var __getOwnPropNames = Object.getOwnPropertyNames;
var __commonJS = (cb, mod) => function __require() {
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
};
var require_assets = __commonJS({
  "assets/index.js"(exports) {
    function _mergeNamespaces(n, m) {
      for (var i2 = 0; i2 < m.length; i2++) {
        const e = m[i2];
        if (typeof e !== "string" && !Array.isArray(e)) {
          for (const k2 in e) {
            if (k2 !== "default" && !(k2 in n)) {
              const d = Object.getOwnPropertyDescriptor(e, k2);
              if (d) {
                Object.defineProperty(n, k2, d.get ? d : {
                  enumerable: true,
                  get: () => e[k2]
                });
              }
            }
          }
        }
      }
      return Object.freeze(Object.defineProperty(n, Symbol.toStringTag, { value: "Module" }));
    }
    (function polyfill() {
      const relList = document.createElement("link").relList;
      if (relList && relList.supports && relList.supports("modulepreload")) return;
      for (const link2 of document.querySelectorAll('link[rel="modulepreload"]')) processPreload(link2);
      new MutationObserver((mutations) => {
        for (const mutation of mutations) {
          if (mutation.type !== "childList") continue;
          for (const node2 of mutation.addedNodes) if (node2.tagName === "LINK" && node2.rel === "modulepreload") processPreload(node2);
        }
      }).observe(document, {
        childList: true,
        subtree: true
      });
      function getFetchOpts(link2) {
        const fetchOpts = {};
        if (link2.integrity) fetchOpts.integrity = link2.integrity;
        if (link2.referrerPolicy) fetchOpts.referrerPolicy = link2.referrerPolicy;
        if (link2.crossOrigin === "use-credentials") fetchOpts.credentials = "include";
        else if (link2.crossOrigin === "anonymous") fetchOpts.credentials = "omit";
        else fetchOpts.credentials = "same-origin";
        return fetchOpts;
      }
      function processPreload(link2) {
        if (link2.ep) return;
        link2.ep = true;
        const fetchOpts = getFetchOpts(link2);
        fetch(link2.href, fetchOpts);
      }
    })();
    var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
    function getDefaultExportFromCjs(x2) {
      return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2["default"] : x2;
    }
    function getAugmentedNamespace(n) {
      if (Object.prototype.hasOwnProperty.call(n, "__esModule")) return n;
      var f = n.default;
      if (typeof f == "function") {
        var a = function a2() {
          var isInstance = false;
          try {
            isInstance = this instanceof a2;
          } catch {
          }
          if (isInstance) {
            return Reflect.construct(f, arguments, this.constructor);
          }
          return f.apply(this, arguments);
        };
        a.prototype = f.prototype;
      } else a = {};
      Object.defineProperty(a, "__esModule", { value: true });
      Object.keys(n).forEach(function(k2) {
        var d = Object.getOwnPropertyDescriptor(n, k2);
        Object.defineProperty(a, k2, d.get ? d : {
          enumerable: true,
          get: function() {
            return n[k2];
          }
        });
      });
      return a;
    }
    var jsxRuntime = { exports: {} };
    var reactJsxRuntime_production = {};
    var hasRequiredReactJsxRuntime_production;
    function requireReactJsxRuntime_production() {
      if (hasRequiredReactJsxRuntime_production) return reactJsxRuntime_production;
      hasRequiredReactJsxRuntime_production = 1;
      var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
      function jsxProd(type, config2, maybeKey) {
        var key2 = null;
        void 0 !== maybeKey && (key2 = "" + maybeKey);
        void 0 !== config2.key && (key2 = "" + config2.key);
        if ("key" in config2) {
          maybeKey = {};
          for (var propName in config2)
            "key" !== propName && (maybeKey[propName] = config2[propName]);
        } else maybeKey = config2;
        config2 = maybeKey.ref;
        return {
          $$typeof: REACT_ELEMENT_TYPE,
          type,
          key: key2,
          ref: void 0 !== config2 ? config2 : null,
          props: maybeKey
        };
      }
      reactJsxRuntime_production.Fragment = REACT_FRAGMENT_TYPE;
      reactJsxRuntime_production.jsx = jsxProd;
      reactJsxRuntime_production.jsxs = jsxProd;
      return reactJsxRuntime_production;
    }
    var hasRequiredJsxRuntime;
    function requireJsxRuntime() {
      if (hasRequiredJsxRuntime) return jsxRuntime.exports;
      hasRequiredJsxRuntime = 1;
      {
        jsxRuntime.exports = requireReactJsxRuntime_production();
      }
      return jsxRuntime.exports;
    }
    var jsxRuntimeExports = requireJsxRuntime();
    var client$1 = { exports: {} };
    var reactDomClient_production = {};
    var scheduler = { exports: {} };
    var scheduler_production = {};
    var hasRequiredScheduler_production;
    function requireScheduler_production() {
      if (hasRequiredScheduler_production) return scheduler_production;
      hasRequiredScheduler_production = 1;
      (function(exports2) {
        function push2(heap2, node2) {
          var index = heap2.length;
          heap2.push(node2);
          a: for (; 0 < index; ) {
            var parentIndex = index - 1 >>> 1, parent = heap2[parentIndex];
            if (0 < compare2(parent, node2))
              heap2[parentIndex] = node2, heap2[index] = parent, index = parentIndex;
            else break a;
          }
        }
        function peek2(heap2) {
          return 0 === heap2.length ? null : heap2[0];
        }
        function pop2(heap2) {
          if (0 === heap2.length) return null;
          var first = heap2[0], last = heap2.pop();
          if (last !== first) {
            heap2[0] = last;
            a: for (var index = 0, length = heap2.length, halfLength = length >>> 1; index < halfLength; ) {
              var leftIndex = 2 * (index + 1) - 1, left2 = heap2[leftIndex], rightIndex = leftIndex + 1, right2 = heap2[rightIndex];
              if (0 > compare2(left2, last))
                rightIndex < length && 0 > compare2(right2, left2) ? (heap2[index] = right2, heap2[rightIndex] = last, index = rightIndex) : (heap2[index] = left2, heap2[leftIndex] = last, index = leftIndex);
              else if (rightIndex < length && 0 > compare2(right2, last))
                heap2[index] = right2, heap2[rightIndex] = last, index = rightIndex;
              else break a;
            }
          }
          return first;
        }
        function compare2(a, b) {
          var diff2 = a.sortIndex - b.sortIndex;
          return 0 !== diff2 ? diff2 : a.id - b.id;
        }
        exports2.unstable_now = void 0;
        if ("object" === typeof performance && "function" === typeof performance.now) {
          var localPerformance = performance;
          exports2.unstable_now = function() {
            return localPerformance.now();
          };
        } else {
          var localDate = Date, initialTime = localDate.now();
          exports2.unstable_now = function() {
            return localDate.now() - initialTime;
          };
        }
        var taskQueue = [], timerQueue = [], taskIdCounter = 1, currentTask = null, currentPriorityLevel = 3, isPerformingWork = false, isHostCallbackScheduled = false, isHostTimeoutScheduled = false, needsPaint = false, localSetTimeout = "function" === typeof setTimeout ? setTimeout : null, localClearTimeout = "function" === typeof clearTimeout ? clearTimeout : null, localSetImmediate = "undefined" !== typeof setImmediate ? setImmediate : null;
        function advanceTimers(currentTime) {
          for (var timer = peek2(timerQueue); null !== timer; ) {
            if (null === timer.callback) pop2(timerQueue);
            else if (timer.startTime <= currentTime)
              pop2(timerQueue), timer.sortIndex = timer.expirationTime, push2(taskQueue, timer);
            else break;
            timer = peek2(timerQueue);
          }
        }
        function handleTimeout(currentTime) {
          isHostTimeoutScheduled = false;
          advanceTimers(currentTime);
          if (!isHostCallbackScheduled)
            if (null !== peek2(taskQueue))
              isHostCallbackScheduled = true, isMessageLoopRunning || (isMessageLoopRunning = true, schedulePerformWorkUntilDeadline());
            else {
              var firstTimer = peek2(timerQueue);
              null !== firstTimer && requestHostTimeout(handleTimeout, firstTimer.startTime - currentTime);
            }
        }
        var isMessageLoopRunning = false, taskTimeoutID = -1, frameInterval = 5, startTime = -1;
        function shouldYieldToHost() {
          return needsPaint ? true : exports2.unstable_now() - startTime < frameInterval ? false : true;
        }
        function performWorkUntilDeadline() {
          needsPaint = false;
          if (isMessageLoopRunning) {
            var currentTime = exports2.unstable_now();
            startTime = currentTime;
            var hasMoreWork = true;
            try {
              a: {
                isHostCallbackScheduled = false;
                isHostTimeoutScheduled && (isHostTimeoutScheduled = false, localClearTimeout(taskTimeoutID), taskTimeoutID = -1);
                isPerformingWork = true;
                var previousPriorityLevel = currentPriorityLevel;
                try {
                  b: {
                    advanceTimers(currentTime);
                    for (currentTask = peek2(taskQueue); null !== currentTask && !(currentTask.expirationTime > currentTime && shouldYieldToHost()); ) {
                      var callback = currentTask.callback;
                      if ("function" === typeof callback) {
                        currentTask.callback = null;
                        currentPriorityLevel = currentTask.priorityLevel;
                        var continuationCallback = callback(
                          currentTask.expirationTime <= currentTime
                        );
                        currentTime = exports2.unstable_now();
                        if ("function" === typeof continuationCallback) {
                          currentTask.callback = continuationCallback;
                          advanceTimers(currentTime);
                          hasMoreWork = true;
                          break b;
                        }
                        currentTask === peek2(taskQueue) && pop2(taskQueue);
                        advanceTimers(currentTime);
                      } else pop2(taskQueue);
                      currentTask = peek2(taskQueue);
                    }
                    if (null !== currentTask) hasMoreWork = true;
                    else {
                      var firstTimer = peek2(timerQueue);
                      null !== firstTimer && requestHostTimeout(
                        handleTimeout,
                        firstTimer.startTime - currentTime
                      );
                      hasMoreWork = false;
                    }
                  }
                  break a;
                } finally {
                  currentTask = null, currentPriorityLevel = previousPriorityLevel, isPerformingWork = false;
                }
                hasMoreWork = void 0;
              }
            } finally {
              hasMoreWork ? schedulePerformWorkUntilDeadline() : isMessageLoopRunning = false;
            }
          }
        }
        var schedulePerformWorkUntilDeadline;
        if ("function" === typeof localSetImmediate)
          schedulePerformWorkUntilDeadline = function() {
            localSetImmediate(performWorkUntilDeadline);
          };
        else if ("undefined" !== typeof MessageChannel) {
          var channel = new MessageChannel(), port = channel.port2;
          channel.port1.onmessage = performWorkUntilDeadline;
          schedulePerformWorkUntilDeadline = function() {
            port.postMessage(null);
          };
        } else
          schedulePerformWorkUntilDeadline = function() {
            localSetTimeout(performWorkUntilDeadline, 0);
          };
        function requestHostTimeout(callback, ms2) {
          taskTimeoutID = localSetTimeout(function() {
            callback(exports2.unstable_now());
          }, ms2);
        }
        exports2.unstable_IdlePriority = 5;
        exports2.unstable_ImmediatePriority = 1;
        exports2.unstable_LowPriority = 4;
        exports2.unstable_NormalPriority = 3;
        exports2.unstable_Profiling = null;
        exports2.unstable_UserBlockingPriority = 2;
        exports2.unstable_cancelCallback = function(task) {
          task.callback = null;
        };
        exports2.unstable_forceFrameRate = function(fps) {
          0 > fps || 125 < fps ? console.error(
            "forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"
          ) : frameInterval = 0 < fps ? Math.floor(1e3 / fps) : 5;
        };
        exports2.unstable_getCurrentPriorityLevel = function() {
          return currentPriorityLevel;
        };
        exports2.unstable_next = function(eventHandler2) {
          switch (currentPriorityLevel) {
            case 1:
            case 2:
            case 3:
              var priorityLevel = 3;
              break;
            default:
              priorityLevel = currentPriorityLevel;
          }
          var previousPriorityLevel = currentPriorityLevel;
          currentPriorityLevel = priorityLevel;
          try {
            return eventHandler2();
          } finally {
            currentPriorityLevel = previousPriorityLevel;
          }
        };
        exports2.unstable_requestPaint = function() {
          needsPaint = true;
        };
        exports2.unstable_runWithPriority = function(priorityLevel, eventHandler2) {
          switch (priorityLevel) {
            case 1:
            case 2:
            case 3:
            case 4:
            case 5:
              break;
            default:
              priorityLevel = 3;
          }
          var previousPriorityLevel = currentPriorityLevel;
          currentPriorityLevel = priorityLevel;
          try {
            return eventHandler2();
          } finally {
            currentPriorityLevel = previousPriorityLevel;
          }
        };
        exports2.unstable_scheduleCallback = function(priorityLevel, callback, options2) {
          var currentTime = exports2.unstable_now();
          "object" === typeof options2 && null !== options2 ? (options2 = options2.delay, options2 = "number" === typeof options2 && 0 < options2 ? currentTime + options2 : currentTime) : options2 = currentTime;
          switch (priorityLevel) {
            case 1:
              var timeout = -1;
              break;
            case 2:
              timeout = 250;
              break;
            case 5:
              timeout = 1073741823;
              break;
            case 4:
              timeout = 1e4;
              break;
            default:
              timeout = 5e3;
          }
          timeout = options2 + timeout;
          priorityLevel = {
            id: taskIdCounter++,
            callback,
            priorityLevel,
            startTime: options2,
            expirationTime: timeout,
            sortIndex: -1
          };
          options2 > currentTime ? (priorityLevel.sortIndex = options2, push2(timerQueue, priorityLevel), null === peek2(taskQueue) && priorityLevel === peek2(timerQueue) && (isHostTimeoutScheduled ? (localClearTimeout(taskTimeoutID), taskTimeoutID = -1) : isHostTimeoutScheduled = true, requestHostTimeout(handleTimeout, options2 - currentTime))) : (priorityLevel.sortIndex = timeout, push2(taskQueue, priorityLevel), isHostCallbackScheduled || isPerformingWork || (isHostCallbackScheduled = true, isMessageLoopRunning || (isMessageLoopRunning = true, schedulePerformWorkUntilDeadline())));
          return priorityLevel;
        };
        exports2.unstable_shouldYield = shouldYieldToHost;
        exports2.unstable_wrapCallback = function(callback) {
          var parentPriorityLevel = currentPriorityLevel;
          return function() {
            var previousPriorityLevel = currentPriorityLevel;
            currentPriorityLevel = parentPriorityLevel;
            try {
              return callback.apply(this, arguments);
            } finally {
              currentPriorityLevel = previousPriorityLevel;
            }
          };
        };
      })(scheduler_production);
      return scheduler_production;
    }
    var hasRequiredScheduler;
    function requireScheduler() {
      if (hasRequiredScheduler) return scheduler.exports;
      hasRequiredScheduler = 1;
      {
        scheduler.exports = requireScheduler_production();
      }
      return scheduler.exports;
    }
    var react = { exports: {} };
    var react_production = {};
    var hasRequiredReact_production;
    function requireReact_production() {
      if (hasRequiredReact_production) return react_production;
      hasRequiredReact_production = 1;
      var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = Symbol.for("react.profiler"), REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), REACT_ACTIVITY_TYPE = Symbol.for("react.activity"), MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
      function getIteratorFn(maybeIterable) {
        if (null === maybeIterable || "object" !== typeof maybeIterable) return null;
        maybeIterable = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable["@@iterator"];
        return "function" === typeof maybeIterable ? maybeIterable : null;
      }
      var ReactNoopUpdateQueue = {
        isMounted: function() {
          return false;
        },
        enqueueForceUpdate: function() {
        },
        enqueueReplaceState: function() {
        },
        enqueueSetState: function() {
        }
      }, assign2 = Object.assign, emptyObject = {};
      function Component2(props, context, updater) {
        this.props = props;
        this.context = context;
        this.refs = emptyObject;
        this.updater = updater || ReactNoopUpdateQueue;
      }
      Component2.prototype.isReactComponent = {};
      Component2.prototype.setState = function(partialState, callback) {
        if ("object" !== typeof partialState && "function" !== typeof partialState && null != partialState)
          throw Error(
            "takes an object of state variables to update or a function which returns an object of state variables."
          );
        this.updater.enqueueSetState(this, partialState, callback, "setState");
      };
      Component2.prototype.forceUpdate = function(callback) {
        this.updater.enqueueForceUpdate(this, callback, "forceUpdate");
      };
      function ComponentDummy() {
      }
      ComponentDummy.prototype = Component2.prototype;
      function PureComponent(props, context, updater) {
        this.props = props;
        this.context = context;
        this.refs = emptyObject;
        this.updater = updater || ReactNoopUpdateQueue;
      }
      var pureComponentPrototype = PureComponent.prototype = new ComponentDummy();
      pureComponentPrototype.constructor = PureComponent;
      assign2(pureComponentPrototype, Component2.prototype);
      pureComponentPrototype.isPureReactComponent = true;
      var isArrayImpl = Array.isArray;
      function noop2() {
      }
      var ReactSharedInternals = { H: null, A: null, T: null, S: null }, hasOwnProperty2 = Object.prototype.hasOwnProperty;
      function ReactElement(type, key2, props) {
        var refProp = props.ref;
        return {
          $$typeof: REACT_ELEMENT_TYPE,
          type,
          key: key2,
          ref: void 0 !== refProp ? refProp : null,
          props
        };
      }
      function cloneAndReplaceKey(oldElement, newKey) {
        return ReactElement(oldElement.type, newKey, oldElement.props);
      }
      function isValidElement(object) {
        return "object" === typeof object && null !== object && object.$$typeof === REACT_ELEMENT_TYPE;
      }
      function escape2(key2) {
        var escaperLookup = { "=": "=0", ":": "=2" };
        return "$" + key2.replace(/[=:]/g, function(match) {
          return escaperLookup[match];
        });
      }
      var userProvidedKeyEscapeRegex = /\/+/g;
      function getElementKey(element, index) {
        return "object" === typeof element && null !== element && null != element.key ? escape2("" + element.key) : index.toString(36);
      }
      function resolveThenable(thenable) {
        switch (thenable.status) {
          case "fulfilled":
            return thenable.value;
          case "rejected":
            throw thenable.reason;
          default:
            switch ("string" === typeof thenable.status ? thenable.then(noop2, noop2) : (thenable.status = "pending", thenable.then(
              function(fulfilledValue) {
                "pending" === thenable.status && (thenable.status = "fulfilled", thenable.value = fulfilledValue);
              },
              function(error2) {
                "pending" === thenable.status && (thenable.status = "rejected", thenable.reason = error2);
              }
            )), thenable.status) {
              case "fulfilled":
                return thenable.value;
              case "rejected":
                throw thenable.reason;
            }
        }
        throw thenable;
      }
      function mapIntoArray(children2, array, escapedPrefix, nameSoFar, callback) {
        var type = typeof children2;
        if ("undefined" === type || "boolean" === type) children2 = null;
        var invokeCallback = false;
        if (null === children2) invokeCallback = true;
        else
          switch (type) {
            case "bigint":
            case "string":
            case "number":
              invokeCallback = true;
              break;
            case "object":
              switch (children2.$$typeof) {
                case REACT_ELEMENT_TYPE:
                case REACT_PORTAL_TYPE:
                  invokeCallback = true;
                  break;
                case REACT_LAZY_TYPE:
                  return invokeCallback = children2._init, mapIntoArray(
                    invokeCallback(children2._payload),
                    array,
                    escapedPrefix,
                    nameSoFar,
                    callback
                  );
              }
          }
        if (invokeCallback)
          return callback = callback(children2), invokeCallback = "" === nameSoFar ? "." + getElementKey(children2, 0) : nameSoFar, isArrayImpl(callback) ? (escapedPrefix = "", null != invokeCallback && (escapedPrefix = invokeCallback.replace(userProvidedKeyEscapeRegex, "$&/") + "/"), mapIntoArray(callback, array, escapedPrefix, "", function(c2) {
            return c2;
          })) : null != callback && (isValidElement(callback) && (callback = cloneAndReplaceKey(
            callback,
            escapedPrefix + (null == callback.key || children2 && children2.key === callback.key ? "" : ("" + callback.key).replace(
              userProvidedKeyEscapeRegex,
              "$&/"
            ) + "/") + invokeCallback
          )), array.push(callback)), 1;
        invokeCallback = 0;
        var nextNamePrefix = "" === nameSoFar ? "." : nameSoFar + ":";
        if (isArrayImpl(children2))
          for (var i2 = 0; i2 < children2.length; i2++)
            nameSoFar = children2[i2], type = nextNamePrefix + getElementKey(nameSoFar, i2), invokeCallback += mapIntoArray(
              nameSoFar,
              array,
              escapedPrefix,
              type,
              callback
            );
        else if (i2 = getIteratorFn(children2), "function" === typeof i2)
          for (children2 = i2.call(children2), i2 = 0; !(nameSoFar = children2.next()).done; )
            nameSoFar = nameSoFar.value, type = nextNamePrefix + getElementKey(nameSoFar, i2++), invokeCallback += mapIntoArray(
              nameSoFar,
              array,
              escapedPrefix,
              type,
              callback
            );
        else if ("object" === type) {
          if ("function" === typeof children2.then)
            return mapIntoArray(
              resolveThenable(children2),
              array,
              escapedPrefix,
              nameSoFar,
              callback
            );
          array = String(children2);
          throw Error(
            "Objects are not valid as a React child (found: " + ("[object Object]" === array ? "object with keys {" + Object.keys(children2).join(", ") + "}" : array) + "). If you meant to render a collection of children, use an array instead."
          );
        }
        return invokeCallback;
      }
      function mapChildren(children2, func, context) {
        if (null == children2) return children2;
        var result2 = [], count = 0;
        mapIntoArray(children2, result2, "", "", function(child) {
          return func.call(context, child, count++);
        });
        return result2;
      }
      function lazyInitializer(payload) {
        if (-1 === payload._status) {
          var ctor = payload._result;
          ctor = ctor();
          ctor.then(
            function(moduleObject) {
              if (0 === payload._status || -1 === payload._status)
                payload._status = 1, payload._result = moduleObject;
            },
            function(error2) {
              if (0 === payload._status || -1 === payload._status)
                payload._status = 2, payload._result = error2;
            }
          );
          -1 === payload._status && (payload._status = 0, payload._result = ctor);
        }
        if (1 === payload._status) return payload._result.default;
        throw payload._result;
      }
      var reportGlobalError = "function" === typeof reportError ? reportError : function(error2) {
        if ("object" === typeof window && "function" === typeof window.ErrorEvent) {
          var event = new window.ErrorEvent("error", {
            bubbles: true,
            cancelable: true,
            message: "object" === typeof error2 && null !== error2 && "string" === typeof error2.message ? String(error2.message) : String(error2),
            error: error2
          });
          if (!window.dispatchEvent(event)) return;
        } else if ("object" === typeof process && "function" === typeof process.emit) {
          process.emit("uncaughtException", error2);
          return;
        }
        console.error(error2);
      }, Children = {
        map: mapChildren,
        forEach: function(children2, forEachFunc, forEachContext) {
          mapChildren(
            children2,
            function() {
              forEachFunc.apply(this, arguments);
            },
            forEachContext
          );
        },
        count: function(children2) {
          var n = 0;
          mapChildren(children2, function() {
            n++;
          });
          return n;
        },
        toArray: function(children2) {
          return mapChildren(children2, function(child) {
            return child;
          }) || [];
        },
        only: function(children2) {
          if (!isValidElement(children2))
            throw Error(
              "React.Children.only expected to receive a single React element child."
            );
          return children2;
        }
      };
      react_production.Activity = REACT_ACTIVITY_TYPE;
      react_production.Children = Children;
      react_production.Component = Component2;
      react_production.Fragment = REACT_FRAGMENT_TYPE;
      react_production.Profiler = REACT_PROFILER_TYPE;
      react_production.PureComponent = PureComponent;
      react_production.StrictMode = REACT_STRICT_MODE_TYPE;
      react_production.Suspense = REACT_SUSPENSE_TYPE;
      react_production.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = ReactSharedInternals;
      react_production.__COMPILER_RUNTIME = {
        __proto__: null,
        c: function(size) {
          return ReactSharedInternals.H.useMemoCache(size);
        }
      };
      react_production.cache = function(fn2) {
        return function() {
          return fn2.apply(null, arguments);
        };
      };
      react_production.cacheSignal = function() {
        return null;
      };
      react_production.cloneElement = function(element, config2, children2) {
        if (null === element || void 0 === element)
          throw Error(
            "The argument must be a React element, but you passed " + element + "."
          );
        var props = assign2({}, element.props), key2 = element.key;
        if (null != config2)
          for (propName in void 0 !== config2.key && (key2 = "" + config2.key), config2)
            !hasOwnProperty2.call(config2, propName) || "key" === propName || "__self" === propName || "__source" === propName || "ref" === propName && void 0 === config2.ref || (props[propName] = config2[propName]);
        var propName = arguments.length - 2;
        if (1 === propName) props.children = children2;
        else if (1 < propName) {
          for (var childArray = Array(propName), i2 = 0; i2 < propName; i2++)
            childArray[i2] = arguments[i2 + 2];
          props.children = childArray;
        }
        return ReactElement(element.type, key2, props);
      };
      react_production.createContext = function(defaultValue) {
        defaultValue = {
          $$typeof: REACT_CONTEXT_TYPE,
          _currentValue: defaultValue,
          _currentValue2: defaultValue,
          _threadCount: 0,
          Provider: null,
          Consumer: null
        };
        defaultValue.Provider = defaultValue;
        defaultValue.Consumer = {
          $$typeof: REACT_CONSUMER_TYPE,
          _context: defaultValue
        };
        return defaultValue;
      };
      react_production.createElement = function(type, config2, children2) {
        var propName, props = {}, key2 = null;
        if (null != config2)
          for (propName in void 0 !== config2.key && (key2 = "" + config2.key), config2)
            hasOwnProperty2.call(config2, propName) && "key" !== propName && "__self" !== propName && "__source" !== propName && (props[propName] = config2[propName]);
        var childrenLength = arguments.length - 2;
        if (1 === childrenLength) props.children = children2;
        else if (1 < childrenLength) {
          for (var childArray = Array(childrenLength), i2 = 0; i2 < childrenLength; i2++)
            childArray[i2] = arguments[i2 + 2];
          props.children = childArray;
        }
        if (type && type.defaultProps)
          for (propName in childrenLength = type.defaultProps, childrenLength)
            void 0 === props[propName] && (props[propName] = childrenLength[propName]);
        return ReactElement(type, key2, props);
      };
      react_production.createRef = function() {
        return { current: null };
      };
      react_production.forwardRef = function(render2) {
        return { $$typeof: REACT_FORWARD_REF_TYPE, render: render2 };
      };
      react_production.isValidElement = isValidElement;
      react_production.lazy = function(ctor) {
        return {
          $$typeof: REACT_LAZY_TYPE,
          _payload: { _status: -1, _result: ctor },
          _init: lazyInitializer
        };
      };
      react_production.memo = function(type, compare2) {
        return {
          $$typeof: REACT_MEMO_TYPE,
          type,
          compare: void 0 === compare2 ? null : compare2
        };
      };
      react_production.startTransition = function(scope) {
        var prevTransition = ReactSharedInternals.T, currentTransition = {};
        ReactSharedInternals.T = currentTransition;
        try {
          var returnValue = scope(), onStartTransitionFinish = ReactSharedInternals.S;
          null !== onStartTransitionFinish && onStartTransitionFinish(currentTransition, returnValue);
          "object" === typeof returnValue && null !== returnValue && "function" === typeof returnValue.then && returnValue.then(noop2, reportGlobalError);
        } catch (error2) {
          reportGlobalError(error2);
        } finally {
          null !== prevTransition && null !== currentTransition.types && (prevTransition.types = currentTransition.types), ReactSharedInternals.T = prevTransition;
        }
      };
      react_production.unstable_useCacheRefresh = function() {
        return ReactSharedInternals.H.useCacheRefresh();
      };
      react_production.use = function(usable) {
        return ReactSharedInternals.H.use(usable);
      };
      react_production.useActionState = function(action, initialState2, permalink) {
        return ReactSharedInternals.H.useActionState(action, initialState2, permalink);
      };
      react_production.useCallback = function(callback, deps) {
        return ReactSharedInternals.H.useCallback(callback, deps);
      };
      react_production.useContext = function(Context2) {
        return ReactSharedInternals.H.useContext(Context2);
      };
      react_production.useDebugValue = function() {
      };
      react_production.useDeferredValue = function(value2, initialValue) {
        return ReactSharedInternals.H.useDeferredValue(value2, initialValue);
      };
      react_production.useEffect = function(create2, deps) {
        return ReactSharedInternals.H.useEffect(create2, deps);
      };
      react_production.useEffectEvent = function(callback) {
        return ReactSharedInternals.H.useEffectEvent(callback);
      };
      react_production.useId = function() {
        return ReactSharedInternals.H.useId();
      };
      react_production.useImperativeHandle = function(ref, create2, deps) {
        return ReactSharedInternals.H.useImperativeHandle(ref, create2, deps);
      };
      react_production.useInsertionEffect = function(create2, deps) {
        return ReactSharedInternals.H.useInsertionEffect(create2, deps);
      };
      react_production.useLayoutEffect = function(create2, deps) {
        return ReactSharedInternals.H.useLayoutEffect(create2, deps);
      };
      react_production.useMemo = function(create2, deps) {
        return ReactSharedInternals.H.useMemo(create2, deps);
      };
      react_production.useOptimistic = function(passthrough, reducer) {
        return ReactSharedInternals.H.useOptimistic(passthrough, reducer);
      };
      react_production.useReducer = function(reducer, initialArg, init2) {
        return ReactSharedInternals.H.useReducer(reducer, initialArg, init2);
      };
      react_production.useRef = function(initialValue) {
        return ReactSharedInternals.H.useRef(initialValue);
      };
      react_production.useState = function(initialState2) {
        return ReactSharedInternals.H.useState(initialState2);
      };
      react_production.useSyncExternalStore = function(subscribe, getSnapshot, getServerSnapshot) {
        return ReactSharedInternals.H.useSyncExternalStore(
          subscribe,
          getSnapshot,
          getServerSnapshot
        );
      };
      react_production.useTransition = function() {
        return ReactSharedInternals.H.useTransition();
      };
      react_production.version = "19.2.3";
      return react_production;
    }
    var hasRequiredReact;
    function requireReact() {
      if (hasRequiredReact) return react.exports;
      hasRequiredReact = 1;
      {
        react.exports = requireReact_production();
      }
      return react.exports;
    }
    var reactDom = { exports: {} };
    var reactDom_production = {};
    var hasRequiredReactDom_production;
    function requireReactDom_production() {
      if (hasRequiredReactDom_production) return reactDom_production;
      hasRequiredReactDom_production = 1;
      var React = requireReact();
      function formatProdErrorMessage(code2) {
        var url = "https://react.dev/errors/" + code2;
        if (1 < arguments.length) {
          url += "?args[]=" + encodeURIComponent(arguments[1]);
          for (var i2 = 2; i2 < arguments.length; i2++)
            url += "&args[]=" + encodeURIComponent(arguments[i2]);
        }
        return "Minified React error #" + code2 + "; visit " + url + " for the full message or use the non-minified dev environment for full errors and additional helpful warnings.";
      }
      function noop2() {
      }
      var Internals = {
        d: {
          f: noop2,
          r: function() {
            throw Error(formatProdErrorMessage(522));
          },
          D: noop2,
          C: noop2,
          L: noop2,
          m: noop2,
          X: noop2,
          S: noop2,
          M: noop2
        },
        p: 0,
        findDOMNode: null
      }, REACT_PORTAL_TYPE = Symbol.for("react.portal");
      function createPortal$1(children2, containerInfo, implementation) {
        var key2 = 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : null;
        return {
          $$typeof: REACT_PORTAL_TYPE,
          key: null == key2 ? null : "" + key2,
          children: children2,
          containerInfo,
          implementation
        };
      }
      var ReactSharedInternals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
      function getCrossOriginStringAs(as, input2) {
        if ("font" === as) return "";
        if ("string" === typeof input2)
          return "use-credentials" === input2 ? input2 : "";
      }
      reactDom_production.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = Internals;
      reactDom_production.createPortal = function(children2, container2) {
        var key2 = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : null;
        if (!container2 || 1 !== container2.nodeType && 9 !== container2.nodeType && 11 !== container2.nodeType)
          throw Error(formatProdErrorMessage(299));
        return createPortal$1(children2, container2, null, key2);
      };
      reactDom_production.flushSync = function(fn2) {
        var previousTransition = ReactSharedInternals.T, previousUpdatePriority = Internals.p;
        try {
          if (ReactSharedInternals.T = null, Internals.p = 2, fn2) return fn2();
        } finally {
          ReactSharedInternals.T = previousTransition, Internals.p = previousUpdatePriority, Internals.d.f();
        }
      };
      reactDom_production.preconnect = function(href, options2) {
        "string" === typeof href && (options2 ? (options2 = options2.crossOrigin, options2 = "string" === typeof options2 ? "use-credentials" === options2 ? options2 : "" : void 0) : options2 = null, Internals.d.C(href, options2));
      };
      reactDom_production.prefetchDNS = function(href) {
        "string" === typeof href && Internals.d.D(href);
      };
      reactDom_production.preinit = function(href, options2) {
        if ("string" === typeof href && options2 && "string" === typeof options2.as) {
          var as = options2.as, crossOrigin = getCrossOriginStringAs(as, options2.crossOrigin), integrity = "string" === typeof options2.integrity ? options2.integrity : void 0, fetchPriority = "string" === typeof options2.fetchPriority ? options2.fetchPriority : void 0;
          "style" === as ? Internals.d.S(
            href,
            "string" === typeof options2.precedence ? options2.precedence : void 0,
            {
              crossOrigin,
              integrity,
              fetchPriority
            }
          ) : "script" === as && Internals.d.X(href, {
            crossOrigin,
            integrity,
            fetchPriority,
            nonce: "string" === typeof options2.nonce ? options2.nonce : void 0
          });
        }
      };
      reactDom_production.preinitModule = function(href, options2) {
        if ("string" === typeof href)
          if ("object" === typeof options2 && null !== options2) {
            if (null == options2.as || "script" === options2.as) {
              var crossOrigin = getCrossOriginStringAs(
                options2.as,
                options2.crossOrigin
              );
              Internals.d.M(href, {
                crossOrigin,
                integrity: "string" === typeof options2.integrity ? options2.integrity : void 0,
                nonce: "string" === typeof options2.nonce ? options2.nonce : void 0
              });
            }
          } else null == options2 && Internals.d.M(href);
      };
      reactDom_production.preload = function(href, options2) {
        if ("string" === typeof href && "object" === typeof options2 && null !== options2 && "string" === typeof options2.as) {
          var as = options2.as, crossOrigin = getCrossOriginStringAs(as, options2.crossOrigin);
          Internals.d.L(href, as, {
            crossOrigin,
            integrity: "string" === typeof options2.integrity ? options2.integrity : void 0,
            nonce: "string" === typeof options2.nonce ? options2.nonce : void 0,
            type: "string" === typeof options2.type ? options2.type : void 0,
            fetchPriority: "string" === typeof options2.fetchPriority ? options2.fetchPriority : void 0,
            referrerPolicy: "string" === typeof options2.referrerPolicy ? options2.referrerPolicy : void 0,
            imageSrcSet: "string" === typeof options2.imageSrcSet ? options2.imageSrcSet : void 0,
            imageSizes: "string" === typeof options2.imageSizes ? options2.imageSizes : void 0,
            media: "string" === typeof options2.media ? options2.media : void 0
          });
        }
      };
      reactDom_production.preloadModule = function(href, options2) {
        if ("string" === typeof href)
          if (options2) {
            var crossOrigin = getCrossOriginStringAs(options2.as, options2.crossOrigin);
            Internals.d.m(href, {
              as: "string" === typeof options2.as && "script" !== options2.as ? options2.as : void 0,
              crossOrigin,
              integrity: "string" === typeof options2.integrity ? options2.integrity : void 0
            });
          } else Internals.d.m(href);
      };
      reactDom_production.requestFormReset = function(form) {
        Internals.d.r(form);
      };
      reactDom_production.unstable_batchedUpdates = function(fn2, a) {
        return fn2(a);
      };
      reactDom_production.useFormState = function(action, initialState2, permalink) {
        return ReactSharedInternals.H.useFormState(action, initialState2, permalink);
      };
      reactDom_production.useFormStatus = function() {
        return ReactSharedInternals.H.useHostTransitionStatus();
      };
      reactDom_production.version = "19.2.3";
      return reactDom_production;
    }
    var hasRequiredReactDom;
    function requireReactDom() {
      if (hasRequiredReactDom) return reactDom.exports;
      hasRequiredReactDom = 1;
      function checkDCE() {
        if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === "undefined" || typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE !== "function") {
          return;
        }
        try {
          __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE);
        } catch (err2) {
          console.error(err2);
        }
      }
      {
        checkDCE();
        reactDom.exports = requireReactDom_production();
      }
      return reactDom.exports;
    }
    var hasRequiredReactDomClient_production;
    function requireReactDomClient_production() {
      if (hasRequiredReactDomClient_production) return reactDomClient_production;
      hasRequiredReactDomClient_production = 1;
      var Scheduler = requireScheduler(), React = requireReact(), ReactDOM2 = requireReactDom();
      function formatProdErrorMessage(code2) {
        var url = "https://react.dev/errors/" + code2;
        if (1 < arguments.length) {
          url += "?args[]=" + encodeURIComponent(arguments[1]);
          for (var i2 = 2; i2 < arguments.length; i2++)
            url += "&args[]=" + encodeURIComponent(arguments[i2]);
        }
        return "Minified React error #" + code2 + "; visit " + url + " for the full message or use the non-minified dev environment for full errors and additional helpful warnings.";
      }
      function isValidContainer(node2) {
        return !(!node2 || 1 !== node2.nodeType && 9 !== node2.nodeType && 11 !== node2.nodeType);
      }
      function getNearestMountedFiber(fiber) {
        var node2 = fiber, nearestMounted = fiber;
        if (fiber.alternate) for (; node2.return; ) node2 = node2.return;
        else {
          fiber = node2;
          do
            node2 = fiber, 0 !== (node2.flags & 4098) && (nearestMounted = node2.return), fiber = node2.return;
          while (fiber);
        }
        return 3 === node2.tag ? nearestMounted : null;
      }
      function getSuspenseInstanceFromFiber(fiber) {
        if (13 === fiber.tag) {
          var suspenseState = fiber.memoizedState;
          null === suspenseState && (fiber = fiber.alternate, null !== fiber && (suspenseState = fiber.memoizedState));
          if (null !== suspenseState) return suspenseState.dehydrated;
        }
        return null;
      }
      function getActivityInstanceFromFiber(fiber) {
        if (31 === fiber.tag) {
          var activityState = fiber.memoizedState;
          null === activityState && (fiber = fiber.alternate, null !== fiber && (activityState = fiber.memoizedState));
          if (null !== activityState) return activityState.dehydrated;
        }
        return null;
      }
      function assertIsMounted(fiber) {
        if (getNearestMountedFiber(fiber) !== fiber)
          throw Error(formatProdErrorMessage(188));
      }
      function findCurrentFiberUsingSlowPath(fiber) {
        var alternate = fiber.alternate;
        if (!alternate) {
          alternate = getNearestMountedFiber(fiber);
          if (null === alternate) throw Error(formatProdErrorMessage(188));
          return alternate !== fiber ? null : fiber;
        }
        for (var a = fiber, b = alternate; ; ) {
          var parentA = a.return;
          if (null === parentA) break;
          var parentB = parentA.alternate;
          if (null === parentB) {
            b = parentA.return;
            if (null !== b) {
              a = b;
              continue;
            }
            break;
          }
          if (parentA.child === parentB.child) {
            for (parentB = parentA.child; parentB; ) {
              if (parentB === a) return assertIsMounted(parentA), fiber;
              if (parentB === b) return assertIsMounted(parentA), alternate;
              parentB = parentB.sibling;
            }
            throw Error(formatProdErrorMessage(188));
          }
          if (a.return !== b.return) a = parentA, b = parentB;
          else {
            for (var didFindChild = false, child$0 = parentA.child; child$0; ) {
              if (child$0 === a) {
                didFindChild = true;
                a = parentA;
                b = parentB;
                break;
              }
              if (child$0 === b) {
                didFindChild = true;
                b = parentA;
                a = parentB;
                break;
              }
              child$0 = child$0.sibling;
            }
            if (!didFindChild) {
              for (child$0 = parentB.child; child$0; ) {
                if (child$0 === a) {
                  didFindChild = true;
                  a = parentB;
                  b = parentA;
                  break;
                }
                if (child$0 === b) {
                  didFindChild = true;
                  b = parentB;
                  a = parentA;
                  break;
                }
                child$0 = child$0.sibling;
              }
              if (!didFindChild) throw Error(formatProdErrorMessage(189));
            }
          }
          if (a.alternate !== b) throw Error(formatProdErrorMessage(190));
        }
        if (3 !== a.tag) throw Error(formatProdErrorMessage(188));
        return a.stateNode.current === a ? fiber : alternate;
      }
      function findCurrentHostFiberImpl(node2) {
        var tag = node2.tag;
        if (5 === tag || 26 === tag || 27 === tag || 6 === tag) return node2;
        for (node2 = node2.child; null !== node2; ) {
          tag = findCurrentHostFiberImpl(node2);
          if (null !== tag) return tag;
          node2 = node2.sibling;
        }
        return null;
      }
      var assign2 = Object.assign, REACT_LEGACY_ELEMENT_TYPE = Symbol.for("react.element"), REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = Symbol.for("react.profiler"), REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy");
      var REACT_ACTIVITY_TYPE = Symbol.for("react.activity");
      var REACT_MEMO_CACHE_SENTINEL = Symbol.for("react.memo_cache_sentinel");
      var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
      function getIteratorFn(maybeIterable) {
        if (null === maybeIterable || "object" !== typeof maybeIterable) return null;
        maybeIterable = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable["@@iterator"];
        return "function" === typeof maybeIterable ? maybeIterable : null;
      }
      var REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference");
      function getComponentNameFromType(type) {
        if (null == type) return null;
        if ("function" === typeof type)
          return type.$$typeof === REACT_CLIENT_REFERENCE ? null : type.displayName || type.name || null;
        if ("string" === typeof type) return type;
        switch (type) {
          case REACT_FRAGMENT_TYPE:
            return "Fragment";
          case REACT_PROFILER_TYPE:
            return "Profiler";
          case REACT_STRICT_MODE_TYPE:
            return "StrictMode";
          case REACT_SUSPENSE_TYPE:
            return "Suspense";
          case REACT_SUSPENSE_LIST_TYPE:
            return "SuspenseList";
          case REACT_ACTIVITY_TYPE:
            return "Activity";
        }
        if ("object" === typeof type)
          switch (type.$$typeof) {
            case REACT_PORTAL_TYPE:
              return "Portal";
            case REACT_CONTEXT_TYPE:
              return type.displayName || "Context";
            case REACT_CONSUMER_TYPE:
              return (type._context.displayName || "Context") + ".Consumer";
            case REACT_FORWARD_REF_TYPE:
              var innerType = type.render;
              type = type.displayName;
              type || (type = innerType.displayName || innerType.name || "", type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef");
              return type;
            case REACT_MEMO_TYPE:
              return innerType = type.displayName || null, null !== innerType ? innerType : getComponentNameFromType(type.type) || "Memo";
            case REACT_LAZY_TYPE:
              innerType = type._payload;
              type = type._init;
              try {
                return getComponentNameFromType(type(innerType));
              } catch (x2) {
              }
          }
        return null;
      }
      var isArrayImpl = Array.isArray, ReactSharedInternals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, ReactDOMSharedInternals = ReactDOM2.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, sharedNotPendingObject = {
        pending: false,
        data: null,
        method: null,
        action: null
      }, valueStack = [], index = -1;
      function createCursor(defaultValue) {
        return { current: defaultValue };
      }
      function pop2(cursor) {
        0 > index || (cursor.current = valueStack[index], valueStack[index] = null, index--);
      }
      function push2(cursor, value2) {
        index++;
        valueStack[index] = cursor.current;
        cursor.current = value2;
      }
      var contextStackCursor = createCursor(null), contextFiberStackCursor = createCursor(null), rootInstanceStackCursor = createCursor(null), hostTransitionProviderCursor = createCursor(null);
      function pushHostContainer(fiber, nextRootInstance) {
        push2(rootInstanceStackCursor, nextRootInstance);
        push2(contextFiberStackCursor, fiber);
        push2(contextStackCursor, null);
        switch (nextRootInstance.nodeType) {
          case 9:
          case 11:
            fiber = (fiber = nextRootInstance.documentElement) ? (fiber = fiber.namespaceURI) ? getOwnHostContext(fiber) : 0 : 0;
            break;
          default:
            if (fiber = nextRootInstance.tagName, nextRootInstance = nextRootInstance.namespaceURI)
              nextRootInstance = getOwnHostContext(nextRootInstance), fiber = getChildHostContextProd(nextRootInstance, fiber);
            else
              switch (fiber) {
                case "svg":
                  fiber = 1;
                  break;
                case "math":
                  fiber = 2;
                  break;
                default:
                  fiber = 0;
              }
        }
        pop2(contextStackCursor);
        push2(contextStackCursor, fiber);
      }
      function popHostContainer() {
        pop2(contextStackCursor);
        pop2(contextFiberStackCursor);
        pop2(rootInstanceStackCursor);
      }
      function pushHostContext(fiber) {
        null !== fiber.memoizedState && push2(hostTransitionProviderCursor, fiber);
        var context = contextStackCursor.current;
        var JSCompiler_inline_result = getChildHostContextProd(context, fiber.type);
        context !== JSCompiler_inline_result && (push2(contextFiberStackCursor, fiber), push2(contextStackCursor, JSCompiler_inline_result));
      }
      function popHostContext(fiber) {
        contextFiberStackCursor.current === fiber && (pop2(contextStackCursor), pop2(contextFiberStackCursor));
        hostTransitionProviderCursor.current === fiber && (pop2(hostTransitionProviderCursor), HostTransitionContext._currentValue = sharedNotPendingObject);
      }
      var prefix, suffix;
      function describeBuiltInComponentFrame(name2) {
        if (void 0 === prefix)
          try {
            throw Error();
          } catch (x2) {
            var match = x2.stack.trim().match(/\n( *(at )?)/);
            prefix = match && match[1] || "";
            suffix = -1 < x2.stack.indexOf("\n    at") ? " (<anonymous>)" : -1 < x2.stack.indexOf("@") ? "@unknown:0:0" : "";
          }
        return "\n" + prefix + name2 + suffix;
      }
      var reentry = false;
      function describeNativeComponentFrame(fn2, construct) {
        if (!fn2 || reentry) return "";
        reentry = true;
        var previousPrepareStackTrace = Error.prepareStackTrace;
        Error.prepareStackTrace = void 0;
        try {
          var RunInRootFrame = {
            DetermineComponentFrameRoot: function() {
              try {
                if (construct) {
                  var Fake = function() {
                    throw Error();
                  };
                  Object.defineProperty(Fake.prototype, "props", {
                    set: function() {
                      throw Error();
                    }
                  });
                  if ("object" === typeof Reflect && Reflect.construct) {
                    try {
                      Reflect.construct(Fake, []);
                    } catch (x2) {
                      var control = x2;
                    }
                    Reflect.construct(fn2, [], Fake);
                  } else {
                    try {
                      Fake.call();
                    } catch (x$12) {
                      control = x$12;
                    }
                    fn2.call(Fake.prototype);
                  }
                } else {
                  try {
                    throw Error();
                  } catch (x$2) {
                    control = x$2;
                  }
                  (Fake = fn2()) && "function" === typeof Fake.catch && Fake.catch(function() {
                  });
                }
              } catch (sample2) {
                if (sample2 && control && "string" === typeof sample2.stack)
                  return [sample2.stack, control.stack];
              }
              return [null, null];
            }
          };
          RunInRootFrame.DetermineComponentFrameRoot.displayName = "DetermineComponentFrameRoot";
          var namePropDescriptor = Object.getOwnPropertyDescriptor(
            RunInRootFrame.DetermineComponentFrameRoot,
            "name"
          );
          namePropDescriptor && namePropDescriptor.configurable && Object.defineProperty(
            RunInRootFrame.DetermineComponentFrameRoot,
            "name",
            { value: "DetermineComponentFrameRoot" }
          );
          var _RunInRootFrame$Deter = RunInRootFrame.DetermineComponentFrameRoot(), sampleStack = _RunInRootFrame$Deter[0], controlStack = _RunInRootFrame$Deter[1];
          if (sampleStack && controlStack) {
            var sampleLines = sampleStack.split("\n"), controlLines = controlStack.split("\n");
            for (namePropDescriptor = RunInRootFrame = 0; RunInRootFrame < sampleLines.length && !sampleLines[RunInRootFrame].includes("DetermineComponentFrameRoot"); )
              RunInRootFrame++;
            for (; namePropDescriptor < controlLines.length && !controlLines[namePropDescriptor].includes(
              "DetermineComponentFrameRoot"
            ); )
              namePropDescriptor++;
            if (RunInRootFrame === sampleLines.length || namePropDescriptor === controlLines.length)
              for (RunInRootFrame = sampleLines.length - 1, namePropDescriptor = controlLines.length - 1; 1 <= RunInRootFrame && 0 <= namePropDescriptor && sampleLines[RunInRootFrame] !== controlLines[namePropDescriptor]; )
                namePropDescriptor--;
            for (; 1 <= RunInRootFrame && 0 <= namePropDescriptor; RunInRootFrame--, namePropDescriptor--)
              if (sampleLines[RunInRootFrame] !== controlLines[namePropDescriptor]) {
                if (1 !== RunInRootFrame || 1 !== namePropDescriptor) {
                  do
                    if (RunInRootFrame--, namePropDescriptor--, 0 > namePropDescriptor || sampleLines[RunInRootFrame] !== controlLines[namePropDescriptor]) {
                      var frame = "\n" + sampleLines[RunInRootFrame].replace(" at new ", " at ");
                      fn2.displayName && frame.includes("<anonymous>") && (frame = frame.replace("<anonymous>", fn2.displayName));
                      return frame;
                    }
                  while (1 <= RunInRootFrame && 0 <= namePropDescriptor);
                }
                break;
              }
          }
        } finally {
          reentry = false, Error.prepareStackTrace = previousPrepareStackTrace;
        }
        return (previousPrepareStackTrace = fn2 ? fn2.displayName || fn2.name : "") ? describeBuiltInComponentFrame(previousPrepareStackTrace) : "";
      }
      function describeFiber(fiber, childFiber) {
        switch (fiber.tag) {
          case 26:
          case 27:
          case 5:
            return describeBuiltInComponentFrame(fiber.type);
          case 16:
            return describeBuiltInComponentFrame("Lazy");
          case 13:
            return fiber.child !== childFiber && null !== childFiber ? describeBuiltInComponentFrame("Suspense Fallback") : describeBuiltInComponentFrame("Suspense");
          case 19:
            return describeBuiltInComponentFrame("SuspenseList");
          case 0:
          case 15:
            return describeNativeComponentFrame(fiber.type, false);
          case 11:
            return describeNativeComponentFrame(fiber.type.render, false);
          case 1:
            return describeNativeComponentFrame(fiber.type, true);
          case 31:
            return describeBuiltInComponentFrame("Activity");
          default:
            return "";
        }
      }
      function getStackByFiberInDevAndProd(workInProgress2) {
        try {
          var info = "", previous = null;
          do
            info += describeFiber(workInProgress2, previous), previous = workInProgress2, workInProgress2 = workInProgress2.return;
          while (workInProgress2);
          return info;
        } catch (x2) {
          return "\nError generating stack: " + x2.message + "\n" + x2.stack;
        }
      }
      var hasOwnProperty2 = Object.prototype.hasOwnProperty, scheduleCallback$3 = Scheduler.unstable_scheduleCallback, cancelCallback$1 = Scheduler.unstable_cancelCallback, shouldYield = Scheduler.unstable_shouldYield, requestPaint = Scheduler.unstable_requestPaint, now = Scheduler.unstable_now, getCurrentPriorityLevel = Scheduler.unstable_getCurrentPriorityLevel, ImmediatePriority = Scheduler.unstable_ImmediatePriority, UserBlockingPriority = Scheduler.unstable_UserBlockingPriority, NormalPriority$1 = Scheduler.unstable_NormalPriority, LowPriority = Scheduler.unstable_LowPriority, IdlePriority = Scheduler.unstable_IdlePriority, log$12 = Scheduler.log, unstable_setDisableYieldValue = Scheduler.unstable_setDisableYieldValue, rendererID = null, injectedHook = null;
      function setIsStrictModeForDevtools(newIsStrictMode) {
        "function" === typeof log$12 && unstable_setDisableYieldValue(newIsStrictMode);
        if (injectedHook && "function" === typeof injectedHook.setStrictMode)
          try {
            injectedHook.setStrictMode(rendererID, newIsStrictMode);
          } catch (err2) {
          }
      }
      var clz32 = Math.clz32 ? Math.clz32 : clz32Fallback, log2 = Math.log, LN2 = Math.LN2;
      function clz32Fallback(x2) {
        x2 >>>= 0;
        return 0 === x2 ? 32 : 31 - (log2(x2) / LN2 | 0) | 0;
      }
      var nextTransitionUpdateLane = 256, nextTransitionDeferredLane = 262144, nextRetryLane = 4194304;
      function getHighestPriorityLanes(lanes) {
        var pendingSyncLanes = lanes & 42;
        if (0 !== pendingSyncLanes) return pendingSyncLanes;
        switch (lanes & -lanes) {
          case 1:
            return 1;
          case 2:
            return 2;
          case 4:
            return 4;
          case 8:
            return 8;
          case 16:
            return 16;
          case 32:
            return 32;
          case 64:
            return 64;
          case 128:
            return 128;
          case 256:
          case 512:
          case 1024:
          case 2048:
          case 4096:
          case 8192:
          case 16384:
          case 32768:
          case 65536:
          case 131072:
            return lanes & 261888;
          case 262144:
          case 524288:
          case 1048576:
          case 2097152:
            return lanes & 3932160;
          case 4194304:
          case 8388608:
          case 16777216:
          case 33554432:
            return lanes & 62914560;
          case 67108864:
            return 67108864;
          case 134217728:
            return 134217728;
          case 268435456:
            return 268435456;
          case 536870912:
            return 536870912;
          case 1073741824:
            return 0;
          default:
            return lanes;
        }
      }
      function getNextLanes(root3, wipLanes, rootHasPendingCommit) {
        var pendingLanes = root3.pendingLanes;
        if (0 === pendingLanes) return 0;
        var nextLanes = 0, suspendedLanes = root3.suspendedLanes, pingedLanes = root3.pingedLanes;
        root3 = root3.warmLanes;
        var nonIdlePendingLanes = pendingLanes & 134217727;
        0 !== nonIdlePendingLanes ? (pendingLanes = nonIdlePendingLanes & ~suspendedLanes, 0 !== pendingLanes ? nextLanes = getHighestPriorityLanes(pendingLanes) : (pingedLanes &= nonIdlePendingLanes, 0 !== pingedLanes ? nextLanes = getHighestPriorityLanes(pingedLanes) : rootHasPendingCommit || (rootHasPendingCommit = nonIdlePendingLanes & ~root3, 0 !== rootHasPendingCommit && (nextLanes = getHighestPriorityLanes(rootHasPendingCommit))))) : (nonIdlePendingLanes = pendingLanes & ~suspendedLanes, 0 !== nonIdlePendingLanes ? nextLanes = getHighestPriorityLanes(nonIdlePendingLanes) : 0 !== pingedLanes ? nextLanes = getHighestPriorityLanes(pingedLanes) : rootHasPendingCommit || (rootHasPendingCommit = pendingLanes & ~root3, 0 !== rootHasPendingCommit && (nextLanes = getHighestPriorityLanes(rootHasPendingCommit))));
        return 0 === nextLanes ? 0 : 0 !== wipLanes && wipLanes !== nextLanes && 0 === (wipLanes & suspendedLanes) && (suspendedLanes = nextLanes & -nextLanes, rootHasPendingCommit = wipLanes & -wipLanes, suspendedLanes >= rootHasPendingCommit || 32 === suspendedLanes && 0 !== (rootHasPendingCommit & 4194048)) ? wipLanes : nextLanes;
      }
      function checkIfRootIsPrerendering(root3, renderLanes2) {
        return 0 === (root3.pendingLanes & ~(root3.suspendedLanes & ~root3.pingedLanes) & renderLanes2);
      }
      function computeExpirationTime(lane, currentTime) {
        switch (lane) {
          case 1:
          case 2:
          case 4:
          case 8:
          case 64:
            return currentTime + 250;
          case 16:
          case 32:
          case 128:
          case 256:
          case 512:
          case 1024:
          case 2048:
          case 4096:
          case 8192:
          case 16384:
          case 32768:
          case 65536:
          case 131072:
          case 262144:
          case 524288:
          case 1048576:
          case 2097152:
            return currentTime + 5e3;
          case 4194304:
          case 8388608:
          case 16777216:
          case 33554432:
            return -1;
          case 67108864:
          case 134217728:
          case 268435456:
          case 536870912:
          case 1073741824:
            return -1;
          default:
            return -1;
        }
      }
      function claimNextRetryLane() {
        var lane = nextRetryLane;
        nextRetryLane <<= 1;
        0 === (nextRetryLane & 62914560) && (nextRetryLane = 4194304);
        return lane;
      }
      function createLaneMap(initial) {
        for (var laneMap = [], i2 = 0; 31 > i2; i2++) laneMap.push(initial);
        return laneMap;
      }
      function markRootUpdated$1(root3, updateLane) {
        root3.pendingLanes |= updateLane;
        268435456 !== updateLane && (root3.suspendedLanes = 0, root3.pingedLanes = 0, root3.warmLanes = 0);
      }
      function markRootFinished(root3, finishedLanes, remainingLanes, spawnedLane, updatedLanes, suspendedRetryLanes) {
        var previouslyPendingLanes = root3.pendingLanes;
        root3.pendingLanes = remainingLanes;
        root3.suspendedLanes = 0;
        root3.pingedLanes = 0;
        root3.warmLanes = 0;
        root3.expiredLanes &= remainingLanes;
        root3.entangledLanes &= remainingLanes;
        root3.errorRecoveryDisabledLanes &= remainingLanes;
        root3.shellSuspendCounter = 0;
        var entanglements = root3.entanglements, expirationTimes = root3.expirationTimes, hiddenUpdates = root3.hiddenUpdates;
        for (remainingLanes = previouslyPendingLanes & ~remainingLanes; 0 < remainingLanes; ) {
          var index$7 = 31 - clz32(remainingLanes), lane = 1 << index$7;
          entanglements[index$7] = 0;
          expirationTimes[index$7] = -1;
          var hiddenUpdatesForLane = hiddenUpdates[index$7];
          if (null !== hiddenUpdatesForLane)
            for (hiddenUpdates[index$7] = null, index$7 = 0; index$7 < hiddenUpdatesForLane.length; index$7++) {
              var update = hiddenUpdatesForLane[index$7];
              null !== update && (update.lane &= -536870913);
            }
          remainingLanes &= ~lane;
        }
        0 !== spawnedLane && markSpawnedDeferredLane(root3, spawnedLane, 0);
        0 !== suspendedRetryLanes && 0 === updatedLanes && 0 !== root3.tag && (root3.suspendedLanes |= suspendedRetryLanes & ~(previouslyPendingLanes & ~finishedLanes));
      }
      function markSpawnedDeferredLane(root3, spawnedLane, entangledLanes) {
        root3.pendingLanes |= spawnedLane;
        root3.suspendedLanes &= ~spawnedLane;
        var spawnedLaneIndex = 31 - clz32(spawnedLane);
        root3.entangledLanes |= spawnedLane;
        root3.entanglements[spawnedLaneIndex] = root3.entanglements[spawnedLaneIndex] | 1073741824 | entangledLanes & 261930;
      }
      function markRootEntangled(root3, entangledLanes) {
        var rootEntangledLanes = root3.entangledLanes |= entangledLanes;
        for (root3 = root3.entanglements; rootEntangledLanes; ) {
          var index$8 = 31 - clz32(rootEntangledLanes), lane = 1 << index$8;
          lane & entangledLanes | root3[index$8] & entangledLanes && (root3[index$8] |= entangledLanes);
          rootEntangledLanes &= ~lane;
        }
      }
      function getBumpedLaneForHydration(root3, renderLanes2) {
        var renderLane = renderLanes2 & -renderLanes2;
        renderLane = 0 !== (renderLane & 42) ? 1 : getBumpedLaneForHydrationByLane(renderLane);
        return 0 !== (renderLane & (root3.suspendedLanes | renderLanes2)) ? 0 : renderLane;
      }
      function getBumpedLaneForHydrationByLane(lane) {
        switch (lane) {
          case 2:
            lane = 1;
            break;
          case 8:
            lane = 4;
            break;
          case 32:
            lane = 16;
            break;
          case 256:
          case 512:
          case 1024:
          case 2048:
          case 4096:
          case 8192:
          case 16384:
          case 32768:
          case 65536:
          case 131072:
          case 262144:
          case 524288:
          case 1048576:
          case 2097152:
          case 4194304:
          case 8388608:
          case 16777216:
          case 33554432:
            lane = 128;
            break;
          case 268435456:
            lane = 134217728;
            break;
          default:
            lane = 0;
        }
        return lane;
      }
      function lanesToEventPriority(lanes) {
        lanes &= -lanes;
        return 2 < lanes ? 8 < lanes ? 0 !== (lanes & 134217727) ? 32 : 268435456 : 8 : 2;
      }
      function resolveUpdatePriority() {
        var updatePriority = ReactDOMSharedInternals.p;
        if (0 !== updatePriority) return updatePriority;
        updatePriority = window.event;
        return void 0 === updatePriority ? 32 : getEventPriority(updatePriority.type);
      }
      function runWithPriority(priority, fn2) {
        var previousPriority = ReactDOMSharedInternals.p;
        try {
          return ReactDOMSharedInternals.p = priority, fn2();
        } finally {
          ReactDOMSharedInternals.p = previousPriority;
        }
      }
      var randomKey = Math.random().toString(36).slice(2), internalInstanceKey = "__reactFiber$" + randomKey, internalPropsKey = "__reactProps$" + randomKey, internalContainerInstanceKey = "__reactContainer$" + randomKey, internalEventHandlersKey = "__reactEvents$" + randomKey, internalEventHandlerListenersKey = "__reactListeners$" + randomKey, internalEventHandlesSetKey = "__reactHandles$" + randomKey, internalRootNodeResourcesKey = "__reactResources$" + randomKey, internalHoistableMarker = "__reactMarker$" + randomKey;
      function detachDeletedInstance(node2) {
        delete node2[internalInstanceKey];
        delete node2[internalPropsKey];
        delete node2[internalEventHandlersKey];
        delete node2[internalEventHandlerListenersKey];
        delete node2[internalEventHandlesSetKey];
      }
      function getClosestInstanceFromNode(targetNode) {
        var targetInst = targetNode[internalInstanceKey];
        if (targetInst) return targetInst;
        for (var parentNode = targetNode.parentNode; parentNode; ) {
          if (targetInst = parentNode[internalContainerInstanceKey] || parentNode[internalInstanceKey]) {
            parentNode = targetInst.alternate;
            if (null !== targetInst.child || null !== parentNode && null !== parentNode.child)
              for (targetNode = getParentHydrationBoundary(targetNode); null !== targetNode; ) {
                if (parentNode = targetNode[internalInstanceKey]) return parentNode;
                targetNode = getParentHydrationBoundary(targetNode);
              }
            return targetInst;
          }
          targetNode = parentNode;
          parentNode = targetNode.parentNode;
        }
        return null;
      }
      function getInstanceFromNode(node2) {
        if (node2 = node2[internalInstanceKey] || node2[internalContainerInstanceKey]) {
          var tag = node2.tag;
          if (5 === tag || 6 === tag || 13 === tag || 31 === tag || 26 === tag || 27 === tag || 3 === tag)
            return node2;
        }
        return null;
      }
      function getNodeFromInstance(inst) {
        var tag = inst.tag;
        if (5 === tag || 26 === tag || 27 === tag || 6 === tag) return inst.stateNode;
        throw Error(formatProdErrorMessage(33));
      }
      function getResourcesFromRoot(root3) {
        var resources = root3[internalRootNodeResourcesKey];
        resources || (resources = root3[internalRootNodeResourcesKey] = { hoistableStyles: /* @__PURE__ */ new Map(), hoistableScripts: /* @__PURE__ */ new Map() });
        return resources;
      }
      function markNodeAsHoistable(node2) {
        node2[internalHoistableMarker] = true;
      }
      var allNativeEvents = /* @__PURE__ */ new Set(), registrationNameDependencies = {};
      function registerTwoPhaseEvent(registrationName, dependencies) {
        registerDirectEvent(registrationName, dependencies);
        registerDirectEvent(registrationName + "Capture", dependencies);
      }
      function registerDirectEvent(registrationName, dependencies) {
        registrationNameDependencies[registrationName] = dependencies;
        for (registrationName = 0; registrationName < dependencies.length; registrationName++)
          allNativeEvents.add(dependencies[registrationName]);
      }
      var VALID_ATTRIBUTE_NAME_REGEX = RegExp(
        "^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"
      ), illegalAttributeNameCache = {}, validatedAttributeNameCache = {};
      function isAttributeNameSafe(attributeName) {
        if (hasOwnProperty2.call(validatedAttributeNameCache, attributeName))
          return true;
        if (hasOwnProperty2.call(illegalAttributeNameCache, attributeName)) return false;
        if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName))
          return validatedAttributeNameCache[attributeName] = true;
        illegalAttributeNameCache[attributeName] = true;
        return false;
      }
      function setValueForAttribute(node2, name2, value2) {
        if (isAttributeNameSafe(name2))
          if (null === value2) node2.removeAttribute(name2);
          else {
            switch (typeof value2) {
              case "undefined":
              case "function":
              case "symbol":
                node2.removeAttribute(name2);
                return;
              case "boolean":
                var prefix$10 = name2.toLowerCase().slice(0, 5);
                if ("data-" !== prefix$10 && "aria-" !== prefix$10) {
                  node2.removeAttribute(name2);
                  return;
                }
            }
            node2.setAttribute(name2, "" + value2);
          }
      }
      function setValueForKnownAttribute(node2, name2, value2) {
        if (null === value2) node2.removeAttribute(name2);
        else {
          switch (typeof value2) {
            case "undefined":
            case "function":
            case "symbol":
            case "boolean":
              node2.removeAttribute(name2);
              return;
          }
          node2.setAttribute(name2, "" + value2);
        }
      }
      function setValueForNamespacedAttribute(node2, namespace, name2, value2) {
        if (null === value2) node2.removeAttribute(name2);
        else {
          switch (typeof value2) {
            case "undefined":
            case "function":
            case "symbol":
            case "boolean":
              node2.removeAttribute(name2);
              return;
          }
          node2.setAttributeNS(namespace, name2, "" + value2);
        }
      }
      function getToStringValue(value2) {
        switch (typeof value2) {
          case "bigint":
          case "boolean":
          case "number":
          case "string":
          case "undefined":
            return value2;
          case "object":
            return value2;
          default:
            return "";
        }
      }
      function isCheckable(elem) {
        var type = elem.type;
        return (elem = elem.nodeName) && "input" === elem.toLowerCase() && ("checkbox" === type || "radio" === type);
      }
      function trackValueOnNode(node2, valueField, currentValue) {
        var descriptor = Object.getOwnPropertyDescriptor(
          node2.constructor.prototype,
          valueField
        );
        if (!node2.hasOwnProperty(valueField) && "undefined" !== typeof descriptor && "function" === typeof descriptor.get && "function" === typeof descriptor.set) {
          var get2 = descriptor.get, set2 = descriptor.set;
          Object.defineProperty(node2, valueField, {
            configurable: true,
            get: function() {
              return get2.call(this);
            },
            set: function(value2) {
              currentValue = "" + value2;
              set2.call(this, value2);
            }
          });
          Object.defineProperty(node2, valueField, {
            enumerable: descriptor.enumerable
          });
          return {
            getValue: function() {
              return currentValue;
            },
            setValue: function(value2) {
              currentValue = "" + value2;
            },
            stopTracking: function() {
              node2._valueTracker = null;
              delete node2[valueField];
            }
          };
        }
      }
      function track(node2) {
        if (!node2._valueTracker) {
          var valueField = isCheckable(node2) ? "checked" : "value";
          node2._valueTracker = trackValueOnNode(
            node2,
            valueField,
            "" + node2[valueField]
          );
        }
      }
      function updateValueIfChanged(node2) {
        if (!node2) return false;
        var tracker = node2._valueTracker;
        if (!tracker) return true;
        var lastValue = tracker.getValue();
        var value2 = "";
        node2 && (value2 = isCheckable(node2) ? node2.checked ? "true" : "false" : node2.value);
        node2 = value2;
        return node2 !== lastValue ? (tracker.setValue(node2), true) : false;
      }
      function getActiveElement(doc2) {
        doc2 = doc2 || ("undefined" !== typeof document ? document : void 0);
        if ("undefined" === typeof doc2) return null;
        try {
          return doc2.activeElement || doc2.body;
        } catch (e) {
          return doc2.body;
        }
      }
      var escapeSelectorAttributeValueInsideDoubleQuotesRegex = /[\n"\\]/g;
      function escapeSelectorAttributeValueInsideDoubleQuotes(value2) {
        return value2.replace(
          escapeSelectorAttributeValueInsideDoubleQuotesRegex,
          function(ch3) {
            return "\\" + ch3.charCodeAt(0).toString(16) + " ";
          }
        );
      }
      function updateInput(element, value2, defaultValue, lastDefaultValue, checked, defaultChecked, type, name2) {
        element.name = "";
        null != type && "function" !== typeof type && "symbol" !== typeof type && "boolean" !== typeof type ? element.type = type : element.removeAttribute("type");
        if (null != value2)
          if ("number" === type) {
            if (0 === value2 && "" === element.value || element.value != value2)
              element.value = "" + getToStringValue(value2);
          } else
            element.value !== "" + getToStringValue(value2) && (element.value = "" + getToStringValue(value2));
        else
          "submit" !== type && "reset" !== type || element.removeAttribute("value");
        null != value2 ? setDefaultValue(element, type, getToStringValue(value2)) : null != defaultValue ? setDefaultValue(element, type, getToStringValue(defaultValue)) : null != lastDefaultValue && element.removeAttribute("value");
        null == checked && null != defaultChecked && (element.defaultChecked = !!defaultChecked);
        null != checked && (element.checked = checked && "function" !== typeof checked && "symbol" !== typeof checked);
        null != name2 && "function" !== typeof name2 && "symbol" !== typeof name2 && "boolean" !== typeof name2 ? element.name = "" + getToStringValue(name2) : element.removeAttribute("name");
      }
      function initInput(element, value2, defaultValue, checked, defaultChecked, type, name2, isHydrating2) {
        null != type && "function" !== typeof type && "symbol" !== typeof type && "boolean" !== typeof type && (element.type = type);
        if (null != value2 || null != defaultValue) {
          if (!("submit" !== type && "reset" !== type || void 0 !== value2 && null !== value2)) {
            track(element);
            return;
          }
          defaultValue = null != defaultValue ? "" + getToStringValue(defaultValue) : "";
          value2 = null != value2 ? "" + getToStringValue(value2) : defaultValue;
          isHydrating2 || value2 === element.value || (element.value = value2);
          element.defaultValue = value2;
        }
        checked = null != checked ? checked : defaultChecked;
        checked = "function" !== typeof checked && "symbol" !== typeof checked && !!checked;
        element.checked = isHydrating2 ? element.checked : !!checked;
        element.defaultChecked = !!checked;
        null != name2 && "function" !== typeof name2 && "symbol" !== typeof name2 && "boolean" !== typeof name2 && (element.name = name2);
        track(element);
      }
      function setDefaultValue(node2, type, value2) {
        "number" === type && getActiveElement(node2.ownerDocument) === node2 || node2.defaultValue === "" + value2 || (node2.defaultValue = "" + value2);
      }
      function updateOptions(node2, multiple, propValue, setDefaultSelected) {
        node2 = node2.options;
        if (multiple) {
          multiple = {};
          for (var i2 = 0; i2 < propValue.length; i2++)
            multiple["$" + propValue[i2]] = true;
          for (propValue = 0; propValue < node2.length; propValue++)
            i2 = multiple.hasOwnProperty("$" + node2[propValue].value), node2[propValue].selected !== i2 && (node2[propValue].selected = i2), i2 && setDefaultSelected && (node2[propValue].defaultSelected = true);
        } else {
          propValue = "" + getToStringValue(propValue);
          multiple = null;
          for (i2 = 0; i2 < node2.length; i2++) {
            if (node2[i2].value === propValue) {
              node2[i2].selected = true;
              setDefaultSelected && (node2[i2].defaultSelected = true);
              return;
            }
            null !== multiple || node2[i2].disabled || (multiple = node2[i2]);
          }
          null !== multiple && (multiple.selected = true);
        }
      }
      function updateTextarea(element, value2, defaultValue) {
        if (null != value2 && (value2 = "" + getToStringValue(value2), value2 !== element.value && (element.value = value2), null == defaultValue)) {
          element.defaultValue !== value2 && (element.defaultValue = value2);
          return;
        }
        element.defaultValue = null != defaultValue ? "" + getToStringValue(defaultValue) : "";
      }
      function initTextarea(element, value2, defaultValue, children2) {
        if (null == value2) {
          if (null != children2) {
            if (null != defaultValue) throw Error(formatProdErrorMessage(92));
            if (isArrayImpl(children2)) {
              if (1 < children2.length) throw Error(formatProdErrorMessage(93));
              children2 = children2[0];
            }
            defaultValue = children2;
          }
          null == defaultValue && (defaultValue = "");
          value2 = defaultValue;
        }
        defaultValue = getToStringValue(value2);
        element.defaultValue = defaultValue;
        children2 = element.textContent;
        children2 === defaultValue && "" !== children2 && null !== children2 && (element.value = children2);
        track(element);
      }
      function setTextContent(node2, text2) {
        if (text2) {
          var firstChild = node2.firstChild;
          if (firstChild && firstChild === node2.lastChild && 3 === firstChild.nodeType) {
            firstChild.nodeValue = text2;
            return;
          }
        }
        node2.textContent = text2;
      }
      var unitlessNumbers = new Set(
        "animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(
          " "
        )
      );
      function setValueForStyle(style3, styleName, value2) {
        var isCustomProperty = 0 === styleName.indexOf("--");
        null == value2 || "boolean" === typeof value2 || "" === value2 ? isCustomProperty ? style3.setProperty(styleName, "") : "float" === styleName ? style3.cssFloat = "" : style3[styleName] = "" : isCustomProperty ? style3.setProperty(styleName, value2) : "number" !== typeof value2 || 0 === value2 || unitlessNumbers.has(styleName) ? "float" === styleName ? style3.cssFloat = value2 : style3[styleName] = ("" + value2).trim() : style3[styleName] = value2 + "px";
      }
      function setValueForStyles(node2, styles2, prevStyles) {
        if (null != styles2 && "object" !== typeof styles2)
          throw Error(formatProdErrorMessage(62));
        node2 = node2.style;
        if (null != prevStyles) {
          for (var styleName in prevStyles)
            !prevStyles.hasOwnProperty(styleName) || null != styles2 && styles2.hasOwnProperty(styleName) || (0 === styleName.indexOf("--") ? node2.setProperty(styleName, "") : "float" === styleName ? node2.cssFloat = "" : node2[styleName] = "");
          for (var styleName$16 in styles2)
            styleName = styles2[styleName$16], styles2.hasOwnProperty(styleName$16) && prevStyles[styleName$16] !== styleName && setValueForStyle(node2, styleName$16, styleName);
        } else
          for (var styleName$17 in styles2)
            styles2.hasOwnProperty(styleName$17) && setValueForStyle(node2, styleName$17, styles2[styleName$17]);
      }
      function isCustomElement(tagName) {
        if (-1 === tagName.indexOf("-")) return false;
        switch (tagName) {
          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 false;
          default:
            return true;
        }
      }
      var aliases2 = /* @__PURE__ */ new Map([
        ["acceptCharset", "accept-charset"],
        ["htmlFor", "for"],
        ["httpEquiv", "http-equiv"],
        ["crossOrigin", "crossorigin"],
        ["accentHeight", "accent-height"],
        ["alignmentBaseline", "alignment-baseline"],
        ["arabicForm", "arabic-form"],
        ["baselineShift", "baseline-shift"],
        ["capHeight", "cap-height"],
        ["clipPath", "clip-path"],
        ["clipRule", "clip-rule"],
        ["colorInterpolation", "color-interpolation"],
        ["colorInterpolationFilters", "color-interpolation-filters"],
        ["colorProfile", "color-profile"],
        ["colorRendering", "color-rendering"],
        ["dominantBaseline", "dominant-baseline"],
        ["enableBackground", "enable-background"],
        ["fillOpacity", "fill-opacity"],
        ["fillRule", "fill-rule"],
        ["floodColor", "flood-color"],
        ["floodOpacity", "flood-opacity"],
        ["fontFamily", "font-family"],
        ["fontSize", "font-size"],
        ["fontSizeAdjust", "font-size-adjust"],
        ["fontStretch", "font-stretch"],
        ["fontStyle", "font-style"],
        ["fontVariant", "font-variant"],
        ["fontWeight", "font-weight"],
        ["glyphName", "glyph-name"],
        ["glyphOrientationHorizontal", "glyph-orientation-horizontal"],
        ["glyphOrientationVertical", "glyph-orientation-vertical"],
        ["horizAdvX", "horiz-adv-x"],
        ["horizOriginX", "horiz-origin-x"],
        ["imageRendering", "image-rendering"],
        ["letterSpacing", "letter-spacing"],
        ["lightingColor", "lighting-color"],
        ["markerEnd", "marker-end"],
        ["markerMid", "marker-mid"],
        ["markerStart", "marker-start"],
        ["overlinePosition", "overline-position"],
        ["overlineThickness", "overline-thickness"],
        ["paintOrder", "paint-order"],
        ["panose-1", "panose-1"],
        ["pointerEvents", "pointer-events"],
        ["renderingIntent", "rendering-intent"],
        ["shapeRendering", "shape-rendering"],
        ["stopColor", "stop-color"],
        ["stopOpacity", "stop-opacity"],
        ["strikethroughPosition", "strikethrough-position"],
        ["strikethroughThickness", "strikethrough-thickness"],
        ["strokeDasharray", "stroke-dasharray"],
        ["strokeDashoffset", "stroke-dashoffset"],
        ["strokeLinecap", "stroke-linecap"],
        ["strokeLinejoin", "stroke-linejoin"],
        ["strokeMiterlimit", "stroke-miterlimit"],
        ["strokeOpacity", "stroke-opacity"],
        ["strokeWidth", "stroke-width"],
        ["textAnchor", "text-anchor"],
        ["textDecoration", "text-decoration"],
        ["textRendering", "text-rendering"],
        ["transformOrigin", "transform-origin"],
        ["underlinePosition", "underline-position"],
        ["underlineThickness", "underline-thickness"],
        ["unicodeBidi", "unicode-bidi"],
        ["unicodeRange", "unicode-range"],
        ["unitsPerEm", "units-per-em"],
        ["vAlphabetic", "v-alphabetic"],
        ["vHanging", "v-hanging"],
        ["vIdeographic", "v-ideographic"],
        ["vMathematical", "v-mathematical"],
        ["vectorEffect", "vector-effect"],
        ["vertAdvY", "vert-adv-y"],
        ["vertOriginX", "vert-origin-x"],
        ["vertOriginY", "vert-origin-y"],
        ["wordSpacing", "word-spacing"],
        ["writingMode", "writing-mode"],
        ["xmlnsXlink", "xmlns:xlink"],
        ["xHeight", "x-height"]
      ]), isJavaScriptProtocol = /^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;
      function sanitizeURL(url) {
        return isJavaScriptProtocol.test("" + url) ? "javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')" : url;
      }
      function noop$1() {
      }
      var currentReplayingEvent = null;
      function getEventTarget(nativeEvent) {
        nativeEvent = nativeEvent.target || nativeEvent.srcElement || window;
        nativeEvent.correspondingUseElement && (nativeEvent = nativeEvent.correspondingUseElement);
        return 3 === nativeEvent.nodeType ? nativeEvent.parentNode : nativeEvent;
      }
      var restoreTarget = null, restoreQueue = null;
      function restoreStateOfTarget(target2) {
        var internalInstance = getInstanceFromNode(target2);
        if (internalInstance && (target2 = internalInstance.stateNode)) {
          var props = target2[internalPropsKey] || null;
          a: switch (target2 = internalInstance.stateNode, internalInstance.type) {
            case "input":
              updateInput(
                target2,
                props.value,
                props.defaultValue,
                props.defaultValue,
                props.checked,
                props.defaultChecked,
                props.type,
                props.name
              );
              internalInstance = props.name;
              if ("radio" === props.type && null != internalInstance) {
                for (props = target2; props.parentNode; ) props = props.parentNode;
                props = props.querySelectorAll(
                  'input[name="' + escapeSelectorAttributeValueInsideDoubleQuotes(
                    "" + internalInstance
                  ) + '"][type="radio"]'
                );
                for (internalInstance = 0; internalInstance < props.length; internalInstance++) {
                  var otherNode = props[internalInstance];
                  if (otherNode !== target2 && otherNode.form === target2.form) {
                    var otherProps = otherNode[internalPropsKey] || null;
                    if (!otherProps) throw Error(formatProdErrorMessage(90));
                    updateInput(
                      otherNode,
                      otherProps.value,
                      otherProps.defaultValue,
                      otherProps.defaultValue,
                      otherProps.checked,
                      otherProps.defaultChecked,
                      otherProps.type,
                      otherProps.name
                    );
                  }
                }
                for (internalInstance = 0; internalInstance < props.length; internalInstance++)
                  otherNode = props[internalInstance], otherNode.form === target2.form && updateValueIfChanged(otherNode);
              }
              break a;
            case "textarea":
              updateTextarea(target2, props.value, props.defaultValue);
              break a;
            case "select":
              internalInstance = props.value, null != internalInstance && updateOptions(target2, !!props.multiple, internalInstance, false);
          }
        }
      }
      var isInsideEventHandler = false;
      function batchedUpdates$1(fn2, a, b) {
        if (isInsideEventHandler) return fn2(a, b);
        isInsideEventHandler = true;
        try {
          var JSCompiler_inline_result = fn2(a);
          return JSCompiler_inline_result;
        } finally {
          if (isInsideEventHandler = false, null !== restoreTarget || null !== restoreQueue) {
            if (flushSyncWork$1(), restoreTarget && (a = restoreTarget, fn2 = restoreQueue, restoreQueue = restoreTarget = null, restoreStateOfTarget(a), fn2))
              for (a = 0; a < fn2.length; a++) restoreStateOfTarget(fn2[a]);
          }
        }
      }
      function getListener2(inst, registrationName) {
        var stateNode = inst.stateNode;
        if (null === stateNode) return null;
        var props = stateNode[internalPropsKey] || null;
        if (null === props) return null;
        stateNode = props[registrationName];
        a: switch (registrationName) {
          case "onClick":
          case "onClickCapture":
          case "onDoubleClick":
          case "onDoubleClickCapture":
          case "onMouseDown":
          case "onMouseDownCapture":
          case "onMouseMove":
          case "onMouseMoveCapture":
          case "onMouseUp":
          case "onMouseUpCapture":
          case "onMouseEnter":
            (props = !props.disabled) || (inst = inst.type, props = !("button" === inst || "input" === inst || "select" === inst || "textarea" === inst));
            inst = !props;
            break a;
          default:
            inst = false;
        }
        if (inst) return null;
        if (stateNode && "function" !== typeof stateNode)
          throw Error(
            formatProdErrorMessage(231, registrationName, typeof stateNode)
          );
        return stateNode;
      }
      var canUseDOM = !("undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement), passiveBrowserEventsSupported = false;
      if (canUseDOM)
        try {
          var options2 = {};
          Object.defineProperty(options2, "passive", {
            get: function() {
              passiveBrowserEventsSupported = true;
            }
          });
          window.addEventListener("test", options2, options2);
          window.removeEventListener("test", options2, options2);
        } catch (e) {
          passiveBrowserEventsSupported = false;
        }
      var root2 = null, startText = null, fallbackText = null;
      function getData() {
        if (fallbackText) return fallbackText;
        var start2, startValue = startText, startLength = startValue.length, end2, endValue = "value" in root2 ? root2.value : root2.textContent, endLength = endValue.length;
        for (start2 = 0; start2 < startLength && startValue[start2] === endValue[start2]; start2++) ;
        var minEnd = startLength - start2;
        for (end2 = 1; end2 <= minEnd && startValue[startLength - end2] === endValue[endLength - end2]; end2++) ;
        return fallbackText = endValue.slice(start2, 1 < end2 ? 1 - end2 : void 0);
      }
      function getEventCharCode(nativeEvent) {
        var keyCode = nativeEvent.keyCode;
        "charCode" in nativeEvent ? (nativeEvent = nativeEvent.charCode, 0 === nativeEvent && 13 === keyCode && (nativeEvent = 13)) : nativeEvent = keyCode;
        10 === nativeEvent && (nativeEvent = 13);
        return 32 <= nativeEvent || 13 === nativeEvent ? nativeEvent : 0;
      }
      function functionThatReturnsTrue() {
        return true;
      }
      function functionThatReturnsFalse() {
        return false;
      }
      function createSyntheticEvent(Interface) {
        function SyntheticBaseEvent(reactName, reactEventType, targetInst, nativeEvent, nativeEventTarget) {
          this._reactName = reactName;
          this._targetInst = targetInst;
          this.type = reactEventType;
          this.nativeEvent = nativeEvent;
          this.target = nativeEventTarget;
          this.currentTarget = null;
          for (var propName in Interface)
            Interface.hasOwnProperty(propName) && (reactName = Interface[propName], this[propName] = reactName ? reactName(nativeEvent) : nativeEvent[propName]);
          this.isDefaultPrevented = (null != nativeEvent.defaultPrevented ? nativeEvent.defaultPrevented : false === nativeEvent.returnValue) ? functionThatReturnsTrue : functionThatReturnsFalse;
          this.isPropagationStopped = functionThatReturnsFalse;
          return this;
        }
        assign2(SyntheticBaseEvent.prototype, {
          preventDefault: function() {
            this.defaultPrevented = true;
            var event = this.nativeEvent;
            event && (event.preventDefault ? event.preventDefault() : "unknown" !== typeof event.returnValue && (event.returnValue = false), this.isDefaultPrevented = functionThatReturnsTrue);
          },
          stopPropagation: function() {
            var event = this.nativeEvent;
            event && (event.stopPropagation ? event.stopPropagation() : "unknown" !== typeof event.cancelBubble && (event.cancelBubble = true), this.isPropagationStopped = functionThatReturnsTrue);
          },
          persist: function() {
          },
          isPersistent: functionThatReturnsTrue
        });
        return SyntheticBaseEvent;
      }
      var EventInterface = {
        eventPhase: 0,
        bubbles: 0,
        cancelable: 0,
        timeStamp: function(event) {
          return event.timeStamp || Date.now();
        },
        defaultPrevented: 0,
        isTrusted: 0
      }, SyntheticEvent = createSyntheticEvent(EventInterface), UIEventInterface = assign2({}, EventInterface, { view: 0, detail: 0 }), SyntheticUIEvent = createSyntheticEvent(UIEventInterface), lastMovementX, lastMovementY, lastMouseEvent, MouseEventInterface = assign2({}, UIEventInterface, {
        screenX: 0,
        screenY: 0,
        clientX: 0,
        clientY: 0,
        pageX: 0,
        pageY: 0,
        ctrlKey: 0,
        shiftKey: 0,
        altKey: 0,
        metaKey: 0,
        getModifierState: getEventModifierState,
        button: 0,
        buttons: 0,
        relatedTarget: function(event) {
          return void 0 === event.relatedTarget ? event.fromElement === event.srcElement ? event.toElement : event.fromElement : event.relatedTarget;
        },
        movementX: function(event) {
          if ("movementX" in event) return event.movementX;
          event !== lastMouseEvent && (lastMouseEvent && "mousemove" === event.type ? (lastMovementX = event.screenX - lastMouseEvent.screenX, lastMovementY = event.screenY - lastMouseEvent.screenY) : lastMovementY = lastMovementX = 0, lastMouseEvent = event);
          return lastMovementX;
        },
        movementY: function(event) {
          return "movementY" in event ? event.movementY : lastMovementY;
        }
      }), SyntheticMouseEvent = createSyntheticEvent(MouseEventInterface), DragEventInterface = assign2({}, MouseEventInterface, { dataTransfer: 0 }), SyntheticDragEvent = createSyntheticEvent(DragEventInterface), FocusEventInterface = assign2({}, UIEventInterface, { relatedTarget: 0 }), SyntheticFocusEvent = createSyntheticEvent(FocusEventInterface), AnimationEventInterface = assign2({}, EventInterface, {
        animationName: 0,
        elapsedTime: 0,
        pseudoElement: 0
      }), SyntheticAnimationEvent = createSyntheticEvent(AnimationEventInterface), ClipboardEventInterface = assign2({}, EventInterface, {
        clipboardData: function(event) {
          return "clipboardData" in event ? event.clipboardData : window.clipboardData;
        }
      }), SyntheticClipboardEvent = createSyntheticEvent(ClipboardEventInterface), CompositionEventInterface = assign2({}, EventInterface, { data: 0 }), SyntheticCompositionEvent = createSyntheticEvent(CompositionEventInterface), normalizeKey = {
        Esc: "Escape",
        Spacebar: " ",
        Left: "ArrowLeft",
        Up: "ArrowUp",
        Right: "ArrowRight",
        Down: "ArrowDown",
        Del: "Delete",
        Win: "OS",
        Menu: "ContextMenu",
        Apps: "ContextMenu",
        Scroll: "ScrollLock",
        MozPrintableKey: "Unidentified"
      }, translateToKey = {
        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"
      }, modifierKeyToProp = {
        Alt: "altKey",
        Control: "ctrlKey",
        Meta: "metaKey",
        Shift: "shiftKey"
      };
      function modifierStateGetter(keyArg) {
        var nativeEvent = this.nativeEvent;
        return nativeEvent.getModifierState ? nativeEvent.getModifierState(keyArg) : (keyArg = modifierKeyToProp[keyArg]) ? !!nativeEvent[keyArg] : false;
      }
      function getEventModifierState() {
        return modifierStateGetter;
      }
      var KeyboardEventInterface = assign2({}, UIEventInterface, {
        key: function(nativeEvent) {
          if (nativeEvent.key) {
            var key2 = normalizeKey[nativeEvent.key] || nativeEvent.key;
            if ("Unidentified" !== key2) return key2;
          }
          return "keypress" === nativeEvent.type ? (nativeEvent = getEventCharCode(nativeEvent), 13 === nativeEvent ? "Enter" : String.fromCharCode(nativeEvent)) : "keydown" === nativeEvent.type || "keyup" === nativeEvent.type ? translateToKey[nativeEvent.keyCode] || "Unidentified" : "";
        },
        code: 0,
        location: 0,
        ctrlKey: 0,
        shiftKey: 0,
        altKey: 0,
        metaKey: 0,
        repeat: 0,
        locale: 0,
        getModifierState: getEventModifierState,
        charCode: function(event) {
          return "keypress" === event.type ? getEventCharCode(event) : 0;
        },
        keyCode: function(event) {
          return "keydown" === event.type || "keyup" === event.type ? event.keyCode : 0;
        },
        which: function(event) {
          return "keypress" === event.type ? getEventCharCode(event) : "keydown" === event.type || "keyup" === event.type ? event.keyCode : 0;
        }
      }), SyntheticKeyboardEvent = createSyntheticEvent(KeyboardEventInterface), PointerEventInterface = assign2({}, MouseEventInterface, {
        pointerId: 0,
        width: 0,
        height: 0,
        pressure: 0,
        tangentialPressure: 0,
        tiltX: 0,
        tiltY: 0,
        twist: 0,
        pointerType: 0,
        isPrimary: 0
      }), SyntheticPointerEvent = createSyntheticEvent(PointerEventInterface), TouchEventInterface = assign2({}, UIEventInterface, {
        touches: 0,
        targetTouches: 0,
        changedTouches: 0,
        altKey: 0,
        metaKey: 0,
        ctrlKey: 0,
        shiftKey: 0,
        getModifierState: getEventModifierState
      }), SyntheticTouchEvent = createSyntheticEvent(TouchEventInterface), TransitionEventInterface = assign2({}, EventInterface, {
        propertyName: 0,
        elapsedTime: 0,
        pseudoElement: 0
      }), SyntheticTransitionEvent = createSyntheticEvent(TransitionEventInterface), WheelEventInterface = assign2({}, MouseEventInterface, {
        deltaX: function(event) {
          return "deltaX" in event ? event.deltaX : "wheelDeltaX" in event ? -event.wheelDeltaX : 0;
        },
        deltaY: function(event) {
          return "deltaY" in event ? event.deltaY : "wheelDeltaY" in event ? -event.wheelDeltaY : "wheelDelta" in event ? -event.wheelDelta : 0;
        },
        deltaZ: 0,
        deltaMode: 0
      }), SyntheticWheelEvent = createSyntheticEvent(WheelEventInterface), ToggleEventInterface = assign2({}, EventInterface, {
        newState: 0,
        oldState: 0
      }), SyntheticToggleEvent = createSyntheticEvent(ToggleEventInterface), END_KEYCODES = [9, 13, 27, 32], canUseCompositionEvent = canUseDOM && "CompositionEvent" in window, documentMode = null;
      canUseDOM && "documentMode" in document && (documentMode = document.documentMode);
      var canUseTextInputEvent = canUseDOM && "TextEvent" in window && !documentMode, useFallbackCompositionData = canUseDOM && (!canUseCompositionEvent || documentMode && 8 < documentMode && 11 >= documentMode), SPACEBAR_CHAR = String.fromCharCode(32), hasSpaceKeypress = false;
      function isFallbackCompositionEnd(domEventName, nativeEvent) {
        switch (domEventName) {
          case "keyup":
            return -1 !== END_KEYCODES.indexOf(nativeEvent.keyCode);
          case "keydown":
            return 229 !== nativeEvent.keyCode;
          case "keypress":
          case "mousedown":
          case "focusout":
            return true;
          default:
            return false;
        }
      }
      function getDataFromCustomEvent(nativeEvent) {
        nativeEvent = nativeEvent.detail;
        return "object" === typeof nativeEvent && "data" in nativeEvent ? nativeEvent.data : null;
      }
      var isComposing = false;
      function getNativeBeforeInputChars(domEventName, nativeEvent) {
        switch (domEventName) {
          case "compositionend":
            return getDataFromCustomEvent(nativeEvent);
          case "keypress":
            if (32 !== nativeEvent.which) return null;
            hasSpaceKeypress = true;
            return SPACEBAR_CHAR;
          case "textInput":
            return domEventName = nativeEvent.data, domEventName === SPACEBAR_CHAR && hasSpaceKeypress ? null : domEventName;
          default:
            return null;
        }
      }
      function getFallbackBeforeInputChars(domEventName, nativeEvent) {
        if (isComposing)
          return "compositionend" === domEventName || !canUseCompositionEvent && isFallbackCompositionEnd(domEventName, nativeEvent) ? (domEventName = getData(), fallbackText = startText = root2 = null, isComposing = false, domEventName) : null;
        switch (domEventName) {
          case "paste":
            return null;
          case "keypress":
            if (!(nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) || nativeEvent.ctrlKey && nativeEvent.altKey) {
              if (nativeEvent.char && 1 < nativeEvent.char.length)
                return nativeEvent.char;
              if (nativeEvent.which) return String.fromCharCode(nativeEvent.which);
            }
            return null;
          case "compositionend":
            return useFallbackCompositionData && "ko" !== nativeEvent.locale ? null : nativeEvent.data;
          default:
            return null;
        }
      }
      var supportedInputTypes = {
        color: true,
        date: true,
        datetime: true,
        "datetime-local": true,
        email: true,
        month: true,
        number: true,
        password: true,
        range: true,
        search: true,
        tel: true,
        text: true,
        time: true,
        url: true,
        week: true
      };
      function isTextInputElement(elem) {
        var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();
        return "input" === nodeName ? !!supportedInputTypes[elem.type] : "textarea" === nodeName ? true : false;
      }
      function createAndAccumulateChangeEvent(dispatchQueue, inst, nativeEvent, target2) {
        restoreTarget ? restoreQueue ? restoreQueue.push(target2) : restoreQueue = [target2] : restoreTarget = target2;
        inst = accumulateTwoPhaseListeners(inst, "onChange");
        0 < inst.length && (nativeEvent = new SyntheticEvent(
          "onChange",
          "change",
          null,
          nativeEvent,
          target2
        ), dispatchQueue.push({ event: nativeEvent, listeners: inst }));
      }
      var activeElement$1 = null, activeElementInst$1 = null;
      function runEventInBatch(dispatchQueue) {
        processDispatchQueue(dispatchQueue, 0);
      }
      function getInstIfValueChanged(targetInst) {
        var targetNode = getNodeFromInstance(targetInst);
        if (updateValueIfChanged(targetNode)) return targetInst;
      }
      function getTargetInstForChangeEvent(domEventName, targetInst) {
        if ("change" === domEventName) return targetInst;
      }
      var isInputEventSupported = false;
      if (canUseDOM) {
        var JSCompiler_inline_result$jscomp$286;
        if (canUseDOM) {
          var isSupported$jscomp$inline_427 = "oninput" in document;
          if (!isSupported$jscomp$inline_427) {
            var element$jscomp$inline_428 = document.createElement("div");
            element$jscomp$inline_428.setAttribute("oninput", "return;");
            isSupported$jscomp$inline_427 = "function" === typeof element$jscomp$inline_428.oninput;
          }
          JSCompiler_inline_result$jscomp$286 = isSupported$jscomp$inline_427;
        } else JSCompiler_inline_result$jscomp$286 = false;
        isInputEventSupported = JSCompiler_inline_result$jscomp$286 && (!document.documentMode || 9 < document.documentMode);
      }
      function stopWatchingForValueChange() {
        activeElement$1 && (activeElement$1.detachEvent("onpropertychange", handlePropertyChange), activeElementInst$1 = activeElement$1 = null);
      }
      function handlePropertyChange(nativeEvent) {
        if ("value" === nativeEvent.propertyName && getInstIfValueChanged(activeElementInst$1)) {
          var dispatchQueue = [];
          createAndAccumulateChangeEvent(
            dispatchQueue,
            activeElementInst$1,
            nativeEvent,
            getEventTarget(nativeEvent)
          );
          batchedUpdates$1(runEventInBatch, dispatchQueue);
        }
      }
      function handleEventsForInputEventPolyfill(domEventName, target2, targetInst) {
        "focusin" === domEventName ? (stopWatchingForValueChange(), activeElement$1 = target2, activeElementInst$1 = targetInst, activeElement$1.attachEvent("onpropertychange", handlePropertyChange)) : "focusout" === domEventName && stopWatchingForValueChange();
      }
      function getTargetInstForInputEventPolyfill(domEventName) {
        if ("selectionchange" === domEventName || "keyup" === domEventName || "keydown" === domEventName)
          return getInstIfValueChanged(activeElementInst$1);
      }
      function getTargetInstForClickEvent(domEventName, targetInst) {
        if ("click" === domEventName) return getInstIfValueChanged(targetInst);
      }
      function getTargetInstForInputOrChangeEvent(domEventName, targetInst) {
        if ("input" === domEventName || "change" === domEventName)
          return getInstIfValueChanged(targetInst);
      }
      function is2(x2, y) {
        return x2 === y && (0 !== x2 || 1 / x2 === 1 / y) || x2 !== x2 && y !== y;
      }
      var objectIs = "function" === typeof Object.is ? Object.is : is2;
      function shallowEqual(objA, objB) {
        if (objectIs(objA, objB)) return true;
        if ("object" !== typeof objA || null === objA || "object" !== typeof objB || null === objB)
          return false;
        var keysA = Object.keys(objA), keysB = Object.keys(objB);
        if (keysA.length !== keysB.length) return false;
        for (keysB = 0; keysB < keysA.length; keysB++) {
          var currentKey = keysA[keysB];
          if (!hasOwnProperty2.call(objB, currentKey) || !objectIs(objA[currentKey], objB[currentKey]))
            return false;
        }
        return true;
      }
      function getLeafNode(node2) {
        for (; node2 && node2.firstChild; ) node2 = node2.firstChild;
        return node2;
      }
      function getNodeForCharacterOffset(root3, offset2) {
        var node2 = getLeafNode(root3);
        root3 = 0;
        for (var nodeEnd; node2; ) {
          if (3 === node2.nodeType) {
            nodeEnd = root3 + node2.textContent.length;
            if (root3 <= offset2 && nodeEnd >= offset2)
              return { node: node2, offset: offset2 - root3 };
            root3 = nodeEnd;
          }
          a: {
            for (; node2; ) {
              if (node2.nextSibling) {
                node2 = node2.nextSibling;
                break a;
              }
              node2 = node2.parentNode;
            }
            node2 = void 0;
          }
          node2 = getLeafNode(node2);
        }
      }
      function containsNode(outerNode, innerNode) {
        return outerNode && innerNode ? outerNode === innerNode ? true : outerNode && 3 === outerNode.nodeType ? false : innerNode && 3 === innerNode.nodeType ? containsNode(outerNode, innerNode.parentNode) : "contains" in outerNode ? outerNode.contains(innerNode) : outerNode.compareDocumentPosition ? !!(outerNode.compareDocumentPosition(innerNode) & 16) : false : false;
      }
      function getActiveElementDeep(containerInfo) {
        containerInfo = null != containerInfo && null != containerInfo.ownerDocument && null != containerInfo.ownerDocument.defaultView ? containerInfo.ownerDocument.defaultView : window;
        for (var element = getActiveElement(containerInfo.document); element instanceof containerInfo.HTMLIFrameElement; ) {
          try {
            var JSCompiler_inline_result = "string" === typeof element.contentWindow.location.href;
          } catch (err2) {
            JSCompiler_inline_result = false;
          }
          if (JSCompiler_inline_result) containerInfo = element.contentWindow;
          else break;
          element = getActiveElement(containerInfo.document);
        }
        return element;
      }
      function hasSelectionCapabilities(elem) {
        var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();
        return nodeName && ("input" === nodeName && ("text" === elem.type || "search" === elem.type || "tel" === elem.type || "url" === elem.type || "password" === elem.type) || "textarea" === nodeName || "true" === elem.contentEditable);
      }
      var skipSelectionChangeEvent = canUseDOM && "documentMode" in document && 11 >= document.documentMode, activeElement = null, activeElementInst = null, lastSelection = null, mouseDown = false;
      function constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget) {
        var doc2 = nativeEventTarget.window === nativeEventTarget ? nativeEventTarget.document : 9 === nativeEventTarget.nodeType ? nativeEventTarget : nativeEventTarget.ownerDocument;
        mouseDown || null == activeElement || activeElement !== getActiveElement(doc2) || (doc2 = activeElement, "selectionStart" in doc2 && hasSelectionCapabilities(doc2) ? doc2 = { start: doc2.selectionStart, end: doc2.selectionEnd } : (doc2 = (doc2.ownerDocument && doc2.ownerDocument.defaultView || window).getSelection(), doc2 = {
          anchorNode: doc2.anchorNode,
          anchorOffset: doc2.anchorOffset,
          focusNode: doc2.focusNode,
          focusOffset: doc2.focusOffset
        }), lastSelection && shallowEqual(lastSelection, doc2) || (lastSelection = doc2, doc2 = accumulateTwoPhaseListeners(activeElementInst, "onSelect"), 0 < doc2.length && (nativeEvent = new SyntheticEvent(
          "onSelect",
          "select",
          null,
          nativeEvent,
          nativeEventTarget
        ), dispatchQueue.push({ event: nativeEvent, listeners: doc2 }), nativeEvent.target = activeElement)));
      }
      function makePrefixMap(styleProp, eventName) {
        var prefixes = {};
        prefixes[styleProp.toLowerCase()] = eventName.toLowerCase();
        prefixes["Webkit" + styleProp] = "webkit" + eventName;
        prefixes["Moz" + styleProp] = "moz" + eventName;
        return prefixes;
      }
      var vendorPrefixes = {
        animationend: makePrefixMap("Animation", "AnimationEnd"),
        animationiteration: makePrefixMap("Animation", "AnimationIteration"),
        animationstart: makePrefixMap("Animation", "AnimationStart"),
        transitionrun: makePrefixMap("Transition", "TransitionRun"),
        transitionstart: makePrefixMap("Transition", "TransitionStart"),
        transitioncancel: makePrefixMap("Transition", "TransitionCancel"),
        transitionend: makePrefixMap("Transition", "TransitionEnd")
      }, prefixedEventNames = {}, style2 = {};
      canUseDOM && (style2 = document.createElement("div").style, "AnimationEvent" in window || (delete vendorPrefixes.animationend.animation, delete vendorPrefixes.animationiteration.animation, delete vendorPrefixes.animationstart.animation), "TransitionEvent" in window || delete vendorPrefixes.transitionend.transition);
      function getVendorPrefixedEventName(eventName) {
        if (prefixedEventNames[eventName]) return prefixedEventNames[eventName];
        if (!vendorPrefixes[eventName]) return eventName;
        var prefixMap = vendorPrefixes[eventName], styleProp;
        for (styleProp in prefixMap)
          if (prefixMap.hasOwnProperty(styleProp) && styleProp in style2)
            return prefixedEventNames[eventName] = prefixMap[styleProp];
        return eventName;
      }
      var ANIMATION_END = getVendorPrefixedEventName("animationend"), ANIMATION_ITERATION = getVendorPrefixedEventName("animationiteration"), ANIMATION_START = getVendorPrefixedEventName("animationstart"), TRANSITION_RUN = getVendorPrefixedEventName("transitionrun"), TRANSITION_START = getVendorPrefixedEventName("transitionstart"), TRANSITION_CANCEL = getVendorPrefixedEventName("transitioncancel"), TRANSITION_END = getVendorPrefixedEventName("transitionend"), topLevelEventsToReactNames = /* @__PURE__ */ new Map(), simpleEventPluginEvents = "abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(
        " "
      );
      simpleEventPluginEvents.push("scrollEnd");
      function registerSimpleEvent(domEventName, reactName) {
        topLevelEventsToReactNames.set(domEventName, reactName);
        registerTwoPhaseEvent(reactName, [domEventName]);
      }
      var reportGlobalError = "function" === typeof reportError ? reportError : function(error2) {
        if ("object" === typeof window && "function" === typeof window.ErrorEvent) {
          var event = new window.ErrorEvent("error", {
            bubbles: true,
            cancelable: true,
            message: "object" === typeof error2 && null !== error2 && "string" === typeof error2.message ? String(error2.message) : String(error2),
            error: error2
          });
          if (!window.dispatchEvent(event)) return;
        } else if ("object" === typeof process && "function" === typeof process.emit) {
          process.emit("uncaughtException", error2);
          return;
        }
        console.error(error2);
      }, concurrentQueues = [], concurrentQueuesIndex = 0, concurrentlyUpdatedLanes = 0;
      function finishQueueingConcurrentUpdates() {
        for (var endIndex = concurrentQueuesIndex, i2 = concurrentlyUpdatedLanes = concurrentQueuesIndex = 0; i2 < endIndex; ) {
          var fiber = concurrentQueues[i2];
          concurrentQueues[i2++] = null;
          var queue = concurrentQueues[i2];
          concurrentQueues[i2++] = null;
          var update = concurrentQueues[i2];
          concurrentQueues[i2++] = null;
          var lane = concurrentQueues[i2];
          concurrentQueues[i2++] = null;
          if (null !== queue && null !== update) {
            var pending = queue.pending;
            null === pending ? update.next = update : (update.next = pending.next, pending.next = update);
            queue.pending = update;
          }
          0 !== lane && markUpdateLaneFromFiberToRoot(fiber, update, lane);
        }
      }
      function enqueueUpdate$1(fiber, queue, update, lane) {
        concurrentQueues[concurrentQueuesIndex++] = fiber;
        concurrentQueues[concurrentQueuesIndex++] = queue;
        concurrentQueues[concurrentQueuesIndex++] = update;
        concurrentQueues[concurrentQueuesIndex++] = lane;
        concurrentlyUpdatedLanes |= lane;
        fiber.lanes |= lane;
        fiber = fiber.alternate;
        null !== fiber && (fiber.lanes |= lane);
      }
      function enqueueConcurrentHookUpdate(fiber, queue, update, lane) {
        enqueueUpdate$1(fiber, queue, update, lane);
        return getRootForUpdatedFiber(fiber);
      }
      function enqueueConcurrentRenderForLane(fiber, lane) {
        enqueueUpdate$1(fiber, null, null, lane);
        return getRootForUpdatedFiber(fiber);
      }
      function markUpdateLaneFromFiberToRoot(sourceFiber, update, lane) {
        sourceFiber.lanes |= lane;
        var alternate = sourceFiber.alternate;
        null !== alternate && (alternate.lanes |= lane);
        for (var isHidden = false, parent = sourceFiber.return; null !== parent; )
          parent.childLanes |= lane, alternate = parent.alternate, null !== alternate && (alternate.childLanes |= lane), 22 === parent.tag && (sourceFiber = parent.stateNode, null === sourceFiber || sourceFiber._visibility & 1 || (isHidden = true)), sourceFiber = parent, parent = parent.return;
        return 3 === sourceFiber.tag ? (parent = sourceFiber.stateNode, isHidden && null !== update && (isHidden = 31 - clz32(lane), sourceFiber = parent.hiddenUpdates, alternate = sourceFiber[isHidden], null === alternate ? sourceFiber[isHidden] = [update] : alternate.push(update), update.lane = lane | 536870912), parent) : null;
      }
      function getRootForUpdatedFiber(sourceFiber) {
        if (50 < nestedUpdateCount)
          throw nestedUpdateCount = 0, rootWithNestedUpdates = null, Error(formatProdErrorMessage(185));
        for (var parent = sourceFiber.return; null !== parent; )
          sourceFiber = parent, parent = sourceFiber.return;
        return 3 === sourceFiber.tag ? sourceFiber.stateNode : null;
      }
      var emptyContextObject = {};
      function FiberNode(tag, pendingProps, key2, mode) {
        this.tag = tag;
        this.key = key2;
        this.sibling = this.child = this.return = this.stateNode = this.type = this.elementType = null;
        this.index = 0;
        this.refCleanup = this.ref = null;
        this.pendingProps = pendingProps;
        this.dependencies = this.memoizedState = this.updateQueue = this.memoizedProps = null;
        this.mode = mode;
        this.subtreeFlags = this.flags = 0;
        this.deletions = null;
        this.childLanes = this.lanes = 0;
        this.alternate = null;
      }
      function createFiberImplClass(tag, pendingProps, key2, mode) {
        return new FiberNode(tag, pendingProps, key2, mode);
      }
      function shouldConstruct(Component2) {
        Component2 = Component2.prototype;
        return !(!Component2 || !Component2.isReactComponent);
      }
      function createWorkInProgress(current2, pendingProps) {
        var workInProgress2 = current2.alternate;
        null === workInProgress2 ? (workInProgress2 = createFiberImplClass(
          current2.tag,
          pendingProps,
          current2.key,
          current2.mode
        ), workInProgress2.elementType = current2.elementType, workInProgress2.type = current2.type, workInProgress2.stateNode = current2.stateNode, workInProgress2.alternate = current2, current2.alternate = workInProgress2) : (workInProgress2.pendingProps = pendingProps, workInProgress2.type = current2.type, workInProgress2.flags = 0, workInProgress2.subtreeFlags = 0, workInProgress2.deletions = null);
        workInProgress2.flags = current2.flags & 65011712;
        workInProgress2.childLanes = current2.childLanes;
        workInProgress2.lanes = current2.lanes;
        workInProgress2.child = current2.child;
        workInProgress2.memoizedProps = current2.memoizedProps;
        workInProgress2.memoizedState = current2.memoizedState;
        workInProgress2.updateQueue = current2.updateQueue;
        pendingProps = current2.dependencies;
        workInProgress2.dependencies = null === pendingProps ? null : { lanes: pendingProps.lanes, firstContext: pendingProps.firstContext };
        workInProgress2.sibling = current2.sibling;
        workInProgress2.index = current2.index;
        workInProgress2.ref = current2.ref;
        workInProgress2.refCleanup = current2.refCleanup;
        return workInProgress2;
      }
      function resetWorkInProgress(workInProgress2, renderLanes2) {
        workInProgress2.flags &= 65011714;
        var current2 = workInProgress2.alternate;
        null === current2 ? (workInProgress2.childLanes = 0, workInProgress2.lanes = renderLanes2, workInProgress2.child = null, workInProgress2.subtreeFlags = 0, workInProgress2.memoizedProps = null, workInProgress2.memoizedState = null, workInProgress2.updateQueue = null, workInProgress2.dependencies = null, workInProgress2.stateNode = null) : (workInProgress2.childLanes = current2.childLanes, workInProgress2.lanes = current2.lanes, workInProgress2.child = current2.child, workInProgress2.subtreeFlags = 0, workInProgress2.deletions = null, workInProgress2.memoizedProps = current2.memoizedProps, workInProgress2.memoizedState = current2.memoizedState, workInProgress2.updateQueue = current2.updateQueue, workInProgress2.type = current2.type, renderLanes2 = current2.dependencies, workInProgress2.dependencies = null === renderLanes2 ? null : {
          lanes: renderLanes2.lanes,
          firstContext: renderLanes2.firstContext
        });
        return workInProgress2;
      }
      function createFiberFromTypeAndProps(type, key2, pendingProps, owner, mode, lanes) {
        var fiberTag = 0;
        owner = type;
        if ("function" === typeof type) shouldConstruct(type) && (fiberTag = 1);
        else if ("string" === typeof type)
          fiberTag = isHostHoistableType(
            type,
            pendingProps,
            contextStackCursor.current
          ) ? 26 : "html" === type || "head" === type || "body" === type ? 27 : 5;
        else
          a: switch (type) {
            case REACT_ACTIVITY_TYPE:
              return type = createFiberImplClass(31, pendingProps, key2, mode), type.elementType = REACT_ACTIVITY_TYPE, type.lanes = lanes, type;
            case REACT_FRAGMENT_TYPE:
              return createFiberFromFragment(pendingProps.children, mode, lanes, key2);
            case REACT_STRICT_MODE_TYPE:
              fiberTag = 8;
              mode |= 24;
              break;
            case REACT_PROFILER_TYPE:
              return type = createFiberImplClass(12, pendingProps, key2, mode | 2), type.elementType = REACT_PROFILER_TYPE, type.lanes = lanes, type;
            case REACT_SUSPENSE_TYPE:
              return type = createFiberImplClass(13, pendingProps, key2, mode), type.elementType = REACT_SUSPENSE_TYPE, type.lanes = lanes, type;
            case REACT_SUSPENSE_LIST_TYPE:
              return type = createFiberImplClass(19, pendingProps, key2, mode), type.elementType = REACT_SUSPENSE_LIST_TYPE, type.lanes = lanes, type;
            default:
              if ("object" === typeof type && null !== type)
                switch (type.$$typeof) {
                  case REACT_CONTEXT_TYPE:
                    fiberTag = 10;
                    break a;
                  case REACT_CONSUMER_TYPE:
                    fiberTag = 9;
                    break a;
                  case REACT_FORWARD_REF_TYPE:
                    fiberTag = 11;
                    break a;
                  case REACT_MEMO_TYPE:
                    fiberTag = 14;
                    break a;
                  case REACT_LAZY_TYPE:
                    fiberTag = 16;
                    owner = null;
                    break a;
                }
              fiberTag = 29;
              pendingProps = Error(
                formatProdErrorMessage(130, null === type ? "null" : typeof type, "")
              );
              owner = null;
          }
        key2 = createFiberImplClass(fiberTag, pendingProps, key2, mode);
        key2.elementType = type;
        key2.type = owner;
        key2.lanes = lanes;
        return key2;
      }
      function createFiberFromFragment(elements, mode, lanes, key2) {
        elements = createFiberImplClass(7, elements, key2, mode);
        elements.lanes = lanes;
        return elements;
      }
      function createFiberFromText(content2, mode, lanes) {
        content2 = createFiberImplClass(6, content2, null, mode);
        content2.lanes = lanes;
        return content2;
      }
      function createFiberFromDehydratedFragment(dehydratedNode) {
        var fiber = createFiberImplClass(18, null, null, 0);
        fiber.stateNode = dehydratedNode;
        return fiber;
      }
      function createFiberFromPortal(portal, mode, lanes) {
        mode = createFiberImplClass(
          4,
          null !== portal.children ? portal.children : [],
          portal.key,
          mode
        );
        mode.lanes = lanes;
        mode.stateNode = {
          containerInfo: portal.containerInfo,
          pendingChildren: null,
          implementation: portal.implementation
        };
        return mode;
      }
      var CapturedStacks = /* @__PURE__ */ new WeakMap();
      function createCapturedValueAtFiber(value2, source2) {
        if ("object" === typeof value2 && null !== value2) {
          var existing = CapturedStacks.get(value2);
          if (void 0 !== existing) return existing;
          source2 = {
            value: value2,
            source: source2,
            stack: getStackByFiberInDevAndProd(source2)
          };
          CapturedStacks.set(value2, source2);
          return source2;
        }
        return {
          value: value2,
          source: source2,
          stack: getStackByFiberInDevAndProd(source2)
        };
      }
      var forkStack = [], forkStackIndex = 0, treeForkProvider = null, treeForkCount = 0, idStack = [], idStackIndex = 0, treeContextProvider = null, treeContextId = 1, treeContextOverflow = "";
      function pushTreeFork(workInProgress2, totalChildren) {
        forkStack[forkStackIndex++] = treeForkCount;
        forkStack[forkStackIndex++] = treeForkProvider;
        treeForkProvider = workInProgress2;
        treeForkCount = totalChildren;
      }
      function pushTreeId(workInProgress2, totalChildren, index2) {
        idStack[idStackIndex++] = treeContextId;
        idStack[idStackIndex++] = treeContextOverflow;
        idStack[idStackIndex++] = treeContextProvider;
        treeContextProvider = workInProgress2;
        var baseIdWithLeadingBit = treeContextId;
        workInProgress2 = treeContextOverflow;
        var baseLength = 32 - clz32(baseIdWithLeadingBit) - 1;
        baseIdWithLeadingBit &= ~(1 << baseLength);
        index2 += 1;
        var length = 32 - clz32(totalChildren) + baseLength;
        if (30 < length) {
          var numberOfOverflowBits = baseLength - baseLength % 5;
          length = (baseIdWithLeadingBit & (1 << numberOfOverflowBits) - 1).toString(32);
          baseIdWithLeadingBit >>= numberOfOverflowBits;
          baseLength -= numberOfOverflowBits;
          treeContextId = 1 << 32 - clz32(totalChildren) + baseLength | index2 << baseLength | baseIdWithLeadingBit;
          treeContextOverflow = length + workInProgress2;
        } else
          treeContextId = 1 << length | index2 << baseLength | baseIdWithLeadingBit, treeContextOverflow = workInProgress2;
      }
      function pushMaterializedTreeId(workInProgress2) {
        null !== workInProgress2.return && (pushTreeFork(workInProgress2, 1), pushTreeId(workInProgress2, 1, 0));
      }
      function popTreeContext(workInProgress2) {
        for (; workInProgress2 === treeForkProvider; )
          treeForkProvider = forkStack[--forkStackIndex], forkStack[forkStackIndex] = null, treeForkCount = forkStack[--forkStackIndex], forkStack[forkStackIndex] = null;
        for (; workInProgress2 === treeContextProvider; )
          treeContextProvider = idStack[--idStackIndex], idStack[idStackIndex] = null, treeContextOverflow = idStack[--idStackIndex], idStack[idStackIndex] = null, treeContextId = idStack[--idStackIndex], idStack[idStackIndex] = null;
      }
      function restoreSuspendedTreeContext(workInProgress2, suspendedContext) {
        idStack[idStackIndex++] = treeContextId;
        idStack[idStackIndex++] = treeContextOverflow;
        idStack[idStackIndex++] = treeContextProvider;
        treeContextId = suspendedContext.id;
        treeContextOverflow = suspendedContext.overflow;
        treeContextProvider = workInProgress2;
      }
      var hydrationParentFiber = null, nextHydratableInstance = null, isHydrating = false, hydrationErrors = null, rootOrSingletonContext = false, HydrationMismatchException = Error(formatProdErrorMessage(519));
      function throwOnHydrationMismatch(fiber) {
        var error2 = Error(
          formatProdErrorMessage(
            418,
            1 < arguments.length && void 0 !== arguments[1] && arguments[1] ? "text" : "HTML",
            ""
          )
        );
        queueHydrationError(createCapturedValueAtFiber(error2, fiber));
        throw HydrationMismatchException;
      }
      function prepareToHydrateHostInstance(fiber) {
        var instance = fiber.stateNode, type = fiber.type, props = fiber.memoizedProps;
        instance[internalInstanceKey] = fiber;
        instance[internalPropsKey] = props;
        switch (type) {
          case "dialog":
            listenToNonDelegatedEvent("cancel", instance);
            listenToNonDelegatedEvent("close", instance);
            break;
          case "iframe":
          case "object":
          case "embed":
            listenToNonDelegatedEvent("load", instance);
            break;
          case "video":
          case "audio":
            for (type = 0; type < mediaEventTypes.length; type++)
              listenToNonDelegatedEvent(mediaEventTypes[type], instance);
            break;
          case "source":
            listenToNonDelegatedEvent("error", instance);
            break;
          case "img":
          case "image":
          case "link":
            listenToNonDelegatedEvent("error", instance);
            listenToNonDelegatedEvent("load", instance);
            break;
          case "details":
            listenToNonDelegatedEvent("toggle", instance);
            break;
          case "input":
            listenToNonDelegatedEvent("invalid", instance);
            initInput(
              instance,
              props.value,
              props.defaultValue,
              props.checked,
              props.defaultChecked,
              props.type,
              props.name,
              true
            );
            break;
          case "select":
            listenToNonDelegatedEvent("invalid", instance);
            break;
          case "textarea":
            listenToNonDelegatedEvent("invalid", instance), initTextarea(instance, props.value, props.defaultValue, props.children);
        }
        type = props.children;
        "string" !== typeof type && "number" !== typeof type && "bigint" !== typeof type || instance.textContent === "" + type || true === props.suppressHydrationWarning || checkForUnmatchedText(instance.textContent, type) ? (null != props.popover && (listenToNonDelegatedEvent("beforetoggle", instance), listenToNonDelegatedEvent("toggle", instance)), null != props.onScroll && listenToNonDelegatedEvent("scroll", instance), null != props.onScrollEnd && listenToNonDelegatedEvent("scrollend", instance), null != props.onClick && (instance.onclick = noop$1), instance = true) : instance = false;
        instance || throwOnHydrationMismatch(fiber, true);
      }
      function popToNextHostParent(fiber) {
        for (hydrationParentFiber = fiber.return; hydrationParentFiber; )
          switch (hydrationParentFiber.tag) {
            case 5:
            case 31:
            case 13:
              rootOrSingletonContext = false;
              return;
            case 27:
            case 3:
              rootOrSingletonContext = true;
              return;
            default:
              hydrationParentFiber = hydrationParentFiber.return;
          }
      }
      function popHydrationState(fiber) {
        if (fiber !== hydrationParentFiber) return false;
        if (!isHydrating) return popToNextHostParent(fiber), isHydrating = true, false;
        var tag = fiber.tag, JSCompiler_temp;
        if (JSCompiler_temp = 3 !== tag && 27 !== tag) {
          if (JSCompiler_temp = 5 === tag)
            JSCompiler_temp = fiber.type, JSCompiler_temp = !("form" !== JSCompiler_temp && "button" !== JSCompiler_temp) || shouldSetTextContent(fiber.type, fiber.memoizedProps);
          JSCompiler_temp = !JSCompiler_temp;
        }
        JSCompiler_temp && nextHydratableInstance && throwOnHydrationMismatch(fiber);
        popToNextHostParent(fiber);
        if (13 === tag) {
          fiber = fiber.memoizedState;
          fiber = null !== fiber ? fiber.dehydrated : null;
          if (!fiber) throw Error(formatProdErrorMessage(317));
          nextHydratableInstance = getNextHydratableInstanceAfterHydrationBoundary(fiber);
        } else if (31 === tag) {
          fiber = fiber.memoizedState;
          fiber = null !== fiber ? fiber.dehydrated : null;
          if (!fiber) throw Error(formatProdErrorMessage(317));
          nextHydratableInstance = getNextHydratableInstanceAfterHydrationBoundary(fiber);
        } else
          27 === tag ? (tag = nextHydratableInstance, isSingletonScope(fiber.type) ? (fiber = previousHydratableOnEnteringScopedSingleton, previousHydratableOnEnteringScopedSingleton = null, nextHydratableInstance = fiber) : nextHydratableInstance = tag) : nextHydratableInstance = hydrationParentFiber ? getNextHydratable(fiber.stateNode.nextSibling) : null;
        return true;
      }
      function resetHydrationState() {
        nextHydratableInstance = hydrationParentFiber = null;
        isHydrating = false;
      }
      function upgradeHydrationErrorsToRecoverable() {
        var queuedErrors = hydrationErrors;
        null !== queuedErrors && (null === workInProgressRootRecoverableErrors ? workInProgressRootRecoverableErrors = queuedErrors : workInProgressRootRecoverableErrors.push.apply(
          workInProgressRootRecoverableErrors,
          queuedErrors
        ), hydrationErrors = null);
        return queuedErrors;
      }
      function queueHydrationError(error2) {
        null === hydrationErrors ? hydrationErrors = [error2] : hydrationErrors.push(error2);
      }
      var valueCursor = createCursor(null), currentlyRenderingFiber$1 = null, lastContextDependency = null;
      function pushProvider(providerFiber, context, nextValue) {
        push2(valueCursor, context._currentValue);
        context._currentValue = nextValue;
      }
      function popProvider(context) {
        context._currentValue = valueCursor.current;
        pop2(valueCursor);
      }
      function scheduleContextWorkOnParentPath(parent, renderLanes2, propagationRoot) {
        for (; null !== parent; ) {
          var alternate = parent.alternate;
          (parent.childLanes & renderLanes2) !== renderLanes2 ? (parent.childLanes |= renderLanes2, null !== alternate && (alternate.childLanes |= renderLanes2)) : null !== alternate && (alternate.childLanes & renderLanes2) !== renderLanes2 && (alternate.childLanes |= renderLanes2);
          if (parent === propagationRoot) break;
          parent = parent.return;
        }
      }
      function propagateContextChanges(workInProgress2, contexts, renderLanes2, forcePropagateEntireTree) {
        var fiber = workInProgress2.child;
        null !== fiber && (fiber.return = workInProgress2);
        for (; null !== fiber; ) {
          var list2 = fiber.dependencies;
          if (null !== list2) {
            var nextFiber = fiber.child;
            list2 = list2.firstContext;
            a: for (; null !== list2; ) {
              var dependency = list2;
              list2 = fiber;
              for (var i2 = 0; i2 < contexts.length; i2++)
                if (dependency.context === contexts[i2]) {
                  list2.lanes |= renderLanes2;
                  dependency = list2.alternate;
                  null !== dependency && (dependency.lanes |= renderLanes2);
                  scheduleContextWorkOnParentPath(
                    list2.return,
                    renderLanes2,
                    workInProgress2
                  );
                  forcePropagateEntireTree || (nextFiber = null);
                  break a;
                }
              list2 = dependency.next;
            }
          } else if (18 === fiber.tag) {
            nextFiber = fiber.return;
            if (null === nextFiber) throw Error(formatProdErrorMessage(341));
            nextFiber.lanes |= renderLanes2;
            list2 = nextFiber.alternate;
            null !== list2 && (list2.lanes |= renderLanes2);
            scheduleContextWorkOnParentPath(nextFiber, renderLanes2, workInProgress2);
            nextFiber = null;
          } else nextFiber = fiber.child;
          if (null !== nextFiber) nextFiber.return = fiber;
          else
            for (nextFiber = fiber; null !== nextFiber; ) {
              if (nextFiber === workInProgress2) {
                nextFiber = null;
                break;
              }
              fiber = nextFiber.sibling;
              if (null !== fiber) {
                fiber.return = nextFiber.return;
                nextFiber = fiber;
                break;
              }
              nextFiber = nextFiber.return;
            }
          fiber = nextFiber;
        }
      }
      function propagateParentContextChanges(current2, workInProgress2, renderLanes2, forcePropagateEntireTree) {
        current2 = null;
        for (var parent = workInProgress2, isInsidePropagationBailout = false; null !== parent; ) {
          if (!isInsidePropagationBailout) {
            if (0 !== (parent.flags & 524288)) isInsidePropagationBailout = true;
            else if (0 !== (parent.flags & 262144)) break;
          }
          if (10 === parent.tag) {
            var currentParent = parent.alternate;
            if (null === currentParent) throw Error(formatProdErrorMessage(387));
            currentParent = currentParent.memoizedProps;
            if (null !== currentParent) {
              var context = parent.type;
              objectIs(parent.pendingProps.value, currentParent.value) || (null !== current2 ? current2.push(context) : current2 = [context]);
            }
          } else if (parent === hostTransitionProviderCursor.current) {
            currentParent = parent.alternate;
            if (null === currentParent) throw Error(formatProdErrorMessage(387));
            currentParent.memoizedState.memoizedState !== parent.memoizedState.memoizedState && (null !== current2 ? current2.push(HostTransitionContext) : current2 = [HostTransitionContext]);
          }
          parent = parent.return;
        }
        null !== current2 && propagateContextChanges(
          workInProgress2,
          current2,
          renderLanes2,
          forcePropagateEntireTree
        );
        workInProgress2.flags |= 262144;
      }
      function checkIfContextChanged(currentDependencies) {
        for (currentDependencies = currentDependencies.firstContext; null !== currentDependencies; ) {
          if (!objectIs(
            currentDependencies.context._currentValue,
            currentDependencies.memoizedValue
          ))
            return true;
          currentDependencies = currentDependencies.next;
        }
        return false;
      }
      function prepareToReadContext(workInProgress2) {
        currentlyRenderingFiber$1 = workInProgress2;
        lastContextDependency = null;
        workInProgress2 = workInProgress2.dependencies;
        null !== workInProgress2 && (workInProgress2.firstContext = null);
      }
      function readContext(context) {
        return readContextForConsumer(currentlyRenderingFiber$1, context);
      }
      function readContextDuringReconciliation(consumer, context) {
        null === currentlyRenderingFiber$1 && prepareToReadContext(consumer);
        return readContextForConsumer(consumer, context);
      }
      function readContextForConsumer(consumer, context) {
        var value2 = context._currentValue;
        context = { context, memoizedValue: value2, next: null };
        if (null === lastContextDependency) {
          if (null === consumer) throw Error(formatProdErrorMessage(308));
          lastContextDependency = context;
          consumer.dependencies = { lanes: 0, firstContext: context };
          consumer.flags |= 524288;
        } else lastContextDependency = lastContextDependency.next = context;
        return value2;
      }
      var AbortControllerLocal = "undefined" !== typeof AbortController ? AbortController : function() {
        var listeners = [], signal = this.signal = {
          aborted: false,
          addEventListener: function(type, listener) {
            listeners.push(listener);
          }
        };
        this.abort = function() {
          signal.aborted = true;
          listeners.forEach(function(listener) {
            return listener();
          });
        };
      }, scheduleCallback$2 = Scheduler.unstable_scheduleCallback, NormalPriority = Scheduler.unstable_NormalPriority, CacheContext = {
        $$typeof: REACT_CONTEXT_TYPE,
        Consumer: null,
        Provider: null,
        _currentValue: null,
        _currentValue2: null,
        _threadCount: 0
      };
      function createCache() {
        return {
          controller: new AbortControllerLocal(),
          data: /* @__PURE__ */ new Map(),
          refCount: 0
        };
      }
      function releaseCache(cache) {
        cache.refCount--;
        0 === cache.refCount && scheduleCallback$2(NormalPriority, function() {
          cache.controller.abort();
        });
      }
      var currentEntangledListeners = null, currentEntangledPendingCount = 0, currentEntangledLane = 0, currentEntangledActionThenable = null;
      function entangleAsyncAction(transition, thenable) {
        if (null === currentEntangledListeners) {
          var entangledListeners = currentEntangledListeners = [];
          currentEntangledPendingCount = 0;
          currentEntangledLane = requestTransitionLane();
          currentEntangledActionThenable = {
            status: "pending",
            value: void 0,
            then: function(resolve) {
              entangledListeners.push(resolve);
            }
          };
        }
        currentEntangledPendingCount++;
        thenable.then(pingEngtangledActionScope, pingEngtangledActionScope);
        return thenable;
      }
      function pingEngtangledActionScope() {
        if (0 === --currentEntangledPendingCount && null !== currentEntangledListeners) {
          null !== currentEntangledActionThenable && (currentEntangledActionThenable.status = "fulfilled");
          var listeners = currentEntangledListeners;
          currentEntangledListeners = null;
          currentEntangledLane = 0;
          currentEntangledActionThenable = null;
          for (var i2 = 0; i2 < listeners.length; i2++) (0, listeners[i2])();
        }
      }
      function chainThenableValue(thenable, result2) {
        var listeners = [], thenableWithOverride = {
          status: "pending",
          value: null,
          reason: null,
          then: function(resolve) {
            listeners.push(resolve);
          }
        };
        thenable.then(
          function() {
            thenableWithOverride.status = "fulfilled";
            thenableWithOverride.value = result2;
            for (var i2 = 0; i2 < listeners.length; i2++) (0, listeners[i2])(result2);
          },
          function(error2) {
            thenableWithOverride.status = "rejected";
            thenableWithOverride.reason = error2;
            for (error2 = 0; error2 < listeners.length; error2++)
              (0, listeners[error2])(void 0);
          }
        );
        return thenableWithOverride;
      }
      var prevOnStartTransitionFinish = ReactSharedInternals.S;
      ReactSharedInternals.S = function(transition, returnValue) {
        globalMostRecentTransitionTime = now();
        "object" === typeof returnValue && null !== returnValue && "function" === typeof returnValue.then && entangleAsyncAction(transition, returnValue);
        null !== prevOnStartTransitionFinish && prevOnStartTransitionFinish(transition, returnValue);
      };
      var resumedCache = createCursor(null);
      function peekCacheFromPool() {
        var cacheResumedFromPreviousRender = resumedCache.current;
        return null !== cacheResumedFromPreviousRender ? cacheResumedFromPreviousRender : workInProgressRoot.pooledCache;
      }
      function pushTransition(offscreenWorkInProgress, prevCachePool) {
        null === prevCachePool ? push2(resumedCache, resumedCache.current) : push2(resumedCache, prevCachePool.pool);
      }
      function getSuspendedCache() {
        var cacheFromPool = peekCacheFromPool();
        return null === cacheFromPool ? null : { parent: CacheContext._currentValue, pool: cacheFromPool };
      }
      var SuspenseException = Error(formatProdErrorMessage(460)), SuspenseyCommitException = Error(formatProdErrorMessage(474)), SuspenseActionException = Error(formatProdErrorMessage(542)), noopSuspenseyCommitThenable = { then: function() {
      } };
      function isThenableResolved(thenable) {
        thenable = thenable.status;
        return "fulfilled" === thenable || "rejected" === thenable;
      }
      function trackUsedThenable(thenableState2, thenable, index2) {
        index2 = thenableState2[index2];
        void 0 === index2 ? thenableState2.push(thenable) : index2 !== thenable && (thenable.then(noop$1, noop$1), thenable = index2);
        switch (thenable.status) {
          case "fulfilled":
            return thenable.value;
          case "rejected":
            throw thenableState2 = thenable.reason, checkIfUseWrappedInAsyncCatch(thenableState2), thenableState2;
          default:
            if ("string" === typeof thenable.status) thenable.then(noop$1, noop$1);
            else {
              thenableState2 = workInProgressRoot;
              if (null !== thenableState2 && 100 < thenableState2.shellSuspendCounter)
                throw Error(formatProdErrorMessage(482));
              thenableState2 = thenable;
              thenableState2.status = "pending";
              thenableState2.then(
                function(fulfilledValue) {
                  if ("pending" === thenable.status) {
                    var fulfilledThenable = thenable;
                    fulfilledThenable.status = "fulfilled";
                    fulfilledThenable.value = fulfilledValue;
                  }
                },
                function(error2) {
                  if ("pending" === thenable.status) {
                    var rejectedThenable = thenable;
                    rejectedThenable.status = "rejected";
                    rejectedThenable.reason = error2;
                  }
                }
              );
            }
            switch (thenable.status) {
              case "fulfilled":
                return thenable.value;
              case "rejected":
                throw thenableState2 = thenable.reason, checkIfUseWrappedInAsyncCatch(thenableState2), thenableState2;
            }
            suspendedThenable = thenable;
            throw SuspenseException;
        }
      }
      function resolveLazy(lazyType) {
        try {
          var init2 = lazyType._init;
          return init2(lazyType._payload);
        } catch (x2) {
          if (null !== x2 && "object" === typeof x2 && "function" === typeof x2.then)
            throw suspendedThenable = x2, SuspenseException;
          throw x2;
        }
      }
      var suspendedThenable = null;
      function getSuspendedThenable() {
        if (null === suspendedThenable) throw Error(formatProdErrorMessage(459));
        var thenable = suspendedThenable;
        suspendedThenable = null;
        return thenable;
      }
      function checkIfUseWrappedInAsyncCatch(rejectedReason) {
        if (rejectedReason === SuspenseException || rejectedReason === SuspenseActionException)
          throw Error(formatProdErrorMessage(483));
      }
      var thenableState$1 = null, thenableIndexCounter$1 = 0;
      function unwrapThenable(thenable) {
        var index2 = thenableIndexCounter$1;
        thenableIndexCounter$1 += 1;
        null === thenableState$1 && (thenableState$1 = []);
        return trackUsedThenable(thenableState$1, thenable, index2);
      }
      function coerceRef(workInProgress2, element) {
        element = element.props.ref;
        workInProgress2.ref = void 0 !== element ? element : null;
      }
      function throwOnInvalidObjectTypeImpl(returnFiber, newChild) {
        if (newChild.$$typeof === REACT_LEGACY_ELEMENT_TYPE)
          throw Error(formatProdErrorMessage(525));
        returnFiber = Object.prototype.toString.call(newChild);
        throw Error(
          formatProdErrorMessage(
            31,
            "[object Object]" === returnFiber ? "object with keys {" + Object.keys(newChild).join(", ") + "}" : returnFiber
          )
        );
      }
      function createChildReconciler(shouldTrackSideEffects) {
        function deleteChild(returnFiber, childToDelete) {
          if (shouldTrackSideEffects) {
            var deletions = returnFiber.deletions;
            null === deletions ? (returnFiber.deletions = [childToDelete], returnFiber.flags |= 16) : deletions.push(childToDelete);
          }
        }
        function deleteRemainingChildren(returnFiber, currentFirstChild) {
          if (!shouldTrackSideEffects) return null;
          for (; null !== currentFirstChild; )
            deleteChild(returnFiber, currentFirstChild), currentFirstChild = currentFirstChild.sibling;
          return null;
        }
        function mapRemainingChildren(currentFirstChild) {
          for (var existingChildren = /* @__PURE__ */ new Map(); null !== currentFirstChild; )
            null !== currentFirstChild.key ? existingChildren.set(currentFirstChild.key, currentFirstChild) : existingChildren.set(currentFirstChild.index, currentFirstChild), currentFirstChild = currentFirstChild.sibling;
          return existingChildren;
        }
        function useFiber(fiber, pendingProps) {
          fiber = createWorkInProgress(fiber, pendingProps);
          fiber.index = 0;
          fiber.sibling = null;
          return fiber;
        }
        function placeChild(newFiber, lastPlacedIndex, newIndex) {
          newFiber.index = newIndex;
          if (!shouldTrackSideEffects)
            return newFiber.flags |= 1048576, lastPlacedIndex;
          newIndex = newFiber.alternate;
          if (null !== newIndex)
            return newIndex = newIndex.index, newIndex < lastPlacedIndex ? (newFiber.flags |= 67108866, lastPlacedIndex) : newIndex;
          newFiber.flags |= 67108866;
          return lastPlacedIndex;
        }
        function placeSingleChild(newFiber) {
          shouldTrackSideEffects && null === newFiber.alternate && (newFiber.flags |= 67108866);
          return newFiber;
        }
        function updateTextNode(returnFiber, current2, textContent, lanes) {
          if (null === current2 || 6 !== current2.tag)
            return current2 = createFiberFromText(textContent, returnFiber.mode, lanes), current2.return = returnFiber, current2;
          current2 = useFiber(current2, textContent);
          current2.return = returnFiber;
          return current2;
        }
        function updateElement(returnFiber, current2, element, lanes) {
          var elementType = element.type;
          if (elementType === REACT_FRAGMENT_TYPE)
            return updateFragment(
              returnFiber,
              current2,
              element.props.children,
              lanes,
              element.key
            );
          if (null !== current2 && (current2.elementType === elementType || "object" === typeof elementType && null !== elementType && elementType.$$typeof === REACT_LAZY_TYPE && resolveLazy(elementType) === current2.type))
            return current2 = useFiber(current2, element.props), coerceRef(current2, element), current2.return = returnFiber, current2;
          current2 = createFiberFromTypeAndProps(
            element.type,
            element.key,
            element.props,
            null,
            returnFiber.mode,
            lanes
          );
          coerceRef(current2, element);
          current2.return = returnFiber;
          return current2;
        }
        function updatePortal(returnFiber, current2, portal, lanes) {
          if (null === current2 || 4 !== current2.tag || current2.stateNode.containerInfo !== portal.containerInfo || current2.stateNode.implementation !== portal.implementation)
            return current2 = createFiberFromPortal(portal, returnFiber.mode, lanes), current2.return = returnFiber, current2;
          current2 = useFiber(current2, portal.children || []);
          current2.return = returnFiber;
          return current2;
        }
        function updateFragment(returnFiber, current2, fragment, lanes, key2) {
          if (null === current2 || 7 !== current2.tag)
            return current2 = createFiberFromFragment(
              fragment,
              returnFiber.mode,
              lanes,
              key2
            ), current2.return = returnFiber, current2;
          current2 = useFiber(current2, fragment);
          current2.return = returnFiber;
          return current2;
        }
        function createChild(returnFiber, newChild, lanes) {
          if ("string" === typeof newChild && "" !== newChild || "number" === typeof newChild || "bigint" === typeof newChild)
            return newChild = createFiberFromText(
              "" + newChild,
              returnFiber.mode,
              lanes
            ), newChild.return = returnFiber, newChild;
          if ("object" === typeof newChild && null !== newChild) {
            switch (newChild.$$typeof) {
              case REACT_ELEMENT_TYPE:
                return lanes = createFiberFromTypeAndProps(
                  newChild.type,
                  newChild.key,
                  newChild.props,
                  null,
                  returnFiber.mode,
                  lanes
                ), coerceRef(lanes, newChild), lanes.return = returnFiber, lanes;
              case REACT_PORTAL_TYPE:
                return newChild = createFiberFromPortal(
                  newChild,
                  returnFiber.mode,
                  lanes
                ), newChild.return = returnFiber, newChild;
              case REACT_LAZY_TYPE:
                return newChild = resolveLazy(newChild), createChild(returnFiber, newChild, lanes);
            }
            if (isArrayImpl(newChild) || getIteratorFn(newChild))
              return newChild = createFiberFromFragment(
                newChild,
                returnFiber.mode,
                lanes,
                null
              ), newChild.return = returnFiber, newChild;
            if ("function" === typeof newChild.then)
              return createChild(returnFiber, unwrapThenable(newChild), lanes);
            if (newChild.$$typeof === REACT_CONTEXT_TYPE)
              return createChild(
                returnFiber,
                readContextDuringReconciliation(returnFiber, newChild),
                lanes
              );
            throwOnInvalidObjectTypeImpl(returnFiber, newChild);
          }
          return null;
        }
        function updateSlot(returnFiber, oldFiber, newChild, lanes) {
          var key2 = null !== oldFiber ? oldFiber.key : null;
          if ("string" === typeof newChild && "" !== newChild || "number" === typeof newChild || "bigint" === typeof newChild)
            return null !== key2 ? null : updateTextNode(returnFiber, oldFiber, "" + newChild, lanes);
          if ("object" === typeof newChild && null !== newChild) {
            switch (newChild.$$typeof) {
              case REACT_ELEMENT_TYPE:
                return newChild.key === key2 ? updateElement(returnFiber, oldFiber, newChild, lanes) : null;
              case REACT_PORTAL_TYPE:
                return newChild.key === key2 ? updatePortal(returnFiber, oldFiber, newChild, lanes) : null;
              case REACT_LAZY_TYPE:
                return newChild = resolveLazy(newChild), updateSlot(returnFiber, oldFiber, newChild, lanes);
            }
            if (isArrayImpl(newChild) || getIteratorFn(newChild))
              return null !== key2 ? null : updateFragment(returnFiber, oldFiber, newChild, lanes, null);
            if ("function" === typeof newChild.then)
              return updateSlot(
                returnFiber,
                oldFiber,
                unwrapThenable(newChild),
                lanes
              );
            if (newChild.$$typeof === REACT_CONTEXT_TYPE)
              return updateSlot(
                returnFiber,
                oldFiber,
                readContextDuringReconciliation(returnFiber, newChild),
                lanes
              );
            throwOnInvalidObjectTypeImpl(returnFiber, newChild);
          }
          return null;
        }
        function updateFromMap(existingChildren, returnFiber, newIdx, newChild, lanes) {
          if ("string" === typeof newChild && "" !== newChild || "number" === typeof newChild || "bigint" === typeof newChild)
            return existingChildren = existingChildren.get(newIdx) || null, updateTextNode(returnFiber, existingChildren, "" + newChild, lanes);
          if ("object" === typeof newChild && null !== newChild) {
            switch (newChild.$$typeof) {
              case REACT_ELEMENT_TYPE:
                return existingChildren = existingChildren.get(
                  null === newChild.key ? newIdx : newChild.key
                ) || null, updateElement(returnFiber, existingChildren, newChild, lanes);
              case REACT_PORTAL_TYPE:
                return existingChildren = existingChildren.get(
                  null === newChild.key ? newIdx : newChild.key
                ) || null, updatePortal(returnFiber, existingChildren, newChild, lanes);
              case REACT_LAZY_TYPE:
                return newChild = resolveLazy(newChild), updateFromMap(
                  existingChildren,
                  returnFiber,
                  newIdx,
                  newChild,
                  lanes
                );
            }
            if (isArrayImpl(newChild) || getIteratorFn(newChild))
              return existingChildren = existingChildren.get(newIdx) || null, updateFragment(returnFiber, existingChildren, newChild, lanes, null);
            if ("function" === typeof newChild.then)
              return updateFromMap(
                existingChildren,
                returnFiber,
                newIdx,
                unwrapThenable(newChild),
                lanes
              );
            if (newChild.$$typeof === REACT_CONTEXT_TYPE)
              return updateFromMap(
                existingChildren,
                returnFiber,
                newIdx,
                readContextDuringReconciliation(returnFiber, newChild),
                lanes
              );
            throwOnInvalidObjectTypeImpl(returnFiber, newChild);
          }
          return null;
        }
        function reconcileChildrenArray(returnFiber, currentFirstChild, newChildren, lanes) {
          for (var resultingFirstChild = null, previousNewFiber = null, oldFiber = currentFirstChild, newIdx = currentFirstChild = 0, nextOldFiber = null; null !== oldFiber && newIdx < newChildren.length; newIdx++) {
            oldFiber.index > newIdx ? (nextOldFiber = oldFiber, oldFiber = null) : nextOldFiber = oldFiber.sibling;
            var newFiber = updateSlot(
              returnFiber,
              oldFiber,
              newChildren[newIdx],
              lanes
            );
            if (null === newFiber) {
              null === oldFiber && (oldFiber = nextOldFiber);
              break;
            }
            shouldTrackSideEffects && oldFiber && null === newFiber.alternate && deleteChild(returnFiber, oldFiber);
            currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx);
            null === previousNewFiber ? resultingFirstChild = newFiber : previousNewFiber.sibling = newFiber;
            previousNewFiber = newFiber;
            oldFiber = nextOldFiber;
          }
          if (newIdx === newChildren.length)
            return deleteRemainingChildren(returnFiber, oldFiber), isHydrating && pushTreeFork(returnFiber, newIdx), resultingFirstChild;
          if (null === oldFiber) {
            for (; newIdx < newChildren.length; newIdx++)
              oldFiber = createChild(returnFiber, newChildren[newIdx], lanes), null !== oldFiber && (currentFirstChild = placeChild(
                oldFiber,
                currentFirstChild,
                newIdx
              ), null === previousNewFiber ? resultingFirstChild = oldFiber : previousNewFiber.sibling = oldFiber, previousNewFiber = oldFiber);
            isHydrating && pushTreeFork(returnFiber, newIdx);
            return resultingFirstChild;
          }
          for (oldFiber = mapRemainingChildren(oldFiber); newIdx < newChildren.length; newIdx++)
            nextOldFiber = updateFromMap(
              oldFiber,
              returnFiber,
              newIdx,
              newChildren[newIdx],
              lanes
            ), null !== nextOldFiber && (shouldTrackSideEffects && null !== nextOldFiber.alternate && oldFiber.delete(
              null === nextOldFiber.key ? newIdx : nextOldFiber.key
            ), currentFirstChild = placeChild(
              nextOldFiber,
              currentFirstChild,
              newIdx
            ), null === previousNewFiber ? resultingFirstChild = nextOldFiber : previousNewFiber.sibling = nextOldFiber, previousNewFiber = nextOldFiber);
          shouldTrackSideEffects && oldFiber.forEach(function(child) {
            return deleteChild(returnFiber, child);
          });
          isHydrating && pushTreeFork(returnFiber, newIdx);
          return resultingFirstChild;
        }
        function reconcileChildrenIterator(returnFiber, currentFirstChild, newChildren, lanes) {
          if (null == newChildren) throw Error(formatProdErrorMessage(151));
          for (var resultingFirstChild = null, previousNewFiber = null, oldFiber = currentFirstChild, newIdx = currentFirstChild = 0, nextOldFiber = null, step = newChildren.next(); null !== oldFiber && !step.done; newIdx++, step = newChildren.next()) {
            oldFiber.index > newIdx ? (nextOldFiber = oldFiber, oldFiber = null) : nextOldFiber = oldFiber.sibling;
            var newFiber = updateSlot(returnFiber, oldFiber, step.value, lanes);
            if (null === newFiber) {
              null === oldFiber && (oldFiber = nextOldFiber);
              break;
            }
            shouldTrackSideEffects && oldFiber && null === newFiber.alternate && deleteChild(returnFiber, oldFiber);
            currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx);
            null === previousNewFiber ? resultingFirstChild = newFiber : previousNewFiber.sibling = newFiber;
            previousNewFiber = newFiber;
            oldFiber = nextOldFiber;
          }
          if (step.done)
            return deleteRemainingChildren(returnFiber, oldFiber), isHydrating && pushTreeFork(returnFiber, newIdx), resultingFirstChild;
          if (null === oldFiber) {
            for (; !step.done; newIdx++, step = newChildren.next())
              step = createChild(returnFiber, step.value, lanes), null !== step && (currentFirstChild = placeChild(step, currentFirstChild, newIdx), null === previousNewFiber ? resultingFirstChild = step : previousNewFiber.sibling = step, previousNewFiber = step);
            isHydrating && pushTreeFork(returnFiber, newIdx);
            return resultingFirstChild;
          }
          for (oldFiber = mapRemainingChildren(oldFiber); !step.done; newIdx++, step = newChildren.next())
            step = updateFromMap(oldFiber, returnFiber, newIdx, step.value, lanes), null !== step && (shouldTrackSideEffects && null !== step.alternate && oldFiber.delete(null === step.key ? newIdx : step.key), currentFirstChild = placeChild(step, currentFirstChild, newIdx), null === previousNewFiber ? resultingFirstChild = step : previousNewFiber.sibling = step, previousNewFiber = step);
          shouldTrackSideEffects && oldFiber.forEach(function(child) {
            return deleteChild(returnFiber, child);
          });
          isHydrating && pushTreeFork(returnFiber, newIdx);
          return resultingFirstChild;
        }
        function reconcileChildFibersImpl(returnFiber, currentFirstChild, newChild, lanes) {
          "object" === typeof newChild && null !== newChild && newChild.type === REACT_FRAGMENT_TYPE && null === newChild.key && (newChild = newChild.props.children);
          if ("object" === typeof newChild && null !== newChild) {
            switch (newChild.$$typeof) {
              case REACT_ELEMENT_TYPE:
                a: {
                  for (var key2 = newChild.key; null !== currentFirstChild; ) {
                    if (currentFirstChild.key === key2) {
                      key2 = newChild.type;
                      if (key2 === REACT_FRAGMENT_TYPE) {
                        if (7 === currentFirstChild.tag) {
                          deleteRemainingChildren(
                            returnFiber,
                            currentFirstChild.sibling
                          );
                          lanes = useFiber(
                            currentFirstChild,
                            newChild.props.children
                          );
                          lanes.return = returnFiber;
                          returnFiber = lanes;
                          break a;
                        }
                      } else if (currentFirstChild.elementType === key2 || "object" === typeof key2 && null !== key2 && key2.$$typeof === REACT_LAZY_TYPE && resolveLazy(key2) === currentFirstChild.type) {
                        deleteRemainingChildren(
                          returnFiber,
                          currentFirstChild.sibling
                        );
                        lanes = useFiber(currentFirstChild, newChild.props);
                        coerceRef(lanes, newChild);
                        lanes.return = returnFiber;
                        returnFiber = lanes;
                        break a;
                      }
                      deleteRemainingChildren(returnFiber, currentFirstChild);
                      break;
                    } else deleteChild(returnFiber, currentFirstChild);
                    currentFirstChild = currentFirstChild.sibling;
                  }
                  newChild.type === REACT_FRAGMENT_TYPE ? (lanes = createFiberFromFragment(
                    newChild.props.children,
                    returnFiber.mode,
                    lanes,
                    newChild.key
                  ), lanes.return = returnFiber, returnFiber = lanes) : (lanes = createFiberFromTypeAndProps(
                    newChild.type,
                    newChild.key,
                    newChild.props,
                    null,
                    returnFiber.mode,
                    lanes
                  ), coerceRef(lanes, newChild), lanes.return = returnFiber, returnFiber = lanes);
                }
                return placeSingleChild(returnFiber);
              case REACT_PORTAL_TYPE:
                a: {
                  for (key2 = newChild.key; null !== currentFirstChild; ) {
                    if (currentFirstChild.key === key2)
                      if (4 === currentFirstChild.tag && currentFirstChild.stateNode.containerInfo === newChild.containerInfo && currentFirstChild.stateNode.implementation === newChild.implementation) {
                        deleteRemainingChildren(
                          returnFiber,
                          currentFirstChild.sibling
                        );
                        lanes = useFiber(currentFirstChild, newChild.children || []);
                        lanes.return = returnFiber;
                        returnFiber = lanes;
                        break a;
                      } else {
                        deleteRemainingChildren(returnFiber, currentFirstChild);
                        break;
                      }
                    else deleteChild(returnFiber, currentFirstChild);
                    currentFirstChild = currentFirstChild.sibling;
                  }
                  lanes = createFiberFromPortal(newChild, returnFiber.mode, lanes);
                  lanes.return = returnFiber;
                  returnFiber = lanes;
                }
                return placeSingleChild(returnFiber);
              case REACT_LAZY_TYPE:
                return newChild = resolveLazy(newChild), reconcileChildFibersImpl(
                  returnFiber,
                  currentFirstChild,
                  newChild,
                  lanes
                );
            }
            if (isArrayImpl(newChild))
              return reconcileChildrenArray(
                returnFiber,
                currentFirstChild,
                newChild,
                lanes
              );
            if (getIteratorFn(newChild)) {
              key2 = getIteratorFn(newChild);
              if ("function" !== typeof key2) throw Error(formatProdErrorMessage(150));
              newChild = key2.call(newChild);
              return reconcileChildrenIterator(
                returnFiber,
                currentFirstChild,
                newChild,
                lanes
              );
            }
            if ("function" === typeof newChild.then)
              return reconcileChildFibersImpl(
                returnFiber,
                currentFirstChild,
                unwrapThenable(newChild),
                lanes
              );
            if (newChild.$$typeof === REACT_CONTEXT_TYPE)
              return reconcileChildFibersImpl(
                returnFiber,
                currentFirstChild,
                readContextDuringReconciliation(returnFiber, newChild),
                lanes
              );
            throwOnInvalidObjectTypeImpl(returnFiber, newChild);
          }
          return "string" === typeof newChild && "" !== newChild || "number" === typeof newChild || "bigint" === typeof newChild ? (newChild = "" + newChild, null !== currentFirstChild && 6 === currentFirstChild.tag ? (deleteRemainingChildren(returnFiber, currentFirstChild.sibling), lanes = useFiber(currentFirstChild, newChild), lanes.return = returnFiber, returnFiber = lanes) : (deleteRemainingChildren(returnFiber, currentFirstChild), lanes = createFiberFromText(newChild, returnFiber.mode, lanes), lanes.return = returnFiber, returnFiber = lanes), placeSingleChild(returnFiber)) : deleteRemainingChildren(returnFiber, currentFirstChild);
        }
        return function(returnFiber, currentFirstChild, newChild, lanes) {
          try {
            thenableIndexCounter$1 = 0;
            var firstChildFiber = reconcileChildFibersImpl(
              returnFiber,
              currentFirstChild,
              newChild,
              lanes
            );
            thenableState$1 = null;
            return firstChildFiber;
          } catch (x2) {
            if (x2 === SuspenseException || x2 === SuspenseActionException) throw x2;
            var fiber = createFiberImplClass(29, x2, null, returnFiber.mode);
            fiber.lanes = lanes;
            fiber.return = returnFiber;
            return fiber;
          } finally {
          }
        };
      }
      var reconcileChildFibers = createChildReconciler(true), mountChildFibers = createChildReconciler(false), hasForceUpdate = false;
      function initializeUpdateQueue(fiber) {
        fiber.updateQueue = {
          baseState: fiber.memoizedState,
          firstBaseUpdate: null,
          lastBaseUpdate: null,
          shared: { pending: null, lanes: 0, hiddenCallbacks: null },
          callbacks: null
        };
      }
      function cloneUpdateQueue(current2, workInProgress2) {
        current2 = current2.updateQueue;
        workInProgress2.updateQueue === current2 && (workInProgress2.updateQueue = {
          baseState: current2.baseState,
          firstBaseUpdate: current2.firstBaseUpdate,
          lastBaseUpdate: current2.lastBaseUpdate,
          shared: current2.shared,
          callbacks: null
        });
      }
      function createUpdate(lane) {
        return { lane, tag: 0, payload: null, callback: null, next: null };
      }
      function enqueueUpdate(fiber, update, lane) {
        var updateQueue = fiber.updateQueue;
        if (null === updateQueue) return null;
        updateQueue = updateQueue.shared;
        if (0 !== (executionContext & 2)) {
          var pending = updateQueue.pending;
          null === pending ? update.next = update : (update.next = pending.next, pending.next = update);
          updateQueue.pending = update;
          update = getRootForUpdatedFiber(fiber);
          markUpdateLaneFromFiberToRoot(fiber, null, lane);
          return update;
        }
        enqueueUpdate$1(fiber, updateQueue, update, lane);
        return getRootForUpdatedFiber(fiber);
      }
      function entangleTransitions(root3, fiber, lane) {
        fiber = fiber.updateQueue;
        if (null !== fiber && (fiber = fiber.shared, 0 !== (lane & 4194048))) {
          var queueLanes = fiber.lanes;
          queueLanes &= root3.pendingLanes;
          lane |= queueLanes;
          fiber.lanes = lane;
          markRootEntangled(root3, lane);
        }
      }
      function enqueueCapturedUpdate(workInProgress2, capturedUpdate) {
        var queue = workInProgress2.updateQueue, current2 = workInProgress2.alternate;
        if (null !== current2 && (current2 = current2.updateQueue, queue === current2)) {
          var newFirst = null, newLast = null;
          queue = queue.firstBaseUpdate;
          if (null !== queue) {
            do {
              var clone2 = {
                lane: queue.lane,
                tag: queue.tag,
                payload: queue.payload,
                callback: null,
                next: null
              };
              null === newLast ? newFirst = newLast = clone2 : newLast = newLast.next = clone2;
              queue = queue.next;
            } while (null !== queue);
            null === newLast ? newFirst = newLast = capturedUpdate : newLast = newLast.next = capturedUpdate;
          } else newFirst = newLast = capturedUpdate;
          queue = {
            baseState: current2.baseState,
            firstBaseUpdate: newFirst,
            lastBaseUpdate: newLast,
            shared: current2.shared,
            callbacks: current2.callbacks
          };
          workInProgress2.updateQueue = queue;
          return;
        }
        workInProgress2 = queue.lastBaseUpdate;
        null === workInProgress2 ? queue.firstBaseUpdate = capturedUpdate : workInProgress2.next = capturedUpdate;
        queue.lastBaseUpdate = capturedUpdate;
      }
      var didReadFromEntangledAsyncAction = false;
      function suspendIfUpdateReadFromEntangledAsyncAction() {
        if (didReadFromEntangledAsyncAction) {
          var entangledActionThenable = currentEntangledActionThenable;
          if (null !== entangledActionThenable) throw entangledActionThenable;
        }
      }
      function processUpdateQueue(workInProgress$jscomp$0, props, instance$jscomp$0, renderLanes2) {
        didReadFromEntangledAsyncAction = false;
        var queue = workInProgress$jscomp$0.updateQueue;
        hasForceUpdate = false;
        var firstBaseUpdate = queue.firstBaseUpdate, lastBaseUpdate = queue.lastBaseUpdate, pendingQueue = queue.shared.pending;
        if (null !== pendingQueue) {
          queue.shared.pending = null;
          var lastPendingUpdate = pendingQueue, firstPendingUpdate = lastPendingUpdate.next;
          lastPendingUpdate.next = null;
          null === lastBaseUpdate ? firstBaseUpdate = firstPendingUpdate : lastBaseUpdate.next = firstPendingUpdate;
          lastBaseUpdate = lastPendingUpdate;
          var current2 = workInProgress$jscomp$0.alternate;
          null !== current2 && (current2 = current2.updateQueue, pendingQueue = current2.lastBaseUpdate, pendingQueue !== lastBaseUpdate && (null === pendingQueue ? current2.firstBaseUpdate = firstPendingUpdate : pendingQueue.next = firstPendingUpdate, current2.lastBaseUpdate = lastPendingUpdate));
        }
        if (null !== firstBaseUpdate) {
          var newState = queue.baseState;
          lastBaseUpdate = 0;
          current2 = firstPendingUpdate = lastPendingUpdate = null;
          pendingQueue = firstBaseUpdate;
          do {
            var updateLane = pendingQueue.lane & -536870913, isHiddenUpdate = updateLane !== pendingQueue.lane;
            if (isHiddenUpdate ? (workInProgressRootRenderLanes & updateLane) === updateLane : (renderLanes2 & updateLane) === updateLane) {
              0 !== updateLane && updateLane === currentEntangledLane && (didReadFromEntangledAsyncAction = true);
              null !== current2 && (current2 = current2.next = {
                lane: 0,
                tag: pendingQueue.tag,
                payload: pendingQueue.payload,
                callback: null,
                next: null
              });
              a: {
                var workInProgress2 = workInProgress$jscomp$0, update = pendingQueue;
                updateLane = props;
                var instance = instance$jscomp$0;
                switch (update.tag) {
                  case 1:
                    workInProgress2 = update.payload;
                    if ("function" === typeof workInProgress2) {
                      newState = workInProgress2.call(instance, newState, updateLane);
                      break a;
                    }
                    newState = workInProgress2;
                    break a;
                  case 3:
                    workInProgress2.flags = workInProgress2.flags & -65537 | 128;
                  case 0:
                    workInProgress2 = update.payload;
                    updateLane = "function" === typeof workInProgress2 ? workInProgress2.call(instance, newState, updateLane) : workInProgress2;
                    if (null === updateLane || void 0 === updateLane) break a;
                    newState = assign2({}, newState, updateLane);
                    break a;
                  case 2:
                    hasForceUpdate = true;
                }
              }
              updateLane = pendingQueue.callback;
              null !== updateLane && (workInProgress$jscomp$0.flags |= 64, isHiddenUpdate && (workInProgress$jscomp$0.flags |= 8192), isHiddenUpdate = queue.callbacks, null === isHiddenUpdate ? queue.callbacks = [updateLane] : isHiddenUpdate.push(updateLane));
            } else
              isHiddenUpdate = {
                lane: updateLane,
                tag: pendingQueue.tag,
                payload: pendingQueue.payload,
                callback: pendingQueue.callback,
                next: null
              }, null === current2 ? (firstPendingUpdate = current2 = isHiddenUpdate, lastPendingUpdate = newState) : current2 = current2.next = isHiddenUpdate, lastBaseUpdate |= updateLane;
            pendingQueue = pendingQueue.next;
            if (null === pendingQueue)
              if (pendingQueue = queue.shared.pending, null === pendingQueue)
                break;
              else
                isHiddenUpdate = pendingQueue, pendingQueue = isHiddenUpdate.next, isHiddenUpdate.next = null, queue.lastBaseUpdate = isHiddenUpdate, queue.shared.pending = null;
          } while (1);
          null === current2 && (lastPendingUpdate = newState);
          queue.baseState = lastPendingUpdate;
          queue.firstBaseUpdate = firstPendingUpdate;
          queue.lastBaseUpdate = current2;
          null === firstBaseUpdate && (queue.shared.lanes = 0);
          workInProgressRootSkippedLanes |= lastBaseUpdate;
          workInProgress$jscomp$0.lanes = lastBaseUpdate;
          workInProgress$jscomp$0.memoizedState = newState;
        }
      }
      function callCallback(callback, context) {
        if ("function" !== typeof callback)
          throw Error(formatProdErrorMessage(191, callback));
        callback.call(context);
      }
      function commitCallbacks(updateQueue, context) {
        var callbacks = updateQueue.callbacks;
        if (null !== callbacks)
          for (updateQueue.callbacks = null, updateQueue = 0; updateQueue < callbacks.length; updateQueue++)
            callCallback(callbacks[updateQueue], context);
      }
      var currentTreeHiddenStackCursor = createCursor(null), prevEntangledRenderLanesCursor = createCursor(0);
      function pushHiddenContext(fiber, context) {
        fiber = entangledRenderLanes;
        push2(prevEntangledRenderLanesCursor, fiber);
        push2(currentTreeHiddenStackCursor, context);
        entangledRenderLanes = fiber | context.baseLanes;
      }
      function reuseHiddenContextOnStack() {
        push2(prevEntangledRenderLanesCursor, entangledRenderLanes);
        push2(currentTreeHiddenStackCursor, currentTreeHiddenStackCursor.current);
      }
      function popHiddenContext() {
        entangledRenderLanes = prevEntangledRenderLanesCursor.current;
        pop2(currentTreeHiddenStackCursor);
        pop2(prevEntangledRenderLanesCursor);
      }
      var suspenseHandlerStackCursor = createCursor(null), shellBoundary = null;
      function pushPrimaryTreeSuspenseHandler(handler) {
        var current2 = handler.alternate;
        push2(suspenseStackCursor, suspenseStackCursor.current & 1);
        push2(suspenseHandlerStackCursor, handler);
        null === shellBoundary && (null === current2 || null !== currentTreeHiddenStackCursor.current ? shellBoundary = handler : null !== current2.memoizedState && (shellBoundary = handler));
      }
      function pushDehydratedActivitySuspenseHandler(fiber) {
        push2(suspenseStackCursor, suspenseStackCursor.current);
        push2(suspenseHandlerStackCursor, fiber);
        null === shellBoundary && (shellBoundary = fiber);
      }
      function pushOffscreenSuspenseHandler(fiber) {
        22 === fiber.tag ? (push2(suspenseStackCursor, suspenseStackCursor.current), push2(suspenseHandlerStackCursor, fiber), null === shellBoundary && (shellBoundary = fiber)) : reuseSuspenseHandlerOnStack();
      }
      function reuseSuspenseHandlerOnStack() {
        push2(suspenseStackCursor, suspenseStackCursor.current);
        push2(suspenseHandlerStackCursor, suspenseHandlerStackCursor.current);
      }
      function popSuspenseHandler(fiber) {
        pop2(suspenseHandlerStackCursor);
        shellBoundary === fiber && (shellBoundary = null);
        pop2(suspenseStackCursor);
      }
      var suspenseStackCursor = createCursor(0);
      function findFirstSuspended(row2) {
        for (var node2 = row2; null !== node2; ) {
          if (13 === node2.tag) {
            var state = node2.memoizedState;
            if (null !== state && (state = state.dehydrated, null === state || isSuspenseInstancePending(state) || isSuspenseInstanceFallback(state)))
              return node2;
          } else if (19 === node2.tag && ("forwards" === node2.memoizedProps.revealOrder || "backwards" === node2.memoizedProps.revealOrder || "unstable_legacy-backwards" === node2.memoizedProps.revealOrder || "together" === node2.memoizedProps.revealOrder)) {
            if (0 !== (node2.flags & 128)) return node2;
          } else if (null !== node2.child) {
            node2.child.return = node2;
            node2 = node2.child;
            continue;
          }
          if (node2 === row2) break;
          for (; null === node2.sibling; ) {
            if (null === node2.return || node2.return === row2) return null;
            node2 = node2.return;
          }
          node2.sibling.return = node2.return;
          node2 = node2.sibling;
        }
        return null;
      }
      var renderLanes = 0, currentlyRenderingFiber = null, currentHook = null, workInProgressHook = null, didScheduleRenderPhaseUpdate = false, didScheduleRenderPhaseUpdateDuringThisPass = false, shouldDoubleInvokeUserFnsInHooksDEV = false, localIdCounter = 0, thenableIndexCounter = 0, thenableState = null, globalClientIdCounter = 0;
      function throwInvalidHookError() {
        throw Error(formatProdErrorMessage(321));
      }
      function areHookInputsEqual(nextDeps, prevDeps) {
        if (null === prevDeps) return false;
        for (var i2 = 0; i2 < prevDeps.length && i2 < nextDeps.length; i2++)
          if (!objectIs(nextDeps[i2], prevDeps[i2])) return false;
        return true;
      }
      function renderWithHooks(current2, workInProgress2, Component2, props, secondArg, nextRenderLanes) {
        renderLanes = nextRenderLanes;
        currentlyRenderingFiber = workInProgress2;
        workInProgress2.memoizedState = null;
        workInProgress2.updateQueue = null;
        workInProgress2.lanes = 0;
        ReactSharedInternals.H = null === current2 || null === current2.memoizedState ? HooksDispatcherOnMount : HooksDispatcherOnUpdate;
        shouldDoubleInvokeUserFnsInHooksDEV = false;
        nextRenderLanes = Component2(props, secondArg);
        shouldDoubleInvokeUserFnsInHooksDEV = false;
        didScheduleRenderPhaseUpdateDuringThisPass && (nextRenderLanes = renderWithHooksAgain(
          workInProgress2,
          Component2,
          props,
          secondArg
        ));
        finishRenderingHooks(current2);
        return nextRenderLanes;
      }
      function finishRenderingHooks(current2) {
        ReactSharedInternals.H = ContextOnlyDispatcher;
        var didRenderTooFewHooks = null !== currentHook && null !== currentHook.next;
        renderLanes = 0;
        workInProgressHook = currentHook = currentlyRenderingFiber = null;
        didScheduleRenderPhaseUpdate = false;
        thenableIndexCounter = 0;
        thenableState = null;
        if (didRenderTooFewHooks) throw Error(formatProdErrorMessage(300));
        null === current2 || didReceiveUpdate || (current2 = current2.dependencies, null !== current2 && checkIfContextChanged(current2) && (didReceiveUpdate = true));
      }
      function renderWithHooksAgain(workInProgress2, Component2, props, secondArg) {
        currentlyRenderingFiber = workInProgress2;
        var numberOfReRenders = 0;
        do {
          didScheduleRenderPhaseUpdateDuringThisPass && (thenableState = null);
          thenableIndexCounter = 0;
          didScheduleRenderPhaseUpdateDuringThisPass = false;
          if (25 <= numberOfReRenders) throw Error(formatProdErrorMessage(301));
          numberOfReRenders += 1;
          workInProgressHook = currentHook = null;
          if (null != workInProgress2.updateQueue) {
            var children2 = workInProgress2.updateQueue;
            children2.lastEffect = null;
            children2.events = null;
            children2.stores = null;
            null != children2.memoCache && (children2.memoCache.index = 0);
          }
          ReactSharedInternals.H = HooksDispatcherOnRerender;
          children2 = Component2(props, secondArg);
        } while (didScheduleRenderPhaseUpdateDuringThisPass);
        return children2;
      }
      function TransitionAwareHostComponent() {
        var dispatcher = ReactSharedInternals.H, maybeThenable = dispatcher.useState()[0];
        maybeThenable = "function" === typeof maybeThenable.then ? useThenable(maybeThenable) : maybeThenable;
        dispatcher = dispatcher.useState()[0];
        (null !== currentHook ? currentHook.memoizedState : null) !== dispatcher && (currentlyRenderingFiber.flags |= 1024);
        return maybeThenable;
      }
      function checkDidRenderIdHook() {
        var didRenderIdHook = 0 !== localIdCounter;
        localIdCounter = 0;
        return didRenderIdHook;
      }
      function bailoutHooks(current2, workInProgress2, lanes) {
        workInProgress2.updateQueue = current2.updateQueue;
        workInProgress2.flags &= -2053;
        current2.lanes &= ~lanes;
      }
      function resetHooksOnUnwind(workInProgress2) {
        if (didScheduleRenderPhaseUpdate) {
          for (workInProgress2 = workInProgress2.memoizedState; null !== workInProgress2; ) {
            var queue = workInProgress2.queue;
            null !== queue && (queue.pending = null);
            workInProgress2 = workInProgress2.next;
          }
          didScheduleRenderPhaseUpdate = false;
        }
        renderLanes = 0;
        workInProgressHook = currentHook = currentlyRenderingFiber = null;
        didScheduleRenderPhaseUpdateDuringThisPass = false;
        thenableIndexCounter = localIdCounter = 0;
        thenableState = null;
      }
      function mountWorkInProgressHook() {
        var hook = {
          memoizedState: null,
          baseState: null,
          baseQueue: null,
          queue: null,
          next: null
        };
        null === workInProgressHook ? currentlyRenderingFiber.memoizedState = workInProgressHook = hook : workInProgressHook = workInProgressHook.next = hook;
        return workInProgressHook;
      }
      function updateWorkInProgressHook() {
        if (null === currentHook) {
          var nextCurrentHook = currentlyRenderingFiber.alternate;
          nextCurrentHook = null !== nextCurrentHook ? nextCurrentHook.memoizedState : null;
        } else nextCurrentHook = currentHook.next;
        var nextWorkInProgressHook = null === workInProgressHook ? currentlyRenderingFiber.memoizedState : workInProgressHook.next;
        if (null !== nextWorkInProgressHook)
          workInProgressHook = nextWorkInProgressHook, currentHook = nextCurrentHook;
        else {
          if (null === nextCurrentHook) {
            if (null === currentlyRenderingFiber.alternate)
              throw Error(formatProdErrorMessage(467));
            throw Error(formatProdErrorMessage(310));
          }
          currentHook = nextCurrentHook;
          nextCurrentHook = {
            memoizedState: currentHook.memoizedState,
            baseState: currentHook.baseState,
            baseQueue: currentHook.baseQueue,
            queue: currentHook.queue,
            next: null
          };
          null === workInProgressHook ? currentlyRenderingFiber.memoizedState = workInProgressHook = nextCurrentHook : workInProgressHook = workInProgressHook.next = nextCurrentHook;
        }
        return workInProgressHook;
      }
      function createFunctionComponentUpdateQueue() {
        return { lastEffect: null, events: null, stores: null, memoCache: null };
      }
      function useThenable(thenable) {
        var index2 = thenableIndexCounter;
        thenableIndexCounter += 1;
        null === thenableState && (thenableState = []);
        thenable = trackUsedThenable(thenableState, thenable, index2);
        index2 = currentlyRenderingFiber;
        null === (null === workInProgressHook ? index2.memoizedState : workInProgressHook.next) && (index2 = index2.alternate, ReactSharedInternals.H = null === index2 || null === index2.memoizedState ? HooksDispatcherOnMount : HooksDispatcherOnUpdate);
        return thenable;
      }
      function use2(usable) {
        if (null !== usable && "object" === typeof usable) {
          if ("function" === typeof usable.then) return useThenable(usable);
          if (usable.$$typeof === REACT_CONTEXT_TYPE) return readContext(usable);
        }
        throw Error(formatProdErrorMessage(438, String(usable)));
      }
      function useMemoCache(size) {
        var memoCache = null, updateQueue = currentlyRenderingFiber.updateQueue;
        null !== updateQueue && (memoCache = updateQueue.memoCache);
        if (null == memoCache) {
          var current2 = currentlyRenderingFiber.alternate;
          null !== current2 && (current2 = current2.updateQueue, null !== current2 && (current2 = current2.memoCache, null != current2 && (memoCache = {
            data: current2.data.map(function(array) {
              return array.slice();
            }),
            index: 0
          })));
        }
        null == memoCache && (memoCache = { data: [], index: 0 });
        null === updateQueue && (updateQueue = createFunctionComponentUpdateQueue(), currentlyRenderingFiber.updateQueue = updateQueue);
        updateQueue.memoCache = memoCache;
        updateQueue = memoCache.data[memoCache.index];
        if (void 0 === updateQueue)
          for (updateQueue = memoCache.data[memoCache.index] = Array(size), current2 = 0; current2 < size; current2++)
            updateQueue[current2] = REACT_MEMO_CACHE_SENTINEL;
        memoCache.index++;
        return updateQueue;
      }
      function basicStateReducer(state, action) {
        return "function" === typeof action ? action(state) : action;
      }
      function updateReducer(reducer) {
        var hook = updateWorkInProgressHook();
        return updateReducerImpl(hook, currentHook, reducer);
      }
      function updateReducerImpl(hook, current2, reducer) {
        var queue = hook.queue;
        if (null === queue) throw Error(formatProdErrorMessage(311));
        queue.lastRenderedReducer = reducer;
        var baseQueue = hook.baseQueue, pendingQueue = queue.pending;
        if (null !== pendingQueue) {
          if (null !== baseQueue) {
            var baseFirst = baseQueue.next;
            baseQueue.next = pendingQueue.next;
            pendingQueue.next = baseFirst;
          }
          current2.baseQueue = baseQueue = pendingQueue;
          queue.pending = null;
        }
        pendingQueue = hook.baseState;
        if (null === baseQueue) hook.memoizedState = pendingQueue;
        else {
          current2 = baseQueue.next;
          var newBaseQueueFirst = baseFirst = null, newBaseQueueLast = null, update = current2, didReadFromEntangledAsyncAction$60 = false;
          do {
            var updateLane = update.lane & -536870913;
            if (updateLane !== update.lane ? (workInProgressRootRenderLanes & updateLane) === updateLane : (renderLanes & updateLane) === updateLane) {
              var revertLane = update.revertLane;
              if (0 === revertLane)
                null !== newBaseQueueLast && (newBaseQueueLast = newBaseQueueLast.next = {
                  lane: 0,
                  revertLane: 0,
                  gesture: null,
                  action: update.action,
                  hasEagerState: update.hasEagerState,
                  eagerState: update.eagerState,
                  next: null
                }), updateLane === currentEntangledLane && (didReadFromEntangledAsyncAction$60 = true);
              else if ((renderLanes & revertLane) === revertLane) {
                update = update.next;
                revertLane === currentEntangledLane && (didReadFromEntangledAsyncAction$60 = true);
                continue;
              } else
                updateLane = {
                  lane: 0,
                  revertLane: update.revertLane,
                  gesture: null,
                  action: update.action,
                  hasEagerState: update.hasEagerState,
                  eagerState: update.eagerState,
                  next: null
                }, null === newBaseQueueLast ? (newBaseQueueFirst = newBaseQueueLast = updateLane, baseFirst = pendingQueue) : newBaseQueueLast = newBaseQueueLast.next = updateLane, currentlyRenderingFiber.lanes |= revertLane, workInProgressRootSkippedLanes |= revertLane;
              updateLane = update.action;
              shouldDoubleInvokeUserFnsInHooksDEV && reducer(pendingQueue, updateLane);
              pendingQueue = update.hasEagerState ? update.eagerState : reducer(pendingQueue, updateLane);
            } else
              revertLane = {
                lane: updateLane,
                revertLane: update.revertLane,
                gesture: update.gesture,
                action: update.action,
                hasEagerState: update.hasEagerState,
                eagerState: update.eagerState,
                next: null
              }, null === newBaseQueueLast ? (newBaseQueueFirst = newBaseQueueLast = revertLane, baseFirst = pendingQueue) : newBaseQueueLast = newBaseQueueLast.next = revertLane, currentlyRenderingFiber.lanes |= updateLane, workInProgressRootSkippedLanes |= updateLane;
            update = update.next;
          } while (null !== update && update !== current2);
          null === newBaseQueueLast ? baseFirst = pendingQueue : newBaseQueueLast.next = newBaseQueueFirst;
          if (!objectIs(pendingQueue, hook.memoizedState) && (didReceiveUpdate = true, didReadFromEntangledAsyncAction$60 && (reducer = currentEntangledActionThenable, null !== reducer)))
            throw reducer;
          hook.memoizedState = pendingQueue;
          hook.baseState = baseFirst;
          hook.baseQueue = newBaseQueueLast;
          queue.lastRenderedState = pendingQueue;
        }
        null === baseQueue && (queue.lanes = 0);
        return [hook.memoizedState, queue.dispatch];
      }
      function rerenderReducer(reducer) {
        var hook = updateWorkInProgressHook(), queue = hook.queue;
        if (null === queue) throw Error(formatProdErrorMessage(311));
        queue.lastRenderedReducer = reducer;
        var dispatch = queue.dispatch, lastRenderPhaseUpdate = queue.pending, newState = hook.memoizedState;
        if (null !== lastRenderPhaseUpdate) {
          queue.pending = null;
          var update = lastRenderPhaseUpdate = lastRenderPhaseUpdate.next;
          do
            newState = reducer(newState, update.action), update = update.next;
          while (update !== lastRenderPhaseUpdate);
          objectIs(newState, hook.memoizedState) || (didReceiveUpdate = true);
          hook.memoizedState = newState;
          null === hook.baseQueue && (hook.baseState = newState);
          queue.lastRenderedState = newState;
        }
        return [newState, dispatch];
      }
      function updateSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) {
        var fiber = currentlyRenderingFiber, hook = updateWorkInProgressHook(), isHydrating$jscomp$0 = isHydrating;
        if (isHydrating$jscomp$0) {
          if (void 0 === getServerSnapshot) throw Error(formatProdErrorMessage(407));
          getServerSnapshot = getServerSnapshot();
        } else getServerSnapshot = getSnapshot();
        var snapshotChanged = !objectIs(
          (currentHook || hook).memoizedState,
          getServerSnapshot
        );
        snapshotChanged && (hook.memoizedState = getServerSnapshot, didReceiveUpdate = true);
        hook = hook.queue;
        updateEffect(subscribeToStore.bind(null, fiber, hook, subscribe), [
          subscribe
        ]);
        if (hook.getSnapshot !== getSnapshot || snapshotChanged || null !== workInProgressHook && workInProgressHook.memoizedState.tag & 1) {
          fiber.flags |= 2048;
          pushSimpleEffect(
            9,
            { destroy: void 0 },
            updateStoreInstance.bind(
              null,
              fiber,
              hook,
              getServerSnapshot,
              getSnapshot
            ),
            null
          );
          if (null === workInProgressRoot) throw Error(formatProdErrorMessage(349));
          isHydrating$jscomp$0 || 0 !== (renderLanes & 127) || pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot);
        }
        return getServerSnapshot;
      }
      function pushStoreConsistencyCheck(fiber, getSnapshot, renderedSnapshot) {
        fiber.flags |= 16384;
        fiber = { getSnapshot, value: renderedSnapshot };
        getSnapshot = currentlyRenderingFiber.updateQueue;
        null === getSnapshot ? (getSnapshot = createFunctionComponentUpdateQueue(), currentlyRenderingFiber.updateQueue = getSnapshot, getSnapshot.stores = [fiber]) : (renderedSnapshot = getSnapshot.stores, null === renderedSnapshot ? getSnapshot.stores = [fiber] : renderedSnapshot.push(fiber));
      }
      function updateStoreInstance(fiber, inst, nextSnapshot, getSnapshot) {
        inst.value = nextSnapshot;
        inst.getSnapshot = getSnapshot;
        checkIfSnapshotChanged(inst) && forceStoreRerender(fiber);
      }
      function subscribeToStore(fiber, inst, subscribe) {
        return subscribe(function() {
          checkIfSnapshotChanged(inst) && forceStoreRerender(fiber);
        });
      }
      function checkIfSnapshotChanged(inst) {
        var latestGetSnapshot = inst.getSnapshot;
        inst = inst.value;
        try {
          var nextValue = latestGetSnapshot();
          return !objectIs(inst, nextValue);
        } catch (error2) {
          return true;
        }
      }
      function forceStoreRerender(fiber) {
        var root3 = enqueueConcurrentRenderForLane(fiber, 2);
        null !== root3 && scheduleUpdateOnFiber(root3, fiber, 2);
      }
      function mountStateImpl(initialState2) {
        var hook = mountWorkInProgressHook();
        if ("function" === typeof initialState2) {
          var initialStateInitializer = initialState2;
          initialState2 = initialStateInitializer();
          if (shouldDoubleInvokeUserFnsInHooksDEV) {
            setIsStrictModeForDevtools(true);
            try {
              initialStateInitializer();
            } finally {
              setIsStrictModeForDevtools(false);
            }
          }
        }
        hook.memoizedState = hook.baseState = initialState2;
        hook.queue = {
          pending: null,
          lanes: 0,
          dispatch: null,
          lastRenderedReducer: basicStateReducer,
          lastRenderedState: initialState2
        };
        return hook;
      }
      function updateOptimisticImpl(hook, current2, passthrough, reducer) {
        hook.baseState = passthrough;
        return updateReducerImpl(
          hook,
          currentHook,
          "function" === typeof reducer ? reducer : basicStateReducer
        );
      }
      function dispatchActionState(fiber, actionQueue, setPendingState, setState2, payload) {
        if (isRenderPhaseUpdate(fiber)) throw Error(formatProdErrorMessage(485));
        fiber = actionQueue.action;
        if (null !== fiber) {
          var actionNode = {
            payload,
            action: fiber,
            next: null,
            isTransition: true,
            status: "pending",
            value: null,
            reason: null,
            listeners: [],
            then: function(listener) {
              actionNode.listeners.push(listener);
            }
          };
          null !== ReactSharedInternals.T ? setPendingState(true) : actionNode.isTransition = false;
          setState2(actionNode);
          setPendingState = actionQueue.pending;
          null === setPendingState ? (actionNode.next = actionQueue.pending = actionNode, runActionStateAction(actionQueue, actionNode)) : (actionNode.next = setPendingState.next, actionQueue.pending = setPendingState.next = actionNode);
        }
      }
      function runActionStateAction(actionQueue, node2) {
        var action = node2.action, payload = node2.payload, prevState = actionQueue.state;
        if (node2.isTransition) {
          var prevTransition = ReactSharedInternals.T, currentTransition = {};
          ReactSharedInternals.T = currentTransition;
          try {
            var returnValue = action(prevState, payload), onStartTransitionFinish = ReactSharedInternals.S;
            null !== onStartTransitionFinish && onStartTransitionFinish(currentTransition, returnValue);
            handleActionReturnValue(actionQueue, node2, returnValue);
          } catch (error2) {
            onActionError(actionQueue, node2, error2);
          } finally {
            null !== prevTransition && null !== currentTransition.types && (prevTransition.types = currentTransition.types), ReactSharedInternals.T = prevTransition;
          }
        } else
          try {
            prevTransition = action(prevState, payload), handleActionReturnValue(actionQueue, node2, prevTransition);
          } catch (error$66) {
            onActionError(actionQueue, node2, error$66);
          }
      }
      function handleActionReturnValue(actionQueue, node2, returnValue) {
        null !== returnValue && "object" === typeof returnValue && "function" === typeof returnValue.then ? returnValue.then(
          function(nextState) {
            onActionSuccess(actionQueue, node2, nextState);
          },
          function(error2) {
            return onActionError(actionQueue, node2, error2);
          }
        ) : onActionSuccess(actionQueue, node2, returnValue);
      }
      function onActionSuccess(actionQueue, actionNode, nextState) {
        actionNode.status = "fulfilled";
        actionNode.value = nextState;
        notifyActionListeners(actionNode);
        actionQueue.state = nextState;
        actionNode = actionQueue.pending;
        null !== actionNode && (nextState = actionNode.next, nextState === actionNode ? actionQueue.pending = null : (nextState = nextState.next, actionNode.next = nextState, runActionStateAction(actionQueue, nextState)));
      }
      function onActionError(actionQueue, actionNode, error2) {
        var last = actionQueue.pending;
        actionQueue.pending = null;
        if (null !== last) {
          last = last.next;
          do
            actionNode.status = "rejected", actionNode.reason = error2, notifyActionListeners(actionNode), actionNode = actionNode.next;
          while (actionNode !== last);
        }
        actionQueue.action = null;
      }
      function notifyActionListeners(actionNode) {
        actionNode = actionNode.listeners;
        for (var i2 = 0; i2 < actionNode.length; i2++) (0, actionNode[i2])();
      }
      function actionStateReducer(oldState, newState) {
        return newState;
      }
      function mountActionState(action, initialStateProp) {
        if (isHydrating) {
          var ssrFormState = workInProgressRoot.formState;
          if (null !== ssrFormState) {
            a: {
              var JSCompiler_inline_result = currentlyRenderingFiber;
              if (isHydrating) {
                if (nextHydratableInstance) {
                  b: {
                    var JSCompiler_inline_result$jscomp$0 = nextHydratableInstance;
                    for (var inRootOrSingleton = rootOrSingletonContext; 8 !== JSCompiler_inline_result$jscomp$0.nodeType; ) {
                      if (!inRootOrSingleton) {
                        JSCompiler_inline_result$jscomp$0 = null;
                        break b;
                      }
                      JSCompiler_inline_result$jscomp$0 = getNextHydratable(
                        JSCompiler_inline_result$jscomp$0.nextSibling
                      );
                      if (null === JSCompiler_inline_result$jscomp$0) {
                        JSCompiler_inline_result$jscomp$0 = null;
                        break b;
                      }
                    }
                    inRootOrSingleton = JSCompiler_inline_result$jscomp$0.data;
                    JSCompiler_inline_result$jscomp$0 = "F!" === inRootOrSingleton || "F" === inRootOrSingleton ? JSCompiler_inline_result$jscomp$0 : null;
                  }
                  if (JSCompiler_inline_result$jscomp$0) {
                    nextHydratableInstance = getNextHydratable(
                      JSCompiler_inline_result$jscomp$0.nextSibling
                    );
                    JSCompiler_inline_result = "F!" === JSCompiler_inline_result$jscomp$0.data;
                    break a;
                  }
                }
                throwOnHydrationMismatch(JSCompiler_inline_result);
              }
              JSCompiler_inline_result = false;
            }
            JSCompiler_inline_result && (initialStateProp = ssrFormState[0]);
          }
        }
        ssrFormState = mountWorkInProgressHook();
        ssrFormState.memoizedState = ssrFormState.baseState = initialStateProp;
        JSCompiler_inline_result = {
          pending: null,
          lanes: 0,
          dispatch: null,
          lastRenderedReducer: actionStateReducer,
          lastRenderedState: initialStateProp
        };
        ssrFormState.queue = JSCompiler_inline_result;
        ssrFormState = dispatchSetState.bind(
          null,
          currentlyRenderingFiber,
          JSCompiler_inline_result
        );
        JSCompiler_inline_result.dispatch = ssrFormState;
        JSCompiler_inline_result = mountStateImpl(false);
        inRootOrSingleton = dispatchOptimisticSetState.bind(
          null,
          currentlyRenderingFiber,
          false,
          JSCompiler_inline_result.queue
        );
        JSCompiler_inline_result = mountWorkInProgressHook();
        JSCompiler_inline_result$jscomp$0 = {
          state: initialStateProp,
          dispatch: null,
          action,
          pending: null
        };
        JSCompiler_inline_result.queue = JSCompiler_inline_result$jscomp$0;
        ssrFormState = dispatchActionState.bind(
          null,
          currentlyRenderingFiber,
          JSCompiler_inline_result$jscomp$0,
          inRootOrSingleton,
          ssrFormState
        );
        JSCompiler_inline_result$jscomp$0.dispatch = ssrFormState;
        JSCompiler_inline_result.memoizedState = action;
        return [initialStateProp, ssrFormState, false];
      }
      function updateActionState(action) {
        var stateHook = updateWorkInProgressHook();
        return updateActionStateImpl(stateHook, currentHook, action);
      }
      function updateActionStateImpl(stateHook, currentStateHook, action) {
        currentStateHook = updateReducerImpl(
          stateHook,
          currentStateHook,
          actionStateReducer
        )[0];
        stateHook = updateReducer(basicStateReducer)[0];
        if ("object" === typeof currentStateHook && null !== currentStateHook && "function" === typeof currentStateHook.then)
          try {
            var state = useThenable(currentStateHook);
          } catch (x2) {
            if (x2 === SuspenseException) throw SuspenseActionException;
            throw x2;
          }
        else state = currentStateHook;
        currentStateHook = updateWorkInProgressHook();
        var actionQueue = currentStateHook.queue, dispatch = actionQueue.dispatch;
        action !== currentStateHook.memoizedState && (currentlyRenderingFiber.flags |= 2048, pushSimpleEffect(
          9,
          { destroy: void 0 },
          actionStateActionEffect.bind(null, actionQueue, action),
          null
        ));
        return [state, dispatch, stateHook];
      }
      function actionStateActionEffect(actionQueue, action) {
        actionQueue.action = action;
      }
      function rerenderActionState(action) {
        var stateHook = updateWorkInProgressHook(), currentStateHook = currentHook;
        if (null !== currentStateHook)
          return updateActionStateImpl(stateHook, currentStateHook, action);
        updateWorkInProgressHook();
        stateHook = stateHook.memoizedState;
        currentStateHook = updateWorkInProgressHook();
        var dispatch = currentStateHook.queue.dispatch;
        currentStateHook.memoizedState = action;
        return [stateHook, dispatch, false];
      }
      function pushSimpleEffect(tag, inst, create2, deps) {
        tag = { tag, create: create2, deps, inst, next: null };
        inst = currentlyRenderingFiber.updateQueue;
        null === inst && (inst = createFunctionComponentUpdateQueue(), currentlyRenderingFiber.updateQueue = inst);
        create2 = inst.lastEffect;
        null === create2 ? inst.lastEffect = tag.next = tag : (deps = create2.next, create2.next = tag, tag.next = deps, inst.lastEffect = tag);
        return tag;
      }
      function updateRef() {
        return updateWorkInProgressHook().memoizedState;
      }
      function mountEffectImpl(fiberFlags, hookFlags, create2, deps) {
        var hook = mountWorkInProgressHook();
        currentlyRenderingFiber.flags |= fiberFlags;
        hook.memoizedState = pushSimpleEffect(
          1 | hookFlags,
          { destroy: void 0 },
          create2,
          void 0 === deps ? null : deps
        );
      }
      function updateEffectImpl(fiberFlags, hookFlags, create2, deps) {
        var hook = updateWorkInProgressHook();
        deps = void 0 === deps ? null : deps;
        var inst = hook.memoizedState.inst;
        null !== currentHook && null !== deps && areHookInputsEqual(deps, currentHook.memoizedState.deps) ? hook.memoizedState = pushSimpleEffect(hookFlags, inst, create2, deps) : (currentlyRenderingFiber.flags |= fiberFlags, hook.memoizedState = pushSimpleEffect(
          1 | hookFlags,
          inst,
          create2,
          deps
        ));
      }
      function mountEffect(create2, deps) {
        mountEffectImpl(8390656, 8, create2, deps);
      }
      function updateEffect(create2, deps) {
        updateEffectImpl(2048, 8, create2, deps);
      }
      function useEffectEventImpl(payload) {
        currentlyRenderingFiber.flags |= 4;
        var componentUpdateQueue = currentlyRenderingFiber.updateQueue;
        if (null === componentUpdateQueue)
          componentUpdateQueue = createFunctionComponentUpdateQueue(), currentlyRenderingFiber.updateQueue = componentUpdateQueue, componentUpdateQueue.events = [payload];
        else {
          var events = componentUpdateQueue.events;
          null === events ? componentUpdateQueue.events = [payload] : events.push(payload);
        }
      }
      function updateEvent(callback) {
        var ref = updateWorkInProgressHook().memoizedState;
        useEffectEventImpl({ ref, nextImpl: callback });
        return function() {
          if (0 !== (executionContext & 2)) throw Error(formatProdErrorMessage(440));
          return ref.impl.apply(void 0, arguments);
        };
      }
      function updateInsertionEffect(create2, deps) {
        return updateEffectImpl(4, 2, create2, deps);
      }
      function updateLayoutEffect(create2, deps) {
        return updateEffectImpl(4, 4, create2, deps);
      }
      function imperativeHandleEffect(create2, ref) {
        if ("function" === typeof ref) {
          create2 = create2();
          var refCleanup = ref(create2);
          return function() {
            "function" === typeof refCleanup ? refCleanup() : ref(null);
          };
        }
        if (null !== ref && void 0 !== ref)
          return create2 = create2(), ref.current = create2, function() {
            ref.current = null;
          };
      }
      function updateImperativeHandle(ref, create2, deps) {
        deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null;
        updateEffectImpl(4, 4, imperativeHandleEffect.bind(null, create2, ref), deps);
      }
      function mountDebugValue() {
      }
      function updateCallback(callback, deps) {
        var hook = updateWorkInProgressHook();
        deps = void 0 === deps ? null : deps;
        var prevState = hook.memoizedState;
        if (null !== deps && areHookInputsEqual(deps, prevState[1]))
          return prevState[0];
        hook.memoizedState = [callback, deps];
        return callback;
      }
      function updateMemo(nextCreate, deps) {
        var hook = updateWorkInProgressHook();
        deps = void 0 === deps ? null : deps;
        var prevState = hook.memoizedState;
        if (null !== deps && areHookInputsEqual(deps, prevState[1]))
          return prevState[0];
        prevState = nextCreate();
        if (shouldDoubleInvokeUserFnsInHooksDEV) {
          setIsStrictModeForDevtools(true);
          try {
            nextCreate();
          } finally {
            setIsStrictModeForDevtools(false);
          }
        }
        hook.memoizedState = [prevState, deps];
        return prevState;
      }
      function mountDeferredValueImpl(hook, value2, initialValue) {
        if (void 0 === initialValue || 0 !== (renderLanes & 1073741824) && 0 === (workInProgressRootRenderLanes & 261930))
          return hook.memoizedState = value2;
        hook.memoizedState = initialValue;
        hook = requestDeferredLane();
        currentlyRenderingFiber.lanes |= hook;
        workInProgressRootSkippedLanes |= hook;
        return initialValue;
      }
      function updateDeferredValueImpl(hook, prevValue, value2, initialValue) {
        if (objectIs(value2, prevValue)) return value2;
        if (null !== currentTreeHiddenStackCursor.current)
          return hook = mountDeferredValueImpl(hook, value2, initialValue), objectIs(hook, prevValue) || (didReceiveUpdate = true), hook;
        if (0 === (renderLanes & 42) || 0 !== (renderLanes & 1073741824) && 0 === (workInProgressRootRenderLanes & 261930))
          return didReceiveUpdate = true, hook.memoizedState = value2;
        hook = requestDeferredLane();
        currentlyRenderingFiber.lanes |= hook;
        workInProgressRootSkippedLanes |= hook;
        return prevValue;
      }
      function startTransition2(fiber, queue, pendingState, finishedState, callback) {
        var previousPriority = ReactDOMSharedInternals.p;
        ReactDOMSharedInternals.p = 0 !== previousPriority && 8 > previousPriority ? previousPriority : 8;
        var prevTransition = ReactSharedInternals.T, currentTransition = {};
        ReactSharedInternals.T = currentTransition;
        dispatchOptimisticSetState(fiber, false, queue, pendingState);
        try {
          var returnValue = callback(), onStartTransitionFinish = ReactSharedInternals.S;
          null !== onStartTransitionFinish && onStartTransitionFinish(currentTransition, returnValue);
          if (null !== returnValue && "object" === typeof returnValue && "function" === typeof returnValue.then) {
            var thenableForFinishedState = chainThenableValue(
              returnValue,
              finishedState
            );
            dispatchSetStateInternal(
              fiber,
              queue,
              thenableForFinishedState,
              requestUpdateLane(fiber)
            );
          } else
            dispatchSetStateInternal(
              fiber,
              queue,
              finishedState,
              requestUpdateLane(fiber)
            );
        } catch (error2) {
          dispatchSetStateInternal(
            fiber,
            queue,
            { then: function() {
            }, status: "rejected", reason: error2 },
            requestUpdateLane()
          );
        } finally {
          ReactDOMSharedInternals.p = previousPriority, null !== prevTransition && null !== currentTransition.types && (prevTransition.types = currentTransition.types), ReactSharedInternals.T = prevTransition;
        }
      }
      function noop2() {
      }
      function startHostTransition(formFiber, pendingState, action, formData) {
        if (5 !== formFiber.tag) throw Error(formatProdErrorMessage(476));
        var queue = ensureFormComponentIsStateful(formFiber).queue;
        startTransition2(
          formFiber,
          queue,
          pendingState,
          sharedNotPendingObject,
          null === action ? noop2 : function() {
            requestFormReset$1(formFiber);
            return action(formData);
          }
        );
      }
      function ensureFormComponentIsStateful(formFiber) {
        var existingStateHook = formFiber.memoizedState;
        if (null !== existingStateHook) return existingStateHook;
        existingStateHook = {
          memoizedState: sharedNotPendingObject,
          baseState: sharedNotPendingObject,
          baseQueue: null,
          queue: {
            pending: null,
            lanes: 0,
            dispatch: null,
            lastRenderedReducer: basicStateReducer,
            lastRenderedState: sharedNotPendingObject
          },
          next: null
        };
        var initialResetState = {};
        existingStateHook.next = {
          memoizedState: initialResetState,
          baseState: initialResetState,
          baseQueue: null,
          queue: {
            pending: null,
            lanes: 0,
            dispatch: null,
            lastRenderedReducer: basicStateReducer,
            lastRenderedState: initialResetState
          },
          next: null
        };
        formFiber.memoizedState = existingStateHook;
        formFiber = formFiber.alternate;
        null !== formFiber && (formFiber.memoizedState = existingStateHook);
        return existingStateHook;
      }
      function requestFormReset$1(formFiber) {
        var stateHook = ensureFormComponentIsStateful(formFiber);
        null === stateHook.next && (stateHook = formFiber.alternate.memoizedState);
        dispatchSetStateInternal(
          formFiber,
          stateHook.next.queue,
          {},
          requestUpdateLane()
        );
      }
      function useHostTransitionStatus() {
        return readContext(HostTransitionContext);
      }
      function updateId() {
        return updateWorkInProgressHook().memoizedState;
      }
      function updateRefresh() {
        return updateWorkInProgressHook().memoizedState;
      }
      function refreshCache(fiber) {
        for (var provider = fiber.return; null !== provider; ) {
          switch (provider.tag) {
            case 24:
            case 3:
              var lane = requestUpdateLane();
              fiber = createUpdate(lane);
              var root$69 = enqueueUpdate(provider, fiber, lane);
              null !== root$69 && (scheduleUpdateOnFiber(root$69, provider, lane), entangleTransitions(root$69, provider, lane));
              provider = { cache: createCache() };
              fiber.payload = provider;
              return;
          }
          provider = provider.return;
        }
      }
      function dispatchReducerAction(fiber, queue, action) {
        var lane = requestUpdateLane();
        action = {
          lane,
          revertLane: 0,
          gesture: null,
          action,
          hasEagerState: false,
          eagerState: null,
          next: null
        };
        isRenderPhaseUpdate(fiber) ? enqueueRenderPhaseUpdate(queue, action) : (action = enqueueConcurrentHookUpdate(fiber, queue, action, lane), null !== action && (scheduleUpdateOnFiber(action, fiber, lane), entangleTransitionUpdate(action, queue, lane)));
      }
      function dispatchSetState(fiber, queue, action) {
        var lane = requestUpdateLane();
        dispatchSetStateInternal(fiber, queue, action, lane);
      }
      function dispatchSetStateInternal(fiber, queue, action, lane) {
        var update = {
          lane,
          revertLane: 0,
          gesture: null,
          action,
          hasEagerState: false,
          eagerState: null,
          next: null
        };
        if (isRenderPhaseUpdate(fiber)) enqueueRenderPhaseUpdate(queue, update);
        else {
          var alternate = fiber.alternate;
          if (0 === fiber.lanes && (null === alternate || 0 === alternate.lanes) && (alternate = queue.lastRenderedReducer, null !== alternate))
            try {
              var currentState = queue.lastRenderedState, eagerState = alternate(currentState, action);
              update.hasEagerState = true;
              update.eagerState = eagerState;
              if (objectIs(eagerState, currentState))
                return enqueueUpdate$1(fiber, queue, update, 0), null === workInProgressRoot && finishQueueingConcurrentUpdates(), false;
            } catch (error2) {
            } finally {
            }
          action = enqueueConcurrentHookUpdate(fiber, queue, update, lane);
          if (null !== action)
            return scheduleUpdateOnFiber(action, fiber, lane), entangleTransitionUpdate(action, queue, lane), true;
        }
        return false;
      }
      function dispatchOptimisticSetState(fiber, throwIfDuringRender, queue, action) {
        action = {
          lane: 2,
          revertLane: requestTransitionLane(),
          gesture: null,
          action,
          hasEagerState: false,
          eagerState: null,
          next: null
        };
        if (isRenderPhaseUpdate(fiber)) {
          if (throwIfDuringRender) throw Error(formatProdErrorMessage(479));
        } else
          throwIfDuringRender = enqueueConcurrentHookUpdate(
            fiber,
            queue,
            action,
            2
          ), null !== throwIfDuringRender && scheduleUpdateOnFiber(throwIfDuringRender, fiber, 2);
      }
      function isRenderPhaseUpdate(fiber) {
        var alternate = fiber.alternate;
        return fiber === currentlyRenderingFiber || null !== alternate && alternate === currentlyRenderingFiber;
      }
      function enqueueRenderPhaseUpdate(queue, update) {
        didScheduleRenderPhaseUpdateDuringThisPass = didScheduleRenderPhaseUpdate = true;
        var pending = queue.pending;
        null === pending ? update.next = update : (update.next = pending.next, pending.next = update);
        queue.pending = update;
      }
      function entangleTransitionUpdate(root3, queue, lane) {
        if (0 !== (lane & 4194048)) {
          var queueLanes = queue.lanes;
          queueLanes &= root3.pendingLanes;
          lane |= queueLanes;
          queue.lanes = lane;
          markRootEntangled(root3, lane);
        }
      }
      var ContextOnlyDispatcher = {
        readContext,
        use: use2,
        useCallback: throwInvalidHookError,
        useContext: throwInvalidHookError,
        useEffect: throwInvalidHookError,
        useImperativeHandle: throwInvalidHookError,
        useLayoutEffect: throwInvalidHookError,
        useInsertionEffect: throwInvalidHookError,
        useMemo: throwInvalidHookError,
        useReducer: throwInvalidHookError,
        useRef: throwInvalidHookError,
        useState: throwInvalidHookError,
        useDebugValue: throwInvalidHookError,
        useDeferredValue: throwInvalidHookError,
        useTransition: throwInvalidHookError,
        useSyncExternalStore: throwInvalidHookError,
        useId: throwInvalidHookError,
        useHostTransitionStatus: throwInvalidHookError,
        useFormState: throwInvalidHookError,
        useActionState: throwInvalidHookError,
        useOptimistic: throwInvalidHookError,
        useMemoCache: throwInvalidHookError,
        useCacheRefresh: throwInvalidHookError
      };
      ContextOnlyDispatcher.useEffectEvent = throwInvalidHookError;
      var HooksDispatcherOnMount = {
        readContext,
        use: use2,
        useCallback: function(callback, deps) {
          mountWorkInProgressHook().memoizedState = [
            callback,
            void 0 === deps ? null : deps
          ];
          return callback;
        },
        useContext: readContext,
        useEffect: mountEffect,
        useImperativeHandle: function(ref, create2, deps) {
          deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null;
          mountEffectImpl(
            4194308,
            4,
            imperativeHandleEffect.bind(null, create2, ref),
            deps
          );
        },
        useLayoutEffect: function(create2, deps) {
          return mountEffectImpl(4194308, 4, create2, deps);
        },
        useInsertionEffect: function(create2, deps) {
          mountEffectImpl(4, 2, create2, deps);
        },
        useMemo: function(nextCreate, deps) {
          var hook = mountWorkInProgressHook();
          deps = void 0 === deps ? null : deps;
          var nextValue = nextCreate();
          if (shouldDoubleInvokeUserFnsInHooksDEV) {
            setIsStrictModeForDevtools(true);
            try {
              nextCreate();
            } finally {
              setIsStrictModeForDevtools(false);
            }
          }
          hook.memoizedState = [nextValue, deps];
          return nextValue;
        },
        useReducer: function(reducer, initialArg, init2) {
          var hook = mountWorkInProgressHook();
          if (void 0 !== init2) {
            var initialState2 = init2(initialArg);
            if (shouldDoubleInvokeUserFnsInHooksDEV) {
              setIsStrictModeForDevtools(true);
              try {
                init2(initialArg);
              } finally {
                setIsStrictModeForDevtools(false);
              }
            }
          } else initialState2 = initialArg;
          hook.memoizedState = hook.baseState = initialState2;
          reducer = {
            pending: null,
            lanes: 0,
            dispatch: null,
            lastRenderedReducer: reducer,
            lastRenderedState: initialState2
          };
          hook.queue = reducer;
          reducer = reducer.dispatch = dispatchReducerAction.bind(
            null,
            currentlyRenderingFiber,
            reducer
          );
          return [hook.memoizedState, reducer];
        },
        useRef: function(initialValue) {
          var hook = mountWorkInProgressHook();
          initialValue = { current: initialValue };
          return hook.memoizedState = initialValue;
        },
        useState: function(initialState2) {
          initialState2 = mountStateImpl(initialState2);
          var queue = initialState2.queue, dispatch = dispatchSetState.bind(null, currentlyRenderingFiber, queue);
          queue.dispatch = dispatch;
          return [initialState2.memoizedState, dispatch];
        },
        useDebugValue: mountDebugValue,
        useDeferredValue: function(value2, initialValue) {
          var hook = mountWorkInProgressHook();
          return mountDeferredValueImpl(hook, value2, initialValue);
        },
        useTransition: function() {
          var stateHook = mountStateImpl(false);
          stateHook = startTransition2.bind(
            null,
            currentlyRenderingFiber,
            stateHook.queue,
            true,
            false
          );
          mountWorkInProgressHook().memoizedState = stateHook;
          return [false, stateHook];
        },
        useSyncExternalStore: function(subscribe, getSnapshot, getServerSnapshot) {
          var fiber = currentlyRenderingFiber, hook = mountWorkInProgressHook();
          if (isHydrating) {
            if (void 0 === getServerSnapshot)
              throw Error(formatProdErrorMessage(407));
            getServerSnapshot = getServerSnapshot();
          } else {
            getServerSnapshot = getSnapshot();
            if (null === workInProgressRoot)
              throw Error(formatProdErrorMessage(349));
            0 !== (workInProgressRootRenderLanes & 127) || pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot);
          }
          hook.memoizedState = getServerSnapshot;
          var inst = { value: getServerSnapshot, getSnapshot };
          hook.queue = inst;
          mountEffect(subscribeToStore.bind(null, fiber, inst, subscribe), [
            subscribe
          ]);
          fiber.flags |= 2048;
          pushSimpleEffect(
            9,
            { destroy: void 0 },
            updateStoreInstance.bind(
              null,
              fiber,
              inst,
              getServerSnapshot,
              getSnapshot
            ),
            null
          );
          return getServerSnapshot;
        },
        useId: function() {
          var hook = mountWorkInProgressHook(), identifierPrefix = workInProgressRoot.identifierPrefix;
          if (isHydrating) {
            var JSCompiler_inline_result = treeContextOverflow;
            var idWithLeadingBit = treeContextId;
            JSCompiler_inline_result = (idWithLeadingBit & ~(1 << 32 - clz32(idWithLeadingBit) - 1)).toString(32) + JSCompiler_inline_result;
            identifierPrefix = "_" + identifierPrefix + "R_" + JSCompiler_inline_result;
            JSCompiler_inline_result = localIdCounter++;
            0 < JSCompiler_inline_result && (identifierPrefix += "H" + JSCompiler_inline_result.toString(32));
            identifierPrefix += "_";
          } else
            JSCompiler_inline_result = globalClientIdCounter++, identifierPrefix = "_" + identifierPrefix + "r_" + JSCompiler_inline_result.toString(32) + "_";
          return hook.memoizedState = identifierPrefix;
        },
        useHostTransitionStatus,
        useFormState: mountActionState,
        useActionState: mountActionState,
        useOptimistic: function(passthrough) {
          var hook = mountWorkInProgressHook();
          hook.memoizedState = hook.baseState = passthrough;
          var queue = {
            pending: null,
            lanes: 0,
            dispatch: null,
            lastRenderedReducer: null,
            lastRenderedState: null
          };
          hook.queue = queue;
          hook = dispatchOptimisticSetState.bind(
            null,
            currentlyRenderingFiber,
            true,
            queue
          );
          queue.dispatch = hook;
          return [passthrough, hook];
        },
        useMemoCache,
        useCacheRefresh: function() {
          return mountWorkInProgressHook().memoizedState = refreshCache.bind(
            null,
            currentlyRenderingFiber
          );
        },
        useEffectEvent: function(callback) {
          var hook = mountWorkInProgressHook(), ref = { impl: callback };
          hook.memoizedState = ref;
          return function() {
            if (0 !== (executionContext & 2))
              throw Error(formatProdErrorMessage(440));
            return ref.impl.apply(void 0, arguments);
          };
        }
      }, HooksDispatcherOnUpdate = {
        readContext,
        use: use2,
        useCallback: updateCallback,
        useContext: readContext,
        useEffect: updateEffect,
        useImperativeHandle: updateImperativeHandle,
        useInsertionEffect: updateInsertionEffect,
        useLayoutEffect: updateLayoutEffect,
        useMemo: updateMemo,
        useReducer: updateReducer,
        useRef: updateRef,
        useState: function() {
          return updateReducer(basicStateReducer);
        },
        useDebugValue: mountDebugValue,
        useDeferredValue: function(value2, initialValue) {
          var hook = updateWorkInProgressHook();
          return updateDeferredValueImpl(
            hook,
            currentHook.memoizedState,
            value2,
            initialValue
          );
        },
        useTransition: function() {
          var booleanOrThenable = updateReducer(basicStateReducer)[0], start2 = updateWorkInProgressHook().memoizedState;
          return [
            "boolean" === typeof booleanOrThenable ? booleanOrThenable : useThenable(booleanOrThenable),
            start2
          ];
        },
        useSyncExternalStore: updateSyncExternalStore,
        useId: updateId,
        useHostTransitionStatus,
        useFormState: updateActionState,
        useActionState: updateActionState,
        useOptimistic: function(passthrough, reducer) {
          var hook = updateWorkInProgressHook();
          return updateOptimisticImpl(hook, currentHook, passthrough, reducer);
        },
        useMemoCache,
        useCacheRefresh: updateRefresh
      };
      HooksDispatcherOnUpdate.useEffectEvent = updateEvent;
      var HooksDispatcherOnRerender = {
        readContext,
        use: use2,
        useCallback: updateCallback,
        useContext: readContext,
        useEffect: updateEffect,
        useImperativeHandle: updateImperativeHandle,
        useInsertionEffect: updateInsertionEffect,
        useLayoutEffect: updateLayoutEffect,
        useMemo: updateMemo,
        useReducer: rerenderReducer,
        useRef: updateRef,
        useState: function() {
          return rerenderReducer(basicStateReducer);
        },
        useDebugValue: mountDebugValue,
        useDeferredValue: function(value2, initialValue) {
          var hook = updateWorkInProgressHook();
          return null === currentHook ? mountDeferredValueImpl(hook, value2, initialValue) : updateDeferredValueImpl(
            hook,
            currentHook.memoizedState,
            value2,
            initialValue
          );
        },
        useTransition: function() {
          var booleanOrThenable = rerenderReducer(basicStateReducer)[0], start2 = updateWorkInProgressHook().memoizedState;
          return [
            "boolean" === typeof booleanOrThenable ? booleanOrThenable : useThenable(booleanOrThenable),
            start2
          ];
        },
        useSyncExternalStore: updateSyncExternalStore,
        useId: updateId,
        useHostTransitionStatus,
        useFormState: rerenderActionState,
        useActionState: rerenderActionState,
        useOptimistic: function(passthrough, reducer) {
          var hook = updateWorkInProgressHook();
          if (null !== currentHook)
            return updateOptimisticImpl(hook, currentHook, passthrough, reducer);
          hook.baseState = passthrough;
          return [passthrough, hook.queue.dispatch];
        },
        useMemoCache,
        useCacheRefresh: updateRefresh
      };
      HooksDispatcherOnRerender.useEffectEvent = updateEvent;
      function applyDerivedStateFromProps(workInProgress2, ctor, getDerivedStateFromProps, nextProps) {
        ctor = workInProgress2.memoizedState;
        getDerivedStateFromProps = getDerivedStateFromProps(nextProps, ctor);
        getDerivedStateFromProps = null === getDerivedStateFromProps || void 0 === getDerivedStateFromProps ? ctor : assign2({}, ctor, getDerivedStateFromProps);
        workInProgress2.memoizedState = getDerivedStateFromProps;
        0 === workInProgress2.lanes && (workInProgress2.updateQueue.baseState = getDerivedStateFromProps);
      }
      var classComponentUpdater = {
        enqueueSetState: function(inst, payload, callback) {
          inst = inst._reactInternals;
          var lane = requestUpdateLane(), update = createUpdate(lane);
          update.payload = payload;
          void 0 !== callback && null !== callback && (update.callback = callback);
          payload = enqueueUpdate(inst, update, lane);
          null !== payload && (scheduleUpdateOnFiber(payload, inst, lane), entangleTransitions(payload, inst, lane));
        },
        enqueueReplaceState: function(inst, payload, callback) {
          inst = inst._reactInternals;
          var lane = requestUpdateLane(), update = createUpdate(lane);
          update.tag = 1;
          update.payload = payload;
          void 0 !== callback && null !== callback && (update.callback = callback);
          payload = enqueueUpdate(inst, update, lane);
          null !== payload && (scheduleUpdateOnFiber(payload, inst, lane), entangleTransitions(payload, inst, lane));
        },
        enqueueForceUpdate: function(inst, callback) {
          inst = inst._reactInternals;
          var lane = requestUpdateLane(), update = createUpdate(lane);
          update.tag = 2;
          void 0 !== callback && null !== callback && (update.callback = callback);
          callback = enqueueUpdate(inst, update, lane);
          null !== callback && (scheduleUpdateOnFiber(callback, inst, lane), entangleTransitions(callback, inst, lane));
        }
      };
      function checkShouldComponentUpdate(workInProgress2, ctor, oldProps, newProps, oldState, newState, nextContext) {
        workInProgress2 = workInProgress2.stateNode;
        return "function" === typeof workInProgress2.shouldComponentUpdate ? workInProgress2.shouldComponentUpdate(newProps, newState, nextContext) : ctor.prototype && ctor.prototype.isPureReactComponent ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) : true;
      }
      function callComponentWillReceiveProps(workInProgress2, instance, newProps, nextContext) {
        workInProgress2 = instance.state;
        "function" === typeof instance.componentWillReceiveProps && instance.componentWillReceiveProps(newProps, nextContext);
        "function" === typeof instance.UNSAFE_componentWillReceiveProps && instance.UNSAFE_componentWillReceiveProps(newProps, nextContext);
        instance.state !== workInProgress2 && classComponentUpdater.enqueueReplaceState(instance, instance.state, null);
      }
      function resolveClassComponentProps(Component2, baseProps) {
        var newProps = baseProps;
        if ("ref" in baseProps) {
          newProps = {};
          for (var propName in baseProps)
            "ref" !== propName && (newProps[propName] = baseProps[propName]);
        }
        if (Component2 = Component2.defaultProps) {
          newProps === baseProps && (newProps = assign2({}, newProps));
          for (var propName$73 in Component2)
            void 0 === newProps[propName$73] && (newProps[propName$73] = Component2[propName$73]);
        }
        return newProps;
      }
      function defaultOnUncaughtError(error2) {
        reportGlobalError(error2);
      }
      function defaultOnCaughtError(error2) {
        console.error(error2);
      }
      function defaultOnRecoverableError(error2) {
        reportGlobalError(error2);
      }
      function logUncaughtError(root3, errorInfo) {
        try {
          var onUncaughtError = root3.onUncaughtError;
          onUncaughtError(errorInfo.value, { componentStack: errorInfo.stack });
        } catch (e$74) {
          setTimeout(function() {
            throw e$74;
          });
        }
      }
      function logCaughtError(root3, boundary, errorInfo) {
        try {
          var onCaughtError = root3.onCaughtError;
          onCaughtError(errorInfo.value, {
            componentStack: errorInfo.stack,
            errorBoundary: 1 === boundary.tag ? boundary.stateNode : null
          });
        } catch (e$75) {
          setTimeout(function() {
            throw e$75;
          });
        }
      }
      function createRootErrorUpdate(root3, errorInfo, lane) {
        lane = createUpdate(lane);
        lane.tag = 3;
        lane.payload = { element: null };
        lane.callback = function() {
          logUncaughtError(root3, errorInfo);
        };
        return lane;
      }
      function createClassErrorUpdate(lane) {
        lane = createUpdate(lane);
        lane.tag = 3;
        return lane;
      }
      function initializeClassErrorUpdate(update, root3, fiber, errorInfo) {
        var getDerivedStateFromError = fiber.type.getDerivedStateFromError;
        if ("function" === typeof getDerivedStateFromError) {
          var error2 = errorInfo.value;
          update.payload = function() {
            return getDerivedStateFromError(error2);
          };
          update.callback = function() {
            logCaughtError(root3, fiber, errorInfo);
          };
        }
        var inst = fiber.stateNode;
        null !== inst && "function" === typeof inst.componentDidCatch && (update.callback = function() {
          logCaughtError(root3, fiber, errorInfo);
          "function" !== typeof getDerivedStateFromError && (null === legacyErrorBoundariesThatAlreadyFailed ? legacyErrorBoundariesThatAlreadyFailed = /* @__PURE__ */ new Set([this]) : legacyErrorBoundariesThatAlreadyFailed.add(this));
          var stack2 = errorInfo.stack;
          this.componentDidCatch(errorInfo.value, {
            componentStack: null !== stack2 ? stack2 : ""
          });
        });
      }
      function throwException(root3, returnFiber, sourceFiber, value2, rootRenderLanes) {
        sourceFiber.flags |= 32768;
        if (null !== value2 && "object" === typeof value2 && "function" === typeof value2.then) {
          returnFiber = sourceFiber.alternate;
          null !== returnFiber && propagateParentContextChanges(
            returnFiber,
            sourceFiber,
            rootRenderLanes,
            true
          );
          sourceFiber = suspenseHandlerStackCursor.current;
          if (null !== sourceFiber) {
            switch (sourceFiber.tag) {
              case 31:
              case 13:
                return null === shellBoundary ? renderDidSuspendDelayIfPossible() : null === sourceFiber.alternate && 0 === workInProgressRootExitStatus && (workInProgressRootExitStatus = 3), sourceFiber.flags &= -257, sourceFiber.flags |= 65536, sourceFiber.lanes = rootRenderLanes, value2 === noopSuspenseyCommitThenable ? sourceFiber.flags |= 16384 : (returnFiber = sourceFiber.updateQueue, null === returnFiber ? sourceFiber.updateQueue = /* @__PURE__ */ new Set([value2]) : returnFiber.add(value2), attachPingListener(root3, value2, rootRenderLanes)), false;
              case 22:
                return sourceFiber.flags |= 65536, value2 === noopSuspenseyCommitThenable ? sourceFiber.flags |= 16384 : (returnFiber = sourceFiber.updateQueue, null === returnFiber ? (returnFiber = {
                  transitions: null,
                  markerInstances: null,
                  retryQueue: /* @__PURE__ */ new Set([value2])
                }, sourceFiber.updateQueue = returnFiber) : (sourceFiber = returnFiber.retryQueue, null === sourceFiber ? returnFiber.retryQueue = /* @__PURE__ */ new Set([value2]) : sourceFiber.add(value2)), attachPingListener(root3, value2, rootRenderLanes)), false;
            }
            throw Error(formatProdErrorMessage(435, sourceFiber.tag));
          }
          attachPingListener(root3, value2, rootRenderLanes);
          renderDidSuspendDelayIfPossible();
          return false;
        }
        if (isHydrating)
          return returnFiber = suspenseHandlerStackCursor.current, null !== returnFiber ? (0 === (returnFiber.flags & 65536) && (returnFiber.flags |= 256), returnFiber.flags |= 65536, returnFiber.lanes = rootRenderLanes, value2 !== HydrationMismatchException && (root3 = Error(formatProdErrorMessage(422), { cause: value2 }), queueHydrationError(createCapturedValueAtFiber(root3, sourceFiber)))) : (value2 !== HydrationMismatchException && (returnFiber = Error(formatProdErrorMessage(423), {
            cause: value2
          }), queueHydrationError(
            createCapturedValueAtFiber(returnFiber, sourceFiber)
          )), root3 = root3.current.alternate, root3.flags |= 65536, rootRenderLanes &= -rootRenderLanes, root3.lanes |= rootRenderLanes, value2 = createCapturedValueAtFiber(value2, sourceFiber), rootRenderLanes = createRootErrorUpdate(
            root3.stateNode,
            value2,
            rootRenderLanes
          ), enqueueCapturedUpdate(root3, rootRenderLanes), 4 !== workInProgressRootExitStatus && (workInProgressRootExitStatus = 2)), false;
        var wrapperError = Error(formatProdErrorMessage(520), { cause: value2 });
        wrapperError = createCapturedValueAtFiber(wrapperError, sourceFiber);
        null === workInProgressRootConcurrentErrors ? workInProgressRootConcurrentErrors = [wrapperError] : workInProgressRootConcurrentErrors.push(wrapperError);
        4 !== workInProgressRootExitStatus && (workInProgressRootExitStatus = 2);
        if (null === returnFiber) return true;
        value2 = createCapturedValueAtFiber(value2, sourceFiber);
        sourceFiber = returnFiber;
        do {
          switch (sourceFiber.tag) {
            case 3:
              return sourceFiber.flags |= 65536, root3 = rootRenderLanes & -rootRenderLanes, sourceFiber.lanes |= root3, root3 = createRootErrorUpdate(sourceFiber.stateNode, value2, root3), enqueueCapturedUpdate(sourceFiber, root3), false;
            case 1:
              if (returnFiber = sourceFiber.type, wrapperError = sourceFiber.stateNode, 0 === (sourceFiber.flags & 128) && ("function" === typeof returnFiber.getDerivedStateFromError || null !== wrapperError && "function" === typeof wrapperError.componentDidCatch && (null === legacyErrorBoundariesThatAlreadyFailed || !legacyErrorBoundariesThatAlreadyFailed.has(wrapperError))))
                return sourceFiber.flags |= 65536, rootRenderLanes &= -rootRenderLanes, sourceFiber.lanes |= rootRenderLanes, rootRenderLanes = createClassErrorUpdate(rootRenderLanes), initializeClassErrorUpdate(
                  rootRenderLanes,
                  root3,
                  sourceFiber,
                  value2
                ), enqueueCapturedUpdate(sourceFiber, rootRenderLanes), false;
          }
          sourceFiber = sourceFiber.return;
        } while (null !== sourceFiber);
        return false;
      }
      var SelectiveHydrationException = Error(formatProdErrorMessage(461)), didReceiveUpdate = false;
      function reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2) {
        workInProgress2.child = null === current2 ? mountChildFibers(workInProgress2, null, nextChildren, renderLanes2) : reconcileChildFibers(
          workInProgress2,
          current2.child,
          nextChildren,
          renderLanes2
        );
      }
      function updateForwardRef(current2, workInProgress2, Component2, nextProps, renderLanes2) {
        Component2 = Component2.render;
        var ref = workInProgress2.ref;
        if ("ref" in nextProps) {
          var propsWithoutRef = {};
          for (var key2 in nextProps)
            "ref" !== key2 && (propsWithoutRef[key2] = nextProps[key2]);
        } else propsWithoutRef = nextProps;
        prepareToReadContext(workInProgress2);
        nextProps = renderWithHooks(
          current2,
          workInProgress2,
          Component2,
          propsWithoutRef,
          ref,
          renderLanes2
        );
        key2 = checkDidRenderIdHook();
        if (null !== current2 && !didReceiveUpdate)
          return bailoutHooks(current2, workInProgress2, renderLanes2), bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
        isHydrating && key2 && pushMaterializedTreeId(workInProgress2);
        workInProgress2.flags |= 1;
        reconcileChildren(current2, workInProgress2, nextProps, renderLanes2);
        return workInProgress2.child;
      }
      function updateMemoComponent(current2, workInProgress2, Component2, nextProps, renderLanes2) {
        if (null === current2) {
          var type = Component2.type;
          if ("function" === typeof type && !shouldConstruct(type) && void 0 === type.defaultProps && null === Component2.compare)
            return workInProgress2.tag = 15, workInProgress2.type = type, updateSimpleMemoComponent(
              current2,
              workInProgress2,
              type,
              nextProps,
              renderLanes2
            );
          current2 = createFiberFromTypeAndProps(
            Component2.type,
            null,
            nextProps,
            workInProgress2,
            workInProgress2.mode,
            renderLanes2
          );
          current2.ref = workInProgress2.ref;
          current2.return = workInProgress2;
          return workInProgress2.child = current2;
        }
        type = current2.child;
        if (!checkScheduledUpdateOrContext(current2, renderLanes2)) {
          var prevProps = type.memoizedProps;
          Component2 = Component2.compare;
          Component2 = null !== Component2 ? Component2 : shallowEqual;
          if (Component2(prevProps, nextProps) && current2.ref === workInProgress2.ref)
            return bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
        }
        workInProgress2.flags |= 1;
        current2 = createWorkInProgress(type, nextProps);
        current2.ref = workInProgress2.ref;
        current2.return = workInProgress2;
        return workInProgress2.child = current2;
      }
      function updateSimpleMemoComponent(current2, workInProgress2, Component2, nextProps, renderLanes2) {
        if (null !== current2) {
          var prevProps = current2.memoizedProps;
          if (shallowEqual(prevProps, nextProps) && current2.ref === workInProgress2.ref)
            if (didReceiveUpdate = false, workInProgress2.pendingProps = nextProps = prevProps, checkScheduledUpdateOrContext(current2, renderLanes2))
              0 !== (current2.flags & 131072) && (didReceiveUpdate = true);
            else
              return workInProgress2.lanes = current2.lanes, bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
        }
        return updateFunctionComponent(
          current2,
          workInProgress2,
          Component2,
          nextProps,
          renderLanes2
        );
      }
      function updateOffscreenComponent(current2, workInProgress2, renderLanes2, nextProps) {
        var nextChildren = nextProps.children, prevState = null !== current2 ? current2.memoizedState : null;
        null === current2 && null === workInProgress2.stateNode && (workInProgress2.stateNode = {
          _visibility: 1,
          _pendingMarkers: null,
          _retryCache: null,
          _transitions: null
        });
        if ("hidden" === nextProps.mode) {
          if (0 !== (workInProgress2.flags & 128)) {
            prevState = null !== prevState ? prevState.baseLanes | renderLanes2 : renderLanes2;
            if (null !== current2) {
              nextProps = workInProgress2.child = current2.child;
              for (nextChildren = 0; null !== nextProps; )
                nextChildren = nextChildren | nextProps.lanes | nextProps.childLanes, nextProps = nextProps.sibling;
              nextProps = nextChildren & ~prevState;
            } else nextProps = 0, workInProgress2.child = null;
            return deferHiddenOffscreenComponent(
              current2,
              workInProgress2,
              prevState,
              renderLanes2,
              nextProps
            );
          }
          if (0 !== (renderLanes2 & 536870912))
            workInProgress2.memoizedState = { baseLanes: 0, cachePool: null }, null !== current2 && pushTransition(
              workInProgress2,
              null !== prevState ? prevState.cachePool : null
            ), null !== prevState ? pushHiddenContext(workInProgress2, prevState) : reuseHiddenContextOnStack(), pushOffscreenSuspenseHandler(workInProgress2);
          else
            return nextProps = workInProgress2.lanes = 536870912, deferHiddenOffscreenComponent(
              current2,
              workInProgress2,
              null !== prevState ? prevState.baseLanes | renderLanes2 : renderLanes2,
              renderLanes2,
              nextProps
            );
        } else
          null !== prevState ? (pushTransition(workInProgress2, prevState.cachePool), pushHiddenContext(workInProgress2, prevState), reuseSuspenseHandlerOnStack(), workInProgress2.memoizedState = null) : (null !== current2 && pushTransition(workInProgress2, null), reuseHiddenContextOnStack(), reuseSuspenseHandlerOnStack());
        reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
        return workInProgress2.child;
      }
      function bailoutOffscreenComponent(current2, workInProgress2) {
        null !== current2 && 22 === current2.tag || null !== workInProgress2.stateNode || (workInProgress2.stateNode = {
          _visibility: 1,
          _pendingMarkers: null,
          _retryCache: null,
          _transitions: null
        });
        return workInProgress2.sibling;
      }
      function deferHiddenOffscreenComponent(current2, workInProgress2, nextBaseLanes, renderLanes2, remainingChildLanes) {
        var JSCompiler_inline_result = peekCacheFromPool();
        JSCompiler_inline_result = null === JSCompiler_inline_result ? null : { parent: CacheContext._currentValue, pool: JSCompiler_inline_result };
        workInProgress2.memoizedState = {
          baseLanes: nextBaseLanes,
          cachePool: JSCompiler_inline_result
        };
        null !== current2 && pushTransition(workInProgress2, null);
        reuseHiddenContextOnStack();
        pushOffscreenSuspenseHandler(workInProgress2);
        null !== current2 && propagateParentContextChanges(current2, workInProgress2, renderLanes2, true);
        workInProgress2.childLanes = remainingChildLanes;
        return null;
      }
      function mountActivityChildren(workInProgress2, nextProps) {
        nextProps = mountWorkInProgressOffscreenFiber(
          { mode: nextProps.mode, children: nextProps.children },
          workInProgress2.mode
        );
        nextProps.ref = workInProgress2.ref;
        workInProgress2.child = nextProps;
        nextProps.return = workInProgress2;
        return nextProps;
      }
      function retryActivityComponentWithoutHydrating(current2, workInProgress2, renderLanes2) {
        reconcileChildFibers(workInProgress2, current2.child, null, renderLanes2);
        current2 = mountActivityChildren(workInProgress2, workInProgress2.pendingProps);
        current2.flags |= 2;
        popSuspenseHandler(workInProgress2);
        workInProgress2.memoizedState = null;
        return current2;
      }
      function updateActivityComponent(current2, workInProgress2, renderLanes2) {
        var nextProps = workInProgress2.pendingProps, didSuspend = 0 !== (workInProgress2.flags & 128);
        workInProgress2.flags &= -129;
        if (null === current2) {
          if (isHydrating) {
            if ("hidden" === nextProps.mode)
              return current2 = mountActivityChildren(workInProgress2, nextProps), workInProgress2.lanes = 536870912, bailoutOffscreenComponent(null, current2);
            pushDehydratedActivitySuspenseHandler(workInProgress2);
            (current2 = nextHydratableInstance) ? (current2 = canHydrateHydrationBoundary(
              current2,
              rootOrSingletonContext
            ), current2 = null !== current2 && "&" === current2.data ? current2 : null, null !== current2 && (workInProgress2.memoizedState = {
              dehydrated: current2,
              treeContext: null !== treeContextProvider ? { id: treeContextId, overflow: treeContextOverflow } : null,
              retryLane: 536870912,
              hydrationErrors: null
            }, renderLanes2 = createFiberFromDehydratedFragment(current2), renderLanes2.return = workInProgress2, workInProgress2.child = renderLanes2, hydrationParentFiber = workInProgress2, nextHydratableInstance = null)) : current2 = null;
            if (null === current2) throw throwOnHydrationMismatch(workInProgress2);
            workInProgress2.lanes = 536870912;
            return null;
          }
          return mountActivityChildren(workInProgress2, nextProps);
        }
        var prevState = current2.memoizedState;
        if (null !== prevState) {
          var dehydrated = prevState.dehydrated;
          pushDehydratedActivitySuspenseHandler(workInProgress2);
          if (didSuspend)
            if (workInProgress2.flags & 256)
              workInProgress2.flags &= -257, workInProgress2 = retryActivityComponentWithoutHydrating(
                current2,
                workInProgress2,
                renderLanes2
              );
            else if (null !== workInProgress2.memoizedState)
              workInProgress2.child = current2.child, workInProgress2.flags |= 128, workInProgress2 = null;
            else throw Error(formatProdErrorMessage(558));
          else if (didReceiveUpdate || propagateParentContextChanges(current2, workInProgress2, renderLanes2, false), didSuspend = 0 !== (renderLanes2 & current2.childLanes), didReceiveUpdate || didSuspend) {
            nextProps = workInProgressRoot;
            if (null !== nextProps && (dehydrated = getBumpedLaneForHydration(nextProps, renderLanes2), 0 !== dehydrated && dehydrated !== prevState.retryLane))
              throw prevState.retryLane = dehydrated, enqueueConcurrentRenderForLane(current2, dehydrated), scheduleUpdateOnFiber(nextProps, current2, dehydrated), SelectiveHydrationException;
            renderDidSuspendDelayIfPossible();
            workInProgress2 = retryActivityComponentWithoutHydrating(
              current2,
              workInProgress2,
              renderLanes2
            );
          } else
            current2 = prevState.treeContext, nextHydratableInstance = getNextHydratable(dehydrated.nextSibling), hydrationParentFiber = workInProgress2, isHydrating = true, hydrationErrors = null, rootOrSingletonContext = false, null !== current2 && restoreSuspendedTreeContext(workInProgress2, current2), workInProgress2 = mountActivityChildren(workInProgress2, nextProps), workInProgress2.flags |= 4096;
          return workInProgress2;
        }
        current2 = createWorkInProgress(current2.child, {
          mode: nextProps.mode,
          children: nextProps.children
        });
        current2.ref = workInProgress2.ref;
        workInProgress2.child = current2;
        current2.return = workInProgress2;
        return current2;
      }
      function markRef(current2, workInProgress2) {
        var ref = workInProgress2.ref;
        if (null === ref)
          null !== current2 && null !== current2.ref && (workInProgress2.flags |= 4194816);
        else {
          if ("function" !== typeof ref && "object" !== typeof ref)
            throw Error(formatProdErrorMessage(284));
          if (null === current2 || current2.ref !== ref)
            workInProgress2.flags |= 4194816;
        }
      }
      function updateFunctionComponent(current2, workInProgress2, Component2, nextProps, renderLanes2) {
        prepareToReadContext(workInProgress2);
        Component2 = renderWithHooks(
          current2,
          workInProgress2,
          Component2,
          nextProps,
          void 0,
          renderLanes2
        );
        nextProps = checkDidRenderIdHook();
        if (null !== current2 && !didReceiveUpdate)
          return bailoutHooks(current2, workInProgress2, renderLanes2), bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
        isHydrating && nextProps && pushMaterializedTreeId(workInProgress2);
        workInProgress2.flags |= 1;
        reconcileChildren(current2, workInProgress2, Component2, renderLanes2);
        return workInProgress2.child;
      }
      function replayFunctionComponent(current2, workInProgress2, nextProps, Component2, secondArg, renderLanes2) {
        prepareToReadContext(workInProgress2);
        workInProgress2.updateQueue = null;
        nextProps = renderWithHooksAgain(
          workInProgress2,
          Component2,
          nextProps,
          secondArg
        );
        finishRenderingHooks(current2);
        Component2 = checkDidRenderIdHook();
        if (null !== current2 && !didReceiveUpdate)
          return bailoutHooks(current2, workInProgress2, renderLanes2), bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
        isHydrating && Component2 && pushMaterializedTreeId(workInProgress2);
        workInProgress2.flags |= 1;
        reconcileChildren(current2, workInProgress2, nextProps, renderLanes2);
        return workInProgress2.child;
      }
      function updateClassComponent(current2, workInProgress2, Component2, nextProps, renderLanes2) {
        prepareToReadContext(workInProgress2);
        if (null === workInProgress2.stateNode) {
          var context = emptyContextObject, contextType = Component2.contextType;
          "object" === typeof contextType && null !== contextType && (context = readContext(contextType));
          context = new Component2(nextProps, context);
          workInProgress2.memoizedState = null !== context.state && void 0 !== context.state ? context.state : null;
          context.updater = classComponentUpdater;
          workInProgress2.stateNode = context;
          context._reactInternals = workInProgress2;
          context = workInProgress2.stateNode;
          context.props = nextProps;
          context.state = workInProgress2.memoizedState;
          context.refs = {};
          initializeUpdateQueue(workInProgress2);
          contextType = Component2.contextType;
          context.context = "object" === typeof contextType && null !== contextType ? readContext(contextType) : emptyContextObject;
          context.state = workInProgress2.memoizedState;
          contextType = Component2.getDerivedStateFromProps;
          "function" === typeof contextType && (applyDerivedStateFromProps(
            workInProgress2,
            Component2,
            contextType,
            nextProps
          ), context.state = workInProgress2.memoizedState);
          "function" === typeof Component2.getDerivedStateFromProps || "function" === typeof context.getSnapshotBeforeUpdate || "function" !== typeof context.UNSAFE_componentWillMount && "function" !== typeof context.componentWillMount || (contextType = context.state, "function" === typeof context.componentWillMount && context.componentWillMount(), "function" === typeof context.UNSAFE_componentWillMount && context.UNSAFE_componentWillMount(), contextType !== context.state && classComponentUpdater.enqueueReplaceState(context, context.state, null), processUpdateQueue(workInProgress2, nextProps, context, renderLanes2), suspendIfUpdateReadFromEntangledAsyncAction(), context.state = workInProgress2.memoizedState);
          "function" === typeof context.componentDidMount && (workInProgress2.flags |= 4194308);
          nextProps = true;
        } else if (null === current2) {
          context = workInProgress2.stateNode;
          var unresolvedOldProps = workInProgress2.memoizedProps, oldProps = resolveClassComponentProps(Component2, unresolvedOldProps);
          context.props = oldProps;
          var oldContext = context.context, contextType$jscomp$0 = Component2.contextType;
          contextType = emptyContextObject;
          "object" === typeof contextType$jscomp$0 && null !== contextType$jscomp$0 && (contextType = readContext(contextType$jscomp$0));
          var getDerivedStateFromProps = Component2.getDerivedStateFromProps;
          contextType$jscomp$0 = "function" === typeof getDerivedStateFromProps || "function" === typeof context.getSnapshotBeforeUpdate;
          unresolvedOldProps = workInProgress2.pendingProps !== unresolvedOldProps;
          contextType$jscomp$0 || "function" !== typeof context.UNSAFE_componentWillReceiveProps && "function" !== typeof context.componentWillReceiveProps || (unresolvedOldProps || oldContext !== contextType) && callComponentWillReceiveProps(
            workInProgress2,
            context,
            nextProps,
            contextType
          );
          hasForceUpdate = false;
          var oldState = workInProgress2.memoizedState;
          context.state = oldState;
          processUpdateQueue(workInProgress2, nextProps, context, renderLanes2);
          suspendIfUpdateReadFromEntangledAsyncAction();
          oldContext = workInProgress2.memoizedState;
          unresolvedOldProps || oldState !== oldContext || hasForceUpdate ? ("function" === typeof getDerivedStateFromProps && (applyDerivedStateFromProps(
            workInProgress2,
            Component2,
            getDerivedStateFromProps,
            nextProps
          ), oldContext = workInProgress2.memoizedState), (oldProps = hasForceUpdate || checkShouldComponentUpdate(
            workInProgress2,
            Component2,
            oldProps,
            nextProps,
            oldState,
            oldContext,
            contextType
          )) ? (contextType$jscomp$0 || "function" !== typeof context.UNSAFE_componentWillMount && "function" !== typeof context.componentWillMount || ("function" === typeof context.componentWillMount && context.componentWillMount(), "function" === typeof context.UNSAFE_componentWillMount && context.UNSAFE_componentWillMount()), "function" === typeof context.componentDidMount && (workInProgress2.flags |= 4194308)) : ("function" === typeof context.componentDidMount && (workInProgress2.flags |= 4194308), workInProgress2.memoizedProps = nextProps, workInProgress2.memoizedState = oldContext), context.props = nextProps, context.state = oldContext, context.context = contextType, nextProps = oldProps) : ("function" === typeof context.componentDidMount && (workInProgress2.flags |= 4194308), nextProps = false);
        } else {
          context = workInProgress2.stateNode;
          cloneUpdateQueue(current2, workInProgress2);
          contextType = workInProgress2.memoizedProps;
          contextType$jscomp$0 = resolveClassComponentProps(Component2, contextType);
          context.props = contextType$jscomp$0;
          getDerivedStateFromProps = workInProgress2.pendingProps;
          oldState = context.context;
          oldContext = Component2.contextType;
          oldProps = emptyContextObject;
          "object" === typeof oldContext && null !== oldContext && (oldProps = readContext(oldContext));
          unresolvedOldProps = Component2.getDerivedStateFromProps;
          (oldContext = "function" === typeof unresolvedOldProps || "function" === typeof context.getSnapshotBeforeUpdate) || "function" !== typeof context.UNSAFE_componentWillReceiveProps && "function" !== typeof context.componentWillReceiveProps || (contextType !== getDerivedStateFromProps || oldState !== oldProps) && callComponentWillReceiveProps(
            workInProgress2,
            context,
            nextProps,
            oldProps
          );
          hasForceUpdate = false;
          oldState = workInProgress2.memoizedState;
          context.state = oldState;
          processUpdateQueue(workInProgress2, nextProps, context, renderLanes2);
          suspendIfUpdateReadFromEntangledAsyncAction();
          var newState = workInProgress2.memoizedState;
          contextType !== getDerivedStateFromProps || oldState !== newState || hasForceUpdate || null !== current2 && null !== current2.dependencies && checkIfContextChanged(current2.dependencies) ? ("function" === typeof unresolvedOldProps && (applyDerivedStateFromProps(
            workInProgress2,
            Component2,
            unresolvedOldProps,
            nextProps
          ), newState = workInProgress2.memoizedState), (contextType$jscomp$0 = hasForceUpdate || checkShouldComponentUpdate(
            workInProgress2,
            Component2,
            contextType$jscomp$0,
            nextProps,
            oldState,
            newState,
            oldProps
          ) || null !== current2 && null !== current2.dependencies && checkIfContextChanged(current2.dependencies)) ? (oldContext || "function" !== typeof context.UNSAFE_componentWillUpdate && "function" !== typeof context.componentWillUpdate || ("function" === typeof context.componentWillUpdate && context.componentWillUpdate(nextProps, newState, oldProps), "function" === typeof context.UNSAFE_componentWillUpdate && context.UNSAFE_componentWillUpdate(
            nextProps,
            newState,
            oldProps
          )), "function" === typeof context.componentDidUpdate && (workInProgress2.flags |= 4), "function" === typeof context.getSnapshotBeforeUpdate && (workInProgress2.flags |= 1024)) : ("function" !== typeof context.componentDidUpdate || contextType === current2.memoizedProps && oldState === current2.memoizedState || (workInProgress2.flags |= 4), "function" !== typeof context.getSnapshotBeforeUpdate || contextType === current2.memoizedProps && oldState === current2.memoizedState || (workInProgress2.flags |= 1024), workInProgress2.memoizedProps = nextProps, workInProgress2.memoizedState = newState), context.props = nextProps, context.state = newState, context.context = oldProps, nextProps = contextType$jscomp$0) : ("function" !== typeof context.componentDidUpdate || contextType === current2.memoizedProps && oldState === current2.memoizedState || (workInProgress2.flags |= 4), "function" !== typeof context.getSnapshotBeforeUpdate || contextType === current2.memoizedProps && oldState === current2.memoizedState || (workInProgress2.flags |= 1024), nextProps = false);
        }
        context = nextProps;
        markRef(current2, workInProgress2);
        nextProps = 0 !== (workInProgress2.flags & 128);
        context || nextProps ? (context = workInProgress2.stateNode, Component2 = nextProps && "function" !== typeof Component2.getDerivedStateFromError ? null : context.render(), workInProgress2.flags |= 1, null !== current2 && nextProps ? (workInProgress2.child = reconcileChildFibers(
          workInProgress2,
          current2.child,
          null,
          renderLanes2
        ), workInProgress2.child = reconcileChildFibers(
          workInProgress2,
          null,
          Component2,
          renderLanes2
        )) : reconcileChildren(current2, workInProgress2, Component2, renderLanes2), workInProgress2.memoizedState = context.state, current2 = workInProgress2.child) : current2 = bailoutOnAlreadyFinishedWork(
          current2,
          workInProgress2,
          renderLanes2
        );
        return current2;
      }
      function mountHostRootWithoutHydrating(current2, workInProgress2, nextChildren, renderLanes2) {
        resetHydrationState();
        workInProgress2.flags |= 256;
        reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
        return workInProgress2.child;
      }
      var SUSPENDED_MARKER = {
        dehydrated: null,
        treeContext: null,
        retryLane: 0,
        hydrationErrors: null
      };
      function mountSuspenseOffscreenState(renderLanes2) {
        return { baseLanes: renderLanes2, cachePool: getSuspendedCache() };
      }
      function getRemainingWorkInPrimaryTree(current2, primaryTreeDidDefer, renderLanes2) {
        current2 = null !== current2 ? current2.childLanes & ~renderLanes2 : 0;
        primaryTreeDidDefer && (current2 |= workInProgressDeferredLane);
        return current2;
      }
      function updateSuspenseComponent(current2, workInProgress2, renderLanes2) {
        var nextProps = workInProgress2.pendingProps, showFallback = false, didSuspend = 0 !== (workInProgress2.flags & 128), JSCompiler_temp;
        (JSCompiler_temp = didSuspend) || (JSCompiler_temp = null !== current2 && null === current2.memoizedState ? false : 0 !== (suspenseStackCursor.current & 2));
        JSCompiler_temp && (showFallback = true, workInProgress2.flags &= -129);
        JSCompiler_temp = 0 !== (workInProgress2.flags & 32);
        workInProgress2.flags &= -33;
        if (null === current2) {
          if (isHydrating) {
            showFallback ? pushPrimaryTreeSuspenseHandler(workInProgress2) : reuseSuspenseHandlerOnStack();
            (current2 = nextHydratableInstance) ? (current2 = canHydrateHydrationBoundary(
              current2,
              rootOrSingletonContext
            ), current2 = null !== current2 && "&" !== current2.data ? current2 : null, null !== current2 && (workInProgress2.memoizedState = {
              dehydrated: current2,
              treeContext: null !== treeContextProvider ? { id: treeContextId, overflow: treeContextOverflow } : null,
              retryLane: 536870912,
              hydrationErrors: null
            }, renderLanes2 = createFiberFromDehydratedFragment(current2), renderLanes2.return = workInProgress2, workInProgress2.child = renderLanes2, hydrationParentFiber = workInProgress2, nextHydratableInstance = null)) : current2 = null;
            if (null === current2) throw throwOnHydrationMismatch(workInProgress2);
            isSuspenseInstanceFallback(current2) ? workInProgress2.lanes = 32 : workInProgress2.lanes = 536870912;
            return null;
          }
          var nextPrimaryChildren = nextProps.children;
          nextProps = nextProps.fallback;
          if (showFallback)
            return reuseSuspenseHandlerOnStack(), showFallback = workInProgress2.mode, nextPrimaryChildren = mountWorkInProgressOffscreenFiber(
              { mode: "hidden", children: nextPrimaryChildren },
              showFallback
            ), nextProps = createFiberFromFragment(
              nextProps,
              showFallback,
              renderLanes2,
              null
            ), nextPrimaryChildren.return = workInProgress2, nextProps.return = workInProgress2, nextPrimaryChildren.sibling = nextProps, workInProgress2.child = nextPrimaryChildren, nextProps = workInProgress2.child, nextProps.memoizedState = mountSuspenseOffscreenState(renderLanes2), nextProps.childLanes = getRemainingWorkInPrimaryTree(
              current2,
              JSCompiler_temp,
              renderLanes2
            ), workInProgress2.memoizedState = SUSPENDED_MARKER, bailoutOffscreenComponent(null, nextProps);
          pushPrimaryTreeSuspenseHandler(workInProgress2);
          return mountSuspensePrimaryChildren(workInProgress2, nextPrimaryChildren);
        }
        var prevState = current2.memoizedState;
        if (null !== prevState && (nextPrimaryChildren = prevState.dehydrated, null !== nextPrimaryChildren)) {
          if (didSuspend)
            workInProgress2.flags & 256 ? (pushPrimaryTreeSuspenseHandler(workInProgress2), workInProgress2.flags &= -257, workInProgress2 = retrySuspenseComponentWithoutHydrating(
              current2,
              workInProgress2,
              renderLanes2
            )) : null !== workInProgress2.memoizedState ? (reuseSuspenseHandlerOnStack(), workInProgress2.child = current2.child, workInProgress2.flags |= 128, workInProgress2 = null) : (reuseSuspenseHandlerOnStack(), nextPrimaryChildren = nextProps.fallback, showFallback = workInProgress2.mode, nextProps = mountWorkInProgressOffscreenFiber(
              { mode: "visible", children: nextProps.children },
              showFallback
            ), nextPrimaryChildren = createFiberFromFragment(
              nextPrimaryChildren,
              showFallback,
              renderLanes2,
              null
            ), nextPrimaryChildren.flags |= 2, nextProps.return = workInProgress2, nextPrimaryChildren.return = workInProgress2, nextProps.sibling = nextPrimaryChildren, workInProgress2.child = nextProps, reconcileChildFibers(
              workInProgress2,
              current2.child,
              null,
              renderLanes2
            ), nextProps = workInProgress2.child, nextProps.memoizedState = mountSuspenseOffscreenState(renderLanes2), nextProps.childLanes = getRemainingWorkInPrimaryTree(
              current2,
              JSCompiler_temp,
              renderLanes2
            ), workInProgress2.memoizedState = SUSPENDED_MARKER, workInProgress2 = bailoutOffscreenComponent(null, nextProps));
          else if (pushPrimaryTreeSuspenseHandler(workInProgress2), isSuspenseInstanceFallback(nextPrimaryChildren)) {
            JSCompiler_temp = nextPrimaryChildren.nextSibling && nextPrimaryChildren.nextSibling.dataset;
            if (JSCompiler_temp) var digest = JSCompiler_temp.dgst;
            JSCompiler_temp = digest;
            nextProps = Error(formatProdErrorMessage(419));
            nextProps.stack = "";
            nextProps.digest = JSCompiler_temp;
            queueHydrationError({ value: nextProps, source: null, stack: null });
            workInProgress2 = retrySuspenseComponentWithoutHydrating(
              current2,
              workInProgress2,
              renderLanes2
            );
          } else if (didReceiveUpdate || propagateParentContextChanges(current2, workInProgress2, renderLanes2, false), JSCompiler_temp = 0 !== (renderLanes2 & current2.childLanes), didReceiveUpdate || JSCompiler_temp) {
            JSCompiler_temp = workInProgressRoot;
            if (null !== JSCompiler_temp && (nextProps = getBumpedLaneForHydration(JSCompiler_temp, renderLanes2), 0 !== nextProps && nextProps !== prevState.retryLane))
              throw prevState.retryLane = nextProps, enqueueConcurrentRenderForLane(current2, nextProps), scheduleUpdateOnFiber(JSCompiler_temp, current2, nextProps), SelectiveHydrationException;
            isSuspenseInstancePending(nextPrimaryChildren) || renderDidSuspendDelayIfPossible();
            workInProgress2 = retrySuspenseComponentWithoutHydrating(
              current2,
              workInProgress2,
              renderLanes2
            );
          } else
            isSuspenseInstancePending(nextPrimaryChildren) ? (workInProgress2.flags |= 192, workInProgress2.child = current2.child, workInProgress2 = null) : (current2 = prevState.treeContext, nextHydratableInstance = getNextHydratable(
              nextPrimaryChildren.nextSibling
            ), hydrationParentFiber = workInProgress2, isHydrating = true, hydrationErrors = null, rootOrSingletonContext = false, null !== current2 && restoreSuspendedTreeContext(workInProgress2, current2), workInProgress2 = mountSuspensePrimaryChildren(
              workInProgress2,
              nextProps.children
            ), workInProgress2.flags |= 4096);
          return workInProgress2;
        }
        if (showFallback)
          return reuseSuspenseHandlerOnStack(), nextPrimaryChildren = nextProps.fallback, showFallback = workInProgress2.mode, prevState = current2.child, digest = prevState.sibling, nextProps = createWorkInProgress(prevState, {
            mode: "hidden",
            children: nextProps.children
          }), nextProps.subtreeFlags = prevState.subtreeFlags & 65011712, null !== digest ? nextPrimaryChildren = createWorkInProgress(
            digest,
            nextPrimaryChildren
          ) : (nextPrimaryChildren = createFiberFromFragment(
            nextPrimaryChildren,
            showFallback,
            renderLanes2,
            null
          ), nextPrimaryChildren.flags |= 2), nextPrimaryChildren.return = workInProgress2, nextProps.return = workInProgress2, nextProps.sibling = nextPrimaryChildren, workInProgress2.child = nextProps, bailoutOffscreenComponent(null, nextProps), nextProps = workInProgress2.child, nextPrimaryChildren = current2.child.memoizedState, null === nextPrimaryChildren ? nextPrimaryChildren = mountSuspenseOffscreenState(renderLanes2) : (showFallback = nextPrimaryChildren.cachePool, null !== showFallback ? (prevState = CacheContext._currentValue, showFallback = showFallback.parent !== prevState ? { parent: prevState, pool: prevState } : showFallback) : showFallback = getSuspendedCache(), nextPrimaryChildren = {
            baseLanes: nextPrimaryChildren.baseLanes | renderLanes2,
            cachePool: showFallback
          }), nextProps.memoizedState = nextPrimaryChildren, nextProps.childLanes = getRemainingWorkInPrimaryTree(
            current2,
            JSCompiler_temp,
            renderLanes2
          ), workInProgress2.memoizedState = SUSPENDED_MARKER, bailoutOffscreenComponent(current2.child, nextProps);
        pushPrimaryTreeSuspenseHandler(workInProgress2);
        renderLanes2 = current2.child;
        current2 = renderLanes2.sibling;
        renderLanes2 = createWorkInProgress(renderLanes2, {
          mode: "visible",
          children: nextProps.children
        });
        renderLanes2.return = workInProgress2;
        renderLanes2.sibling = null;
        null !== current2 && (JSCompiler_temp = workInProgress2.deletions, null === JSCompiler_temp ? (workInProgress2.deletions = [current2], workInProgress2.flags |= 16) : JSCompiler_temp.push(current2));
        workInProgress2.child = renderLanes2;
        workInProgress2.memoizedState = null;
        return renderLanes2;
      }
      function mountSuspensePrimaryChildren(workInProgress2, primaryChildren) {
        primaryChildren = mountWorkInProgressOffscreenFiber(
          { mode: "visible", children: primaryChildren },
          workInProgress2.mode
        );
        primaryChildren.return = workInProgress2;
        return workInProgress2.child = primaryChildren;
      }
      function mountWorkInProgressOffscreenFiber(offscreenProps, mode) {
        offscreenProps = createFiberImplClass(22, offscreenProps, null, mode);
        offscreenProps.lanes = 0;
        return offscreenProps;
      }
      function retrySuspenseComponentWithoutHydrating(current2, workInProgress2, renderLanes2) {
        reconcileChildFibers(workInProgress2, current2.child, null, renderLanes2);
        current2 = mountSuspensePrimaryChildren(
          workInProgress2,
          workInProgress2.pendingProps.children
        );
        current2.flags |= 2;
        workInProgress2.memoizedState = null;
        return current2;
      }
      function scheduleSuspenseWorkOnFiber(fiber, renderLanes2, propagationRoot) {
        fiber.lanes |= renderLanes2;
        var alternate = fiber.alternate;
        null !== alternate && (alternate.lanes |= renderLanes2);
        scheduleContextWorkOnParentPath(fiber.return, renderLanes2, propagationRoot);
      }
      function initSuspenseListRenderState(workInProgress2, isBackwards, tail, lastContentRow, tailMode, treeForkCount2) {
        var renderState = workInProgress2.memoizedState;
        null === renderState ? workInProgress2.memoizedState = {
          isBackwards,
          rendering: null,
          renderingStartTime: 0,
          last: lastContentRow,
          tail,
          tailMode,
          treeForkCount: treeForkCount2
        } : (renderState.isBackwards = isBackwards, renderState.rendering = null, renderState.renderingStartTime = 0, renderState.last = lastContentRow, renderState.tail = tail, renderState.tailMode = tailMode, renderState.treeForkCount = treeForkCount2);
      }
      function updateSuspenseListComponent(current2, workInProgress2, renderLanes2) {
        var nextProps = workInProgress2.pendingProps, revealOrder = nextProps.revealOrder, tailMode = nextProps.tail;
        nextProps = nextProps.children;
        var suspenseContext = suspenseStackCursor.current, shouldForceFallback = 0 !== (suspenseContext & 2);
        shouldForceFallback ? (suspenseContext = suspenseContext & 1 | 2, workInProgress2.flags |= 128) : suspenseContext &= 1;
        push2(suspenseStackCursor, suspenseContext);
        reconcileChildren(current2, workInProgress2, nextProps, renderLanes2);
        nextProps = isHydrating ? treeForkCount : 0;
        if (!shouldForceFallback && null !== current2 && 0 !== (current2.flags & 128))
          a: for (current2 = workInProgress2.child; null !== current2; ) {
            if (13 === current2.tag)
              null !== current2.memoizedState && scheduleSuspenseWorkOnFiber(current2, renderLanes2, workInProgress2);
            else if (19 === current2.tag)
              scheduleSuspenseWorkOnFiber(current2, renderLanes2, workInProgress2);
            else if (null !== current2.child) {
              current2.child.return = current2;
              current2 = current2.child;
              continue;
            }
            if (current2 === workInProgress2) break a;
            for (; null === current2.sibling; ) {
              if (null === current2.return || current2.return === workInProgress2)
                break a;
              current2 = current2.return;
            }
            current2.sibling.return = current2.return;
            current2 = current2.sibling;
          }
        switch (revealOrder) {
          case "forwards":
            renderLanes2 = workInProgress2.child;
            for (revealOrder = null; null !== renderLanes2; )
              current2 = renderLanes2.alternate, null !== current2 && null === findFirstSuspended(current2) && (revealOrder = renderLanes2), renderLanes2 = renderLanes2.sibling;
            renderLanes2 = revealOrder;
            null === renderLanes2 ? (revealOrder = workInProgress2.child, workInProgress2.child = null) : (revealOrder = renderLanes2.sibling, renderLanes2.sibling = null);
            initSuspenseListRenderState(
              workInProgress2,
              false,
              revealOrder,
              renderLanes2,
              tailMode,
              nextProps
            );
            break;
          case "backwards":
          case "unstable_legacy-backwards":
            renderLanes2 = null;
            revealOrder = workInProgress2.child;
            for (workInProgress2.child = null; null !== revealOrder; ) {
              current2 = revealOrder.alternate;
              if (null !== current2 && null === findFirstSuspended(current2)) {
                workInProgress2.child = revealOrder;
                break;
              }
              current2 = revealOrder.sibling;
              revealOrder.sibling = renderLanes2;
              renderLanes2 = revealOrder;
              revealOrder = current2;
            }
            initSuspenseListRenderState(
              workInProgress2,
              true,
              renderLanes2,
              null,
              tailMode,
              nextProps
            );
            break;
          case "together":
            initSuspenseListRenderState(
              workInProgress2,
              false,
              null,
              null,
              void 0,
              nextProps
            );
            break;
          default:
            workInProgress2.memoizedState = null;
        }
        return workInProgress2.child;
      }
      function bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2) {
        null !== current2 && (workInProgress2.dependencies = current2.dependencies);
        workInProgressRootSkippedLanes |= workInProgress2.lanes;
        if (0 === (renderLanes2 & workInProgress2.childLanes))
          if (null !== current2) {
            if (propagateParentContextChanges(
              current2,
              workInProgress2,
              renderLanes2,
              false
            ), 0 === (renderLanes2 & workInProgress2.childLanes))
              return null;
          } else return null;
        if (null !== current2 && workInProgress2.child !== current2.child)
          throw Error(formatProdErrorMessage(153));
        if (null !== workInProgress2.child) {
          current2 = workInProgress2.child;
          renderLanes2 = createWorkInProgress(current2, current2.pendingProps);
          workInProgress2.child = renderLanes2;
          for (renderLanes2.return = workInProgress2; null !== current2.sibling; )
            current2 = current2.sibling, renderLanes2 = renderLanes2.sibling = createWorkInProgress(current2, current2.pendingProps), renderLanes2.return = workInProgress2;
          renderLanes2.sibling = null;
        }
        return workInProgress2.child;
      }
      function checkScheduledUpdateOrContext(current2, renderLanes2) {
        if (0 !== (current2.lanes & renderLanes2)) return true;
        current2 = current2.dependencies;
        return null !== current2 && checkIfContextChanged(current2) ? true : false;
      }
      function attemptEarlyBailoutIfNoScheduledUpdate(current2, workInProgress2, renderLanes2) {
        switch (workInProgress2.tag) {
          case 3:
            pushHostContainer(workInProgress2, workInProgress2.stateNode.containerInfo);
            pushProvider(workInProgress2, CacheContext, current2.memoizedState.cache);
            resetHydrationState();
            break;
          case 27:
          case 5:
            pushHostContext(workInProgress2);
            break;
          case 4:
            pushHostContainer(workInProgress2, workInProgress2.stateNode.containerInfo);
            break;
          case 10:
            pushProvider(
              workInProgress2,
              workInProgress2.type,
              workInProgress2.memoizedProps.value
            );
            break;
          case 31:
            if (null !== workInProgress2.memoizedState)
              return workInProgress2.flags |= 128, pushDehydratedActivitySuspenseHandler(workInProgress2), null;
            break;
          case 13:
            var state$102 = workInProgress2.memoizedState;
            if (null !== state$102) {
              if (null !== state$102.dehydrated)
                return pushPrimaryTreeSuspenseHandler(workInProgress2), workInProgress2.flags |= 128, null;
              if (0 !== (renderLanes2 & workInProgress2.child.childLanes))
                return updateSuspenseComponent(current2, workInProgress2, renderLanes2);
              pushPrimaryTreeSuspenseHandler(workInProgress2);
              current2 = bailoutOnAlreadyFinishedWork(
                current2,
                workInProgress2,
                renderLanes2
              );
              return null !== current2 ? current2.sibling : null;
            }
            pushPrimaryTreeSuspenseHandler(workInProgress2);
            break;
          case 19:
            var didSuspendBefore = 0 !== (current2.flags & 128);
            state$102 = 0 !== (renderLanes2 & workInProgress2.childLanes);
            state$102 || (propagateParentContextChanges(
              current2,
              workInProgress2,
              renderLanes2,
              false
            ), state$102 = 0 !== (renderLanes2 & workInProgress2.childLanes));
            if (didSuspendBefore) {
              if (state$102)
                return updateSuspenseListComponent(
                  current2,
                  workInProgress2,
                  renderLanes2
                );
              workInProgress2.flags |= 128;
            }
            didSuspendBefore = workInProgress2.memoizedState;
            null !== didSuspendBefore && (didSuspendBefore.rendering = null, didSuspendBefore.tail = null, didSuspendBefore.lastEffect = null);
            push2(suspenseStackCursor, suspenseStackCursor.current);
            if (state$102) break;
            else return null;
          case 22:
            return workInProgress2.lanes = 0, updateOffscreenComponent(
              current2,
              workInProgress2,
              renderLanes2,
              workInProgress2.pendingProps
            );
          case 24:
            pushProvider(workInProgress2, CacheContext, current2.memoizedState.cache);
        }
        return bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
      }
      function beginWork(current2, workInProgress2, renderLanes2) {
        if (null !== current2)
          if (current2.memoizedProps !== workInProgress2.pendingProps)
            didReceiveUpdate = true;
          else {
            if (!checkScheduledUpdateOrContext(current2, renderLanes2) && 0 === (workInProgress2.flags & 128))
              return didReceiveUpdate = false, attemptEarlyBailoutIfNoScheduledUpdate(
                current2,
                workInProgress2,
                renderLanes2
              );
            didReceiveUpdate = 0 !== (current2.flags & 131072) ? true : false;
          }
        else
          didReceiveUpdate = false, isHydrating && 0 !== (workInProgress2.flags & 1048576) && pushTreeId(workInProgress2, treeForkCount, workInProgress2.index);
        workInProgress2.lanes = 0;
        switch (workInProgress2.tag) {
          case 16:
            a: {
              var props = workInProgress2.pendingProps;
              current2 = resolveLazy(workInProgress2.elementType);
              workInProgress2.type = current2;
              if ("function" === typeof current2)
                shouldConstruct(current2) ? (props = resolveClassComponentProps(current2, props), workInProgress2.tag = 1, workInProgress2 = updateClassComponent(
                  null,
                  workInProgress2,
                  current2,
                  props,
                  renderLanes2
                )) : (workInProgress2.tag = 0, workInProgress2 = updateFunctionComponent(
                  null,
                  workInProgress2,
                  current2,
                  props,
                  renderLanes2
                ));
              else {
                if (void 0 !== current2 && null !== current2) {
                  var $$typeof = current2.$$typeof;
                  if ($$typeof === REACT_FORWARD_REF_TYPE) {
                    workInProgress2.tag = 11;
                    workInProgress2 = updateForwardRef(
                      null,
                      workInProgress2,
                      current2,
                      props,
                      renderLanes2
                    );
                    break a;
                  } else if ($$typeof === REACT_MEMO_TYPE) {
                    workInProgress2.tag = 14;
                    workInProgress2 = updateMemoComponent(
                      null,
                      workInProgress2,
                      current2,
                      props,
                      renderLanes2
                    );
                    break a;
                  }
                }
                workInProgress2 = getComponentNameFromType(current2) || current2;
                throw Error(formatProdErrorMessage(306, workInProgress2, ""));
              }
            }
            return workInProgress2;
          case 0:
            return updateFunctionComponent(
              current2,
              workInProgress2,
              workInProgress2.type,
              workInProgress2.pendingProps,
              renderLanes2
            );
          case 1:
            return props = workInProgress2.type, $$typeof = resolveClassComponentProps(
              props,
              workInProgress2.pendingProps
            ), updateClassComponent(
              current2,
              workInProgress2,
              props,
              $$typeof,
              renderLanes2
            );
          case 3:
            a: {
              pushHostContainer(
                workInProgress2,
                workInProgress2.stateNode.containerInfo
              );
              if (null === current2) throw Error(formatProdErrorMessage(387));
              props = workInProgress2.pendingProps;
              var prevState = workInProgress2.memoizedState;
              $$typeof = prevState.element;
              cloneUpdateQueue(current2, workInProgress2);
              processUpdateQueue(workInProgress2, props, null, renderLanes2);
              var nextState = workInProgress2.memoizedState;
              props = nextState.cache;
              pushProvider(workInProgress2, CacheContext, props);
              props !== prevState.cache && propagateContextChanges(
                workInProgress2,
                [CacheContext],
                renderLanes2,
                true
              );
              suspendIfUpdateReadFromEntangledAsyncAction();
              props = nextState.element;
              if (prevState.isDehydrated)
                if (prevState = {
                  element: props,
                  isDehydrated: false,
                  cache: nextState.cache
                }, workInProgress2.updateQueue.baseState = prevState, workInProgress2.memoizedState = prevState, workInProgress2.flags & 256) {
                  workInProgress2 = mountHostRootWithoutHydrating(
                    current2,
                    workInProgress2,
                    props,
                    renderLanes2
                  );
                  break a;
                } else if (props !== $$typeof) {
                  $$typeof = createCapturedValueAtFiber(
                    Error(formatProdErrorMessage(424)),
                    workInProgress2
                  );
                  queueHydrationError($$typeof);
                  workInProgress2 = mountHostRootWithoutHydrating(
                    current2,
                    workInProgress2,
                    props,
                    renderLanes2
                  );
                  break a;
                } else {
                  current2 = workInProgress2.stateNode.containerInfo;
                  switch (current2.nodeType) {
                    case 9:
                      current2 = current2.body;
                      break;
                    default:
                      current2 = "HTML" === current2.nodeName ? current2.ownerDocument.body : current2;
                  }
                  nextHydratableInstance = getNextHydratable(current2.firstChild);
                  hydrationParentFiber = workInProgress2;
                  isHydrating = true;
                  hydrationErrors = null;
                  rootOrSingletonContext = true;
                  renderLanes2 = mountChildFibers(
                    workInProgress2,
                    null,
                    props,
                    renderLanes2
                  );
                  for (workInProgress2.child = renderLanes2; renderLanes2; )
                    renderLanes2.flags = renderLanes2.flags & -3 | 4096, renderLanes2 = renderLanes2.sibling;
                }
              else {
                resetHydrationState();
                if (props === $$typeof) {
                  workInProgress2 = bailoutOnAlreadyFinishedWork(
                    current2,
                    workInProgress2,
                    renderLanes2
                  );
                  break a;
                }
                reconcileChildren(current2, workInProgress2, props, renderLanes2);
              }
              workInProgress2 = workInProgress2.child;
            }
            return workInProgress2;
          case 26:
            return markRef(current2, workInProgress2), null === current2 ? (renderLanes2 = getResource(
              workInProgress2.type,
              null,
              workInProgress2.pendingProps,
              null
            )) ? workInProgress2.memoizedState = renderLanes2 : isHydrating || (renderLanes2 = workInProgress2.type, current2 = workInProgress2.pendingProps, props = getOwnerDocumentFromRootContainer(
              rootInstanceStackCursor.current
            ).createElement(renderLanes2), props[internalInstanceKey] = workInProgress2, props[internalPropsKey] = current2, setInitialProperties(props, renderLanes2, current2), markNodeAsHoistable(props), workInProgress2.stateNode = props) : workInProgress2.memoizedState = getResource(
              workInProgress2.type,
              current2.memoizedProps,
              workInProgress2.pendingProps,
              current2.memoizedState
            ), null;
          case 27:
            return pushHostContext(workInProgress2), null === current2 && isHydrating && (props = workInProgress2.stateNode = resolveSingletonInstance(
              workInProgress2.type,
              workInProgress2.pendingProps,
              rootInstanceStackCursor.current
            ), hydrationParentFiber = workInProgress2, rootOrSingletonContext = true, $$typeof = nextHydratableInstance, isSingletonScope(workInProgress2.type) ? (previousHydratableOnEnteringScopedSingleton = $$typeof, nextHydratableInstance = getNextHydratable(props.firstChild)) : nextHydratableInstance = $$typeof), reconcileChildren(
              current2,
              workInProgress2,
              workInProgress2.pendingProps.children,
              renderLanes2
            ), markRef(current2, workInProgress2), null === current2 && (workInProgress2.flags |= 4194304), workInProgress2.child;
          case 5:
            if (null === current2 && isHydrating) {
              if ($$typeof = props = nextHydratableInstance)
                props = canHydrateInstance(
                  props,
                  workInProgress2.type,
                  workInProgress2.pendingProps,
                  rootOrSingletonContext
                ), null !== props ? (workInProgress2.stateNode = props, hydrationParentFiber = workInProgress2, nextHydratableInstance = getNextHydratable(props.firstChild), rootOrSingletonContext = false, $$typeof = true) : $$typeof = false;
              $$typeof || throwOnHydrationMismatch(workInProgress2);
            }
            pushHostContext(workInProgress2);
            $$typeof = workInProgress2.type;
            prevState = workInProgress2.pendingProps;
            nextState = null !== current2 ? current2.memoizedProps : null;
            props = prevState.children;
            shouldSetTextContent($$typeof, prevState) ? props = null : null !== nextState && shouldSetTextContent($$typeof, nextState) && (workInProgress2.flags |= 32);
            null !== workInProgress2.memoizedState && ($$typeof = renderWithHooks(
              current2,
              workInProgress2,
              TransitionAwareHostComponent,
              null,
              null,
              renderLanes2
            ), HostTransitionContext._currentValue = $$typeof);
            markRef(current2, workInProgress2);
            reconcileChildren(current2, workInProgress2, props, renderLanes2);
            return workInProgress2.child;
          case 6:
            if (null === current2 && isHydrating) {
              if (current2 = renderLanes2 = nextHydratableInstance)
                renderLanes2 = canHydrateTextInstance(
                  renderLanes2,
                  workInProgress2.pendingProps,
                  rootOrSingletonContext
                ), null !== renderLanes2 ? (workInProgress2.stateNode = renderLanes2, hydrationParentFiber = workInProgress2, nextHydratableInstance = null, current2 = true) : current2 = false;
              current2 || throwOnHydrationMismatch(workInProgress2);
            }
            return null;
          case 13:
            return updateSuspenseComponent(current2, workInProgress2, renderLanes2);
          case 4:
            return pushHostContainer(
              workInProgress2,
              workInProgress2.stateNode.containerInfo
            ), props = workInProgress2.pendingProps, null === current2 ? workInProgress2.child = reconcileChildFibers(
              workInProgress2,
              null,
              props,
              renderLanes2
            ) : reconcileChildren(current2, workInProgress2, props, renderLanes2), workInProgress2.child;
          case 11:
            return updateForwardRef(
              current2,
              workInProgress2,
              workInProgress2.type,
              workInProgress2.pendingProps,
              renderLanes2
            );
          case 7:
            return reconcileChildren(
              current2,
              workInProgress2,
              workInProgress2.pendingProps,
              renderLanes2
            ), workInProgress2.child;
          case 8:
            return reconcileChildren(
              current2,
              workInProgress2,
              workInProgress2.pendingProps.children,
              renderLanes2
            ), workInProgress2.child;
          case 12:
            return reconcileChildren(
              current2,
              workInProgress2,
              workInProgress2.pendingProps.children,
              renderLanes2
            ), workInProgress2.child;
          case 10:
            return props = workInProgress2.pendingProps, pushProvider(workInProgress2, workInProgress2.type, props.value), reconcileChildren(current2, workInProgress2, props.children, renderLanes2), workInProgress2.child;
          case 9:
            return $$typeof = workInProgress2.type._context, props = workInProgress2.pendingProps.children, prepareToReadContext(workInProgress2), $$typeof = readContext($$typeof), props = props($$typeof), workInProgress2.flags |= 1, reconcileChildren(current2, workInProgress2, props, renderLanes2), workInProgress2.child;
          case 14:
            return updateMemoComponent(
              current2,
              workInProgress2,
              workInProgress2.type,
              workInProgress2.pendingProps,
              renderLanes2
            );
          case 15:
            return updateSimpleMemoComponent(
              current2,
              workInProgress2,
              workInProgress2.type,
              workInProgress2.pendingProps,
              renderLanes2
            );
          case 19:
            return updateSuspenseListComponent(current2, workInProgress2, renderLanes2);
          case 31:
            return updateActivityComponent(current2, workInProgress2, renderLanes2);
          case 22:
            return updateOffscreenComponent(
              current2,
              workInProgress2,
              renderLanes2,
              workInProgress2.pendingProps
            );
          case 24:
            return prepareToReadContext(workInProgress2), props = readContext(CacheContext), null === current2 ? ($$typeof = peekCacheFromPool(), null === $$typeof && ($$typeof = workInProgressRoot, prevState = createCache(), $$typeof.pooledCache = prevState, prevState.refCount++, null !== prevState && ($$typeof.pooledCacheLanes |= renderLanes2), $$typeof = prevState), workInProgress2.memoizedState = { parent: props, cache: $$typeof }, initializeUpdateQueue(workInProgress2), pushProvider(workInProgress2, CacheContext, $$typeof)) : (0 !== (current2.lanes & renderLanes2) && (cloneUpdateQueue(current2, workInProgress2), processUpdateQueue(workInProgress2, null, null, renderLanes2), suspendIfUpdateReadFromEntangledAsyncAction()), $$typeof = current2.memoizedState, prevState = workInProgress2.memoizedState, $$typeof.parent !== props ? ($$typeof = { parent: props, cache: props }, workInProgress2.memoizedState = $$typeof, 0 === workInProgress2.lanes && (workInProgress2.memoizedState = workInProgress2.updateQueue.baseState = $$typeof), pushProvider(workInProgress2, CacheContext, props)) : (props = prevState.cache, pushProvider(workInProgress2, CacheContext, props), props !== $$typeof.cache && propagateContextChanges(
              workInProgress2,
              [CacheContext],
              renderLanes2,
              true
            ))), reconcileChildren(
              current2,
              workInProgress2,
              workInProgress2.pendingProps.children,
              renderLanes2
            ), workInProgress2.child;
          case 29:
            throw workInProgress2.pendingProps;
        }
        throw Error(formatProdErrorMessage(156, workInProgress2.tag));
      }
      function markUpdate(workInProgress2) {
        workInProgress2.flags |= 4;
      }
      function preloadInstanceAndSuspendIfNeeded(workInProgress2, type, oldProps, newProps, renderLanes2) {
        if (type = 0 !== (workInProgress2.mode & 32)) type = false;
        if (type) {
          if (workInProgress2.flags |= 16777216, (renderLanes2 & 335544128) === renderLanes2)
            if (workInProgress2.stateNode.complete) workInProgress2.flags |= 8192;
            else if (shouldRemainOnPreviousScreen()) workInProgress2.flags |= 8192;
            else
              throw suspendedThenable = noopSuspenseyCommitThenable, SuspenseyCommitException;
        } else workInProgress2.flags &= -16777217;
      }
      function preloadResourceAndSuspendIfNeeded(workInProgress2, resource) {
        if ("stylesheet" !== resource.type || 0 !== (resource.state.loading & 4))
          workInProgress2.flags &= -16777217;
        else if (workInProgress2.flags |= 16777216, !preloadResource(resource))
          if (shouldRemainOnPreviousScreen()) workInProgress2.flags |= 8192;
          else
            throw suspendedThenable = noopSuspenseyCommitThenable, SuspenseyCommitException;
      }
      function scheduleRetryEffect(workInProgress2, retryQueue) {
        null !== retryQueue && (workInProgress2.flags |= 4);
        workInProgress2.flags & 16384 && (retryQueue = 22 !== workInProgress2.tag ? claimNextRetryLane() : 536870912, workInProgress2.lanes |= retryQueue, workInProgressSuspendedRetryLanes |= retryQueue);
      }
      function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) {
        if (!isHydrating)
          switch (renderState.tailMode) {
            case "hidden":
              hasRenderedATailFallback = renderState.tail;
              for (var lastTailNode = null; null !== hasRenderedATailFallback; )
                null !== hasRenderedATailFallback.alternate && (lastTailNode = hasRenderedATailFallback), hasRenderedATailFallback = hasRenderedATailFallback.sibling;
              null === lastTailNode ? renderState.tail = null : lastTailNode.sibling = null;
              break;
            case "collapsed":
              lastTailNode = renderState.tail;
              for (var lastTailNode$106 = null; null !== lastTailNode; )
                null !== lastTailNode.alternate && (lastTailNode$106 = lastTailNode), lastTailNode = lastTailNode.sibling;
              null === lastTailNode$106 ? hasRenderedATailFallback || null === renderState.tail ? renderState.tail = null : renderState.tail.sibling = null : lastTailNode$106.sibling = null;
          }
      }
      function bubbleProperties(completedWork) {
        var didBailout = null !== completedWork.alternate && completedWork.alternate.child === completedWork.child, newChildLanes = 0, subtreeFlags = 0;
        if (didBailout)
          for (var child$107 = completedWork.child; null !== child$107; )
            newChildLanes |= child$107.lanes | child$107.childLanes, subtreeFlags |= child$107.subtreeFlags & 65011712, subtreeFlags |= child$107.flags & 65011712, child$107.return = completedWork, child$107 = child$107.sibling;
        else
          for (child$107 = completedWork.child; null !== child$107; )
            newChildLanes |= child$107.lanes | child$107.childLanes, subtreeFlags |= child$107.subtreeFlags, subtreeFlags |= child$107.flags, child$107.return = completedWork, child$107 = child$107.sibling;
        completedWork.subtreeFlags |= subtreeFlags;
        completedWork.childLanes = newChildLanes;
        return didBailout;
      }
      function completeWork(current2, workInProgress2, renderLanes2) {
        var newProps = workInProgress2.pendingProps;
        popTreeContext(workInProgress2);
        switch (workInProgress2.tag) {
          case 16:
          case 15:
          case 0:
          case 11:
          case 7:
          case 8:
          case 12:
          case 9:
          case 14:
            return bubbleProperties(workInProgress2), null;
          case 1:
            return bubbleProperties(workInProgress2), null;
          case 3:
            renderLanes2 = workInProgress2.stateNode;
            newProps = null;
            null !== current2 && (newProps = current2.memoizedState.cache);
            workInProgress2.memoizedState.cache !== newProps && (workInProgress2.flags |= 2048);
            popProvider(CacheContext);
            popHostContainer();
            renderLanes2.pendingContext && (renderLanes2.context = renderLanes2.pendingContext, renderLanes2.pendingContext = null);
            if (null === current2 || null === current2.child)
              popHydrationState(workInProgress2) ? markUpdate(workInProgress2) : null === current2 || current2.memoizedState.isDehydrated && 0 === (workInProgress2.flags & 256) || (workInProgress2.flags |= 1024, upgradeHydrationErrorsToRecoverable());
            bubbleProperties(workInProgress2);
            return null;
          case 26:
            var type = workInProgress2.type, nextResource = workInProgress2.memoizedState;
            null === current2 ? (markUpdate(workInProgress2), null !== nextResource ? (bubbleProperties(workInProgress2), preloadResourceAndSuspendIfNeeded(workInProgress2, nextResource)) : (bubbleProperties(workInProgress2), preloadInstanceAndSuspendIfNeeded(
              workInProgress2,
              type,
              null,
              newProps,
              renderLanes2
            ))) : nextResource ? nextResource !== current2.memoizedState ? (markUpdate(workInProgress2), bubbleProperties(workInProgress2), preloadResourceAndSuspendIfNeeded(workInProgress2, nextResource)) : (bubbleProperties(workInProgress2), workInProgress2.flags &= -16777217) : (current2 = current2.memoizedProps, current2 !== newProps && markUpdate(workInProgress2), bubbleProperties(workInProgress2), preloadInstanceAndSuspendIfNeeded(
              workInProgress2,
              type,
              current2,
              newProps,
              renderLanes2
            ));
            return null;
          case 27:
            popHostContext(workInProgress2);
            renderLanes2 = rootInstanceStackCursor.current;
            type = workInProgress2.type;
            if (null !== current2 && null != workInProgress2.stateNode)
              current2.memoizedProps !== newProps && markUpdate(workInProgress2);
            else {
              if (!newProps) {
                if (null === workInProgress2.stateNode)
                  throw Error(formatProdErrorMessage(166));
                bubbleProperties(workInProgress2);
                return null;
              }
              current2 = contextStackCursor.current;
              popHydrationState(workInProgress2) ? prepareToHydrateHostInstance(workInProgress2) : (current2 = resolveSingletonInstance(type, newProps, renderLanes2), workInProgress2.stateNode = current2, markUpdate(workInProgress2));
            }
            bubbleProperties(workInProgress2);
            return null;
          case 5:
            popHostContext(workInProgress2);
            type = workInProgress2.type;
            if (null !== current2 && null != workInProgress2.stateNode)
              current2.memoizedProps !== newProps && markUpdate(workInProgress2);
            else {
              if (!newProps) {
                if (null === workInProgress2.stateNode)
                  throw Error(formatProdErrorMessage(166));
                bubbleProperties(workInProgress2);
                return null;
              }
              nextResource = contextStackCursor.current;
              if (popHydrationState(workInProgress2))
                prepareToHydrateHostInstance(workInProgress2);
              else {
                var ownerDocument = getOwnerDocumentFromRootContainer(
                  rootInstanceStackCursor.current
                );
                switch (nextResource) {
                  case 1:
                    nextResource = ownerDocument.createElementNS(
                      "http://www.w3.org/2000/svg",
                      type
                    );
                    break;
                  case 2:
                    nextResource = ownerDocument.createElementNS(
                      "http://www.w3.org/1998/Math/MathML",
                      type
                    );
                    break;
                  default:
                    switch (type) {
                      case "svg":
                        nextResource = ownerDocument.createElementNS(
                          "http://www.w3.org/2000/svg",
                          type
                        );
                        break;
                      case "math":
                        nextResource = ownerDocument.createElementNS(
                          "http://www.w3.org/1998/Math/MathML",
                          type
                        );
                        break;
                      case "script":
                        nextResource = ownerDocument.createElement("div");
                        nextResource.innerHTML = "<script><\/script>";
                        nextResource = nextResource.removeChild(
                          nextResource.firstChild
                        );
                        break;
                      case "select":
                        nextResource = "string" === typeof newProps.is ? ownerDocument.createElement("select", {
                          is: newProps.is
                        }) : ownerDocument.createElement("select");
                        newProps.multiple ? nextResource.multiple = true : newProps.size && (nextResource.size = newProps.size);
                        break;
                      default:
                        nextResource = "string" === typeof newProps.is ? ownerDocument.createElement(type, { is: newProps.is }) : ownerDocument.createElement(type);
                    }
                }
                nextResource[internalInstanceKey] = workInProgress2;
                nextResource[internalPropsKey] = newProps;
                a: for (ownerDocument = workInProgress2.child; null !== ownerDocument; ) {
                  if (5 === ownerDocument.tag || 6 === ownerDocument.tag)
                    nextResource.appendChild(ownerDocument.stateNode);
                  else if (4 !== ownerDocument.tag && 27 !== ownerDocument.tag && null !== ownerDocument.child) {
                    ownerDocument.child.return = ownerDocument;
                    ownerDocument = ownerDocument.child;
                    continue;
                  }
                  if (ownerDocument === workInProgress2) break a;
                  for (; null === ownerDocument.sibling; ) {
                    if (null === ownerDocument.return || ownerDocument.return === workInProgress2)
                      break a;
                    ownerDocument = ownerDocument.return;
                  }
                  ownerDocument.sibling.return = ownerDocument.return;
                  ownerDocument = ownerDocument.sibling;
                }
                workInProgress2.stateNode = nextResource;
                a: switch (setInitialProperties(nextResource, type, newProps), type) {
                  case "button":
                  case "input":
                  case "select":
                  case "textarea":
                    newProps = !!newProps.autoFocus;
                    break a;
                  case "img":
                    newProps = true;
                    break a;
                  default:
                    newProps = false;
                }
                newProps && markUpdate(workInProgress2);
              }
            }
            bubbleProperties(workInProgress2);
            preloadInstanceAndSuspendIfNeeded(
              workInProgress2,
              workInProgress2.type,
              null === current2 ? null : current2.memoizedProps,
              workInProgress2.pendingProps,
              renderLanes2
            );
            return null;
          case 6:
            if (current2 && null != workInProgress2.stateNode)
              current2.memoizedProps !== newProps && markUpdate(workInProgress2);
            else {
              if ("string" !== typeof newProps && null === workInProgress2.stateNode)
                throw Error(formatProdErrorMessage(166));
              current2 = rootInstanceStackCursor.current;
              if (popHydrationState(workInProgress2)) {
                current2 = workInProgress2.stateNode;
                renderLanes2 = workInProgress2.memoizedProps;
                newProps = null;
                type = hydrationParentFiber;
                if (null !== type)
                  switch (type.tag) {
                    case 27:
                    case 5:
                      newProps = type.memoizedProps;
                  }
                current2[internalInstanceKey] = workInProgress2;
                current2 = current2.nodeValue === renderLanes2 || null !== newProps && true === newProps.suppressHydrationWarning || checkForUnmatchedText(current2.nodeValue, renderLanes2) ? true : false;
                current2 || throwOnHydrationMismatch(workInProgress2, true);
              } else
                current2 = getOwnerDocumentFromRootContainer(current2).createTextNode(
                  newProps
                ), current2[internalInstanceKey] = workInProgress2, workInProgress2.stateNode = current2;
            }
            bubbleProperties(workInProgress2);
            return null;
          case 31:
            renderLanes2 = workInProgress2.memoizedState;
            if (null === current2 || null !== current2.memoizedState) {
              newProps = popHydrationState(workInProgress2);
              if (null !== renderLanes2) {
                if (null === current2) {
                  if (!newProps) throw Error(formatProdErrorMessage(318));
                  current2 = workInProgress2.memoizedState;
                  current2 = null !== current2 ? current2.dehydrated : null;
                  if (!current2) throw Error(formatProdErrorMessage(557));
                  current2[internalInstanceKey] = workInProgress2;
                } else
                  resetHydrationState(), 0 === (workInProgress2.flags & 128) && (workInProgress2.memoizedState = null), workInProgress2.flags |= 4;
                bubbleProperties(workInProgress2);
                current2 = false;
              } else
                renderLanes2 = upgradeHydrationErrorsToRecoverable(), null !== current2 && null !== current2.memoizedState && (current2.memoizedState.hydrationErrors = renderLanes2), current2 = true;
              if (!current2) {
                if (workInProgress2.flags & 256)
                  return popSuspenseHandler(workInProgress2), workInProgress2;
                popSuspenseHandler(workInProgress2);
                return null;
              }
              if (0 !== (workInProgress2.flags & 128))
                throw Error(formatProdErrorMessage(558));
            }
            bubbleProperties(workInProgress2);
            return null;
          case 13:
            newProps = workInProgress2.memoizedState;
            if (null === current2 || null !== current2.memoizedState && null !== current2.memoizedState.dehydrated) {
              type = popHydrationState(workInProgress2);
              if (null !== newProps && null !== newProps.dehydrated) {
                if (null === current2) {
                  if (!type) throw Error(formatProdErrorMessage(318));
                  type = workInProgress2.memoizedState;
                  type = null !== type ? type.dehydrated : null;
                  if (!type) throw Error(formatProdErrorMessage(317));
                  type[internalInstanceKey] = workInProgress2;
                } else
                  resetHydrationState(), 0 === (workInProgress2.flags & 128) && (workInProgress2.memoizedState = null), workInProgress2.flags |= 4;
                bubbleProperties(workInProgress2);
                type = false;
              } else
                type = upgradeHydrationErrorsToRecoverable(), null !== current2 && null !== current2.memoizedState && (current2.memoizedState.hydrationErrors = type), type = true;
              if (!type) {
                if (workInProgress2.flags & 256)
                  return popSuspenseHandler(workInProgress2), workInProgress2;
                popSuspenseHandler(workInProgress2);
                return null;
              }
            }
            popSuspenseHandler(workInProgress2);
            if (0 !== (workInProgress2.flags & 128))
              return workInProgress2.lanes = renderLanes2, workInProgress2;
            renderLanes2 = null !== newProps;
            current2 = null !== current2 && null !== current2.memoizedState;
            renderLanes2 && (newProps = workInProgress2.child, type = null, null !== newProps.alternate && null !== newProps.alternate.memoizedState && null !== newProps.alternate.memoizedState.cachePool && (type = newProps.alternate.memoizedState.cachePool.pool), nextResource = null, null !== newProps.memoizedState && null !== newProps.memoizedState.cachePool && (nextResource = newProps.memoizedState.cachePool.pool), nextResource !== type && (newProps.flags |= 2048));
            renderLanes2 !== current2 && renderLanes2 && (workInProgress2.child.flags |= 8192);
            scheduleRetryEffect(workInProgress2, workInProgress2.updateQueue);
            bubbleProperties(workInProgress2);
            return null;
          case 4:
            return popHostContainer(), null === current2 && listenToAllSupportedEvents(workInProgress2.stateNode.containerInfo), bubbleProperties(workInProgress2), null;
          case 10:
            return popProvider(workInProgress2.type), bubbleProperties(workInProgress2), null;
          case 19:
            pop2(suspenseStackCursor);
            newProps = workInProgress2.memoizedState;
            if (null === newProps) return bubbleProperties(workInProgress2), null;
            type = 0 !== (workInProgress2.flags & 128);
            nextResource = newProps.rendering;
            if (null === nextResource)
              if (type) cutOffTailIfNeeded(newProps, false);
              else {
                if (0 !== workInProgressRootExitStatus || null !== current2 && 0 !== (current2.flags & 128))
                  for (current2 = workInProgress2.child; null !== current2; ) {
                    nextResource = findFirstSuspended(current2);
                    if (null !== nextResource) {
                      workInProgress2.flags |= 128;
                      cutOffTailIfNeeded(newProps, false);
                      current2 = nextResource.updateQueue;
                      workInProgress2.updateQueue = current2;
                      scheduleRetryEffect(workInProgress2, current2);
                      workInProgress2.subtreeFlags = 0;
                      current2 = renderLanes2;
                      for (renderLanes2 = workInProgress2.child; null !== renderLanes2; )
                        resetWorkInProgress(renderLanes2, current2), renderLanes2 = renderLanes2.sibling;
                      push2(
                        suspenseStackCursor,
                        suspenseStackCursor.current & 1 | 2
                      );
                      isHydrating && pushTreeFork(workInProgress2, newProps.treeForkCount);
                      return workInProgress2.child;
                    }
                    current2 = current2.sibling;
                  }
                null !== newProps.tail && now() > workInProgressRootRenderTargetTime && (workInProgress2.flags |= 128, type = true, cutOffTailIfNeeded(newProps, false), workInProgress2.lanes = 4194304);
              }
            else {
              if (!type)
                if (current2 = findFirstSuspended(nextResource), null !== current2) {
                  if (workInProgress2.flags |= 128, type = true, current2 = current2.updateQueue, workInProgress2.updateQueue = current2, scheduleRetryEffect(workInProgress2, current2), cutOffTailIfNeeded(newProps, true), null === newProps.tail && "hidden" === newProps.tailMode && !nextResource.alternate && !isHydrating)
                    return bubbleProperties(workInProgress2), null;
                } else
                  2 * now() - newProps.renderingStartTime > workInProgressRootRenderTargetTime && 536870912 !== renderLanes2 && (workInProgress2.flags |= 128, type = true, cutOffTailIfNeeded(newProps, false), workInProgress2.lanes = 4194304);
              newProps.isBackwards ? (nextResource.sibling = workInProgress2.child, workInProgress2.child = nextResource) : (current2 = newProps.last, null !== current2 ? current2.sibling = nextResource : workInProgress2.child = nextResource, newProps.last = nextResource);
            }
            if (null !== newProps.tail)
              return current2 = newProps.tail, newProps.rendering = current2, newProps.tail = current2.sibling, newProps.renderingStartTime = now(), current2.sibling = null, renderLanes2 = suspenseStackCursor.current, push2(
                suspenseStackCursor,
                type ? renderLanes2 & 1 | 2 : renderLanes2 & 1
              ), isHydrating && pushTreeFork(workInProgress2, newProps.treeForkCount), current2;
            bubbleProperties(workInProgress2);
            return null;
          case 22:
          case 23:
            return popSuspenseHandler(workInProgress2), popHiddenContext(), newProps = null !== workInProgress2.memoizedState, null !== current2 ? null !== current2.memoizedState !== newProps && (workInProgress2.flags |= 8192) : newProps && (workInProgress2.flags |= 8192), newProps ? 0 !== (renderLanes2 & 536870912) && 0 === (workInProgress2.flags & 128) && (bubbleProperties(workInProgress2), workInProgress2.subtreeFlags & 6 && (workInProgress2.flags |= 8192)) : bubbleProperties(workInProgress2), renderLanes2 = workInProgress2.updateQueue, null !== renderLanes2 && scheduleRetryEffect(workInProgress2, renderLanes2.retryQueue), renderLanes2 = null, null !== current2 && null !== current2.memoizedState && null !== current2.memoizedState.cachePool && (renderLanes2 = current2.memoizedState.cachePool.pool), newProps = null, null !== workInProgress2.memoizedState && null !== workInProgress2.memoizedState.cachePool && (newProps = workInProgress2.memoizedState.cachePool.pool), newProps !== renderLanes2 && (workInProgress2.flags |= 2048), null !== current2 && pop2(resumedCache), null;
          case 24:
            return renderLanes2 = null, null !== current2 && (renderLanes2 = current2.memoizedState.cache), workInProgress2.memoizedState.cache !== renderLanes2 && (workInProgress2.flags |= 2048), popProvider(CacheContext), bubbleProperties(workInProgress2), null;
          case 25:
            return null;
          case 30:
            return null;
        }
        throw Error(formatProdErrorMessage(156, workInProgress2.tag));
      }
      function unwindWork(current2, workInProgress2) {
        popTreeContext(workInProgress2);
        switch (workInProgress2.tag) {
          case 1:
            return current2 = workInProgress2.flags, current2 & 65536 ? (workInProgress2.flags = current2 & -65537 | 128, workInProgress2) : null;
          case 3:
            return popProvider(CacheContext), popHostContainer(), current2 = workInProgress2.flags, 0 !== (current2 & 65536) && 0 === (current2 & 128) ? (workInProgress2.flags = current2 & -65537 | 128, workInProgress2) : null;
          case 26:
          case 27:
          case 5:
            return popHostContext(workInProgress2), null;
          case 31:
            if (null !== workInProgress2.memoizedState) {
              popSuspenseHandler(workInProgress2);
              if (null === workInProgress2.alternate)
                throw Error(formatProdErrorMessage(340));
              resetHydrationState();
            }
            current2 = workInProgress2.flags;
            return current2 & 65536 ? (workInProgress2.flags = current2 & -65537 | 128, workInProgress2) : null;
          case 13:
            popSuspenseHandler(workInProgress2);
            current2 = workInProgress2.memoizedState;
            if (null !== current2 && null !== current2.dehydrated) {
              if (null === workInProgress2.alternate)
                throw Error(formatProdErrorMessage(340));
              resetHydrationState();
            }
            current2 = workInProgress2.flags;
            return current2 & 65536 ? (workInProgress2.flags = current2 & -65537 | 128, workInProgress2) : null;
          case 19:
            return pop2(suspenseStackCursor), null;
          case 4:
            return popHostContainer(), null;
          case 10:
            return popProvider(workInProgress2.type), null;
          case 22:
          case 23:
            return popSuspenseHandler(workInProgress2), popHiddenContext(), null !== current2 && pop2(resumedCache), current2 = workInProgress2.flags, current2 & 65536 ? (workInProgress2.flags = current2 & -65537 | 128, workInProgress2) : null;
          case 24:
            return popProvider(CacheContext), null;
          case 25:
            return null;
          default:
            return null;
        }
      }
      function unwindInterruptedWork(current2, interruptedWork) {
        popTreeContext(interruptedWork);
        switch (interruptedWork.tag) {
          case 3:
            popProvider(CacheContext);
            popHostContainer();
            break;
          case 26:
          case 27:
          case 5:
            popHostContext(interruptedWork);
            break;
          case 4:
            popHostContainer();
            break;
          case 31:
            null !== interruptedWork.memoizedState && popSuspenseHandler(interruptedWork);
            break;
          case 13:
            popSuspenseHandler(interruptedWork);
            break;
          case 19:
            pop2(suspenseStackCursor);
            break;
          case 10:
            popProvider(interruptedWork.type);
            break;
          case 22:
          case 23:
            popSuspenseHandler(interruptedWork);
            popHiddenContext();
            null !== current2 && pop2(resumedCache);
            break;
          case 24:
            popProvider(CacheContext);
        }
      }
      function commitHookEffectListMount(flags, finishedWork) {
        try {
          var updateQueue = finishedWork.updateQueue, lastEffect = null !== updateQueue ? updateQueue.lastEffect : null;
          if (null !== lastEffect) {
            var firstEffect = lastEffect.next;
            updateQueue = firstEffect;
            do {
              if ((updateQueue.tag & flags) === flags) {
                lastEffect = void 0;
                var create2 = updateQueue.create, inst = updateQueue.inst;
                lastEffect = create2();
                inst.destroy = lastEffect;
              }
              updateQueue = updateQueue.next;
            } while (updateQueue !== firstEffect);
          }
        } catch (error2) {
          captureCommitPhaseError(finishedWork, finishedWork.return, error2);
        }
      }
      function commitHookEffectListUnmount(flags, finishedWork, nearestMountedAncestor$jscomp$0) {
        try {
          var updateQueue = finishedWork.updateQueue, lastEffect = null !== updateQueue ? updateQueue.lastEffect : null;
          if (null !== lastEffect) {
            var firstEffect = lastEffect.next;
            updateQueue = firstEffect;
            do {
              if ((updateQueue.tag & flags) === flags) {
                var inst = updateQueue.inst, destroy2 = inst.destroy;
                if (void 0 !== destroy2) {
                  inst.destroy = void 0;
                  lastEffect = finishedWork;
                  var nearestMountedAncestor = nearestMountedAncestor$jscomp$0, destroy_ = destroy2;
                  try {
                    destroy_();
                  } catch (error2) {
                    captureCommitPhaseError(
                      lastEffect,
                      nearestMountedAncestor,
                      error2
                    );
                  }
                }
              }
              updateQueue = updateQueue.next;
            } while (updateQueue !== firstEffect);
          }
        } catch (error2) {
          captureCommitPhaseError(finishedWork, finishedWork.return, error2);
        }
      }
      function commitClassCallbacks(finishedWork) {
        var updateQueue = finishedWork.updateQueue;
        if (null !== updateQueue) {
          var instance = finishedWork.stateNode;
          try {
            commitCallbacks(updateQueue, instance);
          } catch (error2) {
            captureCommitPhaseError(finishedWork, finishedWork.return, error2);
          }
        }
      }
      function safelyCallComponentWillUnmount(current2, nearestMountedAncestor, instance) {
        instance.props = resolveClassComponentProps(
          current2.type,
          current2.memoizedProps
        );
        instance.state = current2.memoizedState;
        try {
          instance.componentWillUnmount();
        } catch (error2) {
          captureCommitPhaseError(current2, nearestMountedAncestor, error2);
        }
      }
      function safelyAttachRef(current2, nearestMountedAncestor) {
        try {
          var ref = current2.ref;
          if (null !== ref) {
            switch (current2.tag) {
              case 26:
              case 27:
              case 5:
                var instanceToUse = current2.stateNode;
                break;
              case 30:
                instanceToUse = current2.stateNode;
                break;
              default:
                instanceToUse = current2.stateNode;
            }
            "function" === typeof ref ? current2.refCleanup = ref(instanceToUse) : ref.current = instanceToUse;
          }
        } catch (error2) {
          captureCommitPhaseError(current2, nearestMountedAncestor, error2);
        }
      }
      function safelyDetachRef(current2, nearestMountedAncestor) {
        var ref = current2.ref, refCleanup = current2.refCleanup;
        if (null !== ref)
          if ("function" === typeof refCleanup)
            try {
              refCleanup();
            } catch (error2) {
              captureCommitPhaseError(current2, nearestMountedAncestor, error2);
            } finally {
              current2.refCleanup = null, current2 = current2.alternate, null != current2 && (current2.refCleanup = null);
            }
          else if ("function" === typeof ref)
            try {
              ref(null);
            } catch (error$140) {
              captureCommitPhaseError(current2, nearestMountedAncestor, error$140);
            }
          else ref.current = null;
      }
      function commitHostMount(finishedWork) {
        var type = finishedWork.type, props = finishedWork.memoizedProps, instance = finishedWork.stateNode;
        try {
          a: switch (type) {
            case "button":
            case "input":
            case "select":
            case "textarea":
              props.autoFocus && instance.focus();
              break a;
            case "img":
              props.src ? instance.src = props.src : props.srcSet && (instance.srcset = props.srcSet);
          }
        } catch (error2) {
          captureCommitPhaseError(finishedWork, finishedWork.return, error2);
        }
      }
      function commitHostUpdate(finishedWork, newProps, oldProps) {
        try {
          var domElement = finishedWork.stateNode;
          updateProperties(domElement, finishedWork.type, oldProps, newProps);
          domElement[internalPropsKey] = newProps;
        } catch (error2) {
          captureCommitPhaseError(finishedWork, finishedWork.return, error2);
        }
      }
      function isHostParent(fiber) {
        return 5 === fiber.tag || 3 === fiber.tag || 26 === fiber.tag || 27 === fiber.tag && isSingletonScope(fiber.type) || 4 === fiber.tag;
      }
      function getHostSibling(fiber) {
        a: for (; ; ) {
          for (; null === fiber.sibling; ) {
            if (null === fiber.return || isHostParent(fiber.return)) return null;
            fiber = fiber.return;
          }
          fiber.sibling.return = fiber.return;
          for (fiber = fiber.sibling; 5 !== fiber.tag && 6 !== fiber.tag && 18 !== fiber.tag; ) {
            if (27 === fiber.tag && isSingletonScope(fiber.type)) continue a;
            if (fiber.flags & 2) continue a;
            if (null === fiber.child || 4 === fiber.tag) continue a;
            else fiber.child.return = fiber, fiber = fiber.child;
          }
          if (!(fiber.flags & 2)) return fiber.stateNode;
        }
      }
      function insertOrAppendPlacementNodeIntoContainer(node2, before, parent) {
        var tag = node2.tag;
        if (5 === tag || 6 === tag)
          node2 = node2.stateNode, before ? (9 === parent.nodeType ? parent.body : "HTML" === parent.nodeName ? parent.ownerDocument.body : parent).insertBefore(node2, before) : (before = 9 === parent.nodeType ? parent.body : "HTML" === parent.nodeName ? parent.ownerDocument.body : parent, before.appendChild(node2), parent = parent._reactRootContainer, null !== parent && void 0 !== parent || null !== before.onclick || (before.onclick = noop$1));
        else if (4 !== tag && (27 === tag && isSingletonScope(node2.type) && (parent = node2.stateNode, before = null), node2 = node2.child, null !== node2))
          for (insertOrAppendPlacementNodeIntoContainer(node2, before, parent), node2 = node2.sibling; null !== node2; )
            insertOrAppendPlacementNodeIntoContainer(node2, before, parent), node2 = node2.sibling;
      }
      function insertOrAppendPlacementNode(node2, before, parent) {
        var tag = node2.tag;
        if (5 === tag || 6 === tag)
          node2 = node2.stateNode, before ? parent.insertBefore(node2, before) : parent.appendChild(node2);
        else if (4 !== tag && (27 === tag && isSingletonScope(node2.type) && (parent = node2.stateNode), node2 = node2.child, null !== node2))
          for (insertOrAppendPlacementNode(node2, before, parent), node2 = node2.sibling; null !== node2; )
            insertOrAppendPlacementNode(node2, before, parent), node2 = node2.sibling;
      }
      function commitHostSingletonAcquisition(finishedWork) {
        var singleton = finishedWork.stateNode, props = finishedWork.memoizedProps;
        try {
          for (var type = finishedWork.type, attributes2 = singleton.attributes; attributes2.length; )
            singleton.removeAttributeNode(attributes2[0]);
          setInitialProperties(singleton, type, props);
          singleton[internalInstanceKey] = finishedWork;
          singleton[internalPropsKey] = props;
        } catch (error2) {
          captureCommitPhaseError(finishedWork, finishedWork.return, error2);
        }
      }
      var offscreenSubtreeIsHidden = false, offscreenSubtreeWasHidden = false, needsFormReset = false, PossiblyWeakSet = "function" === typeof WeakSet ? WeakSet : Set, nextEffect = null;
      function commitBeforeMutationEffects(root3, firstChild) {
        root3 = root3.containerInfo;
        eventsEnabled = _enabled;
        root3 = getActiveElementDeep(root3);
        if (hasSelectionCapabilities(root3)) {
          if ("selectionStart" in root3)
            var JSCompiler_temp = {
              start: root3.selectionStart,
              end: root3.selectionEnd
            };
          else
            a: {
              JSCompiler_temp = (JSCompiler_temp = root3.ownerDocument) && JSCompiler_temp.defaultView || window;
              var selection = JSCompiler_temp.getSelection && JSCompiler_temp.getSelection();
              if (selection && 0 !== selection.rangeCount) {
                JSCompiler_temp = selection.anchorNode;
                var anchorOffset = selection.anchorOffset, focusNode = selection.focusNode;
                selection = selection.focusOffset;
                try {
                  JSCompiler_temp.nodeType, focusNode.nodeType;
                } catch (e$20) {
                  JSCompiler_temp = null;
                  break a;
                }
                var length = 0, start2 = -1, end2 = -1, indexWithinAnchor = 0, indexWithinFocus = 0, node2 = root3, parentNode = null;
                b: for (; ; ) {
                  for (var next; ; ) {
                    node2 !== JSCompiler_temp || 0 !== anchorOffset && 3 !== node2.nodeType || (start2 = length + anchorOffset);
                    node2 !== focusNode || 0 !== selection && 3 !== node2.nodeType || (end2 = length + selection);
                    3 === node2.nodeType && (length += node2.nodeValue.length);
                    if (null === (next = node2.firstChild)) break;
                    parentNode = node2;
                    node2 = next;
                  }
                  for (; ; ) {
                    if (node2 === root3) break b;
                    parentNode === JSCompiler_temp && ++indexWithinAnchor === anchorOffset && (start2 = length);
                    parentNode === focusNode && ++indexWithinFocus === selection && (end2 = length);
                    if (null !== (next = node2.nextSibling)) break;
                    node2 = parentNode;
                    parentNode = node2.parentNode;
                  }
                  node2 = next;
                }
                JSCompiler_temp = -1 === start2 || -1 === end2 ? null : { start: start2, end: end2 };
              } else JSCompiler_temp = null;
            }
          JSCompiler_temp = JSCompiler_temp || { start: 0, end: 0 };
        } else JSCompiler_temp = null;
        selectionInformation = { focusedElem: root3, selectionRange: JSCompiler_temp };
        _enabled = false;
        for (nextEffect = firstChild; null !== nextEffect; )
          if (firstChild = nextEffect, root3 = firstChild.child, 0 !== (firstChild.subtreeFlags & 1028) && null !== root3)
            root3.return = firstChild, nextEffect = root3;
          else
            for (; null !== nextEffect; ) {
              firstChild = nextEffect;
              focusNode = firstChild.alternate;
              root3 = firstChild.flags;
              switch (firstChild.tag) {
                case 0:
                  if (0 !== (root3 & 4) && (root3 = firstChild.updateQueue, root3 = null !== root3 ? root3.events : null, null !== root3))
                    for (JSCompiler_temp = 0; JSCompiler_temp < root3.length; JSCompiler_temp++)
                      anchorOffset = root3[JSCompiler_temp], anchorOffset.ref.impl = anchorOffset.nextImpl;
                  break;
                case 11:
                case 15:
                  break;
                case 1:
                  if (0 !== (root3 & 1024) && null !== focusNode) {
                    root3 = void 0;
                    JSCompiler_temp = firstChild;
                    anchorOffset = focusNode.memoizedProps;
                    focusNode = focusNode.memoizedState;
                    selection = JSCompiler_temp.stateNode;
                    try {
                      var resolvedPrevProps = resolveClassComponentProps(
                        JSCompiler_temp.type,
                        anchorOffset
                      );
                      root3 = selection.getSnapshotBeforeUpdate(
                        resolvedPrevProps,
                        focusNode
                      );
                      selection.__reactInternalSnapshotBeforeUpdate = root3;
                    } catch (error2) {
                      captureCommitPhaseError(
                        JSCompiler_temp,
                        JSCompiler_temp.return,
                        error2
                      );
                    }
                  }
                  break;
                case 3:
                  if (0 !== (root3 & 1024)) {
                    if (root3 = firstChild.stateNode.containerInfo, JSCompiler_temp = root3.nodeType, 9 === JSCompiler_temp)
                      clearContainerSparingly(root3);
                    else if (1 === JSCompiler_temp)
                      switch (root3.nodeName) {
                        case "HEAD":
                        case "HTML":
                        case "BODY":
                          clearContainerSparingly(root3);
                          break;
                        default:
                          root3.textContent = "";
                      }
                  }
                  break;
                case 5:
                case 26:
                case 27:
                case 6:
                case 4:
                case 17:
                  break;
                default:
                  if (0 !== (root3 & 1024)) throw Error(formatProdErrorMessage(163));
              }
              root3 = firstChild.sibling;
              if (null !== root3) {
                root3.return = firstChild.return;
                nextEffect = root3;
                break;
              }
              nextEffect = firstChild.return;
            }
      }
      function commitLayoutEffectOnFiber(finishedRoot, current2, finishedWork) {
        var flags = finishedWork.flags;
        switch (finishedWork.tag) {
          case 0:
          case 11:
          case 15:
            recursivelyTraverseLayoutEffects(finishedRoot, finishedWork);
            flags & 4 && commitHookEffectListMount(5, finishedWork);
            break;
          case 1:
            recursivelyTraverseLayoutEffects(finishedRoot, finishedWork);
            if (flags & 4)
              if (finishedRoot = finishedWork.stateNode, null === current2)
                try {
                  finishedRoot.componentDidMount();
                } catch (error2) {
                  captureCommitPhaseError(finishedWork, finishedWork.return, error2);
                }
              else {
                var prevProps = resolveClassComponentProps(
                  finishedWork.type,
                  current2.memoizedProps
                );
                current2 = current2.memoizedState;
                try {
                  finishedRoot.componentDidUpdate(
                    prevProps,
                    current2,
                    finishedRoot.__reactInternalSnapshotBeforeUpdate
                  );
                } catch (error$139) {
                  captureCommitPhaseError(
                    finishedWork,
                    finishedWork.return,
                    error$139
                  );
                }
              }
            flags & 64 && commitClassCallbacks(finishedWork);
            flags & 512 && safelyAttachRef(finishedWork, finishedWork.return);
            break;
          case 3:
            recursivelyTraverseLayoutEffects(finishedRoot, finishedWork);
            if (flags & 64 && (finishedRoot = finishedWork.updateQueue, null !== finishedRoot)) {
              current2 = null;
              if (null !== finishedWork.child)
                switch (finishedWork.child.tag) {
                  case 27:
                  case 5:
                    current2 = finishedWork.child.stateNode;
                    break;
                  case 1:
                    current2 = finishedWork.child.stateNode;
                }
              try {
                commitCallbacks(finishedRoot, current2);
              } catch (error2) {
                captureCommitPhaseError(finishedWork, finishedWork.return, error2);
              }
            }
            break;
          case 27:
            null === current2 && flags & 4 && commitHostSingletonAcquisition(finishedWork);
          case 26:
          case 5:
            recursivelyTraverseLayoutEffects(finishedRoot, finishedWork);
            null === current2 && flags & 4 && commitHostMount(finishedWork);
            flags & 512 && safelyAttachRef(finishedWork, finishedWork.return);
            break;
          case 12:
            recursivelyTraverseLayoutEffects(finishedRoot, finishedWork);
            break;
          case 31:
            recursivelyTraverseLayoutEffects(finishedRoot, finishedWork);
            flags & 4 && commitActivityHydrationCallbacks(finishedRoot, finishedWork);
            break;
          case 13:
            recursivelyTraverseLayoutEffects(finishedRoot, finishedWork);
            flags & 4 && commitSuspenseHydrationCallbacks(finishedRoot, finishedWork);
            flags & 64 && (finishedRoot = finishedWork.memoizedState, null !== finishedRoot && (finishedRoot = finishedRoot.dehydrated, null !== finishedRoot && (finishedWork = retryDehydratedSuspenseBoundary.bind(
              null,
              finishedWork
            ), registerSuspenseInstanceRetry(finishedRoot, finishedWork))));
            break;
          case 22:
            flags = null !== finishedWork.memoizedState || offscreenSubtreeIsHidden;
            if (!flags) {
              current2 = null !== current2 && null !== current2.memoizedState || offscreenSubtreeWasHidden;
              prevProps = offscreenSubtreeIsHidden;
              var prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden;
              offscreenSubtreeIsHidden = flags;
              (offscreenSubtreeWasHidden = current2) && !prevOffscreenSubtreeWasHidden ? recursivelyTraverseReappearLayoutEffects(
                finishedRoot,
                finishedWork,
                0 !== (finishedWork.subtreeFlags & 8772)
              ) : recursivelyTraverseLayoutEffects(finishedRoot, finishedWork);
              offscreenSubtreeIsHidden = prevProps;
              offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden;
            }
            break;
          case 30:
            break;
          default:
            recursivelyTraverseLayoutEffects(finishedRoot, finishedWork);
        }
      }
      function detachFiberAfterEffects(fiber) {
        var alternate = fiber.alternate;
        null !== alternate && (fiber.alternate = null, detachFiberAfterEffects(alternate));
        fiber.child = null;
        fiber.deletions = null;
        fiber.sibling = null;
        5 === fiber.tag && (alternate = fiber.stateNode, null !== alternate && detachDeletedInstance(alternate));
        fiber.stateNode = null;
        fiber.return = null;
        fiber.dependencies = null;
        fiber.memoizedProps = null;
        fiber.memoizedState = null;
        fiber.pendingProps = null;
        fiber.stateNode = null;
        fiber.updateQueue = null;
      }
      var hostParent = null, hostParentIsContainer = false;
      function recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, parent) {
        for (parent = parent.child; null !== parent; )
          commitDeletionEffectsOnFiber(finishedRoot, nearestMountedAncestor, parent), parent = parent.sibling;
      }
      function commitDeletionEffectsOnFiber(finishedRoot, nearestMountedAncestor, deletedFiber) {
        if (injectedHook && "function" === typeof injectedHook.onCommitFiberUnmount)
          try {
            injectedHook.onCommitFiberUnmount(rendererID, deletedFiber);
          } catch (err2) {
          }
        switch (deletedFiber.tag) {
          case 26:
            offscreenSubtreeWasHidden || safelyDetachRef(deletedFiber, nearestMountedAncestor);
            recursivelyTraverseDeletionEffects(
              finishedRoot,
              nearestMountedAncestor,
              deletedFiber
            );
            deletedFiber.memoizedState ? deletedFiber.memoizedState.count-- : deletedFiber.stateNode && (deletedFiber = deletedFiber.stateNode, deletedFiber.parentNode.removeChild(deletedFiber));
            break;
          case 27:
            offscreenSubtreeWasHidden || safelyDetachRef(deletedFiber, nearestMountedAncestor);
            var prevHostParent = hostParent, prevHostParentIsContainer = hostParentIsContainer;
            isSingletonScope(deletedFiber.type) && (hostParent = deletedFiber.stateNode, hostParentIsContainer = false);
            recursivelyTraverseDeletionEffects(
              finishedRoot,
              nearestMountedAncestor,
              deletedFiber
            );
            releaseSingletonInstance(deletedFiber.stateNode);
            hostParent = prevHostParent;
            hostParentIsContainer = prevHostParentIsContainer;
            break;
          case 5:
            offscreenSubtreeWasHidden || safelyDetachRef(deletedFiber, nearestMountedAncestor);
          case 6:
            prevHostParent = hostParent;
            prevHostParentIsContainer = hostParentIsContainer;
            hostParent = null;
            recursivelyTraverseDeletionEffects(
              finishedRoot,
              nearestMountedAncestor,
              deletedFiber
            );
            hostParent = prevHostParent;
            hostParentIsContainer = prevHostParentIsContainer;
            if (null !== hostParent)
              if (hostParentIsContainer)
                try {
                  (9 === hostParent.nodeType ? hostParent.body : "HTML" === hostParent.nodeName ? hostParent.ownerDocument.body : hostParent).removeChild(deletedFiber.stateNode);
                } catch (error2) {
                  captureCommitPhaseError(
                    deletedFiber,
                    nearestMountedAncestor,
                    error2
                  );
                }
              else
                try {
                  hostParent.removeChild(deletedFiber.stateNode);
                } catch (error2) {
                  captureCommitPhaseError(
                    deletedFiber,
                    nearestMountedAncestor,
                    error2
                  );
                }
            break;
          case 18:
            null !== hostParent && (hostParentIsContainer ? (finishedRoot = hostParent, clearHydrationBoundary(
              9 === finishedRoot.nodeType ? finishedRoot.body : "HTML" === finishedRoot.nodeName ? finishedRoot.ownerDocument.body : finishedRoot,
              deletedFiber.stateNode
            ), retryIfBlockedOn(finishedRoot)) : clearHydrationBoundary(hostParent, deletedFiber.stateNode));
            break;
          case 4:
            prevHostParent = hostParent;
            prevHostParentIsContainer = hostParentIsContainer;
            hostParent = deletedFiber.stateNode.containerInfo;
            hostParentIsContainer = true;
            recursivelyTraverseDeletionEffects(
              finishedRoot,
              nearestMountedAncestor,
              deletedFiber
            );
            hostParent = prevHostParent;
            hostParentIsContainer = prevHostParentIsContainer;
            break;
          case 0:
          case 11:
          case 14:
          case 15:
            commitHookEffectListUnmount(2, deletedFiber, nearestMountedAncestor);
            offscreenSubtreeWasHidden || commitHookEffectListUnmount(4, deletedFiber, nearestMountedAncestor);
            recursivelyTraverseDeletionEffects(
              finishedRoot,
              nearestMountedAncestor,
              deletedFiber
            );
            break;
          case 1:
            offscreenSubtreeWasHidden || (safelyDetachRef(deletedFiber, nearestMountedAncestor), prevHostParent = deletedFiber.stateNode, "function" === typeof prevHostParent.componentWillUnmount && safelyCallComponentWillUnmount(
              deletedFiber,
              nearestMountedAncestor,
              prevHostParent
            ));
            recursivelyTraverseDeletionEffects(
              finishedRoot,
              nearestMountedAncestor,
              deletedFiber
            );
            break;
          case 21:
            recursivelyTraverseDeletionEffects(
              finishedRoot,
              nearestMountedAncestor,
              deletedFiber
            );
            break;
          case 22:
            offscreenSubtreeWasHidden = (prevHostParent = offscreenSubtreeWasHidden) || null !== deletedFiber.memoizedState;
            recursivelyTraverseDeletionEffects(
              finishedRoot,
              nearestMountedAncestor,
              deletedFiber
            );
            offscreenSubtreeWasHidden = prevHostParent;
            break;
          default:
            recursivelyTraverseDeletionEffects(
              finishedRoot,
              nearestMountedAncestor,
              deletedFiber
            );
        }
      }
      function commitActivityHydrationCallbacks(finishedRoot, finishedWork) {
        if (null === finishedWork.memoizedState && (finishedRoot = finishedWork.alternate, null !== finishedRoot && (finishedRoot = finishedRoot.memoizedState, null !== finishedRoot))) {
          finishedRoot = finishedRoot.dehydrated;
          try {
            retryIfBlockedOn(finishedRoot);
          } catch (error2) {
            captureCommitPhaseError(finishedWork, finishedWork.return, error2);
          }
        }
      }
      function commitSuspenseHydrationCallbacks(finishedRoot, finishedWork) {
        if (null === finishedWork.memoizedState && (finishedRoot = finishedWork.alternate, null !== finishedRoot && (finishedRoot = finishedRoot.memoizedState, null !== finishedRoot && (finishedRoot = finishedRoot.dehydrated, null !== finishedRoot))))
          try {
            retryIfBlockedOn(finishedRoot);
          } catch (error2) {
            captureCommitPhaseError(finishedWork, finishedWork.return, error2);
          }
      }
      function getRetryCache(finishedWork) {
        switch (finishedWork.tag) {
          case 31:
          case 13:
          case 19:
            var retryCache = finishedWork.stateNode;
            null === retryCache && (retryCache = finishedWork.stateNode = new PossiblyWeakSet());
            return retryCache;
          case 22:
            return finishedWork = finishedWork.stateNode, retryCache = finishedWork._retryCache, null === retryCache && (retryCache = finishedWork._retryCache = new PossiblyWeakSet()), retryCache;
          default:
            throw Error(formatProdErrorMessage(435, finishedWork.tag));
        }
      }
      function attachSuspenseRetryListeners(finishedWork, wakeables) {
        var retryCache = getRetryCache(finishedWork);
        wakeables.forEach(function(wakeable) {
          if (!retryCache.has(wakeable)) {
            retryCache.add(wakeable);
            var retry = resolveRetryWakeable.bind(null, finishedWork, wakeable);
            wakeable.then(retry, retry);
          }
        });
      }
      function recursivelyTraverseMutationEffects(root$jscomp$0, parentFiber) {
        var deletions = parentFiber.deletions;
        if (null !== deletions)
          for (var i2 = 0; i2 < deletions.length; i2++) {
            var childToDelete = deletions[i2], root3 = root$jscomp$0, returnFiber = parentFiber, parent = returnFiber;
            a: for (; null !== parent; ) {
              switch (parent.tag) {
                case 27:
                  if (isSingletonScope(parent.type)) {
                    hostParent = parent.stateNode;
                    hostParentIsContainer = false;
                    break a;
                  }
                  break;
                case 5:
                  hostParent = parent.stateNode;
                  hostParentIsContainer = false;
                  break a;
                case 3:
                case 4:
                  hostParent = parent.stateNode.containerInfo;
                  hostParentIsContainer = true;
                  break a;
              }
              parent = parent.return;
            }
            if (null === hostParent) throw Error(formatProdErrorMessage(160));
            commitDeletionEffectsOnFiber(root3, returnFiber, childToDelete);
            hostParent = null;
            hostParentIsContainer = false;
            root3 = childToDelete.alternate;
            null !== root3 && (root3.return = null);
            childToDelete.return = null;
          }
        if (parentFiber.subtreeFlags & 13886)
          for (parentFiber = parentFiber.child; null !== parentFiber; )
            commitMutationEffectsOnFiber(parentFiber, root$jscomp$0), parentFiber = parentFiber.sibling;
      }
      var currentHoistableRoot = null;
      function commitMutationEffectsOnFiber(finishedWork, root3) {
        var current2 = finishedWork.alternate, flags = finishedWork.flags;
        switch (finishedWork.tag) {
          case 0:
          case 11:
          case 14:
          case 15:
            recursivelyTraverseMutationEffects(root3, finishedWork);
            commitReconciliationEffects(finishedWork);
            flags & 4 && (commitHookEffectListUnmount(3, finishedWork, finishedWork.return), commitHookEffectListMount(3, finishedWork), commitHookEffectListUnmount(5, finishedWork, finishedWork.return));
            break;
          case 1:
            recursivelyTraverseMutationEffects(root3, finishedWork);
            commitReconciliationEffects(finishedWork);
            flags & 512 && (offscreenSubtreeWasHidden || null === current2 || safelyDetachRef(current2, current2.return));
            flags & 64 && offscreenSubtreeIsHidden && (finishedWork = finishedWork.updateQueue, null !== finishedWork && (flags = finishedWork.callbacks, null !== flags && (current2 = finishedWork.shared.hiddenCallbacks, finishedWork.shared.hiddenCallbacks = null === current2 ? flags : current2.concat(flags))));
            break;
          case 26:
            var hoistableRoot = currentHoistableRoot;
            recursivelyTraverseMutationEffects(root3, finishedWork);
            commitReconciliationEffects(finishedWork);
            flags & 512 && (offscreenSubtreeWasHidden || null === current2 || safelyDetachRef(current2, current2.return));
            if (flags & 4) {
              var currentResource = null !== current2 ? current2.memoizedState : null;
              flags = finishedWork.memoizedState;
              if (null === current2)
                if (null === flags)
                  if (null === finishedWork.stateNode) {
                    a: {
                      flags = finishedWork.type;
                      current2 = finishedWork.memoizedProps;
                      hoistableRoot = hoistableRoot.ownerDocument || hoistableRoot;
                      b: switch (flags) {
                        case "title":
                          currentResource = hoistableRoot.getElementsByTagName("title")[0];
                          if (!currentResource || currentResource[internalHoistableMarker] || currentResource[internalInstanceKey] || "http://www.w3.org/2000/svg" === currentResource.namespaceURI || currentResource.hasAttribute("itemprop"))
                            currentResource = hoistableRoot.createElement(flags), hoistableRoot.head.insertBefore(
                              currentResource,
                              hoistableRoot.querySelector("head > title")
                            );
                          setInitialProperties(currentResource, flags, current2);
                          currentResource[internalInstanceKey] = finishedWork;
                          markNodeAsHoistable(currentResource);
                          flags = currentResource;
                          break a;
                        case "link":
                          var maybeNodes = getHydratableHoistableCache(
                            "link",
                            "href",
                            hoistableRoot
                          ).get(flags + (current2.href || ""));
                          if (maybeNodes) {
                            for (var i2 = 0; i2 < maybeNodes.length; i2++)
                              if (currentResource = maybeNodes[i2], currentResource.getAttribute("href") === (null == current2.href || "" === current2.href ? null : current2.href) && currentResource.getAttribute("rel") === (null == current2.rel ? null : current2.rel) && currentResource.getAttribute("title") === (null == current2.title ? null : current2.title) && currentResource.getAttribute("crossorigin") === (null == current2.crossOrigin ? null : current2.crossOrigin)) {
                                maybeNodes.splice(i2, 1);
                                break b;
                              }
                          }
                          currentResource = hoistableRoot.createElement(flags);
                          setInitialProperties(currentResource, flags, current2);
                          hoistableRoot.head.appendChild(currentResource);
                          break;
                        case "meta":
                          if (maybeNodes = getHydratableHoistableCache(
                            "meta",
                            "content",
                            hoistableRoot
                          ).get(flags + (current2.content || ""))) {
                            for (i2 = 0; i2 < maybeNodes.length; i2++)
                              if (currentResource = maybeNodes[i2], currentResource.getAttribute("content") === (null == current2.content ? null : "" + current2.content) && currentResource.getAttribute("name") === (null == current2.name ? null : current2.name) && currentResource.getAttribute("property") === (null == current2.property ? null : current2.property) && currentResource.getAttribute("http-equiv") === (null == current2.httpEquiv ? null : current2.httpEquiv) && currentResource.getAttribute("charset") === (null == current2.charSet ? null : current2.charSet)) {
                                maybeNodes.splice(i2, 1);
                                break b;
                              }
                          }
                          currentResource = hoistableRoot.createElement(flags);
                          setInitialProperties(currentResource, flags, current2);
                          hoistableRoot.head.appendChild(currentResource);
                          break;
                        default:
                          throw Error(formatProdErrorMessage(468, flags));
                      }
                      currentResource[internalInstanceKey] = finishedWork;
                      markNodeAsHoistable(currentResource);
                      flags = currentResource;
                    }
                    finishedWork.stateNode = flags;
                  } else
                    mountHoistable(
                      hoistableRoot,
                      finishedWork.type,
                      finishedWork.stateNode
                    );
                else
                  finishedWork.stateNode = acquireResource(
                    hoistableRoot,
                    flags,
                    finishedWork.memoizedProps
                  );
              else
                currentResource !== flags ? (null === currentResource ? null !== current2.stateNode && (current2 = current2.stateNode, current2.parentNode.removeChild(current2)) : currentResource.count--, null === flags ? mountHoistable(
                  hoistableRoot,
                  finishedWork.type,
                  finishedWork.stateNode
                ) : acquireResource(
                  hoistableRoot,
                  flags,
                  finishedWork.memoizedProps
                )) : null === flags && null !== finishedWork.stateNode && commitHostUpdate(
                  finishedWork,
                  finishedWork.memoizedProps,
                  current2.memoizedProps
                );
            }
            break;
          case 27:
            recursivelyTraverseMutationEffects(root3, finishedWork);
            commitReconciliationEffects(finishedWork);
            flags & 512 && (offscreenSubtreeWasHidden || null === current2 || safelyDetachRef(current2, current2.return));
            null !== current2 && flags & 4 && commitHostUpdate(
              finishedWork,
              finishedWork.memoizedProps,
              current2.memoizedProps
            );
            break;
          case 5:
            recursivelyTraverseMutationEffects(root3, finishedWork);
            commitReconciliationEffects(finishedWork);
            flags & 512 && (offscreenSubtreeWasHidden || null === current2 || safelyDetachRef(current2, current2.return));
            if (finishedWork.flags & 32) {
              hoistableRoot = finishedWork.stateNode;
              try {
                setTextContent(hoistableRoot, "");
              } catch (error2) {
                captureCommitPhaseError(finishedWork, finishedWork.return, error2);
              }
            }
            flags & 4 && null != finishedWork.stateNode && (hoistableRoot = finishedWork.memoizedProps, commitHostUpdate(
              finishedWork,
              hoistableRoot,
              null !== current2 ? current2.memoizedProps : hoistableRoot
            ));
            flags & 1024 && (needsFormReset = true);
            break;
          case 6:
            recursivelyTraverseMutationEffects(root3, finishedWork);
            commitReconciliationEffects(finishedWork);
            if (flags & 4) {
              if (null === finishedWork.stateNode)
                throw Error(formatProdErrorMessage(162));
              flags = finishedWork.memoizedProps;
              current2 = finishedWork.stateNode;
              try {
                current2.nodeValue = flags;
              } catch (error2) {
                captureCommitPhaseError(finishedWork, finishedWork.return, error2);
              }
            }
            break;
          case 3:
            tagCaches = null;
            hoistableRoot = currentHoistableRoot;
            currentHoistableRoot = getHoistableRoot(root3.containerInfo);
            recursivelyTraverseMutationEffects(root3, finishedWork);
            currentHoistableRoot = hoistableRoot;
            commitReconciliationEffects(finishedWork);
            if (flags & 4 && null !== current2 && current2.memoizedState.isDehydrated)
              try {
                retryIfBlockedOn(root3.containerInfo);
              } catch (error2) {
                captureCommitPhaseError(finishedWork, finishedWork.return, error2);
              }
            needsFormReset && (needsFormReset = false, recursivelyResetForms(finishedWork));
            break;
          case 4:
            flags = currentHoistableRoot;
            currentHoistableRoot = getHoistableRoot(
              finishedWork.stateNode.containerInfo
            );
            recursivelyTraverseMutationEffects(root3, finishedWork);
            commitReconciliationEffects(finishedWork);
            currentHoistableRoot = flags;
            break;
          case 12:
            recursivelyTraverseMutationEffects(root3, finishedWork);
            commitReconciliationEffects(finishedWork);
            break;
          case 31:
            recursivelyTraverseMutationEffects(root3, finishedWork);
            commitReconciliationEffects(finishedWork);
            flags & 4 && (flags = finishedWork.updateQueue, null !== flags && (finishedWork.updateQueue = null, attachSuspenseRetryListeners(finishedWork, flags)));
            break;
          case 13:
            recursivelyTraverseMutationEffects(root3, finishedWork);
            commitReconciliationEffects(finishedWork);
            finishedWork.child.flags & 8192 && null !== finishedWork.memoizedState !== (null !== current2 && null !== current2.memoizedState) && (globalMostRecentFallbackTime = now());
            flags & 4 && (flags = finishedWork.updateQueue, null !== flags && (finishedWork.updateQueue = null, attachSuspenseRetryListeners(finishedWork, flags)));
            break;
          case 22:
            hoistableRoot = null !== finishedWork.memoizedState;
            var wasHidden = null !== current2 && null !== current2.memoizedState, prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden, prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden;
            offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden || hoistableRoot;
            offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden || wasHidden;
            recursivelyTraverseMutationEffects(root3, finishedWork);
            offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden;
            offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden;
            commitReconciliationEffects(finishedWork);
            if (flags & 8192)
              a: for (root3 = finishedWork.stateNode, root3._visibility = hoistableRoot ? root3._visibility & -2 : root3._visibility | 1, hoistableRoot && (null === current2 || wasHidden || offscreenSubtreeIsHidden || offscreenSubtreeWasHidden || recursivelyTraverseDisappearLayoutEffects(finishedWork)), current2 = null, root3 = finishedWork; ; ) {
                if (5 === root3.tag || 26 === root3.tag) {
                  if (null === current2) {
                    wasHidden = current2 = root3;
                    try {
                      if (currentResource = wasHidden.stateNode, hoistableRoot)
                        maybeNodes = currentResource.style, "function" === typeof maybeNodes.setProperty ? maybeNodes.setProperty("display", "none", "important") : maybeNodes.display = "none";
                      else {
                        i2 = wasHidden.stateNode;
                        var styleProp = wasHidden.memoizedProps.style, display = void 0 !== styleProp && null !== styleProp && styleProp.hasOwnProperty("display") ? styleProp.display : null;
                        i2.style.display = null == display || "boolean" === typeof display ? "" : ("" + display).trim();
                      }
                    } catch (error2) {
                      captureCommitPhaseError(wasHidden, wasHidden.return, error2);
                    }
                  }
                } else if (6 === root3.tag) {
                  if (null === current2) {
                    wasHidden = root3;
                    try {
                      wasHidden.stateNode.nodeValue = hoistableRoot ? "" : wasHidden.memoizedProps;
                    } catch (error2) {
                      captureCommitPhaseError(wasHidden, wasHidden.return, error2);
                    }
                  }
                } else if (18 === root3.tag) {
                  if (null === current2) {
                    wasHidden = root3;
                    try {
                      var instance = wasHidden.stateNode;
                      hoistableRoot ? hideOrUnhideDehydratedBoundary(instance, true) : hideOrUnhideDehydratedBoundary(wasHidden.stateNode, false);
                    } catch (error2) {
                      captureCommitPhaseError(wasHidden, wasHidden.return, error2);
                    }
                  }
                } else if ((22 !== root3.tag && 23 !== root3.tag || null === root3.memoizedState || root3 === finishedWork) && null !== root3.child) {
                  root3.child.return = root3;
                  root3 = root3.child;
                  continue;
                }
                if (root3 === finishedWork) break a;
                for (; null === root3.sibling; ) {
                  if (null === root3.return || root3.return === finishedWork) break a;
                  current2 === root3 && (current2 = null);
                  root3 = root3.return;
                }
                current2 === root3 && (current2 = null);
                root3.sibling.return = root3.return;
                root3 = root3.sibling;
              }
            flags & 4 && (flags = finishedWork.updateQueue, null !== flags && (current2 = flags.retryQueue, null !== current2 && (flags.retryQueue = null, attachSuspenseRetryListeners(finishedWork, current2))));
            break;
          case 19:
            recursivelyTraverseMutationEffects(root3, finishedWork);
            commitReconciliationEffects(finishedWork);
            flags & 4 && (flags = finishedWork.updateQueue, null !== flags && (finishedWork.updateQueue = null, attachSuspenseRetryListeners(finishedWork, flags)));
            break;
          case 30:
            break;
          case 21:
            break;
          default:
            recursivelyTraverseMutationEffects(root3, finishedWork), commitReconciliationEffects(finishedWork);
        }
      }
      function commitReconciliationEffects(finishedWork) {
        var flags = finishedWork.flags;
        if (flags & 2) {
          try {
            for (var hostParentFiber, parentFiber = finishedWork.return; null !== parentFiber; ) {
              if (isHostParent(parentFiber)) {
                hostParentFiber = parentFiber;
                break;
              }
              parentFiber = parentFiber.return;
            }
            if (null == hostParentFiber) throw Error(formatProdErrorMessage(160));
            switch (hostParentFiber.tag) {
              case 27:
                var parent = hostParentFiber.stateNode, before = getHostSibling(finishedWork);
                insertOrAppendPlacementNode(finishedWork, before, parent);
                break;
              case 5:
                var parent$141 = hostParentFiber.stateNode;
                hostParentFiber.flags & 32 && (setTextContent(parent$141, ""), hostParentFiber.flags &= -33);
                var before$142 = getHostSibling(finishedWork);
                insertOrAppendPlacementNode(finishedWork, before$142, parent$141);
                break;
              case 3:
              case 4:
                var parent$143 = hostParentFiber.stateNode.containerInfo, before$144 = getHostSibling(finishedWork);
                insertOrAppendPlacementNodeIntoContainer(
                  finishedWork,
                  before$144,
                  parent$143
                );
                break;
              default:
                throw Error(formatProdErrorMessage(161));
            }
          } catch (error2) {
            captureCommitPhaseError(finishedWork, finishedWork.return, error2);
          }
          finishedWork.flags &= -3;
        }
        flags & 4096 && (finishedWork.flags &= -4097);
      }
      function recursivelyResetForms(parentFiber) {
        if (parentFiber.subtreeFlags & 1024)
          for (parentFiber = parentFiber.child; null !== parentFiber; ) {
            var fiber = parentFiber;
            recursivelyResetForms(fiber);
            5 === fiber.tag && fiber.flags & 1024 && fiber.stateNode.reset();
            parentFiber = parentFiber.sibling;
          }
      }
      function recursivelyTraverseLayoutEffects(root3, parentFiber) {
        if (parentFiber.subtreeFlags & 8772)
          for (parentFiber = parentFiber.child; null !== parentFiber; )
            commitLayoutEffectOnFiber(root3, parentFiber.alternate, parentFiber), parentFiber = parentFiber.sibling;
      }
      function recursivelyTraverseDisappearLayoutEffects(parentFiber) {
        for (parentFiber = parentFiber.child; null !== parentFiber; ) {
          var finishedWork = parentFiber;
          switch (finishedWork.tag) {
            case 0:
            case 11:
            case 14:
            case 15:
              commitHookEffectListUnmount(4, finishedWork, finishedWork.return);
              recursivelyTraverseDisappearLayoutEffects(finishedWork);
              break;
            case 1:
              safelyDetachRef(finishedWork, finishedWork.return);
              var instance = finishedWork.stateNode;
              "function" === typeof instance.componentWillUnmount && safelyCallComponentWillUnmount(
                finishedWork,
                finishedWork.return,
                instance
              );
              recursivelyTraverseDisappearLayoutEffects(finishedWork);
              break;
            case 27:
              releaseSingletonInstance(finishedWork.stateNode);
            case 26:
            case 5:
              safelyDetachRef(finishedWork, finishedWork.return);
              recursivelyTraverseDisappearLayoutEffects(finishedWork);
              break;
            case 22:
              null === finishedWork.memoizedState && recursivelyTraverseDisappearLayoutEffects(finishedWork);
              break;
            case 30:
              recursivelyTraverseDisappearLayoutEffects(finishedWork);
              break;
            default:
              recursivelyTraverseDisappearLayoutEffects(finishedWork);
          }
          parentFiber = parentFiber.sibling;
        }
      }
      function recursivelyTraverseReappearLayoutEffects(finishedRoot$jscomp$0, parentFiber, includeWorkInProgressEffects) {
        includeWorkInProgressEffects = includeWorkInProgressEffects && 0 !== (parentFiber.subtreeFlags & 8772);
        for (parentFiber = parentFiber.child; null !== parentFiber; ) {
          var current2 = parentFiber.alternate, finishedRoot = finishedRoot$jscomp$0, finishedWork = parentFiber, flags = finishedWork.flags;
          switch (finishedWork.tag) {
            case 0:
            case 11:
            case 15:
              recursivelyTraverseReappearLayoutEffects(
                finishedRoot,
                finishedWork,
                includeWorkInProgressEffects
              );
              commitHookEffectListMount(4, finishedWork);
              break;
            case 1:
              recursivelyTraverseReappearLayoutEffects(
                finishedRoot,
                finishedWork,
                includeWorkInProgressEffects
              );
              current2 = finishedWork;
              finishedRoot = current2.stateNode;
              if ("function" === typeof finishedRoot.componentDidMount)
                try {
                  finishedRoot.componentDidMount();
                } catch (error2) {
                  captureCommitPhaseError(current2, current2.return, error2);
                }
              current2 = finishedWork;
              finishedRoot = current2.updateQueue;
              if (null !== finishedRoot) {
                var instance = current2.stateNode;
                try {
                  var hiddenCallbacks = finishedRoot.shared.hiddenCallbacks;
                  if (null !== hiddenCallbacks)
                    for (finishedRoot.shared.hiddenCallbacks = null, finishedRoot = 0; finishedRoot < hiddenCallbacks.length; finishedRoot++)
                      callCallback(hiddenCallbacks[finishedRoot], instance);
                } catch (error2) {
                  captureCommitPhaseError(current2, current2.return, error2);
                }
              }
              includeWorkInProgressEffects && flags & 64 && commitClassCallbacks(finishedWork);
              safelyAttachRef(finishedWork, finishedWork.return);
              break;
            case 27:
              commitHostSingletonAcquisition(finishedWork);
            case 26:
            case 5:
              recursivelyTraverseReappearLayoutEffects(
                finishedRoot,
                finishedWork,
                includeWorkInProgressEffects
              );
              includeWorkInProgressEffects && null === current2 && flags & 4 && commitHostMount(finishedWork);
              safelyAttachRef(finishedWork, finishedWork.return);
              break;
            case 12:
              recursivelyTraverseReappearLayoutEffects(
                finishedRoot,
                finishedWork,
                includeWorkInProgressEffects
              );
              break;
            case 31:
              recursivelyTraverseReappearLayoutEffects(
                finishedRoot,
                finishedWork,
                includeWorkInProgressEffects
              );
              includeWorkInProgressEffects && flags & 4 && commitActivityHydrationCallbacks(finishedRoot, finishedWork);
              break;
            case 13:
              recursivelyTraverseReappearLayoutEffects(
                finishedRoot,
                finishedWork,
                includeWorkInProgressEffects
              );
              includeWorkInProgressEffects && flags & 4 && commitSuspenseHydrationCallbacks(finishedRoot, finishedWork);
              break;
            case 22:
              null === finishedWork.memoizedState && recursivelyTraverseReappearLayoutEffects(
                finishedRoot,
                finishedWork,
                includeWorkInProgressEffects
              );
              safelyAttachRef(finishedWork, finishedWork.return);
              break;
            case 30:
              break;
            default:
              recursivelyTraverseReappearLayoutEffects(
                finishedRoot,
                finishedWork,
                includeWorkInProgressEffects
              );
          }
          parentFiber = parentFiber.sibling;
        }
      }
      function commitOffscreenPassiveMountEffects(current2, finishedWork) {
        var previousCache = null;
        null !== current2 && null !== current2.memoizedState && null !== current2.memoizedState.cachePool && (previousCache = current2.memoizedState.cachePool.pool);
        current2 = null;
        null !== finishedWork.memoizedState && null !== finishedWork.memoizedState.cachePool && (current2 = finishedWork.memoizedState.cachePool.pool);
        current2 !== previousCache && (null != current2 && current2.refCount++, null != previousCache && releaseCache(previousCache));
      }
      function commitCachePassiveMountEffect(current2, finishedWork) {
        current2 = null;
        null !== finishedWork.alternate && (current2 = finishedWork.alternate.memoizedState.cache);
        finishedWork = finishedWork.memoizedState.cache;
        finishedWork !== current2 && (finishedWork.refCount++, null != current2 && releaseCache(current2));
      }
      function recursivelyTraversePassiveMountEffects(root3, parentFiber, committedLanes, committedTransitions) {
        if (parentFiber.subtreeFlags & 10256)
          for (parentFiber = parentFiber.child; null !== parentFiber; )
            commitPassiveMountOnFiber(
              root3,
              parentFiber,
              committedLanes,
              committedTransitions
            ), parentFiber = parentFiber.sibling;
      }
      function commitPassiveMountOnFiber(finishedRoot, finishedWork, committedLanes, committedTransitions) {
        var flags = finishedWork.flags;
        switch (finishedWork.tag) {
          case 0:
          case 11:
          case 15:
            recursivelyTraversePassiveMountEffects(
              finishedRoot,
              finishedWork,
              committedLanes,
              committedTransitions
            );
            flags & 2048 && commitHookEffectListMount(9, finishedWork);
            break;
          case 1:
            recursivelyTraversePassiveMountEffects(
              finishedRoot,
              finishedWork,
              committedLanes,
              committedTransitions
            );
            break;
          case 3:
            recursivelyTraversePassiveMountEffects(
              finishedRoot,
              finishedWork,
              committedLanes,
              committedTransitions
            );
            flags & 2048 && (finishedRoot = null, null !== finishedWork.alternate && (finishedRoot = finishedWork.alternate.memoizedState.cache), finishedWork = finishedWork.memoizedState.cache, finishedWork !== finishedRoot && (finishedWork.refCount++, null != finishedRoot && releaseCache(finishedRoot)));
            break;
          case 12:
            if (flags & 2048) {
              recursivelyTraversePassiveMountEffects(
                finishedRoot,
                finishedWork,
                committedLanes,
                committedTransitions
              );
              finishedRoot = finishedWork.stateNode;
              try {
                var _finishedWork$memoize2 = finishedWork.memoizedProps, id = _finishedWork$memoize2.id, onPostCommit = _finishedWork$memoize2.onPostCommit;
                "function" === typeof onPostCommit && onPostCommit(
                  id,
                  null === finishedWork.alternate ? "mount" : "update",
                  finishedRoot.passiveEffectDuration,
                  -0
                );
              } catch (error2) {
                captureCommitPhaseError(finishedWork, finishedWork.return, error2);
              }
            } else
              recursivelyTraversePassiveMountEffects(
                finishedRoot,
                finishedWork,
                committedLanes,
                committedTransitions
              );
            break;
          case 31:
            recursivelyTraversePassiveMountEffects(
              finishedRoot,
              finishedWork,
              committedLanes,
              committedTransitions
            );
            break;
          case 13:
            recursivelyTraversePassiveMountEffects(
              finishedRoot,
              finishedWork,
              committedLanes,
              committedTransitions
            );
            break;
          case 23:
            break;
          case 22:
            _finishedWork$memoize2 = finishedWork.stateNode;
            id = finishedWork.alternate;
            null !== finishedWork.memoizedState ? _finishedWork$memoize2._visibility & 2 ? recursivelyTraversePassiveMountEffects(
              finishedRoot,
              finishedWork,
              committedLanes,
              committedTransitions
            ) : recursivelyTraverseAtomicPassiveEffects(finishedRoot, finishedWork) : _finishedWork$memoize2._visibility & 2 ? recursivelyTraversePassiveMountEffects(
              finishedRoot,
              finishedWork,
              committedLanes,
              committedTransitions
            ) : (_finishedWork$memoize2._visibility |= 2, recursivelyTraverseReconnectPassiveEffects(
              finishedRoot,
              finishedWork,
              committedLanes,
              committedTransitions,
              0 !== (finishedWork.subtreeFlags & 10256) || false
            ));
            flags & 2048 && commitOffscreenPassiveMountEffects(id, finishedWork);
            break;
          case 24:
            recursivelyTraversePassiveMountEffects(
              finishedRoot,
              finishedWork,
              committedLanes,
              committedTransitions
            );
            flags & 2048 && commitCachePassiveMountEffect(finishedWork.alternate, finishedWork);
            break;
          default:
            recursivelyTraversePassiveMountEffects(
              finishedRoot,
              finishedWork,
              committedLanes,
              committedTransitions
            );
        }
      }
      function recursivelyTraverseReconnectPassiveEffects(finishedRoot$jscomp$0, parentFiber, committedLanes$jscomp$0, committedTransitions$jscomp$0, includeWorkInProgressEffects) {
        includeWorkInProgressEffects = includeWorkInProgressEffects && (0 !== (parentFiber.subtreeFlags & 10256) || false);
        for (parentFiber = parentFiber.child; null !== parentFiber; ) {
          var finishedRoot = finishedRoot$jscomp$0, finishedWork = parentFiber, committedLanes = committedLanes$jscomp$0, committedTransitions = committedTransitions$jscomp$0, flags = finishedWork.flags;
          switch (finishedWork.tag) {
            case 0:
            case 11:
            case 15:
              recursivelyTraverseReconnectPassiveEffects(
                finishedRoot,
                finishedWork,
                committedLanes,
                committedTransitions,
                includeWorkInProgressEffects
              );
              commitHookEffectListMount(8, finishedWork);
              break;
            case 23:
              break;
            case 22:
              var instance = finishedWork.stateNode;
              null !== finishedWork.memoizedState ? instance._visibility & 2 ? recursivelyTraverseReconnectPassiveEffects(
                finishedRoot,
                finishedWork,
                committedLanes,
                committedTransitions,
                includeWorkInProgressEffects
              ) : recursivelyTraverseAtomicPassiveEffects(
                finishedRoot,
                finishedWork
              ) : (instance._visibility |= 2, recursivelyTraverseReconnectPassiveEffects(
                finishedRoot,
                finishedWork,
                committedLanes,
                committedTransitions,
                includeWorkInProgressEffects
              ));
              includeWorkInProgressEffects && flags & 2048 && commitOffscreenPassiveMountEffects(
                finishedWork.alternate,
                finishedWork
              );
              break;
            case 24:
              recursivelyTraverseReconnectPassiveEffects(
                finishedRoot,
                finishedWork,
                committedLanes,
                committedTransitions,
                includeWorkInProgressEffects
              );
              includeWorkInProgressEffects && flags & 2048 && commitCachePassiveMountEffect(finishedWork.alternate, finishedWork);
              break;
            default:
              recursivelyTraverseReconnectPassiveEffects(
                finishedRoot,
                finishedWork,
                committedLanes,
                committedTransitions,
                includeWorkInProgressEffects
              );
          }
          parentFiber = parentFiber.sibling;
        }
      }
      function recursivelyTraverseAtomicPassiveEffects(finishedRoot$jscomp$0, parentFiber) {
        if (parentFiber.subtreeFlags & 10256)
          for (parentFiber = parentFiber.child; null !== parentFiber; ) {
            var finishedRoot = finishedRoot$jscomp$0, finishedWork = parentFiber, flags = finishedWork.flags;
            switch (finishedWork.tag) {
              case 22:
                recursivelyTraverseAtomicPassiveEffects(finishedRoot, finishedWork);
                flags & 2048 && commitOffscreenPassiveMountEffects(
                  finishedWork.alternate,
                  finishedWork
                );
                break;
              case 24:
                recursivelyTraverseAtomicPassiveEffects(finishedRoot, finishedWork);
                flags & 2048 && commitCachePassiveMountEffect(finishedWork.alternate, finishedWork);
                break;
              default:
                recursivelyTraverseAtomicPassiveEffects(finishedRoot, finishedWork);
            }
            parentFiber = parentFiber.sibling;
          }
      }
      var suspenseyCommitFlag = 8192;
      function recursivelyAccumulateSuspenseyCommit(parentFiber, committedLanes, suspendedState) {
        if (parentFiber.subtreeFlags & suspenseyCommitFlag)
          for (parentFiber = parentFiber.child; null !== parentFiber; )
            accumulateSuspenseyCommitOnFiber(
              parentFiber,
              committedLanes,
              suspendedState
            ), parentFiber = parentFiber.sibling;
      }
      function accumulateSuspenseyCommitOnFiber(fiber, committedLanes, suspendedState) {
        switch (fiber.tag) {
          case 26:
            recursivelyAccumulateSuspenseyCommit(
              fiber,
              committedLanes,
              suspendedState
            );
            fiber.flags & suspenseyCommitFlag && null !== fiber.memoizedState && suspendResource(
              suspendedState,
              currentHoistableRoot,
              fiber.memoizedState,
              fiber.memoizedProps
            );
            break;
          case 5:
            recursivelyAccumulateSuspenseyCommit(
              fiber,
              committedLanes,
              suspendedState
            );
            break;
          case 3:
          case 4:
            var previousHoistableRoot = currentHoistableRoot;
            currentHoistableRoot = getHoistableRoot(fiber.stateNode.containerInfo);
            recursivelyAccumulateSuspenseyCommit(
              fiber,
              committedLanes,
              suspendedState
            );
            currentHoistableRoot = previousHoistableRoot;
            break;
          case 22:
            null === fiber.memoizedState && (previousHoistableRoot = fiber.alternate, null !== previousHoistableRoot && null !== previousHoistableRoot.memoizedState ? (previousHoistableRoot = suspenseyCommitFlag, suspenseyCommitFlag = 16777216, recursivelyAccumulateSuspenseyCommit(
              fiber,
              committedLanes,
              suspendedState
            ), suspenseyCommitFlag = previousHoistableRoot) : recursivelyAccumulateSuspenseyCommit(
              fiber,
              committedLanes,
              suspendedState
            ));
            break;
          default:
            recursivelyAccumulateSuspenseyCommit(
              fiber,
              committedLanes,
              suspendedState
            );
        }
      }
      function detachAlternateSiblings(parentFiber) {
        var previousFiber = parentFiber.alternate;
        if (null !== previousFiber && (parentFiber = previousFiber.child, null !== parentFiber)) {
          previousFiber.child = null;
          do
            previousFiber = parentFiber.sibling, parentFiber.sibling = null, parentFiber = previousFiber;
          while (null !== parentFiber);
        }
      }
      function recursivelyTraversePassiveUnmountEffects(parentFiber) {
        var deletions = parentFiber.deletions;
        if (0 !== (parentFiber.flags & 16)) {
          if (null !== deletions)
            for (var i2 = 0; i2 < deletions.length; i2++) {
              var childToDelete = deletions[i2];
              nextEffect = childToDelete;
              commitPassiveUnmountEffectsInsideOfDeletedTree_begin(
                childToDelete,
                parentFiber
              );
            }
          detachAlternateSiblings(parentFiber);
        }
        if (parentFiber.subtreeFlags & 10256)
          for (parentFiber = parentFiber.child; null !== parentFiber; )
            commitPassiveUnmountOnFiber(parentFiber), parentFiber = parentFiber.sibling;
      }
      function commitPassiveUnmountOnFiber(finishedWork) {
        switch (finishedWork.tag) {
          case 0:
          case 11:
          case 15:
            recursivelyTraversePassiveUnmountEffects(finishedWork);
            finishedWork.flags & 2048 && commitHookEffectListUnmount(9, finishedWork, finishedWork.return);
            break;
          case 3:
            recursivelyTraversePassiveUnmountEffects(finishedWork);
            break;
          case 12:
            recursivelyTraversePassiveUnmountEffects(finishedWork);
            break;
          case 22:
            var instance = finishedWork.stateNode;
            null !== finishedWork.memoizedState && instance._visibility & 2 && (null === finishedWork.return || 13 !== finishedWork.return.tag) ? (instance._visibility &= -3, recursivelyTraverseDisconnectPassiveEffects(finishedWork)) : recursivelyTraversePassiveUnmountEffects(finishedWork);
            break;
          default:
            recursivelyTraversePassiveUnmountEffects(finishedWork);
        }
      }
      function recursivelyTraverseDisconnectPassiveEffects(parentFiber) {
        var deletions = parentFiber.deletions;
        if (0 !== (parentFiber.flags & 16)) {
          if (null !== deletions)
            for (var i2 = 0; i2 < deletions.length; i2++) {
              var childToDelete = deletions[i2];
              nextEffect = childToDelete;
              commitPassiveUnmountEffectsInsideOfDeletedTree_begin(
                childToDelete,
                parentFiber
              );
            }
          detachAlternateSiblings(parentFiber);
        }
        for (parentFiber = parentFiber.child; null !== parentFiber; ) {
          deletions = parentFiber;
          switch (deletions.tag) {
            case 0:
            case 11:
            case 15:
              commitHookEffectListUnmount(8, deletions, deletions.return);
              recursivelyTraverseDisconnectPassiveEffects(deletions);
              break;
            case 22:
              i2 = deletions.stateNode;
              i2._visibility & 2 && (i2._visibility &= -3, recursivelyTraverseDisconnectPassiveEffects(deletions));
              break;
            default:
              recursivelyTraverseDisconnectPassiveEffects(deletions);
          }
          parentFiber = parentFiber.sibling;
        }
      }
      function commitPassiveUnmountEffectsInsideOfDeletedTree_begin(deletedSubtreeRoot, nearestMountedAncestor) {
        for (; null !== nextEffect; ) {
          var fiber = nextEffect;
          switch (fiber.tag) {
            case 0:
            case 11:
            case 15:
              commitHookEffectListUnmount(8, fiber, nearestMountedAncestor);
              break;
            case 23:
            case 22:
              if (null !== fiber.memoizedState && null !== fiber.memoizedState.cachePool) {
                var cache = fiber.memoizedState.cachePool.pool;
                null != cache && cache.refCount++;
              }
              break;
            case 24:
              releaseCache(fiber.memoizedState.cache);
          }
          cache = fiber.child;
          if (null !== cache) cache.return = fiber, nextEffect = cache;
          else
            a: for (fiber = deletedSubtreeRoot; null !== nextEffect; ) {
              cache = nextEffect;
              var sibling = cache.sibling, returnFiber = cache.return;
              detachFiberAfterEffects(cache);
              if (cache === fiber) {
                nextEffect = null;
                break a;
              }
              if (null !== sibling) {
                sibling.return = returnFiber;
                nextEffect = sibling;
                break a;
              }
              nextEffect = returnFiber;
            }
        }
      }
      var DefaultAsyncDispatcher = {
        getCacheForType: function(resourceType) {
          var cache = readContext(CacheContext), cacheForType = cache.data.get(resourceType);
          void 0 === cacheForType && (cacheForType = resourceType(), cache.data.set(resourceType, cacheForType));
          return cacheForType;
        },
        cacheSignal: function() {
          return readContext(CacheContext).controller.signal;
        }
      }, PossiblyWeakMap = "function" === typeof WeakMap ? WeakMap : Map, executionContext = 0, workInProgressRoot = null, workInProgress = null, workInProgressRootRenderLanes = 0, workInProgressSuspendedReason = 0, workInProgressThrownValue = null, workInProgressRootDidSkipSuspendedSiblings = false, workInProgressRootIsPrerendering = false, workInProgressRootDidAttachPingListener = false, entangledRenderLanes = 0, workInProgressRootExitStatus = 0, workInProgressRootSkippedLanes = 0, workInProgressRootInterleavedUpdatedLanes = 0, workInProgressRootPingedLanes = 0, workInProgressDeferredLane = 0, workInProgressSuspendedRetryLanes = 0, workInProgressRootConcurrentErrors = null, workInProgressRootRecoverableErrors = null, workInProgressRootDidIncludeRecursiveRenderUpdate = false, globalMostRecentFallbackTime = 0, globalMostRecentTransitionTime = 0, workInProgressRootRenderTargetTime = Infinity, workInProgressTransitions = null, legacyErrorBoundariesThatAlreadyFailed = null, pendingEffectsStatus = 0, pendingEffectsRoot = null, pendingFinishedWork = null, pendingEffectsLanes = 0, pendingEffectsRemainingLanes = 0, pendingPassiveTransitions = null, pendingRecoverableErrors = null, nestedUpdateCount = 0, rootWithNestedUpdates = null;
      function requestUpdateLane() {
        return 0 !== (executionContext & 2) && 0 !== workInProgressRootRenderLanes ? workInProgressRootRenderLanes & -workInProgressRootRenderLanes : null !== ReactSharedInternals.T ? requestTransitionLane() : resolveUpdatePriority();
      }
      function requestDeferredLane() {
        if (0 === workInProgressDeferredLane)
          if (0 === (workInProgressRootRenderLanes & 536870912) || isHydrating) {
            var lane = nextTransitionDeferredLane;
            nextTransitionDeferredLane <<= 1;
            0 === (nextTransitionDeferredLane & 3932160) && (nextTransitionDeferredLane = 262144);
            workInProgressDeferredLane = lane;
          } else workInProgressDeferredLane = 536870912;
        lane = suspenseHandlerStackCursor.current;
        null !== lane && (lane.flags |= 32);
        return workInProgressDeferredLane;
      }
      function scheduleUpdateOnFiber(root3, fiber, lane) {
        if (root3 === workInProgressRoot && (2 === workInProgressSuspendedReason || 9 === workInProgressSuspendedReason) || null !== root3.cancelPendingCommit)
          prepareFreshStack(root3, 0), markRootSuspended(
            root3,
            workInProgressRootRenderLanes,
            workInProgressDeferredLane,
            false
          );
        markRootUpdated$1(root3, lane);
        if (0 === (executionContext & 2) || root3 !== workInProgressRoot)
          root3 === workInProgressRoot && (0 === (executionContext & 2) && (workInProgressRootInterleavedUpdatedLanes |= lane), 4 === workInProgressRootExitStatus && markRootSuspended(
            root3,
            workInProgressRootRenderLanes,
            workInProgressDeferredLane,
            false
          )), ensureRootIsScheduled(root3);
      }
      function performWorkOnRoot(root$jscomp$0, lanes, forceSync) {
        if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(327));
        var shouldTimeSlice = !forceSync && 0 === (lanes & 127) && 0 === (lanes & root$jscomp$0.expiredLanes) || checkIfRootIsPrerendering(root$jscomp$0, lanes), exitStatus = shouldTimeSlice ? renderRootConcurrent(root$jscomp$0, lanes) : renderRootSync(root$jscomp$0, lanes, true), renderWasConcurrent = shouldTimeSlice;
        do {
          if (0 === exitStatus) {
            workInProgressRootIsPrerendering && !shouldTimeSlice && markRootSuspended(root$jscomp$0, lanes, 0, false);
            break;
          } else {
            forceSync = root$jscomp$0.current.alternate;
            if (renderWasConcurrent && !isRenderConsistentWithExternalStores(forceSync)) {
              exitStatus = renderRootSync(root$jscomp$0, lanes, false);
              renderWasConcurrent = false;
              continue;
            }
            if (2 === exitStatus) {
              renderWasConcurrent = lanes;
              if (root$jscomp$0.errorRecoveryDisabledLanes & renderWasConcurrent)
                var JSCompiler_inline_result = 0;
              else
                JSCompiler_inline_result = root$jscomp$0.pendingLanes & -536870913, JSCompiler_inline_result = 0 !== JSCompiler_inline_result ? JSCompiler_inline_result : JSCompiler_inline_result & 536870912 ? 536870912 : 0;
              if (0 !== JSCompiler_inline_result) {
                lanes = JSCompiler_inline_result;
                a: {
                  var root3 = root$jscomp$0;
                  exitStatus = workInProgressRootConcurrentErrors;
                  var wasRootDehydrated = root3.current.memoizedState.isDehydrated;
                  wasRootDehydrated && (prepareFreshStack(root3, JSCompiler_inline_result).flags |= 256);
                  JSCompiler_inline_result = renderRootSync(
                    root3,
                    JSCompiler_inline_result,
                    false
                  );
                  if (2 !== JSCompiler_inline_result) {
                    if (workInProgressRootDidAttachPingListener && !wasRootDehydrated) {
                      root3.errorRecoveryDisabledLanes |= renderWasConcurrent;
                      workInProgressRootInterleavedUpdatedLanes |= renderWasConcurrent;
                      exitStatus = 4;
                      break a;
                    }
                    renderWasConcurrent = workInProgressRootRecoverableErrors;
                    workInProgressRootRecoverableErrors = exitStatus;
                    null !== renderWasConcurrent && (null === workInProgressRootRecoverableErrors ? workInProgressRootRecoverableErrors = renderWasConcurrent : workInProgressRootRecoverableErrors.push.apply(
                      workInProgressRootRecoverableErrors,
                      renderWasConcurrent
                    ));
                  }
                  exitStatus = JSCompiler_inline_result;
                }
                renderWasConcurrent = false;
                if (2 !== exitStatus) continue;
              }
            }
            if (1 === exitStatus) {
              prepareFreshStack(root$jscomp$0, 0);
              markRootSuspended(root$jscomp$0, lanes, 0, true);
              break;
            }
            a: {
              shouldTimeSlice = root$jscomp$0;
              renderWasConcurrent = exitStatus;
              switch (renderWasConcurrent) {
                case 0:
                case 1:
                  throw Error(formatProdErrorMessage(345));
                case 4:
                  if ((lanes & 4194048) !== lanes) break;
                case 6:
                  markRootSuspended(
                    shouldTimeSlice,
                    lanes,
                    workInProgressDeferredLane,
                    !workInProgressRootDidSkipSuspendedSiblings
                  );
                  break a;
                case 2:
                  workInProgressRootRecoverableErrors = null;
                  break;
                case 3:
                case 5:
                  break;
                default:
                  throw Error(formatProdErrorMessage(329));
              }
              if ((lanes & 62914560) === lanes && (exitStatus = globalMostRecentFallbackTime + 300 - now(), 10 < exitStatus)) {
                markRootSuspended(
                  shouldTimeSlice,
                  lanes,
                  workInProgressDeferredLane,
                  !workInProgressRootDidSkipSuspendedSiblings
                );
                if (0 !== getNextLanes(shouldTimeSlice, 0, true)) break a;
                pendingEffectsLanes = lanes;
                shouldTimeSlice.timeoutHandle = scheduleTimeout(
                  commitRootWhenReady.bind(
                    null,
                    shouldTimeSlice,
                    forceSync,
                    workInProgressRootRecoverableErrors,
                    workInProgressTransitions,
                    workInProgressRootDidIncludeRecursiveRenderUpdate,
                    lanes,
                    workInProgressDeferredLane,
                    workInProgressRootInterleavedUpdatedLanes,
                    workInProgressSuspendedRetryLanes,
                    workInProgressRootDidSkipSuspendedSiblings,
                    renderWasConcurrent,
                    "Throttled",
                    -0,
                    0
                  ),
                  exitStatus
                );
                break a;
              }
              commitRootWhenReady(
                shouldTimeSlice,
                forceSync,
                workInProgressRootRecoverableErrors,
                workInProgressTransitions,
                workInProgressRootDidIncludeRecursiveRenderUpdate,
                lanes,
                workInProgressDeferredLane,
                workInProgressRootInterleavedUpdatedLanes,
                workInProgressSuspendedRetryLanes,
                workInProgressRootDidSkipSuspendedSiblings,
                renderWasConcurrent,
                null,
                -0,
                0
              );
            }
          }
          break;
        } while (1);
        ensureRootIsScheduled(root$jscomp$0);
      }
      function commitRootWhenReady(root3, finishedWork, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, lanes, spawnedLane, updatedLanes, suspendedRetryLanes, didSkipSuspendedSiblings, exitStatus, suspendedCommitReason, completedRenderStartTime, completedRenderEndTime) {
        root3.timeoutHandle = -1;
        suspendedCommitReason = finishedWork.subtreeFlags;
        if (suspendedCommitReason & 8192 || 16785408 === (suspendedCommitReason & 16785408)) {
          suspendedCommitReason = {
            stylesheets: null,
            count: 0,
            imgCount: 0,
            imgBytes: 0,
            suspenseyImages: [],
            waitingForImages: true,
            waitingForViewTransition: false,
            unsuspend: noop$1
          };
          accumulateSuspenseyCommitOnFiber(
            finishedWork,
            lanes,
            suspendedCommitReason
          );
          var timeoutOffset = (lanes & 62914560) === lanes ? globalMostRecentFallbackTime - now() : (lanes & 4194048) === lanes ? globalMostRecentTransitionTime - now() : 0;
          timeoutOffset = waitForCommitToBeReady(
            suspendedCommitReason,
            timeoutOffset
          );
          if (null !== timeoutOffset) {
            pendingEffectsLanes = lanes;
            root3.cancelPendingCommit = timeoutOffset(
              commitRoot.bind(
                null,
                root3,
                finishedWork,
                lanes,
                recoverableErrors,
                transitions,
                didIncludeRenderPhaseUpdate,
                spawnedLane,
                updatedLanes,
                suspendedRetryLanes,
                exitStatus,
                suspendedCommitReason,
                null,
                completedRenderStartTime,
                completedRenderEndTime
              )
            );
            markRootSuspended(root3, lanes, spawnedLane, !didSkipSuspendedSiblings);
            return;
          }
        }
        commitRoot(
          root3,
          finishedWork,
          lanes,
          recoverableErrors,
          transitions,
          didIncludeRenderPhaseUpdate,
          spawnedLane,
          updatedLanes,
          suspendedRetryLanes
        );
      }
      function isRenderConsistentWithExternalStores(finishedWork) {
        for (var node2 = finishedWork; ; ) {
          var tag = node2.tag;
          if ((0 === tag || 11 === tag || 15 === tag) && node2.flags & 16384 && (tag = node2.updateQueue, null !== tag && (tag = tag.stores, null !== tag)))
            for (var i2 = 0; i2 < tag.length; i2++) {
              var check2 = tag[i2], getSnapshot = check2.getSnapshot;
              check2 = check2.value;
              try {
                if (!objectIs(getSnapshot(), check2)) return false;
              } catch (error2) {
                return false;
              }
            }
          tag = node2.child;
          if (node2.subtreeFlags & 16384 && null !== tag)
            tag.return = node2, node2 = tag;
          else {
            if (node2 === finishedWork) break;
            for (; null === node2.sibling; ) {
              if (null === node2.return || node2.return === finishedWork) return true;
              node2 = node2.return;
            }
            node2.sibling.return = node2.return;
            node2 = node2.sibling;
          }
        }
        return true;
      }
      function markRootSuspended(root3, suspendedLanes, spawnedLane, didAttemptEntireTree) {
        suspendedLanes &= ~workInProgressRootPingedLanes;
        suspendedLanes &= ~workInProgressRootInterleavedUpdatedLanes;
        root3.suspendedLanes |= suspendedLanes;
        root3.pingedLanes &= ~suspendedLanes;
        didAttemptEntireTree && (root3.warmLanes |= suspendedLanes);
        didAttemptEntireTree = root3.expirationTimes;
        for (var lanes = suspendedLanes; 0 < lanes; ) {
          var index$6 = 31 - clz32(lanes), lane = 1 << index$6;
          didAttemptEntireTree[index$6] = -1;
          lanes &= ~lane;
        }
        0 !== spawnedLane && markSpawnedDeferredLane(root3, spawnedLane, suspendedLanes);
      }
      function flushSyncWork$1() {
        return 0 === (executionContext & 6) ? (flushSyncWorkAcrossRoots_impl(0), false) : true;
      }
      function resetWorkInProgressStack() {
        if (null !== workInProgress) {
          if (0 === workInProgressSuspendedReason)
            var interruptedWork = workInProgress.return;
          else
            interruptedWork = workInProgress, lastContextDependency = currentlyRenderingFiber$1 = null, resetHooksOnUnwind(interruptedWork), thenableState$1 = null, thenableIndexCounter$1 = 0, interruptedWork = workInProgress;
          for (; null !== interruptedWork; )
            unwindInterruptedWork(interruptedWork.alternate, interruptedWork), interruptedWork = interruptedWork.return;
          workInProgress = null;
        }
      }
      function prepareFreshStack(root3, lanes) {
        var timeoutHandle = root3.timeoutHandle;
        -1 !== timeoutHandle && (root3.timeoutHandle = -1, cancelTimeout(timeoutHandle));
        timeoutHandle = root3.cancelPendingCommit;
        null !== timeoutHandle && (root3.cancelPendingCommit = null, timeoutHandle());
        pendingEffectsLanes = 0;
        resetWorkInProgressStack();
        workInProgressRoot = root3;
        workInProgress = timeoutHandle = createWorkInProgress(root3.current, null);
        workInProgressRootRenderLanes = lanes;
        workInProgressSuspendedReason = 0;
        workInProgressThrownValue = null;
        workInProgressRootDidSkipSuspendedSiblings = false;
        workInProgressRootIsPrerendering = checkIfRootIsPrerendering(root3, lanes);
        workInProgressRootDidAttachPingListener = false;
        workInProgressSuspendedRetryLanes = workInProgressDeferredLane = workInProgressRootPingedLanes = workInProgressRootInterleavedUpdatedLanes = workInProgressRootSkippedLanes = workInProgressRootExitStatus = 0;
        workInProgressRootRecoverableErrors = workInProgressRootConcurrentErrors = null;
        workInProgressRootDidIncludeRecursiveRenderUpdate = false;
        0 !== (lanes & 8) && (lanes |= lanes & 32);
        var allEntangledLanes = root3.entangledLanes;
        if (0 !== allEntangledLanes)
          for (root3 = root3.entanglements, allEntangledLanes &= lanes; 0 < allEntangledLanes; ) {
            var index$4 = 31 - clz32(allEntangledLanes), lane = 1 << index$4;
            lanes |= root3[index$4];
            allEntangledLanes &= ~lane;
          }
        entangledRenderLanes = lanes;
        finishQueueingConcurrentUpdates();
        return timeoutHandle;
      }
      function handleThrow(root3, thrownValue) {
        currentlyRenderingFiber = null;
        ReactSharedInternals.H = ContextOnlyDispatcher;
        thrownValue === SuspenseException || thrownValue === SuspenseActionException ? (thrownValue = getSuspendedThenable(), workInProgressSuspendedReason = 3) : thrownValue === SuspenseyCommitException ? (thrownValue = getSuspendedThenable(), workInProgressSuspendedReason = 4) : workInProgressSuspendedReason = thrownValue === SelectiveHydrationException ? 8 : null !== thrownValue && "object" === typeof thrownValue && "function" === typeof thrownValue.then ? 6 : 1;
        workInProgressThrownValue = thrownValue;
        null === workInProgress && (workInProgressRootExitStatus = 1, logUncaughtError(
          root3,
          createCapturedValueAtFiber(thrownValue, root3.current)
        ));
      }
      function shouldRemainOnPreviousScreen() {
        var handler = suspenseHandlerStackCursor.current;
        return null === handler ? true : (workInProgressRootRenderLanes & 4194048) === workInProgressRootRenderLanes ? null === shellBoundary ? true : false : (workInProgressRootRenderLanes & 62914560) === workInProgressRootRenderLanes || 0 !== (workInProgressRootRenderLanes & 536870912) ? handler === shellBoundary : false;
      }
      function pushDispatcher() {
        var prevDispatcher = ReactSharedInternals.H;
        ReactSharedInternals.H = ContextOnlyDispatcher;
        return null === prevDispatcher ? ContextOnlyDispatcher : prevDispatcher;
      }
      function pushAsyncDispatcher() {
        var prevAsyncDispatcher = ReactSharedInternals.A;
        ReactSharedInternals.A = DefaultAsyncDispatcher;
        return prevAsyncDispatcher;
      }
      function renderDidSuspendDelayIfPossible() {
        workInProgressRootExitStatus = 4;
        workInProgressRootDidSkipSuspendedSiblings || (workInProgressRootRenderLanes & 4194048) !== workInProgressRootRenderLanes && null !== suspenseHandlerStackCursor.current || (workInProgressRootIsPrerendering = true);
        0 === (workInProgressRootSkippedLanes & 134217727) && 0 === (workInProgressRootInterleavedUpdatedLanes & 134217727) || null === workInProgressRoot || markRootSuspended(
          workInProgressRoot,
          workInProgressRootRenderLanes,
          workInProgressDeferredLane,
          false
        );
      }
      function renderRootSync(root3, lanes, shouldYieldForPrerendering) {
        var prevExecutionContext = executionContext;
        executionContext |= 2;
        var prevDispatcher = pushDispatcher(), prevAsyncDispatcher = pushAsyncDispatcher();
        if (workInProgressRoot !== root3 || workInProgressRootRenderLanes !== lanes)
          workInProgressTransitions = null, prepareFreshStack(root3, lanes);
        lanes = false;
        var exitStatus = workInProgressRootExitStatus;
        a: do
          try {
            if (0 !== workInProgressSuspendedReason && null !== workInProgress) {
              var unitOfWork = workInProgress, thrownValue = workInProgressThrownValue;
              switch (workInProgressSuspendedReason) {
                case 8:
                  resetWorkInProgressStack();
                  exitStatus = 6;
                  break a;
                case 3:
                case 2:
                case 9:
                case 6:
                  null === suspenseHandlerStackCursor.current && (lanes = true);
                  var reason = workInProgressSuspendedReason;
                  workInProgressSuspendedReason = 0;
                  workInProgressThrownValue = null;
                  throwAndUnwindWorkLoop(root3, unitOfWork, thrownValue, reason);
                  if (shouldYieldForPrerendering && workInProgressRootIsPrerendering) {
                    exitStatus = 0;
                    break a;
                  }
                  break;
                default:
                  reason = workInProgressSuspendedReason, workInProgressSuspendedReason = 0, workInProgressThrownValue = null, throwAndUnwindWorkLoop(root3, unitOfWork, thrownValue, reason);
              }
            }
            workLoopSync();
            exitStatus = workInProgressRootExitStatus;
            break;
          } catch (thrownValue$165) {
            handleThrow(root3, thrownValue$165);
          }
        while (1);
        lanes && root3.shellSuspendCounter++;
        lastContextDependency = currentlyRenderingFiber$1 = null;
        executionContext = prevExecutionContext;
        ReactSharedInternals.H = prevDispatcher;
        ReactSharedInternals.A = prevAsyncDispatcher;
        null === workInProgress && (workInProgressRoot = null, workInProgressRootRenderLanes = 0, finishQueueingConcurrentUpdates());
        return exitStatus;
      }
      function workLoopSync() {
        for (; null !== workInProgress; ) performUnitOfWork(workInProgress);
      }
      function renderRootConcurrent(root3, lanes) {
        var prevExecutionContext = executionContext;
        executionContext |= 2;
        var prevDispatcher = pushDispatcher(), prevAsyncDispatcher = pushAsyncDispatcher();
        workInProgressRoot !== root3 || workInProgressRootRenderLanes !== lanes ? (workInProgressTransitions = null, workInProgressRootRenderTargetTime = now() + 500, prepareFreshStack(root3, lanes)) : workInProgressRootIsPrerendering = checkIfRootIsPrerendering(
          root3,
          lanes
        );
        a: do
          try {
            if (0 !== workInProgressSuspendedReason && null !== workInProgress) {
              lanes = workInProgress;
              var thrownValue = workInProgressThrownValue;
              b: switch (workInProgressSuspendedReason) {
                case 1:
                  workInProgressSuspendedReason = 0;
                  workInProgressThrownValue = null;
                  throwAndUnwindWorkLoop(root3, lanes, thrownValue, 1);
                  break;
                case 2:
                case 9:
                  if (isThenableResolved(thrownValue)) {
                    workInProgressSuspendedReason = 0;
                    workInProgressThrownValue = null;
                    replaySuspendedUnitOfWork(lanes);
                    break;
                  }
                  lanes = function() {
                    2 !== workInProgressSuspendedReason && 9 !== workInProgressSuspendedReason || workInProgressRoot !== root3 || (workInProgressSuspendedReason = 7);
                    ensureRootIsScheduled(root3);
                  };
                  thrownValue.then(lanes, lanes);
                  break a;
                case 3:
                  workInProgressSuspendedReason = 7;
                  break a;
                case 4:
                  workInProgressSuspendedReason = 5;
                  break a;
                case 7:
                  isThenableResolved(thrownValue) ? (workInProgressSuspendedReason = 0, workInProgressThrownValue = null, replaySuspendedUnitOfWork(lanes)) : (workInProgressSuspendedReason = 0, workInProgressThrownValue = null, throwAndUnwindWorkLoop(root3, lanes, thrownValue, 7));
                  break;
                case 5:
                  var resource = null;
                  switch (workInProgress.tag) {
                    case 26:
                      resource = workInProgress.memoizedState;
                    case 5:
                    case 27:
                      var hostFiber = workInProgress;
                      if (resource ? preloadResource(resource) : hostFiber.stateNode.complete) {
                        workInProgressSuspendedReason = 0;
                        workInProgressThrownValue = null;
                        var sibling = hostFiber.sibling;
                        if (null !== sibling) workInProgress = sibling;
                        else {
                          var returnFiber = hostFiber.return;
                          null !== returnFiber ? (workInProgress = returnFiber, completeUnitOfWork(returnFiber)) : workInProgress = null;
                        }
                        break b;
                      }
                  }
                  workInProgressSuspendedReason = 0;
                  workInProgressThrownValue = null;
                  throwAndUnwindWorkLoop(root3, lanes, thrownValue, 5);
                  break;
                case 6:
                  workInProgressSuspendedReason = 0;
                  workInProgressThrownValue = null;
                  throwAndUnwindWorkLoop(root3, lanes, thrownValue, 6);
                  break;
                case 8:
                  resetWorkInProgressStack();
                  workInProgressRootExitStatus = 6;
                  break a;
                default:
                  throw Error(formatProdErrorMessage(462));
              }
            }
            workLoopConcurrentByScheduler();
            break;
          } catch (thrownValue$167) {
            handleThrow(root3, thrownValue$167);
          }
        while (1);
        lastContextDependency = currentlyRenderingFiber$1 = null;
        ReactSharedInternals.H = prevDispatcher;
        ReactSharedInternals.A = prevAsyncDispatcher;
        executionContext = prevExecutionContext;
        if (null !== workInProgress) return 0;
        workInProgressRoot = null;
        workInProgressRootRenderLanes = 0;
        finishQueueingConcurrentUpdates();
        return workInProgressRootExitStatus;
      }
      function workLoopConcurrentByScheduler() {
        for (; null !== workInProgress && !shouldYield(); )
          performUnitOfWork(workInProgress);
      }
      function performUnitOfWork(unitOfWork) {
        var next = beginWork(unitOfWork.alternate, unitOfWork, entangledRenderLanes);
        unitOfWork.memoizedProps = unitOfWork.pendingProps;
        null === next ? completeUnitOfWork(unitOfWork) : workInProgress = next;
      }
      function replaySuspendedUnitOfWork(unitOfWork) {
        var next = unitOfWork;
        var current2 = next.alternate;
        switch (next.tag) {
          case 15:
          case 0:
            next = replayFunctionComponent(
              current2,
              next,
              next.pendingProps,
              next.type,
              void 0,
              workInProgressRootRenderLanes
            );
            break;
          case 11:
            next = replayFunctionComponent(
              current2,
              next,
              next.pendingProps,
              next.type.render,
              next.ref,
              workInProgressRootRenderLanes
            );
            break;
          case 5:
            resetHooksOnUnwind(next);
          default:
            unwindInterruptedWork(current2, next), next = workInProgress = resetWorkInProgress(next, entangledRenderLanes), next = beginWork(current2, next, entangledRenderLanes);
        }
        unitOfWork.memoizedProps = unitOfWork.pendingProps;
        null === next ? completeUnitOfWork(unitOfWork) : workInProgress = next;
      }
      function throwAndUnwindWorkLoop(root3, unitOfWork, thrownValue, suspendedReason) {
        lastContextDependency = currentlyRenderingFiber$1 = null;
        resetHooksOnUnwind(unitOfWork);
        thenableState$1 = null;
        thenableIndexCounter$1 = 0;
        var returnFiber = unitOfWork.return;
        try {
          if (throwException(
            root3,
            returnFiber,
            unitOfWork,
            thrownValue,
            workInProgressRootRenderLanes
          )) {
            workInProgressRootExitStatus = 1;
            logUncaughtError(
              root3,
              createCapturedValueAtFiber(thrownValue, root3.current)
            );
            workInProgress = null;
            return;
          }
        } catch (error2) {
          if (null !== returnFiber) throw workInProgress = returnFiber, error2;
          workInProgressRootExitStatus = 1;
          logUncaughtError(
            root3,
            createCapturedValueAtFiber(thrownValue, root3.current)
          );
          workInProgress = null;
          return;
        }
        if (unitOfWork.flags & 32768) {
          if (isHydrating || 1 === suspendedReason) root3 = true;
          else if (workInProgressRootIsPrerendering || 0 !== (workInProgressRootRenderLanes & 536870912))
            root3 = false;
          else if (workInProgressRootDidSkipSuspendedSiblings = root3 = true, 2 === suspendedReason || 9 === suspendedReason || 3 === suspendedReason || 6 === suspendedReason)
            suspendedReason = suspenseHandlerStackCursor.current, null !== suspendedReason && 13 === suspendedReason.tag && (suspendedReason.flags |= 16384);
          unwindUnitOfWork(unitOfWork, root3);
        } else completeUnitOfWork(unitOfWork);
      }
      function completeUnitOfWork(unitOfWork) {
        var completedWork = unitOfWork;
        do {
          if (0 !== (completedWork.flags & 32768)) {
            unwindUnitOfWork(
              completedWork,
              workInProgressRootDidSkipSuspendedSiblings
            );
            return;
          }
          unitOfWork = completedWork.return;
          var next = completeWork(
            completedWork.alternate,
            completedWork,
            entangledRenderLanes
          );
          if (null !== next) {
            workInProgress = next;
            return;
          }
          completedWork = completedWork.sibling;
          if (null !== completedWork) {
            workInProgress = completedWork;
            return;
          }
          workInProgress = completedWork = unitOfWork;
        } while (null !== completedWork);
        0 === workInProgressRootExitStatus && (workInProgressRootExitStatus = 5);
      }
      function unwindUnitOfWork(unitOfWork, skipSiblings) {
        do {
          var next = unwindWork(unitOfWork.alternate, unitOfWork);
          if (null !== next) {
            next.flags &= 32767;
            workInProgress = next;
            return;
          }
          next = unitOfWork.return;
          null !== next && (next.flags |= 32768, next.subtreeFlags = 0, next.deletions = null);
          if (!skipSiblings && (unitOfWork = unitOfWork.sibling, null !== unitOfWork)) {
            workInProgress = unitOfWork;
            return;
          }
          workInProgress = unitOfWork = next;
        } while (null !== unitOfWork);
        workInProgressRootExitStatus = 6;
        workInProgress = null;
      }
      function commitRoot(root3, finishedWork, lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, suspendedRetryLanes) {
        root3.cancelPendingCommit = null;
        do
          flushPendingEffects();
        while (0 !== pendingEffectsStatus);
        if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(327));
        if (null !== finishedWork) {
          if (finishedWork === root3.current) throw Error(formatProdErrorMessage(177));
          didIncludeRenderPhaseUpdate = finishedWork.lanes | finishedWork.childLanes;
          didIncludeRenderPhaseUpdate |= concurrentlyUpdatedLanes;
          markRootFinished(
            root3,
            lanes,
            didIncludeRenderPhaseUpdate,
            spawnedLane,
            updatedLanes,
            suspendedRetryLanes
          );
          root3 === workInProgressRoot && (workInProgress = workInProgressRoot = null, workInProgressRootRenderLanes = 0);
          pendingFinishedWork = finishedWork;
          pendingEffectsRoot = root3;
          pendingEffectsLanes = lanes;
          pendingEffectsRemainingLanes = didIncludeRenderPhaseUpdate;
          pendingPassiveTransitions = transitions;
          pendingRecoverableErrors = recoverableErrors;
          0 !== (finishedWork.subtreeFlags & 10256) || 0 !== (finishedWork.flags & 10256) ? (root3.callbackNode = null, root3.callbackPriority = 0, scheduleCallback$1(NormalPriority$1, function() {
            flushPassiveEffects();
            return null;
          })) : (root3.callbackNode = null, root3.callbackPriority = 0);
          recoverableErrors = 0 !== (finishedWork.flags & 13878);
          if (0 !== (finishedWork.subtreeFlags & 13878) || recoverableErrors) {
            recoverableErrors = ReactSharedInternals.T;
            ReactSharedInternals.T = null;
            transitions = ReactDOMSharedInternals.p;
            ReactDOMSharedInternals.p = 2;
            spawnedLane = executionContext;
            executionContext |= 4;
            try {
              commitBeforeMutationEffects(root3, finishedWork, lanes);
            } finally {
              executionContext = spawnedLane, ReactDOMSharedInternals.p = transitions, ReactSharedInternals.T = recoverableErrors;
            }
          }
          pendingEffectsStatus = 1;
          flushMutationEffects();
          flushLayoutEffects();
          flushSpawnedWork();
        }
      }
      function flushMutationEffects() {
        if (1 === pendingEffectsStatus) {
          pendingEffectsStatus = 0;
          var root3 = pendingEffectsRoot, finishedWork = pendingFinishedWork, rootMutationHasEffect = 0 !== (finishedWork.flags & 13878);
          if (0 !== (finishedWork.subtreeFlags & 13878) || rootMutationHasEffect) {
            rootMutationHasEffect = ReactSharedInternals.T;
            ReactSharedInternals.T = null;
            var previousPriority = ReactDOMSharedInternals.p;
            ReactDOMSharedInternals.p = 2;
            var prevExecutionContext = executionContext;
            executionContext |= 4;
            try {
              commitMutationEffectsOnFiber(finishedWork, root3);
              var priorSelectionInformation = selectionInformation, curFocusedElem = getActiveElementDeep(root3.containerInfo), priorFocusedElem = priorSelectionInformation.focusedElem, priorSelectionRange = priorSelectionInformation.selectionRange;
              if (curFocusedElem !== priorFocusedElem && priorFocusedElem && priorFocusedElem.ownerDocument && containsNode(
                priorFocusedElem.ownerDocument.documentElement,
                priorFocusedElem
              )) {
                if (null !== priorSelectionRange && hasSelectionCapabilities(priorFocusedElem)) {
                  var start2 = priorSelectionRange.start, end2 = priorSelectionRange.end;
                  void 0 === end2 && (end2 = start2);
                  if ("selectionStart" in priorFocusedElem)
                    priorFocusedElem.selectionStart = start2, priorFocusedElem.selectionEnd = Math.min(
                      end2,
                      priorFocusedElem.value.length
                    );
                  else {
                    var doc2 = priorFocusedElem.ownerDocument || document, win = doc2 && doc2.defaultView || window;
                    if (win.getSelection) {
                      var selection = win.getSelection(), length = priorFocusedElem.textContent.length, start$jscomp$0 = Math.min(priorSelectionRange.start, length), end$jscomp$0 = void 0 === priorSelectionRange.end ? start$jscomp$0 : Math.min(priorSelectionRange.end, length);
                      !selection.extend && start$jscomp$0 > end$jscomp$0 && (curFocusedElem = end$jscomp$0, end$jscomp$0 = start$jscomp$0, start$jscomp$0 = curFocusedElem);
                      var startMarker = getNodeForCharacterOffset(
                        priorFocusedElem,
                        start$jscomp$0
                      ), endMarker = getNodeForCharacterOffset(
                        priorFocusedElem,
                        end$jscomp$0
                      );
                      if (startMarker && endMarker && (1 !== selection.rangeCount || selection.anchorNode !== startMarker.node || selection.anchorOffset !== startMarker.offset || selection.focusNode !== endMarker.node || selection.focusOffset !== endMarker.offset)) {
                        var range2 = doc2.createRange();
                        range2.setStart(startMarker.node, startMarker.offset);
                        selection.removeAllRanges();
                        start$jscomp$0 > end$jscomp$0 ? (selection.addRange(range2), selection.extend(endMarker.node, endMarker.offset)) : (range2.setEnd(endMarker.node, endMarker.offset), selection.addRange(range2));
                      }
                    }
                  }
                }
                doc2 = [];
                for (selection = priorFocusedElem; selection = selection.parentNode; )
                  1 === selection.nodeType && doc2.push({
                    element: selection,
                    left: selection.scrollLeft,
                    top: selection.scrollTop
                  });
                "function" === typeof priorFocusedElem.focus && priorFocusedElem.focus();
                for (priorFocusedElem = 0; priorFocusedElem < doc2.length; priorFocusedElem++) {
                  var info = doc2[priorFocusedElem];
                  info.element.scrollLeft = info.left;
                  info.element.scrollTop = info.top;
                }
              }
              _enabled = !!eventsEnabled;
              selectionInformation = eventsEnabled = null;
            } finally {
              executionContext = prevExecutionContext, ReactDOMSharedInternals.p = previousPriority, ReactSharedInternals.T = rootMutationHasEffect;
            }
          }
          root3.current = finishedWork;
          pendingEffectsStatus = 2;
        }
      }
      function flushLayoutEffects() {
        if (2 === pendingEffectsStatus) {
          pendingEffectsStatus = 0;
          var root3 = pendingEffectsRoot, finishedWork = pendingFinishedWork, rootHasLayoutEffect = 0 !== (finishedWork.flags & 8772);
          if (0 !== (finishedWork.subtreeFlags & 8772) || rootHasLayoutEffect) {
            rootHasLayoutEffect = ReactSharedInternals.T;
            ReactSharedInternals.T = null;
            var previousPriority = ReactDOMSharedInternals.p;
            ReactDOMSharedInternals.p = 2;
            var prevExecutionContext = executionContext;
            executionContext |= 4;
            try {
              commitLayoutEffectOnFiber(root3, finishedWork.alternate, finishedWork);
            } finally {
              executionContext = prevExecutionContext, ReactDOMSharedInternals.p = previousPriority, ReactSharedInternals.T = rootHasLayoutEffect;
            }
          }
          pendingEffectsStatus = 3;
        }
      }
      function flushSpawnedWork() {
        if (4 === pendingEffectsStatus || 3 === pendingEffectsStatus) {
          pendingEffectsStatus = 0;
          requestPaint();
          var root3 = pendingEffectsRoot, finishedWork = pendingFinishedWork, lanes = pendingEffectsLanes, recoverableErrors = pendingRecoverableErrors;
          0 !== (finishedWork.subtreeFlags & 10256) || 0 !== (finishedWork.flags & 10256) ? pendingEffectsStatus = 5 : (pendingEffectsStatus = 0, pendingFinishedWork = pendingEffectsRoot = null, releaseRootPooledCache(root3, root3.pendingLanes));
          var remainingLanes = root3.pendingLanes;
          0 === remainingLanes && (legacyErrorBoundariesThatAlreadyFailed = null);
          lanesToEventPriority(lanes);
          finishedWork = finishedWork.stateNode;
          if (injectedHook && "function" === typeof injectedHook.onCommitFiberRoot)
            try {
              injectedHook.onCommitFiberRoot(
                rendererID,
                finishedWork,
                void 0,
                128 === (finishedWork.current.flags & 128)
              );
            } catch (err2) {
            }
          if (null !== recoverableErrors) {
            finishedWork = ReactSharedInternals.T;
            remainingLanes = ReactDOMSharedInternals.p;
            ReactDOMSharedInternals.p = 2;
            ReactSharedInternals.T = null;
            try {
              for (var onRecoverableError = root3.onRecoverableError, i2 = 0; i2 < recoverableErrors.length; i2++) {
                var recoverableError = recoverableErrors[i2];
                onRecoverableError(recoverableError.value, {
                  componentStack: recoverableError.stack
                });
              }
            } finally {
              ReactSharedInternals.T = finishedWork, ReactDOMSharedInternals.p = remainingLanes;
            }
          }
          0 !== (pendingEffectsLanes & 3) && flushPendingEffects();
          ensureRootIsScheduled(root3);
          remainingLanes = root3.pendingLanes;
          0 !== (lanes & 261930) && 0 !== (remainingLanes & 42) ? root3 === rootWithNestedUpdates ? nestedUpdateCount++ : (nestedUpdateCount = 0, rootWithNestedUpdates = root3) : nestedUpdateCount = 0;
          flushSyncWorkAcrossRoots_impl(0);
        }
      }
      function releaseRootPooledCache(root3, remainingLanes) {
        0 === (root3.pooledCacheLanes &= remainingLanes) && (remainingLanes = root3.pooledCache, null != remainingLanes && (root3.pooledCache = null, releaseCache(remainingLanes)));
      }
      function flushPendingEffects() {
        flushMutationEffects();
        flushLayoutEffects();
        flushSpawnedWork();
        return flushPassiveEffects();
      }
      function flushPassiveEffects() {
        if (5 !== pendingEffectsStatus) return false;
        var root3 = pendingEffectsRoot, remainingLanes = pendingEffectsRemainingLanes;
        pendingEffectsRemainingLanes = 0;
        var renderPriority = lanesToEventPriority(pendingEffectsLanes), prevTransition = ReactSharedInternals.T, previousPriority = ReactDOMSharedInternals.p;
        try {
          ReactDOMSharedInternals.p = 32 > renderPriority ? 32 : renderPriority;
          ReactSharedInternals.T = null;
          renderPriority = pendingPassiveTransitions;
          pendingPassiveTransitions = null;
          var root$jscomp$0 = pendingEffectsRoot, lanes = pendingEffectsLanes;
          pendingEffectsStatus = 0;
          pendingFinishedWork = pendingEffectsRoot = null;
          pendingEffectsLanes = 0;
          if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(331));
          var prevExecutionContext = executionContext;
          executionContext |= 4;
          commitPassiveUnmountOnFiber(root$jscomp$0.current);
          commitPassiveMountOnFiber(
            root$jscomp$0,
            root$jscomp$0.current,
            lanes,
            renderPriority
          );
          executionContext = prevExecutionContext;
          flushSyncWorkAcrossRoots_impl(0, false);
          if (injectedHook && "function" === typeof injectedHook.onPostCommitFiberRoot)
            try {
              injectedHook.onPostCommitFiberRoot(rendererID, root$jscomp$0);
            } catch (err2) {
            }
          return true;
        } finally {
          ReactDOMSharedInternals.p = previousPriority, ReactSharedInternals.T = prevTransition, releaseRootPooledCache(root3, remainingLanes);
        }
      }
      function captureCommitPhaseErrorOnRoot(rootFiber, sourceFiber, error2) {
        sourceFiber = createCapturedValueAtFiber(error2, sourceFiber);
        sourceFiber = createRootErrorUpdate(rootFiber.stateNode, sourceFiber, 2);
        rootFiber = enqueueUpdate(rootFiber, sourceFiber, 2);
        null !== rootFiber && (markRootUpdated$1(rootFiber, 2), ensureRootIsScheduled(rootFiber));
      }
      function captureCommitPhaseError(sourceFiber, nearestMountedAncestor, error2) {
        if (3 === sourceFiber.tag)
          captureCommitPhaseErrorOnRoot(sourceFiber, sourceFiber, error2);
        else
          for (; null !== nearestMountedAncestor; ) {
            if (3 === nearestMountedAncestor.tag) {
              captureCommitPhaseErrorOnRoot(
                nearestMountedAncestor,
                sourceFiber,
                error2
              );
              break;
            } else if (1 === nearestMountedAncestor.tag) {
              var instance = nearestMountedAncestor.stateNode;
              if ("function" === typeof nearestMountedAncestor.type.getDerivedStateFromError || "function" === typeof instance.componentDidCatch && (null === legacyErrorBoundariesThatAlreadyFailed || !legacyErrorBoundariesThatAlreadyFailed.has(instance))) {
                sourceFiber = createCapturedValueAtFiber(error2, sourceFiber);
                error2 = createClassErrorUpdate(2);
                instance = enqueueUpdate(nearestMountedAncestor, error2, 2);
                null !== instance && (initializeClassErrorUpdate(
                  error2,
                  instance,
                  nearestMountedAncestor,
                  sourceFiber
                ), markRootUpdated$1(instance, 2), ensureRootIsScheduled(instance));
                break;
              }
            }
            nearestMountedAncestor = nearestMountedAncestor.return;
          }
      }
      function attachPingListener(root3, wakeable, lanes) {
        var pingCache = root3.pingCache;
        if (null === pingCache) {
          pingCache = root3.pingCache = new PossiblyWeakMap();
          var threadIDs = /* @__PURE__ */ new Set();
          pingCache.set(wakeable, threadIDs);
        } else
          threadIDs = pingCache.get(wakeable), void 0 === threadIDs && (threadIDs = /* @__PURE__ */ new Set(), pingCache.set(wakeable, threadIDs));
        threadIDs.has(lanes) || (workInProgressRootDidAttachPingListener = true, threadIDs.add(lanes), root3 = pingSuspendedRoot.bind(null, root3, wakeable, lanes), wakeable.then(root3, root3));
      }
      function pingSuspendedRoot(root3, wakeable, pingedLanes) {
        var pingCache = root3.pingCache;
        null !== pingCache && pingCache.delete(wakeable);
        root3.pingedLanes |= root3.suspendedLanes & pingedLanes;
        root3.warmLanes &= ~pingedLanes;
        workInProgressRoot === root3 && (workInProgressRootRenderLanes & pingedLanes) === pingedLanes && (4 === workInProgressRootExitStatus || 3 === workInProgressRootExitStatus && (workInProgressRootRenderLanes & 62914560) === workInProgressRootRenderLanes && 300 > now() - globalMostRecentFallbackTime ? 0 === (executionContext & 2) && prepareFreshStack(root3, 0) : workInProgressRootPingedLanes |= pingedLanes, workInProgressSuspendedRetryLanes === workInProgressRootRenderLanes && (workInProgressSuspendedRetryLanes = 0));
        ensureRootIsScheduled(root3);
      }
      function retryTimedOutBoundary(boundaryFiber, retryLane) {
        0 === retryLane && (retryLane = claimNextRetryLane());
        boundaryFiber = enqueueConcurrentRenderForLane(boundaryFiber, retryLane);
        null !== boundaryFiber && (markRootUpdated$1(boundaryFiber, retryLane), ensureRootIsScheduled(boundaryFiber));
      }
      function retryDehydratedSuspenseBoundary(boundaryFiber) {
        var suspenseState = boundaryFiber.memoizedState, retryLane = 0;
        null !== suspenseState && (retryLane = suspenseState.retryLane);
        retryTimedOutBoundary(boundaryFiber, retryLane);
      }
      function resolveRetryWakeable(boundaryFiber, wakeable) {
        var retryLane = 0;
        switch (boundaryFiber.tag) {
          case 31:
          case 13:
            var retryCache = boundaryFiber.stateNode;
            var suspenseState = boundaryFiber.memoizedState;
            null !== suspenseState && (retryLane = suspenseState.retryLane);
            break;
          case 19:
            retryCache = boundaryFiber.stateNode;
            break;
          case 22:
            retryCache = boundaryFiber.stateNode._retryCache;
            break;
          default:
            throw Error(formatProdErrorMessage(314));
        }
        null !== retryCache && retryCache.delete(wakeable);
        retryTimedOutBoundary(boundaryFiber, retryLane);
      }
      function scheduleCallback$1(priorityLevel, callback) {
        return scheduleCallback$3(priorityLevel, callback);
      }
      var firstScheduledRoot = null, lastScheduledRoot = null, didScheduleMicrotask = false, mightHavePendingSyncWork = false, isFlushingWork = false, currentEventTransitionLane = 0;
      function ensureRootIsScheduled(root3) {
        root3 !== lastScheduledRoot && null === root3.next && (null === lastScheduledRoot ? firstScheduledRoot = lastScheduledRoot = root3 : lastScheduledRoot = lastScheduledRoot.next = root3);
        mightHavePendingSyncWork = true;
        didScheduleMicrotask || (didScheduleMicrotask = true, scheduleImmediateRootScheduleTask());
      }
      function flushSyncWorkAcrossRoots_impl(syncTransitionLanes, onlyLegacy) {
        if (!isFlushingWork && mightHavePendingSyncWork) {
          isFlushingWork = true;
          do {
            var didPerformSomeWork = false;
            for (var root$170 = firstScheduledRoot; null !== root$170; ) {
              if (0 !== syncTransitionLanes) {
                var pendingLanes = root$170.pendingLanes;
                if (0 === pendingLanes) var JSCompiler_inline_result = 0;
                else {
                  var suspendedLanes = root$170.suspendedLanes, pingedLanes = root$170.pingedLanes;
                  JSCompiler_inline_result = (1 << 31 - clz32(42 | syncTransitionLanes) + 1) - 1;
                  JSCompiler_inline_result &= pendingLanes & ~(suspendedLanes & ~pingedLanes);
                  JSCompiler_inline_result = JSCompiler_inline_result & 201326741 ? JSCompiler_inline_result & 201326741 | 1 : JSCompiler_inline_result ? JSCompiler_inline_result | 2 : 0;
                }
                0 !== JSCompiler_inline_result && (didPerformSomeWork = true, performSyncWorkOnRoot(root$170, JSCompiler_inline_result));
              } else
                JSCompiler_inline_result = workInProgressRootRenderLanes, JSCompiler_inline_result = getNextLanes(
                  root$170,
                  root$170 === workInProgressRoot ? JSCompiler_inline_result : 0,
                  null !== root$170.cancelPendingCommit || -1 !== root$170.timeoutHandle
                ), 0 === (JSCompiler_inline_result & 3) || checkIfRootIsPrerendering(root$170, JSCompiler_inline_result) || (didPerformSomeWork = true, performSyncWorkOnRoot(root$170, JSCompiler_inline_result));
              root$170 = root$170.next;
            }
          } while (didPerformSomeWork);
          isFlushingWork = false;
        }
      }
      function processRootScheduleInImmediateTask() {
        processRootScheduleInMicrotask();
      }
      function processRootScheduleInMicrotask() {
        mightHavePendingSyncWork = didScheduleMicrotask = false;
        var syncTransitionLanes = 0;
        0 !== currentEventTransitionLane && shouldAttemptEagerTransition() && (syncTransitionLanes = currentEventTransitionLane);
        for (var currentTime = now(), prev = null, root3 = firstScheduledRoot; null !== root3; ) {
          var next = root3.next, nextLanes = scheduleTaskForRootDuringMicrotask(root3, currentTime);
          if (0 === nextLanes)
            root3.next = null, null === prev ? firstScheduledRoot = next : prev.next = next, null === next && (lastScheduledRoot = prev);
          else if (prev = root3, 0 !== syncTransitionLanes || 0 !== (nextLanes & 3))
            mightHavePendingSyncWork = true;
          root3 = next;
        }
        0 !== pendingEffectsStatus && 5 !== pendingEffectsStatus || flushSyncWorkAcrossRoots_impl(syncTransitionLanes);
        0 !== currentEventTransitionLane && (currentEventTransitionLane = 0);
      }
      function scheduleTaskForRootDuringMicrotask(root3, currentTime) {
        for (var suspendedLanes = root3.suspendedLanes, pingedLanes = root3.pingedLanes, expirationTimes = root3.expirationTimes, lanes = root3.pendingLanes & -62914561; 0 < lanes; ) {
          var index$5 = 31 - clz32(lanes), lane = 1 << index$5, expirationTime = expirationTimes[index$5];
          if (-1 === expirationTime) {
            if (0 === (lane & suspendedLanes) || 0 !== (lane & pingedLanes))
              expirationTimes[index$5] = computeExpirationTime(lane, currentTime);
          } else expirationTime <= currentTime && (root3.expiredLanes |= lane);
          lanes &= ~lane;
        }
        currentTime = workInProgressRoot;
        suspendedLanes = workInProgressRootRenderLanes;
        suspendedLanes = getNextLanes(
          root3,
          root3 === currentTime ? suspendedLanes : 0,
          null !== root3.cancelPendingCommit || -1 !== root3.timeoutHandle
        );
        pingedLanes = root3.callbackNode;
        if (0 === suspendedLanes || root3 === currentTime && (2 === workInProgressSuspendedReason || 9 === workInProgressSuspendedReason) || null !== root3.cancelPendingCommit)
          return null !== pingedLanes && null !== pingedLanes && cancelCallback$1(pingedLanes), root3.callbackNode = null, root3.callbackPriority = 0;
        if (0 === (suspendedLanes & 3) || checkIfRootIsPrerendering(root3, suspendedLanes)) {
          currentTime = suspendedLanes & -suspendedLanes;
          if (currentTime === root3.callbackPriority) return currentTime;
          null !== pingedLanes && cancelCallback$1(pingedLanes);
          switch (lanesToEventPriority(suspendedLanes)) {
            case 2:
            case 8:
              suspendedLanes = UserBlockingPriority;
              break;
            case 32:
              suspendedLanes = NormalPriority$1;
              break;
            case 268435456:
              suspendedLanes = IdlePriority;
              break;
            default:
              suspendedLanes = NormalPriority$1;
          }
          pingedLanes = performWorkOnRootViaSchedulerTask.bind(null, root3);
          suspendedLanes = scheduleCallback$3(suspendedLanes, pingedLanes);
          root3.callbackPriority = currentTime;
          root3.callbackNode = suspendedLanes;
          return currentTime;
        }
        null !== pingedLanes && null !== pingedLanes && cancelCallback$1(pingedLanes);
        root3.callbackPriority = 2;
        root3.callbackNode = null;
        return 2;
      }
      function performWorkOnRootViaSchedulerTask(root3, didTimeout) {
        if (0 !== pendingEffectsStatus && 5 !== pendingEffectsStatus)
          return root3.callbackNode = null, root3.callbackPriority = 0, null;
        var originalCallbackNode = root3.callbackNode;
        if (flushPendingEffects() && root3.callbackNode !== originalCallbackNode)
          return null;
        var workInProgressRootRenderLanes$jscomp$0 = workInProgressRootRenderLanes;
        workInProgressRootRenderLanes$jscomp$0 = getNextLanes(
          root3,
          root3 === workInProgressRoot ? workInProgressRootRenderLanes$jscomp$0 : 0,
          null !== root3.cancelPendingCommit || -1 !== root3.timeoutHandle
        );
        if (0 === workInProgressRootRenderLanes$jscomp$0) return null;
        performWorkOnRoot(root3, workInProgressRootRenderLanes$jscomp$0, didTimeout);
        scheduleTaskForRootDuringMicrotask(root3, now());
        return null != root3.callbackNode && root3.callbackNode === originalCallbackNode ? performWorkOnRootViaSchedulerTask.bind(null, root3) : null;
      }
      function performSyncWorkOnRoot(root3, lanes) {
        if (flushPendingEffects()) return null;
        performWorkOnRoot(root3, lanes, true);
      }
      function scheduleImmediateRootScheduleTask() {
        scheduleMicrotask(function() {
          0 !== (executionContext & 6) ? scheduleCallback$3(
            ImmediatePriority,
            processRootScheduleInImmediateTask
          ) : processRootScheduleInMicrotask();
        });
      }
      function requestTransitionLane() {
        if (0 === currentEventTransitionLane) {
          var actionScopeLane = currentEntangledLane;
          0 === actionScopeLane && (actionScopeLane = nextTransitionUpdateLane, nextTransitionUpdateLane <<= 1, 0 === (nextTransitionUpdateLane & 261888) && (nextTransitionUpdateLane = 256));
          currentEventTransitionLane = actionScopeLane;
        }
        return currentEventTransitionLane;
      }
      function coerceFormActionProp(actionProp) {
        return null == actionProp || "symbol" === typeof actionProp || "boolean" === typeof actionProp ? null : "function" === typeof actionProp ? actionProp : sanitizeURL("" + actionProp);
      }
      function createFormDataWithSubmitter(form, submitter) {
        var temp = submitter.ownerDocument.createElement("input");
        temp.name = submitter.name;
        temp.value = submitter.value;
        form.id && temp.setAttribute("form", form.id);
        submitter.parentNode.insertBefore(temp, submitter);
        form = new FormData(form);
        temp.parentNode.removeChild(temp);
        return form;
      }
      function extractEvents$1(dispatchQueue, domEventName, maybeTargetInst, nativeEvent, nativeEventTarget) {
        if ("submit" === domEventName && maybeTargetInst && maybeTargetInst.stateNode === nativeEventTarget) {
          var action = coerceFormActionProp(
            (nativeEventTarget[internalPropsKey] || null).action
          ), submitter = nativeEvent.submitter;
          submitter && (domEventName = (domEventName = submitter[internalPropsKey] || null) ? coerceFormActionProp(domEventName.formAction) : submitter.getAttribute("formAction"), null !== domEventName && (action = domEventName, submitter = null));
          var event = new SyntheticEvent(
            "action",
            "action",
            null,
            nativeEvent,
            nativeEventTarget
          );
          dispatchQueue.push({
            event,
            listeners: [
              {
                instance: null,
                listener: function() {
                  if (nativeEvent.defaultPrevented) {
                    if (0 !== currentEventTransitionLane) {
                      var formData = submitter ? createFormDataWithSubmitter(nativeEventTarget, submitter) : new FormData(nativeEventTarget);
                      startHostTransition(
                        maybeTargetInst,
                        {
                          pending: true,
                          data: formData,
                          method: nativeEventTarget.method,
                          action
                        },
                        null,
                        formData
                      );
                    }
                  } else
                    "function" === typeof action && (event.preventDefault(), formData = submitter ? createFormDataWithSubmitter(nativeEventTarget, submitter) : new FormData(nativeEventTarget), startHostTransition(
                      maybeTargetInst,
                      {
                        pending: true,
                        data: formData,
                        method: nativeEventTarget.method,
                        action
                      },
                      action,
                      formData
                    ));
                },
                currentTarget: nativeEventTarget
              }
            ]
          });
        }
      }
      for (var i$jscomp$inline_1577 = 0; i$jscomp$inline_1577 < simpleEventPluginEvents.length; i$jscomp$inline_1577++) {
        var eventName$jscomp$inline_1578 = simpleEventPluginEvents[i$jscomp$inline_1577], domEventName$jscomp$inline_1579 = eventName$jscomp$inline_1578.toLowerCase(), capitalizedEvent$jscomp$inline_1580 = eventName$jscomp$inline_1578[0].toUpperCase() + eventName$jscomp$inline_1578.slice(1);
        registerSimpleEvent(
          domEventName$jscomp$inline_1579,
          "on" + capitalizedEvent$jscomp$inline_1580
        );
      }
      registerSimpleEvent(ANIMATION_END, "onAnimationEnd");
      registerSimpleEvent(ANIMATION_ITERATION, "onAnimationIteration");
      registerSimpleEvent(ANIMATION_START, "onAnimationStart");
      registerSimpleEvent("dblclick", "onDoubleClick");
      registerSimpleEvent("focusin", "onFocus");
      registerSimpleEvent("focusout", "onBlur");
      registerSimpleEvent(TRANSITION_RUN, "onTransitionRun");
      registerSimpleEvent(TRANSITION_START, "onTransitionStart");
      registerSimpleEvent(TRANSITION_CANCEL, "onTransitionCancel");
      registerSimpleEvent(TRANSITION_END, "onTransitionEnd");
      registerDirectEvent("onMouseEnter", ["mouseout", "mouseover"]);
      registerDirectEvent("onMouseLeave", ["mouseout", "mouseover"]);
      registerDirectEvent("onPointerEnter", ["pointerout", "pointerover"]);
      registerDirectEvent("onPointerLeave", ["pointerout", "pointerover"]);
      registerTwoPhaseEvent(
        "onChange",
        "change click focusin focusout input keydown keyup selectionchange".split(" ")
      );
      registerTwoPhaseEvent(
        "onSelect",
        "focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(
          " "
        )
      );
      registerTwoPhaseEvent("onBeforeInput", [
        "compositionend",
        "keypress",
        "textInput",
        "paste"
      ]);
      registerTwoPhaseEvent(
        "onCompositionEnd",
        "compositionend focusout keydown keypress keyup mousedown".split(" ")
      );
      registerTwoPhaseEvent(
        "onCompositionStart",
        "compositionstart focusout keydown keypress keyup mousedown".split(" ")
      );
      registerTwoPhaseEvent(
        "onCompositionUpdate",
        "compositionupdate focusout keydown keypress keyup mousedown".split(" ")
      );
      var mediaEventTypes = "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(
        " "
      ), nonDelegatedEvents = new Set(
        "beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(mediaEventTypes)
      );
      function processDispatchQueue(dispatchQueue, eventSystemFlags) {
        eventSystemFlags = 0 !== (eventSystemFlags & 4);
        for (var i2 = 0; i2 < dispatchQueue.length; i2++) {
          var _dispatchQueue$i = dispatchQueue[i2], event = _dispatchQueue$i.event;
          _dispatchQueue$i = _dispatchQueue$i.listeners;
          a: {
            var previousInstance = void 0;
            if (eventSystemFlags)
              for (var i$jscomp$0 = _dispatchQueue$i.length - 1; 0 <= i$jscomp$0; i$jscomp$0--) {
                var _dispatchListeners$i = _dispatchQueue$i[i$jscomp$0], instance = _dispatchListeners$i.instance, currentTarget = _dispatchListeners$i.currentTarget;
                _dispatchListeners$i = _dispatchListeners$i.listener;
                if (instance !== previousInstance && event.isPropagationStopped())
                  break a;
                previousInstance = _dispatchListeners$i;
                event.currentTarget = currentTarget;
                try {
                  previousInstance(event);
                } catch (error2) {
                  reportGlobalError(error2);
                }
                event.currentTarget = null;
                previousInstance = instance;
              }
            else
              for (i$jscomp$0 = 0; i$jscomp$0 < _dispatchQueue$i.length; i$jscomp$0++) {
                _dispatchListeners$i = _dispatchQueue$i[i$jscomp$0];
                instance = _dispatchListeners$i.instance;
                currentTarget = _dispatchListeners$i.currentTarget;
                _dispatchListeners$i = _dispatchListeners$i.listener;
                if (instance !== previousInstance && event.isPropagationStopped())
                  break a;
                previousInstance = _dispatchListeners$i;
                event.currentTarget = currentTarget;
                try {
                  previousInstance(event);
                } catch (error2) {
                  reportGlobalError(error2);
                }
                event.currentTarget = null;
                previousInstance = instance;
              }
          }
        }
      }
      function listenToNonDelegatedEvent(domEventName, targetElement) {
        var JSCompiler_inline_result = targetElement[internalEventHandlersKey];
        void 0 === JSCompiler_inline_result && (JSCompiler_inline_result = targetElement[internalEventHandlersKey] = /* @__PURE__ */ new Set());
        var listenerSetKey = domEventName + "__bubble";
        JSCompiler_inline_result.has(listenerSetKey) || (addTrappedEventListener(targetElement, domEventName, 2, false), JSCompiler_inline_result.add(listenerSetKey));
      }
      function listenToNativeEvent(domEventName, isCapturePhaseListener, target2) {
        var eventSystemFlags = 0;
        isCapturePhaseListener && (eventSystemFlags |= 4);
        addTrappedEventListener(
          target2,
          domEventName,
          eventSystemFlags,
          isCapturePhaseListener
        );
      }
      var listeningMarker = "_reactListening" + Math.random().toString(36).slice(2);
      function listenToAllSupportedEvents(rootContainerElement) {
        if (!rootContainerElement[listeningMarker]) {
          rootContainerElement[listeningMarker] = true;
          allNativeEvents.forEach(function(domEventName) {
            "selectionchange" !== domEventName && (nonDelegatedEvents.has(domEventName) || listenToNativeEvent(domEventName, false, rootContainerElement), listenToNativeEvent(domEventName, true, rootContainerElement));
          });
          var ownerDocument = 9 === rootContainerElement.nodeType ? rootContainerElement : rootContainerElement.ownerDocument;
          null === ownerDocument || ownerDocument[listeningMarker] || (ownerDocument[listeningMarker] = true, listenToNativeEvent("selectionchange", false, ownerDocument));
        }
      }
      function addTrappedEventListener(targetContainer, domEventName, eventSystemFlags, isCapturePhaseListener) {
        switch (getEventPriority(domEventName)) {
          case 2:
            var listenerWrapper = dispatchDiscreteEvent;
            break;
          case 8:
            listenerWrapper = dispatchContinuousEvent;
            break;
          default:
            listenerWrapper = dispatchEvent2;
        }
        eventSystemFlags = listenerWrapper.bind(
          null,
          domEventName,
          eventSystemFlags,
          targetContainer
        );
        listenerWrapper = void 0;
        !passiveBrowserEventsSupported || "touchstart" !== domEventName && "touchmove" !== domEventName && "wheel" !== domEventName || (listenerWrapper = true);
        isCapturePhaseListener ? void 0 !== listenerWrapper ? targetContainer.addEventListener(domEventName, eventSystemFlags, {
          capture: true,
          passive: listenerWrapper
        }) : targetContainer.addEventListener(domEventName, eventSystemFlags, true) : void 0 !== listenerWrapper ? targetContainer.addEventListener(domEventName, eventSystemFlags, {
          passive: listenerWrapper
        }) : targetContainer.addEventListener(domEventName, eventSystemFlags, false);
      }
      function dispatchEventForPluginEventSystem(domEventName, eventSystemFlags, nativeEvent, targetInst$jscomp$0, targetContainer) {
        var ancestorInst = targetInst$jscomp$0;
        if (0 === (eventSystemFlags & 1) && 0 === (eventSystemFlags & 2) && null !== targetInst$jscomp$0)
          a: for (; ; ) {
            if (null === targetInst$jscomp$0) return;
            var nodeTag = targetInst$jscomp$0.tag;
            if (3 === nodeTag || 4 === nodeTag) {
              var container2 = targetInst$jscomp$0.stateNode.containerInfo;
              if (container2 === targetContainer) break;
              if (4 === nodeTag)
                for (nodeTag = targetInst$jscomp$0.return; null !== nodeTag; ) {
                  var grandTag = nodeTag.tag;
                  if ((3 === grandTag || 4 === grandTag) && nodeTag.stateNode.containerInfo === targetContainer)
                    return;
                  nodeTag = nodeTag.return;
                }
              for (; null !== container2; ) {
                nodeTag = getClosestInstanceFromNode(container2);
                if (null === nodeTag) return;
                grandTag = nodeTag.tag;
                if (5 === grandTag || 6 === grandTag || 26 === grandTag || 27 === grandTag) {
                  targetInst$jscomp$0 = ancestorInst = nodeTag;
                  continue a;
                }
                container2 = container2.parentNode;
              }
            }
            targetInst$jscomp$0 = targetInst$jscomp$0.return;
          }
        batchedUpdates$1(function() {
          var targetInst = ancestorInst, nativeEventTarget = getEventTarget(nativeEvent), dispatchQueue = [];
          a: {
            var reactName = topLevelEventsToReactNames.get(domEventName);
            if (void 0 !== reactName) {
              var SyntheticEventCtor = SyntheticEvent, reactEventType = domEventName;
              switch (domEventName) {
                case "keypress":
                  if (0 === getEventCharCode(nativeEvent)) break a;
                case "keydown":
                case "keyup":
                  SyntheticEventCtor = SyntheticKeyboardEvent;
                  break;
                case "focusin":
                  reactEventType = "focus";
                  SyntheticEventCtor = SyntheticFocusEvent;
                  break;
                case "focusout":
                  reactEventType = "blur";
                  SyntheticEventCtor = SyntheticFocusEvent;
                  break;
                case "beforeblur":
                case "afterblur":
                  SyntheticEventCtor = SyntheticFocusEvent;
                  break;
                case "click":
                  if (2 === nativeEvent.button) break a;
                case "auxclick":
                case "dblclick":
                case "mousedown":
                case "mousemove":
                case "mouseup":
                case "mouseout":
                case "mouseover":
                case "contextmenu":
                  SyntheticEventCtor = SyntheticMouseEvent;
                  break;
                case "drag":
                case "dragend":
                case "dragenter":
                case "dragexit":
                case "dragleave":
                case "dragover":
                case "dragstart":
                case "drop":
                  SyntheticEventCtor = SyntheticDragEvent;
                  break;
                case "touchcancel":
                case "touchend":
                case "touchmove":
                case "touchstart":
                  SyntheticEventCtor = SyntheticTouchEvent;
                  break;
                case ANIMATION_END:
                case ANIMATION_ITERATION:
                case ANIMATION_START:
                  SyntheticEventCtor = SyntheticAnimationEvent;
                  break;
                case TRANSITION_END:
                  SyntheticEventCtor = SyntheticTransitionEvent;
                  break;
                case "scroll":
                case "scrollend":
                  SyntheticEventCtor = SyntheticUIEvent;
                  break;
                case "wheel":
                  SyntheticEventCtor = SyntheticWheelEvent;
                  break;
                case "copy":
                case "cut":
                case "paste":
                  SyntheticEventCtor = SyntheticClipboardEvent;
                  break;
                case "gotpointercapture":
                case "lostpointercapture":
                case "pointercancel":
                case "pointerdown":
                case "pointermove":
                case "pointerout":
                case "pointerover":
                case "pointerup":
                  SyntheticEventCtor = SyntheticPointerEvent;
                  break;
                case "toggle":
                case "beforetoggle":
                  SyntheticEventCtor = SyntheticToggleEvent;
              }
              var inCapturePhase = 0 !== (eventSystemFlags & 4), accumulateTargetOnly = !inCapturePhase && ("scroll" === domEventName || "scrollend" === domEventName), reactEventName = inCapturePhase ? null !== reactName ? reactName + "Capture" : null : reactName;
              inCapturePhase = [];
              for (var instance = targetInst, lastHostComponent; null !== instance; ) {
                var _instance = instance;
                lastHostComponent = _instance.stateNode;
                _instance = _instance.tag;
                5 !== _instance && 26 !== _instance && 27 !== _instance || null === lastHostComponent || null === reactEventName || (_instance = getListener2(instance, reactEventName), null != _instance && inCapturePhase.push(
                  createDispatchListener(instance, _instance, lastHostComponent)
                ));
                if (accumulateTargetOnly) break;
                instance = instance.return;
              }
              0 < inCapturePhase.length && (reactName = new SyntheticEventCtor(
                reactName,
                reactEventType,
                null,
                nativeEvent,
                nativeEventTarget
              ), dispatchQueue.push({ event: reactName, listeners: inCapturePhase }));
            }
          }
          if (0 === (eventSystemFlags & 7)) {
            a: {
              reactName = "mouseover" === domEventName || "pointerover" === domEventName;
              SyntheticEventCtor = "mouseout" === domEventName || "pointerout" === domEventName;
              if (reactName && nativeEvent !== currentReplayingEvent && (reactEventType = nativeEvent.relatedTarget || nativeEvent.fromElement) && (getClosestInstanceFromNode(reactEventType) || reactEventType[internalContainerInstanceKey]))
                break a;
              if (SyntheticEventCtor || reactName) {
                reactName = nativeEventTarget.window === nativeEventTarget ? nativeEventTarget : (reactName = nativeEventTarget.ownerDocument) ? reactName.defaultView || reactName.parentWindow : window;
                if (SyntheticEventCtor) {
                  if (reactEventType = nativeEvent.relatedTarget || nativeEvent.toElement, SyntheticEventCtor = targetInst, reactEventType = reactEventType ? getClosestInstanceFromNode(reactEventType) : null, null !== reactEventType && (accumulateTargetOnly = getNearestMountedFiber(reactEventType), inCapturePhase = reactEventType.tag, reactEventType !== accumulateTargetOnly || 5 !== inCapturePhase && 27 !== inCapturePhase && 6 !== inCapturePhase))
                    reactEventType = null;
                } else SyntheticEventCtor = null, reactEventType = targetInst;
                if (SyntheticEventCtor !== reactEventType) {
                  inCapturePhase = SyntheticMouseEvent;
                  _instance = "onMouseLeave";
                  reactEventName = "onMouseEnter";
                  instance = "mouse";
                  if ("pointerout" === domEventName || "pointerover" === domEventName)
                    inCapturePhase = SyntheticPointerEvent, _instance = "onPointerLeave", reactEventName = "onPointerEnter", instance = "pointer";
                  accumulateTargetOnly = null == SyntheticEventCtor ? reactName : getNodeFromInstance(SyntheticEventCtor);
                  lastHostComponent = null == reactEventType ? reactName : getNodeFromInstance(reactEventType);
                  reactName = new inCapturePhase(
                    _instance,
                    instance + "leave",
                    SyntheticEventCtor,
                    nativeEvent,
                    nativeEventTarget
                  );
                  reactName.target = accumulateTargetOnly;
                  reactName.relatedTarget = lastHostComponent;
                  _instance = null;
                  getClosestInstanceFromNode(nativeEventTarget) === targetInst && (inCapturePhase = new inCapturePhase(
                    reactEventName,
                    instance + "enter",
                    reactEventType,
                    nativeEvent,
                    nativeEventTarget
                  ), inCapturePhase.target = lastHostComponent, inCapturePhase.relatedTarget = accumulateTargetOnly, _instance = inCapturePhase);
                  accumulateTargetOnly = _instance;
                  if (SyntheticEventCtor && reactEventType)
                    b: {
                      inCapturePhase = getParent;
                      reactEventName = SyntheticEventCtor;
                      instance = reactEventType;
                      lastHostComponent = 0;
                      for (_instance = reactEventName; _instance; _instance = inCapturePhase(_instance))
                        lastHostComponent++;
                      _instance = 0;
                      for (var tempB = instance; tempB; tempB = inCapturePhase(tempB))
                        _instance++;
                      for (; 0 < lastHostComponent - _instance; )
                        reactEventName = inCapturePhase(reactEventName), lastHostComponent--;
                      for (; 0 < _instance - lastHostComponent; )
                        instance = inCapturePhase(instance), _instance--;
                      for (; lastHostComponent--; ) {
                        if (reactEventName === instance || null !== instance && reactEventName === instance.alternate) {
                          inCapturePhase = reactEventName;
                          break b;
                        }
                        reactEventName = inCapturePhase(reactEventName);
                        instance = inCapturePhase(instance);
                      }
                      inCapturePhase = null;
                    }
                  else inCapturePhase = null;
                  null !== SyntheticEventCtor && accumulateEnterLeaveListenersForEvent(
                    dispatchQueue,
                    reactName,
                    SyntheticEventCtor,
                    inCapturePhase,
                    false
                  );
                  null !== reactEventType && null !== accumulateTargetOnly && accumulateEnterLeaveListenersForEvent(
                    dispatchQueue,
                    accumulateTargetOnly,
                    reactEventType,
                    inCapturePhase,
                    true
                  );
                }
              }
            }
            a: {
              reactName = targetInst ? getNodeFromInstance(targetInst) : window;
              SyntheticEventCtor = reactName.nodeName && reactName.nodeName.toLowerCase();
              if ("select" === SyntheticEventCtor || "input" === SyntheticEventCtor && "file" === reactName.type)
                var getTargetInstFunc = getTargetInstForChangeEvent;
              else if (isTextInputElement(reactName))
                if (isInputEventSupported)
                  getTargetInstFunc = getTargetInstForInputOrChangeEvent;
                else {
                  getTargetInstFunc = getTargetInstForInputEventPolyfill;
                  var handleEventFunc = handleEventsForInputEventPolyfill;
                }
              else
                SyntheticEventCtor = reactName.nodeName, !SyntheticEventCtor || "input" !== SyntheticEventCtor.toLowerCase() || "checkbox" !== reactName.type && "radio" !== reactName.type ? targetInst && isCustomElement(targetInst.elementType) && (getTargetInstFunc = getTargetInstForChangeEvent) : getTargetInstFunc = getTargetInstForClickEvent;
              if (getTargetInstFunc && (getTargetInstFunc = getTargetInstFunc(domEventName, targetInst))) {
                createAndAccumulateChangeEvent(
                  dispatchQueue,
                  getTargetInstFunc,
                  nativeEvent,
                  nativeEventTarget
                );
                break a;
              }
              handleEventFunc && handleEventFunc(domEventName, reactName, targetInst);
              "focusout" === domEventName && targetInst && "number" === reactName.type && null != targetInst.memoizedProps.value && setDefaultValue(reactName, "number", reactName.value);
            }
            handleEventFunc = targetInst ? getNodeFromInstance(targetInst) : window;
            switch (domEventName) {
              case "focusin":
                if (isTextInputElement(handleEventFunc) || "true" === handleEventFunc.contentEditable)
                  activeElement = handleEventFunc, activeElementInst = targetInst, lastSelection = null;
                break;
              case "focusout":
                lastSelection = activeElementInst = activeElement = null;
                break;
              case "mousedown":
                mouseDown = true;
                break;
              case "contextmenu":
              case "mouseup":
              case "dragend":
                mouseDown = false;
                constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget);
                break;
              case "selectionchange":
                if (skipSelectionChangeEvent) break;
              case "keydown":
              case "keyup":
                constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget);
            }
            var fallbackData;
            if (canUseCompositionEvent)
              b: {
                switch (domEventName) {
                  case "compositionstart":
                    var eventType = "onCompositionStart";
                    break b;
                  case "compositionend":
                    eventType = "onCompositionEnd";
                    break b;
                  case "compositionupdate":
                    eventType = "onCompositionUpdate";
                    break b;
                }
                eventType = void 0;
              }
            else
              isComposing ? isFallbackCompositionEnd(domEventName, nativeEvent) && (eventType = "onCompositionEnd") : "keydown" === domEventName && 229 === nativeEvent.keyCode && (eventType = "onCompositionStart");
            eventType && (useFallbackCompositionData && "ko" !== nativeEvent.locale && (isComposing || "onCompositionStart" !== eventType ? "onCompositionEnd" === eventType && isComposing && (fallbackData = getData()) : (root2 = nativeEventTarget, startText = "value" in root2 ? root2.value : root2.textContent, isComposing = true)), handleEventFunc = accumulateTwoPhaseListeners(targetInst, eventType), 0 < handleEventFunc.length && (eventType = new SyntheticCompositionEvent(
              eventType,
              domEventName,
              null,
              nativeEvent,
              nativeEventTarget
            ), dispatchQueue.push({ event: eventType, listeners: handleEventFunc }), fallbackData ? eventType.data = fallbackData : (fallbackData = getDataFromCustomEvent(nativeEvent), null !== fallbackData && (eventType.data = fallbackData))));
            if (fallbackData = canUseTextInputEvent ? getNativeBeforeInputChars(domEventName, nativeEvent) : getFallbackBeforeInputChars(domEventName, nativeEvent))
              eventType = accumulateTwoPhaseListeners(targetInst, "onBeforeInput"), 0 < eventType.length && (handleEventFunc = new SyntheticCompositionEvent(
                "onBeforeInput",
                "beforeinput",
                null,
                nativeEvent,
                nativeEventTarget
              ), dispatchQueue.push({
                event: handleEventFunc,
                listeners: eventType
              }), handleEventFunc.data = fallbackData);
            extractEvents$1(
              dispatchQueue,
              domEventName,
              targetInst,
              nativeEvent,
              nativeEventTarget
            );
          }
          processDispatchQueue(dispatchQueue, eventSystemFlags);
        });
      }
      function createDispatchListener(instance, listener, currentTarget) {
        return {
          instance,
          listener,
          currentTarget
        };
      }
      function accumulateTwoPhaseListeners(targetFiber, reactName) {
        for (var captureName = reactName + "Capture", listeners = []; null !== targetFiber; ) {
          var _instance2 = targetFiber, stateNode = _instance2.stateNode;
          _instance2 = _instance2.tag;
          5 !== _instance2 && 26 !== _instance2 && 27 !== _instance2 || null === stateNode || (_instance2 = getListener2(targetFiber, captureName), null != _instance2 && listeners.unshift(
            createDispatchListener(targetFiber, _instance2, stateNode)
          ), _instance2 = getListener2(targetFiber, reactName), null != _instance2 && listeners.push(
            createDispatchListener(targetFiber, _instance2, stateNode)
          ));
          if (3 === targetFiber.tag) return listeners;
          targetFiber = targetFiber.return;
        }
        return [];
      }
      function getParent(inst) {
        if (null === inst) return null;
        do
          inst = inst.return;
        while (inst && 5 !== inst.tag && 27 !== inst.tag);
        return inst ? inst : null;
      }
      function accumulateEnterLeaveListenersForEvent(dispatchQueue, event, target2, common, inCapturePhase) {
        for (var registrationName = event._reactName, listeners = []; null !== target2 && target2 !== common; ) {
          var _instance3 = target2, alternate = _instance3.alternate, stateNode = _instance3.stateNode;
          _instance3 = _instance3.tag;
          if (null !== alternate && alternate === common) break;
          5 !== _instance3 && 26 !== _instance3 && 27 !== _instance3 || null === stateNode || (alternate = stateNode, inCapturePhase ? (stateNode = getListener2(target2, registrationName), null != stateNode && listeners.unshift(
            createDispatchListener(target2, stateNode, alternate)
          )) : inCapturePhase || (stateNode = getListener2(target2, registrationName), null != stateNode && listeners.push(
            createDispatchListener(target2, stateNode, alternate)
          )));
          target2 = target2.return;
        }
        0 !== listeners.length && dispatchQueue.push({ event, listeners });
      }
      var NORMALIZE_NEWLINES_REGEX = /\r\n?/g, NORMALIZE_NULL_AND_REPLACEMENT_REGEX = /\u0000|\uFFFD/g;
      function normalizeMarkupForTextOrAttribute(markup) {
        return ("string" === typeof markup ? markup : "" + markup).replace(NORMALIZE_NEWLINES_REGEX, "\n").replace(NORMALIZE_NULL_AND_REPLACEMENT_REGEX, "");
      }
      function checkForUnmatchedText(serverText, clientText) {
        clientText = normalizeMarkupForTextOrAttribute(clientText);
        return normalizeMarkupForTextOrAttribute(serverText) === clientText ? true : false;
      }
      function setProp(domElement, tag, key2, value2, props, prevValue) {
        switch (key2) {
          case "children":
            "string" === typeof value2 ? "body" === tag || "textarea" === tag && "" === value2 || setTextContent(domElement, value2) : ("number" === typeof value2 || "bigint" === typeof value2) && "body" !== tag && setTextContent(domElement, "" + value2);
            break;
          case "className":
            setValueForKnownAttribute(domElement, "class", value2);
            break;
          case "tabIndex":
            setValueForKnownAttribute(domElement, "tabindex", value2);
            break;
          case "dir":
          case "role":
          case "viewBox":
          case "width":
          case "height":
            setValueForKnownAttribute(domElement, key2, value2);
            break;
          case "style":
            setValueForStyles(domElement, value2, prevValue);
            break;
          case "data":
            if ("object" !== tag) {
              setValueForKnownAttribute(domElement, "data", value2);
              break;
            }
          case "src":
          case "href":
            if ("" === value2 && ("a" !== tag || "href" !== key2)) {
              domElement.removeAttribute(key2);
              break;
            }
            if (null == value2 || "function" === typeof value2 || "symbol" === typeof value2 || "boolean" === typeof value2) {
              domElement.removeAttribute(key2);
              break;
            }
            value2 = sanitizeURL("" + value2);
            domElement.setAttribute(key2, value2);
            break;
          case "action":
          case "formAction":
            if ("function" === typeof value2) {
              domElement.setAttribute(
                key2,
                "javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')"
              );
              break;
            } else
              "function" === typeof prevValue && ("formAction" === key2 ? ("input" !== tag && setProp(domElement, tag, "name", props.name, props, null), setProp(
                domElement,
                tag,
                "formEncType",
                props.formEncType,
                props,
                null
              ), setProp(
                domElement,
                tag,
                "formMethod",
                props.formMethod,
                props,
                null
              ), setProp(
                domElement,
                tag,
                "formTarget",
                props.formTarget,
                props,
                null
              )) : (setProp(domElement, tag, "encType", props.encType, props, null), setProp(domElement, tag, "method", props.method, props, null), setProp(domElement, tag, "target", props.target, props, null)));
            if (null == value2 || "symbol" === typeof value2 || "boolean" === typeof value2) {
              domElement.removeAttribute(key2);
              break;
            }
            value2 = sanitizeURL("" + value2);
            domElement.setAttribute(key2, value2);
            break;
          case "onClick":
            null != value2 && (domElement.onclick = noop$1);
            break;
          case "onScroll":
            null != value2 && listenToNonDelegatedEvent("scroll", domElement);
            break;
          case "onScrollEnd":
            null != value2 && listenToNonDelegatedEvent("scrollend", domElement);
            break;
          case "dangerouslySetInnerHTML":
            if (null != value2) {
              if ("object" !== typeof value2 || !("__html" in value2))
                throw Error(formatProdErrorMessage(61));
              key2 = value2.__html;
              if (null != key2) {
                if (null != props.children) throw Error(formatProdErrorMessage(60));
                domElement.innerHTML = key2;
              }
            }
            break;
          case "multiple":
            domElement.multiple = value2 && "function" !== typeof value2 && "symbol" !== typeof value2;
            break;
          case "muted":
            domElement.muted = value2 && "function" !== typeof value2 && "symbol" !== typeof value2;
            break;
          case "suppressContentEditableWarning":
          case "suppressHydrationWarning":
          case "defaultValue":
          case "defaultChecked":
          case "innerHTML":
          case "ref":
            break;
          case "autoFocus":
            break;
          case "xlinkHref":
            if (null == value2 || "function" === typeof value2 || "boolean" === typeof value2 || "symbol" === typeof value2) {
              domElement.removeAttribute("xlink:href");
              break;
            }
            key2 = sanitizeURL("" + value2);
            domElement.setAttributeNS(
              "http://www.w3.org/1999/xlink",
              "xlink:href",
              key2
            );
            break;
          case "contentEditable":
          case "spellCheck":
          case "draggable":
          case "value":
          case "autoReverse":
          case "externalResourcesRequired":
          case "focusable":
          case "preserveAlpha":
            null != value2 && "function" !== typeof value2 && "symbol" !== typeof value2 ? domElement.setAttribute(key2, "" + value2) : domElement.removeAttribute(key2);
            break;
          case "inert":
          case "allowFullScreen":
          case "async":
          case "autoPlay":
          case "controls":
          case "default":
          case "defer":
          case "disabled":
          case "disablePictureInPicture":
          case "disableRemotePlayback":
          case "formNoValidate":
          case "hidden":
          case "loop":
          case "noModule":
          case "noValidate":
          case "open":
          case "playsInline":
          case "readOnly":
          case "required":
          case "reversed":
          case "scoped":
          case "seamless":
          case "itemScope":
            value2 && "function" !== typeof value2 && "symbol" !== typeof value2 ? domElement.setAttribute(key2, "") : domElement.removeAttribute(key2);
            break;
          case "capture":
          case "download":
            true === value2 ? domElement.setAttribute(key2, "") : false !== value2 && null != value2 && "function" !== typeof value2 && "symbol" !== typeof value2 ? domElement.setAttribute(key2, value2) : domElement.removeAttribute(key2);
            break;
          case "cols":
          case "rows":
          case "size":
          case "span":
            null != value2 && "function" !== typeof value2 && "symbol" !== typeof value2 && !isNaN(value2) && 1 <= value2 ? domElement.setAttribute(key2, value2) : domElement.removeAttribute(key2);
            break;
          case "rowSpan":
          case "start":
            null == value2 || "function" === typeof value2 || "symbol" === typeof value2 || isNaN(value2) ? domElement.removeAttribute(key2) : domElement.setAttribute(key2, value2);
            break;
          case "popover":
            listenToNonDelegatedEvent("beforetoggle", domElement);
            listenToNonDelegatedEvent("toggle", domElement);
            setValueForAttribute(domElement, "popover", value2);
            break;
          case "xlinkActuate":
            setValueForNamespacedAttribute(
              domElement,
              "http://www.w3.org/1999/xlink",
              "xlink:actuate",
              value2
            );
            break;
          case "xlinkArcrole":
            setValueForNamespacedAttribute(
              domElement,
              "http://www.w3.org/1999/xlink",
              "xlink:arcrole",
              value2
            );
            break;
          case "xlinkRole":
            setValueForNamespacedAttribute(
              domElement,
              "http://www.w3.org/1999/xlink",
              "xlink:role",
              value2
            );
            break;
          case "xlinkShow":
            setValueForNamespacedAttribute(
              domElement,
              "http://www.w3.org/1999/xlink",
              "xlink:show",
              value2
            );
            break;
          case "xlinkTitle":
            setValueForNamespacedAttribute(
              domElement,
              "http://www.w3.org/1999/xlink",
              "xlink:title",
              value2
            );
            break;
          case "xlinkType":
            setValueForNamespacedAttribute(
              domElement,
              "http://www.w3.org/1999/xlink",
              "xlink:type",
              value2
            );
            break;
          case "xmlBase":
            setValueForNamespacedAttribute(
              domElement,
              "http://www.w3.org/XML/1998/namespace",
              "xml:base",
              value2
            );
            break;
          case "xmlLang":
            setValueForNamespacedAttribute(
              domElement,
              "http://www.w3.org/XML/1998/namespace",
              "xml:lang",
              value2
            );
            break;
          case "xmlSpace":
            setValueForNamespacedAttribute(
              domElement,
              "http://www.w3.org/XML/1998/namespace",
              "xml:space",
              value2
            );
            break;
          case "is":
            setValueForAttribute(domElement, "is", value2);
            break;
          case "innerText":
          case "textContent":
            break;
          default:
            if (!(2 < key2.length) || "o" !== key2[0] && "O" !== key2[0] || "n" !== key2[1] && "N" !== key2[1])
              key2 = aliases2.get(key2) || key2, setValueForAttribute(domElement, key2, value2);
        }
      }
      function setPropOnCustomElement(domElement, tag, key2, value2, props, prevValue) {
        switch (key2) {
          case "style":
            setValueForStyles(domElement, value2, prevValue);
            break;
          case "dangerouslySetInnerHTML":
            if (null != value2) {
              if ("object" !== typeof value2 || !("__html" in value2))
                throw Error(formatProdErrorMessage(61));
              key2 = value2.__html;
              if (null != key2) {
                if (null != props.children) throw Error(formatProdErrorMessage(60));
                domElement.innerHTML = key2;
              }
            }
            break;
          case "children":
            "string" === typeof value2 ? setTextContent(domElement, value2) : ("number" === typeof value2 || "bigint" === typeof value2) && setTextContent(domElement, "" + value2);
            break;
          case "onScroll":
            null != value2 && listenToNonDelegatedEvent("scroll", domElement);
            break;
          case "onScrollEnd":
            null != value2 && listenToNonDelegatedEvent("scrollend", domElement);
            break;
          case "onClick":
            null != value2 && (domElement.onclick = noop$1);
            break;
          case "suppressContentEditableWarning":
          case "suppressHydrationWarning":
          case "innerHTML":
          case "ref":
            break;
          case "innerText":
          case "textContent":
            break;
          default:
            if (!registrationNameDependencies.hasOwnProperty(key2))
              a: {
                if ("o" === key2[0] && "n" === key2[1] && (props = key2.endsWith("Capture"), tag = key2.slice(2, props ? key2.length - 7 : void 0), prevValue = domElement[internalPropsKey] || null, prevValue = null != prevValue ? prevValue[key2] : null, "function" === typeof prevValue && domElement.removeEventListener(tag, prevValue, props), "function" === typeof value2)) {
                  "function" !== typeof prevValue && null !== prevValue && (key2 in domElement ? domElement[key2] = null : domElement.hasAttribute(key2) && domElement.removeAttribute(key2));
                  domElement.addEventListener(tag, value2, props);
                  break a;
                }
                key2 in domElement ? domElement[key2] = value2 : true === value2 ? domElement.setAttribute(key2, "") : setValueForAttribute(domElement, key2, value2);
              }
        }
      }
      function setInitialProperties(domElement, tag, props) {
        switch (tag) {
          case "div":
          case "span":
          case "svg":
          case "path":
          case "a":
          case "g":
          case "p":
          case "li":
            break;
          case "img":
            listenToNonDelegatedEvent("error", domElement);
            listenToNonDelegatedEvent("load", domElement);
            var hasSrc = false, hasSrcSet = false, propKey;
            for (propKey in props)
              if (props.hasOwnProperty(propKey)) {
                var propValue = props[propKey];
                if (null != propValue)
                  switch (propKey) {
                    case "src":
                      hasSrc = true;
                      break;
                    case "srcSet":
                      hasSrcSet = true;
                      break;
                    case "children":
                    case "dangerouslySetInnerHTML":
                      throw Error(formatProdErrorMessage(137, tag));
                    default:
                      setProp(domElement, tag, propKey, propValue, props, null);
                  }
              }
            hasSrcSet && setProp(domElement, tag, "srcSet", props.srcSet, props, null);
            hasSrc && setProp(domElement, tag, "src", props.src, props, null);
            return;
          case "input":
            listenToNonDelegatedEvent("invalid", domElement);
            var defaultValue = propKey = propValue = hasSrcSet = null, checked = null, defaultChecked = null;
            for (hasSrc in props)
              if (props.hasOwnProperty(hasSrc)) {
                var propValue$184 = props[hasSrc];
                if (null != propValue$184)
                  switch (hasSrc) {
                    case "name":
                      hasSrcSet = propValue$184;
                      break;
                    case "type":
                      propValue = propValue$184;
                      break;
                    case "checked":
                      checked = propValue$184;
                      break;
                    case "defaultChecked":
                      defaultChecked = propValue$184;
                      break;
                    case "value":
                      propKey = propValue$184;
                      break;
                    case "defaultValue":
                      defaultValue = propValue$184;
                      break;
                    case "children":
                    case "dangerouslySetInnerHTML":
                      if (null != propValue$184)
                        throw Error(formatProdErrorMessage(137, tag));
                      break;
                    default:
                      setProp(domElement, tag, hasSrc, propValue$184, props, null);
                  }
              }
            initInput(
              domElement,
              propKey,
              defaultValue,
              checked,
              defaultChecked,
              propValue,
              hasSrcSet,
              false
            );
            return;
          case "select":
            listenToNonDelegatedEvent("invalid", domElement);
            hasSrc = propValue = propKey = null;
            for (hasSrcSet in props)
              if (props.hasOwnProperty(hasSrcSet) && (defaultValue = props[hasSrcSet], null != defaultValue))
                switch (hasSrcSet) {
                  case "value":
                    propKey = defaultValue;
                    break;
                  case "defaultValue":
                    propValue = defaultValue;
                    break;
                  case "multiple":
                    hasSrc = defaultValue;
                  default:
                    setProp(domElement, tag, hasSrcSet, defaultValue, props, null);
                }
            tag = propKey;
            props = propValue;
            domElement.multiple = !!hasSrc;
            null != tag ? updateOptions(domElement, !!hasSrc, tag, false) : null != props && updateOptions(domElement, !!hasSrc, props, true);
            return;
          case "textarea":
            listenToNonDelegatedEvent("invalid", domElement);
            propKey = hasSrcSet = hasSrc = null;
            for (propValue in props)
              if (props.hasOwnProperty(propValue) && (defaultValue = props[propValue], null != defaultValue))
                switch (propValue) {
                  case "value":
                    hasSrc = defaultValue;
                    break;
                  case "defaultValue":
                    hasSrcSet = defaultValue;
                    break;
                  case "children":
                    propKey = defaultValue;
                    break;
                  case "dangerouslySetInnerHTML":
                    if (null != defaultValue) throw Error(formatProdErrorMessage(91));
                    break;
                  default:
                    setProp(domElement, tag, propValue, defaultValue, props, null);
                }
            initTextarea(domElement, hasSrc, hasSrcSet, propKey);
            return;
          case "option":
            for (checked in props)
              if (props.hasOwnProperty(checked) && (hasSrc = props[checked], null != hasSrc))
                switch (checked) {
                  case "selected":
                    domElement.selected = hasSrc && "function" !== typeof hasSrc && "symbol" !== typeof hasSrc;
                    break;
                  default:
                    setProp(domElement, tag, checked, hasSrc, props, null);
                }
            return;
          case "dialog":
            listenToNonDelegatedEvent("beforetoggle", domElement);
            listenToNonDelegatedEvent("toggle", domElement);
            listenToNonDelegatedEvent("cancel", domElement);
            listenToNonDelegatedEvent("close", domElement);
            break;
          case "iframe":
          case "object":
            listenToNonDelegatedEvent("load", domElement);
            break;
          case "video":
          case "audio":
            for (hasSrc = 0; hasSrc < mediaEventTypes.length; hasSrc++)
              listenToNonDelegatedEvent(mediaEventTypes[hasSrc], domElement);
            break;
          case "image":
            listenToNonDelegatedEvent("error", domElement);
            listenToNonDelegatedEvent("load", domElement);
            break;
          case "details":
            listenToNonDelegatedEvent("toggle", domElement);
            break;
          case "embed":
          case "source":
          case "link":
            listenToNonDelegatedEvent("error", domElement), listenToNonDelegatedEvent("load", domElement);
          case "area":
          case "base":
          case "br":
          case "col":
          case "hr":
          case "keygen":
          case "meta":
          case "param":
          case "track":
          case "wbr":
          case "menuitem":
            for (defaultChecked in props)
              if (props.hasOwnProperty(defaultChecked) && (hasSrc = props[defaultChecked], null != hasSrc))
                switch (defaultChecked) {
                  case "children":
                  case "dangerouslySetInnerHTML":
                    throw Error(formatProdErrorMessage(137, tag));
                  default:
                    setProp(domElement, tag, defaultChecked, hasSrc, props, null);
                }
            return;
          default:
            if (isCustomElement(tag)) {
              for (propValue$184 in props)
                props.hasOwnProperty(propValue$184) && (hasSrc = props[propValue$184], void 0 !== hasSrc && setPropOnCustomElement(
                  domElement,
                  tag,
                  propValue$184,
                  hasSrc,
                  props,
                  void 0
                ));
              return;
            }
        }
        for (defaultValue in props)
          props.hasOwnProperty(defaultValue) && (hasSrc = props[defaultValue], null != hasSrc && setProp(domElement, tag, defaultValue, hasSrc, props, null));
      }
      function updateProperties(domElement, tag, lastProps, nextProps) {
        switch (tag) {
          case "div":
          case "span":
          case "svg":
          case "path":
          case "a":
          case "g":
          case "p":
          case "li":
            break;
          case "input":
            var name2 = null, type = null, value2 = null, defaultValue = null, lastDefaultValue = null, checked = null, defaultChecked = null;
            for (propKey in lastProps) {
              var lastProp = lastProps[propKey];
              if (lastProps.hasOwnProperty(propKey) && null != lastProp)
                switch (propKey) {
                  case "checked":
                    break;
                  case "value":
                    break;
                  case "defaultValue":
                    lastDefaultValue = lastProp;
                  default:
                    nextProps.hasOwnProperty(propKey) || setProp(domElement, tag, propKey, null, nextProps, lastProp);
                }
            }
            for (var propKey$201 in nextProps) {
              var propKey = nextProps[propKey$201];
              lastProp = lastProps[propKey$201];
              if (nextProps.hasOwnProperty(propKey$201) && (null != propKey || null != lastProp))
                switch (propKey$201) {
                  case "type":
                    type = propKey;
                    break;
                  case "name":
                    name2 = propKey;
                    break;
                  case "checked":
                    checked = propKey;
                    break;
                  case "defaultChecked":
                    defaultChecked = propKey;
                    break;
                  case "value":
                    value2 = propKey;
                    break;
                  case "defaultValue":
                    defaultValue = propKey;
                    break;
                  case "children":
                  case "dangerouslySetInnerHTML":
                    if (null != propKey)
                      throw Error(formatProdErrorMessage(137, tag));
                    break;
                  default:
                    propKey !== lastProp && setProp(
                      domElement,
                      tag,
                      propKey$201,
                      propKey,
                      nextProps,
                      lastProp
                    );
                }
            }
            updateInput(
              domElement,
              value2,
              defaultValue,
              lastDefaultValue,
              checked,
              defaultChecked,
              type,
              name2
            );
            return;
          case "select":
            propKey = value2 = defaultValue = propKey$201 = null;
            for (type in lastProps)
              if (lastDefaultValue = lastProps[type], lastProps.hasOwnProperty(type) && null != lastDefaultValue)
                switch (type) {
                  case "value":
                    break;
                  case "multiple":
                    propKey = lastDefaultValue;
                  default:
                    nextProps.hasOwnProperty(type) || setProp(
                      domElement,
                      tag,
                      type,
                      null,
                      nextProps,
                      lastDefaultValue
                    );
                }
            for (name2 in nextProps)
              if (type = nextProps[name2], lastDefaultValue = lastProps[name2], nextProps.hasOwnProperty(name2) && (null != type || null != lastDefaultValue))
                switch (name2) {
                  case "value":
                    propKey$201 = type;
                    break;
                  case "defaultValue":
                    defaultValue = type;
                    break;
                  case "multiple":
                    value2 = type;
                  default:
                    type !== lastDefaultValue && setProp(
                      domElement,
                      tag,
                      name2,
                      type,
                      nextProps,
                      lastDefaultValue
                    );
                }
            tag = defaultValue;
            lastProps = value2;
            nextProps = propKey;
            null != propKey$201 ? updateOptions(domElement, !!lastProps, propKey$201, false) : !!nextProps !== !!lastProps && (null != tag ? updateOptions(domElement, !!lastProps, tag, true) : updateOptions(domElement, !!lastProps, lastProps ? [] : "", false));
            return;
          case "textarea":
            propKey = propKey$201 = null;
            for (defaultValue in lastProps)
              if (name2 = lastProps[defaultValue], lastProps.hasOwnProperty(defaultValue) && null != name2 && !nextProps.hasOwnProperty(defaultValue))
                switch (defaultValue) {
                  case "value":
                    break;
                  case "children":
                    break;
                  default:
                    setProp(domElement, tag, defaultValue, null, nextProps, name2);
                }
            for (value2 in nextProps)
              if (name2 = nextProps[value2], type = lastProps[value2], nextProps.hasOwnProperty(value2) && (null != name2 || null != type))
                switch (value2) {
                  case "value":
                    propKey$201 = name2;
                    break;
                  case "defaultValue":
                    propKey = name2;
                    break;
                  case "children":
                    break;
                  case "dangerouslySetInnerHTML":
                    if (null != name2) throw Error(formatProdErrorMessage(91));
                    break;
                  default:
                    name2 !== type && setProp(domElement, tag, value2, name2, nextProps, type);
                }
            updateTextarea(domElement, propKey$201, propKey);
            return;
          case "option":
            for (var propKey$217 in lastProps)
              if (propKey$201 = lastProps[propKey$217], lastProps.hasOwnProperty(propKey$217) && null != propKey$201 && !nextProps.hasOwnProperty(propKey$217))
                switch (propKey$217) {
                  case "selected":
                    domElement.selected = false;
                    break;
                  default:
                    setProp(
                      domElement,
                      tag,
                      propKey$217,
                      null,
                      nextProps,
                      propKey$201
                    );
                }
            for (lastDefaultValue in nextProps)
              if (propKey$201 = nextProps[lastDefaultValue], propKey = lastProps[lastDefaultValue], nextProps.hasOwnProperty(lastDefaultValue) && propKey$201 !== propKey && (null != propKey$201 || null != propKey))
                switch (lastDefaultValue) {
                  case "selected":
                    domElement.selected = propKey$201 && "function" !== typeof propKey$201 && "symbol" !== typeof propKey$201;
                    break;
                  default:
                    setProp(
                      domElement,
                      tag,
                      lastDefaultValue,
                      propKey$201,
                      nextProps,
                      propKey
                    );
                }
            return;
          case "img":
          case "link":
          case "area":
          case "base":
          case "br":
          case "col":
          case "embed":
          case "hr":
          case "keygen":
          case "meta":
          case "param":
          case "source":
          case "track":
          case "wbr":
          case "menuitem":
            for (var propKey$222 in lastProps)
              propKey$201 = lastProps[propKey$222], lastProps.hasOwnProperty(propKey$222) && null != propKey$201 && !nextProps.hasOwnProperty(propKey$222) && setProp(domElement, tag, propKey$222, null, nextProps, propKey$201);
            for (checked in nextProps)
              if (propKey$201 = nextProps[checked], propKey = lastProps[checked], nextProps.hasOwnProperty(checked) && propKey$201 !== propKey && (null != propKey$201 || null != propKey))
                switch (checked) {
                  case "children":
                  case "dangerouslySetInnerHTML":
                    if (null != propKey$201)
                      throw Error(formatProdErrorMessage(137, tag));
                    break;
                  default:
                    setProp(
                      domElement,
                      tag,
                      checked,
                      propKey$201,
                      nextProps,
                      propKey
                    );
                }
            return;
          default:
            if (isCustomElement(tag)) {
              for (var propKey$227 in lastProps)
                propKey$201 = lastProps[propKey$227], lastProps.hasOwnProperty(propKey$227) && void 0 !== propKey$201 && !nextProps.hasOwnProperty(propKey$227) && setPropOnCustomElement(
                  domElement,
                  tag,
                  propKey$227,
                  void 0,
                  nextProps,
                  propKey$201
                );
              for (defaultChecked in nextProps)
                propKey$201 = nextProps[defaultChecked], propKey = lastProps[defaultChecked], !nextProps.hasOwnProperty(defaultChecked) || propKey$201 === propKey || void 0 === propKey$201 && void 0 === propKey || setPropOnCustomElement(
                  domElement,
                  tag,
                  defaultChecked,
                  propKey$201,
                  nextProps,
                  propKey
                );
              return;
            }
        }
        for (var propKey$232 in lastProps)
          propKey$201 = lastProps[propKey$232], lastProps.hasOwnProperty(propKey$232) && null != propKey$201 && !nextProps.hasOwnProperty(propKey$232) && setProp(domElement, tag, propKey$232, null, nextProps, propKey$201);
        for (lastProp in nextProps)
          propKey$201 = nextProps[lastProp], propKey = lastProps[lastProp], !nextProps.hasOwnProperty(lastProp) || propKey$201 === propKey || null == propKey$201 && null == propKey || setProp(domElement, tag, lastProp, propKey$201, nextProps, propKey);
      }
      function isLikelyStaticResource(initiatorType) {
        switch (initiatorType) {
          case "css":
          case "script":
          case "font":
          case "img":
          case "image":
          case "input":
          case "link":
            return true;
          default:
            return false;
        }
      }
      function estimateBandwidth() {
        if ("function" === typeof performance.getEntriesByType) {
          for (var count = 0, bits2 = 0, resourceEntries = performance.getEntriesByType("resource"), i2 = 0; i2 < resourceEntries.length; i2++) {
            var entry = resourceEntries[i2], transferSize = entry.transferSize, initiatorType = entry.initiatorType, duration = entry.duration;
            if (transferSize && duration && isLikelyStaticResource(initiatorType)) {
              initiatorType = 0;
              duration = entry.responseEnd;
              for (i2 += 1; i2 < resourceEntries.length; i2++) {
                var overlapEntry = resourceEntries[i2], overlapStartTime = overlapEntry.startTime;
                if (overlapStartTime > duration) break;
                var overlapTransferSize = overlapEntry.transferSize, overlapInitiatorType = overlapEntry.initiatorType;
                overlapTransferSize && isLikelyStaticResource(overlapInitiatorType) && (overlapEntry = overlapEntry.responseEnd, initiatorType += overlapTransferSize * (overlapEntry < duration ? 1 : (duration - overlapStartTime) / (overlapEntry - overlapStartTime)));
              }
              --i2;
              bits2 += 8 * (transferSize + initiatorType) / (entry.duration / 1e3);
              count++;
              if (10 < count) break;
            }
          }
          if (0 < count) return bits2 / count / 1e6;
        }
        return navigator.connection && (count = navigator.connection.downlink, "number" === typeof count) ? count : 5;
      }
      var eventsEnabled = null, selectionInformation = null;
      function getOwnerDocumentFromRootContainer(rootContainerElement) {
        return 9 === rootContainerElement.nodeType ? rootContainerElement : rootContainerElement.ownerDocument;
      }
      function getOwnHostContext(namespaceURI) {
        switch (namespaceURI) {
          case "http://www.w3.org/2000/svg":
            return 1;
          case "http://www.w3.org/1998/Math/MathML":
            return 2;
          default:
            return 0;
        }
      }
      function getChildHostContextProd(parentNamespace, type) {
        if (0 === parentNamespace)
          switch (type) {
            case "svg":
              return 1;
            case "math":
              return 2;
            default:
              return 0;
          }
        return 1 === parentNamespace && "foreignObject" === type ? 0 : parentNamespace;
      }
      function shouldSetTextContent(type, props) {
        return "textarea" === type || "noscript" === type || "string" === typeof props.children || "number" === typeof props.children || "bigint" === typeof props.children || "object" === typeof props.dangerouslySetInnerHTML && null !== props.dangerouslySetInnerHTML && null != props.dangerouslySetInnerHTML.__html;
      }
      var currentPopstateTransitionEvent = null;
      function shouldAttemptEagerTransition() {
        var event = window.event;
        if (event && "popstate" === event.type) {
          if (event === currentPopstateTransitionEvent) return false;
          currentPopstateTransitionEvent = event;
          return true;
        }
        currentPopstateTransitionEvent = null;
        return false;
      }
      var scheduleTimeout = "function" === typeof setTimeout ? setTimeout : void 0, cancelTimeout = "function" === typeof clearTimeout ? clearTimeout : void 0, localPromise = "function" === typeof Promise ? Promise : void 0, scheduleMicrotask = "function" === typeof queueMicrotask ? queueMicrotask : "undefined" !== typeof localPromise ? function(callback) {
        return localPromise.resolve(null).then(callback).catch(handleErrorInNextTick);
      } : scheduleTimeout;
      function handleErrorInNextTick(error2) {
        setTimeout(function() {
          throw error2;
        });
      }
      function isSingletonScope(type) {
        return "head" === type;
      }
      function clearHydrationBoundary(parentInstance, hydrationInstance) {
        var node2 = hydrationInstance, depth = 0;
        do {
          var nextNode = node2.nextSibling;
          parentInstance.removeChild(node2);
          if (nextNode && 8 === nextNode.nodeType)
            if (node2 = nextNode.data, "/$" === node2 || "/&" === node2) {
              if (0 === depth) {
                parentInstance.removeChild(nextNode);
                retryIfBlockedOn(hydrationInstance);
                return;
              }
              depth--;
            } else if ("$" === node2 || "$?" === node2 || "$~" === node2 || "$!" === node2 || "&" === node2)
              depth++;
            else if ("html" === node2)
              releaseSingletonInstance(parentInstance.ownerDocument.documentElement);
            else if ("head" === node2) {
              node2 = parentInstance.ownerDocument.head;
              releaseSingletonInstance(node2);
              for (var node$jscomp$0 = node2.firstChild; node$jscomp$0; ) {
                var nextNode$jscomp$0 = node$jscomp$0.nextSibling, nodeName = node$jscomp$0.nodeName;
                node$jscomp$0[internalHoistableMarker] || "SCRIPT" === nodeName || "STYLE" === nodeName || "LINK" === nodeName && "stylesheet" === node$jscomp$0.rel.toLowerCase() || node2.removeChild(node$jscomp$0);
                node$jscomp$0 = nextNode$jscomp$0;
              }
            } else
              "body" === node2 && releaseSingletonInstance(parentInstance.ownerDocument.body);
          node2 = nextNode;
        } while (node2);
        retryIfBlockedOn(hydrationInstance);
      }
      function hideOrUnhideDehydratedBoundary(suspenseInstance, isHidden) {
        var node2 = suspenseInstance;
        suspenseInstance = 0;
        do {
          var nextNode = node2.nextSibling;
          1 === node2.nodeType ? isHidden ? (node2._stashedDisplay = node2.style.display, node2.style.display = "none") : (node2.style.display = node2._stashedDisplay || "", "" === node2.getAttribute("style") && node2.removeAttribute("style")) : 3 === node2.nodeType && (isHidden ? (node2._stashedText = node2.nodeValue, node2.nodeValue = "") : node2.nodeValue = node2._stashedText || "");
          if (nextNode && 8 === nextNode.nodeType)
            if (node2 = nextNode.data, "/$" === node2)
              if (0 === suspenseInstance) break;
              else suspenseInstance--;
            else
              "$" !== node2 && "$?" !== node2 && "$~" !== node2 && "$!" !== node2 || suspenseInstance++;
          node2 = nextNode;
        } while (node2);
      }
      function clearContainerSparingly(container2) {
        var nextNode = container2.firstChild;
        nextNode && 10 === nextNode.nodeType && (nextNode = nextNode.nextSibling);
        for (; nextNode; ) {
          var node2 = nextNode;
          nextNode = nextNode.nextSibling;
          switch (node2.nodeName) {
            case "HTML":
            case "HEAD":
            case "BODY":
              clearContainerSparingly(node2);
              detachDeletedInstance(node2);
              continue;
            case "SCRIPT":
            case "STYLE":
              continue;
            case "LINK":
              if ("stylesheet" === node2.rel.toLowerCase()) continue;
          }
          container2.removeChild(node2);
        }
      }
      function canHydrateInstance(instance, type, props, inRootOrSingleton) {
        for (; 1 === instance.nodeType; ) {
          var anyProps = props;
          if (instance.nodeName.toLowerCase() !== type.toLowerCase()) {
            if (!inRootOrSingleton && ("INPUT" !== instance.nodeName || "hidden" !== instance.type))
              break;
          } else if (!inRootOrSingleton)
            if ("input" === type && "hidden" === instance.type) {
              var name2 = null == anyProps.name ? null : "" + anyProps.name;
              if ("hidden" === anyProps.type && instance.getAttribute("name") === name2)
                return instance;
            } else return instance;
          else if (!instance[internalHoistableMarker])
            switch (type) {
              case "meta":
                if (!instance.hasAttribute("itemprop")) break;
                return instance;
              case "link":
                name2 = instance.getAttribute("rel");
                if ("stylesheet" === name2 && instance.hasAttribute("data-precedence"))
                  break;
                else if (name2 !== anyProps.rel || instance.getAttribute("href") !== (null == anyProps.href || "" === anyProps.href ? null : anyProps.href) || instance.getAttribute("crossorigin") !== (null == anyProps.crossOrigin ? null : anyProps.crossOrigin) || instance.getAttribute("title") !== (null == anyProps.title ? null : anyProps.title))
                  break;
                return instance;
              case "style":
                if (instance.hasAttribute("data-precedence")) break;
                return instance;
              case "script":
                name2 = instance.getAttribute("src");
                if ((name2 !== (null == anyProps.src ? null : anyProps.src) || instance.getAttribute("type") !== (null == anyProps.type ? null : anyProps.type) || instance.getAttribute("crossorigin") !== (null == anyProps.crossOrigin ? null : anyProps.crossOrigin)) && name2 && instance.hasAttribute("async") && !instance.hasAttribute("itemprop"))
                  break;
                return instance;
              default:
                return instance;
            }
          instance = getNextHydratable(instance.nextSibling);
          if (null === instance) break;
        }
        return null;
      }
      function canHydrateTextInstance(instance, text2, inRootOrSingleton) {
        if ("" === text2) return null;
        for (; 3 !== instance.nodeType; ) {
          if ((1 !== instance.nodeType || "INPUT" !== instance.nodeName || "hidden" !== instance.type) && !inRootOrSingleton)
            return null;
          instance = getNextHydratable(instance.nextSibling);
          if (null === instance) return null;
        }
        return instance;
      }
      function canHydrateHydrationBoundary(instance, inRootOrSingleton) {
        for (; 8 !== instance.nodeType; ) {
          if ((1 !== instance.nodeType || "INPUT" !== instance.nodeName || "hidden" !== instance.type) && !inRootOrSingleton)
            return null;
          instance = getNextHydratable(instance.nextSibling);
          if (null === instance) return null;
        }
        return instance;
      }
      function isSuspenseInstancePending(instance) {
        return "$?" === instance.data || "$~" === instance.data;
      }
      function isSuspenseInstanceFallback(instance) {
        return "$!" === instance.data || "$?" === instance.data && "loading" !== instance.ownerDocument.readyState;
      }
      function registerSuspenseInstanceRetry(instance, callback) {
        var ownerDocument = instance.ownerDocument;
        if ("$~" === instance.data) instance._reactRetry = callback;
        else if ("$?" !== instance.data || "loading" !== ownerDocument.readyState)
          callback();
        else {
          var listener = function() {
            callback();
            ownerDocument.removeEventListener("DOMContentLoaded", listener);
          };
          ownerDocument.addEventListener("DOMContentLoaded", listener);
          instance._reactRetry = listener;
        }
      }
      function getNextHydratable(node2) {
        for (; null != node2; node2 = node2.nextSibling) {
          var nodeType = node2.nodeType;
          if (1 === nodeType || 3 === nodeType) break;
          if (8 === nodeType) {
            nodeType = node2.data;
            if ("$" === nodeType || "$!" === nodeType || "$?" === nodeType || "$~" === nodeType || "&" === nodeType || "F!" === nodeType || "F" === nodeType)
              break;
            if ("/$" === nodeType || "/&" === nodeType) return null;
          }
        }
        return node2;
      }
      var previousHydratableOnEnteringScopedSingleton = null;
      function getNextHydratableInstanceAfterHydrationBoundary(hydrationInstance) {
        hydrationInstance = hydrationInstance.nextSibling;
        for (var depth = 0; hydrationInstance; ) {
          if (8 === hydrationInstance.nodeType) {
            var data = hydrationInstance.data;
            if ("/$" === data || "/&" === data) {
              if (0 === depth)
                return getNextHydratable(hydrationInstance.nextSibling);
              depth--;
            } else
              "$" !== data && "$!" !== data && "$?" !== data && "$~" !== data && "&" !== data || depth++;
          }
          hydrationInstance = hydrationInstance.nextSibling;
        }
        return null;
      }
      function getParentHydrationBoundary(targetInstance) {
        targetInstance = targetInstance.previousSibling;
        for (var depth = 0; targetInstance; ) {
          if (8 === targetInstance.nodeType) {
            var data = targetInstance.data;
            if ("$" === data || "$!" === data || "$?" === data || "$~" === data || "&" === data) {
              if (0 === depth) return targetInstance;
              depth--;
            } else "/$" !== data && "/&" !== data || depth++;
          }
          targetInstance = targetInstance.previousSibling;
        }
        return null;
      }
      function resolveSingletonInstance(type, props, rootContainerInstance) {
        props = getOwnerDocumentFromRootContainer(rootContainerInstance);
        switch (type) {
          case "html":
            type = props.documentElement;
            if (!type) throw Error(formatProdErrorMessage(452));
            return type;
          case "head":
            type = props.head;
            if (!type) throw Error(formatProdErrorMessage(453));
            return type;
          case "body":
            type = props.body;
            if (!type) throw Error(formatProdErrorMessage(454));
            return type;
          default:
            throw Error(formatProdErrorMessage(451));
        }
      }
      function releaseSingletonInstance(instance) {
        for (var attributes2 = instance.attributes; attributes2.length; )
          instance.removeAttributeNode(attributes2[0]);
        detachDeletedInstance(instance);
      }
      var preloadPropsMap = /* @__PURE__ */ new Map(), preconnectsSet = /* @__PURE__ */ new Set();
      function getHoistableRoot(container2) {
        return "function" === typeof container2.getRootNode ? container2.getRootNode() : 9 === container2.nodeType ? container2 : container2.ownerDocument;
      }
      var previousDispatcher = ReactDOMSharedInternals.d;
      ReactDOMSharedInternals.d = {
        f: flushSyncWork,
        r: requestFormReset,
        D: prefetchDNS,
        C: preconnect,
        L: preload,
        m: preloadModule,
        X: preinitScript,
        S: preinitStyle,
        M: preinitModuleScript
      };
      function flushSyncWork() {
        var previousWasRendering = previousDispatcher.f(), wasRendering = flushSyncWork$1();
        return previousWasRendering || wasRendering;
      }
      function requestFormReset(form) {
        var formInst = getInstanceFromNode(form);
        null !== formInst && 5 === formInst.tag && "form" === formInst.type ? requestFormReset$1(formInst) : previousDispatcher.r(form);
      }
      var globalDocument = "undefined" === typeof document ? null : document;
      function preconnectAs(rel, href, crossOrigin) {
        var ownerDocument = globalDocument;
        if (ownerDocument && "string" === typeof href && href) {
          var limitedEscapedHref = escapeSelectorAttributeValueInsideDoubleQuotes(href);
          limitedEscapedHref = 'link[rel="' + rel + '"][href="' + limitedEscapedHref + '"]';
          "string" === typeof crossOrigin && (limitedEscapedHref += '[crossorigin="' + crossOrigin + '"]');
          preconnectsSet.has(limitedEscapedHref) || (preconnectsSet.add(limitedEscapedHref), rel = { rel, crossOrigin, href }, null === ownerDocument.querySelector(limitedEscapedHref) && (href = ownerDocument.createElement("link"), setInitialProperties(href, "link", rel), markNodeAsHoistable(href), ownerDocument.head.appendChild(href)));
        }
      }
      function prefetchDNS(href) {
        previousDispatcher.D(href);
        preconnectAs("dns-prefetch", href, null);
      }
      function preconnect(href, crossOrigin) {
        previousDispatcher.C(href, crossOrigin);
        preconnectAs("preconnect", href, crossOrigin);
      }
      function preload(href, as, options3) {
        previousDispatcher.L(href, as, options3);
        var ownerDocument = globalDocument;
        if (ownerDocument && href && as) {
          var preloadSelector = 'link[rel="preload"][as="' + escapeSelectorAttributeValueInsideDoubleQuotes(as) + '"]';
          "image" === as ? options3 && options3.imageSrcSet ? (preloadSelector += '[imagesrcset="' + escapeSelectorAttributeValueInsideDoubleQuotes(
            options3.imageSrcSet
          ) + '"]', "string" === typeof options3.imageSizes && (preloadSelector += '[imagesizes="' + escapeSelectorAttributeValueInsideDoubleQuotes(
            options3.imageSizes
          ) + '"]')) : preloadSelector += '[href="' + escapeSelectorAttributeValueInsideDoubleQuotes(href) + '"]' : preloadSelector += '[href="' + escapeSelectorAttributeValueInsideDoubleQuotes(href) + '"]';
          var key2 = preloadSelector;
          switch (as) {
            case "style":
              key2 = getStyleKey(href);
              break;
            case "script":
              key2 = getScriptKey(href);
          }
          preloadPropsMap.has(key2) || (href = assign2(
            {
              rel: "preload",
              href: "image" === as && options3 && options3.imageSrcSet ? void 0 : href,
              as
            },
            options3
          ), preloadPropsMap.set(key2, href), null !== ownerDocument.querySelector(preloadSelector) || "style" === as && ownerDocument.querySelector(getStylesheetSelectorFromKey(key2)) || "script" === as && ownerDocument.querySelector(getScriptSelectorFromKey(key2)) || (as = ownerDocument.createElement("link"), setInitialProperties(as, "link", href), markNodeAsHoistable(as), ownerDocument.head.appendChild(as)));
        }
      }
      function preloadModule(href, options3) {
        previousDispatcher.m(href, options3);
        var ownerDocument = globalDocument;
        if (ownerDocument && href) {
          var as = options3 && "string" === typeof options3.as ? options3.as : "script", preloadSelector = 'link[rel="modulepreload"][as="' + escapeSelectorAttributeValueInsideDoubleQuotes(as) + '"][href="' + escapeSelectorAttributeValueInsideDoubleQuotes(href) + '"]', key2 = preloadSelector;
          switch (as) {
            case "audioworklet":
            case "paintworklet":
            case "serviceworker":
            case "sharedworker":
            case "worker":
            case "script":
              key2 = getScriptKey(href);
          }
          if (!preloadPropsMap.has(key2) && (href = assign2({ rel: "modulepreload", href }, options3), preloadPropsMap.set(key2, href), null === ownerDocument.querySelector(preloadSelector))) {
            switch (as) {
              case "audioworklet":
              case "paintworklet":
              case "serviceworker":
              case "sharedworker":
              case "worker":
              case "script":
                if (ownerDocument.querySelector(getScriptSelectorFromKey(key2)))
                  return;
            }
            as = ownerDocument.createElement("link");
            setInitialProperties(as, "link", href);
            markNodeAsHoistable(as);
            ownerDocument.head.appendChild(as);
          }
        }
      }
      function preinitStyle(href, precedence, options3) {
        previousDispatcher.S(href, precedence, options3);
        var ownerDocument = globalDocument;
        if (ownerDocument && href) {
          var styles2 = getResourcesFromRoot(ownerDocument).hoistableStyles, key2 = getStyleKey(href);
          precedence = precedence || "default";
          var resource = styles2.get(key2);
          if (!resource) {
            var state = { loading: 0, preload: null };
            if (resource = ownerDocument.querySelector(
              getStylesheetSelectorFromKey(key2)
            ))
              state.loading = 5;
            else {
              href = assign2(
                { rel: "stylesheet", href, "data-precedence": precedence },
                options3
              );
              (options3 = preloadPropsMap.get(key2)) && adoptPreloadPropsForStylesheet(href, options3);
              var link2 = resource = ownerDocument.createElement("link");
              markNodeAsHoistable(link2);
              setInitialProperties(link2, "link", href);
              link2._p = new Promise(function(resolve, reject) {
                link2.onload = resolve;
                link2.onerror = reject;
              });
              link2.addEventListener("load", function() {
                state.loading |= 1;
              });
              link2.addEventListener("error", function() {
                state.loading |= 2;
              });
              state.loading |= 4;
              insertStylesheet(resource, precedence, ownerDocument);
            }
            resource = {
              type: "stylesheet",
              instance: resource,
              count: 1,
              state
            };
            styles2.set(key2, resource);
          }
        }
      }
      function preinitScript(src, options3) {
        previousDispatcher.X(src, options3);
        var ownerDocument = globalDocument;
        if (ownerDocument && src) {
          var scripts = getResourcesFromRoot(ownerDocument).hoistableScripts, key2 = getScriptKey(src), resource = scripts.get(key2);
          resource || (resource = ownerDocument.querySelector(getScriptSelectorFromKey(key2)), resource || (src = assign2({ src, async: true }, options3), (options3 = preloadPropsMap.get(key2)) && adoptPreloadPropsForScript(src, options3), resource = ownerDocument.createElement("script"), markNodeAsHoistable(resource), setInitialProperties(resource, "link", src), ownerDocument.head.appendChild(resource)), resource = {
            type: "script",
            instance: resource,
            count: 1,
            state: null
          }, scripts.set(key2, resource));
        }
      }
      function preinitModuleScript(src, options3) {
        previousDispatcher.M(src, options3);
        var ownerDocument = globalDocument;
        if (ownerDocument && src) {
          var scripts = getResourcesFromRoot(ownerDocument).hoistableScripts, key2 = getScriptKey(src), resource = scripts.get(key2);
          resource || (resource = ownerDocument.querySelector(getScriptSelectorFromKey(key2)), resource || (src = assign2({ src, async: true, type: "module" }, options3), (options3 = preloadPropsMap.get(key2)) && adoptPreloadPropsForScript(src, options3), resource = ownerDocument.createElement("script"), markNodeAsHoistable(resource), setInitialProperties(resource, "link", src), ownerDocument.head.appendChild(resource)), resource = {
            type: "script",
            instance: resource,
            count: 1,
            state: null
          }, scripts.set(key2, resource));
        }
      }
      function getResource(type, currentProps, pendingProps, currentResource) {
        var JSCompiler_inline_result = (JSCompiler_inline_result = rootInstanceStackCursor.current) ? getHoistableRoot(JSCompiler_inline_result) : null;
        if (!JSCompiler_inline_result) throw Error(formatProdErrorMessage(446));
        switch (type) {
          case "meta":
          case "title":
            return null;
          case "style":
            return "string" === typeof pendingProps.precedence && "string" === typeof pendingProps.href ? (currentProps = getStyleKey(pendingProps.href), pendingProps = getResourcesFromRoot(
              JSCompiler_inline_result
            ).hoistableStyles, currentResource = pendingProps.get(currentProps), currentResource || (currentResource = {
              type: "style",
              instance: null,
              count: 0,
              state: null
            }, pendingProps.set(currentProps, currentResource)), currentResource) : { type: "void", instance: null, count: 0, state: null };
          case "link":
            if ("stylesheet" === pendingProps.rel && "string" === typeof pendingProps.href && "string" === typeof pendingProps.precedence) {
              type = getStyleKey(pendingProps.href);
              var styles$243 = getResourcesFromRoot(
                JSCompiler_inline_result
              ).hoistableStyles, resource$244 = styles$243.get(type);
              resource$244 || (JSCompiler_inline_result = JSCompiler_inline_result.ownerDocument || JSCompiler_inline_result, resource$244 = {
                type: "stylesheet",
                instance: null,
                count: 0,
                state: { loading: 0, preload: null }
              }, styles$243.set(type, resource$244), (styles$243 = JSCompiler_inline_result.querySelector(
                getStylesheetSelectorFromKey(type)
              )) && !styles$243._p && (resource$244.instance = styles$243, resource$244.state.loading = 5), preloadPropsMap.has(type) || (pendingProps = {
                rel: "preload",
                as: "style",
                href: pendingProps.href,
                crossOrigin: pendingProps.crossOrigin,
                integrity: pendingProps.integrity,
                media: pendingProps.media,
                hrefLang: pendingProps.hrefLang,
                referrerPolicy: pendingProps.referrerPolicy
              }, preloadPropsMap.set(type, pendingProps), styles$243 || preloadStylesheet(
                JSCompiler_inline_result,
                type,
                pendingProps,
                resource$244.state
              )));
              if (currentProps && null === currentResource)
                throw Error(formatProdErrorMessage(528, ""));
              return resource$244;
            }
            if (currentProps && null !== currentResource)
              throw Error(formatProdErrorMessage(529, ""));
            return null;
          case "script":
            return currentProps = pendingProps.async, pendingProps = pendingProps.src, "string" === typeof pendingProps && currentProps && "function" !== typeof currentProps && "symbol" !== typeof currentProps ? (currentProps = getScriptKey(pendingProps), pendingProps = getResourcesFromRoot(
              JSCompiler_inline_result
            ).hoistableScripts, currentResource = pendingProps.get(currentProps), currentResource || (currentResource = {
              type: "script",
              instance: null,
              count: 0,
              state: null
            }, pendingProps.set(currentProps, currentResource)), currentResource) : { type: "void", instance: null, count: 0, state: null };
          default:
            throw Error(formatProdErrorMessage(444, type));
        }
      }
      function getStyleKey(href) {
        return 'href="' + escapeSelectorAttributeValueInsideDoubleQuotes(href) + '"';
      }
      function getStylesheetSelectorFromKey(key2) {
        return 'link[rel="stylesheet"][' + key2 + "]";
      }
      function stylesheetPropsFromRawProps(rawProps) {
        return assign2({}, rawProps, {
          "data-precedence": rawProps.precedence,
          precedence: null
        });
      }
      function preloadStylesheet(ownerDocument, key2, preloadProps, state) {
        ownerDocument.querySelector('link[rel="preload"][as="style"][' + key2 + "]") ? state.loading = 1 : (key2 = ownerDocument.createElement("link"), state.preload = key2, key2.addEventListener("load", function() {
          return state.loading |= 1;
        }), key2.addEventListener("error", function() {
          return state.loading |= 2;
        }), setInitialProperties(key2, "link", preloadProps), markNodeAsHoistable(key2), ownerDocument.head.appendChild(key2));
      }
      function getScriptKey(src) {
        return '[src="' + escapeSelectorAttributeValueInsideDoubleQuotes(src) + '"]';
      }
      function getScriptSelectorFromKey(key2) {
        return "script[async]" + key2;
      }
      function acquireResource(hoistableRoot, resource, props) {
        resource.count++;
        if (null === resource.instance)
          switch (resource.type) {
            case "style":
              var instance = hoistableRoot.querySelector(
                'style[data-href~="' + escapeSelectorAttributeValueInsideDoubleQuotes(props.href) + '"]'
              );
              if (instance)
                return resource.instance = instance, markNodeAsHoistable(instance), instance;
              var styleProps = assign2({}, props, {
                "data-href": props.href,
                "data-precedence": props.precedence,
                href: null,
                precedence: null
              });
              instance = (hoistableRoot.ownerDocument || hoistableRoot).createElement(
                "style"
              );
              markNodeAsHoistable(instance);
              setInitialProperties(instance, "style", styleProps);
              insertStylesheet(instance, props.precedence, hoistableRoot);
              return resource.instance = instance;
            case "stylesheet":
              styleProps = getStyleKey(props.href);
              var instance$249 = hoistableRoot.querySelector(
                getStylesheetSelectorFromKey(styleProps)
              );
              if (instance$249)
                return resource.state.loading |= 4, resource.instance = instance$249, markNodeAsHoistable(instance$249), instance$249;
              instance = stylesheetPropsFromRawProps(props);
              (styleProps = preloadPropsMap.get(styleProps)) && adoptPreloadPropsForStylesheet(instance, styleProps);
              instance$249 = (hoistableRoot.ownerDocument || hoistableRoot).createElement("link");
              markNodeAsHoistable(instance$249);
              var linkInstance = instance$249;
              linkInstance._p = new Promise(function(resolve, reject) {
                linkInstance.onload = resolve;
                linkInstance.onerror = reject;
              });
              setInitialProperties(instance$249, "link", instance);
              resource.state.loading |= 4;
              insertStylesheet(instance$249, props.precedence, hoistableRoot);
              return resource.instance = instance$249;
            case "script":
              instance$249 = getScriptKey(props.src);
              if (styleProps = hoistableRoot.querySelector(
                getScriptSelectorFromKey(instance$249)
              ))
                return resource.instance = styleProps, markNodeAsHoistable(styleProps), styleProps;
              instance = props;
              if (styleProps = preloadPropsMap.get(instance$249))
                instance = assign2({}, props), adoptPreloadPropsForScript(instance, styleProps);
              hoistableRoot = hoistableRoot.ownerDocument || hoistableRoot;
              styleProps = hoistableRoot.createElement("script");
              markNodeAsHoistable(styleProps);
              setInitialProperties(styleProps, "link", instance);
              hoistableRoot.head.appendChild(styleProps);
              return resource.instance = styleProps;
            case "void":
              return null;
            default:
              throw Error(formatProdErrorMessage(443, resource.type));
          }
        else
          "stylesheet" === resource.type && 0 === (resource.state.loading & 4) && (instance = resource.instance, resource.state.loading |= 4, insertStylesheet(instance, props.precedence, hoistableRoot));
        return resource.instance;
      }
      function insertStylesheet(instance, precedence, root3) {
        for (var nodes = root3.querySelectorAll(
          'link[rel="stylesheet"][data-precedence],style[data-precedence]'
        ), last = nodes.length ? nodes[nodes.length - 1] : null, prior = last, i2 = 0; i2 < nodes.length; i2++) {
          var node2 = nodes[i2];
          if (node2.dataset.precedence === precedence) prior = node2;
          else if (prior !== last) break;
        }
        prior ? prior.parentNode.insertBefore(instance, prior.nextSibling) : (precedence = 9 === root3.nodeType ? root3.head : root3, precedence.insertBefore(instance, precedence.firstChild));
      }
      function adoptPreloadPropsForStylesheet(stylesheetProps, preloadProps) {
        null == stylesheetProps.crossOrigin && (stylesheetProps.crossOrigin = preloadProps.crossOrigin);
        null == stylesheetProps.referrerPolicy && (stylesheetProps.referrerPolicy = preloadProps.referrerPolicy);
        null == stylesheetProps.title && (stylesheetProps.title = preloadProps.title);
      }
      function adoptPreloadPropsForScript(scriptProps, preloadProps) {
        null == scriptProps.crossOrigin && (scriptProps.crossOrigin = preloadProps.crossOrigin);
        null == scriptProps.referrerPolicy && (scriptProps.referrerPolicy = preloadProps.referrerPolicy);
        null == scriptProps.integrity && (scriptProps.integrity = preloadProps.integrity);
      }
      var tagCaches = null;
      function getHydratableHoistableCache(type, keyAttribute, ownerDocument) {
        if (null === tagCaches) {
          var cache = /* @__PURE__ */ new Map();
          var caches = tagCaches = /* @__PURE__ */ new Map();
          caches.set(ownerDocument, cache);
        } else
          caches = tagCaches, cache = caches.get(ownerDocument), cache || (cache = /* @__PURE__ */ new Map(), caches.set(ownerDocument, cache));
        if (cache.has(type)) return cache;
        cache.set(type, null);
        ownerDocument = ownerDocument.getElementsByTagName(type);
        for (caches = 0; caches < ownerDocument.length; caches++) {
          var node2 = ownerDocument[caches];
          if (!(node2[internalHoistableMarker] || node2[internalInstanceKey] || "link" === type && "stylesheet" === node2.getAttribute("rel")) && "http://www.w3.org/2000/svg" !== node2.namespaceURI) {
            var nodeKey = node2.getAttribute(keyAttribute) || "";
            nodeKey = type + nodeKey;
            var existing = cache.get(nodeKey);
            existing ? existing.push(node2) : cache.set(nodeKey, [node2]);
          }
        }
        return cache;
      }
      function mountHoistable(hoistableRoot, type, instance) {
        hoistableRoot = hoistableRoot.ownerDocument || hoistableRoot;
        hoistableRoot.head.insertBefore(
          instance,
          "title" === type ? hoistableRoot.querySelector("head > title") : null
        );
      }
      function isHostHoistableType(type, props, hostContext) {
        if (1 === hostContext || null != props.itemProp) return false;
        switch (type) {
          case "meta":
          case "title":
            return true;
          case "style":
            if ("string" !== typeof props.precedence || "string" !== typeof props.href || "" === props.href)
              break;
            return true;
          case "link":
            if ("string" !== typeof props.rel || "string" !== typeof props.href || "" === props.href || props.onLoad || props.onError)
              break;
            switch (props.rel) {
              case "stylesheet":
                return type = props.disabled, "string" === typeof props.precedence && null == type;
              default:
                return true;
            }
          case "script":
            if (props.async && "function" !== typeof props.async && "symbol" !== typeof props.async && !props.onLoad && !props.onError && props.src && "string" === typeof props.src)
              return true;
        }
        return false;
      }
      function preloadResource(resource) {
        return "stylesheet" === resource.type && 0 === (resource.state.loading & 3) ? false : true;
      }
      function suspendResource(state, hoistableRoot, resource, props) {
        if ("stylesheet" === resource.type && ("string" !== typeof props.media || false !== matchMedia(props.media).matches) && 0 === (resource.state.loading & 4)) {
          if (null === resource.instance) {
            var key2 = getStyleKey(props.href), instance = hoistableRoot.querySelector(
              getStylesheetSelectorFromKey(key2)
            );
            if (instance) {
              hoistableRoot = instance._p;
              null !== hoistableRoot && "object" === typeof hoistableRoot && "function" === typeof hoistableRoot.then && (state.count++, state = onUnsuspend.bind(state), hoistableRoot.then(state, state));
              resource.state.loading |= 4;
              resource.instance = instance;
              markNodeAsHoistable(instance);
              return;
            }
            instance = hoistableRoot.ownerDocument || hoistableRoot;
            props = stylesheetPropsFromRawProps(props);
            (key2 = preloadPropsMap.get(key2)) && adoptPreloadPropsForStylesheet(props, key2);
            instance = instance.createElement("link");
            markNodeAsHoistable(instance);
            var linkInstance = instance;
            linkInstance._p = new Promise(function(resolve, reject) {
              linkInstance.onload = resolve;
              linkInstance.onerror = reject;
            });
            setInitialProperties(instance, "link", props);
            resource.instance = instance;
          }
          null === state.stylesheets && (state.stylesheets = /* @__PURE__ */ new Map());
          state.stylesheets.set(resource, hoistableRoot);
          (hoistableRoot = resource.state.preload) && 0 === (resource.state.loading & 3) && (state.count++, resource = onUnsuspend.bind(state), hoistableRoot.addEventListener("load", resource), hoistableRoot.addEventListener("error", resource));
        }
      }
      var estimatedBytesWithinLimit = 0;
      function waitForCommitToBeReady(state, timeoutOffset) {
        state.stylesheets && 0 === state.count && insertSuspendedStylesheets(state, state.stylesheets);
        return 0 < state.count || 0 < state.imgCount ? function(commit) {
          var stylesheetTimer = setTimeout(function() {
            state.stylesheets && insertSuspendedStylesheets(state, state.stylesheets);
            if (state.unsuspend) {
              var unsuspend = state.unsuspend;
              state.unsuspend = null;
              unsuspend();
            }
          }, 6e4 + timeoutOffset);
          0 < state.imgBytes && 0 === estimatedBytesWithinLimit && (estimatedBytesWithinLimit = 62500 * estimateBandwidth());
          var imgTimer = setTimeout(
            function() {
              state.waitingForImages = false;
              if (0 === state.count && (state.stylesheets && insertSuspendedStylesheets(state, state.stylesheets), state.unsuspend)) {
                var unsuspend = state.unsuspend;
                state.unsuspend = null;
                unsuspend();
              }
            },
            (state.imgBytes > estimatedBytesWithinLimit ? 50 : 800) + timeoutOffset
          );
          state.unsuspend = commit;
          return function() {
            state.unsuspend = null;
            clearTimeout(stylesheetTimer);
            clearTimeout(imgTimer);
          };
        } : null;
      }
      function onUnsuspend() {
        this.count--;
        if (0 === this.count && (0 === this.imgCount || !this.waitingForImages)) {
          if (this.stylesheets) insertSuspendedStylesheets(this, this.stylesheets);
          else if (this.unsuspend) {
            var unsuspend = this.unsuspend;
            this.unsuspend = null;
            unsuspend();
          }
        }
      }
      var precedencesByRoot = null;
      function insertSuspendedStylesheets(state, resources) {
        state.stylesheets = null;
        null !== state.unsuspend && (state.count++, precedencesByRoot = /* @__PURE__ */ new Map(), resources.forEach(insertStylesheetIntoRoot, state), precedencesByRoot = null, onUnsuspend.call(state));
      }
      function insertStylesheetIntoRoot(root3, resource) {
        if (!(resource.state.loading & 4)) {
          var precedences = precedencesByRoot.get(root3);
          if (precedences) var last = precedences.get(null);
          else {
            precedences = /* @__PURE__ */ new Map();
            precedencesByRoot.set(root3, precedences);
            for (var nodes = root3.querySelectorAll(
              "link[data-precedence],style[data-precedence]"
            ), i2 = 0; i2 < nodes.length; i2++) {
              var node2 = nodes[i2];
              if ("LINK" === node2.nodeName || "not all" !== node2.getAttribute("media"))
                precedences.set(node2.dataset.precedence, node2), last = node2;
            }
            last && precedences.set(null, last);
          }
          nodes = resource.instance;
          node2 = nodes.getAttribute("data-precedence");
          i2 = precedences.get(node2) || last;
          i2 === last && precedences.set(null, nodes);
          precedences.set(node2, nodes);
          this.count++;
          last = onUnsuspend.bind(this);
          nodes.addEventListener("load", last);
          nodes.addEventListener("error", last);
          i2 ? i2.parentNode.insertBefore(nodes, i2.nextSibling) : (root3 = 9 === root3.nodeType ? root3.head : root3, root3.insertBefore(nodes, root3.firstChild));
          resource.state.loading |= 4;
        }
      }
      var HostTransitionContext = {
        $$typeof: REACT_CONTEXT_TYPE,
        Provider: null,
        Consumer: null,
        _currentValue: sharedNotPendingObject,
        _currentValue2: sharedNotPendingObject,
        _threadCount: 0
      };
      function FiberRootNode(containerInfo, tag, hydrate, identifierPrefix, onUncaughtError, onCaughtError, onRecoverableError, onDefaultTransitionIndicator, formState) {
        this.tag = 1;
        this.containerInfo = containerInfo;
        this.pingCache = this.current = this.pendingChildren = null;
        this.timeoutHandle = -1;
        this.callbackNode = this.next = this.pendingContext = this.context = this.cancelPendingCommit = null;
        this.callbackPriority = 0;
        this.expirationTimes = createLaneMap(-1);
        this.entangledLanes = this.shellSuspendCounter = this.errorRecoveryDisabledLanes = this.expiredLanes = this.warmLanes = this.pingedLanes = this.suspendedLanes = this.pendingLanes = 0;
        this.entanglements = createLaneMap(0);
        this.hiddenUpdates = createLaneMap(null);
        this.identifierPrefix = identifierPrefix;
        this.onUncaughtError = onUncaughtError;
        this.onCaughtError = onCaughtError;
        this.onRecoverableError = onRecoverableError;
        this.pooledCache = null;
        this.pooledCacheLanes = 0;
        this.formState = formState;
        this.incompleteTransitions = /* @__PURE__ */ new Map();
      }
      function createFiberRoot(containerInfo, tag, hydrate, initialChildren, hydrationCallbacks, isStrictMode, identifierPrefix, formState, onUncaughtError, onCaughtError, onRecoverableError, onDefaultTransitionIndicator) {
        containerInfo = new FiberRootNode(
          containerInfo,
          tag,
          hydrate,
          identifierPrefix,
          onUncaughtError,
          onCaughtError,
          onRecoverableError,
          onDefaultTransitionIndicator,
          formState
        );
        tag = 1;
        true === isStrictMode && (tag |= 24);
        isStrictMode = createFiberImplClass(3, null, null, tag);
        containerInfo.current = isStrictMode;
        isStrictMode.stateNode = containerInfo;
        tag = createCache();
        tag.refCount++;
        containerInfo.pooledCache = tag;
        tag.refCount++;
        isStrictMode.memoizedState = {
          element: initialChildren,
          isDehydrated: hydrate,
          cache: tag
        };
        initializeUpdateQueue(isStrictMode);
        return containerInfo;
      }
      function getContextForSubtree(parentComponent) {
        if (!parentComponent) return emptyContextObject;
        parentComponent = emptyContextObject;
        return parentComponent;
      }
      function updateContainerImpl(rootFiber, lane, element, container2, parentComponent, callback) {
        parentComponent = getContextForSubtree(parentComponent);
        null === container2.context ? container2.context = parentComponent : container2.pendingContext = parentComponent;
        container2 = createUpdate(lane);
        container2.payload = { element };
        callback = void 0 === callback ? null : callback;
        null !== callback && (container2.callback = callback);
        element = enqueueUpdate(rootFiber, container2, lane);
        null !== element && (scheduleUpdateOnFiber(element, rootFiber, lane), entangleTransitions(element, rootFiber, lane));
      }
      function markRetryLaneImpl(fiber, retryLane) {
        fiber = fiber.memoizedState;
        if (null !== fiber && null !== fiber.dehydrated) {
          var a = fiber.retryLane;
          fiber.retryLane = 0 !== a && a < retryLane ? a : retryLane;
        }
      }
      function markRetryLaneIfNotHydrated(fiber, retryLane) {
        markRetryLaneImpl(fiber, retryLane);
        (fiber = fiber.alternate) && markRetryLaneImpl(fiber, retryLane);
      }
      function attemptContinuousHydration(fiber) {
        if (13 === fiber.tag || 31 === fiber.tag) {
          var root3 = enqueueConcurrentRenderForLane(fiber, 67108864);
          null !== root3 && scheduleUpdateOnFiber(root3, fiber, 67108864);
          markRetryLaneIfNotHydrated(fiber, 67108864);
        }
      }
      function attemptHydrationAtCurrentPriority(fiber) {
        if (13 === fiber.tag || 31 === fiber.tag) {
          var lane = requestUpdateLane();
          lane = getBumpedLaneForHydrationByLane(lane);
          var root3 = enqueueConcurrentRenderForLane(fiber, lane);
          null !== root3 && scheduleUpdateOnFiber(root3, fiber, lane);
          markRetryLaneIfNotHydrated(fiber, lane);
        }
      }
      var _enabled = true;
      function dispatchDiscreteEvent(domEventName, eventSystemFlags, container2, nativeEvent) {
        var prevTransition = ReactSharedInternals.T;
        ReactSharedInternals.T = null;
        var previousPriority = ReactDOMSharedInternals.p;
        try {
          ReactDOMSharedInternals.p = 2, dispatchEvent2(domEventName, eventSystemFlags, container2, nativeEvent);
        } finally {
          ReactDOMSharedInternals.p = previousPriority, ReactSharedInternals.T = prevTransition;
        }
      }
      function dispatchContinuousEvent(domEventName, eventSystemFlags, container2, nativeEvent) {
        var prevTransition = ReactSharedInternals.T;
        ReactSharedInternals.T = null;
        var previousPriority = ReactDOMSharedInternals.p;
        try {
          ReactDOMSharedInternals.p = 8, dispatchEvent2(domEventName, eventSystemFlags, container2, nativeEvent);
        } finally {
          ReactDOMSharedInternals.p = previousPriority, ReactSharedInternals.T = prevTransition;
        }
      }
      function dispatchEvent2(domEventName, eventSystemFlags, targetContainer, nativeEvent) {
        if (_enabled) {
          var blockedOn = findInstanceBlockingEvent(nativeEvent);
          if (null === blockedOn)
            dispatchEventForPluginEventSystem(
              domEventName,
              eventSystemFlags,
              nativeEvent,
              return_targetInst,
              targetContainer
            ), clearIfContinuousEvent(domEventName, nativeEvent);
          else if (queueIfContinuousEvent(
            blockedOn,
            domEventName,
            eventSystemFlags,
            targetContainer,
            nativeEvent
          ))
            nativeEvent.stopPropagation();
          else if (clearIfContinuousEvent(domEventName, nativeEvent), eventSystemFlags & 4 && -1 < discreteReplayableEvents.indexOf(domEventName)) {
            for (; null !== blockedOn; ) {
              var fiber = getInstanceFromNode(blockedOn);
              if (null !== fiber)
                switch (fiber.tag) {
                  case 3:
                    fiber = fiber.stateNode;
                    if (fiber.current.memoizedState.isDehydrated) {
                      var lanes = getHighestPriorityLanes(fiber.pendingLanes);
                      if (0 !== lanes) {
                        var root3 = fiber;
                        root3.pendingLanes |= 2;
                        for (root3.entangledLanes |= 2; lanes; ) {
                          var lane = 1 << 31 - clz32(lanes);
                          root3.entanglements[1] |= lane;
                          lanes &= ~lane;
                        }
                        ensureRootIsScheduled(fiber);
                        0 === (executionContext & 6) && (workInProgressRootRenderTargetTime = now() + 500, flushSyncWorkAcrossRoots_impl(0));
                      }
                    }
                    break;
                  case 31:
                  case 13:
                    root3 = enqueueConcurrentRenderForLane(fiber, 2), null !== root3 && scheduleUpdateOnFiber(root3, fiber, 2), flushSyncWork$1(), markRetryLaneIfNotHydrated(fiber, 2);
                }
              fiber = findInstanceBlockingEvent(nativeEvent);
              null === fiber && dispatchEventForPluginEventSystem(
                domEventName,
                eventSystemFlags,
                nativeEvent,
                return_targetInst,
                targetContainer
              );
              if (fiber === blockedOn) break;
              blockedOn = fiber;
            }
            null !== blockedOn && nativeEvent.stopPropagation();
          } else
            dispatchEventForPluginEventSystem(
              domEventName,
              eventSystemFlags,
              nativeEvent,
              null,
              targetContainer
            );
        }
      }
      function findInstanceBlockingEvent(nativeEvent) {
        nativeEvent = getEventTarget(nativeEvent);
        return findInstanceBlockingTarget(nativeEvent);
      }
      var return_targetInst = null;
      function findInstanceBlockingTarget(targetNode) {
        return_targetInst = null;
        targetNode = getClosestInstanceFromNode(targetNode);
        if (null !== targetNode) {
          var nearestMounted = getNearestMountedFiber(targetNode);
          if (null === nearestMounted) targetNode = null;
          else {
            var tag = nearestMounted.tag;
            if (13 === tag) {
              targetNode = getSuspenseInstanceFromFiber(nearestMounted);
              if (null !== targetNode) return targetNode;
              targetNode = null;
            } else if (31 === tag) {
              targetNode = getActivityInstanceFromFiber(nearestMounted);
              if (null !== targetNode) return targetNode;
              targetNode = null;
            } else if (3 === tag) {
              if (nearestMounted.stateNode.current.memoizedState.isDehydrated)
                return 3 === nearestMounted.tag ? nearestMounted.stateNode.containerInfo : null;
              targetNode = null;
            } else nearestMounted !== targetNode && (targetNode = null);
          }
        }
        return_targetInst = targetNode;
        return null;
      }
      function getEventPriority(domEventName) {
        switch (domEventName) {
          case "beforetoggle":
          case "cancel":
          case "click":
          case "close":
          case "contextmenu":
          case "copy":
          case "cut":
          case "auxclick":
          case "dblclick":
          case "dragend":
          case "dragstart":
          case "drop":
          case "focusin":
          case "focusout":
          case "input":
          case "invalid":
          case "keydown":
          case "keypress":
          case "keyup":
          case "mousedown":
          case "mouseup":
          case "paste":
          case "pause":
          case "play":
          case "pointercancel":
          case "pointerdown":
          case "pointerup":
          case "ratechange":
          case "reset":
          case "resize":
          case "seeked":
          case "submit":
          case "toggle":
          case "touchcancel":
          case "touchend":
          case "touchstart":
          case "volumechange":
          case "change":
          case "selectionchange":
          case "textInput":
          case "compositionstart":
          case "compositionend":
          case "compositionupdate":
          case "beforeblur":
          case "afterblur":
          case "beforeinput":
          case "blur":
          case "fullscreenchange":
          case "focus":
          case "hashchange":
          case "popstate":
          case "select":
          case "selectstart":
            return 2;
          case "drag":
          case "dragenter":
          case "dragexit":
          case "dragleave":
          case "dragover":
          case "mousemove":
          case "mouseout":
          case "mouseover":
          case "pointermove":
          case "pointerout":
          case "pointerover":
          case "scroll":
          case "touchmove":
          case "wheel":
          case "mouseenter":
          case "mouseleave":
          case "pointerenter":
          case "pointerleave":
            return 8;
          case "message":
            switch (getCurrentPriorityLevel()) {
              case ImmediatePriority:
                return 2;
              case UserBlockingPriority:
                return 8;
              case NormalPriority$1:
              case LowPriority:
                return 32;
              case IdlePriority:
                return 268435456;
              default:
                return 32;
            }
          default:
            return 32;
        }
      }
      var hasScheduledReplayAttempt = false, queuedFocus = null, queuedDrag = null, queuedMouse = null, queuedPointers = /* @__PURE__ */ new Map(), queuedPointerCaptures = /* @__PURE__ */ new Map(), queuedExplicitHydrationTargets = [], discreteReplayableEvents = "mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(
        " "
      );
      function clearIfContinuousEvent(domEventName, nativeEvent) {
        switch (domEventName) {
          case "focusin":
          case "focusout":
            queuedFocus = null;
            break;
          case "dragenter":
          case "dragleave":
            queuedDrag = null;
            break;
          case "mouseover":
          case "mouseout":
            queuedMouse = null;
            break;
          case "pointerover":
          case "pointerout":
            queuedPointers.delete(nativeEvent.pointerId);
            break;
          case "gotpointercapture":
          case "lostpointercapture":
            queuedPointerCaptures.delete(nativeEvent.pointerId);
        }
      }
      function accumulateOrCreateContinuousQueuedReplayableEvent(existingQueuedEvent, blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent) {
        if (null === existingQueuedEvent || existingQueuedEvent.nativeEvent !== nativeEvent)
          return existingQueuedEvent = {
            blockedOn,
            domEventName,
            eventSystemFlags,
            nativeEvent,
            targetContainers: [targetContainer]
          }, null !== blockedOn && (blockedOn = getInstanceFromNode(blockedOn), null !== blockedOn && attemptContinuousHydration(blockedOn)), existingQueuedEvent;
        existingQueuedEvent.eventSystemFlags |= eventSystemFlags;
        blockedOn = existingQueuedEvent.targetContainers;
        null !== targetContainer && -1 === blockedOn.indexOf(targetContainer) && blockedOn.push(targetContainer);
        return existingQueuedEvent;
      }
      function queueIfContinuousEvent(blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent) {
        switch (domEventName) {
          case "focusin":
            return queuedFocus = accumulateOrCreateContinuousQueuedReplayableEvent(
              queuedFocus,
              blockedOn,
              domEventName,
              eventSystemFlags,
              targetContainer,
              nativeEvent
            ), true;
          case "dragenter":
            return queuedDrag = accumulateOrCreateContinuousQueuedReplayableEvent(
              queuedDrag,
              blockedOn,
              domEventName,
              eventSystemFlags,
              targetContainer,
              nativeEvent
            ), true;
          case "mouseover":
            return queuedMouse = accumulateOrCreateContinuousQueuedReplayableEvent(
              queuedMouse,
              blockedOn,
              domEventName,
              eventSystemFlags,
              targetContainer,
              nativeEvent
            ), true;
          case "pointerover":
            var pointerId = nativeEvent.pointerId;
            queuedPointers.set(
              pointerId,
              accumulateOrCreateContinuousQueuedReplayableEvent(
                queuedPointers.get(pointerId) || null,
                blockedOn,
                domEventName,
                eventSystemFlags,
                targetContainer,
                nativeEvent
              )
            );
            return true;
          case "gotpointercapture":
            return pointerId = nativeEvent.pointerId, queuedPointerCaptures.set(
              pointerId,
              accumulateOrCreateContinuousQueuedReplayableEvent(
                queuedPointerCaptures.get(pointerId) || null,
                blockedOn,
                domEventName,
                eventSystemFlags,
                targetContainer,
                nativeEvent
              )
            ), true;
        }
        return false;
      }
      function attemptExplicitHydrationTarget(queuedTarget) {
        var targetInst = getClosestInstanceFromNode(queuedTarget.target);
        if (null !== targetInst) {
          var nearestMounted = getNearestMountedFiber(targetInst);
          if (null !== nearestMounted) {
            if (targetInst = nearestMounted.tag, 13 === targetInst) {
              if (targetInst = getSuspenseInstanceFromFiber(nearestMounted), null !== targetInst) {
                queuedTarget.blockedOn = targetInst;
                runWithPriority(queuedTarget.priority, function() {
                  attemptHydrationAtCurrentPriority(nearestMounted);
                });
                return;
              }
            } else if (31 === targetInst) {
              if (targetInst = getActivityInstanceFromFiber(nearestMounted), null !== targetInst) {
                queuedTarget.blockedOn = targetInst;
                runWithPriority(queuedTarget.priority, function() {
                  attemptHydrationAtCurrentPriority(nearestMounted);
                });
                return;
              }
            } else if (3 === targetInst && nearestMounted.stateNode.current.memoizedState.isDehydrated) {
              queuedTarget.blockedOn = 3 === nearestMounted.tag ? nearestMounted.stateNode.containerInfo : null;
              return;
            }
          }
        }
        queuedTarget.blockedOn = null;
      }
      function attemptReplayContinuousQueuedEvent(queuedEvent) {
        if (null !== queuedEvent.blockedOn) return false;
        for (var targetContainers = queuedEvent.targetContainers; 0 < targetContainers.length; ) {
          var nextBlockedOn = findInstanceBlockingEvent(queuedEvent.nativeEvent);
          if (null === nextBlockedOn) {
            nextBlockedOn = queuedEvent.nativeEvent;
            var nativeEventClone = new nextBlockedOn.constructor(
              nextBlockedOn.type,
              nextBlockedOn
            );
            currentReplayingEvent = nativeEventClone;
            nextBlockedOn.target.dispatchEvent(nativeEventClone);
            currentReplayingEvent = null;
          } else
            return targetContainers = getInstanceFromNode(nextBlockedOn), null !== targetContainers && attemptContinuousHydration(targetContainers), queuedEvent.blockedOn = nextBlockedOn, false;
          targetContainers.shift();
        }
        return true;
      }
      function attemptReplayContinuousQueuedEventInMap(queuedEvent, key2, map2) {
        attemptReplayContinuousQueuedEvent(queuedEvent) && map2.delete(key2);
      }
      function replayUnblockedEvents() {
        hasScheduledReplayAttempt = false;
        null !== queuedFocus && attemptReplayContinuousQueuedEvent(queuedFocus) && (queuedFocus = null);
        null !== queuedDrag && attemptReplayContinuousQueuedEvent(queuedDrag) && (queuedDrag = null);
        null !== queuedMouse && attemptReplayContinuousQueuedEvent(queuedMouse) && (queuedMouse = null);
        queuedPointers.forEach(attemptReplayContinuousQueuedEventInMap);
        queuedPointerCaptures.forEach(attemptReplayContinuousQueuedEventInMap);
      }
      function scheduleCallbackIfUnblocked(queuedEvent, unblocked) {
        queuedEvent.blockedOn === unblocked && (queuedEvent.blockedOn = null, hasScheduledReplayAttempt || (hasScheduledReplayAttempt = true, Scheduler.unstable_scheduleCallback(
          Scheduler.unstable_NormalPriority,
          replayUnblockedEvents
        )));
      }
      var lastScheduledReplayQueue = null;
      function scheduleReplayQueueIfNeeded(formReplayingQueue) {
        lastScheduledReplayQueue !== formReplayingQueue && (lastScheduledReplayQueue = formReplayingQueue, Scheduler.unstable_scheduleCallback(
          Scheduler.unstable_NormalPriority,
          function() {
            lastScheduledReplayQueue === formReplayingQueue && (lastScheduledReplayQueue = null);
            for (var i2 = 0; i2 < formReplayingQueue.length; i2 += 3) {
              var form = formReplayingQueue[i2], submitterOrAction = formReplayingQueue[i2 + 1], formData = formReplayingQueue[i2 + 2];
              if ("function" !== typeof submitterOrAction)
                if (null === findInstanceBlockingTarget(submitterOrAction || form))
                  continue;
                else break;
              var formInst = getInstanceFromNode(form);
              null !== formInst && (formReplayingQueue.splice(i2, 3), i2 -= 3, startHostTransition(
                formInst,
                {
                  pending: true,
                  data: formData,
                  method: form.method,
                  action: submitterOrAction
                },
                submitterOrAction,
                formData
              ));
            }
          }
        ));
      }
      function retryIfBlockedOn(unblocked) {
        function unblock(queuedEvent) {
          return scheduleCallbackIfUnblocked(queuedEvent, unblocked);
        }
        null !== queuedFocus && scheduleCallbackIfUnblocked(queuedFocus, unblocked);
        null !== queuedDrag && scheduleCallbackIfUnblocked(queuedDrag, unblocked);
        null !== queuedMouse && scheduleCallbackIfUnblocked(queuedMouse, unblocked);
        queuedPointers.forEach(unblock);
        queuedPointerCaptures.forEach(unblock);
        for (var i2 = 0; i2 < queuedExplicitHydrationTargets.length; i2++) {
          var queuedTarget = queuedExplicitHydrationTargets[i2];
          queuedTarget.blockedOn === unblocked && (queuedTarget.blockedOn = null);
        }
        for (; 0 < queuedExplicitHydrationTargets.length && (i2 = queuedExplicitHydrationTargets[0], null === i2.blockedOn); )
          attemptExplicitHydrationTarget(i2), null === i2.blockedOn && queuedExplicitHydrationTargets.shift();
        i2 = (unblocked.ownerDocument || unblocked).$$reactFormReplay;
        if (null != i2)
          for (queuedTarget = 0; queuedTarget < i2.length; queuedTarget += 3) {
            var form = i2[queuedTarget], submitterOrAction = i2[queuedTarget + 1], formProps = form[internalPropsKey] || null;
            if ("function" === typeof submitterOrAction)
              formProps || scheduleReplayQueueIfNeeded(i2);
            else if (formProps) {
              var action = null;
              if (submitterOrAction && submitterOrAction.hasAttribute("formAction"))
                if (form = submitterOrAction, formProps = submitterOrAction[internalPropsKey] || null)
                  action = formProps.formAction;
                else {
                  if (null !== findInstanceBlockingTarget(form)) continue;
                }
              else action = formProps.action;
              "function" === typeof action ? i2[queuedTarget + 1] = action : (i2.splice(queuedTarget, 3), queuedTarget -= 3);
              scheduleReplayQueueIfNeeded(i2);
            }
          }
      }
      function defaultOnDefaultTransitionIndicator() {
        function handleNavigate(event) {
          event.canIntercept && "react-transition" === event.info && event.intercept({
            handler: function() {
              return new Promise(function(resolve) {
                return pendingResolve = resolve;
              });
            },
            focusReset: "manual",
            scroll: "manual"
          });
        }
        function handleNavigateComplete() {
          null !== pendingResolve && (pendingResolve(), pendingResolve = null);
          isCancelled || setTimeout(startFakeNavigation, 20);
        }
        function startFakeNavigation() {
          if (!isCancelled && !navigation.transition) {
            var currentEntry = navigation.currentEntry;
            currentEntry && null != currentEntry.url && navigation.navigate(currentEntry.url, {
              state: currentEntry.getState(),
              info: "react-transition",
              history: "replace"
            });
          }
        }
        if ("object" === typeof navigation) {
          var isCancelled = false, pendingResolve = null;
          navigation.addEventListener("navigate", handleNavigate);
          navigation.addEventListener("navigatesuccess", handleNavigateComplete);
          navigation.addEventListener("navigateerror", handleNavigateComplete);
          setTimeout(startFakeNavigation, 100);
          return function() {
            isCancelled = true;
            navigation.removeEventListener("navigate", handleNavigate);
            navigation.removeEventListener("navigatesuccess", handleNavigateComplete);
            navigation.removeEventListener("navigateerror", handleNavigateComplete);
            null !== pendingResolve && (pendingResolve(), pendingResolve = null);
          };
        }
      }
      function ReactDOMRoot(internalRoot) {
        this._internalRoot = internalRoot;
      }
      ReactDOMHydrationRoot.prototype.render = ReactDOMRoot.prototype.render = function(children2) {
        var root3 = this._internalRoot;
        if (null === root3) throw Error(formatProdErrorMessage(409));
        var current2 = root3.current, lane = requestUpdateLane();
        updateContainerImpl(current2, lane, children2, root3, null, null);
      };
      ReactDOMHydrationRoot.prototype.unmount = ReactDOMRoot.prototype.unmount = function() {
        var root3 = this._internalRoot;
        if (null !== root3) {
          this._internalRoot = null;
          var container2 = root3.containerInfo;
          updateContainerImpl(root3.current, 2, null, root3, null, null);
          flushSyncWork$1();
          container2[internalContainerInstanceKey] = null;
        }
      };
      function ReactDOMHydrationRoot(internalRoot) {
        this._internalRoot = internalRoot;
      }
      ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function(target2) {
        if (target2) {
          var updatePriority = resolveUpdatePriority();
          target2 = { blockedOn: null, target: target2, priority: updatePriority };
          for (var i2 = 0; i2 < queuedExplicitHydrationTargets.length && 0 !== updatePriority && updatePriority < queuedExplicitHydrationTargets[i2].priority; i2++) ;
          queuedExplicitHydrationTargets.splice(i2, 0, target2);
          0 === i2 && attemptExplicitHydrationTarget(target2);
        }
      };
      var isomorphicReactPackageVersion$jscomp$inline_1840 = React.version;
      if ("19.2.3" !== isomorphicReactPackageVersion$jscomp$inline_1840)
        throw Error(
          formatProdErrorMessage(
            527,
            isomorphicReactPackageVersion$jscomp$inline_1840,
            "19.2.3"
          )
        );
      ReactDOMSharedInternals.findDOMNode = function(componentOrElement) {
        var fiber = componentOrElement._reactInternals;
        if (void 0 === fiber) {
          if ("function" === typeof componentOrElement.render)
            throw Error(formatProdErrorMessage(188));
          componentOrElement = Object.keys(componentOrElement).join(",");
          throw Error(formatProdErrorMessage(268, componentOrElement));
        }
        componentOrElement = findCurrentFiberUsingSlowPath(fiber);
        componentOrElement = null !== componentOrElement ? findCurrentHostFiberImpl(componentOrElement) : null;
        componentOrElement = null === componentOrElement ? null : componentOrElement.stateNode;
        return componentOrElement;
      };
      var internals$jscomp$inline_2347 = {
        bundleType: 0,
        version: "19.2.3",
        rendererPackageName: "react-dom",
        currentDispatcherRef: ReactSharedInternals,
        reconcilerVersion: "19.2.3"
      };
      if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
        var hook$jscomp$inline_2348 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
        if (!hook$jscomp$inline_2348.isDisabled && hook$jscomp$inline_2348.supportsFiber)
          try {
            rendererID = hook$jscomp$inline_2348.inject(
              internals$jscomp$inline_2347
            ), injectedHook = hook$jscomp$inline_2348;
          } catch (err2) {
          }
      }
      reactDomClient_production.createRoot = function(container2, options3) {
        if (!isValidContainer(container2)) throw Error(formatProdErrorMessage(299));
        var isStrictMode = false, identifierPrefix = "", onUncaughtError = defaultOnUncaughtError, onCaughtError = defaultOnCaughtError, onRecoverableError = defaultOnRecoverableError;
        null !== options3 && void 0 !== options3 && (true === options3.unstable_strictMode && (isStrictMode = true), void 0 !== options3.identifierPrefix && (identifierPrefix = options3.identifierPrefix), void 0 !== options3.onUncaughtError && (onUncaughtError = options3.onUncaughtError), void 0 !== options3.onCaughtError && (onCaughtError = options3.onCaughtError), void 0 !== options3.onRecoverableError && (onRecoverableError = options3.onRecoverableError));
        options3 = createFiberRoot(
          container2,
          1,
          false,
          null,
          null,
          isStrictMode,
          identifierPrefix,
          null,
          onUncaughtError,
          onCaughtError,
          onRecoverableError,
          defaultOnDefaultTransitionIndicator
        );
        container2[internalContainerInstanceKey] = options3.current;
        listenToAllSupportedEvents(container2);
        return new ReactDOMRoot(options3);
      };
      reactDomClient_production.hydrateRoot = function(container2, initialChildren, options3) {
        if (!isValidContainer(container2)) throw Error(formatProdErrorMessage(299));
        var isStrictMode = false, identifierPrefix = "", onUncaughtError = defaultOnUncaughtError, onCaughtError = defaultOnCaughtError, onRecoverableError = defaultOnRecoverableError, formState = null;
        null !== options3 && void 0 !== options3 && (true === options3.unstable_strictMode && (isStrictMode = true), void 0 !== options3.identifierPrefix && (identifierPrefix = options3.identifierPrefix), void 0 !== options3.onUncaughtError && (onUncaughtError = options3.onUncaughtError), void 0 !== options3.onCaughtError && (onCaughtError = options3.onCaughtError), void 0 !== options3.onRecoverableError && (onRecoverableError = options3.onRecoverableError), void 0 !== options3.formState && (formState = options3.formState));
        initialChildren = createFiberRoot(
          container2,
          1,
          true,
          initialChildren,
          null != options3 ? options3 : null,
          isStrictMode,
          identifierPrefix,
          formState,
          onUncaughtError,
          onCaughtError,
          onRecoverableError,
          defaultOnDefaultTransitionIndicator
        );
        initialChildren.context = getContextForSubtree(null);
        options3 = initialChildren.current;
        isStrictMode = requestUpdateLane();
        isStrictMode = getBumpedLaneForHydrationByLane(isStrictMode);
        identifierPrefix = createUpdate(isStrictMode);
        identifierPrefix.callback = null;
        enqueueUpdate(options3, identifierPrefix, isStrictMode);
        options3 = isStrictMode;
        initialChildren.current.lanes = options3;
        markRootUpdated$1(initialChildren, options3);
        ensureRootIsScheduled(initialChildren);
        container2[internalContainerInstanceKey] = initialChildren.current;
        listenToAllSupportedEvents(container2);
        return new ReactDOMHydrationRoot(initialChildren);
      };
      reactDomClient_production.version = "19.2.3";
      return reactDomClient_production;
    }
    var hasRequiredClient$1;
    function requireClient$1() {
      if (hasRequiredClient$1) return client$1.exports;
      hasRequiredClient$1 = 1;
      function checkDCE() {
        if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === "undefined" || typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE !== "function") {
          return;
        }
        try {
          __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE);
        } catch (err2) {
          console.error(err2);
        }
      }
      {
        checkDCE();
        client$1.exports = requireReactDomClient_production();
      }
      return client$1.exports;
    }
    var clientExports = requireClient$1();
    var Space_Separator = /[\u1680\u2000-\u200A\u202F\u205F\u3000]/;
    var ID_Start = /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/;
    var ID_Continue = /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/;
    var unicode$1 = {
      Space_Separator,
      ID_Start,
      ID_Continue
    };
    var util = {
      isSpaceSeparator(c2) {
        return typeof c2 === "string" && unicode$1.Space_Separator.test(c2);
      },
      isIdStartChar(c2) {
        return typeof c2 === "string" && (c2 >= "a" && c2 <= "z" || c2 >= "A" && c2 <= "Z" || c2 === "$" || c2 === "_" || unicode$1.ID_Start.test(c2));
      },
      isIdContinueChar(c2) {
        return typeof c2 === "string" && (c2 >= "a" && c2 <= "z" || c2 >= "A" && c2 <= "Z" || c2 >= "0" && c2 <= "9" || c2 === "$" || c2 === "_" || c2 === "‌" || c2 === "‍" || unicode$1.ID_Continue.test(c2));
      },
      isDigit(c2) {
        return typeof c2 === "string" && /[0-9]/.test(c2);
      },
      isHexDigit(c2) {
        return typeof c2 === "string" && /[0-9A-Fa-f]/.test(c2);
      }
    };
    let source;
    let parseState;
    let stack;
    let pos;
    let line;
    let column;
    let token;
    let key$2;
    let root$2;
    var parse$6 = function parse2(text2, reviver) {
      source = String(text2);
      parseState = "start";
      stack = [];
      pos = 0;
      line = 1;
      column = 0;
      token = void 0;
      key$2 = void 0;
      root$2 = void 0;
      do {
        token = lex();
        parseStates[parseState]();
      } while (token.type !== "eof");
      if (typeof reviver === "function") {
        return internalize({ "": root$2 }, "", reviver);
      }
      return root$2;
    };
    function internalize(holder, name2, reviver) {
      const value2 = holder[name2];
      if (value2 != null && typeof value2 === "object") {
        if (Array.isArray(value2)) {
          for (let i2 = 0; i2 < value2.length; i2++) {
            const key2 = String(i2);
            const replacement = internalize(value2, key2, reviver);
            if (replacement === void 0) {
              delete value2[key2];
            } else {
              Object.defineProperty(value2, key2, {
                value: replacement,
                writable: true,
                enumerable: true,
                configurable: true
              });
            }
          }
        } else {
          for (const key2 in value2) {
            const replacement = internalize(value2, key2, reviver);
            if (replacement === void 0) {
              delete value2[key2];
            } else {
              Object.defineProperty(value2, key2, {
                value: replacement,
                writable: true,
                enumerable: true,
                configurable: true
              });
            }
          }
        }
      }
      return reviver.call(holder, name2, value2);
    }
    let lexState;
    let buffer$1;
    let doubleQuote;
    let sign;
    let c;
    function lex() {
      lexState = "default";
      buffer$1 = "";
      doubleQuote = false;
      sign = 1;
      for (; ; ) {
        c = peek$1();
        const token2 = lexStates[lexState]();
        if (token2) {
          return token2;
        }
      }
    }
    function peek$1() {
      if (source[pos]) {
        return String.fromCodePoint(source.codePointAt(pos));
      }
    }
    function read$1() {
      const c2 = peek$1();
      if (c2 === "\n") {
        line++;
        column = 0;
      } else if (c2) {
        column += c2.length;
      } else {
        column++;
      }
      if (c2) {
        pos += c2.length;
      }
      return c2;
    }
    const lexStates = {
      default() {
        switch (c) {
          case "	":
          case "\v":
          case "\f":
          case " ":
          case " ":
          case "\uFEFF":
          case "\n":
          case "\r":
          case "\u2028":
          case "\u2029":
            read$1();
            return;
          case "/":
            read$1();
            lexState = "comment";
            return;
          case void 0:
            read$1();
            return newToken("eof");
        }
        if (util.isSpaceSeparator(c)) {
          read$1();
          return;
        }
        return lexStates[parseState]();
      },
      comment() {
        switch (c) {
          case "*":
            read$1();
            lexState = "multiLineComment";
            return;
          case "/":
            read$1();
            lexState = "singleLineComment";
            return;
        }
        throw invalidChar(read$1());
      },
      multiLineComment() {
        switch (c) {
          case "*":
            read$1();
            lexState = "multiLineCommentAsterisk";
            return;
          case void 0:
            throw invalidChar(read$1());
        }
        read$1();
      },
      multiLineCommentAsterisk() {
        switch (c) {
          case "*":
            read$1();
            return;
          case "/":
            read$1();
            lexState = "default";
            return;
          case void 0:
            throw invalidChar(read$1());
        }
        read$1();
        lexState = "multiLineComment";
      },
      singleLineComment() {
        switch (c) {
          case "\n":
          case "\r":
          case "\u2028":
          case "\u2029":
            read$1();
            lexState = "default";
            return;
          case void 0:
            read$1();
            return newToken("eof");
        }
        read$1();
      },
      value() {
        switch (c) {
          case "{":
          case "[":
            return newToken("punctuator", read$1());
          case "n":
            read$1();
            literal$5("ull");
            return newToken("null", null);
          case "t":
            read$1();
            literal$5("rue");
            return newToken("boolean", true);
          case "f":
            read$1();
            literal$5("alse");
            return newToken("boolean", false);
          case "-":
          case "+":
            if (read$1() === "-") {
              sign = -1;
            }
            lexState = "sign";
            return;
          case ".":
            buffer$1 = read$1();
            lexState = "decimalPointLeading";
            return;
          case "0":
            buffer$1 = read$1();
            lexState = "zero";
            return;
          case "1":
          case "2":
          case "3":
          case "4":
          case "5":
          case "6":
          case "7":
          case "8":
          case "9":
            buffer$1 = read$1();
            lexState = "decimalInteger";
            return;
          case "I":
            read$1();
            literal$5("nfinity");
            return newToken("numeric", Infinity);
          case "N":
            read$1();
            literal$5("aN");
            return newToken("numeric", NaN);
          case '"':
          case "'":
            doubleQuote = read$1() === '"';
            buffer$1 = "";
            lexState = "string";
            return;
        }
        throw invalidChar(read$1());
      },
      identifierNameStartEscape() {
        if (c !== "u") {
          throw invalidChar(read$1());
        }
        read$1();
        const u = unicodeEscape();
        switch (u) {
          case "$":
          case "_":
            break;
          default:
            if (!util.isIdStartChar(u)) {
              throw invalidIdentifier();
            }
            break;
        }
        buffer$1 += u;
        lexState = "identifierName";
      },
      identifierName() {
        switch (c) {
          case "$":
          case "_":
          case "‌":
          case "‍":
            buffer$1 += read$1();
            return;
          case "\\":
            read$1();
            lexState = "identifierNameEscape";
            return;
        }
        if (util.isIdContinueChar(c)) {
          buffer$1 += read$1();
          return;
        }
        return newToken("identifier", buffer$1);
      },
      identifierNameEscape() {
        if (c !== "u") {
          throw invalidChar(read$1());
        }
        read$1();
        const u = unicodeEscape();
        switch (u) {
          case "$":
          case "_":
          case "‌":
          case "‍":
            break;
          default:
            if (!util.isIdContinueChar(u)) {
              throw invalidIdentifier();
            }
            break;
        }
        buffer$1 += u;
        lexState = "identifierName";
      },
      sign() {
        switch (c) {
          case ".":
            buffer$1 = read$1();
            lexState = "decimalPointLeading";
            return;
          case "0":
            buffer$1 = read$1();
            lexState = "zero";
            return;
          case "1":
          case "2":
          case "3":
          case "4":
          case "5":
          case "6":
          case "7":
          case "8":
          case "9":
            buffer$1 = read$1();
            lexState = "decimalInteger";
            return;
          case "I":
            read$1();
            literal$5("nfinity");
            return newToken("numeric", sign * Infinity);
          case "N":
            read$1();
            literal$5("aN");
            return newToken("numeric", NaN);
        }
        throw invalidChar(read$1());
      },
      zero() {
        switch (c) {
          case ".":
            buffer$1 += read$1();
            lexState = "decimalPoint";
            return;
          case "e":
          case "E":
            buffer$1 += read$1();
            lexState = "decimalExponent";
            return;
          case "x":
          case "X":
            buffer$1 += read$1();
            lexState = "hexadecimal";
            return;
        }
        return newToken("numeric", sign * 0);
      },
      decimalInteger() {
        switch (c) {
          case ".":
            buffer$1 += read$1();
            lexState = "decimalPoint";
            return;
          case "e":
          case "E":
            buffer$1 += read$1();
            lexState = "decimalExponent";
            return;
        }
        if (util.isDigit(c)) {
          buffer$1 += read$1();
          return;
        }
        return newToken("numeric", sign * Number(buffer$1));
      },
      decimalPointLeading() {
        if (util.isDigit(c)) {
          buffer$1 += read$1();
          lexState = "decimalFraction";
          return;
        }
        throw invalidChar(read$1());
      },
      decimalPoint() {
        switch (c) {
          case "e":
          case "E":
            buffer$1 += read$1();
            lexState = "decimalExponent";
            return;
        }
        if (util.isDigit(c)) {
          buffer$1 += read$1();
          lexState = "decimalFraction";
          return;
        }
        return newToken("numeric", sign * Number(buffer$1));
      },
      decimalFraction() {
        switch (c) {
          case "e":
          case "E":
            buffer$1 += read$1();
            lexState = "decimalExponent";
            return;
        }
        if (util.isDigit(c)) {
          buffer$1 += read$1();
          return;
        }
        return newToken("numeric", sign * Number(buffer$1));
      },
      decimalExponent() {
        switch (c) {
          case "+":
          case "-":
            buffer$1 += read$1();
            lexState = "decimalExponentSign";
            return;
        }
        if (util.isDigit(c)) {
          buffer$1 += read$1();
          lexState = "decimalExponentInteger";
          return;
        }
        throw invalidChar(read$1());
      },
      decimalExponentSign() {
        if (util.isDigit(c)) {
          buffer$1 += read$1();
          lexState = "decimalExponentInteger";
          return;
        }
        throw invalidChar(read$1());
      },
      decimalExponentInteger() {
        if (util.isDigit(c)) {
          buffer$1 += read$1();
          return;
        }
        return newToken("numeric", sign * Number(buffer$1));
      },
      hexadecimal() {
        if (util.isHexDigit(c)) {
          buffer$1 += read$1();
          lexState = "hexadecimalInteger";
          return;
        }
        throw invalidChar(read$1());
      },
      hexadecimalInteger() {
        if (util.isHexDigit(c)) {
          buffer$1 += read$1();
          return;
        }
        return newToken("numeric", sign * Number(buffer$1));
      },
      string() {
        switch (c) {
          case "\\":
            read$1();
            buffer$1 += escape$1();
            return;
          case '"':
            if (doubleQuote) {
              read$1();
              return newToken("string", buffer$1);
            }
            buffer$1 += read$1();
            return;
          case "'":
            if (!doubleQuote) {
              read$1();
              return newToken("string", buffer$1);
            }
            buffer$1 += read$1();
            return;
          case "\n":
          case "\r":
            throw invalidChar(read$1());
          case "\u2028":
          case "\u2029":
            separatorChar(c);
            break;
          case void 0:
            throw invalidChar(read$1());
        }
        buffer$1 += read$1();
      },
      start() {
        switch (c) {
          case "{":
          case "[":
            return newToken("punctuator", read$1());
        }
        lexState = "value";
      },
      beforePropertyName() {
        switch (c) {
          case "$":
          case "_":
            buffer$1 = read$1();
            lexState = "identifierName";
            return;
          case "\\":
            read$1();
            lexState = "identifierNameStartEscape";
            return;
          case "}":
            return newToken("punctuator", read$1());
          case '"':
          case "'":
            doubleQuote = read$1() === '"';
            lexState = "string";
            return;
        }
        if (util.isIdStartChar(c)) {
          buffer$1 += read$1();
          lexState = "identifierName";
          return;
        }
        throw invalidChar(read$1());
      },
      afterPropertyName() {
        if (c === ":") {
          return newToken("punctuator", read$1());
        }
        throw invalidChar(read$1());
      },
      beforePropertyValue() {
        lexState = "value";
      },
      afterPropertyValue() {
        switch (c) {
          case ",":
          case "}":
            return newToken("punctuator", read$1());
        }
        throw invalidChar(read$1());
      },
      beforeArrayValue() {
        if (c === "]") {
          return newToken("punctuator", read$1());
        }
        lexState = "value";
      },
      afterArrayValue() {
        switch (c) {
          case ",":
          case "]":
            return newToken("punctuator", read$1());
        }
        throw invalidChar(read$1());
      },
      end() {
        throw invalidChar(read$1());
      }
    };
    function newToken(type, value2) {
      return {
        type,
        value: value2,
        line,
        column
      };
    }
    function literal$5(s) {
      for (const c2 of s) {
        const p = peek$1();
        if (p !== c2) {
          throw invalidChar(read$1());
        }
        read$1();
      }
    }
    function escape$1() {
      const c2 = peek$1();
      switch (c2) {
        case "b":
          read$1();
          return "\b";
        case "f":
          read$1();
          return "\f";
        case "n":
          read$1();
          return "\n";
        case "r":
          read$1();
          return "\r";
        case "t":
          read$1();
          return "	";
        case "v":
          read$1();
          return "\v";
        case "0":
          read$1();
          if (util.isDigit(peek$1())) {
            throw invalidChar(read$1());
          }
          return "\0";
        case "x":
          read$1();
          return hexEscape();
        case "u":
          read$1();
          return unicodeEscape();
        case "\n":
        case "\u2028":
        case "\u2029":
          read$1();
          return "";
        case "\r":
          read$1();
          if (peek$1() === "\n") {
            read$1();
          }
          return "";
        case "1":
        case "2":
        case "3":
        case "4":
        case "5":
        case "6":
        case "7":
        case "8":
        case "9":
          throw invalidChar(read$1());
        case void 0:
          throw invalidChar(read$1());
      }
      return read$1();
    }
    function hexEscape() {
      let buffer2 = "";
      let c2 = peek$1();
      if (!util.isHexDigit(c2)) {
        throw invalidChar(read$1());
      }
      buffer2 += read$1();
      c2 = peek$1();
      if (!util.isHexDigit(c2)) {
        throw invalidChar(read$1());
      }
      buffer2 += read$1();
      return String.fromCodePoint(parseInt(buffer2, 16));
    }
    function unicodeEscape() {
      let buffer2 = "";
      let count = 4;
      while (count-- > 0) {
        const c2 = peek$1();
        if (!util.isHexDigit(c2)) {
          throw invalidChar(read$1());
        }
        buffer2 += read$1();
      }
      return String.fromCodePoint(parseInt(buffer2, 16));
    }
    const parseStates = {
      start() {
        if (token.type === "eof") {
          throw invalidEOF();
        }
        push();
      },
      beforePropertyName() {
        switch (token.type) {
          case "identifier":
          case "string":
            key$2 = token.value;
            parseState = "afterPropertyName";
            return;
          case "punctuator":
            pop();
            return;
          case "eof":
            throw invalidEOF();
        }
      },
      afterPropertyName() {
        if (token.type === "eof") {
          throw invalidEOF();
        }
        parseState = "beforePropertyValue";
      },
      beforePropertyValue() {
        if (token.type === "eof") {
          throw invalidEOF();
        }
        push();
      },
      beforeArrayValue() {
        if (token.type === "eof") {
          throw invalidEOF();
        }
        if (token.type === "punctuator" && token.value === "]") {
          pop();
          return;
        }
        push();
      },
      afterPropertyValue() {
        if (token.type === "eof") {
          throw invalidEOF();
        }
        switch (token.value) {
          case ",":
            parseState = "beforePropertyName";
            return;
          case "}":
            pop();
        }
      },
      afterArrayValue() {
        if (token.type === "eof") {
          throw invalidEOF();
        }
        switch (token.value) {
          case ",":
            parseState = "beforeArrayValue";
            return;
          case "]":
            pop();
        }
      },
      end() {
      }
    };
    function push() {
      let value2;
      switch (token.type) {
        case "punctuator":
          switch (token.value) {
            case "{":
              value2 = {};
              break;
            case "[":
              value2 = [];
              break;
          }
          break;
        case "null":
        case "boolean":
        case "numeric":
        case "string":
          value2 = token.value;
          break;
      }
      if (root$2 === void 0) {
        root$2 = value2;
      } else {
        const parent = stack[stack.length - 1];
        if (Array.isArray(parent)) {
          parent.push(value2);
        } else {
          Object.defineProperty(parent, key$2, {
            value: value2,
            writable: true,
            enumerable: true,
            configurable: true
          });
        }
      }
      if (value2 !== null && typeof value2 === "object") {
        stack.push(value2);
        if (Array.isArray(value2)) {
          parseState = "beforeArrayValue";
        } else {
          parseState = "beforePropertyName";
        }
      } else {
        const current2 = stack[stack.length - 1];
        if (current2 == null) {
          parseState = "end";
        } else if (Array.isArray(current2)) {
          parseState = "afterArrayValue";
        } else {
          parseState = "afterPropertyValue";
        }
      }
    }
    function pop() {
      stack.pop();
      const current2 = stack[stack.length - 1];
      if (current2 == null) {
        parseState = "end";
      } else if (Array.isArray(current2)) {
        parseState = "afterArrayValue";
      } else {
        parseState = "afterPropertyValue";
      }
    }
    function invalidChar(c2) {
      if (c2 === void 0) {
        return syntaxError(`JSON5: invalid end of input at ${line}:${column}`);
      }
      return syntaxError(`JSON5: invalid character '${formatChar(c2)}' at ${line}:${column}`);
    }
    function invalidEOF() {
      return syntaxError(`JSON5: invalid end of input at ${line}:${column}`);
    }
    function invalidIdentifier() {
      column -= 5;
      return syntaxError(`JSON5: invalid identifier character at ${line}:${column}`);
    }
    function separatorChar(c2) {
      console.warn(`JSON5: '${formatChar(c2)}' in strings is not valid ECMAScript; consider escaping`);
    }
    function formatChar(c2) {
      const replacements = {
        "'": "\\'",
        '"': '\\"',
        "\\": "\\\\",
        "\b": "\\b",
        "\f": "\\f",
        "\n": "\\n",
        "\r": "\\r",
        "	": "\\t",
        "\v": "\\v",
        "\0": "\\0",
        "\u2028": "\\u2028",
        "\u2029": "\\u2029"
      };
      if (replacements[c2]) {
        return replacements[c2];
      }
      if (c2 < " ") {
        const hexString = c2.charCodeAt(0).toString(16);
        return "\\x" + ("00" + hexString).substring(hexString.length);
      }
      return c2;
    }
    function syntaxError(message2) {
      const err2 = new SyntaxError(message2);
      err2.lineNumber = line;
      err2.columnNumber = column;
      return err2;
    }
    var stringify$3 = function stringify2(value2, replacer, space) {
      const stack2 = [];
      let indent = "";
      let propertyList;
      let replacerFunc;
      let gap2 = "";
      let quote2;
      if (replacer != null && typeof replacer === "object" && !Array.isArray(replacer)) {
        space = replacer.space;
        quote2 = replacer.quote;
        replacer = replacer.replacer;
      }
      if (typeof replacer === "function") {
        replacerFunc = replacer;
      } else if (Array.isArray(replacer)) {
        propertyList = [];
        for (const v of replacer) {
          let item2;
          if (typeof v === "string") {
            item2 = v;
          } else if (typeof v === "number" || v instanceof String || v instanceof Number) {
            item2 = String(v);
          }
          if (item2 !== void 0 && propertyList.indexOf(item2) < 0) {
            propertyList.push(item2);
          }
        }
      }
      if (space instanceof Number) {
        space = Number(space);
      } else if (space instanceof String) {
        space = String(space);
      }
      if (typeof space === "number") {
        if (space > 0) {
          space = Math.min(10, Math.floor(space));
          gap2 = "          ".substr(0, space);
        }
      } else if (typeof space === "string") {
        gap2 = space.substr(0, 10);
      }
      return serializeProperty("", { "": value2 });
      function serializeProperty(key2, holder) {
        let value3 = holder[key2];
        if (value3 != null) {
          if (typeof value3.toJSON5 === "function") {
            value3 = value3.toJSON5(key2);
          } else if (typeof value3.toJSON === "function") {
            value3 = value3.toJSON(key2);
          }
        }
        if (replacerFunc) {
          value3 = replacerFunc.call(holder, key2, value3);
        }
        if (value3 instanceof Number) {
          value3 = Number(value3);
        } else if (value3 instanceof String) {
          value3 = String(value3);
        } else if (value3 instanceof Boolean) {
          value3 = value3.valueOf();
        }
        switch (value3) {
          case null:
            return "null";
          case true:
            return "true";
          case false:
            return "false";
        }
        if (typeof value3 === "string") {
          return quoteString(value3);
        }
        if (typeof value3 === "number") {
          return String(value3);
        }
        if (typeof value3 === "object") {
          return Array.isArray(value3) ? serializeArray(value3) : serializeObject(value3);
        }
        return void 0;
      }
      function quoteString(value3) {
        const quotes = {
          "'": 0.1,
          '"': 0.2
        };
        const replacements = {
          "'": "\\'",
          '"': '\\"',
          "\\": "\\\\",
          "\b": "\\b",
          "\f": "\\f",
          "\n": "\\n",
          "\r": "\\r",
          "	": "\\t",
          "\v": "\\v",
          "\0": "\\0",
          "\u2028": "\\u2028",
          "\u2029": "\\u2029"
        };
        let product = "";
        for (let i2 = 0; i2 < value3.length; i2++) {
          const c2 = value3[i2];
          switch (c2) {
            case "'":
            case '"':
              quotes[c2]++;
              product += c2;
              continue;
            case "\0":
              if (util.isDigit(value3[i2 + 1])) {
                product += "\\x00";
                continue;
              }
          }
          if (replacements[c2]) {
            product += replacements[c2];
            continue;
          }
          if (c2 < " ") {
            let hexString = c2.charCodeAt(0).toString(16);
            product += "\\x" + ("00" + hexString).substring(hexString.length);
            continue;
          }
          product += c2;
        }
        const quoteChar = quote2 || Object.keys(quotes).reduce((a, b) => quotes[a] < quotes[b] ? a : b);
        product = product.replace(new RegExp(quoteChar, "g"), replacements[quoteChar]);
        return quoteChar + product + quoteChar;
      }
      function serializeObject(value3) {
        if (stack2.indexOf(value3) >= 0) {
          throw TypeError("Converting circular structure to JSON5");
        }
        stack2.push(value3);
        let stepback = indent;
        indent = indent + gap2;
        let keys = propertyList || Object.keys(value3);
        let partial = [];
        for (const key2 of keys) {
          const propertyString = serializeProperty(key2, value3);
          if (propertyString !== void 0) {
            let member = serializeKey(key2) + ":";
            if (gap2 !== "") {
              member += " ";
            }
            member += propertyString;
            partial.push(member);
          }
        }
        let final;
        if (partial.length === 0) {
          final = "{}";
        } else {
          let properties;
          if (gap2 === "") {
            properties = partial.join(",");
            final = "{" + properties + "}";
          } else {
            let separator2 = ",\n" + indent;
            properties = partial.join(separator2);
            final = "{\n" + indent + properties + ",\n" + stepback + "}";
          }
        }
        stack2.pop();
        indent = stepback;
        return final;
      }
      function serializeKey(key2) {
        if (key2.length === 0) {
          return quoteString(key2);
        }
        const firstChar = String.fromCodePoint(key2.codePointAt(0));
        if (!util.isIdStartChar(firstChar)) {
          return quoteString(key2);
        }
        for (let i2 = firstChar.length; i2 < key2.length; i2++) {
          if (!util.isIdContinueChar(String.fromCodePoint(key2.codePointAt(i2)))) {
            return quoteString(key2);
          }
        }
        return key2;
      }
      function serializeArray(value3) {
        if (stack2.indexOf(value3) >= 0) {
          throw TypeError("Converting circular structure to JSON5");
        }
        stack2.push(value3);
        let stepback = indent;
        indent = indent + gap2;
        let partial = [];
        for (let i2 = 0; i2 < value3.length; i2++) {
          const propertyString = serializeProperty(String(i2), value3);
          partial.push(propertyString !== void 0 ? propertyString : "null");
        }
        let final;
        if (partial.length === 0) {
          final = "[]";
        } else {
          if (gap2 === "") {
            let properties = partial.join(",");
            final = "[" + properties + "]";
          } else {
            let separator2 = ",\n" + indent;
            let properties = partial.join(separator2);
            final = "[\n" + indent + properties + ",\n" + stepback + "]";
          }
        }
        stack2.pop();
        indent = stepback;
        return final;
      }
    };
    const JSON5 = {
      parse: parse$6,
      stringify: stringify$3
    };
    var lib$d = JSON5;
    var prism = { exports: {} };
    var hasRequiredPrism;
    function requirePrism() {
      if (hasRequiredPrism) return prism.exports;
      hasRequiredPrism = 1;
      (function(module2) {
        var _self = typeof window !== "undefined" ? window : typeof WorkerGlobalScope !== "undefined" && self instanceof WorkerGlobalScope ? self : {};
        var Prism2 = (function(_self2) {
          var lang2 = /(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i;
          var uniqueId = 0;
          var plainTextGrammar = {};
          var _ = {
            /**
             * By default, Prism will attempt to highlight all code elements (by calling {@link Prism.highlightAll}) on the
             * current page after the page finished loading. This might be a problem if e.g. you wanted to asynchronously load
             * additional languages or plugins yourself.
             *
             * By setting this value to `true`, Prism will not automatically highlight all code elements on the page.
             *
             * You obviously have to change this value before the automatic highlighting started. To do this, you can add an
             * empty Prism object into the global scope before loading the Prism script like this:
             *
             * ```js
             * window.Prism = window.Prism || {};
             * Prism.manual = true;
             * // add a new <script> to load Prism's script
             * ```
             *
             * @default false
             * @type {boolean}
             * @memberof Prism
             * @public
             */
            manual: _self2.Prism && _self2.Prism.manual,
            /**
             * By default, if Prism is in a web worker, it assumes that it is in a worker it created itself, so it uses
             * `addEventListener` to communicate with its parent instance. However, if you're using Prism manually in your
             * own worker, you don't want it to do this.
             *
             * By setting this value to `true`, Prism will not add its own listeners to the worker.
             *
             * You obviously have to change this value before Prism executes. To do this, you can add an
             * empty Prism object into the global scope before loading the Prism script like this:
             *
             * ```js
             * window.Prism = window.Prism || {};
             * Prism.disableWorkerMessageHandler = true;
             * // Load Prism's script
             * ```
             *
             * @default false
             * @type {boolean}
             * @memberof Prism
             * @public
             */
            disableWorkerMessageHandler: _self2.Prism && _self2.Prism.disableWorkerMessageHandler,
            /**
             * 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: {
              encode: function encode2(tokens) {
                if (tokens instanceof Token2) {
                  return new Token2(tokens.type, encode2(tokens.content), tokens.alias);
                } else if (Array.isArray(tokens)) {
                  return tokens.map(encode2);
                } else {
                  return tokens.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/\u00a0/g, " ");
                }
              },
              /**
               * 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(o) {
                return Object.prototype.toString.call(o).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(obj) {
                if (!obj["__id"]) {
                  Object.defineProperty(obj, "__id", { value: ++uniqueId });
                }
                return obj["__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 deepClone(o, visited) {
                visited = visited || {};
                var clone2;
                var id;
                switch (_.util.type(o)) {
                  case "Object":
                    id = _.util.objId(o);
                    if (visited[id]) {
                      return visited[id];
                    }
                    clone2 = /** @type {Record<string, any>} */
                    {};
                    visited[id] = clone2;
                    for (var key2 in o) {
                      if (o.hasOwnProperty(key2)) {
                        clone2[key2] = deepClone(o[key2], visited);
                      }
                    }
                    return (
                      /** @type {any} */
                      clone2
                    );
                  case "Array":
                    id = _.util.objId(o);
                    if (visited[id]) {
                      return visited[id];
                    }
                    clone2 = [];
                    visited[id] = clone2;
                    /** @type {Array} */
                    /** @type {any} */
                    o.forEach(function(v, i2) {
                      clone2[i2] = deepClone(v, visited);
                    });
                    return (
                      /** @type {any} */
                      clone2
                    );
                  default:
                    return o;
                }
              },
              /**
               * Returns the Prism language of the given element set by a `language-xxxx` or `lang-xxxx` class.
               *
               * If no language is set for the element or the element is `null` or `undefined`, `none` will be returned.
               *
               * @param {Element} element
               * @returns {string}
               */
              getLanguage: function(element) {
                while (element) {
                  var m = lang2.exec(element.className);
                  if (m) {
                    return m[1].toLowerCase();
                  }
                  element = element.parentElement;
                }
                return "none";
              },
              /**
               * Sets the Prism `language-xxxx` class of the given element.
               *
               * @param {Element} element
               * @param {string} language
               * @returns {void}
               */
              setLanguage: function(element, language2) {
                element.className = element.className.replace(RegExp(lang2, "gi"), "");
                element.classList.add("language-" + language2);
              },
              /**
               * Returns the script element that is currently executing.
               *
               * This does __not__ work for line script element.
               *
               * @returns {HTMLScriptElement | null}
               */
              currentScript: function() {
                if (typeof document === "undefined") {
                  return null;
                }
                if (document.currentScript && document.currentScript.tagName === "SCRIPT" && 1 < 2) {
                  return (
                    /** @type {any} */
                    document.currentScript
                  );
                }
                try {
                  throw new Error();
                } catch (err2) {
                  var src = (/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(err2.stack) || [])[1];
                  if (src) {
                    var scripts = document.getElementsByTagName("script");
                    for (var i2 in scripts) {
                      if (scripts[i2].src == src) {
                        return scripts[i2];
                      }
                    }
                  }
                  return null;
                }
              },
              /**
               * Returns whether a given class is active for `element`.
               *
               * The class can be activated if `element` or one of its ancestors has the given class and it can be deactivated
               * if `element` or one of its ancestors has the negated version of the given class. The _negated version_ of the
               * given class is just the given class with a `no-` prefix.
               *
               * Whether the class is active is determined by the closest ancestor of `element` (where `element` itself is
               * closest ancestor) that has the given class or the negated version of it. If neither `element` nor any of its
               * ancestors have the given class or the negated version of it, then the default activation will be returned.
               *
               * In the paradoxical situation where the closest ancestor contains __both__ the given class and the negated
               * version of it, the class is considered active.
               *
               * @param {Element} element
               * @param {string} className
               * @param {boolean} [defaultActivation=false]
               * @returns {boolean}
               */
              isActive: function(element, className2, defaultActivation) {
                var no2 = "no-" + className2;
                while (element) {
                  var classList = element.classList;
                  if (classList.contains(className2)) {
                    return true;
                  }
                  if (classList.contains(no2)) {
                    return false;
                  }
                  element = element.parentElement;
                }
                return !!defaultActivation;
              }
            },
            /**
             * 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: plainTextGrammar,
              plaintext: plainTextGrammar,
              text: plainTextGrammar,
              txt: plainTextGrammar,
              /**
               * 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(id, redef) {
                var lang3 = _.util.clone(_.languages[id]);
                for (var key2 in redef) {
                  lang3[key2] = redef[key2];
                }
                return lang3;
              },
              /**
               * 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(inside2, before, insert2, root2) {
                root2 = root2 || /** @type {any} */
                _.languages;
                var grammar = root2[inside2];
                var ret = {};
                for (var token2 in grammar) {
                  if (grammar.hasOwnProperty(token2)) {
                    if (token2 == before) {
                      for (var newToken2 in insert2) {
                        if (insert2.hasOwnProperty(newToken2)) {
                          ret[newToken2] = insert2[newToken2];
                        }
                      }
                    }
                    if (!insert2.hasOwnProperty(token2)) {
                      ret[token2] = grammar[token2];
                    }
                  }
                }
                var old = root2[inside2];
                root2[inside2] = ret;
                _.languages.DFS(_.languages, function(key2, value2) {
                  if (value2 === old && key2 != inside2) {
                    this[key2] = ret;
                  }
                });
                return ret;
              },
              // Traverse a language definition with Depth First Search
              DFS: function DFS(o, callback, type, visited) {
                visited = visited || {};
                var objId = _.util.objId;
                for (var i2 in o) {
                  if (o.hasOwnProperty(i2)) {
                    callback.call(o, i2, o[i2], type || i2);
                    var property2 = o[i2];
                    var propertyType = _.util.type(property2);
                    if (propertyType === "Object" && !visited[objId(property2)]) {
                      visited[objId(property2)] = true;
                      DFS(property2, callback, null, visited);
                    } else if (propertyType === "Array" && !visited[objId(property2)]) {
                      visited[objId(property2)] = true;
                      DFS(property2, callback, i2, visited);
                    }
                  }
                }
              }
            },
            plugins: {},
            /**
             * This is the most high-level function in Prism’s API.
             * It fetches all the elements that have a `.language-xxxx` class and then calls {@link Prism.highlightElement} on
             * each one of them.
             *
             * This is equivalent to `Prism.highlightAllUnder(document, async, callback)`.
             *
             * @param {boolean} [async=false] Same as in {@link Prism.highlightAllUnder}.
             * @param {HighlightCallback} [callback] Same as in {@link Prism.highlightAllUnder}.
             * @memberof Prism
             * @public
             */
            highlightAll: function(async, callback) {
              _.highlightAllUnder(document, async, callback);
            },
            /**
             * Fetches all the descendants of `container` that have a `.language-xxxx` class and then calls
             * {@link Prism.highlightElement} on each one of them.
             *
             * The following hooks will be run:
             * 1. `before-highlightall`
             * 2. `before-all-elements-highlight`
             * 3. All hooks of {@link Prism.highlightElement} for each element.
             *
             * @param {ParentNode} container The root element, whose descendants that have a `.language-xxxx` class will be highlighted.
             * @param {boolean} [async=false] Whether each element is to be highlighted asynchronously using Web Workers.
             * @param {HighlightCallback} [callback] An optional callback to be invoked on each element after its highlighting is done.
             * @memberof Prism
             * @public
             */
            highlightAllUnder: function(container2, async, callback) {
              var env = {
                callback,
                container: container2,
                selector: 'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'
              };
              _.hooks.run("before-highlightall", env);
              env.elements = Array.prototype.slice.apply(env.container.querySelectorAll(env.selector));
              _.hooks.run("before-all-elements-highlight", env);
              for (var i2 = 0, element; element = env.elements[i2++]; ) {
                _.highlightElement(element, async === true, env.callback);
              }
            },
            /**
             * Highlights the code inside a single element.
             *
             * The following hooks will be run:
             * 1. `before-sanity-check`
             * 2. `before-highlight`
             * 3. All hooks of {@link Prism.highlight}. These hooks will be run by an asynchronous worker if `async` is `true`.
             * 4. `before-insert`
             * 5. `after-highlight`
             * 6. `complete`
             *
             * Some the above hooks will be skipped if the element doesn't contain any text or there is no grammar loaded for
             * the element's language.
             *
             * @param {Element} element The element containing the code.
             * It must have a class of `language-xxxx` to be processed, where `xxxx` is a valid language identifier.
             * @param {boolean} [async=false] Whether the element is to be highlighted asynchronously using Web Workers
             * to improve performance and avoid blocking the UI when highlighting very large chunks of code. This option is
             * [disabled by default](https://prismjs.com/faq.html#why-is-asynchronous-highlighting-disabled-by-default).
             *
             * Note: All language definitions required to highlight the code must be included in the main `prism.js` file for
             * asynchronous highlighting to work. You can build your own bundle on the
             * [Download page](https://prismjs.com/download.html).
             * @param {HighlightCallback} [callback] An optional callback to be invoked after the highlighting is done.
             * Mostly useful when `async` is `true`, since in that case, the highlighting is done asynchronously.
             * @memberof Prism
             * @public
             */
            highlightElement: function(element, async, callback) {
              var language2 = _.util.getLanguage(element);
              var grammar = _.languages[language2];
              _.util.setLanguage(element, language2);
              var parent = element.parentElement;
              if (parent && parent.nodeName.toLowerCase() === "pre") {
                _.util.setLanguage(parent, language2);
              }
              var code2 = element.textContent;
              var env = {
                element,
                language: language2,
                grammar,
                code: code2
              };
              function insertHighlightedCode(highlightedCode) {
                env.highlightedCode = highlightedCode;
                _.hooks.run("before-insert", env);
                env.element.innerHTML = env.highlightedCode;
                _.hooks.run("after-highlight", env);
                _.hooks.run("complete", env);
                callback && callback.call(env.element);
              }
              _.hooks.run("before-sanity-check", env);
              parent = env.element.parentElement;
              if (parent && parent.nodeName.toLowerCase() === "pre" && !parent.hasAttribute("tabindex")) {
                parent.setAttribute("tabindex", "0");
              }
              if (!env.code) {
                _.hooks.run("complete", env);
                callback && callback.call(env.element);
                return;
              }
              _.hooks.run("before-highlight", env);
              if (!env.grammar) {
                insertHighlightedCode(_.util.encode(env.code));
                return;
              }
              if (async && _self2.Worker) {
                var worker = new Worker(_.filename);
                worker.onmessage = function(evt) {
                  insertHighlightedCode(evt.data);
                };
                worker.postMessage(JSON.stringify({
                  language: env.language,
                  code: env.code,
                  immediateClose: true
                }));
              } else {
                insertHighlightedCode(_.highlight(env.code, env.grammar, env.language));
              }
            },
            /**
             * 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(text2, grammar, language2) {
              var env = {
                code: text2,
                grammar,
                language: language2
              };
              _.hooks.run("before-tokenize", env);
              if (!env.grammar) {
                throw new Error('The language "' + env.language + '" has no grammar.');
              }
              env.tokens = _.tokenize(env.code, env.grammar);
              _.hooks.run("after-tokenize", env);
              return Token2.stringify(_.util.encode(env.tokens), env.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(text2, grammar) {
              var rest = grammar.rest;
              if (rest) {
                for (var token2 in rest) {
                  grammar[token2] = rest[token2];
                }
                delete grammar.rest;
              }
              var tokenList = new LinkedList2();
              addAfter(tokenList, tokenList.head, text2);
              matchGrammar(text2, tokenList, grammar, tokenList.head, 0);
              return toArray2(tokenList);
            },
            /**
             * @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(name2, callback) {
                var hooks = _.hooks.all;
                hooks[name2] = hooks[name2] || [];
                hooks[name2].push(callback);
              },
              /**
               * 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(name2, env) {
                var callbacks = _.hooks.all[name2];
                if (!callbacks || !callbacks.length) {
                  return;
                }
                for (var i2 = 0, callback; callback = callbacks[i2++]; ) {
                  callback(env);
                }
              }
            },
            Token: Token2
          };
          _self2.Prism = _;
          function Token2(type, content2, alias, matchedStr) {
            this.type = type;
            this.content = content2;
            this.alias = alias;
            this.length = (matchedStr || "").length | 0;
          }
          Token2.stringify = function stringify2(o, language2) {
            if (typeof o == "string") {
              return o;
            }
            if (Array.isArray(o)) {
              var s = "";
              o.forEach(function(e) {
                s += stringify2(e, language2);
              });
              return s;
            }
            var env = {
              type: o.type,
              content: stringify2(o.content, language2),
              tag: "span",
              classes: ["token", o.type],
              attributes: {},
              language: language2
            };
            var aliases2 = o.alias;
            if (aliases2) {
              if (Array.isArray(aliases2)) {
                Array.prototype.push.apply(env.classes, aliases2);
              } else {
                env.classes.push(aliases2);
              }
            }
            _.hooks.run("wrap", env);
            var attributes2 = "";
            for (var name2 in env.attributes) {
              attributes2 += " " + name2 + '="' + (env.attributes[name2] || "").replace(/"/g, "&quot;") + '"';
            }
            return "<" + env.tag + ' class="' + env.classes.join(" ") + '"' + attributes2 + ">" + env.content + "</" + env.tag + ">";
          };
          function matchPattern(pattern, pos2, text2, lookbehind) {
            pattern.lastIndex = pos2;
            var match = pattern.exec(text2);
            if (match && lookbehind && match[1]) {
              var lookbehindLength = match[1].length;
              match.index += lookbehindLength;
              match[0] = match[0].slice(lookbehindLength);
            }
            return match;
          }
          function matchGrammar(text2, tokenList, grammar, startNode, startPos, rematch) {
            for (var token2 in grammar) {
              if (!grammar.hasOwnProperty(token2) || !grammar[token2]) {
                continue;
              }
              var patterns = grammar[token2];
              patterns = Array.isArray(patterns) ? patterns : [patterns];
              for (var j = 0; j < patterns.length; ++j) {
                if (rematch && rematch.cause == token2 + "," + j) {
                  return;
                }
                var patternObj = patterns[j];
                var inside2 = patternObj.inside;
                var lookbehind = !!patternObj.lookbehind;
                var greedy = !!patternObj.greedy;
                var alias = patternObj.alias;
                if (greedy && !patternObj.pattern.global) {
                  var flags = patternObj.pattern.toString().match(/[imsuy]*$/)[0];
                  patternObj.pattern = RegExp(patternObj.pattern.source, flags + "g");
                }
                var pattern = patternObj.pattern || patternObj;
                for (var currentNode = startNode.next, pos2 = startPos; currentNode !== tokenList.tail; pos2 += currentNode.value.length, currentNode = currentNode.next) {
                  if (rematch && pos2 >= rematch.reach) {
                    break;
                  }
                  var str2 = currentNode.value;
                  if (tokenList.length > text2.length) {
                    return;
                  }
                  if (str2 instanceof Token2) {
                    continue;
                  }
                  var removeCount = 1;
                  var match;
                  if (greedy) {
                    match = matchPattern(pattern, pos2, text2, lookbehind);
                    if (!match || match.index >= text2.length) {
                      break;
                    }
                    var from = match.index;
                    var to2 = match.index + match[0].length;
                    var p = pos2;
                    p += currentNode.value.length;
                    while (from >= p) {
                      currentNode = currentNode.next;
                      p += currentNode.value.length;
                    }
                    p -= currentNode.value.length;
                    pos2 = p;
                    if (currentNode.value instanceof Token2) {
                      continue;
                    }
                    for (var k2 = currentNode; k2 !== tokenList.tail && (p < to2 || typeof k2.value === "string"); k2 = k2.next) {
                      removeCount++;
                      p += k2.value.length;
                    }
                    removeCount--;
                    str2 = text2.slice(pos2, p);
                    match.index -= pos2;
                  } else {
                    match = matchPattern(pattern, 0, str2, lookbehind);
                    if (!match) {
                      continue;
                    }
                  }
                  var from = match.index;
                  var matchStr = match[0];
                  var before = str2.slice(0, from);
                  var after = str2.slice(from + matchStr.length);
                  var reach = pos2 + str2.length;
                  if (rematch && reach > rematch.reach) {
                    rematch.reach = reach;
                  }
                  var removeFrom = currentNode.prev;
                  if (before) {
                    removeFrom = addAfter(tokenList, removeFrom, before);
                    pos2 += before.length;
                  }
                  removeRange(tokenList, removeFrom, removeCount);
                  var wrapped = new Token2(token2, inside2 ? _.tokenize(matchStr, inside2) : matchStr, alias, matchStr);
                  currentNode = addAfter(tokenList, removeFrom, wrapped);
                  if (after) {
                    addAfter(tokenList, currentNode, after);
                  }
                  if (removeCount > 1) {
                    var nestedRematch = {
                      cause: token2 + "," + j,
                      reach
                    };
                    matchGrammar(text2, tokenList, grammar, currentNode.prev, pos2, nestedRematch);
                    if (rematch && nestedRematch.reach > rematch.reach) {
                      rematch.reach = nestedRematch.reach;
                    }
                  }
                }
              }
            }
          }
          function LinkedList2() {
            var head = { value: null, prev: null, next: null };
            var tail = { value: null, prev: head, next: null };
            head.next = tail;
            this.head = head;
            this.tail = tail;
            this.length = 0;
          }
          function addAfter(list2, node2, value2) {
            var next = node2.next;
            var newNode = { value: value2, prev: node2, next };
            node2.next = newNode;
            next.prev = newNode;
            list2.length++;
            return newNode;
          }
          function removeRange(list2, node2, count) {
            var next = node2.next;
            for (var i2 = 0; i2 < count && next !== list2.tail; i2++) {
              next = next.next;
            }
            node2.next = next;
            next.prev = node2;
            list2.length -= i2;
          }
          function toArray2(list2) {
            var array = [];
            var node2 = list2.head.next;
            while (node2 !== list2.tail) {
              array.push(node2.value);
              node2 = node2.next;
            }
            return array;
          }
          if (!_self2.document) {
            if (!_self2.addEventListener) {
              return _;
            }
            if (!_.disableWorkerMessageHandler) {
              _self2.addEventListener("message", function(evt) {
                var message2 = JSON.parse(evt.data);
                var lang3 = message2.language;
                var code2 = message2.code;
                var immediateClose = message2.immediateClose;
                _self2.postMessage(_.highlight(code2, _.languages[lang3], lang3));
                if (immediateClose) {
                  _self2.close();
                }
              }, false);
            }
            return _;
          }
          var script2 = _.util.currentScript();
          if (script2) {
            _.filename = script2.src;
            if (script2.hasAttribute("data-manual")) {
              _.manual = true;
            }
          }
          function highlightAutomaticallyCallback() {
            if (!_.manual) {
              _.highlightAll();
            }
          }
          if (!_.manual) {
            var readyState = document.readyState;
            if (readyState === "loading" || readyState === "interactive" && script2 && script2.defer) {
              document.addEventListener("DOMContentLoaded", highlightAutomaticallyCallback);
            } else {
              if (window.requestAnimationFrame) {
                window.requestAnimationFrame(highlightAutomaticallyCallback);
              } else {
                window.setTimeout(highlightAutomaticallyCallback, 16);
              }
            }
          }
          return _;
        })(_self);
        if (module2.exports) {
          module2.exports = Prism2;
        }
        if (typeof commonjsGlobal !== "undefined") {
          commonjsGlobal.Prism = Prism2;
        }
        Prism2.languages.markup = {
          "comment": {
            pattern: /<!--(?:(?!<!--)[\s\S])*?-->/,
            greedy: true
          },
          "prolog": {
            pattern: /<\?[\s\S]+?\?>/,
            greedy: true
          },
          "doctype": {
            // https://www.w3.org/TR/xml/#NT-doctypedecl
            pattern: /<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,
            greedy: true,
            inside: {
              "internal-subset": {
                pattern: /(^[^\[]*\[)[\s\S]+(?=\]>$)/,
                lookbehind: true,
                greedy: true,
                inside: null
                // see below
              },
              "string": {
                pattern: /"[^"]*"|'[^']*'/,
                greedy: true
              },
              "punctuation": /^<!|>$|[[\]]/,
              "doctype-tag": /^DOCTYPE/i,
              "name": /[^\s<>'"]+/
            }
          },
          "cdata": {
            pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
            greedy: true
          },
          "tag": {
            pattern: /<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,
            greedy: true,
            inside: {
              "tag": {
                pattern: /^<\/?[^\s>\/]+/,
                inside: {
                  "punctuation": /^<\/?/,
                  "namespace": /^[^\s>\/:]+:/
                }
              },
              "special-attr": [],
              "attr-value": {
                pattern: /=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,
                inside: {
                  "punctuation": [
                    {
                      pattern: /^=/,
                      alias: "attr-equals"
                    },
                    {
                      pattern: /^(\s*)["']|["']$/,
                      lookbehind: true
                    }
                  ]
                }
              },
              "punctuation": /\/?>/,
              "attr-name": {
                pattern: /[^\s>\/]+/,
                inside: {
                  "namespace": /^[^\s>\/:]+:/
                }
              }
            }
          },
          "entity": [
            {
              pattern: /&[\da-z]{1,8};/i,
              alias: "named-entity"
            },
            /&#x?[\da-f]{1,8};/i
          ]
        };
        Prism2.languages.markup["tag"].inside["attr-value"].inside["entity"] = Prism2.languages.markup["entity"];
        Prism2.languages.markup["doctype"].inside["internal-subset"].inside = Prism2.languages.markup;
        Prism2.hooks.add("wrap", function(env) {
          if (env.type === "entity") {
            env.attributes["title"] = env.content.replace(/&amp;/, "&");
          }
        });
        Object.defineProperty(Prism2.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 addInlined(tagName, lang2) {
            var includedCdataInside = {};
            includedCdataInside["language-" + lang2] = {
              pattern: /(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,
              lookbehind: true,
              inside: Prism2.languages[lang2]
            };
            includedCdataInside["cdata"] = /^<!\[CDATA\[|\]\]>$/i;
            var inside2 = {
              "included-cdata": {
                pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
                inside: includedCdataInside
              }
            };
            inside2["language-" + lang2] = {
              pattern: /[\s\S]+/,
              inside: Prism2.languages[lang2]
            };
            var def = {};
            def[tagName] = {
              pattern: RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g, function() {
                return tagName;
              }), "i"),
              lookbehind: true,
              greedy: true,
              inside: inside2
            };
            Prism2.languages.insertBefore("markup", "cdata", def);
          }
        });
        Object.defineProperty(Prism2.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(attrName, lang2) {
            Prism2.languages.markup.tag.inside["special-attr"].push({
              pattern: RegExp(
                /(^|["'\s])/.source + "(?:" + attrName + ")" + /\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,
                "i"
              ),
              lookbehind: true,
              inside: {
                "attr-name": /^[^\s=]+/,
                "attr-value": {
                  pattern: /=[\s\S]+/,
                  inside: {
                    "value": {
                      pattern: /(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,
                      lookbehind: true,
                      alias: [lang2, "language-" + lang2],
                      inside: Prism2.languages[lang2]
                    },
                    "punctuation": [
                      {
                        pattern: /^=/,
                        alias: "attr-equals"
                      },
                      /"|'/
                    ]
                  }
                }
              }
            });
          }
        });
        Prism2.languages.html = Prism2.languages.markup;
        Prism2.languages.mathml = Prism2.languages.markup;
        Prism2.languages.svg = Prism2.languages.markup;
        Prism2.languages.xml = Prism2.languages.extend("markup", {});
        Prism2.languages.ssml = Prism2.languages.xml;
        Prism2.languages.atom = Prism2.languages.xml;
        Prism2.languages.rss = Prism2.languages.xml;
        (function(Prism3) {
          var string2 = /(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;
          Prism3.languages.css = {
            "comment": /\/\*[\s\S]*?\*\//,
            "atrule": {
              pattern: RegExp("@[\\w-](?:" + /[^;{\s"']|\s+(?!\s)/.source + "|" + string2.source + ")*?" + /(?:;|(?=\s*\{))/.source),
              inside: {
                "rule": /^@[\w-]+/,
                "selector-function-argument": {
                  pattern: /(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,
                  lookbehind: true,
                  alias: "selector"
                },
                "keyword": {
                  pattern: /(^|[^\w-])(?:and|not|only|or)(?![\w-])/,
                  lookbehind: true
                }
                // See rest below
              }
            },
            "url": {
              // https://drafts.csswg.org/css-values-3/#urls
              pattern: RegExp("\\burl\\((?:" + string2.source + "|" + /(?:[^\\\r\n()"']|\\[\s\S])*/.source + ")\\)", "i"),
              greedy: true,
              inside: {
                "function": /^url/i,
                "punctuation": /^\(|\)$/,
                "string": {
                  pattern: RegExp("^" + string2.source + "$"),
                  alias: "url"
                }
              }
            },
            "selector": {
              pattern: RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|` + string2.source + ")*(?=\\s*\\{)"),
              lookbehind: true
            },
            "string": {
              pattern: string2,
              greedy: true
            },
            "property": {
              pattern: /(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,
              lookbehind: true
            },
            "important": /!important\b/i,
            "function": {
              pattern: /(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,
              lookbehind: true
            },
            "punctuation": /[(){};:,]/
          };
          Prism3.languages.css["atrule"].inside.rest = Prism3.languages.css;
          var markup = Prism3.languages.markup;
          if (markup) {
            markup.tag.addInlined("style", "css");
            markup.tag.addAttribute("style", "css");
          }
        })(Prism2);
        Prism2.languages.clike = {
          "comment": [
            {
              pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,
              lookbehind: true,
              greedy: true
            },
            {
              pattern: /(^|[^\\:])\/\/.*/,
              lookbehind: true,
              greedy: true
            }
          ],
          "string": {
            pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
            greedy: true
          },
          "class-name": {
            pattern: /(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,
            lookbehind: true,
            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": /[{}[\];(),.:]/
        };
        Prism2.languages.javascript = Prism2.languages.extend("clike", {
          "class-name": [
            Prism2.languages.clike["class-name"],
            {
              pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,
              lookbehind: true
            }
          ],
          "keyword": [
            {
              pattern: /((?:^|\})\s*)catch\b/,
              lookbehind: true
            },
            {
              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: true
            }
          ],
          // 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: true
          },
          "operator": /--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/
        });
        Prism2.languages.javascript["class-name"][0].pattern = /(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/;
        Prism2.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: true,
            greedy: true,
            inside: {
              "regex-source": {
                pattern: /^(\/)[\s\S]+(?=\/[a-z]*$)/,
                lookbehind: true,
                alias: "language-regex",
                inside: Prism2.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: true,
              inside: Prism2.languages.javascript
            },
            {
              pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,
              lookbehind: true,
              inside: Prism2.languages.javascript
            },
            {
              pattern: /(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,
              lookbehind: true,
              inside: Prism2.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: true,
              inside: Prism2.languages.javascript
            }
          ],
          "constant": /\b[A-Z](?:[A-Z_]|\dx?)*\b/
        });
        Prism2.languages.insertBefore("javascript", "string", {
          "hashbang": {
            pattern: /^#!.*/,
            greedy: true,
            alias: "comment"
          },
          "template-string": {
            pattern: /`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,
            greedy: true,
            inside: {
              "template-punctuation": {
                pattern: /^`|`$/,
                alias: "string"
              },
              "interpolation": {
                pattern: /((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,
                lookbehind: true,
                inside: {
                  "interpolation-punctuation": {
                    pattern: /^\$\{|\}$/,
                    alias: "punctuation"
                  },
                  rest: Prism2.languages.javascript
                }
              },
              "string": /[\s\S]+/
            }
          },
          "string-property": {
            pattern: /((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,
            lookbehind: true,
            greedy: true,
            alias: "property"
          }
        });
        Prism2.languages.insertBefore("javascript", "operator", {
          "literal-property": {
            pattern: /((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,
            lookbehind: true,
            alias: "property"
          }
        });
        if (Prism2.languages.markup) {
          Prism2.languages.markup.tag.addInlined("script", "javascript");
          Prism2.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"
          );
        }
        Prism2.languages.js = Prism2.languages.javascript;
        (function() {
          if (typeof Prism2 === "undefined" || typeof document === "undefined") {
            return;
          }
          if (!Element.prototype.matches) {
            Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;
          }
          var LOADING_MESSAGE = "Loading…";
          var FAILURE_MESSAGE = function(status2, message2) {
            return "✖ Error " + status2 + " while fetching file: " + message2;
          };
          var FAILURE_EMPTY_MESSAGE = "✖ Error: File does not exist or is empty";
          var EXTENSIONS = {
            "js": "javascript",
            "py": "python",
            "rb": "ruby",
            "ps1": "powershell",
            "psm1": "powershell",
            "sh": "bash",
            "bat": "batch",
            "h": "c",
            "tex": "latex"
          };
          var STATUS_ATTR = "data-src-status";
          var STATUS_LOADING = "loading";
          var STATUS_LOADED = "loaded";
          var STATUS_FAILED = "failed";
          var SELECTOR = "pre[data-src]:not([" + STATUS_ATTR + '="' + STATUS_LOADED + '"]):not([' + STATUS_ATTR + '="' + STATUS_LOADING + '"])';
          function loadFile(src, success2, error2) {
            var xhr = new XMLHttpRequest();
            xhr.open("GET", src, true);
            xhr.onreadystatechange = function() {
              if (xhr.readyState == 4) {
                if (xhr.status < 400 && xhr.responseText) {
                  success2(xhr.responseText);
                } else {
                  if (xhr.status >= 400) {
                    error2(FAILURE_MESSAGE(xhr.status, xhr.statusText));
                  } else {
                    error2(FAILURE_EMPTY_MESSAGE);
                  }
                }
              }
            };
            xhr.send(null);
          }
          function parseRange(range2) {
            var m = /^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(range2 || "");
            if (m) {
              var start2 = Number(m[1]);
              var comma2 = m[2];
              var end2 = m[3];
              if (!comma2) {
                return [start2, start2];
              }
              if (!end2) {
                return [start2, void 0];
              }
              return [start2, Number(end2)];
            }
            return void 0;
          }
          Prism2.hooks.add("before-highlightall", function(env) {
            env.selector += ", " + SELECTOR;
          });
          Prism2.hooks.add("before-sanity-check", function(env) {
            var pre2 = (
              /** @type {HTMLPreElement} */
              env.element
            );
            if (pre2.matches(SELECTOR)) {
              env.code = "";
              pre2.setAttribute(STATUS_ATTR, STATUS_LOADING);
              var code2 = pre2.appendChild(document.createElement("CODE"));
              code2.textContent = LOADING_MESSAGE;
              var src = pre2.getAttribute("data-src");
              var language2 = env.language;
              if (language2 === "none") {
                var extension = (/\.(\w+)$/.exec(src) || [, "none"])[1];
                language2 = EXTENSIONS[extension] || extension;
              }
              Prism2.util.setLanguage(code2, language2);
              Prism2.util.setLanguage(pre2, language2);
              var autoloader = Prism2.plugins.autoloader;
              if (autoloader) {
                autoloader.loadLanguages(language2);
              }
              loadFile(
                src,
                function(text2) {
                  pre2.setAttribute(STATUS_ATTR, STATUS_LOADED);
                  var range2 = parseRange(pre2.getAttribute("data-range"));
                  if (range2) {
                    var lines = text2.split(/\r\n?|\n/g);
                    var start2 = range2[0];
                    var end2 = range2[1] == null ? lines.length : range2[1];
                    if (start2 < 0) {
                      start2 += lines.length;
                    }
                    start2 = Math.max(0, Math.min(start2 - 1, lines.length));
                    if (end2 < 0) {
                      end2 += lines.length;
                    }
                    end2 = Math.max(0, Math.min(end2, lines.length));
                    text2 = lines.slice(start2, end2).join("\n");
                    if (!pre2.hasAttribute("data-start")) {
                      pre2.setAttribute("data-start", String(start2 + 1));
                    }
                  }
                  code2.textContent = text2;
                  Prism2.highlightElement(code2);
                },
                function(error2) {
                  pre2.setAttribute(STATUS_ATTR, STATUS_FAILED);
                  code2.textContent = error2;
                }
              );
            }
          });
          Prism2.plugins.fileHighlight = {
            /**
             * Executes the File Highlight plugin for all matching `pre` elements under the given container.
             *
             * Note: Elements which are already loaded or currently loading will not be touched by this method.
             *
             * @param {ParentNode} [container=document]
             */
            highlight: function highlight(container2) {
              var elements = (container2 || document).querySelectorAll(SELECTOR);
              for (var i2 = 0, element; element = elements[i2++]; ) {
                Prism2.highlightElement(element);
              }
            }
          };
          var logged = false;
          Prism2.fileHighlight = function() {
            if (!logged) {
              console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead.");
              logged = true;
            }
            Prism2.plugins.fileHighlight.highlight.apply(this, arguments);
          };
        })();
      })(prism);
      return prism.exports;
    }
    var prismExports = requirePrism();
    (function(Prism2) {
      var envVars = "\\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";
      var commandAfterHeredoc = {
        pattern: /(^(["']?)\w+\2)[ \t]+\S.*/,
        lookbehind: true,
        alias: "punctuation",
        // this looks reasonably well in all themes
        inside: null
        // see below
      };
      var insideString = {
        "bash": commandAfterHeredoc,
        "environment": {
          pattern: RegExp("\\$" + envVars),
          alias: "constant"
        },
        "variable": [
          // [0]: Arithmetic Environment
          {
            pattern: /\$?\(\([\s\S]+?\)\)/,
            greedy: true,
            inside: {
              // If there is a $ sign at the beginning highlight $(( and )) as variable
              "variable": [
                {
                  pattern: /(^\$\(\([\s\S]+)\)\)/,
                  lookbehind: true
                },
                /^\$\(\(/
              ],
              "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: true,
            inside: {
              "variable": /^\$\(|^`|\)$|`$/
            }
          },
          // [2]: Brace expansion
          {
            pattern: /\$\{[^}]+\}/,
            greedy: true,
            inside: {
              "operator": /:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,
              "punctuation": /[\[\]]/,
              "environment": {
                pattern: RegExp("(\\{)" + envVars),
                lookbehind: true,
                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})/
      };
      Prism2.languages.bash = {
        "shebang": {
          pattern: /^#!\s*\/.*/,
          alias: "important"
        },
        "comment": {
          pattern: /(^|[^"{\\$])#.*/,
          lookbehind: true
        },
        "function-name": [
          // a) function foo {
          // b) foo() {
          // c) function foo() {
          // but not “foo {”
          {
            // a) and c)
            pattern: /(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,
            lookbehind: true,
            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: true
        },
        // Highlight variable names as variables in the left-hand part
        // of assignments (“=” and “+=”).
        "assign-left": {
          pattern: /(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,
          inside: {
            "environment": {
              pattern: RegExp("(^|[\\s;|&]|[<>]\\()" + envVars),
              lookbehind: true,
              alias: "constant"
            }
          },
          alias: "variable",
          lookbehind: true
        },
        // Highlight parameter names as variables
        "parameter": {
          pattern: /(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/,
          alias: "variable",
          lookbehind: true
        },
        "string": [
          // Support for Here-documents https://en.wikipedia.org/wiki/Here_document
          {
            pattern: /((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,
            lookbehind: true,
            greedy: true,
            inside: insideString
          },
          // Here-document with quotes around the tag
          // → No expansion (so no “inside”).
          {
            pattern: /((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,
            lookbehind: true,
            greedy: true,
            inside: {
              "bash": commandAfterHeredoc
            }
          },
          // “Normal” string
          {
            // https://www.gnu.org/software/bash/manual/html_node/Double-Quotes.html
            pattern: /(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,
            lookbehind: true,
            greedy: true,
            inside: insideString
          },
          {
            // https://www.gnu.org/software/bash/manual/html_node/Single-Quotes.html
            pattern: /(^|[^$\\])'[^']*'/,
            lookbehind: true,
            greedy: true
          },
          {
            // https://www.gnu.org/software/bash/manual/html_node/ANSI_002dC-Quoting.html
            pattern: /\$'(?:[^'\\]|\\[\s\S])*'/,
            greedy: true,
            inside: {
              "entity": insideString.entity
            }
          }
        ],
        "environment": {
          pattern: RegExp("\\$?" + envVars),
          alias: "constant"
        },
        "variable": insideString.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: true
        },
        "keyword": {
          pattern: /(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,
          lookbehind: true
        },
        // 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: true,
          // Alias added to make those easier to distinguish from strings.
          alias: "class-name"
        },
        "boolean": {
          pattern: /(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,
          lookbehind: true
        },
        "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: true
        }
      };
      commandAfterHeredoc.inside = Prism2.languages.bash;
      var toBeCopied = [
        "comment",
        "function-name",
        "for-or-select",
        "assign-left",
        "parameter",
        "string",
        "environment",
        "function",
        "keyword",
        "builtin",
        "boolean",
        "file-descriptor",
        "operator",
        "punctuation",
        "number"
      ];
      var inside2 = insideString.variable[1].inside;
      for (var i2 = 0; i2 < toBeCopied.length; i2++) {
        inside2[toBeCopied[i2]] = Prism2.languages.bash[toBeCopied[i2]];
      }
      Prism2.languages.sh = Prism2.languages.bash;
      Prism2.languages.shell = Prism2.languages.bash;
    })(Prism);
    Prism.languages.clike = {
      "comment": [
        {
          pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,
          lookbehind: true,
          greedy: true
        },
        {
          pattern: /(^|[^\\:])\/\/.*/,
          lookbehind: true,
          greedy: true
        }
      ],
      "string": {
        pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
        greedy: true
      },
      "class-name": {
        pattern: /(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,
        lookbehind: true,
        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": /[{}[\];(),.:]/
    };
    Prism.languages.javascript = Prism.languages.extend("clike", {
      "class-name": [
        Prism.languages.clike["class-name"],
        {
          pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,
          lookbehind: true
        }
      ],
      "keyword": [
        {
          pattern: /((?:^|\})\s*)catch\b/,
          lookbehind: true
        },
        {
          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: true
        }
      ],
      // 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: true
      },
      "operator": /--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/
    });
    Prism.languages.javascript["class-name"][0].pattern = /(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/;
    Prism.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: true,
        greedy: true,
        inside: {
          "regex-source": {
            pattern: /^(\/)[\s\S]+(?=\/[a-z]*$)/,
            lookbehind: true,
            alias: "language-regex",
            inside: Prism.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: true,
          inside: Prism.languages.javascript
        },
        {
          pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,
          lookbehind: true,
          inside: Prism.languages.javascript
        },
        {
          pattern: /(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,
          lookbehind: true,
          inside: Prism.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: true,
          inside: Prism.languages.javascript
        }
      ],
      "constant": /\b[A-Z](?:[A-Z_]|\dx?)*\b/
    });
    Prism.languages.insertBefore("javascript", "string", {
      "hashbang": {
        pattern: /^#!.*/,
        greedy: true,
        alias: "comment"
      },
      "template-string": {
        pattern: /`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,
        greedy: true,
        inside: {
          "template-punctuation": {
            pattern: /^`|`$/,
            alias: "string"
          },
          "interpolation": {
            pattern: /((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,
            lookbehind: true,
            inside: {
              "interpolation-punctuation": {
                pattern: /^\$\{|\}$/,
                alias: "punctuation"
              },
              rest: Prism.languages.javascript
            }
          },
          "string": /[\s\S]+/
        }
      },
      "string-property": {
        pattern: /((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,
        lookbehind: true,
        greedy: true,
        alias: "property"
      }
    });
    Prism.languages.insertBefore("javascript", "operator", {
      "literal-property": {
        pattern: /((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,
        lookbehind: true,
        alias: "property"
      }
    });
    if (Prism.languages.markup) {
      Prism.languages.markup.tag.addInlined("script", "javascript");
      Prism.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"
      );
    }
    Prism.languages.js = Prism.languages.javascript;
    Prism.languages.json = {
      "property": {
        pattern: /(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,
        lookbehind: true,
        greedy: true
      },
      "string": {
        pattern: /(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,
        lookbehind: true,
        greedy: true
      },
      "comment": {
        pattern: /\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,
        greedy: true
      },
      "number": /-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,
      "punctuation": /[{}[\],]/,
      "operator": /:/,
      "boolean": /\b(?:false|true)\b/,
      "null": {
        pattern: /\bnull\b/,
        alias: "keyword"
      }
    };
    Prism.languages.webmanifest = Prism.languages.json;
    var prismPython = {};
    var hasRequiredPrismPython;
    function requirePrismPython() {
      if (hasRequiredPrismPython) return prismPython;
      hasRequiredPrismPython = 1;
      Prism.languages.python = {
        "comment": {
          pattern: /(^|[^\\])#.*/,
          lookbehind: true,
          greedy: true
        },
        "string-interpolation": {
          pattern: /(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,
          greedy: true,
          inside: {
            "interpolation": {
              // "{" <expression> <optional "!s", "!r", or "!a"> <optional ":" format specifier> "}"
              pattern: /((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,
              lookbehind: true,
              inside: {
                "format-spec": {
                  pattern: /(:)[^:(){}]+(?=\}$)/,
                  lookbehind: true
                },
                "conversion-option": {
                  pattern: /![sra](?=[:}]$)/,
                  alias: "punctuation"
                },
                rest: null
              }
            },
            "string": /[\s\S]+/
          }
        },
        "triple-quoted-string": {
          pattern: /(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,
          greedy: true,
          alias: "string"
        },
        "string": {
          pattern: /(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,
          greedy: true
        },
        "function": {
          pattern: /((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,
          lookbehind: true
        },
        "class-name": {
          pattern: /(\bclass\s+)\w+/i,
          lookbehind: true
        },
        "decorator": {
          pattern: /(^[\t ]*)@\w+(?:\.\w+)*/m,
          lookbehind: true,
          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": /[{}[\];(),.:]/
      };
      Prism.languages.python["string-interpolation"].inside["interpolation"].inside.rest = Prism.languages.python;
      Prism.languages.py = Prism.languages.python;
      return prismPython;
    }
    requirePrismPython();
    (function(Prism2) {
      var anchorOrAlias = /[*&][^\s[\]{},]+/;
      var tag = /!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/;
      var properties = "(?:" + tag.source + "(?:[ 	]+" + anchorOrAlias.source + ")?|" + anchorOrAlias.source + "(?:[ 	]+" + tag.source + ")?)";
      var plainKey = /(?:[^\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;
      });
      var string2 = /"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;
      function createValuePattern(value2, flags) {
        flags = (flags || "").replace(/m/g, "") + "m";
        var pattern = /([:\-,[{]\s*(?:\s<<prop>>[ \t]+)?)(?:<<value>>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<<prop>>/g, function() {
          return properties;
        }).replace(/<<value>>/g, function() {
          return value2;
        });
        return RegExp(pattern, flags);
      }
      Prism2.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 properties;
          })),
          lookbehind: true,
          alias: "string"
        },
        "comment": /#.*/,
        "key": {
          pattern: RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<<prop>>[ \t]+)?)<<key>>(?=\s*:\s)/.source.replace(/<<prop>>/g, function() {
            return properties;
          }).replace(/<<key>>/g, function() {
            return "(?:" + plainKey + "|" + string2 + ")";
          })),
          lookbehind: true,
          greedy: true,
          alias: "atrule"
        },
        "directive": {
          pattern: /(^[ \t]*)%.+/m,
          lookbehind: true,
          alias: "important"
        },
        "datetime": {
          pattern: createValuePattern(/\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: true,
          alias: "number"
        },
        "boolean": {
          pattern: createValuePattern(/false|true/.source, "i"),
          lookbehind: true,
          alias: "important"
        },
        "null": {
          pattern: createValuePattern(/null|~/.source, "i"),
          lookbehind: true,
          alias: "important"
        },
        "string": {
          pattern: createValuePattern(string2),
          lookbehind: true,
          greedy: true
        },
        "number": {
          pattern: createValuePattern(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source, "i"),
          lookbehind: true
        },
        "tag": tag,
        "important": anchorOrAlias,
        "punctuation": /---|[:[\]{}\-,|>?]|\.\.\./
      };
      Prism2.languages.yml = Prism2.languages.yaml;
    })(Prism);
    var clipboard$1 = { exports: {} };
    var clipboard = clipboard$1.exports;
    var hasRequiredClipboard;
    function requireClipboard() {
      if (hasRequiredClipboard) return clipboard$1.exports;
      hasRequiredClipboard = 1;
      (function(module2, exports2) {
        (function webpackUniversalModuleDefinition(root2, factory) {
          module2.exports = factory();
        })(clipboard, function() {
          return (
            /******/
            (function() {
              var __webpack_modules__ = {
                /***/
                686: (
                  /***/
                  (function(__unused_webpack_module, __webpack_exports__, __webpack_require__2) {
                    __webpack_require__2.d(__webpack_exports__, {
                      "default": function() {
                        return (
                          /* binding */
                          clipboard2
                        );
                      }
                    });
                    var tiny_emitter = __webpack_require__2(279);
                    var tiny_emitter_default = /* @__PURE__ */ __webpack_require__2.n(tiny_emitter);
                    var listen = __webpack_require__2(370);
                    var listen_default = /* @__PURE__ */ __webpack_require__2.n(listen);
                    var src_select = __webpack_require__2(817);
                    var select_default = /* @__PURE__ */ __webpack_require__2.n(src_select);
                    function command2(type) {
                      try {
                        return document.execCommand(type);
                      } catch (err2) {
                        return false;
                      }
                    }
                    var ClipboardActionCut = function ClipboardActionCut2(target2) {
                      var selectedText = select_default()(target2);
                      command2("cut");
                      return selectedText;
                    };
                    var actions_cut = ClipboardActionCut;
                    function createFakeElement(value2) {
                      var isRTL = document.documentElement.getAttribute("dir") === "rtl";
                      var fakeElement = document.createElement("textarea");
                      fakeElement.style.fontSize = "12pt";
                      fakeElement.style.border = "0";
                      fakeElement.style.padding = "0";
                      fakeElement.style.margin = "0";
                      fakeElement.style.position = "absolute";
                      fakeElement.style[isRTL ? "right" : "left"] = "-9999px";
                      var yPosition = window.pageYOffset || document.documentElement.scrollTop;
                      fakeElement.style.top = "".concat(yPosition, "px");
                      fakeElement.setAttribute("readonly", "");
                      fakeElement.value = value2;
                      return fakeElement;
                    }
                    var fakeCopyAction = function fakeCopyAction2(value2, options2) {
                      var fakeElement = createFakeElement(value2);
                      options2.container.appendChild(fakeElement);
                      var selectedText = select_default()(fakeElement);
                      command2("copy");
                      fakeElement.remove();
                      return selectedText;
                    };
                    var ClipboardActionCopy = function ClipboardActionCopy2(target2) {
                      var options2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
                        container: document.body
                      };
                      var selectedText = "";
                      if (typeof target2 === "string") {
                        selectedText = fakeCopyAction(target2, options2);
                      } else if (target2 instanceof HTMLInputElement && !["text", "search", "url", "tel", "password"].includes(target2 === null || target2 === void 0 ? void 0 : target2.type)) {
                        selectedText = fakeCopyAction(target2.value, options2);
                      } else {
                        selectedText = select_default()(target2);
                        command2("copy");
                      }
                      return selectedText;
                    };
                    var actions_copy = ClipboardActionCopy;
                    function _typeof(obj) {
                      "@babel/helpers - typeof";
                      if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
                        _typeof = function _typeof2(obj2) {
                          return typeof obj2;
                        };
                      } else {
                        _typeof = function _typeof2(obj2) {
                          return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
                        };
                      }
                      return _typeof(obj);
                    }
                    var ClipboardActionDefault = function ClipboardActionDefault2() {
                      var options2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
                      var _options$action = options2.action, action = _options$action === void 0 ? "copy" : _options$action, container2 = options2.container, target2 = options2.target, text2 = options2.text;
                      if (action !== "copy" && action !== "cut") {
                        throw new Error('Invalid "action" value, use either "copy" or "cut"');
                      }
                      if (target2 !== void 0) {
                        if (target2 && _typeof(target2) === "object" && target2.nodeType === 1) {
                          if (action === "copy" && target2.hasAttribute("disabled")) {
                            throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');
                          }
                          if (action === "cut" && (target2.hasAttribute("readonly") || target2.hasAttribute("disabled"))) {
                            throw new Error(`Invalid "target" attribute. You can't cut text from elements with "readonly" or "disabled" attributes`);
                          }
                        } else {
                          throw new Error('Invalid "target" value, use a valid Element');
                        }
                      }
                      if (text2) {
                        return actions_copy(text2, {
                          container: container2
                        });
                      }
                      if (target2) {
                        return action === "cut" ? actions_cut(target2) : actions_copy(target2, {
                          container: container2
                        });
                      }
                    };
                    var actions_default = ClipboardActionDefault;
                    function clipboard_typeof(obj) {
                      "@babel/helpers - typeof";
                      if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
                        clipboard_typeof = function _typeof2(obj2) {
                          return typeof obj2;
                        };
                      } else {
                        clipboard_typeof = function _typeof2(obj2) {
                          return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
                        };
                      }
                      return clipboard_typeof(obj);
                    }
                    function _classCallCheck(instance, Constructor) {
                      if (!(instance instanceof Constructor)) {
                        throw new TypeError("Cannot call a class as a function");
                      }
                    }
                    function _defineProperties(target2, props) {
                      for (var i2 = 0; i2 < props.length; i2++) {
                        var descriptor = props[i2];
                        descriptor.enumerable = descriptor.enumerable || false;
                        descriptor.configurable = true;
                        if ("value" in descriptor) descriptor.writable = true;
                        Object.defineProperty(target2, descriptor.key, descriptor);
                      }
                    }
                    function _createClass(Constructor, protoProps, staticProps) {
                      if (protoProps) _defineProperties(Constructor.prototype, protoProps);
                      if (staticProps) _defineProperties(Constructor, staticProps);
                      return Constructor;
                    }
                    function _inherits(subClass, superClass) {
                      if (typeof superClass !== "function" && superClass !== null) {
                        throw new TypeError("Super expression must either be null or a function");
                      }
                      subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
                      if (superClass) _setPrototypeOf(subClass, superClass);
                    }
                    function _setPrototypeOf(o, p) {
                      _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf2(o2, p2) {
                        o2.__proto__ = p2;
                        return o2;
                      };
                      return _setPrototypeOf(o, p);
                    }
                    function _createSuper(Derived) {
                      var hasNativeReflectConstruct = _isNativeReflectConstruct();
                      return function _createSuperInternal() {
                        var Super = _getPrototypeOf(Derived), result2;
                        if (hasNativeReflectConstruct) {
                          var NewTarget = _getPrototypeOf(this).constructor;
                          result2 = Reflect.construct(Super, arguments, NewTarget);
                        } else {
                          result2 = Super.apply(this, arguments);
                        }
                        return _possibleConstructorReturn(this, result2);
                      };
                    }
                    function _possibleConstructorReturn(self2, call) {
                      if (call && (clipboard_typeof(call) === "object" || typeof call === "function")) {
                        return call;
                      }
                      return _assertThisInitialized(self2);
                    }
                    function _assertThisInitialized(self2) {
                      if (self2 === void 0) {
                        throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
                      }
                      return self2;
                    }
                    function _isNativeReflectConstruct() {
                      if (typeof Reflect === "undefined" || !Reflect.construct) return false;
                      if (Reflect.construct.sham) return false;
                      if (typeof Proxy === "function") return true;
                      try {
                        Date.prototype.toString.call(Reflect.construct(Date, [], function() {
                        }));
                        return true;
                      } catch (e) {
                        return false;
                      }
                    }
                    function _getPrototypeOf(o) {
                      _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf2(o2) {
                        return o2.__proto__ || Object.getPrototypeOf(o2);
                      };
                      return _getPrototypeOf(o);
                    }
                    function getAttributeValue(suffix, element) {
                      var attribute2 = "data-clipboard-".concat(suffix);
                      if (!element.hasAttribute(attribute2)) {
                        return;
                      }
                      return element.getAttribute(attribute2);
                    }
                    var Clipboard = /* @__PURE__ */ (function(_Emitter) {
                      _inherits(Clipboard2, _Emitter);
                      var _super = _createSuper(Clipboard2);
                      function Clipboard2(trigger, options2) {
                        var _this;
                        _classCallCheck(this, Clipboard2);
                        _this = _super.call(this);
                        _this.resolveOptions(options2);
                        _this.listenClick(trigger);
                        return _this;
                      }
                      _createClass(Clipboard2, [{
                        key: "resolveOptions",
                        value: function resolveOptions() {
                          var options2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
                          this.action = typeof options2.action === "function" ? options2.action : this.defaultAction;
                          this.target = typeof options2.target === "function" ? options2.target : this.defaultTarget;
                          this.text = typeof options2.text === "function" ? options2.text : this.defaultText;
                          this.container = clipboard_typeof(options2.container) === "object" ? options2.container : document.body;
                        }
                        /**
                         * Adds a click event listener to the passed trigger.
                         * @param {String|HTMLElement|HTMLCollection|NodeList} trigger
                         */
                      }, {
                        key: "listenClick",
                        value: function listenClick(trigger) {
                          var _this2 = this;
                          this.listener = listen_default()(trigger, "click", function(e) {
                            return _this2.onClick(e);
                          });
                        }
                        /**
                         * Defines a new `ClipboardAction` on each click event.
                         * @param {Event} e
                         */
                      }, {
                        key: "onClick",
                        value: function onClick(e) {
                          var trigger = e.delegateTarget || e.currentTarget;
                          var action = this.action(trigger) || "copy";
                          var text2 = actions_default({
                            action,
                            container: this.container,
                            target: this.target(trigger),
                            text: this.text(trigger)
                          });
                          this.emit(text2 ? "success" : "error", {
                            action,
                            text: text2,
                            trigger,
                            clearSelection: function clearSelection() {
                              if (trigger) {
                                trigger.focus();
                              }
                              window.getSelection().removeAllRanges();
                            }
                          });
                        }
                        /**
                         * Default `action` lookup function.
                         * @param {Element} trigger
                         */
                      }, {
                        key: "defaultAction",
                        value: function defaultAction(trigger) {
                          return getAttributeValue("action", trigger);
                        }
                        /**
                         * Default `target` lookup function.
                         * @param {Element} trigger
                         */
                      }, {
                        key: "defaultTarget",
                        value: function defaultTarget(trigger) {
                          var selector2 = getAttributeValue("target", trigger);
                          if (selector2) {
                            return document.querySelector(selector2);
                          }
                        }
                        /**
                         * Allow fire programmatically a copy action
                         * @param {String|HTMLElement} target
                         * @param {Object} options
                         * @returns Text copied.
                         */
                      }, {
                        key: "defaultText",
                        /**
                         * Default `text` lookup function.
                         * @param {Element} trigger
                         */
                        value: function defaultText(trigger) {
                          return getAttributeValue("text", trigger);
                        }
                        /**
                         * Destroy lifecycle.
                         */
                      }, {
                        key: "destroy",
                        value: function destroy2() {
                          this.listener.destroy();
                        }
                      }], [{
                        key: "copy",
                        value: function copy2(target2) {
                          var options2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
                            container: document.body
                          };
                          return actions_copy(target2, options2);
                        }
                        /**
                         * Allow fire programmatically a cut action
                         * @param {String|HTMLElement} target
                         * @returns Text cutted.
                         */
                      }, {
                        key: "cut",
                        value: function cut(target2) {
                          return actions_cut(target2);
                        }
                        /**
                         * Returns the support of the given action, or all actions if no action is
                         * given.
                         * @param {String} [action]
                         */
                      }, {
                        key: "isSupported",
                        value: function isSupported() {
                          var action = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : ["copy", "cut"];
                          var actions = typeof action === "string" ? [action] : action;
                          var support = !!document.queryCommandSupported;
                          actions.forEach(function(action2) {
                            support = support && !!document.queryCommandSupported(action2);
                          });
                          return support;
                        }
                      }]);
                      return Clipboard2;
                    })(tiny_emitter_default());
                    var clipboard2 = Clipboard;
                  })
                ),
                /***/
                828: (
                  /***/
                  (function(module3) {
                    var DOCUMENT_NODE_TYPE = 9;
                    if (typeof Element !== "undefined" && !Element.prototype.matches) {
                      var proto = Element.prototype;
                      proto.matches = proto.matchesSelector || proto.mozMatchesSelector || proto.msMatchesSelector || proto.oMatchesSelector || proto.webkitMatchesSelector;
                    }
                    function closest(element, selector2) {
                      while (element && element.nodeType !== DOCUMENT_NODE_TYPE) {
                        if (typeof element.matches === "function" && element.matches(selector2)) {
                          return element;
                        }
                        element = element.parentNode;
                      }
                    }
                    module3.exports = closest;
                  })
                ),
                /***/
                438: (
                  /***/
                  (function(module3, __unused_webpack_exports, __webpack_require__2) {
                    var closest = __webpack_require__2(828);
                    function _delegate(element, selector2, type, callback, useCapture) {
                      var listenerFn = listener.apply(this, arguments);
                      element.addEventListener(type, listenerFn, useCapture);
                      return {
                        destroy: function() {
                          element.removeEventListener(type, listenerFn, useCapture);
                        }
                      };
                    }
                    function delegate(elements, selector2, type, callback, useCapture) {
                      if (typeof elements.addEventListener === "function") {
                        return _delegate.apply(null, arguments);
                      }
                      if (typeof type === "function") {
                        return _delegate.bind(null, document).apply(null, arguments);
                      }
                      if (typeof elements === "string") {
                        elements = document.querySelectorAll(elements);
                      }
                      return Array.prototype.map.call(elements, function(element) {
                        return _delegate(element, selector2, type, callback, useCapture);
                      });
                    }
                    function listener(element, selector2, type, callback) {
                      return function(e) {
                        e.delegateTarget = closest(e.target, selector2);
                        if (e.delegateTarget) {
                          callback.call(element, e);
                        }
                      };
                    }
                    module3.exports = delegate;
                  })
                ),
                /***/
                879: (
                  /***/
                  (function(__unused_webpack_module, exports3) {
                    exports3.node = function(value2) {
                      return value2 !== void 0 && value2 instanceof HTMLElement && value2.nodeType === 1;
                    };
                    exports3.nodeList = function(value2) {
                      var type = Object.prototype.toString.call(value2);
                      return value2 !== void 0 && (type === "[object NodeList]" || type === "[object HTMLCollection]") && "length" in value2 && (value2.length === 0 || exports3.node(value2[0]));
                    };
                    exports3.string = function(value2) {
                      return typeof value2 === "string" || value2 instanceof String;
                    };
                    exports3.fn = function(value2) {
                      var type = Object.prototype.toString.call(value2);
                      return type === "[object Function]";
                    };
                  })
                ),
                /***/
                370: (
                  /***/
                  (function(module3, __unused_webpack_exports, __webpack_require__2) {
                    var is2 = __webpack_require__2(879);
                    var delegate = __webpack_require__2(438);
                    function listen(target2, type, callback) {
                      if (!target2 && !type && !callback) {
                        throw new Error("Missing required arguments");
                      }
                      if (!is2.string(type)) {
                        throw new TypeError("Second argument must be a String");
                      }
                      if (!is2.fn(callback)) {
                        throw new TypeError("Third argument must be a Function");
                      }
                      if (is2.node(target2)) {
                        return listenNode(target2, type, callback);
                      } else if (is2.nodeList(target2)) {
                        return listenNodeList(target2, type, callback);
                      } else if (is2.string(target2)) {
                        return listenSelector(target2, type, callback);
                      } else {
                        throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList");
                      }
                    }
                    function listenNode(node2, type, callback) {
                      node2.addEventListener(type, callback);
                      return {
                        destroy: function() {
                          node2.removeEventListener(type, callback);
                        }
                      };
                    }
                    function listenNodeList(nodeList, type, callback) {
                      Array.prototype.forEach.call(nodeList, function(node2) {
                        node2.addEventListener(type, callback);
                      });
                      return {
                        destroy: function() {
                          Array.prototype.forEach.call(nodeList, function(node2) {
                            node2.removeEventListener(type, callback);
                          });
                        }
                      };
                    }
                    function listenSelector(selector2, type, callback) {
                      return delegate(document.body, selector2, type, callback);
                    }
                    module3.exports = listen;
                  })
                ),
                /***/
                817: (
                  /***/
                  (function(module3) {
                    function select(element) {
                      var selectedText;
                      if (element.nodeName === "SELECT") {
                        element.focus();
                        selectedText = element.value;
                      } else if (element.nodeName === "INPUT" || element.nodeName === "TEXTAREA") {
                        var isReadOnly = element.hasAttribute("readonly");
                        if (!isReadOnly) {
                          element.setAttribute("readonly", "");
                        }
                        element.select();
                        element.setSelectionRange(0, element.value.length);
                        if (!isReadOnly) {
                          element.removeAttribute("readonly");
                        }
                        selectedText = element.value;
                      } else {
                        if (element.hasAttribute("contenteditable")) {
                          element.focus();
                        }
                        var selection = window.getSelection();
                        var range2 = document.createRange();
                        range2.selectNodeContents(element);
                        selection.removeAllRanges();
                        selection.addRange(range2);
                        selectedText = selection.toString();
                      }
                      return selectedText;
                    }
                    module3.exports = select;
                  })
                ),
                /***/
                279: (
                  /***/
                  (function(module3) {
                    function E() {
                    }
                    E.prototype = {
                      on: function(name2, callback, ctx) {
                        var e = this.e || (this.e = {});
                        (e[name2] || (e[name2] = [])).push({
                          fn: callback,
                          ctx
                        });
                        return this;
                      },
                      once: function(name2, callback, ctx) {
                        var self2 = this;
                        function listener() {
                          self2.off(name2, listener);
                          callback.apply(ctx, arguments);
                        }
                        listener._ = callback;
                        return this.on(name2, listener, ctx);
                      },
                      emit: function(name2) {
                        var data = [].slice.call(arguments, 1);
                        var evtArr = ((this.e || (this.e = {}))[name2] || []).slice();
                        var i2 = 0;
                        var len = evtArr.length;
                        for (i2; i2 < len; i2++) {
                          evtArr[i2].fn.apply(evtArr[i2].ctx, data);
                        }
                        return this;
                      },
                      off: function(name2, callback) {
                        var e = this.e || (this.e = {});
                        var evts = e[name2];
                        var liveEvents = [];
                        if (evts && callback) {
                          for (var i2 = 0, len = evts.length; i2 < len; i2++) {
                            if (evts[i2].fn !== callback && evts[i2].fn._ !== callback)
                              liveEvents.push(evts[i2]);
                          }
                        }
                        liveEvents.length ? e[name2] = liveEvents : delete e[name2];
                        return this;
                      }
                    };
                    module3.exports = E;
                    module3.exports.TinyEmitter = E;
                  })
                )
                /******/
              };
              var __webpack_module_cache__ = {};
              function __webpack_require__(moduleId) {
                if (__webpack_module_cache__[moduleId]) {
                  return __webpack_module_cache__[moduleId].exports;
                }
                var module3 = __webpack_module_cache__[moduleId] = {
                  /******/
                  // no module.id needed
                  /******/
                  // no module.loaded needed
                  /******/
                  exports: {}
                  /******/
                };
                __webpack_modules__[moduleId](module3, module3.exports, __webpack_require__);
                return module3.exports;
              }
              !(function() {
                __webpack_require__.n = function(module3) {
                  var getter = module3 && module3.__esModule ? (
                    /******/
                    function() {
                      return module3["default"];
                    }
                  ) : (
                    /******/
                    function() {
                      return module3;
                    }
                  );
                  __webpack_require__.d(getter, { a: getter });
                  return getter;
                };
              })();
              !(function() {
                __webpack_require__.d = function(exports3, definition) {
                  for (var key2 in definition) {
                    if (__webpack_require__.o(definition, key2) && !__webpack_require__.o(exports3, key2)) {
                      Object.defineProperty(exports3, key2, { enumerable: true, get: definition[key2] });
                    }
                  }
                };
              })();
              !(function() {
                __webpack_require__.o = function(obj, prop2) {
                  return Object.prototype.hasOwnProperty.call(obj, prop2);
                };
              })();
              return __webpack_require__(686);
            })().default
          );
        });
      })(clipboard$1);
      return clipboard$1.exports;
    }
    var clipboardExports = requireClipboard();
    const ClipboardJS = /* @__PURE__ */ getDefaultExportFromCjs(clipboardExports);
    var reactExports = requireReact();
    const React20 = /* @__PURE__ */ getDefaultExportFromCjs(reactExports);
    const React4 = /* @__PURE__ */ _mergeNamespaces({
      __proto__: null,
      default: React20
    }, [reactExports]);
    var __typeError = (msg) => {
      throw TypeError(msg);
    };
    var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
    var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
    var __privateAdd = (obj, member, value2) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value2);
    var PopStateEventType = "popstate";
    function createHashHistory(options2 = {}) {
      function createHashLocation(window2, globalHistory) {
        let {
          pathname = "/",
          search = "",
          hash: hash2 = ""
        } = parsePath$1(window2.location.hash.substring(1));
        if (!pathname.startsWith("/") && !pathname.startsWith(".")) {
          pathname = "/" + pathname;
        }
        return createLocation(
          "",
          { pathname, search, hash: hash2 },
          // state defaults to `null` because `window.history.state` does
          globalHistory.state && globalHistory.state.usr || null,
          globalHistory.state && globalHistory.state.key || "default"
        );
      }
      function createHashHref(window2, to2) {
        let base2 = window2.document.querySelector("base");
        let href = "";
        if (base2 && base2.getAttribute("href")) {
          let url = window2.location.href;
          let hashIndex = url.indexOf("#");
          href = hashIndex === -1 ? url : url.slice(0, hashIndex);
        }
        return href + "#" + (typeof to2 === "string" ? to2 : createPath(to2));
      }
      function validateHashLocation(location2, to2) {
        warning(
          location2.pathname.charAt(0) === "/",
          `relative pathnames are not supported in hash history.push(${JSON.stringify(
            to2
          )})`
        );
      }
      return getUrlBasedHistory(
        createHashLocation,
        createHashHref,
        validateHashLocation,
        options2
      );
    }
    function invariant(value2, message2) {
      if (value2 === false || value2 === null || typeof value2 === "undefined") {
        throw new Error(message2);
      }
    }
    function warning(cond, message2) {
      if (!cond) {
        if (typeof console !== "undefined") console.warn(message2);
        try {
          throw new Error(message2);
        } catch (e) {
        }
      }
    }
    function createKey() {
      return Math.random().toString(36).substring(2, 10);
    }
    function getHistoryState(location2, index) {
      return {
        usr: location2.state,
        key: location2.key,
        idx: index
      };
    }
    function createLocation(current2, to2, state = null, key2) {
      let location2 = {
        pathname: typeof current2 === "string" ? current2 : current2.pathname,
        search: "",
        hash: "",
        ...typeof to2 === "string" ? parsePath$1(to2) : to2,
        state,
        // TODO: This could be cleaned up.  push/replace should probably just take
        // full Locations now and avoid the need to run through this flow at all
        // But that's a pretty big refactor to the current test suite so going to
        // keep as is for the time being and just let any incoming keys take precedence
        key: to2 && to2.key || key2 || createKey()
      };
      return location2;
    }
    function createPath({
      pathname = "/",
      search = "",
      hash: hash2 = ""
    }) {
      if (search && search !== "?")
        pathname += search.charAt(0) === "?" ? search : "?" + search;
      if (hash2 && hash2 !== "#")
        pathname += hash2.charAt(0) === "#" ? hash2 : "#" + hash2;
      return pathname;
    }
    function parsePath$1(path) {
      let parsedPath = {};
      if (path) {
        let hashIndex = path.indexOf("#");
        if (hashIndex >= 0) {
          parsedPath.hash = path.substring(hashIndex);
          path = path.substring(0, hashIndex);
        }
        let searchIndex = path.indexOf("?");
        if (searchIndex >= 0) {
          parsedPath.search = path.substring(searchIndex);
          path = path.substring(0, searchIndex);
        }
        if (path) {
          parsedPath.pathname = path;
        }
      }
      return parsedPath;
    }
    function getUrlBasedHistory(getLocation, createHref2, validateLocation, options2 = {}) {
      let { window: window2 = document.defaultView, v5Compat = false } = options2;
      let globalHistory = window2.history;
      let action = "POP";
      let listener = null;
      let index = getIndex();
      if (index == null) {
        index = 0;
        globalHistory.replaceState({ ...globalHistory.state, idx: index }, "");
      }
      function getIndex() {
        let state = globalHistory.state || { idx: null };
        return state.idx;
      }
      function handlePop() {
        action = "POP";
        let nextIndex = getIndex();
        let delta2 = nextIndex == null ? null : nextIndex - index;
        index = nextIndex;
        if (listener) {
          listener({ action, location: history2.location, delta: delta2 });
        }
      }
      function push2(to2, state) {
        action = "PUSH";
        let location2 = createLocation(history2.location, to2, state);
        if (validateLocation) validateLocation(location2, to2);
        index = getIndex() + 1;
        let historyState = getHistoryState(location2, index);
        let url = history2.createHref(location2);
        try {
          globalHistory.pushState(historyState, "", url);
        } catch (error2) {
          if (error2 instanceof DOMException && error2.name === "DataCloneError") {
            throw error2;
          }
          window2.location.assign(url);
        }
        if (v5Compat && listener) {
          listener({ action, location: history2.location, delta: 1 });
        }
      }
      function replace2(to2, state) {
        action = "REPLACE";
        let location2 = createLocation(history2.location, to2, state);
        if (validateLocation) validateLocation(location2, to2);
        index = getIndex();
        let historyState = getHistoryState(location2, index);
        let url = history2.createHref(location2);
        globalHistory.replaceState(historyState, "", url);
        if (v5Compat && listener) {
          listener({ action, location: history2.location, delta: 0 });
        }
      }
      function createURL(to2) {
        return createBrowserURLImpl(to2);
      }
      let history2 = {
        get action() {
          return action;
        },
        get location() {
          return getLocation(window2, globalHistory);
        },
        listen(fn2) {
          if (listener) {
            throw new Error("A history only accepts one active listener");
          }
          window2.addEventListener(PopStateEventType, handlePop);
          listener = fn2;
          return () => {
            window2.removeEventListener(PopStateEventType, handlePop);
            listener = null;
          };
        },
        createHref(to2) {
          return createHref2(window2, to2);
        },
        createURL,
        encodeLocation(to2) {
          let url = createURL(to2);
          return {
            pathname: url.pathname,
            search: url.search,
            hash: url.hash
          };
        },
        push: push2,
        replace: replace2,
        go(n) {
          return globalHistory.go(n);
        }
      };
      return history2;
    }
    function createBrowserURLImpl(to2, isAbsolute = false) {
      let base2 = "http://localhost";
      if (typeof window !== "undefined") {
        base2 = window.location.origin !== "null" ? window.location.origin : window.location.href;
      }
      invariant(base2, "No window.location.(origin|href) available to create URL");
      let href = typeof to2 === "string" ? to2 : createPath(to2);
      href = href.replace(/ $/, "%20");
      if (!isAbsolute && href.startsWith("//")) {
        href = base2 + href;
      }
      return new URL(href, base2);
    }
    var _map;
    var RouterContextProvider = class {
      /**
       * Create a new `RouterContextProvider` instance
       * @param init An optional initial context map to populate the provider with
       */
      constructor(init2) {
        __privateAdd(this, _map, /* @__PURE__ */ new Map());
        if (init2) {
          for (let [context, value2] of init2) {
            this.set(context, value2);
          }
        }
      }
      /**
       * Access a value from the context. If no value has been set for the context,
       * it will return the context's `defaultValue` if provided, or throw an error
       * if no `defaultValue` was set.
       * @param context The context to get the value for
       * @returns The value for the context, or the context's `defaultValue` if no
       * value was set
       */
      get(context) {
        if (__privateGet(this, _map).has(context)) {
          return __privateGet(this, _map).get(context);
        }
        if (context.defaultValue !== void 0) {
          return context.defaultValue;
        }
        throw new Error("No value found for context");
      }
      /**
       * Set a value for the context. If the context already has a value set, this
       * will overwrite it.
       *
       * @param context The context to set the value for
       * @param value The value to set for the context
       * @returns {void}
       */
      set(context, value2) {
        __privateGet(this, _map).set(context, value2);
      }
    };
    _map = /* @__PURE__ */ new WeakMap();
    var unsupportedLazyRouteObjectKeys = /* @__PURE__ */ new Set([
      "lazy",
      "caseSensitive",
      "path",
      "id",
      "index",
      "children"
    ]);
    function isUnsupportedLazyRouteObjectKey(key2) {
      return unsupportedLazyRouteObjectKeys.has(
        key2
      );
    }
    var unsupportedLazyRouteFunctionKeys = /* @__PURE__ */ new Set([
      "lazy",
      "caseSensitive",
      "path",
      "id",
      "index",
      "middleware",
      "children"
    ]);
    function isUnsupportedLazyRouteFunctionKey(key2) {
      return unsupportedLazyRouteFunctionKeys.has(
        key2
      );
    }
    function isIndexRoute(route) {
      return route.index === true;
    }
    function convertRoutesToDataRoutes(routes, mapRouteProperties2, parentPath = [], manifest = {}, allowInPlaceMutations = false) {
      return routes.map((route, index) => {
        let treePath = [...parentPath, String(index)];
        let id = typeof route.id === "string" ? route.id : treePath.join("-");
        invariant(
          route.index !== true || !route.children,
          `Cannot specify children on an index route`
        );
        invariant(
          allowInPlaceMutations || !manifest[id],
          `Found a route id collision on id "${id}".  Route id's must be globally unique within Data Router usages`
        );
        if (isIndexRoute(route)) {
          let indexRoute = {
            ...route,
            id
          };
          manifest[id] = mergeRouteUpdates(
            indexRoute,
            mapRouteProperties2(indexRoute)
          );
          return indexRoute;
        } else {
          let pathOrLayoutRoute = {
            ...route,
            id,
            children: void 0
          };
          manifest[id] = mergeRouteUpdates(
            pathOrLayoutRoute,
            mapRouteProperties2(pathOrLayoutRoute)
          );
          if (route.children) {
            pathOrLayoutRoute.children = convertRoutesToDataRoutes(
              route.children,
              mapRouteProperties2,
              treePath,
              manifest,
              allowInPlaceMutations
            );
          }
          return pathOrLayoutRoute;
        }
      });
    }
    function mergeRouteUpdates(route, updates) {
      return Object.assign(route, {
        ...updates,
        ...typeof updates.lazy === "object" && updates.lazy != null ? {
          lazy: {
            ...route.lazy,
            ...updates.lazy
          }
        } : {}
      });
    }
    function matchRoutes(routes, locationArg, basename2 = "/") {
      return matchRoutesImpl(routes, locationArg, basename2, false);
    }
    function matchRoutesImpl(routes, locationArg, basename2, allowPartial) {
      let location2 = typeof locationArg === "string" ? parsePath$1(locationArg) : locationArg;
      let pathname = stripBasename(location2.pathname || "/", basename2);
      if (pathname == null) {
        return null;
      }
      let branches = flattenRoutes(routes);
      rankRouteBranches(branches);
      let matches = null;
      for (let i2 = 0; matches == null && i2 < branches.length; ++i2) {
        let decoded = decodePath(pathname);
        matches = matchRouteBranch(
          branches[i2],
          decoded,
          allowPartial
        );
      }
      return matches;
    }
    function convertRouteMatchToUiMatch(match, loaderData) {
      let { route, pathname, params } = match;
      return {
        id: route.id,
        pathname,
        params,
        data: loaderData[route.id],
        loaderData: loaderData[route.id],
        handle: route.handle
      };
    }
    function flattenRoutes(routes, branches = [], parentsMeta = [], parentPath = "", _hasParentOptionalSegments = false) {
      let flattenRoute = (route, index, hasParentOptionalSegments = _hasParentOptionalSegments, relativePath) => {
        let meta2 = {
          relativePath: relativePath === void 0 ? route.path || "" : relativePath,
          caseSensitive: route.caseSensitive === true,
          childrenIndex: index,
          route
        };
        if (meta2.relativePath.startsWith("/")) {
          if (!meta2.relativePath.startsWith(parentPath) && hasParentOptionalSegments) {
            return;
          }
          invariant(
            meta2.relativePath.startsWith(parentPath),
            `Absolute route path "${meta2.relativePath}" nested under path "${parentPath}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`
          );
          meta2.relativePath = meta2.relativePath.slice(parentPath.length);
        }
        let path = joinPaths([parentPath, meta2.relativePath]);
        let routesMeta = parentsMeta.concat(meta2);
        if (route.children && route.children.length > 0) {
          invariant(
            // Our types know better, but runtime JS may not!
            // @ts-expect-error
            route.index !== true,
            `Index routes must not have child routes. Please remove all child routes from route path "${path}".`
          );
          flattenRoutes(
            route.children,
            branches,
            routesMeta,
            path,
            hasParentOptionalSegments
          );
        }
        if (route.path == null && !route.index) {
          return;
        }
        branches.push({
          path,
          score: computeScore(path, route.index),
          routesMeta
        });
      };
      routes.forEach((route, index) => {
        if (route.path === "" || !route.path?.includes("?")) {
          flattenRoute(route, index);
        } else {
          for (let exploded of explodeOptionalSegments(route.path)) {
            flattenRoute(route, index, true, exploded);
          }
        }
      });
      return branches;
    }
    function explodeOptionalSegments(path) {
      let segments2 = path.split("/");
      if (segments2.length === 0) return [];
      let [first, ...rest] = segments2;
      let isOptional = first.endsWith("?");
      let required = first.replace(/\?$/, "");
      if (rest.length === 0) {
        return isOptional ? [required, ""] : [required];
      }
      let restExploded = explodeOptionalSegments(rest.join("/"));
      let result2 = [];
      result2.push(
        ...restExploded.map(
          (subpath) => subpath === "" ? required : [required, subpath].join("/")
        )
      );
      if (isOptional) {
        result2.push(...restExploded);
      }
      return result2.map(
        (exploded) => path.startsWith("/") && exploded === "" ? "/" : exploded
      );
    }
    function rankRouteBranches(branches) {
      branches.sort(
        (a, b) => a.score !== b.score ? b.score - a.score : compareIndexes(
          a.routesMeta.map((meta2) => meta2.childrenIndex),
          b.routesMeta.map((meta2) => meta2.childrenIndex)
        )
      );
    }
    var paramRe = /^:[\w-]+$/;
    var dynamicSegmentValue = 3;
    var indexRouteValue = 2;
    var emptySegmentValue = 1;
    var staticSegmentValue = 10;
    var splatPenalty = -2;
    var isSplat = (s) => s === "*";
    function computeScore(path, index) {
      let segments2 = path.split("/");
      let initialScore = segments2.length;
      if (segments2.some(isSplat)) {
        initialScore += splatPenalty;
      }
      if (index) {
        initialScore += indexRouteValue;
      }
      return segments2.filter((s) => !isSplat(s)).reduce(
        (score2, segment2) => score2 + (paramRe.test(segment2) ? dynamicSegmentValue : segment2 === "" ? emptySegmentValue : staticSegmentValue),
        initialScore
      );
    }
    function compareIndexes(a, b) {
      let siblings = a.length === b.length && a.slice(0, -1).every((n, i2) => n === b[i2]);
      return siblings ? (
        // If two routes are siblings, we should try to match the earlier sibling
        // first. This allows people to have fine-grained control over the matching
        // behavior by simply putting routes with identical paths in the order they
        // want them tried.
        a[a.length - 1] - b[b.length - 1]
      ) : (
        // Otherwise, it doesn't really make sense to rank non-siblings by index,
        // so they sort equally.
        0
      );
    }
    function matchRouteBranch(branch, pathname, allowPartial = false) {
      let { routesMeta } = branch;
      let matchedParams = {};
      let matchedPathname = "/";
      let matches = [];
      for (let i2 = 0; i2 < routesMeta.length; ++i2) {
        let meta2 = routesMeta[i2];
        let end2 = i2 === routesMeta.length - 1;
        let remainingPathname = matchedPathname === "/" ? pathname : pathname.slice(matchedPathname.length) || "/";
        let match = matchPath(
          { path: meta2.relativePath, caseSensitive: meta2.caseSensitive, end: end2 },
          remainingPathname
        );
        let route = meta2.route;
        if (!match && end2 && allowPartial && !routesMeta[routesMeta.length - 1].route.index) {
          match = matchPath(
            {
              path: meta2.relativePath,
              caseSensitive: meta2.caseSensitive,
              end: false
            },
            remainingPathname
          );
        }
        if (!match) {
          return null;
        }
        Object.assign(matchedParams, match.params);
        matches.push({
          // TODO: Can this as be avoided?
          params: matchedParams,
          pathname: joinPaths([matchedPathname, match.pathname]),
          pathnameBase: normalizePathname(
            joinPaths([matchedPathname, match.pathnameBase])
          ),
          route
        });
        if (match.pathnameBase !== "/") {
          matchedPathname = joinPaths([matchedPathname, match.pathnameBase]);
        }
      }
      return matches;
    }
    function matchPath(pattern, pathname) {
      if (typeof pattern === "string") {
        pattern = { path: pattern, caseSensitive: false, end: true };
      }
      let [matcher, compiledParams] = compilePath(
        pattern.path,
        pattern.caseSensitive,
        pattern.end
      );
      let match = pathname.match(matcher);
      if (!match) return null;
      let matchedPathname = match[0];
      let pathnameBase = matchedPathname.replace(/(.)\/+$/, "$1");
      let captureGroups = match.slice(1);
      let params = compiledParams.reduce(
        (memo2, { paramName, isOptional }, index) => {
          if (paramName === "*") {
            let splatValue = captureGroups[index] || "";
            pathnameBase = matchedPathname.slice(0, matchedPathname.length - splatValue.length).replace(/(.)\/+$/, "$1");
          }
          const value2 = captureGroups[index];
          if (isOptional && !value2) {
            memo2[paramName] = void 0;
          } else {
            memo2[paramName] = (value2 || "").replace(/%2F/g, "/");
          }
          return memo2;
        },
        {}
      );
      return {
        params,
        pathname: matchedPathname,
        pathnameBase,
        pattern
      };
    }
    function compilePath(path, caseSensitive = false, end2 = true) {
      warning(
        path === "*" || !path.endsWith("*") || path.endsWith("/*"),
        `Route path "${path}" will be treated as if it were "${path.replace(/\*$/, "/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${path.replace(/\*$/, "/*")}".`
      );
      let params = [];
      let regexpSource = "^" + path.replace(/\/*\*?$/, "").replace(/^\/*/, "/").replace(/[\\.*+^${}|()[\]]/g, "\\$&").replace(
        /\/:([\w-]+)(\?)?/g,
        (_, paramName, isOptional) => {
          params.push({ paramName, isOptional: isOptional != null });
          return isOptional ? "/?([^\\/]+)?" : "/([^\\/]+)";
        }
      ).replace(/\/([\w-]+)\?(\/|$)/g, "(/$1)?$2");
      if (path.endsWith("*")) {
        params.push({ paramName: "*" });
        regexpSource += path === "*" || path === "/*" ? "(.*)$" : "(?:\\/(.+)|\\/*)$";
      } else if (end2) {
        regexpSource += "\\/*$";
      } else if (path !== "" && path !== "/") {
        regexpSource += "(?:(?=\\/|$))";
      } else ;
      let matcher = new RegExp(regexpSource, caseSensitive ? void 0 : "i");
      return [matcher, params];
    }
    function decodePath(value2) {
      try {
        return value2.split("/").map((v) => decodeURIComponent(v).replace(/\//g, "%2F")).join("/");
      } catch (error2) {
        warning(
          false,
          `The URL path "${value2}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${error2}).`
        );
        return value2;
      }
    }
    function stripBasename(pathname, basename2) {
      if (basename2 === "/") return pathname;
      if (!pathname.toLowerCase().startsWith(basename2.toLowerCase())) {
        return null;
      }
      let startIndex = basename2.endsWith("/") ? basename2.length - 1 : basename2.length;
      let nextChar = pathname.charAt(startIndex);
      if (nextChar && nextChar !== "/") {
        return null;
      }
      return pathname.slice(startIndex) || "/";
    }
    function prependBasename({
      basename: basename2,
      pathname
    }) {
      return pathname === "/" ? basename2 : joinPaths([basename2, pathname]);
    }
    var ABSOLUTE_URL_REGEX = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;
    var isAbsoluteUrl = (url) => ABSOLUTE_URL_REGEX.test(url);
    function resolvePath(to2, fromPathname = "/") {
      let {
        pathname: toPathname,
        search = "",
        hash: hash2 = ""
      } = typeof to2 === "string" ? parsePath$1(to2) : to2;
      let pathname;
      if (toPathname) {
        if (isAbsoluteUrl(toPathname)) {
          pathname = toPathname;
        } else {
          if (toPathname.includes("//")) {
            let oldPathname = toPathname;
            toPathname = toPathname.replace(/\/\/+/g, "/");
            warning(
              false,
              `Pathnames cannot have embedded double slashes - normalizing ${oldPathname} -> ${toPathname}`
            );
          }
          if (toPathname.startsWith("/")) {
            pathname = resolvePathname(toPathname.substring(1), "/");
          } else {
            pathname = resolvePathname(toPathname, fromPathname);
          }
        }
      } else {
        pathname = fromPathname;
      }
      return {
        pathname,
        search: normalizeSearch(search),
        hash: normalizeHash(hash2)
      };
    }
    function resolvePathname(relativePath, fromPathname) {
      let segments2 = fromPathname.replace(/\/+$/, "").split("/");
      let relativeSegments = relativePath.split("/");
      relativeSegments.forEach((segment2) => {
        if (segment2 === "..") {
          if (segments2.length > 1) segments2.pop();
        } else if (segment2 !== ".") {
          segments2.push(segment2);
        }
      });
      return segments2.length > 1 ? segments2.join("/") : "/";
    }
    function getInvalidPathError(char, field, dest, path) {
      return `Cannot include a '${char}' character in a manually specified \`to.${field}\` field [${JSON.stringify(
        path
      )}].  Please separate it out to the \`to.${dest}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`;
    }
    function getPathContributingMatches(matches) {
      return matches.filter(
        (match, index) => index === 0 || match.route.path && match.route.path.length > 0
      );
    }
    function getResolveToMatches(matches) {
      let pathMatches = getPathContributingMatches(matches);
      return pathMatches.map(
        (match, idx) => idx === pathMatches.length - 1 ? match.pathname : match.pathnameBase
      );
    }
    function resolveTo(toArg, routePathnames, locationPathname, isPathRelative = false) {
      let to2;
      if (typeof toArg === "string") {
        to2 = parsePath$1(toArg);
      } else {
        to2 = { ...toArg };
        invariant(
          !to2.pathname || !to2.pathname.includes("?"),
          getInvalidPathError("?", "pathname", "search", to2)
        );
        invariant(
          !to2.pathname || !to2.pathname.includes("#"),
          getInvalidPathError("#", "pathname", "hash", to2)
        );
        invariant(
          !to2.search || !to2.search.includes("#"),
          getInvalidPathError("#", "search", "hash", to2)
        );
      }
      let isEmptyPath = toArg === "" || to2.pathname === "";
      let toPathname = isEmptyPath ? "/" : to2.pathname;
      let from;
      if (toPathname == null) {
        from = locationPathname;
      } else {
        let routePathnameIndex = routePathnames.length - 1;
        if (!isPathRelative && toPathname.startsWith("..")) {
          let toSegments = toPathname.split("/");
          while (toSegments[0] === "..") {
            toSegments.shift();
            routePathnameIndex -= 1;
          }
          to2.pathname = toSegments.join("/");
        }
        from = routePathnameIndex >= 0 ? routePathnames[routePathnameIndex] : "/";
      }
      let path = resolvePath(to2, from);
      let hasExplicitTrailingSlash = toPathname && toPathname !== "/" && toPathname.endsWith("/");
      let hasCurrentTrailingSlash = (isEmptyPath || toPathname === ".") && locationPathname.endsWith("/");
      if (!path.pathname.endsWith("/") && (hasExplicitTrailingSlash || hasCurrentTrailingSlash)) {
        path.pathname += "/";
      }
      return path;
    }
    var joinPaths = (paths) => paths.join("/").replace(/\/\/+/g, "/");
    var normalizePathname = (pathname) => pathname.replace(/\/+$/, "").replace(/^\/*/, "/");
    var normalizeSearch = (search) => !search || search === "?" ? "" : search.startsWith("?") ? search : "?" + search;
    var normalizeHash = (hash2) => !hash2 || hash2 === "#" ? "" : hash2.startsWith("#") ? hash2 : "#" + hash2;
    var ErrorResponseImpl = class {
      constructor(status2, statusText2, data2, internal = false) {
        this.status = status2;
        this.statusText = statusText2 || "";
        this.internal = internal;
        if (data2 instanceof Error) {
          this.data = data2.toString();
          this.error = data2;
        } else {
          this.data = data2;
        }
      }
    };
    function isRouteErrorResponse(error2) {
      return error2 != null && typeof error2.status === "number" && typeof error2.statusText === "string" && typeof error2.internal === "boolean" && "data" in error2;
    }
    function getRoutePattern(matches) {
      return matches.map((m) => m.route.path).filter(Boolean).join("/").replace(/\/\/*/g, "/") || "/";
    }
    var isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";
    function parseToInfo(_to, basename2) {
      let to2 = _to;
      if (typeof to2 !== "string" || !ABSOLUTE_URL_REGEX.test(to2)) {
        return {
          absoluteURL: void 0,
          isExternal: false,
          to: to2
        };
      }
      let absoluteURL = to2;
      let isExternal = false;
      if (isBrowser) {
        try {
          let currentUrl = new URL(window.location.href);
          let targetUrl = to2.startsWith("//") ? new URL(currentUrl.protocol + to2) : new URL(to2);
          let path = stripBasename(targetUrl.pathname, basename2);
          if (targetUrl.origin === currentUrl.origin && path != null) {
            to2 = path + targetUrl.search + targetUrl.hash;
          } else {
            isExternal = true;
          }
        } catch (e) {
          warning(
            false,
            `<Link to="${to2}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`
          );
        }
      }
      return {
        absoluteURL,
        isExternal,
        to: to2
      };
    }
    var UninstrumentedSymbol = Symbol("Uninstrumented");
    function getRouteInstrumentationUpdates(fns, route) {
      let aggregated = {
        lazy: [],
        "lazy.loader": [],
        "lazy.action": [],
        "lazy.middleware": [],
        middleware: [],
        loader: [],
        action: []
      };
      fns.forEach(
        (fn2) => fn2({
          id: route.id,
          index: route.index,
          path: route.path,
          instrument(i2) {
            let keys = Object.keys(aggregated);
            for (let key2 of keys) {
              if (i2[key2]) {
                aggregated[key2].push(i2[key2]);
              }
            }
          }
        })
      );
      let updates = {};
      if (typeof route.lazy === "function" && aggregated.lazy.length > 0) {
        let instrumented = wrapImpl(aggregated.lazy, route.lazy, () => void 0);
        if (instrumented) {
          updates.lazy = instrumented;
        }
      }
      if (typeof route.lazy === "object") {
        let lazyObject = route.lazy;
        ["middleware", "loader", "action"].forEach((key2) => {
          let lazyFn = lazyObject[key2];
          let instrumentations = aggregated[`lazy.${key2}`];
          if (typeof lazyFn === "function" && instrumentations.length > 0) {
            let instrumented = wrapImpl(instrumentations, lazyFn, () => void 0);
            if (instrumented) {
              updates.lazy = Object.assign(updates.lazy || {}, {
                [key2]: instrumented
              });
            }
          }
        });
      }
      ["loader", "action"].forEach((key2) => {
        let handler = route[key2];
        if (typeof handler === "function" && aggregated[key2].length > 0) {
          let original = handler[UninstrumentedSymbol] ?? handler;
          let instrumented = wrapImpl(
            aggregated[key2],
            original,
            (...args2) => getHandlerInfo(args2[0])
          );
          if (instrumented) {
            instrumented[UninstrumentedSymbol] = original;
            updates[key2] = instrumented;
          }
        }
      });
      if (route.middleware && route.middleware.length > 0 && aggregated.middleware.length > 0) {
        updates.middleware = route.middleware.map((middleware) => {
          let original = middleware[UninstrumentedSymbol] ?? middleware;
          let instrumented = wrapImpl(
            aggregated.middleware,
            original,
            (...args2) => getHandlerInfo(args2[0])
          );
          if (instrumented) {
            instrumented[UninstrumentedSymbol] = original;
            return instrumented;
          }
          return middleware;
        });
      }
      return updates;
    }
    function instrumentClientSideRouter(router, fns) {
      let aggregated = {
        navigate: [],
        fetch: []
      };
      fns.forEach(
        (fn2) => fn2({
          instrument(i2) {
            let keys = Object.keys(i2);
            for (let key2 of keys) {
              if (i2[key2]) {
                aggregated[key2].push(i2[key2]);
              }
            }
          }
        })
      );
      if (aggregated.navigate.length > 0) {
        let navigate = router.navigate[UninstrumentedSymbol] ?? router.navigate;
        let instrumentedNavigate = wrapImpl(
          aggregated.navigate,
          navigate,
          (...args2) => {
            let [to2, opts] = args2;
            return {
              to: typeof to2 === "number" || typeof to2 === "string" ? to2 : to2 ? createPath(to2) : ".",
              ...getRouterInfo(router, opts ?? {})
            };
          }
        );
        if (instrumentedNavigate) {
          instrumentedNavigate[UninstrumentedSymbol] = navigate;
          router.navigate = instrumentedNavigate;
        }
      }
      if (aggregated.fetch.length > 0) {
        let fetch2 = router.fetch[UninstrumentedSymbol] ?? router.fetch;
        let instrumentedFetch = wrapImpl(aggregated.fetch, fetch2, (...args2) => {
          let [key2, , href, opts] = args2;
          return {
            href: href ?? ".",
            fetcherKey: key2,
            ...getRouterInfo(router, opts ?? {})
          };
        });
        if (instrumentedFetch) {
          instrumentedFetch[UninstrumentedSymbol] = fetch2;
          router.fetch = instrumentedFetch;
        }
      }
      return router;
    }
    function wrapImpl(impls, handler, getInfo) {
      if (impls.length === 0) {
        return null;
      }
      return async (...args2) => {
        let result2 = await recurseRight(
          impls,
          getInfo(...args2),
          () => handler(...args2),
          impls.length - 1
        );
        if (result2.type === "error") {
          throw result2.value;
        }
        return result2.value;
      };
    }
    async function recurseRight(impls, info, handler, index) {
      let impl = impls[index];
      let result2;
      if (!impl) {
        try {
          let value2 = await handler();
          result2 = { type: "success", value: value2 };
        } catch (e) {
          result2 = { type: "error", value: e };
        }
      } else {
        let handlerPromise = void 0;
        let callHandler = async () => {
          if (handlerPromise) {
            console.error("You cannot call instrumented handlers more than once");
          } else {
            handlerPromise = recurseRight(impls, info, handler, index - 1);
          }
          result2 = await handlerPromise;
          invariant(result2, "Expected a result");
          if (result2.type === "error" && result2.value instanceof Error) {
            return { status: "error", error: result2.value };
          }
          return { status: "success", error: void 0 };
        };
        try {
          await impl(callHandler, info);
        } catch (e) {
          console.error("An instrumentation function threw an error:", e);
        }
        if (!handlerPromise) {
          await callHandler();
        }
        await handlerPromise;
      }
      if (result2) {
        return result2;
      }
      return {
        type: "error",
        value: new Error("No result assigned in instrumentation chain.")
      };
    }
    function getHandlerInfo(args2) {
      let { request, context, params, unstable_pattern } = args2;
      return {
        request: getReadonlyRequest(request),
        params: { ...params },
        unstable_pattern,
        context: getReadonlyContext(context)
      };
    }
    function getRouterInfo(router, opts) {
      return {
        currentUrl: createPath(router.state.location),
        ..."formMethod" in opts ? { formMethod: opts.formMethod } : {},
        ..."formEncType" in opts ? { formEncType: opts.formEncType } : {},
        ..."formData" in opts ? { formData: opts.formData } : {},
        ..."body" in opts ? { body: opts.body } : {}
      };
    }
    function getReadonlyRequest(request) {
      return {
        method: request.method,
        url: request.url,
        headers: {
          get: (...args2) => request.headers.get(...args2)
        }
      };
    }
    function getReadonlyContext(context) {
      if (isPlainObject$1(context)) {
        let frozen = { ...context };
        Object.freeze(frozen);
        return frozen;
      } else {
        return {
          get: (ctx) => context.get(ctx)
        };
      }
    }
    var objectProtoNames = Object.getOwnPropertyNames(Object.prototype).sort().join("\0");
    function isPlainObject$1(thing) {
      if (thing === null || typeof thing !== "object") {
        return false;
      }
      const proto = Object.getPrototypeOf(thing);
      return proto === Object.prototype || proto === null || Object.getOwnPropertyNames(proto).sort().join("\0") === objectProtoNames;
    }
    var validMutationMethodsArr = [
      "POST",
      "PUT",
      "PATCH",
      "DELETE"
    ];
    var validMutationMethods = new Set(
      validMutationMethodsArr
    );
    var validRequestMethodsArr = [
      "GET",
      ...validMutationMethodsArr
    ];
    var validRequestMethods = new Set(validRequestMethodsArr);
    var redirectStatusCodes = /* @__PURE__ */ new Set([301, 302, 303, 307, 308]);
    var redirectPreserveMethodStatusCodes = /* @__PURE__ */ new Set([307, 308]);
    var IDLE_NAVIGATION = {
      state: "idle",
      location: void 0,
      formMethod: void 0,
      formAction: void 0,
      formEncType: void 0,
      formData: void 0,
      json: void 0,
      text: void 0
    };
    var IDLE_FETCHER = {
      state: "idle",
      data: void 0,
      formMethod: void 0,
      formAction: void 0,
      formEncType: void 0,
      formData: void 0,
      json: void 0,
      text: void 0
    };
    var IDLE_BLOCKER = {
      state: "unblocked",
      proceed: void 0,
      reset: void 0,
      location: void 0
    };
    var defaultMapRouteProperties = (route) => ({
      hasErrorBoundary: Boolean(route.hasErrorBoundary)
    });
    var TRANSITIONS_STORAGE_KEY = "remix-router-transitions";
    var ResetLoaderDataSymbol = Symbol("ResetLoaderData");
    function createRouter(init2) {
      const routerWindow = init2.window ? init2.window : typeof window !== "undefined" ? window : void 0;
      const isBrowser3 = typeof routerWindow !== "undefined" && typeof routerWindow.document !== "undefined" && typeof routerWindow.document.createElement !== "undefined";
      invariant(
        init2.routes.length > 0,
        "You must provide a non-empty routes array to createRouter"
      );
      let hydrationRouteProperties2 = init2.hydrationRouteProperties || [];
      let _mapRouteProperties = init2.mapRouteProperties || defaultMapRouteProperties;
      let mapRouteProperties2 = _mapRouteProperties;
      if (init2.unstable_instrumentations) {
        let instrumentations = init2.unstable_instrumentations;
        mapRouteProperties2 = (route) => {
          return {
            ..._mapRouteProperties(route),
            ...getRouteInstrumentationUpdates(
              instrumentations.map((i2) => i2.route).filter(Boolean),
              route
            )
          };
        };
      }
      let manifest = {};
      let dataRoutes = convertRoutesToDataRoutes(
        init2.routes,
        mapRouteProperties2,
        void 0,
        manifest
      );
      let inFlightDataRoutes;
      let basename2 = init2.basename || "/";
      if (!basename2.startsWith("/")) {
        basename2 = `/${basename2}`;
      }
      let dataStrategyImpl = init2.dataStrategy || defaultDataStrategyWithMiddleware;
      let future = {
        ...init2.future
      };
      let unlistenHistory = null;
      let subscribers = /* @__PURE__ */ new Set();
      let savedScrollPositions2 = null;
      let getScrollRestorationKey2 = null;
      let getScrollPosition = null;
      let initialScrollRestored = init2.hydrationData != null;
      let initialMatches = matchRoutes(dataRoutes, init2.history.location, basename2);
      let initialMatchesIsFOW = false;
      let initialErrors = null;
      let initialized;
      if (initialMatches == null && !init2.patchRoutesOnNavigation) {
        let error2 = getInternalRouterError(404, {
          pathname: init2.history.location.pathname
        });
        let { matches, route } = getShortCircuitMatches(dataRoutes);
        initialized = true;
        initialMatches = matches;
        initialErrors = { [route.id]: error2 };
      } else {
        if (initialMatches && !init2.hydrationData) {
          let fogOfWar = checkFogOfWar(
            initialMatches,
            dataRoutes,
            init2.history.location.pathname
          );
          if (fogOfWar.active) {
            initialMatches = null;
          }
        }
        if (!initialMatches) {
          initialized = false;
          initialMatches = [];
          let fogOfWar = checkFogOfWar(
            null,
            dataRoutes,
            init2.history.location.pathname
          );
          if (fogOfWar.active && fogOfWar.matches) {
            initialMatchesIsFOW = true;
            initialMatches = fogOfWar.matches;
          }
        } else if (initialMatches.some((m) => m.route.lazy)) {
          initialized = false;
        } else if (!initialMatches.some((m) => routeHasLoaderOrMiddleware(m.route))) {
          initialized = true;
        } else {
          let loaderData = init2.hydrationData ? init2.hydrationData.loaderData : null;
          let errors2 = init2.hydrationData ? init2.hydrationData.errors : null;
          if (errors2) {
            let idx = initialMatches.findIndex(
              (m) => errors2[m.route.id] !== void 0
            );
            initialized = initialMatches.slice(0, idx + 1).every(
              (m) => !shouldLoadRouteOnHydration(m.route, loaderData, errors2)
            );
          } else {
            initialized = initialMatches.every(
              (m) => !shouldLoadRouteOnHydration(m.route, loaderData, errors2)
            );
          }
        }
      }
      let router;
      let state = {
        historyAction: init2.history.action,
        location: init2.history.location,
        matches: initialMatches,
        initialized,
        navigation: IDLE_NAVIGATION,
        // Don't restore on initial updateState() if we were SSR'd
        restoreScrollPosition: init2.hydrationData != null ? false : null,
        preventScrollReset: false,
        revalidation: "idle",
        loaderData: init2.hydrationData && init2.hydrationData.loaderData || {},
        actionData: init2.hydrationData && init2.hydrationData.actionData || null,
        errors: init2.hydrationData && init2.hydrationData.errors || initialErrors,
        fetchers: /* @__PURE__ */ new Map(),
        blockers: /* @__PURE__ */ new Map()
      };
      let pendingAction = "POP";
      let pendingPopstateNavigationDfd = null;
      let pendingPreventScrollReset = false;
      let pendingNavigationController;
      let pendingViewTransitionEnabled = false;
      let appliedViewTransitions = /* @__PURE__ */ new Map();
      let removePageHideEventListener = null;
      let isUninterruptedRevalidation = false;
      let isRevalidationRequired = false;
      let cancelledFetcherLoads = /* @__PURE__ */ new Set();
      let fetchControllers = /* @__PURE__ */ new Map();
      let incrementingLoadId = 0;
      let pendingNavigationLoadId = -1;
      let fetchReloadIds = /* @__PURE__ */ new Map();
      let fetchRedirectIds = /* @__PURE__ */ new Set();
      let fetchLoadMatches = /* @__PURE__ */ new Map();
      let activeFetchers = /* @__PURE__ */ new Map();
      let fetchersQueuedForDeletion = /* @__PURE__ */ new Set();
      let blockerFunctions = /* @__PURE__ */ new Map();
      let unblockBlockerHistoryUpdate = void 0;
      let pendingRevalidationDfd = null;
      function initialize() {
        unlistenHistory = init2.history.listen(
          ({ action: historyAction, location: location2, delta: delta2 }) => {
            if (unblockBlockerHistoryUpdate) {
              unblockBlockerHistoryUpdate();
              unblockBlockerHistoryUpdate = void 0;
              return;
            }
            warning(
              blockerFunctions.size === 0 || delta2 != null,
              "You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs.  This can also happen if you are using createHashRouter and the user manually changes the URL."
            );
            let blockerKey = shouldBlockNavigation({
              currentLocation: state.location,
              nextLocation: location2,
              historyAction
            });
            if (blockerKey && delta2 != null) {
              let nextHistoryUpdatePromise = new Promise((resolve) => {
                unblockBlockerHistoryUpdate = resolve;
              });
              init2.history.go(delta2 * -1);
              updateBlocker(blockerKey, {
                state: "blocked",
                location: location2,
                proceed() {
                  updateBlocker(blockerKey, {
                    state: "proceeding",
                    proceed: void 0,
                    reset: void 0,
                    location: location2
                  });
                  nextHistoryUpdatePromise.then(() => init2.history.go(delta2));
                },
                reset() {
                  let blockers = new Map(state.blockers);
                  blockers.set(blockerKey, IDLE_BLOCKER);
                  updateState({ blockers });
                }
              });
              pendingPopstateNavigationDfd?.resolve();
              pendingPopstateNavigationDfd = null;
              return;
            }
            return startNavigation(historyAction, location2);
          }
        );
        if (isBrowser3) {
          restoreAppliedTransitions(routerWindow, appliedViewTransitions);
          let _saveAppliedTransitions = () => persistAppliedTransitions(routerWindow, appliedViewTransitions);
          routerWindow.addEventListener("pagehide", _saveAppliedTransitions);
          removePageHideEventListener = () => routerWindow.removeEventListener("pagehide", _saveAppliedTransitions);
        }
        if (!state.initialized) {
          startNavigation("POP", state.location, {
            initialHydration: true
          });
        }
        return router;
      }
      function dispose2() {
        if (unlistenHistory) {
          unlistenHistory();
        }
        if (removePageHideEventListener) {
          removePageHideEventListener();
        }
        subscribers.clear();
        pendingNavigationController && pendingNavigationController.abort();
        state.fetchers.forEach((_, key2) => deleteFetcher(key2));
        state.blockers.forEach((_, key2) => deleteBlocker(key2));
      }
      function subscribe(fn2) {
        subscribers.add(fn2);
        return () => subscribers.delete(fn2);
      }
      function updateState(newState, opts = {}) {
        if (newState.matches) {
          newState.matches = newState.matches.map((m) => {
            let route = manifest[m.route.id];
            let matchRoute = m.route;
            if (matchRoute.element !== route.element || matchRoute.errorElement !== route.errorElement || matchRoute.hydrateFallbackElement !== route.hydrateFallbackElement) {
              return {
                ...m,
                route
              };
            }
            return m;
          });
        }
        state = {
          ...state,
          ...newState
        };
        let unmountedFetchers = [];
        let mountedFetchers = [];
        state.fetchers.forEach((fetcher, key2) => {
          if (fetcher.state === "idle") {
            if (fetchersQueuedForDeletion.has(key2)) {
              unmountedFetchers.push(key2);
            } else {
              mountedFetchers.push(key2);
            }
          }
        });
        fetchersQueuedForDeletion.forEach((key2) => {
          if (!state.fetchers.has(key2) && !fetchControllers.has(key2)) {
            unmountedFetchers.push(key2);
          }
        });
        [...subscribers].forEach(
          (subscriber) => subscriber(state, {
            deletedFetchers: unmountedFetchers,
            newErrors: newState.errors ?? null,
            viewTransitionOpts: opts.viewTransitionOpts,
            flushSync: opts.flushSync === true
          })
        );
        unmountedFetchers.forEach((key2) => deleteFetcher(key2));
        mountedFetchers.forEach((key2) => state.fetchers.delete(key2));
      }
      function completeNavigation(location2, newState, { flushSync } = {}) {
        let isActionReload = state.actionData != null && state.navigation.formMethod != null && isMutationMethod(state.navigation.formMethod) && state.navigation.state === "loading" && location2.state?._isRedirect !== true;
        let actionData;
        if (newState.actionData) {
          if (Object.keys(newState.actionData).length > 0) {
            actionData = newState.actionData;
          } else {
            actionData = null;
          }
        } else if (isActionReload) {
          actionData = state.actionData;
        } else {
          actionData = null;
        }
        let loaderData = newState.loaderData ? mergeLoaderData(
          state.loaderData,
          newState.loaderData,
          newState.matches || [],
          newState.errors
        ) : state.loaderData;
        let blockers = state.blockers;
        if (blockers.size > 0) {
          blockers = new Map(blockers);
          blockers.forEach((_, k2) => blockers.set(k2, IDLE_BLOCKER));
        }
        let restoreScrollPosition = isUninterruptedRevalidation ? false : getSavedScrollPosition(location2, newState.matches || state.matches);
        let preventScrollReset = pendingPreventScrollReset === true || state.navigation.formMethod != null && isMutationMethod(state.navigation.formMethod) && location2.state?._isRedirect !== true;
        if (inFlightDataRoutes) {
          dataRoutes = inFlightDataRoutes;
          inFlightDataRoutes = void 0;
        }
        if (isUninterruptedRevalidation) ;
        else if (pendingAction === "POP") ;
        else if (pendingAction === "PUSH") {
          init2.history.push(location2, location2.state);
        } else if (pendingAction === "REPLACE") {
          init2.history.replace(location2, location2.state);
        }
        let viewTransitionOpts;
        if (pendingAction === "POP") {
          let priorPaths = appliedViewTransitions.get(state.location.pathname);
          if (priorPaths && priorPaths.has(location2.pathname)) {
            viewTransitionOpts = {
              currentLocation: state.location,
              nextLocation: location2
            };
          } else if (appliedViewTransitions.has(location2.pathname)) {
            viewTransitionOpts = {
              currentLocation: location2,
              nextLocation: state.location
            };
          }
        } else if (pendingViewTransitionEnabled) {
          let toPaths = appliedViewTransitions.get(state.location.pathname);
          if (toPaths) {
            toPaths.add(location2.pathname);
          } else {
            toPaths = /* @__PURE__ */ new Set([location2.pathname]);
            appliedViewTransitions.set(state.location.pathname, toPaths);
          }
          viewTransitionOpts = {
            currentLocation: state.location,
            nextLocation: location2
          };
        }
        updateState(
          {
            ...newState,
            // matches, errors, fetchers go through as-is
            actionData,
            loaderData,
            historyAction: pendingAction,
            location: location2,
            initialized: true,
            navigation: IDLE_NAVIGATION,
            revalidation: "idle",
            restoreScrollPosition,
            preventScrollReset,
            blockers
          },
          {
            viewTransitionOpts,
            flushSync: flushSync === true
          }
        );
        pendingAction = "POP";
        pendingPreventScrollReset = false;
        pendingViewTransitionEnabled = false;
        isUninterruptedRevalidation = false;
        isRevalidationRequired = false;
        pendingPopstateNavigationDfd?.resolve();
        pendingPopstateNavigationDfd = null;
        pendingRevalidationDfd?.resolve();
        pendingRevalidationDfd = null;
      }
      async function navigate(to2, opts) {
        pendingPopstateNavigationDfd?.resolve();
        pendingPopstateNavigationDfd = null;
        if (typeof to2 === "number") {
          if (!pendingPopstateNavigationDfd) {
            pendingPopstateNavigationDfd = createDeferred();
          }
          let promise = pendingPopstateNavigationDfd.promise;
          init2.history.go(to2);
          return promise;
        }
        let normalizedPath = normalizeTo(
          state.location,
          state.matches,
          basename2,
          to2,
          opts?.fromRouteId,
          opts?.relative
        );
        let { path, submission, error: error2 } = normalizeNavigateOptions(
          false,
          normalizedPath,
          opts
        );
        let currentLocation = state.location;
        let nextLocation = createLocation(state.location, path, opts && opts.state);
        nextLocation = {
          ...nextLocation,
          ...init2.history.encodeLocation(nextLocation)
        };
        let userReplace = opts && opts.replace != null ? opts.replace : void 0;
        let historyAction = "PUSH";
        if (userReplace === true) {
          historyAction = "REPLACE";
        } else if (userReplace === false) ;
        else if (submission != null && isMutationMethod(submission.formMethod) && submission.formAction === state.location.pathname + state.location.search) {
          historyAction = "REPLACE";
        }
        let preventScrollReset = opts && "preventScrollReset" in opts ? opts.preventScrollReset === true : void 0;
        let flushSync = (opts && opts.flushSync) === true;
        let blockerKey = shouldBlockNavigation({
          currentLocation,
          nextLocation,
          historyAction
        });
        if (blockerKey) {
          updateBlocker(blockerKey, {
            state: "blocked",
            location: nextLocation,
            proceed() {
              updateBlocker(blockerKey, {
                state: "proceeding",
                proceed: void 0,
                reset: void 0,
                location: nextLocation
              });
              navigate(to2, opts);
            },
            reset() {
              let blockers = new Map(state.blockers);
              blockers.set(blockerKey, IDLE_BLOCKER);
              updateState({ blockers });
            }
          });
          return;
        }
        await startNavigation(historyAction, nextLocation, {
          submission,
          // Send through the formData serialization error if we have one so we can
          // render at the right error boundary after we match routes
          pendingError: error2,
          preventScrollReset,
          replace: opts && opts.replace,
          enableViewTransition: opts && opts.viewTransition,
          flushSync,
          callSiteDefaultShouldRevalidate: opts && opts.unstable_defaultShouldRevalidate
        });
      }
      function revalidate() {
        if (!pendingRevalidationDfd) {
          pendingRevalidationDfd = createDeferred();
        }
        interruptActiveLoads();
        updateState({ revalidation: "loading" });
        let promise = pendingRevalidationDfd.promise;
        if (state.navigation.state === "submitting") {
          return promise;
        }
        if (state.navigation.state === "idle") {
          startNavigation(state.historyAction, state.location, {
            startUninterruptedRevalidation: true
          });
          return promise;
        }
        startNavigation(
          pendingAction || state.historyAction,
          state.navigation.location,
          {
            overrideNavigation: state.navigation,
            // Proxy through any rending view transition
            enableViewTransition: pendingViewTransitionEnabled === true
          }
        );
        return promise;
      }
      async function startNavigation(historyAction, location2, opts) {
        pendingNavigationController && pendingNavigationController.abort();
        pendingNavigationController = null;
        pendingAction = historyAction;
        isUninterruptedRevalidation = (opts && opts.startUninterruptedRevalidation) === true;
        saveScrollPosition(state.location, state.matches);
        pendingPreventScrollReset = (opts && opts.preventScrollReset) === true;
        pendingViewTransitionEnabled = (opts && opts.enableViewTransition) === true;
        let routesToUse = inFlightDataRoutes || dataRoutes;
        let loadingNavigation = opts && opts.overrideNavigation;
        let matches = opts?.initialHydration && state.matches && state.matches.length > 0 && !initialMatchesIsFOW ? (
          // `matchRoutes()` has already been called if we're in here via `router.initialize()`
          state.matches
        ) : matchRoutes(routesToUse, location2, basename2);
        let flushSync = (opts && opts.flushSync) === true;
        if (matches && state.initialized && !isRevalidationRequired && isHashChangeOnly(state.location, location2) && !(opts && opts.submission && isMutationMethod(opts.submission.formMethod))) {
          completeNavigation(location2, { matches }, { flushSync });
          return;
        }
        let fogOfWar = checkFogOfWar(matches, routesToUse, location2.pathname);
        if (fogOfWar.active && fogOfWar.matches) {
          matches = fogOfWar.matches;
        }
        if (!matches) {
          let { error: error2, notFoundMatches, route } = handleNavigational404(
            location2.pathname
          );
          completeNavigation(
            location2,
            {
              matches: notFoundMatches,
              loaderData: {},
              errors: {
                [route.id]: error2
              }
            },
            { flushSync }
          );
          return;
        }
        pendingNavigationController = new AbortController();
        let request = createClientSideRequest(
          init2.history,
          location2,
          pendingNavigationController.signal,
          opts && opts.submission
        );
        let scopedContext = init2.getContext ? await init2.getContext() : new RouterContextProvider();
        let pendingActionResult;
        if (opts && opts.pendingError) {
          pendingActionResult = [
            findNearestBoundary(matches).route.id,
            { type: "error", error: opts.pendingError }
          ];
        } else if (opts && opts.submission && isMutationMethod(opts.submission.formMethod)) {
          let actionResult = await handleAction(
            request,
            location2,
            opts.submission,
            matches,
            scopedContext,
            fogOfWar.active,
            opts && opts.initialHydration === true,
            { replace: opts.replace, flushSync }
          );
          if (actionResult.shortCircuited) {
            return;
          }
          if (actionResult.pendingActionResult) {
            let [routeId, result2] = actionResult.pendingActionResult;
            if (isErrorResult(result2) && isRouteErrorResponse(result2.error) && result2.error.status === 404) {
              pendingNavigationController = null;
              completeNavigation(location2, {
                matches: actionResult.matches,
                loaderData: {},
                errors: {
                  [routeId]: result2.error
                }
              });
              return;
            }
          }
          matches = actionResult.matches || matches;
          pendingActionResult = actionResult.pendingActionResult;
          loadingNavigation = getLoadingNavigation(location2, opts.submission);
          flushSync = false;
          fogOfWar.active = false;
          request = createClientSideRequest(
            init2.history,
            request.url,
            request.signal
          );
        }
        let {
          shortCircuited,
          matches: updatedMatches,
          loaderData,
          errors: errors2
        } = await handleLoaders(
          request,
          location2,
          matches,
          scopedContext,
          fogOfWar.active,
          loadingNavigation,
          opts && opts.submission,
          opts && opts.fetcherSubmission,
          opts && opts.replace,
          opts && opts.initialHydration === true,
          flushSync,
          pendingActionResult,
          opts && opts.callSiteDefaultShouldRevalidate
        );
        if (shortCircuited) {
          return;
        }
        pendingNavigationController = null;
        completeNavigation(location2, {
          matches: updatedMatches || matches,
          ...getActionDataForCommit(pendingActionResult),
          loaderData,
          errors: errors2
        });
      }
      async function handleAction(request, location2, submission, matches, scopedContext, isFogOfWar, initialHydration, opts = {}) {
        interruptActiveLoads();
        let navigation2 = getSubmittingNavigation(location2, submission);
        updateState({ navigation: navigation2 }, { flushSync: opts.flushSync === true });
        if (isFogOfWar) {
          let discoverResult = await discoverRoutes(
            matches,
            location2.pathname,
            request.signal
          );
          if (discoverResult.type === "aborted") {
            return { shortCircuited: true };
          } else if (discoverResult.type === "error") {
            if (discoverResult.partialMatches.length === 0) {
              let { matches: matches2, route } = getShortCircuitMatches(dataRoutes);
              return {
                matches: matches2,
                pendingActionResult: [
                  route.id,
                  {
                    type: "error",
                    error: discoverResult.error
                  }
                ]
              };
            }
            let boundaryId = findNearestBoundary(discoverResult.partialMatches).route.id;
            return {
              matches: discoverResult.partialMatches,
              pendingActionResult: [
                boundaryId,
                {
                  type: "error",
                  error: discoverResult.error
                }
              ]
            };
          } else if (!discoverResult.matches) {
            let { notFoundMatches, error: error2, route } = handleNavigational404(
              location2.pathname
            );
            return {
              matches: notFoundMatches,
              pendingActionResult: [
                route.id,
                {
                  type: "error",
                  error: error2
                }
              ]
            };
          } else {
            matches = discoverResult.matches;
          }
        }
        let result2;
        let actionMatch = getTargetMatch(matches, location2);
        if (!actionMatch.route.action && !actionMatch.route.lazy) {
          result2 = {
            type: "error",
            error: getInternalRouterError(405, {
              method: request.method,
              pathname: location2.pathname,
              routeId: actionMatch.route.id
            })
          };
        } else {
          let dsMatches = getTargetedDataStrategyMatches(
            mapRouteProperties2,
            manifest,
            request,
            matches,
            actionMatch,
            initialHydration ? [] : hydrationRouteProperties2,
            scopedContext
          );
          let results = await callDataStrategy(
            request,
            dsMatches,
            scopedContext,
            null
          );
          result2 = results[actionMatch.route.id];
          if (!result2) {
            for (let match of matches) {
              if (results[match.route.id]) {
                result2 = results[match.route.id];
                break;
              }
            }
          }
          if (request.signal.aborted) {
            return { shortCircuited: true };
          }
        }
        if (isRedirectResult(result2)) {
          let replace2;
          if (opts && opts.replace != null) {
            replace2 = opts.replace;
          } else {
            let location22 = normalizeRedirectLocation(
              result2.response.headers.get("Location"),
              new URL(request.url),
              basename2
            );
            replace2 = location22 === state.location.pathname + state.location.search;
          }
          await startRedirectNavigation(request, result2, true, {
            submission,
            replace: replace2
          });
          return { shortCircuited: true };
        }
        if (isErrorResult(result2)) {
          let boundaryMatch = findNearestBoundary(matches, actionMatch.route.id);
          if ((opts && opts.replace) !== true) {
            pendingAction = "PUSH";
          }
          return {
            matches,
            pendingActionResult: [
              boundaryMatch.route.id,
              result2,
              actionMatch.route.id
            ]
          };
        }
        return {
          matches,
          pendingActionResult: [actionMatch.route.id, result2]
        };
      }
      async function handleLoaders(request, location2, matches, scopedContext, isFogOfWar, overrideNavigation, submission, fetcherSubmission, replace2, initialHydration, flushSync, pendingActionResult, callSiteDefaultShouldRevalidate) {
        let loadingNavigation = overrideNavigation || getLoadingNavigation(location2, submission);
        let activeSubmission = submission || fetcherSubmission || getSubmissionFromNavigation(loadingNavigation);
        let shouldUpdateNavigationState = !isUninterruptedRevalidation && !initialHydration;
        if (isFogOfWar) {
          if (shouldUpdateNavigationState) {
            let actionData = getUpdatedActionData(pendingActionResult);
            updateState(
              {
                navigation: loadingNavigation,
                ...actionData !== void 0 ? { actionData } : {}
              },
              {
                flushSync
              }
            );
          }
          let discoverResult = await discoverRoutes(
            matches,
            location2.pathname,
            request.signal
          );
          if (discoverResult.type === "aborted") {
            return { shortCircuited: true };
          } else if (discoverResult.type === "error") {
            if (discoverResult.partialMatches.length === 0) {
              let { matches: matches2, route } = getShortCircuitMatches(dataRoutes);
              return {
                matches: matches2,
                loaderData: {},
                errors: {
                  [route.id]: discoverResult.error
                }
              };
            }
            let boundaryId = findNearestBoundary(discoverResult.partialMatches).route.id;
            return {
              matches: discoverResult.partialMatches,
              loaderData: {},
              errors: {
                [boundaryId]: discoverResult.error
              }
            };
          } else if (!discoverResult.matches) {
            let { error: error2, notFoundMatches, route } = handleNavigational404(
              location2.pathname
            );
            return {
              matches: notFoundMatches,
              loaderData: {},
              errors: {
                [route.id]: error2
              }
            };
          } else {
            matches = discoverResult.matches;
          }
        }
        let routesToUse = inFlightDataRoutes || dataRoutes;
        let { dsMatches, revalidatingFetchers } = getMatchesToLoad(
          request,
          scopedContext,
          mapRouteProperties2,
          manifest,
          init2.history,
          state,
          matches,
          activeSubmission,
          location2,
          initialHydration ? [] : hydrationRouteProperties2,
          initialHydration === true,
          isRevalidationRequired,
          cancelledFetcherLoads,
          fetchersQueuedForDeletion,
          fetchLoadMatches,
          fetchRedirectIds,
          routesToUse,
          basename2,
          init2.patchRoutesOnNavigation != null,
          pendingActionResult,
          callSiteDefaultShouldRevalidate
        );
        pendingNavigationLoadId = ++incrementingLoadId;
        if (!init2.dataStrategy && !dsMatches.some((m) => m.shouldLoad) && !dsMatches.some(
          (m) => m.route.middleware && m.route.middleware.length > 0
        ) && revalidatingFetchers.length === 0) {
          let updatedFetchers2 = markFetchRedirectsDone();
          completeNavigation(
            location2,
            {
              matches,
              loaderData: {},
              // Commit pending error if we're short circuiting
              errors: pendingActionResult && isErrorResult(pendingActionResult[1]) ? { [pendingActionResult[0]]: pendingActionResult[1].error } : null,
              ...getActionDataForCommit(pendingActionResult),
              ...updatedFetchers2 ? { fetchers: new Map(state.fetchers) } : {}
            },
            { flushSync }
          );
          return { shortCircuited: true };
        }
        if (shouldUpdateNavigationState) {
          let updates = {};
          if (!isFogOfWar) {
            updates.navigation = loadingNavigation;
            let actionData = getUpdatedActionData(pendingActionResult);
            if (actionData !== void 0) {
              updates.actionData = actionData;
            }
          }
          if (revalidatingFetchers.length > 0) {
            updates.fetchers = getUpdatedRevalidatingFetchers(revalidatingFetchers);
          }
          updateState(updates, { flushSync });
        }
        revalidatingFetchers.forEach((rf) => {
          abortFetcher(rf.key);
          if (rf.controller) {
            fetchControllers.set(rf.key, rf.controller);
          }
        });
        let abortPendingFetchRevalidations = () => revalidatingFetchers.forEach((f) => abortFetcher(f.key));
        if (pendingNavigationController) {
          pendingNavigationController.signal.addEventListener(
            "abort",
            abortPendingFetchRevalidations
          );
        }
        let { loaderResults, fetcherResults } = await callLoadersAndMaybeResolveData(
          dsMatches,
          revalidatingFetchers,
          request,
          scopedContext
        );
        if (request.signal.aborted) {
          return { shortCircuited: true };
        }
        if (pendingNavigationController) {
          pendingNavigationController.signal.removeEventListener(
            "abort",
            abortPendingFetchRevalidations
          );
        }
        revalidatingFetchers.forEach((rf) => fetchControllers.delete(rf.key));
        let redirect2 = findRedirect(loaderResults);
        if (redirect2) {
          await startRedirectNavigation(request, redirect2.result, true, {
            replace: replace2
          });
          return { shortCircuited: true };
        }
        redirect2 = findRedirect(fetcherResults);
        if (redirect2) {
          fetchRedirectIds.add(redirect2.key);
          await startRedirectNavigation(request, redirect2.result, true, {
            replace: replace2
          });
          return { shortCircuited: true };
        }
        let { loaderData, errors: errors2 } = processLoaderData(
          state,
          matches,
          loaderResults,
          pendingActionResult,
          revalidatingFetchers,
          fetcherResults
        );
        if (initialHydration && state.errors) {
          errors2 = { ...state.errors, ...errors2 };
        }
        let updatedFetchers = markFetchRedirectsDone();
        let didAbortFetchLoads = abortStaleFetchLoads(pendingNavigationLoadId);
        let shouldUpdateFetchers = updatedFetchers || didAbortFetchLoads || revalidatingFetchers.length > 0;
        return {
          matches,
          loaderData,
          errors: errors2,
          ...shouldUpdateFetchers ? { fetchers: new Map(state.fetchers) } : {}
        };
      }
      function getUpdatedActionData(pendingActionResult) {
        if (pendingActionResult && !isErrorResult(pendingActionResult[1])) {
          return {
            [pendingActionResult[0]]: pendingActionResult[1].data
          };
        } else if (state.actionData) {
          if (Object.keys(state.actionData).length === 0) {
            return null;
          } else {
            return state.actionData;
          }
        }
      }
      function getUpdatedRevalidatingFetchers(revalidatingFetchers) {
        revalidatingFetchers.forEach((rf) => {
          let fetcher = state.fetchers.get(rf.key);
          let revalidatingFetcher = getLoadingFetcher(
            void 0,
            fetcher ? fetcher.data : void 0
          );
          state.fetchers.set(rf.key, revalidatingFetcher);
        });
        return new Map(state.fetchers);
      }
      async function fetch2(key2, routeId, href, opts) {
        abortFetcher(key2);
        let flushSync = (opts && opts.flushSync) === true;
        let routesToUse = inFlightDataRoutes || dataRoutes;
        let normalizedPath = normalizeTo(
          state.location,
          state.matches,
          basename2,
          href,
          routeId,
          opts?.relative
        );
        let matches = matchRoutes(routesToUse, normalizedPath, basename2);
        let fogOfWar = checkFogOfWar(matches, routesToUse, normalizedPath);
        if (fogOfWar.active && fogOfWar.matches) {
          matches = fogOfWar.matches;
        }
        if (!matches) {
          setFetcherError(
            key2,
            routeId,
            getInternalRouterError(404, { pathname: normalizedPath }),
            { flushSync }
          );
          return;
        }
        let { path, submission, error: error2 } = normalizeNavigateOptions(
          true,
          normalizedPath,
          opts
        );
        if (error2) {
          setFetcherError(key2, routeId, error2, { flushSync });
          return;
        }
        let scopedContext = init2.getContext ? await init2.getContext() : new RouterContextProvider();
        let preventScrollReset = (opts && opts.preventScrollReset) === true;
        if (submission && isMutationMethod(submission.formMethod)) {
          await handleFetcherAction(
            key2,
            routeId,
            path,
            matches,
            scopedContext,
            fogOfWar.active,
            flushSync,
            preventScrollReset,
            submission,
            opts && opts.unstable_defaultShouldRevalidate
          );
          return;
        }
        fetchLoadMatches.set(key2, { routeId, path });
        await handleFetcherLoader(
          key2,
          routeId,
          path,
          matches,
          scopedContext,
          fogOfWar.active,
          flushSync,
          preventScrollReset,
          submission
        );
      }
      async function handleFetcherAction(key2, routeId, path, requestMatches, scopedContext, isFogOfWar, flushSync, preventScrollReset, submission, callSiteDefaultShouldRevalidate) {
        interruptActiveLoads();
        fetchLoadMatches.delete(key2);
        let existingFetcher = state.fetchers.get(key2);
        updateFetcherState(key2, getSubmittingFetcher(submission, existingFetcher), {
          flushSync
        });
        let abortController = new AbortController();
        let fetchRequest = createClientSideRequest(
          init2.history,
          path,
          abortController.signal,
          submission
        );
        if (isFogOfWar) {
          let discoverResult = await discoverRoutes(
            requestMatches,
            new URL(fetchRequest.url).pathname,
            fetchRequest.signal,
            key2
          );
          if (discoverResult.type === "aborted") {
            return;
          } else if (discoverResult.type === "error") {
            setFetcherError(key2, routeId, discoverResult.error, { flushSync });
            return;
          } else if (!discoverResult.matches) {
            setFetcherError(
              key2,
              routeId,
              getInternalRouterError(404, { pathname: path }),
              { flushSync }
            );
            return;
          } else {
            requestMatches = discoverResult.matches;
          }
        }
        let match = getTargetMatch(requestMatches, path);
        if (!match.route.action && !match.route.lazy) {
          let error2 = getInternalRouterError(405, {
            method: submission.formMethod,
            pathname: path,
            routeId
          });
          setFetcherError(key2, routeId, error2, { flushSync });
          return;
        }
        fetchControllers.set(key2, abortController);
        let originatingLoadId = incrementingLoadId;
        let fetchMatches = getTargetedDataStrategyMatches(
          mapRouteProperties2,
          manifest,
          fetchRequest,
          requestMatches,
          match,
          hydrationRouteProperties2,
          scopedContext
        );
        let actionResults = await callDataStrategy(
          fetchRequest,
          fetchMatches,
          scopedContext,
          key2
        );
        let actionResult = actionResults[match.route.id];
        if (!actionResult) {
          for (let match2 of fetchMatches) {
            if (actionResults[match2.route.id]) {
              actionResult = actionResults[match2.route.id];
              break;
            }
          }
        }
        if (fetchRequest.signal.aborted) {
          if (fetchControllers.get(key2) === abortController) {
            fetchControllers.delete(key2);
          }
          return;
        }
        if (fetchersQueuedForDeletion.has(key2)) {
          if (isRedirectResult(actionResult) || isErrorResult(actionResult)) {
            updateFetcherState(key2, getDoneFetcher(void 0));
            return;
          }
        } else {
          if (isRedirectResult(actionResult)) {
            fetchControllers.delete(key2);
            if (pendingNavigationLoadId > originatingLoadId) {
              updateFetcherState(key2, getDoneFetcher(void 0));
              return;
            } else {
              fetchRedirectIds.add(key2);
              updateFetcherState(key2, getLoadingFetcher(submission));
              return startRedirectNavigation(fetchRequest, actionResult, false, {
                fetcherSubmission: submission,
                preventScrollReset
              });
            }
          }
          if (isErrorResult(actionResult)) {
            setFetcherError(key2, routeId, actionResult.error);
            return;
          }
        }
        let nextLocation = state.navigation.location || state.location;
        let revalidationRequest = createClientSideRequest(
          init2.history,
          nextLocation,
          abortController.signal
        );
        let routesToUse = inFlightDataRoutes || dataRoutes;
        let matches = state.navigation.state !== "idle" ? matchRoutes(routesToUse, state.navigation.location, basename2) : state.matches;
        invariant(matches, "Didn't find any matches after fetcher action");
        let loadId = ++incrementingLoadId;
        fetchReloadIds.set(key2, loadId);
        let loadFetcher = getLoadingFetcher(submission, actionResult.data);
        state.fetchers.set(key2, loadFetcher);
        let { dsMatches, revalidatingFetchers } = getMatchesToLoad(
          revalidationRequest,
          scopedContext,
          mapRouteProperties2,
          manifest,
          init2.history,
          state,
          matches,
          submission,
          nextLocation,
          hydrationRouteProperties2,
          false,
          isRevalidationRequired,
          cancelledFetcherLoads,
          fetchersQueuedForDeletion,
          fetchLoadMatches,
          fetchRedirectIds,
          routesToUse,
          basename2,
          init2.patchRoutesOnNavigation != null,
          [match.route.id, actionResult],
          callSiteDefaultShouldRevalidate
        );
        revalidatingFetchers.filter((rf) => rf.key !== key2).forEach((rf) => {
          let staleKey = rf.key;
          let existingFetcher2 = state.fetchers.get(staleKey);
          let revalidatingFetcher = getLoadingFetcher(
            void 0,
            existingFetcher2 ? existingFetcher2.data : void 0
          );
          state.fetchers.set(staleKey, revalidatingFetcher);
          abortFetcher(staleKey);
          if (rf.controller) {
            fetchControllers.set(staleKey, rf.controller);
          }
        });
        updateState({ fetchers: new Map(state.fetchers) });
        let abortPendingFetchRevalidations = () => revalidatingFetchers.forEach((rf) => abortFetcher(rf.key));
        abortController.signal.addEventListener(
          "abort",
          abortPendingFetchRevalidations
        );
        let { loaderResults, fetcherResults } = await callLoadersAndMaybeResolveData(
          dsMatches,
          revalidatingFetchers,
          revalidationRequest,
          scopedContext
        );
        if (abortController.signal.aborted) {
          return;
        }
        abortController.signal.removeEventListener(
          "abort",
          abortPendingFetchRevalidations
        );
        fetchReloadIds.delete(key2);
        fetchControllers.delete(key2);
        revalidatingFetchers.forEach((r2) => fetchControllers.delete(r2.key));
        if (state.fetchers.has(key2)) {
          let doneFetcher = getDoneFetcher(actionResult.data);
          state.fetchers.set(key2, doneFetcher);
        }
        let redirect2 = findRedirect(loaderResults);
        if (redirect2) {
          return startRedirectNavigation(
            revalidationRequest,
            redirect2.result,
            false,
            { preventScrollReset }
          );
        }
        redirect2 = findRedirect(fetcherResults);
        if (redirect2) {
          fetchRedirectIds.add(redirect2.key);
          return startRedirectNavigation(
            revalidationRequest,
            redirect2.result,
            false,
            { preventScrollReset }
          );
        }
        let { loaderData, errors: errors2 } = processLoaderData(
          state,
          matches,
          loaderResults,
          void 0,
          revalidatingFetchers,
          fetcherResults
        );
        abortStaleFetchLoads(loadId);
        if (state.navigation.state === "loading" && loadId > pendingNavigationLoadId) {
          invariant(pendingAction, "Expected pending action");
          pendingNavigationController && pendingNavigationController.abort();
          completeNavigation(state.navigation.location, {
            matches,
            loaderData,
            errors: errors2,
            fetchers: new Map(state.fetchers)
          });
        } else {
          updateState({
            errors: errors2,
            loaderData: mergeLoaderData(
              state.loaderData,
              loaderData,
              matches,
              errors2
            ),
            fetchers: new Map(state.fetchers)
          });
          isRevalidationRequired = false;
        }
      }
      async function handleFetcherLoader(key2, routeId, path, matches, scopedContext, isFogOfWar, flushSync, preventScrollReset, submission) {
        let existingFetcher = state.fetchers.get(key2);
        updateFetcherState(
          key2,
          getLoadingFetcher(
            submission,
            existingFetcher ? existingFetcher.data : void 0
          ),
          { flushSync }
        );
        let abortController = new AbortController();
        let fetchRequest = createClientSideRequest(
          init2.history,
          path,
          abortController.signal
        );
        if (isFogOfWar) {
          let discoverResult = await discoverRoutes(
            matches,
            new URL(fetchRequest.url).pathname,
            fetchRequest.signal,
            key2
          );
          if (discoverResult.type === "aborted") {
            return;
          } else if (discoverResult.type === "error") {
            setFetcherError(key2, routeId, discoverResult.error, { flushSync });
            return;
          } else if (!discoverResult.matches) {
            setFetcherError(
              key2,
              routeId,
              getInternalRouterError(404, { pathname: path }),
              { flushSync }
            );
            return;
          } else {
            matches = discoverResult.matches;
          }
        }
        let match = getTargetMatch(matches, path);
        fetchControllers.set(key2, abortController);
        let originatingLoadId = incrementingLoadId;
        let dsMatches = getTargetedDataStrategyMatches(
          mapRouteProperties2,
          manifest,
          fetchRequest,
          matches,
          match,
          hydrationRouteProperties2,
          scopedContext
        );
        let results = await callDataStrategy(
          fetchRequest,
          dsMatches,
          scopedContext,
          key2
        );
        let result2 = results[match.route.id];
        if (fetchControllers.get(key2) === abortController) {
          fetchControllers.delete(key2);
        }
        if (fetchRequest.signal.aborted) {
          return;
        }
        if (fetchersQueuedForDeletion.has(key2)) {
          updateFetcherState(key2, getDoneFetcher(void 0));
          return;
        }
        if (isRedirectResult(result2)) {
          if (pendingNavigationLoadId > originatingLoadId) {
            updateFetcherState(key2, getDoneFetcher(void 0));
            return;
          } else {
            fetchRedirectIds.add(key2);
            await startRedirectNavigation(fetchRequest, result2, false, {
              preventScrollReset
            });
            return;
          }
        }
        if (isErrorResult(result2)) {
          setFetcherError(key2, routeId, result2.error);
          return;
        }
        updateFetcherState(key2, getDoneFetcher(result2.data));
      }
      async function startRedirectNavigation(request, redirect2, isNavigation, {
        submission,
        fetcherSubmission,
        preventScrollReset,
        replace: replace2
      } = {}) {
        if (!isNavigation) {
          pendingPopstateNavigationDfd?.resolve();
          pendingPopstateNavigationDfd = null;
        }
        if (redirect2.response.headers.has("X-Remix-Revalidate")) {
          isRevalidationRequired = true;
        }
        let location2 = redirect2.response.headers.get("Location");
        invariant(location2, "Expected a Location header on the redirect Response");
        location2 = normalizeRedirectLocation(
          location2,
          new URL(request.url),
          basename2
        );
        let redirectLocation = createLocation(state.location, location2, {
          _isRedirect: true
        });
        if (isBrowser3) {
          let isDocumentReload = false;
          if (redirect2.response.headers.has("X-Remix-Reload-Document")) {
            isDocumentReload = true;
          } else if (isAbsoluteUrl(location2)) {
            const url = createBrowserURLImpl(location2, true);
            isDocumentReload = // Hard reload if it's an absolute URL to a new origin
            url.origin !== routerWindow.location.origin || // Hard reload if it's an absolute URL that does not match our basename
            stripBasename(url.pathname, basename2) == null;
          }
          if (isDocumentReload) {
            if (replace2) {
              routerWindow.location.replace(location2);
            } else {
              routerWindow.location.assign(location2);
            }
            return;
          }
        }
        pendingNavigationController = null;
        let redirectNavigationType = replace2 === true || redirect2.response.headers.has("X-Remix-Replace") ? "REPLACE" : "PUSH";
        let { formMethod, formAction, formEncType } = state.navigation;
        if (!submission && !fetcherSubmission && formMethod && formAction && formEncType) {
          submission = getSubmissionFromNavigation(state.navigation);
        }
        let activeSubmission = submission || fetcherSubmission;
        if (redirectPreserveMethodStatusCodes.has(redirect2.response.status) && activeSubmission && isMutationMethod(activeSubmission.formMethod)) {
          await startNavigation(redirectNavigationType, redirectLocation, {
            submission: {
              ...activeSubmission,
              formAction: location2
            },
            // Preserve these flags across redirects
            preventScrollReset: preventScrollReset || pendingPreventScrollReset,
            enableViewTransition: isNavigation ? pendingViewTransitionEnabled : void 0
          });
        } else {
          let overrideNavigation = getLoadingNavigation(
            redirectLocation,
            submission
          );
          await startNavigation(redirectNavigationType, redirectLocation, {
            overrideNavigation,
            // Send fetcher submissions through for shouldRevalidate
            fetcherSubmission,
            // Preserve these flags across redirects
            preventScrollReset: preventScrollReset || pendingPreventScrollReset,
            enableViewTransition: isNavigation ? pendingViewTransitionEnabled : void 0
          });
        }
      }
      async function callDataStrategy(request, matches, scopedContext, fetcherKey) {
        let results;
        let dataResults = {};
        try {
          results = await callDataStrategyImpl(
            dataStrategyImpl,
            request,
            matches,
            fetcherKey,
            scopedContext,
            false
          );
        } catch (e) {
          matches.filter((m) => m.shouldLoad).forEach((m) => {
            dataResults[m.route.id] = {
              type: "error",
              error: e
            };
          });
          return dataResults;
        }
        if (request.signal.aborted) {
          return dataResults;
        }
        if (!isMutationMethod(request.method)) {
          for (let match of matches) {
            if (results[match.route.id]?.type === "error") {
              break;
            }
            if (!results.hasOwnProperty(match.route.id) && !state.loaderData.hasOwnProperty(match.route.id) && (!state.errors || !state.errors.hasOwnProperty(match.route.id)) && match.shouldCallHandler()) {
              results[match.route.id] = {
                type: "error",
                result: new Error(
                  `No result returned from dataStrategy for route ${match.route.id}`
                )
              };
            }
          }
        }
        for (let [routeId, result2] of Object.entries(results)) {
          if (isRedirectDataStrategyResult(result2)) {
            let response = result2.result;
            dataResults[routeId] = {
              type: "redirect",
              response: normalizeRelativeRoutingRedirectResponse(
                response,
                request,
                routeId,
                matches,
                basename2
              )
            };
          } else {
            dataResults[routeId] = await convertDataStrategyResultToDataResult(result2);
          }
        }
        return dataResults;
      }
      async function callLoadersAndMaybeResolveData(matches, fetchersToLoad, request, scopedContext) {
        let loaderResultsPromise = callDataStrategy(
          request,
          matches,
          scopedContext,
          null
        );
        let fetcherResultsPromise = Promise.all(
          fetchersToLoad.map(async (f) => {
            if (f.matches && f.match && f.request && f.controller) {
              let results = await callDataStrategy(
                f.request,
                f.matches,
                scopedContext,
                f.key
              );
              let result2 = results[f.match.route.id];
              return { [f.key]: result2 };
            } else {
              return Promise.resolve({
                [f.key]: {
                  type: "error",
                  error: getInternalRouterError(404, {
                    pathname: f.path
                  })
                }
              });
            }
          })
        );
        let loaderResults = await loaderResultsPromise;
        let fetcherResults = (await fetcherResultsPromise).reduce(
          (acc, r2) => Object.assign(acc, r2),
          {}
        );
        return {
          loaderResults,
          fetcherResults
        };
      }
      function interruptActiveLoads() {
        isRevalidationRequired = true;
        fetchLoadMatches.forEach((_, key2) => {
          if (fetchControllers.has(key2)) {
            cancelledFetcherLoads.add(key2);
          }
          abortFetcher(key2);
        });
      }
      function updateFetcherState(key2, fetcher, opts = {}) {
        state.fetchers.set(key2, fetcher);
        updateState(
          { fetchers: new Map(state.fetchers) },
          { flushSync: (opts && opts.flushSync) === true }
        );
      }
      function setFetcherError(key2, routeId, error2, opts = {}) {
        let boundaryMatch = findNearestBoundary(state.matches, routeId);
        deleteFetcher(key2);
        updateState(
          {
            errors: {
              [boundaryMatch.route.id]: error2
            },
            fetchers: new Map(state.fetchers)
          },
          { flushSync: (opts && opts.flushSync) === true }
        );
      }
      function getFetcher(key2) {
        activeFetchers.set(key2, (activeFetchers.get(key2) || 0) + 1);
        if (fetchersQueuedForDeletion.has(key2)) {
          fetchersQueuedForDeletion.delete(key2);
        }
        return state.fetchers.get(key2) || IDLE_FETCHER;
      }
      function resetFetcher(key2, opts) {
        abortFetcher(key2, opts?.reason);
        updateFetcherState(key2, getDoneFetcher(null));
      }
      function deleteFetcher(key2) {
        let fetcher = state.fetchers.get(key2);
        if (fetchControllers.has(key2) && !(fetcher && fetcher.state === "loading" && fetchReloadIds.has(key2))) {
          abortFetcher(key2);
        }
        fetchLoadMatches.delete(key2);
        fetchReloadIds.delete(key2);
        fetchRedirectIds.delete(key2);
        fetchersQueuedForDeletion.delete(key2);
        cancelledFetcherLoads.delete(key2);
        state.fetchers.delete(key2);
      }
      function queueFetcherForDeletion(key2) {
        let count = (activeFetchers.get(key2) || 0) - 1;
        if (count <= 0) {
          activeFetchers.delete(key2);
          fetchersQueuedForDeletion.add(key2);
        } else {
          activeFetchers.set(key2, count);
        }
        updateState({ fetchers: new Map(state.fetchers) });
      }
      function abortFetcher(key2, reason) {
        let controller = fetchControllers.get(key2);
        if (controller) {
          controller.abort(reason);
          fetchControllers.delete(key2);
        }
      }
      function markFetchersDone(keys) {
        for (let key2 of keys) {
          let fetcher = getFetcher(key2);
          let doneFetcher = getDoneFetcher(fetcher.data);
          state.fetchers.set(key2, doneFetcher);
        }
      }
      function markFetchRedirectsDone() {
        let doneKeys = [];
        let updatedFetchers = false;
        for (let key2 of fetchRedirectIds) {
          let fetcher = state.fetchers.get(key2);
          invariant(fetcher, `Expected fetcher: ${key2}`);
          if (fetcher.state === "loading") {
            fetchRedirectIds.delete(key2);
            doneKeys.push(key2);
            updatedFetchers = true;
          }
        }
        markFetchersDone(doneKeys);
        return updatedFetchers;
      }
      function abortStaleFetchLoads(landedId) {
        let yeetedKeys = [];
        for (let [key2, id] of fetchReloadIds) {
          if (id < landedId) {
            let fetcher = state.fetchers.get(key2);
            invariant(fetcher, `Expected fetcher: ${key2}`);
            if (fetcher.state === "loading") {
              abortFetcher(key2);
              fetchReloadIds.delete(key2);
              yeetedKeys.push(key2);
            }
          }
        }
        markFetchersDone(yeetedKeys);
        return yeetedKeys.length > 0;
      }
      function getBlocker(key2, fn2) {
        let blocker = state.blockers.get(key2) || IDLE_BLOCKER;
        if (blockerFunctions.get(key2) !== fn2) {
          blockerFunctions.set(key2, fn2);
        }
        return blocker;
      }
      function deleteBlocker(key2) {
        state.blockers.delete(key2);
        blockerFunctions.delete(key2);
      }
      function updateBlocker(key2, newBlocker) {
        let blocker = state.blockers.get(key2) || IDLE_BLOCKER;
        invariant(
          blocker.state === "unblocked" && newBlocker.state === "blocked" || blocker.state === "blocked" && newBlocker.state === "blocked" || blocker.state === "blocked" && newBlocker.state === "proceeding" || blocker.state === "blocked" && newBlocker.state === "unblocked" || blocker.state === "proceeding" && newBlocker.state === "unblocked",
          `Invalid blocker state transition: ${blocker.state} -> ${newBlocker.state}`
        );
        let blockers = new Map(state.blockers);
        blockers.set(key2, newBlocker);
        updateState({ blockers });
      }
      function shouldBlockNavigation({
        currentLocation,
        nextLocation,
        historyAction
      }) {
        if (blockerFunctions.size === 0) {
          return;
        }
        if (blockerFunctions.size > 1) {
          warning(false, "A router only supports one blocker at a time");
        }
        let entries = Array.from(blockerFunctions.entries());
        let [blockerKey, blockerFunction] = entries[entries.length - 1];
        let blocker = state.blockers.get(blockerKey);
        if (blocker && blocker.state === "proceeding") {
          return;
        }
        if (blockerFunction({ currentLocation, nextLocation, historyAction })) {
          return blockerKey;
        }
      }
      function handleNavigational404(pathname) {
        let error2 = getInternalRouterError(404, { pathname });
        let routesToUse = inFlightDataRoutes || dataRoutes;
        let { matches, route } = getShortCircuitMatches(routesToUse);
        return { notFoundMatches: matches, route, error: error2 };
      }
      function enableScrollRestoration(positions, getPosition, getKey) {
        savedScrollPositions2 = positions;
        getScrollPosition = getPosition;
        getScrollRestorationKey2 = getKey || null;
        if (!initialScrollRestored && state.navigation === IDLE_NAVIGATION) {
          initialScrollRestored = true;
          let y = getSavedScrollPosition(state.location, state.matches);
          if (y != null) {
            updateState({ restoreScrollPosition: y });
          }
        }
        return () => {
          savedScrollPositions2 = null;
          getScrollPosition = null;
          getScrollRestorationKey2 = null;
        };
      }
      function getScrollKey(location2, matches) {
        if (getScrollRestorationKey2) {
          let key2 = getScrollRestorationKey2(
            location2,
            matches.map((m) => convertRouteMatchToUiMatch(m, state.loaderData))
          );
          return key2 || location2.key;
        }
        return location2.key;
      }
      function saveScrollPosition(location2, matches) {
        if (savedScrollPositions2 && getScrollPosition) {
          let key2 = getScrollKey(location2, matches);
          savedScrollPositions2[key2] = getScrollPosition();
        }
      }
      function getSavedScrollPosition(location2, matches) {
        if (savedScrollPositions2) {
          let key2 = getScrollKey(location2, matches);
          let y = savedScrollPositions2[key2];
          if (typeof y === "number") {
            return y;
          }
        }
        return null;
      }
      function checkFogOfWar(matches, routesToUse, pathname) {
        if (init2.patchRoutesOnNavigation) {
          if (!matches) {
            let fogMatches = matchRoutesImpl(
              routesToUse,
              pathname,
              basename2,
              true
            );
            return { active: true, matches: fogMatches || [] };
          } else {
            if (Object.keys(matches[0].params).length > 0) {
              let partialMatches = matchRoutesImpl(
                routesToUse,
                pathname,
                basename2,
                true
              );
              return { active: true, matches: partialMatches };
            }
          }
        }
        return { active: false, matches: null };
      }
      async function discoverRoutes(matches, pathname, signal, fetcherKey) {
        if (!init2.patchRoutesOnNavigation) {
          return { type: "success", matches };
        }
        let partialMatches = matches;
        while (true) {
          let isNonHMR = inFlightDataRoutes == null;
          let routesToUse = inFlightDataRoutes || dataRoutes;
          let localManifest = manifest;
          try {
            await init2.patchRoutesOnNavigation({
              signal,
              path: pathname,
              matches: partialMatches,
              fetcherKey,
              patch: (routeId, children2) => {
                if (signal.aborted) return;
                patchRoutesImpl(
                  routeId,
                  children2,
                  routesToUse,
                  localManifest,
                  mapRouteProperties2,
                  false
                );
              }
            });
          } catch (e) {
            return { type: "error", error: e, partialMatches };
          } finally {
            if (isNonHMR && !signal.aborted) {
              dataRoutes = [...dataRoutes];
            }
          }
          if (signal.aborted) {
            return { type: "aborted" };
          }
          let newMatches = matchRoutes(routesToUse, pathname, basename2);
          let newPartialMatches = null;
          if (newMatches) {
            if (Object.keys(newMatches[0].params).length === 0) {
              return { type: "success", matches: newMatches };
            } else {
              newPartialMatches = matchRoutesImpl(
                routesToUse,
                pathname,
                basename2,
                true
              );
              let matchedDeeper = newPartialMatches && partialMatches.length < newPartialMatches.length && compareMatches(
                partialMatches,
                newPartialMatches.slice(0, partialMatches.length)
              );
              if (!matchedDeeper) {
                return { type: "success", matches: newMatches };
              }
            }
          }
          if (!newPartialMatches) {
            newPartialMatches = matchRoutesImpl(
              routesToUse,
              pathname,
              basename2,
              true
            );
          }
          if (!newPartialMatches || compareMatches(partialMatches, newPartialMatches)) {
            return { type: "success", matches: null };
          }
          partialMatches = newPartialMatches;
        }
      }
      function compareMatches(a, b) {
        return a.length === b.length && a.every((m, i2) => m.route.id === b[i2].route.id);
      }
      function _internalSetRoutes(newRoutes) {
        manifest = {};
        inFlightDataRoutes = convertRoutesToDataRoutes(
          newRoutes,
          mapRouteProperties2,
          void 0,
          manifest
        );
      }
      function patchRoutes(routeId, children2, unstable_allowElementMutations = false) {
        let isNonHMR = inFlightDataRoutes == null;
        let routesToUse = inFlightDataRoutes || dataRoutes;
        patchRoutesImpl(
          routeId,
          children2,
          routesToUse,
          manifest,
          mapRouteProperties2,
          unstable_allowElementMutations
        );
        if (isNonHMR) {
          dataRoutes = [...dataRoutes];
          updateState({});
        }
      }
      router = {
        get basename() {
          return basename2;
        },
        get future() {
          return future;
        },
        get state() {
          return state;
        },
        get routes() {
          return dataRoutes;
        },
        get window() {
          return routerWindow;
        },
        initialize,
        subscribe,
        enableScrollRestoration,
        navigate,
        fetch: fetch2,
        revalidate,
        // Passthrough to history-aware createHref used by useHref so we get proper
        // hash-aware URLs in DOM paths
        createHref: (to2) => init2.history.createHref(to2),
        encodeLocation: (to2) => init2.history.encodeLocation(to2),
        getFetcher,
        resetFetcher,
        deleteFetcher: queueFetcherForDeletion,
        dispose: dispose2,
        getBlocker,
        deleteBlocker,
        patchRoutes,
        _internalFetchControllers: fetchControllers,
        // TODO: Remove setRoutes, it's temporary to avoid dealing with
        // updating the tree while validating the update algorithm.
        _internalSetRoutes,
        _internalSetStateDoNotUseOrYouWillBreakYourApp(newState) {
          updateState(newState);
        }
      };
      if (init2.unstable_instrumentations) {
        router = instrumentClientSideRouter(
          router,
          init2.unstable_instrumentations.map((i2) => i2.router).filter(Boolean)
        );
      }
      return router;
    }
    function isSubmissionNavigation(opts) {
      return opts != null && ("formData" in opts && opts.formData != null || "body" in opts && opts.body !== void 0);
    }
    function normalizeTo(location2, matches, basename2, to2, fromRouteId, relative) {
      let contextualMatches;
      let activeRouteMatch;
      if (fromRouteId) {
        contextualMatches = [];
        for (let match of matches) {
          contextualMatches.push(match);
          if (match.route.id === fromRouteId) {
            activeRouteMatch = match;
            break;
          }
        }
      } else {
        contextualMatches = matches;
        activeRouteMatch = matches[matches.length - 1];
      }
      let path = resolveTo(
        to2 ? to2 : ".",
        getResolveToMatches(contextualMatches),
        stripBasename(location2.pathname, basename2) || location2.pathname,
        relative === "path"
      );
      if (to2 == null) {
        path.search = location2.search;
        path.hash = location2.hash;
      }
      if ((to2 == null || to2 === "" || to2 === ".") && activeRouteMatch) {
        let nakedIndex = hasNakedIndexQuery(path.search);
        if (activeRouteMatch.route.index && !nakedIndex) {
          path.search = path.search ? path.search.replace(/^\?/, "?index&") : "?index";
        } else if (!activeRouteMatch.route.index && nakedIndex) {
          let params = new URLSearchParams(path.search);
          let indexValues = params.getAll("index");
          params.delete("index");
          indexValues.filter((v) => v).forEach((v) => params.append("index", v));
          let qs = params.toString();
          path.search = qs ? `?${qs}` : "";
        }
      }
      if (basename2 !== "/") {
        path.pathname = prependBasename({ basename: basename2, pathname: path.pathname });
      }
      return createPath(path);
    }
    function normalizeNavigateOptions(isFetcher, path, opts) {
      if (!opts || !isSubmissionNavigation(opts)) {
        return { path };
      }
      if (opts.formMethod && !isValidMethod(opts.formMethod)) {
        return {
          path,
          error: getInternalRouterError(405, { method: opts.formMethod })
        };
      }
      let getInvalidBodyError = () => ({
        path,
        error: getInternalRouterError(400, { type: "invalid-body" })
      });
      let rawFormMethod = opts.formMethod || "get";
      let formMethod = rawFormMethod.toUpperCase();
      let formAction = stripHashFromPath(path);
      if (opts.body !== void 0) {
        if (opts.formEncType === "text/plain") {
          if (!isMutationMethod(formMethod)) {
            return getInvalidBodyError();
          }
          let text2 = typeof opts.body === "string" ? opts.body : opts.body instanceof FormData || opts.body instanceof URLSearchParams ? (
            // https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#plain-text-form-data
            Array.from(opts.body.entries()).reduce(
              (acc, [name2, value2]) => `${acc}${name2}=${value2}
`,
              ""
            )
          ) : String(opts.body);
          return {
            path,
            submission: {
              formMethod,
              formAction,
              formEncType: opts.formEncType,
              formData: void 0,
              json: void 0,
              text: text2
            }
          };
        } else if (opts.formEncType === "application/json") {
          if (!isMutationMethod(formMethod)) {
            return getInvalidBodyError();
          }
          try {
            let json = typeof opts.body === "string" ? JSON.parse(opts.body) : opts.body;
            return {
              path,
              submission: {
                formMethod,
                formAction,
                formEncType: opts.formEncType,
                formData: void 0,
                json,
                text: void 0
              }
            };
          } catch (e) {
            return getInvalidBodyError();
          }
        }
      }
      invariant(
        typeof FormData === "function",
        "FormData is not available in this environment"
      );
      let searchParams;
      let formData;
      if (opts.formData) {
        searchParams = convertFormDataToSearchParams(opts.formData);
        formData = opts.formData;
      } else if (opts.body instanceof FormData) {
        searchParams = convertFormDataToSearchParams(opts.body);
        formData = opts.body;
      } else if (opts.body instanceof URLSearchParams) {
        searchParams = opts.body;
        formData = convertSearchParamsToFormData(searchParams);
      } else if (opts.body == null) {
        searchParams = new URLSearchParams();
        formData = new FormData();
      } else {
        try {
          searchParams = new URLSearchParams(opts.body);
          formData = convertSearchParamsToFormData(searchParams);
        } catch (e) {
          return getInvalidBodyError();
        }
      }
      let submission = {
        formMethod,
        formAction,
        formEncType: opts && opts.formEncType || "application/x-www-form-urlencoded",
        formData,
        json: void 0,
        text: void 0
      };
      if (isMutationMethod(submission.formMethod)) {
        return { path, submission };
      }
      let parsedPath = parsePath$1(path);
      if (isFetcher && parsedPath.search && hasNakedIndexQuery(parsedPath.search)) {
        searchParams.append("index", "");
      }
      parsedPath.search = `?${searchParams}`;
      return { path: createPath(parsedPath), submission };
    }
    function getMatchesToLoad(request, scopedContext, mapRouteProperties2, manifest, history2, state, matches, submission, location2, lazyRoutePropertiesToSkip, initialHydration, isRevalidationRequired, cancelledFetcherLoads, fetchersQueuedForDeletion, fetchLoadMatches, fetchRedirectIds, routesToUse, basename2, hasPatchRoutesOnNavigation, pendingActionResult, callSiteDefaultShouldRevalidate) {
      let actionResult = pendingActionResult ? isErrorResult(pendingActionResult[1]) ? pendingActionResult[1].error : pendingActionResult[1].data : void 0;
      let currentUrl = history2.createURL(state.location);
      let nextUrl = history2.createURL(location2);
      let maxIdx;
      if (initialHydration && state.errors) {
        let boundaryId = Object.keys(state.errors)[0];
        maxIdx = matches.findIndex((m) => m.route.id === boundaryId);
      } else if (pendingActionResult && isErrorResult(pendingActionResult[1])) {
        let boundaryId = pendingActionResult[0];
        maxIdx = matches.findIndex((m) => m.route.id === boundaryId) - 1;
      }
      let actionStatus = pendingActionResult ? pendingActionResult[1].statusCode : void 0;
      let shouldSkipRevalidation = actionStatus && actionStatus >= 400;
      let baseShouldRevalidateArgs = {
        currentUrl,
        currentParams: state.matches[0]?.params || {},
        nextUrl,
        nextParams: matches[0].params,
        ...submission,
        actionResult,
        actionStatus
      };
      let pattern = getRoutePattern(matches);
      let dsMatches = matches.map((match, index) => {
        let { route } = match;
        let forceShouldLoad = null;
        if (maxIdx != null && index > maxIdx) {
          forceShouldLoad = false;
        } else if (route.lazy) {
          forceShouldLoad = true;
        } else if (!routeHasLoaderOrMiddleware(route)) {
          forceShouldLoad = false;
        } else if (initialHydration) {
          forceShouldLoad = shouldLoadRouteOnHydration(
            route,
            state.loaderData,
            state.errors
          );
        } else if (isNewLoader(state.loaderData, state.matches[index], match)) {
          forceShouldLoad = true;
        }
        if (forceShouldLoad !== null) {
          return getDataStrategyMatch(
            mapRouteProperties2,
            manifest,
            request,
            pattern,
            match,
            lazyRoutePropertiesToSkip,
            scopedContext,
            forceShouldLoad
          );
        }
        let defaultShouldRevalidate = false;
        if (typeof callSiteDefaultShouldRevalidate === "boolean") {
          defaultShouldRevalidate = callSiteDefaultShouldRevalidate;
        } else if (shouldSkipRevalidation) {
          defaultShouldRevalidate = false;
        } else if (isRevalidationRequired) {
          defaultShouldRevalidate = true;
        } else if (currentUrl.pathname + currentUrl.search === nextUrl.pathname + nextUrl.search) {
          defaultShouldRevalidate = true;
        } else if (currentUrl.search !== nextUrl.search) {
          defaultShouldRevalidate = true;
        } else if (isNewRouteInstance(state.matches[index], match)) {
          defaultShouldRevalidate = true;
        }
        let shouldRevalidateArgs = {
          ...baseShouldRevalidateArgs,
          defaultShouldRevalidate
        };
        let shouldLoad = shouldRevalidateLoader(match, shouldRevalidateArgs);
        return getDataStrategyMatch(
          mapRouteProperties2,
          manifest,
          request,
          pattern,
          match,
          lazyRoutePropertiesToSkip,
          scopedContext,
          shouldLoad,
          shouldRevalidateArgs,
          callSiteDefaultShouldRevalidate
        );
      });
      let revalidatingFetchers = [];
      fetchLoadMatches.forEach((f, key2) => {
        if (initialHydration || !matches.some((m) => m.route.id === f.routeId) || fetchersQueuedForDeletion.has(key2)) {
          return;
        }
        let fetcher = state.fetchers.get(key2);
        let isMidInitialLoad = fetcher && fetcher.state !== "idle" && fetcher.data === void 0;
        let fetcherMatches = matchRoutes(routesToUse, f.path, basename2);
        if (!fetcherMatches) {
          if (hasPatchRoutesOnNavigation && isMidInitialLoad) {
            return;
          }
          revalidatingFetchers.push({
            key: key2,
            routeId: f.routeId,
            path: f.path,
            matches: null,
            match: null,
            request: null,
            controller: null
          });
          return;
        }
        if (fetchRedirectIds.has(key2)) {
          return;
        }
        let fetcherMatch = getTargetMatch(fetcherMatches, f.path);
        let fetchController = new AbortController();
        let fetchRequest = createClientSideRequest(
          history2,
          f.path,
          fetchController.signal
        );
        let fetcherDsMatches = null;
        if (cancelledFetcherLoads.has(key2)) {
          cancelledFetcherLoads.delete(key2);
          fetcherDsMatches = getTargetedDataStrategyMatches(
            mapRouteProperties2,
            manifest,
            fetchRequest,
            fetcherMatches,
            fetcherMatch,
            lazyRoutePropertiesToSkip,
            scopedContext
          );
        } else if (isMidInitialLoad) {
          if (isRevalidationRequired) {
            fetcherDsMatches = getTargetedDataStrategyMatches(
              mapRouteProperties2,
              manifest,
              fetchRequest,
              fetcherMatches,
              fetcherMatch,
              lazyRoutePropertiesToSkip,
              scopedContext
            );
          }
        } else {
          let defaultShouldRevalidate;
          if (typeof callSiteDefaultShouldRevalidate === "boolean") {
            defaultShouldRevalidate = callSiteDefaultShouldRevalidate;
          } else if (shouldSkipRevalidation) {
            defaultShouldRevalidate = false;
          } else {
            defaultShouldRevalidate = isRevalidationRequired;
          }
          let shouldRevalidateArgs = {
            ...baseShouldRevalidateArgs,
            defaultShouldRevalidate
          };
          if (shouldRevalidateLoader(fetcherMatch, shouldRevalidateArgs)) {
            fetcherDsMatches = getTargetedDataStrategyMatches(
              mapRouteProperties2,
              manifest,
              fetchRequest,
              fetcherMatches,
              fetcherMatch,
              lazyRoutePropertiesToSkip,
              scopedContext,
              shouldRevalidateArgs
            );
          }
        }
        if (fetcherDsMatches) {
          revalidatingFetchers.push({
            key: key2,
            routeId: f.routeId,
            path: f.path,
            matches: fetcherDsMatches,
            match: fetcherMatch,
            request: fetchRequest,
            controller: fetchController
          });
        }
      });
      return { dsMatches, revalidatingFetchers };
    }
    function routeHasLoaderOrMiddleware(route) {
      return route.loader != null || route.middleware != null && route.middleware.length > 0;
    }
    function shouldLoadRouteOnHydration(route, loaderData, errors2) {
      if (route.lazy) {
        return true;
      }
      if (!routeHasLoaderOrMiddleware(route)) {
        return false;
      }
      let hasData = loaderData != null && route.id in loaderData;
      let hasError = errors2 != null && errors2[route.id] !== void 0;
      if (!hasData && hasError) {
        return false;
      }
      if (typeof route.loader === "function" && route.loader.hydrate === true) {
        return true;
      }
      return !hasData && !hasError;
    }
    function isNewLoader(currentLoaderData, currentMatch, match) {
      let isNew = (
        // [a] -> [a, b]
        !currentMatch || // [a, b] -> [a, c]
        match.route.id !== currentMatch.route.id
      );
      let isMissingData = !currentLoaderData.hasOwnProperty(match.route.id);
      return isNew || isMissingData;
    }
    function isNewRouteInstance(currentMatch, match) {
      let currentPath = currentMatch.route.path;
      return (
        // param change for this match, /users/123 -> /users/456
        currentMatch.pathname !== match.pathname || // splat param changed, which is not present in match.path
        // e.g. /files/images/avatar.jpg -> files/finances.xls
        currentPath != null && currentPath.endsWith("*") && currentMatch.params["*"] !== match.params["*"]
      );
    }
    function shouldRevalidateLoader(loaderMatch, arg) {
      if (loaderMatch.route.shouldRevalidate) {
        let routeChoice = loaderMatch.route.shouldRevalidate(arg);
        if (typeof routeChoice === "boolean") {
          return routeChoice;
        }
      }
      return arg.defaultShouldRevalidate;
    }
    function patchRoutesImpl(routeId, children2, routesToUse, manifest, mapRouteProperties2, allowElementMutations) {
      let childrenToPatch;
      if (routeId) {
        let route = manifest[routeId];
        invariant(
          route,
          `No route found to patch children into: routeId = ${routeId}`
        );
        if (!route.children) {
          route.children = [];
        }
        childrenToPatch = route.children;
      } else {
        childrenToPatch = routesToUse;
      }
      let uniqueChildren = [];
      let existingChildren = [];
      children2.forEach((newRoute) => {
        let existingRoute = childrenToPatch.find(
          (existingRoute2) => isSameRoute(newRoute, existingRoute2)
        );
        if (existingRoute) {
          existingChildren.push({ existingRoute, newRoute });
        } else {
          uniqueChildren.push(newRoute);
        }
      });
      if (uniqueChildren.length > 0) {
        let newRoutes = convertRoutesToDataRoutes(
          uniqueChildren,
          mapRouteProperties2,
          [routeId || "_", "patch", String(childrenToPatch?.length || "0")],
          manifest
        );
        childrenToPatch.push(...newRoutes);
      }
      if (allowElementMutations && existingChildren.length > 0) {
        for (let i2 = 0; i2 < existingChildren.length; i2++) {
          let { existingRoute, newRoute } = existingChildren[i2];
          let existingRouteTyped = existingRoute;
          let [newRouteTyped] = convertRoutesToDataRoutes(
            [newRoute],
            mapRouteProperties2,
            [],
            // Doesn't matter for mutated routes since they already have an id
            {},
            // Don't touch the manifest here since we're updating in place
            true
          );
          Object.assign(existingRouteTyped, {
            element: newRouteTyped.element ? newRouteTyped.element : existingRouteTyped.element,
            errorElement: newRouteTyped.errorElement ? newRouteTyped.errorElement : existingRouteTyped.errorElement,
            hydrateFallbackElement: newRouteTyped.hydrateFallbackElement ? newRouteTyped.hydrateFallbackElement : existingRouteTyped.hydrateFallbackElement
          });
        }
      }
    }
    function isSameRoute(newRoute, existingRoute) {
      if ("id" in newRoute && "id" in existingRoute && newRoute.id === existingRoute.id) {
        return true;
      }
      if (!(newRoute.index === existingRoute.index && newRoute.path === existingRoute.path && newRoute.caseSensitive === existingRoute.caseSensitive)) {
        return false;
      }
      if ((!newRoute.children || newRoute.children.length === 0) && (!existingRoute.children || existingRoute.children.length === 0)) {
        return true;
      }
      return newRoute.children.every(
        (aChild, i2) => existingRoute.children?.some((bChild) => isSameRoute(aChild, bChild))
      );
    }
    var lazyRoutePropertyCache = /* @__PURE__ */ new WeakMap();
    var loadLazyRouteProperty = ({
      key: key2,
      route,
      manifest,
      mapRouteProperties: mapRouteProperties2
    }) => {
      let routeToUpdate = manifest[route.id];
      invariant(routeToUpdate, "No route found in manifest");
      if (!routeToUpdate.lazy || typeof routeToUpdate.lazy !== "object") {
        return;
      }
      let lazyFn = routeToUpdate.lazy[key2];
      if (!lazyFn) {
        return;
      }
      let cache = lazyRoutePropertyCache.get(routeToUpdate);
      if (!cache) {
        cache = {};
        lazyRoutePropertyCache.set(routeToUpdate, cache);
      }
      let cachedPromise = cache[key2];
      if (cachedPromise) {
        return cachedPromise;
      }
      let propertyPromise = (async () => {
        let isUnsupported = isUnsupportedLazyRouteObjectKey(key2);
        let staticRouteValue = routeToUpdate[key2];
        let isStaticallyDefined = staticRouteValue !== void 0 && key2 !== "hasErrorBoundary";
        if (isUnsupported) {
          warning(
            !isUnsupported,
            "Route property " + key2 + " is not a supported lazy route property. This property will be ignored."
          );
          cache[key2] = Promise.resolve();
        } else if (isStaticallyDefined) {
          warning(
            false,
            `Route "${routeToUpdate.id}" has a static property "${key2}" defined. The lazy property will be ignored.`
          );
        } else {
          let value2 = await lazyFn();
          if (value2 != null) {
            Object.assign(routeToUpdate, { [key2]: value2 });
            Object.assign(routeToUpdate, mapRouteProperties2(routeToUpdate));
          }
        }
        if (typeof routeToUpdate.lazy === "object") {
          routeToUpdate.lazy[key2] = void 0;
          if (Object.values(routeToUpdate.lazy).every((value2) => value2 === void 0)) {
            routeToUpdate.lazy = void 0;
          }
        }
      })();
      cache[key2] = propertyPromise;
      return propertyPromise;
    };
    var lazyRouteFunctionCache = /* @__PURE__ */ new WeakMap();
    function loadLazyRoute(route, type, manifest, mapRouteProperties2, lazyRoutePropertiesToSkip) {
      let routeToUpdate = manifest[route.id];
      invariant(routeToUpdate, "No route found in manifest");
      if (!route.lazy) {
        return {
          lazyRoutePromise: void 0,
          lazyHandlerPromise: void 0
        };
      }
      if (typeof route.lazy === "function") {
        let cachedPromise = lazyRouteFunctionCache.get(routeToUpdate);
        if (cachedPromise) {
          return {
            lazyRoutePromise: cachedPromise,
            lazyHandlerPromise: cachedPromise
          };
        }
        let lazyRoutePromise2 = (async () => {
          invariant(
            typeof route.lazy === "function",
            "No lazy route function found"
          );
          let lazyRoute = await route.lazy();
          let routeUpdates = {};
          for (let lazyRouteProperty in lazyRoute) {
            let lazyValue = lazyRoute[lazyRouteProperty];
            if (lazyValue === void 0) {
              continue;
            }
            let isUnsupported = isUnsupportedLazyRouteFunctionKey(lazyRouteProperty);
            let staticRouteValue = routeToUpdate[lazyRouteProperty];
            let isStaticallyDefined = staticRouteValue !== void 0 && // This property isn't static since it should always be updated based
            // on the route updates
            lazyRouteProperty !== "hasErrorBoundary";
            if (isUnsupported) {
              warning(
                !isUnsupported,
                "Route property " + lazyRouteProperty + " is not a supported property to be returned from a lazy route function. This property will be ignored."
              );
            } else if (isStaticallyDefined) {
              warning(
                !isStaticallyDefined,
                `Route "${routeToUpdate.id}" has a static property "${lazyRouteProperty}" defined but its lazy function is also returning a value for this property. The lazy route property "${lazyRouteProperty}" will be ignored.`
              );
            } else {
              routeUpdates[lazyRouteProperty] = lazyValue;
            }
          }
          Object.assign(routeToUpdate, routeUpdates);
          Object.assign(routeToUpdate, {
            // To keep things framework agnostic, we use the provided `mapRouteProperties`
            // function to set the framework-aware properties (`element`/`hasErrorBoundary`)
            // since the logic will differ between frameworks.
            ...mapRouteProperties2(routeToUpdate),
            lazy: void 0
          });
        })();
        lazyRouteFunctionCache.set(routeToUpdate, lazyRoutePromise2);
        lazyRoutePromise2.catch(() => {
        });
        return {
          lazyRoutePromise: lazyRoutePromise2,
          lazyHandlerPromise: lazyRoutePromise2
        };
      }
      let lazyKeys = Object.keys(route.lazy);
      let lazyPropertyPromises = [];
      let lazyHandlerPromise = void 0;
      for (let key2 of lazyKeys) {
        if (lazyRoutePropertiesToSkip && lazyRoutePropertiesToSkip.includes(key2)) {
          continue;
        }
        let promise = loadLazyRouteProperty({
          key: key2,
          route,
          manifest,
          mapRouteProperties: mapRouteProperties2
        });
        if (promise) {
          lazyPropertyPromises.push(promise);
          if (key2 === type) {
            lazyHandlerPromise = promise;
          }
        }
      }
      let lazyRoutePromise = lazyPropertyPromises.length > 0 ? Promise.all(lazyPropertyPromises).then(() => {
      }) : void 0;
      lazyRoutePromise?.catch(() => {
      });
      lazyHandlerPromise?.catch(() => {
      });
      return {
        lazyRoutePromise,
        lazyHandlerPromise
      };
    }
    async function defaultDataStrategy(args2) {
      let matchesToLoad = args2.matches.filter((m) => m.shouldLoad);
      let keyedResults = {};
      let results = await Promise.all(matchesToLoad.map((m) => m.resolve()));
      results.forEach((result2, i2) => {
        keyedResults[matchesToLoad[i2].route.id] = result2;
      });
      return keyedResults;
    }
    async function defaultDataStrategyWithMiddleware(args2) {
      if (!args2.matches.some((m) => m.route.middleware)) {
        return defaultDataStrategy(args2);
      }
      return runClientMiddlewarePipeline(args2, () => defaultDataStrategy(args2));
    }
    function runClientMiddlewarePipeline(args2, handler) {
      return runMiddlewarePipeline(
        args2,
        handler,
        (r2) => {
          if (isRedirectResponse(r2)) {
            throw r2;
          }
          return r2;
        },
        isDataStrategyResults,
        errorHandler
      );
      function errorHandler(error2, routeId, nextResult) {
        if (nextResult) {
          return Promise.resolve(
            Object.assign(nextResult.value, {
              [routeId]: { type: "error", result: error2 }
            })
          );
        } else {
          let { matches } = args2;
          let maxBoundaryIdx = Math.min(
            // Throwing route
            Math.max(
              matches.findIndex((m) => m.route.id === routeId),
              0
            ),
            // or the shallowest route that needs to load data
            Math.max(
              matches.findIndex((m) => m.shouldCallHandler()),
              0
            )
          );
          let boundaryRouteId = findNearestBoundary(
            matches,
            matches[maxBoundaryIdx].route.id
          ).route.id;
          return Promise.resolve({
            [boundaryRouteId]: { type: "error", result: error2 }
          });
        }
      }
    }
    async function runMiddlewarePipeline(args2, handler, processResult2, isResult, errorHandler) {
      let { matches, request, params, context, unstable_pattern } = args2;
      let tuples = matches.flatMap(
        (m) => m.route.middleware ? m.route.middleware.map((fn2) => [m.route.id, fn2]) : []
      );
      let result2 = await callRouteMiddleware(
        {
          request,
          params,
          context,
          unstable_pattern
        },
        tuples,
        handler,
        processResult2,
        isResult,
        errorHandler
      );
      return result2;
    }
    async function callRouteMiddleware(args2, middlewares, handler, processResult2, isResult, errorHandler, idx = 0) {
      let { request } = args2;
      if (request.signal.aborted) {
        throw request.signal.reason ?? new Error(`Request aborted: ${request.method} ${request.url}`);
      }
      let tuple = middlewares[idx];
      if (!tuple) {
        let result2 = await handler();
        return result2;
      }
      let [routeId, middleware] = tuple;
      let nextResult;
      let next = async () => {
        if (nextResult) {
          throw new Error("You may only call `next()` once per middleware");
        }
        try {
          let result2 = await callRouteMiddleware(
            args2,
            middlewares,
            handler,
            processResult2,
            isResult,
            errorHandler,
            idx + 1
          );
          nextResult = { value: result2 };
          return nextResult.value;
        } catch (error2) {
          nextResult = { value: await errorHandler(error2, routeId, nextResult) };
          return nextResult.value;
        }
      };
      try {
        let value2 = await middleware(args2, next);
        let result2 = value2 != null ? processResult2(value2) : void 0;
        if (isResult(result2)) {
          return result2;
        } else if (nextResult) {
          return result2 ?? nextResult.value;
        } else {
          nextResult = { value: await next() };
          return nextResult.value;
        }
      } catch (error2) {
        let response = await errorHandler(error2, routeId, nextResult);
        return response;
      }
    }
    function getDataStrategyMatchLazyPromises(mapRouteProperties2, manifest, request, match, lazyRoutePropertiesToSkip) {
      let lazyMiddlewarePromise = loadLazyRouteProperty({
        key: "middleware",
        route: match.route,
        manifest,
        mapRouteProperties: mapRouteProperties2
      });
      let lazyRoutePromises = loadLazyRoute(
        match.route,
        isMutationMethod(request.method) ? "action" : "loader",
        manifest,
        mapRouteProperties2,
        lazyRoutePropertiesToSkip
      );
      return {
        middleware: lazyMiddlewarePromise,
        route: lazyRoutePromises.lazyRoutePromise,
        handler: lazyRoutePromises.lazyHandlerPromise
      };
    }
    function getDataStrategyMatch(mapRouteProperties2, manifest, request, unstable_pattern, match, lazyRoutePropertiesToSkip, scopedContext, shouldLoad, shouldRevalidateArgs = null, callSiteDefaultShouldRevalidate) {
      let isUsingNewApi = false;
      let _lazyPromises = getDataStrategyMatchLazyPromises(
        mapRouteProperties2,
        manifest,
        request,
        match,
        lazyRoutePropertiesToSkip
      );
      return {
        ...match,
        _lazyPromises,
        shouldLoad,
        shouldRevalidateArgs,
        shouldCallHandler(defaultShouldRevalidate) {
          isUsingNewApi = true;
          if (!shouldRevalidateArgs) {
            return shouldLoad;
          }
          if (typeof callSiteDefaultShouldRevalidate === "boolean") {
            return shouldRevalidateLoader(match, {
              ...shouldRevalidateArgs,
              defaultShouldRevalidate: callSiteDefaultShouldRevalidate
            });
          }
          if (typeof defaultShouldRevalidate === "boolean") {
            return shouldRevalidateLoader(match, {
              ...shouldRevalidateArgs,
              defaultShouldRevalidate
            });
          }
          return shouldRevalidateLoader(match, shouldRevalidateArgs);
        },
        resolve(handlerOverride) {
          let { lazy, loader, middleware } = match.route;
          let callHandler = isUsingNewApi || shouldLoad || handlerOverride && !isMutationMethod(request.method) && (lazy || loader);
          let isMiddlewareOnlyRoute = middleware && middleware.length > 0 && !loader && !lazy;
          if (callHandler && (isMutationMethod(request.method) || !isMiddlewareOnlyRoute)) {
            return callLoaderOrAction({
              request,
              unstable_pattern,
              match,
              lazyHandlerPromise: _lazyPromises?.handler,
              lazyRoutePromise: _lazyPromises?.route,
              handlerOverride,
              scopedContext
            });
          }
          return Promise.resolve({ type: "data", result: void 0 });
        }
      };
    }
    function getTargetedDataStrategyMatches(mapRouteProperties2, manifest, request, matches, targetMatch, lazyRoutePropertiesToSkip, scopedContext, shouldRevalidateArgs = null) {
      return matches.map((match) => {
        if (match.route.id !== targetMatch.route.id) {
          return {
            ...match,
            shouldLoad: false,
            shouldRevalidateArgs,
            shouldCallHandler: () => false,
            _lazyPromises: getDataStrategyMatchLazyPromises(
              mapRouteProperties2,
              manifest,
              request,
              match,
              lazyRoutePropertiesToSkip
            ),
            resolve: () => Promise.resolve({ type: "data", result: void 0 })
          };
        }
        return getDataStrategyMatch(
          mapRouteProperties2,
          manifest,
          request,
          getRoutePattern(matches),
          match,
          lazyRoutePropertiesToSkip,
          scopedContext,
          true,
          shouldRevalidateArgs
        );
      });
    }
    async function callDataStrategyImpl(dataStrategyImpl, request, matches, fetcherKey, scopedContext, isStaticHandler) {
      if (matches.some((m) => m._lazyPromises?.middleware)) {
        await Promise.all(matches.map((m) => m._lazyPromises?.middleware));
      }
      let dataStrategyArgs = {
        request,
        unstable_pattern: getRoutePattern(matches),
        params: matches[0].params,
        context: scopedContext,
        matches
      };
      let runClientMiddleware = (cb) => {
        let typedDataStrategyArgs = dataStrategyArgs;
        return runClientMiddlewarePipeline(typedDataStrategyArgs, () => {
          return cb({
            ...typedDataStrategyArgs,
            fetcherKey,
            runClientMiddleware: () => {
              throw new Error(
                "Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler"
              );
            }
          });
        });
      };
      let results = await dataStrategyImpl({
        ...dataStrategyArgs,
        fetcherKey,
        runClientMiddleware
      });
      try {
        await Promise.all(
          matches.flatMap((m) => [
            m._lazyPromises?.handler,
            m._lazyPromises?.route
          ])
        );
      } catch (e) {
      }
      return results;
    }
    async function callLoaderOrAction({
      request,
      unstable_pattern,
      match,
      lazyHandlerPromise,
      lazyRoutePromise,
      handlerOverride,
      scopedContext
    }) {
      let result2;
      let onReject;
      let isAction = isMutationMethod(request.method);
      let type = isAction ? "action" : "loader";
      let runHandler = (handler) => {
        let reject;
        let abortPromise = new Promise((_, r2) => reject = r2);
        onReject = () => reject();
        request.signal.addEventListener("abort", onReject);
        let actualHandler = (ctx) => {
          if (typeof handler !== "function") {
            return Promise.reject(
              new Error(
                `You cannot call the handler for a route which defines a boolean "${type}" [routeId: ${match.route.id}]`
              )
            );
          }
          return handler(
            {
              request,
              unstable_pattern,
              params: match.params,
              context: scopedContext
            },
            ...ctx !== void 0 ? [ctx] : []
          );
        };
        let handlerPromise = (async () => {
          try {
            let val = await (handlerOverride ? handlerOverride((ctx) => actualHandler(ctx)) : actualHandler());
            return { type: "data", result: val };
          } catch (e) {
            return { type: "error", result: e };
          }
        })();
        return Promise.race([handlerPromise, abortPromise]);
      };
      try {
        let handler = isAction ? match.route.action : match.route.loader;
        if (lazyHandlerPromise || lazyRoutePromise) {
          if (handler) {
            let handlerError;
            let [value2] = await Promise.all([
              // If the handler throws, don't let it immediately bubble out,
              // since we need to let the lazy() execution finish so we know if this
              // route has a boundary that can handle the error
              runHandler(handler).catch((e) => {
                handlerError = e;
              }),
              // Ensure all lazy route promises are resolved before continuing
              lazyHandlerPromise,
              lazyRoutePromise
            ]);
            if (handlerError !== void 0) {
              throw handlerError;
            }
            result2 = value2;
          } else {
            await lazyHandlerPromise;
            let handler2 = isAction ? match.route.action : match.route.loader;
            if (handler2) {
              [result2] = await Promise.all([runHandler(handler2), lazyRoutePromise]);
            } else if (type === "action") {
              let url = new URL(request.url);
              let pathname = url.pathname + url.search;
              throw getInternalRouterError(405, {
                method: request.method,
                pathname,
                routeId: match.route.id
              });
            } else {
              return { type: "data", result: void 0 };
            }
          }
        } else if (!handler) {
          let url = new URL(request.url);
          let pathname = url.pathname + url.search;
          throw getInternalRouterError(404, {
            pathname
          });
        } else {
          result2 = await runHandler(handler);
        }
      } catch (e) {
        return { type: "error", result: e };
      } finally {
        if (onReject) {
          request.signal.removeEventListener("abort", onReject);
        }
      }
      return result2;
    }
    async function parseResponseBody(response) {
      let contentType = response.headers.get("Content-Type");
      if (contentType && /\bapplication\/json\b/.test(contentType)) {
        return response.body == null ? null : response.json();
      }
      return response.text();
    }
    async function convertDataStrategyResultToDataResult(dataStrategyResult) {
      let { result: result2, type } = dataStrategyResult;
      if (isResponse(result2)) {
        let data2;
        try {
          data2 = await parseResponseBody(result2);
        } catch (e) {
          return { type: "error", error: e };
        }
        if (type === "error") {
          return {
            type: "error",
            error: new ErrorResponseImpl(result2.status, result2.statusText, data2),
            statusCode: result2.status,
            headers: result2.headers
          };
        }
        return {
          type: "data",
          data: data2,
          statusCode: result2.status,
          headers: result2.headers
        };
      }
      if (type === "error") {
        if (isDataWithResponseInit(result2)) {
          if (result2.data instanceof Error) {
            return {
              type: "error",
              error: result2.data,
              statusCode: result2.init?.status,
              headers: result2.init?.headers ? new Headers(result2.init.headers) : void 0
            };
          }
          return {
            type: "error",
            error: dataWithResponseInitToErrorResponse(result2),
            statusCode: isRouteErrorResponse(result2) ? result2.status : void 0,
            headers: result2.init?.headers ? new Headers(result2.init.headers) : void 0
          };
        }
        return {
          type: "error",
          error: result2,
          statusCode: isRouteErrorResponse(result2) ? result2.status : void 0
        };
      }
      if (isDataWithResponseInit(result2)) {
        return {
          type: "data",
          data: result2.data,
          statusCode: result2.init?.status,
          headers: result2.init?.headers ? new Headers(result2.init.headers) : void 0
        };
      }
      return { type: "data", data: result2 };
    }
    function normalizeRelativeRoutingRedirectResponse(response, request, routeId, matches, basename2) {
      let location2 = response.headers.get("Location");
      invariant(
        location2,
        "Redirects returned/thrown from loaders/actions must have a Location header"
      );
      if (!isAbsoluteUrl(location2)) {
        let trimmedMatches = matches.slice(
          0,
          matches.findIndex((m) => m.route.id === routeId) + 1
        );
        location2 = normalizeTo(
          new URL(request.url),
          trimmedMatches,
          basename2,
          location2
        );
        response.headers.set("Location", location2);
      }
      return response;
    }
    function normalizeRedirectLocation(location2, currentUrl, basename2) {
      if (isAbsoluteUrl(location2)) {
        let normalizedLocation = location2;
        let url = normalizedLocation.startsWith("//") ? new URL(currentUrl.protocol + normalizedLocation) : new URL(normalizedLocation);
        let isSameBasename = stripBasename(url.pathname, basename2) != null;
        if (url.origin === currentUrl.origin && isSameBasename) {
          return url.pathname + url.search + url.hash;
        }
      }
      return location2;
    }
    function createClientSideRequest(history2, location2, signal, submission) {
      let url = history2.createURL(stripHashFromPath(location2)).toString();
      let init2 = { signal };
      if (submission && isMutationMethod(submission.formMethod)) {
        let { formMethod, formEncType } = submission;
        init2.method = formMethod.toUpperCase();
        if (formEncType === "application/json") {
          init2.headers = new Headers({ "Content-Type": formEncType });
          init2.body = JSON.stringify(submission.json);
        } else if (formEncType === "text/plain") {
          init2.body = submission.text;
        } else if (formEncType === "application/x-www-form-urlencoded" && submission.formData) {
          init2.body = convertFormDataToSearchParams(submission.formData);
        } else {
          init2.body = submission.formData;
        }
      }
      return new Request(url, init2);
    }
    function convertFormDataToSearchParams(formData) {
      let searchParams = new URLSearchParams();
      for (let [key2, value2] of formData.entries()) {
        searchParams.append(key2, typeof value2 === "string" ? value2 : value2.name);
      }
      return searchParams;
    }
    function convertSearchParamsToFormData(searchParams) {
      let formData = new FormData();
      for (let [key2, value2] of searchParams.entries()) {
        formData.append(key2, value2);
      }
      return formData;
    }
    function processRouteLoaderData(matches, results, pendingActionResult, isStaticHandler = false, skipLoaderErrorBubbling = false) {
      let loaderData = {};
      let errors2 = null;
      let statusCode;
      let foundError = false;
      let loaderHeaders = {};
      let pendingError = pendingActionResult && isErrorResult(pendingActionResult[1]) ? pendingActionResult[1].error : void 0;
      matches.forEach((match) => {
        if (!(match.route.id in results)) {
          return;
        }
        let id = match.route.id;
        let result2 = results[id];
        invariant(
          !isRedirectResult(result2),
          "Cannot handle redirect results in processLoaderData"
        );
        if (isErrorResult(result2)) {
          let error2 = result2.error;
          if (pendingError !== void 0) {
            error2 = pendingError;
            pendingError = void 0;
          }
          errors2 = errors2 || {};
          if (skipLoaderErrorBubbling) {
            errors2[id] = error2;
          } else {
            let boundaryMatch = findNearestBoundary(matches, id);
            if (errors2[boundaryMatch.route.id] == null) {
              errors2[boundaryMatch.route.id] = error2;
            }
          }
          if (!isStaticHandler) {
            loaderData[id] = ResetLoaderDataSymbol;
          }
          if (!foundError) {
            foundError = true;
            statusCode = isRouteErrorResponse(result2.error) ? result2.error.status : 500;
          }
          if (result2.headers) {
            loaderHeaders[id] = result2.headers;
          }
        } else {
          loaderData[id] = result2.data;
          if (result2.statusCode && result2.statusCode !== 200 && !foundError) {
            statusCode = result2.statusCode;
          }
          if (result2.headers) {
            loaderHeaders[id] = result2.headers;
          }
        }
      });
      if (pendingError !== void 0 && pendingActionResult) {
        errors2 = { [pendingActionResult[0]]: pendingError };
        if (pendingActionResult[2]) {
          loaderData[pendingActionResult[2]] = void 0;
        }
      }
      return {
        loaderData,
        errors: errors2,
        statusCode: statusCode || 200,
        loaderHeaders
      };
    }
    function processLoaderData(state, matches, results, pendingActionResult, revalidatingFetchers, fetcherResults) {
      let { loaderData, errors: errors2 } = processRouteLoaderData(
        matches,
        results,
        pendingActionResult
      );
      revalidatingFetchers.filter((f) => !f.matches || f.matches.some((m) => m.shouldLoad)).forEach((rf) => {
        let { key: key2, match, controller } = rf;
        if (controller && controller.signal.aborted) {
          return;
        }
        let result2 = fetcherResults[key2];
        invariant(result2, "Did not find corresponding fetcher result");
        if (isErrorResult(result2)) {
          let boundaryMatch = findNearestBoundary(state.matches, match?.route.id);
          if (!(errors2 && errors2[boundaryMatch.route.id])) {
            errors2 = {
              ...errors2,
              [boundaryMatch.route.id]: result2.error
            };
          }
          state.fetchers.delete(key2);
        } else if (isRedirectResult(result2)) {
          invariant(false, "Unhandled fetcher revalidation redirect");
        } else {
          let doneFetcher = getDoneFetcher(result2.data);
          state.fetchers.set(key2, doneFetcher);
        }
      });
      return { loaderData, errors: errors2 };
    }
    function mergeLoaderData(loaderData, newLoaderData, matches, errors2) {
      let mergedLoaderData = Object.entries(newLoaderData).filter(([, v]) => v !== ResetLoaderDataSymbol).reduce((merged, [k2, v]) => {
        merged[k2] = v;
        return merged;
      }, {});
      for (let match of matches) {
        let id = match.route.id;
        if (!newLoaderData.hasOwnProperty(id) && loaderData.hasOwnProperty(id) && match.route.loader) {
          mergedLoaderData[id] = loaderData[id];
        }
        if (errors2 && errors2.hasOwnProperty(id)) {
          break;
        }
      }
      return mergedLoaderData;
    }
    function getActionDataForCommit(pendingActionResult) {
      if (!pendingActionResult) {
        return {};
      }
      return isErrorResult(pendingActionResult[1]) ? {
        // Clear out prior actionData on errors
        actionData: {}
      } : {
        actionData: {
          [pendingActionResult[0]]: pendingActionResult[1].data
        }
      };
    }
    function findNearestBoundary(matches, routeId) {
      let eligibleMatches = routeId ? matches.slice(0, matches.findIndex((m) => m.route.id === routeId) + 1) : [...matches];
      return eligibleMatches.reverse().find((m) => m.route.hasErrorBoundary === true) || matches[0];
    }
    function getShortCircuitMatches(routes) {
      let route = routes.length === 1 ? routes[0] : routes.find((r2) => r2.index || !r2.path || r2.path === "/") || {
        id: `__shim-error-route__`
      };
      return {
        matches: [
          {
            params: {},
            pathname: "",
            pathnameBase: "",
            route
          }
        ],
        route
      };
    }
    function getInternalRouterError(status2, {
      pathname,
      routeId,
      method,
      type,
      message: message2
    } = {}) {
      let statusText2 = "Unknown Server Error";
      let errorMessage = "Unknown @remix-run/router error";
      if (status2 === 400) {
        statusText2 = "Bad Request";
        if (method && pathname && routeId) {
          errorMessage = `You made a ${method} request to "${pathname}" but did not provide a \`loader\` for route "${routeId}", so there is no way to handle the request.`;
        } else if (type === "invalid-body") {
          errorMessage = "Unable to encode submission body";
        }
      } else if (status2 === 403) {
        statusText2 = "Forbidden";
        errorMessage = `Route "${routeId}" does not match URL "${pathname}"`;
      } else if (status2 === 404) {
        statusText2 = "Not Found";
        errorMessage = `No route matches URL "${pathname}"`;
      } else if (status2 === 405) {
        statusText2 = "Method Not Allowed";
        if (method && pathname && routeId) {
          errorMessage = `You made a ${method.toUpperCase()} request to "${pathname}" but did not provide an \`action\` for route "${routeId}", so there is no way to handle the request.`;
        } else if (method) {
          errorMessage = `Invalid request method "${method.toUpperCase()}"`;
        }
      }
      return new ErrorResponseImpl(
        status2 || 500,
        statusText2,
        new Error(errorMessage),
        true
      );
    }
    function findRedirect(results) {
      let entries = Object.entries(results);
      for (let i2 = entries.length - 1; i2 >= 0; i2--) {
        let [key2, result2] = entries[i2];
        if (isRedirectResult(result2)) {
          return { key: key2, result: result2 };
        }
      }
    }
    function stripHashFromPath(path) {
      let parsedPath = typeof path === "string" ? parsePath$1(path) : path;
      return createPath({ ...parsedPath, hash: "" });
    }
    function isHashChangeOnly(a, b) {
      if (a.pathname !== b.pathname || a.search !== b.search) {
        return false;
      }
      if (a.hash === "") {
        return b.hash !== "";
      } else if (a.hash === b.hash) {
        return true;
      } else if (b.hash !== "") {
        return true;
      }
      return false;
    }
    function dataWithResponseInitToErrorResponse(data2) {
      return new ErrorResponseImpl(
        data2.init?.status ?? 500,
        data2.init?.statusText ?? "Internal Server Error",
        data2.data
      );
    }
    function isDataStrategyResults(result2) {
      return result2 != null && typeof result2 === "object" && Object.entries(result2).every(
        ([key2, value2]) => typeof key2 === "string" && isDataStrategyResult(value2)
      );
    }
    function isDataStrategyResult(result2) {
      return result2 != null && typeof result2 === "object" && "type" in result2 && "result" in result2 && (result2.type === "data" || result2.type === "error");
    }
    function isRedirectDataStrategyResult(result2) {
      return isResponse(result2.result) && redirectStatusCodes.has(result2.result.status);
    }
    function isErrorResult(result2) {
      return result2.type === "error";
    }
    function isRedirectResult(result2) {
      return (result2 && result2.type) === "redirect";
    }
    function isDataWithResponseInit(value2) {
      return typeof value2 === "object" && value2 != null && "type" in value2 && "data" in value2 && "init" in value2 && value2.type === "DataWithResponseInit";
    }
    function isResponse(value2) {
      return value2 != null && typeof value2.status === "number" && typeof value2.statusText === "string" && typeof value2.headers === "object" && typeof value2.body !== "undefined";
    }
    function isRedirectStatusCode(statusCode) {
      return redirectStatusCodes.has(statusCode);
    }
    function isRedirectResponse(result2) {
      return isResponse(result2) && isRedirectStatusCode(result2.status) && result2.headers.has("Location");
    }
    function isValidMethod(method) {
      return validRequestMethods.has(method.toUpperCase());
    }
    function isMutationMethod(method) {
      return validMutationMethods.has(method.toUpperCase());
    }
    function hasNakedIndexQuery(search) {
      return new URLSearchParams(search).getAll("index").some((v) => v === "");
    }
    function getTargetMatch(matches, location2) {
      let search = typeof location2 === "string" ? parsePath$1(location2).search : location2.search;
      if (matches[matches.length - 1].route.index && hasNakedIndexQuery(search || "")) {
        return matches[matches.length - 1];
      }
      let pathMatches = getPathContributingMatches(matches);
      return pathMatches[pathMatches.length - 1];
    }
    function getSubmissionFromNavigation(navigation2) {
      let { formMethod, formAction, formEncType, text: text2, formData, json } = navigation2;
      if (!formMethod || !formAction || !formEncType) {
        return;
      }
      if (text2 != null) {
        return {
          formMethod,
          formAction,
          formEncType,
          formData: void 0,
          json: void 0,
          text: text2
        };
      } else if (formData != null) {
        return {
          formMethod,
          formAction,
          formEncType,
          formData,
          json: void 0,
          text: void 0
        };
      } else if (json !== void 0) {
        return {
          formMethod,
          formAction,
          formEncType,
          formData: void 0,
          json,
          text: void 0
        };
      }
    }
    function getLoadingNavigation(location2, submission) {
      if (submission) {
        let navigation2 = {
          state: "loading",
          location: location2,
          formMethod: submission.formMethod,
          formAction: submission.formAction,
          formEncType: submission.formEncType,
          formData: submission.formData,
          json: submission.json,
          text: submission.text
        };
        return navigation2;
      } else {
        let navigation2 = {
          state: "loading",
          location: location2,
          formMethod: void 0,
          formAction: void 0,
          formEncType: void 0,
          formData: void 0,
          json: void 0,
          text: void 0
        };
        return navigation2;
      }
    }
    function getSubmittingNavigation(location2, submission) {
      let navigation2 = {
        state: "submitting",
        location: location2,
        formMethod: submission.formMethod,
        formAction: submission.formAction,
        formEncType: submission.formEncType,
        formData: submission.formData,
        json: submission.json,
        text: submission.text
      };
      return navigation2;
    }
    function getLoadingFetcher(submission, data2) {
      if (submission) {
        let fetcher = {
          state: "loading",
          formMethod: submission.formMethod,
          formAction: submission.formAction,
          formEncType: submission.formEncType,
          formData: submission.formData,
          json: submission.json,
          text: submission.text,
          data: data2
        };
        return fetcher;
      } else {
        let fetcher = {
          state: "loading",
          formMethod: void 0,
          formAction: void 0,
          formEncType: void 0,
          formData: void 0,
          json: void 0,
          text: void 0,
          data: data2
        };
        return fetcher;
      }
    }
    function getSubmittingFetcher(submission, existingFetcher) {
      let fetcher = {
        state: "submitting",
        formMethod: submission.formMethod,
        formAction: submission.formAction,
        formEncType: submission.formEncType,
        formData: submission.formData,
        json: submission.json,
        text: submission.text,
        data: existingFetcher ? existingFetcher.data : void 0
      };
      return fetcher;
    }
    function getDoneFetcher(data2) {
      let fetcher = {
        state: "idle",
        formMethod: void 0,
        formAction: void 0,
        formEncType: void 0,
        formData: void 0,
        json: void 0,
        text: void 0,
        data: data2
      };
      return fetcher;
    }
    function restoreAppliedTransitions(_window, transitions) {
      try {
        let sessionPositions = _window.sessionStorage.getItem(
          TRANSITIONS_STORAGE_KEY
        );
        if (sessionPositions) {
          let json = JSON.parse(sessionPositions);
          for (let [k2, v] of Object.entries(json || {})) {
            if (v && Array.isArray(v)) {
              transitions.set(k2, new Set(v || []));
            }
          }
        }
      } catch (e) {
      }
    }
    function persistAppliedTransitions(_window, transitions) {
      if (transitions.size > 0) {
        let json = {};
        for (let [k2, v] of transitions) {
          json[k2] = [...v];
        }
        try {
          _window.sessionStorage.setItem(
            TRANSITIONS_STORAGE_KEY,
            JSON.stringify(json)
          );
        } catch (error2) {
          warning(
            false,
            `Failed to save applied view transitions in sessionStorage (${error2}).`
          );
        }
      }
    }
    function createDeferred() {
      let resolve;
      let reject;
      let promise = new Promise((res, rej) => {
        resolve = async (val) => {
          res(val);
          try {
            await promise;
          } catch (e) {
          }
        };
        reject = async (error2) => {
          rej(error2);
          try {
            await promise;
          } catch (e) {
          }
        };
      });
      return {
        promise,
        //@ts-ignore
        resolve,
        //@ts-ignore
        reject
      };
    }
    var DataRouterContext = reactExports.createContext(null);
    DataRouterContext.displayName = "DataRouter";
    var DataRouterStateContext = reactExports.createContext(null);
    DataRouterStateContext.displayName = "DataRouterState";
    var RSCRouterContext = reactExports.createContext(false);
    function useIsRSCRouterContext() {
      return reactExports.useContext(RSCRouterContext);
    }
    var ViewTransitionContext = reactExports.createContext({
      isTransitioning: false
    });
    ViewTransitionContext.displayName = "ViewTransition";
    var FetchersContext = reactExports.createContext(
      /* @__PURE__ */ new Map()
    );
    FetchersContext.displayName = "Fetchers";
    var AwaitContext = reactExports.createContext(null);
    AwaitContext.displayName = "Await";
    var NavigationContext = reactExports.createContext(
      null
    );
    NavigationContext.displayName = "Navigation";
    var LocationContext = reactExports.createContext(
      null
    );
    LocationContext.displayName = "Location";
    var RouteContext = reactExports.createContext({
      outlet: null,
      matches: [],
      isDataRoute: false
    });
    RouteContext.displayName = "Route";
    var RouteErrorContext = reactExports.createContext(null);
    RouteErrorContext.displayName = "RouteError";
    var ERROR_DIGEST_BASE = "REACT_ROUTER_ERROR";
    var ERROR_DIGEST_REDIRECT = "REDIRECT";
    var ERROR_DIGEST_ROUTE_ERROR_RESPONSE = "ROUTE_ERROR_RESPONSE";
    function decodeRedirectErrorDigest(digest) {
      if (digest.startsWith(`${ERROR_DIGEST_BASE}:${ERROR_DIGEST_REDIRECT}:{`)) {
        try {
          let parsed = JSON.parse(digest.slice(28));
          if (typeof parsed === "object" && parsed && typeof parsed.status === "number" && typeof parsed.statusText === "string" && typeof parsed.location === "string" && typeof parsed.reloadDocument === "boolean" && typeof parsed.replace === "boolean") {
            return parsed;
          }
        } catch {
        }
      }
    }
    function decodeRouteErrorResponseDigest(digest) {
      if (digest.startsWith(
        `${ERROR_DIGEST_BASE}:${ERROR_DIGEST_ROUTE_ERROR_RESPONSE}:{`
      )) {
        try {
          let parsed = JSON.parse(digest.slice(40));
          if (typeof parsed === "object" && parsed && typeof parsed.status === "number" && typeof parsed.statusText === "string") {
            return new ErrorResponseImpl(
              parsed.status,
              parsed.statusText,
              parsed.data
            );
          }
        } catch {
        }
      }
    }
    function useHref(to2, { relative } = {}) {
      invariant(
        useInRouterContext(),
        // TODO: This error is probably because they somehow have 2 versions of the
        // router loaded. We can help them understand how to avoid that.
        `useHref() may be used only in the context of a <Router> component.`
      );
      let { basename: basename2, navigator: navigator2 } = reactExports.useContext(NavigationContext);
      let { hash: hash2, pathname, search } = useResolvedPath(to2, { relative });
      let joinedPathname = pathname;
      if (basename2 !== "/") {
        joinedPathname = pathname === "/" ? basename2 : joinPaths([basename2, pathname]);
      }
      return navigator2.createHref({ pathname: joinedPathname, search, hash: hash2 });
    }
    function useInRouterContext() {
      return reactExports.useContext(LocationContext) != null;
    }
    function useLocation() {
      invariant(
        useInRouterContext(),
        // TODO: This error is probably because they somehow have 2 versions of the
        // router loaded. We can help them understand how to avoid that.
        `useLocation() may be used only in the context of a <Router> component.`
      );
      return reactExports.useContext(LocationContext).location;
    }
    var navigateEffectWarning = `You should call navigate() in a React.useEffect(), not when your component is first rendered.`;
    function useIsomorphicLayoutEffect$1(cb) {
      let isStatic = reactExports.useContext(NavigationContext).static;
      if (!isStatic) {
        reactExports.useLayoutEffect(cb);
      }
    }
    function useNavigate() {
      let { isDataRoute } = reactExports.useContext(RouteContext);
      return isDataRoute ? useNavigateStable() : useNavigateUnstable();
    }
    function useNavigateUnstable() {
      invariant(
        useInRouterContext(),
        // TODO: This error is probably because they somehow have 2 versions of the
        // router loaded. We can help them understand how to avoid that.
        `useNavigate() may be used only in the context of a <Router> component.`
      );
      let dataRouterContext = reactExports.useContext(DataRouterContext);
      let { basename: basename2, navigator: navigator2 } = reactExports.useContext(NavigationContext);
      let { matches } = reactExports.useContext(RouteContext);
      let { pathname: locationPathname } = useLocation();
      let routePathnamesJson = JSON.stringify(getResolveToMatches(matches));
      let activeRef = reactExports.useRef(false);
      useIsomorphicLayoutEffect$1(() => {
        activeRef.current = true;
      });
      let navigate = reactExports.useCallback(
        (to2, options2 = {}) => {
          warning(activeRef.current, navigateEffectWarning);
          if (!activeRef.current) return;
          if (typeof to2 === "number") {
            navigator2.go(to2);
            return;
          }
          let path = resolveTo(
            to2,
            JSON.parse(routePathnamesJson),
            locationPathname,
            options2.relative === "path"
          );
          if (dataRouterContext == null && basename2 !== "/") {
            path.pathname = path.pathname === "/" ? basename2 : joinPaths([basename2, path.pathname]);
          }
          (!!options2.replace ? navigator2.replace : navigator2.push)(
            path,
            options2.state,
            options2
          );
        },
        [
          basename2,
          navigator2,
          routePathnamesJson,
          locationPathname,
          dataRouterContext
        ]
      );
      return navigate;
    }
    var OutletContext = reactExports.createContext(null);
    function useOutlet(context) {
      let outlet = reactExports.useContext(RouteContext).outlet;
      return reactExports.useMemo(
        () => outlet && /* @__PURE__ */ reactExports.createElement(OutletContext.Provider, { value: context }, outlet),
        [outlet, context]
      );
    }
    function useParams() {
      let { matches } = reactExports.useContext(RouteContext);
      let routeMatch = matches[matches.length - 1];
      return routeMatch ? routeMatch.params : {};
    }
    function useResolvedPath(to2, { relative } = {}) {
      let { matches } = reactExports.useContext(RouteContext);
      let { pathname: locationPathname } = useLocation();
      let routePathnamesJson = JSON.stringify(getResolveToMatches(matches));
      return reactExports.useMemo(
        () => resolveTo(
          to2,
          JSON.parse(routePathnamesJson),
          locationPathname,
          relative === "path"
        ),
        [to2, routePathnamesJson, locationPathname, relative]
      );
    }
    function useRoutesImpl(routes, locationArg, dataRouterState, onError, future) {
      invariant(
        useInRouterContext(),
        // TODO: This error is probably because they somehow have 2 versions of the
        // router loaded. We can help them understand how to avoid that.
        `useRoutes() may be used only in the context of a <Router> component.`
      );
      let { navigator: navigator2 } = reactExports.useContext(NavigationContext);
      let { matches: parentMatches } = reactExports.useContext(RouteContext);
      let routeMatch = parentMatches[parentMatches.length - 1];
      let parentParams = routeMatch ? routeMatch.params : {};
      let parentPathname = routeMatch ? routeMatch.pathname : "/";
      let parentPathnameBase = routeMatch ? routeMatch.pathnameBase : "/";
      let parentRoute = routeMatch && routeMatch.route;
      {
        let parentPath = parentRoute && parentRoute.path || "";
        warningOnce(
          parentPathname,
          !parentRoute || parentPath.endsWith("*") || parentPath.endsWith("*?"),
          `You rendered descendant <Routes> (or called \`useRoutes()\`) at "${parentPathname}" (under <Route path="${parentPath}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.

Please change the parent <Route path="${parentPath}"> to <Route path="${parentPath === "/" ? "*" : `${parentPath}/*`}">.`
        );
      }
      let locationFromContext = useLocation();
      let location2;
      {
        location2 = locationFromContext;
      }
      let pathname = location2.pathname || "/";
      let remainingPathname = pathname;
      if (parentPathnameBase !== "/") {
        let parentSegments = parentPathnameBase.replace(/^\//, "").split("/");
        let segments2 = pathname.replace(/^\//, "").split("/");
        remainingPathname = "/" + segments2.slice(parentSegments.length).join("/");
      }
      let matches = matchRoutes(routes, { pathname: remainingPathname });
      {
        warning(
          parentRoute || matches != null,
          `No routes matched location "${location2.pathname}${location2.search}${location2.hash}" `
        );
        warning(
          matches == null || matches[matches.length - 1].route.element !== void 0 || matches[matches.length - 1].route.Component !== void 0 || matches[matches.length - 1].route.lazy !== void 0,
          `Matched leaf route at location "${location2.pathname}${location2.search}${location2.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`
        );
      }
      let renderedMatches = _renderMatches(
        matches && matches.map(
          (match) => Object.assign({}, match, {
            params: Object.assign({}, parentParams, match.params),
            pathname: joinPaths([
              parentPathnameBase,
              // Re-encode pathnames that were decoded inside matchRoutes.
              // Pre-encode `?` and `#` ahead of `encodeLocation` because it uses
              // `new URL()` internally and we need to prevent it from treating
              // them as separators
              navigator2.encodeLocation ? navigator2.encodeLocation(
                match.pathname.replace(/\?/g, "%3F").replace(/#/g, "%23")
              ).pathname : match.pathname
            ]),
            pathnameBase: match.pathnameBase === "/" ? parentPathnameBase : joinPaths([
              parentPathnameBase,
              // Re-encode pathnames that were decoded inside matchRoutes
              // Pre-encode `?` and `#` ahead of `encodeLocation` because it uses
              // `new URL()` internally and we need to prevent it from treating
              // them as separators
              navigator2.encodeLocation ? navigator2.encodeLocation(
                match.pathnameBase.replace(/\?/g, "%3F").replace(/#/g, "%23")
              ).pathname : match.pathnameBase
            ])
          })
        ),
        parentMatches,
        dataRouterState,
        onError,
        future
      );
      return renderedMatches;
    }
    function DefaultErrorComponent() {
      let error2 = useRouteError();
      let message2 = isRouteErrorResponse(error2) ? `${error2.status} ${error2.statusText}` : error2 instanceof Error ? error2.message : JSON.stringify(error2);
      let stack2 = error2 instanceof Error ? error2.stack : null;
      let lightgrey = "rgba(200,200,200, 0.5)";
      let preStyles = { padding: "0.5rem", backgroundColor: lightgrey };
      let codeStyles = { padding: "2px 4px", backgroundColor: lightgrey };
      let devInfo = null;
      {
        console.error(
          "Error handled by React Router default ErrorBoundary:",
          error2
        );
        devInfo = /* @__PURE__ */ reactExports.createElement(reactExports.Fragment, null, /* @__PURE__ */ reactExports.createElement("p", null, "💿 Hey developer 👋"), /* @__PURE__ */ reactExports.createElement("p", null, "You can provide a way better UX than this when your app throws errors by providing your own ", /* @__PURE__ */ reactExports.createElement("code", { style: codeStyles }, "ErrorBoundary"), " or", " ", /* @__PURE__ */ reactExports.createElement("code", { style: codeStyles }, "errorElement"), " prop on your route."));
      }
      return /* @__PURE__ */ reactExports.createElement(reactExports.Fragment, null, /* @__PURE__ */ reactExports.createElement("h2", null, "Unexpected Application Error!"), /* @__PURE__ */ reactExports.createElement("h3", { style: { fontStyle: "italic" } }, message2), stack2 ? /* @__PURE__ */ reactExports.createElement("pre", { style: preStyles }, stack2) : null, devInfo);
    }
    var defaultErrorElement = /* @__PURE__ */ reactExports.createElement(DefaultErrorComponent, null);
    var RenderErrorBoundary = class extends reactExports.Component {
      constructor(props) {
        super(props);
        this.state = {
          location: props.location,
          revalidation: props.revalidation,
          error: props.error
        };
      }
      static getDerivedStateFromError(error2) {
        return { error: error2 };
      }
      static getDerivedStateFromProps(props, state) {
        if (state.location !== props.location || state.revalidation !== "idle" && props.revalidation === "idle") {
          return {
            error: props.error,
            location: props.location,
            revalidation: props.revalidation
          };
        }
        return {
          error: props.error !== void 0 ? props.error : state.error,
          location: state.location,
          revalidation: props.revalidation || state.revalidation
        };
      }
      componentDidCatch(error2, errorInfo) {
        if (this.props.onError) {
          this.props.onError(error2, errorInfo);
        } else {
          console.error(
            "React Router caught the following error during render",
            error2
          );
        }
      }
      render() {
        let error2 = this.state.error;
        if (this.context && typeof error2 === "object" && error2 && "digest" in error2 && typeof error2.digest === "string") {
          const decoded = decodeRouteErrorResponseDigest(error2.digest);
          if (decoded) error2 = decoded;
        }
        let result2 = error2 !== void 0 ? /* @__PURE__ */ reactExports.createElement(RouteContext.Provider, { value: this.props.routeContext }, /* @__PURE__ */ reactExports.createElement(
          RouteErrorContext.Provider,
          {
            value: error2,
            children: this.props.component
          }
        )) : this.props.children;
        if (this.context) {
          return /* @__PURE__ */ reactExports.createElement(RSCErrorHandler, { error: error2 }, result2);
        }
        return result2;
      }
    };
    RenderErrorBoundary.contextType = RSCRouterContext;
    var errorRedirectHandledMap = /* @__PURE__ */ new WeakMap();
    function RSCErrorHandler({
      children: children2,
      error: error2
    }) {
      let { basename: basename2 } = reactExports.useContext(NavigationContext);
      if (typeof error2 === "object" && error2 && "digest" in error2 && typeof error2.digest === "string") {
        let redirect2 = decodeRedirectErrorDigest(error2.digest);
        if (redirect2) {
          let existingRedirect = errorRedirectHandledMap.get(error2);
          if (existingRedirect) throw existingRedirect;
          let parsed = parseToInfo(redirect2.location, basename2);
          if (isBrowser && !errorRedirectHandledMap.get(error2)) {
            if (parsed.isExternal || redirect2.reloadDocument) {
              window.location.href = parsed.absoluteURL || parsed.to;
            } else {
              const redirectPromise = Promise.resolve().then(
                () => window.__reactRouterDataRouter.navigate(parsed.to, {
                  replace: redirect2.replace
                })
              );
              errorRedirectHandledMap.set(error2, redirectPromise);
              throw redirectPromise;
            }
          }
          return /* @__PURE__ */ reactExports.createElement(
            "meta",
            {
              httpEquiv: "refresh",
              content: `0;url=${parsed.absoluteURL || parsed.to}`
            }
          );
        }
      }
      return children2;
    }
    function RenderedRoute({ routeContext, match, children: children2 }) {
      let dataRouterContext = reactExports.useContext(DataRouterContext);
      if (dataRouterContext && dataRouterContext.static && dataRouterContext.staticContext && (match.route.errorElement || match.route.ErrorBoundary)) {
        dataRouterContext.staticContext._deepestRenderedBoundaryId = match.route.id;
      }
      return /* @__PURE__ */ reactExports.createElement(RouteContext.Provider, { value: routeContext }, children2);
    }
    function _renderMatches(matches, parentMatches = [], dataRouterState = null, onErrorHandler = null, future = null) {
      if (matches == null) {
        if (!dataRouterState) {
          return null;
        }
        if (dataRouterState.errors) {
          matches = dataRouterState.matches;
        } else if (parentMatches.length === 0 && !dataRouterState.initialized && dataRouterState.matches.length > 0) {
          matches = dataRouterState.matches;
        } else {
          return null;
        }
      }
      let renderedMatches = matches;
      let errors2 = dataRouterState?.errors;
      if (errors2 != null) {
        let errorIndex = renderedMatches.findIndex(
          (m) => m.route.id && errors2?.[m.route.id] !== void 0
        );
        invariant(
          errorIndex >= 0,
          `Could not find a matching route for errors on route IDs: ${Object.keys(
            errors2
          ).join(",")}`
        );
        renderedMatches = renderedMatches.slice(
          0,
          Math.min(renderedMatches.length, errorIndex + 1)
        );
      }
      let renderFallback = false;
      let fallbackIndex = -1;
      if (dataRouterState) {
        for (let i2 = 0; i2 < renderedMatches.length; i2++) {
          let match = renderedMatches[i2];
          if (match.route.HydrateFallback || match.route.hydrateFallbackElement) {
            fallbackIndex = i2;
          }
          if (match.route.id) {
            let { loaderData, errors: errors22 } = dataRouterState;
            let needsToRunLoader = match.route.loader && !loaderData.hasOwnProperty(match.route.id) && (!errors22 || errors22[match.route.id] === void 0);
            if (match.route.lazy || needsToRunLoader) {
              renderFallback = true;
              if (fallbackIndex >= 0) {
                renderedMatches = renderedMatches.slice(0, fallbackIndex + 1);
              } else {
                renderedMatches = [renderedMatches[0]];
              }
              break;
            }
          }
        }
      }
      let onError = dataRouterState && onErrorHandler ? (error2, errorInfo) => {
        onErrorHandler(error2, {
          location: dataRouterState.location,
          params: dataRouterState.matches?.[0]?.params ?? {},
          unstable_pattern: getRoutePattern(dataRouterState.matches),
          errorInfo
        });
      } : void 0;
      return renderedMatches.reduceRight(
        (outlet, match, index) => {
          let error2;
          let shouldRenderHydrateFallback = false;
          let errorElement = null;
          let hydrateFallbackElement = null;
          if (dataRouterState) {
            error2 = errors2 && match.route.id ? errors2[match.route.id] : void 0;
            errorElement = match.route.errorElement || defaultErrorElement;
            if (renderFallback) {
              if (fallbackIndex < 0 && index === 0) {
                warningOnce(
                  "route-fallback",
                  false,
                  "No `HydrateFallback` element provided to render during initial hydration"
                );
                shouldRenderHydrateFallback = true;
                hydrateFallbackElement = null;
              } else if (fallbackIndex === index) {
                shouldRenderHydrateFallback = true;
                hydrateFallbackElement = match.route.hydrateFallbackElement || null;
              }
            }
          }
          let matches2 = parentMatches.concat(renderedMatches.slice(0, index + 1));
          let getChildren2 = () => {
            let children2;
            if (error2) {
              children2 = errorElement;
            } else if (shouldRenderHydrateFallback) {
              children2 = hydrateFallbackElement;
            } else if (match.route.Component) {
              children2 = /* @__PURE__ */ reactExports.createElement(match.route.Component, null);
            } else if (match.route.element) {
              children2 = match.route.element;
            } else {
              children2 = outlet;
            }
            return /* @__PURE__ */ reactExports.createElement(
              RenderedRoute,
              {
                match,
                routeContext: {
                  outlet,
                  matches: matches2,
                  isDataRoute: dataRouterState != null
                },
                children: children2
              }
            );
          };
          return dataRouterState && (match.route.ErrorBoundary || match.route.errorElement || index === 0) ? /* @__PURE__ */ reactExports.createElement(
            RenderErrorBoundary,
            {
              location: dataRouterState.location,
              revalidation: dataRouterState.revalidation,
              component: errorElement,
              error: error2,
              children: getChildren2(),
              routeContext: { outlet: null, matches: matches2, isDataRoute: true },
              onError
            }
          ) : getChildren2();
        },
        null
      );
    }
    function getDataRouterConsoleError(hookName) {
      return `${hookName} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`;
    }
    function useDataRouterContext(hookName) {
      let ctx = reactExports.useContext(DataRouterContext);
      invariant(ctx, getDataRouterConsoleError(hookName));
      return ctx;
    }
    function useDataRouterState(hookName) {
      let state = reactExports.useContext(DataRouterStateContext);
      invariant(state, getDataRouterConsoleError(hookName));
      return state;
    }
    function useRouteContext(hookName) {
      let route = reactExports.useContext(RouteContext);
      invariant(route, getDataRouterConsoleError(hookName));
      return route;
    }
    function useCurrentRouteId(hookName) {
      let route = useRouteContext(hookName);
      let thisRoute = route.matches[route.matches.length - 1];
      invariant(
        thisRoute.route.id,
        `${hookName} can only be used on routes that contain a unique "id"`
      );
      return thisRoute.route.id;
    }
    function useRouteId() {
      return useCurrentRouteId(
        "useRouteId"
        /* UseRouteId */
      );
    }
    function useRouteError() {
      let error2 = reactExports.useContext(RouteErrorContext);
      let state = useDataRouterState(
        "useRouteError"
        /* UseRouteError */
      );
      let routeId = useCurrentRouteId(
        "useRouteError"
        /* UseRouteError */
      );
      if (error2 !== void 0) {
        return error2;
      }
      return state.errors?.[routeId];
    }
    function useNavigateStable() {
      let { router } = useDataRouterContext(
        "useNavigate"
        /* UseNavigateStable */
      );
      let id = useCurrentRouteId(
        "useNavigate"
        /* UseNavigateStable */
      );
      let activeRef = reactExports.useRef(false);
      useIsomorphicLayoutEffect$1(() => {
        activeRef.current = true;
      });
      let navigate = reactExports.useCallback(
        async (to2, options2 = {}) => {
          warning(activeRef.current, navigateEffectWarning);
          if (!activeRef.current) return;
          if (typeof to2 === "number") {
            await router.navigate(to2);
          } else {
            await router.navigate(to2, { fromRouteId: id, ...options2 });
          }
        },
        [router, id]
      );
      return navigate;
    }
    var alreadyWarned = {};
    function warningOnce(key2, cond, message2) {
      if (!cond && !alreadyWarned[key2]) {
        alreadyWarned[key2] = true;
        warning(false, message2);
      }
    }
    var alreadyWarned2 = {};
    function warnOnce(condition, message2) {
      if (!condition && !alreadyWarned2[message2]) {
        alreadyWarned2[message2] = true;
        console.warn(message2);
      }
    }
    var USE_OPTIMISTIC = "useOptimistic";
    var useOptimisticImpl = React4[USE_OPTIMISTIC];
    var stableUseOptimisticSetter = () => void 0;
    function useOptimisticSafe(val) {
      if (useOptimisticImpl) {
        return useOptimisticImpl(val);
      } else {
        return [val, stableUseOptimisticSetter];
      }
    }
    function mapRouteProperties(route) {
      let updates = {
        // Note: this check also occurs in createRoutesFromChildren so update
        // there if you change this -- please and thank you!
        hasErrorBoundary: route.hasErrorBoundary || route.ErrorBoundary != null || route.errorElement != null
      };
      if (route.Component) {
        {
          if (route.element) {
            warning(
              false,
              "You should not include both `Component` and `element` on your route - `Component` will be used."
            );
          }
        }
        Object.assign(updates, {
          element: reactExports.createElement(route.Component),
          Component: void 0
        });
      }
      if (route.HydrateFallback) {
        {
          if (route.hydrateFallbackElement) {
            warning(
              false,
              "You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."
            );
          }
        }
        Object.assign(updates, {
          hydrateFallbackElement: reactExports.createElement(route.HydrateFallback),
          HydrateFallback: void 0
        });
      }
      if (route.ErrorBoundary) {
        {
          if (route.errorElement) {
            warning(
              false,
              "You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."
            );
          }
        }
        Object.assign(updates, {
          errorElement: reactExports.createElement(route.ErrorBoundary),
          ErrorBoundary: void 0
        });
      }
      return updates;
    }
    var hydrationRouteProperties = [
      "HydrateFallback",
      "hydrateFallbackElement"
    ];
    var Deferred = class {
      constructor() {
        this.status = "pending";
        this.promise = new Promise((resolve, reject) => {
          this.resolve = (value2) => {
            if (this.status === "pending") {
              this.status = "resolved";
              resolve(value2);
            }
          };
          this.reject = (reason) => {
            if (this.status === "pending") {
              this.status = "rejected";
              reject(reason);
            }
          };
        });
      }
    };
    function RouterProvider({
      router,
      flushSync: reactDomFlushSyncImpl,
      onError,
      unstable_useTransitions
    }) {
      let unstable_rsc = useIsRSCRouterContext();
      unstable_useTransitions = unstable_rsc || unstable_useTransitions;
      let [_state, setStateImpl] = reactExports.useState(router.state);
      let [state, setOptimisticState] = useOptimisticSafe(_state);
      let [pendingState, setPendingState] = reactExports.useState();
      let [vtContext, setVtContext] = reactExports.useState({
        isTransitioning: false
      });
      let [renderDfd, setRenderDfd] = reactExports.useState();
      let [transition, setTransition] = reactExports.useState();
      let [interruption, setInterruption] = reactExports.useState();
      let fetcherData = reactExports.useRef(/* @__PURE__ */ new Map());
      let setState2 = reactExports.useCallback(
        (newState, { deletedFetchers, newErrors, flushSync, viewTransitionOpts }) => {
          if (newErrors && onError) {
            Object.values(newErrors).forEach(
              (error2) => onError(error2, {
                location: newState.location,
                params: newState.matches[0]?.params ?? {},
                unstable_pattern: getRoutePattern(newState.matches)
              })
            );
          }
          newState.fetchers.forEach((fetcher, key2) => {
            if (fetcher.data !== void 0) {
              fetcherData.current.set(key2, fetcher.data);
            }
          });
          deletedFetchers.forEach((key2) => fetcherData.current.delete(key2));
          warnOnce(
            flushSync === false || reactDomFlushSyncImpl != null,
            'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable.  Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.'
          );
          let isViewTransitionAvailable = router.window != null && router.window.document != null && typeof router.window.document.startViewTransition === "function";
          warnOnce(
            viewTransitionOpts == null || isViewTransitionAvailable,
            "You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."
          );
          if (!viewTransitionOpts || !isViewTransitionAvailable) {
            if (reactDomFlushSyncImpl && flushSync) {
              reactDomFlushSyncImpl(() => setStateImpl(newState));
            } else if (unstable_useTransitions === false) {
              setStateImpl(newState);
            } else {
              reactExports.startTransition(() => {
                if (unstable_useTransitions === true) {
                  setOptimisticState((s) => getOptimisticRouterState(s, newState));
                }
                setStateImpl(newState);
              });
            }
            return;
          }
          if (reactDomFlushSyncImpl && flushSync) {
            reactDomFlushSyncImpl(() => {
              if (transition) {
                renderDfd?.resolve();
                transition.skipTransition();
              }
              setVtContext({
                isTransitioning: true,
                flushSync: true,
                currentLocation: viewTransitionOpts.currentLocation,
                nextLocation: viewTransitionOpts.nextLocation
              });
            });
            let t2 = router.window.document.startViewTransition(() => {
              reactDomFlushSyncImpl(() => setStateImpl(newState));
            });
            t2.finished.finally(() => {
              reactDomFlushSyncImpl(() => {
                setRenderDfd(void 0);
                setTransition(void 0);
                setPendingState(void 0);
                setVtContext({ isTransitioning: false });
              });
            });
            reactDomFlushSyncImpl(() => setTransition(t2));
            return;
          }
          if (transition) {
            renderDfd?.resolve();
            transition.skipTransition();
            setInterruption({
              state: newState,
              currentLocation: viewTransitionOpts.currentLocation,
              nextLocation: viewTransitionOpts.nextLocation
            });
          } else {
            setPendingState(newState);
            setVtContext({
              isTransitioning: true,
              flushSync: false,
              currentLocation: viewTransitionOpts.currentLocation,
              nextLocation: viewTransitionOpts.nextLocation
            });
          }
        },
        [
          router.window,
          reactDomFlushSyncImpl,
          transition,
          renderDfd,
          unstable_useTransitions,
          setOptimisticState,
          onError
        ]
      );
      reactExports.useLayoutEffect(() => router.subscribe(setState2), [router, setState2]);
      reactExports.useEffect(() => {
        if (vtContext.isTransitioning && !vtContext.flushSync) {
          setRenderDfd(new Deferred());
        }
      }, [vtContext]);
      reactExports.useEffect(() => {
        if (renderDfd && pendingState && router.window) {
          let newState = pendingState;
          let renderPromise = renderDfd.promise;
          let transition2 = router.window.document.startViewTransition(async () => {
            if (unstable_useTransitions === false) {
              setStateImpl(newState);
            } else {
              reactExports.startTransition(() => {
                if (unstable_useTransitions === true) {
                  setOptimisticState((s) => getOptimisticRouterState(s, newState));
                }
                setStateImpl(newState);
              });
            }
            await renderPromise;
          });
          transition2.finished.finally(() => {
            setRenderDfd(void 0);
            setTransition(void 0);
            setPendingState(void 0);
            setVtContext({ isTransitioning: false });
          });
          setTransition(transition2);
        }
      }, [
        pendingState,
        renderDfd,
        router.window,
        unstable_useTransitions,
        setOptimisticState
      ]);
      reactExports.useEffect(() => {
        if (renderDfd && pendingState && state.location.key === pendingState.location.key) {
          renderDfd.resolve();
        }
      }, [renderDfd, transition, state.location, pendingState]);
      reactExports.useEffect(() => {
        if (!vtContext.isTransitioning && interruption) {
          setPendingState(interruption.state);
          setVtContext({
            isTransitioning: true,
            flushSync: false,
            currentLocation: interruption.currentLocation,
            nextLocation: interruption.nextLocation
          });
          setInterruption(void 0);
        }
      }, [vtContext.isTransitioning, interruption]);
      let navigator2 = reactExports.useMemo(() => {
        return {
          createHref: router.createHref,
          encodeLocation: router.encodeLocation,
          go: (n) => router.navigate(n),
          push: (to2, state2, opts) => router.navigate(to2, {
            state: state2,
            preventScrollReset: opts?.preventScrollReset
          }),
          replace: (to2, state2, opts) => router.navigate(to2, {
            replace: true,
            state: state2,
            preventScrollReset: opts?.preventScrollReset
          })
        };
      }, [router]);
      let basename2 = router.basename || "/";
      let dataRouterContext = reactExports.useMemo(
        () => ({
          router,
          navigator: navigator2,
          static: false,
          basename: basename2,
          onError
        }),
        [router, navigator2, basename2, onError]
      );
      return /* @__PURE__ */ reactExports.createElement(reactExports.Fragment, null, /* @__PURE__ */ reactExports.createElement(DataRouterContext.Provider, { value: dataRouterContext }, /* @__PURE__ */ reactExports.createElement(DataRouterStateContext.Provider, { value: state }, /* @__PURE__ */ reactExports.createElement(FetchersContext.Provider, { value: fetcherData.current }, /* @__PURE__ */ reactExports.createElement(ViewTransitionContext.Provider, { value: vtContext }, /* @__PURE__ */ reactExports.createElement(
        Router,
        {
          basename: basename2,
          location: state.location,
          navigationType: state.historyAction,
          navigator: navigator2,
          unstable_useTransitions
        },
        /* @__PURE__ */ reactExports.createElement(
          MemoizedDataRoutes,
          {
            routes: router.routes,
            future: router.future,
            state,
            onError
          }
        )
      ))))), null);
    }
    function getOptimisticRouterState(currentState, newState) {
      return {
        // Don't surface "current location specific" stuff mid-navigation
        // (historyAction, location, matches, loaderData, errors, initialized,
        // restoreScroll, preventScrollReset, blockers, etc.)
        ...currentState,
        // Only surface "pending/in-flight stuff"
        // (navigation, revalidation, actionData, fetchers, )
        navigation: newState.navigation.state !== "idle" ? newState.navigation : currentState.navigation,
        revalidation: newState.revalidation !== "idle" ? newState.revalidation : currentState.revalidation,
        actionData: newState.navigation.state !== "submitting" ? newState.actionData : currentState.actionData,
        fetchers: newState.fetchers
      };
    }
    var MemoizedDataRoutes = reactExports.memo(DataRoutes);
    function DataRoutes({
      routes,
      future,
      state,
      onError
    }) {
      return useRoutesImpl(routes, void 0, state, onError, future);
    }
    function Navigate({
      to: to2,
      replace: replace2,
      state,
      relative
    }) {
      invariant(
        useInRouterContext(),
        // TODO: This error is probably because they somehow have 2 versions of
        // the router loaded. We can help them understand how to avoid that.
        `<Navigate> may be used only in the context of a <Router> component.`
      );
      let { static: isStatic } = reactExports.useContext(NavigationContext);
      warning(
        !isStatic,
        `<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.`
      );
      let { matches } = reactExports.useContext(RouteContext);
      let { pathname: locationPathname } = useLocation();
      let navigate = useNavigate();
      let path = resolveTo(
        to2,
        getResolveToMatches(matches),
        locationPathname,
        relative === "path"
      );
      let jsonPath = JSON.stringify(path);
      reactExports.useEffect(() => {
        navigate(JSON.parse(jsonPath), { replace: replace2, state, relative });
      }, [navigate, jsonPath, relative, replace2, state]);
      return null;
    }
    function Outlet(props) {
      return useOutlet(props.context);
    }
    function Router({
      basename: basenameProp = "/",
      children: children2 = null,
      location: locationProp,
      navigationType = "POP",
      navigator: navigator2,
      static: staticProp = false,
      unstable_useTransitions
    }) {
      invariant(
        !useInRouterContext(),
        `You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`
      );
      let basename2 = basenameProp.replace(/^\/*/, "/");
      let navigationContext = reactExports.useMemo(
        () => ({
          basename: basename2,
          navigator: navigator2,
          static: staticProp,
          unstable_useTransitions,
          future: {}
        }),
        [basename2, navigator2, staticProp, unstable_useTransitions]
      );
      if (typeof locationProp === "string") {
        locationProp = parsePath$1(locationProp);
      }
      let {
        pathname = "/",
        search = "",
        hash: hash2 = "",
        state = null,
        key: key2 = "default"
      } = locationProp;
      let locationContext = reactExports.useMemo(() => {
        let trailingPathname = stripBasename(pathname, basename2);
        if (trailingPathname == null) {
          return null;
        }
        return {
          location: {
            pathname: trailingPathname,
            search,
            hash: hash2,
            state,
            key: key2
          },
          navigationType
        };
      }, [basename2, pathname, search, hash2, state, key2, navigationType]);
      warning(
        locationContext != null,
        `<Router basename="${basename2}"> is not able to match the URL "${pathname}${search}${hash2}" because it does not start with the basename, so the <Router> won't render anything.`
      );
      if (locationContext == null) {
        return null;
      }
      return /* @__PURE__ */ reactExports.createElement(NavigationContext.Provider, { value: navigationContext }, /* @__PURE__ */ reactExports.createElement(LocationContext.Provider, { children: children2, value: locationContext }));
    }
    var defaultMethod = "get";
    var defaultEncType = "application/x-www-form-urlencoded";
    function isHtmlElement(object) {
      return typeof HTMLElement !== "undefined" && object instanceof HTMLElement;
    }
    function isButtonElement(object) {
      return isHtmlElement(object) && object.tagName.toLowerCase() === "button";
    }
    function isFormElement(object) {
      return isHtmlElement(object) && object.tagName.toLowerCase() === "form";
    }
    function isInputElement(object) {
      return isHtmlElement(object) && object.tagName.toLowerCase() === "input";
    }
    function isModifiedEvent(event) {
      return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey);
    }
    function shouldProcessLinkClick(event, target2) {
      return event.button === 0 && // Ignore everything but left clicks
      (!target2 || target2 === "_self") && // Let browser handle "target=_blank" etc.
      !isModifiedEvent(event);
    }
    function createSearchParams(init2 = "") {
      return new URLSearchParams(
        typeof init2 === "string" || Array.isArray(init2) || init2 instanceof URLSearchParams ? init2 : Object.keys(init2).reduce((memo2, key2) => {
          let value2 = init2[key2];
          return memo2.concat(
            Array.isArray(value2) ? value2.map((v) => [key2, v]) : [[key2, value2]]
          );
        }, [])
      );
    }
    function getSearchParamsForLocation(locationSearch, defaultSearchParams) {
      let searchParams = createSearchParams(locationSearch);
      if (defaultSearchParams) {
        defaultSearchParams.forEach((_, key2) => {
          if (!searchParams.has(key2)) {
            defaultSearchParams.getAll(key2).forEach((value2) => {
              searchParams.append(key2, value2);
            });
          }
        });
      }
      return searchParams;
    }
    var _formDataSupportsSubmitter = null;
    function isFormDataSubmitterSupported() {
      if (_formDataSupportsSubmitter === null) {
        try {
          new FormData(
            document.createElement("form"),
            // @ts-expect-error if FormData supports the submitter parameter, this will throw
            0
          );
          _formDataSupportsSubmitter = false;
        } catch (e) {
          _formDataSupportsSubmitter = true;
        }
      }
      return _formDataSupportsSubmitter;
    }
    var supportedFormEncTypes = /* @__PURE__ */ new Set([
      "application/x-www-form-urlencoded",
      "multipart/form-data",
      "text/plain"
    ]);
    function getFormEncType(encType) {
      if (encType != null && !supportedFormEncTypes.has(encType)) {
        warning(
          false,
          `"${encType}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${defaultEncType}"`
        );
        return null;
      }
      return encType;
    }
    function getFormSubmissionInfo(target2, basename2) {
      let method;
      let action;
      let encType;
      let formData;
      let body2;
      if (isFormElement(target2)) {
        let attr = target2.getAttribute("action");
        action = attr ? stripBasename(attr, basename2) : null;
        method = target2.getAttribute("method") || defaultMethod;
        encType = getFormEncType(target2.getAttribute("enctype")) || defaultEncType;
        formData = new FormData(target2);
      } else if (isButtonElement(target2) || isInputElement(target2) && (target2.type === "submit" || target2.type === "image")) {
        let form = target2.form;
        if (form == null) {
          throw new Error(
            `Cannot submit a <button> or <input type="submit"> without a <form>`
          );
        }
        let attr = target2.getAttribute("formaction") || form.getAttribute("action");
        action = attr ? stripBasename(attr, basename2) : null;
        method = target2.getAttribute("formmethod") || form.getAttribute("method") || defaultMethod;
        encType = getFormEncType(target2.getAttribute("formenctype")) || getFormEncType(form.getAttribute("enctype")) || defaultEncType;
        formData = new FormData(form, target2);
        if (!isFormDataSubmitterSupported()) {
          let { name: name2, type, value: value2 } = target2;
          if (type === "image") {
            let prefix = name2 ? `${name2}.` : "";
            formData.append(`${prefix}x`, "0");
            formData.append(`${prefix}y`, "0");
          } else if (name2) {
            formData.append(name2, value2);
          }
        }
      } else if (isHtmlElement(target2)) {
        throw new Error(
          `Cannot submit element that is not <form>, <button>, or <input type="submit|image">`
        );
      } else {
        method = defaultMethod;
        action = null;
        encType = defaultEncType;
        body2 = target2;
      }
      if (formData && encType === "text/plain") {
        body2 = formData;
        formData = void 0;
      }
      return { action, method: method.toLowerCase(), encType, formData, body: body2 };
    }
    Object.getOwnPropertyNames(Object.prototype).sort().join("\0");
    function invariant2(value2, message2) {
      if (value2 === false || value2 === null || typeof value2 === "undefined") {
        throw new Error(message2);
      }
    }
    function singleFetchUrl(reqUrl, basename2, extension) {
      let url = typeof reqUrl === "string" ? new URL(
        reqUrl,
        // This can be called during the SSR flow via PrefetchPageLinksImpl so
        // don't assume window is available
        typeof window === "undefined" ? "server://singlefetch/" : window.location.origin
      ) : reqUrl;
      if (url.pathname === "/") {
        url.pathname = `_root.${extension}`;
      } else if (basename2 && stripBasename(url.pathname, basename2) === "/") {
        url.pathname = `${basename2.replace(/\/$/, "")}/_root.${extension}`;
      } else {
        url.pathname = `${url.pathname.replace(/\/$/, "")}.${extension}`;
      }
      return url;
    }
    async function loadRouteModule(route, routeModulesCache) {
      if (route.id in routeModulesCache) {
        return routeModulesCache[route.id];
      }
      try {
        let routeModule = await import(
          /* @vite-ignore */
          /* webpackIgnore: true */
          route.module
        );
        routeModulesCache[route.id] = routeModule;
        return routeModule;
      } catch (error2) {
        console.error(
          `Error loading route module \`${route.module}\`, reloading page...`
        );
        console.error(error2);
        if (window.__reactRouterContext && window.__reactRouterContext.isSpaMode && // @ts-expect-error
        void 0) ;
        window.location.reload();
        return new Promise(() => {
        });
      }
    }
    function isHtmlLinkDescriptor(object) {
      if (object == null) {
        return false;
      }
      if (object.href == null) {
        return object.rel === "preload" && typeof object.imageSrcSet === "string" && typeof object.imageSizes === "string";
      }
      return typeof object.rel === "string" && typeof object.href === "string";
    }
    async function getKeyedPrefetchLinks(matches, manifest, routeModules) {
      let links2 = await Promise.all(
        matches.map(async (match) => {
          let route = manifest.routes[match.route.id];
          if (route) {
            let mod2 = await loadRouteModule(route, routeModules);
            return mod2.links ? mod2.links() : [];
          }
          return [];
        })
      );
      return dedupeLinkDescriptors(
        links2.flat(1).filter(isHtmlLinkDescriptor).filter((link2) => link2.rel === "stylesheet" || link2.rel === "preload").map(
          (link2) => link2.rel === "stylesheet" ? { ...link2, rel: "prefetch", as: "style" } : { ...link2, rel: "prefetch" }
        )
      );
    }
    function getNewMatchesForLinks(page, nextMatches, currentMatches, manifest, location2, mode) {
      let isNew = (match, index) => {
        if (!currentMatches[index]) return true;
        return match.route.id !== currentMatches[index].route.id;
      };
      let matchPathChanged = (match, index) => {
        return (
          // param change, /users/123 -> /users/456
          currentMatches[index].pathname !== match.pathname || // splat param changed, which is not present in match.path
          // e.g. /files/images/avatar.jpg -> files/finances.xls
          currentMatches[index].route.path?.endsWith("*") && currentMatches[index].params["*"] !== match.params["*"]
        );
      };
      if (mode === "assets") {
        return nextMatches.filter(
          (match, index) => isNew(match, index) || matchPathChanged(match, index)
        );
      }
      if (mode === "data") {
        return nextMatches.filter((match, index) => {
          let manifestRoute = manifest.routes[match.route.id];
          if (!manifestRoute || !manifestRoute.hasLoader) {
            return false;
          }
          if (isNew(match, index) || matchPathChanged(match, index)) {
            return true;
          }
          if (match.route.shouldRevalidate) {
            let routeChoice = match.route.shouldRevalidate({
              currentUrl: new URL(
                location2.pathname + location2.search + location2.hash,
                window.origin
              ),
              currentParams: currentMatches[0]?.params || {},
              nextUrl: new URL(page, window.origin),
              nextParams: match.params,
              defaultShouldRevalidate: true
            });
            if (typeof routeChoice === "boolean") {
              return routeChoice;
            }
          }
          return true;
        });
      }
      return [];
    }
    function getModuleLinkHrefs(matches, manifest, { includeHydrateFallback } = {}) {
      return dedupeHrefs(
        matches.map((match) => {
          let route = manifest.routes[match.route.id];
          if (!route) return [];
          let hrefs = [route.module];
          if (route.clientActionModule) {
            hrefs = hrefs.concat(route.clientActionModule);
          }
          if (route.clientLoaderModule) {
            hrefs = hrefs.concat(route.clientLoaderModule);
          }
          if (includeHydrateFallback && route.hydrateFallbackModule) {
            hrefs = hrefs.concat(route.hydrateFallbackModule);
          }
          if (route.imports) {
            hrefs = hrefs.concat(route.imports);
          }
          return hrefs;
        }).flat(1)
      );
    }
    function dedupeHrefs(hrefs) {
      return [...new Set(hrefs)];
    }
    function sortKeys(obj) {
      let sorted = {};
      let keys = Object.keys(obj).sort();
      for (let key2 of keys) {
        sorted[key2] = obj[key2];
      }
      return sorted;
    }
    function dedupeLinkDescriptors(descriptors, preloads) {
      let set2 = /* @__PURE__ */ new Set();
      new Set(preloads);
      return descriptors.reduce((deduped, descriptor) => {
        let key2 = JSON.stringify(sortKeys(descriptor));
        if (!set2.has(key2)) {
          set2.add(key2);
          deduped.push({ key: key2, link: descriptor });
        }
        return deduped;
      }, []);
    }
    function useDataRouterContext2() {
      let context = reactExports.useContext(DataRouterContext);
      invariant2(
        context,
        "You must render this element inside a <DataRouterContext.Provider> element"
      );
      return context;
    }
    function useDataRouterStateContext() {
      let context = reactExports.useContext(DataRouterStateContext);
      invariant2(
        context,
        "You must render this element inside a <DataRouterStateContext.Provider> element"
      );
      return context;
    }
    var FrameworkContext = reactExports.createContext(void 0);
    FrameworkContext.displayName = "FrameworkContext";
    function useFrameworkContext() {
      let context = reactExports.useContext(FrameworkContext);
      invariant2(
        context,
        "You must render this element inside a <HydratedRouter> element"
      );
      return context;
    }
    function usePrefetchBehavior(prefetch, theirElementProps) {
      let frameworkContext = reactExports.useContext(FrameworkContext);
      let [maybePrefetch, setMaybePrefetch] = reactExports.useState(false);
      let [shouldPrefetch, setShouldPrefetch] = reactExports.useState(false);
      let { onFocus, onBlur, onMouseEnter, onMouseLeave, onTouchStart } = theirElementProps;
      let ref = reactExports.useRef(null);
      reactExports.useEffect(() => {
        if (prefetch === "render") {
          setShouldPrefetch(true);
        }
        if (prefetch === "viewport") {
          let callback = (entries) => {
            entries.forEach((entry) => {
              setShouldPrefetch(entry.isIntersecting);
            });
          };
          let observer = new IntersectionObserver(callback, { threshold: 0.5 });
          if (ref.current) observer.observe(ref.current);
          return () => {
            observer.disconnect();
          };
        }
      }, [prefetch]);
      reactExports.useEffect(() => {
        if (maybePrefetch) {
          let id = setTimeout(() => {
            setShouldPrefetch(true);
          }, 100);
          return () => {
            clearTimeout(id);
          };
        }
      }, [maybePrefetch]);
      let setIntent = () => {
        setMaybePrefetch(true);
      };
      let cancelIntent = () => {
        setMaybePrefetch(false);
        setShouldPrefetch(false);
      };
      if (!frameworkContext) {
        return [false, ref, {}];
      }
      if (prefetch !== "intent") {
        return [shouldPrefetch, ref, {}];
      }
      return [
        shouldPrefetch,
        ref,
        {
          onFocus: composeEventHandlers(onFocus, setIntent),
          onBlur: composeEventHandlers(onBlur, cancelIntent),
          onMouseEnter: composeEventHandlers(onMouseEnter, setIntent),
          onMouseLeave: composeEventHandlers(onMouseLeave, cancelIntent),
          onTouchStart: composeEventHandlers(onTouchStart, setIntent)
        }
      ];
    }
    function composeEventHandlers(theirHandler, ourHandler) {
      return (event) => {
        theirHandler && theirHandler(event);
        if (!event.defaultPrevented) {
          ourHandler(event);
        }
      };
    }
    function PrefetchPageLinks({ page, ...linkProps }) {
      let { router } = useDataRouterContext2();
      let matches = reactExports.useMemo(
        () => matchRoutes(router.routes, page, router.basename),
        [router.routes, page, router.basename]
      );
      if (!matches) {
        return null;
      }
      return /* @__PURE__ */ reactExports.createElement(PrefetchPageLinksImpl, { page, matches, ...linkProps });
    }
    function useKeyedPrefetchLinks(matches) {
      let { manifest, routeModules } = useFrameworkContext();
      let [keyedPrefetchLinks, setKeyedPrefetchLinks] = reactExports.useState([]);
      reactExports.useEffect(() => {
        let interrupted = false;
        void getKeyedPrefetchLinks(matches, manifest, routeModules).then(
          (links2) => {
            if (!interrupted) {
              setKeyedPrefetchLinks(links2);
            }
          }
        );
        return () => {
          interrupted = true;
        };
      }, [matches, manifest, routeModules]);
      return keyedPrefetchLinks;
    }
    function PrefetchPageLinksImpl({
      page,
      matches: nextMatches,
      ...linkProps
    }) {
      let location2 = useLocation();
      let { manifest, routeModules } = useFrameworkContext();
      let { basename: basename2 } = useDataRouterContext2();
      let { loaderData, matches } = useDataRouterStateContext();
      let newMatchesForData = reactExports.useMemo(
        () => getNewMatchesForLinks(
          page,
          nextMatches,
          matches,
          manifest,
          location2,
          "data"
        ),
        [page, nextMatches, matches, manifest, location2]
      );
      let newMatchesForAssets = reactExports.useMemo(
        () => getNewMatchesForLinks(
          page,
          nextMatches,
          matches,
          manifest,
          location2,
          "assets"
        ),
        [page, nextMatches, matches, manifest, location2]
      );
      let dataHrefs = reactExports.useMemo(() => {
        if (page === location2.pathname + location2.search + location2.hash) {
          return [];
        }
        let routesParams = /* @__PURE__ */ new Set();
        let foundOptOutRoute = false;
        nextMatches.forEach((m) => {
          let manifestRoute = manifest.routes[m.route.id];
          if (!manifestRoute || !manifestRoute.hasLoader) {
            return;
          }
          if (!newMatchesForData.some((m2) => m2.route.id === m.route.id) && m.route.id in loaderData && routeModules[m.route.id]?.shouldRevalidate) {
            foundOptOutRoute = true;
          } else if (manifestRoute.hasClientLoader) {
            foundOptOutRoute = true;
          } else {
            routesParams.add(m.route.id);
          }
        });
        if (routesParams.size === 0) {
          return [];
        }
        let url = singleFetchUrl(page, basename2, "data");
        if (foundOptOutRoute && routesParams.size > 0) {
          url.searchParams.set(
            "_routes",
            nextMatches.filter((m) => routesParams.has(m.route.id)).map((m) => m.route.id).join(",")
          );
        }
        return [url.pathname + url.search];
      }, [
        basename2,
        loaderData,
        location2,
        manifest,
        newMatchesForData,
        nextMatches,
        page,
        routeModules
      ]);
      let moduleHrefs = reactExports.useMemo(
        () => getModuleLinkHrefs(newMatchesForAssets, manifest),
        [newMatchesForAssets, manifest]
      );
      let keyedPrefetchLinks = useKeyedPrefetchLinks(newMatchesForAssets);
      return /* @__PURE__ */ reactExports.createElement(reactExports.Fragment, null, dataHrefs.map((href) => /* @__PURE__ */ reactExports.createElement("link", { key: href, rel: "prefetch", as: "fetch", href, ...linkProps })), moduleHrefs.map((href) => /* @__PURE__ */ reactExports.createElement("link", { key: href, rel: "modulepreload", href, ...linkProps })), keyedPrefetchLinks.map(({ key: key2, link: link2 }) => (
        // these don't spread `linkProps` because they are full link descriptors
        // already with their own props
        /* @__PURE__ */ reactExports.createElement("link", { key: key2, nonce: linkProps.nonce, ...link2 })
      )));
    }
    function mergeRefs(...refs) {
      return (value2) => {
        refs.forEach((ref) => {
          if (typeof ref === "function") {
            ref(value2);
          } else if (ref != null) {
            ref.current = value2;
          }
        });
      };
    }
    var isBrowser2 = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";
    try {
      if (isBrowser2) {
        window.__reactRouterVersion = // @ts-expect-error
        "7.11.0";
      }
    } catch (e) {
    }
    function createHashRouter(routes, opts) {
      return createRouter({
        basename: opts?.basename,
        getContext: opts?.getContext,
        future: opts?.future,
        history: createHashHistory({ window: opts?.window }),
        hydrationData: opts?.hydrationData || parseHydrationData(),
        routes,
        mapRouteProperties,
        hydrationRouteProperties,
        dataStrategy: opts?.dataStrategy,
        patchRoutesOnNavigation: opts?.patchRoutesOnNavigation,
        window: opts?.window,
        unstable_instrumentations: opts?.unstable_instrumentations
      }).initialize();
    }
    function parseHydrationData() {
      let state = window?.__staticRouterHydrationData;
      if (state && state.errors) {
        state = {
          ...state,
          errors: deserializeErrors(state.errors)
        };
      }
      return state;
    }
    function deserializeErrors(errors2) {
      if (!errors2) return null;
      let entries = Object.entries(errors2);
      let serialized = {};
      for (let [key2, val] of entries) {
        if (val && val.__type === "RouteErrorResponse") {
          serialized[key2] = new ErrorResponseImpl(
            val.status,
            val.statusText,
            val.data,
            val.internal === true
          );
        } else if (val && val.__type === "Error") {
          if (val.__subType) {
            let ErrorConstructor = window[val.__subType];
            if (typeof ErrorConstructor === "function") {
              try {
                let error2 = new ErrorConstructor(val.message);
                error2.stack = "";
                serialized[key2] = error2;
              } catch (e) {
              }
            }
          }
          if (serialized[key2] == null) {
            let error2 = new Error(val.message);
            error2.stack = "";
            serialized[key2] = error2;
          }
        } else {
          serialized[key2] = val;
        }
      }
      return serialized;
    }
    var ABSOLUTE_URL_REGEX2 = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;
    var Link = reactExports.forwardRef(
      function LinkWithRef({
        onClick,
        discover = "render",
        prefetch = "none",
        relative,
        reloadDocument,
        replace: replace2,
        state,
        target: target2,
        to: to2,
        preventScrollReset,
        viewTransition,
        unstable_defaultShouldRevalidate,
        ...rest
      }, forwardedRef) {
        let { basename: basename2, unstable_useTransitions } = reactExports.useContext(NavigationContext);
        let isAbsolute = typeof to2 === "string" && ABSOLUTE_URL_REGEX2.test(to2);
        let parsed = parseToInfo(to2, basename2);
        to2 = parsed.to;
        let href = useHref(to2, { relative });
        let [shouldPrefetch, prefetchRef, prefetchHandlers] = usePrefetchBehavior(
          prefetch,
          rest
        );
        let internalOnClick = useLinkClickHandler(to2, {
          replace: replace2,
          state,
          target: target2,
          preventScrollReset,
          relative,
          viewTransition,
          unstable_defaultShouldRevalidate,
          unstable_useTransitions
        });
        function handleClick(event) {
          if (onClick) onClick(event);
          if (!event.defaultPrevented) {
            internalOnClick(event);
          }
        }
        let link2 = (
          // eslint-disable-next-line jsx-a11y/anchor-has-content
          /* @__PURE__ */ reactExports.createElement(
            "a",
            {
              ...rest,
              ...prefetchHandlers,
              href: parsed.absoluteURL || href,
              onClick: parsed.isExternal || reloadDocument ? onClick : handleClick,
              ref: mergeRefs(forwardedRef, prefetchRef),
              target: target2,
              "data-discover": !isAbsolute && discover === "render" ? "true" : void 0
            }
          )
        );
        return shouldPrefetch && !isAbsolute ? /* @__PURE__ */ reactExports.createElement(reactExports.Fragment, null, link2, /* @__PURE__ */ reactExports.createElement(PrefetchPageLinks, { page: href })) : link2;
      }
    );
    Link.displayName = "Link";
    var NavLink = reactExports.forwardRef(
      function NavLinkWithRef({
        "aria-current": ariaCurrentProp = "page",
        caseSensitive = false,
        className: classNameProp = "",
        end: end2 = false,
        style: styleProp,
        to: to2,
        viewTransition,
        children: children2,
        ...rest
      }, ref) {
        let path = useResolvedPath(to2, { relative: rest.relative });
        let location2 = useLocation();
        let routerState = reactExports.useContext(DataRouterStateContext);
        let { navigator: navigator2, basename: basename2 } = reactExports.useContext(NavigationContext);
        let isTransitioning = routerState != null && // Conditional usage is OK here because the usage of a data router is static
        // eslint-disable-next-line react-hooks/rules-of-hooks
        useViewTransitionState(path) && viewTransition === true;
        let toPathname = navigator2.encodeLocation ? navigator2.encodeLocation(path).pathname : path.pathname;
        let locationPathname = location2.pathname;
        let nextLocationPathname = routerState && routerState.navigation && routerState.navigation.location ? routerState.navigation.location.pathname : null;
        if (!caseSensitive) {
          locationPathname = locationPathname.toLowerCase();
          nextLocationPathname = nextLocationPathname ? nextLocationPathname.toLowerCase() : null;
          toPathname = toPathname.toLowerCase();
        }
        if (nextLocationPathname && basename2) {
          nextLocationPathname = stripBasename(nextLocationPathname, basename2) || nextLocationPathname;
        }
        const endSlashPosition = toPathname !== "/" && toPathname.endsWith("/") ? toPathname.length - 1 : toPathname.length;
        let isActive = locationPathname === toPathname || !end2 && locationPathname.startsWith(toPathname) && locationPathname.charAt(endSlashPosition) === "/";
        let isPending = nextLocationPathname != null && (nextLocationPathname === toPathname || !end2 && nextLocationPathname.startsWith(toPathname) && nextLocationPathname.charAt(toPathname.length) === "/");
        let renderProps = {
          isActive,
          isPending,
          isTransitioning
        };
        let ariaCurrent = isActive ? ariaCurrentProp : void 0;
        let className2;
        if (typeof classNameProp === "function") {
          className2 = classNameProp(renderProps);
        } else {
          className2 = [
            classNameProp,
            isActive ? "active" : null,
            isPending ? "pending" : null,
            isTransitioning ? "transitioning" : null
          ].filter(Boolean).join(" ");
        }
        let style2 = typeof styleProp === "function" ? styleProp(renderProps) : styleProp;
        return /* @__PURE__ */ reactExports.createElement(
          Link,
          {
            ...rest,
            "aria-current": ariaCurrent,
            className: className2,
            ref,
            style: style2,
            to: to2,
            viewTransition
          },
          typeof children2 === "function" ? children2(renderProps) : children2
        );
      }
    );
    NavLink.displayName = "NavLink";
    var Form = reactExports.forwardRef(
      ({
        discover = "render",
        fetcherKey,
        navigate,
        reloadDocument,
        replace: replace2,
        state,
        method = defaultMethod,
        action,
        onSubmit,
        relative,
        preventScrollReset,
        viewTransition,
        unstable_defaultShouldRevalidate,
        ...props
      }, forwardedRef) => {
        let { unstable_useTransitions } = reactExports.useContext(NavigationContext);
        let submit = useSubmit();
        let formAction = useFormAction(action, { relative });
        let formMethod = method.toLowerCase() === "get" ? "get" : "post";
        let isAbsolute = typeof action === "string" && ABSOLUTE_URL_REGEX2.test(action);
        let submitHandler = (event) => {
          onSubmit && onSubmit(event);
          if (event.defaultPrevented) return;
          event.preventDefault();
          let submitter = event.nativeEvent.submitter;
          let submitMethod = submitter?.getAttribute("formmethod") || method;
          let doSubmit = () => submit(submitter || event.currentTarget, {
            fetcherKey,
            method: submitMethod,
            navigate,
            replace: replace2,
            state,
            relative,
            preventScrollReset,
            viewTransition,
            unstable_defaultShouldRevalidate
          });
          if (unstable_useTransitions && navigate !== false) {
            reactExports.startTransition(() => doSubmit());
          } else {
            doSubmit();
          }
        };
        return /* @__PURE__ */ reactExports.createElement(
          "form",
          {
            ref: forwardedRef,
            method: formMethod,
            action: formAction,
            onSubmit: reloadDocument ? onSubmit : submitHandler,
            ...props,
            "data-discover": !isAbsolute && discover === "render" ? "true" : void 0
          }
        );
      }
    );
    Form.displayName = "Form";
    function getDataRouterConsoleError2(hookName) {
      return `${hookName} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`;
    }
    function useDataRouterContext3(hookName) {
      let ctx = reactExports.useContext(DataRouterContext);
      invariant(ctx, getDataRouterConsoleError2(hookName));
      return ctx;
    }
    function useLinkClickHandler(to2, {
      target: target2,
      replace: replaceProp,
      state,
      preventScrollReset,
      relative,
      viewTransition,
      unstable_defaultShouldRevalidate,
      unstable_useTransitions
    } = {}) {
      let navigate = useNavigate();
      let location2 = useLocation();
      let path = useResolvedPath(to2, { relative });
      return reactExports.useCallback(
        (event) => {
          if (shouldProcessLinkClick(event, target2)) {
            event.preventDefault();
            let replace2 = replaceProp !== void 0 ? replaceProp : createPath(location2) === createPath(path);
            let doNavigate = () => navigate(to2, {
              replace: replace2,
              state,
              preventScrollReset,
              relative,
              viewTransition,
              unstable_defaultShouldRevalidate
            });
            if (unstable_useTransitions) {
              reactExports.startTransition(() => doNavigate());
            } else {
              doNavigate();
            }
          }
        },
        [
          location2,
          navigate,
          path,
          replaceProp,
          state,
          target2,
          to2,
          preventScrollReset,
          relative,
          viewTransition,
          unstable_defaultShouldRevalidate,
          unstable_useTransitions
        ]
      );
    }
    function useSearchParams(defaultInit) {
      warning(
        typeof URLSearchParams !== "undefined",
        `You cannot use the \`useSearchParams\` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.`
      );
      let defaultSearchParamsRef = reactExports.useRef(createSearchParams(defaultInit));
      let hasSetSearchParamsRef = reactExports.useRef(false);
      let location2 = useLocation();
      let searchParams = reactExports.useMemo(
        () => (
          // Only merge in the defaults if we haven't yet called setSearchParams.
          // Once we call that we want those to take precedence, otherwise you can't
          // remove a param with setSearchParams({}) if it has an initial value
          getSearchParamsForLocation(
            location2.search,
            hasSetSearchParamsRef.current ? null : defaultSearchParamsRef.current
          )
        ),
        [location2.search]
      );
      let navigate = useNavigate();
      let setSearchParams = reactExports.useCallback(
        (nextInit, navigateOptions) => {
          const newSearchParams = createSearchParams(
            typeof nextInit === "function" ? nextInit(new URLSearchParams(searchParams)) : nextInit
          );
          hasSetSearchParamsRef.current = true;
          navigate("?" + newSearchParams, navigateOptions);
        },
        [navigate, searchParams]
      );
      return [searchParams, setSearchParams];
    }
    var fetcherId = 0;
    var getUniqueFetcherId = () => `__${String(++fetcherId)}__`;
    function useSubmit() {
      let { router } = useDataRouterContext3(
        "useSubmit"
        /* UseSubmit */
      );
      let { basename: basename2 } = reactExports.useContext(NavigationContext);
      let currentRouteId = useRouteId();
      let routerFetch = router.fetch;
      let routerNavigate = router.navigate;
      return reactExports.useCallback(
        async (target2, options2 = {}) => {
          let { action, method, encType, formData, body: body2 } = getFormSubmissionInfo(
            target2,
            basename2
          );
          if (options2.navigate === false) {
            let key2 = options2.fetcherKey || getUniqueFetcherId();
            await routerFetch(key2, currentRouteId, options2.action || action, {
              unstable_defaultShouldRevalidate: options2.unstable_defaultShouldRevalidate,
              preventScrollReset: options2.preventScrollReset,
              formData,
              body: body2,
              formMethod: options2.method || method,
              formEncType: options2.encType || encType,
              flushSync: options2.flushSync
            });
          } else {
            await routerNavigate(options2.action || action, {
              unstable_defaultShouldRevalidate: options2.unstable_defaultShouldRevalidate,
              preventScrollReset: options2.preventScrollReset,
              formData,
              body: body2,
              formMethod: options2.method || method,
              formEncType: options2.encType || encType,
              replace: options2.replace,
              state: options2.state,
              fromRouteId: currentRouteId,
              flushSync: options2.flushSync,
              viewTransition: options2.viewTransition
            });
          }
        },
        [routerFetch, routerNavigate, basename2, currentRouteId]
      );
    }
    function useFormAction(action, { relative } = {}) {
      let { basename: basename2 } = reactExports.useContext(NavigationContext);
      let routeContext = reactExports.useContext(RouteContext);
      invariant(routeContext, "useFormAction must be used inside a RouteContext");
      let [match] = routeContext.matches.slice(-1);
      let path = { ...useResolvedPath(action ? action : ".", { relative }) };
      let location2 = useLocation();
      if (action == null) {
        path.search = location2.search;
        let params = new URLSearchParams(path.search);
        let indexValues = params.getAll("index");
        let hasNakedIndexParam = indexValues.some((v) => v === "");
        if (hasNakedIndexParam) {
          params.delete("index");
          indexValues.filter((v) => v).forEach((v) => params.append("index", v));
          let qs = params.toString();
          path.search = qs ? `?${qs}` : "";
        }
      }
      if ((!action || action === ".") && match.route.index) {
        path.search = path.search ? path.search.replace(/^\?/, "?index&") : "?index";
      }
      if (basename2 !== "/") {
        path.pathname = path.pathname === "/" ? basename2 : joinPaths([basename2, path.pathname]);
      }
      return createPath(path);
    }
    function useViewTransitionState(to2, { relative } = {}) {
      let vtContext = reactExports.useContext(ViewTransitionContext);
      invariant(
        vtContext != null,
        "`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`.  Did you accidentally import `RouterProvider` from `react-router`?"
      );
      let { basename: basename2 } = useDataRouterContext3(
        "useViewTransitionState"
        /* useViewTransitionState */
      );
      let path = useResolvedPath(to2, { relative });
      if (!vtContext.isTransitioning) {
        return false;
      }
      let currentPath = stripBasename(vtContext.currentLocation.pathname, basename2) || vtContext.currentLocation.pathname;
      let nextPath = stripBasename(vtContext.nextLocation.pathname, basename2) || vtContext.nextLocation.pathname;
      return matchPath(path.pathname, nextPath) != null || matchPath(path.pathname, currentPath) != null;
    }
    var reactDomExports = requireReactDom();
    const ReactDOM = /* @__PURE__ */ getDefaultExportFromCjs(reactDomExports);
    function RouterProvider2(props) {
      return /* @__PURE__ */ reactExports.createElement(RouterProvider, { flushSync: reactDomExports.flushSync, ...props });
    }
    var NOTHING = Symbol.for("immer-nothing");
    var DRAFTABLE = Symbol.for("immer-draftable");
    var DRAFT_STATE = Symbol.for("immer-state");
    function die$1(error2, ...args2) {
      throw new Error(
        `[Immer] minified error nr: ${error2}. Full error at: https://bit.ly/3cXEKWf`
      );
    }
    var getPrototypeOf = Object.getPrototypeOf;
    function isDraft(value2) {
      return !!value2 && !!value2[DRAFT_STATE];
    }
    function isDraftable(value2) {
      if (!value2)
        return false;
      return isPlainObject(value2) || Array.isArray(value2) || !!value2[DRAFTABLE] || !!value2.constructor?.[DRAFTABLE] || isMap(value2) || isSet(value2);
    }
    var objectCtorString = Object.prototype.constructor.toString();
    var cachedCtorStrings = /* @__PURE__ */ new WeakMap();
    function isPlainObject(value2) {
      if (!value2 || typeof value2 !== "object")
        return false;
      const proto = Object.getPrototypeOf(value2);
      if (proto === null || proto === Object.prototype)
        return true;
      const Ctor = Object.hasOwnProperty.call(proto, "constructor") && proto.constructor;
      if (Ctor === Object)
        return true;
      if (typeof Ctor !== "function")
        return false;
      let ctorString = cachedCtorStrings.get(Ctor);
      if (ctorString === void 0) {
        ctorString = Function.toString.call(Ctor);
        cachedCtorStrings.set(Ctor, ctorString);
      }
      return ctorString === objectCtorString;
    }
    function each(obj, iter, strict = true) {
      if (getArchtype(obj) === 0) {
        const keys = strict ? Reflect.ownKeys(obj) : Object.keys(obj);
        keys.forEach((key2) => {
          iter(key2, obj[key2], obj);
        });
      } else {
        obj.forEach((entry, index) => iter(index, entry, obj));
      }
    }
    function getArchtype(thing) {
      const state = thing[DRAFT_STATE];
      return state ? state.type_ : Array.isArray(thing) ? 1 : isMap(thing) ? 2 : isSet(thing) ? 3 : 0;
    }
    function has$1(thing, prop2) {
      return getArchtype(thing) === 2 ? thing.has(prop2) : Object.prototype.hasOwnProperty.call(thing, prop2);
    }
    function set(thing, propOrOldValue, value2) {
      const t2 = getArchtype(thing);
      if (t2 === 2)
        thing.set(propOrOldValue, value2);
      else if (t2 === 3) {
        thing.add(value2);
      } else
        thing[propOrOldValue] = value2;
    }
    function is(x2, y) {
      if (x2 === y) {
        return x2 !== 0 || 1 / x2 === 1 / y;
      } else {
        return x2 !== x2 && y !== y;
      }
    }
    function isMap(target2) {
      return target2 instanceof Map;
    }
    function isSet(target2) {
      return target2 instanceof Set;
    }
    function latest(state) {
      return state.copy_ || state.base_;
    }
    function shallowCopy(base2, strict) {
      if (isMap(base2)) {
        return new Map(base2);
      }
      if (isSet(base2)) {
        return new Set(base2);
      }
      if (Array.isArray(base2))
        return Array.prototype.slice.call(base2);
      const isPlain = isPlainObject(base2);
      if (strict === true || strict === "class_only" && !isPlain) {
        const descriptors = Object.getOwnPropertyDescriptors(base2);
        delete descriptors[DRAFT_STATE];
        let keys = Reflect.ownKeys(descriptors);
        for (let i2 = 0; i2 < keys.length; i2++) {
          const key2 = keys[i2];
          const desc = descriptors[key2];
          if (desc.writable === false) {
            desc.writable = true;
            desc.configurable = true;
          }
          if (desc.get || desc.set)
            descriptors[key2] = {
              configurable: true,
              writable: true,
              // could live with !!desc.set as well here...
              enumerable: desc.enumerable,
              value: base2[key2]
            };
        }
        return Object.create(getPrototypeOf(base2), descriptors);
      } else {
        const proto = getPrototypeOf(base2);
        if (proto !== null && isPlain) {
          return { ...base2 };
        }
        const obj = Object.create(proto);
        return Object.assign(obj, base2);
      }
    }
    function freeze(obj, deep = false) {
      if (isFrozen(obj) || isDraft(obj) || !isDraftable(obj))
        return obj;
      if (getArchtype(obj) > 1) {
        Object.defineProperties(obj, {
          set: dontMutateMethodOverride,
          add: dontMutateMethodOverride,
          clear: dontMutateMethodOverride,
          delete: dontMutateMethodOverride
        });
      }
      Object.freeze(obj);
      if (deep)
        Object.values(obj).forEach((value2) => freeze(value2, true));
      return obj;
    }
    function dontMutateFrozenCollections() {
      die$1(2);
    }
    var dontMutateMethodOverride = {
      value: dontMutateFrozenCollections
    };
    function isFrozen(obj) {
      if (obj === null || typeof obj !== "object")
        return true;
      return Object.isFrozen(obj);
    }
    var plugins = {};
    function getPlugin(pluginKey) {
      const plugin = plugins[pluginKey];
      if (!plugin) {
        die$1(0, pluginKey);
      }
      return plugin;
    }
    function loadPlugin(pluginKey, implementation) {
      if (!plugins[pluginKey])
        plugins[pluginKey] = implementation;
    }
    var currentScope;
    function getCurrentScope() {
      return currentScope;
    }
    function createScope(parent_, immer_) {
      return {
        drafts_: [],
        parent_,
        immer_,
        // Whenever the modified draft contains a draft from another scope, we
        // need to prevent auto-freezing so the unowned draft can be finalized.
        canAutoFreeze_: true,
        unfinalizedDrafts_: 0
      };
    }
    function usePatchesInScope(scope, patchListener) {
      if (patchListener) {
        getPlugin("Patches");
        scope.patches_ = [];
        scope.inversePatches_ = [];
        scope.patchListener_ = patchListener;
      }
    }
    function revokeScope(scope) {
      leaveScope(scope);
      scope.drafts_.forEach(revokeDraft);
      scope.drafts_ = null;
    }
    function leaveScope(scope) {
      if (scope === currentScope) {
        currentScope = scope.parent_;
      }
    }
    function enterScope(immer2) {
      return currentScope = createScope(currentScope, immer2);
    }
    function revokeDraft(draft) {
      const state = draft[DRAFT_STATE];
      if (state.type_ === 0 || state.type_ === 1)
        state.revoke_();
      else
        state.revoked_ = true;
    }
    function processResult(result2, scope) {
      scope.unfinalizedDrafts_ = scope.drafts_.length;
      const baseDraft = scope.drafts_[0];
      const isReplaced = result2 !== void 0 && result2 !== baseDraft;
      if (isReplaced) {
        if (baseDraft[DRAFT_STATE].modified_) {
          revokeScope(scope);
          die$1(4);
        }
        if (isDraftable(result2)) {
          result2 = finalize(scope, result2);
          if (!scope.parent_)
            maybeFreeze(scope, result2);
        }
        if (scope.patches_) {
          getPlugin("Patches").generateReplacementPatches_(
            baseDraft[DRAFT_STATE].base_,
            result2,
            scope.patches_,
            scope.inversePatches_
          );
        }
      } else {
        result2 = finalize(scope, baseDraft, []);
      }
      revokeScope(scope);
      if (scope.patches_) {
        scope.patchListener_(scope.patches_, scope.inversePatches_);
      }
      return result2 !== NOTHING ? result2 : void 0;
    }
    function finalize(rootScope, value2, path) {
      if (isFrozen(value2))
        return value2;
      const useStrictIteration = rootScope.immer_.shouldUseStrictIteration();
      const state = value2[DRAFT_STATE];
      if (!state) {
        each(
          value2,
          (key2, childValue) => finalizeProperty(rootScope, state, value2, key2, childValue, path),
          useStrictIteration
        );
        return value2;
      }
      if (state.scope_ !== rootScope)
        return value2;
      if (!state.modified_) {
        maybeFreeze(rootScope, state.base_, true);
        return state.base_;
      }
      if (!state.finalized_) {
        state.finalized_ = true;
        state.scope_.unfinalizedDrafts_--;
        const result2 = state.copy_;
        let resultEach = result2;
        let isSet2 = false;
        if (state.type_ === 3) {
          resultEach = new Set(result2);
          result2.clear();
          isSet2 = true;
        }
        each(
          resultEach,
          (key2, childValue) => finalizeProperty(
            rootScope,
            state,
            result2,
            key2,
            childValue,
            path,
            isSet2
          ),
          useStrictIteration
        );
        maybeFreeze(rootScope, result2, false);
        if (path && rootScope.patches_) {
          getPlugin("Patches").generatePatches_(
            state,
            path,
            rootScope.patches_,
            rootScope.inversePatches_
          );
        }
      }
      return state.copy_;
    }
    function finalizeProperty(rootScope, parentState, targetObject, prop2, childValue, rootPath, targetIsSet) {
      if (childValue == null) {
        return;
      }
      if (typeof childValue !== "object" && !targetIsSet) {
        return;
      }
      const childIsFrozen = isFrozen(childValue);
      if (childIsFrozen && !targetIsSet) {
        return;
      }
      if (isDraft(childValue)) {
        const path = rootPath && parentState && parentState.type_ !== 3 && // Set objects are atomic since they have no keys.
        !has$1(parentState.assigned_, prop2) ? rootPath.concat(prop2) : void 0;
        const res = finalize(rootScope, childValue, path);
        set(targetObject, prop2, res);
        if (isDraft(res)) {
          rootScope.canAutoFreeze_ = false;
        } else
          return;
      } else if (targetIsSet) {
        targetObject.add(childValue);
      }
      if (isDraftable(childValue) && !childIsFrozen) {
        if (!rootScope.immer_.autoFreeze_ && rootScope.unfinalizedDrafts_ < 1) {
          return;
        }
        if (parentState && parentState.base_ && parentState.base_[prop2] === childValue && childIsFrozen) {
          return;
        }
        finalize(rootScope, childValue);
        if ((!parentState || !parentState.scope_.parent_) && typeof prop2 !== "symbol" && (isMap(targetObject) ? targetObject.has(prop2) : Object.prototype.propertyIsEnumerable.call(targetObject, prop2)))
          maybeFreeze(rootScope, childValue);
      }
    }
    function maybeFreeze(scope, value2, deep = false) {
      if (!scope.parent_ && scope.immer_.autoFreeze_ && scope.canAutoFreeze_) {
        freeze(value2, deep);
      }
    }
    function createProxyProxy(base2, parent) {
      const isArray = Array.isArray(base2);
      const state = {
        type_: isArray ? 1 : 0,
        // Track which produce call this is associated with.
        scope_: parent ? parent.scope_ : getCurrentScope(),
        // True for both shallow and deep changes.
        modified_: false,
        // Used during finalization.
        finalized_: false,
        // Track which properties have been assigned (true) or deleted (false).
        assigned_: {},
        // The parent draft state.
        parent_: parent,
        // The base state.
        base_: base2,
        // The base proxy.
        draft_: null,
        // set below
        // The base copy with any updated values.
        copy_: null,
        // Called by the `produce` function.
        revoke_: null,
        isManual_: false
      };
      let target2 = state;
      let traps = objectTraps;
      if (isArray) {
        target2 = [state];
        traps = arrayTraps;
      }
      const { revoke, proxy } = Proxy.revocable(target2, traps);
      state.draft_ = proxy;
      state.revoke_ = revoke;
      return proxy;
    }
    var objectTraps = {
      get(state, prop2) {
        if (prop2 === DRAFT_STATE)
          return state;
        const source2 = latest(state);
        if (!has$1(source2, prop2)) {
          return readPropFromProto(state, source2, prop2);
        }
        const value2 = source2[prop2];
        if (state.finalized_ || !isDraftable(value2)) {
          return value2;
        }
        if (value2 === peek(state.base_, prop2)) {
          prepareCopy(state);
          return state.copy_[prop2] = createProxy(value2, state);
        }
        return value2;
      },
      has(state, prop2) {
        return prop2 in latest(state);
      },
      ownKeys(state) {
        return Reflect.ownKeys(latest(state));
      },
      set(state, prop2, value2) {
        const desc = getDescriptorFromProto(latest(state), prop2);
        if (desc?.set) {
          desc.set.call(state.draft_, value2);
          return true;
        }
        if (!state.modified_) {
          const current2 = peek(latest(state), prop2);
          const currentState = current2?.[DRAFT_STATE];
          if (currentState && currentState.base_ === value2) {
            state.copy_[prop2] = value2;
            state.assigned_[prop2] = false;
            return true;
          }
          if (is(value2, current2) && (value2 !== void 0 || has$1(state.base_, prop2)))
            return true;
          prepareCopy(state);
          markChanged(state);
        }
        if (state.copy_[prop2] === value2 && // special case: handle new props with value 'undefined'
        (value2 !== void 0 || prop2 in state.copy_) || // special case: NaN
        Number.isNaN(value2) && Number.isNaN(state.copy_[prop2]))
          return true;
        state.copy_[prop2] = value2;
        state.assigned_[prop2] = true;
        return true;
      },
      deleteProperty(state, prop2) {
        if (peek(state.base_, prop2) !== void 0 || prop2 in state.base_) {
          state.assigned_[prop2] = false;
          prepareCopy(state);
          markChanged(state);
        } else {
          delete state.assigned_[prop2];
        }
        if (state.copy_) {
          delete state.copy_[prop2];
        }
        return true;
      },
      // Note: We never coerce `desc.value` into an Immer draft, because we can't make
      // the same guarantee in ES5 mode.
      getOwnPropertyDescriptor(state, prop2) {
        const owner = latest(state);
        const desc = Reflect.getOwnPropertyDescriptor(owner, prop2);
        if (!desc)
          return desc;
        return {
          writable: true,
          configurable: state.type_ !== 1 || prop2 !== "length",
          enumerable: desc.enumerable,
          value: owner[prop2]
        };
      },
      defineProperty() {
        die$1(11);
      },
      getPrototypeOf(state) {
        return getPrototypeOf(state.base_);
      },
      setPrototypeOf() {
        die$1(12);
      }
    };
    var arrayTraps = {};
    each(objectTraps, (key2, fn2) => {
      arrayTraps[key2] = function() {
        arguments[0] = arguments[0][0];
        return fn2.apply(this, arguments);
      };
    });
    arrayTraps.deleteProperty = function(state, prop2) {
      return arrayTraps.set.call(this, state, prop2, void 0);
    };
    arrayTraps.set = function(state, prop2, value2) {
      return objectTraps.set.call(this, state[0], prop2, value2, state[0]);
    };
    function peek(draft, prop2) {
      const state = draft[DRAFT_STATE];
      const source2 = state ? latest(state) : draft;
      return source2[prop2];
    }
    function readPropFromProto(state, source2, prop2) {
      const desc = getDescriptorFromProto(source2, prop2);
      return desc ? `value` in desc ? desc.value : (
        // This is a very special case, if the prop is a getter defined by the
        // prototype, we should invoke it with the draft as context!
        desc.get?.call(state.draft_)
      ) : void 0;
    }
    function getDescriptorFromProto(source2, prop2) {
      if (!(prop2 in source2))
        return void 0;
      let proto = getPrototypeOf(source2);
      while (proto) {
        const desc = Object.getOwnPropertyDescriptor(proto, prop2);
        if (desc)
          return desc;
        proto = getPrototypeOf(proto);
      }
      return void 0;
    }
    function markChanged(state) {
      if (!state.modified_) {
        state.modified_ = true;
        if (state.parent_) {
          markChanged(state.parent_);
        }
      }
    }
    function prepareCopy(state) {
      if (!state.copy_) {
        state.copy_ = shallowCopy(
          state.base_,
          state.scope_.immer_.useStrictShallowCopy_
        );
      }
    }
    var Immer2 = class {
      constructor(config2) {
        this.autoFreeze_ = true;
        this.useStrictShallowCopy_ = false;
        this.useStrictIteration_ = true;
        this.produce = (base2, recipe, patchListener) => {
          if (typeof base2 === "function" && typeof recipe !== "function") {
            const defaultBase = recipe;
            recipe = base2;
            const self2 = this;
            return function curriedProduce(base22 = defaultBase, ...args2) {
              return self2.produce(base22, (draft) => recipe.call(this, draft, ...args2));
            };
          }
          if (typeof recipe !== "function")
            die$1(6);
          if (patchListener !== void 0 && typeof patchListener !== "function")
            die$1(7);
          let result2;
          if (isDraftable(base2)) {
            const scope = enterScope(this);
            const proxy = createProxy(base2, void 0);
            let hasError = true;
            try {
              result2 = recipe(proxy);
              hasError = false;
            } finally {
              if (hasError)
                revokeScope(scope);
              else
                leaveScope(scope);
            }
            usePatchesInScope(scope, patchListener);
            return processResult(result2, scope);
          } else if (!base2 || typeof base2 !== "object") {
            result2 = recipe(base2);
            if (result2 === void 0)
              result2 = base2;
            if (result2 === NOTHING)
              result2 = void 0;
            if (this.autoFreeze_)
              freeze(result2, true);
            if (patchListener) {
              const p = [];
              const ip = [];
              getPlugin("Patches").generateReplacementPatches_(base2, result2, p, ip);
              patchListener(p, ip);
            }
            return result2;
          } else
            die$1(1, base2);
        };
        this.produceWithPatches = (base2, recipe) => {
          if (typeof base2 === "function") {
            return (state, ...args2) => this.produceWithPatches(state, (draft) => base2(draft, ...args2));
          }
          let patches, inversePatches;
          const result2 = this.produce(base2, recipe, (p, ip) => {
            patches = p;
            inversePatches = ip;
          });
          return [result2, patches, inversePatches];
        };
        if (typeof config2?.autoFreeze === "boolean")
          this.setAutoFreeze(config2.autoFreeze);
        if (typeof config2?.useStrictShallowCopy === "boolean")
          this.setUseStrictShallowCopy(config2.useStrictShallowCopy);
        if (typeof config2?.useStrictIteration === "boolean")
          this.setUseStrictIteration(config2.useStrictIteration);
      }
      createDraft(base2) {
        if (!isDraftable(base2))
          die$1(8);
        if (isDraft(base2))
          base2 = current(base2);
        const scope = enterScope(this);
        const proxy = createProxy(base2, void 0);
        proxy[DRAFT_STATE].isManual_ = true;
        leaveScope(scope);
        return proxy;
      }
      finishDraft(draft, patchListener) {
        const state = draft && draft[DRAFT_STATE];
        if (!state || !state.isManual_)
          die$1(9);
        const { scope_: scope } = state;
        usePatchesInScope(scope, patchListener);
        return processResult(void 0, scope);
      }
      /**
       * Pass true to automatically freeze all copies created by Immer.
       *
       * By default, auto-freezing is enabled.
       */
      setAutoFreeze(value2) {
        this.autoFreeze_ = value2;
      }
      /**
       * Pass true to enable strict shallow copy.
       *
       * By default, immer does not copy the object descriptors such as getter, setter and non-enumrable properties.
       */
      setUseStrictShallowCopy(value2) {
        this.useStrictShallowCopy_ = value2;
      }
      /**
       * Pass false to use faster iteration that skips non-enumerable properties
       * but still handles symbols for compatibility.
       *
       * By default, strict iteration is enabled (includes all own properties).
       */
      setUseStrictIteration(value2) {
        this.useStrictIteration_ = value2;
      }
      shouldUseStrictIteration() {
        return this.useStrictIteration_;
      }
      applyPatches(base2, patches) {
        let i2;
        for (i2 = patches.length - 1; i2 >= 0; i2--) {
          const patch = patches[i2];
          if (patch.path.length === 0 && patch.op === "replace") {
            base2 = patch.value;
            break;
          }
        }
        if (i2 > -1) {
          patches = patches.slice(i2 + 1);
        }
        const applyPatchesImpl = getPlugin("Patches").applyPatches_;
        if (isDraft(base2)) {
          return applyPatchesImpl(base2, patches);
        }
        return this.produce(
          base2,
          (draft) => applyPatchesImpl(draft, patches)
        );
      }
    };
    function createProxy(value2, parent) {
      const draft = isMap(value2) ? getPlugin("MapSet").proxyMap_(value2, parent) : isSet(value2) ? getPlugin("MapSet").proxySet_(value2, parent) : createProxyProxy(value2, parent);
      const scope = parent ? parent.scope_ : getCurrentScope();
      scope.drafts_.push(draft);
      return draft;
    }
    function current(value2) {
      if (!isDraft(value2))
        die$1(10, value2);
      return currentImpl(value2);
    }
    function currentImpl(value2) {
      if (!isDraftable(value2) || isFrozen(value2))
        return value2;
      const state = value2[DRAFT_STATE];
      let copy2;
      let strict = true;
      if (state) {
        if (!state.modified_)
          return state.base_;
        state.finalized_ = true;
        copy2 = shallowCopy(value2, state.scope_.immer_.useStrictShallowCopy_);
        strict = state.scope_.immer_.shouldUseStrictIteration();
      } else {
        copy2 = shallowCopy(value2, true);
      }
      each(
        copy2,
        (key2, childValue) => {
          set(copy2, key2, currentImpl(childValue));
        },
        strict
      );
      if (state) {
        state.finalized_ = false;
      }
      return copy2;
    }
    function enableMapSet() {
      class DraftMap extends Map {
        constructor(target2, parent) {
          super();
          this[DRAFT_STATE] = {
            type_: 2,
            parent_: parent,
            scope_: parent ? parent.scope_ : getCurrentScope(),
            modified_: false,
            finalized_: false,
            copy_: void 0,
            assigned_: void 0,
            base_: target2,
            draft_: this,
            isManual_: false,
            revoked_: false
          };
        }
        get size() {
          return latest(this[DRAFT_STATE]).size;
        }
        has(key2) {
          return latest(this[DRAFT_STATE]).has(key2);
        }
        set(key2, value2) {
          const state = this[DRAFT_STATE];
          assertUnrevoked(state);
          if (!latest(state).has(key2) || latest(state).get(key2) !== value2) {
            prepareMapCopy(state);
            markChanged(state);
            state.assigned_.set(key2, true);
            state.copy_.set(key2, value2);
            state.assigned_.set(key2, true);
          }
          return this;
        }
        delete(key2) {
          if (!this.has(key2)) {
            return false;
          }
          const state = this[DRAFT_STATE];
          assertUnrevoked(state);
          prepareMapCopy(state);
          markChanged(state);
          if (state.base_.has(key2)) {
            state.assigned_.set(key2, false);
          } else {
            state.assigned_.delete(key2);
          }
          state.copy_.delete(key2);
          return true;
        }
        clear() {
          const state = this[DRAFT_STATE];
          assertUnrevoked(state);
          if (latest(state).size) {
            prepareMapCopy(state);
            markChanged(state);
            state.assigned_ = /* @__PURE__ */ new Map();
            each(state.base_, (key2) => {
              state.assigned_.set(key2, false);
            });
            state.copy_.clear();
          }
        }
        forEach(cb, thisArg) {
          const state = this[DRAFT_STATE];
          latest(state).forEach((_value, key2, _map2) => {
            cb.call(thisArg, this.get(key2), key2, this);
          });
        }
        get(key2) {
          const state = this[DRAFT_STATE];
          assertUnrevoked(state);
          const value2 = latest(state).get(key2);
          if (state.finalized_ || !isDraftable(value2)) {
            return value2;
          }
          if (value2 !== state.base_.get(key2)) {
            return value2;
          }
          const draft = createProxy(value2, state);
          prepareMapCopy(state);
          state.copy_.set(key2, draft);
          return draft;
        }
        keys() {
          return latest(this[DRAFT_STATE]).keys();
        }
        values() {
          const iterator = this.keys();
          return {
            [Symbol.iterator]: () => this.values(),
            next: () => {
              const r2 = iterator.next();
              if (r2.done)
                return r2;
              const value2 = this.get(r2.value);
              return {
                done: false,
                value: value2
              };
            }
          };
        }
        entries() {
          const iterator = this.keys();
          return {
            [Symbol.iterator]: () => this.entries(),
            next: () => {
              const r2 = iterator.next();
              if (r2.done)
                return r2;
              const value2 = this.get(r2.value);
              return {
                done: false,
                value: [r2.value, value2]
              };
            }
          };
        }
        [Symbol.iterator]() {
          return this.entries();
        }
      }
      function proxyMap_(target2, parent) {
        return new DraftMap(target2, parent);
      }
      function prepareMapCopy(state) {
        if (!state.copy_) {
          state.assigned_ = /* @__PURE__ */ new Map();
          state.copy_ = new Map(state.base_);
        }
      }
      class DraftSet extends Set {
        constructor(target2, parent) {
          super();
          this[DRAFT_STATE] = {
            type_: 3,
            parent_: parent,
            scope_: parent ? parent.scope_ : getCurrentScope(),
            modified_: false,
            finalized_: false,
            copy_: void 0,
            base_: target2,
            draft_: this,
            drafts_: /* @__PURE__ */ new Map(),
            revoked_: false,
            isManual_: false
          };
        }
        get size() {
          return latest(this[DRAFT_STATE]).size;
        }
        has(value2) {
          const state = this[DRAFT_STATE];
          assertUnrevoked(state);
          if (!state.copy_) {
            return state.base_.has(value2);
          }
          if (state.copy_.has(value2))
            return true;
          if (state.drafts_.has(value2) && state.copy_.has(state.drafts_.get(value2)))
            return true;
          return false;
        }
        add(value2) {
          const state = this[DRAFT_STATE];
          assertUnrevoked(state);
          if (!this.has(value2)) {
            prepareSetCopy(state);
            markChanged(state);
            state.copy_.add(value2);
          }
          return this;
        }
        delete(value2) {
          if (!this.has(value2)) {
            return false;
          }
          const state = this[DRAFT_STATE];
          assertUnrevoked(state);
          prepareSetCopy(state);
          markChanged(state);
          return state.copy_.delete(value2) || (state.drafts_.has(value2) ? state.copy_.delete(state.drafts_.get(value2)) : (
            /* istanbul ignore next */
            false
          ));
        }
        clear() {
          const state = this[DRAFT_STATE];
          assertUnrevoked(state);
          if (latest(state).size) {
            prepareSetCopy(state);
            markChanged(state);
            state.copy_.clear();
          }
        }
        values() {
          const state = this[DRAFT_STATE];
          assertUnrevoked(state);
          prepareSetCopy(state);
          return state.copy_.values();
        }
        entries() {
          const state = this[DRAFT_STATE];
          assertUnrevoked(state);
          prepareSetCopy(state);
          return state.copy_.entries();
        }
        keys() {
          return this.values();
        }
        [Symbol.iterator]() {
          return this.values();
        }
        forEach(cb, thisArg) {
          const iterator = this.values();
          let result2 = iterator.next();
          while (!result2.done) {
            cb.call(thisArg, result2.value, result2.value, this);
            result2 = iterator.next();
          }
        }
      }
      function proxySet_(target2, parent) {
        return new DraftSet(target2, parent);
      }
      function prepareSetCopy(state) {
        if (!state.copy_) {
          state.copy_ = /* @__PURE__ */ new Set();
          state.base_.forEach((value2) => {
            if (isDraftable(value2)) {
              const draft = createProxy(value2, state);
              state.drafts_.set(value2, draft);
              state.copy_.add(draft);
            } else {
              state.copy_.add(value2);
            }
          });
        }
      }
      function assertUnrevoked(state) {
        if (state.revoked_)
          die$1(3, JSON.stringify(latest(state)));
      }
      loadPlugin("MapSet", { proxyMap_, proxySet_ });
    }
    var immer$1 = new Immer2();
    var produce = immer$1.produce;
    const createStoreImpl = (createState) => {
      let state;
      const listeners = /* @__PURE__ */ new Set();
      const setState2 = (partial, replace2) => {
        const nextState = typeof partial === "function" ? partial(state) : partial;
        if (!Object.is(nextState, state)) {
          const previousState = state;
          state = (replace2 != null ? replace2 : typeof nextState !== "object" || nextState === null) ? nextState : Object.assign({}, state, nextState);
          listeners.forEach((listener) => listener(state, previousState));
        }
      };
      const getState2 = () => state;
      const getInitialState = () => initialState2;
      const subscribe = (listener) => {
        listeners.add(listener);
        return () => listeners.delete(listener);
      };
      const api2 = { setState: setState2, getState: getState2, getInitialState, subscribe };
      const initialState2 = state = createState(setState2, getState2, api2);
      return api2;
    };
    const createStore$1 = ((createState) => createState ? createStoreImpl(createState) : createStoreImpl);
    const identity = (arg) => arg;
    function useStore$1(api2, selector2 = identity) {
      const slice = React20.useSyncExternalStore(
        api2.subscribe,
        React20.useCallback(() => selector2(api2.getState()), [api2, selector2]),
        React20.useCallback(() => selector2(api2.getInitialState()), [api2, selector2])
      );
      React20.useDebugValue(slice);
      return slice;
    }
    const createImpl = (createState) => {
      const api2 = createStore$1(createState);
      const useBoundStore = (selector2) => useStore$1(api2, selector2);
      Object.assign(useBoundStore, api2);
      return useBoundStore;
    };
    const create$2 = ((createState) => createImpl);
    const __vite_import_meta_env__ = { "BASE_URL": "./", "DEV": false, "MODE": "development", "PROD": true, "SSR": false };
    const trackedConnections = /* @__PURE__ */ new Map();
    const getTrackedConnectionState = (name2) => {
      const api2 = trackedConnections.get(name2);
      if (!api2) return {};
      return Object.fromEntries(
        Object.entries(api2.stores).map(([key2, api22]) => [key2, api22.getState()])
      );
    };
    const extractConnectionInformation = (store, extensionConnector, options2) => {
      if (store === void 0) {
        return {
          type: "untracked",
          connection: extensionConnector.connect(options2)
        };
      }
      const existingConnection = trackedConnections.get(options2.name);
      if (existingConnection) {
        return { type: "tracked", store, ...existingConnection };
      }
      const newConnection = {
        connection: extensionConnector.connect(options2),
        stores: {}
      };
      trackedConnections.set(options2.name, newConnection);
      return { type: "tracked", store, ...newConnection };
    };
    const removeStoreFromTrackedConnections = (name2, store) => {
      if (store === void 0) return;
      const connectionInfo = trackedConnections.get(name2);
      if (!connectionInfo) return;
      delete connectionInfo.stores[store];
      if (Object.keys(connectionInfo.stores).length === 0) {
        trackedConnections.delete(name2);
      }
    };
    const findCallerName = (stack2) => {
      var _a2, _b2;
      if (!stack2) return void 0;
      const traceLines = stack2.split("\n");
      const apiSetStateLineIndex = traceLines.findIndex(
        (traceLine) => traceLine.includes("api.setState")
      );
      if (apiSetStateLineIndex < 0) return void 0;
      const callerLine = ((_a2 = traceLines[apiSetStateLineIndex + 1]) == null ? void 0 : _a2.trim()) || "";
      return (_b2 = /.+ (.+) .+/.exec(callerLine)) == null ? void 0 : _b2[1];
    };
    const devtoolsImpl = (fn2, devtoolsOptions = {}) => (set2, get2, api2) => {
      const { enabled, anonymousActionType, store, ...options2 } = devtoolsOptions;
      let extensionConnector;
      try {
        extensionConnector = (enabled != null ? enabled : (__vite_import_meta_env__ ? "development" : void 0) !== "production") && window.__REDUX_DEVTOOLS_EXTENSION__;
      } catch (e) {
      }
      if (!extensionConnector) {
        return fn2(set2, get2, api2);
      }
      const { connection, ...connectionInformation } = extractConnectionInformation(store, extensionConnector, options2);
      let isRecording = true;
      api2.setState = ((state, replace2, nameOrAction) => {
        const r2 = set2(state, replace2);
        if (!isRecording) return r2;
        const action = nameOrAction === void 0 ? {
          type: anonymousActionType || findCallerName(new Error().stack) || "anonymous"
        } : typeof nameOrAction === "string" ? { type: nameOrAction } : nameOrAction;
        if (store === void 0) {
          connection == null ? void 0 : connection.send(action, get2());
          return r2;
        }
        connection == null ? void 0 : connection.send(
          {
            ...action,
            type: `${store}/${action.type}`
          },
          {
            ...getTrackedConnectionState(options2.name),
            [store]: api2.getState()
          }
        );
        return r2;
      });
      api2.devtools = {
        cleanup: () => {
          if (connection && typeof connection.unsubscribe === "function") {
            connection.unsubscribe();
          }
          removeStoreFromTrackedConnections(options2.name, store);
        }
      };
      const setStateFromDevtools = (...a) => {
        const originalIsRecording = isRecording;
        isRecording = false;
        set2(...a);
        isRecording = originalIsRecording;
      };
      const initialState2 = fn2(api2.setState, get2, api2);
      if (connectionInformation.type === "untracked") {
        connection == null ? void 0 : connection.init(initialState2);
      } else {
        connectionInformation.stores[connectionInformation.store] = api2;
        connection == null ? void 0 : connection.init(
          Object.fromEntries(
            Object.entries(connectionInformation.stores).map(([key2, store2]) => [
              key2,
              key2 === connectionInformation.store ? initialState2 : store2.getState()
            ])
          )
        );
      }
      if (api2.dispatchFromDevtools && typeof api2.dispatch === "function") {
        let didWarnAboutReservedActionType = false;
        const originalDispatch = api2.dispatch;
        api2.dispatch = (...args2) => {
          if ((__vite_import_meta_env__ ? "development" : void 0) !== "production" && args2[0].type === "__setState" && !didWarnAboutReservedActionType) {
            console.warn(
              '[zustand devtools middleware] "__setState" action type is reserved to set state from the devtools. Avoid using it.'
            );
            didWarnAboutReservedActionType = true;
          }
          originalDispatch(...args2);
        };
      }
      connection.subscribe((message2) => {
        var _a2;
        switch (message2.type) {
          case "ACTION":
            if (typeof message2.payload !== "string") {
              console.error(
                "[zustand devtools middleware] Unsupported action format"
              );
              return;
            }
            return parseJsonThen(
              message2.payload,
              (action) => {
                if (action.type === "__setState") {
                  if (store === void 0) {
                    setStateFromDevtools(action.state);
                    return;
                  }
                  if (Object.keys(action.state).length !== 1) {
                    console.error(
                      `
                    [zustand devtools middleware] Unsupported __setState action format.
                    When using 'store' option in devtools(), the 'state' should have only one key, which is a value of 'store' that was passed in devtools(),
                    and value of this only key should be a state object. Example: { "type": "__setState", "state": { "abc123Store": { "foo": "bar" } } }
                    `
                    );
                  }
                  const stateFromDevtools = action.state[store];
                  if (stateFromDevtools === void 0 || stateFromDevtools === null) {
                    return;
                  }
                  if (JSON.stringify(api2.getState()) !== JSON.stringify(stateFromDevtools)) {
                    setStateFromDevtools(stateFromDevtools);
                  }
                  return;
                }
                if (!api2.dispatchFromDevtools) return;
                if (typeof api2.dispatch !== "function") return;
                api2.dispatch(action);
              }
            );
          case "DISPATCH":
            switch (message2.payload.type) {
              case "RESET":
                setStateFromDevtools(initialState2);
                if (store === void 0) {
                  return connection == null ? void 0 : connection.init(api2.getState());
                }
                return connection == null ? void 0 : connection.init(getTrackedConnectionState(options2.name));
              case "COMMIT":
                if (store === void 0) {
                  connection == null ? void 0 : connection.init(api2.getState());
                  return;
                }
                return connection == null ? void 0 : connection.init(getTrackedConnectionState(options2.name));
              case "ROLLBACK":
                return parseJsonThen(message2.state, (state) => {
                  if (store === void 0) {
                    setStateFromDevtools(state);
                    connection == null ? void 0 : connection.init(api2.getState());
                    return;
                  }
                  setStateFromDevtools(state[store]);
                  connection == null ? void 0 : connection.init(getTrackedConnectionState(options2.name));
                });
              case "JUMP_TO_STATE":
              case "JUMP_TO_ACTION":
                return parseJsonThen(message2.state, (state) => {
                  if (store === void 0) {
                    setStateFromDevtools(state);
                    return;
                  }
                  if (JSON.stringify(api2.getState()) !== JSON.stringify(state[store])) {
                    setStateFromDevtools(state[store]);
                  }
                });
              case "IMPORT_STATE": {
                const { nextLiftedState } = message2.payload;
                const lastComputedState = (_a2 = nextLiftedState.computedStates.slice(-1)[0]) == null ? void 0 : _a2.state;
                if (!lastComputedState) return;
                if (store === void 0) {
                  setStateFromDevtools(lastComputedState);
                } else {
                  setStateFromDevtools(lastComputedState[store]);
                }
                connection == null ? void 0 : connection.send(
                  null,
                  // FIXME no-any
                  nextLiftedState
                );
                return;
              }
              case "PAUSE_RECORDING":
                return isRecording = !isRecording;
            }
            return;
        }
      });
      return initialState2;
    };
    const devtools = devtoolsImpl;
    const parseJsonThen = (stringified, fn2) => {
      let parsed;
      try {
        parsed = JSON.parse(stringified);
      } catch (e) {
        console.error(
          "[zustand devtools middleware] Could not parse the received json",
          e
        );
      }
      if (parsed !== void 0) fn2(parsed);
    };
    function createJSONStorage(getStorage, options2) {
      let storage2;
      try {
        storage2 = getStorage();
      } catch (e) {
        return;
      }
      const persistStorage = {
        getItem: (name2) => {
          var _a2;
          const parse2 = (str22) => {
            if (str22 === null) {
              return null;
            }
            return JSON.parse(str22, void 0);
          };
          const str2 = (_a2 = storage2.getItem(name2)) != null ? _a2 : null;
          if (str2 instanceof Promise) {
            return str2.then(parse2);
          }
          return parse2(str2);
        },
        setItem: (name2, newValue) => storage2.setItem(name2, JSON.stringify(newValue, void 0)),
        removeItem: (name2) => storage2.removeItem(name2)
      };
      return persistStorage;
    }
    const toThenable = (fn2) => (input2) => {
      try {
        const result2 = fn2(input2);
        if (result2 instanceof Promise) {
          return result2;
        }
        return {
          then(onFulfilled) {
            return toThenable(onFulfilled)(result2);
          },
          catch(_onRejected) {
            return this;
          }
        };
      } catch (e) {
        return {
          then(_onFulfilled) {
            return this;
          },
          catch(onRejected) {
            return toThenable(onRejected)(e);
          }
        };
      }
    };
    const persistImpl = (config2, baseOptions) => (set2, get2, api2) => {
      let options2 = {
        storage: createJSONStorage(() => localStorage),
        partialize: (state) => state,
        version: 0,
        merge: (persistedState, currentState) => ({
          ...currentState,
          ...persistedState
        }),
        ...baseOptions
      };
      let hasHydrated = false;
      const hydrationListeners = /* @__PURE__ */ new Set();
      const finishHydrationListeners = /* @__PURE__ */ new Set();
      let storage2 = options2.storage;
      if (!storage2) {
        return config2(
          (...args2) => {
            console.warn(
              `[zustand persist middleware] Unable to update item '${options2.name}', the given storage is currently unavailable.`
            );
            set2(...args2);
          },
          get2,
          api2
        );
      }
      const setItem = () => {
        const state = options2.partialize({ ...get2() });
        return storage2.setItem(options2.name, {
          state,
          version: options2.version
        });
      };
      const savedSetState = api2.setState;
      api2.setState = (state, replace2) => {
        savedSetState(state, replace2);
        return setItem();
      };
      const configResult = config2(
        (...args2) => {
          set2(...args2);
          return setItem();
        },
        get2,
        api2
      );
      api2.getInitialState = () => configResult;
      let stateFromStorage;
      const hydrate = () => {
        var _a2, _b2;
        if (!storage2) return;
        hasHydrated = false;
        hydrationListeners.forEach((cb) => {
          var _a22;
          return cb((_a22 = get2()) != null ? _a22 : configResult);
        });
        const postRehydrationCallback = ((_b2 = options2.onRehydrateStorage) == null ? void 0 : _b2.call(options2, (_a2 = get2()) != null ? _a2 : configResult)) || void 0;
        return toThenable(storage2.getItem.bind(storage2))(options2.name).then((deserializedStorageValue) => {
          if (deserializedStorageValue) {
            if (typeof deserializedStorageValue.version === "number" && deserializedStorageValue.version !== options2.version) {
              if (options2.migrate) {
                const migration = options2.migrate(
                  deserializedStorageValue.state,
                  deserializedStorageValue.version
                );
                if (migration instanceof Promise) {
                  return migration.then((result2) => [true, result2]);
                }
                return [true, migration];
              }
              console.error(
                `State loaded from storage couldn't be migrated since no migrate function was provided`
              );
            } else {
              return [false, deserializedStorageValue.state];
            }
          }
          return [false, void 0];
        }).then((migrationResult) => {
          var _a22;
          const [migrated, migratedState] = migrationResult;
          stateFromStorage = options2.merge(
            migratedState,
            (_a22 = get2()) != null ? _a22 : configResult
          );
          set2(stateFromStorage, true);
          if (migrated) {
            return setItem();
          }
        }).then(() => {
          postRehydrationCallback == null ? void 0 : postRehydrationCallback(stateFromStorage, void 0);
          stateFromStorage = get2();
          hasHydrated = true;
          finishHydrationListeners.forEach((cb) => cb(stateFromStorage));
        }).catch((e) => {
          postRehydrationCallback == null ? void 0 : postRehydrationCallback(void 0, e);
        });
      };
      api2.persist = {
        setOptions: (newOptions) => {
          options2 = {
            ...options2,
            ...newOptions
          };
          if (newOptions.storage) {
            storage2 = newOptions.storage;
          }
        },
        clearStorage: () => {
          storage2 == null ? void 0 : storage2.removeItem(options2.name);
        },
        getOptions: () => options2,
        rehydrate: () => hydrate(),
        hasHydrated: () => hasHydrated,
        onHydrate: (cb) => {
          hydrationListeners.add(cb);
          return () => {
            hydrationListeners.delete(cb);
          };
        },
        onFinishHydration: (cb) => {
          finishHydrationListeners.add(cb);
          return () => {
            finishHydrationListeners.delete(cb);
          };
        }
      };
      if (!options2.skipHydration) {
        hydrate();
      }
      return stateFromStorage || configResult;
    };
    const persist = persistImpl;
    const immerImpl = (initializer) => (set2, get2, store) => {
      store.setState = (updater, replace2, ...args2) => {
        const nextState = typeof updater === "function" ? produce(updater) : updater;
        return set2(nextState, replace2, ...args2);
      };
      return initializer(store.setState, get2, store);
    };
    const immer = immerImpl;
    var dexie_min$1 = { exports: {} };
    var dexie_min = dexie_min$1.exports;
    var hasRequiredDexie_min;
    function requireDexie_min() {
      if (hasRequiredDexie_min) return dexie_min$1.exports;
      hasRequiredDexie_min = 1;
      (function(module2, exports2) {
        (function(e, t2) {
          module2.exports = t2();
        })(dexie_min, function() {
          var s = function(e2, t3) {
            return (s = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e3, t4) {
              e3.__proto__ = t4;
            } || function(e3, t4) {
              for (var n2 in t4) Object.prototype.hasOwnProperty.call(t4, n2) && (e3[n2] = t4[n2]);
            })(e2, t3);
          };
          var _ = function() {
            return (_ = Object.assign || function(e2) {
              for (var t3, n2 = 1, r3 = arguments.length; n2 < r3; n2++) for (var i3 in t3 = arguments[n2]) Object.prototype.hasOwnProperty.call(t3, i3) && (e2[i3] = t3[i3]);
              return e2;
            }).apply(this, arguments);
          };
          function i2(e2, t3, n2) {
            for (var r3, i3 = 0, o2 = t3.length; i3 < o2; i3++) !r3 && i3 in t3 || ((r3 = r3 || Array.prototype.slice.call(t3, 0, i3))[i3] = t3[i3]);
            return e2.concat(r3 || Array.prototype.slice.call(t3));
          }
          var f = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : "undefined" != typeof window ? window : commonjsGlobal, O = Object.keys, x2 = Array.isArray;
          function a(t3, n2) {
            return "object" != typeof n2 || O(n2).forEach(function(e2) {
              t3[e2] = n2[e2];
            }), t3;
          }
          "undefined" == typeof Promise || f.Promise || (f.Promise = Promise);
          var c2 = Object.getPrototypeOf, n = {}.hasOwnProperty;
          function m(e2, t3) {
            return n.call(e2, t3);
          }
          function r2(t3, n2) {
            "function" == typeof n2 && (n2 = n2(c2(t3))), ("undefined" == typeof Reflect ? O : Reflect.ownKeys)(n2).forEach(function(e2) {
              l(t3, e2, n2[e2]);
            });
          }
          var u = Object.defineProperty;
          function l(e2, t3, n2, r3) {
            u(e2, t3, a(n2 && m(n2, "get") && "function" == typeof n2.get ? { get: n2.get, set: n2.set, configurable: true } : { value: n2, configurable: true, writable: true }, r3));
          }
          function o(t3) {
            return { from: function(e2) {
              return t3.prototype = Object.create(e2.prototype), l(t3.prototype, "constructor", t3), { extend: r2.bind(null, t3.prototype) };
            } };
          }
          var h = Object.getOwnPropertyDescriptor;
          var d = [].slice;
          function b(e2, t3, n2) {
            return d.call(e2, t3, n2);
          }
          function p(e2, t3) {
            return t3(e2);
          }
          function y(e2) {
            if (!e2) throw new Error("Assertion Failed");
          }
          function v(e2) {
            f.setImmediate ? setImmediate(e2) : setTimeout(e2, 0);
          }
          function g(e2, t3) {
            if ("string" == typeof t3 && m(e2, t3)) return e2[t3];
            if (!t3) return e2;
            if ("string" != typeof t3) {
              for (var n2 = [], r3 = 0, i3 = t3.length; r3 < i3; ++r3) {
                var o2 = g(e2, t3[r3]);
                n2.push(o2);
              }
              return n2;
            }
            var a2 = t3.indexOf(".");
            if (-1 !== a2) {
              var u2 = e2[t3.substr(0, a2)];
              return null == u2 ? void 0 : g(u2, t3.substr(a2 + 1));
            }
          }
          function w(e2, t3, n2) {
            if (e2 && void 0 !== t3 && !("isFrozen" in Object && Object.isFrozen(e2))) if ("string" != typeof t3 && "length" in t3) {
              y("string" != typeof n2 && "length" in n2);
              for (var r3 = 0, i3 = t3.length; r3 < i3; ++r3) w(e2, t3[r3], n2[r3]);
            } else {
              var o2, a2, u2 = t3.indexOf(".");
              -1 !== u2 ? (o2 = t3.substr(0, u2), "" === (a2 = t3.substr(u2 + 1)) ? void 0 === n2 ? x2(e2) && !isNaN(parseInt(o2)) ? e2.splice(o2, 1) : delete e2[o2] : e2[o2] = n2 : w(u2 = !(u2 = e2[o2]) || !m(e2, o2) ? e2[o2] = {} : u2, a2, n2)) : void 0 === n2 ? x2(e2) && !isNaN(parseInt(t3)) ? e2.splice(t3, 1) : delete e2[t3] : e2[t3] = n2;
            }
          }
          function k2(e2) {
            var t3, n2 = {};
            for (t3 in e2) m(e2, t3) && (n2[t3] = e2[t3]);
            return n2;
          }
          var t2 = [].concat;
          function P2(e2) {
            return t2.apply([], e2);
          }
          var e = "BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(P2([8, 16, 32, 64].map(function(t3) {
            return ["Int", "Uint", "Float"].map(function(e2) {
              return e2 + t3 + "Array";
            });
          }))).filter(function(e2) {
            return f[e2];
          }), K2 = new Set(e.map(function(e2) {
            return f[e2];
          }));
          var E = null;
          function S(e2) {
            E = /* @__PURE__ */ new WeakMap();
            e2 = (function e3(t3) {
              if (!t3 || "object" != typeof t3) return t3;
              var n2 = E.get(t3);
              if (n2) return n2;
              if (x2(t3)) {
                n2 = [], E.set(t3, n2);
                for (var r3 = 0, i3 = t3.length; r3 < i3; ++r3) n2.push(e3(t3[r3]));
              } else if (K2.has(t3.constructor)) n2 = t3;
              else {
                var o2, a2 = c2(t3);
                for (o2 in n2 = a2 === Object.prototype ? {} : Object.create(a2), E.set(t3, n2), t3) m(t3, o2) && (n2[o2] = e3(t3[o2]));
              }
              return n2;
            })(e2);
            return E = null, e2;
          }
          var j = {}.toString;
          function A2(e2) {
            return j.call(e2).slice(8, -1);
          }
          var C2 = "undefined" != typeof Symbol ? Symbol.iterator : "@@iterator", T = "symbol" == typeof C2 ? function(e2) {
            var t3;
            return null != e2 && (t3 = e2[C2]) && t3.apply(e2);
          } : function() {
            return null;
          };
          function I(e2, t3) {
            t3 = e2.indexOf(t3);
            return 0 <= t3 && e2.splice(t3, 1), 0 <= t3;
          }
          var q = {};
          function D2(e2) {
            var t3, n2, r3, i3;
            if (1 === arguments.length) {
              if (x2(e2)) return e2.slice();
              if (this === q && "string" == typeof e2) return [e2];
              if (i3 = T(e2)) {
                for (n2 = []; !(r3 = i3.next()).done; ) n2.push(r3.value);
                return n2;
              }
              if (null == e2) return [e2];
              if ("number" != typeof (t3 = e2.length)) return [e2];
              for (n2 = new Array(t3); t3--; ) n2[t3] = e2[t3];
              return n2;
            }
            for (t3 = arguments.length, n2 = new Array(t3); t3--; ) n2[t3] = arguments[t3];
            return n2;
          }
          var B = "undefined" != typeof Symbol ? function(e2) {
            return "AsyncFunction" === e2[Symbol.toStringTag];
          } : function() {
            return false;
          }, R = ["Unknown", "Constraint", "Data", "TransactionInactive", "ReadOnly", "Version", "NotFound", "InvalidState", "InvalidAccess", "Abort", "Timeout", "QuotaExceeded", "Syntax", "DataClone"], F2 = ["Modify", "Bulk", "OpenFailed", "VersionChange", "Schema", "Upgrade", "InvalidTable", "MissingAPI", "NoSuchDatabase", "InvalidArgument", "SubTransaction", "Unsupported", "Internal", "DatabaseClosed", "PrematureCommit", "ForeignAwait"].concat(R), M = { VersionChanged: "Database version changed by other database connection", DatabaseClosed: "Database has been closed", Abort: "Transaction aborted", TransactionInactive: "Transaction has already completed or failed", MissingAPI: "IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb" };
          function N(e2, t3) {
            this.name = e2, this.message = t3;
          }
          function L(e2, t3) {
            return e2 + ". Errors: " + Object.keys(t3).map(function(e3) {
              return t3[e3].toString();
            }).filter(function(e3, t4, n2) {
              return n2.indexOf(e3) === t4;
            }).join("\n");
          }
          function U2(e2, t3, n2, r3) {
            this.failures = t3, this.failedKeys = r3, this.successCount = n2, this.message = L(e2, t3);
          }
          function V2(e2, t3) {
            this.name = "BulkError", this.failures = Object.keys(t3).map(function(e3) {
              return t3[e3];
            }), this.failuresByPos = t3, this.message = L(e2, this.failures);
          }
          o(N).from(Error).extend({ toString: function() {
            return this.name + ": " + this.message;
          } }), o(U2).from(N), o(V2).from(N);
          var z = F2.reduce(function(e2, t3) {
            return e2[t3] = t3 + "Error", e2;
          }, {}), W = N, Y2 = F2.reduce(function(e2, n2) {
            var r3 = n2 + "Error";
            function t3(e3, t4) {
              this.name = r3, e3 ? "string" == typeof e3 ? (this.message = "".concat(e3).concat(t4 ? "\n " + t4 : ""), this.inner = t4 || null) : "object" == typeof e3 && (this.message = "".concat(e3.name, " ").concat(e3.message), this.inner = e3) : (this.message = M[n2] || r3, this.inner = null);
            }
            return o(t3).from(W), e2[n2] = t3, e2;
          }, {});
          Y2.Syntax = SyntaxError, Y2.Type = TypeError, Y2.Range = RangeError;
          var $2 = R.reduce(function(e2, t3) {
            return e2[t3 + "Error"] = Y2[t3], e2;
          }, {});
          var Q2 = F2.reduce(function(e2, t3) {
            return -1 === ["Syntax", "Type", "Range"].indexOf(t3) && (e2[t3 + "Error"] = Y2[t3]), e2;
          }, {});
          function G() {
          }
          function X2(e2) {
            return e2;
          }
          function H(t3, n2) {
            return null == t3 || t3 === X2 ? n2 : function(e2) {
              return n2(t3(e2));
            };
          }
          function J2(e2, t3) {
            return function() {
              e2.apply(this, arguments), t3.apply(this, arguments);
            };
          }
          function Z2(i3, o2) {
            return i3 === G ? o2 : function() {
              var e2 = i3.apply(this, arguments);
              void 0 !== e2 && (arguments[0] = e2);
              var t3 = this.onsuccess, n2 = this.onerror;
              this.onsuccess = null, this.onerror = null;
              var r3 = o2.apply(this, arguments);
              return t3 && (this.onsuccess = this.onsuccess ? J2(t3, this.onsuccess) : t3), n2 && (this.onerror = this.onerror ? J2(n2, this.onerror) : n2), void 0 !== r3 ? r3 : e2;
            };
          }
          function ee2(n2, r3) {
            return n2 === G ? r3 : function() {
              n2.apply(this, arguments);
              var e2 = this.onsuccess, t3 = this.onerror;
              this.onsuccess = this.onerror = null, r3.apply(this, arguments), e2 && (this.onsuccess = this.onsuccess ? J2(e2, this.onsuccess) : e2), t3 && (this.onerror = this.onerror ? J2(t3, this.onerror) : t3);
            };
          }
          function te2(i3, o2) {
            return i3 === G ? o2 : function(e2) {
              var t3 = i3.apply(this, arguments);
              a(e2, t3);
              var n2 = this.onsuccess, r3 = this.onerror;
              this.onsuccess = null, this.onerror = null;
              e2 = o2.apply(this, arguments);
              return n2 && (this.onsuccess = this.onsuccess ? J2(n2, this.onsuccess) : n2), r3 && (this.onerror = this.onerror ? J2(r3, this.onerror) : r3), void 0 === t3 ? void 0 === e2 ? void 0 : e2 : a(t3, e2);
            };
          }
          function ne2(e2, t3) {
            return e2 === G ? t3 : function() {
              return false !== t3.apply(this, arguments) && e2.apply(this, arguments);
            };
          }
          function re2(i3, o2) {
            return i3 === G ? o2 : function() {
              var e2 = i3.apply(this, arguments);
              if (e2 && "function" == typeof e2.then) {
                for (var t3 = this, n2 = arguments.length, r3 = new Array(n2); n2--; ) r3[n2] = arguments[n2];
                return e2.then(function() {
                  return o2.apply(t3, r3);
                });
              }
              return o2.apply(this, arguments);
            };
          }
          Q2.ModifyError = U2, Q2.DexieError = N, Q2.BulkError = V2;
          var ie2 = "undefined" != typeof location && /^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);
          function oe2(e2) {
            ie2 = e2;
          }
          var ae2 = {}, ue2 = 100, e = "undefined" == typeof Promise ? [] : (function() {
            var e2 = Promise.resolve();
            if ("undefined" == typeof crypto || !crypto.subtle) return [e2, c2(e2), e2];
            var t3 = crypto.subtle.digest("SHA-512", new Uint8Array([0]));
            return [t3, c2(t3), e2];
          })(), R = e[0], F2 = e[1], e = e[2], F2 = F2 && F2.then, se2 = R && R.constructor, ce2 = !!e;
          var le2 = function(e2, t3) {
            be2.push([e2, t3]), he2 && (queueMicrotask(Se2), he2 = false);
          }, fe2 = true, he2 = true, de2 = [], pe2 = [], ye2 = X2, ve2 = { id: "global", global: true, ref: 0, unhandleds: [], onunhandled: G, pgp: false, env: {}, finalize: G }, me2 = ve2, be2 = [], ge2 = 0, we2 = [];
          function _e2(e2) {
            if ("object" != typeof this) throw new TypeError("Promises must be constructed via new");
            this._listeners = [], this._lib = false;
            var t3 = this._PSD = me2;
            if ("function" != typeof e2) {
              if (e2 !== ae2) throw new TypeError("Not a function");
              return this._state = arguments[1], this._value = arguments[2], void (false === this._state && Oe2(this, this._value));
            }
            this._state = null, this._value = null, ++t3.ref, (function t4(r3, e3) {
              try {
                e3(function(n2) {
                  if (null === r3._state) {
                    if (n2 === r3) throw new TypeError("A promise cannot be resolved with itself.");
                    var e4 = r3._lib && je2();
                    n2 && "function" == typeof n2.then ? t4(r3, function(e5, t5) {
                      n2 instanceof _e2 ? n2._then(e5, t5) : n2.then(e5, t5);
                    }) : (r3._state = true, r3._value = n2, Pe2(r3)), e4 && Ae2();
                  }
                }, Oe2.bind(null, r3));
              } catch (e4) {
                Oe2(r3, e4);
              }
            })(this, e2);
          }
          var xe2 = { get: function() {
            var u2 = me2, t3 = Fe2;
            function e2(n2, r3) {
              var i3 = this, o2 = !u2.global && (u2 !== me2 || t3 !== Fe2), a2 = o2 && !Ue2(), e3 = new _e2(function(e4, t4) {
                Ke2(i3, new ke2(Qe2(n2, u2, o2, a2), Qe2(r3, u2, o2, a2), e4, t4, u2));
              });
              return this._consoleTask && (e3._consoleTask = this._consoleTask), e3;
            }
            return e2.prototype = ae2, e2;
          }, set: function(e2) {
            l(this, "then", e2 && e2.prototype === ae2 ? xe2 : { get: function() {
              return e2;
            }, set: xe2.set });
          } };
          function ke2(e2, t3, n2, r3, i3) {
            this.onFulfilled = "function" == typeof e2 ? e2 : null, this.onRejected = "function" == typeof t3 ? t3 : null, this.resolve = n2, this.reject = r3, this.psd = i3;
          }
          function Oe2(e2, t3) {
            var n2, r3;
            pe2.push(t3), null === e2._state && (n2 = e2._lib && je2(), t3 = ye2(t3), e2._state = false, e2._value = t3, r3 = e2, de2.some(function(e3) {
              return e3._value === r3._value;
            }) || de2.push(r3), Pe2(e2), n2 && Ae2());
          }
          function Pe2(e2) {
            var t3 = e2._listeners;
            e2._listeners = [];
            for (var n2 = 0, r3 = t3.length; n2 < r3; ++n2) Ke2(e2, t3[n2]);
            var i3 = e2._PSD;
            --i3.ref || i3.finalize(), 0 === ge2 && (++ge2, le2(function() {
              0 == --ge2 && Ce2();
            }, []));
          }
          function Ke2(e2, t3) {
            if (null !== e2._state) {
              var n2 = e2._state ? t3.onFulfilled : t3.onRejected;
              if (null === n2) return (e2._state ? t3.resolve : t3.reject)(e2._value);
              ++t3.psd.ref, ++ge2, le2(Ee2, [n2, e2, t3]);
            } else e2._listeners.push(t3);
          }
          function Ee2(e2, t3, n2) {
            try {
              var r3, i3 = t3._value;
              !t3._state && pe2.length && (pe2 = []), r3 = ie2 && t3._consoleTask ? t3._consoleTask.run(function() {
                return e2(i3);
              }) : e2(i3), t3._state || -1 !== pe2.indexOf(i3) || (function(e3) {
                var t4 = de2.length;
                for (; t4; ) if (de2[--t4]._value === e3._value) return de2.splice(t4, 1);
              })(t3), n2.resolve(r3);
            } catch (e3) {
              n2.reject(e3);
            } finally {
              0 == --ge2 && Ce2(), --n2.psd.ref || n2.psd.finalize();
            }
          }
          function Se2() {
            $e2(ve2, function() {
              je2() && Ae2();
            });
          }
          function je2() {
            var e2 = fe2;
            return he2 = fe2 = false, e2;
          }
          function Ae2() {
            var e2, t3, n2;
            do {
              for (; 0 < be2.length; ) for (e2 = be2, be2 = [], n2 = e2.length, t3 = 0; t3 < n2; ++t3) {
                var r3 = e2[t3];
                r3[0].apply(null, r3[1]);
              }
            } while (0 < be2.length);
            he2 = fe2 = true;
          }
          function Ce2() {
            var e2 = de2;
            de2 = [], e2.forEach(function(e3) {
              e3._PSD.onunhandled.call(null, e3._value, e3);
            });
            for (var t3 = we2.slice(0), n2 = t3.length; n2; ) t3[--n2]();
          }
          function Te2(e2) {
            return new _e2(ae2, false, e2);
          }
          function Ie2(n2, r3) {
            var i3 = me2;
            return function() {
              var e2 = je2(), t3 = me2;
              try {
                return We2(i3, true), n2.apply(this, arguments);
              } catch (e3) {
                r3 && r3(e3);
              } finally {
                We2(t3, false), e2 && Ae2();
              }
            };
          }
          r2(_e2.prototype, { then: xe2, _then: function(e2, t3) {
            Ke2(this, new ke2(null, null, e2, t3, me2));
          }, catch: function(e2) {
            if (1 === arguments.length) return this.then(null, e2);
            var t3 = e2, n2 = arguments[1];
            return "function" == typeof t3 ? this.then(null, function(e3) {
              return (e3 instanceof t3 ? n2 : Te2)(e3);
            }) : this.then(null, function(e3) {
              return (e3 && e3.name === t3 ? n2 : Te2)(e3);
            });
          }, finally: function(t3) {
            return this.then(function(e2) {
              return _e2.resolve(t3()).then(function() {
                return e2;
              });
            }, function(e2) {
              return _e2.resolve(t3()).then(function() {
                return Te2(e2);
              });
            });
          }, timeout: function(r3, i3) {
            var o2 = this;
            return r3 < 1 / 0 ? new _e2(function(e2, t3) {
              var n2 = setTimeout(function() {
                return t3(new Y2.Timeout(i3));
              }, r3);
              o2.then(e2, t3).finally(clearTimeout.bind(null, n2));
            }) : this;
          } }), "undefined" != typeof Symbol && Symbol.toStringTag && l(_e2.prototype, Symbol.toStringTag, "Dexie.Promise"), ve2.env = Ye2(), r2(_e2, { all: function() {
            var o2 = D2.apply(null, arguments).map(Ve2);
            return new _e2(function(n2, r3) {
              0 === o2.length && n2([]);
              var i3 = o2.length;
              o2.forEach(function(e2, t3) {
                return _e2.resolve(e2).then(function(e3) {
                  o2[t3] = e3, --i3 || n2(o2);
                }, r3);
              });
            });
          }, resolve: function(n2) {
            return n2 instanceof _e2 ? n2 : n2 && "function" == typeof n2.then ? new _e2(function(e2, t3) {
              n2.then(e2, t3);
            }) : new _e2(ae2, true, n2);
          }, reject: Te2, race: function() {
            var e2 = D2.apply(null, arguments).map(Ve2);
            return new _e2(function(t3, n2) {
              e2.map(function(e3) {
                return _e2.resolve(e3).then(t3, n2);
              });
            });
          }, PSD: { get: function() {
            return me2;
          }, set: function(e2) {
            return me2 = e2;
          } }, totalEchoes: { get: function() {
            return Fe2;
          } }, newPSD: Ne2, usePSD: $e2, scheduler: { get: function() {
            return le2;
          }, set: function(e2) {
            le2 = e2;
          } }, rejectionMapper: { get: function() {
            return ye2;
          }, set: function(e2) {
            ye2 = e2;
          } }, follow: function(i3, n2) {
            return new _e2(function(e2, t3) {
              return Ne2(function(n3, r3) {
                var e3 = me2;
                e3.unhandleds = [], e3.onunhandled = r3, e3.finalize = J2(function() {
                  var t4, e4 = this;
                  t4 = function() {
                    0 === e4.unhandleds.length ? n3() : r3(e4.unhandleds[0]);
                  }, we2.push(function e5() {
                    t4(), we2.splice(we2.indexOf(e5), 1);
                  }), ++ge2, le2(function() {
                    0 == --ge2 && Ce2();
                  }, []);
                }, e3.finalize), i3();
              }, n2, e2, t3);
            });
          } }), se2 && (se2.allSettled && l(_e2, "allSettled", function() {
            var e2 = D2.apply(null, arguments).map(Ve2);
            return new _e2(function(n2) {
              0 === e2.length && n2([]);
              var r3 = e2.length, i3 = new Array(r3);
              e2.forEach(function(e3, t3) {
                return _e2.resolve(e3).then(function(e4) {
                  return i3[t3] = { status: "fulfilled", value: e4 };
                }, function(e4) {
                  return i3[t3] = { status: "rejected", reason: e4 };
                }).then(function() {
                  return --r3 || n2(i3);
                });
              });
            });
          }), se2.any && "undefined" != typeof AggregateError && l(_e2, "any", function() {
            var e2 = D2.apply(null, arguments).map(Ve2);
            return new _e2(function(n2, r3) {
              0 === e2.length && r3(new AggregateError([]));
              var i3 = e2.length, o2 = new Array(i3);
              e2.forEach(function(e3, t3) {
                return _e2.resolve(e3).then(function(e4) {
                  return n2(e4);
                }, function(e4) {
                  o2[t3] = e4, --i3 || r3(new AggregateError(o2));
                });
              });
            });
          }), se2.withResolvers && (_e2.withResolvers = se2.withResolvers));
          var qe2 = { awaits: 0, echoes: 0, id: 0 }, De2 = 0, Be2 = [], Re2 = 0, Fe2 = 0, Me2 = 0;
          function Ne2(e2, t3, n2, r3) {
            var i3 = me2, o2 = Object.create(i3);
            o2.parent = i3, o2.ref = 0, o2.global = false, o2.id = ++Me2, ve2.env, o2.env = ce2 ? { Promise: _e2, PromiseProp: { value: _e2, configurable: true, writable: true }, all: _e2.all, race: _e2.race, allSettled: _e2.allSettled, any: _e2.any, resolve: _e2.resolve, reject: _e2.reject } : {}, t3 && a(o2, t3), ++i3.ref, o2.finalize = function() {
              --this.parent.ref || this.parent.finalize();
            };
            r3 = $e2(o2, e2, n2, r3);
            return 0 === o2.ref && o2.finalize(), r3;
          }
          function Le2() {
            return qe2.id || (qe2.id = ++De2), ++qe2.awaits, qe2.echoes += ue2, qe2.id;
          }
          function Ue2() {
            return !!qe2.awaits && (0 == --qe2.awaits && (qe2.id = 0), qe2.echoes = qe2.awaits * ue2, true);
          }
          function Ve2(e2) {
            return qe2.echoes && e2 && e2.constructor === se2 ? (Le2(), e2.then(function(e3) {
              return Ue2(), e3;
            }, function(e3) {
              return Ue2(), Xe2(e3);
            })) : e2;
          }
          function ze2() {
            var e2 = Be2[Be2.length - 1];
            Be2.pop(), We2(e2, false);
          }
          function We2(e2, t3) {
            var n2, r3 = me2;
            (t3 ? !qe2.echoes || Re2++ && e2 === me2 : !Re2 || --Re2 && e2 === me2) || queueMicrotask(t3 ? (function(e3) {
              ++Fe2, qe2.echoes && 0 != --qe2.echoes || (qe2.echoes = qe2.awaits = qe2.id = 0), Be2.push(me2), We2(e3, true);
            }).bind(null, e2) : ze2), e2 !== me2 && (me2 = e2, r3 === ve2 && (ve2.env = Ye2()), ce2 && (n2 = ve2.env.Promise, t3 = e2.env, (r3.global || e2.global) && (Object.defineProperty(f, "Promise", t3.PromiseProp), n2.all = t3.all, n2.race = t3.race, n2.resolve = t3.resolve, n2.reject = t3.reject, t3.allSettled && (n2.allSettled = t3.allSettled), t3.any && (n2.any = t3.any))));
          }
          function Ye2() {
            var e2 = f.Promise;
            return ce2 ? { Promise: e2, PromiseProp: Object.getOwnPropertyDescriptor(f, "Promise"), all: e2.all, race: e2.race, allSettled: e2.allSettled, any: e2.any, resolve: e2.resolve, reject: e2.reject } : {};
          }
          function $e2(e2, t3, n2, r3, i3) {
            var o2 = me2;
            try {
              return We2(e2, true), t3(n2, r3, i3);
            } finally {
              We2(o2, false);
            }
          }
          function Qe2(t3, n2, r3, i3) {
            return "function" != typeof t3 ? t3 : function() {
              var e2 = me2;
              r3 && Le2(), We2(n2, true);
              try {
                return t3.apply(this, arguments);
              } finally {
                We2(e2, false), i3 && queueMicrotask(Ue2);
              }
            };
          }
          function Ge2(e2) {
            Promise === se2 && 0 === qe2.echoes ? 0 === Re2 ? e2() : enqueueNativeMicroTask(e2) : setTimeout(e2, 0);
          }
          -1 === ("" + F2).indexOf("[native code]") && (Le2 = Ue2 = G);
          var Xe2 = _e2.reject;
          var He = String.fromCharCode(65535), Je2 = "Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.", Ze2 = "String expected.", et2 = [], tt2 = "__dbnames", nt = "readonly", rt2 = "readwrite";
          function it2(e2, t3) {
            return e2 ? t3 ? function() {
              return e2.apply(this, arguments) && t3.apply(this, arguments);
            } : e2 : t3;
          }
          var ot2 = { type: 3, lower: -1 / 0, lowerOpen: false, upper: [[]], upperOpen: false };
          function at(t3) {
            return "string" != typeof t3 || /\./.test(t3) ? function(e2) {
              return e2;
            } : function(e2) {
              return void 0 === e2[t3] && t3 in e2 && delete (e2 = S(e2))[t3], e2;
            };
          }
          function ut2() {
            throw Y2.Type("Entity instances must never be new:ed. Instances are generated by the framework bypassing the constructor.");
          }
          function st(e2, t3) {
            try {
              var n2 = ct(e2), r3 = ct(t3);
              if (n2 !== r3) return "Array" === n2 ? 1 : "Array" === r3 ? -1 : "binary" === n2 ? 1 : "binary" === r3 ? -1 : "string" === n2 ? 1 : "string" === r3 ? -1 : "Date" === n2 ? 1 : "Date" !== r3 ? NaN : -1;
              switch (n2) {
                case "number":
                case "Date":
                case "string":
                  return t3 < e2 ? 1 : e2 < t3 ? -1 : 0;
                case "binary":
                  return (function(e3, t4) {
                    for (var n3 = e3.length, r4 = t4.length, i3 = n3 < r4 ? n3 : r4, o2 = 0; o2 < i3; ++o2) if (e3[o2] !== t4[o2]) return e3[o2] < t4[o2] ? -1 : 1;
                    return n3 === r4 ? 0 : n3 < r4 ? -1 : 1;
                  })(lt2(e2), lt2(t3));
                case "Array":
                  return (function(e3, t4) {
                    for (var n3 = e3.length, r4 = t4.length, i3 = n3 < r4 ? n3 : r4, o2 = 0; o2 < i3; ++o2) {
                      var a2 = st(e3[o2], t4[o2]);
                      if (0 !== a2) return a2;
                    }
                    return n3 === r4 ? 0 : n3 < r4 ? -1 : 1;
                  })(e2, t3);
              }
            } catch (e3) {
            }
            return NaN;
          }
          function ct(e2) {
            var t3 = typeof e2;
            if ("object" != t3) return t3;
            if (ArrayBuffer.isView(e2)) return "binary";
            e2 = A2(e2);
            return "ArrayBuffer" === e2 ? "binary" : e2;
          }
          function lt2(e2) {
            return e2 instanceof Uint8Array ? e2 : ArrayBuffer.isView(e2) ? new Uint8Array(e2.buffer, e2.byteOffset, e2.byteLength) : new Uint8Array(e2);
          }
          function ft(t3, n2, r3) {
            var e2 = t3.schema.yProps;
            return e2 ? (n2 && 0 < r3.numFailures && (n2 = n2.filter(function(e3, t4) {
              return !r3.failures[t4];
            })), Promise.all(e2.map(function(e3) {
              e3 = e3.updatesTable;
              return n2 ? t3.db.table(e3).where("k").anyOf(n2).delete() : t3.db.table(e3).clear();
            })).then(function() {
              return r3;
            })) : r3;
          }
          var ht2 = (dt2.prototype.execute = function(e2) {
            var t3 = this["@@propmod"];
            if (void 0 !== t3.add) {
              var n2 = t3.add;
              if (x2(n2)) return i2(i2([], x2(e2) ? e2 : [], true), n2).sort();
              if ("number" == typeof n2) return (Number(e2) || 0) + n2;
              if ("bigint" == typeof n2) try {
                return BigInt(e2) + n2;
              } catch (e3) {
                return BigInt(0) + n2;
              }
              throw new TypeError("Invalid term ".concat(n2));
            }
            if (void 0 !== t3.remove) {
              var r3 = t3.remove;
              if (x2(r3)) return x2(e2) ? e2.filter(function(e3) {
                return !r3.includes(e3);
              }).sort() : [];
              if ("number" == typeof r3) return Number(e2) - r3;
              if ("bigint" == typeof r3) try {
                return BigInt(e2) - r3;
              } catch (e3) {
                return BigInt(0) - r3;
              }
              throw new TypeError("Invalid subtrahend ".concat(r3));
            }
            n2 = null === (n2 = t3.replacePrefix) || void 0 === n2 ? void 0 : n2[0];
            return n2 && "string" == typeof e2 && e2.startsWith(n2) ? t3.replacePrefix[1] + e2.substring(n2.length) : e2;
          }, dt2);
          function dt2(e2) {
            this["@@propmod"] = e2;
          }
          function pt(e2, t3) {
            for (var n2 = O(t3), r3 = n2.length, i3 = false, o2 = 0; o2 < r3; ++o2) {
              var a2 = n2[o2], u2 = t3[a2], s2 = g(e2, a2);
              u2 instanceof ht2 ? (w(e2, a2, u2.execute(s2)), i3 = true) : s2 !== u2 && (w(e2, a2, u2), i3 = true);
            }
            return i3;
          }
          var yt2 = (vt2.prototype._trans = function(e2, r3, t3) {
            var n2 = this._tx || me2.trans, i3 = this.name, o2 = ie2 && "undefined" != typeof console && console.createTask && console.createTask("Dexie: ".concat("readonly" === e2 ? "read" : "write", " ").concat(this.name));
            function a2(e3, t4, n3) {
              if (!n3.schema[i3]) throw new Y2.NotFound("Table " + i3 + " not part of transaction");
              return r3(n3.idbtrans, n3);
            }
            var u2 = je2();
            try {
              var s2 = n2 && n2.db._novip === this.db._novip ? n2 === me2.trans ? n2._promise(e2, a2, t3) : Ne2(function() {
                return n2._promise(e2, a2, t3);
              }, { trans: n2, transless: me2.transless || me2 }) : (function t4(n3, r4, i4, o3) {
                if (n3.idbdb && (n3._state.openComplete || me2.letThrough || n3._vip)) {
                  var a3 = n3._createTransaction(r4, i4, n3._dbSchema);
                  try {
                    a3.create(), n3._state.PR1398_maxLoop = 3;
                  } catch (e3) {
                    return e3.name === z.InvalidState && n3.isOpen() && 0 < --n3._state.PR1398_maxLoop ? (console.warn("Dexie: Need to reopen db"), n3.close({ disableAutoOpen: false }), n3.open().then(function() {
                      return t4(n3, r4, i4, o3);
                    })) : Xe2(e3);
                  }
                  return a3._promise(r4, function(e3, t5) {
                    return Ne2(function() {
                      return me2.trans = a3, o3(e3, t5, a3);
                    });
                  }).then(function(e3) {
                    if ("readwrite" === r4) try {
                      a3.idbtrans.commit();
                    } catch (e4) {
                    }
                    return "readonly" === r4 ? e3 : a3._completion.then(function() {
                      return e3;
                    });
                  });
                }
                if (n3._state.openComplete) return Xe2(new Y2.DatabaseClosed(n3._state.dbOpenError));
                if (!n3._state.isBeingOpened) {
                  if (!n3._state.autoOpen) return Xe2(new Y2.DatabaseClosed());
                  n3.open().catch(G);
                }
                return n3._state.dbReadyPromise.then(function() {
                  return t4(n3, r4, i4, o3);
                });
              })(this.db, e2, [this.name], a2);
              return o2 && (s2._consoleTask = o2, s2 = s2.catch(function(e3) {
                return console.trace(e3), Xe2(e3);
              })), s2;
            } finally {
              u2 && Ae2();
            }
          }, vt2.prototype.get = function(t3, e2) {
            var n2 = this;
            return t3 && t3.constructor === Object ? this.where(t3).first(e2) : null == t3 ? Xe2(new Y2.Type("Invalid argument to Table.get()")) : this._trans("readonly", function(e3) {
              return n2.core.get({ trans: e3, key: t3 }).then(function(e4) {
                return n2.hook.reading.fire(e4);
              });
            }).then(e2);
          }, vt2.prototype.where = function(o2) {
            if ("string" == typeof o2) return new this.db.WhereClause(this, o2);
            if (x2(o2)) return new this.db.WhereClause(this, "[".concat(o2.join("+"), "]"));
            var n2 = O(o2);
            if (1 === n2.length) return this.where(n2[0]).equals(o2[n2[0]]);
            var e2 = this.schema.indexes.concat(this.schema.primKey).filter(function(t4) {
              if (t4.compound && n2.every(function(e4) {
                return 0 <= t4.keyPath.indexOf(e4);
              })) {
                for (var e3 = 0; e3 < n2.length; ++e3) if (-1 === n2.indexOf(t4.keyPath[e3])) return false;
                return true;
              }
              return false;
            }).sort(function(e3, t4) {
              return e3.keyPath.length - t4.keyPath.length;
            })[0];
            if (e2 && this.db._maxKey !== He) {
              var t3 = e2.keyPath.slice(0, n2.length);
              return this.where(t3).equals(t3.map(function(e3) {
                return o2[e3];
              }));
            }
            !e2 && ie2 && console.warn("The query ".concat(JSON.stringify(o2), " on ").concat(this.name, " would benefit from a ") + "compound index [".concat(n2.join("+"), "]"));
            var a2 = this.schema.idxByName;
            function u2(e3, t4) {
              return 0 === st(e3, t4);
            }
            var r3 = n2.reduce(function(e3, t4) {
              var n3 = e3[0], r4 = e3[1], e3 = a2[t4], i3 = o2[t4];
              return [n3 || e3, n3 || !e3 ? it2(r4, e3 && e3.multi ? function(e4) {
                e4 = g(e4, t4);
                return x2(e4) && e4.some(function(e5) {
                  return u2(i3, e5);
                });
              } : function(e4) {
                return u2(i3, g(e4, t4));
              }) : r4];
            }, [null, null]), t3 = r3[0], r3 = r3[1];
            return t3 ? this.where(t3.name).equals(o2[t3.keyPath]).filter(r3) : e2 ? this.filter(r3) : this.where(n2).equals("");
          }, vt2.prototype.filter = function(e2) {
            return this.toCollection().and(e2);
          }, vt2.prototype.count = function(e2) {
            return this.toCollection().count(e2);
          }, vt2.prototype.offset = function(e2) {
            return this.toCollection().offset(e2);
          }, vt2.prototype.limit = function(e2) {
            return this.toCollection().limit(e2);
          }, vt2.prototype.each = function(e2) {
            return this.toCollection().each(e2);
          }, vt2.prototype.toArray = function(e2) {
            return this.toCollection().toArray(e2);
          }, vt2.prototype.toCollection = function() {
            return new this.db.Collection(new this.db.WhereClause(this));
          }, vt2.prototype.orderBy = function(e2) {
            return new this.db.Collection(new this.db.WhereClause(this, x2(e2) ? "[".concat(e2.join("+"), "]") : e2));
          }, vt2.prototype.reverse = function() {
            return this.toCollection().reverse();
          }, vt2.prototype.mapToClass = function(r3) {
            var e2, t3 = this.db, n2 = this.name;
            function i3() {
              return null !== e2 && e2.apply(this, arguments) || this;
            }
            (this.schema.mappedClass = r3).prototype instanceof ut2 && ((function(e3, t4) {
              if ("function" != typeof t4 && null !== t4) throw new TypeError("Class extends value " + String(t4) + " is not a constructor or null");
              function n3() {
                this.constructor = e3;
              }
              s(e3, t4), e3.prototype = null === t4 ? Object.create(t4) : (n3.prototype = t4.prototype, new n3());
            })(i3, e2 = r3), Object.defineProperty(i3.prototype, "db", { get: function() {
              return t3;
            }, enumerable: false, configurable: true }), i3.prototype.table = function() {
              return n2;
            }, r3 = i3);
            for (var o2 = /* @__PURE__ */ new Set(), a2 = r3.prototype; a2; a2 = c2(a2)) Object.getOwnPropertyNames(a2).forEach(function(e3) {
              return o2.add(e3);
            });
            function u2(e3) {
              if (!e3) return e3;
              var t4, n3 = Object.create(r3.prototype);
              for (t4 in e3) if (!o2.has(t4)) try {
                n3[t4] = e3[t4];
              } catch (e4) {
              }
              return n3;
            }
            return this.schema.readHook && this.hook.reading.unsubscribe(this.schema.readHook), this.schema.readHook = u2, this.hook("reading", u2), r3;
          }, vt2.prototype.defineClass = function() {
            return this.mapToClass(function(e2) {
              a(this, e2);
            });
          }, vt2.prototype.add = function(t3, n2) {
            var r3 = this, e2 = this.schema.primKey, i3 = e2.auto, o2 = e2.keyPath, a2 = t3;
            return o2 && i3 && (a2 = at(o2)(t3)), this._trans("readwrite", function(e3) {
              return r3.core.mutate({ trans: e3, type: "add", keys: null != n2 ? [n2] : null, values: [a2] });
            }).then(function(e3) {
              return e3.numFailures ? _e2.reject(e3.failures[0]) : e3.lastResult;
            }).then(function(e3) {
              if (o2) try {
                w(t3, o2, e3);
              } catch (e4) {
              }
              return e3;
            });
          }, vt2.prototype.upsert = function(r3, i3) {
            var o2 = this, a2 = this.schema.primKey.keyPath;
            return this._trans("readwrite", function(n2) {
              return o2.core.get({ trans: n2, key: r3 }).then(function(t3) {
                var e2 = null != t3 ? t3 : {};
                return pt(e2, i3), a2 && w(e2, a2, r3), o2.core.mutate({ trans: n2, type: "put", values: [e2], keys: [r3], upsert: true, updates: { keys: [r3], changeSpecs: [i3] } }).then(function(e3) {
                  return e3.numFailures ? _e2.reject(e3.failures[0]) : !!t3;
                });
              });
            });
          }, vt2.prototype.update = function(e2, t3) {
            if ("object" != typeof e2 || x2(e2)) return this.where(":id").equals(e2).modify(t3);
            e2 = g(e2, this.schema.primKey.keyPath);
            return void 0 === e2 ? Xe2(new Y2.InvalidArgument("Given object does not contain its primary key")) : this.where(":id").equals(e2).modify(t3);
          }, vt2.prototype.put = function(t3, n2) {
            var r3 = this, e2 = this.schema.primKey, i3 = e2.auto, o2 = e2.keyPath, a2 = t3;
            return o2 && i3 && (a2 = at(o2)(t3)), this._trans("readwrite", function(e3) {
              return r3.core.mutate({ trans: e3, type: "put", values: [a2], keys: null != n2 ? [n2] : null });
            }).then(function(e3) {
              return e3.numFailures ? _e2.reject(e3.failures[0]) : e3.lastResult;
            }).then(function(e3) {
              if (o2) try {
                w(t3, o2, e3);
              } catch (e4) {
              }
              return e3;
            });
          }, vt2.prototype.delete = function(t3) {
            var n2 = this;
            return this._trans("readwrite", function(e2) {
              return n2.core.mutate({ trans: e2, type: "delete", keys: [t3] }).then(function(e3) {
                return ft(n2, [t3], e3);
              }).then(function(e3) {
                return e3.numFailures ? _e2.reject(e3.failures[0]) : void 0;
              });
            });
          }, vt2.prototype.clear = function() {
            var t3 = this;
            return this._trans("readwrite", function(e2) {
              return t3.core.mutate({ trans: e2, type: "deleteRange", range: ot2 }).then(function(e3) {
                return ft(t3, null, e3);
              });
            }).then(function(e2) {
              return e2.numFailures ? _e2.reject(e2.failures[0]) : void 0;
            });
          }, vt2.prototype.bulkGet = function(t3) {
            var n2 = this;
            return this._trans("readonly", function(e2) {
              return n2.core.getMany({ keys: t3, trans: e2 }).then(function(e3) {
                return e3.map(function(e4) {
                  return n2.hook.reading.fire(e4);
                });
              });
            });
          }, vt2.prototype.bulkAdd = function(r3, e2, t3) {
            var o2 = this, a2 = Array.isArray(e2) ? e2 : void 0, u2 = (t3 = t3 || (a2 ? void 0 : e2)) ? t3.allKeys : void 0;
            return this._trans("readwrite", function(e3) {
              var t4 = o2.schema.primKey, n2 = t4.auto, t4 = t4.keyPath;
              if (t4 && a2) throw new Y2.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");
              if (a2 && a2.length !== r3.length) throw new Y2.InvalidArgument("Arguments objects and keys must have the same length");
              var i3 = r3.length, t4 = t4 && n2 ? r3.map(at(t4)) : r3;
              return o2.core.mutate({ trans: e3, type: "add", keys: a2, values: t4, wantResults: u2 }).then(function(e4) {
                var t5 = e4.numFailures, n3 = e4.results, r4 = e4.lastResult, e4 = e4.failures;
                if (0 === t5) return u2 ? n3 : r4;
                throw new V2("".concat(o2.name, ".bulkAdd(): ").concat(t5, " of ").concat(i3, " operations failed"), e4);
              });
            });
          }, vt2.prototype.bulkPut = function(r3, e2, t3) {
            var o2 = this, a2 = Array.isArray(e2) ? e2 : void 0, u2 = (t3 = t3 || (a2 ? void 0 : e2)) ? t3.allKeys : void 0;
            return this._trans("readwrite", function(e3) {
              var t4 = o2.schema.primKey, n2 = t4.auto, t4 = t4.keyPath;
              if (t4 && a2) throw new Y2.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");
              if (a2 && a2.length !== r3.length) throw new Y2.InvalidArgument("Arguments objects and keys must have the same length");
              var i3 = r3.length, t4 = t4 && n2 ? r3.map(at(t4)) : r3;
              return o2.core.mutate({ trans: e3, type: "put", keys: a2, values: t4, wantResults: u2 }).then(function(e4) {
                var t5 = e4.numFailures, n3 = e4.results, r4 = e4.lastResult, e4 = e4.failures;
                if (0 === t5) return u2 ? n3 : r4;
                throw new V2("".concat(o2.name, ".bulkPut(): ").concat(t5, " of ").concat(i3, " operations failed"), e4);
              });
            });
          }, vt2.prototype.bulkUpdate = function(t3) {
            var h2 = this, n2 = this.core, r3 = t3.map(function(e2) {
              return e2.key;
            }), i3 = t3.map(function(e2) {
              return e2.changes;
            }), d2 = [];
            return this._trans("readwrite", function(e2) {
              return n2.getMany({ trans: e2, keys: r3, cache: "clone" }).then(function(c3) {
                var l2 = [], f2 = [];
                t3.forEach(function(e3, t4) {
                  var n3 = e3.key, r4 = e3.changes, i4 = c3[t4];
                  if (i4) {
                    for (var o2 = 0, a2 = Object.keys(r4); o2 < a2.length; o2++) {
                      var u2 = a2[o2], s3 = r4[u2];
                      if (u2 === h2.schema.primKey.keyPath) {
                        if (0 !== st(s3, n3)) throw new Y2.Constraint("Cannot update primary key in bulkUpdate()");
                      } else w(i4, u2, s3);
                    }
                    d2.push(t4), l2.push(n3), f2.push(i4);
                  }
                });
                var s2 = l2.length;
                return n2.mutate({ trans: e2, type: "put", keys: l2, values: f2, updates: { keys: r3, changeSpecs: i3 } }).then(function(e3) {
                  var t4 = e3.numFailures, n3 = e3.failures;
                  if (0 === t4) return s2;
                  for (var r4 = 0, i4 = Object.keys(n3); r4 < i4.length; r4++) {
                    var o2, a2 = i4[r4], u2 = d2[Number(a2)];
                    null != u2 && (o2 = n3[a2], delete n3[a2], n3[u2] = o2);
                  }
                  throw new V2("".concat(h2.name, ".bulkUpdate(): ").concat(t4, " of ").concat(s2, " operations failed"), n3);
                });
              });
            });
          }, vt2.prototype.bulkDelete = function(t3) {
            var r3 = this, i3 = t3.length;
            return this._trans("readwrite", function(e2) {
              return r3.core.mutate({ trans: e2, type: "delete", keys: t3 }).then(function(e3) {
                return ft(r3, t3, e3);
              });
            }).then(function(e2) {
              var t4 = e2.numFailures, n2 = e2.lastResult, e2 = e2.failures;
              if (0 === t4) return n2;
              throw new V2("".concat(r3.name, ".bulkDelete(): ").concat(t4, " of ").concat(i3, " operations failed"), e2);
            });
          }, vt2);
          function vt2() {
          }
          function mt(i3) {
            function t3(e3, t4) {
              if (t4) {
                for (var n3 = arguments.length, r3 = new Array(n3 - 1); --n3; ) r3[n3 - 1] = arguments[n3];
                return a2[e3].subscribe.apply(null, r3), i3;
              }
              if ("string" == typeof e3) return a2[e3];
            }
            var a2 = {};
            t3.addEventType = u2;
            for (var e2 = 1, n2 = arguments.length; e2 < n2; ++e2) u2(arguments[e2]);
            return t3;
            function u2(e3, n3, r3) {
              if ("object" != typeof e3) {
                var i4;
                n3 = n3 || ne2;
                var o2 = { subscribers: [], fire: r3 = r3 || G, subscribe: function(e4) {
                  -1 === o2.subscribers.indexOf(e4) && (o2.subscribers.push(e4), o2.fire = n3(o2.fire, e4));
                }, unsubscribe: function(t4) {
                  o2.subscribers = o2.subscribers.filter(function(e4) {
                    return e4 !== t4;
                  }), o2.fire = o2.subscribers.reduce(n3, r3);
                } };
                return a2[e3] = t3[e3] = o2;
              }
              O(i4 = e3).forEach(function(e4) {
                var t4 = i4[e4];
                if (x2(t4)) u2(e4, i4[e4][0], i4[e4][1]);
                else {
                  if ("asap" !== t4) throw new Y2.InvalidArgument("Invalid event config");
                  var n4 = u2(e4, X2, function() {
                    for (var e5 = arguments.length, t5 = new Array(e5); e5--; ) t5[e5] = arguments[e5];
                    n4.subscribers.forEach(function(e6) {
                      v(function() {
                        e6.apply(null, t5);
                      });
                    });
                  });
                }
              });
            }
          }
          function bt2(e2, t3) {
            return o(t3).from({ prototype: e2 }), t3;
          }
          function gt2(e2, t3) {
            return !(e2.filter || e2.algorithm || e2.or) && (t3 ? e2.justLimit : !e2.replayFilter);
          }
          function wt(e2, t3) {
            e2.filter = it2(e2.filter, t3);
          }
          function _t2(e2, t3, n2) {
            var r3 = e2.replayFilter;
            e2.replayFilter = r3 ? function() {
              return it2(r3(), t3());
            } : t3, e2.justLimit = n2 && !r3;
          }
          function xt(e2, t3) {
            if (e2.isPrimKey) return t3.primaryKey;
            var n2 = t3.getIndexByKeyPath(e2.index);
            if (!n2) throw new Y2.Schema("KeyPath " + e2.index + " on object store " + t3.name + " is not indexed");
            return n2;
          }
          function kt2(e2, t3, n2) {
            var r3 = xt(e2, t3.schema);
            return t3.openCursor({ trans: n2, values: !e2.keysOnly, reverse: "prev" === e2.dir, unique: !!e2.unique, query: { index: r3, range: e2.range } });
          }
          function Ot(e2, o2, t3, n2) {
            var a2 = e2.replayFilter ? it2(e2.filter, e2.replayFilter()) : e2.filter;
            if (e2.or) {
              var u2 = {}, r3 = function(e3, t4, n3) {
                var r4, i3;
                a2 && !a2(t4, n3, function(e4) {
                  return t4.stop(e4);
                }, function(e4) {
                  return t4.fail(e4);
                }) || ("[object ArrayBuffer]" === (i3 = "" + (r4 = t4.primaryKey)) && (i3 = "" + new Uint8Array(r4)), m(u2, i3) || (u2[i3] = true, o2(e3, t4, n3)));
              };
              return Promise.all([e2.or._iterate(r3, t3), Pt2(kt2(e2, n2, t3), e2.algorithm, r3, !e2.keysOnly && e2.valueMapper)]);
            }
            return Pt2(kt2(e2, n2, t3), it2(e2.algorithm, a2), o2, !e2.keysOnly && e2.valueMapper);
          }
          function Pt2(e2, r3, i3, o2) {
            var a2 = Ie2(o2 ? function(e3, t3, n2) {
              return i3(o2(e3), t3, n2);
            } : i3);
            return e2.then(function(n2) {
              if (n2) return n2.start(function() {
                var t3 = function() {
                  return n2.continue();
                };
                r3 && !r3(n2, function(e3) {
                  return t3 = e3;
                }, function(e3) {
                  n2.stop(e3), t3 = G;
                }, function(e3) {
                  n2.fail(e3), t3 = G;
                }) || a2(n2.value, n2, function(e3) {
                  return t3 = e3;
                }), t3();
              });
            });
          }
          var Kt2 = (Et2.prototype._read = function(e2, t3) {
            var n2 = this._ctx;
            return n2.error ? n2.table._trans(null, Xe2.bind(null, n2.error)) : n2.table._trans("readonly", e2).then(t3);
          }, Et2.prototype._write = function(e2) {
            var t3 = this._ctx;
            return t3.error ? t3.table._trans(null, Xe2.bind(null, t3.error)) : t3.table._trans("readwrite", e2, "locked");
          }, Et2.prototype._addAlgorithm = function(e2) {
            var t3 = this._ctx;
            t3.algorithm = it2(t3.algorithm, e2);
          }, Et2.prototype._iterate = function(e2, t3) {
            return Ot(this._ctx, e2, t3, this._ctx.table.core);
          }, Et2.prototype.clone = function(e2) {
            var t3 = Object.create(this.constructor.prototype), n2 = Object.create(this._ctx);
            return e2 && a(n2, e2), t3._ctx = n2, t3;
          }, Et2.prototype.raw = function() {
            return this._ctx.valueMapper = null, this;
          }, Et2.prototype.each = function(t3) {
            var n2 = this._ctx;
            return this._read(function(e2) {
              return Ot(n2, t3, e2, n2.table.core);
            });
          }, Et2.prototype.count = function(e2) {
            var i3 = this;
            return this._read(function(e3) {
              var t3 = i3._ctx, n2 = t3.table.core;
              if (gt2(t3, true)) return n2.count({ trans: e3, query: { index: xt(t3, n2.schema), range: t3.range } }).then(function(e4) {
                return Math.min(e4, t3.limit);
              });
              var r3 = 0;
              return Ot(t3, function() {
                return ++r3, false;
              }, e3, n2).then(function() {
                return r3;
              });
            }).then(e2);
          }, Et2.prototype.sortBy = function(e2, t3) {
            var n2 = e2.split(".").reverse(), r3 = n2[0], i3 = n2.length - 1;
            function o2(e3, t4) {
              return t4 ? o2(e3[n2[t4]], t4 - 1) : e3[r3];
            }
            var a2 = "next" === this._ctx.dir ? 1 : -1;
            function u2(e3, t4) {
              return st(o2(e3, i3), o2(t4, i3)) * a2;
            }
            return this.toArray(function(e3) {
              return e3.sort(u2);
            }).then(t3);
          }, Et2.prototype.toArray = function(e2) {
            var o2 = this;
            return this._read(function(e3) {
              var t3 = o2._ctx;
              if ("next" === t3.dir && gt2(t3, true) && 0 < t3.limit) {
                var n2 = t3.valueMapper, r3 = xt(t3, t3.table.core.schema);
                return t3.table.core.query({ trans: e3, limit: t3.limit, values: true, query: { index: r3, range: t3.range } }).then(function(e4) {
                  e4 = e4.result;
                  return n2 ? e4.map(n2) : e4;
                });
              }
              var i3 = [];
              return Ot(t3, function(e4) {
                return i3.push(e4);
              }, e3, t3.table.core).then(function() {
                return i3;
              });
            }, e2);
          }, Et2.prototype.offset = function(t3) {
            var e2 = this._ctx;
            return t3 <= 0 || (e2.offset += t3, gt2(e2) ? _t2(e2, function() {
              var n2 = t3;
              return function(e3, t4) {
                return 0 === n2 || (1 === n2 ? --n2 : t4(function() {
                  e3.advance(n2), n2 = 0;
                }), false);
              };
            }) : _t2(e2, function() {
              var e3 = t3;
              return function() {
                return --e3 < 0;
              };
            })), this;
          }, Et2.prototype.limit = function(e2) {
            return this._ctx.limit = Math.min(this._ctx.limit, e2), _t2(this._ctx, function() {
              var r3 = e2;
              return function(e3, t3, n2) {
                return --r3 <= 0 && t3(n2), 0 <= r3;
              };
            }, true), this;
          }, Et2.prototype.until = function(r3, i3) {
            return wt(this._ctx, function(e2, t3, n2) {
              return !r3(e2.value) || (t3(n2), i3);
            }), this;
          }, Et2.prototype.first = function(e2) {
            return this.limit(1).toArray(function(e3) {
              return e3[0];
            }).then(e2);
          }, Et2.prototype.last = function(e2) {
            return this.reverse().first(e2);
          }, Et2.prototype.filter = function(t3) {
            var e2;
            return wt(this._ctx, function(e3) {
              return t3(e3.value);
            }), (e2 = this._ctx).isMatch = it2(e2.isMatch, t3), this;
          }, Et2.prototype.and = function(e2) {
            return this.filter(e2);
          }, Et2.prototype.or = function(e2) {
            return new this.db.WhereClause(this._ctx.table, e2, this);
          }, Et2.prototype.reverse = function() {
            return this._ctx.dir = "prev" === this._ctx.dir ? "next" : "prev", this._ondirectionchange && this._ondirectionchange(this._ctx.dir), this;
          }, Et2.prototype.desc = function() {
            return this.reverse();
          }, Et2.prototype.eachKey = function(n2) {
            var e2 = this._ctx;
            return e2.keysOnly = !e2.isMatch, this.each(function(e3, t3) {
              n2(t3.key, t3);
            });
          }, Et2.prototype.eachUniqueKey = function(e2) {
            return this._ctx.unique = "unique", this.eachKey(e2);
          }, Et2.prototype.eachPrimaryKey = function(n2) {
            var e2 = this._ctx;
            return e2.keysOnly = !e2.isMatch, this.each(function(e3, t3) {
              n2(t3.primaryKey, t3);
            });
          }, Et2.prototype.keys = function(e2) {
            var t3 = this._ctx;
            t3.keysOnly = !t3.isMatch;
            var n2 = [];
            return this.each(function(e3, t4) {
              n2.push(t4.key);
            }).then(function() {
              return n2;
            }).then(e2);
          }, Et2.prototype.primaryKeys = function(e2) {
            var n2 = this._ctx;
            if ("next" === n2.dir && gt2(n2, true) && 0 < n2.limit) return this._read(function(e3) {
              var t3 = xt(n2, n2.table.core.schema);
              return n2.table.core.query({ trans: e3, values: false, limit: n2.limit, query: { index: t3, range: n2.range } });
            }).then(function(e3) {
              return e3.result;
            }).then(e2);
            n2.keysOnly = !n2.isMatch;
            var r3 = [];
            return this.each(function(e3, t3) {
              r3.push(t3.primaryKey);
            }).then(function() {
              return r3;
            }).then(e2);
          }, Et2.prototype.uniqueKeys = function(e2) {
            return this._ctx.unique = "unique", this.keys(e2);
          }, Et2.prototype.firstKey = function(e2) {
            return this.limit(1).keys(function(e3) {
              return e3[0];
            }).then(e2);
          }, Et2.prototype.lastKey = function(e2) {
            return this.reverse().firstKey(e2);
          }, Et2.prototype.distinct = function() {
            var e2 = this._ctx, e2 = e2.index && e2.table.schema.idxByName[e2.index];
            if (!e2 || !e2.multi) return this;
            var n2 = {};
            return wt(this._ctx, function(e3) {
              var t3 = e3.primaryKey.toString(), e3 = m(n2, t3);
              return n2[t3] = true, !e3;
            }), this;
          }, Et2.prototype.modify = function(x3) {
            var n2 = this, k3 = this._ctx;
            return this._write(function(p2) {
              var y2 = "function" == typeof x3 ? x3 : function(e3) {
                return pt(e3, x3);
              }, v2 = k3.table.core, e2 = v2.schema.primaryKey, m2 = e2.outbound, b2 = e2.extractKey, g2 = 200, e2 = n2.db._options.modifyChunkSize;
              e2 && (g2 = "object" == typeof e2 ? e2[v2.name] || e2["*"] || 200 : e2);
              function w2(e3, t4) {
                var n3 = t4.failures, t4 = t4.numFailures;
                u2 += e3 - t4;
                for (var r3 = 0, i3 = O(n3); r3 < i3.length; r3++) {
                  var o2 = i3[r3];
                  a2.push(n3[o2]);
                }
              }
              var a2 = [], u2 = 0, t3 = [], _2 = x3 === St;
              return n2.clone().primaryKeys().then(function(f2) {
                function h2(s2) {
                  var c3 = Math.min(g2, f2.length - s2), l2 = f2.slice(s2, s2 + c3);
                  return (_2 ? Promise.resolve([]) : v2.getMany({ trans: p2, keys: l2, cache: "immutable" })).then(function(e3) {
                    var n3 = [], t4 = [], r3 = m2 ? [] : null, i3 = _2 ? l2 : [];
                    if (!_2) for (var o2 = 0; o2 < c3; ++o2) {
                      var a3 = e3[o2], u3 = { value: S(a3), primKey: f2[s2 + o2] };
                      false !== y2.call(u3, u3.value, u3) && (null == u3.value ? i3.push(f2[s2 + o2]) : m2 || 0 === st(b2(a3), b2(u3.value)) ? (t4.push(u3.value), m2 && r3.push(f2[s2 + o2])) : (i3.push(f2[s2 + o2]), n3.push(u3.value)));
                    }
                    return Promise.resolve(0 < n3.length && v2.mutate({ trans: p2, type: "add", values: n3 }).then(function(e4) {
                      for (var t5 in e4.failures) i3.splice(parseInt(t5), 1);
                      w2(n3.length, e4);
                    })).then(function() {
                      return (0 < t4.length || d2 && "object" == typeof x3) && v2.mutate({ trans: p2, type: "put", keys: r3, values: t4, criteria: d2, changeSpec: "function" != typeof x3 && x3, isAdditionalChunk: 0 < s2 }).then(function(e4) {
                        return w2(t4.length, e4);
                      });
                    }).then(function() {
                      return (0 < i3.length || d2 && _2) && v2.mutate({ trans: p2, type: "delete", keys: i3, criteria: d2, isAdditionalChunk: 0 < s2 }).then(function(e4) {
                        return ft(k3.table, i3, e4);
                      }).then(function(e4) {
                        return w2(i3.length, e4);
                      });
                    }).then(function() {
                      return f2.length > s2 + c3 && h2(s2 + g2);
                    });
                  });
                }
                var d2 = gt2(k3) && k3.limit === 1 / 0 && ("function" != typeof x3 || _2) && { index: k3.index, range: k3.range };
                return h2(0).then(function() {
                  if (0 < a2.length) throw new U2("Error modifying one or more objects", a2, u2, t3);
                  return f2.length;
                });
              });
            });
          }, Et2.prototype.delete = function() {
            var i3 = this._ctx, n2 = i3.range;
            return !gt2(i3) || i3.table.schema.yProps || !i3.isPrimKey && 3 !== n2.type ? this.modify(St) : this._write(function(e2) {
              var t3 = i3.table.core.schema.primaryKey, r3 = n2;
              return i3.table.core.count({ trans: e2, query: { index: t3, range: r3 } }).then(function(n3) {
                return i3.table.core.mutate({ trans: e2, type: "deleteRange", range: r3 }).then(function(e3) {
                  var t4 = e3.failures, e3 = e3.numFailures;
                  if (e3) throw new U2("Could not delete some values", Object.keys(t4).map(function(e4) {
                    return t4[e4];
                  }), n3 - e3);
                  return n3 - e3;
                });
              });
            });
          }, Et2);
          function Et2() {
          }
          var St = function(e2, t3) {
            return t3.value = null;
          };
          function jt2(e2, t3) {
            return e2 < t3 ? -1 : e2 === t3 ? 0 : 1;
          }
          function At2(e2, t3) {
            return t3 < e2 ? -1 : e2 === t3 ? 0 : 1;
          }
          function Ct2(e2, t3, n2) {
            e2 = e2 instanceof Bt ? new e2.Collection(e2) : e2;
            return e2._ctx.error = new (n2 || TypeError)(t3), e2;
          }
          function Tt(e2) {
            return new e2.Collection(e2, function() {
              return Dt2("");
            }).limit(0);
          }
          function It2(e2, s2, n2, r3) {
            var i3, c3, l2, f2, h2, d2, p2, y2 = n2.length;
            if (!n2.every(function(e3) {
              return "string" == typeof e3;
            })) return Ct2(e2, Ze2);
            function t3(e3) {
              i3 = "next" === e3 ? function(e4) {
                return e4.toUpperCase();
              } : function(e4) {
                return e4.toLowerCase();
              }, c3 = "next" === e3 ? function(e4) {
                return e4.toLowerCase();
              } : function(e4) {
                return e4.toUpperCase();
              }, l2 = "next" === e3 ? jt2 : At2;
              var t4 = n2.map(function(e4) {
                return { lower: c3(e4), upper: i3(e4) };
              }).sort(function(e4, t5) {
                return l2(e4.lower, t5.lower);
              });
              f2 = t4.map(function(e4) {
                return e4.upper;
              }), h2 = t4.map(function(e4) {
                return e4.lower;
              }), p2 = "next" === (d2 = e3) ? "" : r3;
            }
            t3("next");
            e2 = new e2.Collection(e2, function() {
              return qt(f2[0], h2[y2 - 1] + r3);
            });
            e2._ondirectionchange = function(e3) {
              t3(e3);
            };
            var v2 = 0;
            return e2._addAlgorithm(function(e3, t4, n3) {
              var r4 = e3.key;
              if ("string" != typeof r4) return false;
              var i4 = c3(r4);
              if (s2(i4, h2, v2)) return true;
              for (var o2 = null, a2 = v2; a2 < y2; ++a2) {
                var u2 = (function(e4, t5, n4, r5, i5, o3) {
                  for (var a3 = Math.min(e4.length, r5.length), u3 = -1, s3 = 0; s3 < a3; ++s3) {
                    var c4 = t5[s3];
                    if (c4 !== r5[s3]) return i5(e4[s3], n4[s3]) < 0 ? e4.substr(0, s3) + n4[s3] + n4.substr(s3 + 1) : i5(e4[s3], r5[s3]) < 0 ? e4.substr(0, s3) + r5[s3] + n4.substr(s3 + 1) : 0 <= u3 ? e4.substr(0, u3) + t5[u3] + n4.substr(u3 + 1) : null;
                    i5(e4[s3], c4) < 0 && (u3 = s3);
                  }
                  return a3 < r5.length && "next" === o3 ? e4 + n4.substr(e4.length) : a3 < e4.length && "prev" === o3 ? e4.substr(0, n4.length) : u3 < 0 ? null : e4.substr(0, u3) + r5[u3] + n4.substr(u3 + 1);
                })(r4, i4, f2[a2], h2[a2], l2, d2);
                null === u2 && null === o2 ? v2 = a2 + 1 : (null === o2 || 0 < l2(o2, u2)) && (o2 = u2);
              }
              return t4(null !== o2 ? function() {
                e3.continue(o2 + p2);
              } : n3), false;
            }), e2;
          }
          function qt(e2, t3, n2, r3) {
            return { type: 2, lower: e2, upper: t3, lowerOpen: n2, upperOpen: r3 };
          }
          function Dt2(e2) {
            return { type: 1, lower: e2, upper: e2 };
          }
          var Bt = (Object.defineProperty(Rt2.prototype, "Collection", { get: function() {
            return this._ctx.table.db.Collection;
          }, enumerable: false, configurable: true }), Rt2.prototype.between = function(e2, t3, n2, r3) {
            n2 = false !== n2, r3 = true === r3;
            try {
              return 0 < this._cmp(e2, t3) || 0 === this._cmp(e2, t3) && (n2 || r3) && (!n2 || !r3) ? Tt(this) : new this.Collection(this, function() {
                return qt(e2, t3, !n2, !r3);
              });
            } catch (e3) {
              return Ct2(this, Je2);
            }
          }, Rt2.prototype.equals = function(e2) {
            return null == e2 ? Ct2(this, Je2) : new this.Collection(this, function() {
              return Dt2(e2);
            });
          }, Rt2.prototype.above = function(e2) {
            return null == e2 ? Ct2(this, Je2) : new this.Collection(this, function() {
              return qt(e2, void 0, true);
            });
          }, Rt2.prototype.aboveOrEqual = function(e2) {
            return null == e2 ? Ct2(this, Je2) : new this.Collection(this, function() {
              return qt(e2, void 0, false);
            });
          }, Rt2.prototype.below = function(e2) {
            return null == e2 ? Ct2(this, Je2) : new this.Collection(this, function() {
              return qt(void 0, e2, false, true);
            });
          }, Rt2.prototype.belowOrEqual = function(e2) {
            return null == e2 ? Ct2(this, Je2) : new this.Collection(this, function() {
              return qt(void 0, e2);
            });
          }, Rt2.prototype.startsWith = function(e2) {
            return "string" != typeof e2 ? Ct2(this, Ze2) : this.between(e2, e2 + He, true, true);
          }, Rt2.prototype.startsWithIgnoreCase = function(e2) {
            return "" === e2 ? this.startsWith(e2) : It2(this, function(e3, t3) {
              return 0 === e3.indexOf(t3[0]);
            }, [e2], He);
          }, Rt2.prototype.equalsIgnoreCase = function(e2) {
            return It2(this, function(e3, t3) {
              return e3 === t3[0];
            }, [e2], "");
          }, Rt2.prototype.anyOfIgnoreCase = function() {
            var e2 = D2.apply(q, arguments);
            return 0 === e2.length ? Tt(this) : It2(this, function(e3, t3) {
              return -1 !== t3.indexOf(e3);
            }, e2, "");
          }, Rt2.prototype.startsWithAnyOfIgnoreCase = function() {
            var e2 = D2.apply(q, arguments);
            return 0 === e2.length ? Tt(this) : It2(this, function(t3, e3) {
              return e3.some(function(e4) {
                return 0 === t3.indexOf(e4);
              });
            }, e2, He);
          }, Rt2.prototype.anyOf = function() {
            var t3 = this, i3 = D2.apply(q, arguments), o2 = this._cmp;
            try {
              i3.sort(o2);
            } catch (e3) {
              return Ct2(this, Je2);
            }
            if (0 === i3.length) return Tt(this);
            var e2 = new this.Collection(this, function() {
              return qt(i3[0], i3[i3.length - 1]);
            });
            e2._ondirectionchange = function(e3) {
              o2 = "next" === e3 ? t3._ascending : t3._descending, i3.sort(o2);
            };
            var a2 = 0;
            return e2._addAlgorithm(function(e3, t4, n2) {
              for (var r3 = e3.key; 0 < o2(r3, i3[a2]); ) if (++a2 === i3.length) return t4(n2), false;
              return 0 === o2(r3, i3[a2]) || (t4(function() {
                e3.continue(i3[a2]);
              }), false);
            }), e2;
          }, Rt2.prototype.notEqual = function(e2) {
            return this.inAnyRange([[-1 / 0, e2], [e2, this.db._maxKey]], { includeLowers: false, includeUppers: false });
          }, Rt2.prototype.noneOf = function() {
            var e2 = D2.apply(q, arguments);
            if (0 === e2.length) return new this.Collection(this);
            try {
              e2.sort(this._ascending);
            } catch (e3) {
              return Ct2(this, Je2);
            }
            var t3 = e2.reduce(function(e3, t4) {
              return e3 ? e3.concat([[e3[e3.length - 1][1], t4]]) : [[-1 / 0, t4]];
            }, null);
            return t3.push([e2[e2.length - 1], this.db._maxKey]), this.inAnyRange(t3, { includeLowers: false, includeUppers: false });
          }, Rt2.prototype.inAnyRange = function(e2, t3) {
            var o2 = this, a2 = this._cmp, u2 = this._ascending, n2 = this._descending, s2 = this._min, c3 = this._max;
            if (0 === e2.length) return Tt(this);
            if (!e2.every(function(e3) {
              return void 0 !== e3[0] && void 0 !== e3[1] && u2(e3[0], e3[1]) <= 0;
            })) return Ct2(this, "First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower", Y2.InvalidArgument);
            var r3 = !t3 || false !== t3.includeLowers, i3 = t3 && true === t3.includeUppers;
            var l2, f2 = u2;
            function h2(e3, t4) {
              return f2(e3[0], t4[0]);
            }
            try {
              (l2 = e2.reduce(function(e3, t4) {
                for (var n3 = 0, r4 = e3.length; n3 < r4; ++n3) {
                  var i4 = e3[n3];
                  if (a2(t4[0], i4[1]) < 0 && 0 < a2(t4[1], i4[0])) {
                    i4[0] = s2(i4[0], t4[0]), i4[1] = c3(i4[1], t4[1]);
                    break;
                  }
                }
                return n3 === r4 && e3.push(t4), e3;
              }, [])).sort(h2);
            } catch (e3) {
              return Ct2(this, Je2);
            }
            var d2 = 0, p2 = i3 ? function(e3) {
              return 0 < u2(e3, l2[d2][1]);
            } : function(e3) {
              return 0 <= u2(e3, l2[d2][1]);
            }, y2 = r3 ? function(e3) {
              return 0 < n2(e3, l2[d2][0]);
            } : function(e3) {
              return 0 <= n2(e3, l2[d2][0]);
            };
            var v2 = p2, e2 = new this.Collection(this, function() {
              return qt(l2[0][0], l2[l2.length - 1][1], !r3, !i3);
            });
            return e2._ondirectionchange = function(e3) {
              f2 = "next" === e3 ? (v2 = p2, u2) : (v2 = y2, n2), l2.sort(h2);
            }, e2._addAlgorithm(function(e3, t4, n3) {
              for (var r4, i4 = e3.key; v2(i4); ) if (++d2 === l2.length) return t4(n3), false;
              return !p2(r4 = i4) && !y2(r4) || (0 === o2._cmp(i4, l2[d2][1]) || 0 === o2._cmp(i4, l2[d2][0]) || t4(function() {
                f2 === u2 ? e3.continue(l2[d2][0]) : e3.continue(l2[d2][1]);
              }), false);
            }), e2;
          }, Rt2.prototype.startsWithAnyOf = function() {
            var e2 = D2.apply(q, arguments);
            return e2.every(function(e3) {
              return "string" == typeof e3;
            }) ? 0 === e2.length ? Tt(this) : this.inAnyRange(e2.map(function(e3) {
              return [e3, e3 + He];
            })) : Ct2(this, "startsWithAnyOf() only works with strings");
          }, Rt2);
          function Rt2() {
          }
          function Ft2(t3) {
            return Ie2(function(e2) {
              return Mt(e2), t3(e2.target.error), false;
            });
          }
          function Mt(e2) {
            e2.stopPropagation && e2.stopPropagation(), e2.preventDefault && e2.preventDefault();
          }
          var Nt = "storagemutated", Lt2 = "x-storagemutated-1", Ut = mt(null, Nt), Vt2 = (zt2.prototype._lock = function() {
            return y(!me2.global), ++this._reculock, 1 !== this._reculock || me2.global || (me2.lockOwnerFor = this), this;
          }, zt2.prototype._unlock = function() {
            if (y(!me2.global), 0 == --this._reculock) for (me2.global || (me2.lockOwnerFor = null); 0 < this._blockedFuncs.length && !this._locked(); ) {
              var e2 = this._blockedFuncs.shift();
              try {
                $e2(e2[1], e2[0]);
              } catch (e3) {
              }
            }
            return this;
          }, zt2.prototype._locked = function() {
            return this._reculock && me2.lockOwnerFor !== this;
          }, zt2.prototype.create = function(t3) {
            var n2 = this;
            if (!this.mode) return this;
            var e2 = this.db.idbdb, r3 = this.db._state.dbOpenError;
            if (y(!this.idbtrans), !t3 && !e2) switch (r3 && r3.name) {
              case "DatabaseClosedError":
                throw new Y2.DatabaseClosed(r3);
              case "MissingAPIError":
                throw new Y2.MissingAPI(r3.message, r3);
              default:
                throw new Y2.OpenFailed(r3);
            }
            if (!this.active) throw new Y2.TransactionInactive();
            return y(null === this._completion._state), (t3 = this.idbtrans = t3 || (this.db.core || e2).transaction(this.storeNames, this.mode, { durability: this.chromeTransactionDurability })).onerror = Ie2(function(e3) {
              Mt(e3), n2._reject(t3.error);
            }), t3.onabort = Ie2(function(e3) {
              Mt(e3), n2.active && n2._reject(new Y2.Abort(t3.error)), n2.active = false, n2.on("abort").fire(e3);
            }), t3.oncomplete = Ie2(function() {
              n2.active = false, n2._resolve(), "mutatedParts" in t3 && Ut.storagemutated.fire(t3.mutatedParts);
            }), this;
          }, zt2.prototype._promise = function(n2, r3, i3) {
            var o2 = this;
            if ("readwrite" === n2 && "readwrite" !== this.mode) return Xe2(new Y2.ReadOnly("Transaction is readonly"));
            if (!this.active) return Xe2(new Y2.TransactionInactive());
            if (this._locked()) return new _e2(function(e3, t3) {
              o2._blockedFuncs.push([function() {
                o2._promise(n2, r3, i3).then(e3, t3);
              }, me2]);
            });
            if (i3) return Ne2(function() {
              var e3 = new _e2(function(e4, t3) {
                o2._lock();
                var n3 = r3(e4, t3, o2);
                n3 && n3.then && n3.then(e4, t3);
              });
              return e3.finally(function() {
                return o2._unlock();
              }), e3._lib = true, e3;
            });
            var e2 = new _e2(function(e3, t3) {
              var n3 = r3(e3, t3, o2);
              n3 && n3.then && n3.then(e3, t3);
            });
            return e2._lib = true, e2;
          }, zt2.prototype._root = function() {
            return this.parent ? this.parent._root() : this;
          }, zt2.prototype.waitFor = function(e2) {
            var t3, r3 = this._root(), i3 = _e2.resolve(e2);
            r3._waitingFor ? r3._waitingFor = r3._waitingFor.then(function() {
              return i3;
            }) : (r3._waitingFor = i3, r3._waitingQueue = [], t3 = r3.idbtrans.objectStore(r3.storeNames[0]), (function e3() {
              for (++r3._spinCount; r3._waitingQueue.length; ) r3._waitingQueue.shift()();
              r3._waitingFor && (t3.get(-1 / 0).onsuccess = e3);
            })());
            var o2 = r3._waitingFor;
            return new _e2(function(t4, n2) {
              i3.then(function(e3) {
                return r3._waitingQueue.push(Ie2(t4.bind(null, e3)));
              }, function(e3) {
                return r3._waitingQueue.push(Ie2(n2.bind(null, e3)));
              }).finally(function() {
                r3._waitingFor === o2 && (r3._waitingFor = null);
              });
            });
          }, zt2.prototype.abort = function() {
            this.active && (this.active = false, this.idbtrans && this.idbtrans.abort(), this._reject(new Y2.Abort()));
          }, zt2.prototype.table = function(e2) {
            var t3 = this._memoizedTables || (this._memoizedTables = {});
            if (m(t3, e2)) return t3[e2];
            var n2 = this.schema[e2];
            if (!n2) throw new Y2.NotFound("Table " + e2 + " not part of transaction");
            n2 = new this.db.Table(e2, n2, this);
            return n2.core = this.db.core.table(e2), t3[e2] = n2;
          }, zt2);
          function zt2() {
          }
          function Wt2(e2, t3, n2, r3, i3, o2, a2, u2) {
            return { name: e2, keyPath: t3, unique: n2, multi: r3, auto: i3, compound: o2, src: (n2 && !a2 ? "&" : "") + (r3 ? "*" : "") + (i3 ? "++" : "") + Yt(t3), type: u2 };
          }
          function Yt(e2) {
            return "string" == typeof e2 ? e2 : e2 ? "[" + [].join.call(e2, "+") + "]" : "";
          }
          function $t(e2, t3, n2) {
            return { name: e2, primKey: t3, indexes: n2, mappedClass: null, idxByName: (r3 = function(e3) {
              return [e3.name, e3];
            }, n2.reduce(function(e3, t4, n3) {
              n3 = r3(t4, n3);
              return n3 && (e3[n3[0]] = n3[1]), e3;
            }, {})) };
            var r3;
          }
          var Qt2 = function(e2) {
            try {
              return e2.only([[]]), Qt2 = function() {
                return [[]];
              }, [[]];
            } catch (e3) {
              return Qt2 = function() {
                return He;
              }, He;
            }
          };
          function Gt2(t3) {
            return null == t3 ? function() {
            } : "string" == typeof t3 ? 1 === (n2 = t3).split(".").length ? function(e2) {
              return e2[n2];
            } : function(e2) {
              return g(e2, n2);
            } : function(e2) {
              return g(e2, t3);
            };
            var n2;
          }
          function Xt2(e2) {
            return [].slice.call(e2);
          }
          var Ht2 = 0;
          function Jt2(e2) {
            return null == e2 ? ":id" : "string" == typeof e2 ? e2 : "[".concat(e2.join("+"), "]");
          }
          function Zt2(e2, i3, t3) {
            function _2(e3) {
              if (3 === e3.type) return null;
              if (4 === e3.type) throw new Error("Cannot convert never type to IDBKeyRange");
              var t4 = e3.lower, n3 = e3.upper, r4 = e3.lowerOpen, e3 = e3.upperOpen;
              return void 0 === t4 ? void 0 === n3 ? null : i3.upperBound(n3, !!e3) : void 0 === n3 ? i3.lowerBound(t4, !!r4) : i3.bound(t4, n3, !!r4, !!e3);
            }
            function n2(e3) {
              var h2, w2 = e3.name;
              return { name: w2, schema: e3, mutate: function(e4) {
                var y2 = e4.trans, v2 = e4.type, m2 = e4.keys, b2 = e4.values, g2 = e4.range;
                return new Promise(function(t4, e5) {
                  t4 = Ie2(t4);
                  var n3 = y2.objectStore(w2), r4 = null == n3.keyPath, i4 = "put" === v2 || "add" === v2;
                  if (!i4 && "delete" !== v2 && "deleteRange" !== v2) throw new Error("Invalid operation type: " + v2);
                  var o3, a3 = (m2 || b2 || { length: 1 }).length;
                  if (m2 && b2 && m2.length !== b2.length) throw new Error("Given keys array must have same length as given values array.");
                  if (0 === a3) return t4({ numFailures: 0, failures: {}, results: [], lastResult: void 0 });
                  function u3(e6) {
                    ++l2, Mt(e6);
                  }
                  var s3 = [], c4 = [], l2 = 0;
                  if ("deleteRange" === v2) {
                    if (4 === g2.type) return t4({ numFailures: l2, failures: c4, results: [], lastResult: void 0 });
                    3 === g2.type ? s3.push(o3 = n3.clear()) : s3.push(o3 = n3.delete(_2(g2)));
                  } else {
                    var r4 = i4 ? r4 ? [b2, m2] : [b2, null] : [m2, null], f2 = r4[0], h3 = r4[1];
                    if (i4) for (var d2 = 0; d2 < a3; ++d2) s3.push(o3 = h3 && void 0 !== h3[d2] ? n3[v2](f2[d2], h3[d2]) : n3[v2](f2[d2])), o3.onerror = u3;
                    else for (d2 = 0; d2 < a3; ++d2) s3.push(o3 = n3[v2](f2[d2])), o3.onerror = u3;
                  }
                  function p2(e6) {
                    e6 = e6.target.result, s3.forEach(function(e7, t5) {
                      return null != e7.error && (c4[t5] = e7.error);
                    }), t4({ numFailures: l2, failures: c4, results: "delete" === v2 ? m2 : s3.map(function(e7) {
                      return e7.result;
                    }), lastResult: e6 });
                  }
                  o3.onerror = function(e6) {
                    u3(e6), p2(e6);
                  }, o3.onsuccess = p2;
                });
              }, getMany: function(e4) {
                var f2 = e4.trans, h3 = e4.keys;
                return new Promise(function(t4, e5) {
                  t4 = Ie2(t4);
                  for (var n3, r4 = f2.objectStore(w2), i4 = h3.length, o3 = new Array(i4), a3 = 0, u3 = 0, s3 = function(e6) {
                    e6 = e6.target;
                    o3[e6._pos] = e6.result, ++u3 === a3 && t4(o3);
                  }, c4 = Ft2(e5), l2 = 0; l2 < i4; ++l2) null != h3[l2] && ((n3 = r4.get(h3[l2]))._pos = l2, n3.onsuccess = s3, n3.onerror = c4, ++a3);
                  0 === a3 && t4(o3);
                });
              }, get: function(e4) {
                var r4 = e4.trans, i4 = e4.key;
                return new Promise(function(t4, e5) {
                  t4 = Ie2(t4);
                  var n3 = r4.objectStore(w2).get(i4);
                  n3.onsuccess = function(e6) {
                    return t4(e6.target.result);
                  }, n3.onerror = Ft2(e5);
                });
              }, query: (h2 = s2, function(f2) {
                return new Promise(function(n3, e4) {
                  n3 = Ie2(n3);
                  var r4, i4, o3, t4 = f2.trans, a3 = f2.values, u3 = f2.limit, s3 = f2.query, c4 = u3 === 1 / 0 ? void 0 : u3, l2 = s3.index, s3 = s3.range, t4 = t4.objectStore(w2), l2 = l2.isPrimaryKey ? t4 : t4.index(l2.name), s3 = _2(s3);
                  if (0 === u3) return n3({ result: [] });
                  h2 ? ((c4 = a3 ? l2.getAll(s3, c4) : l2.getAllKeys(s3, c4)).onsuccess = function(e5) {
                    return n3({ result: e5.target.result });
                  }, c4.onerror = Ft2(e4)) : (r4 = 0, i4 = !a3 && "openKeyCursor" in l2 ? l2.openKeyCursor(s3) : l2.openCursor(s3), o3 = [], i4.onsuccess = function(e5) {
                    var t5 = i4.result;
                    return t5 ? (o3.push(a3 ? t5.value : t5.primaryKey), ++r4 === u3 ? n3({ result: o3 }) : void t5.continue()) : n3({ result: o3 });
                  }, i4.onerror = Ft2(e4));
                });
              }), openCursor: function(e4) {
                var c4 = e4.trans, o3 = e4.values, a3 = e4.query, u3 = e4.reverse, l2 = e4.unique;
                return new Promise(function(t4, n3) {
                  t4 = Ie2(t4);
                  var e5 = a3.index, r4 = a3.range, i4 = c4.objectStore(w2), i4 = e5.isPrimaryKey ? i4 : i4.index(e5.name), e5 = u3 ? l2 ? "prevunique" : "prev" : l2 ? "nextunique" : "next", s3 = !o3 && "openKeyCursor" in i4 ? i4.openKeyCursor(_2(r4), e5) : i4.openCursor(_2(r4), e5);
                  s3.onerror = Ft2(n3), s3.onsuccess = Ie2(function(e6) {
                    var r5, i5, o4, a4, u4 = s3.result;
                    u4 ? (u4.___id = ++Ht2, u4.done = false, r5 = u4.continue.bind(u4), i5 = (i5 = u4.continuePrimaryKey) && i5.bind(u4), o4 = u4.advance.bind(u4), a4 = function() {
                      throw new Error("Cursor not stopped");
                    }, u4.trans = c4, u4.stop = u4.continue = u4.continuePrimaryKey = u4.advance = function() {
                      throw new Error("Cursor not started");
                    }, u4.fail = Ie2(n3), u4.next = function() {
                      var e7 = this, t5 = 1;
                      return this.start(function() {
                        return t5-- ? e7.continue() : e7.stop();
                      }).then(function() {
                        return e7;
                      });
                    }, u4.start = function(e7) {
                      function t5() {
                        if (s3.result) try {
                          e7();
                        } catch (e8) {
                          u4.fail(e8);
                        }
                        else u4.done = true, u4.start = function() {
                          throw new Error("Cursor behind last entry");
                        }, u4.stop();
                      }
                      var n4 = new Promise(function(t6, e8) {
                        t6 = Ie2(t6), s3.onerror = Ft2(e8), u4.fail = e8, u4.stop = function(e9) {
                          u4.stop = u4.continue = u4.continuePrimaryKey = u4.advance = a4, t6(e9);
                        };
                      });
                      return s3.onsuccess = Ie2(function(e8) {
                        s3.onsuccess = t5, t5();
                      }), u4.continue = r5, u4.continuePrimaryKey = i5, u4.advance = o4, t5(), n4;
                    }, t4(u4)) : t4(null);
                  }, n3);
                });
              }, count: function(e4) {
                var t4 = e4.query, i4 = e4.trans, o3 = t4.index, a3 = t4.range;
                return new Promise(function(t5, e5) {
                  var n3 = i4.objectStore(w2), r4 = o3.isPrimaryKey ? n3 : n3.index(o3.name), n3 = _2(a3), r4 = n3 ? r4.count(n3) : r4.count();
                  r4.onsuccess = Ie2(function(e6) {
                    return t5(e6.target.result);
                  }), r4.onerror = Ft2(e5);
                });
              } };
            }
            var r3, o2, a2, u2 = (o2 = t3, a2 = Xt2((r3 = e2).objectStoreNames), { schema: { name: r3.name, tables: a2.map(function(e3) {
              return o2.objectStore(e3);
            }).map(function(t4) {
              var e3 = t4.keyPath, n3 = t4.autoIncrement, r4 = x2(e3), i4 = {}, n3 = { name: t4.name, primaryKey: { name: null, isPrimaryKey: true, outbound: null == e3, compound: r4, keyPath: e3, autoIncrement: n3, unique: true, extractKey: Gt2(e3) }, indexes: Xt2(t4.indexNames).map(function(e4) {
                return t4.index(e4);
              }).map(function(e4) {
                var t5 = e4.name, n4 = e4.unique, r5 = e4.multiEntry, e4 = e4.keyPath, r5 = { name: t5, compound: x2(e4), keyPath: e4, unique: n4, multiEntry: r5, extractKey: Gt2(e4) };
                return i4[Jt2(e4)] = r5;
              }), getIndexByKeyPath: function(e4) {
                return i4[Jt2(e4)];
              } };
              return i4[":id"] = n3.primaryKey, null != e3 && (i4[Jt2(e3)] = n3.primaryKey), n3;
            }) }, hasGetAll: 0 < a2.length && "getAll" in o2.objectStore(a2[0]) && !("undefined" != typeof navigator && /Safari/.test(navigator.userAgent) && !/(Chrome\/|Edge\/)/.test(navigator.userAgent) && [].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1] < 604) }), t3 = u2.schema, s2 = u2.hasGetAll, u2 = t3.tables.map(n2), c3 = {};
            return u2.forEach(function(e3) {
              return c3[e3.name] = e3;
            }), { stack: "dbcore", transaction: e2.transaction.bind(e2), table: function(e3) {
              if (!c3[e3]) throw new Error("Table '".concat(e3, "' not found"));
              return c3[e3];
            }, MIN_KEY: -1 / 0, MAX_KEY: Qt2(i3), schema: t3 };
          }
          function en(e2, t3, n2, r3) {
            var i3 = n2.IDBKeyRange;
            return n2.indexedDB, { dbcore: (r3 = Zt2(t3, i3, r3), e2.dbcore.reduce(function(e3, t4) {
              t4 = t4.create;
              return _(_({}, e3), t4(e3));
            }, r3)) };
          }
          function tn2(n2, e2) {
            var t3 = e2.db, e2 = en(n2._middlewares, t3, n2._deps, e2);
            n2.core = e2.dbcore, n2.tables.forEach(function(e3) {
              var t4 = e3.name;
              n2.core.schema.tables.some(function(e4) {
                return e4.name === t4;
              }) && (e3.core = n2.core.table(t4), n2[t4] instanceof n2.Table && (n2[t4].core = e3.core));
            });
          }
          function nn(i3, e2, t3, o2) {
            t3.forEach(function(n2) {
              var r3 = o2[n2];
              e2.forEach(function(e3) {
                var t4 = (function e4(t5, n3) {
                  return h(t5, n3) || (t5 = c2(t5)) && e4(t5, n3);
                })(e3, n2);
                (!t4 || "value" in t4 && void 0 === t4.value) && (e3 === i3.Transaction.prototype || e3 instanceof i3.Transaction ? l(e3, n2, { get: function() {
                  return this.table(n2);
                }, set: function(e4) {
                  u(this, n2, { value: e4, writable: true, configurable: true, enumerable: true });
                } }) : e3[n2] = new i3.Table(n2, r3));
              });
            });
          }
          function rn(n2, e2) {
            e2.forEach(function(e3) {
              for (var t3 in e3) e3[t3] instanceof n2.Table && delete e3[t3];
            });
          }
          function on(e2, t3) {
            return e2._cfg.version - t3._cfg.version;
          }
          function an2(n2, r3, i3, e2) {
            var o2 = n2._dbSchema;
            i3.objectStoreNames.contains("$meta") && !o2.$meta && (o2.$meta = $t("$meta", pn2("")[0], []), n2._storeNames.push("$meta"));
            var a2 = n2._createTransaction("readwrite", n2._storeNames, o2);
            a2.create(i3), a2._completion.catch(e2);
            var u2 = a2._reject.bind(a2), s2 = me2.transless || me2;
            Ne2(function() {
              return me2.trans = a2, me2.transless = s2, 0 !== r3 ? (tn2(n2, i3), t3 = r3, ((e3 = a2).storeNames.includes("$meta") ? e3.table("$meta").get("version").then(function(e4) {
                return null != e4 ? e4 : t3;
              }) : _e2.resolve(t3)).then(function(e4) {
                return c3 = e4, l2 = a2, f2 = i3, t4 = [], e4 = (s3 = n2)._versions, h2 = s3._dbSchema = hn2(0, s3.idbdb, f2), 0 !== (e4 = e4.filter(function(e5) {
                  return e5._cfg.version >= c3;
                })).length ? (e4.forEach(function(u3) {
                  t4.push(function() {
                    var t5 = h2, e5 = u3._cfg.dbschema;
                    dn2(s3, t5, f2), dn2(s3, e5, f2), h2 = s3._dbSchema = e5;
                    var n3 = sn(t5, e5);
                    n3.add.forEach(function(e6) {
                      cn(f2, e6[0], e6[1].primKey, e6[1].indexes);
                    }), n3.change.forEach(function(e6) {
                      if (e6.recreate) throw new Y2.Upgrade("Not yet support for changing primary key");
                      var t6 = f2.objectStore(e6.name);
                      e6.add.forEach(function(e7) {
                        return fn2(t6, e7);
                      }), e6.change.forEach(function(e7) {
                        t6.deleteIndex(e7.name), fn2(t6, e7);
                      }), e6.del.forEach(function(e7) {
                        return t6.deleteIndex(e7);
                      });
                    });
                    var r4 = u3._cfg.contentUpgrade;
                    if (r4 && u3._cfg.version > c3) {
                      tn2(s3, f2), l2._memoizedTables = {};
                      var i4 = k2(e5);
                      n3.del.forEach(function(e6) {
                        i4[e6] = t5[e6];
                      }), rn(s3, [s3.Transaction.prototype]), nn(s3, [s3.Transaction.prototype], O(i4), i4), l2.schema = i4;
                      var o3, a3 = B(r4);
                      a3 && Le2();
                      n3 = _e2.follow(function() {
                        var e6;
                        (o3 = r4(l2)) && a3 && (e6 = Ue2.bind(null, null), o3.then(e6, e6));
                      });
                      return o3 && "function" == typeof o3.then ? _e2.resolve(o3) : n3.then(function() {
                        return o3;
                      });
                    }
                  }), t4.push(function(e5) {
                    var t5, n3, r4 = u3._cfg.dbschema;
                    t5 = r4, n3 = e5, [].slice.call(n3.db.objectStoreNames).forEach(function(e6) {
                      return null == t5[e6] && n3.db.deleteObjectStore(e6);
                    }), rn(s3, [s3.Transaction.prototype]), nn(s3, [s3.Transaction.prototype], s3._storeNames, s3._dbSchema), l2.schema = s3._dbSchema;
                  }), t4.push(function(e5) {
                    s3.idbdb.objectStoreNames.contains("$meta") && (Math.ceil(s3.idbdb.version / 10) === u3._cfg.version ? (s3.idbdb.deleteObjectStore("$meta"), delete s3._dbSchema.$meta, s3._storeNames = s3._storeNames.filter(function(e6) {
                      return "$meta" !== e6;
                    })) : e5.objectStore("$meta").put(u3._cfg.version, "version"));
                  });
                }), (function e5() {
                  return t4.length ? _e2.resolve(t4.shift()(l2.idbtrans)).then(e5) : _e2.resolve();
                })().then(function() {
                  ln(h2, f2);
                })) : _e2.resolve();
                var s3, c3, l2, f2, t4, h2;
              }).catch(u2)) : (O(o2).forEach(function(e4) {
                cn(i3, e4, o2[e4].primKey, o2[e4].indexes);
              }), tn2(n2, i3), void _e2.follow(function() {
                return n2.on.populate.fire(a2);
              }).catch(u2));
              var e3, t3;
            });
          }
          function un2(e2, r3) {
            ln(e2._dbSchema, r3), r3.db.version % 10 != 0 || r3.objectStoreNames.contains("$meta") || r3.db.createObjectStore("$meta").add(Math.ceil(r3.db.version / 10 - 1), "version");
            var t3 = hn2(0, e2.idbdb, r3);
            dn2(e2, e2._dbSchema, r3);
            for (var n2 = 0, i3 = sn(t3, e2._dbSchema).change; n2 < i3.length; n2++) {
              var o2 = (function(t4) {
                if (t4.change.length || t4.recreate) return console.warn("Unable to patch indexes of table ".concat(t4.name, " because it has changes on the type of index or primary key.")), { value: void 0 };
                var n3 = r3.objectStore(t4.name);
                t4.add.forEach(function(e3) {
                  ie2 && console.debug("Dexie upgrade patch: Creating missing index ".concat(t4.name, ".").concat(e3.src)), fn2(n3, e3);
                });
              })(i3[n2]);
              if ("object" == typeof o2) return o2.value;
            }
          }
          function sn(e2, t3) {
            var n2, r3 = { del: [], add: [], change: [] };
            for (n2 in e2) t3[n2] || r3.del.push(n2);
            for (n2 in t3) {
              var i3 = e2[n2], o2 = t3[n2];
              if (i3) {
                var a2 = { name: n2, def: o2, recreate: false, del: [], add: [], change: [] };
                if ("" + (i3.primKey.keyPath || "") != "" + (o2.primKey.keyPath || "") || i3.primKey.auto !== o2.primKey.auto) a2.recreate = true, r3.change.push(a2);
                else {
                  var u2 = i3.idxByName, s2 = o2.idxByName, c3 = void 0;
                  for (c3 in u2) s2[c3] || a2.del.push(c3);
                  for (c3 in s2) {
                    var l2 = u2[c3], f2 = s2[c3];
                    l2 ? l2.src !== f2.src && a2.change.push(f2) : a2.add.push(f2);
                  }
                  (0 < a2.del.length || 0 < a2.add.length || 0 < a2.change.length) && r3.change.push(a2);
                }
              } else r3.add.push([n2, o2]);
            }
            return r3;
          }
          function cn(e2, t3, n2, r3) {
            var i3 = e2.db.createObjectStore(t3, n2.keyPath ? { keyPath: n2.keyPath, autoIncrement: n2.auto } : { autoIncrement: n2.auto });
            return r3.forEach(function(e3) {
              return fn2(i3, e3);
            }), i3;
          }
          function ln(t3, n2) {
            O(t3).forEach(function(e2) {
              n2.db.objectStoreNames.contains(e2) || (ie2 && console.debug("Dexie: Creating missing table", e2), cn(n2, e2, t3[e2].primKey, t3[e2].indexes));
            });
          }
          function fn2(e2, t3) {
            e2.createIndex(t3.name, t3.keyPath, { unique: t3.unique, multiEntry: t3.multi });
          }
          function hn2(e2, t3, u2) {
            var s2 = {};
            return b(t3.objectStoreNames, 0).forEach(function(e3) {
              for (var t4 = u2.objectStore(e3), n2 = Wt2(Yt(a2 = t4.keyPath), a2 || "", true, false, !!t4.autoIncrement, a2 && "string" != typeof a2, true), r3 = [], i3 = 0; i3 < t4.indexNames.length; ++i3) {
                var o2 = t4.index(t4.indexNames[i3]), a2 = o2.keyPath, o2 = Wt2(o2.name, a2, !!o2.unique, !!o2.multiEntry, false, a2 && "string" != typeof a2, false);
                r3.push(o2);
              }
              s2[e3] = $t(e3, n2, r3);
            }), s2;
          }
          function dn2(e2, t3, n2) {
            for (var r3 = n2.db.objectStoreNames, i3 = 0; i3 < r3.length; ++i3) {
              var o2 = r3[i3], a2 = n2.objectStore(o2);
              e2._hasGetAll = "getAll" in a2;
              for (var u2 = 0; u2 < a2.indexNames.length; ++u2) {
                var s2 = a2.indexNames[u2], c3 = a2.index(s2).keyPath, l2 = "string" == typeof c3 ? c3 : "[" + b(c3).join("+") + "]";
                !t3[o2] || (c3 = t3[o2].idxByName[l2]) && (c3.name = s2, delete t3[o2].idxByName[l2], t3[o2].idxByName[s2] = c3);
              }
            }
            "undefined" != typeof navigator && /Safari/.test(navigator.userAgent) && !/(Chrome\/|Edge\/)/.test(navigator.userAgent) && f.WorkerGlobalScope && f instanceof f.WorkerGlobalScope && [].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1] < 604 && (e2._hasGetAll = false);
          }
          function pn2(e2) {
            return e2.split(",").map(function(e3, t3) {
              var n2 = e3.split(":"), r3 = null === (i3 = n2[1]) || void 0 === i3 ? void 0 : i3.trim(), i3 = (e3 = n2[0].trim()).replace(/([&*]|\+\+)/g, ""), n2 = /^\[/.test(i3) ? i3.match(/^\[(.*)\]$/)[1].split("+") : i3;
              return Wt2(i3, n2 || null, /\&/.test(e3), /\*/.test(e3), /\+\+/.test(e3), x2(n2), 0 === t3, r3);
            });
          }
          var yn = (vn.prototype._createTableSchema = $t, vn.prototype._parseIndexSyntax = pn2, vn.prototype._parseStoresSpec = function(r3, i3) {
            var o2 = this;
            O(r3).forEach(function(e2) {
              if (null !== r3[e2]) {
                var t3 = o2._parseIndexSyntax(r3[e2]), n2 = t3.shift();
                if (!n2) throw new Y2.Schema("Invalid schema for table " + e2 + ": " + r3[e2]);
                if (n2.unique = true, n2.multi) throw new Y2.Schema("Primary key cannot be multiEntry*");
                t3.forEach(function(e3) {
                  if (e3.auto) throw new Y2.Schema("Only primary key can be marked as autoIncrement (++)");
                  if (!e3.keyPath) throw new Y2.Schema("Index must have a name and cannot be an empty string");
                });
                t3 = o2._createTableSchema(e2, n2, t3);
                i3[e2] = t3;
              }
            });
          }, vn.prototype.stores = function(e2) {
            var t3 = this.db;
            this._cfg.storesSource = this._cfg.storesSource ? a(this._cfg.storesSource, e2) : e2;
            var e2 = t3._versions, n2 = {}, r3 = {};
            return e2.forEach(function(e3) {
              a(n2, e3._cfg.storesSource), r3 = e3._cfg.dbschema = {}, e3._parseStoresSpec(n2, r3);
            }), t3._dbSchema = r3, rn(t3, [t3._allTables, t3, t3.Transaction.prototype]), nn(t3, [t3._allTables, t3, t3.Transaction.prototype, this._cfg.tables], O(r3), r3), t3._storeNames = O(r3), this;
          }, vn.prototype.upgrade = function(e2) {
            return this._cfg.contentUpgrade = re2(this._cfg.contentUpgrade || G, e2), this;
          }, vn);
          function vn() {
          }
          function mn2(e2, t3) {
            var n2 = e2._dbNamesDB;
            return n2 || (n2 = e2._dbNamesDB = new nr2(tt2, { addons: [], indexedDB: e2, IDBKeyRange: t3 })).version(1).stores({ dbnames: "name" }), n2.table("dbnames");
          }
          function bn2(e2) {
            return e2 && "function" == typeof e2.databases;
          }
          function gn2(e2) {
            return Ne2(function() {
              return me2.letThrough = true, e2();
            });
          }
          function wn2(e2) {
            return !("from" in e2);
          }
          var _n2 = function(e2, t3) {
            if (!this) {
              var n2 = new _n2();
              return e2 && "d" in e2 && a(n2, e2), n2;
            }
            a(this, arguments.length ? { d: 1, from: e2, to: 1 < arguments.length ? t3 : e2 } : { d: 0 });
          };
          function xn2(e2, t3, n2) {
            var r3 = st(t3, n2);
            if (!isNaN(r3)) {
              if (0 < r3) throw RangeError();
              if (wn2(e2)) return a(e2, { from: t3, to: n2, d: 1 });
              var i3 = e2.l, r3 = e2.r;
              if (st(n2, e2.from) < 0) return i3 ? xn2(i3, t3, n2) : e2.l = { from: t3, to: n2, d: 1, l: null, r: null }, Kn2(e2);
              if (0 < st(t3, e2.to)) return r3 ? xn2(r3, t3, n2) : e2.r = { from: t3, to: n2, d: 1, l: null, r: null }, Kn2(e2);
              st(t3, e2.from) < 0 && (e2.from = t3, e2.l = null, e2.d = r3 ? r3.d + 1 : 1), 0 < st(n2, e2.to) && (e2.to = n2, e2.r = null, e2.d = e2.l ? e2.l.d + 1 : 1);
              n2 = !e2.r;
              i3 && !e2.l && kn2(e2, i3), r3 && n2 && kn2(e2, r3);
            }
          }
          function kn2(e2, t3) {
            wn2(t3) || (function e3(t4, n2) {
              var r3 = n2.from, i3 = n2.to, o2 = n2.l, n2 = n2.r;
              xn2(t4, r3, i3), o2 && e3(t4, o2), n2 && e3(t4, n2);
            })(e2, t3);
          }
          function On2(e2, t3) {
            var n2 = Pn2(t3), r3 = n2.next();
            if (r3.done) return false;
            for (var i3 = r3.value, o2 = Pn2(e2), a2 = o2.next(i3.from), u2 = a2.value; !r3.done && !a2.done; ) {
              if (st(u2.from, i3.to) <= 0 && 0 <= st(u2.to, i3.from)) return true;
              st(i3.from, u2.from) < 0 ? i3 = (r3 = n2.next(u2.from)).value : u2 = (a2 = o2.next(i3.from)).value;
            }
            return false;
          }
          function Pn2(e2) {
            var n2 = wn2(e2) ? null : { s: 0, n: e2 };
            return { next: function(e3) {
              for (var t3 = 0 < arguments.length; n2; ) switch (n2.s) {
                case 0:
                  if (n2.s = 1, t3) for (; n2.n.l && st(e3, n2.n.from) < 0; ) n2 = { up: n2, n: n2.n.l, s: 1 };
                  else for (; n2.n.l; ) n2 = { up: n2, n: n2.n.l, s: 1 };
                case 1:
                  if (n2.s = 2, !t3 || st(e3, n2.n.to) <= 0) return { value: n2.n, done: false };
                case 2:
                  if (n2.n.r) {
                    n2.s = 3, n2 = { up: n2, n: n2.n.r, s: 0 };
                    continue;
                  }
                case 3:
                  n2 = n2.up;
              }
              return { done: true };
            } };
          }
          function Kn2(e2) {
            var t3, n2, r3 = ((null === (t3 = e2.r) || void 0 === t3 ? void 0 : t3.d) || 0) - ((null === (n2 = e2.l) || void 0 === n2 ? void 0 : n2.d) || 0), i3 = 1 < r3 ? "r" : r3 < -1 ? "l" : "";
            i3 && (t3 = "r" == i3 ? "l" : "r", n2 = _({}, e2), r3 = e2[i3], e2.from = r3.from, e2.to = r3.to, e2[i3] = r3[i3], n2[i3] = r3[t3], (e2[t3] = n2).d = En2(n2)), e2.d = En2(e2);
          }
          function En2(e2) {
            var t3 = e2.r, e2 = e2.l;
            return (t3 ? e2 ? Math.max(t3.d, e2.d) : t3.d : e2 ? e2.d : 0) + 1;
          }
          function Sn2(t3, n2) {
            return O(n2).forEach(function(e2) {
              t3[e2] ? kn2(t3[e2], n2[e2]) : t3[e2] = (function e3(t4) {
                var n3, r3, i3 = {};
                for (n3 in t4) m(t4, n3) && (r3 = t4[n3], i3[n3] = !r3 || "object" != typeof r3 || K2.has(r3.constructor) ? r3 : e3(r3));
                return i3;
              })(n2[e2]);
            }), t3;
          }
          function jn2(t3, n2) {
            return t3.all || n2.all || Object.keys(t3).some(function(e2) {
              return n2[e2] && On2(n2[e2], t3[e2]);
            });
          }
          r2(_n2.prototype, ((F2 = { add: function(e2) {
            return kn2(this, e2), this;
          }, addKey: function(e2) {
            return xn2(this, e2, e2), this;
          }, addKeys: function(e2) {
            var t3 = this;
            return e2.forEach(function(e3) {
              return xn2(t3, e3, e3);
            }), this;
          }, hasKey: function(e2) {
            var t3 = Pn2(this).next(e2).value;
            return t3 && st(t3.from, e2) <= 0 && 0 <= st(t3.to, e2);
          } })[C2] = function() {
            return Pn2(this);
          }, F2));
          var An2 = {}, Cn2 = {}, Tn2 = false;
          function In2(e2) {
            Sn2(Cn2, e2), Tn2 || (Tn2 = true, setTimeout(function() {
              Tn2 = false, qn2(Cn2, !(Cn2 = {}));
            }, 0));
          }
          function qn2(e2, t3) {
            void 0 === t3 && (t3 = false);
            var n2 = /* @__PURE__ */ new Set();
            if (e2.all) for (var r3 = 0, i3 = Object.values(An2); r3 < i3.length; r3++) Dn2(a2 = i3[r3], e2, n2, t3);
            else for (var o2 in e2) {
              var a2, u2 = /^idb\:\/\/(.*)\/(.*)\//.exec(o2);
              u2 && (o2 = u2[1], u2 = u2[2], (a2 = An2["idb://".concat(o2, "/").concat(u2)]) && Dn2(a2, e2, n2, t3));
            }
            n2.forEach(function(e3) {
              return e3();
            });
          }
          function Dn2(e2, t3, n2, r3) {
            for (var i3 = [], o2 = 0, a2 = Object.entries(e2.queries.query); o2 < a2.length; o2++) {
              for (var u2 = a2[o2], s2 = u2[0], c3 = [], l2 = 0, f2 = u2[1]; l2 < f2.length; l2++) {
                var h2 = f2[l2];
                jn2(t3, h2.obsSet) ? h2.subscribers.forEach(function(e3) {
                  return n2.add(e3);
                }) : r3 && c3.push(h2);
              }
              r3 && i3.push([s2, c3]);
            }
            if (r3) for (var d2 = 0, p2 = i3; d2 < p2.length; d2++) {
              var y2 = p2[d2], s2 = y2[0], c3 = y2[1];
              e2.queries.query[s2] = c3;
            }
          }
          function Bn2(f2) {
            var h2 = f2._state, r3 = f2._deps.indexedDB;
            if (h2.isBeingOpened || f2.idbdb) return h2.dbReadyPromise.then(function() {
              return h2.dbOpenError ? Xe2(h2.dbOpenError) : f2;
            });
            h2.isBeingOpened = true, h2.dbOpenError = null, h2.openComplete = false;
            var t3 = h2.openCanceller, d2 = Math.round(10 * f2.verno), p2 = false;
            function e2() {
              if (h2.openCanceller !== t3) throw new Y2.DatabaseClosed("db.open() was cancelled");
            }
            function y2() {
              return new _e2(function(s2, n3) {
                if (e2(), !r3) throw new Y2.MissingAPI();
                var c3 = f2.name, l2 = h2.autoSchema || !d2 ? r3.open(c3) : r3.open(c3, d2);
                if (!l2) throw new Y2.MissingAPI();
                l2.onerror = Ft2(n3), l2.onblocked = Ie2(f2._fireOnBlocked), l2.onupgradeneeded = Ie2(function(e3) {
                  var t4;
                  v2 = l2.transaction, h2.autoSchema && !f2._options.allowEmptyDB ? (l2.onerror = Mt, v2.abort(), l2.result.close(), (t4 = r3.deleteDatabase(c3)).onsuccess = t4.onerror = Ie2(function() {
                    n3(new Y2.NoSuchDatabase("Database ".concat(c3, " doesnt exist")));
                  })) : (v2.onerror = Ft2(n3), e3 = e3.oldVersion > Math.pow(2, 62) ? 0 : e3.oldVersion, m2 = e3 < 1, f2.idbdb = l2.result, p2 && un2(f2, v2), an2(f2, e3 / 10, v2, n3));
                }, n3), l2.onsuccess = Ie2(function() {
                  v2 = null;
                  var e3, t4, n4, r4, i4, o2 = f2.idbdb = l2.result, a2 = b(o2.objectStoreNames);
                  if (0 < a2.length) try {
                    var u2 = o2.transaction(1 === (r4 = a2).length ? r4[0] : r4, "readonly");
                    if (h2.autoSchema) t4 = o2, n4 = u2, (e3 = f2).verno = t4.version / 10, n4 = e3._dbSchema = hn2(0, t4, n4), e3._storeNames = b(t4.objectStoreNames, 0), nn(e3, [e3._allTables], O(n4), n4);
                    else if (dn2(f2, f2._dbSchema, u2), ((i4 = sn(hn2(0, (i4 = f2).idbdb, u2), i4._dbSchema)).add.length || i4.change.some(function(e4) {
                      return e4.add.length || e4.change.length;
                    })) && !p2) return console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Dexie will add missing parts and increment native version number to workaround this."), o2.close(), d2 = o2.version + 1, p2 = true, s2(y2());
                    tn2(f2, u2);
                  } catch (e4) {
                  }
                  et2.push(f2), o2.onversionchange = Ie2(function(e4) {
                    h2.vcFired = true, f2.on("versionchange").fire(e4);
                  }), o2.onclose = Ie2(function() {
                    f2.close({ disableAutoOpen: false });
                  }), m2 && (i4 = f2._deps, u2 = c3, o2 = i4.indexedDB, i4 = i4.IDBKeyRange, bn2(o2) || u2 === tt2 || mn2(o2, i4).put({ name: u2 }).catch(G)), s2();
                }, n3);
              }).catch(function(e3) {
                switch (null == e3 ? void 0 : e3.name) {
                  case "UnknownError":
                    if (0 < h2.PR1398_maxLoop) return h2.PR1398_maxLoop--, console.warn("Dexie: Workaround for Chrome UnknownError on open()"), y2();
                    break;
                  case "VersionError":
                    if (0 < d2) return d2 = 0, y2();
                }
                return _e2.reject(e3);
              });
            }
            var n2, i3 = h2.dbReadyResolve, v2 = null, m2 = false;
            return _e2.race([t3, ("undefined" == typeof navigator ? _e2.resolve() : !navigator.userAgentData && /Safari\//.test(navigator.userAgent) && !/Chrom(e|ium)\//.test(navigator.userAgent) && indexedDB.databases ? new Promise(function(e3) {
              function t4() {
                return indexedDB.databases().finally(e3);
              }
              n2 = setInterval(t4, 100), t4();
            }).finally(function() {
              return clearInterval(n2);
            }) : Promise.resolve()).then(y2)]).then(function() {
              return e2(), h2.onReadyBeingFired = [], _e2.resolve(gn2(function() {
                return f2.on.ready.fire(f2.vip);
              })).then(function e3() {
                if (0 < h2.onReadyBeingFired.length) {
                  var t4 = h2.onReadyBeingFired.reduce(re2, G);
                  return h2.onReadyBeingFired = [], _e2.resolve(gn2(function() {
                    return t4(f2.vip);
                  })).then(e3);
                }
              });
            }).finally(function() {
              h2.openCanceller === t3 && (h2.onReadyBeingFired = null, h2.isBeingOpened = false);
            }).catch(function(e3) {
              h2.dbOpenError = e3;
              try {
                v2 && v2.abort();
              } catch (e4) {
              }
              return t3 === h2.openCanceller && f2._close(), Xe2(e3);
            }).finally(function() {
              h2.openComplete = true, i3();
            }).then(function() {
              var n3;
              return m2 && (n3 = {}, f2.tables.forEach(function(t4) {
                t4.schema.indexes.forEach(function(e3) {
                  e3.name && (n3["idb://".concat(f2.name, "/").concat(t4.name, "/").concat(e3.name)] = new _n2(-1 / 0, [[[]]]));
                }), n3["idb://".concat(f2.name, "/").concat(t4.name, "/")] = n3["idb://".concat(f2.name, "/").concat(t4.name, "/:dels")] = new _n2(-1 / 0, [[[]]]);
              }), Ut(Nt).fire(n3), qn2(n3, true)), f2;
            });
          }
          function Rn2(t3) {
            function e2(e3) {
              return t3.next(e3);
            }
            var r3 = n2(e2), i3 = n2(function(e3) {
              return t3.throw(e3);
            });
            function n2(n3) {
              return function(e3) {
                var t4 = n3(e3), e3 = t4.value;
                return t4.done ? e3 : e3 && "function" == typeof e3.then ? e3.then(r3, i3) : x2(e3) ? Promise.all(e3).then(r3, i3) : r3(e3);
              };
            }
            return n2(e2)();
          }
          function Fn2(e2, t3, n2) {
            for (var r3 = x2(e2) ? e2.slice() : [e2], i3 = 0; i3 < n2; ++i3) r3.push(t3);
            return r3;
          }
          var Mn2 = { stack: "dbcore", name: "VirtualIndexMiddleware", level: 1, create: function(f2) {
            return _(_({}, f2), { table: function(e2) {
              var a2 = f2.table(e2), t3 = a2.schema, u2 = {}, s2 = [];
              function c3(e3, t4, n3) {
                var r4 = Jt2(e3), i4 = u2[r4] = u2[r4] || [], o2 = null == e3 ? 0 : "string" == typeof e3 ? 1 : e3.length, a3 = 0 < t4, a3 = _(_({}, n3), { name: a3 ? "".concat(r4, "(virtual-from:").concat(n3.name, ")") : n3.name, lowLevelIndex: n3, isVirtual: a3, keyTail: t4, keyLength: o2, extractKey: Gt2(e3), unique: !a3 && n3.unique });
                return i4.push(a3), a3.isPrimaryKey || s2.push(a3), 1 < o2 && c3(2 === o2 ? e3[0] : e3.slice(0, o2 - 1), t4 + 1, n3), i4.sort(function(e4, t5) {
                  return e4.keyTail - t5.keyTail;
                }), a3;
              }
              e2 = c3(t3.primaryKey.keyPath, 0, t3.primaryKey);
              u2[":id"] = [e2];
              for (var n2 = 0, r3 = t3.indexes; n2 < r3.length; n2++) {
                var i3 = r3[n2];
                c3(i3.keyPath, 0, i3);
              }
              function l2(e3) {
                var t4, n3 = e3.query.index;
                return n3.isVirtual ? _(_({}, e3), { query: { index: n3.lowLevelIndex, range: (t4 = e3.query.range, n3 = n3.keyTail, { type: 1 === t4.type ? 2 : t4.type, lower: Fn2(t4.lower, t4.lowerOpen ? f2.MAX_KEY : f2.MIN_KEY, n3), lowerOpen: true, upper: Fn2(t4.upper, t4.upperOpen ? f2.MIN_KEY : f2.MAX_KEY, n3), upperOpen: true }) } }) : e3;
              }
              return _(_({}, a2), { schema: _(_({}, t3), { primaryKey: e2, indexes: s2, getIndexByKeyPath: function(e3) {
                return (e3 = u2[Jt2(e3)]) && e3[0];
              } }), count: function(e3) {
                return a2.count(l2(e3));
              }, query: function(e3) {
                return a2.query(l2(e3));
              }, openCursor: function(t4) {
                var e3 = t4.query.index, r4 = e3.keyTail, n3 = e3.isVirtual, i4 = e3.keyLength;
                return n3 ? a2.openCursor(l2(t4)).then(function(e4) {
                  return e4 && o2(e4);
                }) : a2.openCursor(t4);
                function o2(n4) {
                  return Object.create(n4, { continue: { value: function(e4) {
                    null != e4 ? n4.continue(Fn2(e4, t4.reverse ? f2.MAX_KEY : f2.MIN_KEY, r4)) : t4.unique ? n4.continue(n4.key.slice(0, i4).concat(t4.reverse ? f2.MIN_KEY : f2.MAX_KEY, r4)) : n4.continue();
                  } }, continuePrimaryKey: { value: function(e4, t5) {
                    n4.continuePrimaryKey(Fn2(e4, f2.MAX_KEY, r4), t5);
                  } }, primaryKey: { get: function() {
                    return n4.primaryKey;
                  } }, key: { get: function() {
                    var e4 = n4.key;
                    return 1 === i4 ? e4[0] : e4.slice(0, i4);
                  } }, value: { get: function() {
                    return n4.value;
                  } } });
                }
              } });
            } });
          } };
          function Nn2(i3, o2, a2, u2) {
            return a2 = a2 || {}, u2 = u2 || "", O(i3).forEach(function(e2) {
              var t3, n2, r3;
              m(o2, e2) ? (t3 = i3[e2], n2 = o2[e2], "object" == typeof t3 && "object" == typeof n2 && t3 && n2 ? (r3 = A2(t3)) !== A2(n2) ? a2[u2 + e2] = o2[e2] : "Object" === r3 ? Nn2(t3, n2, a2, u2 + e2 + ".") : t3 !== n2 && (a2[u2 + e2] = o2[e2]) : t3 !== n2 && (a2[u2 + e2] = o2[e2])) : a2[u2 + e2] = void 0;
            }), O(o2).forEach(function(e2) {
              m(i3, e2) || (a2[u2 + e2] = o2[e2]);
            }), a2;
          }
          function Ln2(e2, t3) {
            return "delete" === t3.type ? t3.keys : t3.keys || t3.values.map(e2.extractKey);
          }
          var Un2 = { stack: "dbcore", name: "HooksMiddleware", level: 2, create: function(e2) {
            return _(_({}, e2), { table: function(r3) {
              var y2 = e2.table(r3), v2 = y2.schema.primaryKey;
              return _(_({}, y2), { mutate: function(e3) {
                var t3 = me2.trans, n2 = t3.table(r3).hook, h2 = n2.deleting, d2 = n2.creating, p2 = n2.updating;
                switch (e3.type) {
                  case "add":
                    if (d2.fire === G) break;
                    return t3._promise("readwrite", function() {
                      return a2(e3);
                    }, true);
                  case "put":
                    if (d2.fire === G && p2.fire === G) break;
                    return t3._promise("readwrite", function() {
                      return a2(e3);
                    }, true);
                  case "delete":
                    if (h2.fire === G) break;
                    return t3._promise("readwrite", function() {
                      return a2(e3);
                    }, true);
                  case "deleteRange":
                    if (h2.fire === G) break;
                    return t3._promise("readwrite", function() {
                      return (function n3(r4, i3, o2) {
                        return y2.query({ trans: r4, values: false, query: { index: v2, range: i3 }, limit: o2 }).then(function(e4) {
                          var t4 = e4.result;
                          return a2({ type: "delete", keys: t4, trans: r4 }).then(function(e5) {
                            return 0 < e5.numFailures ? Promise.reject(e5.failures[0]) : t4.length < o2 ? { failures: [], numFailures: 0, lastResult: void 0 } : n3(r4, _(_({}, i3), { lower: t4[t4.length - 1], lowerOpen: true }), o2);
                          });
                        });
                      })(e3.trans, e3.range, 1e4);
                    }, true);
                }
                return y2.mutate(e3);
                function a2(c3) {
                  var e4, t4, n3, l2 = me2.trans, f2 = c3.keys || Ln2(v2, c3);
                  if (!f2) throw new Error("Keys missing");
                  return "delete" !== (c3 = "add" === c3.type || "put" === c3.type ? _(_({}, c3), { keys: f2 }) : _({}, c3)).type && (c3.values = i2([], c3.values)), c3.keys && (c3.keys = i2([], c3.keys)), e4 = y2, n3 = f2, ("add" === (t4 = c3).type ? Promise.resolve([]) : e4.getMany({ trans: t4.trans, keys: n3, cache: "immutable" })).then(function(u2) {
                    var s2 = f2.map(function(e5, t5) {
                      var n4, r4, i3, o2 = u2[t5], a3 = { onerror: null, onsuccess: null };
                      return "delete" === c3.type ? h2.fire.call(a3, e5, o2, l2) : "add" === c3.type || void 0 === o2 ? (n4 = d2.fire.call(a3, e5, c3.values[t5], l2), null == e5 && null != n4 && (c3.keys[t5] = e5 = n4, v2.outbound || w(c3.values[t5], v2.keyPath, e5))) : (n4 = Nn2(o2, c3.values[t5]), (r4 = p2.fire.call(a3, n4, e5, o2, l2)) && (i3 = c3.values[t5], Object.keys(r4).forEach(function(e6) {
                        m(i3, e6) ? i3[e6] = r4[e6] : w(i3, e6, r4[e6]);
                      }))), a3;
                    });
                    return y2.mutate(c3).then(function(e5) {
                      for (var t5 = e5.failures, n4 = e5.results, r4 = e5.numFailures, e5 = e5.lastResult, i3 = 0; i3 < f2.length; ++i3) {
                        var o2 = (n4 || f2)[i3], a3 = s2[i3];
                        null == o2 ? a3.onerror && a3.onerror(t5[i3]) : a3.onsuccess && a3.onsuccess("put" === c3.type && u2[i3] ? c3.values[i3] : o2);
                      }
                      return { failures: t5, results: n4, numFailures: r4, lastResult: e5 };
                    }).catch(function(t5) {
                      return s2.forEach(function(e5) {
                        return e5.onerror && e5.onerror(t5);
                      }), Promise.reject(t5);
                    });
                  });
                }
              } });
            } });
          } };
          function Vn2(e2, t3, n2) {
            try {
              if (!t3) return null;
              if (t3.keys.length < e2.length) return null;
              for (var r3 = [], i3 = 0, o2 = 0; i3 < t3.keys.length && o2 < e2.length; ++i3) 0 === st(t3.keys[i3], e2[o2]) && (r3.push(n2 ? S(t3.values[i3]) : t3.values[i3]), ++o2);
              return r3.length === e2.length ? r3 : null;
            } catch (e3) {
              return null;
            }
          }
          var zn2 = { stack: "dbcore", level: -1, create: function(t3) {
            return { table: function(e2) {
              var n2 = t3.table(e2);
              return _(_({}, n2), { getMany: function(t4) {
                if (!t4.cache) return n2.getMany(t4);
                var e3 = Vn2(t4.keys, t4.trans._cache, "clone" === t4.cache);
                return e3 ? _e2.resolve(e3) : n2.getMany(t4).then(function(e4) {
                  return t4.trans._cache = { keys: t4.keys, values: "clone" === t4.cache ? S(e4) : e4 }, e4;
                });
              }, mutate: function(e3) {
                return "add" !== e3.type && (e3.trans._cache = null), n2.mutate(e3);
              } });
            } };
          } };
          function Wn2(e2, t3) {
            return "readonly" === e2.trans.mode && !!e2.subscr && !e2.trans.explicit && "disabled" !== e2.trans.db._options.cache && !t3.schema.primaryKey.outbound;
          }
          function Yn2(e2, t3) {
            switch (e2) {
              case "query":
                return t3.values && !t3.unique;
              case "get":
              case "getMany":
              case "count":
              case "openCursor":
                return false;
            }
          }
          var $n2 = { stack: "dbcore", level: 0, name: "Observability", create: function(b2) {
            var g2 = b2.schema.name, w2 = new _n2(b2.MIN_KEY, b2.MAX_KEY);
            return _(_({}, b2), { transaction: function(e2, t3, n2) {
              if (me2.subscr && "readonly" !== t3) throw new Y2.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(me2.querier));
              return b2.transaction(e2, t3, n2);
            }, table: function(d2) {
              var p2 = b2.table(d2), y2 = p2.schema, v2 = y2.primaryKey, e2 = y2.indexes, c3 = v2.extractKey, l2 = v2.outbound, m2 = v2.autoIncrement && e2.filter(function(e3) {
                return e3.compound && e3.keyPath.includes(v2.keyPath);
              }), t3 = _(_({}, p2), { mutate: function(a2) {
                function u2(e4) {
                  return e4 = "idb://".concat(g2, "/").concat(d2, "/").concat(e4), n2[e4] || (n2[e4] = new _n2());
                }
                var e3, o2, s2, t4 = a2.trans, n2 = a2.mutatedParts || (a2.mutatedParts = {}), r3 = u2(""), i3 = u2(":dels"), c4 = a2.type, l3 = "deleteRange" === a2.type ? [a2.range] : "delete" === a2.type ? [a2.keys] : a2.values.length < 50 ? [Ln2(v2, a2).filter(function(e4) {
                  return e4;
                }), a2.values] : [], f3 = l3[0], h2 = l3[1], l3 = a2.trans._cache;
                return x2(f3) ? (r3.addKeys(f3), (l3 = "delete" === c4 || f3.length === h2.length ? Vn2(f3, l3) : null) || i3.addKeys(f3), (l3 || h2) && (e3 = u2, o2 = l3, s2 = h2, y2.indexes.forEach(function(t5) {
                  var n3 = e3(t5.name || "");
                  function r4(e4) {
                    return null != e4 ? t5.extractKey(e4) : null;
                  }
                  function i4(e4) {
                    return t5.multiEntry && x2(e4) ? e4.forEach(function(e5) {
                      return n3.addKey(e5);
                    }) : n3.addKey(e4);
                  }
                  (o2 || s2).forEach(function(e4, t6) {
                    var n4 = o2 && r4(o2[t6]), t6 = s2 && r4(s2[t6]);
                    0 !== st(n4, t6) && (null != n4 && i4(n4), null != t6 && i4(t6));
                  });
                }))) : f3 ? (h2 = { from: null !== (h2 = f3.lower) && void 0 !== h2 ? h2 : b2.MIN_KEY, to: null !== (h2 = f3.upper) && void 0 !== h2 ? h2 : b2.MAX_KEY }, i3.add(h2), r3.add(h2)) : (r3.add(w2), i3.add(w2), y2.indexes.forEach(function(e4) {
                  return u2(e4.name).add(w2);
                })), p2.mutate(a2).then(function(o3) {
                  return !f3 || "add" !== a2.type && "put" !== a2.type || (r3.addKeys(o3.results), m2 && m2.forEach(function(t5) {
                    for (var e4 = a2.values.map(function(e5) {
                      return t5.extractKey(e5);
                    }), n3 = t5.keyPath.findIndex(function(e5) {
                      return e5 === v2.keyPath;
                    }), r4 = 0, i4 = o3.results.length; r4 < i4; ++r4) e4[r4][n3] = o3.results[r4];
                    u2(t5.name).addKeys(e4);
                  })), t4.mutatedParts = Sn2(t4.mutatedParts || {}, n2), o3;
                });
              } }), e2 = function(e3) {
                var t4 = e3.query, e3 = t4.index, t4 = t4.range;
                return [e3, new _n2(null !== (e3 = t4.lower) && void 0 !== e3 ? e3 : b2.MIN_KEY, null !== (t4 = t4.upper) && void 0 !== t4 ? t4 : b2.MAX_KEY)];
              }, f2 = { get: function(e3) {
                return [v2, new _n2(e3.key)];
              }, getMany: function(e3) {
                return [v2, new _n2().addKeys(e3.keys)];
              }, count: e2, query: e2, openCursor: e2 };
              return O(f2).forEach(function(s2) {
                t3[s2] = function(i3) {
                  var e3 = me2.subscr, t4 = !!e3, n2 = Wn2(me2, p2) && Yn2(s2, i3) ? i3.obsSet = {} : e3;
                  if (t4) {
                    var r3 = function(e4) {
                      e4 = "idb://".concat(g2, "/").concat(d2, "/").concat(e4);
                      return n2[e4] || (n2[e4] = new _n2());
                    }, o2 = r3(""), a2 = r3(":dels"), e3 = f2[s2](i3), t4 = e3[0], e3 = e3[1];
                    if (("query" === s2 && t4.isPrimaryKey && !i3.values ? a2 : r3(t4.name || "")).add(e3), !t4.isPrimaryKey) {
                      if ("count" !== s2) {
                        var u2 = "query" === s2 && l2 && i3.values && p2.query(_(_({}, i3), { values: false }));
                        return p2[s2].apply(this, arguments).then(function(t5) {
                          if ("query" === s2) {
                            if (l2 && i3.values) return u2.then(function(e5) {
                              e5 = e5.result;
                              return o2.addKeys(e5), t5;
                            });
                            var e4 = i3.values ? t5.result.map(c3) : t5.result;
                            (i3.values ? o2 : a2).addKeys(e4);
                          } else if ("openCursor" === s2) {
                            var n3 = t5, r4 = i3.values;
                            return n3 && Object.create(n3, { key: { get: function() {
                              return a2.addKey(n3.primaryKey), n3.key;
                            } }, primaryKey: { get: function() {
                              var e5 = n3.primaryKey;
                              return a2.addKey(e5), e5;
                            } }, value: { get: function() {
                              return r4 && o2.addKey(n3.primaryKey), n3.value;
                            } } });
                          }
                          return t5;
                        });
                      }
                      a2.add(w2);
                    }
                  }
                  return p2[s2].apply(this, arguments);
                };
              }), t3;
            } });
          } };
          function Qn2(e2, t3, n2) {
            if (0 === n2.numFailures) return t3;
            if ("deleteRange" === t3.type) return null;
            var r3 = t3.keys ? t3.keys.length : "values" in t3 && t3.values ? t3.values.length : 1;
            if (n2.numFailures === r3) return null;
            t3 = _({}, t3);
            return x2(t3.keys) && (t3.keys = t3.keys.filter(function(e3, t4) {
              return !(t4 in n2.failures);
            })), "values" in t3 && x2(t3.values) && (t3.values = t3.values.filter(function(e3, t4) {
              return !(t4 in n2.failures);
            })), t3;
          }
          function Gn2(e2, t3) {
            return n2 = e2, (void 0 === (r3 = t3).lower || (r3.lowerOpen ? 0 < st(n2, r3.lower) : 0 <= st(n2, r3.lower))) && (e2 = e2, void 0 === (t3 = t3).upper || (t3.upperOpen ? st(e2, t3.upper) < 0 : st(e2, t3.upper) <= 0));
            var n2, r3;
          }
          function Xn2(e2, d2, t3, n2, r3, i3) {
            if (!t3 || 0 === t3.length) return e2;
            var o2 = d2.query.index, p2 = o2.multiEntry, y2 = d2.query.range, v2 = n2.schema.primaryKey.extractKey, m2 = o2.extractKey, a2 = (o2.lowLevelIndex || o2).extractKey, t3 = t3.reduce(function(e3, t4) {
              var n3 = e3, r4 = [];
              if ("add" === t4.type || "put" === t4.type) for (var i4 = new _n2(), o3 = t4.values.length - 1; 0 <= o3; --o3) {
                var a3, u2 = t4.values[o3], s2 = v2(u2);
                i4.hasKey(s2) || (a3 = m2(u2), (p2 && x2(a3) ? a3.some(function(e4) {
                  return Gn2(e4, y2);
                }) : Gn2(a3, y2)) && (i4.addKey(s2), r4.push(u2)));
              }
              switch (t4.type) {
                case "add":
                  var c3 = new _n2().addKeys(d2.values ? e3.map(function(e4) {
                    return v2(e4);
                  }) : e3), n3 = e3.concat(d2.values ? r4.filter(function(e4) {
                    e4 = v2(e4);
                    return !c3.hasKey(e4) && (c3.addKey(e4), true);
                  }) : r4.map(function(e4) {
                    return v2(e4);
                  }).filter(function(e4) {
                    return !c3.hasKey(e4) && (c3.addKey(e4), true);
                  }));
                  break;
                case "put":
                  var l2 = new _n2().addKeys(t4.values.map(function(e4) {
                    return v2(e4);
                  }));
                  n3 = e3.filter(function(e4) {
                    return !l2.hasKey(d2.values ? v2(e4) : e4);
                  }).concat(d2.values ? r4 : r4.map(function(e4) {
                    return v2(e4);
                  }));
                  break;
                case "delete":
                  var f2 = new _n2().addKeys(t4.keys);
                  n3 = e3.filter(function(e4) {
                    return !f2.hasKey(d2.values ? v2(e4) : e4);
                  });
                  break;
                case "deleteRange":
                  var h2 = t4.range;
                  n3 = e3.filter(function(e4) {
                    return !Gn2(v2(e4), h2);
                  });
              }
              return n3;
            }, e2);
            return t3 === e2 ? e2 : (t3.sort(function(e3, t4) {
              return st(a2(e3), a2(t4)) || st(v2(e3), v2(t4));
            }), d2.limit && d2.limit < 1 / 0 && (t3.length > d2.limit ? t3.length = d2.limit : e2.length === d2.limit && t3.length < d2.limit && (r3.dirty = true)), i3 ? Object.freeze(t3) : t3);
          }
          function Hn2(e2, t3) {
            return 0 === st(e2.lower, t3.lower) && 0 === st(e2.upper, t3.upper) && !!e2.lowerOpen == !!t3.lowerOpen && !!e2.upperOpen == !!t3.upperOpen;
          }
          function Jn2(e2, t3) {
            return (function(e3, t4, n2, r3) {
              if (void 0 === e3) return void 0 !== t4 ? -1 : 0;
              if (void 0 === t4) return 1;
              if (0 === (t4 = st(e3, t4))) {
                if (n2 && r3) return 0;
                if (n2) return 1;
                if (r3) return -1;
              }
              return t4;
            })(e2.lower, t3.lower, e2.lowerOpen, t3.lowerOpen) <= 0 && 0 <= (function(e3, t4, n2, r3) {
              if (void 0 === e3) return void 0 !== t4 ? 1 : 0;
              if (void 0 === t4) return -1;
              if (0 === (t4 = st(e3, t4))) {
                if (n2 && r3) return 0;
                if (n2) return -1;
                if (r3) return 1;
              }
              return t4;
            })(e2.upper, t3.upper, e2.upperOpen, t3.upperOpen);
          }
          function Zn2(n2, r3, i3, e2) {
            n2.subscribers.add(i3), e2.addEventListener("abort", function() {
              var e3, t3;
              n2.subscribers.delete(i3), 0 === n2.subscribers.size && (e3 = n2, t3 = r3, setTimeout(function() {
                0 === e3.subscribers.size && I(t3, e3);
              }, 3e3));
            });
          }
          var er2 = { stack: "dbcore", level: 0, name: "Cache", create: function(k3) {
            var O2 = k3.schema.name;
            return _(_({}, k3), { transaction: function(g2, w2, e2) {
              var _2, t3, x3 = k3.transaction(g2, w2, e2);
              return "readwrite" === w2 && (t3 = (_2 = new AbortController()).signal, e2 = function(b2) {
                return function() {
                  if (_2.abort(), "readwrite" === w2) {
                    for (var t4 = /* @__PURE__ */ new Set(), e3 = 0, n2 = g2; e3 < n2.length; e3++) {
                      var r3 = n2[e3], i3 = An2["idb://".concat(O2, "/").concat(r3)];
                      if (i3) {
                        var o2 = k3.table(r3), a2 = i3.optimisticOps.filter(function(e4) {
                          return e4.trans === x3;
                        });
                        if (x3._explicit && b2 && x3.mutatedParts) for (var u2 = 0, s2 = Object.values(i3.queries.query); u2 < s2.length; u2++) for (var c3 = 0, l2 = (d2 = s2[u2]).slice(); c3 < l2.length; c3++) jn2((p2 = l2[c3]).obsSet, x3.mutatedParts) && (I(d2, p2), p2.subscribers.forEach(function(e4) {
                          return t4.add(e4);
                        }));
                        else if (0 < a2.length) {
                          i3.optimisticOps = i3.optimisticOps.filter(function(e4) {
                            return e4.trans !== x3;
                          });
                          for (var f2 = 0, h2 = Object.values(i3.queries.query); f2 < h2.length; f2++) for (var d2, p2, y2, v2 = 0, m2 = (d2 = h2[f2]).slice(); v2 < m2.length; v2++) null != (p2 = m2[v2]).res && x3.mutatedParts && (b2 && !p2.dirty ? (y2 = Object.isFrozen(p2.res), y2 = Xn2(p2.res, p2.req, a2, o2, p2, y2), p2.dirty ? (I(d2, p2), p2.subscribers.forEach(function(e4) {
                            return t4.add(e4);
                          })) : y2 !== p2.res && (p2.res = y2, p2.promise = _e2.resolve({ result: y2 }))) : (p2.dirty && I(d2, p2), p2.subscribers.forEach(function(e4) {
                            return t4.add(e4);
                          })));
                        }
                      }
                    }
                    t4.forEach(function(e4) {
                      return e4();
                    });
                  }
                };
              }, x3.addEventListener("abort", e2(false), { signal: t3 }), x3.addEventListener("error", e2(false), { signal: t3 }), x3.addEventListener("complete", e2(true), { signal: t3 })), x3;
            }, table: function(c3) {
              var l2 = k3.table(c3), i3 = l2.schema.primaryKey;
              return _(_({}, l2), { mutate: function(t3) {
                var e2 = me2.trans;
                if (i3.outbound || "disabled" === e2.db._options.cache || e2.explicit || "readwrite" !== e2.idbtrans.mode) return l2.mutate(t3);
                var n2 = An2["idb://".concat(O2, "/").concat(c3)];
                if (!n2) return l2.mutate(t3);
                e2 = l2.mutate(t3);
                return "add" !== t3.type && "put" !== t3.type || !(50 <= t3.values.length || Ln2(i3, t3).some(function(e3) {
                  return null == e3;
                })) ? (n2.optimisticOps.push(t3), t3.mutatedParts && In2(t3.mutatedParts), e2.then(function(e3) {
                  0 < e3.numFailures && (I(n2.optimisticOps, t3), (e3 = Qn2(0, t3, e3)) && n2.optimisticOps.push(e3), t3.mutatedParts && In2(t3.mutatedParts));
                }), e2.catch(function() {
                  I(n2.optimisticOps, t3), t3.mutatedParts && In2(t3.mutatedParts);
                })) : e2.then(function(r3) {
                  var e3 = Qn2(0, _(_({}, t3), { values: t3.values.map(function(e4, t4) {
                    var n3;
                    if (r3.failures[t4]) return e4;
                    e4 = null !== (n3 = i3.keyPath) && void 0 !== n3 && n3.includes(".") ? S(e4) : _({}, e4);
                    return w(e4, i3.keyPath, r3.results[t4]), e4;
                  }) }), r3);
                  n2.optimisticOps.push(e3), queueMicrotask(function() {
                    return t3.mutatedParts && In2(t3.mutatedParts);
                  });
                }), e2;
              }, query: function(t3) {
                if (!Wn2(me2, l2) || !Yn2("query", t3)) return l2.query(t3);
                var i4 = "immutable" === (null === (o2 = me2.trans) || void 0 === o2 ? void 0 : o2.db._options.cache), e2 = me2, n2 = e2.requery, r3 = e2.signal, o2 = (function(e3, t4, n3, r4) {
                  var i5 = An2["idb://".concat(e3, "/").concat(t4)];
                  if (!i5) return [];
                  if (!(t4 = i5.queries[n3])) return [null, false, i5, null];
                  var o3 = t4[(r4.query ? r4.query.index.name : null) || ""];
                  if (!o3) return [null, false, i5, null];
                  switch (n3) {
                    case "query":
                      var a3 = o3.find(function(e4) {
                        return e4.req.limit === r4.limit && e4.req.values === r4.values && Hn2(e4.req.query.range, r4.query.range);
                      });
                      return a3 ? [a3, true, i5, o3] : [o3.find(function(e4) {
                        return ("limit" in e4.req ? e4.req.limit : 1 / 0) >= r4.limit && (!r4.values || e4.req.values) && Jn2(e4.req.query.range, r4.query.range);
                      }), false, i5, o3];
                    case "count":
                      a3 = o3.find(function(e4) {
                        return Hn2(e4.req.query.range, r4.query.range);
                      });
                      return [a3, !!a3, i5, o3];
                  }
                })(O2, c3, "query", t3), a2 = o2[0], e2 = o2[1], u2 = o2[2], s2 = o2[3];
                return a2 && e2 ? a2.obsSet = t3.obsSet : (e2 = l2.query(t3).then(function(e3) {
                  var t4 = e3.result;
                  if (a2 && (a2.res = t4), i4) {
                    for (var n3 = 0, r4 = t4.length; n3 < r4; ++n3) Object.freeze(t4[n3]);
                    Object.freeze(t4);
                  } else e3.result = S(t4);
                  return e3;
                }).catch(function(e3) {
                  return s2 && a2 && I(s2, a2), Promise.reject(e3);
                }), a2 = { obsSet: t3.obsSet, promise: e2, subscribers: /* @__PURE__ */ new Set(), type: "query", req: t3, dirty: false }, s2 ? s2.push(a2) : (s2 = [a2], (u2 = u2 || (An2["idb://".concat(O2, "/").concat(c3)] = { queries: { query: {}, count: {} }, objs: /* @__PURE__ */ new Map(), optimisticOps: [], unsignaledParts: {} })).queries.query[t3.query.index.name || ""] = s2)), Zn2(a2, s2, n2, r3), a2.promise.then(function(e3) {
                  return { result: Xn2(e3.result, t3, null == u2 ? void 0 : u2.optimisticOps, l2, a2, i4) };
                });
              } });
            } });
          } };
          function tr2(e2, r3) {
            return new Proxy(e2, { get: function(e3, t3, n2) {
              return "db" === t3 ? r3 : Reflect.get(e3, t3, n2);
            } });
          }
          var nr2 = (rr2.prototype.version = function(t3) {
            if (isNaN(t3) || t3 < 0.1) throw new Y2.Type("Given version is not a positive number");
            if (t3 = Math.round(10 * t3) / 10, this.idbdb || this._state.isBeingOpened) throw new Y2.Schema("Cannot add version when database is open");
            this.verno = Math.max(this.verno, t3);
            var e2 = this._versions, n2 = e2.filter(function(e3) {
              return e3._cfg.version === t3;
            })[0];
            return n2 || (n2 = new this.Version(t3), e2.push(n2), e2.sort(on), n2.stores({}), this._state.autoSchema = false, n2);
          }, rr2.prototype._whenReady = function(e2) {
            var n2 = this;
            return this.idbdb && (this._state.openComplete || me2.letThrough || this._vip) ? e2() : new _e2(function(e3, t3) {
              if (n2._state.openComplete) return t3(new Y2.DatabaseClosed(n2._state.dbOpenError));
              if (!n2._state.isBeingOpened) {
                if (!n2._state.autoOpen) return void t3(new Y2.DatabaseClosed());
                n2.open().catch(G);
              }
              n2._state.dbReadyPromise.then(e3, t3);
            }).then(e2);
          }, rr2.prototype.use = function(e2) {
            var t3 = e2.stack, n2 = e2.create, r3 = e2.level, i3 = e2.name;
            i3 && this.unuse({ stack: t3, name: i3 });
            e2 = this._middlewares[t3] || (this._middlewares[t3] = []);
            return e2.push({ stack: t3, create: n2, level: null == r3 ? 10 : r3, name: i3 }), e2.sort(function(e3, t4) {
              return e3.level - t4.level;
            }), this;
          }, rr2.prototype.unuse = function(e2) {
            var t3 = e2.stack, n2 = e2.name, r3 = e2.create;
            return t3 && this._middlewares[t3] && (this._middlewares[t3] = this._middlewares[t3].filter(function(e3) {
              return r3 ? e3.create !== r3 : !!n2 && e3.name !== n2;
            })), this;
          }, rr2.prototype.open = function() {
            var e2 = this;
            return $e2(ve2, function() {
              return Bn2(e2);
            });
          }, rr2.prototype._close = function() {
            this.on.close.fire(new CustomEvent("close"));
            var n2 = this._state, e2 = et2.indexOf(this);
            if (0 <= e2 && et2.splice(e2, 1), this.idbdb) {
              try {
                this.idbdb.close();
              } catch (e3) {
              }
              this.idbdb = null;
            }
            n2.isBeingOpened || (n2.dbReadyPromise = new _e2(function(e3) {
              n2.dbReadyResolve = e3;
            }), n2.openCanceller = new _e2(function(e3, t3) {
              n2.cancelOpen = t3;
            }));
          }, rr2.prototype.close = function(e2) {
            var t3 = (void 0 === e2 ? { disableAutoOpen: true } : e2).disableAutoOpen, e2 = this._state;
            t3 ? (e2.isBeingOpened && e2.cancelOpen(new Y2.DatabaseClosed()), this._close(), e2.autoOpen = false, e2.dbOpenError = new Y2.DatabaseClosed()) : (this._close(), e2.autoOpen = this._options.autoOpen || e2.isBeingOpened, e2.openComplete = false, e2.dbOpenError = null);
          }, rr2.prototype.delete = function(n2) {
            var i3 = this;
            void 0 === n2 && (n2 = { disableAutoOpen: true });
            var o2 = 0 < arguments.length && "object" != typeof arguments[0], a2 = this._state;
            return new _e2(function(r3, t3) {
              function e2() {
                i3.close(n2);
                var e3 = i3._deps.indexedDB.deleteDatabase(i3.name);
                e3.onsuccess = Ie2(function() {
                  var e4, t4, n3;
                  e4 = i3._deps, t4 = i3.name, n3 = e4.indexedDB, e4 = e4.IDBKeyRange, bn2(n3) || t4 === tt2 || mn2(n3, e4).delete(t4).catch(G), r3();
                }), e3.onerror = Ft2(t3), e3.onblocked = i3._fireOnBlocked;
              }
              if (o2) throw new Y2.InvalidArgument("Invalid closeOptions argument to db.delete()");
              a2.isBeingOpened ? a2.dbReadyPromise.then(e2) : e2();
            });
          }, rr2.prototype.backendDB = function() {
            return this.idbdb;
          }, rr2.prototype.isOpen = function() {
            return null !== this.idbdb;
          }, rr2.prototype.hasBeenClosed = function() {
            var e2 = this._state.dbOpenError;
            return e2 && "DatabaseClosed" === e2.name;
          }, rr2.prototype.hasFailed = function() {
            return null !== this._state.dbOpenError;
          }, rr2.prototype.dynamicallyOpened = function() {
            return this._state.autoSchema;
          }, Object.defineProperty(rr2.prototype, "tables", { get: function() {
            var t3 = this;
            return O(this._allTables).map(function(e2) {
              return t3._allTables[e2];
            });
          }, enumerable: false, configurable: true }), rr2.prototype.transaction = function() {
            var e2 = (function(e3, t3, n2) {
              var r3 = arguments.length;
              if (r3 < 2) throw new Y2.InvalidArgument("Too few arguments");
              for (var i3 = new Array(r3 - 1); --r3; ) i3[r3 - 1] = arguments[r3];
              return n2 = i3.pop(), [e3, P2(i3), n2];
            }).apply(this, arguments);
            return this._transaction.apply(this, e2);
          }, rr2.prototype._transaction = function(e2, t3, n2) {
            var r3 = this, i3 = me2.trans;
            i3 && i3.db === this && -1 === e2.indexOf("!") || (i3 = null);
            var o2, a2, u2 = -1 !== e2.indexOf("?");
            e2 = e2.replace("!", "").replace("?", "");
            try {
              if (a2 = t3.map(function(e3) {
                e3 = e3 instanceof r3.Table ? e3.name : e3;
                if ("string" != typeof e3) throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");
                return e3;
              }), "r" == e2 || e2 === nt) o2 = nt;
              else {
                if ("rw" != e2 && e2 != rt2) throw new Y2.InvalidArgument("Invalid transaction mode: " + e2);
                o2 = rt2;
              }
              if (i3) {
                if (i3.mode === nt && o2 === rt2) {
                  if (!u2) throw new Y2.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");
                  i3 = null;
                }
                i3 && a2.forEach(function(e3) {
                  if (i3 && -1 === i3.storeNames.indexOf(e3)) {
                    if (!u2) throw new Y2.SubTransaction("Table " + e3 + " not included in parent transaction.");
                    i3 = null;
                  }
                }), u2 && i3 && !i3.active && (i3 = null);
              }
            } catch (n3) {
              return i3 ? i3._promise(null, function(e3, t4) {
                t4(n3);
              }) : Xe2(n3);
            }
            var s2 = (function i4(o3, a3, u3, s3, c3) {
              return _e2.resolve().then(function() {
                var e3 = me2.transless || me2, t4 = o3._createTransaction(a3, u3, o3._dbSchema, s3);
                if (t4.explicit = true, e3 = { trans: t4, transless: e3 }, s3) t4.idbtrans = s3.idbtrans;
                else try {
                  t4.create(), t4.idbtrans._explicit = true, o3._state.PR1398_maxLoop = 3;
                } catch (e4) {
                  return e4.name === z.InvalidState && o3.isOpen() && 0 < --o3._state.PR1398_maxLoop ? (console.warn("Dexie: Need to reopen db"), o3.close({ disableAutoOpen: false }), o3.open().then(function() {
                    return i4(o3, a3, u3, null, c3);
                  })) : Xe2(e4);
                }
                var n3, r4 = B(c3);
                return r4 && Le2(), e3 = _e2.follow(function() {
                  var e4;
                  (n3 = c3.call(t4, t4)) && (r4 ? (e4 = Ue2.bind(null, null), n3.then(e4, e4)) : "function" == typeof n3.next && "function" == typeof n3.throw && (n3 = Rn2(n3)));
                }, e3), (n3 && "function" == typeof n3.then ? _e2.resolve(n3).then(function(e4) {
                  return t4.active ? e4 : Xe2(new Y2.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"));
                }) : e3.then(function() {
                  return n3;
                })).then(function(e4) {
                  return s3 && t4._resolve(), t4._completion.then(function() {
                    return e4;
                  });
                }).catch(function(e4) {
                  return t4._reject(e4), Xe2(e4);
                });
              });
            }).bind(null, this, o2, a2, i3, n2);
            return i3 ? i3._promise(o2, s2, "lock") : me2.trans ? $e2(me2.transless, function() {
              return r3._whenReady(s2);
            }) : this._whenReady(s2);
          }, rr2.prototype.table = function(e2) {
            if (!m(this._allTables, e2)) throw new Y2.InvalidTable("Table ".concat(e2, " does not exist"));
            return this._allTables[e2];
          }, rr2);
          function rr2(e2, t3) {
            var o2 = this;
            this._middlewares = {}, this.verno = 0;
            var n2 = rr2.dependencies;
            this._options = t3 = _({ addons: rr2.addons, autoOpen: true, indexedDB: n2.indexedDB, IDBKeyRange: n2.IDBKeyRange, cache: "cloned" }, t3), this._deps = { indexedDB: t3.indexedDB, IDBKeyRange: t3.IDBKeyRange };
            n2 = t3.addons;
            this._dbSchema = {}, this._versions = [], this._storeNames = [], this._allTables = {}, this.idbdb = null, this._novip = this;
            var a2, r3, u2, i3, s2, c3 = { dbOpenError: null, isBeingOpened: false, onReadyBeingFired: null, openComplete: false, dbReadyResolve: G, dbReadyPromise: null, cancelOpen: G, openCanceller: null, autoSchema: true, PR1398_maxLoop: 3, autoOpen: t3.autoOpen };
            c3.dbReadyPromise = new _e2(function(e3) {
              c3.dbReadyResolve = e3;
            }), c3.openCanceller = new _e2(function(e3, t4) {
              c3.cancelOpen = t4;
            }), this._state = c3, this.name = e2, this.on = mt(this, "populate", "blocked", "versionchange", "close", { ready: [re2, G] }), this.once = function(n3, r4) {
              var i4 = function() {
                for (var e3 = [], t4 = 0; t4 < arguments.length; t4++) e3[t4] = arguments[t4];
                o2.on(n3).unsubscribe(i4), r4.apply(o2, e3);
              };
              return o2.on(n3, i4);
            }, this.on.ready.subscribe = p(this.on.ready.subscribe, function(i4) {
              return function(n3, r4) {
                rr2.vip(function() {
                  var t4, e3 = o2._state;
                  e3.openComplete ? (e3.dbOpenError || _e2.resolve().then(n3), r4 && i4(n3)) : e3.onReadyBeingFired ? (e3.onReadyBeingFired.push(n3), r4 && i4(n3)) : (i4(n3), t4 = o2, r4 || i4(function e4() {
                    t4.on.ready.unsubscribe(n3), t4.on.ready.unsubscribe(e4);
                  }));
                });
              };
            }), this.Collection = (a2 = this, bt2(Kt2.prototype, function(e3, t4) {
              this.db = a2;
              var n3 = ot2, r4 = null;
              if (t4) try {
                n3 = t4();
              } catch (e4) {
                r4 = e4;
              }
              var i4 = e3._ctx, t4 = i4.table, e3 = t4.hook.reading.fire;
              this._ctx = { table: t4, index: i4.index, isPrimKey: !i4.index || t4.schema.primKey.keyPath && i4.index === t4.schema.primKey.name, range: n3, keysOnly: false, dir: "next", unique: "", algorithm: null, filter: null, replayFilter: null, justLimit: true, isMatch: null, offset: 0, limit: 1 / 0, error: r4, or: i4.or, valueMapper: e3 !== X2 ? e3 : null };
            })), this.Table = (r3 = this, bt2(yt2.prototype, function(e3, t4, n3) {
              this.db = r3, this._tx = n3, this.name = e3, this.schema = t4, this.hook = r3._allTables[e3] ? r3._allTables[e3].hook : mt(null, { creating: [Z2, G], reading: [H, X2], updating: [te2, G], deleting: [ee2, G] });
            })), this.Transaction = (u2 = this, bt2(Vt2.prototype, function(e3, t4, n3, r4, i4) {
              var o3 = this;
              "readonly" !== e3 && t4.forEach(function(e4) {
                e4 = null === (e4 = n3[e4]) || void 0 === e4 ? void 0 : e4.yProps;
                e4 && (t4 = t4.concat(e4.map(function(e5) {
                  return e5.updatesTable;
                })));
              }), this.db = u2, this.mode = e3, this.storeNames = t4, this.schema = n3, this.chromeTransactionDurability = r4, this.idbtrans = null, this.on = mt(this, "complete", "error", "abort"), this.parent = i4 || null, this.active = true, this._reculock = 0, this._blockedFuncs = [], this._resolve = null, this._reject = null, this._waitingFor = null, this._waitingQueue = null, this._spinCount = 0, this._completion = new _e2(function(e4, t5) {
                o3._resolve = e4, o3._reject = t5;
              }), this._completion.then(function() {
                o3.active = false, o3.on.complete.fire();
              }, function(e4) {
                var t5 = o3.active;
                return o3.active = false, o3.on.error.fire(e4), o3.parent ? o3.parent._reject(e4) : t5 && o3.idbtrans && o3.idbtrans.abort(), Xe2(e4);
              });
            })), this.Version = (i3 = this, bt2(yn.prototype, function(e3) {
              this.db = i3, this._cfg = { version: e3, storesSource: null, dbschema: {}, tables: {}, contentUpgrade: null };
            })), this.WhereClause = (s2 = this, bt2(Bt.prototype, function(e3, t4, n3) {
              if (this.db = s2, this._ctx = { table: e3, index: ":id" === t4 ? null : t4, or: n3 }, this._cmp = this._ascending = st, this._descending = function(e4, t5) {
                return st(t5, e4);
              }, this._max = function(e4, t5) {
                return 0 < st(e4, t5) ? e4 : t5;
              }, this._min = function(e4, t5) {
                return st(e4, t5) < 0 ? e4 : t5;
              }, this._IDBKeyRange = s2._deps.IDBKeyRange, !this._IDBKeyRange) throw new Y2.MissingAPI();
            })), this.on("versionchange", function(e3) {
              0 < e3.newVersion ? console.warn("Another connection wants to upgrade database '".concat(o2.name, "'. Closing db now to resume the upgrade.")) : console.warn("Another connection wants to delete database '".concat(o2.name, "'. Closing db now to resume the delete request.")), o2.close({ disableAutoOpen: false });
            }), this.on("blocked", function(e3) {
              !e3.newVersion || e3.newVersion < e3.oldVersion ? console.warn("Dexie.delete('".concat(o2.name, "') was blocked")) : console.warn("Upgrade '".concat(o2.name, "' blocked by other connection holding version ").concat(e3.oldVersion / 10));
            }), this._maxKey = Qt2(t3.IDBKeyRange), this._createTransaction = function(e3, t4, n3, r4) {
              return new o2.Transaction(e3, t4, n3, o2._options.chromeTransactionDurability, r4);
            }, this._fireOnBlocked = function(t4) {
              o2.on("blocked").fire(t4), et2.filter(function(e3) {
                return e3.name === o2.name && e3 !== o2 && !e3._state.vcFired;
              }).map(function(e3) {
                return e3.on("versionchange").fire(t4);
              });
            }, this.use(zn2), this.use(er2), this.use($n2), this.use(Mn2), this.use(Un2);
            var l2 = new Proxy(this, { get: function(e3, t4, n3) {
              if ("_vip" === t4) return true;
              if ("table" === t4) return function(e4) {
                return tr2(o2.table(e4), l2);
              };
              var r4 = Reflect.get(e3, t4, n3);
              return r4 instanceof yt2 ? tr2(r4, l2) : "tables" === t4 ? r4.map(function(e4) {
                return tr2(e4, l2);
              }) : "_createTransaction" === t4 ? function() {
                return tr2(r4.apply(this, arguments), l2);
              } : r4;
            } });
            this.vip = l2, n2.forEach(function(e3) {
              return e3(o2);
            });
          }
          var ir2, F2 = "undefined" != typeof Symbol && "observable" in Symbol ? Symbol.observable : "@@observable", or2 = (ar2.prototype.subscribe = function(e2, t3, n2) {
            return this._subscribe(e2 && "function" != typeof e2 ? e2 : { next: e2, error: t3, complete: n2 });
          }, ar2.prototype[F2] = function() {
            return this;
          }, ar2);
          function ar2(e2) {
            this._subscribe = e2;
          }
          try {
            ir2 = { indexedDB: f.indexedDB || f.mozIndexedDB || f.webkitIndexedDB || f.msIndexedDB, IDBKeyRange: f.IDBKeyRange || f.webkitIDBKeyRange };
          } catch (e2) {
            ir2 = { indexedDB: null, IDBKeyRange: null };
          }
          function ur2(h2) {
            var d2, p2 = false, e2 = new or2(function(r3) {
              var i3 = B(h2);
              var o2, a2 = false, u2 = {}, s2 = {}, e3 = { get closed() {
                return a2;
              }, unsubscribe: function() {
                a2 || (a2 = true, o2 && o2.abort(), c3 && Ut.storagemutated.unsubscribe(f2));
              } };
              r3.start && r3.start(e3);
              var c3 = false, l2 = function() {
                return Ge2(t3);
              };
              var f2 = function(e4) {
                Sn2(u2, e4), jn2(s2, u2) && l2();
              }, t3 = function() {
                var t4, n2, e4;
                !a2 && ir2.indexedDB && (u2 = {}, t4 = {}, o2 && o2.abort(), o2 = new AbortController(), e4 = (function(e5) {
                  var t5 = je2();
                  try {
                    i3 && Le2();
                    var n3 = Ne2(h2, e5);
                    return n3 = i3 ? n3.finally(Ue2) : n3;
                  } finally {
                    t5 && Ae2();
                  }
                })(n2 = { subscr: t4, signal: o2.signal, requery: l2, querier: h2, trans: null }), Promise.resolve(e4).then(function(e5) {
                  p2 = true, d2 = e5, a2 || n2.signal.aborted || (u2 = {}, (function(e6) {
                    for (var t5 in e6) if (m(e6, t5)) return;
                    return 1;
                  })(s2 = t4) || c3 || (Ut(Nt, f2), c3 = true), Ge2(function() {
                    return !a2 && r3.next && r3.next(e5);
                  }));
                }, function(e5) {
                  p2 = false, ["DatabaseClosedError", "AbortError"].includes(null == e5 ? void 0 : e5.name) || a2 || Ge2(function() {
                    a2 || r3.error && r3.error(e5);
                  });
                }));
              };
              return setTimeout(l2, 0), e3;
            });
            return e2.hasValue = function() {
              return p2;
            }, e2.getValue = function() {
              return d2;
            }, e2;
          }
          var sr2 = nr2;
          function cr2(e2) {
            var t3 = fr2;
            try {
              fr2 = true, Ut.storagemutated.fire(e2), qn2(e2, true);
            } finally {
              fr2 = t3;
            }
          }
          r2(sr2, _(_({}, Q2), { delete: function(e2) {
            return new sr2(e2, { addons: [] }).delete();
          }, exists: function(e2) {
            return new sr2(e2, { addons: [] }).open().then(function(e3) {
              return e3.close(), true;
            }).catch("NoSuchDatabaseError", function() {
              return false;
            });
          }, getDatabaseNames: function(e2) {
            try {
              return t3 = sr2.dependencies, n2 = t3.indexedDB, t3 = t3.IDBKeyRange, (bn2(n2) ? Promise.resolve(n2.databases()).then(function(e3) {
                return e3.map(function(e4) {
                  return e4.name;
                }).filter(function(e4) {
                  return e4 !== tt2;
                });
              }) : mn2(n2, t3).toCollection().primaryKeys()).then(e2);
            } catch (e3) {
              return Xe2(new Y2.MissingAPI());
            }
            var t3, n2;
          }, defineClass: function() {
            return function(e2) {
              a(this, e2);
            };
          }, ignoreTransaction: function(e2) {
            return me2.trans ? $e2(me2.transless, e2) : e2();
          }, vip: gn2, async: function(t3) {
            return function() {
              try {
                var e2 = Rn2(t3.apply(this, arguments));
                return e2 && "function" == typeof e2.then ? e2 : _e2.resolve(e2);
              } catch (e3) {
                return Xe2(e3);
              }
            };
          }, spawn: function(e2, t3, n2) {
            try {
              var r3 = Rn2(e2.apply(n2, t3 || []));
              return r3 && "function" == typeof r3.then ? r3 : _e2.resolve(r3);
            } catch (e3) {
              return Xe2(e3);
            }
          }, currentTransaction: { get: function() {
            return me2.trans || null;
          } }, waitFor: function(e2, t3) {
            t3 = _e2.resolve("function" == typeof e2 ? sr2.ignoreTransaction(e2) : e2).timeout(t3 || 6e4);
            return me2.trans ? me2.trans.waitFor(t3) : t3;
          }, Promise: _e2, debug: { get: function() {
            return ie2;
          }, set: function(e2) {
            oe2(e2);
          } }, derive: o, extend: a, props: r2, override: p, Events: mt, on: Ut, liveQuery: ur2, extendObservabilitySet: Sn2, getByKeyPath: g, setByKeyPath: w, delByKeyPath: function(t3, e2) {
            "string" == typeof e2 ? w(t3, e2, void 0) : "length" in e2 && [].map.call(e2, function(e3) {
              w(t3, e3, void 0);
            });
          }, shallowClone: k2, deepClone: S, getObjectDiff: Nn2, cmp: st, asap: v, minKey: -1 / 0, addons: [], connections: et2, errnames: z, dependencies: ir2, cache: An2, semVer: "4.2.1", version: "4.2.1".split(".").map(function(e2) {
            return parseInt(e2);
          }).reduce(function(e2, t3, n2) {
            return e2 + t3 / Math.pow(10, 2 * n2);
          }) })), sr2.maxKey = Qt2(sr2.dependencies.IDBKeyRange), "undefined" != typeof dispatchEvent && "undefined" != typeof addEventListener && (Ut(Nt, function(e2) {
            fr2 || (e2 = new CustomEvent(Lt2, { detail: e2 }), fr2 = true, dispatchEvent(e2), fr2 = false);
          }), addEventListener(Lt2, function(e2) {
            e2 = e2.detail;
            fr2 || cr2(e2);
          }));
          var lr2, fr2 = false, hr2 = function() {
          };
          return "undefined" != typeof BroadcastChannel && ((hr2 = function() {
            (lr2 = new BroadcastChannel(Lt2)).onmessage = function(e2) {
              return e2.data && cr2(e2.data);
            };
          })(), "function" == typeof lr2.unref && lr2.unref(), Ut(Nt, function(e2) {
            fr2 || lr2.postMessage(e2);
          })), "undefined" != typeof addEventListener && (addEventListener("pagehide", function(e2) {
            if (!nr2.disableBfCache && e2.persisted) {
              ie2 && console.debug("Dexie: handling persisted pagehide"), null != lr2 && lr2.close();
              for (var t3 = 0, n2 = et2; t3 < n2.length; t3++) n2[t3].close({ disableAutoOpen: false });
            }
          }), addEventListener("pageshow", function(e2) {
            !nr2.disableBfCache && e2.persisted && (ie2 && console.debug("Dexie: handling persisted pageshow"), hr2(), cr2({ all: new _n2(-1 / 0, [[]]) }));
          })), _e2.rejectionMapper = function(e2, t3) {
            return !e2 || e2 instanceof N || e2 instanceof TypeError || e2 instanceof SyntaxError || !e2.name || !$2[e2.name] ? e2 : (t3 = new $2[e2.name](t3 || e2.message, e2), "stack" in e2 && l(t3, "stack", { get: function() {
              return this.inner.stack;
            } }), t3);
          }, oe2(ie2), _(nr2, Object.freeze({ __proto__: null, Dexie: nr2, liveQuery: ur2, Entity: ut2, cmp: st, PropModification: ht2, replacePrefix: function(e2, t3) {
            return new ht2({ replacePrefix: [e2, t3] });
          }, add: function(e2) {
            return new ht2({ add: e2 });
          }, remove: function(e2) {
            return new ht2({ remove: e2 });
          }, default: nr2, RangeSet: _n2, mergeRanges: kn2, rangesOverlap: On2 }), { default: nr2 }), nr2;
        });
      })(dexie_min$1);
      return dexie_min$1.exports;
    }
    var dexie_minExports = requireDexie_min();
    const _Dexie = /* @__PURE__ */ getDefaultExportFromCjs(dexie_minExports);
    const DexieSymbol = Symbol.for("Dexie");
    const Dexie = globalThis[DexieSymbol] || (globalThis[DexieSymbol] = _Dexie);
    if (_Dexie.semVer !== Dexie.semVer) {
      throw new Error(`Two different versions of Dexie loaded in the same app: ${_Dexie.semVer} and ${Dexie.semVer}`);
    }
    const {
      liveQuery,
      mergeRanges,
      rangesOverlap,
      RangeSet: RangeSet$1,
      cmp,
      Entity,
      PropModification,
      replacePrefix,
      add: add$1,
      remove: remove$1,
      DexieYProvider
    } = Dexie;
    const DB_VERSION = 9;
    function resolveDBName(databaseHandle) {
      const sanitizedDir = databaseHandle.replace(/[^a-zA-Z0-9_-]/g, "_");
      const dbName = `InspectAI_${sanitizedDir}`;
      return dbName;
    }
    class AppDatabase extends Dexie {
      logs;
      log_previews;
      log_details;
      /**
       * Check if an existing database needs to be recreated due to version mismatch.
       * Returns true if the database should be deleted and recreated.
       */
      static async checkVersionMismatch(databaseHandle) {
        const dbName = resolveDBName(databaseHandle);
        try {
          const existingDb = await Dexie.exists(dbName);
          if (!existingDb) {
            return false;
          }
          const tempDb = new Dexie(dbName);
          await tempDb.open();
          const currentVersion = tempDb.verno;
          tempDb.close();
          if (currentVersion !== DB_VERSION) {
            console.log(
              `Database version mismatch (found v${currentVersion}, expected v${DB_VERSION})`
            );
            return true;
          }
          return false;
        } catch (error2) {
          return false;
        }
      }
      constructor(databaseHandle) {
        super(resolveDBName(databaseHandle));
        this.version(DB_VERSION).stores({
          // Basic file listing - indexes for querying and sorting
          logs: "++id, &file_path, mtime, task, task_id, cached_at",
          // Log summaries from get_log_summaries() - indexes for common queries
          log_previews: "file_path, preview.status, preview.task_id, preview.model, cached_at",
          // Complete log info from get_log_details() - includes samples
          log_details: "file_path, details.status, cached_at"
        });
      }
    }
    const getEnabledNamespaces = () => {
      return "*".split(",").map((ns) => ns.trim()).filter(Boolean);
    };
    new Set(getEnabledNamespaces());
    const createLogger = (namespace) => {
      const logger = {
        debug: (message2, ...args2) => {
        },
        info: (message2, ...args2) => {
        },
        warn: (message2, ...args2) => {
        },
        // Always log errors, even in production
        error: (message2, ...args2) => {
          console.error(`[${namespace}] ${message2}`, ...args2);
        },
        // Lazy evaluation for expensive logs
        debugIf: (fn2) => {
        }
      };
      return logger;
    };
    const log$b = createLogger("DatabaseManager");
    class DatabaseManager {
      database = null;
      databaseHandle = null;
      /**
       * Opens a database for the specified log directory.
       * If already connected to this directory, returns the existing connection.
       * If connected to a different directory, closes the current connection first.
       */
      async openDatabase(databaseHandle) {
        if (this.databaseHandle === databaseHandle && this.database) {
          return this.database;
        }
        log$b.debug(`Opening database for log directory: ${databaseHandle}`);
        if (this.database && this.databaseHandle !== databaseHandle) {
          await this.close();
        }
        const needsRecreation = await AppDatabase.checkVersionMismatch(databaseHandle);
        if (needsRecreation) {
          log$b.info(
            `Recreating database due to version mismatch for: ${databaseHandle}`
          );
          const sanitizedDir = databaseHandle.replace(/[^a-zA-Z0-9_-]/g, "_");
          const dbName = `InspectAI_${sanitizedDir}`;
          await Dexie.delete(dbName);
          log$b.debug(`Deleted old database: ${dbName}`);
        }
        this.database = new AppDatabase(databaseHandle);
        this.databaseHandle = databaseHandle;
        try {
          await this.database.open();
          log$b.debug(`Successfully opened database for: ${databaseHandle}`);
          return this.database;
        } catch (error2) {
          log$b.error(`Failed to open database for ${databaseHandle}:`, error2);
          this.database = null;
          this.databaseHandle = null;
          throw error2;
        }
      }
      /**
       * Get the current database instance.
       * Returns null if no database is open.
       */
      getDatabase() {
        return this.database;
      }
      /**
       * Get the current log directory.
       * Returns null if no database is open.
       */
      getDatabaseHandle() {
        return this.databaseHandle;
      }
      /**
       * Close the current database connection.
       */
      async close() {
        if (this.database) {
          log$b.debug(`Closing database for: ${this.databaseHandle}`);
          this.database.close();
          this.database = null;
          this.databaseHandle = null;
        }
      }
      /**
       * Check if a database is currently open.
       */
      isOpen() {
        return this.database !== null && this.databaseHandle !== null;
      }
      /**
       * Get database info for debugging.
       */
      getInfo() {
        return {
          databaseHandle: this.databaseHandle,
          isOpen: this.isOpen()
        };
      }
    }
    const log$a = createLogger("DatabaseService");
    class DatabaseService {
      manager;
      constructor(manager) {
        this.manager = manager;
      }
      /**
       * Get the current database instance.
       * Throws an error if no database is open.
       */
      getDb() {
        const db = this.manager.getDatabase();
        if (!db) {
          throw new Error("No database initialized. Call openDatabase first.");
        }
        return db;
      }
      opened() {
        return this.manager.getDatabase() !== null;
      }
      /**
       * Open a database for the specified log directory.
       */
      async openDatabase(databaseHandle) {
        await this.manager.openDatabase(databaseHandle);
      }
      /**
       * Close the current database connection.
       */
      async closeDatabase() {
        await this.manager.close();
      }
      /**
       * Get the current log directory.
       */
      getDatabaseHandle() {
        return this.manager.getDatabaseHandle();
      }
      async countRows(entity2) {
        const db = this.getDb();
        switch (entity2) {
          case "logs":
            return db.logs.count();
          case "logPreviews":
            return db.log_previews.count();
          case "logDetails":
            return db.log_details.count();
        }
      }
      // === LOG FILES ===
      async writeLogs(logs) {
        const db = this.getDb();
        const now = (/* @__PURE__ */ new Date()).toISOString();
        const existingRecords = await db.logs.toArray();
        const existingByPath = new Map(
          existingRecords.map((r2) => [r2.file_path, r2.id])
        );
        const records = logs.map((file) => ({
          id: existingByPath.get(file.name),
          file_path: file.name,
          file_name: file.name.split("/").pop() || file.name,
          task: file.task,
          task_id: file.task_id,
          mtime: file.mtime,
          cached_at: now
        }));
        log$a.debug(`Caching ${records.length} log files`);
        await db.logs.bulkPut(records);
      }
      async readLogs() {
        try {
          if (!this.opened()) {
            log$a.debug("Database not open");
            return null;
          }
          const db = this.getDb();
          let files = await db.logs.toArray();
          files.sort((a, b) => {
            if (a.mtime !== void 0 && b.mtime !== void 0) {
              return b.mtime - a.mtime;
            }
            if (a.id !== void 0 && b.id !== void 0) {
              return a.id - b.id;
            }
            return 0;
          });
          if (files.length === 0) {
            log$a.debug("No cached log files found");
            return [];
          }
          log$a.debug(`Retrieved ${files.length} cached log files`);
          return files.map((file) => ({
            name: file.file_path,
            task: file.task,
            task_id: file.task_id,
            mtime: file.mtime
          }));
        } catch (error2) {
          log$a.error("Error retrieving cached log files:", error2);
          return null;
        }
      }
      // === LOG PREVIEWS ===
      async writeLogPreviews(previews, filePaths) {
        const db = this.getDb();
        const now = (/* @__PURE__ */ new Date()).toISOString();
        const records = previews.map((summary2, index) => ({
          file_path: filePaths[index],
          cached_at: now,
          preview: summary2
        }));
        log$a.debug(`Caching ${records.length} log previews`);
        await db.log_previews.bulkPut(records);
      }
      async readLogPreviews(logs) {
        try {
          const filePaths = logs.map((log2) => log2.name);
          const db = this.getDb();
          const records = await db.log_previews.where("file_path").anyOf(filePaths).toArray();
          log$a.debug(
            `Retrieved ${records.length} cached log previews out of ${filePaths.length} requested`
          );
          const result2 = {};
          for (const record of records) {
            result2[record.file_path] = record.preview;
          }
          return result2;
        } catch (error2) {
          log$a.error("Error retrieving cached log summaries:", error2);
          return {};
        }
      }
      async findMissingPreviews(logs) {
        try {
          const filePaths = logs.map((log2) => log2.name);
          const db = this.getDb();
          const records = await db.log_previews.where("file_path").anyOf(filePaths).toArray();
          const cachedPaths = new Set(records.map((r2) => r2.file_path));
          const missing = logs.filter((log2) => !cachedPaths.has(log2.name));
          log$a.debug(
            `Found ${missing.length} missing previews out of ${logs.length} requested`
          );
          return missing;
        } catch (error2) {
          log$a.error("Error finding missing previews:", error2);
          return logs;
        }
      }
      // === LOG DETAILS ===
      async writeLogDetail(filePath, info) {
        const db = this.getDb();
        const now = (/* @__PURE__ */ new Date()).toISOString();
        const record = {
          file_path: filePath,
          cached_at: now,
          details: info
        };
        log$a.debug(`Caching log info for: ${filePath}`);
        await db.log_details.put(record);
      }
      async writeLogDetails(details) {
        const db = this.getDb();
        const now = (/* @__PURE__ */ new Date()).toISOString();
        const records = Object.entries(details).map(([filePath, info]) => ({
          file_path: filePath,
          cached_at: now,
          details: info
        }));
        log$a.debug(`Caching ${records.length} log details`);
        await db.log_details.bulkPut(records);
      }
      async readLogDetailsForFile(filePath) {
        try {
          const db = this.getDb();
          const record = await db.log_details.get(filePath);
          if (!record) {
            log$a.debug(`No cached log info found for: ${filePath}`);
            return null;
          }
          log$a.debug(`Retrieved cached log info for: ${filePath}`);
          return record.details;
        } catch (error2) {
          log$a.error(`Error retrieving cached log info for ${filePath}:`, error2);
          return null;
        }
      }
      async readLogDetails(logs) {
        try {
          const filePaths = logs.map((log2) => log2.name);
          const db = this.getDb();
          const records = await db.log_details.where("file_path").anyOf(filePaths).toArray();
          log$a.debug(
            `Retrieved ${records.length} cached log details out of ${filePaths.length} requested`
          );
          const result2 = {};
          for (const record of records) {
            result2[record.file_path] = record.details;
          }
          return result2;
        } catch (error2) {
          log$a.error("Error retrieving cached log details:", error2);
          return {};
        }
      }
      async findMissingDetails(logs) {
        try {
          const filePaths = logs.map((log2) => log2.name);
          const db = this.getDb();
          const records = await db.log_details.where("file_path").anyOf(filePaths).toArray();
          const cachedPaths = new Set(records.map((r2) => r2.file_path));
          const missing = logs.filter((log2) => !cachedPaths.has(log2.name));
          log$a.debug(
            `Found ${missing.length} missing details out of ${logs.length} requested`
          );
          return missing;
        } catch (error2) {
          log$a.error("Error finding missing details:", error2);
          return logs;
        }
      }
      // === SAMPLE SUMMARIES (extracted from LogDetails) ===
      async readAllSampleSummaries() {
        const db = this.getDb();
        const records = await db.log_details.toArray();
        const allSummaries = [];
        for (const record of records) {
          if (record.details.sampleSummaries) {
            allSummaries.push(...record.details.sampleSummaries);
          }
        }
        log$a.debug(
          `Retrieved ${allSummaries.length} sample summaries across all files`
        );
        return allSummaries;
      }
      async readSampleSummariesForFile(filePath) {
        const logInfo = await this.readLogDetailsForFile(filePath);
        if (!logInfo || !logInfo.sampleSummaries) {
          return [];
        }
        return logInfo.sampleSummaries;
      }
      async querySampleSummaries(filter) {
        const allSummaries = await this.readAllSampleSummaries();
        let filtered = allSummaries;
        if (filter?.completed !== void 0) {
          filtered = filtered.filter(
            (summary2) => summary2.completed === filter.completed
          );
        }
        if (filter?.hasError !== void 0) {
          filtered = filtered.filter((summary2) => {
            const hasError = !!summary2.error;
            return hasError === filter.hasError;
          });
        }
        if (filter?.scoreRange) {
          const { min: min2, max: max2, scoreName } = filter.scoreRange;
          filtered = filtered.filter((summary2) => {
            if (!summary2.scores) return false;
            if (scoreName) {
              const score2 = summary2.scores[scoreName];
              return score2 && typeof score2.value === "number" && score2.value >= min2 && score2.value <= max2;
            } else {
              return Object.values(summary2.scores).some(
                (score2) => score2 && typeof score2.value === "number" && score2.value >= min2 && score2.value <= max2
              );
            }
          });
        }
        log$a.debug(
          `Query returned ${filtered.length} sample summaries (filtered from ${allSummaries.length})`
        );
        return filtered;
      }
      // === MANAGEMENT ===
      /**
       * Clear all cached data from all tables.
       */
      async clearAllCaches() {
        const db = this.getDb();
        log$a.debug("Clearing all caches");
        await Promise.all([
          db.logs.clear(),
          db.log_previews.clear(),
          db.log_details.clear()
        ]);
      }
      /**
       * Clear cache for a specific log file
       */
      async clearCacheForFile(filePath) {
        const db = this.getDb();
        log$a.debug(`Clearing cache for file: ${filePath}`);
        await Promise.all([
          db.logs.where("file_path").equals(filePath).delete(),
          db.log_previews.where("file_path").equals(filePath).delete(),
          db.log_details.where("file_path").equals(filePath).delete()
        ]);
      }
      /**
       * Get cache statistics.
       */
      async getCacheStats() {
        const db = this.getDb();
        const [logFiles, logSummaries, logInfo] = await Promise.all([
          db.logs.count(),
          db.log_previews.count(),
          db.log_details.count()
        ]);
        let sampleSummaries = 0;
        const logInfoRecords = await db.log_details.toArray();
        for (const record of logInfoRecords) {
          if (record.details.sampleSummaries) {
            sampleSummaries += record.details.sampleSummaries.length;
          }
        }
        return {
          logFiles,
          logSummaries,
          logHeaders: logInfo,
          // For backward compatibility
          sampleSummaries,
          logHandle: this.manager.getDatabaseHandle()
        };
      }
    }
    function createDatabaseService() {
      const manager = new DatabaseManager();
      return new DatabaseService(manager);
    }
    function throttle$1(func, wait, options2 = {}) {
      let context;
      let args2;
      let result2;
      let timeout = null;
      let previous = 0;
      const later = function() {
        previous = options2.leading === false ? 0 : Date.now();
        timeout = null;
        result2 = func.apply(context, args2 === null ? [] : args2);
        if (!timeout) {
          context = null;
          args2 = null;
        }
      };
      return function(...callArgs) {
        const now = Date.now();
        if (!previous && options2.leading === false) {
          previous = now;
        }
        const remaining = wait - (now - previous);
        context = this;
        args2 = callArgs;
        if (remaining <= 0 || remaining > wait) {
          if (timeout) {
            clearTimeout(timeout);
            timeout = null;
          }
          previous = now;
          result2 = func.apply(context, args2);
          if (!timeout) {
            context = null;
            args2 = null;
          }
        } else if (!timeout && options2.trailing !== false) {
          timeout = setTimeout(later, remaining);
        }
        return result2;
      };
    }
    function debounce$2(func, wait, options2 = {}) {
      let timeout = null;
      let context;
      let args2;
      let result2;
      let lastCallTime = null;
      const later = () => {
        const last = Date.now() - (lastCallTime || 0);
        if (last < wait && last >= 0) {
          timeout = setTimeout(later, wait - last);
        } else {
          timeout = null;
          if (!options2.leading) {
            result2 = func.apply(context, args2);
            if (!timeout) {
              context = null;
              args2 = null;
            }
          }
        }
      };
      return function(...callArgs) {
        context = this;
        args2 = callArgs;
        lastCallTime = Date.now();
        const callNow = options2.leading && !timeout;
        if (!timeout) {
          timeout = setTimeout(later, wait);
        }
        if (callNow) {
          result2 = func.apply(context, args2);
          context = null;
          args2 = null;
        }
        return result2;
      };
    }
    const kModelNone = "none/none";
    const kLogViewSamplesTabId = "samples";
    const kLogViewJsonTabId = "json";
    const kLogViewInfoTabId = "info";
    const kLogViewModelsTabId = "models";
    const kLogViewTaskTabId = "task";
    const kLogViewErrorTabId = "error";
    const kWorkspaceTabs = [
      kLogViewSamplesTabId,
      kLogViewJsonTabId,
      kLogViewInfoTabId,
      kLogViewModelsTabId,
      kLogViewTaskTabId,
      kLogViewErrorTabId
    ];
    const kSampleMessagesTabId = `messages`;
    const kSampleTranscriptTabId = `transcript`;
    const kSampleScoringTabId = `scoring`;
    const kSampleMetdataTabId = `metadata`;
    const kSampleErrorTabId = `error`;
    const kSampleErrorRetriesTabId = `retry-errors`;
    const kSampleJsonTabId = `json`;
    const kSampleTabIds = [
      kSampleMessagesTabId,
      kSampleTranscriptTabId,
      kSampleScoringTabId,
      kSampleMetdataTabId,
      kSampleErrorTabId,
      kSampleErrorRetriesTabId,
      kSampleJsonTabId
    ];
    const kScoreTypePassFail = "passfail";
    const kScoreTypeCategorical = "categorical";
    const kScoreTypeNumeric = "numeric";
    const kScoreTypeOther = "other";
    const kScoreTypeObject = "object";
    const kScoreTypeBoolean = "boolean";
    const kScoreTypeList = "list";
    const kSampleAscVal = "sample-asc";
    const kSampleDescVal = "sample-desc";
    const kEpochAscVal = "epoch-asc";
    const kEpochDescVal = "epoch-desc";
    const kScoreAscVal = "score-asc";
    const kScoreDescVal = "score-desc";
    const kDefaultSort = kSampleAscVal;
    const clearDocumentSelection = () => {
      const sel = window.getSelection();
      if (sel) {
        if (sel.removeAllRanges) {
          sel.removeAllRanges();
        } else if (sel.empty) {
          sel.empty();
        }
      }
    };
    const kDefaultWorkspaceTab = kLogViewSamplesTabId;
    const kDefaultSampleTab = kSampleTranscriptTabId;
    const initialState$3 = {
      status: { loading: 0, syncing: false },
      showFind: false,
      dialogs: {
        sample: false,
        transcriptFilter: false,
        options: false
      },
      tabs: {
        workspace: kDefaultWorkspaceTab,
        sample: kDefaultSampleTab
      },
      scrollPositions: {},
      listPositions: {},
      visibleRanges: {},
      collapsed: {},
      messages: {},
      propertyBags: {},
      displayMode: "rendered",
      logsSampleView: false
    };
    const createAppSlice = (set2, get2, _store) => {
      const getBoolRecord = (record, name2, defaultValue) => {
        if (Object.keys(record).includes(name2)) {
          return record[name2];
        } else {
          return defaultValue || false;
        }
      };
      const slice = {
        // State
        app: initialState$3,
        capabilities: {},
        // Actions
        appActions: {
          setLoading: (loading, error2) => set2((state) => {
            state.app.status.loading = Math.max(
              state.app.status.loading + (loading ? 1 : -1),
              0
            );
            state.app.status.error = error2;
          }),
          setShowFind: (show) => set2((state) => {
            state.app.showFind = show;
          }),
          hideFind: () => {
            clearDocumentSelection();
            set2((state) => {
              state.app.showFind = false;
            });
          },
          setNativeFind: (nativeFind) => set2((state) => {
            state.app.nativeFind = nativeFind;
          }),
          setShowingSampleDialog: (showing) => {
            const state = get2();
            const isShowing = state.app.dialogs.sample;
            if (showing === isShowing) {
              return;
            }
            set2((state2) => {
              state2.app.dialogs.sample = showing;
            });
            if (!showing) {
              const state2 = get2();
              state2.appActions.clearSampleTab();
            }
          },
          setShowingTranscriptFilterDialog: (showing) => {
            const state = get2();
            const isShowing = state.app.dialogs.transcriptFilter;
            if (showing === isShowing) {
              return;
            }
            set2((state2) => {
              state2.app.dialogs.transcriptFilter = showing;
            });
          },
          setShowingOptionsDialog: (showing) => {
            const state = get2();
            const isShowing = state.app.dialogs.options;
            if (showing === isShowing) {
              return;
            }
            set2((state2) => {
              state2.app.dialogs.options = showing;
            });
          },
          setWorkspaceTab: (tab2) => {
            set2((state) => {
              state.app.tabs.workspace = tab2;
            });
          },
          clearWorkspaceTab: () => {
            set2((state) => {
              state.app.tabs.workspace = kDefaultWorkspaceTab;
            });
          },
          setInitialState: (log2, sample_id, sample_epoch) => {
            set2((state) => {
              state.app.initialState = {
                log: log2,
                sample_id,
                sample_epoch
              };
            });
          },
          clearInitialState: () => {
            set2((state) => {
              state.app.initialState = void 0;
            });
          },
          setSampleTab: (tab2) => {
            set2((state) => {
              state.app.tabs.sample = tab2;
            });
          },
          clearSampleTab: () => {
            set2((state) => {
              state.app.tabs.sample = kDefaultSampleTab;
            });
          },
          getScrollPosition: (name2) => {
            const state = get2();
            return state.app.scrollPositions[name2];
          },
          setScrollPosition: (name2, position) => {
            set2((state) => {
              state.app.scrollPositions[name2] = position;
            });
          },
          getListPosition: (name2) => {
            const state = get2();
            if (Object.keys(state.app.listPositions).includes(name2)) {
              return state.app.listPositions[name2];
            } else {
              return void 0;
            }
          },
          setListPosition: (name2, position) => {
            set2((state) => {
              state.app.listPositions[name2] = position;
            });
          },
          clearListPosition: (name2) => {
            set2((state) => {
              const newListPositions = { ...state.app.listPositions };
              delete newListPositions[name2];
              return {
                app: {
                  ...state.app,
                  listPositions: newListPositions
                }
              };
            });
          },
          getVisibleRange: (name2) => {
            const state = get2();
            if (Object.keys(state.app.visibleRanges).includes(name2)) {
              return state.app.visibleRanges[name2];
            } else {
              return { startIndex: 0, endIndex: 0 };
            }
          },
          setVisibleRange: (name2, value2) => {
            set2((state) => {
              state.app.visibleRanges[name2] = value2;
            });
          },
          clearVisibleRange: (name2) => {
            set2((state) => {
              const newVisibleRanges = { ...state.app.visibleRanges };
              delete newVisibleRanges[name2];
              return {
                app: {
                  ...state.app,
                  visibleRanges: newVisibleRanges
                }
              };
            });
          },
          getCollapsed: (name2, defaultValue) => {
            return getBoolRecord(get2().app.collapsed, name2, defaultValue);
          },
          setCollapsed: (name2, value2) => {
            set2((state) => {
              state.app.collapsed[name2] = value2;
            });
          },
          getMessageVisible: (name2, defaultValue) => {
            return getBoolRecord(get2().app.messages, name2, defaultValue);
          },
          setMessageVisible: (name2, value2) => {
            set2((state) => {
              state.app.messages[name2] = value2;
            });
          },
          clearMessageVisible: (name2) => {
            set2((state) => {
              delete state.app.messages[name2];
            });
          },
          getPropertyValue: (bagName, key2, defaultValue) => {
            const state = get2();
            const bag = state.app.propertyBags[bagName] || {};
            return key2 in bag ? bag[key2] : defaultValue;
          },
          setPropertyValue: (bagName, key2, value2) => {
            set2((state) => {
              if (!state.app.propertyBags[bagName]) {
                state.app.propertyBags[bagName] = {};
              }
              state.app.propertyBags[bagName][key2] = value2;
            });
          },
          removePropertyValue: (bagName, key2) => {
            set2((state) => {
              if (state.app.propertyBags[bagName]) {
                const { [key2]: _, ...rest } = state.app.propertyBags[bagName];
                state.app.propertyBags[bagName] = rest;
              }
            });
          },
          setUrlHash: (urlHash) => {
            set2((state) => {
              state.app.urlHash = urlHash;
            });
          },
          setSingleFileMode: (singleFile) => {
            set2((state) => {
              state.app.singleFileMode = singleFile;
            });
          },
          setDisplayMode: (mode) => {
            set2((state) => {
              state.app.displayMode = mode;
            });
          },
          setLogsSampleView: (logsSampleView) => {
            set2((state) => {
              state.app.logsSampleView = logsSampleView;
            });
          }
        }
      };
      const cleanup = () => {
      };
      return [slice, cleanup];
    };
    const initializeAppSlice = (set2, capabilities2) => {
      set2((state) => {
        state.capabilities = capabilities2;
        if (!state.app) {
          state.app = initialState$3;
        }
      });
    };
    const sampleIdsEqual = (id, otherId) => {
      if (id === void 0 && otherId === void 0) {
        return true;
      }
      if (id === void 0 || otherId === void 0) {
        return false;
      }
      return String(id) === String(otherId);
    };
    const toLogPreview = (header2) => {
      return {
        eval_id: header2.eval.eval_id,
        run_id: header2.eval.run_id,
        task: header2.eval.task,
        task_id: header2.eval.task_id,
        task_version: header2.eval.task_version,
        version: header2.version,
        status: header2.status,
        error: header2.error,
        model: header2.eval.model,
        started_at: header2.stats?.started_at,
        completed_at: header2.stats?.completed_at,
        primary_metric: primaryMetric(header2.results)
      };
    };
    const primaryMetric = (evalResults) => {
      if (evalResults?.scores && evalResults?.scores.length > 0) {
        const evalMetrics = evalResults.scores[0].metrics;
        const metrics = Object.values(evalMetrics);
        if (metrics.length > 0) {
          return metrics[0];
        }
      }
      return void 0;
    };
    const directoryRelativeUrl = (file, dir) => {
      if (!dir) {
        return uriEncodePathSegments(file);
      }
      const normalizedFile = file.replace(/\\/g, "/");
      const normalizedLogDir = dir.replace(/\\/g, "/");
      const dirWithSlash = normalizedLogDir.endsWith("/") ? normalizedLogDir : normalizedLogDir + "/";
      if (normalizedFile.startsWith(dirWithSlash)) {
        const relativePath = normalizedFile.substring(dirWithSlash.length);
        const segments2 = relativePath.split("/");
        const encodedSegments = segments2.map(
          (segment2) => encodeURIComponent(segment2)
        );
        return encodedSegments.join("/");
      }
      return uriEncodePathSegments(normalizedFile);
    };
    const uriEncodePathSegments = (path) => {
      const segments2 = path.split("/");
      return segments2.map((segment2) => encodeURIComponent(segment2)).join("/");
    };
    const join = (file, dir) => {
      if (!dir) {
        return file;
      }
      const normalizedFile = file.replace(/\\/g, "/");
      const normalizedLogDir = dir.replace(/\\/g, "/");
      const dirWithSlash = normalizedLogDir.endsWith("/") ? normalizedLogDir : normalizedLogDir + "/";
      if (normalizedFile.startsWith(dirWithSlash)) {
        return normalizedFile;
      }
      return dirWithSlash + normalizedFile;
    };
    function encodePathParts(url) {
      if (!url) return url;
      try {
        const fullUrl = new URL(url);
        fullUrl.pathname = fullUrl.pathname.split("/").map(
          (segment2) => segment2 ? encodeURIComponent(decodeURIComponent(segment2)) : ""
        ).join("/");
        return fullUrl.toString();
      } catch {
        return url.split("/").map(
          (segment2) => segment2 ? encodeURIComponent(decodeURIComponent(segment2)) : ""
        ).join("/");
      }
    }
    const isUri = (value2) => {
      if (!value2) return false;
      try {
        new URL(value2);
        return true;
      } catch {
        return false;
      }
    };
    const prettyDirUri = (uri) => {
      if (uri.startsWith("file://")) {
        return uri.replace("file://", "");
      } else {
        return uri;
      }
    };
    const createPolling = (name2, callback, options2) => {
      const log2 = createLogger(`Polling ${name2}`);
      const { maxRetries, interval } = options2;
      let timeoutId = null;
      let retryCount = 0;
      let isPolling = false;
      let isStopped = false;
      const calculateBackoff = (retryCount2) => {
        return Math.min(interval * Math.pow(2, retryCount2) * 1e3, 6e4);
      };
      const stop = () => {
        if (timeoutId) {
          clearTimeout(timeoutId);
          timeoutId = null;
        }
        log2.debug("Stop Polling");
        isPolling = false;
        isStopped = true;
      };
      const poll = async () => {
        try {
          log2.debug("Poll");
          if (!isPolling || isStopped) {
            return;
          }
          const shouldContinue = await callback();
          if (shouldContinue === false) {
            stop();
            return;
          }
          retryCount = 0;
          if (!isPolling || isStopped) {
            return;
          }
          timeoutId = setTimeout(poll, interval * 1e3);
        } catch (e) {
          if (!isPolling || isStopped) {
            return;
          }
          log2.debug("Polling error occurred", e);
          retryCount += 1;
          if (retryCount >= maxRetries) {
            stop();
            throw new Error(
              `Gave up polling ${name2} after ${maxRetries} attempts.`
            );
          }
          const backoffTime = calculateBackoff(retryCount);
          log2.debug(
            `Retry ${retryCount}/${maxRetries}, backoff: ${backoffTime / 1e3}s`
          );
          timeoutId = setTimeout(poll, backoffTime);
        }
      };
      const start2 = () => {
        if (isPolling) {
          return;
        }
        log2.debug("Start Polling");
        isPolling = true;
        isStopped = false;
        poll();
      };
      return { name: name2, start: start2, stop };
    };
    const log$9 = createLogger("logPolling");
    const kRetries$1 = 10;
    const kPollingInterval$2 = 2;
    function createLogPolling(get2, set2) {
      let currentPolling = null;
      let abortController;
      const refreshLog = async (logFileName, clearPending = false) => {
        if (abortController?.signal.aborted) {
          return false;
        }
        const state = get2();
        const api2 = state.api;
        const selectedLogFile = state.logs.selectedLogFile;
        if (!api2 || !selectedLogFile) {
          return false;
        }
        log$9.debug(`refresh: ${selectedLogFile}`);
        try {
          const logDetails = await api2.get_log_details(selectedLogFile);
          set2((state2) => {
            state2.log.selectedLogDetails = logDetails;
            log$9.debug(
              `Setting refreshed summary ${logDetails.sampleSummaries.length} samples`,
              logDetails
            );
            if (clearPending) {
              const pendingSampleSummaries = state2.log.pendingSampleSummaries;
              if ((pendingSampleSummaries?.samples.length || 0) > 0) {
                log$9.debug(
                  `Clearing pending summaries during refresh for: ${logFileName}`
                );
                state2.log.pendingSampleSummaries = {
                  samples: [],
                  refresh: pendingSampleSummaries?.refresh || 2
                };
              }
            }
          });
          return true;
        } catch (error2) {
          log$9.error("Error refreshing log:", error2);
          return false;
        }
      };
      const startPolling = (logFileName) => {
        if (currentPolling) {
          currentPolling.stop();
        }
        abortController = new AbortController();
        let loadedPendingSamples = false;
        currentPolling = createPolling(
          `PendingSamples-${logFileName}`,
          async () => {
            if (abortController.signal.aborted) {
              log$9.debug(`Component unmounted, stopping poll for: ${logFileName}`);
              return false;
            }
            const state = get2();
            const api2 = state.api;
            if (!api2?.get_log_pending_samples) {
              return false;
            }
            if (abortController.signal.aborted) {
              return false;
            }
            log$9.debug(`Polling running samples: ${logFileName}`);
            const currentEtag = get2().log.pendingSampleSummaries?.etag;
            const pendingSamples = await api2.get_log_pending_samples(
              logFileName,
              currentEtag
            );
            log$9.debug(`Received pending samples`, pendingSamples);
            if (abortController.signal.aborted) {
              return false;
            }
            if (pendingSamples.status === "OK" && pendingSamples.pendingSamples) {
              loadedPendingSamples = true;
              set2((state2) => {
                state2.log.pendingSampleSummaries = pendingSamples.pendingSamples;
              });
              await refreshLog(logFileName, false);
              return true;
            } else if (pendingSamples.status === "NotFound") {
              log$9.debug(`Stop polling running samples: ${logFileName}`);
              if (loadedPendingSamples || state.log.selectedLogDetails?.status === "started") {
                log$9.debug(`Refresh log: ${logFileName}`);
                await refreshLog(logFileName, true);
              }
              return false;
            }
            return true;
          },
          {
            maxRetries: kRetries$1,
            interval: get2().log.pendingSampleSummaries?.refresh || kPollingInterval$2
          }
        );
        currentPolling.start();
      };
      const clearPendingSummaries = (logFileName) => {
        if (abortController.signal.aborted) {
          return false;
        }
        const pendingSampleSummaries = get2().log.pendingSampleSummaries;
        if ((pendingSampleSummaries?.samples.length || 0) > 0) {
          log$9.debug(`Clear pending: ${logFileName}`);
          return refreshLog(logFileName, true);
        }
        return false;
      };
      const stopPolling = () => {
        if (currentPolling) {
          currentPolling.stop();
          currentPolling = null;
        }
      };
      const cleanup = () => {
        log$9.debug(`Cleanup`);
        if (abortController) {
          abortController.abort();
        }
        stopPolling();
      };
      return {
        startPolling,
        stopPolling,
        clearPendingSummaries,
        cleanup,
        // Expose the refresh function so components can use it directly
        refreshLog: (clearPending = false) => refreshLog(get2().logs.selectedLogFile || "", clearPending)
      };
    }
    const log$8 = createLogger("logSlice");
    const initialState$2 = {
      // Log state
      șselectedSampleId: void 0,
      selectedSampleEpoch: void 0,
      selectedLogDetails: void 0,
      pendingSampleSummaries: void 0,
      loadedLog: void 0,
      // Filter state
      filter: "",
      filterError: void 0,
      epoch: "all",
      sort: kDefaultSort,
      selectedScores: void 0,
      scores: void 0
    };
    const createLogSlice = (set2, get2, _store) => {
      const logPolling = createLogPolling(get2, set2);
      const slice = {
        // State
        log: initialState$2,
        // Actions
        logActions: {
          selectSample: (sampleId, epoch) => {
            const currentSample = get2().log.selectedSampleHandle;
            if (sampleIdsEqual(currentSample?.id, sampleId) && currentSample?.epoch === epoch) {
              return;
            }
            set2((state) => {
              state.log.selectedSampleHandle = { id: sampleId, epoch };
            });
          },
          clearSelectedSample: () => {
            set2((state) => {
              state.log.selectedSampleHandle = void 0;
            });
          },
          setSelectedLogDetails: (details) => {
            set2((state) => {
              state.log.selectedScores = void 0;
              state.log.selectedLogDetails = details;
            });
            if (details.status !== "started" && details.sampleSummaries.length === 0) {
              get2().appActions.setWorkspaceTab(kLogViewInfoTabId);
            }
          },
          clearSelectedLogDetails: () => {
            set2((state) => {
              state.log.selectedLogDetails = void 0;
            });
          },
          setPendingSampleSummaries: (pendingSampleSummaries) => set2((state) => {
            state.log.pendingSampleSummaries = pendingSampleSummaries;
          }),
          setFilter: (filter) => set2((state) => {
            state.log.filter = filter;
          }),
          setFilterError: (error2) => set2((state) => {
            state.log.filterError = error2;
          }),
          clearFilterError: () => {
            set2((state) => {
              state.log.filterError = void 0;
            });
          },
          setEpoch: (epoch) => set2((state) => {
            state.log.epoch = epoch;
          }),
          setSort: (sort2) => set2((state) => {
            state.log.sort = sort2;
          }),
          setSelectedScores: (scores2) => set2((state) => {
            state.log.selectedScores = scores2;
          }),
          setScores: (scores2) => set2((state) => {
            state.log.scores = scores2;
          }),
          resetFiltering: () => set2((state) => {
            state.log.filter = "";
            state.log.filterError = void 0;
            state.log.epoch = "all";
            state.log.sort = kDefaultSort;
            state.log.selectedScores = state.log.scores?.slice(0, 1);
          }),
          syncLog: async (logFileName) => {
            const state = get2();
            const api2 = state.api;
            let logDir2 = state.logs.logDir;
            if (state.logs.logDir === void 0) {
              logDir2 = await state.logsActions.initLogDir();
            }
            const logAbsPath = !isUri(logFileName) ? join(logFileName, logDir2) : logFileName;
            if (!api2) {
              console.error("API not initialized in Store");
              return;
            }
            log$8.debug(`Load log: ${logAbsPath}`);
            const dbService = state.databaseService;
            if (dbService && dbService.opened()) {
              try {
                const cachedInfo = await dbService.readLogDetailsForFile(logAbsPath);
                if (cachedInfo) {
                  log$8.debug(`Using cached log info for: ${logAbsPath}`);
                  state.logActions.setSelectedLogDetails(cachedInfo);
                  api2.get_log_details(logAbsPath).then((logDetails) => {
                    state.logActions.setSelectedLogDetails(logDetails);
                    dbService.writeLogDetail(logAbsPath, logDetails).catch(() => {
                    });
                  });
                  const header2 = {
                    [logFileName]: toLogPreview(cachedInfo)
                  };
                  state.logsActions.updateLogPreviews(header2);
                  set2((state2) => {
                    state2.log.loadedLog = logFileName;
                  });
                  return;
                }
              } catch (e) {
              }
            }
            try {
              const logDetails = await api2.get_log_details(logFileName);
              state.logActions.setSelectedLogDetails(logDetails);
              if (dbService) {
                setTimeout(() => {
                  dbService.writeLogDetail(logFileName, logDetails).catch(() => {
                  });
                }, 0);
              }
              const header2 = {
                [logFileName]: toLogPreview(logDetails)
              };
              state.logsActions.updateLogPreviews(header2);
              set2((state2) => {
                state2.log.loadedLog = logFileName;
              });
              logPolling.startPolling(logFileName);
            } catch (error2) {
              log$8.error("Error loading log:", error2);
              throw error2;
            }
          },
          clearLog: () => {
            set2((state) => {
              state.log.loadedLog = void 0;
            });
          },
          pollLog: async () => {
            const currentLog = get2().log.loadedLog;
            if (currentLog) {
              logPolling.startPolling(currentLog);
            }
          },
          refreshLog: async () => {
            const state = get2();
            const api2 = state.api;
            const selectedLogFile = state.logs.selectedLogFile;
            if (!api2 || !selectedLogFile) {
              return;
            }
            log$8.debug(`refresh: ${selectedLogFile}`);
            try {
              const logDetails = await api2.get_log_details(selectedLogFile);
              state.logActions.setSelectedLogDetails(logDetails);
            } catch (error2) {
              log$8.error("Error refreshing log:", error2);
              throw error2;
            }
          },
          setFilteredSampleCount: (count) => {
            set2((state) => {
              state.log.filteredSampleCount = count;
            });
          },
          clearFilteredSampleCount: () => {
            set2((state) => {
              state.log.filteredSampleCount = void 0;
            });
          }
        }
      };
      const cleanup = () => {
        logPolling.cleanup();
      };
      return [slice, cleanup];
    };
    const initalializeLogSlice = (set2) => {
      set2((state) => {
        if (!state.log) {
          state.log = initialState$2;
        }
      });
    };
    const log$7 = createLogger("Log Slice");
    const initialState$1 = {
      logDir: void 0,
      logs: [],
      logPreviews: {},
      logDetails: {},
      selectedLogFile: void 0,
      listing: {
        columnVisibility: {}
      },
      pendingRequests: /* @__PURE__ */ new Map(),
      dbStats: {
        logCount: 0,
        previewCount: 0,
        detailsCount: 0
      },
      samplesListState: {
        columnVisibility: {}
      },
      showRetriedLogs: false
    };
    const createLogsSlice = (set2, get2, _store) => {
      const slice = {
        // State
        logs: initialState$1,
        // Actions
        logsActions: {
          setLogDir: (logDir2) => {
            set2((state) => {
              if (logDir2 !== state.logs.logDir) {
                state.logs.logDir = logDir2;
                state.logs.samplesListState.gridState = void 0;
                state.logs.listing.gridState = void 0;
                state.logs.listing.previousLogPath = void 0;
              }
            });
          },
          setLogHandles: (logs) => set2((state) => {
            state.logs.logs = logs;
          }),
          syncLogPreviews: async (logs) => {
            const state = get2();
            const api2 = state.api;
            if (!api2) {
              console.error("API not initialized in LogsStore");
              return;
            }
            if (!state.replicationService) {
              console.error("Replication service not initialized in LogsStore");
              return;
            }
            try {
              await state.replicationService?.loadLogPreviews({ logs });
            } catch (e) {
              console.error("Failed to sync log previews", e);
            }
          },
          updateLogPreviews: (previews) => set2((state) => {
            state.logs.logPreviews = {
              ...get2().logs.logPreviews,
              ...previews
            };
          }),
          updateLogDetails: (details) => set2((state) => {
            state.logs.logDetails = {
              ...get2().logs.logDetails,
              ...details
            };
          }),
          setGridState: (gridState) => {
            set2((state) => {
              state.logs.samplesListState.gridState = gridState;
            });
          },
          clearGridState: () => {
            set2((state) => {
              state.logs.samplesListState.gridState = void 0;
            });
          },
          setDisplayedSamples: (samples) => {
            const currentDisplaySamples = get2().logs.samplesListState.displayedSamples;
            set2((state) => {
              if (!displaySamplesEqual(currentDisplaySamples, samples)) {
                state.logs.samplesListState.displayedSamples = samples;
              }
            });
          },
          clearDisplayedSamples: () => {
            set2((state) => {
              state.logs.samplesListState.displayedSamples = void 0;
            });
          },
          setSamplesColumnVisibility: (visibility) => {
            set2((state) => {
              state.logs.samplesListState.columnVisibility = visibility;
            });
          },
          setPreviousSamplesPath: (path) => {
            set2((state) => {
              state.logs.samplesListState.previousSamplesPath = path;
            });
          },
          initLogDir: async () => {
            const api2 = get2().api;
            if (!api2) {
              console.error("API not initialized in LogsStore");
              return void 0;
            }
            const loadLogDir = async () => {
              try {
                return await api2.get_log_dir();
              } catch (e) {
                console.log(e);
                get2().appActions.setLoading(false, e);
                return void 0;
              }
            };
            const logDir2 = await loadLogDir();
            if (get2().logs.logDir !== logDir2) {
              get2().logsActions.setLogDir(logDir2);
            }
            return logDir2;
          },
          ensureReplication: async () => {
            const state = get2();
            if (state.logs.logDir) {
              await state.logsActions.syncLogs();
            }
          },
          syncLogs: async () => {
            const api2 = get2().api;
            if (!api2) {
              console.error("API not initialized in LogsStore");
              return [];
            }
            const databaseService = get2().databaseService;
            const useProgress = !!databaseService?.getDatabaseHandle();
            if (useProgress) {
              get2().appActions.setLoading(true);
            }
            const logDir2 = await get2().logsActions.initLogDir();
            const databaseHandle = api2.get_log_dir_handle(logDir2);
            const initDatabase = !databaseService || databaseService.getDatabaseHandle() !== databaseHandle;
            if (initDatabase) {
              const initializeDatabase = async (logDir22) => {
                if (!logDir22) {
                  return void 0;
                }
                try {
                  const databaseService3 = get2().databaseService;
                  if (!databaseService3) {
                    return void 0;
                  }
                  await databaseService3.openDatabase(databaseHandle);
                  return databaseService3;
                } catch (e) {
                  console.log(e);
                  if (useProgress) {
                    get2().appActions.setLoading(false, e);
                  }
                  return;
                }
              };
              if (!logDir2 || get2().app.singleFileMode) {
                if (useProgress) {
                  get2().appActions.setLoading(false);
                }
                return [];
              }
              const databaseService2 = await initializeDatabase(logDir2);
              if (!databaseService2) {
                throw new Error("Database service not available");
              }
              await get2().replicationService?.startReplication(
                databaseService2,
                api2,
                {
                  setLogHandles: (logs) => {
                    const state = get2();
                    state.logsActions.setLogHandles(logs);
                  },
                  getSelectedLog: () => {
                    const state = get2();
                    if (!state.logs.selectedLogFile) {
                      return void 0;
                    }
                    return state.logs.logs.find((handle) => {
                      return handle.name.endsWith(state.logs.selectedLogFile);
                    });
                  },
                  setSelectedLogFile: (logFile) => {
                    const state = get2();
                    state.logsActions.setSelectedLogFile(logFile);
                  },
                  updateLogPreviews: (previews) => {
                    const state = get2();
                    state.logsActions.updateLogPreviews(previews);
                  },
                  updateLogDetails: (details) => {
                    const state = get2();
                    state.logsActions.updateLogDetails(details);
                  },
                  setLoading(loading) {
                    const state = get2();
                    state.appActions.setLoading(loading);
                  },
                  setBackgroundSyncing(syncing) {
                    set2((state) => {
                      state.app.status.syncing = syncing;
                    });
                  },
                  setDbStats(stats) {
                    set2((state) => {
                      state.logs.dbStats = stats;
                    });
                  }
                }
              );
            }
            if (useProgress) {
              get2().appActions.setLoading(false);
            }
            return await get2().replicationService?.sync(initDatabase) || [];
          },
          syncEvalSetInfo: async (logPath) => {
            const api2 = get2().api;
            if (!api2) {
              console.error("API not initialized in LogsStore");
              return void 0;
            }
            const info = await api2.get_eval_set(logPath);
            set2((state) => {
              state.logs.evalSet = info;
            });
          },
          updateFlowData: (flowPath, flowData) => {
            set2((state) => {
              state.logs.flowDir = flowPath;
              state.logs.flow = flowData;
            });
          },
          // Select a specific log file
          setSelectedLogFile: async (logFile) => {
            const state = get2();
            const isInFileList = state.logs.logs.findIndex(
              (val) => val.name.endsWith(logFile)
            ) !== -1;
            if (!isInFileList) {
              if (state.replicationService?.isReplicating() && !state.app.singleFileMode) {
                await state.logsActions.syncLogs();
                const logHandle = state.logs.logs.find(
                  (val) => val.name.endsWith(logFile)
                );
                if (!logHandle) {
                  throw new Error(`Log file not found: ${logFile}`);
                }
              } else {
                state.logsActions.setLogHandles([{ name: logFile }]);
              }
            }
            set2((state2) => {
              const absoluteLogfile = isUri(logFile) ? logFile : join(logFile, state2.logs.logDir);
              state2.logs.selectedLogFile = absoluteLogfile;
            });
          },
          setFilteredCount: (count) => {
            set2((state) => {
              state.logs.listing.filteredCount = count;
            });
          },
          setWatchedLogs: (logs) => {
            set2((state) => {
              state.logs.listing.watchedLogs = logs;
            });
          },
          clearWatchedLogs: () => {
            set2((state) => {
              state.logs.listing.watchedLogs = void 0;
            });
          },
          setSelectedRowIndex: (index) => {
            set2((state) => {
              state.logs.listing.selectedRowIndex = index;
            });
          },
          setLogsGridState: (gridState) => {
            set2((state) => {
              state.logs.listing.gridState = gridState;
            });
          },
          clearLogsGridState: () => {
            set2((state) => {
              state.logs.listing.gridState = void 0;
            });
          },
          setPreviousLogsPath: (path) => {
            set2((state) => {
              state.logs.listing.previousLogPath = path;
            });
          },
          setLogsColumnVisibility: (visibility) => {
            set2((state) => {
              state.logs.listing.columnVisibility = visibility;
            });
          },
          clearSelectedLogFile: () => {
            set2((state) => {
              state.logs.selectedLogFile = void 0;
            });
          },
          // Cross-file sample operations
          getAllCachedSamples: async () => {
            try {
              log$7.debug("LOADING ALL CACHED SAMPLES");
              const dbService = get2().databaseService;
              if (!dbService) {
                throw new Error("Database service not initialized");
              }
              const samples = await dbService.readAllSampleSummaries();
              log$7.debug(`Retrieved ${samples.length} cached samples`);
              return samples;
            } catch (e) {
              log$7.debug("No cached samples available");
              return [];
            }
          },
          queryCachedSamples: async (filter) => {
            try {
              log$7.debug("QUERYING CACHED SAMPLES", filter);
              const dbService = get2().databaseService;
              if (!dbService) {
                throw new Error("Database service not initialized");
              }
              const samples = await dbService.querySampleSummaries(filter);
              log$7.debug(`Query returned ${samples.length} samples`);
              return samples;
            } catch (e) {
              log$7.debug("Sample query failed, returning empty results");
              return [];
            }
          },
          setShowRetriedLogs: (showRetriedLogs) => {
            set2((state) => {
              state.logs.showRetriedLogs = showRetriedLogs;
            });
          }
        }
      };
      const cleanup = () => {
      };
      return [slice, cleanup];
    };
    const initializeLogsSlice = (set2) => {
      set2((state) => {
        if (!state.logs) {
          state.logs = initialState$1;
        }
      });
    };
    const displaySamplesEqual = (a, b) => {
      if (!a && !b) return true;
      if (!a || !b) return false;
      if (a.length !== b.length) return false;
      for (let i2 = 0; i2 < a.length; i2++) {
        if (a[i2].logFile !== b[i2].logFile || a[i2].sampleId !== b[i2].sampleId || a[i2].epoch !== b[i2].epoch) {
          return false;
        }
      }
      return true;
    };
    const resolveAttachments = (value2, attachments, onFailedResolve) => {
      const CONTENT_PROTOCOL = "tc://";
      const ATTACHMENT_PROTOCOL = "attachment://";
      if (value2 === null || value2 === void 0) {
        return value2;
      }
      if (Array.isArray(value2)) {
        let hasChanged = false;
        const resolvedArray = value2.map((v) => {
          const resolved = resolveAttachments(v, attachments);
          if (resolved !== v) hasChanged = true;
          return resolved;
        });
        return hasChanged ? resolvedArray : value2;
      }
      if (typeof value2 === "object" && !(value2 instanceof Date) && !(value2 instanceof RegExp)) {
        let hasChanged = false;
        const resolvedObject = {};
        for (const [key2, val] of Object.entries(value2)) {
          const resolved = resolveAttachments(val, attachments);
          resolvedObject[key2] = resolved;
          if (resolved !== val) hasChanged = true;
        }
        return hasChanged ? resolvedObject : value2;
      }
      if (typeof value2 === "string") {
        if (value2.startsWith(CONTENT_PROTOCOL)) {
          const updatedValue = value2.replace(CONTENT_PROTOCOL, ATTACHMENT_PROTOCOL);
          if (updatedValue.startsWith(ATTACHMENT_PROTOCOL)) {
            const attachmentId = updatedValue.slice(ATTACHMENT_PROTOCOL.length);
            const attachment = attachments[attachmentId];
            if (attachment === void 0 && onFailedResolve) {
              onFailedResolve(attachmentId);
            }
            return attachment !== void 0 ? attachment : value2;
          }
          return updatedValue;
        }
        if (value2.startsWith(ATTACHMENT_PROTOCOL)) {
          const attachmentId = value2.slice(ATTACHMENT_PROTOCOL.length);
          const attachment = attachments[attachmentId];
          if (attachment === void 0 && onFailedResolve) {
            onFailedResolve(attachmentId);
          }
          return attachment !== void 0 ? attachment : value2;
        }
      }
      return value2;
    };
    const resolveSample$1 = (sample2) => {
      sample2 = { ...sample2 };
      if (sample2.transcript) {
        sample2.events = sample2.transcript.events;
        sample2.attachments = sample2.transcript.content;
      }
      sample2.attachments = sample2.attachments || {};
      sample2.input = resolveAttachments(sample2.input, sample2.attachments);
      sample2.messages = resolveAttachments(sample2.messages, sample2.attachments);
      sample2.events = resolveAttachments(sample2.events, sample2.attachments);
      sample2.attachments = {};
      return sample2;
    };
    const log$6 = createLogger("samplePolling");
    const kNoId = -1;
    const kPollingInterval$1 = 2;
    const kPollingMaxRetries = 10;
    function createSamplePolling(get2, set2) {
      let currentPolling = null;
      let abortController;
      const pollingState = {
        eventId: kNoId,
        attachmentId: kNoId,
        eventMapping: {},
        attachments: {},
        events: []
      };
      const startPolling = (logFile, summary2) => {
        const pollingId = `${logFile}:${summary2.id}-${summary2.epoch}`;
        log$6.debug(`Start Polling ${pollingId}`);
        if (currentPolling && currentPolling.name === pollingId) {
          log$6.debug(`Aleady polling, ignoring start`);
          return;
        }
        if (currentPolling) {
          log$6.debug(`Resetting existing polling`);
          currentPolling.stop();
          set2((state) => {
            state.sample.runningEvents = [];
          });
          resetPollingState(pollingState);
        }
        abortController = new AbortController();
        log$6.debug(`Polling sample: ${summary2.id}-${summary2.epoch}`);
        const pollCallback = async () => {
          const state = get2();
          const api2 = state.api;
          if (!api2) {
            throw new Error("Required API is missing");
          }
          if (!api2.get_log_sample_data) {
            throw new Error("Required API get_log_sample_data is undefined.");
          }
          if (abortController.signal.aborted) {
            return false;
          }
          state.sampleActions.setSampleStatus("streaming");
          const eventId = pollingState.eventId;
          const attachmentId = pollingState.attachmentId;
          const sampleDataResponse = await api2.get_log_sample_data(
            logFile,
            summary2.id,
            summary2.epoch,
            eventId,
            attachmentId
          );
          if (abortController.signal.aborted) {
            return false;
          }
          if (sampleDataResponse?.status === "NotFound") {
            stopPolling();
            if (state.sample.runningEvents.length > 0) {
              try {
                log$6.debug(
                  `LOADING COMPLETED SAMPLE AFTER FLUSH: ${summary2.id}-${summary2.epoch}`
                );
                const sample2 = await api2.get_log_sample(
                  logFile,
                  summary2.id,
                  summary2.epoch
                );
                if (sample2) {
                  const migratedSample = resolveSample$1(sample2);
                  set2((state2) => {
                    state2.sampleActions.setSelectedSample(migratedSample);
                    state2.sampleActions.setSampleStatus("ok");
                    state2.sample.runningEvents = [];
                  });
                } else {
                  set2((state2) => {
                    state2.sampleActions.setSampleStatus("error");
                    state2.sample.sampleError = new Error(
                      "Unable to load sample - an unknown error occurred"
                    );
                    state2.sample.runningEvents = [];
                  });
                }
              } catch (e) {
                set2((state2) => {
                  state2.sample.sampleError = e;
                  state2.sampleActions.setSampleStatus("error");
                  state2.sample.runningEvents = [];
                });
              }
            } else {
              state.sampleActions.setSampleStatus("ok");
              state.sample.runningEvents = [];
            }
            return false;
          }
          if (sampleDataResponse?.status === "OK" && sampleDataResponse.sampleData) {
            if (abortController.signal.aborted) {
              return false;
            }
            if (sampleDataResponse.sampleData) {
              processAttachments(sampleDataResponse.sampleData, pollingState);
              const processedEvents = processEvents(
                sampleDataResponse.sampleData,
                pollingState,
                api2,
                logFile
              );
              if (sampleDataResponse.sampleData.attachments.length > 0) {
                const maxAttachment = findMaxId(
                  sampleDataResponse.sampleData.attachments,
                  pollingState.attachmentId
                );
                log$6.debug(`New max attachment ${maxAttachment}`);
                pollingState.attachmentId = maxAttachment;
              }
              if (sampleDataResponse.sampleData.events.length > 0) {
                const maxEvent = findMaxId(
                  sampleDataResponse.sampleData.events,
                  pollingState.eventId
                );
                log$6.debug(`New max event ${maxEvent}`);
                pollingState.eventId = maxEvent;
              }
              if (processedEvents) {
                set2((state2) => {
                  state2.sample.runningEvents = [...pollingState.events];
                });
              }
            }
          }
          return true;
        };
        const polling = createPolling(pollingId, pollCallback, {
          maxRetries: kPollingMaxRetries,
          interval: kPollingInterval$1
        });
        currentPolling = polling;
        polling.start();
      };
      const stopPolling = () => {
        if (currentPolling) {
          currentPolling.stop();
          currentPolling = null;
        }
      };
      const cleanup = () => {
        log$6.debug(`Cleanup`);
        if (abortController) {
          abortController.abort();
        }
        stopPolling();
      };
      return {
        startPolling,
        stopPolling,
        cleanup
      };
    }
    const resetPollingState = (state) => {
      state.eventId = kNoId;
      state.attachmentId = kNoId;
      state.eventMapping = {};
      state.attachments = {};
      state.events = [];
    };
    function processAttachments(sampleData, pollingState) {
      log$6.debug(`Processing ${sampleData.attachments.length} attachments`);
      Object.values(sampleData.attachments).forEach((v) => {
        pollingState.attachments[v.hash] = v.content;
      });
    }
    function processEvents(sampleData, pollingState, api2, log_file) {
      log$6.debug(`Processing ${sampleData.events.length} events`);
      if (sampleData.events.length === 0) {
        return false;
      }
      for (const eventData of sampleData.events) {
        const existingIndex = pollingState.eventMapping[eventData.event_id];
        const resolvedEvent = resolveAttachments(
          eventData.event,
          pollingState.attachments,
          (attachmentId) => {
            const snapshot = {
              eventId: eventData.event_id,
              attachmentId,
              available_attachments: Object.keys(pollingState.attachments)
            };
            if (api2.log_message) {
              api2.log_message(
                log_file,
                `Unable to resolve attachment ${attachmentId}
` + JSON.stringify(snapshot)
              );
            }
            console.warn(`Unable to resolve attachment ${attachmentId}`, snapshot);
          }
        );
        if (existingIndex) {
          log$6.debug(`Replace event ${existingIndex}`);
          pollingState.events[existingIndex] = resolvedEvent;
        } else {
          log$6.debug(`New event ${pollingState.events.length}`);
          const currentIndex = pollingState.events.length;
          pollingState.eventMapping[eventData.event_id] = currentIndex;
          pollingState.events.push(resolvedEvent);
        }
      }
      return true;
    }
    const findMaxId = (items, currentMax) => {
      if (items.length > 0) {
        const newMax = Math.max(...items.map((i2) => i2.id), currentMax);
        return newMax;
      }
      return currentMax;
    };
    const isJson = (text2) => {
      text2 = text2.trim();
      if (text2.startsWith("{") && text2.endsWith("}")) {
        try {
          JSON.parse(text2);
          return true;
        } catch {
          return false;
        }
      }
      return false;
    };
    const asJsonObjArray = (text2) => {
      text2 = text2.trim();
      if (text2.startsWith("[") && text2.endsWith("]")) {
        try {
          const arr2 = JSON.parse(text2);
          if (Array.isArray(arr2) && arr2.every((item2) => typeof item2 === "object")) {
            return arr2;
          } else {
            return void 0;
          }
        } catch {
          return void 0;
        }
      }
      return void 0;
    };
    const parsedJson = (text2) => {
      text2 = text2.trim();
      if (text2.startsWith("{") && text2.endsWith("}")) {
        try {
          return JSON.parse(text2);
        } catch {
          return void 0;
        }
      }
      return void 0;
    };
    function estimateSize(list2, frequency = 0.2) {
      if (!list2 || list2.length === 0) {
        return 0;
      }
      const sampleSize = Math.ceil(list2.length * frequency);
      const messageIndices = /* @__PURE__ */ new Set();
      while (messageIndices.size < sampleSize && messageIndices.size < list2.length) {
        const randomIndex = Math.floor(Math.random() * list2.length);
        messageIndices.add(randomIndex);
      }
      const totalSize = Array.from(messageIndices).reduce((size, index) => {
        return size + JSON.stringify(list2[index]).length;
      }, 0);
      const estimatedTotalSize = totalSize / sampleSize * list2.length;
      return estimatedTotalSize;
    }
    function filterState(state) {
      if (!state) {
        return state;
      }
      const filters2 = [filterLargeLogDetails];
      return filters2.reduce(
        (filteredState, filter) => filter(filteredState),
        state
      );
    }
    function isLargeSample(sample2) {
      const storeKeys = countKeys(sample2.store);
      if (storeKeys > 5e3) {
        return true;
      }
      const estimatedMessageSize = estimateSize(sample2.messages);
      if (estimatedMessageSize > 25e4) {
        return true;
      }
      return true;
    }
    function countKeys(obj, options2 = { countArrayIndices: false }) {
      if (obj === null || typeof obj !== "object") {
        return 0;
      }
      if (Array.isArray(obj)) {
        let count2 = 0;
        if (options2.countArrayIndices) {
          count2 += obj.length;
        }
        for (const item2 of obj) {
          count2 += countKeys(item2, options2);
        }
        return count2;
      }
      let count = Object.keys(obj).length;
      for (const key2 in obj) {
        if (Object.prototype.hasOwnProperty.call(obj, key2)) {
          count += countKeys(obj[key2], options2);
        }
      }
      return count;
    }
    function filterLargeLogDetails(state) {
      if (!state || !state.log || !state.log.selectedLogDetails) {
        return state;
      }
      const estimatedSize = estimateSize(
        state.log.selectedLogDetails.sampleSummaries
      );
      if (estimatedSize > 25e4) {
        return {
          ...state,
          log: {
            ...state.log,
            selectedLogDetails: void 0
          }
        };
      } else {
        return state;
      }
    }
    const log$5 = createLogger("sampleSlice");
    let selectedSampleRef = {
      current: void 0
    };
    const kDefaultExcludeEvents = [
      "sample_init",
      "sandbox",
      "state",
      "store"
    ];
    const initialState = {
      // Store ID for all samples (used for triggering renders)
      sample_identifier: void 0,
      // Store the actual sample object for small samples
      selectedSampleObject: void 0,
      // Flag to indicate where the sample is stored
      sampleInState: false,
      sampleStatus: "ok",
      sampleError: void 0,
      visiblePopover: void 0,
      // signals that the sample needs to be reloaded
      sampleNeedsReload: 0,
      // The resolved events
      runningEvents: [],
      collapsedEvents: null,
      collapsedMode: null,
      eventFilter: {
        filteredTypes: [...kDefaultExcludeEvents]
      },
      collapsedIdBuckets: {},
      selectedOutlineId: void 0
    };
    const createSampleSlice = (set2, get2, _store) => {
      const samplePolling = createSamplePolling(get2, set2);
      const slice = {
        // Actions
        sample: initialState,
        sampleActions: {
          setSelectedSample: (sample2) => {
            const isLarge = isLargeSample(sample2);
            set2((state) => {
              state.sample.sample_identifier = {
                id: sample2.id,
                epoch: sample2.epoch
              };
              state.sample.sampleInState = !isLarge;
              if (!isLarge) {
                state.sample.selectedSampleObject = sample2;
                selectedSampleRef.current = void 0;
              } else {
                state.sample.selectedSampleObject = void 0;
                selectedSampleRef.current = sample2;
              }
            });
            if (sample2.events.length < 1) {
              get2().appActions.setSampleTab(kSampleMessagesTabId);
            }
          },
          getSelectedSample: () => {
            const state = get2().sample;
            return state.sampleInState ? state.selectedSampleObject : selectedSampleRef.current;
          },
          clearSelectedSample: () => {
            selectedSampleRef.current = void 0;
            set2((state) => {
              state.sample.sample_identifier = void 0;
              state.sample.selectedSampleObject = void 0;
              state.sample.sampleInState = false;
              state.log.selectedSampleHandle = void 0;
            });
          },
          setSampleStatus: (status2) => set2((state) => {
            state.sample.sampleStatus = status2;
          }),
          setSampleError: (error2) => set2((state) => {
            state.sample.sampleError = error2;
          }),
          setCollapsedEvents: (scope, collapsed2) => {
            set2((state) => {
              if (state.sample.collapsedEvents === null) {
                state.sample.collapsedEvents = {};
              }
              state.sample.collapsedEvents[scope] = collapsed2;
            });
          },
          clearCollapsedEvents: () => {
            set2((state) => {
              if (state.sample.collapsedEvents !== null) {
                state.sample.collapsedEvents = null;
              }
              state.sample.collapsedMode = null;
            });
          },
          collapseEvent: (scope, id, collapsed2) => {
            set2((state) => {
              if (state.sample.collapsedEvents === null) {
                state.sample.collapsedEvents = {};
              }
              if (!state.sample.collapsedEvents[scope]) {
                state.sample.collapsedEvents[scope] = {};
              }
              if (collapsed2) {
                state.sample.collapsedEvents[scope][id] = true;
              } else {
                delete state.sample.collapsedEvents[scope][id];
              }
            });
          },
          setCollapsedIds: (key2, collapsed2) => {
            set2((state) => {
              state.sample.collapsedIdBuckets[key2] = collapsed2;
            });
          },
          collapseId: (key2, id, collapsed2) => {
            set2((state) => {
              if (state.sample.collapsedIdBuckets[key2] === void 0) {
                state.sample.collapsedIdBuckets[key2] = {};
              }
              if (collapsed2) {
                state.sample.collapsedIdBuckets[key2][id] = true;
              } else {
                delete state.sample.collapsedIdBuckets[key2][id];
              }
            });
          },
          clearCollapsedIds: (key2) => {
            set2((state) => {
              delete state.sample.collapsedIdBuckets[key2];
            });
          },
          setCollapsedMode: (mode) => {
            set2((state) => {
              state.sample.collapsedMode = mode;
            });
          },
          setFilteredEventTypes: (types2) => {
            set2((state) => {
              state.sample.eventFilter.filteredTypes = types2;
            });
          },
          setVisiblePopover: (id) => {
            set2((state) => {
              state.sample.visiblePopover = id;
            });
          },
          clearVisiblePopover: () => {
            set2((state) => {
              state.sample.visiblePopover = void 0;
            });
          },
          setSelectedOutlineId: (id) => {
            set2((state) => {
              state.sample.selectedOutlineId = id;
            });
          },
          clearSelectedOutlineId: () => {
            set2((state) => {
              state.sample.selectedOutlineId = void 0;
            });
          },
          pollSample: async (logFile, id, epoch) => {
            const state = get2();
            const sampleExists = state.sample.sampleInState ? !!state.sample.selectedSampleObject : !!selectedSampleRef.current;
            if (state.log.loadedLog && sampleExists) {
              const sampleSummary = { id, epoch };
              samplePolling.startPolling(logFile, sampleSummary);
            }
          },
          loadSample: async (logFile, id, epoch, completed) => {
            const sampleActions = get2().sampleActions;
            sampleActions.setSampleError(void 0);
            sampleActions.setSampleStatus("loading");
            const state = get2();
            try {
              if (completed !== false) {
                log$5.debug(`LOADING COMPLETED SAMPLE: ${id}-${epoch}`);
                const sample2 = await get2().api?.get_log_sample(logFile, id, epoch);
                log$5.debug(`LOADED COMPLETED SAMPLE: ${id}-${epoch}`);
                if (sample2) {
                  if (state.sample.sample_identifier?.id !== sample2.id && state.sample.sample_identifier?.epoch !== sample2.epoch) {
                    sampleActions.clearCollapsedEvents();
                  }
                  const migratedSample = resolveSample$1(sample2);
                  sampleActions.setSelectedSample(migratedSample);
                  sampleActions.setSampleStatus("ok");
                } else {
                  sampleActions.setSampleStatus("error");
                  throw new Error(
                    "Unable to load sample - an unknown error occurred"
                  );
                }
              } else {
                log$5.debug(`POLLING RUNNING SAMPLE: ${id}-${epoch}`);
                const sampleSummary = { id, epoch };
                samplePolling.startPolling(logFile, sampleSummary);
              }
            } catch (e) {
              sampleActions.setSampleError(e);
              sampleActions.setSampleStatus("error");
            }
          }
        }
      };
      const cleanup = () => {
        samplePolling.cleanup();
        selectedSampleRef.current = void 0;
      };
      return [slice, cleanup];
    };
    const handleRehydrate = (state) => {
      if (!state.sample.sampleInState) {
        state.sample.sampleNeedsReload = state.sample.sampleNeedsReload + 1;
      }
    };
    const initializeSampleSlice = (set2) => {
      set2((state) => {
        if (!state.sample) {
          state.sample = initialState;
        }
      });
    };
    var WorkPriority = /* @__PURE__ */ ((WorkPriority2) => {
      WorkPriority2[WorkPriority2["Low"] = 0] = "Low";
      WorkPriority2[WorkPriority2["Medium"] = 1] = "Medium";
      WorkPriority2[WorkPriority2["High"] = 2] = "High";
      return WorkPriority2;
    })(WorkPriority || {});
    class WorkQueue {
      itemsById = /* @__PURE__ */ new Map();
      activeWorkers = 0;
      options;
      constructor(options2) {
        this.options = {
          batchSize: 1,
          processingDelay: 100,
          maxRetries: 3,
          onProcessingChanged: (_processing) => {
          },
          ...options2
        };
      }
      enqueue(items, priority = 1) {
        const now = Date.now();
        for (const item2 of items) {
          const id = this.options.getId(item2);
          const existing = this.itemsById.get(id);
          if (existing) {
            if (priority > existing.priority) {
              existing.priority = priority;
            }
          } else {
            this.itemsById.set(id, {
              id,
              data: item2,
              priority,
              addedAt: now,
              retries: 0
            });
          }
        }
        void this.startProcessing();
      }
      async processImmediate(items) {
        const results = await this.options.worker(items);
        this.options.onComplete(results, items);
      }
      async startProcessing() {
        while (this.activeWorkers < this.options.concurrency && this.itemsById.size > 0) {
          this.activeWorkers++;
          if (this.activeWorkers === 1) {
            try {
              this.options.onProcessingChanged(true);
            } catch (error2) {
              console.error("onProcessingChanged callback error:", error2);
            }
          }
          void this.runWorker();
        }
      }
      async runWorker() {
        try {
          while (this.itemsById.size > 0) {
            const batch2 = this.claimNextBatch();
            if (batch2.length === 0) {
              break;
            }
            const inputs = batch2.map((item2) => item2.data);
            try {
              const results = await this.options.worker(inputs);
              this.options.onComplete(results, inputs);
            } catch (error2) {
              console.error("Work queue processing error:", error2);
              for (const item2 of batch2) {
                if (item2.retries < this.options.maxRetries) {
                  item2.retries++;
                  this.itemsById.set(item2.id, item2);
                }
              }
            }
            if (this.itemsById.size > 0 && this.options.processingDelay > 0) {
              await new Promise(
                (resolve) => setTimeout(resolve, this.options.processingDelay)
              );
            }
          }
        } finally {
          this.activeWorkers--;
          if (this.activeWorkers === 0) {
            try {
              this.options.onProcessingChanged(false);
            } catch (error2) {
              console.error("onProcessingChanged callback error:", error2);
            }
          }
        }
      }
      claimNextBatch() {
        const items = Array.from(this.itemsById.values()).sort((a, b) => {
          if (a.priority !== b.priority) {
            return b.priority - a.priority;
          }
          return a.addedAt - b.addedAt;
        });
        const batch2 = items.slice(0, this.options.batchSize);
        batch2.forEach((item2) => this.itemsById.delete(item2.id));
        return batch2;
      }
      clear() {
        this.itemsById.clear();
      }
      get size() {
        return this.itemsById.size;
      }
      get isProcessing() {
        return this.activeWorkers > 0;
      }
    }
    class ReplicationService {
      // For remote data retrieval
      _api = void 0;
      // For storage
      _database = void 0;
      // To update application state
      _applicationContext = void 0;
      // The work queues
      _previewQueue;
      _detailQueue;
      _processingCount;
      // Track sync requests (so we wait on already running requests before syncing again)
      _pendingSync = null;
      _syncQueued = false;
      // Batched DB updates
      _pendingPreviewUpdates = {};
      _pendingDetailUpdates = {};
      _flushingPreview = false;
      _flushingDetail = false;
      _throttledFlushPreviewBatch;
      _throttledFlushDetailBatch;
      _throttledUpdateDbStats;
      constructor() {
        this._processingCount = 0;
        this._throttledUpdateDbStats = throttle$1(() => this.updateDbStats(), 1e3);
        this._throttledFlushPreviewBatch = throttle$1(
          () => this.flushPreviewBatch(),
          100
        );
        this._throttledFlushDetailBatch = throttle$1(
          () => this.flushDetailBatch(),
          100
        );
        this._previewQueue = new WorkQueue({
          name: "Log-Preview-Queue",
          concurrency: 2,
          batchSize: 6,
          processingDelay: 20,
          onProcessingChanged: this.processingChanged,
          getId: (log2) => log2.name,
          worker: async (logHandles) => {
            if (!this._api) {
              throw new Error("API not available");
            }
            const previews = await this._api.get_log_summaries(
              logHandles.map((log2) => log2.name)
            );
            return previews;
          },
          onComplete: async (previews, inputs) => {
            inputs.forEach((log2, i2) => {
              if (previews[i2]) {
                this._pendingPreviewUpdates[log2.name] = previews[i2];
              }
            });
            this._throttledFlushPreviewBatch();
          }
        });
        this._detailQueue = new WorkQueue({
          name: "Log-Detail-Queue",
          concurrency: 10,
          batchSize: 1,
          processingDelay: 0,
          onProcessingChanged: this.processingChanged,
          getId: (log2) => log2.name,
          worker: async (logHandles) => {
            if (!this._api) throw new Error("API not available");
            const details = await Promise.all(
              logHandles.map(async (log2) => {
                try {
                  const result2 = await this._api.get_log_details(log2.name);
                  return result2;
                } catch {
                  return void 0;
                }
              })
            );
            const allResults = details.filter((d) => d !== void 0);
            return allResults;
          },
          onComplete: async (details, inputs) => {
            inputs.forEach((log2, i2) => {
              if (details[i2]) {
                this._pendingDetailUpdates[log2.name] = details[i2];
              }
            });
            this._throttledFlushDetailBatch();
          }
        });
      }
      processingChanged = (processing2) => {
        this._processingCount += processing2 ? 1 : -1;
        if (this._processingCount > 0) {
          this._applicationContext?.setBackgroundSyncing(true);
        } else {
          this._applicationContext?.setBackgroundSyncing(false);
        }
      };
      async flushPreviewBatch() {
        if (this._flushingPreview) {
          return;
        }
        this._flushingPreview = true;
        try {
          const updates = { ...this._pendingPreviewUpdates };
          this._pendingPreviewUpdates = {};
          if (Object.keys(updates).length === 0) {
            return;
          }
          if (this._database) {
            await this._database.writeLogPreviews(Object.values(updates), Object.keys(updates)).catch(() => {
            });
            this._throttledUpdateDbStats();
          }
          setTimeout(() => {
            this._applicationContext?.updateLogPreviews(updates);
          }, 0);
        } finally {
          this._flushingPreview = false;
        }
      }
      async flushDetailBatch() {
        if (this._flushingDetail) {
          return;
        }
        this._flushingDetail = true;
        try {
          const updates = { ...this._pendingDetailUpdates };
          this._pendingDetailUpdates = {};
          if (Object.keys(updates).length === 0) {
            return;
          }
          if (this._database) {
            await this._database.writeLogDetails(updates);
            this._throttledUpdateDbStats();
          }
          setTimeout(() => {
            this._applicationContext?.updateLogDetails(updates);
          }, 0);
        } finally {
          this._flushingDetail = false;
        }
      }
      async updateDbStats() {
        if (!this._database || !this._applicationContext) return;
        await Promise.all([
          this._database.countRows("logs"),
          this._database.countRows("logPreviews"),
          this._database.countRows("logDetails")
        ]).then(([logCount, previewCount, detailsCount]) => {
          this._applicationContext?.setDbStats({
            logCount,
            previewCount,
            detailsCount
          });
        }).catch(() => {
        });
      }
      async startReplication(database, api2, context) {
        this._database = database;
        this._api = api2;
        this._applicationContext = context;
        const logHandles = await database.readLogs();
        if (logHandles) {
          context.setLogHandles(logHandles);
          const logPreviews = await database.readLogPreviews(logHandles);
          if (logPreviews && Object.keys(logPreviews).length > 0) {
            context.updateLogPreviews(logPreviews);
          }
          const logDetails = await database.readLogDetails(logHandles);
          if (logDetails && Object.keys(logDetails).length > 0) {
            context.updateLogDetails(logDetails);
          }
          await this.updateDbStats();
        }
      }
      stopReplication() {
        this._database = void 0;
        this._api = void 0;
        this._applicationContext = void 0;
      }
      isReplicating() {
        return !!this._api && !!this._database && !!this._applicationContext;
      }
      async sync(progress2) {
        if (this._pendingSync && this._syncQueued) {
          return this._pendingSync;
        }
        if (this._pendingSync) {
          this._syncQueued = true;
          await this._pendingSync;
          this._syncQueued = false;
          return this.sync(progress2);
        }
        this._pendingSync = this._syncImpl(progress2);
        try {
          return await this._pendingSync;
        } finally {
          this._pendingSync = null;
        }
      }
      async _syncImpl(progress2) {
        if (!this._database) {
          throw new Error("No database available for replication.");
        }
        if (!this._api) {
          throw new Error("No API available for replication.");
        }
        if (!this._applicationContext) {
          throw new Error("No replication context available for replication.");
        }
        if (progress2) {
          this._applicationContext.setLoading(true);
        }
        const logFiles = await this._database.readLogs() || [];
        let mtime = 0;
        let clientFileCount = 0;
        if (logFiles && logFiles.length > 0) {
          mtime = Math.max(...logFiles.map((file) => file.mtime || 0));
          clientFileCount = logFiles.length;
        }
        const staticList = logFiles.length > 0 && mtime === 0;
        if (staticList) {
          const serverLogs = await this._api.get_logs(0, 0);
          let invalidate = false;
          if (serverLogs.files.length !== logFiles.length) {
            invalidate = true;
          } else {
            const localLogNames = new Set(logFiles.map((f) => f.name));
            for (const serverLog of serverLogs.files) {
              if (!localLogNames.has(serverLog.name)) {
                invalidate = true;
                break;
              }
            }
          }
          if (invalidate) {
            for (const file of logFiles) {
              this._database?.clearCacheForFile(file.name);
            }
            this._applicationContext?.setLogHandles(serverLogs.files);
            this.queueLogDetails(serverLogs.files);
            this.queueLogPreviews(serverLogs.files);
            if (progress2) {
              this._applicationContext.setLoading(false);
            }
            return serverLogs.files;
          } else {
            this._applicationContext?.setLogHandles(logFiles);
            const previewTasks2 = [];
            const previews2 = await this._database.findMissingPreviews(logFiles);
            for (const p of previews2) {
              if (!previewTasks2.find((t2) => t2.name === p.name)) {
                previewTasks2.push(p);
              }
            }
            this.queueLogPreviews(previewTasks2);
            const detailTasks2 = [];
            const details2 = await this._database.findMissingDetails(logFiles);
            for (const d of details2) {
              if (!detailTasks2.find((t2) => t2.name === d.name)) {
                detailTasks2.push(d);
              }
            }
            this.queueLogDetails(detailTasks2);
            if (progress2) {
              this._applicationContext.setLoading(false);
            }
            return logFiles;
          }
        }
        const response = await this._api.get_logs(mtime, clientFileCount);
        const updatedLogs = response.files;
        if (response.response_type === "full") {
          const deletedFiles = logFiles.filter((current2) => {
            return !updatedLogs.find((f) => f.name === current2.name);
          });
          for (const file of deletedFiles) {
            this._database?.clearCacheForFile(file.name);
          }
        }
        const toInvalidate = updatedLogs.filter((remoteLog) => {
          const localCopy = logFiles.find((f) => f.name === remoteLog.name);
          if (!localCopy) {
            return true;
          }
          if (remoteLog.mtime && localCopy.mtime) {
            return remoteLog.mtime > localCopy.mtime;
          }
          return true;
        });
        toInvalidate.map((file) => file.name).map((name2) => this._database?.clearCacheForFile(name2));
        await this._database.writeLogs(updatedLogs);
        const allLogHandles = await this._database.readLogs() || [];
        this._applicationContext?.setLogHandles(allLogHandles);
        const previewTasks = [...toInvalidate];
        const previews = await this._database.findMissingPreviews(allLogHandles);
        for (const p of previews) {
          if (!previewTasks.find((t2) => t2.name === p.name)) {
            previewTasks.push(p);
          }
        }
        this.queueLogPreviews(previewTasks.slice(0, 25), WorkPriority.High);
        this.queueLogPreviews(previewTasks.slice(25), WorkPriority.Medium);
        const detailTasks = [...toInvalidate];
        const details = await this._database.findMissingDetails(allLogHandles);
        for (const d of details) {
          if (!detailTasks.find((t2) => t2.name === d.name)) {
            detailTasks.push(d);
          }
        }
        this.queueLogDetails(detailTasks, WorkPriority.High);
        if (progress2) {
          this._applicationContext.setLoading(false);
        }
        return allLogHandles;
      }
      async loadLogPreviews(context) {
        this._applicationContext?.setLoading(true);
        try {
          if (context.force) {
            const toLoad = context.logs || await this._database?.readLogs() || [];
            await this._previewQueue.processImmediate(toLoad);
          } else {
            const allLogs = await this._database?.readLogs() || [];
            const loaded = await this._database?.readLogPreviews(allLogs) || {};
            const logList = context.logs || allLogs;
            const filtered = logList.filter((log2) => {
              const loadedPreview = loaded[log2.name];
              if (!loadedPreview) {
                return true;
              }
              if (loadedPreview.status === "success") {
                return false;
              }
              return true;
            });
            if (Object.keys(loaded).length > 0) {
              this._applicationContext?.updateLogPreviews(loaded);
            }
            if (filtered.length > 0) {
              this.queueLogPreviews(filtered, WorkPriority.High);
            }
          }
        } finally {
          this._applicationContext?.setLoading(false);
        }
      }
      clearData() {
        this._database?.clearAllCaches();
        this.updateDbStats();
      }
      queueLogPreviews(logs, priority = WorkPriority.Medium) {
        this._previewQueue.enqueue(logs, priority);
      }
      count = 0;
      queueLogDetails(logs, priority = WorkPriority.Medium) {
        this.count = this.count + logs.length;
        this._detailQueue.enqueue(logs, priority);
      }
    }
    const log$4 = createLogger("store");
    let storeImplementation = null;
    const useStore = ((selector2) => {
      if (!storeImplementation) {
        throw new Error(
          "Store accessed before initialization. Call initializeStore first."
        );
      }
      return selector2 ? storeImplementation(selector2) : storeImplementation();
    });
    const initializeStore = (api2, capabilities2, storage2) => {
      enableMapSet();
      const storageImplementation = {
        getItem: (name2) => {
          return storage2 ? storage2.getItem(name2) : null;
        },
        setItem: debounce$2((name2, value2) => {
          if (storage2) {
            storage2.setItem(name2, value2);
          }
        }, 1e3),
        removeItem: (name2) => {
          if (storage2) {
            storage2.removeItem(name2);
          }
        }
      };
      const store = create$2()(
        devtools(
          persist(
            immer((set2, get2, store2) => {
              const [appSlice, appCleanup] = createAppSlice(
                set2,
                get2
              );
              const [logsSlice, logsCleanup] = createLogsSlice(
                set2,
                get2
              );
              const [logSlice, logCleanup] = createLogSlice(
                set2,
                get2
              );
              const [sampleSlice, sampleCleanup] = createSampleSlice(
                set2,
                get2
              );
              const databaseService = createDatabaseService();
              const replicationService = new ReplicationService();
              return {
                // Shared state
                api: null,
                databaseService,
                replicationService,
                // Initialize
                initialize: (api22, capabilities22) => {
                  set2((state) => {
                    state.api = api22;
                    state.databaseService = databaseService;
                    state.replicationService = replicationService;
                  });
                  initializeAppSlice(
                    set2,
                    capabilities22
                  );
                  initializeLogsSlice(
                    set2
                  );
                  initalializeLogSlice(
                    set2
                  );
                  initializeSampleSlice(
                    set2
                  );
                },
                // Create the slices and merge them in
                ...appSlice,
                ...logsSlice,
                ...logSlice,
                ...sampleSlice,
                cleanup: async () => {
                  await databaseService.closeDatabase();
                  appCleanup();
                  await logsCleanup();
                  logCleanup();
                  sampleCleanup();
                }
              };
            }),
            {
              name: "app-storage",
              storage: storageImplementation,
              partialize: (state) => {
                const persisted = filterState({
                  app: { ...state.app, rehydrated: true },
                  log: state.log,
                  logs: state.logs,
                  sample: state.sample
                });
                log$4.debug("PARTIALIZED STATE", persisted);
                return persisted;
              },
              version: 1,
              onRehydrateStorage: (state) => {
                return (hydrationState, error2) => {
                  handleRehydrate(state);
                  log$4.debug("REHYDRATING STATE");
                  if (error2) {
                    log$4.debug("ERROR", { error: error2 });
                  } else {
                    log$4.debug("STATE", { state, hydrationState });
                  }
                };
              }
            }
          )
        )
      );
      storeImplementation = store;
      store.getState().initialize(api2, capabilities2);
    };
    const filename = (path) => {
      if (!path) {
        return "";
      }
      path = path.endsWith("/") ? path.slice(0, -1) : path;
      const pathparts = path.split("/");
      const basename2 = pathparts.slice(-1)[0];
      if (basename2.startsWith(".") && !basename2.substring(1).includes(".")) {
        return basename2;
      }
      const match = basename2.match(/(.*)\.\S+$/);
      if (match) {
        return match[1];
      } else {
        return path;
      }
    };
    const basename = (path) => {
      if (!path) {
        return "";
      }
      path = path.endsWith("/") ? path.slice(0, -1) : path;
      const pathparts = path.split("/");
      return pathparts.slice(-1)[0];
    };
    const dirname = (path) => {
      path = path.endsWith("/") ? path.slice(0, -1) : path;
      const pathparts = path.split("/");
      if (pathparts.length > 1) {
        pathparts.pop();
        return pathparts.join("/");
      }
      return "";
    };
    const isInDirectory = (path, directory) => {
      directory = directory.endsWith("/") ? directory.slice(0, -1) : directory;
      return dirname(path) === directory;
    };
    const ensureTrailingSlash = (path) => {
      if (!path) {
        return "";
      }
      return path.endsWith("/") ? path : path + "/";
    };
    const loggingIcons = {
      notset: "bi bi-card-text",
      debug: "bi bi-bug",
      http: "bi bi-download",
      info: "bi bi-info-square",
      warning: "bi bi-exclamation-triangle",
      error: "bi bi-x-circle",
      critical: "bi bi-fire"
    };
    const iconForMimeType = (mimeType) => {
      if (mimeType === "application/pdf") {
        return "bi bi-file-pdf";
      } else if (mimeType.startsWith("image/")) {
        return "bi bi-file-image";
      } else {
        return "bi bi-file-earmark";
      }
    };
    const ApplicationIcons = {
      // bi bi-x-diamond
      approve: "bi bi-shield",
      approvals: {
        approve: "bi bi-shield-check",
        reject: "bi bi-shield-x",
        terminate: "bi bi-shield-exclamation",
        escalate: "bi bi-box-arrow-up",
        modify: "bi bi-pencil-square"
      },
      arrows: {
        right: "bi bi-arrow-right",
        down: "bi bi-arrow-down",
        up: "bi bi-arrow-up"
      },
      cancelled: "bi bi-x-circle",
      checkbox: {
        checked: "bi bi-check-circle",
        unchecked: "bi bi-circle"
      },
      chevron: {
        right: "bi bi-chevron-right",
        down: "bi bi-chevron-down"
      },
      close: "bi bi-x",
      collapse: {
        all: "bi bi-arrows-collapse"
      },
      confirm: "bi bi-check",
      copy: "bi bi-copy",
      display: "bi bi-card-text",
      downloadLog: "bi bi-download",
      edit: "bi bi-pencil-square",
      error: "bi bi-exclamation-circle-fill",
      expand: {
        all: "bi bi-arrows-expand"
      },
      filter: "bi bi-funnel",
      folder: "bi bi-folder",
      flow: "ii inspect-flow",
      info: "bi bi-info-circle",
      input: "bi bi-terminal",
      inspectFile: "ii inspect-icon-file",
      limits: {
        messages: "bi bi-chat-right-text",
        custom: "bi bi-exclamation-triangle",
        operator: "bi bi-person-workspace",
        tokens: "bi bi-list",
        time: "bi bi-clock",
        execution: "bi bi-stopwatch"
      },
      link: "bi bi-link-45deg",
      loading: "bi bi-arrow-clockwise",
      logging: loggingIcons,
      metadata: "bi bi-table",
      metrics: "bi bi-clipboard-data",
      model: "bi bi-grid-3x3-gap",
      navbar: {
        home: "ii inspect-icon-home",
        back: "ii inspect-icon-back",
        tasks: "ii inspect-icon-tasks"
      },
      next: "bi bi-chevron-right",
      noSamples: "bi bi-ban",
      pendingTask: "bi bi-clock",
      play: "bi bi-play-fill",
      previous: "bi bi-chevron-left",
      refresh: "bi bi-arrow-clockwise",
      role: {
        tool: "bi bi-tools"
      },
      running: "bi bi-stars",
      sample: "bi bi-database",
      sandbox: "bi bi-box-seam",
      scorer: "bi bi-calculator",
      search: "bi bi-search",
      sidebar: "bi bi-list",
      solvers: {
        use_tools: "bi bi-tools"
      },
      success: "bi bi-check-circle-fill",
      toggle: {
        // combination of toggle-on and toggle2-off looked best for our default button font size
        on: "bi bi-toggle-on",
        off: "bi bi-toggle2-off"
      },
      tree: {
        open: "bi bi-caret-down-fill",
        closed: "bi bi-caret-right-fill"
      }
    };
    const ErrorPanel = ({ title: title2, error: error2 }) => {
      const message2 = error2.message;
      const stack2 = error2.stack;
      return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "error-panel centered-flex", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "error-panel-heading centered-flex", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: `${ApplicationIcons.error} error-icon` }) }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: title2 || "" })
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "error-panel-body", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
          "Error: ",
          message2 || "",
          stack2 && error2.displayStack !== false && /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: "error-panel-stack", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("code", { children: [
            "at ",
            stack2
          ] }) })
        ] }) })
      ] });
    };
    class AppErrorBoundary extends reactExports.Component {
      constructor(props) {
        super(props);
        this.state = { hasError: false };
      }
      static getDerivedStateFromError(error2) {
        return { hasError: true, error: error2 };
      }
      componentDidCatch(error2, errorInfo) {
        console.log({ error: error2, errorInfo });
      }
      render() {
        if (this.state.hasError) {
          console.error({ e: this.state.error });
          if (this.state.error) {
            return /* @__PURE__ */ jsxRuntimeExports.jsx(
              ErrorPanel,
              {
                title: "An unexpected error occurred.",
                error: this.state.error
              }
            );
          } else {
            return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "An unknown error with no additional information occured." });
          }
        }
        return this.props.children;
      }
    }
    function r(e) {
      var t2, f, n = "";
      if ("string" == typeof e || "number" == typeof e) n += e;
      else if ("object" == typeof e) if (Array.isArray(e)) {
        var o = e.length;
        for (t2 = 0; t2 < o; t2++) e[t2] && (f = r(e[t2])) && (n && (n += " "), n += f);
      } else for (f in e) e[f] && (n && (n += " "), n += f);
      return n;
    }
    function clsx() {
      for (var e, t2, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t2 = r(e)) && (n && (n += " "), n += t2);
      return n;
    }
    const container$o = "_container_1n7pm_1";
    const label$b = "_label_1n7pm_7";
    const outer = "_outer_1n7pm_11";
    const inner = "_inner_1n7pm_20";
    const styles$1Q = {
      container: container$o,
      label: label$b,
      outer,
      inner
    };
    const ProgressBar = ({
      min: min2,
      max: max2,
      value: value2,
      label: label2,
      width = "100px"
    }) => {
      return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$1Q.container), children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$1Q.outer), style: { width }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
          "div",
          {
            className: clsx(styles$1Q.inner),
            style: { width: `${(value2 - min2) / (max2 - min2) * 100}%` }
          }
        ) }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$1Q.label, "text-size-smallest"), children: [
          value2,
          " / ",
          max2,
          " ",
          label2 || ""
        ] })
      ] });
    };
    const log$3 = createLogger("Client-Events-Service");
    const kRetries = 10;
    const kPollingInterval = 5;
    const kRefreshEvent = "refresh-evals";
    class ClientEventsService {
      currentPolling = null;
      abortController = null;
      isRefreshing = false;
      pendingLogs = /* @__PURE__ */ new Set();
      onRefreshCallback = null;
      setRefreshCallback(callback) {
        this.onRefreshCallback = callback;
      }
      async refreshPendingLogFiles() {
        if (this.isRefreshing || !this.onRefreshCallback) {
          return;
        }
        do {
          try {
            const logFiles = [...this.pendingLogs];
            this.pendingLogs.clear();
            this.isRefreshing = true;
            await this.onRefreshCallback(logFiles);
          } finally {
            this.isRefreshing = false;
          }
        } while (this.pendingLogs.size > 0);
      }
      async refreshLogFiles(logs) {
        logs.forEach((file) => this.pendingLogs.add(file));
        await this.refreshPendingLogFiles();
      }
      startPolling(logs, api2) {
        this.stopPolling();
        this.abortController = new AbortController();
        let pollingCount = 1;
        this.currentPolling = createPolling(
          `Client-Events`,
          async () => {
            if (this.abortController?.signal.aborted) {
              log$3.debug(`Component unmounted, stopping poll for client events`);
              return false;
            }
            log$3.debug(`Polling client events`);
            const events = await api2?.client_events();
            log$3.debug(`Received events`, events);
            if (this.abortController?.signal.aborted) {
              log$3.debug(`Polling aborted, stopping poll for client events`);
              return false;
            }
            if ((events || []).includes(kRefreshEvent)) {
              await this.refreshLogFiles(logs);
            }
            if (pollingCount++ % 10 === 0) {
              await this.refreshLogFiles(logs);
            }
            return true;
          },
          {
            maxRetries: kRetries,
            interval: kPollingInterval
          }
        );
        this.currentPolling.start();
      }
      stopPolling() {
        if (this.currentPolling) {
          this.currentPolling.stop();
          this.currentPolling = null;
        }
        if (this.abortController) {
          this.abortController.abort();
          this.abortController = null;
        }
      }
      cleanup() {
        log$3.debug(`Cleanup`);
        this.stopPolling();
        this.pendingLogs.clear();
        this.onRefreshCallback = null;
      }
    }
    const clientEventsService = new ClientEventsService();
    const arrayToString = (val) => {
      val = Array.isArray(val) ? val : [val];
      return val.join(", ");
    };
    const inputString = (input2) => {
      if (typeof input2 === "string") {
        return [input2];
      } else {
        return input2.map((inp) => {
          if (typeof inp === "string") {
            return inp;
          } else {
            const content2 = inp.content;
            if (typeof content2 === "string") {
              return content2;
            } else {
              const result2 = content2.map((con) => {
                if (con.type === "text") {
                  return con.text;
                } else {
                  return "";
                }
              });
              return result2.join("\n");
            }
          }
        });
      }
    };
    const formatDataset = (samples, epochs, name2) => {
      const perEpochSamples = epochs > 0 ? samples / epochs : samples;
      const namePrefix = name2 ? `${name2} — ` : "";
      const terms = [
        namePrefix,
        String(perEpochSamples),
        epochs > 1 ? `x ${epochs} ` : "",
        samples === 1 ? "sample" : "samples"
      ];
      return terms.join(" ");
    };
    const formatTime$1 = (seconds) => {
      if (seconds < 60) {
        return `${formatPrettyDecimal(seconds, 1)} sec`;
      } else if (seconds < 60 * 60) {
        return `${Math.floor(seconds / 60)} min ${Math.floor(seconds % 60)} sec`;
      } else if (seconds < 60 * 60 * 24) {
        const hours = Math.floor(seconds / (60 * 60));
        const minutes = Math.floor(seconds % (60 * 60) / 60);
        const remainingSeconds = seconds % 60;
        return `${hours} hr ${minutes} min ${Math.floor(remainingSeconds)} sec`;
      } else {
        const days = Math.floor(seconds / (60 * 60 * 24));
        const hours = Math.floor(seconds % (60 * 60 * 24) / (60 * 60));
        const minutes = Math.floor(seconds % (60 * 60) / 60);
        const remainingSeconds = seconds % 60;
        return `${days} days ${hours} hr ${minutes} min ${Math.floor(remainingSeconds)} sec`;
      }
    };
    function formatPrettyDecimal(num2, maxDecimals = 3) {
      const numDecimalPlaces = num2.toString().includes(".") ? num2.toString().split(".")[1].length : 0;
      if (numDecimalPlaces === 0) {
        return num2.toFixed(1);
      } else if (numDecimalPlaces > maxDecimals) {
        return num2.toFixed(maxDecimals);
      } else {
        return num2.toString();
      }
    }
    function formatDecimalNoTrailingZeroes(num2) {
      if (typeof num2 !== "number") {
        return num2;
      }
      if (num2.toString().includes(".")) {
        const decimal = num2.toString().split(".")[1];
        const trimmed = decimal.replace(/\.?0+$/, "");
        return num2.toFixed(trimmed.length);
      } else {
        return num2.toFixed(0);
      }
    }
    function toTitleCase(str2) {
      if (!str2) {
        return str2;
      }
      return str2.split(" ").map(
        (w) => w.length > 0 ? w[0].toUpperCase() + w.substr(1).toLowerCase() : w
      ).join(" ");
    }
    function formatNoDecimal(num2) {
      if (typeof num2 !== "number") {
        return num2;
      }
      const rounded = Math.round(num2);
      return rounded.toFixed(0);
    }
    function formatNumber(num2) {
      return num2.toLocaleString(navigator.language, {
        minimumFractionDigits: 0,
        maximumFractionDigits: 5
      });
    }
    function formatDateTime(date) {
      const options2 = {
        year: "2-digit",
        month: "2-digit",
        day: "2-digit",
        hour: "numeric",
        minute: "2-digit",
        second: "2-digit",
        hour12: true
      };
      return new Intl.DateTimeFormat(void 0, options2).format(date);
    }
    function formatDuration(start2, end2) {
      const durationMs = end2.getTime() - start2.getTime();
      const durationSec = durationMs / 1e3;
      return formatTime$1(durationSec);
    }
    const errorType = (message2) => {
      if (!message2) {
        return "Error";
      }
      if (message2.includes("(")) {
        return message2.split("(")[0];
      }
      return "Error";
    };
    const circle$1 = "_circle_qymy9_1";
    const green$1 = "_green_qymy9_12";
    const red$1 = "_red_qymy9_18";
    const styles$1P = {
      circle: circle$1,
      green: green$1,
      red: red$1
    };
    const booleanScoreDescriptor = () => {
      return {
        scoreType: "boolean",
        compare: (a, b) => {
          return Number(a.value) - Number(b.value);
        },
        render: (score2) => {
          return /* @__PURE__ */ jsxRuntimeExports.jsx(
            "span",
            {
              className: clsx(
                styles$1P.circle,
                "text-size-small",
                score2 ? styles$1P.green : styles$1P.red
              ),
              children: String(score2)
            }
          );
        }
      };
    };
    const categoricalScoreDescriptor = (values) => {
      return {
        scoreType: kScoreTypeCategorical,
        categories: values,
        compare: (a, b) => {
          return String(a.value).localeCompare(String(b.value));
        },
        render: (score2) => {
          return String(score2);
        }
      };
    };
    const isNumeric$1 = (n) => {
      return !isNaN(parseFloat(n)) && isFinite(n);
    };
    const toArray = (val) => {
      if (Array.isArray(val)) {
        return val;
      } else {
        return [val];
      }
    };
    const listScoreDescriptor = (_values) => {
      return {
        scoreType: kScoreTypeList,
        filterable: false,
        compare: (a, b) => {
          return a.value.length - b.value.length;
        },
        render: (score2) => {
          if (score2 === null || score2 === void 0) {
            return "[null]";
          }
          const formattedScores = [];
          score2.forEach((value2) => {
            if (!Array.isArray(score2)) {
              throw new Error(
                "Unexpected use of list score descriptor for non-lisß object"
              );
            }
            const formattedValue = value2 && isNumeric$1(value2) ? formatPrettyDecimal(
              typeof value2 === "number" ? value2 : parseFloat(value2 === true ? "1" : value2)
            ) : String(value2);
            formattedScores.push(formattedValue);
          });
          return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
            "[",
            formattedScores.join(", "),
            "]"
          ] }, `score-value`);
        }
      };
    };
    function compareWithNan(a, b) {
      const aIsNaN = Number.isNaN(a);
      const bIsNaN = Number.isNaN(b);
      if (aIsNaN && bIsNaN) {
        return 0;
      }
      if (aIsNaN) {
        return 1;
      }
      if (bIsNaN) {
        return -1;
      }
      return a - b;
    }
    const numericScoreDescriptor = (values) => {
      const onlyNumeric = values.filter((val) => {
        return typeof val === "number";
      });
      return {
        scoreType: kScoreTypeNumeric,
        min: Math.min(...onlyNumeric),
        max: Math.max(...onlyNumeric),
        compare: (a, b) => {
          if (typeof a.value === "number" && typeof b.value === "number") {
            return compareWithNan(a.value, b.value);
          } else if (typeof a.value === "number" && typeof b.value !== "number") {
            return -1;
          } else if (typeof a.value !== "number" && typeof b.value === "number") {
            return 1;
          } else {
            return 0;
          }
        },
        render: (score2) => {
          return formatDecimalNoTrailingZeroes(Number(score2));
        }
      };
    };
    const container$n = "_container_1ramc_1";
    const key$1 = "_key_1ramc_12";
    const value$2 = "_value_1ramc_16";
    const styles$1O = {
      container: container$n,
      key: key$1,
      value: value$2
    };
    const objectScoreDescriptor = (values) => {
      const buckets = values.map((val) => {
        return JSON.stringify(val);
      });
      const vals = new Set(buckets);
      let categories = void 0;
      if (vals.size < 10) {
        categories = Array.from(vals).map((val) => {
          return {
            val,
            text: val
          };
        });
      }
      return {
        scoreType: kScoreTypeObject,
        categories,
        filterable: false,
        compare: () => {
          return 0;
        },
        render: (score2) => {
          if (score2 === null || score2 === void 0) {
            return "[null]";
          }
          const scores2 = [];
          const keys = Object.keys(score2);
          keys.forEach((key2) => {
            if (typeof score2 !== "object" || Array.isArray(score2)) {
              throw new Error(
                "Unexpected use of object score descriptor for non-score object"
              );
            }
            const value2 = score2[key2];
            const formattedValue = value2 && isNumeric$1(value2) ? formatPrettyDecimal(
              typeof value2 === "number" ? value2 : parseFloat(value2 === true ? "1" : value2)
            ) : String(value2);
            scores2.push(
              /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
                /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$1O.key, "text-size-smaller"), children: key2 }),
                /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$1O.value, "text-size-base"), children: formattedValue })
              ] })
            );
          });
          return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$1O.container), children: scores2 }, `score-value`);
        }
      };
    };
    function commonjsRequire(path) {
      throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
    }
    var ansiOutput = { exports: {} };
    var hasRequiredAnsiOutput;
    function requireAnsiOutput() {
      if (hasRequiredAnsiOutput) return ansiOutput.exports;
      hasRequiredAnsiOutput = 1;
      (function(module2, exports2) {
        (function(factory) {
          {
            var v = factory(commonjsRequire, exports2);
            if (v !== void 0) module2.exports = v;
          }
        })(function(require2, exports3) {
          Object.defineProperty(exports3, "__esModule", { value: true });
          exports3.ANSIOutput = exports3.ANSIColor = exports3.ANSIFont = exports3.ANSIStyle = void 0;
          let counter2 = 0;
          const generateId = () => {
            return `${++counter2}`.padStart(16, "0");
          };
          var ANSIStyle;
          (function(ANSIStyle2) {
            ANSIStyle2["Bold"] = "ansiBold";
            ANSIStyle2["Dim"] = "ansiDim";
            ANSIStyle2["Italic"] = "ansiItalic";
            ANSIStyle2["Underlined"] = "ansiUnderlined";
            ANSIStyle2["SlowBlink"] = "ansiSlowBlink";
            ANSIStyle2["RapidBlink"] = "ansiRapidBlink";
            ANSIStyle2["Hidden"] = "ansiHidden";
            ANSIStyle2["CrossedOut"] = "ansiCrossedOut";
            ANSIStyle2["Fraktur"] = "ansiFraktur";
            ANSIStyle2["DoubleUnderlined"] = "ansiDoubleUnderlined";
            ANSIStyle2["Framed"] = "ansiFramed";
            ANSIStyle2["Encircled"] = "ansiEncircled";
            ANSIStyle2["Overlined"] = "ansiOverlined";
            ANSIStyle2["Superscript"] = "ansiSuperscript";
            ANSIStyle2["Subscript"] = "ansiSubscript";
          })(ANSIStyle || (exports3.ANSIStyle = ANSIStyle = {}));
          var ANSIFont;
          (function(ANSIFont2) {
            ANSIFont2["AlternativeFont1"] = "ansiAlternativeFont1";
            ANSIFont2["AlternativeFont2"] = "ansiAlternativeFont2";
            ANSIFont2["AlternativeFont3"] = "ansiAlternativeFont3";
            ANSIFont2["AlternativeFont4"] = "ansiAlternativeFont4";
            ANSIFont2["AlternativeFont5"] = "ansiAlternativeFont5";
            ANSIFont2["AlternativeFont6"] = "ansiAlternativeFont6";
            ANSIFont2["AlternativeFont7"] = "ansiAlternativeFont7";
            ANSIFont2["AlternativeFont8"] = "ansiAlternativeFont8";
            ANSIFont2["AlternativeFont9"] = "ansiAlternativeFont9";
          })(ANSIFont || (exports3.ANSIFont = ANSIFont = {}));
          var ANSIColor;
          (function(ANSIColor2) {
            ANSIColor2["Black"] = "ansiBlack";
            ANSIColor2["Red"] = "ansiRed";
            ANSIColor2["Green"] = "ansiGreen";
            ANSIColor2["Yellow"] = "ansiYellow";
            ANSIColor2["Blue"] = "ansiBlue";
            ANSIColor2["Magenta"] = "ansiMagenta";
            ANSIColor2["Cyan"] = "ansiCyan";
            ANSIColor2["White"] = "ansiWhite";
            ANSIColor2["BrightBlack"] = "ansiBrightBlack";
            ANSIColor2["BrightRed"] = "ansiBrightRed";
            ANSIColor2["BrightGreen"] = "ansiBrightGreen";
            ANSIColor2["BrightYellow"] = "ansiBrightYellow";
            ANSIColor2["BrightBlue"] = "ansiBrightBlue";
            ANSIColor2["BrightMagenta"] = "ansiBrightMagenta";
            ANSIColor2["BrightCyan"] = "ansiBrightCyan";
            ANSIColor2["BrightWhite"] = "ansiBrightWhite";
          })(ANSIColor || (exports3.ANSIColor = ANSIColor = {}));
          class ANSIOutput {
            //#region Private Properties
            /**
             * Gets or sets the parser state.
             */
            _parserState = ParserState.BufferingOutput;
            /**
             * Gets or sets the control sequence that's being parsed.
             */
            _controlSequence = "";
            /**
             * Gets or sets the SGR state.
             */
            _sgrState = void 0;
            /**
             * Gets or sets the current set of output lines.
             */
            _outputLines = [];
            /**
             * Gets or sets the output line.
             */
            _outputLine = 0;
            /**
             * Gets or sets the output column.
             */
            _outputColumn = 0;
            /**
             * Gets or sets the buffer.
             */
            _buffer = "";
            /**
             * Gets or sets a value which indicates whether there is a pending newline.
             */
            _pendingNewline = false;
            //#endregion Private Properties
            //#region Public Properties
            /**
             * Gets the output lines.
             */
            get outputLines() {
              this.flushBuffer();
              return this._outputLines;
            }
            //#endregion Public Properties
            //#region Public Static Methods
            /**
             * Processes output and returns the ANSIOutput lines of the output.
             * @param output The output to process.
             * @returns The ANSIOutput lines of the output.
             */
            static processOutput(output2) {
              const ansiOutput2 = new ANSIOutput();
              ansiOutput2.processOutput(output2);
              return ansiOutput2.outputLines;
            }
            //#endregion Public Static Methods
            //#region Public Methods
            /**
             * Processes output.
             * @param output The output to process.
             */
            processOutput(output2) {
              for (let i2 = 0; i2 < output2.length; i2++) {
                if (this._pendingNewline) {
                  this.flushBuffer();
                  this._outputLine++;
                  this._outputColumn = 0;
                  this._pendingNewline = false;
                }
                const char = output2.charAt(i2);
                if (this._parserState === ParserState.BufferingOutput) {
                  if (char === "\x1B") {
                    this.flushBuffer();
                    this._parserState = ParserState.ControlSequenceStarted;
                  } else if (char === "") {
                    this.flushBuffer();
                    this._parserState = ParserState.ParsingControlSequence;
                  } else {
                    this.processCharacter(char);
                  }
                } else if (this._parserState === ParserState.ControlSequenceStarted) {
                  if (char === "[") {
                    this._parserState = ParserState.ParsingControlSequence;
                  } else {
                    this._parserState = ParserState.BufferingOutput;
                    this.processCharacter(char);
                  }
                } else if (this._parserState === ParserState.ParsingControlSequence) {
                  this._controlSequence += char;
                  if (char.match(/^[A-Za-z]$/)) {
                    this.processControlSequence();
                  }
                }
              }
              this.flushBuffer();
            }
            //#endregion Public Methods
            //#region Private Methods
            /**
             * Flushes the buffer to the output line.
             */
            flushBuffer() {
              for (let i2 = this._outputLines.length; i2 < this._outputLine + 1; i2++) {
                this._outputLines.push(new OutputLine());
              }
              if (this._buffer) {
                const outputLine = this._outputLines[this._outputLine];
                outputLine.insert(this._buffer, this._outputColumn, this._sgrState);
                this._outputColumn += this._buffer.length;
                this._buffer = "";
              }
            }
            /**
             * Processes a character.
             * @param char The character.
             */
            processCharacter(char) {
              switch (char) {
                // LF sets the pending newline flag.
                case "\n":
                  this._pendingNewline = true;
                  break;
                // CR flushes the buffer and sets the output column to 0.
                case "\r":
                  this.flushBuffer();
                  this._outputColumn = 0;
                  break;
                // Buffer the character.
                default:
                  this._buffer += char;
                  break;
              }
            }
            /**
             * Processes a control sequence.
             */
            processControlSequence() {
              switch (this._controlSequence.charAt(this._controlSequence.length - 1)) {
                // CUU (Cursor Up).
                case "A":
                  this.processCUU();
                  break;
                // CUD (Cursor Down).
                case "B":
                  this.processCUD();
                  break;
                // CUF (Cursor Forward).
                case "C":
                  this.processCUF();
                  break;
                // CUB (Cursor Backward).
                case "D":
                  this.processCUB();
                  break;
                // CUP (Cursor Position).
                case "H":
                  this.processCUP();
                  break;
                // ED (Erase in Display).
                case "J":
                  this.processED();
                  break;
                // EL (Erase in Line).
                case "K":
                  this.processEL();
                  break;
                // SGR (Select Graphic Rendition).
                case "m":
                  this.processSGR();
                  break;
              }
              this._controlSequence = "";
              this._parserState = ParserState.BufferingOutput;
            }
            /**
             * Processes a CUU (Cursor Up) control sequence.
             */
            processCUU() {
              const match = this._controlSequence.match(/^([0-9]*)A$/);
              if (match) {
                this._outputLine = Math.max(this._outputLine - rangeParam(match[1], 1, 1), 0);
              }
            }
            /**
             * Processes a CUD (Cursor Down) control sequence.
             */
            processCUD() {
              const match = this._controlSequence.match(/^([0-9]*)B$/);
              if (match) {
                this._outputLine = this._outputLine + rangeParam(match[1], 1, 1);
              }
            }
            /**
             * Processes a CUF (Cursor Forward) control sequence.
             */
            processCUF() {
              const match = this._controlSequence.match(/^([0-9]*)C$/);
              if (match) {
                this._outputColumn = this._outputColumn + rangeParam(match[1], 1, 1);
              }
            }
            /**
             * Processes a CUB (Cursor Backward) control sequence.
             */
            processCUB() {
              const match = this._controlSequence.match(/^([0-9]*)D$/);
              if (match) {
                this._outputColumn = Math.max(this._outputColumn - rangeParam(match[1], 1, 1), 0);
              }
            }
            /**
             * Processes a CUP (Cursor Position) control sequence.
             */
            processCUP() {
              const match = this._controlSequence.match(/^([0-9]*)(?:;?([0-9]*))H$/);
              if (match) {
                this._outputLine = rangeParam(match[1], 1, 1) - 1;
                this._outputColumn = rangeParam(match[2], 1, 1) - 1;
              }
            }
            /**
             * Processes an ED (Erase in Display) control sequence.
             */
            processED() {
              const match = this._controlSequence.match(/^([0-9]*)J$/);
              if (match) {
                switch (getParam(match[1], 0)) {
                  // Clear from cursor to the end of the screen.
                  case 0:
                    this._outputLines[this._outputLine].clearToEndOfLine(this._outputColumn);
                    for (let i2 = this._outputLine + 1; i2 < this._outputLines.length; i2++) {
                      this._outputLines[i2].clearEntireLine();
                    }
                    break;
                  // Clear from cursor to the beginning of the screen.
                  case 1:
                    this._outputLines[this._outputLine].clearToBeginningOfLine(this._outputColumn);
                    for (let i2 = 0; i2 < this._outputLine; i2++) {
                      this._outputLines[i2].clearEntireLine();
                    }
                    break;
                  // Clear the entire screen.
                  case 2:
                    for (let i2 = 0; i2 < this._outputLines.length; i2++) {
                      this._outputLines[i2].clearEntireLine();
                    }
                    break;
                }
              }
            }
            /**
             * Processes an EL (Erase in Line) control sequence.
             */
            processEL() {
              const match = this._controlSequence.match(/^([0-9]*)K$/);
              if (match) {
                const outputLine = this._outputLines[this._outputLine];
                switch (getParam(match[1], 0)) {
                  // Clear from cursor to the end of the line.
                  case 0:
                    outputLine.clearToEndOfLine(this._outputColumn);
                    break;
                  // Clear from cursor to the beginning of the line.
                  case 1:
                    outputLine.clearToBeginningOfLine(this._outputColumn);
                    break;
                  // Clear the entire line.
                  case 2:
                    outputLine.clearEntireLine();
                    break;
                }
              }
            }
            /**
             * Processes an SGR (Select Graphic Rendition) control sequence.
             */
            processSGR() {
              const sgrState = this._sgrState ? this._sgrState.copy() : new SGRState();
              const sgrParams = this._controlSequence.slice(0, -1).split(";").map((sgrParam) => sgrParam === "" ? SGRParam.Reset : parseInt(sgrParam, 10));
              for (let index = 0; index < sgrParams.length; index++) {
                const sgrParam = sgrParams[index];
                const processSetColor = () => {
                  if (index + 1 === sgrParams.length) {
                    return void 0;
                  }
                  switch (sgrParams[++index]) {
                    // SGRColorParam.Color256 is an indexed color.
                    case SGRParamColor.Color256: {
                      if (index + 1 === sgrParams.length) {
                        return void 0;
                      }
                      const colorIndex = sgrParams[++index];
                      switch (colorIndex) {
                        case SGRParamIndexedColor.Black:
                          return ANSIColor.Black;
                        case SGRParamIndexedColor.Red:
                          return ANSIColor.Red;
                        case SGRParamIndexedColor.Green:
                          return ANSIColor.Green;
                        case SGRParamIndexedColor.Yellow:
                          return ANSIColor.Yellow;
                        case SGRParamIndexedColor.Blue:
                          return ANSIColor.Blue;
                        case SGRParamIndexedColor.Magenta:
                          return ANSIColor.Magenta;
                        case SGRParamIndexedColor.Cyan:
                          return ANSIColor.Cyan;
                        case SGRParamIndexedColor.White:
                          return ANSIColor.White;
                        case SGRParamIndexedColor.BrightBlack:
                          return ANSIColor.BrightBlack;
                        case SGRParamIndexedColor.BrightRed:
                          return ANSIColor.BrightRed;
                        case SGRParamIndexedColor.BrightGreen:
                          return ANSIColor.BrightGreen;
                        case SGRParamIndexedColor.BrightYellow:
                          return ANSIColor.BrightYellow;
                        case SGRParamIndexedColor.BrightBlue:
                          return ANSIColor.BrightBlue;
                        case SGRParamIndexedColor.BrightMagenta:
                          return ANSIColor.BrightMagenta;
                        case SGRParamIndexedColor.BrightCyan:
                          return ANSIColor.BrightCyan;
                        case SGRParamIndexedColor.BrightWhite:
                          return ANSIColor.BrightWhite;
                        // Process other color indexes.
                        default:
                          if (colorIndex % 1 !== 0) {
                            return void 0;
                          }
                          if (colorIndex >= 16 && colorIndex <= 231) {
                            let colorNumber = colorIndex - 16;
                            let blue = colorNumber % 6;
                            colorNumber = (colorNumber - blue) / 6;
                            let green2 = colorNumber % 6;
                            colorNumber = (colorNumber - green2) / 6;
                            let red2 = colorNumber;
                            blue = Math.round(blue * 255 / 5);
                            green2 = Math.round(green2 * 255 / 5);
                            red2 = Math.round(red2 * 255 / 5);
                            return "#" + twoDigitHex(red2) + twoDigitHex(green2) + twoDigitHex(blue);
                          } else if (colorIndex >= 232 && colorIndex <= 255) {
                            const rgb = Math.round((colorIndex - 232) / 23 * 255);
                            const grayscale = twoDigitHex(rgb);
                            return "#" + grayscale + grayscale + grayscale;
                          } else {
                            return void 0;
                          }
                      }
                    }
                    // SGRParamColor.ColorRGB is an r;g;b color.
                    case SGRParamColor.ColorRGB: {
                      const rgb = [0, 0, 0];
                      for (let i2 = 0; i2 < 3 && index + 1 < sgrParams.length; i2++) {
                        rgb[i2] = sgrParams[++index];
                      }
                      return "#" + twoDigitHex(rgb[0]) + twoDigitHex(rgb[1]) + twoDigitHex(rgb[2]);
                    }
                  }
                  return void 0;
                };
                switch (sgrParam) {
                  case SGRParam.Reset:
                    sgrState.reset();
                    break;
                  case SGRParam.Bold:
                    sgrState.setStyle(ANSIStyle.Bold);
                    break;
                  case SGRParam.Dim:
                    sgrState.setStyle(ANSIStyle.Dim);
                    break;
                  case SGRParam.Italic:
                    sgrState.setStyle(ANSIStyle.Italic);
                    break;
                  case SGRParam.Underlined:
                    sgrState.setStyle(ANSIStyle.Underlined, ANSIStyle.DoubleUnderlined);
                    break;
                  case SGRParam.SlowBlink:
                    sgrState.setStyle(ANSIStyle.SlowBlink, ANSIStyle.RapidBlink);
                    break;
                  case SGRParam.RapidBlink:
                    sgrState.setStyle(ANSIStyle.RapidBlink, ANSIStyle.SlowBlink);
                    break;
                  case SGRParam.Reversed:
                    sgrState.setReversed(true);
                    break;
                  case SGRParam.Hidden:
                    sgrState.setStyle(ANSIStyle.Hidden);
                    break;
                  case SGRParam.CrossedOut:
                    sgrState.setStyle(ANSIStyle.CrossedOut);
                    break;
                  case SGRParam.PrimaryFont:
                    sgrState.setFont();
                    break;
                  case SGRParam.AlternativeFont1:
                    sgrState.setFont(ANSIFont.AlternativeFont1);
                    break;
                  case SGRParam.AlternativeFont2:
                    sgrState.setFont(ANSIFont.AlternativeFont2);
                    break;
                  case SGRParam.AlternativeFont3:
                    sgrState.setFont(ANSIFont.AlternativeFont3);
                    break;
                  case SGRParam.AlternativeFont4:
                    sgrState.setFont(ANSIFont.AlternativeFont4);
                    break;
                  case SGRParam.AlternativeFont5:
                    sgrState.setFont(ANSIFont.AlternativeFont5);
                    break;
                  case SGRParam.AlternativeFont6:
                    sgrState.setFont(ANSIFont.AlternativeFont6);
                    break;
                  case SGRParam.AlternativeFont7:
                    sgrState.setFont(ANSIFont.AlternativeFont7);
                    break;
                  case SGRParam.AlternativeFont8:
                    sgrState.setFont(ANSIFont.AlternativeFont8);
                    break;
                  case SGRParam.AlternativeFont9:
                    sgrState.setFont(ANSIFont.AlternativeFont9);
                    break;
                  case SGRParam.Fraktur:
                    sgrState.setStyle(ANSIStyle.Fraktur);
                    break;
                  case SGRParam.DoubleUnderlined:
                    sgrState.setStyle(ANSIStyle.DoubleUnderlined, ANSIStyle.Underlined);
                    break;
                  case SGRParam.NormalIntensity:
                    sgrState.deleteStyles(ANSIStyle.Bold, ANSIStyle.Dim);
                    break;
                  case SGRParam.NotItalicNotFraktur:
                    sgrState.deleteStyles(ANSIStyle.Italic, ANSIStyle.Fraktur);
                    break;
                  case SGRParam.NotUnderlined:
                    sgrState.deleteStyles(ANSIStyle.Underlined, ANSIStyle.DoubleUnderlined);
                    break;
                  case SGRParam.NotBlinking:
                    sgrState.deleteStyles(ANSIStyle.SlowBlink, ANSIStyle.RapidBlink);
                    break;
                  case SGRParam.ProportionalSpacing:
                    break;
                  case SGRParam.NotReversed:
                    sgrState.setReversed(false);
                    break;
                  case SGRParam.Reveal:
                    sgrState.deleteStyles(ANSIStyle.Hidden);
                    break;
                  case SGRParam.NotCrossedOut:
                    sgrState.deleteStyles(ANSIStyle.CrossedOut);
                    break;
                  case SGRParam.ForegroundBlack:
                    sgrState.setForegroundColor(ANSIColor.Black);
                    break;
                  case SGRParam.ForegroundRed:
                    sgrState.setForegroundColor(ANSIColor.Red);
                    break;
                  case SGRParam.ForegroundGreen:
                    sgrState.setForegroundColor(ANSIColor.Green);
                    break;
                  case SGRParam.ForegroundYellow:
                    sgrState.setForegroundColor(ANSIColor.Yellow);
                    break;
                  case SGRParam.ForegroundBlue:
                    sgrState.setForegroundColor(ANSIColor.Blue);
                    break;
                  case SGRParam.ForegroundMagenta:
                    sgrState.setForegroundColor(ANSIColor.Magenta);
                    break;
                  case SGRParam.ForegroundCyan:
                    sgrState.setForegroundColor(ANSIColor.Cyan);
                    break;
                  case SGRParam.ForegroundWhite:
                    sgrState.setForegroundColor(ANSIColor.White);
                    break;
                  case SGRParam.SetForeground: {
                    const foregroundColor2 = processSetColor();
                    if (foregroundColor2) {
                      sgrState.setForegroundColor(foregroundColor2);
                    }
                    break;
                  }
                  case SGRParam.DefaultForeground:
                    sgrState.setForegroundColor();
                    break;
                  case SGRParam.BackgroundBlack:
                    sgrState.setBackgroundColor(ANSIColor.Black);
                    break;
                  case SGRParam.BackgroundRed:
                    sgrState.setBackgroundColor(ANSIColor.Red);
                    break;
                  case SGRParam.BackgroundGreen:
                    sgrState.setBackgroundColor(ANSIColor.Green);
                    break;
                  case SGRParam.BackgroundYellow:
                    sgrState.setBackgroundColor(ANSIColor.Yellow);
                    break;
                  case SGRParam.BackgroundBlue:
                    sgrState.setBackgroundColor(ANSIColor.Blue);
                    break;
                  case SGRParam.BackgroundMagenta:
                    sgrState.setBackgroundColor(ANSIColor.Magenta);
                    break;
                  case SGRParam.BackgroundCyan:
                    sgrState.setBackgroundColor(ANSIColor.Cyan);
                    break;
                  case SGRParam.BackgroundWhite:
                    sgrState.setBackgroundColor(ANSIColor.White);
                    break;
                  case SGRParam.SetBackground: {
                    const backgroundColor2 = processSetColor();
                    if (backgroundColor2) {
                      sgrState.setBackgroundColor(backgroundColor2);
                    }
                    break;
                  }
                  case SGRParam.DefaultBackground:
                    sgrState.setBackgroundColor();
                    break;
                  case SGRParam.ForegroundBrightBlack:
                    sgrState.setForegroundColor(ANSIColor.BrightBlack);
                    break;
                  case SGRParam.ForegroundBrightRed:
                    sgrState.setForegroundColor(ANSIColor.BrightRed);
                    break;
                  case SGRParam.ForegroundBrightGreen:
                    sgrState.setForegroundColor(ANSIColor.BrightGreen);
                    break;
                  case SGRParam.ForegroundBrightYellow:
                    sgrState.setForegroundColor(ANSIColor.BrightYellow);
                    break;
                  case SGRParam.ForegroundBrightBlue:
                    sgrState.setForegroundColor(ANSIColor.BrightBlue);
                    break;
                  case SGRParam.ForegroundBrightMagenta:
                    sgrState.setForegroundColor(ANSIColor.BrightMagenta);
                    break;
                  case SGRParam.ForegroundBrightCyan:
                    sgrState.setForegroundColor(ANSIColor.BrightCyan);
                    break;
                  case SGRParam.ForegroundBrightWhite:
                    sgrState.setForegroundColor(ANSIColor.BrightWhite);
                    break;
                  case SGRParam.BackgroundBrightBlack:
                    sgrState.setBackgroundColor(ANSIColor.BrightBlack);
                    break;
                  case SGRParam.BackgroundBrightRed:
                    sgrState.setBackgroundColor(ANSIColor.BrightRed);
                    break;
                  case SGRParam.BackgroundBrightGreen:
                    sgrState.setBackgroundColor(ANSIColor.BrightGreen);
                    break;
                  case SGRParam.BackgroundBrightYellow:
                    sgrState.setBackgroundColor(ANSIColor.BrightYellow);
                    break;
                  case SGRParam.BackgroundBrightBlue:
                    sgrState.setBackgroundColor(ANSIColor.BrightBlue);
                    break;
                  case SGRParam.BackgroundBrightMagenta:
                    sgrState.setBackgroundColor(ANSIColor.BrightMagenta);
                    break;
                  case SGRParam.BackgroundBrightCyan:
                    sgrState.setBackgroundColor(ANSIColor.BrightCyan);
                    break;
                  case SGRParam.BackgroundBrightWhite:
                    sgrState.setBackgroundColor(ANSIColor.BrightWhite);
                    break;
                }
              }
              if (!SGRState.equivalent(sgrState, this._sgrState)) {
                this._sgrState = sgrState;
              }
            }
          }
          exports3.ANSIOutput = ANSIOutput;
          var SGRParam;
          (function(SGRParam2) {
            SGRParam2[SGRParam2["Reset"] = 0] = "Reset";
            SGRParam2[SGRParam2["Bold"] = 1] = "Bold";
            SGRParam2[SGRParam2["Dim"] = 2] = "Dim";
            SGRParam2[SGRParam2["Italic"] = 3] = "Italic";
            SGRParam2[SGRParam2["Underlined"] = 4] = "Underlined";
            SGRParam2[SGRParam2["SlowBlink"] = 5] = "SlowBlink";
            SGRParam2[SGRParam2["RapidBlink"] = 6] = "RapidBlink";
            SGRParam2[SGRParam2["Reversed"] = 7] = "Reversed";
            SGRParam2[SGRParam2["Hidden"] = 8] = "Hidden";
            SGRParam2[SGRParam2["CrossedOut"] = 9] = "CrossedOut";
            SGRParam2[SGRParam2["PrimaryFont"] = 10] = "PrimaryFont";
            SGRParam2[SGRParam2["AlternativeFont1"] = 11] = "AlternativeFont1";
            SGRParam2[SGRParam2["AlternativeFont2"] = 12] = "AlternativeFont2";
            SGRParam2[SGRParam2["AlternativeFont3"] = 13] = "AlternativeFont3";
            SGRParam2[SGRParam2["AlternativeFont4"] = 14] = "AlternativeFont4";
            SGRParam2[SGRParam2["AlternativeFont5"] = 15] = "AlternativeFont5";
            SGRParam2[SGRParam2["AlternativeFont6"] = 16] = "AlternativeFont6";
            SGRParam2[SGRParam2["AlternativeFont7"] = 17] = "AlternativeFont7";
            SGRParam2[SGRParam2["AlternativeFont8"] = 18] = "AlternativeFont8";
            SGRParam2[SGRParam2["AlternativeFont9"] = 19] = "AlternativeFont9";
            SGRParam2[SGRParam2["Fraktur"] = 20] = "Fraktur";
            SGRParam2[SGRParam2["DoubleUnderlined"] = 21] = "DoubleUnderlined";
            SGRParam2[SGRParam2["NormalIntensity"] = 22] = "NormalIntensity";
            SGRParam2[SGRParam2["NotItalicNotFraktur"] = 23] = "NotItalicNotFraktur";
            SGRParam2[SGRParam2["NotUnderlined"] = 24] = "NotUnderlined";
            SGRParam2[SGRParam2["NotBlinking"] = 25] = "NotBlinking";
            SGRParam2[SGRParam2["ProportionalSpacing"] = 26] = "ProportionalSpacing";
            SGRParam2[SGRParam2["NotReversed"] = 27] = "NotReversed";
            SGRParam2[SGRParam2["Reveal"] = 28] = "Reveal";
            SGRParam2[SGRParam2["NotCrossedOut"] = 29] = "NotCrossedOut";
            SGRParam2[SGRParam2["ForegroundBlack"] = 30] = "ForegroundBlack";
            SGRParam2[SGRParam2["ForegroundRed"] = 31] = "ForegroundRed";
            SGRParam2[SGRParam2["ForegroundGreen"] = 32] = "ForegroundGreen";
            SGRParam2[SGRParam2["ForegroundYellow"] = 33] = "ForegroundYellow";
            SGRParam2[SGRParam2["ForegroundBlue"] = 34] = "ForegroundBlue";
            SGRParam2[SGRParam2["ForegroundMagenta"] = 35] = "ForegroundMagenta";
            SGRParam2[SGRParam2["ForegroundCyan"] = 36] = "ForegroundCyan";
            SGRParam2[SGRParam2["ForegroundWhite"] = 37] = "ForegroundWhite";
            SGRParam2[SGRParam2["SetForeground"] = 38] = "SetForeground";
            SGRParam2[SGRParam2["DefaultForeground"] = 39] = "DefaultForeground";
            SGRParam2[SGRParam2["BackgroundBlack"] = 40] = "BackgroundBlack";
            SGRParam2[SGRParam2["BackgroundRed"] = 41] = "BackgroundRed";
            SGRParam2[SGRParam2["BackgroundGreen"] = 42] = "BackgroundGreen";
            SGRParam2[SGRParam2["BackgroundYellow"] = 43] = "BackgroundYellow";
            SGRParam2[SGRParam2["BackgroundBlue"] = 44] = "BackgroundBlue";
            SGRParam2[SGRParam2["BackgroundMagenta"] = 45] = "BackgroundMagenta";
            SGRParam2[SGRParam2["BackgroundCyan"] = 46] = "BackgroundCyan";
            SGRParam2[SGRParam2["BackgroundWhite"] = 47] = "BackgroundWhite";
            SGRParam2[SGRParam2["SetBackground"] = 48] = "SetBackground";
            SGRParam2[SGRParam2["DefaultBackground"] = 49] = "DefaultBackground";
            SGRParam2[SGRParam2["DisableProportionalSpacing"] = 50] = "DisableProportionalSpacing";
            SGRParam2[SGRParam2["Framed"] = 51] = "Framed";
            SGRParam2[SGRParam2["Encircled"] = 52] = "Encircled";
            SGRParam2[SGRParam2["Overlined"] = 53] = "Overlined";
            SGRParam2[SGRParam2["NotFramedNotEncircled"] = 54] = "NotFramedNotEncircled";
            SGRParam2[SGRParam2["NotOverlined"] = 55] = "NotOverlined";
            SGRParam2[SGRParam2["SetUnderline"] = 58] = "SetUnderline";
            SGRParam2[SGRParam2["DefaultUnderline"] = 59] = "DefaultUnderline";
            SGRParam2[SGRParam2["IdeogramUnderlineOrRightSideLine"] = 60] = "IdeogramUnderlineOrRightSideLine";
            SGRParam2[SGRParam2["IdeogramDoubleUnderlineOrDoubleRightSideLine"] = 61] = "IdeogramDoubleUnderlineOrDoubleRightSideLine";
            SGRParam2[SGRParam2["IdeogramOverlineOrLeftSideLine"] = 62] = "IdeogramOverlineOrLeftSideLine";
            SGRParam2[SGRParam2["IdeogramDoubleOverlineOrDoubleLeftSideLine"] = 63] = "IdeogramDoubleOverlineOrDoubleLeftSideLine";
            SGRParam2[SGRParam2["IdeogramStressMarking"] = 64] = "IdeogramStressMarking";
            SGRParam2[SGRParam2["NoIdeogramAttributes"] = 65] = "NoIdeogramAttributes";
            SGRParam2[SGRParam2["Superscript"] = 73] = "Superscript";
            SGRParam2[SGRParam2["Subscript"] = 74] = "Subscript";
            SGRParam2[SGRParam2["NotSuperscriptNotSubscript"] = 75] = "NotSuperscriptNotSubscript";
            SGRParam2[SGRParam2["ForegroundBrightBlack"] = 90] = "ForegroundBrightBlack";
            SGRParam2[SGRParam2["ForegroundBrightRed"] = 91] = "ForegroundBrightRed";
            SGRParam2[SGRParam2["ForegroundBrightGreen"] = 92] = "ForegroundBrightGreen";
            SGRParam2[SGRParam2["ForegroundBrightYellow"] = 93] = "ForegroundBrightYellow";
            SGRParam2[SGRParam2["ForegroundBrightBlue"] = 94] = "ForegroundBrightBlue";
            SGRParam2[SGRParam2["ForegroundBrightMagenta"] = 95] = "ForegroundBrightMagenta";
            SGRParam2[SGRParam2["ForegroundBrightCyan"] = 96] = "ForegroundBrightCyan";
            SGRParam2[SGRParam2["ForegroundBrightWhite"] = 97] = "ForegroundBrightWhite";
            SGRParam2[SGRParam2["BackgroundBrightBlack"] = 100] = "BackgroundBrightBlack";
            SGRParam2[SGRParam2["BackgroundBrightRed"] = 101] = "BackgroundBrightRed";
            SGRParam2[SGRParam2["BackgroundBrightGreen"] = 102] = "BackgroundBrightGreen";
            SGRParam2[SGRParam2["BackgroundBrightYellow"] = 103] = "BackgroundBrightYellow";
            SGRParam2[SGRParam2["BackgroundBrightBlue"] = 104] = "BackgroundBrightBlue";
            SGRParam2[SGRParam2["BackgroundBrightMagenta"] = 105] = "BackgroundBrightMagenta";
            SGRParam2[SGRParam2["BackgroundBrightCyan"] = 106] = "BackgroundBrightCyan";
            SGRParam2[SGRParam2["BackgroundBrightWhite"] = 107] = "BackgroundBrightWhite";
          })(SGRParam || (SGRParam = {}));
          var SGRParamColor;
          (function(SGRParamColor2) {
            SGRParamColor2[SGRParamColor2["Color256"] = 5] = "Color256";
            SGRParamColor2[SGRParamColor2["ColorRGB"] = 2] = "ColorRGB";
          })(SGRParamColor || (SGRParamColor = {}));
          var SGRParamIndexedColor;
          (function(SGRParamIndexedColor2) {
            SGRParamIndexedColor2[SGRParamIndexedColor2["Black"] = 0] = "Black";
            SGRParamIndexedColor2[SGRParamIndexedColor2["Red"] = 1] = "Red";
            SGRParamIndexedColor2[SGRParamIndexedColor2["Green"] = 2] = "Green";
            SGRParamIndexedColor2[SGRParamIndexedColor2["Yellow"] = 3] = "Yellow";
            SGRParamIndexedColor2[SGRParamIndexedColor2["Blue"] = 4] = "Blue";
            SGRParamIndexedColor2[SGRParamIndexedColor2["Magenta"] = 5] = "Magenta";
            SGRParamIndexedColor2[SGRParamIndexedColor2["Cyan"] = 6] = "Cyan";
            SGRParamIndexedColor2[SGRParamIndexedColor2["White"] = 7] = "White";
            SGRParamIndexedColor2[SGRParamIndexedColor2["BrightBlack"] = 8] = "BrightBlack";
            SGRParamIndexedColor2[SGRParamIndexedColor2["BrightRed"] = 9] = "BrightRed";
            SGRParamIndexedColor2[SGRParamIndexedColor2["BrightGreen"] = 10] = "BrightGreen";
            SGRParamIndexedColor2[SGRParamIndexedColor2["BrightYellow"] = 11] = "BrightYellow";
            SGRParamIndexedColor2[SGRParamIndexedColor2["BrightBlue"] = 12] = "BrightBlue";
            SGRParamIndexedColor2[SGRParamIndexedColor2["BrightMagenta"] = 13] = "BrightMagenta";
            SGRParamIndexedColor2[SGRParamIndexedColor2["BrightCyan"] = 14] = "BrightCyan";
            SGRParamIndexedColor2[SGRParamIndexedColor2["BrightWhite"] = 15] = "BrightWhite";
          })(SGRParamIndexedColor || (SGRParamIndexedColor = {}));
          var ParserState;
          (function(ParserState2) {
            ParserState2[ParserState2["BufferingOutput"] = 0] = "BufferingOutput";
            ParserState2[ParserState2["ControlSequenceStarted"] = 1] = "ControlSequenceStarted";
            ParserState2[ParserState2["ParsingControlSequence"] = 2] = "ParsingControlSequence";
          })(ParserState || (ParserState = {}));
          class SGRState {
            //#region Private Properties.
            /**
             * Gets or sets the styles.
             */
            _styles;
            /**
             * Gets or sets the foreground color.
             */
            _foregroundColor;
            /**
             * Gets or sets the background color.
             */
            _backgroundColor;
            /**
             * Gets or sets the underlined color.
             */
            _underlinedColor;
            /**
             * Gets or sets a value which indicates whether the foreground and background colors are
             * reversed.
             */
            _reversed;
            /**
             * Gets or sets the font.
             */
            _font;
            //#endregion Private Properties.
            //#region Public Methods
            /**
             * Resets the SGRState.
             */
            reset() {
              this._styles = void 0;
              this._foregroundColor = void 0;
              this._backgroundColor = void 0;
              this._underlinedColor = void 0;
              this._reversed = void 0;
              this._font = void 0;
            }
            /**
             * Creates a copy of the SGRState.
             * @returns The copy of the SGRState.
             */
            copy() {
              const copy2 = new SGRState();
              if (this._styles && this._styles.size) {
                const styles2 = /* @__PURE__ */ new Set();
                this._styles.forEach((style2) => styles2.add(style2));
                copy2._styles = styles2;
              }
              copy2._foregroundColor = this._foregroundColor;
              copy2._backgroundColor = this._backgroundColor;
              copy2._underlinedColor = this._underlinedColor;
              copy2._reversed = this._reversed;
              copy2._font = this._font;
              return copy2;
            }
            /**
             * Sets a style.
             * @param style The style to set.
             * @param stylesToDelete The styles to delete.
             */
            setStyle(style2, ...stylesToDelete) {
              if (this._styles) {
                for (const style3 of stylesToDelete) {
                  this._styles.delete(style3);
                }
              } else {
                this._styles = /* @__PURE__ */ new Set();
              }
              this._styles.add(style2);
            }
            /**
             * Deletes styles.
             * @param stylesToDelete The styles to delete.
             */
            deleteStyles(...stylesToDelete) {
              if (this._styles) {
                for (const style2 of stylesToDelete) {
                  this._styles.delete(style2);
                }
                if (!this._styles.size) {
                  this._styles = void 0;
                }
              }
            }
            /**
             * Sets the foreground color.
             * @param color The foreground color.
             */
            setForegroundColor(color) {
              if (!this._reversed) {
                this._foregroundColor = color;
              } else {
                this._backgroundColor = color;
              }
            }
            /**
             * Sets the background color.
             * @param color The background color.
             */
            setBackgroundColor(color) {
              if (!this._reversed) {
                this._backgroundColor = color;
              } else {
                this._foregroundColor = color;
              }
            }
            /**
             * Sets reversed.
             * @param reversed A value which indicates whether the foreground and background colors are
             * reversed.
             */
            setReversed(reversed) {
              if (reversed) {
                if (!this._reversed) {
                  this._reversed = true;
                  this.reverseForegroundAndBackgroundColors();
                }
              } else {
                if (this._reversed) {
                  this._reversed = void 0;
                  this.reverseForegroundAndBackgroundColors();
                }
              }
            }
            /**
             * Sets the font.
             * @param font The font.
             */
            setFont(font) {
              this._font = font;
            }
            /**
             *
             * @param left
             * @param right
             * @returns
             */
            static equivalent(left2, right2) {
              const setReplacer = (_, value2) => value2 instanceof Set ? !value2.size ? void 0 : [...value2] : value2;
              return left2 === right2 || JSON.stringify(left2, setReplacer) === JSON.stringify(right2, setReplacer);
            }
            //#endregion Public Methods
            //#region ANSIFormat Implementation
            /**
             * Gets the styles.
             */
            get styles() {
              return !this._styles ? void 0 : [...this._styles];
            }
            /**
             * Gets the foreground color.
             */
            get foregroundColor() {
              if (this._backgroundColor && !this._foregroundColor) {
                switch (this._backgroundColor) {
                  case ANSIColor.Black:
                  case ANSIColor.BrightBlack:
                  case ANSIColor.Red:
                  case ANSIColor.BrightRed:
                    return ANSIColor.White;
                  case ANSIColor.Green:
                  case ANSIColor.BrightGreen:
                  case ANSIColor.Yellow:
                  case ANSIColor.BrightYellow:
                  case ANSIColor.Blue:
                  case ANSIColor.BrightBlue:
                  case ANSIColor.Magenta:
                  case ANSIColor.BrightMagenta:
                  case ANSIColor.Cyan:
                  case ANSIColor.BrightCyan:
                  case ANSIColor.White:
                  case ANSIColor.BrightWhite:
                    return ANSIColor.Black;
                }
              }
              return this._foregroundColor;
            }
            /**
             * Gets the background color.
             */
            get backgroundColor() {
              return this._backgroundColor;
            }
            /**
             * Gets the underlined color.
             */
            get underlinedColor() {
              return this._underlinedColor;
            }
            /**
             * Gets the font.
             */
            get font() {
              return this._font;
            }
            //#endregion ANSIFormat Implementation
            //#region Private Methods
            /**
             * Reverses the foreground and background colors.
             */
            reverseForegroundAndBackgroundColors() {
              const foregroundColor2 = this._foregroundColor;
              this._foregroundColor = this._backgroundColor;
              this._backgroundColor = foregroundColor2;
            }
          }
          class OutputLine {
            //#region Private Properties
            /**
             * Gets the identifier.
             */
            _id = generateId();
            /**
             * Gets or sets the output runs.
             */
            _outputRuns = [];
            /**
             * Gets or sets the total length.
             */
            _totalLength = 0;
            //#endregion Private Properties
            //#region Public Methods
            /**
             * Clears the entire output line.
             */
            clearEntireLine() {
              if (this._totalLength) {
                this._outputRuns = [new OutputRun2(" ".repeat(this._totalLength))];
              }
            }
            /**
             * Clears to the end of the output line.
             * @param column The column at which to clear from.
             */
            clearToEndOfLine(column2) {
              column2 = Math.max(column2, 0);
              if (column2 >= this._totalLength) {
                return;
              }
              if (column2 === 0) {
                this.clearEntireLine();
                return;
              }
              let leftOffset = 0;
              let leftOutputRun;
              let leftOutputRunIndex = void 0;
              for (let index = 0; index < this._outputRuns.length; index++) {
                const outputRun = this._outputRuns[index];
                if (column2 < leftOffset + outputRun.text.length) {
                  leftOutputRun = outputRun;
                  leftOutputRunIndex = index;
                  break;
                }
                leftOffset += outputRun.text.length;
              }
              if (leftOutputRun === void 0 || leftOutputRunIndex === void 0) {
                return;
              }
              const leftTextLength = column2 - leftOffset;
              const erasureText = " ".repeat(this._totalLength - column2);
              const outputRuns = [];
              if (!leftTextLength) {
                outputRuns.push(new OutputRun2(erasureText));
              } else {
                const leftText = leftOutputRun.text.slice(0, leftTextLength);
                outputRuns.push(new OutputRun2(leftText, leftOutputRun.sgrState));
                outputRuns.push(new OutputRun2(erasureText));
              }
              this.outputRuns.splice(leftOutputRunIndex, this._outputRuns.length - leftOutputRunIndex, ...outputRuns);
            }
            /**
             * Clears to the beginning of the output line.
             * @param column The column at which to clear from.
             */
            clearToBeginningOfLine(column2) {
              column2 = Math.max(column2, 0);
              if (column2 === 0) {
                return;
              }
              if (column2 >= this._totalLength) {
                this.clearEntireLine();
                return;
              }
              let rightOffset = 0;
              let rightOutputRun;
              let rightOutputRunIndex = void 0;
              for (let index = this._outputRuns.length - 1; index >= 0; index--) {
                const outputRun = this._outputRuns[index];
                if (column2 >= rightOffset - outputRun.text.length) {
                  rightOutputRun = outputRun;
                  rightOutputRunIndex = index;
                  break;
                }
                rightOffset -= outputRun.text.length;
              }
              if (rightOutputRun === void 0 || rightOutputRunIndex === void 0) {
                return;
              }
              const rightTextLength = rightOffset - column2;
              const erasureText = " ".repeat(column2);
              const outputRuns = [new OutputRun2(erasureText)];
              if (rightTextLength) {
                const rightOutputRunText = rightOutputRun.text.slice(-rightTextLength);
                outputRuns.push(new OutputRun2(rightOutputRunText, rightOutputRun.sgrState));
              }
              this.outputRuns.splice(0, this._outputRuns.length - rightOutputRunIndex, ...outputRuns);
            }
            /**
             * Inserts text into the output line.
             * @param text The text to insert.
             * @param column The column at which to insert the text.
             * @param sgrState The SGR state.
             */
            insert(text2, column2, sgrState) {
              if (!text2.length) {
                return;
              }
              if (column2 === this._totalLength) {
                this._totalLength += text2.length;
                if (this._outputRuns.length) {
                  const lastOutputRun = this._outputRuns[this._outputRuns.length - 1];
                  if (SGRState.equivalent(lastOutputRun.sgrState, sgrState)) {
                    lastOutputRun.appendText(text2);
                    return;
                  }
                }
                this._outputRuns.push(new OutputRun2(text2, sgrState));
                return;
              }
              if (column2 > this._totalLength) {
                const spacer2 = " ".repeat(column2 - this._totalLength);
                this._totalLength += spacer2.length + text2.length;
                if (!sgrState && this._outputRuns.length) {
                  const lastOutputRun = this._outputRuns[this._outputRuns.length - 1];
                  if (!lastOutputRun.sgrState) {
                    lastOutputRun.appendText(spacer2);
                    lastOutputRun.appendText(text2);
                    return;
                  }
                }
                if (!sgrState) {
                  this._outputRuns.push(new OutputRun2(spacer2 + text2));
                } else {
                  this._outputRuns.push(new OutputRun2(spacer2));
                  this._outputRuns.push(new OutputRun2(text2, sgrState));
                }
              }
              let leftOffset = 0;
              let leftOutputRunIndex = void 0;
              for (let index = 0; index < this._outputRuns.length; index++) {
                const outputRun = this._outputRuns[index];
                if (column2 < leftOffset + outputRun.text.length) {
                  leftOutputRunIndex = index;
                  break;
                }
                leftOffset += outputRun.text.length;
              }
              if (leftOutputRunIndex === void 0) {
                this._outputRuns.push(new OutputRun2(text2, sgrState));
                return;
              }
              if (column2 + text2.length >= this._totalLength) {
                const leftTextLength = column2 - leftOffset;
                const outputRuns2 = [];
                if (!leftTextLength) {
                  outputRuns2.push(new OutputRun2(text2, sgrState));
                } else {
                  const leftOutputRun = this._outputRuns[leftOutputRunIndex];
                  const leftText = leftOutputRun.text.slice(0, leftTextLength);
                  if (SGRState.equivalent(leftOutputRun.sgrState, sgrState)) {
                    outputRuns2.push(new OutputRun2(leftText + text2, sgrState));
                  } else {
                    outputRuns2.push(new OutputRun2(leftText, leftOutputRun.sgrState));
                    outputRuns2.push(new OutputRun2(text2, sgrState));
                  }
                }
                this.outputRuns.splice(leftOutputRunIndex, 1, ...outputRuns2);
                this._totalLength = leftOffset + leftTextLength + text2.length;
                return;
              }
              let rightOffset = this._totalLength;
              let rightOutputRunIndex = void 0;
              for (let index = this._outputRuns.length - 1; index >= 0; index--) {
                const outputRun = this._outputRuns[index];
                if (column2 + text2.length > rightOffset - outputRun.text.length) {
                  rightOutputRunIndex = index;
                  break;
                }
                rightOffset -= outputRun.text.length;
              }
              if (rightOutputRunIndex === void 0) {
                this._outputRuns.push(new OutputRun2(text2, sgrState));
                return;
              }
              const outputRuns = [];
              const leftOutputRunTextLength = column2 - leftOffset;
              if (leftOutputRunTextLength) {
                const leftOutputRun = this._outputRuns[leftOutputRunIndex];
                const leftOutputRunText = leftOutputRun.text.slice(0, leftOutputRunTextLength);
                outputRuns.push(new OutputRun2(leftOutputRunText, leftOutputRun.sgrState));
              }
              outputRuns.push(new OutputRun2(text2, sgrState));
              const rightOutputRunTextLength = rightOffset - (column2 + text2.length);
              if (rightOutputRunTextLength) {
                const rightOutputRun = this._outputRuns[rightOutputRunIndex];
                const rightOutputRunText = rightOutputRun.text.slice(-rightOutputRunTextLength);
                outputRuns.push(new OutputRun2(rightOutputRunText, rightOutputRun.sgrState));
              }
              this._outputRuns.splice(leftOutputRunIndex, rightOutputRunIndex - leftOutputRunIndex + 1, ...outputRuns);
              if (this._outputRuns.length > 1) {
                this._outputRuns = OutputRun2.optimizeOutputRuns(this._outputRuns);
              }
              this._totalLength = this._outputRuns.reduce((totalLength, outputRun) => totalLength + outputRun.text.length, 0);
            }
            //#endregion Public Methods
            //#region ANSIOutputLine Implementation
            /**
             * Gets the identifier.
             */
            get id() {
              return this._id;
            }
            /**
             * Gets the output runs.
             */
            get outputRuns() {
              return this._outputRuns;
            }
          }
          class OutputRun2 {
            //#region Private Properties
            /**
             * Gets the identifier.
             */
            _id = generateId();
            /**
             * Gets the SGR state.
             */
            _sgrState;
            /**
             * Gets or sets the text.
             */
            _text;
            //#endregion Private Properties
            //#region Public Properties
            get sgrState() {
              return this._sgrState;
            }
            //#endregion Public Properties
            //#region Constructor
            /**
             * Constructor.
             * @param text The text.
             * @param sgrState The SGR state.
             */
            constructor(text2, sgrState) {
              this._sgrState = sgrState;
              this._text = text2;
            }
            //#endregion Constructor
            //#region Public Methods
            /**
             * Optimizes a an array of output runs by combining adjacent output runs with equivalent SGR
             * states.
             * @param outputRunsIn The output runs to optimize.
             * @returns The optimized output runs.
             */
            static optimizeOutputRuns(outputRunsIn) {
              const outputRunsOut = [outputRunsIn[0]];
              for (let i2 = 1, o = 0; i2 < outputRunsIn.length; i2++) {
                const outputRun = outputRunsIn[i2];
                if (SGRState.equivalent(outputRunsOut[o].sgrState, outputRun.sgrState)) {
                  outputRunsOut[o]._text += outputRun.text;
                } else {
                  outputRunsOut[++o] = outputRun;
                }
              }
              return outputRunsOut;
            }
            /**
             * Appends text to the end of the output run.
             * @param text The text to append.
             */
            appendText(text2) {
              this._text += text2;
            }
            //#endregion Public Methods
            //#region ANSIOutputRun Implementation
            /**
             * Gets the identifier.
             */
            get id() {
              return this._id;
            }
            /**
             * Gets the format.
             */
            get format() {
              return this._sgrState;
            }
            /**
             * Gets the text.
             */
            get text() {
              return this._text;
            }
          }
          const rangeParam = (value2, defaultValue, minValue) => {
            const param = getParam(value2, defaultValue);
            return Math.max(param, minValue);
          };
          const getParam = (value2, defaultValue) => {
            const param = parseInt(value2);
            return Number.isNaN(param) ? defaultValue : param;
          };
          const twoDigitHex = (value2) => {
            const hex = Math.max(Math.min(255, value2), 0).toString(16);
            return hex.length === 2 ? hex : "0" + hex;
          };
        });
      })(ansiOutput, ansiOutput.exports);
      return ansiOutput.exports;
    }
    var ansiOutputExports = requireAnsiOutput();
    const toolButton$1 = "_toolButton_nu8dt_1";
    const latched = "_latched_nu8dt_13";
    const styles$1N = {
      toolButton: toolButton$1,
      latched
    };
    const ToolButton = reactExports.forwardRef(
      ({ label: label2, classes = "", icon: icon2, className: className2, latched: latched2, ...rest }, ref) => {
        return /* @__PURE__ */ jsxRuntimeExports.jsxs(
          "button",
          {
            ref,
            type: "button",
            className: clsx(
              "btn",
              "btn-tools",
              styles$1N.toolButton,
              classes,
              className2,
              latched2 ? styles$1N.latched : void 0
            ),
            ...rest,
            children: [
              icon2 && /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: `${icon2}` }),
              label2
            ]
          }
        );
      }
    );
    ToolButton.displayName = "ToolButton";
    const ansiDisplayContainer = "_ansiDisplayContainer_sawhg_1";
    const ansiDisplay = "_ansiDisplay_sawhg_1";
    const ansiDisplayRaw = "_ansiDisplayRaw_sawhg_28";
    const ansiDisplayToggle = "_ansiDisplayToggle_sawhg_33";
    const styles$1M = {
      ansiDisplayContainer,
      ansiDisplay,
      ansiDisplayRaw,
      ansiDisplayToggle
    };
    const ANSIDisplay = ({
      output: output2,
      style: style2,
      className: className2
    }) => {
      const [showRaw, setShowRaw] = reactExports.useState(false);
      const ansiOutput2 = new ansiOutputExports.ANSIOutput();
      ansiOutput2.processOutput(output2);
      const getUniformBackgroundColor = () => {
        const backgroundColorCounts = /* @__PURE__ */ new Map();
        let totalLinesWithBackground = 0;
        for (const line2 of ansiOutput2.outputLines) {
          let lineBackgroundColor = void 0;
          for (const run of line2.outputRuns) {
            if (run.format?.backgroundColor) {
              lineBackgroundColor = run.format.backgroundColor;
              break;
            }
          }
          if (lineBackgroundColor) {
            totalLinesWithBackground++;
            backgroundColorCounts.set(
              lineBackgroundColor,
              (backgroundColorCounts.get(lineBackgroundColor) || 0) + 1
            );
          }
        }
        if (totalLinesWithBackground === 0) {
          return void 0;
        }
        const backgroundColorPercentages = /* @__PURE__ */ new Map();
        for (const [color, count] of backgroundColorCounts.entries()) {
          backgroundColorPercentages.set(color, count / totalLinesWithBackground);
        }
        let dominantColor = void 0;
        let maxPercentage = 0;
        for (const [color, percentage] of backgroundColorPercentages.entries()) {
          if (percentage > maxPercentage) {
            maxPercentage = percentage;
            dominantColor = color;
          }
        }
        return maxPercentage > 0.8 ? dominantColor : void 0;
      };
      const uniformBackgroundColor = getUniformBackgroundColor();
      const backgroundStyle = uniformBackgroundColor ? computeForegroundBackgroundColor(kBackground, uniformBackgroundColor) : {};
      let firstOutput = false;
      return /* @__PURE__ */ jsxRuntimeExports.jsxs(
        "div",
        {
          className: clsx(styles$1M.ansiDisplayContainer, className2),
          style: { ...style2 },
          children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              ToolButton,
              {
                className: clsx(styles$1M.ansiDisplayToggle, "text-size-smallest"),
                icon: "bi bi-code-slash",
                label: "",
                latched: showRaw,
                onClick: () => setShowRaw(!showRaw),
                title: showRaw ? "Show rendered output" : "Show raw output"
              }
            ),
            showRaw ? /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: clsx(styles$1M.ansiDisplay, styles$1M.ansiDisplayRaw), children: output2 }) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$1M.ansiDisplay), style: backgroundStyle, children: ansiOutput2.outputLines.map((line2, index) => {
              firstOutput = firstOutput || !!line2.outputRuns.length;
              return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$1M.ansiDisplayLine), children: !line2.outputRuns.length ? firstOutput ? /* @__PURE__ */ jsxRuntimeExports.jsx("br", {}) : null : line2.outputRuns.map((outputRun) => /* @__PURE__ */ jsxRuntimeExports.jsx(OutputRun, { run: outputRun }, outputRun.id)) }, index);
            }) })
          ]
        }
      );
    };
    const kForeground = 0;
    const kBackground = 1;
    const OutputRun = ({ run }) => {
      return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { style: computeCSSProperties(run), children: run.text });
    };
    const computeCSSProperties = (outputRun) => {
      return !outputRun.format ? {} : {
        ...computeStyles$2(outputRun.format.styles || []),
        ...computeForegroundBackgroundColor(
          kForeground,
          outputRun.format.foregroundColor
        ),
        ...computeForegroundBackgroundColor(
          kBackground,
          outputRun.format.backgroundColor
        )
      };
    };
    const computeStyles$2 = (styles2) => {
      let cssProperties = {};
      if (styles2) {
        styles2.forEach((style2) => {
          switch (style2) {
            // Bold.
            case ansiOutputExports.ANSIStyle.Bold:
              cssProperties = { ...cssProperties, ...{ fontWeight: "bold" } };
              break;
            // Dim.
            case ansiOutputExports.ANSIStyle.Dim:
              cssProperties = { ...cssProperties, ...{ fontWeight: "lighter" } };
              break;
            // Italic.
            case ansiOutputExports.ANSIStyle.Italic:
              cssProperties = { ...cssProperties, ...{ fontStyle: "italic" } };
              break;
            // Underlined.
            case ansiOutputExports.ANSIStyle.Underlined:
              cssProperties = {
                ...cssProperties,
                ...{
                  textDecorationLine: "underline",
                  textDecorationStyle: "solid"
                }
              };
              break;
            // Slow blink.
            case ansiOutputExports.ANSIStyle.SlowBlink:
              cssProperties = {
                ...cssProperties,
                ...{ animation: "ansi-display-run-blink 1s linear infinite" }
              };
              break;
            // Rapid blink.
            case ansiOutputExports.ANSIStyle.RapidBlink:
              cssProperties = {
                ...cssProperties,
                ...{ animation: "ansi-display-run-blink 0.5s linear infinite" }
              };
              break;
            // Hidden.
            case ansiOutputExports.ANSIStyle.Hidden:
              cssProperties = { ...cssProperties, ...{ visibility: "hidden" } };
              break;
            // CrossedOut.
            case ansiOutputExports.ANSIStyle.CrossedOut:
              cssProperties = {
                ...cssProperties,
                ...{
                  textDecorationLine: "line-through",
                  textDecorationStyle: "solid"
                }
              };
              break;
            // TODO Fraktur
            // DoubleUnderlined.
            case ansiOutputExports.ANSIStyle.DoubleUnderlined:
              cssProperties = {
                ...cssProperties,
                ...{
                  textDecorationLine: "underline",
                  textDecorationStyle: "double"
                }
              };
              break;
          }
        });
      }
      return cssProperties;
    };
    const computeForegroundBackgroundColor = (colorType, color) => {
      switch (color) {
        // Undefined.
        case void 0:
          return {};
        // One of the standard colors.
        case ansiOutputExports.ANSIColor.Black:
        case ansiOutputExports.ANSIColor.Red:
        case ansiOutputExports.ANSIColor.Green:
        case ansiOutputExports.ANSIColor.Yellow:
        case ansiOutputExports.ANSIColor.Blue:
        case ansiOutputExports.ANSIColor.Magenta:
        case ansiOutputExports.ANSIColor.Cyan:
        case ansiOutputExports.ANSIColor.White:
        case ansiOutputExports.ANSIColor.BrightBlack:
        case ansiOutputExports.ANSIColor.BrightRed:
        case ansiOutputExports.ANSIColor.BrightGreen:
        case ansiOutputExports.ANSIColor.BrightYellow:
        case ansiOutputExports.ANSIColor.BrightBlue:
        case ansiOutputExports.ANSIColor.BrightMagenta:
        case ansiOutputExports.ANSIColor.BrightCyan:
        case ansiOutputExports.ANSIColor.BrightWhite:
          if (colorType === kForeground) {
            return { color: `var(--${color})` };
          } else {
            return { background: `var(--${color})` };
          }
        // TODO@softwarenerd - This isn't hooked up.
        default:
          if (colorType === kForeground) {
            return { color };
          } else {
            return { background: color };
          }
      }
    };
    const JSONPanel = ({
      id,
      json,
      data,
      simple = false,
      style: style2,
      className: className2
    }) => {
      const sourceCode = reactExports.useMemo(() => {
        return json || JSON.stringify(resolveBase64(data), void 0, 2);
      }, [json, data]);
      const sourceCodeRef = reactExports.useRef(null);
      usePrismHighlight(sourceCodeRef, sourceCode.length);
      return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: sourceCodeRef, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
        "pre",
        {
          className: clsx("json-panel", simple ? "simple" : "", className2),
          style: style2,
          children: /* @__PURE__ */ jsxRuntimeExports.jsx("code", { id, className: clsx("source-code", "language-javascript"), children: sourceCode })
        }
      ) });
    };
    const resolveBase64 = (value2) => {
      const prefix = "data:image";
      if (Array.isArray(value2)) {
        return value2.map((v) => resolveBase64(v));
      }
      if (value2 && typeof value2 === "object") {
        const resolvedObject = {};
        for (const key2 of Object.keys(value2)) {
          resolvedObject[key2] = resolveBase64(value2[key2]);
        }
        return resolvedObject;
      }
      if (typeof value2 === "string") {
        let resolvedValue = value2;
        if (resolvedValue.startsWith(prefix)) {
          resolvedValue = "[base64 image]";
        }
        return resolvedValue;
      }
      return value2;
    };
    const visible = "_visible_tm52u_1";
    const hidden$2 = "_hidden_tm52u_5";
    const pills = "_pills_tm52u_9";
    const pill = "_pill_tm52u_9";
    const styles$1L = {
      visible,
      hidden: hidden$2,
      pills,
      pill
    };
    const NavPills = ({ id, children: children2 }) => {
      const defaultNav = children2 ? children2[0].props["title"] : "";
      const [activeItem, setActiveItem] = useProperty(id, "active", {
        defaultValue: defaultNav
      });
      if (!activeItem || !children2) {
        return void 0;
      }
      const navPills = children2.map((nav2, idx) => {
        const title2 = typeof nav2 === "object" ? nav2["props"]?.title || `Tab ${idx}` : `Tab ${idx}`;
        return /* @__PURE__ */ jsxRuntimeExports.jsx(
          NavPill,
          {
            title: title2,
            activeItem,
            setActiveItem
          },
          `nav-pill-contents-${idx}`
        );
      });
      const navBodies = children2.map((child, idx) => {
        return /* @__PURE__ */ jsxRuntimeExports.jsx(
          "div",
          {
            className: child["props"]?.title === activeItem ? styles$1L.visible : styles$1L.hidden,
            children: child
          },
          `nav-pill-container-${idx}`
        );
      });
      return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          "ul",
          {
            className: clsx("nav", "nav-pills", styles$1L.pills),
            role: "tablist",
            "aria-orientation": "horizontal",
            children: navPills
          }
        ),
        navBodies
      ] });
    };
    const NavPill = ({
      title: title2,
      activeItem,
      setActiveItem,
      children: children2
    }) => {
      const active = activeItem === title2;
      const handleClick = reactExports.useCallback(
        (e) => {
          const target2 = e.currentTarget.dataset.target;
          if (target2) {
            setActiveItem(target2);
          }
        },
        [setActiveItem]
      );
      return /* @__PURE__ */ jsxRuntimeExports.jsxs("li", { className: "nav-item", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          "button",
          {
            type: "button",
            role: "tab",
            "aria-selected": active,
            className: clsx(
              "nav-link",
              "text-style-label",
              active ? "active " : "",
              styles$1L.pill
            ),
            "data-target": title2,
            onClick: handleClick,
            children: title2
          }
        ),
        children2
      ] });
    };
    const Buckets = {
      first: 0,
      intermediate: 10,
      final: 1e3
    };
    const copyButton = "_copyButton_1goi8_1";
    const styles$1K = {
      copyButton
    };
    const CopyButton = ({
      icon: icon2 = ApplicationIcons.copy,
      value: value2,
      onCopySuccess,
      onCopyError,
      className: className2 = "",
      ariaLabel = "Copy to clipboard"
    }) => {
      const [isCopied, setIsCopied] = reactExports.useState(false);
      const handleClick = async () => {
        try {
          await navigator.clipboard.writeText(value2);
          setIsCopied(true);
          onCopySuccess?.();
          setTimeout(() => {
            setIsCopied(false);
          }, 1250);
        } catch (error2) {
          onCopyError?.(
            error2 instanceof Error ? error2 : new Error("Failed to copy")
          );
        }
      };
      return /* @__PURE__ */ jsxRuntimeExports.jsx(
        "button",
        {
          type: "button",
          className: clsx("copy-button", styles$1K.copyButton, className2),
          onClick: handleClick,
          "aria-label": ariaLabel,
          disabled: isCopied,
          children: /* @__PURE__ */ jsxRuntimeExports.jsx(
            "i",
            {
              className: isCopied ? `${ApplicationIcons.confirm} primary` : icon2,
              "aria-hidden": "true"
            }
          )
        }
      );
    };
    const useResizeObserver = (callback) => {
      const elementRef = reactExports.useRef(null);
      const observerRef = reactExports.useRef(null);
      reactExports.useEffect(() => {
        const element = elementRef.current;
        if (!element) return;
        observerRef.current = new ResizeObserver((entries) => {
          if (entries[0]) {
            callback(entries[0]);
          }
        });
        observerRef.current.observe(element);
        return () => {
          if (observerRef.current) {
            observerRef.current.disconnect();
          }
        };
      }, [callback]);
      return elementRef;
    };
    const expandablePanel = "_expandablePanel_1cl3h_1";
    const expandableBordered = "_expandableBordered_1cl3h_5";
    const expandableCollapsed = "_expandableCollapsed_1cl3h_18";
    const moreToggle = "_moreToggle_1cl3h_22";
    const bordered$1 = "_bordered_1cl3h_32";
    const moreToggleButton = "_moreToggleButton_1cl3h_36";
    const separator$6 = "_separator_1cl3h_42";
    const inlineRight = "_inlineRight_1cl3h_48";
    const blockLeft = "_blockLeft_1cl3h_54";
    const styles$1J = {
      expandablePanel,
      expandableBordered,
      expandableCollapsed,
      moreToggle,
      bordered: bordered$1,
      moreToggleButton,
      separator: separator$6,
      inlineRight,
      blockLeft
    };
    const ExpandablePanel = reactExports.memo(
      ({
        id,
        collapse,
        border,
        lines = 15,
        children: children2,
        className: className2,
        togglePosition: layout = "inline-right"
      }) => {
        const [collapsed2, setCollapsed] = useCollapsedState(id, collapse);
        const [showToggle, setShowToggle] = reactExports.useState(false);
        const baseFontSizeRef = reactExports.useRef(0);
        const checkOverflow = reactExports.useCallback(
          (entry) => {
            const element = entry.target;
            if (baseFontSizeRef.current === 0) {
              const computedStyle = window.getComputedStyle(element);
              const rootFontSize = parseFloat(computedStyle.fontSize);
              baseFontSizeRef.current = rootFontSize;
            }
            const maxCollapsedHeight = baseFontSizeRef.current * lines;
            const contentHeight = element.scrollHeight;
            setShowToggle(contentHeight > maxCollapsedHeight);
          },
          [lines]
        );
        const contentRef = useResizeObserver(checkOverflow);
        const baseStyles = {
          overflow: "hidden",
          ...collapsed2 && {
            maxHeight: `${lines}rem`
          }
        };
        return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(className2), children: [
          /* @__PURE__ */ jsxRuntimeExports.jsxs(
            "div",
            {
              style: baseStyles,
              ref: contentRef,
              "data-expandable-panel": "true",
              className: clsx(
                styles$1J.expandablePanel,
                collapsed2 ? styles$1J.expandableCollapsed : void 0,
                border ? styles$1J.expandableBordered : void 0,
                showToggle ? styles$1J.padBottom : void 0,
                className2
              ),
              children: [
                children2,
                showToggle && layout == "inline-right" && /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
                  MoreToggle,
                  {
                    collapsed: collapsed2,
                    setCollapsed,
                    border: !border,
                    position: "inline-right"
                  }
                ) })
              ]
            }
          ),
          showToggle && layout === "block-left" && /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
            MoreToggle,
            {
              collapsed: collapsed2,
              setCollapsed,
              border: !border,
              position: "block-left"
            }
          ) }),
          showToggle && layout == "inline-right" && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$1J.separator) })
        ] });
      }
    );
    const MoreToggle = ({
      collapsed: collapsed2,
      border,
      setCollapsed,
      style: style2,
      position
    }) => {
      const text2 = collapsed2 ? "more" : "less";
      const handleClick = reactExports.useCallback(() => {
        setCollapsed(!collapsed2);
      }, [setCollapsed, collapsed2]);
      return /* @__PURE__ */ jsxRuntimeExports.jsx(
        "div",
        {
          className: clsx(
            styles$1J.moreToggle,
            border ? styles$1J.bordered : void 0,
            position === "inline-right" ? styles$1J.inlineRight : styles$1J.blockLeft
          ),
          style: style2,
          children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
            "button",
            {
              className: clsx("btn", styles$1J.moreToggleButton, "text-size-smallest"),
              onClick: handleClick,
              children: [
                text2,
                "..."
              ]
            }
          )
        }
      );
    };
    const LabeledValue = ({
      layout = "column",
      style: style2,
      label: label2,
      children: children2,
      valueStyle,
      className: className2
    }) => {
      return /* @__PURE__ */ jsxRuntimeExports.jsxs(
        "div",
        {
          className: clsx(
            "labeled-value",
            layout === "column" ? "column" : "row",
            className2
          ),
          style: {
            ...style2
          },
          children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              "div",
              {
                className: "labeled-value-label text-style-label text-style-secondary",
                children: label2
              }
            ),
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "labeled-value-value", style: { ...valueStyle }, children: children2 })
          ]
        }
      );
    };
    const ve = 0, At = 1, Jt = 2, zn = 4;
    function un(t2) {
      return () => t2;
    }
    function mo$3(t2) {
      t2();
    }
    function se(t2, e) {
      return (n) => t2(e(n));
    }
    function an(t2, e) {
      return () => t2(e);
    }
    function po(t2, e) {
      return (n) => t2(e, n);
    }
    function Ae(t2) {
      return t2 !== void 0;
    }
    function ho(...t2) {
      return () => {
        t2.map(mo$3);
      };
    }
    function Qt() {
    }
    function ye(t2, e) {
      return e(t2), t2;
    }
    function go(t2, e) {
      return e(t2);
    }
    function tt(...t2) {
      return t2;
    }
    function Y(t2, e) {
      return t2(At, e);
    }
    function D(t2, e) {
      t2(ve, e);
    }
    function We(t2) {
      t2(Jt);
    }
    function rt(t2) {
      return t2(zn);
    }
    function F(t2, e) {
      return Y(t2, po(e, ve));
    }
    function Et(t2, e) {
      const n = t2(At, (o) => {
        n(), e(o);
      });
      return n;
    }
    function dn(t2) {
      let e, n;
      return (o) => (r2) => {
        e = r2, n && clearTimeout(n), n = setTimeout(() => {
          o(e);
        }, t2);
      };
    }
    function On(t2, e) {
      return t2 === e;
    }
    function J(t2 = On) {
      let e;
      return (n) => (o) => {
        t2(e, o) || (e = o, n(o));
      };
    }
    function P$1(t2) {
      return (e) => (n) => {
        t2(n) && e(n);
      };
    }
    function k(t2) {
      return (e) => se(e, t2);
    }
    function Ft(t2) {
      return (e) => () => {
        e(t2);
      };
    }
    function x$1(t2, ...e) {
      const n = Io(...e);
      return (o, r2) => {
        switch (o) {
          case Jt:
            We(t2);
            return;
          case At:
            return Y(t2, n(r2));
        }
      };
    }
    function Lt$1(t2, e) {
      return (n) => (o) => {
        n(e = t2(e, o));
      };
    }
    function Kt(t2) {
      return (e) => (n) => {
        t2 > 0 ? t2-- : e(n);
      };
    }
    function Gt$1(t2) {
      let e = null, n;
      return (o) => (r2) => {
        e = r2, !n && (n = setTimeout(() => {
          n = void 0, o(e);
        }, t2));
      };
    }
    function $(...t2) {
      const e = new Array(t2.length);
      let n = 0, o = null;
      const r2 = Math.pow(2, t2.length) - 1;
      return t2.forEach((s, i2) => {
        const l = Math.pow(2, i2);
        Y(s, (c2) => {
          const d = n;
          n = n | l, e[i2] = c2, d !== r2 && n === r2 && o && (o(), o = null);
        });
      }), (s) => (i2) => {
        const l = () => {
          s([i2].concat(e));
        };
        n === r2 ? l() : o = l;
      };
    }
    function Io(...t2) {
      return (e) => t2.reduceRight(go, e);
    }
    function xo(t2) {
      let e, n;
      const o = () => e == null ? void 0 : e();
      return function(r2, s) {
        switch (r2) {
          case At:
            return s ? n === s ? void 0 : (o(), n = s, e = Y(t2, s), e) : (o(), Qt);
          case Jt:
            o(), n = null;
            return;
        }
      };
    }
    function C$1(t2) {
      let e = t2;
      const n = U();
      return (o, r2) => {
        switch (o) {
          case ve:
            e = r2;
            break;
          case At: {
            r2(e);
            break;
          }
          case zn:
            return e;
        }
        return n(o, r2);
      };
    }
    function ht(t2, e) {
      return ye(C$1(e), (n) => F(t2, n));
    }
    function U() {
      const t2 = [];
      return (e, n) => {
        switch (e) {
          case ve:
            t2.slice().forEach((o) => {
              o(n);
            });
            return;
          case Jt:
            t2.splice(0, t2.length);
            return;
          case At:
            return t2.push(n), () => {
              const o = t2.indexOf(n);
              o > -1 && t2.splice(o, 1);
            };
        }
      };
    }
    function bt(t2) {
      return ye(U(), (e) => F(t2, e));
    }
    function K(t2, e = [], { singleton: n } = { singleton: true }) {
      return {
        constructor: t2,
        dependencies: e,
        id: So(),
        singleton: n
      };
    }
    const So = () => Symbol();
    function To(t2) {
      const e = /* @__PURE__ */ new Map(), n = ({ constructor: o, dependencies: r2, id: s, singleton: i2 }) => {
        if (i2 && e.has(s))
          return e.get(s);
        const l = o(r2.map((c2) => n(c2)));
        return i2 && e.set(s, l), l;
      };
      return n(t2);
    }
    function ut(...t2) {
      const e = U(), n = new Array(t2.length);
      let o = 0;
      const r2 = Math.pow(2, t2.length) - 1;
      return t2.forEach((s, i2) => {
        const l = Math.pow(2, i2);
        Y(s, (c2) => {
          n[i2] = c2, o = o | l, o === r2 && D(e, n);
        });
      }), function(s, i2) {
        switch (s) {
          case Jt: {
            We(e);
            return;
          }
          case At:
            return o === r2 && i2(n), Y(e, i2);
        }
      };
    }
    function V(t2, e = On) {
      return x$1(t2, J(e));
    }
    function Fe(...t2) {
      return function(e, n) {
        switch (e) {
          case Jt:
            return;
          case At:
            return ho(...t2.map((o) => Y(o, n)));
        }
      };
    }
    var Ct = /* @__PURE__ */ ((t2) => (t2[t2.DEBUG = 0] = "DEBUG", t2[t2.INFO = 1] = "INFO", t2[t2.WARN = 2] = "WARN", t2[t2.ERROR = 3] = "ERROR", t2))(Ct || {});
    const Co = {
      0: "debug",
      3: "error",
      1: "log",
      2: "warn"
    }, wo = () => typeof globalThis > "u" ? window : globalThis, Wt = K(
      () => {
        const t2 = C$1(
          3
          /* ERROR */
        );
        return {
          log: C$1((n, o, r2 = 1) => {
            var i2;
            const s = (i2 = wo().VIRTUOSO_LOG_LEVEL) != null ? i2 : rt(t2);
            r2 >= s && console[Co[r2]](
              "%creact-virtuoso: %c%s %o",
              "color: #0253b3; font-weight: bold",
              "color: initial",
              n,
              o
            );
          }),
          logLevel: t2
        };
      },
      [],
      { singleton: true }
    );
    function Vt$1(t2, e, n) {
      return _e(t2, e, n).callbackRef;
    }
    function _e(t2, e, n) {
      const o = React20.useRef(null);
      let r2 = (i2) => {
      };
      const s = React20.useMemo(() => typeof ResizeObserver < "u" ? new ResizeObserver((i2) => {
        const l = () => {
          const c2 = i2[0].target;
          c2.offsetParent !== null && t2(c2);
        };
        n ? l() : requestAnimationFrame(l);
      }) : null, [t2, n]);
      return r2 = (i2) => {
        i2 && e ? (s == null || s.observe(i2), o.current = i2) : (o.current && (s == null || s.unobserve(o.current)), o.current = null);
      }, { callbackRef: r2, ref: o };
    }
    function Fn(t2, e, n, o, r2, s, i2, l, c2) {
      const d = React20.useCallback(
        (m) => {
          const S = vo(m.children, e, l ? "offsetWidth" : "offsetHeight", r2);
          let h = m.parentElement;
          for (; !h.dataset.virtuosoScroller; )
            h = h.parentElement;
          const T = h.lastElementChild.dataset.viewportType === "window";
          let w;
          T && (w = h.ownerDocument.defaultView);
          const R = i2 ? l ? i2.scrollLeft : i2.scrollTop : T ? l ? w.scrollX || w.document.documentElement.scrollLeft : w.scrollY || w.document.documentElement.scrollTop : l ? h.scrollLeft : h.scrollTop, g = i2 ? l ? i2.scrollWidth : i2.scrollHeight : T ? l ? w.document.documentElement.scrollWidth : w.document.documentElement.scrollHeight : l ? h.scrollWidth : h.scrollHeight, f = i2 ? l ? i2.offsetWidth : i2.offsetHeight : T ? l ? w.innerWidth : w.innerHeight : l ? h.offsetWidth : h.offsetHeight;
          o({
            scrollHeight: g,
            scrollTop: Math.max(R, 0),
            viewportHeight: f
          }), s == null || s(
            l ? fn("column-gap", getComputedStyle(m).columnGap, r2) : fn("row-gap", getComputedStyle(m).rowGap, r2)
          ), S !== null && t2(S);
        },
        [t2, e, r2, s, i2, o, l]
      );
      return _e(d, n, c2);
    }
    function vo(t2, e, n, o) {
      const r2 = t2.length;
      if (r2 === 0)
        return null;
      const s = [];
      for (let i2 = 0; i2 < r2; i2++) {
        const l = t2.item(i2);
        if (l.dataset.index === void 0)
          continue;
        const c2 = parseInt(l.dataset.index), d = parseFloat(l.dataset.knownSize), m = e(l, n);
        if (m === 0 && o("Zero-sized element, this should not happen", { child: l }, Ct.ERROR), m === d)
          continue;
        const S = s[s.length - 1];
        s.length === 0 || S.size !== m || S.endIndex !== c2 - 1 ? s.push({ endIndex: c2, size: m, startIndex: c2 }) : s[s.length - 1].endIndex++;
      }
      return s;
    }
    function fn(t2, e, n) {
      return e !== "normal" && !(e != null && e.endsWith("px")) && n(`${t2} was not resolved to pixel value correctly`, e, Ct.WARN), e === "normal" ? 0 : parseInt(e != null ? e : "0", 10);
    }
    function Ne(t2, e, n) {
      const o = React20.useRef(null), r2 = React20.useCallback(
        (c2) => {
          if (!(c2 != null && c2.offsetParent))
            return;
          const d = c2.getBoundingClientRect(), m = d.width;
          let S, h;
          if (e) {
            const T = e.getBoundingClientRect(), w = d.top - T.top;
            h = T.height - Math.max(0, w), S = w + e.scrollTop;
          } else {
            const T = i2.current.ownerDocument.defaultView;
            h = T.innerHeight - Math.max(0, d.top), S = d.top + T.scrollY;
          }
          o.current = {
            offsetTop: S,
            visibleHeight: h,
            visibleWidth: m
          }, t2(o.current);
        },
        // eslint-disable-next-line react-hooks/exhaustive-deps
        [t2, e]
      ), { callbackRef: s, ref: i2 } = _e(r2, true, n), l = React20.useCallback(() => {
        r2(i2.current);
      }, [r2, i2]);
      return React20.useEffect(() => {
        var c2;
        if (e) {
          e.addEventListener("scroll", l);
          const d = new ResizeObserver(() => {
            requestAnimationFrame(l);
          });
          return d.observe(e), () => {
            e.removeEventListener("scroll", l), d.unobserve(e);
          };
        } else {
          const d = (c2 = i2.current) == null ? void 0 : c2.ownerDocument.defaultView;
          return d == null || d.addEventListener("scroll", l), d == null || d.addEventListener("resize", l), () => {
            d == null || d.removeEventListener("scroll", l), d == null || d.removeEventListener("resize", l);
          };
        }
      }, [l, e, i2]), s;
    }
    const It = K(
      () => {
        const t2 = U(), e = U(), n = C$1(0), o = U(), r2 = C$1(0), s = U(), i2 = U(), l = C$1(0), c2 = C$1(0), d = C$1(0), m = C$1(0), S = U(), h = U(), T = C$1(false), w = C$1(false), R = C$1(false);
        return F(
          x$1(
            t2,
            k(({ scrollTop: g }) => g)
          ),
          e
        ), F(
          x$1(
            t2,
            k(({ scrollHeight: g }) => g)
          ),
          i2
        ), F(e, r2), {
          deviation: n,
          fixedFooterHeight: d,
          fixedHeaderHeight: c2,
          footerHeight: m,
          headerHeight: l,
          horizontalDirection: w,
          scrollBy: h,
          // input
          scrollContainerState: t2,
          scrollHeight: i2,
          scrollingInProgress: T,
          // signals
          scrollTo: S,
          scrollTop: e,
          skipAnimationFrameInResizeObserver: R,
          smoothScrollTargetReached: o,
          // state
          statefulScrollTop: r2,
          viewportHeight: s
        };
      },
      [],
      { singleton: true }
    ), ie$2 = { lvl: 0 };
    function Ln(t2, e) {
      const n = t2.length;
      if (n === 0)
        return [];
      let { index: o, value: r2 } = e(t2[0]);
      const s = [];
      for (let i2 = 1; i2 < n; i2++) {
        const { index: l, value: c2 } = e(t2[i2]);
        s.push({ end: l - 1, start: o, value: r2 }), o = l, r2 = c2;
      }
      return s.push({ end: 1 / 0, start: o, value: r2 }), s;
    }
    function X(t2) {
      return t2 === ie$2;
    }
    function le$1(t2, e) {
      if (!X(t2))
        return e === t2.k ? t2.v : e < t2.k ? le$1(t2.l, e) : le$1(t2.r, e);
    }
    function kt(t2, e, n = "k") {
      if (X(t2))
        return [-1 / 0, void 0];
      if (Number(t2[n]) === e)
        return [t2.k, t2.v];
      if (Number(t2[n]) < e) {
        const o = kt(t2.r, e, n);
        return o[0] === -1 / 0 ? [t2.k, t2.v] : o;
      }
      return kt(t2.l, e, n);
    }
    function yt(t2, e, n) {
      return X(t2) ? Gn(e, n, 1) : e === t2.k ? dt(t2, { k: e, v: n }) : e < t2.k ? mn$3(dt(t2, { l: yt(t2.l, e, n) })) : mn$3(dt(t2, { r: yt(t2.r, e, n) }));
    }
    function Zt() {
      return ie$2;
    }
    function Xt(t2, e, n) {
      if (X(t2))
        return [];
      const o = kt(t2, e)[0];
      return yo(Ve(t2, o, n));
    }
    function Le(t2, e) {
      if (X(t2)) return ie$2;
      const { k: n, l: o, r: r2 } = t2;
      if (e === n) {
        if (X(o))
          return r2;
        if (X(r2))
          return o;
        {
          const [s, i2] = Pn(o);
          return Se(dt(t2, { k: s, l: Vn(o), v: i2 }));
        }
      } else return e < n ? Se(dt(t2, { l: Le(o, e) })) : Se(dt(t2, { r: Le(r2, e) }));
    }
    function Dt(t2) {
      return X(t2) ? [] : [...Dt(t2.l), { k: t2.k, v: t2.v }, ...Dt(t2.r)];
    }
    function Ve(t2, e, n) {
      if (X(t2))
        return [];
      const { k: o, l: r2, r: s, v: i2 } = t2;
      let l = [];
      return o > e && (l = l.concat(Ve(r2, e, n))), o >= e && o <= n && l.push({ k: o, v: i2 }), o <= n && (l = l.concat(Ve(s, e, n))), l;
    }
    function Se(t2) {
      const { l: e, lvl: n, r: o } = t2;
      if (o.lvl >= n - 1 && e.lvl >= n - 1)
        return t2;
      if (n > o.lvl + 1) {
        if (Ee(e))
          return Mn(dt(t2, { lvl: n - 1 }));
        if (!X(e) && !X(e.r))
          return dt(e.r, {
            l: dt(e, { r: e.r.l }),
            lvl: n,
            r: dt(t2, {
              l: e.r.r,
              lvl: n - 1
            })
          });
        throw new Error("Unexpected empty nodes");
      } else {
        if (Ee(t2))
          return Pe(dt(t2, { lvl: n - 1 }));
        if (!X(o) && !X(o.l)) {
          const r2 = o.l, s = Ee(r2) ? o.lvl - 1 : o.lvl;
          return dt(r2, {
            l: dt(t2, {
              lvl: n - 1,
              r: r2.l
            }),
            lvl: r2.lvl + 1,
            r: Pe(dt(o, { l: r2.r, lvl: s }))
          });
        } else
          throw new Error("Unexpected empty nodes");
      }
    }
    function dt(t2, e) {
      return Gn(
        e.k !== void 0 ? e.k : t2.k,
        e.v !== void 0 ? e.v : t2.v,
        e.lvl !== void 0 ? e.lvl : t2.lvl,
        e.l !== void 0 ? e.l : t2.l,
        e.r !== void 0 ? e.r : t2.r
      );
    }
    function Vn(t2) {
      return X(t2.r) ? t2.l : Se(dt(t2, { r: Vn(t2.r) }));
    }
    function Ee(t2) {
      return X(t2) || t2.lvl > t2.r.lvl;
    }
    function Pn(t2) {
      return X(t2.r) ? [t2.k, t2.v] : Pn(t2.r);
    }
    function Gn(t2, e, n, o = ie$2, r2 = ie$2) {
      return { k: t2, l: o, lvl: n, r: r2, v: e };
    }
    function mn$3(t2) {
      return Pe(Mn(t2));
    }
    function Mn(t2) {
      const { l: e } = t2;
      return !X(e) && e.lvl === t2.lvl ? dt(e, { r: dt(t2, { l: e.r }) }) : t2;
    }
    function Pe(t2) {
      const { lvl: e, r: n } = t2;
      return !X(n) && !X(n.r) && n.lvl === e && n.r.lvl === e ? dt(n, { l: dt(t2, { r: n.l }), lvl: e + 1 }) : t2;
    }
    function yo(t2) {
      return Ln(t2, ({ k: e, v: n }) => ({ index: e, value: n }));
    }
    function An(t2, e) {
      return !!(t2 && t2.startIndex === e.startIndex && t2.endIndex === e.endIndex);
    }
    function ce(t2, e) {
      return !!(t2 && t2[0] === e[0] && t2[1] === e[1]);
    }
    const De = K(
      () => ({ recalcInProgress: C$1(false) }),
      [],
      { singleton: true }
    );
    function Wn(t2, e, n) {
      return t2[Ce(t2, e, n)];
    }
    function Ce(t2, e, n, o = 0) {
      let r2 = t2.length - 1;
      for (; o <= r2; ) {
        const s = Math.floor((o + r2) / 2), i2 = t2[s], l = n(i2, e);
        if (l === 0)
          return s;
        if (l === -1) {
          if (r2 - o < 2)
            return s - 1;
          r2 = s - 1;
        } else {
          if (r2 === o)
            return s;
          o = s + 1;
        }
      }
      throw new Error(`Failed binary finding record in array - ${t2.join(",")}, searched for ${e}`);
    }
    function bo(t2, e, n, o) {
      const r2 = Ce(t2, e, o), s = Ce(t2, n, o, r2);
      return t2.slice(r2, s + 1);
    }
    function zt(t2, e) {
      return Math.round(t2.getBoundingClientRect()[e]);
    }
    function be(t2) {
      return !X(t2.groupOffsetTree);
    }
    function $e({ index: t2 }, e) {
      return e === t2 ? 0 : e < t2 ? -1 : 1;
    }
    function Ro() {
      return {
        groupIndices: [],
        groupOffsetTree: Zt(),
        lastIndex: 0,
        lastOffset: 0,
        lastSize: 0,
        offsetTree: [],
        sizeTree: Zt()
      };
    }
    function Ho(t2, e) {
      let n = X(t2) ? 0 : 1 / 0;
      for (const o of e) {
        const { endIndex: r2, size: s, startIndex: i2 } = o;
        if (n = Math.min(n, i2), X(t2)) {
          t2 = yt(t2, 0, s);
          continue;
        }
        const l = Xt(t2, i2 - 1, r2 + 1);
        if (l.some(Lo(o)))
          continue;
        let c2 = false, d = false;
        for (const { end: m, start: S, value: h } of l)
          c2 ? (r2 >= S || s === h) && (t2 = Le(t2, S)) : (d = h !== s, c2 = true), m > r2 && r2 >= S && h !== s && (t2 = yt(t2, r2 + 1, h));
        d && (t2 = yt(t2, i2, s));
      }
      return [t2, n];
    }
    function Eo(t2) {
      return typeof t2.groupIndex < "u";
    }
    function Bo({ offset: t2 }, e) {
      return e === t2 ? 0 : e < t2 ? -1 : 1;
    }
    function ue(t2, e, n) {
      if (e.length === 0)
        return 0;
      const { index: o, offset: r2, size: s } = Wn(e, t2, $e), i2 = t2 - o, l = s * i2 + (i2 - 1) * n + r2;
      return l > 0 ? l + n : l;
    }
    function _n(t2, e) {
      if (!be(e))
        return t2;
      let n = 0;
      for (; e.groupIndices[n] <= t2 + n; )
        n++;
      return t2 + n;
    }
    function Nn(t2, e, n) {
      if (Eo(t2))
        return e.groupIndices[t2.groupIndex] + 1;
      {
        const o = t2.index === "LAST" ? n : t2.index;
        let r2 = _n(o, e);
        return r2 = Math.max(0, r2, Math.min(n, r2)), r2;
      }
    }
    function ko(t2, e, n, o = 0) {
      return o > 0 && (e = Math.max(e, Wn(t2, o, $e).offset)), Ln(bo(t2, e, n, Bo), Fo);
    }
    function zo(t2, [e, n, o, r2]) {
      e.length > 0 && o("received item sizes", e, Ct.DEBUG);
      const s = t2.sizeTree;
      let i2 = s, l = 0;
      if (n.length > 0 && X(s) && e.length === 2) {
        const h = e[0].size, T = e[1].size;
        i2 = n.reduce((w, R) => yt(yt(w, R, h), R + 1, T), i2);
      } else
        [i2, l] = Ho(i2, e);
      if (i2 === s)
        return t2;
      const { lastIndex: c2, lastOffset: d, lastSize: m, offsetTree: S } = Ge(t2.offsetTree, l, i2, r2);
      return {
        groupIndices: n,
        groupOffsetTree: n.reduce((h, T) => yt(h, T, ue(T, S, r2)), Zt()),
        lastIndex: c2,
        lastOffset: d,
        lastSize: m,
        offsetTree: S,
        sizeTree: i2
      };
    }
    function Oo(t2) {
      return Dt(t2).map(({ k: e, v: n }, o, r2) => {
        const s = r2[o + 1];
        return { endIndex: s ? s.k - 1 : 1 / 0, size: n, startIndex: e };
      });
    }
    function pn(t2, e) {
      let n = 0, o = 0;
      for (; n < t2; )
        n += e[o + 1] - e[o] - 1, o++;
      return o - (n === t2 ? 0 : 1);
    }
    function Ge(t2, e, n, o) {
      let r2 = t2, s = 0, i2 = 0, l = 0, c2 = 0;
      if (e !== 0) {
        c2 = Ce(r2, e - 1, $e), l = r2[c2].offset;
        const m = kt(n, e - 1);
        s = m[0], i2 = m[1], r2.length && r2[c2].size === kt(n, e)[1] && (c2 -= 1), r2 = r2.slice(0, c2 + 1);
      } else
        r2 = [];
      for (const { start: d, value: m } of Xt(n, e, 1 / 0)) {
        const S = d - s, h = S * i2 + l + S * o;
        r2.push({
          index: d,
          offset: h,
          size: m
        }), s = d, l = h, i2 = m;
      }
      return {
        lastIndex: s,
        lastOffset: l,
        lastSize: i2,
        offsetTree: r2
      };
    }
    function Fo(t2) {
      return { index: t2.index, value: t2 };
    }
    function Lo(t2) {
      const { endIndex: e, size: n, startIndex: o } = t2;
      return (r2) => r2.start === o && (r2.end === e || r2.end === 1 / 0) && r2.value === n;
    }
    const Vo = {
      offsetHeight: "height",
      offsetWidth: "width"
    }, Pt = K(
      ([{ log: t2 }, { recalcInProgress: e }]) => {
        const n = U(), o = U(), r2 = ht(o, 0), s = U(), i2 = U(), l = C$1(0), c2 = C$1([]), d = C$1(void 0), m = C$1(void 0), S = C$1(void 0), h = C$1(void 0), T = C$1((u, p) => zt(u, Vo[p])), w = C$1(void 0), R = C$1(0), g = Ro(), f = ht(
          x$1(n, $(c2, t2, R), Lt$1(zo, g), J()),
          g
        ), a = ht(
          x$1(
            c2,
            J(),
            Lt$1((u, p) => ({ current: p, prev: u.current }), {
              current: [],
              prev: []
            }),
            k(({ prev: u }) => u)
          ),
          []
        );
        F(
          x$1(
            c2,
            P$1((u) => u.length > 0),
            $(f, R),
            k(([u, p, v]) => {
              const O = u.reduce((B, W, _) => yt(B, W, ue(W, p.offsetTree, v) || _), Zt());
              return {
                ...p,
                groupIndices: u,
                groupOffsetTree: O
              };
            })
          ),
          f
        ), F(
          x$1(
            o,
            $(f),
            P$1(([u, { lastIndex: p }]) => u < p),
            k(([u, { lastIndex: p, lastSize: v }]) => [
              {
                endIndex: p,
                size: v,
                startIndex: u
              }
            ])
          ),
          n
        ), F(d, m);
        const I = ht(
          x$1(
            d,
            k((u) => u === void 0)
          ),
          true
        );
        F(
          x$1(
            m,
            P$1((u) => u !== void 0 && X(rt(f).sizeTree)),
            k((u) => {
              const p = rt(S), v = rt(c2).length > 0;
              return p ? v ? [
                { endIndex: 0, size: p, startIndex: 0 },
                { endIndex: 1, size: u, startIndex: 1 }
              ] : [] : [{ endIndex: 0, size: u, startIndex: 0 }];
            })
          ),
          n
        ), F(
          x$1(
            h,
            P$1((u) => u !== void 0 && u.length > 0 && X(rt(f).sizeTree)),
            k((u) => {
              const p = [];
              let v = u[0], O = 0;
              for (let B = 1; B < u.length; B++) {
                const W = u[B];
                W !== v && (p.push({
                  endIndex: B - 1,
                  size: v,
                  startIndex: O
                }), v = W, O = B);
              }
              return p.push({
                endIndex: u.length - 1,
                size: v,
                startIndex: O
              }), p;
            })
          ),
          n
        ), F(
          x$1(
            c2,
            $(S, m),
            P$1(([, u, p]) => u !== void 0 && p !== void 0),
            k(([u, p, v]) => {
              const O = [];
              for (let B = 0; B < u.length; B++) {
                const W = u[B], _ = u[B + 1];
                O.push({
                  startIndex: W,
                  endIndex: W,
                  size: p
                }), _ !== void 0 && O.push({
                  startIndex: W + 1,
                  endIndex: _ - 1,
                  size: v
                });
              }
              return O;
            })
          ),
          n
        );
        const b = bt(
          x$1(
            n,
            $(f),
            Lt$1(
              ({ sizes: u }, [p, v]) => ({
                changed: v !== u,
                sizes: v
              }),
              { changed: false, sizes: g }
            ),
            k((u) => u.changed)
          )
        );
        Y(
          x$1(
            l,
            Lt$1(
              (u, p) => ({ diff: u.prev - p, prev: p }),
              { diff: 0, prev: 0 }
            ),
            k((u) => u.diff)
          ),
          (u) => {
            const { groupIndices: p } = rt(f);
            if (u > 0)
              D(e, true), D(s, u + pn(u, p));
            else if (u < 0) {
              const v = rt(a);
              v.length > 0 && (u -= pn(-u, v)), D(i2, u);
            }
          }
        ), Y(x$1(l, $(t2)), ([u, p]) => {
          u < 0 && p(
            "`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",
            { firstItemIndex: l },
            Ct.ERROR
          );
        });
        const y = bt(s);
        F(
          x$1(
            s,
            $(f),
            k(([u, p]) => {
              const v = p.groupIndices.length > 0, O = [], B = p.lastSize;
              if (v) {
                const W = le$1(p.sizeTree, 0);
                let _ = 0, j = 0;
                for (; _ < u; ) {
                  const M = p.groupIndices[j], et2 = p.groupIndices.length === j + 1 ? 1 / 0 : p.groupIndices[j + 1] - M - 1;
                  O.push({
                    endIndex: M,
                    size: W,
                    startIndex: M
                  }), O.push({
                    endIndex: M + 1 + et2 - 1,
                    size: B,
                    startIndex: M + 1
                  }), j++, _ += et2 + 1;
                }
                const L = Dt(p.sizeTree);
                return _ !== u && L.shift(), L.reduce(
                  (M, { k: et2, v: wt }) => {
                    let ft = M.ranges;
                    return M.prevSize !== 0 && (ft = [
                      ...M.ranges,
                      {
                        endIndex: et2 + u - 1,
                        size: M.prevSize,
                        startIndex: M.prevIndex
                      }
                    ]), {
                      prevIndex: et2 + u,
                      prevSize: wt,
                      ranges: ft
                    };
                  },
                  {
                    prevIndex: u,
                    prevSize: 0,
                    ranges: O
                  }
                ).ranges;
              }
              return Dt(p.sizeTree).reduce(
                (W, { k: _, v: j }) => ({
                  prevIndex: _ + u,
                  prevSize: j,
                  ranges: [...W.ranges, { endIndex: _ + u - 1, size: W.prevSize, startIndex: W.prevIndex }]
                }),
                {
                  prevIndex: 0,
                  prevSize: B,
                  ranges: []
                }
              ).ranges;
            })
          ),
          n
        );
        const z = bt(
          x$1(
            i2,
            $(f, R),
            k(([u, { offsetTree: p }, v]) => {
              const O = -u;
              return ue(O, p, v);
            })
          )
        );
        return F(
          x$1(
            i2,
            $(f, R),
            k(([u, p, v]) => {
              if (p.groupIndices.length > 0) {
                if (X(p.sizeTree))
                  return p;
                let B = Zt();
                const W = rt(a);
                let _ = 0, j = 0, L = 0;
                for (; _ < -u; ) {
                  L = W[j];
                  const M = W[j + 1] - L - 1;
                  j++, _ += M + 1;
                }
                if (B = Dt(p.sizeTree).reduce((M, { k: et2, v: wt }) => yt(M, Math.max(0, et2 + u), wt), B), _ !== -u) {
                  const M = le$1(p.sizeTree, L);
                  B = yt(B, 0, M);
                  const et2 = kt(p.sizeTree, -u + 1)[1];
                  B = yt(B, 1, et2);
                }
                return {
                  ...p,
                  sizeTree: B,
                  ...Ge(p.offsetTree, 0, B, v)
                };
              } else {
                const B = Dt(p.sizeTree).reduce((W, { k: _, v: j }) => yt(W, Math.max(0, _ + u), j), Zt());
                return {
                  ...p,
                  sizeTree: B,
                  ...Ge(p.offsetTree, 0, B, v)
                };
              }
            })
          ),
          f
        ), {
          beforeUnshiftWith: y,
          // input
          data: w,
          defaultItemSize: m,
          firstItemIndex: l,
          fixedItemSize: d,
          fixedGroupSize: S,
          gap: R,
          groupIndices: c2,
          heightEstimates: h,
          itemSize: T,
          listRefresh: b,
          shiftWith: i2,
          shiftWithOffset: z,
          sizeRanges: n,
          // output
          sizes: f,
          statefulTotalCount: r2,
          totalCount: o,
          trackItemSizes: I,
          unshiftWith: s
        };
      },
      tt(Wt, De),
      { singleton: true }
    );
    function Po(t2) {
      return t2.reduce(
        (e, n) => (e.groupIndices.push(e.totalCount), e.totalCount += n + 1, e),
        {
          groupIndices: [],
          totalCount: 0
        }
      );
    }
    const Dn = K(
      ([{ groupIndices: t2, sizes: e, totalCount: n }, { headerHeight: o, scrollTop: r2 }]) => {
        const s = U(), i2 = U(), l = bt(x$1(s, k(Po)));
        return F(
          x$1(
            l,
            k((c2) => c2.totalCount)
          ),
          n
        ), F(
          x$1(
            l,
            k((c2) => c2.groupIndices)
          ),
          t2
        ), F(
          x$1(
            ut(r2, e, o),
            P$1(([c2, d]) => be(d)),
            k(([c2, d, m]) => kt(d.groupOffsetTree, Math.max(c2 - m, 0), "v")[0]),
            J(),
            k((c2) => [c2])
          ),
          i2
        ), { groupCounts: s, topItemsIndexes: i2 };
      },
      tt(Pt, It)
    ), _t = K(
      ([{ log: t2 }]) => {
        const e = C$1(false), n = bt(
          x$1(
            e,
            P$1((o) => o),
            J()
          )
        );
        return Y(e, (o) => {
          o && rt(t2)("props updated", {}, Ct.DEBUG);
        }), { didMount: n, propsReady: e };
      },
      tt(Wt),
      { singleton: true }
    ), Go = typeof document < "u" && "scrollBehavior" in document.documentElement.style;
    function $n(t2) {
      const e = typeof t2 == "number" ? { index: t2 } : t2;
      return e.align || (e.align = "start"), (!e.behavior || !Go) && (e.behavior = "auto"), e.offset || (e.offset = 0), e;
    }
    const me = K(
      ([
        { gap: t2, listRefresh: e, sizes: n, totalCount: o },
        {
          fixedFooterHeight: r2,
          fixedHeaderHeight: s,
          footerHeight: i2,
          headerHeight: l,
          scrollingInProgress: c2,
          scrollTo: d,
          smoothScrollTargetReached: m,
          viewportHeight: S
        },
        { log: h }
      ]) => {
        const T = U(), w = U(), R = C$1(0);
        let g = null, f = null, a = null;
        function I() {
          g && (g(), g = null), a && (a(), a = null), f && (clearTimeout(f), f = null), D(c2, false);
        }
        return F(
          x$1(
            T,
            $(n, S, o, R, l, i2, h),
            $(t2, s, r2),
            k(
              ([
                [b, y, z, u, p, v, O, B],
                W,
                _,
                j
              ]) => {
                const L = $n(b), { align: xt, behavior: M, offset: et2 } = L, wt = u - 1, ft = Nn(L, y, wt);
                let St = ue(ft, y.offsetTree, W) + v;
                xt === "end" ? (St += _ + kt(y.sizeTree, ft)[1] - z + j, ft === wt && (St += O)) : xt === "center" ? St += (_ + kt(y.sizeTree, ft)[1] - z + j) / 2 : St -= p, et2 && (St += et2);
                const Mt = (pt) => {
                  I(), pt ? (B("retrying to scroll to", { location: b }, Ct.DEBUG), D(T, b)) : (D(w, true), B("list did not change, scroll successful", {}, Ct.DEBUG));
                };
                if (I(), M === "smooth") {
                  let pt = false;
                  a = Y(e, (qt) => {
                    pt = pt || qt;
                  }), g = Et(m, () => {
                    Mt(pt);
                  });
                } else
                  g = Et(x$1(e, Mo(150)), Mt);
                return f = setTimeout(() => {
                  I();
                }, 1200), D(c2, true), B("scrolling from index to", { behavior: M, index: ft, top: St }, Ct.DEBUG), { behavior: M, top: St };
              }
            )
          ),
          d
        ), {
          scrollTargetReached: w,
          scrollToIndex: T,
          topListHeight: R
        };
      },
      tt(Pt, It, Wt),
      { singleton: true }
    );
    function Mo(t2) {
      return (e) => {
        const n = setTimeout(() => {
          e(false);
        }, t2);
        return (o) => {
          o && (e(true), clearTimeout(n));
        };
      };
    }
    function Ue(t2, e) {
      t2 == 0 ? e() : requestAnimationFrame(() => {
        Ue(t2 - 1, e);
      });
    }
    function Ke(t2, e) {
      const n = e - 1;
      return typeof t2 == "number" ? t2 : t2.index === "LAST" ? n : t2.index;
    }
    const pe = K(
      ([{ defaultItemSize: t2, listRefresh: e, sizes: n }, { scrollTop: o }, { scrollTargetReached: r2, scrollToIndex: s }, { didMount: i2 }]) => {
        const l = C$1(true), c2 = C$1(0), d = C$1(true);
        return F(
          x$1(
            i2,
            $(c2),
            P$1(([m, S]) => !!S),
            Ft(false)
          ),
          l
        ), F(
          x$1(
            i2,
            $(c2),
            P$1(([m, S]) => !!S),
            Ft(false)
          ),
          d
        ), Y(
          x$1(
            ut(e, i2),
            $(l, n, t2, d),
            P$1(([[, m], S, { sizeTree: h }, T, w]) => m && (!X(h) || Ae(T)) && !S && !w),
            $(c2)
          ),
          ([, m]) => {
            Et(r2, () => {
              D(d, true);
            }), Ue(4, () => {
              Et(o, () => {
                D(l, true);
              }), D(s, m);
            });
          }
        ), {
          initialItemFinalLocationReached: d,
          initialTopMostItemIndex: c2,
          scrolledToInitialItem: l
        };
      },
      tt(Pt, It, me, _t),
      { singleton: true }
    );
    function Un(t2, e) {
      return Math.abs(t2 - e) < 1.01;
    }
    const ae = "up", oe = "down", Ao = "none", Wo = {
      atBottom: false,
      notAtBottomBecause: "NOT_SHOWING_LAST_ITEM",
      state: {
        offsetBottom: 0,
        scrollHeight: 0,
        scrollTop: 0,
        viewportHeight: 0
      }
    }, _o = 0, he = K(([{ footerHeight: t2, headerHeight: e, scrollBy: n, scrollContainerState: o, scrollTop: r2, viewportHeight: s }]) => {
      const i2 = C$1(false), l = C$1(true), c2 = U(), d = U(), m = C$1(4), S = C$1(_o), h = ht(
        x$1(
          Fe(x$1(V(r2), Kt(1), Ft(true)), x$1(V(r2), Kt(1), Ft(false), dn(100))),
          J()
        ),
        false
      ), T = ht(
        x$1(Fe(x$1(n, Ft(true)), x$1(n, Ft(false), dn(200))), J()),
        false
      );
      F(
        x$1(
          ut(V(r2), V(S)),
          k(([a, I]) => a <= I),
          J()
        ),
        l
      ), F(x$1(l, Gt$1(50)), d);
      const w = bt(
        x$1(
          ut(o, V(s), V(e), V(t2), V(m)),
          Lt$1((a, [{ scrollHeight: I, scrollTop: b }, y, z, u, p]) => {
            const v = b + y - I > -p, O = {
              scrollHeight: I,
              scrollTop: b,
              viewportHeight: y
            };
            if (v) {
              let W, _;
              return b > a.state.scrollTop ? (W = "SCROLLED_DOWN", _ = a.state.scrollTop - b) : (W = "SIZE_DECREASED", _ = a.state.scrollTop - b || a.scrollTopDelta), {
                atBottom: true,
                atBottomBecause: W,
                scrollTopDelta: _,
                state: O
              };
            }
            let B;
            return O.scrollHeight > a.state.scrollHeight ? B = "SIZE_INCREASED" : y < a.state.viewportHeight ? B = "VIEWPORT_HEIGHT_DECREASING" : b < a.state.scrollTop ? B = "SCROLLING_UPWARDS" : B = "NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM", {
              atBottom: false,
              notAtBottomBecause: B,
              state: O
            };
          }, Wo),
          J((a, I) => a && a.atBottom === I.atBottom)
        )
      ), R = ht(
        x$1(
          o,
          Lt$1(
            (a, { scrollHeight: I, scrollTop: b, viewportHeight: y }) => {
              if (Un(a.scrollHeight, I))
                return {
                  changed: false,
                  jump: 0,
                  scrollHeight: I,
                  scrollTop: b
                };
              {
                const z = I - (b + y) < 1;
                return a.scrollTop !== b && z ? {
                  changed: true,
                  jump: a.scrollTop - b,
                  scrollHeight: I,
                  scrollTop: b
                } : {
                  changed: true,
                  jump: 0,
                  scrollHeight: I,
                  scrollTop: b
                };
              }
            },
            { changed: false, jump: 0, scrollHeight: 0, scrollTop: 0 }
          ),
          P$1((a) => a.changed),
          k((a) => a.jump)
        ),
        0
      );
      F(
        x$1(
          w,
          k((a) => a.atBottom)
        ),
        i2
      ), F(x$1(i2, Gt$1(50)), c2);
      const g = C$1(oe);
      F(
        x$1(
          o,
          k(({ scrollTop: a }) => a),
          J(),
          Lt$1(
            (a, I) => rt(T) ? { direction: a.direction, prevScrollTop: I } : { direction: I < a.prevScrollTop ? ae : oe, prevScrollTop: I },
            { direction: oe, prevScrollTop: 0 }
          ),
          k((a) => a.direction)
        ),
        g
      ), F(x$1(o, Gt$1(50), Ft(Ao)), g);
      const f = C$1(0);
      return F(
        x$1(
          h,
          P$1((a) => !a),
          Ft(0)
        ),
        f
      ), F(
        x$1(
          r2,
          Gt$1(100),
          $(h),
          P$1(([a, I]) => !!I),
          Lt$1(([a, I], [b]) => [I, b], [0, 0]),
          k(([a, I]) => I - a)
        ),
        f
      ), {
        atBottomState: w,
        atBottomStateChange: c2,
        atBottomThreshold: m,
        atTopStateChange: d,
        atTopThreshold: S,
        isAtBottom: i2,
        isAtTop: l,
        isScrolling: h,
        lastJumpDueToItemResize: R,
        scrollDirection: g,
        scrollVelocity: f
      };
    }, tt(It)), de = "top", fe = "bottom", hn = "none";
    function gn(t2, e, n) {
      return typeof t2 == "number" ? n === ae && e === de || n === oe && e === fe ? t2 : 0 : n === ae ? e === de ? t2.main : t2.reverse : e === fe ? t2.main : t2.reverse;
    }
    function In(t2, e) {
      var n;
      return typeof t2 == "number" ? t2 : (n = t2[e]) != null ? n : 0;
    }
    const je = K(
      ([{ deviation: t2, fixedHeaderHeight: e, headerHeight: n, scrollTop: o, viewportHeight: r2 }]) => {
        const s = U(), i2 = C$1(0), l = C$1(0), c2 = C$1(0), d = ht(
          x$1(
            ut(
              V(o),
              V(r2),
              V(n),
              V(s, ce),
              V(c2),
              V(i2),
              V(e),
              V(t2),
              V(l)
            ),
            k(
              ([
                m,
                S,
                h,
                [T, w],
                R,
                g,
                f,
                a,
                I
              ]) => {
                const b = m - a, y = g + f, z = Math.max(h - b, 0);
                let u = hn;
                const p = In(I, de), v = In(I, fe);
                return T -= a, T += h + f, w += h + f, w -= a, T > m + y - p && (u = ae), w < m - z + S + v && (u = oe), u !== hn ? [
                  Math.max(b - h - gn(R, de, u) - p, 0),
                  b - z - f + S + gn(R, fe, u) + v
                ] : null;
              }
            ),
            P$1((m) => m != null),
            J(ce)
          ),
          [0, 0]
        );
        return {
          increaseViewportBy: l,
          // input
          listBoundary: s,
          overscan: c2,
          topListHeight: i2,
          // output
          visibleRange: d
        };
      },
      tt(It),
      { singleton: true }
    );
    function No(t2, e, n) {
      if (be(e)) {
        const o = _n(t2, e);
        return [
          { index: kt(e.groupOffsetTree, o)[0], offset: 0, size: 0 },
          { data: n == null ? void 0 : n[0], index: o, offset: 0, size: 0 }
        ];
      }
      return [{ data: n == null ? void 0 : n[0], index: t2, offset: 0, size: 0 }];
    }
    const Be = {
      bottom: 0,
      firstItemIndex: 0,
      items: [],
      offsetBottom: 0,
      offsetTop: 0,
      top: 0,
      topItems: [],
      topListHeight: 0,
      totalCount: 0
    };
    function Te(t2, e, n, o, r2, s) {
      const { lastIndex: i2, lastOffset: l, lastSize: c2 } = r2;
      let d = 0, m = 0;
      if (t2.length > 0) {
        d = t2[0].offset;
        const R = t2[t2.length - 1];
        m = R.offset + R.size;
      }
      const S = n - i2, h = l + S * c2 + (S - 1) * o, T = d, w = h - m;
      return {
        bottom: m,
        firstItemIndex: s,
        items: xn(t2, r2, s),
        offsetBottom: w,
        offsetTop: d,
        top: T,
        topItems: xn(e, r2, s),
        topListHeight: e.reduce((R, g) => g.size + R, 0),
        totalCount: n
      };
    }
    function Kn(t2, e, n, o, r2, s) {
      let i2 = 0;
      if (n.groupIndices.length > 0)
        for (const m of n.groupIndices) {
          if (m - i2 >= t2)
            break;
          i2++;
        }
      const l = t2 + i2, c2 = Ke(e, l), d = Array.from({ length: l }).map((m, S) => ({
        data: s[S + c2],
        index: S + c2,
        offset: 0,
        size: 0
      }));
      return Te(d, [], l, r2, n, o);
    }
    function xn(t2, e, n) {
      if (t2.length === 0)
        return [];
      if (!be(e))
        return t2.map((d) => ({ ...d, index: d.index + n, originalIndex: d.index }));
      const o = t2[0].index, r2 = t2[t2.length - 1].index, s = [], i2 = Xt(e.groupOffsetTree, o, r2);
      let l, c2 = 0;
      for (const d of t2) {
        (!l || l.end < d.index) && (l = i2.shift(), c2 = e.groupIndices.indexOf(l.start));
        let m;
        d.index === l.start ? m = {
          index: c2,
          type: "group"
        } : m = {
          groupIndex: c2,
          index: d.index - (c2 + 1) + n
        }, s.push({
          ...m,
          data: d.data,
          offset: d.offset,
          originalIndex: d.index,
          size: d.size
        });
      }
      return s;
    }
    function Sn(t2, e) {
      var n;
      return t2 === void 0 ? 0 : typeof t2 == "number" ? t2 : (n = t2[e]) != null ? n : 0;
    }
    const jt = K(
      ([
        { data: t2, firstItemIndex: e, gap: n, sizes: o, totalCount: r2 },
        s,
        { listBoundary: i2, topListHeight: l, visibleRange: c2 },
        { initialTopMostItemIndex: d, scrolledToInitialItem: m },
        { topListHeight: S },
        h,
        { didMount: T },
        { recalcInProgress: w }
      ]) => {
        const R = C$1([]), g = C$1(0), f = U(), a = C$1(0);
        F(s.topItemsIndexes, R);
        const I = ht(
          x$1(
            ut(
              T,
              w,
              V(c2, ce),
              V(r2),
              V(o),
              V(d),
              m,
              V(R),
              V(e),
              V(n),
              V(a),
              t2
            ),
            P$1(([u, p, , v, , , , , , , , O]) => {
              const B = O && O.length !== v;
              return u && !p && !B;
            }),
            k(
              ([
                ,
                ,
                [u, p],
                v,
                O,
                B,
                W,
                _,
                j,
                L,
                xt,
                M
              ]) => {
                var q, at, gt2, Tt;
                const et2 = O, { offsetTree: wt, sizeTree: ft } = et2, St = rt(g);
                if (v === 0)
                  return { ...Be, totalCount: v };
                if (u === 0 && p === 0)
                  return St === 0 ? { ...Be, totalCount: v } : Kn(St, B, O, j, L, M || []);
                if (X(ft))
                  return St > 0 ? null : Te(
                    No(Ke(B, v), et2, M),
                    [],
                    v,
                    L,
                    et2,
                    j
                  );
                const Mt = [];
                if (_.length > 0) {
                  const st = _[0], it2 = _[_.length - 1];
                  let mt = 0;
                  for (const lt2 of Xt(ft, st, it2)) {
                    const Z2 = lt2.value, nt = Math.max(lt2.start, st), vt2 = Math.min(lt2.end, it2);
                    for (let ct = nt; ct <= vt2; ct++)
                      Mt.push({ data: M == null ? void 0 : M[ct], index: ct, offset: mt, size: Z2 }), mt += Z2;
                  }
                }
                if (!W)
                  return Te([], Mt, v, L, et2, j);
                const pt = _.length > 0 ? _[_.length - 1] + 1 : 0, qt = ko(wt, u, p, pt);
                if (qt.length === 0)
                  return null;
                const ee2 = v - 1, Ot = ye([], (st) => {
                  for (const it2 of qt) {
                    const mt = it2.value;
                    let lt2 = mt.offset, Z2 = it2.start;
                    const nt = mt.size;
                    if (mt.offset < u) {
                      Z2 += Math.floor((u - mt.offset + L) / (nt + L));
                      const ct = Z2 - it2.start;
                      lt2 += ct * nt + ct * L;
                    }
                    Z2 < pt && (lt2 += (pt - Z2) * nt, Z2 = pt);
                    const vt2 = Math.min(it2.end, ee2);
                    for (let ct = Z2; ct <= vt2 && !(lt2 >= p); ct++)
                      st.push({ data: M == null ? void 0 : M[ct], index: ct, offset: lt2, size: nt }), lt2 += nt + L;
                  }
                }), ne2 = Sn(xt, de), H = Sn(xt, fe);
                if (Ot.length > 0 && (ne2 > 0 || H > 0)) {
                  const st = Ot[0], it2 = Ot[Ot.length - 1];
                  if (ne2 > 0 && st.index > pt) {
                    const mt = Math.min(ne2, st.index - pt), lt2 = [];
                    let Z2 = st.offset;
                    for (let nt = st.index - 1; nt >= st.index - mt; nt--) {
                      const ct = (at = (q = Xt(ft, nt, nt)[0]) == null ? void 0 : q.value) != null ? at : st.size;
                      Z2 -= ct + L, lt2.unshift({ data: M == null ? void 0 : M[nt], index: nt, offset: Z2, size: ct });
                    }
                    Ot.unshift(...lt2);
                  }
                  if (H > 0 && it2.index < ee2) {
                    const mt = Math.min(H, ee2 - it2.index);
                    let lt2 = it2.offset + it2.size + L;
                    for (let Z2 = it2.index + 1; Z2 <= it2.index + mt; Z2++) {
                      const vt2 = (Tt = (gt2 = Xt(ft, Z2, Z2)[0]) == null ? void 0 : gt2.value) != null ? Tt : it2.size;
                      Ot.push({ data: M == null ? void 0 : M[Z2], index: Z2, offset: lt2, size: vt2 }), lt2 += vt2 + L;
                    }
                  }
                }
                return Te(Ot, Mt, v, L, et2, j);
              }
            ),
            //@ts-expect-error filter needs to be fixed
            P$1((u) => u !== null),
            J()
          ),
          Be
        );
        F(
          x$1(
            t2,
            P$1(Ae),
            k((u) => u == null ? void 0 : u.length)
          ),
          r2
        ), F(
          x$1(
            I,
            k((u) => u.topListHeight)
          ),
          S
        ), F(S, l), F(
          x$1(
            I,
            k((u) => [u.top, u.bottom])
          ),
          i2
        ), F(
          x$1(
            I,
            k((u) => u.items)
          ),
          f
        );
        const b = bt(
          x$1(
            I,
            P$1(({ items: u }) => u.length > 0),
            $(r2, t2),
            P$1(([{ items: u }, p]) => u[u.length - 1].originalIndex === p - 1),
            k(([, u, p]) => [u - 1, p]),
            J(ce),
            k(([u]) => u)
          )
        ), y = bt(
          x$1(
            I,
            Gt$1(200),
            P$1(({ items: u, topItems: p }) => u.length > 0 && u[0].originalIndex === p.length),
            k(({ items: u }) => u[0].index),
            J()
          )
        ), z = bt(
          x$1(
            I,
            P$1(({ items: u }) => u.length > 0),
            k(({ items: u }) => {
              let p = 0, v = u.length - 1;
              for (; u[p].type === "group" && p < v; )
                p++;
              for (; u[v].type === "group" && v > p; )
                v--;
              return {
                endIndex: u[v].index,
                startIndex: u[p].index
              };
            }),
            J(An)
          )
        );
        return {
          endReached: b,
          initialItemCount: g,
          itemsRendered: f,
          listState: I,
          minOverscanItemCount: a,
          rangeChanged: z,
          startReached: y,
          topItemsIndexes: R,
          ...h
        };
      },
      tt(
        Pt,
        Dn,
        je,
        pe,
        me,
        he,
        _t,
        De
      ),
      { singleton: true }
    ), jn = K(
      ([{ fixedFooterHeight: t2, fixedHeaderHeight: e, footerHeight: n, headerHeight: o }, { listState: r2 }]) => {
        const s = U(), i2 = ht(
          x$1(
            ut(n, t2, o, e, r2),
            k(([l, c2, d, m, S]) => l + c2 + d + m + S.offsetBottom + S.bottom)
          ),
          0
        );
        return F(V(i2), s), { totalListHeight: i2, totalListHeightChanged: s };
      },
      tt(It, jt),
      { singleton: true }
    ), Do = K(
      ([{ viewportHeight: t2 }, { totalListHeight: e }]) => {
        const n = C$1(false), o = ht(
          x$1(
            ut(n, t2, e),
            P$1(([r2]) => r2),
            k(([, r2, s]) => Math.max(0, r2 - s)),
            Gt$1(0),
            J()
          ),
          0
        );
        return { alignToBottom: n, paddingTopAddition: o };
      },
      tt(It, jn),
      { singleton: true }
    ), qn = K(() => ({
      context: C$1(null)
    })), $o = ({
      itemBottom: t2,
      itemTop: e,
      locationParams: { align: n, behavior: o, ...r2 },
      viewportBottom: s,
      viewportTop: i2
    }) => e < i2 ? { ...r2, align: n != null ? n : "start", behavior: o } : t2 > s ? { ...r2, align: n != null ? n : "end", behavior: o } : null, Yn = K(
      ([
        { gap: t2, sizes: e, totalCount: n },
        { fixedFooterHeight: o, fixedHeaderHeight: r2, headerHeight: s, scrollingInProgress: i2, scrollTop: l, viewportHeight: c2 },
        { scrollToIndex: d }
      ]) => {
        const m = U();
        return F(
          x$1(
            m,
            $(e, c2, n, s, r2, o, l),
            $(t2),
            k(([[S, h, T, w, R, g, f, a], I]) => {
              const { align: b, behavior: y, calculateViewLocation: z = $o, done: u, ...p } = S, v = Nn(S, h, w - 1), O = ue(v, h.offsetTree, I) + R + g, B = O + kt(h.sizeTree, v)[1], W = a + g, _ = a + T - f, j = z({
                itemBottom: B,
                itemTop: O,
                locationParams: { align: b, behavior: y, ...p },
                viewportBottom: _,
                viewportTop: W
              });
              return j ? u && Et(
                x$1(
                  i2,
                  P$1((L) => !L),
                  // skips the initial publish of false, and the cleanup call.
                  // but if scrollingInProgress is true, we skip the initial publish.
                  Kt(rt(i2) ? 1 : 2)
                ),
                u
              ) : u && u(), j;
            }),
            P$1((S) => S !== null)
          ),
          d
        ), {
          scrollIntoView: m
        };
      },
      tt(Pt, It, me, jt, Wt),
      { singleton: true }
    );
    function Tn(t2) {
      return t2 ? t2 === "smooth" ? "smooth" : "auto" : false;
    }
    const Uo = (t2, e) => typeof t2 == "function" ? Tn(t2(e)) : e && Tn(t2), Ko = K(
      ([
        { listRefresh: t2, totalCount: e, fixedItemSize: n, data: o },
        { atBottomState: r2, isAtBottom: s },
        { scrollToIndex: i2 },
        { scrolledToInitialItem: l },
        { didMount: c2, propsReady: d },
        { log: m },
        { scrollingInProgress: S },
        { context: h },
        { scrollIntoView: T }
      ]) => {
        const w = C$1(false), R = U();
        let g = null;
        function f(y) {
          D(i2, {
            align: "end",
            behavior: y,
            index: "LAST"
          });
        }
        Y(
          x$1(
            ut(x$1(V(e), Kt(1)), c2),
            $(V(w), s, l, S),
            k(([[y, z], u, p, v, O]) => {
              let B = z && v, W = "auto";
              return B && (W = Uo(u, p || O), B = B && !!W), { followOutputBehavior: W, shouldFollow: B, totalCount: y };
            }),
            P$1(({ shouldFollow: y }) => y)
          ),
          ({ followOutputBehavior: y, totalCount: z }) => {
            g && (g(), g = null), rt(n) ? requestAnimationFrame(() => {
              rt(m)("following output to ", { totalCount: z }, Ct.DEBUG), f(y);
            }) : g = Et(t2, () => {
              rt(m)("following output to ", { totalCount: z }, Ct.DEBUG), f(y), g = null;
            });
          }
        );
        function a(y) {
          const z = Et(r2, (u) => {
            y && !u.atBottom && u.notAtBottomBecause === "SIZE_INCREASED" && !g && (rt(m)("scrolling to bottom due to increased size", {}, Ct.DEBUG), f("auto"));
          });
          setTimeout(z, 100);
        }
        Y(
          x$1(
            ut(V(w), e, d),
            P$1(([y, , z]) => y && z),
            Lt$1(
              ({ value: y }, [, z]) => ({ refreshed: y === z, value: z }),
              { refreshed: false, value: 0 }
            ),
            P$1(({ refreshed: y }) => y),
            $(w, e)
          ),
          ([, y]) => {
            rt(l) && a(y !== false);
          }
        ), Y(R, () => {
          a(rt(w) !== false);
        }), Y(ut(V(w), r2), ([y, z]) => {
          y && !z.atBottom && z.notAtBottomBecause === "VIEWPORT_HEIGHT_DECREASING" && f("auto");
        });
        const I = C$1(null), b = U();
        return F(
          Fe(
            x$1(
              V(o),
              k((y) => {
                var z;
                return (z = y == null ? void 0 : y.length) != null ? z : 0;
              })
            ),
            x$1(V(e))
          ),
          b
        ), Y(
          x$1(
            ut(x$1(b, Kt(1)), c2),
            $(V(I), l, S, h),
            k(([[y, z], u, p, v, O]) => z && p && (u == null ? void 0 : u({ context: O, totalCount: y, scrollingInProgress: v }))),
            P$1((y) => !!y),
            Gt$1(0)
          ),
          (y) => {
            g && (g(), g = null), rt(n) ? requestAnimationFrame(() => {
              rt(m)("scrolling into view", {}), D(T, y);
            }) : g = Et(t2, () => {
              rt(m)("scrolling into view", {}), D(T, y), g = null;
            });
          }
        ), { autoscrollToBottom: R, followOutput: w, scrollIntoViewOnChange: I };
      },
      tt(
        Pt,
        he,
        me,
        pe,
        _t,
        Wt,
        It,
        qn,
        Yn
      )
    ), jo = K(
      ([{ data: t2, firstItemIndex: e, gap: n, sizes: o }, { initialTopMostItemIndex: r2 }, { initialItemCount: s, listState: i2 }, { didMount: l }]) => (F(
        x$1(
          l,
          $(s),
          P$1(([, c2]) => c2 !== 0),
          $(r2, o, e, n, t2),
          k(([[, c2], d, m, S, h, T = []]) => Kn(c2, d, m, S, h, T))
        ),
        i2
      ), {}),
      tt(Pt, pe, jt, _t),
      { singleton: true }
    ), qo = K(
      ([{ didMount: t2 }, { scrollTo: e }, { listState: n }]) => {
        const o = C$1(0);
        return Y(
          x$1(
            t2,
            $(o),
            P$1(([, r2]) => r2 !== 0),
            k(([, r2]) => ({ top: r2 }))
          ),
          (r2) => {
            Et(
              x$1(
                n,
                Kt(1),
                P$1((s) => s.items.length > 1)
              ),
              () => {
                requestAnimationFrame(() => {
                  D(e, r2);
                });
              }
            );
          }
        ), {
          initialScrollTop: o
        };
      },
      tt(_t, It, jt),
      { singleton: true }
    ), Zn = K(
      ([{ scrollVelocity: t2 }]) => {
        const e = C$1(false), n = U(), o = C$1(false);
        return F(
          x$1(
            t2,
            $(o, e, n),
            P$1(([r2, s]) => !!s),
            k(([r2, s, i2, l]) => {
              const { enter: c2, exit: d } = s;
              if (i2) {
                if (d(r2, l))
                  return false;
              } else if (c2(r2, l))
                return true;
              return i2;
            }),
            J()
          ),
          e
        ), Y(
          x$1(ut(e, t2, n), $(o)),
          ([[r2, s, i2], l]) => {
            r2 && l && l.change && l.change(s, i2);
          }
        ), { isSeeking: e, scrollSeekConfiguration: o, scrollSeekRangeChanged: n, scrollVelocity: t2 };
      },
      tt(he),
      { singleton: true }
    ), qe = K(([{ scrollContainerState: t2, scrollTo: e }]) => {
      const n = U(), o = U(), r2 = U(), s = C$1(false), i2 = C$1(void 0);
      return F(
        x$1(
          ut(n, o),
          k(([{ scrollHeight: l, scrollTop: c2, viewportHeight: d }, { offsetTop: m }]) => ({
            scrollHeight: l,
            scrollTop: Math.max(0, c2 - m),
            viewportHeight: d
          }))
        ),
        t2
      ), F(
        x$1(
          e,
          $(o),
          k(([l, { offsetTop: c2 }]) => ({
            ...l,
            top: l.top + c2
          }))
        ),
        r2
      ), {
        customScrollParent: i2,
        // config
        useWindowScroll: s,
        // input
        windowScrollContainerState: n,
        // signals
        windowScrollTo: r2,
        windowViewportRect: o
      };
    }, tt(It)), Yo = K(
      ([
        { sizeRanges: t2, sizes: e },
        { headerHeight: n, scrollTop: o },
        { initialTopMostItemIndex: r2 },
        { didMount: s },
        { useWindowScroll: i2, windowScrollContainerState: l, windowViewportRect: c2 }
      ]) => {
        const d = U(), m = C$1(void 0), S = C$1(null), h = C$1(null);
        return F(l, S), F(c2, h), Y(
          x$1(
            d,
            $(e, o, i2, S, h, n)
          ),
          ([T, w, R, g, f, a, I]) => {
            const b = Oo(w.sizeTree);
            g && f !== null && a !== null && (R = f.scrollTop - a.offsetTop), R -= I, T({ ranges: b, scrollTop: R });
          }
        ), F(x$1(m, P$1(Ae), k(Zo)), r2), F(
          x$1(
            s,
            $(m),
            P$1(([, T]) => T !== void 0),
            J(),
            k(([, T]) => T.ranges)
          ),
          t2
        ), {
          getState: d,
          restoreStateFrom: m
        };
      },
      tt(Pt, It, pe, _t, qe)
    );
    function Zo(t2) {
      return { align: "start", index: 0, offset: t2.scrollTop };
    }
    const Xo = K(([{ topItemsIndexes: t2 }]) => {
      const e = C$1(0);
      return F(
        x$1(
          e,
          P$1((n) => n >= 0),
          k((n) => Array.from({ length: n }).map((o, r2) => r2))
        ),
        t2
      ), { topItemCount: e };
    }, tt(jt));
    function Xn(t2) {
      let e = false, n;
      return () => (e || (e = true, n = t2()), n);
    }
    const Jo = Xn(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.test(navigator.userAgent)), Qo = K(
      ([
        { deviation: t2, scrollBy: e, scrollingInProgress: n, scrollTop: o },
        { isAtBottom: r2, isScrolling: s, lastJumpDueToItemResize: i2, scrollDirection: l },
        { listState: c2 },
        { beforeUnshiftWith: d, gap: m, shiftWithOffset: S, sizes: h },
        { log: T },
        { recalcInProgress: w }
      ]) => {
        const R = bt(
          x$1(
            c2,
            $(i2),
            Lt$1(
              ([, f, a, I], [{ bottom: b, items: y, offsetBottom: z, totalCount: u }, p]) => {
                const v = b + z;
                let O = 0;
                return a === u && f.length > 0 && y.length > 0 && (y[0].originalIndex === 0 && f[0].originalIndex === 0 || (O = v - I, O !== 0 && (O += p))), [O, y, u, v];
              },
              [0, [], 0, 0]
            ),
            P$1(([f]) => f !== 0),
            $(o, l, n, r2, T, w),
            P$1(([, f, a, I, , , b]) => !b && !I && f !== 0 && a === ae),
            k(([[f], , , , , a]) => (a("Upward scrolling compensation", { amount: f }, Ct.DEBUG), f))
          )
        );
        function g(f) {
          f > 0 ? (D(e, { behavior: "auto", top: -f }), D(t2, 0)) : (D(t2, 0), D(e, { behavior: "auto", top: -f }));
        }
        return Y(x$1(R, $(t2, s)), ([f, a, I]) => {
          I && Jo() ? D(t2, a - f) : g(-f);
        }), Y(
          x$1(
            ut(ht(s, false), t2, w),
            P$1(([f, a, I]) => !f && !I && a !== 0),
            k(([f, a]) => a),
            Gt$1(1)
          ),
          g
        ), F(
          x$1(
            S,
            k((f) => ({ top: -f }))
          ),
          e
        ), Y(
          x$1(
            d,
            $(h, m),
            k(([f, { groupIndices: a, lastSize: I, sizeTree: b }, y]) => {
              function z(u) {
                return u * (I + y);
              }
              if (a.length === 0)
                return z(f);
              {
                let u = 0;
                const p = le$1(b, 0);
                let v = 0, O = 0;
                for (; v < f; ) {
                  v++, u += p;
                  let B = a.length === O + 1 ? 1 / 0 : a[O + 1] - a[O] - 1;
                  v + B > f && (u -= p, B = f - v + 1), v += B, u += z(B), O++;
                }
                return u;
              }
            })
          ),
          (f) => {
            D(t2, f), requestAnimationFrame(() => {
              D(e, { top: f }), requestAnimationFrame(() => {
                D(t2, 0), D(w, false);
              });
            });
          }
        ), { deviation: t2 };
      },
      tt(It, he, jt, Pt, Wt, De)
    ), tr = K(
      ([
        t2,
        e,
        n,
        o,
        r2,
        s,
        i2,
        l,
        c2,
        d,
        m
      ]) => ({
        ...t2,
        ...e,
        ...n,
        ...o,
        ...r2,
        ...s,
        ...i2,
        ...l,
        ...c2,
        ...d,
        ...m
      }),
      tt(
        je,
        jo,
        _t,
        Zn,
        jn,
        qo,
        Do,
        qe,
        Yn,
        Wt,
        qn
      )
    ), Jn = K(
      ([
        {
          data: t2,
          defaultItemSize: e,
          firstItemIndex: n,
          fixedItemSize: o,
          fixedGroupSize: r2,
          gap: s,
          groupIndices: i2,
          heightEstimates: l,
          itemSize: c2,
          sizeRanges: d,
          sizes: m,
          statefulTotalCount: S,
          totalCount: h,
          trackItemSizes: T
        },
        { initialItemFinalLocationReached: w, initialTopMostItemIndex: R, scrolledToInitialItem: g },
        f,
        a,
        I,
        b,
        { scrollToIndex: y },
        z,
        { topItemCount: u },
        { groupCounts: p },
        v
      ]) => {
        const { listState: O, minOverscanItemCount: B, topItemsIndexes: W, rangeChanged: _, ...j } = b;
        return F(_, v.scrollSeekRangeChanged), F(
          x$1(
            v.windowViewportRect,
            k((L) => L.visibleHeight)
          ),
          f.viewportHeight
        ), {
          data: t2,
          defaultItemHeight: e,
          firstItemIndex: n,
          fixedItemHeight: o,
          fixedGroupHeight: r2,
          gap: s,
          groupCounts: p,
          heightEstimates: l,
          initialItemFinalLocationReached: w,
          initialTopMostItemIndex: R,
          scrolledToInitialItem: g,
          sizeRanges: d,
          topItemCount: u,
          topItemsIndexes: W,
          // input
          totalCount: h,
          ...I,
          groupIndices: i2,
          itemSize: c2,
          listState: O,
          minOverscanItemCount: B,
          scrollToIndex: y,
          // output
          statefulTotalCount: S,
          trackItemSizes: T,
          // exported from stateFlagsSystem
          rangeChanged: _,
          ...j,
          // the bag of IO from featureGroup1System
          ...v,
          ...f,
          sizes: m,
          ...a
        };
      },
      tt(
        Pt,
        pe,
        It,
        Yo,
        Ko,
        jt,
        me,
        Qo,
        Xo,
        Dn,
        tr
      )
    );
    function er(t2, e) {
      const n = {}, o = {};
      let r2 = 0;
      const s = t2.length;
      for (; r2 < s; )
        o[t2[r2]] = 1, r2 += 1;
      for (const i2 in e)
        Object.hasOwn(o, i2) || (n[i2] = e[i2]);
      return n;
    }
    const Ie = typeof document < "u" ? React20.useLayoutEffect : React20.useEffect;
    function Ye(t2, e, n) {
      const o = Object.keys(e.required || {}), r2 = Object.keys(e.optional || {}), s = Object.keys(e.methods || {}), i2 = Object.keys(e.events || {}), l = React20.createContext({});
      function c2(f, a) {
        f.propsReady && D(f.propsReady, false);
        for (const I of o) {
          const b = f[e.required[I]];
          D(b, a[I]);
        }
        for (const I of r2)
          if (I in a) {
            const b = f[e.optional[I]];
            D(b, a[I]);
          }
        f.propsReady && D(f.propsReady, true);
      }
      function d(f) {
        return s.reduce((a, I) => (a[I] = (b) => {
          const y = f[e.methods[I]];
          D(y, b);
        }, a), {});
      }
      function m(f) {
        return i2.reduce((a, I) => (a[I] = xo(f[e.events[I]]), a), {});
      }
      const S = React20.forwardRef((f, a) => {
        const { children: I, ...b } = f, [y] = React20.useState(() => ye(To(t2), (p) => {
          c2(p, b);
        })), [z] = React20.useState(an(m, y));
        Ie(() => {
          for (const p of i2)
            p in b && Y(z[p], b[p]);
          return () => {
            Object.values(z).map(We);
          };
        }, [b, z, y]), Ie(() => {
          c2(y, b);
        }), React20.useImperativeHandle(a, un(d(y)));
        const u = n;
        return /* @__PURE__ */ jsxRuntimeExports.jsx(l.Provider, { value: y, children: n ? /* @__PURE__ */ jsxRuntimeExports.jsx(u, { ...er([...o, ...r2, ...i2], b), children: I }) : I });
      }), h = (f) => {
        const a = React20.useContext(l);
        return React20.useCallback(
          (I) => {
            D(a[f], I);
          },
          [a, f]
        );
      }, T = (f) => {
        const I = React20.useContext(l)[f], b = React20.useCallback(
          (y) => Y(I, y),
          [I]
        );
        return React20.useSyncExternalStore(
          b,
          () => rt(I),
          () => rt(I)
        );
      }, w = (f) => {
        const I = React20.useContext(l)[f], [b, y] = React20.useState(an(rt, I));
        return Ie(
          () => Y(I, (z) => {
            z !== b && y(un(z));
          }),
          [I, b]
        ), b;
      }, R = React20.version.startsWith("18") ? T : w;
      return {
        Component: S,
        useEmitter: (f, a) => {
          const b = React20.useContext(l)[f];
          Ie(() => Y(b, a), [a, b]);
        },
        useEmitterValue: R,
        usePublisher: h
      };
    }
    const Re$1 = React20.createContext(void 0), Qn = React20.createContext(void 0), to = typeof document < "u" ? React20.useLayoutEffect : React20.useEffect;
    function ke(t2) {
      return "self" in t2;
    }
    function nr(t2) {
      return "body" in t2;
    }
    function eo(t2, e, n, o = Qt, r2, s) {
      const i2 = React20.useRef(null), l = React20.useRef(null), c2 = React20.useRef(null), d = React20.useCallback(
        (h) => {
          let T, w, R;
          const g = h.target;
          if (nr(g) || ke(g)) {
            const a = ke(g) ? g : g.defaultView;
            R = s ? a.scrollX : a.scrollY, T = s ? a.document.documentElement.scrollWidth : a.document.documentElement.scrollHeight, w = s ? a.innerWidth : a.innerHeight;
          } else
            R = s ? g.scrollLeft : g.scrollTop, T = s ? g.scrollWidth : g.scrollHeight, w = s ? g.offsetWidth : g.offsetHeight;
          const f = () => {
            t2({
              scrollHeight: T,
              scrollTop: Math.max(R, 0),
              viewportHeight: w
            });
          };
          h.suppressFlushSync ? f() : ReactDOM.flushSync(f), l.current !== null && (R === l.current || R <= 0 || R === T - w) && (l.current = null, e(true), c2.current && (clearTimeout(c2.current), c2.current = null));
        },
        [t2, e, s]
      );
      React20.useEffect(() => {
        const h = r2 || i2.current;
        return o(r2 || i2.current), d({ suppressFlushSync: true, target: h }), h.addEventListener("scroll", d, { passive: true }), () => {
          o(null), h.removeEventListener("scroll", d);
        };
      }, [i2, d, n, o, r2]);
      function m(h) {
        const T = i2.current;
        if (!T || (s ? "offsetWidth" in T && T.offsetWidth === 0 : "offsetHeight" in T && T.offsetHeight === 0))
          return;
        const w = h.behavior === "smooth";
        let R, g, f;
        ke(T) ? (g = Math.max(
          zt(T.document.documentElement, s ? "width" : "height"),
          s ? T.document.documentElement.scrollWidth : T.document.documentElement.scrollHeight
        ), R = s ? T.innerWidth : T.innerHeight, f = s ? window.scrollX : window.scrollY) : (g = T[s ? "scrollWidth" : "scrollHeight"], R = zt(T, s ? "width" : "height"), f = T[s ? "scrollLeft" : "scrollTop"]);
        const a = g - R;
        if (h.top = Math.ceil(Math.max(Math.min(a, h.top), 0)), Un(R, g) || h.top === f) {
          t2({ scrollHeight: g, scrollTop: f, viewportHeight: R }), w && e(true);
          return;
        }
        w ? (l.current = h.top, c2.current && clearTimeout(c2.current), c2.current = setTimeout(() => {
          c2.current = null, l.current = null, e(true);
        }, 1e3)) : l.current = null, s && (h = { behavior: h.behavior, left: h.top }), T.scrollTo(h);
      }
      function S(h) {
        s && (h = { behavior: h.behavior, left: h.top }), i2.current.scrollBy(h);
      }
      return { scrollByCallback: S, scrollerRef: i2, scrollToCallback: m };
    }
    const ze = "-webkit-sticky", Cn = "sticky", Ze = Xn(() => {
      if (typeof document > "u")
        return Cn;
      const t2 = document.createElement("div");
      return t2.style.position = ze, t2.style.position === ze ? ze : Cn;
    });
    function Xe(t2) {
      return t2;
    }
    const or$1 = /* @__PURE__ */ K(() => {
      const t2 = C$1((l) => `Item ${l}`), e = C$1((l) => `Group ${l}`), n = C$1({}), o = C$1(Xe), r2 = C$1("div"), s = C$1(Qt), i2 = (l, c2 = null) => ht(
        x$1(
          n,
          k((d) => d[l]),
          J()
        ),
        c2
      );
      return {
        components: n,
        computeItemKey: o,
        EmptyPlaceholder: i2("EmptyPlaceholder"),
        FooterComponent: i2("Footer"),
        GroupComponent: i2("Group", "div"),
        groupContent: e,
        HeaderComponent: i2("Header"),
        HeaderFooterTag: r2,
        ItemComponent: i2("Item", "div"),
        itemContent: t2,
        ListComponent: i2("List", "div"),
        ScrollerComponent: i2("Scroller", "div"),
        scrollerRef: s,
        ScrollSeekPlaceholder: i2("ScrollSeekPlaceholder"),
        TopItemListComponent: i2("TopItemList")
      };
    }), rr = /* @__PURE__ */ K(
      ([t2, e]) => ({ ...t2, ...e }),
      tt(Jn, or$1)
    ), sr = ({ height: t2 }) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { height: t2 } }), ir = { overflowAnchor: "none", position: Ze(), zIndex: 1 }, no = { overflowAnchor: "none" }, lr = { ...no, display: "inline-block", height: "100%" }, wn = /* @__PURE__ */ React20.memo(function({ showTopList: e = false }) {
      const n = A("listState"), o = Rt("sizeRanges"), r2 = A("useWindowScroll"), s = A("customScrollParent"), i2 = Rt("windowScrollContainerState"), l = Rt("scrollContainerState"), c2 = s || r2 ? i2 : l, d = A("itemContent"), m = A("context"), S = A("groupContent"), h = A("trackItemSizes"), T = A("itemSize"), w = A("log"), R = Rt("gap"), g = A("horizontalDirection"), { callbackRef: f } = Fn(
        o,
        T,
        h,
        e ? Qt : c2,
        w,
        R,
        s,
        g,
        A("skipAnimationFrameInResizeObserver")
      ), [a, I] = React20.useState(0);
      tn("deviation", (L) => {
        a !== L && I(L);
      });
      const b = A("EmptyPlaceholder"), y = A("ScrollSeekPlaceholder") || sr, z = A("ListComponent"), u = A("ItemComponent"), p = A("GroupComponent"), v = A("computeItemKey"), O = A("isSeeking"), B = A("groupIndices").length > 0, W = A("alignToBottom"), _ = A("initialItemFinalLocationReached"), j = e ? {} : {
        boxSizing: "border-box",
        ...g ? {
          display: "inline-block",
          height: "100%",
          marginLeft: a !== 0 ? a : W ? "auto" : 0,
          paddingLeft: n.offsetTop,
          paddingRight: n.offsetBottom,
          whiteSpace: "nowrap"
        } : {
          marginTop: a !== 0 ? a : W ? "auto" : 0,
          paddingBottom: n.offsetBottom,
          paddingTop: n.offsetTop
        },
        ..._ ? {} : { visibility: "hidden" }
      };
      return !e && n.totalCount === 0 && b ? /* @__PURE__ */ jsxRuntimeExports.jsx(b, { ...Q(b, m) }) : /* @__PURE__ */ jsxRuntimeExports.jsx(
        z,
        {
          ...Q(z, m),
          "data-testid": e ? "virtuoso-top-item-list" : "virtuoso-item-list",
          ref: f,
          style: j,
          children: (e ? n.topItems : n.items).map((L) => {
            const xt = L.originalIndex, M = v(xt + n.firstItemIndex, L.data, m);
            return O ? /* @__PURE__ */ reactExports.createElement(
              y,
              {
                ...Q(y, m),
                height: L.size,
                index: L.index,
                key: M,
                type: L.type || "item",
                ...L.type === "group" ? {} : { groupIndex: L.groupIndex }
              }
            ) : L.type === "group" ? /* @__PURE__ */ reactExports.createElement(
              p,
              {
                ...Q(p, m),
                "data-index": xt,
                "data-item-index": L.index,
                "data-known-size": L.size,
                key: M,
                style: ir
              },
              S(L.index, m)
            ) : /* @__PURE__ */ reactExports.createElement(
              u,
              {
                ...Q(u, m),
                ...oo(u, L.data),
                "data-index": xt,
                "data-item-group-index": L.groupIndex,
                "data-item-index": L.index,
                "data-known-size": L.size,
                key: M,
                style: g ? lr : no
              },
              B ? d(L.index, L.groupIndex, L.data, m) : d(L.index, L.data, m)
            );
          })
        }
      );
    }), cr = {
      height: "100%",
      outline: "none",
      overflowY: "auto",
      position: "relative",
      WebkitOverflowScrolling: "touch"
    }, ur = {
      outline: "none",
      overflowX: "auto",
      position: "relative"
    }, te = (t2) => ({
      height: "100%",
      position: "absolute",
      top: 0,
      width: "100%",
      ...t2 ? { display: "flex", flexDirection: "column" } : {}
    }), ar = {
      position: Ze(),
      top: 0,
      width: "100%",
      zIndex: 1
    };
    function Q(t2, e) {
      if (typeof t2 != "string")
        return { context: e };
    }
    function oo(t2, e) {
      return { item: typeof t2 == "string" ? void 0 : e };
    }
    const dr = /* @__PURE__ */ React20.memo(function() {
      const e = A("HeaderComponent"), n = Rt("headerHeight"), o = A("HeaderFooterTag"), r2 = Vt$1(
        React20.useMemo(
          () => (i2) => {
            n(zt(i2, "height"));
          },
          [n]
        ),
        true,
        A("skipAnimationFrameInResizeObserver")
      ), s = A("context");
      return e ? /* @__PURE__ */ jsxRuntimeExports.jsx(o, { ref: r2, children: /* @__PURE__ */ jsxRuntimeExports.jsx(e, { ...Q(e, s) }) }) : null;
    }), fr = /* @__PURE__ */ React20.memo(function() {
      const e = A("FooterComponent"), n = Rt("footerHeight"), o = A("HeaderFooterTag"), r2 = Vt$1(
        React20.useMemo(
          () => (i2) => {
            n(zt(i2, "height"));
          },
          [n]
        ),
        true,
        A("skipAnimationFrameInResizeObserver")
      ), s = A("context");
      return e ? /* @__PURE__ */ jsxRuntimeExports.jsx(o, { ref: r2, children: /* @__PURE__ */ jsxRuntimeExports.jsx(e, { ...Q(e, s) }) }) : null;
    });
    function Je({ useEmitter: t2, useEmitterValue: e, usePublisher: n }) {
      return React20.memo(function({ children: s, style: i2, context: l, ...c2 }) {
        const d = n("scrollContainerState"), m = e("ScrollerComponent"), S = n("smoothScrollTargetReached"), h = e("scrollerRef"), T = e("horizontalDirection") || false, { scrollByCallback: w, scrollerRef: R, scrollToCallback: g } = eo(
          d,
          S,
          m,
          h,
          void 0,
          T
        );
        return t2("scrollTo", g), t2("scrollBy", w), /* @__PURE__ */ jsxRuntimeExports.jsx(
          m,
          {
            "data-testid": "virtuoso-scroller",
            "data-virtuoso-scroller": true,
            ref: R,
            style: { ...T ? ur : cr, ...i2 },
            tabIndex: 0,
            ...c2,
            ...Q(m, l),
            children: s
          }
        );
      });
    }
    function Qe({ useEmitter: t2, useEmitterValue: e, usePublisher: n }) {
      return React20.memo(function({ children: s, style: i2, context: l, ...c2 }) {
        const d = n("windowScrollContainerState"), m = e("ScrollerComponent"), S = n("smoothScrollTargetReached"), h = e("totalListHeight"), T = e("deviation"), w = e("customScrollParent"), R = React20.useRef(null), g = e("scrollerRef"), { scrollByCallback: f, scrollerRef: a, scrollToCallback: I } = eo(
          d,
          S,
          m,
          g,
          w
        );
        return to(() => {
          var b;
          return a.current = w || ((b = R.current) == null ? void 0 : b.ownerDocument.defaultView), () => {
            a.current = null;
          };
        }, [a, w]), t2("windowScrollTo", I), t2("scrollBy", f), /* @__PURE__ */ jsxRuntimeExports.jsx(
          m,
          {
            ref: R,
            "data-virtuoso-scroller": true,
            style: { position: "relative", ...i2, ...h !== 0 ? { height: h + T } : {} },
            ...c2,
            ...Q(m, l),
            children: s
          }
        );
      });
    }
    const mr = ({ children: t2 }) => {
      const e = React20.useContext(Re$1), n = Rt("viewportHeight"), o = Rt("fixedItemHeight"), r2 = A("alignToBottom"), s = A("horizontalDirection"), i2 = React20.useMemo(
        () => se(n, (c2) => zt(c2, s ? "width" : "height")),
        [n, s]
      ), l = Vt$1(i2, true, A("skipAnimationFrameInResizeObserver"));
      return React20.useEffect(() => {
        e && (n(e.viewportHeight), o(e.itemHeight));
      }, [e, n, o]), /* @__PURE__ */ jsxRuntimeExports.jsx("div", { "data-viewport-type": "element", ref: l, style: te(r2), children: t2 });
    }, pr$1 = ({ children: t2 }) => {
      const e = React20.useContext(Re$1), n = Rt("windowViewportRect"), o = Rt("fixedItemHeight"), r2 = A("customScrollParent"), s = Ne(
        n,
        r2,
        A("skipAnimationFrameInResizeObserver")
      ), i2 = A("alignToBottom");
      return React20.useEffect(() => {
        e && (o(e.itemHeight), n({ offsetTop: 0, visibleHeight: e.viewportHeight, visibleWidth: 100 }));
      }, [e, n, o]), /* @__PURE__ */ jsxRuntimeExports.jsx("div", { "data-viewport-type": "window", ref: s, style: te(i2), children: t2 });
    }, hr$1 = ({ children: t2 }) => {
      const e = A("TopItemListComponent") || "div", n = A("headerHeight"), o = { ...ar, marginTop: `${n}px` }, r2 = A("context");
      return /* @__PURE__ */ jsxRuntimeExports.jsx(e, { style: o, ...Q(e, r2), children: t2 });
    }, gr = /* @__PURE__ */ React20.memo(function(e) {
      const n = A("useWindowScroll"), o = A("topItemsIndexes").length > 0, r2 = A("customScrollParent"), s = A("context");
      return /* @__PURE__ */ jsxRuntimeExports.jsxs(r2 || n ? xr : Ir, { ...e, context: s, children: [
        o && /* @__PURE__ */ jsxRuntimeExports.jsx(hr$1, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(wn, { showTopList: true }) }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs(r2 || n ? pr$1 : mr, { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(dr, {}),
          /* @__PURE__ */ jsxRuntimeExports.jsx(wn, {}),
          /* @__PURE__ */ jsxRuntimeExports.jsx(fr, {})
        ] })
      ] });
    }), {
      Component: ro,
      useEmitter: tn,
      useEmitterValue: A,
      usePublisher: Rt
    } = /* @__PURE__ */ Ye(
      rr,
      {
        required: {},
        optional: {
          restoreStateFrom: "restoreStateFrom",
          context: "context",
          followOutput: "followOutput",
          scrollIntoViewOnChange: "scrollIntoViewOnChange",
          itemContent: "itemContent",
          groupContent: "groupContent",
          overscan: "overscan",
          increaseViewportBy: "increaseViewportBy",
          minOverscanItemCount: "minOverscanItemCount",
          totalCount: "totalCount",
          groupCounts: "groupCounts",
          topItemCount: "topItemCount",
          firstItemIndex: "firstItemIndex",
          initialTopMostItemIndex: "initialTopMostItemIndex",
          components: "components",
          atBottomThreshold: "atBottomThreshold",
          atTopThreshold: "atTopThreshold",
          computeItemKey: "computeItemKey",
          defaultItemHeight: "defaultItemHeight",
          fixedGroupHeight: "fixedGroupHeight",
          // Must be set above 'fixedItemHeight'
          fixedItemHeight: "fixedItemHeight",
          heightEstimates: "heightEstimates",
          itemSize: "itemSize",
          scrollSeekConfiguration: "scrollSeekConfiguration",
          headerFooterTag: "HeaderFooterTag",
          data: "data",
          initialItemCount: "initialItemCount",
          initialScrollTop: "initialScrollTop",
          alignToBottom: "alignToBottom",
          useWindowScroll: "useWindowScroll",
          customScrollParent: "customScrollParent",
          scrollerRef: "scrollerRef",
          logLevel: "logLevel",
          horizontalDirection: "horizontalDirection",
          skipAnimationFrameInResizeObserver: "skipAnimationFrameInResizeObserver"
        },
        methods: {
          scrollToIndex: "scrollToIndex",
          scrollIntoView: "scrollIntoView",
          scrollTo: "scrollTo",
          scrollBy: "scrollBy",
          autoscrollToBottom: "autoscrollToBottom",
          getState: "getState"
        },
        events: {
          isScrolling: "isScrolling",
          endReached: "endReached",
          startReached: "startReached",
          rangeChanged: "rangeChanged",
          atBottomStateChange: "atBottomStateChange",
          atTopStateChange: "atTopStateChange",
          totalListHeightChanged: "totalListHeightChanged",
          itemsRendered: "itemsRendered",
          groupIndices: "groupIndices"
        }
      },
      gr
    ), Ir = /* @__PURE__ */ Je({ useEmitter: tn, useEmitterValue: A, usePublisher: Rt }), xr = /* @__PURE__ */ Qe({ useEmitter: tn, useEmitterValue: A, usePublisher: Rt }), Yr = ro, Sr = /* @__PURE__ */ K(() => {
      const t2 = C$1((d) => /* @__PURE__ */ jsxRuntimeExports.jsxs("td", { children: [
        "Item $",
        d
      ] })), e = C$1(null), n = C$1((d) => /* @__PURE__ */ jsxRuntimeExports.jsxs("td", { colSpan: 1e3, children: [
        "Group ",
        d
      ] })), o = C$1(null), r2 = C$1(null), s = C$1({}), i2 = C$1(Xe), l = C$1(Qt), c2 = (d, m = null) => ht(
        x$1(
          s,
          k((S) => S[d]),
          J()
        ),
        m
      );
      return {
        components: s,
        computeItemKey: i2,
        context: e,
        EmptyPlaceholder: c2("EmptyPlaceholder"),
        FillerRow: c2("FillerRow"),
        fixedFooterContent: r2,
        fixedHeaderContent: o,
        itemContent: t2,
        groupContent: n,
        ScrollerComponent: c2("Scroller", "div"),
        scrollerRef: l,
        ScrollSeekPlaceholder: c2("ScrollSeekPlaceholder"),
        TableBodyComponent: c2("TableBody", "tbody"),
        TableComponent: c2("Table", "table"),
        TableFooterComponent: c2("TableFoot", "tfoot"),
        TableHeadComponent: c2("TableHead", "thead"),
        TableRowComponent: c2("TableRow", "tr"),
        GroupComponent: c2("Group", "tr")
      };
    });
    /* @__PURE__ */ K(
      ([t2, e]) => ({ ...t2, ...e }),
      tt(Jn, Sr)
    );
    ({ position: Ze() });
    const bn = {
      bottom: 0,
      itemHeight: 0,
      items: [],
      itemWidth: 0,
      offsetBottom: 0,
      offsetTop: 0,
      top: 0
    }, kr = {
      bottom: 0,
      itemHeight: 0,
      items: [{ index: 0 }],
      itemWidth: 0,
      offsetBottom: 0,
      offsetTop: 0,
      top: 0
    }, { ceil: Rn, floor: we, max: re, min: Oe, round: Hn } = Math;
    function En(t2, e, n) {
      return Array.from({ length: e - t2 + 1 }).map((o, r2) => ({ data: n === null ? null : n[r2 + t2], index: r2 + t2 }));
    }
    function zr(t2) {
      return {
        ...kr,
        items: t2
      };
    }
    function xe(t2, e) {
      return t2 && t2.width === e.width && t2.height === e.height;
    }
    function Or$1(t2, e) {
      return t2 && t2.column === e.column && t2.row === e.row;
    }
    const Fr = /* @__PURE__ */ K(
      ([
        { increaseViewportBy: t2, listBoundary: e, overscan: n, visibleRange: o },
        { footerHeight: r2, headerHeight: s, scrollBy: i2, scrollContainerState: l, scrollTo: c2, scrollTop: d, smoothScrollTargetReached: m, viewportHeight: S },
        h,
        T,
        { didMount: w, propsReady: R },
        { customScrollParent: g, useWindowScroll: f, windowScrollContainerState: a, windowScrollTo: I, windowViewportRect: b },
        y
      ]) => {
        const z = C$1(0), u = C$1(0), p = C$1(bn), v = C$1({ height: 0, width: 0 }), O = C$1({ height: 0, width: 0 }), B = U(), W = U(), _ = C$1(0), j = C$1(null), L = C$1({ column: 0, row: 0 }), xt = U(), M = U(), et2 = C$1(false), wt = C$1(0), ft = C$1(true), St = C$1(false), Mt = C$1(false);
        Y(
          x$1(
            w,
            $(wt),
            P$1(([H, q]) => !!q)
          ),
          () => {
            D(ft, false);
          }
        ), Y(
          x$1(
            ut(w, ft, O, v, wt, St),
            P$1(([H, q, at, gt2, , Tt]) => H && !q && at.height !== 0 && gt2.height !== 0 && !Tt)
          ),
          ([, , , , H]) => {
            D(St, true), Ue(1, () => {
              D(B, H);
            }), Et(x$1(d), () => {
              D(e, [0, 0]), D(ft, true);
            });
          }
        ), F(
          x$1(
            M,
            P$1((H) => H != null && H.scrollTop > 0),
            Ft(0)
          ),
          u
        ), Y(
          x$1(
            w,
            $(M),
            P$1(([, H]) => H != null)
          ),
          ([, H]) => {
            H && (D(v, H.viewport), D(O, H.item), D(L, H.gap), H.scrollTop > 0 && (D(et2, true), Et(x$1(d, Kt(1)), (q) => {
              D(et2, false);
            }), D(c2, { top: H.scrollTop })));
          }
        ), F(
          x$1(
            v,
            k(({ height: H }) => H)
          ),
          S
        ), F(
          x$1(
            ut(
              V(v, xe),
              V(O, xe),
              V(L, (H, q) => H && H.column === q.column && H.row === q.row),
              V(d)
            ),
            k(([H, q, at, gt2]) => ({
              gap: at,
              item: q,
              scrollTop: gt2,
              viewport: H
            }))
          ),
          xt
        ), F(
          x$1(
            ut(
              V(z),
              o,
              V(L, Or$1),
              V(O, xe),
              V(v, xe),
              V(j),
              V(u),
              V(et2),
              V(ft),
              V(wt)
            ),
            P$1(([, , , , , , , H]) => !H),
            k(
              ([
                H,
                [q, at],
                gt2,
                Tt,
                st,
                it2,
                mt,
                ,
                lt2,
                Z2
              ]) => {
                const { column: nt, row: vt2 } = gt2, { height: ct, width: He } = Tt, { width: nn } = st;
                if (mt === 0 && (H === 0 || nn === 0))
                  return bn;
                if (He === 0) {
                  const cn = Ke(Z2, H), uo = cn + Math.max(mt - 1, 0);
                  return zr(En(cn, uo, it2));
                }
                const ge2 = io(nn, He, nt);
                let Yt, Nt;
                lt2 ? q === 0 && at === 0 && mt > 0 ? (Yt = 0, Nt = mt - 1) : (Yt = ge2 * we((q + vt2) / (ct + vt2)), Nt = ge2 * Rn((at + vt2) / (ct + vt2)) - 1, Nt = Oe(H - 1, re(Nt, ge2 - 1)), Yt = Oe(Nt, re(0, Yt))) : (Yt = 0, Nt = -1);
                const on = En(Yt, Nt, it2), { bottom: rn, top: sn } = Bn(st, gt2, Tt, on), ln = Rn(H / ge2), co = ln * ct + (ln - 1) * vt2 - rn;
                return { bottom: rn, itemHeight: ct, items: on, itemWidth: He, offsetBottom: co, offsetTop: sn, top: sn };
              }
            )
          ),
          p
        ), F(
          x$1(
            j,
            P$1((H) => H !== null),
            k((H) => H.length)
          ),
          z
        ), F(
          x$1(
            ut(v, O, p, L),
            P$1(([H, q, { items: at }]) => at.length > 0 && q.height !== 0 && H.height !== 0),
            k(([H, q, { items: at }, gt2]) => {
              const { bottom: Tt, top: st } = Bn(H, gt2, q, at);
              return [st, Tt];
            }),
            J(ce)
          ),
          e
        );
        const pt = C$1(false);
        F(
          x$1(
            d,
            $(pt),
            k(([H, q]) => q || H !== 0)
          ),
          pt
        );
        const qt = bt(
          x$1(
            ut(p, z),
            P$1(([{ items: H }]) => H.length > 0),
            $(pt),
            P$1(([[H, q], at]) => {
              const Tt = H.items[H.items.length - 1].index === q - 1;
              return (at || H.bottom > 0 && H.itemHeight > 0 && H.offsetBottom === 0 && H.items.length === q) && Tt;
            }),
            k(([[, H]]) => H - 1),
            J()
          )
        ), ee2 = bt(
          x$1(
            V(p),
            P$1(({ items: H }) => H.length > 0 && H[0].index === 0),
            Ft(0),
            J()
          )
        ), Ot = bt(
          x$1(
            V(p),
            $(et2),
            P$1(([{ items: H }, q]) => H.length > 0 && !q),
            k(([{ items: H }]) => ({
              endIndex: H[H.length - 1].index,
              startIndex: H[0].index
            })),
            J(An),
            Gt$1(0)
          )
        );
        F(Ot, T.scrollSeekRangeChanged), F(
          x$1(
            B,
            $(v, O, z, L),
            k(([H, q, at, gt2, Tt]) => {
              const st = $n(H), { align: it2, behavior: mt, offset: lt2 } = st;
              let Z2 = st.index;
              Z2 === "LAST" && (Z2 = gt2 - 1), Z2 = re(0, Z2, Oe(gt2 - 1, Z2));
              let nt = Me(q, Tt, at, Z2);
              return it2 === "end" ? nt = Hn(nt - q.height + at.height) : it2 === "center" && (nt = Hn(nt - q.height / 2 + at.height / 2)), lt2 && (nt += lt2), { behavior: mt, top: nt };
            })
          ),
          c2
        );
        const ne2 = ht(
          x$1(
            p,
            k((H) => H.offsetBottom + H.bottom)
          ),
          0
        );
        return F(
          x$1(
            b,
            k((H) => ({ height: H.visibleHeight, width: H.visibleWidth }))
          ),
          v
        ), {
          customScrollParent: g,
          // input
          data: j,
          deviation: _,
          footerHeight: r2,
          gap: L,
          headerHeight: s,
          increaseViewportBy: t2,
          initialItemCount: u,
          itemDimensions: O,
          overscan: n,
          restoreStateFrom: M,
          scrollBy: i2,
          scrollContainerState: l,
          scrollHeight: W,
          scrollTo: c2,
          scrollToIndex: B,
          scrollTop: d,
          smoothScrollTargetReached: m,
          totalCount: z,
          useWindowScroll: f,
          viewportDimensions: v,
          windowScrollContainerState: a,
          windowScrollTo: I,
          windowViewportRect: b,
          ...T,
          // output
          gridState: p,
          horizontalDirection: Mt,
          initialTopMostItemIndex: wt,
          totalListHeight: ne2,
          ...h,
          endReached: qt,
          propsReady: R,
          rangeChanged: Ot,
          startReached: ee2,
          stateChanged: xt,
          stateRestoreInProgress: et2,
          ...y
        };
      },
      tt(je, It, he, Zn, _t, qe, Wt)
    );
    function io(t2, e, n) {
      return re(1, we((t2 + n) / (we(e) + n)));
    }
    function Bn(t2, e, n, o) {
      const { height: r2 } = n;
      if (r2 === void 0 || o.length === 0)
        return { bottom: 0, top: 0 };
      const s = Me(t2, e, n, o[0].index);
      return { bottom: Me(t2, e, n, o[o.length - 1].index) + r2, top: s };
    }
    function Me(t2, e, n, o) {
      const r2 = io(t2.width, n.width, e.column), s = we(o / r2), i2 = s * n.height + re(0, s - 1) * e.row;
      return i2 > 0 ? i2 + e.row : i2;
    }
    const Lr = /* @__PURE__ */ K(() => {
      const t2 = C$1((S) => `Item ${S}`), e = C$1({}), n = C$1(null), o = C$1("virtuoso-grid-item"), r2 = C$1("virtuoso-grid-list"), s = C$1(Xe), i2 = C$1("div"), l = C$1(Qt), c2 = (S, h = null) => ht(
        x$1(
          e,
          k((T) => T[S]),
          J()
        ),
        h
      ), d = C$1(false), m = C$1(false);
      return F(V(m), d), {
        components: e,
        computeItemKey: s,
        context: n,
        FooterComponent: c2("Footer"),
        HeaderComponent: c2("Header"),
        headerFooterTag: i2,
        itemClassName: o,
        ItemComponent: c2("Item", "div"),
        itemContent: t2,
        listClassName: r2,
        ListComponent: c2("List", "div"),
        readyStateChanged: d,
        reportReadyState: m,
        ScrollerComponent: c2("Scroller", "div"),
        scrollerRef: l,
        ScrollSeekPlaceholder: c2("ScrollSeekPlaceholder", "div")
      };
    }), Vr = /* @__PURE__ */ K(
      ([t2, e]) => ({ ...t2, ...e }),
      tt(Fr, Lr)
    ), Pr$1 = /* @__PURE__ */ React20.memo(function() {
      const e = ot("gridState"), n = ot("listClassName"), o = ot("itemClassName"), r2 = ot("itemContent"), s = ot("computeItemKey"), i2 = ot("isSeeking"), l = Ht("scrollHeight"), c2 = ot("ItemComponent"), d = ot("ListComponent"), m = ot("ScrollSeekPlaceholder"), S = ot("context"), h = Ht("itemDimensions"), T = Ht("gap"), w = ot("log"), R = ot("stateRestoreInProgress"), g = Ht("reportReadyState"), f = Vt$1(
        React20.useMemo(
          () => (a) => {
            const I = a.parentElement.parentElement.scrollHeight;
            l(I);
            const b = a.firstChild;
            if (b) {
              const { height: y, width: z } = b.getBoundingClientRect();
              h({ height: y, width: z });
            }
            T({
              column: kn("column-gap", getComputedStyle(a).columnGap, w),
              row: kn("row-gap", getComputedStyle(a).rowGap, w)
            });
          },
          [l, h, T, w]
        ),
        true,
        false
      );
      return to(() => {
        e.itemHeight > 0 && e.itemWidth > 0 && g(true);
      }, [e]), R ? null : /* @__PURE__ */ jsxRuntimeExports.jsx(
        d,
        {
          className: n,
          ref: f,
          ...Q(d, S),
          "data-testid": "virtuoso-item-list",
          style: { paddingBottom: e.offsetBottom, paddingTop: e.offsetTop },
          children: e.items.map((a) => {
            const I = s(a.index, a.data, S);
            return i2 ? /* @__PURE__ */ jsxRuntimeExports.jsx(
              m,
              {
                ...Q(m, S),
                height: e.itemHeight,
                index: a.index,
                width: e.itemWidth
              },
              I
            ) : /* @__PURE__ */ reactExports.createElement(
              c2,
              {
                ...Q(c2, S),
                className: o,
                "data-index": a.index,
                key: I
              },
              r2(a.index, a.data, S)
            );
          })
        }
      );
    }), Gr = React20.memo(function() {
      const e = ot("HeaderComponent"), n = Ht("headerHeight"), o = ot("headerFooterTag"), r2 = Vt$1(
        React20.useMemo(
          () => (i2) => {
            n(zt(i2, "height"));
          },
          [n]
        ),
        true,
        false
      ), s = ot("context");
      return e ? /* @__PURE__ */ jsxRuntimeExports.jsx(o, { ref: r2, children: /* @__PURE__ */ jsxRuntimeExports.jsx(e, { ...Q(e, s) }) }) : null;
    }), Mr = React20.memo(function() {
      const e = ot("FooterComponent"), n = Ht("footerHeight"), o = ot("headerFooterTag"), r2 = Vt$1(
        React20.useMemo(
          () => (i2) => {
            n(zt(i2, "height"));
          },
          [n]
        ),
        true,
        false
      ), s = ot("context");
      return e ? /* @__PURE__ */ jsxRuntimeExports.jsx(o, { ref: r2, children: /* @__PURE__ */ jsxRuntimeExports.jsx(e, { ...Q(e, s) }) }) : null;
    }), Ar = ({ children: t2 }) => {
      const e = React20.useContext(Qn), n = Ht("itemDimensions"), o = Ht("viewportDimensions"), r2 = Vt$1(
        React20.useMemo(
          () => (s) => {
            o(s.getBoundingClientRect());
          },
          [o]
        ),
        true,
        false
      );
      return React20.useEffect(() => {
        e && (o({ height: e.viewportHeight, width: e.viewportWidth }), n({ height: e.itemHeight, width: e.itemWidth }));
      }, [e, o, n]), /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: r2, style: te(false), children: t2 });
    }, Wr = ({ children: t2 }) => {
      const e = React20.useContext(Qn), n = Ht("windowViewportRect"), o = Ht("itemDimensions"), r2 = ot("customScrollParent"), s = Ne(n, r2, false);
      return React20.useEffect(() => {
        e && (o({ height: e.itemHeight, width: e.itemWidth }), n({ offsetTop: 0, visibleHeight: e.viewportHeight, visibleWidth: e.viewportWidth }));
      }, [e, n, o]), /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: s, style: te(false), children: t2 });
    }, _r = /* @__PURE__ */ React20.memo(function({ ...e }) {
      const n = ot("useWindowScroll"), o = ot("customScrollParent"), r2 = o || n ? $r : Dr, s = o || n ? Wr : Ar, i2 = ot("context");
      return /* @__PURE__ */ jsxRuntimeExports.jsx(r2, { ...e, ...Q(r2, i2), children: /* @__PURE__ */ jsxRuntimeExports.jsxs(s, { children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(Gr, {}),
        /* @__PURE__ */ jsxRuntimeExports.jsx(Pr$1, {}),
        /* @__PURE__ */ jsxRuntimeExports.jsx(Mr, {})
      ] }) });
    }), {
      useEmitter: lo,
      useEmitterValue: ot,
      usePublisher: Ht
    } = /* @__PURE__ */ Ye(
      Vr,
      {
        optional: {
          context: "context",
          totalCount: "totalCount",
          overscan: "overscan",
          itemContent: "itemContent",
          components: "components",
          computeItemKey: "computeItemKey",
          data: "data",
          initialItemCount: "initialItemCount",
          scrollSeekConfiguration: "scrollSeekConfiguration",
          headerFooterTag: "headerFooterTag",
          listClassName: "listClassName",
          itemClassName: "itemClassName",
          useWindowScroll: "useWindowScroll",
          customScrollParent: "customScrollParent",
          scrollerRef: "scrollerRef",
          logLevel: "logLevel",
          restoreStateFrom: "restoreStateFrom",
          initialTopMostItemIndex: "initialTopMostItemIndex",
          increaseViewportBy: "increaseViewportBy"
        },
        methods: {
          scrollTo: "scrollTo",
          scrollBy: "scrollBy",
          scrollToIndex: "scrollToIndex"
        },
        events: {
          isScrolling: "isScrolling",
          endReached: "endReached",
          startReached: "startReached",
          rangeChanged: "rangeChanged",
          atBottomStateChange: "atBottomStateChange",
          atTopStateChange: "atTopStateChange",
          stateChanged: "stateChanged",
          readyStateChanged: "readyStateChanged"
        }
      },
      _r
    ), Dr = /* @__PURE__ */ Je({ useEmitter: lo, useEmitterValue: ot, usePublisher: Ht }), $r = /* @__PURE__ */ Qe({ useEmitter: lo, useEmitterValue: ot, usePublisher: Ht });
    function kn(t2, e, n) {
      return e !== "normal" && !(e != null && e.endsWith("px")) && n(`${t2} was not resolved to pixel value correctly`, e, Ct.WARN), e === "normal" ? 0 : parseInt(e != null ? e : "0", 10);
    }
    const log$2 = createLogger("scrolling");
    function useStatefulScrollPosition(elementRef, elementKey, delay = 1e3, scrollable2 = true) {
      const getScrollPosition = useStore(
        (state) => state.appActions.getScrollPosition
      );
      const setScrollPosition = useStore(
        (state) => state.appActions.setScrollPosition
      );
      const handleScroll = reactExports.useMemo(
        () => debounce$2((e) => {
          const target2 = e.target;
          const position = target2.scrollTop;
          log$2.debug(`Storing scroll position`, elementKey, position);
          setScrollPosition(elementKey, position);
        }, delay),
        [elementKey, setScrollPosition, delay]
      );
      const restoreScrollPosition = reactExports.useCallback(() => {
        const element = elementRef.current;
        const savedPosition = getScrollPosition(elementKey);
        if (element && savedPosition !== void 0) {
          requestAnimationFrame(() => {
            element.scrollTop = savedPosition;
            requestAnimationFrame(() => {
              if (element.scrollTop !== savedPosition) {
                element.scrollTop = savedPosition;
              }
            });
          });
        }
      }, [elementKey, getScrollPosition, elementRef]);
      reactExports.useEffect(() => {
        const element = elementRef.current;
        if (!element || !scrollable2) {
          return;
        }
        log$2.debug(`Restore Scroll Hook`, elementKey);
        const savedPosition = getScrollPosition(elementKey);
        if (savedPosition !== void 0) {
          log$2.debug(`Restoring scroll position`, savedPosition);
          const tryRestoreScroll = () => {
            if (element.scrollHeight > element.clientHeight) {
              if (element.scrollTop !== savedPosition) {
                element.scrollTop = savedPosition;
                log$2.debug(`Scroll position restored to ${savedPosition}`);
              }
              return true;
            }
            return false;
          };
          if (!tryRestoreScroll()) {
            let attempts = 0;
            const maxAttempts = 5;
            const pollForRender = () => {
              if (tryRestoreScroll() || attempts >= maxAttempts) {
                if (attempts >= maxAttempts) {
                  log$2.debug(
                    `Failed to restore scroll after ${maxAttempts} attempts`
                  );
                }
                return;
              }
              attempts++;
              setTimeout(pollForRender, 1e3);
            };
            setTimeout(pollForRender, 1e3);
          }
        }
        if (element.addEventListener) {
          element.addEventListener("scroll", handleScroll);
        } else {
          log$2.warn("Element has no way to add event listener", element);
        }
        return () => {
          if (element.removeEventListener) {
            element.removeEventListener("scroll", handleScroll);
          } else {
            log$2.warn("Element has no way to remove event listener", element);
          }
        };
      }, [elementKey, elementRef, getScrollPosition, handleScroll, scrollable2]);
      return { restoreScrollPosition };
    }
    const useVirtuosoState = (virtuosoRef, elementKey, delay = 1e3) => {
      const restoreState = useStore(
        reactExports.useCallback((state) => state.app.listPositions[elementKey], [elementKey])
      );
      const setListPosition = useStore(
        reactExports.useCallback((state) => state.appActions.setListPosition, [])
      );
      const clearListPosition = useStore(
        reactExports.useCallback((state) => state.appActions.clearListPosition, [])
      );
      const debouncedFnRef = reactExports.useRef(null);
      const handleStateChange = reactExports.useCallback(
        (state) => {
          log$2.debug(`Storing list state: [${elementKey}]`, state);
          setListPosition(elementKey, state);
        },
        [elementKey, setListPosition]
      );
      reactExports.useEffect(() => {
        debouncedFnRef.current = debounce$2((isScrolling2) => {
          log$2.debug("List scroll", isScrolling2);
          const element = virtuosoRef.current;
          if (!element) {
            return;
          }
          element.getState(handleStateChange);
        }, delay);
        return () => {
          clearListPosition(elementKey);
        };
      }, [delay, elementKey, handleStateChange, clearListPosition, virtuosoRef]);
      const isScrolling = reactExports.useCallback((scrolling) => {
        if (!scrolling) {
          return;
        }
        if (debouncedFnRef.current) {
          debouncedFnRef.current(scrolling);
        }
      }, []);
      const stateRef = reactExports.useRef(restoreState);
      reactExports.useEffect(() => {
        stateRef.current = restoreState;
      }, [restoreState]);
      const getRestoreState = reactExports.useCallback(() => stateRef.current, []);
      const setVisibleRangeRaw = useStore(
        (state) => state.appActions.setVisibleRange
      );
      const setVisibleRange = reactExports.useCallback(
        (value2) => {
          setVisibleRangeRaw(elementKey, value2);
        },
        [setVisibleRangeRaw, elementKey]
      );
      const visibleRanges = useStore((state) => state.app.visibleRanges);
      const visibleRange = reactExports.useMemo(() => {
        return visibleRanges[elementKey] || {
          startIndex: 0,
          endIndex: 0
        };
      }, [visibleRanges, elementKey]);
      return { getRestoreState, isScrolling, visibleRange, setVisibleRange };
    };
    function useRafThrottle(callback, dependencies = []) {
      const rafRef = reactExports.useRef(null);
      const callbackRef = reactExports.useRef(callback);
      reactExports.useEffect(() => {
        callbackRef.current = callback;
      }, [callback, ...dependencies]);
      const throttledCallback = reactExports.useCallback((...args2) => {
        if (rafRef.current) {
          return;
        }
        rafRef.current = requestAnimationFrame(() => {
          callbackRef.current(...args2);
          rafRef.current = null;
        });
      }, []);
      reactExports.useEffect(() => {
        return () => {
          if (rafRef.current) {
            cancelAnimationFrame(rafRef.current);
            rafRef.current = null;
          }
        };
      }, []);
      return throttledCallback;
    }
    function useScrollTrack(elementIds, onElementVisible, scrollRef, options2) {
      const currentVisibleRef = reactExports.useRef(null);
      const lastCheckRef = reactExports.useRef(0);
      const rafRef = reactExports.useRef(null);
      const findTopmostVisibleElement = reactExports.useCallback(() => {
        const container2 = scrollRef?.current;
        const containerRect = container2?.getBoundingClientRect();
        const topOffset = 50;
        const viewportTop = containerRect ? containerRect.top + topOffset : topOffset;
        const viewportBottom = containerRect ? containerRect.bottom : window.innerHeight;
        const viewportHeight = viewportBottom - viewportTop;
        let detectionPoint = viewportTop;
        if (container2) {
          const scrollHeight = container2.scrollHeight;
          const scrollTop = container2.scrollTop;
          const clientHeight = container2.clientHeight;
          const maxScroll = scrollHeight - clientHeight;
          const scrollProgress = maxScroll > 0 ? scrollTop / maxScroll : 0;
          const slideThreshold = 0.8;
          if (scrollProgress > slideThreshold) {
            const slideProgress = (scrollProgress - slideThreshold) / (1 - slideThreshold);
            const easedProgress = Math.pow(slideProgress, 3);
            detectionPoint = viewportTop + viewportHeight * 0.9 * easedProgress;
          }
          if (scrollProgress >= 0.99) {
            detectionPoint = viewportBottom - 50;
          }
        }
        let closestId = null;
        let closestDistance = Infinity;
        const elementIdSet = new Set(elementIds);
        const elements = container2 ? container2.querySelectorAll("[id]") : document.querySelectorAll("[id]");
        for (const element of elements) {
          const id = element.id;
          if (elementIdSet.has(id)) {
            const rect2 = element.getBoundingClientRect();
            if (rect2.bottom >= viewportTop && rect2.top <= viewportBottom) {
              const elementCenter = rect2.top + rect2.height / 2;
              const distance = Math.abs(elementCenter - detectionPoint);
              if (distance < closestDistance) {
                closestDistance = distance;
                closestId = id;
              }
            }
          }
        }
        return closestId;
      }, [elementIds, scrollRef, options2?.topOffset]);
      const checkVisibility = reactExports.useCallback(() => {
        const now = Date.now();
        const checkInterval = 100;
        if (now - lastCheckRef.current < checkInterval) {
          return;
        }
        lastCheckRef.current = now;
        const topmostId = findTopmostVisibleElement();
        if (topmostId !== currentVisibleRef.current) {
          currentVisibleRef.current = topmostId;
          if (topmostId) {
            onElementVisible(topmostId);
          }
        }
      }, [findTopmostVisibleElement, onElementVisible, options2?.checkInterval]);
      const handleScroll = reactExports.useCallback(() => {
        if (rafRef.current !== null) {
          cancelAnimationFrame(rafRef.current);
        }
        rafRef.current = requestAnimationFrame(() => {
          checkVisibility();
          rafRef.current = null;
        });
      }, [checkVisibility]);
      reactExports.useEffect(() => {
        if (elementIds.length === 0) return;
        const scrollElement = scrollRef?.current || window;
        checkVisibility();
        scrollElement.addEventListener("scroll", handleScroll, { passive: true });
        const intervalId = setInterval(checkVisibility, 1e3);
        return () => {
          scrollElement.removeEventListener("scroll", handleScroll);
          clearInterval(intervalId);
          if (rafRef.current !== null) {
            cancelAnimationFrame(rafRef.current);
          }
        };
      }, [elementIds, scrollRef, handleScroll, checkVisibility]);
    }
    const keyPairContainer = "_keyPairContainer_qjlxf_1";
    const keyPairBordered = "_keyPairBordered_qjlxf_9";
    const key = "_key_qjlxf_1";
    const pre$1 = "_pre_qjlxf_19";
    const treeIcon = "_treeIcon_qjlxf_23";
    const styles$1I = {
      keyPairContainer,
      keyPairBordered,
      key,
      pre: pre$1,
      treeIcon
    };
    const kStoreInstanceKey = /^(.+)?:([a-zA-Z0-9]{22}):instance$/;
    const kStoreKey = /^(.+)?:([a-zA-Z0-9]{22}):(.+)$/;
    const resolveStoreKeys = (record) => {
      const result2 = {};
      const storeInstances = {};
      const instanceKeys = /* @__PURE__ */ new Set();
      const entries = Object.entries(record);
      for (let i2 = 0; i2 < entries.length; i2++) {
        const [key2, value2] = entries[i2];
        const instanceInfo = parseStoreInstanceKey(key2, value2);
        if (instanceInfo) {
          const { storeName, instanceId } = instanceInfo;
          const instanceKey = storeKey(storeName, instanceId);
          if (!storeInstances[instanceKey]) {
            storeInstances[instanceKey] = {};
          }
          instanceKeys.add(key2);
          continue;
        } else {
          const storeKeyInfo = parseStoreKey(key2);
          if (storeKeyInfo) {
            const { storeName, instanceId, keyName: keyName2 } = storeKeyInfo;
            const instanceKey = storeKey(storeName, instanceId);
            if (storeInstances[instanceKey]) {
              storeInstances[instanceKey][keyName2] = value2;
              continue;
            }
          } else {
            result2[key2] = value2;
          }
        }
      }
      for (const [instanceKey, children2] of Object.entries(storeInstances)) {
        result2[instanceKey] = resolveStoreKeys(children2);
      }
      for (const [key2, value2] of Object.entries(result2)) {
        if (typeof value2 === "object" && value2 !== null && !Array.isArray(value2)) {
          result2[key2] = resolveStoreKeys(value2);
        }
      }
      return result2;
    };
    const parseStoreInstanceKey = (key2, value2) => {
      const match = key2.match(kStoreInstanceKey);
      if (match) {
        const [, storeName, instanceId] = match;
        if (typeof value2 === "string" && instanceId === value2) {
          return {
            storeName,
            instanceId
          };
        }
      }
      return null;
    };
    const parseStoreKey = (key2) => {
      const match = key2.match(kStoreKey);
      if (match) {
        const [, storeName, instanceId, keyName2] = match;
        if (keyName2 !== "instance") {
          return {
            storeName,
            instanceId,
            keyName: keyName2
          };
        }
      }
      return null;
    };
    const storeKey = (storeName, instanceId) => {
      return `${storeName || ""} (${instanceId})`;
    };
    const kRecordTreeKey = "record-tree-key";
    const RecordTree = ({
      id,
      record,
      className: className2,
      scrollRef,
      defaultExpandLevel = 1,
      processStore = false,
      useBorders = true
    }) => {
      const listHandle = reactExports.useRef(null);
      const { getRestoreState } = useVirtuosoState(
        listHandle,
        `metadata-grid-${id}`
      );
      const [collapsedIds, setCollapsed, clearIds] = useCollapsibleIds(id);
      const setCollapsedIds = useStore(
        (state) => state.sampleActions.setCollapsedIds
      );
      reactExports.useEffect(() => {
        return () => {
          clearIds();
        };
      }, [clearIds, id]);
      const items = reactExports.useMemo(() => {
        const items2 = toTreeItems(
          record,
          collapsedIds || {},
          processStore ? [resolveStoreKeys] : []
        );
        return items2;
      }, [record, collapsedIds, processStore]);
      reactExports.useEffect(() => {
        if (collapsedIds) {
          return;
        }
        const defaultCollapsedIds = items.reduce(
          (prev, item2) => {
            if (item2.depth >= defaultExpandLevel && item2.hasChildren) {
              prev[item2.id] = true;
            }
            return prev;
          },
          {}
        );
        setCollapsedIds(id, defaultCollapsedIds);
      }, [collapsedIds, defaultExpandLevel, id, items, setCollapsedIds]);
      const keyUpHandler = reactExports.useCallback(
        (itemId, index) => {
          return (event) => {
            switch (event.key) {
              case "Enter":
                event.preventDefault();
                event.stopPropagation();
                setCollapsed(itemId, !collapsedIds?.[id]);
                break;
              case "ArrowDown": {
                event.preventDefault();
                event.stopPropagation();
                if (index === items.length - 1) {
                  return;
                }
                const treeRoot = document.getElementById(id);
                const nextEl = treeRoot?.querySelector(
                  `.${kRecordTreeKey}[data-index="${index + 1}"]`
                );
                if (nextEl) {
                  nextEl.focus();
                }
                break;
              }
              case "ArrowUp": {
                event.preventDefault();
                event.stopPropagation();
                if (index === 0) {
                  return;
                }
                const treeRoot = document.getElementById(id);
                const prevEl = treeRoot?.querySelector(
                  `.${kRecordTreeKey}[data-index="${index - 1}"]`
                );
                if (prevEl) {
                  prevEl.focus();
                }
                break;
              }
              case "ArrowRight":
                event.preventDefault();
                event.stopPropagation();
                setCollapsed(itemId, false);
                break;
              case "ArrowLeft":
                event.preventDefault();
                event.stopPropagation();
                setCollapsed(itemId, true);
                break;
            }
          };
        },
        [collapsedIds, id, items.length, setCollapsed]
      );
      const renderRow = (index) => {
        const item2 = items[index];
        return /* @__PURE__ */ jsxRuntimeExports.jsxs(
          "div",
          {
            className: clsx(
              styles$1I.keyPairContainer,
              index < items.length - 1 && useBorders ? styles$1I.keyPairBordered : void 0,
              "text-size-small"
            ),
            style: {
              paddingLeft: `${item2.depth * 20}px`
            },
            children: [
              /* @__PURE__ */ jsxRuntimeExports.jsxs(
                "div",
                {
                  "data-index": index,
                  className: clsx(
                    kRecordTreeKey,
                    styles$1I.key,
                    "font-monospace",
                    "text-style-secondary"
                  ),
                  onKeyUp: keyUpHandler(item2.id, index),
                  tabIndex: 0,
                  onClick: () => {
                    setCollapsed(item2.id, !collapsedIds?.[item2.id]);
                  },
                  children: [
                    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: item2.hasChildren ? /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: clsx(styles$1I.pre), children: /* @__PURE__ */ jsxRuntimeExports.jsx(
                      "i",
                      {
                        className: clsx(
                          collapsedIds && collapsedIds[item2.id] ? ApplicationIcons.tree.closed : ApplicationIcons.tree.open,
                          styles$1I.treeIcon
                        )
                      }
                    ) }) : void 0 }),
                    /* @__PURE__ */ jsxRuntimeExports.jsxs("pre", { className: clsx(styles$1I.pre), children: [
                      item2.key,
                      ":"
                    ] })
                  ]
                }
              ),
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: item2.value !== null && (!item2.hasChildren || collapsedIds?.[item2.id]) ? /* @__PURE__ */ jsxRuntimeExports.jsx(
                ExpandablePanel,
                {
                  id: `${id}-collapse-${item2.id}`,
                  collapse: true,
                  lines: 15,
                  togglePosition: "block-left",
                  children: /* @__PURE__ */ jsxRuntimeExports.jsx(
                    RenderedContent,
                    {
                      id: `${id}-value-${item2.id}`,
                      entry: {
                        name: item2.key,
                        value: item2.value
                      },
                      renderOptions: { renderString: "pre" }
                    }
                  )
                }
              ) : void 0 })
            ]
          },
          item2.id
        );
      };
      if (!collapsedIds) {
        return null;
      }
      if (!scrollRef) {
        return /* @__PURE__ */ jsxRuntimeExports.jsx(
          "div",
          {
            id,
            className: clsx(className2, "samples-list"),
            style: { width: "100%" },
            tabIndex: 0,
            children: items.map((_, index) => renderRow(index))
          }
        );
      }
      return /* @__PURE__ */ jsxRuntimeExports.jsx(
        Yr,
        {
          ref: listHandle,
          customScrollParent: scrollRef?.current ? scrollRef.current : void 0,
          id,
          style: { width: "100%", height: "100%" },
          data: items,
          defaultItemHeight: 50,
          itemContent: renderRow,
          atBottomThreshold: 30,
          increaseViewportBy: { top: 300, bottom: 300 },
          overscan: {
            main: 10,
            reverse: 10
          },
          className: clsx(className2, "samples-list"),
          skipAnimationFrameInResizeObserver: true,
          restoreStateFrom: getRestoreState(),
          tabIndex: 0
        }
      );
    };
    const toTreeItems = (record, collapsedIds, recordProcessors = [], currentDepth = 0, currentPath = []) => {
      if (!record) {
        return [];
      }
      if (recordProcessors.length > 0) {
        for (const processor of recordProcessors) {
          record = processor(record);
        }
      }
      const result2 = [];
      Object.entries(record).forEach(([key2, value2], index) => {
        const itemSegment = index.toString();
        result2.push(
          ...processNodeRecursive(
            key2,
            value2,
            currentDepth,
            currentPath,
            itemSegment,
            collapsedIds
          )
        );
      });
      return result2;
    };
    const processNodeRecursive = (key2, value2, depth, parentPath, thisPath, collapsedIds) => {
      const items = [];
      const currentItemPath = [...parentPath, thisPath];
      const id = `${depth}.${currentItemPath.join(".")}`;
      if (isPrimitiveOrNull(value2)) {
        items.push({
          id,
          key: key2,
          value: value2 === void 0 ? null : value2,
          depth,
          hasChildren: false
        });
        return items;
      }
      let displayValue = null;
      let processChildren = false;
      if (Array.isArray(value2)) {
        processChildren = true;
        displayValue = `Array(${value2.length})`;
      } else if (typeof value2 === "object" && value2 !== null) {
        processChildren = true;
        displayValue = `Object(${Object.keys(value2).length})`;
      } else {
        displayValue = String(value2);
        processChildren = false;
      }
      items.push({ id, key: key2, value: displayValue, depth, hasChildren: true });
      if (processChildren && !collapsedIds[id]) {
        const childDepth = depth + 1;
        if (Array.isArray(value2)) {
          if (value2.length > 0) {
            value2.forEach((element, index) => {
              const elementKey = `[${index}]`;
              const elementIdentifier = `[${index}]`;
              items.push(
                ...processNodeRecursive(
                  elementKey,
                  element,
                  childDepth,
                  currentItemPath,
                  elementIdentifier,
                  collapsedIds
                )
              );
            });
          }
        } else if (typeof value2 === "object" && value2 !== null) {
          Object.entries(value2).forEach(
            ([childKey, childValue], index) => {
              const childIdentifier = index.toString();
              items.push(
                ...processNodeRecursive(
                  childKey,
                  childValue,
                  childDepth,
                  currentItemPath,
                  childIdentifier,
                  collapsedIds
                )
              );
            }
          );
        }
      }
      return items;
    };
    const isPrimitiveOrNull = (value2) => {
      return value2 === null || value2 === void 0 || typeof value2 === "string" || typeof value2 === "number" || typeof value2 === "boolean";
    };
    const decodeUrlParam = (param) => {
      if (!param) return param;
      try {
        return decodeURIComponent(param);
      } catch {
        return param;
      }
    };
    const useLogOrSampleRouteParams = () => {
      const location2 = useLocation();
      const logParams = useLogRouteParams();
      const sampleParams = useSamplesRouteParams();
      if (location2.pathname.startsWith("/samples/")) {
        return {
          logPath: sampleParams.samplesPath,
          id: sampleParams.sampleId,
          epoch: sampleParams.epoch,
          sampleTabId: sampleParams.tabId,
          tabId: void 0,
          uuid: void 0
        };
      } else {
        return {
          logPath: logParams.logPath,
          id: logParams.sampleId,
          epoch: logParams.epoch,
          tabId: logParams.tabId,
          sampleTabId: logParams.sampleTabId,
          uuid: logParams.sampleUuid
        };
      }
    };
    const useLogRouteParams = () => {
      const params = useParams();
      return reactExports.useMemo(() => {
        const splatPath = params["*"] || "";
        const sampleUuidMatch = splatPath.match(
          /^(.+?)\/samples\/sample_uuid\/([^/]+)(?:\/(.+?))?\/?\s*$/
        );
        if (sampleUuidMatch) {
          const [, logPath, sampleUuid, sampleTabId] = sampleUuidMatch;
          return {
            logPath: decodeUrlParam(logPath),
            tabId: void 0,
            sampleTabId: decodeUrlParam(sampleTabId),
            sampleId: void 0,
            epoch: void 0,
            sampleUuid: decodeUrlParam(sampleUuid)
          };
        }
        const fullSampleUrlMatch = splatPath.match(
          /^(.+?)\/samples\/sample\/([^/]+)(?:\/([^/]+)(?:\/(.+?))?)?\/?\s*$/
        );
        if (fullSampleUrlMatch) {
          const [, logPath, sampleId, epoch, sampleTabId] = fullSampleUrlMatch;
          return {
            logPath: decodeUrlParam(logPath),
            tabId: void 0,
            sampleTabId: decodeUrlParam(sampleTabId),
            sampleId: decodeUrlParam(sampleId),
            epoch: epoch ? decodeUrlParam(epoch) : void 0
          };
        }
        const sampleUrlMatch = splatPath.match(
          /^(.+?)\/samples(?:\/([^/]+)(?:\/([^/]+))?)?$/
        );
        if (sampleUrlMatch) {
          const [, logPath, firstSegment, secondSegment] = sampleUrlMatch;
          if (firstSegment) {
            const validSampleTabIds = new Set(kSampleTabIds);
            if (validSampleTabIds.has(firstSegment) && !secondSegment) {
              return {
                logPath: decodeUrlParam(logPath),
                tabId: "samples",
                sampleTabId: decodeUrlParam(firstSegment),
                sampleId: void 0,
                epoch: void 0
              };
            } else {
              return {
                logPath: decodeUrlParam(logPath),
                tabId: void 0,
                sampleTabId: void 0,
                sampleId: decodeUrlParam(firstSegment),
                epoch: secondSegment ? decodeUrlParam(secondSegment) : void 0
              };
            }
          } else {
            return {
              logPath: decodeUrlParam(logPath),
              tabId: "samples",
              sampleTabId: void 0,
              sampleId: void 0,
              epoch: void 0
            };
          }
        }
        const pathSegments = splatPath.split("/").filter(Boolean);
        if (pathSegments.length === 0) {
          return {
            logPath: void 0,
            tabId: void 0,
            sampleTabId: void 0,
            sampleId: void 0,
            epoch: void 0
          };
        }
        const validTabIds = new Set(kWorkspaceTabs);
        let tabIdIndex = -1;
        let foundTabId = void 0;
        for (let i2 = pathSegments.length - 1; i2 >= 0; i2--) {
          const segment2 = pathSegments[i2];
          const decodedSegment = decodeUrlParam(segment2) || segment2;
          if (validTabIds.has(decodedSegment)) {
            tabIdIndex = i2;
            foundTabId = decodedSegment;
            break;
          }
        }
        if (foundTabId && tabIdIndex > 0) {
          const pathSlice = pathSegments.slice(0, tabIdIndex);
          const firstSegment = pathSlice[0];
          const logPath = firstSegment?.endsWith(":") && !firstSegment.includes("://") ? firstSegment + (firstSegment === "file:" ? "///" : "//") + pathSlice.slice(1).join("/") : pathSlice.join("/");
          return {
            logPath: decodeUrlParam(logPath),
            tabId: foundTabId,
            sampleTabId: void 0,
            sampleId: void 0,
            epoch: void 0
          };
        } else {
          return {
            logPath: decodeUrlParam(splatPath),
            tabId: void 0,
            sampleTabId: void 0,
            sampleId: void 0,
            epoch: void 0
          };
        }
      }, [params]);
    };
    const useSamplesRouteParams = () => {
      const params = useParams();
      return reactExports.useMemo(() => {
        const splatPath = params["*"] || "";
        const sampleMatch = splatPath.match(
          /^(.+?)\/sample\/([^/]+)\/([^/]+)(?:\/([^/]+))?\/?$/
        );
        if (sampleMatch) {
          const [, logPath, sampleId, epoch, tabId] = sampleMatch;
          return {
            samplesPath: decodeUrlParam(logPath),
            sampleId: decodeUrlParam(sampleId),
            epoch: decodeUrlParam(epoch),
            tabId: tabId ? decodeUrlParam(tabId) : void 0
          };
        }
        return {
          samplesPath: splatPath ? decodeUrlParam(splatPath) : void 0,
          sampleId: void 0,
          epoch: void 0,
          tabId: void 0
        };
      }, [params]);
    };
    const kLogsRoutUrlPattern = "/logs";
    const kLogRouteUrlPattern = "/logs/*";
    const kSampleRouteUrlPattern = "/logs/*/samples/sample/:sampleId/:epoch?/:sampleTabId?";
    const kSampleUuidRouteUrlPattern = "/logs/*/samples/sample_uuid/:sampleUuid/:sampleTabId?";
    const baseUrl = (logPath, sampleId, sampleEpoch) => {
      if (sampleId !== void 0 && sampleEpoch !== void 0) {
        return logSamplesUrl(logPath, sampleId, sampleEpoch);
      } else {
        return logsUrl(logPath);
      }
    };
    const useSampleUrlBuilder = () => {
      const location2 = useLocation();
      return (logPath, sampleId, sampleEpoch, sampleTabId) => {
        if (sampleId && sampleEpoch && location2.pathname.startsWith("/samples/")) {
          return samplesSampleUrl(logPath, sampleId, sampleEpoch, sampleTabId);
        } else {
          return logSamplesUrl(logPath, sampleId, sampleEpoch, sampleTabId);
        }
      };
    };
    const logSamplesUrl = (logPath, sampleId, sampleEpoch, sampleTabId) => {
      const decodedLogPath = decodeUrlParam(logPath) || logPath;
      if (sampleId !== void 0 && sampleEpoch !== void 0) {
        return encodePathParts(
          `/logs/${decodedLogPath}/samples/sample/${sampleId}/${sampleEpoch}/${sampleTabId || ""}`
        );
      } else {
        return encodePathParts(
          `/logs/${decodedLogPath}/samples/${sampleTabId || ""}`
        );
      }
    };
    const samplesSampleUrl = (logPath, sampleId, epoch, sampleTabId) => {
      const decodedLogPath = decodeUrlParam(logPath) || logPath;
      return encodePathParts(
        `/samples/${decodedLogPath}/sample/${sampleId}/${epoch}/${sampleTabId || ""}`
      );
    };
    const sampleEventUrl = (builder, eventId, logPath, sampleId, sampleEpoch) => {
      const baseUrl2 = builder(
        logPath,
        sampleId,
        sampleEpoch,
        kSampleTranscriptTabId
      );
      return `${baseUrl2}?event=${eventId}`;
    };
    const useSampleMessageUrl = (messageId, sampleId, sampleEpoch) => {
      const {
        logPath: urlLogPath,
        id: urlSampleId,
        epoch: urlEpoch
      } = useLogOrSampleRouteParams();
      const builder = useSampleUrlBuilder();
      const log_file = useStore((state) => state.logs.selectedLogFile);
      const log_dir = useStore((state) => state.logs.logDir);
      let targetLogPath = urlLogPath;
      if (!targetLogPath && log_file) {
        targetLogPath = makeLogsPath(log_file, log_dir);
      }
      const messageUrl = reactExports.useMemo(() => {
        return messageId && targetLogPath ? sampleMessageUrl(
          builder,
          messageId,
          targetLogPath,
          urlSampleId,
          urlEpoch
        ) : void 0;
      }, [
        messageId,
        targetLogPath,
        builder,
        sampleId,
        urlSampleId,
        sampleEpoch,
        urlEpoch
      ]);
      return messageUrl;
    };
    const useSampleEventUrl = (eventId, sampleId, sampleEpoch) => {
      const {
        logPath: urlLogPath,
        id: urlSampleId,
        epoch: urlEpoch
      } = useLogOrSampleRouteParams();
      const builder = useSampleUrlBuilder();
      const log_file = useStore((state) => state.logs.selectedLogFile);
      const log_dir = useStore((state) => state.logs.logDir);
      let targetLogPath = urlLogPath;
      if (!targetLogPath && log_file) {
        targetLogPath = makeLogsPath(log_file, log_dir);
      }
      const eventUrl = reactExports.useMemo(() => {
        return targetLogPath ? sampleEventUrl(
          builder,
          eventId,
          targetLogPath,
          urlSampleId,
          urlEpoch
        ) : void 0;
      }, [
        targetLogPath,
        builder,
        eventId,
        sampleId,
        urlSampleId,
        sampleEpoch,
        urlEpoch
      ]);
      return eventUrl;
    };
    const sampleMessageUrl = (builder, messageId, logPath, sampleId, sampleEpoch) => {
      const baseUrl2 = builder(logPath, sampleId, sampleEpoch, kSampleMessagesTabId);
      return `${baseUrl2}?message=${messageId}`;
    };
    const samplesUrl = (log_file, log_dir) => {
      const path = makeLogsPath(log_file, log_dir);
      const decodedLogSegment = decodeUrlParam(path) || path;
      return encodePathParts(`/samples/${decodedLogSegment}`);
    };
    const logsUrl = (log_file, log_dir, tabId) => {
      return logsUrlRaw(makeLogsPath(log_file, log_dir), tabId);
    };
    const makeLogsPath = (log_file, log_dir) => {
      const pathSegment = directoryRelativeUrl(log_file, log_dir);
      return pathSegment;
    };
    const logsUrlRaw = (log_segment, tabId) => {
      const decodedLogSegment = decodeUrlParam(log_segment) || log_segment;
      if (tabId) {
        return encodePathParts(`/logs/${decodedLogSegment}/${tabId}`);
      } else {
        return encodePathParts(`/logs/${decodedLogSegment}`);
      }
    };
    const supportsLinking = () => {
      return location.hostname !== "localhost" && location.hostname !== "127.0.0.1" && location.protocol !== "vscode-webview:";
    };
    const toFullUrl = (path) => {
      return `${window.location.origin}${window.location.pathname}${window.location.search}#${path}`;
    };
    const message$3 = "_message_b8oe1_1";
    const systemRole = "_systemRole_b8oe1_8";
    const messageGrid = "_messageGrid_b8oe1_12";
    const toolMessageGrid = "_toolMessageGrid_b8oe1_20";
    const messageContents = "_messageContents_b8oe1_24";
    const indented = "_indented_b8oe1_29";
    const copyLink$1 = "_copyLink_b8oe1_33";
    const metadataLabel = "_metadataLabel_b8oe1_43";
    const hover$1 = "_hover_b8oe1_47";
    const styles$1H = {
      message: message$3,
      systemRole,
      messageGrid,
      toolMessageGrid,
      messageContents,
      indented,
      copyLink: copyLink$1,
      metadataLabel,
      hover: hover$1
    };
    const panel$7 = "_panel_1pa96_1";
    const code$5 = "_code_1pa96_7";
    const styles$1G = {
      panel: panel$7,
      code: code$5
    };
    const CodePanel = ({ code: code2, language: language2 = "json" }) => {
      const codeContainerRef = reactExports.useRef(null);
      usePrismHighlight(codeContainerRef, code2.length);
      return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: codeContainerRef, className: clsx(styles$1G.panel), children: /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: clsx(styles$1G.code), children: /* @__PURE__ */ jsxRuntimeExports.jsx("code", { className: clsx(`language-${language2}`), children: code2 }) }) });
    };
    class JsonWorkerPool {
      encoder = new TextEncoder();
      decoder = new TextDecoder();
      workers = [];
      blobURL = null;
      nextRequestId = 0;
      pendingRequests = /* @__PURE__ */ new Map();
      poolSize = 4;
      ensureWorkers() {
        if (this.workers.length === 0) {
          const blob = new Blob([kWorkerCode], { type: "application/javascript" });
          this.blobURL = URL.createObjectURL(blob);
          for (let i2 = 0; i2 < this.poolSize; i2++) {
            const worker = new Worker(this.blobURL);
            worker.onmessage = (e) => this.handleMessage(e);
            worker.onerror = (error2) => this.handleError(error2);
            this.workers.push(worker);
            worker.postMessage({
              type: "init",
              scriptContent: kJson5ScriptBase64
            });
          }
        }
      }
      handleMessage(e) {
        const { requestId, success: success2, serialized, result: result2, error: error2, stack: stack2 } = e.data;
        const pending = this.pendingRequests.get(requestId);
        if (!pending) return;
        this.pendingRequests.delete(requestId);
        if (success2) {
          if (serialized) {
            const resultString = this.decoder.decode(result2);
            pending.resolve(JSON.parse(resultString));
          } else {
            pending.resolve(result2);
          }
        } else {
          const err2 = new Error(error2);
          if (stack2) err2.stack = stack2;
          pending.reject(err2);
        }
      }
      handleError(error2) {
        const err2 = new Error(`Worker error: ${error2.message}`);
        for (const pending of this.pendingRequests.values()) {
          pending.reject(err2);
        }
        this.pendingRequests.clear();
      }
      async parse(text2) {
        this.ensureWorkers();
        const encodedText = this.encoder.encode(text2);
        const requestId = this.nextRequestId++;
        return new Promise((resolve, reject) => {
          this.pendingRequests.set(requestId, { resolve, reject });
          const worker = this.workers[requestId % this.workers.length];
          worker?.postMessage(
            {
              type: "parse",
              requestId,
              encodedText
            },
            [encodedText.buffer]
          );
        });
      }
      terminate() {
        this.workers.forEach((w) => w.terminate());
        this.workers = [];
        if (this.blobURL) {
          URL.revokeObjectURL(this.blobURL);
          this.blobURL = null;
        }
        this.pendingRequests.clear();
      }
    }
    const workerPool = new JsonWorkerPool();
    const asyncJsonParse = async (text2) => {
      if (text2.length < 5e4) {
        let result2 = void 0;
        try {
          result2 = JSON.parse(text2);
        } catch {
          result2 = lib$d.parse(text2);
        }
        return Promise.resolve(result2);
      } else {
        return workerPool.parse(text2);
      }
    };
    const jsonParse = (text2) => {
      try {
        return JSON.parse(text2);
      } catch {
        return lib$d.parse(text2);
      }
    };
    const kWorkerCode = `
// Store the JSON5 parser once loaded
let JSON5 = null;
const decoder = new TextDecoder();
const encoder = new TextEncoder();

self.onmessage = function (e) {
  const { type } = e.data || {};

  if (type === 'init') {
    const { scriptContent } = e.data;
    try {
      if (!JSON5) {
        const script = atob(scriptContent);
        new Function(script)();
        if (typeof self.JSON5 !== 'object' || typeof self.JSON5.parse !== 'function') {
          throw new Error('Failed to initialize JSON5 parser');
        }
        JSON5 = self.JSON5;
      }
    } catch (err) {
      // nothing to respond to yet; worker will fail on first parse if init failed
      console.error('JSON5 init error in worker', err);
    }
    return;
  }

  if (type === 'parse') {
    const { requestId, encodedText, scriptContent } = e.data;

    try {
      
      // Decode the text using TextDecoder
      const text = decoder.decode(encodedText);

      // Parse with JSON/JSON5
      let result = undefined;
      try {
        // Optimistically, try a regular JSON parse first (this is much faster)
        result = JSON.parse(text);
      } catch {
        result = JSON5.parse(text);
      }

      if (result && typeof result === 'object' &&
          (Array.isArray(result) ? result.length > 10000 : Object.keys(result).length > 10000)) {

        // Large result, use transferrable object
        const resultString = JSON.stringify(result);
        const serialized = encoder.encode(resultString);

        postMessage({
          requestId,
          success: true,
          serialized: true,
          result: serialized
        }, [serialized.buffer]);
      } else {
        // Small results, send directly
        postMessage({
          requestId,
          success: true, 
          serialized: false, 
          result: result 
        });
      }
    } catch (err) {
      postMessage({
        requestId,
        success: false, 
        error: err.message,
        stack: err.stack || ''
      });
    }
  }
};`;
    const kJson5ScriptBase64 = ` `;
    const decodeCache = {};
    function getDecodeCache(exclude) {
      let cache = decodeCache[exclude];
      if (cache) {
        return cache;
      }
      cache = decodeCache[exclude] = [];
      for (let i2 = 0; i2 < 128; i2++) {
        const ch3 = String.fromCharCode(i2);
        cache.push(ch3);
      }
      for (let i2 = 0; i2 < exclude.length; i2++) {
        const ch3 = exclude.charCodeAt(i2);
        cache[ch3] = "%" + ("0" + ch3.toString(16).toUpperCase()).slice(-2);
      }
      return cache;
    }
    function decode$2(string2, exclude) {
      if (typeof exclude !== "string") {
        exclude = decode$2.defaultChars;
      }
      const cache = getDecodeCache(exclude);
      return string2.replace(/(%[a-f0-9]{2})+/gi, function(seq) {
        let result2 = "";
        for (let i2 = 0, l = seq.length; i2 < l; i2 += 3) {
          const b1 = parseInt(seq.slice(i2 + 1, i2 + 3), 16);
          if (b1 < 128) {
            result2 += cache[b1];
            continue;
          }
          if ((b1 & 224) === 192 && i2 + 3 < l) {
            const b2 = parseInt(seq.slice(i2 + 4, i2 + 6), 16);
            if ((b2 & 192) === 128) {
              const chr = b1 << 6 & 1984 | b2 & 63;
              if (chr < 128) {
                result2 += "��";
              } else {
                result2 += String.fromCharCode(chr);
              }
              i2 += 3;
              continue;
            }
          }
          if ((b1 & 240) === 224 && i2 + 6 < l) {
            const b2 = parseInt(seq.slice(i2 + 4, i2 + 6), 16);
            const b3 = parseInt(seq.slice(i2 + 7, i2 + 9), 16);
            if ((b2 & 192) === 128 && (b3 & 192) === 128) {
              const chr = b1 << 12 & 61440 | b2 << 6 & 4032 | b3 & 63;
              if (chr < 2048 || chr >= 55296 && chr <= 57343) {
                result2 += "���";
              } else {
                result2 += String.fromCharCode(chr);
              }
              i2 += 6;
              continue;
            }
          }
          if ((b1 & 248) === 240 && i2 + 9 < l) {
            const b2 = parseInt(seq.slice(i2 + 4, i2 + 6), 16);
            const b3 = parseInt(seq.slice(i2 + 7, i2 + 9), 16);
            const b4 = parseInt(seq.slice(i2 + 10, i2 + 12), 16);
            if ((b2 & 192) === 128 && (b3 & 192) === 128 && (b4 & 192) === 128) {
              let chr = b1 << 18 & 1835008 | b2 << 12 & 258048 | b3 << 6 & 4032 | b4 & 63;
              if (chr < 65536 || chr > 1114111) {
                result2 += "����";
              } else {
                chr -= 65536;
                result2 += String.fromCharCode(55296 + (chr >> 10), 56320 + (chr & 1023));
              }
              i2 += 9;
              continue;
            }
          }
          result2 += "�";
        }
        return result2;
      });
    }
    decode$2.defaultChars = ";/?:@&=+$,#";
    decode$2.componentChars = "";
    const encodeCache = {};
    function getEncodeCache(exclude) {
      let cache = encodeCache[exclude];
      if (cache) {
        return cache;
      }
      cache = encodeCache[exclude] = [];
      for (let i2 = 0; i2 < 128; i2++) {
        const ch3 = String.fromCharCode(i2);
        if (/^[0-9a-z]$/i.test(ch3)) {
          cache.push(ch3);
        } else {
          cache.push("%" + ("0" + i2.toString(16).toUpperCase()).slice(-2));
        }
      }
      for (let i2 = 0; i2 < exclude.length; i2++) {
        cache[exclude.charCodeAt(i2)] = exclude[i2];
      }
      return cache;
    }
    function encode$2(string2, exclude, keepEscaped) {
      if (typeof exclude !== "string") {
        keepEscaped = exclude;
        exclude = encode$2.defaultChars;
      }
      if (typeof keepEscaped === "undefined") {
        keepEscaped = true;
      }
      const cache = getEncodeCache(exclude);
      let result2 = "";
      for (let i2 = 0, l = string2.length; i2 < l; i2++) {
        const code2 = string2.charCodeAt(i2);
        if (keepEscaped && code2 === 37 && i2 + 2 < l) {
          if (/^[0-9a-f]{2}$/i.test(string2.slice(i2 + 1, i2 + 3))) {
            result2 += string2.slice(i2, i2 + 3);
            i2 += 2;
            continue;
          }
        }
        if (code2 < 128) {
          result2 += cache[code2];
          continue;
        }
        if (code2 >= 55296 && code2 <= 57343) {
          if (code2 >= 55296 && code2 <= 56319 && i2 + 1 < l) {
            const nextCode = string2.charCodeAt(i2 + 1);
            if (nextCode >= 56320 && nextCode <= 57343) {
              result2 += encodeURIComponent(string2[i2] + string2[i2 + 1]);
              i2++;
              continue;
            }
          }
          result2 += "%EF%BF%BD";
          continue;
        }
        result2 += encodeURIComponent(string2[i2]);
      }
      return result2;
    }
    encode$2.defaultChars = ";/?:@&=+$,-_.!~*'()#";
    encode$2.componentChars = "-_.!~*'()";
    function format$1(url) {
      let result2 = "";
      result2 += url.protocol || "";
      result2 += url.slashes ? "//" : "";
      result2 += url.auth ? url.auth + "@" : "";
      if (url.hostname && url.hostname.indexOf(":") !== -1) {
        result2 += "[" + url.hostname + "]";
      } else {
        result2 += url.hostname || "";
      }
      result2 += url.port ? ":" + url.port : "";
      result2 += url.pathname || "";
      result2 += url.search || "";
      result2 += url.hash || "";
      return result2;
    }
    function Url() {
      this.protocol = null;
      this.slashes = null;
      this.auth = null;
      this.port = null;
      this.hostname = null;
      this.hash = null;
      this.search = null;
      this.pathname = null;
    }
    const protocolPattern = /^([a-z0-9.+-]+:)/i;
    const portPattern = /:[0-9]*$/;
    const simplePathPattern = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/;
    const delims = ["<", ">", '"', "`", " ", "\r", "\n", "	"];
    const unwise = ["{", "}", "|", "\\", "^", "`"].concat(delims);
    const autoEscape = ["'"].concat(unwise);
    const nonHostChars = ["%", "/", "?", ";", "#"].concat(autoEscape);
    const hostEndingChars = ["/", "?", "#"];
    const hostnameMaxLen = 255;
    const hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/;
    const hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/;
    const hostlessProtocol = {
      javascript: true,
      "javascript:": true
    };
    const slashedProtocol = {
      http: true,
      https: true,
      ftp: true,
      gopher: true,
      file: true,
      "http:": true,
      "https:": true,
      "ftp:": true,
      "gopher:": true,
      "file:": true
    };
    function urlParse(url, slashesDenoteHost) {
      if (url && url instanceof Url) return url;
      const u = new Url();
      u.parse(url, slashesDenoteHost);
      return u;
    }
    Url.prototype.parse = function(url, slashesDenoteHost) {
      let lowerProto, hec, slashes;
      let rest = url;
      rest = rest.trim();
      if (!slashesDenoteHost && url.split("#").length === 1) {
        const simplePath = simplePathPattern.exec(rest);
        if (simplePath) {
          this.pathname = simplePath[1];
          if (simplePath[2]) {
            this.search = simplePath[2];
          }
          return this;
        }
      }
      let proto = protocolPattern.exec(rest);
      if (proto) {
        proto = proto[0];
        lowerProto = proto.toLowerCase();
        this.protocol = proto;
        rest = rest.substr(proto.length);
      }
      if (slashesDenoteHost || proto || rest.match(/^\/\/[^@\/]+@[^@\/]+/)) {
        slashes = rest.substr(0, 2) === "//";
        if (slashes && !(proto && hostlessProtocol[proto])) {
          rest = rest.substr(2);
          this.slashes = true;
        }
      }
      if (!hostlessProtocol[proto] && (slashes || proto && !slashedProtocol[proto])) {
        let hostEnd = -1;
        for (let i2 = 0; i2 < hostEndingChars.length; i2++) {
          hec = rest.indexOf(hostEndingChars[i2]);
          if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) {
            hostEnd = hec;
          }
        }
        let auth, atSign;
        if (hostEnd === -1) {
          atSign = rest.lastIndexOf("@");
        } else {
          atSign = rest.lastIndexOf("@", hostEnd);
        }
        if (atSign !== -1) {
          auth = rest.slice(0, atSign);
          rest = rest.slice(atSign + 1);
          this.auth = auth;
        }
        hostEnd = -1;
        for (let i2 = 0; i2 < nonHostChars.length; i2++) {
          hec = rest.indexOf(nonHostChars[i2]);
          if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) {
            hostEnd = hec;
          }
        }
        if (hostEnd === -1) {
          hostEnd = rest.length;
        }
        if (rest[hostEnd - 1] === ":") {
          hostEnd--;
        }
        const host = rest.slice(0, hostEnd);
        rest = rest.slice(hostEnd);
        this.parseHost(host);
        this.hostname = this.hostname || "";
        const ipv6Hostname = this.hostname[0] === "[" && this.hostname[this.hostname.length - 1] === "]";
        if (!ipv6Hostname) {
          const hostparts = this.hostname.split(/\./);
          for (let i2 = 0, l = hostparts.length; i2 < l; i2++) {
            const part2 = hostparts[i2];
            if (!part2) {
              continue;
            }
            if (!part2.match(hostnamePartPattern)) {
              let newpart = "";
              for (let j = 0, k2 = part2.length; j < k2; j++) {
                if (part2.charCodeAt(j) > 127) {
                  newpart += "x";
                } else {
                  newpart += part2[j];
                }
              }
              if (!newpart.match(hostnamePartPattern)) {
                const validParts = hostparts.slice(0, i2);
                const notHost = hostparts.slice(i2 + 1);
                const bit = part2.match(hostnamePartStart);
                if (bit) {
                  validParts.push(bit[1]);
                  notHost.unshift(bit[2]);
                }
                if (notHost.length) {
                  rest = notHost.join(".") + rest;
                }
                this.hostname = validParts.join(".");
                break;
              }
            }
          }
        }
        if (this.hostname.length > hostnameMaxLen) {
          this.hostname = "";
        }
        if (ipv6Hostname) {
          this.hostname = this.hostname.substr(1, this.hostname.length - 2);
        }
      }
      const hash2 = rest.indexOf("#");
      if (hash2 !== -1) {
        this.hash = rest.substr(hash2);
        rest = rest.slice(0, hash2);
      }
      const qm = rest.indexOf("?");
      if (qm !== -1) {
        this.search = rest.substr(qm);
        rest = rest.slice(0, qm);
      }
      if (rest) {
        this.pathname = rest;
      }
      if (slashedProtocol[lowerProto] && this.hostname && !this.pathname) {
        this.pathname = "";
      }
      return this;
    };
    Url.prototype.parseHost = function(host) {
      let port = portPattern.exec(host);
      if (port) {
        port = port[0];
        if (port !== ":") {
          this.port = port.substr(1);
        }
        host = host.substr(0, host.length - port.length);
      }
      if (host) {
        this.hostname = host;
      }
    };
    const mdurl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
      __proto__: null,
      decode: decode$2,
      encode: encode$2,
      format: format$1,
      parse: urlParse
    }, Symbol.toStringTag, { value: "Module" }));
    const Any = /[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;
    const Cc = /[\0-\x1F\x7F-\x9F]/;
    const regex$1 = /[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/;
    const P = /[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/;
    const regex = /[\$\+<->\^`\|~\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\u0888\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-\u20C0\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-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\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-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/;
    const Z = /[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/;
    const ucmicro = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
      __proto__: null,
      Any,
      Cc,
      Cf: regex$1,
      P,
      S: regex,
      Z
    }, Symbol.toStringTag, { value: "Module" }));
    const htmlDecodeTree = new Uint16Array(
      // prettier-ignore
      'ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\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((c2) => c2.charCodeAt(0))
    );
    const xmlDecodeTree = new Uint16Array(
      // prettier-ignore
      "Ȁaglq	\x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map((c2) => c2.charCodeAt(0))
    );
    var _a$6;
    const decodeMap = /* @__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]
    ]);
    const fromCodePoint$2 = (
      // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition, node/no-unsupported-features/es-builtins
      (_a$6 = String.fromCodePoint) !== null && _a$6 !== void 0 ? _a$6 : function(codePoint) {
        let output2 = "";
        if (codePoint > 65535) {
          codePoint -= 65536;
          output2 += String.fromCharCode(codePoint >>> 10 & 1023 | 55296);
          codePoint = 56320 | codePoint & 1023;
        }
        output2 += String.fromCharCode(codePoint);
        return output2;
      }
    );
    function replaceCodePoint(codePoint) {
      var _a2;
      if (codePoint >= 55296 && codePoint <= 57343 || codePoint > 1114111) {
        return 65533;
      }
      return (_a2 = decodeMap.get(codePoint)) !== null && _a2 !== void 0 ? _a2 : codePoint;
    }
    var CharCodes;
    (function(CharCodes2) {
      CharCodes2[CharCodes2["NUM"] = 35] = "NUM";
      CharCodes2[CharCodes2["SEMI"] = 59] = "SEMI";
      CharCodes2[CharCodes2["EQUALS"] = 61] = "EQUALS";
      CharCodes2[CharCodes2["ZERO"] = 48] = "ZERO";
      CharCodes2[CharCodes2["NINE"] = 57] = "NINE";
      CharCodes2[CharCodes2["LOWER_A"] = 97] = "LOWER_A";
      CharCodes2[CharCodes2["LOWER_F"] = 102] = "LOWER_F";
      CharCodes2[CharCodes2["LOWER_X"] = 120] = "LOWER_X";
      CharCodes2[CharCodes2["LOWER_Z"] = 122] = "LOWER_Z";
      CharCodes2[CharCodes2["UPPER_A"] = 65] = "UPPER_A";
      CharCodes2[CharCodes2["UPPER_F"] = 70] = "UPPER_F";
      CharCodes2[CharCodes2["UPPER_Z"] = 90] = "UPPER_Z";
    })(CharCodes || (CharCodes = {}));
    const TO_LOWER_BIT = 32;
    var BinTrieFlags;
    (function(BinTrieFlags2) {
      BinTrieFlags2[BinTrieFlags2["VALUE_LENGTH"] = 49152] = "VALUE_LENGTH";
      BinTrieFlags2[BinTrieFlags2["BRANCH_LENGTH"] = 16256] = "BRANCH_LENGTH";
      BinTrieFlags2[BinTrieFlags2["JUMP_TABLE"] = 127] = "JUMP_TABLE";
    })(BinTrieFlags || (BinTrieFlags = {}));
    function isNumber(code2) {
      return code2 >= CharCodes.ZERO && code2 <= CharCodes.NINE;
    }
    function isHexadecimalCharacter(code2) {
      return code2 >= CharCodes.UPPER_A && code2 <= CharCodes.UPPER_F || code2 >= CharCodes.LOWER_A && code2 <= CharCodes.LOWER_F;
    }
    function isAsciiAlphaNumeric(code2) {
      return code2 >= CharCodes.UPPER_A && code2 <= CharCodes.UPPER_Z || code2 >= CharCodes.LOWER_A && code2 <= CharCodes.LOWER_Z || isNumber(code2);
    }
    function isEntityInAttributeInvalidEnd(code2) {
      return code2 === CharCodes.EQUALS || isAsciiAlphaNumeric(code2);
    }
    var EntityDecoderState;
    (function(EntityDecoderState2) {
      EntityDecoderState2[EntityDecoderState2["EntityStart"] = 0] = "EntityStart";
      EntityDecoderState2[EntityDecoderState2["NumericStart"] = 1] = "NumericStart";
      EntityDecoderState2[EntityDecoderState2["NumericDecimal"] = 2] = "NumericDecimal";
      EntityDecoderState2[EntityDecoderState2["NumericHex"] = 3] = "NumericHex";
      EntityDecoderState2[EntityDecoderState2["NamedEntity"] = 4] = "NamedEntity";
    })(EntityDecoderState || (EntityDecoderState = {}));
    var DecodingMode;
    (function(DecodingMode2) {
      DecodingMode2[DecodingMode2["Legacy"] = 0] = "Legacy";
      DecodingMode2[DecodingMode2["Strict"] = 1] = "Strict";
      DecodingMode2[DecodingMode2["Attribute"] = 2] = "Attribute";
    })(DecodingMode || (DecodingMode = {}));
    class EntityDecoder {
      constructor(decodeTree, emitCodePoint, errors2) {
        this.decodeTree = decodeTree;
        this.emitCodePoint = emitCodePoint;
        this.errors = errors2;
        this.state = EntityDecoderState.EntityStart;
        this.consumed = 1;
        this.result = 0;
        this.treeIndex = 0;
        this.excess = 1;
        this.decodeMode = DecodingMode.Strict;
      }
      /** Resets the instance to make it reusable. */
      startEntity(decodeMode) {
        this.decodeMode = decodeMode;
        this.state = EntityDecoderState.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 string 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(str2, offset2) {
        switch (this.state) {
          case EntityDecoderState.EntityStart: {
            if (str2.charCodeAt(offset2) === CharCodes.NUM) {
              this.state = EntityDecoderState.NumericStart;
              this.consumed += 1;
              return this.stateNumericStart(str2, offset2 + 1);
            }
            this.state = EntityDecoderState.NamedEntity;
            return this.stateNamedEntity(str2, offset2);
          }
          case EntityDecoderState.NumericStart: {
            return this.stateNumericStart(str2, offset2);
          }
          case EntityDecoderState.NumericDecimal: {
            return this.stateNumericDecimal(str2, offset2);
          }
          case EntityDecoderState.NumericHex: {
            return this.stateNumericHex(str2, offset2);
          }
          case EntityDecoderState.NamedEntity: {
            return this.stateNamedEntity(str2, offset2);
          }
        }
      }
      /**
       * Switches between the numeric decimal and hexadecimal states.
       *
       * Equivalent to the `Numeric character reference state` in the HTML spec.
       *
       * @param str 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(str2, offset2) {
        if (offset2 >= str2.length) {
          return -1;
        }
        if ((str2.charCodeAt(offset2) | TO_LOWER_BIT) === CharCodes.LOWER_X) {
          this.state = EntityDecoderState.NumericHex;
          this.consumed += 1;
          return this.stateNumericHex(str2, offset2 + 1);
        }
        this.state = EntityDecoderState.NumericDecimal;
        return this.stateNumericDecimal(str2, offset2);
      }
      addToNumericResult(str2, start2, end2, base2) {
        if (start2 !== end2) {
          const digitCount = end2 - start2;
          this.result = this.result * Math.pow(base2, digitCount) + parseInt(str2.substr(start2, digitCount), base2);
          this.consumed += digitCount;
        }
      }
      /**
       * Parses a hexadecimal numeric entity.
       *
       * Equivalent to the `Hexademical character reference state` in the HTML spec.
       *
       * @param str 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(str2, offset2) {
        const startIdx = offset2;
        while (offset2 < str2.length) {
          const char = str2.charCodeAt(offset2);
          if (isNumber(char) || isHexadecimalCharacter(char)) {
            offset2 += 1;
          } else {
            this.addToNumericResult(str2, startIdx, offset2, 16);
            return this.emitNumericEntity(char, 3);
          }
        }
        this.addToNumericResult(str2, startIdx, offset2, 16);
        return -1;
      }
      /**
       * Parses a decimal numeric entity.
       *
       * Equivalent to the `Decimal character reference state` in the HTML spec.
       *
       * @param str 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(str2, offset2) {
        const startIdx = offset2;
        while (offset2 < str2.length) {
          const char = str2.charCodeAt(offset2);
          if (isNumber(char)) {
            offset2 += 1;
          } else {
            this.addToNumericResult(str2, startIdx, offset2, 10);
            return this.emitNumericEntity(char, 2);
          }
        }
        this.addToNumericResult(str2, startIdx, offset2, 10);
        return -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(lastCp, expectedLength) {
        var _a2;
        if (this.consumed <= expectedLength) {
          (_a2 = this.errors) === null || _a2 === void 0 ? void 0 : _a2.absenceOfDigitsInNumericCharacterReference(this.consumed);
          return 0;
        }
        if (lastCp === CharCodes.SEMI) {
          this.consumed += 1;
        } else if (this.decodeMode === DecodingMode.Strict) {
          return 0;
        }
        this.emitCodePoint(replaceCodePoint(this.result), this.consumed);
        if (this.errors) {
          if (lastCp !== CharCodes.SEMI) {
            this.errors.missingSemicolonAfterCharacterReference();
          }
          this.errors.validateNumericCharacterReference(this.result);
        }
        return this.consumed;
      }
      /**
       * Parses a named entity.
       *
       * Equivalent to the `Named character reference state` in the HTML spec.
       *
       * @param str 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(str2, offset2) {
        const { decodeTree } = this;
        let current2 = decodeTree[this.treeIndex];
        let valueLength = (current2 & BinTrieFlags.VALUE_LENGTH) >> 14;
        for (; offset2 < str2.length; offset2++, this.excess++) {
          const char = str2.charCodeAt(offset2);
          this.treeIndex = determineBranch(decodeTree, current2, this.treeIndex + Math.max(1, valueLength), char);
          if (this.treeIndex < 0) {
            return this.result === 0 || // If we are parsing an attribute
            this.decodeMode === DecodingMode.Attribute && // We shouldn't have consumed any characters after the entity,
            (valueLength === 0 || // And there should be no invalid characters.
            isEntityInAttributeInvalidEnd(char)) ? 0 : this.emitNotTerminatedNamedEntity();
          }
          current2 = decodeTree[this.treeIndex];
          valueLength = (current2 & BinTrieFlags.VALUE_LENGTH) >> 14;
          if (valueLength !== 0) {
            if (char === CharCodes.SEMI) {
              return this.emitNamedEntityData(this.treeIndex, valueLength, this.consumed + this.excess);
            }
            if (this.decodeMode !== DecodingMode.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 _a2;
        const { result: result2, decodeTree } = this;
        const valueLength = (decodeTree[result2] & BinTrieFlags.VALUE_LENGTH) >> 14;
        this.emitNamedEntityData(result2, valueLength, this.consumed);
        (_a2 = this.errors) === null || _a2 === void 0 ? void 0 : _a2.missingSemicolonAfterCharacterReference();
        return 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(result2, valueLength, consumed) {
        const { decodeTree } = this;
        this.emitCodePoint(valueLength === 1 ? decodeTree[result2] & ~BinTrieFlags.VALUE_LENGTH : decodeTree[result2 + 1], consumed);
        if (valueLength === 3) {
          this.emitCodePoint(decodeTree[result2 + 2], consumed);
        }
        return consumed;
      }
      /**
       * 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 _a2;
        switch (this.state) {
          case EntityDecoderState.NamedEntity: {
            return this.result !== 0 && (this.decodeMode !== DecodingMode.Attribute || this.result === this.treeIndex) ? this.emitNotTerminatedNamedEntity() : 0;
          }
          // Otherwise, emit a numeric entity if we have one.
          case EntityDecoderState.NumericDecimal: {
            return this.emitNumericEntity(0, 2);
          }
          case EntityDecoderState.NumericHex: {
            return this.emitNumericEntity(0, 3);
          }
          case EntityDecoderState.NumericStart: {
            (_a2 = this.errors) === null || _a2 === void 0 ? void 0 : _a2.absenceOfDigitsInNumericCharacterReference(this.consumed);
            return 0;
          }
          case EntityDecoderState.EntityStart: {
            return 0;
          }
        }
      }
    }
    function getDecoder(decodeTree) {
      let ret = "";
      const decoder = new EntityDecoder(decodeTree, (str2) => ret += fromCodePoint$2(str2));
      return function decodeWithTrie(str2, decodeMode) {
        let lastIndex = 0;
        let offset2 = 0;
        while ((offset2 = str2.indexOf("&", offset2)) >= 0) {
          ret += str2.slice(lastIndex, offset2);
          decoder.startEntity(decodeMode);
          const len = decoder.write(
            str2,
            // Skip the "&"
            offset2 + 1
          );
          if (len < 0) {
            lastIndex = offset2 + decoder.end();
            break;
          }
          lastIndex = offset2 + len;
          offset2 = len === 0 ? lastIndex + 1 : lastIndex;
        }
        const result2 = ret + str2.slice(lastIndex);
        ret = "";
        return result2;
      };
    }
    function determineBranch(decodeTree, current2, nodeIdx, char) {
      const branchCount = (current2 & BinTrieFlags.BRANCH_LENGTH) >> 7;
      const jumpOffset = current2 & BinTrieFlags.JUMP_TABLE;
      if (branchCount === 0) {
        return jumpOffset !== 0 && char === jumpOffset ? nodeIdx : -1;
      }
      if (jumpOffset) {
        const value2 = char - jumpOffset;
        return value2 < 0 || value2 >= branchCount ? -1 : decodeTree[nodeIdx + value2] - 1;
      }
      let lo2 = nodeIdx;
      let hi = lo2 + branchCount - 1;
      while (lo2 <= hi) {
        const mid2 = lo2 + hi >>> 1;
        const midVal = decodeTree[mid2];
        if (midVal < char) {
          lo2 = mid2 + 1;
        } else if (midVal > char) {
          hi = mid2 - 1;
        } else {
          return decodeTree[mid2 + branchCount];
        }
      }
      return -1;
    }
    const htmlDecoder = getDecoder(htmlDecodeTree);
    getDecoder(xmlDecodeTree);
    function decodeHTML(str2, mode = DecodingMode.Legacy) {
      return htmlDecoder(str2, mode);
    }
    function _class$1(obj) {
      return Object.prototype.toString.call(obj);
    }
    function isString$1(obj) {
      return _class$1(obj) === "[object String]";
    }
    const _hasOwnProperty = Object.prototype.hasOwnProperty;
    function has(object, key2) {
      return _hasOwnProperty.call(object, key2);
    }
    function assign$1(obj) {
      const sources = Array.prototype.slice.call(arguments, 1);
      sources.forEach(function(source2) {
        if (!source2) {
          return;
        }
        if (typeof source2 !== "object") {
          throw new TypeError(source2 + "must be object");
        }
        Object.keys(source2).forEach(function(key2) {
          obj[key2] = source2[key2];
        });
      });
      return obj;
    }
    function arrayReplaceAt(src, pos2, newElements) {
      return [].concat(src.slice(0, pos2), newElements, src.slice(pos2 + 1));
    }
    function isValidEntityCode(c2) {
      if (c2 >= 55296 && c2 <= 57343) {
        return false;
      }
      if (c2 >= 64976 && c2 <= 65007) {
        return false;
      }
      if ((c2 & 65535) === 65535 || (c2 & 65535) === 65534) {
        return false;
      }
      if (c2 >= 0 && c2 <= 8) {
        return false;
      }
      if (c2 === 11) {
        return false;
      }
      if (c2 >= 14 && c2 <= 31) {
        return false;
      }
      if (c2 >= 127 && c2 <= 159) {
        return false;
      }
      if (c2 > 1114111) {
        return false;
      }
      return true;
    }
    function fromCodePoint$1(c2) {
      if (c2 > 65535) {
        c2 -= 65536;
        const surrogate1 = 55296 + (c2 >> 10);
        const surrogate2 = 56320 + (c2 & 1023);
        return String.fromCharCode(surrogate1, surrogate2);
      }
      return String.fromCharCode(c2);
    }
    const UNESCAPE_MD_RE = /\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g;
    const ENTITY_RE = /&([a-z#][a-z0-9]{1,31});/gi;
    const UNESCAPE_ALL_RE = new RegExp(UNESCAPE_MD_RE.source + "|" + ENTITY_RE.source, "gi");
    const DIGITAL_ENTITY_TEST_RE = /^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;
    function replaceEntityPattern(match, name2) {
      if (name2.charCodeAt(0) === 35 && DIGITAL_ENTITY_TEST_RE.test(name2)) {
        const code2 = name2[1].toLowerCase() === "x" ? parseInt(name2.slice(2), 16) : parseInt(name2.slice(1), 10);
        if (isValidEntityCode(code2)) {
          return fromCodePoint$1(code2);
        }
        return match;
      }
      const decoded = decodeHTML(match);
      if (decoded !== match) {
        return decoded;
      }
      return match;
    }
    function unescapeMd(str2) {
      if (str2.indexOf("\\") < 0) {
        return str2;
      }
      return str2.replace(UNESCAPE_MD_RE, "$1");
    }
    function unescapeAll(str2) {
      if (str2.indexOf("\\") < 0 && str2.indexOf("&") < 0) {
        return str2;
      }
      return str2.replace(UNESCAPE_ALL_RE, function(match, escaped, entity2) {
        if (escaped) {
          return escaped;
        }
        return replaceEntityPattern(match, entity2);
      });
    }
    const HTML_ESCAPE_TEST_RE = /[&<>"]/;
    const HTML_ESCAPE_REPLACE_RE = /[&<>"]/g;
    const HTML_REPLACEMENTS = {
      "&": "&amp;",
      "<": "&lt;",
      ">": "&gt;",
      '"': "&quot;"
    };
    function replaceUnsafeChar(ch3) {
      return HTML_REPLACEMENTS[ch3];
    }
    function escapeHtml(str2) {
      if (HTML_ESCAPE_TEST_RE.test(str2)) {
        return str2.replace(HTML_ESCAPE_REPLACE_RE, replaceUnsafeChar);
      }
      return str2;
    }
    const REGEXP_ESCAPE_RE = /[.?*+^$[\]\\(){}|-]/g;
    function escapeRE$1(str2) {
      return str2.replace(REGEXP_ESCAPE_RE, "\\$&");
    }
    function isSpace(code2) {
      switch (code2) {
        case 9:
        case 32:
          return true;
      }
      return false;
    }
    function isWhiteSpace(code2) {
      if (code2 >= 8192 && code2 <= 8202) {
        return true;
      }
      switch (code2) {
        case 9:
        // \t
        case 10:
        // \n
        case 11:
        // \v
        case 12:
        // \f
        case 13:
        // \r
        case 32:
        case 160:
        case 5760:
        case 8239:
        case 8287:
        case 12288:
          return true;
      }
      return false;
    }
    function isPunctChar(ch3) {
      return P.test(ch3) || regex.test(ch3);
    }
    function isMdAsciiPunct(ch3) {
      switch (ch3) {
        case 33:
        case 34:
        case 35:
        case 36:
        case 37:
        case 38:
        case 39:
        case 40:
        case 41:
        case 42:
        case 43:
        case 44:
        case 45:
        case 46:
        case 47:
        case 58:
        case 59:
        case 60:
        case 61:
        case 62:
        case 63:
        case 64:
        case 91:
        case 92:
        case 93:
        case 94:
        case 95:
        case 96:
        case 123:
        case 124:
        case 125:
        case 126:
          return true;
        default:
          return false;
      }
    }
    function normalizeReference(str2) {
      str2 = str2.trim().replace(/\s+/g, " ");
      if ("ẞ".toLowerCase() === "Ṿ") {
        str2 = str2.replace(/ẞ/g, "ß");
      }
      return str2.toLowerCase().toUpperCase();
    }
    const lib$c = { mdurl, ucmicro };
    const utils$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
      __proto__: null,
      arrayReplaceAt,
      assign: assign$1,
      escapeHtml,
      escapeRE: escapeRE$1,
      fromCodePoint: fromCodePoint$1,
      has,
      isMdAsciiPunct,
      isPunctChar,
      isSpace,
      isString: isString$1,
      isValidEntityCode,
      isWhiteSpace,
      lib: lib$c,
      normalizeReference,
      unescapeAll,
      unescapeMd
    }, Symbol.toStringTag, { value: "Module" }));
    function parseLinkLabel(state, start2, disableNested) {
      let level, found, marker2, prevPos;
      const max2 = state.posMax;
      const oldPos = state.pos;
      state.pos = start2 + 1;
      level = 1;
      while (state.pos < max2) {
        marker2 = state.src.charCodeAt(state.pos);
        if (marker2 === 93) {
          level--;
          if (level === 0) {
            found = true;
            break;
          }
        }
        prevPos = state.pos;
        state.md.inline.skipToken(state);
        if (marker2 === 91) {
          if (prevPos === state.pos - 1) {
            level++;
          } else if (disableNested) {
            state.pos = oldPos;
            return -1;
          }
        }
      }
      let labelEnd = -1;
      if (found) {
        labelEnd = state.pos;
      }
      state.pos = oldPos;
      return labelEnd;
    }
    function parseLinkDestination(str2, start2, max2) {
      let code2;
      let pos2 = start2;
      const result2 = {
        ok: false,
        pos: 0,
        str: ""
      };
      if (str2.charCodeAt(pos2) === 60) {
        pos2++;
        while (pos2 < max2) {
          code2 = str2.charCodeAt(pos2);
          if (code2 === 10) {
            return result2;
          }
          if (code2 === 60) {
            return result2;
          }
          if (code2 === 62) {
            result2.pos = pos2 + 1;
            result2.str = unescapeAll(str2.slice(start2 + 1, pos2));
            result2.ok = true;
            return result2;
          }
          if (code2 === 92 && pos2 + 1 < max2) {
            pos2 += 2;
            continue;
          }
          pos2++;
        }
        return result2;
      }
      let level = 0;
      while (pos2 < max2) {
        code2 = str2.charCodeAt(pos2);
        if (code2 === 32) {
          break;
        }
        if (code2 < 32 || code2 === 127) {
          break;
        }
        if (code2 === 92 && pos2 + 1 < max2) {
          if (str2.charCodeAt(pos2 + 1) === 32) {
            break;
          }
          pos2 += 2;
          continue;
        }
        if (code2 === 40) {
          level++;
          if (level > 32) {
            return result2;
          }
        }
        if (code2 === 41) {
          if (level === 0) {
            break;
          }
          level--;
        }
        pos2++;
      }
      if (start2 === pos2) {
        return result2;
      }
      if (level !== 0) {
        return result2;
      }
      result2.str = unescapeAll(str2.slice(start2, pos2));
      result2.pos = pos2;
      result2.ok = true;
      return result2;
    }
    function parseLinkTitle(str2, start2, max2, prev_state) {
      let code2;
      let pos2 = start2;
      const state = {
        // if `true`, this is a valid link title
        ok: false,
        // if `true`, this link can be continued on the next line
        can_continue: false,
        // if `ok`, it's the position of the first character after the closing marker
        pos: 0,
        // if `ok`, it's the unescaped title
        str: "",
        // expected closing marker character code
        marker: 0
      };
      if (prev_state) {
        state.str = prev_state.str;
        state.marker = prev_state.marker;
      } else {
        if (pos2 >= max2) {
          return state;
        }
        let marker2 = str2.charCodeAt(pos2);
        if (marker2 !== 34 && marker2 !== 39 && marker2 !== 40) {
          return state;
        }
        start2++;
        pos2++;
        if (marker2 === 40) {
          marker2 = 41;
        }
        state.marker = marker2;
      }
      while (pos2 < max2) {
        code2 = str2.charCodeAt(pos2);
        if (code2 === state.marker) {
          state.pos = pos2 + 1;
          state.str += unescapeAll(str2.slice(start2, pos2));
          state.ok = true;
          return state;
        } else if (code2 === 40 && state.marker === 41) {
          return state;
        } else if (code2 === 92 && pos2 + 1 < max2) {
          pos2++;
        }
        pos2++;
      }
      state.can_continue = true;
      state.str += unescapeAll(str2.slice(start2, pos2));
      return state;
    }
    const helpers$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
      __proto__: null,
      parseLinkDestination,
      parseLinkLabel,
      parseLinkTitle
    }, Symbol.toStringTag, { value: "Module" }));
    const default_rules = {};
    default_rules.code_inline = function(tokens, idx, options2, env, slf) {
      const token2 = tokens[idx];
      return "<code" + slf.renderAttrs(token2) + ">" + escapeHtml(token2.content) + "</code>";
    };
    default_rules.code_block = function(tokens, idx, options2, env, slf) {
      const token2 = tokens[idx];
      return "<pre" + slf.renderAttrs(token2) + "><code>" + escapeHtml(tokens[idx].content) + "</code></pre>\n";
    };
    default_rules.fence = function(tokens, idx, options2, env, slf) {
      const token2 = tokens[idx];
      const info = token2.info ? unescapeAll(token2.info).trim() : "";
      let langName = "";
      let langAttrs = "";
      if (info) {
        const arr2 = info.split(/(\s+)/g);
        langName = arr2[0];
        langAttrs = arr2.slice(2).join("");
      }
      let highlighted;
      if (options2.highlight) {
        highlighted = options2.highlight(token2.content, langName, langAttrs) || escapeHtml(token2.content);
      } else {
        highlighted = escapeHtml(token2.content);
      }
      if (highlighted.indexOf("<pre") === 0) {
        return highlighted + "\n";
      }
      if (info) {
        const i2 = token2.attrIndex("class");
        const tmpAttrs = token2.attrs ? token2.attrs.slice() : [];
        if (i2 < 0) {
          tmpAttrs.push(["class", options2.langPrefix + langName]);
        } else {
          tmpAttrs[i2] = tmpAttrs[i2].slice();
          tmpAttrs[i2][1] += " " + options2.langPrefix + langName;
        }
        const tmpToken = {
          attrs: tmpAttrs
        };
        return `<pre><code${slf.renderAttrs(tmpToken)}>${highlighted}</code></pre>
`;
      }
      return `<pre><code${slf.renderAttrs(token2)}>${highlighted}</code></pre>
`;
    };
    default_rules.image = function(tokens, idx, options2, env, slf) {
      const token2 = tokens[idx];
      token2.attrs[token2.attrIndex("alt")][1] = slf.renderInlineAsText(token2.children, options2, env);
      return slf.renderToken(tokens, idx, options2);
    };
    default_rules.hardbreak = function(tokens, idx, options2) {
      return options2.xhtmlOut ? "<br />\n" : "<br>\n";
    };
    default_rules.softbreak = function(tokens, idx, options2) {
      return options2.breaks ? options2.xhtmlOut ? "<br />\n" : "<br>\n" : "\n";
    };
    default_rules.text = function(tokens, idx) {
      return escapeHtml(tokens[idx].content);
    };
    default_rules.html_block = function(tokens, idx) {
      return tokens[idx].content;
    };
    default_rules.html_inline = function(tokens, idx) {
      return tokens[idx].content;
    };
    function Renderer() {
      this.rules = assign$1({}, default_rules);
    }
    Renderer.prototype.renderAttrs = function renderAttrs(token2) {
      let i2, l, result2;
      if (!token2.attrs) {
        return "";
      }
      result2 = "";
      for (i2 = 0, l = token2.attrs.length; i2 < l; i2++) {
        result2 += " " + escapeHtml(token2.attrs[i2][0]) + '="' + escapeHtml(token2.attrs[i2][1]) + '"';
      }
      return result2;
    };
    Renderer.prototype.renderToken = function renderToken(tokens, idx, options2) {
      const token2 = tokens[idx];
      let result2 = "";
      if (token2.hidden) {
        return "";
      }
      if (token2.block && token2.nesting !== -1 && idx && tokens[idx - 1].hidden) {
        result2 += "\n";
      }
      result2 += (token2.nesting === -1 ? "</" : "<") + token2.tag;
      result2 += this.renderAttrs(token2);
      if (token2.nesting === 0 && options2.xhtmlOut) {
        result2 += " /";
      }
      let needLf = false;
      if (token2.block) {
        needLf = true;
        if (token2.nesting === 1) {
          if (idx + 1 < tokens.length) {
            const nextToken2 = tokens[idx + 1];
            if (nextToken2.type === "inline" || nextToken2.hidden) {
              needLf = false;
            } else if (nextToken2.nesting === -1 && nextToken2.tag === token2.tag) {
              needLf = false;
            }
          }
        }
      }
      result2 += needLf ? ">\n" : ">";
      return result2;
    };
    Renderer.prototype.renderInline = function(tokens, options2, env) {
      let result2 = "";
      const rules = this.rules;
      for (let i2 = 0, len = tokens.length; i2 < len; i2++) {
        const type = tokens[i2].type;
        if (typeof rules[type] !== "undefined") {
          result2 += rules[type](tokens, i2, options2, env, this);
        } else {
          result2 += this.renderToken(tokens, i2, options2);
        }
      }
      return result2;
    };
    Renderer.prototype.renderInlineAsText = function(tokens, options2, env) {
      let result2 = "";
      for (let i2 = 0, len = tokens.length; i2 < len; i2++) {
        switch (tokens[i2].type) {
          case "text":
            result2 += tokens[i2].content;
            break;
          case "image":
            result2 += this.renderInlineAsText(tokens[i2].children, options2, env);
            break;
          case "html_inline":
          case "html_block":
            result2 += tokens[i2].content;
            break;
          case "softbreak":
          case "hardbreak":
            result2 += "\n";
            break;
        }
      }
      return result2;
    };
    Renderer.prototype.render = function(tokens, options2, env) {
      let result2 = "";
      const rules = this.rules;
      for (let i2 = 0, len = tokens.length; i2 < len; i2++) {
        const type = tokens[i2].type;
        if (type === "inline") {
          result2 += this.renderInline(tokens[i2].children, options2, env);
        } else if (typeof rules[type] !== "undefined") {
          result2 += rules[type](tokens, i2, options2, env, this);
        } else {
          result2 += this.renderToken(tokens, i2, options2, env);
        }
      }
      return result2;
    };
    function Ruler() {
      this.__rules__ = [];
      this.__cache__ = null;
    }
    Ruler.prototype.__find__ = function(name2) {
      for (let i2 = 0; i2 < this.__rules__.length; i2++) {
        if (this.__rules__[i2].name === name2) {
          return i2;
        }
      }
      return -1;
    };
    Ruler.prototype.__compile__ = function() {
      const self2 = this;
      const chains = [""];
      self2.__rules__.forEach(function(rule) {
        if (!rule.enabled) {
          return;
        }
        rule.alt.forEach(function(altName) {
          if (chains.indexOf(altName) < 0) {
            chains.push(altName);
          }
        });
      });
      self2.__cache__ = {};
      chains.forEach(function(chain) {
        self2.__cache__[chain] = [];
        self2.__rules__.forEach(function(rule) {
          if (!rule.enabled) {
            return;
          }
          if (chain && rule.alt.indexOf(chain) < 0) {
            return;
          }
          self2.__cache__[chain].push(rule.fn);
        });
      });
    };
    Ruler.prototype.at = function(name2, fn2, options2) {
      const index = this.__find__(name2);
      const opt = options2 || {};
      if (index === -1) {
        throw new Error("Parser rule not found: " + name2);
      }
      this.__rules__[index].fn = fn2;
      this.__rules__[index].alt = opt.alt || [];
      this.__cache__ = null;
    };
    Ruler.prototype.before = function(beforeName, ruleName, fn2, options2) {
      const index = this.__find__(beforeName);
      const opt = options2 || {};
      if (index === -1) {
        throw new Error("Parser rule not found: " + beforeName);
      }
      this.__rules__.splice(index, 0, {
        name: ruleName,
        enabled: true,
        fn: fn2,
        alt: opt.alt || []
      });
      this.__cache__ = null;
    };
    Ruler.prototype.after = function(afterName, ruleName, fn2, options2) {
      const index = this.__find__(afterName);
      const opt = options2 || {};
      if (index === -1) {
        throw new Error("Parser rule not found: " + afterName);
      }
      this.__rules__.splice(index + 1, 0, {
        name: ruleName,
        enabled: true,
        fn: fn2,
        alt: opt.alt || []
      });
      this.__cache__ = null;
    };
    Ruler.prototype.push = function(ruleName, fn2, options2) {
      const opt = options2 || {};
      this.__rules__.push({
        name: ruleName,
        enabled: true,
        fn: fn2,
        alt: opt.alt || []
      });
      this.__cache__ = null;
    };
    Ruler.prototype.enable = function(list2, ignoreInvalid) {
      if (!Array.isArray(list2)) {
        list2 = [list2];
      }
      const result2 = [];
      list2.forEach(function(name2) {
        const idx = this.__find__(name2);
        if (idx < 0) {
          if (ignoreInvalid) {
            return;
          }
          throw new Error("Rules manager: invalid rule name " + name2);
        }
        this.__rules__[idx].enabled = true;
        result2.push(name2);
      }, this);
      this.__cache__ = null;
      return result2;
    };
    Ruler.prototype.enableOnly = function(list2, ignoreInvalid) {
      if (!Array.isArray(list2)) {
        list2 = [list2];
      }
      this.__rules__.forEach(function(rule) {
        rule.enabled = false;
      });
      this.enable(list2, ignoreInvalid);
    };
    Ruler.prototype.disable = function(list2, ignoreInvalid) {
      if (!Array.isArray(list2)) {
        list2 = [list2];
      }
      const result2 = [];
      list2.forEach(function(name2) {
        const idx = this.__find__(name2);
        if (idx < 0) {
          if (ignoreInvalid) {
            return;
          }
          throw new Error("Rules manager: invalid rule name " + name2);
        }
        this.__rules__[idx].enabled = false;
        result2.push(name2);
      }, this);
      this.__cache__ = null;
      return result2;
    };
    Ruler.prototype.getRules = function(chainName) {
      if (this.__cache__ === null) {
        this.__compile__();
      }
      return this.__cache__[chainName] || [];
    };
    function Token(type, tag, nesting) {
      this.type = type;
      this.tag = tag;
      this.attrs = null;
      this.map = null;
      this.nesting = nesting;
      this.level = 0;
      this.children = null;
      this.content = "";
      this.markup = "";
      this.info = "";
      this.meta = null;
      this.block = false;
      this.hidden = false;
    }
    Token.prototype.attrIndex = function attrIndex(name2) {
      if (!this.attrs) {
        return -1;
      }
      const attrs = this.attrs;
      for (let i2 = 0, len = attrs.length; i2 < len; i2++) {
        if (attrs[i2][0] === name2) {
          return i2;
        }
      }
      return -1;
    };
    Token.prototype.attrPush = function attrPush(attrData) {
      if (this.attrs) {
        this.attrs.push(attrData);
      } else {
        this.attrs = [attrData];
      }
    };
    Token.prototype.attrSet = function attrSet(name2, value2) {
      const idx = this.attrIndex(name2);
      const attrData = [name2, value2];
      if (idx < 0) {
        this.attrPush(attrData);
      } else {
        this.attrs[idx] = attrData;
      }
    };
    Token.prototype.attrGet = function attrGet(name2) {
      const idx = this.attrIndex(name2);
      let value2 = null;
      if (idx >= 0) {
        value2 = this.attrs[idx][1];
      }
      return value2;
    };
    Token.prototype.attrJoin = function attrJoin(name2, value2) {
      const idx = this.attrIndex(name2);
      if (idx < 0) {
        this.attrPush([name2, value2]);
      } else {
        this.attrs[idx][1] = this.attrs[idx][1] + " " + value2;
      }
    };
    function StateCore(src, md, env) {
      this.src = src;
      this.env = env;
      this.tokens = [];
      this.inlineMode = false;
      this.md = md;
    }
    StateCore.prototype.Token = Token;
    const NEWLINES_RE = /\r\n?|\n/g;
    const NULL_RE = /\0/g;
    function normalize(state) {
      let str2;
      str2 = state.src.replace(NEWLINES_RE, "\n");
      str2 = str2.replace(NULL_RE, "�");
      state.src = str2;
    }
    function block$1(state) {
      let token2;
      if (state.inlineMode) {
        token2 = new state.Token("inline", "", 0);
        token2.content = state.src;
        token2.map = [0, 1];
        token2.children = [];
        state.tokens.push(token2);
      } else {
        state.md.block.parse(state.src, state.md, state.env, state.tokens);
      }
    }
    function inline$1(state) {
      const tokens = state.tokens;
      for (let i2 = 0, l = tokens.length; i2 < l; i2++) {
        const tok = tokens[i2];
        if (tok.type === "inline") {
          state.md.inline.parse(tok.content, state.md, state.env, tok.children);
        }
      }
    }
    function isLinkOpen$1(str2) {
      return /^<a[>\s]/i.test(str2);
    }
    function isLinkClose$1(str2) {
      return /^<\/a\s*>/i.test(str2);
    }
    function linkify$1(state) {
      const blockTokens = state.tokens;
      if (!state.md.options.linkify) {
        return;
      }
      for (let j = 0, l = blockTokens.length; j < l; j++) {
        if (blockTokens[j].type !== "inline" || !state.md.linkify.pretest(blockTokens[j].content)) {
          continue;
        }
        let tokens = blockTokens[j].children;
        let htmlLinkLevel = 0;
        for (let i2 = tokens.length - 1; i2 >= 0; i2--) {
          const currentToken = tokens[i2];
          if (currentToken.type === "link_close") {
            i2--;
            while (tokens[i2].level !== currentToken.level && tokens[i2].type !== "link_open") {
              i2--;
            }
            continue;
          }
          if (currentToken.type === "html_inline") {
            if (isLinkOpen$1(currentToken.content) && htmlLinkLevel > 0) {
              htmlLinkLevel--;
            }
            if (isLinkClose$1(currentToken.content)) {
              htmlLinkLevel++;
            }
          }
          if (htmlLinkLevel > 0) {
            continue;
          }
          if (currentToken.type === "text" && state.md.linkify.test(currentToken.content)) {
            const text2 = currentToken.content;
            let links2 = state.md.linkify.match(text2);
            const nodes = [];
            let level = currentToken.level;
            let lastPos = 0;
            if (links2.length > 0 && links2[0].index === 0 && i2 > 0 && tokens[i2 - 1].type === "text_special") {
              links2 = links2.slice(1);
            }
            for (let ln = 0; ln < links2.length; ln++) {
              const url = links2[ln].url;
              const fullUrl = state.md.normalizeLink(url);
              if (!state.md.validateLink(fullUrl)) {
                continue;
              }
              let urlText = links2[ln].text;
              if (!links2[ln].schema) {
                urlText = state.md.normalizeLinkText("http://" + urlText).replace(/^http:\/\//, "");
              } else if (links2[ln].schema === "mailto:" && !/^mailto:/i.test(urlText)) {
                urlText = state.md.normalizeLinkText("mailto:" + urlText).replace(/^mailto:/, "");
              } else {
                urlText = state.md.normalizeLinkText(urlText);
              }
              const pos2 = links2[ln].index;
              if (pos2 > lastPos) {
                const token2 = new state.Token("text", "", 0);
                token2.content = text2.slice(lastPos, pos2);
                token2.level = level;
                nodes.push(token2);
              }
              const token_o = new state.Token("link_open", "a", 1);
              token_o.attrs = [["href", fullUrl]];
              token_o.level = level++;
              token_o.markup = "linkify";
              token_o.info = "auto";
              nodes.push(token_o);
              const token_t = new state.Token("text", "", 0);
              token_t.content = urlText;
              token_t.level = level;
              nodes.push(token_t);
              const token_c = new state.Token("link_close", "a", -1);
              token_c.level = --level;
              token_c.markup = "linkify";
              token_c.info = "auto";
              nodes.push(token_c);
              lastPos = links2[ln].lastIndex;
            }
            if (lastPos < text2.length) {
              const token2 = new state.Token("text", "", 0);
              token2.content = text2.slice(lastPos);
              token2.level = level;
              nodes.push(token2);
            }
            blockTokens[j].children = tokens = arrayReplaceAt(tokens, i2, nodes);
          }
        }
      }
    }
    const RARE_RE = /\+-|\.\.|\?\?\?\?|!!!!|,,|--/;
    const SCOPED_ABBR_TEST_RE = /\((c|tm|r)\)/i;
    const SCOPED_ABBR_RE = /\((c|tm|r)\)/ig;
    const SCOPED_ABBR = {
      c: "©",
      r: "®",
      tm: "™"
    };
    function replaceFn(match, name2) {
      return SCOPED_ABBR[name2.toLowerCase()];
    }
    function replace_scoped(inlineTokens) {
      let inside_autolink = 0;
      for (let i2 = inlineTokens.length - 1; i2 >= 0; i2--) {
        const token2 = inlineTokens[i2];
        if (token2.type === "text" && !inside_autolink) {
          token2.content = token2.content.replace(SCOPED_ABBR_RE, replaceFn);
        }
        if (token2.type === "link_open" && token2.info === "auto") {
          inside_autolink--;
        }
        if (token2.type === "link_close" && token2.info === "auto") {
          inside_autolink++;
        }
      }
    }
    function replace_rare(inlineTokens) {
      let inside_autolink = 0;
      for (let i2 = inlineTokens.length - 1; i2 >= 0; i2--) {
        const token2 = inlineTokens[i2];
        if (token2.type === "text" && !inside_autolink) {
          if (RARE_RE.test(token2.content)) {
            token2.content = token2.content.replace(/\+-/g, "±").replace(/\.{2,}/g, "…").replace(/([?!])…/g, "$1..").replace(/([?!]){4,}/g, "$1$1$1").replace(/,{2,}/g, ",").replace(/(^|[^-])---(?=[^-]|$)/mg, "$1—").replace(/(^|\s)--(?=\s|$)/mg, "$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/mg, "$1–");
          }
        }
        if (token2.type === "link_open" && token2.info === "auto") {
          inside_autolink--;
        }
        if (token2.type === "link_close" && token2.info === "auto") {
          inside_autolink++;
        }
      }
    }
    function replace$1(state) {
      let blkIdx;
      if (!state.md.options.typographer) {
        return;
      }
      for (blkIdx = state.tokens.length - 1; blkIdx >= 0; blkIdx--) {
        if (state.tokens[blkIdx].type !== "inline") {
          continue;
        }
        if (SCOPED_ABBR_TEST_RE.test(state.tokens[blkIdx].content)) {
          replace_scoped(state.tokens[blkIdx].children);
        }
        if (RARE_RE.test(state.tokens[blkIdx].content)) {
          replace_rare(state.tokens[blkIdx].children);
        }
      }
    }
    const QUOTE_TEST_RE = /['"]/;
    const QUOTE_RE = /['"]/g;
    const APOSTROPHE = "’";
    function replaceAt(str2, index, ch3) {
      return str2.slice(0, index) + ch3 + str2.slice(index + 1);
    }
    function process_inlines(tokens, state) {
      let j;
      const stack2 = [];
      for (let i2 = 0; i2 < tokens.length; i2++) {
        const token2 = tokens[i2];
        const thisLevel = tokens[i2].level;
        for (j = stack2.length - 1; j >= 0; j--) {
          if (stack2[j].level <= thisLevel) {
            break;
          }
        }
        stack2.length = j + 1;
        if (token2.type !== "text") {
          continue;
        }
        let text2 = token2.content;
        let pos2 = 0;
        let max2 = text2.length;
        OUTER:
          while (pos2 < max2) {
            QUOTE_RE.lastIndex = pos2;
            const t2 = QUOTE_RE.exec(text2);
            if (!t2) {
              break;
            }
            let canOpen = true;
            let canClose = true;
            pos2 = t2.index + 1;
            const isSingle = t2[0] === "'";
            let lastChar = 32;
            if (t2.index - 1 >= 0) {
              lastChar = text2.charCodeAt(t2.index - 1);
            } else {
              for (j = i2 - 1; j >= 0; j--) {
                if (tokens[j].type === "softbreak" || tokens[j].type === "hardbreak") break;
                if (!tokens[j].content) continue;
                lastChar = tokens[j].content.charCodeAt(tokens[j].content.length - 1);
                break;
              }
            }
            let nextChar = 32;
            if (pos2 < max2) {
              nextChar = text2.charCodeAt(pos2);
            } else {
              for (j = i2 + 1; j < tokens.length; j++) {
                if (tokens[j].type === "softbreak" || tokens[j].type === "hardbreak") break;
                if (!tokens[j].content) continue;
                nextChar = tokens[j].content.charCodeAt(0);
                break;
              }
            }
            const isLastPunctChar = isMdAsciiPunct(lastChar) || isPunctChar(String.fromCharCode(lastChar));
            const isNextPunctChar = isMdAsciiPunct(nextChar) || isPunctChar(String.fromCharCode(nextChar));
            const isLastWhiteSpace = isWhiteSpace(lastChar);
            const isNextWhiteSpace = isWhiteSpace(nextChar);
            if (isNextWhiteSpace) {
              canOpen = false;
            } else if (isNextPunctChar) {
              if (!(isLastWhiteSpace || isLastPunctChar)) {
                canOpen = false;
              }
            }
            if (isLastWhiteSpace) {
              canClose = false;
            } else if (isLastPunctChar) {
              if (!(isNextWhiteSpace || isNextPunctChar)) {
                canClose = false;
              }
            }
            if (nextChar === 34 && t2[0] === '"') {
              if (lastChar >= 48 && lastChar <= 57) {
                canClose = canOpen = false;
              }
            }
            if (canOpen && canClose) {
              canOpen = isLastPunctChar;
              canClose = isNextPunctChar;
            }
            if (!canOpen && !canClose) {
              if (isSingle) {
                token2.content = replaceAt(token2.content, t2.index, APOSTROPHE);
              }
              continue;
            }
            if (canClose) {
              for (j = stack2.length - 1; j >= 0; j--) {
                let item2 = stack2[j];
                if (stack2[j].level < thisLevel) {
                  break;
                }
                if (item2.single === isSingle && stack2[j].level === thisLevel) {
                  item2 = stack2[j];
                  let openQuote;
                  let closeQuote;
                  if (isSingle) {
                    openQuote = state.md.options.quotes[2];
                    closeQuote = state.md.options.quotes[3];
                  } else {
                    openQuote = state.md.options.quotes[0];
                    closeQuote = state.md.options.quotes[1];
                  }
                  token2.content = replaceAt(token2.content, t2.index, closeQuote);
                  tokens[item2.token].content = replaceAt(
                    tokens[item2.token].content,
                    item2.pos,
                    openQuote
                  );
                  pos2 += closeQuote.length - 1;
                  if (item2.token === i2) {
                    pos2 += openQuote.length - 1;
                  }
                  text2 = token2.content;
                  max2 = text2.length;
                  stack2.length = j;
                  continue OUTER;
                }
              }
            }
            if (canOpen) {
              stack2.push({
                token: i2,
                pos: t2.index,
                single: isSingle,
                level: thisLevel
              });
            } else if (canClose && isSingle) {
              token2.content = replaceAt(token2.content, t2.index, APOSTROPHE);
            }
          }
      }
    }
    function smartquotes(state) {
      if (!state.md.options.typographer) {
        return;
      }
      for (let blkIdx = state.tokens.length - 1; blkIdx >= 0; blkIdx--) {
        if (state.tokens[blkIdx].type !== "inline" || !QUOTE_TEST_RE.test(state.tokens[blkIdx].content)) {
          continue;
        }
        process_inlines(state.tokens[blkIdx].children, state);
      }
    }
    function text_join(state) {
      let curr, last;
      const blockTokens = state.tokens;
      const l = blockTokens.length;
      for (let j = 0; j < l; j++) {
        if (blockTokens[j].type !== "inline") continue;
        const tokens = blockTokens[j].children;
        const max2 = tokens.length;
        for (curr = 0; curr < max2; curr++) {
          if (tokens[curr].type === "text_special") {
            tokens[curr].type = "text";
          }
        }
        for (curr = last = 0; curr < max2; curr++) {
          if (tokens[curr].type === "text" && curr + 1 < max2 && tokens[curr + 1].type === "text") {
            tokens[curr + 1].content = tokens[curr].content + tokens[curr + 1].content;
          } else {
            if (curr !== last) {
              tokens[last] = tokens[curr];
            }
            last++;
          }
        }
        if (curr !== last) {
          tokens.length = last;
        }
      }
    }
    const _rules$2 = [
      ["normalize", normalize],
      ["block", block$1],
      ["inline", inline$1],
      ["linkify", linkify$1],
      ["replacements", replace$1],
      ["smartquotes", smartquotes],
      // `text_join` finds `text_special` tokens (for escape sequences)
      // and joins them with the rest of the text
      ["text_join", text_join]
    ];
    function Core$1() {
      this.ruler = new Ruler();
      for (let i2 = 0; i2 < _rules$2.length; i2++) {
        this.ruler.push(_rules$2[i2][0], _rules$2[i2][1]);
      }
    }
    Core$1.prototype.process = function(state) {
      const rules = this.ruler.getRules("");
      for (let i2 = 0, l = rules.length; i2 < l; i2++) {
        rules[i2](state);
      }
    };
    Core$1.prototype.State = StateCore;
    function StateBlock(src, md, env, tokens) {
      this.src = src;
      this.md = md;
      this.env = env;
      this.tokens = tokens;
      this.bMarks = [];
      this.eMarks = [];
      this.tShift = [];
      this.sCount = [];
      this.bsCount = [];
      this.blkIndent = 0;
      this.line = 0;
      this.lineMax = 0;
      this.tight = false;
      this.ddIndent = -1;
      this.listIndent = -1;
      this.parentType = "root";
      this.level = 0;
      const s = this.src;
      for (let start2 = 0, pos2 = 0, indent = 0, offset2 = 0, len = s.length, indent_found = false; pos2 < len; pos2++) {
        const ch3 = s.charCodeAt(pos2);
        if (!indent_found) {
          if (isSpace(ch3)) {
            indent++;
            if (ch3 === 9) {
              offset2 += 4 - offset2 % 4;
            } else {
              offset2++;
            }
            continue;
          } else {
            indent_found = true;
          }
        }
        if (ch3 === 10 || pos2 === len - 1) {
          if (ch3 !== 10) {
            pos2++;
          }
          this.bMarks.push(start2);
          this.eMarks.push(pos2);
          this.tShift.push(indent);
          this.sCount.push(offset2);
          this.bsCount.push(0);
          indent_found = false;
          indent = 0;
          offset2 = 0;
          start2 = pos2 + 1;
        }
      }
      this.bMarks.push(s.length);
      this.eMarks.push(s.length);
      this.tShift.push(0);
      this.sCount.push(0);
      this.bsCount.push(0);
      this.lineMax = this.bMarks.length - 1;
    }
    StateBlock.prototype.push = function(type, tag, nesting) {
      const token2 = new Token(type, tag, nesting);
      token2.block = true;
      if (nesting < 0) this.level--;
      token2.level = this.level;
      if (nesting > 0) this.level++;
      this.tokens.push(token2);
      return token2;
    };
    StateBlock.prototype.isEmpty = function isEmpty(line2) {
      return this.bMarks[line2] + this.tShift[line2] >= this.eMarks[line2];
    };
    StateBlock.prototype.skipEmptyLines = function skipEmptyLines(from) {
      for (let max2 = this.lineMax; from < max2; from++) {
        if (this.bMarks[from] + this.tShift[from] < this.eMarks[from]) {
          break;
        }
      }
      return from;
    };
    StateBlock.prototype.skipSpaces = function skipSpaces(pos2) {
      for (let max2 = this.src.length; pos2 < max2; pos2++) {
        const ch3 = this.src.charCodeAt(pos2);
        if (!isSpace(ch3)) {
          break;
        }
      }
      return pos2;
    };
    StateBlock.prototype.skipSpacesBack = function skipSpacesBack(pos2, min2) {
      if (pos2 <= min2) {
        return pos2;
      }
      while (pos2 > min2) {
        if (!isSpace(this.src.charCodeAt(--pos2))) {
          return pos2 + 1;
        }
      }
      return pos2;
    };
    StateBlock.prototype.skipChars = function skipChars(pos2, code2) {
      for (let max2 = this.src.length; pos2 < max2; pos2++) {
        if (this.src.charCodeAt(pos2) !== code2) {
          break;
        }
      }
      return pos2;
    };
    StateBlock.prototype.skipCharsBack = function skipCharsBack(pos2, code2, min2) {
      if (pos2 <= min2) {
        return pos2;
      }
      while (pos2 > min2) {
        if (code2 !== this.src.charCodeAt(--pos2)) {
          return pos2 + 1;
        }
      }
      return pos2;
    };
    StateBlock.prototype.getLines = function getLines(begin, end2, indent, keepLastLF) {
      if (begin >= end2) {
        return "";
      }
      const queue = new Array(end2 - begin);
      for (let i2 = 0, line2 = begin; line2 < end2; line2++, i2++) {
        let lineIndent = 0;
        const lineStart = this.bMarks[line2];
        let first = lineStart;
        let last;
        if (line2 + 1 < end2 || keepLastLF) {
          last = this.eMarks[line2] + 1;
        } else {
          last = this.eMarks[line2];
        }
        while (first < last && lineIndent < indent) {
          const ch3 = this.src.charCodeAt(first);
          if (isSpace(ch3)) {
            if (ch3 === 9) {
              lineIndent += 4 - (lineIndent + this.bsCount[line2]) % 4;
            } else {
              lineIndent++;
            }
          } else if (first - lineStart < this.tShift[line2]) {
            lineIndent++;
          } else {
            break;
          }
          first++;
        }
        if (lineIndent > indent) {
          queue[i2] = new Array(lineIndent - indent + 1).join(" ") + this.src.slice(first, last);
        } else {
          queue[i2] = this.src.slice(first, last);
        }
      }
      return queue.join("");
    };
    StateBlock.prototype.Token = Token;
    const MAX_AUTOCOMPLETED_CELLS = 65536;
    function getLine(state, line2) {
      const pos2 = state.bMarks[line2] + state.tShift[line2];
      const max2 = state.eMarks[line2];
      return state.src.slice(pos2, max2);
    }
    function escapedSplit(str2) {
      const result2 = [];
      const max2 = str2.length;
      let pos2 = 0;
      let ch3 = str2.charCodeAt(pos2);
      let isEscaped = false;
      let lastPos = 0;
      let current2 = "";
      while (pos2 < max2) {
        if (ch3 === 124) {
          if (!isEscaped) {
            result2.push(current2 + str2.substring(lastPos, pos2));
            current2 = "";
            lastPos = pos2 + 1;
          } else {
            current2 += str2.substring(lastPos, pos2 - 1);
            lastPos = pos2;
          }
        }
        isEscaped = ch3 === 92;
        pos2++;
        ch3 = str2.charCodeAt(pos2);
      }
      result2.push(current2 + str2.substring(lastPos));
      return result2;
    }
    function table$2(state, startLine, endLine, silent) {
      if (startLine + 2 > endLine) {
        return false;
      }
      let nextLine = startLine + 1;
      if (state.sCount[nextLine] < state.blkIndent) {
        return false;
      }
      if (state.sCount[nextLine] - state.blkIndent >= 4) {
        return false;
      }
      let pos2 = state.bMarks[nextLine] + state.tShift[nextLine];
      if (pos2 >= state.eMarks[nextLine]) {
        return false;
      }
      const firstCh = state.src.charCodeAt(pos2++);
      if (firstCh !== 124 && firstCh !== 45 && firstCh !== 58) {
        return false;
      }
      if (pos2 >= state.eMarks[nextLine]) {
        return false;
      }
      const secondCh = state.src.charCodeAt(pos2++);
      if (secondCh !== 124 && secondCh !== 45 && secondCh !== 58 && !isSpace(secondCh)) {
        return false;
      }
      if (firstCh === 45 && isSpace(secondCh)) {
        return false;
      }
      while (pos2 < state.eMarks[nextLine]) {
        const ch3 = state.src.charCodeAt(pos2);
        if (ch3 !== 124 && ch3 !== 45 && ch3 !== 58 && !isSpace(ch3)) {
          return false;
        }
        pos2++;
      }
      let lineText = getLine(state, startLine + 1);
      let columns = lineText.split("|");
      const aligns = [];
      for (let i2 = 0; i2 < columns.length; i2++) {
        const t2 = columns[i2].trim();
        if (!t2) {
          if (i2 === 0 || i2 === columns.length - 1) {
            continue;
          } else {
            return false;
          }
        }
        if (!/^:?-+:?$/.test(t2)) {
          return false;
        }
        if (t2.charCodeAt(t2.length - 1) === 58) {
          aligns.push(t2.charCodeAt(0) === 58 ? "center" : "right");
        } else if (t2.charCodeAt(0) === 58) {
          aligns.push("left");
        } else {
          aligns.push("");
        }
      }
      lineText = getLine(state, startLine).trim();
      if (lineText.indexOf("|") === -1) {
        return false;
      }
      if (state.sCount[startLine] - state.blkIndent >= 4) {
        return false;
      }
      columns = escapedSplit(lineText);
      if (columns.length && columns[0] === "") columns.shift();
      if (columns.length && columns[columns.length - 1] === "") columns.pop();
      const columnCount = columns.length;
      if (columnCount === 0 || columnCount !== aligns.length) {
        return false;
      }
      if (silent) {
        return true;
      }
      const oldParentType = state.parentType;
      state.parentType = "table";
      const terminatorRules = state.md.block.ruler.getRules("blockquote");
      const token_to = state.push("table_open", "table", 1);
      const tableLines = [startLine, 0];
      token_to.map = tableLines;
      const token_tho = state.push("thead_open", "thead", 1);
      token_tho.map = [startLine, startLine + 1];
      const token_htro = state.push("tr_open", "tr", 1);
      token_htro.map = [startLine, startLine + 1];
      for (let i2 = 0; i2 < columns.length; i2++) {
        const token_ho = state.push("th_open", "th", 1);
        if (aligns[i2]) {
          token_ho.attrs = [["style", "text-align:" + aligns[i2]]];
        }
        const token_il = state.push("inline", "", 0);
        token_il.content = columns[i2].trim();
        token_il.children = [];
        state.push("th_close", "th", -1);
      }
      state.push("tr_close", "tr", -1);
      state.push("thead_close", "thead", -1);
      let tbodyLines;
      let autocompletedCells = 0;
      for (nextLine = startLine + 2; nextLine < endLine; nextLine++) {
        if (state.sCount[nextLine] < state.blkIndent) {
          break;
        }
        let terminate = false;
        for (let i2 = 0, l = terminatorRules.length; i2 < l; i2++) {
          if (terminatorRules[i2](state, nextLine, endLine, true)) {
            terminate = true;
            break;
          }
        }
        if (terminate) {
          break;
        }
        lineText = getLine(state, nextLine).trim();
        if (!lineText) {
          break;
        }
        if (state.sCount[nextLine] - state.blkIndent >= 4) {
          break;
        }
        columns = escapedSplit(lineText);
        if (columns.length && columns[0] === "") columns.shift();
        if (columns.length && columns[columns.length - 1] === "") columns.pop();
        autocompletedCells += columnCount - columns.length;
        if (autocompletedCells > MAX_AUTOCOMPLETED_CELLS) {
          break;
        }
        if (nextLine === startLine + 2) {
          const token_tbo = state.push("tbody_open", "tbody", 1);
          token_tbo.map = tbodyLines = [startLine + 2, 0];
        }
        const token_tro = state.push("tr_open", "tr", 1);
        token_tro.map = [nextLine, nextLine + 1];
        for (let i2 = 0; i2 < columnCount; i2++) {
          const token_tdo = state.push("td_open", "td", 1);
          if (aligns[i2]) {
            token_tdo.attrs = [["style", "text-align:" + aligns[i2]]];
          }
          const token_il = state.push("inline", "", 0);
          token_il.content = columns[i2] ? columns[i2].trim() : "";
          token_il.children = [];
          state.push("td_close", "td", -1);
        }
        state.push("tr_close", "tr", -1);
      }
      if (tbodyLines) {
        state.push("tbody_close", "tbody", -1);
        tbodyLines[1] = nextLine;
      }
      state.push("table_close", "table", -1);
      tableLines[1] = nextLine;
      state.parentType = oldParentType;
      state.line = nextLine;
      return true;
    }
    function code$4(state, startLine, endLine) {
      if (state.sCount[startLine] - state.blkIndent < 4) {
        return false;
      }
      let nextLine = startLine + 1;
      let last = nextLine;
      while (nextLine < endLine) {
        if (state.isEmpty(nextLine)) {
          nextLine++;
          continue;
        }
        if (state.sCount[nextLine] - state.blkIndent >= 4) {
          nextLine++;
          last = nextLine;
          continue;
        }
        break;
      }
      state.line = last;
      const token2 = state.push("code_block", "code", 0);
      token2.content = state.getLines(startLine, last, 4 + state.blkIndent, false) + "\n";
      token2.map = [startLine, state.line];
      return true;
    }
    function fence(state, startLine, endLine, silent) {
      let pos2 = state.bMarks[startLine] + state.tShift[startLine];
      let max2 = state.eMarks[startLine];
      if (state.sCount[startLine] - state.blkIndent >= 4) {
        return false;
      }
      if (pos2 + 3 > max2) {
        return false;
      }
      const marker2 = state.src.charCodeAt(pos2);
      if (marker2 !== 126 && marker2 !== 96) {
        return false;
      }
      let mem = pos2;
      pos2 = state.skipChars(pos2, marker2);
      let len = pos2 - mem;
      if (len < 3) {
        return false;
      }
      const markup = state.src.slice(mem, pos2);
      const params = state.src.slice(pos2, max2);
      if (marker2 === 96) {
        if (params.indexOf(String.fromCharCode(marker2)) >= 0) {
          return false;
        }
      }
      if (silent) {
        return true;
      }
      let nextLine = startLine;
      let haveEndMarker = false;
      for (; ; ) {
        nextLine++;
        if (nextLine >= endLine) {
          break;
        }
        pos2 = mem = state.bMarks[nextLine] + state.tShift[nextLine];
        max2 = state.eMarks[nextLine];
        if (pos2 < max2 && state.sCount[nextLine] < state.blkIndent) {
          break;
        }
        if (state.src.charCodeAt(pos2) !== marker2) {
          continue;
        }
        if (state.sCount[nextLine] - state.blkIndent >= 4) {
          continue;
        }
        pos2 = state.skipChars(pos2, marker2);
        if (pos2 - mem < len) {
          continue;
        }
        pos2 = state.skipSpaces(pos2);
        if (pos2 < max2) {
          continue;
        }
        haveEndMarker = true;
        break;
      }
      len = state.sCount[startLine];
      state.line = nextLine + (haveEndMarker ? 1 : 0);
      const token2 = state.push("fence", "code", 0);
      token2.info = params;
      token2.content = state.getLines(startLine + 1, nextLine, len, true);
      token2.markup = markup;
      token2.map = [startLine, state.line];
      return true;
    }
    function blockquote(state, startLine, endLine, silent) {
      let pos2 = state.bMarks[startLine] + state.tShift[startLine];
      let max2 = state.eMarks[startLine];
      const oldLineMax = state.lineMax;
      if (state.sCount[startLine] - state.blkIndent >= 4) {
        return false;
      }
      if (state.src.charCodeAt(pos2) !== 62) {
        return false;
      }
      if (silent) {
        return true;
      }
      const oldBMarks = [];
      const oldBSCount = [];
      const oldSCount = [];
      const oldTShift = [];
      const terminatorRules = state.md.block.ruler.getRules("blockquote");
      const oldParentType = state.parentType;
      state.parentType = "blockquote";
      let lastLineEmpty = false;
      let nextLine;
      for (nextLine = startLine; nextLine < endLine; nextLine++) {
        const isOutdented = state.sCount[nextLine] < state.blkIndent;
        pos2 = state.bMarks[nextLine] + state.tShift[nextLine];
        max2 = state.eMarks[nextLine];
        if (pos2 >= max2) {
          break;
        }
        if (state.src.charCodeAt(pos2++) === 62 && !isOutdented) {
          let initial = state.sCount[nextLine] + 1;
          let spaceAfterMarker;
          let adjustTab;
          if (state.src.charCodeAt(pos2) === 32) {
            pos2++;
            initial++;
            adjustTab = false;
            spaceAfterMarker = true;
          } else if (state.src.charCodeAt(pos2) === 9) {
            spaceAfterMarker = true;
            if ((state.bsCount[nextLine] + initial) % 4 === 3) {
              pos2++;
              initial++;
              adjustTab = false;
            } else {
              adjustTab = true;
            }
          } else {
            spaceAfterMarker = false;
          }
          let offset2 = initial;
          oldBMarks.push(state.bMarks[nextLine]);
          state.bMarks[nextLine] = pos2;
          while (pos2 < max2) {
            const ch3 = state.src.charCodeAt(pos2);
            if (isSpace(ch3)) {
              if (ch3 === 9) {
                offset2 += 4 - (offset2 + state.bsCount[nextLine] + (adjustTab ? 1 : 0)) % 4;
              } else {
                offset2++;
              }
            } else {
              break;
            }
            pos2++;
          }
          lastLineEmpty = pos2 >= max2;
          oldBSCount.push(state.bsCount[nextLine]);
          state.bsCount[nextLine] = state.sCount[nextLine] + 1 + (spaceAfterMarker ? 1 : 0);
          oldSCount.push(state.sCount[nextLine]);
          state.sCount[nextLine] = offset2 - initial;
          oldTShift.push(state.tShift[nextLine]);
          state.tShift[nextLine] = pos2 - state.bMarks[nextLine];
          continue;
        }
        if (lastLineEmpty) {
          break;
        }
        let terminate = false;
        for (let i2 = 0, l = terminatorRules.length; i2 < l; i2++) {
          if (terminatorRules[i2](state, nextLine, endLine, true)) {
            terminate = true;
            break;
          }
        }
        if (terminate) {
          state.lineMax = nextLine;
          if (state.blkIndent !== 0) {
            oldBMarks.push(state.bMarks[nextLine]);
            oldBSCount.push(state.bsCount[nextLine]);
            oldTShift.push(state.tShift[nextLine]);
            oldSCount.push(state.sCount[nextLine]);
            state.sCount[nextLine] -= state.blkIndent;
          }
          break;
        }
        oldBMarks.push(state.bMarks[nextLine]);
        oldBSCount.push(state.bsCount[nextLine]);
        oldTShift.push(state.tShift[nextLine]);
        oldSCount.push(state.sCount[nextLine]);
        state.sCount[nextLine] = -1;
      }
      const oldIndent = state.blkIndent;
      state.blkIndent = 0;
      const token_o = state.push("blockquote_open", "blockquote", 1);
      token_o.markup = ">";
      const lines = [startLine, 0];
      token_o.map = lines;
      state.md.block.tokenize(state, startLine, nextLine);
      const token_c = state.push("blockquote_close", "blockquote", -1);
      token_c.markup = ">";
      state.lineMax = oldLineMax;
      state.parentType = oldParentType;
      lines[1] = state.line;
      for (let i2 = 0; i2 < oldTShift.length; i2++) {
        state.bMarks[i2 + startLine] = oldBMarks[i2];
        state.tShift[i2 + startLine] = oldTShift[i2];
        state.sCount[i2 + startLine] = oldSCount[i2];
        state.bsCount[i2 + startLine] = oldBSCount[i2];
      }
      state.blkIndent = oldIndent;
      return true;
    }
    function hr(state, startLine, endLine, silent) {
      const max2 = state.eMarks[startLine];
      if (state.sCount[startLine] - state.blkIndent >= 4) {
        return false;
      }
      let pos2 = state.bMarks[startLine] + state.tShift[startLine];
      const marker2 = state.src.charCodeAt(pos2++);
      if (marker2 !== 42 && marker2 !== 45 && marker2 !== 95) {
        return false;
      }
      let cnt = 1;
      while (pos2 < max2) {
        const ch3 = state.src.charCodeAt(pos2++);
        if (ch3 !== marker2 && !isSpace(ch3)) {
          return false;
        }
        if (ch3 === marker2) {
          cnt++;
        }
      }
      if (cnt < 3) {
        return false;
      }
      if (silent) {
        return true;
      }
      state.line = startLine + 1;
      const token2 = state.push("hr", "hr", 0);
      token2.map = [startLine, state.line];
      token2.markup = Array(cnt + 1).join(String.fromCharCode(marker2));
      return true;
    }
    function skipBulletListMarker(state, startLine) {
      const max2 = state.eMarks[startLine];
      let pos2 = state.bMarks[startLine] + state.tShift[startLine];
      const marker2 = state.src.charCodeAt(pos2++);
      if (marker2 !== 42 && marker2 !== 45 && marker2 !== 43) {
        return -1;
      }
      if (pos2 < max2) {
        const ch3 = state.src.charCodeAt(pos2);
        if (!isSpace(ch3)) {
          return -1;
        }
      }
      return pos2;
    }
    function skipOrderedListMarker(state, startLine) {
      const start2 = state.bMarks[startLine] + state.tShift[startLine];
      const max2 = state.eMarks[startLine];
      let pos2 = start2;
      if (pos2 + 1 >= max2) {
        return -1;
      }
      let ch3 = state.src.charCodeAt(pos2++);
      if (ch3 < 48 || ch3 > 57) {
        return -1;
      }
      for (; ; ) {
        if (pos2 >= max2) {
          return -1;
        }
        ch3 = state.src.charCodeAt(pos2++);
        if (ch3 >= 48 && ch3 <= 57) {
          if (pos2 - start2 >= 10) {
            return -1;
          }
          continue;
        }
        if (ch3 === 41 || ch3 === 46) {
          break;
        }
        return -1;
      }
      if (pos2 < max2) {
        ch3 = state.src.charCodeAt(pos2);
        if (!isSpace(ch3)) {
          return -1;
        }
      }
      return pos2;
    }
    function markTightParagraphs(state, idx) {
      const level = state.level + 2;
      for (let i2 = idx + 2, l = state.tokens.length - 2; i2 < l; i2++) {
        if (state.tokens[i2].level === level && state.tokens[i2].type === "paragraph_open") {
          state.tokens[i2 + 2].hidden = true;
          state.tokens[i2].hidden = true;
          i2 += 2;
        }
      }
    }
    function list$2(state, startLine, endLine, silent) {
      let max2, pos2, start2, token2;
      let nextLine = startLine;
      let tight = true;
      if (state.sCount[nextLine] - state.blkIndent >= 4) {
        return false;
      }
      if (state.listIndent >= 0 && state.sCount[nextLine] - state.listIndent >= 4 && state.sCount[nextLine] < state.blkIndent) {
        return false;
      }
      let isTerminatingParagraph = false;
      if (silent && state.parentType === "paragraph") {
        if (state.sCount[nextLine] >= state.blkIndent) {
          isTerminatingParagraph = true;
        }
      }
      let isOrdered;
      let markerValue;
      let posAfterMarker;
      if ((posAfterMarker = skipOrderedListMarker(state, nextLine)) >= 0) {
        isOrdered = true;
        start2 = state.bMarks[nextLine] + state.tShift[nextLine];
        markerValue = Number(state.src.slice(start2, posAfterMarker - 1));
        if (isTerminatingParagraph && markerValue !== 1) return false;
      } else if ((posAfterMarker = skipBulletListMarker(state, nextLine)) >= 0) {
        isOrdered = false;
      } else {
        return false;
      }
      if (isTerminatingParagraph) {
        if (state.skipSpaces(posAfterMarker) >= state.eMarks[nextLine]) return false;
      }
      if (silent) {
        return true;
      }
      const markerCharCode = state.src.charCodeAt(posAfterMarker - 1);
      const listTokIdx = state.tokens.length;
      if (isOrdered) {
        token2 = state.push("ordered_list_open", "ol", 1);
        if (markerValue !== 1) {
          token2.attrs = [["start", markerValue]];
        }
      } else {
        token2 = state.push("bullet_list_open", "ul", 1);
      }
      const listLines = [nextLine, 0];
      token2.map = listLines;
      token2.markup = String.fromCharCode(markerCharCode);
      let prevEmptyEnd = false;
      const terminatorRules = state.md.block.ruler.getRules("list");
      const oldParentType = state.parentType;
      state.parentType = "list";
      while (nextLine < endLine) {
        pos2 = posAfterMarker;
        max2 = state.eMarks[nextLine];
        const initial = state.sCount[nextLine] + posAfterMarker - (state.bMarks[nextLine] + state.tShift[nextLine]);
        let offset2 = initial;
        while (pos2 < max2) {
          const ch3 = state.src.charCodeAt(pos2);
          if (ch3 === 9) {
            offset2 += 4 - (offset2 + state.bsCount[nextLine]) % 4;
          } else if (ch3 === 32) {
            offset2++;
          } else {
            break;
          }
          pos2++;
        }
        const contentStart = pos2;
        let indentAfterMarker;
        if (contentStart >= max2) {
          indentAfterMarker = 1;
        } else {
          indentAfterMarker = offset2 - initial;
        }
        if (indentAfterMarker > 4) {
          indentAfterMarker = 1;
        }
        const indent = initial + indentAfterMarker;
        token2 = state.push("list_item_open", "li", 1);
        token2.markup = String.fromCharCode(markerCharCode);
        const itemLines = [nextLine, 0];
        token2.map = itemLines;
        if (isOrdered) {
          token2.info = state.src.slice(start2, posAfterMarker - 1);
        }
        const oldTight = state.tight;
        const oldTShift = state.tShift[nextLine];
        const oldSCount = state.sCount[nextLine];
        const oldListIndent = state.listIndent;
        state.listIndent = state.blkIndent;
        state.blkIndent = indent;
        state.tight = true;
        state.tShift[nextLine] = contentStart - state.bMarks[nextLine];
        state.sCount[nextLine] = offset2;
        if (contentStart >= max2 && state.isEmpty(nextLine + 1)) {
          state.line = Math.min(state.line + 2, endLine);
        } else {
          state.md.block.tokenize(state, nextLine, endLine, true);
        }
        if (!state.tight || prevEmptyEnd) {
          tight = false;
        }
        prevEmptyEnd = state.line - nextLine > 1 && state.isEmpty(state.line - 1);
        state.blkIndent = state.listIndent;
        state.listIndent = oldListIndent;
        state.tShift[nextLine] = oldTShift;
        state.sCount[nextLine] = oldSCount;
        state.tight = oldTight;
        token2 = state.push("list_item_close", "li", -1);
        token2.markup = String.fromCharCode(markerCharCode);
        nextLine = state.line;
        itemLines[1] = nextLine;
        if (nextLine >= endLine) {
          break;
        }
        if (state.sCount[nextLine] < state.blkIndent) {
          break;
        }
        if (state.sCount[nextLine] - state.blkIndent >= 4) {
          break;
        }
        let terminate = false;
        for (let i2 = 0, l = terminatorRules.length; i2 < l; i2++) {
          if (terminatorRules[i2](state, nextLine, endLine, true)) {
            terminate = true;
            break;
          }
        }
        if (terminate) {
          break;
        }
        if (isOrdered) {
          posAfterMarker = skipOrderedListMarker(state, nextLine);
          if (posAfterMarker < 0) {
            break;
          }
          start2 = state.bMarks[nextLine] + state.tShift[nextLine];
        } else {
          posAfterMarker = skipBulletListMarker(state, nextLine);
          if (posAfterMarker < 0) {
            break;
          }
        }
        if (markerCharCode !== state.src.charCodeAt(posAfterMarker - 1)) {
          break;
        }
      }
      if (isOrdered) {
        token2 = state.push("ordered_list_close", "ol", -1);
      } else {
        token2 = state.push("bullet_list_close", "ul", -1);
      }
      token2.markup = String.fromCharCode(markerCharCode);
      listLines[1] = nextLine;
      state.line = nextLine;
      state.parentType = oldParentType;
      if (tight) {
        markTightParagraphs(state, listTokIdx);
      }
      return true;
    }
    function reference$1(state, startLine, _endLine, silent) {
      let pos2 = state.bMarks[startLine] + state.tShift[startLine];
      let max2 = state.eMarks[startLine];
      let nextLine = startLine + 1;
      if (state.sCount[startLine] - state.blkIndent >= 4) {
        return false;
      }
      if (state.src.charCodeAt(pos2) !== 91) {
        return false;
      }
      function getNextLine(nextLine2) {
        const endLine = state.lineMax;
        if (nextLine2 >= endLine || state.isEmpty(nextLine2)) {
          return null;
        }
        let isContinuation = false;
        if (state.sCount[nextLine2] - state.blkIndent > 3) {
          isContinuation = true;
        }
        if (state.sCount[nextLine2] < 0) {
          isContinuation = true;
        }
        if (!isContinuation) {
          const terminatorRules = state.md.block.ruler.getRules("reference");
          const oldParentType = state.parentType;
          state.parentType = "reference";
          let terminate = false;
          for (let i2 = 0, l = terminatorRules.length; i2 < l; i2++) {
            if (terminatorRules[i2](state, nextLine2, endLine, true)) {
              terminate = true;
              break;
            }
          }
          state.parentType = oldParentType;
          if (terminate) {
            return null;
          }
        }
        const pos3 = state.bMarks[nextLine2] + state.tShift[nextLine2];
        const max3 = state.eMarks[nextLine2];
        return state.src.slice(pos3, max3 + 1);
      }
      let str2 = state.src.slice(pos2, max2 + 1);
      max2 = str2.length;
      let labelEnd = -1;
      for (pos2 = 1; pos2 < max2; pos2++) {
        const ch3 = str2.charCodeAt(pos2);
        if (ch3 === 91) {
          return false;
        } else if (ch3 === 93) {
          labelEnd = pos2;
          break;
        } else if (ch3 === 10) {
          const lineContent = getNextLine(nextLine);
          if (lineContent !== null) {
            str2 += lineContent;
            max2 = str2.length;
            nextLine++;
          }
        } else if (ch3 === 92) {
          pos2++;
          if (pos2 < max2 && str2.charCodeAt(pos2) === 10) {
            const lineContent = getNextLine(nextLine);
            if (lineContent !== null) {
              str2 += lineContent;
              max2 = str2.length;
              nextLine++;
            }
          }
        }
      }
      if (labelEnd < 0 || str2.charCodeAt(labelEnd + 1) !== 58) {
        return false;
      }
      for (pos2 = labelEnd + 2; pos2 < max2; pos2++) {
        const ch3 = str2.charCodeAt(pos2);
        if (ch3 === 10) {
          const lineContent = getNextLine(nextLine);
          if (lineContent !== null) {
            str2 += lineContent;
            max2 = str2.length;
            nextLine++;
          }
        } else if (isSpace(ch3)) ;
        else {
          break;
        }
      }
      const destRes = state.md.helpers.parseLinkDestination(str2, pos2, max2);
      if (!destRes.ok) {
        return false;
      }
      const href = state.md.normalizeLink(destRes.str);
      if (!state.md.validateLink(href)) {
        return false;
      }
      pos2 = destRes.pos;
      const destEndPos = pos2;
      const destEndLineNo = nextLine;
      const start2 = pos2;
      for (; pos2 < max2; pos2++) {
        const ch3 = str2.charCodeAt(pos2);
        if (ch3 === 10) {
          const lineContent = getNextLine(nextLine);
          if (lineContent !== null) {
            str2 += lineContent;
            max2 = str2.length;
            nextLine++;
          }
        } else if (isSpace(ch3)) ;
        else {
          break;
        }
      }
      let titleRes = state.md.helpers.parseLinkTitle(str2, pos2, max2);
      while (titleRes.can_continue) {
        const lineContent = getNextLine(nextLine);
        if (lineContent === null) break;
        str2 += lineContent;
        pos2 = max2;
        max2 = str2.length;
        nextLine++;
        titleRes = state.md.helpers.parseLinkTitle(str2, pos2, max2, titleRes);
      }
      let title2;
      if (pos2 < max2 && start2 !== pos2 && titleRes.ok) {
        title2 = titleRes.str;
        pos2 = titleRes.pos;
      } else {
        title2 = "";
        pos2 = destEndPos;
        nextLine = destEndLineNo;
      }
      while (pos2 < max2) {
        const ch3 = str2.charCodeAt(pos2);
        if (!isSpace(ch3)) {
          break;
        }
        pos2++;
      }
      if (pos2 < max2 && str2.charCodeAt(pos2) !== 10) {
        if (title2) {
          title2 = "";
          pos2 = destEndPos;
          nextLine = destEndLineNo;
          while (pos2 < max2) {
            const ch3 = str2.charCodeAt(pos2);
            if (!isSpace(ch3)) {
              break;
            }
            pos2++;
          }
        }
      }
      if (pos2 < max2 && str2.charCodeAt(pos2) !== 10) {
        return false;
      }
      const label2 = normalizeReference(str2.slice(1, labelEnd));
      if (!label2) {
        return false;
      }
      if (silent) {
        return true;
      }
      if (typeof state.env.references === "undefined") {
        state.env.references = {};
      }
      if (typeof state.env.references[label2] === "undefined") {
        state.env.references[label2] = { title: title2, href };
      }
      state.line = nextLine;
      return true;
    }
    const block_names = [
      "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"
    ];
    const attr_name = "[a-zA-Z_:][a-zA-Z0-9:._-]*";
    const unquoted = "[^\"'=<>`\\x00-\\x20]+";
    const single_quoted = "'[^']*'";
    const double_quoted = '"[^"]*"';
    const attr_value = "(?:" + unquoted + "|" + single_quoted + "|" + double_quoted + ")";
    const attribute = "(?:\\s+" + attr_name + "(?:\\s*=\\s*" + attr_value + ")?)";
    const open_tag = "<[A-Za-z][A-Za-z0-9\\-]*" + attribute + "*\\s*\\/?>";
    const close_tag = "<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>";
    const comment$5 = "<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->";
    const processing = "<[?][\\s\\S]*?[?]>";
    const declaration = "<![A-Za-z][^>]*>";
    const cdata = "<!\\[CDATA\\[[\\s\\S]*?\\]\\]>";
    const HTML_TAG_RE = new RegExp("^(?:" + open_tag + "|" + close_tag + "|" + comment$5 + "|" + processing + "|" + declaration + "|" + cdata + ")");
    const HTML_OPEN_CLOSE_TAG_RE = new RegExp("^(?:" + open_tag + "|" + close_tag + ")");
    const HTML_SEQUENCES = [
      [/^<(script|pre|style|textarea)(?=(\s|>|$))/i, /<\/(script|pre|style|textarea)>/i, true],
      [/^<!--/, /-->/, true],
      [/^<\?/, /\?>/, true],
      [/^<![A-Z]/, />/, true],
      [/^<!\[CDATA\[/, /\]\]>/, true],
      [new RegExp("^</?(" + block_names.join("|") + ")(?=(\\s|/?>|$))", "i"), /^$/, true],
      [new RegExp(HTML_OPEN_CLOSE_TAG_RE.source + "\\s*$"), /^$/, false]
    ];
    function html_block(state, startLine, endLine, silent) {
      let pos2 = state.bMarks[startLine] + state.tShift[startLine];
      let max2 = state.eMarks[startLine];
      if (state.sCount[startLine] - state.blkIndent >= 4) {
        return false;
      }
      if (!state.md.options.html) {
        return false;
      }
      if (state.src.charCodeAt(pos2) !== 60) {
        return false;
      }
      let lineText = state.src.slice(pos2, max2);
      let i2 = 0;
      for (; i2 < HTML_SEQUENCES.length; i2++) {
        if (HTML_SEQUENCES[i2][0].test(lineText)) {
          break;
        }
      }
      if (i2 === HTML_SEQUENCES.length) {
        return false;
      }
      if (silent) {
        return HTML_SEQUENCES[i2][2];
      }
      let nextLine = startLine + 1;
      if (!HTML_SEQUENCES[i2][1].test(lineText)) {
        for (; nextLine < endLine; nextLine++) {
          if (state.sCount[nextLine] < state.blkIndent) {
            break;
          }
          pos2 = state.bMarks[nextLine] + state.tShift[nextLine];
          max2 = state.eMarks[nextLine];
          lineText = state.src.slice(pos2, max2);
          if (HTML_SEQUENCES[i2][1].test(lineText)) {
            if (lineText.length !== 0) {
              nextLine++;
            }
            break;
          }
        }
      }
      state.line = nextLine;
      const token2 = state.push("html_block", "", 0);
      token2.map = [startLine, nextLine];
      token2.content = state.getLines(startLine, nextLine, state.blkIndent, true);
      return true;
    }
    function heading$5(state, startLine, endLine, silent) {
      let pos2 = state.bMarks[startLine] + state.tShift[startLine];
      let max2 = state.eMarks[startLine];
      if (state.sCount[startLine] - state.blkIndent >= 4) {
        return false;
      }
      let ch3 = state.src.charCodeAt(pos2);
      if (ch3 !== 35 || pos2 >= max2) {
        return false;
      }
      let level = 1;
      ch3 = state.src.charCodeAt(++pos2);
      while (ch3 === 35 && pos2 < max2 && level <= 6) {
        level++;
        ch3 = state.src.charCodeAt(++pos2);
      }
      if (level > 6 || pos2 < max2 && !isSpace(ch3)) {
        return false;
      }
      if (silent) {
        return true;
      }
      max2 = state.skipSpacesBack(max2, pos2);
      const tmp = state.skipCharsBack(max2, 35, pos2);
      if (tmp > pos2 && isSpace(state.src.charCodeAt(tmp - 1))) {
        max2 = tmp;
      }
      state.line = startLine + 1;
      const token_o = state.push("heading_open", "h" + String(level), 1);
      token_o.markup = "########".slice(0, level);
      token_o.map = [startLine, state.line];
      const token_i = state.push("inline", "", 0);
      token_i.content = state.src.slice(pos2, max2).trim();
      token_i.map = [startLine, state.line];
      token_i.children = [];
      const token_c = state.push("heading_close", "h" + String(level), -1);
      token_c.markup = "########".slice(0, level);
      return true;
    }
    function lheading(state, startLine, endLine) {
      const terminatorRules = state.md.block.ruler.getRules("paragraph");
      if (state.sCount[startLine] - state.blkIndent >= 4) {
        return false;
      }
      const oldParentType = state.parentType;
      state.parentType = "paragraph";
      let level = 0;
      let marker2;
      let nextLine = startLine + 1;
      for (; nextLine < endLine && !state.isEmpty(nextLine); nextLine++) {
        if (state.sCount[nextLine] - state.blkIndent > 3) {
          continue;
        }
        if (state.sCount[nextLine] >= state.blkIndent) {
          let pos2 = state.bMarks[nextLine] + state.tShift[nextLine];
          const max2 = state.eMarks[nextLine];
          if (pos2 < max2) {
            marker2 = state.src.charCodeAt(pos2);
            if (marker2 === 45 || marker2 === 61) {
              pos2 = state.skipChars(pos2, marker2);
              pos2 = state.skipSpaces(pos2);
              if (pos2 >= max2) {
                level = marker2 === 61 ? 1 : 2;
                break;
              }
            }
          }
        }
        if (state.sCount[nextLine] < 0) {
          continue;
        }
        let terminate = false;
        for (let i2 = 0, l = terminatorRules.length; i2 < l; i2++) {
          if (terminatorRules[i2](state, nextLine, endLine, true)) {
            terminate = true;
            break;
          }
        }
        if (terminate) {
          break;
        }
      }
      if (!level) {
        return false;
      }
      const content2 = state.getLines(startLine, nextLine, state.blkIndent, false).trim();
      state.line = nextLine + 1;
      const token_o = state.push("heading_open", "h" + String(level), 1);
      token_o.markup = String.fromCharCode(marker2);
      token_o.map = [startLine, state.line];
      const token_i = state.push("inline", "", 0);
      token_i.content = content2;
      token_i.map = [startLine, state.line - 1];
      token_i.children = [];
      const token_c = state.push("heading_close", "h" + String(level), -1);
      token_c.markup = String.fromCharCode(marker2);
      state.parentType = oldParentType;
      return true;
    }
    function paragraph(state, startLine, endLine) {
      const terminatorRules = state.md.block.ruler.getRules("paragraph");
      const oldParentType = state.parentType;
      let nextLine = startLine + 1;
      state.parentType = "paragraph";
      for (; nextLine < endLine && !state.isEmpty(nextLine); nextLine++) {
        if (state.sCount[nextLine] - state.blkIndent > 3) {
          continue;
        }
        if (state.sCount[nextLine] < 0) {
          continue;
        }
        let terminate = false;
        for (let i2 = 0, l = terminatorRules.length; i2 < l; i2++) {
          if (terminatorRules[i2](state, nextLine, endLine, true)) {
            terminate = true;
            break;
          }
        }
        if (terminate) {
          break;
        }
      }
      const content2 = state.getLines(startLine, nextLine, state.blkIndent, false).trim();
      state.line = nextLine;
      const token_o = state.push("paragraph_open", "p", 1);
      token_o.map = [startLine, state.line];
      const token_i = state.push("inline", "", 0);
      token_i.content = content2;
      token_i.map = [startLine, state.line];
      token_i.children = [];
      state.push("paragraph_close", "p", -1);
      state.parentType = oldParentType;
      return true;
    }
    const _rules$1 = [
      // First 2 params - rule name & source. Secondary array - list of rules,
      // which can be terminated by this one.
      ["table", table$2, ["paragraph", "reference"]],
      ["code", code$4],
      ["fence", fence, ["paragraph", "reference", "blockquote", "list"]],
      ["blockquote", blockquote, ["paragraph", "reference", "blockquote", "list"]],
      ["hr", hr, ["paragraph", "reference", "blockquote", "list"]],
      ["list", list$2, ["paragraph", "reference", "blockquote"]],
      ["reference", reference$1],
      ["html_block", html_block, ["paragraph", "reference", "blockquote"]],
      ["heading", heading$5, ["paragraph", "reference", "blockquote"]],
      ["lheading", lheading],
      ["paragraph", paragraph]
    ];
    function ParserBlock() {
      this.ruler = new Ruler();
      for (let i2 = 0; i2 < _rules$1.length; i2++) {
        this.ruler.push(_rules$1[i2][0], _rules$1[i2][1], { alt: (_rules$1[i2][2] || []).slice() });
      }
    }
    ParserBlock.prototype.tokenize = function(state, startLine, endLine) {
      const rules = this.ruler.getRules("");
      const len = rules.length;
      const maxNesting = state.md.options.maxNesting;
      let line2 = startLine;
      let hasEmptyLines = false;
      while (line2 < endLine) {
        state.line = line2 = state.skipEmptyLines(line2);
        if (line2 >= endLine) {
          break;
        }
        if (state.sCount[line2] < state.blkIndent) {
          break;
        }
        if (state.level >= maxNesting) {
          state.line = endLine;
          break;
        }
        const prevLine = state.line;
        let ok = false;
        for (let i2 = 0; i2 < len; i2++) {
          ok = rules[i2](state, line2, endLine, false);
          if (ok) {
            if (prevLine >= state.line) {
              throw new Error("block rule didn't increment state.line");
            }
            break;
          }
        }
        if (!ok) throw new Error("none of the block rules matched");
        state.tight = !hasEmptyLines;
        if (state.isEmpty(state.line - 1)) {
          hasEmptyLines = true;
        }
        line2 = state.line;
        if (line2 < endLine && state.isEmpty(line2)) {
          hasEmptyLines = true;
          line2++;
          state.line = line2;
        }
      }
    };
    ParserBlock.prototype.parse = function(src, md, env, outTokens) {
      if (!src) {
        return;
      }
      const state = new this.State(src, md, env, outTokens);
      this.tokenize(state, state.line, state.lineMax);
    };
    ParserBlock.prototype.State = StateBlock;
    function StateInline(src, md, env, outTokens) {
      this.src = src;
      this.env = env;
      this.md = md;
      this.tokens = outTokens;
      this.tokens_meta = Array(outTokens.length);
      this.pos = 0;
      this.posMax = this.src.length;
      this.level = 0;
      this.pending = "";
      this.pendingLevel = 0;
      this.cache = {};
      this.delimiters = [];
      this._prev_delimiters = [];
      this.backticks = {};
      this.backticksScanned = false;
      this.linkLevel = 0;
    }
    StateInline.prototype.pushPending = function() {
      const token2 = new Token("text", "", 0);
      token2.content = this.pending;
      token2.level = this.pendingLevel;
      this.tokens.push(token2);
      this.pending = "";
      return token2;
    };
    StateInline.prototype.push = function(type, tag, nesting) {
      if (this.pending) {
        this.pushPending();
      }
      const token2 = new Token(type, tag, nesting);
      let token_meta = null;
      if (nesting < 0) {
        this.level--;
        this.delimiters = this._prev_delimiters.pop();
      }
      token2.level = this.level;
      if (nesting > 0) {
        this.level++;
        this._prev_delimiters.push(this.delimiters);
        this.delimiters = [];
        token_meta = { delimiters: this.delimiters };
      }
      this.pendingLevel = this.level;
      this.tokens.push(token2);
      this.tokens_meta.push(token_meta);
      return token2;
    };
    StateInline.prototype.scanDelims = function(start2, canSplitWord) {
      const max2 = this.posMax;
      const marker2 = this.src.charCodeAt(start2);
      const lastChar = start2 > 0 ? this.src.charCodeAt(start2 - 1) : 32;
      let pos2 = start2;
      while (pos2 < max2 && this.src.charCodeAt(pos2) === marker2) {
        pos2++;
      }
      const count = pos2 - start2;
      const nextChar = pos2 < max2 ? this.src.charCodeAt(pos2) : 32;
      const isLastPunctChar = isMdAsciiPunct(lastChar) || isPunctChar(String.fromCharCode(lastChar));
      const isNextPunctChar = isMdAsciiPunct(nextChar) || isPunctChar(String.fromCharCode(nextChar));
      const isLastWhiteSpace = isWhiteSpace(lastChar);
      const isNextWhiteSpace = isWhiteSpace(nextChar);
      const left_flanking = !isNextWhiteSpace && (!isNextPunctChar || isLastWhiteSpace || isLastPunctChar);
      const right_flanking = !isLastWhiteSpace && (!isLastPunctChar || isNextWhiteSpace || isNextPunctChar);
      const can_open = left_flanking && (canSplitWord || !right_flanking || isLastPunctChar);
      const can_close = right_flanking && (canSplitWord || !left_flanking || isNextPunctChar);
      return { can_open, can_close, length: count };
    };
    StateInline.prototype.Token = Token;
    function isTerminatorChar(ch3) {
      switch (ch3) {
        case 10:
        case 33:
        case 35:
        case 36:
        case 37:
        case 38:
        case 42:
        case 43:
        case 45:
        case 58:
        case 60:
        case 61:
        case 62:
        case 64:
        case 91:
        case 92:
        case 93:
        case 94:
        case 95:
        case 96:
        case 123:
        case 125:
        case 126:
          return true;
        default:
          return false;
      }
    }
    function text$1(state, silent) {
      let pos2 = state.pos;
      while (pos2 < state.posMax && !isTerminatorChar(state.src.charCodeAt(pos2))) {
        pos2++;
      }
      if (pos2 === state.pos) {
        return false;
      }
      if (!silent) {
        state.pending += state.src.slice(state.pos, pos2);
      }
      state.pos = pos2;
      return true;
    }
    const SCHEME_RE = /(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i;
    function linkify(state, silent) {
      if (!state.md.options.linkify) return false;
      if (state.linkLevel > 0) return false;
      const pos2 = state.pos;
      const max2 = state.posMax;
      if (pos2 + 3 > max2) return false;
      if (state.src.charCodeAt(pos2) !== 58) return false;
      if (state.src.charCodeAt(pos2 + 1) !== 47) return false;
      if (state.src.charCodeAt(pos2 + 2) !== 47) return false;
      const match = state.pending.match(SCHEME_RE);
      if (!match) return false;
      const proto = match[1];
      const link2 = state.md.linkify.matchAtStart(state.src.slice(pos2 - proto.length));
      if (!link2) return false;
      let url = link2.url;
      if (url.length <= proto.length) return false;
      url = url.replace(/\*+$/, "");
      const fullUrl = state.md.normalizeLink(url);
      if (!state.md.validateLink(fullUrl)) return false;
      if (!silent) {
        state.pending = state.pending.slice(0, -proto.length);
        const token_o = state.push("link_open", "a", 1);
        token_o.attrs = [["href", fullUrl]];
        token_o.markup = "linkify";
        token_o.info = "auto";
        const token_t = state.push("text", "", 0);
        token_t.content = state.md.normalizeLinkText(url);
        const token_c = state.push("link_close", "a", -1);
        token_c.markup = "linkify";
        token_c.info = "auto";
      }
      state.pos += url.length - proto.length;
      return true;
    }
    function newline(state, silent) {
      let pos2 = state.pos;
      if (state.src.charCodeAt(pos2) !== 10) {
        return false;
      }
      const pmax = state.pending.length - 1;
      const max2 = state.posMax;
      if (!silent) {
        if (pmax >= 0 && state.pending.charCodeAt(pmax) === 32) {
          if (pmax >= 1 && state.pending.charCodeAt(pmax - 1) === 32) {
            let ws = pmax - 1;
            while (ws >= 1 && state.pending.charCodeAt(ws - 1) === 32) ws--;
            state.pending = state.pending.slice(0, ws);
            state.push("hardbreak", "br", 0);
          } else {
            state.pending = state.pending.slice(0, -1);
            state.push("softbreak", "br", 0);
          }
        } else {
          state.push("softbreak", "br", 0);
        }
      }
      pos2++;
      while (pos2 < max2 && isSpace(state.src.charCodeAt(pos2))) {
        pos2++;
      }
      state.pos = pos2;
      return true;
    }
    const ESCAPED = [];
    for (let i2 = 0; i2 < 256; i2++) {
      ESCAPED.push(0);
    }
    "\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(ch3) {
      ESCAPED[ch3.charCodeAt(0)] = 1;
    });
    function escape(state, silent) {
      let pos2 = state.pos;
      const max2 = state.posMax;
      if (state.src.charCodeAt(pos2) !== 92) return false;
      pos2++;
      if (pos2 >= max2) return false;
      let ch1 = state.src.charCodeAt(pos2);
      if (ch1 === 10) {
        if (!silent) {
          state.push("hardbreak", "br", 0);
        }
        pos2++;
        while (pos2 < max2) {
          ch1 = state.src.charCodeAt(pos2);
          if (!isSpace(ch1)) break;
          pos2++;
        }
        state.pos = pos2;
        return true;
      }
      let escapedStr = state.src[pos2];
      if (ch1 >= 55296 && ch1 <= 56319 && pos2 + 1 < max2) {
        const ch22 = state.src.charCodeAt(pos2 + 1);
        if (ch22 >= 56320 && ch22 <= 57343) {
          escapedStr += state.src[pos2 + 1];
          pos2++;
        }
      }
      const origStr = "\\" + escapedStr;
      if (!silent) {
        const token2 = state.push("text_special", "", 0);
        if (ch1 < 256 && ESCAPED[ch1] !== 0) {
          token2.content = escapedStr;
        } else {
          token2.content = origStr;
        }
        token2.markup = origStr;
        token2.info = "escape";
      }
      state.pos = pos2 + 1;
      return true;
    }
    function backtick(state, silent) {
      let pos2 = state.pos;
      const ch3 = state.src.charCodeAt(pos2);
      if (ch3 !== 96) {
        return false;
      }
      const start2 = pos2;
      pos2++;
      const max2 = state.posMax;
      while (pos2 < max2 && state.src.charCodeAt(pos2) === 96) {
        pos2++;
      }
      const marker2 = state.src.slice(start2, pos2);
      const openerLength = marker2.length;
      if (state.backticksScanned && (state.backticks[openerLength] || 0) <= start2) {
        if (!silent) state.pending += marker2;
        state.pos += openerLength;
        return true;
      }
      let matchEnd = pos2;
      let matchStart;
      while ((matchStart = state.src.indexOf("`", matchEnd)) !== -1) {
        matchEnd = matchStart + 1;
        while (matchEnd < max2 && state.src.charCodeAt(matchEnd) === 96) {
          matchEnd++;
        }
        const closerLength = matchEnd - matchStart;
        if (closerLength === openerLength) {
          if (!silent) {
            const token2 = state.push("code_inline", "code", 0);
            token2.markup = marker2;
            token2.content = state.src.slice(pos2, matchStart).replace(/\n/g, " ").replace(/^ (.+) $/, "$1");
          }
          state.pos = matchEnd;
          return true;
        }
        state.backticks[closerLength] = matchStart;
      }
      state.backticksScanned = true;
      if (!silent) state.pending += marker2;
      state.pos += openerLength;
      return true;
    }
    function strikethrough_tokenize(state, silent) {
      const start2 = state.pos;
      const marker2 = state.src.charCodeAt(start2);
      if (silent) {
        return false;
      }
      if (marker2 !== 126) {
        return false;
      }
      const scanned = state.scanDelims(state.pos, true);
      let len = scanned.length;
      const ch3 = String.fromCharCode(marker2);
      if (len < 2) {
        return false;
      }
      let token2;
      if (len % 2) {
        token2 = state.push("text", "", 0);
        token2.content = ch3;
        len--;
      }
      for (let i2 = 0; i2 < len; i2 += 2) {
        token2 = state.push("text", "", 0);
        token2.content = ch3 + ch3;
        state.delimiters.push({
          marker: marker2,
          length: 0,
          // disable "rule of 3" length checks meant for emphasis
          token: state.tokens.length - 1,
          end: -1,
          open: scanned.can_open,
          close: scanned.can_close
        });
      }
      state.pos += scanned.length;
      return true;
    }
    function postProcess$1(state, delimiters2) {
      let token2;
      const loneMarkers = [];
      const max2 = delimiters2.length;
      for (let i2 = 0; i2 < max2; i2++) {
        const startDelim = delimiters2[i2];
        if (startDelim.marker !== 126) {
          continue;
        }
        if (startDelim.end === -1) {
          continue;
        }
        const endDelim = delimiters2[startDelim.end];
        token2 = state.tokens[startDelim.token];
        token2.type = "s_open";
        token2.tag = "s";
        token2.nesting = 1;
        token2.markup = "~~";
        token2.content = "";
        token2 = state.tokens[endDelim.token];
        token2.type = "s_close";
        token2.tag = "s";
        token2.nesting = -1;
        token2.markup = "~~";
        token2.content = "";
        if (state.tokens[endDelim.token - 1].type === "text" && state.tokens[endDelim.token - 1].content === "~") {
          loneMarkers.push(endDelim.token - 1);
        }
      }
      while (loneMarkers.length) {
        const i2 = loneMarkers.pop();
        let j = i2 + 1;
        while (j < state.tokens.length && state.tokens[j].type === "s_close") {
          j++;
        }
        j--;
        if (i2 !== j) {
          token2 = state.tokens[j];
          state.tokens[j] = state.tokens[i2];
          state.tokens[i2] = token2;
        }
      }
    }
    function strikethrough_postProcess(state) {
      const tokens_meta = state.tokens_meta;
      const max2 = state.tokens_meta.length;
      postProcess$1(state, state.delimiters);
      for (let curr = 0; curr < max2; curr++) {
        if (tokens_meta[curr] && tokens_meta[curr].delimiters) {
          postProcess$1(state, tokens_meta[curr].delimiters);
        }
      }
    }
    const r_strikethrough = {
      tokenize: strikethrough_tokenize,
      postProcess: strikethrough_postProcess
    };
    function emphasis_tokenize(state, silent) {
      const start2 = state.pos;
      const marker2 = state.src.charCodeAt(start2);
      if (silent) {
        return false;
      }
      if (marker2 !== 95 && marker2 !== 42) {
        return false;
      }
      const scanned = state.scanDelims(state.pos, marker2 === 42);
      for (let i2 = 0; i2 < scanned.length; i2++) {
        const token2 = state.push("text", "", 0);
        token2.content = String.fromCharCode(marker2);
        state.delimiters.push({
          // Char code of the starting marker (number).
          //
          marker: marker2,
          // Total length of these series of delimiters.
          //
          length: scanned.length,
          // A position of the token this delimiter corresponds to.
          //
          token: state.tokens.length - 1,
          // If this delimiter is matched as a valid opener, `end` will be
          // equal to its position, otherwise it's `-1`.
          //
          end: -1,
          // Boolean flags that determine if this delimiter could open or close
          // an emphasis.
          //
          open: scanned.can_open,
          close: scanned.can_close
        });
      }
      state.pos += scanned.length;
      return true;
    }
    function postProcess(state, delimiters2) {
      const max2 = delimiters2.length;
      for (let i2 = max2 - 1; i2 >= 0; i2--) {
        const startDelim = delimiters2[i2];
        if (startDelim.marker !== 95 && startDelim.marker !== 42) {
          continue;
        }
        if (startDelim.end === -1) {
          continue;
        }
        const endDelim = delimiters2[startDelim.end];
        const isStrong = i2 > 0 && delimiters2[i2 - 1].end === startDelim.end + 1 && // check that first two markers match and adjacent
        delimiters2[i2 - 1].marker === startDelim.marker && delimiters2[i2 - 1].token === startDelim.token - 1 && // check that last two markers are adjacent (we can safely assume they match)
        delimiters2[startDelim.end + 1].token === endDelim.token + 1;
        const ch3 = String.fromCharCode(startDelim.marker);
        const token_o = state.tokens[startDelim.token];
        token_o.type = isStrong ? "strong_open" : "em_open";
        token_o.tag = isStrong ? "strong" : "em";
        token_o.nesting = 1;
        token_o.markup = isStrong ? ch3 + ch3 : ch3;
        token_o.content = "";
        const token_c = state.tokens[endDelim.token];
        token_c.type = isStrong ? "strong_close" : "em_close";
        token_c.tag = isStrong ? "strong" : "em";
        token_c.nesting = -1;
        token_c.markup = isStrong ? ch3 + ch3 : ch3;
        token_c.content = "";
        if (isStrong) {
          state.tokens[delimiters2[i2 - 1].token].content = "";
          state.tokens[delimiters2[startDelim.end + 1].token].content = "";
          i2--;
        }
      }
    }
    function emphasis_post_process(state) {
      const tokens_meta = state.tokens_meta;
      const max2 = state.tokens_meta.length;
      postProcess(state, state.delimiters);
      for (let curr = 0; curr < max2; curr++) {
        if (tokens_meta[curr] && tokens_meta[curr].delimiters) {
          postProcess(state, tokens_meta[curr].delimiters);
        }
      }
    }
    const r_emphasis = {
      tokenize: emphasis_tokenize,
      postProcess: emphasis_post_process
    };
    function link(state, silent) {
      let code2, label2, res, ref;
      let href = "";
      let title2 = "";
      let start2 = state.pos;
      let parseReference = true;
      if (state.src.charCodeAt(state.pos) !== 91) {
        return false;
      }
      const oldPos = state.pos;
      const max2 = state.posMax;
      const labelStart = state.pos + 1;
      const labelEnd = state.md.helpers.parseLinkLabel(state, state.pos, true);
      if (labelEnd < 0) {
        return false;
      }
      let pos2 = labelEnd + 1;
      if (pos2 < max2 && state.src.charCodeAt(pos2) === 40) {
        parseReference = false;
        pos2++;
        for (; pos2 < max2; pos2++) {
          code2 = state.src.charCodeAt(pos2);
          if (!isSpace(code2) && code2 !== 10) {
            break;
          }
        }
        if (pos2 >= max2) {
          return false;
        }
        start2 = pos2;
        res = state.md.helpers.parseLinkDestination(state.src, pos2, state.posMax);
        if (res.ok) {
          href = state.md.normalizeLink(res.str);
          if (state.md.validateLink(href)) {
            pos2 = res.pos;
          } else {
            href = "";
          }
          start2 = pos2;
          for (; pos2 < max2; pos2++) {
            code2 = state.src.charCodeAt(pos2);
            if (!isSpace(code2) && code2 !== 10) {
              break;
            }
          }
          res = state.md.helpers.parseLinkTitle(state.src, pos2, state.posMax);
          if (pos2 < max2 && start2 !== pos2 && res.ok) {
            title2 = res.str;
            pos2 = res.pos;
            for (; pos2 < max2; pos2++) {
              code2 = state.src.charCodeAt(pos2);
              if (!isSpace(code2) && code2 !== 10) {
                break;
              }
            }
          }
        }
        if (pos2 >= max2 || state.src.charCodeAt(pos2) !== 41) {
          parseReference = true;
        }
        pos2++;
      }
      if (parseReference) {
        if (typeof state.env.references === "undefined") {
          return false;
        }
        if (pos2 < max2 && state.src.charCodeAt(pos2) === 91) {
          start2 = pos2 + 1;
          pos2 = state.md.helpers.parseLinkLabel(state, pos2);
          if (pos2 >= 0) {
            label2 = state.src.slice(start2, pos2++);
          } else {
            pos2 = labelEnd + 1;
          }
        } else {
          pos2 = labelEnd + 1;
        }
        if (!label2) {
          label2 = state.src.slice(labelStart, labelEnd);
        }
        ref = state.env.references[normalizeReference(label2)];
        if (!ref) {
          state.pos = oldPos;
          return false;
        }
        href = ref.href;
        title2 = ref.title;
      }
      if (!silent) {
        state.pos = labelStart;
        state.posMax = labelEnd;
        const token_o = state.push("link_open", "a", 1);
        const attrs = [["href", href]];
        token_o.attrs = attrs;
        if (title2) {
          attrs.push(["title", title2]);
        }
        state.linkLevel++;
        state.md.inline.tokenize(state);
        state.linkLevel--;
        state.push("link_close", "a", -1);
      }
      state.pos = pos2;
      state.posMax = max2;
      return true;
    }
    function image$2(state, silent) {
      let code2, content2, label2, pos2, ref, res, title2, start2;
      let href = "";
      const oldPos = state.pos;
      const max2 = state.posMax;
      if (state.src.charCodeAt(state.pos) !== 33) {
        return false;
      }
      if (state.src.charCodeAt(state.pos + 1) !== 91) {
        return false;
      }
      const labelStart = state.pos + 2;
      const labelEnd = state.md.helpers.parseLinkLabel(state, state.pos + 1, false);
      if (labelEnd < 0) {
        return false;
      }
      pos2 = labelEnd + 1;
      if (pos2 < max2 && state.src.charCodeAt(pos2) === 40) {
        pos2++;
        for (; pos2 < max2; pos2++) {
          code2 = state.src.charCodeAt(pos2);
          if (!isSpace(code2) && code2 !== 10) {
            break;
          }
        }
        if (pos2 >= max2) {
          return false;
        }
        start2 = pos2;
        res = state.md.helpers.parseLinkDestination(state.src, pos2, state.posMax);
        if (res.ok) {
          href = state.md.normalizeLink(res.str);
          if (state.md.validateLink(href)) {
            pos2 = res.pos;
          } else {
            href = "";
          }
        }
        start2 = pos2;
        for (; pos2 < max2; pos2++) {
          code2 = state.src.charCodeAt(pos2);
          if (!isSpace(code2) && code2 !== 10) {
            break;
          }
        }
        res = state.md.helpers.parseLinkTitle(state.src, pos2, state.posMax);
        if (pos2 < max2 && start2 !== pos2 && res.ok) {
          title2 = res.str;
          pos2 = res.pos;
          for (; pos2 < max2; pos2++) {
            code2 = state.src.charCodeAt(pos2);
            if (!isSpace(code2) && code2 !== 10) {
              break;
            }
          }
        } else {
          title2 = "";
        }
        if (pos2 >= max2 || state.src.charCodeAt(pos2) !== 41) {
          state.pos = oldPos;
          return false;
        }
        pos2++;
      } else {
        if (typeof state.env.references === "undefined") {
          return false;
        }
        if (pos2 < max2 && state.src.charCodeAt(pos2) === 91) {
          start2 = pos2 + 1;
          pos2 = state.md.helpers.parseLinkLabel(state, pos2);
          if (pos2 >= 0) {
            label2 = state.src.slice(start2, pos2++);
          } else {
            pos2 = labelEnd + 1;
          }
        } else {
          pos2 = labelEnd + 1;
        }
        if (!label2) {
          label2 = state.src.slice(labelStart, labelEnd);
        }
        ref = state.env.references[normalizeReference(label2)];
        if (!ref) {
          state.pos = oldPos;
          return false;
        }
        href = ref.href;
        title2 = ref.title;
      }
      if (!silent) {
        content2 = state.src.slice(labelStart, labelEnd);
        const tokens = [];
        state.md.inline.parse(
          content2,
          state.md,
          state.env,
          tokens
        );
        const token2 = state.push("image", "img", 0);
        const attrs = [["src", href], ["alt", ""]];
        token2.attrs = attrs;
        token2.children = tokens;
        token2.content = content2;
        if (title2) {
          attrs.push(["title", title2]);
        }
      }
      state.pos = pos2;
      state.posMax = max2;
      return true;
    }
    const EMAIL_RE = /^([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])?)*)$/;
    const AUTOLINK_RE = /^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;
    function autolink(state, silent) {
      let pos2 = state.pos;
      if (state.src.charCodeAt(pos2) !== 60) {
        return false;
      }
      const start2 = state.pos;
      const max2 = state.posMax;
      for (; ; ) {
        if (++pos2 >= max2) return false;
        const ch3 = state.src.charCodeAt(pos2);
        if (ch3 === 60) return false;
        if (ch3 === 62) break;
      }
      const url = state.src.slice(start2 + 1, pos2);
      if (AUTOLINK_RE.test(url)) {
        const fullUrl = state.md.normalizeLink(url);
        if (!state.md.validateLink(fullUrl)) {
          return false;
        }
        if (!silent) {
          const token_o = state.push("link_open", "a", 1);
          token_o.attrs = [["href", fullUrl]];
          token_o.markup = "autolink";
          token_o.info = "auto";
          const token_t = state.push("text", "", 0);
          token_t.content = state.md.normalizeLinkText(url);
          const token_c = state.push("link_close", "a", -1);
          token_c.markup = "autolink";
          token_c.info = "auto";
        }
        state.pos += url.length + 2;
        return true;
      }
      if (EMAIL_RE.test(url)) {
        const fullUrl = state.md.normalizeLink("mailto:" + url);
        if (!state.md.validateLink(fullUrl)) {
          return false;
        }
        if (!silent) {
          const token_o = state.push("link_open", "a", 1);
          token_o.attrs = [["href", fullUrl]];
          token_o.markup = "autolink";
          token_o.info = "auto";
          const token_t = state.push("text", "", 0);
          token_t.content = state.md.normalizeLinkText(url);
          const token_c = state.push("link_close", "a", -1);
          token_c.markup = "autolink";
          token_c.info = "auto";
        }
        state.pos += url.length + 2;
        return true;
      }
      return false;
    }
    function isLinkOpen(str2) {
      return /^<a[>\s]/i.test(str2);
    }
    function isLinkClose(str2) {
      return /^<\/a\s*>/i.test(str2);
    }
    function isLetter(ch3) {
      const lc = ch3 | 32;
      return lc >= 97 && lc <= 122;
    }
    function html_inline(state, silent) {
      if (!state.md.options.html) {
        return false;
      }
      const max2 = state.posMax;
      const pos2 = state.pos;
      if (state.src.charCodeAt(pos2) !== 60 || pos2 + 2 >= max2) {
        return false;
      }
      const ch3 = state.src.charCodeAt(pos2 + 1);
      if (ch3 !== 33 && ch3 !== 63 && ch3 !== 47 && !isLetter(ch3)) {
        return false;
      }
      const match = state.src.slice(pos2).match(HTML_TAG_RE);
      if (!match) {
        return false;
      }
      if (!silent) {
        const token2 = state.push("html_inline", "", 0);
        token2.content = match[0];
        if (isLinkOpen(token2.content)) state.linkLevel++;
        if (isLinkClose(token2.content)) state.linkLevel--;
      }
      state.pos += match[0].length;
      return true;
    }
    const DIGITAL_RE = /^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i;
    const NAMED_RE = /^&([a-z][a-z0-9]{1,31});/i;
    function entity(state, silent) {
      const pos2 = state.pos;
      const max2 = state.posMax;
      if (state.src.charCodeAt(pos2) !== 38) return false;
      if (pos2 + 1 >= max2) return false;
      const ch3 = state.src.charCodeAt(pos2 + 1);
      if (ch3 === 35) {
        const match = state.src.slice(pos2).match(DIGITAL_RE);
        if (match) {
          if (!silent) {
            const code2 = match[1][0].toLowerCase() === "x" ? parseInt(match[1].slice(1), 16) : parseInt(match[1], 10);
            const token2 = state.push("text_special", "", 0);
            token2.content = isValidEntityCode(code2) ? fromCodePoint$1(code2) : fromCodePoint$1(65533);
            token2.markup = match[0];
            token2.info = "entity";
          }
          state.pos += match[0].length;
          return true;
        }
      } else {
        const match = state.src.slice(pos2).match(NAMED_RE);
        if (match) {
          const decoded = decodeHTML(match[0]);
          if (decoded !== match[0]) {
            if (!silent) {
              const token2 = state.push("text_special", "", 0);
              token2.content = decoded;
              token2.markup = match[0];
              token2.info = "entity";
            }
            state.pos += match[0].length;
            return true;
          }
        }
      }
      return false;
    }
    function processDelimiters(delimiters2) {
      const openersBottom = {};
      const max2 = delimiters2.length;
      if (!max2) return;
      let headerIdx = 0;
      let lastTokenIdx = -2;
      const jumps = [];
      for (let closerIdx = 0; closerIdx < max2; closerIdx++) {
        const closer = delimiters2[closerIdx];
        jumps.push(0);
        if (delimiters2[headerIdx].marker !== closer.marker || lastTokenIdx !== closer.token - 1) {
          headerIdx = closerIdx;
        }
        lastTokenIdx = closer.token;
        closer.length = closer.length || 0;
        if (!closer.close) continue;
        if (!openersBottom.hasOwnProperty(closer.marker)) {
          openersBottom[closer.marker] = [-1, -1, -1, -1, -1, -1];
        }
        const minOpenerIdx = openersBottom[closer.marker][(closer.open ? 3 : 0) + closer.length % 3];
        let openerIdx = headerIdx - jumps[headerIdx] - 1;
        let newMinOpenerIdx = openerIdx;
        for (; openerIdx > minOpenerIdx; openerIdx -= jumps[openerIdx] + 1) {
          const opener = delimiters2[openerIdx];
          if (opener.marker !== closer.marker) continue;
          if (opener.open && opener.end < 0) {
            let isOddMatch = false;
            if (opener.close || closer.open) {
              if ((opener.length + closer.length) % 3 === 0) {
                if (opener.length % 3 !== 0 || closer.length % 3 !== 0) {
                  isOddMatch = true;
                }
              }
            }
            if (!isOddMatch) {
              const lastJump = openerIdx > 0 && !delimiters2[openerIdx - 1].open ? jumps[openerIdx - 1] + 1 : 0;
              jumps[closerIdx] = closerIdx - openerIdx + lastJump;
              jumps[openerIdx] = lastJump;
              closer.open = false;
              opener.end = closerIdx;
              opener.close = false;
              newMinOpenerIdx = -1;
              lastTokenIdx = -2;
              break;
            }
          }
        }
        if (newMinOpenerIdx !== -1) {
          openersBottom[closer.marker][(closer.open ? 3 : 0) + (closer.length || 0) % 3] = newMinOpenerIdx;
        }
      }
    }
    function link_pairs(state) {
      const tokens_meta = state.tokens_meta;
      const max2 = state.tokens_meta.length;
      processDelimiters(state.delimiters);
      for (let curr = 0; curr < max2; curr++) {
        if (tokens_meta[curr] && tokens_meta[curr].delimiters) {
          processDelimiters(tokens_meta[curr].delimiters);
        }
      }
    }
    function fragments_join(state) {
      let curr, last;
      let level = 0;
      const tokens = state.tokens;
      const max2 = state.tokens.length;
      for (curr = last = 0; curr < max2; curr++) {
        if (tokens[curr].nesting < 0) level--;
        tokens[curr].level = level;
        if (tokens[curr].nesting > 0) level++;
        if (tokens[curr].type === "text" && curr + 1 < max2 && tokens[curr + 1].type === "text") {
          tokens[curr + 1].content = tokens[curr].content + tokens[curr + 1].content;
        } else {
          if (curr !== last) {
            tokens[last] = tokens[curr];
          }
          last++;
        }
      }
      if (curr !== last) {
        tokens.length = last;
      }
    }
    const _rules = [
      ["text", text$1],
      ["linkify", linkify],
      ["newline", newline],
      ["escape", escape],
      ["backticks", backtick],
      ["strikethrough", r_strikethrough.tokenize],
      ["emphasis", r_emphasis.tokenize],
      ["link", link],
      ["image", image$2],
      ["autolink", autolink],
      ["html_inline", html_inline],
      ["entity", entity]
    ];
    const _rules2 = [
      ["balance_pairs", link_pairs],
      ["strikethrough", r_strikethrough.postProcess],
      ["emphasis", r_emphasis.postProcess],
      // rules for pairs separate '**' into its own text tokens, which may be left unused,
      // rule below merges unused segments back with the rest of the text
      ["fragments_join", fragments_join]
    ];
    function ParserInline() {
      this.ruler = new Ruler();
      for (let i2 = 0; i2 < _rules.length; i2++) {
        this.ruler.push(_rules[i2][0], _rules[i2][1]);
      }
      this.ruler2 = new Ruler();
      for (let i2 = 0; i2 < _rules2.length; i2++) {
        this.ruler2.push(_rules2[i2][0], _rules2[i2][1]);
      }
    }
    ParserInline.prototype.skipToken = function(state) {
      const pos2 = state.pos;
      const rules = this.ruler.getRules("");
      const len = rules.length;
      const maxNesting = state.md.options.maxNesting;
      const cache = state.cache;
      if (typeof cache[pos2] !== "undefined") {
        state.pos = cache[pos2];
        return;
      }
      let ok = false;
      if (state.level < maxNesting) {
        for (let i2 = 0; i2 < len; i2++) {
          state.level++;
          ok = rules[i2](state, true);
          state.level--;
          if (ok) {
            if (pos2 >= state.pos) {
              throw new Error("inline rule didn't increment state.pos");
            }
            break;
          }
        }
      } else {
        state.pos = state.posMax;
      }
      if (!ok) {
        state.pos++;
      }
      cache[pos2] = state.pos;
    };
    ParserInline.prototype.tokenize = function(state) {
      const rules = this.ruler.getRules("");
      const len = rules.length;
      const end2 = state.posMax;
      const maxNesting = state.md.options.maxNesting;
      while (state.pos < end2) {
        const prevPos = state.pos;
        let ok = false;
        if (state.level < maxNesting) {
          for (let i2 = 0; i2 < len; i2++) {
            ok = rules[i2](state, false);
            if (ok) {
              if (prevPos >= state.pos) {
                throw new Error("inline rule didn't increment state.pos");
              }
              break;
            }
          }
        }
        if (ok) {
          if (state.pos >= end2) {
            break;
          }
          continue;
        }
        state.pending += state.src[state.pos++];
      }
      if (state.pending) {
        state.pushPending();
      }
    };
    ParserInline.prototype.parse = function(str2, md, env, outTokens) {
      const state = new this.State(str2, md, env, outTokens);
      this.tokenize(state);
      const rules = this.ruler2.getRules("");
      const len = rules.length;
      for (let i2 = 0; i2 < len; i2++) {
        rules[i2](state);
      }
    };
    ParserInline.prototype.State = StateInline;
    function reFactory(opts) {
      const re2 = {};
      opts = opts || {};
      re2.src_Any = Any.source;
      re2.src_Cc = Cc.source;
      re2.src_Z = Z.source;
      re2.src_P = P.source;
      re2.src_ZPCc = [re2.src_Z, re2.src_P, re2.src_Cc].join("|");
      re2.src_ZCc = [re2.src_Z, re2.src_Cc].join("|");
      const text_separators = "[><｜]";
      re2.src_pseudo_letter = "(?:(?!" + text_separators + "|" + re2.src_ZPCc + ")" + re2.src_Any + ")";
      re2.src_ip4 = "(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)";
      re2.src_auth = "(?:(?:(?!" + re2.src_ZCc + "|[@/\\[\\]()]).)+@)?";
      re2.src_port = "(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?";
      re2.src_host_terminator = "(?=$|" + text_separators + "|" + re2.src_ZPCc + ")(?!" + (opts["---"] ? "-(?!--)|" : "-|") + "_|:\\d|\\.-|\\.(?!$|" + re2.src_ZPCc + "))";
      re2.src_path = "(?:[/?#](?:(?!" + re2.src_ZCc + "|" + text_separators + `|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!` + re2.src_ZCc + "|\\]).)*\\]|\\((?:(?!" + re2.src_ZCc + "|[)]).)*\\)|\\{(?:(?!" + re2.src_ZCc + '|[}]).)*\\}|\\"(?:(?!' + re2.src_ZCc + `|["]).)+\\"|\\'(?:(?!` + re2.src_ZCc + "|[']).)+\\'|\\'(?=" + re2.src_pseudo_letter + "|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!" + re2.src_ZCc + "|[.]|$)|" + (opts["---"] ? "\\-(?!--(?:[^-]|$))(?:-*)|" : "\\-+|") + // allow `,,,` in paths
      ",(?!" + re2.src_ZCc + "|$)|;(?!" + re2.src_ZCc + "|$)|\\!+(?!" + re2.src_ZCc + "|[!]|$)|\\?(?!" + re2.src_ZCc + "|[?]|$))+|\\/)?";
      re2.src_email_name = '[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*';
      re2.src_xn = "xn--[a-z0-9\\-]{1,59}";
      re2.src_domain_root = // Allow letters & digits (http://test1)
      "(?:" + re2.src_xn + "|" + re2.src_pseudo_letter + "{1,63})";
      re2.src_domain = "(?:" + re2.src_xn + "|(?:" + re2.src_pseudo_letter + ")|(?:" + re2.src_pseudo_letter + "(?:-|" + re2.src_pseudo_letter + "){0,61}" + re2.src_pseudo_letter + "))";
      re2.src_host = "(?:(?:(?:(?:" + re2.src_domain + ")\\.)*" + re2.src_domain + "))";
      re2.tpl_host_fuzzy = "(?:" + re2.src_ip4 + "|(?:(?:(?:" + re2.src_domain + ")\\.)+(?:%TLDS%)))";
      re2.tpl_host_no_ip_fuzzy = "(?:(?:(?:" + re2.src_domain + ")\\.)+(?:%TLDS%))";
      re2.src_host_strict = re2.src_host + re2.src_host_terminator;
      re2.tpl_host_fuzzy_strict = re2.tpl_host_fuzzy + re2.src_host_terminator;
      re2.src_host_port_strict = re2.src_host + re2.src_port + re2.src_host_terminator;
      re2.tpl_host_port_fuzzy_strict = re2.tpl_host_fuzzy + re2.src_port + re2.src_host_terminator;
      re2.tpl_host_port_no_ip_fuzzy_strict = re2.tpl_host_no_ip_fuzzy + re2.src_port + re2.src_host_terminator;
      re2.tpl_host_fuzzy_test = "localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:" + re2.src_ZPCc + "|>|$))";
      re2.tpl_email_fuzzy = "(^|" + text_separators + '|"|\\(|' + re2.src_ZCc + ")(" + re2.src_email_name + "@" + re2.tpl_host_fuzzy_strict + ")";
      re2.tpl_link_fuzzy = // Fuzzy link can't be prepended with .:/\- and non punctuation.
      // but can start with > (markdown blockquote)
      "(^|(?![.:/\\-_@])(?:[$+<=>^`|｜]|" + re2.src_ZPCc + "))((?![$+<=>^`|｜])" + re2.tpl_host_port_fuzzy_strict + re2.src_path + ")";
      re2.tpl_link_no_ip_fuzzy = // Fuzzy link can't be prepended with .:/\- and non punctuation.
      // but can start with > (markdown blockquote)
      "(^|(?![.:/\\-_@])(?:[$+<=>^`|｜]|" + re2.src_ZPCc + "))((?![$+<=>^`|｜])" + re2.tpl_host_port_no_ip_fuzzy_strict + re2.src_path + ")";
      return re2;
    }
    function assign(obj) {
      const sources = Array.prototype.slice.call(arguments, 1);
      sources.forEach(function(source2) {
        if (!source2) {
          return;
        }
        Object.keys(source2).forEach(function(key2) {
          obj[key2] = source2[key2];
        });
      });
      return obj;
    }
    function _class(obj) {
      return Object.prototype.toString.call(obj);
    }
    function isString(obj) {
      return _class(obj) === "[object String]";
    }
    function isObject(obj) {
      return _class(obj) === "[object Object]";
    }
    function isRegExp(obj) {
      return _class(obj) === "[object RegExp]";
    }
    function isFunction(obj) {
      return _class(obj) === "[object Function]";
    }
    function escapeRE(str2) {
      return str2.replace(/[.?*+^$[\]\\(){}|-]/g, "\\$&");
    }
    const defaultOptions = {
      fuzzyLink: true,
      fuzzyEmail: true,
      fuzzyIP: false
    };
    function isOptionsObj(obj) {
      return Object.keys(obj || {}).reduce(function(acc, k2) {
        return acc || defaultOptions.hasOwnProperty(k2);
      }, false);
    }
    const defaultSchemas = {
      "http:": {
        validate: function(text2, pos2, self2) {
          const tail = text2.slice(pos2);
          if (!self2.re.http) {
            self2.re.http = new RegExp(
              "^\\/\\/" + self2.re.src_auth + self2.re.src_host_port_strict + self2.re.src_path,
              "i"
            );
          }
          if (self2.re.http.test(tail)) {
            return tail.match(self2.re.http)[0].length;
          }
          return 0;
        }
      },
      "https:": "http:",
      "ftp:": "http:",
      "//": {
        validate: function(text2, pos2, self2) {
          const tail = text2.slice(pos2);
          if (!self2.re.no_http) {
            self2.re.no_http = new RegExp(
              "^" + self2.re.src_auth + // Don't allow single-level domains, because of false positives like '//test'
              // with code comments
              "(?:localhost|(?:(?:" + self2.re.src_domain + ")\\.)+" + self2.re.src_domain_root + ")" + self2.re.src_port + self2.re.src_host_terminator + self2.re.src_path,
              "i"
            );
          }
          if (self2.re.no_http.test(tail)) {
            if (pos2 >= 3 && text2[pos2 - 3] === ":") {
              return 0;
            }
            if (pos2 >= 3 && text2[pos2 - 3] === "/") {
              return 0;
            }
            return tail.match(self2.re.no_http)[0].length;
          }
          return 0;
        }
      },
      "mailto:": {
        validate: function(text2, pos2, self2) {
          const tail = text2.slice(pos2);
          if (!self2.re.mailto) {
            self2.re.mailto = new RegExp(
              "^" + self2.re.src_email_name + "@" + self2.re.src_host_strict,
              "i"
            );
          }
          if (self2.re.mailto.test(tail)) {
            return tail.match(self2.re.mailto)[0].length;
          }
          return 0;
        }
      }
    };
    const tlds_2ch_src_re = "a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]";
    const tlds_default = "biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");
    function resetScanCache(self2) {
      self2.__index__ = -1;
      self2.__text_cache__ = "";
    }
    function createValidator(re2) {
      return function(text2, pos2) {
        const tail = text2.slice(pos2);
        if (re2.test(tail)) {
          return tail.match(re2)[0].length;
        }
        return 0;
      };
    }
    function createNormalizer() {
      return function(match, self2) {
        self2.normalize(match);
      };
    }
    function compile$2(self2) {
      const re2 = self2.re = reFactory(self2.__opts__);
      const tlds = self2.__tlds__.slice();
      self2.onCompile();
      if (!self2.__tlds_replaced__) {
        tlds.push(tlds_2ch_src_re);
      }
      tlds.push(re2.src_xn);
      re2.src_tlds = tlds.join("|");
      function untpl(tpl) {
        return tpl.replace("%TLDS%", re2.src_tlds);
      }
      re2.email_fuzzy = RegExp(untpl(re2.tpl_email_fuzzy), "i");
      re2.link_fuzzy = RegExp(untpl(re2.tpl_link_fuzzy), "i");
      re2.link_no_ip_fuzzy = RegExp(untpl(re2.tpl_link_no_ip_fuzzy), "i");
      re2.host_fuzzy_test = RegExp(untpl(re2.tpl_host_fuzzy_test), "i");
      const aliases2 = [];
      self2.__compiled__ = {};
      function schemaError(name2, val) {
        throw new Error('(LinkifyIt) Invalid schema "' + name2 + '": ' + val);
      }
      Object.keys(self2.__schemas__).forEach(function(name2) {
        const val = self2.__schemas__[name2];
        if (val === null) {
          return;
        }
        const compiled = { validate: null, link: null };
        self2.__compiled__[name2] = compiled;
        if (isObject(val)) {
          if (isRegExp(val.validate)) {
            compiled.validate = createValidator(val.validate);
          } else if (isFunction(val.validate)) {
            compiled.validate = val.validate;
          } else {
            schemaError(name2, val);
          }
          if (isFunction(val.normalize)) {
            compiled.normalize = val.normalize;
          } else if (!val.normalize) {
            compiled.normalize = createNormalizer();
          } else {
            schemaError(name2, val);
          }
          return;
        }
        if (isString(val)) {
          aliases2.push(name2);
          return;
        }
        schemaError(name2, val);
      });
      aliases2.forEach(function(alias) {
        if (!self2.__compiled__[self2.__schemas__[alias]]) {
          return;
        }
        self2.__compiled__[alias].validate = self2.__compiled__[self2.__schemas__[alias]].validate;
        self2.__compiled__[alias].normalize = self2.__compiled__[self2.__schemas__[alias]].normalize;
      });
      self2.__compiled__[""] = { validate: null, normalize: createNormalizer() };
      const slist = Object.keys(self2.__compiled__).filter(function(name2) {
        return name2.length > 0 && self2.__compiled__[name2];
      }).map(escapeRE).join("|");
      self2.re.schema_test = RegExp("(^|(?!_)(?:[><｜]|" + re2.src_ZPCc + "))(" + slist + ")", "i");
      self2.re.schema_search = RegExp("(^|(?!_)(?:[><｜]|" + re2.src_ZPCc + "))(" + slist + ")", "ig");
      self2.re.schema_at_start = RegExp("^" + self2.re.schema_search.source, "i");
      self2.re.pretest = RegExp(
        "(" + self2.re.schema_test.source + ")|(" + self2.re.host_fuzzy_test.source + ")|@",
        "i"
      );
      resetScanCache(self2);
    }
    function Match$1(self2, shift2) {
      const start2 = self2.__index__;
      const end2 = self2.__last_index__;
      const text2 = self2.__text_cache__.slice(start2, end2);
      this.schema = self2.__schema__.toLowerCase();
      this.index = start2 + shift2;
      this.lastIndex = end2 + shift2;
      this.raw = text2;
      this.text = text2;
      this.url = text2;
    }
    function createMatch(self2, shift2) {
      const match = new Match$1(self2, shift2);
      self2.__compiled__[match.schema].normalize(match, self2);
      return match;
    }
    function LinkifyIt(schemas, options2) {
      if (!(this instanceof LinkifyIt)) {
        return new LinkifyIt(schemas, options2);
      }
      if (!options2) {
        if (isOptionsObj(schemas)) {
          options2 = schemas;
          schemas = {};
        }
      }
      this.__opts__ = assign({}, defaultOptions, options2);
      this.__index__ = -1;
      this.__last_index__ = -1;
      this.__schema__ = "";
      this.__text_cache__ = "";
      this.__schemas__ = assign({}, defaultSchemas, schemas);
      this.__compiled__ = {};
      this.__tlds__ = tlds_default;
      this.__tlds_replaced__ = false;
      this.re = {};
      compile$2(this);
    }
    LinkifyIt.prototype.add = function add2(schema, definition) {
      this.__schemas__[schema] = definition;
      compile$2(this);
      return this;
    };
    LinkifyIt.prototype.set = function set2(options2) {
      this.__opts__ = assign(this.__opts__, options2);
      return this;
    };
    LinkifyIt.prototype.test = function test(text2) {
      this.__text_cache__ = text2;
      this.__index__ = -1;
      if (!text2.length) {
        return false;
      }
      let m, ml, me2, len, shift2, next, re2, tld_pos, at_pos;
      if (this.re.schema_test.test(text2)) {
        re2 = this.re.schema_search;
        re2.lastIndex = 0;
        while ((m = re2.exec(text2)) !== null) {
          len = this.testSchemaAt(text2, m[2], re2.lastIndex);
          if (len) {
            this.__schema__ = m[2];
            this.__index__ = m.index + m[1].length;
            this.__last_index__ = m.index + m[0].length + len;
            break;
          }
        }
      }
      if (this.__opts__.fuzzyLink && this.__compiled__["http:"]) {
        tld_pos = text2.search(this.re.host_fuzzy_test);
        if (tld_pos >= 0) {
          if (this.__index__ < 0 || tld_pos < this.__index__) {
            if ((ml = text2.match(this.__opts__.fuzzyIP ? this.re.link_fuzzy : this.re.link_no_ip_fuzzy)) !== null) {
              shift2 = ml.index + ml[1].length;
              if (this.__index__ < 0 || shift2 < this.__index__) {
                this.__schema__ = "";
                this.__index__ = shift2;
                this.__last_index__ = ml.index + ml[0].length;
              }
            }
          }
        }
      }
      if (this.__opts__.fuzzyEmail && this.__compiled__["mailto:"]) {
        at_pos = text2.indexOf("@");
        if (at_pos >= 0) {
          if ((me2 = text2.match(this.re.email_fuzzy)) !== null) {
            shift2 = me2.index + me2[1].length;
            next = me2.index + me2[0].length;
            if (this.__index__ < 0 || shift2 < this.__index__ || shift2 === this.__index__ && next > this.__last_index__) {
              this.__schema__ = "mailto:";
              this.__index__ = shift2;
              this.__last_index__ = next;
            }
          }
        }
      }
      return this.__index__ >= 0;
    };
    LinkifyIt.prototype.pretest = function pretest(text2) {
      return this.re.pretest.test(text2);
    };
    LinkifyIt.prototype.testSchemaAt = function testSchemaAt(text2, schema, pos2) {
      if (!this.__compiled__[schema.toLowerCase()]) {
        return 0;
      }
      return this.__compiled__[schema.toLowerCase()].validate(text2, pos2, this);
    };
    LinkifyIt.prototype.match = function match(text2) {
      const result2 = [];
      let shift2 = 0;
      if (this.__index__ >= 0 && this.__text_cache__ === text2) {
        result2.push(createMatch(this, shift2));
        shift2 = this.__last_index__;
      }
      let tail = shift2 ? text2.slice(shift2) : text2;
      while (this.test(tail)) {
        result2.push(createMatch(this, shift2));
        tail = tail.slice(this.__last_index__);
        shift2 += this.__last_index__;
      }
      if (result2.length) {
        return result2;
      }
      return null;
    };
    LinkifyIt.prototype.matchAtStart = function matchAtStart(text2) {
      this.__text_cache__ = text2;
      this.__index__ = -1;
      if (!text2.length) return null;
      const m = this.re.schema_at_start.exec(text2);
      if (!m) return null;
      const len = this.testSchemaAt(text2, m[2], m[0].length);
      if (!len) return null;
      this.__schema__ = m[2];
      this.__index__ = m.index + m[1].length;
      this.__last_index__ = m.index + m[0].length + len;
      return createMatch(this, 0);
    };
    LinkifyIt.prototype.tlds = function tlds(list2, keepOld) {
      list2 = Array.isArray(list2) ? list2 : [list2];
      if (!keepOld) {
        this.__tlds__ = list2.slice();
        this.__tlds_replaced__ = true;
        compile$2(this);
        return this;
      }
      this.__tlds__ = this.__tlds__.concat(list2).sort().filter(function(el2, idx, arr2) {
        return el2 !== arr2[idx - 1];
      }).reverse();
      compile$2(this);
      return this;
    };
    LinkifyIt.prototype.normalize = function normalize2(match) {
      if (!match.schema) {
        match.url = "http://" + match.url;
      }
      if (match.schema === "mailto:" && !/^mailto:/i.test(match.url)) {
        match.url = "mailto:" + match.url;
      }
    };
    LinkifyIt.prototype.onCompile = function onCompile() {
    };
    const maxInt = 2147483647;
    const base$1 = 36;
    const tMin = 1;
    const tMax = 26;
    const skew = 38;
    const damp = 700;
    const initialBias = 72;
    const initialN = 128;
    const delimiter = "-";
    const regexPunycode = /^xn--/;
    const regexNonASCII = /[^\0-\x7F]/;
    const regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g;
    const errors = {
      "overflow": "Overflow: input needs wider integers to process",
      "not-basic": "Illegal input >= 0x80 (not a basic code point)",
      "invalid-input": "Invalid input"
    };
    const baseMinusTMin = base$1 - tMin;
    const floor = Math.floor;
    const stringFromCharCode = String.fromCharCode;
    function error$3(type) {
      throw new RangeError(errors[type]);
    }
    function map$1(array, callback) {
      const result2 = [];
      let length = array.length;
      while (length--) {
        result2[length] = callback(array[length]);
      }
      return result2;
    }
    function mapDomain(domain, callback) {
      const parts = domain.split("@");
      let result2 = "";
      if (parts.length > 1) {
        result2 = parts[0] + "@";
        domain = parts[1];
      }
      domain = domain.replace(regexSeparators, ".");
      const labels = domain.split(".");
      const encoded = map$1(labels, callback).join(".");
      return result2 + encoded;
    }
    function ucs2decode(string2) {
      const output2 = [];
      let counter2 = 0;
      const length = string2.length;
      while (counter2 < length) {
        const value2 = string2.charCodeAt(counter2++);
        if (value2 >= 55296 && value2 <= 56319 && counter2 < length) {
          const extra = string2.charCodeAt(counter2++);
          if ((extra & 64512) == 56320) {
            output2.push(((value2 & 1023) << 10) + (extra & 1023) + 65536);
          } else {
            output2.push(value2);
            counter2--;
          }
        } else {
          output2.push(value2);
        }
      }
      return output2;
    }
    const ucs2encode = (codePoints) => String.fromCodePoint(...codePoints);
    const basicToDigit = function(codePoint) {
      if (codePoint >= 48 && codePoint < 58) {
        return 26 + (codePoint - 48);
      }
      if (codePoint >= 65 && codePoint < 91) {
        return codePoint - 65;
      }
      if (codePoint >= 97 && codePoint < 123) {
        return codePoint - 97;
      }
      return base$1;
    };
    const digitToBasic = function(digit, flag) {
      return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);
    };
    const adapt = function(delta2, numPoints, firstTime) {
      let k2 = 0;
      delta2 = firstTime ? floor(delta2 / damp) : delta2 >> 1;
      delta2 += floor(delta2 / numPoints);
      for (; delta2 > baseMinusTMin * tMax >> 1; k2 += base$1) {
        delta2 = floor(delta2 / baseMinusTMin);
      }
      return floor(k2 + (baseMinusTMin + 1) * delta2 / (delta2 + skew));
    };
    const decode$1 = function(input2) {
      const output2 = [];
      const inputLength = input2.length;
      let i2 = 0;
      let n = initialN;
      let bias = initialBias;
      let basic = input2.lastIndexOf(delimiter);
      if (basic < 0) {
        basic = 0;
      }
      for (let j = 0; j < basic; ++j) {
        if (input2.charCodeAt(j) >= 128) {
          error$3("not-basic");
        }
        output2.push(input2.charCodeAt(j));
      }
      for (let index = basic > 0 ? basic + 1 : 0; index < inputLength; ) {
        const oldi = i2;
        for (let w = 1, k2 = base$1; ; k2 += base$1) {
          if (index >= inputLength) {
            error$3("invalid-input");
          }
          const digit = basicToDigit(input2.charCodeAt(index++));
          if (digit >= base$1) {
            error$3("invalid-input");
          }
          if (digit > floor((maxInt - i2) / w)) {
            error$3("overflow");
          }
          i2 += digit * w;
          const t2 = k2 <= bias ? tMin : k2 >= bias + tMax ? tMax : k2 - bias;
          if (digit < t2) {
            break;
          }
          const baseMinusT = base$1 - t2;
          if (w > floor(maxInt / baseMinusT)) {
            error$3("overflow");
          }
          w *= baseMinusT;
        }
        const out = output2.length + 1;
        bias = adapt(i2 - oldi, out, oldi == 0);
        if (floor(i2 / out) > maxInt - n) {
          error$3("overflow");
        }
        n += floor(i2 / out);
        i2 %= out;
        output2.splice(i2++, 0, n);
      }
      return String.fromCodePoint(...output2);
    };
    const encode$1 = function(input2) {
      const output2 = [];
      input2 = ucs2decode(input2);
      const inputLength = input2.length;
      let n = initialN;
      let delta2 = 0;
      let bias = initialBias;
      for (const currentValue of input2) {
        if (currentValue < 128) {
          output2.push(stringFromCharCode(currentValue));
        }
      }
      const basicLength = output2.length;
      let handledCPCount = basicLength;
      if (basicLength) {
        output2.push(delimiter);
      }
      while (handledCPCount < inputLength) {
        let m = maxInt;
        for (const currentValue of input2) {
          if (currentValue >= n && currentValue < m) {
            m = currentValue;
          }
        }
        const handledCPCountPlusOne = handledCPCount + 1;
        if (m - n > floor((maxInt - delta2) / handledCPCountPlusOne)) {
          error$3("overflow");
        }
        delta2 += (m - n) * handledCPCountPlusOne;
        n = m;
        for (const currentValue of input2) {
          if (currentValue < n && ++delta2 > maxInt) {
            error$3("overflow");
          }
          if (currentValue === n) {
            let q = delta2;
            for (let k2 = base$1; ; k2 += base$1) {
              const t2 = k2 <= bias ? tMin : k2 >= bias + tMax ? tMax : k2 - bias;
              if (q < t2) {
                break;
              }
              const qMinusT = q - t2;
              const baseMinusT = base$1 - t2;
              output2.push(
                stringFromCharCode(digitToBasic(t2 + qMinusT % baseMinusT, 0))
              );
              q = floor(qMinusT / baseMinusT);
            }
            output2.push(stringFromCharCode(digitToBasic(q, 0)));
            bias = adapt(delta2, handledCPCountPlusOne, handledCPCount === basicLength);
            delta2 = 0;
            ++handledCPCount;
          }
        }
        ++delta2;
        ++n;
      }
      return output2.join("");
    };
    const toUnicode = function(input2) {
      return mapDomain(input2, function(string2) {
        return regexPunycode.test(string2) ? decode$1(string2.slice(4).toLowerCase()) : string2;
      });
    };
    const toASCII = function(input2) {
      return mapDomain(input2, function(string2) {
        return regexNonASCII.test(string2) ? "xn--" + encode$1(string2) : string2;
      });
    };
    const punycode = {
      /**
       * A string representing the current Punycode.js version number.
       * @memberOf punycode
       * @type String
       */
      "version": "2.3.1",
      /**
       * An object of methods to convert from JavaScript's internal character
       * representation (UCS-2) to Unicode code points, and back.
       * @see <https://mathiasbynens.be/notes/javascript-encoding>
       * @memberOf punycode
       * @type Object
       */
      "ucs2": {
        "decode": ucs2decode,
        "encode": ucs2encode
      },
      "decode": decode$1,
      "encode": encode$1,
      "toASCII": toASCII,
      "toUnicode": toUnicode
    };
    const cfg_default = {
      options: {
        // Enable HTML tags in source
        html: false,
        // Use '/' to close single tags (<br />)
        xhtmlOut: false,
        // Convert '\n' in paragraphs into <br>
        breaks: false,
        // CSS language prefix for fenced blocks
        langPrefix: "language-",
        // autoconvert URL-like texts to links
        linkify: false,
        // Enable some language-neutral replacements + quotes beautification
        typographer: false,
        // Double + single quotes replacement pairs, when typographer enabled,
        // and smartquotes on. Could be either a String or an Array.
        //
        // For example, you can use '«»„“' for Russian, '„“‚‘' for German,
        // and ['«\xA0', '\xA0»', '‹\xA0', '\xA0›'] for French (including nbsp).
        quotes: "“”‘’",
        /* “”‘’ */
        // Highlighter function. Should return escaped HTML,
        // or '' if the source string is not changed and should be escaped externaly.
        // If result starts with <pre... internal wrapper is skipped.
        //
        // function (/*str, lang*/) { return ''; }
        //
        highlight: null,
        // Internal protection, recursion limit
        maxNesting: 100
      },
      components: {
        core: {},
        block: {},
        inline: {}
      }
    };
    const cfg_zero = {
      options: {
        // Enable HTML tags in source
        html: false,
        // Use '/' to close single tags (<br />)
        xhtmlOut: false,
        // Convert '\n' in paragraphs into <br>
        breaks: false,
        // CSS language prefix for fenced blocks
        langPrefix: "language-",
        // autoconvert URL-like texts to links
        linkify: false,
        // Enable some language-neutral replacements + quotes beautification
        typographer: false,
        // Double + single quotes replacement pairs, when typographer enabled,
        // and smartquotes on. Could be either a String or an Array.
        //
        // For example, you can use '«»„“' for Russian, '„“‚‘' for German,
        // and ['«\xA0', '\xA0»', '‹\xA0', '\xA0›'] for French (including nbsp).
        quotes: "“”‘’",
        /* “”‘’ */
        // Highlighter function. Should return escaped HTML,
        // or '' if the source string is not changed and should be escaped externaly.
        // If result starts with <pre... internal wrapper is skipped.
        //
        // function (/*str, lang*/) { return ''; }
        //
        highlight: null,
        // Internal protection, recursion limit
        maxNesting: 20
      },
      components: {
        core: {
          rules: [
            "normalize",
            "block",
            "inline",
            "text_join"
          ]
        },
        block: {
          rules: [
            "paragraph"
          ]
        },
        inline: {
          rules: [
            "text"
          ],
          rules2: [
            "balance_pairs",
            "fragments_join"
          ]
        }
      }
    };
    const cfg_commonmark = {
      options: {
        // Enable HTML tags in source
        html: true,
        // Use '/' to close single tags (<br />)
        xhtmlOut: true,
        // Convert '\n' in paragraphs into <br>
        breaks: false,
        // CSS language prefix for fenced blocks
        langPrefix: "language-",
        // autoconvert URL-like texts to links
        linkify: false,
        // Enable some language-neutral replacements + quotes beautification
        typographer: false,
        // Double + single quotes replacement pairs, when typographer enabled,
        // and smartquotes on. Could be either a String or an Array.
        //
        // For example, you can use '«»„“' for Russian, '„“‚‘' for German,
        // and ['«\xA0', '\xA0»', '‹\xA0', '\xA0›'] for French (including nbsp).
        quotes: "“”‘’",
        /* “”‘’ */
        // Highlighter function. Should return escaped HTML,
        // or '' if the source string is not changed and should be escaped externaly.
        // If result starts with <pre... internal wrapper is skipped.
        //
        // function (/*str, lang*/) { return ''; }
        //
        highlight: null,
        // Internal protection, recursion limit
        maxNesting: 20
      },
      components: {
        core: {
          rules: [
            "normalize",
            "block",
            "inline",
            "text_join"
          ]
        },
        block: {
          rules: [
            "blockquote",
            "code",
            "fence",
            "heading",
            "hr",
            "html_block",
            "lheading",
            "list",
            "reference",
            "paragraph"
          ]
        },
        inline: {
          rules: [
            "autolink",
            "backticks",
            "emphasis",
            "entity",
            "escape",
            "html_inline",
            "image",
            "link",
            "newline",
            "text"
          ],
          rules2: [
            "balance_pairs",
            "emphasis",
            "fragments_join"
          ]
        }
      }
    };
    const config = {
      default: cfg_default,
      zero: cfg_zero,
      commonmark: cfg_commonmark
    };
    const BAD_PROTO_RE = /^(vbscript|javascript|file|data):/;
    const GOOD_DATA_RE = /^data:image\/(gif|png|jpeg|webp);/;
    function validateLink(url) {
      const str2 = url.trim().toLowerCase();
      return BAD_PROTO_RE.test(str2) ? GOOD_DATA_RE.test(str2) : true;
    }
    const RECODE_HOSTNAME_FOR = ["http:", "https:", "mailto:"];
    function normalizeLink(url) {
      const parsed = urlParse(url, true);
      if (parsed.hostname) {
        if (!parsed.protocol || RECODE_HOSTNAME_FOR.indexOf(parsed.protocol) >= 0) {
          try {
            parsed.hostname = punycode.toASCII(parsed.hostname);
          } catch (er2) {
          }
        }
      }
      return encode$2(format$1(parsed));
    }
    function normalizeLinkText(url) {
      const parsed = urlParse(url, true);
      if (parsed.hostname) {
        if (!parsed.protocol || RECODE_HOSTNAME_FOR.indexOf(parsed.protocol) >= 0) {
          try {
            parsed.hostname = punycode.toUnicode(parsed.hostname);
          } catch (er2) {
          }
        }
      }
      return decode$2(format$1(parsed), decode$2.defaultChars + "%");
    }
    function MarkdownIt(presetName, options2) {
      if (!(this instanceof MarkdownIt)) {
        return new MarkdownIt(presetName, options2);
      }
      if (!options2) {
        if (!isString$1(presetName)) {
          options2 = presetName || {};
          presetName = "default";
        }
      }
      this.inline = new ParserInline();
      this.block = new ParserBlock();
      this.core = new Core$1();
      this.renderer = new Renderer();
      this.linkify = new LinkifyIt();
      this.validateLink = validateLink;
      this.normalizeLink = normalizeLink;
      this.normalizeLinkText = normalizeLinkText;
      this.utils = utils$2;
      this.helpers = assign$1({}, helpers$2);
      this.options = {};
      this.configure(presetName);
      if (options2) {
        this.set(options2);
      }
    }
    MarkdownIt.prototype.set = function(options2) {
      assign$1(this.options, options2);
      return this;
    };
    MarkdownIt.prototype.configure = function(presets) {
      const self2 = this;
      if (isString$1(presets)) {
        const presetName = presets;
        presets = config[presetName];
        if (!presets) {
          throw new Error('Wrong `markdown-it` preset "' + presetName + '", check name');
        }
      }
      if (!presets) {
        throw new Error("Wrong `markdown-it` preset, can't be empty");
      }
      if (presets.options) {
        self2.set(presets.options);
      }
      if (presets.components) {
        Object.keys(presets.components).forEach(function(name2) {
          if (presets.components[name2].rules) {
            self2[name2].ruler.enableOnly(presets.components[name2].rules);
          }
          if (presets.components[name2].rules2) {
            self2[name2].ruler2.enableOnly(presets.components[name2].rules2);
          }
        });
      }
      return this;
    };
    MarkdownIt.prototype.enable = function(list2, ignoreInvalid) {
      let result2 = [];
      if (!Array.isArray(list2)) {
        list2 = [list2];
      }
      ["core", "block", "inline"].forEach(function(chain) {
        result2 = result2.concat(this[chain].ruler.enable(list2, true));
      }, this);
      result2 = result2.concat(this.inline.ruler2.enable(list2, true));
      const missed = list2.filter(function(name2) {
        return result2.indexOf(name2) < 0;
      });
      if (missed.length && !ignoreInvalid) {
        throw new Error("MarkdownIt. Failed to enable unknown rule(s): " + missed);
      }
      return this;
    };
    MarkdownIt.prototype.disable = function(list2, ignoreInvalid) {
      let result2 = [];
      if (!Array.isArray(list2)) {
        list2 = [list2];
      }
      ["core", "block", "inline"].forEach(function(chain) {
        result2 = result2.concat(this[chain].ruler.disable(list2, true));
      }, this);
      result2 = result2.concat(this.inline.ruler2.disable(list2, true));
      const missed = list2.filter(function(name2) {
        return result2.indexOf(name2) < 0;
      });
      if (missed.length && !ignoreInvalid) {
        throw new Error("MarkdownIt. Failed to disable unknown rule(s): " + missed);
      }
      return this;
    };
    MarkdownIt.prototype.use = function(plugin) {
      const args2 = [this].concat(Array.prototype.slice.call(arguments, 1));
      plugin.apply(plugin, args2);
      return this;
    };
    MarkdownIt.prototype.parse = function(src, env) {
      if (typeof src !== "string") {
        throw new Error("Input data should be a String");
      }
      const state = new this.core.State(src, this, env);
      this.core.process(state);
      return state.tokens;
    };
    MarkdownIt.prototype.render = function(src, env) {
      env = env || {};
      return this.renderer.render(this.parse(src, env), this.options, env);
    };
    MarkdownIt.prototype.parseInline = function(src, env) {
      const state = new this.core.State(src, this, env);
      state.inlineMode = true;
      this.core.process(state);
      return state.tokens;
    };
    MarkdownIt.prototype.renderInline = function(src, env) {
      env = env || {};
      return this.renderer.render(this.parseInline(src, env), this.options, env);
    };
    var mathjax = {};
    var version = {};
    var hasRequiredVersion;
    function requireVersion() {
      if (hasRequiredVersion) return version;
      hasRequiredVersion = 1;
      Object.defineProperty(version, "__esModule", { value: true });
      version.VERSION = void 0;
      version.VERSION = "3.2.2";
      return version;
    }
    var HandlerList = {};
    var PrioritizedList = {};
    var hasRequiredPrioritizedList;
    function requirePrioritizedList() {
      if (hasRequiredPrioritizedList) return PrioritizedList;
      hasRequiredPrioritizedList = 1;
      Object.defineProperty(PrioritizedList, "__esModule", { value: true });
      PrioritizedList.PrioritizedList = void 0;
      var PrioritizedList$1 = (function() {
        function PrioritizedList2() {
          this.items = [];
          this.items = [];
        }
        PrioritizedList2.prototype[Symbol.iterator] = function() {
          var i2 = 0;
          var items = this.items;
          return {
            next: function() {
              return { value: items[i2++], done: i2 > items.length };
            }
          };
        };
        PrioritizedList2.prototype.add = function(item2, priority) {
          if (priority === void 0) {
            priority = PrioritizedList2.DEFAULTPRIORITY;
          }
          var i2 = this.items.length;
          do {
            i2--;
          } while (i2 >= 0 && priority < this.items[i2].priority);
          this.items.splice(i2 + 1, 0, { item: item2, priority });
          return item2;
        };
        PrioritizedList2.prototype.remove = function(item2) {
          var i2 = this.items.length;
          do {
            i2--;
          } while (i2 >= 0 && this.items[i2].item !== item2);
          if (i2 >= 0) {
            this.items.splice(i2, 1);
          }
        };
        PrioritizedList2.DEFAULTPRIORITY = 5;
        return PrioritizedList2;
      })();
      PrioritizedList.PrioritizedList = PrioritizedList$1;
      return PrioritizedList;
    }
    var hasRequiredHandlerList;
    function requireHandlerList() {
      if (hasRequiredHandlerList) return HandlerList;
      hasRequiredHandlerList = 1;
      var __extends2 = HandlerList && HandlerList.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      var __values2 = HandlerList && HandlerList.__values || function(o) {
        var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i2 = 0;
        if (m) return m.call(o);
        if (o && typeof o.length === "number") return {
          next: function() {
            if (o && i2 >= o.length) o = void 0;
            return { value: o && o[i2++], done: !o };
          }
        };
        throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
      };
      Object.defineProperty(HandlerList, "__esModule", { value: true });
      HandlerList.HandlerList = void 0;
      var PrioritizedList_js_1 = requirePrioritizedList();
      var HandlerList$1 = (function(_super) {
        __extends2(HandlerList2, _super);
        function HandlerList2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        HandlerList2.prototype.register = function(handler) {
          return this.add(handler, handler.priority);
        };
        HandlerList2.prototype.unregister = function(handler) {
          this.remove(handler);
        };
        HandlerList2.prototype.handlesDocument = function(document2) {
          var e_1, _a2;
          try {
            for (var _b2 = __values2(this), _c = _b2.next(); !_c.done; _c = _b2.next()) {
              var item2 = _c.value;
              var handler = item2.item;
              if (handler.handlesDocument(document2)) {
                return handler;
              }
            }
          } catch (e_1_1) {
            e_1 = { error: e_1_1 };
          } finally {
            try {
              if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
            } finally {
              if (e_1) throw e_1.error;
            }
          }
          throw new Error("Can't find handler for document");
        };
        HandlerList2.prototype.document = function(document2, options2) {
          if (options2 === void 0) {
            options2 = null;
          }
          return this.handlesDocument(document2).create(document2, options2);
        };
        return HandlerList2;
      })(PrioritizedList_js_1.PrioritizedList);
      HandlerList.HandlerList = HandlerList$1;
      return HandlerList;
    }
    var Retries = {};
    var hasRequiredRetries;
    function requireRetries() {
      if (hasRequiredRetries) return Retries;
      hasRequiredRetries = 1;
      Object.defineProperty(Retries, "__esModule", { value: true });
      Retries.retryAfter = Retries.handleRetriesFor = void 0;
      function handleRetriesFor(code2) {
        return new Promise(function run(ok, fail) {
          try {
            ok(code2());
          } catch (err2) {
            if (err2.retry && err2.retry instanceof Promise) {
              err2.retry.then(function() {
                return run(ok, fail);
              }).catch(function(perr) {
                return fail(perr);
              });
            } else if (err2.restart && err2.restart.isCallback) {
              MathJax.Callback.After(function() {
                return run(ok, fail);
              }, err2.restart);
            } else {
              fail(err2);
            }
          }
        });
      }
      Retries.handleRetriesFor = handleRetriesFor;
      function retryAfter(promise) {
        var err2 = new Error("MathJax retry");
        err2.retry = promise;
        throw err2;
      }
      Retries.retryAfter = retryAfter;
      return Retries;
    }
    var hasRequiredMathjax;
    function requireMathjax() {
      if (hasRequiredMathjax) return mathjax;
      hasRequiredMathjax = 1;
      (function(exports2) {
        Object.defineProperty(exports2, "__esModule", { value: true });
        exports2.mathjax = void 0;
        var version_js_1 = requireVersion();
        var HandlerList_js_1 = requireHandlerList();
        var Retries_js_1 = requireRetries();
        exports2.mathjax = {
          version: version_js_1.VERSION,
          handlers: new HandlerList_js_1.HandlerList(),
          document: function(document2, options2) {
            return exports2.mathjax.handlers.document(document2, options2);
          },
          handleRetriesFor: Retries_js_1.handleRetriesFor,
          retryAfter: Retries_js_1.retryAfter,
          asyncLoad: null
        };
      })(mathjax);
      return mathjax;
    }
    var tex$2 = {};
    var InputJax = {};
    var Options = {};
    var hasRequiredOptions$1;
    function requireOptions$1() {
      if (hasRequiredOptions$1) return Options;
      hasRequiredOptions$1 = 1;
      (function(exports2) {
        var __values2 = Options && Options.__values || function(o) {
          var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i2 = 0;
          if (m) return m.call(o);
          if (o && typeof o.length === "number") return {
            next: function() {
              if (o && i2 >= o.length) o = void 0;
              return { value: o && o[i2++], done: !o };
            }
          };
          throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
        };
        var __read2 = Options && Options.__read || function(o, n) {
          var m = typeof Symbol === "function" && o[Symbol.iterator];
          if (!m) return o;
          var i2 = m.call(o), r2, ar2 = [], e;
          try {
            while ((n === void 0 || n-- > 0) && !(r2 = i2.next()).done) ar2.push(r2.value);
          } catch (error2) {
            e = { error: error2 };
          } finally {
            try {
              if (r2 && !r2.done && (m = i2["return"])) m.call(i2);
            } finally {
              if (e) throw e.error;
            }
          }
          return ar2;
        };
        var __spreadArray2 = Options && Options.__spreadArray || function(to2, from, pack) {
          if (pack || arguments.length === 2) for (var i2 = 0, l = from.length, ar2; i2 < l; i2++) {
            if (ar2 || !(i2 in from)) {
              if (!ar2) ar2 = Array.prototype.slice.call(from, 0, i2);
              ar2[i2] = from[i2];
            }
          }
          return to2.concat(ar2 || Array.prototype.slice.call(from));
        };
        Object.defineProperty(exports2, "__esModule", { value: true });
        exports2.lookup = exports2.separateOptions = exports2.selectOptionsFromKeys = exports2.selectOptions = exports2.userOptions = exports2.defaultOptions = exports2.insert = exports2.copy = exports2.keys = exports2.makeArray = exports2.expandable = exports2.Expandable = exports2.OPTIONS = exports2.REMOVE = exports2.APPEND = exports2.isObject = void 0;
        var OBJECT = {}.constructor;
        function isObject2(obj) {
          return typeof obj === "object" && obj !== null && (obj.constructor === OBJECT || obj.constructor === Expandable);
        }
        exports2.isObject = isObject2;
        exports2.APPEND = "[+]";
        exports2.REMOVE = "[-]";
        exports2.OPTIONS = {
          invalidOption: "warn",
          optionError: function(message2, _key) {
            if (exports2.OPTIONS.invalidOption === "fatal") {
              throw new Error(message2);
            }
            console.warn("MathJax: " + message2);
          }
        };
        var Expandable = /* @__PURE__ */ (function() {
          function Expandable2() {
          }
          return Expandable2;
        })();
        exports2.Expandable = Expandable;
        function expandable(def) {
          return Object.assign(Object.create(Expandable.prototype), def);
        }
        exports2.expandable = expandable;
        function makeArray(x2) {
          return Array.isArray(x2) ? x2 : [x2];
        }
        exports2.makeArray = makeArray;
        function keys(def) {
          if (!def) {
            return [];
          }
          return Object.keys(def).concat(Object.getOwnPropertySymbols(def));
        }
        exports2.keys = keys;
        function copy2(def) {
          var e_1, _a2;
          var props = {};
          try {
            for (var _b2 = __values2(keys(def)), _c = _b2.next(); !_c.done; _c = _b2.next()) {
              var key2 = _c.value;
              var prop2 = Object.getOwnPropertyDescriptor(def, key2);
              var value2 = prop2.value;
              if (Array.isArray(value2)) {
                prop2.value = insert2([], value2, false);
              } else if (isObject2(value2)) {
                prop2.value = copy2(value2);
              }
              if (prop2.enumerable) {
                props[key2] = prop2;
              }
            }
          } catch (e_1_1) {
            e_1 = { error: e_1_1 };
          } finally {
            try {
              if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
            } finally {
              if (e_1) throw e_1.error;
            }
          }
          return Object.defineProperties(def.constructor === Expandable ? expandable({}) : {}, props);
        }
        exports2.copy = copy2;
        function insert2(dst, src, warn) {
          var e_2, _a2;
          if (warn === void 0) {
            warn = true;
          }
          var _loop_1 = function(key3) {
            if (warn && dst[key3] === void 0 && dst.constructor !== Expandable) {
              if (typeof key3 === "symbol") {
                key3 = key3.toString();
              }
              exports2.OPTIONS.optionError('Invalid option "'.concat(key3, '" (no default value).'), key3);
              return "continue";
            }
            var sval = src[key3], dval = dst[key3];
            if (isObject2(sval) && dval !== null && (typeof dval === "object" || typeof dval === "function")) {
              var ids = keys(sval);
              if (Array.isArray(dval) && (ids.length === 1 && (ids[0] === exports2.APPEND || ids[0] === exports2.REMOVE) && Array.isArray(sval[ids[0]]) || ids.length === 2 && ids.sort().join(",") === exports2.APPEND + "," + exports2.REMOVE && Array.isArray(sval[exports2.APPEND]) && Array.isArray(sval[exports2.REMOVE]))) {
                if (sval[exports2.REMOVE]) {
                  dval = dst[key3] = dval.filter(function(x2) {
                    return sval[exports2.REMOVE].indexOf(x2) < 0;
                  });
                }
                if (sval[exports2.APPEND]) {
                  dst[key3] = __spreadArray2(__spreadArray2([], __read2(dval), false), __read2(sval[exports2.APPEND]), false);
                }
              } else {
                insert2(dval, sval, warn);
              }
            } else if (Array.isArray(sval)) {
              dst[key3] = [];
              insert2(dst[key3], sval, false);
            } else if (isObject2(sval)) {
              dst[key3] = copy2(sval);
            } else {
              dst[key3] = sval;
            }
          };
          try {
            for (var _b2 = __values2(keys(src)), _c = _b2.next(); !_c.done; _c = _b2.next()) {
              var key2 = _c.value;
              _loop_1(key2);
            }
          } catch (e_2_1) {
            e_2 = { error: e_2_1 };
          } finally {
            try {
              if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
            } finally {
              if (e_2) throw e_2.error;
            }
          }
          return dst;
        }
        exports2.insert = insert2;
        function defaultOptions2(options2) {
          var defs = [];
          for (var _i = 1; _i < arguments.length; _i++) {
            defs[_i - 1] = arguments[_i];
          }
          defs.forEach(function(def) {
            return insert2(options2, def, false);
          });
          return options2;
        }
        exports2.defaultOptions = defaultOptions2;
        function userOptions(options2) {
          var defs = [];
          for (var _i = 1; _i < arguments.length; _i++) {
            defs[_i - 1] = arguments[_i];
          }
          defs.forEach(function(def) {
            return insert2(options2, def, true);
          });
          return options2;
        }
        exports2.userOptions = userOptions;
        function selectOptions(options2) {
          var e_3, _a2;
          var keys2 = [];
          for (var _i = 1; _i < arguments.length; _i++) {
            keys2[_i - 1] = arguments[_i];
          }
          var subset2 = {};
          try {
            for (var keys_1 = __values2(keys2), keys_1_1 = keys_1.next(); !keys_1_1.done; keys_1_1 = keys_1.next()) {
              var key2 = keys_1_1.value;
              if (options2.hasOwnProperty(key2)) {
                subset2[key2] = options2[key2];
              }
            }
          } catch (e_3_1) {
            e_3 = { error: e_3_1 };
          } finally {
            try {
              if (keys_1_1 && !keys_1_1.done && (_a2 = keys_1.return)) _a2.call(keys_1);
            } finally {
              if (e_3) throw e_3.error;
            }
          }
          return subset2;
        }
        exports2.selectOptions = selectOptions;
        function selectOptionsFromKeys(options2, object) {
          return selectOptions.apply(void 0, __spreadArray2([options2], __read2(Object.keys(object)), false));
        }
        exports2.selectOptionsFromKeys = selectOptionsFromKeys;
        function separateOptions(options2) {
          var e_4, _a2, e_5, _b2;
          var objects = [];
          for (var _i = 1; _i < arguments.length; _i++) {
            objects[_i - 1] = arguments[_i];
          }
          var results = [];
          try {
            for (var objects_1 = __values2(objects), objects_1_1 = objects_1.next(); !objects_1_1.done; objects_1_1 = objects_1.next()) {
              var object = objects_1_1.value;
              var exists = {}, missing = {};
              try {
                for (var _c = (e_5 = void 0, __values2(Object.keys(options2 || {}))), _d = _c.next(); !_d.done; _d = _c.next()) {
                  var key2 = _d.value;
                  (object[key2] === void 0 ? missing : exists)[key2] = options2[key2];
                }
              } catch (e_5_1) {
                e_5 = { error: e_5_1 };
              } finally {
                try {
                  if (_d && !_d.done && (_b2 = _c.return)) _b2.call(_c);
                } finally {
                  if (e_5) throw e_5.error;
                }
              }
              results.push(exists);
              options2 = missing;
            }
          } catch (e_4_1) {
            e_4 = { error: e_4_1 };
          } finally {
            try {
              if (objects_1_1 && !objects_1_1.done && (_a2 = objects_1.return)) _a2.call(objects_1);
            } finally {
              if (e_4) throw e_4.error;
            }
          }
          results.unshift(options2);
          return results;
        }
        exports2.separateOptions = separateOptions;
        function lookup(name2, lookup2, def) {
          if (def === void 0) {
            def = null;
          }
          return lookup2.hasOwnProperty(name2) ? lookup2[name2] : def;
        }
        exports2.lookup = lookup;
      })(Options);
      return Options;
    }
    var FunctionList = {};
    var hasRequiredFunctionList;
    function requireFunctionList() {
      if (hasRequiredFunctionList) return FunctionList;
      hasRequiredFunctionList = 1;
      var __extends2 = FunctionList && FunctionList.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      var __values2 = FunctionList && FunctionList.__values || function(o) {
        var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i2 = 0;
        if (m) return m.call(o);
        if (o && typeof o.length === "number") return {
          next: function() {
            if (o && i2 >= o.length) o = void 0;
            return { value: o && o[i2++], done: !o };
          }
        };
        throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
      };
      var __read2 = FunctionList && FunctionList.__read || function(o, n) {
        var m = typeof Symbol === "function" && o[Symbol.iterator];
        if (!m) return o;
        var i2 = m.call(o), r2, ar2 = [], e;
        try {
          while ((n === void 0 || n-- > 0) && !(r2 = i2.next()).done) ar2.push(r2.value);
        } catch (error2) {
          e = { error: error2 };
        } finally {
          try {
            if (r2 && !r2.done && (m = i2["return"])) m.call(i2);
          } finally {
            if (e) throw e.error;
          }
        }
        return ar2;
      };
      var __spreadArray2 = FunctionList && FunctionList.__spreadArray || function(to2, from, pack) {
        if (pack || arguments.length === 2) for (var i2 = 0, l = from.length, ar2; i2 < l; i2++) {
          if (ar2 || !(i2 in from)) {
            if (!ar2) ar2 = Array.prototype.slice.call(from, 0, i2);
            ar2[i2] = from[i2];
          }
        }
        return to2.concat(ar2 || Array.prototype.slice.call(from));
      };
      Object.defineProperty(FunctionList, "__esModule", { value: true });
      FunctionList.FunctionList = void 0;
      var PrioritizedList_js_1 = requirePrioritizedList();
      var FunctionList$1 = (function(_super) {
        __extends2(FunctionList2, _super);
        function FunctionList2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        FunctionList2.prototype.execute = function() {
          var e_1, _a2;
          var data = [];
          for (var _i = 0; _i < arguments.length; _i++) {
            data[_i] = arguments[_i];
          }
          try {
            for (var _b2 = __values2(this), _c = _b2.next(); !_c.done; _c = _b2.next()) {
              var item2 = _c.value;
              var result2 = item2.item.apply(item2, __spreadArray2([], __read2(data), false));
              if (result2 === false) {
                return false;
              }
            }
          } catch (e_1_1) {
            e_1 = { error: e_1_1 };
          } finally {
            try {
              if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
            } finally {
              if (e_1) throw e_1.error;
            }
          }
          return true;
        };
        FunctionList2.prototype.asyncExecute = function() {
          var data = [];
          for (var _i = 0; _i < arguments.length; _i++) {
            data[_i] = arguments[_i];
          }
          var i2 = -1;
          var items = this.items;
          return new Promise(function(ok, fail) {
            (function execute() {
              var _a2;
              while (++i2 < items.length) {
                var result2 = (_a2 = items[i2]).item.apply(_a2, __spreadArray2([], __read2(data), false));
                if (result2 instanceof Promise) {
                  result2.then(execute).catch(function(err2) {
                    return fail(err2);
                  });
                  return;
                }
                if (result2 === false) {
                  ok(false);
                  return;
                }
              }
              ok(true);
            })();
          });
        };
        return FunctionList2;
      })(PrioritizedList_js_1.PrioritizedList);
      FunctionList.FunctionList = FunctionList$1;
      return FunctionList;
    }
    var hasRequiredInputJax;
    function requireInputJax() {
      if (hasRequiredInputJax) return InputJax;
      hasRequiredInputJax = 1;
      Object.defineProperty(InputJax, "__esModule", { value: true });
      InputJax.AbstractInputJax = void 0;
      var Options_js_1 = requireOptions$1();
      var FunctionList_js_1 = requireFunctionList();
      var AbstractInputJax = (function() {
        function AbstractInputJax2(options2) {
          if (options2 === void 0) {
            options2 = {};
          }
          this.adaptor = null;
          this.mmlFactory = null;
          var CLASS = this.constructor;
          this.options = (0, Options_js_1.userOptions)((0, Options_js_1.defaultOptions)({}, CLASS.OPTIONS), options2);
          this.preFilters = new FunctionList_js_1.FunctionList();
          this.postFilters = new FunctionList_js_1.FunctionList();
        }
        Object.defineProperty(AbstractInputJax2.prototype, "name", {
          get: function() {
            return this.constructor.NAME;
          },
          enumerable: false,
          configurable: true
        });
        AbstractInputJax2.prototype.setAdaptor = function(adaptor) {
          this.adaptor = adaptor;
        };
        AbstractInputJax2.prototype.setMmlFactory = function(mmlFactory) {
          this.mmlFactory = mmlFactory;
        };
        AbstractInputJax2.prototype.initialize = function() {
        };
        AbstractInputJax2.prototype.reset = function() {
        };
        Object.defineProperty(AbstractInputJax2.prototype, "processStrings", {
          get: function() {
            return true;
          },
          enumerable: false,
          configurable: true
        });
        AbstractInputJax2.prototype.findMath = function(_node, _options) {
          return [];
        };
        AbstractInputJax2.prototype.executeFilters = function(filters2, math2, document2, data) {
          var args2 = { math: math2, document: document2, data };
          filters2.execute(args2);
          return args2.data;
        };
        AbstractInputJax2.NAME = "generic";
        AbstractInputJax2.OPTIONS = {};
        return AbstractInputJax2;
      })();
      InputJax.AbstractInputJax = AbstractInputJax;
      return InputJax;
    }
    var FindTeX = {};
    var FindMath = {};
    var hasRequiredFindMath;
    function requireFindMath() {
      if (hasRequiredFindMath) return FindMath;
      hasRequiredFindMath = 1;
      Object.defineProperty(FindMath, "__esModule", { value: true });
      FindMath.AbstractFindMath = void 0;
      var Options_js_1 = requireOptions$1();
      var AbstractFindMath = (function() {
        function AbstractFindMath2(options2) {
          var CLASS = this.constructor;
          this.options = (0, Options_js_1.userOptions)((0, Options_js_1.defaultOptions)({}, CLASS.OPTIONS), options2);
        }
        AbstractFindMath2.OPTIONS = {};
        return AbstractFindMath2;
      })();
      FindMath.AbstractFindMath = AbstractFindMath;
      return FindMath;
    }
    var string$5 = {};
    var hasRequiredString;
    function requireString() {
      if (hasRequiredString) return string$5;
      hasRequiredString = 1;
      var __read2 = string$5 && string$5.__read || function(o, n) {
        var m = typeof Symbol === "function" && o[Symbol.iterator];
        if (!m) return o;
        var i2 = m.call(o), r2, ar2 = [], e;
        try {
          while ((n === void 0 || n-- > 0) && !(r2 = i2.next()).done) ar2.push(r2.value);
        } catch (error2) {
          e = { error: error2 };
        } finally {
          try {
            if (r2 && !r2.done && (m = i2["return"])) m.call(i2);
          } finally {
            if (e) throw e.error;
          }
        }
        return ar2;
      };
      var __spreadArray2 = string$5 && string$5.__spreadArray || function(to2, from, pack) {
        if (pack || arguments.length === 2) for (var i2 = 0, l = from.length, ar2; i2 < l; i2++) {
          if (ar2 || !(i2 in from)) {
            if (!ar2) ar2 = Array.prototype.slice.call(from, 0, i2);
            ar2[i2] = from[i2];
          }
        }
        return to2.concat(ar2 || Array.prototype.slice.call(from));
      };
      Object.defineProperty(string$5, "__esModule", { value: true });
      string$5.split = string$5.isPercent = string$5.unicodeString = string$5.unicodeChars = string$5.quotePattern = string$5.sortLength = void 0;
      function sortLength(a, b) {
        return a.length !== b.length ? b.length - a.length : a === b ? 0 : a < b ? -1 : 1;
      }
      string$5.sortLength = sortLength;
      function quotePattern(text2) {
        return text2.replace(/([\^$(){}+*?\-|\[\]\:\\])/g, "\\$1");
      }
      string$5.quotePattern = quotePattern;
      function unicodeChars(text2) {
        return Array.from(text2).map(function(c2) {
          return c2.codePointAt(0);
        });
      }
      string$5.unicodeChars = unicodeChars;
      function unicodeString(data) {
        return String.fromCodePoint.apply(String, __spreadArray2([], __read2(data), false));
      }
      string$5.unicodeString = unicodeString;
      function isPercent(x2) {
        return !!x2.match(/%\s*$/);
      }
      string$5.isPercent = isPercent;
      function split(x2) {
        return x2.trim().split(/\s+/);
      }
      string$5.split = split;
      return string$5;
    }
    var MathItem = {};
    var hasRequiredMathItem;
    function requireMathItem() {
      if (hasRequiredMathItem) return MathItem;
      hasRequiredMathItem = 1;
      (function(exports2) {
        Object.defineProperty(exports2, "__esModule", { value: true });
        exports2.newState = exports2.STATE = exports2.AbstractMathItem = exports2.protoItem = void 0;
        function protoItem(open, math2, close2, n, start2, end2, display) {
          if (display === void 0) {
            display = null;
          }
          var item2 = {
            open,
            math: math2,
            close: close2,
            n,
            start: { n: start2 },
            end: { n: end2 },
            display
          };
          return item2;
        }
        exports2.protoItem = protoItem;
        var AbstractMathItem = (function() {
          function AbstractMathItem2(math2, jax, display, start2, end2) {
            if (display === void 0) {
              display = true;
            }
            if (start2 === void 0) {
              start2 = { i: 0, n: 0, delim: "" };
            }
            if (end2 === void 0) {
              end2 = { i: 0, n: 0, delim: "" };
            }
            this.root = null;
            this.typesetRoot = null;
            this.metrics = {};
            this.inputData = {};
            this.outputData = {};
            this._state = exports2.STATE.UNPROCESSED;
            this.math = math2;
            this.inputJax = jax;
            this.display = display;
            this.start = start2;
            this.end = end2;
            this.root = null;
            this.typesetRoot = null;
            this.metrics = {};
            this.inputData = {};
            this.outputData = {};
          }
          Object.defineProperty(AbstractMathItem2.prototype, "isEscaped", {
            get: function() {
              return this.display === null;
            },
            enumerable: false,
            configurable: true
          });
          AbstractMathItem2.prototype.render = function(document2) {
            document2.renderActions.renderMath(this, document2);
          };
          AbstractMathItem2.prototype.rerender = function(document2, start2) {
            if (start2 === void 0) {
              start2 = exports2.STATE.RERENDER;
            }
            if (this.state() >= start2) {
              this.state(start2 - 1);
            }
            document2.renderActions.renderMath(this, document2, start2);
          };
          AbstractMathItem2.prototype.convert = function(document2, end2) {
            if (end2 === void 0) {
              end2 = exports2.STATE.LAST;
            }
            document2.renderActions.renderConvert(this, document2, end2);
          };
          AbstractMathItem2.prototype.compile = function(document2) {
            if (this.state() < exports2.STATE.COMPILED) {
              this.root = this.inputJax.compile(this, document2);
              this.state(exports2.STATE.COMPILED);
            }
          };
          AbstractMathItem2.prototype.typeset = function(document2) {
            if (this.state() < exports2.STATE.TYPESET) {
              this.typesetRoot = document2.outputJax[this.isEscaped ? "escaped" : "typeset"](this, document2);
              this.state(exports2.STATE.TYPESET);
            }
          };
          AbstractMathItem2.prototype.updateDocument = function(_document) {
          };
          AbstractMathItem2.prototype.removeFromDocument = function(_restore) {
          };
          AbstractMathItem2.prototype.setMetrics = function(em, ex, cwidth, lwidth, scale) {
            this.metrics = {
              em,
              ex,
              containerWidth: cwidth,
              lineWidth: lwidth,
              scale
            };
          };
          AbstractMathItem2.prototype.state = function(state, restore) {
            if (state === void 0) {
              state = null;
            }
            if (restore === void 0) {
              restore = false;
            }
            if (state != null) {
              if (state < exports2.STATE.INSERTED && this._state >= exports2.STATE.INSERTED) {
                this.removeFromDocument(restore);
              }
              if (state < exports2.STATE.TYPESET && this._state >= exports2.STATE.TYPESET) {
                this.outputData = {};
              }
              if (state < exports2.STATE.COMPILED && this._state >= exports2.STATE.COMPILED) {
                this.inputData = {};
              }
              this._state = state;
            }
            return this._state;
          };
          AbstractMathItem2.prototype.reset = function(restore) {
            if (restore === void 0) {
              restore = false;
            }
            this.state(exports2.STATE.UNPROCESSED, restore);
          };
          return AbstractMathItem2;
        })();
        exports2.AbstractMathItem = AbstractMathItem;
        exports2.STATE = {
          UNPROCESSED: 0,
          FINDMATH: 10,
          COMPILED: 20,
          CONVERT: 100,
          METRICS: 110,
          RERENDER: 125,
          TYPESET: 150,
          INSERTED: 200,
          LAST: 1e4
        };
        function newState(name2, state) {
          if (name2 in exports2.STATE) {
            throw Error("State " + name2 + " already exists");
          }
          exports2.STATE[name2] = state;
        }
        exports2.newState = newState;
      })(MathItem);
      return MathItem;
    }
    var hasRequiredFindTeX;
    function requireFindTeX() {
      if (hasRequiredFindTeX) return FindTeX;
      hasRequiredFindTeX = 1;
      var __extends2 = FindTeX && FindTeX.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      var __read2 = FindTeX && FindTeX.__read || function(o, n) {
        var m = typeof Symbol === "function" && o[Symbol.iterator];
        if (!m) return o;
        var i2 = m.call(o), r2, ar2 = [], e;
        try {
          while ((n === void 0 || n-- > 0) && !(r2 = i2.next()).done) ar2.push(r2.value);
        } catch (error2) {
          e = { error: error2 };
        } finally {
          try {
            if (r2 && !r2.done && (m = i2["return"])) m.call(i2);
          } finally {
            if (e) throw e.error;
          }
        }
        return ar2;
      };
      Object.defineProperty(FindTeX, "__esModule", { value: true });
      FindTeX.FindTeX = void 0;
      var FindMath_js_1 = requireFindMath();
      var string_js_1 = requireString();
      var MathItem_js_1 = requireMathItem();
      var FindTeX$1 = (function(_super) {
        __extends2(FindTeX2, _super);
        function FindTeX2(options2) {
          var _this = _super.call(this, options2) || this;
          _this.getPatterns();
          return _this;
        }
        FindTeX2.prototype.getPatterns = function() {
          var _this = this;
          var options2 = this.options;
          var starts = [], parts = [], subparts = [];
          this.end = {};
          this.env = this.sub = 0;
          var i2 = 1;
          options2["inlineMath"].forEach(function(delims2) {
            return _this.addPattern(starts, delims2, false);
          });
          options2["displayMath"].forEach(function(delims2) {
            return _this.addPattern(starts, delims2, true);
          });
          if (starts.length) {
            parts.push(starts.sort(string_js_1.sortLength).join("|"));
          }
          if (options2["processEnvironments"]) {
            parts.push("\\\\begin\\s*\\{([^}]*)\\}");
            this.env = i2;
            i2++;
          }
          if (options2["processEscapes"]) {
            subparts.push("\\\\([\\\\$])");
          }
          if (options2["processRefs"]) {
            subparts.push("(\\\\(?:eq)?ref\\s*\\{[^}]*\\})");
          }
          if (subparts.length) {
            parts.push("(" + subparts.join("|") + ")");
            this.sub = i2;
          }
          this.start = new RegExp(parts.join("|"), "g");
          this.hasPatterns = parts.length > 0;
        };
        FindTeX2.prototype.addPattern = function(starts, delims2, display) {
          var _a2 = __read2(delims2, 2), open = _a2[0], close2 = _a2[1];
          starts.push((0, string_js_1.quotePattern)(open));
          this.end[open] = [close2, display, this.endPattern(close2)];
        };
        FindTeX2.prototype.endPattern = function(end2, endp) {
          return new RegExp((endp || (0, string_js_1.quotePattern)(end2)) + "|\\\\(?:[a-zA-Z]|.)|[{}]", "g");
        };
        FindTeX2.prototype.findEnd = function(text2, n, start2, end2) {
          var _a2 = __read2(end2, 3), close2 = _a2[0], display = _a2[1], pattern = _a2[2];
          var i2 = pattern.lastIndex = start2.index + start2[0].length;
          var match, braces = 0;
          while (match = pattern.exec(text2)) {
            if ((match[1] || match[0]) === close2 && braces === 0) {
              return (0, MathItem_js_1.protoItem)(start2[0], text2.substr(i2, match.index - i2), match[0], n, start2.index, match.index + match[0].length, display);
            } else if (match[0] === "{") {
              braces++;
            } else if (match[0] === "}" && braces) {
              braces--;
            }
          }
          return null;
        };
        FindTeX2.prototype.findMathInString = function(math2, n, text2) {
          var start2, match;
          this.start.lastIndex = 0;
          while (start2 = this.start.exec(text2)) {
            if (start2[this.env] !== void 0 && this.env) {
              var end2 = "\\\\end\\s*(\\{" + (0, string_js_1.quotePattern)(start2[this.env]) + "\\})";
              match = this.findEnd(text2, n, start2, ["{" + start2[this.env] + "}", true, this.endPattern(null, end2)]);
              if (match) {
                match.math = match.open + match.math + match.close;
                match.open = match.close = "";
              }
            } else if (start2[this.sub] !== void 0 && this.sub) {
              var math_1 = start2[this.sub];
              var end2 = start2.index + start2[this.sub].length;
              if (math_1.length === 2) {
                match = (0, MathItem_js_1.protoItem)("", math_1.substr(1), "", n, start2.index, end2);
              } else {
                match = (0, MathItem_js_1.protoItem)("", math_1, "", n, start2.index, end2, false);
              }
            } else {
              match = this.findEnd(text2, n, start2, this.end[start2[0]]);
            }
            if (match) {
              math2.push(match);
              this.start.lastIndex = match.end.n;
            }
          }
        };
        FindTeX2.prototype.findMath = function(strings) {
          var math2 = [];
          if (this.hasPatterns) {
            for (var i2 = 0, m = strings.length; i2 < m; i2++) {
              this.findMathInString(math2, i2, strings[i2]);
            }
          }
          return math2;
        };
        FindTeX2.OPTIONS = {
          inlineMath: [
            ["\\(", "\\)"]
          ],
          displayMath: [
            ["$$", "$$"],
            ["\\[", "\\]"]
          ],
          processEscapes: true,
          processEnvironments: true,
          processRefs: true
        };
        return FindTeX2;
      })(FindMath_js_1.AbstractFindMath);
      FindTeX.FindTeX = FindTeX$1;
      return FindTeX;
    }
    var FilterUtil = {};
    var MmlNode = {};
    var Attributes = {};
    var hasRequiredAttributes$2;
    function requireAttributes$2() {
      if (hasRequiredAttributes$2) return Attributes;
      hasRequiredAttributes$2 = 1;
      (function(exports2) {
        var __values2 = Attributes && Attributes.__values || function(o) {
          var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i2 = 0;
          if (m) return m.call(o);
          if (o && typeof o.length === "number") return {
            next: function() {
              if (o && i2 >= o.length) o = void 0;
              return { value: o && o[i2++], done: !o };
            }
          };
          throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
        };
        Object.defineProperty(exports2, "__esModule", { value: true });
        exports2.Attributes = exports2.INHERIT = void 0;
        exports2.INHERIT = "_inherit_";
        var Attributes$1 = (function() {
          function Attributes2(defaults, global2) {
            this.global = global2;
            this.defaults = Object.create(global2);
            this.inherited = Object.create(this.defaults);
            this.attributes = Object.create(this.inherited);
            Object.assign(this.defaults, defaults);
          }
          Attributes2.prototype.set = function(name2, value2) {
            this.attributes[name2] = value2;
          };
          Attributes2.prototype.setList = function(list2) {
            Object.assign(this.attributes, list2);
          };
          Attributes2.prototype.get = function(name2) {
            var value2 = this.attributes[name2];
            if (value2 === exports2.INHERIT) {
              value2 = this.global[name2];
            }
            return value2;
          };
          Attributes2.prototype.getExplicit = function(name2) {
            if (!this.attributes.hasOwnProperty(name2)) {
              return void 0;
            }
            return this.attributes[name2];
          };
          Attributes2.prototype.getList = function() {
            var e_1, _a2;
            var names = [];
            for (var _i = 0; _i < arguments.length; _i++) {
              names[_i] = arguments[_i];
            }
            var values = {};
            try {
              for (var names_1 = __values2(names), names_1_1 = names_1.next(); !names_1_1.done; names_1_1 = names_1.next()) {
                var name_1 = names_1_1.value;
                values[name_1] = this.get(name_1);
              }
            } catch (e_1_1) {
              e_1 = { error: e_1_1 };
            } finally {
              try {
                if (names_1_1 && !names_1_1.done && (_a2 = names_1.return)) _a2.call(names_1);
              } finally {
                if (e_1) throw e_1.error;
              }
            }
            return values;
          };
          Attributes2.prototype.setInherited = function(name2, value2) {
            this.inherited[name2] = value2;
          };
          Attributes2.prototype.getInherited = function(name2) {
            return this.inherited[name2];
          };
          Attributes2.prototype.getDefault = function(name2) {
            return this.defaults[name2];
          };
          Attributes2.prototype.isSet = function(name2) {
            return this.attributes.hasOwnProperty(name2) || this.inherited.hasOwnProperty(name2);
          };
          Attributes2.prototype.hasDefault = function(name2) {
            return name2 in this.defaults;
          };
          Attributes2.prototype.getExplicitNames = function() {
            return Object.keys(this.attributes);
          };
          Attributes2.prototype.getInheritedNames = function() {
            return Object.keys(this.inherited);
          };
          Attributes2.prototype.getDefaultNames = function() {
            return Object.keys(this.defaults);
          };
          Attributes2.prototype.getGlobalNames = function() {
            return Object.keys(this.global);
          };
          Attributes2.prototype.getAllAttributes = function() {
            return this.attributes;
          };
          Attributes2.prototype.getAllInherited = function() {
            return this.inherited;
          };
          Attributes2.prototype.getAllDefaults = function() {
            return this.defaults;
          };
          Attributes2.prototype.getAllGlobals = function() {
            return this.global;
          };
          return Attributes2;
        })();
        exports2.Attributes = Attributes$1;
      })(Attributes);
      return Attributes;
    }
    var Node$1 = {};
    var hasRequiredNode$1;
    function requireNode$1() {
      if (hasRequiredNode$1) return Node$1;
      hasRequiredNode$1 = 1;
      var __extends2 = Node$1 && Node$1.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      var __assign2 = Node$1 && Node$1.__assign || function() {
        __assign2 = Object.assign || function(t2) {
          for (var s, i2 = 1, n = arguments.length; i2 < n; i2++) {
            s = arguments[i2];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
              t2[p] = s[p];
          }
          return t2;
        };
        return __assign2.apply(this, arguments);
      };
      var __values2 = Node$1 && Node$1.__values || function(o) {
        var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i2 = 0;
        if (m) return m.call(o);
        if (o && typeof o.length === "number") return {
          next: function() {
            if (o && i2 >= o.length) o = void 0;
            return { value: o && o[i2++], done: !o };
          }
        };
        throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
      };
      Object.defineProperty(Node$1, "__esModule", { value: true });
      Node$1.AbstractEmptyNode = Node$1.AbstractNode = void 0;
      var AbstractNode = (function() {
        function AbstractNode2(factory, properties, children2) {
          var e_1, _a2;
          if (properties === void 0) {
            properties = {};
          }
          if (children2 === void 0) {
            children2 = [];
          }
          this.factory = factory;
          this.parent = null;
          this.properties = {};
          this.childNodes = [];
          try {
            for (var _b2 = __values2(Object.keys(properties)), _c = _b2.next(); !_c.done; _c = _b2.next()) {
              var name_1 = _c.value;
              this.setProperty(name_1, properties[name_1]);
            }
          } catch (e_1_1) {
            e_1 = { error: e_1_1 };
          } finally {
            try {
              if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
            } finally {
              if (e_1) throw e_1.error;
            }
          }
          if (children2.length) {
            this.setChildren(children2);
          }
        }
        Object.defineProperty(AbstractNode2.prototype, "kind", {
          get: function() {
            return "unknown";
          },
          enumerable: false,
          configurable: true
        });
        AbstractNode2.prototype.setProperty = function(name2, value2) {
          this.properties[name2] = value2;
        };
        AbstractNode2.prototype.getProperty = function(name2) {
          return this.properties[name2];
        };
        AbstractNode2.prototype.getPropertyNames = function() {
          return Object.keys(this.properties);
        };
        AbstractNode2.prototype.getAllProperties = function() {
          return this.properties;
        };
        AbstractNode2.prototype.removeProperty = function() {
          var e_2, _a2;
          var names = [];
          for (var _i = 0; _i < arguments.length; _i++) {
            names[_i] = arguments[_i];
          }
          try {
            for (var names_1 = __values2(names), names_1_1 = names_1.next(); !names_1_1.done; names_1_1 = names_1.next()) {
              var name_2 = names_1_1.value;
              delete this.properties[name_2];
            }
          } catch (e_2_1) {
            e_2 = { error: e_2_1 };
          } finally {
            try {
              if (names_1_1 && !names_1_1.done && (_a2 = names_1.return)) _a2.call(names_1);
            } finally {
              if (e_2) throw e_2.error;
            }
          }
        };
        AbstractNode2.prototype.isKind = function(kind) {
          return this.factory.nodeIsKind(this, kind);
        };
        AbstractNode2.prototype.setChildren = function(children2) {
          var e_3, _a2;
          this.childNodes = [];
          try {
            for (var children_1 = __values2(children2), children_1_1 = children_1.next(); !children_1_1.done; children_1_1 = children_1.next()) {
              var child = children_1_1.value;
              this.appendChild(child);
            }
          } catch (e_3_1) {
            e_3 = { error: e_3_1 };
          } finally {
            try {
              if (children_1_1 && !children_1_1.done && (_a2 = children_1.return)) _a2.call(children_1);
            } finally {
              if (e_3) throw e_3.error;
            }
          }
        };
        AbstractNode2.prototype.appendChild = function(child) {
          this.childNodes.push(child);
          child.parent = this;
          return child;
        };
        AbstractNode2.prototype.replaceChild = function(newChild, oldChild) {
          var i2 = this.childIndex(oldChild);
          if (i2 !== null) {
            this.childNodes[i2] = newChild;
            newChild.parent = this;
            oldChild.parent = null;
          }
          return newChild;
        };
        AbstractNode2.prototype.removeChild = function(child) {
          var i2 = this.childIndex(child);
          if (i2 !== null) {
            this.childNodes.splice(i2, 1);
            child.parent = null;
          }
          return child;
        };
        AbstractNode2.prototype.childIndex = function(node2) {
          var i2 = this.childNodes.indexOf(node2);
          return i2 === -1 ? null : i2;
        };
        AbstractNode2.prototype.copy = function() {
          var e_4, _a2;
          var node2 = this.factory.create(this.kind);
          node2.properties = __assign2({}, this.properties);
          try {
            for (var _b2 = __values2(this.childNodes || []), _c = _b2.next(); !_c.done; _c = _b2.next()) {
              var child = _c.value;
              if (child) {
                node2.appendChild(child.copy());
              }
            }
          } catch (e_4_1) {
            e_4 = { error: e_4_1 };
          } finally {
            try {
              if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
            } finally {
              if (e_4) throw e_4.error;
            }
          }
          return node2;
        };
        AbstractNode2.prototype.findNodes = function(kind) {
          var nodes = [];
          this.walkTree(function(node2) {
            if (node2.isKind(kind)) {
              nodes.push(node2);
            }
          });
          return nodes;
        };
        AbstractNode2.prototype.walkTree = function(func, data) {
          var e_5, _a2;
          func(this, data);
          try {
            for (var _b2 = __values2(this.childNodes), _c = _b2.next(); !_c.done; _c = _b2.next()) {
              var child = _c.value;
              if (child) {
                child.walkTree(func, data);
              }
            }
          } catch (e_5_1) {
            e_5 = { error: e_5_1 };
          } finally {
            try {
              if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
            } finally {
              if (e_5) throw e_5.error;
            }
          }
          return data;
        };
        AbstractNode2.prototype.toString = function() {
          return this.kind + "(" + this.childNodes.join(",") + ")";
        };
        return AbstractNode2;
      })();
      Node$1.AbstractNode = AbstractNode;
      var AbstractEmptyNode = (function(_super) {
        __extends2(AbstractEmptyNode2, _super);
        function AbstractEmptyNode2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        AbstractEmptyNode2.prototype.setChildren = function(_children) {
        };
        AbstractEmptyNode2.prototype.appendChild = function(child) {
          return child;
        };
        AbstractEmptyNode2.prototype.replaceChild = function(_newChild, oldChild) {
          return oldChild;
        };
        AbstractEmptyNode2.prototype.childIndex = function(_node) {
          return null;
        };
        AbstractEmptyNode2.prototype.walkTree = function(func, data) {
          func(this, data);
          return data;
        };
        AbstractEmptyNode2.prototype.toString = function() {
          return this.kind;
        };
        return AbstractEmptyNode2;
      })(AbstractNode);
      Node$1.AbstractEmptyNode = AbstractEmptyNode;
      return Node$1;
    }
    var hasRequiredMmlNode;
    function requireMmlNode() {
      if (hasRequiredMmlNode) return MmlNode;
      hasRequiredMmlNode = 1;
      (function(exports2) {
        var __extends2 = MmlNode && MmlNode.__extends || /* @__PURE__ */ (function() {
          var extendStatics2 = function(d, b) {
            extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
              d2.__proto__ = b2;
            } || function(d2, b2) {
              for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
            };
            return extendStatics2(d, b);
          };
          return function(d, b) {
            if (typeof b !== "function" && b !== null)
              throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
            extendStatics2(d, b);
            function __() {
              this.constructor = d;
            }
            d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
          };
        })();
        var __assign2 = MmlNode && MmlNode.__assign || function() {
          __assign2 = Object.assign || function(t2) {
            for (var s, i2 = 1, n = arguments.length; i2 < n; i2++) {
              s = arguments[i2];
              for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
                t2[p] = s[p];
            }
            return t2;
          };
          return __assign2.apply(this, arguments);
        };
        var __values2 = MmlNode && MmlNode.__values || function(o) {
          var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i2 = 0;
          if (m) return m.call(o);
          if (o && typeof o.length === "number") return {
            next: function() {
              if (o && i2 >= o.length) o = void 0;
              return { value: o && o[i2++], done: !o };
            }
          };
          throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
        };
        var __read2 = MmlNode && MmlNode.__read || function(o, n) {
          var m = typeof Symbol === "function" && o[Symbol.iterator];
          if (!m) return o;
          var i2 = m.call(o), r2, ar2 = [], e;
          try {
            while ((n === void 0 || n-- > 0) && !(r2 = i2.next()).done) ar2.push(r2.value);
          } catch (error2) {
            e = { error: error2 };
          } finally {
            try {
              if (r2 && !r2.done && (m = i2["return"])) m.call(i2);
            } finally {
              if (e) throw e.error;
            }
          }
          return ar2;
        };
        Object.defineProperty(exports2, "__esModule", { value: true });
        exports2.XMLNode = exports2.TextNode = exports2.AbstractMmlEmptyNode = exports2.AbstractMmlBaseNode = exports2.AbstractMmlLayoutNode = exports2.AbstractMmlTokenNode = exports2.AbstractMmlNode = exports2.indentAttributes = exports2.TEXCLASSNAMES = exports2.TEXCLASS = void 0;
        var Attributes_js_1 = requireAttributes$2();
        var Node_js_1 = requireNode$1();
        exports2.TEXCLASS = {
          ORD: 0,
          OP: 1,
          BIN: 2,
          REL: 3,
          OPEN: 4,
          CLOSE: 5,
          PUNCT: 6,
          INNER: 7,
          VCENTER: 8,
          NONE: -1
        };
        exports2.TEXCLASSNAMES = ["ORD", "OP", "BIN", "REL", "OPEN", "CLOSE", "PUNCT", "INNER", "VCENTER"];
        var TEXSPACELENGTH = ["", "thinmathspace", "mediummathspace", "thickmathspace"];
        var TEXSPACE = [
          [0, -1, 2, 3, 0, 0, 0, 1],
          [-1, -1, 0, 3, 0, 0, 0, 1],
          [2, 2, 0, 0, 2, 0, 0, 2],
          [3, 3, 0, 0, 3, 0, 0, 3],
          [0, 0, 0, 0, 0, 0, 0, 0],
          [0, -1, 2, 3, 0, 0, 0, 1],
          [1, 1, 0, 1, 1, 1, 1, 1],
          [1, -1, 2, 3, 1, 0, 1, 1]
        ];
        exports2.indentAttributes = [
          "indentalign",
          "indentalignfirst",
          "indentshift",
          "indentshiftfirst"
        ];
        var AbstractMmlNode = (function(_super) {
          __extends2(AbstractMmlNode2, _super);
          function AbstractMmlNode2(factory, attributes2, children2) {
            if (attributes2 === void 0) {
              attributes2 = {};
            }
            if (children2 === void 0) {
              children2 = [];
            }
            var _this = _super.call(this, factory) || this;
            _this.prevClass = null;
            _this.prevLevel = null;
            _this.texclass = null;
            if (_this.arity < 0) {
              _this.childNodes = [factory.create("inferredMrow")];
              _this.childNodes[0].parent = _this;
            }
            _this.setChildren(children2);
            _this.attributes = new Attributes_js_1.Attributes(factory.getNodeClass(_this.kind).defaults, factory.getNodeClass("math").defaults);
            _this.attributes.setList(attributes2);
            return _this;
          }
          AbstractMmlNode2.prototype.copy = function(keepIds) {
            var e_1, _a2, e_2, _b2;
            if (keepIds === void 0) {
              keepIds = false;
            }
            var node2 = this.factory.create(this.kind);
            node2.properties = __assign2({}, this.properties);
            if (this.attributes) {
              var attributes2 = this.attributes.getAllAttributes();
              try {
                for (var _c = __values2(Object.keys(attributes2)), _d = _c.next(); !_d.done; _d = _c.next()) {
                  var name_1 = _d.value;
                  if (name_1 !== "id" || keepIds) {
                    node2.attributes.set(name_1, attributes2[name_1]);
                  }
                }
              } catch (e_1_1) {
                e_1 = { error: e_1_1 };
              } finally {
                try {
                  if (_d && !_d.done && (_a2 = _c.return)) _a2.call(_c);
                } finally {
                  if (e_1) throw e_1.error;
                }
              }
            }
            if (this.childNodes && this.childNodes.length) {
              var children2 = this.childNodes;
              if (children2.length === 1 && children2[0].isInferred) {
                children2 = children2[0].childNodes;
              }
              try {
                for (var children_1 = __values2(children2), children_1_1 = children_1.next(); !children_1_1.done; children_1_1 = children_1.next()) {
                  var child = children_1_1.value;
                  if (child) {
                    node2.appendChild(child.copy());
                  } else {
                    node2.childNodes.push(null);
                  }
                }
              } catch (e_2_1) {
                e_2 = { error: e_2_1 };
              } finally {
                try {
                  if (children_1_1 && !children_1_1.done && (_b2 = children_1.return)) _b2.call(children_1);
                } finally {
                  if (e_2) throw e_2.error;
                }
              }
            }
            return node2;
          };
          Object.defineProperty(AbstractMmlNode2.prototype, "texClass", {
            get: function() {
              return this.texclass;
            },
            set: function(texClass) {
              this.texclass = texClass;
            },
            enumerable: false,
            configurable: true
          });
          Object.defineProperty(AbstractMmlNode2.prototype, "isToken", {
            get: function() {
              return false;
            },
            enumerable: false,
            configurable: true
          });
          Object.defineProperty(AbstractMmlNode2.prototype, "isEmbellished", {
            get: function() {
              return false;
            },
            enumerable: false,
            configurable: true
          });
          Object.defineProperty(AbstractMmlNode2.prototype, "isSpacelike", {
            get: function() {
              return false;
            },
            enumerable: false,
            configurable: true
          });
          Object.defineProperty(AbstractMmlNode2.prototype, "linebreakContainer", {
            get: function() {
              return false;
            },
            enumerable: false,
            configurable: true
          });
          Object.defineProperty(AbstractMmlNode2.prototype, "hasNewLine", {
            get: function() {
              return false;
            },
            enumerable: false,
            configurable: true
          });
          Object.defineProperty(AbstractMmlNode2.prototype, "arity", {
            get: function() {
              return Infinity;
            },
            enumerable: false,
            configurable: true
          });
          Object.defineProperty(AbstractMmlNode2.prototype, "isInferred", {
            get: function() {
              return false;
            },
            enumerable: false,
            configurable: true
          });
          Object.defineProperty(AbstractMmlNode2.prototype, "Parent", {
            get: function() {
              var parent = this.parent;
              while (parent && parent.notParent) {
                parent = parent.Parent;
              }
              return parent;
            },
            enumerable: false,
            configurable: true
          });
          Object.defineProperty(AbstractMmlNode2.prototype, "notParent", {
            get: function() {
              return false;
            },
            enumerable: false,
            configurable: true
          });
          AbstractMmlNode2.prototype.setChildren = function(children2) {
            if (this.arity < 0) {
              return this.childNodes[0].setChildren(children2);
            }
            return _super.prototype.setChildren.call(this, children2);
          };
          AbstractMmlNode2.prototype.appendChild = function(child) {
            var e_3, _a2;
            var _this = this;
            if (this.arity < 0) {
              this.childNodes[0].appendChild(child);
              return child;
            }
            if (child.isInferred) {
              if (this.arity === Infinity) {
                child.childNodes.forEach(function(node2) {
                  return _super.prototype.appendChild.call(_this, node2);
                });
                return child;
              }
              var original = child;
              child = this.factory.create("mrow");
              child.setChildren(original.childNodes);
              child.attributes = original.attributes;
              try {
                for (var _b2 = __values2(original.getPropertyNames()), _c = _b2.next(); !_c.done; _c = _b2.next()) {
                  var name_2 = _c.value;
                  child.setProperty(name_2, original.getProperty(name_2));
                }
              } catch (e_3_1) {
                e_3 = { error: e_3_1 };
              } finally {
                try {
                  if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
                } finally {
                  if (e_3) throw e_3.error;
                }
              }
            }
            return _super.prototype.appendChild.call(this, child);
          };
          AbstractMmlNode2.prototype.replaceChild = function(newChild, oldChild) {
            if (this.arity < 0) {
              this.childNodes[0].replaceChild(newChild, oldChild);
              return newChild;
            }
            return _super.prototype.replaceChild.call(this, newChild, oldChild);
          };
          AbstractMmlNode2.prototype.core = function() {
            return this;
          };
          AbstractMmlNode2.prototype.coreMO = function() {
            return this;
          };
          AbstractMmlNode2.prototype.coreIndex = function() {
            return 0;
          };
          AbstractMmlNode2.prototype.childPosition = function() {
            var e_4, _a2;
            var child = this;
            var parent = child.parent;
            while (parent && parent.notParent) {
              child = parent;
              parent = parent.parent;
            }
            if (parent) {
              var i2 = 0;
              try {
                for (var _b2 = __values2(parent.childNodes), _c = _b2.next(); !_c.done; _c = _b2.next()) {
                  var node2 = _c.value;
                  if (node2 === child) {
                    return i2;
                  }
                  i2++;
                }
              } catch (e_4_1) {
                e_4 = { error: e_4_1 };
              } finally {
                try {
                  if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
                } finally {
                  if (e_4) throw e_4.error;
                }
              }
            }
            return null;
          };
          AbstractMmlNode2.prototype.setTeXclass = function(prev) {
            this.getPrevClass(prev);
            return this.texClass != null ? this : prev;
          };
          AbstractMmlNode2.prototype.updateTeXclass = function(core) {
            if (core) {
              this.prevClass = core.prevClass;
              this.prevLevel = core.prevLevel;
              core.prevClass = core.prevLevel = null;
              this.texClass = core.texClass;
            }
          };
          AbstractMmlNode2.prototype.getPrevClass = function(prev) {
            if (prev) {
              this.prevClass = prev.texClass;
              this.prevLevel = prev.attributes.get("scriptlevel");
            }
          };
          AbstractMmlNode2.prototype.texSpacing = function() {
            var prevClass = this.prevClass != null ? this.prevClass : exports2.TEXCLASS.NONE;
            var texClass = this.texClass || exports2.TEXCLASS.ORD;
            if (prevClass === exports2.TEXCLASS.NONE || texClass === exports2.TEXCLASS.NONE) {
              return "";
            }
            if (prevClass === exports2.TEXCLASS.VCENTER) {
              prevClass = exports2.TEXCLASS.ORD;
            }
            if (texClass === exports2.TEXCLASS.VCENTER) {
              texClass = exports2.TEXCLASS.ORD;
            }
            var space = TEXSPACE[prevClass][texClass];
            if ((this.prevLevel > 0 || this.attributes.get("scriptlevel") > 0) && space >= 0) {
              return "";
            }
            return TEXSPACELENGTH[Math.abs(space)];
          };
          AbstractMmlNode2.prototype.hasSpacingAttributes = function() {
            return this.isEmbellished && this.coreMO().hasSpacingAttributes();
          };
          AbstractMmlNode2.prototype.setInheritedAttributes = function(attributes2, display, level, prime2) {
            var e_5, _a2;
            if (attributes2 === void 0) {
              attributes2 = {};
            }
            if (display === void 0) {
              display = false;
            }
            if (level === void 0) {
              level = 0;
            }
            if (prime2 === void 0) {
              prime2 = false;
            }
            var defaults = this.attributes.getAllDefaults();
            try {
              for (var _b2 = __values2(Object.keys(attributes2)), _c = _b2.next(); !_c.done; _c = _b2.next()) {
                var key2 = _c.value;
                if (defaults.hasOwnProperty(key2) || AbstractMmlNode2.alwaysInherit.hasOwnProperty(key2)) {
                  var _d = __read2(attributes2[key2], 2), node2 = _d[0], value2 = _d[1];
                  var noinherit = (AbstractMmlNode2.noInherit[node2] || {})[this.kind] || {};
                  if (!noinherit[key2]) {
                    this.attributes.setInherited(key2, value2);
                  }
                }
              }
            } catch (e_5_1) {
              e_5 = { error: e_5_1 };
            } finally {
              try {
                if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
              } finally {
                if (e_5) throw e_5.error;
              }
            }
            var displaystyle = this.attributes.getExplicit("displaystyle");
            if (displaystyle === void 0) {
              this.attributes.setInherited("displaystyle", display);
            }
            var scriptlevel = this.attributes.getExplicit("scriptlevel");
            if (scriptlevel === void 0) {
              this.attributes.setInherited("scriptlevel", level);
            }
            if (prime2) {
              this.setProperty("texprimestyle", prime2);
            }
            var arity = this.arity;
            if (arity >= 0 && arity !== Infinity && (arity === 1 && this.childNodes.length === 0 || arity !== 1 && this.childNodes.length !== arity)) {
              if (arity < this.childNodes.length) {
                this.childNodes = this.childNodes.slice(0, arity);
              } else {
                while (this.childNodes.length < arity) {
                  this.appendChild(this.factory.create("mrow"));
                }
              }
            }
            this.setChildInheritedAttributes(attributes2, display, level, prime2);
          };
          AbstractMmlNode2.prototype.setChildInheritedAttributes = function(attributes2, display, level, prime2) {
            var e_6, _a2;
            try {
              for (var _b2 = __values2(this.childNodes), _c = _b2.next(); !_c.done; _c = _b2.next()) {
                var child = _c.value;
                child.setInheritedAttributes(attributes2, display, level, prime2);
              }
            } catch (e_6_1) {
              e_6 = { error: e_6_1 };
            } finally {
              try {
                if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
              } finally {
                if (e_6) throw e_6.error;
              }
            }
          };
          AbstractMmlNode2.prototype.addInheritedAttributes = function(current2, attributes2) {
            var e_7, _a2;
            var updated = __assign2({}, current2);
            try {
              for (var _b2 = __values2(Object.keys(attributes2)), _c = _b2.next(); !_c.done; _c = _b2.next()) {
                var name_3 = _c.value;
                if (name_3 !== "displaystyle" && name_3 !== "scriptlevel" && name_3 !== "style") {
                  updated[name_3] = [this.kind, attributes2[name_3]];
                }
              }
            } catch (e_7_1) {
              e_7 = { error: e_7_1 };
            } finally {
              try {
                if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
              } finally {
                if (e_7) throw e_7.error;
              }
            }
            return updated;
          };
          AbstractMmlNode2.prototype.inheritAttributesFrom = function(node2) {
            var attributes2 = node2.attributes;
            var display = attributes2.get("displaystyle");
            var scriptlevel = attributes2.get("scriptlevel");
            var defaults = !attributes2.isSet("mathsize") ? {} : {
              mathsize: ["math", attributes2.get("mathsize")]
            };
            var prime2 = node2.getProperty("texprimestyle") || false;
            this.setInheritedAttributes(defaults, display, scriptlevel, prime2);
          };
          AbstractMmlNode2.prototype.verifyTree = function(options2) {
            if (options2 === void 0) {
              options2 = null;
            }
            if (options2 === null) {
              return;
            }
            this.verifyAttributes(options2);
            var arity = this.arity;
            if (options2["checkArity"]) {
              if (arity >= 0 && arity !== Infinity && (arity === 1 && this.childNodes.length === 0 || arity !== 1 && this.childNodes.length !== arity)) {
                this.mError('Wrong number of children for "' + this.kind + '" node', options2, true);
              }
            }
            this.verifyChildren(options2);
          };
          AbstractMmlNode2.prototype.verifyAttributes = function(options2) {
            var e_8, _a2;
            if (options2["checkAttributes"]) {
              var attributes2 = this.attributes;
              var bad = [];
              try {
                for (var _b2 = __values2(attributes2.getExplicitNames()), _c = _b2.next(); !_c.done; _c = _b2.next()) {
                  var name_4 = _c.value;
                  if (name_4.substr(0, 5) !== "data-" && attributes2.getDefault(name_4) === void 0 && !name_4.match(/^(?:class|style|id|(?:xlink:)?href)$/)) {
                    bad.push(name_4);
                  }
                }
              } catch (e_8_1) {
                e_8 = { error: e_8_1 };
              } finally {
                try {
                  if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
                } finally {
                  if (e_8) throw e_8.error;
                }
              }
              if (bad.length) {
                this.mError("Unknown attributes for " + this.kind + " node: " + bad.join(", "), options2);
              }
            }
          };
          AbstractMmlNode2.prototype.verifyChildren = function(options2) {
            var e_9, _a2;
            try {
              for (var _b2 = __values2(this.childNodes), _c = _b2.next(); !_c.done; _c = _b2.next()) {
                var child = _c.value;
                child.verifyTree(options2);
              }
            } catch (e_9_1) {
              e_9 = { error: e_9_1 };
            } finally {
              try {
                if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
              } finally {
                if (e_9) throw e_9.error;
              }
            }
          };
          AbstractMmlNode2.prototype.mError = function(message2, options2, short) {
            if (short === void 0) {
              short = false;
            }
            if (this.parent && this.parent.isKind("merror")) {
              return null;
            }
            var merror2 = this.factory.create("merror");
            merror2.attributes.set("data-mjx-message", message2);
            if (options2["fullErrors"] || short) {
              var mtext2 = this.factory.create("mtext");
              var text2 = this.factory.create("text");
              text2.setText(options2["fullErrors"] ? message2 : this.kind);
              mtext2.appendChild(text2);
              merror2.appendChild(mtext2);
              this.parent.replaceChild(merror2, this);
            } else {
              this.parent.replaceChild(merror2, this);
              merror2.appendChild(this);
            }
            return merror2;
          };
          AbstractMmlNode2.defaults = {
            mathbackground: Attributes_js_1.INHERIT,
            mathcolor: Attributes_js_1.INHERIT,
            mathsize: Attributes_js_1.INHERIT,
            dir: Attributes_js_1.INHERIT
          };
          AbstractMmlNode2.noInherit = {
            mstyle: {
              mpadded: { width: true, height: true, depth: true, lspace: true, voffset: true },
              mtable: { width: true, height: true, depth: true, align: true }
            },
            maligngroup: {
              mrow: { groupalign: true },
              mtable: { groupalign: true }
            }
          };
          AbstractMmlNode2.alwaysInherit = {
            scriptminsize: true,
            scriptsizemultiplier: true
          };
          AbstractMmlNode2.verifyDefaults = {
            checkArity: true,
            checkAttributes: false,
            fullErrors: false,
            fixMmultiscripts: true,
            fixMtables: true
          };
          return AbstractMmlNode2;
        })(Node_js_1.AbstractNode);
        exports2.AbstractMmlNode = AbstractMmlNode;
        var AbstractMmlTokenNode = (function(_super) {
          __extends2(AbstractMmlTokenNode2, _super);
          function AbstractMmlTokenNode2() {
            return _super !== null && _super.apply(this, arguments) || this;
          }
          Object.defineProperty(AbstractMmlTokenNode2.prototype, "isToken", {
            get: function() {
              return true;
            },
            enumerable: false,
            configurable: true
          });
          AbstractMmlTokenNode2.prototype.getText = function() {
            var e_10, _a2;
            var text2 = "";
            try {
              for (var _b2 = __values2(this.childNodes), _c = _b2.next(); !_c.done; _c = _b2.next()) {
                var child = _c.value;
                if (child instanceof TextNode2) {
                  text2 += child.getText();
                }
              }
            } catch (e_10_1) {
              e_10 = { error: e_10_1 };
            } finally {
              try {
                if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
              } finally {
                if (e_10) throw e_10.error;
              }
            }
            return text2;
          };
          AbstractMmlTokenNode2.prototype.setChildInheritedAttributes = function(attributes2, display, level, prime2) {
            var e_11, _a2;
            try {
              for (var _b2 = __values2(this.childNodes), _c = _b2.next(); !_c.done; _c = _b2.next()) {
                var child = _c.value;
                if (child instanceof AbstractMmlNode) {
                  child.setInheritedAttributes(attributes2, display, level, prime2);
                }
              }
            } catch (e_11_1) {
              e_11 = { error: e_11_1 };
            } finally {
              try {
                if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
              } finally {
                if (e_11) throw e_11.error;
              }
            }
          };
          AbstractMmlTokenNode2.prototype.walkTree = function(func, data) {
            var e_12, _a2;
            func(this, data);
            try {
              for (var _b2 = __values2(this.childNodes), _c = _b2.next(); !_c.done; _c = _b2.next()) {
                var child = _c.value;
                if (child instanceof AbstractMmlNode) {
                  child.walkTree(func, data);
                }
              }
            } catch (e_12_1) {
              e_12 = { error: e_12_1 };
            } finally {
              try {
                if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
              } finally {
                if (e_12) throw e_12.error;
              }
            }
            return data;
          };
          AbstractMmlTokenNode2.defaults = __assign2(__assign2({}, AbstractMmlNode.defaults), { mathvariant: "normal", mathsize: Attributes_js_1.INHERIT });
          return AbstractMmlTokenNode2;
        })(AbstractMmlNode);
        exports2.AbstractMmlTokenNode = AbstractMmlTokenNode;
        var AbstractMmlLayoutNode = (function(_super) {
          __extends2(AbstractMmlLayoutNode2, _super);
          function AbstractMmlLayoutNode2() {
            return _super !== null && _super.apply(this, arguments) || this;
          }
          Object.defineProperty(AbstractMmlLayoutNode2.prototype, "isSpacelike", {
            get: function() {
              return this.childNodes[0].isSpacelike;
            },
            enumerable: false,
            configurable: true
          });
          Object.defineProperty(AbstractMmlLayoutNode2.prototype, "isEmbellished", {
            get: function() {
              return this.childNodes[0].isEmbellished;
            },
            enumerable: false,
            configurable: true
          });
          Object.defineProperty(AbstractMmlLayoutNode2.prototype, "arity", {
            get: function() {
              return -1;
            },
            enumerable: false,
            configurable: true
          });
          AbstractMmlLayoutNode2.prototype.core = function() {
            return this.childNodes[0];
          };
          AbstractMmlLayoutNode2.prototype.coreMO = function() {
            return this.childNodes[0].coreMO();
          };
          AbstractMmlLayoutNode2.prototype.setTeXclass = function(prev) {
            prev = this.childNodes[0].setTeXclass(prev);
            this.updateTeXclass(this.childNodes[0]);
            return prev;
          };
          AbstractMmlLayoutNode2.defaults = AbstractMmlNode.defaults;
          return AbstractMmlLayoutNode2;
        })(AbstractMmlNode);
        exports2.AbstractMmlLayoutNode = AbstractMmlLayoutNode;
        var AbstractMmlBaseNode = (function(_super) {
          __extends2(AbstractMmlBaseNode2, _super);
          function AbstractMmlBaseNode2() {
            return _super !== null && _super.apply(this, arguments) || this;
          }
          Object.defineProperty(AbstractMmlBaseNode2.prototype, "isEmbellished", {
            get: function() {
              return this.childNodes[0].isEmbellished;
            },
            enumerable: false,
            configurable: true
          });
          AbstractMmlBaseNode2.prototype.core = function() {
            return this.childNodes[0];
          };
          AbstractMmlBaseNode2.prototype.coreMO = function() {
            return this.childNodes[0].coreMO();
          };
          AbstractMmlBaseNode2.prototype.setTeXclass = function(prev) {
            var e_13, _a2;
            this.getPrevClass(prev);
            this.texClass = exports2.TEXCLASS.ORD;
            var base2 = this.childNodes[0];
            if (base2) {
              if (this.isEmbellished || base2.isKind("mi")) {
                prev = base2.setTeXclass(prev);
                this.updateTeXclass(this.core());
              } else {
                base2.setTeXclass(null);
                prev = this;
              }
            } else {
              prev = this;
            }
            try {
              for (var _b2 = __values2(this.childNodes.slice(1)), _c = _b2.next(); !_c.done; _c = _b2.next()) {
                var child = _c.value;
                if (child) {
                  child.setTeXclass(null);
                }
              }
            } catch (e_13_1) {
              e_13 = { error: e_13_1 };
            } finally {
              try {
                if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
              } finally {
                if (e_13) throw e_13.error;
              }
            }
            return prev;
          };
          AbstractMmlBaseNode2.defaults = AbstractMmlNode.defaults;
          return AbstractMmlBaseNode2;
        })(AbstractMmlNode);
        exports2.AbstractMmlBaseNode = AbstractMmlBaseNode;
        var AbstractMmlEmptyNode = (function(_super) {
          __extends2(AbstractMmlEmptyNode2, _super);
          function AbstractMmlEmptyNode2() {
            return _super !== null && _super.apply(this, arguments) || this;
          }
          Object.defineProperty(AbstractMmlEmptyNode2.prototype, "isToken", {
            get: function() {
              return false;
            },
            enumerable: false,
            configurable: true
          });
          Object.defineProperty(AbstractMmlEmptyNode2.prototype, "isEmbellished", {
            get: function() {
              return false;
            },
            enumerable: false,
            configurable: true
          });
          Object.defineProperty(AbstractMmlEmptyNode2.prototype, "isSpacelike", {
            get: function() {
              return false;
            },
            enumerable: false,
            configurable: true
          });
          Object.defineProperty(AbstractMmlEmptyNode2.prototype, "linebreakContainer", {
            get: function() {
              return false;
            },
            enumerable: false,
            configurable: true
          });
          Object.defineProperty(AbstractMmlEmptyNode2.prototype, "hasNewLine", {
            get: function() {
              return false;
            },
            enumerable: false,
            configurable: true
          });
          Object.defineProperty(AbstractMmlEmptyNode2.prototype, "arity", {
            get: function() {
              return 0;
            },
            enumerable: false,
            configurable: true
          });
          Object.defineProperty(AbstractMmlEmptyNode2.prototype, "isInferred", {
            get: function() {
              return false;
            },
            enumerable: false,
            configurable: true
          });
          Object.defineProperty(AbstractMmlEmptyNode2.prototype, "notParent", {
            get: function() {
              return false;
            },
            enumerable: false,
            configurable: true
          });
          Object.defineProperty(AbstractMmlEmptyNode2.prototype, "Parent", {
            get: function() {
              return this.parent;
            },
            enumerable: false,
            configurable: true
          });
          Object.defineProperty(AbstractMmlEmptyNode2.prototype, "texClass", {
            get: function() {
              return exports2.TEXCLASS.NONE;
            },
            enumerable: false,
            configurable: true
          });
          Object.defineProperty(AbstractMmlEmptyNode2.prototype, "prevClass", {
            get: function() {
              return exports2.TEXCLASS.NONE;
            },
            enumerable: false,
            configurable: true
          });
          Object.defineProperty(AbstractMmlEmptyNode2.prototype, "prevLevel", {
            get: function() {
              return 0;
            },
            enumerable: false,
            configurable: true
          });
          AbstractMmlEmptyNode2.prototype.hasSpacingAttributes = function() {
            return false;
          };
          Object.defineProperty(AbstractMmlEmptyNode2.prototype, "attributes", {
            get: function() {
              return null;
            },
            enumerable: false,
            configurable: true
          });
          AbstractMmlEmptyNode2.prototype.core = function() {
            return this;
          };
          AbstractMmlEmptyNode2.prototype.coreMO = function() {
            return this;
          };
          AbstractMmlEmptyNode2.prototype.coreIndex = function() {
            return 0;
          };
          AbstractMmlEmptyNode2.prototype.childPosition = function() {
            return 0;
          };
          AbstractMmlEmptyNode2.prototype.setTeXclass = function(prev) {
            return prev;
          };
          AbstractMmlEmptyNode2.prototype.texSpacing = function() {
            return "";
          };
          AbstractMmlEmptyNode2.prototype.setInheritedAttributes = function(_attributes, _display, _level, _prime) {
          };
          AbstractMmlEmptyNode2.prototype.inheritAttributesFrom = function(_node) {
          };
          AbstractMmlEmptyNode2.prototype.verifyTree = function(_options) {
          };
          AbstractMmlEmptyNode2.prototype.mError = function(_message, _options, _short) {
            return null;
          };
          return AbstractMmlEmptyNode2;
        })(Node_js_1.AbstractEmptyNode);
        exports2.AbstractMmlEmptyNode = AbstractMmlEmptyNode;
        var TextNode2 = (function(_super) {
          __extends2(TextNode3, _super);
          function TextNode3() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this.text = "";
            return _this;
          }
          Object.defineProperty(TextNode3.prototype, "kind", {
            get: function() {
              return "text";
            },
            enumerable: false,
            configurable: true
          });
          TextNode3.prototype.getText = function() {
            return this.text;
          };
          TextNode3.prototype.setText = function(text2) {
            this.text = text2;
            return this;
          };
          TextNode3.prototype.copy = function() {
            return this.factory.create(this.kind).setText(this.getText());
          };
          TextNode3.prototype.toString = function() {
            return this.text;
          };
          return TextNode3;
        })(AbstractMmlEmptyNode);
        exports2.TextNode = TextNode2;
        var XMLNode = (function(_super) {
          __extends2(XMLNode2, _super);
          function XMLNode2() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this.xml = null;
            _this.adaptor = null;
            return _this;
          }
          Object.defineProperty(XMLNode2.prototype, "kind", {
            get: function() {
              return "XML";
            },
            enumerable: false,
            configurable: true
          });
          XMLNode2.prototype.getXML = function() {
            return this.xml;
          };
          XMLNode2.prototype.setXML = function(xml, adaptor) {
            if (adaptor === void 0) {
              adaptor = null;
            }
            this.xml = xml;
            this.adaptor = adaptor;
            return this;
          };
          XMLNode2.prototype.getSerializedXML = function() {
            return this.adaptor.serializeXML(this.xml);
          };
          XMLNode2.prototype.copy = function() {
            return this.factory.create(this.kind).setXML(this.adaptor.clone(this.xml));
          };
          XMLNode2.prototype.toString = function() {
            return "XML data";
          };
          return XMLNode2;
        })(AbstractMmlEmptyNode);
        exports2.XMLNode = XMLNode;
      })(MmlNode);
      return MmlNode;
    }
    var NodeUtil = {};
    var mo$2 = {};
    var OperatorDictionary = {};
    var hasRequiredOperatorDictionary;
    function requireOperatorDictionary() {
      if (hasRequiredOperatorDictionary) return OperatorDictionary;
      hasRequiredOperatorDictionary = 1;
      (function(exports2) {
        var __values2 = OperatorDictionary && OperatorDictionary.__values || function(o) {
          var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i2 = 0;
          if (m) return m.call(o);
          if (o && typeof o.length === "number") return {
            next: function() {
              if (o && i2 >= o.length) o = void 0;
              return { value: o && o[i2++], done: !o };
            }
          };
          throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
        };
        Object.defineProperty(exports2, "__esModule", { value: true });
        exports2.OPTABLE = exports2.MMLSPACING = exports2.getRange = exports2.RANGES = exports2.MO = exports2.OPDEF = void 0;
        var MmlNode_js_1 = requireMmlNode();
        function OPDEF(lspace, rspace, texClass, properties) {
          if (texClass === void 0) {
            texClass = MmlNode_js_1.TEXCLASS.BIN;
          }
          if (properties === void 0) {
            properties = null;
          }
          return [lspace, rspace, texClass, properties];
        }
        exports2.OPDEF = OPDEF;
        exports2.MO = {
          ORD: OPDEF(0, 0, MmlNode_js_1.TEXCLASS.ORD),
          ORD11: OPDEF(1, 1, MmlNode_js_1.TEXCLASS.ORD),
          ORD21: OPDEF(2, 1, MmlNode_js_1.TEXCLASS.ORD),
          ORD02: OPDEF(0, 2, MmlNode_js_1.TEXCLASS.ORD),
          ORD55: OPDEF(5, 5, MmlNode_js_1.TEXCLASS.ORD),
          NONE: OPDEF(0, 0, MmlNode_js_1.TEXCLASS.NONE),
          OP: OPDEF(1, 2, MmlNode_js_1.TEXCLASS.OP, { largeop: true, movablelimits: true, symmetric: true }),
          OPFIXED: OPDEF(1, 2, MmlNode_js_1.TEXCLASS.OP, { largeop: true, movablelimits: true }),
          INTEGRAL: OPDEF(0, 1, MmlNode_js_1.TEXCLASS.OP, { largeop: true, symmetric: true }),
          INTEGRAL2: OPDEF(1, 2, MmlNode_js_1.TEXCLASS.OP, { largeop: true, symmetric: true }),
          BIN3: OPDEF(3, 3, MmlNode_js_1.TEXCLASS.BIN),
          BIN4: OPDEF(4, 4, MmlNode_js_1.TEXCLASS.BIN),
          BIN01: OPDEF(0, 1, MmlNode_js_1.TEXCLASS.BIN),
          BIN5: OPDEF(5, 5, MmlNode_js_1.TEXCLASS.BIN),
          TALLBIN: OPDEF(4, 4, MmlNode_js_1.TEXCLASS.BIN, { stretchy: true }),
          BINOP: OPDEF(4, 4, MmlNode_js_1.TEXCLASS.BIN, { largeop: true, movablelimits: true }),
          REL: OPDEF(5, 5, MmlNode_js_1.TEXCLASS.REL),
          REL1: OPDEF(1, 1, MmlNode_js_1.TEXCLASS.REL, { stretchy: true }),
          REL4: OPDEF(4, 4, MmlNode_js_1.TEXCLASS.REL),
          RELSTRETCH: OPDEF(5, 5, MmlNode_js_1.TEXCLASS.REL, { stretchy: true }),
          RELACCENT: OPDEF(5, 5, MmlNode_js_1.TEXCLASS.REL, { accent: true }),
          WIDEREL: OPDEF(5, 5, MmlNode_js_1.TEXCLASS.REL, { accent: true, stretchy: true }),
          OPEN: OPDEF(0, 0, MmlNode_js_1.TEXCLASS.OPEN, { fence: true, stretchy: true, symmetric: true }),
          CLOSE: OPDEF(0, 0, MmlNode_js_1.TEXCLASS.CLOSE, { fence: true, stretchy: true, symmetric: true }),
          INNER: OPDEF(0, 0, MmlNode_js_1.TEXCLASS.INNER),
          PUNCT: OPDEF(0, 3, MmlNode_js_1.TEXCLASS.PUNCT),
          ACCENT: OPDEF(0, 0, MmlNode_js_1.TEXCLASS.ORD, { accent: true }),
          WIDEACCENT: OPDEF(0, 0, MmlNode_js_1.TEXCLASS.ORD, { accent: true, stretchy: true })
        };
        exports2.RANGES = [
          [32, 127, MmlNode_js_1.TEXCLASS.REL, "mo"],
          [160, 191, MmlNode_js_1.TEXCLASS.ORD, "mo"],
          [192, 591, MmlNode_js_1.TEXCLASS.ORD, "mi"],
          [688, 879, MmlNode_js_1.TEXCLASS.ORD, "mo"],
          [880, 6688, MmlNode_js_1.TEXCLASS.ORD, "mi"],
          [6832, 6911, MmlNode_js_1.TEXCLASS.ORD, "mo"],
          [6912, 7615, MmlNode_js_1.TEXCLASS.ORD, "mi"],
          [7616, 7679, MmlNode_js_1.TEXCLASS.ORD, "mo"],
          [7680, 8191, MmlNode_js_1.TEXCLASS.ORD, "mi"],
          [8192, 8303, MmlNode_js_1.TEXCLASS.ORD, "mo"],
          [8304, 8351, MmlNode_js_1.TEXCLASS.ORD, "mo"],
          [8448, 8527, MmlNode_js_1.TEXCLASS.ORD, "mi"],
          [8528, 8591, MmlNode_js_1.TEXCLASS.ORD, "mn"],
          [8592, 8703, MmlNode_js_1.TEXCLASS.REL, "mo"],
          [8704, 8959, MmlNode_js_1.TEXCLASS.BIN, "mo"],
          [8960, 9215, MmlNode_js_1.TEXCLASS.ORD, "mo"],
          [9312, 9471, MmlNode_js_1.TEXCLASS.ORD, "mn"],
          [9472, 10223, MmlNode_js_1.TEXCLASS.ORD, "mo"],
          [10224, 10239, MmlNode_js_1.TEXCLASS.REL, "mo"],
          [10240, 10495, MmlNode_js_1.TEXCLASS.ORD, "mtext"],
          [10496, 10623, MmlNode_js_1.TEXCLASS.REL, "mo"],
          [10624, 10751, MmlNode_js_1.TEXCLASS.ORD, "mo"],
          [10752, 11007, MmlNode_js_1.TEXCLASS.BIN, "mo"],
          [11008, 11055, MmlNode_js_1.TEXCLASS.ORD, "mo"],
          [11056, 11087, MmlNode_js_1.TEXCLASS.REL, "mo"],
          [11088, 11263, MmlNode_js_1.TEXCLASS.ORD, "mo"],
          [11264, 11744, MmlNode_js_1.TEXCLASS.ORD, "mi"],
          [11776, 11903, MmlNode_js_1.TEXCLASS.ORD, "mo"],
          [11904, 12255, MmlNode_js_1.TEXCLASS.ORD, "mi", "normal"],
          [12272, 12351, MmlNode_js_1.TEXCLASS.ORD, "mo"],
          [12352, 42143, MmlNode_js_1.TEXCLASS.ORD, "mi", "normal"],
          [42192, 43055, MmlNode_js_1.TEXCLASS.ORD, "mi"],
          [43056, 43071, MmlNode_js_1.TEXCLASS.ORD, "mn"],
          [43072, 55295, MmlNode_js_1.TEXCLASS.ORD, "mi"],
          [63744, 64255, MmlNode_js_1.TEXCLASS.ORD, "mi", "normal"],
          [64256, 65023, MmlNode_js_1.TEXCLASS.ORD, "mi"],
          [65024, 65135, MmlNode_js_1.TEXCLASS.ORD, "mo"],
          [65136, 65791, MmlNode_js_1.TEXCLASS.ORD, "mi"],
          [65792, 65935, MmlNode_js_1.TEXCLASS.ORD, "mn"],
          [65936, 74751, MmlNode_js_1.TEXCLASS.ORD, "mi", "normal"],
          [74752, 74879, MmlNode_js_1.TEXCLASS.ORD, "mn"],
          [74880, 113823, MmlNode_js_1.TEXCLASS.ORD, "mi", "normal"],
          [113824, 119391, MmlNode_js_1.TEXCLASS.ORD, "mo"],
          [119648, 119679, MmlNode_js_1.TEXCLASS.ORD, "mn"],
          [119808, 120781, MmlNode_js_1.TEXCLASS.ORD, "mi"],
          [120782, 120831, MmlNode_js_1.TEXCLASS.ORD, "mn"],
          [122624, 129023, MmlNode_js_1.TEXCLASS.ORD, "mo"],
          [129024, 129279, MmlNode_js_1.TEXCLASS.REL, "mo"],
          [129280, 129535, MmlNode_js_1.TEXCLASS.ORD, "mo"],
          [131072, 195103, MmlNode_js_1.TEXCLASS.ORD, "mi", "normnal"]
        ];
        function getRange(text2) {
          var e_1, _a2;
          var n = text2.codePointAt(0);
          try {
            for (var RANGES_1 = __values2(exports2.RANGES), RANGES_1_1 = RANGES_1.next(); !RANGES_1_1.done; RANGES_1_1 = RANGES_1.next()) {
              var range2 = RANGES_1_1.value;
              if (n <= range2[1]) {
                if (n >= range2[0]) {
                  return range2;
                }
                break;
              }
            }
          } catch (e_1_1) {
            e_1 = { error: e_1_1 };
          } finally {
            try {
              if (RANGES_1_1 && !RANGES_1_1.done && (_a2 = RANGES_1.return)) _a2.call(RANGES_1);
            } finally {
              if (e_1) throw e_1.error;
            }
          }
          return null;
        }
        exports2.getRange = getRange;
        exports2.MMLSPACING = [
          [0, 0],
          [1, 2],
          [3, 3],
          [4, 4],
          [0, 0],
          [0, 0],
          [0, 3]
        ];
        exports2.OPTABLE = {
          prefix: {
            "(": exports2.MO.OPEN,
            "+": exports2.MO.BIN01,
            "-": exports2.MO.BIN01,
            "[": exports2.MO.OPEN,
            "{": exports2.MO.OPEN,
            "|": exports2.MO.OPEN,
            "||": [0, 0, MmlNode_js_1.TEXCLASS.BIN, { fence: true, stretchy: true, symmetric: true }],
            "|||": [0, 0, MmlNode_js_1.TEXCLASS.ORD, { fence: true, stretchy: true, symmetric: true }],
            "¬": exports2.MO.ORD21,
            "±": exports2.MO.BIN01,
            "‖": [0, 0, MmlNode_js_1.TEXCLASS.ORD, { fence: true, stretchy: true }],
            "‘": [0, 0, MmlNode_js_1.TEXCLASS.OPEN, { fence: true }],
            "“": [0, 0, MmlNode_js_1.TEXCLASS.OPEN, { fence: true }],
            "ⅅ": exports2.MO.ORD21,
            "ⅆ": OPDEF(2, 0, MmlNode_js_1.TEXCLASS.ORD),
            "∀": exports2.MO.ORD21,
            "∂": exports2.MO.ORD21,
            "∃": exports2.MO.ORD21,
            "∄": exports2.MO.ORD21,
            "∇": exports2.MO.ORD21,
            "∏": exports2.MO.OP,
            "∐": exports2.MO.OP,
            "∑": exports2.MO.OP,
            "−": exports2.MO.BIN01,
            "∓": exports2.MO.BIN01,
            "√": [1, 1, MmlNode_js_1.TEXCLASS.ORD, { stretchy: true }],
            "∛": exports2.MO.ORD11,
            "∜": exports2.MO.ORD11,
            "∠": exports2.MO.ORD,
            "∡": exports2.MO.ORD,
            "∢": exports2.MO.ORD,
            "∫": exports2.MO.INTEGRAL,
            "∬": exports2.MO.INTEGRAL,
            "∭": exports2.MO.INTEGRAL,
            "∮": exports2.MO.INTEGRAL,
            "∯": exports2.MO.INTEGRAL,
            "∰": exports2.MO.INTEGRAL,
            "∱": exports2.MO.INTEGRAL,
            "∲": exports2.MO.INTEGRAL,
            "∳": exports2.MO.INTEGRAL,
            "⋀": exports2.MO.OP,
            "⋁": exports2.MO.OP,
            "⋂": exports2.MO.OP,
            "⋃": exports2.MO.OP,
            "⌈": exports2.MO.OPEN,
            "⌊": exports2.MO.OPEN,
            "〈": exports2.MO.OPEN,
            "❲": exports2.MO.OPEN,
            "⟦": exports2.MO.OPEN,
            "⟨": exports2.MO.OPEN,
            "⟪": exports2.MO.OPEN,
            "⟬": exports2.MO.OPEN,
            "⟮": exports2.MO.OPEN,
            "⦀": [0, 0, MmlNode_js_1.TEXCLASS.ORD, { fence: true, stretchy: true }],
            "⦃": exports2.MO.OPEN,
            "⦅": exports2.MO.OPEN,
            "⦇": exports2.MO.OPEN,
            "⦉": exports2.MO.OPEN,
            "⦋": exports2.MO.OPEN,
            "⦍": exports2.MO.OPEN,
            "⦏": exports2.MO.OPEN,
            "⦑": exports2.MO.OPEN,
            "⦓": exports2.MO.OPEN,
            "⦕": exports2.MO.OPEN,
            "⦗": exports2.MO.OPEN,
            "⧼": exports2.MO.OPEN,
            "⨀": exports2.MO.OP,
            "⨁": exports2.MO.OP,
            "⨂": exports2.MO.OP,
            "⨃": exports2.MO.OP,
            "⨄": exports2.MO.OP,
            "⨅": exports2.MO.OP,
            "⨆": exports2.MO.OP,
            "⨇": exports2.MO.OP,
            "⨈": exports2.MO.OP,
            "⨉": exports2.MO.OP,
            "⨊": exports2.MO.OP,
            "⨋": exports2.MO.INTEGRAL2,
            "⨌": exports2.MO.INTEGRAL,
            "⨍": exports2.MO.INTEGRAL2,
            "⨎": exports2.MO.INTEGRAL2,
            "⨏": exports2.MO.INTEGRAL2,
            "⨐": exports2.MO.OP,
            "⨑": exports2.MO.OP,
            "⨒": exports2.MO.OP,
            "⨓": exports2.MO.OP,
            "⨔": exports2.MO.OP,
            "⨕": exports2.MO.INTEGRAL2,
            "⨖": exports2.MO.INTEGRAL2,
            "⨗": exports2.MO.INTEGRAL2,
            "⨘": exports2.MO.INTEGRAL2,
            "⨙": exports2.MO.INTEGRAL2,
            "⨚": exports2.MO.INTEGRAL2,
            "⨛": exports2.MO.INTEGRAL2,
            "⨜": exports2.MO.INTEGRAL2,
            "⫼": exports2.MO.OP,
            "⫿": exports2.MO.OP
          },
          postfix: {
            "!!": OPDEF(1, 0),
            "!": [1, 0, MmlNode_js_1.TEXCLASS.CLOSE, null],
            '"': exports2.MO.ACCENT,
            "&": exports2.MO.ORD,
            ")": exports2.MO.CLOSE,
            "++": OPDEF(0, 0),
            "--": OPDEF(0, 0),
            "..": OPDEF(0, 0),
            "...": exports2.MO.ORD,
            "'": exports2.MO.ACCENT,
            "]": exports2.MO.CLOSE,
            "^": exports2.MO.WIDEACCENT,
            "_": exports2.MO.WIDEACCENT,
            "`": exports2.MO.ACCENT,
            "|": exports2.MO.CLOSE,
            "}": exports2.MO.CLOSE,
            "~": exports2.MO.WIDEACCENT,
            "||": [0, 0, MmlNode_js_1.TEXCLASS.BIN, { fence: true, stretchy: true, symmetric: true }],
            "|||": [0, 0, MmlNode_js_1.TEXCLASS.ORD, { fence: true, stretchy: true, symmetric: true }],
            "¨": exports2.MO.ACCENT,
            "ª": exports2.MO.ACCENT,
            "¯": exports2.MO.WIDEACCENT,
            "°": exports2.MO.ORD,
            "²": exports2.MO.ACCENT,
            "³": exports2.MO.ACCENT,
            "´": exports2.MO.ACCENT,
            "¸": exports2.MO.ACCENT,
            "¹": exports2.MO.ACCENT,
            "º": exports2.MO.ACCENT,
            "ˆ": exports2.MO.WIDEACCENT,
            "ˇ": exports2.MO.WIDEACCENT,
            "ˉ": exports2.MO.WIDEACCENT,
            "ˊ": exports2.MO.ACCENT,
            "ˋ": exports2.MO.ACCENT,
            "ˍ": exports2.MO.WIDEACCENT,
            "˘": exports2.MO.ACCENT,
            "˙": exports2.MO.ACCENT,
            "˚": exports2.MO.ACCENT,
            "˜": exports2.MO.WIDEACCENT,
            "˝": exports2.MO.ACCENT,
            "˷": exports2.MO.WIDEACCENT,
            "̂": exports2.MO.WIDEACCENT,
            "̑": exports2.MO.ACCENT,
            "϶": exports2.MO.REL,
            "‖": [0, 0, MmlNode_js_1.TEXCLASS.ORD, { fence: true, stretchy: true }],
            "’": [0, 0, MmlNode_js_1.TEXCLASS.CLOSE, { fence: true }],
            "‚": exports2.MO.ACCENT,
            "‛": exports2.MO.ACCENT,
            "”": [0, 0, MmlNode_js_1.TEXCLASS.CLOSE, { fence: true }],
            "„": exports2.MO.ACCENT,
            "‟": exports2.MO.ACCENT,
            "′": exports2.MO.ORD,
            "″": exports2.MO.ACCENT,
            "‴": exports2.MO.ACCENT,
            "‵": exports2.MO.ACCENT,
            "‶": exports2.MO.ACCENT,
            "‷": exports2.MO.ACCENT,
            "‾": exports2.MO.WIDEACCENT,
            "⁗": exports2.MO.ACCENT,
            "⃛": exports2.MO.ACCENT,
            "⃜": exports2.MO.ACCENT,
            "⌉": exports2.MO.CLOSE,
            "⌋": exports2.MO.CLOSE,
            "〉": exports2.MO.CLOSE,
            "⎴": exports2.MO.WIDEACCENT,
            "⎵": exports2.MO.WIDEACCENT,
            "⏜": exports2.MO.WIDEACCENT,
            "⏝": exports2.MO.WIDEACCENT,
            "⏞": exports2.MO.WIDEACCENT,
            "⏟": exports2.MO.WIDEACCENT,
            "⏠": exports2.MO.WIDEACCENT,
            "⏡": exports2.MO.WIDEACCENT,
            "■": exports2.MO.BIN3,
            "□": exports2.MO.BIN3,
            "▪": exports2.MO.BIN3,
            "▫": exports2.MO.BIN3,
            "▭": exports2.MO.BIN3,
            "▮": exports2.MO.BIN3,
            "▯": exports2.MO.BIN3,
            "▰": exports2.MO.BIN3,
            "▱": exports2.MO.BIN3,
            "▲": exports2.MO.BIN4,
            "▴": exports2.MO.BIN4,
            "▶": exports2.MO.BIN4,
            "▷": exports2.MO.BIN4,
            "▸": exports2.MO.BIN4,
            "▼": exports2.MO.BIN4,
            "▾": exports2.MO.BIN4,
            "◀": exports2.MO.BIN4,
            "◁": exports2.MO.BIN4,
            "◂": exports2.MO.BIN4,
            "◄": exports2.MO.BIN4,
            "◅": exports2.MO.BIN4,
            "◆": exports2.MO.BIN4,
            "◇": exports2.MO.BIN4,
            "◈": exports2.MO.BIN4,
            "◉": exports2.MO.BIN4,
            "◌": exports2.MO.BIN4,
            "◍": exports2.MO.BIN4,
            "◎": exports2.MO.BIN4,
            "●": exports2.MO.BIN4,
            "◖": exports2.MO.BIN4,
            "◗": exports2.MO.BIN4,
            "◦": exports2.MO.BIN4,
            "♭": exports2.MO.ORD02,
            "♮": exports2.MO.ORD02,
            "♯": exports2.MO.ORD02,
            "❳": exports2.MO.CLOSE,
            "⟧": exports2.MO.CLOSE,
            "⟩": exports2.MO.CLOSE,
            "⟫": exports2.MO.CLOSE,
            "⟭": exports2.MO.CLOSE,
            "⟯": exports2.MO.CLOSE,
            "⦀": [0, 0, MmlNode_js_1.TEXCLASS.ORD, { fence: true, stretchy: true }],
            "⦄": exports2.MO.CLOSE,
            "⦆": exports2.MO.CLOSE,
            "⦈": exports2.MO.CLOSE,
            "⦊": exports2.MO.CLOSE,
            "⦌": exports2.MO.CLOSE,
            "⦎": exports2.MO.CLOSE,
            "⦐": exports2.MO.CLOSE,
            "⦒": exports2.MO.CLOSE,
            "⦔": exports2.MO.CLOSE,
            "⦖": exports2.MO.CLOSE,
            "⦘": exports2.MO.CLOSE,
            "⧽": exports2.MO.CLOSE
          },
          infix: {
            "!=": exports2.MO.BIN4,
            "#": exports2.MO.ORD,
            "$": exports2.MO.ORD,
            "%": [3, 3, MmlNode_js_1.TEXCLASS.ORD, null],
            "&&": exports2.MO.BIN4,
            "": exports2.MO.ORD,
            "*": exports2.MO.BIN3,
            "**": OPDEF(1, 1),
            "*=": exports2.MO.BIN4,
            "+": exports2.MO.BIN4,
            "+=": exports2.MO.BIN4,
            ",": [0, 3, MmlNode_js_1.TEXCLASS.PUNCT, { linebreakstyle: "after", separator: true }],
            "-": exports2.MO.BIN4,
            "-=": exports2.MO.BIN4,
            "->": exports2.MO.BIN5,
            ".": [0, 3, MmlNode_js_1.TEXCLASS.PUNCT, { separator: true }],
            "/": exports2.MO.ORD11,
            "//": OPDEF(1, 1),
            "/=": exports2.MO.BIN4,
            ":": [1, 2, MmlNode_js_1.TEXCLASS.REL, null],
            ":=": exports2.MO.BIN4,
            ";": [0, 3, MmlNode_js_1.TEXCLASS.PUNCT, { linebreakstyle: "after", separator: true }],
            "<": exports2.MO.REL,
            "<=": exports2.MO.BIN5,
            "<>": OPDEF(1, 1),
            "=": exports2.MO.REL,
            "==": exports2.MO.BIN4,
            ">": exports2.MO.REL,
            ">=": exports2.MO.BIN5,
            "?": [1, 1, MmlNode_js_1.TEXCLASS.CLOSE, null],
            "@": exports2.MO.ORD11,
            "\\": exports2.MO.ORD,
            "^": exports2.MO.ORD11,
            "_": exports2.MO.ORD11,
            "|": [2, 2, MmlNode_js_1.TEXCLASS.ORD, { fence: true, stretchy: true, symmetric: true }],
            "||": [2, 2, MmlNode_js_1.TEXCLASS.BIN, { fence: true, stretchy: true, symmetric: true }],
            "|||": [2, 2, MmlNode_js_1.TEXCLASS.ORD, { fence: true, stretchy: true, symmetric: true }],
            "±": exports2.MO.BIN4,
            "·": exports2.MO.BIN4,
            "×": exports2.MO.BIN4,
            "÷": exports2.MO.BIN4,
            "ʹ": exports2.MO.ORD,
            "̀": exports2.MO.ACCENT,
            "́": exports2.MO.ACCENT,
            "̃": exports2.MO.WIDEACCENT,
            "̄": exports2.MO.ACCENT,
            "̆": exports2.MO.ACCENT,
            "̇": exports2.MO.ACCENT,
            "̈": exports2.MO.ACCENT,
            "̌": exports2.MO.ACCENT,
            "̲": exports2.MO.WIDEACCENT,
            "̸": exports2.MO.REL4,
            "―": [0, 0, MmlNode_js_1.TEXCLASS.ORD, { stretchy: true }],
            "‗": [0, 0, MmlNode_js_1.TEXCLASS.ORD, { stretchy: true }],
            "†": exports2.MO.BIN3,
            "‡": exports2.MO.BIN3,
            "•": exports2.MO.BIN4,
            "…": exports2.MO.INNER,
            "⁃": exports2.MO.BIN4,
            "⁄": exports2.MO.TALLBIN,
            "⁡": exports2.MO.NONE,
            "⁢": exports2.MO.NONE,
            "⁣": [0, 0, MmlNode_js_1.TEXCLASS.NONE, { linebreakstyle: "after", separator: true }],
            "⁤": exports2.MO.NONE,
            "⃗": exports2.MO.ACCENT,
            "ℑ": exports2.MO.ORD,
            "ℓ": exports2.MO.ORD,
            "℘": exports2.MO.ORD,
            "ℜ": exports2.MO.ORD,
            "←": exports2.MO.WIDEREL,
            "↑": exports2.MO.RELSTRETCH,
            "→": exports2.MO.WIDEREL,
            "↓": exports2.MO.RELSTRETCH,
            "↔": exports2.MO.WIDEREL,
            "↕": exports2.MO.RELSTRETCH,
            "↖": exports2.MO.RELSTRETCH,
            "↗": exports2.MO.RELSTRETCH,
            "↘": exports2.MO.RELSTRETCH,
            "↙": exports2.MO.RELSTRETCH,
            "↚": exports2.MO.RELACCENT,
            "↛": exports2.MO.RELACCENT,
            "↜": exports2.MO.WIDEREL,
            "↝": exports2.MO.WIDEREL,
            "↞": exports2.MO.WIDEREL,
            "↟": exports2.MO.WIDEREL,
            "↠": exports2.MO.WIDEREL,
            "↡": exports2.MO.RELSTRETCH,
            "↢": exports2.MO.WIDEREL,
            "↣": exports2.MO.WIDEREL,
            "↤": exports2.MO.WIDEREL,
            "↥": exports2.MO.RELSTRETCH,
            "↦": exports2.MO.WIDEREL,
            "↧": exports2.MO.RELSTRETCH,
            "↨": exports2.MO.RELSTRETCH,
            "↩": exports2.MO.WIDEREL,
            "↪": exports2.MO.WIDEREL,
            "↫": exports2.MO.WIDEREL,
            "↬": exports2.MO.WIDEREL,
            "↭": exports2.MO.WIDEREL,
            "↮": exports2.MO.RELACCENT,
            "↯": exports2.MO.RELSTRETCH,
            "↰": exports2.MO.RELSTRETCH,
            "↱": exports2.MO.RELSTRETCH,
            "↲": exports2.MO.RELSTRETCH,
            "↳": exports2.MO.RELSTRETCH,
            "↴": exports2.MO.RELSTRETCH,
            "↵": exports2.MO.RELSTRETCH,
            "↶": exports2.MO.RELACCENT,
            "↷": exports2.MO.RELACCENT,
            "↸": exports2.MO.REL,
            "↹": exports2.MO.WIDEREL,
            "↺": exports2.MO.REL,
            "↻": exports2.MO.REL,
            "↼": exports2.MO.WIDEREL,
            "↽": exports2.MO.WIDEREL,
            "↾": exports2.MO.RELSTRETCH,
            "↿": exports2.MO.RELSTRETCH,
            "⇀": exports2.MO.WIDEREL,
            "⇁": exports2.MO.WIDEREL,
            "⇂": exports2.MO.RELSTRETCH,
            "⇃": exports2.MO.RELSTRETCH,
            "⇄": exports2.MO.WIDEREL,
            "⇅": exports2.MO.RELSTRETCH,
            "⇆": exports2.MO.WIDEREL,
            "⇇": exports2.MO.WIDEREL,
            "⇈": exports2.MO.RELSTRETCH,
            "⇉": exports2.MO.WIDEREL,
            "⇊": exports2.MO.RELSTRETCH,
            "⇋": exports2.MO.WIDEREL,
            "⇌": exports2.MO.WIDEREL,
            "⇍": exports2.MO.RELACCENT,
            "⇎": exports2.MO.RELACCENT,
            "⇏": exports2.MO.RELACCENT,
            "⇐": exports2.MO.WIDEREL,
            "⇑": exports2.MO.RELSTRETCH,
            "⇒": exports2.MO.WIDEREL,
            "⇓": exports2.MO.RELSTRETCH,
            "⇔": exports2.MO.WIDEREL,
            "⇕": exports2.MO.RELSTRETCH,
            "⇖": exports2.MO.RELSTRETCH,
            "⇗": exports2.MO.RELSTRETCH,
            "⇘": exports2.MO.RELSTRETCH,
            "⇙": exports2.MO.RELSTRETCH,
            "⇚": exports2.MO.WIDEREL,
            "⇛": exports2.MO.WIDEREL,
            "⇜": exports2.MO.WIDEREL,
            "⇝": exports2.MO.WIDEREL,
            "⇞": exports2.MO.REL,
            "⇟": exports2.MO.REL,
            "⇠": exports2.MO.WIDEREL,
            "⇡": exports2.MO.RELSTRETCH,
            "⇢": exports2.MO.WIDEREL,
            "⇣": exports2.MO.RELSTRETCH,
            "⇤": exports2.MO.WIDEREL,
            "⇥": exports2.MO.WIDEREL,
            "⇦": exports2.MO.WIDEREL,
            "⇧": exports2.MO.RELSTRETCH,
            "⇨": exports2.MO.WIDEREL,
            "⇩": exports2.MO.RELSTRETCH,
            "⇪": exports2.MO.RELSTRETCH,
            "⇫": exports2.MO.RELSTRETCH,
            "⇬": exports2.MO.RELSTRETCH,
            "⇭": exports2.MO.RELSTRETCH,
            "⇮": exports2.MO.RELSTRETCH,
            "⇯": exports2.MO.RELSTRETCH,
            "⇰": exports2.MO.WIDEREL,
            "⇱": exports2.MO.REL,
            "⇲": exports2.MO.REL,
            "⇳": exports2.MO.RELSTRETCH,
            "⇴": exports2.MO.RELACCENT,
            "⇵": exports2.MO.RELSTRETCH,
            "⇶": exports2.MO.WIDEREL,
            "⇷": exports2.MO.RELACCENT,
            "⇸": exports2.MO.RELACCENT,
            "⇹": exports2.MO.RELACCENT,
            "⇺": exports2.MO.RELACCENT,
            "⇻": exports2.MO.RELACCENT,
            "⇼": exports2.MO.RELACCENT,
            "⇽": exports2.MO.WIDEREL,
            "⇾": exports2.MO.WIDEREL,
            "⇿": exports2.MO.WIDEREL,
            "∁": OPDEF(1, 2, MmlNode_js_1.TEXCLASS.ORD),
            "∅": exports2.MO.ORD,
            "∆": exports2.MO.BIN3,
            "∈": exports2.MO.REL,
            "∉": exports2.MO.REL,
            "∊": exports2.MO.REL,
            "∋": exports2.MO.REL,
            "∌": exports2.MO.REL,
            "∍": exports2.MO.REL,
            "∎": exports2.MO.BIN3,
            "−": exports2.MO.BIN4,
            "∓": exports2.MO.BIN4,
            "∔": exports2.MO.BIN4,
            "∕": exports2.MO.TALLBIN,
            "∖": exports2.MO.BIN4,
            "∗": exports2.MO.BIN4,
            "∘": exports2.MO.BIN4,
            "∙": exports2.MO.BIN4,
            "∝": exports2.MO.REL,
            "∞": exports2.MO.ORD,
            "∟": exports2.MO.REL,
            "∣": exports2.MO.REL,
            "∤": exports2.MO.REL,
            "∥": exports2.MO.REL,
            "∦": exports2.MO.REL,
            "∧": exports2.MO.BIN4,
            "∨": exports2.MO.BIN4,
            "∩": exports2.MO.BIN4,
            "∪": exports2.MO.BIN4,
            "∴": exports2.MO.REL,
            "∵": exports2.MO.REL,
            "∶": exports2.MO.REL,
            "∷": exports2.MO.REL,
            "∸": exports2.MO.BIN4,
            "∹": exports2.MO.REL,
            "∺": exports2.MO.BIN4,
            "∻": exports2.MO.REL,
            "∼": exports2.MO.REL,
            "∽": exports2.MO.REL,
            "∽̱": exports2.MO.BIN3,
            "∾": exports2.MO.REL,
            "∿": exports2.MO.BIN3,
            "≀": exports2.MO.BIN4,
            "≁": exports2.MO.REL,
            "≂": exports2.MO.REL,
            "≂̸": exports2.MO.REL,
            "≃": exports2.MO.REL,
            "≄": exports2.MO.REL,
            "≅": exports2.MO.REL,
            "≆": exports2.MO.REL,
            "≇": exports2.MO.REL,
            "≈": exports2.MO.REL,
            "≉": exports2.MO.REL,
            "≊": exports2.MO.REL,
            "≋": exports2.MO.REL,
            "≌": exports2.MO.REL,
            "≍": exports2.MO.REL,
            "≎": exports2.MO.REL,
            "≎̸": exports2.MO.REL,
            "≏": exports2.MO.REL,
            "≏̸": exports2.MO.REL,
            "≐": exports2.MO.REL,
            "≑": exports2.MO.REL,
            "≒": exports2.MO.REL,
            "≓": exports2.MO.REL,
            "≔": exports2.MO.REL,
            "≕": exports2.MO.REL,
            "≖": exports2.MO.REL,
            "≗": exports2.MO.REL,
            "≘": exports2.MO.REL,
            "≙": exports2.MO.REL,
            "≚": exports2.MO.REL,
            "≛": exports2.MO.REL,
            "≜": exports2.MO.REL,
            "≝": exports2.MO.REL,
            "≞": exports2.MO.REL,
            "≟": exports2.MO.REL,
            "≠": exports2.MO.REL,
            "≡": exports2.MO.REL,
            "≢": exports2.MO.REL,
            "≣": exports2.MO.REL,
            "≤": exports2.MO.REL,
            "≥": exports2.MO.REL,
            "≦": exports2.MO.REL,
            "≦̸": exports2.MO.REL,
            "≧": exports2.MO.REL,
            "≨": exports2.MO.REL,
            "≩": exports2.MO.REL,
            "≪": exports2.MO.REL,
            "≪̸": exports2.MO.REL,
            "≫": exports2.MO.REL,
            "≫̸": exports2.MO.REL,
            "≬": exports2.MO.REL,
            "≭": exports2.MO.REL,
            "≮": exports2.MO.REL,
            "≯": exports2.MO.REL,
            "≰": exports2.MO.REL,
            "≱": exports2.MO.REL,
            "≲": exports2.MO.REL,
            "≳": exports2.MO.REL,
            "≴": exports2.MO.REL,
            "≵": exports2.MO.REL,
            "≶": exports2.MO.REL,
            "≷": exports2.MO.REL,
            "≸": exports2.MO.REL,
            "≹": exports2.MO.REL,
            "≺": exports2.MO.REL,
            "≻": exports2.MO.REL,
            "≼": exports2.MO.REL,
            "≽": exports2.MO.REL,
            "≾": exports2.MO.REL,
            "≿": exports2.MO.REL,
            "≿̸": exports2.MO.REL,
            "⊀": exports2.MO.REL,
            "⊁": exports2.MO.REL,
            "⊂": exports2.MO.REL,
            "⊂⃒": exports2.MO.REL,
            "⊃": exports2.MO.REL,
            "⊃⃒": exports2.MO.REL,
            "⊄": exports2.MO.REL,
            "⊅": exports2.MO.REL,
            "⊆": exports2.MO.REL,
            "⊇": exports2.MO.REL,
            "⊈": exports2.MO.REL,
            "⊉": exports2.MO.REL,
            "⊊": exports2.MO.REL,
            "⊋": exports2.MO.REL,
            "⊌": exports2.MO.BIN4,
            "⊍": exports2.MO.BIN4,
            "⊎": exports2.MO.BIN4,
            "⊏": exports2.MO.REL,
            "⊏̸": exports2.MO.REL,
            "⊐": exports2.MO.REL,
            "⊐̸": exports2.MO.REL,
            "⊑": exports2.MO.REL,
            "⊒": exports2.MO.REL,
            "⊓": exports2.MO.BIN4,
            "⊔": exports2.MO.BIN4,
            "⊕": exports2.MO.BIN4,
            "⊖": exports2.MO.BIN4,
            "⊗": exports2.MO.BIN4,
            "⊘": exports2.MO.BIN4,
            "⊙": exports2.MO.BIN4,
            "⊚": exports2.MO.BIN4,
            "⊛": exports2.MO.BIN4,
            "⊜": exports2.MO.BIN4,
            "⊝": exports2.MO.BIN4,
            "⊞": exports2.MO.BIN4,
            "⊟": exports2.MO.BIN4,
            "⊠": exports2.MO.BIN4,
            "⊡": exports2.MO.BIN4,
            "⊢": exports2.MO.REL,
            "⊣": exports2.MO.REL,
            "⊤": exports2.MO.ORD55,
            "⊥": exports2.MO.REL,
            "⊦": exports2.MO.REL,
            "⊧": exports2.MO.REL,
            "⊨": exports2.MO.REL,
            "⊩": exports2.MO.REL,
            "⊪": exports2.MO.REL,
            "⊫": exports2.MO.REL,
            "⊬": exports2.MO.REL,
            "⊭": exports2.MO.REL,
            "⊮": exports2.MO.REL,
            "⊯": exports2.MO.REL,
            "⊰": exports2.MO.REL,
            "⊱": exports2.MO.REL,
            "⊲": exports2.MO.REL,
            "⊳": exports2.MO.REL,
            "⊴": exports2.MO.REL,
            "⊵": exports2.MO.REL,
            "⊶": exports2.MO.REL,
            "⊷": exports2.MO.REL,
            "⊸": exports2.MO.REL,
            "⊹": exports2.MO.REL,
            "⊺": exports2.MO.BIN4,
            "⊻": exports2.MO.BIN4,
            "⊼": exports2.MO.BIN4,
            "⊽": exports2.MO.BIN4,
            "⊾": exports2.MO.BIN3,
            "⊿": exports2.MO.BIN3,
            "⋄": exports2.MO.BIN4,
            "⋅": exports2.MO.BIN4,
            "⋆": exports2.MO.BIN4,
            "⋇": exports2.MO.BIN4,
            "⋈": exports2.MO.REL,
            "⋉": exports2.MO.BIN4,
            "⋊": exports2.MO.BIN4,
            "⋋": exports2.MO.BIN4,
            "⋌": exports2.MO.BIN4,
            "⋍": exports2.MO.REL,
            "⋎": exports2.MO.BIN4,
            "⋏": exports2.MO.BIN4,
            "⋐": exports2.MO.REL,
            "⋑": exports2.MO.REL,
            "⋒": exports2.MO.BIN4,
            "⋓": exports2.MO.BIN4,
            "⋔": exports2.MO.REL,
            "⋕": exports2.MO.REL,
            "⋖": exports2.MO.REL,
            "⋗": exports2.MO.REL,
            "⋘": exports2.MO.REL,
            "⋙": exports2.MO.REL,
            "⋚": exports2.MO.REL,
            "⋛": exports2.MO.REL,
            "⋜": exports2.MO.REL,
            "⋝": exports2.MO.REL,
            "⋞": exports2.MO.REL,
            "⋟": exports2.MO.REL,
            "⋠": exports2.MO.REL,
            "⋡": exports2.MO.REL,
            "⋢": exports2.MO.REL,
            "⋣": exports2.MO.REL,
            "⋤": exports2.MO.REL,
            "⋥": exports2.MO.REL,
            "⋦": exports2.MO.REL,
            "⋧": exports2.MO.REL,
            "⋨": exports2.MO.REL,
            "⋩": exports2.MO.REL,
            "⋪": exports2.MO.REL,
            "⋫": exports2.MO.REL,
            "⋬": exports2.MO.REL,
            "⋭": exports2.MO.REL,
            "⋮": exports2.MO.ORD55,
            "⋯": exports2.MO.INNER,
            "⋰": exports2.MO.REL,
            "⋱": [5, 5, MmlNode_js_1.TEXCLASS.INNER, null],
            "⋲": exports2.MO.REL,
            "⋳": exports2.MO.REL,
            "⋴": exports2.MO.REL,
            "⋵": exports2.MO.REL,
            "⋶": exports2.MO.REL,
            "⋷": exports2.MO.REL,
            "⋸": exports2.MO.REL,
            "⋹": exports2.MO.REL,
            "⋺": exports2.MO.REL,
            "⋻": exports2.MO.REL,
            "⋼": exports2.MO.REL,
            "⋽": exports2.MO.REL,
            "⋾": exports2.MO.REL,
            "⋿": exports2.MO.REL,
            "⌅": exports2.MO.BIN3,
            "⌆": exports2.MO.BIN3,
            "⌢": exports2.MO.REL4,
            "⌣": exports2.MO.REL4,
            "〈": exports2.MO.OPEN,
            "〉": exports2.MO.CLOSE,
            "⎪": exports2.MO.ORD,
            "⎯": [0, 0, MmlNode_js_1.TEXCLASS.ORD, { stretchy: true }],
            "⎰": exports2.MO.OPEN,
            "⎱": exports2.MO.CLOSE,
            "─": exports2.MO.ORD,
            "△": exports2.MO.BIN4,
            "▵": exports2.MO.BIN4,
            "▹": exports2.MO.BIN4,
            "▽": exports2.MO.BIN4,
            "▿": exports2.MO.BIN4,
            "◃": exports2.MO.BIN4,
            "◯": exports2.MO.BIN3,
            "♠": exports2.MO.ORD,
            "♡": exports2.MO.ORD,
            "♢": exports2.MO.ORD,
            "♣": exports2.MO.ORD,
            "❘": exports2.MO.REL,
            "⟰": exports2.MO.RELSTRETCH,
            "⟱": exports2.MO.RELSTRETCH,
            "⟵": exports2.MO.WIDEREL,
            "⟶": exports2.MO.WIDEREL,
            "⟷": exports2.MO.WIDEREL,
            "⟸": exports2.MO.WIDEREL,
            "⟹": exports2.MO.WIDEREL,
            "⟺": exports2.MO.WIDEREL,
            "⟻": exports2.MO.WIDEREL,
            "⟼": exports2.MO.WIDEREL,
            "⟽": exports2.MO.WIDEREL,
            "⟾": exports2.MO.WIDEREL,
            "⟿": exports2.MO.WIDEREL,
            "⤀": exports2.MO.RELACCENT,
            "⤁": exports2.MO.RELACCENT,
            "⤂": exports2.MO.RELACCENT,
            "⤃": exports2.MO.RELACCENT,
            "⤄": exports2.MO.RELACCENT,
            "⤅": exports2.MO.RELACCENT,
            "⤆": exports2.MO.RELACCENT,
            "⤇": exports2.MO.RELACCENT,
            "⤈": exports2.MO.REL,
            "⤉": exports2.MO.REL,
            "⤊": exports2.MO.RELSTRETCH,
            "⤋": exports2.MO.RELSTRETCH,
            "⤌": exports2.MO.WIDEREL,
            "⤍": exports2.MO.WIDEREL,
            "⤎": exports2.MO.WIDEREL,
            "⤏": exports2.MO.WIDEREL,
            "⤐": exports2.MO.WIDEREL,
            "⤑": exports2.MO.RELACCENT,
            "⤒": exports2.MO.RELSTRETCH,
            "⤓": exports2.MO.RELSTRETCH,
            "⤔": exports2.MO.RELACCENT,
            "⤕": exports2.MO.RELACCENT,
            "⤖": exports2.MO.RELACCENT,
            "⤗": exports2.MO.RELACCENT,
            "⤘": exports2.MO.RELACCENT,
            "⤙": exports2.MO.RELACCENT,
            "⤚": exports2.MO.RELACCENT,
            "⤛": exports2.MO.RELACCENT,
            "⤜": exports2.MO.RELACCENT,
            "⤝": exports2.MO.RELACCENT,
            "⤞": exports2.MO.RELACCENT,
            "⤟": exports2.MO.RELACCENT,
            "⤠": exports2.MO.RELACCENT,
            "⤡": exports2.MO.RELSTRETCH,
            "⤢": exports2.MO.RELSTRETCH,
            "⤣": exports2.MO.REL,
            "⤤": exports2.MO.REL,
            "⤥": exports2.MO.REL,
            "⤦": exports2.MO.REL,
            "⤧": exports2.MO.REL,
            "⤨": exports2.MO.REL,
            "⤩": exports2.MO.REL,
            "⤪": exports2.MO.REL,
            "⤫": exports2.MO.REL,
            "⤬": exports2.MO.REL,
            "⤭": exports2.MO.REL,
            "⤮": exports2.MO.REL,
            "⤯": exports2.MO.REL,
            "⤰": exports2.MO.REL,
            "⤱": exports2.MO.REL,
            "⤲": exports2.MO.REL,
            "⤳": exports2.MO.RELACCENT,
            "⤴": exports2.MO.REL,
            "⤵": exports2.MO.REL,
            "⤶": exports2.MO.REL,
            "⤷": exports2.MO.REL,
            "⤸": exports2.MO.REL,
            "⤹": exports2.MO.REL,
            "⤺": exports2.MO.RELACCENT,
            "⤻": exports2.MO.RELACCENT,
            "⤼": exports2.MO.RELACCENT,
            "⤽": exports2.MO.RELACCENT,
            "⤾": exports2.MO.REL,
            "⤿": exports2.MO.REL,
            "⥀": exports2.MO.REL,
            "⥁": exports2.MO.REL,
            "⥂": exports2.MO.RELACCENT,
            "⥃": exports2.MO.RELACCENT,
            "⥄": exports2.MO.RELACCENT,
            "⥅": exports2.MO.RELACCENT,
            "⥆": exports2.MO.RELACCENT,
            "⥇": exports2.MO.RELACCENT,
            "⥈": exports2.MO.RELACCENT,
            "⥉": exports2.MO.REL,
            "⥊": exports2.MO.RELACCENT,
            "⥋": exports2.MO.RELACCENT,
            "⥌": exports2.MO.REL,
            "⥍": exports2.MO.REL,
            "⥎": exports2.MO.WIDEREL,
            "⥏": exports2.MO.RELSTRETCH,
            "⥐": exports2.MO.WIDEREL,
            "⥑": exports2.MO.RELSTRETCH,
            "⥒": exports2.MO.WIDEREL,
            "⥓": exports2.MO.WIDEREL,
            "⥔": exports2.MO.RELSTRETCH,
            "⥕": exports2.MO.RELSTRETCH,
            "⥖": exports2.MO.RELSTRETCH,
            "⥗": exports2.MO.RELSTRETCH,
            "⥘": exports2.MO.RELSTRETCH,
            "⥙": exports2.MO.RELSTRETCH,
            "⥚": exports2.MO.WIDEREL,
            "⥛": exports2.MO.WIDEREL,
            "⥜": exports2.MO.RELSTRETCH,
            "⥝": exports2.MO.RELSTRETCH,
            "⥞": exports2.MO.WIDEREL,
            "⥟": exports2.MO.WIDEREL,
            "⥠": exports2.MO.RELSTRETCH,
            "⥡": exports2.MO.RELSTRETCH,
            "⥢": exports2.MO.RELACCENT,
            "⥣": exports2.MO.REL,
            "⥤": exports2.MO.RELACCENT,
            "⥥": exports2.MO.REL,
            "⥦": exports2.MO.RELACCENT,
            "⥧": exports2.MO.RELACCENT,
            "⥨": exports2.MO.RELACCENT,
            "⥩": exports2.MO.RELACCENT,
            "⥪": exports2.MO.RELACCENT,
            "⥫": exports2.MO.RELACCENT,
            "⥬": exports2.MO.RELACCENT,
            "⥭": exports2.MO.RELACCENT,
            "⥮": exports2.MO.RELSTRETCH,
            "⥯": exports2.MO.RELSTRETCH,
            "⥰": exports2.MO.RELACCENT,
            "⥱": exports2.MO.RELACCENT,
            "⥲": exports2.MO.RELACCENT,
            "⥳": exports2.MO.RELACCENT,
            "⥴": exports2.MO.RELACCENT,
            "⥵": exports2.MO.RELACCENT,
            "⥶": exports2.MO.RELACCENT,
            "⥷": exports2.MO.RELACCENT,
            "⥸": exports2.MO.RELACCENT,
            "⥹": exports2.MO.RELACCENT,
            "⥺": exports2.MO.RELACCENT,
            "⥻": exports2.MO.RELACCENT,
            "⥼": exports2.MO.RELACCENT,
            "⥽": exports2.MO.RELACCENT,
            "⥾": exports2.MO.REL,
            "⥿": exports2.MO.REL,
            "⦁": exports2.MO.BIN3,
            "⦂": exports2.MO.BIN3,
            "⦙": exports2.MO.BIN3,
            "⦚": exports2.MO.BIN3,
            "⦛": exports2.MO.BIN3,
            "⦜": exports2.MO.BIN3,
            "⦝": exports2.MO.BIN3,
            "⦞": exports2.MO.BIN3,
            "⦟": exports2.MO.BIN3,
            "⦠": exports2.MO.BIN3,
            "⦡": exports2.MO.BIN3,
            "⦢": exports2.MO.BIN3,
            "⦣": exports2.MO.BIN3,
            "⦤": exports2.MO.BIN3,
            "⦥": exports2.MO.BIN3,
            "⦦": exports2.MO.BIN3,
            "⦧": exports2.MO.BIN3,
            "⦨": exports2.MO.BIN3,
            "⦩": exports2.MO.BIN3,
            "⦪": exports2.MO.BIN3,
            "⦫": exports2.MO.BIN3,
            "⦬": exports2.MO.BIN3,
            "⦭": exports2.MO.BIN3,
            "⦮": exports2.MO.BIN3,
            "⦯": exports2.MO.BIN3,
            "⦰": exports2.MO.BIN3,
            "⦱": exports2.MO.BIN3,
            "⦲": exports2.MO.BIN3,
            "⦳": exports2.MO.BIN3,
            "⦴": exports2.MO.BIN3,
            "⦵": exports2.MO.BIN3,
            "⦶": exports2.MO.BIN4,
            "⦷": exports2.MO.BIN4,
            "⦸": exports2.MO.BIN4,
            "⦹": exports2.MO.BIN4,
            "⦺": exports2.MO.BIN4,
            "⦻": exports2.MO.BIN4,
            "⦼": exports2.MO.BIN4,
            "⦽": exports2.MO.BIN4,
            "⦾": exports2.MO.BIN4,
            "⦿": exports2.MO.BIN4,
            "⧀": exports2.MO.REL,
            "⧁": exports2.MO.REL,
            "⧂": exports2.MO.BIN3,
            "⧃": exports2.MO.BIN3,
            "⧄": exports2.MO.BIN4,
            "⧅": exports2.MO.BIN4,
            "⧆": exports2.MO.BIN4,
            "⧇": exports2.MO.BIN4,
            "⧈": exports2.MO.BIN4,
            "⧉": exports2.MO.BIN3,
            "⧊": exports2.MO.BIN3,
            "⧋": exports2.MO.BIN3,
            "⧌": exports2.MO.BIN3,
            "⧍": exports2.MO.BIN3,
            "⧎": exports2.MO.REL,
            "⧏": exports2.MO.REL,
            "⧏̸": exports2.MO.REL,
            "⧐": exports2.MO.REL,
            "⧐̸": exports2.MO.REL,
            "⧑": exports2.MO.REL,
            "⧒": exports2.MO.REL,
            "⧓": exports2.MO.REL,
            "⧔": exports2.MO.REL,
            "⧕": exports2.MO.REL,
            "⧖": exports2.MO.BIN4,
            "⧗": exports2.MO.BIN4,
            "⧘": exports2.MO.BIN3,
            "⧙": exports2.MO.BIN3,
            "⧛": exports2.MO.BIN3,
            "⧜": exports2.MO.BIN3,
            "⧝": exports2.MO.BIN3,
            "⧞": exports2.MO.REL,
            "⧟": exports2.MO.BIN3,
            "⧠": exports2.MO.BIN3,
            "⧡": exports2.MO.REL,
            "⧢": exports2.MO.BIN4,
            "⧣": exports2.MO.REL,
            "⧤": exports2.MO.REL,
            "⧥": exports2.MO.REL,
            "⧦": exports2.MO.REL,
            "⧧": exports2.MO.BIN3,
            "⧨": exports2.MO.BIN3,
            "⧩": exports2.MO.BIN3,
            "⧪": exports2.MO.BIN3,
            "⧫": exports2.MO.BIN3,
            "⧬": exports2.MO.BIN3,
            "⧭": exports2.MO.BIN3,
            "⧮": exports2.MO.BIN3,
            "⧯": exports2.MO.BIN3,
            "⧰": exports2.MO.BIN3,
            "⧱": exports2.MO.BIN3,
            "⧲": exports2.MO.BIN3,
            "⧳": exports2.MO.BIN3,
            "⧴": exports2.MO.REL,
            "⧵": exports2.MO.BIN4,
            "⧶": exports2.MO.BIN4,
            "⧷": exports2.MO.BIN4,
            "⧸": exports2.MO.BIN3,
            "⧹": exports2.MO.BIN3,
            "⧺": exports2.MO.BIN3,
            "⧻": exports2.MO.BIN3,
            "⧾": exports2.MO.BIN4,
            "⧿": exports2.MO.BIN4,
            "⨝": exports2.MO.BIN3,
            "⨞": exports2.MO.BIN3,
            "⨟": exports2.MO.BIN3,
            "⨠": exports2.MO.BIN3,
            "⨡": exports2.MO.BIN3,
            "⨢": exports2.MO.BIN4,
            "⨣": exports2.MO.BIN4,
            "⨤": exports2.MO.BIN4,
            "⨥": exports2.MO.BIN4,
            "⨦": exports2.MO.BIN4,
            "⨧": exports2.MO.BIN4,
            "⨨": exports2.MO.BIN4,
            "⨩": exports2.MO.BIN4,
            "⨪": exports2.MO.BIN4,
            "⨫": exports2.MO.BIN4,
            "⨬": exports2.MO.BIN4,
            "⨭": exports2.MO.BIN4,
            "⨮": exports2.MO.BIN4,
            "⨯": exports2.MO.BIN4,
            "⨰": exports2.MO.BIN4,
            "⨱": exports2.MO.BIN4,
            "⨲": exports2.MO.BIN4,
            "⨳": exports2.MO.BIN4,
            "⨴": exports2.MO.BIN4,
            "⨵": exports2.MO.BIN4,
            "⨶": exports2.MO.BIN4,
            "⨷": exports2.MO.BIN4,
            "⨸": exports2.MO.BIN4,
            "⨹": exports2.MO.BIN4,
            "⨺": exports2.MO.BIN4,
            "⨻": exports2.MO.BIN4,
            "⨼": exports2.MO.BIN4,
            "⨽": exports2.MO.BIN4,
            "⨾": exports2.MO.BIN4,
            "⨿": exports2.MO.BIN4,
            "⩀": exports2.MO.BIN4,
            "⩁": exports2.MO.BIN4,
            "⩂": exports2.MO.BIN4,
            "⩃": exports2.MO.BIN4,
            "⩄": exports2.MO.BIN4,
            "⩅": exports2.MO.BIN4,
            "⩆": exports2.MO.BIN4,
            "⩇": exports2.MO.BIN4,
            "⩈": exports2.MO.BIN4,
            "⩉": exports2.MO.BIN4,
            "⩊": exports2.MO.BIN4,
            "⩋": exports2.MO.BIN4,
            "⩌": exports2.MO.BIN4,
            "⩍": exports2.MO.BIN4,
            "⩎": exports2.MO.BIN4,
            "⩏": exports2.MO.BIN4,
            "⩐": exports2.MO.BIN4,
            "⩑": exports2.MO.BIN4,
            "⩒": exports2.MO.BIN4,
            "⩓": exports2.MO.BIN4,
            "⩔": exports2.MO.BIN4,
            "⩕": exports2.MO.BIN4,
            "⩖": exports2.MO.BIN4,
            "⩗": exports2.MO.BIN4,
            "⩘": exports2.MO.BIN4,
            "⩙": exports2.MO.REL,
            "⩚": exports2.MO.BIN4,
            "⩛": exports2.MO.BIN4,
            "⩜": exports2.MO.BIN4,
            "⩝": exports2.MO.BIN4,
            "⩞": exports2.MO.BIN4,
            "⩟": exports2.MO.BIN4,
            "⩠": exports2.MO.BIN4,
            "⩡": exports2.MO.BIN4,
            "⩢": exports2.MO.BIN4,
            "⩣": exports2.MO.BIN4,
            "⩤": exports2.MO.BIN4,
            "⩥": exports2.MO.BIN4,
            "⩦": exports2.MO.REL,
            "⩧": exports2.MO.REL,
            "⩨": exports2.MO.REL,
            "⩩": exports2.MO.REL,
            "⩪": exports2.MO.REL,
            "⩫": exports2.MO.REL,
            "⩬": exports2.MO.REL,
            "⩭": exports2.MO.REL,
            "⩮": exports2.MO.REL,
            "⩯": exports2.MO.REL,
            "⩰": exports2.MO.REL,
            "⩱": exports2.MO.BIN4,
            "⩲": exports2.MO.BIN4,
            "⩳": exports2.MO.REL,
            "⩴": exports2.MO.REL,
            "⩵": exports2.MO.REL,
            "⩶": exports2.MO.REL,
            "⩷": exports2.MO.REL,
            "⩸": exports2.MO.REL,
            "⩹": exports2.MO.REL,
            "⩺": exports2.MO.REL,
            "⩻": exports2.MO.REL,
            "⩼": exports2.MO.REL,
            "⩽": exports2.MO.REL,
            "⩽̸": exports2.MO.REL,
            "⩾": exports2.MO.REL,
            "⩾̸": exports2.MO.REL,
            "⩿": exports2.MO.REL,
            "⪀": exports2.MO.REL,
            "⪁": exports2.MO.REL,
            "⪂": exports2.MO.REL,
            "⪃": exports2.MO.REL,
            "⪄": exports2.MO.REL,
            "⪅": exports2.MO.REL,
            "⪆": exports2.MO.REL,
            "⪇": exports2.MO.REL,
            "⪈": exports2.MO.REL,
            "⪉": exports2.MO.REL,
            "⪊": exports2.MO.REL,
            "⪋": exports2.MO.REL,
            "⪌": exports2.MO.REL,
            "⪍": exports2.MO.REL,
            "⪎": exports2.MO.REL,
            "⪏": exports2.MO.REL,
            "⪐": exports2.MO.REL,
            "⪑": exports2.MO.REL,
            "⪒": exports2.MO.REL,
            "⪓": exports2.MO.REL,
            "⪔": exports2.MO.REL,
            "⪕": exports2.MO.REL,
            "⪖": exports2.MO.REL,
            "⪗": exports2.MO.REL,
            "⪘": exports2.MO.REL,
            "⪙": exports2.MO.REL,
            "⪚": exports2.MO.REL,
            "⪛": exports2.MO.REL,
            "⪜": exports2.MO.REL,
            "⪝": exports2.MO.REL,
            "⪞": exports2.MO.REL,
            "⪟": exports2.MO.REL,
            "⪠": exports2.MO.REL,
            "⪡": exports2.MO.REL,
            "⪡̸": exports2.MO.REL,
            "⪢": exports2.MO.REL,
            "⪢̸": exports2.MO.REL,
            "⪣": exports2.MO.REL,
            "⪤": exports2.MO.REL,
            "⪥": exports2.MO.REL,
            "⪦": exports2.MO.REL,
            "⪧": exports2.MO.REL,
            "⪨": exports2.MO.REL,
            "⪩": exports2.MO.REL,
            "⪪": exports2.MO.REL,
            "⪫": exports2.MO.REL,
            "⪬": exports2.MO.REL,
            "⪭": exports2.MO.REL,
            "⪮": exports2.MO.REL,
            "⪯": exports2.MO.REL,
            "⪯̸": exports2.MO.REL,
            "⪰": exports2.MO.REL,
            "⪰̸": exports2.MO.REL,
            "⪱": exports2.MO.REL,
            "⪲": exports2.MO.REL,
            "⪳": exports2.MO.REL,
            "⪴": exports2.MO.REL,
            "⪵": exports2.MO.REL,
            "⪶": exports2.MO.REL,
            "⪷": exports2.MO.REL,
            "⪸": exports2.MO.REL,
            "⪹": exports2.MO.REL,
            "⪺": exports2.MO.REL,
            "⪻": exports2.MO.REL,
            "⪼": exports2.MO.REL,
            "⪽": exports2.MO.REL,
            "⪾": exports2.MO.REL,
            "⪿": exports2.MO.REL,
            "⫀": exports2.MO.REL,
            "⫁": exports2.MO.REL,
            "⫂": exports2.MO.REL,
            "⫃": exports2.MO.REL,
            "⫄": exports2.MO.REL,
            "⫅": exports2.MO.REL,
            "⫆": exports2.MO.REL,
            "⫇": exports2.MO.REL,
            "⫈": exports2.MO.REL,
            "⫉": exports2.MO.REL,
            "⫊": exports2.MO.REL,
            "⫋": exports2.MO.REL,
            "⫌": exports2.MO.REL,
            "⫍": exports2.MO.REL,
            "⫎": exports2.MO.REL,
            "⫏": exports2.MO.REL,
            "⫐": exports2.MO.REL,
            "⫑": exports2.MO.REL,
            "⫒": exports2.MO.REL,
            "⫓": exports2.MO.REL,
            "⫔": exports2.MO.REL,
            "⫕": exports2.MO.REL,
            "⫖": exports2.MO.REL,
            "⫗": exports2.MO.REL,
            "⫘": exports2.MO.REL,
            "⫙": exports2.MO.REL,
            "⫚": exports2.MO.REL,
            "⫛": exports2.MO.REL,
            "⫝": exports2.MO.REL,
            "⫝̸": exports2.MO.REL,
            "⫞": exports2.MO.REL,
            "⫟": exports2.MO.REL,
            "⫠": exports2.MO.REL,
            "⫡": exports2.MO.REL,
            "⫢": exports2.MO.REL,
            "⫣": exports2.MO.REL,
            "⫤": exports2.MO.REL,
            "⫥": exports2.MO.REL,
            "⫦": exports2.MO.REL,
            "⫧": exports2.MO.REL,
            "⫨": exports2.MO.REL,
            "⫩": exports2.MO.REL,
            "⫪": exports2.MO.REL,
            "⫫": exports2.MO.REL,
            "⫬": exports2.MO.REL,
            "⫭": exports2.MO.REL,
            "⫮": exports2.MO.REL,
            "⫯": exports2.MO.REL,
            "⫰": exports2.MO.REL,
            "⫱": exports2.MO.REL,
            "⫲": exports2.MO.REL,
            "⫳": exports2.MO.REL,
            "⫴": exports2.MO.BIN4,
            "⫵": exports2.MO.BIN4,
            "⫶": exports2.MO.BIN4,
            "⫷": exports2.MO.REL,
            "⫸": exports2.MO.REL,
            "⫹": exports2.MO.REL,
            "⫺": exports2.MO.REL,
            "⫻": exports2.MO.BIN4,
            "⫽": exports2.MO.BIN4,
            "⫾": exports2.MO.BIN3,
            "⭅": exports2.MO.RELSTRETCH,
            "⭆": exports2.MO.RELSTRETCH,
            "〈": exports2.MO.OPEN,
            "〉": exports2.MO.CLOSE,
            "︷": exports2.MO.WIDEACCENT,
            "︸": exports2.MO.WIDEACCENT
          }
        };
        exports2.OPTABLE.infix["^"] = exports2.MO.WIDEREL;
        exports2.OPTABLE.infix["_"] = exports2.MO.WIDEREL;
        exports2.OPTABLE.infix["⫝̸"] = exports2.MO.REL;
      })(OperatorDictionary);
      return OperatorDictionary;
    }
    var hasRequiredMo$2;
    function requireMo$2() {
      if (hasRequiredMo$2) return mo$2;
      hasRequiredMo$2 = 1;
      var __extends2 = mo$2 && mo$2.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      var __assign2 = mo$2 && mo$2.__assign || function() {
        __assign2 = Object.assign || function(t2) {
          for (var s, i2 = 1, n = arguments.length; i2 < n; i2++) {
            s = arguments[i2];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
              t2[p] = s[p];
          }
          return t2;
        };
        return __assign2.apply(this, arguments);
      };
      var __read2 = mo$2 && mo$2.__read || function(o, n) {
        var m = typeof Symbol === "function" && o[Symbol.iterator];
        if (!m) return o;
        var i2 = m.call(o), r2, ar2 = [], e;
        try {
          while ((n === void 0 || n-- > 0) && !(r2 = i2.next()).done) ar2.push(r2.value);
        } catch (error2) {
          e = { error: error2 };
        } finally {
          try {
            if (r2 && !r2.done && (m = i2["return"])) m.call(i2);
          } finally {
            if (e) throw e.error;
          }
        }
        return ar2;
      };
      var __values2 = mo$2 && mo$2.__values || function(o) {
        var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i2 = 0;
        if (m) return m.call(o);
        if (o && typeof o.length === "number") return {
          next: function() {
            if (o && i2 >= o.length) o = void 0;
            return { value: o && o[i2++], done: !o };
          }
        };
        throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
      };
      Object.defineProperty(mo$2, "__esModule", { value: true });
      mo$2.MmlMo = void 0;
      var MmlNode_js_1 = requireMmlNode();
      var OperatorDictionary_js_1 = requireOperatorDictionary();
      var string_js_1 = requireString();
      var MmlMo = (function(_super) {
        __extends2(MmlMo2, _super);
        function MmlMo2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this._texClass = null;
          _this.lspace = 5 / 18;
          _this.rspace = 5 / 18;
          return _this;
        }
        Object.defineProperty(MmlMo2.prototype, "texClass", {
          get: function() {
            if (this._texClass === null) {
              var mo2 = this.getText();
              var _a2 = __read2(this.handleExplicitForm(this.getForms()), 3), form1 = _a2[0], form2 = _a2[1], form3 = _a2[2];
              var OPTABLE_1 = this.constructor.OPTABLE;
              var def = OPTABLE_1[form1][mo2] || OPTABLE_1[form2][mo2] || OPTABLE_1[form3][mo2];
              return def ? def[2] : MmlNode_js_1.TEXCLASS.REL;
            }
            return this._texClass;
          },
          set: function(value2) {
            this._texClass = value2;
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(MmlMo2.prototype, "kind", {
          get: function() {
            return "mo";
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(MmlMo2.prototype, "isEmbellished", {
          get: function() {
            return true;
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(MmlMo2.prototype, "hasNewLine", {
          get: function() {
            return this.attributes.get("linebreak") === "newline";
          },
          enumerable: false,
          configurable: true
        });
        MmlMo2.prototype.coreParent = function() {
          var embellished = this;
          var parent = this;
          var math2 = this.factory.getNodeClass("math");
          while (parent && parent.isEmbellished && parent.coreMO() === this && !(parent instanceof math2)) {
            embellished = parent;
            parent = parent.parent;
          }
          return embellished;
        };
        MmlMo2.prototype.coreText = function(parent) {
          if (!parent) {
            return "";
          }
          if (parent.isEmbellished) {
            return parent.coreMO().getText();
          }
          while (((parent.isKind("mrow") || parent.isKind("TeXAtom") && parent.texClass !== MmlNode_js_1.TEXCLASS.VCENTER || parent.isKind("mstyle") || parent.isKind("mphantom")) && parent.childNodes.length === 1 || parent.isKind("munderover")) && parent.childNodes[0]) {
            parent = parent.childNodes[0];
          }
          return parent.isToken ? parent.getText() : "";
        };
        MmlMo2.prototype.hasSpacingAttributes = function() {
          return this.attributes.isSet("lspace") || this.attributes.isSet("rspace");
        };
        Object.defineProperty(MmlMo2.prototype, "isAccent", {
          get: function() {
            var accent = false;
            var node2 = this.coreParent().parent;
            if (node2) {
              var key2 = node2.isKind("mover") ? node2.childNodes[node2.over].coreMO() ? "accent" : "" : node2.isKind("munder") ? node2.childNodes[node2.under].coreMO() ? "accentunder" : "" : node2.isKind("munderover") ? this === node2.childNodes[node2.over].coreMO() ? "accent" : this === node2.childNodes[node2.under].coreMO() ? "accentunder" : "" : "";
              if (key2) {
                var value2 = node2.attributes.getExplicit(key2);
                accent = value2 !== void 0 ? accent : this.attributes.get("accent");
              }
            }
            return accent;
          },
          enumerable: false,
          configurable: true
        });
        MmlMo2.prototype.setTeXclass = function(prev) {
          var _a2 = this.attributes.getList("form", "fence"), form = _a2.form, fence2 = _a2.fence;
          if (this.getProperty("texClass") === void 0 && (this.attributes.isSet("lspace") || this.attributes.isSet("rspace"))) {
            return null;
          }
          if (fence2 && this.texClass === MmlNode_js_1.TEXCLASS.REL) {
            if (form === "prefix") {
              this.texClass = MmlNode_js_1.TEXCLASS.OPEN;
            }
            if (form === "postfix") {
              this.texClass = MmlNode_js_1.TEXCLASS.CLOSE;
            }
          }
          return this.adjustTeXclass(prev);
        };
        MmlMo2.prototype.adjustTeXclass = function(prev) {
          var texClass = this.texClass;
          var prevClass = this.prevClass;
          if (texClass === MmlNode_js_1.TEXCLASS.NONE) {
            return prev;
          }
          if (prev) {
            if (prev.getProperty("autoOP") && (texClass === MmlNode_js_1.TEXCLASS.BIN || texClass === MmlNode_js_1.TEXCLASS.REL)) {
              prevClass = prev.texClass = MmlNode_js_1.TEXCLASS.ORD;
            }
            prevClass = this.prevClass = prev.texClass || MmlNode_js_1.TEXCLASS.ORD;
            this.prevLevel = this.attributes.getInherited("scriptlevel");
          } else {
            prevClass = this.prevClass = MmlNode_js_1.TEXCLASS.NONE;
          }
          if (texClass === MmlNode_js_1.TEXCLASS.BIN && (prevClass === MmlNode_js_1.TEXCLASS.NONE || prevClass === MmlNode_js_1.TEXCLASS.BIN || prevClass === MmlNode_js_1.TEXCLASS.OP || prevClass === MmlNode_js_1.TEXCLASS.REL || prevClass === MmlNode_js_1.TEXCLASS.OPEN || prevClass === MmlNode_js_1.TEXCLASS.PUNCT)) {
            this.texClass = MmlNode_js_1.TEXCLASS.ORD;
          } else if (prevClass === MmlNode_js_1.TEXCLASS.BIN && (texClass === MmlNode_js_1.TEXCLASS.REL || texClass === MmlNode_js_1.TEXCLASS.CLOSE || texClass === MmlNode_js_1.TEXCLASS.PUNCT)) {
            prev.texClass = this.prevClass = MmlNode_js_1.TEXCLASS.ORD;
          } else if (texClass === MmlNode_js_1.TEXCLASS.BIN) {
            var child = this;
            var parent_1 = this.parent;
            while (parent_1 && parent_1.parent && parent_1.isEmbellished && (parent_1.childNodes.length === 1 || !parent_1.isKind("mrow") && parent_1.core() === child)) {
              child = parent_1;
              parent_1 = parent_1.parent;
            }
            if (parent_1.childNodes[parent_1.childNodes.length - 1] === child) {
              this.texClass = MmlNode_js_1.TEXCLASS.ORD;
            }
          }
          return this;
        };
        MmlMo2.prototype.setInheritedAttributes = function(attributes2, display, level, prime2) {
          if (attributes2 === void 0) {
            attributes2 = {};
          }
          if (display === void 0) {
            display = false;
          }
          if (level === void 0) {
            level = 0;
          }
          if (prime2 === void 0) {
            prime2 = false;
          }
          _super.prototype.setInheritedAttributes.call(this, attributes2, display, level, prime2);
          var mo2 = this.getText();
          this.checkOperatorTable(mo2);
          this.checkPseudoScripts(mo2);
          this.checkPrimes(mo2);
          this.checkMathAccent(mo2);
        };
        MmlMo2.prototype.checkOperatorTable = function(mo2) {
          var e_1, _a2;
          var _b2 = __read2(this.handleExplicitForm(this.getForms()), 3), form1 = _b2[0], form2 = _b2[1], form3 = _b2[2];
          this.attributes.setInherited("form", form1);
          var OPTABLE = this.constructor.OPTABLE;
          var def = OPTABLE[form1][mo2] || OPTABLE[form2][mo2] || OPTABLE[form3][mo2];
          if (def) {
            if (this.getProperty("texClass") === void 0) {
              this.texClass = def[2];
            }
            try {
              for (var _c = __values2(Object.keys(def[3] || {})), _d = _c.next(); !_d.done; _d = _c.next()) {
                var name_1 = _d.value;
                this.attributes.setInherited(name_1, def[3][name_1]);
              }
            } catch (e_1_1) {
              e_1 = { error: e_1_1 };
            } finally {
              try {
                if (_d && !_d.done && (_a2 = _c.return)) _a2.call(_c);
              } finally {
                if (e_1) throw e_1.error;
              }
            }
            this.lspace = (def[0] + 1) / 18;
            this.rspace = (def[1] + 1) / 18;
          } else {
            var range2 = (0, OperatorDictionary_js_1.getRange)(mo2);
            if (range2) {
              if (this.getProperty("texClass") === void 0) {
                this.texClass = range2[2];
              }
              var spacing = this.constructor.MMLSPACING[range2[2]];
              this.lspace = (spacing[0] + 1) / 18;
              this.rspace = (spacing[1] + 1) / 18;
            }
          }
        };
        MmlMo2.prototype.getForms = function() {
          var core = this;
          var parent = this.parent;
          var Parent = this.Parent;
          while (Parent && Parent.isEmbellished) {
            core = parent;
            parent = Parent.parent;
            Parent = Parent.Parent;
          }
          if (parent && parent.isKind("mrow") && parent.nonSpaceLength() !== 1) {
            if (parent.firstNonSpace() === core) {
              return ["prefix", "infix", "postfix"];
            }
            if (parent.lastNonSpace() === core) {
              return ["postfix", "infix", "prefix"];
            }
          }
          return ["infix", "prefix", "postfix"];
        };
        MmlMo2.prototype.handleExplicitForm = function(forms2) {
          if (this.attributes.isSet("form")) {
            var form_1 = this.attributes.get("form");
            forms2 = [form_1].concat(forms2.filter(function(name2) {
              return name2 !== form_1;
            }));
          }
          return forms2;
        };
        MmlMo2.prototype.checkPseudoScripts = function(mo2) {
          var PSEUDOSCRIPTS = this.constructor.pseudoScripts;
          if (!mo2.match(PSEUDOSCRIPTS))
            return;
          var parent = this.coreParent().Parent;
          var isPseudo = !parent || !(parent.isKind("msubsup") && !parent.isKind("msub"));
          this.setProperty("pseudoscript", isPseudo);
          if (isPseudo) {
            this.attributes.setInherited("lspace", 0);
            this.attributes.setInherited("rspace", 0);
          }
        };
        MmlMo2.prototype.checkPrimes = function(mo2) {
          var PRIMES = this.constructor.primes;
          if (!mo2.match(PRIMES))
            return;
          var REMAP = this.constructor.remapPrimes;
          var primes2 = (0, string_js_1.unicodeString)((0, string_js_1.unicodeChars)(mo2).map(function(c2) {
            return REMAP[c2];
          }));
          this.setProperty("primes", primes2);
        };
        MmlMo2.prototype.checkMathAccent = function(mo2) {
          var parent = this.Parent;
          if (this.getProperty("mathaccent") !== void 0 || !parent || !parent.isKind("munderover"))
            return;
          var base2 = parent.childNodes[0];
          if (base2.isEmbellished && base2.coreMO() === this)
            return;
          var MATHACCENT = this.constructor.mathaccents;
          if (mo2.match(MATHACCENT)) {
            this.setProperty("mathaccent", true);
          }
        };
        MmlMo2.defaults = __assign2(__assign2({}, MmlNode_js_1.AbstractMmlTokenNode.defaults), { form: "infix", fence: false, separator: false, lspace: "thickmathspace", rspace: "thickmathspace", stretchy: false, symmetric: false, maxsize: "infinity", minsize: "0em", largeop: false, movablelimits: false, accent: false, linebreak: "auto", lineleading: "1ex", linebreakstyle: "before", indentalign: "auto", indentshift: "0", indenttarget: "", indentalignfirst: "indentalign", indentshiftfirst: "indentshift", indentalignlast: "indentalign", indentshiftlast: "indentshift" });
        MmlMo2.MMLSPACING = OperatorDictionary_js_1.MMLSPACING;
        MmlMo2.OPTABLE = OperatorDictionary_js_1.OPTABLE;
        MmlMo2.pseudoScripts = new RegExp([
          "^[\"'*`",
          "ª",
          "°",
          "²-´",
          "¹",
          "º",
          "‘-‟",
          "′-‷⁗",
          "⁰ⁱ",
          "⁴-ⁿ",
          "₀-₎",
          "]+$"
        ].join(""));
        MmlMo2.primes = new RegExp([
          "^[\"'`",
          "‘-‟",
          "]+$"
        ].join(""));
        MmlMo2.remapPrimes = {
          34: 8243,
          39: 8242,
          96: 8245,
          8216: 8245,
          8217: 8242,
          8218: 8242,
          8219: 8245,
          8220: 8246,
          8221: 8243,
          8222: 8243,
          8223: 8246
        };
        MmlMo2.mathaccents = new RegExp([
          "^[",
          "´́ˊ",
          "`̀ˋ",
          "¨̈",
          "~̃˜",
          "¯̄ˉ",
          "˘̆",
          "ˇ̌",
          "^̂ˆ",
          "→⃗",
          "˙̇",
          "˚̊",
          "⃛",
          "⃜",
          "]$"
        ].join(""));
        return MmlMo2;
      })(MmlNode_js_1.AbstractMmlTokenNode);
      mo$2.MmlMo = MmlMo;
      return mo$2;
    }
    var hasRequiredNodeUtil;
    function requireNodeUtil() {
      if (hasRequiredNodeUtil) return NodeUtil;
      hasRequiredNodeUtil = 1;
      var __values2 = NodeUtil && NodeUtil.__values || function(o) {
        var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i2 = 0;
        if (m) return m.call(o);
        if (o && typeof o.length === "number") return {
          next: function() {
            if (o && i2 >= o.length) o = void 0;
            return { value: o && o[i2++], done: !o };
          }
        };
        throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
      };
      var __read2 = NodeUtil && NodeUtil.__read || function(o, n) {
        var m = typeof Symbol === "function" && o[Symbol.iterator];
        if (!m) return o;
        var i2 = m.call(o), r2, ar2 = [], e;
        try {
          while ((n === void 0 || n-- > 0) && !(r2 = i2.next()).done) ar2.push(r2.value);
        } catch (error2) {
          e = { error: error2 };
        } finally {
          try {
            if (r2 && !r2.done && (m = i2["return"])) m.call(i2);
          } finally {
            if (e) throw e.error;
          }
        }
        return ar2;
      };
      var __spreadArray2 = NodeUtil && NodeUtil.__spreadArray || function(to2, from, pack) {
        if (pack || arguments.length === 2) for (var i2 = 0, l = from.length, ar2; i2 < l; i2++) {
          if (ar2 || !(i2 in from)) {
            if (!ar2) ar2 = Array.prototype.slice.call(from, 0, i2);
            ar2[i2] = from[i2];
          }
        }
        return to2.concat(ar2 || Array.prototype.slice.call(from));
      };
      Object.defineProperty(NodeUtil, "__esModule", { value: true });
      var MmlNode_js_1 = requireMmlNode();
      var mo_js_1 = requireMo$2();
      var NodeUtil$1;
      (function(NodeUtil2) {
        var attrs = /* @__PURE__ */ new Map([
          ["autoOP", true],
          ["fnOP", true],
          ["movesupsub", true],
          ["subsupOK", true],
          ["texprimestyle", true],
          ["useHeight", true],
          ["variantForm", true],
          ["withDelims", true],
          ["mathaccent", true],
          ["open", true],
          ["close", true]
        ]);
        function createEntity(code2) {
          return String.fromCodePoint(parseInt(code2, 16));
        }
        NodeUtil2.createEntity = createEntity;
        function getChildren2(node2) {
          return node2.childNodes;
        }
        NodeUtil2.getChildren = getChildren2;
        function getText(node2) {
          return node2.getText();
        }
        NodeUtil2.getText = getText;
        function appendChildren(node2, children2) {
          var e_1, _a2;
          try {
            for (var children_1 = __values2(children2), children_1_1 = children_1.next(); !children_1_1.done; children_1_1 = children_1.next()) {
              var child = children_1_1.value;
              node2.appendChild(child);
            }
          } catch (e_1_1) {
            e_1 = { error: e_1_1 };
          } finally {
            try {
              if (children_1_1 && !children_1_1.done && (_a2 = children_1.return)) _a2.call(children_1);
            } finally {
              if (e_1) throw e_1.error;
            }
          }
        }
        NodeUtil2.appendChildren = appendChildren;
        function setAttribute2(node2, attribute2, value2) {
          node2.attributes.set(attribute2, value2);
        }
        NodeUtil2.setAttribute = setAttribute2;
        function setProperty2(node2, property2, value2) {
          node2.setProperty(property2, value2);
        }
        NodeUtil2.setProperty = setProperty2;
        function setProperties(node2, properties) {
          var e_2, _a2;
          try {
            for (var _b2 = __values2(Object.keys(properties)), _c = _b2.next(); !_c.done; _c = _b2.next()) {
              var name_1 = _c.value;
              var value2 = properties[name_1];
              if (name_1 === "texClass") {
                node2.texClass = value2;
                node2.setProperty(name_1, value2);
              } else if (name_1 === "movablelimits") {
                node2.setProperty("movablelimits", value2);
                if (node2.isKind("mo") || node2.isKind("mstyle")) {
                  node2.attributes.set("movablelimits", value2);
                }
              } else if (name_1 === "inferred") {
              } else if (attrs.has(name_1)) {
                node2.setProperty(name_1, value2);
              } else {
                node2.attributes.set(name_1, value2);
              }
            }
          } catch (e_2_1) {
            e_2 = { error: e_2_1 };
          } finally {
            try {
              if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
            } finally {
              if (e_2) throw e_2.error;
            }
          }
        }
        NodeUtil2.setProperties = setProperties;
        function getProperty(node2, property2) {
          return node2.getProperty(property2);
        }
        NodeUtil2.getProperty = getProperty;
        function getAttribute(node2, attr) {
          return node2.attributes.get(attr);
        }
        NodeUtil2.getAttribute = getAttribute;
        function removeProperties(node2) {
          var properties = [];
          for (var _i = 1; _i < arguments.length; _i++) {
            properties[_i - 1] = arguments[_i];
          }
          node2.removeProperty.apply(node2, __spreadArray2([], __read2(properties), false));
        }
        NodeUtil2.removeProperties = removeProperties;
        function getChildAt(node2, position) {
          return node2.childNodes[position];
        }
        NodeUtil2.getChildAt = getChildAt;
        function setChild(node2, position, child) {
          var children2 = node2.childNodes;
          children2[position] = child;
          if (child) {
            child.parent = node2;
          }
        }
        NodeUtil2.setChild = setChild;
        function copyChildren(oldNode, newNode) {
          var children2 = oldNode.childNodes;
          for (var i2 = 0; i2 < children2.length; i2++) {
            setChild(newNode, i2, children2[i2]);
          }
        }
        NodeUtil2.copyChildren = copyChildren;
        function copyAttributes(oldNode, newNode) {
          newNode.attributes = oldNode.attributes;
          setProperties(newNode, oldNode.getAllProperties());
        }
        NodeUtil2.copyAttributes = copyAttributes;
        function isType(node2, kind) {
          return node2.isKind(kind);
        }
        NodeUtil2.isType = isType;
        function isEmbellished(node2) {
          return node2.isEmbellished;
        }
        NodeUtil2.isEmbellished = isEmbellished;
        function getTexClass(node2) {
          return node2.texClass;
        }
        NodeUtil2.getTexClass = getTexClass;
        function getCoreMO(node2) {
          return node2.coreMO();
        }
        NodeUtil2.getCoreMO = getCoreMO;
        function isNode(item2) {
          return item2 instanceof MmlNode_js_1.AbstractMmlNode || item2 instanceof MmlNode_js_1.AbstractMmlEmptyNode;
        }
        NodeUtil2.isNode = isNode;
        function isInferred(node2) {
          return node2.isInferred;
        }
        NodeUtil2.isInferred = isInferred;
        function getForm(node2) {
          var e_3, _a2;
          if (!isType(node2, "mo")) {
            return null;
          }
          var mo2 = node2;
          var forms2 = mo2.getForms();
          try {
            for (var forms_1 = __values2(forms2), forms_1_1 = forms_1.next(); !forms_1_1.done; forms_1_1 = forms_1.next()) {
              var form = forms_1_1.value;
              var symbol = mo_js_1.MmlMo.OPTABLE[form][mo2.getText()];
              if (symbol) {
                return symbol;
              }
            }
          } catch (e_3_1) {
            e_3 = { error: e_3_1 };
          } finally {
            try {
              if (forms_1_1 && !forms_1_1.done && (_a2 = forms_1.return)) _a2.call(forms_1);
            } finally {
              if (e_3) throw e_3.error;
            }
          }
          return null;
        }
        NodeUtil2.getForm = getForm;
      })(NodeUtil$1 || (NodeUtil$1 = {}));
      NodeUtil.default = NodeUtil$1;
      return NodeUtil;
    }
    var hasRequiredFilterUtil;
    function requireFilterUtil() {
      if (hasRequiredFilterUtil) return FilterUtil;
      hasRequiredFilterUtil = 1;
      var __values2 = FilterUtil && FilterUtil.__values || function(o) {
        var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i2 = 0;
        if (m) return m.call(o);
        if (o && typeof o.length === "number") return {
          next: function() {
            if (o && i2 >= o.length) o = void 0;
            return { value: o && o[i2++], done: !o };
          }
        };
        throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
      };
      var __importDefault2 = FilterUtil && FilterUtil.__importDefault || function(mod2) {
        return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
      };
      Object.defineProperty(FilterUtil, "__esModule", { value: true });
      var MmlNode_js_1 = requireMmlNode();
      var NodeUtil_js_1 = __importDefault2(requireNodeUtil());
      var FilterUtil$1;
      (function(FilterUtil2) {
        FilterUtil2.cleanStretchy = function(arg) {
          var e_1, _a2;
          var options2 = arg.data;
          try {
            for (var _b2 = __values2(options2.getList("fixStretchy")), _c = _b2.next(); !_c.done; _c = _b2.next()) {
              var mo2 = _c.value;
              if (NodeUtil_js_1.default.getProperty(mo2, "fixStretchy")) {
                var symbol = NodeUtil_js_1.default.getForm(mo2);
                if (symbol && symbol[3] && symbol[3]["stretchy"]) {
                  NodeUtil_js_1.default.setAttribute(mo2, "stretchy", false);
                }
                var parent_1 = mo2.parent;
                if (!NodeUtil_js_1.default.getTexClass(mo2) && (!symbol || !symbol[2])) {
                  var texAtom = options2.nodeFactory.create("node", "TeXAtom", [mo2]);
                  parent_1.replaceChild(texAtom, mo2);
                  texAtom.inheritAttributesFrom(mo2);
                }
                NodeUtil_js_1.default.removeProperties(mo2, "fixStretchy");
              }
            }
          } catch (e_1_1) {
            e_1 = { error: e_1_1 };
          } finally {
            try {
              if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
            } finally {
              if (e_1) throw e_1.error;
            }
          }
        };
        FilterUtil2.cleanAttributes = function(arg) {
          var node2 = arg.data.root;
          node2.walkTree(function(mml, _d) {
            var e_2, _a2;
            var attribs = mml.attributes;
            if (!attribs) {
              return;
            }
            var keep = new Set((attribs.get("mjx-keep-attrs") || "").split(/ /));
            delete attribs.getAllAttributes()["mjx-keep-attrs"];
            try {
              for (var _b2 = __values2(attribs.getExplicitNames()), _c = _b2.next(); !_c.done; _c = _b2.next()) {
                var key2 = _c.value;
                if (!keep.has(key2) && attribs.attributes[key2] === mml.attributes.getInherited(key2)) {
                  delete attribs.attributes[key2];
                }
              }
            } catch (e_2_1) {
              e_2 = { error: e_2_1 };
            } finally {
              try {
                if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
              } finally {
                if (e_2) throw e_2.error;
              }
            }
          }, {});
        };
        FilterUtil2.combineRelations = function(arg) {
          var e_3, _a2, e_4, _b2;
          var remove2 = [];
          try {
            for (var _c = __values2(arg.data.getList("mo")), _e2 = _c.next(); !_e2.done; _e2 = _c.next()) {
              var mo2 = _e2.value;
              if (mo2.getProperty("relationsCombined") || !mo2.parent || mo2.parent && !NodeUtil_js_1.default.isType(mo2.parent, "mrow") || NodeUtil_js_1.default.getTexClass(mo2) !== MmlNode_js_1.TEXCLASS.REL) {
                continue;
              }
              var mml = mo2.parent;
              var m2 = void 0;
              var children2 = mml.childNodes;
              var next = children2.indexOf(mo2) + 1;
              var variantForm = NodeUtil_js_1.default.getProperty(mo2, "variantForm");
              while (next < children2.length && (m2 = children2[next]) && NodeUtil_js_1.default.isType(m2, "mo") && NodeUtil_js_1.default.getTexClass(m2) === MmlNode_js_1.TEXCLASS.REL) {
                if (variantForm === NodeUtil_js_1.default.getProperty(m2, "variantForm") && _compareExplicit(mo2, m2)) {
                  NodeUtil_js_1.default.appendChildren(mo2, NodeUtil_js_1.default.getChildren(m2));
                  _copyExplicit(["stretchy", "rspace"], mo2, m2);
                  try {
                    for (var _f = (e_4 = void 0, __values2(m2.getPropertyNames())), _g = _f.next(); !_g.done; _g = _f.next()) {
                      var name_1 = _g.value;
                      mo2.setProperty(name_1, m2.getProperty(name_1));
                    }
                  } catch (e_4_1) {
                    e_4 = { error: e_4_1 };
                  } finally {
                    try {
                      if (_g && !_g.done && (_b2 = _f.return)) _b2.call(_f);
                    } finally {
                      if (e_4) throw e_4.error;
                    }
                  }
                  children2.splice(next, 1);
                  remove2.push(m2);
                  m2.parent = null;
                  m2.setProperty("relationsCombined", true);
                } else {
                  if (mo2.attributes.getExplicit("rspace") == null) {
                    NodeUtil_js_1.default.setAttribute(mo2, "rspace", "0pt");
                  }
                  if (m2.attributes.getExplicit("lspace") == null) {
                    NodeUtil_js_1.default.setAttribute(m2, "lspace", "0pt");
                  }
                  break;
                }
              }
              mo2.attributes.setInherited("form", mo2.getForms()[0]);
            }
          } catch (e_3_1) {
            e_3 = { error: e_3_1 };
          } finally {
            try {
              if (_e2 && !_e2.done && (_a2 = _c.return)) _a2.call(_c);
            } finally {
              if (e_3) throw e_3.error;
            }
          }
          arg.data.removeFromList("mo", remove2);
        };
        var _copyExplicit = function(attrs, node1, node2) {
          var attr1 = node1.attributes;
          var attr2 = node2.attributes;
          attrs.forEach(function(x2) {
            var attr = attr2.getExplicit(x2);
            if (attr != null) {
              attr1.set(x2, attr);
            }
          });
        };
        var _compareExplicit = function(node1, node2) {
          var e_5, _a2;
          var filter = function(attr, space) {
            var exp = attr.getExplicitNames();
            return exp.filter(function(x2) {
              return x2 !== space && (x2 !== "stretchy" || attr.getExplicit("stretchy"));
            });
          };
          var attr1 = node1.attributes;
          var attr2 = node2.attributes;
          var exp1 = filter(attr1, "lspace");
          var exp2 = filter(attr2, "rspace");
          if (exp1.length !== exp2.length) {
            return false;
          }
          try {
            for (var exp1_1 = __values2(exp1), exp1_1_1 = exp1_1.next(); !exp1_1_1.done; exp1_1_1 = exp1_1.next()) {
              var name_2 = exp1_1_1.value;
              if (attr1.getExplicit(name_2) !== attr2.getExplicit(name_2)) {
                return false;
              }
            }
          } catch (e_5_1) {
            e_5 = { error: e_5_1 };
          } finally {
            try {
              if (exp1_1_1 && !exp1_1_1.done && (_a2 = exp1_1.return)) _a2.call(exp1_1);
            } finally {
              if (e_5) throw e_5.error;
            }
          }
          return true;
        };
        var _cleanSubSup = function(options2, low, up) {
          var e_6, _a2;
          var remove2 = [];
          try {
            for (var _b2 = __values2(options2.getList("m" + low + up)), _c = _b2.next(); !_c.done; _c = _b2.next()) {
              var mml = _c.value;
              var children2 = mml.childNodes;
              if (children2[mml[low]] && children2[mml[up]]) {
                continue;
              }
              var parent_2 = mml.parent;
              var newNode = children2[mml[low]] ? options2.nodeFactory.create("node", "m" + low, [children2[mml.base], children2[mml[low]]]) : options2.nodeFactory.create("node", "m" + up, [children2[mml.base], children2[mml[up]]]);
              NodeUtil_js_1.default.copyAttributes(mml, newNode);
              if (parent_2) {
                parent_2.replaceChild(newNode, mml);
              } else {
                options2.root = newNode;
              }
              remove2.push(mml);
            }
          } catch (e_6_1) {
            e_6 = { error: e_6_1 };
          } finally {
            try {
              if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
            } finally {
              if (e_6) throw e_6.error;
            }
          }
          options2.removeFromList("m" + low + up, remove2);
        };
        FilterUtil2.cleanSubSup = function(arg) {
          var options2 = arg.data;
          if (options2.error) {
            return;
          }
          _cleanSubSup(options2, "sub", "sup");
          _cleanSubSup(options2, "under", "over");
        };
        var _moveLimits = function(options2, underover, subsup2) {
          var e_7, _a2;
          var remove2 = [];
          try {
            for (var _b2 = __values2(options2.getList(underover)), _c = _b2.next(); !_c.done; _c = _b2.next()) {
              var mml = _c.value;
              if (mml.attributes.get("displaystyle")) {
                continue;
              }
              var base2 = mml.childNodes[mml.base];
              var mo2 = base2.coreMO();
              if (base2.getProperty("movablelimits") && !mo2.attributes.getExplicit("movablelimits")) {
                var node2 = options2.nodeFactory.create("node", subsup2, mml.childNodes);
                NodeUtil_js_1.default.copyAttributes(mml, node2);
                if (mml.parent) {
                  mml.parent.replaceChild(node2, mml);
                } else {
                  options2.root = node2;
                }
                remove2.push(mml);
              }
            }
          } catch (e_7_1) {
            e_7 = { error: e_7_1 };
          } finally {
            try {
              if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
            } finally {
              if (e_7) throw e_7.error;
            }
          }
          options2.removeFromList(underover, remove2);
        };
        FilterUtil2.moveLimits = function(arg) {
          var options2 = arg.data;
          _moveLimits(options2, "munderover", "msubsup");
          _moveLimits(options2, "munder", "msub");
          _moveLimits(options2, "mover", "msup");
        };
        FilterUtil2.setInherited = function(arg) {
          arg.data.root.setInheritedAttributes({}, arg.math["display"], 0, false);
        };
      })(FilterUtil$1 || (FilterUtil$1 = {}));
      FilterUtil.default = FilterUtil$1;
      return FilterUtil;
    }
    var TexParser = {};
    var ParseUtil = {};
    var TexError = {};
    var hasRequiredTexError;
    function requireTexError() {
      if (hasRequiredTexError) return TexError;
      hasRequiredTexError = 1;
      Object.defineProperty(TexError, "__esModule", { value: true });
      var TexError$1 = (function() {
        function TexError2(id, message2) {
          var rest = [];
          for (var _i = 2; _i < arguments.length; _i++) {
            rest[_i - 2] = arguments[_i];
          }
          this.id = id;
          this.message = TexError2.processString(message2, rest);
        }
        TexError2.processString = function(str2, args2) {
          var parts = str2.split(TexError2.pattern);
          for (var i2 = 1, m = parts.length; i2 < m; i2 += 2) {
            var c2 = parts[i2].charAt(0);
            if (c2 >= "0" && c2 <= "9") {
              parts[i2] = args2[parseInt(parts[i2], 10) - 1];
              if (typeof parts[i2] === "number") {
                parts[i2] = parts[i2].toString();
              }
            } else if (c2 === "{") {
              c2 = parts[i2].substr(1);
              if (c2 >= "0" && c2 <= "9") {
                parts[i2] = args2[parseInt(parts[i2].substr(1, parts[i2].length - 2), 10) - 1];
                if (typeof parts[i2] === "number") {
                  parts[i2] = parts[i2].toString();
                }
              } else {
                var match = parts[i2].match(/^\{([a-z]+):%(\d+)\|(.*)\}$/);
                if (match) {
                  parts[i2] = "%" + parts[i2];
                }
              }
            }
            if (parts[i2] == null) {
              parts[i2] = "???";
            }
          }
          return parts.join("");
        };
        TexError2.pattern = /%(\d+|\{\d+\}|\{[a-z]+:\%\d+(?:\|(?:%\{\d+\}|%.|[^\}])*)+\}|.)/g;
        return TexError2;
      })();
      TexError.default = TexError$1;
      return TexError;
    }
    var Entities = {};
    var AsyncLoad = {};
    var hasRequiredAsyncLoad;
    function requireAsyncLoad() {
      if (hasRequiredAsyncLoad) return AsyncLoad;
      hasRequiredAsyncLoad = 1;
      Object.defineProperty(AsyncLoad, "__esModule", { value: true });
      AsyncLoad.asyncLoad = void 0;
      var mathjax_js_1 = requireMathjax();
      function asyncLoad(name2) {
        if (!mathjax_js_1.mathjax.asyncLoad) {
          return Promise.reject("Can't load '".concat(name2, "': No asyncLoad method specified"));
        }
        return new Promise(function(ok, fail) {
          var result2 = mathjax_js_1.mathjax.asyncLoad(name2);
          if (result2 instanceof Promise) {
            result2.then(function(value2) {
              return ok(value2);
            }).catch(function(err2) {
              return fail(err2);
            });
          } else {
            ok(result2);
          }
        });
      }
      AsyncLoad.asyncLoad = asyncLoad;
      return AsyncLoad;
    }
    var hasRequiredEntities;
    function requireEntities() {
      if (hasRequiredEntities) return Entities;
      hasRequiredEntities = 1;
      (function(exports2) {
        Object.defineProperty(exports2, "__esModule", { value: true });
        exports2.numeric = exports2.translate = exports2.remove = exports2.add = exports2.entities = exports2.options = void 0;
        var Retries_js_1 = requireRetries();
        var AsyncLoad_js_1 = requireAsyncLoad();
        exports2.options = {
          loadMissingEntities: true
        };
        exports2.entities = {
          ApplyFunction: "⁡",
          Backslash: "∖",
          Because: "∵",
          Breve: "˘",
          Cap: "⋒",
          CenterDot: "·",
          CircleDot: "⊙",
          CircleMinus: "⊖",
          CirclePlus: "⊕",
          CircleTimes: "⊗",
          Congruent: "≡",
          ContourIntegral: "∮",
          Coproduct: "∐",
          Cross: "⨯",
          Cup: "⋓",
          CupCap: "≍",
          Dagger: "‡",
          Del: "∇",
          Delta: "Δ",
          Diamond: "⋄",
          DifferentialD: "ⅆ",
          DotEqual: "≐",
          DoubleDot: "¨",
          DoubleRightTee: "⊨",
          DoubleVerticalBar: "∥",
          DownArrow: "↓",
          DownLeftVector: "↽",
          DownRightVector: "⇁",
          DownTee: "⊤",
          Downarrow: "⇓",
          Element: "∈",
          EqualTilde: "≂",
          Equilibrium: "⇌",
          Exists: "∃",
          ExponentialE: "ⅇ",
          FilledVerySmallSquare: "▪",
          ForAll: "∀",
          Gamma: "Γ",
          Gg: "⋙",
          GreaterEqual: "≥",
          GreaterEqualLess: "⋛",
          GreaterFullEqual: "≧",
          GreaterLess: "≷",
          GreaterSlantEqual: "⩾",
          GreaterTilde: "≳",
          Hacek: "ˇ",
          Hat: "^",
          HumpDownHump: "≎",
          HumpEqual: "≏",
          Im: "ℑ",
          ImaginaryI: "ⅈ",
          Integral: "∫",
          Intersection: "⋂",
          InvisibleComma: "⁣",
          InvisibleTimes: "⁢",
          Lambda: "Λ",
          Larr: "↞",
          LeftAngleBracket: "⟨",
          LeftArrow: "←",
          LeftArrowRightArrow: "⇆",
          LeftCeiling: "⌈",
          LeftDownVector: "⇃",
          LeftFloor: "⌊",
          LeftRightArrow: "↔",
          LeftTee: "⊣",
          LeftTriangle: "⊲",
          LeftTriangleEqual: "⊴",
          LeftUpVector: "↿",
          LeftVector: "↼",
          Leftarrow: "⇐",
          Leftrightarrow: "⇔",
          LessEqualGreater: "⋚",
          LessFullEqual: "≦",
          LessGreater: "≶",
          LessSlantEqual: "⩽",
          LessTilde: "≲",
          Ll: "⋘",
          Lleftarrow: "⇚",
          LongLeftArrow: "⟵",
          LongLeftRightArrow: "⟷",
          LongRightArrow: "⟶",
          Longleftarrow: "⟸",
          Longleftrightarrow: "⟺",
          Longrightarrow: "⟹",
          Lsh: "↰",
          MinusPlus: "∓",
          NestedGreaterGreater: "≫",
          NestedLessLess: "≪",
          NotDoubleVerticalBar: "∦",
          NotElement: "∉",
          NotEqual: "≠",
          NotExists: "∄",
          NotGreater: "≯",
          NotGreaterEqual: "≱",
          NotLeftTriangle: "⋪",
          NotLeftTriangleEqual: "⋬",
          NotLess: "≮",
          NotLessEqual: "≰",
          NotPrecedes: "⊀",
          NotPrecedesSlantEqual: "⋠",
          NotRightTriangle: "⋫",
          NotRightTriangleEqual: "⋭",
          NotSubsetEqual: "⊈",
          NotSucceeds: "⊁",
          NotSucceedsSlantEqual: "⋡",
          NotSupersetEqual: "⊉",
          NotTilde: "≁",
          NotVerticalBar: "∤",
          Omega: "Ω",
          OverBar: "‾",
          OverBrace: "⏞",
          PartialD: "∂",
          Phi: "Φ",
          Pi: "Π",
          PlusMinus: "±",
          Precedes: "≺",
          PrecedesEqual: "⪯",
          PrecedesSlantEqual: "≼",
          PrecedesTilde: "≾",
          Product: "∏",
          Proportional: "∝",
          Psi: "Ψ",
          Rarr: "↠",
          Re: "ℜ",
          ReverseEquilibrium: "⇋",
          RightAngleBracket: "⟩",
          RightArrow: "→",
          RightArrowLeftArrow: "⇄",
          RightCeiling: "⌉",
          RightDownVector: "⇂",
          RightFloor: "⌋",
          RightTee: "⊢",
          RightTeeArrow: "↦",
          RightTriangle: "⊳",
          RightTriangleEqual: "⊵",
          RightUpVector: "↾",
          RightVector: "⇀",
          Rightarrow: "⇒",
          Rrightarrow: "⇛",
          Rsh: "↱",
          Sigma: "Σ",
          SmallCircle: "∘",
          Sqrt: "√",
          Square: "□",
          SquareIntersection: "⊓",
          SquareSubset: "⊏",
          SquareSubsetEqual: "⊑",
          SquareSuperset: "⊐",
          SquareSupersetEqual: "⊒",
          SquareUnion: "⊔",
          Star: "⋆",
          Subset: "⋐",
          SubsetEqual: "⊆",
          Succeeds: "≻",
          SucceedsEqual: "⪰",
          SucceedsSlantEqual: "≽",
          SucceedsTilde: "≿",
          SuchThat: "∋",
          Sum: "∑",
          Superset: "⊃",
          SupersetEqual: "⊇",
          Supset: "⋑",
          Therefore: "∴",
          Theta: "Θ",
          Tilde: "∼",
          TildeEqual: "≃",
          TildeFullEqual: "≅",
          TildeTilde: "≈",
          UnderBar: "_",
          UnderBrace: "⏟",
          Union: "⋃",
          UnionPlus: "⊎",
          UpArrow: "↑",
          UpDownArrow: "↕",
          UpTee: "⊥",
          Uparrow: "⇑",
          Updownarrow: "⇕",
          Upsilon: "Υ",
          Vdash: "⊩",
          Vee: "⋁",
          VerticalBar: "∣",
          VerticalTilde: "≀",
          Vvdash: "⊪",
          Wedge: "⋀",
          Xi: "Ξ",
          amp: "&",
          acute: "´",
          aleph: "ℵ",
          alpha: "α",
          amalg: "⨿",
          and: "∧",
          ang: "∠",
          angmsd: "∡",
          angsph: "∢",
          ape: "≊",
          backprime: "‵",
          backsim: "∽",
          backsimeq: "⋍",
          beta: "β",
          beth: "ℶ",
          between: "≬",
          bigcirc: "◯",
          bigodot: "⨀",
          bigoplus: "⨁",
          bigotimes: "⨂",
          bigsqcup: "⨆",
          bigstar: "★",
          bigtriangledown: "▽",
          bigtriangleup: "△",
          biguplus: "⨄",
          blacklozenge: "⧫",
          blacktriangle: "▴",
          blacktriangledown: "▾",
          blacktriangleleft: "◂",
          bowtie: "⋈",
          boxdl: "┐",
          boxdr: "┌",
          boxminus: "⊟",
          boxplus: "⊞",
          boxtimes: "⊠",
          boxul: "┘",
          boxur: "└",
          bsol: "\\",
          bull: "•",
          cap: "∩",
          check: "✓",
          chi: "χ",
          circ: "ˆ",
          circeq: "≗",
          circlearrowleft: "↺",
          circlearrowright: "↻",
          circledR: "®",
          circledS: "Ⓢ",
          circledast: "⊛",
          circledcirc: "⊚",
          circleddash: "⊝",
          clubs: "♣",
          colon: ":",
          comp: "∁",
          ctdot: "⋯",
          cuepr: "⋞",
          cuesc: "⋟",
          cularr: "↶",
          cup: "∪",
          curarr: "↷",
          curlyvee: "⋎",
          curlywedge: "⋏",
          dagger: "†",
          daleth: "ℸ",
          ddarr: "⇊",
          deg: "°",
          delta: "δ",
          digamma: "ϝ",
          div: "÷",
          divideontimes: "⋇",
          dot: "˙",
          doteqdot: "≑",
          dotplus: "∔",
          dotsquare: "⊡",
          dtdot: "⋱",
          ecir: "≖",
          efDot: "≒",
          egs: "⪖",
          ell: "ℓ",
          els: "⪕",
          empty: "∅",
          epsi: "ε",
          epsiv: "ϵ",
          erDot: "≓",
          eta: "η",
          eth: "ð",
          flat: "♭",
          fork: "⋔",
          frown: "⌢",
          gEl: "⪌",
          gamma: "γ",
          gap: "⪆",
          gimel: "ℷ",
          gnE: "≩",
          gnap: "⪊",
          gne: "⪈",
          gnsim: "⋧",
          gt: ">",
          gtdot: "⋗",
          harrw: "↭",
          hbar: "ℏ",
          hellip: "…",
          hookleftarrow: "↩",
          hookrightarrow: "↪",
          imath: "ı",
          infin: "∞",
          intcal: "⊺",
          iota: "ι",
          jmath: "ȷ",
          kappa: "κ",
          kappav: "ϰ",
          lEg: "⪋",
          lambda: "λ",
          lap: "⪅",
          larrlp: "↫",
          larrtl: "↢",
          lbrace: "{",
          lbrack: "[",
          le: "≤",
          leftleftarrows: "⇇",
          leftthreetimes: "⋋",
          lessdot: "⋖",
          lmoust: "⎰",
          lnE: "≨",
          lnap: "⪉",
          lne: "⪇",
          lnsim: "⋦",
          longmapsto: "⟼",
          looparrowright: "↬",
          lowast: "∗",
          loz: "◊",
          lt: "<",
          ltimes: "⋉",
          ltri: "◃",
          macr: "¯",
          malt: "✠",
          mho: "℧",
          mu: "μ",
          multimap: "⊸",
          nLeftarrow: "⇍",
          nLeftrightarrow: "⇎",
          nRightarrow: "⇏",
          nVDash: "⊯",
          nVdash: "⊮",
          natur: "♮",
          nearr: "↗",
          nharr: "↮",
          nlarr: "↚",
          not: "¬",
          nrarr: "↛",
          nu: "ν",
          nvDash: "⊭",
          nvdash: "⊬",
          nwarr: "↖",
          omega: "ω",
          omicron: "ο",
          or: "∨",
          osol: "⊘",
          period: ".",
          phi: "φ",
          phiv: "ϕ",
          pi: "π",
          piv: "ϖ",
          prap: "⪷",
          precnapprox: "⪹",
          precneqq: "⪵",
          precnsim: "⋨",
          prime: "′",
          psi: "ψ",
          quot: '"',
          rarrtl: "↣",
          rbrace: "}",
          rbrack: "]",
          rho: "ρ",
          rhov: "ϱ",
          rightrightarrows: "⇉",
          rightthreetimes: "⋌",
          ring: "˚",
          rmoust: "⎱",
          rtimes: "⋊",
          rtri: "▹",
          scap: "⪸",
          scnE: "⪶",
          scnap: "⪺",
          scnsim: "⋩",
          sdot: "⋅",
          searr: "↘",
          sect: "§",
          sharp: "♯",
          sigma: "σ",
          sigmav: "ς",
          simne: "≆",
          smile: "⌣",
          spades: "♠",
          sub: "⊂",
          subE: "⫅",
          subnE: "⫋",
          subne: "⊊",
          supE: "⫆",
          supnE: "⫌",
          supne: "⊋",
          swarr: "↙",
          tau: "τ",
          theta: "θ",
          thetav: "ϑ",
          tilde: "˜",
          times: "×",
          triangle: "▵",
          triangleq: "≜",
          upsi: "υ",
          upuparrows: "⇈",
          veebar: "⊻",
          vellip: "⋮",
          weierp: "℘",
          xi: "ξ",
          yen: "¥",
          zeta: "ζ",
          zigrarr: "⇝",
          nbsp: " ",
          rsquo: "’",
          lsquo: "‘"
        };
        var loaded = {};
        function add2(additions, file) {
          Object.assign(exports2.entities, additions);
          loaded[file] = true;
        }
        exports2.add = add2;
        function remove2(entity2) {
          delete exports2.entities[entity2];
        }
        exports2.remove = remove2;
        function translate(text2) {
          return text2.replace(/&([a-z][a-z0-9]*|#(?:[0-9]+|x[0-9a-f]+));/ig, replace2);
        }
        exports2.translate = translate;
        function replace2(match, entity2) {
          if (entity2.charAt(0) === "#") {
            return numeric2(entity2.slice(1));
          }
          if (exports2.entities[entity2]) {
            return exports2.entities[entity2];
          }
          if (exports2.options["loadMissingEntities"]) {
            var file = entity2.match(/^[a-zA-Z](fr|scr|opf)$/) ? RegExp.$1 : entity2.charAt(0).toLowerCase();
            if (!loaded[file]) {
              loaded[file] = true;
              (0, Retries_js_1.retryAfter)((0, AsyncLoad_js_1.asyncLoad)("./util/entities/" + file + ".js"));
            }
          }
          return match;
        }
        function numeric2(entity2) {
          var n = entity2.charAt(0) === "x" ? parseInt(entity2.slice(1), 16) : parseInt(entity2);
          return String.fromCodePoint(n);
        }
        exports2.numeric = numeric2;
      })(Entities);
      return Entities;
    }
    var hasRequiredParseUtil;
    function requireParseUtil() {
      if (hasRequiredParseUtil) return ParseUtil;
      hasRequiredParseUtil = 1;
      var __read2 = ParseUtil && ParseUtil.__read || function(o, n) {
        var m = typeof Symbol === "function" && o[Symbol.iterator];
        if (!m) return o;
        var i2 = m.call(o), r2, ar2 = [], e;
        try {
          while ((n === void 0 || n-- > 0) && !(r2 = i2.next()).done) ar2.push(r2.value);
        } catch (error2) {
          e = { error: error2 };
        } finally {
          try {
            if (r2 && !r2.done && (m = i2["return"])) m.call(i2);
          } finally {
            if (e) throw e.error;
          }
        }
        return ar2;
      };
      var __values2 = ParseUtil && ParseUtil.__values || function(o) {
        var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i2 = 0;
        if (m) return m.call(o);
        if (o && typeof o.length === "number") return {
          next: function() {
            if (o && i2 >= o.length) o = void 0;
            return { value: o && o[i2++], done: !o };
          }
        };
        throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
      };
      var __importDefault2 = ParseUtil && ParseUtil.__importDefault || function(mod2) {
        return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
      };
      Object.defineProperty(ParseUtil, "__esModule", { value: true });
      var MmlNode_js_1 = requireMmlNode();
      var NodeUtil_js_1 = __importDefault2(requireNodeUtil());
      var TexParser_js_1 = __importDefault2(requireTexParser());
      var TexError_js_1 = __importDefault2(requireTexError());
      var Entities_js_1 = requireEntities();
      var ParseUtil$1;
      (function(ParseUtil2) {
        var emPerInch = 7.2;
        var pxPerInch = 72;
        var UNIT_CASES = {
          "em": function(m) {
            return m;
          },
          "ex": function(m) {
            return m * 0.43;
          },
          "pt": function(m) {
            return m / 10;
          },
          "pc": function(m) {
            return m * 1.2;
          },
          "px": function(m) {
            return m * emPerInch / pxPerInch;
          },
          "in": function(m) {
            return m * emPerInch;
          },
          "cm": function(m) {
            return m * emPerInch / 2.54;
          },
          "mm": function(m) {
            return m * emPerInch / 25.4;
          },
          "mu": function(m) {
            return m / 18;
          }
        };
        var num2 = "([-+]?([.,]\\d+|\\d+([.,]\\d*)?))";
        var unit = "(pt|em|ex|mu|px|mm|cm|in|pc)";
        var dimenEnd = RegExp("^\\s*" + num2 + "\\s*" + unit + "\\s*$");
        var dimenRest = RegExp("^\\s*" + num2 + "\\s*" + unit + " ?");
        function matchDimen(dim, rest) {
          if (rest === void 0) {
            rest = false;
          }
          var match = dim.match(rest ? dimenRest : dimenEnd);
          return match ? muReplace([match[1].replace(/,/, "."), match[4], match[0].length]) : [null, null, 0];
        }
        ParseUtil2.matchDimen = matchDimen;
        function muReplace(_a2) {
          var _b2 = __read2(_a2, 3), value2 = _b2[0], unit2 = _b2[1], length = _b2[2];
          if (unit2 !== "mu") {
            return [value2, unit2, length];
          }
          var em = Em(UNIT_CASES[unit2](parseFloat(value2 || "1")));
          return [em.slice(0, -2), "em", length];
        }
        function dimen2em(dim) {
          var _a2 = __read2(matchDimen(dim), 2), value2 = _a2[0], unit2 = _a2[1];
          var m = parseFloat(value2 || "1");
          var func = UNIT_CASES[unit2];
          return func ? func(m) : 0;
        }
        ParseUtil2.dimen2em = dimen2em;
        function Em(m) {
          if (Math.abs(m) < 6e-4) {
            return "0em";
          }
          return m.toFixed(3).replace(/\.?0+$/, "") + "em";
        }
        ParseUtil2.Em = Em;
        function cols() {
          var W = [];
          for (var _i = 0; _i < arguments.length; _i++) {
            W[_i] = arguments[_i];
          }
          return W.map(function(n) {
            return Em(n);
          }).join(" ");
        }
        ParseUtil2.cols = cols;
        function fenced(configuration, open, mml, close2, big, color) {
          if (big === void 0) {
            big = "";
          }
          if (color === void 0) {
            color = "";
          }
          var nf = configuration.nodeFactory;
          var mrow2 = nf.create("node", "mrow", [], { open, close: close2, texClass: MmlNode_js_1.TEXCLASS.INNER });
          var mo2;
          if (big) {
            mo2 = new TexParser_js_1.default("\\" + big + "l" + open, configuration.parser.stack.env, configuration).mml();
          } else {
            var openNode = nf.create("text", open);
            mo2 = nf.create("node", "mo", [], { fence: true, stretchy: true, symmetric: true, texClass: MmlNode_js_1.TEXCLASS.OPEN }, openNode);
          }
          NodeUtil_js_1.default.appendChildren(mrow2, [mo2, mml]);
          if (big) {
            mo2 = new TexParser_js_1.default("\\" + big + "r" + close2, configuration.parser.stack.env, configuration).mml();
          } else {
            var closeNode = nf.create("text", close2);
            mo2 = nf.create("node", "mo", [], { fence: true, stretchy: true, symmetric: true, texClass: MmlNode_js_1.TEXCLASS.CLOSE }, closeNode);
          }
          color && mo2.attributes.set("mathcolor", color);
          NodeUtil_js_1.default.appendChildren(mrow2, [mo2]);
          return mrow2;
        }
        ParseUtil2.fenced = fenced;
        function fixedFence(configuration, open, mml, close2) {
          var mrow2 = configuration.nodeFactory.create("node", "mrow", [], { open, close: close2, texClass: MmlNode_js_1.TEXCLASS.ORD });
          if (open) {
            NodeUtil_js_1.default.appendChildren(mrow2, [mathPalette(configuration, open, "l")]);
          }
          if (NodeUtil_js_1.default.isType(mml, "mrow")) {
            NodeUtil_js_1.default.appendChildren(mrow2, NodeUtil_js_1.default.getChildren(mml));
          } else {
            NodeUtil_js_1.default.appendChildren(mrow2, [mml]);
          }
          if (close2) {
            NodeUtil_js_1.default.appendChildren(mrow2, [mathPalette(configuration, close2, "r")]);
          }
          return mrow2;
        }
        ParseUtil2.fixedFence = fixedFence;
        function mathPalette(configuration, fence2, side) {
          if (fence2 === "{" || fence2 === "}") {
            fence2 = "\\" + fence2;
          }
          var D2 = "{\\bigg" + side + " " + fence2 + "}";
          var T = "{\\big" + side + " " + fence2 + "}";
          return new TexParser_js_1.default("\\mathchoice" + D2 + T + T + T, {}, configuration).mml();
        }
        ParseUtil2.mathPalette = mathPalette;
        function fixInitialMO(configuration, nodes) {
          for (var i2 = 0, m = nodes.length; i2 < m; i2++) {
            var child = nodes[i2];
            if (child && (!NodeUtil_js_1.default.isType(child, "mspace") && (!NodeUtil_js_1.default.isType(child, "TeXAtom") || NodeUtil_js_1.default.getChildren(child)[0] && NodeUtil_js_1.default.getChildren(NodeUtil_js_1.default.getChildren(child)[0]).length))) {
              if (NodeUtil_js_1.default.isEmbellished(child) || NodeUtil_js_1.default.isType(child, "TeXAtom") && NodeUtil_js_1.default.getTexClass(child) === MmlNode_js_1.TEXCLASS.REL) {
                var mi2 = configuration.nodeFactory.create("node", "mi");
                nodes.unshift(mi2);
              }
              break;
            }
          }
        }
        ParseUtil2.fixInitialMO = fixInitialMO;
        function internalMath(parser2, text2, level, font) {
          if (parser2.configuration.options.internalMath) {
            return parser2.configuration.options.internalMath(parser2, text2, level, font);
          }
          var mathvariant = font || parser2.stack.env.font;
          var def = mathvariant ? { mathvariant } : {};
          var mml = [], i2 = 0, k2 = 0, c2, node2, match = "", braces = 0;
          if (text2.match(/\\?[${}\\]|\\\(|\\(eq)?ref\s*\{/)) {
            while (i2 < text2.length) {
              c2 = text2.charAt(i2++);
              if (c2 === "$") {
                if (match === "$" && braces === 0) {
                  node2 = parser2.create("node", "TeXAtom", [new TexParser_js_1.default(text2.slice(k2, i2 - 1), {}, parser2.configuration).mml()]);
                  mml.push(node2);
                  match = "";
                  k2 = i2;
                } else if (match === "") {
                  if (k2 < i2 - 1) {
                    mml.push(internalText(parser2, text2.slice(k2, i2 - 1), def));
                  }
                  match = "$";
                  k2 = i2;
                }
              } else if (c2 === "{" && match !== "") {
                braces++;
              } else if (c2 === "}") {
                if (match === "}" && braces === 0) {
                  var atom = new TexParser_js_1.default(text2.slice(k2, i2), {}, parser2.configuration).mml();
                  node2 = parser2.create("node", "TeXAtom", [atom], def);
                  mml.push(node2);
                  match = "";
                  k2 = i2;
                } else if (match !== "") {
                  if (braces) {
                    braces--;
                  }
                }
              } else if (c2 === "\\") {
                if (match === "" && text2.substr(i2).match(/^(eq)?ref\s*\{/)) {
                  var len = RegExp["$&"].length;
                  if (k2 < i2 - 1) {
                    mml.push(internalText(parser2, text2.slice(k2, i2 - 1), def));
                  }
                  match = "}";
                  k2 = i2 - 1;
                  i2 += len;
                } else {
                  c2 = text2.charAt(i2++);
                  if (c2 === "(" && match === "") {
                    if (k2 < i2 - 2) {
                      mml.push(internalText(parser2, text2.slice(k2, i2 - 2), def));
                    }
                    match = ")";
                    k2 = i2;
                  } else if (c2 === ")" && match === ")" && braces === 0) {
                    node2 = parser2.create("node", "TeXAtom", [new TexParser_js_1.default(text2.slice(k2, i2 - 2), {}, parser2.configuration).mml()]);
                    mml.push(node2);
                    match = "";
                    k2 = i2;
                  } else if (c2.match(/[${}\\]/) && match === "") {
                    i2--;
                    text2 = text2.substr(0, i2 - 1) + text2.substr(i2);
                  }
                }
              }
            }
            if (match !== "") {
              throw new TexError_js_1.default("MathNotTerminated", "Math not terminated in text box");
            }
          }
          if (k2 < text2.length) {
            mml.push(internalText(parser2, text2.slice(k2), def));
          }
          if (level != null) {
            mml = [parser2.create("node", "mstyle", mml, { displaystyle: false, scriptlevel: level })];
          } else if (mml.length > 1) {
            mml = [parser2.create("node", "mrow", mml)];
          }
          return mml;
        }
        ParseUtil2.internalMath = internalMath;
        function internalText(parser2, text2, def) {
          text2 = text2.replace(/^\s+/, Entities_js_1.entities.nbsp).replace(/\s+$/, Entities_js_1.entities.nbsp);
          var textNode = parser2.create("text", text2);
          return parser2.create("node", "mtext", [], def, textNode);
        }
        ParseUtil2.internalText = internalText;
        function underOver(parser2, base2, script2, pos2, stack2) {
          ParseUtil2.checkMovableLimits(base2);
          if (NodeUtil_js_1.default.isType(base2, "munderover") && NodeUtil_js_1.default.isEmbellished(base2)) {
            NodeUtil_js_1.default.setProperties(NodeUtil_js_1.default.getCoreMO(base2), { lspace: 0, rspace: 0 });
            var mo2 = parser2.create("node", "mo", [], { rspace: 0 });
            base2 = parser2.create("node", "mrow", [mo2, base2]);
          }
          var mml = parser2.create("node", "munderover", [base2]);
          NodeUtil_js_1.default.setChild(mml, pos2 === "over" ? mml.over : mml.under, script2);
          var node2 = mml;
          if (stack2) {
            node2 = parser2.create("node", "TeXAtom", [mml], { texClass: MmlNode_js_1.TEXCLASS.OP, movesupsub: true });
          }
          NodeUtil_js_1.default.setProperty(node2, "subsupOK", true);
          return node2;
        }
        ParseUtil2.underOver = underOver;
        function checkMovableLimits(base2) {
          var symbol = NodeUtil_js_1.default.isType(base2, "mo") ? NodeUtil_js_1.default.getForm(base2) : null;
          if (NodeUtil_js_1.default.getProperty(base2, "movablelimits") || symbol && symbol[3] && symbol[3].movablelimits) {
            NodeUtil_js_1.default.setProperties(base2, { movablelimits: false });
          }
        }
        ParseUtil2.checkMovableLimits = checkMovableLimits;
        function trimSpaces(text2) {
          if (typeof text2 !== "string") {
            return text2;
          }
          var TEXT = text2.trim();
          if (TEXT.match(/\\$/) && text2.match(/ $/)) {
            TEXT += " ";
          }
          return TEXT;
        }
        ParseUtil2.trimSpaces = trimSpaces;
        function setArrayAlign(array, align) {
          align = ParseUtil2.trimSpaces(align || "");
          if (align === "t") {
            array.arraydef.align = "baseline 1";
          } else if (align === "b") {
            array.arraydef.align = "baseline -1";
          } else if (align === "c") {
            array.arraydef.align = "axis";
          } else if (align) {
            array.arraydef.align = align;
          }
          return array;
        }
        ParseUtil2.setArrayAlign = setArrayAlign;
        function substituteArgs(parser2, args2, str2) {
          var text2 = "";
          var newstring = "";
          var i2 = 0;
          while (i2 < str2.length) {
            var c2 = str2.charAt(i2++);
            if (c2 === "\\") {
              text2 += c2 + str2.charAt(i2++);
            } else if (c2 === "#") {
              c2 = str2.charAt(i2++);
              if (c2 === "#") {
                text2 += c2;
              } else {
                if (!c2.match(/[1-9]/) || parseInt(c2, 10) > args2.length) {
                  throw new TexError_js_1.default("IllegalMacroParam", "Illegal macro parameter reference");
                }
                newstring = addArgs(parser2, addArgs(parser2, newstring, text2), args2[parseInt(c2, 10) - 1]);
                text2 = "";
              }
            } else {
              text2 += c2;
            }
          }
          return addArgs(parser2, newstring, text2);
        }
        ParseUtil2.substituteArgs = substituteArgs;
        function addArgs(parser2, s1, s2) {
          if (s2.match(/^[a-z]/i) && s1.match(/(^|[^\\])(\\\\)*\\[a-z]+$/i)) {
            s1 += " ";
          }
          if (s1.length + s2.length > parser2.configuration.options["maxBuffer"]) {
            throw new TexError_js_1.default("MaxBufferSize", "MathJax internal buffer size exceeded; is there a recursive macro call?");
          }
          return s1 + s2;
        }
        ParseUtil2.addArgs = addArgs;
        function checkMaxMacros(parser2, isMacro) {
          if (isMacro === void 0) {
            isMacro = true;
          }
          if (++parser2.macroCount <= parser2.configuration.options["maxMacros"]) {
            return;
          }
          if (isMacro) {
            throw new TexError_js_1.default("MaxMacroSub1", "MathJax maximum macro substitution count exceeded; is here a recursive macro call?");
          } else {
            throw new TexError_js_1.default("MaxMacroSub2", "MathJax maximum substitution count exceeded; is there a recursive latex environment?");
          }
        }
        ParseUtil2.checkMaxMacros = checkMaxMacros;
        function checkEqnEnv(parser2) {
          if (parser2.stack.global.eqnenv) {
            throw new TexError_js_1.default("ErroneousNestingEq", "Erroneous nesting of equation structures");
          }
          parser2.stack.global.eqnenv = true;
        }
        ParseUtil2.checkEqnEnv = checkEqnEnv;
        function copyNode(node2, parser2) {
          var tree = node2.copy();
          var options2 = parser2.configuration;
          tree.walkTree(function(n) {
            var e_1, _a2;
            options2.addNode(n.kind, n);
            var lists = (n.getProperty("in-lists") || "").split(/,/);
            try {
              for (var lists_1 = __values2(lists), lists_1_1 = lists_1.next(); !lists_1_1.done; lists_1_1 = lists_1.next()) {
                var list2 = lists_1_1.value;
                list2 && options2.addNode(list2, n);
              }
            } catch (e_1_1) {
              e_1 = { error: e_1_1 };
            } finally {
              try {
                if (lists_1_1 && !lists_1_1.done && (_a2 = lists_1.return)) _a2.call(lists_1);
              } finally {
                if (e_1) throw e_1.error;
              }
            }
          });
          return tree;
        }
        ParseUtil2.copyNode = copyNode;
        function MmlFilterAttribute(_parser2, _name, value2) {
          return value2;
        }
        ParseUtil2.MmlFilterAttribute = MmlFilterAttribute;
        function getFontDef(parser2) {
          var font = parser2.stack.env["font"];
          return font ? { mathvariant: font } : {};
        }
        ParseUtil2.getFontDef = getFontDef;
        function keyvalOptions(attrib, allowed, error2) {
          var e_2, _a2;
          if (allowed === void 0) {
            allowed = null;
          }
          if (error2 === void 0) {
            error2 = false;
          }
          var def = readKeyval(attrib);
          if (allowed) {
            try {
              for (var _b2 = __values2(Object.keys(def)), _c = _b2.next(); !_c.done; _c = _b2.next()) {
                var key2 = _c.value;
                if (!allowed.hasOwnProperty(key2)) {
                  if (error2) {
                    throw new TexError_js_1.default("InvalidOption", "Invalid option: %1", key2);
                  }
                  delete def[key2];
                }
              }
            } catch (e_2_1) {
              e_2 = { error: e_2_1 };
            } finally {
              try {
                if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
              } finally {
                if (e_2) throw e_2.error;
              }
            }
          }
          return def;
        }
        ParseUtil2.keyvalOptions = keyvalOptions;
        function readKeyval(text2) {
          var _a2, _b2;
          var options2 = {};
          var rest = text2;
          var end2, key2, val;
          while (rest) {
            _a2 = __read2(readValue(rest, ["=", ","]), 3), key2 = _a2[0], end2 = _a2[1], rest = _a2[2];
            if (end2 === "=") {
              _b2 = __read2(readValue(rest, [","]), 3), val = _b2[0], end2 = _b2[1], rest = _b2[2];
              val = val === "false" || val === "true" ? JSON.parse(val) : val;
              options2[key2] = val;
            } else if (key2) {
              options2[key2] = true;
            }
          }
          return options2;
        }
        function removeBraces(text2, count) {
          while (count > 0) {
            text2 = text2.trim().slice(1, -1);
            count--;
          }
          return text2.trim();
        }
        function readValue(text2, end2) {
          var length = text2.length;
          var braces = 0;
          var value2 = "";
          var index = 0;
          var start2 = 0;
          var startCount = true;
          var stopCount = false;
          while (index < length) {
            var c2 = text2[index++];
            switch (c2) {
              case " ":
                break;
              case "{":
                if (startCount) {
                  start2++;
                } else {
                  stopCount = false;
                  if (start2 > braces) {
                    start2 = braces;
                  }
                }
                braces++;
                break;
              case "}":
                if (braces) {
                  braces--;
                }
                if (startCount || stopCount) {
                  start2--;
                  stopCount = true;
                }
                startCount = false;
                break;
              default:
                if (!braces && end2.indexOf(c2) !== -1) {
                  return [stopCount ? "true" : removeBraces(value2, start2), c2, text2.slice(index)];
                }
                startCount = false;
                stopCount = false;
            }
            value2 += c2;
          }
          if (braces) {
            throw new TexError_js_1.default("ExtraOpenMissingClose", "Extra open brace or missing close brace");
          }
          return [stopCount ? "true" : removeBraces(value2, start2), "", text2.slice(index)];
        }
      })(ParseUtil$1 || (ParseUtil$1 = {}));
      ParseUtil.default = ParseUtil$1;
      return ParseUtil;
    }
    var Stack = {};
    var hasRequiredStack;
    function requireStack() {
      if (hasRequiredStack) return Stack;
      hasRequiredStack = 1;
      var __values2 = Stack && Stack.__values || function(o) {
        var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i2 = 0;
        if (m) return m.call(o);
        if (o && typeof o.length === "number") return {
          next: function() {
            if (o && i2 >= o.length) o = void 0;
            return { value: o && o[i2++], done: !o };
          }
        };
        throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
      };
      var __read2 = Stack && Stack.__read || function(o, n) {
        var m = typeof Symbol === "function" && o[Symbol.iterator];
        if (!m) return o;
        var i2 = m.call(o), r2, ar2 = [], e;
        try {
          while ((n === void 0 || n-- > 0) && !(r2 = i2.next()).done) ar2.push(r2.value);
        } catch (error2) {
          e = { error: error2 };
        } finally {
          try {
            if (r2 && !r2.done && (m = i2["return"])) m.call(i2);
          } finally {
            if (e) throw e.error;
          }
        }
        return ar2;
      };
      var __spreadArray2 = Stack && Stack.__spreadArray || function(to2, from, pack) {
        if (pack || arguments.length === 2) for (var i2 = 0, l = from.length, ar2; i2 < l; i2++) {
          if (ar2 || !(i2 in from)) {
            if (!ar2) ar2 = Array.prototype.slice.call(from, 0, i2);
            ar2[i2] = from[i2];
          }
        }
        return to2.concat(ar2 || Array.prototype.slice.call(from));
      };
      var __importDefault2 = Stack && Stack.__importDefault || function(mod2) {
        return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
      };
      Object.defineProperty(Stack, "__esModule", { value: true });
      var NodeUtil_js_1 = __importDefault2(requireNodeUtil());
      var Stack$1 = (function() {
        function Stack2(_factory, _env, inner2) {
          this._factory = _factory;
          this._env = _env;
          this.global = {};
          this.stack = [];
          this.global = { isInner: inner2 };
          this.stack = [this._factory.create("start", this.global)];
          if (_env) {
            this.stack[0].env = _env;
          }
          this.env = this.stack[0].env;
        }
        Object.defineProperty(Stack2.prototype, "env", {
          get: function() {
            return this._env;
          },
          set: function(env) {
            this._env = env;
          },
          enumerable: false,
          configurable: true
        });
        Stack2.prototype.Push = function() {
          var e_1, _a2;
          var args2 = [];
          for (var _i = 0; _i < arguments.length; _i++) {
            args2[_i] = arguments[_i];
          }
          try {
            for (var args_1 = __values2(args2), args_1_1 = args_1.next(); !args_1_1.done; args_1_1 = args_1.next()) {
              var node2 = args_1_1.value;
              if (!node2) {
                continue;
              }
              var item2 = NodeUtil_js_1.default.isNode(node2) ? this._factory.create("mml", node2) : node2;
              item2.global = this.global;
              var _b2 = __read2(this.stack.length ? this.Top().checkItem(item2) : [null, true], 2), top_1 = _b2[0], success2 = _b2[1];
              if (!success2) {
                continue;
              }
              if (top_1) {
                this.Pop();
                this.Push.apply(this, __spreadArray2([], __read2(top_1), false));
                continue;
              }
              this.stack.push(item2);
              if (item2.env) {
                if (item2.copyEnv) {
                  Object.assign(item2.env, this.env);
                }
                this.env = item2.env;
              } else {
                item2.env = this.env;
              }
            }
          } catch (e_1_1) {
            e_1 = { error: e_1_1 };
          } finally {
            try {
              if (args_1_1 && !args_1_1.done && (_a2 = args_1.return)) _a2.call(args_1);
            } finally {
              if (e_1) throw e_1.error;
            }
          }
        };
        Stack2.prototype.Pop = function() {
          var item2 = this.stack.pop();
          if (!item2.isOpen) {
            delete item2.env;
          }
          this.env = this.stack.length ? this.Top().env : {};
          return item2;
        };
        Stack2.prototype.Top = function(n) {
          if (n === void 0) {
            n = 1;
          }
          return this.stack.length < n ? null : this.stack[this.stack.length - n];
        };
        Stack2.prototype.Prev = function(noPop) {
          var top2 = this.Top();
          return noPop ? top2.First : top2.Pop();
        };
        Stack2.prototype.toString = function() {
          return "stack[\n  " + this.stack.join("\n  ") + "\n]";
        };
        return Stack2;
      })();
      Stack.default = Stack$1;
      return Stack;
    }
    var hasRequiredTexParser;
    function requireTexParser() {
      if (hasRequiredTexParser) return TexParser;
      hasRequiredTexParser = 1;
      var __values2 = TexParser && TexParser.__values || function(o) {
        var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i2 = 0;
        if (m) return m.call(o);
        if (o && typeof o.length === "number") return {
          next: function() {
            if (o && i2 >= o.length) o = void 0;
            return { value: o && o[i2++], done: !o };
          }
        };
        throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
      };
      var __read2 = TexParser && TexParser.__read || function(o, n) {
        var m = typeof Symbol === "function" && o[Symbol.iterator];
        if (!m) return o;
        var i2 = m.call(o), r2, ar2 = [], e;
        try {
          while ((n === void 0 || n-- > 0) && !(r2 = i2.next()).done) ar2.push(r2.value);
        } catch (error2) {
          e = { error: error2 };
        } finally {
          try {
            if (r2 && !r2.done && (m = i2["return"])) m.call(i2);
          } finally {
            if (e) throw e.error;
          }
        }
        return ar2;
      };
      var __spreadArray2 = TexParser && TexParser.__spreadArray || function(to2, from, pack) {
        if (pack || arguments.length === 2) for (var i2 = 0, l = from.length, ar2; i2 < l; i2++) {
          if (ar2 || !(i2 in from)) {
            if (!ar2) ar2 = Array.prototype.slice.call(from, 0, i2);
            ar2[i2] = from[i2];
          }
        }
        return to2.concat(ar2 || Array.prototype.slice.call(from));
      };
      var __importDefault2 = TexParser && TexParser.__importDefault || function(mod2) {
        return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
      };
      Object.defineProperty(TexParser, "__esModule", { value: true });
      var ParseUtil_js_1 = __importDefault2(requireParseUtil());
      var Stack_js_1 = __importDefault2(requireStack());
      var TexError_js_1 = __importDefault2(requireTexError());
      var MmlNode_js_1 = requireMmlNode();
      var TexParser$1 = (function() {
        function TexParser2(_string, env, configuration) {
          var e_1, _a2;
          this._string = _string;
          this.configuration = configuration;
          this.macroCount = 0;
          this.i = 0;
          this.currentCS = "";
          var inner2 = env.hasOwnProperty("isInner");
          var isInner = env["isInner"];
          delete env["isInner"];
          var ENV;
          if (env) {
            ENV = {};
            try {
              for (var _b2 = __values2(Object.keys(env)), _c = _b2.next(); !_c.done; _c = _b2.next()) {
                var id = _c.value;
                ENV[id] = env[id];
              }
            } catch (e_1_1) {
              e_1 = { error: e_1_1 };
            } finally {
              try {
                if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
              } finally {
                if (e_1) throw e_1.error;
              }
            }
          }
          this.configuration.pushParser(this);
          this.stack = new Stack_js_1.default(this.itemFactory, ENV, inner2 ? isInner : true);
          this.Parse();
          this.Push(this.itemFactory.create("stop"));
        }
        Object.defineProperty(TexParser2.prototype, "options", {
          get: function() {
            return this.configuration.options;
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(TexParser2.prototype, "itemFactory", {
          get: function() {
            return this.configuration.itemFactory;
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(TexParser2.prototype, "tags", {
          get: function() {
            return this.configuration.tags;
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(TexParser2.prototype, "string", {
          get: function() {
            return this._string;
          },
          set: function(str2) {
            this._string = str2;
          },
          enumerable: false,
          configurable: true
        });
        TexParser2.prototype.parse = function(kind, input2) {
          return this.configuration.handlers.get(kind).parse(input2);
        };
        TexParser2.prototype.lookup = function(kind, symbol) {
          return this.configuration.handlers.get(kind).lookup(symbol);
        };
        TexParser2.prototype.contains = function(kind, symbol) {
          return this.configuration.handlers.get(kind).contains(symbol);
        };
        TexParser2.prototype.toString = function() {
          var e_2, _a2;
          var str2 = "";
          try {
            for (var _b2 = __values2(Array.from(this.configuration.handlers.keys())), _c = _b2.next(); !_c.done; _c = _b2.next()) {
              var config2 = _c.value;
              str2 += config2 + ": " + this.configuration.handlers.get(config2) + "\n";
            }
          } catch (e_2_1) {
            e_2 = { error: e_2_1 };
          } finally {
            try {
              if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
            } finally {
              if (e_2) throw e_2.error;
            }
          }
          return str2;
        };
        TexParser2.prototype.Parse = function() {
          var c2;
          while (this.i < this.string.length) {
            c2 = this.getCodePoint();
            this.i += c2.length;
            this.parse("character", [this, c2]);
          }
        };
        TexParser2.prototype.Push = function(arg) {
          if (arg instanceof MmlNode_js_1.AbstractMmlNode && arg.isInferred) {
            this.PushAll(arg.childNodes);
          } else {
            this.stack.Push(arg);
          }
        };
        TexParser2.prototype.PushAll = function(args2) {
          var e_3, _a2;
          try {
            for (var args_1 = __values2(args2), args_1_1 = args_1.next(); !args_1_1.done; args_1_1 = args_1.next()) {
              var arg = args_1_1.value;
              this.stack.Push(arg);
            }
          } catch (e_3_1) {
            e_3 = { error: e_3_1 };
          } finally {
            try {
              if (args_1_1 && !args_1_1.done && (_a2 = args_1.return)) _a2.call(args_1);
            } finally {
              if (e_3) throw e_3.error;
            }
          }
        };
        TexParser2.prototype.mml = function() {
          if (!this.stack.Top().isKind("mml")) {
            return null;
          }
          var node2 = this.stack.Top().First;
          this.configuration.popParser();
          return node2;
        };
        TexParser2.prototype.convertDelimiter = function(c2) {
          var symbol = this.lookup("delimiter", c2);
          return symbol ? symbol.char : null;
        };
        TexParser2.prototype.getCodePoint = function() {
          var code2 = this.string.codePointAt(this.i);
          return code2 === void 0 ? "" : String.fromCodePoint(code2);
        };
        TexParser2.prototype.nextIsSpace = function() {
          return !!this.string.charAt(this.i).match(/\s/);
        };
        TexParser2.prototype.GetNext = function() {
          while (this.nextIsSpace()) {
            this.i++;
          }
          return this.getCodePoint();
        };
        TexParser2.prototype.GetCS = function() {
          var CS = this.string.slice(this.i).match(/^(([a-z]+) ?|[\uD800-\uDBFF].|.)/i);
          if (CS) {
            this.i += CS[0].length;
            return CS[2] || CS[1];
          } else {
            this.i++;
            return " ";
          }
        };
        TexParser2.prototype.GetArgument = function(_name, noneOK) {
          switch (this.GetNext()) {
            case "":
              if (!noneOK) {
                throw new TexError_js_1.default("MissingArgFor", "Missing argument for %1", this.currentCS);
              }
              return null;
            case "}":
              if (!noneOK) {
                throw new TexError_js_1.default("ExtraCloseMissingOpen", "Extra close brace or missing open brace");
              }
              return null;
            case "\\":
              this.i++;
              return "\\" + this.GetCS();
            case "{":
              var j = ++this.i, parens = 1;
              while (this.i < this.string.length) {
                switch (this.string.charAt(this.i++)) {
                  case "\\":
                    this.i++;
                    break;
                  case "{":
                    parens++;
                    break;
                  case "}":
                    if (--parens === 0) {
                      return this.string.slice(j, this.i - 1);
                    }
                    break;
                }
              }
              throw new TexError_js_1.default("MissingCloseBrace", "Missing close brace");
          }
          var c2 = this.getCodePoint();
          this.i += c2.length;
          return c2;
        };
        TexParser2.prototype.GetBrackets = function(_name, def) {
          if (this.GetNext() !== "[") {
            return def;
          }
          var j = ++this.i, parens = 0;
          while (this.i < this.string.length) {
            switch (this.string.charAt(this.i++)) {
              case "{":
                parens++;
                break;
              case "\\":
                this.i++;
                break;
              case "}":
                if (parens-- <= 0) {
                  throw new TexError_js_1.default("ExtraCloseLooking", "Extra close brace while looking for %1", "']'");
                }
                break;
              case "]":
                if (parens === 0) {
                  return this.string.slice(j, this.i - 1);
                }
                break;
            }
          }
          throw new TexError_js_1.default("MissingCloseBracket", "Could not find closing ']' for argument to %1", this.currentCS);
        };
        TexParser2.prototype.GetDelimiter = function(name2, braceOK) {
          var c2 = this.GetNext();
          this.i += c2.length;
          if (this.i <= this.string.length) {
            if (c2 === "\\") {
              c2 += this.GetCS();
            } else if (c2 === "{" && braceOK) {
              this.i--;
              c2 = this.GetArgument(name2).trim();
            }
            if (this.contains("delimiter", c2)) {
              return this.convertDelimiter(c2);
            }
          }
          throw new TexError_js_1.default("MissingOrUnrecognizedDelim", "Missing or unrecognized delimiter for %1", this.currentCS);
        };
        TexParser2.prototype.GetDimen = function(name2) {
          if (this.GetNext() === "{") {
            var dimen = this.GetArgument(name2);
            var _a2 = __read2(ParseUtil_js_1.default.matchDimen(dimen), 2), value2 = _a2[0], unit = _a2[1];
            if (value2) {
              return value2 + unit;
            }
          } else {
            var dimen = this.string.slice(this.i);
            var _b2 = __read2(ParseUtil_js_1.default.matchDimen(dimen, true), 3), value2 = _b2[0], unit = _b2[1], length_1 = _b2[2];
            if (value2) {
              this.i += length_1;
              return value2 + unit;
            }
          }
          throw new TexError_js_1.default("MissingDimOrUnits", "Missing dimension or its units for %1", this.currentCS);
        };
        TexParser2.prototype.GetUpTo = function(_name, token2) {
          while (this.nextIsSpace()) {
            this.i++;
          }
          var j = this.i;
          var parens = 0;
          while (this.i < this.string.length) {
            var k2 = this.i;
            var c2 = this.GetNext();
            this.i += c2.length;
            switch (c2) {
              case "\\":
                c2 += this.GetCS();
                break;
              case "{":
                parens++;
                break;
              case "}":
                if (parens === 0) {
                  throw new TexError_js_1.default("ExtraCloseLooking", "Extra close brace while looking for %1", token2);
                }
                parens--;
                break;
            }
            if (parens === 0 && c2 === token2) {
              return this.string.slice(j, k2);
            }
          }
          throw new TexError_js_1.default("TokenNotFoundForCommand", "Could not find %1 for %2", token2, this.currentCS);
        };
        TexParser2.prototype.ParseArg = function(name2) {
          return new TexParser2(this.GetArgument(name2), this.stack.env, this.configuration).mml();
        };
        TexParser2.prototype.ParseUpTo = function(name2, token2) {
          return new TexParser2(this.GetUpTo(name2, token2), this.stack.env, this.configuration).mml();
        };
        TexParser2.prototype.GetDelimiterArg = function(name2) {
          var c2 = ParseUtil_js_1.default.trimSpaces(this.GetArgument(name2));
          if (c2 === "") {
            return null;
          }
          if (this.contains("delimiter", c2)) {
            return c2;
          }
          throw new TexError_js_1.default("MissingOrUnrecognizedDelim", "Missing or unrecognized delimiter for %1", this.currentCS);
        };
        TexParser2.prototype.GetStar = function() {
          var star2 = this.GetNext() === "*";
          if (star2) {
            this.i++;
          }
          return star2;
        };
        TexParser2.prototype.create = function(kind) {
          var _a2;
          var rest = [];
          for (var _i = 1; _i < arguments.length; _i++) {
            rest[_i - 1] = arguments[_i];
          }
          return (_a2 = this.configuration.nodeFactory).create.apply(_a2, __spreadArray2([kind], __read2(rest), false));
        };
        return TexParser2;
      })();
      TexParser.default = TexParser$1;
      return TexParser;
    }
    var ParseOptions = {};
    var StackItemFactory = {};
    var StackItem = {};
    var hasRequiredStackItem;
    function requireStackItem() {
      if (hasRequiredStackItem) return StackItem;
      hasRequiredStackItem = 1;
      var __extends2 = StackItem && StackItem.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      var __read2 = StackItem && StackItem.__read || function(o, n) {
        var m = typeof Symbol === "function" && o[Symbol.iterator];
        if (!m) return o;
        var i2 = m.call(o), r2, ar2 = [], e;
        try {
          while ((n === void 0 || n-- > 0) && !(r2 = i2.next()).done) ar2.push(r2.value);
        } catch (error2) {
          e = { error: error2 };
        } finally {
          try {
            if (r2 && !r2.done && (m = i2["return"])) m.call(i2);
          } finally {
            if (e) throw e.error;
          }
        }
        return ar2;
      };
      var __spreadArray2 = StackItem && StackItem.__spreadArray || function(to2, from, pack) {
        if (pack || arguments.length === 2) for (var i2 = 0, l = from.length, ar2; i2 < l; i2++) {
          if (ar2 || !(i2 in from)) {
            if (!ar2) ar2 = Array.prototype.slice.call(from, 0, i2);
            ar2[i2] = from[i2];
          }
        }
        return to2.concat(ar2 || Array.prototype.slice.call(from));
      };
      var __values2 = StackItem && StackItem.__values || function(o) {
        var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i2 = 0;
        if (m) return m.call(o);
        if (o && typeof o.length === "number") return {
          next: function() {
            if (o && i2 >= o.length) o = void 0;
            return { value: o && o[i2++], done: !o };
          }
        };
        throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
      };
      var __importDefault2 = StackItem && StackItem.__importDefault || function(mod2) {
        return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
      };
      Object.defineProperty(StackItem, "__esModule", { value: true });
      StackItem.BaseItem = StackItem.MmlStack = void 0;
      var TexError_js_1 = __importDefault2(requireTexError());
      var MmlStack = (function() {
        function MmlStack2(_nodes) {
          this._nodes = _nodes;
        }
        Object.defineProperty(MmlStack2.prototype, "nodes", {
          get: function() {
            return this._nodes;
          },
          enumerable: false,
          configurable: true
        });
        MmlStack2.prototype.Push = function() {
          var _a2;
          var nodes = [];
          for (var _i = 0; _i < arguments.length; _i++) {
            nodes[_i] = arguments[_i];
          }
          (_a2 = this._nodes).push.apply(_a2, __spreadArray2([], __read2(nodes), false));
        };
        MmlStack2.prototype.Pop = function() {
          return this._nodes.pop();
        };
        Object.defineProperty(MmlStack2.prototype, "First", {
          get: function() {
            return this._nodes[this.Size() - 1];
          },
          set: function(node2) {
            this._nodes[this.Size() - 1] = node2;
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(MmlStack2.prototype, "Last", {
          get: function() {
            return this._nodes[0];
          },
          set: function(node2) {
            this._nodes[0] = node2;
          },
          enumerable: false,
          configurable: true
        });
        MmlStack2.prototype.Peek = function(n) {
          if (n == null) {
            n = 1;
          }
          return this._nodes.slice(this.Size() - n);
        };
        MmlStack2.prototype.Size = function() {
          return this._nodes.length;
        };
        MmlStack2.prototype.Clear = function() {
          this._nodes = [];
        };
        MmlStack2.prototype.toMml = function(inferred, forceRow) {
          if (inferred === void 0) {
            inferred = true;
          }
          if (this._nodes.length === 1 && !forceRow) {
            return this.First;
          }
          return this.create("node", inferred ? "inferredMrow" : "mrow", this._nodes, {});
        };
        MmlStack2.prototype.create = function(kind) {
          var _a2;
          var rest = [];
          for (var _i = 1; _i < arguments.length; _i++) {
            rest[_i - 1] = arguments[_i];
          }
          return (_a2 = this.factory.configuration.nodeFactory).create.apply(_a2, __spreadArray2([kind], __read2(rest), false));
        };
        return MmlStack2;
      })();
      StackItem.MmlStack = MmlStack;
      var BaseItem = (function(_super) {
        __extends2(BaseItem2, _super);
        function BaseItem2(factory) {
          var nodes = [];
          for (var _i = 1; _i < arguments.length; _i++) {
            nodes[_i - 1] = arguments[_i];
          }
          var _this = _super.call(this, nodes) || this;
          _this.factory = factory;
          _this.global = {};
          _this._properties = {};
          if (_this.isOpen) {
            _this._env = {};
          }
          return _this;
        }
        Object.defineProperty(BaseItem2.prototype, "kind", {
          get: function() {
            return "base";
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(BaseItem2.prototype, "env", {
          get: function() {
            return this._env;
          },
          set: function(value2) {
            this._env = value2;
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(BaseItem2.prototype, "copyEnv", {
          get: function() {
            return true;
          },
          enumerable: false,
          configurable: true
        });
        BaseItem2.prototype.getProperty = function(key2) {
          return this._properties[key2];
        };
        BaseItem2.prototype.setProperty = function(key2, value2) {
          this._properties[key2] = value2;
          return this;
        };
        Object.defineProperty(BaseItem2.prototype, "isOpen", {
          get: function() {
            return false;
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(BaseItem2.prototype, "isClose", {
          get: function() {
            return false;
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(BaseItem2.prototype, "isFinal", {
          get: function() {
            return false;
          },
          enumerable: false,
          configurable: true
        });
        BaseItem2.prototype.isKind = function(kind) {
          return kind === this.kind;
        };
        BaseItem2.prototype.checkItem = function(item2) {
          if (item2.isKind("over") && this.isOpen) {
            item2.setProperty("num", this.toMml(false));
            this.Clear();
          }
          if (item2.isKind("cell") && this.isOpen) {
            if (item2.getProperty("linebreak")) {
              return BaseItem2.fail;
            }
            throw new TexError_js_1.default("Misplaced", "Misplaced %1", item2.getName());
          }
          if (item2.isClose && this.getErrors(item2.kind)) {
            var _a2 = __read2(this.getErrors(item2.kind), 2), id = _a2[0], message2 = _a2[1];
            throw new TexError_js_1.default(id, message2, item2.getName());
          }
          if (!item2.isFinal) {
            return BaseItem2.success;
          }
          this.Push(item2.First);
          return BaseItem2.fail;
        };
        BaseItem2.prototype.clearEnv = function() {
          var e_1, _a2;
          try {
            for (var _b2 = __values2(Object.keys(this.env)), _c = _b2.next(); !_c.done; _c = _b2.next()) {
              var id = _c.value;
              delete this.env[id];
            }
          } catch (e_1_1) {
            e_1 = { error: e_1_1 };
          } finally {
            try {
              if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
            } finally {
              if (e_1) throw e_1.error;
            }
          }
        };
        BaseItem2.prototype.setProperties = function(def) {
          Object.assign(this._properties, def);
          return this;
        };
        BaseItem2.prototype.getName = function() {
          return this.getProperty("name");
        };
        BaseItem2.prototype.toString = function() {
          return this.kind + "[" + this.nodes.join("; ") + "]";
        };
        BaseItem2.prototype.getErrors = function(kind) {
          var CLASS = this.constructor;
          return (CLASS.errors || {})[kind] || BaseItem2.errors[kind];
        };
        BaseItem2.fail = [null, false];
        BaseItem2.success = [null, true];
        BaseItem2.errors = {
          end: ["MissingBeginExtraEnd", "Missing \\begin{%1} or extra \\end{%1}"],
          close: ["ExtraCloseMissingOpen", "Extra close brace or missing open brace"],
          right: ["MissingLeftExtraRight", "Missing \\left or extra \\right"],
          middle: ["ExtraMiddle", "Extra \\middle"]
        };
        return BaseItem2;
      })(MmlStack);
      StackItem.BaseItem = BaseItem;
      return StackItem;
    }
    var Factory = {};
    var hasRequiredFactory;
    function requireFactory() {
      if (hasRequiredFactory) return Factory;
      hasRequiredFactory = 1;
      var __values2 = Factory && Factory.__values || function(o) {
        var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i2 = 0;
        if (m) return m.call(o);
        if (o && typeof o.length === "number") return {
          next: function() {
            if (o && i2 >= o.length) o = void 0;
            return { value: o && o[i2++], done: !o };
          }
        };
        throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
      };
      var __read2 = Factory && Factory.__read || function(o, n) {
        var m = typeof Symbol === "function" && o[Symbol.iterator];
        if (!m) return o;
        var i2 = m.call(o), r2, ar2 = [], e;
        try {
          while ((n === void 0 || n-- > 0) && !(r2 = i2.next()).done) ar2.push(r2.value);
        } catch (error2) {
          e = { error: error2 };
        } finally {
          try {
            if (r2 && !r2.done && (m = i2["return"])) m.call(i2);
          } finally {
            if (e) throw e.error;
          }
        }
        return ar2;
      };
      var __spreadArray2 = Factory && Factory.__spreadArray || function(to2, from, pack) {
        if (pack || arguments.length === 2) for (var i2 = 0, l = from.length, ar2; i2 < l; i2++) {
          if (ar2 || !(i2 in from)) {
            if (!ar2) ar2 = Array.prototype.slice.call(from, 0, i2);
            ar2[i2] = from[i2];
          }
        }
        return to2.concat(ar2 || Array.prototype.slice.call(from));
      };
      Object.defineProperty(Factory, "__esModule", { value: true });
      Factory.AbstractFactory = void 0;
      var AbstractFactory = (function() {
        function AbstractFactory2(nodes) {
          var e_1, _a2;
          if (nodes === void 0) {
            nodes = null;
          }
          this.defaultKind = "unknown";
          this.nodeMap = /* @__PURE__ */ new Map();
          this.node = {};
          if (nodes === null) {
            nodes = this.constructor.defaultNodes;
          }
          try {
            for (var _b2 = __values2(Object.keys(nodes)), _c = _b2.next(); !_c.done; _c = _b2.next()) {
              var kind = _c.value;
              this.setNodeClass(kind, nodes[kind]);
            }
          } catch (e_1_1) {
            e_1 = { error: e_1_1 };
          } finally {
            try {
              if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
            } finally {
              if (e_1) throw e_1.error;
            }
          }
        }
        AbstractFactory2.prototype.create = function(kind) {
          var args2 = [];
          for (var _i = 1; _i < arguments.length; _i++) {
            args2[_i - 1] = arguments[_i];
          }
          return (this.node[kind] || this.node[this.defaultKind]).apply(void 0, __spreadArray2([], __read2(args2), false));
        };
        AbstractFactory2.prototype.setNodeClass = function(kind, nodeClass) {
          this.nodeMap.set(kind, nodeClass);
          var THIS = this;
          var KIND = this.nodeMap.get(kind);
          this.node[kind] = function() {
            var args2 = [];
            for (var _i = 0; _i < arguments.length; _i++) {
              args2[_i] = arguments[_i];
            }
            return new (KIND.bind.apply(KIND, __spreadArray2([void 0, THIS], __read2(args2), false)))();
          };
        };
        AbstractFactory2.prototype.getNodeClass = function(kind) {
          return this.nodeMap.get(kind);
        };
        AbstractFactory2.prototype.deleteNodeClass = function(kind) {
          this.nodeMap.delete(kind);
          delete this.node[kind];
        };
        AbstractFactory2.prototype.nodeIsKind = function(node2, kind) {
          return node2 instanceof this.getNodeClass(kind);
        };
        AbstractFactory2.prototype.getKinds = function() {
          return Array.from(this.nodeMap.keys());
        };
        AbstractFactory2.defaultNodes = {};
        return AbstractFactory2;
      })();
      Factory.AbstractFactory = AbstractFactory;
      return Factory;
    }
    var hasRequiredStackItemFactory;
    function requireStackItemFactory() {
      if (hasRequiredStackItemFactory) return StackItemFactory;
      hasRequiredStackItemFactory = 1;
      var __extends2 = StackItemFactory && StackItemFactory.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      var _a2;
      Object.defineProperty(StackItemFactory, "__esModule", { value: true });
      var StackItem_js_1 = requireStackItem();
      var Factory_js_1 = requireFactory();
      var DummyItem = (function(_super) {
        __extends2(DummyItem2, _super);
        function DummyItem2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        return DummyItem2;
      })(StackItem_js_1.BaseItem);
      var StackItemFactory$1 = (function(_super) {
        __extends2(StackItemFactory2, _super);
        function StackItemFactory2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.defaultKind = "dummy";
          _this.configuration = null;
          return _this;
        }
        StackItemFactory2.DefaultStackItems = (_a2 = {}, _a2[DummyItem.prototype.kind] = DummyItem, _a2);
        return StackItemFactory2;
      })(Factory_js_1.AbstractFactory);
      StackItemFactory.default = StackItemFactory$1;
      return StackItemFactory;
    }
    var NodeFactory$1 = {};
    var hasRequiredNodeFactory$1;
    function requireNodeFactory$1() {
      if (hasRequiredNodeFactory$1) return NodeFactory$1;
      hasRequiredNodeFactory$1 = 1;
      var __read2 = NodeFactory$1 && NodeFactory$1.__read || function(o, n) {
        var m = typeof Symbol === "function" && o[Symbol.iterator];
        if (!m) return o;
        var i2 = m.call(o), r2, ar2 = [], e;
        try {
          while ((n === void 0 || n-- > 0) && !(r2 = i2.next()).done) ar2.push(r2.value);
        } catch (error2) {
          e = { error: error2 };
        } finally {
          try {
            if (r2 && !r2.done && (m = i2["return"])) m.call(i2);
          } finally {
            if (e) throw e.error;
          }
        }
        return ar2;
      };
      var __spreadArray2 = NodeFactory$1 && NodeFactory$1.__spreadArray || function(to2, from, pack) {
        if (pack || arguments.length === 2) for (var i2 = 0, l = from.length, ar2; i2 < l; i2++) {
          if (ar2 || !(i2 in from)) {
            if (!ar2) ar2 = Array.prototype.slice.call(from, 0, i2);
            ar2[i2] = from[i2];
          }
        }
        return to2.concat(ar2 || Array.prototype.slice.call(from));
      };
      var __importDefault2 = NodeFactory$1 && NodeFactory$1.__importDefault || function(mod2) {
        return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
      };
      Object.defineProperty(NodeFactory$1, "__esModule", { value: true });
      NodeFactory$1.NodeFactory = void 0;
      var NodeUtil_js_1 = __importDefault2(requireNodeUtil());
      var NodeFactory2 = (function() {
        function NodeFactory3() {
          this.mmlFactory = null;
          this.factory = {
            "node": NodeFactory3.createNode,
            "token": NodeFactory3.createToken,
            "text": NodeFactory3.createText,
            "error": NodeFactory3.createError
          };
        }
        NodeFactory3.createNode = function(factory, kind, children2, def, text2) {
          if (children2 === void 0) {
            children2 = [];
          }
          if (def === void 0) {
            def = {};
          }
          var node2 = factory.mmlFactory.create(kind);
          node2.setChildren(children2);
          if (text2) {
            node2.appendChild(text2);
          }
          NodeUtil_js_1.default.setProperties(node2, def);
          return node2;
        };
        NodeFactory3.createToken = function(factory, kind, def, text2) {
          if (def === void 0) {
            def = {};
          }
          if (text2 === void 0) {
            text2 = "";
          }
          var textNode = factory.create("text", text2);
          return factory.create("node", kind, [], def, textNode);
        };
        NodeFactory3.createText = function(factory, text2) {
          if (text2 == null) {
            return null;
          }
          return factory.mmlFactory.create("text").setText(text2);
        };
        NodeFactory3.createError = function(factory, message2) {
          var text2 = factory.create("text", message2);
          var mtext2 = factory.create("node", "mtext", [], {}, text2);
          var error2 = factory.create("node", "merror", [mtext2], { "data-mjx-error": message2 });
          return error2;
        };
        NodeFactory3.prototype.setMmlFactory = function(mmlFactory) {
          this.mmlFactory = mmlFactory;
        };
        NodeFactory3.prototype.set = function(kind, func) {
          this.factory[kind] = func;
        };
        NodeFactory3.prototype.setCreators = function(maps) {
          for (var kind in maps) {
            this.set(kind, maps[kind]);
          }
        };
        NodeFactory3.prototype.create = function(kind) {
          var rest = [];
          for (var _i = 1; _i < arguments.length; _i++) {
            rest[_i - 1] = arguments[_i];
          }
          var func = this.factory[kind] || this.factory["node"];
          var node2 = func.apply(void 0, __spreadArray2([this, rest[0]], __read2(rest.slice(1)), false));
          if (kind === "node") {
            this.configuration.addNode(rest[0], node2);
          }
          return node2;
        };
        NodeFactory3.prototype.get = function(kind) {
          return this.factory[kind];
        };
        return NodeFactory3;
      })();
      NodeFactory$1.NodeFactory = NodeFactory2;
      return NodeFactory$1;
    }
    var hasRequiredParseOptions;
    function requireParseOptions() {
      if (hasRequiredParseOptions) return ParseOptions;
      hasRequiredParseOptions = 1;
      var __read2 = ParseOptions && ParseOptions.__read || function(o, n) {
        var m = typeof Symbol === "function" && o[Symbol.iterator];
        if (!m) return o;
        var i2 = m.call(o), r2, ar2 = [], e;
        try {
          while ((n === void 0 || n-- > 0) && !(r2 = i2.next()).done) ar2.push(r2.value);
        } catch (error2) {
          e = { error: error2 };
        } finally {
          try {
            if (r2 && !r2.done && (m = i2["return"])) m.call(i2);
          } finally {
            if (e) throw e.error;
          }
        }
        return ar2;
      };
      var __spreadArray2 = ParseOptions && ParseOptions.__spreadArray || function(to2, from, pack) {
        if (pack || arguments.length === 2) for (var i2 = 0, l = from.length, ar2; i2 < l; i2++) {
          if (ar2 || !(i2 in from)) {
            if (!ar2) ar2 = Array.prototype.slice.call(from, 0, i2);
            ar2[i2] = from[i2];
          }
        }
        return to2.concat(ar2 || Array.prototype.slice.call(from));
      };
      var __values2 = ParseOptions && ParseOptions.__values || function(o) {
        var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i2 = 0;
        if (m) return m.call(o);
        if (o && typeof o.length === "number") return {
          next: function() {
            if (o && i2 >= o.length) o = void 0;
            return { value: o && o[i2++], done: !o };
          }
        };
        throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
      };
      var __importDefault2 = ParseOptions && ParseOptions.__importDefault || function(mod2) {
        return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
      };
      Object.defineProperty(ParseOptions, "__esModule", { value: true });
      var StackItemFactory_js_1 = __importDefault2(requireStackItemFactory());
      var NodeFactory_js_1 = requireNodeFactory$1();
      var NodeUtil_js_1 = __importDefault2(requireNodeUtil());
      var Options_js_1 = requireOptions$1();
      var ParseOptions$1 = (function() {
        function ParseOptions2(configuration, options2) {
          if (options2 === void 0) {
            options2 = [];
          }
          this.options = {};
          this.packageData = /* @__PURE__ */ new Map();
          this.parsers = [];
          this.root = null;
          this.nodeLists = {};
          this.error = false;
          this.handlers = configuration.handlers;
          this.nodeFactory = new NodeFactory_js_1.NodeFactory();
          this.nodeFactory.configuration = this;
          this.nodeFactory.setCreators(configuration.nodes);
          this.itemFactory = new StackItemFactory_js_1.default(configuration.items);
          this.itemFactory.configuration = this;
          Options_js_1.defaultOptions.apply(void 0, __spreadArray2([this.options], __read2(options2), false));
          (0, Options_js_1.defaultOptions)(this.options, configuration.options);
        }
        ParseOptions2.prototype.pushParser = function(parser2) {
          this.parsers.unshift(parser2);
        };
        ParseOptions2.prototype.popParser = function() {
          this.parsers.shift();
        };
        Object.defineProperty(ParseOptions2.prototype, "parser", {
          get: function() {
            return this.parsers[0];
          },
          enumerable: false,
          configurable: true
        });
        ParseOptions2.prototype.clear = function() {
          this.parsers = [];
          this.root = null;
          this.nodeLists = {};
          this.error = false;
          this.tags.resetTag();
        };
        ParseOptions2.prototype.addNode = function(property2, node2) {
          var list2 = this.nodeLists[property2];
          if (!list2) {
            list2 = this.nodeLists[property2] = [];
          }
          list2.push(node2);
          if (node2.kind !== property2) {
            var inlists = NodeUtil_js_1.default.getProperty(node2, "in-lists") || "";
            var lists = (inlists ? inlists.split(/,/) : []).concat(property2).join(",");
            NodeUtil_js_1.default.setProperty(node2, "in-lists", lists);
          }
        };
        ParseOptions2.prototype.getList = function(property2) {
          var e_1, _a2;
          var list2 = this.nodeLists[property2] || [];
          var result2 = [];
          try {
            for (var list_1 = __values2(list2), list_1_1 = list_1.next(); !list_1_1.done; list_1_1 = list_1.next()) {
              var node2 = list_1_1.value;
              if (this.inTree(node2)) {
                result2.push(node2);
              }
            }
          } catch (e_1_1) {
            e_1 = { error: e_1_1 };
          } finally {
            try {
              if (list_1_1 && !list_1_1.done && (_a2 = list_1.return)) _a2.call(list_1);
            } finally {
              if (e_1) throw e_1.error;
            }
          }
          this.nodeLists[property2] = result2;
          return result2;
        };
        ParseOptions2.prototype.removeFromList = function(property2, nodes) {
          var e_2, _a2;
          var list2 = this.nodeLists[property2] || [];
          try {
            for (var nodes_1 = __values2(nodes), nodes_1_1 = nodes_1.next(); !nodes_1_1.done; nodes_1_1 = nodes_1.next()) {
              var node2 = nodes_1_1.value;
              var i2 = list2.indexOf(node2);
              if (i2 >= 0) {
                list2.splice(i2, 1);
              }
            }
          } catch (e_2_1) {
            e_2 = { error: e_2_1 };
          } finally {
            try {
              if (nodes_1_1 && !nodes_1_1.done && (_a2 = nodes_1.return)) _a2.call(nodes_1);
            } finally {
              if (e_2) throw e_2.error;
            }
          }
        };
        ParseOptions2.prototype.inTree = function(node2) {
          while (node2 && node2 !== this.root) {
            node2 = node2.parent;
          }
          return !!node2;
        };
        return ParseOptions2;
      })();
      ParseOptions.default = ParseOptions$1;
      return ParseOptions;
    }
    var Tags = {};
    var hasRequiredTags;
    function requireTags() {
      if (hasRequiredTags) return Tags;
      hasRequiredTags = 1;
      (function(exports2) {
        var __extends2 = Tags && Tags.__extends || /* @__PURE__ */ (function() {
          var extendStatics2 = function(d, b) {
            extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
              d2.__proto__ = b2;
            } || function(d2, b2) {
              for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
            };
            return extendStatics2(d, b);
          };
          return function(d, b) {
            if (typeof b !== "function" && b !== null)
              throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
            extendStatics2(d, b);
            function __() {
              this.constructor = d;
            }
            d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
          };
        })();
        var __values2 = Tags && Tags.__values || function(o) {
          var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i2 = 0;
          if (m) return m.call(o);
          if (o && typeof o.length === "number") return {
            next: function() {
              if (o && i2 >= o.length) o = void 0;
              return { value: o && o[i2++], done: !o };
            }
          };
          throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
        };
        var __importDefault2 = Tags && Tags.__importDefault || function(mod2) {
          return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
        };
        Object.defineProperty(exports2, "__esModule", { value: true });
        exports2.TagsFactory = exports2.AllTags = exports2.NoTags = exports2.AbstractTags = exports2.TagInfo = exports2.Label = void 0;
        var TexParser_js_1 = __importDefault2(requireTexParser());
        var Label = /* @__PURE__ */ (function() {
          function Label2(tag, id) {
            if (tag === void 0) {
              tag = "???";
            }
            if (id === void 0) {
              id = "";
            }
            this.tag = tag;
            this.id = id;
          }
          return Label2;
        })();
        exports2.Label = Label;
        var TagInfo = /* @__PURE__ */ (function() {
          function TagInfo2(env, taggable, defaultTags, tag, tagId, tagFormat, noTag, labelId) {
            if (env === void 0) {
              env = "";
            }
            if (taggable === void 0) {
              taggable = false;
            }
            if (defaultTags === void 0) {
              defaultTags = false;
            }
            if (tag === void 0) {
              tag = null;
            }
            if (tagId === void 0) {
              tagId = "";
            }
            if (tagFormat === void 0) {
              tagFormat = "";
            }
            if (noTag === void 0) {
              noTag = false;
            }
            if (labelId === void 0) {
              labelId = "";
            }
            this.env = env;
            this.taggable = taggable;
            this.defaultTags = defaultTags;
            this.tag = tag;
            this.tagId = tagId;
            this.tagFormat = tagFormat;
            this.noTag = noTag;
            this.labelId = labelId;
          }
          return TagInfo2;
        })();
        exports2.TagInfo = TagInfo;
        var AbstractTags = (function() {
          function AbstractTags2() {
            this.counter = 0;
            this.allCounter = 0;
            this.configuration = null;
            this.ids = {};
            this.allIds = {};
            this.labels = {};
            this.allLabels = {};
            this.redo = false;
            this.refUpdate = false;
            this.currentTag = new TagInfo();
            this.history = [];
            this.stack = [];
            this.enTag = function(node2, tag) {
              var nf = this.configuration.nodeFactory;
              var cell2 = nf.create("node", "mtd", [node2]);
              var row2 = nf.create("node", "mlabeledtr", [tag, cell2]);
              var table2 = nf.create("node", "mtable", [row2], {
                side: this.configuration.options["tagSide"],
                minlabelspacing: this.configuration.options["tagIndent"],
                displaystyle: true
              });
              return table2;
            };
          }
          AbstractTags2.prototype.start = function(env, taggable, defaultTags) {
            if (this.currentTag) {
              this.stack.push(this.currentTag);
            }
            this.currentTag = new TagInfo(env, taggable, defaultTags);
          };
          Object.defineProperty(AbstractTags2.prototype, "env", {
            get: function() {
              return this.currentTag.env;
            },
            enumerable: false,
            configurable: true
          });
          AbstractTags2.prototype.end = function() {
            this.history.push(this.currentTag);
            this.currentTag = this.stack.pop();
          };
          AbstractTags2.prototype.tag = function(tag, noFormat) {
            this.currentTag.tag = tag;
            this.currentTag.tagFormat = noFormat ? tag : this.formatTag(tag);
            this.currentTag.noTag = false;
          };
          AbstractTags2.prototype.notag = function() {
            this.tag("", true);
            this.currentTag.noTag = true;
          };
          Object.defineProperty(AbstractTags2.prototype, "noTag", {
            get: function() {
              return this.currentTag.noTag;
            },
            enumerable: false,
            configurable: true
          });
          Object.defineProperty(AbstractTags2.prototype, "label", {
            get: function() {
              return this.currentTag.labelId;
            },
            set: function(label2) {
              this.currentTag.labelId = label2;
            },
            enumerable: false,
            configurable: true
          });
          AbstractTags2.prototype.formatUrl = function(id, base2) {
            return base2 + "#" + encodeURIComponent(id);
          };
          AbstractTags2.prototype.formatTag = function(tag) {
            return "(" + tag + ")";
          };
          AbstractTags2.prototype.formatId = function(id) {
            return "mjx-eqn:" + id.replace(/\s/g, "_");
          };
          AbstractTags2.prototype.formatNumber = function(n) {
            return n.toString();
          };
          AbstractTags2.prototype.autoTag = function() {
            if (this.currentTag.tag == null) {
              this.counter++;
              this.tag(this.formatNumber(this.counter), false);
            }
          };
          AbstractTags2.prototype.clearTag = function() {
            this.label = "";
            this.tag(null, true);
            this.currentTag.tagId = "";
          };
          AbstractTags2.prototype.getTag = function(force) {
            if (force === void 0) {
              force = false;
            }
            if (force) {
              this.autoTag();
              return this.makeTag();
            }
            var ct = this.currentTag;
            if (ct.taggable && !ct.noTag) {
              if (ct.defaultTags) {
                this.autoTag();
              }
              if (ct.tag) {
                return this.makeTag();
              }
            }
            return null;
          };
          AbstractTags2.prototype.resetTag = function() {
            this.history = [];
            this.redo = false;
            this.refUpdate = false;
            this.clearTag();
          };
          AbstractTags2.prototype.reset = function(offset2) {
            if (offset2 === void 0) {
              offset2 = 0;
            }
            this.resetTag();
            this.counter = this.allCounter = offset2;
            this.allLabels = {};
            this.allIds = {};
          };
          AbstractTags2.prototype.startEquation = function(math2) {
            this.history = [];
            this.stack = [];
            this.clearTag();
            this.currentTag = new TagInfo("", void 0, void 0);
            this.labels = {};
            this.ids = {};
            this.counter = this.allCounter;
            this.redo = false;
            var recompile = math2.inputData.recompile;
            if (recompile) {
              this.refUpdate = true;
              this.counter = recompile.counter;
            }
          };
          AbstractTags2.prototype.finishEquation = function(math2) {
            if (this.redo) {
              math2.inputData.recompile = {
                state: math2.state(),
                counter: this.allCounter
              };
            }
            if (!this.refUpdate) {
              this.allCounter = this.counter;
            }
            Object.assign(this.allIds, this.ids);
            Object.assign(this.allLabels, this.labels);
          };
          AbstractTags2.prototype.finalize = function(node2, env) {
            if (!env.display || this.currentTag.env || this.currentTag.tag == null) {
              return node2;
            }
            var tag = this.makeTag();
            var table2 = this.enTag(node2, tag);
            return table2;
          };
          AbstractTags2.prototype.makeId = function() {
            this.currentTag.tagId = this.formatId(this.configuration.options["useLabelIds"] ? this.label || this.currentTag.tag : this.currentTag.tag);
          };
          AbstractTags2.prototype.makeTag = function() {
            this.makeId();
            if (this.label) {
              this.labels[this.label] = new Label(this.currentTag.tag, this.currentTag.tagId);
            }
            var mml = new TexParser_js_1.default("\\text{" + this.currentTag.tagFormat + "}", {}, this.configuration).mml();
            return this.configuration.nodeFactory.create("node", "mtd", [mml], { id: this.currentTag.tagId });
          };
          return AbstractTags2;
        })();
        exports2.AbstractTags = AbstractTags;
        var NoTags = (function(_super) {
          __extends2(NoTags2, _super);
          function NoTags2() {
            return _super !== null && _super.apply(this, arguments) || this;
          }
          NoTags2.prototype.autoTag = function() {
          };
          NoTags2.prototype.getTag = function() {
            return !this.currentTag.tag ? null : _super.prototype.getTag.call(this);
          };
          return NoTags2;
        })(AbstractTags);
        exports2.NoTags = NoTags;
        var AllTags = (function(_super) {
          __extends2(AllTags2, _super);
          function AllTags2() {
            return _super !== null && _super.apply(this, arguments) || this;
          }
          AllTags2.prototype.finalize = function(node2, env) {
            if (!env.display || this.history.find(function(x2) {
              return x2.taggable;
            })) {
              return node2;
            }
            var tag = this.getTag(true);
            return this.enTag(node2, tag);
          };
          return AllTags2;
        })(AbstractTags);
        exports2.AllTags = AllTags;
        (function(TagsFactory) {
          var tagsMapping = /* @__PURE__ */ new Map([
            ["none", NoTags],
            ["all", AllTags]
          ]);
          var defaultTags = "none";
          TagsFactory.OPTIONS = {
            tags: defaultTags,
            tagSide: "right",
            tagIndent: "0.8em",
            useLabelIds: true,
            ignoreDuplicateLabels: false
          };
          TagsFactory.add = function(name2, constr) {
            tagsMapping.set(name2, constr);
          };
          TagsFactory.addTags = function(tags2) {
            var e_1, _a2;
            try {
              for (var _b2 = __values2(Object.keys(tags2)), _c = _b2.next(); !_c.done; _c = _b2.next()) {
                var key2 = _c.value;
                TagsFactory.add(key2, tags2[key2]);
              }
            } catch (e_1_1) {
              e_1 = { error: e_1_1 };
            } finally {
              try {
                if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
              } finally {
                if (e_1) throw e_1.error;
              }
            }
          };
          TagsFactory.create = function(name2) {
            var constr = tagsMapping.get(name2) || tagsMapping.get(defaultTags);
            if (!constr) {
              throw Error("Unknown tags class");
            }
            return new constr();
          };
          TagsFactory.setDefault = function(name2) {
            defaultTags = name2;
          };
          TagsFactory.getDefault = function() {
            return TagsFactory.create(defaultTags);
          };
        })(exports2.TagsFactory || (exports2.TagsFactory = {}));
      })(Tags);
      return Tags;
    }
    var Configuration$1 = {};
    var MapHandler = {};
    var hasRequiredMapHandler;
    function requireMapHandler() {
      if (hasRequiredMapHandler) return MapHandler;
      hasRequiredMapHandler = 1;
      (function(exports2) {
        var __values2 = MapHandler && MapHandler.__values || function(o) {
          var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i2 = 0;
          if (m) return m.call(o);
          if (o && typeof o.length === "number") return {
            next: function() {
              if (o && i2 >= o.length) o = void 0;
              return { value: o && o[i2++], done: !o };
            }
          };
          throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
        };
        var __read2 = MapHandler && MapHandler.__read || function(o, n) {
          var m = typeof Symbol === "function" && o[Symbol.iterator];
          if (!m) return o;
          var i2 = m.call(o), r2, ar2 = [], e;
          try {
            while ((n === void 0 || n-- > 0) && !(r2 = i2.next()).done) ar2.push(r2.value);
          } catch (error2) {
            e = { error: error2 };
          } finally {
            try {
              if (r2 && !r2.done && (m = i2["return"])) m.call(i2);
            } finally {
              if (e) throw e.error;
            }
          }
          return ar2;
        };
        Object.defineProperty(exports2, "__esModule", { value: true });
        exports2.SubHandlers = exports2.SubHandler = exports2.MapHandler = void 0;
        var PrioritizedList_js_1 = requirePrioritizedList();
        var FunctionList_js_1 = requireFunctionList();
        var MapHandler$1;
        (function(MapHandler2) {
          var maps = /* @__PURE__ */ new Map();
          MapHandler2.register = function(map2) {
            maps.set(map2.name, map2);
          };
          MapHandler2.getMap = function(name2) {
            return maps.get(name2);
          };
        })(MapHandler$1 = exports2.MapHandler || (exports2.MapHandler = {}));
        var SubHandler = (function() {
          function SubHandler2() {
            this._configuration = new PrioritizedList_js_1.PrioritizedList();
            this._fallback = new FunctionList_js_1.FunctionList();
          }
          SubHandler2.prototype.add = function(maps, fallback, priority) {
            var e_1, _a2;
            if (priority === void 0) {
              priority = PrioritizedList_js_1.PrioritizedList.DEFAULTPRIORITY;
            }
            try {
              for (var _b2 = __values2(maps.slice().reverse()), _c = _b2.next(); !_c.done; _c = _b2.next()) {
                var name_1 = _c.value;
                var map2 = MapHandler$1.getMap(name_1);
                if (!map2) {
                  this.warn("Configuration " + name_1 + " not found! Omitted.");
                  return;
                }
                this._configuration.add(map2, priority);
              }
            } catch (e_1_1) {
              e_1 = { error: e_1_1 };
            } finally {
              try {
                if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
              } finally {
                if (e_1) throw e_1.error;
              }
            }
            if (fallback) {
              this._fallback.add(fallback, priority);
            }
          };
          SubHandler2.prototype.parse = function(input2) {
            var e_2, _a2;
            try {
              for (var _b2 = __values2(this._configuration), _c = _b2.next(); !_c.done; _c = _b2.next()) {
                var map2 = _c.value.item;
                var result2 = map2.parse(input2);
                if (result2) {
                  return result2;
                }
              }
            } catch (e_2_1) {
              e_2 = { error: e_2_1 };
            } finally {
              try {
                if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
              } finally {
                if (e_2) throw e_2.error;
              }
            }
            var _d = __read2(input2, 2), env = _d[0], symbol = _d[1];
            Array.from(this._fallback)[0].item(env, symbol);
          };
          SubHandler2.prototype.lookup = function(symbol) {
            var map2 = this.applicable(symbol);
            return map2 ? map2.lookup(symbol) : null;
          };
          SubHandler2.prototype.contains = function(symbol) {
            return this.applicable(symbol) ? true : false;
          };
          SubHandler2.prototype.toString = function() {
            var e_3, _a2;
            var names = [];
            try {
              for (var _b2 = __values2(this._configuration), _c = _b2.next(); !_c.done; _c = _b2.next()) {
                var map2 = _c.value.item;
                names.push(map2.name);
              }
            } catch (e_3_1) {
              e_3 = { error: e_3_1 };
            } finally {
              try {
                if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
              } finally {
                if (e_3) throw e_3.error;
              }
            }
            return names.join(", ");
          };
          SubHandler2.prototype.applicable = function(symbol) {
            var e_4, _a2;
            try {
              for (var _b2 = __values2(this._configuration), _c = _b2.next(); !_c.done; _c = _b2.next()) {
                var map2 = _c.value.item;
                if (map2.contains(symbol)) {
                  return map2;
                }
              }
            } catch (e_4_1) {
              e_4 = { error: e_4_1 };
            } finally {
              try {
                if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
              } finally {
                if (e_4) throw e_4.error;
              }
            }
            return null;
          };
          SubHandler2.prototype.retrieve = function(name2) {
            var e_5, _a2;
            try {
              for (var _b2 = __values2(this._configuration), _c = _b2.next(); !_c.done; _c = _b2.next()) {
                var map2 = _c.value.item;
                if (map2.name === name2) {
                  return map2;
                }
              }
            } catch (e_5_1) {
              e_5 = { error: e_5_1 };
            } finally {
              try {
                if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
              } finally {
                if (e_5) throw e_5.error;
              }
            }
            return null;
          };
          SubHandler2.prototype.warn = function(message2) {
            console.log("TexParser Warning: " + message2);
          };
          return SubHandler2;
        })();
        exports2.SubHandler = SubHandler;
        var SubHandlers = (function() {
          function SubHandlers2() {
            this.map = /* @__PURE__ */ new Map();
          }
          SubHandlers2.prototype.add = function(handlers2, fallbacks, priority) {
            var e_6, _a2;
            if (priority === void 0) {
              priority = PrioritizedList_js_1.PrioritizedList.DEFAULTPRIORITY;
            }
            try {
              for (var _b2 = __values2(Object.keys(handlers2)), _c = _b2.next(); !_c.done; _c = _b2.next()) {
                var key2 = _c.value;
                var name_2 = key2;
                var subHandler = this.get(name_2);
                if (!subHandler) {
                  subHandler = new SubHandler();
                  this.set(name_2, subHandler);
                }
                subHandler.add(handlers2[name_2], fallbacks[name_2], priority);
              }
            } catch (e_6_1) {
              e_6 = { error: e_6_1 };
            } finally {
              try {
                if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
              } finally {
                if (e_6) throw e_6.error;
              }
            }
          };
          SubHandlers2.prototype.set = function(name2, subHandler) {
            this.map.set(name2, subHandler);
          };
          SubHandlers2.prototype.get = function(name2) {
            return this.map.get(name2);
          };
          SubHandlers2.prototype.retrieve = function(name2) {
            var e_7, _a2;
            try {
              for (var _b2 = __values2(this.map.values()), _c = _b2.next(); !_c.done; _c = _b2.next()) {
                var handler = _c.value;
                var map2 = handler.retrieve(name2);
                if (map2) {
                  return map2;
                }
              }
            } catch (e_7_1) {
              e_7 = { error: e_7_1 };
            } finally {
              try {
                if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
              } finally {
                if (e_7) throw e_7.error;
              }
            }
            return null;
          };
          SubHandlers2.prototype.keys = function() {
            return this.map.keys();
          };
          return SubHandlers2;
        })();
        exports2.SubHandlers = SubHandlers;
      })(MapHandler);
      return MapHandler;
    }
    var hasRequiredConfiguration;
    function requireConfiguration() {
      if (hasRequiredConfiguration) return Configuration$1;
      hasRequiredConfiguration = 1;
      (function(exports2) {
        var __values2 = Configuration$1 && Configuration$1.__values || function(o) {
          var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i2 = 0;
          if (m) return m.call(o);
          if (o && typeof o.length === "number") return {
            next: function() {
              if (o && i2 >= o.length) o = void 0;
              return { value: o && o[i2++], done: !o };
            }
          };
          throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
        };
        var __read2 = Configuration$1 && Configuration$1.__read || function(o, n) {
          var m = typeof Symbol === "function" && o[Symbol.iterator];
          if (!m) return o;
          var i2 = m.call(o), r2, ar2 = [], e;
          try {
            while ((n === void 0 || n-- > 0) && !(r2 = i2.next()).done) ar2.push(r2.value);
          } catch (error2) {
            e = { error: error2 };
          } finally {
            try {
              if (r2 && !r2.done && (m = i2["return"])) m.call(i2);
            } finally {
              if (e) throw e.error;
            }
          }
          return ar2;
        };
        Object.defineProperty(exports2, "__esModule", { value: true });
        exports2.ParserConfiguration = exports2.ConfigurationHandler = exports2.Configuration = void 0;
        var Options_js_1 = requireOptions$1();
        var MapHandler_js_1 = requireMapHandler();
        var FunctionList_js_1 = requireFunctionList();
        var PrioritizedList_js_1 = requirePrioritizedList();
        var Tags_js_1 = requireTags();
        var Configuration2 = (function() {
          function Configuration3(name2, handler, fallback, items, tags2, options2, nodes, preprocessors, postprocessors, initMethod, configMethod, priority, parser2) {
            if (handler === void 0) {
              handler = {};
            }
            if (fallback === void 0) {
              fallback = {};
            }
            if (items === void 0) {
              items = {};
            }
            if (tags2 === void 0) {
              tags2 = {};
            }
            if (options2 === void 0) {
              options2 = {};
            }
            if (nodes === void 0) {
              nodes = {};
            }
            if (preprocessors === void 0) {
              preprocessors = [];
            }
            if (postprocessors === void 0) {
              postprocessors = [];
            }
            if (initMethod === void 0) {
              initMethod = null;
            }
            if (configMethod === void 0) {
              configMethod = null;
            }
            this.name = name2;
            this.handler = handler;
            this.fallback = fallback;
            this.items = items;
            this.tags = tags2;
            this.options = options2;
            this.nodes = nodes;
            this.preprocessors = preprocessors;
            this.postprocessors = postprocessors;
            this.initMethod = initMethod;
            this.configMethod = configMethod;
            this.priority = priority;
            this.parser = parser2;
            this.handler = Object.assign({ character: [], delimiter: [], macro: [], environment: [] }, handler);
          }
          Configuration3.makeProcessor = function(func, priority) {
            return Array.isArray(func) ? func : [func, priority];
          };
          Configuration3._create = function(name2, config2) {
            var _this = this;
            if (config2 === void 0) {
              config2 = {};
            }
            var priority = config2.priority || PrioritizedList_js_1.PrioritizedList.DEFAULTPRIORITY;
            var init2 = config2.init ? this.makeProcessor(config2.init, priority) : null;
            var conf = config2.config ? this.makeProcessor(config2.config, priority) : null;
            var preprocessors = (config2.preprocessors || []).map(function(pre2) {
              return _this.makeProcessor(pre2, priority);
            });
            var postprocessors = (config2.postprocessors || []).map(function(post) {
              return _this.makeProcessor(post, priority);
            });
            var parser2 = config2.parser || "tex";
            return new Configuration3(name2, config2.handler || {}, config2.fallback || {}, config2.items || {}, config2.tags || {}, config2.options || {}, config2.nodes || {}, preprocessors, postprocessors, init2, conf, priority, parser2);
          };
          Configuration3.create = function(name2, config2) {
            if (config2 === void 0) {
              config2 = {};
            }
            var configuration = Configuration3._create(name2, config2);
            ConfigurationHandler.set(name2, configuration);
            return configuration;
          };
          Configuration3.local = function(config2) {
            if (config2 === void 0) {
              config2 = {};
            }
            return Configuration3._create("", config2);
          };
          Object.defineProperty(Configuration3.prototype, "init", {
            get: function() {
              return this.initMethod ? this.initMethod[0] : null;
            },
            enumerable: false,
            configurable: true
          });
          Object.defineProperty(Configuration3.prototype, "config", {
            get: function() {
              return this.configMethod ? this.configMethod[0] : null;
            },
            enumerable: false,
            configurable: true
          });
          return Configuration3;
        })();
        exports2.Configuration = Configuration2;
        var ConfigurationHandler;
        (function(ConfigurationHandler2) {
          var maps = /* @__PURE__ */ new Map();
          ConfigurationHandler2.set = function(name2, map2) {
            maps.set(name2, map2);
          };
          ConfigurationHandler2.get = function(name2) {
            return maps.get(name2);
          };
          ConfigurationHandler2.keys = function() {
            return maps.keys();
          };
        })(ConfigurationHandler = exports2.ConfigurationHandler || (exports2.ConfigurationHandler = {}));
        var ParserConfiguration = (function() {
          function ParserConfiguration2(packages, parsers) {
            var e_1, _a2, e_2, _b2;
            if (parsers === void 0) {
              parsers = ["tex"];
            }
            this.initMethod = new FunctionList_js_1.FunctionList();
            this.configMethod = new FunctionList_js_1.FunctionList();
            this.configurations = new PrioritizedList_js_1.PrioritizedList();
            this.parsers = [];
            this.handlers = new MapHandler_js_1.SubHandlers();
            this.items = {};
            this.tags = {};
            this.options = {};
            this.nodes = {};
            this.parsers = parsers;
            try {
              for (var _c = __values2(packages.slice().reverse()), _d = _c.next(); !_d.done; _d = _c.next()) {
                var pkg = _d.value;
                this.addPackage(pkg);
              }
            } catch (e_1_1) {
              e_1 = { error: e_1_1 };
            } finally {
              try {
                if (_d && !_d.done && (_a2 = _c.return)) _a2.call(_c);
              } finally {
                if (e_1) throw e_1.error;
              }
            }
            try {
              for (var _e2 = __values2(this.configurations), _f = _e2.next(); !_f.done; _f = _e2.next()) {
                var _g = _f.value, config2 = _g.item, priority = _g.priority;
                this.append(config2, priority);
              }
            } catch (e_2_1) {
              e_2 = { error: e_2_1 };
            } finally {
              try {
                if (_f && !_f.done && (_b2 = _e2.return)) _b2.call(_e2);
              } finally {
                if (e_2) throw e_2.error;
              }
            }
          }
          ParserConfiguration2.prototype.init = function() {
            this.initMethod.execute(this);
          };
          ParserConfiguration2.prototype.config = function(jax) {
            var e_3, _a2;
            this.configMethod.execute(this, jax);
            try {
              for (var _b2 = __values2(this.configurations), _c = _b2.next(); !_c.done; _c = _b2.next()) {
                var config2 = _c.value;
                this.addFilters(jax, config2.item);
              }
            } catch (e_3_1) {
              e_3 = { error: e_3_1 };
            } finally {
              try {
                if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
              } finally {
                if (e_3) throw e_3.error;
              }
            }
          };
          ParserConfiguration2.prototype.addPackage = function(pkg) {
            var name2 = typeof pkg === "string" ? pkg : pkg[0];
            var conf = this.getPackage(name2);
            conf && this.configurations.add(conf, typeof pkg === "string" ? conf.priority : pkg[1]);
          };
          ParserConfiguration2.prototype.add = function(name2, jax, options2) {
            var e_4, _a2;
            if (options2 === void 0) {
              options2 = {};
            }
            var config2 = this.getPackage(name2);
            this.append(config2);
            this.configurations.add(config2, config2.priority);
            this.init();
            var parser2 = jax.parseOptions;
            parser2.nodeFactory.setCreators(config2.nodes);
            try {
              for (var _b2 = __values2(Object.keys(config2.items)), _c = _b2.next(); !_c.done; _c = _b2.next()) {
                var kind = _c.value;
                parser2.itemFactory.setNodeClass(kind, config2.items[kind]);
              }
            } catch (e_4_1) {
              e_4 = { error: e_4_1 };
            } finally {
              try {
                if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
              } finally {
                if (e_4) throw e_4.error;
              }
            }
            Tags_js_1.TagsFactory.addTags(config2.tags);
            (0, Options_js_1.defaultOptions)(parser2.options, config2.options);
            (0, Options_js_1.userOptions)(parser2.options, options2);
            this.addFilters(jax, config2);
            if (config2.config) {
              config2.config(this, jax);
            }
          };
          ParserConfiguration2.prototype.getPackage = function(name2) {
            var config2 = ConfigurationHandler.get(name2);
            if (config2 && this.parsers.indexOf(config2.parser) < 0) {
              throw Error("Package ".concat(name2, " doesn't target the proper parser"));
            }
            return config2;
          };
          ParserConfiguration2.prototype.append = function(config2, priority) {
            priority = priority || config2.priority;
            if (config2.initMethod) {
              this.initMethod.add(config2.initMethod[0], config2.initMethod[1]);
            }
            if (config2.configMethod) {
              this.configMethod.add(config2.configMethod[0], config2.configMethod[1]);
            }
            this.handlers.add(config2.handler, config2.fallback, priority);
            Object.assign(this.items, config2.items);
            Object.assign(this.tags, config2.tags);
            (0, Options_js_1.defaultOptions)(this.options, config2.options);
            Object.assign(this.nodes, config2.nodes);
          };
          ParserConfiguration2.prototype.addFilters = function(jax, config2) {
            var e_5, _a2, e_6, _b2;
            try {
              for (var _c = __values2(config2.preprocessors), _d = _c.next(); !_d.done; _d = _c.next()) {
                var _e2 = __read2(_d.value, 2), pre2 = _e2[0], priority = _e2[1];
                jax.preFilters.add(pre2, priority);
              }
            } catch (e_5_1) {
              e_5 = { error: e_5_1 };
            } finally {
              try {
                if (_d && !_d.done && (_a2 = _c.return)) _a2.call(_c);
              } finally {
                if (e_5) throw e_5.error;
              }
            }
            try {
              for (var _f = __values2(config2.postprocessors), _g = _f.next(); !_g.done; _g = _f.next()) {
                var _h = __read2(_g.value, 2), post = _h[0], priority = _h[1];
                jax.postFilters.add(post, priority);
              }
            } catch (e_6_1) {
              e_6 = { error: e_6_1 };
            } finally {
              try {
                if (_g && !_g.done && (_b2 = _f.return)) _b2.call(_f);
              } finally {
                if (e_6) throw e_6.error;
              }
            }
          };
          return ParserConfiguration2;
        })();
        exports2.ParserConfiguration = ParserConfiguration;
      })(Configuration$1);
      return Configuration$1;
    }
    var BaseConfiguration = {};
    var SymbolMap = {};
    var _Symbol = {};
    var hasRequired_Symbol;
    function require_Symbol() {
      if (hasRequired_Symbol) return _Symbol;
      hasRequired_Symbol = 1;
      Object.defineProperty(_Symbol, "__esModule", { value: true });
      _Symbol.Macro = _Symbol.Symbol = void 0;
      var Symbol2 = (function() {
        function Symbol3(_symbol, _char, _attributes) {
          this._symbol = _symbol;
          this._char = _char;
          this._attributes = _attributes;
        }
        Object.defineProperty(Symbol3.prototype, "symbol", {
          get: function() {
            return this._symbol;
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(Symbol3.prototype, "char", {
          get: function() {
            return this._char;
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(Symbol3.prototype, "attributes", {
          get: function() {
            return this._attributes;
          },
          enumerable: false,
          configurable: true
        });
        return Symbol3;
      })();
      _Symbol.Symbol = Symbol2;
      var Macro = (function() {
        function Macro2(_symbol, _func, _args) {
          if (_args === void 0) {
            _args = [];
          }
          this._symbol = _symbol;
          this._func = _func;
          this._args = _args;
        }
        Object.defineProperty(Macro2.prototype, "symbol", {
          get: function() {
            return this._symbol;
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(Macro2.prototype, "func", {
          get: function() {
            return this._func;
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(Macro2.prototype, "args", {
          get: function() {
            return this._args;
          },
          enumerable: false,
          configurable: true
        });
        return Macro2;
      })();
      _Symbol.Macro = Macro;
      return _Symbol;
    }
    var hasRequiredSymbolMap;
    function requireSymbolMap() {
      if (hasRequiredSymbolMap) return SymbolMap;
      hasRequiredSymbolMap = 1;
      var __extends2 = SymbolMap && SymbolMap.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      var __read2 = SymbolMap && SymbolMap.__read || function(o, n) {
        var m = typeof Symbol === "function" && o[Symbol.iterator];
        if (!m) return o;
        var i2 = m.call(o), r2, ar2 = [], e;
        try {
          while ((n === void 0 || n-- > 0) && !(r2 = i2.next()).done) ar2.push(r2.value);
        } catch (error2) {
          e = { error: error2 };
        } finally {
          try {
            if (r2 && !r2.done && (m = i2["return"])) m.call(i2);
          } finally {
            if (e) throw e.error;
          }
        }
        return ar2;
      };
      var __values2 = SymbolMap && SymbolMap.__values || function(o) {
        var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i2 = 0;
        if (m) return m.call(o);
        if (o && typeof o.length === "number") return {
          next: function() {
            if (o && i2 >= o.length) o = void 0;
            return { value: o && o[i2++], done: !o };
          }
        };
        throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
      };
      var __spreadArray2 = SymbolMap && SymbolMap.__spreadArray || function(to2, from, pack) {
        if (pack || arguments.length === 2) for (var i2 = 0, l = from.length, ar2; i2 < l; i2++) {
          if (ar2 || !(i2 in from)) {
            if (!ar2) ar2 = Array.prototype.slice.call(from, 0, i2);
            ar2[i2] = from[i2];
          }
        }
        return to2.concat(ar2 || Array.prototype.slice.call(from));
      };
      Object.defineProperty(SymbolMap, "__esModule", { value: true });
      SymbolMap.EnvironmentMap = SymbolMap.CommandMap = SymbolMap.MacroMap = SymbolMap.DelimiterMap = SymbolMap.CharacterMap = SymbolMap.AbstractParseMap = SymbolMap.RegExpMap = SymbolMap.AbstractSymbolMap = SymbolMap.parseResult = void 0;
      var Symbol_js_1 = require_Symbol();
      var MapHandler_js_1 = requireMapHandler();
      function parseResult(result2) {
        return result2 === void 0 ? true : result2;
      }
      SymbolMap.parseResult = parseResult;
      var AbstractSymbolMap = (function() {
        function AbstractSymbolMap2(_name, _parser2) {
          this._name = _name;
          this._parser = _parser2;
          MapHandler_js_1.MapHandler.register(this);
        }
        Object.defineProperty(AbstractSymbolMap2.prototype, "name", {
          get: function() {
            return this._name;
          },
          enumerable: false,
          configurable: true
        });
        AbstractSymbolMap2.prototype.parserFor = function(symbol) {
          return this.contains(symbol) ? this.parser : null;
        };
        AbstractSymbolMap2.prototype.parse = function(_a2) {
          var _b2 = __read2(_a2, 2), env = _b2[0], symbol = _b2[1];
          var parser2 = this.parserFor(symbol);
          var mapped = this.lookup(symbol);
          return parser2 && mapped ? parseResult(parser2(env, mapped)) : null;
        };
        Object.defineProperty(AbstractSymbolMap2.prototype, "parser", {
          get: function() {
            return this._parser;
          },
          set: function(parser2) {
            this._parser = parser2;
          },
          enumerable: false,
          configurable: true
        });
        return AbstractSymbolMap2;
      })();
      SymbolMap.AbstractSymbolMap = AbstractSymbolMap;
      var RegExpMap = (function(_super) {
        __extends2(RegExpMap2, _super);
        function RegExpMap2(name2, parser2, _regExp) {
          var _this = _super.call(this, name2, parser2) || this;
          _this._regExp = _regExp;
          return _this;
        }
        RegExpMap2.prototype.contains = function(symbol) {
          return this._regExp.test(symbol);
        };
        RegExpMap2.prototype.lookup = function(symbol) {
          return this.contains(symbol) ? symbol : null;
        };
        return RegExpMap2;
      })(AbstractSymbolMap);
      SymbolMap.RegExpMap = RegExpMap;
      var AbstractParseMap = (function(_super) {
        __extends2(AbstractParseMap2, _super);
        function AbstractParseMap2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.map = /* @__PURE__ */ new Map();
          return _this;
        }
        AbstractParseMap2.prototype.lookup = function(symbol) {
          return this.map.get(symbol);
        };
        AbstractParseMap2.prototype.contains = function(symbol) {
          return this.map.has(symbol);
        };
        AbstractParseMap2.prototype.add = function(symbol, object) {
          this.map.set(symbol, object);
        };
        AbstractParseMap2.prototype.remove = function(symbol) {
          this.map.delete(symbol);
        };
        return AbstractParseMap2;
      })(AbstractSymbolMap);
      SymbolMap.AbstractParseMap = AbstractParseMap;
      var CharacterMap = (function(_super) {
        __extends2(CharacterMap2, _super);
        function CharacterMap2(name2, parser2, json) {
          var e_1, _a2;
          var _this = _super.call(this, name2, parser2) || this;
          try {
            for (var _b2 = __values2(Object.keys(json)), _c = _b2.next(); !_c.done; _c = _b2.next()) {
              var key2 = _c.value;
              var value2 = json[key2];
              var _d = __read2(typeof value2 === "string" ? [value2, null] : value2, 2), char = _d[0], attrs = _d[1];
              var character = new Symbol_js_1.Symbol(key2, char, attrs);
              _this.add(key2, character);
            }
          } catch (e_1_1) {
            e_1 = { error: e_1_1 };
          } finally {
            try {
              if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
            } finally {
              if (e_1) throw e_1.error;
            }
          }
          return _this;
        }
        return CharacterMap2;
      })(AbstractParseMap);
      SymbolMap.CharacterMap = CharacterMap;
      var DelimiterMap = (function(_super) {
        __extends2(DelimiterMap2, _super);
        function DelimiterMap2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        DelimiterMap2.prototype.parse = function(_a2) {
          var _b2 = __read2(_a2, 2), env = _b2[0], symbol = _b2[1];
          return _super.prototype.parse.call(this, [env, "\\" + symbol]);
        };
        return DelimiterMap2;
      })(CharacterMap);
      SymbolMap.DelimiterMap = DelimiterMap;
      var MacroMap = (function(_super) {
        __extends2(MacroMap2, _super);
        function MacroMap2(name2, json, functionMap) {
          var e_2, _a2;
          var _this = _super.call(this, name2, null) || this;
          try {
            for (var _b2 = __values2(Object.keys(json)), _c = _b2.next(); !_c.done; _c = _b2.next()) {
              var key2 = _c.value;
              var value2 = json[key2];
              var _d = __read2(typeof value2 === "string" ? [value2] : value2), func = _d[0], attrs = _d.slice(1);
              var character = new Symbol_js_1.Macro(key2, functionMap[func], attrs);
              _this.add(key2, character);
            }
          } catch (e_2_1) {
            e_2 = { error: e_2_1 };
          } finally {
            try {
              if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
            } finally {
              if (e_2) throw e_2.error;
            }
          }
          return _this;
        }
        MacroMap2.prototype.parserFor = function(symbol) {
          var macro = this.lookup(symbol);
          return macro ? macro.func : null;
        };
        MacroMap2.prototype.parse = function(_a2) {
          var _b2 = __read2(_a2, 2), env = _b2[0], symbol = _b2[1];
          var macro = this.lookup(symbol);
          var parser2 = this.parserFor(symbol);
          if (!macro || !parser2) {
            return null;
          }
          return parseResult(parser2.apply(void 0, __spreadArray2([env, macro.symbol], __read2(macro.args), false)));
        };
        return MacroMap2;
      })(AbstractParseMap);
      SymbolMap.MacroMap = MacroMap;
      var CommandMap = (function(_super) {
        __extends2(CommandMap2, _super);
        function CommandMap2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        CommandMap2.prototype.parse = function(_a2) {
          var _b2 = __read2(_a2, 2), env = _b2[0], symbol = _b2[1];
          var macro = this.lookup(symbol);
          var parser2 = this.parserFor(symbol);
          if (!macro || !parser2) {
            return null;
          }
          var saveCommand = env.currentCS;
          env.currentCS = "\\" + symbol;
          var result2 = parser2.apply(void 0, __spreadArray2([env, "\\" + macro.symbol], __read2(macro.args), false));
          env.currentCS = saveCommand;
          return parseResult(result2);
        };
        return CommandMap2;
      })(MacroMap);
      SymbolMap.CommandMap = CommandMap;
      var EnvironmentMap = (function(_super) {
        __extends2(EnvironmentMap2, _super);
        function EnvironmentMap2(name2, parser2, json, functionMap) {
          var _this = _super.call(this, name2, json, functionMap) || this;
          _this.parser = parser2;
          return _this;
        }
        EnvironmentMap2.prototype.parse = function(_a2) {
          var _b2 = __read2(_a2, 2), env = _b2[0], symbol = _b2[1];
          var macro = this.lookup(symbol);
          var envParser = this.parserFor(symbol);
          if (!macro || !envParser) {
            return null;
          }
          return parseResult(this.parser(env, macro.symbol, envParser, macro.args));
        };
        return EnvironmentMap2;
      })(MacroMap);
      SymbolMap.EnvironmentMap = EnvironmentMap;
      return SymbolMap;
    }
    var BaseItems = {};
    var hasRequiredBaseItems;
    function requireBaseItems() {
      if (hasRequiredBaseItems) return BaseItems;
      hasRequiredBaseItems = 1;
      var __extends2 = BaseItems && BaseItems.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      var __read2 = BaseItems && BaseItems.__read || function(o, n) {
        var m = typeof Symbol === "function" && o[Symbol.iterator];
        if (!m) return o;
        var i2 = m.call(o), r2, ar2 = [], e;
        try {
          while ((n === void 0 || n-- > 0) && !(r2 = i2.next()).done) ar2.push(r2.value);
        } catch (error2) {
          e = { error: error2 };
        } finally {
          try {
            if (r2 && !r2.done && (m = i2["return"])) m.call(i2);
          } finally {
            if (e) throw e.error;
          }
        }
        return ar2;
      };
      var __spreadArray2 = BaseItems && BaseItems.__spreadArray || function(to2, from, pack) {
        if (pack || arguments.length === 2) for (var i2 = 0, l = from.length, ar2; i2 < l; i2++) {
          if (ar2 || !(i2 in from)) {
            if (!ar2) ar2 = Array.prototype.slice.call(from, 0, i2);
            ar2[i2] = from[i2];
          }
        }
        return to2.concat(ar2 || Array.prototype.slice.call(from));
      };
      var __importDefault2 = BaseItems && BaseItems.__importDefault || function(mod2) {
        return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
      };
      Object.defineProperty(BaseItems, "__esModule", { value: true });
      BaseItems.EquationItem = BaseItems.EqnArrayItem = BaseItems.ArrayItem = BaseItems.DotsItem = BaseItems.NonscriptItem = BaseItems.NotItem = BaseItems.FnItem = BaseItems.MmlItem = BaseItems.CellItem = BaseItems.PositionItem = BaseItems.StyleItem = BaseItems.EndItem = BaseItems.BeginItem = BaseItems.RightItem = BaseItems.Middle = BaseItems.LeftItem = BaseItems.OverItem = BaseItems.SubsupItem = BaseItems.PrimeItem = BaseItems.CloseItem = BaseItems.OpenItem = BaseItems.StopItem = BaseItems.StartItem = void 0;
      var MapHandler_js_1 = requireMapHandler();
      var Entities_js_1 = requireEntities();
      var MmlNode_js_1 = requireMmlNode();
      var TexError_js_1 = __importDefault2(requireTexError());
      var ParseUtil_js_1 = __importDefault2(requireParseUtil());
      var NodeUtil_js_1 = __importDefault2(requireNodeUtil());
      var StackItem_js_1 = requireStackItem();
      var StartItem = (function(_super) {
        __extends2(StartItem2, _super);
        function StartItem2(factory, global2) {
          var _this = _super.call(this, factory) || this;
          _this.global = global2;
          return _this;
        }
        Object.defineProperty(StartItem2.prototype, "kind", {
          get: function() {
            return "start";
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(StartItem2.prototype, "isOpen", {
          get: function() {
            return true;
          },
          enumerable: false,
          configurable: true
        });
        StartItem2.prototype.checkItem = function(item2) {
          if (item2.isKind("stop")) {
            var node2 = this.toMml();
            if (!this.global.isInner) {
              node2 = this.factory.configuration.tags.finalize(node2, this.env);
            }
            return [[this.factory.create("mml", node2)], true];
          }
          return _super.prototype.checkItem.call(this, item2);
        };
        return StartItem2;
      })(StackItem_js_1.BaseItem);
      BaseItems.StartItem = StartItem;
      var StopItem = (function(_super) {
        __extends2(StopItem2, _super);
        function StopItem2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        Object.defineProperty(StopItem2.prototype, "kind", {
          get: function() {
            return "stop";
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(StopItem2.prototype, "isClose", {
          get: function() {
            return true;
          },
          enumerable: false,
          configurable: true
        });
        return StopItem2;
      })(StackItem_js_1.BaseItem);
      BaseItems.StopItem = StopItem;
      var OpenItem = (function(_super) {
        __extends2(OpenItem2, _super);
        function OpenItem2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        Object.defineProperty(OpenItem2.prototype, "kind", {
          get: function() {
            return "open";
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(OpenItem2.prototype, "isOpen", {
          get: function() {
            return true;
          },
          enumerable: false,
          configurable: true
        });
        OpenItem2.prototype.checkItem = function(item2) {
          if (item2.isKind("close")) {
            var mml = this.toMml();
            var node2 = this.create("node", "TeXAtom", [mml]);
            return [[this.factory.create("mml", node2)], true];
          }
          return _super.prototype.checkItem.call(this, item2);
        };
        OpenItem2.errors = Object.assign(Object.create(StackItem_js_1.BaseItem.errors), {
          "stop": [
            "ExtraOpenMissingClose",
            "Extra open brace or missing close brace"
          ]
        });
        return OpenItem2;
      })(StackItem_js_1.BaseItem);
      BaseItems.OpenItem = OpenItem;
      var CloseItem = (function(_super) {
        __extends2(CloseItem2, _super);
        function CloseItem2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        Object.defineProperty(CloseItem2.prototype, "kind", {
          get: function() {
            return "close";
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(CloseItem2.prototype, "isClose", {
          get: function() {
            return true;
          },
          enumerable: false,
          configurable: true
        });
        return CloseItem2;
      })(StackItem_js_1.BaseItem);
      BaseItems.CloseItem = CloseItem;
      var PrimeItem = (function(_super) {
        __extends2(PrimeItem2, _super);
        function PrimeItem2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        Object.defineProperty(PrimeItem2.prototype, "kind", {
          get: function() {
            return "prime";
          },
          enumerable: false,
          configurable: true
        });
        PrimeItem2.prototype.checkItem = function(item2) {
          var _a2 = __read2(this.Peek(2), 2), top0 = _a2[0], top1 = _a2[1];
          if (!NodeUtil_js_1.default.isType(top0, "msubsup") || NodeUtil_js_1.default.isType(top0, "msup")) {
            var node2 = this.create("node", "msup", [top0, top1]);
            return [[node2, item2], true];
          }
          NodeUtil_js_1.default.setChild(top0, top0.sup, top1);
          return [[top0, item2], true];
        };
        return PrimeItem2;
      })(StackItem_js_1.BaseItem);
      BaseItems.PrimeItem = PrimeItem;
      var SubsupItem = (function(_super) {
        __extends2(SubsupItem2, _super);
        function SubsupItem2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        Object.defineProperty(SubsupItem2.prototype, "kind", {
          get: function() {
            return "subsup";
          },
          enumerable: false,
          configurable: true
        });
        SubsupItem2.prototype.checkItem = function(item2) {
          if (item2.isKind("open") || item2.isKind("left")) {
            return StackItem_js_1.BaseItem.success;
          }
          var top2 = this.First;
          var position = this.getProperty("position");
          if (item2.isKind("mml")) {
            if (this.getProperty("primes")) {
              if (position !== 2) {
                NodeUtil_js_1.default.setChild(top2, 2, this.getProperty("primes"));
              } else {
                NodeUtil_js_1.default.setProperty(this.getProperty("primes"), "variantForm", true);
                var node2 = this.create("node", "mrow", [this.getProperty("primes"), item2.First]);
                item2.First = node2;
              }
            }
            NodeUtil_js_1.default.setChild(top2, position, item2.First);
            if (this.getProperty("movesupsub") != null) {
              NodeUtil_js_1.default.setProperty(top2, "movesupsub", this.getProperty("movesupsub"));
            }
            var result2 = this.factory.create("mml", top2);
            return [[result2], true];
          }
          if (_super.prototype.checkItem.call(this, item2)[1]) {
            var error2 = this.getErrors(["", "sub", "sup"][position]);
            throw new (TexError_js_1.default.bind.apply(TexError_js_1.default, __spreadArray2([void 0, error2[0], error2[1]], __read2(error2.splice(2)), false)))();
          }
          return null;
        };
        SubsupItem2.errors = Object.assign(Object.create(StackItem_js_1.BaseItem.errors), {
          "stop": [
            "MissingScript",
            "Missing superscript or subscript argument"
          ],
          "sup": [
            "MissingOpenForSup",
            "Missing open brace for superscript"
          ],
          "sub": [
            "MissingOpenForSub",
            "Missing open brace for subscript"
          ]
        });
        return SubsupItem2;
      })(StackItem_js_1.BaseItem);
      BaseItems.SubsupItem = SubsupItem;
      var OverItem = (function(_super) {
        __extends2(OverItem2, _super);
        function OverItem2(factory) {
          var _this = _super.call(this, factory) || this;
          _this.setProperty("name", "\\over");
          return _this;
        }
        Object.defineProperty(OverItem2.prototype, "kind", {
          get: function() {
            return "over";
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(OverItem2.prototype, "isClose", {
          get: function() {
            return true;
          },
          enumerable: false,
          configurable: true
        });
        OverItem2.prototype.checkItem = function(item2) {
          if (item2.isKind("over")) {
            throw new TexError_js_1.default("AmbiguousUseOf", "Ambiguous use of %1", item2.getName());
          }
          if (item2.isClose) {
            var mml = this.create("node", "mfrac", [this.getProperty("num"), this.toMml(false)]);
            if (this.getProperty("thickness") != null) {
              NodeUtil_js_1.default.setAttribute(mml, "linethickness", this.getProperty("thickness"));
            }
            if (this.getProperty("open") || this.getProperty("close")) {
              NodeUtil_js_1.default.setProperty(mml, "withDelims", true);
              mml = ParseUtil_js_1.default.fixedFence(this.factory.configuration, this.getProperty("open"), mml, this.getProperty("close"));
            }
            return [[this.factory.create("mml", mml), item2], true];
          }
          return _super.prototype.checkItem.call(this, item2);
        };
        OverItem2.prototype.toString = function() {
          return "over[" + this.getProperty("num") + " / " + this.nodes.join("; ") + "]";
        };
        return OverItem2;
      })(StackItem_js_1.BaseItem);
      BaseItems.OverItem = OverItem;
      var LeftItem = (function(_super) {
        __extends2(LeftItem2, _super);
        function LeftItem2(factory, delim) {
          var _this = _super.call(this, factory) || this;
          _this.setProperty("delim", delim);
          return _this;
        }
        Object.defineProperty(LeftItem2.prototype, "kind", {
          get: function() {
            return "left";
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(LeftItem2.prototype, "isOpen", {
          get: function() {
            return true;
          },
          enumerable: false,
          configurable: true
        });
        LeftItem2.prototype.checkItem = function(item2) {
          if (item2.isKind("right")) {
            return [[this.factory.create("mml", ParseUtil_js_1.default.fenced(this.factory.configuration, this.getProperty("delim"), this.toMml(), item2.getProperty("delim"), "", item2.getProperty("color")))], true];
          }
          if (item2.isKind("middle")) {
            var def = { stretchy: true };
            if (item2.getProperty("color")) {
              def.mathcolor = item2.getProperty("color");
            }
            this.Push(this.create("node", "TeXAtom", [], { texClass: MmlNode_js_1.TEXCLASS.CLOSE }), this.create("token", "mo", def, item2.getProperty("delim")), this.create("node", "TeXAtom", [], { texClass: MmlNode_js_1.TEXCLASS.OPEN }));
            this.env = {};
            return [[this], true];
          }
          return _super.prototype.checkItem.call(this, item2);
        };
        LeftItem2.errors = Object.assign(Object.create(StackItem_js_1.BaseItem.errors), {
          "stop": [
            "ExtraLeftMissingRight",
            "Extra \\left or missing \\right"
          ]
        });
        return LeftItem2;
      })(StackItem_js_1.BaseItem);
      BaseItems.LeftItem = LeftItem;
      var Middle = (function(_super) {
        __extends2(Middle2, _super);
        function Middle2(factory, delim, color) {
          var _this = _super.call(this, factory) || this;
          _this.setProperty("delim", delim);
          color && _this.setProperty("color", color);
          return _this;
        }
        Object.defineProperty(Middle2.prototype, "kind", {
          get: function() {
            return "middle";
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(Middle2.prototype, "isClose", {
          get: function() {
            return true;
          },
          enumerable: false,
          configurable: true
        });
        return Middle2;
      })(StackItem_js_1.BaseItem);
      BaseItems.Middle = Middle;
      var RightItem = (function(_super) {
        __extends2(RightItem2, _super);
        function RightItem2(factory, delim, color) {
          var _this = _super.call(this, factory) || this;
          _this.setProperty("delim", delim);
          color && _this.setProperty("color", color);
          return _this;
        }
        Object.defineProperty(RightItem2.prototype, "kind", {
          get: function() {
            return "right";
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(RightItem2.prototype, "isClose", {
          get: function() {
            return true;
          },
          enumerable: false,
          configurable: true
        });
        return RightItem2;
      })(StackItem_js_1.BaseItem);
      BaseItems.RightItem = RightItem;
      var BeginItem = (function(_super) {
        __extends2(BeginItem2, _super);
        function BeginItem2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        Object.defineProperty(BeginItem2.prototype, "kind", {
          get: function() {
            return "begin";
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(BeginItem2.prototype, "isOpen", {
          get: function() {
            return true;
          },
          enumerable: false,
          configurable: true
        });
        BeginItem2.prototype.checkItem = function(item2) {
          if (item2.isKind("end")) {
            if (item2.getName() !== this.getName()) {
              throw new TexError_js_1.default("EnvBadEnd", "\\begin{%1} ended with \\end{%2}", this.getName(), item2.getName());
            }
            if (!this.getProperty("end")) {
              return [[this.factory.create("mml", this.toMml())], true];
            }
            return StackItem_js_1.BaseItem.fail;
          }
          if (item2.isKind("stop")) {
            throw new TexError_js_1.default("EnvMissingEnd", "Missing \\end{%1}", this.getName());
          }
          return _super.prototype.checkItem.call(this, item2);
        };
        return BeginItem2;
      })(StackItem_js_1.BaseItem);
      BaseItems.BeginItem = BeginItem;
      var EndItem = (function(_super) {
        __extends2(EndItem2, _super);
        function EndItem2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        Object.defineProperty(EndItem2.prototype, "kind", {
          get: function() {
            return "end";
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(EndItem2.prototype, "isClose", {
          get: function() {
            return true;
          },
          enumerable: false,
          configurable: true
        });
        return EndItem2;
      })(StackItem_js_1.BaseItem);
      BaseItems.EndItem = EndItem;
      var StyleItem = (function(_super) {
        __extends2(StyleItem2, _super);
        function StyleItem2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        Object.defineProperty(StyleItem2.prototype, "kind", {
          get: function() {
            return "style";
          },
          enumerable: false,
          configurable: true
        });
        StyleItem2.prototype.checkItem = function(item2) {
          if (!item2.isClose) {
            return _super.prototype.checkItem.call(this, item2);
          }
          var mml = this.create("node", "mstyle", this.nodes, this.getProperty("styles"));
          return [[this.factory.create("mml", mml), item2], true];
        };
        return StyleItem2;
      })(StackItem_js_1.BaseItem);
      BaseItems.StyleItem = StyleItem;
      var PositionItem = (function(_super) {
        __extends2(PositionItem2, _super);
        function PositionItem2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        Object.defineProperty(PositionItem2.prototype, "kind", {
          get: function() {
            return "position";
          },
          enumerable: false,
          configurable: true
        });
        PositionItem2.prototype.checkItem = function(item2) {
          if (item2.isClose) {
            throw new TexError_js_1.default("MissingBoxFor", "Missing box for %1", this.getName());
          }
          if (item2.isFinal) {
            var mml = item2.toMml();
            switch (this.getProperty("move")) {
              case "vertical":
                mml = this.create("node", "mpadded", [mml], {
                  height: this.getProperty("dh"),
                  depth: this.getProperty("dd"),
                  voffset: this.getProperty("dh")
                });
                return [[this.factory.create("mml", mml)], true];
              case "horizontal":
                return [[
                  this.factory.create("mml", this.getProperty("left")),
                  item2,
                  this.factory.create("mml", this.getProperty("right"))
                ], true];
            }
          }
          return _super.prototype.checkItem.call(this, item2);
        };
        return PositionItem2;
      })(StackItem_js_1.BaseItem);
      BaseItems.PositionItem = PositionItem;
      var CellItem = (function(_super) {
        __extends2(CellItem2, _super);
        function CellItem2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        Object.defineProperty(CellItem2.prototype, "kind", {
          get: function() {
            return "cell";
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(CellItem2.prototype, "isClose", {
          get: function() {
            return true;
          },
          enumerable: false,
          configurable: true
        });
        return CellItem2;
      })(StackItem_js_1.BaseItem);
      BaseItems.CellItem = CellItem;
      var MmlItem = (function(_super) {
        __extends2(MmlItem2, _super);
        function MmlItem2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        Object.defineProperty(MmlItem2.prototype, "isFinal", {
          get: function() {
            return true;
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(MmlItem2.prototype, "kind", {
          get: function() {
            return "mml";
          },
          enumerable: false,
          configurable: true
        });
        return MmlItem2;
      })(StackItem_js_1.BaseItem);
      BaseItems.MmlItem = MmlItem;
      var FnItem = (function(_super) {
        __extends2(FnItem2, _super);
        function FnItem2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        Object.defineProperty(FnItem2.prototype, "kind", {
          get: function() {
            return "fn";
          },
          enumerable: false,
          configurable: true
        });
        FnItem2.prototype.checkItem = function(item2) {
          var top2 = this.First;
          if (top2) {
            if (item2.isOpen) {
              return StackItem_js_1.BaseItem.success;
            }
            if (!item2.isKind("fn")) {
              var mml = item2.First;
              if (!item2.isKind("mml") || !mml) {
                return [[top2, item2], true];
              }
              if (NodeUtil_js_1.default.isType(mml, "mstyle") && mml.childNodes.length && NodeUtil_js_1.default.isType(mml.childNodes[0].childNodes[0], "mspace") || NodeUtil_js_1.default.isType(mml, "mspace")) {
                return [[top2, item2], true];
              }
              if (NodeUtil_js_1.default.isEmbellished(mml)) {
                mml = NodeUtil_js_1.default.getCoreMO(mml);
              }
              var form = NodeUtil_js_1.default.getForm(mml);
              if (form != null && [0, 0, 1, 1, 0, 1, 1, 0, 0, 0][form[2]]) {
                return [[top2, item2], true];
              }
            }
            var node2 = this.create("token", "mo", { texClass: MmlNode_js_1.TEXCLASS.NONE }, Entities_js_1.entities.ApplyFunction);
            return [[top2, node2, item2], true];
          }
          return _super.prototype.checkItem.apply(this, arguments);
        };
        return FnItem2;
      })(StackItem_js_1.BaseItem);
      BaseItems.FnItem = FnItem;
      var NotItem = (function(_super) {
        __extends2(NotItem2, _super);
        function NotItem2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.remap = MapHandler_js_1.MapHandler.getMap("not_remap");
          return _this;
        }
        Object.defineProperty(NotItem2.prototype, "kind", {
          get: function() {
            return "not";
          },
          enumerable: false,
          configurable: true
        });
        NotItem2.prototype.checkItem = function(item2) {
          var mml;
          var c2;
          var textNode;
          if (item2.isKind("open") || item2.isKind("left")) {
            return StackItem_js_1.BaseItem.success;
          }
          if (item2.isKind("mml") && (NodeUtil_js_1.default.isType(item2.First, "mo") || NodeUtil_js_1.default.isType(item2.First, "mi") || NodeUtil_js_1.default.isType(item2.First, "mtext"))) {
            mml = item2.First;
            c2 = NodeUtil_js_1.default.getText(mml);
            if (c2.length === 1 && !NodeUtil_js_1.default.getProperty(mml, "movesupsub") && NodeUtil_js_1.default.getChildren(mml).length === 1) {
              if (this.remap.contains(c2)) {
                textNode = this.create("text", this.remap.lookup(c2).char);
                NodeUtil_js_1.default.setChild(mml, 0, textNode);
              } else {
                textNode = this.create("text", "̸");
                NodeUtil_js_1.default.appendChildren(mml, [textNode]);
              }
              return [[item2], true];
            }
          }
          textNode = this.create("text", "⧸");
          var mtextNode = this.create("node", "mtext", [], {}, textNode);
          var paddedNode = this.create("node", "mpadded", [mtextNode], { width: 0 });
          mml = this.create("node", "TeXAtom", [paddedNode], { texClass: MmlNode_js_1.TEXCLASS.REL });
          return [[mml, item2], true];
        };
        return NotItem2;
      })(StackItem_js_1.BaseItem);
      BaseItems.NotItem = NotItem;
      var NonscriptItem = (function(_super) {
        __extends2(NonscriptItem2, _super);
        function NonscriptItem2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        Object.defineProperty(NonscriptItem2.prototype, "kind", {
          get: function() {
            return "nonscript";
          },
          enumerable: false,
          configurable: true
        });
        NonscriptItem2.prototype.checkItem = function(item2) {
          if (item2.isKind("mml") && item2.Size() === 1) {
            var mml = item2.First;
            if (mml.isKind("mstyle") && mml.notParent) {
              mml = NodeUtil_js_1.default.getChildren(NodeUtil_js_1.default.getChildren(mml)[0])[0];
            }
            if (mml.isKind("mspace")) {
              if (mml !== item2.First) {
                var mrow2 = this.create("node", "mrow", [item2.Pop()]);
                item2.Push(mrow2);
              }
              this.factory.configuration.addNode("nonscript", item2.First);
            }
          }
          return [[item2], true];
        };
        return NonscriptItem2;
      })(StackItem_js_1.BaseItem);
      BaseItems.NonscriptItem = NonscriptItem;
      var DotsItem = (function(_super) {
        __extends2(DotsItem2, _super);
        function DotsItem2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        Object.defineProperty(DotsItem2.prototype, "kind", {
          get: function() {
            return "dots";
          },
          enumerable: false,
          configurable: true
        });
        DotsItem2.prototype.checkItem = function(item2) {
          if (item2.isKind("open") || item2.isKind("left")) {
            return StackItem_js_1.BaseItem.success;
          }
          var dots = this.getProperty("ldots");
          var top2 = item2.First;
          if (item2.isKind("mml") && NodeUtil_js_1.default.isEmbellished(top2)) {
            var tclass = NodeUtil_js_1.default.getTexClass(NodeUtil_js_1.default.getCoreMO(top2));
            if (tclass === MmlNode_js_1.TEXCLASS.BIN || tclass === MmlNode_js_1.TEXCLASS.REL) {
              dots = this.getProperty("cdots");
            }
          }
          return [[dots, item2], true];
        };
        return DotsItem2;
      })(StackItem_js_1.BaseItem);
      BaseItems.DotsItem = DotsItem;
      var ArrayItem = (function(_super) {
        __extends2(ArrayItem2, _super);
        function ArrayItem2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.table = [];
          _this.row = [];
          _this.frame = [];
          _this.hfill = [];
          _this.arraydef = {};
          _this.dashed = false;
          return _this;
        }
        Object.defineProperty(ArrayItem2.prototype, "kind", {
          get: function() {
            return "array";
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(ArrayItem2.prototype, "isOpen", {
          get: function() {
            return true;
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(ArrayItem2.prototype, "copyEnv", {
          get: function() {
            return false;
          },
          enumerable: false,
          configurable: true
        });
        ArrayItem2.prototype.checkItem = function(item2) {
          if (item2.isClose && !item2.isKind("over")) {
            if (item2.getProperty("isEntry")) {
              this.EndEntry();
              this.clearEnv();
              return StackItem_js_1.BaseItem.fail;
            }
            if (item2.getProperty("isCR")) {
              this.EndEntry();
              this.EndRow();
              this.clearEnv();
              return StackItem_js_1.BaseItem.fail;
            }
            this.EndTable();
            this.clearEnv();
            var newItem = this.factory.create("mml", this.createMml());
            if (this.getProperty("requireClose")) {
              if (item2.isKind("close")) {
                return [[newItem], true];
              }
              throw new TexError_js_1.default("MissingCloseBrace", "Missing close brace");
            }
            return [[newItem, item2], true];
          }
          return _super.prototype.checkItem.call(this, item2);
        };
        ArrayItem2.prototype.createMml = function() {
          var scriptlevel = this.arraydef["scriptlevel"];
          delete this.arraydef["scriptlevel"];
          var mml = this.create("node", "mtable", this.table, this.arraydef);
          if (scriptlevel) {
            mml.setProperty("scriptlevel", scriptlevel);
          }
          if (this.frame.length === 4) {
            NodeUtil_js_1.default.setAttribute(mml, "frame", this.dashed ? "dashed" : "solid");
          } else if (this.frame.length) {
            if (this.arraydef["rowlines"]) {
              this.arraydef["rowlines"] = this.arraydef["rowlines"].replace(/none( none)+$/, "none");
            }
            NodeUtil_js_1.default.setAttribute(mml, "frame", "");
            mml = this.create("node", "menclose", [mml], { notation: this.frame.join(" ") });
            if ((this.arraydef["columnlines"] || "none") !== "none" || (this.arraydef["rowlines"] || "none") !== "none") {
              NodeUtil_js_1.default.setAttribute(mml, "data-padding", 0);
            }
          }
          if (this.getProperty("open") || this.getProperty("close")) {
            mml = ParseUtil_js_1.default.fenced(this.factory.configuration, this.getProperty("open"), mml, this.getProperty("close"));
          }
          return mml;
        };
        ArrayItem2.prototype.EndEntry = function() {
          var mtd2 = this.create("node", "mtd", this.nodes);
          if (this.hfill.length) {
            if (this.hfill[0] === 0) {
              NodeUtil_js_1.default.setAttribute(mtd2, "columnalign", "right");
            }
            if (this.hfill[this.hfill.length - 1] === this.Size()) {
              NodeUtil_js_1.default.setAttribute(mtd2, "columnalign", NodeUtil_js_1.default.getAttribute(mtd2, "columnalign") ? "center" : "left");
            }
          }
          this.row.push(mtd2);
          this.Clear();
          this.hfill = [];
        };
        ArrayItem2.prototype.EndRow = function() {
          var node2;
          if (this.getProperty("isNumbered") && this.row.length === 3) {
            this.row.unshift(this.row.pop());
            node2 = this.create("node", "mlabeledtr", this.row);
          } else {
            node2 = this.create("node", "mtr", this.row);
          }
          this.table.push(node2);
          this.row = [];
        };
        ArrayItem2.prototype.EndTable = function() {
          if (this.Size() || this.row.length) {
            this.EndEntry();
            this.EndRow();
          }
          this.checkLines();
        };
        ArrayItem2.prototype.checkLines = function() {
          if (this.arraydef["rowlines"]) {
            var lines = this.arraydef["rowlines"].split(/ /);
            if (lines.length === this.table.length) {
              this.frame.push("bottom");
              lines.pop();
              this.arraydef["rowlines"] = lines.join(" ");
            } else if (lines.length < this.table.length - 1) {
              this.arraydef["rowlines"] += " none";
            }
          }
          if (this.getProperty("rowspacing")) {
            var rows = this.arraydef["rowspacing"].split(/ /);
            while (rows.length < this.table.length) {
              rows.push(this.getProperty("rowspacing") + "em");
            }
            this.arraydef["rowspacing"] = rows.join(" ");
          }
        };
        ArrayItem2.prototype.addRowSpacing = function(spacing) {
          if (this.arraydef["rowspacing"]) {
            var rows = this.arraydef["rowspacing"].split(/ /);
            if (!this.getProperty("rowspacing")) {
              var dimem = ParseUtil_js_1.default.dimen2em(rows[0]);
              this.setProperty("rowspacing", dimem);
            }
            var rowspacing = this.getProperty("rowspacing");
            while (rows.length < this.table.length) {
              rows.push(ParseUtil_js_1.default.Em(rowspacing));
            }
            rows[this.table.length - 1] = ParseUtil_js_1.default.Em(Math.max(0, rowspacing + ParseUtil_js_1.default.dimen2em(spacing)));
            this.arraydef["rowspacing"] = rows.join(" ");
          }
        };
        return ArrayItem2;
      })(StackItem_js_1.BaseItem);
      BaseItems.ArrayItem = ArrayItem;
      var EqnArrayItem = (function(_super) {
        __extends2(EqnArrayItem2, _super);
        function EqnArrayItem2(factory) {
          var args2 = [];
          for (var _i = 1; _i < arguments.length; _i++) {
            args2[_i - 1] = arguments[_i];
          }
          var _this = _super.call(this, factory) || this;
          _this.maxrow = 0;
          _this.factory.configuration.tags.start(args2[0], args2[2], args2[1]);
          return _this;
        }
        Object.defineProperty(EqnArrayItem2.prototype, "kind", {
          get: function() {
            return "eqnarray";
          },
          enumerable: false,
          configurable: true
        });
        EqnArrayItem2.prototype.EndEntry = function() {
          if (this.row.length) {
            ParseUtil_js_1.default.fixInitialMO(this.factory.configuration, this.nodes);
          }
          var node2 = this.create("node", "mtd", this.nodes);
          this.row.push(node2);
          this.Clear();
        };
        EqnArrayItem2.prototype.EndRow = function() {
          if (this.row.length > this.maxrow) {
            this.maxrow = this.row.length;
          }
          var mtr2 = "mtr";
          var tag = this.factory.configuration.tags.getTag();
          if (tag) {
            this.row = [tag].concat(this.row);
            mtr2 = "mlabeledtr";
          }
          this.factory.configuration.tags.clearTag();
          var node2 = this.create("node", mtr2, this.row);
          this.table.push(node2);
          this.row = [];
        };
        EqnArrayItem2.prototype.EndTable = function() {
          _super.prototype.EndTable.call(this);
          this.factory.configuration.tags.end();
          this.extendArray("columnalign", this.maxrow);
          this.extendArray("columnwidth", this.maxrow);
          this.extendArray("columnspacing", this.maxrow - 1);
        };
        EqnArrayItem2.prototype.extendArray = function(name2, max2) {
          if (!this.arraydef[name2])
            return;
          var repeat = this.arraydef[name2].split(/ /);
          var columns = __spreadArray2([], __read2(repeat), false);
          if (columns.length > 1) {
            while (columns.length < max2) {
              columns.push.apply(columns, __spreadArray2([], __read2(repeat), false));
            }
            this.arraydef[name2] = columns.slice(0, max2).join(" ");
          }
        };
        return EqnArrayItem2;
      })(ArrayItem);
      BaseItems.EqnArrayItem = EqnArrayItem;
      var EquationItem = (function(_super) {
        __extends2(EquationItem2, _super);
        function EquationItem2(factory) {
          var args2 = [];
          for (var _i = 1; _i < arguments.length; _i++) {
            args2[_i - 1] = arguments[_i];
          }
          var _this = _super.call(this, factory) || this;
          _this.factory.configuration.tags.start("equation", true, args2[0]);
          return _this;
        }
        Object.defineProperty(EquationItem2.prototype, "kind", {
          get: function() {
            return "equation";
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(EquationItem2.prototype, "isOpen", {
          get: function() {
            return true;
          },
          enumerable: false,
          configurable: true
        });
        EquationItem2.prototype.checkItem = function(item2) {
          if (item2.isKind("end")) {
            var mml = this.toMml();
            var tag = this.factory.configuration.tags.getTag();
            this.factory.configuration.tags.end();
            return [[tag ? this.factory.configuration.tags.enTag(mml, tag) : mml, item2], true];
          }
          if (item2.isKind("stop")) {
            throw new TexError_js_1.default("EnvMissingEnd", "Missing \\end{%1}", this.getName());
          }
          return _super.prototype.checkItem.call(this, item2);
        };
        return EquationItem2;
      })(StackItem_js_1.BaseItem);
      BaseItems.EquationItem = EquationItem;
      return BaseItems;
    }
    var BaseMappings = {};
    var TexConstants = {};
    var hasRequiredTexConstants;
    function requireTexConstants() {
      if (hasRequiredTexConstants) return TexConstants;
      hasRequiredTexConstants = 1;
      (function(exports2) {
        Object.defineProperty(exports2, "__esModule", { value: true });
        exports2.TexConstant = void 0;
        (function(TexConstant) {
          TexConstant.Variant = {
            NORMAL: "normal",
            BOLD: "bold",
            ITALIC: "italic",
            BOLDITALIC: "bold-italic",
            DOUBLESTRUCK: "double-struck",
            FRAKTUR: "fraktur",
            BOLDFRAKTUR: "bold-fraktur",
            SCRIPT: "script",
            BOLDSCRIPT: "bold-script",
            SANSSERIF: "sans-serif",
            BOLDSANSSERIF: "bold-sans-serif",
            SANSSERIFITALIC: "sans-serif-italic",
            SANSSERIFBOLDITALIC: "sans-serif-bold-italic",
            MONOSPACE: "monospace",
            INITIAL: "inital",
            TAILED: "tailed",
            LOOPED: "looped",
            STRETCHED: "stretched",
            CALLIGRAPHIC: "-tex-calligraphic",
            BOLDCALLIGRAPHIC: "-tex-bold-calligraphic",
            OLDSTYLE: "-tex-oldstyle",
            BOLDOLDSTYLE: "-tex-bold-oldstyle",
            MATHITALIC: "-tex-mathit"
          };
          TexConstant.Form = {
            PREFIX: "prefix",
            INFIX: "infix",
            POSTFIX: "postfix"
          };
          TexConstant.LineBreak = {
            AUTO: "auto",
            NEWLINE: "newline",
            NOBREAK: "nobreak",
            GOODBREAK: "goodbreak",
            BADBREAK: "badbreak"
          };
          TexConstant.LineBreakStyle = {
            BEFORE: "before",
            AFTER: "after",
            DUPLICATE: "duplicate",
            INFIXLINBREAKSTYLE: "infixlinebreakstyle"
          };
          TexConstant.IndentAlign = {
            LEFT: "left",
            CENTER: "center",
            RIGHT: "right",
            AUTO: "auto",
            ID: "id",
            INDENTALIGN: "indentalign"
          };
          TexConstant.IndentShift = {
            INDENTSHIFT: "indentshift"
          };
          TexConstant.LineThickness = {
            THIN: "thin",
            MEDIUM: "medium",
            THICK: "thick"
          };
          TexConstant.Notation = {
            LONGDIV: "longdiv",
            ACTUARIAL: "actuarial",
            PHASORANGLE: "phasorangle",
            RADICAL: "radical",
            BOX: "box",
            ROUNDEDBOX: "roundedbox",
            CIRCLE: "circle",
            LEFT: "left",
            RIGHT: "right",
            TOP: "top",
            BOTTOM: "bottom",
            UPDIAGONALSTRIKE: "updiagonalstrike",
            DOWNDIAGONALSTRIKE: "downdiagonalstrike",
            VERTICALSTRIKE: "verticalstrike",
            HORIZONTALSTRIKE: "horizontalstrike",
            NORTHEASTARROW: "northeastarrow",
            MADRUWB: "madruwb",
            UPDIAGONALARROW: "updiagonalarrow"
          };
          TexConstant.Align = {
            TOP: "top",
            BOTTOM: "bottom",
            CENTER: "center",
            BASELINE: "baseline",
            AXIS: "axis",
            LEFT: "left",
            RIGHT: "right"
          };
          TexConstant.Lines = {
            NONE: "none",
            SOLID: "solid",
            DASHED: "dashed"
          };
          TexConstant.Side = {
            LEFT: "left",
            RIGHT: "right",
            LEFTOVERLAP: "leftoverlap",
            RIGHTOVERLAP: "rightoverlap"
          };
          TexConstant.Width = {
            AUTO: "auto",
            FIT: "fit"
          };
          TexConstant.Actiontype = {
            TOGGLE: "toggle",
            STATUSLINE: "statusline",
            TOOLTIP: "tooltip",
            INPUT: "input"
          };
          TexConstant.Overflow = {
            LINBREAK: "linebreak",
            SCROLL: "scroll",
            ELIDE: "elide",
            TRUNCATE: "truncate",
            SCALE: "scale"
          };
          TexConstant.Unit = {
            EM: "em",
            EX: "ex",
            PX: "px",
            IN: "in",
            CM: "cm",
            MM: "mm",
            PT: "pt",
            PC: "pc"
          };
        })(exports2.TexConstant || (exports2.TexConstant = {}));
      })(TexConstants);
      return TexConstants;
    }
    var BaseMethods = {};
    var lengths = {};
    var hasRequiredLengths;
    function requireLengths() {
      if (hasRequiredLengths) return lengths;
      hasRequiredLengths = 1;
      (function(exports2) {
        Object.defineProperty(exports2, "__esModule", { value: true });
        exports2.px = exports2.emRounded = exports2.em = exports2.percent = exports2.length2em = exports2.MATHSPACE = exports2.RELUNITS = exports2.UNITS = exports2.BIGDIMEN = void 0;
        exports2.BIGDIMEN = 1e6;
        exports2.UNITS = {
          px: 1,
          "in": 96,
          cm: 96 / 2.54,
          mm: 96 / 25.4
        };
        exports2.RELUNITS = {
          em: 1,
          ex: 0.431,
          pt: 1 / 10,
          pc: 12 / 10,
          mu: 1 / 18
        };
        exports2.MATHSPACE = {
          veryverythinmathspace: 1 / 18,
          verythinmathspace: 2 / 18,
          thinmathspace: 3 / 18,
          mediummathspace: 4 / 18,
          thickmathspace: 5 / 18,
          verythickmathspace: 6 / 18,
          veryverythickmathspace: 7 / 18,
          negativeveryverythinmathspace: -1 / 18,
          negativeverythinmathspace: -2 / 18,
          negativethinmathspace: -3 / 18,
          negativemediummathspace: -4 / 18,
          negativethickmathspace: -5 / 18,
          negativeverythickmathspace: -6 / 18,
          negativeveryverythickmathspace: -7 / 18,
          thin: 0.04,
          medium: 0.06,
          thick: 0.1,
          normal: 1,
          big: 2,
          small: 1 / Math.sqrt(2),
          infinity: exports2.BIGDIMEN
        };
        function length2em(length, size, scale, em2) {
          if (size === void 0) {
            size = 0;
          }
          if (scale === void 0) {
            scale = 1;
          }
          if (em2 === void 0) {
            em2 = 16;
          }
          if (typeof length !== "string") {
            length = String(length);
          }
          if (length === "" || length == null) {
            return size;
          }
          if (exports2.MATHSPACE[length]) {
            return exports2.MATHSPACE[length];
          }
          var match = length.match(/^\s*([-+]?(?:\.\d+|\d+(?:\.\d*)?))?(pt|em|ex|mu|px|pc|in|mm|cm|%)?/);
          if (!match) {
            return size;
          }
          var m = parseFloat(match[1] || "1"), unit = match[2];
          if (exports2.UNITS.hasOwnProperty(unit)) {
            return m * exports2.UNITS[unit] / em2 / scale;
          }
          if (exports2.RELUNITS.hasOwnProperty(unit)) {
            return m * exports2.RELUNITS[unit];
          }
          if (unit === "%") {
            return m / 100 * size;
          }
          return m * size;
        }
        exports2.length2em = length2em;
        function percent(m) {
          return (100 * m).toFixed(1).replace(/\.?0+$/, "") + "%";
        }
        exports2.percent = percent;
        function em(m) {
          if (Math.abs(m) < 1e-3)
            return "0";
          return m.toFixed(3).replace(/\.?0+$/, "") + "em";
        }
        exports2.em = em;
        function emRounded(m, em2) {
          if (em2 === void 0) {
            em2 = 16;
          }
          m = (Math.round(m * em2) + 0.05) / em2;
          if (Math.abs(m) < 1e-3)
            return "0em";
          return m.toFixed(3).replace(/\.?0+$/, "") + "em";
        }
        exports2.emRounded = emRounded;
        function px(m, M, em2) {
          if (M === void 0) {
            M = -exports2.BIGDIMEN;
          }
          if (em2 === void 0) {
            em2 = 16;
          }
          m *= em2;
          if (M && m < M)
            m = M;
          if (Math.abs(m) < 0.1)
            return "0";
          return m.toFixed(1).replace(/\.0$/, "") + "px";
        }
        exports2.px = px;
      })(lengths);
      return lengths;
    }
    var hasRequiredBaseMethods;
    function requireBaseMethods() {
      if (hasRequiredBaseMethods) return BaseMethods;
      hasRequiredBaseMethods = 1;
      var __assign2 = BaseMethods && BaseMethods.__assign || function() {
        __assign2 = Object.assign || function(t2) {
          for (var s, i2 = 1, n = arguments.length; i2 < n; i2++) {
            s = arguments[i2];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
              t2[p] = s[p];
          }
          return t2;
        };
        return __assign2.apply(this, arguments);
      };
      var __createBinding2 = BaseMethods && BaseMethods.__createBinding || (Object.create ? (function(o, m, k2, k22) {
        if (k22 === void 0) k22 = k2;
        var desc = Object.getOwnPropertyDescriptor(m, k2);
        if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
          desc = { enumerable: true, get: function() {
            return m[k2];
          } };
        }
        Object.defineProperty(o, k22, desc);
      }) : (function(o, m, k2, k22) {
        if (k22 === void 0) k22 = k2;
        o[k22] = m[k2];
      }));
      var __setModuleDefault2 = BaseMethods && BaseMethods.__setModuleDefault || (Object.create ? (function(o, v) {
        Object.defineProperty(o, "default", { enumerable: true, value: v });
      }) : function(o, v) {
        o["default"] = v;
      });
      var __importStar2 = BaseMethods && BaseMethods.__importStar || function(mod2) {
        if (mod2 && mod2.__esModule) return mod2;
        var result2 = {};
        if (mod2 != null) {
          for (var k2 in mod2) if (k2 !== "default" && Object.prototype.hasOwnProperty.call(mod2, k2)) __createBinding2(result2, mod2, k2);
        }
        __setModuleDefault2(result2, mod2);
        return result2;
      };
      var __read2 = BaseMethods && BaseMethods.__read || function(o, n) {
        var m = typeof Symbol === "function" && o[Symbol.iterator];
        if (!m) return o;
        var i2 = m.call(o), r2, ar2 = [], e;
        try {
          while ((n === void 0 || n-- > 0) && !(r2 = i2.next()).done) ar2.push(r2.value);
        } catch (error2) {
          e = { error: error2 };
        } finally {
          try {
            if (r2 && !r2.done && (m = i2["return"])) m.call(i2);
          } finally {
            if (e) throw e.error;
          }
        }
        return ar2;
      };
      var __importDefault2 = BaseMethods && BaseMethods.__importDefault || function(mod2) {
        return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
      };
      Object.defineProperty(BaseMethods, "__esModule", { value: true });
      var sitem = __importStar2(requireBaseItems());
      var NodeUtil_js_1 = __importDefault2(requireNodeUtil());
      var TexError_js_1 = __importDefault2(requireTexError());
      var TexParser_js_1 = __importDefault2(requireTexParser());
      var TexConstants_js_1 = requireTexConstants();
      var ParseUtil_js_1 = __importDefault2(requireParseUtil());
      var MmlNode_js_1 = requireMmlNode();
      var Tags_js_1 = requireTags();
      var lengths_js_1 = requireLengths();
      var Entities_js_1 = requireEntities();
      var Options_js_1 = requireOptions$1();
      var BaseMethods$1 = {};
      var P_HEIGHT = 1.2 / 0.85;
      var MmlTokenAllow = {
        fontfamily: 1,
        fontsize: 1,
        fontweight: 1,
        fontstyle: 1,
        color: 1,
        background: 1,
        id: 1,
        "class": 1,
        href: 1,
        style: 1
      };
      BaseMethods$1.Open = function(parser2, _c) {
        parser2.Push(parser2.itemFactory.create("open"));
      };
      BaseMethods$1.Close = function(parser2, _c) {
        parser2.Push(parser2.itemFactory.create("close"));
      };
      BaseMethods$1.Tilde = function(parser2, _c) {
        parser2.Push(parser2.create("token", "mtext", {}, Entities_js_1.entities.nbsp));
      };
      BaseMethods$1.Space = function(_parser2, _c) {
      };
      BaseMethods$1.Superscript = function(parser2, _c) {
        var _a2;
        if (parser2.GetNext().match(/\d/)) {
          parser2.string = parser2.string.substr(0, parser2.i + 1) + " " + parser2.string.substr(parser2.i + 1);
        }
        var primes2;
        var base2;
        var top2 = parser2.stack.Top();
        if (top2.isKind("prime")) {
          _a2 = __read2(top2.Peek(2), 2), base2 = _a2[0], primes2 = _a2[1];
          parser2.stack.Pop();
        } else {
          base2 = parser2.stack.Prev();
          if (!base2) {
            base2 = parser2.create("token", "mi", {}, "");
          }
        }
        var movesupsub = NodeUtil_js_1.default.getProperty(base2, "movesupsub");
        var position = NodeUtil_js_1.default.isType(base2, "msubsup") ? base2.sup : base2.over;
        if (NodeUtil_js_1.default.isType(base2, "msubsup") && !NodeUtil_js_1.default.isType(base2, "msup") && NodeUtil_js_1.default.getChildAt(base2, base2.sup) || NodeUtil_js_1.default.isType(base2, "munderover") && !NodeUtil_js_1.default.isType(base2, "mover") && NodeUtil_js_1.default.getChildAt(base2, base2.over) && !NodeUtil_js_1.default.getProperty(base2, "subsupOK")) {
          throw new TexError_js_1.default("DoubleExponent", "Double exponent: use braces to clarify");
        }
        if (!NodeUtil_js_1.default.isType(base2, "msubsup") || NodeUtil_js_1.default.isType(base2, "msup")) {
          if (movesupsub) {
            if (!NodeUtil_js_1.default.isType(base2, "munderover") || NodeUtil_js_1.default.isType(base2, "mover") || NodeUtil_js_1.default.getChildAt(base2, base2.over)) {
              base2 = parser2.create("node", "munderover", [base2], { movesupsub: true });
            }
            position = base2.over;
          } else {
            base2 = parser2.create("node", "msubsup", [base2]);
            position = base2.sup;
          }
        }
        parser2.Push(parser2.itemFactory.create("subsup", base2).setProperties({
          position,
          primes: primes2,
          movesupsub
        }));
      };
      BaseMethods$1.Subscript = function(parser2, _c) {
        var _a2;
        if (parser2.GetNext().match(/\d/)) {
          parser2.string = parser2.string.substr(0, parser2.i + 1) + " " + parser2.string.substr(parser2.i + 1);
        }
        var primes2, base2;
        var top2 = parser2.stack.Top();
        if (top2.isKind("prime")) {
          _a2 = __read2(top2.Peek(2), 2), base2 = _a2[0], primes2 = _a2[1];
          parser2.stack.Pop();
        } else {
          base2 = parser2.stack.Prev();
          if (!base2) {
            base2 = parser2.create("token", "mi", {}, "");
          }
        }
        var movesupsub = NodeUtil_js_1.default.getProperty(base2, "movesupsub");
        var position = NodeUtil_js_1.default.isType(base2, "msubsup") ? base2.sub : base2.under;
        if (NodeUtil_js_1.default.isType(base2, "msubsup") && !NodeUtil_js_1.default.isType(base2, "msup") && NodeUtil_js_1.default.getChildAt(base2, base2.sub) || NodeUtil_js_1.default.isType(base2, "munderover") && !NodeUtil_js_1.default.isType(base2, "mover") && NodeUtil_js_1.default.getChildAt(base2, base2.under) && !NodeUtil_js_1.default.getProperty(base2, "subsupOK")) {
          throw new TexError_js_1.default("DoubleSubscripts", "Double subscripts: use braces to clarify");
        }
        if (!NodeUtil_js_1.default.isType(base2, "msubsup") || NodeUtil_js_1.default.isType(base2, "msup")) {
          if (movesupsub) {
            if (!NodeUtil_js_1.default.isType(base2, "munderover") || NodeUtil_js_1.default.isType(base2, "mover") || NodeUtil_js_1.default.getChildAt(base2, base2.under)) {
              base2 = parser2.create("node", "munderover", [base2], { movesupsub: true });
            }
            position = base2.under;
          } else {
            base2 = parser2.create("node", "msubsup", [base2]);
            position = base2.sub;
          }
        }
        parser2.Push(parser2.itemFactory.create("subsup", base2).setProperties({
          position,
          primes: primes2,
          movesupsub
        }));
      };
      BaseMethods$1.Prime = function(parser2, c2) {
        var base2 = parser2.stack.Prev();
        if (!base2) {
          base2 = parser2.create("node", "mi");
        }
        if (NodeUtil_js_1.default.isType(base2, "msubsup") && !NodeUtil_js_1.default.isType(base2, "msup") && NodeUtil_js_1.default.getChildAt(base2, base2.sup)) {
          throw new TexError_js_1.default("DoubleExponentPrime", "Prime causes double exponent: use braces to clarify");
        }
        var sup4 = "";
        parser2.i--;
        do {
          sup4 += Entities_js_1.entities.prime;
          parser2.i++, c2 = parser2.GetNext();
        } while (c2 === "'" || c2 === Entities_js_1.entities.rsquo);
        sup4 = ["", "′", "″", "‴", "⁗"][sup4.length] || sup4;
        var node2 = parser2.create("token", "mo", { variantForm: true }, sup4);
        parser2.Push(parser2.itemFactory.create("prime", base2, node2));
      };
      BaseMethods$1.Comment = function(parser2, _c) {
        while (parser2.i < parser2.string.length && parser2.string.charAt(parser2.i) !== "\n") {
          parser2.i++;
        }
      };
      BaseMethods$1.Hash = function(_parser2, _c) {
        throw new TexError_js_1.default("CantUseHash1", "You can't use 'macro parameter character #' in math mode");
      };
      BaseMethods$1.MathFont = function(parser2, name2, variant) {
        var text2 = parser2.GetArgument(name2);
        var mml = new TexParser_js_1.default(text2, __assign2(__assign2({}, parser2.stack.env), { font: variant, multiLetterIdentifiers: /^[a-zA-Z]+/, noAutoOP: true }), parser2.configuration).mml();
        parser2.Push(parser2.create("node", "TeXAtom", [mml]));
      };
      BaseMethods$1.SetFont = function(parser2, _name, font) {
        parser2.stack.env["font"] = font;
      };
      BaseMethods$1.SetStyle = function(parser2, _name, texStyle, style2, level) {
        parser2.stack.env["style"] = texStyle;
        parser2.stack.env["level"] = level;
        parser2.Push(parser2.itemFactory.create("style").setProperty("styles", { displaystyle: style2, scriptlevel: level }));
      };
      BaseMethods$1.SetSize = function(parser2, _name, size) {
        parser2.stack.env["size"] = size;
        parser2.Push(parser2.itemFactory.create("style").setProperty("styles", { mathsize: (0, lengths_js_1.em)(size) }));
      };
      BaseMethods$1.Spacer = function(parser2, _name, space) {
        var node2 = parser2.create("node", "mspace", [], { width: (0, lengths_js_1.em)(space) });
        var style2 = parser2.create("node", "mstyle", [node2], { scriptlevel: 0 });
        parser2.Push(style2);
      };
      BaseMethods$1.LeftRight = function(parser2, name2) {
        var first = name2.substr(1);
        parser2.Push(parser2.itemFactory.create(first, parser2.GetDelimiter(name2), parser2.stack.env.color));
      };
      BaseMethods$1.NamedFn = function(parser2, name2, id) {
        if (!id) {
          id = name2.substr(1);
        }
        var mml = parser2.create("token", "mi", { texClass: MmlNode_js_1.TEXCLASS.OP }, id);
        parser2.Push(parser2.itemFactory.create("fn", mml));
      };
      BaseMethods$1.NamedOp = function(parser2, name2, id) {
        if (!id) {
          id = name2.substr(1);
        }
        id = id.replace(/&thinsp;/, " ");
        var mml = parser2.create("token", "mo", {
          movablelimits: true,
          movesupsub: true,
          form: TexConstants_js_1.TexConstant.Form.PREFIX,
          texClass: MmlNode_js_1.TEXCLASS.OP
        }, id);
        parser2.Push(mml);
      };
      BaseMethods$1.Limits = function(parser2, _name, limits) {
        var op = parser2.stack.Prev(true);
        if (!op || NodeUtil_js_1.default.getTexClass(NodeUtil_js_1.default.getCoreMO(op)) !== MmlNode_js_1.TEXCLASS.OP && NodeUtil_js_1.default.getProperty(op, "movesupsub") == null) {
          throw new TexError_js_1.default("MisplacedLimits", "%1 is allowed only on operators", parser2.currentCS);
        }
        var top2 = parser2.stack.Top();
        var node2;
        if (NodeUtil_js_1.default.isType(op, "munderover") && !limits) {
          node2 = parser2.create("node", "msubsup");
          NodeUtil_js_1.default.copyChildren(op, node2);
          op = top2.Last = node2;
        } else if (NodeUtil_js_1.default.isType(op, "msubsup") && limits) {
          node2 = parser2.create("node", "munderover");
          NodeUtil_js_1.default.copyChildren(op, node2);
          op = top2.Last = node2;
        }
        NodeUtil_js_1.default.setProperty(op, "movesupsub", limits ? true : false);
        NodeUtil_js_1.default.setProperties(NodeUtil_js_1.default.getCoreMO(op), { "movablelimits": false });
        if (NodeUtil_js_1.default.getAttribute(op, "movablelimits") || NodeUtil_js_1.default.getProperty(op, "movablelimits")) {
          NodeUtil_js_1.default.setProperties(op, { "movablelimits": false });
        }
      };
      BaseMethods$1.Over = function(parser2, name2, open, close2) {
        var mml = parser2.itemFactory.create("over").setProperty("name", parser2.currentCS);
        if (open || close2) {
          mml.setProperty("open", open);
          mml.setProperty("close", close2);
        } else if (name2.match(/withdelims$/)) {
          mml.setProperty("open", parser2.GetDelimiter(name2));
          mml.setProperty("close", parser2.GetDelimiter(name2));
        }
        if (name2.match(/^\\above/)) {
          mml.setProperty("thickness", parser2.GetDimen(name2));
        } else if (name2.match(/^\\atop/) || open || close2) {
          mml.setProperty("thickness", 0);
        }
        parser2.Push(mml);
      };
      BaseMethods$1.Frac = function(parser2, name2) {
        var num2 = parser2.ParseArg(name2);
        var den = parser2.ParseArg(name2);
        var node2 = parser2.create("node", "mfrac", [num2, den]);
        parser2.Push(node2);
      };
      BaseMethods$1.Sqrt = function(parser2, name2) {
        var n = parser2.GetBrackets(name2);
        var arg = parser2.GetArgument(name2);
        if (arg === "\\frac") {
          arg += "{" + parser2.GetArgument(arg) + "}{" + parser2.GetArgument(arg) + "}";
        }
        var mml = new TexParser_js_1.default(arg, parser2.stack.env, parser2.configuration).mml();
        if (!n) {
          mml = parser2.create("node", "msqrt", [mml]);
        } else {
          mml = parser2.create("node", "mroot", [mml, parseRoot(parser2, n)]);
        }
        parser2.Push(mml);
      };
      function parseRoot(parser2, n) {
        var env = parser2.stack.env;
        var inRoot = env["inRoot"];
        env["inRoot"] = true;
        var newParser = new TexParser_js_1.default(n, env, parser2.configuration);
        var node2 = newParser.mml();
        var global2 = newParser.stack.global;
        if (global2["leftRoot"] || global2["upRoot"]) {
          var def = {};
          if (global2["leftRoot"]) {
            def["width"] = global2["leftRoot"];
          }
          if (global2["upRoot"]) {
            def["voffset"] = global2["upRoot"];
            def["height"] = global2["upRoot"];
          }
          node2 = parser2.create("node", "mpadded", [node2], def);
        }
        env["inRoot"] = inRoot;
        return node2;
      }
      BaseMethods$1.Root = function(parser2, name2) {
        var n = parser2.GetUpTo(name2, "\\of");
        var arg = parser2.ParseArg(name2);
        var node2 = parser2.create("node", "mroot", [arg, parseRoot(parser2, n)]);
        parser2.Push(node2);
      };
      BaseMethods$1.MoveRoot = function(parser2, name2, id) {
        if (!parser2.stack.env["inRoot"]) {
          throw new TexError_js_1.default("MisplacedMoveRoot", "%1 can appear only within a root", parser2.currentCS);
        }
        if (parser2.stack.global[id]) {
          throw new TexError_js_1.default("MultipleMoveRoot", "Multiple use of %1", parser2.currentCS);
        }
        var n = parser2.GetArgument(name2);
        if (!n.match(/-?[0-9]+/)) {
          throw new TexError_js_1.default("IntegerArg", "The argument to %1 must be an integer", parser2.currentCS);
        }
        n = parseInt(n, 10) / 15 + "em";
        if (n.substr(0, 1) !== "-") {
          n = "+" + n;
        }
        parser2.stack.global[id] = n;
      };
      BaseMethods$1.Accent = function(parser2, name2, accent, stretchy) {
        var c2 = parser2.ParseArg(name2);
        var def = __assign2(__assign2({}, ParseUtil_js_1.default.getFontDef(parser2)), { accent: true, mathaccent: true });
        var entity2 = NodeUtil_js_1.default.createEntity(accent);
        var moNode = parser2.create("token", "mo", def, entity2);
        var mml = moNode;
        NodeUtil_js_1.default.setAttribute(mml, "stretchy", stretchy ? true : false);
        var mo2 = NodeUtil_js_1.default.isEmbellished(c2) ? NodeUtil_js_1.default.getCoreMO(c2) : c2;
        if (NodeUtil_js_1.default.isType(mo2, "mo") || NodeUtil_js_1.default.getProperty(mo2, "movablelimits")) {
          NodeUtil_js_1.default.setProperties(mo2, { "movablelimits": false });
        }
        var muoNode = parser2.create("node", "munderover");
        NodeUtil_js_1.default.setChild(muoNode, 0, c2);
        NodeUtil_js_1.default.setChild(muoNode, 1, null);
        NodeUtil_js_1.default.setChild(muoNode, 2, mml);
        var texAtom = parser2.create("node", "TeXAtom", [muoNode]);
        parser2.Push(texAtom);
      };
      BaseMethods$1.UnderOver = function(parser2, name2, c2, stack2) {
        var entity2 = NodeUtil_js_1.default.createEntity(c2);
        var mo2 = parser2.create("token", "mo", { stretchy: true, accent: true }, entity2);
        var pos2 = name2.charAt(1) === "o" ? "over" : "under";
        var base2 = parser2.ParseArg(name2);
        parser2.Push(ParseUtil_js_1.default.underOver(parser2, base2, mo2, pos2, stack2));
      };
      BaseMethods$1.Overset = function(parser2, name2) {
        var top2 = parser2.ParseArg(name2);
        var base2 = parser2.ParseArg(name2);
        ParseUtil_js_1.default.checkMovableLimits(base2);
        if (top2.isKind("mo")) {
          NodeUtil_js_1.default.setAttribute(top2, "accent", false);
        }
        var node2 = parser2.create("node", "mover", [base2, top2]);
        parser2.Push(node2);
      };
      BaseMethods$1.Underset = function(parser2, name2) {
        var bot2 = parser2.ParseArg(name2);
        var base2 = parser2.ParseArg(name2);
        ParseUtil_js_1.default.checkMovableLimits(base2);
        if (bot2.isKind("mo")) {
          NodeUtil_js_1.default.setAttribute(bot2, "accent", false);
        }
        var node2 = parser2.create("node", "munder", [base2, bot2], { accentunder: false });
        parser2.Push(node2);
      };
      BaseMethods$1.Overunderset = function(parser2, name2) {
        var top2 = parser2.ParseArg(name2);
        var bot2 = parser2.ParseArg(name2);
        var base2 = parser2.ParseArg(name2);
        ParseUtil_js_1.default.checkMovableLimits(base2);
        if (top2.isKind("mo")) {
          NodeUtil_js_1.default.setAttribute(top2, "accent", false);
        }
        if (bot2.isKind("mo")) {
          NodeUtil_js_1.default.setAttribute(bot2, "accent", false);
        }
        var node2 = parser2.create("node", "munderover", [base2, bot2, top2], { accent: false, accentunder: false });
        parser2.Push(node2);
      };
      BaseMethods$1.TeXAtom = function(parser2, name2, mclass) {
        var def = { texClass: mclass };
        var mml;
        var node2;
        var parsed;
        if (mclass === MmlNode_js_1.TEXCLASS.OP) {
          def["movesupsub"] = def["movablelimits"] = true;
          var arg = parser2.GetArgument(name2);
          var match = arg.match(/^\s*\\rm\s+([a-zA-Z0-9 ]+)$/);
          if (match) {
            def["mathvariant"] = TexConstants_js_1.TexConstant.Variant.NORMAL;
            node2 = parser2.create("token", "mi", def, match[1]);
          } else {
            parsed = new TexParser_js_1.default(arg, parser2.stack.env, parser2.configuration).mml();
            node2 = parser2.create("node", "TeXAtom", [parsed], def);
          }
          mml = parser2.itemFactory.create("fn", node2);
        } else {
          parsed = parser2.ParseArg(name2);
          mml = parser2.create("node", "TeXAtom", [parsed], def);
        }
        parser2.Push(mml);
      };
      BaseMethods$1.MmlToken = function(parser2, name2) {
        var kind = parser2.GetArgument(name2);
        var attr = parser2.GetBrackets(name2, "").replace(/^\s+/, "");
        var text2 = parser2.GetArgument(name2);
        var def = {};
        var keep = [];
        var node2;
        try {
          node2 = parser2.create("node", kind);
        } catch (e) {
          node2 = null;
        }
        if (!node2 || !node2.isToken) {
          throw new TexError_js_1.default("NotMathMLToken", "%1 is not a token element", kind);
        }
        while (attr !== "") {
          var match = attr.match(/^([a-z]+)\s*=\s*('[^']*'|"[^"]*"|[^ ,]*)\s*,?\s*/i);
          if (!match) {
            throw new TexError_js_1.default("InvalidMathMLAttr", "Invalid MathML attribute: %1", attr);
          }
          if (!node2.attributes.hasDefault(match[1]) && !MmlTokenAllow[match[1]]) {
            throw new TexError_js_1.default("UnknownAttrForElement", "%1 is not a recognized attribute for %2", match[1], kind);
          }
          var value2 = ParseUtil_js_1.default.MmlFilterAttribute(parser2, match[1], match[2].replace(/^(['"])(.*)\1$/, "$2"));
          if (value2) {
            if (value2.toLowerCase() === "true") {
              value2 = true;
            } else if (value2.toLowerCase() === "false") {
              value2 = false;
            }
            def[match[1]] = value2;
            keep.push(match[1]);
          }
          attr = attr.substr(match[0].length);
        }
        if (keep.length) {
          def["mjx-keep-attrs"] = keep.join(" ");
        }
        var textNode = parser2.create("text", text2);
        node2.appendChild(textNode);
        NodeUtil_js_1.default.setProperties(node2, def);
        parser2.Push(node2);
      };
      BaseMethods$1.Strut = function(parser2, _name) {
        var row2 = parser2.create("node", "mrow");
        var padded2 = parser2.create("node", "mpadded", [row2], { height: "8.6pt", depth: "3pt", width: 0 });
        parser2.Push(padded2);
      };
      BaseMethods$1.Phantom = function(parser2, name2, v, h) {
        var box = parser2.create("node", "mphantom", [parser2.ParseArg(name2)]);
        if (v || h) {
          box = parser2.create("node", "mpadded", [box]);
          if (h) {
            NodeUtil_js_1.default.setAttribute(box, "height", 0);
            NodeUtil_js_1.default.setAttribute(box, "depth", 0);
          }
          if (v) {
            NodeUtil_js_1.default.setAttribute(box, "width", 0);
          }
        }
        var atom = parser2.create("node", "TeXAtom", [box]);
        parser2.Push(atom);
      };
      BaseMethods$1.Smash = function(parser2, name2) {
        var bt2 = ParseUtil_js_1.default.trimSpaces(parser2.GetBrackets(name2, ""));
        var smash = parser2.create("node", "mpadded", [parser2.ParseArg(name2)]);
        switch (bt2) {
          case "b":
            NodeUtil_js_1.default.setAttribute(smash, "depth", 0);
            break;
          case "t":
            NodeUtil_js_1.default.setAttribute(smash, "height", 0);
            break;
          default:
            NodeUtil_js_1.default.setAttribute(smash, "height", 0);
            NodeUtil_js_1.default.setAttribute(smash, "depth", 0);
        }
        var atom = parser2.create("node", "TeXAtom", [smash]);
        parser2.Push(atom);
      };
      BaseMethods$1.Lap = function(parser2, name2) {
        var mml = parser2.create("node", "mpadded", [parser2.ParseArg(name2)], { width: 0 });
        if (name2 === "\\llap") {
          NodeUtil_js_1.default.setAttribute(mml, "lspace", "-1width");
        }
        var atom = parser2.create("node", "TeXAtom", [mml]);
        parser2.Push(atom);
      };
      BaseMethods$1.RaiseLower = function(parser2, name2) {
        var h = parser2.GetDimen(name2);
        var item2 = parser2.itemFactory.create("position").setProperties({ name: parser2.currentCS, move: "vertical" });
        if (h.charAt(0) === "-") {
          h = h.slice(1);
          name2 = name2.substr(1) === "raise" ? "\\lower" : "\\raise";
        }
        if (name2 === "\\lower") {
          item2.setProperty("dh", "-" + h);
          item2.setProperty("dd", "+" + h);
        } else {
          item2.setProperty("dh", "+" + h);
          item2.setProperty("dd", "-" + h);
        }
        parser2.Push(item2);
      };
      BaseMethods$1.MoveLeftRight = function(parser2, name2) {
        var h = parser2.GetDimen(name2);
        var nh = h.charAt(0) === "-" ? h.slice(1) : "-" + h;
        if (name2 === "\\moveleft") {
          var tmp = h;
          h = nh;
          nh = tmp;
        }
        parser2.Push(parser2.itemFactory.create("position").setProperties({
          name: parser2.currentCS,
          move: "horizontal",
          left: parser2.create("node", "mspace", [], { width: h }),
          right: parser2.create("node", "mspace", [], { width: nh })
        }));
      };
      BaseMethods$1.Hskip = function(parser2, name2) {
        var node2 = parser2.create("node", "mspace", [], { width: parser2.GetDimen(name2) });
        parser2.Push(node2);
      };
      BaseMethods$1.Nonscript = function(parser2, _name) {
        parser2.Push(parser2.itemFactory.create("nonscript"));
      };
      BaseMethods$1.Rule = function(parser2, name2, style2) {
        var w = parser2.GetDimen(name2), h = parser2.GetDimen(name2), d = parser2.GetDimen(name2);
        var def = { width: w, height: h, depth: d };
        if (style2 !== "blank") {
          def["mathbackground"] = parser2.stack.env["color"] || "black";
        }
        var node2 = parser2.create("node", "mspace", [], def);
        parser2.Push(node2);
      };
      BaseMethods$1.rule = function(parser2, name2) {
        var v = parser2.GetBrackets(name2), w = parser2.GetDimen(name2), h = parser2.GetDimen(name2);
        var mml = parser2.create("node", "mspace", [], {
          width: w,
          height: h,
          mathbackground: parser2.stack.env["color"] || "black"
        });
        if (v) {
          mml = parser2.create("node", "mpadded", [mml], { voffset: v });
          if (v.match(/^\-/)) {
            NodeUtil_js_1.default.setAttribute(mml, "height", v);
            NodeUtil_js_1.default.setAttribute(mml, "depth", "+" + v.substr(1));
          } else {
            NodeUtil_js_1.default.setAttribute(mml, "height", "+" + v);
          }
        }
        parser2.Push(mml);
      };
      BaseMethods$1.MakeBig = function(parser2, name2, mclass, size) {
        size *= P_HEIGHT;
        var sizeStr = String(size).replace(/(\.\d\d\d).+/, "$1") + "em";
        var delim = parser2.GetDelimiter(name2, true);
        var mo2 = parser2.create("token", "mo", {
          minsize: sizeStr,
          maxsize: sizeStr,
          fence: true,
          stretchy: true,
          symmetric: true
        }, delim);
        var node2 = parser2.create("node", "TeXAtom", [mo2], { texClass: mclass });
        parser2.Push(node2);
      };
      BaseMethods$1.BuildRel = function(parser2, name2) {
        var top2 = parser2.ParseUpTo(name2, "\\over");
        var bot2 = parser2.ParseArg(name2);
        var node2 = parser2.create("node", "munderover");
        NodeUtil_js_1.default.setChild(node2, 0, bot2);
        NodeUtil_js_1.default.setChild(node2, 1, null);
        NodeUtil_js_1.default.setChild(node2, 2, top2);
        var atom = parser2.create("node", "TeXAtom", [node2], { texClass: MmlNode_js_1.TEXCLASS.REL });
        parser2.Push(atom);
      };
      BaseMethods$1.HBox = function(parser2, name2, style2, font) {
        parser2.PushAll(ParseUtil_js_1.default.internalMath(parser2, parser2.GetArgument(name2), style2, font));
      };
      BaseMethods$1.FBox = function(parser2, name2) {
        var internal = ParseUtil_js_1.default.internalMath(parser2, parser2.GetArgument(name2));
        var node2 = parser2.create("node", "menclose", internal, { notation: "box" });
        parser2.Push(node2);
      };
      BaseMethods$1.FrameBox = function(parser2, name2) {
        var width = parser2.GetBrackets(name2);
        var pos2 = parser2.GetBrackets(name2) || "c";
        var mml = ParseUtil_js_1.default.internalMath(parser2, parser2.GetArgument(name2));
        if (width) {
          mml = [parser2.create("node", "mpadded", mml, {
            width,
            "data-align": (0, Options_js_1.lookup)(pos2, { l: "left", r: "right" }, "center")
          })];
        }
        var node2 = parser2.create("node", "TeXAtom", [parser2.create("node", "menclose", mml, { notation: "box" })], { texClass: MmlNode_js_1.TEXCLASS.ORD });
        parser2.Push(node2);
      };
      BaseMethods$1.Not = function(parser2, _name) {
        parser2.Push(parser2.itemFactory.create("not"));
      };
      BaseMethods$1.Dots = function(parser2, _name) {
        var ldotsEntity = NodeUtil_js_1.default.createEntity("2026");
        var cdotsEntity = NodeUtil_js_1.default.createEntity("22EF");
        var ldots = parser2.create("token", "mo", { stretchy: false }, ldotsEntity);
        var cdots = parser2.create("token", "mo", { stretchy: false }, cdotsEntity);
        parser2.Push(parser2.itemFactory.create("dots").setProperties({
          ldots,
          cdots
        }));
      };
      BaseMethods$1.Matrix = function(parser2, _name, open, close2, align, spacing, vspacing, style2, cases, numbered) {
        var c2 = parser2.GetNext();
        if (c2 === "") {
          throw new TexError_js_1.default("MissingArgFor", "Missing argument for %1", parser2.currentCS);
        }
        if (c2 === "{") {
          parser2.i++;
        } else {
          parser2.string = c2 + "}" + parser2.string.slice(parser2.i + 1);
          parser2.i = 0;
        }
        var array = parser2.itemFactory.create("array").setProperty("requireClose", true);
        array.arraydef = {
          rowspacing: vspacing || "4pt",
          columnspacing: spacing || "1em"
        };
        if (cases) {
          array.setProperty("isCases", true);
        }
        if (numbered) {
          array.setProperty("isNumbered", true);
          array.arraydef.side = numbered;
        }
        if (open || close2) {
          array.setProperty("open", open);
          array.setProperty("close", close2);
        }
        if (style2 === "D") {
          array.arraydef.displaystyle = true;
        }
        if (align != null) {
          array.arraydef.columnalign = align;
        }
        parser2.Push(array);
      };
      BaseMethods$1.Entry = function(parser2, name2) {
        parser2.Push(parser2.itemFactory.create("cell").setProperties({ isEntry: true, name: name2 }));
        var top2 = parser2.stack.Top();
        var env = top2.getProperty("casesEnv");
        var cases = top2.getProperty("isCases");
        if (!cases && !env)
          return;
        var str2 = parser2.string;
        var braces = 0, close2 = -1, i2 = parser2.i, m = str2.length;
        var end2 = env ? new RegExp("^\\\\end\\s*\\{".concat(env.replace(/\*/, "\\*"), "\\}")) : null;
        while (i2 < m) {
          var c2 = str2.charAt(i2);
          if (c2 === "{") {
            braces++;
            i2++;
          } else if (c2 === "}") {
            if (braces === 0) {
              m = 0;
            } else {
              braces--;
              if (braces === 0 && close2 < 0) {
                close2 = i2 - parser2.i;
              }
              i2++;
            }
          } else if (c2 === "&" && braces === 0) {
            throw new TexError_js_1.default("ExtraAlignTab", "Extra alignment tab in \\cases text");
          } else if (c2 === "\\") {
            var rest = str2.substr(i2);
            if (rest.match(/^((\\cr)[^a-zA-Z]|\\\\)/) || end2 && rest.match(end2)) {
              m = 0;
            } else {
              i2 += 2;
            }
          } else {
            i2++;
          }
        }
        var text2 = str2.substr(parser2.i, i2 - parser2.i);
        if (!text2.match(/^\s*\\text[^a-zA-Z]/) || close2 !== text2.replace(/\s+$/, "").length - 1) {
          var internal = ParseUtil_js_1.default.internalMath(parser2, ParseUtil_js_1.default.trimSpaces(text2), 0);
          parser2.PushAll(internal);
          parser2.i = i2;
        }
      };
      BaseMethods$1.Cr = function(parser2, name2) {
        parser2.Push(parser2.itemFactory.create("cell").setProperties({ isCR: true, name: name2 }));
      };
      BaseMethods$1.CrLaTeX = function(parser2, name2, nobrackets) {
        if (nobrackets === void 0) {
          nobrackets = false;
        }
        var n;
        if (!nobrackets) {
          if (parser2.string.charAt(parser2.i) === "*") {
            parser2.i++;
          }
          if (parser2.string.charAt(parser2.i) === "[") {
            var dim = parser2.GetBrackets(name2, "");
            var _a2 = __read2(ParseUtil_js_1.default.matchDimen(dim), 2), value2 = _a2[0], unit = _a2[1];
            if (dim && !value2) {
              throw new TexError_js_1.default("BracketMustBeDimension", "Bracket argument to %1 must be a dimension", parser2.currentCS);
            }
            n = value2 + unit;
          }
        }
        parser2.Push(parser2.itemFactory.create("cell").setProperties({ isCR: true, name: name2, linebreak: true }));
        var top2 = parser2.stack.Top();
        var node2;
        if (top2 instanceof sitem.ArrayItem) {
          if (n) {
            top2.addRowSpacing(n);
          }
        } else {
          if (n) {
            node2 = parser2.create("node", "mspace", [], { depth: n });
            parser2.Push(node2);
          }
          node2 = parser2.create("node", "mspace", [], { linebreak: TexConstants_js_1.TexConstant.LineBreak.NEWLINE });
          parser2.Push(node2);
        }
      };
      BaseMethods$1.HLine = function(parser2, _name, style2) {
        if (style2 == null) {
          style2 = "solid";
        }
        var top2 = parser2.stack.Top();
        if (!(top2 instanceof sitem.ArrayItem) || top2.Size()) {
          throw new TexError_js_1.default("Misplaced", "Misplaced %1", parser2.currentCS);
        }
        if (!top2.table.length) {
          top2.frame.push("top");
        } else {
          var lines = top2.arraydef["rowlines"] ? top2.arraydef["rowlines"].split(/ /) : [];
          while (lines.length < top2.table.length) {
            lines.push("none");
          }
          lines[top2.table.length - 1] = style2;
          top2.arraydef["rowlines"] = lines.join(" ");
        }
      };
      BaseMethods$1.HFill = function(parser2, _name) {
        var top2 = parser2.stack.Top();
        if (top2 instanceof sitem.ArrayItem) {
          top2.hfill.push(top2.Size());
        } else {
          throw new TexError_js_1.default("UnsupportedHFill", "Unsupported use of %1", parser2.currentCS);
        }
      };
      BaseMethods$1.BeginEnd = function(parser2, name2) {
        var env = parser2.GetArgument(name2);
        if (env.match(/\\/i)) {
          throw new TexError_js_1.default("InvalidEnv", "Invalid environment name '%1'", env);
        }
        var macro = parser2.configuration.handlers.get("environment").lookup(env);
        if (macro && name2 === "\\end") {
          if (!macro.args[0]) {
            var mml = parser2.itemFactory.create("end").setProperty("name", env);
            parser2.Push(mml);
            return;
          }
          parser2.stack.env["closing"] = env;
        }
        ParseUtil_js_1.default.checkMaxMacros(parser2, false);
        parser2.parse("environment", [parser2, env]);
      };
      BaseMethods$1.Array = function(parser2, begin, open, close2, align, spacing, vspacing, style2, raggedHeight) {
        if (!align) {
          align = parser2.GetArgument("\\begin{" + begin.getName() + "}");
        }
        var lines = ("c" + align).replace(/[^clr|:]/g, "").replace(/[^|:]([|:])+/g, "$1");
        align = align.replace(/[^clr]/g, "").split("").join(" ");
        align = align.replace(/l/g, "left").replace(/r/g, "right").replace(/c/g, "center");
        var array = parser2.itemFactory.create("array");
        array.arraydef = {
          columnalign: align,
          columnspacing: spacing || "1em",
          rowspacing: vspacing || "4pt"
        };
        if (lines.match(/[|:]/)) {
          if (lines.charAt(0).match(/[|:]/)) {
            array.frame.push("left");
            array.dashed = lines.charAt(0) === ":";
          }
          if (lines.charAt(lines.length - 1).match(/[|:]/)) {
            array.frame.push("right");
          }
          lines = lines.substr(1, lines.length - 2);
          array.arraydef.columnlines = lines.split("").join(" ").replace(/[^|: ]/g, "none").replace(/\|/g, "solid").replace(/:/g, "dashed");
        }
        if (open) {
          array.setProperty("open", parser2.convertDelimiter(open));
        }
        if (close2) {
          array.setProperty("close", parser2.convertDelimiter(close2));
        }
        if ((style2 || "").charAt(1) === "'") {
          array.arraydef["data-cramped"] = true;
          style2 = style2.charAt(0);
        }
        if (style2 === "D") {
          array.arraydef["displaystyle"] = true;
        } else if (style2) {
          array.arraydef["displaystyle"] = false;
        }
        if (style2 === "S") {
          array.arraydef["scriptlevel"] = 1;
        }
        if (raggedHeight) {
          array.arraydef["useHeight"] = false;
        }
        parser2.Push(begin);
        return array;
      };
      BaseMethods$1.AlignedArray = function(parser2, begin) {
        var align = parser2.GetBrackets("\\begin{" + begin.getName() + "}");
        var item2 = BaseMethods$1.Array(parser2, begin);
        return ParseUtil_js_1.default.setArrayAlign(item2, align);
      };
      BaseMethods$1.Equation = function(parser2, begin, numbered) {
        parser2.Push(begin);
        ParseUtil_js_1.default.checkEqnEnv(parser2);
        return parser2.itemFactory.create("equation", numbered).setProperty("name", begin.getName());
      };
      BaseMethods$1.EqnArray = function(parser2, begin, numbered, taggable, align, spacing) {
        parser2.Push(begin);
        if (taggable) {
          ParseUtil_js_1.default.checkEqnEnv(parser2);
        }
        align = align.replace(/[^clr]/g, "").split("").join(" ");
        align = align.replace(/l/g, "left").replace(/r/g, "right").replace(/c/g, "center");
        var newItem = parser2.itemFactory.create("eqnarray", begin.getName(), numbered, taggable, parser2.stack.global);
        newItem.arraydef = {
          displaystyle: true,
          columnalign: align,
          columnspacing: spacing || "1em",
          rowspacing: "3pt",
          side: parser2.options["tagSide"],
          minlabelspacing: parser2.options["tagIndent"]
        };
        return newItem;
      };
      BaseMethods$1.HandleNoTag = function(parser2, _name) {
        parser2.tags.notag();
      };
      BaseMethods$1.HandleLabel = function(parser2, name2) {
        var label2 = parser2.GetArgument(name2);
        if (label2 === "") {
          return;
        }
        if (!parser2.tags.refUpdate) {
          if (parser2.tags.label) {
            throw new TexError_js_1.default("MultipleCommand", "Multiple %1", parser2.currentCS);
          }
          parser2.tags.label = label2;
          if ((parser2.tags.allLabels[label2] || parser2.tags.labels[label2]) && !parser2.options["ignoreDuplicateLabels"]) {
            throw new TexError_js_1.default("MultipleLabel", "Label '%1' multiply defined", label2);
          }
          parser2.tags.labels[label2] = new Tags_js_1.Label();
        }
      };
      BaseMethods$1.HandleRef = function(parser2, name2, eqref) {
        var label2 = parser2.GetArgument(name2);
        var ref = parser2.tags.allLabels[label2] || parser2.tags.labels[label2];
        if (!ref) {
          if (!parser2.tags.refUpdate) {
            parser2.tags.redo = true;
          }
          ref = new Tags_js_1.Label();
        }
        var tag = ref.tag;
        if (eqref) {
          tag = parser2.tags.formatTag(tag);
        }
        var node2 = parser2.create("node", "mrow", ParseUtil_js_1.default.internalMath(parser2, tag), {
          href: parser2.tags.formatUrl(ref.id, parser2.options.baseURL),
          "class": "MathJax_ref"
        });
        parser2.Push(node2);
      };
      BaseMethods$1.Macro = function(parser2, name2, macro, argcount, def) {
        if (argcount) {
          var args2 = [];
          if (def != null) {
            var optional = parser2.GetBrackets(name2);
            args2.push(optional == null ? def : optional);
          }
          for (var i2 = args2.length; i2 < argcount; i2++) {
            args2.push(parser2.GetArgument(name2));
          }
          macro = ParseUtil_js_1.default.substituteArgs(parser2, args2, macro);
        }
        parser2.string = ParseUtil_js_1.default.addArgs(parser2, macro, parser2.string.slice(parser2.i));
        parser2.i = 0;
        ParseUtil_js_1.default.checkMaxMacros(parser2);
      };
      BaseMethods$1.MathChoice = function(parser2, name2) {
        var D2 = parser2.ParseArg(name2);
        var T = parser2.ParseArg(name2);
        var S = parser2.ParseArg(name2);
        var SS = parser2.ParseArg(name2);
        parser2.Push(parser2.create("node", "MathChoice", [D2, T, S, SS]));
      };
      BaseMethods.default = BaseMethods$1;
      return BaseMethods;
    }
    var ParseMethods = {};
    var hasRequiredParseMethods;
    function requireParseMethods() {
      if (hasRequiredParseMethods) return ParseMethods;
      hasRequiredParseMethods = 1;
      var __read2 = ParseMethods && ParseMethods.__read || function(o, n) {
        var m = typeof Symbol === "function" && o[Symbol.iterator];
        if (!m) return o;
        var i2 = m.call(o), r2, ar2 = [], e;
        try {
          while ((n === void 0 || n-- > 0) && !(r2 = i2.next()).done) ar2.push(r2.value);
        } catch (error2) {
          e = { error: error2 };
        } finally {
          try {
            if (r2 && !r2.done && (m = i2["return"])) m.call(i2);
          } finally {
            if (e) throw e.error;
          }
        }
        return ar2;
      };
      var __spreadArray2 = ParseMethods && ParseMethods.__spreadArray || function(to2, from, pack) {
        if (pack || arguments.length === 2) for (var i2 = 0, l = from.length, ar2; i2 < l; i2++) {
          if (ar2 || !(i2 in from)) {
            if (!ar2) ar2 = Array.prototype.slice.call(from, 0, i2);
            ar2[i2] = from[i2];
          }
        }
        return to2.concat(ar2 || Array.prototype.slice.call(from));
      };
      var __importDefault2 = ParseMethods && ParseMethods.__importDefault || function(mod2) {
        return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
      };
      Object.defineProperty(ParseMethods, "__esModule", { value: true });
      var NodeUtil_js_1 = __importDefault2(requireNodeUtil());
      var TexConstants_js_1 = requireTexConstants();
      var ParseUtil_js_1 = __importDefault2(requireParseUtil());
      var ParseMethods$1;
      (function(ParseMethods2) {
        function variable(parser2, c2) {
          var def = ParseUtil_js_1.default.getFontDef(parser2);
          var env = parser2.stack.env;
          if (env.multiLetterIdentifiers && env.font !== "") {
            c2 = parser2.string.substr(parser2.i - 1).match(env.multiLetterIdentifiers)[0];
            parser2.i += c2.length - 1;
            if (def.mathvariant === TexConstants_js_1.TexConstant.Variant.NORMAL && env.noAutoOP && c2.length > 1) {
              def.autoOP = false;
            }
          }
          var node2 = parser2.create("token", "mi", def, c2);
          parser2.Push(node2);
        }
        ParseMethods2.variable = variable;
        function digit(parser2, c2) {
          var mml;
          var pattern = parser2.configuration.options["digits"];
          var n = parser2.string.slice(parser2.i - 1).match(pattern);
          var def = ParseUtil_js_1.default.getFontDef(parser2);
          if (n) {
            mml = parser2.create("token", "mn", def, n[0].replace(/[{}]/g, ""));
            parser2.i += n[0].length - 1;
          } else {
            mml = parser2.create("token", "mo", def, c2);
          }
          parser2.Push(mml);
        }
        ParseMethods2.digit = digit;
        function controlSequence(parser2, _c) {
          var name2 = parser2.GetCS();
          parser2.parse("macro", [parser2, name2]);
        }
        ParseMethods2.controlSequence = controlSequence;
        function mathchar0mi(parser2, mchar) {
          var def = mchar.attributes || { mathvariant: TexConstants_js_1.TexConstant.Variant.ITALIC };
          var node2 = parser2.create("token", "mi", def, mchar.char);
          parser2.Push(node2);
        }
        ParseMethods2.mathchar0mi = mathchar0mi;
        function mathchar0mo(parser2, mchar) {
          var def = mchar.attributes || {};
          def["stretchy"] = false;
          var node2 = parser2.create("token", "mo", def, mchar.char);
          NodeUtil_js_1.default.setProperty(node2, "fixStretchy", true);
          parser2.configuration.addNode("fixStretchy", node2);
          parser2.Push(node2);
        }
        ParseMethods2.mathchar0mo = mathchar0mo;
        function mathchar7(parser2, mchar) {
          var def = mchar.attributes || { mathvariant: TexConstants_js_1.TexConstant.Variant.NORMAL };
          if (parser2.stack.env["font"]) {
            def["mathvariant"] = parser2.stack.env["font"];
          }
          var node2 = parser2.create("token", "mi", def, mchar.char);
          parser2.Push(node2);
        }
        ParseMethods2.mathchar7 = mathchar7;
        function delimiter2(parser2, delim) {
          var def = delim.attributes || {};
          def = Object.assign({ fence: false, stretchy: false }, def);
          var node2 = parser2.create("token", "mo", def, delim.char);
          parser2.Push(node2);
        }
        ParseMethods2.delimiter = delimiter2;
        function environment(parser2, env, func, args2) {
          var end2 = args2[0];
          var mml = parser2.itemFactory.create("begin").setProperties({ name: env, end: end2 });
          mml = func.apply(void 0, __spreadArray2([parser2, mml], __read2(args2.slice(1)), false));
          parser2.Push(mml);
        }
        ParseMethods2.environment = environment;
      })(ParseMethods$1 || (ParseMethods$1 = {}));
      ParseMethods.default = ParseMethods$1;
      return ParseMethods;
    }
    var hasRequiredBaseMappings;
    function requireBaseMappings() {
      if (hasRequiredBaseMappings) return BaseMappings;
      hasRequiredBaseMappings = 1;
      var __createBinding2 = BaseMappings && BaseMappings.__createBinding || (Object.create ? (function(o, m, k2, k22) {
        if (k22 === void 0) k22 = k2;
        var desc = Object.getOwnPropertyDescriptor(m, k2);
        if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
          desc = { enumerable: true, get: function() {
            return m[k2];
          } };
        }
        Object.defineProperty(o, k22, desc);
      }) : (function(o, m, k2, k22) {
        if (k22 === void 0) k22 = k2;
        o[k22] = m[k2];
      }));
      var __setModuleDefault2 = BaseMappings && BaseMappings.__setModuleDefault || (Object.create ? (function(o, v) {
        Object.defineProperty(o, "default", { enumerable: true, value: v });
      }) : function(o, v) {
        o["default"] = v;
      });
      var __importStar2 = BaseMappings && BaseMappings.__importStar || function(mod2) {
        if (mod2 && mod2.__esModule) return mod2;
        var result2 = {};
        if (mod2 != null) {
          for (var k2 in mod2) if (k2 !== "default" && Object.prototype.hasOwnProperty.call(mod2, k2)) __createBinding2(result2, mod2, k2);
        }
        __setModuleDefault2(result2, mod2);
        return result2;
      };
      var __importDefault2 = BaseMappings && BaseMappings.__importDefault || function(mod2) {
        return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
      };
      Object.defineProperty(BaseMappings, "__esModule", { value: true });
      var sm = __importStar2(requireSymbolMap());
      var TexConstants_js_1 = requireTexConstants();
      var BaseMethods_js_1 = __importDefault2(requireBaseMethods());
      var ParseMethods_js_1 = __importDefault2(requireParseMethods());
      var ParseUtil_js_1 = __importDefault2(requireParseUtil());
      var MmlNode_js_1 = requireMmlNode();
      var lengths_js_1 = requireLengths();
      new sm.RegExpMap("letter", ParseMethods_js_1.default.variable, /[a-z]/i);
      new sm.RegExpMap("digit", ParseMethods_js_1.default.digit, /[0-9.,]/);
      new sm.RegExpMap("command", ParseMethods_js_1.default.controlSequence, /^\\/);
      new sm.MacroMap("special", {
        "{": "Open",
        "}": "Close",
        "~": "Tilde",
        "^": "Superscript",
        "_": "Subscript",
        " ": "Space",
        "	": "Space",
        "\r": "Space",
        "\n": "Space",
        "'": "Prime",
        "%": "Comment",
        "&": "Entry",
        "#": "Hash",
        " ": "Space",
        "’": "Prime"
      }, BaseMethods_js_1.default);
      new sm.CharacterMap("mathchar0mi", ParseMethods_js_1.default.mathchar0mi, {
        alpha: "α",
        beta: "β",
        gamma: "γ",
        delta: "δ",
        epsilon: "ϵ",
        zeta: "ζ",
        eta: "η",
        theta: "θ",
        iota: "ι",
        kappa: "κ",
        lambda: "λ",
        mu: "μ",
        nu: "ν",
        xi: "ξ",
        omicron: "ο",
        pi: "π",
        rho: "ρ",
        sigma: "σ",
        tau: "τ",
        upsilon: "υ",
        phi: "ϕ",
        chi: "χ",
        psi: "ψ",
        omega: "ω",
        varepsilon: "ε",
        vartheta: "ϑ",
        varpi: "ϖ",
        varrho: "ϱ",
        varsigma: "ς",
        varphi: "φ",
        S: ["§", { mathvariant: TexConstants_js_1.TexConstant.Variant.NORMAL }],
        aleph: ["ℵ", { mathvariant: TexConstants_js_1.TexConstant.Variant.NORMAL }],
        hbar: ["ℏ", { variantForm: true }],
        imath: "ı",
        jmath: "ȷ",
        ell: "ℓ",
        wp: ["℘", { mathvariant: TexConstants_js_1.TexConstant.Variant.NORMAL }],
        Re: ["ℜ", { mathvariant: TexConstants_js_1.TexConstant.Variant.NORMAL }],
        Im: ["ℑ", { mathvariant: TexConstants_js_1.TexConstant.Variant.NORMAL }],
        partial: ["∂", { mathvariant: TexConstants_js_1.TexConstant.Variant.ITALIC }],
        infty: ["∞", { mathvariant: TexConstants_js_1.TexConstant.Variant.NORMAL }],
        prime: ["′", { variantForm: true }],
        emptyset: ["∅", { mathvariant: TexConstants_js_1.TexConstant.Variant.NORMAL }],
        nabla: ["∇", { mathvariant: TexConstants_js_1.TexConstant.Variant.NORMAL }],
        top: ["⊤", { mathvariant: TexConstants_js_1.TexConstant.Variant.NORMAL }],
        bot: ["⊥", { mathvariant: TexConstants_js_1.TexConstant.Variant.NORMAL }],
        angle: ["∠", { mathvariant: TexConstants_js_1.TexConstant.Variant.NORMAL }],
        triangle: ["△", { mathvariant: TexConstants_js_1.TexConstant.Variant.NORMAL }],
        backslash: ["∖", { mathvariant: TexConstants_js_1.TexConstant.Variant.NORMAL }],
        forall: ["∀", { mathvariant: TexConstants_js_1.TexConstant.Variant.NORMAL }],
        exists: ["∃", { mathvariant: TexConstants_js_1.TexConstant.Variant.NORMAL }],
        neg: ["¬", { mathvariant: TexConstants_js_1.TexConstant.Variant.NORMAL }],
        lnot: ["¬", { mathvariant: TexConstants_js_1.TexConstant.Variant.NORMAL }],
        flat: ["♭", { mathvariant: TexConstants_js_1.TexConstant.Variant.NORMAL }],
        natural: ["♮", { mathvariant: TexConstants_js_1.TexConstant.Variant.NORMAL }],
        sharp: ["♯", { mathvariant: TexConstants_js_1.TexConstant.Variant.NORMAL }],
        clubsuit: ["♣", { mathvariant: TexConstants_js_1.TexConstant.Variant.NORMAL }],
        diamondsuit: ["♢", { mathvariant: TexConstants_js_1.TexConstant.Variant.NORMAL }],
        heartsuit: ["♡", { mathvariant: TexConstants_js_1.TexConstant.Variant.NORMAL }],
        spadesuit: ["♠", { mathvariant: TexConstants_js_1.TexConstant.Variant.NORMAL }]
      });
      new sm.CharacterMap("mathchar0mo", ParseMethods_js_1.default.mathchar0mo, {
        surd: "√",
        coprod: ["∐", {
          texClass: MmlNode_js_1.TEXCLASS.OP,
          movesupsub: true
        }],
        bigvee: ["⋁", {
          texClass: MmlNode_js_1.TEXCLASS.OP,
          movesupsub: true
        }],
        bigwedge: ["⋀", {
          texClass: MmlNode_js_1.TEXCLASS.OP,
          movesupsub: true
        }],
        biguplus: ["⨄", {
          texClass: MmlNode_js_1.TEXCLASS.OP,
          movesupsub: true
        }],
        bigcap: ["⋂", {
          texClass: MmlNode_js_1.TEXCLASS.OP,
          movesupsub: true
        }],
        bigcup: ["⋃", {
          texClass: MmlNode_js_1.TEXCLASS.OP,
          movesupsub: true
        }],
        "int": ["∫", { texClass: MmlNode_js_1.TEXCLASS.OP }],
        intop: ["∫", {
          texClass: MmlNode_js_1.TEXCLASS.OP,
          movesupsub: true,
          movablelimits: true
        }],
        iint: ["∬", { texClass: MmlNode_js_1.TEXCLASS.OP }],
        iiint: ["∭", { texClass: MmlNode_js_1.TEXCLASS.OP }],
        prod: ["∏", {
          texClass: MmlNode_js_1.TEXCLASS.OP,
          movesupsub: true
        }],
        sum: ["∑", {
          texClass: MmlNode_js_1.TEXCLASS.OP,
          movesupsub: true
        }],
        bigotimes: ["⨂", {
          texClass: MmlNode_js_1.TEXCLASS.OP,
          movesupsub: true
        }],
        bigoplus: ["⨁", {
          texClass: MmlNode_js_1.TEXCLASS.OP,
          movesupsub: true
        }],
        bigodot: ["⨀", {
          texClass: MmlNode_js_1.TEXCLASS.OP,
          movesupsub: true
        }],
        oint: ["∮", { texClass: MmlNode_js_1.TEXCLASS.OP }],
        bigsqcup: ["⨆", {
          texClass: MmlNode_js_1.TEXCLASS.OP,
          movesupsub: true
        }],
        smallint: ["∫", { largeop: false }],
        triangleleft: "◃",
        triangleright: "▹",
        bigtriangleup: "△",
        bigtriangledown: "▽",
        wedge: "∧",
        land: "∧",
        vee: "∨",
        lor: "∨",
        cap: "∩",
        cup: "∪",
        ddagger: "‡",
        dagger: "†",
        sqcap: "⊓",
        sqcup: "⊔",
        uplus: "⊎",
        amalg: "⨿",
        diamond: "⋄",
        bullet: "∙",
        wr: "≀",
        div: "÷",
        divsymbol: "÷",
        odot: ["⊙", { largeop: false }],
        oslash: ["⊘", { largeop: false }],
        otimes: ["⊗", { largeop: false }],
        ominus: ["⊖", { largeop: false }],
        oplus: ["⊕", { largeop: false }],
        mp: "∓",
        pm: "±",
        circ: "∘",
        bigcirc: "◯",
        setminus: "∖",
        cdot: "⋅",
        ast: "∗",
        times: "×",
        star: "⋆",
        propto: "∝",
        sqsubseteq: "⊑",
        sqsupseteq: "⊒",
        parallel: "∥",
        mid: "∣",
        dashv: "⊣",
        vdash: "⊢",
        leq: "≤",
        le: "≤",
        geq: "≥",
        ge: "≥",
        lt: "<",
        gt: ">",
        succ: "≻",
        prec: "≺",
        approx: "≈",
        succeq: "⪰",
        preceq: "⪯",
        supset: "⊃",
        subset: "⊂",
        supseteq: "⊇",
        subseteq: "⊆",
        "in": "∈",
        ni: "∋",
        notin: "∉",
        owns: "∋",
        gg: "≫",
        ll: "≪",
        sim: "∼",
        simeq: "≃",
        perp: "⊥",
        equiv: "≡",
        asymp: "≍",
        smile: "⌣",
        frown: "⌢",
        ne: "≠",
        neq: "≠",
        cong: "≅",
        doteq: "≐",
        bowtie: "⋈",
        models: "⊨",
        notChar: "⧸",
        Leftrightarrow: "⇔",
        Leftarrow: "⇐",
        Rightarrow: "⇒",
        leftrightarrow: "↔",
        leftarrow: "←",
        gets: "←",
        rightarrow: "→",
        to: ["→", { accent: false }],
        mapsto: "↦",
        leftharpoonup: "↼",
        leftharpoondown: "↽",
        rightharpoonup: "⇀",
        rightharpoondown: "⇁",
        nearrow: "↗",
        searrow: "↘",
        nwarrow: "↖",
        swarrow: "↙",
        rightleftharpoons: "⇌",
        hookrightarrow: "↪",
        hookleftarrow: "↩",
        longleftarrow: "⟵",
        Longleftarrow: "⟸",
        longrightarrow: "⟶",
        Longrightarrow: "⟹",
        Longleftrightarrow: "⟺",
        longleftrightarrow: "⟷",
        longmapsto: "⟼",
        ldots: "…",
        cdots: "⋯",
        vdots: "⋮",
        ddots: "⋱",
        dotsc: "…",
        dotsb: "⋯",
        dotsm: "⋯",
        dotsi: "⋯",
        dotso: "…",
        ldotp: [".", { texClass: MmlNode_js_1.TEXCLASS.PUNCT }],
        cdotp: ["⋅", { texClass: MmlNode_js_1.TEXCLASS.PUNCT }],
        colon: [":", { texClass: MmlNode_js_1.TEXCLASS.PUNCT }]
      });
      new sm.CharacterMap("mathchar7", ParseMethods_js_1.default.mathchar7, {
        Gamma: "Γ",
        Delta: "Δ",
        Theta: "Θ",
        Lambda: "Λ",
        Xi: "Ξ",
        Pi: "Π",
        Sigma: "Σ",
        Upsilon: "Υ",
        Phi: "Φ",
        Psi: "Ψ",
        Omega: "Ω",
        "_": "_",
        "#": "#",
        "$": "$",
        "%": "%",
        "&": "&",
        And: "&"
      });
      new sm.DelimiterMap("delimiter", ParseMethods_js_1.default.delimiter, {
        "(": "(",
        ")": ")",
        "[": "[",
        "]": "]",
        "<": "⟨",
        ">": "⟩",
        "\\lt": "⟨",
        "\\gt": "⟩",
        "/": "/",
        "|": ["|", { texClass: MmlNode_js_1.TEXCLASS.ORD }],
        ".": "",
        "\\\\": "\\",
        "\\lmoustache": "⎰",
        "\\rmoustache": "⎱",
        "\\lgroup": "⟮",
        "\\rgroup": "⟯",
        "\\arrowvert": "⏐",
        "\\Arrowvert": "‖",
        "\\bracevert": "⎪",
        "\\Vert": ["‖", { texClass: MmlNode_js_1.TEXCLASS.ORD }],
        "\\|": ["‖", { texClass: MmlNode_js_1.TEXCLASS.ORD }],
        "\\vert": ["|", { texClass: MmlNode_js_1.TEXCLASS.ORD }],
        "\\uparrow": "↑",
        "\\downarrow": "↓",
        "\\updownarrow": "↕",
        "\\Uparrow": "⇑",
        "\\Downarrow": "⇓",
        "\\Updownarrow": "⇕",
        "\\backslash": "\\",
        "\\rangle": "⟩",
        "\\langle": "⟨",
        "\\rbrace": "}",
        "\\lbrace": "{",
        "\\}": "}",
        "\\{": "{",
        "\\rceil": "⌉",
        "\\lceil": "⌈",
        "\\rfloor": "⌋",
        "\\lfloor": "⌊",
        "\\lbrack": "[",
        "\\rbrack": "]"
      });
      new sm.CommandMap("macros", {
        displaystyle: ["SetStyle", "D", true, 0],
        textstyle: ["SetStyle", "T", false, 0],
        scriptstyle: ["SetStyle", "S", false, 1],
        scriptscriptstyle: ["SetStyle", "SS", false, 2],
        rm: ["SetFont", TexConstants_js_1.TexConstant.Variant.NORMAL],
        mit: ["SetFont", TexConstants_js_1.TexConstant.Variant.ITALIC],
        oldstyle: ["SetFont", TexConstants_js_1.TexConstant.Variant.OLDSTYLE],
        cal: ["SetFont", TexConstants_js_1.TexConstant.Variant.CALLIGRAPHIC],
        it: ["SetFont", TexConstants_js_1.TexConstant.Variant.MATHITALIC],
        bf: ["SetFont", TexConstants_js_1.TexConstant.Variant.BOLD],
        bbFont: ["SetFont", TexConstants_js_1.TexConstant.Variant.DOUBLESTRUCK],
        scr: ["SetFont", TexConstants_js_1.TexConstant.Variant.SCRIPT],
        frak: ["SetFont", TexConstants_js_1.TexConstant.Variant.FRAKTUR],
        sf: ["SetFont", TexConstants_js_1.TexConstant.Variant.SANSSERIF],
        tt: ["SetFont", TexConstants_js_1.TexConstant.Variant.MONOSPACE],
        mathrm: ["MathFont", TexConstants_js_1.TexConstant.Variant.NORMAL],
        mathup: ["MathFont", TexConstants_js_1.TexConstant.Variant.NORMAL],
        mathnormal: ["MathFont", ""],
        mathbf: ["MathFont", TexConstants_js_1.TexConstant.Variant.BOLD],
        mathbfup: ["MathFont", TexConstants_js_1.TexConstant.Variant.BOLD],
        mathit: ["MathFont", TexConstants_js_1.TexConstant.Variant.MATHITALIC],
        mathbfit: ["MathFont", TexConstants_js_1.TexConstant.Variant.BOLDITALIC],
        mathbb: ["MathFont", TexConstants_js_1.TexConstant.Variant.DOUBLESTRUCK],
        Bbb: ["MathFont", TexConstants_js_1.TexConstant.Variant.DOUBLESTRUCK],
        mathfrak: ["MathFont", TexConstants_js_1.TexConstant.Variant.FRAKTUR],
        mathbffrak: ["MathFont", TexConstants_js_1.TexConstant.Variant.BOLDFRAKTUR],
        mathscr: ["MathFont", TexConstants_js_1.TexConstant.Variant.SCRIPT],
        mathbfscr: ["MathFont", TexConstants_js_1.TexConstant.Variant.BOLDSCRIPT],
        mathsf: ["MathFont", TexConstants_js_1.TexConstant.Variant.SANSSERIF],
        mathsfup: ["MathFont", TexConstants_js_1.TexConstant.Variant.SANSSERIF],
        mathbfsf: ["MathFont", TexConstants_js_1.TexConstant.Variant.BOLDSANSSERIF],
        mathbfsfup: ["MathFont", TexConstants_js_1.TexConstant.Variant.BOLDSANSSERIF],
        mathsfit: ["MathFont", TexConstants_js_1.TexConstant.Variant.SANSSERIFITALIC],
        mathbfsfit: ["MathFont", TexConstants_js_1.TexConstant.Variant.SANSSERIFBOLDITALIC],
        mathtt: ["MathFont", TexConstants_js_1.TexConstant.Variant.MONOSPACE],
        mathcal: ["MathFont", TexConstants_js_1.TexConstant.Variant.CALLIGRAPHIC],
        mathbfcal: ["MathFont", TexConstants_js_1.TexConstant.Variant.BOLDCALLIGRAPHIC],
        symrm: ["MathFont", TexConstants_js_1.TexConstant.Variant.NORMAL],
        symup: ["MathFont", TexConstants_js_1.TexConstant.Variant.NORMAL],
        symnormal: ["MathFont", ""],
        symbf: ["MathFont", TexConstants_js_1.TexConstant.Variant.BOLD],
        symbfup: ["MathFont", TexConstants_js_1.TexConstant.Variant.BOLD],
        symit: ["MathFont", TexConstants_js_1.TexConstant.Variant.ITALIC],
        symbfit: ["MathFont", TexConstants_js_1.TexConstant.Variant.BOLDITALIC],
        symbb: ["MathFont", TexConstants_js_1.TexConstant.Variant.DOUBLESTRUCK],
        symfrak: ["MathFont", TexConstants_js_1.TexConstant.Variant.FRAKTUR],
        symbffrak: ["MathFont", TexConstants_js_1.TexConstant.Variant.BOLDFRAKTUR],
        symscr: ["MathFont", TexConstants_js_1.TexConstant.Variant.SCRIPT],
        symbfscr: ["MathFont", TexConstants_js_1.TexConstant.Variant.BOLDSCRIPT],
        symsf: ["MathFont", TexConstants_js_1.TexConstant.Variant.SANSSERIF],
        symsfup: ["MathFont", TexConstants_js_1.TexConstant.Variant.SANSSERIF],
        symbfsf: ["MathFont", TexConstants_js_1.TexConstant.Variant.BOLDSANSSERIF],
        symbfsfup: ["MathFont", TexConstants_js_1.TexConstant.Variant.BOLDSANSSERIF],
        symsfit: ["MathFont", TexConstants_js_1.TexConstant.Variant.SANSSERIFITALIC],
        symbfsfit: ["MathFont", TexConstants_js_1.TexConstant.Variant.SANSSERIFBOLDITALIC],
        symtt: ["MathFont", TexConstants_js_1.TexConstant.Variant.MONOSPACE],
        symcal: ["MathFont", TexConstants_js_1.TexConstant.Variant.CALLIGRAPHIC],
        symbfcal: ["MathFont", TexConstants_js_1.TexConstant.Variant.BOLDCALLIGRAPHIC],
        textrm: ["HBox", null, TexConstants_js_1.TexConstant.Variant.NORMAL],
        textup: ["HBox", null, TexConstants_js_1.TexConstant.Variant.NORMAL],
        textnormal: ["HBox"],
        textit: ["HBox", null, TexConstants_js_1.TexConstant.Variant.ITALIC],
        textbf: ["HBox", null, TexConstants_js_1.TexConstant.Variant.BOLD],
        textsf: ["HBox", null, TexConstants_js_1.TexConstant.Variant.SANSSERIF],
        texttt: ["HBox", null, TexConstants_js_1.TexConstant.Variant.MONOSPACE],
        tiny: ["SetSize", 0.5],
        Tiny: ["SetSize", 0.6],
        scriptsize: ["SetSize", 0.7],
        small: ["SetSize", 0.85],
        normalsize: ["SetSize", 1],
        large: ["SetSize", 1.2],
        Large: ["SetSize", 1.44],
        LARGE: ["SetSize", 1.73],
        huge: ["SetSize", 2.07],
        Huge: ["SetSize", 2.49],
        arcsin: "NamedFn",
        arccos: "NamedFn",
        arctan: "NamedFn",
        arg: "NamedFn",
        cos: "NamedFn",
        cosh: "NamedFn",
        cot: "NamedFn",
        coth: "NamedFn",
        csc: "NamedFn",
        deg: "NamedFn",
        det: "NamedOp",
        dim: "NamedFn",
        exp: "NamedFn",
        gcd: "NamedOp",
        hom: "NamedFn",
        inf: "NamedOp",
        ker: "NamedFn",
        lg: "NamedFn",
        lim: "NamedOp",
        liminf: ["NamedOp", "lim&thinsp;inf"],
        limsup: ["NamedOp", "lim&thinsp;sup"],
        ln: "NamedFn",
        log: "NamedFn",
        max: "NamedOp",
        min: "NamedOp",
        Pr: "NamedOp",
        sec: "NamedFn",
        sin: "NamedFn",
        sinh: "NamedFn",
        sup: "NamedOp",
        tan: "NamedFn",
        tanh: "NamedFn",
        limits: ["Limits", 1],
        nolimits: ["Limits", 0],
        overline: ["UnderOver", "2015"],
        underline: ["UnderOver", "2015"],
        overbrace: ["UnderOver", "23DE", 1],
        underbrace: ["UnderOver", "23DF", 1],
        overparen: ["UnderOver", "23DC"],
        underparen: ["UnderOver", "23DD"],
        overrightarrow: ["UnderOver", "2192"],
        underrightarrow: ["UnderOver", "2192"],
        overleftarrow: ["UnderOver", "2190"],
        underleftarrow: ["UnderOver", "2190"],
        overleftrightarrow: ["UnderOver", "2194"],
        underleftrightarrow: ["UnderOver", "2194"],
        overset: "Overset",
        underset: "Underset",
        overunderset: "Overunderset",
        stackrel: ["Macro", "\\mathrel{\\mathop{#2}\\limits^{#1}}", 2],
        stackbin: ["Macro", "\\mathbin{\\mathop{#2}\\limits^{#1}}", 2],
        over: "Over",
        overwithdelims: "Over",
        atop: "Over",
        atopwithdelims: "Over",
        above: "Over",
        abovewithdelims: "Over",
        brace: ["Over", "{", "}"],
        brack: ["Over", "[", "]"],
        choose: ["Over", "(", ")"],
        frac: "Frac",
        sqrt: "Sqrt",
        root: "Root",
        uproot: ["MoveRoot", "upRoot"],
        leftroot: ["MoveRoot", "leftRoot"],
        left: "LeftRight",
        right: "LeftRight",
        middle: "LeftRight",
        llap: "Lap",
        rlap: "Lap",
        raise: "RaiseLower",
        lower: "RaiseLower",
        moveleft: "MoveLeftRight",
        moveright: "MoveLeftRight",
        ",": ["Spacer", lengths_js_1.MATHSPACE.thinmathspace],
        ":": ["Spacer", lengths_js_1.MATHSPACE.mediummathspace],
        ">": ["Spacer", lengths_js_1.MATHSPACE.mediummathspace],
        ";": ["Spacer", lengths_js_1.MATHSPACE.thickmathspace],
        "!": ["Spacer", lengths_js_1.MATHSPACE.negativethinmathspace],
        enspace: ["Spacer", 0.5],
        quad: ["Spacer", 1],
        qquad: ["Spacer", 2],
        thinspace: ["Spacer", lengths_js_1.MATHSPACE.thinmathspace],
        negthinspace: ["Spacer", lengths_js_1.MATHSPACE.negativethinmathspace],
        hskip: "Hskip",
        hspace: "Hskip",
        kern: "Hskip",
        mskip: "Hskip",
        mspace: "Hskip",
        mkern: "Hskip",
        rule: "rule",
        Rule: ["Rule"],
        Space: ["Rule", "blank"],
        nonscript: "Nonscript",
        big: ["MakeBig", MmlNode_js_1.TEXCLASS.ORD, 0.85],
        Big: ["MakeBig", MmlNode_js_1.TEXCLASS.ORD, 1.15],
        bigg: ["MakeBig", MmlNode_js_1.TEXCLASS.ORD, 1.45],
        Bigg: ["MakeBig", MmlNode_js_1.TEXCLASS.ORD, 1.75],
        bigl: ["MakeBig", MmlNode_js_1.TEXCLASS.OPEN, 0.85],
        Bigl: ["MakeBig", MmlNode_js_1.TEXCLASS.OPEN, 1.15],
        biggl: ["MakeBig", MmlNode_js_1.TEXCLASS.OPEN, 1.45],
        Biggl: ["MakeBig", MmlNode_js_1.TEXCLASS.OPEN, 1.75],
        bigr: ["MakeBig", MmlNode_js_1.TEXCLASS.CLOSE, 0.85],
        Bigr: ["MakeBig", MmlNode_js_1.TEXCLASS.CLOSE, 1.15],
        biggr: ["MakeBig", MmlNode_js_1.TEXCLASS.CLOSE, 1.45],
        Biggr: ["MakeBig", MmlNode_js_1.TEXCLASS.CLOSE, 1.75],
        bigm: ["MakeBig", MmlNode_js_1.TEXCLASS.REL, 0.85],
        Bigm: ["MakeBig", MmlNode_js_1.TEXCLASS.REL, 1.15],
        biggm: ["MakeBig", MmlNode_js_1.TEXCLASS.REL, 1.45],
        Biggm: ["MakeBig", MmlNode_js_1.TEXCLASS.REL, 1.75],
        mathord: ["TeXAtom", MmlNode_js_1.TEXCLASS.ORD],
        mathop: ["TeXAtom", MmlNode_js_1.TEXCLASS.OP],
        mathopen: ["TeXAtom", MmlNode_js_1.TEXCLASS.OPEN],
        mathclose: ["TeXAtom", MmlNode_js_1.TEXCLASS.CLOSE],
        mathbin: ["TeXAtom", MmlNode_js_1.TEXCLASS.BIN],
        mathrel: ["TeXAtom", MmlNode_js_1.TEXCLASS.REL],
        mathpunct: ["TeXAtom", MmlNode_js_1.TEXCLASS.PUNCT],
        mathinner: ["TeXAtom", MmlNode_js_1.TEXCLASS.INNER],
        vcenter: ["TeXAtom", MmlNode_js_1.TEXCLASS.VCENTER],
        buildrel: "BuildRel",
        hbox: ["HBox", 0],
        text: "HBox",
        mbox: ["HBox", 0],
        fbox: "FBox",
        boxed: ["Macro", "\\fbox{$\\displaystyle{#1}$}", 1],
        framebox: "FrameBox",
        strut: "Strut",
        mathstrut: ["Macro", "\\vphantom{(}"],
        phantom: "Phantom",
        vphantom: ["Phantom", 1, 0],
        hphantom: ["Phantom", 0, 1],
        smash: "Smash",
        acute: ["Accent", "00B4"],
        grave: ["Accent", "0060"],
        ddot: ["Accent", "00A8"],
        tilde: ["Accent", "007E"],
        bar: ["Accent", "00AF"],
        breve: ["Accent", "02D8"],
        check: ["Accent", "02C7"],
        hat: ["Accent", "005E"],
        vec: ["Accent", "2192"],
        dot: ["Accent", "02D9"],
        widetilde: ["Accent", "007E", 1],
        widehat: ["Accent", "005E", 1],
        matrix: "Matrix",
        array: "Matrix",
        pmatrix: ["Matrix", "(", ")"],
        cases: [
          "Matrix",
          "{",
          "",
          "left left",
          null,
          ".1em",
          null,
          true
        ],
        eqalign: [
          "Matrix",
          null,
          null,
          "right left",
          (0, lengths_js_1.em)(lengths_js_1.MATHSPACE.thickmathspace),
          ".5em",
          "D"
        ],
        displaylines: ["Matrix", null, null, "center", null, ".5em", "D"],
        cr: "Cr",
        "\\": "CrLaTeX",
        newline: ["CrLaTeX", true],
        hline: ["HLine", "solid"],
        hdashline: ["HLine", "dashed"],
        eqalignno: [
          "Matrix",
          null,
          null,
          "right left",
          (0, lengths_js_1.em)(lengths_js_1.MATHSPACE.thickmathspace),
          ".5em",
          "D",
          null,
          "right"
        ],
        leqalignno: [
          "Matrix",
          null,
          null,
          "right left",
          (0, lengths_js_1.em)(lengths_js_1.MATHSPACE.thickmathspace),
          ".5em",
          "D",
          null,
          "left"
        ],
        hfill: "HFill",
        hfil: "HFill",
        hfilll: "HFill",
        bmod: ["Macro", '\\mmlToken{mo}[lspace="thickmathspace" rspace="thickmathspace"]{mod}'],
        pmod: ["Macro", "\\pod{\\mmlToken{mi}{mod}\\kern 6mu #1}", 1],
        mod: [
          "Macro",
          "\\mathchoice{\\kern18mu}{\\kern12mu}{\\kern12mu}{\\kern12mu}\\mmlToken{mi}{mod}\\,\\,#1",
          1
        ],
        pod: ["Macro", "\\mathchoice{\\kern18mu}{\\kern8mu}{\\kern8mu}{\\kern8mu}(#1)", 1],
        iff: ["Macro", "\\;\\Longleftrightarrow\\;"],
        skew: ["Macro", "{{#2{#3\\mkern#1mu}\\mkern-#1mu}{}}", 3],
        pmb: ["Macro", "\\rlap{#1}\\kern1px{#1}", 1],
        TeX: ["Macro", "T\\kern-.14em\\lower.5ex{E}\\kern-.115em X"],
        LaTeX: ["Macro", "L\\kern-.325em\\raise.21em{\\scriptstyle{A}}\\kern-.17em\\TeX"],
        " ": ["Macro", "\\text{ }"],
        not: "Not",
        dots: "Dots",
        space: "Tilde",
        " ": "Tilde",
        begin: "BeginEnd",
        end: "BeginEnd",
        label: "HandleLabel",
        ref: "HandleRef",
        nonumber: "HandleNoTag",
        mathchoice: "MathChoice",
        mmlToken: "MmlToken"
      }, BaseMethods_js_1.default);
      new sm.EnvironmentMap("environment", ParseMethods_js_1.default.environment, {
        array: ["AlignedArray"],
        equation: ["Equation", null, true],
        eqnarray: [
          "EqnArray",
          null,
          true,
          true,
          "rcl",
          ParseUtil_js_1.default.cols(0, lengths_js_1.MATHSPACE.thickmathspace),
          ".5em"
        ]
      }, BaseMethods_js_1.default);
      new sm.CharacterMap("not_remap", null, {
        "←": "↚",
        "→": "↛",
        "↔": "↮",
        "⇐": "⇍",
        "⇒": "⇏",
        "⇔": "⇎",
        "∈": "∉",
        "∋": "∌",
        "∣": "∤",
        "∥": "∦",
        "∼": "≁",
        "~": "≁",
        "≃": "≄",
        "≅": "≇",
        "≈": "≉",
        "≍": "≭",
        "=": "≠",
        "≡": "≢",
        "<": "≮",
        ">": "≯",
        "≤": "≰",
        "≥": "≱",
        "≲": "≴",
        "≳": "≵",
        "≶": "≸",
        "≷": "≹",
        "≺": "⊀",
        "≻": "⊁",
        "⊂": "⊄",
        "⊃": "⊅",
        "⊆": "⊈",
        "⊇": "⊉",
        "⊢": "⊬",
        "⊨": "⊭",
        "⊩": "⊮",
        "⊫": "⊯",
        "≼": "⋠",
        "≽": "⋡",
        "⊑": "⋢",
        "⊒": "⋣",
        "⊲": "⋪",
        "⊳": "⋫",
        "⊴": "⋬",
        "⊵": "⋭",
        "∃": "∄"
      });
      return BaseMappings;
    }
    var hasRequiredBaseConfiguration;
    function requireBaseConfiguration() {
      if (hasRequiredBaseConfiguration) return BaseConfiguration;
      hasRequiredBaseConfiguration = 1;
      var __extends2 = BaseConfiguration && BaseConfiguration.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      var __createBinding2 = BaseConfiguration && BaseConfiguration.__createBinding || (Object.create ? (function(o, m, k2, k22) {
        if (k22 === void 0) k22 = k2;
        var desc = Object.getOwnPropertyDescriptor(m, k2);
        if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
          desc = { enumerable: true, get: function() {
            return m[k2];
          } };
        }
        Object.defineProperty(o, k22, desc);
      }) : (function(o, m, k2, k22) {
        if (k22 === void 0) k22 = k2;
        o[k22] = m[k2];
      }));
      var __setModuleDefault2 = BaseConfiguration && BaseConfiguration.__setModuleDefault || (Object.create ? (function(o, v) {
        Object.defineProperty(o, "default", { enumerable: true, value: v });
      }) : function(o, v) {
        o["default"] = v;
      });
      var __importStar2 = BaseConfiguration && BaseConfiguration.__importStar || function(mod2) {
        if (mod2 && mod2.__esModule) return mod2;
        var result2 = {};
        if (mod2 != null) {
          for (var k2 in mod2) if (k2 !== "default" && Object.prototype.hasOwnProperty.call(mod2, k2)) __createBinding2(result2, mod2, k2);
        }
        __setModuleDefault2(result2, mod2);
        return result2;
      };
      var __values2 = BaseConfiguration && BaseConfiguration.__values || function(o) {
        var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i2 = 0;
        if (m) return m.call(o);
        if (o && typeof o.length === "number") return {
          next: function() {
            if (o && i2 >= o.length) o = void 0;
            return { value: o && o[i2++], done: !o };
          }
        };
        throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
      };
      var __importDefault2 = BaseConfiguration && BaseConfiguration.__importDefault || function(mod2) {
        return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
      };
      var _a2;
      Object.defineProperty(BaseConfiguration, "__esModule", { value: true });
      BaseConfiguration.BaseConfiguration = BaseConfiguration.BaseTags = BaseConfiguration.Other = void 0;
      var Configuration_js_1 = requireConfiguration();
      var MapHandler_js_1 = requireMapHandler();
      var TexError_js_1 = __importDefault2(requireTexError());
      var NodeUtil_js_1 = __importDefault2(requireNodeUtil());
      var SymbolMap_js_1 = requireSymbolMap();
      var bitem = __importStar2(requireBaseItems());
      var Tags_js_1 = requireTags();
      requireBaseMappings();
      var OperatorDictionary_js_1 = requireOperatorDictionary();
      new SymbolMap_js_1.CharacterMap("remap", null, {
        "-": "−",
        "*": "∗",
        "`": "‘"
      });
      function Other(parser2, char) {
        var font = parser2.stack.env["font"];
        var def = font ? { mathvariant: parser2.stack.env["font"] } : {};
        var remap = MapHandler_js_1.MapHandler.getMap("remap").lookup(char);
        var range2 = (0, OperatorDictionary_js_1.getRange)(char);
        var type = range2 ? range2[3] : "mo";
        var mo2 = parser2.create("token", type, def, remap ? remap.char : char);
        range2[4] && mo2.attributes.set("mathvariant", range2[4]);
        if (type === "mo") {
          NodeUtil_js_1.default.setProperty(mo2, "fixStretchy", true);
          parser2.configuration.addNode("fixStretchy", mo2);
        }
        parser2.Push(mo2);
      }
      BaseConfiguration.Other = Other;
      function csUndefined(_parser2, name2) {
        throw new TexError_js_1.default("UndefinedControlSequence", "Undefined control sequence %1", "\\" + name2);
      }
      function envUndefined(_parser2, env) {
        throw new TexError_js_1.default("UnknownEnv", "Unknown environment '%1'", env);
      }
      function filterNonscript(_a3) {
        var e_1, _b2;
        var data = _a3.data;
        try {
          for (var _c = __values2(data.getList("nonscript")), _d = _c.next(); !_d.done; _d = _c.next()) {
            var mml = _d.value;
            if (mml.attributes.get("scriptlevel") > 0) {
              var parent_1 = mml.parent;
              parent_1.childNodes.splice(parent_1.childIndex(mml), 1);
              data.removeFromList(mml.kind, [mml]);
              if (mml.isKind("mrow")) {
                var mstyle2 = mml.childNodes[0];
                data.removeFromList("mstyle", [mstyle2]);
                data.removeFromList("mspace", mstyle2.childNodes[0].childNodes);
              }
            } else if (mml.isKind("mrow")) {
              mml.parent.replaceChild(mml.childNodes[0], mml);
              data.removeFromList("mrow", [mml]);
            }
          }
        } catch (e_1_1) {
          e_1 = { error: e_1_1 };
        } finally {
          try {
            if (_d && !_d.done && (_b2 = _c.return)) _b2.call(_c);
          } finally {
            if (e_1) throw e_1.error;
          }
        }
      }
      var BaseTags = (function(_super) {
        __extends2(BaseTags2, _super);
        function BaseTags2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        return BaseTags2;
      })(Tags_js_1.AbstractTags);
      BaseConfiguration.BaseTags = BaseTags;
      BaseConfiguration.BaseConfiguration = Configuration_js_1.Configuration.create("base", {
        handler: {
          character: ["command", "special", "letter", "digit"],
          delimiter: ["delimiter"],
          macro: ["delimiter", "macros", "mathchar0mi", "mathchar0mo", "mathchar7"],
          environment: ["environment"]
        },
        fallback: {
          character: Other,
          macro: csUndefined,
          environment: envUndefined
        },
        items: (_a2 = {}, _a2[bitem.StartItem.prototype.kind] = bitem.StartItem, _a2[bitem.StopItem.prototype.kind] = bitem.StopItem, _a2[bitem.OpenItem.prototype.kind] = bitem.OpenItem, _a2[bitem.CloseItem.prototype.kind] = bitem.CloseItem, _a2[bitem.PrimeItem.prototype.kind] = bitem.PrimeItem, _a2[bitem.SubsupItem.prototype.kind] = bitem.SubsupItem, _a2[bitem.OverItem.prototype.kind] = bitem.OverItem, _a2[bitem.LeftItem.prototype.kind] = bitem.LeftItem, _a2[bitem.Middle.prototype.kind] = bitem.Middle, _a2[bitem.RightItem.prototype.kind] = bitem.RightItem, _a2[bitem.BeginItem.prototype.kind] = bitem.BeginItem, _a2[bitem.EndItem.prototype.kind] = bitem.EndItem, _a2[bitem.StyleItem.prototype.kind] = bitem.StyleItem, _a2[bitem.PositionItem.prototype.kind] = bitem.PositionItem, _a2[bitem.CellItem.prototype.kind] = bitem.CellItem, _a2[bitem.MmlItem.prototype.kind] = bitem.MmlItem, _a2[bitem.FnItem.prototype.kind] = bitem.FnItem, _a2[bitem.NotItem.prototype.kind] = bitem.NotItem, _a2[bitem.NonscriptItem.prototype.kind] = bitem.NonscriptItem, _a2[bitem.DotsItem.prototype.kind] = bitem.DotsItem, _a2[bitem.ArrayItem.prototype.kind] = bitem.ArrayItem, _a2[bitem.EqnArrayItem.prototype.kind] = bitem.EqnArrayItem, _a2[bitem.EquationItem.prototype.kind] = bitem.EquationItem, _a2),
        options: {
          maxMacros: 1e3,
          baseURL: typeof document === "undefined" || document.getElementsByTagName("base").length === 0 ? "" : String(document.location).replace(/#.*$/, "")
        },
        tags: {
          base: BaseTags
        },
        postprocessors: [[filterNonscript, -4]]
      });
      return BaseConfiguration;
    }
    var hasRequiredTex$2;
    function requireTex$2() {
      if (hasRequiredTex$2) return tex$2;
      hasRequiredTex$2 = 1;
      var __extends2 = tex$2 && tex$2.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      var __assign2 = tex$2 && tex$2.__assign || function() {
        __assign2 = Object.assign || function(t2) {
          for (var s, i2 = 1, n = arguments.length; i2 < n; i2++) {
            s = arguments[i2];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
              t2[p] = s[p];
          }
          return t2;
        };
        return __assign2.apply(this, arguments);
      };
      var __read2 = tex$2 && tex$2.__read || function(o, n) {
        var m = typeof Symbol === "function" && o[Symbol.iterator];
        if (!m) return o;
        var i2 = m.call(o), r2, ar2 = [], e;
        try {
          while ((n === void 0 || n-- > 0) && !(r2 = i2.next()).done) ar2.push(r2.value);
        } catch (error2) {
          e = { error: error2 };
        } finally {
          try {
            if (r2 && !r2.done && (m = i2["return"])) m.call(i2);
          } finally {
            if (e) throw e.error;
          }
        }
        return ar2;
      };
      var __importDefault2 = tex$2 && tex$2.__importDefault || function(mod2) {
        return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
      };
      Object.defineProperty(tex$2, "__esModule", { value: true });
      tex$2.TeX = void 0;
      var InputJax_js_1 = requireInputJax();
      var Options_js_1 = requireOptions$1();
      var FindTeX_js_1 = requireFindTeX();
      var FilterUtil_js_1 = __importDefault2(requireFilterUtil());
      var NodeUtil_js_1 = __importDefault2(requireNodeUtil());
      var TexParser_js_1 = __importDefault2(requireTexParser());
      var TexError_js_1 = __importDefault2(requireTexError());
      var ParseOptions_js_1 = __importDefault2(requireParseOptions());
      var Tags_js_1 = requireTags();
      var Configuration_js_1 = requireConfiguration();
      requireBaseConfiguration();
      var TeX = (function(_super) {
        __extends2(TeX2, _super);
        function TeX2(options2) {
          if (options2 === void 0) {
            options2 = {};
          }
          var _this = this;
          var _a2 = __read2((0, Options_js_1.separateOptions)(options2, TeX2.OPTIONS, FindTeX_js_1.FindTeX.OPTIONS), 3), rest = _a2[0], tex2 = _a2[1], find2 = _a2[2];
          _this = _super.call(this, tex2) || this;
          _this.findTeX = _this.options["FindTeX"] || new FindTeX_js_1.FindTeX(find2);
          var packages = _this.options.packages;
          var configuration = _this.configuration = TeX2.configure(packages);
          var parseOptions = _this._parseOptions = new ParseOptions_js_1.default(configuration, [_this.options, Tags_js_1.TagsFactory.OPTIONS]);
          (0, Options_js_1.userOptions)(parseOptions.options, rest);
          configuration.config(_this);
          TeX2.tags(parseOptions, configuration);
          _this.postFilters.add(FilterUtil_js_1.default.cleanSubSup, -6);
          _this.postFilters.add(FilterUtil_js_1.default.setInherited, -5);
          _this.postFilters.add(FilterUtil_js_1.default.moveLimits, -4);
          _this.postFilters.add(FilterUtil_js_1.default.cleanStretchy, -3);
          _this.postFilters.add(FilterUtil_js_1.default.cleanAttributes, -2);
          _this.postFilters.add(FilterUtil_js_1.default.combineRelations, -1);
          return _this;
        }
        TeX2.configure = function(packages) {
          var configuration = new Configuration_js_1.ParserConfiguration(packages, ["tex"]);
          configuration.init();
          return configuration;
        };
        TeX2.tags = function(options2, configuration) {
          Tags_js_1.TagsFactory.addTags(configuration.tags);
          Tags_js_1.TagsFactory.setDefault(options2.options.tags);
          options2.tags = Tags_js_1.TagsFactory.getDefault();
          options2.tags.configuration = options2;
        };
        TeX2.prototype.setMmlFactory = function(mmlFactory) {
          _super.prototype.setMmlFactory.call(this, mmlFactory);
          this._parseOptions.nodeFactory.setMmlFactory(mmlFactory);
        };
        Object.defineProperty(TeX2.prototype, "parseOptions", {
          get: function() {
            return this._parseOptions;
          },
          enumerable: false,
          configurable: true
        });
        TeX2.prototype.reset = function(tag) {
          if (tag === void 0) {
            tag = 0;
          }
          this.parseOptions.tags.reset(tag);
        };
        TeX2.prototype.compile = function(math2, document2) {
          this.parseOptions.clear();
          this.executeFilters(this.preFilters, math2, document2, this.parseOptions);
          var display = math2.display;
          this.latex = math2.math;
          var node2;
          this.parseOptions.tags.startEquation(math2);
          var globalEnv;
          try {
            var parser2 = new TexParser_js_1.default(this.latex, { display, isInner: false }, this.parseOptions);
            node2 = parser2.mml();
            globalEnv = parser2.stack.global;
          } catch (err2) {
            if (!(err2 instanceof TexError_js_1.default)) {
              throw err2;
            }
            this.parseOptions.error = true;
            node2 = this.options.formatError(this, err2);
          }
          node2 = this.parseOptions.nodeFactory.create("node", "math", [node2]);
          if (globalEnv === null || globalEnv === void 0 ? void 0 : globalEnv.indentalign) {
            NodeUtil_js_1.default.setAttribute(node2, "indentalign", globalEnv.indentalign);
          }
          if (display) {
            NodeUtil_js_1.default.setAttribute(node2, "display", "block");
          }
          this.parseOptions.tags.finishEquation(math2);
          this.parseOptions.root = node2;
          this.executeFilters(this.postFilters, math2, document2, this.parseOptions);
          this.mathNode = this.parseOptions.root;
          return this.mathNode;
        };
        TeX2.prototype.findMath = function(strings) {
          return this.findTeX.findMath(strings);
        };
        TeX2.prototype.formatError = function(err2) {
          var message2 = err2.message.replace(/\n.*/, "");
          return this.parseOptions.nodeFactory.create("error", message2, err2.id, this.latex);
        };
        TeX2.NAME = "TeX";
        TeX2.OPTIONS = __assign2(__assign2({}, InputJax_js_1.AbstractInputJax.OPTIONS), { FindTeX: null, packages: ["base"], digits: /^(?:[0-9]+(?:\{,\}[0-9]{3})*(?:\.[0-9]*)?|\.[0-9]+)/, maxBuffer: 5 * 1024, formatError: function(jax, err2) {
          return jax.formatError(err2);
        } });
        return TeX2;
      })(InputJax_js_1.AbstractInputJax);
      tex$2.TeX = TeX;
      return tex$2;
    }
    var svg$1 = {};
    var OutputJax$1 = {};
    var OutputJax = {};
    var hasRequiredOutputJax$1;
    function requireOutputJax$1() {
      if (hasRequiredOutputJax$1) return OutputJax;
      hasRequiredOutputJax$1 = 1;
      Object.defineProperty(OutputJax, "__esModule", { value: true });
      OutputJax.AbstractOutputJax = void 0;
      var Options_js_1 = requireOptions$1();
      var FunctionList_js_1 = requireFunctionList();
      var AbstractOutputJax = (function() {
        function AbstractOutputJax2(options2) {
          if (options2 === void 0) {
            options2 = {};
          }
          this.adaptor = null;
          var CLASS = this.constructor;
          this.options = (0, Options_js_1.userOptions)((0, Options_js_1.defaultOptions)({}, CLASS.OPTIONS), options2);
          this.postFilters = new FunctionList_js_1.FunctionList();
        }
        Object.defineProperty(AbstractOutputJax2.prototype, "name", {
          get: function() {
            return this.constructor.NAME;
          },
          enumerable: false,
          configurable: true
        });
        AbstractOutputJax2.prototype.setAdaptor = function(adaptor) {
          this.adaptor = adaptor;
        };
        AbstractOutputJax2.prototype.initialize = function() {
        };
        AbstractOutputJax2.prototype.reset = function() {
        };
        AbstractOutputJax2.prototype.getMetrics = function(_document) {
        };
        AbstractOutputJax2.prototype.styleSheet = function(_document) {
          return null;
        };
        AbstractOutputJax2.prototype.pageElements = function(_document) {
          return null;
        };
        AbstractOutputJax2.prototype.executeFilters = function(filters2, math2, document2, data) {
          var args2 = { math: math2, document: document2, data };
          filters2.execute(args2);
          return args2.data;
        };
        AbstractOutputJax2.NAME = "generic";
        AbstractOutputJax2.OPTIONS = {};
        return AbstractOutputJax2;
      })();
      OutputJax.AbstractOutputJax = AbstractOutputJax;
      return OutputJax;
    }
    var Styles = {};
    var hasRequiredStyles;
    function requireStyles() {
      if (hasRequiredStyles) return Styles;
      hasRequiredStyles = 1;
      var __values2 = Styles && Styles.__values || function(o) {
        var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i2 = 0;
        if (m) return m.call(o);
        if (o && typeof o.length === "number") return {
          next: function() {
            if (o && i2 >= o.length) o = void 0;
            return { value: o && o[i2++], done: !o };
          }
        };
        throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
      };
      var __read2 = Styles && Styles.__read || function(o, n) {
        var m = typeof Symbol === "function" && o[Symbol.iterator];
        if (!m) return o;
        var i2 = m.call(o), r2, ar2 = [], e;
        try {
          while ((n === void 0 || n-- > 0) && !(r2 = i2.next()).done) ar2.push(r2.value);
        } catch (error2) {
          e = { error: error2 };
        } finally {
          try {
            if (r2 && !r2.done && (m = i2["return"])) m.call(i2);
          } finally {
            if (e) throw e.error;
          }
        }
        return ar2;
      };
      var __spreadArray2 = Styles && Styles.__spreadArray || function(to2, from, pack) {
        if (pack || arguments.length === 2) for (var i2 = 0, l = from.length, ar2; i2 < l; i2++) {
          if (ar2 || !(i2 in from)) {
            if (!ar2) ar2 = Array.prototype.slice.call(from, 0, i2);
            ar2[i2] = from[i2];
          }
        }
        return to2.concat(ar2 || Array.prototype.slice.call(from));
      };
      Object.defineProperty(Styles, "__esModule", { value: true });
      Styles.Styles = void 0;
      var TRBL = ["top", "right", "bottom", "left"];
      var WSC = ["width", "style", "color"];
      function splitSpaces(text2) {
        var parts = text2.split(/((?:'[^']*'|"[^"]*"|,[\s\n]|[^\s\n])*)/g);
        var split = [];
        while (parts.length > 1) {
          parts.shift();
          split.push(parts.shift());
        }
        return split;
      }
      function splitTRBL(name2) {
        var e_1, _a2;
        var parts = splitSpaces(this.styles[name2]);
        if (parts.length === 0) {
          parts.push("");
        }
        if (parts.length === 1) {
          parts.push(parts[0]);
        }
        if (parts.length === 2) {
          parts.push(parts[0]);
        }
        if (parts.length === 3) {
          parts.push(parts[1]);
        }
        try {
          for (var _b2 = __values2(Styles$1.connect[name2].children), _c = _b2.next(); !_c.done; _c = _b2.next()) {
            var child = _c.value;
            this.setStyle(this.childName(name2, child), parts.shift());
          }
        } catch (e_1_1) {
          e_1 = { error: e_1_1 };
        } finally {
          try {
            if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
          } finally {
            if (e_1) throw e_1.error;
          }
        }
      }
      function combineTRBL(name2) {
        var e_2, _a2;
        var children2 = Styles$1.connect[name2].children;
        var parts = [];
        try {
          for (var children_1 = __values2(children2), children_1_1 = children_1.next(); !children_1_1.done; children_1_1 = children_1.next()) {
            var child = children_1_1.value;
            var part2 = this.styles[name2 + "-" + child];
            if (!part2) {
              delete this.styles[name2];
              return;
            }
            parts.push(part2);
          }
        } catch (e_2_1) {
          e_2 = { error: e_2_1 };
        } finally {
          try {
            if (children_1_1 && !children_1_1.done && (_a2 = children_1.return)) _a2.call(children_1);
          } finally {
            if (e_2) throw e_2.error;
          }
        }
        if (parts[3] === parts[1]) {
          parts.pop();
          if (parts[2] === parts[0]) {
            parts.pop();
            if (parts[1] === parts[0]) {
              parts.pop();
            }
          }
        }
        this.styles[name2] = parts.join(" ");
      }
      function splitSame(name2) {
        var e_3, _a2;
        try {
          for (var _b2 = __values2(Styles$1.connect[name2].children), _c = _b2.next(); !_c.done; _c = _b2.next()) {
            var child = _c.value;
            this.setStyle(this.childName(name2, child), this.styles[name2]);
          }
        } catch (e_3_1) {
          e_3 = { error: e_3_1 };
        } finally {
          try {
            if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
          } finally {
            if (e_3) throw e_3.error;
          }
        }
      }
      function combineSame(name2) {
        var e_4, _a2;
        var children2 = __spreadArray2([], __read2(Styles$1.connect[name2].children), false);
        var value2 = this.styles[this.childName(name2, children2.shift())];
        try {
          for (var children_2 = __values2(children2), children_2_1 = children_2.next(); !children_2_1.done; children_2_1 = children_2.next()) {
            var child = children_2_1.value;
            if (this.styles[this.childName(name2, child)] !== value2) {
              delete this.styles[name2];
              return;
            }
          }
        } catch (e_4_1) {
          e_4 = { error: e_4_1 };
        } finally {
          try {
            if (children_2_1 && !children_2_1.done && (_a2 = children_2.return)) _a2.call(children_2);
          } finally {
            if (e_4) throw e_4.error;
          }
        }
        this.styles[name2] = value2;
      }
      var BORDER = {
        width: /^(?:[\d.]+(?:[a-z]+)|thin|medium|thick|inherit|initial|unset)$/,
        style: /^(?:none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset|inherit|initial|unset)$/
      };
      function splitWSC(name2) {
        var e_5, _a2, e_6, _b2;
        var parts = { width: "", style: "", color: "" };
        try {
          for (var _c = __values2(splitSpaces(this.styles[name2])), _d = _c.next(); !_d.done; _d = _c.next()) {
            var part2 = _d.value;
            if (part2.match(BORDER.width) && parts.width === "") {
              parts.width = part2;
            } else if (part2.match(BORDER.style) && parts.style === "") {
              parts.style = part2;
            } else {
              parts.color = part2;
            }
          }
        } catch (e_5_1) {
          e_5 = { error: e_5_1 };
        } finally {
          try {
            if (_d && !_d.done && (_a2 = _c.return)) _a2.call(_c);
          } finally {
            if (e_5) throw e_5.error;
          }
        }
        try {
          for (var _e2 = __values2(Styles$1.connect[name2].children), _f = _e2.next(); !_f.done; _f = _e2.next()) {
            var child = _f.value;
            this.setStyle(this.childName(name2, child), parts[child]);
          }
        } catch (e_6_1) {
          e_6 = { error: e_6_1 };
        } finally {
          try {
            if (_f && !_f.done && (_b2 = _e2.return)) _b2.call(_e2);
          } finally {
            if (e_6) throw e_6.error;
          }
        }
      }
      function combineWSC(name2) {
        var e_7, _a2;
        var parts = [];
        try {
          for (var _b2 = __values2(Styles$1.connect[name2].children), _c = _b2.next(); !_c.done; _c = _b2.next()) {
            var child = _c.value;
            var value2 = this.styles[this.childName(name2, child)];
            if (value2) {
              parts.push(value2);
            }
          }
        } catch (e_7_1) {
          e_7 = { error: e_7_1 };
        } finally {
          try {
            if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
          } finally {
            if (e_7) throw e_7.error;
          }
        }
        if (parts.length) {
          this.styles[name2] = parts.join(" ");
        } else {
          delete this.styles[name2];
        }
      }
      var FONT = {
        style: /^(?:normal|italic|oblique|inherit|initial|unset)$/,
        variant: new RegExp("^(?:" + [
          "normal|none",
          "inherit|initial|unset",
          "common-ligatures|no-common-ligatures",
          "discretionary-ligatures|no-discretionary-ligatures",
          "historical-ligatures|no-historical-ligatures",
          "contextual|no-contextual",
          "(?:stylistic|character-variant|swash|ornaments|annotation)\\([^)]*\\)",
          "small-caps|all-small-caps|petite-caps|all-petite-caps|unicase|titling-caps",
          "lining-nums|oldstyle-nums|proportional-nums|tabular-nums",
          "diagonal-fractions|stacked-fractions",
          "ordinal|slashed-zero",
          "jis78|jis83|jis90|jis04|simplified|traditional",
          "full-width|proportional-width",
          "ruby"
        ].join("|") + ")$"),
        weight: /^(?:normal|bold|bolder|lighter|[1-9]00|inherit|initial|unset)$/,
        stretch: new RegExp("^(?:" + [
          "normal",
          "(?:(?:ultra|extra|semi)-)?condensed",
          "(?:(?:semi|extra|ulta)-)?expanded",
          "inherit|initial|unset"
        ].join("|") + ")$"),
        size: new RegExp("^(?:" + [
          "xx-small|x-small|small|medium|large|x-large|xx-large|larger|smaller",
          "[d.]+%|[d.]+[a-z]+",
          "inherit|initial|unset"
        ].join("|") + ")(?:/(?:normal|[d.+](?:%|[a-z]+)?))?$")
      };
      function splitFont(name2) {
        var e_8, _a2, e_9, _b2;
        var parts = splitSpaces(this.styles[name2]);
        var value2 = {
          style: "",
          variant: [],
          weight: "",
          stretch: "",
          size: "",
          family: "",
          "line-height": ""
        };
        try {
          for (var parts_1 = __values2(parts), parts_1_1 = parts_1.next(); !parts_1_1.done; parts_1_1 = parts_1.next()) {
            var part2 = parts_1_1.value;
            value2.family = part2;
            try {
              for (var _c = (e_9 = void 0, __values2(Object.keys(FONT))), _d = _c.next(); !_d.done; _d = _c.next()) {
                var name_1 = _d.value;
                if ((Array.isArray(value2[name_1]) || value2[name_1] === "") && part2.match(FONT[name_1])) {
                  if (name_1 === "size") {
                    var _e2 = __read2(part2.split(/\//), 2), size = _e2[0], height = _e2[1];
                    value2[name_1] = size;
                    if (height) {
                      value2["line-height"] = height;
                    }
                  } else if (value2.size === "") {
                    if (Array.isArray(value2[name_1])) {
                      value2[name_1].push(part2);
                    } else {
                      value2[name_1] = part2;
                    }
                  }
                }
              }
            } catch (e_9_1) {
              e_9 = { error: e_9_1 };
            } finally {
              try {
                if (_d && !_d.done && (_b2 = _c.return)) _b2.call(_c);
              } finally {
                if (e_9) throw e_9.error;
              }
            }
          }
        } catch (e_8_1) {
          e_8 = { error: e_8_1 };
        } finally {
          try {
            if (parts_1_1 && !parts_1_1.done && (_a2 = parts_1.return)) _a2.call(parts_1);
          } finally {
            if (e_8) throw e_8.error;
          }
        }
        saveFontParts(name2, value2);
        delete this.styles[name2];
      }
      function saveFontParts(name2, value2) {
        var e_10, _a2;
        try {
          for (var _b2 = __values2(Styles$1.connect[name2].children), _c = _b2.next(); !_c.done; _c = _b2.next()) {
            var child = _c.value;
            var cname = this.childName(name2, child);
            if (Array.isArray(value2[child])) {
              var values = value2[child];
              if (values.length) {
                this.styles[cname] = values.join(" ");
              }
            } else if (value2[child] !== "") {
              this.styles[cname] = value2[child];
            }
          }
        } catch (e_10_1) {
          e_10 = { error: e_10_1 };
        } finally {
          try {
            if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
          } finally {
            if (e_10) throw e_10.error;
          }
        }
      }
      function combineFont(_name) {
      }
      var Styles$1 = (function() {
        function Styles2(cssText) {
          if (cssText === void 0) {
            cssText = "";
          }
          this.parse(cssText);
        }
        Object.defineProperty(Styles2.prototype, "cssText", {
          get: function() {
            var e_11, _a2;
            var styles2 = [];
            try {
              for (var _b2 = __values2(Object.keys(this.styles)), _c = _b2.next(); !_c.done; _c = _b2.next()) {
                var name_2 = _c.value;
                var parent_1 = this.parentName(name_2);
                if (!this.styles[parent_1]) {
                  styles2.push(name_2 + ": " + this.styles[name_2] + ";");
                }
              }
            } catch (e_11_1) {
              e_11 = { error: e_11_1 };
            } finally {
              try {
                if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
              } finally {
                if (e_11) throw e_11.error;
              }
            }
            return styles2.join(" ");
          },
          enumerable: false,
          configurable: true
        });
        Styles2.prototype.set = function(name2, value2) {
          name2 = this.normalizeName(name2);
          this.setStyle(name2, value2);
          if (Styles2.connect[name2] && !Styles2.connect[name2].combine) {
            this.combineChildren(name2);
            delete this.styles[name2];
          }
          while (name2.match(/-/)) {
            name2 = this.parentName(name2);
            if (!Styles2.connect[name2])
              break;
            Styles2.connect[name2].combine.call(this, name2);
          }
        };
        Styles2.prototype.get = function(name2) {
          name2 = this.normalizeName(name2);
          return this.styles.hasOwnProperty(name2) ? this.styles[name2] : "";
        };
        Styles2.prototype.setStyle = function(name2, value2) {
          this.styles[name2] = value2;
          if (Styles2.connect[name2] && Styles2.connect[name2].children) {
            Styles2.connect[name2].split.call(this, name2);
          }
          if (value2 === "") {
            delete this.styles[name2];
          }
        };
        Styles2.prototype.combineChildren = function(name2) {
          var e_12, _a2;
          var parent = this.parentName(name2);
          try {
            for (var _b2 = __values2(Styles2.connect[name2].children), _c = _b2.next(); !_c.done; _c = _b2.next()) {
              var child = _c.value;
              var cname = this.childName(parent, child);
              Styles2.connect[cname].combine.call(this, cname);
            }
          } catch (e_12_1) {
            e_12 = { error: e_12_1 };
          } finally {
            try {
              if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
            } finally {
              if (e_12) throw e_12.error;
            }
          }
        };
        Styles2.prototype.parentName = function(name2) {
          var parent = name2.replace(/-[^-]*$/, "");
          return name2 === parent ? "" : parent;
        };
        Styles2.prototype.childName = function(name2, child) {
          if (child.match(/-/)) {
            return child;
          }
          if (Styles2.connect[name2] && !Styles2.connect[name2].combine) {
            child += name2.replace(/.*-/, "-");
            name2 = this.parentName(name2);
          }
          return name2 + "-" + child;
        };
        Styles2.prototype.normalizeName = function(name2) {
          return name2.replace(/[A-Z]/g, function(c2) {
            return "-" + c2.toLowerCase();
          });
        };
        Styles2.prototype.parse = function(cssText) {
          if (cssText === void 0) {
            cssText = "";
          }
          var PATTERN = this.constructor.pattern;
          this.styles = {};
          var parts = cssText.replace(PATTERN.comment, "").split(PATTERN.style);
          while (parts.length > 1) {
            var _a2 = __read2(parts.splice(0, 3), 3), space = _a2[0], name_3 = _a2[1], value2 = _a2[2];
            if (space.match(/[^\s\n]/))
              return;
            this.set(name_3, value2);
          }
        };
        Styles2.pattern = {
          style: /([-a-z]+)[\s\n]*:[\s\n]*((?:'[^']*'|"[^"]*"|\n|.)*?)[\s\n]*(?:;|$)/g,
          comment: /\/\*[^]*?\*\//g
        };
        Styles2.connect = {
          padding: {
            children: TRBL,
            split: splitTRBL,
            combine: combineTRBL
          },
          border: {
            children: TRBL,
            split: splitSame,
            combine: combineSame
          },
          "border-top": {
            children: WSC,
            split: splitWSC,
            combine: combineWSC
          },
          "border-right": {
            children: WSC,
            split: splitWSC,
            combine: combineWSC
          },
          "border-bottom": {
            children: WSC,
            split: splitWSC,
            combine: combineWSC
          },
          "border-left": {
            children: WSC,
            split: splitWSC,
            combine: combineWSC
          },
          "border-width": {
            children: TRBL,
            split: splitTRBL,
            combine: null
          },
          "border-style": {
            children: TRBL,
            split: splitTRBL,
            combine: null
          },
          "border-color": {
            children: TRBL,
            split: splitTRBL,
            combine: null
          },
          font: {
            children: ["style", "variant", "weight", "stretch", "line-height", "size", "family"],
            split: splitFont,
            combine: combineFont
          }
        };
        return Styles2;
      })();
      Styles.Styles = Styles$1;
      return Styles;
    }
    var StyleList = {};
    var hasRequiredStyleList;
    function requireStyleList() {
      if (hasRequiredStyleList) return StyleList;
      hasRequiredStyleList = 1;
      var __values2 = StyleList && StyleList.__values || function(o) {
        var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i2 = 0;
        if (m) return m.call(o);
        if (o && typeof o.length === "number") return {
          next: function() {
            if (o && i2 >= o.length) o = void 0;
            return { value: o && o[i2++], done: !o };
          }
        };
        throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
      };
      Object.defineProperty(StyleList, "__esModule", { value: true });
      StyleList.CssStyles = void 0;
      var CssStyles = (function() {
        function CssStyles2(styles2) {
          if (styles2 === void 0) {
            styles2 = null;
          }
          this.styles = {};
          this.addStyles(styles2);
        }
        Object.defineProperty(CssStyles2.prototype, "cssText", {
          get: function() {
            return this.getStyleString();
          },
          enumerable: false,
          configurable: true
        });
        CssStyles2.prototype.addStyles = function(styles2) {
          var e_1, _a2;
          if (!styles2)
            return;
          try {
            for (var _b2 = __values2(Object.keys(styles2)), _c = _b2.next(); !_c.done; _c = _b2.next()) {
              var style2 = _c.value;
              if (!this.styles[style2]) {
                this.styles[style2] = {};
              }
              Object.assign(this.styles[style2], styles2[style2]);
            }
          } catch (e_1_1) {
            e_1 = { error: e_1_1 };
          } finally {
            try {
              if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
            } finally {
              if (e_1) throw e_1.error;
            }
          }
        };
        CssStyles2.prototype.removeStyles = function() {
          var e_2, _a2;
          var selectors = [];
          for (var _i = 0; _i < arguments.length; _i++) {
            selectors[_i] = arguments[_i];
          }
          try {
            for (var selectors_1 = __values2(selectors), selectors_1_1 = selectors_1.next(); !selectors_1_1.done; selectors_1_1 = selectors_1.next()) {
              var selector2 = selectors_1_1.value;
              delete this.styles[selector2];
            }
          } catch (e_2_1) {
            e_2 = { error: e_2_1 };
          } finally {
            try {
              if (selectors_1_1 && !selectors_1_1.done && (_a2 = selectors_1.return)) _a2.call(selectors_1);
            } finally {
              if (e_2) throw e_2.error;
            }
          }
        };
        CssStyles2.prototype.clear = function() {
          this.styles = {};
        };
        CssStyles2.prototype.getStyleString = function() {
          return this.getStyleRules().join("\n\n");
        };
        CssStyles2.prototype.getStyleRules = function() {
          var e_3, _a2;
          var selectors = Object.keys(this.styles);
          var defs = new Array(selectors.length);
          var i2 = 0;
          try {
            for (var selectors_2 = __values2(selectors), selectors_2_1 = selectors_2.next(); !selectors_2_1.done; selectors_2_1 = selectors_2.next()) {
              var selector2 = selectors_2_1.value;
              defs[i2++] = selector2 + " {\n" + this.getStyleDefString(this.styles[selector2]) + "\n}";
            }
          } catch (e_3_1) {
            e_3 = { error: e_3_1 };
          } finally {
            try {
              if (selectors_2_1 && !selectors_2_1.done && (_a2 = selectors_2.return)) _a2.call(selectors_2);
            } finally {
              if (e_3) throw e_3.error;
            }
          }
          return defs;
        };
        CssStyles2.prototype.getStyleDefString = function(styles2) {
          var e_4, _a2;
          var properties = Object.keys(styles2);
          var values = new Array(properties.length);
          var i2 = 0;
          try {
            for (var properties_1 = __values2(properties), properties_1_1 = properties_1.next(); !properties_1_1.done; properties_1_1 = properties_1.next()) {
              var property2 = properties_1_1.value;
              values[i2++] = "  " + property2 + ": " + styles2[property2] + ";";
            }
          } catch (e_4_1) {
            e_4 = { error: e_4_1 };
          } finally {
            try {
              if (properties_1_1 && !properties_1_1.done && (_a2 = properties_1.return)) _a2.call(properties_1);
            } finally {
              if (e_4) throw e_4.error;
            }
          }
          return values.join("\n");
        };
        return CssStyles2;
      })();
      StyleList.CssStyles = CssStyles;
      return StyleList;
    }
    var hasRequiredOutputJax;
    function requireOutputJax() {
      if (hasRequiredOutputJax) return OutputJax$1;
      hasRequiredOutputJax = 1;
      var __extends2 = OutputJax$1 && OutputJax$1.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      var __assign2 = OutputJax$1 && OutputJax$1.__assign || function() {
        __assign2 = Object.assign || function(t2) {
          for (var s, i2 = 1, n = arguments.length; i2 < n; i2++) {
            s = arguments[i2];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
              t2[p] = s[p];
          }
          return t2;
        };
        return __assign2.apply(this, arguments);
      };
      var __read2 = OutputJax$1 && OutputJax$1.__read || function(o, n) {
        var m = typeof Symbol === "function" && o[Symbol.iterator];
        if (!m) return o;
        var i2 = m.call(o), r2, ar2 = [], e;
        try {
          while ((n === void 0 || n-- > 0) && !(r2 = i2.next()).done) ar2.push(r2.value);
        } catch (error2) {
          e = { error: error2 };
        } finally {
          try {
            if (r2 && !r2.done && (m = i2["return"])) m.call(i2);
          } finally {
            if (e) throw e.error;
          }
        }
        return ar2;
      };
      var __values2 = OutputJax$1 && OutputJax$1.__values || function(o) {
        var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i2 = 0;
        if (m) return m.call(o);
        if (o && typeof o.length === "number") return {
          next: function() {
            if (o && i2 >= o.length) o = void 0;
            return { value: o && o[i2++], done: !o };
          }
        };
        throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
      };
      Object.defineProperty(OutputJax$1, "__esModule", { value: true });
      OutputJax$1.CommonOutputJax = void 0;
      var OutputJax_js_1 = requireOutputJax$1();
      var MathItem_js_1 = requireMathItem();
      var Options_js_1 = requireOptions$1();
      var lengths_js_1 = requireLengths();
      var Styles_js_1 = requireStyles();
      var StyleList_js_1 = requireStyleList();
      var CommonOutputJax = (function(_super) {
        __extends2(CommonOutputJax2, _super);
        function CommonOutputJax2(options2, defaultFactory, defaultFont) {
          if (options2 === void 0) {
            options2 = null;
          }
          if (defaultFactory === void 0) {
            defaultFactory = null;
          }
          if (defaultFont === void 0) {
            defaultFont = null;
          }
          var _this = this;
          var _a2 = __read2((0, Options_js_1.separateOptions)(options2, defaultFont.OPTIONS), 2), jaxOptions = _a2[0], fontOptions = _a2[1];
          _this = _super.call(this, jaxOptions) || this;
          _this.factory = _this.options.wrapperFactory || new defaultFactory();
          _this.factory.jax = _this;
          _this.cssStyles = _this.options.cssStyles || new StyleList_js_1.CssStyles();
          _this.font = _this.options.font || new defaultFont(fontOptions);
          _this.unknownCache = /* @__PURE__ */ new Map();
          return _this;
        }
        CommonOutputJax2.prototype.typeset = function(math2, html2) {
          this.setDocument(html2);
          var node2 = this.createNode();
          this.toDOM(math2, node2, html2);
          return node2;
        };
        CommonOutputJax2.prototype.createNode = function() {
          var jax = this.constructor.NAME;
          return this.html("mjx-container", { "class": "MathJax", jax });
        };
        CommonOutputJax2.prototype.setScale = function(node2) {
          var scale = this.math.metrics.scale * this.options.scale;
          if (scale !== 1) {
            this.adaptor.setStyle(node2, "fontSize", (0, lengths_js_1.percent)(scale));
          }
        };
        CommonOutputJax2.prototype.toDOM = function(math2, node2, html2) {
          if (html2 === void 0) {
            html2 = null;
          }
          this.setDocument(html2);
          this.math = math2;
          this.pxPerEm = math2.metrics.ex / this.font.params.x_height;
          math2.root.setTeXclass(null);
          this.setScale(node2);
          this.nodeMap = /* @__PURE__ */ new Map();
          this.container = node2;
          this.processMath(math2.root, node2);
          this.nodeMap = null;
          this.executeFilters(this.postFilters, math2, html2, node2);
        };
        CommonOutputJax2.prototype.getBBox = function(math2, html2) {
          this.setDocument(html2);
          this.math = math2;
          math2.root.setTeXclass(null);
          this.nodeMap = /* @__PURE__ */ new Map();
          var bbox = this.factory.wrap(math2.root).getOuterBBox();
          this.nodeMap = null;
          return bbox;
        };
        CommonOutputJax2.prototype.getMetrics = function(html2) {
          var e_1, _a2;
          this.setDocument(html2);
          var adaptor = this.adaptor;
          var maps = this.getMetricMaps(html2);
          try {
            for (var _b2 = __values2(html2.math), _c = _b2.next(); !_c.done; _c = _b2.next()) {
              var math2 = _c.value;
              var parent_1 = adaptor.parent(math2.start.node);
              if (math2.state() < MathItem_js_1.STATE.METRICS && parent_1) {
                var map2 = maps[math2.display ? 1 : 0];
                var _d = map2.get(parent_1), em = _d.em, ex = _d.ex, containerWidth = _d.containerWidth, lineWidth = _d.lineWidth, scale = _d.scale, family = _d.family;
                math2.setMetrics(em, ex, containerWidth, lineWidth, scale);
                if (this.options.mtextInheritFont) {
                  math2.outputData.mtextFamily = family;
                }
                if (this.options.merrorInheritFont) {
                  math2.outputData.merrorFamily = family;
                }
                math2.state(MathItem_js_1.STATE.METRICS);
              }
            }
          } catch (e_1_1) {
            e_1 = { error: e_1_1 };
          } finally {
            try {
              if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
            } finally {
              if (e_1) throw e_1.error;
            }
          }
        };
        CommonOutputJax2.prototype.getMetricsFor = function(node2, display) {
          var getFamily = this.options.mtextInheritFont || this.options.merrorInheritFont;
          var test = this.getTestElement(node2, display);
          var metrics = this.measureMetrics(test, getFamily);
          this.adaptor.remove(test);
          return metrics;
        };
        CommonOutputJax2.prototype.getMetricMaps = function(html2) {
          var e_2, _a2, e_3, _b2, e_4, _c, e_5, _d, e_6, _e2;
          var adaptor = this.adaptor;
          var domMaps = [/* @__PURE__ */ new Map(), /* @__PURE__ */ new Map()];
          try {
            for (var _f = __values2(html2.math), _g = _f.next(); !_g.done; _g = _f.next()) {
              var math2 = _g.value;
              var node2 = adaptor.parent(math2.start.node);
              if (node2 && math2.state() < MathItem_js_1.STATE.METRICS) {
                var map2 = domMaps[math2.display ? 1 : 0];
                if (!map2.has(node2)) {
                  map2.set(node2, this.getTestElement(node2, math2.display));
                }
              }
            }
          } catch (e_2_1) {
            e_2 = { error: e_2_1 };
          } finally {
            try {
              if (_g && !_g.done && (_a2 = _f.return)) _a2.call(_f);
            } finally {
              if (e_2) throw e_2.error;
            }
          }
          var getFamily = this.options.mtextInheritFont || this.options.merrorInheritFont;
          var maps = [/* @__PURE__ */ new Map(), /* @__PURE__ */ new Map()];
          try {
            for (var _h = __values2(maps.keys()), _j = _h.next(); !_j.done; _j = _h.next()) {
              var i2 = _j.value;
              try {
                for (var _k = (e_4 = void 0, __values2(domMaps[i2].keys())), _l = _k.next(); !_l.done; _l = _k.next()) {
                  var node2 = _l.value;
                  maps[i2].set(node2, this.measureMetrics(domMaps[i2].get(node2), getFamily));
                }
              } catch (e_4_1) {
                e_4 = { error: e_4_1 };
              } finally {
                try {
                  if (_l && !_l.done && (_c = _k.return)) _c.call(_k);
                } finally {
                  if (e_4) throw e_4.error;
                }
              }
            }
          } catch (e_3_1) {
            e_3 = { error: e_3_1 };
          } finally {
            try {
              if (_j && !_j.done && (_b2 = _h.return)) _b2.call(_h);
            } finally {
              if (e_3) throw e_3.error;
            }
          }
          try {
            for (var _m = __values2(maps.keys()), _o2 = _m.next(); !_o2.done; _o2 = _m.next()) {
              var i2 = _o2.value;
              try {
                for (var _p = (e_6 = void 0, __values2(domMaps[i2].values())), _q = _p.next(); !_q.done; _q = _p.next()) {
                  var node2 = _q.value;
                  adaptor.remove(node2);
                }
              } catch (e_6_1) {
                e_6 = { error: e_6_1 };
              } finally {
                try {
                  if (_q && !_q.done && (_e2 = _p.return)) _e2.call(_p);
                } finally {
                  if (e_6) throw e_6.error;
                }
              }
            }
          } catch (e_5_1) {
            e_5 = { error: e_5_1 };
          } finally {
            try {
              if (_o2 && !_o2.done && (_d = _m.return)) _d.call(_m);
            } finally {
              if (e_5) throw e_5.error;
            }
          }
          return maps;
        };
        CommonOutputJax2.prototype.getTestElement = function(node2, display) {
          var adaptor = this.adaptor;
          if (!this.testInline) {
            this.testInline = this.html("mjx-test", { style: {
              display: "inline-block",
              width: "100%",
              "font-style": "normal",
              "font-weight": "normal",
              "font-size": "100%",
              "font-size-adjust": "none",
              "text-indent": 0,
              "text-transform": "none",
              "letter-spacing": "normal",
              "word-spacing": "normal",
              overflow: "hidden",
              height: "1px",
              "margin-right": "-1px"
            } }, [
              this.html("mjx-left-box", { style: {
                display: "inline-block",
                width: 0,
                "float": "left"
              } }),
              this.html("mjx-ex-box", { style: {
                position: "absolute",
                overflow: "hidden",
                width: "1px",
                height: "60ex"
              } }),
              this.html("mjx-right-box", { style: {
                display: "inline-block",
                width: 0,
                "float": "right"
              } })
            ]);
            this.testDisplay = adaptor.clone(this.testInline);
            adaptor.setStyle(this.testDisplay, "display", "table");
            adaptor.setStyle(this.testDisplay, "margin-right", "");
            adaptor.setStyle(adaptor.firstChild(this.testDisplay), "display", "none");
            var right2 = adaptor.lastChild(this.testDisplay);
            adaptor.setStyle(right2, "display", "table-cell");
            adaptor.setStyle(right2, "width", "10000em");
            adaptor.setStyle(right2, "float", "");
          }
          return adaptor.append(node2, adaptor.clone(display ? this.testDisplay : this.testInline));
        };
        CommonOutputJax2.prototype.measureMetrics = function(node2, getFamily) {
          var adaptor = this.adaptor;
          var family = getFamily ? adaptor.fontFamily(node2) : "";
          var em = adaptor.fontSize(node2);
          var _a2 = __read2(adaptor.nodeSize(adaptor.childNode(node2, 1)), 2), w = _a2[0], h = _a2[1];
          var ex = w ? h / 60 : em * this.options.exFactor;
          var containerWidth = !w ? 1e6 : adaptor.getStyle(node2, "display") === "table" ? adaptor.nodeSize(adaptor.lastChild(node2))[0] - 1 : adaptor.nodeBBox(adaptor.lastChild(node2)).left - adaptor.nodeBBox(adaptor.firstChild(node2)).left - 2;
          var scale = Math.max(this.options.minScale, this.options.matchFontHeight ? ex / this.font.params.x_height / em : 1);
          var lineWidth = 1e6;
          return { em, ex, containerWidth, lineWidth, scale, family };
        };
        CommonOutputJax2.prototype.styleSheet = function(html2) {
          var e_7, _a2;
          this.setDocument(html2);
          this.cssStyles.clear();
          this.cssStyles.addStyles(this.constructor.commonStyles);
          if ("getStyles" in html2) {
            try {
              for (var _b2 = __values2(html2.getStyles()), _c = _b2.next(); !_c.done; _c = _b2.next()) {
                var styles2 = _c.value;
                this.cssStyles.addStyles(styles2);
              }
            } catch (e_7_1) {
              e_7 = { error: e_7_1 };
            } finally {
              try {
                if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
              } finally {
                if (e_7) throw e_7.error;
              }
            }
          }
          this.addWrapperStyles(this.cssStyles);
          this.addFontStyles(this.cssStyles);
          var sheet = this.html("style", { id: "MJX-styles" }, [this.text("\n" + this.cssStyles.cssText + "\n")]);
          return sheet;
        };
        CommonOutputJax2.prototype.addFontStyles = function(styles2) {
          styles2.addStyles(this.font.styles);
        };
        CommonOutputJax2.prototype.addWrapperStyles = function(styles2) {
          var e_8, _a2;
          try {
            for (var _b2 = __values2(this.factory.getKinds()), _c = _b2.next(); !_c.done; _c = _b2.next()) {
              var kind = _c.value;
              this.addClassStyles(this.factory.getNodeClass(kind), styles2);
            }
          } catch (e_8_1) {
            e_8 = { error: e_8_1 };
          } finally {
            try {
              if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
            } finally {
              if (e_8) throw e_8.error;
            }
          }
        };
        CommonOutputJax2.prototype.addClassStyles = function(CLASS, styles2) {
          styles2.addStyles(CLASS.styles);
        };
        CommonOutputJax2.prototype.setDocument = function(html2) {
          if (html2) {
            this.document = html2;
            this.adaptor.document = html2.document;
          }
        };
        CommonOutputJax2.prototype.html = function(type, def, content2, ns) {
          if (def === void 0) {
            def = {};
          }
          if (content2 === void 0) {
            content2 = [];
          }
          return this.adaptor.node(type, def, content2, ns);
        };
        CommonOutputJax2.prototype.text = function(text2) {
          return this.adaptor.text(text2);
        };
        CommonOutputJax2.prototype.fixed = function(m, n) {
          if (n === void 0) {
            n = 3;
          }
          if (Math.abs(m) < 6e-4) {
            return "0";
          }
          return m.toFixed(n).replace(/\.?0+$/, "");
        };
        CommonOutputJax2.prototype.measureText = function(text2, variant, font) {
          if (font === void 0) {
            font = ["", false, false];
          }
          var node2 = this.unknownText(text2, variant);
          if (variant === "-explicitFont") {
            var styles2 = this.cssFontStyles(font);
            this.adaptor.setAttributes(node2, { style: styles2 });
          }
          return this.measureTextNodeWithCache(node2, text2, variant, font);
        };
        CommonOutputJax2.prototype.measureTextNodeWithCache = function(text2, chars, variant, font) {
          if (font === void 0) {
            font = ["", false, false];
          }
          if (variant === "-explicitFont") {
            variant = [font[0], font[1] ? "T" : "F", font[2] ? "T" : "F", ""].join("-");
          }
          if (!this.unknownCache.has(variant)) {
            this.unknownCache.set(variant, /* @__PURE__ */ new Map());
          }
          var map2 = this.unknownCache.get(variant);
          var cached = map2.get(chars);
          if (cached)
            return cached;
          var bbox = this.measureTextNode(text2);
          map2.set(chars, bbox);
          return bbox;
        };
        CommonOutputJax2.prototype.measureXMLnode = function(xml) {
          var adaptor = this.adaptor;
          var content2 = this.html("mjx-xml-block", { style: { display: "inline-block" } }, [adaptor.clone(xml)]);
          var base2 = this.html("mjx-baseline", { style: { display: "inline-block", width: 0, height: 0 } });
          var style2 = {
            position: "absolute",
            display: "inline-block",
            "font-family": "initial",
            "line-height": "normal"
          };
          var node2 = this.html("mjx-measure-xml", { style: style2 }, [base2, content2]);
          adaptor.append(adaptor.parent(this.math.start.node), this.container);
          adaptor.append(this.container, node2);
          var em = this.math.metrics.em * this.math.metrics.scale;
          var _a2 = adaptor.nodeBBox(content2), left2 = _a2.left, right2 = _a2.right, bottom2 = _a2.bottom, top2 = _a2.top;
          var w = (right2 - left2) / em;
          var h = (adaptor.nodeBBox(base2).top - top2) / em;
          var d = (bottom2 - top2) / em - h;
          adaptor.remove(this.container);
          adaptor.remove(node2);
          return { w, h, d };
        };
        CommonOutputJax2.prototype.cssFontStyles = function(font, styles2) {
          if (styles2 === void 0) {
            styles2 = {};
          }
          var _a2 = __read2(font, 3), family = _a2[0], italic2 = _a2[1], bold2 = _a2[2];
          styles2["font-family"] = this.font.getFamily(family);
          if (italic2)
            styles2["font-style"] = "italic";
          if (bold2)
            styles2["font-weight"] = "bold";
          return styles2;
        };
        CommonOutputJax2.prototype.getFontData = function(styles2) {
          if (!styles2) {
            styles2 = new Styles_js_1.Styles();
          }
          return [
            this.font.getFamily(styles2.get("font-family")),
            styles2.get("font-style") === "italic",
            styles2.get("font-weight") === "bold"
          ];
        };
        CommonOutputJax2.NAME = "Common";
        CommonOutputJax2.OPTIONS = __assign2(__assign2({}, OutputJax_js_1.AbstractOutputJax.OPTIONS), { scale: 1, minScale: 0.5, mtextInheritFont: false, merrorInheritFont: false, mtextFont: "", merrorFont: "serif", mathmlSpacing: false, skipAttributes: {}, exFactor: 0.5, displayAlign: "center", displayIndent: "0", wrapperFactory: null, font: null, cssStyles: null });
        CommonOutputJax2.commonStyles = {};
        return CommonOutputJax2;
      })(OutputJax_js_1.AbstractOutputJax);
      OutputJax$1.CommonOutputJax = CommonOutputJax;
      return OutputJax$1;
    }
    var WrapperFactory$2 = {};
    var WrapperFactory$1 = {};
    var WrapperFactory = {};
    var hasRequiredWrapperFactory$2;
    function requireWrapperFactory$2() {
      if (hasRequiredWrapperFactory$2) return WrapperFactory;
      hasRequiredWrapperFactory$2 = 1;
      var __extends2 = WrapperFactory && WrapperFactory.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      var __read2 = WrapperFactory && WrapperFactory.__read || function(o, n) {
        var m = typeof Symbol === "function" && o[Symbol.iterator];
        if (!m) return o;
        var i2 = m.call(o), r2, ar2 = [], e;
        try {
          while ((n === void 0 || n-- > 0) && !(r2 = i2.next()).done) ar2.push(r2.value);
        } catch (error2) {
          e = { error: error2 };
        } finally {
          try {
            if (r2 && !r2.done && (m = i2["return"])) m.call(i2);
          } finally {
            if (e) throw e.error;
          }
        }
        return ar2;
      };
      var __spreadArray2 = WrapperFactory && WrapperFactory.__spreadArray || function(to2, from, pack) {
        if (pack || arguments.length === 2) for (var i2 = 0, l = from.length, ar2; i2 < l; i2++) {
          if (ar2 || !(i2 in from)) {
            if (!ar2) ar2 = Array.prototype.slice.call(from, 0, i2);
            ar2[i2] = from[i2];
          }
        }
        return to2.concat(ar2 || Array.prototype.slice.call(from));
      };
      Object.defineProperty(WrapperFactory, "__esModule", { value: true });
      WrapperFactory.AbstractWrapperFactory = void 0;
      var Factory_js_1 = requireFactory();
      var AbstractWrapperFactory = (function(_super) {
        __extends2(AbstractWrapperFactory2, _super);
        function AbstractWrapperFactory2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        AbstractWrapperFactory2.prototype.wrap = function(node2) {
          var args2 = [];
          for (var _i = 1; _i < arguments.length; _i++) {
            args2[_i - 1] = arguments[_i];
          }
          return this.create.apply(this, __spreadArray2([node2.kind, node2], __read2(args2), false));
        };
        return AbstractWrapperFactory2;
      })(Factory_js_1.AbstractFactory);
      WrapperFactory.AbstractWrapperFactory = AbstractWrapperFactory;
      return WrapperFactory;
    }
    var hasRequiredWrapperFactory$1;
    function requireWrapperFactory$1() {
      if (hasRequiredWrapperFactory$1) return WrapperFactory$1;
      hasRequiredWrapperFactory$1 = 1;
      var __extends2 = WrapperFactory$1 && WrapperFactory$1.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      Object.defineProperty(WrapperFactory$1, "__esModule", { value: true });
      WrapperFactory$1.CommonWrapperFactory = void 0;
      var WrapperFactory_js_1 = requireWrapperFactory$2();
      var CommonWrapperFactory = (function(_super) {
        __extends2(CommonWrapperFactory2, _super);
        function CommonWrapperFactory2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.jax = null;
          return _this;
        }
        Object.defineProperty(CommonWrapperFactory2.prototype, "Wrappers", {
          get: function() {
            return this.node;
          },
          enumerable: false,
          configurable: true
        });
        CommonWrapperFactory2.defaultNodes = {};
        return CommonWrapperFactory2;
      })(WrapperFactory_js_1.AbstractWrapperFactory);
      WrapperFactory$1.CommonWrapperFactory = CommonWrapperFactory;
      return WrapperFactory$1;
    }
    var Wrappers = {};
    var Wrapper$2 = {};
    var BBox = {};
    var hasRequiredBBox;
    function requireBBox() {
      if (hasRequiredBBox) return BBox;
      hasRequiredBBox = 1;
      Object.defineProperty(BBox, "__esModule", { value: true });
      BBox.BBox = void 0;
      var lengths_js_1 = requireLengths();
      var BBox$1 = (function() {
        function BBox2(def) {
          if (def === void 0) {
            def = { w: 0, h: -lengths_js_1.BIGDIMEN, d: -lengths_js_1.BIGDIMEN };
          }
          this.w = def.w || 0;
          this.h = "h" in def ? def.h : -lengths_js_1.BIGDIMEN;
          this.d = "d" in def ? def.d : -lengths_js_1.BIGDIMEN;
          this.L = this.R = this.ic = this.sk = this.dx = 0;
          this.scale = this.rscale = 1;
          this.pwidth = "";
        }
        BBox2.zero = function() {
          return new BBox2({ h: 0, d: 0, w: 0 });
        };
        BBox2.empty = function() {
          return new BBox2();
        };
        BBox2.prototype.empty = function() {
          this.w = 0;
          this.h = this.d = -lengths_js_1.BIGDIMEN;
          return this;
        };
        BBox2.prototype.clean = function() {
          if (this.w === -lengths_js_1.BIGDIMEN)
            this.w = 0;
          if (this.h === -lengths_js_1.BIGDIMEN)
            this.h = 0;
          if (this.d === -lengths_js_1.BIGDIMEN)
            this.d = 0;
        };
        BBox2.prototype.rescale = function(scale) {
          this.w *= scale;
          this.h *= scale;
          this.d *= scale;
        };
        BBox2.prototype.combine = function(cbox, x2, y) {
          if (x2 === void 0) {
            x2 = 0;
          }
          if (y === void 0) {
            y = 0;
          }
          var rscale = cbox.rscale;
          var w = x2 + rscale * (cbox.w + cbox.L + cbox.R);
          var h = y + rscale * cbox.h;
          var d = rscale * cbox.d - y;
          if (w > this.w)
            this.w = w;
          if (h > this.h)
            this.h = h;
          if (d > this.d)
            this.d = d;
        };
        BBox2.prototype.append = function(cbox) {
          var scale = cbox.rscale;
          this.w += scale * (cbox.w + cbox.L + cbox.R);
          if (scale * cbox.h > this.h) {
            this.h = scale * cbox.h;
          }
          if (scale * cbox.d > this.d) {
            this.d = scale * cbox.d;
          }
        };
        BBox2.prototype.updateFrom = function(cbox) {
          this.h = cbox.h;
          this.d = cbox.d;
          this.w = cbox.w;
          if (cbox.pwidth) {
            this.pwidth = cbox.pwidth;
          }
        };
        BBox2.fullWidth = "100%";
        BBox2.StyleAdjust = [
          ["borderTopWidth", "h"],
          ["borderRightWidth", "w"],
          ["borderBottomWidth", "d"],
          ["borderLeftWidth", "w", 0],
          ["paddingTop", "h"],
          ["paddingRight", "w"],
          ["paddingBottom", "d"],
          ["paddingLeft", "w", 0]
        ];
        return BBox2;
      })();
      BBox.BBox = BBox$1;
      return BBox;
    }
    var Wrapper$1 = {};
    var Wrapper = {};
    var hasRequiredWrapper$2;
    function requireWrapper$2() {
      if (hasRequiredWrapper$2) return Wrapper;
      hasRequiredWrapper$2 = 1;
      Object.defineProperty(Wrapper, "__esModule", { value: true });
      Wrapper.AbstractWrapper = void 0;
      var AbstractWrapper = (function() {
        function AbstractWrapper2(factory, node2) {
          this.factory = factory;
          this.node = node2;
        }
        Object.defineProperty(AbstractWrapper2.prototype, "kind", {
          get: function() {
            return this.node.kind;
          },
          enumerable: false,
          configurable: true
        });
        AbstractWrapper2.prototype.wrap = function(node2) {
          return this.factory.wrap(node2);
        };
        return AbstractWrapper2;
      })();
      Wrapper.AbstractWrapper = AbstractWrapper;
      return Wrapper;
    }
    var FontData$1 = {};
    var hasRequiredFontData$1;
    function requireFontData$1() {
      if (hasRequiredFontData$1) return FontData$1;
      hasRequiredFontData$1 = 1;
      var __assign2 = FontData$1 && FontData$1.__assign || function() {
        __assign2 = Object.assign || function(t2) {
          for (var s, i2 = 1, n = arguments.length; i2 < n; i2++) {
            s = arguments[i2];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
              t2[p] = s[p];
          }
          return t2;
        };
        return __assign2.apply(this, arguments);
      };
      var __read2 = FontData$1 && FontData$1.__read || function(o, n) {
        var m = typeof Symbol === "function" && o[Symbol.iterator];
        if (!m) return o;
        var i2 = m.call(o), r2, ar2 = [], e;
        try {
          while ((n === void 0 || n-- > 0) && !(r2 = i2.next()).done) ar2.push(r2.value);
        } catch (error2) {
          e = { error: error2 };
        } finally {
          try {
            if (r2 && !r2.done && (m = i2["return"])) m.call(i2);
          } finally {
            if (e) throw e.error;
          }
        }
        return ar2;
      };
      var __spreadArray2 = FontData$1 && FontData$1.__spreadArray || function(to2, from, pack) {
        if (pack || arguments.length === 2) for (var i2 = 0, l = from.length, ar2; i2 < l; i2++) {
          if (ar2 || !(i2 in from)) {
            if (!ar2) ar2 = Array.prototype.slice.call(from, 0, i2);
            ar2[i2] = from[i2];
          }
        }
        return to2.concat(ar2 || Array.prototype.slice.call(from));
      };
      var __values2 = FontData$1 && FontData$1.__values || function(o) {
        var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i2 = 0;
        if (m) return m.call(o);
        if (o && typeof o.length === "number") return {
          next: function() {
            if (o && i2 >= o.length) o = void 0;
            return { value: o && o[i2++], done: !o };
          }
        };
        throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
      };
      Object.defineProperty(FontData$1, "__esModule", { value: true });
      FontData$1.FontData = FontData$1.NOSTRETCH = FontData$1.H = FontData$1.V = void 0;
      var Options_js_1 = requireOptions$1();
      FontData$1.V = 1;
      FontData$1.H = 2;
      FontData$1.NOSTRETCH = { dir: 0 };
      var FontData2 = (function() {
        function FontData3(options2) {
          var e_1, _a2, e_2, _b2;
          if (options2 === void 0) {
            options2 = null;
          }
          this.variant = {};
          this.delimiters = {};
          this.cssFontMap = {};
          this.remapChars = {};
          this.skewIcFactor = 0.75;
          var CLASS = this.constructor;
          this.options = (0, Options_js_1.userOptions)((0, Options_js_1.defaultOptions)({}, CLASS.OPTIONS), options2);
          this.params = __assign2({}, CLASS.defaultParams);
          this.sizeVariants = __spreadArray2([], __read2(CLASS.defaultSizeVariants), false);
          this.stretchVariants = __spreadArray2([], __read2(CLASS.defaultStretchVariants), false);
          this.cssFontMap = __assign2({}, CLASS.defaultCssFonts);
          try {
            for (var _c = __values2(Object.keys(this.cssFontMap)), _d = _c.next(); !_d.done; _d = _c.next()) {
              var name_1 = _d.value;
              if (this.cssFontMap[name_1][0] === "unknown") {
                this.cssFontMap[name_1][0] = this.options.unknownFamily;
              }
            }
          } catch (e_1_1) {
            e_1 = { error: e_1_1 };
          } finally {
            try {
              if (_d && !_d.done && (_a2 = _c.return)) _a2.call(_c);
            } finally {
              if (e_1) throw e_1.error;
            }
          }
          this.cssFamilyPrefix = CLASS.defaultCssFamilyPrefix;
          this.createVariants(CLASS.defaultVariants);
          this.defineDelimiters(CLASS.defaultDelimiters);
          try {
            for (var _e2 = __values2(Object.keys(CLASS.defaultChars)), _f = _e2.next(); !_f.done; _f = _e2.next()) {
              var name_2 = _f.value;
              this.defineChars(name_2, CLASS.defaultChars[name_2]);
            }
          } catch (e_2_1) {
            e_2 = { error: e_2_1 };
          } finally {
            try {
              if (_f && !_f.done && (_b2 = _e2.return)) _b2.call(_e2);
            } finally {
              if (e_2) throw e_2.error;
            }
          }
          this.defineRemap("accent", CLASS.defaultAccentMap);
          this.defineRemap("mo", CLASS.defaultMoMap);
          this.defineRemap("mn", CLASS.defaultMnMap);
        }
        FontData3.charOptions = function(font, n) {
          var char = font[n];
          if (char.length === 3) {
            char[3] = {};
          }
          return char[3];
        };
        Object.defineProperty(FontData3.prototype, "styles", {
          get: function() {
            return this._styles;
          },
          set: function(style2) {
            this._styles = style2;
          },
          enumerable: false,
          configurable: true
        });
        FontData3.prototype.createVariant = function(name2, inherit, link2) {
          if (inherit === void 0) {
            inherit = null;
          }
          if (link2 === void 0) {
            link2 = null;
          }
          var variant = {
            linked: [],
            chars: inherit ? Object.create(this.variant[inherit].chars) : {}
          };
          if (link2 && this.variant[link2]) {
            Object.assign(variant.chars, this.variant[link2].chars);
            this.variant[link2].linked.push(variant.chars);
            variant.chars = Object.create(variant.chars);
          }
          this.remapSmpChars(variant.chars, name2);
          this.variant[name2] = variant;
        };
        FontData3.prototype.remapSmpChars = function(chars, name2) {
          var e_3, _a2, e_4, _b2;
          var CLASS = this.constructor;
          if (CLASS.VariantSmp[name2]) {
            var SmpRemap = CLASS.SmpRemap;
            var SmpGreek = [null, null, CLASS.SmpRemapGreekU, CLASS.SmpRemapGreekL];
            try {
              for (var _c = __values2(CLASS.SmpRanges), _d = _c.next(); !_d.done; _d = _c.next()) {
                var _e2 = __read2(_d.value, 3), i2 = _e2[0], lo2 = _e2[1], hi = _e2[2];
                var base2 = CLASS.VariantSmp[name2][i2];
                if (!base2)
                  continue;
                for (var n = lo2; n <= hi; n++) {
                  if (n === 930)
                    continue;
                  var smp = base2 + n - lo2;
                  chars[n] = this.smpChar(SmpRemap[smp] || smp);
                }
                if (SmpGreek[i2]) {
                  try {
                    for (var _f = (e_4 = void 0, __values2(Object.keys(SmpGreek[i2]).map(function(x2) {
                      return parseInt(x2);
                    }))), _g = _f.next(); !_g.done; _g = _f.next()) {
                      var n = _g.value;
                      chars[n] = this.smpChar(base2 + SmpGreek[i2][n]);
                    }
                  } catch (e_4_1) {
                    e_4 = { error: e_4_1 };
                  } finally {
                    try {
                      if (_g && !_g.done && (_b2 = _f.return)) _b2.call(_f);
                    } finally {
                      if (e_4) throw e_4.error;
                    }
                  }
                }
              }
            } catch (e_3_1) {
              e_3 = { error: e_3_1 };
            } finally {
              try {
                if (_d && !_d.done && (_a2 = _c.return)) _a2.call(_c);
              } finally {
                if (e_3) throw e_3.error;
              }
            }
          }
          if (name2 === "bold") {
            chars[988] = this.smpChar(120778);
            chars[989] = this.smpChar(120779);
          }
        };
        FontData3.prototype.smpChar = function(n) {
          return [, , , { smp: n }];
        };
        FontData3.prototype.createVariants = function(variants) {
          var e_5, _a2;
          try {
            for (var variants_1 = __values2(variants), variants_1_1 = variants_1.next(); !variants_1_1.done; variants_1_1 = variants_1.next()) {
              var variant = variants_1_1.value;
              this.createVariant(variant[0], variant[1], variant[2]);
            }
          } catch (e_5_1) {
            e_5 = { error: e_5_1 };
          } finally {
            try {
              if (variants_1_1 && !variants_1_1.done && (_a2 = variants_1.return)) _a2.call(variants_1);
            } finally {
              if (e_5) throw e_5.error;
            }
          }
        };
        FontData3.prototype.defineChars = function(name2, chars) {
          var e_6, _a2;
          var variant = this.variant[name2];
          Object.assign(variant.chars, chars);
          try {
            for (var _b2 = __values2(variant.linked), _c = _b2.next(); !_c.done; _c = _b2.next()) {
              var link2 = _c.value;
              Object.assign(link2, chars);
            }
          } catch (e_6_1) {
            e_6 = { error: e_6_1 };
          } finally {
            try {
              if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
            } finally {
              if (e_6) throw e_6.error;
            }
          }
        };
        FontData3.prototype.defineDelimiters = function(delims2) {
          Object.assign(this.delimiters, delims2);
        };
        FontData3.prototype.defineRemap = function(name2, remap) {
          if (!this.remapChars.hasOwnProperty(name2)) {
            this.remapChars[name2] = {};
          }
          Object.assign(this.remapChars[name2], remap);
        };
        FontData3.prototype.getDelimiter = function(n) {
          return this.delimiters[n];
        };
        FontData3.prototype.getSizeVariant = function(n, i2) {
          if (this.delimiters[n].variants) {
            i2 = this.delimiters[n].variants[i2];
          }
          return this.sizeVariants[i2];
        };
        FontData3.prototype.getStretchVariant = function(n, i2) {
          return this.stretchVariants[this.delimiters[n].stretchv ? this.delimiters[n].stretchv[i2] : 0];
        };
        FontData3.prototype.getChar = function(name2, n) {
          return this.variant[name2].chars[n];
        };
        FontData3.prototype.getVariant = function(name2) {
          return this.variant[name2];
        };
        FontData3.prototype.getCssFont = function(variant) {
          return this.cssFontMap[variant] || ["serif", false, false];
        };
        FontData3.prototype.getFamily = function(family) {
          return this.cssFamilyPrefix ? this.cssFamilyPrefix + ", " + family : family;
        };
        FontData3.prototype.getRemappedChar = function(name2, c2) {
          var map2 = this.remapChars[name2] || {};
          return map2[c2];
        };
        FontData3.OPTIONS = {
          unknownFamily: "serif"
        };
        FontData3.JAX = "common";
        FontData3.NAME = "";
        FontData3.defaultVariants = [
          ["normal"],
          ["bold", "normal"],
          ["italic", "normal"],
          ["bold-italic", "italic", "bold"],
          ["double-struck", "bold"],
          ["fraktur", "normal"],
          ["bold-fraktur", "bold", "fraktur"],
          ["script", "italic"],
          ["bold-script", "bold-italic", "script"],
          ["sans-serif", "normal"],
          ["bold-sans-serif", "bold", "sans-serif"],
          ["sans-serif-italic", "italic", "sans-serif"],
          ["sans-serif-bold-italic", "bold-italic", "bold-sans-serif"],
          ["monospace", "normal"]
        ];
        FontData3.defaultCssFonts = {
          normal: ["unknown", false, false],
          bold: ["unknown", false, true],
          italic: ["unknown", true, false],
          "bold-italic": ["unknown", true, true],
          "double-struck": ["unknown", false, true],
          fraktur: ["unknown", false, false],
          "bold-fraktur": ["unknown", false, true],
          script: ["cursive", false, false],
          "bold-script": ["cursive", false, true],
          "sans-serif": ["sans-serif", false, false],
          "bold-sans-serif": ["sans-serif", false, true],
          "sans-serif-italic": ["sans-serif", true, false],
          "sans-serif-bold-italic": ["sans-serif", true, true],
          monospace: ["monospace", false, false]
        };
        FontData3.defaultCssFamilyPrefix = "";
        FontData3.VariantSmp = {
          bold: [119808, 119834, 120488, 120514, 120782],
          italic: [119860, 119886, 120546, 120572],
          "bold-italic": [119912, 119938, 120604, 120630],
          script: [119964, 119990],
          "bold-script": [120016, 120042],
          fraktur: [120068, 120094],
          "double-struck": [120120, 120146, , , 120792],
          "bold-fraktur": [120172, 120198],
          "sans-serif": [120224, 120250, , , 120802],
          "bold-sans-serif": [120276, 120302, 120662, 120688, 120812],
          "sans-serif-italic": [120328, 120354],
          "sans-serif-bold-italic": [120380, 120406, 120720, 120746],
          "monospace": [120432, 120458, , , 120822]
        };
        FontData3.SmpRanges = [
          [0, 65, 90],
          [1, 97, 122],
          [2, 913, 937],
          [3, 945, 969],
          [4, 48, 57]
        ];
        FontData3.SmpRemap = {
          119893: 8462,
          119965: 8492,
          119968: 8496,
          119969: 8497,
          119971: 8459,
          119972: 8464,
          119975: 8466,
          119976: 8499,
          119981: 8475,
          119994: 8495,
          119996: 8458,
          120004: 8500,
          120070: 8493,
          120075: 8460,
          120076: 8465,
          120085: 8476,
          120093: 8488,
          120122: 8450,
          120127: 8461,
          120133: 8469,
          120135: 8473,
          120136: 8474,
          120137: 8477,
          120145: 8484
        };
        FontData3.SmpRemapGreekU = {
          8711: 25,
          1012: 17
        };
        FontData3.SmpRemapGreekL = {
          977: 27,
          981: 29,
          982: 31,
          1008: 28,
          1009: 30,
          1013: 26,
          8706: 25
        };
        FontData3.defaultAccentMap = {
          768: "ˋ",
          769: "ˊ",
          770: "ˆ",
          771: "˜",
          772: "ˉ",
          774: "˘",
          775: "˙",
          776: "¨",
          778: "˚",
          780: "ˇ",
          8594: "⃗",
          8242: "'",
          8243: "''",
          8244: "'''",
          8245: "`",
          8246: "``",
          8247: "```",
          8279: "''''",
          8400: "↼",
          8401: "⇀",
          8406: "←",
          8417: "↔",
          8432: "*",
          8411: "...",
          8412: "....",
          8428: "⇁",
          8429: "↽",
          8430: "←",
          8431: "→"
        };
        FontData3.defaultMoMap = {
          45: "−"
        };
        FontData3.defaultMnMap = {
          45: "−"
        };
        FontData3.defaultParams = {
          x_height: 0.442,
          quad: 1,
          num1: 0.676,
          num2: 0.394,
          num3: 0.444,
          denom1: 0.686,
          denom2: 0.345,
          sup1: 0.413,
          sup2: 0.363,
          sup3: 0.289,
          sub1: 0.15,
          sub2: 0.247,
          sup_drop: 0.386,
          sub_drop: 0.05,
          delim1: 2.39,
          delim2: 1,
          axis_height: 0.25,
          rule_thickness: 0.06,
          big_op_spacing1: 0.111,
          big_op_spacing2: 0.167,
          big_op_spacing3: 0.2,
          big_op_spacing4: 0.6,
          big_op_spacing5: 0.1,
          surd_height: 0.075,
          scriptspace: 0.05,
          nulldelimiterspace: 0.12,
          delimiterfactor: 901,
          delimitershortfall: 0.3,
          min_rule_thickness: 1.25,
          separation_factor: 1.75,
          extra_ic: 0.033
        };
        FontData3.defaultDelimiters = {};
        FontData3.defaultChars = {};
        FontData3.defaultSizeVariants = [];
        FontData3.defaultStretchVariants = [];
        return FontData3;
      })();
      FontData$1.FontData = FontData2;
      return FontData$1;
    }
    var hasRequiredWrapper$1;
    function requireWrapper$1() {
      if (hasRequiredWrapper$1) return Wrapper$1;
      hasRequiredWrapper$1 = 1;
      var __extends2 = Wrapper$1 && Wrapper$1.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      var __createBinding2 = Wrapper$1 && Wrapper$1.__createBinding || (Object.create ? (function(o, m, k2, k22) {
        if (k22 === void 0) k22 = k2;
        var desc = Object.getOwnPropertyDescriptor(m, k2);
        if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
          desc = { enumerable: true, get: function() {
            return m[k2];
          } };
        }
        Object.defineProperty(o, k22, desc);
      }) : (function(o, m, k2, k22) {
        if (k22 === void 0) k22 = k2;
        o[k22] = m[k2];
      }));
      var __setModuleDefault2 = Wrapper$1 && Wrapper$1.__setModuleDefault || (Object.create ? (function(o, v) {
        Object.defineProperty(o, "default", { enumerable: true, value: v });
      }) : function(o, v) {
        o["default"] = v;
      });
      var __importStar2 = Wrapper$1 && Wrapper$1.__importStar || function(mod2) {
        if (mod2 && mod2.__esModule) return mod2;
        var result2 = {};
        if (mod2 != null) {
          for (var k2 in mod2) if (k2 !== "default" && Object.prototype.hasOwnProperty.call(mod2, k2)) __createBinding2(result2, mod2, k2);
        }
        __setModuleDefault2(result2, mod2);
        return result2;
      };
      var __values2 = Wrapper$1 && Wrapper$1.__values || function(o) {
        var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i2 = 0;
        if (m) return m.call(o);
        if (o && typeof o.length === "number") return {
          next: function() {
            if (o && i2 >= o.length) o = void 0;
            return { value: o && o[i2++], done: !o };
          }
        };
        throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
      };
      var __read2 = Wrapper$1 && Wrapper$1.__read || function(o, n) {
        var m = typeof Symbol === "function" && o[Symbol.iterator];
        if (!m) return o;
        var i2 = m.call(o), r2, ar2 = [], e;
        try {
          while ((n === void 0 || n-- > 0) && !(r2 = i2.next()).done) ar2.push(r2.value);
        } catch (error2) {
          e = { error: error2 };
        } finally {
          try {
            if (r2 && !r2.done && (m = i2["return"])) m.call(i2);
          } finally {
            if (e) throw e.error;
          }
        }
        return ar2;
      };
      var __spreadArray2 = Wrapper$1 && Wrapper$1.__spreadArray || function(to2, from, pack) {
        if (pack || arguments.length === 2) for (var i2 = 0, l = from.length, ar2; i2 < l; i2++) {
          if (ar2 || !(i2 in from)) {
            if (!ar2) ar2 = Array.prototype.slice.call(from, 0, i2);
            ar2[i2] = from[i2];
          }
        }
        return to2.concat(ar2 || Array.prototype.slice.call(from));
      };
      Object.defineProperty(Wrapper$1, "__esModule", { value: true });
      Wrapper$1.CommonWrapper = void 0;
      var Wrapper_js_1 = requireWrapper$2();
      var MmlNode_js_1 = requireMmlNode();
      var string_js_1 = requireString();
      var LENGTHS = __importStar2(requireLengths());
      var Styles_js_1 = requireStyles();
      var BBox_js_1 = requireBBox();
      var FontData_js_1 = requireFontData$1();
      var SMALLSIZE = 2 / 18;
      function MathMLSpace(script2, size) {
        return script2 ? size < SMALLSIZE ? 0 : SMALLSIZE : size;
      }
      var CommonWrapper = (function(_super) {
        __extends2(CommonWrapper2, _super);
        function CommonWrapper2(factory, node2, parent) {
          if (parent === void 0) {
            parent = null;
          }
          var _this = _super.call(this, factory, node2) || this;
          _this.parent = null;
          _this.removedStyles = null;
          _this.styles = null;
          _this.variant = "";
          _this.bboxComputed = false;
          _this.stretch = FontData_js_1.NOSTRETCH;
          _this.font = null;
          _this.parent = parent;
          _this.font = factory.jax.font;
          _this.bbox = BBox_js_1.BBox.zero();
          _this.getStyles();
          _this.getVariant();
          _this.getScale();
          _this.getSpace();
          _this.childNodes = node2.childNodes.map(function(child) {
            var wrapped = _this.wrap(child);
            if (wrapped.bbox.pwidth && (node2.notParent || node2.isKind("math"))) {
              _this.bbox.pwidth = BBox_js_1.BBox.fullWidth;
            }
            return wrapped;
          });
          return _this;
        }
        Object.defineProperty(CommonWrapper2.prototype, "jax", {
          get: function() {
            return this.factory.jax;
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(CommonWrapper2.prototype, "adaptor", {
          get: function() {
            return this.factory.jax.adaptor;
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(CommonWrapper2.prototype, "metrics", {
          get: function() {
            return this.factory.jax.math.metrics;
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(CommonWrapper2.prototype, "fixesPWidth", {
          get: function() {
            return !this.node.notParent && !this.node.isToken;
          },
          enumerable: false,
          configurable: true
        });
        CommonWrapper2.prototype.wrap = function(node2, parent) {
          if (parent === void 0) {
            parent = null;
          }
          var wrapped = this.factory.wrap(node2, parent || this);
          if (parent) {
            parent.childNodes.push(wrapped);
          }
          this.jax.nodeMap.set(node2, wrapped);
          return wrapped;
        };
        CommonWrapper2.prototype.getBBox = function(save) {
          if (save === void 0) {
            save = true;
          }
          if (this.bboxComputed) {
            return this.bbox;
          }
          var bbox = save ? this.bbox : BBox_js_1.BBox.zero();
          this.computeBBox(bbox);
          this.bboxComputed = save;
          return bbox;
        };
        CommonWrapper2.prototype.getOuterBBox = function(save) {
          var e_1, _a2;
          if (save === void 0) {
            save = true;
          }
          var bbox = this.getBBox(save);
          if (!this.styles)
            return bbox;
          var obox = new BBox_js_1.BBox();
          Object.assign(obox, bbox);
          try {
            for (var _b2 = __values2(BBox_js_1.BBox.StyleAdjust), _c = _b2.next(); !_c.done; _c = _b2.next()) {
              var _d = __read2(_c.value, 2), name_1 = _d[0], side = _d[1];
              var x2 = this.styles.get(name_1);
              if (x2) {
                obox[side] += this.length2em(x2, 1, obox.rscale);
              }
            }
          } catch (e_1_1) {
            e_1 = { error: e_1_1 };
          } finally {
            try {
              if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
            } finally {
              if (e_1) throw e_1.error;
            }
          }
          return obox;
        };
        CommonWrapper2.prototype.computeBBox = function(bbox, recompute) {
          var e_2, _a2;
          if (recompute === void 0) {
            recompute = false;
          }
          bbox.empty();
          try {
            for (var _b2 = __values2(this.childNodes), _c = _b2.next(); !_c.done; _c = _b2.next()) {
              var child = _c.value;
              bbox.append(child.getOuterBBox());
            }
          } catch (e_2_1) {
            e_2 = { error: e_2_1 };
          } finally {
            try {
              if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
            } finally {
              if (e_2) throw e_2.error;
            }
          }
          bbox.clean();
          if (this.fixesPWidth && this.setChildPWidths(recompute)) {
            this.computeBBox(bbox, true);
          }
        };
        CommonWrapper2.prototype.setChildPWidths = function(recompute, w, clear) {
          var e_3, _a2;
          if (w === void 0) {
            w = null;
          }
          if (clear === void 0) {
            clear = true;
          }
          if (recompute) {
            return false;
          }
          if (clear) {
            this.bbox.pwidth = "";
          }
          var changed = false;
          try {
            for (var _b2 = __values2(this.childNodes), _c = _b2.next(); !_c.done; _c = _b2.next()) {
              var child = _c.value;
              var cbox = child.getOuterBBox();
              if (cbox.pwidth && child.setChildPWidths(recompute, w === null ? cbox.w : w, clear)) {
                changed = true;
              }
            }
          } catch (e_3_1) {
            e_3 = { error: e_3_1 };
          } finally {
            try {
              if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
            } finally {
              if (e_3) throw e_3.error;
            }
          }
          return changed;
        };
        CommonWrapper2.prototype.invalidateBBox = function() {
          if (this.bboxComputed) {
            this.bboxComputed = false;
            if (this.parent) {
              this.parent.invalidateBBox();
            }
          }
        };
        CommonWrapper2.prototype.copySkewIC = function(bbox) {
          var first = this.childNodes[0];
          if (first === null || first === void 0 ? void 0 : first.bbox.sk) {
            bbox.sk = first.bbox.sk;
          }
          if (first === null || first === void 0 ? void 0 : first.bbox.dx) {
            bbox.dx = first.bbox.dx;
          }
          var last = this.childNodes[this.childNodes.length - 1];
          if (last === null || last === void 0 ? void 0 : last.bbox.ic) {
            bbox.ic = last.bbox.ic;
            bbox.w += bbox.ic;
          }
        };
        CommonWrapper2.prototype.getStyles = function() {
          var styleString = this.node.attributes.getExplicit("style");
          if (!styleString)
            return;
          var style2 = this.styles = new Styles_js_1.Styles(styleString);
          for (var i2 = 0, m = CommonWrapper2.removeStyles.length; i2 < m; i2++) {
            var id = CommonWrapper2.removeStyles[i2];
            if (style2.get(id)) {
              if (!this.removedStyles)
                this.removedStyles = {};
              this.removedStyles[id] = style2.get(id);
              style2.set(id, "");
            }
          }
        };
        CommonWrapper2.prototype.getVariant = function() {
          if (!this.node.isToken)
            return;
          var attributes2 = this.node.attributes;
          var variant = attributes2.get("mathvariant");
          if (!attributes2.getExplicit("mathvariant")) {
            var values = attributes2.getList("fontfamily", "fontweight", "fontstyle");
            if (this.removedStyles) {
              var style2 = this.removedStyles;
              if (style2.fontFamily)
                values.family = style2.fontFamily;
              if (style2.fontWeight)
                values.weight = style2.fontWeight;
              if (style2.fontStyle)
                values.style = style2.fontStyle;
            }
            if (values.fontfamily)
              values.family = values.fontfamily;
            if (values.fontweight)
              values.weight = values.fontweight;
            if (values.fontstyle)
              values.style = values.fontstyle;
            if (values.weight && values.weight.match(/^\d+$/)) {
              values.weight = parseInt(values.weight) > 600 ? "bold" : "normal";
            }
            if (values.family) {
              variant = this.explicitVariant(values.family, values.weight, values.style);
            } else {
              if (this.node.getProperty("variantForm"))
                variant = "-tex-variant";
              variant = (CommonWrapper2.BOLDVARIANTS[values.weight] || {})[variant] || variant;
              variant = (CommonWrapper2.ITALICVARIANTS[values.style] || {})[variant] || variant;
            }
          }
          this.variant = variant;
        };
        CommonWrapper2.prototype.explicitVariant = function(fontFamily, fontWeight, fontStyle) {
          var style2 = this.styles;
          if (!style2)
            style2 = this.styles = new Styles_js_1.Styles();
          style2.set("fontFamily", fontFamily);
          if (fontWeight)
            style2.set("fontWeight", fontWeight);
          if (fontStyle)
            style2.set("fontStyle", fontStyle);
          return "-explicitFont";
        };
        CommonWrapper2.prototype.getScale = function() {
          var scale = 1, parent = this.parent;
          var pscale = parent ? parent.bbox.scale : 1;
          var attributes2 = this.node.attributes;
          var scriptlevel = Math.min(attributes2.get("scriptlevel"), 2);
          var fontsize = attributes2.get("fontsize");
          var mathsize = this.node.isToken || this.node.isKind("mstyle") ? attributes2.get("mathsize") : attributes2.getInherited("mathsize");
          if (scriptlevel !== 0) {
            scale = Math.pow(attributes2.get("scriptsizemultiplier"), scriptlevel);
            var scriptminsize = this.length2em(attributes2.get("scriptminsize"), 0.8, 1);
            if (scale < scriptminsize)
              scale = scriptminsize;
          }
          if (this.removedStyles && this.removedStyles.fontSize && !fontsize) {
            fontsize = this.removedStyles.fontSize;
          }
          if (fontsize && !attributes2.getExplicit("mathsize")) {
            mathsize = fontsize;
          }
          if (mathsize !== "1") {
            scale *= this.length2em(mathsize, 1, 1);
          }
          this.bbox.scale = scale;
          this.bbox.rscale = scale / pscale;
        };
        CommonWrapper2.prototype.getSpace = function() {
          var isTop = this.isTopEmbellished();
          var hasSpacing = this.node.hasSpacingAttributes();
          if (this.jax.options.mathmlSpacing || hasSpacing) {
            isTop && this.getMathMLSpacing();
          } else {
            this.getTeXSpacing(isTop, hasSpacing);
          }
        };
        CommonWrapper2.prototype.getMathMLSpacing = function() {
          var node2 = this.node.coreMO();
          var child = node2.coreParent();
          var parent = child.parent;
          if (!parent || !parent.isKind("mrow") || parent.childNodes.length === 1)
            return;
          var attributes2 = node2.attributes;
          var isScript = attributes2.get("scriptlevel") > 0;
          this.bbox.L = attributes2.isSet("lspace") ? Math.max(0, this.length2em(attributes2.get("lspace"))) : MathMLSpace(isScript, node2.lspace);
          this.bbox.R = attributes2.isSet("rspace") ? Math.max(0, this.length2em(attributes2.get("rspace"))) : MathMLSpace(isScript, node2.rspace);
          var n = parent.childIndex(child);
          if (n === 0)
            return;
          var prev = parent.childNodes[n - 1];
          if (!prev.isEmbellished)
            return;
          var bbox = this.jax.nodeMap.get(prev).getBBox();
          if (bbox.R) {
            this.bbox.L = Math.max(0, this.bbox.L - bbox.R);
          }
        };
        CommonWrapper2.prototype.getTeXSpacing = function(isTop, hasSpacing) {
          if (!hasSpacing) {
            var space = this.node.texSpacing();
            if (space) {
              this.bbox.L = this.length2em(space);
            }
          }
          if (isTop || hasSpacing) {
            var attributes2 = this.node.coreMO().attributes;
            if (attributes2.isSet("lspace")) {
              this.bbox.L = Math.max(0, this.length2em(attributes2.get("lspace")));
            }
            if (attributes2.isSet("rspace")) {
              this.bbox.R = Math.max(0, this.length2em(attributes2.get("rspace")));
            }
          }
        };
        CommonWrapper2.prototype.isTopEmbellished = function() {
          return this.node.isEmbellished && !(this.node.parent && this.node.parent.isEmbellished);
        };
        CommonWrapper2.prototype.core = function() {
          return this.jax.nodeMap.get(this.node.core());
        };
        CommonWrapper2.prototype.coreMO = function() {
          return this.jax.nodeMap.get(this.node.coreMO());
        };
        CommonWrapper2.prototype.getText = function() {
          var e_4, _a2;
          var text2 = "";
          if (this.node.isToken) {
            try {
              for (var _b2 = __values2(this.node.childNodes), _c = _b2.next(); !_c.done; _c = _b2.next()) {
                var child = _c.value;
                if (child instanceof MmlNode_js_1.TextNode) {
                  text2 += child.getText();
                }
              }
            } catch (e_4_1) {
              e_4 = { error: e_4_1 };
            } finally {
              try {
                if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
              } finally {
                if (e_4) throw e_4.error;
              }
            }
          }
          return text2;
        };
        CommonWrapper2.prototype.canStretch = function(direction) {
          this.stretch = FontData_js_1.NOSTRETCH;
          if (this.node.isEmbellished) {
            var core = this.core();
            if (core && core.node !== this.node) {
              if (core.canStretch(direction)) {
                this.stretch = core.stretch;
              }
            }
          }
          return this.stretch.dir !== 0;
        };
        CommonWrapper2.prototype.getAlignShift = function() {
          var _a2;
          var _b2 = (_a2 = this.node.attributes).getList.apply(_a2, __spreadArray2([], __read2(MmlNode_js_1.indentAttributes), false)), indentalign = _b2.indentalign, indentshift = _b2.indentshift, indentalignfirst = _b2.indentalignfirst, indentshiftfirst = _b2.indentshiftfirst;
          if (indentalignfirst !== "indentalign") {
            indentalign = indentalignfirst;
          }
          if (indentalign === "auto") {
            indentalign = this.jax.options.displayAlign;
          }
          if (indentshiftfirst !== "indentshift") {
            indentshift = indentshiftfirst;
          }
          if (indentshift === "auto") {
            indentshift = this.jax.options.displayIndent;
            if (indentalign === "right" && !indentshift.match(/^\s*0[a-z]*\s*$/)) {
              indentshift = ("-" + indentshift.trim()).replace(/^--/, "");
            }
          }
          var shift2 = this.length2em(indentshift, this.metrics.containerWidth);
          return [indentalign, shift2];
        };
        CommonWrapper2.prototype.getAlignX = function(W, bbox, align) {
          return align === "right" ? W - (bbox.w + bbox.R) * bbox.rscale : align === "left" ? bbox.L * bbox.rscale : (W - bbox.w * bbox.rscale) / 2;
        };
        CommonWrapper2.prototype.getAlignY = function(H, D2, h, d, align) {
          return align === "top" ? H - h : align === "bottom" ? d - D2 : align === "center" ? (H - h - (D2 - d)) / 2 : 0;
        };
        CommonWrapper2.prototype.getWrapWidth = function(i2) {
          return this.childNodes[i2].getBBox().w;
        };
        CommonWrapper2.prototype.getChildAlign = function(_i) {
          return "left";
        };
        CommonWrapper2.prototype.percent = function(m) {
          return LENGTHS.percent(m);
        };
        CommonWrapper2.prototype.em = function(m) {
          return LENGTHS.em(m);
        };
        CommonWrapper2.prototype.px = function(m, M) {
          if (M === void 0) {
            M = -LENGTHS.BIGDIMEN;
          }
          return LENGTHS.px(m, M, this.metrics.em);
        };
        CommonWrapper2.prototype.length2em = function(length, size, scale) {
          if (size === void 0) {
            size = 1;
          }
          if (scale === void 0) {
            scale = null;
          }
          if (scale === null) {
            scale = this.bbox.scale;
          }
          return LENGTHS.length2em(length, size, scale, this.jax.pxPerEm);
        };
        CommonWrapper2.prototype.unicodeChars = function(text2, name2) {
          if (name2 === void 0) {
            name2 = this.variant;
          }
          var chars = (0, string_js_1.unicodeChars)(text2);
          var variant = this.font.getVariant(name2);
          if (variant && variant.chars) {
            var map_1 = variant.chars;
            chars = chars.map(function(n) {
              return ((map_1[n] || [])[3] || {}).smp || n;
            });
          }
          return chars;
        };
        CommonWrapper2.prototype.remapChars = function(chars) {
          return chars;
        };
        CommonWrapper2.prototype.mmlText = function(text2) {
          return this.node.factory.create("text").setText(text2);
        };
        CommonWrapper2.prototype.mmlNode = function(kind, properties, children2) {
          if (properties === void 0) {
            properties = {};
          }
          if (children2 === void 0) {
            children2 = [];
          }
          return this.node.factory.create(kind, properties, children2);
        };
        CommonWrapper2.prototype.createMo = function(text2) {
          var mmlFactory = this.node.factory;
          var textNode = mmlFactory.create("text").setText(text2);
          var mml = mmlFactory.create("mo", { stretchy: true }, [textNode]);
          mml.inheritAttributesFrom(this.node);
          var node2 = this.wrap(mml);
          node2.parent = this;
          return node2;
        };
        CommonWrapper2.prototype.getVariantChar = function(variant, n) {
          var char = this.font.getChar(variant, n) || [0, 0, 0, { unknown: true }];
          if (char.length === 3) {
            char[3] = {};
          }
          return char;
        };
        CommonWrapper2.kind = "unknown";
        CommonWrapper2.styles = {};
        CommonWrapper2.removeStyles = [
          "fontSize",
          "fontFamily",
          "fontWeight",
          "fontStyle",
          "fontVariant",
          "font"
        ];
        CommonWrapper2.skipAttributes = {
          fontfamily: true,
          fontsize: true,
          fontweight: true,
          fontstyle: true,
          color: true,
          background: true,
          "class": true,
          href: true,
          style: true,
          xmlns: true
        };
        CommonWrapper2.BOLDVARIANTS = {
          bold: {
            normal: "bold",
            italic: "bold-italic",
            fraktur: "bold-fraktur",
            script: "bold-script",
            "sans-serif": "bold-sans-serif",
            "sans-serif-italic": "sans-serif-bold-italic"
          },
          normal: {
            bold: "normal",
            "bold-italic": "italic",
            "bold-fraktur": "fraktur",
            "bold-script": "script",
            "bold-sans-serif": "sans-serif",
            "sans-serif-bold-italic": "sans-serif-italic"
          }
        };
        CommonWrapper2.ITALICVARIANTS = {
          italic: {
            normal: "italic",
            bold: "bold-italic",
            "sans-serif": "sans-serif-italic",
            "bold-sans-serif": "sans-serif-bold-italic"
          },
          normal: {
            italic: "normal",
            "bold-italic": "bold",
            "sans-serif-italic": "sans-serif",
            "sans-serif-bold-italic": "bold-sans-serif"
          }
        };
        return CommonWrapper2;
      })(Wrapper_js_1.AbstractWrapper);
      Wrapper$1.CommonWrapper = CommonWrapper;
      return Wrapper$1;
    }
    var hasRequiredWrapper;
    function requireWrapper() {
      if (hasRequiredWrapper) return Wrapper$2;
      hasRequiredWrapper = 1;
      var __extends2 = Wrapper$2 && Wrapper$2.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      var __values2 = Wrapper$2 && Wrapper$2.__values || function(o) {
        var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i2 = 0;
        if (m) return m.call(o);
        if (o && typeof o.length === "number") return {
          next: function() {
            if (o && i2 >= o.length) o = void 0;
            return { value: o && o[i2++], done: !o };
          }
        };
        throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
      };
      var __read2 = Wrapper$2 && Wrapper$2.__read || function(o, n) {
        var m = typeof Symbol === "function" && o[Symbol.iterator];
        if (!m) return o;
        var i2 = m.call(o), r2, ar2 = [], e;
        try {
          while ((n === void 0 || n-- > 0) && !(r2 = i2.next()).done) ar2.push(r2.value);
        } catch (error2) {
          e = { error: error2 };
        } finally {
          try {
            if (r2 && !r2.done && (m = i2["return"])) m.call(i2);
          } finally {
            if (e) throw e.error;
          }
        }
        return ar2;
      };
      Object.defineProperty(Wrapper$2, "__esModule", { value: true });
      Wrapper$2.SVGWrapper = void 0;
      var BBox_js_1 = requireBBox();
      var Wrapper_js_1 = requireWrapper$1();
      var svg_js_1 = requireSvg();
      var SVGWrapper = (function(_super) {
        __extends2(SVGWrapper2, _super);
        function SVGWrapper2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.element = null;
          _this.dx = 0;
          return _this;
        }
        SVGWrapper2.prototype.toSVG = function(parent) {
          this.addChildren(this.standardSVGnode(parent));
        };
        SVGWrapper2.prototype.addChildren = function(parent) {
          var e_1, _a2;
          var x2 = 0;
          try {
            for (var _b2 = __values2(this.childNodes), _c = _b2.next(); !_c.done; _c = _b2.next()) {
              var child = _c.value;
              child.toSVG(parent);
              var bbox = child.getOuterBBox();
              if (child.element) {
                child.place(x2 + bbox.L * bbox.rscale, 0);
              }
              x2 += (bbox.L + bbox.w + bbox.R) * bbox.rscale;
            }
          } catch (e_1_1) {
            e_1 = { error: e_1_1 };
          } finally {
            try {
              if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
            } finally {
              if (e_1) throw e_1.error;
            }
          }
        };
        SVGWrapper2.prototype.standardSVGnode = function(parent) {
          var svg2 = this.createSVGnode(parent);
          this.handleStyles();
          this.handleScale();
          this.handleBorder();
          this.handleColor();
          this.handleAttributes();
          return svg2;
        };
        SVGWrapper2.prototype.createSVGnode = function(parent) {
          this.element = this.svg("g", { "data-mml-node": this.node.kind });
          var href = this.node.attributes.get("href");
          if (href) {
            parent = this.adaptor.append(parent, this.svg("a", { href }));
            var _a2 = this.getOuterBBox(), h = _a2.h, d = _a2.d, w = _a2.w;
            this.adaptor.append(this.element, this.svg("rect", {
              "data-hitbox": true,
              fill: "none",
              stroke: "none",
              "pointer-events": "all",
              width: this.fixed(w),
              height: this.fixed(h + d),
              y: this.fixed(-d)
            }));
          }
          this.adaptor.append(parent, this.element);
          return this.element;
        };
        SVGWrapper2.prototype.handleStyles = function() {
          var _this = this;
          if (!this.styles)
            return;
          var styles2 = this.styles.cssText;
          if (styles2) {
            this.adaptor.setAttribute(this.element, "style", styles2);
          }
          BBox_js_1.BBox.StyleAdjust.forEach(function(_a2) {
            var _b2 = __read2(_a2, 3), name2 = _b2[0], lr2 = _b2[2];
            if (lr2 !== 0)
              return;
            var x2 = _this.styles.get(name2);
            if (x2) {
              _this.dx += _this.length2em(x2, 1, _this.bbox.rscale);
            }
          });
        };
        SVGWrapper2.prototype.handleScale = function() {
          if (this.bbox.rscale !== 1) {
            var scale = "scale(" + this.fixed(this.bbox.rscale / 1e3, 3) + ")";
            this.adaptor.setAttribute(this.element, "transform", scale);
          }
        };
        SVGWrapper2.prototype.handleColor = function() {
          var _a2;
          var adaptor = this.adaptor;
          var attributes2 = this.node.attributes;
          var mathcolor = attributes2.getExplicit("mathcolor");
          var color = attributes2.getExplicit("color");
          var mathbackground = attributes2.getExplicit("mathbackground");
          var background = attributes2.getExplicit("background");
          var bgcolor = ((_a2 = this.styles) === null || _a2 === void 0 ? void 0 : _a2.get("background-color")) || "";
          if (mathcolor || color) {
            adaptor.setAttribute(this.element, "fill", mathcolor || color);
            adaptor.setAttribute(this.element, "stroke", mathcolor || color);
          }
          if (mathbackground || background || bgcolor) {
            var _b2 = this.getOuterBBox(), h = _b2.h, d = _b2.d, w = _b2.w;
            var rect2 = this.svg("rect", {
              fill: mathbackground || background || bgcolor,
              x: this.fixed(-this.dx),
              y: this.fixed(-d),
              width: this.fixed(w),
              height: this.fixed(h + d),
              "data-bgcolor": true
            });
            var child = adaptor.firstChild(this.element);
            if (child) {
              adaptor.insert(rect2, child);
            } else {
              adaptor.append(this.element, rect2);
            }
          }
        };
        SVGWrapper2.prototype.handleBorder = function() {
          var e_2, _a2, e_3, _b2;
          if (!this.styles)
            return;
          var width = Array(4).fill(0);
          var style2 = Array(4);
          var color = Array(4);
          try {
            for (var _c = __values2([["Top", 0], ["Right", 1], ["Bottom", 2], ["Left", 3]]), _d = _c.next(); !_d.done; _d = _c.next()) {
              var _e2 = __read2(_d.value, 2), name_1 = _e2[0], i2 = _e2[1];
              var key2 = "border" + name_1;
              var w_1 = this.styles.get(key2 + "Width");
              if (!w_1)
                continue;
              width[i2] = Math.max(0, this.length2em(w_1, 1, this.bbox.rscale));
              style2[i2] = this.styles.get(key2 + "Style") || "solid";
              color[i2] = this.styles.get(key2 + "Color") || "currentColor";
            }
          } catch (e_2_1) {
            e_2 = { error: e_2_1 };
          } finally {
            try {
              if (_d && !_d.done && (_a2 = _c.return)) _a2.call(_c);
            } finally {
              if (e_2) throw e_2.error;
            }
          }
          var f = SVGWrapper2.borderFuzz;
          var bbox = this.getOuterBBox();
          var _f = __read2([bbox.h + f, bbox.d + f, bbox.w + f], 3), h = _f[0], d = _f[1], w = _f[2];
          var outerRT = [w, h];
          var outerLT = [-f, h];
          var outerRB = [w, -d];
          var outerLB = [-f, -d];
          var innerRT = [w - width[1], h - width[0]];
          var innerLT = [-f + width[3], h - width[0]];
          var innerRB = [w - width[1], -d + width[2]];
          var innerLB = [-f + width[3], -d + width[2]];
          var paths = [
            [outerLT, outerRT, innerRT, innerLT],
            [outerRB, outerRT, innerRT, innerRB],
            [outerLB, outerRB, innerRB, innerLB],
            [outerLB, outerLT, innerLT, innerLB]
          ];
          var adaptor = this.adaptor;
          var child = adaptor.firstChild(this.element);
          try {
            for (var _g = __values2([0, 1, 2, 3]), _h = _g.next(); !_h.done; _h = _g.next()) {
              var i2 = _h.value;
              if (!width[i2])
                continue;
              var path = paths[i2];
              if (style2[i2] === "dashed" || style2[i2] === "dotted") {
                this.addBorderBroken(path, color[i2], style2[i2], width[i2], i2);
              } else {
                this.addBorderSolid(path, color[i2], child);
              }
            }
          } catch (e_3_1) {
            e_3 = { error: e_3_1 };
          } finally {
            try {
              if (_h && !_h.done && (_b2 = _g.return)) _b2.call(_g);
            } finally {
              if (e_3) throw e_3.error;
            }
          }
        };
        SVGWrapper2.prototype.addBorderSolid = function(path, color, child) {
          var _this = this;
          var border = this.svg("polygon", {
            points: path.map(function(_a2) {
              var _b2 = __read2(_a2, 2), x2 = _b2[0], y = _b2[1];
              return "".concat(_this.fixed(x2 - _this.dx), ",").concat(_this.fixed(y));
            }).join(" "),
            stroke: "none",
            fill: color
          });
          if (child) {
            this.adaptor.insert(border, child);
          } else {
            this.adaptor.append(this.element, border);
          }
        };
        SVGWrapper2.prototype.addBorderBroken = function(path, color, style2, t2, i2) {
          var dot2 = style2 === "dotted";
          var t22 = t2 / 2;
          var _a2 = __read2([[t22, -t22, -t22, -t22], [-t22, t22, -t22, -t22], [t22, t22, -t22, t22], [t22, t22, t22, -t22]][i2], 4), tx1 = _a2[0], ty1 = _a2[1], tx2 = _a2[2], ty2 = _a2[3];
          var _b2 = __read2(path, 2), A2 = _b2[0], B = _b2[1];
          var x1 = A2[0] + tx1 - this.dx, y1 = A2[1] + ty1;
          var x2 = B[0] + tx2 - this.dx, y2 = B[1] + ty2;
          var W = Math.abs(i2 % 2 ? y2 - y1 : x2 - x1);
          var n = dot2 ? Math.ceil(W / (2 * t2)) : Math.ceil((W - t2) / (4 * t2));
          var m = W / (4 * n + 1);
          var line2 = this.svg("line", {
            x1: this.fixed(x1),
            y1: this.fixed(y1),
            x2: this.fixed(x2),
            y2: this.fixed(y2),
            "stroke-width": this.fixed(t2),
            stroke: color,
            "stroke-linecap": dot2 ? "round" : "square",
            "stroke-dasharray": dot2 ? [1, this.fixed(W / n - 2e-3)].join(" ") : [this.fixed(m), this.fixed(3 * m)].join(" ")
          });
          var adaptor = this.adaptor;
          var child = adaptor.firstChild(this.element);
          if (child) {
            adaptor.insert(line2, child);
          } else {
            adaptor.append(this.element, line2);
          }
        };
        SVGWrapper2.prototype.handleAttributes = function() {
          var e_4, _a2, e_5, _b2;
          var attributes2 = this.node.attributes;
          var defaults = attributes2.getAllDefaults();
          var skip = SVGWrapper2.skipAttributes;
          try {
            for (var _c = __values2(attributes2.getExplicitNames()), _d = _c.next(); !_d.done; _d = _c.next()) {
              var name_2 = _d.value;
              if (skip[name_2] === false || !(name_2 in defaults) && !skip[name_2] && !this.adaptor.hasAttribute(this.element, name_2)) {
                this.adaptor.setAttribute(this.element, name_2, attributes2.getExplicit(name_2));
              }
            }
          } catch (e_4_1) {
            e_4 = { error: e_4_1 };
          } finally {
            try {
              if (_d && !_d.done && (_a2 = _c.return)) _a2.call(_c);
            } finally {
              if (e_4) throw e_4.error;
            }
          }
          if (attributes2.get("class")) {
            var names = attributes2.get("class").trim().split(/ +/);
            try {
              for (var names_1 = __values2(names), names_1_1 = names_1.next(); !names_1_1.done; names_1_1 = names_1.next()) {
                var name_3 = names_1_1.value;
                this.adaptor.addClass(this.element, name_3);
              }
            } catch (e_5_1) {
              e_5 = { error: e_5_1 };
            } finally {
              try {
                if (names_1_1 && !names_1_1.done && (_b2 = names_1.return)) _b2.call(names_1);
              } finally {
                if (e_5) throw e_5.error;
              }
            }
          }
        };
        SVGWrapper2.prototype.place = function(x2, y, element) {
          if (element === void 0) {
            element = null;
          }
          x2 += this.dx;
          if (!(x2 || y))
            return;
          if (!element) {
            element = this.element;
            y = this.handleId(y);
          }
          var translate = "translate(".concat(this.fixed(x2), ",").concat(this.fixed(y), ")");
          var transform = this.adaptor.getAttribute(element, "transform") || "";
          this.adaptor.setAttribute(element, "transform", translate + (transform ? " " + transform : ""));
        };
        SVGWrapper2.prototype.handleId = function(y) {
          if (!this.node.attributes || !this.node.attributes.get("id")) {
            return y;
          }
          var adaptor = this.adaptor;
          var h = this.getBBox().h;
          var children2 = adaptor.childNodes(this.element);
          children2.forEach(function(child) {
            return adaptor.remove(child);
          });
          var g = this.svg("g", { "data-idbox": true, transform: "translate(0,".concat(this.fixed(-h), ")") }, children2);
          adaptor.append(this.element, this.svg("text", { "data-id-align": true }, [this.text("")]));
          adaptor.append(this.element, g);
          return y + h;
        };
        SVGWrapper2.prototype.firstChild = function() {
          var adaptor = this.adaptor;
          var child = adaptor.firstChild(this.element);
          if (child && adaptor.kind(child) === "text" && adaptor.getAttribute(child, "data-id-align")) {
            child = adaptor.firstChild(adaptor.next(child));
          }
          if (child && adaptor.kind(child) === "rect" && adaptor.getAttribute(child, "data-hitbox")) {
            child = adaptor.next(child);
          }
          return child;
        };
        SVGWrapper2.prototype.placeChar = function(n, x2, y, parent, variant) {
          var e_6, _a2;
          if (variant === void 0) {
            variant = null;
          }
          if (variant === null) {
            variant = this.variant;
          }
          var C2 = n.toString(16).toUpperCase();
          var _b2 = __read2(this.getVariantChar(variant, n), 4), w = _b2[2], data = _b2[3];
          if ("p" in data) {
            var path = data.p ? "M" + data.p + "Z" : "";
            this.place(x2, y, this.adaptor.append(parent, this.charNode(variant, C2, path)));
          } else if ("c" in data) {
            var g = this.adaptor.append(parent, this.svg("g", { "data-c": C2 }));
            this.place(x2, y, g);
            x2 = 0;
            try {
              for (var _c = __values2(this.unicodeChars(data.c, variant)), _d = _c.next(); !_d.done; _d = _c.next()) {
                var n_1 = _d.value;
                x2 += this.placeChar(n_1, x2, y, g, variant);
              }
            } catch (e_6_1) {
              e_6 = { error: e_6_1 };
            } finally {
              try {
                if (_d && !_d.done && (_a2 = _c.return)) _a2.call(_c);
              } finally {
                if (e_6) throw e_6.error;
              }
            }
          } else if (data.unknown) {
            var char = String.fromCodePoint(n);
            var text2 = this.adaptor.append(parent, this.jax.unknownText(char, variant));
            this.place(x2, y, text2);
            return this.jax.measureTextNodeWithCache(text2, char, variant).w;
          }
          return w;
        };
        SVGWrapper2.prototype.charNode = function(variant, C2, path) {
          var cache = this.jax.options.fontCache;
          return cache !== "none" ? this.useNode(variant, C2, path) : this.pathNode(C2, path);
        };
        SVGWrapper2.prototype.pathNode = function(C2, path) {
          return this.svg("path", { "data-c": C2, d: path });
        };
        SVGWrapper2.prototype.useNode = function(variant, C2, path) {
          var use2 = this.svg("use", { "data-c": C2 });
          var id = "#" + this.jax.fontCache.cachePath(variant, C2, path);
          this.adaptor.setAttribute(use2, "href", id, svg_js_1.XLINKNS);
          return use2;
        };
        SVGWrapper2.prototype.drawBBox = function() {
          var _a2 = this.getBBox(), w = _a2.w, h = _a2.h, d = _a2.d;
          var box = this.svg("g", { style: {
            opacity: 0.25
          } }, [
            this.svg("rect", {
              fill: "red",
              height: this.fixed(h),
              width: this.fixed(w)
            }),
            this.svg("rect", {
              fill: "green",
              height: this.fixed(d),
              width: this.fixed(w),
              y: this.fixed(-d)
            })
          ]);
          var node2 = this.element || this.parent.element;
          this.adaptor.append(node2, box);
        };
        SVGWrapper2.prototype.html = function(type, def, content2) {
          if (def === void 0) {
            def = {};
          }
          if (content2 === void 0) {
            content2 = [];
          }
          return this.jax.html(type, def, content2);
        };
        SVGWrapper2.prototype.svg = function(type, def, content2) {
          if (def === void 0) {
            def = {};
          }
          if (content2 === void 0) {
            content2 = [];
          }
          return this.jax.svg(type, def, content2);
        };
        SVGWrapper2.prototype.text = function(text2) {
          return this.jax.text(text2);
        };
        SVGWrapper2.prototype.fixed = function(x2, n) {
          if (n === void 0) {
            n = 1;
          }
          return this.jax.fixed(x2 * 1e3, n);
        };
        SVGWrapper2.kind = "unknown";
        SVGWrapper2.borderFuzz = 5e-3;
        return SVGWrapper2;
      })(Wrapper_js_1.CommonWrapper);
      Wrapper$2.SVGWrapper = SVGWrapper;
      return Wrapper$2;
    }
    var math$2 = {};
    var math$1 = {};
    var hasRequiredMath$2;
    function requireMath$2() {
      if (hasRequiredMath$2) return math$1;
      hasRequiredMath$2 = 1;
      var __extends2 = math$1 && math$1.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      Object.defineProperty(math$1, "__esModule", { value: true });
      math$1.CommonMathMixin = void 0;
      function CommonMathMixin(Base) {
        return (function(_super) {
          __extends2(class_1, _super);
          function class_1() {
            return _super !== null && _super.apply(this, arguments) || this;
          }
          class_1.prototype.getWrapWidth = function(_i) {
            return this.parent ? this.getBBox().w : this.metrics.containerWidth / this.jax.pxPerEm;
          };
          return class_1;
        })(Base);
      }
      math$1.CommonMathMixin = CommonMathMixin;
      return math$1;
    }
    var math = {};
    var hasRequiredMath$1;
    function requireMath$1() {
      if (hasRequiredMath$1) return math;
      hasRequiredMath$1 = 1;
      var __extends2 = math && math.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      var __assign2 = math && math.__assign || function() {
        __assign2 = Object.assign || function(t2) {
          for (var s, i2 = 1, n = arguments.length; i2 < n; i2++) {
            s = arguments[i2];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
              t2[p] = s[p];
          }
          return t2;
        };
        return __assign2.apply(this, arguments);
      };
      Object.defineProperty(math, "__esModule", { value: true });
      math.MmlMath = void 0;
      var MmlNode_js_1 = requireMmlNode();
      var MmlMath = (function(_super) {
        __extends2(MmlMath2, _super);
        function MmlMath2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        Object.defineProperty(MmlMath2.prototype, "kind", {
          get: function() {
            return "math";
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(MmlMath2.prototype, "linebreakContainer", {
          get: function() {
            return true;
          },
          enumerable: false,
          configurable: true
        });
        MmlMath2.prototype.setChildInheritedAttributes = function(attributes2, display, level, prime2) {
          if (this.attributes.get("mode") === "display") {
            this.attributes.setInherited("display", "block");
          }
          attributes2 = this.addInheritedAttributes(attributes2, this.attributes.getAllAttributes());
          display = !!this.attributes.get("displaystyle") || !this.attributes.get("displaystyle") && this.attributes.get("display") === "block";
          this.attributes.setInherited("displaystyle", display);
          level = this.attributes.get("scriptlevel") || this.constructor.defaults["scriptlevel"];
          _super.prototype.setChildInheritedAttributes.call(this, attributes2, display, level, prime2);
        };
        MmlMath2.defaults = __assign2(__assign2({}, MmlNode_js_1.AbstractMmlLayoutNode.defaults), { mathvariant: "normal", mathsize: "normal", mathcolor: "", mathbackground: "transparent", dir: "ltr", scriptlevel: 0, displaystyle: false, display: "inline", maxwidth: "", overflow: "linebreak", altimg: "", "altimg-width": "", "altimg-height": "", "altimg-valign": "", alttext: "", cdgroup: "", scriptsizemultiplier: 1 / Math.sqrt(2), scriptminsize: "8px", infixlinebreakstyle: "before", lineleading: "1ex", linebreakmultchar: "⁢", indentshift: "auto", indentalign: "auto", indenttarget: "", indentalignfirst: "indentalign", indentshiftfirst: "indentshift", indentalignlast: "indentalign", indentshiftlast: "indentshift" });
        return MmlMath2;
      })(MmlNode_js_1.AbstractMmlLayoutNode);
      math.MmlMath = MmlMath;
      return math;
    }
    var hasRequiredMath;
    function requireMath() {
      if (hasRequiredMath) return math$2;
      hasRequiredMath = 1;
      var __extends2 = math$2 && math$2.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      var __read2 = math$2 && math$2.__read || function(o, n) {
        var m = typeof Symbol === "function" && o[Symbol.iterator];
        if (!m) return o;
        var i2 = m.call(o), r2, ar2 = [], e;
        try {
          while ((n === void 0 || n-- > 0) && !(r2 = i2.next()).done) ar2.push(r2.value);
        } catch (error2) {
          e = { error: error2 };
        } finally {
          try {
            if (r2 && !r2.done && (m = i2["return"])) m.call(i2);
          } finally {
            if (e) throw e.error;
          }
        }
        return ar2;
      };
      var __values2 = math$2 && math$2.__values || function(o) {
        var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i2 = 0;
        if (m) return m.call(o);
        if (o && typeof o.length === "number") return {
          next: function() {
            if (o && i2 >= o.length) o = void 0;
            return { value: o && o[i2++], done: !o };
          }
        };
        throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
      };
      Object.defineProperty(math$2, "__esModule", { value: true });
      math$2.SVGmath = void 0;
      var Wrapper_js_1 = requireWrapper();
      var math_js_1 = requireMath$2();
      var math_js_2 = requireMath$1();
      var BBox_js_1 = requireBBox();
      var SVGmath = (function(_super) {
        __extends2(SVGmath2, _super);
        function SVGmath2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        SVGmath2.prototype.toSVG = function(parent) {
          _super.prototype.toSVG.call(this, parent);
          var adaptor = this.adaptor;
          var display = this.node.attributes.get("display") === "block";
          if (display) {
            adaptor.setAttribute(this.jax.container, "display", "true");
            this.handleDisplay();
          }
          if (this.jax.document.options.internalSpeechTitles) {
            this.handleSpeech();
          }
        };
        SVGmath2.prototype.handleDisplay = function() {
          var _a2 = __read2(this.getAlignShift(), 2), align = _a2[0], shift2 = _a2[1];
          if (align !== "center") {
            this.adaptor.setAttribute(this.jax.container, "justify", align);
          }
          if (this.bbox.pwidth === BBox_js_1.BBox.fullWidth) {
            this.adaptor.setAttribute(this.jax.container, "width", "full");
            if (this.jax.table) {
              var _b2 = this.jax.table.getOuterBBox(), L = _b2.L, w = _b2.w, R = _b2.R;
              if (align === "right") {
                R = Math.max(R || -shift2, -shift2);
              } else if (align === "left") {
                L = Math.max(L || shift2, shift2);
              } else if (align === "center") {
                w += 2 * Math.abs(shift2);
              }
              this.jax.minwidth = Math.max(0, L + w + R);
            }
          } else {
            this.jax.shift = shift2;
          }
        };
        SVGmath2.prototype.handleSpeech = function() {
          var e_1, _a2;
          var adaptor = this.adaptor;
          var attributes2 = this.node.attributes;
          var speech = attributes2.get("aria-label") || attributes2.get("data-semantic-speech");
          if (speech) {
            var id = this.getTitleID();
            var label2 = this.svg("title", { id }, [this.text(speech)]);
            adaptor.insert(label2, adaptor.firstChild(this.element));
            adaptor.setAttribute(this.element, "aria-labeledby", id);
            adaptor.removeAttribute(this.element, "aria-label");
            try {
              for (var _b2 = __values2(this.childNodes[0].childNodes), _c = _b2.next(); !_c.done; _c = _b2.next()) {
                var child = _c.value;
                adaptor.setAttribute(child.element, "aria-hidden", "true");
              }
            } catch (e_1_1) {
              e_1 = { error: e_1_1 };
            } finally {
              try {
                if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
              } finally {
                if (e_1) throw e_1.error;
              }
            }
          }
        };
        SVGmath2.prototype.getTitleID = function() {
          return "mjx-svg-title-" + String(this.jax.options.titleID++);
        };
        SVGmath2.prototype.setChildPWidths = function(recompute, w, _clear) {
          if (w === void 0) {
            w = null;
          }
          return _super.prototype.setChildPWidths.call(this, recompute, this.parent ? w : this.metrics.containerWidth / this.jax.pxPerEm, false);
        };
        SVGmath2.kind = math_js_2.MmlMath.prototype.kind;
        SVGmath2.styles = {
          'mjx-container[jax="SVG"][display="true"]': {
            display: "block",
            "text-align": "center",
            margin: "1em 0"
          },
          'mjx-container[jax="SVG"][display="true"][width="full"]': {
            display: "flex"
          },
          'mjx-container[jax="SVG"][justify="left"]': {
            "text-align": "left"
          },
          'mjx-container[jax="SVG"][justify="right"]': {
            "text-align": "right"
          }
        };
        return SVGmath2;
      })((0, math_js_1.CommonMathMixin)(Wrapper_js_1.SVGWrapper));
      math$2.SVGmath = SVGmath;
      return math$2;
    }
    var mrow$2 = {};
    var mrow$1 = {};
    var hasRequiredMrow$2;
    function requireMrow$2() {
      if (hasRequiredMrow$2) return mrow$1;
      hasRequiredMrow$2 = 1;
      var __extends2 = mrow$1 && mrow$1.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      var __read2 = mrow$1 && mrow$1.__read || function(o, n) {
        var m = typeof Symbol === "function" && o[Symbol.iterator];
        if (!m) return o;
        var i2 = m.call(o), r2, ar2 = [], e;
        try {
          while ((n === void 0 || n-- > 0) && !(r2 = i2.next()).done) ar2.push(r2.value);
        } catch (error2) {
          e = { error: error2 };
        } finally {
          try {
            if (r2 && !r2.done && (m = i2["return"])) m.call(i2);
          } finally {
            if (e) throw e.error;
          }
        }
        return ar2;
      };
      var __spreadArray2 = mrow$1 && mrow$1.__spreadArray || function(to2, from, pack) {
        if (pack || arguments.length === 2) for (var i2 = 0, l = from.length, ar2; i2 < l; i2++) {
          if (ar2 || !(i2 in from)) {
            if (!ar2) ar2 = Array.prototype.slice.call(from, 0, i2);
            ar2[i2] = from[i2];
          }
        }
        return to2.concat(ar2 || Array.prototype.slice.call(from));
      };
      var __values2 = mrow$1 && mrow$1.__values || function(o) {
        var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i2 = 0;
        if (m) return m.call(o);
        if (o && typeof o.length === "number") return {
          next: function() {
            if (o && i2 >= o.length) o = void 0;
            return { value: o && o[i2++], done: !o };
          }
        };
        throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
      };
      Object.defineProperty(mrow$1, "__esModule", { value: true });
      mrow$1.CommonInferredMrowMixin = mrow$1.CommonMrowMixin = void 0;
      var BBox_js_1 = requireBBox();
      function CommonMrowMixin(Base) {
        return (function(_super) {
          __extends2(class_1, _super);
          function class_1() {
            var e_1, _a2;
            var args2 = [];
            for (var _i = 0; _i < arguments.length; _i++) {
              args2[_i] = arguments[_i];
            }
            var _this = _super.apply(this, __spreadArray2([], __read2(args2), false)) || this;
            _this.stretchChildren();
            try {
              for (var _b2 = __values2(_this.childNodes), _c = _b2.next(); !_c.done; _c = _b2.next()) {
                var child = _c.value;
                if (child.bbox.pwidth) {
                  _this.bbox.pwidth = BBox_js_1.BBox.fullWidth;
                  break;
                }
              }
            } catch (e_1_1) {
              e_1 = { error: e_1_1 };
            } finally {
              try {
                if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
              } finally {
                if (e_1) throw e_1.error;
              }
            }
            return _this;
          }
          Object.defineProperty(class_1.prototype, "fixesPWidth", {
            get: function() {
              return false;
            },
            enumerable: false,
            configurable: true
          });
          class_1.prototype.stretchChildren = function() {
            var e_2, _a2, e_3, _b2, e_4, _c;
            var stretchy = [];
            try {
              for (var _d = __values2(this.childNodes), _e2 = _d.next(); !_e2.done; _e2 = _d.next()) {
                var child = _e2.value;
                if (child.canStretch(1)) {
                  stretchy.push(child);
                }
              }
            } catch (e_2_1) {
              e_2 = { error: e_2_1 };
            } finally {
              try {
                if (_e2 && !_e2.done && (_a2 = _d.return)) _a2.call(_d);
              } finally {
                if (e_2) throw e_2.error;
              }
            }
            var count = stretchy.length;
            var nodeCount = this.childNodes.length;
            if (count && nodeCount > 1) {
              var H = 0, D2 = 0;
              var all2 = count > 1 && count === nodeCount;
              try {
                for (var _f = __values2(this.childNodes), _g = _f.next(); !_g.done; _g = _f.next()) {
                  var child = _g.value;
                  var noStretch = child.stretch.dir === 0;
                  if (all2 || noStretch) {
                    var _h = child.getOuterBBox(noStretch), h = _h.h, d = _h.d, rscale = _h.rscale;
                    h *= rscale;
                    d *= rscale;
                    if (h > H)
                      H = h;
                    if (d > D2)
                      D2 = d;
                  }
                }
              } catch (e_3_1) {
                e_3 = { error: e_3_1 };
              } finally {
                try {
                  if (_g && !_g.done && (_b2 = _f.return)) _b2.call(_f);
                } finally {
                  if (e_3) throw e_3.error;
                }
              }
              try {
                for (var stretchy_1 = __values2(stretchy), stretchy_1_1 = stretchy_1.next(); !stretchy_1_1.done; stretchy_1_1 = stretchy_1.next()) {
                  var child = stretchy_1_1.value;
                  child.coreMO().getStretchedVariant([H, D2]);
                }
              } catch (e_4_1) {
                e_4 = { error: e_4_1 };
              } finally {
                try {
                  if (stretchy_1_1 && !stretchy_1_1.done && (_c = stretchy_1.return)) _c.call(stretchy_1);
                } finally {
                  if (e_4) throw e_4.error;
                }
              }
            }
          };
          return class_1;
        })(Base);
      }
      mrow$1.CommonMrowMixin = CommonMrowMixin;
      function CommonInferredMrowMixin(Base) {
        return (function(_super) {
          __extends2(class_2, _super);
          function class_2() {
            return _super !== null && _super.apply(this, arguments) || this;
          }
          class_2.prototype.getScale = function() {
            this.bbox.scale = this.parent.bbox.scale;
            this.bbox.rscale = 1;
          };
          return class_2;
        })(Base);
      }
      mrow$1.CommonInferredMrowMixin = CommonInferredMrowMixin;
      return mrow$1;
    }
    var mrow = {};
    var hasRequiredMrow$1;
    function requireMrow$1() {
      if (hasRequiredMrow$1) return mrow;
      hasRequiredMrow$1 = 1;
      var __extends2 = mrow && mrow.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      var __assign2 = mrow && mrow.__assign || function() {
        __assign2 = Object.assign || function(t2) {
          for (var s, i2 = 1, n = arguments.length; i2 < n; i2++) {
            s = arguments[i2];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
              t2[p] = s[p];
          }
          return t2;
        };
        return __assign2.apply(this, arguments);
      };
      var __values2 = mrow && mrow.__values || function(o) {
        var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i2 = 0;
        if (m) return m.call(o);
        if (o && typeof o.length === "number") return {
          next: function() {
            if (o && i2 >= o.length) o = void 0;
            return { value: o && o[i2++], done: !o };
          }
        };
        throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
      };
      Object.defineProperty(mrow, "__esModule", { value: true });
      mrow.MmlInferredMrow = mrow.MmlMrow = void 0;
      var MmlNode_js_1 = requireMmlNode();
      var MmlMrow = (function(_super) {
        __extends2(MmlMrow2, _super);
        function MmlMrow2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this._core = null;
          return _this;
        }
        Object.defineProperty(MmlMrow2.prototype, "kind", {
          get: function() {
            return "mrow";
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(MmlMrow2.prototype, "isSpacelike", {
          get: function() {
            var e_1, _a2;
            try {
              for (var _b2 = __values2(this.childNodes), _c = _b2.next(); !_c.done; _c = _b2.next()) {
                var child = _c.value;
                if (!child.isSpacelike) {
                  return false;
                }
              }
            } catch (e_1_1) {
              e_1 = { error: e_1_1 };
            } finally {
              try {
                if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
              } finally {
                if (e_1) throw e_1.error;
              }
            }
            return true;
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(MmlMrow2.prototype, "isEmbellished", {
          get: function() {
            var e_2, _a2;
            var embellished = false;
            var i2 = 0;
            try {
              for (var _b2 = __values2(this.childNodes), _c = _b2.next(); !_c.done; _c = _b2.next()) {
                var child = _c.value;
                if (child) {
                  if (child.isEmbellished) {
                    if (embellished) {
                      return false;
                    }
                    embellished = true;
                    this._core = i2;
                  } else if (!child.isSpacelike) {
                    return false;
                  }
                }
                i2++;
              }
            } catch (e_2_1) {
              e_2 = { error: e_2_1 };
            } finally {
              try {
                if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
              } finally {
                if (e_2) throw e_2.error;
              }
            }
            return embellished;
          },
          enumerable: false,
          configurable: true
        });
        MmlMrow2.prototype.core = function() {
          if (!this.isEmbellished || this._core == null) {
            return this;
          }
          return this.childNodes[this._core];
        };
        MmlMrow2.prototype.coreMO = function() {
          if (!this.isEmbellished || this._core == null) {
            return this;
          }
          return this.childNodes[this._core].coreMO();
        };
        MmlMrow2.prototype.nonSpaceLength = function() {
          var e_3, _a2;
          var n = 0;
          try {
            for (var _b2 = __values2(this.childNodes), _c = _b2.next(); !_c.done; _c = _b2.next()) {
              var child = _c.value;
              if (child && !child.isSpacelike) {
                n++;
              }
            }
          } catch (e_3_1) {
            e_3 = { error: e_3_1 };
          } finally {
            try {
              if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
            } finally {
              if (e_3) throw e_3.error;
            }
          }
          return n;
        };
        MmlMrow2.prototype.firstNonSpace = function() {
          var e_4, _a2;
          try {
            for (var _b2 = __values2(this.childNodes), _c = _b2.next(); !_c.done; _c = _b2.next()) {
              var child = _c.value;
              if (child && !child.isSpacelike) {
                return child;
              }
            }
          } catch (e_4_1) {
            e_4 = { error: e_4_1 };
          } finally {
            try {
              if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
            } finally {
              if (e_4) throw e_4.error;
            }
          }
          return null;
        };
        MmlMrow2.prototype.lastNonSpace = function() {
          var i2 = this.childNodes.length;
          while (--i2 >= 0) {
            var child = this.childNodes[i2];
            if (child && !child.isSpacelike) {
              return child;
            }
          }
          return null;
        };
        MmlMrow2.prototype.setTeXclass = function(prev) {
          var e_5, _a2, e_6, _b2;
          if (this.getProperty("open") != null || this.getProperty("close") != null) {
            this.getPrevClass(prev);
            prev = null;
            try {
              for (var _c = __values2(this.childNodes), _d = _c.next(); !_d.done; _d = _c.next()) {
                var child = _d.value;
                prev = child.setTeXclass(prev);
              }
            } catch (e_5_1) {
              e_5 = { error: e_5_1 };
            } finally {
              try {
                if (_d && !_d.done && (_a2 = _c.return)) _a2.call(_c);
              } finally {
                if (e_5) throw e_5.error;
              }
            }
            if (this.texClass == null) {
              this.texClass = MmlNode_js_1.TEXCLASS.INNER;
            }
          } else {
            try {
              for (var _e2 = __values2(this.childNodes), _f = _e2.next(); !_f.done; _f = _e2.next()) {
                var child = _f.value;
                prev = child.setTeXclass(prev);
              }
            } catch (e_6_1) {
              e_6 = { error: e_6_1 };
            } finally {
              try {
                if (_f && !_f.done && (_b2 = _e2.return)) _b2.call(_e2);
              } finally {
                if (e_6) throw e_6.error;
              }
            }
            if (this.childNodes[0]) {
              this.updateTeXclass(this.childNodes[0]);
            }
          }
          return prev;
        };
        MmlMrow2.defaults = __assign2({}, MmlNode_js_1.AbstractMmlNode.defaults);
        return MmlMrow2;
      })(MmlNode_js_1.AbstractMmlNode);
      mrow.MmlMrow = MmlMrow;
      var MmlInferredMrow = (function(_super) {
        __extends2(MmlInferredMrow2, _super);
        function MmlInferredMrow2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        Object.defineProperty(MmlInferredMrow2.prototype, "kind", {
          get: function() {
            return "inferredMrow";
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(MmlInferredMrow2.prototype, "isInferred", {
          get: function() {
            return true;
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(MmlInferredMrow2.prototype, "notParent", {
          get: function() {
            return true;
          },
          enumerable: false,
          configurable: true
        });
        MmlInferredMrow2.prototype.toString = function() {
          return "[" + this.childNodes.join(",") + "]";
        };
        MmlInferredMrow2.defaults = MmlMrow.defaults;
        return MmlInferredMrow2;
      })(MmlMrow);
      mrow.MmlInferredMrow = MmlInferredMrow;
      return mrow;
    }
    var hasRequiredMrow;
    function requireMrow() {
      if (hasRequiredMrow) return mrow$2;
      hasRequiredMrow = 1;
      var __extends2 = mrow$2 && mrow$2.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      Object.defineProperty(mrow$2, "__esModule", { value: true });
      mrow$2.SVGinferredMrow = mrow$2.SVGmrow = void 0;
      var Wrapper_js_1 = requireWrapper();
      var mrow_js_1 = requireMrow$2();
      var mrow_js_2 = requireMrow$2();
      var mrow_js_3 = requireMrow$1();
      var SVGmrow = (function(_super) {
        __extends2(SVGmrow2, _super);
        function SVGmrow2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        SVGmrow2.prototype.toSVG = function(parent) {
          var svg2 = this.node.isInferred ? this.element = parent : this.standardSVGnode(parent);
          this.addChildren(svg2);
        };
        SVGmrow2.kind = mrow_js_3.MmlMrow.prototype.kind;
        return SVGmrow2;
      })((0, mrow_js_1.CommonMrowMixin)(Wrapper_js_1.SVGWrapper));
      mrow$2.SVGmrow = SVGmrow;
      var SVGinferredMrow = (function(_super) {
        __extends2(SVGinferredMrow2, _super);
        function SVGinferredMrow2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        SVGinferredMrow2.kind = mrow_js_3.MmlInferredMrow.prototype.kind;
        return SVGinferredMrow2;
      })((0, mrow_js_2.CommonInferredMrowMixin)(SVGmrow));
      mrow$2.SVGinferredMrow = SVGinferredMrow;
      return mrow$2;
    }
    var mi$2 = {};
    var mi$1 = {};
    var hasRequiredMi$2;
    function requireMi$2() {
      if (hasRequiredMi$2) return mi$1;
      hasRequiredMi$2 = 1;
      var __extends2 = mi$1 && mi$1.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      Object.defineProperty(mi$1, "__esModule", { value: true });
      mi$1.CommonMiMixin = void 0;
      function CommonMiMixin(Base) {
        return (function(_super) {
          __extends2(class_1, _super);
          function class_1() {
            return _super !== null && _super.apply(this, arguments) || this;
          }
          class_1.prototype.computeBBox = function(bbox, _recompute) {
            _super.prototype.computeBBox.call(this, bbox);
            this.copySkewIC(bbox);
          };
          return class_1;
        })(Base);
      }
      mi$1.CommonMiMixin = CommonMiMixin;
      return mi$1;
    }
    var mi = {};
    var hasRequiredMi$1;
    function requireMi$1() {
      if (hasRequiredMi$1) return mi;
      hasRequiredMi$1 = 1;
      var __extends2 = mi && mi.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      var __assign2 = mi && mi.__assign || function() {
        __assign2 = Object.assign || function(t2) {
          for (var s, i2 = 1, n = arguments.length; i2 < n; i2++) {
            s = arguments[i2];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
              t2[p] = s[p];
          }
          return t2;
        };
        return __assign2.apply(this, arguments);
      };
      Object.defineProperty(mi, "__esModule", { value: true });
      mi.MmlMi = void 0;
      var MmlNode_js_1 = requireMmlNode();
      var MmlMi = (function(_super) {
        __extends2(MmlMi2, _super);
        function MmlMi2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.texclass = MmlNode_js_1.TEXCLASS.ORD;
          return _this;
        }
        Object.defineProperty(MmlMi2.prototype, "kind", {
          get: function() {
            return "mi";
          },
          enumerable: false,
          configurable: true
        });
        MmlMi2.prototype.setInheritedAttributes = function(attributes2, display, level, prime2) {
          if (attributes2 === void 0) {
            attributes2 = {};
          }
          if (display === void 0) {
            display = false;
          }
          if (level === void 0) {
            level = 0;
          }
          if (prime2 === void 0) {
            prime2 = false;
          }
          _super.prototype.setInheritedAttributes.call(this, attributes2, display, level, prime2);
          var text2 = this.getText();
          if (text2.match(MmlMi2.singleCharacter) && !attributes2.mathvariant) {
            this.attributes.setInherited("mathvariant", "italic");
          }
        };
        MmlMi2.prototype.setTeXclass = function(prev) {
          this.getPrevClass(prev);
          var name2 = this.getText();
          if (name2.length > 1 && name2.match(MmlMi2.operatorName) && this.attributes.get("mathvariant") === "normal" && this.getProperty("autoOP") === void 0 && this.getProperty("texClass") === void 0) {
            this.texClass = MmlNode_js_1.TEXCLASS.OP;
            this.setProperty("autoOP", true);
          }
          return this;
        };
        MmlMi2.defaults = __assign2({}, MmlNode_js_1.AbstractMmlTokenNode.defaults);
        MmlMi2.operatorName = /^[a-z][a-z0-9]*$/i;
        MmlMi2.singleCharacter = /^[\uD800-\uDBFF]?.[\u0300-\u036F\u1AB0-\u1ABE\u1DC0-\u1DFF\u20D0-\u20EF]*$/;
        return MmlMi2;
      })(MmlNode_js_1.AbstractMmlTokenNode);
      mi.MmlMi = MmlMi;
      return mi;
    }
    var hasRequiredMi;
    function requireMi() {
      if (hasRequiredMi) return mi$2;
      hasRequiredMi = 1;
      var __extends2 = mi$2 && mi$2.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      Object.defineProperty(mi$2, "__esModule", { value: true });
      mi$2.SVGmi = void 0;
      var Wrapper_js_1 = requireWrapper();
      var mi_js_1 = requireMi$2();
      var mi_js_2 = requireMi$1();
      var SVGmi = (function(_super) {
        __extends2(SVGmi2, _super);
        function SVGmi2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        SVGmi2.kind = mi_js_2.MmlMi.prototype.kind;
        return SVGmi2;
      })((0, mi_js_1.CommonMiMixin)(Wrapper_js_1.SVGWrapper));
      mi$2.SVGmi = SVGmi;
      return mi$2;
    }
    var mo$1 = {};
    var mo = {};
    var hasRequiredMo$1;
    function requireMo$1() {
      if (hasRequiredMo$1) return mo;
      hasRequiredMo$1 = 1;
      var __extends2 = mo && mo.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      var __assign2 = mo && mo.__assign || function() {
        __assign2 = Object.assign || function(t2) {
          for (var s, i2 = 1, n = arguments.length; i2 < n; i2++) {
            s = arguments[i2];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
              t2[p] = s[p];
          }
          return t2;
        };
        return __assign2.apply(this, arguments);
      };
      var __read2 = mo && mo.__read || function(o, n) {
        var m = typeof Symbol === "function" && o[Symbol.iterator];
        if (!m) return o;
        var i2 = m.call(o), r2, ar2 = [], e;
        try {
          while ((n === void 0 || n-- > 0) && !(r2 = i2.next()).done) ar2.push(r2.value);
        } catch (error2) {
          e = { error: error2 };
        } finally {
          try {
            if (r2 && !r2.done && (m = i2["return"])) m.call(i2);
          } finally {
            if (e) throw e.error;
          }
        }
        return ar2;
      };
      var __spreadArray2 = mo && mo.__spreadArray || function(to2, from, pack) {
        if (pack || arguments.length === 2) for (var i2 = 0, l = from.length, ar2; i2 < l; i2++) {
          if (ar2 || !(i2 in from)) {
            if (!ar2) ar2 = Array.prototype.slice.call(from, 0, i2);
            ar2[i2] = from[i2];
          }
        }
        return to2.concat(ar2 || Array.prototype.slice.call(from));
      };
      var __values2 = mo && mo.__values || function(o) {
        var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i2 = 0;
        if (m) return m.call(o);
        if (o && typeof o.length === "number") return {
          next: function() {
            if (o && i2 >= o.length) o = void 0;
            return { value: o && o[i2++], done: !o };
          }
        };
        throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
      };
      var _a2;
      Object.defineProperty(mo, "__esModule", { value: true });
      mo.CommonMoMixin = mo.DirectionVH = void 0;
      var BBox_js_1 = requireBBox();
      var string_js_1 = requireString();
      var FontData_js_1 = requireFontData$1();
      mo.DirectionVH = (_a2 = {}, _a2[1] = "v", _a2[2] = "h", _a2);
      function CommonMoMixin(Base) {
        return (function(_super) {
          __extends2(class_1, _super);
          function class_1() {
            var args2 = [];
            for (var _i = 0; _i < arguments.length; _i++) {
              args2[_i] = arguments[_i];
            }
            var _this = _super.apply(this, __spreadArray2([], __read2(args2), false)) || this;
            _this.size = null;
            _this.isAccent = _this.node.isAccent;
            return _this;
          }
          class_1.prototype.computeBBox = function(bbox, _recompute) {
            this.protoBBox(bbox);
            if (this.node.attributes.get("symmetric") && this.stretch.dir !== 2) {
              var d = this.getCenterOffset(bbox);
              bbox.h += d;
              bbox.d -= d;
            }
            if (this.node.getProperty("mathaccent") && (this.stretch.dir === 0 || this.size >= 0)) {
              bbox.w = 0;
            }
          };
          class_1.prototype.protoBBox = function(bbox) {
            var stretchy = this.stretch.dir !== 0;
            if (stretchy && this.size === null) {
              this.getStretchedVariant([0]);
            }
            if (stretchy && this.size < 0)
              return;
            _super.prototype.computeBBox.call(this, bbox);
            this.copySkewIC(bbox);
          };
          class_1.prototype.getAccentOffset = function() {
            var bbox = BBox_js_1.BBox.empty();
            this.protoBBox(bbox);
            return -bbox.w / 2;
          };
          class_1.prototype.getCenterOffset = function(bbox) {
            if (bbox === void 0) {
              bbox = null;
            }
            if (!bbox) {
              bbox = BBox_js_1.BBox.empty();
              _super.prototype.computeBBox.call(this, bbox);
            }
            return (bbox.h + bbox.d) / 2 + this.font.params.axis_height - bbox.h;
          };
          class_1.prototype.getVariant = function() {
            if (this.node.attributes.get("largeop")) {
              this.variant = this.node.attributes.get("displaystyle") ? "-largeop" : "-smallop";
              return;
            }
            if (!this.node.attributes.getExplicit("mathvariant") && this.node.getProperty("pseudoscript") === false) {
              this.variant = "-tex-variant";
              return;
            }
            _super.prototype.getVariant.call(this);
          };
          class_1.prototype.canStretch = function(direction) {
            if (this.stretch.dir !== 0) {
              return this.stretch.dir === direction;
            }
            var attributes2 = this.node.attributes;
            if (!attributes2.get("stretchy"))
              return false;
            var c2 = this.getText();
            if (Array.from(c2).length !== 1)
              return false;
            var delim = this.font.getDelimiter(c2.codePointAt(0));
            this.stretch = delim && delim.dir === direction ? delim : FontData_js_1.NOSTRETCH;
            return this.stretch.dir !== 0;
          };
          class_1.prototype.getStretchedVariant = function(WH, exact) {
            var e_1, _a3;
            if (exact === void 0) {
              exact = false;
            }
            if (this.stretch.dir !== 0) {
              var D2 = this.getWH(WH);
              var min2 = this.getSize("minsize", 0);
              var max2 = this.getSize("maxsize", Infinity);
              var mathaccent = this.node.getProperty("mathaccent");
              D2 = Math.max(min2, Math.min(max2, D2));
              var df = this.font.params.delimiterfactor / 1e3;
              var ds = this.font.params.delimitershortfall;
              var m = min2 || exact ? D2 : mathaccent ? Math.min(D2 / df, D2 + ds) : Math.max(D2 * df, D2 - ds);
              var delim = this.stretch;
              var c2 = delim.c || this.getText().codePointAt(0);
              var i2 = 0;
              if (delim.sizes) {
                try {
                  for (var _b2 = __values2(delim.sizes), _c = _b2.next(); !_c.done; _c = _b2.next()) {
                    var d = _c.value;
                    if (d >= m) {
                      if (mathaccent && i2) {
                        i2--;
                      }
                      this.variant = this.font.getSizeVariant(c2, i2);
                      this.size = i2;
                      if (delim.schar && delim.schar[i2]) {
                        this.stretch = __assign2(__assign2({}, this.stretch), { c: delim.schar[i2] });
                      }
                      return;
                    }
                    i2++;
                  }
                } catch (e_1_1) {
                  e_1 = { error: e_1_1 };
                } finally {
                  try {
                    if (_c && !_c.done && (_a3 = _b2.return)) _a3.call(_b2);
                  } finally {
                    if (e_1) throw e_1.error;
                  }
                }
              }
              if (delim.stretch) {
                this.size = -1;
                this.invalidateBBox();
                this.getStretchBBox(WH, this.checkExtendedHeight(D2, delim), delim);
              } else {
                this.variant = this.font.getSizeVariant(c2, i2 - 1);
                this.size = i2 - 1;
              }
            }
          };
          class_1.prototype.getSize = function(name2, value2) {
            var attributes2 = this.node.attributes;
            if (attributes2.isSet(name2)) {
              value2 = this.length2em(attributes2.get(name2), 1, 1);
            }
            return value2;
          };
          class_1.prototype.getWH = function(WH) {
            if (WH.length === 0)
              return 0;
            if (WH.length === 1)
              return WH[0];
            var _a3 = __read2(WH, 2), H = _a3[0], D2 = _a3[1];
            var a = this.font.params.axis_height;
            return this.node.attributes.get("symmetric") ? 2 * Math.max(H - a, D2 + a) : H + D2;
          };
          class_1.prototype.getStretchBBox = function(WHD, D2, C2) {
            var _a3;
            if (C2.hasOwnProperty("min") && C2.min > D2) {
              D2 = C2.min;
            }
            var _b2 = __read2(C2.HDW, 3), h = _b2[0], d = _b2[1], w = _b2[2];
            if (this.stretch.dir === 1) {
              _a3 = __read2(this.getBaseline(WHD, D2, C2), 2), h = _a3[0], d = _a3[1];
            } else {
              w = D2;
            }
            this.bbox.h = h;
            this.bbox.d = d;
            this.bbox.w = w;
          };
          class_1.prototype.getBaseline = function(WHD, HD, C2) {
            var hasWHD = WHD.length === 2 && WHD[0] + WHD[1] === HD;
            var symmetric = this.node.attributes.get("symmetric");
            var _a3 = __read2(hasWHD ? WHD : [HD, 0], 2), H = _a3[0], D2 = _a3[1];
            var _b2 = __read2([H + D2, 0], 2), h = _b2[0], d = _b2[1];
            if (symmetric) {
              var a = this.font.params.axis_height;
              if (hasWHD) {
                h = 2 * Math.max(H - a, D2 + a);
              }
              d = h / 2 - a;
            } else if (hasWHD) {
              d = D2;
            } else {
              var _c = __read2(C2.HDW || [0.75, 0.25], 2), ch3 = _c[0], cd = _c[1];
              d = cd * (h / (ch3 + cd));
            }
            return [h - d, d];
          };
          class_1.prototype.checkExtendedHeight = function(D2, C2) {
            if (C2.fullExt) {
              var _a3 = __read2(C2.fullExt, 2), extSize = _a3[0], endSize = _a3[1];
              var n = Math.ceil(Math.max(0, D2 - endSize) / extSize);
              D2 = endSize + n * extSize;
            }
            return D2;
          };
          class_1.prototype.remapChars = function(chars) {
            var primes2 = this.node.getProperty("primes");
            if (primes2) {
              return (0, string_js_1.unicodeChars)(primes2);
            }
            if (chars.length === 1) {
              var parent_1 = this.node.coreParent().parent;
              var isAccent = this.isAccent && !parent_1.isKind("mrow");
              var map2 = isAccent ? "accent" : "mo";
              var text2 = this.font.getRemappedChar(map2, chars[0]);
              if (text2) {
                chars = this.unicodeChars(text2, this.variant);
              }
            }
            return chars;
          };
          return class_1;
        })(Base);
      }
      mo.CommonMoMixin = CommonMoMixin;
      return mo;
    }
    var hasRequiredMo;
    function requireMo() {
      if (hasRequiredMo) return mo$1;
      hasRequiredMo = 1;
      var __extends2 = mo$1 && mo$1.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      var __values2 = mo$1 && mo$1.__values || function(o) {
        var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i2 = 0;
        if (m) return m.call(o);
        if (o && typeof o.length === "number") return {
          next: function() {
            if (o && i2 >= o.length) o = void 0;
            return { value: o && o[i2++], done: !o };
          }
        };
        throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
      };
      var __read2 = mo$1 && mo$1.__read || function(o, n) {
        var m = typeof Symbol === "function" && o[Symbol.iterator];
        if (!m) return o;
        var i2 = m.call(o), r2, ar2 = [], e;
        try {
          while ((n === void 0 || n-- > 0) && !(r2 = i2.next()).done) ar2.push(r2.value);
        } catch (error2) {
          e = { error: error2 };
        } finally {
          try {
            if (r2 && !r2.done && (m = i2["return"])) m.call(i2);
          } finally {
            if (e) throw e.error;
          }
        }
        return ar2;
      };
      Object.defineProperty(mo$1, "__esModule", { value: true });
      mo$1.SVGmo = void 0;
      var Wrapper_js_1 = requireWrapper();
      var mo_js_1 = requireMo$1();
      var mo_js_2 = requireMo$2();
      var VFUZZ = 0.1;
      var HFUZZ = 0.1;
      var SVGmo = (function(_super) {
        __extends2(SVGmo2, _super);
        function SVGmo2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        SVGmo2.prototype.toSVG = function(parent) {
          var attributes2 = this.node.attributes;
          var symmetric = attributes2.get("symmetric") && this.stretch.dir !== 2;
          var stretchy = this.stretch.dir !== 0;
          if (stretchy && this.size === null) {
            this.getStretchedVariant([]);
          }
          var svg2 = this.standardSVGnode(parent);
          if (stretchy && this.size < 0) {
            this.stretchSVG();
          } else {
            var u = symmetric || attributes2.get("largeop") ? this.fixed(this.getCenterOffset()) : "0";
            var v = this.node.getProperty("mathaccent") ? this.fixed(this.getAccentOffset()) : "0";
            if (u !== "0" || v !== "0") {
              this.adaptor.setAttribute(svg2, "transform", "translate(".concat(v, " ").concat(u, ")"));
            }
            this.addChildren(svg2);
          }
        };
        SVGmo2.prototype.stretchSVG = function() {
          var stretch = this.stretch.stretch;
          var variants = this.getStretchVariants();
          var bbox = this.getBBox();
          if (this.stretch.dir === 1) {
            this.stretchVertical(stretch, variants, bbox);
          } else {
            this.stretchHorizontal(stretch, variants, bbox);
          }
        };
        SVGmo2.prototype.getStretchVariants = function() {
          var e_1, _a2;
          var c2 = this.stretch.c || this.getText().codePointAt(0);
          var variants = [];
          try {
            for (var _b2 = __values2(this.stretch.stretch.keys()), _c = _b2.next(); !_c.done; _c = _b2.next()) {
              var i2 = _c.value;
              variants[i2] = this.font.getStretchVariant(c2, i2);
            }
          } catch (e_1_1) {
            e_1 = { error: e_1_1 };
          } finally {
            try {
              if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
            } finally {
              if (e_1) throw e_1.error;
            }
          }
          return variants;
        };
        SVGmo2.prototype.stretchVertical = function(stretch, variant, bbox) {
          var h = bbox.h, d = bbox.d, w = bbox.w;
          var T = this.addTop(stretch[0], variant[0], h, w);
          var B = this.addBot(stretch[2], variant[2], d, w);
          if (stretch.length === 4) {
            var _a2 = __read2(this.addMidV(stretch[3], variant[3], w), 2), H = _a2[0], D2 = _a2[1];
            this.addExtV(stretch[1], variant[1], h, 0, T, H, w);
            this.addExtV(stretch[1], variant[1], 0, d, D2, B, w);
          } else {
            this.addExtV(stretch[1], variant[1], h, d, T, B, w);
          }
        };
        SVGmo2.prototype.stretchHorizontal = function(stretch, variant, bbox) {
          var w = bbox.w;
          var L = this.addLeft(stretch[0], variant[0]);
          var R = this.addRight(stretch[2], variant[2], w);
          if (stretch.length === 4) {
            var _a2 = __read2(this.addMidH(stretch[3], variant[3], w), 2), x1 = _a2[0], x2 = _a2[1];
            var w2 = w / 2;
            this.addExtH(stretch[1], variant[1], w2, L, w2 - x1);
            this.addExtH(stretch[1], variant[1], w2, x2 - w2, R, w2);
          } else {
            this.addExtH(stretch[1], variant[1], w, L, R);
          }
        };
        SVGmo2.prototype.getChar = function(n, variant) {
          var char = this.font.getChar(variant, n) || [0, 0, 0, null];
          return [char[0], char[1], char[2], char[3] || {}];
        };
        SVGmo2.prototype.addGlyph = function(n, variant, x2, y, parent) {
          if (parent === void 0) {
            parent = null;
          }
          return this.placeChar(n, x2, y, parent || this.element, variant);
        };
        SVGmo2.prototype.addTop = function(n, v, H, W) {
          if (!n)
            return 0;
          var _a2 = __read2(this.getChar(n, v), 3), h = _a2[0], d = _a2[1], w = _a2[2];
          this.addGlyph(n, v, (W - w) / 2, H - h);
          return h + d;
        };
        SVGmo2.prototype.addExtV = function(n, v, H, D2, T, B, W) {
          var _this = this;
          if (!n)
            return;
          T = Math.max(0, T - VFUZZ);
          B = Math.max(0, B - VFUZZ);
          var adaptor = this.adaptor;
          var _a2 = __read2(this.getChar(n, v), 3), h = _a2[0], d = _a2[1], w = _a2[2];
          var Y2 = H + D2 - T - B;
          var s = 1.5 * Y2 / (h + d);
          var y = (s * (h - d) - Y2) / 2;
          if (Y2 <= 0)
            return;
          var svg2 = this.svg("svg", {
            width: this.fixed(w),
            height: this.fixed(Y2),
            y: this.fixed(B - D2),
            x: this.fixed((W - w) / 2),
            viewBox: [0, y, w, Y2].map(function(x2) {
              return _this.fixed(x2);
            }).join(" ")
          });
          this.addGlyph(n, v, 0, 0, svg2);
          var glyph = adaptor.lastChild(svg2);
          adaptor.setAttribute(glyph, "transform", "scale(1,".concat(this.jax.fixed(s), ")"));
          adaptor.append(this.element, svg2);
        };
        SVGmo2.prototype.addBot = function(n, v, D2, W) {
          if (!n)
            return 0;
          var _a2 = __read2(this.getChar(n, v), 3), h = _a2[0], d = _a2[1], w = _a2[2];
          this.addGlyph(n, v, (W - w) / 2, d - D2);
          return h + d;
        };
        SVGmo2.prototype.addMidV = function(n, v, W) {
          if (!n)
            return [0, 0];
          var _a2 = __read2(this.getChar(n, v), 3), h = _a2[0], d = _a2[1], w = _a2[2];
          var y = (d - h) / 2 + this.font.params.axis_height;
          this.addGlyph(n, v, (W - w) / 2, y);
          return [h + y, d - y];
        };
        SVGmo2.prototype.addLeft = function(n, v) {
          return n ? this.addGlyph(n, v, 0, 0) : 0;
        };
        SVGmo2.prototype.addExtH = function(n, v, W, L, R, x2) {
          var _this = this;
          if (x2 === void 0) {
            x2 = 0;
          }
          if (!n)
            return;
          R = Math.max(0, R - HFUZZ);
          L = Math.max(0, L - HFUZZ);
          var adaptor = this.adaptor;
          var _a2 = __read2(this.getChar(n, v), 3), h = _a2[0], d = _a2[1], w = _a2[2];
          var X2 = W - L - R;
          var Y2 = h + d + 2 * VFUZZ;
          var s = 1.5 * (X2 / w);
          var D2 = -(d + VFUZZ);
          if (X2 <= 0)
            return;
          var svg2 = this.svg("svg", {
            width: this.fixed(X2),
            height: this.fixed(Y2),
            x: this.fixed(x2 + L),
            y: this.fixed(D2),
            viewBox: [(s * w - X2) / 2, D2, X2, Y2].map(function(x3) {
              return _this.fixed(x3);
            }).join(" ")
          });
          this.addGlyph(n, v, 0, 0, svg2);
          var glyph = adaptor.lastChild(svg2);
          adaptor.setAttribute(glyph, "transform", "scale(" + this.jax.fixed(s) + ",1)");
          adaptor.append(this.element, svg2);
        };
        SVGmo2.prototype.addRight = function(n, v, W) {
          if (!n)
            return 0;
          var w = this.getChar(n, v)[2];
          return this.addGlyph(n, v, W - w, 0);
        };
        SVGmo2.prototype.addMidH = function(n, v, W) {
          if (!n)
            return [0, 0];
          var w = this.getChar(n, v)[2];
          this.addGlyph(n, v, (W - w) / 2, 0);
          return [(W - w) / 2, (W + w) / 2];
        };
        SVGmo2.kind = mo_js_2.MmlMo.prototype.kind;
        return SVGmo2;
      })((0, mo_js_1.CommonMoMixin)(Wrapper_js_1.SVGWrapper));
      mo$1.SVGmo = SVGmo;
      return mo$1;
    }
    var mn$2 = {};
    var mn$1 = {};
    var hasRequiredMn$2;
    function requireMn$2() {
      if (hasRequiredMn$2) return mn$1;
      hasRequiredMn$2 = 1;
      var __extends2 = mn$1 && mn$1.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      Object.defineProperty(mn$1, "__esModule", { value: true });
      mn$1.CommonMnMixin = void 0;
      function CommonMnMixin(Base) {
        return (function(_super) {
          __extends2(class_1, _super);
          function class_1() {
            return _super !== null && _super.apply(this, arguments) || this;
          }
          class_1.prototype.remapChars = function(chars) {
            if (chars.length) {
              var text2 = this.font.getRemappedChar("mn", chars[0]);
              if (text2) {
                var c2 = this.unicodeChars(text2, this.variant);
                if (c2.length === 1) {
                  chars[0] = c2[0];
                } else {
                  chars = c2.concat(chars.slice(1));
                }
              }
            }
            return chars;
          };
          return class_1;
        })(Base);
      }
      mn$1.CommonMnMixin = CommonMnMixin;
      return mn$1;
    }
    var mn = {};
    var hasRequiredMn$1;
    function requireMn$1() {
      if (hasRequiredMn$1) return mn;
      hasRequiredMn$1 = 1;
      var __extends2 = mn && mn.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      var __assign2 = mn && mn.__assign || function() {
        __assign2 = Object.assign || function(t2) {
          for (var s, i2 = 1, n = arguments.length; i2 < n; i2++) {
            s = arguments[i2];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
              t2[p] = s[p];
          }
          return t2;
        };
        return __assign2.apply(this, arguments);
      };
      Object.defineProperty(mn, "__esModule", { value: true });
      mn.MmlMn = void 0;
      var MmlNode_js_1 = requireMmlNode();
      var MmlMn = (function(_super) {
        __extends2(MmlMn2, _super);
        function MmlMn2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.texclass = MmlNode_js_1.TEXCLASS.ORD;
          return _this;
        }
        Object.defineProperty(MmlMn2.prototype, "kind", {
          get: function() {
            return "mn";
          },
          enumerable: false,
          configurable: true
        });
        MmlMn2.defaults = __assign2({}, MmlNode_js_1.AbstractMmlTokenNode.defaults);
        return MmlMn2;
      })(MmlNode_js_1.AbstractMmlTokenNode);
      mn.MmlMn = MmlMn;
      return mn;
    }
    var hasRequiredMn;
    function requireMn() {
      if (hasRequiredMn) return mn$2;
      hasRequiredMn = 1;
      var __extends2 = mn$2 && mn$2.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      Object.defineProperty(mn$2, "__esModule", { value: true });
      mn$2.SVGmn = void 0;
      var Wrapper_js_1 = requireWrapper();
      var mn_js_1 = requireMn$2();
      var mn_js_2 = requireMn$1();
      var SVGmn = (function(_super) {
        __extends2(SVGmn2, _super);
        function SVGmn2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        SVGmn2.kind = mn_js_2.MmlMn.prototype.kind;
        return SVGmn2;
      })((0, mn_js_1.CommonMnMixin)(Wrapper_js_1.SVGWrapper));
      mn$2.SVGmn = SVGmn;
      return mn$2;
    }
    var ms$2 = {};
    var ms$1 = {};
    var hasRequiredMs$2;
    function requireMs$2() {
      if (hasRequiredMs$2) return ms$1;
      hasRequiredMs$2 = 1;
      var __extends2 = ms$1 && ms$1.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      var __read2 = ms$1 && ms$1.__read || function(o, n) {
        var m = typeof Symbol === "function" && o[Symbol.iterator];
        if (!m) return o;
        var i2 = m.call(o), r2, ar2 = [], e;
        try {
          while ((n === void 0 || n-- > 0) && !(r2 = i2.next()).done) ar2.push(r2.value);
        } catch (error2) {
          e = { error: error2 };
        } finally {
          try {
            if (r2 && !r2.done && (m = i2["return"])) m.call(i2);
          } finally {
            if (e) throw e.error;
          }
        }
        return ar2;
      };
      var __spreadArray2 = ms$1 && ms$1.__spreadArray || function(to2, from, pack) {
        if (pack || arguments.length === 2) for (var i2 = 0, l = from.length, ar2; i2 < l; i2++) {
          if (ar2 || !(i2 in from)) {
            if (!ar2) ar2 = Array.prototype.slice.call(from, 0, i2);
            ar2[i2] = from[i2];
          }
        }
        return to2.concat(ar2 || Array.prototype.slice.call(from));
      };
      Object.defineProperty(ms$1, "__esModule", { value: true });
      ms$1.CommonMsMixin = void 0;
      function CommonMsMixin(Base) {
        return (function(_super) {
          __extends2(class_1, _super);
          function class_1() {
            var args2 = [];
            for (var _i = 0; _i < arguments.length; _i++) {
              args2[_i] = arguments[_i];
            }
            var _this = _super.apply(this, __spreadArray2([], __read2(args2), false)) || this;
            var attributes2 = _this.node.attributes;
            var quotes = attributes2.getList("lquote", "rquote");
            if (_this.variant !== "monospace") {
              if (!attributes2.isSet("lquote") && quotes.lquote === '"')
                quotes.lquote = "“";
              if (!attributes2.isSet("rquote") && quotes.rquote === '"')
                quotes.rquote = "”";
            }
            _this.childNodes.unshift(_this.createText(quotes.lquote));
            _this.childNodes.push(_this.createText(quotes.rquote));
            return _this;
          }
          class_1.prototype.createText = function(text2) {
            var node2 = this.wrap(this.mmlText(text2));
            node2.parent = this;
            return node2;
          };
          return class_1;
        })(Base);
      }
      ms$1.CommonMsMixin = CommonMsMixin;
      return ms$1;
    }
    var ms = {};
    var hasRequiredMs$1;
    function requireMs$1() {
      if (hasRequiredMs$1) return ms;
      hasRequiredMs$1 = 1;
      var __extends2 = ms && ms.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      var __assign2 = ms && ms.__assign || function() {
        __assign2 = Object.assign || function(t2) {
          for (var s, i2 = 1, n = arguments.length; i2 < n; i2++) {
            s = arguments[i2];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
              t2[p] = s[p];
          }
          return t2;
        };
        return __assign2.apply(this, arguments);
      };
      Object.defineProperty(ms, "__esModule", { value: true });
      ms.MmlMs = void 0;
      var MmlNode_js_1 = requireMmlNode();
      var MmlMs = (function(_super) {
        __extends2(MmlMs2, _super);
        function MmlMs2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.texclass = MmlNode_js_1.TEXCLASS.ORD;
          return _this;
        }
        Object.defineProperty(MmlMs2.prototype, "kind", {
          get: function() {
            return "ms";
          },
          enumerable: false,
          configurable: true
        });
        MmlMs2.defaults = __assign2(__assign2({}, MmlNode_js_1.AbstractMmlTokenNode.defaults), { lquote: '"', rquote: '"' });
        return MmlMs2;
      })(MmlNode_js_1.AbstractMmlTokenNode);
      ms.MmlMs = MmlMs;
      return ms;
    }
    var hasRequiredMs;
    function requireMs() {
      if (hasRequiredMs) return ms$2;
      hasRequiredMs = 1;
      var __extends2 = ms$2 && ms$2.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      Object.defineProperty(ms$2, "__esModule", { value: true });
      ms$2.SVGms = void 0;
      var Wrapper_js_1 = requireWrapper();
      var ms_js_1 = requireMs$2();
      var ms_js_2 = requireMs$1();
      var SVGms = (function(_super) {
        __extends2(SVGms2, _super);
        function SVGms2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        SVGms2.kind = ms_js_2.MmlMs.prototype.kind;
        return SVGms2;
      })((0, ms_js_1.CommonMsMixin)(Wrapper_js_1.SVGWrapper));
      ms$2.SVGms = SVGms;
      return ms$2;
    }
    var mtext$2 = {};
    var mtext$1 = {};
    var hasRequiredMtext$2;
    function requireMtext$2() {
      if (hasRequiredMtext$2) return mtext$1;
      hasRequiredMtext$2 = 1;
      var __extends2 = mtext$1 && mtext$1.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      Object.defineProperty(mtext$1, "__esModule", { value: true });
      mtext$1.CommonMtextMixin = void 0;
      function CommonMtextMixin(Base) {
        var _a2;
        return _a2 = (function(_super) {
          __extends2(class_1, _super);
          function class_1() {
            return _super !== null && _super.apply(this, arguments) || this;
          }
          class_1.prototype.getVariant = function() {
            var options2 = this.jax.options;
            var data = this.jax.math.outputData;
            var merror2 = (!!data.merrorFamily || !!options2.merrorFont) && this.node.Parent.isKind("merror");
            if (!!data.mtextFamily || !!options2.mtextFont || merror2) {
              var variant = this.node.attributes.get("mathvariant");
              var font = this.constructor.INHERITFONTS[variant] || this.jax.font.getCssFont(variant);
              var family = font[0] || (merror2 ? data.merrorFamily || options2.merrorFont : data.mtextFamily || options2.mtextFont);
              this.variant = this.explicitVariant(family, font[2] ? "bold" : "", font[1] ? "italic" : "");
              return;
            }
            _super.prototype.getVariant.call(this);
          };
          return class_1;
        })(Base), _a2.INHERITFONTS = {
          normal: ["", false, false],
          bold: ["", false, true],
          italic: ["", true, false],
          "bold-italic": ["", true, true]
        }, _a2;
      }
      mtext$1.CommonMtextMixin = CommonMtextMixin;
      return mtext$1;
    }
    var mtext = {};
    var hasRequiredMtext$1;
    function requireMtext$1() {
      if (hasRequiredMtext$1) return mtext;
      hasRequiredMtext$1 = 1;
      var __extends2 = mtext && mtext.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      var __assign2 = mtext && mtext.__assign || function() {
        __assign2 = Object.assign || function(t2) {
          for (var s, i2 = 1, n = arguments.length; i2 < n; i2++) {
            s = arguments[i2];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
              t2[p] = s[p];
          }
          return t2;
        };
        return __assign2.apply(this, arguments);
      };
      Object.defineProperty(mtext, "__esModule", { value: true });
      mtext.MmlMtext = void 0;
      var MmlNode_js_1 = requireMmlNode();
      var MmlMtext = (function(_super) {
        __extends2(MmlMtext2, _super);
        function MmlMtext2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.texclass = MmlNode_js_1.TEXCLASS.ORD;
          return _this;
        }
        Object.defineProperty(MmlMtext2.prototype, "kind", {
          get: function() {
            return "mtext";
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(MmlMtext2.prototype, "isSpacelike", {
          get: function() {
            return true;
          },
          enumerable: false,
          configurable: true
        });
        MmlMtext2.defaults = __assign2({}, MmlNode_js_1.AbstractMmlTokenNode.defaults);
        return MmlMtext2;
      })(MmlNode_js_1.AbstractMmlTokenNode);
      mtext.MmlMtext = MmlMtext;
      return mtext;
    }
    var hasRequiredMtext;
    function requireMtext() {
      if (hasRequiredMtext) return mtext$2;
      hasRequiredMtext = 1;
      var __extends2 = mtext$2 && mtext$2.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      Object.defineProperty(mtext$2, "__esModule", { value: true });
      mtext$2.SVGmtext = void 0;
      var Wrapper_js_1 = requireWrapper();
      var mtext_js_1 = requireMtext$2();
      var mtext_js_2 = requireMtext$1();
      var SVGmtext = (function(_super) {
        __extends2(SVGmtext2, _super);
        function SVGmtext2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        SVGmtext2.kind = mtext_js_2.MmlMtext.prototype.kind;
        return SVGmtext2;
      })((0, mtext_js_1.CommonMtextMixin)(Wrapper_js_1.SVGWrapper));
      mtext$2.SVGmtext = SVGmtext;
      return mtext$2;
    }
    var merror$1 = {};
    var merror = {};
    var hasRequiredMerror$1;
    function requireMerror$1() {
      if (hasRequiredMerror$1) return merror;
      hasRequiredMerror$1 = 1;
      var __extends2 = merror && merror.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      var __assign2 = merror && merror.__assign || function() {
        __assign2 = Object.assign || function(t2) {
          for (var s, i2 = 1, n = arguments.length; i2 < n; i2++) {
            s = arguments[i2];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
              t2[p] = s[p];
          }
          return t2;
        };
        return __assign2.apply(this, arguments);
      };
      Object.defineProperty(merror, "__esModule", { value: true });
      merror.MmlMerror = void 0;
      var MmlNode_js_1 = requireMmlNode();
      var MmlMerror = (function(_super) {
        __extends2(MmlMerror2, _super);
        function MmlMerror2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.texclass = MmlNode_js_1.TEXCLASS.ORD;
          return _this;
        }
        Object.defineProperty(MmlMerror2.prototype, "kind", {
          get: function() {
            return "merror";
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(MmlMerror2.prototype, "arity", {
          get: function() {
            return -1;
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(MmlMerror2.prototype, "linebreakContainer", {
          get: function() {
            return true;
          },
          enumerable: false,
          configurable: true
        });
        MmlMerror2.defaults = __assign2({}, MmlNode_js_1.AbstractMmlNode.defaults);
        return MmlMerror2;
      })(MmlNode_js_1.AbstractMmlNode);
      merror.MmlMerror = MmlMerror;
      return merror;
    }
    var hasRequiredMerror;
    function requireMerror() {
      if (hasRequiredMerror) return merror$1;
      hasRequiredMerror = 1;
      var __extends2 = merror$1 && merror$1.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      Object.defineProperty(merror$1, "__esModule", { value: true });
      merror$1.SVGmerror = void 0;
      var Wrapper_js_1 = requireWrapper();
      var merror_js_1 = requireMerror$1();
      var SVGmerror = (function(_super) {
        __extends2(SVGmerror2, _super);
        function SVGmerror2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        SVGmerror2.prototype.toSVG = function(parent) {
          var svg2 = this.standardSVGnode(parent);
          var _a2 = this.getBBox(), h = _a2.h, d = _a2.d, w = _a2.w;
          this.adaptor.append(this.element, this.svg("rect", {
            "data-background": true,
            width: this.fixed(w),
            height: this.fixed(h + d),
            y: this.fixed(-d)
          }));
          var title2 = this.node.attributes.get("title");
          if (title2) {
            this.adaptor.append(this.element, this.svg("title", {}, [this.adaptor.text(title2)]));
          }
          this.addChildren(svg2);
        };
        SVGmerror2.kind = merror_js_1.MmlMerror.prototype.kind;
        SVGmerror2.styles = {
          'g[data-mml-node="merror"] > g': {
            fill: "red",
            stroke: "red"
          },
          'g[data-mml-node="merror"] > rect[data-background]': {
            fill: "yellow",
            stroke: "none"
          }
        };
        return SVGmerror2;
      })(Wrapper_js_1.SVGWrapper);
      merror$1.SVGmerror = SVGmerror;
      return merror$1;
    }
    var mspace$2 = {};
    var mspace$1 = {};
    var hasRequiredMspace$2;
    function requireMspace$2() {
      if (hasRequiredMspace$2) return mspace$1;
      hasRequiredMspace$2 = 1;
      var __extends2 = mspace$1 && mspace$1.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      Object.defineProperty(mspace$1, "__esModule", { value: true });
      mspace$1.CommonMspaceMixin = void 0;
      function CommonMspaceMixin(Base) {
        return (function(_super) {
          __extends2(class_1, _super);
          function class_1() {
            return _super !== null && _super.apply(this, arguments) || this;
          }
          class_1.prototype.computeBBox = function(bbox, _recompute) {
            var attributes2 = this.node.attributes;
            bbox.w = this.length2em(attributes2.get("width"), 0);
            bbox.h = this.length2em(attributes2.get("height"), 0);
            bbox.d = this.length2em(attributes2.get("depth"), 0);
          };
          class_1.prototype.handleVariant = function() {
          };
          return class_1;
        })(Base);
      }
      mspace$1.CommonMspaceMixin = CommonMspaceMixin;
      return mspace$1;
    }
    var mspace = {};
    var hasRequiredMspace$1;
    function requireMspace$1() {
      if (hasRequiredMspace$1) return mspace;
      hasRequiredMspace$1 = 1;
      var __extends2 = mspace && mspace.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      var __assign2 = mspace && mspace.__assign || function() {
        __assign2 = Object.assign || function(t2) {
          for (var s, i2 = 1, n = arguments.length; i2 < n; i2++) {
            s = arguments[i2];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
              t2[p] = s[p];
          }
          return t2;
        };
        return __assign2.apply(this, arguments);
      };
      Object.defineProperty(mspace, "__esModule", { value: true });
      mspace.MmlMspace = void 0;
      var MmlNode_js_1 = requireMmlNode();
      var MmlMspace = (function(_super) {
        __extends2(MmlMspace2, _super);
        function MmlMspace2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.texclass = MmlNode_js_1.TEXCLASS.NONE;
          return _this;
        }
        MmlMspace2.prototype.setTeXclass = function(prev) {
          return prev;
        };
        Object.defineProperty(MmlMspace2.prototype, "kind", {
          get: function() {
            return "mspace";
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(MmlMspace2.prototype, "arity", {
          get: function() {
            return 0;
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(MmlMspace2.prototype, "isSpacelike", {
          get: function() {
            return true;
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(MmlMspace2.prototype, "hasNewline", {
          get: function() {
            var attributes2 = this.attributes;
            return attributes2.getExplicit("width") == null && attributes2.getExplicit("height") == null && attributes2.getExplicit("depth") == null && attributes2.get("linebreak") === "newline";
          },
          enumerable: false,
          configurable: true
        });
        MmlMspace2.defaults = __assign2(__assign2({}, MmlNode_js_1.AbstractMmlTokenNode.defaults), { width: "0em", height: "0ex", depth: "0ex", linebreak: "auto" });
        return MmlMspace2;
      })(MmlNode_js_1.AbstractMmlTokenNode);
      mspace.MmlMspace = MmlMspace;
      return mspace;
    }
    var hasRequiredMspace;
    function requireMspace() {
      if (hasRequiredMspace) return mspace$2;
      hasRequiredMspace = 1;
      var __extends2 = mspace$2 && mspace$2.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      Object.defineProperty(mspace$2, "__esModule", { value: true });
      mspace$2.SVGmspace = void 0;
      var Wrapper_js_1 = requireWrapper();
      var mspace_js_1 = requireMspace$2();
      var mspace_js_2 = requireMspace$1();
      var SVGmspace = (function(_super) {
        __extends2(SVGmspace2, _super);
        function SVGmspace2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        SVGmspace2.kind = mspace_js_2.MmlMspace.prototype.kind;
        return SVGmspace2;
      })((0, mspace_js_1.CommonMspaceMixin)(Wrapper_js_1.SVGWrapper));
      mspace$2.SVGmspace = SVGmspace;
      return mspace$2;
    }
    var mpadded$2 = {};
    var mpadded$1 = {};
    var hasRequiredMpadded$2;
    function requireMpadded$2() {
      if (hasRequiredMpadded$2) return mpadded$1;
      hasRequiredMpadded$2 = 1;
      var __extends2 = mpadded$1 && mpadded$1.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      var __read2 = mpadded$1 && mpadded$1.__read || function(o, n) {
        var m = typeof Symbol === "function" && o[Symbol.iterator];
        if (!m) return o;
        var i2 = m.call(o), r2, ar2 = [], e;
        try {
          while ((n === void 0 || n-- > 0) && !(r2 = i2.next()).done) ar2.push(r2.value);
        } catch (error2) {
          e = { error: error2 };
        } finally {
          try {
            if (r2 && !r2.done && (m = i2["return"])) m.call(i2);
          } finally {
            if (e) throw e.error;
          }
        }
        return ar2;
      };
      Object.defineProperty(mpadded$1, "__esModule", { value: true });
      mpadded$1.CommonMpaddedMixin = void 0;
      function CommonMpaddedMixin(Base) {
        return (function(_super) {
          __extends2(class_1, _super);
          function class_1() {
            return _super !== null && _super.apply(this, arguments) || this;
          }
          class_1.prototype.getDimens = function() {
            var values = this.node.attributes.getList("width", "height", "depth", "lspace", "voffset");
            var bbox = this.childNodes[0].getBBox();
            var w = bbox.w, h = bbox.h, d = bbox.d;
            var W = w, H = h, D2 = d, x2 = 0, y = 0, dx = 0;
            if (values.width !== "")
              w = this.dimen(values.width, bbox, "w", 0);
            if (values.height !== "")
              h = this.dimen(values.height, bbox, "h", 0);
            if (values.depth !== "")
              d = this.dimen(values.depth, bbox, "d", 0);
            if (values.voffset !== "")
              y = this.dimen(values.voffset, bbox);
            if (values.lspace !== "")
              x2 = this.dimen(values.lspace, bbox);
            var align = this.node.attributes.get("data-align");
            if (align) {
              dx = this.getAlignX(w, bbox, align);
            }
            return [H, D2, W, h - H, d - D2, w - W, x2, y, dx];
          };
          class_1.prototype.dimen = function(length, bbox, d, m) {
            if (d === void 0) {
              d = "";
            }
            if (m === void 0) {
              m = null;
            }
            length = String(length);
            var match = length.match(/width|height|depth/);
            var size = match ? bbox[match[0].charAt(0)] : d ? bbox[d] : 0;
            var dimen = this.length2em(length, size) || 0;
            if (length.match(/^[-+]/) && d) {
              dimen += size;
            }
            if (m != null) {
              dimen = Math.max(m, dimen);
            }
            return dimen;
          };
          class_1.prototype.computeBBox = function(bbox, recompute) {
            if (recompute === void 0) {
              recompute = false;
            }
            var _a2 = __read2(this.getDimens(), 6), H = _a2[0], D2 = _a2[1], W = _a2[2], dh = _a2[3], dd2 = _a2[4], dw = _a2[5];
            bbox.w = W + dw;
            bbox.h = H + dh;
            bbox.d = D2 + dd2;
            this.setChildPWidths(recompute, bbox.w);
          };
          class_1.prototype.getWrapWidth = function(_i) {
            return this.getBBox().w;
          };
          class_1.prototype.getChildAlign = function(_i) {
            return this.node.attributes.get("data-align") || "left";
          };
          return class_1;
        })(Base);
      }
      mpadded$1.CommonMpaddedMixin = CommonMpaddedMixin;
      return mpadded$1;
    }
    var mpadded = {};
    var hasRequiredMpadded$1;
    function requireMpadded$1() {
      if (hasRequiredMpadded$1) return mpadded;
      hasRequiredMpadded$1 = 1;
      var __extends2 = mpadded && mpadded.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      var __assign2 = mpadded && mpadded.__assign || function() {
        __assign2 = Object.assign || function(t2) {
          for (var s, i2 = 1, n = arguments.length; i2 < n; i2++) {
            s = arguments[i2];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
              t2[p] = s[p];
          }
          return t2;
        };
        return __assign2.apply(this, arguments);
      };
      Object.defineProperty(mpadded, "__esModule", { value: true });
      mpadded.MmlMpadded = void 0;
      var MmlNode_js_1 = requireMmlNode();
      var MmlMpadded = (function(_super) {
        __extends2(MmlMpadded2, _super);
        function MmlMpadded2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        Object.defineProperty(MmlMpadded2.prototype, "kind", {
          get: function() {
            return "mpadded";
          },
          enumerable: false,
          configurable: true
        });
        MmlMpadded2.defaults = __assign2(__assign2({}, MmlNode_js_1.AbstractMmlLayoutNode.defaults), { width: "", height: "", depth: "", lspace: 0, voffset: 0 });
        return MmlMpadded2;
      })(MmlNode_js_1.AbstractMmlLayoutNode);
      mpadded.MmlMpadded = MmlMpadded;
      return mpadded;
    }
    var hasRequiredMpadded;
    function requireMpadded() {
      if (hasRequiredMpadded) return mpadded$2;
      hasRequiredMpadded = 1;
      var __extends2 = mpadded$2 && mpadded$2.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      var __read2 = mpadded$2 && mpadded$2.__read || function(o, n) {
        var m = typeof Symbol === "function" && o[Symbol.iterator];
        if (!m) return o;
        var i2 = m.call(o), r2, ar2 = [], e;
        try {
          while ((n === void 0 || n-- > 0) && !(r2 = i2.next()).done) ar2.push(r2.value);
        } catch (error2) {
          e = { error: error2 };
        } finally {
          try {
            if (r2 && !r2.done && (m = i2["return"])) m.call(i2);
          } finally {
            if (e) throw e.error;
          }
        }
        return ar2;
      };
      Object.defineProperty(mpadded$2, "__esModule", { value: true });
      mpadded$2.SVGmpadded = void 0;
      var Wrapper_js_1 = requireWrapper();
      var mpadded_js_1 = requireMpadded$2();
      var mpadded_js_2 = requireMpadded$1();
      var SVGmpadded = (function(_super) {
        __extends2(SVGmpadded2, _super);
        function SVGmpadded2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        SVGmpadded2.prototype.toSVG = function(parent) {
          var svg2 = this.standardSVGnode(parent);
          var _a2 = __read2(this.getDimens(), 9), dw = _a2[5], x2 = _a2[6], y = _a2[7], dx = _a2[8];
          var align = this.node.attributes.get("data-align") || "left";
          var X2 = x2 + dx - (dw < 0 && align !== "left" ? align === "center" ? dw / 2 : dw : 0);
          if (X2 || y) {
            svg2 = this.adaptor.append(svg2, this.svg("g"));
            this.place(X2, y, svg2);
          }
          this.addChildren(svg2);
        };
        SVGmpadded2.kind = mpadded_js_2.MmlMpadded.prototype.kind;
        return SVGmpadded2;
      })((0, mpadded_js_1.CommonMpaddedMixin)(Wrapper_js_1.SVGWrapper));
      mpadded$2.SVGmpadded = SVGmpadded;
      return mpadded$2;
    }
    var mphantom$1 = {};
    var mphantom = {};
    var hasRequiredMphantom$1;
    function requireMphantom$1() {
      if (hasRequiredMphantom$1) return mphantom;
      hasRequiredMphantom$1 = 1;
      var __extends2 = mphantom && mphantom.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      var __assign2 = mphantom && mphantom.__assign || function() {
        __assign2 = Object.assign || function(t2) {
          for (var s, i2 = 1, n = arguments.length; i2 < n; i2++) {
            s = arguments[i2];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
              t2[p] = s[p];
          }
          return t2;
        };
        return __assign2.apply(this, arguments);
      };
      Object.defineProperty(mphantom, "__esModule", { value: true });
      mphantom.MmlMphantom = void 0;
      var MmlNode_js_1 = requireMmlNode();
      var MmlMphantom = (function(_super) {
        __extends2(MmlMphantom2, _super);
        function MmlMphantom2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.texclass = MmlNode_js_1.TEXCLASS.ORD;
          return _this;
        }
        Object.defineProperty(MmlMphantom2.prototype, "kind", {
          get: function() {
            return "mphantom";
          },
          enumerable: false,
          configurable: true
        });
        MmlMphantom2.defaults = __assign2({}, MmlNode_js_1.AbstractMmlLayoutNode.defaults);
        return MmlMphantom2;
      })(MmlNode_js_1.AbstractMmlLayoutNode);
      mphantom.MmlMphantom = MmlMphantom;
      return mphantom;
    }
    var hasRequiredMphantom;
    function requireMphantom() {
      if (hasRequiredMphantom) return mphantom$1;
      hasRequiredMphantom = 1;
      var __extends2 = mphantom$1 && mphantom$1.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      Object.defineProperty(mphantom$1, "__esModule", { value: true });
      mphantom$1.SVGmphantom = void 0;
      var Wrapper_js_1 = requireWrapper();
      var mphantom_js_1 = requireMphantom$1();
      var SVGmphantom = (function(_super) {
        __extends2(SVGmphantom2, _super);
        function SVGmphantom2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        SVGmphantom2.prototype.toSVG = function(parent) {
          this.standardSVGnode(parent);
        };
        SVGmphantom2.kind = mphantom_js_1.MmlMphantom.prototype.kind;
        return SVGmphantom2;
      })(Wrapper_js_1.SVGWrapper);
      mphantom$1.SVGmphantom = SVGmphantom;
      return mphantom$1;
    }
    var mfrac$2 = {};
    var mfrac$1 = {};
    var hasRequiredMfrac$2;
    function requireMfrac$2() {
      if (hasRequiredMfrac$2) return mfrac$1;
      hasRequiredMfrac$2 = 1;
      var __extends2 = mfrac$1 && mfrac$1.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      var __read2 = mfrac$1 && mfrac$1.__read || function(o, n) {
        var m = typeof Symbol === "function" && o[Symbol.iterator];
        if (!m) return o;
        var i2 = m.call(o), r2, ar2 = [], e;
        try {
          while ((n === void 0 || n-- > 0) && !(r2 = i2.next()).done) ar2.push(r2.value);
        } catch (error2) {
          e = { error: error2 };
        } finally {
          try {
            if (r2 && !r2.done && (m = i2["return"])) m.call(i2);
          } finally {
            if (e) throw e.error;
          }
        }
        return ar2;
      };
      var __spreadArray2 = mfrac$1 && mfrac$1.__spreadArray || function(to2, from, pack) {
        if (pack || arguments.length === 2) for (var i2 = 0, l = from.length, ar2; i2 < l; i2++) {
          if (ar2 || !(i2 in from)) {
            if (!ar2) ar2 = Array.prototype.slice.call(from, 0, i2);
            ar2[i2] = from[i2];
          }
        }
        return to2.concat(ar2 || Array.prototype.slice.call(from));
      };
      Object.defineProperty(mfrac$1, "__esModule", { value: true });
      mfrac$1.CommonMfracMixin = void 0;
      function CommonMfracMixin(Base) {
        return (function(_super) {
          __extends2(class_1, _super);
          function class_1() {
            var args2 = [];
            for (var _i = 0; _i < arguments.length; _i++) {
              args2[_i] = arguments[_i];
            }
            var _this = _super.apply(this, __spreadArray2([], __read2(args2), false)) || this;
            _this.bevel = null;
            _this.pad = _this.node.getProperty("withDelims") ? 0 : _this.font.params.nulldelimiterspace;
            if (_this.node.attributes.get("bevelled")) {
              var H = _this.getBevelData(_this.isDisplay()).H;
              var bevel = _this.bevel = _this.createMo("/");
              bevel.node.attributes.set("symmetric", true);
              bevel.canStretch(1);
              bevel.getStretchedVariant([H], true);
            }
            return _this;
          }
          class_1.prototype.computeBBox = function(bbox, recompute) {
            if (recompute === void 0) {
              recompute = false;
            }
            bbox.empty();
            var _a2 = this.node.attributes.getList("linethickness", "bevelled"), linethickness = _a2.linethickness, bevelled = _a2.bevelled;
            var display = this.isDisplay();
            var w = null;
            if (bevelled) {
              this.getBevelledBBox(bbox, display);
            } else {
              var thickness = this.length2em(String(linethickness), 0.06);
              w = -2 * this.pad;
              if (thickness === 0) {
                this.getAtopBBox(bbox, display);
              } else {
                this.getFractionBBox(bbox, display, thickness);
                w -= 0.2;
              }
              w += bbox.w;
            }
            bbox.clean();
            this.setChildPWidths(recompute, w);
          };
          class_1.prototype.getFractionBBox = function(bbox, display, t2) {
            var nbox = this.childNodes[0].getOuterBBox();
            var dbox = this.childNodes[1].getOuterBBox();
            var tex2 = this.font.params;
            var a = tex2.axis_height;
            var _a2 = this.getTUV(display, t2), T = _a2.T, u = _a2.u, v = _a2.v;
            bbox.combine(nbox, 0, a + T + Math.max(nbox.d * nbox.rscale, u));
            bbox.combine(dbox, 0, a - T - Math.max(dbox.h * dbox.rscale, v));
            bbox.w += 2 * this.pad + 0.2;
          };
          class_1.prototype.getTUV = function(display, t2) {
            var tex2 = this.font.params;
            var a = tex2.axis_height;
            var T = (display ? 3.5 : 1.5) * t2;
            return {
              T: (display ? 3.5 : 1.5) * t2,
              u: (display ? tex2.num1 : tex2.num2) - a - T,
              v: (display ? tex2.denom1 : tex2.denom2) + a - T
            };
          };
          class_1.prototype.getAtopBBox = function(bbox, display) {
            var _a2 = this.getUVQ(display), u = _a2.u, v = _a2.v, nbox = _a2.nbox, dbox = _a2.dbox;
            bbox.combine(nbox, 0, u);
            bbox.combine(dbox, 0, -v);
            bbox.w += 2 * this.pad;
          };
          class_1.prototype.getUVQ = function(display) {
            var nbox = this.childNodes[0].getOuterBBox();
            var dbox = this.childNodes[1].getOuterBBox();
            var tex2 = this.font.params;
            var _a2 = __read2(display ? [tex2.num1, tex2.denom1] : [tex2.num3, tex2.denom2], 2), u = _a2[0], v = _a2[1];
            var p = (display ? 7 : 3) * tex2.rule_thickness;
            var q = u - nbox.d * nbox.scale - (dbox.h * dbox.scale - v);
            if (q < p) {
              u += (p - q) / 2;
              v += (p - q) / 2;
              q = p;
            }
            return { u, v, q, nbox, dbox };
          };
          class_1.prototype.getBevelledBBox = function(bbox, display) {
            var _a2 = this.getBevelData(display), u = _a2.u, v = _a2.v, delta2 = _a2.delta, nbox = _a2.nbox, dbox = _a2.dbox;
            var lbox = this.bevel.getOuterBBox();
            bbox.combine(nbox, 0, u);
            bbox.combine(lbox, bbox.w - delta2 / 2, 0);
            bbox.combine(dbox, bbox.w - delta2 / 2, v);
          };
          class_1.prototype.getBevelData = function(display) {
            var nbox = this.childNodes[0].getOuterBBox();
            var dbox = this.childNodes[1].getOuterBBox();
            var delta2 = display ? 0.4 : 0.15;
            var H = Math.max(nbox.scale * (nbox.h + nbox.d), dbox.scale * (dbox.h + dbox.d)) + 2 * delta2;
            var a = this.font.params.axis_height;
            var u = nbox.scale * (nbox.d - nbox.h) / 2 + a + delta2;
            var v = dbox.scale * (dbox.d - dbox.h) / 2 + a - delta2;
            return { H, delta: delta2, u, v, nbox, dbox };
          };
          class_1.prototype.canStretch = function(_direction) {
            return false;
          };
          class_1.prototype.isDisplay = function() {
            var _a2 = this.node.attributes.getList("displaystyle", "scriptlevel"), displaystyle = _a2.displaystyle, scriptlevel = _a2.scriptlevel;
            return displaystyle && scriptlevel === 0;
          };
          class_1.prototype.getWrapWidth = function(i2) {
            var attributes2 = this.node.attributes;
            if (attributes2.get("bevelled")) {
              return this.childNodes[i2].getOuterBBox().w;
            }
            var w = this.getBBox().w;
            var thickness = this.length2em(attributes2.get("linethickness"));
            return w - (thickness ? 0.2 : 0) - 2 * this.pad;
          };
          class_1.prototype.getChildAlign = function(i2) {
            var attributes2 = this.node.attributes;
            return attributes2.get("bevelled") ? "left" : attributes2.get(["numalign", "denomalign"][i2]);
          };
          return class_1;
        })(Base);
      }
      mfrac$1.CommonMfracMixin = CommonMfracMixin;
      return mfrac$1;
    }
    var mfrac = {};
    var hasRequiredMfrac$1;
    function requireMfrac$1() {
      if (hasRequiredMfrac$1) return mfrac;
      hasRequiredMfrac$1 = 1;
      var __extends2 = mfrac && mfrac.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      var __assign2 = mfrac && mfrac.__assign || function() {
        __assign2 = Object.assign || function(t2) {
          for (var s, i2 = 1, n = arguments.length; i2 < n; i2++) {
            s = arguments[i2];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
              t2[p] = s[p];
          }
          return t2;
        };
        return __assign2.apply(this, arguments);
      };
      var __values2 = mfrac && mfrac.__values || function(o) {
        var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i2 = 0;
        if (m) return m.call(o);
        if (o && typeof o.length === "number") return {
          next: function() {
            if (o && i2 >= o.length) o = void 0;
            return { value: o && o[i2++], done: !o };
          }
        };
        throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
      };
      Object.defineProperty(mfrac, "__esModule", { value: true });
      mfrac.MmlMfrac = void 0;
      var MmlNode_js_1 = requireMmlNode();
      var MmlMfrac = (function(_super) {
        __extends2(MmlMfrac2, _super);
        function MmlMfrac2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        Object.defineProperty(MmlMfrac2.prototype, "kind", {
          get: function() {
            return "mfrac";
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(MmlMfrac2.prototype, "arity", {
          get: function() {
            return 2;
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(MmlMfrac2.prototype, "linebreakContainer", {
          get: function() {
            return true;
          },
          enumerable: false,
          configurable: true
        });
        MmlMfrac2.prototype.setTeXclass = function(prev) {
          var e_1, _a2;
          this.getPrevClass(prev);
          try {
            for (var _b2 = __values2(this.childNodes), _c = _b2.next(); !_c.done; _c = _b2.next()) {
              var child = _c.value;
              child.setTeXclass(null);
            }
          } catch (e_1_1) {
            e_1 = { error: e_1_1 };
          } finally {
            try {
              if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
            } finally {
              if (e_1) throw e_1.error;
            }
          }
          return this;
        };
        MmlMfrac2.prototype.setChildInheritedAttributes = function(attributes2, display, level, prime2) {
          if (!display || level > 0) {
            level++;
          }
          this.childNodes[0].setInheritedAttributes(attributes2, false, level, prime2);
          this.childNodes[1].setInheritedAttributes(attributes2, false, level, true);
        };
        MmlMfrac2.defaults = __assign2(__assign2({}, MmlNode_js_1.AbstractMmlBaseNode.defaults), { linethickness: "medium", numalign: "center", denomalign: "center", bevelled: false });
        return MmlMfrac2;
      })(MmlNode_js_1.AbstractMmlBaseNode);
      mfrac.MmlMfrac = MmlMfrac;
      return mfrac;
    }
    var hasRequiredMfrac;
    function requireMfrac() {
      if (hasRequiredMfrac) return mfrac$2;
      hasRequiredMfrac = 1;
      var __extends2 = mfrac$2 && mfrac$2.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      var __read2 = mfrac$2 && mfrac$2.__read || function(o, n) {
        var m = typeof Symbol === "function" && o[Symbol.iterator];
        if (!m) return o;
        var i2 = m.call(o), r2, ar2 = [], e;
        try {
          while ((n === void 0 || n-- > 0) && !(r2 = i2.next()).done) ar2.push(r2.value);
        } catch (error2) {
          e = { error: error2 };
        } finally {
          try {
            if (r2 && !r2.done && (m = i2["return"])) m.call(i2);
          } finally {
            if (e) throw e.error;
          }
        }
        return ar2;
      };
      Object.defineProperty(mfrac$2, "__esModule", { value: true });
      mfrac$2.SVGmfrac = void 0;
      var Wrapper_js_1 = requireWrapper();
      var mfrac_js_1 = requireMfrac$2();
      var mfrac_js_2 = requireMfrac$1();
      var SVGmfrac = (function(_super) {
        __extends2(SVGmfrac2, _super);
        function SVGmfrac2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        SVGmfrac2.prototype.toSVG = function(parent) {
          this.standardSVGnode(parent);
          var _a2 = this.node.attributes.getList("linethickness", "bevelled"), linethickness = _a2.linethickness, bevelled = _a2.bevelled;
          var display = this.isDisplay();
          if (bevelled) {
            this.makeBevelled(display);
          } else {
            var thickness = this.length2em(String(linethickness), 0.06);
            if (thickness === 0) {
              this.makeAtop(display);
            } else {
              this.makeFraction(display, thickness);
            }
          }
        };
        SVGmfrac2.prototype.makeFraction = function(display, t2) {
          var svg2 = this.element;
          var _a2 = this.node.attributes.getList("numalign", "denomalign"), numalign = _a2.numalign, denomalign = _a2.denomalign;
          var _b2 = __read2(this.childNodes, 2), num2 = _b2[0], den = _b2[1];
          var nbox = num2.getOuterBBox();
          var dbox = den.getOuterBBox();
          var tex2 = this.font.params;
          var a = tex2.axis_height;
          var d = 0.1;
          var pad = this.node.getProperty("withDelims") ? 0 : tex2.nulldelimiterspace;
          var W = Math.max((nbox.L + nbox.w + nbox.R) * nbox.rscale, (dbox.L + dbox.w + dbox.R) * dbox.rscale);
          var nx = this.getAlignX(W, nbox, numalign) + d + pad;
          var dx = this.getAlignX(W, dbox, denomalign) + d + pad;
          var _c = this.getTUV(display, t2), T = _c.T, u = _c.u, v = _c.v;
          num2.toSVG(svg2);
          num2.place(nx, a + T + Math.max(nbox.d * nbox.rscale, u));
          den.toSVG(svg2);
          den.place(dx, a - T - Math.max(dbox.h * dbox.rscale, v));
          this.adaptor.append(svg2, this.svg("rect", {
            width: this.fixed(W + 2 * d),
            height: this.fixed(t2),
            x: this.fixed(pad),
            y: this.fixed(a - t2 / 2)
          }));
        };
        SVGmfrac2.prototype.makeAtop = function(display) {
          var svg2 = this.element;
          var _a2 = this.node.attributes.getList("numalign", "denomalign"), numalign = _a2.numalign, denomalign = _a2.denomalign;
          var _b2 = __read2(this.childNodes, 2), num2 = _b2[0], den = _b2[1];
          var nbox = num2.getOuterBBox();
          var dbox = den.getOuterBBox();
          var tex2 = this.font.params;
          var pad = this.node.getProperty("withDelims") ? 0 : tex2.nulldelimiterspace;
          var W = Math.max((nbox.L + nbox.w + nbox.R) * nbox.rscale, (dbox.L + dbox.w + dbox.R) * dbox.rscale);
          var nx = this.getAlignX(W, nbox, numalign) + pad;
          var dx = this.getAlignX(W, dbox, denomalign) + pad;
          var _c = this.getUVQ(display), u = _c.u, v = _c.v;
          num2.toSVG(svg2);
          num2.place(nx, u);
          den.toSVG(svg2);
          den.place(dx, -v);
        };
        SVGmfrac2.prototype.makeBevelled = function(display) {
          var svg2 = this.element;
          var _a2 = __read2(this.childNodes, 2), num2 = _a2[0], den = _a2[1];
          var _b2 = this.getBevelData(display), u = _b2.u, v = _b2.v, delta2 = _b2.delta, nbox = _b2.nbox, dbox = _b2.dbox;
          var w = (nbox.L + nbox.w + nbox.R) * nbox.rscale;
          num2.toSVG(svg2);
          this.bevel.toSVG(svg2);
          den.toSVG(svg2);
          num2.place(nbox.L * nbox.rscale, u);
          this.bevel.place(w - delta2 / 2, 0);
          den.place(w + this.bevel.getOuterBBox().w + dbox.L * dbox.rscale - delta2, v);
        };
        SVGmfrac2.kind = mfrac_js_2.MmlMfrac.prototype.kind;
        return SVGmfrac2;
      })((0, mfrac_js_1.CommonMfracMixin)(Wrapper_js_1.SVGWrapper));
      mfrac$2.SVGmfrac = SVGmfrac;
      return mfrac$2;
    }
    var msqrt$2 = {};
    var msqrt$1 = {};
    var hasRequiredMsqrt$2;
    function requireMsqrt$2() {
      if (hasRequiredMsqrt$2) return msqrt$1;
      hasRequiredMsqrt$2 = 1;
      var __extends2 = msqrt$1 && msqrt$1.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      var __read2 = msqrt$1 && msqrt$1.__read || function(o, n) {
        var m = typeof Symbol === "function" && o[Symbol.iterator];
        if (!m) return o;
        var i2 = m.call(o), r2, ar2 = [], e;
        try {
          while ((n === void 0 || n-- > 0) && !(r2 = i2.next()).done) ar2.push(r2.value);
        } catch (error2) {
          e = { error: error2 };
        } finally {
          try {
            if (r2 && !r2.done && (m = i2["return"])) m.call(i2);
          } finally {
            if (e) throw e.error;
          }
        }
        return ar2;
      };
      var __spreadArray2 = msqrt$1 && msqrt$1.__spreadArray || function(to2, from, pack) {
        if (pack || arguments.length === 2) for (var i2 = 0, l = from.length, ar2; i2 < l; i2++) {
          if (ar2 || !(i2 in from)) {
            if (!ar2) ar2 = Array.prototype.slice.call(from, 0, i2);
            ar2[i2] = from[i2];
          }
        }
        return to2.concat(ar2 || Array.prototype.slice.call(from));
      };
      Object.defineProperty(msqrt$1, "__esModule", { value: true });
      msqrt$1.CommonMsqrtMixin = void 0;
      var BBox_js_1 = requireBBox();
      function CommonMsqrtMixin(Base) {
        return (function(_super) {
          __extends2(class_1, _super);
          function class_1() {
            var args2 = [];
            for (var _i = 0; _i < arguments.length; _i++) {
              args2[_i] = arguments[_i];
            }
            var _this = _super.apply(this, __spreadArray2([], __read2(args2), false)) || this;
            var surd = _this.createMo("√");
            surd.canStretch(1);
            var _a2 = _this.childNodes[_this.base].getOuterBBox(), h = _a2.h, d = _a2.d;
            var t2 = _this.font.params.rule_thickness;
            var p = _this.node.attributes.get("displaystyle") ? _this.font.params.x_height : t2;
            _this.surdH = h + d + 2 * t2 + p / 4;
            surd.getStretchedVariant([_this.surdH - d, d], true);
            return _this;
          }
          Object.defineProperty(class_1.prototype, "base", {
            get: function() {
              return 0;
            },
            enumerable: false,
            configurable: true
          });
          Object.defineProperty(class_1.prototype, "surd", {
            get: function() {
              return 1;
            },
            enumerable: false,
            configurable: true
          });
          Object.defineProperty(class_1.prototype, "root", {
            get: function() {
              return null;
            },
            enumerable: false,
            configurable: true
          });
          class_1.prototype.createMo = function(text2) {
            var node2 = _super.prototype.createMo.call(this, text2);
            this.childNodes.push(node2);
            return node2;
          };
          class_1.prototype.computeBBox = function(bbox, recompute) {
            if (recompute === void 0) {
              recompute = false;
            }
            var surdbox = this.childNodes[this.surd].getBBox();
            var basebox = new BBox_js_1.BBox(this.childNodes[this.base].getOuterBBox());
            var q = this.getPQ(surdbox)[1];
            var t2 = this.font.params.rule_thickness;
            var H = basebox.h + q + t2;
            var _a2 = __read2(this.getRootDimens(surdbox, H), 1), x2 = _a2[0];
            bbox.h = H + t2;
            this.combineRootBBox(bbox, surdbox, H);
            bbox.combine(surdbox, x2, H - surdbox.h);
            bbox.combine(basebox, x2 + surdbox.w, 0);
            bbox.clean();
            this.setChildPWidths(recompute);
          };
          class_1.prototype.combineRootBBox = function(_bbox, _sbox, _H) {
          };
          class_1.prototype.getPQ = function(sbox) {
            var t2 = this.font.params.rule_thickness;
            var p = this.node.attributes.get("displaystyle") ? this.font.params.x_height : t2;
            var q = sbox.h + sbox.d > this.surdH ? (sbox.h + sbox.d - (this.surdH - 2 * t2 - p / 2)) / 2 : t2 + p / 4;
            return [p, q];
          };
          class_1.prototype.getRootDimens = function(_sbox, _H) {
            return [0, 0, 0, 0];
          };
          return class_1;
        })(Base);
      }
      msqrt$1.CommonMsqrtMixin = CommonMsqrtMixin;
      return msqrt$1;
    }
    var msqrt = {};
    var hasRequiredMsqrt$1;
    function requireMsqrt$1() {
      if (hasRequiredMsqrt$1) return msqrt;
      hasRequiredMsqrt$1 = 1;
      var __extends2 = msqrt && msqrt.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      var __assign2 = msqrt && msqrt.__assign || function() {
        __assign2 = Object.assign || function(t2) {
          for (var s, i2 = 1, n = arguments.length; i2 < n; i2++) {
            s = arguments[i2];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
              t2[p] = s[p];
          }
          return t2;
        };
        return __assign2.apply(this, arguments);
      };
      Object.defineProperty(msqrt, "__esModule", { value: true });
      msqrt.MmlMsqrt = void 0;
      var MmlNode_js_1 = requireMmlNode();
      var MmlMsqrt = (function(_super) {
        __extends2(MmlMsqrt2, _super);
        function MmlMsqrt2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.texclass = MmlNode_js_1.TEXCLASS.ORD;
          return _this;
        }
        Object.defineProperty(MmlMsqrt2.prototype, "kind", {
          get: function() {
            return "msqrt";
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(MmlMsqrt2.prototype, "arity", {
          get: function() {
            return -1;
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(MmlMsqrt2.prototype, "linebreakContainer", {
          get: function() {
            return true;
          },
          enumerable: false,
          configurable: true
        });
        MmlMsqrt2.prototype.setTeXclass = function(prev) {
          this.getPrevClass(prev);
          this.childNodes[0].setTeXclass(null);
          return this;
        };
        MmlMsqrt2.prototype.setChildInheritedAttributes = function(attributes2, display, level, _prime) {
          this.childNodes[0].setInheritedAttributes(attributes2, display, level, true);
        };
        MmlMsqrt2.defaults = __assign2({}, MmlNode_js_1.AbstractMmlNode.defaults);
        return MmlMsqrt2;
      })(MmlNode_js_1.AbstractMmlNode);
      msqrt.MmlMsqrt = MmlMsqrt;
      return msqrt;
    }
    var hasRequiredMsqrt;
    function requireMsqrt() {
      if (hasRequiredMsqrt) return msqrt$2;
      hasRequiredMsqrt = 1;
      var __extends2 = msqrt$2 && msqrt$2.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      Object.defineProperty(msqrt$2, "__esModule", { value: true });
      msqrt$2.SVGmsqrt = void 0;
      var Wrapper_js_1 = requireWrapper();
      var msqrt_js_1 = requireMsqrt$2();
      var msqrt_js_2 = requireMsqrt$1();
      var SVGmsqrt = (function(_super) {
        __extends2(SVGmsqrt2, _super);
        function SVGmsqrt2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.dx = 0;
          return _this;
        }
        SVGmsqrt2.prototype.toSVG = function(parent) {
          var surd = this.childNodes[this.surd];
          var base2 = this.childNodes[this.base];
          var root2 = this.root ? this.childNodes[this.root] : null;
          var sbox = surd.getBBox();
          var bbox = base2.getOuterBBox();
          var q = this.getPQ(sbox)[1];
          var t2 = this.font.params.rule_thickness * this.bbox.scale;
          var H = bbox.h + q + t2;
          var SVG = this.standardSVGnode(parent);
          var BASE = this.adaptor.append(SVG, this.svg("g"));
          this.addRoot(SVG, root2, sbox, H);
          surd.toSVG(SVG);
          surd.place(this.dx, H - sbox.h);
          base2.toSVG(BASE);
          base2.place(this.dx + sbox.w, 0);
          this.adaptor.append(SVG, this.svg("rect", {
            width: this.fixed(bbox.w),
            height: this.fixed(t2),
            x: this.fixed(this.dx + sbox.w),
            y: this.fixed(H - t2)
          }));
        };
        SVGmsqrt2.prototype.addRoot = function(_ROOT, _root, _sbox, _H) {
        };
        SVGmsqrt2.kind = msqrt_js_2.MmlMsqrt.prototype.kind;
        return SVGmsqrt2;
      })((0, msqrt_js_1.CommonMsqrtMixin)(Wrapper_js_1.SVGWrapper));
      msqrt$2.SVGmsqrt = SVGmsqrt;
      return msqrt$2;
    }
    var mroot$2 = {};
    var mroot$1 = {};
    var hasRequiredMroot$2;
    function requireMroot$2() {
      if (hasRequiredMroot$2) return mroot$1;
      hasRequiredMroot$2 = 1;
      var __extends2 = mroot$1 && mroot$1.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      Object.defineProperty(mroot$1, "__esModule", { value: true });
      mroot$1.CommonMrootMixin = void 0;
      function CommonMrootMixin(Base) {
        return (function(_super) {
          __extends2(class_1, _super);
          function class_1() {
            return _super !== null && _super.apply(this, arguments) || this;
          }
          Object.defineProperty(class_1.prototype, "surd", {
            get: function() {
              return 2;
            },
            enumerable: false,
            configurable: true
          });
          Object.defineProperty(class_1.prototype, "root", {
            get: function() {
              return 1;
            },
            enumerable: false,
            configurable: true
          });
          class_1.prototype.combineRootBBox = function(BBOX, sbox, H) {
            var bbox = this.childNodes[this.root].getOuterBBox();
            var h = this.getRootDimens(sbox, H)[1];
            BBOX.combine(bbox, 0, h);
          };
          class_1.prototype.getRootDimens = function(sbox, H) {
            var surd = this.childNodes[this.surd];
            var bbox = this.childNodes[this.root].getOuterBBox();
            var offset2 = (surd.size < 0 ? 0.5 : 0.6) * sbox.w;
            var w = bbox.w, rscale = bbox.rscale;
            var W = Math.max(w, offset2 / rscale);
            var dx = Math.max(0, W - w);
            var h = this.rootHeight(bbox, sbox, surd.size, H);
            var x2 = W * rscale - offset2;
            return [x2, h, dx];
          };
          class_1.prototype.rootHeight = function(rbox, sbox, size, H) {
            var h = sbox.h + sbox.d;
            var b = (size < 0 ? 1.9 : 0.55 * h) - (h - H);
            return b + Math.max(0, rbox.d * rbox.rscale);
          };
          return class_1;
        })(Base);
      }
      mroot$1.CommonMrootMixin = CommonMrootMixin;
      return mroot$1;
    }
    var mroot = {};
    var hasRequiredMroot$1;
    function requireMroot$1() {
      if (hasRequiredMroot$1) return mroot;
      hasRequiredMroot$1 = 1;
      var __extends2 = mroot && mroot.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      var __assign2 = mroot && mroot.__assign || function() {
        __assign2 = Object.assign || function(t2) {
          for (var s, i2 = 1, n = arguments.length; i2 < n; i2++) {
            s = arguments[i2];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
              t2[p] = s[p];
          }
          return t2;
        };
        return __assign2.apply(this, arguments);
      };
      Object.defineProperty(mroot, "__esModule", { value: true });
      mroot.MmlMroot = void 0;
      var MmlNode_js_1 = requireMmlNode();
      var MmlMroot = (function(_super) {
        __extends2(MmlMroot2, _super);
        function MmlMroot2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.texclass = MmlNode_js_1.TEXCLASS.ORD;
          return _this;
        }
        Object.defineProperty(MmlMroot2.prototype, "kind", {
          get: function() {
            return "mroot";
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(MmlMroot2.prototype, "arity", {
          get: function() {
            return 2;
          },
          enumerable: false,
          configurable: true
        });
        MmlMroot2.prototype.setTeXclass = function(prev) {
          this.getPrevClass(prev);
          this.childNodes[0].setTeXclass(null);
          this.childNodes[1].setTeXclass(null);
          return this;
        };
        MmlMroot2.prototype.setChildInheritedAttributes = function(attributes2, display, level, prime2) {
          this.childNodes[0].setInheritedAttributes(attributes2, display, level, true);
          this.childNodes[1].setInheritedAttributes(attributes2, false, level + 2, prime2);
        };
        MmlMroot2.defaults = __assign2({}, MmlNode_js_1.AbstractMmlNode.defaults);
        return MmlMroot2;
      })(MmlNode_js_1.AbstractMmlNode);
      mroot.MmlMroot = MmlMroot;
      return mroot;
    }
    var hasRequiredMroot;
    function requireMroot() {
      if (hasRequiredMroot) return mroot$2;
      hasRequiredMroot = 1;
      var __extends2 = mroot$2 && mroot$2.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      var __read2 = mroot$2 && mroot$2.__read || function(o, n) {
        var m = typeof Symbol === "function" && o[Symbol.iterator];
        if (!m) return o;
        var i2 = m.call(o), r2, ar2 = [], e;
        try {
          while ((n === void 0 || n-- > 0) && !(r2 = i2.next()).done) ar2.push(r2.value);
        } catch (error2) {
          e = { error: error2 };
        } finally {
          try {
            if (r2 && !r2.done && (m = i2["return"])) m.call(i2);
          } finally {
            if (e) throw e.error;
          }
        }
        return ar2;
      };
      Object.defineProperty(mroot$2, "__esModule", { value: true });
      mroot$2.SVGmroot = void 0;
      var msqrt_js_1 = requireMsqrt();
      var mroot_js_1 = requireMroot$2();
      var mroot_js_2 = requireMroot$1();
      var SVGmroot = (function(_super) {
        __extends2(SVGmroot2, _super);
        function SVGmroot2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        SVGmroot2.prototype.addRoot = function(ROOT, root2, sbox, H) {
          root2.toSVG(ROOT);
          var _a2 = __read2(this.getRootDimens(sbox, H), 3), x2 = _a2[0], h = _a2[1], dx = _a2[2];
          var bbox = root2.getOuterBBox();
          root2.place(dx * bbox.rscale, h);
          this.dx = x2;
        };
        SVGmroot2.kind = mroot_js_2.MmlMroot.prototype.kind;
        return SVGmroot2;
      })((0, mroot_js_1.CommonMrootMixin)(msqrt_js_1.SVGmsqrt));
      mroot$2.SVGmroot = SVGmroot;
      return mroot$2;
    }
    var mfenced$2 = {};
    var mfenced$1 = {};
    var hasRequiredMfenced$2;
    function requireMfenced$2() {
      if (hasRequiredMfenced$2) return mfenced$1;
      hasRequiredMfenced$2 = 1;
      var __extends2 = mfenced$1 && mfenced$1.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      var __read2 = mfenced$1 && mfenced$1.__read || function(o, n) {
        var m = typeof Symbol === "function" && o[Symbol.iterator];
        if (!m) return o;
        var i2 = m.call(o), r2, ar2 = [], e;
        try {
          while ((n === void 0 || n-- > 0) && !(r2 = i2.next()).done) ar2.push(r2.value);
        } catch (error2) {
          e = { error: error2 };
        } finally {
          try {
            if (r2 && !r2.done && (m = i2["return"])) m.call(i2);
          } finally {
            if (e) throw e.error;
          }
        }
        return ar2;
      };
      var __spreadArray2 = mfenced$1 && mfenced$1.__spreadArray || function(to2, from, pack) {
        if (pack || arguments.length === 2) for (var i2 = 0, l = from.length, ar2; i2 < l; i2++) {
          if (ar2 || !(i2 in from)) {
            if (!ar2) ar2 = Array.prototype.slice.call(from, 0, i2);
            ar2[i2] = from[i2];
          }
        }
        return to2.concat(ar2 || Array.prototype.slice.call(from));
      };
      var __values2 = mfenced$1 && mfenced$1.__values || function(o) {
        var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i2 = 0;
        if (m) return m.call(o);
        if (o && typeof o.length === "number") return {
          next: function() {
            if (o && i2 >= o.length) o = void 0;
            return { value: o && o[i2++], done: !o };
          }
        };
        throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
      };
      Object.defineProperty(mfenced$1, "__esModule", { value: true });
      mfenced$1.CommonMfencedMixin = void 0;
      function CommonMfencedMixin(Base) {
        return (function(_super) {
          __extends2(class_1, _super);
          function class_1() {
            var args2 = [];
            for (var _i = 0; _i < arguments.length; _i++) {
              args2[_i] = arguments[_i];
            }
            var _this = _super.apply(this, __spreadArray2([], __read2(args2), false)) || this;
            _this.mrow = null;
            _this.createMrow();
            _this.addMrowChildren();
            return _this;
          }
          class_1.prototype.createMrow = function() {
            var mmlFactory = this.node.factory;
            var mrow2 = mmlFactory.create("inferredMrow");
            mrow2.inheritAttributesFrom(this.node);
            this.mrow = this.wrap(mrow2);
            this.mrow.parent = this;
          };
          class_1.prototype.addMrowChildren = function() {
            var e_1, _a2;
            var mfenced2 = this.node;
            var mrow2 = this.mrow;
            this.addMo(mfenced2.open);
            if (this.childNodes.length) {
              mrow2.childNodes.push(this.childNodes[0]);
            }
            var i2 = 0;
            try {
              for (var _b2 = __values2(this.childNodes.slice(1)), _c = _b2.next(); !_c.done; _c = _b2.next()) {
                var child = _c.value;
                this.addMo(mfenced2.separators[i2++]);
                mrow2.childNodes.push(child);
              }
            } catch (e_1_1) {
              e_1 = { error: e_1_1 };
            } finally {
              try {
                if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
              } finally {
                if (e_1) throw e_1.error;
              }
            }
            this.addMo(mfenced2.close);
            mrow2.stretchChildren();
          };
          class_1.prototype.addMo = function(node2) {
            if (!node2)
              return;
            var mo2 = this.wrap(node2);
            this.mrow.childNodes.push(mo2);
            mo2.parent = this.mrow;
          };
          class_1.prototype.computeBBox = function(bbox, recompute) {
            if (recompute === void 0) {
              recompute = false;
            }
            bbox.updateFrom(this.mrow.getOuterBBox());
            this.setChildPWidths(recompute);
          };
          return class_1;
        })(Base);
      }
      mfenced$1.CommonMfencedMixin = CommonMfencedMixin;
      return mfenced$1;
    }
    var mfenced = {};
    var hasRequiredMfenced$1;
    function requireMfenced$1() {
      if (hasRequiredMfenced$1) return mfenced;
      hasRequiredMfenced$1 = 1;
      var __extends2 = mfenced && mfenced.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      var __assign2 = mfenced && mfenced.__assign || function() {
        __assign2 = Object.assign || function(t2) {
          for (var s, i2 = 1, n = arguments.length; i2 < n; i2++) {
            s = arguments[i2];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
              t2[p] = s[p];
          }
          return t2;
        };
        return __assign2.apply(this, arguments);
      };
      var __values2 = mfenced && mfenced.__values || function(o) {
        var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i2 = 0;
        if (m) return m.call(o);
        if (o && typeof o.length === "number") return {
          next: function() {
            if (o && i2 >= o.length) o = void 0;
            return { value: o && o[i2++], done: !o };
          }
        };
        throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
      };
      Object.defineProperty(mfenced, "__esModule", { value: true });
      mfenced.MmlMfenced = void 0;
      var MmlNode_js_1 = requireMmlNode();
      var MmlMfenced = (function(_super) {
        __extends2(MmlMfenced2, _super);
        function MmlMfenced2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.texclass = MmlNode_js_1.TEXCLASS.INNER;
          _this.separators = [];
          _this.open = null;
          _this.close = null;
          return _this;
        }
        Object.defineProperty(MmlMfenced2.prototype, "kind", {
          get: function() {
            return "mfenced";
          },
          enumerable: false,
          configurable: true
        });
        MmlMfenced2.prototype.setTeXclass = function(prev) {
          this.getPrevClass(prev);
          if (this.open) {
            prev = this.open.setTeXclass(prev);
          }
          if (this.childNodes[0]) {
            prev = this.childNodes[0].setTeXclass(prev);
          }
          for (var i2 = 1, m = this.childNodes.length; i2 < m; i2++) {
            if (this.separators[i2 - 1]) {
              prev = this.separators[i2 - 1].setTeXclass(prev);
            }
            if (this.childNodes[i2]) {
              prev = this.childNodes[i2].setTeXclass(prev);
            }
          }
          if (this.close) {
            prev = this.close.setTeXclass(prev);
          }
          this.updateTeXclass(this.open);
          return prev;
        };
        MmlMfenced2.prototype.setChildInheritedAttributes = function(attributes2, display, level, prime2) {
          var e_1, _a2;
          this.addFakeNodes();
          try {
            for (var _b2 = __values2([this.open, this.close].concat(this.separators)), _c = _b2.next(); !_c.done; _c = _b2.next()) {
              var child = _c.value;
              if (child) {
                child.setInheritedAttributes(attributes2, display, level, prime2);
              }
            }
          } catch (e_1_1) {
            e_1 = { error: e_1_1 };
          } finally {
            try {
              if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
            } finally {
              if (e_1) throw e_1.error;
            }
          }
          _super.prototype.setChildInheritedAttributes.call(this, attributes2, display, level, prime2);
        };
        MmlMfenced2.prototype.addFakeNodes = function() {
          var e_2, _a2;
          var _b2 = this.attributes.getList("open", "close", "separators"), open = _b2.open, close2 = _b2.close, separators = _b2.separators;
          open = open.replace(/[ \t\n\r]/g, "");
          close2 = close2.replace(/[ \t\n\r]/g, "");
          separators = separators.replace(/[ \t\n\r]/g, "");
          if (open) {
            this.open = this.fakeNode(open, { fence: true, form: "prefix" }, MmlNode_js_1.TEXCLASS.OPEN);
          }
          if (separators) {
            while (separators.length < this.childNodes.length - 1) {
              separators += separators.charAt(separators.length - 1);
            }
            var i2 = 0;
            try {
              for (var _c = __values2(this.childNodes.slice(1)), _d = _c.next(); !_d.done; _d = _c.next()) {
                var child = _d.value;
                if (child) {
                  this.separators.push(this.fakeNode(separators.charAt(i2++)));
                }
              }
            } catch (e_2_1) {
              e_2 = { error: e_2_1 };
            } finally {
              try {
                if (_d && !_d.done && (_a2 = _c.return)) _a2.call(_c);
              } finally {
                if (e_2) throw e_2.error;
              }
            }
          }
          if (close2) {
            this.close = this.fakeNode(close2, { fence: true, form: "postfix" }, MmlNode_js_1.TEXCLASS.CLOSE);
          }
        };
        MmlMfenced2.prototype.fakeNode = function(c2, properties, texClass) {
          if (properties === void 0) {
            properties = {};
          }
          if (texClass === void 0) {
            texClass = null;
          }
          var text2 = this.factory.create("text").setText(c2);
          var node2 = this.factory.create("mo", properties, [text2]);
          node2.texClass = texClass;
          node2.parent = this;
          return node2;
        };
        MmlMfenced2.defaults = __assign2(__assign2({}, MmlNode_js_1.AbstractMmlNode.defaults), { open: "(", close: ")", separators: "," });
        return MmlMfenced2;
      })(MmlNode_js_1.AbstractMmlNode);
      mfenced.MmlMfenced = MmlMfenced;
      return mfenced;
    }
    var hasRequiredMfenced;
    function requireMfenced() {
      if (hasRequiredMfenced) return mfenced$2;
      hasRequiredMfenced = 1;
      var __extends2 = mfenced$2 && mfenced$2.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      var __values2 = mfenced$2 && mfenced$2.__values || function(o) {
        var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i2 = 0;
        if (m) return m.call(o);
        if (o && typeof o.length === "number") return {
          next: function() {
            if (o && i2 >= o.length) o = void 0;
            return { value: o && o[i2++], done: !o };
          }
        };
        throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
      };
      Object.defineProperty(mfenced$2, "__esModule", { value: true });
      mfenced$2.SVGmfenced = void 0;
      var Wrapper_js_1 = requireWrapper();
      var mfenced_js_1 = requireMfenced$2();
      var mfenced_js_2 = requireMfenced$1();
      var SVGmfenced = (function(_super) {
        __extends2(SVGmfenced2, _super);
        function SVGmfenced2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        SVGmfenced2.prototype.toSVG = function(parent) {
          var svg2 = this.standardSVGnode(parent);
          this.setChildrenParent(this.mrow);
          this.mrow.toSVG(svg2);
          this.setChildrenParent(this);
        };
        SVGmfenced2.prototype.setChildrenParent = function(parent) {
          var e_1, _a2;
          try {
            for (var _b2 = __values2(this.childNodes), _c = _b2.next(); !_c.done; _c = _b2.next()) {
              var child = _c.value;
              child.parent = parent;
            }
          } catch (e_1_1) {
            e_1 = { error: e_1_1 };
          } finally {
            try {
              if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
            } finally {
              if (e_1) throw e_1.error;
            }
          }
        };
        SVGmfenced2.kind = mfenced_js_2.MmlMfenced.prototype.kind;
        return SVGmfenced2;
      })((0, mfenced_js_1.CommonMfencedMixin)(Wrapper_js_1.SVGWrapper));
      mfenced$2.SVGmfenced = SVGmfenced;
      return mfenced$2;
    }
    var msubsup$2 = {};
    var scriptbase$1 = {};
    var scriptbase = {};
    var hasRequiredScriptbase$1;
    function requireScriptbase$1() {
      if (hasRequiredScriptbase$1) return scriptbase;
      hasRequiredScriptbase$1 = 1;
      var __extends2 = scriptbase && scriptbase.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      var __read2 = scriptbase && scriptbase.__read || function(o, n) {
        var m = typeof Symbol === "function" && o[Symbol.iterator];
        if (!m) return o;
        var i2 = m.call(o), r2, ar2 = [], e;
        try {
          while ((n === void 0 || n-- > 0) && !(r2 = i2.next()).done) ar2.push(r2.value);
        } catch (error2) {
          e = { error: error2 };
        } finally {
          try {
            if (r2 && !r2.done && (m = i2["return"])) m.call(i2);
          } finally {
            if (e) throw e.error;
          }
        }
        return ar2;
      };
      var __spreadArray2 = scriptbase && scriptbase.__spreadArray || function(to2, from, pack) {
        if (pack || arguments.length === 2) for (var i2 = 0, l = from.length, ar2; i2 < l; i2++) {
          if (ar2 || !(i2 in from)) {
            if (!ar2) ar2 = Array.prototype.slice.call(from, 0, i2);
            ar2[i2] = from[i2];
          }
        }
        return to2.concat(ar2 || Array.prototype.slice.call(from));
      };
      var __values2 = scriptbase && scriptbase.__values || function(o) {
        var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i2 = 0;
        if (m) return m.call(o);
        if (o && typeof o.length === "number") return {
          next: function() {
            if (o && i2 >= o.length) o = void 0;
            return { value: o && o[i2++], done: !o };
          }
        };
        throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
      };
      Object.defineProperty(scriptbase, "__esModule", { value: true });
      scriptbase.CommonScriptbaseMixin = void 0;
      var MmlNode_js_1 = requireMmlNode();
      function CommonScriptbaseMixin(Base) {
        var _a2;
        return _a2 = (function(_super) {
          __extends2(class_1, _super);
          function class_1() {
            var args2 = [];
            for (var _i = 0; _i < arguments.length; _i++) {
              args2[_i] = arguments[_i];
            }
            var _this = _super.apply(this, __spreadArray2([], __read2(args2), false)) || this;
            _this.baseScale = 1;
            _this.baseIc = 0;
            _this.baseRemoveIc = false;
            _this.baseIsChar = false;
            _this.baseHasAccentOver = null;
            _this.baseHasAccentUnder = null;
            _this.isLineAbove = false;
            _this.isLineBelow = false;
            _this.isMathAccent = false;
            var core = _this.baseCore = _this.getBaseCore();
            if (!core)
              return _this;
            _this.setBaseAccentsFor(core);
            _this.baseScale = _this.getBaseScale();
            _this.baseIc = _this.getBaseIc();
            _this.baseIsChar = _this.isCharBase();
            _this.isMathAccent = _this.baseIsChar && (_this.scriptChild && !!_this.scriptChild.coreMO().node.getProperty("mathaccent"));
            _this.checkLineAccents();
            _this.baseRemoveIc = !_this.isLineAbove && !_this.isLineBelow && (!_this.constructor.useIC || _this.isMathAccent);
            return _this;
          }
          Object.defineProperty(class_1.prototype, "baseChild", {
            get: function() {
              return this.childNodes[this.node.base];
            },
            enumerable: false,
            configurable: true
          });
          Object.defineProperty(class_1.prototype, "scriptChild", {
            get: function() {
              return this.childNodes[1];
            },
            enumerable: false,
            configurable: true
          });
          class_1.prototype.getBaseCore = function() {
            var core = this.getSemanticBase() || this.childNodes[0];
            while (core && (core.childNodes.length === 1 && (core.node.isKind("mrow") || core.node.isKind("TeXAtom") && core.node.texClass !== MmlNode_js_1.TEXCLASS.VCENTER || core.node.isKind("mstyle") || core.node.isKind("mpadded") || core.node.isKind("mphantom") || core.node.isKind("semantics")) || core.node.isKind("munderover") && core.isMathAccent)) {
              this.setBaseAccentsFor(core);
              core = core.childNodes[0];
            }
            if (!core) {
              this.baseHasAccentOver = this.baseHasAccentUnder = false;
            }
            return core || this.childNodes[0];
          };
          class_1.prototype.setBaseAccentsFor = function(core) {
            if (core.node.isKind("munderover")) {
              if (this.baseHasAccentOver === null) {
                this.baseHasAccentOver = !!core.node.attributes.get("accent");
              }
              if (this.baseHasAccentUnder === null) {
                this.baseHasAccentUnder = !!core.node.attributes.get("accentunder");
              }
            }
          };
          class_1.prototype.getSemanticBase = function() {
            var fence2 = this.node.attributes.getExplicit("data-semantic-fencepointer");
            return this.getBaseFence(this.baseChild, fence2);
          };
          class_1.prototype.getBaseFence = function(fence2, id) {
            var e_1, _a3;
            if (!fence2 || !fence2.node.attributes || !id) {
              return null;
            }
            if (fence2.node.attributes.getExplicit("data-semantic-id") === id) {
              return fence2;
            }
            try {
              for (var _b2 = __values2(fence2.childNodes), _c = _b2.next(); !_c.done; _c = _b2.next()) {
                var child = _c.value;
                var result2 = this.getBaseFence(child, id);
                if (result2) {
                  return result2;
                }
              }
            } catch (e_1_1) {
              e_1 = { error: e_1_1 };
            } finally {
              try {
                if (_c && !_c.done && (_a3 = _b2.return)) _a3.call(_b2);
              } finally {
                if (e_1) throw e_1.error;
              }
            }
            return null;
          };
          class_1.prototype.getBaseScale = function() {
            var child = this.baseCore;
            var scale = 1;
            while (child && child !== this) {
              var bbox = child.getOuterBBox();
              scale *= bbox.rscale;
              child = child.parent;
            }
            return scale;
          };
          class_1.prototype.getBaseIc = function() {
            return this.baseCore.getOuterBBox().ic * this.baseScale;
          };
          class_1.prototype.getAdjustedIc = function() {
            var bbox = this.baseCore.getOuterBBox();
            return (bbox.ic ? 1.05 * bbox.ic + 0.05 : 0) * this.baseScale;
          };
          class_1.prototype.isCharBase = function() {
            var base2 = this.baseCore;
            return (base2.node.isKind("mo") && base2.size === null || base2.node.isKind("mi") || base2.node.isKind("mn")) && base2.bbox.rscale === 1 && Array.from(base2.getText()).length === 1;
          };
          class_1.prototype.checkLineAccents = function() {
            if (!this.node.isKind("munderover"))
              return;
            if (this.node.isKind("mover")) {
              this.isLineAbove = this.isLineAccent(this.scriptChild);
            } else if (this.node.isKind("munder")) {
              this.isLineBelow = this.isLineAccent(this.scriptChild);
            } else {
              var mml = this;
              this.isLineAbove = this.isLineAccent(mml.overChild);
              this.isLineBelow = this.isLineAccent(mml.underChild);
            }
          };
          class_1.prototype.isLineAccent = function(script2) {
            var node2 = script2.coreMO().node;
            return node2.isToken && node2.getText() === "―";
          };
          class_1.prototype.getBaseWidth = function() {
            var bbox = this.baseChild.getOuterBBox();
            return bbox.w * bbox.rscale - (this.baseRemoveIc ? this.baseIc : 0) + this.font.params.extra_ic;
          };
          class_1.prototype.computeBBox = function(bbox, recompute) {
            if (recompute === void 0) {
              recompute = false;
            }
            var w = this.getBaseWidth();
            var _a3 = __read2(this.getOffset(), 2), x2 = _a3[0], y = _a3[1];
            bbox.append(this.baseChild.getOuterBBox());
            bbox.combine(this.scriptChild.getOuterBBox(), w + x2, y);
            bbox.w += this.font.params.scriptspace;
            bbox.clean();
            this.setChildPWidths(recompute);
          };
          class_1.prototype.getOffset = function() {
            return [0, 0];
          };
          class_1.prototype.baseCharZero = function(n) {
            var largeop2 = !!this.baseCore.node.attributes.get("largeop");
            var scale = this.baseScale;
            return this.baseIsChar && !largeop2 && scale === 1 ? 0 : n;
          };
          class_1.prototype.getV = function() {
            var bbox = this.baseCore.getOuterBBox();
            var sbox = this.scriptChild.getOuterBBox();
            var tex2 = this.font.params;
            var subscriptshift = this.length2em(this.node.attributes.get("subscriptshift"), tex2.sub1);
            return Math.max(this.baseCharZero(bbox.d * this.baseScale + tex2.sub_drop * sbox.rscale), subscriptshift, sbox.h * sbox.rscale - 4 / 5 * tex2.x_height);
          };
          class_1.prototype.getU = function() {
            var bbox = this.baseCore.getOuterBBox();
            var sbox = this.scriptChild.getOuterBBox();
            var tex2 = this.font.params;
            var attr = this.node.attributes.getList("displaystyle", "superscriptshift");
            var prime2 = this.node.getProperty("texprimestyle");
            var p = prime2 ? tex2.sup3 : attr.displaystyle ? tex2.sup1 : tex2.sup2;
            var superscriptshift = this.length2em(attr.superscriptshift, p);
            return Math.max(this.baseCharZero(bbox.h * this.baseScale - tex2.sup_drop * sbox.rscale), superscriptshift, sbox.d * sbox.rscale + 1 / 4 * tex2.x_height);
          };
          class_1.prototype.hasMovableLimits = function() {
            var display = this.node.attributes.get("displaystyle");
            var mo2 = this.baseChild.coreMO().node;
            return !display && !!mo2.attributes.get("movablelimits");
          };
          class_1.prototype.getOverKU = function(basebox, overbox) {
            var accent = this.node.attributes.get("accent");
            var tex2 = this.font.params;
            var d = overbox.d * overbox.rscale;
            var t2 = tex2.rule_thickness * tex2.separation_factor;
            var delta2 = this.baseHasAccentOver ? t2 : 0;
            var T = this.isLineAbove ? 3 * tex2.rule_thickness : t2;
            var k2 = (accent ? T : Math.max(tex2.big_op_spacing1, tex2.big_op_spacing3 - Math.max(0, d))) - delta2;
            return [k2, basebox.h * basebox.rscale + k2 + d];
          };
          class_1.prototype.getUnderKV = function(basebox, underbox) {
            var accent = this.node.attributes.get("accentunder");
            var tex2 = this.font.params;
            var h = underbox.h * underbox.rscale;
            var t2 = tex2.rule_thickness * tex2.separation_factor;
            var delta2 = this.baseHasAccentUnder ? t2 : 0;
            var T = this.isLineBelow ? 3 * tex2.rule_thickness : t2;
            var k2 = (accent ? T : Math.max(tex2.big_op_spacing2, tex2.big_op_spacing4 - h)) - delta2;
            return [k2, -(basebox.d * basebox.rscale + k2 + h)];
          };
          class_1.prototype.getDeltaW = function(boxes, delta2) {
            var e_2, _a3, e_3, _b2;
            if (delta2 === void 0) {
              delta2 = [0, 0, 0];
            }
            var align = this.node.attributes.get("align");
            var widths = boxes.map(function(box) {
              return box.w * box.rscale;
            });
            widths[0] -= this.baseRemoveIc && !this.baseCore.node.attributes.get("largeop") ? this.baseIc : 0;
            var w = Math.max.apply(Math, __spreadArray2([], __read2(widths), false));
            var dw = [];
            var m = 0;
            try {
              for (var _c = __values2(widths.keys()), _d = _c.next(); !_d.done; _d = _c.next()) {
                var i2 = _d.value;
                dw[i2] = (align === "center" ? (w - widths[i2]) / 2 : align === "right" ? w - widths[i2] : 0) + delta2[i2];
                if (dw[i2] < m) {
                  m = -dw[i2];
                }
              }
            } catch (e_2_1) {
              e_2 = { error: e_2_1 };
            } finally {
              try {
                if (_d && !_d.done && (_a3 = _c.return)) _a3.call(_c);
              } finally {
                if (e_2) throw e_2.error;
              }
            }
            if (m) {
              try {
                for (var _e2 = __values2(dw.keys()), _f = _e2.next(); !_f.done; _f = _e2.next()) {
                  var i2 = _f.value;
                  dw[i2] += m;
                }
              } catch (e_3_1) {
                e_3 = { error: e_3_1 };
              } finally {
                try {
                  if (_f && !_f.done && (_b2 = _e2.return)) _b2.call(_e2);
                } finally {
                  if (e_3) throw e_3.error;
                }
              }
            }
            [1, 2].map(function(i3) {
              return dw[i3] += boxes[i3] ? boxes[i3].dx * boxes[0].scale : 0;
            });
            return dw;
          };
          class_1.prototype.getDelta = function(noskew) {
            if (noskew === void 0) {
              noskew = false;
            }
            var accent = this.node.attributes.get("accent");
            var _a3 = this.baseCore.getOuterBBox(), sk = _a3.sk, ic2 = _a3.ic;
            return ((accent && !noskew ? sk : 0) + this.font.skewIcFactor * ic2) * this.baseScale;
          };
          class_1.prototype.stretchChildren = function() {
            var e_4, _a3, e_5, _b2, e_6, _c;
            var stretchy = [];
            try {
              for (var _d = __values2(this.childNodes), _e2 = _d.next(); !_e2.done; _e2 = _d.next()) {
                var child = _e2.value;
                if (child.canStretch(2)) {
                  stretchy.push(child);
                }
              }
            } catch (e_4_1) {
              e_4 = { error: e_4_1 };
            } finally {
              try {
                if (_e2 && !_e2.done && (_a3 = _d.return)) _a3.call(_d);
              } finally {
                if (e_4) throw e_4.error;
              }
            }
            var count = stretchy.length;
            var nodeCount = this.childNodes.length;
            if (count && nodeCount > 1) {
              var W = 0;
              var all2 = count > 1 && count === nodeCount;
              try {
                for (var _f = __values2(this.childNodes), _g = _f.next(); !_g.done; _g = _f.next()) {
                  var child = _g.value;
                  var noStretch = child.stretch.dir === 0;
                  if (all2 || noStretch) {
                    var _h = child.getOuterBBox(noStretch), w = _h.w, rscale = _h.rscale;
                    if (w * rscale > W)
                      W = w * rscale;
                  }
                }
              } catch (e_5_1) {
                e_5 = { error: e_5_1 };
              } finally {
                try {
                  if (_g && !_g.done && (_b2 = _f.return)) _b2.call(_f);
                } finally {
                  if (e_5) throw e_5.error;
                }
              }
              try {
                for (var stretchy_1 = __values2(stretchy), stretchy_1_1 = stretchy_1.next(); !stretchy_1_1.done; stretchy_1_1 = stretchy_1.next()) {
                  var child = stretchy_1_1.value;
                  child.coreMO().getStretchedVariant([W / child.bbox.rscale]);
                }
              } catch (e_6_1) {
                e_6 = { error: e_6_1 };
              } finally {
                try {
                  if (stretchy_1_1 && !stretchy_1_1.done && (_c = stretchy_1.return)) _c.call(stretchy_1);
                } finally {
                  if (e_6) throw e_6.error;
                }
              }
            }
          };
          return class_1;
        })(Base), _a2.useIC = true, _a2;
      }
      scriptbase.CommonScriptbaseMixin = CommonScriptbaseMixin;
      return scriptbase;
    }
    var hasRequiredScriptbase;
    function requireScriptbase() {
      if (hasRequiredScriptbase) return scriptbase$1;
      hasRequiredScriptbase = 1;
      var __extends2 = scriptbase$1 && scriptbase$1.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      var __read2 = scriptbase$1 && scriptbase$1.__read || function(o, n) {
        var m = typeof Symbol === "function" && o[Symbol.iterator];
        if (!m) return o;
        var i2 = m.call(o), r2, ar2 = [], e;
        try {
          while ((n === void 0 || n-- > 0) && !(r2 = i2.next()).done) ar2.push(r2.value);
        } catch (error2) {
          e = { error: error2 };
        } finally {
          try {
            if (r2 && !r2.done && (m = i2["return"])) m.call(i2);
          } finally {
            if (e) throw e.error;
          }
        }
        return ar2;
      };
      Object.defineProperty(scriptbase$1, "__esModule", { value: true });
      scriptbase$1.SVGscriptbase = void 0;
      var Wrapper_js_1 = requireWrapper();
      var scriptbase_js_1 = requireScriptbase$1();
      var SVGscriptbase = (function(_super) {
        __extends2(SVGscriptbase2, _super);
        function SVGscriptbase2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        SVGscriptbase2.prototype.toSVG = function(parent) {
          var svg2 = this.standardSVGnode(parent);
          var w = this.getBaseWidth();
          var _a2 = __read2(this.getOffset(), 2), x2 = _a2[0], v = _a2[1];
          this.baseChild.toSVG(svg2);
          this.scriptChild.toSVG(svg2);
          this.scriptChild.place(w + x2, v);
        };
        SVGscriptbase2.kind = "scriptbase";
        return SVGscriptbase2;
      })((0, scriptbase_js_1.CommonScriptbaseMixin)(Wrapper_js_1.SVGWrapper));
      scriptbase$1.SVGscriptbase = SVGscriptbase;
      return scriptbase$1;
    }
    var msubsup$1 = {};
    var hasRequiredMsubsup$2;
    function requireMsubsup$2() {
      if (hasRequiredMsubsup$2) return msubsup$1;
      hasRequiredMsubsup$2 = 1;
      var __extends2 = msubsup$1 && msubsup$1.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      var __read2 = msubsup$1 && msubsup$1.__read || function(o, n) {
        var m = typeof Symbol === "function" && o[Symbol.iterator];
        if (!m) return o;
        var i2 = m.call(o), r2, ar2 = [], e;
        try {
          while ((n === void 0 || n-- > 0) && !(r2 = i2.next()).done) ar2.push(r2.value);
        } catch (error2) {
          e = { error: error2 };
        } finally {
          try {
            if (r2 && !r2.done && (m = i2["return"])) m.call(i2);
          } finally {
            if (e) throw e.error;
          }
        }
        return ar2;
      };
      Object.defineProperty(msubsup$1, "__esModule", { value: true });
      msubsup$1.CommonMsubsupMixin = msubsup$1.CommonMsupMixin = msubsup$1.CommonMsubMixin = void 0;
      function CommonMsubMixin(Base) {
        var _a2;
        return _a2 = (function(_super) {
          __extends2(class_1, _super);
          function class_1() {
            return _super !== null && _super.apply(this, arguments) || this;
          }
          Object.defineProperty(class_1.prototype, "scriptChild", {
            get: function() {
              return this.childNodes[this.node.sub];
            },
            enumerable: false,
            configurable: true
          });
          class_1.prototype.getOffset = function() {
            return [0, -this.getV()];
          };
          return class_1;
        })(Base), _a2.useIC = false, _a2;
      }
      msubsup$1.CommonMsubMixin = CommonMsubMixin;
      function CommonMsupMixin(Base) {
        return (function(_super) {
          __extends2(class_2, _super);
          function class_2() {
            return _super !== null && _super.apply(this, arguments) || this;
          }
          Object.defineProperty(class_2.prototype, "scriptChild", {
            get: function() {
              return this.childNodes[this.node.sup];
            },
            enumerable: false,
            configurable: true
          });
          class_2.prototype.getOffset = function() {
            var x2 = this.getAdjustedIc() - (this.baseRemoveIc ? 0 : this.baseIc);
            return [x2, this.getU()];
          };
          return class_2;
        })(Base);
      }
      msubsup$1.CommonMsupMixin = CommonMsupMixin;
      function CommonMsubsupMixin(Base) {
        var _a2;
        return _a2 = (function(_super) {
          __extends2(class_3, _super);
          function class_3() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this.UVQ = null;
            return _this;
          }
          Object.defineProperty(class_3.prototype, "subChild", {
            get: function() {
              return this.childNodes[this.node.sub];
            },
            enumerable: false,
            configurable: true
          });
          Object.defineProperty(class_3.prototype, "supChild", {
            get: function() {
              return this.childNodes[this.node.sup];
            },
            enumerable: false,
            configurable: true
          });
          class_3.prototype.computeBBox = function(bbox, recompute) {
            if (recompute === void 0) {
              recompute = false;
            }
            var basebox = this.baseChild.getOuterBBox();
            var _a3 = __read2([this.subChild.getOuterBBox(), this.supChild.getOuterBBox()], 2), subbox = _a3[0], supbox = _a3[1];
            bbox.empty();
            bbox.append(basebox);
            var w = this.getBaseWidth();
            var x2 = this.getAdjustedIc();
            var _b2 = __read2(this.getUVQ(), 2), u = _b2[0], v = _b2[1];
            bbox.combine(subbox, w, v);
            bbox.combine(supbox, w + x2, u);
            bbox.w += this.font.params.scriptspace;
            bbox.clean();
            this.setChildPWidths(recompute);
          };
          class_3.prototype.getUVQ = function(subbox, supbox) {
            if (subbox === void 0) {
              subbox = this.subChild.getOuterBBox();
            }
            if (supbox === void 0) {
              supbox = this.supChild.getOuterBBox();
            }
            var basebox = this.baseCore.getOuterBBox();
            if (this.UVQ)
              return this.UVQ;
            var tex2 = this.font.params;
            var t2 = 3 * tex2.rule_thickness;
            var subscriptshift = this.length2em(this.node.attributes.get("subscriptshift"), tex2.sub2);
            var drop = this.baseCharZero(basebox.d * this.baseScale + tex2.sub_drop * subbox.rscale);
            var _a3 = __read2([this.getU(), Math.max(drop, subscriptshift)], 2), u = _a3[0], v = _a3[1];
            var q = u - supbox.d * supbox.rscale - (subbox.h * subbox.rscale - v);
            if (q < t2) {
              v += t2 - q;
              var p = 4 / 5 * tex2.x_height - (u - supbox.d * supbox.rscale);
              if (p > 0) {
                u += p;
                v -= p;
              }
            }
            u = Math.max(this.length2em(this.node.attributes.get("superscriptshift"), u), u);
            v = Math.max(this.length2em(this.node.attributes.get("subscriptshift"), v), v);
            q = u - supbox.d * supbox.rscale - (subbox.h * subbox.rscale - v);
            this.UVQ = [u, -v, q];
            return this.UVQ;
          };
          return class_3;
        })(Base), _a2.useIC = false, _a2;
      }
      msubsup$1.CommonMsubsupMixin = CommonMsubsupMixin;
      return msubsup$1;
    }
    var msubsup = {};
    var hasRequiredMsubsup$1;
    function requireMsubsup$1() {
      if (hasRequiredMsubsup$1) return msubsup;
      hasRequiredMsubsup$1 = 1;
      var __extends2 = msubsup && msubsup.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      var __assign2 = msubsup && msubsup.__assign || function() {
        __assign2 = Object.assign || function(t2) {
          for (var s, i2 = 1, n = arguments.length; i2 < n; i2++) {
            s = arguments[i2];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
              t2[p] = s[p];
          }
          return t2;
        };
        return __assign2.apply(this, arguments);
      };
      Object.defineProperty(msubsup, "__esModule", { value: true });
      msubsup.MmlMsup = msubsup.MmlMsub = msubsup.MmlMsubsup = void 0;
      var MmlNode_js_1 = requireMmlNode();
      var MmlMsubsup = (function(_super) {
        __extends2(MmlMsubsup2, _super);
        function MmlMsubsup2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        Object.defineProperty(MmlMsubsup2.prototype, "kind", {
          get: function() {
            return "msubsup";
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(MmlMsubsup2.prototype, "arity", {
          get: function() {
            return 3;
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(MmlMsubsup2.prototype, "base", {
          get: function() {
            return 0;
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(MmlMsubsup2.prototype, "sub", {
          get: function() {
            return 1;
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(MmlMsubsup2.prototype, "sup", {
          get: function() {
            return 2;
          },
          enumerable: false,
          configurable: true
        });
        MmlMsubsup2.prototype.setChildInheritedAttributes = function(attributes2, display, level, prime2) {
          var nodes = this.childNodes;
          nodes[0].setInheritedAttributes(attributes2, display, level, prime2);
          nodes[1].setInheritedAttributes(attributes2, false, level + 1, prime2 || this.sub === 1);
          if (!nodes[2]) {
            return;
          }
          nodes[2].setInheritedAttributes(attributes2, false, level + 1, prime2 || this.sub === 2);
        };
        MmlMsubsup2.defaults = __assign2(__assign2({}, MmlNode_js_1.AbstractMmlBaseNode.defaults), { subscriptshift: "", superscriptshift: "" });
        return MmlMsubsup2;
      })(MmlNode_js_1.AbstractMmlBaseNode);
      msubsup.MmlMsubsup = MmlMsubsup;
      var MmlMsub = (function(_super) {
        __extends2(MmlMsub2, _super);
        function MmlMsub2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        Object.defineProperty(MmlMsub2.prototype, "kind", {
          get: function() {
            return "msub";
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(MmlMsub2.prototype, "arity", {
          get: function() {
            return 2;
          },
          enumerable: false,
          configurable: true
        });
        MmlMsub2.defaults = __assign2({}, MmlMsubsup.defaults);
        return MmlMsub2;
      })(MmlMsubsup);
      msubsup.MmlMsub = MmlMsub;
      var MmlMsup = (function(_super) {
        __extends2(MmlMsup2, _super);
        function MmlMsup2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        Object.defineProperty(MmlMsup2.prototype, "kind", {
          get: function() {
            return "msup";
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(MmlMsup2.prototype, "arity", {
          get: function() {
            return 2;
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(MmlMsup2.prototype, "sup", {
          get: function() {
            return 1;
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(MmlMsup2.prototype, "sub", {
          get: function() {
            return 2;
          },
          enumerable: false,
          configurable: true
        });
        MmlMsup2.defaults = __assign2({}, MmlMsubsup.defaults);
        return MmlMsup2;
      })(MmlMsubsup);
      msubsup.MmlMsup = MmlMsup;
      return msubsup;
    }
    var hasRequiredMsubsup;
    function requireMsubsup() {
      if (hasRequiredMsubsup) return msubsup$2;
      hasRequiredMsubsup = 1;
      var __extends2 = msubsup$2 && msubsup$2.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      var __read2 = msubsup$2 && msubsup$2.__read || function(o, n) {
        var m = typeof Symbol === "function" && o[Symbol.iterator];
        if (!m) return o;
        var i2 = m.call(o), r2, ar2 = [], e;
        try {
          while ((n === void 0 || n-- > 0) && !(r2 = i2.next()).done) ar2.push(r2.value);
        } catch (error2) {
          e = { error: error2 };
        } finally {
          try {
            if (r2 && !r2.done && (m = i2["return"])) m.call(i2);
          } finally {
            if (e) throw e.error;
          }
        }
        return ar2;
      };
      Object.defineProperty(msubsup$2, "__esModule", { value: true });
      msubsup$2.SVGmsubsup = msubsup$2.SVGmsup = msubsup$2.SVGmsub = void 0;
      var scriptbase_js_1 = requireScriptbase();
      var msubsup_js_1 = requireMsubsup$2();
      var msubsup_js_2 = requireMsubsup$2();
      var msubsup_js_3 = requireMsubsup$2();
      var msubsup_js_4 = requireMsubsup$1();
      var SVGmsub = (function(_super) {
        __extends2(SVGmsub2, _super);
        function SVGmsub2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        SVGmsub2.kind = msubsup_js_4.MmlMsub.prototype.kind;
        return SVGmsub2;
      })((0, msubsup_js_1.CommonMsubMixin)(scriptbase_js_1.SVGscriptbase));
      msubsup$2.SVGmsub = SVGmsub;
      var SVGmsup = (function(_super) {
        __extends2(SVGmsup2, _super);
        function SVGmsup2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        SVGmsup2.kind = msubsup_js_4.MmlMsup.prototype.kind;
        return SVGmsup2;
      })((0, msubsup_js_2.CommonMsupMixin)(scriptbase_js_1.SVGscriptbase));
      msubsup$2.SVGmsup = SVGmsup;
      var SVGmsubsup = (function(_super) {
        __extends2(SVGmsubsup2, _super);
        function SVGmsubsup2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        SVGmsubsup2.prototype.toSVG = function(parent) {
          var svg2 = this.standardSVGnode(parent);
          var _a2 = __read2([this.baseChild, this.supChild, this.subChild], 3), base2 = _a2[0], sup4 = _a2[1], sub2 = _a2[2];
          var w = this.getBaseWidth();
          var x2 = this.getAdjustedIc();
          var _b2 = __read2(this.getUVQ(), 2), u = _b2[0], v = _b2[1];
          base2.toSVG(svg2);
          sup4.toSVG(svg2);
          sub2.toSVG(svg2);
          sub2.place(w, v);
          sup4.place(w + x2, u);
        };
        SVGmsubsup2.kind = msubsup_js_4.MmlMsubsup.prototype.kind;
        return SVGmsubsup2;
      })((0, msubsup_js_3.CommonMsubsupMixin)(scriptbase_js_1.SVGscriptbase));
      msubsup$2.SVGmsubsup = SVGmsubsup;
      return msubsup$2;
    }
    var munderover$2 = {};
    var munderover$1 = {};
    var hasRequiredMunderover$2;
    function requireMunderover$2() {
      if (hasRequiredMunderover$2) return munderover$1;
      hasRequiredMunderover$2 = 1;
      var __extends2 = munderover$1 && munderover$1.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      var __read2 = munderover$1 && munderover$1.__read || function(o, n) {
        var m = typeof Symbol === "function" && o[Symbol.iterator];
        if (!m) return o;
        var i2 = m.call(o), r2, ar2 = [], e;
        try {
          while ((n === void 0 || n-- > 0) && !(r2 = i2.next()).done) ar2.push(r2.value);
        } catch (error2) {
          e = { error: error2 };
        } finally {
          try {
            if (r2 && !r2.done && (m = i2["return"])) m.call(i2);
          } finally {
            if (e) throw e.error;
          }
        }
        return ar2;
      };
      var __spreadArray2 = munderover$1 && munderover$1.__spreadArray || function(to2, from, pack) {
        if (pack || arguments.length === 2) for (var i2 = 0, l = from.length, ar2; i2 < l; i2++) {
          if (ar2 || !(i2 in from)) {
            if (!ar2) ar2 = Array.prototype.slice.call(from, 0, i2);
            ar2[i2] = from[i2];
          }
        }
        return to2.concat(ar2 || Array.prototype.slice.call(from));
      };
      Object.defineProperty(munderover$1, "__esModule", { value: true });
      munderover$1.CommonMunderoverMixin = munderover$1.CommonMoverMixin = munderover$1.CommonMunderMixin = void 0;
      function CommonMunderMixin(Base) {
        return (function(_super) {
          __extends2(class_1, _super);
          function class_1() {
            var args2 = [];
            for (var _i = 0; _i < arguments.length; _i++) {
              args2[_i] = arguments[_i];
            }
            var _this = _super.apply(this, __spreadArray2([], __read2(args2), false)) || this;
            _this.stretchChildren();
            return _this;
          }
          Object.defineProperty(class_1.prototype, "scriptChild", {
            get: function() {
              return this.childNodes[this.node.under];
            },
            enumerable: false,
            configurable: true
          });
          class_1.prototype.computeBBox = function(bbox, recompute) {
            if (recompute === void 0) {
              recompute = false;
            }
            if (this.hasMovableLimits()) {
              _super.prototype.computeBBox.call(this, bbox, recompute);
              return;
            }
            bbox.empty();
            var basebox = this.baseChild.getOuterBBox();
            var underbox = this.scriptChild.getOuterBBox();
            var v = this.getUnderKV(basebox, underbox)[1];
            var delta2 = this.isLineBelow ? 0 : this.getDelta(true);
            var _a2 = __read2(this.getDeltaW([basebox, underbox], [0, -delta2]), 2), bw = _a2[0], uw = _a2[1];
            bbox.combine(basebox, bw, 0);
            bbox.combine(underbox, uw, v);
            bbox.d += this.font.params.big_op_spacing5;
            bbox.clean();
            this.setChildPWidths(recompute);
          };
          return class_1;
        })(Base);
      }
      munderover$1.CommonMunderMixin = CommonMunderMixin;
      function CommonMoverMixin(Base) {
        return (function(_super) {
          __extends2(class_2, _super);
          function class_2() {
            var args2 = [];
            for (var _i = 0; _i < arguments.length; _i++) {
              args2[_i] = arguments[_i];
            }
            var _this = _super.apply(this, __spreadArray2([], __read2(args2), false)) || this;
            _this.stretchChildren();
            return _this;
          }
          Object.defineProperty(class_2.prototype, "scriptChild", {
            get: function() {
              return this.childNodes[this.node.over];
            },
            enumerable: false,
            configurable: true
          });
          class_2.prototype.computeBBox = function(bbox) {
            if (this.hasMovableLimits()) {
              _super.prototype.computeBBox.call(this, bbox);
              return;
            }
            bbox.empty();
            var basebox = this.baseChild.getOuterBBox();
            var overbox = this.scriptChild.getOuterBBox();
            if (this.node.attributes.get("accent")) {
              basebox.h = Math.max(basebox.h, this.font.params.x_height * basebox.scale);
            }
            var u = this.getOverKU(basebox, overbox)[1];
            var delta2 = this.isLineAbove ? 0 : this.getDelta();
            var _a2 = __read2(this.getDeltaW([basebox, overbox], [0, delta2]), 2), bw = _a2[0], ow = _a2[1];
            bbox.combine(basebox, bw, 0);
            bbox.combine(overbox, ow, u);
            bbox.h += this.font.params.big_op_spacing5;
            bbox.clean();
          };
          return class_2;
        })(Base);
      }
      munderover$1.CommonMoverMixin = CommonMoverMixin;
      function CommonMunderoverMixin(Base) {
        return (function(_super) {
          __extends2(class_3, _super);
          function class_3() {
            var args2 = [];
            for (var _i = 0; _i < arguments.length; _i++) {
              args2[_i] = arguments[_i];
            }
            var _this = _super.apply(this, __spreadArray2([], __read2(args2), false)) || this;
            _this.stretchChildren();
            return _this;
          }
          Object.defineProperty(class_3.prototype, "underChild", {
            get: function() {
              return this.childNodes[this.node.under];
            },
            enumerable: false,
            configurable: true
          });
          Object.defineProperty(class_3.prototype, "overChild", {
            get: function() {
              return this.childNodes[this.node.over];
            },
            enumerable: false,
            configurable: true
          });
          Object.defineProperty(class_3.prototype, "subChild", {
            get: function() {
              return this.underChild;
            },
            enumerable: false,
            configurable: true
          });
          Object.defineProperty(class_3.prototype, "supChild", {
            get: function() {
              return this.overChild;
            },
            enumerable: false,
            configurable: true
          });
          class_3.prototype.computeBBox = function(bbox) {
            if (this.hasMovableLimits()) {
              _super.prototype.computeBBox.call(this, bbox);
              return;
            }
            bbox.empty();
            var overbox = this.overChild.getOuterBBox();
            var basebox = this.baseChild.getOuterBBox();
            var underbox = this.underChild.getOuterBBox();
            if (this.node.attributes.get("accent")) {
              basebox.h = Math.max(basebox.h, this.font.params.x_height * basebox.scale);
            }
            var u = this.getOverKU(basebox, overbox)[1];
            var v = this.getUnderKV(basebox, underbox)[1];
            var delta2 = this.getDelta();
            var _a2 = __read2(this.getDeltaW([basebox, underbox, overbox], [0, this.isLineBelow ? 0 : -delta2, this.isLineAbove ? 0 : delta2]), 3), bw = _a2[0], uw = _a2[1], ow = _a2[2];
            bbox.combine(basebox, bw, 0);
            bbox.combine(overbox, ow, u);
            bbox.combine(underbox, uw, v);
            var z = this.font.params.big_op_spacing5;
            bbox.h += z;
            bbox.d += z;
            bbox.clean();
          };
          return class_3;
        })(Base);
      }
      munderover$1.CommonMunderoverMixin = CommonMunderoverMixin;
      return munderover$1;
    }
    var munderover = {};
    var hasRequiredMunderover$1;
    function requireMunderover$1() {
      if (hasRequiredMunderover$1) return munderover;
      hasRequiredMunderover$1 = 1;
      var __extends2 = munderover && munderover.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      var __assign2 = munderover && munderover.__assign || function() {
        __assign2 = Object.assign || function(t2) {
          for (var s, i2 = 1, n = arguments.length; i2 < n; i2++) {
            s = arguments[i2];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
              t2[p] = s[p];
          }
          return t2;
        };
        return __assign2.apply(this, arguments);
      };
      Object.defineProperty(munderover, "__esModule", { value: true });
      munderover.MmlMover = munderover.MmlMunder = munderover.MmlMunderover = void 0;
      var MmlNode_js_1 = requireMmlNode();
      var MmlMunderover = (function(_super) {
        __extends2(MmlMunderover2, _super);
        function MmlMunderover2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        Object.defineProperty(MmlMunderover2.prototype, "kind", {
          get: function() {
            return "munderover";
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(MmlMunderover2.prototype, "arity", {
          get: function() {
            return 3;
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(MmlMunderover2.prototype, "base", {
          get: function() {
            return 0;
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(MmlMunderover2.prototype, "under", {
          get: function() {
            return 1;
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(MmlMunderover2.prototype, "over", {
          get: function() {
            return 2;
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(MmlMunderover2.prototype, "linebreakContainer", {
          get: function() {
            return true;
          },
          enumerable: false,
          configurable: true
        });
        MmlMunderover2.prototype.setChildInheritedAttributes = function(attributes2, display, level, prime2) {
          var nodes = this.childNodes;
          nodes[0].setInheritedAttributes(attributes2, display, level, prime2 || !!nodes[this.over]);
          var force = !!(!display && nodes[0].coreMO().attributes.get("movablelimits"));
          var ACCENTS = this.constructor.ACCENTS;
          nodes[1].setInheritedAttributes(attributes2, false, this.getScriptlevel(ACCENTS[1], force, level), prime2 || this.under === 1);
          this.setInheritedAccent(1, ACCENTS[1], display, level, prime2, force);
          if (!nodes[2]) {
            return;
          }
          nodes[2].setInheritedAttributes(attributes2, false, this.getScriptlevel(ACCENTS[2], force, level), prime2 || this.under === 2);
          this.setInheritedAccent(2, ACCENTS[2], display, level, prime2, force);
        };
        MmlMunderover2.prototype.getScriptlevel = function(accent, force, level) {
          if (force || !this.attributes.get(accent)) {
            level++;
          }
          return level;
        };
        MmlMunderover2.prototype.setInheritedAccent = function(n, accent, display, level, prime2, force) {
          var node2 = this.childNodes[n];
          if (this.attributes.getExplicit(accent) == null && node2.isEmbellished) {
            var value2 = node2.coreMO().attributes.get("accent");
            this.attributes.setInherited(accent, value2);
            if (value2 !== this.attributes.getDefault(accent)) {
              node2.setInheritedAttributes({}, display, this.getScriptlevel(accent, force, level), prime2);
            }
          }
        };
        MmlMunderover2.defaults = __assign2(__assign2({}, MmlNode_js_1.AbstractMmlBaseNode.defaults), { accent: false, accentunder: false, align: "center" });
        MmlMunderover2.ACCENTS = ["", "accentunder", "accent"];
        return MmlMunderover2;
      })(MmlNode_js_1.AbstractMmlBaseNode);
      munderover.MmlMunderover = MmlMunderover;
      var MmlMunder = (function(_super) {
        __extends2(MmlMunder2, _super);
        function MmlMunder2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        Object.defineProperty(MmlMunder2.prototype, "kind", {
          get: function() {
            return "munder";
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(MmlMunder2.prototype, "arity", {
          get: function() {
            return 2;
          },
          enumerable: false,
          configurable: true
        });
        MmlMunder2.defaults = __assign2({}, MmlMunderover.defaults);
        return MmlMunder2;
      })(MmlMunderover);
      munderover.MmlMunder = MmlMunder;
      var MmlMover = (function(_super) {
        __extends2(MmlMover2, _super);
        function MmlMover2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        Object.defineProperty(MmlMover2.prototype, "kind", {
          get: function() {
            return "mover";
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(MmlMover2.prototype, "arity", {
          get: function() {
            return 2;
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(MmlMover2.prototype, "over", {
          get: function() {
            return 1;
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(MmlMover2.prototype, "under", {
          get: function() {
            return 2;
          },
          enumerable: false,
          configurable: true
        });
        MmlMover2.defaults = __assign2({}, MmlMunderover.defaults);
        MmlMover2.ACCENTS = ["", "accent", "accentunder"];
        return MmlMover2;
      })(MmlMunderover);
      munderover.MmlMover = MmlMover;
      return munderover;
    }
    var hasRequiredMunderover;
    function requireMunderover() {
      if (hasRequiredMunderover) return munderover$2;
      hasRequiredMunderover = 1;
      var __extends2 = munderover$2 && munderover$2.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      var __read2 = munderover$2 && munderover$2.__read || function(o, n) {
        var m = typeof Symbol === "function" && o[Symbol.iterator];
        if (!m) return o;
        var i2 = m.call(o), r2, ar2 = [], e;
        try {
          while ((n === void 0 || n-- > 0) && !(r2 = i2.next()).done) ar2.push(r2.value);
        } catch (error2) {
          e = { error: error2 };
        } finally {
          try {
            if (r2 && !r2.done && (m = i2["return"])) m.call(i2);
          } finally {
            if (e) throw e.error;
          }
        }
        return ar2;
      };
      Object.defineProperty(munderover$2, "__esModule", { value: true });
      munderover$2.SVGmunderover = munderover$2.SVGmover = munderover$2.SVGmunder = void 0;
      var msubsup_js_1 = requireMsubsup();
      var munderover_js_1 = requireMunderover$2();
      var munderover_js_2 = requireMunderover$2();
      var munderover_js_3 = requireMunderover$2();
      var munderover_js_4 = requireMunderover$1();
      var SVGmunder = (function(_super) {
        __extends2(SVGmunder2, _super);
        function SVGmunder2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        SVGmunder2.prototype.toSVG = function(parent) {
          if (this.hasMovableLimits()) {
            _super.prototype.toSVG.call(this, parent);
            return;
          }
          var svg2 = this.standardSVGnode(parent);
          var _a2 = __read2([this.baseChild, this.scriptChild], 2), base2 = _a2[0], script2 = _a2[1];
          var _b2 = __read2([base2.getOuterBBox(), script2.getOuterBBox()], 2), bbox = _b2[0], sbox = _b2[1];
          base2.toSVG(svg2);
          script2.toSVG(svg2);
          var delta2 = this.isLineBelow ? 0 : this.getDelta(true);
          var v = this.getUnderKV(bbox, sbox)[1];
          var _c = __read2(this.getDeltaW([bbox, sbox], [0, -delta2]), 2), bx = _c[0], sx = _c[1];
          base2.place(bx, 0);
          script2.place(sx, v);
        };
        SVGmunder2.kind = munderover_js_4.MmlMunder.prototype.kind;
        return SVGmunder2;
      })((0, munderover_js_1.CommonMunderMixin)(msubsup_js_1.SVGmsub));
      munderover$2.SVGmunder = SVGmunder;
      var SVGmover = (function(_super) {
        __extends2(SVGmover2, _super);
        function SVGmover2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        SVGmover2.prototype.toSVG = function(parent) {
          if (this.hasMovableLimits()) {
            _super.prototype.toSVG.call(this, parent);
            return;
          }
          var svg2 = this.standardSVGnode(parent);
          var _a2 = __read2([this.baseChild, this.scriptChild], 2), base2 = _a2[0], script2 = _a2[1];
          var _b2 = __read2([base2.getOuterBBox(), script2.getOuterBBox()], 2), bbox = _b2[0], sbox = _b2[1];
          base2.toSVG(svg2);
          script2.toSVG(svg2);
          var delta2 = this.isLineAbove ? 0 : this.getDelta();
          var u = this.getOverKU(bbox, sbox)[1];
          var _c = __read2(this.getDeltaW([bbox, sbox], [0, delta2]), 2), bx = _c[0], sx = _c[1];
          base2.place(bx, 0);
          script2.place(sx, u);
        };
        SVGmover2.kind = munderover_js_4.MmlMover.prototype.kind;
        return SVGmover2;
      })((0, munderover_js_2.CommonMoverMixin)(msubsup_js_1.SVGmsup));
      munderover$2.SVGmover = SVGmover;
      var SVGmunderover = (function(_super) {
        __extends2(SVGmunderover2, _super);
        function SVGmunderover2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        SVGmunderover2.prototype.toSVG = function(parent) {
          if (this.hasMovableLimits()) {
            _super.prototype.toSVG.call(this, parent);
            return;
          }
          var svg2 = this.standardSVGnode(parent);
          var _a2 = __read2([this.baseChild, this.overChild, this.underChild], 3), base2 = _a2[0], over = _a2[1], under = _a2[2];
          var _b2 = __read2([base2.getOuterBBox(), over.getOuterBBox(), under.getOuterBBox()], 3), bbox = _b2[0], obox = _b2[1], ubox = _b2[2];
          base2.toSVG(svg2);
          under.toSVG(svg2);
          over.toSVG(svg2);
          var delta2 = this.getDelta();
          var u = this.getOverKU(bbox, obox)[1];
          var v = this.getUnderKV(bbox, ubox)[1];
          var _c = __read2(this.getDeltaW([bbox, ubox, obox], [0, this.isLineBelow ? 0 : -delta2, this.isLineAbove ? 0 : delta2]), 3), bx = _c[0], ux = _c[1], ox = _c[2];
          base2.place(bx, 0);
          under.place(ux, v);
          over.place(ox, u);
        };
        SVGmunderover2.kind = munderover_js_4.MmlMunderover.prototype.kind;
        return SVGmunderover2;
      })((0, munderover_js_3.CommonMunderoverMixin)(msubsup_js_1.SVGmsubsup));
      munderover$2.SVGmunderover = SVGmunderover;
      return munderover$2;
    }
    var mmultiscripts$2 = {};
    var mmultiscripts$1 = {};
    var hasRequiredMmultiscripts$2;
    function requireMmultiscripts$2() {
      if (hasRequiredMmultiscripts$2) return mmultiscripts$1;
      hasRequiredMmultiscripts$2 = 1;
      (function(exports2) {
        var __extends2 = mmultiscripts$1 && mmultiscripts$1.__extends || /* @__PURE__ */ (function() {
          var extendStatics2 = function(d, b) {
            extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
              d2.__proto__ = b2;
            } || function(d2, b2) {
              for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
            };
            return extendStatics2(d, b);
          };
          return function(d, b) {
            if (typeof b !== "function" && b !== null)
              throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
            extendStatics2(d, b);
            function __() {
              this.constructor = d;
            }
            d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
          };
        })();
        var __read2 = mmultiscripts$1 && mmultiscripts$1.__read || function(o, n) {
          var m = typeof Symbol === "function" && o[Symbol.iterator];
          if (!m) return o;
          var i2 = m.call(o), r2, ar2 = [], e;
          try {
            while ((n === void 0 || n-- > 0) && !(r2 = i2.next()).done) ar2.push(r2.value);
          } catch (error2) {
            e = { error: error2 };
          } finally {
            try {
              if (r2 && !r2.done && (m = i2["return"])) m.call(i2);
            } finally {
              if (e) throw e.error;
            }
          }
          return ar2;
        };
        var __spreadArray2 = mmultiscripts$1 && mmultiscripts$1.__spreadArray || function(to2, from, pack) {
          if (pack || arguments.length === 2) for (var i2 = 0, l = from.length, ar2; i2 < l; i2++) {
            if (ar2 || !(i2 in from)) {
              if (!ar2) ar2 = Array.prototype.slice.call(from, 0, i2);
              ar2[i2] = from[i2];
            }
          }
          return to2.concat(ar2 || Array.prototype.slice.call(from));
        };
        var __values2 = mmultiscripts$1 && mmultiscripts$1.__values || function(o) {
          var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i2 = 0;
          if (m) return m.call(o);
          if (o && typeof o.length === "number") return {
            next: function() {
              if (o && i2 >= o.length) o = void 0;
              return { value: o && o[i2++], done: !o };
            }
          };
          throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
        };
        Object.defineProperty(exports2, "__esModule", { value: true });
        exports2.CommonMmultiscriptsMixin = exports2.ScriptNames = exports2.NextScript = void 0;
        var BBox_js_1 = requireBBox();
        exports2.NextScript = {
          base: "subList",
          subList: "supList",
          supList: "subList",
          psubList: "psupList",
          psupList: "psubList"
        };
        exports2.ScriptNames = ["sup", "sup", "psup", "psub"];
        function CommonMmultiscriptsMixin(Base) {
          return (function(_super) {
            __extends2(class_1, _super);
            function class_1() {
              var args2 = [];
              for (var _i = 0; _i < arguments.length; _i++) {
                args2[_i] = arguments[_i];
              }
              var _this = _super.apply(this, __spreadArray2([], __read2(args2), false)) || this;
              _this.scriptData = null;
              _this.firstPrescript = 0;
              _this.getScriptData();
              return _this;
            }
            class_1.prototype.combinePrePost = function(pre2, post) {
              var bbox = new BBox_js_1.BBox(pre2);
              bbox.combine(post, 0, 0);
              return bbox;
            };
            class_1.prototype.computeBBox = function(bbox, recompute) {
              if (recompute === void 0) {
                recompute = false;
              }
              var scriptspace = this.font.params.scriptspace;
              var data = this.scriptData;
              var sub2 = this.combinePrePost(data.sub, data.psub);
              var sup4 = this.combinePrePost(data.sup, data.psup);
              var _a2 = __read2(this.getUVQ(sub2, sup4), 2), u = _a2[0], v = _a2[1];
              bbox.empty();
              if (data.numPrescripts) {
                bbox.combine(data.psup, scriptspace, u);
                bbox.combine(data.psub, scriptspace, v);
              }
              bbox.append(data.base);
              if (data.numScripts) {
                var w = bbox.w;
                bbox.combine(data.sup, w, u);
                bbox.combine(data.sub, w, v);
                bbox.w += scriptspace;
              }
              bbox.clean();
              this.setChildPWidths(recompute);
            };
            class_1.prototype.getScriptData = function() {
              var data = this.scriptData = {
                base: null,
                sub: BBox_js_1.BBox.empty(),
                sup: BBox_js_1.BBox.empty(),
                psub: BBox_js_1.BBox.empty(),
                psup: BBox_js_1.BBox.empty(),
                numPrescripts: 0,
                numScripts: 0
              };
              var lists = this.getScriptBBoxLists();
              this.combineBBoxLists(data.sub, data.sup, lists.subList, lists.supList);
              this.combineBBoxLists(data.psub, data.psup, lists.psubList, lists.psupList);
              data.base = lists.base[0];
              data.numPrescripts = lists.psubList.length;
              data.numScripts = lists.subList.length;
            };
            class_1.prototype.getScriptBBoxLists = function() {
              var e_1, _a2;
              var lists = {
                base: [],
                subList: [],
                supList: [],
                psubList: [],
                psupList: []
              };
              var script2 = "base";
              try {
                for (var _b2 = __values2(this.childNodes), _c = _b2.next(); !_c.done; _c = _b2.next()) {
                  var child = _c.value;
                  if (child.node.isKind("mprescripts")) {
                    script2 = "psubList";
                  } else {
                    lists[script2].push(child.getOuterBBox());
                    script2 = exports2.NextScript[script2];
                  }
                }
              } catch (e_1_1) {
                e_1 = { error: e_1_1 };
              } finally {
                try {
                  if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
                } finally {
                  if (e_1) throw e_1.error;
                }
              }
              this.firstPrescript = lists.subList.length + lists.supList.length + 2;
              this.padLists(lists.subList, lists.supList);
              this.padLists(lists.psubList, lists.psupList);
              return lists;
            };
            class_1.prototype.padLists = function(list1, list2) {
              if (list1.length > list2.length) {
                list2.push(BBox_js_1.BBox.empty());
              }
            };
            class_1.prototype.combineBBoxLists = function(bbox1, bbox2, list1, list2) {
              for (var i2 = 0; i2 < list1.length; i2++) {
                var _a2 = __read2(this.getScaledWHD(list1[i2]), 3), w1 = _a2[0], h1 = _a2[1], d1 = _a2[2];
                var _b2 = __read2(this.getScaledWHD(list2[i2]), 3), w2 = _b2[0], h2 = _b2[1], d2 = _b2[2];
                var w = Math.max(w1, w2);
                bbox1.w += w;
                bbox2.w += w;
                if (h1 > bbox1.h)
                  bbox1.h = h1;
                if (d1 > bbox1.d)
                  bbox1.d = d1;
                if (h2 > bbox2.h)
                  bbox2.h = h2;
                if (d2 > bbox2.d)
                  bbox2.d = d2;
              }
            };
            class_1.prototype.getScaledWHD = function(bbox) {
              var w = bbox.w, h = bbox.h, d = bbox.d, rscale = bbox.rscale;
              return [w * rscale, h * rscale, d * rscale];
            };
            class_1.prototype.getUVQ = function(subbox, supbox) {
              var _a2;
              if (!this.UVQ) {
                var _b2 = __read2([0, 0, 0], 3), u = _b2[0], v = _b2[1], q = _b2[2];
                if (subbox.h === 0 && subbox.d === 0) {
                  u = this.getU();
                } else if (supbox.h === 0 && supbox.d === 0) {
                  u = -this.getV();
                } else {
                  _a2 = __read2(_super.prototype.getUVQ.call(this, subbox, supbox), 3), u = _a2[0], v = _a2[1], q = _a2[2];
                }
                this.UVQ = [u, v, q];
              }
              return this.UVQ;
            };
            return class_1;
          })(Base);
        }
        exports2.CommonMmultiscriptsMixin = CommonMmultiscriptsMixin;
      })(mmultiscripts$1);
      return mmultiscripts$1;
    }
    var mmultiscripts = {};
    var hasRequiredMmultiscripts$1;
    function requireMmultiscripts$1() {
      if (hasRequiredMmultiscripts$1) return mmultiscripts;
      hasRequiredMmultiscripts$1 = 1;
      var __extends2 = mmultiscripts && mmultiscripts.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      var __assign2 = mmultiscripts && mmultiscripts.__assign || function() {
        __assign2 = Object.assign || function(t2) {
          for (var s, i2 = 1, n = arguments.length; i2 < n; i2++) {
            s = arguments[i2];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
              t2[p] = s[p];
          }
          return t2;
        };
        return __assign2.apply(this, arguments);
      };
      Object.defineProperty(mmultiscripts, "__esModule", { value: true });
      mmultiscripts.MmlNone = mmultiscripts.MmlMprescripts = mmultiscripts.MmlMmultiscripts = void 0;
      var MmlNode_js_1 = requireMmlNode();
      var msubsup_js_1 = requireMsubsup$1();
      var MmlMmultiscripts = (function(_super) {
        __extends2(MmlMmultiscripts2, _super);
        function MmlMmultiscripts2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        Object.defineProperty(MmlMmultiscripts2.prototype, "kind", {
          get: function() {
            return "mmultiscripts";
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(MmlMmultiscripts2.prototype, "arity", {
          get: function() {
            return 1;
          },
          enumerable: false,
          configurable: true
        });
        MmlMmultiscripts2.prototype.setChildInheritedAttributes = function(attributes2, display, level, prime2) {
          this.childNodes[0].setInheritedAttributes(attributes2, display, level, prime2);
          var prescripts = false;
          for (var i2 = 1, n = 0; i2 < this.childNodes.length; i2++) {
            var child = this.childNodes[i2];
            if (child.isKind("mprescripts")) {
              if (!prescripts) {
                prescripts = true;
                if (i2 % 2 === 0) {
                  var mrow2 = this.factory.create("mrow");
                  this.childNodes.splice(i2, 0, mrow2);
                  mrow2.parent = this;
                  i2++;
                }
              }
            } else {
              var primestyle = prime2 || n % 2 === 0;
              child.setInheritedAttributes(attributes2, false, level + 1, primestyle);
              n++;
            }
          }
          if (this.childNodes.length % 2 === (prescripts ? 1 : 0)) {
            this.appendChild(this.factory.create("mrow"));
            this.childNodes[this.childNodes.length - 1].setInheritedAttributes(attributes2, false, level + 1, prime2);
          }
        };
        MmlMmultiscripts2.prototype.verifyChildren = function(options2) {
          var prescripts = false;
          var fix = options2["fixMmultiscripts"];
          for (var i2 = 0; i2 < this.childNodes.length; i2++) {
            var child = this.childNodes[i2];
            if (child.isKind("mprescripts")) {
              if (prescripts) {
                child.mError(child.kind + " can only appear once in " + this.kind, options2, true);
              } else {
                prescripts = true;
                if (i2 % 2 === 0 && !fix) {
                  this.mError("There must be an equal number of prescripts of each type", options2);
                }
              }
            }
          }
          if (this.childNodes.length % 2 === (prescripts ? 1 : 0) && !fix) {
            this.mError("There must be an equal number of scripts of each type", options2);
          }
          _super.prototype.verifyChildren.call(this, options2);
        };
        MmlMmultiscripts2.defaults = __assign2({}, msubsup_js_1.MmlMsubsup.defaults);
        return MmlMmultiscripts2;
      })(msubsup_js_1.MmlMsubsup);
      mmultiscripts.MmlMmultiscripts = MmlMmultiscripts;
      var MmlMprescripts = (function(_super) {
        __extends2(MmlMprescripts2, _super);
        function MmlMprescripts2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        Object.defineProperty(MmlMprescripts2.prototype, "kind", {
          get: function() {
            return "mprescripts";
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(MmlMprescripts2.prototype, "arity", {
          get: function() {
            return 0;
          },
          enumerable: false,
          configurable: true
        });
        MmlMprescripts2.prototype.verifyTree = function(options2) {
          _super.prototype.verifyTree.call(this, options2);
          if (this.parent && !this.parent.isKind("mmultiscripts")) {
            this.mError(this.kind + " must be a child of mmultiscripts", options2, true);
          }
        };
        MmlMprescripts2.defaults = __assign2({}, MmlNode_js_1.AbstractMmlNode.defaults);
        return MmlMprescripts2;
      })(MmlNode_js_1.AbstractMmlNode);
      mmultiscripts.MmlMprescripts = MmlMprescripts;
      var MmlNone = (function(_super) {
        __extends2(MmlNone2, _super);
        function MmlNone2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        Object.defineProperty(MmlNone2.prototype, "kind", {
          get: function() {
            return "none";
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(MmlNone2.prototype, "arity", {
          get: function() {
            return 0;
          },
          enumerable: false,
          configurable: true
        });
        MmlNone2.prototype.verifyTree = function(options2) {
          _super.prototype.verifyTree.call(this, options2);
          if (this.parent && !this.parent.isKind("mmultiscripts")) {
            this.mError(this.kind + " must be a child of mmultiscripts", options2, true);
          }
        };
        MmlNone2.defaults = __assign2({}, MmlNode_js_1.AbstractMmlNode.defaults);
        return MmlNone2;
      })(MmlNode_js_1.AbstractMmlNode);
      mmultiscripts.MmlNone = MmlNone;
      return mmultiscripts;
    }
    var hasRequiredMmultiscripts;
    function requireMmultiscripts() {
      if (hasRequiredMmultiscripts) return mmultiscripts$2;
      hasRequiredMmultiscripts = 1;
      var __extends2 = mmultiscripts$2 && mmultiscripts$2.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      var __read2 = mmultiscripts$2 && mmultiscripts$2.__read || function(o, n) {
        var m = typeof Symbol === "function" && o[Symbol.iterator];
        if (!m) return o;
        var i2 = m.call(o), r2, ar2 = [], e;
        try {
          while ((n === void 0 || n-- > 0) && !(r2 = i2.next()).done) ar2.push(r2.value);
        } catch (error2) {
          e = { error: error2 };
        } finally {
          try {
            if (r2 && !r2.done && (m = i2["return"])) m.call(i2);
          } finally {
            if (e) throw e.error;
          }
        }
        return ar2;
      };
      Object.defineProperty(mmultiscripts$2, "__esModule", { value: true });
      mmultiscripts$2.SVGmmultiscripts = mmultiscripts$2.AlignX = void 0;
      var msubsup_js_1 = requireMsubsup();
      var mmultiscripts_js_1 = requireMmultiscripts$2();
      var mmultiscripts_js_2 = requireMmultiscripts$1();
      var string_js_1 = requireString();
      function AlignX(align) {
        return {
          left: function(_w, _W) {
            return 0;
          },
          center: function(w, W) {
            return (W - w) / 2;
          },
          right: function(w, W) {
            return W - w;
          }
        }[align] || (function(_w, _W) {
          return 0;
        });
      }
      mmultiscripts$2.AlignX = AlignX;
      var SVGmmultiscripts = (function(_super) {
        __extends2(SVGmmultiscripts2, _super);
        function SVGmmultiscripts2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        SVGmmultiscripts2.prototype.toSVG = function(parent) {
          var svg2 = this.standardSVGnode(parent);
          var data = this.scriptData;
          var scriptalign = this.node.getProperty("scriptalign") || "right left";
          var _a2 = __read2((0, string_js_1.split)(scriptalign + " " + scriptalign), 2), preAlign = _a2[0], postAlign = _a2[1];
          var sub2 = this.combinePrePost(data.sub, data.psub);
          var sup4 = this.combinePrePost(data.sup, data.psup);
          var _b2 = __read2(this.getUVQ(sub2, sup4), 2), u = _b2[0], v = _b2[1];
          var x2 = 0;
          if (data.numPrescripts) {
            x2 = this.addScripts(0.05, u, v, this.firstPrescript, data.numPrescripts, preAlign);
          }
          var base2 = this.baseChild;
          base2.toSVG(svg2);
          base2.place(x2, 0);
          x2 += base2.getOuterBBox().w;
          if (data.numScripts) {
            this.addScripts(x2, u, v, 1, data.numScripts, postAlign);
          }
        };
        SVGmmultiscripts2.prototype.addScripts = function(x2, u, v, i2, n, align) {
          var adaptor = this.adaptor;
          var alignX = AlignX(align);
          var supRow = adaptor.append(this.element, this.svg("g"));
          var subRow = adaptor.append(this.element, this.svg("g"));
          this.place(x2, u, supRow);
          this.place(x2, v, subRow);
          var m = i2 + 2 * n;
          var dx = 0;
          while (i2 < m) {
            var _a2 = __read2([this.childNodes[i2++], this.childNodes[i2++]], 2), sub2 = _a2[0], sup4 = _a2[1];
            var _b2 = __read2([sub2.getOuterBBox(), sup4.getOuterBBox()], 2), subbox = _b2[0], supbox = _b2[1];
            var _c = __read2([subbox.rscale, supbox.rscale], 2), subr = _c[0], supr = _c[1];
            var w = Math.max(subbox.w * subr, supbox.w * supr);
            sub2.toSVG(subRow);
            sup4.toSVG(supRow);
            sub2.place(dx + alignX(subbox.w * subr, w), 0);
            sup4.place(dx + alignX(supbox.w * supr, w), 0);
            dx += w;
          }
          return x2 + dx;
        };
        SVGmmultiscripts2.kind = mmultiscripts_js_2.MmlMmultiscripts.prototype.kind;
        return SVGmmultiscripts2;
      })((0, mmultiscripts_js_1.CommonMmultiscriptsMixin)(msubsup_js_1.SVGmsubsup));
      mmultiscripts$2.SVGmmultiscripts = SVGmmultiscripts;
      return mmultiscripts$2;
    }
    var mtable$2 = {};
    var mtable$1 = {};
    var numeric = {};
    var hasRequiredNumeric;
    function requireNumeric() {
      if (hasRequiredNumeric) return numeric;
      hasRequiredNumeric = 1;
      Object.defineProperty(numeric, "__esModule", { value: true });
      numeric.max = numeric.sum = void 0;
      function sum2(A2) {
        return A2.reduce(function(a, b) {
          return a + b;
        }, 0);
      }
      numeric.sum = sum2;
      function max2(A2) {
        return A2.reduce(function(a, b) {
          return Math.max(a, b);
        }, 0);
      }
      numeric.max = max2;
      return numeric;
    }
    var hasRequiredMtable$2;
    function requireMtable$2() {
      if (hasRequiredMtable$2) return mtable$1;
      hasRequiredMtable$2 = 1;
      var __extends2 = mtable$1 && mtable$1.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      var __read2 = mtable$1 && mtable$1.__read || function(o, n) {
        var m = typeof Symbol === "function" && o[Symbol.iterator];
        if (!m) return o;
        var i2 = m.call(o), r2, ar2 = [], e;
        try {
          while ((n === void 0 || n-- > 0) && !(r2 = i2.next()).done) ar2.push(r2.value);
        } catch (error2) {
          e = { error: error2 };
        } finally {
          try {
            if (r2 && !r2.done && (m = i2["return"])) m.call(i2);
          } finally {
            if (e) throw e.error;
          }
        }
        return ar2;
      };
      var __spreadArray2 = mtable$1 && mtable$1.__spreadArray || function(to2, from, pack) {
        if (pack || arguments.length === 2) for (var i2 = 0, l = from.length, ar2; i2 < l; i2++) {
          if (ar2 || !(i2 in from)) {
            if (!ar2) ar2 = Array.prototype.slice.call(from, 0, i2);
            ar2[i2] = from[i2];
          }
        }
        return to2.concat(ar2 || Array.prototype.slice.call(from));
      };
      var __values2 = mtable$1 && mtable$1.__values || function(o) {
        var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i2 = 0;
        if (m) return m.call(o);
        if (o && typeof o.length === "number") return {
          next: function() {
            if (o && i2 >= o.length) o = void 0;
            return { value: o && o[i2++], done: !o };
          }
        };
        throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
      };
      Object.defineProperty(mtable$1, "__esModule", { value: true });
      mtable$1.CommonMtableMixin = void 0;
      var BBox_js_1 = requireBBox();
      var string_js_1 = requireString();
      var numeric_js_1 = requireNumeric();
      function CommonMtableMixin(Base) {
        return (function(_super) {
          __extends2(class_1, _super);
          function class_1() {
            var args2 = [];
            for (var _i = 0; _i < arguments.length; _i++) {
              args2[_i] = arguments[_i];
            }
            var _this = _super.apply(this, __spreadArray2([], __read2(args2), false)) || this;
            _this.numCols = 0;
            _this.numRows = 0;
            _this.data = null;
            _this.pwidthCells = [];
            _this.pWidth = 0;
            _this.numCols = (0, numeric_js_1.max)(_this.tableRows.map(function(row2) {
              return row2.numCells;
            }));
            _this.numRows = _this.childNodes.length;
            _this.hasLabels = _this.childNodes.reduce(function(value2, row2) {
              return value2 || row2.node.isKind("mlabeledtr");
            }, false);
            _this.findContainer();
            _this.isTop = !_this.container || _this.container.node.isKind("math") && !_this.container.parent;
            if (_this.isTop) {
              _this.jax.table = _this;
            }
            _this.getPercentageWidth();
            var attributes2 = _this.node.attributes;
            _this.frame = attributes2.get("frame") !== "none";
            _this.fLine = _this.frame && attributes2.get("frame") ? 0.07 : 0;
            _this.fSpace = _this.frame ? _this.convertLengths(_this.getAttributeArray("framespacing")) : [0, 0];
            _this.cSpace = _this.convertLengths(_this.getColumnAttributes("columnspacing"));
            _this.rSpace = _this.convertLengths(_this.getRowAttributes("rowspacing"));
            _this.cLines = _this.getColumnAttributes("columnlines").map(function(x2) {
              return x2 === "none" ? 0 : 0.07;
            });
            _this.rLines = _this.getRowAttributes("rowlines").map(function(x2) {
              return x2 === "none" ? 0 : 0.07;
            });
            _this.cWidths = _this.getColumnWidths();
            _this.stretchRows();
            _this.stretchColumns();
            return _this;
          }
          Object.defineProperty(class_1.prototype, "tableRows", {
            get: function() {
              return this.childNodes;
            },
            enumerable: false,
            configurable: true
          });
          class_1.prototype.findContainer = function() {
            var node2 = this;
            var parent = node2.parent;
            while (parent && (parent.node.notParent || parent.node.isKind("mrow"))) {
              node2 = parent;
              parent = parent.parent;
            }
            this.container = parent;
            this.containerI = node2.node.childPosition();
          };
          class_1.prototype.getPercentageWidth = function() {
            if (this.hasLabels) {
              this.bbox.pwidth = BBox_js_1.BBox.fullWidth;
            } else {
              var width = this.node.attributes.get("width");
              if ((0, string_js_1.isPercent)(width)) {
                this.bbox.pwidth = width;
              }
            }
          };
          class_1.prototype.stretchRows = function() {
            var equal = this.node.attributes.get("equalrows");
            var HD = equal ? this.getEqualRowHeight() : 0;
            var _a2 = equal ? this.getTableData() : { H: [0], D: [0] }, H = _a2.H, D2 = _a2.D;
            var rows = this.tableRows;
            for (var i2 = 0; i2 < this.numRows; i2++) {
              var hd = equal ? [(HD + H[i2] - D2[i2]) / 2, (HD - H[i2] + D2[i2]) / 2] : null;
              rows[i2].stretchChildren(hd);
            }
          };
          class_1.prototype.stretchColumns = function() {
            for (var i2 = 0; i2 < this.numCols; i2++) {
              var width = typeof this.cWidths[i2] === "number" ? this.cWidths[i2] : null;
              this.stretchColumn(i2, width);
            }
          };
          class_1.prototype.stretchColumn = function(i2, W) {
            var e_1, _a2, e_2, _b2, e_3, _c;
            var stretchy = [];
            try {
              for (var _d = __values2(this.tableRows), _e2 = _d.next(); !_e2.done; _e2 = _d.next()) {
                var row2 = _e2.value;
                var cell2 = row2.getChild(i2);
                if (cell2) {
                  var child = cell2.childNodes[0];
                  if (child.stretch.dir === 0 && child.canStretch(2)) {
                    stretchy.push(child);
                  }
                }
              }
            } catch (e_1_1) {
              e_1 = { error: e_1_1 };
            } finally {
              try {
                if (_e2 && !_e2.done && (_a2 = _d.return)) _a2.call(_d);
              } finally {
                if (e_1) throw e_1.error;
              }
            }
            var count = stretchy.length;
            var nodeCount = this.childNodes.length;
            if (count && nodeCount > 1) {
              if (W === null) {
                W = 0;
                var all2 = count > 1 && count === nodeCount;
                try {
                  for (var _f = __values2(this.tableRows), _g = _f.next(); !_g.done; _g = _f.next()) {
                    var row2 = _g.value;
                    var cell2 = row2.getChild(i2);
                    if (cell2) {
                      var child = cell2.childNodes[0];
                      var noStretch = child.stretch.dir === 0;
                      if (all2 || noStretch) {
                        var w = child.getBBox(noStretch).w;
                        if (w > W) {
                          W = w;
                        }
                      }
                    }
                  }
                } catch (e_2_1) {
                  e_2 = { error: e_2_1 };
                } finally {
                  try {
                    if (_g && !_g.done && (_b2 = _f.return)) _b2.call(_f);
                  } finally {
                    if (e_2) throw e_2.error;
                  }
                }
              }
              try {
                for (var stretchy_1 = __values2(stretchy), stretchy_1_1 = stretchy_1.next(); !stretchy_1_1.done; stretchy_1_1 = stretchy_1.next()) {
                  var child = stretchy_1_1.value;
                  child.coreMO().getStretchedVariant([W]);
                }
              } catch (e_3_1) {
                e_3 = { error: e_3_1 };
              } finally {
                try {
                  if (stretchy_1_1 && !stretchy_1_1.done && (_c = stretchy_1.return)) _c.call(stretchy_1);
                } finally {
                  if (e_3) throw e_3.error;
                }
              }
            }
          };
          class_1.prototype.getTableData = function() {
            if (this.data) {
              return this.data;
            }
            var H = new Array(this.numRows).fill(0);
            var D2 = new Array(this.numRows).fill(0);
            var W = new Array(this.numCols).fill(0);
            var NH = new Array(this.numRows);
            var ND = new Array(this.numRows);
            var LW = [0];
            var rows = this.tableRows;
            for (var j = 0; j < rows.length; j++) {
              var M = 0;
              var row2 = rows[j];
              var align = row2.node.attributes.get("rowalign");
              for (var i2 = 0; i2 < row2.numCells; i2++) {
                var cell2 = row2.getChild(i2);
                M = this.updateHDW(cell2, i2, j, align, H, D2, W, M);
                this.recordPWidthCell(cell2, i2);
              }
              NH[j] = H[j];
              ND[j] = D2[j];
              if (row2.labeled) {
                M = this.updateHDW(row2.childNodes[0], 0, j, align, H, D2, LW, M);
              }
              this.extendHD(j, H, D2, M);
              this.extendHD(j, NH, ND, M);
            }
            var L = LW[0];
            this.data = { H, D: D2, W, NH, ND, L };
            return this.data;
          };
          class_1.prototype.updateHDW = function(cell2, i2, j, align, H, D2, W, M) {
            var _a2 = cell2.getBBox(), h = _a2.h, d = _a2.d, w = _a2.w;
            var scale = cell2.parent.bbox.rscale;
            if (cell2.parent.bbox.rscale !== 1) {
              h *= scale;
              d *= scale;
              w *= scale;
            }
            if (this.node.getProperty("useHeight")) {
              if (h < 0.75)
                h = 0.75;
              if (d < 0.25)
                d = 0.25;
            }
            var m = 0;
            align = cell2.node.attributes.get("rowalign") || align;
            if (align !== "baseline" && align !== "axis") {
              m = h + d;
              h = d = 0;
            }
            if (h > H[j])
              H[j] = h;
            if (d > D2[j])
              D2[j] = d;
            if (m > M)
              M = m;
            if (W && w > W[i2])
              W[i2] = w;
            return M;
          };
          class_1.prototype.extendHD = function(i2, H, D2, M) {
            var d = (M - (H[i2] + D2[i2])) / 2;
            if (d < 1e-5)
              return;
            H[i2] += d;
            D2[i2] += d;
          };
          class_1.prototype.recordPWidthCell = function(cell2, i2) {
            if (cell2.childNodes[0] && cell2.childNodes[0].getBBox().pwidth) {
              this.pwidthCells.push([cell2, i2]);
            }
          };
          class_1.prototype.computeBBox = function(bbox, _recompute) {
            var _a2 = this.getTableData(), H = _a2.H, D2 = _a2.D;
            var height, width;
            if (this.node.attributes.get("equalrows")) {
              var HD = this.getEqualRowHeight();
              height = (0, numeric_js_1.sum)([].concat(this.rLines, this.rSpace)) + HD * this.numRows;
            } else {
              height = (0, numeric_js_1.sum)(H.concat(D2, this.rLines, this.rSpace));
            }
            height += 2 * (this.fLine + this.fSpace[1]);
            var CW = this.getComputedWidths();
            width = (0, numeric_js_1.sum)(CW.concat(this.cLines, this.cSpace)) + 2 * (this.fLine + this.fSpace[0]);
            var w = this.node.attributes.get("width");
            if (w !== "auto") {
              width = Math.max(this.length2em(w, 0) + 2 * this.fLine, width);
            }
            var _b2 = __read2(this.getBBoxHD(height), 2), h = _b2[0], d = _b2[1];
            bbox.h = h;
            bbox.d = d;
            bbox.w = width;
            var _c = __read2(this.getBBoxLR(), 2), L = _c[0], R = _c[1];
            bbox.L = L;
            bbox.R = R;
            if (!(0, string_js_1.isPercent)(w)) {
              this.setColumnPWidths();
            }
          };
          class_1.prototype.setChildPWidths = function(_recompute, cwidth, _clear) {
            var width = this.node.attributes.get("width");
            if (!(0, string_js_1.isPercent)(width))
              return false;
            if (!this.hasLabels) {
              this.bbox.pwidth = "";
              this.container.bbox.pwidth = "";
            }
            var _a2 = this.bbox, w = _a2.w, L = _a2.L, R = _a2.R;
            var labelInWidth = this.node.attributes.get("data-width-includes-label");
            var W = Math.max(w, this.length2em(width, Math.max(cwidth, L + w + R))) - (labelInWidth ? L + R : 0);
            var cols = this.node.attributes.get("equalcolumns") ? Array(this.numCols).fill(this.percent(1 / Math.max(1, this.numCols))) : this.getColumnAttributes("columnwidth", 0);
            this.cWidths = this.getColumnWidthsFixed(cols, W);
            var CW = this.getComputedWidths();
            this.pWidth = (0, numeric_js_1.sum)(CW.concat(this.cLines, this.cSpace)) + 2 * (this.fLine + this.fSpace[0]);
            if (this.isTop) {
              this.bbox.w = this.pWidth;
            }
            this.setColumnPWidths();
            if (this.pWidth !== w) {
              this.parent.invalidateBBox();
            }
            return this.pWidth !== w;
          };
          class_1.prototype.setColumnPWidths = function() {
            var e_4, _a2;
            var W = this.cWidths;
            try {
              for (var _b2 = __values2(this.pwidthCells), _c = _b2.next(); !_c.done; _c = _b2.next()) {
                var _d = __read2(_c.value, 2), cell2 = _d[0], i2 = _d[1];
                if (cell2.setChildPWidths(false, W[i2])) {
                  cell2.invalidateBBox();
                  cell2.getBBox();
                }
              }
            } catch (e_4_1) {
              e_4 = { error: e_4_1 };
            } finally {
              try {
                if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
              } finally {
                if (e_4) throw e_4.error;
              }
            }
          };
          class_1.prototype.getBBoxHD = function(height) {
            var _a2 = __read2(this.getAlignmentRow(), 2), align = _a2[0], row2 = _a2[1];
            if (row2 === null) {
              var a = this.font.params.axis_height;
              var h2 = height / 2;
              var HD = {
                top: [0, height],
                center: [h2, h2],
                bottom: [height, 0],
                baseline: [h2, h2],
                axis: [h2 + a, h2 - a]
              };
              return HD[align] || [h2, h2];
            } else {
              var y = this.getVerticalPosition(row2, align);
              return [y, height - y];
            }
          };
          class_1.prototype.getBBoxLR = function() {
            if (this.hasLabels) {
              var attributes2 = this.node.attributes;
              var side = attributes2.get("side");
              var _a2 = __read2(this.getPadAlignShift(side), 2), pad = _a2[0], align = _a2[1];
              var labels = this.hasLabels && !!attributes2.get("data-width-includes-label");
              if (labels && this.frame && this.fSpace[0]) {
                pad -= this.fSpace[0];
              }
              return align === "center" && !labels ? [pad, pad] : side === "left" ? [pad, 0] : [0, pad];
            }
            return [0, 0];
          };
          class_1.prototype.getPadAlignShift = function(side) {
            var L = this.getTableData().L;
            var sep2 = this.length2em(this.node.attributes.get("minlabelspacing"));
            var pad = L + sep2;
            var _a2 = __read2(this.styles == null ? ["", ""] : [this.styles.get("padding-left"), this.styles.get("padding-right")], 2), lpad = _a2[0], rpad = _a2[1];
            if (lpad || rpad) {
              pad = Math.max(pad, this.length2em(lpad || "0"), this.length2em(rpad || "0"));
            }
            var _b2 = __read2(this.getAlignShift(), 2), align = _b2[0], shift2 = _b2[1];
            if (align === side) {
              shift2 = side === "left" ? Math.max(pad, shift2) - pad : Math.min(-pad, shift2) + pad;
            }
            return [pad, align, shift2];
          };
          class_1.prototype.getAlignShift = function() {
            return this.isTop ? _super.prototype.getAlignShift.call(this) : [this.container.getChildAlign(this.containerI), 0];
          };
          class_1.prototype.getWidth = function() {
            return this.pWidth || this.getBBox().w;
          };
          class_1.prototype.getEqualRowHeight = function() {
            var _a2 = this.getTableData(), H = _a2.H, D2 = _a2.D;
            var HD = Array.from(H.keys()).map(function(i2) {
              return H[i2] + D2[i2];
            });
            return Math.max.apply(Math, HD);
          };
          class_1.prototype.getComputedWidths = function() {
            var _this = this;
            var W = this.getTableData().W;
            var CW = Array.from(W.keys()).map(function(i2) {
              return typeof _this.cWidths[i2] === "number" ? _this.cWidths[i2] : W[i2];
            });
            if (this.node.attributes.get("equalcolumns")) {
              CW = Array(CW.length).fill((0, numeric_js_1.max)(CW));
            }
            return CW;
          };
          class_1.prototype.getColumnWidths = function() {
            var width = this.node.attributes.get("width");
            if (this.node.attributes.get("equalcolumns")) {
              return this.getEqualColumns(width);
            }
            var swidths = this.getColumnAttributes("columnwidth", 0);
            if (width === "auto") {
              return this.getColumnWidthsAuto(swidths);
            }
            if ((0, string_js_1.isPercent)(width)) {
              return this.getColumnWidthsPercent(swidths);
            }
            return this.getColumnWidthsFixed(swidths, this.length2em(width));
          };
          class_1.prototype.getEqualColumns = function(width) {
            var n = Math.max(1, this.numCols);
            var cwidth;
            if (width === "auto") {
              var W = this.getTableData().W;
              cwidth = (0, numeric_js_1.max)(W);
            } else if ((0, string_js_1.isPercent)(width)) {
              cwidth = this.percent(1 / n);
            } else {
              var w = (0, numeric_js_1.sum)([].concat(this.cLines, this.cSpace)) + 2 * this.fSpace[0];
              cwidth = Math.max(0, this.length2em(width) - w) / n;
            }
            return Array(this.numCols).fill(cwidth);
          };
          class_1.prototype.getColumnWidthsAuto = function(swidths) {
            var _this = this;
            return swidths.map(function(x2) {
              if (x2 === "auto" || x2 === "fit")
                return null;
              if ((0, string_js_1.isPercent)(x2))
                return x2;
              return _this.length2em(x2);
            });
          };
          class_1.prototype.getColumnWidthsPercent = function(swidths) {
            var _this = this;
            var hasFit = swidths.indexOf("fit") >= 0;
            var W = (hasFit ? this.getTableData() : { W: null }).W;
            return Array.from(swidths.keys()).map(function(i2) {
              var x2 = swidths[i2];
              if (x2 === "fit")
                return null;
              if (x2 === "auto")
                return hasFit ? W[i2] : null;
              if ((0, string_js_1.isPercent)(x2))
                return x2;
              return _this.length2em(x2);
            });
          };
          class_1.prototype.getColumnWidthsFixed = function(swidths, width) {
            var _this = this;
            var indices = Array.from(swidths.keys());
            var fit = indices.filter(function(i2) {
              return swidths[i2] === "fit";
            });
            var auto2 = indices.filter(function(i2) {
              return swidths[i2] === "auto";
            });
            var n = fit.length || auto2.length;
            var W = (n ? this.getTableData() : { W: null }).W;
            var cwidth = width - (0, numeric_js_1.sum)([].concat(this.cLines, this.cSpace)) - 2 * this.fSpace[0];
            var dw = cwidth;
            indices.forEach(function(i2) {
              var x2 = swidths[i2];
              dw -= x2 === "fit" || x2 === "auto" ? W[i2] : _this.length2em(x2, cwidth);
            });
            var fw = n && dw > 0 ? dw / n : 0;
            return indices.map(function(i2) {
              var x2 = swidths[i2];
              if (x2 === "fit")
                return W[i2] + fw;
              if (x2 === "auto")
                return W[i2] + (fit.length === 0 ? fw : 0);
              return _this.length2em(x2, cwidth);
            });
          };
          class_1.prototype.getVerticalPosition = function(i2, align) {
            var equal = this.node.attributes.get("equalrows");
            var _a2 = this.getTableData(), H = _a2.H, D2 = _a2.D;
            var HD = equal ? this.getEqualRowHeight() : 0;
            var space = this.getRowHalfSpacing();
            var y = this.fLine;
            for (var j = 0; j < i2; j++) {
              y += space[j] + (equal ? HD : H[j] + D2[j]) + space[j + 1] + this.rLines[j];
            }
            var _b2 = __read2(equal ? [(HD + H[i2] - D2[i2]) / 2, (HD - H[i2] + D2[i2]) / 2] : [H[i2], D2[i2]], 2), h = _b2[0], d = _b2[1];
            var offset2 = {
              top: 0,
              center: space[i2] + (h + d) / 2,
              bottom: space[i2] + h + d + space[i2 + 1],
              baseline: space[i2] + h,
              axis: space[i2] + h - 0.25
            };
            y += offset2[align] || 0;
            return y;
          };
          class_1.prototype.getEmHalfSpacing = function(fspace, space, scale) {
            if (scale === void 0) {
              scale = 1;
            }
            var fspaceEm = this.em(fspace * scale);
            var spaceEm = this.addEm(space, 2 / scale);
            spaceEm.unshift(fspaceEm);
            spaceEm.push(fspaceEm);
            return spaceEm;
          };
          class_1.prototype.getRowHalfSpacing = function() {
            var space = this.rSpace.map(function(x2) {
              return x2 / 2;
            });
            space.unshift(this.fSpace[1]);
            space.push(this.fSpace[1]);
            return space;
          };
          class_1.prototype.getColumnHalfSpacing = function() {
            var space = this.cSpace.map(function(x2) {
              return x2 / 2;
            });
            space.unshift(this.fSpace[0]);
            space.push(this.fSpace[0]);
            return space;
          };
          class_1.prototype.getAlignmentRow = function() {
            var _a2 = __read2((0, string_js_1.split)(this.node.attributes.get("align")), 2), align = _a2[0], row2 = _a2[1];
            if (row2 == null)
              return [align, null];
            var i2 = parseInt(row2);
            if (i2 < 0)
              i2 += this.numRows + 1;
            return [align, i2 < 1 || i2 > this.numRows ? null : i2 - 1];
          };
          class_1.prototype.getColumnAttributes = function(name2, i2) {
            if (i2 === void 0) {
              i2 = 1;
            }
            var n = this.numCols - i2;
            var columns = this.getAttributeArray(name2);
            if (columns.length === 0)
              return null;
            while (columns.length < n) {
              columns.push(columns[columns.length - 1]);
            }
            if (columns.length > n) {
              columns.splice(n);
            }
            return columns;
          };
          class_1.prototype.getRowAttributes = function(name2, i2) {
            if (i2 === void 0) {
              i2 = 1;
            }
            var n = this.numRows - i2;
            var rows = this.getAttributeArray(name2);
            if (rows.length === 0)
              return null;
            while (rows.length < n) {
              rows.push(rows[rows.length - 1]);
            }
            if (rows.length > n) {
              rows.splice(n);
            }
            return rows;
          };
          class_1.prototype.getAttributeArray = function(name2) {
            var value2 = this.node.attributes.get(name2);
            if (!value2)
              return [this.node.attributes.getDefault(name2)];
            return (0, string_js_1.split)(value2);
          };
          class_1.prototype.addEm = function(list2, n) {
            var _this = this;
            if (n === void 0) {
              n = 1;
            }
            if (!list2)
              return null;
            return list2.map(function(x2) {
              return _this.em(x2 / n);
            });
          };
          class_1.prototype.convertLengths = function(list2) {
            var _this = this;
            if (!list2)
              return null;
            return list2.map(function(x2) {
              return _this.length2em(x2);
            });
          };
          return class_1;
        })(Base);
      }
      mtable$1.CommonMtableMixin = CommonMtableMixin;
      return mtable$1;
    }
    var mtable = {};
    var hasRequiredMtable$1;
    function requireMtable$1() {
      if (hasRequiredMtable$1) return mtable;
      hasRequiredMtable$1 = 1;
      var __extends2 = mtable && mtable.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      var __assign2 = mtable && mtable.__assign || function() {
        __assign2 = Object.assign || function(t2) {
          for (var s, i2 = 1, n = arguments.length; i2 < n; i2++) {
            s = arguments[i2];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
              t2[p] = s[p];
          }
          return t2;
        };
        return __assign2.apply(this, arguments);
      };
      var __values2 = mtable && mtable.__values || function(o) {
        var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i2 = 0;
        if (m) return m.call(o);
        if (o && typeof o.length === "number") return {
          next: function() {
            if (o && i2 >= o.length) o = void 0;
            return { value: o && o[i2++], done: !o };
          }
        };
        throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
      };
      Object.defineProperty(mtable, "__esModule", { value: true });
      mtable.MmlMtable = void 0;
      var MmlNode_js_1 = requireMmlNode();
      var string_js_1 = requireString();
      var MmlMtable = (function(_super) {
        __extends2(MmlMtable2, _super);
        function MmlMtable2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.properties = {
            useHeight: true
          };
          _this.texclass = MmlNode_js_1.TEXCLASS.ORD;
          return _this;
        }
        Object.defineProperty(MmlMtable2.prototype, "kind", {
          get: function() {
            return "mtable";
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(MmlMtable2.prototype, "linebreakContainer", {
          get: function() {
            return true;
          },
          enumerable: false,
          configurable: true
        });
        MmlMtable2.prototype.setInheritedAttributes = function(attributes2, display, level, prime2) {
          var e_1, _a2;
          try {
            for (var indentAttributes_1 = __values2(MmlNode_js_1.indentAttributes), indentAttributes_1_1 = indentAttributes_1.next(); !indentAttributes_1_1.done; indentAttributes_1_1 = indentAttributes_1.next()) {
              var name_1 = indentAttributes_1_1.value;
              if (attributes2[name_1]) {
                this.attributes.setInherited(name_1, attributes2[name_1][1]);
              }
              if (this.attributes.getExplicit(name_1) !== void 0) {
                delete this.attributes.getAllAttributes()[name_1];
              }
            }
          } catch (e_1_1) {
            e_1 = { error: e_1_1 };
          } finally {
            try {
              if (indentAttributes_1_1 && !indentAttributes_1_1.done && (_a2 = indentAttributes_1.return)) _a2.call(indentAttributes_1);
            } finally {
              if (e_1) throw e_1.error;
            }
          }
          _super.prototype.setInheritedAttributes.call(this, attributes2, display, level, prime2);
        };
        MmlMtable2.prototype.setChildInheritedAttributes = function(attributes2, display, level, _prime) {
          var e_2, _a2, e_3, _b2;
          try {
            for (var _c = __values2(this.childNodes), _d = _c.next(); !_d.done; _d = _c.next()) {
              var child = _d.value;
              if (!child.isKind("mtr")) {
                this.replaceChild(this.factory.create("mtr"), child).appendChild(child);
              }
            }
          } catch (e_2_1) {
            e_2 = { error: e_2_1 };
          } finally {
            try {
              if (_d && !_d.done && (_a2 = _c.return)) _a2.call(_c);
            } finally {
              if (e_2) throw e_2.error;
            }
          }
          level = this.getProperty("scriptlevel") || level;
          display = !!(this.attributes.getExplicit("displaystyle") || this.attributes.getDefault("displaystyle"));
          attributes2 = this.addInheritedAttributes(attributes2, {
            columnalign: this.attributes.get("columnalign"),
            rowalign: "center"
          });
          var cramped = this.attributes.getExplicit("data-cramped");
          var ralign = (0, string_js_1.split)(this.attributes.get("rowalign"));
          try {
            for (var _e2 = __values2(this.childNodes), _f = _e2.next(); !_f.done; _f = _e2.next()) {
              var child = _f.value;
              attributes2.rowalign[1] = ralign.shift() || attributes2.rowalign[1];
              child.setInheritedAttributes(attributes2, display, level, !!cramped);
            }
          } catch (e_3_1) {
            e_3 = { error: e_3_1 };
          } finally {
            try {
              if (_f && !_f.done && (_b2 = _e2.return)) _b2.call(_e2);
            } finally {
              if (e_3) throw e_3.error;
            }
          }
        };
        MmlMtable2.prototype.verifyChildren = function(options2) {
          var mtr2 = null;
          var factory = this.factory;
          for (var i2 = 0; i2 < this.childNodes.length; i2++) {
            var child = this.childNodes[i2];
            if (child.isKind("mtr")) {
              mtr2 = null;
            } else {
              var isMtd = child.isKind("mtd");
              if (mtr2) {
                this.removeChild(child);
                i2--;
              } else {
                mtr2 = this.replaceChild(factory.create("mtr"), child);
              }
              mtr2.appendChild(isMtd ? child : factory.create("mtd", {}, [child]));
              if (!options2["fixMtables"]) {
                child.parent.removeChild(child);
                child.parent = this;
                isMtd && mtr2.appendChild(factory.create("mtd"));
                var merror2 = child.mError("Children of " + this.kind + " must be mtr or mlabeledtr", options2, isMtd);
                mtr2.childNodes[mtr2.childNodes.length - 1].appendChild(merror2);
              }
            }
          }
          _super.prototype.verifyChildren.call(this, options2);
        };
        MmlMtable2.prototype.setTeXclass = function(prev) {
          var e_4, _a2;
          this.getPrevClass(prev);
          try {
            for (var _b2 = __values2(this.childNodes), _c = _b2.next(); !_c.done; _c = _b2.next()) {
              var child = _c.value;
              child.setTeXclass(null);
            }
          } catch (e_4_1) {
            e_4 = { error: e_4_1 };
          } finally {
            try {
              if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
            } finally {
              if (e_4) throw e_4.error;
            }
          }
          return this;
        };
        MmlMtable2.defaults = __assign2(__assign2({}, MmlNode_js_1.AbstractMmlNode.defaults), { align: "axis", rowalign: "baseline", columnalign: "center", groupalign: "{left}", alignmentscope: true, columnwidth: "auto", width: "auto", rowspacing: "1ex", columnspacing: ".8em", rowlines: "none", columnlines: "none", frame: "none", framespacing: "0.4em 0.5ex", equalrows: false, equalcolumns: false, displaystyle: false, side: "right", minlabelspacing: "0.8em" });
        return MmlMtable2;
      })(MmlNode_js_1.AbstractMmlNode);
      mtable.MmlMtable = MmlMtable;
      return mtable;
    }
    var hasRequiredMtable;
    function requireMtable() {
      if (hasRequiredMtable) return mtable$2;
      hasRequiredMtable = 1;
      var __extends2 = mtable$2 && mtable$2.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      var __read2 = mtable$2 && mtable$2.__read || function(o, n) {
        var m = typeof Symbol === "function" && o[Symbol.iterator];
        if (!m) return o;
        var i2 = m.call(o), r2, ar2 = [], e;
        try {
          while ((n === void 0 || n-- > 0) && !(r2 = i2.next()).done) ar2.push(r2.value);
        } catch (error2) {
          e = { error: error2 };
        } finally {
          try {
            if (r2 && !r2.done && (m = i2["return"])) m.call(i2);
          } finally {
            if (e) throw e.error;
          }
        }
        return ar2;
      };
      var __spreadArray2 = mtable$2 && mtable$2.__spreadArray || function(to2, from, pack) {
        if (pack || arguments.length === 2) for (var i2 = 0, l = from.length, ar2; i2 < l; i2++) {
          if (ar2 || !(i2 in from)) {
            if (!ar2) ar2 = Array.prototype.slice.call(from, 0, i2);
            ar2[i2] = from[i2];
          }
        }
        return to2.concat(ar2 || Array.prototype.slice.call(from));
      };
      Object.defineProperty(mtable$2, "__esModule", { value: true });
      mtable$2.SVGmtable = void 0;
      var Wrapper_js_1 = requireWrapper();
      var mtable_js_1 = requireMtable$2();
      var mtable_js_2 = requireMtable$1();
      var CLASSPREFIX = "mjx-";
      var SVGmtable = (function(_super) {
        __extends2(SVGmtable2, _super);
        function SVGmtable2(factory, node2, parent) {
          if (parent === void 0) {
            parent = null;
          }
          var _this = _super.call(this, factory, node2, parent) || this;
          var def = { "data-labels": true };
          if (_this.isTop) {
            def.transform = "matrix(1 0 0 -1 0 0)";
          }
          _this.labels = _this.svg("g", def);
          return _this;
        }
        SVGmtable2.prototype.toSVG = function(parent) {
          var svg2 = this.standardSVGnode(parent);
          this.placeRows(svg2);
          this.handleColumnLines(svg2);
          this.handleRowLines(svg2);
          this.handleFrame(svg2);
          var dx = this.handlePWidth(svg2);
          this.handleLabels(svg2, parent, dx);
        };
        SVGmtable2.prototype.placeRows = function(svg2) {
          var _a2, _b2, _c;
          var equal = this.node.attributes.get("equalrows");
          var _d = this.getTableData(), H = _d.H, D2 = _d.D;
          var HD = this.getEqualRowHeight();
          var rSpace = this.getRowHalfSpacing();
          var rLines = __spreadArray2(__spreadArray2([this.fLine], __read2(this.rLines), false), [this.fLine], false);
          var y = this.getBBox().h - rLines[0];
          for (var i2 = 0; i2 < this.numRows; i2++) {
            var row2 = this.childNodes[i2];
            _a2 = __read2(this.getRowHD(equal, HD, H[i2], D2[i2]), 2), row2.H = _a2[0], row2.D = _a2[1];
            _b2 = __read2([rSpace[i2], rSpace[i2 + 1]], 2), row2.tSpace = _b2[0], row2.bSpace = _b2[1];
            _c = __read2([rLines[i2], rLines[i2 + 1]], 2), row2.tLine = _c[0], row2.bLine = _c[1];
            row2.toSVG(svg2);
            row2.place(0, y - rSpace[i2] - row2.H);
            y -= rSpace[i2] + row2.H + row2.D + rSpace[i2 + 1] + rLines[i2 + 1];
          }
        };
        SVGmtable2.prototype.getRowHD = function(equal, HD, H, D2) {
          return equal ? [(HD + H - D2) / 2, (HD - H + D2) / 2] : [H, D2];
        };
        SVGmtable2.prototype.handleColor = function() {
          _super.prototype.handleColor.call(this);
          var rect2 = this.firstChild();
          if (rect2) {
            this.adaptor.setAttribute(rect2, "width", this.fixed(this.getWidth()));
          }
        };
        SVGmtable2.prototype.handleColumnLines = function(svg2) {
          if (this.node.attributes.get("columnlines") === "none")
            return;
          var lines = this.getColumnAttributes("columnlines");
          if (!lines)
            return;
          var cSpace = this.getColumnHalfSpacing();
          var cLines = this.cLines;
          var cWidth = this.getComputedWidths();
          var x2 = this.fLine;
          for (var i2 = 0; i2 < lines.length; i2++) {
            x2 += cSpace[i2] + cWidth[i2] + cSpace[i2 + 1];
            if (lines[i2] !== "none") {
              this.adaptor.append(svg2, this.makeVLine(x2, lines[i2], cLines[i2]));
            }
            x2 += cLines[i2];
          }
        };
        SVGmtable2.prototype.handleRowLines = function(svg2) {
          if (this.node.attributes.get("rowlines") === "none")
            return;
          var lines = this.getRowAttributes("rowlines");
          if (!lines)
            return;
          var equal = this.node.attributes.get("equalrows");
          var _a2 = this.getTableData(), H = _a2.H, D2 = _a2.D;
          var HD = this.getEqualRowHeight();
          var rSpace = this.getRowHalfSpacing();
          var rLines = this.rLines;
          var y = this.getBBox().h - this.fLine;
          for (var i2 = 0; i2 < lines.length; i2++) {
            var _b2 = __read2(this.getRowHD(equal, HD, H[i2], D2[i2]), 2), rH = _b2[0], rD = _b2[1];
            y -= rSpace[i2] + rH + rD + rSpace[i2 + 1];
            if (lines[i2] !== "none") {
              this.adaptor.append(svg2, this.makeHLine(y, lines[i2], rLines[i2]));
            }
            y -= rLines[i2];
          }
        };
        SVGmtable2.prototype.handleFrame = function(svg2) {
          if (this.frame && this.fLine) {
            var _a2 = this.getBBox(), h = _a2.h, d = _a2.d, w = _a2.w;
            var style2 = this.node.attributes.get("frame");
            this.adaptor.append(svg2, this.makeFrame(w, h, d, style2));
          }
        };
        SVGmtable2.prototype.handlePWidth = function(svg2) {
          if (!this.pWidth) {
            return 0;
          }
          var _a2 = this.getBBox(), w = _a2.w, L = _a2.L, R = _a2.R;
          var W = L + this.pWidth + R;
          var align = this.getAlignShift()[0];
          var CW = Math.max(this.isTop ? W : 0, this.container.getWrapWidth(this.containerI)) - L - R;
          var dw = w - (this.pWidth > CW ? CW : this.pWidth);
          var dx = align === "left" ? 0 : align === "right" ? dw : dw / 2;
          if (dx) {
            var table2 = this.svg("g", {}, this.adaptor.childNodes(svg2));
            this.place(dx, 0, table2);
            this.adaptor.append(svg2, table2);
          }
          return dx;
        };
        SVGmtable2.prototype.lineClass = function(style2) {
          return CLASSPREFIX + style2;
        };
        SVGmtable2.prototype.makeFrame = function(w, h, d, style2) {
          var t2 = this.fLine;
          return this.svg("rect", this.setLineThickness(t2, style2, {
            "data-frame": true,
            "class": this.lineClass(style2),
            width: this.fixed(w - t2),
            height: this.fixed(h + d - t2),
            x: this.fixed(t2 / 2),
            y: this.fixed(t2 / 2 - d)
          }));
        };
        SVGmtable2.prototype.makeVLine = function(x2, style2, t2) {
          var _a2 = this.getBBox(), h = _a2.h, d = _a2.d;
          var dt2 = style2 === "dotted" ? t2 / 2 : 0;
          var X2 = this.fixed(x2 + t2 / 2);
          return this.svg("line", this.setLineThickness(t2, style2, {
            "data-line": "v",
            "class": this.lineClass(style2),
            x1: X2,
            y1: this.fixed(dt2 - d),
            x2: X2,
            y2: this.fixed(h - dt2)
          }));
        };
        SVGmtable2.prototype.makeHLine = function(y, style2, t2) {
          var w = this.getBBox().w;
          var dt2 = style2 === "dotted" ? t2 / 2 : 0;
          var Y2 = this.fixed(y - t2 / 2);
          return this.svg("line", this.setLineThickness(t2, style2, {
            "data-line": "h",
            "class": this.lineClass(style2),
            x1: this.fixed(dt2),
            y1: Y2,
            x2: this.fixed(w - dt2),
            y2: Y2
          }));
        };
        SVGmtable2.prototype.setLineThickness = function(t2, style2, properties) {
          if (t2 !== 0.07) {
            properties["stroke-thickness"] = this.fixed(t2);
            if (style2 !== "solid") {
              properties["stroke-dasharray"] = (style2 === "dotted" ? "0," : "") + this.fixed(2 * t2);
            }
          }
          return properties;
        };
        SVGmtable2.prototype.handleLabels = function(svg2, _parent, dx) {
          if (!this.hasLabels)
            return;
          var labels = this.labels;
          var attributes2 = this.node.attributes;
          var side = attributes2.get("side");
          this.spaceLabels();
          this.isTop ? this.topTable(svg2, labels, side) : this.subTable(svg2, labels, side, dx);
        };
        SVGmtable2.prototype.spaceLabels = function() {
          var adaptor = this.adaptor;
          var h = this.getBBox().h;
          var L = this.getTableData().L;
          var space = this.getRowHalfSpacing();
          var y = h - this.fLine;
          var current2 = adaptor.firstChild(this.labels);
          for (var i2 = 0; i2 < this.numRows; i2++) {
            var row2 = this.childNodes[i2];
            if (row2.node.isKind("mlabeledtr")) {
              var cell2 = row2.childNodes[0];
              y -= space[i2] + row2.H;
              row2.placeCell(cell2, { x: 0, y, w: L, lSpace: 0, rSpace: 0, lLine: 0, rLine: 0 });
              y -= row2.D + space[i2 + 1] + this.rLines[i2];
              current2 = adaptor.next(current2);
            } else {
              y -= space[i2] + row2.H + row2.D + space[i2 + 1] + this.rLines[i2];
            }
          }
        };
        SVGmtable2.prototype.topTable = function(svg2, labels, side) {
          var adaptor = this.adaptor;
          var _a2 = this.getBBox(), h = _a2.h, d = _a2.d, w = _a2.w, L = _a2.L, R = _a2.R;
          var W = L + (this.pWidth || w) + R;
          var LW = this.getTableData().L;
          var _b2 = __read2(this.getPadAlignShift(side), 3), align = _b2[1], shift2 = _b2[2];
          var dx = shift2 + (align === "right" ? -W : align === "center" ? -W / 2 : 0) + L;
          var matrix = "matrix(1 0 0 -1 0 0)";
          var scale = "scale(".concat(this.jax.fixed(this.font.params.x_height * 1e3 / this.metrics.ex, 2), ")");
          var transform = "translate(0 ".concat(this.fixed(h), ") ").concat(matrix, " ").concat(scale);
          var table2 = this.svg("svg", {
            "data-table": true,
            preserveAspectRatio: align === "left" ? "xMinYMid" : align === "right" ? "xMaxYMid" : "xMidYMid",
            viewBox: [this.fixed(-dx), this.fixed(-h), 1, this.fixed(h + d)].join(" ")
          }, [
            this.svg("g", { transform: matrix }, adaptor.childNodes(svg2))
          ]);
          labels = this.svg("svg", {
            "data-labels": true,
            preserveAspectRatio: side === "left" ? "xMinYMid" : "xMaxYMid",
            viewBox: [side === "left" ? 0 : this.fixed(LW), this.fixed(-h), 1, this.fixed(h + d)].join(" ")
          }, [labels]);
          adaptor.append(svg2, this.svg("g", { transform }, [table2, labels]));
          this.place(-L, 0, svg2);
        };
        SVGmtable2.prototype.subTable = function(svg2, labels, side, dx) {
          var adaptor = this.adaptor;
          var _a2 = this.getBBox(), w = _a2.w, L = _a2.L, R = _a2.R;
          var W = L + (this.pWidth || w) + R;
          var labelW = this.getTableData().L;
          var align = this.getAlignShift()[0];
          var CW = Math.max(W, this.container.getWrapWidth(this.containerI));
          this.place(side === "left" ? (align === "left" ? 0 : align === "right" ? W - CW + dx : (W - CW) / 2 + dx) - L : (align === "left" ? CW : align === "right" ? W + dx : (CW + W) / 2 + dx) - L - labelW, 0, labels);
          adaptor.append(svg2, labels);
        };
        SVGmtable2.kind = mtable_js_2.MmlMtable.prototype.kind;
        SVGmtable2.styles = {
          'g[data-mml-node="mtable"] > line[data-line], svg[data-table] > g > line[data-line]': {
            "stroke-width": "70px",
            fill: "none"
          },
          'g[data-mml-node="mtable"] > rect[data-frame], svg[data-table] > g > rect[data-frame]': {
            "stroke-width": "70px",
            fill: "none"
          },
          'g[data-mml-node="mtable"] > .mjx-dashed, svg[data-table] > g > .mjx-dashed': {
            "stroke-dasharray": "140"
          },
          'g[data-mml-node="mtable"] > .mjx-dotted, svg[data-table] > g > .mjx-dotted': {
            "stroke-linecap": "round",
            "stroke-dasharray": "0,140"
          },
          'g[data-mml-node="mtable"] > g > svg': {
            overflow: "visible"
          }
        };
        return SVGmtable2;
      })((0, mtable_js_1.CommonMtableMixin)(Wrapper_js_1.SVGWrapper));
      mtable$2.SVGmtable = SVGmtable;
      return mtable$2;
    }
    var mtr$2 = {};
    var mtr$1 = {};
    var hasRequiredMtr$2;
    function requireMtr$2() {
      if (hasRequiredMtr$2) return mtr$1;
      hasRequiredMtr$2 = 1;
      var __extends2 = mtr$1 && mtr$1.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      var __values2 = mtr$1 && mtr$1.__values || function(o) {
        var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i2 = 0;
        if (m) return m.call(o);
        if (o && typeof o.length === "number") return {
          next: function() {
            if (o && i2 >= o.length) o = void 0;
            return { value: o && o[i2++], done: !o };
          }
        };
        throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
      };
      Object.defineProperty(mtr$1, "__esModule", { value: true });
      mtr$1.CommonMlabeledtrMixin = mtr$1.CommonMtrMixin = void 0;
      function CommonMtrMixin(Base) {
        return (function(_super) {
          __extends2(class_1, _super);
          function class_1() {
            return _super !== null && _super.apply(this, arguments) || this;
          }
          Object.defineProperty(class_1.prototype, "fixesPWidth", {
            get: function() {
              return false;
            },
            enumerable: false,
            configurable: true
          });
          Object.defineProperty(class_1.prototype, "numCells", {
            get: function() {
              return this.childNodes.length;
            },
            enumerable: false,
            configurable: true
          });
          Object.defineProperty(class_1.prototype, "labeled", {
            get: function() {
              return false;
            },
            enumerable: false,
            configurable: true
          });
          Object.defineProperty(class_1.prototype, "tableCells", {
            get: function() {
              return this.childNodes;
            },
            enumerable: false,
            configurable: true
          });
          class_1.prototype.getChild = function(i2) {
            return this.childNodes[i2];
          };
          class_1.prototype.getChildBBoxes = function() {
            return this.childNodes.map(function(cell2) {
              return cell2.getBBox();
            });
          };
          class_1.prototype.stretchChildren = function(HD) {
            var e_1, _a2, e_2, _b2, e_3, _c;
            if (HD === void 0) {
              HD = null;
            }
            var stretchy = [];
            var children2 = this.labeled ? this.childNodes.slice(1) : this.childNodes;
            try {
              for (var children_1 = __values2(children2), children_1_1 = children_1.next(); !children_1_1.done; children_1_1 = children_1.next()) {
                var mtd2 = children_1_1.value;
                var child = mtd2.childNodes[0];
                if (child.canStretch(1)) {
                  stretchy.push(child);
                }
              }
            } catch (e_1_1) {
              e_1 = { error: e_1_1 };
            } finally {
              try {
                if (children_1_1 && !children_1_1.done && (_a2 = children_1.return)) _a2.call(children_1);
              } finally {
                if (e_1) throw e_1.error;
              }
            }
            var count = stretchy.length;
            var nodeCount = this.childNodes.length;
            if (count && nodeCount > 1) {
              if (HD === null) {
                var H = 0, D2 = 0;
                var all2 = count > 1 && count === nodeCount;
                try {
                  for (var children_2 = __values2(children2), children_2_1 = children_2.next(); !children_2_1.done; children_2_1 = children_2.next()) {
                    var mtd2 = children_2_1.value;
                    var child = mtd2.childNodes[0];
                    var noStretch = child.stretch.dir === 0;
                    if (all2 || noStretch) {
                      var _d = child.getBBox(noStretch), h = _d.h, d = _d.d;
                      if (h > H) {
                        H = h;
                      }
                      if (d > D2) {
                        D2 = d;
                      }
                    }
                  }
                } catch (e_2_1) {
                  e_2 = { error: e_2_1 };
                } finally {
                  try {
                    if (children_2_1 && !children_2_1.done && (_b2 = children_2.return)) _b2.call(children_2);
                  } finally {
                    if (e_2) throw e_2.error;
                  }
                }
                HD = [H, D2];
              }
              try {
                for (var stretchy_1 = __values2(stretchy), stretchy_1_1 = stretchy_1.next(); !stretchy_1_1.done; stretchy_1_1 = stretchy_1.next()) {
                  var child = stretchy_1_1.value;
                  child.coreMO().getStretchedVariant(HD);
                }
              } catch (e_3_1) {
                e_3 = { error: e_3_1 };
              } finally {
                try {
                  if (stretchy_1_1 && !stretchy_1_1.done && (_c = stretchy_1.return)) _c.call(stretchy_1);
                } finally {
                  if (e_3) throw e_3.error;
                }
              }
            }
          };
          return class_1;
        })(Base);
      }
      mtr$1.CommonMtrMixin = CommonMtrMixin;
      function CommonMlabeledtrMixin(Base) {
        return (function(_super) {
          __extends2(class_2, _super);
          function class_2() {
            return _super !== null && _super.apply(this, arguments) || this;
          }
          Object.defineProperty(class_2.prototype, "numCells", {
            get: function() {
              return Math.max(0, this.childNodes.length - 1);
            },
            enumerable: false,
            configurable: true
          });
          Object.defineProperty(class_2.prototype, "labeled", {
            get: function() {
              return true;
            },
            enumerable: false,
            configurable: true
          });
          Object.defineProperty(class_2.prototype, "tableCells", {
            get: function() {
              return this.childNodes.slice(1);
            },
            enumerable: false,
            configurable: true
          });
          class_2.prototype.getChild = function(i2) {
            return this.childNodes[i2 + 1];
          };
          class_2.prototype.getChildBBoxes = function() {
            return this.childNodes.slice(1).map(function(cell2) {
              return cell2.getBBox();
            });
          };
          return class_2;
        })(Base);
      }
      mtr$1.CommonMlabeledtrMixin = CommonMlabeledtrMixin;
      return mtr$1;
    }
    var mtr = {};
    var hasRequiredMtr$1;
    function requireMtr$1() {
      if (hasRequiredMtr$1) return mtr;
      hasRequiredMtr$1 = 1;
      var __extends2 = mtr && mtr.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      var __assign2 = mtr && mtr.__assign || function() {
        __assign2 = Object.assign || function(t2) {
          for (var s, i2 = 1, n = arguments.length; i2 < n; i2++) {
            s = arguments[i2];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
              t2[p] = s[p];
          }
          return t2;
        };
        return __assign2.apply(this, arguments);
      };
      var __values2 = mtr && mtr.__values || function(o) {
        var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i2 = 0;
        if (m) return m.call(o);
        if (o && typeof o.length === "number") return {
          next: function() {
            if (o && i2 >= o.length) o = void 0;
            return { value: o && o[i2++], done: !o };
          }
        };
        throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
      };
      Object.defineProperty(mtr, "__esModule", { value: true });
      mtr.MmlMlabeledtr = mtr.MmlMtr = void 0;
      var MmlNode_js_1 = requireMmlNode();
      var Attributes_js_1 = requireAttributes$2();
      var string_js_1 = requireString();
      var MmlMtr = (function(_super) {
        __extends2(MmlMtr2, _super);
        function MmlMtr2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        Object.defineProperty(MmlMtr2.prototype, "kind", {
          get: function() {
            return "mtr";
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(MmlMtr2.prototype, "linebreakContainer", {
          get: function() {
            return true;
          },
          enumerable: false,
          configurable: true
        });
        MmlMtr2.prototype.setChildInheritedAttributes = function(attributes2, display, level, prime2) {
          var e_1, _a2, e_2, _b2;
          try {
            for (var _c = __values2(this.childNodes), _d = _c.next(); !_d.done; _d = _c.next()) {
              var child = _d.value;
              if (!child.isKind("mtd")) {
                this.replaceChild(this.factory.create("mtd"), child).appendChild(child);
              }
            }
          } catch (e_1_1) {
            e_1 = { error: e_1_1 };
          } finally {
            try {
              if (_d && !_d.done && (_a2 = _c.return)) _a2.call(_c);
            } finally {
              if (e_1) throw e_1.error;
            }
          }
          var calign = (0, string_js_1.split)(this.attributes.get("columnalign"));
          if (this.arity === 1) {
            calign.unshift(this.parent.attributes.get("side"));
          }
          attributes2 = this.addInheritedAttributes(attributes2, {
            rowalign: this.attributes.get("rowalign"),
            columnalign: "center"
          });
          try {
            for (var _e2 = __values2(this.childNodes), _f = _e2.next(); !_f.done; _f = _e2.next()) {
              var child = _f.value;
              attributes2.columnalign[1] = calign.shift() || attributes2.columnalign[1];
              child.setInheritedAttributes(attributes2, display, level, prime2);
            }
          } catch (e_2_1) {
            e_2 = { error: e_2_1 };
          } finally {
            try {
              if (_f && !_f.done && (_b2 = _e2.return)) _b2.call(_e2);
            } finally {
              if (e_2) throw e_2.error;
            }
          }
        };
        MmlMtr2.prototype.verifyChildren = function(options2) {
          var e_3, _a2;
          if (this.parent && !this.parent.isKind("mtable")) {
            this.mError(this.kind + " can only be a child of an mtable", options2, true);
            return;
          }
          try {
            for (var _b2 = __values2(this.childNodes), _c = _b2.next(); !_c.done; _c = _b2.next()) {
              var child = _c.value;
              if (!child.isKind("mtd")) {
                var mtd2 = this.replaceChild(this.factory.create("mtd"), child);
                mtd2.appendChild(child);
                if (!options2["fixMtables"]) {
                  child.mError("Children of " + this.kind + " must be mtd", options2);
                }
              }
            }
          } catch (e_3_1) {
            e_3 = { error: e_3_1 };
          } finally {
            try {
              if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
            } finally {
              if (e_3) throw e_3.error;
            }
          }
          _super.prototype.verifyChildren.call(this, options2);
        };
        MmlMtr2.prototype.setTeXclass = function(prev) {
          var e_4, _a2;
          this.getPrevClass(prev);
          try {
            for (var _b2 = __values2(this.childNodes), _c = _b2.next(); !_c.done; _c = _b2.next()) {
              var child = _c.value;
              child.setTeXclass(null);
            }
          } catch (e_4_1) {
            e_4 = { error: e_4_1 };
          } finally {
            try {
              if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
            } finally {
              if (e_4) throw e_4.error;
            }
          }
          return this;
        };
        MmlMtr2.defaults = __assign2(__assign2({}, MmlNode_js_1.AbstractMmlNode.defaults), { rowalign: Attributes_js_1.INHERIT, columnalign: Attributes_js_1.INHERIT, groupalign: Attributes_js_1.INHERIT });
        return MmlMtr2;
      })(MmlNode_js_1.AbstractMmlNode);
      mtr.MmlMtr = MmlMtr;
      var MmlMlabeledtr = (function(_super) {
        __extends2(MmlMlabeledtr2, _super);
        function MmlMlabeledtr2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        Object.defineProperty(MmlMlabeledtr2.prototype, "kind", {
          get: function() {
            return "mlabeledtr";
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(MmlMlabeledtr2.prototype, "arity", {
          get: function() {
            return 1;
          },
          enumerable: false,
          configurable: true
        });
        return MmlMlabeledtr2;
      })(MmlMtr);
      mtr.MmlMlabeledtr = MmlMlabeledtr;
      return mtr;
    }
    var hasRequiredMtr;
    function requireMtr() {
      if (hasRequiredMtr) return mtr$2;
      hasRequiredMtr = 1;
      var __extends2 = mtr$2 && mtr$2.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      var __read2 = mtr$2 && mtr$2.__read || function(o, n) {
        var m = typeof Symbol === "function" && o[Symbol.iterator];
        if (!m) return o;
        var i2 = m.call(o), r2, ar2 = [], e;
        try {
          while ((n === void 0 || n-- > 0) && !(r2 = i2.next()).done) ar2.push(r2.value);
        } catch (error2) {
          e = { error: error2 };
        } finally {
          try {
            if (r2 && !r2.done && (m = i2["return"])) m.call(i2);
          } finally {
            if (e) throw e.error;
          }
        }
        return ar2;
      };
      var __spreadArray2 = mtr$2 && mtr$2.__spreadArray || function(to2, from, pack) {
        if (pack || arguments.length === 2) for (var i2 = 0, l = from.length, ar2; i2 < l; i2++) {
          if (ar2 || !(i2 in from)) {
            if (!ar2) ar2 = Array.prototype.slice.call(from, 0, i2);
            ar2[i2] = from[i2];
          }
        }
        return to2.concat(ar2 || Array.prototype.slice.call(from));
      };
      Object.defineProperty(mtr$2, "__esModule", { value: true });
      mtr$2.SVGmlabeledtr = mtr$2.SVGmtr = void 0;
      var Wrapper_js_1 = requireWrapper();
      var mtr_js_1 = requireMtr$2();
      var mtr_js_2 = requireMtr$2();
      var mtr_js_3 = requireMtr$1();
      var SVGmtr = (function(_super) {
        __extends2(SVGmtr2, _super);
        function SVGmtr2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        SVGmtr2.prototype.toSVG = function(parent) {
          var svg2 = this.standardSVGnode(parent);
          this.placeCells(svg2);
          this.placeColor();
        };
        SVGmtr2.prototype.placeCells = function(svg2) {
          var cSpace = this.parent.getColumnHalfSpacing();
          var cLines = __spreadArray2(__spreadArray2([this.parent.fLine], __read2(this.parent.cLines), false), [this.parent.fLine], false);
          var cWidth = this.parent.getComputedWidths();
          var scale = 1 / this.getBBox().rscale;
          var x2 = cLines[0];
          for (var i2 = 0; i2 < this.numCells; i2++) {
            var child = this.getChild(i2);
            child.toSVG(svg2);
            x2 += this.placeCell(child, {
              x: x2,
              y: 0,
              lSpace: cSpace[i2] * scale,
              rSpace: cSpace[i2 + 1] * scale,
              w: cWidth[i2] * scale,
              lLine: cLines[i2] * scale,
              rLine: cLines[i2 + 1] * scale
            });
          }
        };
        SVGmtr2.prototype.placeCell = function(cell2, sizes) {
          var x2 = sizes.x, y = sizes.y, lSpace = sizes.lSpace, w = sizes.w, rSpace = sizes.rSpace, lLine = sizes.lLine, rLine = sizes.rLine;
          var scale = 1 / this.getBBox().rscale;
          var _a2 = __read2([this.H * scale, this.D * scale], 2), h = _a2[0], d = _a2[1];
          var _b2 = __read2([this.tSpace * scale, this.bSpace * scale], 2), t2 = _b2[0], b = _b2[1];
          var _c = __read2(cell2.placeCell(x2 + lSpace, y, w, h, d), 2), dx = _c[0], dy = _c[1];
          var W = lSpace + w + rSpace;
          cell2.placeColor(-(dx + lSpace + lLine / 2), -(d + b + dy), W + (lLine + rLine) / 2, h + d + t2 + b);
          return W + rLine;
        };
        SVGmtr2.prototype.placeColor = function() {
          var scale = 1 / this.getBBox().rscale;
          var adaptor = this.adaptor;
          var child = this.firstChild();
          if (child && adaptor.kind(child) === "rect" && adaptor.getAttribute(child, "data-bgcolor")) {
            var _a2 = __read2([this.tLine / 2 * scale, this.bLine / 2 * scale], 2), TL = _a2[0], BL = _a2[1];
            var _b2 = __read2([this.tSpace * scale, this.bSpace * scale], 2), TS = _b2[0], BS = _b2[1];
            var _c = __read2([this.H * scale, this.D * scale], 2), H = _c[0], D2 = _c[1];
            adaptor.setAttribute(child, "y", this.fixed(-(D2 + BS + BL)));
            adaptor.setAttribute(child, "width", this.fixed(this.parent.getWidth() * scale));
            adaptor.setAttribute(child, "height", this.fixed(TL + TS + H + D2 + BS + BL));
          }
        };
        SVGmtr2.kind = mtr_js_3.MmlMtr.prototype.kind;
        return SVGmtr2;
      })((0, mtr_js_1.CommonMtrMixin)(Wrapper_js_1.SVGWrapper));
      mtr$2.SVGmtr = SVGmtr;
      var SVGmlabeledtr = (function(_super) {
        __extends2(SVGmlabeledtr2, _super);
        function SVGmlabeledtr2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        SVGmlabeledtr2.prototype.toSVG = function(parent) {
          _super.prototype.toSVG.call(this, parent);
          var child = this.childNodes[0];
          if (child) {
            child.toSVG(this.parent.labels);
          }
        };
        SVGmlabeledtr2.kind = mtr_js_3.MmlMlabeledtr.prototype.kind;
        return SVGmlabeledtr2;
      })((0, mtr_js_2.CommonMlabeledtrMixin)(SVGmtr));
      mtr$2.SVGmlabeledtr = SVGmlabeledtr;
      return mtr$2;
    }
    var mtd$2 = {};
    var mtd$1 = {};
    var hasRequiredMtd$2;
    function requireMtd$2() {
      if (hasRequiredMtd$2) return mtd$1;
      hasRequiredMtd$2 = 1;
      var __extends2 = mtd$1 && mtd$1.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      Object.defineProperty(mtd$1, "__esModule", { value: true });
      mtd$1.CommonMtdMixin = void 0;
      function CommonMtdMixin(Base) {
        return (function(_super) {
          __extends2(class_1, _super);
          function class_1() {
            return _super !== null && _super.apply(this, arguments) || this;
          }
          Object.defineProperty(class_1.prototype, "fixesPWidth", {
            get: function() {
              return false;
            },
            enumerable: false,
            configurable: true
          });
          class_1.prototype.invalidateBBox = function() {
            this.bboxComputed = false;
          };
          class_1.prototype.getWrapWidth = function(_j) {
            var table2 = this.parent.parent;
            var row2 = this.parent;
            var i2 = this.node.childPosition() - (row2.labeled ? 1 : 0);
            return typeof table2.cWidths[i2] === "number" ? table2.cWidths[i2] : table2.getTableData().W[i2];
          };
          class_1.prototype.getChildAlign = function(_i) {
            return this.node.attributes.get("columnalign");
          };
          return class_1;
        })(Base);
      }
      mtd$1.CommonMtdMixin = CommonMtdMixin;
      return mtd$1;
    }
    var mtd = {};
    var hasRequiredMtd$1;
    function requireMtd$1() {
      if (hasRequiredMtd$1) return mtd;
      hasRequiredMtd$1 = 1;
      var __extends2 = mtd && mtd.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      var __assign2 = mtd && mtd.__assign || function() {
        __assign2 = Object.assign || function(t2) {
          for (var s, i2 = 1, n = arguments.length; i2 < n; i2++) {
            s = arguments[i2];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
              t2[p] = s[p];
          }
          return t2;
        };
        return __assign2.apply(this, arguments);
      };
      Object.defineProperty(mtd, "__esModule", { value: true });
      mtd.MmlMtd = void 0;
      var MmlNode_js_1 = requireMmlNode();
      var Attributes_js_1 = requireAttributes$2();
      var MmlMtd = (function(_super) {
        __extends2(MmlMtd2, _super);
        function MmlMtd2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        Object.defineProperty(MmlMtd2.prototype, "kind", {
          get: function() {
            return "mtd";
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(MmlMtd2.prototype, "arity", {
          get: function() {
            return -1;
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(MmlMtd2.prototype, "linebreakContainer", {
          get: function() {
            return true;
          },
          enumerable: false,
          configurable: true
        });
        MmlMtd2.prototype.verifyChildren = function(options2) {
          if (this.parent && !this.parent.isKind("mtr")) {
            this.mError(this.kind + " can only be a child of an mtr or mlabeledtr", options2, true);
            return;
          }
          _super.prototype.verifyChildren.call(this, options2);
        };
        MmlMtd2.prototype.setTeXclass = function(prev) {
          this.getPrevClass(prev);
          this.childNodes[0].setTeXclass(null);
          return this;
        };
        MmlMtd2.defaults = __assign2(__assign2({}, MmlNode_js_1.AbstractMmlBaseNode.defaults), { rowspan: 1, columnspan: 1, rowalign: Attributes_js_1.INHERIT, columnalign: Attributes_js_1.INHERIT, groupalign: Attributes_js_1.INHERIT });
        return MmlMtd2;
      })(MmlNode_js_1.AbstractMmlBaseNode);
      mtd.MmlMtd = MmlMtd;
      return mtd;
    }
    var hasRequiredMtd;
    function requireMtd() {
      if (hasRequiredMtd) return mtd$2;
      hasRequiredMtd = 1;
      var __extends2 = mtd$2 && mtd$2.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      Object.defineProperty(mtd$2, "__esModule", { value: true });
      mtd$2.SVGmtd = void 0;
      var Wrapper_js_1 = requireWrapper();
      var mtd_js_1 = requireMtd$2();
      var mtd_js_2 = requireMtd$1();
      var SVGmtd = (function(_super) {
        __extends2(SVGmtd2, _super);
        function SVGmtd2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        SVGmtd2.prototype.placeCell = function(x2, y, W, H, D2) {
          var bbox = this.getBBox();
          var h = Math.max(bbox.h, 0.75);
          var d = Math.max(bbox.d, 0.25);
          var calign = this.node.attributes.get("columnalign");
          var ralign = this.node.attributes.get("rowalign");
          var alignX = this.getAlignX(W, bbox, calign);
          var alignY = this.getAlignY(H, D2, h, d, ralign);
          this.place(x2 + alignX, y + alignY);
          return [alignX, alignY];
        };
        SVGmtd2.prototype.placeColor = function(x2, y, W, H) {
          var adaptor = this.adaptor;
          var child = this.firstChild();
          if (child && adaptor.kind(child) === "rect" && adaptor.getAttribute(child, "data-bgcolor")) {
            adaptor.setAttribute(child, "x", this.fixed(x2));
            adaptor.setAttribute(child, "y", this.fixed(y));
            adaptor.setAttribute(child, "width", this.fixed(W));
            adaptor.setAttribute(child, "height", this.fixed(H));
          }
        };
        SVGmtd2.kind = mtd_js_2.MmlMtd.prototype.kind;
        return SVGmtd2;
      })((0, mtd_js_1.CommonMtdMixin)(Wrapper_js_1.SVGWrapper));
      mtd$2.SVGmtd = SVGmtd;
      return mtd$2;
    }
    var maction$2 = {};
    var maction$1 = {};
    var hasRequiredMaction$2;
    function requireMaction$2() {
      if (hasRequiredMaction$2) return maction$1;
      hasRequiredMaction$2 = 1;
      (function(exports2) {
        var __extends2 = maction$1 && maction$1.__extends || /* @__PURE__ */ (function() {
          var extendStatics2 = function(d, b) {
            extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
              d2.__proto__ = b2;
            } || function(d2, b2) {
              for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
            };
            return extendStatics2(d, b);
          };
          return function(d, b) {
            if (typeof b !== "function" && b !== null)
              throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
            extendStatics2(d, b);
            function __() {
              this.constructor = d;
            }
            d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
          };
        })();
        var __read2 = maction$1 && maction$1.__read || function(o, n) {
          var m = typeof Symbol === "function" && o[Symbol.iterator];
          if (!m) return o;
          var i2 = m.call(o), r2, ar2 = [], e;
          try {
            while ((n === void 0 || n-- > 0) && !(r2 = i2.next()).done) ar2.push(r2.value);
          } catch (error2) {
            e = { error: error2 };
          } finally {
            try {
              if (r2 && !r2.done && (m = i2["return"])) m.call(i2);
            } finally {
              if (e) throw e.error;
            }
          }
          return ar2;
        };
        var __spreadArray2 = maction$1 && maction$1.__spreadArray || function(to2, from, pack) {
          if (pack || arguments.length === 2) for (var i2 = 0, l = from.length, ar2; i2 < l; i2++) {
            if (ar2 || !(i2 in from)) {
              if (!ar2) ar2 = Array.prototype.slice.call(from, 0, i2);
              ar2[i2] = from[i2];
            }
          }
          return to2.concat(ar2 || Array.prototype.slice.call(from));
        };
        Object.defineProperty(exports2, "__esModule", { value: true });
        exports2.CommonMactionMixin = exports2.TooltipData = void 0;
        var string_js_1 = requireString();
        exports2.TooltipData = {
          dx: ".2em",
          dy: ".1em",
          postDelay: 600,
          clearDelay: 100,
          hoverTimer: /* @__PURE__ */ new Map(),
          clearTimer: /* @__PURE__ */ new Map(),
          stopTimers: function(node2, data) {
            if (data.clearTimer.has(node2)) {
              clearTimeout(data.clearTimer.get(node2));
              data.clearTimer.delete(node2);
            }
            if (data.hoverTimer.has(node2)) {
              clearTimeout(data.hoverTimer.get(node2));
              data.hoverTimer.delete(node2);
            }
          }
        };
        function CommonMactionMixin(Base) {
          return (function(_super) {
            __extends2(class_1, _super);
            function class_1() {
              var args2 = [];
              for (var _i = 0; _i < arguments.length; _i++) {
                args2[_i] = arguments[_i];
              }
              var _this = _super.apply(this, __spreadArray2([], __read2(args2), false)) || this;
              var actions = _this.constructor.actions;
              var action = _this.node.attributes.get("actiontype");
              var _a2 = __read2(actions.get(action) || [(function(_node, _data) {
              }), {}], 2), handler = _a2[0], data = _a2[1];
              _this.action = handler;
              _this.data = data;
              _this.getParameters();
              return _this;
            }
            Object.defineProperty(class_1.prototype, "selected", {
              get: function() {
                var selection = this.node.attributes.get("selection");
                var i2 = Math.max(1, Math.min(this.childNodes.length, selection)) - 1;
                return this.childNodes[i2] || this.wrap(this.node.selected);
              },
              enumerable: false,
              configurable: true
            });
            class_1.prototype.getParameters = function() {
              var offsets = this.node.attributes.get("data-offsets");
              var _a2 = __read2((0, string_js_1.split)(offsets || ""), 2), dx = _a2[0], dy = _a2[1];
              this.dx = this.length2em(dx || exports2.TooltipData.dx);
              this.dy = this.length2em(dy || exports2.TooltipData.dy);
            };
            class_1.prototype.computeBBox = function(bbox, recompute) {
              if (recompute === void 0) {
                recompute = false;
              }
              bbox.updateFrom(this.selected.getOuterBBox());
              this.selected.setChildPWidths(recompute);
            };
            return class_1;
          })(Base);
        }
        exports2.CommonMactionMixin = CommonMactionMixin;
      })(maction$1);
      return maction$1;
    }
    var maction = {};
    var hasRequiredMaction$1;
    function requireMaction$1() {
      if (hasRequiredMaction$1) return maction;
      hasRequiredMaction$1 = 1;
      var __extends2 = maction && maction.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      var __assign2 = maction && maction.__assign || function() {
        __assign2 = Object.assign || function(t2) {
          for (var s, i2 = 1, n = arguments.length; i2 < n; i2++) {
            s = arguments[i2];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
              t2[p] = s[p];
          }
          return t2;
        };
        return __assign2.apply(this, arguments);
      };
      Object.defineProperty(maction, "__esModule", { value: true });
      maction.MmlMaction = void 0;
      var MmlNode_js_1 = requireMmlNode();
      var MmlMaction = (function(_super) {
        __extends2(MmlMaction2, _super);
        function MmlMaction2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        Object.defineProperty(MmlMaction2.prototype, "kind", {
          get: function() {
            return "maction";
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(MmlMaction2.prototype, "arity", {
          get: function() {
            return 1;
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(MmlMaction2.prototype, "selected", {
          get: function() {
            var selection = this.attributes.get("selection");
            var i2 = Math.max(1, Math.min(this.childNodes.length, selection)) - 1;
            return this.childNodes[i2] || this.factory.create("mrow");
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(MmlMaction2.prototype, "isEmbellished", {
          get: function() {
            return this.selected.isEmbellished;
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(MmlMaction2.prototype, "isSpacelike", {
          get: function() {
            return this.selected.isSpacelike;
          },
          enumerable: false,
          configurable: true
        });
        MmlMaction2.prototype.core = function() {
          return this.selected.core();
        };
        MmlMaction2.prototype.coreMO = function() {
          return this.selected.coreMO();
        };
        MmlMaction2.prototype.verifyAttributes = function(options2) {
          _super.prototype.verifyAttributes.call(this, options2);
          if (this.attributes.get("actiontype") !== "toggle" && this.attributes.getExplicit("selection") !== void 0) {
            var attributes2 = this.attributes.getAllAttributes();
            delete attributes2.selection;
          }
        };
        MmlMaction2.prototype.setTeXclass = function(prev) {
          if (this.attributes.get("actiontype") === "tooltip" && this.childNodes[1]) {
            this.childNodes[1].setTeXclass(null);
          }
          var selected2 = this.selected;
          prev = selected2.setTeXclass(prev);
          this.updateTeXclass(selected2);
          return prev;
        };
        MmlMaction2.prototype.nextToggleSelection = function() {
          var selection = Math.max(1, this.attributes.get("selection") + 1);
          if (selection > this.childNodes.length) {
            selection = 1;
          }
          this.attributes.set("selection", selection);
        };
        MmlMaction2.defaults = __assign2(__assign2({}, MmlNode_js_1.AbstractMmlNode.defaults), { actiontype: "toggle", selection: 1 });
        return MmlMaction2;
      })(MmlNode_js_1.AbstractMmlNode);
      maction.MmlMaction = MmlMaction;
      return maction;
    }
    var hasRequiredMaction;
    function requireMaction() {
      if (hasRequiredMaction) return maction$2;
      hasRequiredMaction = 1;
      var __extends2 = maction$2 && maction$2.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      Object.defineProperty(maction$2, "__esModule", { value: true });
      maction$2.SVGmaction = void 0;
      var Wrapper_js_1 = requireWrapper();
      var maction_js_1 = requireMaction$2();
      var maction_js_2 = requireMaction$2();
      var maction_js_3 = requireMaction$1();
      var SVGmaction = (function(_super) {
        __extends2(SVGmaction2, _super);
        function SVGmaction2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        SVGmaction2.prototype.toSVG = function(parent) {
          var svg2 = this.standardSVGnode(parent);
          var child = this.selected;
          var _a2 = child.getOuterBBox(), h = _a2.h, d = _a2.d, w = _a2.w;
          this.adaptor.append(this.element, this.svg("rect", {
            width: this.fixed(w),
            height: this.fixed(h + d),
            y: this.fixed(-d),
            fill: "none",
            "pointer-events": "all"
          }));
          child.toSVG(svg2);
          var bbox = child.getOuterBBox();
          if (child.element) {
            child.place(bbox.L * bbox.rscale, 0);
          }
          this.action(this, this.data);
        };
        SVGmaction2.prototype.setEventHandler = function(type, handler) {
          this.element.addEventListener(type, handler);
        };
        SVGmaction2.kind = maction_js_3.MmlMaction.prototype.kind;
        SVGmaction2.styles = {
          '[jax="SVG"] mjx-tool': {
            display: "inline-block",
            position: "relative",
            width: 0,
            height: 0
          },
          '[jax="SVG"] mjx-tool > mjx-tip': {
            position: "absolute",
            top: 0,
            left: 0
          },
          "mjx-tool > mjx-tip": {
            display: "inline-block",
            padding: ".2em",
            border: "1px solid #888",
            "font-size": "70%",
            "background-color": "#F8F8F8",
            color: "black",
            "box-shadow": "2px 2px 5px #AAAAAA"
          },
          'g[data-mml-node="maction"][data-toggle]': {
            cursor: "pointer"
          },
          "mjx-status": {
            display: "block",
            position: "fixed",
            left: "1em",
            bottom: "1em",
            "min-width": "25%",
            padding: ".2em .4em",
            border: "1px solid #888",
            "font-size": "90%",
            "background-color": "#F8F8F8",
            color: "black"
          }
        };
        SVGmaction2.actions = /* @__PURE__ */ new Map([
          ["toggle", [function(node2, _data) {
            node2.adaptor.setAttribute(node2.element, "data-toggle", node2.node.attributes.get("selection"));
            var math2 = node2.factory.jax.math;
            var document2 = node2.factory.jax.document;
            var mml = node2.node;
            node2.setEventHandler("click", function(event) {
              if (!math2.end.node) {
                math2.start.node = math2.end.node = math2.typesetRoot;
                math2.start.n = math2.end.n = 0;
              }
              mml.nextToggleSelection();
              math2.rerender(document2);
              event.stopPropagation();
            });
          }, {}]],
          ["tooltip", [function(node2, data) {
            var tip = node2.childNodes[1];
            if (!tip)
              return;
            var rect2 = node2.firstChild();
            if (tip.node.isKind("mtext")) {
              var text2 = tip.node.getText();
              node2.adaptor.insert(node2.svg("title", {}, [node2.text(text2)]), rect2);
            } else {
              var adaptor_1 = node2.adaptor;
              var container_1 = node2.jax.container;
              var math2 = node2.node.factory.create("math", {}, [node2.childNodes[1].node]);
              var tool_1 = node2.html("mjx-tool", {}, [node2.html("mjx-tip")]);
              var hidden_1 = adaptor_1.append(rect2, node2.svg("foreignObject", { style: { display: "none" } }, [tool_1]));
              node2.jax.processMath(math2, adaptor_1.firstChild(tool_1));
              node2.childNodes[1].node.parent = node2.node;
              node2.setEventHandler("mouseover", function(event) {
                data.stopTimers(node2, data);
                data.hoverTimer.set(node2, setTimeout(function() {
                  adaptor_1.setStyle(tool_1, "left", "0");
                  adaptor_1.setStyle(tool_1, "top", "0");
                  adaptor_1.append(container_1, tool_1);
                  var tbox = adaptor_1.nodeBBox(tool_1);
                  var nbox = adaptor_1.nodeBBox(node2.element);
                  var dx = (nbox.right - tbox.left) / node2.metrics.em + node2.dx;
                  var dy = (nbox.bottom - tbox.bottom) / node2.metrics.em + node2.dy;
                  adaptor_1.setStyle(tool_1, "left", node2.px(dx));
                  adaptor_1.setStyle(tool_1, "top", node2.px(dy));
                }, data.postDelay));
                event.stopPropagation();
              });
              node2.setEventHandler("mouseout", function(event) {
                data.stopTimers(node2, data);
                var timer = setTimeout(function() {
                  return adaptor_1.append(hidden_1, tool_1);
                }, data.clearDelay);
                data.clearTimer.set(node2, timer);
                event.stopPropagation();
              });
            }
          }, maction_js_2.TooltipData]],
          ["statusline", [function(node2, data) {
            var tip = node2.childNodes[1];
            if (!tip)
              return;
            if (tip.node.isKind("mtext")) {
              var adaptor_2 = node2.adaptor;
              var text_1 = tip.node.getText();
              adaptor_2.setAttribute(node2.element, "data-statusline", text_1);
              node2.setEventHandler("mouseover", function(event) {
                if (data.status === null) {
                  var body2 = adaptor_2.body(adaptor_2.document);
                  data.status = adaptor_2.append(body2, node2.html("mjx-status", {}, [node2.text(text_1)]));
                }
                event.stopPropagation();
              });
              node2.setEventHandler("mouseout", function(event) {
                if (data.status) {
                  adaptor_2.remove(data.status);
                  data.status = null;
                }
                event.stopPropagation();
              });
            }
          }, {
            status: null
          }]]
        ]);
        return SVGmaction2;
      })((0, maction_js_1.CommonMactionMixin)(Wrapper_js_1.SVGWrapper));
      maction$2.SVGmaction = SVGmaction;
      return maction$2;
    }
    var menclose$2 = {};
    var menclose$1 = {};
    var Notation$1 = {};
    var hasRequiredNotation$1;
    function requireNotation$1() {
      if (hasRequiredNotation$1) return Notation$1;
      hasRequiredNotation$1 = 1;
      (function(exports2) {
        var __read2 = Notation$1 && Notation$1.__read || function(o, n) {
          var m = typeof Symbol === "function" && o[Symbol.iterator];
          if (!m) return o;
          var i2 = m.call(o), r2, ar2 = [], e;
          try {
            while ((n === void 0 || n-- > 0) && !(r2 = i2.next()).done) ar2.push(r2.value);
          } catch (error2) {
            e = { error: error2 };
          } finally {
            try {
              if (r2 && !r2.done && (m = i2["return"])) m.call(i2);
            } finally {
              if (e) throw e.error;
            }
          }
          return ar2;
        };
        Object.defineProperty(exports2, "__esModule", { value: true });
        exports2.CommonArrow = exports2.CommonDiagonalArrow = exports2.CommonDiagonalStrike = exports2.CommonBorder2 = exports2.CommonBorder = exports2.arrowBBox = exports2.diagonalArrowDef = exports2.arrowDef = exports2.arrowBBoxW = exports2.arrowBBoxHD = exports2.arrowHead = exports2.fullBorder = exports2.fullPadding = exports2.fullBBox = exports2.sideNames = exports2.sideIndex = exports2.SOLID = exports2.PADDING = exports2.THICKNESS = exports2.ARROWY = exports2.ARROWDX = exports2.ARROWX = void 0;
        exports2.ARROWX = 4, exports2.ARROWDX = 1, exports2.ARROWY = 2;
        exports2.THICKNESS = 0.067;
        exports2.PADDING = 0.2;
        exports2.SOLID = exports2.THICKNESS + "em solid";
        exports2.sideIndex = { top: 0, right: 1, bottom: 2, left: 3 };
        exports2.sideNames = Object.keys(exports2.sideIndex);
        exports2.fullBBox = (function(node2) {
          return new Array(4).fill(node2.thickness + node2.padding);
        });
        exports2.fullPadding = (function(node2) {
          return new Array(4).fill(node2.padding);
        });
        exports2.fullBorder = (function(node2) {
          return new Array(4).fill(node2.thickness);
        });
        var arrowHead = function(node2) {
          return Math.max(node2.padding, node2.thickness * (node2.arrowhead.x + node2.arrowhead.dx + 1));
        };
        exports2.arrowHead = arrowHead;
        var arrowBBoxHD = function(node2, TRBL) {
          if (node2.childNodes[0]) {
            var _a2 = node2.childNodes[0].getBBox(), h = _a2.h, d = _a2.d;
            TRBL[0] = TRBL[2] = Math.max(0, node2.thickness * node2.arrowhead.y - (h + d) / 2);
          }
          return TRBL;
        };
        exports2.arrowBBoxHD = arrowBBoxHD;
        var arrowBBoxW = function(node2, TRBL) {
          if (node2.childNodes[0]) {
            var w = node2.childNodes[0].getBBox().w;
            TRBL[1] = TRBL[3] = Math.max(0, node2.thickness * node2.arrowhead.y - w / 2);
          }
          return TRBL;
        };
        exports2.arrowBBoxW = arrowBBoxW;
        exports2.arrowDef = {
          up: [-Math.PI / 2, false, true, "verticalstrike"],
          down: [Math.PI / 2, false, true, "verticakstrike"],
          right: [0, false, false, "horizontalstrike"],
          left: [Math.PI, false, false, "horizontalstrike"],
          updown: [Math.PI / 2, true, true, "verticalstrike uparrow downarrow"],
          leftright: [0, true, false, "horizontalstrike leftarrow rightarrow"]
        };
        exports2.diagonalArrowDef = {
          updiagonal: [-1, 0, false, "updiagonalstrike northeastarrow"],
          northeast: [-1, 0, false, "updiagonalstrike updiagonalarrow"],
          southeast: [1, 0, false, "downdiagonalstrike"],
          northwest: [1, Math.PI, false, "downdiagonalstrike"],
          southwest: [-1, Math.PI, false, "updiagonalstrike"],
          northeastsouthwest: [-1, 0, true, "updiagonalstrike northeastarrow updiagonalarrow southwestarrow"],
          northwestsoutheast: [1, 0, true, "downdiagonalstrike northwestarrow southeastarrow"]
        };
        exports2.arrowBBox = {
          up: function(node2) {
            return (0, exports2.arrowBBoxW)(node2, [(0, exports2.arrowHead)(node2), 0, node2.padding, 0]);
          },
          down: function(node2) {
            return (0, exports2.arrowBBoxW)(node2, [node2.padding, 0, (0, exports2.arrowHead)(node2), 0]);
          },
          right: function(node2) {
            return (0, exports2.arrowBBoxHD)(node2, [0, (0, exports2.arrowHead)(node2), 0, node2.padding]);
          },
          left: function(node2) {
            return (0, exports2.arrowBBoxHD)(node2, [0, node2.padding, 0, (0, exports2.arrowHead)(node2)]);
          },
          updown: function(node2) {
            return (0, exports2.arrowBBoxW)(node2, [(0, exports2.arrowHead)(node2), 0, (0, exports2.arrowHead)(node2), 0]);
          },
          leftright: function(node2) {
            return (0, exports2.arrowBBoxHD)(node2, [0, (0, exports2.arrowHead)(node2), 0, (0, exports2.arrowHead)(node2)]);
          }
        };
        var CommonBorder = function(render2) {
          return function(side) {
            var i2 = exports2.sideIndex[side];
            return [side, {
              renderer: render2,
              bbox: function(node2) {
                var bbox = [0, 0, 0, 0];
                bbox[i2] = node2.thickness + node2.padding;
                return bbox;
              },
              border: function(node2) {
                var bbox = [0, 0, 0, 0];
                bbox[i2] = node2.thickness;
                return bbox;
              }
            }];
          };
        };
        exports2.CommonBorder = CommonBorder;
        var CommonBorder2 = function(render2) {
          return function(name2, side1, side2) {
            var i1 = exports2.sideIndex[side1];
            var i2 = exports2.sideIndex[side2];
            return [name2, {
              renderer: render2,
              bbox: function(node2) {
                var t2 = node2.thickness + node2.padding;
                var bbox = [0, 0, 0, 0];
                bbox[i1] = bbox[i2] = t2;
                return bbox;
              },
              border: function(node2) {
                var bbox = [0, 0, 0, 0];
                bbox[i1] = bbox[i2] = node2.thickness;
                return bbox;
              },
              remove: side1 + " " + side2
            }];
          };
        };
        exports2.CommonBorder2 = CommonBorder2;
        var CommonDiagonalStrike = function(render2) {
          return function(name2) {
            var cname = "mjx-" + name2.charAt(0) + "strike";
            return [name2 + "diagonalstrike", {
              renderer: render2(cname),
              bbox: exports2.fullBBox
            }];
          };
        };
        exports2.CommonDiagonalStrike = CommonDiagonalStrike;
        var CommonDiagonalArrow = function(render2) {
          return function(name2) {
            var _a2 = __read2(exports2.diagonalArrowDef[name2], 4), c2 = _a2[0], pi2 = _a2[1], double = _a2[2], remove2 = _a2[3];
            return [name2 + "arrow", {
              renderer: function(node2, _child) {
                var _a3 = __read2(node2.arrowAW(), 2), a = _a3[0], W = _a3[1];
                var arrow2 = node2.arrow(W, c2 * (a - pi2), double);
                render2(node2, arrow2);
              },
              bbox: function(node2) {
                var _a3 = node2.arrowData(), a = _a3.a, x2 = _a3.x, y = _a3.y;
                var _b2 = __read2([node2.arrowhead.x, node2.arrowhead.y, node2.arrowhead.dx], 3), ax = _b2[0], ay = _b2[1], adx = _b2[2];
                var _c = __read2(node2.getArgMod(ax + adx, ay), 2), b = _c[0], ar2 = _c[1];
                var dy = y + (b > a ? node2.thickness * ar2 * Math.sin(b - a) : 0);
                var dx = x2 + (b > Math.PI / 2 - a ? node2.thickness * ar2 * Math.sin(b + a - Math.PI / 2) : 0);
                return [dy, dx, dy, dx];
              },
              remove: remove2
            }];
          };
        };
        exports2.CommonDiagonalArrow = CommonDiagonalArrow;
        var CommonArrow = function(render2) {
          return function(name2) {
            var _a2 = __read2(exports2.arrowDef[name2], 4), angle2 = _a2[0], double = _a2[1], isVertical = _a2[2], remove2 = _a2[3];
            return [name2 + "arrow", {
              renderer: function(node2, _child) {
                var _a3 = node2.getBBox(), w = _a3.w, h = _a3.h, d = _a3.d;
                var _b2 = __read2(isVertical ? [h + d, "X"] : [w, "Y"], 2), W = _b2[0], offset2 = _b2[1];
                var dd2 = node2.getOffset(offset2);
                var arrow2 = node2.arrow(W, angle2, double, offset2, dd2);
                render2(node2, arrow2);
              },
              bbox: exports2.arrowBBox[name2],
              remove: remove2
            }];
          };
        };
        exports2.CommonArrow = CommonArrow;
      })(Notation$1);
      return Notation$1;
    }
    var hasRequiredMenclose$2;
    function requireMenclose$2() {
      if (hasRequiredMenclose$2) return menclose$1;
      hasRequiredMenclose$2 = 1;
      var __extends2 = menclose$1 && menclose$1.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      var __createBinding2 = menclose$1 && menclose$1.__createBinding || (Object.create ? (function(o, m, k2, k22) {
        if (k22 === void 0) k22 = k2;
        var desc = Object.getOwnPropertyDescriptor(m, k2);
        if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
          desc = { enumerable: true, get: function() {
            return m[k2];
          } };
        }
        Object.defineProperty(o, k22, desc);
      }) : (function(o, m, k2, k22) {
        if (k22 === void 0) k22 = k2;
        o[k22] = m[k2];
      }));
      var __setModuleDefault2 = menclose$1 && menclose$1.__setModuleDefault || (Object.create ? (function(o, v) {
        Object.defineProperty(o, "default", { enumerable: true, value: v });
      }) : function(o, v) {
        o["default"] = v;
      });
      var __importStar2 = menclose$1 && menclose$1.__importStar || function(mod2) {
        if (mod2 && mod2.__esModule) return mod2;
        var result2 = {};
        if (mod2 != null) {
          for (var k2 in mod2) if (k2 !== "default" && Object.prototype.hasOwnProperty.call(mod2, k2)) __createBinding2(result2, mod2, k2);
        }
        __setModuleDefault2(result2, mod2);
        return result2;
      };
      var __read2 = menclose$1 && menclose$1.__read || function(o, n) {
        var m = typeof Symbol === "function" && o[Symbol.iterator];
        if (!m) return o;
        var i2 = m.call(o), r2, ar2 = [], e;
        try {
          while ((n === void 0 || n-- > 0) && !(r2 = i2.next()).done) ar2.push(r2.value);
        } catch (error2) {
          e = { error: error2 };
        } finally {
          try {
            if (r2 && !r2.done && (m = i2["return"])) m.call(i2);
          } finally {
            if (e) throw e.error;
          }
        }
        return ar2;
      };
      var __spreadArray2 = menclose$1 && menclose$1.__spreadArray || function(to2, from, pack) {
        if (pack || arguments.length === 2) for (var i2 = 0, l = from.length, ar2; i2 < l; i2++) {
          if (ar2 || !(i2 in from)) {
            if (!ar2) ar2 = Array.prototype.slice.call(from, 0, i2);
            ar2[i2] = from[i2];
          }
        }
        return to2.concat(ar2 || Array.prototype.slice.call(from));
      };
      var __values2 = menclose$1 && menclose$1.__values || function(o) {
        var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i2 = 0;
        if (m) return m.call(o);
        if (o && typeof o.length === "number") return {
          next: function() {
            if (o && i2 >= o.length) o = void 0;
            return { value: o && o[i2++], done: !o };
          }
        };
        throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
      };
      Object.defineProperty(menclose$1, "__esModule", { value: true });
      menclose$1.CommonMencloseMixin = void 0;
      var Notation2 = __importStar2(requireNotation$1());
      var string_js_1 = requireString();
      function CommonMencloseMixin(Base) {
        return (function(_super) {
          __extends2(class_1, _super);
          function class_1() {
            var args2 = [];
            for (var _i = 0; _i < arguments.length; _i++) {
              args2[_i] = arguments[_i];
            }
            var _this = _super.apply(this, __spreadArray2([], __read2(args2), false)) || this;
            _this.notations = {};
            _this.renderChild = null;
            _this.msqrt = null;
            _this.padding = Notation2.PADDING;
            _this.thickness = Notation2.THICKNESS;
            _this.arrowhead = { x: Notation2.ARROWX, y: Notation2.ARROWY, dx: Notation2.ARROWDX };
            _this.TRBL = [0, 0, 0, 0];
            _this.getParameters();
            _this.getNotations();
            _this.removeRedundantNotations();
            _this.initializeNotations();
            _this.TRBL = _this.getBBoxExtenders();
            return _this;
          }
          class_1.prototype.getParameters = function() {
            var attributes2 = this.node.attributes;
            var padding = attributes2.get("data-padding");
            if (padding !== void 0) {
              this.padding = this.length2em(padding, Notation2.PADDING);
            }
            var thickness = attributes2.get("data-thickness");
            if (thickness !== void 0) {
              this.thickness = this.length2em(thickness, Notation2.THICKNESS);
            }
            var arrowhead = attributes2.get("data-arrowhead");
            if (arrowhead !== void 0) {
              var _b2 = __read2((0, string_js_1.split)(arrowhead), 3), x2 = _b2[0], y = _b2[1], dx = _b2[2];
              this.arrowhead = {
                x: x2 ? parseFloat(x2) : Notation2.ARROWX,
                y: y ? parseFloat(y) : Notation2.ARROWY,
                dx: dx ? parseFloat(dx) : Notation2.ARROWDX
              };
            }
          };
          class_1.prototype.getNotations = function() {
            var e_1, _b2;
            var Notations = this.constructor.notations;
            try {
              for (var _c = __values2((0, string_js_1.split)(this.node.attributes.get("notation"))), _d = _c.next(); !_d.done; _d = _c.next()) {
                var name_1 = _d.value;
                var notation = Notations.get(name_1);
                if (notation) {
                  this.notations[name_1] = notation;
                  if (notation.renderChild) {
                    this.renderChild = notation.renderer;
                  }
                }
              }
            } catch (e_1_1) {
              e_1 = { error: e_1_1 };
            } finally {
              try {
                if (_d && !_d.done && (_b2 = _c.return)) _b2.call(_c);
              } finally {
                if (e_1) throw e_1.error;
              }
            }
          };
          class_1.prototype.removeRedundantNotations = function() {
            var e_2, _b2, e_3, _c;
            try {
              for (var _d = __values2(Object.keys(this.notations)), _e2 = _d.next(); !_e2.done; _e2 = _d.next()) {
                var name_2 = _e2.value;
                if (this.notations[name_2]) {
                  var remove2 = this.notations[name_2].remove || "";
                  try {
                    for (var _f = (e_3 = void 0, __values2(remove2.split(/ /))), _g = _f.next(); !_g.done; _g = _f.next()) {
                      var notation = _g.value;
                      delete this.notations[notation];
                    }
                  } catch (e_3_1) {
                    e_3 = { error: e_3_1 };
                  } finally {
                    try {
                      if (_g && !_g.done && (_c = _f.return)) _c.call(_f);
                    } finally {
                      if (e_3) throw e_3.error;
                    }
                  }
                }
              }
            } catch (e_2_1) {
              e_2 = { error: e_2_1 };
            } finally {
              try {
                if (_e2 && !_e2.done && (_b2 = _d.return)) _b2.call(_d);
              } finally {
                if (e_2) throw e_2.error;
              }
            }
          };
          class_1.prototype.initializeNotations = function() {
            var e_4, _b2;
            try {
              for (var _c = __values2(Object.keys(this.notations)), _d = _c.next(); !_d.done; _d = _c.next()) {
                var name_3 = _d.value;
                var init2 = this.notations[name_3].init;
                init2 && init2(this);
              }
            } catch (e_4_1) {
              e_4 = { error: e_4_1 };
            } finally {
              try {
                if (_d && !_d.done && (_b2 = _c.return)) _b2.call(_c);
              } finally {
                if (e_4) throw e_4.error;
              }
            }
          };
          class_1.prototype.computeBBox = function(bbox, recompute) {
            if (recompute === void 0) {
              recompute = false;
            }
            var _b2 = __read2(this.TRBL, 4), T = _b2[0], R = _b2[1], B = _b2[2], L = _b2[3];
            var child = this.childNodes[0].getBBox();
            bbox.combine(child, L, 0);
            bbox.h += T;
            bbox.d += B;
            bbox.w += R;
            this.setChildPWidths(recompute);
          };
          class_1.prototype.getBBoxExtenders = function() {
            var e_5, _b2;
            var TRBL = [0, 0, 0, 0];
            try {
              for (var _c = __values2(Object.keys(this.notations)), _d = _c.next(); !_d.done; _d = _c.next()) {
                var name_4 = _d.value;
                this.maximizeEntries(TRBL, this.notations[name_4].bbox(this));
              }
            } catch (e_5_1) {
              e_5 = { error: e_5_1 };
            } finally {
              try {
                if (_d && !_d.done && (_b2 = _c.return)) _b2.call(_c);
              } finally {
                if (e_5) throw e_5.error;
              }
            }
            return TRBL;
          };
          class_1.prototype.getPadding = function() {
            var e_6, _b2;
            var _this = this;
            var BTRBL = [0, 0, 0, 0];
            try {
              for (var _c = __values2(Object.keys(this.notations)), _d = _c.next(); !_d.done; _d = _c.next()) {
                var name_5 = _d.value;
                var border = this.notations[name_5].border;
                if (border) {
                  this.maximizeEntries(BTRBL, border(this));
                }
              }
            } catch (e_6_1) {
              e_6 = { error: e_6_1 };
            } finally {
              try {
                if (_d && !_d.done && (_b2 = _c.return)) _b2.call(_c);
              } finally {
                if (e_6) throw e_6.error;
              }
            }
            return [0, 1, 2, 3].map(function(i2) {
              return _this.TRBL[i2] - BTRBL[i2];
            });
          };
          class_1.prototype.maximizeEntries = function(X2, Y2) {
            for (var i2 = 0; i2 < X2.length; i2++) {
              if (X2[i2] < Y2[i2]) {
                X2[i2] = Y2[i2];
              }
            }
          };
          class_1.prototype.getOffset = function(direction) {
            var _b2 = __read2(this.TRBL, 4), T = _b2[0], R = _b2[1], B = _b2[2], L = _b2[3];
            var d = (direction === "X" ? R - L : B - T) / 2;
            return Math.abs(d) > 1e-3 ? d : 0;
          };
          class_1.prototype.getArgMod = function(w, h) {
            return [Math.atan2(h, w), Math.sqrt(w * w + h * h)];
          };
          class_1.prototype.arrow = function(_w, _a2, _double, _offset, _dist) {
            return null;
          };
          class_1.prototype.arrowData = function() {
            var _b2 = __read2([this.padding, this.thickness], 2), p = _b2[0], t2 = _b2[1];
            var r2 = t2 * (this.arrowhead.x + Math.max(1, this.arrowhead.dx));
            var _c = this.childNodes[0].getBBox(), h = _c.h, d = _c.d, w = _c.w;
            var H = h + d;
            var R = Math.sqrt(H * H + w * w);
            var x2 = Math.max(p, r2 * w / R);
            var y = Math.max(p, r2 * H / R);
            var _d = __read2(this.getArgMod(w + 2 * x2, H + 2 * y), 2), a = _d[0], W = _d[1];
            return { a, W, x: x2, y };
          };
          class_1.prototype.arrowAW = function() {
            var _b2 = this.childNodes[0].getBBox(), h = _b2.h, d = _b2.d, w = _b2.w;
            var _c = __read2(this.TRBL, 4), T = _c[0], R = _c[1], B = _c[2], L = _c[3];
            return this.getArgMod(L + w + R, T + h + d + B);
          };
          class_1.prototype.createMsqrt = function(child) {
            var mmlFactory = this.node.factory;
            var mml = mmlFactory.create("msqrt");
            mml.inheritAttributesFrom(this.node);
            mml.childNodes[0] = child.node;
            var node2 = this.wrap(mml);
            node2.parent = this;
            return node2;
          };
          class_1.prototype.sqrtTRBL = function() {
            var bbox = this.msqrt.getBBox();
            var cbox = this.msqrt.childNodes[0].getBBox();
            return [bbox.h - cbox.h, 0, bbox.d - cbox.d, bbox.w - cbox.w];
          };
          return class_1;
        })(Base);
      }
      menclose$1.CommonMencloseMixin = CommonMencloseMixin;
      return menclose$1;
    }
    var Notation = {};
    var hasRequiredNotation;
    function requireNotation() {
      if (hasRequiredNotation) return Notation;
      hasRequiredNotation = 1;
      (function(exports2) {
        var __createBinding2 = Notation && Notation.__createBinding || (Object.create ? (function(o, m, k2, k22) {
          if (k22 === void 0) k22 = k2;
          var desc = Object.getOwnPropertyDescriptor(m, k2);
          if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
            desc = { enumerable: true, get: function() {
              return m[k2];
            } };
          }
          Object.defineProperty(o, k22, desc);
        }) : (function(o, m, k2, k22) {
          if (k22 === void 0) k22 = k2;
          o[k22] = m[k2];
        }));
        var __setModuleDefault2 = Notation && Notation.__setModuleDefault || (Object.create ? (function(o, v) {
          Object.defineProperty(o, "default", { enumerable: true, value: v });
        }) : function(o, v) {
          o["default"] = v;
        });
        var __importStar2 = Notation && Notation.__importStar || function(mod2) {
          if (mod2 && mod2.__esModule) return mod2;
          var result2 = {};
          if (mod2 != null) {
            for (var k2 in mod2) if (k2 !== "default" && Object.prototype.hasOwnProperty.call(mod2, k2)) __createBinding2(result2, mod2, k2);
          }
          __setModuleDefault2(result2, mod2);
          return result2;
        };
        var __exportStar2 = Notation && Notation.__exportStar || function(m, exports3) {
          for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p)) __createBinding2(exports3, m, p);
        };
        Object.defineProperty(exports2, "__esModule", { value: true });
        exports2.Arrow = exports2.DiagonalArrow = exports2.DiagonalStrike = exports2.Border2 = exports2.Border = exports2.RenderLine = exports2.lineOffset = exports2.lineData = exports2.computeLineData = void 0;
        var Notation$12 = __importStar2(requireNotation$1());
        __exportStar2(requireNotation$1(), exports2);
        exports2.computeLineData = {
          top: function(h, _d, w, t2) {
            return [0, h - t2, w, h - t2];
          },
          right: function(h, d, w, t2) {
            return [w - t2, -d, w - t2, h];
          },
          bottom: function(_h, d, w, t2) {
            return [0, t2 - d, w, t2 - d];
          },
          left: function(h, d, _w, t2) {
            return [t2, -d, t2, h];
          },
          vertical: function(h, d, w, _t2) {
            return [w / 2, h, w / 2, -d];
          },
          horizontal: function(h, d, w, _t2) {
            return [0, (h - d) / 2, w, (h - d) / 2];
          },
          up: function(h, d, w, t2) {
            return [t2, t2 - d, w - t2, h - t2];
          },
          down: function(h, d, w, t2) {
            return [t2, h - t2, w - t2, t2 - d];
          }
        };
        var lineData = function(node2, kind, offset2) {
          if (offset2 === void 0) {
            offset2 = "";
          }
          var _a2 = node2.getBBox(), h = _a2.h, d = _a2.d, w = _a2.w;
          var t2 = node2.thickness / 2;
          return (0, exports2.lineOffset)(exports2.computeLineData[kind](h, d, w, t2), node2, offset2);
        };
        exports2.lineData = lineData;
        var lineOffset = function(data, node2, offset2) {
          if (offset2) {
            var d = node2.getOffset(offset2);
            if (d) {
              if (offset2 === "X") {
                data[0] -= d;
                data[2] -= d;
              } else {
                data[1] -= d;
                data[3] -= d;
              }
            }
          }
          return data;
        };
        exports2.lineOffset = lineOffset;
        var RenderLine = function(line2, offset2) {
          if (offset2 === void 0) {
            offset2 = "";
          }
          return (function(node2, _child) {
            var L = node2.line((0, exports2.lineData)(node2, line2, offset2));
            node2.adaptor.append(node2.element, L);
          });
        };
        exports2.RenderLine = RenderLine;
        var Border = function(side) {
          return Notation$12.CommonBorder(function(node2, _child) {
            node2.adaptor.append(node2.element, node2.line((0, exports2.lineData)(node2, side)));
          })(side);
        };
        exports2.Border = Border;
        var Border2 = function(name2, side1, side2) {
          return Notation$12.CommonBorder2(function(node2, _child) {
            node2.adaptor.append(node2.element, node2.line((0, exports2.lineData)(node2, side1)));
            node2.adaptor.append(node2.element, node2.line((0, exports2.lineData)(node2, side2)));
          })(name2, side1, side2);
        };
        exports2.Border2 = Border2;
        var DiagonalStrike = function(name2) {
          return Notation$12.CommonDiagonalStrike(function(_cname) {
            return function(node2, _child) {
              node2.adaptor.append(node2.element, node2.line((0, exports2.lineData)(node2, name2)));
            };
          })(name2);
        };
        exports2.DiagonalStrike = DiagonalStrike;
        var DiagonalArrow = function(name2) {
          return Notation$12.CommonDiagonalArrow(function(node2, arrow2) {
            node2.adaptor.append(node2.element, arrow2);
          })(name2);
        };
        exports2.DiagonalArrow = DiagonalArrow;
        var Arrow = function(name2) {
          return Notation$12.CommonArrow(function(node2, arrow2) {
            node2.adaptor.append(node2.element, arrow2);
          })(name2);
        };
        exports2.Arrow = Arrow;
      })(Notation);
      return Notation;
    }
    var menclose = {};
    var hasRequiredMenclose$1;
    function requireMenclose$1() {
      if (hasRequiredMenclose$1) return menclose;
      hasRequiredMenclose$1 = 1;
      var __extends2 = menclose && menclose.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      var __assign2 = menclose && menclose.__assign || function() {
        __assign2 = Object.assign || function(t2) {
          for (var s, i2 = 1, n = arguments.length; i2 < n; i2++) {
            s = arguments[i2];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
              t2[p] = s[p];
          }
          return t2;
        };
        return __assign2.apply(this, arguments);
      };
      Object.defineProperty(menclose, "__esModule", { value: true });
      menclose.MmlMenclose = void 0;
      var MmlNode_js_1 = requireMmlNode();
      var MmlMenclose = (function(_super) {
        __extends2(MmlMenclose2, _super);
        function MmlMenclose2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.texclass = MmlNode_js_1.TEXCLASS.ORD;
          return _this;
        }
        Object.defineProperty(MmlMenclose2.prototype, "kind", {
          get: function() {
            return "menclose";
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(MmlMenclose2.prototype, "arity", {
          get: function() {
            return -1;
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(MmlMenclose2.prototype, "linebreakContininer", {
          get: function() {
            return true;
          },
          enumerable: false,
          configurable: true
        });
        MmlMenclose2.prototype.setTeXclass = function(prev) {
          prev = this.childNodes[0].setTeXclass(prev);
          this.updateTeXclass(this.childNodes[0]);
          return prev;
        };
        MmlMenclose2.defaults = __assign2(__assign2({}, MmlNode_js_1.AbstractMmlNode.defaults), { notation: "longdiv" });
        return MmlMenclose2;
      })(MmlNode_js_1.AbstractMmlNode);
      menclose.MmlMenclose = MmlMenclose;
      return menclose;
    }
    var hasRequiredMenclose;
    function requireMenclose() {
      if (hasRequiredMenclose) return menclose$2;
      hasRequiredMenclose = 1;
      var __extends2 = menclose$2 && menclose$2.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      var __createBinding2 = menclose$2 && menclose$2.__createBinding || (Object.create ? (function(o, m, k2, k22) {
        if (k22 === void 0) k22 = k2;
        var desc = Object.getOwnPropertyDescriptor(m, k2);
        if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
          desc = { enumerable: true, get: function() {
            return m[k2];
          } };
        }
        Object.defineProperty(o, k22, desc);
      }) : (function(o, m, k2, k22) {
        if (k22 === void 0) k22 = k2;
        o[k22] = m[k2];
      }));
      var __setModuleDefault2 = menclose$2 && menclose$2.__setModuleDefault || (Object.create ? (function(o, v) {
        Object.defineProperty(o, "default", { enumerable: true, value: v });
      }) : function(o, v) {
        o["default"] = v;
      });
      var __importStar2 = menclose$2 && menclose$2.__importStar || function(mod2) {
        if (mod2 && mod2.__esModule) return mod2;
        var result2 = {};
        if (mod2 != null) {
          for (var k2 in mod2) if (k2 !== "default" && Object.prototype.hasOwnProperty.call(mod2, k2)) __createBinding2(result2, mod2, k2);
        }
        __setModuleDefault2(result2, mod2);
        return result2;
      };
      var __values2 = menclose$2 && menclose$2.__values || function(o) {
        var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i2 = 0;
        if (m) return m.call(o);
        if (o && typeof o.length === "number") return {
          next: function() {
            if (o && i2 >= o.length) o = void 0;
            return { value: o && o[i2++], done: !o };
          }
        };
        throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
      };
      var __read2 = menclose$2 && menclose$2.__read || function(o, n) {
        var m = typeof Symbol === "function" && o[Symbol.iterator];
        if (!m) return o;
        var i2 = m.call(o), r2, ar2 = [], e;
        try {
          while ((n === void 0 || n-- > 0) && !(r2 = i2.next()).done) ar2.push(r2.value);
        } catch (error2) {
          e = { error: error2 };
        } finally {
          try {
            if (r2 && !r2.done && (m = i2["return"])) m.call(i2);
          } finally {
            if (e) throw e.error;
          }
        }
        return ar2;
      };
      Object.defineProperty(menclose$2, "__esModule", { value: true });
      menclose$2.SVGmenclose = void 0;
      var Wrapper_js_1 = requireWrapper();
      var menclose_js_1 = requireMenclose$2();
      var Notation2 = __importStar2(requireNotation());
      var menclose_js_2 = requireMenclose$1();
      var SVGmenclose = (function(_super) {
        __extends2(SVGmenclose2, _super);
        function SVGmenclose2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        SVGmenclose2.prototype.toSVG = function(parent) {
          var e_1, _a2;
          var svg2 = this.standardSVGnode(parent);
          var left2 = this.getBBoxExtenders()[3];
          var def = {};
          if (left2 > 0) {
            def.transform = "translate(" + this.fixed(left2) + ", 0)";
          }
          var block2 = this.adaptor.append(svg2, this.svg("g", def));
          if (this.renderChild) {
            this.renderChild(this, block2);
          } else {
            this.childNodes[0].toSVG(block2);
          }
          try {
            for (var _b2 = __values2(Object.keys(this.notations)), _c = _b2.next(); !_c.done; _c = _b2.next()) {
              var name_1 = _c.value;
              var notation = this.notations[name_1];
              !notation.renderChild && notation.renderer(this, svg2);
            }
          } catch (e_1_1) {
            e_1 = { error: e_1_1 };
          } finally {
            try {
              if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
            } finally {
              if (e_1) throw e_1.error;
            }
          }
        };
        SVGmenclose2.prototype.arrow = function(W, a, double, offset2, dist2) {
          if (offset2 === void 0) {
            offset2 = "";
          }
          if (dist2 === void 0) {
            dist2 = 0;
          }
          var _a2 = this.getBBox(), w = _a2.w, h = _a2.h, d = _a2.d;
          var dw = (W - w) / 2;
          var m = (h - d) / 2;
          var t2 = this.thickness;
          var t22 = t2 / 2;
          var _b2 = __read2([t2 * this.arrowhead.x, t2 * this.arrowhead.y, t2 * this.arrowhead.dx], 3), x2 = _b2[0], y = _b2[1], dx = _b2[2];
          var arrow2 = double ? this.fill("M", w + dw, m, "l", -(x2 + dx), y, "l", dx, t22 - y, "L", x2 - dw, m + t22, "l", dx, y - t22, "l", -(x2 + dx), -y, "l", x2 + dx, -y, "l", -dx, y - t22, "L", w + dw - x2, m - t22, "l", -dx, t22 - y, "Z") : this.fill("M", w + dw, m, "l", -(x2 + dx), y, "l", dx, t22 - y, "L", -dw, m + t22, "l", 0, -t2, "L", w + dw - x2, m - t22, "l", -dx, t22 - y, "Z");
          var transform = [];
          if (dist2) {
            transform.push(offset2 === "X" ? "translate(".concat(this.fixed(-dist2), " 0)") : "translate(0 ".concat(this.fixed(dist2), ")"));
          }
          if (a) {
            var A2 = this.jax.fixed(-a * 180 / Math.PI);
            transform.push("rotate(".concat(A2, " ").concat(this.fixed(w / 2), " ").concat(this.fixed(m), ")"));
          }
          if (transform.length) {
            this.adaptor.setAttribute(arrow2, "transform", transform.join(" "));
          }
          return arrow2;
        };
        SVGmenclose2.prototype.line = function(pq) {
          var _a2 = __read2(pq, 4), x1 = _a2[0], y1 = _a2[1], x2 = _a2[2], y2 = _a2[3];
          return this.svg("line", {
            x1: this.fixed(x1),
            y1: this.fixed(y1),
            x2: this.fixed(x2),
            y2: this.fixed(y2),
            "stroke-width": this.fixed(this.thickness)
          });
        };
        SVGmenclose2.prototype.box = function(w, h, d, r2) {
          if (r2 === void 0) {
            r2 = 0;
          }
          var t2 = this.thickness;
          var def = {
            x: this.fixed(t2 / 2),
            y: this.fixed(t2 / 2 - d),
            width: this.fixed(w - t2),
            height: this.fixed(h + d - t2),
            fill: "none",
            "stroke-width": this.fixed(t2)
          };
          if (r2) {
            def.rx = this.fixed(r2);
          }
          return this.svg("rect", def);
        };
        SVGmenclose2.prototype.ellipse = function(w, h, d) {
          var t2 = this.thickness;
          return this.svg("ellipse", {
            rx: this.fixed((w - t2) / 2),
            ry: this.fixed((h + d - t2) / 2),
            cx: this.fixed(w / 2),
            cy: this.fixed((h - d) / 2),
            "fill": "none",
            "stroke-width": this.fixed(t2)
          });
        };
        SVGmenclose2.prototype.path = function(join2) {
          var _this = this;
          var P2 = [];
          for (var _i = 1; _i < arguments.length; _i++) {
            P2[_i - 1] = arguments[_i];
          }
          return this.svg("path", {
            d: P2.map(function(x2) {
              return typeof x2 === "string" ? x2 : _this.fixed(x2);
            }).join(" "),
            style: { "stroke-width": this.fixed(this.thickness) },
            "stroke-linecap": "round",
            "stroke-linejoin": join2,
            fill: "none"
          });
        };
        SVGmenclose2.prototype.fill = function() {
          var _this = this;
          var P2 = [];
          for (var _i = 0; _i < arguments.length; _i++) {
            P2[_i] = arguments[_i];
          }
          return this.svg("path", {
            d: P2.map(function(x2) {
              return typeof x2 === "string" ? x2 : _this.fixed(x2);
            }).join(" ")
          });
        };
        SVGmenclose2.kind = menclose_js_2.MmlMenclose.prototype.kind;
        SVGmenclose2.notations = new Map([
          Notation2.Border("top"),
          Notation2.Border("right"),
          Notation2.Border("bottom"),
          Notation2.Border("left"),
          Notation2.Border2("actuarial", "top", "right"),
          Notation2.Border2("madruwb", "bottom", "right"),
          Notation2.DiagonalStrike("up"),
          Notation2.DiagonalStrike("down"),
          ["horizontalstrike", {
            renderer: Notation2.RenderLine("horizontal", "Y"),
            bbox: function(node2) {
              return [0, node2.padding, 0, node2.padding];
            }
          }],
          ["verticalstrike", {
            renderer: Notation2.RenderLine("vertical", "X"),
            bbox: function(node2) {
              return [node2.padding, 0, node2.padding, 0];
            }
          }],
          ["box", {
            renderer: function(node2, _child) {
              var _a2 = node2.getBBox(), w = _a2.w, h = _a2.h, d = _a2.d;
              node2.adaptor.append(node2.element, node2.box(w, h, d));
            },
            bbox: Notation2.fullBBox,
            border: Notation2.fullBorder,
            remove: "left right top bottom"
          }],
          ["roundedbox", {
            renderer: function(node2, _child) {
              var _a2 = node2.getBBox(), w = _a2.w, h = _a2.h, d = _a2.d;
              var r2 = node2.thickness + node2.padding;
              node2.adaptor.append(node2.element, node2.box(w, h, d, r2));
            },
            bbox: Notation2.fullBBox
          }],
          ["circle", {
            renderer: function(node2, _child) {
              var _a2 = node2.getBBox(), w = _a2.w, h = _a2.h, d = _a2.d;
              node2.adaptor.append(node2.element, node2.ellipse(w, h, d));
            },
            bbox: Notation2.fullBBox
          }],
          ["phasorangle", {
            renderer: function(node2, _child) {
              var _a2 = node2.getBBox(), w = _a2.w, h = _a2.h, d = _a2.d;
              var a = node2.getArgMod(1.75 * node2.padding, h + d)[0];
              var t2 = node2.thickness / 2;
              var HD = h + d;
              var cos = Math.cos(a);
              node2.adaptor.append(node2.element, node2.path("mitre", "M", w, t2 - d, "L", t2 + cos * t2, t2 - d, "L", cos * HD + t2, HD - d - t2));
            },
            bbox: function(node2) {
              var p = node2.padding / 2;
              var t2 = node2.thickness;
              return [2 * p, p, p + t2, 3 * p + t2];
            },
            border: function(node2) {
              return [0, 0, node2.thickness, 0];
            },
            remove: "bottom"
          }],
          Notation2.Arrow("up"),
          Notation2.Arrow("down"),
          Notation2.Arrow("left"),
          Notation2.Arrow("right"),
          Notation2.Arrow("updown"),
          Notation2.Arrow("leftright"),
          Notation2.DiagonalArrow("updiagonal"),
          Notation2.DiagonalArrow("northeast"),
          Notation2.DiagonalArrow("southeast"),
          Notation2.DiagonalArrow("northwest"),
          Notation2.DiagonalArrow("southwest"),
          Notation2.DiagonalArrow("northeastsouthwest"),
          Notation2.DiagonalArrow("northwestsoutheast"),
          ["longdiv", {
            renderer: function(node2, _child) {
              var _a2 = node2.getBBox(), w = _a2.w, h = _a2.h, d = _a2.d;
              var t2 = node2.thickness / 2;
              var p = node2.padding;
              node2.adaptor.append(node2.element, node2.path("round", "M", t2, t2 - d, "a", p - t2 / 2, (h + d) / 2 - 4 * t2, 0, "0,1", 0, h + d - 2 * t2, "L", w - t2, h - t2));
            },
            bbox: function(node2) {
              var p = node2.padding;
              var t2 = node2.thickness;
              return [p + t2, p, p, 2 * p + t2 / 2];
            }
          }],
          ["radical", {
            renderer: function(node2, child) {
              node2.msqrt.toSVG(child);
              var left2 = node2.sqrtTRBL()[3];
              node2.place(-left2, 0, child);
            },
            init: function(node2) {
              node2.msqrt = node2.createMsqrt(node2.childNodes[0]);
            },
            bbox: function(node2) {
              return node2.sqrtTRBL();
            },
            renderChild: true
          }]
        ]);
        return SVGmenclose2;
      })((0, menclose_js_1.CommonMencloseMixin)(Wrapper_js_1.SVGWrapper));
      menclose$2.SVGmenclose = SVGmenclose;
      return menclose$2;
    }
    var semantics$2 = {};
    var semantics$1 = {};
    var hasRequiredSemantics$2;
    function requireSemantics$2() {
      if (hasRequiredSemantics$2) return semantics$1;
      hasRequiredSemantics$2 = 1;
      var __extends2 = semantics$1 && semantics$1.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      Object.defineProperty(semantics$1, "__esModule", { value: true });
      semantics$1.CommonSemanticsMixin = void 0;
      function CommonSemanticsMixin(Base) {
        return (function(_super) {
          __extends2(class_1, _super);
          function class_1() {
            return _super !== null && _super.apply(this, arguments) || this;
          }
          class_1.prototype.computeBBox = function(bbox, _recompute) {
            if (this.childNodes.length) {
              var _a2 = this.childNodes[0].getBBox(), w = _a2.w, h = _a2.h, d = _a2.d;
              bbox.w = w;
              bbox.h = h;
              bbox.d = d;
            }
          };
          return class_1;
        })(Base);
      }
      semantics$1.CommonSemanticsMixin = CommonSemanticsMixin;
      return semantics$1;
    }
    var semantics = {};
    var hasRequiredSemantics$1;
    function requireSemantics$1() {
      if (hasRequiredSemantics$1) return semantics;
      hasRequiredSemantics$1 = 1;
      var __extends2 = semantics && semantics.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      var __assign2 = semantics && semantics.__assign || function() {
        __assign2 = Object.assign || function(t2) {
          for (var s, i2 = 1, n = arguments.length; i2 < n; i2++) {
            s = arguments[i2];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
              t2[p] = s[p];
          }
          return t2;
        };
        return __assign2.apply(this, arguments);
      };
      Object.defineProperty(semantics, "__esModule", { value: true });
      semantics.MmlAnnotation = semantics.MmlAnnotationXML = semantics.MmlSemantics = void 0;
      var MmlNode_js_1 = requireMmlNode();
      var MmlSemantics = (function(_super) {
        __extends2(MmlSemantics2, _super);
        function MmlSemantics2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        Object.defineProperty(MmlSemantics2.prototype, "kind", {
          get: function() {
            return "semantics";
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(MmlSemantics2.prototype, "arity", {
          get: function() {
            return 1;
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(MmlSemantics2.prototype, "notParent", {
          get: function() {
            return true;
          },
          enumerable: false,
          configurable: true
        });
        MmlSemantics2.defaults = __assign2(__assign2({}, MmlNode_js_1.AbstractMmlBaseNode.defaults), { definitionUrl: null, encoding: null });
        return MmlSemantics2;
      })(MmlNode_js_1.AbstractMmlBaseNode);
      semantics.MmlSemantics = MmlSemantics;
      var MmlAnnotationXML = (function(_super) {
        __extends2(MmlAnnotationXML2, _super);
        function MmlAnnotationXML2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        Object.defineProperty(MmlAnnotationXML2.prototype, "kind", {
          get: function() {
            return "annotation-xml";
          },
          enumerable: false,
          configurable: true
        });
        MmlAnnotationXML2.prototype.setChildInheritedAttributes = function() {
        };
        MmlAnnotationXML2.defaults = __assign2(__assign2({}, MmlNode_js_1.AbstractMmlNode.defaults), { definitionUrl: null, encoding: null, cd: "mathmlkeys", name: "", src: null });
        return MmlAnnotationXML2;
      })(MmlNode_js_1.AbstractMmlNode);
      semantics.MmlAnnotationXML = MmlAnnotationXML;
      var MmlAnnotation = (function(_super) {
        __extends2(MmlAnnotation2, _super);
        function MmlAnnotation2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.properties = {
            isChars: true
          };
          return _this;
        }
        Object.defineProperty(MmlAnnotation2.prototype, "kind", {
          get: function() {
            return "annotation";
          },
          enumerable: false,
          configurable: true
        });
        MmlAnnotation2.defaults = __assign2({}, MmlAnnotationXML.defaults);
        return MmlAnnotation2;
      })(MmlAnnotationXML);
      semantics.MmlAnnotation = MmlAnnotation;
      return semantics;
    }
    var hasRequiredSemantics;
    function requireSemantics() {
      if (hasRequiredSemantics) return semantics$2;
      hasRequiredSemantics = 1;
      var __extends2 = semantics$2 && semantics$2.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      Object.defineProperty(semantics$2, "__esModule", { value: true });
      semantics$2.SVGxml = semantics$2.SVGannotationXML = semantics$2.SVGannotation = semantics$2.SVGsemantics = void 0;
      var Wrapper_js_1 = requireWrapper();
      var semantics_js_1 = requireSemantics$2();
      var semantics_js_2 = requireSemantics$1();
      var MmlNode_js_1 = requireMmlNode();
      var SVGsemantics = (function(_super) {
        __extends2(SVGsemantics2, _super);
        function SVGsemantics2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        SVGsemantics2.prototype.toSVG = function(parent) {
          var svg2 = this.standardSVGnode(parent);
          if (this.childNodes.length) {
            this.childNodes[0].toSVG(svg2);
          }
        };
        SVGsemantics2.kind = semantics_js_2.MmlSemantics.prototype.kind;
        return SVGsemantics2;
      })((0, semantics_js_1.CommonSemanticsMixin)(Wrapper_js_1.SVGWrapper));
      semantics$2.SVGsemantics = SVGsemantics;
      var SVGannotation = (function(_super) {
        __extends2(SVGannotation2, _super);
        function SVGannotation2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        SVGannotation2.prototype.toSVG = function(parent) {
          _super.prototype.toSVG.call(this, parent);
        };
        SVGannotation2.prototype.computeBBox = function() {
          return this.bbox;
        };
        SVGannotation2.kind = semantics_js_2.MmlAnnotation.prototype.kind;
        return SVGannotation2;
      })(Wrapper_js_1.SVGWrapper);
      semantics$2.SVGannotation = SVGannotation;
      var SVGannotationXML = (function(_super) {
        __extends2(SVGannotationXML2, _super);
        function SVGannotationXML2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        SVGannotationXML2.kind = semantics_js_2.MmlAnnotationXML.prototype.kind;
        SVGannotationXML2.styles = {
          "foreignObject[data-mjx-xml]": {
            "font-family": "initial",
            "line-height": "normal",
            overflow: "visible"
          }
        };
        return SVGannotationXML2;
      })(Wrapper_js_1.SVGWrapper);
      semantics$2.SVGannotationXML = SVGannotationXML;
      var SVGxml = (function(_super) {
        __extends2(SVGxml2, _super);
        function SVGxml2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        SVGxml2.prototype.toSVG = function(parent) {
          var xml = this.adaptor.clone(this.node.getXML());
          var em = this.jax.math.metrics.em * this.jax.math.metrics.scale;
          var scale = this.fixed(1 / em);
          var _a2 = this.getBBox(), w = _a2.w, h = _a2.h, d = _a2.d;
          this.element = this.adaptor.append(parent, this.svg("foreignObject", {
            "data-mjx-xml": true,
            y: this.jax.fixed(-h * em) + "px",
            width: this.jax.fixed(w * em) + "px",
            height: this.jax.fixed((h + d) * em) + "px",
            transform: "scale(".concat(scale, ") matrix(1 0 0 -1 0 0)")
          }, [xml]));
        };
        SVGxml2.prototype.computeBBox = function(bbox, _recompute) {
          var _a2 = this.jax.measureXMLnode(this.node.getXML()), w = _a2.w, h = _a2.h, d = _a2.d;
          bbox.w = w;
          bbox.h = h;
          bbox.d = d;
        };
        SVGxml2.prototype.getStyles = function() {
        };
        SVGxml2.prototype.getScale = function() {
        };
        SVGxml2.prototype.getVariant = function() {
        };
        SVGxml2.kind = MmlNode_js_1.XMLNode.prototype.kind;
        SVGxml2.autoStyle = false;
        return SVGxml2;
      })(Wrapper_js_1.SVGWrapper);
      semantics$2.SVGxml = SVGxml;
      return semantics$2;
    }
    var mglyph$2 = {};
    var mglyph$1 = {};
    var hasRequiredMglyph$2;
    function requireMglyph$2() {
      if (hasRequiredMglyph$2) return mglyph$1;
      hasRequiredMglyph$2 = 1;
      var __extends2 = mglyph$1 && mglyph$1.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      var __read2 = mglyph$1 && mglyph$1.__read || function(o, n) {
        var m = typeof Symbol === "function" && o[Symbol.iterator];
        if (!m) return o;
        var i2 = m.call(o), r2, ar2 = [], e;
        try {
          while ((n === void 0 || n-- > 0) && !(r2 = i2.next()).done) ar2.push(r2.value);
        } catch (error2) {
          e = { error: error2 };
        } finally {
          try {
            if (r2 && !r2.done && (m = i2["return"])) m.call(i2);
          } finally {
            if (e) throw e.error;
          }
        }
        return ar2;
      };
      var __spreadArray2 = mglyph$1 && mglyph$1.__spreadArray || function(to2, from, pack) {
        if (pack || arguments.length === 2) for (var i2 = 0, l = from.length, ar2; i2 < l; i2++) {
          if (ar2 || !(i2 in from)) {
            if (!ar2) ar2 = Array.prototype.slice.call(from, 0, i2);
            ar2[i2] = from[i2];
          }
        }
        return to2.concat(ar2 || Array.prototype.slice.call(from));
      };
      Object.defineProperty(mglyph$1, "__esModule", { value: true });
      mglyph$1.CommonMglyphMixin = void 0;
      function CommonMglyphMixin(Base) {
        return (function(_super) {
          __extends2(class_1, _super);
          function class_1() {
            var args2 = [];
            for (var _i = 0; _i < arguments.length; _i++) {
              args2[_i] = arguments[_i];
            }
            var _this = _super.apply(this, __spreadArray2([], __read2(args2), false)) || this;
            _this.getParameters();
            return _this;
          }
          class_1.prototype.getParameters = function() {
            var _a2 = this.node.attributes.getList("width", "height", "valign", "src", "index"), width = _a2.width, height = _a2.height, valign = _a2.valign, src = _a2.src, index = _a2.index;
            if (src) {
              this.width = width === "auto" ? 1 : this.length2em(width);
              this.height = height === "auto" ? 1 : this.length2em(height);
              this.valign = this.length2em(valign || "0");
            } else {
              var text2 = String.fromCodePoint(parseInt(index));
              var mmlFactory = this.node.factory;
              this.charWrapper = this.wrap(mmlFactory.create("text").setText(text2));
              this.charWrapper.parent = this;
            }
          };
          class_1.prototype.computeBBox = function(bbox, _recompute) {
            if (this.charWrapper) {
              bbox.updateFrom(this.charWrapper.getBBox());
            } else {
              bbox.w = this.width;
              bbox.h = this.height + this.valign;
              bbox.d = -this.valign;
            }
          };
          return class_1;
        })(Base);
      }
      mglyph$1.CommonMglyphMixin = CommonMglyphMixin;
      return mglyph$1;
    }
    var mglyph = {};
    var hasRequiredMglyph$1;
    function requireMglyph$1() {
      if (hasRequiredMglyph$1) return mglyph;
      hasRequiredMglyph$1 = 1;
      var __extends2 = mglyph && mglyph.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      var __assign2 = mglyph && mglyph.__assign || function() {
        __assign2 = Object.assign || function(t2) {
          for (var s, i2 = 1, n = arguments.length; i2 < n; i2++) {
            s = arguments[i2];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
              t2[p] = s[p];
          }
          return t2;
        };
        return __assign2.apply(this, arguments);
      };
      Object.defineProperty(mglyph, "__esModule", { value: true });
      mglyph.MmlMglyph = void 0;
      var MmlNode_js_1 = requireMmlNode();
      var MmlMglyph = (function(_super) {
        __extends2(MmlMglyph2, _super);
        function MmlMglyph2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.texclass = MmlNode_js_1.TEXCLASS.ORD;
          return _this;
        }
        Object.defineProperty(MmlMglyph2.prototype, "kind", {
          get: function() {
            return "mglyph";
          },
          enumerable: false,
          configurable: true
        });
        MmlMglyph2.prototype.verifyAttributes = function(options2) {
          var _a2 = this.attributes.getList("src", "fontfamily", "index"), src = _a2.src, fontfamily = _a2.fontfamily, index = _a2.index;
          if (src === "" && (fontfamily === "" || index === "")) {
            this.mError("mglyph must have either src or fontfamily and index attributes", options2, true);
          } else {
            _super.prototype.verifyAttributes.call(this, options2);
          }
        };
        MmlMglyph2.defaults = __assign2(__assign2({}, MmlNode_js_1.AbstractMmlTokenNode.defaults), { alt: "", src: "", index: "", width: "auto", height: "auto", valign: "0em" });
        return MmlMglyph2;
      })(MmlNode_js_1.AbstractMmlTokenNode);
      mglyph.MmlMglyph = MmlMglyph;
      return mglyph;
    }
    var hasRequiredMglyph;
    function requireMglyph() {
      if (hasRequiredMglyph) return mglyph$2;
      hasRequiredMglyph = 1;
      var __extends2 = mglyph$2 && mglyph$2.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      Object.defineProperty(mglyph$2, "__esModule", { value: true });
      mglyph$2.SVGmglyph = void 0;
      var Wrapper_js_1 = requireWrapper();
      var mglyph_js_1 = requireMglyph$2();
      var mglyph_js_2 = requireMglyph$1();
      var SVGmglyph = (function(_super) {
        __extends2(SVGmglyph2, _super);
        function SVGmglyph2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        SVGmglyph2.prototype.toSVG = function(parent) {
          var svg2 = this.standardSVGnode(parent);
          if (this.charWrapper) {
            this.charWrapper.toSVG(svg2);
            return;
          }
          var _a2 = this.node.attributes.getList("src", "alt"), src = _a2.src, alt = _a2.alt;
          var h = this.fixed(this.height);
          var w = this.fixed(this.width);
          var y = this.fixed(this.height + (this.valign || 0));
          var properties = {
            width: w,
            height: h,
            transform: "translate(0 " + y + ") matrix(1 0 0 -1 0 0)",
            preserveAspectRatio: "none",
            "aria-label": alt,
            href: src
          };
          var img = this.svg("image", properties);
          this.adaptor.append(svg2, img);
        };
        SVGmglyph2.kind = mglyph_js_2.MmlMglyph.prototype.kind;
        return SVGmglyph2;
      })((0, mglyph_js_1.CommonMglyphMixin)(Wrapper_js_1.SVGWrapper));
      mglyph$2.SVGmglyph = SVGmglyph;
      return mglyph$2;
    }
    var TeXAtom$2 = {};
    var TeXAtom$1 = {};
    var hasRequiredTeXAtom$2;
    function requireTeXAtom$2() {
      if (hasRequiredTeXAtom$2) return TeXAtom$1;
      hasRequiredTeXAtom$2 = 1;
      var __extends2 = TeXAtom$1 && TeXAtom$1.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      Object.defineProperty(TeXAtom$1, "__esModule", { value: true });
      TeXAtom$1.CommonTeXAtomMixin = void 0;
      var MmlNode_js_1 = requireMmlNode();
      function CommonTeXAtomMixin(Base) {
        return (function(_super) {
          __extends2(class_1, _super);
          function class_1() {
            return _super !== null && _super.apply(this, arguments) || this;
          }
          class_1.prototype.computeBBox = function(bbox, recompute) {
            if (recompute === void 0) {
              recompute = false;
            }
            _super.prototype.computeBBox.call(this, bbox, recompute);
            if (this.childNodes[0] && this.childNodes[0].bbox.ic) {
              bbox.ic = this.childNodes[0].bbox.ic;
            }
            if (this.node.texClass === MmlNode_js_1.TEXCLASS.VCENTER) {
              var h = bbox.h, d = bbox.d;
              var a = this.font.params.axis_height;
              var dh = (h + d) / 2 + a - h;
              bbox.h += dh;
              bbox.d -= dh;
            }
          };
          return class_1;
        })(Base);
      }
      TeXAtom$1.CommonTeXAtomMixin = CommonTeXAtomMixin;
      return TeXAtom$1;
    }
    var TeXAtom = {};
    var hasRequiredTeXAtom$1;
    function requireTeXAtom$1() {
      if (hasRequiredTeXAtom$1) return TeXAtom;
      hasRequiredTeXAtom$1 = 1;
      var __extends2 = TeXAtom && TeXAtom.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      var __assign2 = TeXAtom && TeXAtom.__assign || function() {
        __assign2 = Object.assign || function(t2) {
          for (var s, i2 = 1, n = arguments.length; i2 < n; i2++) {
            s = arguments[i2];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
              t2[p] = s[p];
          }
          return t2;
        };
        return __assign2.apply(this, arguments);
      };
      Object.defineProperty(TeXAtom, "__esModule", { value: true });
      TeXAtom.TeXAtom = void 0;
      var MmlNode_js_1 = requireMmlNode();
      var mo_js_1 = requireMo$2();
      var TeXAtom$12 = (function(_super) {
        __extends2(TeXAtom2, _super);
        function TeXAtom2(factory, attributes2, children2) {
          var _this = _super.call(this, factory, attributes2, children2) || this;
          _this.texclass = MmlNode_js_1.TEXCLASS.ORD;
          _this.setProperty("texClass", _this.texClass);
          return _this;
        }
        Object.defineProperty(TeXAtom2.prototype, "kind", {
          get: function() {
            return "TeXAtom";
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(TeXAtom2.prototype, "arity", {
          get: function() {
            return -1;
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(TeXAtom2.prototype, "notParent", {
          get: function() {
            return this.childNodes[0] && this.childNodes[0].childNodes.length === 1;
          },
          enumerable: false,
          configurable: true
        });
        TeXAtom2.prototype.setTeXclass = function(prev) {
          this.childNodes[0].setTeXclass(null);
          return this.adjustTeXclass(prev);
        };
        TeXAtom2.prototype.adjustTeXclass = function(prev) {
          return prev;
        };
        TeXAtom2.defaults = __assign2({}, MmlNode_js_1.AbstractMmlBaseNode.defaults);
        return TeXAtom2;
      })(MmlNode_js_1.AbstractMmlBaseNode);
      TeXAtom.TeXAtom = TeXAtom$12;
      TeXAtom$12.prototype.adjustTeXclass = mo_js_1.MmlMo.prototype.adjustTeXclass;
      return TeXAtom;
    }
    var hasRequiredTeXAtom;
    function requireTeXAtom() {
      if (hasRequiredTeXAtom) return TeXAtom$2;
      hasRequiredTeXAtom = 1;
      var __extends2 = TeXAtom$2 && TeXAtom$2.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      Object.defineProperty(TeXAtom$2, "__esModule", { value: true });
      TeXAtom$2.SVGTeXAtom = void 0;
      var Wrapper_js_1 = requireWrapper();
      var TeXAtom_js_1 = requireTeXAtom$2();
      var TeXAtom_js_2 = requireTeXAtom$1();
      var MmlNode_js_1 = requireMmlNode();
      var SVGTeXAtom = (function(_super) {
        __extends2(SVGTeXAtom2, _super);
        function SVGTeXAtom2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        SVGTeXAtom2.prototype.toSVG = function(parent) {
          _super.prototype.toSVG.call(this, parent);
          this.adaptor.setAttribute(this.element, "data-mjx-texclass", MmlNode_js_1.TEXCLASSNAMES[this.node.texClass]);
          if (this.node.texClass === MmlNode_js_1.TEXCLASS.VCENTER) {
            var bbox = this.childNodes[0].getBBox();
            var h = bbox.h, d = bbox.d;
            var a = this.font.params.axis_height;
            var dh = (h + d) / 2 + a - h;
            var translate = "translate(0 " + this.fixed(dh) + ")";
            this.adaptor.setAttribute(this.element, "transform", translate);
          }
        };
        SVGTeXAtom2.kind = TeXAtom_js_2.TeXAtom.prototype.kind;
        return SVGTeXAtom2;
      })((0, TeXAtom_js_1.CommonTeXAtomMixin)(Wrapper_js_1.SVGWrapper));
      TeXAtom$2.SVGTeXAtom = SVGTeXAtom;
      return TeXAtom$2;
    }
    var TextNode$2 = {};
    var TextNode$1 = {};
    var hasRequiredTextNode$1;
    function requireTextNode$1() {
      if (hasRequiredTextNode$1) return TextNode$1;
      hasRequiredTextNode$1 = 1;
      var __extends2 = TextNode$1 && TextNode$1.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      var __values2 = TextNode$1 && TextNode$1.__values || function(o) {
        var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i2 = 0;
        if (m) return m.call(o);
        if (o && typeof o.length === "number") return {
          next: function() {
            if (o && i2 >= o.length) o = void 0;
            return { value: o && o[i2++], done: !o };
          }
        };
        throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
      };
      var __read2 = TextNode$1 && TextNode$1.__read || function(o, n) {
        var m = typeof Symbol === "function" && o[Symbol.iterator];
        if (!m) return o;
        var i2 = m.call(o), r2, ar2 = [], e;
        try {
          while ((n === void 0 || n-- > 0) && !(r2 = i2.next()).done) ar2.push(r2.value);
        } catch (error2) {
          e = { error: error2 };
        } finally {
          try {
            if (r2 && !r2.done && (m = i2["return"])) m.call(i2);
          } finally {
            if (e) throw e.error;
          }
        }
        return ar2;
      };
      Object.defineProperty(TextNode$1, "__esModule", { value: true });
      TextNode$1.CommonTextNodeMixin = void 0;
      function CommonTextNodeMixin(Base) {
        return (function(_super) {
          __extends2(class_1, _super);
          function class_1() {
            return _super !== null && _super.apply(this, arguments) || this;
          }
          class_1.prototype.computeBBox = function(bbox, _recompute) {
            var e_1, _a2;
            var variant = this.parent.variant;
            var text2 = this.node.getText();
            if (variant === "-explicitFont") {
              var font = this.jax.getFontData(this.parent.styles);
              var _b2 = this.jax.measureText(text2, variant, font), w = _b2.w, h = _b2.h, d = _b2.d;
              bbox.h = h;
              bbox.d = d;
              bbox.w = w;
            } else {
              var chars = this.remappedText(text2, variant);
              bbox.empty();
              try {
                for (var chars_1 = __values2(chars), chars_1_1 = chars_1.next(); !chars_1_1.done; chars_1_1 = chars_1.next()) {
                  var char = chars_1_1.value;
                  var _c = __read2(this.getVariantChar(variant, char), 4), h = _c[0], d = _c[1], w = _c[2], data = _c[3];
                  if (data.unknown) {
                    var cbox = this.jax.measureText(String.fromCodePoint(char), variant);
                    w = cbox.w;
                    h = cbox.h;
                    d = cbox.d;
                  }
                  bbox.w += w;
                  if (h > bbox.h)
                    bbox.h = h;
                  if (d > bbox.d)
                    bbox.d = d;
                  bbox.ic = data.ic || 0;
                  bbox.sk = data.sk || 0;
                  bbox.dx = data.dx || 0;
                }
              } catch (e_1_1) {
                e_1 = { error: e_1_1 };
              } finally {
                try {
                  if (chars_1_1 && !chars_1_1.done && (_a2 = chars_1.return)) _a2.call(chars_1);
                } finally {
                  if (e_1) throw e_1.error;
                }
              }
              if (chars.length > 1) {
                bbox.sk = 0;
              }
              bbox.clean();
            }
          };
          class_1.prototype.remappedText = function(text2, variant) {
            var c2 = this.parent.stretch.c;
            return c2 ? [c2] : this.parent.remapChars(this.unicodeChars(text2, variant));
          };
          class_1.prototype.getStyles = function() {
          };
          class_1.prototype.getVariant = function() {
          };
          class_1.prototype.getScale = function() {
          };
          class_1.prototype.getSpace = function() {
          };
          return class_1;
        })(Base);
      }
      TextNode$1.CommonTextNodeMixin = CommonTextNodeMixin;
      return TextNode$1;
    }
    var hasRequiredTextNode;
    function requireTextNode() {
      if (hasRequiredTextNode) return TextNode$2;
      hasRequiredTextNode = 1;
      var __extends2 = TextNode$2 && TextNode$2.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      var __values2 = TextNode$2 && TextNode$2.__values || function(o) {
        var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i2 = 0;
        if (m) return m.call(o);
        if (o && typeof o.length === "number") return {
          next: function() {
            if (o && i2 >= o.length) o = void 0;
            return { value: o && o[i2++], done: !o };
          }
        };
        throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
      };
      Object.defineProperty(TextNode$2, "__esModule", { value: true });
      TextNode$2.SVGTextNode = void 0;
      var MmlNode_js_1 = requireMmlNode();
      var Wrapper_js_1 = requireWrapper();
      var TextNode_js_1 = requireTextNode$1();
      var SVGTextNode = (function(_super) {
        __extends2(SVGTextNode2, _super);
        function SVGTextNode2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        SVGTextNode2.prototype.toSVG = function(parent) {
          var e_1, _a2;
          var text2 = this.node.getText();
          var variant = this.parent.variant;
          if (text2.length === 0)
            return;
          if (variant === "-explicitFont") {
            this.element = this.adaptor.append(parent, this.jax.unknownText(text2, variant));
          } else {
            var chars = this.remappedText(text2, variant);
            if (this.parent.childNodes.length > 1) {
              parent = this.element = this.adaptor.append(parent, this.svg("g", { "data-mml-node": "text" }));
            }
            var x2 = 0;
            try {
              for (var chars_1 = __values2(chars), chars_1_1 = chars_1.next(); !chars_1_1.done; chars_1_1 = chars_1.next()) {
                var n = chars_1_1.value;
                x2 += this.placeChar(n, x2, 0, parent, variant);
              }
            } catch (e_1_1) {
              e_1 = { error: e_1_1 };
            } finally {
              try {
                if (chars_1_1 && !chars_1_1.done && (_a2 = chars_1.return)) _a2.call(chars_1);
              } finally {
                if (e_1) throw e_1.error;
              }
            }
          }
        };
        SVGTextNode2.kind = MmlNode_js_1.TextNode.prototype.kind;
        SVGTextNode2.styles = {
          'mjx-container[jax="SVG"] path[data-c], mjx-container[jax="SVG"] use[data-c]': {
            "stroke-width": 3
          }
        };
        return SVGTextNode2;
      })((0, TextNode_js_1.CommonTextNodeMixin)(Wrapper_js_1.SVGWrapper));
      TextNode$2.SVGTextNode = SVGTextNode;
      return TextNode$2;
    }
    var hasRequiredWrappers;
    function requireWrappers() {
      if (hasRequiredWrappers) return Wrappers;
      hasRequiredWrappers = 1;
      var _a2;
      Object.defineProperty(Wrappers, "__esModule", { value: true });
      Wrappers.SVGWrappers = void 0;
      var Wrapper_js_1 = requireWrapper();
      var math_js_1 = requireMath();
      var mrow_js_1 = requireMrow();
      var mi_js_1 = requireMi();
      var mo_js_1 = requireMo();
      var mn_js_1 = requireMn();
      var ms_js_1 = requireMs();
      var mtext_js_1 = requireMtext();
      var merror_js_1 = requireMerror();
      var mspace_js_1 = requireMspace();
      var mpadded_js_1 = requireMpadded();
      var mphantom_js_1 = requireMphantom();
      var mfrac_js_1 = requireMfrac();
      var msqrt_js_1 = requireMsqrt();
      var mroot_js_1 = requireMroot();
      var mfenced_js_1 = requireMfenced();
      var msubsup_js_1 = requireMsubsup();
      var munderover_js_1 = requireMunderover();
      var mmultiscripts_js_1 = requireMmultiscripts();
      var mtable_js_1 = requireMtable();
      var mtr_js_1 = requireMtr();
      var mtd_js_1 = requireMtd();
      var maction_js_1 = requireMaction();
      var menclose_js_1 = requireMenclose();
      var semantics_js_1 = requireSemantics();
      var mglyph_js_1 = requireMglyph();
      var TeXAtom_js_1 = requireTeXAtom();
      var TextNode_js_1 = requireTextNode();
      Wrappers.SVGWrappers = (_a2 = {}, _a2[math_js_1.SVGmath.kind] = math_js_1.SVGmath, _a2[mrow_js_1.SVGmrow.kind] = mrow_js_1.SVGmrow, _a2[mrow_js_1.SVGinferredMrow.kind] = mrow_js_1.SVGinferredMrow, _a2[mi_js_1.SVGmi.kind] = mi_js_1.SVGmi, _a2[mo_js_1.SVGmo.kind] = mo_js_1.SVGmo, _a2[mn_js_1.SVGmn.kind] = mn_js_1.SVGmn, _a2[ms_js_1.SVGms.kind] = ms_js_1.SVGms, _a2[mtext_js_1.SVGmtext.kind] = mtext_js_1.SVGmtext, _a2[merror_js_1.SVGmerror.kind] = merror_js_1.SVGmerror, _a2[mspace_js_1.SVGmspace.kind] = mspace_js_1.SVGmspace, _a2[mpadded_js_1.SVGmpadded.kind] = mpadded_js_1.SVGmpadded, _a2[mphantom_js_1.SVGmphantom.kind] = mphantom_js_1.SVGmphantom, _a2[mfrac_js_1.SVGmfrac.kind] = mfrac_js_1.SVGmfrac, _a2[msqrt_js_1.SVGmsqrt.kind] = msqrt_js_1.SVGmsqrt, _a2[mroot_js_1.SVGmroot.kind] = mroot_js_1.SVGmroot, _a2[mfenced_js_1.SVGmfenced.kind] = mfenced_js_1.SVGmfenced, _a2[msubsup_js_1.SVGmsub.kind] = msubsup_js_1.SVGmsub, _a2[msubsup_js_1.SVGmsup.kind] = msubsup_js_1.SVGmsup, _a2[msubsup_js_1.SVGmsubsup.kind] = msubsup_js_1.SVGmsubsup, _a2[munderover_js_1.SVGmunder.kind] = munderover_js_1.SVGmunder, _a2[munderover_js_1.SVGmover.kind] = munderover_js_1.SVGmover, _a2[munderover_js_1.SVGmunderover.kind] = munderover_js_1.SVGmunderover, _a2[mmultiscripts_js_1.SVGmmultiscripts.kind] = mmultiscripts_js_1.SVGmmultiscripts, _a2[mtable_js_1.SVGmtable.kind] = mtable_js_1.SVGmtable, _a2[mtr_js_1.SVGmtr.kind] = mtr_js_1.SVGmtr, _a2[mtr_js_1.SVGmlabeledtr.kind] = mtr_js_1.SVGmlabeledtr, _a2[mtd_js_1.SVGmtd.kind] = mtd_js_1.SVGmtd, _a2[maction_js_1.SVGmaction.kind] = maction_js_1.SVGmaction, _a2[menclose_js_1.SVGmenclose.kind] = menclose_js_1.SVGmenclose, _a2[semantics_js_1.SVGsemantics.kind] = semantics_js_1.SVGsemantics, _a2[semantics_js_1.SVGannotation.kind] = semantics_js_1.SVGannotation, _a2[semantics_js_1.SVGannotationXML.kind] = semantics_js_1.SVGannotationXML, _a2[semantics_js_1.SVGxml.kind] = semantics_js_1.SVGxml, _a2[mglyph_js_1.SVGmglyph.kind] = mglyph_js_1.SVGmglyph, _a2[TeXAtom_js_1.SVGTeXAtom.kind] = TeXAtom_js_1.SVGTeXAtom, _a2[TextNode_js_1.SVGTextNode.kind] = TextNode_js_1.SVGTextNode, _a2[Wrapper_js_1.SVGWrapper.kind] = Wrapper_js_1.SVGWrapper, _a2);
      return Wrappers;
    }
    var hasRequiredWrapperFactory;
    function requireWrapperFactory() {
      if (hasRequiredWrapperFactory) return WrapperFactory$2;
      hasRequiredWrapperFactory = 1;
      var __extends2 = WrapperFactory$2 && WrapperFactory$2.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      Object.defineProperty(WrapperFactory$2, "__esModule", { value: true });
      WrapperFactory$2.SVGWrapperFactory = void 0;
      var WrapperFactory_js_1 = requireWrapperFactory$1();
      var Wrappers_js_1 = requireWrappers();
      var SVGWrapperFactory = (function(_super) {
        __extends2(SVGWrapperFactory2, _super);
        function SVGWrapperFactory2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.jax = null;
          return _this;
        }
        SVGWrapperFactory2.defaultNodes = Wrappers_js_1.SVGWrappers;
        return SVGWrapperFactory2;
      })(WrapperFactory_js_1.CommonWrapperFactory);
      WrapperFactory$2.SVGWrapperFactory = SVGWrapperFactory;
      return WrapperFactory$2;
    }
    var tex$1 = {};
    var FontData = {};
    var hasRequiredFontData;
    function requireFontData() {
      if (hasRequiredFontData) return FontData;
      hasRequiredFontData = 1;
      (function(exports2) {
        var __extends2 = FontData && FontData.__extends || /* @__PURE__ */ (function() {
          var extendStatics2 = function(d, b) {
            extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
              d2.__proto__ = b2;
            } || function(d2, b2) {
              for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
            };
            return extendStatics2(d, b);
          };
          return function(d, b) {
            if (typeof b !== "function" && b !== null)
              throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
            extendStatics2(d, b);
            function __() {
              this.constructor = d;
            }
            d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
          };
        })();
        var __assign2 = FontData && FontData.__assign || function() {
          __assign2 = Object.assign || function(t2) {
            for (var s, i2 = 1, n = arguments.length; i2 < n; i2++) {
              s = arguments[i2];
              for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
                t2[p] = s[p];
            }
            return t2;
          };
          return __assign2.apply(this, arguments);
        };
        var __createBinding2 = FontData && FontData.__createBinding || (Object.create ? (function(o, m, k2, k22) {
          if (k22 === void 0) k22 = k2;
          var desc = Object.getOwnPropertyDescriptor(m, k2);
          if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
            desc = { enumerable: true, get: function() {
              return m[k2];
            } };
          }
          Object.defineProperty(o, k22, desc);
        }) : (function(o, m, k2, k22) {
          if (k22 === void 0) k22 = k2;
          o[k22] = m[k2];
        }));
        var __exportStar2 = FontData && FontData.__exportStar || function(m, exports3) {
          for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p)) __createBinding2(exports3, m, p);
        };
        var __values2 = FontData && FontData.__values || function(o) {
          var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i2 = 0;
          if (m) return m.call(o);
          if (o && typeof o.length === "number") return {
            next: function() {
              if (o && i2 >= o.length) o = void 0;
              return { value: o && o[i2++], done: !o };
            }
          };
          throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
        };
        Object.defineProperty(exports2, "__esModule", { value: true });
        exports2.AddPaths = exports2.SVGFontData = void 0;
        var FontData_js_1 = requireFontData$1();
        __exportStar2(requireFontData$1(), exports2);
        var SVGFontData = (function(_super) {
          __extends2(SVGFontData2, _super);
          function SVGFontData2() {
            return _super !== null && _super.apply(this, arguments) || this;
          }
          SVGFontData2.charOptions = function(font, n) {
            return _super.charOptions.call(this, font, n);
          };
          SVGFontData2.OPTIONS = __assign2(__assign2({}, FontData_js_1.FontData.OPTIONS), { dynamicPrefix: "./output/svg/fonts" });
          SVGFontData2.JAX = "SVG";
          return SVGFontData2;
        })(FontData_js_1.FontData);
        exports2.SVGFontData = SVGFontData;
        function AddPaths(font, paths, content2) {
          var e_1, _a2, e_2, _b2;
          try {
            for (var _c = __values2(Object.keys(paths)), _d = _c.next(); !_d.done; _d = _c.next()) {
              var c2 = _d.value;
              var n = parseInt(c2);
              SVGFontData.charOptions(font, n).p = paths[n];
            }
          } catch (e_1_1) {
            e_1 = { error: e_1_1 };
          } finally {
            try {
              if (_d && !_d.done && (_a2 = _c.return)) _a2.call(_c);
            } finally {
              if (e_1) throw e_1.error;
            }
          }
          try {
            for (var _e2 = __values2(Object.keys(content2)), _f = _e2.next(); !_f.done; _f = _e2.next()) {
              var c2 = _f.value;
              var n = parseInt(c2);
              SVGFontData.charOptions(font, n).c = content2[n];
            }
          } catch (e_2_1) {
            e_2 = { error: e_2_1 };
          } finally {
            try {
              if (_f && !_f.done && (_b2 = _e2.return)) _b2.call(_e2);
            } finally {
              if (e_2) throw e_2.error;
            }
          }
          return font;
        }
        exports2.AddPaths = AddPaths;
      })(FontData);
      return FontData;
    }
    var tex = {};
    var hasRequiredTex$1;
    function requireTex$1() {
      if (hasRequiredTex$1) return tex;
      hasRequiredTex$1 = 1;
      var __extends2 = tex && tex.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      var __assign2 = tex && tex.__assign || function() {
        __assign2 = Object.assign || function(t2) {
          for (var s, i2 = 1, n = arguments.length; i2 < n; i2++) {
            s = arguments[i2];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
              t2[p] = s[p];
          }
          return t2;
        };
        return __assign2.apply(this, arguments);
      };
      var __read2 = tex && tex.__read || function(o, n) {
        var m = typeof Symbol === "function" && o[Symbol.iterator];
        if (!m) return o;
        var i2 = m.call(o), r2, ar2 = [], e;
        try {
          while ((n === void 0 || n-- > 0) && !(r2 = i2.next()).done) ar2.push(r2.value);
        } catch (error2) {
          e = { error: error2 };
        } finally {
          try {
            if (r2 && !r2.done && (m = i2["return"])) m.call(i2);
          } finally {
            if (e) throw e.error;
          }
        }
        return ar2;
      };
      var __spreadArray2 = tex && tex.__spreadArray || function(to2, from, pack) {
        if (pack || arguments.length === 2) for (var i2 = 0, l = from.length, ar2; i2 < l; i2++) {
          if (ar2 || !(i2 in from)) {
            if (!ar2) ar2 = Array.prototype.slice.call(from, 0, i2);
            ar2[i2] = from[i2];
          }
        }
        return to2.concat(ar2 || Array.prototype.slice.call(from));
      };
      Object.defineProperty(tex, "__esModule", { value: true });
      tex.CommonTeXFontMixin = void 0;
      function CommonTeXFontMixin(Base) {
        var _a2;
        return _a2 = (function(_super) {
          __extends2(class_1, _super);
          function class_1() {
            return _super !== null && _super.apply(this, arguments) || this;
          }
          class_1.prototype.getDelimiterData = function(n) {
            return this.getChar("-smallop", n) || this.getChar("-size4", n);
          };
          return class_1;
        })(Base), _a2.NAME = "TeX", _a2.defaultVariants = __spreadArray2(__spreadArray2([], __read2(Base.defaultVariants), false), [
          ["-smallop", "normal"],
          ["-largeop", "normal"],
          ["-size3", "normal"],
          ["-size4", "normal"],
          ["-tex-calligraphic", "italic"],
          ["-tex-bold-calligraphic", "bold-italic"],
          ["-tex-oldstyle", "normal"],
          ["-tex-bold-oldstyle", "bold"],
          ["-tex-mathit", "italic"],
          ["-tex-variant", "normal"]
        ], false), _a2.defaultCssFonts = __assign2(__assign2({}, Base.defaultCssFonts), { "-smallop": ["serif", false, false], "-largeop": ["serif", false, false], "-size3": ["serif", false, false], "-size4": ["serif", false, false], "-tex-calligraphic": ["cursive", true, false], "-tex-bold-calligraphic": ["cursive", true, true], "-tex-oldstyle": ["serif", false, false], "-tex-bold-oldstyle": ["serif", false, true], "-tex-mathit": ["serif", true, false] }), _a2.defaultSizeVariants = ["normal", "-smallop", "-largeop", "-size3", "-size4", "-tex-variant"], _a2.defaultStretchVariants = ["-size4"], _a2;
      }
      tex.CommonTeXFontMixin = CommonTeXFontMixin;
      return tex;
    }
    var boldItalic$1 = {};
    var boldItalic = {};
    var hasRequiredBoldItalic$1;
    function requireBoldItalic$1() {
      if (hasRequiredBoldItalic$1) return boldItalic;
      hasRequiredBoldItalic$1 = 1;
      Object.defineProperty(boldItalic, "__esModule", { value: true });
      boldItalic.boldItalic = void 0;
      boldItalic.boldItalic = {
        47: [0.711, 0.21, 0.894],
        305: [0.452, 8e-3, 0.394, { sk: 0.0319 }],
        567: [0.451, 0.201, 0.439, { sk: 0.0958 }],
        8260: [0.711, 0.21, 0.894],
        8710: [0.711, 0, 0.958, { sk: 0.192 }],
        10744: [0.711, 0.21, 0.894]
      };
      return boldItalic;
    }
    var hasRequiredBoldItalic;
    function requireBoldItalic() {
      if (hasRequiredBoldItalic) return boldItalic$1;
      hasRequiredBoldItalic = 1;
      Object.defineProperty(boldItalic$1, "__esModule", { value: true });
      boldItalic$1.boldItalic = void 0;
      var FontData_js_1 = requireFontData();
      var bold_italic_js_1 = requireBoldItalic$1();
      boldItalic$1.boldItalic = (0, FontData_js_1.AddPaths)(bold_italic_js_1.boldItalic, {
        47: "189 -210Q179 -210 170 -203T160 -179Q160 -171 162 -166Q164 -163 420 266T679 698Q686 711 704 711Q714 711 723 704T733 681Q733 672 730 667Q723 654 469 228T211 -201Q202 -210 189 -210",
        305: "24 296Q24 305 34 328T63 380T115 430T187 452Q205 452 223 448T262 435T295 406T308 360Q308 345 287 290T240 170T207 87Q202 67 202 57Q202 42 215 42Q235 42 257 64Q288 92 302 140Q307 156 310 159T330 162H336H347Q367 162 367 148Q367 140 357 117T329 65T276 14T201 -8Q158 -8 121 15T83 84Q83 104 133 229T184 358Q189 376 189 388Q189 402 177 402Q156 402 134 380Q103 352 89 304Q84 288 81 285T61 282H55H44Q24 282 24 296",
        567: "297 360T297 373T294 392T288 400T278 401H276Q237 398 200 363Q181 343 170 325T156 299T149 287T129 282H123H116Q102 282 97 284T92 298Q93 303 98 315T118 349T151 390T201 427T267 451H279Q357 451 388 422T420 354V339L370 138Q321 -60 317 -69Q287 -157 163 -194Q133 -201 99 -201Q39 -201 14 -178T-12 -125Q-12 -94 11 -69T68 -43Q93 -43 108 -57T123 -95Q123 -121 100 -151H104Q131 -151 155 -125T193 -60Q195 -54 244 141T294 345Q297 360 297 373",
        8260: "189 -210Q179 -210 170 -203T160 -179Q160 -171 162 -166Q164 -163 420 266T679 698Q686 711 704 711Q714 711 723 704T733 681Q733 672 730 667Q723 654 469 228T211 -201Q202 -210 189 -210",
        8710: "65 0Q59 6 59 9T61 16Q64 20 334 357T608 698Q616 706 629 710Q630 710 634 710T644 710T656 711Q686 711 694 703Q698 699 700 693Q706 674 805 345T904 14Q904 7 894 1L479 0H65ZM630 342L567 551L232 134L462 133H693Q693 137 630 342",
        10744: "189 -210Q179 -210 170 -203T160 -179Q160 -171 162 -166Q164 -163 420 266T679 698Q686 711 704 711Q714 711 723 704T733 681Q733 672 730 667Q723 654 469 228T211 -201Q202 -210 189 -210"
      }, {});
      return boldItalic$1;
    }
    var bold$1 = {};
    var bold = {};
    var hasRequiredBold$1;
    function requireBold$1() {
      if (hasRequiredBold$1) return bold;
      hasRequiredBold$1 = 1;
      Object.defineProperty(bold, "__esModule", { value: true });
      bold.bold = void 0;
      bold.bold = {
        33: [0.705, 0, 0.35],
        34: [0.694, -0.329, 0.603],
        35: [0.694, 0.193, 0.958],
        36: [0.75, 0.056, 0.575],
        37: [0.75, 0.056, 0.958],
        38: [0.705, 0.011, 0.894],
        39: [0.694, -0.329, 0.319],
        40: [0.75, 0.249, 0.447],
        41: [0.75, 0.249, 0.447],
        42: [0.75, -0.306, 0.575],
        43: [0.633, 0.131, 0.894],
        44: [0.171, 0.194, 0.319],
        45: [0.278, -0.166, 0.383],
        46: [0.171, 0, 0.319],
        47: [0.75, 0.25, 0.575],
        58: [0.444, 0, 0.319],
        59: [0.444, 0.194, 0.319],
        60: [0.587, 0.085, 0.894],
        61: [0.393, -0.109, 0.894],
        62: [0.587, 0.085, 0.894],
        63: [0.7, 0, 0.543],
        64: [0.699, 6e-3, 0.894],
        91: [0.75, 0.25, 0.319],
        92: [0.75, 0.25, 0.575],
        93: [0.75, 0.25, 0.319],
        94: [0.694, -0.52, 0.575],
        95: [-0.01, 0.061, 0.575],
        96: [0.706, -0.503, 0.575],
        123: [0.75, 0.25, 0.575],
        124: [0.75, 0.249, 0.319],
        125: [0.75, 0.25, 0.575],
        126: [0.344, -0.202, 0.575],
        168: [0.695, -0.535, 0.575],
        172: [0.371, -0.061, 0.767],
        175: [0.607, -0.54, 0.575],
        176: [0.702, -0.536, 0.575],
        177: [0.728, 0.035, 0.894],
        180: [0.706, -0.503, 0.575],
        183: [0.336, -0.166, 0.319],
        215: [0.53, 0.028, 0.894],
        247: [0.597, 0.096, 0.894],
        305: [0.442, 0, 0.278, { sk: 0.0278 }],
        567: [0.442, 0.205, 0.306, { sk: 0.0833 }],
        697: [0.563, -0.033, 0.344],
        710: [0.694, -0.52, 0.575],
        711: [0.66, -0.515, 0.575],
        713: [0.607, -0.54, 0.575],
        714: [0.706, -0.503, 0.575],
        715: [0.706, -0.503, 0.575],
        728: [0.694, -0.5, 0.575],
        729: [0.695, -0.525, 0.575],
        730: [0.702, -0.536, 0.575],
        732: [0.694, -0.552, 0.575],
        768: [0.706, -0.503, 0],
        769: [0.706, -0.503, 0],
        770: [0.694, -0.52, 0],
        771: [0.694, -0.552, 0],
        772: [0.607, -0.54, 0],
        774: [0.694, -0.5, 0],
        775: [0.695, -0.525, 0],
        776: [0.695, -0.535, 0],
        778: [0.702, -0.536, 0],
        779: [0.714, -0.511, 0],
        780: [0.66, -0.515, 0],
        824: [0.711, 0.21, 0],
        8194: [0, 0, 0.5],
        8195: [0, 0, 0.999],
        8196: [0, 0, 0.333],
        8197: [0, 0, 0.25],
        8198: [0, 0, 0.167],
        8201: [0, 0, 0.167],
        8202: [0, 0, 0.083],
        8211: [0.3, -0.249, 0.575],
        8212: [0.3, -0.249, 1.15],
        8213: [0.3, -0.249, 1.15],
        8214: [0.75, 0.248, 0.575],
        8215: [-0.01, 0.061, 0.575],
        8216: [0.694, -0.329, 0.319],
        8217: [0.694, -0.329, 0.319],
        8220: [0.694, -0.329, 0.603],
        8221: [0.694, -0.329, 0.603],
        8224: [0.702, 0.211, 0.511],
        8225: [0.702, 0.202, 0.511],
        8226: [0.474, -0.028, 0.575],
        8230: [0.171, 0, 1.295],
        8242: [0.563, -0.033, 0.344],
        8243: [0.563, 0, 0.688],
        8244: [0.563, 0, 1.032],
        8254: [0.607, -0.54, 0.575],
        8260: [0.75, 0.25, 0.575],
        8279: [0.563, 0, 1.376],
        8407: [0.723, -0.513, 0.575],
        8463: [0.694, 8e-3, 0.668, { sk: -0.0319 }],
        8467: [0.702, 0.019, 0.474, { sk: 0.128 }],
        8472: [0.461, 0.21, 0.74],
        8501: [0.694, 0, 0.703],
        8592: [0.518, 0.017, 1.15],
        8593: [0.694, 0.193, 0.575],
        8594: [0.518, 0.017, 1.15],
        8595: [0.694, 0.194, 0.575],
        8596: [0.518, 0.017, 1.15],
        8597: [0.767, 0.267, 0.575],
        8598: [0.724, 0.194, 1.15],
        8599: [0.724, 0.193, 1.15],
        8600: [0.694, 0.224, 1.15],
        8601: [0.694, 0.224, 1.15],
        8602: [0.711, 0.21, 1.15],
        8603: [0.711, 0.21, 1.15],
        8614: [0.518, 0.017, 1.15],
        8617: [0.518, 0.017, 1.282],
        8618: [0.518, 0.017, 1.282],
        8622: [0.711, 0.21, 1.15],
        8636: [0.518, -0.22, 1.15],
        8637: [0.281, 0.017, 1.15],
        8640: [0.518, -0.22, 1.15],
        8641: [0.281, 0.017, 1.15],
        8652: [0.718, 0.017, 1.15],
        8653: [0.711, 0.21, 1.15],
        8654: [0.711, 0.21, 1.15],
        8655: [0.711, 0.21, 1.15],
        8656: [0.547, 0.046, 1.15],
        8657: [0.694, 0.193, 0.703],
        8658: [0.547, 0.046, 1.15],
        8659: [0.694, 0.194, 0.703],
        8660: [0.547, 0.046, 1.15],
        8661: [0.767, 0.267, 0.703],
        8704: [0.694, 0.016, 0.639],
        8707: [0.694, 0, 0.639],
        8708: [0.711, 0.21, 0.639],
        8709: [0.767, 0.073, 0.575],
        8710: [0.698, 0, 0.958],
        8712: [0.587, 0.086, 0.767],
        8713: [0.711, 0.21, 0.767],
        8715: [0.587, 0.086, 0.767],
        8716: [0.711, 0.21, 0.767],
        8722: [0.281, -0.221, 0.894],
        8723: [0.537, 0.227, 0.894],
        8725: [0.75, 0.25, 0.575],
        8726: [0.75, 0.25, 0.575],
        8727: [0.472, -0.028, 0.575],
        8728: [0.474, -0.028, 0.575],
        8729: [0.474, -0.028, 0.575],
        8730: [0.82, 0.18, 0.958, { ic: 0.03 }],
        8733: [0.451, 8e-3, 0.894],
        8734: [0.452, 8e-3, 1.15],
        8736: [0.714, 0, 0.722],
        8739: [0.75, 0.249, 0.319],
        8740: [0.75, 0.249, 0.319],
        8741: [0.75, 0.248, 0.575],
        8742: [0.75, 0.248, 0.575],
        8743: [0.604, 0.017, 0.767],
        8744: [0.604, 0.016, 0.767],
        8745: [0.603, 0.016, 0.767],
        8746: [0.604, 0.016, 0.767],
        8747: [0.711, 0.211, 0.569, { ic: 0.063 }],
        8764: [0.391, -0.109, 0.894],
        8768: [0.583, 0.082, 0.319],
        8769: [0.711, 0.21, 0.894],
        8771: [0.502, 0, 0.894],
        8772: [0.711, 0.21, 0.894],
        8773: [0.638, 0.027, 0.894],
        8775: [0.711, 0.21, 0.894],
        8776: [0.524, -0.032, 0.894],
        8777: [0.711, 0.21, 0.894],
        8781: [0.533, 0.032, 0.894],
        8784: [0.721, -0.109, 0.894],
        8800: [0.711, 0.21, 0.894],
        8801: [0.505, 0, 0.894],
        8802: [0.711, 0.21, 0.894],
        8804: [0.697, 0.199, 0.894],
        8805: [0.697, 0.199, 0.894],
        8810: [0.617, 0.116, 1.15],
        8811: [0.618, 0.116, 1.15],
        8813: [0.711, 0.21, 0.894],
        8814: [0.711, 0.21, 0.894],
        8815: [0.711, 0.21, 0.894],
        8816: [0.711, 0.21, 0.894],
        8817: [0.711, 0.21, 0.894],
        8826: [0.585, 0.086, 0.894],
        8827: [0.586, 0.086, 0.894],
        8832: [0.711, 0.21, 0.894],
        8833: [0.711, 0.21, 0.894],
        8834: [0.587, 0.085, 0.894],
        8835: [0.587, 0.086, 0.894],
        8836: [0.711, 0.21, 0.894],
        8837: [0.711, 0.21, 0.894],
        8838: [0.697, 0.199, 0.894],
        8839: [0.697, 0.199, 0.894],
        8840: [0.711, 0.21, 0.894],
        8841: [0.711, 0.21, 0.894],
        8846: [0.604, 0.016, 0.767],
        8849: [0.697, 0.199, 0.894],
        8850: [0.697, 0.199, 0.894],
        8851: [0.604, 0, 0.767],
        8852: [0.604, 0, 0.767],
        8853: [0.632, 0.132, 0.894],
        8854: [0.632, 0.132, 0.894],
        8855: [0.632, 0.132, 0.894],
        8856: [0.632, 0.132, 0.894],
        8857: [0.632, 0.132, 0.894],
        8866: [0.693, 0, 0.703],
        8867: [0.693, 0, 0.703],
        8868: [0.694, 0, 0.894],
        8869: [0.693, 0, 0.894],
        8872: [0.75, 0.249, 0.974],
        8876: [0.711, 0.21, 0.703],
        8877: [0.75, 0.249, 0.974],
        8900: [0.523, 0.021, 0.575],
        8901: [0.336, -0.166, 0.319],
        8902: [0.502, 0, 0.575],
        8904: [0.54, 0.039, 1],
        8930: [0.711, 0.21, 0.894],
        8931: [0.711, 0.21, 0.894],
        8942: [0.951, 0.029, 0.319],
        8943: [0.336, -0.166, 1.295],
        8945: [0.871, -0.101, 1.323],
        8968: [0.75, 0.248, 0.511],
        8969: [0.75, 0.248, 0.511],
        8970: [0.749, 0.248, 0.511],
        8971: [0.749, 0.248, 0.511],
        8994: [0.405, -0.108, 1.15],
        8995: [0.392, -0.126, 1.15],
        9001: [0.75, 0.249, 0.447],
        9002: [0.75, 0.249, 0.447],
        9651: [0.711, 0, 1.022],
        9653: [0.711, 0, 1.022],
        9657: [0.54, 0.039, 0.575],
        9661: [0.5, 0.21, 1.022],
        9663: [0.5, 0.21, 1.022],
        9667: [0.539, 0.038, 0.575],
        9711: [0.711, 0.211, 1.15],
        9824: [0.719, 0.129, 0.894],
        9825: [0.711, 0.024, 0.894],
        9826: [0.719, 0.154, 0.894],
        9827: [0.719, 0.129, 0.894],
        9837: [0.75, 0.017, 0.447],
        9838: [0.741, 0.223, 0.447],
        9839: [0.724, 0.224, 0.447],
        10072: [0.75, 0.249, 0.319],
        10216: [0.75, 0.249, 0.447],
        10217: [0.75, 0.249, 0.447],
        10229: [0.518, 0.017, 1.805],
        10230: [0.518, 0.017, 1.833],
        10231: [0.518, 0.017, 2.126],
        10232: [0.547, 0.046, 1.868],
        10233: [0.547, 0.046, 1.87],
        10234: [0.547, 0.046, 2.126],
        10236: [0.518, 0.017, 1.833],
        10744: [0.711, 0.21, 0.894],
        10799: [0.53, 0.028, 0.894],
        10815: [0.686, 0, 0.9],
        10927: [0.696, 0.199, 0.894],
        10928: [0.697, 0.199, 0.894],
        12296: [0.75, 0.249, 0.447],
        12297: [0.75, 0.249, 0.447]
      };
      return bold;
    }
    var hasRequiredBold;
    function requireBold() {
      if (hasRequiredBold) return bold$1;
      hasRequiredBold = 1;
      Object.defineProperty(bold$1, "__esModule", { value: true });
      bold$1.bold = void 0;
      var FontData_js_1 = requireFontData();
      var bold_js_1 = requireBold$1();
      bold$1.bold = (0, FontData_js_1.AddPaths)(bold_js_1.bold, {
        33: "89 629Q89 663 116 684T171 705Q215 705 237 681T260 634Q260 619 233 434T204 244Q201 237 175 237Q150 237 146 244Q144 248 117 433T89 629ZM90 86Q90 125 116 148T177 171Q211 169 235 146T259 86Q259 48 235 25T175 1Q138 1 114 24T90 86",
        34: "38 572T38 608T61 669T121 694Q167 694 196 657T225 559Q225 520 214 482T186 418T151 370T119 339T99 329T82 340T70 360Q70 365 74 369T92 385T122 414Q142 441 154 471T170 518L172 535L166 532Q160 530 148 527T122 523Q85 523 62 547ZM305 572T305 608T328 669T388 694Q434 694 463 657T492 559Q492 520 481 482T453 418T418 370T386 339T366 329T349 340T337 360Q337 365 341 369T359 385T389 414Q409 441 421 471T436 518L439 535L433 532Q427 530 415 527T389 523Q352 523 329 547",
        35: "64 362Q64 380 87 393H363L366 404Q379 443 390 480T409 542T424 590T435 628T443 655T451 674T458 686T467 692T478 694Q490 694 499 686T509 662Q505 643 427 395Q427 393 523 393H620L623 404Q630 426 652 498T691 624T711 681Q718 694 735 694Q748 694 757 685T766 662Q762 643 684 395Q684 393 777 393H871Q872 392 875 390T881 386T887 381T891 374T893 363Q893 345 871 333L767 332H664L660 319Q660 318 638 245T614 171Q614 169 742 169H871L877 165Q883 161 885 159T890 151T893 138Q893 120 871 109L732 108H594L590 95Q587 84 546 -46Q508 -175 505 -178Q498 -193 478 -193Q462 -193 455 -183T448 -164Q448 -156 530 106Q530 108 434 108H337L333 95Q330 84 289 -46Q251 -175 248 -178Q240 -193 222 -193Q206 -193 199 -183T191 -164Q191 -154 273 106Q273 108 180 108L87 109Q64 117 64 139Q64 156 87 169H293L321 262Q326 277 331 294T340 321L343 330Q343 332 215 332L87 333Q64 343 64 362ZM600 330Q600 332 504 332H407L403 319Q403 318 381 245T357 171Q357 169 453 169H550L578 262Q583 277 588 294T597 321L600 330",
        36: "64 494Q64 541 80 579T120 638T171 674T219 693T253 698H256V750H318V699H323Q355 694 380 686T433 663T480 620T506 556Q510 539 510 520Q510 480 488 463T440 445L422 447Q407 451 398 459Q370 478 370 515Q370 542 384 559T412 580L427 584Q424 589 418 596T386 617T324 636H318V434Q411 419 460 355T510 217Q510 196 507 175T492 122T461 67T404 23T318 -4V-56H256V-5H254Q252 -3 240 -3Q194 4 160 23T108 64T80 112T67 156T64 190Q64 218 81 240T134 262Q171 262 187 240T204 193T190 150T153 125Q146 125 144 123Q142 123 149 113T174 89T218 66Q247 58 255 58Q256 58 256 173V287L239 291Q160 308 112 365T64 494ZM255 636Q246 635 236 632T206 620T173 591T160 543Q160 472 256 448V542Q256 636 255 636ZM320 59Q324 59 333 61T356 70T384 89T406 120T415 167Q415 200 395 225T356 260T318 274V59H320",
        37: "65 549Q65 609 84 652T132 714T187 742T236 750Q265 750 296 734T355 697T431 661T541 644Q662 644 736 730Q751 749 767 749T790 739T797 719Q797 710 768 672T504 329Q212 -47 211 -48Q203 -55 191 -55Q161 -55 161 -25Q161 -17 163 -12L642 609Q608 595 542 595Q515 595 488 599T441 608T405 619T381 628L373 632Q373 630 375 619T380 589T383 548Q383 455 343 401T235 347Q217 347 198 351T154 368T110 403T78 462T65 549ZM320 549Q320 633 295 665T235 698H234Q214 698 196 674Q182 650 182 549Q182 509 183 486T190 441T207 409T238 399Q269 399 294 431T320 549ZM745 -56Q727 -56 708 -52T664 -35T620 0T588 59T575 146T588 232T620 291T663 325T708 343T747 347Q810 347 851 294T893 146Q893 89 879 48T841 -15T794 -46T745 -56ZM830 146Q830 230 805 262T745 295H744Q724 295 706 271Q692 247 692 146Q692 106 693 83T700 38T717 6T748 -4Q779 -4 804 28T830 146",
        38: "255 -11Q209 -11 164 4T84 56T48 146Q48 159 50 171Q57 197 72 218T99 249T152 292Q204 333 204 334L194 356Q185 379 176 421T166 511Q166 538 168 551Q182 613 226 654T332 704Q334 704 343 704T358 705Q412 702 444 661T476 565V559Q476 489 334 371L330 368L335 357Q382 272 485 165L496 154L506 163Q543 200 597 273L671 382H601V444H610L732 441Q821 441 830 444H836V382H741L709 335Q702 324 687 302T665 270T646 244T625 216T605 191T581 162T553 132L537 116Q544 109 557 98T605 69T673 51Q711 51 739 70T767 115V118H829V114Q829 70 786 30T668 -11Q570 -11 474 37L451 49L441 43Q352 -11 255 -11ZM415 564Q415 596 400 625T356 654Q329 654 310 634T285 588Q283 580 283 554Q283 475 309 417L325 431Q415 512 415 564ZM192 182Q192 126 213 89T279 51Q348 51 400 83L389 91Q362 112 338 137T295 186T264 229T240 265T227 286Q226 285 222 280T217 272T211 263T205 251T200 238T196 222T193 204T192 182",
        39: "74 572T74 608T97 669T157 694Q203 694 232 657T261 559Q261 520 250 482T222 418T187 370T155 339T135 329Q128 329 117 340T106 359Q106 365 117 375T144 399T176 440T203 505Q204 511 205 518T208 530V535L202 532Q196 530 184 527T158 523Q121 523 98 547",
        40: "103 166T103 251T121 412T165 541T225 639T287 708T341 750H356H361Q382 750 382 736Q382 732 365 714T323 661T274 576T232 439T214 250Q214 -62 381 -229Q382 -231 382 -234Q382 -249 360 -249H356H341Q314 -231 287 -207T226 -138T165 -41T121 89",
        41: "231 251Q231 354 214 439T173 575T123 661T81 714T64 735Q64 744 73 749H75Q77 749 79 749T84 750T90 750H105Q132 732 159 708T220 639T281 542T325 413T343 251T325 89T281 -40T221 -138T159 -207T105 -249H90Q80 -249 76 -249T68 -245T64 -234Q64 -230 81 -212T123 -160T172 -75T214 61T231 251",
        42: "235 706Q235 724 251 737T287 750Q306 750 322 738T339 706Q339 685 318 580V579Q429 663 436 666Q441 668 449 668Q471 668 486 650T501 612Q501 582 478 572Q476 570 414 549L354 528L414 507Q420 505 430 502T445 497T458 492T470 488T479 483T487 478T493 471T497 463T500 454T501 443Q501 423 486 406T449 388H446Q435 388 370 437Q339 461 318 477V476Q339 371 339 350Q339 332 323 319T287 306T251 319T235 350Q235 371 256 476V477Q145 393 138 390Q133 388 125 388Q103 388 88 406T73 444Q73 474 96 484Q98 486 160 507L220 528L160 549Q154 551 144 554T129 559T116 564T104 568T95 573T87 578T81 585T77 593T74 602T73 613Q73 633 88 650T125 668H128Q139 668 204 619Q235 595 256 579V580Q235 685 235 706",
        43: "64 232T64 250T87 281H416V444Q416 608 418 612Q426 633 446 633T475 613Q477 608 477 444V281H807Q808 280 811 278T817 274T823 269T827 262T829 251Q829 230 807 221L642 220H477V57Q477 -107 475 -112Q468 -131 446 -131Q425 -131 418 -112Q416 -107 416 57V220H251L87 221Q64 232 64 250",
        44: "74 85Q74 120 97 145T159 171Q200 171 226 138Q258 101 258 37Q258 -5 246 -44T218 -109T183 -155T152 -184T135 -194Q129 -194 118 -183T106 -164Q106 -157 115 -149Q121 -145 130 -137T161 -100T195 -35Q197 -28 200 -17T204 3T205 11T199 9T183 3T159 0Q120 0 97 26T74 85",
        45: "13 166V278H318V166H13",
        46: "74 85Q74 121 99 146T156 171Q200 171 222 143T245 85Q245 56 224 29T160 1Q118 1 96 27T74 85",
        47: "451 730Q460 750 479 750Q492 750 501 740T510 718Q508 708 318 244L122 -232Q112 -250 95 -250Q82 -250 73 -241T64 -218Q66 -205 258 261T451 730",
        58: "74 359Q74 394 98 419T158 444Q200 444 222 417T245 358Q245 329 224 302T160 274Q116 274 95 301T74 359ZM74 85Q74 121 99 146T156 171Q200 171 222 143T245 85Q245 56 224 29T160 1Q118 1 96 27T74 85",
        59: "74 359Q74 394 98 419T158 444Q200 444 222 417T245 358Q245 329 224 302T160 274Q116 274 95 301T74 359ZM74 50T74 86T97 146T158 171Q204 171 226 132T248 38Q248 -23 223 -80T171 -165T135 -194Q129 -194 118 -183T106 -164Q106 -163 106 -160L107 -158Q108 -155 121 -142T150 -107T177 -58Q189 -32 194 3Q195 6 193 6Q172 0 158 0Q121 0 98 25",
        60: "797 -56Q797 -68 790 -76T767 -85H759L434 70Q108 226 105 229Q96 238 96 250Q96 263 105 272Q109 276 271 354T595 508T757 585Q763 587 766 587Q780 587 788 578T797 556Q797 544 788 535Q784 531 490 391L197 251Q213 242 359 173T644 37T788 -34Q797 -43 797 -56",
        61: "87 333Q64 343 64 362Q64 383 84 391Q89 393 448 393H807Q808 392 811 390T817 386T823 381T827 374T829 363Q829 345 807 333H87ZM87 109Q64 118 64 139Q64 159 86 168Q89 169 448 169H807L812 166Q816 163 818 162T823 157T827 149T829 139Q829 118 807 109H87",
        62: "127 -85Q110 -85 103 -75T96 -55Q96 -41 106 -34Q119 -24 308 65Q361 90 411 114L696 250L427 379Q106 533 103 537Q96 545 96 557Q96 568 104 577T128 587Q137 586 460 431T788 272Q797 263 797 250Q797 238 788 229Q785 226 459 70L135 -85H127",
        63: "65 570Q65 628 119 664T259 700Q326 700 372 688T440 654T469 613T478 569Q478 505 412 465Q287 391 287 294V283Q287 250 284 244T263 237H256H249Q232 237 229 242T225 272V287Q227 364 253 418Q274 463 311 504Q335 530 335 575Q335 622 323 635T259 648Q231 648 209 644T179 636T170 630L172 628Q174 627 177 625T183 620T190 611T197 601T202 587T204 570Q204 539 185 519T134 499Q105 499 85 517T65 570ZM171 86Q171 125 197 148T258 171Q292 169 316 146T340 86Q340 48 316 25T256 1Q218 1 195 24T171 86",
        64: "64 347Q64 511 171 605T434 699Q487 699 500 698Q624 684 703 621T811 464Q828 414 828 344Q828 232 788 179T691 125Q673 125 657 127T628 132T606 140T588 148T576 156T568 162L566 164Q565 164 549 154T504 135T444 125Q349 125 284 183T218 347Q218 455 284 512T448 569Q554 569 610 479H638Q670 479 674 471Q676 468 676 340V258Q676 213 679 199T694 178Q701 174 713 177Q767 187 767 340Q767 489 678 569T446 649Q299 649 213 566T126 346Q126 307 134 269T166 189T225 116T320 65T455 45H463Q606 51 721 91L746 99H782H801Q829 99 829 85Q829 78 825 75T804 65Q800 63 797 62Q625 -6 451 -6Q271 -6 168 91T64 347ZM547 468Q526 493 504 505T444 517T377 476T346 347Q346 306 354 271T386 206T448 177Q505 177 547 226V468",
        91: "128 -250V750H293V689H189V-189H293V-250H128",
        92: "64 718Q63 731 72 740T94 750Q106 750 113 743Q118 741 122 732L318 256Q508 -208 510 -218Q511 -231 502 -240T480 -250Q460 -250 451 -230Q451 -229 259 238T64 718",
        93: "25 689V750H190V-250H25V-189H129V689H25",
        94: "207 632L287 694Q289 693 368 632T448 570T431 545T413 520Q410 520 350 559L287 597L224 559Q164 520 161 520Q160 520 143 544T126 570T207 632",
        95: "0 -61V-10H574V-61H0",
        96: "114 634Q114 663 136 684T183 706Q191 706 196 705T208 700T219 693T232 681T245 666T262 645T282 620Q332 558 337 553Q338 552 318 527L299 503L223 543Q215 547 202 553T183 563T167 571T153 580T141 587T131 595T124 603T118 612T115 622T114 634",
        123: "504 -207T504 -225T500 -246T476 -250H469Q257 -250 227 -145L225 -135L224 0Q224 15 224 30T224 59T224 84T224 106T223 122T223 133V137Q222 138 221 144T213 162T195 185Q171 206 141 215Q123 222 107 223T84 225T74 229T70 250T73 270T83 276T106 276T141 285Q171 294 195 315Q201 321 206 328T214 341T219 352T222 360L223 363V367Q223 371 223 378T223 394T224 415T224 441T224 470T224 501L225 636Q249 739 426 749Q428 749 443 749T466 750H473Q495 750 499 747T504 725T501 704T480 699Q381 693 357 645Q352 634 351 617T350 497V412Q350 350 338 329Q325 303 298 284T251 258T227 251Q226 251 226 250L227 249Q231 248 238 246T265 236T299 217T329 184T349 137Q350 131 350 3T352 -130Q358 -160 392 -178T480 -199Q497 -200 500 -203",
        124: "160 -249Q138 -249 129 -225V250Q129 725 131 729Q139 750 159 750T190 725V-225Q181 -249 160 -249",
        125: "70 726Q71 744 74 747T99 750H106Q323 750 349 636L350 501Q350 486 350 470T350 441T350 416T350 394T351 378T351 367V363Q352 362 353 356T361 338T379 315Q403 294 433 285Q451 278 467 277T490 275T500 271T504 250T501 230T491 224T468 224T433 215Q403 206 379 185Q373 179 368 172T360 159T355 148T352 140L351 137V133Q351 129 351 122T351 106T350 85T350 59T350 31T350 0L349 -135L347 -145Q317 -250 106 -250H99Q79 -250 75 -247T70 -226Q70 -208 73 -204T95 -199Q193 -193 217 -145Q222 -134 223 -117T224 3Q224 20 224 48T223 86Q223 145 237 175T301 232Q335 249 347 249Q348 249 348 250L347 251Q343 252 336 254T309 264T275 284T245 316T225 363Q224 369 224 497T222 631Q216 660 182 678T95 699Q77 700 74 704T70 726",
        126: "343 202Q320 202 278 225T215 249Q181 249 146 214L134 202L115 219Q111 222 106 226T98 234L96 236Q158 306 165 313Q199 344 230 344Q239 344 244 343Q262 339 300 318T359 297Q393 297 428 332L440 344L459 327Q463 324 468 320T476 312L478 310Q416 240 409 233Q375 202 343 202",
        168: "96 615Q96 650 120 672T178 695Q214 693 234 669T255 615Q255 583 232 559T176 535Q147 535 122 556T96 615ZM319 615Q319 651 343 673T399 695Q426 695 452 675T478 615Q478 578 454 557T395 535Q364 537 342 559T319 615",
        172: "680 371Q683 369 688 366T695 361T698 356T701 346T701 332T702 308V216Q702 196 702 168T703 130Q703 90 697 76T671 61Q650 61 643 81Q641 86 641 198V310H364L87 311Q64 319 64 341Q64 362 84 369Q89 371 385 371H680",
        175: "80 540V607H494V540H80",
        176: "160 618Q160 653 193 677T279 702H284Q381 702 407 647Q414 634 414 618Q414 607 410 596T395 570T355 546T287 536T220 545T181 568T165 594T160 618ZM352 618Q352 645 341 652T301 659H292Q286 659 278 659T268 660Q247 660 236 653T224 638T222 619Q222 591 234 585T287 578Q315 578 326 580T345 590T352 618",
        177: "64 328T64 346T87 377H416V542L417 707Q431 728 443 728Q467 728 475 709Q477 704 477 540V377H807Q808 376 811 374T817 370T823 365T827 358T829 347Q829 326 807 317L642 316H477V25H807Q808 24 811 22T817 18T823 13T827 6T829 -5Q829 -26 807 -35H87Q64 -24 64 -6T87 25H416V316H251L87 317Q64 328 64 346",
        180: "391 706Q419 706 439 683T460 634Q460 608 441 593T366 550Q356 545 351 543L275 503L256 527Q236 552 237 553Q242 558 292 620Q299 629 309 641T324 659T336 673T346 685T354 693T363 699T371 703T380 705T391 706",
        183: "74 251Q74 286 99 311T156 336Q200 336 222 308T245 250Q245 221 224 194T160 166T96 193T74 251",
        215: "168 500Q168 515 178 522T195 530H198Q207 530 218 521T282 458Q312 428 331 409L447 294L563 409Q674 520 682 525Q687 529 695 529Q711 529 718 520T726 499V498Q726 489 720 481T666 427Q631 392 606 367L490 251L606 135Q717 23 721 17T726 2Q726 -9 719 -18T695 -28H692Q685 -28 674 -18T608 47Q581 74 563 92L447 207L331 91Q217 -22 208 -27Q206 -28 203 -28H197Q168 -28 168 2Q168 13 178 24T288 135L404 250L288 366Q177 479 173 485T168 500",
        247: "344 495Q344 535 372 566T447 597Q490 597 519 566T548 495Q548 452 518 423T446 393Q404 393 374 423T344 495ZM87 221Q64 230 64 251T84 279Q89 281 448 281H806Q807 280 810 278T816 274T822 269T826 262T828 251Q828 230 806 221H87ZM344 -36T344 6T373 78T446 108Q487 108 517 79T548 6Q548 -35 519 -65T446 -96Q406 -96 375 -66",
        305: "247 0Q232 3 143 3Q132 3 106 3T56 1L34 0H26V46H42Q70 46 91 49Q100 53 102 60T104 102V205V293Q104 345 102 359T88 378Q74 385 41 385H30V408Q30 431 32 431L42 432Q52 433 70 434T106 436Q123 437 142 438T171 441T182 442H185V62Q190 52 197 50T232 46H255V0H247",
        567: "28 -163Q58 -168 64 -168Q124 -168 135 -77Q137 -65 137 141T136 353Q132 371 120 377T72 385H52V408Q52 431 54 431L58 432Q62 432 70 432T87 433T108 434T133 436Q151 437 171 438T202 441T214 442H218V184Q217 -36 217 -59T211 -98Q195 -145 153 -175T58 -205Q9 -205 -23 -179T-55 -117Q-55 -94 -40 -79T-2 -64T36 -79T52 -118Q52 -143 28 -163",
        697: "240 563Q278 563 304 539T331 480V473Q331 462 316 431T217 236Q199 200 174 151T136 78T123 50Q113 33 105 33Q101 33 72 45T38 60Q35 63 35 65Q35 77 101 293T171 517Q182 542 202 552T240 563",
        710: "207 632L287 694Q289 693 368 632T448 570T431 545T413 520Q410 520 350 559L287 597L224 559Q164 520 161 520Q160 520 143 544T126 570T207 632",
        711: "131 603Q130 604 136 618T150 646T158 659L223 635L287 611L351 635L416 659Q417 660 424 647T437 619T443 603Q440 601 364 558T287 515T210 558T131 603",
        713: "80 540V607H494V540H80",
        714: "391 706Q419 706 439 683T460 634Q460 608 441 593T366 550Q356 545 351 543L275 503L256 527Q236 552 237 553Q242 558 292 620Q299 629 309 641T324 659T336 673T346 685T354 693T363 699T371 703T380 705T391 706",
        715: "114 634Q114 663 136 684T183 706Q191 706 196 705T208 700T219 693T232 681T245 666T262 645T282 620Q332 558 337 553Q338 552 318 527L299 503L223 543Q215 547 202 553T183 563T167 571T153 580T141 587T131 595T124 603T118 612T115 622T114 634",
        728: "287 500Q208 500 155 558T102 689V694H153V685Q153 681 154 674T164 648T186 615T226 590T287 578Q347 578 382 611T421 685V694H472V689Q472 623 422 562T287 500",
        729: "202 610Q202 647 227 671T283 695Q324 695 348 669T372 610T350 551T287 525Q248 525 225 551T202 610",
        730: "160 618Q160 653 193 677T279 702H284Q381 702 407 647Q414 634 414 618Q414 607 410 596T395 570T355 546T287 536T220 545T181 568T165 594T160 618ZM352 618Q352 645 341 652T301 659H292Q286 659 278 659T268 660Q247 660 236 653T224 638T222 619Q222 591 234 585T287 578Q315 578 326 580T345 590T352 618",
        732: "343 552Q320 552 278 575T215 599Q181 599 146 564L134 552L115 569Q111 572 106 576T98 584L96 586Q158 656 165 663Q199 694 230 694Q239 694 244 693Q262 689 300 668T359 647Q393 647 428 682L440 694L459 677Q463 674 468 670T476 662L478 660Q416 590 409 583Q375 552 343 552",
        768: "-461 634Q-461 663 -439 684T-392 706Q-384 706 -379 705T-367 700T-356 693T-343 681T-330 666T-313 645T-293 620Q-243 558 -238 553Q-237 552 -257 527L-276 503L-352 543Q-360 547 -373 553T-392 563T-408 571T-422 580T-434 587T-444 595T-451 603T-457 612T-460 622T-461 634",
        769: "-184 706Q-156 706 -136 683T-115 634Q-115 608 -134 593T-209 550Q-219 545 -224 543L-300 503L-319 527Q-339 552 -338 553Q-333 558 -283 620Q-276 629 -266 641T-251 659T-239 673T-229 685T-221 693T-212 699T-204 703T-195 705T-184 706",
        770: "-368 632L-288 694Q-286 693 -207 632T-127 570T-144 545T-162 520Q-165 520 -225 559L-288 597L-351 559Q-411 520 -414 520Q-415 520 -432 544T-449 570T-368 632",
        771: "-232 552Q-255 552 -297 575T-360 599Q-394 599 -429 564L-441 552L-460 569Q-464 572 -469 576T-476 584L-479 586Q-417 656 -410 663Q-376 694 -345 694Q-336 694 -331 693Q-313 689 -275 668T-216 647Q-182 647 -147 682L-135 694L-116 677Q-112 674 -107 670T-100 662L-97 660Q-159 590 -166 583Q-200 552 -232 552",
        772: "-495 540V607H-81V540H-495",
        774: "-288 500Q-367 500 -420 558T-473 689V694H-422V685Q-422 681 -421 674T-411 648T-389 615T-349 590T-288 578Q-228 578 -193 611T-154 685V694H-103V689Q-103 623 -153 562T-288 500",
        775: "-373 610Q-373 647 -348 671T-292 695Q-251 695 -227 669T-203 610T-225 551T-288 525Q-327 525 -350 551T-373 610",
        776: "-479 615Q-479 650 -456 672T-397 695Q-361 693 -341 669T-320 615Q-320 583 -343 559T-399 535Q-428 535 -453 556T-479 615ZM-256 615Q-256 651 -232 673T-176 695Q-149 695 -123 675T-97 615Q-97 578 -121 557T-180 535Q-211 537 -233 559T-256 615",
        778: "-415 618Q-415 653 -382 677T-296 702H-291Q-194 702 -168 647Q-161 634 -161 618Q-161 607 -165 596T-180 570T-220 546T-288 536T-355 545T-394 568T-410 594T-415 618ZM-223 618Q-223 645 -234 652T-274 659H-283Q-289 659 -297 659T-307 660Q-328 660 -339 653T-351 638T-353 619Q-353 591 -341 585T-288 578Q-260 578 -249 580T-230 590T-223 618",
        779: "-389 511L-442 543Q-442 544 -424 606T-404 674Q-390 705 -361 713Q-360 713 -356 713T-349 714Q-340 714 -330 712Q-273 690 -273 644Q-273 621 -290 604L-342 554L-389 511ZM-198 511L-251 543Q-251 544 -233 606T-213 674Q-199 705 -170 713Q-169 713 -165 713T-158 714Q-127 714 -105 693T-82 647Q-82 638 -84 631T-89 618T-99 604T-112 590T-130 574T-151 554L-198 511",
        780: "-444 603Q-445 604 -439 618T-425 646T-417 659L-352 635L-288 611L-224 635L-159 659Q-158 660 -151 647T-138 619T-132 603Q-135 601 -211 558T-288 515T-365 558T-444 603",
        824: "-705 -210Q-715 -210 -724 -203T-734 -179Q-734 -171 -732 -166Q-730 -163 -474 266T-215 698Q-208 711 -190 711Q-180 711 -171 704T-161 681Q-161 672 -164 667Q-171 654 -425 228T-683 -201Q-692 -210 -705 -210",
        8194: "",
        8195: "",
        8196: "",
        8197: "",
        8198: "",
        8201: "",
        8202: "",
        8211: "0 249V300H574V249H0",
        8212: "0 249V300H1149V249H0",
        8213: "0 249V300H1149V249H0",
        8214: "205 -225Q201 -234 199 -237T191 -244T175 -248T161 -246Q151 -240 146 -229Q145 -224 145 251Q145 725 146 730Q156 750 176 750Q193 748 205 727V-225ZM369 727L372 732Q375 737 377 740T385 747T398 750Q406 750 413 747Q423 740 428 730Q430 720 430 251Q430 -219 428 -229Q423 -240 413 -246Q408 -248 400 -248Q393 -248 388 -247T379 -242T375 -236T371 -230L369 -225V727",
        8215: "0 -61V-10H574V-61H0",
        8216: "58 461Q58 503 70 542T99 607T134 654T165 684T184 694T201 683T213 664Q213 658 202 648T175 624T143 583T116 518Q115 512 114 505T112 493L111 488Q132 500 161 500Q198 500 221 475T245 414T222 354T161 329Q112 329 85 369T58 461",
        8217: "74 572T74 608T97 669T157 694Q203 694 232 657T261 559Q261 520 250 482T222 418T187 370T155 339T135 329Q128 329 117 340T106 359Q106 365 117 375T144 399T176 440T203 505Q204 511 205 518T208 530V535L202 532Q196 530 184 527T158 523Q121 523 98 547",
        8220: "110 461Q110 502 121 541T150 606T185 653T217 684T235 694Q242 694 254 682T266 664Q266 659 254 648T226 623T193 578T167 511Q164 500 164 494T164 487Q188 500 212 500Q251 500 274 475T297 414Q297 378 274 354T212 329Q167 329 139 367T110 461ZM377 461Q377 502 388 541T417 606T452 653T484 684T502 694Q509 694 521 682T533 664Q533 659 521 648T493 623T460 578T434 511Q431 500 431 494T431 487Q455 500 479 500Q518 500 541 475T564 414Q564 378 541 354T479 329Q434 329 406 367T377 461",
        8221: "38 572T38 608T61 669T121 694Q167 694 196 657T225 559Q225 520 214 482T186 418T151 370T119 339T99 329T82 340T70 360Q70 365 74 369T92 385T122 414Q142 441 154 471T170 518L172 535L166 532Q160 530 148 527T122 523Q85 523 62 547ZM305 572T305 608T328 669T388 694Q434 694 463 657T492 559Q492 520 481 482T453 418T418 370T386 339T366 329T349 340T337 360Q337 365 341 369T359 385T389 414Q409 441 421 471T436 518L439 535L433 532Q427 530 415 527T389 523Q352 523 329 547",
        8224: "231 470Q232 471 232 473Q232 477 213 540T193 636Q192 642 192 651T204 677T239 700Q249 702 255 702Q300 702 315 660Q317 653 317 636Q317 603 298 539T279 472V470Q280 470 318 488T383 506Q408 506 423 493T442 467T446 444T443 421T424 396T383 382Q355 382 318 400T279 418Q278 416 285 392T303 334T316 284Q318 268 318 234Q318 149 311 45T296 -127T284 -203Q279 -211 255 -211Q237 -211 233 -210T226 -203Q222 -195 214 -129T199 41T192 234V245Q192 286 212 349Q233 413 231 418Q229 418 192 400T128 382Q102 382 86 396T67 421T64 444T67 466T86 492T128 506Q155 506 192 488T231 470",
        8225: "193 637Q193 663 206 679T231 698T255 702T279 699T304 679T317 637Q317 605 299 557T280 504Q280 503 281 503T320 521T382 539Q410 539 428 521T446 476Q446 454 432 434T383 414H377Q358 414 320 431T281 449L280 448Q280 444 298 396T317 316Q318 310 318 301T306 275T271 252Q261 250 255 250Q210 250 195 292Q193 299 193 316Q193 347 211 395T230 448Q230 449 229 449Q227 449 196 434Q151 414 133 414H127Q102 414 87 427T68 452T64 477Q64 503 81 521T127 539Q143 539 164 532T204 515T226 504Q230 502 230 504Q230 508 212 556T193 637ZM193 184Q193 210 206 226T231 245T255 249T279 246T304 226T317 184Q317 153 299 106T280 53Q280 51 282 51T322 68T383 86Q411 86 428 69T445 24T428 -21T382 -39Q358 -39 322 -22T282 -4Q280 -3 280 -3T280 -6Q281 -13 299 -59T317 -136Q318 -142 318 -151T306 -177T271 -200Q261 -202 255 -202Q210 -202 195 -160Q193 -153 193 -136Q193 -106 211 -60T230 -6Q230 -4 228 -4T188 -21T128 -39Q100 -39 83 -22T65 24Q65 53 82 69T127 86Q150 86 187 69T228 51Q230 50 230 50T230 53Q229 58 211 105T193 184",
        8226: "64 251Q64 303 80 344T121 409T175 448T230 469T275 474Q277 474 283 474T292 473Q385 473 447 415T510 251Q510 149 449 89T287 28T126 88T64 251",
        8230: "74 85Q74 121 99 146T156 171Q200 171 222 143T245 85Q245 56 224 29T160 1Q118 1 96 27T74 85ZM562 85Q562 121 587 146T644 171Q688 171 710 143T733 85Q733 56 712 29T648 1Q606 1 584 27T562 85ZM1050 85Q1050 121 1075 146T1132 171Q1176 171 1198 143T1221 85Q1221 56 1200 29T1136 1Q1094 1 1072 27T1050 85",
        8242: "240 563Q278 563 304 539T331 480V473Q331 462 316 431T217 236Q199 200 174 151T136 78T123 50Q113 33 105 33Q101 33 72 45T38 60Q35 63 35 65Q35 77 101 293T171 517Q182 542 202 552T240 563",
        8254: "80 540V607H494V540H80",
        8260: "451 730Q460 750 479 750Q492 750 501 740T510 718Q508 708 318 244L122 -232Q112 -250 95 -250Q82 -250 73 -241T64 -218Q66 -205 258 261T451 730",
        8407: "406 694Q406 704 413 713T433 723Q448 723 454 719T467 701Q483 665 522 648Q542 637 542 619Q542 605 536 599T514 586Q468 569 431 532Q411 513 399 513Q386 513 378 522T369 543Q369 557 381 568Q385 572 387 574L400 588H228L56 589Q33 598 33 618Q33 636 56 649H426Q406 676 406 694",
        8463: "477 56Q477 48 479 46T490 43Q522 45 544 75T577 140Q582 156 585 159T605 162H611H622Q642 162 642 148Q642 138 632 114T602 62T550 13T478 -8Q429 -8 394 17T358 83Q358 95 395 199T433 350Q433 400 394 400H388H383Q335 400 291 363Q256 332 236 298Q233 293 202 170T169 40Q160 18 141 5T99 -8Q70 -8 58 9T45 39Q45 51 116 336L167 540H80V607H184L188 622H184Q183 622 179 622T169 623T157 624T146 624T136 624T131 625Q119 628 119 642Q119 647 123 661T129 679Q133 684 142 685T220 690Q293 694 307 694Q324 694 328 679Q328 673 311 607H494V540H294Q286 507 278 473T264 420L260 403Q260 400 269 408Q327 451 393 451H401H410Q425 451 439 450T476 442T515 424T544 391T556 337Q556 286 517 179T477 56",
        8467: "245 -19Q228 -19 212 -16T184 -6T162 9T143 27T129 46T118 66T111 84T106 99T102 111L101 116L69 89L36 62Q31 60 24 62Q-1 88 -1 98Q-1 101 1 105Q1 106 73 170L95 189V197Q95 242 112 317T159 476T241 624T353 701Q357 702 367 702Q428 702 444 641Q446 630 446 606Q446 454 241 246L215 220L212 203Q203 150 203 114Q203 113 203 106T204 95T205 82T209 67T214 54T223 43T236 35T253 32Q277 32 305 44T352 70T389 98T407 112Q409 113 412 113Q420 113 432 95Q445 77 443 70Q440 64 416 44T342 3T245 -19ZM387 615Q387 651 366 651Q342 651 321 604T276 470L241 331Q246 331 280 373T350 486T387 615",
        8472: "399 159Q410 159 421 151T433 126Q433 104 410 85Q408 84 410 78Q411 72 414 66T428 51T455 43Q483 43 506 55T543 83T568 125T584 166T594 206Q595 211 596 214Q610 273 610 301Q610 365 542 365H538Q483 365 429 344T337 292T269 229T225 175T210 150L255 99Q261 92 274 78T292 58T305 41T316 22T321 3T324 -23Q324 -87 283 -148T174 -210H171Q161 -210 152 -209T128 -201T101 -180T81 -141T72 -78Q72 -72 72 -60T73 -45Q79 4 102 65L108 81Q84 117 84 167Q84 273 140 367T269 461Q285 461 285 447Q285 440 282 431Q278 418 276 415T264 410Q228 404 201 336T174 219Q174 218 176 202L184 214Q252 303 348 360T549 417Q614 417 658 391T719 317Q726 292 726 260Q726 148 646 70T451 -8Q407 -8 377 17T346 92Q346 159 396 159H399ZM178 -160Q200 -160 216 -132T232 -75Q232 -63 228 -56T203 -26Q196 -18 192 -14Q185 -5 176 5T161 20T156 27L153 28Q151 28 146 8T137 -42T132 -89Q132 -160 178 -160",
        8501: "590 427Q581 427 579 433T575 450T568 470V468L532 288L541 281Q620 220 634 165L637 154V124Q637 74 628 46Q623 32 612 16T592 0Q580 0 578 19T569 69T538 121Q532 126 385 240T236 355Q234 355 231 338T225 291T222 237Q222 222 223 213T225 201T228 195T231 190Q238 179 261 160T300 119T316 73Q316 41 291 23T231 1Q226 0 149 0H98Q73 0 69 3T64 24Q64 43 67 47T85 51H89Q119 51 134 55T152 64T154 76Q154 95 125 141T96 220Q96 243 104 270T123 319T145 360T164 391T172 404T150 421T102 468T68 529L65 541V570Q65 620 74 648Q79 664 91 679T111 694Q122 694 123 675T132 625T164 573Q168 569 319 452T471 335Q471 337 486 409T502 488Q502 489 491 493T467 511T448 546V573Q448 602 452 624T462 659T474 680T486 691T493 694Q499 694 502 691T507 682T513 673Q517 667 534 651T557 630Q558 629 590 616T631 587Q638 577 638 543Q637 489 622 458T590 427",
        8592: "1063 281Q1084 268 1084 251Q1084 231 1063 221L649 220H235Q340 133 364 17Q368 1 368 -2Q368 -16 343 -17Q340 -17 338 -17H332Q317 -17 314 -14T305 6Q298 34 285 62T247 126T179 189T78 233Q64 237 64 251Q64 261 74 265T108 277T154 297Q212 328 251 379T305 495Q309 511 313 514T333 518H338Q363 517 367 510Q368 507 368 503Q368 500 364 484Q345 401 287 331Q254 295 235 282L649 281H1063",
        8593: "33 396Q14 396 14 423Q14 445 18 449T41 459Q72 466 99 478T147 505T185 537T215 571T238 604T254 635T264 661T270 678L272 685Q276 694 288 694Q298 692 300 689T307 672Q331 592 392 535T535 459Q553 454 557 450T561 423Q561 396 542 396Q531 396 501 405T418 443T329 517L319 529L318 179V-171Q307 -193 288 -193Q265 -193 258 -171L257 179V529L247 517Q209 473 158 444T76 405T33 396",
        8594: "65 251Q65 270 87 281H500L914 282Q881 304 842 357T785 482Q781 500 781 501Q781 512 792 517Q794 518 812 518H817Q832 518 835 515T844 495Q864 412 923 351T1065 270Q1085 263 1085 251Q1085 240 1077 236T1044 225T995 204Q937 173 898 122T844 6Q840 -10 836 -13T816 -17H811Q786 -16 782 -9Q781 -6 781 -2Q781 1 785 17Q813 138 914 220H500L87 221Q65 228 65 251",
        8595: "14 77Q14 104 33 104Q44 104 74 96T156 57T247 -17L257 -29V321Q257 669 259 675Q268 694 289 694Q295 693 300 691T307 686T313 679T318 672V321L319 -29L329 -17Q366 26 417 55T499 94T542 104Q561 104 561 77Q561 56 557 51T535 41Q481 28 438 0T370 -58T330 -119T308 -167T302 -187Q297 -194 288 -194Q278 -194 273 -186T265 -165T251 -127T220 -77Q151 15 41 41Q22 46 18 50T14 77",
        8596: "305 495Q309 511 313 514T333 518H338Q363 517 367 510Q368 507 368 503Q368 500 364 484Q345 401 287 331Q254 295 235 282L404 281H744L914 282Q880 305 839 362T785 484Q781 500 781 503Q781 517 806 518Q809 518 811 518H817Q832 518 835 515T844 495Q864 412 923 351T1065 270Q1085 263 1085 251Q1085 240 1077 236T1044 225T995 204Q937 173 898 122T844 6Q840 -10 836 -13T816 -17H811Q786 -16 782 -9Q781 -6 781 -2Q781 1 785 17Q813 138 914 220H235Q340 133 364 17Q368 1 368 -2Q368 -16 343 -17Q340 -17 338 -17H332Q317 -17 314 -14T305 6Q298 34 285 62T247 126T179 189T78 233Q64 237 64 251Q64 261 74 265T108 277T154 297Q212 328 251 379T305 495",
        8597: "33 469Q14 469 14 496Q14 518 18 522T41 532Q121 551 182 608T268 745Q275 767 288 767Q299 767 303 755T320 713T355 650Q424 558 535 532Q553 527 557 523T561 496Q561 469 542 469Q531 469 501 478T418 516T329 590L319 602L318 426V74L319 -102L329 -90Q366 -47 417 -18T499 21T542 31Q561 31 561 4Q561 -17 557 -22T535 -32Q454 -51 393 -108T307 -245Q300 -267 288 -267Q279 -267 274 -259T266 -238T250 -200T220 -150Q151 -58 41 -32Q22 -27 18 -23T14 4Q14 31 33 31Q44 31 74 23T156 -16T247 -90L257 -102V602L247 590Q209 546 158 517T76 478T33 469",
        8598: "429 724Q438 724 452 711T466 690Q466 681 452 671Q361 602 242 599H218L756 135Q832 69 913 -1T1036 -108L1077 -143Q1084 -151 1084 -163Q1084 -180 1074 -187T1054 -194H1052Q1043 -194 939 -105Q866 -42 812 5Q180 549 178 549V546Q179 542 179 539Q183 520 183 483Q183 435 172 390T149 323T130 296Q121 292 115 295Q85 312 85 328Q85 331 95 350T115 406T125 486Q125 540 110 583T79 648T64 675Q64 681 68 687T81 693Q87 693 94 690Q162 657 232 657Q296 657 349 681T420 722Q422 724 429 724",
        8599: "1069 693Q1076 693 1080 687T1085 675Q1085 671 1076 656T1055 621T1034 565T1024 486Q1024 442 1034 406T1054 351T1064 328Q1064 321 1057 313T1042 300L1034 295Q1030 293 1027 293Q1023 293 1020 295T1014 301T1009 308T1005 316T1001 324Q980 368 971 419Q966 442 966 484V492Q966 528 972 553Q971 553 757 368T328 -3T107 -191Q103 -193 94 -193Q78 -193 71 -184T64 -164Q64 -153 72 -143Q79 -136 382 124L934 599H909Q837 599 760 634T683 690Q683 697 696 710T722 724Q726 724 742 714T779 691T838 668T920 657Q959 657 991 666T1043 684T1069 693",
        8600: "65 663Q65 680 74 687T93 694H96Q104 694 118 683T204 610Q280 545 338 495Q969 -49 971 -49L970 -46Q970 -42 970 -39Q966 -20 966 18Q966 65 977 110T1001 177T1019 204Q1028 208 1034 205Q1064 188 1064 172Q1064 169 1054 150T1034 94T1024 14Q1024 -28 1033 -64T1054 -120T1075 -155T1085 -175Q1085 -181 1081 -187T1068 -193Q1062 -193 1055 -190Q987 -157 919 -157Q817 -157 739 -215Q727 -224 720 -224Q712 -224 697 -210Q683 -199 683 -190T697 -171Q788 -102 907 -99H931L393 365Q317 431 236 501T114 608L72 643Q65 651 65 663",
        8601: "80 -193Q73 -193 69 -187T64 -175Q64 -172 79 -150T109 -84T125 14Q125 58 115 94T95 149T85 172Q85 179 92 187T108 200L115 205Q119 207 122 207Q126 207 129 205T135 199T140 192T144 184T148 176Q169 132 178 81Q183 58 183 17Q183 -7 182 -24T178 -48L177 -53Q178 -53 389 129T816 498T1043 692Q1049 694 1054 694Q1070 694 1077 684T1085 664Q1085 653 1077 643Q1070 636 767 376L215 -98L240 -99Q312 -99 389 -134T466 -190Q466 -197 452 -210T429 -224Q422 -224 411 -215Q330 -157 229 -157Q190 -157 158 -166T106 -184T80 -193",
        8614: "65 426Q74 448 95 448Q112 448 125 426V281H500L914 282Q881 304 842 357T785 482Q781 500 781 501Q781 512 792 517Q794 518 812 518H817Q832 518 835 515T844 495Q864 412 923 351T1065 270Q1085 263 1085 251Q1085 240 1077 236T1044 225T995 204Q937 173 898 122T844 6Q840 -10 836 -13T816 -17H811Q786 -16 782 -9Q781 -6 781 -2Q781 1 785 17Q813 138 914 220H500L135 221Q134 221 133 221T130 220H125V76Q115 54 95 54Q73 54 65 76V426",
        8617: "1029 475Q1029 505 1068 505Q1129 501 1173 463T1218 363Q1218 296 1170 259T1066 221H1063L649 220H235Q340 133 364 17Q368 1 368 -2Q368 -16 343 -17Q340 -17 338 -17H332Q317 -17 314 -14T305 6Q298 34 285 62T247 126T179 189T78 233Q64 237 64 251Q64 261 74 265T108 277T154 297Q212 328 251 379T305 495Q309 511 313 514T333 518H338Q363 517 367 510Q368 507 368 503Q368 500 364 484Q345 401 287 331Q254 295 235 282L649 281H1063Q1105 284 1131 305T1158 361Q1158 385 1146 401Q1122 441 1063 444Q1029 446 1029 475",
        8618: "225 221H218Q159 221 112 260T65 363Q65 431 116 468T221 505Q254 503 254 474Q254 456 245 450T216 443T188 438Q152 427 137 401Q125 385 125 362Q125 334 147 310Q171 288 221 281H632L1046 282Q1013 304 974 357T917 482Q913 500 913 501Q913 512 924 517Q926 518 944 518H949Q964 518 967 515T976 495Q996 412 1055 351T1197 270Q1217 263 1217 251Q1217 240 1209 236T1176 225T1127 204Q1069 173 1030 122T976 6Q972 -10 968 -13T948 -17H943Q918 -16 914 -9Q913 -6 913 -2Q913 1 917 17Q945 138 1046 220H632L225 221",
        8636: "1063 281Q1084 268 1084 251Q1084 231 1063 221L572 220Q79 220 77 221Q64 225 64 244Q64 250 64 254T67 261T71 265T78 268T85 272Q142 302 189 345T258 421T296 484T315 516Q319 518 337 518Q358 518 363 512Q370 504 367 496Q360 469 319 404T219 290L209 282L636 281H1063",
        8637: "1063 281Q1084 268 1084 251Q1084 231 1063 221L636 220H209L219 212Q278 162 319 97T367 5Q370 -3 363 -11Q358 -17 337 -17H332Q318 -17 314 -14T302 7Q278 55 246 95T185 160T130 202T88 228L70 237Q64 243 64 257Q64 274 75 279Q78 281 571 281H1063",
        8640: "65 251Q65 270 87 281H513L940 282L930 290Q871 338 830 403T782 496Q779 510 791 517Q794 518 812 518H817Q831 518 835 515T847 494Q871 445 903 404T966 338T1022 298T1064 272T1083 259Q1085 255 1085 245Q1085 225 1072 221Q1070 220 578 220L87 221Q65 228 65 251",
        8641: "84 279Q89 281 580 281Q1070 281 1074 279Q1085 275 1085 256Q1085 245 1083 241T1066 230Q919 153 847 7Q839 -11 835 -14T817 -17H812Q791 -17 786 -11Q779 -3 782 5Q789 31 830 96T930 212L940 220H513L87 221Q64 229 64 250Q64 272 84 279",
        8652: "65 451Q65 470 87 481H513L940 482L930 490Q871 538 830 603T782 696Q779 710 791 717Q794 718 812 718H817Q831 718 835 715T847 694Q871 645 903 604T966 538T1022 498T1064 472T1083 459Q1085 455 1085 445Q1085 425 1072 421Q1070 420 578 420L87 421Q65 428 65 451ZM1063 281Q1084 268 1084 251Q1084 231 1063 221L636 220H209L219 212Q278 162 319 97T367 5Q370 -3 363 -11Q358 -17 337 -17H332Q318 -17 314 -14T302 7Q278 55 246 95T185 160T130 202T88 228L70 237Q64 243 64 257Q64 274 75 279Q78 281 571 281H1063",
        8656: "1063 169L1068 166Q1072 163 1074 162T1079 157T1083 149T1085 139Q1085 118 1063 109L733 108H404L412 99Q455 50 488 -10Q498 -27 493 -37Q487 -46 465 -46H460Q446 -46 439 -39T426 -18T399 25T344 89Q239 194 99 229Q96 230 92 231T85 232T79 234T73 235T69 237T66 240T65 244T64 250Q64 267 90 271Q197 295 286 361T430 525Q439 542 442 544T460 547H465Q487 547 492 539Q496 531 496 530Q496 521 471 482T414 405L404 394L733 393H1063Q1064 392 1069 389T1076 384T1082 375T1085 362Q1085 344 1063 333L700 332H338L324 321Q283 290 230 264L205 250Q266 224 323 180L338 170L700 169H1063",
        8657: "672 343Q672 326 670 320T657 313Q644 313 602 335Q577 349 557 361T527 381T509 395T499 403T495 406T494 118Q494 -166 492 -174Q484 -193 465 -193H463Q456 -193 453 -192T444 -186T433 -170V465L423 477Q407 495 394 514T367 554T351 579Q349 576 339 560T313 520T279 477L269 465V-22V-102Q269 -132 269 -145T268 -169T266 -180T260 -185T253 -191Q248 -193 239 -193H237Q218 -193 210 -174Q208 -166 208 118Q208 406 207 406L199 399Q191 392 165 374T100 335Q58 313 45 313Q35 313 33 319T30 343V349Q30 359 30 362T35 369T45 374T66 383T100 401Q267 499 333 680Q339 694 351 694Q361 694 365 687T380 652T407 597Q442 536 489 489T573 420T638 383T670 365Q672 361 672 343",
        8658: "64 362Q64 380 87 393H416L745 394L735 405Q708 436 681 477T654 531Q654 547 679 547H684H689Q703 547 710 540T723 519T750 475T806 411Q914 303 1059 271Q1060 271 1063 270T1068 269T1072 268T1076 266T1079 264T1082 260T1083 256T1084 250Q1084 242 1080 238T1063 231T1035 225T992 211T934 185Q797 112 719 -24Q710 -40 706 -43T689 -46H684Q653 -46 653 -31Q653 -24 661 -10Q694 50 737 99L745 108H416L87 109Q64 117 64 139Q64 156 87 169H449L812 170L826 180Q842 193 860 204T892 223T918 237T937 246L944 250L919 264Q866 290 825 321L811 332H449L87 333Q64 343 64 362",
        8659: "30 157Q30 174 32 180T46 187Q59 187 104 163Q154 136 198 101L207 94Q208 94 208 382Q208 666 210 674Q219 694 241 694Q254 692 262 683Q266 679 267 674Q269 658 269 522V35L279 23Q295 5 308 -14T335 -54T351 -79Q353 -76 363 -60T389 -20T423 23L433 35V671Q439 682 444 686T452 692T463 693H465Q484 693 492 674Q494 666 494 382Q494 94 495 94L504 101Q547 135 593 160T652 187Q665 191 671 177Q672 175 672 157Q672 137 669 134T636 116Q606 101 578 83T528 47T486 9T452 -30T424 -68T403 -103T387 -134T377 -159T370 -176L367 -184Q360 -194 351 -194Q345 -194 342 -192T334 -182T327 -166T315 -137T295 -97Q260 -36 213 11T129 80T63 117T32 136Q30 139 30 157",
        8660: "336 497Q358 541 363 544Q367 547 379 547H384Q401 547 405 545Q418 538 414 525T389 474T346 408L335 393H814L803 408Q781 436 760 474T735 525T744 545Q748 547 765 547Q771 547 774 547T780 546T786 544T790 541T794 535T799 527T805 514T813 497Q841 446 877 406T950 340T1014 301T1068 276L1096 265Q1102 259 1102 251Q1102 240 1085 232Q981 195 902 121Q835 56 798 -25Q791 -40 787 -43T765 -46T744 -44Q735 -40 735 -30Q735 -15 760 28T806 98L814 108H335L343 98Q361 75 378 46T404 -1T414 -24Q418 -37 405 -44Q401 -46 384 -46T363 -43T351 -25Q314 56 247 121Q216 150 182 173T125 206T79 226T53 237Q47 243 47 251Q47 254 47 256T49 261T52 264T57 267T61 268T66 270T71 272Q246 335 336 497ZM985 251Q932 280 882 323L871 332H278Q264 321 253 311T237 297T214 282T164 251L176 244Q221 218 278 169H871Q928 218 973 244L985 251",
        8661: "49 441Q30 441 30 464V471V480Q30 498 44 502Q237 573 331 750Q337 767 351 767Q360 767 368 753T400 702T460 629Q504 584 552 554T632 511T666 497Q672 493 672 471Q672 454 670 449Q664 441 653 441Q639 443 591 465T508 513L495 522L494 386V114L495 -22L508 -13Q543 12 591 34T653 59Q672 59 672 36V29V20Q672 2 658 -2Q465 -71 367 -257Q360 -267 351 -267Q343 -267 336 -257T320 -231T292 -187T242 -129Q198 -84 150 -54T70 -11T36 3Q30 7 30 29Q30 46 32 51Q38 59 49 59Q63 57 111 35T194 -13L208 -22V522L194 513Q159 488 111 466T49 441ZM422 584Q411 594 400 606T383 626T366 648T351 667Q349 665 339 652T314 620T280 584L269 573V-73L280 -84Q305 -108 351 -166Q353 -164 363 -151T389 -119T422 -84L433 -73V573L422 584",
        8704: "1 664Q-2 685 23 693H27Q46 693 54 680T102 578L148 475H492L533 570Q541 586 548 603T560 630T569 650T576 667T582 678T588 686T594 691T600 693T609 694Q622 694 631 684T639 662Q637 653 492 325T341 -8Q333 -16 320 -16Q306 -16 298 -8Q294 -4 147 326L1 656V664ZM464 414H319Q175 414 175 413L319 88L464 414",
        8707: "81 347Q81 359 84 363T104 378H513V633H300L87 634Q64 642 64 664Q64 685 84 692Q89 694 321 694H552Q571 681 574 669V25Q567 7 552 1H87Q64 12 64 30T87 61H513V317H308Q103 317 99 319Q81 328 81 347",
        8709: "285 711Q307 711 326 708T357 701T370 698Q371 698 375 710T383 735T389 750Q395 767 415 767Q431 767 438 757T446 738T436 701T426 670Q426 668 433 664Q468 633 489 588Q511 542 519 488T528 344Q528 286 524 243T508 150T466 63T394 6Q345 -17 287 -17Q265 -17 246 -14T216 -7T203 -4Q191 -47 183 -60T159 -73Q146 -73 137 -63T128 -44Q128 -38 138 -7L148 24L141 30Q134 35 120 49Q94 77 78 113T56 194T48 268T46 344Q46 388 47 416T56 494T78 577T122 644T194 694Q239 711 285 711ZM351 639Q350 639 346 642T337 648T325 654T306 658T283 660Q254 660 221 638T181 567Q171 513 171 375Q171 164 182 129L351 639ZM402 356Q402 516 395 555Q395 557 395 559T394 563T394 566L393 568L223 57Q252 34 286 34H288Q318 34 346 53T387 109Q402 152 402 329V356",
        8710: "901 12Q901 7 892 0H479Q65 0 62 2Q56 6 56 11Q56 14 242 347T433 685Q438 694 450 696Q454 698 480 698H506L523 687Q526 683 711 354T899 17Q901 13 901 12ZM653 137L427 538L202 137L315 136H540L653 137",
        8712: "97 251Q97 393 194 484T417 586Q418 586 436 586T482 586T538 587H648Q649 586 652 584T658 580T664 575T668 568T670 557Q670 536 648 527L534 526Q515 526 491 526T457 526T435 526T417 525T404 523T390 521T374 517Q298 498 243 447T167 324Q159 295 159 283Q159 281 403 281H648Q649 280 652 278T658 274T664 269T668 262T670 251Q670 230 648 221L403 220Q159 220 159 218Q159 206 166 182T190 122T247 50T341 -6Q380 -20 405 -22T534 -25H648Q649 -26 654 -29T661 -34T667 -43T670 -56Q670 -74 648 -85L541 -86Q419 -86 396 -82Q276 -65 187 24T97 251",
        8713: "126 -210Q116 -210 107 -203T97 -179Q97 -171 99 -166Q99 -165 111 -145T150 -80T203 8Q97 104 97 251Q97 393 194 484T417 586Q418 586 436 586T482 586T538 587H549Q565 614 582 643T608 685L616 698Q623 711 641 711Q651 711 660 704T670 681Q670 672 667 667Q666 666 661 657T644 627T620 587H648Q649 586 652 584T658 580T664 575T668 568T670 557Q670 536 648 527L584 526L437 281H648Q649 280 652 278T658 274T664 269T668 262T670 251Q670 230 648 221L403 220H401L283 23Q311 5 341 -6Q380 -20 405 -22T534 -25H648Q649 -26 654 -29T661 -34T667 -43T670 -56Q670 -74 648 -85L541 -86Q419 -86 396 -82Q320 -71 252 -29Q152 -197 148 -201Q139 -210 126 -210ZM235 62L330 220Q159 219 159 218Q159 196 176 150T235 62ZM366 281L513 526Q503 526 487 526T465 526T448 525T433 525T422 525T412 524T403 523T394 521T385 519T374 517Q298 498 243 447T167 324Q159 295 159 283Q159 281 366 281",
        8715: "96 251Q96 268 119 281H363Q607 281 607 283Q607 295 600 319T576 379T519 451T425 507Q386 521 361 523T233 526L119 527Q96 535 96 557Q96 578 116 585Q121 587 229 587Q238 587 257 587T288 588Q366 588 435 568T568 488Q670 388 670 251Q670 155 621 78T499 -39T345 -85Q336 -86 225 -86L119 -85Q96 -77 96 -55Q96 -38 119 -25H233Q356 -24 371 -21Q373 -21 393 -16Q468 3 523 55T599 177Q607 206 607 218Q607 220 363 220L119 221Q96 229 96 251",
        8722: "119 221Q96 230 96 251T116 279Q121 281 448 281H775Q776 280 779 278T785 274T791 269T795 262T797 251Q797 230 775 221H119",
        8723: "64 155Q64 172 87 185H416V476H251L87 477Q64 485 64 507Q64 528 84 535Q89 537 448 537H807Q808 536 811 534T817 530T823 525T827 518T829 507Q829 486 807 477L642 476H477V185H807Q808 184 811 182T817 178T823 173T827 166T829 155Q829 134 807 125L642 124H477V-39Q477 -203 475 -208Q466 -227 446 -227Q427 -227 417 -205L416 -41V124H251L87 125Q64 133 64 155",
        8725: "451 730Q460 750 479 750Q492 750 501 740T510 718Q508 708 318 244L122 -232Q112 -250 95 -250Q82 -250 73 -241T64 -218Q66 -205 258 261T451 730",
        8726: "64 718Q63 731 72 740T94 750Q106 750 113 743Q118 741 122 732L318 256Q508 -208 510 -218Q511 -231 502 -240T480 -250Q460 -250 451 -230Q451 -229 259 238T64 718",
        8727: "236 431Q237 447 251 459T287 472T323 459T338 431Q338 423 328 363L317 300Q318 300 340 317T392 356T435 387Q442 390 450 390Q470 390 485 374T501 335Q501 326 500 320T494 309T486 300T473 293T458 287T438 280T414 272L353 250L414 228Q422 225 436 221T457 214T472 208T485 201T493 192T499 181T501 166Q501 141 484 126T450 111Q447 111 445 111T441 111T437 112T433 114T428 117T422 121T414 127T404 135T391 145T374 158L317 200L328 137Q338 77 338 69Q336 52 321 40T287 28T253 40T236 69Q236 77 246 137L257 200Q256 200 234 183T182 144T139 113Q132 110 124 110Q104 110 89 126T73 165Q73 174 74 180T80 191T88 200T101 207T116 213T136 220T160 228L221 250L160 272Q152 275 138 279T117 286T102 292T89 299T81 308T75 319T73 334Q73 359 90 374T124 389Q127 389 129 389T133 389T137 388T141 386T146 383T152 379T160 373T170 365T183 355T200 342L257 300L246 363Q236 423 236 431",
        8728: "64 251Q64 303 80 344T121 409T175 448T230 469T275 474Q277 474 283 474T292 473Q385 473 447 415T510 251Q510 149 449 89T287 28T126 88T64 251ZM448 251Q448 325 405 369T286 413Q215 413 171 371T126 251Q126 177 168 133T287 89Q361 89 404 132T448 251",
        8729: "64 251Q64 303 80 344T121 409T175 448T230 469T275 474Q277 474 283 474T292 473Q385 473 447 415T510 251Q510 149 449 89T287 28T126 88T64 251",
        8730: "107 178Q100 178 89 188T78 207Q78 216 84 220Q85 221 124 248T207 304T260 338Q269 340 275 335Q276 334 370 156L463 -20L698 393Q928 800 935 811Q944 820 954 820Q972 820 980 811T988 789Q988 781 858 553Q776 409 718 306Q452 -166 447 -171Q439 -179 422 -180Q405 -180 400 -175Q399 -174 346 -73T241 128T187 229L151 205Q111 178 107 178",
        8733: "65 222Q65 282 88 329T144 401T208 438T261 451H273Q312 451 320 450Q456 431 526 330L537 316Q638 451 778 451Q813 451 830 445V388Q821 391 799 391Q758 391 721 377T660 342T618 301T592 266L584 251Q648 152 697 114Q748 74 804 74H806Q823 74 829 77Q830 77 830 38V-1L820 -3Q801 -7 786 -7H771Q699 -7 632 25T527 114L516 128Q414 -8 276 -8Q192 -8 129 56T65 222ZM256 53Q296 53 332 67T392 102T434 143T461 178L469 193Q405 292 356 330Q308 369 251 369H243Q196 369 156 328T116 221Q116 191 124 161T158 99T225 55Q234 53 256 53",
        8734: "65 219Q65 318 132 385T302 452Q473 452 573 331L589 312L596 320Q710 452 857 452Q948 452 1016 386T1084 225Q1084 125 1017 59T848 -8Q679 -8 576 113L560 132L553 124Q439 -8 292 -8Q200 -8 133 58T65 219ZM1033 224Q1033 291 987 340T875 389Q748 389 648 261Q641 253 642 251Q717 163 748 137Q813 81 880 81Q941 81 987 120T1033 224ZM275 56Q315 56 353 70T418 104T466 144T497 178L507 192Q507 193 474 230T441 269Q355 362 267 362Q210 362 163 324T116 221Q116 150 162 103T275 56",
        8736: "71 0L68 2Q65 3 63 5T58 11T55 20Q55 21 56 23V25Q55 27 55 30Q55 31 56 33V35Q55 37 55 40Q55 42 57 48Q67 63 346 381Q421 467 518 578Q607 680 623 697T647 714Q656 714 661 708T666 694V692Q676 687 676 674Q676 668 673 663Q672 662 637 622T534 503T400 350L147 61L386 60H653Q666 50 666 40V38Q676 31 676 20Q676 8 661 0H71",
        8739: "160 -249Q138 -249 129 -225V250Q129 725 131 729Q139 750 159 750T190 725V-225Q181 -249 160 -249",
        8741: "205 -225Q201 -234 199 -237T191 -244T175 -248T161 -246Q151 -240 146 -229Q145 -224 145 251Q145 725 146 730Q156 750 176 750Q193 748 205 727V-225ZM369 727L372 732Q375 737 377 740T385 747T398 750Q406 750 413 747Q423 740 428 730Q430 720 430 251Q430 -219 428 -229Q423 -240 413 -246Q408 -248 400 -248Q393 -248 388 -247T379 -242T375 -236T371 -230L369 -225V727",
        8743: "95 -16Q78 -16 71 -6T64 14Q64 20 65 22L212 308Q359 593 361 595Q370 604 385 604Q398 602 405 595Q407 593 554 308L701 22Q702 20 702 15Q702 1 693 -8T671 -17Q661 -17 651 -9Q647 -5 515 251L383 506L251 251Q119 -5 116 -8Q108 -16 95 -16",
        8744: "64 572Q64 585 72 594T94 604T116 595Q119 592 251 336L383 81L515 336Q647 592 651 596Q661 604 671 604Q684 604 693 595T702 572Q702 567 701 565L554 279Q407 -6 405 -8Q404 -9 401 -11T397 -14Q392 -16 383 -16H380Q369 -16 361 -8Q359 -6 212 279L65 565Q65 566 65 568T64 572",
        8745: "94 -16Q73 -16 64 8V209Q64 239 64 287Q65 418 69 432Q70 434 70 435Q84 487 125 523T216 575T299 597T354 603H372Q444 603 501 590T591 558T648 515T681 471T696 435Q696 434 697 432Q701 417 702 309Q702 303 702 287Q702 239 702 209V8Q693 -16 672 -16Q650 -16 643 3Q641 8 641 201Q641 397 640 403Q631 472 558 507T383 542Q339 542 298 535T219 511T156 468T126 403Q125 397 125 201Q125 8 123 3Q116 -16 94 -16",
        8746: "672 603Q693 603 702 579V378Q702 348 702 300Q701 169 697 155Q696 153 696 152Q676 78 593 31T383 -16Q265 -16 179 28T70 152Q70 153 69 155Q65 170 64 278Q64 285 64 300Q64 348 64 378Q64 579 65 583Q74 604 94 604T123 584Q125 579 125 386Q125 190 126 184Q135 115 210 80T383 44Q426 44 467 51T546 75T609 119T640 184Q641 190 641 386Q641 579 643 584Q650 603 672 603",
        8747: "204 -71Q204 -108 181 -124T137 -141Q132 -141 132 -142Q142 -161 154 -161Q164 -161 186 -152Q200 -145 210 -135T228 -107T241 -77T249 -38T254 -2T258 38T262 74Q282 265 334 489Q334 490 337 503T341 523T347 544T355 569T365 594T379 620T397 643T420 666T447 685T481 700Q511 711 539 711T587 696T616 656T628 612T632 573Q632 536 610 519T562 501Q534 501 513 519T492 571Q492 608 515 624T559 641Q564 641 564 642Q554 661 542 661Q532 661 510 652Q496 645 486 635T468 607T455 577T447 538T442 502T438 462T434 426Q414 235 362 11Q352 -35 347 -54T328 -101T291 -152Q235 -208 162 -211Q147 -211 136 -208T109 -196T83 -165T67 -108Q64 -94 64 -73Q64 -37 86 -19T134 -1Q162 -1 183 -19T204 -71",
        8764: "64 155Q64 210 84 262T150 353T257 391Q300 391 341 371T417 321T484 264T557 215T637 194Q702 194 745 244T788 367Q796 391 808 391Q815 391 821 381T828 353V342Q828 252 776 181T637 109Q594 109 552 129T476 179T409 236T336 285T256 306Q193 306 149 258T105 132Q98 109 86 109Q76 109 70 122T64 155",
        8768: "64 561Q64 570 76 576T108 583Q174 583 214 535T254 407Q254 368 238 324T202 248T166 173T149 92Q149 43 169 2T217 -39Q231 -40 242 -46T254 -60Q254 -69 241 -75T210 -82Q145 -82 105 -34T64 93Q64 133 80 177T116 253T152 328T169 408Q169 461 148 500T105 540Q92 540 78 545T64 561",
        8771: "64 295Q64 378 117 440T257 502Q298 502 339 485T416 443T486 394T560 352T637 335Q693 335 740 373T788 478Q796 502 808 502Q815 502 821 492T828 465V455Q828 365 771 308T640 250Q603 250 562 265T501 294T439 336L370 382Q308 417 256 417Q205 417 164 388T110 317Q110 316 109 304T107 286T103 270T97 255T86 250Q76 250 70 263T64 295ZM64 6T64 27T87 56H93Q99 56 110 56T137 56T173 56T217 56T267 57T323 57T383 57T448 57H807Q808 56 811 54T815 52T819 49T823 45T826 40T828 34T829 27Q829 7 807 -3H87Q64 6 64 27",
        8773: "64 402Q64 457 84 509T150 600T257 638Q300 638 341 618T417 569T484 511T557 462T637 441Q702 441 745 491T788 614Q796 638 808 638Q815 638 821 628T828 600V589Q828 499 776 428T637 356Q594 356 552 376T476 425T409 483T336 532T256 553Q193 553 149 505T105 379Q98 356 86 356Q76 356 70 369T64 402ZM87 197Q64 207 64 226Q64 247 84 255Q89 257 448 257H807Q808 256 811 254T817 250T823 245T827 238T829 227Q829 209 807 197H87ZM87 -27Q64 -18 64 3Q64 23 86 32Q89 33 448 33H807L812 30Q816 27 818 26T823 21T827 13T829 3Q829 -18 807 -27H87",
        8776: "64 345Q64 423 119 473T250 524Q301 524 356 503T451 455T542 407T636 385Q700 385 743 417T786 481Q786 493 791 508T807 524Q817 524 823 512T829 479Q829 404 776 352T638 300Q590 300 537 321T443 369T352 417T256 439Q207 439 166 417T110 359Q109 357 107 341T100 312T85 300Q77 300 71 313T64 345ZM64 77Q64 155 119 205T250 256Q302 256 357 235T451 187T541 139T636 117Q699 117 742 148T786 213Q786 231 792 243T808 256T823 242T829 208Q829 134 776 83T640 32Q591 32 537 53T443 101T352 149T256 171Q206 171 165 148T110 91Q109 89 107 73T100 44T85 32Q77 32 71 45T64 77",
        8781: "798 533Q812 533 820 524T829 502T819 480T769 440Q655 355 537 330Q492 322 447 322Q401 322 356 330Q289 344 219 381T118 443T73 481Q64 490 64 503Q64 517 72 525T94 533Q99 533 102 532Q107 531 138 507T209 456T314 405T446 382Q604 382 765 515Q788 533 798 533ZM95 -32Q81 -32 73 -23T64 -1Q64 10 74 21T124 61Q213 127 293 153T421 179L422 180Q424 180 426 180T432 180T441 180T452 179Q612 179 769 61Q811 29 820 19T829 -1Q829 -14 821 -23T798 -32Q788 -32 765 -14Q608 118 446 118Q287 118 128 -14Q105 -32 95 -32",
        8784: "87 333Q64 343 64 362Q64 383 84 391Q89 393 448 393H807Q808 392 811 390T817 386T823 381T827 374T829 363Q829 345 807 333H87ZM87 109Q64 118 64 139Q64 159 86 168Q89 169 448 169H807L812 166Q816 163 818 162T823 157T827 149T829 139Q829 118 807 109H87ZM362 635Q362 671 387 696T444 721Q488 721 510 693T533 635Q533 606 512 579T448 551Q406 551 384 577T362 635",
        8800: "189 -210Q179 -210 170 -203T160 -179Q160 -171 162 -166Q165 -163 327 109H87Q64 118 64 139Q64 159 86 168Q89 169 363 169L461 333H87Q64 343 64 362Q64 383 84 391Q89 393 448 393H496Q533 455 583 539T656 660T679 698Q686 711 704 711Q714 711 723 704T733 681Q733 672 730 667Q729 664 709 631T645 523T567 393H807Q808 392 811 390T817 386T823 381T827 374T829 363Q829 345 807 333H532L433 169H807L812 166Q816 163 818 162T823 157T827 149T829 139Q829 118 807 109H398Q217 -195 211 -201Q202 -210 189 -210",
        8801: "87 445Q64 454 64 475Q64 497 84 503Q89 505 448 505H807Q808 504 812 502T818 497T823 492T827 484T829 474Q829 456 807 445H87ZM87 221Q64 230 64 251T84 279Q89 281 448 281H807Q808 280 811 278T817 274T823 269T827 262T829 251Q829 230 807 221H87ZM64 6T64 27T87 56H93Q99 56 110 56T137 56T173 56T217 56T267 57T323 57T383 57T448 57H807Q808 56 811 54T815 52T819 49T823 45T826 40T828 34T829 27Q829 7 807 -3H87Q64 6 64 27",
        8804: "797 55Q797 45 790 35T767 25H759L434 180Q108 336 105 339Q96 348 96 360Q96 378 114 388Q126 394 439 544T757 695Q763 697 766 697Q780 697 788 688T797 666Q797 654 788 645Q784 641 507 509T197 361L466 232Q785 80 790 74Q797 66 797 55ZM119 -199Q96 -191 96 -169Q96 -160 102 -152T119 -140H124Q130 -140 140 -140T164 -140T197 -140T237 -140T283 -139T334 -139T389 -139T448 -139H775Q797 -153 797 -169Q797 -187 775 -199H119",
        8805: "127 25Q110 25 103 34T96 54Q96 66 105 75Q109 80 439 238L696 361Q113 637 105 645Q96 654 96 667Q96 679 104 688T128 697Q137 696 460 541T788 382Q797 373 797 360Q797 348 788 339Q785 336 459 180L135 25H127ZM119 -199Q96 -191 96 -169Q96 -160 102 -152T119 -140H124Q130 -140 140 -140T164 -140T197 -140T237 -140T283 -139T334 -139T389 -139T448 -139H775Q797 -153 797 -169Q797 -187 775 -199H119",
        8810: "734 -74T734 -86T727 -107T704 -116H702Q694 -116 584 -55Q473 7 380 58Q87 219 73 229Q64 238 64 250Q64 263 73 272Q87 282 380 443Q695 616 699 617H700Q718 617 726 607T734 588Q734 568 717 560Q705 554 435 404L157 250L439 94Q721 -61 726 -66Q734 -74 734 -86ZM1085 -74T1085 -86T1078 -107T1055 -116H1053Q1045 -116 935 -55Q824 7 731 58Q438 219 424 229Q415 238 415 250Q415 263 424 272Q438 282 731 443Q1046 616 1050 617H1051Q1069 617 1077 607T1085 588Q1085 568 1068 560Q1056 554 786 404L508 250L790 94Q1072 -61 1077 -66Q1085 -74 1085 -86",
        8811: "64 588Q64 600 72 609T94 618H95Q103 618 209 559Q322 496 419 443Q712 282 725 272Q734 263 734 250Q734 238 725 229Q714 220 415 55T110 -113Q103 -116 95 -116Q78 -116 71 -106T64 -86Q64 -74 72 -66Q77 -61 359 94L641 250L363 404Q277 452 173 509Q95 552 82 560T66 576V577Q64 585 64 588ZM415 588Q415 600 423 609T445 618H446Q454 618 560 559Q673 496 770 443Q1063 282 1076 272Q1085 263 1085 250Q1085 238 1076 229Q1065 220 766 55T461 -113Q454 -116 446 -116Q429 -116 422 -106T415 -86Q415 -74 423 -66Q428 -61 710 94L992 250L714 404Q628 452 524 509Q446 552 433 560T417 576V577Q415 585 415 588",
        8826: "797 -57Q797 -65 790 -75T766 -86Q748 -86 741 -74T733 -43T719 8T681 72Q647 112 588 141T475 185T343 207T230 216T136 219Q96 219 96 250Q96 280 132 280H136Q193 281 239 283T347 292T457 310T556 342T643 391T703 460T735 553Q741 585 763 585Q781 585 789 575T797 556Q797 540 792 513T758 434T682 345Q605 285 481 254L462 249Q483 246 526 233T633 185T733 104Q767 63 782 15T797 -57",
        8827: "96 556Q96 568 104 577T126 586Q152 586 158 553Q164 503 188 462T247 394T331 345T429 313T539 294T649 284T758 280H760Q797 280 797 250Q797 219 760 219H758Q627 217 529 204T347 160T216 77T158 -54Q152 -86 126 -86Q110 -86 103 -76T96 -57Q96 -41 101 -14T135 65T211 154Q288 214 412 245L431 250Q410 252 367 265T259 314T160 395Q127 435 112 483T96 556",
        8834: "96 251Q96 389 191 482T417 586Q418 586 428 586T456 586T496 586T546 587T601 587H775Q776 586 779 584T785 580T791 575T795 568T797 557Q797 536 775 527L597 526Q411 525 395 522Q390 521 370 516Q285 494 222 424T158 251Q158 131 246 53Q313 -9 408 -23Q417 -24 597 -25H775Q776 -26 781 -29T788 -34T794 -43T797 -56Q797 -74 775 -85H493Q407 -85 376 -79Q257 -55 177 35T96 251",
        8835: "96 -55Q96 -38 119 -25H296Q482 -24 498 -21Q503 -20 523 -15Q609 7 672 77T735 251T665 431T485 524Q476 525 296 526L119 527Q96 535 96 557Q96 578 116 585Q121 587 300 587Q451 586 476 585T522 579Q632 556 714 468T796 251Q796 112 695 13Q612 -65 497 -82Q473 -86 289 -86L119 -85Q96 -77 96 -55",
        8838: "96 361Q96 499 191 592T417 696Q418 696 428 696T456 696T496 696T546 697T601 697H775Q776 696 779 694T785 690T791 685T795 678T797 667Q797 646 775 637L597 636Q411 635 395 632Q390 631 370 626Q285 604 222 534T158 361Q158 241 246 163Q313 101 408 87Q417 86 597 85H775Q776 84 781 81T788 76T794 67T797 54Q797 36 775 25H493Q407 25 376 31Q257 55 177 145T96 361ZM149 -199Q127 -191 127 -169T149 -140H154Q160 -140 169 -140T192 -140T224 -140T262 -140T306 -139T354 -139T407 -139T463 -139H775Q776 -140 779 -142T785 -146T791 -151T795 -158T797 -169Q797 -190 775 -199H149",
        8839: "96 55Q96 72 119 85H296Q482 86 498 89Q503 90 523 95Q609 117 672 187T735 361T665 541T485 634Q476 635 296 636L119 637Q96 645 96 667Q96 688 116 695Q121 697 300 697Q451 696 476 695T522 689Q632 666 714 578T796 361Q796 222 695 123Q612 45 497 28Q473 24 289 24L119 25Q96 33 96 55ZM119 -199Q96 -190 96 -169T116 -141Q121 -139 433 -139H745Q766 -152 766 -170Q766 -190 745 -199H119",
        8846: "672 603Q693 603 702 579V378Q702 348 702 300Q701 169 697 155Q696 153 696 152Q676 78 593 31T383 -16Q265 -16 179 28T70 152Q70 153 69 155Q65 170 64 278Q64 285 64 300Q64 348 64 378Q64 579 65 583Q74 604 94 604T123 584Q125 579 125 386Q125 190 126 184Q135 115 210 80T383 44Q426 44 467 51T546 75T609 119T640 184Q641 190 641 386Q641 579 643 584Q650 603 672 603ZM353 412Q353 420 353 435T352 456Q352 483 358 495T385 507Q403 506 409 494T415 457Q415 451 415 436T414 411V341H558Q579 329 579 311Q579 289 558 281L486 280H414V136Q400 114 384 114Q363 114 354 136L353 208V280H281L209 281Q187 289 187 310Q187 328 209 341H353V412",
        8849: "127 25Q111 29 104 49V362L105 675Q114 693 127 696H132Q138 696 149 696T174 696T208 696T249 696T297 697T350 697T407 697T468 697H806Q828 683 828 666Q828 646 806 637L485 636H165V85H805Q806 84 809 82T813 80T817 77T821 73T824 68T826 62T827 55Q827 34 806 25H127ZM96 -190T96 -169T119 -140H125Q131 -140 141 -140T167 -140T201 -140T242 -140T290 -139T344 -139T402 -139T463 -139H805Q806 -140 809 -142T813 -144T817 -147T821 -151T824 -156T826 -162T827 -169Q827 -190 806 -199H119Q96 -190 96 -169",
        8850: "66 55Q66 74 89 85H728V636H408L88 637Q66 645 66 667T88 696H94Q99 696 110 696T135 696T169 696T210 696T258 697T311 697T368 697T429 697H767Q786 684 789 672V49Q782 31 767 25H88Q66 32 66 55ZM88 -199Q66 -191 66 -169Q66 -148 87 -140Q91 -139 433 -139H775Q776 -140 779 -142T783 -144T787 -147T791 -151T794 -156T796 -162T797 -169Q797 -189 775 -199H88",
        8851: "131 25Q121 1 100 1Q81 1 71 23L70 301Q70 579 72 583Q77 598 90 602Q95 604 385 604H674Q693 591 696 579V25Q686 1 665 1Q646 1 636 23L635 283V543H131V25",
        8852: "696 25Q689 7 674 1H93Q77 7 71 23L70 301Q70 579 72 583Q80 604 100 604T131 579V61H635V579Q644 603 666 603Q687 603 696 579V25",
        8853: "64 250Q64 350 98 426T189 546T307 610T434 632Q485 632 496 631Q572 621 635 592Q669 575 699 550T760 484T809 384T828 250Q828 77 725 -27T446 -132Q272 -132 168 -27T64 250ZM416 282V570H414Q341 564 285 535T202 475T156 397T134 332T128 287Q127 283 127 282H416ZM765 288Q760 344 743 389T700 462T647 512T589 543T538 560T499 568L483 570H478V282H766L765 288ZM416 -69V220H127Q130 195 131 189T138 155T150 115T168 76T196 35T234 0T286 -35Q337 -61 410 -69H416ZM483 -69Q554 -60 607 -33T687 21T733 93T756 156T764 209Q766 217 766 220H478V-69H483",
        8854: "64 250Q64 350 98 426T189 546T307 610T434 632Q485 632 496 631Q572 621 635 592Q669 575 699 550T760 484T809 384T828 250Q828 77 725 -27T446 -132Q272 -132 168 -27T64 250ZM765 288Q753 424 666 497T446 571T227 498T128 288L127 282H766L765 288ZM446 -70Q578 -70 666 4T765 213L766 220H127Q130 195 131 189T138 155T150 115T168 76T196 35T234 0T286 -35Q353 -70 446 -70",
        8855: "64 250Q64 350 98 426T189 546T307 610T434 632Q485 632 496 631Q572 621 635 592Q669 575 699 550T760 484T809 384T828 250Q828 77 725 -27T446 -132Q272 -132 168 -27T64 250ZM647 512Q567 571 447 571Q340 571 262 523Q237 507 237 505L342 399L447 295L657 505L647 512ZM298 356L192 461Q180 445 161 411Q126 341 126 251Q126 128 192 40L403 250L298 356ZM701 41Q704 41 719 63T750 138T767 250Q767 310 750 362T719 437T701 460L491 250L701 41ZM238 -5Q238 -8 261 -22T336 -53T447 -70Q567 -70 647 -11L657 -4L447 206L342 101Q238 -1 238 -5",
        8856: "64 250Q64 350 98 426T189 546T307 610T434 632Q485 632 496 631Q572 621 635 592Q669 575 699 550T760 484T809 384T828 250Q828 77 725 -27T446 -132Q272 -132 168 -27T64 250ZM657 505Q656 506 650 510T638 518T623 527T604 537T581 547T553 556T522 563T486 569T446 571Q305 571 216 487T126 251Q126 128 192 40L657 505ZM447 -70Q591 -70 679 16T767 250Q767 308 751 360T719 436T701 460L469 228Q238 -1 238 -5Q238 -8 261 -22T336 -53T447 -70",
        8857: "64 250Q64 350 98 426T189 546T307 610T434 632Q485 632 496 631Q572 621 635 592Q669 575 699 550T760 484T809 384T828 250Q828 77 725 -27T446 -132Q272 -132 168 -27T64 250ZM767 252Q767 395 681 483T446 571Q303 571 215 486T126 249Q126 107 212 19T446 -70Q596 -70 681 18T767 252ZM335 251Q335 297 368 329T441 361Q498 361 527 327T557 250Q557 202 525 171T446 140Q397 140 366 173T335 251",
        8866: "65 672Q76 693 91 693Q115 693 123 674Q125 669 125 523V378H615Q618 376 622 373T628 369T632 366T635 362T636 356T637 347Q637 328 619 319Q615 317 370 317H125V171Q125 25 123 20Q114 1 94 1Q73 1 65 23V672",
        8867: "64 327T64 347T89 378H577V525L578 672Q592 693 604 693Q629 693 638 669V25Q628 1 607 1Q588 1 578 23L577 170V317H88Q64 327 64 347",
        8868: "64 664Q64 675 71 683T87 693H93Q99 693 110 693T137 693T173 693T217 694T267 694T323 694T383 694T448 694H807Q808 693 811 691T817 687T823 682T827 675T829 664Q829 643 807 634L642 633H477V25Q467 1 446 1Q427 1 417 23L416 328V633H251L87 634Q64 643 64 664",
        8869: "65 31Q65 38 66 41T71 50T87 61H416V366L417 672Q431 693 443 693Q468 693 477 669V61H807Q808 60 811 58T817 54T823 49T827 42T829 31Q829 10 807 1H87Q65 10 65 31",
        8872: "160 -249Q138 -249 129 -225V250Q129 725 131 729Q139 750 159 750T190 725V392Q219 393 537 393H896Q897 392 900 390T906 386T912 381T916 374T918 363Q918 345 896 333H190V169H896L900 166Q905 163 907 162T912 157T916 149T918 139Q918 118 896 109H190V-225Q181 -249 160 -249",
        8900: "280 522Q281 523 285 523H289Q301 523 366 457Q404 420 431 393Q533 291 546 277T560 250Q560 239 548 226T431 108Q313 -10 304 -16Q297 -21 287 -21Q278 -21 275 -19Q270 -17 146 107T18 238Q15 242 15 251Q15 258 18 263Q20 268 145 392T274 519L280 522ZM388 350L288 449L188 350L89 250L288 52L487 250L388 350",
        8901: "74 251Q74 286 99 311T156 336Q200 336 222 308T245 250Q245 221 224 194T160 166T96 193T74 251",
        8902: "270 491Q274 502 287 502Q298 502 304 491Q304 486 323 396T342 303L438 314Q520 324 534 324Q540 324 545 320T550 307Q550 298 539 290T456 243Q377 198 377 197L416 111Q456 26 456 22Q457 21 457 18Q457 11 451 6T438 0H437Q432 0 415 16Q387 42 358 68L287 133L216 68Q193 47 167 23Q142 0 136 0Q129 0 123 5T117 18Q117 21 118 22Q118 26 158 111L197 197Q197 198 156 221T72 269T26 298Q24 304 24 307Q24 315 29 319T40 324Q53 324 136 314L232 303Q232 306 251 396T270 491",
        8904: "906 251Q906 456 905 456Q550 252 549 251Q549 250 726 148T905 45T906 251ZM967 -14Q958 -38 939 -38H937Q928 -38 923 -35Q919 -34 748 64T500 209L71 -38Q69 -39 63 -39Q42 -39 33 -16V518Q45 540 63 540H65Q72 540 174 481Q247 439 302 407L500 292Q578 339 750 438T929 539H933Q958 539 967 515V-14ZM449 251L94 456Q93 456 93 251Q93 45 94 45L106 52Q119 59 139 71T186 98T242 131T301 165T357 197T404 225T437 244L449 251",
        8942: "74 55Q74 91 99 116T156 141Q200 141 222 113T245 55Q245 26 224 -1T160 -29Q118 -29 96 -3T74 55ZM74 465Q74 501 99 526T156 551Q200 551 222 523T245 465Q245 436 224 409T160 381Q118 381 96 407T74 465ZM74 865Q74 901 99 926T156 951Q200 951 222 923T245 865Q245 836 224 809T160 781Q118 781 96 807T74 865",
        8943: "74 251Q74 286 99 311T156 336Q200 336 222 308T245 250Q245 221 224 194T160 166T96 193T74 251ZM562 251Q562 286 587 311T644 336Q688 336 710 308T733 250Q733 221 712 194T648 166T584 193T562 251ZM1050 251Q1050 286 1075 311T1132 336Q1176 336 1198 308T1221 250Q1221 221 1200 194T1136 166T1072 193T1050 251",
        8945: "129 785Q129 821 154 846T211 871Q255 871 277 843T300 785Q300 756 279 729T215 701Q173 701 151 727T129 785ZM576 485Q576 521 601 546T658 571Q702 571 724 543T747 485Q747 456 726 429T662 401Q620 401 598 427T576 485ZM1023 185Q1023 221 1048 246T1105 271Q1149 271 1171 243T1194 185Q1194 156 1173 129T1109 101Q1067 101 1045 127T1023 185",
        8968: "194 728Q199 743 216 749H220Q223 749 229 749T245 749T265 750T289 750T316 750T345 750H471Q472 749 477 746T484 741T490 732T493 719Q493 701 471 690L362 689H254V-224Q244 -248 223 -248T194 -226V728",
        8969: "317 -224Q307 -248 286 -248Q267 -248 257 -226L256 231V689H148L40 690Q17 698 17 720Q17 741 37 748Q42 750 169 750H295Q314 737 317 725V-224",
        8970: "194 728Q204 749 220 749Q245 749 254 725V-188H471Q472 -189 477 -192T484 -197T490 -206T493 -219Q493 -237 471 -248H216Q200 -242 194 -226V728",
        8971: "17 -219Q17 -201 40 -188H256V270L257 728Q271 749 283 749Q308 749 317 725V-224Q310 -242 295 -248H40L38 -247Q35 -246 34 -245T30 -243T25 -239T21 -234T18 -227T17 -219",
        8994: "95 108Q85 108 75 114T65 139Q65 159 129 227Q316 405 573 405Q654 405 729 387T854 344T950 286T1015 232T1053 191Q1078 160 1083 152Q1084 148 1084 139Q1084 121 1074 115T1054 108Q1040 108 1029 122T990 167T922 223Q819 291 680 309Q641 315 575 315Q508 315 469 309Q303 288 197 201Q168 179 148 155T118 119T95 108",
        8995: "1054 392Q1067 392 1076 384T1085 362Q1085 351 1079 342T1050 310Q983 243 901 200Q753 126 575 126Q494 126 420 141T298 176T205 225T140 272T100 310Q64 346 64 362Q64 370 67 374Q75 393 93 393Q107 393 124 375Q272 214 575 214Q877 214 1025 375Q1039 392 1054 392",
        9001: "127 243V259L223 491Q251 557 286 642Q318 719 324 732T340 748H341Q347 750 351 750Q365 750 373 740T382 723Q382 713 286 482L190 251Q190 249 286 20T382 -219Q382 -232 373 -240T352 -249Q332 -249 323 -229Q320 -220 223 10L127 243",
        9002: "64 720Q64 732 72 741T94 750Q106 750 113 743Q118 741 122 732L319 259V243L122 -231Q112 -249 95 -249Q83 -249 74 -240T64 -218Q64 -210 160 20L256 251L160 482Q64 715 64 720",
        9651: "91 1Q69 10 69 31Q69 39 81 59T168 197Q327 447 485 697Q493 711 510 711Q523 711 532 702Q536 697 743 371T951 41Q953 35 953 31Q953 12 931 1H91ZM690 340Q651 401 604 476T534 586L512 621Q511 622 507 616Q498 604 332 342L154 62L333 61H689L867 62L690 340",
        9653: "91 1Q69 10 69 31Q69 39 81 59T168 197Q327 447 485 697Q493 711 510 711Q523 711 532 702Q536 697 743 371T951 41Q953 35 953 31Q953 12 931 1H91ZM690 340Q651 401 604 476T534 586L512 621Q511 622 507 616Q498 604 332 342L154 62L333 61H689L867 62L690 340",
        9657: "33 518Q45 540 63 540H65Q72 540 174 481Q247 439 302 407Q529 276 533 272Q542 263 542 250Q542 238 533 229Q528 224 304 95T71 -38Q69 -39 63 -39Q42 -39 33 -16V518ZM449 251L94 456Q93 456 93 251Q93 45 94 45L106 52Q119 59 139 71T186 98T242 131T301 165T357 197T404 225T437 244L449 251",
        9661: "68 470Q68 481 75 489T91 499H93Q296 500 512 500H931Q932 499 937 496T945 490T950 482T953 469Q953 465 951 459Q950 455 743 129T532 -202Q524 -210 511 -210Q497 -210 489 -202Q486 -199 281 124T71 456Q68 462 68 470ZM154 439Q155 437 332 158T510 -122Q510 -123 533 -87T600 18T688 157Q866 437 866 438Q867 439 805 439T511 439H154",
        9663: "68 470Q68 481 75 489T91 499H93Q296 500 512 500H931Q932 499 937 496T945 490T950 482T953 469Q953 465 951 459Q950 455 743 129T532 -202Q524 -210 511 -210Q497 -210 489 -202Q486 -199 281 124T71 456Q68 462 68 470ZM154 439Q155 437 332 158T510 -122Q510 -123 533 -87T600 18T688 157Q866 437 866 438Q867 439 805 439T511 439H154",
        9667: "542 -14Q533 -38 514 -38H512Q503 -38 498 -35Q494 -34 270 95T42 229Q33 238 33 251Q33 259 35 264Q36 265 38 268T42 272Q48 278 271 407T504 539H508Q533 539 542 515V-14ZM481 251Q481 456 480 456Q125 252 124 251Q124 250 301 148T480 45T481 251",
        9711: "65 42T65 250T204 584T574 711Q795 711 935 594Q955 577 974 555T1022 490T1067 385T1084 250Q1084 42 945 -84T574 -211T204 -85ZM1024 250Q1024 431 903 540T578 650Q482 650 404 627T274 565T189 474T140 366T125 250Q125 123 186 31T347 -106T573 -150Q772 -150 898 -45T1024 250",
        9824: "675 -18Q536 -18 527 62V70H477V55Q479 14 487 -21T502 -75T509 -101Q509 -120 491 -127Q487 -129 447 -129Q446 -129 439 -129T427 -130Q384 -130 384 -101Q384 -95 391 -76T406 -21T416 55V70H366Q364 52 360 40T342 14T300 -8T230 -17H218Q110 -17 75 117Q64 163 64 209Q64 290 116 357T261 495Q363 574 414 690Q425 719 445 719Q467 719 478 693Q507 627 547 578T623 503T702 438T777 357Q829 285 829 202V197Q826 128 808 81T762 15T714 -11T675 -18",
        9825: "65 491Q65 602 121 656T246 710Q375 710 440 624L447 615Q519 711 638 711Q723 711 775 652T828 491Q828 390 770 313T581 129Q539 95 514 63T483 14T469 -13T446 -24Q434 -24 427 -17T416 0T400 32T371 74Q352 97 310 131T229 199T151 276T89 374T65 491ZM249 649Q188 649 157 603T125 489Q125 409 181 338T352 176Q408 131 437 87L446 73L456 87Q479 121 507 147T579 207T659 278Q768 387 768 489Q768 506 766 524T756 566T731 611T687 642Q668 649 638 649Q609 649 593 644Q547 633 516 604T478 534Q473 505 447 505H445Q420 505 416 534Q407 577 372 608T285 648Q277 649 249 649",
        9826: "409 686Q410 688 412 691T415 696T418 701T421 706T424 709T427 713T431 715T435 717T440 718T446 719Q455 719 460 717T472 704T488 679T516 633T563 567Q624 485 687 422T787 330T826 296T828 282Q828 270 825 265T801 245Q696 161 612 59T477 -133Q465 -154 447 -154Q439 -154 434 -152T425 -146T414 -130T399 -104T372 -62T330 -3Q270 78 207 142T107 234T70 265Q64 274 64 282Q64 296 90 317Q284 472 409 686ZM749 282Q745 286 721 307T681 343T635 388T581 446T525 516T465 601Q462 606 457 613T450 624L447 627V628Q446 628 436 611T402 561T348 489T266 396T155 292L145 282Q147 280 185 245T257 177T343 79T442 -57Q446 -64 447 -64V-63Q450 -59 475 -22T530 56T619 160T749 282",
        9827: "240 527Q240 611 301 665T446 719T590 665T652 527Q652 431 571 373Q578 363 584 352T593 335T597 329L604 335Q611 341 617 345T637 356T667 366Q672 366 680 367T694 368Q767 368 814 310T861 177Q861 109 819 57T713 -12Q690 -17 656 -17Q535 -13 527 62V70H477V55Q479 14 487 -21T502 -75T509 -101Q509 -120 491 -127Q487 -129 447 -129Q446 -129 439 -129T427 -130Q384 -130 384 -101Q384 -95 391 -76T406 -21T416 55V70H366V62Q356 -12 237 -17Q130 -17 71 60Q32 111 32 178Q32 251 78 309T198 368Q217 368 233 364T260 354T279 343T291 333T296 329L300 336Q304 343 310 354T322 373Q240 432 240 527",
        9837: "230 480Q293 480 337 440T381 330V322Q381 240 323 161Q258 71 123 -11L114 -16L97 -17Q70 -17 66 -7Q64 -3 64 366V641Q64 717 65 731T75 748Q78 750 95 750Q117 750 122 742T127 694Q127 685 127 653T126 595V454Q183 480 230 480ZM242 333Q242 405 212 405H207Q147 405 130 370L127 364L126 219Q126 77 128 77Q133 82 140 90T167 127T202 183T229 253T242 333",
        9838: "345 -223Q333 -223 330 -214T327 -178V-116Q327 -23 326 -23L203 -82Q90 -134 77 -140Q65 -142 59 -130Q57 -126 57 295V595Q57 643 57 667T58 704T60 719T63 724Q93 741 101 741Q113 741 116 732T119 680V597Q119 467 120 467Q121 468 180 495T301 552T369 584Q381 586 387 574Q389 570 389 187V-88Q389 -132 389 -154T388 -188T386 -202T383 -206Q353 -223 345 -223ZM327 271Q327 421 326 421L120 323L119 173V23Q120 23 223 72L327 121V271",
        9839: "140 628Q151 628 154 620T158 591V549V484L166 488Q175 492 192 500T223 516L288 548V622V674Q288 681 288 685T289 693T289 699T291 703T295 707T298 709T304 712T311 716Q326 724 332 724Q343 724 346 715T350 685V644V579Q358 583 364 583Q376 583 380 574Q382 570 382 514V481Q382 459 380 454T363 441L350 435V135Q358 139 364 139Q376 139 380 130Q382 126 382 70V37Q382 15 380 10T363 -3L350 -9V-76Q350 -102 348 -106T328 -119Q312 -128 306 -128Q288 -128 288 -99V-77V-40L280 -44Q271 -48 254 -56T223 -72L158 -104V-150V-180Q158 -198 155 -202T135 -216Q119 -224 114 -224Q96 -224 96 -192V-172V-135Q86 -140 81 -140Q70 -140 66 -129Q64 -126 64 -70V-54Q64 -18 66 -12T83 3L96 9V309Q86 304 81 304Q70 304 66 315Q64 318 64 374V407Q64 429 66 434T83 447L96 453V602Q99 609 100 610T118 619Q134 628 140 628ZM288 254Q288 404 287 404L158 340V40L166 44Q175 48 192 56T223 72L288 104V254",
        10072: "160 -249Q138 -249 129 -225V250Q129 725 131 729Q139 750 159 750T190 725V-225Q181 -249 160 -249",
        10216: "127 243V259L223 491Q251 557 286 642Q318 719 324 732T340 748H341Q347 750 351 750Q365 750 373 740T382 723Q382 713 286 482L190 251Q190 249 286 20T382 -219Q382 -232 373 -240T352 -249Q332 -249 323 -229Q320 -220 223 10L127 243",
        10217: "64 720Q64 732 72 741T94 750Q106 750 113 743Q118 741 122 732L319 259V243L122 -231Q112 -249 95 -249Q83 -249 74 -240T64 -218Q64 -210 160 20L256 251L160 482Q64 715 64 720",
        10229: "1063 221L649 220H235Q340 133 364 17Q368 1 368 -2Q368 -16 343 -17Q340 -17 338 -17H332Q317 -17 314 -14T305 6Q298 34 285 62T247 126T179 189T78 233Q64 237 64 251Q64 261 74 265T108 277T154 297Q212 328 251 379T305 495Q309 511 313 514T333 518H338Q363 517 367 510Q368 507 368 503Q368 500 364 484Q345 401 287 331Q254 295 235 282L649 281H1063L1065 280Q1079 281 1392 281H1719Q1720 280 1723 278T1729 274T1735 269T1739 262T1741 251Q1741 230 1719 221H1063",
        10230: "119 221Q96 230 96 251T116 279Q121 281 448 281H1188L1602 282Q1569 304 1530 357T1473 482Q1469 500 1469 501Q1469 512 1480 517Q1482 518 1500 518H1505Q1520 518 1523 515T1532 495Q1552 412 1611 351T1753 270Q1773 263 1773 251Q1773 240 1765 236T1732 225T1683 204Q1625 173 1586 122T1532 6Q1528 -10 1524 -13T1504 -17H1499Q1474 -16 1470 -9Q1469 -6 1469 -2Q1469 1 1473 17Q1501 138 1602 220H1188L775 221H119",
        10231: "1063 221L649 220H235Q340 133 364 17Q368 1 368 -2Q368 -16 343 -17Q340 -17 338 -17H332Q317 -17 314 -14T305 6Q298 34 285 62T247 126T179 189T78 233Q64 237 64 251Q64 261 74 265T108 277T154 297Q212 328 251 379T305 495Q309 511 313 514T333 518H338Q363 517 367 510Q368 507 368 503Q368 500 364 484Q345 401 287 331Q254 295 235 282L649 281H1476L1890 282Q1857 304 1818 357T1761 482Q1757 500 1757 501Q1757 512 1768 517Q1770 518 1788 518H1793Q1808 518 1811 515T1820 495Q1840 412 1899 351T2041 270Q2061 263 2061 251Q2061 240 2053 236T2020 225T1971 204Q1913 173 1874 122T1820 6Q1816 -10 1812 -13T1792 -17H1787Q1762 -16 1758 -9Q1757 -6 1757 -2Q1757 1 1761 17Q1789 138 1890 220H1476L1063 221",
        10232: "1063 333L700 332H338L324 321Q283 290 230 264L205 250Q266 224 323 180L338 170L700 169H1063L1064 168Q1080 169 1423 169H1782L1786 166Q1791 163 1793 162T1798 157T1802 149T1804 139Q1804 118 1782 109H1063L733 108H404L412 99Q455 50 488 -10Q498 -27 493 -37Q487 -46 465 -46H460Q446 -46 439 -39T426 -18T399 25T344 89Q239 194 99 229Q96 230 92 231T85 232T79 234T73 235T69 237T66 240T65 244T64 250Q64 267 90 271Q197 295 286 361T430 525Q439 542 442 544T460 547H465Q487 547 492 539Q496 531 496 530Q496 521 471 482T414 405L404 394L733 393H1063Q1064 392 1065 392Q1081 393 1423 393H1782Q1783 392 1786 390T1792 386T1798 381T1802 374T1804 363Q1804 345 1782 333H1063",
        10233: "87 109Q64 118 64 139Q64 159 86 168Q89 169 448 169H1169L1532 170L1546 180Q1562 193 1580 204T1612 223T1638 237T1657 246L1664 250L1639 264Q1586 290 1545 321L1531 332H1169L807 333H87Q64 343 64 362Q64 383 84 391Q89 393 448 393H1136L1465 394L1455 405Q1428 436 1401 477T1374 531Q1374 547 1399 547H1404H1409Q1423 547 1430 540T1443 519T1470 475T1526 411Q1634 303 1779 271Q1780 271 1783 270T1788 269T1792 268T1796 266T1799 264T1802 260T1803 256T1804 250Q1804 242 1800 238T1783 231T1755 225T1712 211T1654 185Q1517 112 1439 -24Q1430 -40 1426 -43T1409 -46H1404Q1373 -46 1373 -31Q1373 -24 1381 -10Q1414 50 1457 99L1465 108H1136L807 109H87",
        10234: "1063 333L700 332H338L324 321Q283 290 230 264L205 250Q266 224 323 180L338 170L700 169H1425L1788 170L1802 180Q1818 193 1836 204T1868 223T1894 237T1913 246L1920 250L1895 264Q1842 290 1801 321L1787 332H1425L1063 333ZM733 393H1392L1721 394L1711 405Q1684 436 1657 477T1630 531Q1630 547 1655 547H1660H1665Q1679 547 1686 540T1699 519T1726 475T1782 411Q1890 303 2035 271Q2036 271 2039 270T2044 269T2048 268T2052 266T2055 264T2058 260T2059 256T2060 250Q2060 242 2056 238T2039 231T2011 225T1968 211T1910 185Q1773 112 1695 -24Q1686 -40 1682 -43T1665 -46H1660Q1629 -46 1629 -31Q1629 -24 1637 -10Q1670 50 1713 99L1721 108H1392L1063 109L733 108H404L412 99Q455 50 488 -10Q498 -27 493 -37Q487 -46 465 -46H460Q446 -46 439 -39T426 -18T399 25T344 89Q239 194 99 229Q96 230 92 231T85 232T79 234T73 235T69 237T66 240T65 244T64 250Q64 267 90 271Q197 295 286 361T430 525Q439 542 442 544T460 547H465Q487 547 492 539Q496 531 496 530Q496 521 471 482T414 405L404 394L733 393",
        10236: "65 426Q74 448 95 448Q112 448 125 426V281H130L132 280H134Q162 281 448 281H1188L1602 282Q1569 304 1530 357T1473 482Q1469 500 1469 501Q1469 512 1480 517Q1482 518 1500 518H1505Q1520 518 1523 515T1532 495Q1552 412 1611 351T1753 270Q1773 263 1773 251Q1773 240 1765 236T1732 225T1683 204Q1625 173 1586 122T1532 6Q1528 -10 1524 -13T1504 -17H1499Q1474 -16 1470 -9Q1469 -6 1469 -2Q1469 1 1473 17Q1501 138 1602 220H1188L775 221H135Q133 220 130 220H125V76Q115 54 95 54Q73 54 65 76V426",
        10744: "189 -210Q179 -210 170 -203T160 -179Q160 -171 162 -166Q164 -163 420 266T679 698Q686 711 704 711Q714 711 723 704T733 681Q733 672 730 667Q723 654 469 228T211 -201Q202 -210 189 -210",
        10799: "168 500Q168 515 178 522T195 530H198Q207 530 218 521T282 458Q312 428 331 409L447 294L563 409Q674 520 682 525Q687 529 695 529Q711 529 718 520T726 499V498Q726 489 720 481T666 427Q631 392 606 367L490 251L606 135Q717 23 721 17T726 2Q726 -9 719 -18T695 -28H692Q685 -28 674 -18T608 47Q581 74 563 92L447 207L331 91Q217 -22 208 -27Q206 -28 203 -28H197Q168 -28 168 2Q168 13 178 24T288 135L404 250L288 366Q177 479 173 485T168 500",
        10815: "39 655Q39 675 43 680T69 686Q110 684 225 684Q267 684 303 684T360 685T385 686Q401 686 405 680T409 651Q409 632 403 628T367 624H348H301V62H598V624H551H532Q502 624 496 628T490 651Q490 673 494 679T514 686Q518 686 558 685T675 684T792 685T836 686Q852 686 856 680T860 651Q860 632 854 628T818 624H799H752V62H799H809Q846 62 853 59T860 36V31V21Q860 6 850 2Q846 0 450 0H156Q75 0 60 1T40 11V18Q39 26 39 31Q39 54 44 58T82 63Q84 63 90 63T100 62H147V624H100H90Q53 624 46 627T39 650V655",
        10927: "796 54Q796 40 788 32T767 24Q741 24 735 57Q729 107 705 148T646 216T563 264T465 297T356 316T245 326T136 330H134Q96 330 96 360Q96 391 134 391H136Q193 392 239 394T347 403T457 421T556 453T643 502T703 571T735 664Q741 696 763 696Q781 696 789 686T797 667Q797 651 792 624T758 545T682 456Q605 396 481 365L462 360Q483 357 526 344T633 296T733 215Q767 173 781 128T796 54ZM119 -199Q96 -190 96 -169T116 -141Q121 -139 448 -139H775Q776 -140 779 -142T785 -146T791 -151T795 -158T797 -169Q797 -190 775 -199H119",
        10928: "127 24Q115 24 106 32T97 55Q97 95 124 156T211 265Q288 325 412 356L431 361Q410 363 367 376T259 425T160 506Q127 546 112 594T96 667Q96 679 104 688T126 697Q152 697 158 664Q164 614 188 573T247 505T331 456T429 424T539 405T649 395T758 391Q797 391 797 360Q797 330 761 330H758Q701 329 655 327T547 318T437 300T337 268T251 219T190 150T158 57Q151 24 127 24ZM119 -199Q96 -190 96 -169T116 -141Q121 -139 448 -139H775Q776 -140 779 -142T785 -146T791 -151T795 -158T797 -169Q797 -190 775 -199H119",
        12296: "127 243V259L223 491Q251 557 286 642Q318 719 324 732T340 748H341Q347 750 351 750Q365 750 373 740T382 723Q382 713 286 482L190 251Q190 249 286 20T382 -219Q382 -232 373 -240T352 -249Q332 -249 323 -229Q320 -220 223 10L127 243",
        12297: "64 720Q64 732 72 741T94 750Q106 750 113 743Q118 741 122 732L319 259V243L122 -231Q112 -249 95 -249Q83 -249 74 -240T64 -218Q64 -210 160 20L256 251L160 482Q64 715 64 720"
      }, {
        8243: "′′",
        8244: "′′′",
        8279: "′′′′",
        8602: "↚",
        8603: "↛",
        8622: "↮",
        8653: "⇍",
        8654: "⇎",
        8655: "⇏",
        8708: "∄",
        8716: "∌",
        8740: "∤",
        8742: "∦",
        8769: "≁",
        8772: "≄",
        8775: "≇",
        8777: "≉",
        8802: "≢",
        8813: "≭",
        8814: "≮",
        8815: "≯",
        8816: "≰",
        8817: "≱",
        8832: "⊀",
        8833: "⊁",
        8836: "⊄",
        8837: "⊅",
        8840: "⊈",
        8841: "⊉",
        8876: "⊬",
        8877: "⊭",
        8930: "⋢",
        8931: "⋣"
      });
      return bold$1;
    }
    var doubleStruck$1 = {};
    var doubleStruck = {};
    var hasRequiredDoubleStruck$1;
    function requireDoubleStruck$1() {
      if (hasRequiredDoubleStruck$1) return doubleStruck;
      hasRequiredDoubleStruck$1 = 1;
      Object.defineProperty(doubleStruck, "__esModule", { value: true });
      doubleStruck.doubleStruck = void 0;
      doubleStruck.doubleStruck = {};
      return doubleStruck;
    }
    var hasRequiredDoubleStruck;
    function requireDoubleStruck() {
      if (hasRequiredDoubleStruck) return doubleStruck$1;
      hasRequiredDoubleStruck = 1;
      (function(exports2) {
        Object.defineProperty(exports2, "__esModule", { value: true });
        exports2.doubleStruck = void 0;
        var double_struck_js_1 = requireDoubleStruck$1();
        Object.defineProperty(exports2, "doubleStruck", { enumerable: true, get: function() {
          return double_struck_js_1.doubleStruck;
        } });
      })(doubleStruck$1);
      return doubleStruck$1;
    }
    var frakturBold$1 = {};
    var frakturBold = {};
    var hasRequiredFrakturBold$1;
    function requireFrakturBold$1() {
      if (hasRequiredFrakturBold$1) return frakturBold;
      hasRequiredFrakturBold$1 = 1;
      Object.defineProperty(frakturBold, "__esModule", { value: true });
      frakturBold.frakturBold = void 0;
      frakturBold.frakturBold = {
        33: [0.689, 0.012, 0.349],
        34: [0.695, -0.432, 0.254],
        38: [0.696, 0.016, 0.871],
        39: [0.695, -0.436, 0.25],
        40: [0.737, 0.186, 0.459],
        41: [0.735, 0.187, 0.459],
        42: [0.692, -0.449, 0.328],
        43: [0.598, 0.082, 0.893],
        44: [0.107, 0.191, 0.328],
        45: [0.275, -0.236, 0.893],
        46: [0.102, 0.015, 0.328],
        47: [0.721, 0.182, 0.593],
        48: [0.501, 0.012, 0.593],
        49: [0.489, 0, 0.593],
        50: [0.491, 0, 0.593],
        51: [0.487, 0.193, 0.593],
        52: [0.495, 0.196, 0.593],
        53: [0.481, 0.19, 0.593],
        54: [0.704, 0.012, 0.593],
        55: [0.479, 0.197, 0.593],
        56: [0.714, 5e-3, 0.593],
        57: [0.487, 0.195, 0.593],
        58: [0.457, 0.012, 0.255],
        59: [0.458, 0.19, 0.255],
        61: [0.343, -0.168, 0.582],
        63: [0.697, 0.014, 0.428],
        91: [0.74, 0.13, 0.257],
        93: [0.738, 0.132, 0.257],
        94: [0.734, -0.452, 0.59],
        8216: [0.708, -0.411, 0.254],
        8217: [0.692, -0.394, 0.254],
        8260: [0.721, 0.182, 0.593],
        58113: [0.63, 0.027, 0.587],
        58114: [0.693, 0.212, 0.394, { ic: 0.014 }],
        58115: [0.681, 0.219, 0.387],
        58116: [0.473, 0.212, 0.593],
        58117: [0.684, 0.027, 0.393],
        58120: [0.679, 0.22, 0.981],
        58121: [0.717, 0.137, 0.727]
      };
      return frakturBold;
    }
    var hasRequiredFrakturBold;
    function requireFrakturBold() {
      if (hasRequiredFrakturBold) return frakturBold$1;
      hasRequiredFrakturBold = 1;
      Object.defineProperty(frakturBold$1, "__esModule", { value: true });
      frakturBold$1.frakturBold = void 0;
      var FontData_js_1 = requireFontData();
      var fraktur_bold_js_1 = requireFrakturBold$1();
      frakturBold$1.frakturBold = (0, FontData_js_1.AddPaths)(fraktur_bold_js_1.frakturBold, {
        33: "121 621Q121 657 132 673T177 689Q223 689 223 644V635Q223 604 222 595Q221 590 210 490T187 292T175 190V186L166 185L156 184Q156 185 139 393T121 621ZM107 47Q107 70 127 87T174 104Q201 104 221 89T241 48Q241 24 222 6T174 -12Q147 -12 127 6T107 47",
        34: "53 695Q74 695 90 679V622L65 433L52 432H39L27 516Q10 626 10 655Q10 680 26 688Q33 693 39 693Q49 695 53 695ZM151 668Q151 691 191 691Q217 691 224 685T231 661V652Q230 634 219 531L207 433L195 432Q183 432 183 433L168 541Q151 664 151 668",
        38: "290 -14Q186 -14 115 41T44 185Q44 222 54 249T88 300T131 336T189 371Q216 387 216 388Q185 459 185 510Q185 563 206 601T263 659T334 687T405 696Q476 696 503 668T531 603Q531 565 513 536T450 476Q423 459 370 432L334 413L354 384Q474 212 560 139L563 137Q611 185 611 250Q611 295 577 329Q549 356 496 357Q439 357 433 354Q432 354 432 379V403L437 402Q443 402 479 401T557 400Q653 400 735 403T831 407H836Q833 352 833 351L821 352Q809 352 792 352T756 352T720 353T696 354Q680 354 680 353L681 346Q682 339 683 327T685 306Q685 283 681 260T669 218T653 182T635 152T619 129T606 114L602 109Q604 107 618 99T659 81T707 71Q742 71 767 99T804 155L815 183Q815 184 821 183T833 180T839 177Q837 169 834 156T816 110T782 52T727 5T648 -16Q569 -16 499 35H498Q496 35 466 23T387 -1T290 -14ZM418 592Q418 617 398 639T352 661T302 642T278 574Q278 545 288 514T306 465T319 444Q342 456 353 463T382 488T409 529T418 584V592ZM159 239Q159 158 222 98T364 38Q386 38 447 57L469 63L434 98Q349 185 286 275Q258 316 238 345Q233 353 232 353Q159 316 159 239",
        39: "80 645T80 662T93 687T123 695Q158 695 158 659Q158 649 157 643L123 437Q123 436 114 436H104Q104 442 92 538Q80 645 80 662",
        40: "347 719Q325 708 311 698T272 656T233 580T207 455T195 267Q195 30 247 -79Q261 -110 291 -136Q320 -163 347 -172V-179Q347 -186 344 -186Q338 -186 328 -184T287 -165T230 -123Q134 -25 134 271Q134 417 158 514T226 662T335 734L346 737Q347 737 347 728V719",
        41: "264 262Q264 366 253 446T226 572T186 649T145 692T105 714V725Q105 735 107 735Q108 734 121 731T154 719T196 692T242 641T284 560T314 437T326 268Q326 112 299 7Q279 -78 239 -124T116 -185L105 -187V-179L106 -171L109 -169Q130 -161 138 -158T165 -146T190 -127T210 -101T229 -64T243 -12T255 58T261 148T264 262",
        42: "40 516L62 529Q85 542 110 556T140 574L126 582Q112 591 104 595T80 607T40 629Q53 642 57 645L65 652L78 642Q106 620 132 603L152 589V595Q152 630 149 681V692H179V689Q178 681 174 638T171 593Q173 593 240 639L258 652Q260 652 267 643L276 633L260 625Q190 587 175 576Q173 575 180 570Q183 569 186 567Q213 549 256 527L277 515L256 495Q246 501 228 515T194 539T170 554V543Q170 486 178 449H148V456Q152 492 152 550L151 562Q150 562 102 528L53 495Q40 514 40 516",
        43: "422 584L471 598Q472 598 472 440V282H837Q833 273 829 263L821 244L647 243H472V-63L448 -73L423 -82Q422 -82 422 81V243H239Q56 243 56 244Q60 253 65 263L73 282H422V584",
        44: "118 61Q118 80 135 93T169 107Q190 107 221 65T253 -23Q253 -39 251 -49T237 -80T198 -133Q148 -191 144 -191Q142 -191 137 -182T132 -172Q143 -161 160 -131T183 -83Q185 -77 185 -62Q185 -54 184 -48T182 -38T177 -28T171 -19T162 -8T150 6Q130 28 124 38T118 61",
        45: "54 236L73 275H453Q833 275 833 274Q830 265 825 255L818 236H54",
        46: "103 23T103 44T120 83T170 102Q200 102 218 84T237 44Q237 20 216 3T168 -15Q138 -15 121 4",
        47: "272 270Q503 721 506 721L509 720Q512 720 518 719T529 717L550 713L91 -181L66 -182Q41 -182 41 -181L272 270",
        48: "238 -12Q162 -12 102 42T42 185Q42 303 130 393Q163 425 208 452T284 490L313 501Q323 499 339 495T395 472T464 426Q533 357 533 273Q533 201 483 133T364 27T238 -12ZM428 208Q428 255 402 297T342 365T280 404T241 419Q214 419 178 374T142 259Q142 206 168 164T225 99Q259 74 310 74Q326 74 337 75T366 82T396 103T417 141Q428 171 428 208",
        49: "95 481Q102 481 217 485T383 489Q384 489 384 485Q367 397 367 165Q367 58 369 54Q374 46 380 44T410 42H466H546V40Q547 38 547 19L548 0H54V23Q54 29 54 34T54 44L55 47Q79 47 134 46T202 45Q226 45 234 52Q240 57 241 64T245 105Q254 236 254 320V347Q254 369 252 382T240 409T211 431L97 450L96 465Q95 480 95 481",
        50: "307 335Q307 374 283 397T224 421Q187 421 112 387Q105 384 100 382T95 381Q90 387 86 394L77 407L86 413Q219 491 298 491Q370 491 399 460T428 388Q428 373 424 358T409 326T391 297T363 264T335 235T301 202T269 171L199 104Q194 99 205 97Q209 96 214 96Q527 105 544 105Q553 107 563 102Q563 100 557 79T545 34T537 2H377Q338 2 247 2T130 4H44V26L104 77Q185 145 212 172T267 235Q307 291 307 335",
        51: "102 402L108 408Q115 413 122 418T141 431T165 447T194 461T227 474T263 483T302 487H307Q413 487 452 420Q465 400 465 371Q465 334 445 303T396 253T347 225T317 213Q314 213 314 211Q316 209 316 205Q317 201 320 201Q337 201 359 198T411 184T465 156T506 109T523 39Q523 -62 436 -127T229 -193Q179 -193 130 -178T56 -150T31 -133Q31 -132 41 -122L52 -112L63 -117Q128 -148 201 -148Q282 -148 331 -104T381 20Q381 71 363 100T304 145Q243 166 149 166H137V204H146Q179 204 211 210T275 229T326 268T346 329Q346 372 314 401Q292 423 245 423Q188 423 125 383L102 402",
        52: "346 -196Q344 -196 335 -187L336 -148Q337 -127 337 -55V0H13V29L187 253Q362 477 362 479L368 480Q375 481 387 483T411 487T434 491T452 494L459 495Q460 495 470 482V453Q470 389 466 230T461 62Q461 61 513 61T565 60L555 29L546 -1H461V-15Q461 -48 463 -100T465 -154L457 -157Q449 -160 434 -165T405 -175Q347 -196 346 -196ZM339 265V341Q339 362 335 362Q327 362 219 217T110 65V61H337V117Q338 133 338 187T339 265",
        53: "232 192Q176 192 122 152L95 162V481H306Q516 481 516 479Q514 477 501 433L486 389L319 388H152V386V382Q152 379 152 374T151 365Q147 329 146 260V218H149Q211 242 284 242Q353 242 402 224T474 176T508 117T518 55Q518 -62 432 -126T220 -190Q184 -190 151 -185T96 -172T57 -157T31 -145T20 -139T19 -138Q19 -136 27 -125L35 -112L51 -120Q114 -152 174 -152Q257 -152 314 -100T371 46Q371 107 340 149T232 192",
        54: "48 251Q48 330 76 403T150 529T253 623T370 683T485 704Q494 704 520 701T547 695Q547 692 542 659T536 625Q531 624 524 624L512 623L502 628Q489 635 468 640Q452 645 423 645Q403 645 379 640T320 617T255 568T201 481T171 348Q170 341 170 330V325L183 333Q275 385 357 385H361Q464 385 514 312Q546 267 546 217Q546 127 457 58T262 -12Q225 -12 189 3T120 49T68 132T48 251ZM448 165Q448 228 406 274T289 320Q264 320 236 312T190 295T173 284Q173 266 176 241T189 178T214 112T259 61T326 39Q372 39 410 75T448 165",
        55: "57 376L87 479H591V455L584 446Q544 399 491 328T349 117T185 -169L171 -196H159Q152 -197 102 -197Q58 -197 58 -196T56 -185L54 -175L299 158L443 359Q446 367 444 370H254L71 365L57 376",
        56: "88 533Q88 573 120 610T194 668T268 701T307 714Q324 714 352 711T422 695T486 659Q518 625 518 585Q518 536 479 489T384 406L371 398L385 390Q387 389 400 382T420 370T442 356T466 339T489 319T510 295T526 269T538 238T542 204Q542 125 463 60T256 -5Q145 -5 92 52Q45 97 45 165Q45 204 64 237T109 290T163 324T209 345T228 353L214 364Q199 375 179 392T138 431T103 480T88 533ZM405 557Q405 568 402 581T387 612T350 644T286 663Q283 663 280 663T274 664H272Q256 664 228 636T199 572Q199 547 238 507Q268 475 320 437L334 427Q345 433 358 443T388 483T405 549V557ZM304 42Q366 42 398 76T431 155Q431 178 420 200T396 238T359 270T321 296T283 318L263 328Q262 328 230 312Q190 290 175 266T160 198Q160 132 202 87T304 42",
        57: "549 220Q549 23 429 -82T105 -195H84V-189Q84 -179 85 -174V-164H93Q184 -156 238 -132T334 -56Q361 -23 376 16T394 78L397 100L363 88Q329 75 291 61T244 45Q237 44 218 44Q154 44 94 97Q29 152 29 240Q29 350 108 404Q145 429 257 480Q270 487 279 487Q403 487 470 421Q549 347 549 220ZM408 217Q408 276 390 320T346 385T297 415T259 424Q218 424 185 393T151 286Q151 216 213 154Q252 115 321 115Q368 115 388 134T408 217",
        58: "57 398Q57 419 72 438T117 457Q154 457 174 439T194 398Q194 379 176 361T119 343Q85 343 71 362T57 398ZM62 19T62 43T77 85T115 104Q153 104 175 86T197 42Q197 14 171 1T119 -12Q96 -12 79 3",
        59: "56 399Q56 424 73 440T104 456Q114 458 120 458Q149 458 170 440T192 399Q192 380 174 362T120 344Q85 344 71 362T56 399ZM78 53Q78 67 84 76T90 86Q90 88 98 92T116 98Q117 98 121 98T128 99Q152 97 181 58T211 -24Q211 -77 128 -165Q124 -170 121 -173T116 -178T113 -181T110 -185T106 -190L97 -184L88 -177L95 -168Q143 -104 143 -65Q143 -51 137 -40T113 -7T81 35Q78 41 78 53",
        61: "559 342L549 304H22L27 319Q29 328 30 333T33 343H296Q559 343 559 342ZM559 206L549 168H22L27 183Q29 192 30 197T33 207H296Q559 207 559 206",
        63: "121 590Q121 575 128 562T144 542T152 533T115 512L78 491Q55 499 47 516Q40 530 40 553Q40 601 77 632Q155 697 257 697H268Q316 697 355 679Q422 646 422 576Q422 518 388 476Q383 468 376 461T358 444T340 428T316 410T290 390L230 344Q180 307 180 275Q180 261 187 248T202 227L209 219Q209 215 176 193L142 170Q114 177 100 194T84 226V239Q84 259 93 276T113 302T150 331T192 362Q203 370 219 382T247 403T267 422Q312 471 312 546Q312 593 282 623T207 653Q170 653 146 636T121 590ZM95 23T95 49T117 94T173 113Q204 113 223 96T242 54Q242 27 221 7T167 -14Q136 -14 116 4",
        91: "226 711T225 711T86 699V-93H89Q94 -93 157 -96T223 -100H226V-119H223Q134 -119 42 -130H36V740H42Q61 738 156 736H226V723Q226 711 225 711",
        93: "69 732Q116 733 146 734T184 736T197 737T206 738H208V-132Q190 -129 160 -127T99 -125T66 -124H14V-103H19Q20 -103 84 -98T152 -92H158V699H151Q148 700 85 703T18 708H14V732H69",
        94: "1 463T1 464T148 599T296 734Q584 486 584 485L561 472Q538 459 537 461Q296 672 293 672L161 563Q133 539 97 509T44 466L28 452Q27 452 14 457",
        8216: "187 456Q187 437 169 424T138 411Q114 411 84 454T53 538Q53 565 75 597Q109 648 155 697L166 708L181 694L173 681Q124 610 124 577Q124 549 155 511T187 456",
        8217: "125 524Q125 545 92 588T58 651Q58 661 61 667Q65 674 80 683T107 692Q131 692 162 645T193 564Q193 540 176 509T144 460T87 394L78 400L68 406L79 421Q125 489 125 524",
        8260: "272 270Q503 721 506 721L509 720Q512 720 518 719T529 717L550 713L91 -181L66 -182Q41 -182 41 -181L272 270",
        58113: "388 427Q320 485 242 524T128 563H116Q95 563 87 561L77 559Q72 563 69 566T65 570T65 572L75 576Q106 592 154 611T212 630Q230 630 262 622T358 581T492 498L508 486Q512 463 512 396Q512 246 469 112L465 102Q453 94 341 25Q252 -27 247 -27Q243 -27 174 24T97 84Q90 100 90 214Q90 285 98 345Q100 360 102 363T118 377Q175 422 262 465Q264 463 270 460L277 456Q277 455 267 447T244 428T228 414Q206 382 206 269Q206 187 214 164T259 110Q286 89 342 58Q391 131 391 313Q391 355 388 412V427",
        58114: "39 362L37 366L38 368L82 405H133V474Q135 563 143 589T198 658Q210 669 224 676T247 687L255 690H253Q241 690 253 692Q254 692 256 692T260 693Q263 693 262 691L261 690Q300 690 361 662L373 656L388 666Q404 675 405 675L406 674Q406 672 406 670T406 664L408 655L301 555Q300 555 287 564T254 584T221 597Q190 597 176 583T161 550Q161 525 184 495T232 440T261 405H387V399Q377 389 364 379L340 359H258V315Q258 52 228 -18L172 -120L121 -211H109Q102 -212 96 -212L109 -174Q131 -108 135 -80T139 53V76V157V362H39",
        58115: "41 352Q40 354 39 355T37 358L36 360H37Q48 370 61 380L84 400H108Q131 400 131 402Q121 424 104 501L100 519Q109 560 134 602T196 664Q230 681 271 681Q291 681 316 669T358 644L373 631Q373 630 304 553Q299 548 294 547Q292 547 290 546H287Q286 546 274 562T243 593T205 609Q180 609 165 596T150 562Q150 526 191 488L217 462Q248 431 253 405V400H381L384 394L349 352H251V332Q249 271 231 17L227 -37L120 -217L109 -218Q103 -219 97 -219Q97 -218 101 -206T110 -177T118 -151Q126 -129 128 -120T136 -46T141 127Q141 250 136 340V352H41",
        58116: "107 370Q127 384 172 409T255 454T294 473L306 468Q356 446 425 431L435 429L524 468Q528 465 531 461Q499 395 499 271V263Q499 146 509 71T519 -8Q519 -28 512 -45Q510 -50 435 -123T355 -197Q296 -212 257 -212Q209 -212 164 -196T98 -167T67 -143L133 -44H144Q167 -88 216 -111T320 -134Q371 -134 390 -118T410 -69Q410 -52 404 -12T392 60T385 92L193 -29L158 5Q124 39 110 51L96 63V71Q94 79 94 121Q94 130 94 148T93 174Q93 230 96 275T103 344T107 370ZM221 397Q200 334 200 254Q200 170 210 140Q216 126 234 109T268 81L283 71L383 119V127Q384 132 384 241L385 347L368 349Q325 357 290 369T240 389T221 397",
        58117: "103 453Q103 631 95 661Q95 663 102 667T110 672L114 664Q117 655 123 641T131 621L140 597L154 606Q208 641 275 673L297 684Q300 683 302 682T307 679T310 678L314 676Q283 658 256 625Q238 601 231 579T223 515L224 512L282 548Q339 583 341 583T365 548T386 509Q326 443 318 443L316 446Q314 448 311 452T304 460T294 470T283 480T272 488T260 494T248 497Q231 497 223 474Q220 468 218 440T215 407V401H345L309 360H218V314Q218 181 221 139V129L253 108Q306 73 310 73Q315 73 343 83L373 92L374 87Q375 82 375 79T375 74T360 65T308 36T229 -13L208 -27L192 -13Q149 24 90 61Q89 61 89 62L90 68Q91 73 93 87T97 125T100 191T103 291V360H33V366L34 371L85 405H94L103 404V453",
        58120: "602 575Q505 508 505 489Q505 488 505 482T506 463T507 432Q507 314 456 237L449 226L434 216Q420 208 325 143L316 137Q453 82 488 82Q527 82 585 127L596 136Q597 136 599 126L602 115Q578 85 511 27T428 -31Q400 -31 308 10T170 51Q143 51 123 43T92 24T54 -15L34 6L41 14Q65 41 170 129L188 144L204 145Q254 147 293 164T350 208Q378 249 378 344Q378 422 362 478T320 563T268 605T213 618Q177 618 156 600T134 561Q134 539 162 508T217 446T245 394Q245 368 213 337T85 250L62 262Q73 269 86 279T116 308T133 338T108 378T57 439T32 499Q32 556 117 617T291 679Q350 679 393 658Q415 647 433 631T462 600T480 572T490 550T494 541T499 544T516 556T547 578T603 613T689 662L720 679L730 670Q742 659 756 649T785 629T810 615T836 601T855 590Q855 587 860 536T870 419T875 312Q875 114 800 -25Q794 -35 781 -47Q584 -220 398 -220Q322 -220 278 -190Q253 -173 239 -155L244 -150Q248 -145 255 -138T271 -120T290 -100T310 -80T328 -63T341 -51T349 -46Q350 -46 351 -46T354 -47Q357 -47 357 -52Q359 -68 364 -83T383 -118T424 -151T491 -166Q559 -166 613 -129Q629 -118 641 -108T674 -68T710 1T735 107T746 260Q746 433 727 507Q727 512 685 535T615 570L602 575",
        58121: "351 571Q317 571 247 563T171 555Q153 555 133 563T107 584Q94 605 98 609Q101 615 138 658T190 717H207Q204 710 204 699Q204 673 231 666Q235 665 264 665Q296 665 345 667T426 669Q474 669 501 660T545 626Q553 612 553 594Q553 531 498 474T379 384Q371 379 371 378Q371 376 390 376H411H434Q520 376 602 318Q621 303 627 288T633 234Q633 59 540 -34Q465 -109 348 -130Q308 -137 235 -137Q159 -136 143 -129Q132 -125 132 -118V-53Q118 -24 90 -24Q69 -24 37 -39L27 -44L25 -42Q23 -39 21 -35T17 -30Q17 -28 40 -14T103 19T177 44Q183 45 205 45Q219 45 227 44T245 37T259 20T264 -12Q264 -33 262 -48T259 -80Q259 -93 260 -95Q271 -110 305 -110Q343 -110 383 -86T443 -33Q491 34 491 154Q491 223 467 249Q428 288 334 288H322Q288 288 237 276L222 273L206 286L262 367Q279 369 303 377T358 403T410 452T431 524Q431 531 431 533T427 545T416 558T392 566T351 571"
      }, {});
      return frakturBold$1;
    }
    var fraktur$1 = {};
    var fraktur = {};
    var hasRequiredFraktur$1;
    function requireFraktur$1() {
      if (hasRequiredFraktur$1) return fraktur;
      hasRequiredFraktur$1 = 1;
      Object.defineProperty(fraktur, "__esModule", { value: true });
      fraktur.fraktur = void 0;
      fraktur.fraktur = {
        33: [0.689, 0.012, 0.296],
        34: [0.695, -0.432, 0.215],
        38: [0.698, 0.011, 0.738],
        39: [0.695, -0.436, 0.212],
        40: [0.737, 0.186, 0.389],
        41: [0.735, 0.187, 0.389],
        42: [0.692, -0.449, 0.278],
        43: [0.598, 0.082, 0.756],
        44: [0.107, 0.191, 0.278],
        45: [0.275, -0.236, 0.756],
        46: [0.102, 0.015, 0.278],
        47: [0.721, 0.182, 0.502],
        48: [0.492, 0.013, 0.502],
        49: [0.468, 0, 0.502],
        50: [0.474, 0, 0.502],
        51: [0.473, 0.182, 0.502],
        52: [0.476, 0.191, 0.502],
        53: [0.458, 0.184, 0.502],
        54: [0.7, 0.013, 0.502],
        55: [0.468, 0.181, 0.502],
        56: [0.705, 0.01, 0.502],
        57: [0.469, 0.182, 0.502],
        58: [0.457, 0.012, 0.216],
        59: [0.458, 0.189, 0.216],
        61: [0.368, -0.132, 0.756],
        63: [0.693, 0.011, 0.362],
        91: [0.74, 0.13, 0.278],
        93: [0.738, 0.131, 0.278],
        94: [0.734, -0.452, 0.5],
        8216: [0.708, -0.41, 0.215],
        8217: [0.692, -0.395, 0.215],
        8260: [0.721, 0.182, 0.502],
        58112: [0.683, 0.032, 0.497],
        58113: [0.616, 0.03, 0.498],
        58114: [0.68, 0.215, 0.333],
        58115: [0.679, 0.224, 0.329],
        58116: [0.471, 0.214, 0.503],
        58117: [0.686, 0.02, 0.333],
        58118: [0.577, 0.021, 0.334, { ic: 0.013 }],
        58119: [0.475, 0.022, 0.501, { ic: 0.013 }]
      };
      return fraktur;
    }
    var hasRequiredFraktur;
    function requireFraktur() {
      if (hasRequiredFraktur) return fraktur$1;
      hasRequiredFraktur = 1;
      Object.defineProperty(fraktur$1, "__esModule", { value: true });
      fraktur$1.fraktur = void 0;
      var FontData_js_1 = requireFontData();
      var fraktur_js_1 = requireFraktur$1();
      fraktur$1.fraktur = (0, FontData_js_1.AddPaths)(fraktur_js_1.fraktur, {
        33: "102 582T102 620T112 673T152 689Q190 689 190 638Q190 605 167 373L148 187L133 184Q102 582 102 620ZM91 24T91 48T107 88T148 104Q171 104 187 87T204 48Q204 22 188 5T149 -12Q124 -12 108 6",
        34: "33 436Q8 603 8 648Q8 663 9 671T19 687T43 695Q63 695 74 681Q76 678 76 650V623L66 532Q57 443 55 436V432H33V436ZM128 666Q128 691 162 691T196 668Q196 634 186 531Q176 441 176 432H166Q155 432 155 434L142 545Q135 603 130 647Q128 664 128 666",
        38: "181 520Q181 604 231 650T328 697L330 698Q333 698 335 698Q336 698 340 698T346 697Q390 697 418 670T446 604Q446 554 414 511Q384 467 300 417L283 406Q281 405 296 374T347 286T425 182Q466 135 469 135Q470 135 473 140T480 152T486 165Q509 210 509 263Q509 282 507 292Q498 317 488 332T465 352T443 359T418 361Q388 361 357 358L346 356L347 374Q347 394 348 396V399H355Q366 396 535 396Q663 396 689 398L703 399Q703 398 702 375T700 351L688 353Q655 356 601 357Q553 357 553 355Q562 332 562 294Q562 280 561 267T555 241T548 218T539 195T529 175T518 156T508 141T497 126L489 115L496 107Q549 54 596 54Q623 54 644 67T677 101T697 140T708 174L710 187Q710 188 710 188L711 190Q714 190 723 187T733 183Q733 179 732 172T726 145T714 107T694 66T665 27T623 0T569 -11Q500 -11 443 41L434 49L425 42Q348 -9 275 -9Q251 -9 233 -6Q187 -1 152 18T98 60T67 111T52 159T49 195Q49 231 60 261T96 315T141 354T197 390L208 397Q181 459 181 520ZM374 577Q374 607 356 629T311 651Q289 651 271 636Q242 614 242 559Q242 533 249 502T262 453T270 435T279 440T298 453T314 464Q374 503 374 577ZM127 217Q127 145 173 89T291 32Q318 32 347 42T393 63T409 75Q384 100 325 184T227 351Q223 366 220 366Q215 366 178 338Q127 298 127 217",
        39: "69 666Q69 680 79 687T104 695Q112 695 117 694T128 684T134 659L104 438Q104 436 96 436T88 438Q88 447 79 540T69 655V666",
        40: "293 737V719Q291 718 285 714T276 708T268 702T258 695T250 686T241 674Q164 570 164 282Q164 -37 230 -119Q273 -171 292 -171Q293 -171 293 -179V-186H289Q270 -180 259 -175Q175 -132 145 -23T114 275Q114 491 157 598T293 737",
        41: "223 259Q223 386 212 474T178 609T136 677T89 714V735Q121 726 139 713Q276 622 276 273Q276 98 246 -23Q225 -106 189 -139T89 -187V-170L101 -165Q148 -146 172 -110T210 13T223 259",
        42: "118 573Q118 575 76 602L34 629L50 647L55 652L66 642Q76 633 91 620T117 598L128 590Q128 663 125 687V692H151V689V687Q151 685 151 683T150 678T150 672Q145 628 144 605V592L219 652L232 634Q232 632 220 624Q195 610 155 582L146 575L158 567Q178 552 197 540T225 523T233 516Q233 515 226 506T217 495L152 549L143 555V530Q144 509 145 492T148 466T149 454Q149 449 142 449H125V462Q128 522 128 549V562L115 552Q88 531 59 506L45 495Q44 495 39 505T34 516L118 573",
        43: "357 584L399 598V282H709L702 263L696 243H399V-64L379 -73L358 -82Q357 -82 357 81V243H47L51 253Q52 256 54 263T58 272L62 282H357V584",
        44: "99 62Q99 82 114 94T144 107Q159 107 178 77T205 26Q213 5 213 -23Q213 -49 207 -65T181 -113Q128 -189 122 -191Q121 -191 116 -184T111 -174Q111 -173 122 -155T145 -111T156 -62Q156 -44 152 -34T127 4L104 37Q99 49 99 62",
        45: "46 236L62 274Q62 275 384 275H706L699 255L693 236H46",
        46: "87 43Q87 69 104 85T142 102Q164 102 182 86T200 44Q200 20 183 3T141 -15Q118 -15 103 2T87 43",
        47: "230 270Q426 721 428 721Q437 719 447 717L466 713L448 672Q78 -180 77 -181Q77 -182 55 -182L34 -181L230 270",
        48: "212 -13Q184 -13 156 -2T101 32T59 97T42 195Q42 311 132 396Q170 433 211 462T262 492Q272 492 301 477T366 434T429 360T456 258Q456 161 378 74T212 -13ZM381 209Q381 257 365 295T328 355T282 390T243 408T223 413Q220 413 204 403T167 376T137 341Q119 305 119 250Q119 168 159 114T263 59Q308 59 344 93T381 209",
        49: "123 459Q145 459 170 460T217 462T256 464T284 466L295 467Q296 467 296 467T297 468Q299 468 302 466T307 462L309 459Q307 454 304 424T299 341T297 235Q297 139 298 101T302 55T313 44Q316 43 367 43L460 46Q460 35 459 22V-1H450Q402 2 281 6Q222 6 171 4T91 1T56 -1L47 -2V43H121H170Q195 43 201 45T209 56Q212 69 212 214Q212 333 209 365T194 409Q183 417 161 423T121 430L104 432Q103 432 103 446V459H123",
        50: "104 384Q115 394 133 409T199 449T281 474Q321 474 351 447T385 378Q385 328 333 255T228 127T176 72Q176 67 183 65Q184 65 203 65T260 67T331 69L475 73L484 67Q484 64 472 33L460 1H60V17L107 61Q210 159 249 208Q309 283 309 331Q309 363 285 389T228 415Q212 415 184 403T134 379L114 367L104 384",
        51: "305 328Q305 372 279 396T214 421H211Q172 421 128 384L107 398L116 405Q151 437 191 455T251 473H260Q314 473 341 455T382 394Q384 386 384 367T382 338Q362 263 271 217L256 210L257 206L259 202Q260 202 272 201T296 198T324 192T355 179T384 157T410 123T427 75Q429 64 429 41Q429 -59 353 -120T183 -182L88 -164Q81 -162 69 -157T48 -147T39 -141Q39 -139 46 -127L53 -114L69 -122Q129 -149 171 -149Q218 -149 253 -131T305 -83T330 -26T338 29Q338 41 336 55T328 89T308 127T273 153Q228 171 162 171Q158 171 152 171T142 170H127V204H134Q232 214 275 257Q305 292 305 328",
        52: "299 -179Q306 -156 306 -48V0H11V7Q10 10 10 18Q10 23 154 236L298 449Q298 450 339 463L379 476Q385 473 384 470V466Q384 463 384 457T384 444T383 427T383 408Q381 328 381 248Q381 46 384 40H387Q422 40 460 44Q465 44 470 44T478 44L481 45Q481 43 478 24T473 1Q473 -1 464 -1Q462 -1 451 -1T430 0H387V-76L389 -156V-161L311 -191Q299 -181 299 -179ZM299 364H287L277 352Q234 297 186 224T112 104T79 43Q79 42 192 42H306V115Q306 300 299 359V364",
        53: "334 25Q334 99 296 134T207 169Q154 169 107 123L98 114L89 120L80 125V458H420Q420 456 409 418L397 379Q397 378 264 378H131Q130 377 128 376T125 374T124 371T122 368T122 363T121 356T121 345V279V190L130 186L140 190Q196 214 260 214Q311 214 348 197T404 153T431 99T440 42T433 -16T406 -76T356 -130T276 -169T163 -184H156Q110 -184 57 -163L47 -159L53 -147L58 -134Q61 -134 74 -139T110 -148T156 -153Q206 -153 243 -135T299 -87T326 -30T334 25",
        54: "45 240Q45 328 73 406T143 536T235 626T327 681T399 699Q400 699 404 699T411 700Q424 700 441 696T459 689Q459 671 451 637Q451 633 447 632L444 629L434 633Q413 640 384 640H377Q299 640 222 565Q182 531 156 463T129 315V306H136L149 315Q229 376 316 376H318Q393 376 432 326T471 213Q471 129 402 58T237 -13T93 59T45 240ZM391 172Q391 231 354 272T258 314Q230 314 200 302T154 279T133 262L134 249Q154 32 266 32Q315 32 353 64T391 172",
        55: "395 377L391 382H225Q59 382 59 383L74 423Q89 464 89 465Q90 468 94 468Q146 460 350 458H498V442L473 406Q241 75 125 -156L113 -181H40L37 -168L57 -140Q115 -58 199 70T339 287T395 377",
        56: "220 -10Q168 -10 131 6T75 50T48 103T40 157Q40 223 77 266Q103 295 156 328T225 375Q247 393 247 394L206 361Q205 361 193 368T164 391T131 426T102 474T90 531Q90 580 114 615Q146 660 238 698L254 705L262 704Q288 704 332 693T402 656Q434 620 434 568Q434 518 401 475T321 402L305 391L336 368Q339 366 353 356T372 343T389 330T406 316T420 301T434 283T445 265T454 244T458 222T461 195Q461 106 389 48T220 -10ZM350 545Q350 578 337 601T304 634T266 649T234 653L224 654L204 639Q196 634 191 629T182 621T176 614T173 609T170 603T168 597Q165 585 165 567Q165 497 261 424L273 415Q350 467 350 545ZM261 405L263 407Q262 407 261 405ZM258 403Q257 403 255 401L254 399L256 400Q258 402 258 403ZM252 398Q251 398 249 396L248 394L250 395Q252 397 252 398ZM245 36Q276 36 300 45T338 69T360 102T371 136T374 168Q374 211 341 255Q324 275 305 289T235 332Q231 330 215 321T193 307T173 292T153 271T138 247T127 216T123 177Q123 146 132 117T170 62T245 36",
        57: "353 93T352 93T320 79T251 49T201 34Q127 37 87 79Q28 138 28 234Q28 273 37 304T60 355T101 396T152 429T218 462L234 469H243Q348 461 395 417Q466 348 466 201Q466 72 397 -29T211 -163Q155 -179 91 -182H72V-154H80Q144 -154 202 -131T297 -60Q318 -31 333 7T352 68L357 92Q353 93 352 93ZM369 208Q369 240 362 272T339 339T290 394T214 415Q171 415 144 372T116 266Q116 193 154 144T238 95H249Q369 95 369 208",
        58: "50 377T50 400T64 440T99 457Q128 457 146 440T165 399Q165 375 146 359T102 342T64 359ZM53 19T53 43T66 86T103 105Q129 105 148 87T168 41Q168 17 147 3T102 -12Q80 -12 67 3",
        59: "47 399Q47 424 62 441T101 458T143 442T162 400T144 359T101 343Q78 343 63 360T47 399ZM76 86Q76 88 80 91T91 96T106 99Q119 99 131 86Q179 35 179 -25Q179 -64 146 -115T89 -189Q86 -187 83 -185T79 -182T76 -180T75 -177T77 -173T80 -168Q121 -108 121 -64Q121 -44 94 -5T66 52Q66 66 71 75T76 86",
        61: "725 366Q724 365 721 349T716 331V329H385Q54 329 54 331Q55 332 59 349T63 368H394Q725 368 725 366ZM725 169Q724 168 721 152T716 134V132H385Q54 132 54 134Q55 135 59 152T63 171H394Q725 171 725 169",
        63: "46 557Q46 613 103 653T227 693Q287 693 322 659T357 564Q357 517 326 469T259 390T191 326T160 272Q160 240 187 221Q193 217 193 216Q182 209 170 200L147 184Q127 192 113 209T98 250Q98 290 193 376Q287 454 287 542Q287 581 262 616T188 652Q143 652 126 631T108 588Q108 559 140 527L79 490Q46 515 46 557ZM108 47Q108 68 123 85T160 103Q179 103 198 90T217 46Q215 24 201 7T164 -11Q142 -11 125 6T108 47",
        91: "262 -119Q224 -120 191 -123T141 -128T118 -130Q117 -130 117 305V740H122Q141 737 219 736H278V723Q278 711 277 711L159 699V-93H162Q167 -93 220 -96T276 -100Q278 -100 278 -109V-119H262",
        93: "64 733Q89 733 110 734T143 737T158 738H160V-131H154Q101 -125 40 -124H-4V-103H1Q3 -102 57 -98T113 -92H118V700L64 703Q7 707 3 708H-4V732H21Q34 733 64 733",
        94: "0 464L250 734L262 722Q274 712 384 598L495 486Q483 478 467 467L456 459L248 672L154 580L23 452Q17 454 10 458T0 464",
        8216: "117 410Q97 410 71 455T45 539Q45 588 129 694L140 708Q142 708 153 694L147 682Q106 609 106 582V577V571Q106 548 132 511T158 455Q158 434 143 422T117 410",
        8217: "105 529Q105 546 77 588T49 651Q49 658 51 666Q53 672 67 682T92 692Q111 692 137 644T163 563Q163 534 143 497T99 428T74 395Q72 395 65 400T58 407Q105 476 105 523V529",
        8260: "230 270Q426 721 428 721Q437 719 447 717L466 713L448 672Q78 -180 77 -181Q77 -182 55 -182L34 -181L230 270",
        58112: "427 436Q427 434 427 425T429 398T430 362Q430 222 396 109L393 99L305 33Q218 -32 216 -32Q208 -29 142 22L91 68L78 81L77 94Q75 130 75 173Q75 245 87 347L135 385Q178 418 184 424L177 428Q174 429 170 431Q116 454 96 473T75 534Q79 608 154 683Q164 677 164 673Q164 670 157 662T144 637T137 598Q137 552 182 518T280 470T380 447T427 436ZM342 371L275 394L208 417Q203 417 192 399T168 334T156 229Q153 187 153 157Q153 141 156 135Q158 125 208 88T280 51Q306 51 326 120T346 297Q346 339 344 354T342 371",
        58113: "39 551L35 569L52 577Q72 586 98 595T140 610T158 616Q174 612 200 604T293 560T412 477Q414 475 417 472Q428 462 430 450T432 376Q432 223 401 124Q395 106 393 103T382 92Q351 68 281 20T206 -29Q201 -31 137 26L100 60L78 83L77 112Q76 132 76 170Q76 259 86 342L88 360L101 371Q116 386 163 422T215 459Q216 459 224 455T233 450L229 446Q225 442 218 434T203 419Q179 394 175 389T168 372Q156 334 156 262Q156 167 164 137Q168 125 196 102T252 62L278 45Q279 45 285 52T302 78T322 126T339 205T346 316Q346 367 344 389L343 406L326 423Q228 520 113 559L100 564L70 557L39 551",
        58114: "123 386L120 431Q116 476 116 511V520Q116 593 174 649Q207 680 236 680Q258 680 284 664T312 648Q318 648 327 656Q328 657 330 659Q337 664 337 661Q337 660 338 657Q338 652 339 648L268 566L260 574Q234 600 206 600Q182 600 164 585T145 541Q145 492 211 386L267 385H324L299 354H214V312Q214 86 193 -58L192 -69L116 -215H108Q92 -215 92 -212Q93 -211 100 -189T116 -135T128 -80Q134 -41 134 22Q134 54 130 185T125 349V354H29L59 385H91Q123 385 123 386",
        58115: "91 530Q91 564 116 600T164 656T194 678Q195 678 200 678T209 679Q268 679 316 639L293 593Q267 547 263 546H262Q260 546 256 553Q222 613 180 613Q160 613 146 599T132 564T170 474T210 388H318L296 356H206V322Q204 284 204 255Q202 221 202 161V99Q202 28 194 -22T160 -124Q148 -146 116 -199L101 -224L91 -220Q85 -218 84 -217T83 -215L101 -161Q116 -114 119 -73T122 108Q119 334 117 352V356H72L28 357L66 388H92Q118 388 118 389L109 433Q91 514 91 530",
        58116: "254 -150Q293 -150 328 -126T363 -54Q363 -38 352 29T339 98L250 34Q160 -30 159 -30L77 64V71Q74 95 74 174Q74 212 75 243T79 294T83 328T87 352T90 366L117 384Q206 446 238 464L250 471Q277 455 306 443T350 427L365 423Q367 423 405 443T443 465L449 455Q431 414 426 362T418 201Q418 135 420 121Q438 -4 438 -19Q438 -26 438 -31T434 -42T429 -51T420 -63T408 -77T391 -95T370 -119T346 -147T325 -170T309 -187T291 -200T274 -207T252 -213T225 -214Q175 -214 132 -196T70 -160L52 -143Q52 -138 90 -48Q90 -47 95 -47H101Q108 -81 146 -115T254 -150ZM341 136Q341 157 344 242T347 348V355L334 356Q299 359 262 367T203 383T179 391Q177 391 173 377T163 323T158 227Q158 164 161 128V121L174 106Q203 75 223 59L341 127V136",
        58117: "92 446Q92 603 82 664Q94 670 95 670L96 666Q98 661 101 651T108 633Q121 598 121 597L141 612Q247 686 250 686Q251 686 266 679Q261 674 243 659T213 632T190 597T173 546Q172 541 171 530T170 511T170 502Q171 502 222 542L273 582Q308 522 315 504L279 449L269 462Q231 506 215 506Q202 506 190 490Q164 458 164 395V390H279L266 373L254 355H167V306Q169 252 169 217Q170 195 170 147V117L200 92Q234 64 237 64Q243 64 277 81L311 99V75Q310 75 242 27L174 -20L156 -3Q88 60 81 60L79 62Q80 60 82 62Q87 67 87 290V355H57L26 356L73 390H92V446",
        58118: "117 531Q117 533 137 544T178 566L198 577Q200 577 204 575T208 572V570Q208 568 208 566T207 560Q197 496 197 397V392H321L295 353H199V260Q199 157 200 145V122L269 68Q271 67 274 67Q282 67 310 83T342 100Q343 100 345 92T346 83L211 -21L172 12Q117 59 117 63Q117 65 117 87T119 150T120 238V353H75L29 354L65 391H118V460Q117 498 117 531",
        58119: "337 91V78L324 71Q288 53 256 29T206 -8T180 -22Q174 -22 158 -9Q82 46 60 46H59L63 51Q67 56 73 68T85 96Q101 158 101 254Q101 300 95 330T83 370T66 394L53 388Q48 385 41 382T24 374Q22 376 20 378T16 381T13 383T10 385V386L119 475Q150 439 160 430L171 422V409Q173 377 173 300Q173 228 166 183T152 122T145 102Q207 81 242 58L337 104V111Q340 146 340 227Q340 320 339 351T338 408V423L422 469Q425 465 429 462L426 438Q413 354 413 251Q413 152 423 119Q426 110 435 96T452 82Q454 82 509 103Q514 98 514 89Q514 87 507 81T472 51T409 -7L395 -20Q393 -18 390 -17Q386 -14 382 -6Q380 -2 379 1Q369 24 361 40T348 62T341 73T338 84L337 91"
      }, {});
      return fraktur$1;
    }
    var italic$1 = {};
    var italic = {};
    var hasRequiredItalic$1;
    function requireItalic$1() {
      if (hasRequiredItalic$1) return italic;
      hasRequiredItalic$1 = 1;
      Object.defineProperty(italic, "__esModule", { value: true });
      italic.italic = void 0;
      italic.italic = {
        33: [0.716, 0, 0.307, { ic: 0.073 }],
        34: [0.694, -0.379, 0.514, { ic: 0.024 }],
        35: [0.694, 0.194, 0.818, { ic: 0.01 }],
        37: [0.75, 0.056, 0.818, { ic: 0.029 }],
        38: [0.716, 0.022, 0.767, { ic: 0.035 }],
        39: [0.694, -0.379, 0.307, { ic: 0.07 }],
        40: [0.75, 0.25, 0.409, { ic: 0.108 }],
        41: [0.75, 0.25, 0.409],
        42: [0.75, -0.32, 0.511, { ic: 0.073 }],
        43: [0.557, 0.057, 0.767],
        44: [0.121, 0.194, 0.307],
        45: [0.251, -0.18, 0.358],
        46: [0.121, 0, 0.307],
        47: [0.716, 0.215, 0.778],
        48: [0.665, 0.021, 0.511, { ic: 0.051 }],
        49: [0.666, 0, 0.511],
        50: [0.666, 0.022, 0.511, { ic: 0.04 }],
        51: [0.666, 0.022, 0.511, { ic: 0.051 }],
        52: [0.666, 0.194, 0.511],
        53: [0.666, 0.022, 0.511, { ic: 0.056 }],
        54: [0.665, 0.022, 0.511, { ic: 0.054 }],
        55: [0.666, 0.022, 0.511, { ic: 0.123 }],
        56: [0.666, 0.021, 0.511, { ic: 0.042 }],
        57: [0.666, 0.022, 0.511, { ic: 0.042 }],
        58: [0.431, 0, 0.307],
        59: [0.431, 0.194, 0.307],
        61: [0.367, -0.133, 0.767],
        63: [0.716, 0, 0.511, { ic: 0.04 }],
        64: [0.705, 0.011, 0.767, { ic: 0.022 }],
        91: [0.75, 0.25, 0.307, { ic: 0.139 }],
        93: [0.75, 0.25, 0.307, { ic: 0.052 }],
        94: [0.694, -0.527, 0.511, { ic: 0.017 }],
        95: [-0.025, 0.062, 0.511, { ic: 0.043 }],
        126: [0.318, -0.208, 0.511, { ic: 0.06 }],
        305: [0.441, 0.01, 0.307, { ic: 0.033 }],
        567: [0.442, 0.204, 0.332],
        768: [0.697, -0.5, 0],
        769: [0.697, -0.5, 0, { ic: 0.039 }],
        770: [0.694, -0.527, 0, { ic: 0.017 }],
        771: [0.668, -0.558, 0, { ic: 0.06 }],
        772: [0.589, -0.544, 0, { ic: 0.054 }],
        774: [0.694, -0.515, 0, { ic: 0.062 }],
        775: [0.669, -0.548, 0],
        776: [0.669, -0.554, 0, { ic: 0.045 }],
        778: [0.716, -0.542, 0],
        779: [0.697, -0.503, 0, { ic: 0.065 }],
        780: [0.638, -0.502, 0, { ic: 0.029 }],
        989: [0.605, 0.085, 0.778],
        8211: [0.285, -0.248, 0.511, { ic: 0.043 }],
        8212: [0.285, -0.248, 1.022, { ic: 0.016 }],
        8213: [0.285, -0.248, 1.022, { ic: 0.016 }],
        8215: [-0.025, 0.062, 0.511, { ic: 0.043 }],
        8216: [0.694, -0.379, 0.307, { ic: 0.055 }],
        8217: [0.694, -0.379, 0.307, { ic: 0.07 }],
        8220: [0.694, -0.379, 0.514, { ic: 0.092 }],
        8221: [0.694, -0.379, 0.514, { ic: 0.024 }],
        8260: [0.716, 0.215, 0.778],
        8463: [0.695, 0.013, 0.54, { ic: 0.022 }],
        8710: [0.716, 0, 0.833, { sk: 0.167 }],
        10744: [0.716, 0.215, 0.778]
      };
      return italic;
    }
    var hasRequiredItalic;
    function requireItalic() {
      if (hasRequiredItalic) return italic$1;
      hasRequiredItalic = 1;
      Object.defineProperty(italic$1, "__esModule", { value: true });
      italic$1.italic = void 0;
      var FontData_js_1 = requireFontData();
      var italic_js_1 = requireItalic$1();
      italic$1.italic = (0, FontData_js_1.AddPaths)(italic_js_1.italic, {
        33: "330 716Q351 716 365 703T380 670V659L304 433Q230 207 227 204Q225 198 205 198Q184 198 184 207T220 439T260 669Q270 694 297 708Q300 709 304 710T311 713T316 714Q324 716 330 716ZM107 51Q110 83 133 102T179 121Q207 121 219 105T231 72Q231 45 209 23T156 0Q138 0 123 11T107 51",
        34: "214 620Q214 647 236 670T289 694Q312 694 326 677T341 633V624Q341 588 327 550T294 482T253 428T216 392T196 379Q191 379 184 388T176 401Q176 404 195 421T243 472T287 547Q299 576 299 582L295 580Q291 578 282 576T264 573Q241 573 228 585T214 620ZM411 620Q411 647 433 670T486 694Q509 694 523 677T538 633V624Q538 588 524 550T491 482T450 428T413 392T393 379Q388 379 381 388T373 401Q373 404 392 421T440 472T484 547Q496 576 496 582L492 580Q488 578 479 576T461 573Q438 573 425 585T411 620",
        35: "281 327H228Q186 327 175 330T164 347Q164 359 176 365Q179 367 292 367H404L563 688Q569 694 578 694T593 686T597 670Q597 667 531 535L448 367H614L773 688Q779 694 787 694Q796 694 802 688T808 674V672L807 670Q807 667 732 517L658 368L736 367H814Q828 357 828 347Q828 336 812 327H637L599 250Q561 174 561 173H662H724Q760 173 769 170T779 153T770 136T729 132Q721 132 696 132T651 133H540L380 -188Q374 -194 366 -194Q357 -194 351 -188T345 -174L346 -172V-170Q346 -167 412 -35L495 133H330L170 -188Q164 -194 156 -194Q147 -194 141 -188T135 -174L136 -172V-170Q136 -167 211 -17L285 133H207L130 134Q115 140 115 153Q115 164 131 173H306L344 250Q382 326 382 327H281ZM592 327H427L389 250Q351 174 351 173H516L554 250Q592 326 592 327",
        37: "301 348Q257 348 231 383T205 480Q205 553 244 629T346 736Q370 750 394 750Q416 750 429 742T458 714Q512 644 606 644Q722 644 802 732Q817 750 827 750Q835 750 841 744T847 730Q847 725 827 700T689 540Q586 421 512 335Q180 -50 176 -52Q172 -56 165 -56Q157 -56 151 -50T145 -35Q145 -29 162 -9T330 186Q392 258 430 302Q711 627 711 628L701 624Q652 607 604 607Q551 607 494 634L479 642V624Q479 544 439 467Q414 416 377 382T301 348ZM270 443Q270 385 303 385H306H308Q326 385 348 407Q384 441 409 504T434 627Q434 713 390 713Q358 713 328 663Q307 631 289 556T270 451V443ZM608 -56Q573 -56 543 -23T513 76Q513 129 536 190T604 296L627 318Q670 347 704 347Q747 347 767 310T788 222Q788 126 732 35T608 -56ZM742 222Q742 310 699 310Q677 310 655 285T620 227Q608 197 593 138T578 42V36Q578 -18 613 -18Q657 -18 699 64T742 222",
        38: "209 444Q209 546 278 631T424 716Q473 716 501 683T530 601Q530 554 511 535T467 515Q446 515 437 527T427 553Q427 578 446 594T481 610H483V617Q480 641 464 660T419 679Q367 679 328 603Q316 578 305 538T288 470L282 443L295 449Q308 455 330 462T371 469Q397 469 413 450T430 404Q430 363 400 329T331 295Q291 295 256 322Q255 322 246 293T227 223T217 158Q217 117 232 88T273 43T327 22T387 15Q457 15 512 37T599 93T652 169T680 248T688 317T678 380T659 423T647 437Q643 435 637 431T613 416T581 392T554 364T538 332Q540 310 541 310Q554 335 587 335Q601 335 613 327T626 300Q626 290 622 279T603 255T563 242Q532 245 512 263T491 320Q494 351 511 377T547 418T600 456T652 494Q676 512 697 539T728 582T738 601Q738 602 736 602Q732 602 726 604T714 616T707 638Q707 661 724 677T764 694Q799 694 802 660Q802 625 767 562T688 467L694 458Q700 449 702 444T711 428T720 408T727 385T733 358T735 327Q735 281 724 235T685 141T617 59T515 1T375 -22Q270 -22 199 34T127 181Q127 216 147 270T207 374L216 386Q209 421 209 444ZM386 412Q386 432 366 432Q345 432 325 418T294 390T284 375Q284 371 289 362T306 343T335 332Q355 332 367 350T383 384T386 412",
        39: "250 620Q250 647 272 670T325 694Q348 694 362 677T377 633V624Q377 566 343 506T275 412T231 379Q226 379 220 388T213 401T232 421T279 472T323 547Q335 573 335 582L331 580Q327 578 318 576T300 573Q277 573 264 585T250 620",
        40: "241 -250Q203 -212 174 -140T144 39Q144 158 180 288T296 544T481 746L487 750H499Q517 750 517 740Q517 736 495 716Q399 630 331 491T236 228T208 3Q208 -73 224 -130T255 -214T271 -244Q271 -250 252 -250H241",
        41: "326 497Q326 546 320 588T304 655T285 699T269 728T262 740Q262 746 267 749L272 750Q276 750 281 750H293Q331 712 360 640T390 461Q390 332 339 171T188 -116Q161 -150 121 -188T47 -250H35Q17 -250 17 -240Q17 -236 39 -216Q135 -130 203 9T298 272T326 497",
        42: "560 658Q569 658 576 649T584 631Q584 625 583 620T577 611T569 603T556 595T540 587T519 578T494 566L428 536Q427 535 433 531T479 502Q525 475 532 469T539 450Q538 435 525 424T497 412Q489 412 482 418T442 456Q400 497 400 494L387 420Q376 353 373 343T352 323Q345 320 336 320H331Q322 320 316 327T309 343Q309 347 334 420L359 496Q358 496 297 456T234 414Q228 411 221 411Q212 411 204 417T195 439Q198 458 209 465T283 502L353 534L300 566Q255 593 247 599T239 616Q239 631 252 644T282 658Q290 658 295 654T335 615L378 573L391 647Q393 657 395 671T398 691T400 706T404 720T408 730T414 739T423 744T434 749Q435 749 439 749T445 750Q467 748 469 728Q469 723 457 685T432 610L420 573L481 613Q548 658 560 658",
        43: "139 237T139 250T151 266T198 270H293H431L465 407Q469 424 476 452Q494 528 500 542T519 557Q526 557 532 552T538 538Q538 536 507 409T472 272Q472 270 604 270Q737 270 741 268Q753 261 753 250Q753 237 742 233T696 229Q687 229 655 229T599 230H462L461 226Q461 224 427 91T392 -47Q387 -57 374 -57Q367 -57 361 -51T355 -37Q355 -31 388 99L421 230H288Q267 230 238 230T199 229Q163 229 151 233",
        44: "106 46Q106 68 121 90T167 120Q168 120 173 120T180 121Q232 121 232 59V54Q232 18 219 -20T186 -88T145 -143T109 -181T88 -194Q84 -194 77 -185T69 -171Q69 -168 70 -166T76 -161T85 -154T101 -139T124 -114Q146 -88 162 -58T183 -12T188 7Q187 7 183 5T172 2T156 0Q129 0 118 14T106 46",
        45: "205 180H131Q102 180 93 181T84 190Q90 238 103 251H334Q341 244 341 241Q341 236 336 214T327 186Q325 181 312 181T205 180",
        46: "107 50Q107 76 129 98T181 121Q203 121 217 108T231 72Q231 47 210 24T156 0Q135 0 121 13T107 50",
        47: "166 -215T159 -215T147 -212T141 -204T139 -197Q139 -190 144 -183Q157 -157 378 274T602 707Q605 716 618 716Q625 716 630 712T636 703T638 696Q638 691 406 241T170 -212Q166 -215 159 -215",
        48: "414 665Q562 665 562 490Q562 426 534 318Q451 -21 251 -21Q222 -21 202 -15Q155 2 134 40T110 144Q110 201 127 286T187 470T287 614Q348 665 414 665ZM187 98Q187 59 208 37T260 15Q320 15 365 83Q394 128 440 312T487 547Q487 580 471 600T433 627Q428 628 408 628Q381 628 353 609T311 569Q279 526 239 364T190 143Q187 120 187 98",
        49: "248 491Q228 491 228 502Q228 516 236 532Q237 536 246 537T275 541T314 552Q350 567 382 595T430 644L446 664Q450 666 454 666Q468 666 468 658Q468 647 395 359Q321 63 321 59Q321 52 334 50T388 46H422Q428 37 428 35Q428 19 421 5Q416 0 405 0Q400 0 361 1T263 2Q215 2 185 2T142 1T127 0Q110 0 110 11Q110 13 113 25T118 40Q120 46 146 46Q196 46 212 49T235 61Q238 66 295 295L353 526L340 519Q328 512 302 503T248 491",
        50: "159 404Q159 433 176 476T222 562T297 635T395 666Q466 666 508 617T551 497Q551 473 545 446Q534 388 482 333Q441 292 355 240T264 184Q216 151 179 101L171 91Q171 90 177 90Q206 90 269 77T366 64Q385 64 390 65Q418 73 441 98T475 156Q479 168 481 170T495 173H518Q524 167 524 166T521 152Q502 86 459 32T353 -22Q315 -22 259 15T172 53Q156 53 143 36T126 1L121 -16Q119 -22 98 -22H82Q76 -16 76 -13T80 5T98 50T132 111T189 178T274 242Q327 273 364 305T420 370T447 427T460 483Q466 514 466 538Q466 586 443 607T389 629Q338 629 293 584T226 487T204 399Q204 390 204 386T209 378T222 373Q258 376 282 422T307 493Q307 506 302 517T297 531Q297 537 308 546T327 551Q329 550 333 543T340 523T344 497Q344 450 306 393T216 336Q186 336 173 355T159 396V404",
        51: "296 531Q296 536 307 544T322 553Q330 553 338 534T346 501Q346 468 319 440T258 412Q232 412 216 430T200 478Q200 552 281 618Q345 666 416 666Q489 666 525 625T562 530Q562 473 525 419T430 335L416 329Q479 288 479 206Q479 142 440 89T344 7T229 -22Q173 -22 135 12T96 106Q96 192 157 192Q192 192 197 157Q197 134 184 117T142 96Q153 47 180 29Q201 15 232 15Q249 15 275 22Q307 34 331 57Q363 90 379 153T396 246Q396 261 393 272T384 290T371 301T355 308T341 311T326 312H316H307Q287 312 282 313T276 320Q276 323 279 337T283 352Q284 356 290 357T325 358Q364 359 368 360Q386 365 400 372T433 397T464 448T485 527Q487 535 487 556Q487 629 414 629Q350 629 298 580T245 476Q245 450 263 450H264Q280 450 294 463T308 496Q308 508 302 518T296 531",
        52: "448 34Q453 34 463 22T473 5Q473 -2 457 -7Q417 -22 383 -23H366L350 -91Q348 -98 345 -111T340 -130T335 -146T330 -161T325 -172T318 -182T310 -188T299 -193T286 -194Q256 -194 253 -165Q253 -159 271 -83T292 -5Q231 29 169 29Q114 29 91 14Q72 -2 65 1Q46 20 46 28Q46 35 55 43T77 60T96 74Q306 257 396 623Q410 666 444 666Q459 666 468 657T478 634Q478 627 470 595T440 504T387 381T303 239T187 99L164 75H178Q217 75 260 59L304 43Q304 48 325 127Q342 195 346 207T358 228Q372 242 391 242Q403 242 413 235T423 214Q423 205 402 116T378 25Q378 23 387 23Q405 23 418 25T439 31T448 34",
        53: "196 304Q189 309 189 314Q189 317 231 487T275 660Q278 666 283 666Q287 666 302 658T346 643T413 635Q447 635 481 642T537 658T559 666Q561 666 564 663T567 658Q565 637 557 629Q528 600 474 573T359 545Q342 545 327 546T304 550T294 552L291 540Q288 529 283 507T273 465L251 379Q307 420 364 420Q415 420 456 382T497 261Q497 165 429 82T262 -20Q256 -20 247 -21T233 -22Q176 -22 141 15T106 112Q106 208 173 208Q192 208 203 197T214 169Q214 143 195 125T156 107H153V100Q155 73 174 47T239 21Q245 21 259 23Q355 46 392 200Q393 205 394 207Q412 276 412 312Q412 352 396 367T358 383Q288 383 233 314Q226 306 224 305T209 304H196",
        54: "377 434Q425 434 457 404T499 341T509 278Q509 243 496 194T456 105T383 27Q322 -22 256 -22Q142 -22 122 114Q120 130 120 159Q120 221 135 292T195 452T310 599Q390 665 465 665Q565 665 565 583V574Q565 543 546 524Q528 506 504 506Q491 506 478 514T465 543Q465 585 515 602Q505 626 466 626Q419 626 372 587Q334 557 305 503T266 409L255 370Q287 410 339 429Q361 434 377 434ZM424 333Q424 359 411 378T365 397Q318 397 282 356T230 257T205 157T197 94Q197 67 211 45T260 22Q313 22 341 57T386 151Q424 283 424 333",
        55: "466 519Q448 519 435 528T416 550T400 571T376 581Q324 581 271 540T186 437Q185 435 183 432T181 428T179 426T177 424T174 423T171 422T165 422H159Q141 422 141 423Q136 423 136 431Q136 433 190 548T247 665Q249 666 266 666H282Q288 660 288 657Q288 655 284 646T276 628L273 620Q337 666 390 666Q413 666 425 652T438 620T444 584T457 559Q460 557 470 557Q497 557 524 582T571 635T594 665Q595 666 612 666H628Q634 660 634 657Q634 653 618 629T572 556T510 441T437 269T367 43Q356 -22 304 -22Q291 -22 278 -14T263 14Q263 36 281 95T354 269T486 507Q497 524 495 524Q482 519 466 519",
        56: "209 449Q209 545 278 605T416 666Q482 666 517 631T553 546Q553 513 539 482T504 430T463 394T426 370L410 360L430 343Q471 309 483 278T495 211Q495 141 441 75Q363 -21 253 -21Q182 -21 141 18T99 117Q99 161 119 201T170 268T222 308T259 331L272 338L259 349Q212 389 209 449ZM492 542Q492 586 469 605T415 625Q360 625 320 587T279 505Q279 495 281 487T286 474T295 460T306 449T321 436T337 422Q379 386 380 386Q389 386 420 412T472 471Q492 513 492 542ZM163 118Q163 76 189 49T258 21Q316 21 368 64T420 170Q420 193 412 208T395 233T350 271L302 312Q298 312 284 303T249 276T209 235T177 181T163 118",
        57: "297 211Q258 211 230 228T189 273T169 323T163 367Q163 411 183 472T254 585Q327 656 401 665Q403 665 412 665T427 666Q458 664 481 652T518 622T539 580T550 535T553 491Q553 448 544 395T515 277T454 148T358 37Q282 -22 213 -22Q166 -22 137 -1T107 55V64Q107 88 114 104T134 127T154 136T169 138Q185 138 196 128T207 101Q207 82 196 68T172 48L161 43Q161 40 167 36T187 26T219 21Q286 21 344 99Q364 126 382 169T408 241T417 275L412 269Q406 263 395 253T370 234T337 218T297 211ZM476 552Q476 626 417 626Q368 626 330 584Q312 563 300 533T270 433Q248 341 248 312Q248 286 262 267T310 248Q353 248 387 287T440 380T467 480T476 552",
        58: "184 358Q184 385 206 408T258 431Q279 431 293 418T308 383Q308 354 284 332T233 310Q212 310 198 324T184 358ZM107 50Q107 76 129 98T181 121Q203 121 217 108T231 72Q231 47 210 24T156 0Q135 0 121 13T107 50",
        59: "184 358Q184 385 206 408T258 431Q279 431 293 418T308 383Q308 354 284 332T233 310Q212 310 198 324T184 358ZM107 47Q107 77 130 99T180 121Q226 121 226 61Q226 25 214 -14T182 -84T144 -140T109 -180T88 -194T77 -185T70 -172Q70 -169 84 -155T121 -112T161 -48Q180 -10 180 3Q180 4 174 2Q172 2 166 1T156 0Q135 0 121 13T107 47",
        61: "776 357T776 347T761 327H470Q180 327 176 329Q164 334 164 347Q164 359 176 365Q179 367 470 367H761Q776 357 776 347ZM116 143T116 153T131 173H422Q713 173 717 171Q728 166 728 153T717 135Q713 133 422 133H131Q116 143 116 153",
        63: "235 431Q217 431 206 442T195 468Q195 490 215 537T280 638T380 707Q403 716 423 716Q425 716 429 716T436 715Q485 715 518 681T551 590Q551 543 530 503T482 439Q471 428 400 375T318 310Q300 287 300 259Q300 236 315 236Q333 236 352 251T384 300Q386 306 407 306H423Q429 300 429 297Q429 272 393 235T308 198Q287 198 269 215T251 270Q251 330 293 374L374 436Q377 438 401 456T432 480T457 503T481 531T494 561T501 598Q501 614 499 626Q482 678 430 678H426Q392 678 362 660T311 615T280 571T264 540L259 528Q259 527 266 526T283 516T294 492Q294 466 276 449T235 431ZM209 51Q212 83 235 102T281 121Q309 121 321 105T333 72Q333 45 311 23T258 0Q240 0 225 11T209 51",
        64: "198 250Q198 155 248 91T394 26Q514 26 640 80L650 84H675H683Q709 84 709 76Q709 73 708 71Q706 64 660 45T534 8T383 -11T260 24T181 115Q152 168 152 248Q152 410 268 552Q303 590 324 608Q439 705 551 705Q611 705 658 683T733 623T775 543T789 454Q789 380 766 304T720 192Q677 125 617 125Q591 125 573 137T548 160T541 176Q541 178 540 178L534 173Q527 168 515 160T488 144T454 131T417 125Q361 125 320 166T279 284Q279 393 356 481T523 569Q570 569 603 537Q623 515 632 490L637 480L657 479Q684 479 684 470Q684 465 650 333L617 199V185Q616 162 628 162Q677 162 712 278Q743 381 743 442Q743 555 687 611T553 668Q467 668 385 608T250 450T198 250ZM598 445Q598 453 594 470T569 510T518 532Q463 532 410 448T356 271Q356 220 374 191T423 162Q482 162 552 255L575 348Q598 440 598 445",
        91: "205 -221Q205 -239 194 -250H137H106Q73 -250 73 -242Q73 -232 194 255T321 747L324 750H381H417Q435 750 440 748T446 739Q446 730 443 723T437 712L434 710H350L349 706Q349 704 235 249T120 -208Q120 -210 159 -210Q166 -210 175 -210T187 -209Q205 -209 205 -221",
        93: "227 721Q227 739 238 750H295H326Q359 750 359 742Q359 732 238 245T111 -247L108 -250H51H15Q-3 -250 -8 -248T-14 -239Q-14 -230 -11 -223T-5 -212L-2 -210H82L83 -206Q83 -204 197 251T312 708Q312 710 273 710Q266 710 257 710T245 709Q227 709 227 721",
        94: "528 555Q528 549 514 538T496 527Q491 527 470 554Q458 569 449 580L414 625L353 578Q339 567 323 555T298 536L290 529Q286 527 285 527Q279 527 273 533T264 546L260 553Q260 559 263 562Q265 564 342 628T421 693T425 694Q430 694 433 691Q528 563 528 555",
        95: "98 -62Q91 -58 91 -51Q91 -31 100 -26Q102 -25 324 -25H442H500Q536 -25 545 -27T554 -36Q554 -50 548 -56Q546 -60 538 -61Q520 -62 319 -62H98",
        126: "266 208Q262 208 255 215T247 228Q247 233 250 236T274 259Q335 318 369 318Q394 318 420 292T464 265Q485 265 516 291T550 318Q554 318 562 311T571 297Q570 293 551 273T502 231T451 209H447Q421 209 396 235T355 261Q334 261 301 235T266 208",
        305: "75 287Q75 292 82 313T103 362T142 413T196 441H214Q248 441 270 419T293 357Q292 338 289 330T245 208Q193 72 193 46Q193 26 209 26Q228 26 247 43Q273 71 292 136Q295 148 297 150T311 153H317Q327 153 330 153T337 150T340 143Q340 133 330 105T292 41T228 -8Q220 -10 204 -10Q160 -10 141 15T122 71Q122 98 171 227T221 384Q221 396 218 400T203 405Q175 403 156 374T128 312T116 279Q115 278 97 278H81Q75 284 75 287",
        567: "75 284T75 287T81 305T101 343T133 389T180 426T240 442Q273 440 300 420T327 350V332L278 134Q267 92 253 37T233 -45T225 -73Q208 -123 162 -163T54 -204Q8 -204 -15 -181Q-32 -164 -32 -140Q-32 -112 -14 -96T27 -79Q48 -79 57 -91T67 -114Q67 -146 39 -166L44 -167H59H60Q112 -167 145 -74Q148 -65 198 134T251 347Q252 353 252 370Q252 382 251 388T245 399T230 405Q204 405 175 378Q157 360 145 337T126 298T117 280T98 278H81Q75 284 75 287",
        768: "-222 651Q-222 668 -206 682T-174 697Q-155 697 -145 680Q-140 671 -107 599T-74 526Q-74 522 -88 511T-107 500Q-109 500 -113 502T-167 568T-219 637Q-222 643 -222 651",
        769: "-148 500Q-154 500 -163 511T-173 528Q-173 529 -172 530V532Q-170 534 -97 610T-21 688Q-8 697 4 697Q19 697 29 688T39 663T30 638Q26 631 -50 573L-135 507Q-144 500 -148 500",
        770: "17 555Q17 549 3 538T-15 527Q-20 527 -41 554Q-53 569 -62 580L-97 625L-158 578Q-172 567 -188 555T-212 536L-221 529Q-225 527 -226 527Q-232 527 -238 533T-248 546L-251 553Q-251 559 -248 562Q-246 564 -169 628T-90 693T-86 694Q-81 694 -78 691Q17 563 17 555",
        771: "-245 558Q-249 558 -256 565T-264 578Q-264 583 -261 586T-237 609Q-176 668 -142 668Q-117 668 -91 642T-47 615Q-26 615 5 641T39 668Q43 668 51 661T60 647Q59 643 40 623T-9 581T-60 559H-64Q-90 559 -115 585T-156 611Q-177 611 -210 585T-245 558",
        772: "-275 544Q-282 548 -282 554Q-282 561 -279 573T-271 588Q-269 589 -111 589H-27H12Q38 589 46 587T54 578Q54 574 51 563T47 550Q45 546 32 545Q15 544 -118 544H-275",
        774: "-237 641Q-237 694 -218 694H-213Q-195 694 -195 684Q-195 683 -195 679T-197 667T-198 650Q-198 611 -176 589T-117 566Q-74 566 -34 597T23 678Q27 689 30 691T43 694Q62 694 62 684Q62 671 49 645T14 589T-46 537T-123 515Q-175 515 -206 550T-237 641",
        775: "-165 599Q-162 631 -139 650T-93 669Q-65 669 -53 653T-41 620Q-41 593 -63 571T-116 548Q-134 548 -149 559T-165 599",
        776: "-251 601Q-251 626 -230 647T-180 669Q-139 669 -133 625Q-133 595 -155 575T-203 554Q-223 554 -237 567T-251 601ZM-72 599Q-72 632 -48 650T-2 669Q18 669 31 657T45 623Q45 592 22 573T-25 554Q-68 554 -72 599",
        778: "-199 610Q-199 654 -161 685T-79 716Q-39 716 -16 693Q3 674 3 647Q3 607 -34 575T-118 542Q-199 542 -199 610ZM-41 631T-41 655T-83 679H-89Q-129 679 -142 656Q-146 650 -151 632T-156 604Q-156 578 -113 578H-108Q-94 578 -86 579T-69 586T-52 605Q-41 631 -41 655",
        779: "-217 503Q-221 503 -234 510T-248 523Q-248 528 -205 602Q-200 610 -192 623T-180 644T-170 661T-159 676T-151 686T-142 694T-134 696Q-132 697 -121 697Q-88 694 -88 664Q-88 652 -97 640T-152 574Q-214 504 -217 503ZM-64 503Q-68 503 -81 510T-95 523Q-95 528 -52 602Q-47 610 -39 623T-27 644T-17 661T-6 676T2 686T11 694T19 696Q21 697 32 697Q65 694 65 664Q65 652 56 640T1 574Q-61 504 -64 503",
        780: "11 637Q16 637 22 624T29 607Q29 606 27 602Q26 600 -47 552T-125 502H-127Q-133 502 -184 553Q-236 602 -236 608Q-236 612 -224 625T-206 638L-202 637L-196 632Q-190 628 -179 620T-158 603L-116 570Q-109 572 -52 604T11 637",
        989: "477 261Q477 257 473 256T455 253T417 251T348 250H235L155 -77L146 -82Q137 -85 109 -85Q55 -85 55 -77L139 261Q224 596 226 598Q229 603 239 603Q240 603 254 603T290 603T341 604T405 605T477 605Q656 603 687 602T719 596Q719 589 692 588T513 585H319L282 427L242 272Q242 270 351 270Q388 270 410 270T444 269T460 267T469 265T477 261",
        8211: "98 248Q91 252 91 259Q91 279 100 284Q102 285 324 285H442H500Q536 285 545 283T554 274Q554 260 548 254Q546 250 538 249Q520 248 319 248H98",
        8212: "124 248Q117 252 117 259Q117 279 126 284Q128 285 579 285T1033 284Q1037 280 1037 278Q1038 276 1038 274Q1038 253 1029 250Q1026 248 575 248H124",
        8213: "124 248Q117 252 117 259Q117 279 126 284Q128 285 579 285T1033 284Q1037 280 1037 278Q1038 276 1038 274Q1038 253 1029 250Q1026 248 575 248H124",
        8215: "98 -62Q91 -58 91 -51Q91 -31 100 -26Q102 -25 324 -25H442H500Q536 -25 545 -27T554 -36Q554 -50 548 -56Q546 -60 538 -61Q520 -62 319 -62H98",
        8216: "249 379Q228 379 213 396T197 448Q197 533 271 627L278 635Q286 643 295 652T314 671T332 687T344 694Q349 694 355 685T362 671Q362 668 345 654T301 608T256 537Q238 493 240 491Q241 491 245 493T258 498T275 500Q296 500 311 488T326 454Q326 426 304 403T249 379",
        8217: "250 620Q250 647 272 670T325 694Q348 694 362 677T377 633V624Q377 566 343 506T275 412T231 379Q226 379 220 388T213 401T232 421T279 472T323 547Q335 573 335 582L331 580Q327 578 318 576T300 573Q277 573 264 585T250 620",
        8220: "295 379Q274 379 259 396T243 448Q243 533 317 627Q326 638 354 666T391 694Q395 694 402 686T409 673Q409 668 392 654T348 608T302 537Q284 493 286 491Q287 491 291 493T304 498T321 500Q342 500 357 488T372 454Q372 426 350 403T295 379ZM492 379Q471 379 456 396T440 448Q440 533 514 627Q523 638 551 666T588 694Q592 694 599 685T606 672T589 654T544 608T499 537Q481 493 483 491Q484 491 488 493T501 498T518 500Q539 500 554 488T569 454Q569 426 547 403T492 379",
        8221: "214 620Q214 647 236 670T289 694Q312 694 326 677T341 633V624Q341 588 327 550T294 482T253 428T216 392T196 379Q191 379 184 388T176 401Q176 404 195 421T243 472T287 547Q299 576 299 582L295 580Q291 578 282 576T264 573Q241 573 228 585T214 620ZM411 620Q411 647 433 670T486 694Q509 694 523 677T538 633V624Q538 588 524 550T491 482T450 428T413 392T393 379Q388 379 381 388T373 401Q373 404 392 421T440 472T484 547Q496 576 496 582L492 580Q488 578 479 576T461 573Q438 573 425 585T411 620",
        8260: "166 -215T159 -215T147 -212T141 -204T139 -197Q139 -190 144 -183Q157 -157 378 274T602 707Q605 716 618 716Q625 716 630 712T636 703T638 696Q638 691 406 241T170 -212Q166 -215 159 -215",
        8463: "150 475Q147 475 118 466T82 457Q73 457 64 467T54 487Q54 490 55 492Q63 506 64 506Q67 512 118 526Q162 541 169 546Q173 559 175 575Q181 596 181 604Q181 613 166 617Q164 617 153 618T135 619Q119 619 114 621T109 630Q109 636 114 656T122 681Q125 685 202 688Q272 695 286 695Q304 695 304 684Q304 682 291 628L278 577L386 612Q466 635 476 635T492 627T499 607Q499 593 489 586Q485 583 373 546L262 512Q262 511 248 455T233 397T236 397T244 404Q295 441 357 441Q405 441 445 417T485 333Q485 284 449 178T412 58T426 44Q447 44 466 68Q485 87 500 130L509 152H531H543Q562 152 562 144Q562 128 546 93T494 23T415 -13Q385 -13 359 3T322 44Q318 52 318 77Q318 99 352 196T386 337Q386 386 346 386Q318 386 286 370Q267 361 245 338T211 292Q207 287 193 235T162 113T138 21Q128 7 122 4Q105 -12 83 -12Q66 -12 54 -2T42 26Q42 45 98 257L151 475H150",
        8710: "574 715L582 716Q589 716 595 716Q612 716 616 714Q621 712 621 709Q622 707 705 359T788 8Q786 5 785 3L781 0H416Q52 0 50 2T48 6Q48 9 305 358T567 711Q572 712 574 715ZM599 346L538 602L442 474Q347 345 252 217T157 87T409 86T661 88L654 120Q646 151 629 220T599 346",
        10744: "166 -215T159 -215T147 -212T141 -204T139 -197Q139 -190 144 -183Q157 -157 378 274T602 707Q605 716 618 716Q625 716 630 712T636 703T638 696Q638 691 406 241T170 -212Q166 -215 159 -215"
      }, {});
      return italic$1;
    }
    var largeop$1 = {};
    var largeop = {};
    var hasRequiredLargeop$1;
    function requireLargeop$1() {
      if (hasRequiredLargeop$1) return largeop;
      hasRequiredLargeop$1 = 1;
      Object.defineProperty(largeop, "__esModule", { value: true });
      largeop.largeop = void 0;
      largeop.largeop = {
        40: [1.15, 0.649, 0.597],
        41: [1.15, 0.649, 0.597],
        47: [1.15, 0.649, 0.811],
        91: [1.15, 0.649, 0.472],
        92: [1.15, 0.649, 0.811],
        93: [1.15, 0.649, 0.472],
        123: [1.15, 0.649, 0.667],
        125: [1.15, 0.649, 0.667],
        710: [0.772, -0.565, 1],
        732: [0.75, -0.611, 1],
        770: [0.772, -0.565, 0],
        771: [0.75, -0.611, 0],
        8214: [0.602, 0, 0.778],
        8260: [1.15, 0.649, 0.811],
        8593: [0.6, 0, 0.667],
        8595: [0.6, 0, 0.667],
        8657: [0.599, 0, 0.778],
        8659: [0.6, 0, 0.778],
        8719: [0.95, 0.45, 1.278],
        8720: [0.95, 0.45, 1.278],
        8721: [0.95, 0.45, 1.444],
        8730: [1.15, 0.65, 1, { ic: 0.02 }],
        8739: [0.627, 0.015, 0.333],
        8741: [0.627, 0.015, 0.556],
        8747: [1.36, 0.862, 0.556, { ic: 0.388 }],
        8748: [1.36, 0.862, 1.084, { ic: 0.388 }],
        8749: [1.36, 0.862, 1.592, { ic: 0.388 }],
        8750: [1.36, 0.862, 0.556, { ic: 0.388 }],
        8896: [0.95, 0.45, 1.111],
        8897: [0.95, 0.45, 1.111],
        8898: [0.949, 0.45, 1.111],
        8899: [0.95, 0.449, 1.111],
        8968: [1.15, 0.649, 0.528],
        8969: [1.15, 0.649, 0.528],
        8970: [1.15, 0.649, 0.528],
        8971: [1.15, 0.649, 0.528],
        9001: [1.15, 0.649, 0.611],
        9002: [1.15, 0.649, 0.611],
        9168: [0.602, 0, 0.667],
        10072: [0.627, 0.015, 0.333],
        10216: [1.15, 0.649, 0.611],
        10217: [1.15, 0.649, 0.611],
        10752: [0.949, 0.449, 1.511],
        10753: [0.949, 0.449, 1.511],
        10754: [0.949, 0.449, 1.511],
        10756: [0.95, 0.449, 1.111],
        10758: [0.95, 0.45, 1.111],
        10764: [1.36, 0.862, 2.168, { ic: 0.388 }],
        12296: [1.15, 0.649, 0.611],
        12297: [1.15, 0.649, 0.611]
      };
      return largeop;
    }
    var hasRequiredLargeop;
    function requireLargeop() {
      if (hasRequiredLargeop) return largeop$1;
      hasRequiredLargeop = 1;
      Object.defineProperty(largeop$1, "__esModule", { value: true });
      largeop$1.largeop = void 0;
      var FontData_js_1 = requireFontData();
      var largeop_js_1 = requireLargeop$1();
      largeop$1.largeop = (0, FontData_js_1.AddPaths)(largeop_js_1.largeop, {
        40: "180 96T180 250T205 541T266 770T353 944T444 1069T527 1150H555Q561 1144 561 1141Q561 1137 545 1120T504 1072T447 995T386 878T330 721T288 513T272 251Q272 133 280 56Q293 -87 326 -209T399 -405T475 -531T536 -609T561 -640Q561 -643 555 -649H527Q483 -612 443 -568T353 -443T266 -270T205 -41",
        41: "35 1138Q35 1150 51 1150H56H69Q113 1113 153 1069T243 944T330 771T391 541T416 250T391 -40T330 -270T243 -443T152 -568T69 -649H56Q43 -649 39 -647T35 -637Q65 -607 110 -548Q283 -316 316 56Q324 133 324 251Q324 368 316 445Q278 877 48 1123Q36 1137 35 1138",
        47: "78 -649Q56 -646 56 -625Q56 -614 382 261T712 1140Q716 1150 732 1150Q754 1147 754 1126Q754 1116 428 240T98 -639Q94 -649 78 -649",
        91: "224 -649V1150H455V1099H275V-598H455V-649H224",
        92: "754 -625Q754 -649 731 -649Q715 -649 712 -639Q709 -635 383 242T55 1124Q54 1135 61 1142T80 1150Q92 1150 98 1140Q101 1137 427 262T754 -625",
        93: "16 1099V1150H247V-649H16V-598H196V1099H16",
        123: "547 -643L541 -649H528Q515 -649 503 -645Q324 -582 293 -466Q289 -449 289 -428T287 -200L286 42L284 53Q274 98 248 135T196 190T146 222L121 235Q119 239 119 250Q119 262 121 266T133 273Q262 336 284 449L286 460L287 701Q287 737 287 794Q288 949 292 963Q293 966 293 967Q325 1080 508 1148Q516 1150 527 1150H541L547 1144V1130Q547 1117 546 1115T536 1109Q480 1086 437 1046T381 950L379 940L378 699Q378 657 378 594Q377 452 374 438Q373 437 373 436Q350 348 243 282Q192 257 186 254L176 251L188 245Q211 236 234 223T287 189T340 135T373 65Q373 64 374 63Q377 49 378 -93Q378 -156 378 -198L379 -438L381 -449Q393 -504 436 -544T536 -608Q544 -611 545 -613T547 -629V-643",
        125: "119 1130Q119 1144 121 1147T135 1150H139Q151 1150 182 1138T252 1105T326 1046T373 964Q378 942 378 702Q378 469 379 462Q386 394 439 339Q482 296 535 272Q544 268 545 266T547 251Q547 241 547 238T542 231T531 227T510 217T477 194Q390 129 379 39Q378 32 378 -201Q378 -441 373 -463Q342 -580 165 -644Q152 -649 139 -649Q125 -649 122 -646T119 -629Q119 -622 119 -619T121 -614T124 -610T132 -607T143 -602Q195 -579 235 -539T285 -447Q286 -435 287 -199T289 51Q294 74 300 91T329 138T390 197Q412 213 436 226T475 244L489 250L472 258Q455 265 430 279T377 313T327 366T293 434Q289 451 289 472T287 699Q286 941 285 948Q279 978 262 1005T227 1048T184 1080T151 1100T129 1109L127 1110Q119 1113 119 1130",
        710: "1004 603Q1004 600 999 583T991 565L960 574Q929 582 866 599T745 631L500 698Q497 698 254 631Q197 616 134 599T39 574L8 565Q5 565 0 582T-5 603L26 614Q58 624 124 646T248 687L499 772Q999 604 1004 603",
        732: "296 691Q258 691 216 683T140 663T79 639T34 619T16 611Q13 619 8 628L0 644L36 662Q206 749 321 749Q410 749 517 710T703 670Q741 670 783 678T859 698T920 722T965 742T983 750Q986 742 991 733L999 717L963 699Q787 611 664 611Q594 611 484 651T296 691",
        770: "4 603Q4 600 -1 583T-9 565L-40 574Q-71 582 -134 599T-255 631L-500 698Q-503 698 -746 631Q-803 616 -866 599T-961 574L-992 565Q-995 565 -1000 582T-1005 603L-974 614Q-942 624 -876 646T-752 687L-501 772Q-1 604 4 603",
        771: "-704 691Q-742 691 -784 683T-860 663T-921 639T-966 619T-984 611Q-987 619 -992 628L-1000 644L-964 662Q-794 749 -679 749Q-590 749 -483 710T-297 670Q-259 670 -217 678T-141 698T-80 722T-35 742T-17 750Q-14 742 -9 733L-1 717L-37 699Q-213 611 -336 611Q-405 611 -515 651T-704 691",
        8214: "257 0V602H300V0H257ZM478 0V602H521V0H478",
        8260: "78 -649Q56 -646 56 -625Q56 -614 382 261T712 1140Q716 1150 732 1150Q754 1147 754 1126Q754 1116 428 240T98 -639Q94 -649 78 -649",
        8593: "112 421L120 424Q127 427 136 430T161 441T191 458T224 481T260 510T295 546T328 591L333 600L340 589Q380 527 431 489T555 421V377L543 381Q445 418 368 492L355 504V0H312V504L299 492Q222 418 124 381L112 377V421",
        8595: "312 96V600H355V96L368 108Q445 182 543 219L555 223V179L546 176Q538 173 529 169T505 158T475 141T442 119T407 90T372 53T339 9L334 0L327 11Q287 73 236 111T112 179V223L124 219Q222 182 299 108L312 96",
        8657: "142 329Q300 419 389 599Q389 598 399 579T420 541T452 494T497 438T558 383T636 329T708 294L721 289V246Q718 246 694 256T623 293T532 356L522 364L521 182V0H478V405L466 417Q436 450 389 516Q388 515 378 500T352 463T312 417L300 405V0H257V364L247 356Q202 320 155 293T82 256L57 246V289L70 294Q101 305 142 329",
        8659: "257 236V600H300V195L312 183Q342 150 389 84Q390 85 400 100T426 137T466 183L478 195V600H521V418L522 236L532 244Q576 280 623 307T696 344L721 354V311L708 306Q677 295 636 271Q478 181 389 1Q389 2 379 21T358 59T326 106T281 162T220 217T142 271T70 306L57 311V354Q60 354 83 345T154 308T247 244L257 236",
        8719: "220 812Q220 813 218 819T214 829T208 840T199 853T185 866T166 878T140 887T107 893T66 896H56V950H1221V896H1211Q1080 896 1058 812V-311Q1076 -396 1211 -396H1221V-450H725V-396H735Q864 -396 888 -314Q889 -312 889 -311V896H388V292L389 -311Q405 -396 542 -396H552V-450H56V-396H66Q195 -396 219 -314Q220 -312 220 -311V812",
        8720: "220 812Q220 813 218 819T214 829T208 840T199 853T185 866T166 878T140 887T107 893T66 896H56V950H552V896H542Q411 896 389 812L388 208V-396H889V812Q889 813 887 819T883 829T877 840T868 853T854 866T835 878T809 887T776 893T735 896H725V950H1221V896H1211Q1080 896 1058 812V-311Q1076 -396 1211 -396H1221V-450H56V-396H66Q195 -396 219 -314Q220 -312 220 -311V812",
        8721: "60 948Q63 950 665 950H1267L1325 815Q1384 677 1388 669H1348L1341 683Q1320 724 1285 761Q1235 809 1174 838T1033 881T882 898T699 902H574H543H251L259 891Q722 258 724 252Q725 250 724 246Q721 243 460 -56L196 -356Q196 -357 407 -357Q459 -357 548 -357T676 -358Q812 -358 896 -353T1063 -332T1204 -283T1307 -196Q1328 -170 1348 -124H1388Q1388 -125 1381 -145T1356 -210T1325 -294L1267 -449L666 -450Q64 -450 61 -448Q55 -446 55 -439Q55 -437 57 -433L590 177Q590 178 557 222T452 366T322 544L56 909L55 924Q55 945 60 948",
        8730: "1001 1150Q1017 1150 1020 1132Q1020 1127 741 244L460 -643Q453 -650 436 -650H424Q423 -647 423 -645T421 -640T419 -631T415 -617T408 -594T399 -560T385 -512T367 -448T343 -364T312 -259L203 119L138 41L111 67L212 188L264 248L472 -474L983 1140Q988 1150 1001 1150",
        8739: "146 612Q151 627 166 627Q182 627 187 612Q188 610 188 306T187 0Q184 -15 166 -15Q149 -15 146 0V10Q146 19 146 35T146 73T146 122T145 179T145 241T145 306T145 370T145 433T145 489T146 538T146 576T146 602V612",
        8741: "146 612Q151 627 166 627Q182 627 187 612Q188 610 188 306T187 0Q184 -15 166 -15Q149 -15 146 0V10Q146 19 146 35T146 73T146 122T145 179T145 241T145 306T145 370T145 433T145 489T146 538T146 576T146 602V612ZM368 612Q373 627 388 627Q404 627 409 612Q410 610 410 306T409 0Q406 -15 389 -15Q371 -15 368 0V10Q368 19 368 35T368 73T368 122T367 179T367 241T367 306T367 370T367 433T367 489T368 538T368 576T368 602V612",
        8747: "114 -798Q132 -824 165 -824H167Q195 -824 223 -764T275 -600T320 -391T362 -164Q365 -143 367 -133Q439 292 523 655T645 1127Q651 1145 655 1157T672 1201T699 1257T733 1306T777 1346T828 1360Q884 1360 912 1325T944 1245Q944 1220 932 1205T909 1186T887 1183Q866 1183 849 1198T832 1239Q832 1287 885 1296L882 1300Q879 1303 874 1307T866 1313Q851 1323 833 1323Q819 1323 807 1311T775 1255T736 1139T689 936T633 628Q574 293 510 -5T410 -437T355 -629Q278 -862 165 -862Q125 -862 92 -831T55 -746Q55 -711 74 -698T112 -685Q133 -685 150 -700T167 -741Q167 -789 114 -798",
        8748: "114 -798Q132 -824 165 -824H167Q195 -824 223 -764T275 -600T320 -391T362 -164Q365 -143 367 -133Q439 292 523 655T645 1127Q651 1145 655 1157T672 1201T699 1257T733 1306T777 1346T828 1360Q884 1360 912 1325T944 1245Q944 1220 932 1205T909 1186T887 1183Q866 1183 849 1198T832 1239Q832 1287 885 1296L882 1300Q879 1303 874 1307T866 1313Q851 1323 833 1323Q819 1323 807 1311T775 1255T736 1139T689 936T633 628Q574 293 510 -5T410 -437T355 -629Q278 -862 165 -862Q125 -862 92 -831T55 -746Q55 -711 74 -698T112 -685Q133 -685 150 -700T167 -741Q167 -789 114 -798ZM642 -798Q660 -824 693 -824H695Q723 -824 751 -764T803 -600T848 -391T890 -164Q893 -143 895 -133Q967 292 1051 655T1173 1127Q1179 1145 1183 1157T1200 1201T1227 1257T1261 1306T1305 1346T1356 1360Q1412 1360 1440 1325T1472 1245Q1472 1220 1460 1205T1437 1186T1415 1183Q1394 1183 1377 1198T1360 1239Q1360 1287 1413 1296L1410 1300Q1407 1303 1402 1307T1394 1313Q1379 1323 1361 1323Q1347 1323 1335 1311T1303 1255T1264 1139T1217 936T1161 628Q1102 293 1038 -5T938 -437T883 -629Q806 -862 693 -862Q653 -862 620 -831T583 -746Q583 -711 602 -698T640 -685Q661 -685 678 -700T695 -741Q695 -789 642 -798",
        8749: "114 -798Q132 -824 165 -824H167Q195 -824 223 -764T275 -600T320 -391T362 -164Q365 -143 367 -133Q439 292 523 655T645 1127Q651 1145 655 1157T672 1201T699 1257T733 1306T777 1346T828 1360Q884 1360 912 1325T944 1245Q944 1220 932 1205T909 1186T887 1183Q866 1183 849 1198T832 1239Q832 1287 885 1296L882 1300Q879 1303 874 1307T866 1313Q851 1323 833 1323Q819 1323 807 1311T775 1255T736 1139T689 936T633 628Q574 293 510 -5T410 -437T355 -629Q278 -862 165 -862Q125 -862 92 -831T55 -746Q55 -711 74 -698T112 -685Q133 -685 150 -700T167 -741Q167 -789 114 -798ZM642 -798Q660 -824 693 -824H695Q723 -824 751 -764T803 -600T848 -391T890 -164Q893 -143 895 -133Q967 292 1051 655T1173 1127Q1179 1145 1183 1157T1200 1201T1227 1257T1261 1306T1305 1346T1356 1360Q1412 1360 1440 1325T1472 1245Q1472 1220 1460 1205T1437 1186T1415 1183Q1394 1183 1377 1198T1360 1239Q1360 1287 1413 1296L1410 1300Q1407 1303 1402 1307T1394 1313Q1379 1323 1361 1323Q1347 1323 1335 1311T1303 1255T1264 1139T1217 936T1161 628Q1102 293 1038 -5T938 -437T883 -629Q806 -862 693 -862Q653 -862 620 -831T583 -746Q583 -711 602 -698T640 -685Q661 -685 678 -700T695 -741Q695 -789 642 -798ZM1150 -798Q1168 -824 1201 -824H1203Q1231 -824 1259 -764T1311 -600T1356 -391T1398 -164Q1401 -143 1403 -133Q1475 292 1559 655T1681 1127Q1687 1145 1691 1157T1708 1201T1735 1257T1769 1306T1813 1346T1864 1360Q1920 1360 1948 1325T1980 1245Q1980 1220 1968 1205T1945 1186T1923 1183Q1902 1183 1885 1198T1868 1239Q1868 1287 1921 1296L1918 1300Q1915 1303 1910 1307T1902 1313Q1887 1323 1869 1323Q1855 1323 1843 1311T1811 1255T1772 1139T1725 936T1669 628Q1610 293 1546 -5T1446 -437T1391 -629Q1314 -862 1201 -862Q1161 -862 1128 -831T1091 -746Q1091 -711 1110 -698T1148 -685Q1169 -685 1186 -700T1203 -741Q1203 -789 1150 -798",
        8750: "114 -798Q132 -824 165 -824H167Q195 -824 223 -764T275 -600T320 -391T362 -164Q365 -143 367 -133Q382 -52 390 2Q314 40 276 99Q230 167 230 249Q230 363 305 436T484 519H494L503 563Q587 939 632 1087T727 1298Q774 1360 828 1360Q884 1360 912 1325T944 1245Q944 1220 932 1205T909 1186T887 1183Q866 1183 849 1198T832 1239Q832 1287 885 1296L882 1300Q879 1303 874 1307T866 1313Q851 1323 833 1323Q766 1323 688 929Q662 811 610 496Q770 416 770 249Q770 147 701 68T516 -21H506L497 -65Q407 -464 357 -623T237 -837Q203 -862 165 -862Q125 -862 92 -831T55 -746Q55 -711 74 -698T112 -685Q133 -685 150 -700T167 -741Q167 -789 114 -798ZM480 478Q460 478 435 470T380 444T327 401T287 335T271 249Q271 124 375 56L397 43L431 223L485 478H480ZM519 20Q545 20 578 33T647 72T706 144T730 249Q730 383 603 455Q603 454 597 421T582 343T569 276Q516 22 515 20H519",
        8896: "1055 -401Q1055 -419 1042 -434T1007 -450Q977 -450 963 -423Q959 -417 757 167L555 750L353 167Q151 -417 147 -423Q134 -450 104 -450Q84 -450 70 -436T55 -401Q55 -394 56 -390Q59 -381 284 270T512 925Q525 950 555 950Q583 950 597 926Q599 923 825 270T1054 -391Q1055 -394 1055 -401",
        8897: "55 900Q55 919 69 934T103 950Q134 950 147 924Q152 913 353 333L555 -250L757 333Q958 913 963 924Q978 950 1007 950Q1028 950 1041 935T1055 901Q1055 894 1054 891Q1052 884 826 231T597 -426Q583 -450 556 -450Q527 -450 512 -424Q510 -421 285 229T56 890Q55 893 55 900",
        8898: "57 516Q68 602 104 675T190 797T301 882T423 933T542 949Q594 949 606 948Q780 928 901 815T1048 545Q1053 516 1053 475T1055 49Q1055 -406 1054 -410Q1051 -427 1037 -438T1006 -450T976 -439T958 -411Q957 -407 957 37Q957 484 956 494Q945 643 831 747T554 852Q481 852 411 826Q301 786 232 696T154 494Q153 484 153 37Q153 -407 152 -411Q148 -428 135 -439T104 -450T73 -439T56 -410Q55 -406 55 49Q56 505 57 516",
        8899: "56 911Q58 926 71 938T103 950Q120 950 134 939T152 911Q153 907 153 463Q153 16 154 6Q165 -143 279 -247T556 -352Q716 -352 830 -248T956 6Q957 16 957 463Q957 907 958 911Q962 928 975 939T1006 950T1037 939T1054 911Q1055 906 1055 451Q1054 -5 1053 -16Q1029 -207 889 -328T555 -449Q363 -449 226 -331T62 -45Q57 -16 57 25T55 451Q55 906 56 911",
        8968: "224 -649V1150H511V1099H275V-649H224",
        8969: "16 1099V1150H303V-649H252V1099H16",
        8970: "224 -649V1150H275V-598H511V-649H224",
        8971: "252 -598V1150H303V-649H16V-598H252",
        9001: "112 244V258L473 1130Q482 1150 498 1150Q511 1150 517 1142T523 1125V1118L344 685Q304 587 257 473T187 305L165 251L344 -184L523 -616V-623Q524 -634 517 -641T499 -649Q484 -649 473 -629L112 244",
        9002: "112 -649Q103 -649 95 -642T87 -623V-616L266 -184L445 251Q445 252 356 466T178 898T86 1123Q85 1134 93 1142T110 1150Q126 1150 133 1137Q134 1136 317 695L498 258V244L317 -194Q134 -635 133 -636Q126 -649 112 -649",
        9168: "312 0V602H355V0H312",
        10072: "146 612Q151 627 166 627Q182 627 187 612Q188 610 188 306T187 0Q184 -15 166 -15Q149 -15 146 0V10Q146 19 146 35T146 73T146 122T145 179T145 241T145 306T145 370T145 433T145 489T146 538T146 576T146 602V612",
        10216: "112 244V258L473 1130Q482 1150 498 1150Q511 1150 517 1142T523 1125V1118L344 685Q304 587 257 473T187 305L165 251L344 -184L523 -616V-623Q524 -634 517 -641T499 -649Q484 -649 473 -629L112 244",
        10217: "112 -649Q103 -649 95 -642T87 -623V-616L266 -184L445 251Q445 252 356 466T178 898T86 1123Q85 1134 93 1142T110 1150Q126 1150 133 1137Q134 1136 317 695L498 258V244L317 -194Q134 -635 133 -636Q126 -649 112 -649",
        10752: "668 944Q697 949 744 949Q803 949 814 948Q916 937 1006 902T1154 826T1262 730T1336 638T1380 563Q1454 415 1454 250Q1454 113 1402 -14T1258 -238T1036 -391T755 -449Q608 -449 477 -392T255 -240T110 -16T56 250Q56 387 105 510T239 723T434 871T668 944ZM755 -352Q922 -352 1061 -269T1278 -48T1356 250Q1356 479 1202 652T809 850Q798 851 747 851Q634 851 527 806T337 682T204 491T154 251Q154 128 201 17T329 -176T521 -304T755 -352ZM665 250Q665 290 692 315T758 341Q792 339 818 315T845 250Q845 211 819 186T755 160Q716 160 691 186T665 250",
        10753: "668 944Q697 949 744 949Q803 949 814 948Q916 937 1006 902T1154 826T1262 730T1336 638T1380 563Q1454 415 1454 250Q1454 113 1402 -14T1258 -238T1036 -391T755 -449Q608 -449 477 -392T255 -240T110 -16T56 250Q56 387 105 510T239 723T434 871T668 944ZM706 299V850H704Q519 832 386 725T198 476Q181 433 169 379T156 300Q156 299 431 299H706ZM1116 732Q1054 778 982 807T871 842T810 849L804 850V299H1079Q1354 299 1354 300Q1354 311 1352 329T1336 402T1299 506T1228 620T1116 732ZM706 -350V201H431Q156 201 156 200Q156 189 158 171T174 98T211 -6T282 -120T395 -232Q428 -257 464 -277T527 -308T587 -328T636 -339T678 -346T706 -350ZM1354 200Q1354 201 1079 201H804V-350Q808 -349 838 -345T887 -338T940 -323T1010 -295Q1038 -282 1067 -265T1144 -208T1229 -121T1301 0T1349 158Q1354 188 1354 200",
        10754: "668 944Q697 949 744 949Q803 949 814 948Q916 937 1006 902T1154 826T1262 730T1336 638T1380 563Q1454 415 1454 250Q1454 113 1402 -14T1258 -238T1036 -391T755 -449Q608 -449 477 -392T255 -240T110 -16T56 250Q56 387 105 510T239 723T434 871T668 944ZM1143 709Q1138 714 1129 722T1086 752T1017 791T925 826T809 850Q798 851 747 851H728Q659 851 571 823T408 741Q367 713 367 709L755 320L1143 709ZM297 639Q296 639 282 622T247 570T205 491T169 382T154 250T168 118T204 9T247 -70T282 -122L297 -139L685 250L297 639ZM1213 -139Q1214 -139 1228 -122T1263 -70T1305 9T1341 118T1356 250T1342 382T1306 491T1263 570T1228 622L1213 639L825 250L1213 -139ZM367 -209Q373 -215 384 -224T434 -258T514 -302T622 -336T755 -352T887 -338T996 -302T1075 -259T1126 -224L1143 -209L755 180Q754 180 561 -14T367 -209",
        10756: "56 911Q58 926 71 938T103 950Q120 950 134 939T152 911Q153 907 153 463Q153 16 154 6Q165 -143 279 -247T556 -352Q716 -352 830 -248T956 6Q957 16 957 463Q957 907 958 911Q962 928 975 939T1006 950T1037 939T1054 911Q1055 906 1055 451Q1054 -5 1053 -16Q1029 -207 889 -328T555 -449Q363 -449 226 -331T62 -45Q57 -16 57 25T55 451Q55 906 56 911ZM507 554Q511 570 523 581T554 593Q571 593 585 582T603 554Q604 551 604 443V338H709Q817 338 820 337Q835 334 847 321T859 290Q859 254 819 241Q816 240 709 240H604V134Q604 48 604 34T598 11Q583 -15 555 -15Q526 -15 512 11Q507 20 507 34T506 134V240H401H344Q292 240 278 246Q251 259 251 290Q251 309 264 321T290 337Q293 338 401 338H506V443Q506 551 507 554",
        10758: "56 911Q60 927 72 938T103 950Q120 950 134 939T152 911Q153 907 153 277V-352H957V277Q957 907 958 911Q962 928 975 939T1006 950T1036 939T1054 911V891Q1054 871 1054 836T1054 754T1054 647T1055 525T1055 390T1055 250T1055 111T1055 -24T1055 -147T1054 -253T1054 -335T1054 -391V-411Q1047 -442 1016 -449Q1011 -450 552 -450L94 -449Q63 -439 56 -411V-391Q56 -371 56 -336T56 -254T56 -147T55 -25T55 110T55 250T55 389T55 524T55 647T56 753T56 835T56 891V911",
        12296: "112 244V258L473 1130Q482 1150 498 1150Q511 1150 517 1142T523 1125V1118L344 685Q304 587 257 473T187 305L165 251L344 -184L523 -616V-623Q524 -634 517 -641T499 -649Q484 -649 473 -629L112 244",
        12297: "112 -649Q103 -649 95 -642T87 -623V-616L266 -184L445 251Q445 252 356 466T178 898T86 1123Q85 1134 93 1142T110 1150Q126 1150 133 1137Q134 1136 317 695L498 258V244L317 -194Q134 -635 133 -636Q126 -649 112 -649"
      }, {
        10764: "∬∬"
      });
      return largeop$1;
    }
    var monospace$1 = {};
    var monospace = {};
    var hasRequiredMonospace$1;
    function requireMonospace$1() {
      if (hasRequiredMonospace$1) return monospace;
      hasRequiredMonospace$1 = 1;
      Object.defineProperty(monospace, "__esModule", { value: true });
      monospace.monospace = void 0;
      monospace.monospace = {
        32: [0, 0, 0.525],
        33: [0.622, 0, 0.525],
        34: [0.623, -0.333, 0.525],
        35: [0.611, 0, 0.525],
        36: [0.694, 0.082, 0.525],
        37: [0.694, 0.083, 0.525],
        38: [0.622, 0.011, 0.525],
        39: [0.611, -0.287, 0.525],
        40: [0.694, 0.082, 0.525],
        41: [0.694, 0.082, 0.525],
        42: [0.52, -0.09, 0.525],
        43: [0.531, -0.081, 0.525],
        44: [0.14, 0.139, 0.525],
        45: [0.341, -0.271, 0.525],
        46: [0.14, 0, 0.525],
        47: [0.694, 0.083, 0.525],
        58: [0.431, 0, 0.525],
        59: [0.431, 0.139, 0.525],
        60: [0.557, -0.055, 0.525],
        61: [0.417, -0.195, 0.525],
        62: [0.557, -0.055, 0.525],
        63: [0.617, 0, 0.525],
        64: [0.617, 6e-3, 0.525],
        91: [0.694, 0.082, 0.525],
        92: [0.694, 0.083, 0.525],
        93: [0.694, 0.082, 0.525],
        94: [0.611, -0.46, 0.525],
        95: [-0.025, 0.095, 0.525],
        96: [0.681, -0.357, 0.525],
        123: [0.694, 0.083, 0.525],
        124: [0.694, 0.082, 0.525],
        125: [0.694, 0.083, 0.525],
        126: [0.611, -0.466, 0.525],
        127: [0.612, -0.519, 0.525],
        160: [0, 0, 0.525],
        305: [0.431, 0, 0.525],
        567: [0.431, 0.228, 0.525],
        697: [0.623, -0.334, 0.525],
        768: [0.611, -0.485, 0],
        769: [0.611, -0.485, 0],
        770: [0.611, -0.46, 0],
        771: [0.611, -0.466, 0],
        772: [0.577, -0.5, 0],
        774: [0.611, -0.504, 0],
        776: [0.612, -0.519, 0],
        778: [0.619, -0.499, 0],
        780: [0.577, -0.449, 0],
        913: [0.623, 0, 0.525],
        914: [0.611, 0, 0.525],
        915: [0.611, 0, 0.525],
        916: [0.623, 0, 0.525],
        917: [0.611, 0, 0.525],
        918: [0.611, 0, 0.525],
        919: [0.611, 0, 0.525],
        920: [0.621, 0.01, 0.525],
        921: [0.611, 0, 0.525],
        922: [0.611, 0, 0.525],
        923: [0.623, 0, 0.525],
        924: [0.611, 0, 0.525],
        925: [0.611, 0, 0.525],
        926: [0.611, 0, 0.525],
        927: [0.621, 0.01, 0.525],
        928: [0.611, 0, 0.525],
        929: [0.611, 0, 0.525],
        931: [0.611, 0, 0.525],
        932: [0.611, 0, 0.525],
        933: [0.622, 0, 0.525],
        934: [0.611, 0, 0.525],
        935: [0.611, 0, 0.525],
        936: [0.611, 0, 0.525],
        937: [0.622, 0, 0.525],
        8215: [-0.025, 0.095, 0.525],
        8242: [0.623, -0.334, 0.525],
        8243: [0.623, 0, 1.05],
        8244: [0.623, 0, 1.575],
        8260: [0.694, 0.083, 0.525],
        8279: [0.623, 0, 2.1],
        8710: [0.623, 0, 0.525]
      };
      return monospace;
    }
    var hasRequiredMonospace;
    function requireMonospace() {
      if (hasRequiredMonospace) return monospace$1;
      hasRequiredMonospace = 1;
      Object.defineProperty(monospace$1, "__esModule", { value: true });
      monospace$1.monospace = void 0;
      var FontData_js_1 = requireFontData();
      var monospace_js_1 = requireMonospace$1();
      monospace$1.monospace = (0, FontData_js_1.AddPaths)(monospace_js_1.monospace, {
        32: "",
        33: "206 565Q206 590 222 606T265 622Q287 621 303 606T319 565T314 392L308 216Q299 194 273 194H262Q247 194 241 195T228 200T217 216L211 392Q206 539 206 565ZM206 56Q206 83 223 99T265 115Q288 113 304 99T320 58Q320 33 303 17T262 0Q237 0 222 17T206 56",
        34: "122 575Q122 593 137 608T173 623Q196 623 210 608T225 575Q225 562 218 464Q212 373 211 361T201 341Q193 333 173 333Q154 333 146 341Q138 348 137 360T129 464Q122 561 122 575ZM299 575Q299 593 314 608T350 623Q373 623 387 608T402 575Q402 562 395 464Q389 373 388 361T378 341Q370 333 350 333Q331 333 323 341Q315 348 314 360T306 464Q299 561 299 575",
        35: "93 163Q74 163 65 164T46 173T36 198Q36 210 40 215T61 233H131V236Q132 239 140 307T149 377Q149 379 105 379L61 380Q36 392 36 414Q36 450 86 450Q91 450 99 450T112 449H159Q163 480 167 517Q168 524 170 545T174 573T180 591T191 607T210 611Q223 611 232 604T243 588L245 580Q245 565 238 511T230 451Q230 449 282 449H333Q337 480 341 517Q342 524 343 537T345 556T348 573T352 589T359 600T370 608T384 611Q395 611 406 602T419 580Q419 565 412 511T404 451Q404 449 431 449H442Q477 449 485 429Q489 421 489 414Q489 392 463 380L428 379H394V376Q393 373 385 305T376 235Q376 233 419 233H463L468 230Q472 227 473 227T477 223T482 218T486 213T488 206T489 198Q489 162 436 162Q430 162 422 162T412 163H366V161Q364 159 357 92Q356 85 355 73T353 54T350 37T346 22T339 11T328 3T314 0Q303 0 292 9T279 31Q279 37 287 96T295 162Q295 163 244 163H192V161Q190 159 183 92Q182 85 181 73T179 54T176 37T172 22T165 11T154 3T140 0Q129 0 118 9T105 31Q105 37 113 96T121 162Q121 163 93 163ZM323 377Q323 379 272 379H220V376Q219 373 211 305T202 235Q202 233 253 233H305V236Q306 239 314 307T323 377",
        36: "415 397Q392 397 377 411T362 448Q362 464 376 485Q369 498 362 506T346 520T332 528T315 533T300 538V445L301 353L311 350Q382 334 424 284T466 174Q466 115 425 65T303 -2L300 -3V-30Q300 -64 291 -74Q283 -82 262 -82H255Q234 -82 225 -60L224 -32V-4L213 -2Q152 6 106 51T59 170V180Q59 197 74 213Q89 227 110 227T146 213T162 174Q162 156 147 137Q153 123 161 112T176 95T191 85T205 79T216 76T224 74V283L213 285Q147 298 103 343T58 449Q58 516 108 560T224 614V643V654Q224 666 226 673T237 687T264 694Q289 693 294 683T300 642V615H303Q355 607 390 587T440 540T460 493T466 453Q466 425 451 411T415 397ZM137 452Q137 425 158 404T198 376T223 369Q224 369 224 453T223 537Q198 532 168 509T137 452ZM301 75Q307 75 325 83T365 116T387 171Q387 238 300 267V171Q300 75 301 75",
        37: "35 560Q35 607 54 645T110 693Q111 693 116 693T125 694Q165 692 187 651T210 560Q210 506 186 467T123 428Q84 428 60 466T35 560ZM139 560Q139 574 136 587T130 608T124 615Q122 617 120 614Q106 595 106 561Q106 516 121 506Q123 504 125 507Q139 526 139 560ZM123 -83Q107 -83 98 -73T88 -48Q88 -43 89 -41Q90 -37 229 316T370 675Q381 694 400 694Q416 694 426 684T436 659Q436 654 435 652Q434 647 295 294T153 -65Q144 -83 123 -83ZM314 50Q314 104 338 143T400 183Q439 183 464 144T489 50T465 -43T402 -82Q358 -82 336 -41T314 50ZM417 50Q417 71 413 85T405 102L401 106Q386 95 386 50Q386 29 390 15T398 -2L402 -6Q417 5 417 50",
        38: "96 462Q96 546 132 584T211 622Q255 622 284 583T314 474Q314 395 224 305L208 288Q213 275 226 251L265 185L269 179Q273 184 299 246L332 333L342 363Q342 364 341 365Q334 365 334 393Q334 406 334 410T340 420T356 431H412H440Q467 431 478 424T490 393Q490 376 484 367T470 357T448 355H441H415L399 312Q349 176 322 127L315 115L323 106Q360 65 393 65Q405 65 410 80T416 109Q416 140 452 140Q487 140 487 105Q487 56 460 23T391 -11L286 41L273 53L262 42Q212 -11 151 -11Q97 -11 63 33T28 143Q28 161 30 176T38 205T47 227T60 247T72 261T84 274T94 283L122 311L119 323Q96 392 96 462ZM243 474Q243 533 218 545L215 546Q212 546 210 546Q182 546 169 501Q167 492 167 466Q167 419 179 368L188 377Q234 425 242 461Q243 465 243 474ZM217 129Q185 174 154 235Q121 214 115 176Q113 168 113 143Q113 83 139 67Q141 66 152 66Q191 66 228 112L217 129",
        39: "205 554Q205 577 221 594T263 611Q302 611 325 577T349 490Q349 409 298 347Q285 330 258 309T214 287Q203 289 189 302T175 327Q175 341 185 349T213 369T245 402Q269 437 273 483V497Q264 496 263 496Q240 496 223 513T205 554",
        40: "437 -53Q437 -82 399 -82H394Q377 -82 342 -55Q259 7 213 102T166 306Q166 412 211 507T342 667Q377 694 393 694H399Q437 694 437 665Q437 654 426 643T397 620T356 584T311 525Q301 511 290 488T264 412T250 306Q250 191 300 105T422 -27Q437 -37 437 -53",
        41: "87 664Q87 694 126 694Q138 694 147 690T183 667Q266 605 312 510T358 306Q358 193 307 93T161 -70Q142 -82 126 -82Q105 -82 96 -73T87 -53Q87 -47 88 -44Q92 -36 116 -19T173 34T230 119Q273 206 273 306Q273 408 231 494T109 635Q87 649 87 664",
        42: "222 487Q224 501 235 510T262 520Q279 520 289 510T302 487Q302 458 301 429Q301 421 301 413T301 398T300 386T300 377V374Q300 373 301 373Q304 373 353 403T416 434Q432 434 444 423T456 393Q456 389 456 386T454 379T451 373T448 368T442 363T436 358T427 353T417 348T405 342T391 334Q345 309 339 305L388 279Q400 273 412 266T432 255T441 250Q456 238 456 218Q456 200 445 189T417 177Q403 177 354 207T301 238Q300 238 300 237V234Q300 231 300 226T300 214T301 199T301 182Q302 153 302 124Q300 109 289 100T262 90T235 100T222 124Q222 153 223 182Q223 190 223 198T223 213T224 225T224 234V237Q224 238 223 238Q220 238 171 208T108 177Q92 177 80 188T68 218Q68 237 79 246T134 277Q180 303 185 306L136 332Q124 338 112 345T92 356T83 361Q68 373 68 393Q68 411 79 422T107 434Q121 434 170 404T223 373Q224 373 224 374V377Q224 380 224 385T224 397T223 412T223 429Q222 458 222 487",
        43: "147 271Q138 271 122 271T98 270Q68 270 53 277T38 306T53 335T98 342Q105 342 121 342T147 341H227V423L228 505Q241 531 262 531Q268 531 273 530T282 525T287 519T293 511L297 505V341H377H430Q457 341 467 338T483 321Q487 313 487 306Q487 295 480 286T463 273Q457 271 377 271H297V107Q281 81 262 81Q250 81 242 87T230 100L228 107L227 189V271H147",
        44: "193 37T193 70T213 121T260 140Q302 140 327 108T353 36Q353 -7 336 -43T294 -98T249 -128T215 -139Q204 -139 189 -125Q177 -111 174 -101Q172 -84 183 -77T217 -61T253 -33Q261 -24 272 1L265 0Q234 0 214 18",
        45: "57 306Q57 333 86 341H438Q468 332 468 306T438 271H86Q57 280 57 306",
        46: "193 70Q193 105 214 122T258 140Q291 140 311 120T332 70Q332 44 314 23T262 1Q234 1 214 18T193 70",
        47: "94 -83Q78 -83 68 -73T58 -48Q58 -44 60 -36Q62 -31 227 314T399 673Q410 694 431 694Q445 694 455 684T466 659Q466 656 464 648Q463 643 298 298T125 -62Q114 -83 94 -83",
        58: "193 361Q193 396 214 413T258 431Q291 431 311 411T332 361Q332 335 314 314T262 292Q234 292 214 309T193 361ZM193 70Q193 105 214 122T258 140Q291 140 311 120T332 70Q332 44 314 23T262 1Q234 1 214 18T193 70",
        59: "193 361Q193 396 214 413T258 431Q291 431 311 411T332 361Q332 335 314 314T262 292Q234 292 214 309T193 361ZM193 70Q193 105 214 122T259 140Q301 140 319 108T337 33Q337 -38 291 -88T214 -139Q203 -139 189 -126T175 -97Q175 -85 182 -78T200 -66T225 -50T249 -17Q256 -3 256 0Q252 1 248 1Q242 2 235 5T218 15T200 36T193 70",
        60: "468 90Q468 76 458 66T433 55Q426 55 419 58Q413 61 243 168T68 280Q57 291 57 306T68 332Q72 335 241 442T416 553Q424 557 432 557Q447 557 457 547T468 522T456 496Q454 494 305 399L158 306L305 213Q341 190 390 159Q443 125 452 119T464 106V105Q468 97 468 90",
        61: "38 382Q38 409 67 417H457Q487 408 487 382Q487 358 461 348H64Q51 352 45 360T38 376V382ZM67 195Q38 204 38 230Q38 255 62 264Q66 265 264 265H461L464 264Q467 262 469 261T475 256T481 249T485 240T487 230Q487 204 457 195H67",
        62: "57 522Q57 539 67 548T90 557Q98 557 105 554Q111 551 281 444T456 332Q468 320 468 306T456 280Q452 276 282 169T105 58Q98 55 91 55Q79 55 68 63T57 90Q57 105 68 116Q70 118 219 213L366 306L219 399Q75 491 71 494Q57 507 57 522",
        63: "62 493Q62 540 107 578T253 617Q366 617 414 578T462 490Q462 459 445 434T411 400L394 390Q315 347 296 287Q294 278 293 247V217Q285 201 278 198T246 194T216 197T201 215V245V253Q201 379 351 456Q366 464 375 477Q377 482 377 490Q377 517 339 528T251 540Q182 540 159 517Q166 503 166 490Q166 468 151 453T114 438Q96 438 79 451T62 493ZM190 58Q190 85 208 100T249 115Q272 113 288 99T304 58Q304 33 287 17T246 0T206 16T190 58",
        64: "44 306Q44 445 125 531T302 617Q332 617 358 607T411 574T456 502T479 387Q481 361 481 321Q481 203 421 143Q381 103 332 103Q266 103 225 165T183 307Q183 390 227 449T332 508Q358 508 378 498Q350 541 304 541Q229 541 172 473T115 305Q115 208 171 140T306 71H310Q358 71 397 105Q409 115 436 115Q458 115 462 113Q481 106 481 86Q481 73 468 61Q401 -6 305 -6Q262 -6 217 14T133 71T69 170T44 306ZM410 306Q410 361 386 396T333 431Q300 431 277 394T254 305Q254 256 276 218T332 180Q364 180 387 217T410 306",
        91: "237 -82Q221 -78 214 -58V305Q214 669 216 673Q220 687 231 690T278 694H350H461Q462 693 467 690T474 685T478 679T482 670T483 656Q483 632 471 625T428 617Q422 617 406 617T379 618H298V-7H379H420Q459 -7 471 -13T483 -45Q483 -55 483 -59T477 -70T461 -82H237",
        92: "58 659Q58 673 68 683T93 694Q114 694 125 673Q132 659 297 314T464 -36Q466 -44 466 -48Q466 -66 454 -74T431 -83Q410 -83 399 -62Q391 -47 226 298T60 648Q58 656 58 659",
        93: "41 656Q41 681 53 688T99 695Q107 695 133 695T177 694H288Q307 681 310 669V-58Q303 -76 288 -82H64Q41 -73 41 -45Q41 -21 53 -14T96 -6Q102 -6 118 -6T145 -7H226V618H145H100Q67 618 54 625T41 656",
        94: "138 460Q121 460 109 479T96 512Q96 527 106 534Q109 536 178 571T253 609Q256 611 264 611Q272 610 343 574Q357 567 369 561T389 550T402 543T411 538T416 535T420 532T422 529T425 525Q428 518 428 512Q428 498 416 479T386 460H384Q377 460 316 496L262 526L208 496Q147 460 138 460",
        95: "57 -60Q57 -33 86 -25H438Q468 -34 468 -60T438 -95H86Q57 -86 57 -60",
        96: "176 479Q176 563 227 622T310 681Q324 680 337 667T350 641Q350 627 340 619T312 599T280 566Q256 531 252 485V471Q261 472 262 472Q285 472 302 455T320 414Q320 389 303 373T261 357Q223 357 200 391T176 479",
        123: "430 -7H436Q449 -7 456 -8T469 -19T475 -45Q475 -69 466 -76T434 -83H419Q386 -82 363 -80T308 -69T253 -41T223 7L221 17L220 118V220L218 224Q215 229 214 230T210 235T204 241T195 246T184 252T170 257T151 262T127 265Q118 267 100 267T69 270T52 283Q50 288 50 306V314Q50 335 67 341Q68 342 102 343T172 355T217 386L220 392V493L221 595Q225 611 230 621T251 650T304 679T395 693L406 694Q418 694 426 694Q458 694 466 685Q475 676 475 656T466 627Q458 618 430 618Q319 618 305 587L304 486Q304 476 304 458T305 431Q305 385 295 358T251 311L243 306Q243 305 254 298T281 274T302 231Q304 223 304 125L305 25Q309 16 316 10T352 -1T430 -7",
        124: "228 668Q241 694 262 694Q268 694 273 693T282 688T287 682T293 674L297 668V-57Q282 -82 262 -82Q239 -82 228 -57V668",
        125: "49 655Q49 674 56 682T73 692T106 694Q141 693 167 690T224 677T275 647T303 595L305 392Q313 367 347 356T417 344T457 341Q475 335 475 306Q475 292 473 285T464 273T451 269T430 267Q352 262 327 246Q311 236 305 220L303 17L301 7Q294 -16 277 -33T242 -60T196 -74T150 -80T106 -83Q78 -83 72 -82T58 -74Q49 -65 49 -44Q49 -24 58 -16Q66 -7 94 -7Q143 -7 171 -1T207 10T220 25V125Q220 223 222 231Q228 257 243 274T270 299L281 306Q234 329 222 381Q220 387 220 486V587Q212 597 207 601T173 612T94 618Q66 618 58 627Q49 635 49 655",
        126: "125 467Q113 467 100 480T87 509Q88 520 111 543Q172 602 209 609Q219 611 224 611Q246 611 263 596T290 566T304 551Q319 551 367 594Q383 610 396 610H400Q411 610 424 597T437 568Q436 557 413 534Q348 469 305 466Q278 466 260 481T234 511T220 526Q205 526 157 483Q141 467 129 467H125",
        127: "104 565Q104 590 120 600T155 611Q175 611 180 610Q217 599 217 565Q217 545 202 532T166 519H159H155Q120 519 107 547Q104 553 104 565ZM307 565Q307 580 317 593T346 610Q348 610 350 610T354 611Q355 612 367 612Q395 611 408 597T421 565T409 534T365 519H358Q336 519 322 532T307 565",
        160: "",
        305: "411 76Q441 76 451 69T462 38Q462 29 462 26T460 18T453 9T440 1H94Q72 8 72 33V38Q72 46 72 49T74 58T81 68T94 76H233V355H167L102 356Q80 363 80 393Q80 418 91 425T138 432Q145 432 165 432T200 431H295Q297 429 303 425T310 420T314 415T317 404T317 389T318 363Q318 354 318 314T317 241V76H378H411",
        567: "75 -91T100 -91T138 -107T152 -144V-150L160 -151H193H203Q241 -151 267 -121Q284 -97 288 -73T292 23V151V355H218L145 356Q123 365 123 387V393Q123 422 145 430H148Q151 430 156 430T169 430T185 430T205 431T227 431T251 431H354Q356 430 360 427T365 424T369 420T372 416T373 410T375 402T376 391T377 376T377 356Q377 345 377 286T376 176Q376 -67 371 -88Q362 -123 342 -151T299 -194Q254 -228 180 -228Q84 -226 56 -177Q49 -162 48 -148Q48 -122 61 -107",
        697: "211 572Q211 593 226 608T262 623Q281 623 297 610T313 573Q313 561 307 465Q301 370 299 357T284 336Q279 334 262 334Q240 334 231 343Q226 350 225 362T217 465Q211 549 211 572",
        768: "-409 569Q-409 586 -399 596T-377 610Q-376 610 -372 610T-365 611Q-355 610 -284 588T-210 563Q-195 556 -195 537Q-195 533 -197 522T-208 498T-229 485Q-238 485 -312 508T-388 533Q-400 538 -405 552Q-409 559 -409 569",
        769: "-297 485Q-315 485 -323 505T-331 537Q-331 556 -316 563Q-307 569 -170 610Q-169 610 -165 610T-157 611Q-141 609 -131 600T-119 584T-117 569Q-117 555 -124 545T-138 533Q-140 531 -214 508T-297 485",
        770: "-387 460Q-404 460 -416 479T-429 512Q-429 527 -419 534Q-416 536 -347 571T-272 609Q-269 611 -261 611Q-254 610 -182 574Q-168 567 -156 561T-136 550T-123 543T-114 538T-109 535T-105 532T-103 529T-100 525Q-97 518 -97 512Q-97 498 -109 479T-139 460H-141Q-148 460 -209 496L-263 526L-317 496Q-378 460 -387 460",
        771: "-400 467Q-412 467 -425 480T-438 509Q-437 520 -414 543Q-353 602 -316 609Q-306 611 -301 611Q-279 611 -262 596T-235 566T-221 551Q-206 551 -158 594Q-142 610 -129 610H-125Q-114 610 -101 597T-88 568Q-89 557 -112 534Q-177 469 -220 466Q-247 466 -265 481T-291 511T-305 526Q-320 526 -368 483Q-384 467 -396 467H-400",
        772: "-429 500Q-440 504 -445 511T-450 522T-452 536Q-452 552 -451 556Q-445 571 -434 574T-379 578Q-369 578 -330 578T-261 577H-96Q-94 575 -90 573T-85 569T-81 564T-77 558T-75 550T-74 538Q-74 522 -78 515T-96 500H-429",
        774: "-446 579Q-446 611 -412 611H-407Q-383 609 -378 599T-358 587Q-340 583 -263 583H-235Q-159 583 -152 593Q-145 611 -120 611H-117H-115Q-79 611 -79 577Q-80 552 -95 536T-140 514T-191 506T-251 504H-263H-274Q-311 504 -334 505T-386 513T-431 536T-446 579",
        776: "-421 565Q-421 590 -405 600T-370 611Q-350 611 -345 610Q-308 599 -308 565Q-308 545 -323 532T-359 519H-366H-370Q-405 519 -418 547Q-421 553 -421 565ZM-218 565Q-218 580 -208 593T-179 610Q-177 610 -175 610T-171 611Q-170 612 -158 612Q-130 611 -117 597T-104 565T-116 534T-160 519H-167Q-189 519 -203 532T-218 565",
        778: "-344 558Q-344 583 -321 601T-262 619Q-225 619 -204 600T-182 560Q-182 536 -205 518T-264 499Q-301 499 -322 519T-344 558ZM-223 559Q-223 570 -234 579T-261 588T-289 580T-303 559Q-303 549 -293 540T-263 530T-234 539T-223 559",
        780: "-427 525Q-427 542 -417 559T-392 577Q-385 577 -323 553L-263 530L-203 553Q-143 576 -136 576Q-118 576 -109 559T-99 525Q-99 508 -107 502T-161 481Q-177 475 -186 472Q-256 449 -263 449Q-272 449 -339 472T-412 498Q-420 501 -423 508T-427 520V525",
        913: "191 76Q212 75 220 68T229 38Q229 10 208 1H129H80Q48 1 38 7T28 38Q28 51 29 57T40 69T70 76Q89 76 89 78Q90 79 117 205T173 461T205 599Q212 623 250 623H262H273Q312 623 319 599Q322 591 350 461T406 205T435 78Q435 76 454 76H458Q484 76 493 59Q496 53 496 38Q496 11 478 3Q474 1 395 1H317Q295 8 295 38Q295 65 311 73Q316 75 333 76L348 77V78Q348 80 341 112L334 143H190L183 112Q176 80 176 78Q175 76 178 76Q180 76 191 76ZM318 221Q313 238 288 366T263 519Q263 526 262 527Q261 527 261 520Q261 493 236 365T206 221Q206 219 262 219T318 221",
        914: "39 1Q17 10 17 32V38V46Q17 65 34 73Q40 76 61 76H84V535H61H54Q27 535 19 553Q17 557 17 573Q17 583 17 587T23 599T39 610Q40 611 179 611Q320 610 332 607Q332 607 339 605Q394 591 427 547T461 454Q461 413 436 378T369 325L358 320Q405 311 443 270T482 169Q482 112 445 64T345 3L334 1H39ZM309 533Q302 535 234 535H168V356H230Q284 357 296 358T323 368Q346 380 361 402T377 452Q377 482 358 505T309 533ZM398 176Q396 218 371 246T315 279Q310 280 237 280H168V76H239Q316 77 327 81Q329 82 334 84Q398 107 398 176",
        915: "466 611Q468 609 473 606T479 602T483 598T486 593T487 586T488 576T488 562V526V488Q488 452 470 444Q466 442 446 442Q421 442 413 450Q406 457 405 463T404 501V535H185V76H222H239Q260 76 270 69T281 38Q281 12 270 6T209 0H155H104Q48 0 37 5T25 38Q25 59 35 69Q44 76 76 76H101V535H76H64Q36 535 27 552Q25 557 25 573T27 594Q33 606 43 608T106 611H258H466",
        916: "232 622H237Q242 622 249 622T264 623H293Q295 622 300 619T308 613T314 608T319 601Q322 597 405 316T489 19Q489 9 473 1Q471 0 262 0T51 1Q35 9 35 19Q35 34 118 315T205 601Q214 616 232 622ZM267 501Q266 504 265 510T263 521T261 526V523Q261 508 211 332Q142 91 138 82H386Q385 84 345 224Q281 439 267 501",
        917: "374 271Q374 241 367 232T332 223Q307 223 299 231Q290 240 290 263V279H173V76H418V118V144Q418 167 426 176T460 186Q491 186 500 166Q502 161 502 93V52Q502 25 499 17T480 1H41Q19 9 19 32V38Q19 63 36 73Q42 76 65 76H89V535H65H55Q44 535 38 537T25 548T19 573Q19 602 41 610H47Q53 610 63 610T88 610T121 610T160 611T204 611T251 611H458Q460 609 465 606T471 602T475 598T478 593T479 586T480 576T480 562V526V488Q480 452 462 444Q458 442 438 442Q413 442 405 450Q398 457 397 463T396 501V535H173V355H290V371Q290 394 299 403T332 412Q363 412 372 392Q374 387 374 317V271",
        918: "71 1Q60 5 55 11T49 23T48 39V46Q48 56 58 73T131 183Q171 242 197 282L366 535H144V501Q144 470 143 464T135 450Q127 442 102 442H94Q71 442 62 461Q60 466 60 527L61 589Q70 607 83 610H88Q93 610 102 610T124 610T154 610T188 611T227 611T270 611H454Q456 609 461 606T467 601T471 597T474 591T475 584T476 572V565Q476 555 466 538T393 428Q353 369 327 329L158 76H397V120V146Q397 169 405 179T439 189Q470 189 479 169Q481 164 481 95V48Q481 24 478 16T459 1H71",
        919: "16 571Q16 597 27 604T74 611H125H208Q223 602 226 596T230 573Q230 559 227 551T217 540T204 536T186 535H165V356H359V535H338H333Q306 535 297 552Q295 556 295 573Q295 586 295 590T301 600T317 611H486Q501 602 504 596T508 573Q508 559 505 551T495 540T482 536T464 535H443V76H464H470Q482 76 489 75T502 64T508 38Q508 10 486 1H317Q306 5 301 11T296 21T295 38V44Q295 66 311 73Q318 76 338 76H359V280H165V76H186H192Q204 76 211 75T224 64T230 38Q230 10 208 1H39Q28 5 23 11T18 21T17 38V44Q17 66 33 73Q40 76 60 76H81V535H60Q45 535 38 536T24 545T16 571",
        920: "102 588Q140 621 240 621Q323 621 335 620Q393 613 422 588Q450 560 459 493T468 306Q468 185 460 118T422 23Q382 -10 289 -10H262H235Q142 -10 102 23Q74 50 65 118T56 306Q56 427 64 494T102 588ZM262 66Q285 66 300 67T329 74T351 86T366 108T376 138T381 181T383 235T384 306Q384 452 371 492T304 544Q296 545 251 545Q230 545 215 543T188 534T169 520T155 497T147 466T143 423T141 371T140 306Q140 247 141 215T146 151T158 107T179 82T212 69T262 66ZM179 356Q187 378 219 378H223Q240 377 249 372T260 360L261 355Q261 353 262 353T263 355Q263 362 272 369Q280 377 304 377H310Q325 377 331 374T346 356V256Q338 241 331 238T309 234H304Q280 234 272 242Q263 249 263 256Q263 258 262 258T261 256Q261 249 252 242Q244 234 220 234H216Q186 234 179 256V356",
        921: "400 76Q431 76 441 69T452 38Q452 29 452 26T450 18T443 9T430 1H95Q84 6 79 12T73 23T72 38Q72 65 90 73Q96 76 157 76H220V535H157H124Q93 535 83 542T72 573Q72 603 93 610Q97 611 264 611H430Q432 609 436 607T444 602T449 594Q452 588 452 573Q452 546 434 538Q428 535 367 535H304V76H367H400",
        922: "18 549T18 573T29 604T70 611H118H193Q207 603 210 596T214 573Q214 549 198 538Q191 535 172 535H152V421Q152 344 152 326T153 309L242 422L329 534Q327 535 322 536T314 538T308 542T303 548T300 558T298 573Q298 600 316 608Q322 611 392 611H463Q477 602 481 595T485 573Q485 535 446 535H441H420L281 357L436 77L454 76Q473 75 478 73Q495 62 495 38Q495 10 473 1H345Q334 5 329 11T324 21T323 38Q323 51 324 56T332 68T355 77L233 296L152 192V76H172Q191 76 198 73Q214 63 214 38Q214 9 193 1H41Q18 8 18 38Q18 61 35 73Q42 76 61 76H81V535H61Q42 535 35 538Q18 549 18 573",
        923: "30 38Q30 57 38 66T70 76Q88 76 88 78Q89 79 117 207T173 466T205 602Q213 617 231 622H236Q241 622 249 622T264 623H294Q315 609 319 602Q321 598 350 468T407 208T435 78Q436 76 454 76Q470 76 478 73Q495 62 495 38Q495 10 473 1H313Q290 10 290 38Q290 56 297 65T310 74T331 76Q350 76 350 78Q349 80 328 176T285 383T263 520Q263 526 262 527Q261 527 261 521Q261 497 240 388T198 181T174 78Q174 76 193 76Q220 75 227 65Q234 56 234 38Q234 28 234 24T228 13T212 1H52Q30 9 30 32V38",
        924: "50 535Q37 536 31 537T18 547T12 573Q12 598 22 604T62 611H91H121Q147 611 158 607T178 587Q183 579 222 446T261 293Q261 289 262 288Q263 288 263 292Q263 311 298 434T346 588Q353 603 365 607T402 611H435H450Q488 611 500 605T512 573Q512 556 506 547T493 537T474 535H459V76H474Q487 75 493 74T505 64T512 38Q512 11 494 3Q490 1 424 1H386Q355 1 345 7T335 38Q335 55 341 64T354 74T373 76H388V302Q388 512 387 519Q382 482 346 359T304 228Q292 204 262 204T220 228Q215 237 179 359T137 519Q136 512 136 302V76H151Q164 75 170 74T182 64T189 38Q189 11 171 3Q167 1 101 1H63Q32 1 22 7T12 38Q12 55 18 64T31 74T50 76H65V535H50",
        925: "20 571Q20 598 30 604T73 611H105H136Q152 611 160 611T177 607T189 601T198 587T206 568T217 537T231 497Q354 142 365 95L368 84V535H347H342Q314 535 306 552Q304 556 304 573Q304 586 304 590T310 600T326 611H482Q497 602 500 596T504 573Q504 559 501 551T491 540T478 536T460 535H439V25Q432 7 424 4T389 0H374Q334 0 322 31L293 115Q171 468 159 517L156 528V76H177H183Q195 76 202 75T215 64T221 38Q221 10 199 1H43Q32 5 27 11T22 21T21 38V44Q21 66 37 73Q44 76 64 76H85V535H64Q49 535 42 536T28 545T20 571",
        926: "37 555V569Q37 605 60 610H66Q71 610 81 610T105 610T137 610T175 611T217 611T264 611H465Q467 609 471 606T477 602T481 599T484 594T485 588T487 580T487 570T487 554Q487 526 486 520T478 506Q470 498 445 498T412 506Q403 515 403 531V539H121V531Q121 498 86 498H79H71Q48 498 39 517Q37 522 37 555ZM109 318V346Q109 366 113 374T132 389H170Q193 379 193 359V354H331V359Q331 379 354 389H392Q407 381 411 373T415 342V318V290Q415 270 411 262T392 247H354Q331 257 331 277V282H193V277Q193 257 170 247H132Q117 255 113 263T109 294V318ZM56 1Q41 7 37 15T33 42V58V80Q33 101 41 110T77 119Q87 118 91 118T103 114T114 103T117 83V72H407V83Q407 101 416 110T449 119T482 110Q489 103 490 97T491 59V41Q491 24 487 16T469 1H56",
        927: "102 588Q140 621 240 621Q323 621 335 620Q393 613 422 588Q450 560 459 493T468 306Q468 185 460 118T422 23Q382 -10 289 -10H262H235Q142 -10 102 23Q74 50 65 118T56 306Q56 427 64 494T102 588ZM363 513Q357 523 347 530T324 540T302 544T280 546H268Q192 546 167 521Q150 501 145 452T140 300Q140 235 142 197T151 130T172 89T207 71T262 65Q317 65 341 81T374 144T384 300Q384 474 363 513",
        928: "60 535Q45 535 38 536T24 545T16 571Q16 603 36 609Q41 611 264 611H486Q501 602 504 596T508 573Q508 559 505 551T495 540T482 536T464 535H443V76H464H470Q482 76 489 75T502 64T508 38Q508 10 486 1H317Q306 5 301 11T296 21T295 38V44Q295 66 311 73Q318 76 338 76H359V535H165V76H186H192Q204 76 211 75T224 64T230 38Q230 10 208 1H39Q28 5 23 11T18 21T17 38V44Q17 66 33 73Q40 76 60 76H81V535H60",
        929: "41 1Q19 9 19 32V38Q19 63 36 73Q42 76 65 76H89V535H65H55Q38 535 29 543T19 576Q19 603 41 610H49Q57 610 70 610T100 610T136 611T175 611Q190 611 216 611T255 612Q321 612 363 598T441 537Q480 486 480 427V421Q480 354 447 311T378 251Q339 230 275 230H239H173V76H197Q220 76 227 73Q244 62 244 38Q244 10 222 1H41ZM396 421Q396 461 369 491T300 533Q294 534 233 535H173V306H233Q294 307 300 308Q345 319 370 352T396 421",
        931: "40 575Q40 576 40 579T41 583T41 588T43 593T46 597T50 602T55 606T63 610H68Q74 610 84 610T108 610T139 610T176 611T219 611T264 611H462Q464 609 469 606T475 602T479 598T482 593T483 586T484 576T484 562V526V488Q484 452 466 444Q462 442 442 442Q417 442 409 450Q402 457 401 463T400 501V535H153Q153 533 218 430Q233 405 250 378T276 336T286 319Q290 311 290 307Q290 296 239 211Q229 194 223 184L161 78H400V112Q400 142 401 149T409 163Q418 172 442 172Q473 172 482 152Q484 147 484 86V49Q484 25 481 17T462 1H63Q41 10 41 31Q41 39 43 44Q43 45 81 109T157 238L195 303Q195 307 119 430T41 557T40 575",
        932: "129 38Q129 51 129 55T135 65T151 76H220V535H110V501Q110 470 109 464T101 450Q93 442 68 442H60Q37 442 28 461Q26 466 26 527L27 589Q36 607 49 610H55Q61 610 72 610T97 610T131 610T170 611T215 611T264 611H476Q478 609 483 606T489 602T493 598T496 593T497 586T498 576T498 562V526V488Q498 452 480 444Q476 442 456 442Q431 442 423 450Q416 457 415 463T414 501V535H304V76H374Q389 67 392 61T396 38Q396 10 374 1H151Q140 5 135 11T130 21T129 38",
        933: "38 494Q38 549 74 585T152 621Q168 621 179 619T209 606T241 566T262 492Q262 494 265 507T270 526T276 547T285 569T298 589T315 606T337 617T365 622Q416 622 451 584T486 494Q486 470 469 461Q464 459 445 459H437Q416 459 406 476Q404 479 403 502T393 541T365 558Q350 558 340 548T323 519T312 475T307 419T305 354T304 282Q304 254 304 239V76H358Q372 67 376 60T380 38Q380 10 358 1H167Q145 9 145 32V38Q145 54 148 60T167 76H220V239Q220 256 220 289T220 338T219 383T217 426T214 463T209 497T201 522T189 543T174 555Q168 558 159 558Q139 558 131 541T121 502T118 476Q108 459 84 459H79H71Q38 459 38 494",
        934: "139 573V578Q139 603 161 610H166Q172 610 182 610T204 610T232 611T264 611H364Q379 602 382 595T385 573Q385 544 364 536L334 535H304V441H306Q313 440 325 438T367 426T421 403T464 364T483 306Q483 251 430 216T317 172Q315 172 313 172T308 170H306H304V76H364Q379 67 382 60T385 38Q385 28 385 24T379 12T364 1H161Q139 8 139 33V38Q139 46 139 49T141 58T148 68T161 76H220V170H218Q211 171 199 173T157 185T103 208T60 248T41 306Q41 361 94 396T208 439Q210 439 212 439T216 440L218 441H220V535H190L161 536Q139 543 139 573ZM124 306Q124 286 147 271T194 252L218 247Q220 247 220 306V364H218Q212 364 192 359T148 340T124 306ZM400 305Q400 325 377 340T330 360L306 364Q304 364 304 306Q304 247 306 247Q312 247 332 252T376 271T400 305",
        935: "39 571Q39 597 49 604T93 611H141H218Q233 602 236 595T239 573Q239 538 210 535Q202 535 202 534T215 507T243 454L257 428L307 535H298Q266 538 266 573Q266 584 267 588T273 598T289 611H366H401Q442 611 454 605T466 573Q466 546 448 538Q442 535 421 535H398L299 327Q299 323 362 201L426 77L449 76Q467 76 475 75T489 65T495 38Q495 11 477 3Q473 1 395 1H317Q295 8 295 38Q295 73 325 76L334 77Q333 78 314 117T276 196L257 235L239 196Q221 157 204 118T186 77Q190 76 196 76Q211 74 218 67T227 55T228 38Q228 28 227 24T221 13T206 1H50Q28 9 28 32V38Q28 63 45 73Q51 76 73 76H96L214 324Q215 327 162 431L108 535H85H79Q67 535 60 536T46 546T39 571",
        936: "37 439Q38 451 40 457T52 469T77 475H79Q96 475 107 473T132 456T152 411Q152 409 153 396T154 372V365Q154 291 198 261Q215 251 219 251Q220 251 220 393V535H193L167 536Q145 545 145 567V573Q145 602 167 610Q168 611 264 611H358Q372 602 376 595T380 573Q380 545 358 536L331 535H304V393Q304 251 305 251Q307 251 310 252T323 259T339 272T355 295T367 331Q368 337 370 372Q370 382 371 395T372 411Q376 434 384 448T404 467T425 474T447 475Q461 474 467 473T480 463T487 437Q487 419 481 412Q476 403 459 398Q457 390 453 344T431 263Q415 228 383 205T332 177T306 172H304V76H358Q372 67 376 60T380 38Q380 10 358 1H167Q145 9 145 32V38Q145 54 148 60T167 76H220V172H218Q211 172 192 177T141 205T93 263Q74 298 71 343T67 391L66 398Q47 403 42 411T37 433V439",
        937: "40 404Q40 498 106 560T258 622Q357 622 420 558T484 406Q484 359 469 311T428 205T392 117Q382 84 382 78Q382 76 402 76H421V87Q421 110 431 116T457 123Q474 123 483 114Q490 107 491 100T492 61V42Q492 11 474 3Q470 1 397 1H324Q302 9 302 32V39Q302 104 351 225T400 405Q400 462 361 504T262 546Q200 546 162 504T124 405Q124 346 171 230T223 42V36Q223 11 205 3Q201 1 128 1H55Q39 7 33 23L32 60V80Q32 94 34 102T44 116T68 123Q103 123 103 87V76H123Q142 76 142 78Q142 100 117 156T66 282T40 404",
        8215: "57 -60Q57 -33 86 -25H438Q468 -34 468 -60T438 -95H86Q57 -86 57 -60",
        8242: "211 572Q211 593 226 608T262 623Q281 623 297 610T313 573Q313 561 307 465Q301 370 299 357T284 336Q279 334 262 334Q240 334 231 343Q226 350 225 362T217 465Q211 549 211 572",
        8260: "94 -83Q78 -83 68 -73T58 -48Q58 -44 60 -36Q62 -31 227 314T399 673Q410 694 431 694Q445 694 455 684T466 659Q466 656 464 648Q463 643 298 298T125 -62Q114 -83 94 -83",
        8710: "232 622H237Q242 622 249 622T264 623H293Q295 622 300 619T308 613T314 608T319 601Q322 597 405 316T489 19Q489 9 473 1Q471 0 262 0T51 1Q35 9 35 19Q35 34 118 315T205 601Q214 616 232 622ZM267 501Q266 504 265 510T263 521T261 526V523Q261 508 211 332Q142 91 138 82H386Q385 84 345 224Q281 439 267 501"
      }, {
        8243: "′′",
        8244: "′′′",
        8279: "′′′′"
      });
      return monospace$1;
    }
    var normal$1 = {};
    var normal = {};
    var hasRequiredNormal$1;
    function requireNormal$1() {
      if (hasRequiredNormal$1) return normal;
      hasRequiredNormal$1 = 1;
      Object.defineProperty(normal, "__esModule", { value: true });
      normal.normal = void 0;
      normal.normal = {
        32: [0, 0, 0.25],
        33: [0.716, 0, 0.278],
        34: [0.694, -0.379, 0.5],
        35: [0.694, 0.194, 0.833],
        36: [0.75, 0.056, 0.5],
        37: [0.75, 0.056, 0.833],
        38: [0.716, 0.022, 0.778],
        39: [0.694, -0.379, 0.278],
        40: [0.75, 0.25, 0.389],
        41: [0.75, 0.25, 0.389],
        42: [0.75, -0.32, 0.5],
        43: [0.583, 0.082, 0.778],
        44: [0.121, 0.194, 0.278],
        45: [0.252, -0.179, 0.333],
        46: [0.12, 0, 0.278],
        47: [0.75, 0.25, 0.5],
        48: [0.666, 0.022, 0.5],
        49: [0.666, 0, 0.5],
        50: [0.666, 0, 0.5],
        51: [0.665, 0.022, 0.5],
        52: [0.677, 0, 0.5],
        53: [0.666, 0.022, 0.5],
        54: [0.666, 0.022, 0.5],
        55: [0.676, 0.022, 0.5],
        56: [0.666, 0.022, 0.5],
        57: [0.666, 0.022, 0.5],
        58: [0.43, 0, 0.278],
        59: [0.43, 0.194, 0.278],
        60: [0.54, 0.04, 0.778],
        61: [0.583, 0.082, 0.778],
        62: [0.54, 0.04, 0.778],
        63: [0.705, 0, 0.472],
        64: [0.705, 0.011, 0.778],
        65: [0.716, 0, 0.75],
        66: [0.683, 0, 0.708],
        67: [0.705, 0.021, 0.722],
        68: [0.683, 0, 0.764],
        69: [0.68, 0, 0.681],
        70: [0.68, 0, 0.653],
        71: [0.705, 0.022, 0.785],
        72: [0.683, 0, 0.75],
        73: [0.683, 0, 0.361],
        74: [0.683, 0.022, 0.514],
        75: [0.683, 0, 0.778],
        76: [0.683, 0, 0.625],
        77: [0.683, 0, 0.917],
        78: [0.683, 0, 0.75],
        79: [0.705, 0.022, 0.778],
        80: [0.683, 0, 0.681],
        81: [0.705, 0.193, 0.778],
        82: [0.683, 0.022, 0.736],
        83: [0.705, 0.022, 0.556],
        84: [0.677, 0, 0.722],
        85: [0.683, 0.022, 0.75],
        86: [0.683, 0.022, 0.75],
        87: [0.683, 0.022, 1.028],
        88: [0.683, 0, 0.75],
        89: [0.683, 0, 0.75],
        90: [0.683, 0, 0.611],
        91: [0.75, 0.25, 0.278],
        92: [0.75, 0.25, 0.5],
        93: [0.75, 0.25, 0.278],
        94: [0.694, -0.531, 0.5],
        95: [-0.025, 0.062, 0.5],
        96: [0.699, -0.505, 0.5],
        97: [0.448, 0.011, 0.5],
        98: [0.694, 0.011, 0.556],
        99: [0.448, 0.011, 0.444],
        100: [0.694, 0.011, 0.556],
        101: [0.448, 0.011, 0.444],
        102: [0.705, 0, 0.306, { ic: 0.066 }],
        103: [0.453, 0.206, 0.5],
        104: [0.694, 0, 0.556],
        105: [0.669, 0, 0.278],
        106: [0.669, 0.205, 0.306],
        107: [0.694, 0, 0.528],
        108: [0.694, 0, 0.278],
        109: [0.442, 0, 0.833],
        110: [0.442, 0, 0.556],
        111: [0.448, 0.01, 0.5],
        112: [0.442, 0.194, 0.556],
        113: [0.442, 0.194, 0.528],
        114: [0.442, 0, 0.392],
        115: [0.448, 0.011, 0.394],
        116: [0.615, 0.01, 0.389],
        117: [0.442, 0.011, 0.556],
        118: [0.431, 0.011, 0.528],
        119: [0.431, 0.011, 0.722],
        120: [0.431, 0, 0.528],
        121: [0.431, 0.204, 0.528],
        122: [0.431, 0, 0.444],
        123: [0.75, 0.25, 0.5],
        124: [0.75, 0.249, 0.278],
        125: [0.75, 0.25, 0.5],
        126: [0.318, -0.215, 0.5],
        160: [0, 0, 0.25],
        163: [0.714, 0.011, 0.769],
        165: [0.683, 0, 0.75],
        168: [0.669, -0.554, 0.5],
        172: [0.356, -0.089, 0.667],
        174: [0.709, 0.175, 0.947],
        175: [0.59, -0.544, 0.5],
        176: [0.715, -0.542, 0.5],
        177: [0.666, 0, 0.778],
        180: [0.699, -0.505, 0.5],
        183: [0.31, -0.19, 0.278],
        215: [0.491, -9e-3, 0.778],
        240: [0.749, 0.021, 0.556],
        247: [0.537, 0.036, 0.778],
        305: [0.442, 0, 0.278, { sk: 0.0278 }],
        567: [0.442, 0.205, 0.306, { sk: 0.0833 }],
        697: [0.56, -0.043, 0.275],
        710: [0.694, -0.531, 0.5],
        711: [0.644, -0.513, 0.5],
        713: [0.59, -0.544, 0.5],
        714: [0.699, -0.505, 0.5],
        715: [0.699, -0.505, 0.5],
        728: [0.694, -0.515, 0.5],
        729: [0.669, -0.549, 0.5],
        730: [0.715, -0.542, 0.5],
        732: [0.668, -0.565, 0.5],
        768: [0.699, -0.505, 0],
        769: [0.699, -0.505, 0],
        770: [0.694, -0.531, 0],
        771: [0.668, -0.565, 0],
        772: [0.59, -0.544, 0],
        774: [0.694, -0.515, 0],
        775: [0.669, -0.549, 0],
        776: [0.669, -0.554, 0],
        778: [0.715, -0.542, 0],
        779: [0.701, -0.51, 0],
        780: [0.644, -0.513, 0],
        824: [0.716, 0.215, 0],
        913: [0.716, 0, 0.75],
        914: [0.683, 0, 0.708],
        915: [0.68, 0, 0.625],
        916: [0.716, 0, 0.833],
        917: [0.68, 0, 0.681],
        918: [0.683, 0, 0.611],
        919: [0.683, 0, 0.75],
        920: [0.705, 0.022, 0.778],
        921: [0.683, 0, 0.361],
        922: [0.683, 0, 0.778],
        923: [0.716, 0, 0.694],
        924: [0.683, 0, 0.917],
        925: [0.683, 0, 0.75],
        926: [0.677, 0, 0.667],
        927: [0.705, 0.022, 0.778],
        928: [0.68, 0, 0.75],
        929: [0.683, 0, 0.681],
        931: [0.683, 0, 0.722],
        932: [0.677, 0, 0.722],
        933: [0.705, 0, 0.778],
        934: [0.683, 0, 0.722],
        935: [0.683, 0, 0.75],
        936: [0.683, 0, 0.778],
        937: [0.704, 0, 0.722],
        8192: [0, 0, 0.5],
        8193: [0, 0, 1],
        8194: [0, 0, 0.5],
        8195: [0, 0, 1],
        8196: [0, 0, 0.333],
        8197: [0, 0, 0.25],
        8198: [0, 0, 0.167],
        8201: [0, 0, 0.167],
        8202: [0, 0, 0.1],
        8203: [0, 0, 0],
        8204: [0, 0, 0],
        8211: [0.285, -0.248, 0.5],
        8212: [0.285, -0.248, 1],
        8213: [0.285, -0.248, 1],
        8214: [0.75, 0.25, 0.5],
        8215: [-0.025, 0.062, 0.5],
        8216: [0.694, -0.379, 0.278],
        8217: [0.694, -0.379, 0.278],
        8220: [0.694, -0.379, 0.5],
        8221: [0.694, -0.379, 0.5],
        8224: [0.705, 0.216, 0.444],
        8225: [0.705, 0.205, 0.444],
        8226: [0.444, -0.055, 0.5],
        8230: [0.12, 0, 1.172],
        8242: [0.56, -0.043, 0.275],
        8243: [0.56, 0, 0.55],
        8244: [0.56, 0, 0.825],
        8245: [0.56, -0.043, 0.275],
        8246: [0.56, 0, 0.55],
        8247: [0.56, 0, 0.825],
        8254: [0.59, -0.544, 0.5],
        8260: [0.75, 0.25, 0.5],
        8279: [0.56, 0, 1.1],
        8288: [0, 0, 0],
        8289: [0, 0, 0],
        8290: [0, 0, 0],
        8291: [0, 0, 0],
        8292: [0, 0, 0],
        8407: [0.714, -0.516, 0.5],
        8450: [0.702, 0.019, 0.722],
        8459: [0.717, 0.036, 0.969, { ic: 0.272, sk: 0.333 }],
        8460: [0.666, 0.133, 0.72],
        8461: [0.683, 0, 0.778],
        8462: [0.694, 0.011, 0.576, { sk: -0.0278 }],
        8463: [0.695, 0.013, 0.54, { ic: 0.022 }],
        8464: [0.717, 0.017, 0.809, { ic: 0.137, sk: 0.333 }],
        8465: [0.686, 0.026, 0.554],
        8466: [0.717, 0.017, 0.874, { ic: 0.161, sk: 0.306 }],
        8467: [0.705, 0.02, 0.417, { sk: 0.111 }],
        8469: [0.683, 0.02, 0.722],
        8472: [0.453, 0.216, 0.636, { sk: 0.111 }],
        8473: [0.683, 0, 0.611],
        8474: [0.701, 0.181, 0.778],
        8475: [0.717, 0.017, 0.85, { ic: 0.037, sk: 0.194 }],
        8476: [0.686, 0.026, 0.828],
        8477: [0.683, 0, 0.722],
        8484: [0.683, 0, 0.667],
        8486: [0.704, 0, 0.722],
        8487: [0.684, 0.022, 0.722],
        8488: [0.729, 0.139, 0.602],
        8492: [0.708, 0.028, 0.908, { ic: 0.02, sk: 0.194 }],
        8493: [0.685, 0.024, 0.613],
        8496: [0.707, 8e-3, 0.562, { ic: 0.156, sk: 0.139 }],
        8497: [0.735, 0.036, 0.895, { ic: 0.095, sk: 0.222 }],
        8498: [0.695, 0, 0.556],
        8499: [0.721, 0.05, 1.08, { ic: 0.136, sk: 0.444 }],
        8501: [0.694, 0, 0.611],
        8502: [0.763, 0.021, 0.667, { ic: 0.02 }],
        8503: [0.764, 0.043, 0.444],
        8504: [0.764, 0.043, 0.667],
        8513: [0.705, 0.023, 0.639],
        8592: [0.511, 0.011, 1],
        8593: [0.694, 0.193, 0.5],
        8594: [0.511, 0.011, 1],
        8595: [0.694, 0.194, 0.5],
        8596: [0.511, 0.011, 1],
        8597: [0.772, 0.272, 0.5],
        8598: [0.72, 0.195, 1],
        8599: [0.72, 0.195, 1],
        8600: [0.695, 0.22, 1],
        8601: [0.695, 0.22, 1],
        8602: [0.437, -0.06, 1],
        8603: [0.437, -0.06, 1],
        8606: [0.417, -0.083, 1],
        8608: [0.417, -0.083, 1],
        8610: [0.417, -0.083, 1.111],
        8611: [0.417, -0.083, 1.111],
        8614: [0.511, 0.011, 1],
        8617: [0.511, 0.011, 1.126],
        8618: [0.511, 0.011, 1.126],
        8619: [0.575, 0.041, 1],
        8620: [0.575, 0.041, 1],
        8621: [0.417, -0.083, 1.389],
        8622: [0.437, -0.06, 1],
        8624: [0.722, 0, 0.5],
        8625: [0.722, 0, 0.5],
        8630: [0.461, 0, 1],
        8631: [0.46, 0, 1],
        8634: [0.65, 0.083, 0.778],
        8635: [0.65, 0.083, 0.778],
        8636: [0.511, -0.23, 1],
        8637: [0.27, 0.011, 1],
        8638: [0.694, 0.194, 0.417],
        8639: [0.694, 0.194, 0.417],
        8640: [0.511, -0.23, 1],
        8641: [0.27, 0.011, 1],
        8642: [0.694, 0.194, 0.417],
        8643: [0.694, 0.194, 0.417],
        8644: [0.667, 0, 1],
        8646: [0.667, 0, 1],
        8647: [0.583, 0.083, 1],
        8648: [0.694, 0.193, 0.833],
        8649: [0.583, 0.083, 1],
        8650: [0.694, 0.194, 0.833],
        8651: [0.514, 0.014, 1],
        8652: [0.671, 0.011, 1],
        8653: [0.534, 0.035, 1],
        8654: [0.534, 0.037, 1],
        8655: [0.534, 0.035, 1],
        8656: [0.525, 0.024, 1],
        8657: [0.694, 0.194, 0.611],
        8658: [0.525, 0.024, 1],
        8659: [0.694, 0.194, 0.611],
        8660: [0.526, 0.025, 1],
        8661: [0.772, 0.272, 0.611],
        8666: [0.611, 0.111, 1],
        8667: [0.611, 0.111, 1],
        8669: [0.417, -0.083, 1],
        8672: [0.437, -0.064, 1.334],
        8674: [0.437, -0.064, 1.334],
        8704: [0.694, 0.022, 0.556],
        8705: [0.846, 0.021, 0.5],
        8706: [0.715, 0.022, 0.531, { ic: 0.035, sk: 0.0833 }],
        8707: [0.694, 0, 0.556],
        8708: [0.716, 0.215, 0.556],
        8709: [0.772, 0.078, 0.5],
        8710: [0.716, 0, 0.833],
        8711: [0.683, 0.033, 0.833],
        8712: [0.54, 0.04, 0.667],
        8713: [0.716, 0.215, 0.667],
        8715: [0.54, 0.04, 0.667],
        8716: [0.716, 0.215, 0.667],
        8717: [0.44, 0, 0.429, { ic: 0.027 }],
        8719: [0.75, 0.25, 0.944],
        8720: [0.75, 0.25, 0.944],
        8721: [0.75, 0.25, 1.056],
        8722: [0.583, 0.082, 0.778],
        8723: [0.5, 0.166, 0.778],
        8724: [0.766, 0.093, 0.778],
        8725: [0.75, 0.25, 0.5],
        8726: [0.75, 0.25, 0.5],
        8727: [0.465, -0.035, 0.5],
        8728: [0.444, -0.055, 0.5],
        8729: [0.444, -0.055, 0.5],
        8730: [0.8, 0.2, 0.833, { ic: 0.02 }],
        8733: [0.442, 0.011, 0.778],
        8734: [0.442, 0.011, 1],
        8736: [0.694, 0, 0.722],
        8737: [0.714, 0.02, 0.722],
        8738: [0.551, 0.051, 0.722],
        8739: [0.75, 0.249, 0.278],
        8740: [0.75, 0.252, 0.278, { ic: 0.019 }],
        8741: [0.75, 0.25, 0.5],
        8742: [0.75, 0.25, 0.5, { ic: 0.018 }],
        8743: [0.598, 0.022, 0.667],
        8744: [0.598, 0.022, 0.667],
        8745: [0.598, 0.022, 0.667],
        8746: [0.598, 0.022, 0.667],
        8747: [0.716, 0.216, 0.417, { ic: 0.055 }],
        8748: [0.805, 0.306, 0.819, { ic: 0.138 }],
        8749: [0.805, 0.306, 1.166, { ic: 0.138 }],
        8750: [0.805, 0.306, 0.472, { ic: 0.138 }],
        8756: [0.471, 0.082, 0.667],
        8757: [0.471, 0.082, 0.667],
        8764: [0.367, -0.133, 0.778],
        8765: [0.367, -0.133, 0.778],
        8768: [0.583, 0.083, 0.278],
        8769: [0.467, -0.032, 0.778],
        8770: [0.463, -0.034, 0.778],
        8771: [0.464, -0.036, 0.778],
        8772: [0.716, 0.215, 0.778],
        8773: [0.589, -0.022, 0.778],
        8775: [0.652, 0.155, 0.778],
        8776: [0.483, -0.055, 0.778],
        8777: [0.716, 0.215, 0.778],
        8778: [0.579, 0.039, 0.778],
        8781: [0.484, -0.016, 0.778],
        8782: [0.492, -8e-3, 0.778],
        8783: [0.492, -0.133, 0.778],
        8784: [0.67, -0.133, 0.778],
        8785: [0.609, 0.108, 0.778],
        8786: [0.601, 0.101, 0.778],
        8787: [0.601, 0.102, 0.778],
        8790: [0.367, -0.133, 0.778],
        8791: [0.721, -0.133, 0.778],
        8796: [0.859, -0.133, 0.778],
        8800: [0.716, 0.215, 0.778],
        8801: [0.464, -0.036, 0.778],
        8802: [0.716, 0.215, 0.778],
        8804: [0.636, 0.138, 0.778],
        8805: [0.636, 0.138, 0.778],
        8806: [0.753, 0.175, 0.778],
        8807: [0.753, 0.175, 0.778],
        8808: [0.752, 0.286, 0.778],
        8809: [0.752, 0.286, 0.778],
        8810: [0.568, 0.067, 1],
        8811: [0.567, 0.067, 1],
        8812: [0.75, 0.25, 0.5],
        8813: [0.716, 0.215, 0.778],
        8814: [0.708, 0.209, 0.778],
        8815: [0.708, 0.209, 0.778],
        8816: [0.801, 0.303, 0.778],
        8817: [0.801, 0.303, 0.778],
        8818: [0.732, 0.228, 0.778],
        8819: [0.732, 0.228, 0.778],
        8820: [0.732, 0.228, 0.778],
        8821: [0.732, 0.228, 0.778],
        8822: [0.681, 0.253, 0.778],
        8823: [0.681, 0.253, 0.778],
        8824: [0.716, 0.253, 0.778],
        8825: [0.716, 0.253, 0.778],
        8826: [0.539, 0.041, 0.778],
        8827: [0.539, 0.041, 0.778],
        8828: [0.58, 0.153, 0.778],
        8829: [0.58, 0.154, 0.778],
        8830: [0.732, 0.228, 0.778],
        8831: [0.732, 0.228, 0.778],
        8832: [0.705, 0.208, 0.778],
        8833: [0.705, 0.208, 0.778],
        8834: [0.54, 0.04, 0.778],
        8835: [0.54, 0.04, 0.778],
        8836: [0.716, 0.215, 0.778],
        8837: [0.716, 0.215, 0.778],
        8838: [0.636, 0.138, 0.778],
        8839: [0.636, 0.138, 0.778],
        8840: [0.801, 0.303, 0.778],
        8841: [0.801, 0.303, 0.778],
        8842: [0.635, 0.241, 0.778],
        8843: [0.635, 0.241, 0.778],
        8846: [0.598, 0.022, 0.667],
        8847: [0.539, 0.041, 0.778],
        8848: [0.539, 0.041, 0.778],
        8849: [0.636, 0.138, 0.778],
        8850: [0.636, 0.138, 0.778],
        8851: [0.598, 0, 0.667],
        8852: [0.598, 0, 0.667],
        8853: [0.583, 0.083, 0.778],
        8854: [0.583, 0.083, 0.778],
        8855: [0.583, 0.083, 0.778],
        8856: [0.583, 0.083, 0.778],
        8857: [0.583, 0.083, 0.778],
        8858: [0.582, 0.082, 0.778],
        8859: [0.582, 0.082, 0.778],
        8861: [0.582, 0.082, 0.778],
        8862: [0.689, 0, 0.778],
        8863: [0.689, 0, 0.778],
        8864: [0.689, 0, 0.778],
        8865: [0.689, 0, 0.778],
        8866: [0.694, 0, 0.611],
        8867: [0.694, 0, 0.611],
        8868: [0.668, 0, 0.778],
        8869: [0.668, 0, 0.778],
        8872: [0.75, 0.249, 0.867],
        8873: [0.694, 0, 0.722],
        8874: [0.694, 0, 0.889],
        8876: [0.695, 0, 0.611],
        8877: [0.695, 0, 0.611],
        8878: [0.695, 0, 0.722],
        8879: [0.695, 0, 0.722],
        8882: [0.539, 0.041, 0.778],
        8883: [0.539, 0.041, 0.778],
        8884: [0.636, 0.138, 0.778],
        8885: [0.636, 0.138, 0.778],
        8888: [0.408, -0.092, 1.111],
        8890: [0.431, 0.212, 0.556],
        8891: [0.716, 0, 0.611],
        8892: [0.716, 0, 0.611],
        8896: [0.75, 0.249, 0.833],
        8897: [0.75, 0.249, 0.833],
        8898: [0.75, 0.249, 0.833],
        8899: [0.75, 0.249, 0.833],
        8900: [0.488, -0.012, 0.5],
        8901: [0.31, -0.19, 0.278],
        8902: [0.486, -0.016, 0.5],
        8903: [0.545, 0.044, 0.778],
        8904: [0.505, 5e-3, 0.9],
        8905: [0.492, -8e-3, 0.778],
        8906: [0.492, -8e-3, 0.778],
        8907: [0.694, 0.022, 0.778],
        8908: [0.694, 0.022, 0.778],
        8909: [0.464, -0.036, 0.778],
        8910: [0.578, 0.021, 0.76],
        8911: [0.578, 0.022, 0.76],
        8912: [0.54, 0.04, 0.778],
        8913: [0.54, 0.04, 0.778],
        8914: [0.598, 0.022, 0.667],
        8915: [0.598, 0.022, 0.667],
        8916: [0.736, 0.022, 0.667],
        8918: [0.541, 0.041, 0.778],
        8919: [0.541, 0.041, 0.778],
        8920: [0.568, 0.067, 1.333],
        8921: [0.568, 0.067, 1.333],
        8922: [0.886, 0.386, 0.778],
        8923: [0.886, 0.386, 0.778],
        8926: [0.734, 0, 0.778],
        8927: [0.734, 0, 0.778],
        8928: [0.801, 0.303, 0.778],
        8929: [0.801, 0.303, 0.778],
        8930: [0.716, 0.215, 0.778],
        8931: [0.716, 0.215, 0.778],
        8934: [0.73, 0.359, 0.778],
        8935: [0.73, 0.359, 0.778],
        8936: [0.73, 0.359, 0.778],
        8937: [0.73, 0.359, 0.778],
        8938: [0.706, 0.208, 0.778],
        8939: [0.706, 0.208, 0.778],
        8940: [0.802, 0.303, 0.778],
        8941: [0.801, 0.303, 0.778],
        8942: [1.3, 0.03, 0.278],
        8943: [0.31, -0.19, 1.172],
        8945: [1.52, -0.1, 1.282],
        8965: [0.716, 0, 0.611],
        8966: [0.813, 0.097, 0.611],
        8968: [0.75, 0.25, 0.444],
        8969: [0.75, 0.25, 0.444],
        8970: [0.75, 0.25, 0.444],
        8971: [0.75, 0.25, 0.444],
        8988: [0.694, -0.306, 0.5],
        8989: [0.694, -0.306, 0.5],
        8990: [0.366, 0.022, 0.5],
        8991: [0.366, 0.022, 0.5],
        8994: [0.388, -0.122, 1],
        8995: [0.378, -0.134, 1],
        9001: [0.75, 0.25, 0.389],
        9002: [0.75, 0.25, 0.389],
        9136: [0.744, 0.244, 0.412],
        9137: [0.744, 0.244, 0.412],
        9168: [0.602, 0, 0.667],
        9416: [0.709, 0.175, 0.902],
        9484: [0.694, -0.306, 0.5],
        9488: [0.694, -0.306, 0.5],
        9492: [0.366, 0.022, 0.5],
        9496: [0.366, 0.022, 0.5],
        9585: [0.694, 0.195, 0.889],
        9586: [0.694, 0.195, 0.889],
        9632: [0.689, 0, 0.778],
        9633: [0.689, 0, 0.778],
        9642: [0.689, 0, 0.778],
        9650: [0.575, 0.02, 0.722],
        9651: [0.716, 0, 0.889],
        9652: [0.575, 0.02, 0.722],
        9653: [0.716, 0, 0.889],
        9654: [0.539, 0.041, 0.778],
        9656: [0.539, 0.041, 0.778],
        9657: [0.505, 5e-3, 0.5],
        9660: [0.576, 0.019, 0.722],
        9661: [0.5, 0.215, 0.889],
        9662: [0.576, 0.019, 0.722],
        9663: [0.5, 0.215, 0.889],
        9664: [0.539, 0.041, 0.778],
        9666: [0.539, 0.041, 0.778],
        9667: [0.505, 5e-3, 0.5],
        9674: [0.716, 0.132, 0.667],
        9711: [0.715, 0.215, 1],
        9723: [0.689, 0, 0.778],
        9724: [0.689, 0, 0.778],
        9733: [0.694, 0.111, 0.944],
        9824: [0.727, 0.13, 0.778],
        9825: [0.716, 0.033, 0.778],
        9826: [0.727, 0.162, 0.778],
        9827: [0.726, 0.13, 0.778],
        9837: [0.75, 0.022, 0.389],
        9838: [0.734, 0.223, 0.389],
        9839: [0.723, 0.223, 0.389],
        10003: [0.706, 0.034, 0.833],
        10016: [0.716, 0.022, 0.833],
        10072: [0.75, 0.249, 0.278],
        10216: [0.75, 0.25, 0.389],
        10217: [0.75, 0.25, 0.389],
        10222: [0.744, 0.244, 0.412],
        10223: [0.744, 0.244, 0.412],
        10229: [0.511, 0.011, 1.609],
        10230: [0.511, 0.011, 1.638],
        10231: [0.511, 0.011, 1.859],
        10232: [0.525, 0.024, 1.609],
        10233: [0.525, 0.024, 1.638],
        10234: [0.525, 0.024, 1.858],
        10236: [0.511, 0.011, 1.638],
        10731: [0.716, 0.132, 0.667],
        10744: [0.716, 0.215, 0.778],
        10752: [0.75, 0.25, 1.111],
        10753: [0.75, 0.25, 1.111],
        10754: [0.75, 0.25, 1.111],
        10756: [0.75, 0.249, 0.833],
        10758: [0.75, 0.249, 0.833],
        10764: [0.805, 0.306, 1.638, { ic: 0.138 }],
        10799: [0.491, -9e-3, 0.778],
        10815: [0.683, 0, 0.75],
        10846: [0.813, 0.097, 0.611],
        10877: [0.636, 0.138, 0.778],
        10878: [0.636, 0.138, 0.778],
        10885: [0.762, 0.29, 0.778],
        10886: [0.762, 0.29, 0.778],
        10887: [0.635, 0.241, 0.778],
        10888: [0.635, 0.241, 0.778],
        10889: [0.761, 0.387, 0.778],
        10890: [0.761, 0.387, 0.778],
        10891: [1.003, 0.463, 0.778],
        10892: [1.003, 0.463, 0.778],
        10901: [0.636, 0.138, 0.778],
        10902: [0.636, 0.138, 0.778],
        10927: [0.636, 0.138, 0.778],
        10928: [0.636, 0.138, 0.778],
        10933: [0.752, 0.286, 0.778],
        10934: [0.752, 0.286, 0.778],
        10935: [0.761, 0.294, 0.778],
        10936: [0.761, 0.294, 0.778],
        10937: [0.761, 0.337, 0.778],
        10938: [0.761, 0.337, 0.778],
        10949: [0.753, 0.215, 0.778],
        10950: [0.753, 0.215, 0.778],
        10955: [0.783, 0.385, 0.778],
        10956: [0.783, 0.385, 0.778],
        12296: [0.75, 0.25, 0.389],
        12297: [0.75, 0.25, 0.389],
        57350: [0.43, 0.023, 0.222, { ic: 0.018 }],
        57351: [0.431, 0.024, 0.389, { ic: 0.018 }],
        57352: [0.605, 0.085, 0.778],
        57353: [0.434, 6e-3, 0.667, { ic: 0.067 }],
        57356: [0.752, 0.284, 0.778],
        57357: [0.752, 0.284, 0.778],
        57358: [0.919, 0.421, 0.778],
        57359: [0.801, 0.303, 0.778],
        57360: [0.801, 0.303, 0.778],
        57361: [0.919, 0.421, 0.778],
        57366: [0.828, 0.33, 0.778],
        57367: [0.752, 0.332, 0.778],
        57368: [0.828, 0.33, 0.778],
        57369: [0.752, 0.333, 0.778],
        57370: [0.634, 0.255, 0.778],
        57371: [0.634, 0.254, 0.778],
        119808: [0.698, 0, 0.869],
        119809: [0.686, 0, 0.818],
        119810: [0.697, 0.011, 0.831],
        119811: [0.686, 0, 0.882],
        119812: [0.68, 0, 0.756],
        119813: [0.68, 0, 0.724],
        119814: [0.697, 0.01, 0.904],
        119815: [0.686, 0, 0.9],
        119816: [0.686, 0, 0.436],
        119817: [0.686, 0.011, 0.594],
        119818: [0.686, 0, 0.901],
        119819: [0.686, 0, 0.692],
        119820: [0.686, 0, 1.092],
        119821: [0.686, 0, 0.9],
        119822: [0.696, 0.01, 0.864],
        119823: [0.686, 0, 0.786],
        119824: [0.696, 0.193, 0.864],
        119825: [0.686, 0.011, 0.862],
        119826: [0.697, 0.011, 0.639],
        119827: [0.675, 0, 0.8],
        119828: [0.686, 0.011, 0.885],
        119829: [0.686, 7e-3, 0.869],
        119830: [0.686, 7e-3, 1.189],
        119831: [0.686, 0, 0.869],
        119832: [0.686, 0, 0.869],
        119833: [0.686, 0, 0.703],
        119834: [0.453, 6e-3, 0.559],
        119835: [0.694, 6e-3, 0.639],
        119836: [0.453, 6e-3, 0.511],
        119837: [0.694, 6e-3, 0.639],
        119838: [0.452, 6e-3, 0.527],
        119839: [0.7, 0, 0.351, { ic: 0.101 }],
        119840: [0.455, 0.201, 0.575],
        119841: [0.694, 0, 0.639],
        119842: [0.695, 0, 0.319],
        119843: [0.695, 0.2, 0.351],
        119844: [0.694, 0, 0.607],
        119845: [0.694, 0, 0.319],
        119846: [0.45, 0, 0.958],
        119847: [0.45, 0, 0.639],
        119848: [0.452, 5e-3, 0.575],
        119849: [0.45, 0.194, 0.639],
        119850: [0.45, 0.194, 0.607],
        119851: [0.45, 0, 0.474],
        119852: [0.453, 6e-3, 0.454],
        119853: [0.635, 5e-3, 0.447],
        119854: [0.45, 6e-3, 0.639],
        119855: [0.444, 0, 0.607],
        119856: [0.444, 0, 0.831],
        119857: [0.444, 0, 0.607],
        119858: [0.444, 0.2, 0.607],
        119859: [0.444, 0, 0.511],
        119860: [0.716, 0, 0.75, { sk: 0.139 }],
        119861: [0.683, 0, 0.759, { sk: 0.0833 }],
        119862: [0.705, 0.022, 0.715, { ic: 0.045, sk: 0.0833 }],
        119863: [0.683, 0, 0.828, { sk: 0.0556 }],
        119864: [0.68, 0, 0.738, { ic: 0.026, sk: 0.0833 }],
        119865: [0.68, 0, 0.643, { ic: 0.106, sk: 0.0833 }],
        119866: [0.705, 0.022, 0.786, { sk: 0.0833 }],
        119867: [0.683, 0, 0.831, { ic: 0.057, sk: 0.0556 }],
        119868: [0.683, 0, 0.44, { ic: 0.064, sk: 0.111 }],
        119869: [0.683, 0.022, 0.555, { ic: 0.078, sk: 0.167 }],
        119870: [0.683, 0, 0.849, { ic: 0.04, sk: 0.0556 }],
        119871: [0.683, 0, 0.681, { sk: 0.0278 }],
        119872: [0.683, 0, 0.97, { ic: 0.081, sk: 0.0833 }],
        119873: [0.683, 0, 0.803, { ic: 0.085, sk: 0.0833 }],
        119874: [0.704, 0.022, 0.763, { sk: 0.0833 }],
        119875: [0.683, 0, 0.642, { ic: 0.109, sk: 0.0833 }],
        119876: [0.704, 0.194, 0.791, { sk: 0.0833 }],
        119877: [0.683, 0.021, 0.759, { sk: 0.0833 }],
        119878: [0.705, 0.022, 0.613, { ic: 0.032, sk: 0.0833 }],
        119879: [0.677, 0, 0.584, { ic: 0.12, sk: 0.0833 }],
        119880: [0.683, 0.022, 0.683, { ic: 0.084, sk: 0.0278 }],
        119881: [0.683, 0.022, 0.583, { ic: 0.186 }],
        119882: [0.683, 0.022, 0.944, { ic: 0.104 }],
        119883: [0.683, 0, 0.828, { ic: 0.024, sk: 0.0833 }],
        119884: [0.683, 0, 0.581, { ic: 0.182 }],
        119885: [0.683, 0, 0.683, { ic: 0.04, sk: 0.0833 }],
        119886: [0.441, 0.01, 0.529],
        119887: [0.694, 0.011, 0.429],
        119888: [0.442, 0.011, 0.433, { sk: 0.0556 }],
        119889: [0.694, 0.01, 0.52, { sk: 0.167 }],
        119890: [0.442, 0.011, 0.466, { sk: 0.0556 }],
        119891: [0.705, 0.205, 0.49, { ic: 0.06, sk: 0.167 }],
        119892: [0.442, 0.205, 0.477, { sk: 0.0278 }],
        119894: [0.661, 0.011, 0.345],
        119895: [0.661, 0.204, 0.412],
        119896: [0.694, 0.011, 0.521],
        119897: [0.694, 0.011, 0.298, { sk: 0.0833 }],
        119898: [0.442, 0.011, 0.878],
        119899: [0.442, 0.011, 0.6],
        119900: [0.441, 0.011, 0.485, { sk: 0.0556 }],
        119901: [0.442, 0.194, 0.503, { sk: 0.0833 }],
        119902: [0.442, 0.194, 0.446, { ic: 0.014, sk: 0.0833 }],
        119903: [0.442, 0.011, 0.451, { sk: 0.0556 }],
        119904: [0.442, 0.01, 0.469, { sk: 0.0556 }],
        119905: [0.626, 0.011, 0.361, { sk: 0.0833 }],
        119906: [0.442, 0.011, 0.572, { sk: 0.0278 }],
        119907: [0.443, 0.011, 0.485, { sk: 0.0278 }],
        119908: [0.443, 0.011, 0.716, { sk: 0.0833 }],
        119909: [0.442, 0.011, 0.572, { sk: 0.0278 }],
        119910: [0.442, 0.205, 0.49, { sk: 0.0556 }],
        119911: [0.442, 0.011, 0.465, { sk: 0.0556 }],
        119912: [0.711, 0, 0.869, { sk: 0.16 }],
        119913: [0.686, 0, 0.866, { sk: 0.0958 }],
        119914: [0.703, 0.017, 0.817, { ic: 0.038, sk: 0.0958 }],
        119915: [0.686, 0, 0.938, { sk: 0.0639 }],
        119916: [0.68, 0, 0.81, { ic: 0.015, sk: 0.0958 }],
        119917: [0.68, 0, 0.689, { ic: 0.12, sk: 0.0958 }],
        119918: [0.703, 0.016, 0.887, { sk: 0.0958 }],
        119919: [0.686, 0, 0.982, { ic: 0.045, sk: 0.0639 }],
        119920: [0.686, 0, 0.511, { ic: 0.062, sk: 0.128 }],
        119921: [0.686, 0.017, 0.631, { ic: 0.063, sk: 0.192 }],
        119922: [0.686, 0, 0.971, { ic: 0.032, sk: 0.0639 }],
        119923: [0.686, 0, 0.756, { sk: 0.0319 }],
        119924: [0.686, 0, 1.142, { ic: 0.077, sk: 0.0958 }],
        119925: [0.686, 0, 0.95, { ic: 0.077, sk: 0.0958 }],
        119926: [0.703, 0.017, 0.837, { sk: 0.0958 }],
        119927: [0.686, 0, 0.723, { ic: 0.124, sk: 0.0958 }],
        119928: [0.703, 0.194, 0.869, { sk: 0.0958 }],
        119929: [0.686, 0.017, 0.872, { sk: 0.0958 }],
        119930: [0.703, 0.017, 0.693, { ic: 0.021, sk: 0.0958 }],
        119931: [0.675, 0, 0.637, { ic: 0.135, sk: 0.0958 }],
        119932: [0.686, 0.016, 0.8, { ic: 0.077, sk: 0.0319 }],
        119933: [0.686, 0.016, 0.678, { ic: 0.208 }],
        119934: [0.686, 0.017, 1.093, { ic: 0.114 }],
        119935: [0.686, 0, 0.947, { sk: 0.0958 }],
        119936: [0.686, 0, 0.675, { ic: 0.201 }],
        119937: [0.686, 0, 0.773, { ic: 0.032, sk: 0.0958 }],
        119938: [0.452, 8e-3, 0.633],
        119939: [0.694, 8e-3, 0.521],
        119940: [0.451, 8e-3, 0.513, { sk: 0.0639 }],
        119941: [0.694, 8e-3, 0.61, { sk: 0.192 }],
        119942: [0.452, 8e-3, 0.554, { sk: 0.0639 }],
        119943: [0.701, 0.201, 0.568, { ic: 0.056, sk: 0.192 }],
        119944: [0.452, 0.202, 0.545, { sk: 0.0319 }],
        119945: [0.694, 8e-3, 0.668, { sk: -0.0319 }],
        119946: [0.694, 8e-3, 0.405],
        119947: [0.694, 0.202, 0.471],
        119948: [0.694, 8e-3, 0.604],
        119949: [0.694, 8e-3, 0.348, { sk: 0.0958 }],
        119950: [0.452, 8e-3, 1.032],
        119951: [0.452, 8e-3, 0.713],
        119952: [0.452, 8e-3, 0.585, { sk: 0.0639 }],
        119953: [0.452, 0.194, 0.601, { sk: 0.0958 }],
        119954: [0.452, 0.194, 0.542, { sk: 0.0958 }],
        119955: [0.452, 8e-3, 0.529, { sk: 0.0639 }],
        119956: [0.451, 8e-3, 0.531, { sk: 0.0639 }],
        119957: [0.643, 7e-3, 0.415, { sk: 0.0958 }],
        119958: [0.452, 8e-3, 0.681, { sk: 0.0319 }],
        119959: [0.453, 8e-3, 0.567, { sk: 0.0319 }],
        119960: [0.453, 8e-3, 0.831, { sk: 0.0958 }],
        119961: [0.452, 8e-3, 0.659, { sk: 0.0319 }],
        119962: [0.452, 0.202, 0.59, { sk: 0.0639 }],
        119963: [0.452, 8e-3, 0.555, { sk: 0.0639 }],
        119964: [0.717, 8e-3, 0.803, { ic: 0.213, sk: 0.389 }],
        119966: [0.728, 0.026, 0.666, { ic: 0.153, sk: 0.278 }],
        119967: [0.708, 0.031, 0.774, { ic: 0.081, sk: 0.111 }],
        119970: [0.717, 0.037, 0.61, { ic: 0.128, sk: 0.25 }],
        119973: [0.717, 0.314, 1.052, { ic: 0.081, sk: 0.417 }],
        119974: [0.717, 0.037, 0.914, { ic: 0.29, sk: 0.361 }],
        119977: [0.726, 0.036, 0.902, { ic: 0.306, sk: 0.389 }],
        119978: [0.707, 8e-3, 0.738, { ic: 0.067, sk: 0.167 }],
        119979: [0.716, 0.037, 1.013, { ic: 0.018, sk: 0.222 }],
        119980: [0.717, 0.017, 0.883, { sk: 0.278 }],
        119982: [0.708, 0.036, 0.868, { ic: 0.148, sk: 0.333 }],
        119983: [0.735, 0.037, 0.747, { ic: 0.249, sk: 0.222 }],
        119984: [0.717, 0.017, 0.8, { ic: 0.16, sk: 0.25 }],
        119985: [0.717, 0.017, 0.622, { ic: 0.228, sk: 0.222 }],
        119986: [0.717, 0.017, 0.805, { ic: 0.221, sk: 0.25 }],
        119987: [0.717, 0.017, 0.944, { ic: 0.187, sk: 0.278 }],
        119988: [0.716, 0.017, 0.71, { ic: 0.249, sk: 0.194 }],
        119989: [0.717, 0.016, 0.821, { ic: 0.211, sk: 0.306 }],
        120068: [0.696, 0.026, 0.718],
        120069: [0.691, 0.027, 0.884],
        120071: [0.685, 0.027, 0.832],
        120072: [0.685, 0.024, 0.663],
        120073: [0.686, 0.153, 0.611],
        120074: [0.69, 0.026, 0.785],
        120077: [0.686, 0.139, 0.552],
        120078: [0.68, 0.027, 0.668, { ic: 0.014 }],
        120079: [0.686, 0.026, 0.666],
        120080: [0.692, 0.027, 1.05],
        120081: [0.686, 0.025, 0.832],
        120082: [0.729, 0.027, 0.827],
        120083: [0.692, 0.218, 0.828],
        120084: [0.729, 0.069, 0.827],
        120086: [0.692, 0.027, 0.829],
        120087: [0.701, 0.027, 0.669],
        120088: [0.697, 0.027, 0.646, { ic: 0.019 }],
        120089: [0.686, 0.026, 0.831],
        120090: [0.686, 0.027, 1.046],
        120091: [0.688, 0.027, 0.719],
        120092: [0.686, 0.218, 0.833],
        120094: [0.47, 0.035, 0.5],
        120095: [0.685, 0.031, 0.513],
        120096: [0.466, 0.029, 0.389],
        120097: [0.609, 0.033, 0.499],
        120098: [0.467, 0.03, 0.401],
        120099: [0.681, 0.221, 0.326],
        120100: [0.47, 0.209, 0.504],
        120101: [0.688, 0.205, 0.521],
        120102: [0.673, 0.02, 0.279],
        120103: [0.672, 0.208, 0.281],
        120104: [0.689, 0.025, 0.389],
        120105: [0.685, 0.02, 0.28],
        120106: [0.475, 0.026, 0.767],
        120107: [0.475, 0.022, 0.527],
        120108: [0.48, 0.028, 0.489],
        120109: [0.541, 0.212, 0.5],
        120110: [0.479, 0.219, 0.489],
        120111: [0.474, 0.021, 0.389],
        120112: [0.478, 0.029, 0.443],
        120113: [0.64, 0.02, 0.333, { ic: 0.015 }],
        120114: [0.474, 0.023, 0.517],
        120115: [0.53, 0.028, 0.512],
        120116: [0.532, 0.028, 0.774],
        120117: [0.472, 0.188, 0.389],
        120118: [0.528, 0.218, 0.499],
        120119: [0.471, 0.214, 0.391],
        120120: [0.701, 0, 0.722],
        120121: [0.683, 0, 0.667],
        120123: [0.683, 0, 0.722],
        120124: [0.683, 0, 0.667],
        120125: [0.683, 0, 0.611],
        120126: [0.702, 0.019, 0.778],
        120128: [0.683, 0, 0.389],
        120129: [0.683, 0.077, 0.5],
        120130: [0.683, 0, 0.778],
        120131: [0.683, 0, 0.667],
        120132: [0.683, 0, 0.944],
        120134: [0.701, 0.019, 0.778],
        120138: [0.702, 0.012, 0.556],
        120139: [0.683, 0, 0.667],
        120140: [0.683, 0.019, 0.722],
        120141: [0.683, 0.02, 0.722],
        120142: [0.683, 0.019, 1],
        120143: [0.683, 0, 0.722],
        120144: [0.683, 0, 0.722],
        120172: [0.686, 0.031, 0.847],
        120173: [0.684, 0.031, 1.044],
        120174: [0.676, 0.032, 0.723],
        120175: [0.683, 0.029, 0.982],
        120176: [0.686, 0.029, 0.783],
        120177: [0.684, 0.146, 0.722],
        120178: [0.687, 0.029, 0.927],
        120179: [0.683, 0.126, 0.851],
        120180: [0.681, 0.025, 0.655],
        120181: [0.68, 0.141, 0.652],
        120182: [0.681, 0.026, 0.789, { ic: 0.017 }],
        120183: [0.683, 0.028, 0.786],
        120184: [0.683, 0.032, 1.239],
        120185: [0.679, 0.03, 0.983],
        120186: [0.726, 0.03, 0.976],
        120187: [0.688, 0.223, 0.977],
        120188: [0.726, 0.083, 0.976],
        120189: [0.688, 0.028, 0.978],
        120190: [0.685, 0.031, 0.978],
        120191: [0.686, 0.03, 0.79, { ic: 0.012 }],
        120192: [0.688, 0.039, 0.851, { ic: 0.02 }],
        120193: [0.685, 0.029, 0.982],
        120194: [0.683, 0.03, 1.235],
        120195: [0.681, 0.035, 0.849],
        120196: [0.688, 0.214, 0.984],
        120197: [0.677, 0.148, 0.711],
        120198: [0.472, 0.032, 0.603],
        120199: [0.69, 0.032, 0.59],
        120200: [0.473, 0.026, 0.464],
        120201: [0.632, 0.028, 0.589],
        120202: [0.471, 0.027, 0.472],
        120203: [0.687, 0.222, 0.388],
        120204: [0.472, 0.208, 0.595],
        120205: [0.687, 0.207, 0.615],
        120206: [0.686, 0.025, 0.331],
        120207: [0.682, 0.203, 0.332],
        120208: [0.682, 0.025, 0.464],
        120209: [0.681, 0.024, 0.337],
        120210: [0.476, 0.031, 0.921],
        120211: [0.473, 0.028, 0.654],
        120212: [0.482, 0.034, 0.609],
        120213: [0.557, 0.207, 0.604],
        120214: [0.485, 0.211, 0.596],
        120215: [0.472, 0.026, 0.46],
        120216: [0.479, 0.034, 0.523],
        120217: [0.648, 0.027, 0.393, { ic: 0.014 }],
        120218: [0.472, 0.032, 0.589, { ic: 0.014 }],
        120219: [0.546, 0.027, 0.604],
        120220: [0.549, 0.032, 0.918],
        120221: [0.471, 0.188, 0.459],
        120222: [0.557, 0.221, 0.589],
        120223: [0.471, 0.214, 0.461],
        120224: [0.694, 0, 0.667],
        120225: [0.694, 0, 0.667],
        120226: [0.705, 0.011, 0.639],
        120227: [0.694, 0, 0.722],
        120228: [0.691, 0, 0.597],
        120229: [0.691, 0, 0.569],
        120230: [0.704, 0.011, 0.667],
        120231: [0.694, 0, 0.708],
        120232: [0.694, 0, 0.278],
        120233: [0.694, 0.022, 0.472],
        120234: [0.694, 0, 0.694],
        120235: [0.694, 0, 0.542],
        120236: [0.694, 0, 0.875],
        120237: [0.694, 0, 0.708],
        120238: [0.715, 0.022, 0.736],
        120239: [0.694, 0, 0.639],
        120240: [0.715, 0.125, 0.736],
        120241: [0.694, 0, 0.646],
        120242: [0.716, 0.022, 0.556],
        120243: [0.688, 0, 0.681],
        120244: [0.694, 0.022, 0.688],
        120245: [0.694, 0, 0.667],
        120246: [0.694, 0, 0.944],
        120247: [0.694, 0, 0.667],
        120248: [0.694, 0, 0.667],
        120249: [0.694, 0, 0.611],
        120250: [0.46, 0.01, 0.481],
        120251: [0.694, 0.011, 0.517],
        120252: [0.46, 0.01, 0.444],
        120253: [0.694, 0.01, 0.517],
        120254: [0.461, 0.01, 0.444],
        120255: [0.705, 0, 0.306, { ic: 0.041 }],
        120256: [0.455, 0.206, 0.5],
        120257: [0.694, 0, 0.517],
        120258: [0.68, 0, 0.239],
        120259: [0.68, 0.205, 0.267],
        120260: [0.694, 0, 0.489],
        120261: [0.694, 0, 0.239],
        120262: [0.455, 0, 0.794],
        120263: [0.455, 0, 0.517],
        120264: [0.46, 0.01, 0.5],
        120265: [0.455, 0.194, 0.517],
        120266: [0.455, 0.194, 0.517],
        120267: [0.455, 0, 0.342],
        120268: [0.46, 0.01, 0.383],
        120269: [0.571, 0.01, 0.361],
        120270: [0.444, 0.01, 0.517],
        120271: [0.444, 0, 0.461],
        120272: [0.444, 0, 0.683],
        120273: [0.444, 0, 0.461],
        120274: [0.444, 0.204, 0.461],
        120275: [0.444, 0, 0.435],
        120276: [0.694, 0, 0.733],
        120277: [0.694, 0, 0.733],
        120278: [0.704, 0.011, 0.703],
        120279: [0.694, 0, 0.794],
        120280: [0.691, 0, 0.642],
        120281: [0.691, 0, 0.611],
        120282: [0.705, 0.011, 0.733],
        120283: [0.694, 0, 0.794],
        120284: [0.694, 0, 0.331],
        120285: [0.694, 0.022, 0.519],
        120286: [0.694, 0, 0.764],
        120287: [0.694, 0, 0.581],
        120288: [0.694, 0, 0.978],
        120289: [0.694, 0, 0.794],
        120290: [0.716, 0.022, 0.794],
        120291: [0.694, 0, 0.703],
        120292: [0.716, 0.106, 0.794],
        120293: [0.694, 0, 0.703],
        120294: [0.716, 0.022, 0.611],
        120295: [0.688, 0, 0.733],
        120296: [0.694, 0.022, 0.764],
        120297: [0.694, 0, 0.733],
        120298: [0.694, 0, 1.039],
        120299: [0.694, 0, 0.733],
        120300: [0.694, 0, 0.733],
        120301: [0.694, 0, 0.672],
        120302: [0.475, 0.011, 0.525],
        120303: [0.694, 0.01, 0.561],
        120304: [0.475, 0.011, 0.489],
        120305: [0.694, 0.011, 0.561],
        120306: [0.474, 0.01, 0.511],
        120307: [0.705, 0, 0.336, { ic: 0.045 }],
        120308: [0.469, 0.206, 0.55],
        120309: [0.694, 0, 0.561],
        120310: [0.695, 0, 0.256],
        120311: [0.695, 0.205, 0.286],
        120312: [0.694, 0, 0.531],
        120313: [0.694, 0, 0.256],
        120314: [0.469, 0, 0.867],
        120315: [0.468, 0, 0.561],
        120316: [0.474, 0.011, 0.55],
        120317: [0.469, 0.194, 0.561],
        120318: [0.469, 0.194, 0.561],
        120319: [0.469, 0, 0.372],
        120320: [0.474, 0.01, 0.422],
        120321: [0.589, 0.01, 0.404],
        120322: [0.458, 0.011, 0.561],
        120323: [0.458, 0, 0.5],
        120324: [0.458, 0, 0.744],
        120325: [0.458, 0, 0.5],
        120326: [0.458, 0.205, 0.5],
        120327: [0.458, 0, 0.476],
        120328: [0.694, 0, 0.667],
        120329: [0.694, 0, 0.667, { ic: 0.029 }],
        120330: [0.705, 0.01, 0.639, { ic: 0.08 }],
        120331: [0.694, 0, 0.722, { ic: 0.025 }],
        120332: [0.691, 0, 0.597, { ic: 0.091 }],
        120333: [0.691, 0, 0.569, { ic: 0.104 }],
        120334: [0.705, 0.011, 0.667, { ic: 0.063 }],
        120335: [0.694, 0, 0.708, { ic: 0.06 }],
        120336: [0.694, 0, 0.278, { ic: 0.06 }],
        120337: [0.694, 0.022, 0.472, { ic: 0.063 }],
        120338: [0.694, 0, 0.694, { ic: 0.091 }],
        120339: [0.694, 0, 0.542],
        120340: [0.694, 0, 0.875, { ic: 0.054 }],
        120341: [0.694, 0, 0.708, { ic: 0.058 }],
        120342: [0.716, 0.022, 0.736, { ic: 0.027 }],
        120343: [0.694, 0, 0.639, { ic: 0.051 }],
        120344: [0.716, 0.125, 0.736, { ic: 0.027 }],
        120345: [0.694, 0, 0.646, { ic: 0.052 }],
        120346: [0.716, 0.022, 0.556, { ic: 0.053 }],
        120347: [0.688, 0, 0.681, { ic: 0.109 }],
        120348: [0.694, 0.022, 0.688, { ic: 0.059 }],
        120349: [0.694, 0, 0.667, { ic: 0.132 }],
        120350: [0.694, 0, 0.944, { ic: 0.132 }],
        120351: [0.694, 0, 0.667, { ic: 0.091 }],
        120352: [0.694, 0, 0.667, { ic: 0.143 }],
        120353: [0.694, 0, 0.611, { ic: 0.091 }],
        120354: [0.461, 0.01, 0.481],
        120355: [0.694, 0.011, 0.517, { ic: 0.022 }],
        120356: [0.46, 0.011, 0.444, { ic: 0.055 }],
        120357: [0.694, 0.01, 0.517, { ic: 0.071 }],
        120358: [0.46, 0.011, 0.444, { ic: 0.028 }],
        120359: [0.705, 0, 0.306, { ic: 0.188 }],
        120360: [0.455, 0.206, 0.5, { ic: 0.068 }],
        120361: [0.694, 0, 0.517],
        120362: [0.68, 0, 0.239, { ic: 0.076 }],
        120363: [0.68, 0.204, 0.267, { ic: 0.069 }],
        120364: [0.694, 0, 0.489, { ic: 0.054 }],
        120365: [0.694, 0, 0.239, { ic: 0.072 }],
        120366: [0.455, 0, 0.794],
        120367: [0.454, 0, 0.517],
        120368: [0.461, 0.011, 0.5, { ic: 0.023 }],
        120369: [0.455, 0.194, 0.517, { ic: 0.021 }],
        120370: [0.455, 0.194, 0.517, { ic: 0.021 }],
        120371: [0.455, 0, 0.342, { ic: 0.082 }],
        120372: [0.461, 0.011, 0.383, { ic: 0.053 }],
        120373: [0.571, 0.011, 0.361, { ic: 0.049 }],
        120374: [0.444, 0.01, 0.517, { ic: 0.02 }],
        120375: [0.444, 0, 0.461, { ic: 0.079 }],
        120376: [0.444, 0, 0.683, { ic: 0.079 }],
        120377: [0.444, 0, 0.461, { ic: 0.076 }],
        120378: [0.444, 0.205, 0.461, { ic: 0.079 }],
        120379: [0.444, 0, 0.435, { ic: 0.059 }],
        120432: [0.623, 0, 0.525],
        120433: [0.611, 0, 0.525],
        120434: [0.622, 0.011, 0.525],
        120435: [0.611, 0, 0.525],
        120436: [0.611, 0, 0.525],
        120437: [0.611, 0, 0.525],
        120438: [0.622, 0.011, 0.525],
        120439: [0.611, 0, 0.525],
        120440: [0.611, 0, 0.525],
        120441: [0.611, 0.011, 0.525],
        120442: [0.611, 0, 0.525],
        120443: [0.611, 0, 0.525],
        120444: [0.611, 0, 0.525],
        120445: [0.611, 0, 0.525],
        120446: [0.621, 0.01, 0.525],
        120447: [0.611, 0, 0.525],
        120448: [0.621, 0.138, 0.525],
        120449: [0.611, 0.011, 0.525],
        120450: [0.622, 0.011, 0.525],
        120451: [0.611, 0, 0.525],
        120452: [0.611, 0.011, 0.525],
        120453: [0.611, 7e-3, 0.525],
        120454: [0.611, 7e-3, 0.525],
        120455: [0.611, 0, 0.525],
        120456: [0.611, 0, 0.525],
        120457: [0.611, 0, 0.525],
        120458: [0.439, 6e-3, 0.525],
        120459: [0.611, 6e-3, 0.525],
        120460: [0.44, 6e-3, 0.525],
        120461: [0.611, 6e-3, 0.525],
        120462: [0.44, 6e-3, 0.525],
        120463: [0.617, 0, 0.525],
        120464: [0.442, 0.229, 0.525],
        120465: [0.611, 0, 0.525],
        120466: [0.612, 0, 0.525],
        120467: [0.612, 0.228, 0.525],
        120468: [0.611, 0, 0.525],
        120469: [0.611, 0, 0.525],
        120470: [0.436, 0, 0.525, { ic: 0.011 }],
        120471: [0.436, 0, 0.525],
        120472: [0.44, 6e-3, 0.525],
        120473: [0.437, 0.221, 0.525],
        120474: [0.437, 0.221, 0.525, { ic: 0.02 }],
        120475: [0.437, 0, 0.525],
        120476: [0.44, 6e-3, 0.525],
        120477: [0.554, 6e-3, 0.525],
        120478: [0.431, 5e-3, 0.525],
        120479: [0.431, 0, 0.525],
        120480: [0.431, 0, 0.525],
        120481: [0.431, 0, 0.525],
        120482: [0.431, 0.228, 0.525],
        120483: [0.431, 0, 0.525],
        120488: [0.698, 0, 0.869],
        120489: [0.686, 0, 0.818],
        120490: [0.68, 0, 0.692],
        120491: [0.698, 0, 0.958],
        120492: [0.68, 0, 0.756],
        120493: [0.686, 0, 0.703],
        120494: [0.686, 0, 0.9],
        120495: [0.696, 0.01, 0.894],
        120496: [0.686, 0, 0.436],
        120497: [0.686, 0, 0.901],
        120498: [0.698, 0, 0.806],
        120499: [0.686, 0, 1.092],
        120500: [0.686, 0, 0.9],
        120501: [0.675, 0, 0.767],
        120502: [0.696, 0.01, 0.864],
        120503: [0.68, 0, 0.9],
        120504: [0.686, 0, 0.786],
        120506: [0.686, 0, 0.831],
        120507: [0.675, 0, 0.8],
        120508: [0.697, 0, 0.894],
        120509: [0.686, 0, 0.831],
        120510: [0.686, 0, 0.869],
        120511: [0.686, 0, 0.894],
        120512: [0.696, 0, 0.831],
        120513: [0.686, 0.024, 0.958],
        120546: [0.716, 0, 0.75, { sk: 0.139 }],
        120547: [0.683, 0, 0.759, { sk: 0.0833 }],
        120548: [0.68, 0, 0.615, { ic: 0.106, sk: 0.0833 }],
        120549: [0.716, 0, 0.833, { sk: 0.167 }],
        120550: [0.68, 0, 0.738, { ic: 0.026, sk: 0.0833 }],
        120551: [0.683, 0, 0.683, { ic: 0.04, sk: 0.0833 }],
        120552: [0.683, 0, 0.831, { ic: 0.057, sk: 0.0556 }],
        120553: [0.704, 0.022, 0.763, { sk: 0.0833 }],
        120554: [0.683, 0, 0.44, { ic: 0.064, sk: 0.111 }],
        120555: [0.683, 0, 0.849, { ic: 0.04, sk: 0.0556 }],
        120556: [0.716, 0, 0.694, { sk: 0.167 }],
        120557: [0.683, 0, 0.97, { ic: 0.081, sk: 0.0833 }],
        120558: [0.683, 0, 0.803, { ic: 0.085, sk: 0.0833 }],
        120559: [0.677, 0, 0.742, { ic: 0.035, sk: 0.0833 }],
        120560: [0.704, 0.022, 0.763, { sk: 0.0833 }],
        120561: [0.68, 0, 0.831, { ic: 0.056, sk: 0.0556 }],
        120562: [0.683, 0, 0.642, { ic: 0.109, sk: 0.0833 }],
        120564: [0.683, 0, 0.78, { ic: 0.026, sk: 0.0833 }],
        120565: [0.677, 0, 0.584, { ic: 0.12, sk: 0.0833 }],
        120566: [0.705, 0, 0.583, { ic: 0.117, sk: 0.0556 }],
        120567: [0.683, 0, 0.667, { sk: 0.0833 }],
        120568: [0.683, 0, 0.828, { ic: 0.024, sk: 0.0833 }],
        120569: [0.683, 0, 0.612, { ic: 0.08, sk: 0.0556 }],
        120570: [0.704, 0, 0.772, { ic: 0.014, sk: 0.0833 }],
        120572: [0.442, 0.011, 0.64, { sk: 0.0278 }],
        120573: [0.705, 0.194, 0.566, { sk: 0.0833 }],
        120574: [0.441, 0.216, 0.518, { ic: 0.025 }],
        120575: [0.717, 0.01, 0.444, { sk: 0.0556 }],
        120576: [0.452, 0.022, 0.466, { sk: 0.0833 }],
        120577: [0.704, 0.204, 0.438, { ic: 0.033, sk: 0.0833 }],
        120578: [0.442, 0.216, 0.497, { sk: 0.0556 }],
        120579: [0.705, 0.01, 0.469, { sk: 0.0833 }],
        120580: [0.442, 0.01, 0.354, { sk: 0.0556 }],
        120581: [0.442, 0.011, 0.576],
        120582: [0.694, 0.012, 0.583],
        120583: [0.442, 0.216, 0.603, { sk: 0.0278 }],
        120584: [0.442, 0, 0.494, { ic: 0.036, sk: 0.0278 }],
        120585: [0.704, 0.205, 0.438, { sk: 0.111 }],
        120586: [0.441, 0.011, 0.485, { sk: 0.0556 }],
        120587: [0.431, 0.011, 0.57],
        120588: [0.442, 0.216, 0.517, { sk: 0.0833 }],
        120589: [0.442, 0.107, 0.363, { ic: 0.042, sk: 0.0833 }],
        120590: [0.431, 0.011, 0.571],
        120591: [0.431, 0.013, 0.437, { ic: 0.08, sk: 0.0278 }],
        120592: [0.443, 0.01, 0.54, { sk: 0.0278 }],
        120593: [0.442, 0.218, 0.654, { sk: 0.0833 }],
        120594: [0.442, 0.204, 0.626, { sk: 0.0556 }],
        120595: [0.694, 0.205, 0.651, { sk: 0.111 }],
        120596: [0.443, 0.011, 0.622],
        120597: [0.715, 0.022, 0.531, { ic: 0.035, sk: 0.0833 }],
        120598: [0.431, 0.011, 0.406, { sk: 0.0556 }],
        120599: [0.705, 0.011, 0.591, { sk: 0.0833 }],
        120600: [0.434, 6e-3, 0.667, { ic: 0.067 }],
        120601: [0.694, 0.205, 0.596, { sk: 0.0833 }],
        120602: [0.442, 0.194, 0.517, { sk: 0.0833 }],
        120603: [0.431, 0.01, 0.828],
        120604: [0.711, 0, 0.869, { sk: 0.16 }],
        120605: [0.686, 0, 0.866, { sk: 0.0958 }],
        120606: [0.68, 0, 0.657, { ic: 0.12, sk: 0.0958 }],
        120607: [0.711, 0, 0.958, { sk: 0.192 }],
        120608: [0.68, 0, 0.81, { ic: 0.015, sk: 0.0958 }],
        120609: [0.686, 0, 0.773, { ic: 0.032, sk: 0.0958 }],
        120610: [0.686, 0, 0.982, { ic: 0.045, sk: 0.0639 }],
        120611: [0.702, 0.017, 0.867, { sk: 0.0958 }],
        120612: [0.686, 0, 0.511, { ic: 0.062, sk: 0.128 }],
        120613: [0.686, 0, 0.971, { ic: 0.032, sk: 0.0639 }],
        120614: [0.711, 0, 0.806, { sk: 0.192 }],
        120615: [0.686, 0, 1.142, { ic: 0.077, sk: 0.0958 }],
        120616: [0.686, 0, 0.95, { ic: 0.077, sk: 0.0958 }],
        120617: [0.675, 0, 0.841, { ic: 0.026, sk: 0.0958 }],
        120618: [0.703, 0.017, 0.837, { sk: 0.0958 }],
        120619: [0.68, 0, 0.982, { ic: 0.044, sk: 0.0639 }],
        120620: [0.686, 0, 0.723, { ic: 0.124, sk: 0.0958 }],
        120622: [0.686, 0, 0.885, { ic: 0.017, sk: 0.0958 }],
        120623: [0.675, 0, 0.637, { ic: 0.135, sk: 0.0958 }],
        120624: [0.703, 0, 0.671, { ic: 0.131, sk: 0.0639 }],
        120625: [0.686, 0, 0.767, { sk: 0.0958 }],
        120626: [0.686, 0, 0.947, { sk: 0.0958 }],
        120627: [0.686, 0, 0.714, { ic: 0.076, sk: 0.0639 }],
        120628: [0.703, 0, 0.879, { sk: 0.0958 }],
        120630: [0.452, 8e-3, 0.761, { sk: 0.0319 }],
        120631: [0.701, 0.194, 0.66, { sk: 0.0958 }],
        120632: [0.451, 0.211, 0.59, { ic: 0.027 }],
        120633: [0.725, 8e-3, 0.522, { sk: 0.0639 }],
        120634: [0.461, 0.017, 0.529, { sk: 0.0958 }],
        120635: [0.711, 0.202, 0.508, { ic: 0.013, sk: 0.0958 }],
        120636: [0.452, 0.211, 0.6, { sk: 0.0639 }],
        120637: [0.702, 8e-3, 0.562, { sk: 0.0958 }],
        120638: [0.452, 8e-3, 0.412, { sk: 0.0639 }],
        120639: [0.452, 8e-3, 0.668],
        120640: [0.694, 0.013, 0.671],
        120641: [0.452, 0.211, 0.708, { sk: 0.0319 }],
        120642: [0.452, 0, 0.577, { ic: 0.031, sk: 0.0319 }],
        120643: [0.711, 0.201, 0.508, { sk: 0.128 }],
        120644: [0.452, 8e-3, 0.585, { sk: 0.0639 }],
        120645: [0.444, 8e-3, 0.682],
        120646: [0.451, 0.211, 0.612, { sk: 0.0958 }],
        120647: [0.451, 0.105, 0.424, { ic: 0.033, sk: 0.0958 }],
        120648: [0.444, 8e-3, 0.686],
        120649: [0.444, 0.013, 0.521, { ic: 0.089, sk: 0.0319 }],
        120650: [0.453, 8e-3, 0.631, { sk: 0.0319 }],
        120651: [0.452, 0.216, 0.747, { sk: 0.0958 }],
        120652: [0.452, 0.201, 0.718, { sk: 0.0639 }],
        120653: [0.694, 0.202, 0.758, { sk: 0.128 }],
        120654: [0.453, 8e-3, 0.718],
        120655: [0.71, 0.017, 0.628, { ic: 0.029, sk: 0.0958 }],
        120656: [0.444, 7e-3, 0.483, { sk: 0.0639 }],
        120657: [0.701, 8e-3, 0.692, { sk: 0.0958 }],
        120658: [0.434, 6e-3, 0.667, { ic: 0.067 }],
        120659: [0.694, 0.202, 0.712, { sk: 0.0958 }],
        120660: [0.451, 0.194, 0.612, { sk: 0.0958 }],
        120661: [0.444, 8e-3, 0.975],
        120662: [0.694, 0, 0.733],
        120663: [0.694, 0, 0.733],
        120664: [0.691, 0, 0.581],
        120665: [0.694, 0, 0.917],
        120666: [0.691, 0, 0.642],
        120667: [0.694, 0, 0.672],
        120668: [0.694, 0, 0.794],
        120669: [0.716, 0.022, 0.856],
        120670: [0.694, 0, 0.331],
        120671: [0.694, 0, 0.764],
        120672: [0.694, 0, 0.672],
        120673: [0.694, 0, 0.978],
        120674: [0.694, 0, 0.794],
        120675: [0.688, 0, 0.733],
        120676: [0.716, 0.022, 0.794],
        120677: [0.691, 0, 0.794],
        120678: [0.694, 0, 0.703],
        120680: [0.694, 0, 0.794],
        120681: [0.688, 0, 0.733],
        120682: [0.715, 0, 0.856],
        120683: [0.694, 0, 0.794],
        120684: [0.694, 0, 0.733],
        120685: [0.694, 0, 0.856],
        120686: [0.716, 0, 0.794],
        120782: [0.654, 0.01, 0.575],
        120783: [0.655, 0, 0.575],
        120784: [0.654, 0, 0.575],
        120785: [0.655, 0.011, 0.575],
        120786: [0.656, 0, 0.575],
        120787: [0.655, 0.011, 0.575],
        120788: [0.655, 0.011, 0.575],
        120789: [0.676, 0.011, 0.575],
        120790: [0.654, 0.011, 0.575],
        120791: [0.654, 0.011, 0.575],
        120802: [0.678, 0.022, 0.5],
        120803: [0.678, 0, 0.5],
        120804: [0.677, 0, 0.5],
        120805: [0.678, 0.022, 0.5],
        120806: [0.656, 0, 0.5],
        120807: [0.656, 0.021, 0.5],
        120808: [0.677, 0.022, 0.5],
        120809: [0.656, 0.011, 0.5],
        120810: [0.678, 0.022, 0.5],
        120811: [0.677, 0.022, 0.5],
        120812: [0.715, 0.022, 0.55],
        120813: [0.716, 0, 0.55],
        120814: [0.716, 0, 0.55],
        120815: [0.716, 0.022, 0.55],
        120816: [0.694, 0, 0.55],
        120817: [0.694, 0.022, 0.55],
        120818: [0.716, 0.022, 0.55],
        120819: [0.695, 0.011, 0.55],
        120820: [0.715, 0.022, 0.55],
        120821: [0.716, 0.022, 0.55],
        120822: [0.621, 0.01, 0.525],
        120823: [0.622, 0, 0.525],
        120824: [0.622, 0, 0.525],
        120825: [0.622, 0.011, 0.525],
        120826: [0.624, 0, 0.525],
        120827: [0.611, 0.01, 0.525],
        120828: [0.622, 0.011, 0.525],
        120829: [0.627, 0.01, 0.525],
        120830: [0.621, 0.01, 0.525],
        120831: [0.622, 0.011, 0.525]
      };
      return normal;
    }
    var hasRequiredNormal;
    function requireNormal() {
      if (hasRequiredNormal) return normal$1;
      hasRequiredNormal = 1;
      Object.defineProperty(normal$1, "__esModule", { value: true });
      normal$1.normal = void 0;
      var FontData_js_1 = requireFontData();
      var normal_js_1 = requireNormal$1();
      normal$1.normal = (0, FontData_js_1.AddPaths)(normal_js_1.normal, {
        32: "",
        33: "78 661Q78 682 96 699T138 716T180 700T199 661Q199 654 179 432T158 206Q156 198 139 198Q121 198 119 206Q118 209 98 431T78 661ZM79 61Q79 89 97 105T141 121Q164 119 181 104T198 61Q198 31 181 16T139 1Q114 1 97 16T79 61",
        34: "34 634Q34 659 50 676T93 694Q121 694 144 668T168 579Q168 525 146 476T101 403T73 379Q69 379 60 388T50 401Q50 404 62 417T88 448T116 500T131 572Q131 584 130 584T125 581T112 576T94 573Q69 573 52 590T34 634ZM238 634Q238 659 254 676T297 694Q325 694 348 668T372 579Q372 525 350 476T305 403T277 379Q273 379 264 388T254 401Q254 404 266 417T292 448T320 500T335 572Q335 584 334 584T329 581T316 576T298 573Q273 573 256 590T238 634",
        35: "56 347Q56 360 70 367H313L355 524Q394 676 401 686Q406 694 416 694Q434 694 436 676Q436 672 396 522Q355 374 355 369L354 367H543L585 524Q626 679 630 685Q636 694 646 694Q653 694 659 689T665 678Q665 668 626 522Q585 374 585 369L584 367H762Q777 359 777 347Q777 334 767 331T722 327H667H572L552 251L531 174Q531 173 647 173H720Q756 173 766 170T777 153T762 133H519L477 -24Q436 -179 432 -185Q426 -194 416 -194Q409 -194 403 -189T397 -177Q397 -167 436 -21Q477 125 477 131L478 133H289L247 -24Q206 -179 202 -185Q196 -194 186 -194Q179 -194 173 -189T167 -177Q167 -167 206 -21Q247 125 247 131L248 133H70Q56 140 56 153Q56 168 72 173H260L280 249L301 326Q301 327 186 327H72Q56 332 56 347ZM531 326Q531 327 437 327H342L322 251L301 174Q301 173 395 173H490L510 249L531 326",
        36: "162 187Q162 164 146 149T109 133H103V130Q108 115 115 105Q122 92 131 82T150 64T170 52T190 44T206 40T220 37L227 36V313Q190 320 162 335Q116 358 86 404T55 508Q55 567 85 614T165 685Q186 696 225 704H227V750H273V704L286 703Q369 690 413 631Q441 588 444 531Q444 514 443 509Q439 490 425 479T391 468Q368 468 353 483T337 522Q337 546 353 560T390 575L394 576V578Q386 599 372 614T342 637T314 649T288 656L273 658V408L288 405Q329 394 355 376Q396 348 420 300T444 199Q444 130 408 76T313 1Q286 -9 276 -9H273V-56H227V-10H221Q202 -6 193 -4T155 11T108 41T74 94T55 176V182Q55 227 95 238Q103 240 108 240Q129 240 145 226T162 187ZM225 657Q219 657 204 651T169 632T135 594T121 538Q121 512 131 491T156 457T187 435T213 423T227 420V539Q227 657 225 657ZM378 169Q378 230 339 265T274 301Q273 301 273 169V37Q324 50 351 87T378 169",
        37: "465 605Q428 605 394 614T340 632T319 641Q332 608 332 548Q332 458 293 403T202 347Q145 347 101 402T56 548Q56 637 101 693T202 750Q241 750 272 719Q359 642 464 642Q580 642 650 732Q662 748 668 749Q670 750 673 750Q682 750 688 743T693 726Q178 -47 170 -52Q166 -56 160 -56Q147 -56 142 -45Q137 -36 142 -27Q143 -24 363 304Q469 462 525 546T581 630Q528 605 465 605ZM207 385Q235 385 263 427T292 548Q292 617 267 664T200 712Q193 712 186 709T167 698T147 668T134 615Q132 595 132 548V527Q132 436 165 403Q183 385 203 385H207ZM500 146Q500 234 544 290T647 347Q699 347 737 292T776 146T737 0T646 -56Q590 -56 545 0T500 146ZM651 -18Q679 -18 707 24T736 146Q736 215 711 262T644 309Q637 309 630 306T611 295T591 265T578 212Q577 200 577 146V124Q577 -18 647 -18H651",
        38: "156 540Q156 620 201 668T302 716Q354 716 377 671T401 578Q401 505 287 386L274 373Q309 285 416 148L429 132L437 142Q474 191 543 309L562 341V349Q562 368 541 376T498 385H493V431H502L626 428Q709 428 721 431H727V385H712Q688 384 669 379T639 369T618 354T603 337T591 316T578 295Q537 223 506 176T464 117T454 104Q454 102 471 85T497 62Q543 24 585 24Q618 24 648 48T682 113V121H722V112Q721 94 714 75T692 32T646 -7T574 -22Q491 -19 414 42L402 51L391 42Q312 -22 224 -22Q144 -22 93 25T42 135Q42 153 46 169T55 197T74 225T96 249T125 278T156 308L195 347L190 360Q185 372 182 382T174 411T165 448T159 491T156 540ZM361 576Q361 613 348 646T305 679Q272 679 252 649T232 572Q232 497 255 426L259 411L267 420Q361 519 361 576ZM140 164Q140 103 167 64T240 24Q271 24 304 36T356 61T374 77Q295 156 235 262L220 292L210 310L193 293Q177 277 169 268T151 229T140 164",
        39: "78 634Q78 659 95 676T138 694Q166 694 189 668T212 579Q212 525 190 476T146 403T118 379Q114 379 105 388T95 401Q95 404 107 417T133 448T161 500T176 572Q176 584 175 584T170 581T157 576T139 573Q114 573 96 590T78 634",
        40: "94 250Q94 319 104 381T127 488T164 576T202 643T244 695T277 729T302 750H315H319Q333 750 333 741Q333 738 316 720T275 667T226 581T184 443T167 250T184 58T225 -81T274 -167T316 -220T333 -241Q333 -250 318 -250H315H302L274 -226Q180 -141 137 -14T94 250",
        41: "60 749L64 750Q69 750 74 750H86L114 726Q208 641 251 514T294 250Q294 182 284 119T261 12T224 -76T186 -143T145 -194T113 -227T90 -246Q87 -249 86 -250H74Q66 -250 63 -250T58 -247T55 -238Q56 -237 66 -225Q221 -64 221 250T66 725Q56 737 55 738Q55 746 60 749",
        42: "215 721Q216 732 225 741T248 750Q263 750 273 742T284 721L270 571L327 613Q383 654 388 657T399 660Q412 660 423 650T435 624T424 600T376 575Q363 569 355 566L289 534L355 504L424 470Q435 462 435 447Q435 431 424 420T399 409Q393 409 388 412T327 456L270 498L277 423L284 348Q280 320 250 320T215 348L229 498L172 456Q116 415 111 412T100 409Q87 409 76 420T64 447Q64 461 75 470L144 504L210 534L144 566Q136 570 122 576Q83 593 74 600T64 624Q64 639 75 649T100 660Q106 660 111 657T172 613L229 571Q229 578 222 643T215 721",
        43: "56 237T56 250T70 270H369V420L370 570Q380 583 389 583Q402 583 409 568V270H707Q722 262 722 250T707 230H409V-68Q401 -82 391 -82H389H387Q375 -82 369 -68V230H70Q56 237 56 250",
        44: "78 35T78 60T94 103T137 121Q165 121 187 96T210 8Q210 -27 201 -60T180 -117T154 -158T130 -185T117 -194Q113 -194 104 -185T95 -172Q95 -168 106 -156T131 -126T157 -76T173 -3V9L172 8Q170 7 167 6T161 3T152 1T140 0Q113 0 96 17",
        45: "11 179V252H277V179H11",
        46: "78 60Q78 84 95 102T138 120Q162 120 180 104T199 61Q199 36 182 18T139 0T96 17T78 60",
        47: "423 750Q432 750 438 744T444 730Q444 725 271 248T92 -240Q85 -250 75 -250Q68 -250 62 -245T56 -231Q56 -221 230 257T407 740Q411 750 423 750",
        48: "96 585Q152 666 249 666Q297 666 345 640T423 548Q460 465 460 320Q460 165 417 83Q397 41 362 16T301 -15T250 -22Q224 -22 198 -16T137 16T82 83Q39 165 39 320Q39 494 96 585ZM321 597Q291 629 250 629Q208 629 178 597Q153 571 145 525T137 333Q137 175 145 125T181 46Q209 16 250 16Q290 16 318 46Q347 76 354 130T362 333Q362 478 354 524T321 597",
        49: "213 578L200 573Q186 568 160 563T102 556H83V602H102Q149 604 189 617T245 641T273 663Q275 666 285 666Q294 666 302 660V361L303 61Q310 54 315 52T339 48T401 46H427V0H416Q395 3 257 3Q121 3 100 0H88V46H114Q136 46 152 46T177 47T193 50T201 52T207 57T213 61V578",
        50: "109 429Q82 429 66 447T50 491Q50 562 103 614T235 666Q326 666 387 610T449 465Q449 422 429 383T381 315T301 241Q265 210 201 149L142 93L218 92Q375 92 385 97Q392 99 409 186V189H449V186Q448 183 436 95T421 3V0H50V19V31Q50 38 56 46T86 81Q115 113 136 137Q145 147 170 174T204 211T233 244T261 278T284 308T305 340T320 369T333 401T340 431T343 464Q343 527 309 573T212 619Q179 619 154 602T119 569T109 550Q109 549 114 549Q132 549 151 535T170 489Q170 464 154 447T109 429",
        51: "127 463Q100 463 85 480T69 524Q69 579 117 622T233 665Q268 665 277 664Q351 652 390 611T430 522Q430 470 396 421T302 350L299 348Q299 347 308 345T337 336T375 315Q457 262 457 175Q457 96 395 37T238 -22Q158 -22 100 21T42 130Q42 158 60 175T105 193Q133 193 151 175T169 130Q169 119 166 110T159 94T148 82T136 74T126 70T118 67L114 66Q165 21 238 21Q293 21 321 74Q338 107 338 175V195Q338 290 274 322Q259 328 213 329L171 330L168 332Q166 335 166 348Q166 366 174 366Q202 366 232 371Q266 376 294 413T322 525V533Q322 590 287 612Q265 626 240 626Q208 626 181 615T143 592T132 580H135Q138 579 143 578T153 573T165 566T175 555T183 540T186 520Q186 498 172 481T127 463",
        52: "462 0Q444 3 333 3Q217 3 199 0H190V46H221Q241 46 248 46T265 48T279 53T286 61Q287 63 287 115V165H28V211L179 442Q332 674 334 675Q336 677 355 677H373L379 671V211H471V165H379V114Q379 73 379 66T385 54Q393 47 442 46H471V0H462ZM293 211V545L74 212L183 211H293",
        53: "164 157Q164 133 148 117T109 101H102Q148 22 224 22Q294 22 326 82Q345 115 345 210Q345 313 318 349Q292 382 260 382H254Q176 382 136 314Q132 307 129 306T114 304Q97 304 95 310Q93 314 93 485V614Q93 664 98 664Q100 666 102 666Q103 666 123 658T178 642T253 634Q324 634 389 662Q397 666 402 666Q410 666 410 648V635Q328 538 205 538Q174 538 149 544L139 546V374Q158 388 169 396T205 412T256 420Q337 420 393 355T449 201Q449 109 385 44T229 -22Q148 -22 99 32T50 154Q50 178 61 192T84 210T107 214Q132 214 148 197T164 157",
        54: "42 313Q42 476 123 571T303 666Q372 666 402 630T432 550Q432 525 418 510T379 495Q356 495 341 509T326 548Q326 592 373 601Q351 623 311 626Q240 626 194 566Q147 500 147 364L148 360Q153 366 156 373Q197 433 263 433H267Q313 433 348 414Q372 400 396 374T435 317Q456 268 456 210V192Q456 169 451 149Q440 90 387 34T253 -22Q225 -22 199 -14T143 16T92 75T56 172T42 313ZM257 397Q227 397 205 380T171 335T154 278T148 216Q148 133 160 97T198 39Q222 21 251 21Q302 21 329 59Q342 77 347 104T352 209Q352 289 347 316T329 361Q302 397 257 397",
        55: "55 458Q56 460 72 567L88 674Q88 676 108 676H128V672Q128 662 143 655T195 646T364 644H485V605L417 512Q408 500 387 472T360 435T339 403T319 367T305 330T292 284T284 230T278 162T275 80Q275 66 275 52T274 28V19Q270 2 255 -10T221 -22Q210 -22 200 -19T179 0T168 40Q168 198 265 368Q285 400 349 489L395 552H302Q128 552 119 546Q113 543 108 522T98 479L95 458V455H55V458",
        56: "70 417T70 494T124 618T248 666Q319 666 374 624T429 515Q429 485 418 459T392 417T361 389T335 371T324 363L338 354Q352 344 366 334T382 323Q457 264 457 174Q457 95 399 37T249 -22Q159 -22 101 29T43 155Q43 263 172 335L154 348Q133 361 127 368Q70 417 70 494ZM286 386L292 390Q298 394 301 396T311 403T323 413T334 425T345 438T355 454T364 471T369 491T371 513Q371 556 342 586T275 624Q268 625 242 625Q201 625 165 599T128 534Q128 511 141 492T167 463T217 431Q224 426 228 424L286 386ZM250 21Q308 21 350 55T392 137Q392 154 387 169T375 194T353 216T330 234T301 253T274 270Q260 279 244 289T218 306L210 311Q204 311 181 294T133 239T107 157Q107 98 150 60T250 21",
        57: "352 287Q304 211 232 211Q154 211 104 270T44 396Q42 412 42 436V444Q42 537 111 606Q171 666 243 666Q245 666 249 666T257 665H261Q273 665 286 663T323 651T370 619T413 560Q456 472 456 334Q456 194 396 97Q361 41 312 10T208 -22Q147 -22 108 7T68 93T121 149Q143 149 158 135T173 96Q173 78 164 65T148 49T135 44L131 43Q131 41 138 37T164 27T206 22H212Q272 22 313 86Q352 142 352 280V287ZM244 248Q292 248 321 297T351 430Q351 508 343 542Q341 552 337 562T323 588T293 615T246 625Q208 625 181 598Q160 576 154 546T147 441Q147 358 152 329T172 282Q197 248 244 248",
        58: "78 370Q78 394 95 412T138 430Q162 430 180 414T199 371Q199 346 182 328T139 310T96 327T78 370ZM78 60Q78 84 95 102T138 120Q162 120 180 104T199 61Q199 36 182 18T139 0T96 17T78 60",
        59: "78 370Q78 394 95 412T138 430Q162 430 180 414T199 371Q199 346 182 328T139 310T96 327T78 370ZM78 60Q78 85 94 103T137 121Q202 121 202 8Q202 -44 183 -94T144 -169T118 -194Q115 -194 106 -186T95 -174Q94 -171 107 -155T137 -107T160 -38Q161 -32 162 -22T165 -4T165 4Q165 5 161 4T142 0Q110 0 94 18T78 60",
        60: "694 -11T694 -19T688 -33T678 -40Q671 -40 524 29T234 166L90 235Q83 240 83 250Q83 261 91 266Q664 540 678 540Q681 540 687 534T694 519T687 505Q686 504 417 376L151 250L417 124Q686 -4 687 -5Q694 -11 694 -19",
        61: "56 347Q56 360 70 367H707Q722 359 722 347Q722 336 708 328L390 327H72Q56 332 56 347ZM56 153Q56 168 72 173H708Q722 163 722 153Q722 140 707 133H70Q56 140 56 153",
        62: "84 520Q84 528 88 533T96 539L99 540Q106 540 253 471T544 334L687 265Q694 260 694 250T687 235Q685 233 395 96L107 -40H101Q83 -38 83 -20Q83 -19 83 -17Q82 -10 98 -1Q117 9 248 71Q326 108 378 132L626 250L378 368Q90 504 86 509Q84 513 84 520",
        63: "226 668Q190 668 162 656T124 632L114 621Q116 621 119 620T130 616T145 607T157 591T162 567Q162 544 147 529T109 514T71 528T55 566Q55 625 100 661T199 704Q201 704 210 704T224 705H228Q281 705 320 692T378 656T407 612T416 567Q416 503 361 462Q267 395 247 303Q242 279 242 241V224Q242 205 239 202T222 198T205 201T202 218V249Q204 320 220 371T255 445T292 491T315 537Q317 546 317 574V587Q317 604 315 615T304 640T277 661T226 668ZM162 61Q162 89 180 105T224 121Q247 119 264 104T281 61Q281 31 264 16T222 1Q197 1 180 16T162 61",
        64: "56 347Q56 429 86 498T164 612T270 680T386 705Q522 705 622 603T722 349Q722 126 608 126Q541 126 513 176Q512 177 512 179T510 182L509 183Q508 183 503 177T487 163T464 146T429 132T385 126Q311 126 251 186T190 347Q190 448 251 508T385 568Q426 568 460 548T509 511T531 479H555Q580 479 582 478Q586 477 587 468Q588 454 588 338V260Q588 200 593 182T619 163Q641 163 655 178T674 223T680 273T682 325V330Q682 426 647 500Q611 569 544 618T388 668Q271 668 184 577T96 347Q96 216 180 121T396 26Q421 26 446 28T493 34T535 43T573 52T605 63T629 72T647 80T657 84H716Q722 78 722 74Q722 65 675 45T547 7T392 -11Q255 -11 156 90T56 347ZM274 347Q274 266 308 214T390 162Q420 162 449 182T498 235L504 245V449L498 459Q453 532 387 532Q347 532 311 483T274 347",
        65: "255 0Q240 3 140 3Q48 3 39 0H32V46H47Q119 49 139 88Q140 91 192 245T295 553T348 708Q351 716 366 716H376Q396 715 400 709Q402 707 508 390L617 67Q624 54 636 51T687 46H717V0H708Q699 3 581 3Q458 3 437 0H427V46H440Q510 46 510 64Q510 66 486 138L462 209H229L209 150Q189 91 189 85Q189 72 209 59T259 46H264V0H255ZM447 255L345 557L244 256Q244 255 345 255H447",
        66: "131 622Q124 629 120 631T104 634T61 637H28V683H229H267H346Q423 683 459 678T531 651Q574 627 599 590T624 512Q624 461 583 419T476 360L466 357Q539 348 595 302T651 187Q651 119 600 67T469 3Q456 1 242 0H28V46H61Q103 47 112 49T131 61V622ZM511 513Q511 560 485 594T416 636Q415 636 403 636T371 636T333 637Q266 637 251 636T232 628Q229 624 229 499V374H312L396 375L406 377Q410 378 417 380T442 393T474 417T499 456T511 513ZM537 188Q537 239 509 282T430 336L329 337H229V200V116Q229 57 234 52Q240 47 334 47H383Q425 47 443 53Q486 67 511 104T537 188",
        67: "56 342Q56 428 89 500T174 615T283 681T391 705Q394 705 400 705T408 704Q499 704 569 636L582 624L612 663Q639 700 643 704Q644 704 647 704T653 705H657Q660 705 666 699V419L660 413H626Q620 419 619 430Q610 512 571 572T476 651Q457 658 426 658Q322 658 252 588Q173 509 173 342Q173 221 211 151Q232 111 263 84T328 45T384 29T428 24Q517 24 571 93T626 244Q626 251 632 257H660L666 251V236Q661 133 590 56T403 -21Q262 -21 159 83T56 342",
        68: "130 622Q123 629 119 631T103 634T60 637H27V683H228Q399 682 419 682T461 676Q504 667 546 641T626 573T685 470T708 336Q708 210 634 116T442 3Q429 1 228 0H27V46H60Q102 47 111 49T130 61V622ZM593 338Q593 439 571 501T493 602Q439 637 355 637H322H294Q238 637 234 628Q231 624 231 344Q231 62 232 59Q233 49 248 48T339 46H350Q456 46 515 95Q561 133 577 191T593 338",
        69: "128 619Q121 626 117 628T101 631T58 634H25V680H597V676Q599 670 611 560T625 444V440H585V444Q584 447 582 465Q578 500 570 526T553 571T528 601T498 619T457 629T411 633T353 634Q266 634 251 633T233 622Q233 622 233 621Q232 619 232 497V376H286Q359 378 377 385Q413 401 416 469Q416 471 416 473V493H456V213H416V233Q415 268 408 288T383 317T349 328T297 330Q290 330 286 330H232V196V114Q232 57 237 52Q243 47 289 47H340H391Q428 47 452 50T505 62T552 92T584 146Q594 172 599 200T607 247T612 270V273H652V270Q651 267 632 137T610 3V0H25V46H58Q100 47 109 49T128 61V619",
        70: "128 619Q121 626 117 628T101 631T58 634H25V680H582V676Q584 670 596 560T610 444V440H570V444Q563 493 561 501Q555 538 543 563T516 601T477 622T431 631T374 633H334H286Q252 633 244 631T233 621Q232 619 232 490V363H284Q287 363 303 363T327 364T349 367T372 373T389 385Q407 403 410 459V480H450V200H410V221Q407 276 389 296Q381 303 371 307T348 313T327 316T303 317T284 317H232V189L233 61Q240 54 245 52T270 48T333 46H360V0H348Q324 3 182 3Q51 3 36 0H25V46H58Q100 47 109 49T128 61V619",
        71: "56 342Q56 428 89 500T174 615T283 681T391 705Q394 705 400 705T408 704Q499 704 569 636L582 624L612 663Q639 700 643 704Q644 704 647 704T653 705H657Q660 705 666 699V419L660 413H626Q620 419 619 430Q610 512 571 572T476 651Q457 658 426 658Q401 658 376 654T316 633T254 592T205 519T177 411Q173 369 173 335Q173 259 192 201T238 111T302 58T370 31T431 24Q478 24 513 45T559 100Q562 110 562 160V212Q561 213 557 216T551 220T542 223T526 225T502 226T463 227H437V273H449L609 270Q715 270 727 273H735V227H721Q674 227 668 215Q666 211 666 108V6Q660 0 657 0Q653 0 639 10Q617 25 600 42L587 54Q571 27 524 3T406 -22Q317 -22 238 22T108 151T56 342",
        72: "128 622Q121 629 117 631T101 634T58 637H25V683H36Q57 680 180 680Q315 680 324 683H335V637H302Q262 636 251 634T233 622L232 500V378H517V622Q510 629 506 631T490 634T447 637H414V683H425Q446 680 569 680Q704 680 713 683H724V637H691Q651 636 640 634T622 622V61Q628 51 639 49T691 46H724V0H713Q692 3 569 3Q434 3 425 0H414V46H447Q489 47 498 49T517 61V332H232V197L233 61Q239 51 250 49T302 46H335V0H324Q303 3 180 3Q45 3 36 0H25V46H58Q100 47 109 49T128 61V622",
        73: "328 0Q307 3 180 3T32 0H21V46H43Q92 46 106 49T126 60Q128 63 128 342Q128 620 126 623Q122 628 118 630T96 635T43 637H21V683H32Q53 680 180 680T328 683H339V637H317Q268 637 254 634T234 623Q232 620 232 342Q232 63 234 60Q238 55 242 53T264 48T317 46H339V0H328",
        74: "89 177Q115 177 133 160T152 112Q152 88 137 72T102 52Q99 51 101 49Q106 43 129 29Q159 15 190 15Q232 15 256 48T286 126Q286 127 286 142T286 183T286 238T287 306T287 378Q287 403 287 429T287 479T287 524T286 563T286 593T286 614V621Q281 630 263 633T182 637H154V683H166Q187 680 332 680Q439 680 457 683H465V637H449Q422 637 401 634Q393 631 389 623Q388 621 388 376T387 123Q377 61 322 20T194 -22Q188 -22 177 -21T160 -20Q96 -9 61 29T25 110Q25 144 44 160T89 177",
        75: "128 622Q121 629 117 631T101 634T58 637H25V683H36Q57 680 180 680Q315 680 324 683H335V637H313Q235 637 233 620Q232 618 232 462L233 307L379 449Q425 494 479 546Q518 584 524 591T531 607V608Q531 630 503 636Q501 636 498 636T493 637H489V683H499Q517 680 630 680Q704 680 716 683H722V637H708Q633 633 589 597Q584 592 495 506T406 419T515 254T631 80Q644 60 662 54T715 46H736V0H728Q719 3 615 3Q493 3 472 0H461V46H469Q515 46 515 72Q515 78 512 84L336 351Q332 348 278 296L232 251V156Q232 62 235 58Q243 47 302 46H335V0H324Q303 3 180 3Q45 3 36 0H25V46H58Q100 47 109 49T128 61V622",
        76: "128 622Q121 629 117 631T101 634T58 637H25V683H36Q48 680 182 680Q324 680 348 683H360V637H333Q273 637 258 635T233 622L232 342V129Q232 57 237 52Q243 47 313 47Q384 47 410 53Q470 70 498 110T536 221Q536 226 537 238T540 261T542 272T562 273H582V268Q580 265 568 137T554 5V0H25V46H58Q100 47 109 49T128 61V622",
        77: "132 622Q125 629 121 631T105 634T62 637H29V683H135Q221 683 232 682T249 675Q250 674 354 398L458 124L562 398Q666 674 668 675Q671 681 683 682T781 683H887V637H854Q814 636 803 634T785 622V61Q791 51 802 49T854 46H887V0H876Q855 3 736 3Q605 3 596 0H585V46H618Q660 47 669 49T688 61V347Q688 424 688 461T688 546T688 613L687 632Q454 14 450 7Q446 1 430 1T410 7Q409 9 292 316L176 624V606Q175 588 175 543T175 463T175 356L176 86Q187 50 261 46H278V0H269Q254 3 154 3Q52 3 37 0H29V46H46Q78 48 98 56T122 69T132 86V622",
        78: "42 46Q74 48 94 56T118 69T128 86V634H124Q114 637 52 637H25V683H232L235 680Q237 679 322 554T493 303L578 178V598Q572 608 568 613T544 627T492 637H475V683H483Q498 680 600 680Q706 680 715 683H724V637H707Q634 633 622 598L621 302V6L614 0H600Q585 0 582 3T481 150T282 443T171 605V345L172 86Q183 50 257 46H274V0H265Q250 3 150 3Q48 3 33 0H25V46H42",
        79: "56 340Q56 423 86 494T164 610T270 680T388 705Q521 705 621 601T722 341Q722 260 693 191T617 75T510 4T388 -22T267 3T160 74T85 189T56 340ZM467 647Q426 665 388 665Q360 665 331 654T269 620T213 549T179 439Q174 411 174 354Q174 144 277 61Q327 20 385 20H389H391Q474 20 537 99Q603 188 603 354Q603 411 598 439Q577 592 467 647",
        80: "130 622Q123 629 119 631T103 634T60 637H27V683H214Q237 683 276 683T331 684Q419 684 471 671T567 616Q624 563 624 489Q624 421 573 372T451 307Q429 302 328 301H234V181Q234 62 237 58Q245 47 304 46H337V0H326Q305 3 182 3Q47 3 38 0H27V46H60Q102 47 111 49T130 61V622ZM507 488Q507 514 506 528T500 564T483 597T450 620T397 635Q385 637 307 637H286Q237 637 234 628Q231 624 231 483V342H302H339Q390 342 423 349T481 382Q507 411 507 488",
        81: "56 341Q56 499 157 602T388 705Q521 705 621 601T722 341Q722 275 703 218T660 127T603 63T555 25T525 9Q524 8 524 8H523Q524 5 526 -1T537 -21T555 -47T581 -67T615 -76Q653 -76 678 -56T706 -3Q707 10 716 10Q721 10 728 5L727 -13Q727 -88 697 -140T606 -193Q563 -193 538 -166T498 -83Q483 -23 483 -8L471 -11Q459 -14 435 -18T388 -22Q254 -22 155 81T56 341ZM607 339Q607 429 586 496T531 598T461 649T390 665T318 649T248 598T192 496T170 339Q170 143 277 57Q301 39 305 39L304 42Q304 44 304 46Q301 53 301 68Q301 101 325 128T391 155Q454 155 495 70L501 58Q549 91 578 164Q607 234 607 339ZM385 18Q404 18 425 23T459 33T472 40Q471 47 468 57T449 88T412 115Q398 117 386 117Q367 117 353 102T338 67Q338 48 351 33T385 18",
        82: "130 622Q123 629 119 631T103 634T60 637H27V683H202H236H300Q376 683 417 677T500 648Q595 600 609 517Q610 512 610 501Q610 468 594 439T556 392T511 361T472 343L456 338Q459 335 467 332Q497 316 516 298T545 254T559 211T568 155T578 94Q588 46 602 31T640 16H645Q660 16 674 32T692 87Q692 98 696 101T712 105T728 103T732 90Q732 59 716 27T672 -16Q656 -22 630 -22Q481 -16 458 90Q456 101 456 163T449 246Q430 304 373 320L363 322L297 323H231V192L232 61Q238 51 249 49T301 46H334V0H323Q302 3 181 3Q59 3 38 0H27V46H60Q102 47 111 49T130 61V622ZM491 499V509Q491 527 490 539T481 570T462 601T424 623T362 636Q360 636 340 636T304 637H283Q238 637 234 628Q231 624 231 492V360H289Q390 360 434 378T489 456Q491 467 491 499",
        83: "55 507Q55 590 112 647T243 704H257Q342 704 405 641L426 672Q431 679 436 687T446 700L449 704Q450 704 453 704T459 705H463Q466 705 472 699V462L466 456H448Q437 456 435 459T430 479Q413 605 329 646Q292 662 254 662Q201 662 168 626T135 542Q135 508 152 480T200 435Q210 431 286 412T370 389Q427 367 463 314T500 191Q500 110 448 45T301 -21Q245 -21 201 -4T140 27L122 41Q118 36 107 21T87 -7T78 -21Q76 -22 68 -22H64Q61 -22 55 -16V101Q55 220 56 222Q58 227 76 227H89Q95 221 95 214Q95 182 105 151T139 90T205 42T305 24Q352 24 386 62T420 155Q420 198 398 233T340 281Q284 295 266 300Q261 301 239 306T206 314T174 325T141 343T112 367T85 402Q55 451 55 507",
        84: "36 443Q37 448 46 558T55 671V677H666V671Q667 666 676 556T685 443V437H645V443Q645 445 642 478T631 544T610 593Q593 614 555 625Q534 630 478 630H451H443Q417 630 414 618Q413 616 413 339V63Q420 53 439 50T528 46H558V0H545L361 3Q186 1 177 0H164V46H194Q264 46 283 49T309 63V339V550Q309 620 304 625T271 630H244H224Q154 630 119 601Q101 585 93 554T81 486T76 443V437H36V443",
        85: "128 622Q121 629 117 631T101 634T58 637H25V683H36Q57 680 180 680Q315 680 324 683H335V637H302Q262 636 251 634T233 622L232 418V291Q232 189 240 145T280 67Q325 24 389 24Q454 24 506 64T571 183Q575 206 575 410V598Q569 608 565 613T541 627T489 637H472V683H481Q496 680 598 680T715 683H724V637H707Q634 633 622 598L621 399Q620 194 617 180Q617 179 615 171Q595 83 531 31T389 -22Q304 -22 226 33T130 192Q129 201 128 412V622",
        86: "114 620Q113 621 110 624T107 627T103 630T98 632T91 634T80 635T67 636T48 637H19V683H28Q46 680 152 680Q273 680 294 683H305V637H284Q223 634 223 620Q223 618 313 372T404 126L490 358Q575 588 575 597Q575 616 554 626T508 637H503V683H512Q527 680 627 680Q718 680 724 683H730V637H723Q648 637 627 596Q627 595 515 291T401 -14Q396 -22 382 -22H374H367Q353 -22 348 -14Q346 -12 231 303Q114 617 114 620",
        87: "792 683Q810 680 914 680Q991 680 1003 683H1009V637H996Q931 633 915 598Q912 591 863 438T766 135T716 -17Q711 -22 694 -22Q676 -22 673 -15Q671 -13 593 231L514 477L435 234Q416 174 391 92T358 -6T341 -22H331Q314 -21 310 -15Q309 -14 208 302T104 622Q98 632 87 633Q73 637 35 637H18V683H27Q69 681 154 681Q164 681 181 681T216 681T249 682T276 683H287H298V637H285Q213 637 213 620Q213 616 289 381L364 144L427 339Q490 535 492 546Q487 560 482 578T475 602T468 618T461 628T449 633T433 636T408 637H380V683H388Q397 680 508 680Q629 680 650 683H660V637H647Q576 637 576 619L727 146Q869 580 869 600Q869 605 863 612T839 627T794 637H783V683H792",
        88: "270 0Q252 3 141 3Q46 3 31 0H23V46H40Q129 50 161 88Q165 94 244 216T324 339Q324 341 235 480T143 622Q133 631 119 634T57 637H37V683H46Q64 680 172 680Q297 680 318 683H329V637H324Q307 637 286 632T263 621Q263 618 322 525T384 431Q385 431 437 511T489 593Q490 595 490 599Q490 611 477 622T436 637H428V683H437Q455 680 566 680Q661 680 676 683H684V637H667Q585 634 551 599Q548 596 478 491Q412 388 412 387Q412 385 514 225T620 62Q628 53 642 50T695 46H726V0H717Q699 3 591 3Q466 3 445 0H434V46H440Q454 46 476 51T499 64Q499 67 463 124T390 238L353 295L350 292Q348 290 343 283T331 265T312 236T286 195Q219 88 218 84Q218 70 234 59T272 46H280V0H270",
        89: "518 0Q497 3 374 3Q253 3 232 0H221V46H254Q313 47 321 58Q324 62 324 167V273L221 446Q117 620 114 623Q106 631 91 634T31 637H11V683H20Q29 680 148 680Q273 680 294 683H305V637H287Q239 636 236 621Q236 619 321 475L407 332L483 460Q502 492 527 534Q563 594 563 604Q563 632 517 637H508V683H517H525Q533 683 545 683T571 682T600 681T626 681Q695 681 731 683H738V637H723Q640 633 613 588Q612 587 517 427L425 273V169V95Q425 66 428 59T444 49Q459 46 506 46H528V0H518",
        90: "69 443Q69 452 74 554T80 683H549Q555 677 555 664Q555 649 554 648Q552 645 366 348T179 50T192 49T263 49H275H302Q333 49 353 50T401 59T447 78T482 115T507 173Q513 200 520 273V282H560V274Q560 272 552 143T543 8V0H302L61 1L58 3Q55 8 55 21V35Q59 43 153 193T340 489T432 637H343Q259 637 214 625T141 573Q109 523 109 445Q109 443 89 443H69",
        91: "118 -250V750H255V710H158V-210H255V-250H118",
        92: "56 731Q56 740 62 745T75 750Q85 750 92 740Q96 733 270 255T444 -231Q444 -239 438 -244T424 -250Q414 -250 407 -240Q404 -236 230 242T56 731",
        93: "22 710V750H159V-250H22V-210H119V710H22",
        94: "112 560L249 694L257 686Q387 562 387 560L361 531Q359 532 303 581L250 627L195 580Q182 569 169 557T148 538L140 532Q138 530 125 546L112 560",
        95: "0 -62V-25H499V-62H0",
        96: "106 655Q106 671 119 685T150 699Q166 699 177 688Q190 671 222 629T275 561T295 533T282 519L267 505L196 563Q119 626 113 634Q106 643 106 655",
        97: "137 305T115 305T78 320T63 359Q63 394 97 421T218 448Q291 448 336 416T396 340Q401 326 401 309T402 194V124Q402 76 407 58T428 40Q443 40 448 56T453 109V145H493V106Q492 66 490 59Q481 29 455 12T400 -6T353 12T329 54V58L327 55Q325 52 322 49T314 40T302 29T287 17T269 6T247 -2T221 -8T190 -11Q130 -11 82 20T34 107Q34 128 41 147T68 188T116 225T194 253T304 268H318V290Q318 324 312 340Q290 411 215 411Q197 411 181 410T156 406T148 403Q170 388 170 359Q170 334 154 320ZM126 106Q126 75 150 51T209 26Q247 26 276 49T315 109Q317 116 318 175Q318 233 317 233Q309 233 296 232T251 223T193 203T147 166T126 106",
        98: "307 -11Q234 -11 168 55L158 37Q156 34 153 28T147 17T143 10L138 1L118 0H98V298Q98 599 97 603Q94 622 83 628T38 637H20V660Q20 683 22 683L32 684Q42 685 61 686T98 688Q115 689 135 690T165 693T176 694H179V543Q179 391 180 391L183 394Q186 397 192 401T207 411T228 421T254 431T286 439T323 442Q401 442 461 379T522 216Q522 115 458 52T307 -11ZM182 98Q182 97 187 90T196 79T206 67T218 55T233 44T250 35T271 29T295 26Q330 26 363 46T412 113Q424 148 424 212Q424 287 412 323Q385 405 300 405Q270 405 239 390T188 347L182 339V98",
        99: "370 305T349 305T313 320T297 358Q297 381 312 396Q317 401 317 402T307 404Q281 408 258 408Q209 408 178 376Q131 329 131 219Q131 137 162 90Q203 29 272 29Q313 29 338 55T374 117Q376 125 379 127T395 129H409Q415 123 415 120Q415 116 411 104T395 71T366 33T318 2T249 -11Q163 -11 99 53T34 214Q34 318 99 383T250 448T370 421T404 357Q404 334 387 320",
        100: "376 495Q376 511 376 535T377 568Q377 613 367 624T316 637H298V660Q298 683 300 683L310 684Q320 685 339 686T376 688Q393 689 413 690T443 693T454 694H457V390Q457 84 458 81Q461 61 472 55T517 46H535V0Q533 0 459 -5T380 -11H373V44L365 37Q307 -11 235 -11Q158 -11 96 50T34 215Q34 315 97 378T244 442Q319 442 376 393V495ZM373 342Q328 405 260 405Q211 405 173 369Q146 341 139 305T131 211Q131 155 138 120T173 59Q203 26 251 26Q322 26 373 103V342",
        101: "28 218Q28 273 48 318T98 391T163 433T229 448Q282 448 320 430T378 380T406 316T415 245Q415 238 408 231H126V216Q126 68 226 36Q246 30 270 30Q312 30 342 62Q359 79 369 104L379 128Q382 131 395 131H398Q415 131 415 121Q415 117 412 108Q393 53 349 21T250 -11Q155 -11 92 58T28 218ZM333 275Q322 403 238 411H236Q228 411 220 410T195 402T166 381T143 340T127 274V267H333V275",
        102: "273 0Q255 3 146 3Q43 3 34 0H26V46H42Q70 46 91 49Q99 52 103 60Q104 62 104 224V385H33V431H104V497L105 564L107 574Q126 639 171 668T266 704Q267 704 275 704T289 705Q330 702 351 679T372 627Q372 604 358 590T321 576T284 590T270 627Q270 647 288 667H284Q280 668 273 668Q245 668 223 647T189 592Q183 572 182 497V431H293V385H185V225Q185 63 186 61T189 57T194 54T199 51T206 49T213 48T222 47T231 47T241 46T251 46H282V0H273",
        103: "329 409Q373 453 429 453Q459 453 472 434T485 396Q485 382 476 371T449 360Q416 360 412 390Q410 404 415 411Q415 412 416 414V415Q388 412 363 393Q355 388 355 386Q355 385 359 381T368 369T379 351T388 325T392 292Q392 230 343 187T222 143Q172 143 123 171Q112 153 112 133Q112 98 138 81Q147 75 155 75T227 73Q311 72 335 67Q396 58 431 26Q470 -13 470 -72Q470 -139 392 -175Q332 -206 250 -206Q167 -206 107 -175Q29 -140 29 -75Q29 -39 50 -15T92 18L103 24Q67 55 67 108Q67 155 96 193Q52 237 52 292Q52 355 102 398T223 442Q274 442 318 416L329 409ZM299 343Q294 371 273 387T221 404Q192 404 171 388T145 343Q142 326 142 292Q142 248 149 227T179 192Q196 182 222 182Q244 182 260 189T283 207T294 227T299 242Q302 258 302 292T299 343ZM403 -75Q403 -50 389 -34T348 -11T299 -2T245 0H218Q151 0 138 -6Q118 -15 107 -34T95 -74Q95 -84 101 -97T122 -127T170 -155T250 -167Q319 -167 361 -139T403 -75",
        104: "41 46H55Q94 46 102 60V68Q102 77 102 91T102 124T102 167T103 217T103 272T103 329Q103 366 103 407T103 482T102 542T102 586T102 603Q99 622 88 628T43 637H25V660Q25 683 27 683L37 684Q47 685 66 686T103 688Q120 689 140 690T170 693T181 694H184V367Q244 442 328 442Q451 442 463 329Q464 322 464 190V104Q464 66 466 59T477 49Q498 46 526 46H542V0H534L510 1Q487 2 460 2T422 3Q319 3 310 0H302V46H318Q379 46 379 62Q380 64 380 200Q379 335 378 343Q372 371 358 385T334 402T308 404Q263 404 229 370Q202 343 195 315T187 232V168V108Q187 78 188 68T191 55T200 49Q221 46 249 46H265V0H257L234 1Q210 2 183 2T145 3Q42 3 33 0H25V46H41",
        105: "69 609Q69 637 87 653T131 669Q154 667 171 652T188 609Q188 579 171 564T129 549Q104 549 87 564T69 609ZM247 0Q232 3 143 3Q132 3 106 3T56 1L34 0H26V46H42Q70 46 91 49Q100 53 102 60T104 102V205V293Q104 345 102 359T88 378Q74 385 41 385H30V408Q30 431 32 431L42 432Q52 433 70 434T106 436Q123 437 142 438T171 441T182 442H185V62Q190 52 197 50T232 46H255V0H247",
        106: "98 609Q98 637 116 653T160 669Q183 667 200 652T217 609Q217 579 200 564T158 549Q133 549 116 564T98 609ZM28 -163Q58 -168 64 -168Q124 -168 135 -77Q137 -65 137 141T136 353Q132 371 120 377T72 385H52V408Q52 431 54 431L58 432Q62 432 70 432T87 433T108 434T133 436Q151 437 171 438T202 441T214 442H218V184Q217 -36 217 -59T211 -98Q195 -145 153 -175T58 -205Q9 -205 -23 -179T-55 -117Q-55 -94 -40 -79T-2 -64T36 -79T52 -118Q52 -143 28 -163",
        107: "36 46H50Q89 46 97 60V68Q97 77 97 91T97 124T98 167T98 217T98 272T98 329Q98 366 98 407T98 482T98 542T97 586T97 603Q94 622 83 628T38 637H20V660Q20 683 22 683L32 684Q42 685 61 686T98 688Q115 689 135 690T165 693T176 694H179V463L180 233L240 287Q300 341 304 347Q310 356 310 364Q310 383 289 385H284V431H293Q308 428 412 428Q475 428 484 431H489V385H476Q407 380 360 341Q286 278 286 274Q286 273 349 181T420 79Q434 60 451 53T500 46H511V0H505Q496 3 418 3Q322 3 307 0H299V46H306Q330 48 330 65Q330 72 326 79Q323 84 276 153T228 222L176 176V120V84Q176 65 178 59T189 49Q210 46 238 46H254V0H246Q231 3 137 3T28 0H20V46H36",
        108: "42 46H56Q95 46 103 60V68Q103 77 103 91T103 124T104 167T104 217T104 272T104 329Q104 366 104 407T104 482T104 542T103 586T103 603Q100 622 89 628T44 637H26V660Q26 683 28 683L38 684Q48 685 67 686T104 688Q121 689 141 690T171 693T182 694H185V379Q185 62 186 60Q190 52 198 49Q219 46 247 46H263V0H255L232 1Q209 2 183 2T145 3T107 3T57 1L34 0H26V46H42",
        109: "41 46H55Q94 46 102 60V68Q102 77 102 91T102 122T103 161T103 203Q103 234 103 269T102 328V351Q99 370 88 376T43 385H25V408Q25 431 27 431L37 432Q47 433 65 434T102 436Q119 437 138 438T167 441T178 442H181V402Q181 364 182 364T187 369T199 384T218 402T247 421T285 437Q305 442 336 442Q351 442 364 440T387 434T406 426T421 417T432 406T441 395T448 384T452 374T455 366L457 361L460 365Q463 369 466 373T475 384T488 397T503 410T523 422T546 432T572 439T603 442Q729 442 740 329Q741 322 741 190V104Q741 66 743 59T754 49Q775 46 803 46H819V0H811L788 1Q764 2 737 2T699 3Q596 3 587 0H579V46H595Q656 46 656 62Q657 64 657 200Q656 335 655 343Q649 371 635 385T611 402T585 404Q540 404 506 370Q479 343 472 315T464 232V168V108Q464 78 465 68T468 55T477 49Q498 46 526 46H542V0H534L510 1Q487 2 460 2T422 3Q319 3 310 0H302V46H318Q379 46 379 62Q380 64 380 200Q379 335 378 343Q372 371 358 385T334 402T308 404Q263 404 229 370Q202 343 195 315T187 232V168V108Q187 78 188 68T191 55T200 49Q221 46 249 46H265V0H257L234 1Q210 2 183 2T145 3Q42 3 33 0H25V46H41",
        110: "41 46H55Q94 46 102 60V68Q102 77 102 91T102 122T103 161T103 203Q103 234 103 269T102 328V351Q99 370 88 376T43 385H25V408Q25 431 27 431L37 432Q47 433 65 434T102 436Q119 437 138 438T167 441T178 442H181V402Q181 364 182 364T187 369T199 384T218 402T247 421T285 437Q305 442 336 442Q450 438 463 329Q464 322 464 190V104Q464 66 466 59T477 49Q498 46 526 46H542V0H534L510 1Q487 2 460 2T422 3Q319 3 310 0H302V46H318Q379 46 379 62Q380 64 380 200Q379 335 378 343Q372 371 358 385T334 402T308 404Q263 404 229 370Q202 343 195 315T187 232V168V108Q187 78 188 68T191 55T200 49Q221 46 249 46H265V0H257L234 1Q210 2 183 2T145 3Q42 3 33 0H25V46H41",
        111: "28 214Q28 309 93 378T250 448Q340 448 405 380T471 215Q471 120 407 55T250 -10Q153 -10 91 57T28 214ZM250 30Q372 30 372 193V225V250Q372 272 371 288T364 326T348 362T317 390T268 410Q263 411 252 411Q222 411 195 399Q152 377 139 338T126 246V226Q126 130 145 91Q177 30 250 30",
        112: "36 -148H50Q89 -148 97 -134V-126Q97 -119 97 -107T97 -77T98 -38T98 6T98 55T98 106Q98 140 98 177T98 243T98 296T97 335T97 351Q94 370 83 376T38 385H20V408Q20 431 22 431L32 432Q42 433 61 434T98 436Q115 437 135 438T165 441T176 442H179V416L180 390L188 397Q247 441 326 441Q407 441 464 377T522 216Q522 115 457 52T310 -11Q242 -11 190 33L182 40V-45V-101Q182 -128 184 -134T195 -145Q216 -148 244 -148H260V-194H252L228 -193Q205 -192 178 -192T140 -191Q37 -191 28 -194H20V-148H36ZM424 218Q424 292 390 347T305 402Q234 402 182 337V98Q222 26 294 26Q345 26 384 80T424 218",
        113: "33 218Q33 308 95 374T236 441H246Q330 441 381 372L387 364Q388 364 404 403L420 442H457V156Q457 -132 458 -134Q462 -142 470 -145Q491 -148 519 -148H535V-194H527L504 -193Q480 -192 453 -192T415 -191Q312 -191 303 -194H295V-148H311Q339 -148 360 -145Q369 -141 371 -135T373 -106V-41V49Q313 -11 236 -11Q154 -11 94 53T33 218ZM376 300Q346 389 278 401Q275 401 269 401T261 402Q211 400 171 350T131 214Q131 137 165 82T253 27Q296 27 328 54T376 118V300",
        114: "36 46H50Q89 46 97 60V68Q97 77 97 91T98 122T98 161T98 203Q98 234 98 269T98 328L97 351Q94 370 83 376T38 385H20V408Q20 431 22 431L32 432Q42 433 60 434T96 436Q112 437 131 438T160 441T171 442H174V373Q213 441 271 441H277Q322 441 343 419T364 373Q364 352 351 337T313 322Q288 322 276 338T263 372Q263 381 265 388T270 400T273 405Q271 407 250 401Q234 393 226 386Q179 341 179 207V154Q179 141 179 127T179 101T180 81T180 66V61Q181 59 183 57T188 54T193 51T200 49T207 48T216 47T225 47T235 46T245 46H276V0H267Q249 3 140 3Q37 3 28 0H20V46H36",
        115: "295 316Q295 356 268 385T190 414Q154 414 128 401Q98 382 98 349Q97 344 98 336T114 312T157 287Q175 282 201 278T245 269T277 256Q294 248 310 236T342 195T359 133Q359 71 321 31T198 -10H190Q138 -10 94 26L86 19L77 10Q71 4 65 -1L54 -11H46H42Q39 -11 33 -5V74V132Q33 153 35 157T45 162H54Q66 162 70 158T75 146T82 119T101 77Q136 26 198 26Q295 26 295 104Q295 133 277 151Q257 175 194 187T111 210Q75 227 54 256T33 318Q33 357 50 384T93 424T143 442T187 447H198Q238 447 268 432L283 424L292 431Q302 440 314 448H322H326Q329 448 335 442V310L329 304H301Q295 310 295 316",
        116: "27 422Q80 426 109 478T141 600V615H181V431H316V385H181V241Q182 116 182 100T189 68Q203 29 238 29Q282 29 292 100Q293 108 293 146V181H333V146V134Q333 57 291 17Q264 -10 221 -10Q187 -10 162 2T124 33T105 68T98 100Q97 107 97 248V385H18V422H27",
        117: "383 58Q327 -10 256 -10H249Q124 -10 105 89Q104 96 103 226Q102 335 102 348T96 369Q86 385 36 385H25V408Q25 431 27 431L38 432Q48 433 67 434T105 436Q122 437 142 438T172 441T184 442H187V261Q188 77 190 64Q193 49 204 40Q224 26 264 26Q290 26 311 35T343 58T363 90T375 120T379 144Q379 145 379 161T380 201T380 248V315Q380 361 370 372T320 385H302V431Q304 431 378 436T457 442H464V264Q464 84 465 81Q468 61 479 55T524 46H542V0Q540 0 467 -5T390 -11H383V58",
        118: "338 431Q344 429 422 429Q479 429 503 431H508V385H497Q439 381 423 345Q421 341 356 172T288 -2Q283 -11 263 -11Q244 -11 239 -2Q99 359 98 364Q93 378 82 381T43 385H19V431H25L33 430Q41 430 53 430T79 430T104 429T122 428Q217 428 232 431H240V385H226Q187 384 184 370Q184 366 235 234L286 102L377 341V349Q377 363 367 372T349 383T335 385H331V431H338",
        119: "90 368Q84 378 76 380T40 385H18V431H24L43 430Q62 430 84 429T116 428Q206 428 221 431H229V385H215Q177 383 177 368Q177 367 221 239L265 113L339 328L333 345Q323 374 316 379Q308 384 278 385H258V431H264Q270 428 348 428Q439 428 454 431H461V385H452Q404 385 404 369Q404 366 418 324T449 234T481 143L496 100L537 219Q579 341 579 347Q579 363 564 373T530 385H522V431H529Q541 428 624 428Q692 428 698 431H703V385H697Q696 385 691 385T682 384Q635 377 619 334L559 161Q546 124 528 71Q508 12 503 1T487 -11H479Q460 -11 456 -4Q455 -3 407 133L361 267Q359 263 266 -4Q261 -11 243 -11H238Q225 -11 220 -3L90 368",
        120: "201 0Q189 3 102 3Q26 3 17 0H11V46H25Q48 47 67 52T96 61T121 78T139 96T160 122T180 150L226 210L168 288Q159 301 149 315T133 336T122 351T113 363T107 370T100 376T94 379T88 381T80 383Q74 383 44 385H16V431H23Q59 429 126 429Q219 429 229 431H237V385Q201 381 201 369Q201 367 211 353T239 315T268 274L272 270L297 304Q329 345 329 358Q329 364 327 369T322 376T317 380T310 384L307 385H302V431H309Q324 428 408 428Q487 428 493 431H499V385H492Q443 385 411 368Q394 360 377 341T312 257L296 236L358 151Q424 61 429 57T446 50Q464 46 499 46H516V0H510H502Q494 1 482 1T457 2T432 2T414 3Q403 3 377 3T327 1L304 0H295V46H298Q309 46 320 51T331 63Q331 65 291 120L250 175Q249 174 219 133T185 88Q181 83 181 74Q181 63 188 55T206 46Q208 46 208 23V0H201",
        121: "69 -66Q91 -66 104 -80T118 -116Q118 -134 109 -145T91 -160Q84 -163 97 -166Q104 -168 111 -168Q131 -168 148 -159T175 -138T197 -106T213 -75T225 -43L242 0L170 183Q150 233 125 297Q101 358 96 368T80 381Q79 382 78 382Q66 385 34 385H19V431H26L46 430Q65 430 88 429T122 428Q129 428 142 428T171 429T200 430T224 430L233 431H241V385H232Q183 385 185 366L286 112Q286 113 332 227L376 341V350Q376 365 366 373T348 383T334 385H331V431H337H344Q351 431 361 431T382 430T405 429T422 429Q477 429 503 431H508V385H497Q441 380 422 345Q420 343 378 235T289 9T227 -131Q180 -204 113 -204Q69 -204 44 -177T19 -116Q19 -89 35 -78T69 -66",
        122: "42 263Q44 270 48 345T53 423V431H393Q399 425 399 415Q399 403 398 402L381 378Q364 355 331 309T265 220L134 41L182 40H206Q254 40 283 46T331 77Q352 105 359 185L361 201Q361 202 381 202H401V196Q401 195 393 103T384 6V0H209L34 1L31 3Q28 8 28 17Q28 30 29 31T160 210T294 394H236Q169 393 152 388Q127 382 113 367Q89 344 82 264V255H42V263",
        123: "434 -231Q434 -244 428 -250H410Q281 -250 230 -184Q225 -177 222 -172T217 -161T213 -148T211 -133T210 -111T209 -84T209 -47T209 0Q209 21 209 53Q208 142 204 153Q203 154 203 155Q189 191 153 211T82 231Q71 231 68 234T65 250T68 266T82 269Q116 269 152 289T203 345Q208 356 208 377T209 529V579Q209 634 215 656T244 698Q270 724 324 740Q361 748 377 749Q379 749 390 749T408 750H428Q434 744 434 732Q434 719 431 716Q429 713 415 713Q362 710 332 689T296 647Q291 634 291 499V417Q291 370 288 353T271 314Q240 271 184 255L170 250L184 245Q202 239 220 230T262 196T290 137Q291 131 291 1Q291 -134 296 -147Q306 -174 339 -192T415 -213Q429 -213 431 -216Q434 -219 434 -231",
        124: "139 -249H137Q125 -249 119 -235V251L120 737Q130 750 139 750Q152 750 159 735V-235Q151 -249 141 -249H139",
        125: "65 731Q65 745 68 747T88 750Q171 750 216 725T279 670Q288 649 289 635T291 501Q292 362 293 357Q306 312 345 291T417 269Q428 269 431 266T434 250T431 234T417 231Q380 231 345 210T298 157Q293 143 292 121T291 -28V-79Q291 -134 285 -156T256 -198Q202 -250 89 -250Q71 -250 68 -247T65 -230Q65 -224 65 -223T66 -218T69 -214T77 -213Q91 -213 108 -210T146 -200T183 -177T207 -139Q208 -134 209 3L210 139Q223 196 280 230Q315 247 330 250Q305 257 280 270Q225 304 212 352L210 362L209 498Q208 635 207 640Q195 680 154 696T77 713Q68 713 67 716T65 731",
        126: "179 251Q164 251 151 245T131 234T111 215L97 227L83 238Q83 239 95 253T121 283T142 304Q165 318 187 318T253 300T320 282Q335 282 348 288T368 299T388 318L402 306L416 295Q375 236 344 222Q330 215 313 215Q292 215 248 233T179 251",
        160: "",
        163: "699 578Q699 473 635 473Q597 473 595 508Q595 559 654 569V576Q654 619 637 648T581 677Q545 677 513 647T463 561Q460 554 437 464T414 371Q414 370 458 370H502Q508 364 508 362Q505 334 495 324H402L382 241Q377 224 373 206T366 180T361 163T358 151T354 142T350 133T344 120Q340 112 338 107T336 101L354 90Q398 63 422 54T476 44Q515 44 539 73T574 133Q578 144 580 146T598 148Q622 148 622 139Q622 138 620 130Q602 74 555 32T447 -11Q395 -11 317 38L294 51Q271 28 233 9T155 -10Q117 -10 103 5T88 39Q88 73 126 106T224 139Q236 139 247 138T266 134L273 132Q275 132 302 239L323 324H259Q253 330 253 332Q253 350 265 370H300L334 371L355 453Q356 457 360 477T366 501T372 522T379 545T387 565T397 587T409 606T425 627Q453 664 497 689T583 714Q640 714 669 676T699 578ZM245 76Q211 85 195 85Q173 85 158 71T142 42Q142 26 160 26H163Q211 30 245 76",
        165: "515 0Q494 3 374 3Q256 3 235 0H224V46H257Q316 47 324 58Q327 62 327 137V213H133Q121 213 113 213T97 213T86 213T78 213T73 214T70 215T69 216T68 218T67 220Q64 225 66 231T73 240Q76 242 202 242H327V273L247 407H115Q81 407 75 408T67 414Q64 419 66 425T73 434Q76 436 153 436Q228 436 228 437Q227 440 173 530T115 623Q101 637 31 637H11V683H20Q66 681 153 681Q169 681 202 681T262 682L288 683H298V637H280Q230 636 230 621Q230 619 250 584Q255 576 264 561T286 526T305 494L340 437L403 436H467L513 514Q564 596 564 605Q564 608 560 616Q550 634 517 637H508V683H516Q531 680 633 680Q722 680 731 683H738V637H723Q644 632 617 595Q614 591 568 515T521 437T597 436T676 434Q681 432 683 426T682 414T671 409T589 407H503L422 273V242H547Q673 242 676 240Q681 238 683 232T682 220Q682 219 682 218T681 217T679 216T677 215T672 214T664 213T652 213T637 213T616 213H422V139V87Q422 64 425 58T441 49Q456 46 503 46H525V0H515ZM449 406Q449 407 403 407Q358 407 358 406L370 387Q381 368 392 350L404 331Q447 404 449 406",
        168: "95 612Q95 633 112 651T153 669T193 652T210 612Q210 588 194 571T152 554L127 560Q95 577 95 612ZM289 611Q289 634 304 649T335 668Q336 668 340 668T346 669Q369 669 386 652T404 612T387 572T346 554Q323 554 306 570T289 611",
        172: "56 323T56 336T70 356H596Q603 353 611 343V102Q598 89 591 89Q587 89 584 90T579 94T575 98T572 102L571 209V316H70Q56 323 56 336",
        174: "915 266Q915 140 852 38T689 -120T474 -175Q312 -175 188 -71T38 190Q32 220 32 266V287Q32 345 57 416T129 545Q192 624 282 666T464 709Q513 709 522 708Q599 698 665 666T776 590T853 493T900 387T915 287V266ZM875 285Q875 339 853 399T789 517T676 616T519 668Q510 669 465 669Q380 669 299 630T155 514T77 336Q72 312 72 285V266V256Q72 123 163 11Q290 -135 474 -135Q614 -135 727 -46Q875 81 875 266V285ZM276 457Q275 458 274 460T272 463T270 465T267 467T264 469T258 471T252 472T243 473T232 474T218 474H204V514H335Q477 514 499 510Q560 502 610 467T661 375Q661 362 658 350T648 327T635 308T618 292T601 280T583 269T568 262T554 256L547 253Q548 252 556 247T570 237T586 223T602 202T614 174Q616 169 626 123T638 72Q652 23 683 23Q715 23 720 68Q721 78 724 81T740 84T756 82T760 70Q760 47 747 25T715 -7Q700 -14 673 -14Q672 -14 662 -14T643 -12T619 -7T593 2T568 16T547 37T534 67Q531 80 531 97Q531 103 531 116T532 136Q532 218 472 236Q466 238 413 239H360V148L361 58Q366 47 375 44T418 40H432V0H424Q409 3 318 3T212 0H204V40H218Q242 40 253 42T268 47T276 58V457ZM376 473Q365 471 363 464T360 430V366V276H416Q421 276 434 276T453 276T469 277T486 279T501 282T517 287T529 294T542 305Q561 324 561 375Q561 424 545 444T482 472Q478 473 427 474Q415 474 403 474T384 474L376 473",
        175: "69 544V590H430V544H69",
        176: "147 628Q147 669 179 692T244 715Q298 715 325 689T352 629Q352 592 323 567T249 542Q202 542 175 567T147 628ZM313 628Q313 660 300 669T259 678H253Q248 678 242 678T234 679Q217 679 207 674T192 659T188 644T187 629Q187 600 198 590Q210 579 250 579H265Q279 579 288 581T305 595T313 628",
        177: "56 320T56 333T70 353H369V502Q369 651 371 655Q376 666 388 666Q402 666 405 654T409 596V500V353H707Q722 345 722 333Q722 320 707 313H409V40H707Q722 32 722 20T707 0H70Q56 7 56 20T70 40H369V313H70Q56 320 56 333",
        180: "349 699Q367 699 380 686T393 656Q393 651 392 647T387 637T380 627T367 616T351 602T330 585T303 563L232 505L217 519Q203 533 204 533Q204 534 229 567T282 636T313 678L316 681Q318 684 321 686T328 692T337 697T349 699",
        183: "78 250Q78 274 95 292T138 310Q162 310 180 294T199 251Q199 226 182 208T139 190T96 207T78 250",
        215: "630 29Q630 9 609 9Q604 9 587 25T493 118L389 222L284 117Q178 13 175 11Q171 9 168 9Q160 9 154 15T147 29Q147 36 161 51T255 146L359 250L255 354Q174 435 161 449T147 471Q147 480 153 485T168 490Q173 490 175 489Q178 487 284 383L389 278L493 382Q570 459 587 475T609 491Q630 491 630 471Q630 464 620 453T522 355L418 250L522 145Q606 61 618 48T630 29",
        240: "75 566V604Q75 624 79 629T102 635Q124 635 127 629T131 588L133 550L191 588L249 628L231 635Q176 654 124 657Q116 657 106 658L95 659Q94 661 94 687T95 715Q99 717 113 717Q195 717 282 679L309 668L331 681Q351 697 391 721Q428 748 435 748Q437 749 446 749Q470 749 473 746Q478 744 478 681V621Q466 615 456 615Q435 615 424 624L422 661V699L382 675L344 648Q353 639 366 630Q480 538 504 413Q509 393 509 333V313Q509 284 507 257T495 184T466 102T413 33T329 -16Q311 -21 275 -21Q226 -21 195 -10Q150 7 110 50T53 141Q42 179 42 227Q42 332 101 403T245 474Q282 474 314 461T359 436T380 415Q386 405 389 408Q389 426 378 475Q368 505 355 529T329 567T306 590T288 603L282 606L120 501Q116 500 102 500Q84 500 75 506V566ZM388 225Q388 376 309 410Q299 416 273 419Q216 419 191 390Q174 371 168 342T162 218Q162 112 184 79Q212 39 273 39Q312 39 342 62T380 121Q388 159 388 225",
        247: "318 466Q318 500 339 518T386 537Q418 537 438 517T458 466Q458 438 440 417T388 396Q355 396 337 417T318 466ZM56 237T56 250T70 270H706Q721 262 721 250T706 230H70Q56 237 56 250ZM318 34Q318 68 339 86T386 105Q418 105 438 85T458 34Q458 6 440 -15T388 -36Q355 -36 337 -15T318 34",
        305: "247 0Q232 3 143 3Q132 3 106 3T56 1L34 0H26V46H42Q70 46 91 49Q100 53 102 60T104 102V205V293Q104 345 102 359T88 378Q74 385 41 385H30V408Q30 431 32 431L42 432Q52 433 70 434T106 436Q123 437 142 438T171 441T182 442H185V62Q190 52 197 50T232 46H255V0H247",
        567: "28 -163Q58 -168 64 -168Q124 -168 135 -77Q137 -65 137 141T136 353Q132 371 120 377T72 385H52V408Q52 431 54 431L58 432Q62 432 70 432T87 433T108 434T133 436Q151 437 171 438T202 441T214 442H218V184Q217 -36 217 -59T211 -98Q195 -145 153 -175T58 -205Q9 -205 -23 -179T-55 -117Q-55 -94 -40 -79T-2 -64T36 -79T52 -118Q52 -143 28 -163",
        697: "79 43Q73 43 52 49T30 61Q30 68 85 293T146 528Q161 560 198 560Q218 560 240 545T262 501Q262 496 260 486Q259 479 173 263T84 45T79 43",
        710: "112 560L249 694L257 686Q387 562 387 560L361 531Q359 532 303 581L250 627L195 580Q182 569 169 557T148 538L140 532Q138 530 125 546L112 560",
        711: "114 611L127 630L136 644Q138 644 193 612Q248 581 250 581L306 612Q361 644 363 644L385 611L318 562L249 513L114 611",
        713: "69 544V590H430V544H69",
        714: "349 699Q367 699 380 686T393 656Q393 651 392 647T387 637T380 627T367 616T351 602T330 585T303 563L232 505L217 519Q203 533 204 533Q204 534 229 567T282 636T313 678L316 681Q318 684 321 686T328 692T337 697T349 699",
        715: "106 655Q106 671 119 685T150 699Q166 699 177 688Q190 671 222 629T275 561T295 533T282 519L267 505L196 563Q119 626 113 634Q106 643 106 655",
        728: "250 515Q179 515 138 565T92 683V694H129V689Q129 688 129 683T130 675Q137 631 169 599T248 567Q304 567 337 608T370 689V694H407V683Q403 617 361 566T250 515",
        729: "190 609Q190 637 208 653T252 669Q275 667 292 652T309 609Q309 579 292 564T250 549Q225 549 208 564T190 609",
        730: "147 628Q147 669 179 692T244 715Q298 715 325 689T352 629Q352 592 323 567T249 542Q202 542 175 567T147 628ZM313 628Q313 660 300 669T259 678H253Q248 678 242 678T234 679Q217 679 207 674T192 659T188 644T187 629Q187 600 198 590Q210 579 250 579H265Q279 579 288 581T305 595T313 628",
        732: "179 601Q164 601 151 595T131 584T111 565L97 577L83 588Q83 589 95 603T121 633T142 654Q165 668 187 668T253 650T320 632Q335 632 348 638T368 649T388 668L402 656L416 645Q375 586 344 572Q330 565 313 565Q292 565 248 583T179 601",
        768: "-394 655Q-394 671 -381 685T-350 699Q-334 699 -323 688Q-310 671 -278 629T-225 561T-205 533T-218 519L-233 505L-304 563Q-381 626 -387 634Q-394 643 -394 655",
        769: "-151 699Q-133 699 -120 686T-107 656Q-107 651 -108 647T-113 637T-120 627T-133 616T-149 602T-170 585T-197 563L-268 505L-283 519Q-297 533 -296 533Q-296 534 -271 567T-218 636T-187 678L-184 681Q-182 684 -179 686T-172 692T-163 697T-151 699",
        770: "-388 560L-251 694L-243 686Q-113 562 -113 560L-139 531Q-141 532 -197 581L-250 627L-305 580Q-318 569 -331 557T-352 538L-360 532Q-362 530 -375 546L-388 560",
        771: "-321 601Q-336 601 -349 595T-369 584T-389 565L-403 577L-417 588Q-417 589 -405 603T-379 633T-358 654Q-335 668 -313 668T-247 650T-180 632Q-165 632 -152 638T-132 649T-112 668L-98 656L-84 645Q-125 586 -156 572Q-170 565 -187 565Q-208 565 -252 583T-321 601",
        772: "-431 544V590H-70V544H-431",
        774: "-250 515Q-321 515 -362 565T-408 683V694H-371V689Q-371 688 -371 683T-370 675Q-363 631 -331 599T-252 567Q-196 567 -163 608T-130 689V694H-93V683Q-97 617 -139 566T-250 515",
        775: "-310 609Q-310 637 -292 653T-248 669Q-225 667 -208 652T-191 609Q-191 579 -208 564T-250 549Q-275 549 -292 564T-310 609",
        776: "-405 612Q-405 633 -388 651T-347 669T-307 652T-290 612Q-290 588 -306 571T-348 554L-373 560Q-405 577 -405 612ZM-211 611Q-211 634 -196 649T-165 668Q-164 668 -160 668T-154 669Q-131 669 -114 652T-96 612T-113 572T-154 554Q-177 554 -194 570T-211 611",
        778: "-353 628Q-353 669 -321 692T-256 715Q-202 715 -175 689T-148 629Q-148 592 -177 567T-251 542Q-298 542 -325 567T-353 628ZM-187 628Q-187 660 -200 669T-241 678H-247Q-252 678 -258 678T-266 679Q-283 679 -293 674T-308 659T-312 644T-313 629Q-313 600 -302 590Q-290 579 -250 579H-235Q-221 579 -212 581T-195 595T-187 628",
        779: "-292 701Q-278 701 -262 690T-246 658Q-246 649 -250 641Q-252 637 -297 574T-344 510L-378 528Q-378 530 -355 598T-327 676Q-316 701 -292 701ZM-126 701Q-112 701 -96 690T-80 658Q-80 649 -84 641Q-86 637 -131 574T-178 510L-212 528Q-212 530 -189 598T-161 676Q-150 701 -126 701",
        780: "-386 611L-373 630L-364 644Q-362 644 -307 612Q-252 581 -250 581L-194 612Q-139 644 -137 644L-115 611L-182 562L-251 513L-386 611",
        824: "-612 -215T-619 -215T-631 -212T-637 -204T-639 -197Q-639 -190 -634 -183Q-621 -157 -400 274T-176 707Q-173 716 -160 716Q-153 716 -148 712T-142 703T-140 696Q-140 691 -372 241T-608 -212Q-612 -215 -619 -215",
        913: "255 0Q240 3 140 3Q48 3 39 0H32V46H47Q119 49 139 88Q140 91 192 245T295 553T348 708Q351 716 366 716H376Q396 715 400 709Q402 707 508 390L617 67Q624 54 636 51T687 46H717V0H708Q699 3 581 3Q458 3 437 0H427V46H440Q510 46 510 64Q510 66 486 138L462 209H229L209 150Q189 91 189 85Q189 72 209 59T259 46H264V0H255ZM447 255L345 557L244 256Q244 255 345 255H447",
        914: "131 622Q124 629 120 631T104 634T61 637H28V683H229H267H346Q423 683 459 678T531 651Q574 627 599 590T624 512Q624 461 583 419T476 360L466 357Q539 348 595 302T651 187Q651 119 600 67T469 3Q456 1 242 0H28V46H61Q103 47 112 49T131 61V622ZM511 513Q511 560 485 594T416 636Q415 636 403 636T371 636T333 637Q266 637 251 636T232 628Q229 624 229 499V374H312L396 375L406 377Q410 378 417 380T442 393T474 417T499 456T511 513ZM537 188Q537 239 509 282T430 336L329 337H229V200V116Q229 57 234 52Q240 47 334 47H383Q425 47 443 53Q486 67 511 104T537 188",
        915: "128 619Q121 626 117 628T101 631T58 634H25V680H554V676Q556 670 568 560T582 444V440H542V444Q542 445 538 478T523 545T492 598Q454 634 349 634H334Q264 634 249 633T233 621Q232 618 232 339L233 61Q240 54 245 52T270 48T333 46H360V0H348Q324 3 182 3Q51 3 36 0H25V46H58Q100 47 109 49T128 61V619",
        916: "51 0Q46 4 46 7Q46 9 215 357T388 709Q391 716 416 716Q439 716 444 709Q447 705 616 357T786 7Q786 4 781 0H51ZM507 344L384 596L137 92L383 91H630Q630 93 507 344",
        917: "128 619Q121 626 117 628T101 631T58 634H25V680H597V676Q599 670 611 560T625 444V440H585V444Q584 447 582 465Q578 500 570 526T553 571T528 601T498 619T457 629T411 633T353 634Q266 634 251 633T233 622Q233 622 233 621Q232 619 232 497V376H286Q359 378 377 385Q413 401 416 469Q416 471 416 473V493H456V213H416V233Q415 268 408 288T383 317T349 328T297 330Q290 330 286 330H232V196V114Q232 57 237 52Q243 47 289 47H340H391Q428 47 452 50T505 62T552 92T584 146Q594 172 599 200T607 247T612 270V273H652V270Q651 267 632 137T610 3V0H25V46H58Q100 47 109 49T128 61V619",
        918: "69 443Q69 452 74 554T80 683H549Q555 677 555 664Q555 649 554 648Q552 645 366 348T179 50T192 49T263 49H275H302Q333 49 353 50T401 59T447 78T482 115T507 173Q513 200 520 273V282H560V274Q560 272 552 143T543 8V0H302L61 1L58 3Q55 8 55 21V35Q59 43 153 193T340 489T432 637H343Q259 637 214 625T141 573Q109 523 109 445Q109 443 89 443H69",
        919: "128 622Q121 629 117 631T101 634T58 637H25V683H36Q57 680 180 680Q315 680 324 683H335V637H302Q262 636 251 634T233 622L232 500V378H517V622Q510 629 506 631T490 634T447 637H414V683H425Q446 680 569 680Q704 680 713 683H724V637H691Q651 636 640 634T622 622V61Q628 51 639 49T691 46H724V0H713Q692 3 569 3Q434 3 425 0H414V46H447Q489 47 498 49T517 61V332H232V197L233 61Q239 51 250 49T302 46H335V0H324Q303 3 180 3Q45 3 36 0H25V46H58Q100 47 109 49T128 61V622",
        920: "56 340Q56 423 86 494T164 610T270 680T388 705Q521 705 621 601T722 341Q722 260 693 191T617 75T510 4T388 -22T267 3T160 74T85 189T56 340ZM610 339Q610 428 590 495T535 598T463 651T384 668Q332 668 289 638T221 566Q168 485 168 339Q168 274 176 235Q189 158 228 105T324 28Q356 16 388 16Q415 16 442 24T501 54T555 111T594 205T610 339ZM223 263V422H263V388H514V422H554V263H514V297H263V263H223",
        921: "328 0Q307 3 180 3T32 0H21V46H43Q92 46 106 49T126 60Q128 63 128 342Q128 620 126 623Q122 628 118 630T96 635T43 637H21V683H32Q53 680 180 680T328 683H339V637H317Q268 637 254 634T234 623Q232 620 232 342Q232 63 234 60Q238 55 242 53T264 48T317 46H339V0H328",
        922: "128 622Q121 629 117 631T101 634T58 637H25V683H36Q57 680 180 680Q315 680 324 683H335V637H313Q235 637 233 620Q232 618 232 462L233 307L379 449Q425 494 479 546Q518 584 524 591T531 607V608Q531 630 503 636Q501 636 498 636T493 637H489V683H499Q517 680 630 680Q704 680 716 683H722V637H708Q633 633 589 597Q584 592 495 506T406 419T515 254T631 80Q644 60 662 54T715 46H736V0H728Q719 3 615 3Q493 3 472 0H461V46H469Q515 46 515 72Q515 78 512 84L336 351Q332 348 278 296L232 251V156Q232 62 235 58Q243 47 302 46H335V0H324Q303 3 180 3Q45 3 36 0H25V46H58Q100 47 109 49T128 61V622",
        923: "320 708Q326 716 340 716H348H355Q367 716 372 708Q374 706 423 547T523 226T575 62Q581 52 591 50T634 46H661V0H653Q644 3 532 3Q411 3 390 0H379V46H392Q464 46 464 65Q463 70 390 305T316 539L246 316Q177 95 177 84Q177 72 198 59T248 46H253V0H245Q230 3 130 3Q47 3 38 0H32V46H45Q112 51 127 91Q128 92 224 399T320 708",
        924: "132 622Q125 629 121 631T105 634T62 637H29V683H135Q221 683 232 682T249 675Q250 674 354 398L458 124L562 398Q666 674 668 675Q671 681 683 682T781 683H887V637H854Q814 636 803 634T785 622V61Q791 51 802 49T854 46H887V0H876Q855 3 736 3Q605 3 596 0H585V46H618Q660 47 669 49T688 61V347Q688 424 688 461T688 546T688 613L687 632Q454 14 450 7Q446 1 430 1T410 7Q409 9 292 316L176 624V606Q175 588 175 543T175 463T175 356L176 86Q187 50 261 46H278V0H269Q254 3 154 3Q52 3 37 0H29V46H46Q78 48 98 56T122 69T132 86V622",
        925: "42 46Q74 48 94 56T118 69T128 86V634H124Q114 637 52 637H25V683H232L235 680Q237 679 322 554T493 303L578 178V598Q572 608 568 613T544 627T492 637H475V683H483Q498 680 600 680Q706 680 715 683H724V637H707Q634 633 622 598L621 302V6L614 0H600Q585 0 582 3T481 150T282 443T171 605V345L172 86Q183 50 257 46H274V0H265Q250 3 150 3Q48 3 33 0H25V46H42",
        926: "47 509L55 676Q55 677 333 677T611 676L619 509Q619 508 599 508T579 510Q579 529 575 557T564 589Q550 594 333 594T102 589Q95 586 91 558T87 510Q87 508 67 508T47 509ZM139 260V445H179V394H487V445H527V260H487V311H179V260H139ZM50 0L42 180H62Q82 180 82 178Q82 133 89 105Q92 93 95 90T108 86Q137 83 333 83Q530 83 558 86Q568 87 571 90T577 105Q584 133 584 178Q584 180 604 180H624L616 0H50",
        927: "56 340Q56 423 86 494T164 610T270 680T388 705Q521 705 621 601T722 341Q722 260 693 191T617 75T510 4T388 -22T267 3T160 74T85 189T56 340ZM467 647Q426 665 388 665Q360 665 331 654T269 620T213 549T179 439Q174 411 174 354Q174 144 277 61Q327 20 385 20H389H391Q474 20 537 99Q603 188 603 354Q603 411 598 439Q577 592 467 647",
        928: "128 619Q121 626 117 628T101 631T58 634H25V680H724V634H691Q651 633 640 631T622 619V61Q628 51 639 49T691 46H724V0H713Q692 3 569 3Q434 3 425 0H414V46H447Q489 47 498 49T517 61V634H232V348L233 61Q239 51 250 49T302 46H335V0H324Q303 3 180 3Q45 3 36 0H25V46H58Q100 47 109 49T128 61V619",
        929: "130 622Q123 629 119 631T103 634T60 637H27V683H214Q237 683 276 683T331 684Q419 684 471 671T567 616Q624 563 624 489Q624 421 573 372T451 307Q429 302 328 301H234V181Q234 62 237 58Q245 47 304 46H337V0H326Q305 3 182 3Q47 3 38 0H27V46H60Q102 47 111 49T130 61V622ZM507 488Q507 514 506 528T500 564T483 597T450 620T397 635Q385 637 307 637H286Q237 637 234 628Q231 624 231 483V342H302H339Q390 342 423 349T481 382Q507 411 507 488",
        931: "666 247Q664 244 652 126T638 4V0H351Q131 0 95 0T57 5V6Q54 12 57 17L73 36Q89 54 121 90T182 159L305 299L56 644L55 658Q55 677 60 681Q63 683 351 683H638V679Q640 674 652 564T666 447V443H626V447Q618 505 604 543T559 605Q529 626 478 631T333 637H294H189L293 494Q314 465 345 422Q400 346 400 340Q400 338 399 337L154 57Q407 57 428 58Q476 60 508 68T551 83T575 103Q595 125 608 162T624 225L626 251H666V247",
        932: "36 443Q37 448 46 558T55 671V677H666V671Q667 666 676 556T685 443V437H645V443Q645 445 642 478T631 544T610 593Q593 614 555 625Q534 630 478 630H451H443Q417 630 414 618Q413 616 413 339V63Q420 53 439 50T528 46H558V0H545L361 3Q186 1 177 0H164V46H194Q264 46 283 49T309 63V339V550Q309 620 304 625T271 630H244H224Q154 630 119 601Q101 585 93 554T81 486T76 443V437H36V443",
        933: "55 551Q55 604 91 654T194 705Q240 705 277 681T334 624T367 556T385 498L389 474L392 488Q394 501 400 521T414 566T438 615T473 659T521 692T584 705Q620 705 648 689T691 647T714 597T722 551Q722 540 719 538T699 536Q680 536 677 541Q677 542 677 544T676 548Q676 576 650 596T588 616H582Q538 616 505 582Q466 543 454 477T441 318Q441 301 441 269T442 222V61Q448 55 452 53T478 48T542 46H569V0H557Q533 3 389 3T221 0H209V46H236Q256 46 270 46T295 47T311 48T322 51T328 54T332 57T337 61V209Q337 383 333 415Q313 616 189 616Q154 616 128 597T101 548Q101 540 97 538T78 536Q63 536 59 538T55 551",
        934: "312 622Q310 623 307 625T303 629T297 631T286 634T270 635T246 636T211 637H184V683H196Q220 680 361 680T526 683H538V637H511Q468 637 447 635T422 631T411 622V533L425 531Q525 519 595 466T665 342Q665 301 642 267T583 209T506 172T425 152L411 150V61Q417 55 421 53T447 48T511 46H538V0H526Q502 3 361 3T196 0H184V46H211Q231 46 245 46T270 47T286 48T297 51T303 54T307 57T312 61V150H310Q309 151 289 153T232 166T160 195Q149 201 136 210T103 238T69 284T56 342Q56 414 128 467T294 530Q309 532 310 533H312V622ZM170 342Q170 207 307 188H312V495H309Q301 495 282 491T231 469T186 423Q170 389 170 342ZM415 188Q487 199 519 236T551 342Q551 384 539 414T507 459T470 481T434 491T415 495H410V188H415",
        935: "270 0Q252 3 141 3Q46 3 31 0H23V46H40Q129 50 161 88Q165 94 244 216T324 339Q324 341 235 480T143 622Q133 631 119 634T57 637H37V683H46Q64 680 172 680Q297 680 318 683H329V637H324Q307 637 286 632T263 621Q263 618 322 525T384 431Q385 431 437 511T489 593Q490 595 490 599Q490 611 477 622T436 637H428V683H437Q455 680 566 680Q661 680 676 683H684V637H667Q585 634 551 599Q548 596 478 491Q412 388 412 387Q412 385 514 225T620 62Q628 53 642 50T695 46H726V0H717Q699 3 591 3Q466 3 445 0H434V46H440Q454 46 476 51T499 64Q499 67 463 124T390 238L353 295L350 292Q348 290 343 283T331 265T312 236T286 195Q219 88 218 84Q218 70 234 59T272 46H280V0H270",
        936: "340 622Q338 623 335 625T331 629T325 631T314 634T298 635T274 636T239 637H212V683H224Q248 680 389 680T554 683H566V637H539Q479 637 464 635T439 622L438 407Q438 192 439 192Q443 193 449 195T474 207T507 232T536 276T557 344Q560 365 562 417T573 493Q587 536 620 544Q627 546 671 546H715L722 540V515Q714 509 708 509Q680 505 671 476T658 392T644 307Q599 177 451 153L438 151V106L439 61Q446 54 451 52T476 48T539 46H566V0H554Q530 3 389 3T224 0H212V46H239Q259 46 273 46T298 47T314 48T325 51T331 54T335 57T340 61V151Q126 178 117 406Q115 503 69 509Q55 509 55 526Q55 541 59 543T86 546H107H120Q150 546 161 543T184 528Q198 514 204 493Q212 472 213 420T226 316T272 230Q287 216 303 207T330 194L339 192Q340 192 340 407V622",
        937: "55 454Q55 503 75 546T127 617T197 665T272 695T337 704H352Q396 704 404 703Q527 687 596 615T666 454Q666 392 635 330T559 200T499 83V80H543Q589 81 600 83T617 93Q622 102 629 135T636 172L637 177H677V175L660 89Q645 3 644 2V0H552H488Q461 0 456 3T451 20Q451 89 499 235T548 455Q548 512 530 555T483 622T424 656T361 668Q332 668 303 658T243 626T193 560T174 456Q174 380 222 233T270 20Q270 7 263 0H77V2Q76 3 61 89L44 175V177H84L85 172Q85 171 88 155T96 119T104 93Q109 86 120 84T178 80H222V83Q206 132 162 199T87 329T55 454",
        8192: "",
        8193: "",
        8194: "",
        8195: "",
        8196: "",
        8197: "",
        8198: "",
        8201: "",
        8202: "",
        8203: "",
        8204: "",
        8211: "0 248V285H499V248H0",
        8212: "0 248V285H999V248H0",
        8213: "0 248V285H999V248H0",
        8214: "133 736Q138 750 153 750Q164 750 170 739Q172 735 172 250T170 -239Q164 -250 152 -250Q144 -250 138 -244L137 -243Q133 -241 133 -179T132 250Q132 731 133 736ZM329 739Q334 750 346 750Q353 750 361 744L362 743Q366 741 366 679T367 250T367 -178T362 -243L361 -244Q355 -250 347 -250Q335 -250 329 -239Q327 -235 327 250T329 739",
        8215: "0 -62V-25H499V-62H0",
        8216: "64 494Q64 548 86 597T131 670T160 694Q163 694 172 685T182 672Q182 669 170 656T144 625T116 573T101 501Q101 489 102 489T107 491T120 497T138 500Q163 500 180 483T198 440T181 397T139 379Q110 379 87 405T64 494",
        8217: "78 634Q78 659 95 676T138 694Q166 694 189 668T212 579Q212 525 190 476T146 403T118 379Q114 379 105 388T95 401Q95 404 107 417T133 448T161 500T176 572Q176 584 175 584T170 581T157 576T139 573Q114 573 96 590T78 634",
        8220: "128 494Q128 528 137 560T158 616T185 658T209 685T223 694T236 685T245 670Q244 668 231 654T204 622T178 571T164 501Q164 489 165 489T170 491T183 497T201 500Q226 500 244 483T262 440T245 397T202 379Q173 379 151 405T128 494ZM332 494Q332 528 341 560T362 616T389 658T413 685T427 694T439 685T449 672Q449 669 437 656T411 625T383 573T368 501Q368 489 369 489T374 491T387 497T405 500Q430 500 448 483T466 440T449 397T406 379Q377 379 355 405T332 494",
        8221: "34 634Q34 659 50 676T93 694Q121 694 144 668T168 579Q168 525 146 476T101 403T73 379Q69 379 60 388T50 401Q50 404 62 417T88 448T116 500T131 572Q131 584 130 584T125 581T112 576T94 573Q69 573 52 590T34 634ZM238 634Q238 659 254 676T297 694Q325 694 348 668T372 579Q372 525 350 476T305 403T277 379Q273 379 264 388T254 401Q254 404 266 417T292 448T320 500T335 572Q335 584 334 584T329 581T316 576T298 573Q273 573 256 590T238 634",
        8224: "182 675Q195 705 222 705Q234 705 243 700T253 691T263 675L262 655Q262 620 252 549T240 454V449Q250 451 288 461T346 472T377 461T389 431Q389 417 379 404T346 390Q327 390 288 401T243 412H240V405Q245 367 250 339T258 301T261 274T263 225Q263 124 255 -41T239 -213Q236 -216 222 -216H217Q206 -216 204 -212T200 -186Q199 -175 199 -168Q181 38 181 225Q181 265 182 280T191 327T204 405V412H201Q196 412 157 401T98 390Q76 390 66 403T55 431T65 458T98 472Q116 472 155 462T205 449Q204 452 204 460T201 490T193 547Q182 619 182 655V675",
        8225: "181 658Q181 705 222 705T263 658Q263 633 252 572T240 497Q240 496 241 496Q243 496 285 507T345 519Q365 519 376 508T388 478Q388 466 384 458T375 447T361 438H344Q318 438 282 448T241 459Q240 458 240 456Q240 449 251 384T263 297Q263 278 255 267T238 253T222 250T206 252T190 266T181 297Q181 323 192 383T204 458Q204 459 203 459Q198 459 162 449T101 438H84Q74 443 70 446T61 457T56 478Q56 497 67 508T99 519Q117 519 159 508T203 496Q204 496 204 499Q204 507 193 572T181 658ZM181 202Q181 249 222 249T263 202Q263 185 259 161T249 103T240 48V41H243Q248 41 287 52T346 63T377 52T389 22Q389 8 379 -5T346 -19Q327 -19 288 -8T243 3H240V-4Q243 -24 249 -58T259 -117T263 -158Q263 -177 255 -188T238 -202T222 -205T206 -203T190 -189T181 -158Q181 -141 185 -117T195 -59T204 -4V3H201Q196 3 157 -8T98 -19Q76 -19 66 -6T55 22T65 49T98 63Q117 63 156 52T201 41H204V48Q201 68 195 102T185 161T181 202",
        8226: "55 251Q55 328 112 386T249 444T386 388T444 249Q444 171 388 113T250 55Q170 55 113 112T55 251",
        8230: "78 60Q78 84 95 102T138 120Q162 120 180 104T199 61Q199 36 182 18T139 0T96 17T78 60ZM525 60Q525 84 542 102T585 120Q609 120 627 104T646 61Q646 36 629 18T586 0T543 17T525 60ZM972 60Q972 84 989 102T1032 120Q1056 120 1074 104T1093 61Q1093 36 1076 18T1033 0T990 17T972 60",
        8242: "79 43Q73 43 52 49T30 61Q30 68 85 293T146 528Q161 560 198 560Q218 560 240 545T262 501Q262 496 260 486Q259 479 173 263T84 45T79 43",
        8245: "12 501Q12 527 31 542T63 558Q73 560 77 560Q114 560 128 528Q133 518 188 293T244 61Q244 56 223 50T195 43Q192 43 190 45T102 263T14 486Q12 496 12 501",
        8254: "69 544V590H430V544H69",
        8260: "423 750Q432 750 438 744T444 730Q444 725 271 248T92 -240Q85 -250 75 -250Q68 -250 62 -245T56 -231Q56 -221 230 257T407 740Q411 750 423 750",
        8288: "",
        8289: "",
        8290: "",
        8291: "",
        8292: "",
        8407: "377 694Q377 702 382 708T397 714Q404 714 409 709Q414 705 419 690Q429 653 460 633Q471 626 471 615Q471 606 468 603T454 594Q411 572 379 531Q377 529 374 525T369 519T364 517T357 516Q350 516 344 521T337 536Q337 555 384 595H213L42 596Q29 605 29 615Q29 622 42 635H401Q377 673 377 694",
        8450: "684 131Q684 125 672 109T633 71T573 29T489 -5T386 -19Q330 -19 276 -3T174 46T91 134T44 261Q39 283 39 341T44 421Q66 538 143 611T341 699Q344 699 364 700T395 701Q449 698 503 677T585 655Q603 655 611 662T620 678T625 694T639 702Q650 702 657 690V481L653 474Q640 467 628 472Q624 476 618 496T595 541Q562 587 507 625T390 663H381Q337 663 299 625Q212 547 212 336Q212 249 233 179Q274 30 405 30Q533 30 641 130Q658 147 666 147Q671 147 677 143T684 131ZM250 625Q264 643 261 643Q238 635 214 620T161 579T110 510T79 414Q74 384 74 341T79 268Q89 213 113 169T164 101T217 61T260 39L277 34Q270 41 264 48Q199 111 181 254Q178 281 178 344T181 434Q200 559 250 625ZM621 565V625Q617 623 613 623Q603 619 590 619H575L588 605Q608 583 610 579L621 565",
        8459: "331 505Q331 519 382 574T472 629H480Q512 629 529 614T547 576Q547 555 534 532T520 504Q520 493 549 493Q590 493 623 506T668 533L681 546Q731 600 772 641T832 700T852 717Q857 717 860 711T865 697L866 690Q866 688 813 617T708 475T656 403Q682 403 714 404H771L780 416Q1004 707 1167 707Q1209 707 1225 689T1241 646Q1241 604 1209 547T1118 447Q1081 422 1034 405T952 382T888 374T857 370H852L826 334Q733 204 708 144Q691 104 691 76Q691 29 748 29Q768 31 791 48T831 83T862 122T881 146Q883 148 900 148H917Q921 143 921 140T914 127Q810 -8 723 -8Q611 -4 611 100Q611 142 631 191T676 275T721 337T742 367Q716 367 685 366H628L620 355Q618 352 558 268Q486 168 461 141Q405 79 339 34T215 -28Q188 -36 153 -36Q86 -36 58 -11T29 46Q29 82 55 120T123 158Q144 158 154 146T164 119Q164 102 143 89T100 75Q92 75 86 76T77 80T72 82Q67 82 67 60Q67 28 99 14T170 0Q214 0 272 47T419 224L505 340L518 357Q513 357 504 356T467 347T415 330T360 300T308 253Q296 238 295 237H278H274Q256 237 256 243Q256 248 263 256Q291 294 330 321T407 362T476 382T530 393T552 398Q556 402 573 423T600 454Q602 457 604 460T608 465L610 467Q565 455 532 455Q465 455 449 483Q447 487 447 498Q447 513 463 538T479 579Q479 593 463 593Q436 593 385 519Q374 504 371 502T360 499H353H349Q331 499 331 505ZM1195 634Q1195 643 1195 648T1185 662T1157 671Q1130 671 1092 644T1019 579T952 502T901 436L882 409L891 410Q900 411 913 412T934 415Q1081 439 1144 520Q1195 590 1195 634",
        8460: "11 -16L1 0Q7 6 25 27T57 62T91 88T128 101Q159 99 195 66L203 59L211 67Q239 95 239 133Q239 158 210 213T152 330T123 430Q123 477 173 536T269 630T320 666Q376 610 440 606H443Q457 606 466 611T519 647L542 664Q543 664 543 654V643L522 622Q434 537 403 537Q388 537 366 543T329 555T293 570T270 580L261 585L253 574Q206 517 206 475Q206 452 218 416T242 356L255 331Q256 331 270 345T324 391T421 459L437 468H453Q545 463 608 421L618 415L623 392Q644 307 644 233Q644 97 612 9Q604 -10 601 -15T581 -35Q505 -104 467 -124Q446 -133 431 -133Q414 -132 399 -126T376 -115T368 -107Q368 -106 392 -75L415 -43Q432 -67 444 -73T472 -79H474Q479 -79 484 -78T501 -69T521 -50T538 -13T551 46Q558 97 558 180Q558 232 557 245Q553 277 547 300T528 349T488 389T424 404Q344 404 276 295Q272 288 273 285Q300 216 300 168Q300 161 300 156T298 145T297 137T293 129T289 123T283 116T277 107Q212 23 178 -13L166 -26L149 -9Q108 32 81 32Q63 32 21 -7L11 -16",
        8461: "14 666Q14 675 26 683H344L351 679Q361 665 351 655Q344 648 317 648Q287 645 282 641Q270 637 269 623T266 497V370H511V497Q511 519 510 553Q509 615 507 626T496 641H495Q489 645 459 648Q420 648 420 665Q420 672 426 679L433 683H751Q762 676 762 666Q762 648 724 648Q684 645 677 632Q675 626 675 341Q675 57 677 52Q684 38 724 35Q762 35 762 16Q762 6 751 -1H433L426 3Q420 10 420 17Q420 35 459 35Q501 38 506 52Q511 64 511 190V323H266V190Q266 60 271 52Q276 38 317 35Q342 35 351 28Q360 17 351 3L344 -1H26Q14 5 14 16Q14 35 53 35Q94 38 99 52Q104 60 104 341T99 632Q93 645 53 648Q14 648 14 666ZM233 341V553Q233 635 239 648H131Q134 641 135 638T137 603T139 517T139 341Q139 131 138 89T132 37Q131 36 131 35H239Q233 47 233 129V341ZM639 341V489Q639 548 639 576T640 620T642 639T646 648H537L542 639Q546 625 546 341Q546 130 545 88T538 37Q537 36 537 35H646Q643 41 643 42T641 55T639 84T639 140V341",
        8462: "137 683Q138 683 209 688T282 694Q294 694 294 685Q294 674 258 534Q220 386 220 383Q220 381 227 388Q288 442 357 442Q411 442 444 415T478 336Q478 285 440 178T402 50Q403 36 407 31T422 26Q450 26 474 56T513 138Q516 149 519 151T535 153Q555 153 555 145Q555 144 551 130Q535 71 500 33Q466 -10 419 -10H414Q367 -10 346 17T325 74Q325 90 361 192T398 345Q398 404 354 404H349Q266 404 205 306L198 293L164 158Q132 28 127 16Q114 -11 83 -11Q69 -11 59 -2T48 16Q48 30 121 320L195 616Q195 629 188 632T149 637H128Q122 643 122 645T124 664Q129 683 137 683",
        8463: "150 475Q147 475 118 466T82 457Q73 457 64 467T54 487Q54 490 55 492Q63 506 64 506Q67 512 118 526Q162 541 169 546Q173 559 175 575Q181 596 181 604Q181 613 166 617Q164 617 153 618T135 619Q119 619 114 621T109 630Q109 636 114 656T122 681Q125 685 202 688Q272 695 286 695Q304 695 304 684Q304 682 291 628L278 577L386 612Q466 635 476 635T492 627T499 607Q499 593 489 586Q485 583 373 546L262 512Q262 511 248 455T233 397T236 397T244 404Q295 441 357 441Q405 441 445 417T485 333Q485 284 449 178T412 58T426 44Q447 44 466 68Q485 87 500 130L509 152H531H543Q562 152 562 144Q562 128 546 93T494 23T415 -13Q385 -13 359 3T322 44Q318 52 318 77Q318 99 352 196T386 337Q386 386 346 386Q318 386 286 370Q267 361 245 338T211 292Q207 287 193 235T162 113T138 21Q128 7 122 4Q105 -12 83 -12Q66 -12 54 -2T42 26Q42 45 98 257L151 475H150",
        8464: "487 225Q398 255 398 342Q398 410 455 492Q491 545 552 582T669 636T800 673T918 712Q930 717 933 717Q939 717 942 706T946 689Q946 686 915 664T830 591T729 480Q691 429 657 351T615 260Q628 260 663 279T733 339T769 426Q769 442 767 459T764 479Q764 484 766 486Q769 488 781 493T797 498Q802 498 803 494T808 472Q813 442 813 425Q813 369 761 315Q692 246 605 224L592 220L584 209Q547 155 487 106T358 25Q270 -17 191 -17Q143 -17 101 1T59 59Q59 96 85 127T148 158Q169 158 179 146T189 119Q189 102 167 89T125 75Q116 75 109 77T101 81T97 80Q96 77 96 72Q96 50 123 36T204 21H216Q249 21 302 49T411 134Q439 161 459 187Q487 220 487 225ZM460 334Q460 308 472 290T498 268L510 263Q515 263 545 313T626 438T723 561Q751 589 775 609T808 636T817 644H816Q813 644 732 618Q681 601 645 584T585 548T549 514T518 476Q460 390 460 334",
        8465: "190 601Q161 601 137 587T97 553T71 512T55 477T48 463Q44 465 39 468L30 473L35 488Q73 594 106 636T199 685Q200 686 211 686Q250 686 326 652T417 617Q435 617 455 626T497 652T522 670Q532 660 532 654Q469 591 390 550L378 543L343 556Q223 601 190 601ZM378 208Q378 249 369 318T360 424Q360 430 360 439T361 451L362 462Q416 526 482 571L495 580L503 577L511 575L499 562Q442 502 442 465Q442 436 452 368T462 246Q462 169 442 128T385 56Q292 -26 195 -26Q150 -26 104 14L96 21L43 -16Q43 -15 43 -14T41 -10T38 0L48 13Q76 50 123 97L150 125Q154 131 159 131Q166 131 171 116T182 81T193 53Q199 43 216 33T261 22Q307 22 344 68Q378 113 378 208",
        8466: "572 704Q607 704 607 693Q607 681 590 664H588Q586 664 584 664T578 663Q504 658 434 592T363 457Q363 426 386 401Q417 371 481 361Q490 360 527 360H562Q565 363 595 404T666 494T755 596T854 682T945 717Q986 717 1010 696T1035 637Q1035 593 996 531T873 414Q809 378 753 360T674 338T651 333Q650 333 633 308T588 245T544 185Q498 126 426 78L413 68H414Q498 47 575 47Q626 47 676 74T755 139L762 148H779H783Q802 148 802 142Q802 137 795 129Q760 81 691 33T544 -16Q470 -16 366 20L341 29L331 24Q239 -17 155 -17H141Q90 -17 61 -12T23 1T14 22Q14 44 39 65T103 95Q126 101 180 101Q224 101 258 98T309 90T330 86Q332 86 353 103T389 135Q401 146 412 158T431 179T450 203T466 225T485 252T505 280L535 322H509Q391 322 340 362T289 452Q289 495 321 547T396 630Q438 665 486 684T572 704ZM978 635Q978 644 977 650T973 661T968 668T961 673T954 676T946 678T938 680Q929 680 925 677Q893 659 795 531T682 377Q683 377 711 385T755 401T801 421T856 453T906 495Q927 516 952 557T978 635ZM274 50Q274 51 258 54T216 61T166 65Q160 65 151 65T140 64Q115 58 102 48T88 31Q88 20 159 20Q191 20 219 27T261 42L274 50",
        8467: "345 104T349 104T361 95T369 80T352 59Q268 -20 206 -20Q170 -20 146 3T113 53T99 104L94 129Q94 130 79 116T48 86T28 70Q22 70 15 79T7 94Q7 98 12 103T58 147L91 179V185Q91 186 91 191T92 200Q92 282 128 400T223 612T336 705Q397 705 397 636V627Q397 453 194 233Q185 223 180 218T174 211T171 208T165 201L163 186Q159 142 159 123Q159 17 208 17Q228 17 253 30T293 56T335 94Q345 104 349 104ZM360 634Q360 655 354 661T336 668Q328 668 322 666T302 645T272 592Q252 547 229 467T192 330L179 273Q179 272 186 280T204 300T221 322Q327 453 355 590Q360 612 360 634",
        8469: "20 664Q20 666 31 683H142Q256 683 258 681Q259 680 279 653T342 572T422 468L582 259V425Q582 451 582 490T583 541Q583 611 573 628T522 648Q500 648 493 654Q484 665 493 679L500 683H691Q702 676 702 666Q702 657 698 652Q688 648 680 648Q633 648 627 612Q624 601 624 294V-8Q616 -20 607 -20Q601 -20 596 -15Q593 -13 371 270L156 548L153 319Q153 284 153 234T152 167Q152 103 156 78T172 44T213 34Q236 34 242 28Q253 17 242 3L236 -1H36Q24 6 24 16Q24 34 56 34Q58 35 69 36T86 40T100 50T109 72Q111 83 111 345V603L96 619Q72 643 44 648Q20 648 20 664ZM413 419L240 648H120L136 628Q137 626 361 341T587 54L589 68Q589 78 589 121V192L413 419",
        8472: "300 74Q300 133 338 133Q350 133 356 126T363 109Q363 88 340 76Q340 71 342 62T358 39T393 26Q435 26 474 67T532 182T551 290Q551 325 535 349T484 373Q430 373 378 348T291 289T228 218T187 157T174 130Q254 30 265 10Q276 -15 276 -41Q276 -101 235 -158T142 -216Q112 -216 90 -195T67 -118Q67 -40 104 64L110 81Q81 118 81 174Q81 268 134 360T247 453Q252 453 255 451T258 447L259 445Q259 432 253 420Q251 416 242 416Q209 411 176 341T142 203Q142 193 143 184T146 170T149 165L158 180Q215 280 303 345T485 410Q548 410 586 368T625 255Q625 157 553 74T389 -10H383Q349 -10 325 14Q302 37 300 74ZM105 -123Q105 -134 106 -141T110 -158T122 -173T145 -178Q155 -178 160 -176Q184 -163 199 -132T214 -73Q214 -69 214 -66T213 -59T212 -53T209 -47T205 -41T199 -33T193 -25T184 -14T174 -1L165 10Q156 22 148 32L139 43Q138 43 130 15T113 -54T105 -123",
        8473: "16 666Q16 675 28 683H195Q334 683 370 682T437 672Q511 657 554 611T597 495Q597 343 404 309Q402 308 401 308Q381 303 319 303H261V181Q261 157 262 120Q262 60 267 50T304 36Q310 35 313 35Q352 35 352 17Q352 10 346 3L339 -1H28Q16 5 16 16Q16 35 53 35Q68 36 75 37T87 42T95 52Q98 61 98 341T95 630Q91 640 83 643T53 648Q16 648 16 666ZM235 35Q228 46 227 84Q226 129 226 337V621L230 635L237 648H128Q128 647 133 632Q136 620 136 341Q136 64 133 50L128 35H235ZM301 341H313Q339 341 354 344T389 362T417 410T426 498Q426 586 401 616T322 647Q301 647 293 643Q271 637 264 621Q261 617 261 479V341H301ZM429 350Q431 350 443 353T476 367T515 391T548 432T562 490Q562 550 524 592Q507 607 484 619Q481 621 448 635L433 639L439 621Q462 578 462 506Q462 448 454 413T437 366T428 350H429",
        8474: "480 -10Q480 -13 486 -24T507 -50T541 -80T588 -104T648 -114Q666 -114 688 -110T714 -106Q724 -106 728 -114T729 -130Q723 -145 663 -163T548 -181Q503 -181 463 -169T395 -139T343 -97T307 -56T284 -19L280 -3L262 1Q188 24 131 81Q57 155 37 275Q34 292 34 342T37 410Q58 528 131 601Q179 652 248 676T388 701Q485 701 562 661Q698 595 731 448Q742 410 742 341T731 235Q707 141 646 81Q616 50 575 27T493 -5L480 -10ZM568 342Q568 613 437 659L395 666Q329 666 286 626Q232 570 213 439Q210 408 210 342T213 246Q231 113 286 57Q309 37 342 23Q357 19 389 19Q420 19 437 23Q469 38 491 57Q568 134 568 342ZM174 341V354Q174 393 175 419T183 484T205 561T246 635L249 639Q246 639 224 627T193 608Q189 606 183 601T169 589T155 577Q69 491 69 344Q69 133 231 52Q247 42 247 46Q247 46 246 48Q231 69 222 85T200 141T177 239Q174 269 174 341ZM708 341Q708 410 689 467T640 556T588 606T546 630Q532 638 531 638Q530 638 531 635Q563 590 577 543Q602 472 602 341V316Q602 264 599 230T580 144T531 48Q529 44 532 45T546 52Q575 68 596 84T642 128T683 200T706 299Q708 327 708 341ZM391 -17H333Q329 -15 326 -15Q324 -15 324 -17Q324 -21 362 -68Q424 -130 506 -143Q518 -144 544 -144Q569 -144 577 -143L589 -141L575 -139Q544 -127 509 -101T453 -37L442 -19L391 -17",
        8475: "224 266Q185 266 156 286T127 354Q127 419 176 487T282 594Q346 642 433 679T615 717Q732 717 802 680L815 673Q824 680 840 690T860 700Q864 700 867 693T872 680L873 673Q873 668 858 659L845 651L853 642Q887 605 887 561Q887 500 840 439Q790 379 681 336Q693 312 693 292Q692 276 689 263T672 229T653 198T620 152L575 87Q557 57 557 33Q557 24 560 17T566 8L569 5Q546 5 508 25T470 76Q470 83 473 92T545 198T616 310Q616 317 615 318T612 319Q603 319 575 315H560L545 291Q492 201 429 135T277 23Q202 -17 142 -17H130Q50 -17 16 17Q-2 35 -2 57Q-2 95 24 126T88 158Q106 158 116 147T127 121Q127 110 122 102Q116 93 99 84T63 75Q58 75 53 76T47 77T45 75T44 67Q45 52 57 42T88 27T120 21T144 19Q174 19 208 36T267 76T324 134T369 189T406 239Q462 319 504 374T616 503T755 631L770 644Q767 647 753 654T697 670T602 680Q493 680 399 631T247 516Q218 485 193 440T168 359Q168 328 188 316T234 303Q255 303 273 315T304 340T343 389T390 448Q428 490 441 510T456 548Q456 557 458 559Q459 560 476 567T496 575Q505 575 505 558Q505 511 434 412Q429 406 427 403Q397 360 378 343Q342 308 300 287T224 266ZM819 564Q819 595 800 619L784 606Q729 557 692 512T605 387L591 365L610 364Q622 364 631 363T641 361Q643 361 651 363Q725 388 772 449T819 564ZM794 141Q794 123 725 63T612 3Q609 3 612 5Q612 5 615 7Q639 19 678 57T742 131L755 148H772H780Q794 148 794 141ZM588 -3Q590 0 593 0H594L593 -1Q592 -1 590 -2L588 -3",
        8476: "27 496Q31 569 102 627T234 685Q236 685 241 685T251 686Q287 686 318 672T367 638T399 598T418 564L423 550Q424 554 434 567T463 601T505 639T561 671T626 685Q672 685 688 659T710 572Q713 533 721 523T766 513Q781 513 787 514T794 516Q796 512 798 509T801 504T802 501T787 493Q702 461 624 401L607 389Q655 383 688 358L697 352V342Q699 330 699 297Q704 209 710 173T734 103Q751 69 765 69Q769 69 806 83L824 90V74Q823 73 759 24T693 -26Q692 -26 660 32L628 90L629 111Q631 159 631 177Q631 278 614 300Q584 340 523 340Q500 340 467 333T431 325Q429 325 429 322Q428 321 426 308T420 275T410 230T392 178T366 125L358 112L342 99Q306 70 269 38T213 -10T193 -26Q192 -26 163 0T116 26Q82 26 50 -8L42 -16L35 -8L27 0L35 10Q43 21 58 38T104 80T158 106Q179 106 218 65L235 48Q238 48 255 60T295 99T329 158Q352 231 352 359Q352 555 242 614Q210 628 187 628Q140 628 116 600T91 548Q91 522 138 464T185 382V376Q185 345 158 313T103 263L76 246Q74 244 64 253L54 260L65 267Q91 285 100 302Q111 318 111 337Q111 355 69 410T27 496ZM562 628Q504 628 443 507L435 491L436 479Q437 471 437 446Q437 396 432 351L529 389L602 426Q673 462 673 463H672Q644 470 637 483T622 553Q608 628 562 628",
        8477: "17 665Q17 672 28 683H221Q415 681 439 677Q461 673 481 667T516 654T544 639T566 623T584 607T597 592T607 578T614 565T618 554L621 548Q626 530 626 497Q626 447 613 419Q578 348 473 326L455 321Q462 310 473 292T517 226T578 141T637 72T686 35Q705 30 705 16Q705 7 693 -1H510Q503 6 404 159L306 310H268V183Q270 67 271 59Q274 42 291 38Q295 37 319 35Q344 35 353 28Q362 17 353 3L346 -1H28Q16 5 16 16Q16 35 55 35Q96 38 101 52Q106 60 106 341T101 632Q95 645 55 648Q17 648 17 665ZM241 35Q238 42 237 45T235 78T233 163T233 337V621L237 635L244 648H133Q136 641 137 638T139 603T141 517T141 341Q141 131 140 89T134 37Q133 36 133 35H241ZM457 496Q457 540 449 570T425 615T400 634T377 643Q374 643 339 648Q300 648 281 635Q271 628 270 610T268 481V346H284Q327 346 375 352Q421 364 439 392T457 496ZM492 537T492 496T488 427T478 389T469 371T464 361Q464 360 465 360Q469 360 497 370Q593 400 593 495Q593 592 477 630L457 637L461 626Q474 611 488 561Q492 537 492 496ZM464 243Q411 317 410 317Q404 317 401 315Q384 315 370 312H346L526 35H619L606 50Q553 109 464 243",
        8484: "39 -1Q29 9 29 12Q29 23 60 77T219 337L410 648H364Q261 648 210 628Q168 612 142 588T109 545T97 509T88 490Q85 489 80 489Q72 489 61 503L70 588Q72 607 75 628T79 662T81 675Q84 677 88 681Q90 683 341 683H592Q604 673 604 666Q604 662 412 348L221 37Q221 35 301 35Q406 35 446 48Q504 68 543 111T597 212Q602 239 617 239Q624 239 629 234T635 223Q635 215 621 113T604 8L597 1Q595 -1 317 -1H39ZM148 637L166 648H112V632Q111 629 110 622T108 612Q108 608 110 608T116 612T129 623T148 637ZM552 646Q552 648 504 648Q452 648 450 643Q448 639 266 343T77 37Q77 35 128 35H179L366 339L552 646ZM572 35Q581 89 581 97L561 77Q542 59 526 48L508 37L539 35H572",
        8486: "55 454Q55 503 75 546T127 617T197 665T272 695T337 704H352Q396 704 404 703Q527 687 596 615T666 454Q666 392 635 330T559 200T499 83V80H543Q589 81 600 83T617 93Q622 102 629 135T636 172L637 177H677V175L660 89Q645 3 644 2V0H552H488Q461 0 456 3T451 20Q451 89 499 235T548 455Q548 512 530 555T483 622T424 656T361 668Q332 668 303 658T243 626T193 560T174 456Q174 380 222 233T270 20Q270 7 263 0H77V2Q76 3 61 89L44 175V177H84L85 172Q85 171 88 155T96 119T104 93Q109 86 120 84T178 80H222V83Q206 132 162 199T87 329T55 454",
        8487: "126 584Q119 584 110 539T97 493Q95 490 73 490Q44 490 44 501Q44 515 62 590Q75 672 82 679Q84 684 177 684Q193 684 214 684T241 685Q265 685 271 682T277 664V648Q271 572 229 434T186 231Q186 173 203 132T247 70T302 42T360 33Q391 33 419 42T474 72T517 133T533 231Q533 297 491 437T442 648Q442 675 446 679Q448 684 542 684Q635 684 637 681Q640 678 657 594T675 501Q675 490 646 490Q624 490 622 493Q620 493 609 538T593 584Q591 585 585 585T569 586T551 588H513Q514 586 518 573T538 531T582 453Q647 340 660 277Q663 259 663 232Q663 194 657 177Q652 151 629 112T560 39Q495 -5 424 -19Q403 -22 360 -22Q318 -22 297 -19Q239 -8 193 18T120 74T80 131T62 177Q56 194 56 229Q56 281 74 328T137 453Q160 491 174 518T193 555T201 575T206 588H168Q160 587 150 587T134 586T126 584",
        8488: "148 590Q95 592 91 627V633L160 729H176Q169 713 169 705Q169 670 244 670Q269 670 305 672T357 675Q405 675 432 661T468 609Q469 605 469 596Q469 572 460 540Q433 463 301 372Q325 378 359 378Q431 378 472 350T519 297Q532 249 532 198Q532 115 500 40T442 -57Q335 -139 202 -139Q165 -139 125 -131L112 -129V-100Q112 -49 106 -33T75 -17Q55 -17 31 -35L22 -42L11 -26L22 -18Q94 36 151 36H160Q171 36 178 33T188 27T194 13T196 -5T197 -32Q198 -79 206 -90Q217 -107 251 -107Q336 -107 389 -33T442 155Q442 240 407 274Q362 319 285 319Q236 319 192 298Q188 298 181 309L224 372Q227 373 234 374T246 376T257 379T271 384T285 391T302 402T321 417Q384 471 384 540Q384 562 366 581T306 600Q292 600 233 595T148 590",
        8492: "256 262Q161 262 161 351Q161 408 203 471T289 570Q380 645 475 676T617 707L627 708Q637 708 644 708Q759 708 831 675L844 669L857 677Q892 700 896 700Q902 700 907 685Q907 683 907 681T908 678T909 676T909 673Q909 671 909 670T906 667T903 664T897 660T889 655L878 647L889 636Q928 598 928 548Q928 529 923 510T907 474T886 442T861 412T837 388T815 368T800 355Q847 323 847 270V263Q847 205 806 145Q766 82 695 37T564 -8Q527 -8 506 10T484 58Q484 85 501 117T543 172Q607 226 685 228Q695 228 698 226Q703 220 692 206Q684 194 682 193T665 191Q625 189 595 172T550 133T529 93T522 66Q522 29 576 29Q642 29 705 109Q785 211 785 270Q785 287 779 300T769 316T755 327L740 319Q682 290 634 290Q611 290 592 294H588L565 261Q559 252 544 231T522 201T504 178T481 151T455 123Q394 63 314 18T159 -28Q103 -28 67 -6T31 54Q31 88 57 123T123 158Q144 158 154 146T164 119Q164 102 142 89T100 75Q94 75 87 77T76 80L72 81Q69 78 69 65Q69 35 102 22T175 9Q184 9 198 11Q248 23 300 70T403 187T508 331T636 489T789 629L801 639Q796 642 786 647T732 661T633 670Q592 670 558 665Q481 651 409 613T286 520Q274 507 258 485T222 424T202 354Q202 299 269 299Q282 299 295 301T318 307T339 317T358 329T376 345T391 362T406 380T420 398T433 417T445 435Q496 512 496 547Q496 559 497 560T516 569Q526 574 530 574Q538 574 538 540Q538 414 427 325Q342 262 256 262ZM689 382Q708 382 753 375L765 387Q860 482 860 555Q860 594 839 610L822 592Q794 563 752 511T680 420T651 380Q655 381 660 381Q664 382 689 382ZM697 344Q692 345 681 345H675Q671 345 665 345T655 344T650 344L648 342Q646 339 645 338Q643 333 639 327H653Q670 329 676 330Q706 342 706 343Q702 344 697 344",
        8493: "299 585Q333 609 384 634T470 672L505 685Q506 685 513 662T531 613T548 580Q553 576 563 576Q575 576 605 585Q607 585 607 575V564Q537 532 496 527Q475 542 456 567T427 610T415 627Q410 627 398 618T382 603Q373 588 373 558T386 475T400 399Q400 337 366 303Q343 281 309 266T254 247T226 242L214 257Q214 258 223 260T251 272T287 299Q304 316 304 360Q304 396 289 451T274 532Q274 553 277 561V564H269Q205 558 172 501T139 358Q139 207 226 127T443 46Q448 46 457 46T470 47L485 48L601 106Q602 106 602 93V80Q551 48 517 25T474 -4T460 -13T443 -19Q409 -24 367 -24Q360 -24 351 -24T335 -23T326 -22Q190 -2 125 87T59 319V328Q62 412 96 487L101 500L118 512Q189 563 245 591L266 601L299 585",
        8496: "280 398L279 400Q278 402 277 405T275 413T272 426T271 443Q271 494 302 544T379 629T472 685T553 707H565H573Q630 707 664 689Q718 661 718 604Q718 548 662 492T553 436Q525 436 508 451T490 492Q490 534 531 579T619 630Q632 630 632 623Q632 619 624 606Q614 593 602 592T578 580Q566 568 549 541T532 497Q532 474 565 474Q577 474 587 476Q600 481 611 489Q630 503 651 535T672 596Q672 660 553 660H548Q494 660 450 616Q421 587 384 531T343 439Q341 420 344 415H345Q346 415 352 415T369 417T391 418Q421 418 440 412T466 398T473 382Q473 367 452 353T398 339Q370 339 348 345T315 359L304 366Q297 365 284 360T234 321T163 234Q120 160 120 117Q120 83 149 57T252 30Q311 30 357 60Q386 79 414 114T452 179Q454 186 454 200Q454 230 415 242Q401 246 373 246Q353 246 347 244Q328 236 313 219T288 184T274 149T265 121T261 109Q260 107 247 102T230 97Q223 97 223 105Q223 148 271 216T386 284Q446 284 483 260T520 195Q520 121 427 57T239 -8Q192 -8 152 2T79 46T46 133Q46 212 107 285T269 394L280 398ZM427 376Q427 377 402 380Q386 380 386 379L425 375L427 376",
        8497: "258 428Q258 489 322 562T482 685T661 735Q726 735 824 693T977 651Q990 651 990 644Q990 639 971 612T948 581Q947 580 938 580Q878 580 784 621T617 663Q544 663 480 635T379 568T320 492T299 431Q299 387 362 387Q404 387 438 402T493 438T527 486T546 531T551 563Q551 569 550 575T549 584T549 590Q551 593 563 602T579 611Q584 611 592 605T608 584T616 548Q616 513 595 477T554 423Q518 392 464 372T349 351Q258 351 258 428ZM324 187T305 187T286 196Q286 202 301 217Q327 242 383 262T484 290L527 297L567 356Q624 441 643 467T688 521Q715 550 752 581T795 613T804 603T808 587T778 547T702 444T626 300H637Q663 302 685 306L697 308L703 317Q745 376 792 400Q806 406 818 406Q849 406 849 375Q847 355 831 338T797 312T763 296L747 290Q744 289 735 266T724 241Q722 240 702 232T664 217T645 210Q638 210 638 218Q638 224 653 246T669 270Q669 271 668 271Q663 270 624 264L607 263Q570 199 529 152Q513 133 484 106T409 45T305 -13T193 -36Q109 -36 74 -10T39 50Q39 86 64 121T128 158Q171 158 171 121Q171 97 141 83Q125 75 107 75Q93 75 80 83Q76 71 76 62Q76 29 117 15T207 0Q324 0 494 248L501 258H495Q368 239 330 195Q324 187 305 187ZM775 335Q806 358 806 368Q805 369 804 369Q800 369 791 360Q774 336 775 335",
        8498: "457 681Q471 695 477 695Q485 695 497 681V12L484 -1H68Q55 14 55 19T68 39H457V328H215L211 335Q198 346 211 359L217 368H457V681",
        8499: "112 -7Q86 -7 58 6T30 48T54 103T113 130Q129 130 141 121T153 94Q153 71 132 59T90 47H80Q95 30 133 30Q180 30 228 63T311 137T402 249T500 361Q566 425 703 529T910 693Q942 721 945 721T958 716T970 709Q974 704 964 691Q961 688 905 622T847 554L595 181Q553 121 527 77T496 19L492 5Q497 5 531 46Q579 98 685 224T850 409L972 524Q994 543 1004 556Q1012 567 1097 643T1186 720Q1194 720 1206 715T1215 703Q1215 701 1191 671T1133 599T1080 530Q1036 461 983 357T862 152Q802 64 799 17Q799 7 800 5T811 2Q836 2 882 37T969 126Q972 130 974 134T978 138T983 139T996 140H1012Q1018 134 1018 132Q1018 122 981 83T889 4T795 -35Q761 -35 745 -12T728 48Q728 122 781 190Q833 269 890 370L927 434L914 422Q848 360 752 245Q643 117 582 51T498 -33T461 -50Q424 -48 424 -4Q424 84 481 172L714 495Q591 406 523 333Q507 316 430 226T313 95Q263 48 221 24T162 -4T120 -7H112",
        8501: "55 613Q55 643 61 663T74 688T85 694Q94 694 94 681Q98 632 134 588L412 285Q416 311 430 397T447 509V519L438 526Q407 554 398 571T388 617T394 664T407 688T418 694Q425 694 427 684Q429 675 454 635T488 586Q490 584 496 579T513 563T537 540Q555 516 555 487Q555 460 549 441T537 416T528 409Q519 409 517 415T513 435T503 463Q492 481 490 481Q454 264 454 246Q454 237 479 212T529 152T555 79Q555 32 538 9Q531 1 524 1Q516 1 516 13Q512 62 476 106Q468 115 337 258T195 412L193 406Q191 401 189 394T183 377T176 352T171 322T167 284T165 240Q165 224 166 220Q171 199 211 152T252 70Q252 45 235 29T203 8T175 1Q170 0 115 0H79Q60 0 58 3T55 20Q55 31 58 34Q60 37 76 37Q112 39 126 46T140 70Q140 96 112 148T83 236Q83 281 102 334T140 419T159 452Q55 556 55 613",
        8502: "56 706V726Q56 763 76 763Q83 763 87 759T98 741Q108 726 116 721L127 717L340 715Q547 712 564 709Q575 705 587 692Q599 680 605 663L609 650V137H676Q687 124 687 115Q687 110 678 100T622 43L558 -21H-9Q-22 -6 -22 -1T-13 14T42 72L107 137H569V339Q569 541 567 546Q558 555 554 557L545 563H329Q118 566 101 569Q90 573 78 586Q54 610 54 661Q54 670 56 706",
        8503: "56 750Q68 764 76 764Q88 764 97 743T125 717Q131 715 240 715T358 713Q421 691 421 640Q421 608 399 588T358 566Q353 566 352 565T351 557L356 526Q356 488 379 346T402 97Q400 21 385 -12Q366 -43 351 -43Q335 -43 329 -10Q316 40 316 64Q316 67 315 67Q313 67 269 26L222 -21H-9Q-22 -7 -22 -1Q-22 4 -14 14T42 73L107 137H311V564H211H164Q115 564 93 573T60 615Q56 630 56 690V750",
        8504: "62 757Q69 764 75 764Q87 764 97 741Q102 731 105 728T117 721L129 715H349Q569 715 580 710Q618 701 635 670Q640 661 640 639Q640 609 622 590Q617 583 604 575T580 566H573V553Q575 547 576 531T582 469T600 353Q624 205 624 104Q624 46 617 17T591 -32Q581 -43 573 -43Q550 -43 540 44Q535 73 533 319V564H322Q117 566 100 570Q90 573 77 586Q54 609 54 663Q54 689 55 706Q55 738 56 745T62 757",
        8513: "239 665Q194 665 154 653T90 629T66 617Q59 617 53 623T46 637Q46 652 66 659Q129 695 197 701Q218 705 248 705Q293 705 335 693Q371 684 435 644Q543 562 573 417Q577 393 577 341Q577 290 573 266Q531 83 384 10Q346 -9 315 -16T234 -23H206Q202 -23 183 -23T152 -21T120 -18T88 -10T63 3T44 24L37 35V297L50 310H235Q248 297 248 290Q248 285 235 270H77V103Q77 88 77 80T77 63T78 50T80 43T82 38T85 35T89 32T95 30Q126 20 206 17Q289 17 330 30Q407 55 460 120T533 275Q538 305 538 342Q538 486 452 575T239 665",
        8592: "944 261T944 250T929 230H165Q167 228 182 216T211 189T244 152T277 96T303 25Q308 7 308 0Q308 -11 288 -11Q281 -11 278 -11T272 -7T267 2T263 21Q245 94 195 151T73 236Q58 242 55 247Q55 254 59 257T73 264Q121 283 158 314T215 375T247 434T264 480L267 497Q269 503 270 505T275 509T288 511Q308 511 308 500Q308 493 303 475Q293 438 278 406T246 352T215 315T185 287T165 270H929Q944 261 944 250",
        8593: "27 414Q17 414 17 433Q17 437 17 439T17 444T19 447T20 450T22 452T26 453T30 454T36 456Q80 467 120 494T180 549Q227 607 238 678Q240 694 251 694Q259 694 261 684Q261 677 265 659T284 608T320 549Q340 525 363 507T405 479T440 463T467 455T479 451Q483 447 483 433Q483 413 472 413Q467 413 458 416Q342 448 277 545L270 555V-179Q262 -193 252 -193H250H248Q236 -193 230 -179V555L223 545Q192 499 146 467T70 424T27 414",
        8594: "56 237T56 250T70 270H835Q719 357 692 493Q692 494 692 496T691 499Q691 511 708 511H711Q720 511 723 510T729 506T732 497T735 481T743 456Q765 389 816 336T935 261Q944 258 944 250Q944 244 939 241T915 231T877 212Q836 186 806 152T761 85T740 35T732 4Q730 -6 727 -8T711 -11Q691 -11 691 0Q691 7 696 25Q728 151 835 230H70Q56 237 56 250",
        8595: "473 86Q483 86 483 67Q483 63 483 61T483 56T481 53T480 50T478 48T474 47T470 46T464 44Q428 35 391 14T316 -55T264 -168Q264 -170 263 -173T262 -180T261 -184Q259 -194 251 -194Q242 -194 238 -176T221 -121T180 -49Q169 -34 155 -21T125 2T95 20T67 33T44 42T27 47L21 49Q17 53 17 67Q17 87 28 87Q33 87 42 84Q158 52 223 -45L230 -55V312Q230 391 230 482T229 591Q229 662 231 676T243 693Q244 694 251 694Q264 692 270 679V-55L277 -45Q307 1 353 33T430 76T473 86",
        8596: "263 479Q267 501 271 506T288 511Q308 511 308 500Q308 493 303 475Q293 438 278 406T246 352T215 315T185 287T165 270H835Q729 349 696 475Q691 493 691 500Q691 511 711 511Q720 511 723 510T729 506T732 497T735 481T743 456Q765 389 816 336T935 261Q944 258 944 250Q944 244 939 241T915 231T877 212Q836 186 806 152T761 85T740 35T732 4Q730 -6 727 -8T711 -11Q691 -11 691 0Q691 7 696 25Q728 151 835 230H165Q167 228 182 216T211 189T244 152T277 96T303 25Q308 7 308 0Q308 -11 288 -11Q281 -11 278 -11T272 -7T267 2T263 21Q245 94 195 151T73 236Q58 242 55 247Q55 254 59 257T73 264Q144 292 194 349T263 479",
        8597: "27 492Q17 492 17 511Q17 515 17 517T17 522T19 525T20 528T22 530T26 531T30 532T36 534Q80 545 120 572T180 627Q210 664 223 701T238 755T250 772T261 762Q261 757 264 741T282 691T319 628Q352 589 390 566T454 536L479 529Q483 525 483 511Q483 491 472 491Q467 491 458 494Q342 526 277 623L270 633V-133L277 -123Q307 -77 353 -45T430 -2T473 8Q483 8 483 -11Q483 -15 483 -17T483 -22T481 -25T480 -28T478 -30T474 -31T470 -32T464 -34Q407 -49 364 -84T300 -157T270 -223T261 -262Q259 -272 250 -272Q242 -272 239 -255T223 -201T180 -127Q169 -112 155 -99T125 -76T95 -58T67 -45T44 -36T27 -31L21 -29Q17 -25 17 -11Q17 9 28 9Q33 9 42 6Q158 -26 223 -123L230 -133V633L223 623Q192 577 146 545T70 502T27 492",
        8598: "204 662Q257 662 301 676T369 705T394 720Q398 720 407 711T417 697Q417 688 389 671T310 639T212 623Q176 623 153 628Q151 628 221 557T546 232Q942 -164 943 -168Q944 -170 944 -174Q944 -182 938 -188T924 -195Q922 -195 916 -193Q912 -191 517 204Q440 281 326 394T166 553L121 598Q126 589 126 541Q126 438 70 349Q59 332 52 332Q48 332 39 341T29 355Q29 358 38 372T57 407T77 464T86 545Q86 583 78 614T63 663T55 683Q55 693 65 693Q73 693 82 688Q136 662 204 662",
        8599: "582 697Q582 701 591 710T605 720Q607 720 630 706T697 677T795 662Q830 662 863 670T914 686T934 694Q942 694 944 685Q944 680 936 663T921 615T913 545Q913 490 927 446T956 379T970 355Q970 351 961 342T947 332Q940 332 929 349Q874 436 874 541Q874 590 878 598L832 553Q787 508 673 395T482 204Q87 -191 83 -193Q77 -195 75 -195Q67 -195 61 -189T55 -174Q55 -170 56 -168Q58 -164 453 232Q707 487 777 557T847 628Q824 623 787 623Q689 623 599 679Q582 690 582 697",
        8600: "55 675Q55 683 60 689T75 695Q77 695 83 693Q87 691 482 296Q532 246 605 174T717 62T799 -20T859 -80T878 -97Q874 -93 874 -41Q874 64 929 151Q940 168 947 168Q951 168 960 159T970 145Q970 143 956 121T928 54T913 -45Q913 -83 920 -114T936 -163T944 -185Q942 -194 934 -194Q932 -194 914 -186T864 -170T795 -162Q743 -162 698 -176T630 -205T605 -220Q601 -220 592 -211T582 -197Q582 -187 611 -170T691 -138T787 -123Q824 -123 847 -128Q848 -128 778 -57T453 268Q58 664 56 668Q55 670 55 675",
        8601: "126 -41Q126 -92 121 -97Q121 -98 139 -80T200 -20T281 61T394 173T517 296Q909 690 916 693Q922 695 924 695Q932 695 938 689T944 674Q944 670 943 668Q942 664 546 268Q292 13 222 -57T153 -128Q176 -123 212 -123Q310 -123 400 -179Q417 -190 417 -197Q417 -201 408 -210T394 -220Q392 -220 369 -206T302 -177T204 -162Q131 -162 67 -194Q63 -195 59 -192T55 -183Q55 -180 62 -163T78 -115T86 -45Q86 10 72 54T44 120T29 145Q29 149 38 158T52 168Q59 168 70 151Q126 62 126 -41",
        8602: "942 250Q942 244 928 230H511L457 148Q440 124 420 93Q404 68 400 64T389 60Q381 60 375 66T368 81Q368 88 415 159L462 230H175L188 214Q210 188 235 145T264 85Q264 75 260 74T231 72L206 74L191 103Q169 142 164 150Q130 195 64 239Q56 244 56 250T64 261Q115 294 142 323T191 397L206 428H231Q255 428 259 426T264 414Q260 397 235 355T188 288L175 272L331 270Q488 270 491 272Q491 275 542 352T597 432Q602 437 609 437Q617 437 622 432T628 417T582 341L537 272L735 270H931Q942 257 942 250",
        8603: "54 250Q54 258 66 270H277L488 272L542 350Q596 431 602 435Q604 437 609 437Q617 437 622 432T628 417T582 341L537 272L608 270H751L822 272L808 288Q786 313 761 355T733 414Q733 424 737 426T766 428H793L806 397Q829 354 864 314Q896 284 928 263Q942 257 942 250T928 237Q887 208 864 185Q829 147 806 103L793 74L766 72Q742 72 738 73T733 85Q735 102 756 137T797 198L817 225L822 230H511L457 148Q440 124 420 93Q404 68 400 64T389 60Q381 60 375 66T368 81Q368 88 415 159L462 230H264L66 232Q54 239 54 250",
        8606: "56 250Q103 277 142 322T199 417H221Q244 417 244 416Q244 414 237 397T208 344T158 278L151 270H276L285 277Q322 306 349 345T388 417H434Q434 413 424 392T393 338T349 279L340 270H634Q933 270 937 266L938 265Q944 259 944 250T938 235L937 234Q933 230 634 230H340L349 221Q372 196 393 163T424 108T434 83H388Q377 116 350 155T285 223L276 230H151L158 222Q186 191 207 156T236 104T244 84Q244 83 221 83H199Q181 133 142 178T56 250",
        8608: "943 250Q895 221 856 177T801 83H778Q755 83 755 84Q755 86 762 103T791 156T841 222L848 230H723L714 223Q677 194 650 155T611 83H565Q565 87 575 108T606 162T650 221L659 230H365Q66 230 62 234L61 235Q55 241 55 250T61 265L62 266Q66 270 365 270H659L650 279Q627 304 606 337T575 392T565 417H611Q622 384 649 345T714 277L723 270H848L841 278Q813 309 792 344T763 396T755 416Q755 417 778 417H801Q817 367 856 323T943 250",
        8610: "56 250Q103 277 142 322T199 417H221Q244 417 244 416Q244 414 237 397T208 344T158 278L151 270H873L882 277Q919 306 946 345T985 417H1031Q1031 413 1021 392T990 338T946 279L937 270V230L946 221Q969 196 990 163T1021 108T1031 83H985Q974 116 947 155T882 223L873 230H151L158 222Q186 191 207 156T236 104T244 84Q244 83 221 83H199Q181 133 142 178T56 250",
        8611: "1054 250Q1006 221 967 177T912 83H889Q866 83 866 84Q866 86 873 103T902 156T952 222L959 230H237L228 223Q191 194 164 155T125 83H79Q79 87 89 108T120 162T164 221L173 230V270L164 279Q141 304 120 337T89 392T79 417H125Q136 384 163 345T228 277L237 270H959L952 278Q924 309 903 344T874 396T866 416Q866 417 889 417H912Q928 367 967 323T1054 250",
        8614: "95 155V109Q95 83 92 73T75 63Q61 63 58 74T54 130Q54 140 54 180T55 250Q55 421 57 425Q61 437 75 437Q88 437 91 428T95 393V345V270H835Q719 357 692 493Q692 494 692 496T691 499Q691 511 708 511H711Q720 511 723 510T729 506T732 497T735 481T743 456Q765 389 816 336T935 261Q944 258 944 250Q944 244 939 241T915 231T877 212Q836 186 806 152T761 85T740 35T732 4Q730 -6 727 -8T711 -11Q691 -11 691 0Q691 7 696 25Q728 151 835 230H95V155",
        8617: "903 424T903 444T929 464Q976 464 1023 434T1070 347Q1070 316 1055 292T1016 256T971 237T929 230H165Q167 228 182 216T211 189T244 152T277 96T303 25Q308 7 308 0Q308 -11 288 -11Q281 -11 278 -11T272 -7T267 2T263 21Q245 94 195 151T73 236Q58 242 55 247Q55 254 59 257T73 264Q121 283 158 314T215 375T247 434T264 480L267 497Q269 503 270 505T275 509T288 511Q308 511 308 500Q308 493 303 475Q293 438 278 406T246 352T215 315T185 287T165 270H926Q929 270 941 271T960 275T978 280T998 290T1015 307Q1030 325 1030 347Q1030 355 1027 364T1014 387T983 411T929 424H928Q903 424 903 444",
        8618: "55 347Q55 380 72 404T113 441T159 458T197 464Q222 464 222 444Q222 429 204 426T157 417T110 387Q95 369 95 347Q95 339 98 330T111 307T142 283T196 270H961Q845 357 818 493Q818 494 818 496T817 499Q817 511 834 511H837Q846 511 849 510T855 506T858 497T861 481T869 456Q891 389 942 336T1061 261Q1070 258 1070 250Q1070 244 1065 241T1041 231T1003 212Q962 186 932 152T887 85T866 35T858 4Q856 -6 853 -8T837 -11Q817 -11 817 0Q817 7 822 25Q854 151 961 230H196Q149 230 102 260T55 347",
        8619: "56 250Q103 277 142 322T199 417H221Q244 417 244 416Q244 414 237 397T208 344T158 278L151 270H622V305Q622 356 624 388T635 460T661 521T709 559T785 575Q813 575 833 573T880 561T923 534T952 483T964 405Q964 374 959 350T942 307T918 276T884 255T847 242T804 235T760 231T713 230H662V-27Q654 -41 644 -41H642H640Q628 -41 622 -27V230H151L158 222Q186 191 207 156T236 104T244 84Q244 83 221 83H199Q181 133 142 178T56 250ZM924 403Q924 474 894 505T794 536Q758 536 734 526T696 500T675 453T665 395T662 319V270H699Q826 270 875 295T924 403",
        8620: "35 405Q35 454 48 489T86 542T137 567T195 575Q229 575 251 571T301 554T345 510T370 429Q377 384 377 305V270H848L841 278Q813 309 792 344T763 396T755 416Q755 417 778 417H801Q817 367 856 323T943 250Q896 221 857 177T801 83H778Q755 83 755 84Q755 86 762 103T791 156T841 222L848 230H377V-27Q369 -41 359 -41H357Q342 -41 337 -25V230H286Q247 231 225 232T169 238T115 255T75 284T45 333T35 405ZM75 406Q75 322 123 296T300 270H337V319Q335 432 317 477T240 534Q232 535 197 535Q140 535 108 507T75 406",
        8621: "57 250Q159 311 200 417H246L242 407Q215 340 159 278L152 270H276L315 310Q354 349 358 351Q366 356 376 351Q378 350 455 273L530 196L606 273Q683 350 686 351Q694 354 703 351Q705 350 782 273L858 196L933 273Q1010 350 1012 351Q1022 356 1030 351Q1034 349 1073 310L1112 270H1236L1229 278Q1173 340 1146 407L1142 417H1188Q1233 306 1331 250Q1231 192 1188 83H1142L1146 93Q1173 160 1229 222L1236 230H1168Q1155 230 1139 230T1119 229Q1112 229 1108 229T1099 231T1092 233T1085 238T1078 245T1068 256T1056 269L1021 304L984 267Q948 230 910 191T867 149Q857 144 848 150Q844 151 770 227T694 304T618 228T540 150Q531 144 521 149Q517 152 479 191T404 267L367 304L332 269Q328 264 320 256T310 246T303 239T296 234T289 231T280 229T269 229Q265 229 249 229T220 230H152L159 222Q215 160 242 93L246 83H223L200 84L195 96Q152 190 57 250",
        8622: "491 272Q491 275 542 352T597 432Q602 437 609 437Q617 437 622 432T628 417T582 341L537 272L608 270H751L822 272L808 288Q786 313 761 355T733 414Q733 424 737 426T766 428H793L806 397Q829 354 864 314Q896 284 928 263Q942 257 942 250T928 237Q887 208 864 185Q829 147 806 103L793 74L766 72Q742 72 738 73T733 85Q735 102 756 137T797 198L817 225L822 230H511L457 148Q440 124 420 93Q404 68 400 64T389 60Q381 60 375 66T368 81Q368 88 415 159L462 230H175L188 214Q210 188 235 145T264 85Q264 75 260 74T231 72L206 74L191 103Q169 142 164 150Q130 195 64 239Q56 244 56 250T64 261Q115 294 142 323T191 397L206 428H231Q255 428 259 426T264 414Q260 397 235 355T188 288L175 272L331 270Q488 270 491 272",
        8624: "56 555Q74 567 79 570T107 592T141 625T170 667T198 722H221Q244 722 244 721Q244 718 236 699T207 647T161 587L151 576L291 575H292H293H294H296H297H298H299H300H301H302H304H305H306H307H308H309H310H311H312H314H315H316H317H318H319H320H321H322H323H324H325H327H328H329H330H331H332H333H334H335H336H337H338H339H340H341H342H343H345Q435 574 438 570L439 569L440 568Q444 564 444 287Q444 15 442 12Q436 0 424 0T406 12Q404 15 404 275V535H151L162 523Q187 495 207 462T236 410T244 389H198L193 402Q171 457 131 497T56 555",
        8625: "301 722Q339 618 443 555L437 551Q431 547 422 541T401 526T377 504T352 477T327 443T306 402L301 389H255Q255 392 263 410T291 461T337 523L348 535H95V275Q95 15 93 12Q87 0 75 0T57 12Q55 15 55 287Q55 564 59 568L60 569Q64 573 76 573T208 575L348 576L338 587Q314 613 294 646T264 698T255 721Q255 722 278 722H301",
        8630: "361 210Q373 210 373 182V177Q373 155 370 151T348 139Q303 118 267 84T216 28T201 1Q197 -1 196 -1Q189 -1 184 8Q166 39 143 64T99 104T61 129T32 144T19 150Q17 152 17 179Q17 203 21 208Q28 210 39 206Q106 178 157 135L175 119V126Q179 130 179 155Q182 173 193 201Q228 305 312 374T510 459Q532 461 551 461H567Q678 461 784 386Q835 344 861 301Q902 245 926 173T950 32Q950 15 944 8Q930 -6 917 8Q910 12 910 43Q901 208 801 314T561 421Q453 421 359 359Q300 319 263 258T217 126L216 125Q216 124 216 123T217 122Q219 122 229 131T260 156T301 181Q314 189 336 199T361 210",
        8631: "972 209Q980 209 981 204T982 179Q982 155 979 151T957 139Q915 121 878 86T815 8Q808 -1 803 -1Q801 -1 797 1Q797 6 783 28T732 84T650 139L628 150Q626 152 626 177Q626 201 630 206Q636 210 637 210Q650 210 697 181Q727 166 764 137L784 119L782 132Q767 239 689 318T499 417Q474 421 442 421Q343 421 261 369T130 219Q86 121 86 28Q86 15 79 8Q73 1 66 1T53 8Q46 15 46 30Q46 102 77 192T186 361Q274 443 386 459Q396 460 426 460Q515 460 588 431T703 361T773 271T812 187T822 132Q822 123 825 123Q936 209 972 209",
        8634: "369 543T369 563T397 583Q408 583 440 579L454 577L464 581Q492 592 516 609T552 638T565 650Q604 638 607 637Q606 636 598 628T585 614T570 601T548 584T523 568L510 560L516 558Q522 555 527 553T541 546T559 536T580 523T603 506T626 485Q722 384 722 250Q722 106 622 12T387 -83Q253 -83 155 12T56 250Q56 357 110 433T235 545Q244 550 252 550Q270 550 270 531Q270 522 261 515T238 501T202 477T159 433Q95 352 95 250Q95 131 178 45T388 -42Q511 -42 596 43T682 250Q682 340 636 408T522 511Q495 526 488 526Q488 525 488 525T487 522T485 515L490 506Q505 481 516 451T531 404T535 384L532 385Q529 386 524 387T513 390L491 397L488 408Q472 483 413 542L399 543Q369 543 369 563",
        8635: "170 637L213 650Q270 597 313 581L323 577L337 579Q369 583 380 583Q408 583 408 563T380 543H378L364 542Q305 483 289 408L286 397L264 390Q259 389 254 388T245 385L242 384Q242 387 246 403T261 450T287 506L292 515Q291 519 291 521T290 524T289 526Q284 526 265 517T216 486T160 434T114 354T95 249Q95 132 178 45T388 -42Q513 -42 597 44T682 250Q682 337 638 404T532 506Q529 508 525 510T519 514T515 516T511 519T509 522T508 526T507 531Q507 550 525 550Q533 550 542 545Q569 532 596 511T653 454T702 366T721 250Q721 151 672 74T547 -43T388 -83Q254 -83 155 12T56 250Q56 385 151 485Q164 498 179 509T205 528T228 542T247 551T260 558L267 560L254 568Q215 590 170 637",
        8636: "62 230Q56 236 55 244Q55 252 57 255T69 265Q114 292 151 326T208 391T243 448T265 491T273 509Q276 511 288 511Q304 511 306 505Q309 501 303 484Q293 456 279 430T251 383T223 344T196 313T173 291T156 276L148 270H929Q944 261 944 250T929 230H62",
        8637: "55 256Q56 264 62 270H929Q944 261 944 250T929 230H148Q149 229 165 215T196 185T231 145T270 87T303 16Q309 -1 306 -5Q304 -11 288 -11Q279 -11 276 -10T269 -4T264 10T253 36T231 75Q172 173 69 235Q59 242 57 245T55 256",
        8638: "188 258V694H208L215 682Q246 628 293 594T375 551V528Q375 505 374 505Q369 505 351 510T299 534T237 578L228 587V205Q228 -178 226 -182Q221 -194 208 -194T190 -182Q188 -178 188 258",
        8639: "41 551Q76 559 123 592T201 682L208 694H228V258Q228 -178 226 -182Q221 -194 208 -194T190 -182Q188 -178 188 205V587L179 578Q151 552 117 534T65 511T42 505Q41 505 41 528V551",
        8640: "691 500Q691 511 711 511Q720 511 723 510T730 504T735 490T746 464T768 425Q796 378 835 339T897 285T933 263Q941 258 942 256T944 245T937 230H70Q56 237 56 250T70 270H852Q802 308 762 364T707 455T691 500",
        8641: "56 237T56 250T70 270H937Q944 263 944 256Q944 251 944 250T943 246T940 242T933 238Q794 153 734 7Q729 -7 726 -9T711 -11Q695 -11 693 -5Q690 -1 696 16Q721 84 763 139T852 230H70Q56 237 56 250",
        8642: "190 682Q195 694 208 694T226 683Q228 679 228 296V-87L237 -78Q265 -52 299 -34T351 -11T374 -5Q375 -5 375 -28V-51Q340 -60 293 -92T215 -182L208 -194H188V242Q188 678 190 682",
        8643: "188 295V573Q188 657 189 672T200 692Q206 694 208 694Q221 694 226 683Q228 679 228 242V-194H208L201 -182Q170 -128 123 -94T41 -51V-28Q41 -5 42 -5Q47 -5 65 -10T117 -34T179 -78L188 -87V295",
        8644: "943 500Q895 471 856 427T801 333H778Q755 333 755 334Q755 336 762 353T791 406T841 472L848 480H459Q70 480 67 482Q55 488 55 500T67 518Q70 520 459 520H848L841 528Q813 559 792 594T763 646T755 666Q755 667 778 667H801Q817 617 856 573T943 500ZM56 167Q102 194 141 238T198 333H221Q244 333 244 332Q221 265 161 198L151 187H539Q928 187 930 186Q944 182 944 167Q944 155 934 149Q930 147 541 147H151L160 137Q185 110 205 77T235 24T244 1Q244 0 221 0H199Q158 106 56 167",
        8646: "56 500Q103 527 142 572T199 667H221Q244 667 244 666Q244 664 237 647T208 594T158 528L151 520H539Q928 520 932 518Q944 513 944 500T932 482Q928 480 539 480H151L158 472Q186 441 207 406T236 354T244 334Q244 333 221 333H199Q181 383 142 428T56 500ZM943 167Q835 101 801 0H778Q755 0 755 1T758 9T765 25T771 39Q800 94 839 137L848 147H458Q68 147 66 149Q55 154 55 167Q55 182 69 186Q71 187 460 187H848L838 198Q811 228 791 261T762 314L755 332Q755 333 778 333H801Q841 227 943 167",
        8647: "930 437Q944 426 944 416T934 399Q930 397 540 397H150L159 387Q185 360 205 328T234 277T243 252Q243 237 217 191T159 113L150 103H540Q930 103 934 101Q944 94 944 84Q944 71 930 64L540 63H151Q180 34 203 -2T236 -61L244 -83H198Q178 -31 142 11T66 77L55 83L65 89Q157 145 197 246Q199 250 190 269Q150 359 65 411L55 417L66 423Q106 447 142 489T198 583H244Q202 488 151 437H930",
        8648: "83 551Q190 590 250 694Q251 689 263 671T307 621T380 567Q409 551 416 551Q422 551 447 563T511 608T577 684L582 694Q642 591 749 551V528Q749 505 748 505Q745 505 724 515T669 546T612 590L602 599V-181Q595 -193 585 -193H582H581Q568 -193 565 -183L563 -179L562 209V598L552 589Q517 556 473 531T414 506H412Q411 506 393 514T361 530T324 553T280 589L270 598V-179Q255 -192 250 -193H247Q237 -193 230 -181V599L220 590Q197 567 164 546T110 515T84 505Q83 505 83 528V551",
        8649: "55 416Q55 427 70 437H848Q819 466 796 502T764 561L755 583H801Q821 531 857 489T933 423L944 417L934 411Q843 355 802 254Q800 250 809 231Q849 141 934 89L944 83L933 77Q893 53 857 11T801 -83H755Q797 12 848 63H459L70 64Q55 70 55 84Q55 94 65 101Q69 103 459 103H849L840 113Q806 148 779 196T756 254Q756 255 760 264T770 286T786 315T809 351T840 387L849 397H459Q69 397 65 399Q55 406 55 416",
        8650: "230 681Q240 694 251 694Q260 693 270 680V-98L280 -89Q297 -73 314 -60T348 -38T374 -24T397 -13T412 -6H414Q428 -6 473 -32T552 -89L562 -98V291L563 680Q570 693 582 693Q593 694 602 681V-99L612 -90Q635 -68 668 -47T723 -15T748 -5Q749 -5 749 -28V-51Q642 -91 582 -194L577 -184Q551 -141 512 -108T447 -63T416 -51T385 -63T321 -108T255 -184L250 -194Q189 -89 83 -51V-28Q83 -5 84 -5Q88 -5 109 -15T164 -46T220 -90L230 -99V681",
        8651: "195 504L198 514H221Q244 514 244 512Q244 508 239 490T215 437T171 376L162 367H545Q928 367 932 365Q944 360 944 347T932 329Q928 327 492 327H55V347L67 354Q113 379 146 420T195 504ZM67 171Q70 173 507 173H944V153L932 146Q839 95 804 -4L801 -14H778Q755 -14 755 -12Q768 59 828 124L837 133H454Q71 133 67 135Q55 140 55 153Q55 165 67 171",
        8652: "691 660Q691 671 711 671Q720 671 723 670T730 664T735 650T746 624T768 585Q797 538 836 499T897 445T933 423Q941 418 942 416T944 405T937 390H70Q56 397 56 410T70 430H852Q802 468 762 524T707 615T691 660ZM55 256Q56 264 62 270H929Q944 261 944 250T929 230H148Q149 229 165 215T196 185T231 145T270 87T303 16Q309 -1 306 -5Q304 -11 288 -11Q279 -11 276 -10T269 -4T264 10T253 36T231 75Q172 173 69 235Q59 242 57 245T55 256",
        8653: "397 525Q410 525 414 524T418 516Q418 506 394 467T331 381L319 367H473L624 369L657 445Q674 487 684 507T699 531T709 534Q717 534 722 528T728 516Q728 510 695 434Q689 418 683 402T672 377T668 367H928Q942 355 942 347Q942 341 928 327H791Q651 327 651 325Q649 324 620 251T586 174Q586 172 757 172H928Q942 158 942 152Q942 143 928 132H568L537 54Q510 -9 503 -22T486 -35Q479 -35 473 -29T466 -17T495 61L526 132H319L331 118Q364 81 391 37T418 -17Q418 -23 415 -24T401 -26Q398 -26 397 -26L384 -24L377 -13Q344 49 301 97T218 170T143 210T84 233T55 245Q54 253 59 256T86 267Q281 327 377 512L384 525H397ZM606 325Q606 327 439 327H275Q258 312 179 265L148 249Q228 206 262 181L275 172H544L575 247L606 325",
        8654: "395 -24T395 -19T417 57T440 132H255L266 116Q308 64 340 -6Q342 -17 337 -21Q335 -26 320 -26T302 -19Q302 -15 294 4T265 54T217 117T145 182T49 236Q30 243 33 254Q40 261 49 263Q98 283 142 315T214 379T263 442T293 493T302 519Q305 525 320 525T337 521Q342 516 340 505Q308 435 266 383L255 370L384 367H515Q561 522 569 530Q574 534 580 534Q587 534 594 528T602 516Q602 512 580 441T557 367H651L742 370L731 383Q689 435 657 505Q655 516 660 521Q662 525 677 525T695 519Q695 515 703 496T732 446T780 383T853 317T949 263Q967 258 964 245Q959 240 949 236Q897 215 852 182T779 116T731 52T703 3T695 -19Q692 -26 677 -26T660 -21Q655 -17 657 -6Q670 21 682 42T702 77T717 99T728 114T735 122T739 126T740 130T613 132H482L460 54Q440 -9 433 -23T415 -37Q408 -37 402 -31ZM502 325Q502 327 360 327H217L195 310Q173 291 120 256L111 250Q114 248 143 229T195 190L217 172H335L453 174L502 325ZM886 250Q885 251 865 263T831 286T802 310L780 327H544L535 299Q531 283 511 223L495 174L637 172H780L802 190Q843 225 877 243L886 250",
        8655: "346 174Q348 176 378 249T411 325Q411 327 239 327H68Q55 342 55 347Q55 354 68 367H428L459 445Q487 509 494 521T510 534Q517 534 524 527T531 516Q531 515 502 438L471 367H677L666 381Q631 421 605 463T578 516Q578 522 582 523T599 525H615L619 512Q659 437 714 383T812 309T896 272T942 254Q943 246 938 243T911 232Q718 172 619 -13L615 -24L599 -26Q578 -26 578 -17Q578 -11 587 6T617 53T666 118L677 132H373L339 54Q323 12 313 -8T298 -32T288 -35Q280 -35 275 -29T269 -17Q269 -14 298 57T328 132H68Q55 145 55 152Q55 156 56 158T62 165T68 172H206Q346 172 346 174ZM848 249Q763 297 735 318L722 327H455L422 252L391 174Q391 172 557 172H722L735 181Q773 210 819 234L848 249",
        8656: "944 153Q944 140 929 133H318L328 123Q379 69 414 0Q419 -13 419 -17Q419 -24 399 -24Q388 -24 385 -23T377 -12Q332 77 253 144T72 237Q62 240 59 242T56 250T59 257T70 262T89 268T119 278T160 296Q303 366 377 512Q382 522 385 523T401 525Q419 524 419 515Q419 510 414 500Q379 431 328 377L318 367H929Q944 359 944 347Q944 336 930 328L602 327H274L264 319Q225 289 147 250Q148 249 165 241T210 217T264 181L274 173H930Q931 172 933 171T936 169T938 167T941 164T942 162T943 158T944 153",
        8657: "228 -179Q227 -180 226 -182T223 -186T221 -189T218 -192T214 -193T208 -194Q196 -194 189 -181L188 125V430L176 419Q122 369 59 338Q46 330 40 330Q38 330 31 337V350Q31 362 33 365T46 374Q60 381 77 390T128 426T190 484T247 567T292 677Q295 688 298 692Q302 694 305 694Q313 694 318 677Q334 619 363 568T420 485T481 427T532 391T564 374Q575 368 577 365T579 350V337Q572 330 570 330Q564 330 551 338Q487 370 435 419L423 430L422 125V-181Q409 -194 401 -194Q397 -194 394 -193T388 -189T385 -184T382 -180V-177V475L373 487Q331 541 305 602Q304 601 300 591T290 571T278 548T260 519T238 488L229 476L228 148V-179",
        8658: "580 514Q580 525 596 525Q601 525 604 525T609 525T613 524T615 523T617 520T619 517T622 512Q659 438 720 381T831 300T927 263Q944 258 944 250T935 239T898 228T840 204Q696 134 622 -12Q618 -21 615 -22T600 -24Q580 -24 580 -17Q580 -13 585 0Q620 69 671 123L681 133H70Q56 140 56 153Q56 168 72 173H725L735 181Q774 211 852 250Q851 251 834 259T789 283T735 319L725 327H72Q56 332 56 347Q56 360 70 367H681L671 377Q638 412 609 458T580 514",
        8659: "401 694Q412 694 422 681V375L423 70L435 81Q487 130 551 162Q564 170 570 170Q572 170 579 163V150Q579 138 577 135T564 126Q541 114 518 99T453 48T374 -46T318 -177Q313 -194 305 -194T293 -178T272 -119T225 -31Q158 70 46 126Q35 132 33 135T31 150V163Q38 170 40 170Q46 170 59 162Q122 131 176 81L188 70V375L189 681Q199 694 208 694Q219 694 228 680V352L229 25L238 12Q279 -42 305 -102Q344 -23 373 13L382 25V678Q387 692 401 694",
        8660: "308 524Q318 526 323 526Q340 526 340 514Q340 507 336 499Q326 476 314 454T292 417T274 391T260 374L255 368Q255 367 500 367Q744 367 744 368L739 374Q734 379 726 390T707 416T685 453T663 499Q658 511 658 515Q658 525 680 525Q687 524 690 523T695 519T701 507Q766 359 902 287Q921 276 939 269T961 259T966 250Q966 246 965 244T960 240T949 236T930 228T902 213Q763 137 701 -7Q697 -16 695 -19T690 -23T680 -25Q658 -25 658 -15Q658 -11 663 1Q673 24 685 46T707 83T725 109T739 126L744 132Q744 133 500 133Q255 133 255 132L260 126Q265 121 273 110T292 84T314 47T336 1Q341 -11 341 -15Q341 -25 319 -25Q312 -24 309 -23T304 -19T298 -7Q233 141 97 213Q83 221 70 227T51 235T41 239T35 243T34 250T35 256T40 261T51 265T70 273T97 287Q235 363 299 509Q305 522 308 524ZM792 319L783 327H216Q183 294 120 256L110 250L120 244Q173 212 207 181L216 173H783L792 181Q826 212 879 244L889 250L879 256Q826 288 792 319",
        8661: "290 755Q298 772 305 772T318 757T343 706T393 633Q431 588 473 558T545 515T579 497V484Q579 464 570 464Q564 464 550 470Q485 497 423 550L422 400V100L423 -50Q485 3 550 30Q565 36 570 36Q579 36 579 16V3Q575 -1 549 -12T480 -53T393 -132Q361 -172 342 -208T318 -258T305 -272T293 -258T268 -208T217 -132Q170 -80 128 -51T61 -12T31 3V16Q31 36 40 36Q46 36 61 30Q86 19 109 6T146 -18T173 -38T188 -50V550Q186 549 173 539T147 519T110 495T61 470Q46 464 40 464Q31 464 31 484V497Q34 500 63 513T135 557T217 633Q267 692 290 755ZM374 598Q363 610 351 625T332 651T316 676T305 695L294 676Q282 657 267 636T236 598L228 589V-89L236 -98Q247 -110 259 -125T278 -151T294 -176T305 -195L316 -176Q328 -157 343 -136T374 -98L382 -89V589L374 598",
        8666: "944 54Q942 44 929 36H372Q372 34 377 26T395 -4T422 -58Q442 -109 442 -110T408 -111H374L370 -100Q282 124 87 243L76 250L87 257Q284 377 370 600L374 611H408Q442 611 442 610Q423 550 381 480Q380 478 379 475T376 471T374 468T372 465V464H929Q942 456 944 446Q944 442 943 439T941 434T938 430T935 428T931 426T928 424H344L336 414Q277 336 200 277L191 270H560Q929 270 933 268Q944 262 944 250Q944 237 933 232Q929 230 560 230H191L200 223Q279 162 336 86L344 76H928Q929 76 931 75T934 73T938 70T941 66T943 61T944 54",
        8667: "56 250Q56 260 68 270H808L799 277Q720 338 663 414L655 424H363Q71 424 68 426Q55 432 55 444T68 462Q71 464 349 464H627Q627 466 622 474T604 504T577 558Q557 609 557 610T591 611H626L629 600Q717 376 912 257L923 250L912 243Q715 123 629 -100L626 -111H591Q557 -111 557 -110Q576 -50 618 20Q619 22 620 25T623 29T625 32T626 35L627 36H349Q71 36 68 38Q55 44 55 56T68 74Q71 76 363 76H655L663 86Q722 164 799 223L808 230H438L68 231Q56 236 56 250",
        8669: "76 230Q68 230 62 237T56 250Q56 257 63 264T91 291Q102 300 108 306L159 351Q168 356 177 351L218 316L303 239L353 195Q376 214 403 239L488 316L529 351Q538 356 546 351Q548 350 594 310L638 270H848L841 278Q813 309 792 344T763 396T755 416Q755 417 778 417H801Q817 367 856 323T943 250Q895 221 856 177T801 83H778Q755 83 755 84Q755 86 762 103T791 156T841 222L848 230H737Q625 230 622 232Q620 233 599 251T558 288L537 306Q537 305 451 228T362 149Q353 146 345 149Q341 150 255 227T169 306Q167 306 129 270Q123 265 115 257T102 245T93 237T84 232T76 230",
        8672: "292 419Q292 400 261 347T211 275H306H364Q400 275 411 271T422 250T411 230T366 225H306H211Q214 222 232 197T271 136T292 82Q292 71 285 68T262 64H250H241Q221 64 216 67T205 83Q186 127 153 167T78 230Q64 238 64 250Q64 258 69 263T82 272T106 288T139 318Q162 342 177 365T198 402T209 425T223 436Q224 437 252 437H258Q292 437 292 419ZM501 237T501 250T515 270H819Q834 262 834 250T819 230H515Q501 237 501 250ZM918 237T918 250T932 270H1236Q1251 262 1251 250T1236 230H932Q918 237 918 250",
        8674: "84 237T84 250T98 270H402Q417 262 417 250T402 230H98Q84 237 84 250ZM501 237T501 250T515 270H819Q834 262 834 250T819 230H515Q501 237 501 250ZM1022 417Q1022 437 1055 437H1067Q1090 437 1097 434T1109 417Q1128 373 1161 333T1236 270Q1251 261 1251 250Q1251 241 1244 236T1216 217T1175 182Q1149 155 1133 128T1109 85T1097 66Q1093 64 1065 64H1053Q1031 64 1025 72T1027 100Q1036 124 1049 147T1073 185T1091 210T1101 223L1103 225H1008H950Q914 225 903 229T892 250T903 270T948 275H1008H1103L1101 277Q1100 280 1091 291T1067 325T1039 374Q1022 408 1022 417",
        8704: "0 673Q0 684 7 689T20 694Q32 694 38 680T82 567L126 451H430L473 566Q483 593 494 622T512 668T519 685Q524 694 538 694Q556 692 556 674Q556 670 426 329T293 -15Q288 -22 278 -22T263 -15Q260 -11 131 328T0 673ZM414 410Q414 411 278 411T142 410L278 55L414 410",
        8705: "404 269Q412 269 418 267T428 261T435 253T441 245L444 240V172Q444 103 443 96Q440 81 431 65T403 27T344 -7T250 -21T156 -8T97 27T69 65T58 96Q56 103 56 413Q56 722 58 729Q74 822 215 845Q221 846 229 846H243Q282 846 290 845Q422 826 443 729Q444 722 444 653V586L442 583Q441 580 440 578T436 573T430 567T423 562T415 558T404 556Q377 556 367 583Q364 590 364 654V719Q363 721 360 726T355 733Q326 766 250 766H249Q235 766 219 765T174 752T137 719V107Q145 83 178 71T251 58H254Q340 58 364 107V172Q364 176 364 187T363 204Q363 269 404 269",
        8706: "202 508Q179 508 169 520T158 547Q158 557 164 577T185 624T230 675T301 710L333 715H345Q378 715 384 714Q447 703 489 661T549 568T566 457Q566 362 519 240T402 53Q321 -22 223 -22Q123 -22 73 56Q42 102 42 148V159Q42 276 129 370T322 465Q383 465 414 434T455 367L458 378Q478 461 478 515Q478 603 437 639T344 676Q266 676 223 612Q264 606 264 572Q264 547 246 528T202 508ZM430 306Q430 372 401 400T333 428Q270 428 222 382Q197 354 183 323T150 221Q132 149 132 116Q132 21 232 21Q244 21 250 22Q327 35 374 112Q389 137 409 196T430 306",
        8707: "56 661T56 674T70 694H487Q497 686 500 679V15Q497 10 487 1L279 0H70Q56 7 56 20T70 40H460V327H84Q70 334 70 347T84 367H460V654H70Q56 661 56 674",
        8709: "331 696Q335 708 339 722T345 744T350 759T357 769T367 772Q374 772 381 767T388 754Q388 746 377 712L366 673L378 661Q460 575 460 344Q460 281 456 234T432 126T373 27Q319 -22 250 -22Q214 -22 180 -7Q168 -3 168 -4L159 -33Q148 -71 142 -75Q138 -78 132 -78Q124 -78 118 -72T111 -60Q111 -52 122 -18L133 21L125 29Q39 111 39 344Q39 596 137 675Q187 716 251 716Q265 716 278 714T296 710T315 703T331 696ZM276 676Q264 679 246 679Q196 679 159 631Q134 597 128 536T121 356Q121 234 127 174T151 80L234 366Q253 430 275 506T308 618L318 654Q318 656 294 669L276 676ZM181 42Q207 16 250 16Q291 16 324 47Q354 78 366 136T378 356Q378 470 372 528T349 616L348 613Q348 611 264 326L181 42",
        8710: "51 0Q46 4 46 7Q46 9 215 357T388 709Q391 716 416 716Q439 716 444 709Q447 705 616 357T786 7Q786 4 781 0H51ZM507 344L384 596L137 92L383 91H630Q630 93 507 344",
        8711: "46 676Q46 679 51 683H781Q786 679 786 676Q786 674 617 326T444 -26Q439 -33 416 -33T388 -26Q385 -22 216 326T46 676ZM697 596Q697 597 445 597T193 596Q195 591 319 336T445 80L697 596",
        8712: "84 250Q84 372 166 450T360 539Q361 539 377 539T419 540T469 540H568Q583 532 583 520Q583 511 570 501L466 500Q355 499 329 494Q280 482 242 458T183 409T147 354T129 306T124 272V270H568Q583 262 583 250T568 230H124V228Q124 207 134 177T167 112T231 48T328 7Q355 1 466 0H570Q583 -10 583 -20Q583 -32 568 -40H471Q464 -40 446 -40T417 -41Q262 -41 172 45Q84 127 84 250",
        8713: "196 25Q84 109 84 250Q84 372 166 450T360 539Q361 539 375 539T413 540T460 540L547 707Q550 716 563 716Q570 716 575 712T581 703T583 696T505 540H568Q583 532 583 520Q583 511 570 501L484 500L366 270H568Q583 262 583 250T568 230H346L247 38Q284 16 328 7Q355 1 466 0H570Q583 -10 583 -20Q583 -32 568 -40H471Q464 -40 447 -40T419 -41Q304 -41 228 3Q117 -211 115 -212Q111 -215 104 -215T92 -212T86 -204T84 -197Q84 -190 89 -183L196 25ZM214 61L301 230H124V228Q124 196 147 147T214 61ZM321 270L440 500Q353 499 329 494Q280 482 242 458T183 409T147 354T129 306T124 272V270H321",
        8715: "83 520Q83 532 98 540H195Q202 540 220 540T249 541Q404 541 494 455Q582 374 582 250Q582 165 539 99T434 0T304 -39Q297 -40 195 -40H98Q83 -32 83 -20Q83 -10 96 0H200Q311 1 337 6Q369 14 401 28Q422 39 445 55Q484 85 508 127T537 191T542 228V230H98Q84 237 84 250T98 270H542V272Q542 280 539 295T527 336T497 391T445 445Q422 461 401 472Q386 479 374 483T347 491T325 495T298 498T273 499T239 500T200 500L96 501Q83 511 83 520",
        8717: "154 -1Q122 -1 112 3T102 26Q102 63 158 63H178Q192 64 206 65T228 66T240 68Q301 85 324 146L329 157H244Q158 157 153 161Q149 162 145 169T140 183Q140 201 158 215L167 221H256L344 223L349 237Q352 262 352 287Q352 308 351 315Q341 352 315 368T256 385Q231 385 206 376T166 356T149 346Q143 346 138 364T132 388Q132 396 147 406Q198 440 252 440Q291 440 318 435Q421 404 451 301Q456 288 456 248V234Q456 151 391 86Q330 25 240 3Q212 -1 154 -1",
        8719: "158 656Q147 684 131 694Q110 707 69 710H55V750H888V710H874Q840 708 820 698T795 678T786 656V-155Q798 -206 874 -210H888V-250H570V-210H584Q618 -208 638 -197T663 -178T673 -155V710H270V277L271 -155Q283 -206 359 -210H373V-250H55V-210H69Q103 -208 123 -197T148 -178T158 -155V656",
        8720: "158 656Q147 684 131 694Q110 707 69 710H55V750H373V710H359Q325 708 305 698T280 678T271 656L270 223V-210H673V656Q666 672 663 679T639 697T584 710H570V750H888V710H874Q840 708 820 698T795 678T786 656V-155Q798 -206 874 -210H888V-250H55V-210H69Q103 -208 123 -197T148 -178T158 -155V656",
        8721: "61 748Q64 750 489 750H913L954 640Q965 609 976 579T993 533T999 516H979L959 517Q936 579 886 621T777 682Q724 700 655 705T436 710H319Q183 710 183 709Q186 706 348 484T511 259Q517 250 513 244L490 216Q466 188 420 134T330 27L149 -187Q149 -188 362 -188Q388 -188 436 -188T506 -189Q679 -189 778 -162T936 -43Q946 -27 959 6H999L913 -249L489 -250Q65 -250 62 -248Q56 -246 56 -239Q56 -234 118 -161Q186 -81 245 -11L428 206Q428 207 242 462L57 717L56 728Q56 744 61 748",
        8722: "84 237T84 250T98 270H679Q694 262 694 250T679 230H98Q84 237 84 250",
        8723: "56 467T56 480T70 500H707Q722 492 722 480T707 460H409V187H707Q722 179 722 167Q722 154 707 147H409V0V-93Q409 -144 406 -155T389 -166Q376 -166 372 -155T368 -105Q368 -96 368 -62T369 -2V147H70Q56 154 56 167T70 187H369V460H70Q56 467 56 480",
        8724: "339 717Q339 739 354 752T388 766Q410 766 424 751T439 716T424 681T390 666Q369 666 354 681T339 717ZM57 237T57 250T71 270H369V425L370 581Q380 594 389 594Q402 594 409 579V270H707Q722 262 722 250T707 230H409V-79Q401 -93 391 -93H389H387Q375 -93 369 -79V230H71Q57 237 57 250",
        8725: "423 750Q432 750 438 744T444 730Q444 725 271 248T92 -240Q85 -250 75 -250Q68 -250 62 -245T56 -231Q56 -221 230 257T407 740Q411 750 423 750",
        8726: "56 731Q56 740 62 745T75 750Q85 750 92 740Q96 733 270 255T444 -231Q444 -239 438 -244T424 -250Q414 -250 407 -240Q404 -236 230 242T56 731",
        8727: "229 286Q216 420 216 436Q216 454 240 464Q241 464 245 464T251 465Q263 464 273 456T283 436Q283 419 277 356T270 286L328 328Q384 369 389 372T399 375Q412 375 423 365T435 338Q435 325 425 315Q420 312 357 282T289 250L355 219L425 184Q434 175 434 161Q434 146 425 136T401 125Q393 125 383 131T328 171L270 213Q283 79 283 63Q283 53 276 44T250 35Q231 35 224 44T216 63Q216 80 222 143T229 213L171 171Q115 130 110 127Q106 124 100 124Q87 124 76 134T64 161Q64 166 64 169T67 175T72 181T81 188T94 195T113 204T138 215T170 230T210 250L74 315Q65 324 65 338Q65 353 74 363T98 374Q106 374 116 368T171 328L229 286",
        8728: "55 251Q55 328 112 386T249 444T386 388T444 249Q444 171 388 113T250 55Q170 55 113 112T55 251ZM245 403Q188 403 142 361T96 250Q96 183 141 140T250 96Q284 96 313 109T354 135T375 160Q403 197 403 250Q403 313 360 358T245 403",
        8729: "55 251Q55 328 112 386T249 444T386 388T444 249Q444 171 388 113T250 55Q170 55 113 112T55 251",
        8730: "95 178Q89 178 81 186T72 200T103 230T169 280T207 309Q209 311 212 311H213Q219 311 227 294T281 177Q300 134 312 108L397 -77Q398 -77 501 136T707 565T814 786Q820 800 834 800Q841 800 846 794T853 782V776L620 293L385 -193Q381 -200 366 -200Q357 -200 354 -197Q352 -195 256 15L160 225L144 214Q129 202 113 190T95 178",
        8733: "56 124T56 216T107 375T238 442Q260 442 280 438T319 425T352 407T382 385T406 361T427 336T442 315T455 297T462 285L469 297Q555 442 679 442Q687 442 722 437V398H718Q710 400 694 400Q657 400 623 383T567 343T527 294T503 253T495 235Q495 231 520 192T554 143Q625 44 696 44Q717 44 719 46H722V-5Q695 -11 678 -11Q552 -11 457 141Q455 145 454 146L447 134Q362 -11 235 -11Q157 -11 107 56ZM93 213Q93 143 126 87T220 31Q258 31 292 48T349 88T389 137T413 178T421 196Q421 200 396 239T362 288Q322 345 288 366T213 387Q163 387 128 337T93 213",
        8734: "55 217Q55 305 111 373T254 442Q342 442 419 381Q457 350 493 303L507 284L514 294Q618 442 747 442Q833 442 888 374T944 214Q944 128 889 59T743 -11Q657 -11 580 50Q542 81 506 128L492 147L485 137Q381 -11 252 -11Q166 -11 111 57T55 217ZM907 217Q907 285 869 341T761 397Q740 397 720 392T682 378T648 359T619 335T594 310T574 285T559 263T548 246L543 238L574 198Q605 158 622 138T664 94T714 61T765 51Q827 51 867 100T907 217ZM92 214Q92 145 131 89T239 33Q357 33 456 193L425 233Q364 312 334 337Q285 380 233 380Q171 380 132 331T92 214",
        8736: "71 0L68 2Q65 3 63 5T58 11T55 20Q55 22 57 28Q67 43 346 361Q397 420 474 508Q595 648 616 671T647 694T661 688T666 674Q666 668 663 663Q662 662 627 622T524 503T390 350L120 41L386 40H653Q666 30 666 20Q666 8 651 0H71",
        8737: "71 0L68 2Q65 3 63 5T58 11T55 20Q55 22 57 28Q64 38 348 373T638 712Q644 714 646 714Q653 714 659 709T666 694V693Q666 687 633 647Q619 631 576 580Q528 524 495 485Q336 296 329 289Q328 288 348 264T395 182T433 54L434 40H651Q666 32 666 20T651 0H436Q431 -20 416 -20Q400 -20 396 -4V0H71ZM394 40Q394 51 389 76T366 149T319 234L302 256L119 41L256 40H394",
        8738: "666 -32Q666 -51 646 -51Q639 -51 365 85L75 228Q55 238 55 250Q55 257 59 262T68 268L72 270L611 536Q642 551 647 551T659 547T666 532Q666 521 657 515L525 449Q525 448 535 424T556 352T566 250T556 148T536 77T525 51L657 -15Q666 -21 666 -32ZM526 250Q526 297 517 342T499 409T488 431Q487 431 304 341T121 250T304 159T488 69Q526 143 526 250",
        8739: "139 -249H137Q125 -249 119 -235V251L120 737Q130 750 139 750Q152 750 159 735V-235Q151 -249 141 -249H139",
        8740: "118 737Q131 750 138 750L151 746L158 739V579L160 421L213 470Q269 519 276 519Q284 519 290 513T296 499V498Q296 493 291 488T244 445Q225 428 213 417L158 368V-239Q143 -252 136 -252L124 -248L120 -241L118 44V328L62 279Q4 231 0 230Q-8 230 -14 236T-20 250Q-20 257 -11 265T62 332L118 384V737",
        8741: "133 736Q138 750 153 750Q164 750 170 739Q172 735 172 250T170 -239Q164 -250 152 -250Q144 -250 138 -244L137 -243Q133 -241 133 -179T132 250Q132 731 133 736ZM329 739Q334 750 346 750Q353 750 361 744L362 743Q366 741 366 679T367 250T367 -178T362 -243L361 -244Q355 -250 347 -250Q335 -250 329 -239Q327 -235 327 250T329 739",
        8742: "131 737Q134 739 138 743T144 748T151 750T171 737V199L327 357V737Q340 750 347 750Q351 750 353 749T360 743T367 737V397L429 457Q493 518 498 519Q506 519 512 512T518 500Q518 489 442 417L367 339V-237Q352 -250 346 -250L333 -243L327 -237V301L171 143V-237Q156 -250 151 -250T131 -237V101L69 41Q24 -3 15 -12T0 -21Q-8 -21 -14 -14T-20 -2Q-20 5 -7 19T56 81L131 159V737",
        8743: "318 591Q325 598 333 598Q344 598 348 591Q349 590 414 445T545 151T611 -4Q609 -22 591 -22Q588 -22 586 -21T581 -20T577 -17T575 -13T572 -9T570 -4L333 528L96 -4Q87 -20 80 -21Q78 -22 75 -22Q57 -22 55 -4Q55 2 120 150T251 444T318 591",
        8744: "55 580Q56 587 61 592T75 598Q86 598 96 580L333 48L570 580Q579 596 586 597Q588 598 591 598Q609 598 611 580Q611 574 546 426T415 132T348 -15Q343 -22 333 -22T318 -15Q317 -14 252 131T121 425T55 580",
        8745: "88 -21T75 -21T55 -7V200Q55 231 55 280Q56 414 60 428Q61 430 61 431Q77 500 152 549T332 598Q443 598 522 544T610 405Q611 399 611 194V-7Q604 -22 591 -22Q582 -22 572 -9L570 405Q563 433 556 449T529 485Q498 519 445 538T334 558Q251 558 179 518T96 401Q95 396 95 193V-7Q88 -21 75 -21",
        8746: "591 598H592Q604 598 611 583V376Q611 345 611 296Q610 162 606 148Q605 146 605 145Q586 68 507 23T333 -22Q268 -22 209 -1T106 66T56 173Q55 180 55 384L56 585Q66 598 75 598Q85 598 95 585V378L96 172L98 162Q112 95 181 57T332 18Q415 18 487 58T570 175Q571 180 571 383V583Q579 598 591 598",
        8747: "151 -112Q151 -150 106 -161Q106 -165 114 -172T134 -179Q155 -179 170 -146Q181 -120 188 -64T206 101T232 310Q256 472 277 567Q308 716 392 716Q434 716 453 681T472 613Q472 590 458 577T424 564Q404 564 390 578T376 612Q376 650 421 661Q421 663 418 667T407 675T393 679Q387 679 380 675Q360 665 350 619T326 438Q302 190 253 -57Q235 -147 201 -186Q174 -213 138 -216Q93 -216 74 -181T55 -113Q55 -91 69 -78T103 -64Q123 -64 137 -78T151 -112",
        8748: "113 -244Q113 -246 119 -251T139 -263T167 -269Q186 -269 199 -260Q220 -247 232 -218T251 -133T262 -15T276 155T297 367Q300 390 305 438T314 512T325 580T340 647T361 703T390 751T428 784T479 804Q481 804 488 804T501 805Q552 802 581 769T610 695Q610 669 594 657T561 645Q542 645 527 658T512 694Q512 705 516 714T526 729T538 737T548 742L552 743Q552 745 545 751T525 762T498 768Q475 768 460 756T434 716T418 652T407 559T398 444T387 300T369 133Q349 -38 337 -102T303 -207Q256 -306 169 -306Q119 -306 87 -272T55 -196Q55 -170 71 -158T104 -146Q123 -146 138 -159T153 -195Q153 -206 149 -215T139 -230T127 -238T117 -242L113 -244ZM460 -244Q460 -246 466 -251T486 -263T514 -269Q532 -269 546 -260Q567 -247 579 -218T598 -133T609 -15T623 155T644 367Q647 390 652 438T661 512T672 580T687 647T708 703T737 751T775 784T826 804Q828 804 835 804T848 805Q899 802 928 769T957 695Q957 669 941 657T908 645Q889 645 874 658T859 694Q859 705 863 714T873 729T885 737T895 742L899 743Q899 745 892 751T872 762T845 768Q822 768 807 756T781 716T765 652T754 559T745 444T734 300T716 133Q696 -38 684 -102T650 -207Q603 -306 516 -306Q466 -306 434 -272T402 -196Q402 -170 418 -158T451 -146Q470 -146 485 -159T500 -195Q500 -206 496 -215T486 -230T474 -238T464 -242L460 -244",
        8749: "113 -244Q113 -246 119 -251T139 -263T167 -269Q186 -269 199 -260Q220 -247 232 -218T251 -133T262 -15T276 155T297 367Q300 390 305 438T314 512T325 580T340 647T361 703T390 751T428 784T479 804Q481 804 488 804T501 805Q552 802 581 769T610 695Q610 669 594 657T561 645Q542 645 527 658T512 694Q512 705 516 714T526 729T538 737T548 742L552 743Q552 745 545 751T525 762T498 768Q475 768 460 756T434 716T418 652T407 559T398 444T387 300T369 133Q349 -38 337 -102T303 -207Q256 -306 169 -306Q119 -306 87 -272T55 -196Q55 -170 71 -158T104 -146Q123 -146 138 -159T153 -195Q153 -206 149 -215T139 -230T127 -238T117 -242L113 -244ZM460 -244Q460 -246 466 -251T486 -263T514 -269Q532 -269 546 -260Q567 -247 579 -218T598 -133T609 -15T623 155T644 367Q647 390 652 438T661 512T672 580T687 647T708 703T737 751T775 784T826 804Q828 804 835 804T848 805Q899 802 928 769T957 695Q957 669 941 657T908 645Q889 645 874 658T859 694Q859 705 863 714T873 729T885 737T895 742L899 743Q899 745 892 751T872 762T845 768Q822 768 807 756T781 716T765 652T754 559T745 444T734 300T716 133Q696 -38 684 -102T650 -207Q603 -306 516 -306Q466 -306 434 -272T402 -196Q402 -170 418 -158T451 -146Q470 -146 485 -159T500 -195Q500 -206 496 -215T486 -230T474 -238T464 -242L460 -244ZM807 -244Q807 -246 813 -251T833 -263T861 -269Q880 -269 893 -260Q914 -247 926 -218T945 -133T956 -15T970 155T991 367Q994 390 999 438T1008 512T1019 580T1034 647T1055 703T1084 751T1122 784T1173 804Q1175 804 1182 804T1195 805Q1246 802 1275 769T1304 695Q1304 669 1288 657T1255 645Q1236 645 1221 658T1206 694Q1206 705 1210 714T1220 729T1232 737T1242 742L1246 743Q1246 745 1239 751T1219 762T1192 768Q1169 768 1154 756T1128 716T1112 652T1101 559T1092 444T1081 300T1063 133Q1043 -38 1031 -102T997 -207Q950 -306 863 -306Q813 -306 781 -272T749 -196Q749 -170 765 -158T798 -146Q817 -146 832 -159T847 -195Q847 -206 843 -215T833 -230T821 -238T811 -242L807 -244",
        8750: "269 74L256 80Q244 85 227 97T191 128T161 179T148 250Q148 332 199 379T302 433L306 434L307 444Q309 456 313 495T321 553T331 607T345 664T365 712T393 756T431 785T479 804Q481 804 488 804T501 805Q552 802 581 769T610 695Q610 669 594 657T561 645Q542 645 527 658T512 694Q512 705 516 714T526 729T538 737T548 742L552 743Q552 745 545 751T525 762T498 768Q471 768 454 752T427 693T414 626T406 536Q405 530 405 527L397 425L404 422Q410 419 421 413T445 399T470 376T494 345T511 303T518 250Q518 205 502 169T460 112T410 80T364 66L360 65L359 55Q357 38 353 4T346 -43T340 -81T333 -118T326 -148T316 -179T303 -207Q256 -306 169 -306Q119 -306 87 -272T55 -196Q55 -170 71 -158T104 -146Q123 -146 138 -159T153 -195Q153 -206 149 -215T139 -230T127 -238T117 -242L113 -244Q113 -246 119 -251T139 -263T167 -269Q186 -269 199 -260Q231 -241 242 -183T266 33L269 74ZM272 122Q272 156 300 391Q300 392 299 392Q287 392 263 379T213 331T187 249Q187 211 205 180T239 137T272 116V122ZM366 107Q378 107 402 119T453 167T479 249Q479 340 394 383V377Q394 375 394 374T393 371T393 366T392 357T391 342T389 321T386 291T382 251T377 199T369 133Q366 112 366 107",
        8756: "273 411Q273 437 291 454T334 471Q358 471 375 454T393 411T376 368T333 351Q307 351 290 368T273 411ZM84 38Q110 38 126 21T143 -22Q143 -46 127 -64T83 -82Q57 -82 41 -65T24 -22Q24 4 41 21T84 38ZM524 -22Q524 4 541 21T584 38Q608 38 625 21T643 -22Q643 -45 627 -63T583 -82Q557 -82 541 -65T524 -22",
        8757: "23 411Q23 437 41 454T84 471Q108 471 125 454T143 411T126 368T83 351Q57 351 40 368T23 411ZM523 411Q523 437 541 454T584 471Q608 471 625 454T643 411T626 368T583 351Q557 351 540 368T523 411ZM274 -22Q274 4 291 21T334 38Q356 38 374 22T392 -22T375 -65T333 -82Q307 -82 291 -65T274 -22",
        8764: "55 166Q55 241 101 304T222 367Q260 367 296 349T362 304T421 252T484 208T554 189Q616 189 655 236T694 338Q694 350 698 358T708 367Q722 367 722 334Q722 260 677 197T562 134H554Q517 134 481 152T414 196T355 248T292 293T223 311Q179 311 145 286Q109 257 96 218T80 156T69 133Q55 133 55 166",
        8765: "222 133Q147 133 102 197T56 335Q56 362 66 365Q71 369 77 364Q83 356 84 335T90 298Q102 254 137 222T223 189Q258 189 292 206T355 250T413 301T477 346T550 367Q628 367 673 309T722 171Q722 133 708 133Q703 133 699 141T694 162Q694 220 655 265T555 311Q519 311 485 293T421 248T363 196T298 152T222 133",
        8768: "55 569Q55 583 83 583Q122 583 151 565T194 519T215 464T222 411Q222 360 194 304T139 193T111 89Q111 38 134 -7T195 -55Q222 -57 222 -69Q222 -83 189 -83Q130 -83 93 -33T55 90Q55 130 72 174T110 252T148 328T166 411Q166 462 144 507T83 555Q55 556 55 569",
        8769: "220 366Q258 366 297 347T361 308T391 288Q394 288 464 370Q494 407 510 425T535 454T546 465T552 467H553Q560 467 566 461T573 448Q573 439 499 350Q424 266 424 261Q424 259 442 247T492 222T554 209Q607 209 646 243Q671 268 680 295T690 341T702 366Q719 366 719 314Q716 265 695 226Q682 199 664 179Q614 132 555 132Q517 132 477 151T412 190T383 210T347 172T278 89T233 37Q228 32 220 32Q210 32 206 38T201 48Q201 57 266 137Q272 144 275 148Q351 231 351 237Q351 239 333 251T283 276T221 289Q159 289 123 248T86 166Q86 156 82 145T73 132Q55 132 55 172Q55 220 79 272Q95 301 111 319Q161 366 220 366",
        8770: "55 439T55 443T56 449T62 456T68 463H706Q720 449 720 443T706 423H68Q55 439 55 443ZM56 72Q56 112 73 152T130 225T224 257Q259 257 294 240T360 199T419 149T484 107T553 90Q603 90 643 125T691 223Q693 257 704 257Q717 257 717 221Q717 147 671 91T554 34Q517 34 481 51T414 93T355 142T291 184T222 201Q172 201 131 167T84 67Q81 34 71 34Q56 37 56 72",
        8771: "55 283Q55 356 103 409T217 463Q262 463 297 447T395 382Q431 355 446 344T493 320T554 307H558Q613 307 652 344T694 433Q694 464 708 464T722 432Q722 356 673 304T564 251H554Q510 251 465 275T387 329T310 382T223 407H219Q164 407 122 367Q91 333 85 295T76 253T69 250Q55 250 55 283ZM56 56Q56 71 72 76H706Q722 70 722 56Q722 44 707 36H70Q56 43 56 56",
        8773: "55 388Q55 463 101 526T222 589Q260 589 296 571T362 526T421 474T484 430T554 411Q616 411 655 458T694 560Q694 572 698 580T708 589Q722 589 722 556Q722 482 677 419T562 356H554Q517 356 481 374T414 418T355 471T292 515T223 533Q179 533 145 508Q109 479 96 440T80 378T69 355Q55 355 55 388ZM56 236Q56 249 70 256H707Q722 248 722 236Q722 225 708 217L390 216H72Q56 221 56 236ZM56 42Q56 57 72 62H708Q722 52 722 42Q722 30 707 22H70Q56 29 56 42",
        8775: "55 417Q55 479 101 528T222 578Q259 578 294 564T393 507Q413 493 434 480T469 460T484 454L537 549Q587 639 595 647Q600 652 607 652Q615 652 621 647T628 634Q628 625 575 536Q524 446 524 443Q527 440 555 440Q603 440 644 469T691 547Q694 578 706 578T718 556Q718 555 718 551T717 545Q717 488 684 445T595 387Q582 384 558 384Q530 384 508 389L493 394L404 238L557 236H708Q720 224 720 217T706 196H379L291 43L499 41H708Q720 29 720 21T706 1H268L226 -71Q186 -143 179 -148Q173 -155 165 -155T152 -150T146 -137Q146 -133 184 -64L222 1H144L66 3L59 7Q54 14 54 20Q54 29 66 41H246L333 194Q333 196 202 196H68Q55 211 55 218T66 236H213L357 238L457 409L437 421Q432 423 393 450T307 500T222 523Q171 523 129 491T84 414Q82 383 70 383Q55 383 55 417",
        8776: "55 319Q55 360 72 393T114 444T163 472T205 482Q207 482 213 482T223 483Q262 483 296 468T393 413L443 381Q502 346 553 346Q609 346 649 375T694 454Q694 465 698 474T708 483Q722 483 722 452Q722 386 675 338T555 289Q514 289 468 310T388 357T308 404T224 426Q164 426 125 393T83 318Q81 289 69 289Q55 289 55 319ZM55 85Q55 126 72 159T114 210T163 238T205 248Q207 248 213 248T223 249Q262 249 296 234T393 179L443 147Q502 112 553 112Q609 112 649 141T694 220Q694 249 708 249T722 217Q722 153 675 104T555 55Q514 55 468 76T388 123T308 170T224 192Q164 192 125 159T83 84Q80 55 69 55Q55 55 55 85",
        8778: "220 523Q163 523 124 486T84 412Q81 383 69 383Q56 383 56 413Q56 441 67 470Q78 508 111 537T187 575Q203 579 219 579Q248 579 271 572Q304 565 393 508Q498 439 551 439Q620 439 662 486Q688 512 693 557Q693 565 697 572T707 579Q719 579 719 548Q719 483 673 434T550 384Q512 384 467 405T386 453T305 501T220 523ZM222 288Q164 288 124 251T84 177Q81 148 69 148Q56 148 56 178Q56 206 67 235Q78 274 111 302T187 339Q198 343 220 343Q244 343 259 341T308 322T393 272Q496 203 553 203Q612 203 651 241T691 312Q693 343 705 343Q719 343 719 313Q719 245 673 199Q626 148 552 148Q513 148 467 170T385 218T304 266T222 288ZM51 -19Q51 -6 62 -1H387Q713 -1 715 -3Q725 -10 725 -20Q725 -27 718 -34Q714 -38 672 -38T387 -39H62Q51 -25 51 -19",
        8781: "55 464Q55 471 60 477T74 484Q80 484 108 464T172 420T268 376T389 356Q436 356 483 368T566 399T630 436T675 467T695 482Q701 484 703 484Q711 484 716 478T722 464Q722 454 707 442Q550 316 389 316Q338 316 286 329T195 362T124 402T76 437T57 456Q55 462 55 464ZM57 45Q66 58 109 88T230 151T381 183Q438 183 494 168T587 135T658 94T703 61T720 45Q722 39 722 36Q722 28 717 22T703 16Q697 16 669 36T606 80T510 124T389 144Q341 144 294 132T211 101T147 64T102 33T82 18Q76 16 74 16Q66 16 61 22T55 36Q55 39 57 45",
        8782: "245 367Q251 415 288 453T392 492Q445 492 485 456T532 367H707Q722 359 722 347Q722 334 711 331T665 327H608H509Q500 332 498 336Q496 338 493 363T472 411Q443 451 389 451H387Q335 451 305 411Q290 392 287 374T282 344T268 327H72Q56 332 56 347Q56 360 70 367H245ZM56 153Q56 168 72 173H268Q277 168 279 164Q281 162 284 137T305 89Q334 49 389 49H391Q442 49 472 89Q487 108 490 126T495 156T509 173H608H666Q701 173 711 170T722 153T707 133H532Q526 81 486 45T389 8Q331 8 291 45T245 133H70Q56 140 56 153",
        8783: "245 367Q251 415 288 453T392 492Q445 492 485 456T532 367H707Q722 359 722 347Q722 334 711 331T665 327H608H509Q500 332 498 336Q496 338 493 363T472 411Q443 451 389 451H387Q335 451 305 411Q290 392 287 374T282 344T268 327H72Q56 332 56 347Q56 360 70 367H245ZM56 153Q56 168 72 173H708Q722 163 722 153Q722 140 707 133H70Q56 140 56 153",
        8784: "56 347Q56 360 70 367H707Q722 359 722 347Q722 336 708 328L390 327H72Q56 332 56 347ZM56 153Q56 168 72 173H708Q722 163 722 153Q722 140 707 133H70Q56 140 56 153ZM329 610Q329 634 346 652T389 670Q413 670 431 654T450 611Q450 586 433 568T390 550T347 567T329 610",
        8785: "421 474T389 474T339 493T321 541Q321 566 337 587T391 609Q456 602 456 541Q456 512 439 493ZM56 347Q56 360 70 367H707Q722 359 722 347Q722 336 708 328L390 327H72Q56 332 56 347ZM56 153Q56 168 72 173H708Q722 163 722 153Q722 140 707 133H70Q56 140 56 153ZM421 -108T389 -108T339 -89T321 -41Q321 -16 337 5T391 27Q456 20 456 -41Q456 -70 439 -89",
        8786: "15 541Q15 569 33 585T75 601T117 585T135 541Q135 514 118 498T75 481T32 498T15 541ZM56 347Q56 360 70 367H707Q722 359 722 347Q722 336 708 328L390 327H72Q56 332 56 347ZM56 153Q56 168 72 173H708Q722 163 722 153Q722 140 707 133H70Q56 140 56 153ZM642 -41Q642 -17 658 0T702 18Q726 18 744 3T762 -41Q762 -67 745 -84T702 -101Q676 -101 659 -85T642 -41",
        8787: "642 541Q642 569 660 585T702 601T744 585T762 541Q762 515 745 498T702 481Q676 481 659 497T642 541ZM56 347Q56 360 70 367H707Q722 359 722 347Q722 336 708 328L390 327H72Q56 332 56 347ZM56 153Q56 168 72 173H708Q722 163 722 153Q722 140 707 133H70Q56 140 56 153ZM14 -41Q14 -15 31 1T74 18Q101 18 118 0T135 -41Q135 -64 118 -83T75 -102Q51 -102 33 -85T14 -41",
        8790: "56 347Q56 360 70 367H707Q722 359 722 347Q722 334 711 331T658 327H586H465L472 318Q496 288 496 250T472 182L465 173H586H663Q700 173 711 170T722 153T707 133H70Q56 140 56 153Q56 168 72 173H312L305 182Q281 212 281 250T305 318L312 327H72Q56 332 56 347ZM473 250Q473 265 472 273T460 297T428 327H349Q328 313 318 298T306 273T304 250Q304 235 305 227T317 203T349 173H428Q449 187 459 202T471 227T473 250",
        8791: "279 612Q279 656 310 688T388 721Q433 721 465 689T498 612Q498 573 470 538T389 503Q336 503 308 538T279 612ZM458 614Q458 637 452 651T433 672T411 679T383 680T352 675T333 664T324 647T321 629T320 611Q320 593 321 584T332 562T359 545Q366 543 389 543H391Q406 543 414 544T435 552T452 573T458 614ZM56 347Q56 360 70 367H707Q722 359 722 347Q722 336 708 328L390 327H72Q56 332 56 347ZM56 153Q56 168 72 173H708Q722 163 722 153Q722 140 707 133H70Q56 140 56 153",
        8796: "192 482H190Q187 483 185 484T181 488T177 493T175 501Q175 506 178 512Q184 523 278 687T375 853Q379 857 383 857Q385 857 387 858T390 859Q397 859 403 853Q405 851 499 687T600 512Q603 506 603 501Q603 488 587 482H192ZM548 523L389 798Q388 798 309 661T230 523T389 522T548 523ZM56 347Q56 360 70 367H708Q723 359 723 347Q723 336 709 328L390 327H72Q56 332 56 347ZM56 153Q56 168 72 173H709Q723 163 723 153Q723 140 708 133H70Q56 140 56 153",
        8800: "166 -215T159 -215T147 -212T141 -204T139 -197Q139 -190 144 -183L306 133H70Q56 140 56 153Q56 168 72 173H327L406 327H72Q56 332 56 347Q56 360 70 367H426Q597 702 602 707Q605 716 618 716Q625 716 630 712T636 703T638 696Q638 692 471 367H707Q722 359 722 347Q722 336 708 328L451 327L371 173H708Q722 163 722 153Q722 140 707 133H351Q175 -210 170 -212Q166 -215 159 -215",
        8801: "56 444Q56 457 70 464H707Q722 456 722 444Q722 430 706 424H72Q56 429 56 444ZM56 237T56 250T70 270H707Q722 262 722 250T707 230H70Q56 237 56 250ZM56 56Q56 71 72 76H706Q722 70 722 56Q722 44 707 36H70Q56 43 56 56",
        8804: "674 636Q682 636 688 630T694 615T687 601Q686 600 417 472L151 346L399 228Q687 92 691 87Q694 81 694 76Q694 58 676 56H670L382 192Q92 329 90 331Q83 336 83 348Q84 359 96 365Q104 369 382 500T665 634Q669 636 674 636ZM84 -118Q84 -108 99 -98H678Q694 -104 694 -118Q694 -130 679 -138H98Q84 -131 84 -118",
        8805: "83 616Q83 624 89 630T99 636Q107 636 253 568T543 431T687 361Q694 356 694 346T687 331Q685 329 395 192L107 56H101Q83 58 83 76Q83 77 83 79Q82 86 98 95Q117 105 248 167Q326 204 378 228L626 346L360 472Q291 505 200 548Q112 589 98 597T83 616ZM84 -118Q84 -108 99 -98H678Q694 -104 694 -118Q694 -130 679 -138H98Q84 -131 84 -118",
        8806: "674 753Q682 753 688 747T694 732T687 718Q686 717 417 589L151 463L399 345Q687 209 691 204Q694 198 694 193Q694 175 676 173H670L382 309Q92 446 90 448Q83 453 83 465Q84 476 96 482Q104 486 382 617T665 751Q669 753 674 753ZM84 39Q84 49 99 59H678Q694 53 694 39Q694 26 679 19H98Q84 26 84 39ZM83 -157Q83 -153 84 -150T86 -145T89 -141T92 -139T96 -137T99 -135H678Q694 -146 694 -155Q694 -168 679 -175H98Q84 -168 83 -157",
        8807: "83 733Q83 741 89 747T99 753Q107 753 253 685T543 548T687 478Q694 473 694 463T687 448Q685 446 395 309L107 173H101Q83 175 83 193Q83 194 83 196Q82 203 98 212Q117 222 248 284Q326 321 378 345L626 463L360 589Q291 622 200 665Q112 706 98 714T83 733ZM84 39Q84 49 99 59H678Q694 53 694 39Q694 26 679 19H98Q84 26 84 39ZM83 -157Q83 -153 84 -150T86 -145T89 -141T92 -139T96 -137T99 -135H678Q694 -146 694 -155Q694 -168 679 -175H98Q84 -168 83 -157",
        8808: "86 472Q93 477 381 614T673 752Q680 752 686 746T693 732T689 721Q686 715 418 590L151 461L418 332Q684 207 689 201Q693 195 693 190Q693 183 687 177T675 170Q668 170 380 307T86 450Q82 454 82 461Q82 467 86 472ZM82 33Q82 37 83 40T89 47T95 54H473L520 105Q569 156 571 156Q573 157 578 157Q586 157 592 151T598 136Q598 130 562 92L526 56L604 54H682Q693 43 693 35Q693 31 692 28T686 21T680 14H489L342 -139L513 -142H682Q693 -148 693 -160Q693 -167 680 -182H304L258 -230Q248 -240 237 -251T221 -268T211 -278T203 -284T197 -286Q189 -286 184 -280T178 -264Q178 -257 213 -219L249 -182H171L93 -179L86 -175Q82 -170 82 -163Q82 -155 95 -142H289L360 -64L433 14H262L93 16Q82 23 82 33",
        8809: "89 745Q95 752 100 752Q106 752 394 615T689 472Q693 468 693 461T689 450Q684 445 396 308T100 170Q95 170 89 176T82 190Q82 195 86 201Q91 208 358 332L624 461L358 590Q90 715 86 721Q82 725 82 731Q82 739 89 745ZM82 33Q82 37 83 40T89 47T95 54H473L520 105Q569 156 571 156Q573 157 578 157Q586 157 592 151T598 136Q598 130 562 92L526 56L604 54H682Q693 43 693 35Q693 31 692 28T686 21T680 14H489L342 -139L513 -142H682Q693 -148 693 -160Q693 -167 680 -182H304L258 -230Q248 -240 237 -251T221 -268T211 -278T203 -284T197 -286Q189 -286 184 -280T178 -264Q178 -257 213 -219L249 -182H171L93 -179L86 -175Q82 -170 82 -163Q82 -155 95 -142H289L360 -64L433 14H262L93 16Q82 23 82 33",
        8810: "639 -48Q639 -54 634 -60T619 -67H618Q612 -67 536 -26Q430 33 329 88Q61 235 59 239Q56 243 56 250T59 261Q62 266 336 415T615 567L619 568Q622 567 625 567Q639 562 639 548Q639 540 633 534Q632 532 374 391L117 250L374 109Q632 -32 633 -34Q639 -40 639 -48ZM944 -48Q944 -54 939 -60T924 -67H923Q917 -67 841 -26Q735 33 634 88Q366 235 364 239Q361 243 361 250T364 261Q367 266 641 415T920 567L924 568Q927 567 930 567Q944 562 944 548Q944 540 938 534Q937 532 679 391L422 250L679 109Q937 -32 938 -34Q944 -40 944 -48",
        8811: "55 539T55 547T60 561T74 567Q81 567 207 498Q297 449 365 412Q633 265 636 261Q639 255 639 250Q639 241 626 232Q614 224 365 88Q83 -65 79 -66Q76 -67 73 -67Q65 -67 60 -61T55 -47Q55 -39 61 -33Q62 -33 95 -15T193 39T320 109L321 110H322L323 111H324L325 112L326 113H327L329 114H330L331 115H332L333 116L334 117H335L336 118H337L338 119H339L340 120L341 121H342L343 122H344L345 123H346L347 124L348 125H349L351 126H352L353 127H354L355 128L356 129H357L358 130H359L360 131H361L362 132L363 133H364L365 134H366L367 135H368L369 136H370L371 137L372 138H373L374 139H375L376 140L378 141L576 251Q63 530 62 533Q55 539 55 547ZM360 539T360 547T365 561T379 567Q386 567 512 498Q602 449 670 412Q938 265 941 261Q944 255 944 250Q944 241 931 232Q919 224 670 88Q388 -65 384 -66Q381 -67 378 -67Q370 -67 365 -61T360 -47Q360 -39 366 -33Q367 -33 400 -15T498 39T625 109L626 110H627L628 111H629L630 112L631 113H632L634 114H635L636 115H637L638 116L639 117H640L641 118H642L643 119H644L645 120L646 121H647L648 122H649L650 123H651L652 124L653 125H654L656 126H657L658 127H659L660 128L661 129H662L663 130H664L665 131H666L667 132L668 133H669L670 134H671L672 135H673L674 136H675L676 137L677 138H678L679 139H680L681 140L683 141L881 251Q368 530 367 533Q360 539 360 547",
        8812: "104 730Q104 749 123 749Q130 749 138 745Q186 717 237 671L250 659L261 670Q297 703 332 726T375 750T389 744T395 730Q395 721 390 717T364 699T322 668Q290 641 283 632Q280 628 281 627T293 612Q425 454 425 250Q425 144 388 51T293 -112Q282 -125 281 -126T283 -132Q306 -162 379 -209Q395 -219 395 -230Q395 -238 389 -244T375 -250T335 -228T262 -171L250 -159L238 -170Q202 -203 167 -226T124 -250T110 -244T104 -230Q104 -219 121 -209Q199 -156 216 -132Q219 -128 218 -127T206 -112Q74 46 74 250T206 612Q217 625 218 626T216 632Q199 656 121 709Q104 719 104 730ZM249 -94Q364 61 364 250Q364 430 265 574Q253 590 249 594L242 583Q134 439 134 250Q134 114 192 -1Q212 -44 242 -83L249 -94",
        8814: "693 -14T693 -20T687 -33T675 -41Q667 -41 506 37L344 112Q342 112 262 -46Q184 -196 176 -205Q172 -209 168 -209T162 -208Q155 -208 151 -203T146 -190Q146 -178 171 -137Q193 -91 251 21L306 132L198 183Q142 208 118 220T88 238T82 249Q82 253 86 261Q92 267 278 357L464 443L529 572Q561 637 577 667T597 703T607 708Q615 708 622 702T629 688Q629 680 575 579L524 474Q524 473 545 482T598 508Q666 541 673 541T686 535T693 521Q693 512 679 504T589 459L493 414L360 150Q366 148 378 142T431 116T529 70Q686 -8 689 -10Q693 -14 693 -20ZM380 277L433 383Q432 385 292 319T151 250T237 209T324 170L380 277",
        8815: "82 514T82 520T89 533T100 541Q106 541 271 463Q434 386 435 386L515 543Q593 699 600 706Q604 708 607 708Q615 708 622 702T629 688T549 526Q509 445 491 407T473 368Q522 343 580 317Q636 291 660 278T688 261T693 250V249Q693 241 681 234T580 184Q533 161 502 146Q317 59 315 59Q312 56 246 -74Q197 -170 186 -189T168 -209Q164 -209 162 -208Q155 -208 151 -203T146 -190Q146 -187 200 -79L253 28L218 11Q182 -6 144 -23T100 -41Q95 -41 89 -35T82 -21Q82 -12 96 -4T186 41L284 88L349 217Q377 273 395 311T413 350Q413 351 253 428Q101 498 86 510Q82 514 82 520ZM624 250Q461 330 455 330Q454 331 453 329T448 321T441 308T430 287T416 259T398 223L342 114L624 250",
        8816: "82 -124Q82 -120 83 -117T89 -110T95 -103H220L284 50Q346 204 344 206L218 268Q153 297 123 313T87 333T82 344T86 355Q104 369 291 455Q491 552 491 553L542 673Q581 767 590 784T609 801Q616 801 622 795T629 781Q629 773 586 677Q546 581 546 577L609 606Q669 635 673 635Q680 635 686 629T693 615Q693 610 692 608T670 593T604 561L524 521L400 226L542 157Q617 123 649 107T687 85T694 72Q694 66 690 60T679 54Q664 54 526 121Q513 127 495 136T464 150T438 162T416 173T399 180T388 185L384 186Q383 186 322 41L262 -103H680Q682 -105 684 -108T688 -113T691 -118T693 -124Q693 -134 682 -141L464 -143H246L213 -219Q182 -292 178 -299Q172 -303 166 -303T153 -297T146 -283Q146 -282 174 -213T202 -143H146L93 -141Q82 -134 82 -124ZM418 370L466 495Q464 495 308 420T151 344T204 317T311 267T364 244Q364 247 418 370",
        8817: "97 54Q82 54 82 72Q82 79 86 84Q95 91 222 153L351 215L398 324L442 433L258 519Q95 597 87 604Q82 608 82 615T88 628T102 635Q107 635 424 484L458 468L524 630Q593 789 597 795Q601 801 609 801Q616 801 622 795T629 781L562 615L493 450L589 406Q665 371 679 362T694 344Q694 339 693 337T677 326T631 302T538 257Q504 241 465 223T406 195T386 186Q384 185 322 39L262 -103H680Q682 -105 684 -108T688 -113T691 -118T693 -124Q693 -134 682 -141L464 -143H246L213 -219Q182 -292 178 -299Q172 -303 166 -303T153 -297T146 -283Q146 -282 174 -213T202 -143H146L93 -141Q82 -134 82 -124Q82 -120 83 -117T89 -110T95 -103H220L273 26Q326 156 326 157L218 106Q109 54 97 54ZM553 379Q480 412 480 415Q479 415 460 372T423 285T406 241Q408 240 516 291T624 344L553 379",
        8818: "674 732Q682 732 688 726T694 711T687 697Q686 696 417 568L151 442L399 324Q687 188 691 183Q694 177 694 172Q694 154 676 152H670L382 288Q92 425 90 427Q83 432 83 444Q84 455 96 461Q104 465 382 596T665 730Q669 732 674 732ZM56 -194Q56 -107 106 -51T222 6Q260 6 296 -12T362 -56T420 -108T483 -153T554 -171Q616 -171 654 -128T694 -29Q696 6 708 6Q722 6 722 -26Q722 -102 676 -164T557 -227Q518 -227 481 -209T415 -165T358 -113T294 -69T223 -51Q163 -51 125 -93T83 -196Q81 -228 69 -228Q56 -228 56 -202V-194",
        8819: "90 697Q83 704 83 712T88 726T99 732Q107 732 253 664T543 527T687 457Q694 452 694 442T687 427Q685 425 395 288L107 152H101Q83 154 83 172Q83 173 83 175Q82 182 98 191Q117 201 248 263Q326 300 378 324L626 442L360 568Q91 696 90 697ZM56 -194Q56 -107 106 -51T222 6Q260 6 296 -12T362 -56T420 -108T483 -153T554 -171Q616 -171 654 -128T694 -29Q696 6 708 6Q722 6 722 -26Q722 -102 676 -164T557 -227Q518 -227 481 -209T415 -165T358 -113T294 -69T223 -51Q163 -51 125 -93T83 -196Q81 -228 69 -228Q56 -228 56 -202V-194",
        8822: "734 181Q734 173 728 167T714 161Q711 161 386 280T54 404Q44 408 44 421Q44 432 52 437Q66 443 388 562T714 681Q721 681 727 675T734 661Q734 651 722 645Q711 639 462 546Q441 539 420 531L122 421L420 311L723 198Q734 192 734 181ZM44 247Q44 255 50 261T63 267Q66 267 391 148T723 24Q734 18 734 7T723 -10Q716 -14 391 -133T63 -253Q56 -253 50 -247T44 -233Q44 -223 55 -217Q67 -210 317 -118Q337 -110 357 -103L655 7L357 117L54 230Q44 236 44 247",
        8823: "83 661Q83 668 88 674T104 681Q111 679 396 560Q686 437 687 436Q694 431 694 421T687 406Q686 405 543 344T253 222T101 161Q83 163 83 180Q83 194 95 199Q96 199 130 213T232 257T361 311L621 421L357 532Q307 553 233 584Q121 631 102 640T83 661ZM673 267Q694 267 694 248Q694 237 687 232Q684 229 420 118L156 7L416 -103L683 -215Q694 -222 694 -233Q694 -251 676 -253Q670 -253 524 -192T235 -70T90 -8Q83 -1 83 7Q83 19 94 24Q97 25 378 144T667 266Q669 267 673 267",
        8826: "84 249Q84 262 91 266T117 270Q120 270 126 270T137 269Q388 273 512 333T653 512Q657 539 676 539Q685 538 689 532T694 520V515Q689 469 672 431T626 366T569 320T500 286T435 265T373 249Q379 248 404 242T440 233T477 221T533 199Q681 124 694 -17Q694 -41 674 -41Q658 -41 653 -17Q646 41 613 84T533 154T418 197T284 220T137 229H114Q104 229 98 230T88 235T84 249",
        8827: "84 517Q84 539 102 539Q115 539 119 529T125 503T137 459T171 404Q277 275 640 269H661Q694 269 694 249T661 229H640Q526 227 439 214T283 173T173 98T124 -17Q118 -41 103 -41Q83 -41 83 -17Q88 29 105 67T151 132T208 178T277 212T342 233T404 249Q401 250 380 254T345 263T302 276T245 299Q125 358 92 468Q84 502 84 517",
        8828: "112 270Q83 270 83 290Q83 301 94 307Q98 310 118 310Q516 310 620 464Q635 486 642 510T651 548T657 571T675 580Q693 577 693 559V552Q684 472 628 410T465 314Q436 303 372 290Q373 290 388 287T425 278T465 266Q674 199 693 28L694 17Q688 5 683 3Q677 0 673 0Q656 0 653 24Q623 270 118 270H112ZM110 116Q83 116 83 136T110 156H113Q134 156 160 155T231 146T318 128T407 95T489 44T550 -30T583 -131Q583 -153 563 -153Q556 -153 553 -152T547 -145T542 -127Q531 -54 478 0Q425 53 333 83T123 116H110",
        8829: "668 310Q694 310 694 290Q694 285 691 279Q684 271 664 270Q550 268 464 257T301 220T179 146T124 27Q119 0 103 0T83 16Q83 21 83 31T92 68T113 121T157 177T229 231Q295 268 405 290Q404 290 389 293T352 302T312 314Q138 371 96 500Q83 541 83 562Q83 568 89 574T103 580Q115 580 120 570T126 542T138 497T173 442Q289 310 659 310H668ZM194 -131Q201 -60 241 -6T343 82T477 133T628 155Q632 155 644 155T661 156Q685 155 690 147Q694 143 694 136Q694 132 693 129T689 124T685 120T681 117L656 116Q596 114 543 106T436 79T342 35T272 -33T235 -127Q231 -154 212 -154Q203 -153 199 -147T194 -136V-131",
        8830: "84 442Q84 455 91 459T117 463Q120 463 126 463T137 462Q388 466 512 526T653 705Q657 732 676 732Q685 731 689 725T694 714V708Q689 662 672 624T626 559T569 513T500 479T435 458T373 442Q379 441 404 435T440 426T477 414T533 392Q592 362 630 319T681 241T694 174Q694 153 674 153Q662 153 657 163T652 188T640 231T606 287Q500 416 137 422H114Q104 422 98 423T88 428T84 442ZM56 -194Q56 -107 106 -51T222 6Q260 6 296 -12T362 -56T420 -108T483 -153T554 -171Q616 -171 654 -128T694 -29Q696 6 708 6Q722 6 722 -26Q722 -102 676 -164T557 -227Q518 -227 481 -209T415 -165T358 -113T294 -69T223 -51Q163 -51 125 -93T83 -196Q81 -228 69 -228Q56 -228 56 -202V-194",
        8831: "84 710Q84 732 102 732Q115 732 119 722T125 696T137 652T171 597Q277 468 640 462H661Q694 462 694 442T661 422H640Q578 421 526 417T415 403T309 376T222 333T156 268T124 179Q122 162 118 158T103 153Q100 153 98 153T95 154T93 155T90 158T85 163Q83 167 83 176Q88 222 105 260T151 325T208 371T277 405T342 426T404 442Q401 443 380 447T345 456T302 469T245 492Q125 551 92 661Q84 695 84 710ZM56 -194Q56 -107 106 -51T222 6Q260 6 296 -12T362 -56T420 -108T483 -153T554 -171Q616 -171 654 -128T694 -29Q696 6 708 6Q722 6 722 -26Q722 -102 676 -164T557 -227Q518 -227 481 -209T415 -165T358 -113T294 -69T223 -51Q163 -51 125 -93T83 -196Q81 -228 69 -228Q56 -228 56 -202V-194",
        8832: "386 292Q388 292 439 393T543 598T598 703Q599 703 603 704T609 705Q616 705 622 699T629 685T533 494Q440 308 440 305Q451 310 462 312Q547 342 592 388T651 505Q654 525 658 532T673 539Q680 539 686 533T693 519Q693 495 678 450Q638 341 500 283Q433 259 418 259Q416 259 411 251T406 241T415 239Q482 224 544 190Q674 121 691 -10Q693 -28 691 -32Q684 -43 672 -43Q664 -43 658 -37Q656 -33 650 -6T634 47T589 109T500 168Q473 179 436 190T388 201H386L284 -1Q261 -45 232 -101T191 -181T178 -206Q176 -206 172 -207T166 -208Q160 -208 153 -202T146 -188Q146 -185 246 12Q344 206 344 210Q344 213 305 217T213 225T124 228H95Q82 241 82 248Q82 253 95 268H124Q172 268 236 273T343 283T386 292",
        8833: "103 -43Q96 -43 89 -39T82 -26L84 -10Q105 141 275 212Q342 236 355 236Q360 236 364 245L369 256H360Q284 280 275 283Q115 351 86 490Q82 507 82 517Q82 526 88 532T103 538Q110 538 115 534Q119 531 122 517T128 486T143 444T174 397T231 351T320 310Q371 292 389 292L491 496Q595 701 598 703Q599 703 603 704T609 705Q616 705 622 699T629 685Q629 684 531 485Q431 296 431 288Q431 278 520 273T651 268H680Q693 253 693 248Q693 241 680 228H651Q591 228 491 218T386 201L284 -1Q261 -45 232 -101T191 -181T178 -206Q176 -206 172 -207T166 -208Q160 -208 153 -202T146 -188Q146 -182 302 125L335 190L324 185Q313 185 289 172Q241 153 208 128T159 78T135 31T124 -11T118 -37Q112 -43 103 -43",
        8834: "84 250Q84 372 166 450T360 539Q361 539 370 539T395 539T430 540T475 540T524 540H679Q694 532 694 520Q694 511 681 501L522 500H470H441Q366 500 338 496T266 472Q244 461 224 446T179 404T139 337T124 250V245Q124 157 185 89Q244 25 328 7Q348 2 366 2T522 0H681Q694 -10 694 -20Q694 -32 679 -40H526Q510 -40 480 -40T434 -41Q350 -41 289 -25T172 45Q84 127 84 250",
        8835: "83 520Q83 532 98 540H251Q267 540 297 540T343 541Q427 541 488 525T605 455Q693 374 693 250Q693 165 650 99T545 0T415 -39Q407 -40 251 -40H98Q83 -32 83 -20Q83 -10 96 0H255H308H337Q412 0 439 4T512 28Q533 39 553 54T599 96T639 163T654 250Q654 341 592 411Q557 449 512 472Q468 491 439 495T335 500H306H255L96 501Q83 511 83 520",
        8838: "84 346Q84 468 166 546T360 635Q361 635 370 635T395 635T430 636T475 636T524 636H679Q694 628 694 616Q694 607 681 597L522 596H470H441Q366 596 338 592T266 568Q244 557 224 542T179 500T139 433T124 346V341Q124 253 185 185Q244 121 328 103Q348 98 366 98T522 96H681Q694 86 694 76Q694 64 679 56H526Q510 56 480 56T434 55Q350 55 289 71T172 141Q84 223 84 346ZM104 -131T104 -118T118 -98H679Q694 -106 694 -118T679 -138H118Q104 -131 104 -118",
        8839: "83 616Q83 628 98 636H251Q267 636 297 636T343 637Q427 637 488 621T605 551Q693 470 693 346Q693 261 650 195T545 96T415 57Q407 56 251 56H98Q83 64 83 76Q83 86 96 96H255H308H337Q412 96 439 100T512 124Q533 135 553 150T599 192T639 259T654 346Q654 437 592 507Q557 545 512 568Q468 587 439 591T335 596H306H255L96 597Q83 607 83 616ZM84 -131T84 -118T98 -98H659Q674 -106 674 -118T659 -138H98Q84 -131 84 -118",
        8840: "146 -283Q146 -282 174 -213T202 -143H115Q102 -127 102 -123T115 -103H220L291 68L278 73Q203 101 153 157T86 288Q83 309 83 344Q83 380 86 399Q107 480 160 539Q222 601 298 621Q328 630 345 631T435 635L526 637L560 715Q587 778 593 789T609 801Q616 801 622 795T629 781Q629 780 625 771T614 742T600 706L571 637Q571 635 626 635H680Q693 620 693 613T689 601L682 597L618 595H553L449 346Q425 288 399 223T359 127T346 95H356Q365 95 381 95T417 94T463 93T515 93H682Q693 82 693 74T680 53H511Q420 55 335 55L329 57L262 -103H680Q682 -105 684 -108T688 -113T691 -118T693 -124Q693 -134 682 -141L464 -143H246L213 -219Q182 -292 178 -299Q172 -303 166 -303T153 -297T146 -283ZM509 590Q509 595 438 595Q354 595 318 586Q246 567 195 516T126 395Q123 378 123 344T126 293Q141 229 184 181T291 110L306 104L406 346L509 590",
        8841: "82 606T82 613T95 635H251H348Q408 635 435 632T502 615L515 608L520 617Q520 619 558 708Q584 774 591 787T609 801Q616 801 622 795T629 781Q629 775 562 615L551 590L569 577Q646 527 678 437Q691 398 691 344T678 250Q653 182 597 132T469 64Q427 53 366 53H326L295 -25L262 -103H660Q673 -118 673 -124Q673 -129 669 -136L662 -141L453 -143H246L213 -219Q182 -292 178 -299Q172 -303 166 -303T153 -297T146 -283Q146 -282 174 -213T202 -143H95Q82 -128 82 -123T95 -103H220L251 -25L284 53H189L93 55L86 59Q82 64 82 71T95 93H302L400 333Q498 569 498 573L444 590Q431 593 260 595L93 597L86 601Q82 606 82 613ZM652 344V354Q652 451 575 521Q571 526 557 538T537 551Q534 551 533 548Q533 543 438 319L344 95L371 93H386Q487 93 557 150T649 293Q652 309 652 344",
        8842: "693 72Q693 68 692 66T686 59T680 52H524Q398 52 367 53T309 63Q236 82 180 132T98 250Q84 288 84 343Q84 397 98 437Q126 515 193 568T346 632Q347 632 373 633T440 634T520 635H680Q693 620 693 615Q693 608 680 595H526Q364 595 353 592Q279 582 221 539T138 430Q124 392 124 343Q124 296 138 257Q163 192 221 149T353 95Q364 92 526 92H680Q693 79 693 72ZM102 -132T102 -125T115 -103H382L420 -68Q429 -60 438 -52T452 -39T463 -28T472 -20T478 -14T483 -10T487 -7T490 -6T493 -5T496 -5Q502 -5 508 -12T515 -28Q515 -34 513 -37Q512 -38 507 -42T492 -55T475 -70L440 -101L562 -103H682Q693 -114 693 -122T680 -143H395L355 -179Q289 -241 280 -241Q273 -241 267 -235T260 -221T265 -208T300 -174L335 -143H224L113 -141L106 -137Q102 -132 102 -125",
        8843: "82 615Q82 620 95 635H251Q378 635 409 634T469 623Q540 605 596 555T678 437Q691 397 691 343T678 250Q649 172 581 119T426 55Q415 52 251 52H95Q93 55 89 59T84 65T82 72Q82 79 95 92H249Q411 92 422 95Q496 105 554 148T638 257Q651 296 651 343Q651 391 638 430Q613 495 555 538T422 592Q411 595 249 595H95Q82 608 82 615ZM82 -132T82 -125T95 -103H380L420 -57Q452 -21 460 -14T474 -6Q482 -6 488 -12T495 -25T451 -81L433 -101L549 -103H662Q673 -114 673 -122T660 -143H395L355 -190Q311 -239 309 -239Q305 -241 302 -241Q294 -241 287 -235T280 -221T324 -163L342 -143H218L93 -141L86 -137Q82 -132 82 -125",
        8846: "591 598H592Q604 598 611 583V376Q611 345 611 296Q610 162 606 148Q605 146 605 145Q586 68 507 23T333 -22Q268 -22 209 -1T106 66T56 173Q55 180 55 384L56 585Q66 598 75 598Q85 598 95 585V378L96 172L98 162Q112 95 181 57T332 18Q415 18 487 58T570 175Q571 180 571 383V583Q579 598 591 598ZM313 406Q313 417 313 435T312 459Q312 483 316 493T333 503T349 494T353 461V406V325H515Q516 325 519 323T527 316T531 305T527 294T520 287T515 285H353V204V152Q353 127 350 117T333 107T316 117T312 152Q312 158 312 175T313 204V285H151Q150 285 147 287T139 294T135 305T139 316T146 323T151 325H313V406",
        8847: "83 523Q87 535 99 539H679Q694 531 694 519Q694 506 679 499H123V-1H678Q694 -7 694 -21Q694 -34 679 -41H98Q93 -38 84 -28L83 247V523",
        8848: "64 506T64 519T78 539H699Q706 536 714 526V-28Q706 -38 699 -41H78Q64 -34 64 -21Q64 -6 80 -1H674V499H78Q64 506 64 519",
        8849: "94 620Q98 632 110 636H699Q714 628 714 616T699 596H134V96H698Q714 90 714 76Q714 64 699 56H109Q104 59 95 69L94 344V620ZM84 -118Q84 -103 100 -98H698Q714 -104 714 -118Q714 -130 699 -138H98Q84 -131 84 -118",
        8850: "64 603T64 616T78 636H668Q675 633 683 623V69Q675 59 668 56H78Q64 63 64 76Q64 91 80 96H643V596H78Q64 603 64 616ZM64 -118Q64 -108 79 -98H678Q694 -104 694 -118Q694 -130 679 -138H78Q64 -131 64 -118",
        8851: "83 0Q79 0 76 1T71 3T67 6T65 9T63 13T61 16V301L62 585Q70 595 76 598H592Q602 590 605 583V15Q598 2 587 0Q583 0 580 1T575 3T571 6T569 9T567 13T565 16V558H101V15Q94 2 83 0",
        8852: "77 0Q65 4 61 16V301L62 585Q72 598 81 598Q94 598 101 583V40H565V583Q573 598 585 598Q598 598 605 583V15Q602 10 592 1L335 0H77",
        8853: "56 250Q56 394 156 488T384 583Q530 583 626 485T722 250Q722 110 625 14T390 -83Q249 -83 153 14T56 250ZM364 542Q308 539 251 509T148 418T96 278V270H369V542H364ZM681 278Q675 338 650 386T592 462T522 509T458 535T412 542H409V270H681V278ZM96 222Q104 150 139 95T219 12T302 -29T366 -42H369V230H96V222ZM681 222V230H409V-42H412Q429 -42 456 -36T521 -10T590 37T649 113T681 222",
        8854: "56 250Q56 394 156 488T384 583Q530 583 626 485T722 250Q722 110 625 14T390 -83Q249 -83 153 14T56 250ZM681 278Q669 385 591 463T381 542Q283 542 196 471T96 278V270H681V278ZM275 -42T388 -42T585 32T681 222V230H96V222Q108 107 191 33",
        8855: "56 250Q56 394 156 488T384 583Q530 583 626 485T722 250Q722 110 625 14T390 -83Q249 -83 153 14T56 250ZM582 471Q531 510 496 523Q446 542 381 542Q324 542 272 519T196 471L389 278L485 375L582 471ZM167 442Q95 362 95 250Q95 137 167 58L359 250L167 442ZM610 58Q682 138 682 250Q682 363 610 442L418 250L610 58ZM196 29Q209 16 230 2T295 -27T388 -42Q409 -42 429 -40T465 -33T496 -23T522 -11T544 1T561 13T574 22T582 29L388 222L196 29",
        8856: "56 250Q56 394 156 488T384 583Q530 583 626 485T722 250Q722 110 625 14T390 -83Q249 -83 153 14T56 250ZM582 471Q581 472 571 480T556 491T539 502T517 514T491 525T460 534T424 539T381 542Q272 542 184 460T95 251Q95 198 113 150T149 80L167 58L582 471ZM388 -42Q513 -42 597 44T682 250Q682 363 610 442L196 29Q209 16 229 2T295 -27T388 -42",
        8857: "56 250Q56 394 156 488T384 583Q530 583 626 485T722 250Q722 110 625 14T390 -83Q249 -83 153 14T56 250ZM682 250Q682 322 649 387T546 497T381 542Q272 542 184 459T95 250Q95 132 178 45T389 -42Q515 -42 598 45T682 250ZM311 250Q311 285 332 304T375 328Q376 328 382 328T392 329Q424 326 445 305T466 250Q466 217 445 195T389 172Q354 172 333 195T311 250",
        8858: "57 250Q57 327 87 392T166 497T270 560T382 582H394Q512 582 610 500Q721 401 721 250Q721 112 626 15T389 -82Q251 -82 154 13T57 250ZM682 129T682 250T596 457T390 543Q269 543 183 457T96 250Q96 132 180 45T389 -43Q511 -43 596 43ZM250 250Q250 316 295 352T384 388Q451 388 489 347T528 250Q528 192 487 152T389 112Q331 112 291 152T250 250ZM488 250Q488 290 460 319T389 349Q348 349 319 320T290 250Q290 208 320 180T389 151Q431 151 459 181T488 250",
        8859: "57 250Q57 327 87 392T166 497T270 560T382 582H394Q512 582 610 500Q721 401 721 250Q721 112 626 15T389 -82Q251 -82 154 13T57 250ZM682 129T682 250T596 457T390 543Q269 543 183 457T96 250Q96 132 180 45T389 -43Q511 -43 596 43ZM204 339Q204 357 215 366T238 375Q247 375 283 348Q300 336 311 328L368 286Q369 286 366 323T359 398T355 437Q357 456 379 465Q380 465 384 465T391 466Q403 465 412 457T423 437Q423 436 420 398T413 323T410 286L467 328Q476 334 486 341T501 353T513 361T523 368T529 372T535 374T541 375Q554 375 564 365T575 339Q575 325 566 318T519 292Q504 285 496 281L430 250L496 219Q552 192 559 188T572 175Q575 168 575 161Q575 148 566 137T541 126H538Q530 126 499 149Q480 163 467 172L410 214Q409 214 412 177T419 102T423 63Q423 59 421 54T411 43T389 36T368 42T357 54T355 63Q355 64 358 102T365 177T368 214L311 172Q302 165 293 159T279 148T268 140T260 134T254 131T250 128T246 127T242 126T238 126Q223 126 214 135T204 161T213 183T282 219L348 250L282 281Q226 308 219 312T206 325Q204 330 204 339",
        8861: "57 250Q57 327 87 392T166 497T270 560T382 582H394Q512 582 610 500Q721 401 721 250Q721 112 626 15T389 -82Q251 -82 154 13T57 250ZM682 129T682 250T596 457T390 543Q269 543 183 457T96 250Q96 132 180 45T389 -43Q511 -43 596 43ZM223 250Q223 263 233 267T280 271Q289 271 325 271T389 270H490Q535 270 545 267T555 250Q555 241 549 235Q544 231 527 231T389 230Q239 230 235 232Q223 236 223 250",
        8862: "71 0Q59 4 55 16V346L56 676Q64 686 70 689H709Q719 681 722 674V15Q719 10 709 1L390 0H71ZM369 365V649H95V365H369ZM682 365V649H409V365H682ZM369 40V325H95V40H369ZM682 40V325H409V40H682",
        8863: "71 0Q59 4 55 16V346L56 676Q64 686 70 689H709Q719 681 722 674V15Q719 10 709 1L390 0H71ZM682 365V649H95V365H682ZM682 40V325H95V40H682",
        8864: "71 0Q59 4 55 16V346L56 676Q64 686 70 689H707Q714 686 722 676V13Q714 3 707 0H71ZM123 649Q147 625 214 555T335 430T389 374L654 649H123ZM95 70Q99 74 229 209T360 345L95 619V70ZM682 70V619L418 346Q417 344 549 207L682 70ZM654 41L400 304L388 315L123 41L256 40H522L654 41",
        8865: "71 0Q59 4 55 16V346L56 676Q64 686 70 689H709Q719 681 722 674V15Q719 10 709 1L390 0H71ZM682 40V649H95V40H682ZM330 345Q330 371 347 388T390 405Q412 405 430 389T448 345Q448 317 430 301T389 285T348 301T330 345",
        8866: "55 678Q55 679 56 681T58 684T61 688T65 691T70 693T77 694Q88 692 95 679V367H540Q555 359 555 347Q555 334 540 327H95V15Q88 2 77 0Q73 0 70 1T65 3T61 6T59 9T57 13T55 16V678",
        8867: "515 678Q515 679 516 681T518 684T521 688T525 691T530 693T537 694Q548 692 555 679V15Q548 2 537 0Q533 0 530 1T525 3T521 6T519 9T517 13T515 16V327H71Q70 327 67 329T59 336T55 347T59 358T66 365T71 367H515V678",
        8868: "55 642T55 648T59 659T66 666T71 668H708Q723 660 723 648T708 628H409V15Q402 2 391 0Q387 0 384 1T379 3T375 6T373 9T371 13T369 16V628H71Q70 628 67 630T59 637",
        8869: "369 652Q369 653 370 655T372 658T375 662T379 665T384 667T391 668Q402 666 409 653V40H708Q723 32 723 20T708 0H71Q70 0 67 2T59 9T55 20T59 31T66 38T71 40H369V652",
        8872: "139 -249H137Q125 -249 119 -235V251L120 737Q130 750 139 750Q152 750 159 735V367H796Q811 359 811 347Q811 336 797 328L479 327H161L159 328V172L161 173H797Q798 172 800 171T803 169T805 167T808 164T809 162T810 158T811 153Q811 140 796 133H159V-235Q151 -249 141 -249H139",
        8873: "55 678Q55 679 56 681T58 684T61 688T65 691T70 693T77 694Q88 692 95 679V15Q88 2 77 0Q73 0 70 1T65 3T61 6T59 9T57 13T55 16V678ZM249 678Q249 679 250 681T252 684T255 688T259 691T264 693T271 694Q282 692 289 679V367H651Q666 359 666 347Q666 334 651 327H289V15Q282 2 271 0Q267 0 264 1T259 3T255 6T253 9T251 13T249 16V678",
        8874: "55 678Q55 679 56 681T58 684T61 688T65 691T70 693T77 694Q88 692 95 679V15Q88 2 77 0Q73 0 70 1T65 3T61 6T59 9T57 13T55 16V678ZM237 678Q237 679 238 681T240 684T243 688T247 691T252 693T259 694Q270 692 277 679V15Q270 2 259 0Q255 0 252 1T247 3T243 6T241 9T239 13T237 16V678ZM419 678Q419 679 420 681T422 684T425 688T429 691T434 693T441 694Q452 692 459 679V367H818Q833 359 833 347Q833 334 818 327H459V15Q452 2 441 0Q437 0 434 1T429 3T425 6T423 9T421 13T419 16V678",
        8876: "56 681Q70 695 76 695T96 681V368H243L381 530Q521 692 525 692Q537 700 547 688Q554 682 554 674Q554 671 553 669T548 661T539 649T522 631T499 604T465 565T421 512Q296 373 296 368H416H476Q525 368 539 365T554 348Q554 334 543 328H261L96 141V12Q81 -1 75 -1Q65 -1 58 10L56 50V92L18 48Q7 37 -1 28T-13 14T-19 6T-23 1T-27 0T-33 -1Q-42 -1 -48 4T-55 19Q-55 24 -47 34T12 103L56 155V681ZM205 326Q205 328 152 328H96V263Q96 203 98 203Q99 203 123 231T174 290T205 326",
        8877: "56 681Q70 695 76 695T96 681V466H327L425 579Q522 692 527 692Q529 693 534 693Q542 693 547 688T553 674Q553 668 549 663Q549 662 538 650T504 611T463 563L381 468L461 466H543Q554 453 554 446T541 426H345L209 272L376 270H543Q554 257 554 251T541 230H174L96 141V12Q81 -1 75 -1Q65 -1 58 10L56 50V92L18 48Q7 37 -1 28T-13 14T-19 6T-23 1T-27 0T-33 -1Q-42 -1 -48 4T-55 19Q-55 24 -47 34T12 103L56 155V681ZM267 399L292 426H96V270H158L201 321Q256 382 267 399ZM118 228L119 229Q119 230 109 230H96V201L107 212Q118 227 118 228",
        8878: "56 681Q70 695 77 695T96 683V428L98 175L252 323V681Q264 695 272 695Q278 695 292 681V526Q292 368 296 368Q298 368 447 510Q638 695 642 695H645Q651 695 658 688T665 673Q665 666 661 661Q659 660 639 641T578 582T505 512L356 370L505 368H654Q665 357 665 349Q665 343 652 328H314L303 317L292 308V12Q289 10 285 6T279 1T272 -1Q265 -1 252 12V139Q252 266 249 266L96 119V12Q80 -1 76 -1T70 0T63 6T56 12V79L29 55Q-26 -1 -35 -1Q-42 -1 -48 5T-55 19Q-55 25 -51 30T-15 66Q5 86 18 99L56 135V681",
        8879: "56 681Q70 695 77 695T96 683V428L98 175L252 323V681Q264 695 272 695Q278 695 292 681V466H401L503 563L621 679Q637 695 645 695Q652 695 658 688T665 673Q665 670 663 666Q663 665 651 652T611 612T561 563L458 468L556 466H654Q665 455 665 447T652 426H416L294 308L292 288V270H652Q665 255 665 250T652 230H292V12Q289 10 285 6T279 1T272 -1Q265 -1 252 12V139Q252 266 249 266L96 119V12Q80 -1 76 -1T70 0T63 6T56 12V79L29 55Q-26 -1 -35 -1Q-42 -1 -48 5T-55 19Q-55 25 -51 30T-15 66Q5 86 18 99L56 135V681ZM358 426H292V361L325 392L358 426",
        8882: "694 -26Q686 -40 676 -41H670L382 95Q92 232 90 234Q83 239 83 249Q83 262 96 267Q101 270 379 401T665 537Q671 539 674 539Q686 539 694 524V-26ZM654 11T654 249T653 487T402 369T151 249L275 190Q399 131 524 72T652 11Q654 11 654 249",
        8883: "83 523Q83 524 85 527T92 535T103 539Q107 539 389 406T680 268Q694 260 694 249Q694 239 687 234Q685 232 395 95L107 -41H101Q90 -40 83 -26V523ZM376 368Q323 393 254 425T155 472L125 487Q123 487 123 249T125 11Q127 12 252 71T502 190L626 249L376 368",
        8884: "694 71Q686 58 676 56H670L382 192Q92 329 90 331Q83 336 83 346Q83 359 96 364Q101 367 379 498T665 634Q671 636 674 636Q686 636 694 621V71ZM654 108T654 346T653 584T402 466T151 346L275 287Q399 228 524 169T652 108Q654 108 654 346ZM83 -120Q83 -116 84 -113T86 -108T89 -104T92 -102T96 -100T99 -98H678Q679 -98 681 -99T684 -101T688 -104T691 -108T693 -113T694 -120Q692 -130 679 -138H98Q84 -130 83 -120",
        8885: "83 620Q83 621 85 624T92 632T103 636Q107 636 389 503T680 365Q694 357 694 346Q694 336 687 331Q685 329 395 192L107 56H101Q90 58 83 71V620ZM376 465Q323 490 254 522T155 570L125 584Q123 584 123 346T125 108Q127 109 252 168T502 287L626 346L376 465ZM83 -120Q83 -116 84 -113T86 -108T89 -104T92 -102T96 -100T99 -98H678Q679 -98 681 -99T684 -101T688 -104T691 -108T693 -113T694 -120Q692 -130 679 -138H98Q84 -130 83 -120",
        8888: "1055 250Q1055 190 1012 141T896 92Q858 92 828 106T781 140T755 180T741 214L738 228V230H405Q71 230 68 232Q55 238 55 250T68 268Q71 270 405 270H738V272L740 280Q742 287 745 297T754 321T771 348T796 374T832 396T881 408H891Q969 408 1012 360T1055 250ZM896 132Q948 132 981 166T1014 250Q1014 301 985 330T920 367Q914 368 891 368Q853 368 816 338T778 250Q778 198 812 165T896 132",
        8890: "318 -182Q302 -212 280 -212H278H275Q249 -212 239 -182L238 84V351H162L87 352Q57 362 57 391T84 429Q89 431 280 431H470L474 429Q477 427 479 426T484 423T490 417T495 410T499 402T500 391Q500 365 470 352L394 351H318V-182",
        8891: "56 697Q56 706 62 711T75 716Q86 716 90 709Q91 708 104 680T147 592T199 483L305 261L411 483Q443 548 481 629Q512 694 518 705T535 716Q543 716 549 710T555 700Q555 693 501 577T388 340T325 210Q316 194 305 194Q292 194 285 210Q282 219 224 339T111 574T56 697ZM55 14T55 20T59 31T66 38T71 40H540Q555 32 555 20T540 0H71Q70 0 67 2T59 9",
        8892: "55 698Q56 708 70 716H540Q554 708 555 698Q555 694 554 691T552 686T549 682T546 680T542 678T539 676H71Q70 676 68 677T65 679T61 682T58 686T56 691T55 698ZM555 18Q554 12 549 6T536 0H535Q525 0 515 17T459 132Q430 194 410 235L305 455L199 233Q176 185 147 125T105 36T90 7Q85 0 75 0Q63 0 58 11Q55 15 55 21Q58 31 170 266T285 507Q295 522 305 522T320 515Q322 513 439 268L555 24V18",
        8896: "119 -249T97 -249T65 -235T55 -207Q55 -201 56 -198Q58 -190 218 268T380 729Q392 750 416 750Q438 750 451 732Q453 728 534 498T695 36L775 -194Q777 -204 777 -208Q777 -222 767 -235T735 -249Q713 -249 700 -231Q696 -225 557 177L416 579L276 177Q136 -226 132 -231Q119 -249 97 -249",
        8897: "55 708Q55 729 68 739T96 750Q119 750 132 731Q136 726 276 323L416 -79L557 323Q696 725 700 731Q713 749 735 749Q756 749 766 736T777 708Q777 700 696 466T533 1T451 -232Q436 -249 416 -249Q402 -249 391 -241Q384 -236 380 -226Q368 -198 219 230Q55 697 55 708",
        8898: "139 -217Q127 -241 114 -246Q106 -249 97 -249Q67 -249 57 -220Q55 -214 55 102Q55 152 55 221T54 312Q54 422 60 464T91 554Q120 612 165 654T257 714T337 741T392 749Q393 750 402 750Q414 750 422 749Q557 749 660 659T776 430Q777 422 777 102Q777 -214 775 -220Q765 -249 735 -249Q716 -249 708 -241T694 -217L692 428L690 441Q674 540 597 603T416 666H409Q388 666 364 662T294 638T212 581Q156 523 142 441L140 428L139 105V-217",
        8899: "96 750Q103 750 109 748T120 744T127 737T133 730T137 723T139 718V395L140 73L142 60Q159 -43 237 -104T416 -166Q521 -166 597 -103T690 60L692 73L694 718Q708 749 735 749Q765 749 775 720Q777 714 777 398Q777 78 776 71Q766 -51 680 -140Q571 -249 416 -249H411Q261 -249 152 -140Q66 -51 56 71Q55 78 55 398Q55 714 57 720Q60 734 70 740Q80 750 96 750",
        8900: "242 486Q245 488 250 488Q256 488 258 486Q262 484 373 373T486 258T488 250T486 242T373 127T258 14Q256 12 250 12Q245 12 242 14Q237 16 127 126T14 242Q12 245 12 250T14 258Q16 263 126 373T242 486ZM439 250L250 439L61 250L250 61L439 250",
        8901: "78 250Q78 274 95 292T138 310Q162 310 180 294T199 251Q199 226 182 208T139 190T96 207T78 250",
        8902: "210 282Q210 284 225 381T241 480Q241 484 245 484Q249 486 251 486Q258 486 260 477T272 406Q275 390 276 380Q290 286 290 282L388 299Q484 314 487 314H488Q497 314 497 302Q497 297 434 266Q416 257 404 251L315 206L361 118Q372 98 383 75T401 40L407 28Q407 16 395 16Q394 16 392 16L390 17L250 159L110 17L108 16Q106 16 105 16Q93 16 93 28L99 40Q105 52 116 75T139 118L185 206L96 251Q6 296 4 300Q3 301 3 302Q3 314 12 314H13Q16 314 112 299L210 282",
        8903: "366 543Q374 545 382 545Q405 545 419 538Q429 534 443 521T462 496Q466 478 466 467Q466 438 444 412Q422 390 388 390Q352 390 331 412Q311 434 311 467Q311 499 331 518Q345 533 366 543ZM146 472Q146 479 153 485T166 492Q171 492 187 476T279 385L386 278L495 385Q600 492 608 492Q615 492 621 486T628 472Q628 467 614 452T531 367L435 270H706Q720 256 720 250Q720 241 706 230H435L531 132Q600 63 614 48T628 27Q628 20 622 14T608 7Q600 7 495 114L386 221L279 114Q204 39 188 23T166 7Q159 7 153 13T146 27Q146 32 160 47T244 132L339 230H68Q55 243 55 250Q55 255 68 270H339L244 367Q175 436 161 451T146 472ZM466 34Q466 4 447 -20T388 -44Q353 -44 331 -22Q311 1 311 34Q311 66 331 85Q347 101 366 110Q374 112 382 112Q405 112 419 105Q429 100 443 87T462 63Q466 45 466 34",
        8904: "833 50T833 250T832 450T659 351T487 250T658 150T832 50Q833 50 833 250ZM873 10Q866 -5 854 -5Q851 -5 845 -3L449 226L260 115Q51 -5 43 -5Q39 -5 35 -1T28 7L26 11V489Q33 505 43 505Q51 505 260 385L449 274L845 503Q851 505 853 505Q866 505 873 490V10ZM412 250L67 450Q66 450 66 250T67 50Q69 51 240 150T412 250",
        8905: "146 479Q159 492 166 492Q171 492 189 475T279 386L386 279L495 386Q598 492 608 492Q615 492 621 486T628 472Q628 464 522 357L415 250L522 144Q628 37 628 28Q628 21 622 15T608 8Q599 8 495 115L386 221L279 115Q204 40 188 24T166 8Q162 8 160 9T153 15T146 21V479ZM186 77L359 250L186 424V77",
        8906: "146 472Q146 479 152 485T166 492Q171 492 189 475T279 386L386 279L495 386Q598 492 608 492Q615 492 628 479V21Q615 8 608 8Q599 8 495 115L386 221L279 115Q204 40 188 24T166 8Q159 8 153 14T146 28Q146 37 253 144L359 250L253 357Q146 464 146 472ZM588 77V424L499 337L415 250L588 77",
        8907: "55 674Q55 682 62 688T76 694H77Q83 694 100 677T208 561Q320 440 410 342Q462 286 541 201Q677 55 699 30T722 -2Q722 -9 716 -15T701 -22T688 -17Q687 -15 542 141T394 301L388 306L240 146Q119 15 101 -3T75 -22T61 -16T55 -2Q55 4 67 19T158 117Q190 151 209 172L361 336L209 500Q62 657 57 667Q55 671 55 674",
        8908: "84 -22T76 -22T62 -16T55 -2Q55 4 78 30T249 215Q321 293 367 342Q672 672 683 682Q695 694 702 694Q710 694 716 688T722 674Q722 668 710 653T619 555Q587 521 568 500L416 336L568 172Q715 15 720 5Q722 1 722 -2Q722 -9 716 -15T702 -22H700Q693 -22 671 1T537 146L389 306Q387 304 340 253T237 143T135 33L89 -17Q84 -22 76 -22",
        8909: "56 433Q56 464 71 464Q74 464 77 461Q82 454 82 438T91 397T123 347Q166 307 222 307Q264 307 308 331T386 385T465 438T556 463Q631 463 676 408T722 283Q722 250 708 250Q704 250 699 257Q695 265 693 286T682 330Q670 350 655 367Q612 407 556 407Q514 407 470 383T393 329T314 276T222 251Q148 251 102 306T56 433ZM57 56Q57 71 73 76H706Q722 70 722 56Q722 44 707 36H71Q57 43 57 56",
        8910: "83 558Q83 566 89 572T104 578Q108 578 116 577T146 570T190 555T239 526T286 480Q308 453 325 420T351 358T367 304T376 265T380 251T381 253Q381 262 395 312Q428 434 492 499T642 576Q654 578 655 578Q664 578 670 572T676 558Q676 543 657 540T599 524T525 476Q406 362 400 29V8Q400 -21 380 -21Q369 -21 362 -11Q360 -7 360 12Q360 115 348 200T308 360T231 480T111 537Q83 540 83 558",
        8911: "104 -22Q95 -22 89 -16T83 -2Q83 11 98 16T135 23T192 46T256 103Q360 233 360 549Q360 554 360 557T361 563T362 567T364 569T367 572T371 576Q377 578 380 578Q401 578 401 547Q401 543 401 537T400 527Q409 53 648 19Q676 16 676 -2Q676 -10 670 -16T655 -22Q654 -22 642 -20Q556 -9 492 56T395 244Q381 294 381 303Q381 305 380 305T374 275T352 201T310 110T234 27T117 -20Q105 -22 104 -22",
        8912: "84 250Q84 372 166 450T360 539Q361 539 370 539T395 539T430 540T475 540T524 540H679Q694 532 694 520Q694 511 681 501L522 500H470H441Q366 500 338 496T266 472Q244 461 224 446T179 404T139 337T124 250V245Q124 157 185 89Q244 25 328 7Q348 2 366 2T522 0H681Q694 -10 694 -20Q694 -32 679 -40H526Q510 -40 480 -40T434 -41Q350 -41 289 -25T172 45Q84 127 84 250ZM694 134Q694 123 679 114H425H384Q350 114 326 121T277 154Q238 193 238 251Q238 322 295 361Q318 378 339 382T412 387Q423 387 459 387T520 386H679Q694 377 694 366Q694 354 679 346H519Q493 346 458 346T411 347Q360 347 341 342T303 315Q278 287 278 250Q278 210 301 187T351 156Q358 154 519 154H679Q694 146 694 134",
        8913: "83 520Q83 532 98 540H251Q267 540 297 540T343 541Q427 541 488 525T605 455Q693 374 693 250Q693 165 650 99T545 0T415 -39Q407 -40 251 -40H98Q83 -32 83 -20Q83 -10 96 0H255H308H337Q412 0 439 4T512 28Q533 39 553 54T599 96T639 163T654 250Q654 341 592 411Q557 449 512 472Q468 491 439 495T335 500H306H255L96 501Q83 511 83 520ZM83 366Q83 376 96 386H244Q280 386 317 386T378 386L402 387Q456 387 498 348T540 250Q540 203 512 168T446 120Q427 114 353 114H99Q84 120 84 134Q84 147 98 154H258Q284 154 319 154T366 153Q416 153 436 158T474 185Q500 214 500 250Q500 290 477 313T426 344Q419 346 258 346H98Q83 354 83 366",
        8914: "88 -21T75 -21T55 -7V200Q55 231 55 280Q56 414 60 428Q61 430 61 431Q77 500 152 549T332 598Q443 598 522 544T610 405Q611 399 611 194V-7Q604 -22 591 -22Q582 -22 572 -9L570 405Q563 433 556 449T529 485Q498 519 445 538T334 558Q251 558 179 518T96 401Q95 396 95 193V-7Q88 -21 75 -21ZM229 -21H227Q215 -21 209 -7V166Q209 304 209 327T215 363Q226 398 259 421T333 444Q380 444 414 416T455 347Q457 339 457 166V-7Q449 -21 439 -21H437H435Q423 -21 417 -7V164Q417 303 417 325T411 358Q387 403 333 403T255 358Q250 347 250 325T249 164V-7Q241 -21 231 -21H229",
        8915: "591 598H592Q604 598 611 583V376Q611 345 611 296Q610 162 606 148Q605 146 605 145Q586 68 507 23T333 -22Q268 -22 209 -1T106 66T56 173Q55 180 55 384L56 585Q66 598 75 598Q85 598 95 585V378L96 172L98 162Q112 95 181 57T332 18Q415 18 487 58T570 175Q571 180 571 383V583Q579 598 591 598ZM437 598Q450 598 457 583V410Q457 237 455 229Q448 189 414 161T333 132Q291 132 255 157T211 230Q209 237 209 412L210 585Q220 598 229 598Q242 598 249 583V412Q249 273 249 251T255 218Q279 173 333 173T411 218Q416 229 416 251T417 412V583Q425 598 437 598",
        8916: "76 -22Q64 -22 56 -7V176L57 360L59 370Q66 401 83 426T123 468T171 495T221 513T265 522T298 527L311 528H314V625L315 723Q325 736 334 736Q346 736 354 721V528H356L368 527Q380 526 399 523T441 515T490 498T537 472T578 433T606 379Q611 359 611 171V-7Q604 -21 591 -21T571 -7V170Q571 313 571 337T565 375Q555 408 526 432T461 467T402 482T365 487H354V-7Q347 -21 334 -21T314 -7V487H303Q251 484 207 467Q121 438 99 367L97 357L96 174V-9Q86 -22 76 -22",
        8918: "86 261Q92 267 381 404T673 541Q680 541 686 535T693 521T689 510Q684 504 418 379L151 250L418 121Q686 -4 689 -10Q693 -14 693 -21T687 -34T675 -41Q668 -41 380 96T86 239Q82 244 82 250Q82 257 86 261ZM610 250Q610 224 592 198T531 172Q498 172 475 195Q453 214 453 250Q453 308 513 328Q515 330 535 330Q569 328 589 304T610 250",
        8919: "82 521Q82 529 89 535T100 541Q107 541 395 404T689 261Q693 257 693 250T689 239Q684 234 396 97T100 -41Q95 -41 89 -35T82 -21Q82 -12 96 -4Q118 9 358 121L624 250L358 379Q91 503 86 510Q82 514 82 521ZM165 250Q165 282 188 306T239 330Q262 330 275 323Q303 312 318 283Q322 272 322 250Q322 213 300 195Q277 172 246 172Q224 172 213 177Q165 200 165 250",
        8920: "639 -48Q639 -54 634 -60T619 -67H618Q612 -67 536 -26Q430 33 329 88Q61 235 59 239Q56 243 56 250T59 261Q62 266 336 415T615 567L619 568Q622 567 625 567Q639 562 639 548Q639 540 633 534Q632 532 374 391L117 250L374 109Q632 -32 633 -34Q639 -40 639 -48ZM958 -48Q958 -54 953 -60T938 -67H937Q931 -67 855 -26Q749 33 648 88Q380 235 378 239Q375 243 375 250T378 261Q381 266 655 415T934 567L938 568Q941 567 944 567Q958 562 958 548Q958 540 952 534Q951 532 693 391L436 250L693 109Q951 -32 952 -34Q958 -40 958 -48ZM1277 -48Q1277 -54 1272 -60T1257 -67H1256Q1250 -67 1174 -26Q1068 33 967 88Q699 235 697 239Q694 243 694 250T697 261Q700 266 974 415T1253 567L1257 568Q1260 567 1263 567Q1277 562 1277 548Q1277 540 1271 534Q1270 532 1012 391L755 250L1012 109Q1270 -32 1271 -34Q1277 -40 1277 -48",
        8921: "75 -67Q65 -67 60 -61T55 -48Q55 -40 61 -34Q62 -32 329 109L595 250L329 391Q62 532 61 534Q55 540 55 548Q55 562 69 567H77Q81 567 222 493T506 342T653 264Q667 250 653 236Q649 234 504 157T220 7T77 -67H75ZM364 547Q364 563 381 567L384 568Q387 568 518 499T795 353T955 269Q967 261 967 250T955 231Q925 216 780 139T513 -3T383 -67Q373 -67 369 -60T364 -47Q364 -40 370 -34Q373 -31 639 109L904 250L639 391Q373 531 370 534Q364 540 364 547ZM674 538T674 548T681 562T693 567Q699 567 816 505Q915 453 993 412Q1050 382 1132 339Q1241 282 1259 271T1277 250Q1277 241 1263 232Q1246 221 985 84Q698 -67 692 -67Q674 -67 674 -47Q674 -38 680 -33Q683 -30 947 109L1213 250L947 391Q683 530 680 533Q674 538 674 548",
        8922: "674 445Q674 438 669 432T655 425T369 531T90 640Q83 645 83 655Q83 668 95 673Q644 886 654 886Q662 886 668 880T674 866Q674 856 663 850Q649 843 411 751L160 655L407 560Q474 534 561 501Q646 469 660 462T674 445ZM84 250Q84 260 99 270H658Q674 264 674 250Q674 238 659 230H98Q84 237 84 250ZM83 55Q83 68 94 73Q98 76 104 76Q108 75 383 -30T664 -138Q674 -144 674 -155Q674 -165 667 -170Q664 -173 385 -279T104 -386Q85 -386 83 -368Q83 -354 92 -349Q93 -349 347 -251L597 -155L346 -59Q296 -40 223 -12Q118 28 101 36T83 55",
        8923: "111 425T102 425T88 431T83 445V446Q83 455 96 461Q111 469 203 504Q287 536 350 560L597 655L346 751Q94 848 92 850Q83 856 83 866Q83 873 88 879T104 886Q109 885 386 779T667 670Q674 665 674 655T667 640Q665 638 388 532ZM84 250Q84 260 99 270H658Q674 264 674 250Q674 238 659 230H98Q84 237 84 250ZM653 76Q656 76 660 75T669 68T674 56Q674 46 665 40Q663 38 411 -59L160 -155L410 -251Q664 -349 665 -349Q674 -354 674 -368Q672 -386 654 -386Q650 -386 371 -279T90 -170Q83 -165 83 -155Q83 -144 93 -138Q645 76 653 76",
        8926: "113 424Q83 424 83 444Q83 453 96 464H121Q181 466 234 474T341 501T435 545T505 613T542 707Q545 734 564 734Q583 731 583 714Q583 658 560 613T500 538T414 486T321 453T229 434T156 426T113 424ZM112 270Q83 270 83 290Q83 301 94 307Q98 310 118 310Q624 310 653 556Q657 580 675 580Q693 577 693 559V552Q684 472 628 410T465 314Q436 303 372 290Q373 290 388 287T425 278T465 266Q674 199 693 28L694 17L692 14Q691 11 689 8T683 3T673 0Q657 0 653 24Q623 270 118 270H112",
        8927: "195 713Q195 725 201 729T214 734Q227 734 231 722T238 691T255 641T299 580Q405 474 656 464H681Q694 451 694 443Q694 424 670 424H664Q535 424 415 465T235 595Q195 657 195 713ZM668 310Q694 310 694 290Q694 285 691 279Q684 271 664 270Q550 268 464 257T301 220T179 146T124 27Q119 0 103 0T83 16Q83 21 83 31T92 68T113 121T157 177T229 231Q295 268 405 290Q404 290 389 293T352 302T312 314Q138 371 96 500Q83 541 83 562Q83 568 89 574T103 580Q115 580 120 570T126 542T138 497T173 442Q289 310 659 310H668",
        8928: "82 344Q82 349 95 364H124Q266 364 398 390L429 397L509 595Q519 619 536 659Q581 766 590 783T609 801Q616 801 622 795T629 781Q629 776 553 595Q533 548 516 506T489 439T480 415Q482 415 505 426T538 444Q632 498 651 601Q654 621 658 628T673 635Q680 635 686 629T693 615Q693 591 678 546Q636 433 484 375L458 364L451 348Q443 332 443 329T455 324Q480 316 503 307T560 277T619 233T664 170T691 86Q693 68 691 64Q684 53 672 53Q664 53 658 59Q657 60 650 97T617 174T538 244Q515 257 476 273T428 289Q425 289 412 256Q381 179 344 90L262 -103H680Q682 -105 684 -108T688 -113T691 -118T693 -124Q693 -134 682 -141L464 -143H246L213 -219Q182 -292 178 -299Q172 -303 166 -303T153 -297T146 -283Q146 -282 174 -213T202 -143H95Q82 -128 82 -123T95 -103H220L302 97Q384 288 384 299Q384 302 341 308T235 319T124 324H95Q82 337 82 344ZM399 338Q403 338 406 346L409 353L375 344Q375 343 384 341T399 338",
        8929: "146 -283Q146 -282 174 -213T202 -143H95Q82 -127 82 -123T95 -103H220L300 93Q343 196 374 270Q385 294 386 299L373 295Q331 287 289 268Q241 249 208 224T159 174T135 127T124 85T118 59Q112 53 103 53Q91 53 84 64Q82 68 84 86Q96 185 174 248T375 337L400 344Q399 344 381 348T351 355T316 364T276 379T235 398T193 424T155 456T122 497T98 546Q82 587 82 615Q82 622 88 628T102 635Q112 635 116 628T124 601Q128 579 134 562T159 515T207 463T290 418T415 384L422 381L506 586Q571 744 584 772T609 801Q616 801 622 795T629 781T544 577Q525 529 504 478T473 402T462 375Q480 373 500 373Q579 364 651 364H680Q682 361 686 357T691 351T693 344Q693 337 680 324H651Q553 324 451 310L433 308L349 104L262 -101L473 -103H682Q694 -115 694 -123Q694 -133 682 -141L464 -143H246L213 -219Q182 -292 178 -299Q172 -303 166 -303T153 -297T146 -283",
        8934: "86 450Q93 455 380 592T673 730Q680 730 686 724T693 710Q693 702 688 699Q686 693 417 568L151 439L417 310Q685 185 688 179Q693 176 693 168Q693 161 687 155T675 148Q668 148 380 285T86 428Q74 438 86 450ZM55 -205Q55 -175 64 -142T92 -76T145 -22T222 -1Q288 -1 362 -66Q369 -72 372 -75T378 -79T382 -81T384 -79Q389 -74 439 21Q483 100 490 111T504 122Q510 122 518 118T526 103Q526 101 510 69T467 -12T419 -99L413 -112L433 -128Q498 -180 553 -180Q605 -180 646 -139Q672 -112 681 -77T693 -21T706 -1Q719 -1 719 -33Q719 -39 717 -57Q708 -141 655 -190Q625 -224 586 -232Q568 -237 551 -237Q487 -237 413 -172L391 -155Q391 -157 335 -255Q297 -325 286 -342T268 -359Q260 -359 254 -353T248 -339T304 -230L359 -126Q359 -124 337 -107T302 -81Q262 -57 221 -57Q170 -57 130 -93T84 -201Q82 -236 70 -236Q55 -236 55 -205",
        8935: "88 723Q95 730 99 730Q106 730 394 593T688 450Q693 447 693 439T688 428Q683 423 395 286T99 148Q94 148 88 155T82 168Q82 175 86 179Q89 184 357 310L624 439L357 568Q88 694 86 699Q81 703 81 711T88 723ZM55 -205Q55 -175 64 -142T92 -76T145 -22T222 -1Q288 -1 362 -66Q369 -72 372 -75T378 -79T382 -81T384 -79Q389 -74 439 21Q483 100 490 111T504 122Q510 122 518 118T526 103Q526 101 510 69T467 -12T419 -99L413 -112L433 -128Q498 -180 553 -180Q605 -180 646 -139Q672 -112 681 -77T693 -21T706 -1Q719 -1 719 -33Q719 -39 717 -57Q708 -141 655 -190Q625 -224 586 -232Q568 -237 551 -237Q487 -237 413 -172L391 -155Q391 -157 335 -255Q297 -325 286 -342T268 -359Q260 -359 254 -353T248 -339T304 -230L359 -126Q359 -124 337 -107T302 -81Q262 -57 221 -57Q170 -57 130 -93T84 -201Q82 -236 70 -236Q55 -236 55 -205",
        8936: "95 419Q81 433 81 439T95 459H124Q318 459 455 501Q515 521 556 550T615 607T641 659T652 702T659 725Q667 730 673 730Q680 730 686 724T693 710Q693 682 677 641Q668 616 654 594T622 554T586 522T545 497T504 477T464 462T428 452T397 444T375 439Q379 437 410 430T476 411T551 379T625 321T677 237Q693 196 693 168Q693 161 687 155T673 148Q662 148 658 154T651 181Q638 253 591 300T455 377Q318 419 124 419H95ZM55 -205Q55 -175 64 -142T92 -76T145 -22T222 -1Q288 -1 362 -66Q369 -72 372 -75T378 -79T382 -81T384 -79Q389 -74 439 21Q483 100 490 111T504 122Q510 122 518 118T526 103Q526 101 510 69T467 -12T419 -99L413 -112L433 -128Q498 -180 553 -180Q605 -180 646 -139Q672 -112 681 -77T693 -21T706 -1Q719 -1 719 -33Q719 -39 717 -57Q708 -141 655 -190Q625 -224 586 -232Q568 -237 551 -237Q487 -237 413 -172L391 -155Q391 -157 335 -255Q297 -325 286 -342T268 -359Q260 -359 254 -353T248 -339T304 -230L359 -126Q359 -124 337 -107T302 -81Q262 -57 221 -57Q170 -57 130 -93T84 -201Q82 -236 70 -236Q55 -236 55 -205",
        8937: "679 459Q693 445 693 439Q693 430 679 419H651Q455 419 319 377Q231 347 184 300T124 181Q120 161 116 155T102 148Q95 148 89 154T82 168Q82 192 97 237Q111 275 137 306T188 355T249 391T307 414T361 429T399 439Q397 440 364 447T298 467T224 499T149 557T97 641Q82 686 82 710Q82 717 88 723T102 730L115 725Q118 722 124 697Q137 625 184 578T319 501Q456 459 651 459H679ZM55 -205Q55 -175 64 -142T92 -76T145 -22T222 -1Q288 -1 362 -66Q369 -72 372 -75T378 -79T382 -81T384 -79Q389 -74 439 21Q483 100 490 111T504 122Q510 122 518 118T526 103Q526 101 510 69T467 -12T419 -99L413 -112L433 -128Q498 -180 553 -180Q605 -180 646 -139Q672 -112 681 -77T693 -21T706 -1Q719 -1 719 -33Q719 -39 717 -57Q708 -141 655 -190Q625 -224 586 -232Q568 -237 551 -237Q487 -237 413 -172L391 -155Q391 -157 335 -255Q297 -325 286 -342T268 -359Q260 -359 254 -353T248 -339T304 -230L359 -126Q359 -124 337 -107T302 -81Q262 -57 221 -57Q170 -57 130 -93T84 -201Q82 -236 70 -236Q55 -236 55 -205",
        8938: "693 -30Q686 -41 673 -41Q661 -41 506 34L346 110L280 -44Q228 -162 216 -185T193 -208Q177 -208 173 -192Q173 -186 242 -30T311 128Q271 145 184 186T86 236Q82 240 82 246Q82 251 86 259Q96 267 271 350L449 434L506 565Q537 635 551 664T571 700T582 706Q587 706 593 701T600 690Q600 679 553 572Q504 463 504 461L586 501Q672 539 673 539Q679 539 693 525V-30ZM653 10V488L566 445L480 405L422 276Q415 260 405 236T388 199T376 171T368 151T366 145Q368 143 510 77T653 10ZM422 374Q422 376 420 376T285 313T151 248Q315 168 326 163Q415 356 422 374",
        8939: "82 525Q96 539 102 539Q103 539 122 530T186 501T266 463L426 388Q428 388 495 541Q564 694 569 699Q573 706 581 706Q587 706 593 702T600 691Q600 676 533 528Q515 486 506 465T485 418T470 381T466 370Q466 369 575 316Q676 269 689 259Q693 253 693 248Q693 242 689 236Q688 235 506 145Q328 63 324 59Q324 50 266 -70Q224 -169 214 -188T193 -208Q177 -208 173 -192Q173 -183 222 -77Q244 -29 257 2T269 34L186 -6Q108 -43 99 -43Q93 -43 82 -30V525ZM271 416Q129 485 126 485H125Q122 485 122 250Q122 10 124 10L211 50L295 92L411 350Q411 351 271 416ZM624 248L449 332L440 319Q434 297 393 214Q353 121 353 119Q355 119 489 182T624 248",
        8940: "82 -123Q82 -114 93 -103H166L238 -101L293 50Q349 200 349 204L220 266Q166 291 140 304T100 325T84 336T82 344Q82 353 94 360Q112 372 282 453L473 541L482 568Q487 578 529 693Q559 785 569 795Q573 802 581 802Q587 802 593 797T599 786Q599 775 564 675L526 570Q526 568 561 584T633 617T673 635Q679 635 693 621V66Q686 54 679 54Q665 54 526 119Q491 137 458 153T405 177T386 184Q385 182 334 42T282 -101T482 -103H680Q682 -105 684 -108T688 -113T691 -118T693 -124Q693 -134 682 -141L473 -143H266L238 -219Q217 -278 210 -290T193 -303Q178 -303 173 -287Q173 -279 198 -214L222 -145Q222 -143 158 -143L93 -141L86 -136Q82 -131 82 -123ZM653 106V584L506 513L453 370Q442 339 428 300T407 243T400 224Q403 222 527 164T653 106ZM453 486Q453 488 451 488T300 417T151 344L224 308Q247 298 285 279T331 257L364 241L453 486",
        8941: "82 621Q96 635 102 635T249 568L420 486L449 473L469 533Q563 789 569 797Q573 801 581 801Q598 801 600 786Q602 781 544 617L484 455Q531 435 584 408Q677 364 689 355Q693 351 693 344Q693 339 692 337T676 325T631 302T538 257Q504 241 465 223T406 195T386 186Q384 184 333 44T282 -101Q282 -103 482 -103H680Q682 -105 684 -108T688 -113T691 -118T693 -124Q693 -134 682 -141L473 -143H266L238 -219Q217 -278 210 -290T193 -303Q178 -303 173 -287Q173 -279 198 -214L222 -145Q222 -143 158 -143L93 -141L86 -136Q82 -131 82 -123Q82 -114 93 -103H166L238 -101L333 159Q326 159 220 106Q110 54 97 54Q89 54 82 66V621ZM298 501Q155 567 142 575L122 584V344Q122 106 124 106Q125 106 180 132T291 185T351 213Q355 217 393 326L433 435Q433 436 298 501ZM549 381Q472 417 471 417L406 241Q408 240 516 291T624 344L549 381",
        8942: "78 30Q78 54 95 72T138 90Q162 90 180 74T199 31Q199 6 182 -12T139 -30T96 -13T78 30ZM78 440Q78 464 95 482T138 500Q162 500 180 484T199 441Q199 416 182 398T139 380T96 397T78 440ZM78 840Q78 864 95 882T138 900Q162 900 180 884T199 841Q199 816 182 798T139 780T96 797T78 840",
        8943: "78 250Q78 274 95 292T138 310Q162 310 180 294T199 251Q199 226 182 208T139 190T96 207T78 250ZM525 250Q525 274 542 292T585 310Q609 310 627 294T646 251Q646 226 629 208T586 190T543 207T525 250ZM972 250Q972 274 989 292T1032 310Q1056 310 1074 294T1093 251Q1093 226 1076 208T1033 190T990 207T972 250",
        8945: "133 760Q133 784 150 802T193 820Q217 820 235 804T254 761Q254 736 237 718T194 700T151 717T133 760ZM580 460Q580 484 597 502T640 520Q664 520 682 504T701 461Q701 436 684 418T641 400T598 417T580 460ZM1027 160Q1027 184 1044 202T1087 220Q1111 220 1129 204T1148 161Q1148 136 1131 118T1088 100T1045 117T1027 160",
        8965: "55 698Q56 708 70 716H540Q554 708 555 698Q555 694 554 691T552 686T549 682T546 680T542 678T539 676H71Q70 676 68 677T65 679T61 682T58 686T56 691T55 698ZM555 18Q554 12 549 6T536 0H535Q525 0 515 17T459 132Q430 194 410 235L305 455L199 233Q176 185 147 125T105 36T90 7Q85 0 75 0Q63 0 58 11Q55 15 55 21Q58 31 170 266T285 507Q295 522 305 522T320 515Q322 513 439 268L555 24V18",
        8966: "55 795Q56 806 70 813H540Q554 806 555 795Q555 791 554 788T552 783T549 779T546 777T542 775T539 773H71Q70 773 68 774T65 776T61 779T58 783T56 788T55 795ZM55 601Q56 612 70 619H540Q554 612 555 601Q555 597 554 594T552 589T549 585T546 583T542 581T539 579H71Q70 579 68 580T65 582T61 585T58 589T56 594T55 601ZM75 -97Q67 -97 61 -91T55 -81Q55 -71 169 166T285 410Q295 425 305 425Q311 425 316 422T323 414L325 410Q327 404 441 167T555 -81Q555 -85 549 -91T535 -97T520 -90Q519 -89 506 -61T463 27T411 136L305 358L199 136Q167 71 129 -10Q98 -75 92 -86T75 -97",
        8968: "174 734Q178 746 190 750H298H369Q400 750 411 747T422 730T411 713T372 709Q365 709 345 709T310 710H214V-235Q206 -248 196 -250Q192 -250 189 -249T184 -247T180 -244T178 -241T176 -237T174 -234V734",
        8969: "21 717T21 730T32 746T75 750H147H256Q266 742 269 735V-235Q262 -248 251 -250Q247 -250 244 -249T239 -247T235 -244T233 -241T231 -237T229 -234V710H133Q119 710 99 710T71 709Q43 709 32 713",
        8970: "174 734Q174 735 175 737T177 740T180 744T184 747T189 749T196 750Q206 748 214 735V-210H310H373Q401 -210 411 -213T422 -230T411 -247T369 -251Q362 -251 338 -251T298 -250H190Q178 -246 174 -234V734",
        8971: "229 734Q229 735 230 737T232 740T235 744T239 747T244 749T251 750Q262 748 269 735V-235Q266 -240 256 -249L147 -250H77Q43 -250 32 -247T21 -230T32 -213T72 -209Q79 -209 99 -209T133 -210H229V734",
        8988: "76 306Q62 306 59 319T55 386V500V596Q55 664 57 676T68 692Q71 694 250 694Q428 694 432 692Q444 685 444 674Q444 665 432 656Q428 654 261 654H95V487Q95 355 95 336T90 312Q84 306 76 306",
        8989: "424 306Q418 306 413 310T406 318L404 321V654H238Q71 654 68 656Q55 662 55 674T68 692Q71 694 250 694H379Q432 694 438 688Q443 683 443 662T444 500T444 338T438 312Q432 306 424 306",
        8990: "55 172V287Q55 341 58 353T76 366Q88 366 95 351V18H261Q428 18 432 16Q444 9 444 -2Q444 -11 432 -20Q428 -22 250 -22H120Q67 -22 61 -16Q56 -11 56 10T55 172",
        8991: "404 351Q410 366 424 366Q437 366 440 353T444 288V172V72Q444 8 443 -4T432 -20Q428 -22 250 -22Q71 -22 68 -20Q55 -14 55 -2T68 16Q71 18 238 18H404V351",
        8994: "55 141Q55 149 72 174T125 234T209 303T329 360T478 388H526Q649 383 765 319Q814 291 858 250T923 179T944 141Q944 133 938 128T924 122Q914 124 912 125T902 139Q766 328 500 328Q415 328 342 308T225 258T150 199T102 148T84 124Q81 122 75 122Q55 127 55 141",
        8995: "923 378Q944 378 944 358Q944 345 912 311T859 259Q710 134 500 134Q288 134 140 259Q55 336 55 358Q55 366 61 372T75 378Q78 378 84 376Q86 376 101 356T147 310T221 257T339 212T500 193Q628 193 734 236Q841 282 903 363Q914 378 923 378",
        9001: "333 -232Q332 -239 327 -244T313 -250Q303 -250 296 -240Q293 -233 202 6T110 250T201 494T296 740Q299 745 306 749L309 750Q312 750 313 750Q331 750 333 732Q333 727 243 489Q152 252 152 250T243 11Q333 -227 333 -232",
        9002: "55 732Q56 739 61 744T75 750Q85 750 92 740Q95 733 186 494T278 250T187 6T92 -240Q85 -250 75 -250Q67 -250 62 -245T55 -232Q55 -227 145 11Q236 248 236 250T145 489Q55 727 55 732",
        9136: "357 741V726Q357 720 349 715Q261 655 242 539Q240 526 240 454T239 315T239 247Q240 235 240 124V40Q240 -17 233 -53T201 -130Q155 -206 78 -244H69H64Q58 -244 57 -243T56 -234Q56 -232 56 -231V-225Q56 -218 63 -215Q153 -153 170 -39Q172 -25 173 119V219Q173 245 174 249Q173 258 173 376V460Q173 515 178 545T201 611Q244 695 327 741L334 744H354L357 741",
        9137: "78 744Q153 706 196 640T239 492V376Q239 341 239 314T238 271T238 253Q239 251 239 223V119V49Q239 -39 254 -85Q263 -111 275 -134T301 -172T326 -197T346 -213T356 -221T357 -232V-241L354 -244H334Q264 -209 222 -146T174 -12Q173 -6 173 95Q173 134 173 191T174 250Q173 258 173 382V451Q173 542 159 585Q145 626 120 658T75 706T56 723V731Q56 741 57 742T66 744H78",
        9168: "312 0V602H355V0H312",
        9416: "451 -175Q328 -175 226 -115T66 47T8 267Q8 303 15 342T39 431T94 531T186 622Q239 663 307 686T424 709H440Q604 709 716 622Q757 592 788 555T838 482T869 414T886 350T892 301T894 267Q894 147 835 45T674 -116T451 -175ZM854 268Q854 375 802 467T657 614T450 670Q283 670 166 552T49 267Q49 99 167 -18T453 -136Q617 -136 735 -18T854 268ZM273 378Q273 430 309 474T409 527Q411 527 417 527T428 528Q498 528 549 484L567 505Q583 528 590 528H594Q600 528 606 522V350L600 344H586Q577 344 574 344T569 347T566 357Q542 491 432 491Q389 491 365 465T340 407Q340 391 344 378T358 356T377 340T400 328T421 321T443 316T459 313Q499 305 517 300T559 279T601 238Q629 195 629 148Q629 80 583 33T471 -14Q392 -14 330 30Q312 6 293 -13Q292 -14 285 -14Q279 -14 273 -8V77V138Q273 160 275 165T286 170H294H307Q313 164 313 158Q313 108 350 67T471 26Q512 26 537 54T562 119Q562 137 558 151T544 176T527 193T504 205T483 212T459 218T441 222Q391 232 368 241T318 273Q273 316 273 378",
        9484: "76 306Q62 306 59 319T55 386V500V596Q55 664 57 676T68 692Q71 694 250 694Q428 694 432 692Q444 685 444 674Q444 665 432 656Q428 654 261 654H95V487Q95 355 95 336T90 312Q84 306 76 306",
        9488: "424 306Q418 306 413 310T406 318L404 321V654H238Q71 654 68 656Q55 662 55 674T68 692Q71 694 250 694H379Q432 694 438 688Q443 683 443 662T444 500T444 338T438 312Q432 306 424 306",
        9492: "55 172V287Q55 341 58 353T76 366Q88 366 95 351V18H261Q428 18 432 16Q444 9 444 -2Q444 -11 432 -20Q428 -22 250 -22H120Q67 -22 61 -16Q56 -11 56 10T55 172",
        9496: "404 351Q410 366 424 366Q437 366 440 353T444 288V172V72Q444 8 443 -4T432 -20Q428 -22 250 -22Q71 -22 68 -20Q55 -14 55 -2T68 16Q71 18 238 18H404V351",
        9585: "19 -195Q13 -195 7 -188T0 -176Q0 -169 18 -151L822 683Q835 694 840 694T852 688T860 674Q860 667 810 614T460 252Q57 -167 44 -179Q27 -195 19 -195",
        9586: "0 675Q0 681 6 687T19 694Q27 694 44 678L460 247Q759 -62 809 -115T860 -175Q860 -183 852 -189T840 -195Q835 -195 822 -184L18 649Q0 667 0 675",
        9632: "71 0Q59 4 55 16V346L56 676Q64 686 70 689H709Q719 681 722 674V15Q719 10 709 1L390 0H71",
        9633: "71 0Q59 4 55 16V346L56 676Q64 686 70 689H709Q719 681 722 674V15Q719 10 709 1L390 0H71ZM682 40V649H95V40H682",
        9642: "71 0Q59 4 55 16V346L56 676Q64 686 70 689H709Q719 681 722 674V15Q719 10 709 1L390 0H71",
        9650: "99 -20Q84 -11 84 0Q84 5 148 145T278 424L342 563Q347 575 360 575Q368 575 375 570Q376 569 441 430T571 148T637 0Q637 -11 622 -20H99",
        9651: "75 0L72 2Q69 3 67 5T62 11T59 20Q59 24 62 30Q65 37 245 370T428 707Q428 708 430 710T436 714T444 716Q451 716 455 712Q459 710 644 368L828 27V20Q828 7 814 0H75ZM610 347L444 653Q443 653 278 347T113 40H775Q775 42 610 347",
        9652: "99 -20Q84 -11 84 0Q84 5 148 145T278 424L342 563Q347 575 360 575Q368 575 375 570Q376 569 441 430T571 148T637 0Q637 -11 622 -20H99",
        9653: "75 0L72 2Q69 3 67 5T62 11T59 20Q59 24 62 30Q65 37 245 370T428 707Q428 708 430 710T436 714T444 716Q451 716 455 712Q459 710 644 368L828 27V20Q828 7 814 0H75ZM610 347L444 653Q443 653 278 347T113 40H775Q775 42 610 347",
        9654: "83 523Q83 524 85 527T92 535T103 539Q107 539 389 406T680 268Q694 260 694 249Q694 239 687 234Q685 232 395 95L107 -41H101Q90 -40 83 -26V523",
        9656: "83 523Q83 524 85 527T92 535T103 539Q107 539 389 406T680 268Q694 260 694 249Q694 239 687 234Q685 232 395 95L107 -41H101Q90 -40 83 -26V523",
        9657: "26 489Q33 505 43 505Q51 505 260 385Q464 266 471 259Q473 257 473 250Q473 242 469 239Q459 231 260 115Q51 -5 43 -5Q39 -5 35 -1T28 7L26 11V489ZM412 250L67 450Q66 450 66 250T67 50Q69 51 240 150T412 250",
        9660: "84 556Q84 567 99 576H622Q637 567 637 556Q637 551 572 409T441 127T375 -14Q368 -19 360 -19H358Q349 -19 342 -7T296 92Q249 193 211 275Q84 550 84 556",
        9661: "59 480Q59 485 61 489T66 495T72 498L75 500H814Q828 493 828 480V474L644 132Q458 -210 455 -212Q451 -215 444 -215T433 -212Q429 -210 342 -49T164 282T64 466Q59 478 59 480ZM775 460H113Q113 459 278 153T444 -153T610 153T775 460",
        9662: "84 556Q84 567 99 576H622Q637 567 637 556Q637 551 572 409T441 127T375 -14Q368 -19 360 -19H358Q349 -19 342 -7T296 92Q249 193 211 275Q84 550 84 556",
        9663: "59 480Q59 485 61 489T66 495T72 498L75 500H814Q828 493 828 480V474L644 132Q458 -210 455 -212Q451 -215 444 -215T433 -212Q429 -210 342 -49T164 282T64 466Q59 478 59 480ZM775 460H113Q113 459 278 153T444 -153T610 153T775 460",
        9664: "694 -26Q686 -40 676 -41H670L382 95Q92 232 90 234Q83 239 83 249Q83 262 96 267Q101 270 379 401T665 537Q671 539 674 539Q686 539 694 524V-26",
        9666: "694 -26Q686 -40 676 -41H670L382 95Q92 232 90 234Q83 239 83 249Q83 262 96 267Q101 270 379 401T665 537Q671 539 674 539Q686 539 694 524V-26",
        9667: "473 10Q466 -5 454 -5Q451 -5 445 -3Q444 -3 343 56T140 173T35 234Q26 239 26 250T35 266Q40 269 240 384T445 503Q451 505 453 505Q466 505 473 490V10ZM433 50T433 250T432 450T259 351T87 250T258 150T432 50Q433 50 433 250",
        9674: "318 709Q325 716 332 716Q340 716 344 713T474 511Q611 298 611 292Q611 285 526 152Q494 103 474 72Q347 -128 344 -130Q340 -132 333 -132T322 -130Q319 -128 257 -31T131 169T60 278Q56 285 56 292Q56 298 60 305Q73 326 194 516T318 709ZM567 290T567 291T451 475T333 658L100 293Q100 288 215 108L333 -74Q334 -74 450 108",
        9711: "56 250Q56 353 95 442T196 589T335 681T491 715Q573 715 635 693Q694 673 747 635T846 543T917 412T944 250Q944 58 815 -78T500 -215Q457 -215 429 -210Q274 -183 165 -56T56 250ZM500 -176Q664 -176 784 -54T904 250Q904 418 799 536T543 674Q534 675 493 675Q425 675 357 647T229 567T133 432T96 250Q96 160 129 80T217 -56T346 -144T500 -176",
        9723: "71 0Q59 4 55 16V346L56 676Q64 686 70 689H709Q719 681 722 674V15Q719 10 709 1L390 0H71ZM682 40V649H95V40H682",
        9724: "71 0Q59 4 55 16V346L56 676Q64 686 70 689H709Q719 681 722 674V15Q719 10 709 1L390 0H71",
        9733: "367 395Q374 416 398 492T442 627T463 688Q463 692 467 692Q471 694 472 694Q478 694 484 680T523 562Q553 469 576 400L577 395H731H819Q872 395 883 394T895 384Q895 380 891 376T832 333Q794 305 767 285Q643 195 643 194L690 47Q737 -96 737 -103Q737 -111 727 -111Q721 -111 594 -18L472 71L350 -18Q223 -111 217 -111Q207 -111 207 -103Q207 -96 254 47L301 194Q301 195 241 239T118 328T51 378Q49 382 49 384Q49 392 58 393T110 395H213H367",
        9824: "181 -21Q134 -21 96 27T55 193Q55 224 58 247T82 317T143 410Q172 443 234 498Q282 543 314 598T360 687T380 725Q386 727 389 727Q395 727 398 725T406 716T413 702T423 677T439 641Q481 556 544 498Q633 420 678 353T723 204Q723 142 711 94T669 12T590 -21Q520 -21 490 8T459 66V70H409V62Q409 22 416 -17T430 -82T437 -112Q437 -131 407 -131Q403 -131 397 -131T389 -130T382 -130T372 -131Q341 -131 341 -111Q341 -107 348 -82T362 -18T369 62V70H319V66Q319 57 314 44T297 16T257 -10T191 -21H181",
        9825: "55 490Q55 557 71 604T114 674T167 706T222 716Q279 716 322 684T389 605Q391 610 395 617T414 643T447 677T494 704T555 716Q642 716 682 652T723 490Q723 455 718 426T684 342T602 227Q573 196 537 161T485 110T449 63T412 -8Q408 -22 404 -27T389 -33Q382 -33 379 -31T372 -23T366 -8T355 18T335 54Q319 81 298 104T239 163T176 227Q102 310 79 371T55 490ZM198 674Q143 664 119 613T95 491Q95 415 137 346Q174 282 265 194T384 48L389 39Q391 42 397 54T406 71T415 86T427 104T442 122T464 146T491 172Q571 249 613 303Q683 396 683 487Q683 581 649 631Q613 676 556 676Q495 676 457 634T410 538Q407 514 390 514Q386 514 380 517Q372 520 369 536T355 581T319 635Q277 675 223 675H217H208L204 674Q200 674 198 674",
        9826: "370 714Q370 717 375 722T388 727Q398 727 403 721T417 697Q420 692 421 689Q536 465 709 304Q723 291 723 282T709 260Q529 93 406 -153Q402 -162 390 -162H389Q379 -162 376 -158T357 -125Q247 89 89 241L64 265Q55 272 55 282Q55 287 57 290T64 300T77 312T98 331T127 361Q197 435 258 523T344 663L370 714ZM655 299Q568 384 508 470T389 662L376 638Q362 613 341 577T289 497T215 399T123 299L105 282L123 265Q210 180 270 94T389 -98L402 -74Q416 -49 437 -13T489 67T563 165T655 265L673 282L655 299",
        9827: "213 532Q213 615 265 670T389 726Q461 726 513 671T565 532Q565 511 562 492T553 458T541 432T526 409T512 393T498 379L490 371L511 326Q512 326 516 330T528 341T546 353T572 363T606 368Q664 368 707 315T750 174Q750 87 699 33T579 -22Q567 -22 553 -20T517 -10T479 16T459 63V70H409V62Q409 22 416 -17T430 -82T437 -112Q437 -131 407 -131Q403 -131 397 -131T389 -130T382 -130T372 -131Q341 -131 341 -111Q341 -107 348 -82T362 -18T369 62V70H319V63Q315 25 281 2T197 -22Q132 -22 80 32T28 174Q28 255 69 311T175 368Q192 368 207 364T232 353T250 341T262 331T267 326L288 371L280 378Q272 385 267 391T253 407T238 430T226 457T217 492T213 532",
        9837: "200 467Q254 467 293 428T332 321Q332 147 104 -11L88 -22H75Q62 -22 56 -16L55 362V647Q55 743 60 748Q63 750 76 750H83Q87 750 95 744V434L104 440Q144 467 200 467ZM237 322Q237 360 225 388T183 417Q158 417 134 407T101 378Q96 370 96 349T95 197V34Q152 91 194 167T237 322",
        9838: "65 721Q78 734 94 734Q100 734 104 727V444L116 449Q129 454 157 465T208 486Q313 527 314 527Q318 527 324 521V-210Q306 -223 294 -223Q289 -223 284 -216V-13L270 -18Q257 -24 231 -34T180 -54Q77 -96 74 -96T65 -90V721ZM104 13Q282 84 283 85Q284 85 284 252Q284 418 283 418L230 396L140 360L104 346V13",
        9839: "101 -223Q94 -223 93 -217T91 -188V-151Q91 -88 90 -88Q87 -88 80 -92T68 -96Q62 -96 56 -90L55 -50V-22Q55 -8 58 -4T78 5L91 10V177Q91 343 90 343Q87 343 80 339T68 335Q62 335 56 341L55 381V409Q55 423 58 427T78 436L91 441V543V616Q91 643 93 648T106 656Q119 662 126 659Q130 657 130 645T131 554V456L257 503V607L258 710L260 712Q261 715 272 719T286 723Q293 723 295 715T297 671V617Q297 519 298 519Q301 519 307 522T319 526Q327 526 333 521V437L330 435Q328 432 312 427L297 421V254Q297 88 298 88Q301 88 307 91T319 95Q327 95 333 90V6L330 4Q328 1 312 -4L297 -10V-78V-122Q297 -145 295 -149T282 -156Q274 -160 268 -160Q257 -160 257 -130V-89V-25L131 -72V-210Q123 -215 116 -218T104 -222L101 -223ZM257 72V406L131 359V25L257 72",
        10003: "84 231Q84 244 114 264T170 285Q176 285 183 274T224 205Q267 129 268 129Q271 141 279 163T318 250T389 378T502 523T662 673Q702 706 732 706H734Q749 706 749 695Q749 682 730 666T660 607T559 505Q387 299 328 29Q324 0 295 -17T245 -34H241Q234 -34 225 -21T185 46Q166 79 154 101Q84 223 84 231",
        10016: "195 702T195 706T201 716H632Q638 710 638 706T636 700T621 690Q436 581 427 374V357H430Q554 357 645 421Q682 447 711 483T755 542T770 567Q775 572 786 563V131Q777 125 774 125T762 139Q709 228 642 274T482 333Q452 337 430 337H427V320Q430 279 437 247T462 170T521 82T621 4Q630 -2 633 -4T637 -7T638 -12Q638 -16 632 -22H201Q195 -16 195 -12T197 -6T212 4Q397 113 406 320V337H403Q279 337 188 273Q151 247 122 211T78 152T63 127Q58 122 48 131V563Q54 569 59 569Q62 569 71 555Q124 466 191 420T351 361Q381 357 403 357H406V374Q403 415 396 447T371 525T312 613T212 690Q199 697 197 699",
        10072: "139 -249H137Q125 -249 119 -235V251L120 737Q130 750 139 750Q152 750 159 735V-235Q151 -249 141 -249H139",
        10216: "333 -232Q332 -239 327 -244T313 -250Q303 -250 296 -240Q293 -233 202 6T110 250T201 494T296 740Q299 745 306 749L309 750Q312 750 313 750Q331 750 333 732Q333 727 243 489Q152 252 152 250T243 11Q333 -227 333 -232",
        10217: "55 732Q56 739 61 744T75 750Q85 750 92 740Q95 733 186 494T278 250T187 6T92 -240Q85 -250 75 -250Q67 -250 62 -245T55 -232Q55 -227 145 11Q236 248 236 250T145 489Q55 727 55 732",
        10222: "357 741V726Q357 720 349 715Q261 655 242 539Q240 526 240 394V331Q240 259 239 250Q240 242 240 119V49Q240 -42 254 -85Q263 -111 275 -134T301 -172T326 -197T346 -213T356 -221T357 -232V-241L354 -244H334Q264 -209 222 -146T174 -12Q173 -6 173 95Q173 134 173 191T174 250Q173 260 173 376V460Q173 515 178 545T201 611Q244 695 327 741L334 744H354L357 741",
        10223: "78 744Q153 706 196 640T239 492V376Q239 339 239 311T238 269T238 252Q240 236 240 124V40Q240 -18 233 -53T202 -130Q156 -206 79 -244H70H65Q58 -244 57 -242T56 -231T57 -220T64 -215Q153 -154 170 -39Q173 -18 174 119V247Q173 249 173 382V451Q173 542 159 585Q145 626 120 658T75 706T56 723V731Q56 741 57 742T66 744H78",
        10229: "165 270H1510Q1525 262 1525 250T1510 230H165Q167 228 182 216T211 189T244 152T277 96T303 25Q308 7 308 0Q308 -11 288 -11Q281 -11 278 -11T272 -7T267 2T263 21Q245 94 195 151T73 236Q58 242 55 247Q55 254 59 257T73 264Q121 283 158 314T215 375T247 434T264 480L267 497Q269 503 270 505T275 509T288 511Q308 511 308 500Q308 493 303 475Q293 438 278 406T246 352T215 315T185 287T165 270",
        10230: "84 237T84 250T98 270H1444Q1328 357 1301 493Q1301 494 1301 496T1300 499Q1300 511 1317 511H1320Q1329 511 1332 510T1338 506T1341 497T1344 481T1352 456Q1374 389 1425 336T1544 261Q1553 258 1553 250Q1553 244 1548 241T1524 231T1486 212Q1445 186 1415 152T1370 85T1349 35T1341 4Q1339 -6 1336 -8T1320 -11Q1300 -11 1300 0Q1300 7 1305 25Q1337 151 1444 230H98Q84 237 84 250",
        10231: "165 270H1694Q1578 357 1551 493Q1551 494 1551 496T1550 499Q1550 511 1567 511H1570Q1579 511 1582 510T1588 506T1591 497T1594 481T1602 456Q1624 389 1675 336T1794 261Q1803 258 1803 250Q1803 244 1798 241T1774 231T1736 212Q1695 186 1665 152T1620 85T1599 35T1591 4Q1589 -6 1586 -8T1570 -11Q1550 -11 1550 0Q1550 7 1555 25Q1587 151 1694 230H165Q167 228 182 216T211 189T244 152T277 96T303 25Q308 7 308 0Q308 -11 288 -11Q281 -11 278 -11T272 -7T267 2T263 21Q245 94 195 151T73 236Q58 242 55 247Q55 254 59 257T73 264Q121 283 158 314T215 375T247 434T264 480L267 497Q269 503 270 505T275 509T288 511Q308 511 308 500Q308 493 303 475Q293 438 278 406T246 352T215 315T185 287T165 270",
        10232: "274 173H1539Q1540 172 1542 171T1545 169T1547 167T1550 164T1551 162T1552 158T1553 153Q1553 140 1538 133H318L328 123Q379 69 414 0Q419 -13 419 -17Q419 -24 399 -24Q388 -24 385 -23T377 -12Q332 77 253 144T72 237Q62 240 59 242T56 250T59 257T70 262T89 268T119 278T160 296Q303 366 377 512Q382 522 385 523T401 525Q419 524 419 515Q419 510 414 500Q379 431 328 377L318 367H1538Q1553 359 1553 347Q1553 336 1539 328L1221 327H903L900 328L602 327H274L264 319Q225 289 147 250Q148 249 165 241T210 217T264 181L274 173",
        10233: "1218 514Q1218 525 1234 525Q1239 525 1242 525T1247 525T1251 524T1253 523T1255 520T1257 517T1260 512Q1297 438 1358 381T1469 300T1565 263Q1582 258 1582 250T1573 239T1536 228T1478 204Q1334 134 1260 -12Q1256 -21 1253 -22T1238 -24Q1218 -24 1218 -17Q1218 -13 1223 0Q1258 69 1309 123L1319 133H70Q56 140 56 153Q56 168 72 173H1363L1373 181Q1412 211 1490 250Q1489 251 1472 259T1427 283T1373 319L1363 327H710L707 328L390 327H72Q56 332 56 347Q56 360 70 367H1319L1309 377Q1276 412 1247 458T1218 514",
        10234: "1438 514Q1438 525 1454 525Q1459 525 1462 525T1467 525T1471 524T1473 523T1475 520T1477 517T1480 512Q1517 438 1578 381T1689 300T1785 263Q1802 258 1802 250T1793 239T1756 228T1698 204Q1554 134 1480 -12Q1476 -21 1473 -22T1458 -24Q1438 -24 1438 -17Q1438 -13 1443 0Q1478 69 1529 123L1539 133H318L328 123Q379 69 414 0Q419 -13 419 -17Q419 -24 399 -24Q388 -24 385 -23T377 -12Q332 77 253 144T72 237Q62 240 59 242T56 250T59 257T70 262T89 268T119 278T160 296Q303 366 377 512Q382 522 385 523T401 525Q419 524 419 515Q419 510 414 500Q379 431 328 377L318 367H1539L1529 377Q1496 412 1467 458T1438 514ZM274 173H1583L1593 181Q1632 211 1710 250Q1709 251 1692 259T1647 283T1593 319L1583 327H930L927 328L602 327H274L264 319Q225 289 147 250Q148 249 165 241T210 217T264 181L274 173",
        10236: "95 155V109Q95 83 92 73T75 63Q61 63 58 74T54 130Q54 140 54 180T55 250Q55 421 57 425Q61 437 75 437Q88 437 91 428T95 393V345V270H1444Q1328 357 1301 493Q1301 494 1301 496T1300 499Q1300 511 1317 511H1320Q1329 511 1332 510T1338 506T1341 497T1344 481T1352 456Q1374 389 1425 336T1544 261Q1553 258 1553 250Q1553 244 1548 241T1524 231T1486 212Q1445 186 1415 152T1370 85T1349 35T1341 4Q1339 -6 1336 -8T1320 -11Q1300 -11 1300 0Q1300 7 1305 25Q1337 151 1444 230H95V155",
        10731: "318 709Q325 716 332 716Q340 716 344 713T474 511Q611 298 611 292Q611 285 526 152Q494 103 474 72Q347 -128 344 -130Q340 -132 333 -132T322 -130Q319 -128 257 -31T131 169T60 278Q56 285 56 292Q56 298 60 305Q73 326 194 516T318 709",
        10744: "166 -215T159 -215T147 -212T141 -204T139 -197Q139 -190 144 -183Q157 -157 378 274T602 707Q605 716 618 716Q625 716 630 712T636 703T638 696Q638 691 406 241T170 -212Q166 -215 159 -215",
        10752: "555 -250Q420 -250 306 -185T124 -4T56 250Q56 453 193 595T526 749Q528 750 539 750Q554 750 562 749Q688 749 800 687T983 508T1054 250Q1054 112 987 -3T806 -184T555 -250ZM555 -165Q672 -165 767 -108T916 44T970 250Q970 418 861 532T600 664Q591 665 548 665Q446 665 353 614T200 466T140 250V243Q140 88 248 -30Q262 -46 280 -62T338 -105T434 -148T555 -165ZM478 250Q478 288 503 307T551 326Q586 326 609 305T632 250Q632 217 610 196T555 174T500 196T478 250",
        10753: "555 -250Q420 -250 306 -185T124 -4T56 250Q56 453 193 595T526 749Q528 750 539 750Q554 750 562 749Q688 749 800 687T983 508T1054 250Q1054 112 987 -3T806 -184T555 -250ZM513 478Q513 664 512 664Q504 664 481 660T406 637T313 588Q281 564 255 537T211 483T181 431T161 382T150 342T144 310T141 292H513V478ZM798 588Q758 616 711 634T639 658T602 663L597 664V292H969Q969 293 967 309T960 341T949 381T930 430T900 482T856 537T798 588ZM513 -164V208H141Q142 205 144 189T149 160T158 125T173 83T196 39T229 -9Q249 -34 273 -55T318 -92T363 -119T405 -138T444 -150T475 -158T499 -162T513 -164ZM775 -103Q801 -87 823 -68T863 -30T894 10T919 49T937 88T950 123T959 154T964 180T968 198L969 208H597V-164Q599 -163 616 -161T647 -155T683 -145T728 -128T775 -103",
        10754: "555 -250Q420 -250 306 -185T124 -4T56 250Q56 453 193 595T526 749Q528 750 539 750Q554 750 562 749Q688 749 800 687T983 508T1054 250Q1054 112 987 -3T806 -184T555 -250ZM600 664Q591 665 548 665Q414 665 306 583L292 573L423 441L555 310L687 441L818 573L804 583Q714 650 600 664ZM364 118L495 250L364 382L232 513L223 500Q140 391 140 250Q140 107 223 0L232 -13L364 118ZM970 250Q970 389 887 501L878 512Q878 513 861 496T812 447T746 381L615 250L746 118L878 -13L887 0Q970 109 970 250ZM687 59L555 190L423 59L292 -73L306 -83Q416 -166 555 -166T804 -83L818 -73L687 59",
        10756: "96 750Q103 750 109 748T120 744T127 737T133 730T137 723T139 718V395L140 73L142 60Q159 -43 237 -104T416 -166Q521 -166 597 -103T690 60L692 73L694 718Q708 749 735 749Q765 749 775 720Q777 714 777 398Q777 78 776 71Q766 -51 680 -140Q571 -249 416 -249H411Q261 -249 152 -140Q66 -51 56 71Q55 78 55 398Q55 714 57 720Q60 734 70 740Q80 750 96 750ZM223 276Q223 282 224 287T227 296T232 302T238 308T243 313T250 316L254 319H374V376V406Q374 438 382 454T418 470Q443 467 450 453T458 410V376V319H579Q580 319 583 317T589 313T594 308T600 302T604 295T608 287T609 276Q609 253 587 241Q577 235 513 235H458V178Q458 176 458 166T459 148Q459 84 415 84Q401 84 390 93T375 117Q374 120 374 178V235H319Q317 235 307 235T290 234Q223 234 223 276",
        10758: "777 -217Q766 -244 745 -249H88Q64 -242 57 -220Q55 -214 55 250T57 720Q60 734 70 740Q80 750 96 750Q127 750 137 720Q139 714 139 274V-166H693V274Q693 714 695 720Q705 749 735 749Q766 749 775 719Q777 713 777 248V-217",
        10799: "630 29Q630 9 609 9Q604 9 587 25T493 118L389 222L284 117Q178 13 175 11Q171 9 168 9Q160 9 154 15T147 29Q147 36 161 51T255 146L359 250L255 354Q174 435 161 449T147 471Q147 480 153 485T168 490Q173 490 175 489Q178 487 284 383L389 278L493 382Q570 459 587 475T609 491Q630 491 630 471Q630 464 620 453T522 355L418 250L522 145Q606 61 618 48T630 29",
        10815: "28 660Q28 676 31 679T46 683H50Q87 681 182 681Q217 681 247 681T294 682T315 682Q321 682 323 682T328 679T331 673T332 660Q332 643 328 640T304 637Q239 637 231 626Q229 620 229 334V46H520V334Q520 620 518 626Q510 637 445 637Q426 637 422 640T417 660Q417 675 420 678T432 682H435Q437 682 467 682T569 681T671 681T703 682Q714 682 717 679T721 660Q721 643 717 640T693 637Q628 637 620 626Q619 623 619 342Q619 60 620 57Q628 46 693 46Q714 46 717 43T721 23Q721 5 715 1Q713 0 374 0Q36 0 34 1Q28 5 28 23Q28 40 31 43T56 46Q121 46 129 57Q131 63 131 342Q131 620 129 626Q121 637 56 637Q35 637 32 640T28 660",
        10846: "55 795Q56 806 70 813H540Q554 806 555 795Q555 791 554 788T552 783T549 779T546 777T542 775T539 773H71Q70 773 68 774T65 776T61 779T58 783T56 788T55 795ZM55 601Q56 612 70 619H540Q554 612 555 601Q555 597 554 594T552 589T549 585T546 583T542 581T539 579H71Q70 579 68 580T65 582T61 585T58 589T56 594T55 601ZM75 -97Q67 -97 61 -91T55 -81Q55 -71 169 166T285 410Q295 425 305 425Q311 425 316 422T323 414L325 410Q327 404 441 167T555 -81Q555 -85 549 -91T535 -97T520 -90Q519 -89 506 -61T463 27T411 136L305 358L199 136Q167 71 129 -10Q98 -75 92 -86T75 -97",
        10877: "674 636Q682 636 688 630T694 615T687 601Q686 600 417 472L151 346L399 228Q687 92 691 87Q694 81 694 76Q694 58 676 56H670L382 192Q92 329 90 331Q83 336 83 348Q84 359 96 365Q104 369 382 500T665 634Q669 636 674 636ZM94 170Q102 172 104 172Q110 171 254 103T535 -30T678 -98Q694 -106 694 -118Q694 -136 676 -138H670L382 -2Q92 135 90 137Q83 142 83 154Q84 164 94 170",
        10878: "83 616Q83 624 89 630T99 636Q107 636 253 568T543 431T687 361Q694 356 694 346T687 331Q685 329 395 192L107 56H101Q83 58 83 76Q83 77 83 79Q82 86 98 95Q117 105 248 167Q326 204 378 228L626 346L360 472Q291 505 200 548Q112 589 98 597T83 616ZM674 172Q692 172 694 154Q694 142 687 137Q685 135 395 -2L107 -138H101Q83 -136 83 -118Q83 -106 96 -100Q100 -98 380 35T665 170T674 172",
        10885: "667 761Q669 762 673 762Q682 762 688 756T694 741Q694 731 687 727Q684 724 420 613L156 502L416 392Q476 367 544 338T647 295T682 280Q694 274 694 262Q694 244 676 242Q670 242 524 303T235 425T90 487Q83 493 83 501Q83 514 94 519Q97 520 378 639T667 761ZM55 -23Q55 43 103 90T223 138Q265 138 316 114Q342 100 393 68L443 36Q502 0 554 0Q609 0 650 32T694 109Q694 138 708 138Q710 138 713 136T719 127T722 108Q722 37 673 -9T557 -56Q514 -56 468 -35T387 13T308 60T223 82Q167 82 127 50T83 -27Q81 -56 69 -56Q55 -56 55 -23ZM55 -257Q55 -191 103 -144T223 -96Q265 -96 316 -120Q342 -134 393 -166L443 -198Q502 -234 554 -234Q609 -234 650 -202T694 -125Q694 -96 708 -96Q710 -96 713 -98T719 -107T722 -126Q722 -197 673 -243T557 -290Q514 -290 468 -269T387 -221T308 -174T223 -152Q167 -152 127 -184T83 -261Q80 -290 69 -290Q55 -290 55 -257",
        10886: "90 727Q83 734 83 743Q83 751 89 756T104 762Q111 760 396 641Q686 518 687 517Q694 512 694 502T687 487Q686 486 543 425T253 303T101 242Q83 244 83 262Q83 274 95 280Q96 280 130 294T232 338T361 392L621 502L357 613Q93 724 90 727ZM55 -23Q55 43 103 90T223 138Q265 138 316 114Q342 100 393 68L443 36Q502 0 554 0Q609 0 650 32T694 109Q694 138 708 138Q710 138 713 136T719 127T722 108Q722 37 673 -9T557 -56Q514 -56 468 -35T387 13T308 60T223 82Q167 82 127 50T83 -27Q81 -56 69 -56Q55 -56 55 -23ZM55 -257Q55 -191 103 -144T223 -96Q265 -96 316 -120Q342 -134 393 -166L443 -198Q502 -234 554 -234Q609 -234 650 -202T694 -125Q694 -96 708 -96Q710 -96 713 -98T719 -107T722 -126Q722 -197 673 -243T557 -290Q514 -290 468 -269T387 -221T308 -174T223 -152Q167 -152 127 -184T83 -261Q80 -290 69 -290Q55 -290 55 -257",
        10887: "380 497Q445 528 522 564T636 618T673 635Q680 635 686 628T693 615T689 603Q686 599 418 472L151 343L418 215Q686 88 689 83Q693 79 693 72T687 59T675 52Q669 52 381 189T86 332Q82 337 82 344Q82 350 86 355Q91 359 380 497ZM82 -130T82 -124T95 -103H380L431 -54Q476 -6 486 -6Q491 -6 498 -12T505 -27Q505 -28 505 -29T504 -32Q503 -33 498 -38T485 -53T469 -70L438 -103H680Q682 -106 686 -110T691 -116T693 -123Q693 -130 680 -143H398L346 -192Q300 -241 291 -241Q271 -241 271 -221Q271 -209 306 -179L340 -143H95Q82 -130 82 -124",
        10888: "82 614Q82 620 86 625T94 632T100 635Q106 635 394 498T689 355Q693 349 693 343Q693 338 689 332Q683 327 395 190T100 52Q95 52 89 58T82 72Q82 80 95 88Q114 99 358 215L624 343L358 472Q89 599 86 603Q82 607 82 614ZM82 -130T82 -124T95 -103H380L431 -54Q476 -6 486 -6Q491 -6 498 -12T505 -27Q505 -28 505 -29T504 -32Q503 -33 498 -38T485 -53T469 -70L438 -103H680Q682 -106 686 -110T691 -116T693 -123Q693 -130 680 -143H398L346 -192Q300 -241 291 -241Q271 -241 271 -221Q271 -209 306 -179L340 -143H95Q82 -130 82 -124",
        10889: "86 512Q93 518 381 639T673 761Q680 761 686 755T693 741Q693 733 688 730Q685 723 419 612L155 501L419 390Q685 277 688 272Q693 269 693 261Q693 254 687 248T675 241Q669 241 381 362T86 490Q74 500 86 512ZM70 -59Q57 -59 57 -24Q57 40 104 87Q116 102 146 118Q186 136 231 136Q232 136 242 135T258 133T276 128T302 118T334 101T377 74Q386 69 396 63T411 53T417 50Q435 87 453 134Q491 223 495 227Q498 230 505 230Q513 230 519 225T526 212Q526 203 491 118T453 30Q453 22 489 10T553 -3Q589 -3 622 14Q653 28 669 50T688 90T694 122T706 136Q718 136 718 114Q718 113 718 109T717 103Q717 31 668 -14T554 -60Q529 -60 499 -50T451 -32T433 -24Q431 -24 404 -90T375 -157Q375 -159 402 -178T473 -218T553 -239Q599 -239 641 -211T691 -130Q694 -99 706 -99T718 -122Q718 -123 718 -127T717 -133Q717 -204 668 -249T559 -295Q512 -295 470 -275T355 -206L322 -290Q313 -310 304 -332T289 -367T282 -382Q277 -387 270 -387Q262 -387 255 -382T248 -368Q248 -361 322 -186Q311 -177 280 -166T222 -155Q189 -155 153 -173Q122 -186 106 -208T87 -248T82 -280T71 -294Q57 -294 57 -259Q57 -195 104 -148Q122 -126 155 -113T220 -99Q245 -99 276 -109T324 -127T342 -135Q397 -2 397 1Q386 10 367 23T302 58T222 80Q175 80 132 52T84 -28Q82 -59 70 -59",
        10890: "86 730Q81 734 81 740Q81 747 88 754T99 761Q103 761 392 640T688 512Q693 509 693 501T688 490Q682 484 394 363T99 241Q94 241 88 248T82 261Q82 268 86 272Q89 277 355 390L619 501L355 612Q89 723 86 730ZM70 -59Q57 -59 57 -24Q57 40 104 87Q116 102 146 118Q186 136 231 136Q232 136 242 135T258 133T276 128T302 118T334 101T377 74Q386 69 396 63T411 53T417 50Q435 87 453 134Q491 223 495 227Q498 230 505 230Q513 230 519 225T526 212Q526 203 491 118T453 30Q453 22 489 10T553 -3Q589 -3 622 14Q653 28 669 50T688 90T694 122T706 136Q718 136 718 114Q718 113 718 109T717 103Q717 31 668 -14T554 -60Q529 -60 499 -50T451 -32T433 -24Q431 -24 404 -90T375 -157Q375 -159 402 -178T473 -218T553 -239Q599 -239 641 -211T691 -130Q694 -99 706 -99T718 -122Q718 -123 718 -127T717 -133Q717 -204 668 -249T559 -295Q512 -295 470 -275T355 -206L322 -290Q313 -310 304 -332T289 -367T282 -382Q277 -387 270 -387Q262 -387 255 -382T248 -368Q248 -361 322 -186Q311 -177 280 -166T222 -155Q189 -155 153 -173Q122 -186 106 -208T87 -248T82 -280T71 -294Q57 -294 57 -259Q57 -195 104 -148Q122 -126 155 -113T220 -99Q245 -99 276 -109T324 -127T342 -135Q397 -2 397 1Q386 10 367 23T302 58T222 80Q175 80 132 52T84 -28Q82 -59 70 -59",
        10891: "674 1003Q681 1003 687 999T694 983Q694 973 683 967Q669 959 420 868L162 772L422 676Q683 579 685 577Q694 571 694 560Q694 550 687 546T673 541Q669 542 384 647T93 755Q83 760 83 772Q83 783 91 788Q98 791 383 897T674 1003ZM84 354T84 367T98 387H679Q694 379 694 367Q694 354 679 347H98Q84 354 84 367ZM84 160T84 173T98 193H679Q694 185 694 173Q694 160 679 153H98Q84 160 84 173ZM94 -3Q102 -1 104 -1Q107 -2 392 -107T684 -215Q694 -219 694 -232Q694 -241 687 -247Q686 -248 395 -357Q106 -463 101 -463Q83 -461 83 -443Q83 -431 94 -426Q97 -423 357 -328L615 -232L355 -136Q94 -39 92 -37Q83 -31 83 -21Q83 -9 94 -3",
        10892: "104 541Q98 541 91 545T83 560Q83 571 92 577Q94 579 355 676L615 772L357 868Q108 959 94 967Q83 973 83 983Q83 989 87 996T104 1003Q109 1002 396 896T687 787Q694 781 694 772Q694 759 684 755Q678 752 393 647T104 541ZM84 367Q84 380 98 387H679Q694 379 694 367Q694 356 680 348L390 347H100Q84 352 84 367ZM84 173Q84 188 100 193H680Q694 183 694 173Q694 160 679 153H98Q84 160 84 173ZM674 -1Q682 -1 688 -6T694 -20Q694 -31 685 -37Q683 -39 422 -136L162 -232L420 -328Q680 -423 683 -426Q694 -431 694 -443Q694 -461 676 -463Q671 -463 382 -357Q91 -248 90 -247Q83 -242 83 -232Q83 -220 93 -215Q667 -1 674 -1",
        10901: "674 636Q682 636 688 631T694 616Q694 605 687 601Q685 599 395 462L107 326H101Q83 328 83 345Q83 358 96 365Q102 367 382 500T665 634Q671 636 674 636ZM674 442Q692 442 694 424Q694 412 687 407Q686 406 417 278L151 152L399 34Q687 -102 691 -107Q694 -113 694 -118Q694 -136 676 -138H670L382 -2Q92 135 90 137Q83 142 83 154Q84 165 96 171Q104 175 382 306T665 440Q669 442 674 442",
        10902: "83 616Q83 624 89 630T99 636Q107 636 253 568T543 431T687 361Q694 354 694 346Q694 328 676 326H670L382 462Q317 493 226 535Q119 585 101 595T83 616ZM94 440Q102 442 104 442Q110 441 254 373T535 240T678 172Q679 172 680 171Q694 164 694 153T687 137Q685 135 395 -2L107 -138H101Q83 -136 83 -118Q83 -106 93 -101L128 -84Q163 -68 230 -36T361 26L626 152L360 278Q91 406 90 407Q83 412 83 424Q84 434 94 440",
        10927: "84 346Q84 359 91 363T117 367Q120 367 126 367T137 366Q388 370 512 430T653 609Q657 636 676 636Q685 635 689 629T694 618V612Q689 566 672 528T626 463T569 417T500 383T435 362T373 346Q379 345 404 339T440 330T477 318T533 296Q592 266 630 223T681 145T694 78Q694 57 674 57Q662 57 657 67T652 92T640 135T606 191Q500 320 137 326H114Q104 326 98 327T88 332T84 346ZM84 -131T84 -118T98 -98H679Q694 -106 694 -118T679 -138H98Q84 -131 84 -118",
        10928: "84 614Q84 636 102 636Q115 636 119 626T125 600T137 556T171 501Q277 372 640 366H661Q694 366 694 346T661 326H640Q578 325 526 321T415 307T309 280T222 237T156 172T124 83Q122 66 118 62T103 57Q100 57 98 57T95 58T93 59T90 62T85 67Q83 71 83 80Q88 126 105 164T151 229T208 275T277 309T342 330T404 346Q401 347 380 351T345 360T302 373T245 396Q125 455 92 565Q84 599 84 614ZM84 -131T84 -118T98 -98H679Q694 -106 694 -118T679 -138H98Q84 -131 84 -118",
        10933: "653 734Q653 738 660 745T673 752T686 745T693 723Q672 555 466 485Q390 463 378 463Q373 463 373 461Q373 458 378 458Q390 458 466 436Q562 404 620 350Q682 283 693 198Q693 183 686 176Q681 170 674 170T660 176T653 187Q653 192 652 200T646 228T631 265T602 307T555 350Q435 431 151 441H95Q82 454 82 460T95 481H151Q165 482 197 483T238 485Q427 500 528 554T649 707Q653 729 653 734ZM82 33Q82 37 83 40T89 47T95 54H473L520 105Q569 156 571 156Q573 157 578 157Q586 157 592 151T598 136Q598 130 562 92L526 56L604 54H682Q693 43 693 35Q693 31 692 28T686 21T680 14H489L342 -139L513 -142H682Q693 -148 693 -160Q693 -167 680 -182H304L258 -230Q248 -240 237 -251T221 -268T211 -278T203 -284T197 -286Q189 -286 184 -280T178 -264Q178 -257 213 -219L249 -182H171L93 -179L86 -175Q82 -170 82 -163Q82 -155 95 -142H289L360 -64L433 14H262L93 16Q82 23 82 33",
        10934: "693 466T693 460T680 441H624Q608 439 577 438T538 436Q349 421 248 367T126 214Q122 192 122 187Q122 183 116 177T102 170Q95 170 89 176Q82 183 82 198Q93 283 155 350Q213 404 309 436Q385 458 398 458Q402 458 402 461Q402 463 398 463Q385 463 309 485Q103 555 82 723Q82 738 89 745T102 752T115 745T122 734Q122 721 126 701T155 640T220 572Q340 490 624 481H680Q693 466 693 460ZM82 33Q82 37 83 40T89 47T95 54H473L520 105Q569 156 571 156Q573 157 578 157Q586 157 592 151T598 136Q598 130 562 92L526 56L604 54H682Q693 43 693 35Q693 31 692 28T686 21T680 14H489L342 -139L513 -142H682Q693 -148 693 -160Q693 -167 680 -182H304L258 -230Q248 -240 237 -251T221 -268T211 -278T203 -284T197 -286Q189 -286 184 -280T178 -264Q178 -257 213 -219L249 -182H171L93 -179L86 -175Q82 -170 82 -163Q82 -155 95 -142H289L360 -64L433 14H262L93 16Q82 23 82 33",
        10935: "82 494T82 501T95 521H171Q405 527 511 569Q630 618 651 732Q652 734 653 740T655 748T658 754T663 759T672 761L686 754Q693 747 693 734Q684 668 648 623Q627 591 573 557T442 507L417 501Q428 496 442 494Q520 478 573 444T648 378Q684 333 693 267Q693 254 686 247Q673 234 659 245Q657 247 651 269Q630 383 511 432Q406 474 171 481H95Q82 494 82 501ZM70 -59Q57 -59 57 -26Q57 30 90 73T177 132Q191 136 226 136Q228 136 239 136T253 135T267 132T287 125T311 113T346 95T391 67Q462 20 502 5Q519 1 553 1Q586 1 602 5Q641 18 664 45T691 107Q694 136 704 136Q717 136 717 115V105Q717 39 671 -9T554 -58Q518 -58 481 -43T382 14Q302 63 273 74Q255 78 222 78Q188 78 173 74Q90 46 84 -28Q82 -59 70 -59ZM71 -294Q57 -294 57 -262Q57 -205 90 -162T177 -104Q191 -99 226 -99Q266 -103 277 -106Q310 -119 391 -168Q455 -212 502 -231Q519 -235 553 -235Q586 -235 602 -231Q640 -218 661 -195T686 -151T693 -115T704 -99Q717 -99 717 -121V-131Q717 -198 671 -246T556 -294Q519 -294 482 -279T382 -222Q307 -175 273 -162Q255 -157 222 -157Q188 -157 173 -162Q133 -175 110 -201T84 -264Q82 -294 71 -294",
        10936: "693 501Q693 493 679 481H604Q369 474 264 432Q143 382 124 269Q116 246 115 245Q101 234 88 247Q82 254 82 267Q89 329 126 378Q147 410 201 444T333 494L357 501Q354 502 340 505T318 510T295 516T269 525T243 535T215 548T188 565Q142 599 126 623Q89 672 82 734Q82 761 102 761L115 756Q116 755 124 732Q143 619 264 569Q371 527 604 521H679Q693 507 693 501ZM70 -59Q57 -59 57 -26Q57 30 90 73T177 132Q191 136 226 136Q228 136 239 136T253 135T267 132T287 125T311 113T346 95T391 67Q462 20 502 5Q519 1 553 1Q586 1 602 5Q641 18 664 45T691 107Q694 136 704 136Q717 136 717 115V105Q717 39 671 -9T554 -58Q518 -58 481 -43T382 14Q302 63 273 74Q255 78 222 78Q188 78 173 74Q90 46 84 -28Q82 -59 70 -59ZM71 -294Q57 -294 57 -262Q57 -205 90 -162T177 -104Q191 -99 226 -99Q266 -103 277 -106Q310 -119 391 -168Q455 -212 502 -231Q519 -235 553 -235Q586 -235 602 -231Q640 -218 661 -195T686 -151T693 -115T704 -99Q717 -99 717 -121V-131Q717 -198 671 -246T556 -294Q519 -294 482 -279T382 -222Q307 -175 273 -162Q255 -157 222 -157Q188 -157 173 -162Q133 -175 110 -201T84 -264Q82 -294 71 -294",
        10937: "82 494T82 501T95 521H171Q256 523 317 528T441 548T543 584T613 644T651 732Q652 734 653 740T655 748T658 754T663 759T672 761L686 754Q693 747 693 734Q686 686 664 647T615 586T548 545T482 518T417 501Q419 500 451 493T517 471T590 434T657 367T693 267Q693 241 673 241Q664 241 659 245Q656 249 650 273T635 323T593 380T511 432Q406 474 171 481H95Q82 494 82 501ZM57 -26Q57 39 101 87T219 136Q254 136 277 130Q320 114 382 72Q419 50 424 45Q426 45 459 110Q496 178 497 179Q500 180 504 180Q509 180 517 175T526 161Q526 158 495 90L462 25Q462 21 502 5Q519 1 553 1Q586 1 602 5Q641 18 664 45T691 107Q694 136 706 136T718 115Q718 114 718 111T717 105Q717 39 671 -9T554 -58L459 -33Q450 -29 444 -27T437 -26L371 -155L391 -168Q485 -235 538 -235H553Q586 -235 602 -230Q683 -204 691 -128Q694 -99 706 -99T718 -120Q718 -121 718 -124T717 -130Q717 -199 670 -246T557 -294T393 -228Q353 -205 351 -201Q348 -201 315 -266Q294 -310 285 -323T268 -337Q259 -337 254 -331T248 -317Q248 -305 282 -246L313 -181Q313 -177 273 -161Q255 -157 222 -157Q188 -157 173 -161Q134 -174 113 -198T88 -242T82 -278T71 -294Q57 -294 57 -261Q57 -204 91 -161T179 -104Q195 -99 228 -99Q274 -102 315 -124Q337 -132 337 -130L404 -1L384 12Q319 58 273 74Q255 79 222 79Q188 79 173 74Q133 61 112 37T88 -7T82 -43T70 -59Q57 -59 57 -26",
        10938: "693 501Q693 493 679 481H604Q548 479 509 477T418 469T331 454T257 429T194 392T150 340T124 270Q117 247 115 245Q101 236 88 247Q82 254 82 267Q89 330 126 379Q147 411 202 444T333 494L357 501Q239 531 188 565Q142 599 126 623Q89 672 82 734Q82 761 102 761L115 756Q116 755 124 732Q133 678 166 640T241 579T349 544T470 527T604 521H679Q693 507 693 501ZM57 -26Q57 39 101 87T219 136Q254 136 277 130Q320 114 382 72Q419 50 424 45Q426 45 459 110Q496 178 497 179Q500 180 504 180Q509 180 517 175T526 161Q526 158 495 90L462 25Q462 21 502 5Q519 1 553 1Q586 1 602 5Q641 18 664 45T691 107Q694 136 706 136T718 115Q718 114 718 111T717 105Q717 39 671 -9T554 -58L459 -33Q450 -29 444 -27T437 -26L371 -155L391 -168Q485 -235 538 -235H553Q586 -235 602 -230Q683 -204 691 -128Q694 -99 706 -99T718 -120Q718 -121 718 -124T717 -130Q717 -199 670 -246T557 -294T393 -228Q353 -205 351 -201Q348 -201 315 -266Q294 -310 285 -323T268 -337Q259 -337 254 -331T248 -317Q248 -305 282 -246L313 -181Q313 -177 273 -161Q255 -157 222 -157Q188 -157 173 -161Q134 -174 113 -198T88 -242T82 -278T71 -294Q57 -294 57 -261Q57 -204 91 -161T179 -104Q195 -99 228 -99Q274 -102 315 -124Q337 -132 337 -130L404 -1L384 12Q319 58 273 74Q255 79 222 79Q188 79 173 74Q133 61 112 37T88 -7T82 -43T70 -59Q57 -59 57 -26",
        10949: "84 463Q84 585 166 663T360 752Q361 752 370 752T395 752T430 752T475 753T524 753H679Q694 746 694 733Q694 724 681 714L522 713H470H441Q366 713 338 709T266 685Q244 674 224 659T179 617T139 550T124 463V458Q124 370 185 302Q244 238 328 220Q348 215 366 215T522 213H681Q694 203 694 193Q694 180 679 173H526Q510 173 480 173T434 172Q350 172 289 188T172 258Q84 340 84 463ZM84 -14T84 -1T98 19H679Q694 11 694 -1Q694 -14 679 -21H98Q84 -14 84 -1ZM84 -208T84 -195T98 -175H679Q694 -183 694 -195Q694 -208 679 -215H98Q84 -208 84 -195",
        10950: "83 733Q83 746 98 753H251Q267 753 297 753T343 754Q427 754 488 738T605 668Q693 587 693 463Q693 378 650 312T545 213T415 174Q407 173 251 173H98Q83 180 83 193Q83 203 96 213H255H308H337Q412 213 439 217T512 241Q533 252 553 267T599 309T639 376T654 463Q654 554 592 624Q557 662 512 685Q468 704 439 708T335 713H306H255L96 714Q83 724 83 733ZM84 -14T84 -1T98 19H679Q694 11 694 -1Q694 -14 679 -21H98Q84 -14 84 -1ZM84 -208T84 -195T98 -175H679Q694 -183 694 -195Q694 -208 679 -215H98Q84 -208 84 -195",
        10955: "693 221Q693 214 680 201H524Q398 201 367 202T309 212Q236 230 180 280T98 398Q84 438 84 492T98 585Q126 663 193 716T346 781Q347 781 373 781T440 782T520 783H680Q682 780 686 776T691 770T693 763T680 743H526Q364 743 353 741Q279 730 221 687T138 578Q124 540 124 492T138 405Q163 340 221 297T353 243Q364 241 526 241H680Q682 238 686 234T691 228T693 221ZM82 -48T82 -41T95 -19H462L513 41L569 105Q574 110 582 110T596 104T602 90Q602 87 600 83Q600 77 555 30L515 -17L600 -19H682Q693 -30 693 -38T680 -59H480L415 -137L349 -213L515 -215H682Q693 -226 693 -233T680 -255H313L260 -317Q224 -360 212 -372T192 -385Q184 -385 179 -377T173 -362Q174 -361 218 -306L260 -255H178L93 -253L86 -248Q82 -243 82 -235Q82 -226 93 -215H195L295 -213L362 -137L426 -59H260L93 -57L86 -53Q82 -48 82 -41",
        10956: "82 759T82 763T83 769T89 776T95 783H251Q378 783 409 782T469 772Q540 753 596 703T678 585Q691 546 691 492T678 398Q649 320 581 267T426 203Q415 201 251 201H95Q82 214 82 221Q82 225 83 227T89 234T95 241H249Q411 241 422 243Q496 253 554 296T638 405Q651 444 651 492Q651 539 638 578Q613 643 555 686T422 741Q411 743 249 743H95Q82 759 82 763ZM82 -48T82 -41T95 -19H462L513 41L569 105Q574 110 582 110T596 104T602 90Q602 87 600 83Q600 77 555 30L515 -17L600 -19H682Q693 -30 693 -38T680 -59H480L415 -137L349 -213L515 -215H682Q693 -226 693 -233T680 -255H313L260 -317Q224 -360 212 -372T192 -385Q184 -385 179 -377T173 -362Q174 -361 218 -306L260 -255H178L93 -253L86 -248Q82 -243 82 -235Q82 -226 93 -215H195L295 -213L362 -137L426 -59H260L93 -57L86 -53Q82 -48 82 -41",
        12296: "333 -232Q332 -239 327 -244T313 -250Q303 -250 296 -240Q293 -233 202 6T110 250T201 494T296 740Q299 745 306 749L309 750Q312 750 313 750Q331 750 333 732Q333 727 243 489Q152 252 152 250T243 11Q333 -227 333 -232",
        12297: "55 732Q56 739 61 744T75 750Q85 750 92 740Q95 733 186 494T278 250T187 6T92 -240Q85 -250 75 -250Q67 -250 62 -245T55 -232Q55 -227 145 11Q236 248 236 250T145 489Q55 727 55 732",
        57350: "91 417Q104 430 111 430T131 417V301L171 341Q201 373 207 378T220 384Q227 384 233 377T240 366Q240 357 187 299L131 244V-10Q116 -23 111 -23T91 -10V201L49 157Q20 127 14 121T0 115Q-8 115 -14 121T-20 132Q-20 139 17 178Q29 191 36 199L91 257V417",
        57351: "56 417Q68 431 76 431L89 426L96 419V317L98 215L193 273L291 330V375L293 419Q301 431 311 431Q331 431 331 388L333 355L356 370Q381 384 388 384Q394 384 400 377T407 363Q407 354 367 328L331 308V-10Q316 -23 310 -23Q300 -23 293 -12L291 135V284L98 168L96 77V-12Q84 -24 76 -24L62 -19L58 -12L56 66V144L31 128Q5 114 -2 114Q-8 114 -14 121T-20 136Q-20 142 -14 147T20 170L56 190V417",
        57352: "477 261Q477 257 473 256T455 253T417 251T348 250H235L155 -77L146 -82Q137 -85 109 -85Q55 -85 55 -77L139 261Q224 596 226 598Q229 603 239 603Q240 603 254 603T290 603T341 604T405 605T477 605Q656 603 687 602T719 596Q719 589 692 588T513 585H319L282 427L242 272Q242 270 351 270Q388 270 410 270T444 269T460 267T469 265T477 261",
        57353: "228 325Q170 322 156 316T127 309Q108 309 104 314Q99 319 99 322T108 341Q125 376 171 400T268 425H271Q302 425 319 396Q328 377 328 358Q328 332 324 314Q311 270 286 221Q274 194 274 192H275Q339 234 484 325T639 421Q669 434 691 434T723 425T734 406Q734 394 719 381Q715 376 644 330L575 287L566 267Q543 233 526 176Q520 160 515 143T508 115T506 105Q506 103 533 103Q585 103 607 110T641 118Q670 118 670 107Q670 100 661 85Q643 50 598 27T504 3Q465 3 450 36Q441 51 441 73Q441 84 444 96Q452 146 484 205L497 236L324 125Q143 12 135 10Q103 -6 77 -6Q61 -6 49 2T37 21Q37 36 49 46T124 96L195 141L204 156Q219 179 243 248T264 323Q264 325 228 325",
        57356: "86 472Q93 477 381 614T673 752Q680 752 686 746T693 732T689 721Q686 715 418 590L151 461L418 332Q684 207 689 201Q693 195 693 190Q693 183 687 177T675 170Q668 170 380 307T86 450Q82 454 82 461Q82 467 86 472ZM369 101V126Q369 156 382 156H384Q385 157 386 157Q409 157 409 115V98V54H680Q693 39 693 34T680 14H409V-142H680Q693 -155 693 -162Q693 -167 680 -182H409V-273Q396 -284 388 -284Q382 -284 369 -275V-182H95Q82 -167 82 -162Q82 -155 95 -142H369V14H95Q93 17 89 21T84 27T82 34T83 40T89 47T95 54H369V101",
        57357: "89 745Q95 752 100 752Q106 752 394 615T689 472Q693 468 693 461T689 450Q684 445 396 308T100 170Q95 170 89 176T82 190Q82 195 86 201Q91 208 358 332L624 461L358 590Q90 715 86 721Q82 725 82 731Q82 739 89 745ZM369 101V126Q369 156 382 156H384Q385 157 386 157Q409 157 409 115V98V54H680Q693 39 693 34T680 14H409V-142H680Q693 -155 693 -162Q693 -167 680 -182H409V-273Q396 -284 388 -284Q382 -284 369 -275V-182H95Q82 -167 82 -162Q82 -155 95 -142H369V14H95Q93 17 89 21T84 27T82 34T83 40T89 47T95 54H369V101",
        57358: "97 172Q82 172 82 190Q82 197 86 201Q94 209 173 246T327 319T402 357Q405 360 434 448T462 539L278 628Q96 713 86 721Q82 725 82 732T88 745T102 752Q103 752 125 742T198 709T293 666Q342 642 385 622T453 590T478 579Q479 579 506 659T562 824T598 915Q602 919 609 919T622 913T629 901Q629 898 571 728Q546 656 531 608T518 559Q555 539 602 519Q664 488 679 479T694 461Q694 457 689 450Q680 443 616 413T494 356T435 326L389 190L342 57L513 55H682Q694 43 694 34Q694 28 689 21L682 17L506 15H329L322 -8Q320 -13 310 -41T295 -85L275 -141H680Q682 -143 684 -146T688 -151T691 -156T693 -162Q693 -172 682 -179L473 -181H262L220 -303Q192 -388 185 -404T166 -421Q160 -421 153 -415T146 -403Q146 -400 179 -302T220 -185Q220 -181 158 -181L93 -179L86 -174Q82 -169 82 -161Q82 -152 93 -141H164L233 -139L260 -63L286 15H189L93 17L86 21Q82 26 82 34Q82 44 93 55H198L300 57L342 179Q350 204 361 238T378 286T382 301L246 237Q111 172 97 172ZM624 461Q621 464 560 492Q512 518 503 518Q500 518 500 517Q499 513 488 479T465 413T453 379L624 461",
        57359: "97 54Q82 54 82 72Q82 79 86 84Q95 91 222 153L351 215L398 324L442 433L258 519Q95 597 87 604Q82 608 82 615T88 628T102 635Q107 635 424 484L458 468L524 630Q593 789 597 795Q601 801 609 801Q616 801 622 795T629 781L562 615L493 450L589 406Q665 371 679 362T694 344Q694 339 693 337T677 326T631 302T538 257Q504 241 465 223T406 195T386 186Q383 185 344 92T306 -3L486 81Q662 168 673 168Q680 168 686 162T693 148T689 137Q688 136 482 35L280 -59L233 -176Q184 -291 178 -299Q172 -303 166 -303T153 -297T146 -283Q146 -279 185 -186T224 -90Q225 -88 223 -88Q219 -88 193 -101Q109 -143 98 -143Q82 -138 82 -122Q82 -116 85 -113T108 -98T171 -67L249 -30L289 61Q297 81 307 107T321 144T326 157L218 106Q109 54 97 54ZM553 379Q480 412 480 415Q479 415 460 372T423 285T406 241Q408 240 516 291T624 344L553 379",
        57360: "102 168Q103 168 151 146T247 102T295 81Q299 85 322 144T344 206L218 268Q153 297 123 313T87 333T82 344T86 355Q104 369 291 455Q491 552 491 553L542 673Q581 767 590 784T609 801Q616 801 622 795T629 781Q629 773 586 677Q546 581 546 577L609 606Q669 635 673 635Q680 635 686 629T693 615Q693 610 692 608T670 593T604 561L524 521L400 226L542 157Q617 123 649 107T687 85T694 72Q694 66 690 60T679 54Q665 54 526 119Q394 186 386 186Q385 186 342 88L331 61L509 -23Q680 -105 688 -111Q693 -115 693 -122T688 -135T675 -141H673Q664 -141 491 -59Q320 21 316 21H315L249 -136Q183 -293 178 -299Q172 -303 166 -303T153 -297T146 -283Q146 -282 154 -261T181 -197T213 -119L280 41Q280 46 186 86Q157 101 121 119Q92 133 87 136T82 148Q82 155 88 161T102 168ZM418 370L466 495Q464 495 308 420T151 344T204 317T311 267T364 244Q364 247 418 370",
        57361: "82 34Q82 44 93 55H198L300 57L342 179Q351 207 362 238T378 286T384 303T238 377Q109 435 86 450Q82 454 82 460T86 472Q90 476 302 579L511 679Q512 679 553 795Q569 842 577 866T592 903T600 917T608 919Q615 919 622 912T629 901Q629 899 595 799Q589 777 581 753T569 717T564 703L618 728Q666 752 673 752T686 746T693 732Q693 723 683 717T615 683L546 650L491 488Q464 410 450 368T438 326Q493 297 562 266Q660 219 677 209T694 190Q694 183 690 177T678 171Q664 171 546 228L424 286Q422 286 382 172L342 57L513 55H682Q694 43 694 34Q694 28 689 21L682 17L506 15H329L322 -8Q320 -13 310 -41T295 -85L275 -141H680Q682 -143 684 -146T688 -151T691 -156T693 -162Q693 -172 682 -179L473 -181H262L220 -303Q192 -388 185 -404T166 -421Q160 -421 153 -415T146 -403Q146 -400 179 -302T220 -185Q220 -181 158 -181L93 -179L86 -174Q82 -169 82 -161Q82 -152 93 -141H164L233 -139L260 -63L286 15H189L93 17L86 21Q82 26 82 34ZM495 623Q495 626 493 626T321 544T151 461L398 343Q399 343 405 360T423 415T446 483Q457 513 469 551T488 606T495 623",
        57366: "82 -6Q82 1 95 14H262L295 94Q331 171 331 174Q324 175 312 178T267 194T206 227T146 283T98 368Q84 406 84 461T98 554Q126 632 194 685T349 750Q360 752 480 752H591L604 783Q620 819 624 821Q631 828 640 828Q653 825 658 810Q658 808 646 781L635 754Q635 752 658 752Q680 752 686 746Q693 739 693 732Q693 728 692 726T686 719T680 712H615L506 466Q479 407 451 344T408 248T393 214Q393 210 535 210H680Q693 194 693 190T680 170H373L340 92L304 14H680Q693 1 693 -6Q693 -11 680 -26H286L253 -103L218 -179L451 -181H682Q694 -193 694 -201Q694 -212 682 -219L440 -221H200L178 -270Q160 -309 154 -319T139 -330Q122 -330 118 -312L155 -223Q155 -221 126 -221H95Q82 -206 82 -201T95 -181H175L206 -108Q237 -35 242 -30Q242 -26 169 -26H95Q82 -11 82 -6ZM571 710Q571 712 469 712Q443 712 416 712T371 711T351 710Q279 700 221 656T138 548Q124 508 124 461T138 374Q186 245 351 212L460 459Q571 709 571 710",
        57367: "82 -14T82 -7T95 15H431L529 170H435Q341 170 333 175Q149 218 98 368Q84 406 84 461Q84 515 98 555Q126 633 193 686T346 750Q347 750 373 750T440 751T520 752H680Q693 739 693 732Q693 727 680 712H526Q364 712 353 710Q268 700 207 646T126 512Q123 496 123 461T126 410Q141 350 180 304T280 232Q312 217 344 214T464 210H555L589 261Q613 301 620 311T635 321Q644 321 650 315T657 301Q657 296 651 286T630 252T604 212Q604 210 642 210H680Q693 197 693 190Q693 186 692 184T686 177T680 170H578L526 92L478 17L580 15H682Q693 4 693 -4T680 -25H451L353 -179L518 -181H682Q694 -193 694 -201Q694 -211 682 -219L504 -221H326L293 -272Q257 -332 246 -332Q238 -332 232 -326T225 -313Q225 -310 226 -308Q226 -305 251 -265T278 -223Q278 -221 186 -221H95Q93 -218 89 -214T84 -208T82 -201T95 -181H306L404 -25H249L93 -23L86 -19Q82 -14 82 -7",
        57368: "82 732Q82 739 95 752H251H348Q420 752 460 744T551 708Q566 697 566 701Q618 815 624 821Q631 828 640 828Q653 825 658 810L600 677Q600 671 615 656T653 605T689 517Q692 496 692 461T689 406Q668 325 615 266Q572 221 513 196T391 170H373L340 92L304 14H680Q693 1 693 -6Q693 -11 680 -26H286L253 -103L218 -179L451 -181H682Q694 -193 694 -201Q694 -212 682 -219L440 -221H200L178 -270Q160 -309 154 -319T139 -330Q122 -330 118 -312L155 -223Q155 -221 126 -221H95Q82 -206 82 -201T95 -181H175L206 -108Q237 -35 242 -30Q242 -26 169 -26H95Q82 -11 82 -6Q82 1 95 14H262L295 92L331 170H95Q93 172 91 175T87 180T84 185T82 191Q82 199 93 210H220L349 212L549 659Q507 692 462 702T338 712H249H95Q82 727 82 732ZM652 473Q652 513 636 552T603 611T582 632Q581 632 487 422T393 210Q424 210 460 220T535 253T605 316T649 410Q652 427 652 461V473",
        57369: "82 732Q82 739 95 752H251Q415 752 426 750Q539 736 615 657Q667 599 689 517Q692 496 692 461T689 406Q668 325 615 266Q522 170 382 170H355L326 95Q319 80 311 59T298 28T293 17Q293 15 486 15H680Q693 0 693 -6T680 -25H275L213 -179L449 -181H682Q693 -192 693 -199T680 -221H198L178 -270Q153 -333 139 -333Q132 -333 126 -327T119 -314T135 -266T153 -223Q153 -221 124 -221H95Q82 -207 82 -201T95 -181H171L233 -25H162L93 -23L86 -19Q82 -14 82 -7T95 15H251L313 170H202L93 172L86 177Q82 182 82 190Q82 199 93 210H211L329 212L349 261Q366 301 372 311T386 321Q392 321 399 315T407 302Q407 295 390 254T373 210Q374 209 377 209Q412 209 444 217Q512 231 564 273T638 377Q651 414 651 461Q651 509 638 548Q613 613 555 656T422 710Q411 712 249 712H95Q82 727 82 732",
        57370: "693 -115T693 -122T680 -144H315L269 -199Q221 -255 213 -255H212Q203 -255 197 -248T193 -231Q195 -225 229 -184L262 -144H186L113 -142L106 -137Q102 -130 102 -125Q102 -119 115 -104H298L426 52H386Q342 54 309 63Q236 79 180 129T98 249Q84 289 84 343Q84 398 98 436Q126 514 193 567T346 632Q347 632 373 632T440 633T520 634H680Q682 631 686 627T691 621T693 614T680 594H526Q364 594 353 592Q268 581 207 528T126 394Q123 378 123 343T126 292Q141 231 181 185T280 114Q329 92 415 92H462L506 147Q554 203 562 203H563Q572 203 578 196T582 178Q579 173 546 132L513 94L598 92H682Q693 81 693 73T680 52H480L349 -102L515 -104H682Q693 -115 693 -122",
        57371: "82 610T82 614T83 620T89 627T95 634H251Q378 634 409 633T469 623Q540 604 596 554T678 436Q691 397 691 343T678 249Q653 181 597 131T469 63Q427 52 362 52H315L213 -102L438 -104H662Q673 -115 673 -123Q673 -129 660 -144H186L151 -197Q114 -250 109 -253Q106 -254 104 -254Q100 -254 98 -253Q91 -253 87 -248T82 -235Q82 -230 109 -186L138 -144H115Q82 -144 82 -125Q82 -119 95 -104H166L266 49Q266 52 182 52H95Q82 65 82 72Q82 76 83 78T89 85T95 92H295L329 143Q365 195 369 198Q372 203 380 203Q385 203 391 197T398 185Q398 184 398 184L399 182Q399 175 369 129L344 94Q344 92 376 92Q402 92 422 94Q496 104 554 147T638 256Q651 295 651 343Q651 390 638 429Q613 494 555 537T422 592Q411 594 249 594H95Q82 610 82 614",
        119808: "296 0Q278 3 164 3Q58 3 49 0H40V62H92Q144 62 144 64Q388 682 397 689Q403 698 434 698Q463 698 471 689Q475 686 538 530T663 218L724 64Q724 62 776 62H828V0H817Q796 3 658 3Q509 3 485 0H472V62H517Q561 62 561 63L517 175H262L240 120Q218 65 217 64Q217 62 261 62H306V0H296ZM390 237L492 238L440 365Q390 491 388 491Q287 239 287 237H390",
        119809: "720 510Q720 476 704 448T665 404T619 377T580 362L564 359L583 356Q602 353 632 342T690 312Q712 292 725 276Q752 235 752 189V183Q752 160 741 125Q698 18 547 2Q543 1 288 0H39V62H147V624H39V686H264H409Q502 686 542 681T624 655Q720 607 720 510ZM563 513Q563 553 548 578T518 611T486 622Q479 624 385 624H293V382H375Q458 383 467 385Q563 405 563 513ZM590 192Q590 307 505 329Q504 330 503 330L398 331H293V62H391H400H444Q496 62 528 75T580 131Q590 155 590 192",
        119810: "64 343Q64 502 174 599T468 697Q502 697 533 691T586 674T623 655T647 639T657 632L694 663Q703 670 711 677T723 687T730 692T735 695T740 696T746 697Q759 697 762 692T766 668V627V489V449Q766 428 762 424T742 419H732H720Q699 419 697 436Q690 498 657 545Q611 618 532 632Q522 634 496 634Q356 634 286 553Q232 488 232 343T286 133Q355 52 497 52Q597 52 650 112T704 237Q704 248 709 251T729 254H735Q750 254 755 253T763 248T766 234Q766 136 680 63T469 -11Q285 -11 175 86T64 343",
        119811: "39 624V686H270H310H408Q500 686 545 680T638 649Q768 584 805 438Q817 388 817 338Q817 171 702 75Q628 17 515 2Q504 1 270 0H39V62H147V624H39ZM655 337Q655 370 655 390T650 442T639 494T616 540T580 580T526 607T451 623Q443 624 368 624H298V62H377H387H407Q445 62 472 65T540 83T606 129Q629 156 640 195T653 262T655 337",
        119812: "723 286Q721 284 700 145T677 3V0H39V62H147V618H39V680H660V676Q662 670 675 552T691 428V424H629V428Q629 429 627 448T618 494T601 541Q574 593 527 605T382 618H374H304V384H336Q338 384 347 384T361 384T376 386T392 390T407 397T421 407T432 423Q442 444 443 482V501H505V205H443V224Q442 258 435 278T411 307T380 318T336 322H304V62H375H394Q429 62 449 62T497 66T541 76T577 95T609 126T632 170T651 232Q661 287 661 289H723V286",
        119813: "425 0L228 3Q63 3 51 0H39V62H147V618H39V680H644V676Q647 670 659 552T675 428V424H613Q613 433 605 477Q599 511 589 535T562 574T530 599T488 612T441 617T387 618H368H304V371H333Q389 373 411 390T437 468V488H499V192H437V212Q436 244 430 263T408 292T378 305T333 309H304V62H439V0H425",
        119814: "465 -10Q281 -10 173 88T64 343Q64 413 85 471T143 568T217 631T298 670Q371 697 449 697Q452 697 459 697T470 696Q502 696 531 690T582 675T618 658T644 641T656 632L732 695Q734 697 745 697Q758 697 761 692T765 668V627V489V449Q765 428 761 424T741 419H731H724Q705 419 702 422T695 444Q683 520 631 577T495 635Q364 635 295 563Q261 528 247 477T232 343Q232 296 236 260T256 185T296 120T366 76T472 52Q481 51 498 51Q544 51 573 67T607 108Q608 111 608 164V214H464V276H479Q506 273 680 273Q816 273 834 276H845V214H765V113V51Q765 16 763 8T750 0Q742 2 709 16T658 40L648 46Q592 -10 465 -10",
        119815: "400 0Q376 3 226 3Q75 3 51 0H39V62H147V624H39V686H51Q75 683 226 683Q376 683 400 686H412V624H304V388H595V624H487V686H499Q523 683 673 683Q824 683 848 686H860V624H752V62H860V0H848Q824 3 674 3Q523 3 499 0H487V62H595V326H304V62H412V0H400",
        119816: "397 0Q370 3 218 3Q65 3 38 0H25V62H139V624H25V686H38Q65 683 218 683Q370 683 397 686H410V624H296V62H410V0H397",
        119817: "174 114Q174 96 169 82T159 63T144 47L155 45Q183 40 203 40Q271 40 290 104Q294 118 294 150T295 380V624H154V686H169Q196 683 365 683Q499 683 517 686H527V624H446V379Q446 183 446 153T441 108Q413 32 315 2Q266 -11 208 -11Q160 -11 118 -2T42 37T8 114V122Q8 150 30 174T91 198T152 174T174 122V114",
        119818: "400 0Q376 3 226 3Q75 3 51 0H39V62H147V624H39V686H51Q75 683 226 683Q376 683 400 686H412V624H304V338L472 483L634 624H565V686H576Q597 683 728 683Q814 683 829 686H836V624H730L614 524Q507 432 497 422Q496 422 498 418T514 395T553 342T627 241L759 63L805 62H852V0H842Q830 3 701 3Q550 3 526 0H513V62H549Q584 62 584 63Q583 65 486 196T388 328L304 256V62H412V0H400",
        119819: "643 285Q641 280 629 148T612 4V0H39V62H147V624H39V686H51Q75 683 228 683Q415 685 425 686H439V624H304V62H352H378Q492 62 539 138Q551 156 558 178T569 214T576 255T581 289H643V285",
        119820: "314 0Q296 3 181 3T48 0H39V62H147V624H39V686H305Q316 679 323 667Q330 653 434 414L546 157L658 414Q766 662 773 674Q778 681 788 686H1052V624H944V62H1052V0H1040Q1016 3 874 3T708 0H696V62H804V341L803 618L786 580Q770 543 735 462T671 315Q540 13 536 9Q528 1 507 1Q485 1 477 9Q472 14 408 162T281 457T217 603Q215 603 215 334V62H323V0H314",
        119821: "314 0Q296 3 181 3T48 0H39V62H147V624H39V686H171H265Q288 686 297 686T309 684T315 679Q317 676 500 455T684 233V624H576V686H585Q603 683 718 683T851 686H860V624H752V319Q752 15 750 11Q747 4 742 2T718 0H712Q708 0 706 0T700 0T696 1T693 2T690 4T687 7T684 11T679 16T674 23Q671 27 437 311L215 579V62H323V0H314",
        119822: "64 339Q64 431 96 502T182 614T295 675T420 696Q469 696 481 695Q620 680 709 589T798 339Q798 173 697 82T432 -10Q262 -10 163 85T64 339ZM625 454Q618 502 600 538T562 593T515 624T469 639T431 642Q331 642 276 563Q232 493 232 353Q232 315 234 285T244 216T267 148T308 94T372 56Q405 46 432 46Q517 46 567 106T627 267Q631 299 631 353Q631 418 625 454",
        119823: "400 0Q376 3 226 3Q75 3 51 0H39V62H147V624H39V686H253Q435 686 470 685T536 678Q585 668 621 648T675 605T705 557T718 514T721 483T718 451T704 409T673 362T616 322T530 293Q500 288 399 287H304V62H412V0H400ZM553 475Q553 554 537 582T459 622Q451 623 373 624H298V343H372Q457 344 480 350Q527 362 540 390T553 475",
        119824: "64 339Q64 431 96 502T182 614T295 675T420 696Q469 696 481 695Q620 680 709 589T798 339Q798 255 768 184Q720 77 611 26L600 21Q635 -26 682 -26H696Q769 -26 769 0Q769 7 774 12T787 18Q805 18 805 -7V-13Q803 -64 785 -106T737 -171Q720 -183 697 -191Q687 -193 668 -193Q636 -193 613 -182T575 -144T552 -94T532 -27Q531 -23 530 -16T528 -6T526 -3L512 -5Q499 -7 477 -8T431 -10Q393 -10 382 -9Q238 8 151 97T64 339ZM326 80Q326 113 356 138T430 163Q492 163 542 100L553 86Q554 85 561 91T578 108Q637 179 637 330Q637 430 619 498T548 604Q500 641 425 641Q408 641 390 637T347 623T299 590T259 535Q226 469 226 338Q226 244 246 180T318 79L325 74Q326 74 326 80ZM506 58Q480 112 433 112Q412 112 395 104T378 77Q378 44 431 44Q480 44 506 58",
        119825: "394 0Q370 3 222 3Q75 3 51 0H39V62H147V624H39V686H234Q256 686 299 686T362 687Q479 687 554 669T681 593Q716 550 716 497Q716 390 568 338Q569 337 572 336T577 332Q605 317 623 300T650 258T662 218T668 172Q678 98 689 76Q707 40 748 40Q770 40 780 54T795 88T801 111Q805 117 827 117H831Q846 117 852 113T858 92Q857 78 852 63T834 30T797 1T739 -11Q630 -11 580 12T511 87Q506 104 506 168Q506 170 506 178T507 194Q507 289 438 313Q424 318 356 318H298V62H406V0H394ZM366 369Q459 370 490 381Q548 402 548 476V498V517Q548 578 513 600Q479 624 392 624H358H298V369H366",
        119826: "64 493Q64 582 120 636T264 696H272Q280 697 285 697Q380 697 454 645L480 669Q484 672 488 676T495 683T500 688T504 691T508 693T511 695T514 696T517 697T522 697Q536 697 539 691T542 652V577Q542 557 542 532T543 500Q543 472 540 465T524 458H511H505Q489 458 485 461T479 478Q472 529 449 564T393 614T336 634T287 639Q228 639 203 610T177 544Q177 517 195 493T247 457Q253 454 343 436T475 391Q574 326 574 207V200Q574 163 559 120Q517 12 389 -9Q380 -10 346 -10Q308 -10 275 -5T221 7T184 22T160 35T151 40L126 17Q122 14 118 10T111 3T106 -2T102 -5T98 -7T95 -9T92 -10T89 -11T84 -11Q70 -11 67 -4T64 35V108Q64 128 64 153T63 185Q63 203 63 211T69 223T77 227T94 228H100Q118 228 122 225T126 205Q130 125 193 88T345 51Q408 51 434 82T460 157Q460 196 439 221T388 257Q384 259 305 276T221 295Q155 313 110 366T64 493",
        119827: "41 425Q41 426 51 545T62 669V675H737V669Q738 665 748 546T758 425V419H696V425Q687 517 669 555T595 607Q578 612 522 613H478V62H631V0H615Q585 3 399 3Q214 3 184 0H168V62H321V613H277H263Q164 613 134 561Q113 527 103 425V419H41V425",
        119828: "570 686Q588 683 703 683T836 686H845V624H737V420Q737 390 737 345T738 284Q738 205 729 164T689 83Q614 -11 465 -11Q321 -11 240 51T148 207Q147 214 147 421V624H39V686H51Q75 683 226 683Q376 683 400 686H412V624H304V405V370V268Q304 181 311 146T346 87Q387 52 466 52Q642 52 667 195Q668 204 669 415V624H561V686H570",
        119829: "592 686H604Q615 685 631 685T666 684T700 684T724 683Q829 683 835 686H843V624H744L611 315Q584 254 546 165Q492 40 482 19T461 -6L460 -7H409Q398 -4 391 9Q385 20 257 315L124 624H25V686H36Q57 683 190 683Q340 683 364 686H377V624H289L384 403L480 185L492 212Q504 240 529 298T575 405L670 624H582V686H592",
        119830: "915 686L1052 683Q1142 683 1157 686H1164V624H1073L957 320Q930 249 900 170T855 52T839 10Q834 0 826 -5Q821 -7 799 -7H792Q777 -7 772 -5T759 10Q759 11 748 39T716 122T676 228L594 442L512 228Q486 159 455 78Q433 19 428 9T416 -5Q411 -7 389 -7H379Q356 -7 349 10Q349 12 334 51T288 170T231 320L116 624H24V686H35Q44 683 183 683Q331 683 355 686H368V624H323Q278 624 278 623L437 207L499 369L561 531L526 624H434V686H445Q454 683 593 683Q741 683 765 686H778V624H733Q688 624 688 623L847 207Q848 207 927 415T1006 624H905V686H915",
        119831: "327 0Q306 3 174 3Q52 3 43 0H33V62H98L162 63L360 333L157 624H48V686H59Q80 683 217 683Q368 683 395 686H408V624H335L393 540L452 458L573 623Q573 624 528 624H483V686H494Q515 683 646 683Q769 683 778 686H787V624H658L575 511Q493 398 493 397L508 376Q522 356 553 312T611 229L727 62H835V0H824Q803 3 667 3Q516 3 489 0H476V62H513L549 63L401 274L247 63Q247 62 292 62H338V0H327",
        119832: "605 0Q581 3 434 3Q286 3 262 0H250V62H358V275L126 624H19V686H30Q54 683 189 683Q361 685 370 686H383V624H308L319 608Q330 591 353 556T396 491L484 359L660 623Q660 624 623 624H585V686H595Q613 683 728 683Q832 683 841 686H849V624H742L509 274V62H618V0H605",
        119833: "80 430L92 686H358Q624 686 628 684Q638 679 638 656Q638 640 637 639Q637 638 445 353Q401 288 351 214T277 103L253 67L256 66Q258 66 265 66T279 66T298 66H343Q380 66 406 68T464 81T518 110T557 164T579 250Q583 278 583 298Q583 299 614 299H645V291Q643 281 636 150T627 8V0H353Q79 0 75 2Q64 7 64 31Q64 48 66 52L259 340L451 623Q451 624 384 624Q294 623 259 612Q155 581 143 446Q142 440 142 432V430H80",
        119834: "64 349Q64 399 107 426T255 453Q346 453 402 423T473 341Q478 327 478 310T479 196V77Q493 63 529 62Q549 62 553 57T558 31Q558 9 552 5T514 0H497H481Q375 0 367 56L356 46Q300 -6 210 -6Q130 -6 81 30T32 121Q32 188 111 226T332 272H350V292Q350 313 348 327T337 361T306 391T248 402T194 399H189Q204 376 204 354Q204 327 187 306T134 284Q97 284 81 305T64 349ZM164 121Q164 89 186 67T238 45Q274 45 307 63T346 108L350 117V226H347Q248 218 206 189T164 121",
        119835: "32 686L123 690Q214 694 215 694H221V409Q289 450 378 450Q479 450 539 387T600 221Q600 122 535 58T358 -6H355Q272 -6 203 53L160 1L129 0H98V301Q98 362 98 435T99 525Q99 591 97 604T83 620Q69 624 42 624H29V686H32ZM227 105L232 99Q237 93 242 87T258 73T280 59T306 49T339 45Q380 45 411 66T451 131Q457 160 457 230Q457 264 456 284T448 329T430 367T396 389T343 398Q282 398 235 355L227 348V105",
        119836: "447 131H458Q478 131 478 117Q478 112 471 95T439 51T377 9Q330 -6 286 -6Q196 -6 135 35Q39 96 39 222Q39 324 101 384Q169 453 286 453Q359 453 411 431T464 353Q464 319 445 302T395 284Q360 284 343 305T325 353Q325 380 338 396H333Q317 398 295 398H292Q280 398 271 397T245 390T218 373T197 338T183 283Q182 275 182 231Q182 199 184 180T193 132T220 85T270 57Q289 50 317 50H326Q385 50 414 115Q419 127 423 129T447 131",
        119837: "351 686L442 690Q533 694 534 694H540V389Q540 327 540 253T539 163Q539 97 541 83T555 66Q569 62 596 62H609V31Q609 0 608 0Q588 0 510 -3T412 -6Q411 -6 411 16V38L401 31Q337 -6 265 -6Q159 -6 99 58T38 224Q38 265 51 303T92 375T165 429T272 449Q359 449 417 412V507V555Q417 597 415 607T402 620Q388 624 361 624H348V686H351ZM411 350Q362 399 291 399Q278 399 256 392T218 371Q195 351 189 320T182 238V221Q182 179 183 159T191 115T212 74Q241 46 288 46Q358 46 404 100L411 109V350",
        119838: "32 225Q32 332 102 392T272 452H283Q382 452 436 401Q494 343 494 243Q494 226 486 222T440 217Q431 217 394 217T327 218H175V209Q175 177 179 154T196 107T236 69T306 50Q312 49 323 49Q376 49 410 85Q421 99 427 111T434 127T442 133T463 135H468Q494 135 494 117Q494 110 489 97T468 66T431 32T373 5T292 -6Q181 -6 107 55T32 225ZM383 276Q377 346 348 374T280 402Q253 402 230 390T195 357Q179 331 176 279V266H383V276",
        119839: "308 0Q290 3 172 3Q58 3 49 0H40V62H109V382H42V444H109V503L110 562L112 572Q127 625 178 658T316 699Q318 699 330 699T348 700Q381 698 404 687T436 658T449 629T452 606Q452 576 432 557T383 537Q355 537 335 555T314 605Q314 635 328 649H325Q311 649 293 644T253 618T227 560Q226 555 226 498V444H340V382H232V62H318V0H308",
        119840: "50 300Q50 368 105 409T255 450Q328 450 376 426L388 420Q435 455 489 455Q517 455 533 441T554 414T558 389Q558 367 544 353T508 339Q484 339 471 354T458 387Q458 397 462 400Q464 401 461 400Q459 400 454 399Q429 392 427 390Q454 353 459 328Q461 315 461 300Q461 240 419 202Q364 149 248 149Q185 149 136 172Q129 158 129 148Q129 105 170 93Q176 91 263 91Q273 91 298 91T334 91T366 89T400 85T432 77T466 64Q544 22 544 -69Q544 -114 506 -145Q438 -201 287 -201Q149 -201 90 -161T30 -70Q30 -58 33 -47T42 -27T54 -13T69 -1T82 6T94 12T101 15Q66 57 66 106Q66 151 90 187L97 197L89 204Q50 243 50 300ZM485 403H492Q491 404 488 404L485 403V403ZM255 200Q279 200 295 206T319 219T331 242T335 268T336 300Q336 337 333 352T317 380Q298 399 255 399Q228 399 211 392T187 371T178 345T176 312V300V289Q176 235 194 219Q215 200 255 200ZM287 -150Q357 -150 400 -128T443 -71Q443 -65 442 -61T436 -50T420 -37T389 -27T339 -21L308 -20Q276 -20 253 -20Q190 -20 180 -20T156 -26Q130 -38 130 -69Q130 -105 173 -127T287 -150",
        119841: "40 686L131 690Q222 694 223 694H229V533L230 372L238 381Q248 394 264 407T317 435T398 450Q428 450 448 447T491 434T529 402T551 346Q553 335 554 198V62H623V0H614Q596 3 489 3Q374 3 365 0H356V62H425V194V275Q425 348 416 373T371 399Q326 399 288 370T238 290Q236 281 235 171V62H304V0H295Q277 3 171 3Q64 3 46 0H37V62H106V332Q106 387 106 453T107 534Q107 593 105 605T91 620Q77 624 50 624H37V686H40",
        119842: "72 610Q72 649 98 672T159 695Q193 693 217 670T241 610Q241 572 217 549T157 525Q120 525 96 548T72 610ZM46 442L136 446L226 450H232V62H294V0H286Q271 3 171 3Q67 3 49 0H40V62H109V209Q109 358 108 362Q103 380 55 380H43V442H46",
        119843: "104 610Q104 649 130 672T191 695Q225 693 249 670T273 610Q273 572 249 549T189 525Q152 525 128 548T104 610ZM78 442L173 446L268 450H274V196Q274 -5 274 -37T269 -83Q256 -132 201 -166T71 -200Q10 -200 -30 -173T-71 -102Q-71 -70 -51 -51T-1 -31Q27 -31 48 -49T69 -100Q69 -121 53 -147H56Q66 -149 77 -149H80Q90 -149 100 -146T127 -125T149 -73Q151 -55 151 149V362Q150 364 148 366T145 370T142 373T138 375T133 377T124 378T113 379T97 380H75V442H78",
        119844: "32 686L123 690Q214 694 215 694H221V255L377 382H346V444H355Q370 441 476 441Q544 441 556 444H562V382H476L347 277L515 62H587V0H579Q564 3 476 3Q370 3 352 0H343V62H358L373 63L260 206L237 189L216 172V62H285V0H277Q259 3 157 3Q46 3 37 0H29V62H98V332Q98 387 98 453T99 534Q99 593 97 605T83 620Q69 624 42 624H29V686H32",
        119845: "43 686L134 690Q225 694 226 694H232V62H301V0H292Q274 3 170 3Q67 3 49 0H40V62H109V332Q109 387 109 453T110 534Q110 593 108 605T94 620Q80 624 53 624H40V686H43",
        119846: "40 442Q217 450 218 450H224V365Q226 367 235 378T254 397T278 416T314 435T362 448Q376 450 400 450H406Q503 450 534 393Q545 376 545 370Q545 368 555 379Q611 450 716 450Q774 450 809 434Q850 414 861 379T873 276V213V198V62H942V0H933Q915 3 809 3Q702 3 684 0H675V62H744V194V275Q744 348 735 373T690 399Q645 399 607 370T557 290Q555 281 554 171V62H623V0H614Q596 3 489 3Q374 3 365 0H356V62H425V194V275Q425 348 416 373T371 399Q326 399 288 370T238 290Q236 281 235 171V62H304V0H295Q277 3 171 3Q64 3 46 0H37V62H106V210V303Q106 353 104 363T91 376Q77 380 50 380H37V442H40",
        119847: "40 442Q217 450 218 450H224V407L225 365Q233 378 245 391T289 422T362 448Q374 450 398 450Q428 450 448 447T491 434T529 402T551 346Q553 335 554 198V62H623V0H614Q596 3 489 3Q374 3 365 0H356V62H425V194V275Q425 348 416 373T371 399Q326 399 288 370T238 290Q236 281 235 171V62H304V0H295Q277 3 171 3Q64 3 46 0H37V62H106V210V303Q106 353 104 363T91 376Q77 380 50 380H37V442H40",
        119848: "287 -5Q228 -5 182 10T109 48T63 102T39 161T32 219Q32 272 50 314T94 382T154 423T214 446T265 452H279Q319 452 326 451Q428 439 485 376T542 221Q542 156 514 108T442 33Q384 -5 287 -5ZM399 230V250Q399 280 398 298T391 338T372 372T338 392T282 401Q241 401 212 380Q190 363 183 334T175 230Q175 202 175 189T177 153T183 118T195 91T215 68T245 56T287 50Q348 50 374 84Q388 101 393 132T399 230",
        119849: "32 442L123 446Q214 450 215 450H221V409Q222 409 229 413T251 423T284 436T328 446T382 450Q480 450 540 388T600 223Q600 128 539 61T361 -6H354Q292 -6 236 28L227 34V-132H296V-194H287Q269 -191 163 -191Q56 -191 38 -194H29V-132H98V113V284Q98 330 97 348T93 370T83 376Q69 380 42 380H29V442H32ZM457 224Q457 303 427 349T350 395Q282 395 235 352L227 345V104L233 97Q274 45 337 45Q383 45 420 86T457 224",
        119850: "38 220Q38 273 54 314T95 380T152 421T211 443T264 449Q368 449 429 386L438 377L484 450H540V-132H609V-194H600Q582 -191 475 -191Q360 -191 351 -194H342V-132H411V42Q409 41 399 34T383 25T367 16T347 7T324 1T296 -4T264 -6Q162 -6 100 56T38 220ZM287 46Q368 46 417 127V301L412 312Q398 347 369 371T302 395Q282 395 263 388T225 362T194 308T182 221Q182 126 214 86T287 46",
        119851: "405 293T374 293T324 312T305 361Q305 378 312 394Q315 397 315 399Q305 399 294 394T266 375T238 329T222 249Q221 241 221 149V62H308V0H298Q280 3 161 3Q47 3 38 0H29V62H98V210V303Q98 353 96 363T83 376Q69 380 42 380H29V442H32L118 446Q204 450 205 450H210V414L211 378Q247 449 315 449H321Q384 449 413 422T442 360Q442 332 424 313",
        119852: "38 315Q38 339 45 360T70 404T127 440T223 453Q273 453 320 436L338 445L357 453H366Q380 453 383 447T386 403V387V355Q386 331 383 326T365 321H355H349Q333 321 329 324T324 341Q317 406 224 406H216Q123 406 123 353Q123 334 143 321T188 304T244 294T285 286Q305 281 325 273T373 237T412 172Q414 162 414 142Q414 -6 230 -6Q154 -6 117 22L68 -6H58Q44 -6 41 0T38 42V73Q38 85 38 101T37 122Q37 144 42 148T68 153H75Q87 153 91 151T97 147T103 132Q131 46 220 46H230Q257 46 265 47Q330 58 330 108Q330 127 316 142Q300 156 284 162Q271 168 212 178T122 202Q38 243 38 315",
        119853: "272 49Q320 49 320 136V145V177H382V143Q382 106 380 99Q374 62 349 36T285 -2L272 -5H247Q173 -5 134 27Q109 46 102 74T94 160Q94 171 94 199T95 245V382H21V433H25Q58 433 90 456Q121 479 140 523T162 621V635H224V444H363V382H224V239V207V149Q224 98 228 81T249 55Q261 49 272 49",
        119854: "40 442L134 446Q228 450 229 450H235V273V165Q235 90 238 74T254 52Q268 46 304 46H319Q352 46 380 67T419 121L420 123Q424 135 425 199Q425 201 425 207Q425 233 425 249V316Q425 354 423 363T410 376Q396 380 369 380H356V442L554 450V267Q554 84 556 79Q561 62 610 62H623V31Q623 0 622 0Q603 0 527 -3T432 -6Q431 -6 431 25V56L420 45Q373 6 332 -1Q313 -6 281 -6Q208 -6 165 14T109 87L107 98L106 230Q106 358 104 366Q96 380 50 380H37V442H40",
        119855: "401 444Q413 441 495 441Q568 441 574 444H580V382H510L409 156Q348 18 339 6Q331 -4 320 -4Q318 -4 313 -4T303 -3H288Q273 -3 264 12T221 102Q206 135 197 156L96 382H26V444H34Q49 441 145 441Q252 441 270 444H279V382H231L284 264Q335 149 338 149Q338 150 389 264T442 381Q442 382 418 382H394V444H401",
        119856: "624 444Q636 441 722 441Q797 441 800 444H805V382H741L593 11Q592 10 590 8T586 4T584 2T581 0T579 -2T575 -3T571 -3T567 -4T561 -4T553 -4H542Q525 -4 518 6T490 70Q474 110 463 137L415 257L367 137Q357 111 341 72Q320 17 313 7T289 -4H277Q259 -4 253 -2T238 11L90 382H25V444H32Q47 441 140 441Q243 441 261 444H270V382H222L310 164L382 342L366 382H303V444H310Q322 441 407 441Q508 441 523 444H531V382H506Q481 382 481 380Q482 376 529 259T577 142L674 382H617V444H624",
        119857: "227 0Q212 3 121 3Q40 3 28 0H21V62H117L245 213L109 382H26V444H34Q49 441 143 441Q247 441 265 444H274V382H246L281 339Q315 297 316 297Q320 297 354 341L389 382H352V444H360Q375 441 466 441Q547 441 559 444H566V382H471L355 246L504 63L545 62H586V0H578Q563 3 469 3Q365 3 347 0H338V62H366Q366 63 326 112T285 163L198 63L217 62H235V0H227",
        119858: "84 -102Q84 -110 87 -119T102 -138T133 -149Q148 -148 162 -143T186 -131T206 -114T222 -95T234 -76T243 -59T249 -45T252 -37L269 0L96 382H26V444H34Q49 441 146 441Q252 441 270 444H279V382H255Q232 382 232 380L337 151L442 382H394V444H401Q413 441 495 441Q568 441 574 444H580V382H510L406 152Q298 -84 297 -87Q269 -139 225 -169T131 -200Q85 -200 54 -172T23 -100Q23 -64 44 -50T87 -35Q111 -35 130 -50T152 -92V-100H84V-102",
        119859: "48 262Q48 264 54 349T60 436V444H252Q289 444 336 444T394 445Q441 445 450 441T459 418Q459 406 458 404Q456 399 327 229T194 55H237Q260 56 268 56T297 58T325 65T348 77T370 98T384 128T395 170Q400 197 400 216Q400 217 431 217H462V211Q461 208 453 108T444 6V0H245Q46 0 43 2Q32 7 32 28V33Q32 41 40 52T84 112Q129 170 164 217L298 393H256Q189 392 165 380Q124 360 115 303Q110 280 110 256Q110 254 79 254H48V262",
        119860: "208 74Q208 50 254 46Q272 46 272 35Q272 34 270 22Q267 8 264 4T251 0Q249 0 239 0T205 1T141 2Q70 2 50 0H42Q35 7 35 11Q37 38 48 46H62Q132 49 164 96Q170 102 345 401T523 704Q530 716 547 716H555H572Q578 707 578 706L606 383Q634 60 636 57Q641 46 701 46Q726 46 726 36Q726 34 723 22Q720 7 718 4T704 0Q701 0 690 0T651 1T578 2Q484 2 455 0H443Q437 6 437 9T439 27Q443 40 445 43L449 46H469Q523 49 533 63L521 213H283L249 155Q208 86 208 74ZM516 260Q516 271 504 416T490 562L463 519Q447 492 400 412L310 260L413 259Q516 259 516 260",
        119861: "231 637Q204 637 199 638T194 649Q194 676 205 682Q206 683 335 683Q594 683 608 681Q671 671 713 636T756 544Q756 480 698 429T565 360L555 357Q619 348 660 311T702 219Q702 146 630 78T453 1Q446 0 242 0Q42 0 39 2Q35 5 35 10Q35 17 37 24Q42 43 47 45Q51 46 62 46H68Q95 46 128 49Q142 52 147 61Q150 65 219 339T288 628Q288 635 231 637ZM649 544Q649 574 634 600T585 634Q578 636 493 637Q473 637 451 637T416 636H403Q388 635 384 626Q382 622 352 506Q352 503 351 500L320 374H401Q482 374 494 376Q554 386 601 434T649 544ZM595 229Q595 273 572 302T512 336Q506 337 429 337Q311 337 310 336Q310 334 293 263T258 122L240 52Q240 48 252 48T333 46Q422 46 429 47Q491 54 543 105T595 229",
        119862: "50 252Q50 367 117 473T286 641T490 704Q580 704 633 653Q642 643 648 636T656 626L657 623Q660 623 684 649Q691 655 699 663T715 679T725 690L740 705H746Q760 705 760 698Q760 694 728 561Q692 422 692 421Q690 416 687 415T669 413H653Q647 419 647 422Q647 423 648 429T650 449T651 481Q651 552 619 605T510 659Q484 659 454 652T382 628T299 572T226 479Q194 422 175 346T156 222Q156 108 232 58Q280 24 350 24Q441 24 512 92T606 240Q610 253 612 255T628 257Q648 257 648 248Q648 243 647 239Q618 132 523 55T319 -22Q206 -22 128 53T50 252",
        119863: "287 628Q287 635 230 637Q207 637 200 638T193 647Q193 655 197 667T204 682Q206 683 403 683Q570 682 590 682T630 676Q702 659 752 597T803 431Q803 275 696 151T444 3L430 1L236 0H125H72Q48 0 41 2T33 11Q33 13 36 25Q40 41 44 43T67 46Q94 46 127 49Q141 52 146 61Q149 65 218 339T287 628ZM703 469Q703 507 692 537T666 584T629 613T590 629T555 636Q553 636 541 636T512 636T479 637H436Q392 637 386 627Q384 623 313 339T242 52Q242 48 253 48T330 47Q335 47 349 47T373 46Q499 46 581 128Q617 164 640 212T683 339T703 469",
        119864: "492 213Q472 213 472 226Q472 230 477 250T482 285Q482 316 461 323T364 330H312Q311 328 277 192T243 52Q243 48 254 48T334 46Q428 46 458 48T518 61Q567 77 599 117T670 248Q680 270 683 272Q690 274 698 274Q718 274 718 261Q613 7 608 2Q605 0 322 0H133Q31 0 31 11Q31 13 34 25Q38 41 42 43T65 46Q92 46 125 49Q139 52 144 61Q146 66 215 342T285 622Q285 629 281 629Q273 632 228 634H197Q191 640 191 642T193 659Q197 676 203 680H757Q764 676 764 669Q764 664 751 557T737 447Q735 440 717 440H705Q698 445 698 453L701 476Q704 500 704 528Q704 558 697 578T678 609T643 625T596 632T532 634H485Q397 633 392 631Q388 629 386 622Q385 619 355 499T324 377Q347 376 372 376H398Q464 376 489 391T534 472Q538 488 540 490T557 493Q562 493 565 493T570 492T572 491T574 487T577 483L544 351Q511 218 508 216Q505 213 492 213",
        119865: "48 1Q31 1 31 11Q31 13 34 25Q38 41 42 43T65 46Q92 46 125 49Q139 52 144 61Q146 66 215 342T285 622Q285 629 281 629Q273 632 228 634H197Q191 640 191 642T193 659Q197 676 203 680H742Q749 676 749 669Q749 664 736 557T722 447Q720 440 702 440H690Q683 445 683 453Q683 454 686 477T689 530Q689 560 682 579T663 610T626 626T575 633T503 634H480Q398 633 393 631Q388 629 386 623Q385 622 352 492L320 363H375Q378 363 398 363T426 364T448 367T472 374T489 386Q502 398 511 419T524 457T529 475Q532 480 548 480H560Q567 475 567 470Q567 467 536 339T502 207Q500 200 482 200H470Q463 206 463 212Q463 215 468 234T473 274Q473 303 453 310T364 317H309L277 190Q245 66 245 60Q245 46 334 46H359Q365 40 365 39T363 19Q359 6 353 0H336Q295 2 185 2Q120 2 86 2T48 1",
        119866: "50 252Q50 367 117 473T286 641T490 704Q580 704 633 653Q642 643 648 636T656 626L657 623Q660 623 684 649Q691 655 699 663T715 679T725 690L740 705H746Q760 705 760 698Q760 694 728 561Q692 422 692 421Q690 416 687 415T669 413H653Q647 419 647 422Q647 423 648 429T650 449T651 481Q651 552 619 605T510 659Q492 659 471 656T418 643T357 615T294 567T236 496T189 394T158 260Q156 242 156 221Q156 173 170 136T206 79T256 45T308 28T353 24Q407 24 452 47T514 106Q517 114 529 161T541 214Q541 222 528 224T468 227H431Q425 233 425 235T427 254Q431 267 437 273H454Q494 271 594 271Q634 271 659 271T695 272T707 272Q721 272 721 263Q721 261 719 249Q714 230 709 228Q706 227 694 227Q674 227 653 224Q646 221 643 215T629 164Q620 131 614 108Q589 6 586 3Q584 1 581 1Q571 1 553 21T530 52Q530 53 528 52T522 47Q448 -22 322 -22Q201 -22 126 55T50 252",
        119867: "228 637Q194 637 192 641Q191 643 191 649Q191 673 202 682Q204 683 219 683Q260 681 355 681Q389 681 418 681T463 682T483 682Q499 682 499 672Q499 670 497 658Q492 641 487 638H485Q483 638 480 638T473 638T464 637T455 637Q416 636 405 634T387 623Q384 619 355 500Q348 474 340 442T328 395L324 380Q324 378 469 378H614L615 381Q615 384 646 504Q674 619 674 627T617 637Q594 637 587 639T580 648Q580 650 582 660Q586 677 588 679T604 682Q609 682 646 681T740 680Q802 680 835 681T871 682Q888 682 888 672Q888 645 876 638H874Q872 638 869 638T862 638T853 637T844 637Q805 636 794 634T776 623Q773 618 704 340T634 58Q634 51 638 51Q646 48 692 46H723Q729 38 729 37T726 19Q722 6 716 0H701Q664 2 567 2Q533 2 504 2T458 2T437 1Q420 1 420 10Q420 15 423 24Q428 43 433 45Q437 46 448 46H454Q481 46 514 49Q520 50 522 50T528 55T534 64T540 82T547 110T558 153Q565 181 569 198Q602 330 602 331T457 332H312L279 197Q245 63 245 58Q245 51 253 49T303 46H334Q340 38 340 37T337 19Q333 6 327 0H312Q275 2 178 2Q144 2 115 2T69 2T48 1Q31 1 31 10Q31 12 34 24Q39 43 44 45Q48 46 59 46H65Q92 46 125 49Q139 52 144 61Q147 65 216 339T285 628Q285 635 228 637",
        119868: "43 1Q26 1 26 10Q26 12 29 24Q34 43 39 45Q42 46 54 46H60Q120 46 136 53Q137 53 138 54Q143 56 149 77T198 273Q210 318 216 344Q286 624 286 626Q284 630 284 631Q274 637 213 637H193Q184 643 189 662Q193 677 195 680T209 683H213Q285 681 359 681Q481 681 487 683H497Q504 676 504 672T501 655T494 639Q491 637 471 637Q440 637 407 634Q393 631 388 623Q381 609 337 432Q326 385 315 341Q245 65 245 59Q245 52 255 50T307 46H339Q345 38 345 37T342 19Q338 6 332 0H316Q279 2 179 2Q143 2 113 2T65 2T43 1",
        119869: "447 625Q447 637 354 637H329Q323 642 323 645T325 664Q329 677 335 683H352Q393 681 498 681Q541 681 568 681T605 682T619 682Q633 682 633 672Q633 670 630 658Q626 642 623 640T604 637Q552 637 545 623Q541 610 483 376Q420 128 419 127Q397 64 333 21T195 -22Q137 -22 97 8T57 88Q57 130 80 152T132 174Q177 174 182 130Q182 98 164 80T123 56Q115 54 115 53T122 44Q148 15 197 15Q235 15 271 47T324 130Q328 142 387 380T447 625",
        119870: "285 628Q285 635 228 637Q205 637 198 638T191 647Q191 649 193 661Q199 681 203 682Q205 683 214 683H219Q260 681 355 681Q389 681 418 681T463 682T483 682Q500 682 500 674Q500 669 497 660Q496 658 496 654T495 648T493 644T490 641T486 639T479 638T470 637T456 637Q416 636 405 634T387 623L306 305Q307 305 490 449T678 597Q692 611 692 620Q692 635 667 637Q651 637 651 648Q651 650 654 662T659 677Q662 682 676 682Q680 682 711 681T791 680Q814 680 839 681T869 682Q889 682 889 672Q889 650 881 642Q878 637 862 637Q787 632 726 586Q710 576 656 534T556 455L509 418L518 396Q527 374 546 329T581 244Q656 67 661 61Q663 59 666 57Q680 47 717 46H738Q744 38 744 37T741 19Q737 6 731 0H720Q680 3 625 3Q503 3 488 0H478Q472 6 472 9T474 27Q478 40 480 43T491 46H494Q544 46 544 71Q544 75 517 141T485 216L427 354L359 301L291 248L268 155Q245 63 245 58Q245 51 253 49T303 46H334Q340 37 340 35Q340 19 333 5Q328 0 317 0Q314 0 280 1T180 2Q118 2 85 2T49 1Q31 1 31 11Q31 13 34 25Q38 41 42 43T65 46Q92 46 125 49Q139 52 144 61Q147 65 216 339T285 628",
        119871: "228 637Q194 637 192 641Q191 643 191 649Q191 673 202 682Q204 683 217 683Q271 680 344 680Q485 680 506 683H518Q524 677 524 674T522 656Q517 641 513 637H475Q406 636 394 628Q387 624 380 600T313 336Q297 271 279 198T252 88L243 52Q243 48 252 48T311 46H328Q360 46 379 47T428 54T478 72T522 106T564 161Q580 191 594 228T611 270Q616 273 628 273H641Q647 264 647 262T627 203T583 83T557 9Q555 4 553 3T537 0T494 -1Q483 -1 418 -1T294 0H116Q32 0 32 10Q32 17 34 24Q39 43 44 45Q48 46 59 46H65Q92 46 125 49Q139 52 144 61Q147 65 216 339T285 628Q285 635 228 637",
        119872: "289 629Q289 635 232 637Q208 637 201 638T194 648Q194 649 196 659Q197 662 198 666T199 671T201 676T203 679T207 681T212 683T220 683T232 684Q238 684 262 684T307 683Q386 683 398 683T414 678Q415 674 451 396L487 117L510 154Q534 190 574 254T662 394Q837 673 839 675Q840 676 842 678T846 681L852 683H948Q965 683 988 683T1017 684Q1051 684 1051 673Q1051 668 1048 656T1045 643Q1041 637 1008 637Q968 636 957 634T939 623Q936 618 867 340T797 59Q797 55 798 54T805 50T822 48T855 46H886Q892 37 892 35Q892 19 885 5Q880 0 869 0Q864 0 828 1T736 2Q675 2 644 2T609 1Q592 1 592 11Q592 13 594 25Q598 41 602 43T625 46Q652 46 685 49Q699 52 704 61Q706 65 742 207T813 490T848 631L654 322Q458 10 453 5Q451 4 449 3Q444 0 433 0Q418 0 415 7Q413 11 374 317L335 624L267 354Q200 88 200 79Q206 46 272 46H282Q288 41 289 37T286 19Q282 3 278 1Q274 0 267 0Q265 0 255 0T221 1T157 2Q127 2 95 1T58 0Q43 0 39 2T35 11Q35 13 38 25T43 40Q45 46 65 46Q135 46 154 86Q158 92 223 354T289 629",
        119873: "234 637Q231 637 226 637Q201 637 196 638T191 649Q191 676 202 682Q204 683 299 683Q376 683 387 683T401 677Q612 181 616 168L670 381Q723 592 723 606Q723 633 659 637Q635 637 635 648Q635 650 637 660Q641 676 643 679T653 683Q656 683 684 682T767 680Q817 680 843 681T873 682Q888 682 888 672Q888 650 880 642Q878 637 858 637Q787 633 769 597L620 7Q618 0 599 0Q585 0 582 2Q579 5 453 305L326 604L261 344Q196 88 196 79Q201 46 268 46H278Q284 41 284 38T282 19Q278 6 272 0H259Q228 2 151 2Q123 2 100 2T63 2T46 1Q31 1 31 10Q31 14 34 26T39 40Q41 46 62 46Q130 49 150 85Q154 91 221 362L289 634Q287 635 234 637",
        119874: "740 435Q740 320 676 213T511 42T304 -22Q207 -22 138 35T51 201Q50 209 50 244Q50 346 98 438T227 601Q351 704 476 704Q514 704 524 703Q621 689 680 617T740 435ZM637 476Q637 565 591 615T476 665Q396 665 322 605Q242 542 200 428T157 216Q157 126 200 73T314 19Q404 19 485 98T608 313Q637 408 637 476",
        119875: "287 628Q287 635 230 637Q206 637 199 638T192 648Q192 649 194 659Q200 679 203 681T397 683Q587 682 600 680Q664 669 707 631T751 530Q751 453 685 389Q616 321 507 303Q500 302 402 301H307L277 182Q247 66 247 59Q247 55 248 54T255 50T272 48T305 46H336Q342 37 342 35Q342 19 335 5Q330 0 319 0Q316 0 282 1T182 2Q120 2 87 2T51 1Q33 1 33 11Q33 13 36 25Q40 41 44 43T67 46Q94 46 127 49Q141 52 146 61Q149 65 218 339T287 628ZM645 554Q645 567 643 575T634 597T609 619T560 635Q553 636 480 637Q463 637 445 637T416 636T404 636Q391 635 386 627Q384 621 367 550T332 412T314 344Q314 342 395 342H407H430Q542 342 590 392Q617 419 631 471T645 554",
        119876: "399 -80Q399 -47 400 -30T402 -11V-7L387 -11Q341 -22 303 -22Q208 -22 138 35T51 201Q50 209 50 244Q50 346 98 438T227 601Q351 704 476 704Q514 704 524 703Q621 689 680 617T740 435Q740 255 592 107Q529 47 461 16L444 8V3Q444 2 449 -24T470 -66T516 -82Q551 -82 583 -60T625 -3Q631 11 638 11Q647 11 649 2Q649 -6 639 -34T611 -100T557 -165T481 -194Q399 -194 399 -87V-80ZM636 468Q636 523 621 564T580 625T530 655T477 665Q429 665 379 640Q277 591 215 464T153 216Q153 110 207 59Q231 38 236 38V46Q236 86 269 120T347 155Q372 155 390 144T417 114T429 82T435 55L448 64Q512 108 557 185T619 334T636 468ZM314 18Q362 18 404 39L403 49Q399 104 366 115Q354 117 347 117Q344 117 341 117T337 118Q317 118 296 98T274 52Q274 18 314 18",
        119877: "230 637Q203 637 198 638T193 649Q193 676 204 682Q206 683 378 683Q550 682 564 680Q620 672 658 652T712 606T733 563T739 529Q739 484 710 445T643 385T576 351T538 338L545 333Q612 295 612 223Q612 212 607 162T602 80V71Q602 53 603 43T614 25T640 16Q668 16 686 38T712 85Q717 99 720 102T735 105Q755 105 755 93Q755 75 731 36Q693 -21 641 -21H632Q571 -21 531 4T487 82Q487 109 502 166T517 239Q517 290 474 313Q459 320 449 321T378 323H309L277 193Q244 61 244 59Q244 55 245 54T252 50T269 48T302 46H333Q339 38 339 37T336 19Q332 6 326 0H311Q275 2 180 2Q146 2 117 2T71 2T50 1Q33 1 33 10Q33 12 36 24Q41 43 46 45Q50 46 61 46H67Q94 46 127 49Q141 52 146 61Q149 65 218 339T287 628Q287 635 230 637ZM630 554Q630 586 609 608T523 636Q521 636 500 636T462 637H440Q393 637 386 627Q385 624 352 494T319 361Q319 360 388 360Q466 361 492 367Q556 377 592 426Q608 449 619 486T630 554",
        119878: "308 24Q367 24 416 76T466 197Q466 260 414 284Q308 311 278 321T236 341Q176 383 176 462Q176 523 208 573T273 648Q302 673 343 688T407 704H418H425Q521 704 564 640Q565 640 577 653T603 682T623 704Q624 704 627 704T632 705Q645 705 645 698T617 577T585 459T569 456Q549 456 549 465Q549 471 550 475Q550 478 551 494T553 520Q553 554 544 579T526 616T501 641Q465 662 419 662Q362 662 313 616T263 510Q263 480 278 458T319 427Q323 425 389 408T456 390Q490 379 522 342T554 242Q554 216 546 186Q541 164 528 137T492 78T426 18T332 -20Q320 -22 298 -22Q199 -22 144 33L134 44L106 13Q83 -14 78 -18T65 -22Q52 -22 52 -14Q52 -11 110 221Q112 227 130 227H143Q149 221 149 216Q149 214 148 207T144 186T142 153Q144 114 160 87T203 47T255 29T308 24",
        119879: "40 437Q21 437 21 445Q21 450 37 501T71 602L88 651Q93 669 101 677H569H659Q691 677 697 676T704 667Q704 661 687 553T668 444Q668 437 649 437Q640 437 637 437T631 442L629 445Q629 451 635 490T641 551Q641 586 628 604T573 629Q568 630 515 631Q469 631 457 630T439 622Q438 621 368 343T298 60Q298 48 386 46Q418 46 427 45T436 36Q436 31 433 22Q429 4 424 1L422 0Q419 0 415 0Q410 0 363 1T228 2Q99 2 64 0H49Q43 6 43 9T45 27Q49 40 55 46H83H94Q174 46 189 55Q190 56 191 56Q196 59 201 76T241 233Q258 301 269 344Q339 619 339 625Q339 630 310 630H279Q212 630 191 624Q146 614 121 583T67 467Q60 445 57 441T43 437H40",
        119880: "107 637Q73 637 71 641Q70 643 70 649Q70 673 81 682Q83 683 98 683Q139 681 234 681Q268 681 297 681T342 682T362 682Q378 682 378 672Q378 670 376 658Q371 641 366 638H364Q362 638 359 638T352 638T343 637T334 637Q295 636 284 634T266 623Q265 621 238 518T184 302T154 169Q152 155 152 140Q152 86 183 55T269 24Q336 24 403 69T501 205L552 406Q599 598 599 606Q599 633 535 637Q511 637 511 648Q511 650 513 660Q517 676 519 679T529 683Q532 683 561 682T645 680Q696 680 723 681T752 682Q767 682 767 672Q767 650 759 642Q756 637 737 637Q666 633 648 597Q646 592 598 404Q557 235 548 205Q515 105 433 42T263 -22Q171 -22 116 34T60 167V183Q60 201 115 421Q164 622 164 628Q164 635 107 637",
        119881: "52 648Q52 670 65 683H76Q118 680 181 680Q299 680 320 683H330Q336 677 336 674T334 656Q329 641 325 637H304Q282 635 274 635Q245 630 242 620Q242 618 271 369T301 118L374 235Q447 352 520 471T595 594Q599 601 599 609Q599 633 555 637Q537 637 537 648Q537 649 539 661Q542 675 545 679T558 683Q560 683 570 683T604 682T668 681Q737 681 755 683H762Q769 676 769 672Q769 655 760 640Q757 637 743 637Q730 636 719 635T698 630T682 623T670 615T660 608T652 599T645 592L452 282Q272 -9 266 -16Q263 -18 259 -21L241 -22H234Q216 -22 216 -15Q213 -9 177 305Q139 623 138 626Q133 637 76 637H59Q52 642 52 648",
        119882: "436 683Q450 683 486 682T553 680Q604 680 638 681T677 682Q695 682 695 674Q695 670 692 659Q687 641 683 639T661 637Q636 636 621 632T600 624T597 615Q597 603 613 377T629 138L631 141Q633 144 637 151T649 170T666 200T690 241T720 295T759 362Q863 546 877 572T892 604Q892 619 873 628T831 637Q817 637 817 647Q817 650 819 660Q823 676 825 679T839 682Q842 682 856 682T895 682T949 681Q1015 681 1034 683Q1048 683 1048 672Q1048 666 1045 655T1038 640T1028 637Q1006 637 988 631T958 617T939 600T927 584L923 578L754 282Q586 -14 585 -15Q579 -22 561 -22Q546 -22 542 -17Q539 -14 523 229T506 480L494 462Q472 425 366 239Q222 -13 220 -15T215 -19Q210 -22 197 -22Q178 -22 176 -15Q176 -12 154 304T131 622Q129 631 121 633T82 637H58Q51 644 51 648Q52 671 64 683H76Q118 680 176 680Q301 680 313 683H323Q329 677 329 674T327 656Q322 641 318 637H297Q236 634 232 620Q262 160 266 136L501 550L499 587Q496 629 489 632Q483 636 447 637Q428 637 422 639T416 648Q416 650 418 660Q419 664 420 669T421 676T424 680T428 682T436 683",
        119883: "42 0H40Q26 0 26 11Q26 15 29 27Q33 41 36 43T55 46Q141 49 190 98Q200 108 306 224T411 342Q302 620 297 625Q288 636 234 637H206Q200 643 200 645T202 664Q206 677 212 683H226Q260 681 347 681Q380 681 408 681T453 682T473 682Q490 682 490 671Q490 670 488 658Q484 643 481 640T465 637Q434 634 411 620L488 426L541 485Q646 598 646 610Q646 628 622 635Q617 635 609 637Q594 637 594 648Q594 650 596 664Q600 677 606 683H618Q619 683 643 683T697 681T738 680Q828 680 837 683H845Q852 676 852 672Q850 647 840 637H824Q790 636 763 628T722 611T698 593L687 584Q687 585 592 480L505 384Q505 383 536 304T601 142T638 56Q648 47 699 46Q734 46 734 37Q734 35 732 23Q728 7 725 4T711 1Q708 1 678 1T589 2Q528 2 496 2T461 1Q444 1 444 10Q444 11 446 25Q448 35 450 39T455 44T464 46T480 47T506 54Q523 62 523 64Q522 64 476 181L429 299Q241 95 236 84Q232 76 232 72Q232 53 261 47Q262 47 267 47T273 46Q276 46 277 46T280 45T283 42T284 35Q284 26 282 19Q279 6 276 4T261 1Q258 1 243 1T201 2T142 2Q64 2 42 0",
        119884: "66 637Q54 637 49 637T39 638T32 641T30 647T33 664T42 682Q44 683 56 683Q104 680 165 680Q288 680 306 683H316Q322 677 322 674T320 656Q316 643 310 637H298Q242 637 242 624Q242 619 292 477T343 333L346 336Q350 340 358 349T379 373T411 410T454 461Q546 568 561 587T577 618Q577 634 545 637Q528 637 528 647Q528 649 530 661Q533 676 535 679T549 683Q551 683 578 682T657 680Q684 680 713 681T746 682Q763 682 763 673Q763 669 760 657T755 643Q753 637 734 637Q662 632 617 587Q608 578 477 424L348 273L322 169Q295 62 295 57Q295 46 363 46Q379 46 384 45T390 35Q390 33 388 23Q384 6 382 4T366 1Q361 1 324 1T232 2Q170 2 138 2T102 1Q84 1 84 9Q84 14 87 24Q88 27 89 30T90 35T91 39T93 42T96 44T101 45T107 45T116 46T129 46Q168 47 180 50T198 63Q201 68 227 171L252 274L129 623Q128 624 127 625T125 627T122 629T118 631T113 633T105 634T96 635T83 636T66 637",
        119885: "58 8Q58 23 64 35Q64 36 329 334T596 635L586 637Q575 637 512 637H500H476Q442 637 420 635T365 624T311 598T266 548T228 469Q227 466 226 463T224 458T223 453T222 450L221 448Q218 443 202 443Q185 443 182 453L214 561Q228 606 241 651Q249 679 253 681Q256 683 487 683H718Q723 678 723 675Q723 673 717 649Q189 54 188 52L185 49H274Q369 50 377 51Q452 60 500 100T579 247Q587 272 590 277T603 282H607Q628 282 628 271Q547 5 541 2Q538 0 300 0H124Q58 0 58 8",
        119886: "33 157Q33 258 109 349T280 441Q331 441 370 392Q386 422 416 422Q429 422 439 414T449 394Q449 381 412 234T374 68Q374 43 381 35T402 26Q411 27 422 35Q443 55 463 131Q469 151 473 152Q475 153 483 153H487Q506 153 506 144Q506 138 501 117T481 63T449 13Q436 0 417 -8Q409 -10 393 -10Q359 -10 336 5T306 36L300 51Q299 52 296 50Q294 48 292 46Q233 -10 172 -10Q117 -10 75 30T33 157ZM351 328Q351 334 346 350T323 385T277 405Q242 405 210 374T160 293Q131 214 119 129Q119 126 119 118T118 106Q118 61 136 44T179 26Q217 26 254 59T298 110Q300 114 325 217T351 328",
        119887: "73 647Q73 657 77 670T89 683Q90 683 161 688T234 694Q246 694 246 685T212 542Q204 508 195 472T180 418L176 399Q176 396 182 402Q231 442 283 442Q345 442 383 396T422 280Q422 169 343 79T173 -11Q123 -11 82 27T40 150V159Q40 180 48 217T97 414Q147 611 147 623T109 637Q104 637 101 637H96Q86 637 83 637T76 640T73 647ZM336 325V331Q336 405 275 405Q258 405 240 397T207 376T181 352T163 330L157 322L136 236Q114 150 114 114Q114 66 138 42Q154 26 178 26Q211 26 245 58Q270 81 285 114T318 219Q336 291 336 325",
        119888: "34 159Q34 268 120 355T306 442Q362 442 394 418T427 355Q427 326 408 306T360 285Q341 285 330 295T319 325T330 359T352 380T366 386H367Q367 388 361 392T340 400T306 404Q276 404 249 390Q228 381 206 359Q162 315 142 235T121 119Q121 73 147 50Q169 26 205 26H209Q321 26 394 111Q403 121 406 121Q410 121 419 112T429 98T420 83T391 55T346 25T282 0T202 -11Q127 -11 81 37T34 159",
        119889: "366 683Q367 683 438 688T511 694Q523 694 523 686Q523 679 450 384T375 83T374 68Q374 26 402 26Q411 27 422 35Q443 55 463 131Q469 151 473 152Q475 153 483 153H487H491Q506 153 506 145Q506 140 503 129Q490 79 473 48T445 8T417 -8Q409 -10 393 -10Q359 -10 336 5T306 36L300 51Q299 52 296 50Q294 48 292 46Q233 -10 172 -10Q117 -10 75 30T33 157Q33 205 53 255T101 341Q148 398 195 420T280 442Q336 442 364 400Q369 394 369 396Q370 400 396 505T424 616Q424 629 417 632T378 637H357Q351 643 351 645T353 664Q358 683 366 683ZM352 326Q329 405 277 405Q242 405 210 374T160 293Q131 214 119 129Q119 126 119 118T118 106Q118 61 136 44T179 26Q233 26 290 98L298 109L352 326",
        119890: "39 168Q39 225 58 272T107 350T174 402T244 433T307 442H310Q355 442 388 420T421 355Q421 265 310 237Q261 224 176 223Q139 223 138 221Q138 219 132 186T125 128Q125 81 146 54T209 26T302 45T394 111Q403 121 406 121Q410 121 419 112T429 98T420 82T390 55T344 24T281 -1T205 -11Q126 -11 83 42T39 168ZM373 353Q367 405 305 405Q272 405 244 391T199 357T170 316T154 280T149 261Q149 260 169 260Q282 260 327 284T373 353",
        119891: "118 -162Q120 -162 124 -164T135 -167T147 -168Q160 -168 171 -155T187 -126Q197 -99 221 27T267 267T289 382V385H242Q195 385 192 387Q188 390 188 397L195 425Q197 430 203 430T250 431Q298 431 298 432Q298 434 307 482T319 540Q356 705 465 705Q502 703 526 683T550 630Q550 594 529 578T487 561Q443 561 443 603Q443 622 454 636T478 657L487 662Q471 668 457 668Q445 668 434 658T419 630Q412 601 403 552T387 469T380 433Q380 431 435 431Q480 431 487 430T498 424Q499 420 496 407T491 391Q489 386 482 386T428 385H372L349 263Q301 15 282 -47Q255 -132 212 -173Q175 -205 139 -205Q107 -205 81 -186T55 -132Q55 -95 76 -78T118 -61Q162 -61 162 -103Q162 -122 151 -136T127 -157L118 -162",
        119892: "311 43Q296 30 267 15T206 0Q143 0 105 45T66 160Q66 265 143 353T314 442Q361 442 401 394L404 398Q406 401 409 404T418 412T431 419T447 422Q461 422 470 413T480 394Q480 379 423 152T363 -80Q345 -134 286 -169T151 -205Q10 -205 10 -137Q10 -111 28 -91T74 -71Q89 -71 102 -80T116 -111Q116 -121 114 -130T107 -144T99 -154T92 -162L90 -164H91Q101 -167 151 -167Q189 -167 211 -155Q234 -144 254 -122T282 -75Q288 -56 298 -13Q311 35 311 43ZM384 328L380 339Q377 350 375 354T369 368T359 382T346 393T328 402T306 405Q262 405 221 352Q191 313 171 233T151 117Q151 38 213 38Q269 38 323 108L331 118L384 328",
        119894: "184 600Q184 624 203 642T247 661Q265 661 277 649T290 619Q290 596 270 577T226 557Q211 557 198 567T184 600ZM21 287Q21 295 30 318T54 369T98 420T158 442Q197 442 223 419T250 357Q250 340 236 301T196 196T154 83Q149 61 149 51Q149 26 166 26Q175 26 185 29T208 43T235 78T260 137Q263 149 265 151T282 153Q302 153 302 143Q302 135 293 112T268 61T223 11T161 -11Q129 -11 102 10T74 74Q74 91 79 106T122 220Q160 321 166 341T173 380Q173 404 156 404H154Q124 404 99 371T61 287Q60 286 59 284T58 281T56 279T53 278T49 278T41 278H27Q21 284 21 287",
        119895: "297 596Q297 627 318 644T361 661Q378 661 389 651T403 623Q403 595 384 576T340 557Q322 557 310 567T297 596ZM288 376Q288 405 262 405Q240 405 220 393T185 362T161 325T144 293L137 279Q135 278 121 278H107Q101 284 101 286T105 299Q126 348 164 391T252 441Q253 441 260 441T272 442Q296 441 316 432Q341 418 354 401T367 348V332L318 133Q267 -67 264 -75Q246 -125 194 -164T75 -204Q25 -204 7 -183T-12 -137Q-12 -110 7 -91T53 -71Q70 -71 82 -81T95 -112Q95 -148 63 -167Q69 -168 77 -168Q111 -168 139 -140T182 -74L193 -32Q204 11 219 72T251 197T278 308T289 365Q289 372 288 376",
        119896: "121 647Q121 657 125 670T137 683Q138 683 209 688T282 694Q294 694 294 686Q294 679 244 477Q194 279 194 272Q213 282 223 291Q247 309 292 354T362 415Q402 442 438 442Q468 442 485 423T503 369Q503 344 496 327T477 302T456 291T438 288Q418 288 406 299T394 328Q394 353 410 369T442 390L458 393Q446 405 434 405H430Q398 402 367 380T294 316T228 255Q230 254 243 252T267 246T293 238T320 224T342 206T359 180T365 147Q365 130 360 106T354 66Q354 26 381 26Q429 26 459 145Q461 153 479 153H483Q499 153 499 144Q499 139 496 130Q455 -11 378 -11Q333 -11 305 15T277 90Q277 108 280 121T283 145Q283 167 269 183T234 206T200 217T182 220H180Q168 178 159 139T145 81T136 44T129 20T122 7T111 -2Q98 -11 83 -11Q66 -11 57 -1T48 16Q48 26 85 176T158 471L195 616Q196 629 188 632T149 637H144Q134 637 131 637T124 640T121 647",
        119897: "117 59Q117 26 142 26Q179 26 205 131Q211 151 215 152Q217 153 225 153H229Q238 153 241 153T246 151T248 144Q247 138 245 128T234 90T214 43T183 6T137 -11Q101 -11 70 11T38 85Q38 97 39 102L104 360Q167 615 167 623Q167 626 166 628T162 632T157 634T149 635T141 636T132 637T122 637Q112 637 109 637T101 638T95 641T94 647Q94 649 96 661Q101 680 107 682T179 688Q194 689 213 690T243 693T254 694Q266 694 266 686Q266 675 193 386T118 83Q118 81 118 75T117 65V59",
        119898: "21 287Q22 293 24 303T36 341T56 388T88 425T132 442T175 435T205 417T221 395T229 376L231 369Q231 367 232 367L243 378Q303 442 384 442Q401 442 415 440T441 433T460 423T475 411T485 398T493 385T497 373T500 364T502 357L510 367Q573 442 659 442Q713 442 746 415T780 336Q780 285 742 178T704 50Q705 36 709 31T724 26Q752 26 776 56T815 138Q818 149 821 151T837 153Q857 153 857 145Q857 144 853 130Q845 101 831 73T785 17T716 -10Q669 -10 648 17T627 73Q627 92 663 193T700 345Q700 404 656 404H651Q565 404 506 303L499 291L466 157Q433 26 428 16Q415 -11 385 -11Q372 -11 364 -4T353 8T350 18Q350 29 384 161L420 307Q423 322 423 345Q423 404 379 404H374Q288 404 229 303L222 291L189 157Q156 26 151 16Q138 -11 108 -11Q95 -11 87 -5T76 7T74 17Q74 30 112 181Q151 335 151 342Q154 357 154 369Q154 405 129 405Q107 405 92 377T69 316T57 280Q55 278 41 278H27Q21 284 21 287",
        119899: "21 287Q22 293 24 303T36 341T56 388T89 425T135 442Q171 442 195 424T225 390T231 369Q231 367 232 367L243 378Q304 442 382 442Q436 442 469 415T503 336T465 179T427 52Q427 26 444 26Q450 26 453 27Q482 32 505 65T540 145Q542 153 560 153Q580 153 580 145Q580 144 576 130Q568 101 554 73T508 17T439 -10Q392 -10 371 17T350 73Q350 92 386 193T423 345Q423 404 379 404H374Q288 404 229 303L222 291L189 157Q156 26 151 16Q138 -11 108 -11Q95 -11 87 -5T76 7T74 17Q74 30 112 180T152 343Q153 348 153 366Q153 405 129 405Q91 405 66 305Q60 285 60 284Q58 278 41 278H27Q21 284 21 287",
        119900: "201 -11Q126 -11 80 38T34 156Q34 221 64 279T146 380Q222 441 301 441Q333 441 341 440Q354 437 367 433T402 417T438 387T464 338T476 268Q476 161 390 75T201 -11ZM121 120Q121 70 147 48T206 26Q250 26 289 58T351 142Q360 163 374 216T388 308Q388 352 370 375Q346 405 306 405Q243 405 195 347Q158 303 140 230T121 120",
        119901: "23 287Q24 290 25 295T30 317T40 348T55 381T75 411T101 433T134 442Q209 442 230 378L240 387Q302 442 358 442Q423 442 460 395T497 281Q497 173 421 82T249 -10Q227 -10 210 -4Q199 1 187 11T168 28L161 36Q160 35 139 -51T118 -138Q118 -144 126 -145T163 -148H188Q194 -155 194 -157T191 -175Q188 -187 185 -190T172 -194Q170 -194 161 -194T127 -193T65 -192Q-5 -192 -24 -194H-32Q-39 -187 -39 -183Q-37 -156 -26 -148H-6Q28 -147 33 -136Q36 -130 94 103T155 350Q156 355 156 364Q156 405 131 405Q109 405 94 377T71 316T59 280Q57 278 43 278H29Q23 284 23 287ZM178 102Q200 26 252 26Q282 26 310 49T356 107Q374 141 392 215T411 325V331Q411 405 350 405Q339 405 328 402T306 393T286 380T269 365T254 350T243 336T235 326L232 322Q232 321 229 308T218 264T204 212Q178 106 178 102",
        119902: "33 157Q33 258 109 349T280 441Q340 441 372 389Q373 390 377 395T388 406T404 418Q438 442 450 442Q454 442 457 439T460 434Q460 425 391 149Q320 -135 320 -139Q320 -147 365 -148H390Q396 -156 396 -157T393 -175Q389 -188 383 -194H370Q339 -192 262 -192Q234 -192 211 -192T174 -192T157 -193Q143 -193 143 -185Q143 -182 145 -170Q149 -154 152 -151T172 -148Q220 -148 230 -141Q238 -136 258 -53T279 32Q279 33 272 29Q224 -10 172 -10Q117 -10 75 30T33 157ZM352 326Q329 405 277 405Q242 405 210 374T160 293Q131 214 119 129Q119 126 119 118T118 106Q118 61 136 44T179 26Q233 26 290 98L298 109L352 326",
        119903: "21 287Q22 290 23 295T28 317T38 348T53 381T73 411T99 433T132 442Q161 442 183 430T214 408T225 388Q227 382 228 382T236 389Q284 441 347 441H350Q398 441 422 400Q430 381 430 363Q430 333 417 315T391 292T366 288Q346 288 334 299T322 328Q322 376 378 392Q356 405 342 405Q286 405 239 331Q229 315 224 298T190 165Q156 25 151 16Q138 -11 108 -11Q95 -11 87 -5T76 7T74 17Q74 30 114 189T154 366Q154 405 128 405Q107 405 92 377T68 316T57 280Q55 278 41 278H27Q21 284 21 287",
        119904: "131 289Q131 321 147 354T203 415T300 442Q362 442 390 415T419 355Q419 323 402 308T364 292Q351 292 340 300T328 326Q328 342 337 354T354 372T367 378Q368 378 368 379Q368 382 361 388T336 399T297 405Q249 405 227 379T204 326Q204 301 223 291T278 274T330 259Q396 230 396 163Q396 135 385 107T352 51T289 7T195 -10Q118 -10 86 19T53 87Q53 126 74 143T118 160Q133 160 146 151T160 120Q160 94 142 76T111 58Q109 57 108 57T107 55Q108 52 115 47T146 34T201 27Q237 27 263 38T301 66T318 97T323 122Q323 150 302 164T254 181T195 196T148 231Q131 256 131 289",
        119905: "26 385Q19 392 19 395Q19 399 22 411T27 425Q29 430 36 430T87 431H140L159 511Q162 522 166 540T173 566T179 586T187 603T197 615T211 624T229 626Q247 625 254 615T261 596Q261 589 252 549T232 470L222 433Q222 431 272 431H323Q330 424 330 420Q330 398 317 385H210L174 240Q135 80 135 68Q135 26 162 26Q197 26 230 60T283 144Q285 150 288 151T303 153H307Q322 153 322 145Q322 142 319 133Q314 117 301 95T267 48T216 6T155 -11Q125 -11 98 4T59 56Q57 64 57 83V101L92 241Q127 382 128 383Q128 385 77 385H26",
        119906: "21 287Q21 295 30 318T55 370T99 420T158 442Q204 442 227 417T250 358Q250 340 216 246T182 105Q182 62 196 45T238 27T291 44T328 78L339 95Q341 99 377 247Q407 367 413 387T427 416Q444 431 463 431Q480 431 488 421T496 402L420 84Q419 79 419 68Q419 43 426 35T447 26Q469 29 482 57T512 145Q514 153 532 153Q551 153 551 144Q550 139 549 130T540 98T523 55T498 17T462 -8Q454 -10 438 -10Q372 -10 347 46Q345 45 336 36T318 21T296 6T267 -6T233 -11Q189 -11 155 7Q103 38 103 113Q103 170 138 262T173 379Q173 380 173 381Q173 390 173 393T169 400T158 404H154Q131 404 112 385T82 344T65 302T57 280Q55 278 41 278H27Q21 284 21 287",
        119907: "173 380Q173 405 154 405Q130 405 104 376T61 287Q60 286 59 284T58 281T56 279T53 278T49 278T41 278H27Q21 284 21 287Q21 294 29 316T53 368T97 419T160 441Q202 441 225 417T249 361Q249 344 246 335Q246 329 231 291T200 202T182 113Q182 86 187 69Q200 26 250 26Q287 26 319 60T369 139T398 222T409 277Q409 300 401 317T383 343T365 361T357 383Q357 405 376 424T417 443Q436 443 451 425T467 367Q467 340 455 284T418 159T347 40T241 -11Q177 -11 139 22Q102 54 102 117Q102 148 110 181T151 298Q173 362 173 380",
        119908: "580 385Q580 406 599 424T641 443Q659 443 674 425T690 368Q690 339 671 253Q656 197 644 161T609 80T554 12T482 -11Q438 -11 404 5T355 48Q354 47 352 44Q311 -11 252 -11Q226 -11 202 -5T155 14T118 53T104 116Q104 170 138 262T173 379Q173 380 173 381Q173 390 173 393T169 400T158 404H154Q131 404 112 385T82 344T65 302T57 280Q55 278 41 278H27Q21 284 21 287Q21 293 29 315T52 366T96 418T161 441Q204 441 227 416T250 358Q250 340 217 250T184 111Q184 65 205 46T258 26Q301 26 334 87L339 96V119Q339 122 339 128T340 136T341 143T342 152T345 165T348 182T354 206T362 238T373 281Q402 395 406 404Q419 431 449 431Q468 431 475 421T483 402Q483 389 454 274T422 142Q420 131 420 107V100Q420 85 423 71T442 42T487 26Q558 26 600 148Q609 171 620 213T632 273Q632 306 619 325T593 357T580 385",
        119909: "52 289Q59 331 106 386T222 442Q257 442 286 424T329 379Q371 442 430 442Q467 442 494 420T522 361Q522 332 508 314T481 292T458 288Q439 288 427 299T415 328Q415 374 465 391Q454 404 425 404Q412 404 406 402Q368 386 350 336Q290 115 290 78Q290 50 306 38T341 26Q378 26 414 59T463 140Q466 150 469 151T485 153H489Q504 153 504 145Q504 144 502 134Q486 77 440 33T333 -11Q263 -11 227 52Q186 -10 133 -10H127Q78 -10 57 16T35 71Q35 103 54 123T99 143Q142 143 142 101Q142 81 130 66T107 46T94 41L91 40Q91 39 97 36T113 29T132 26Q168 26 194 71Q203 87 217 139T245 247T261 313Q266 340 266 352Q266 380 251 392T217 404Q177 404 142 372T93 290Q91 281 88 280T72 278H58Q52 284 52 289",
        119910: "21 287Q21 301 36 335T84 406T158 442Q199 442 224 419T250 355Q248 336 247 334Q247 331 231 288T198 191T182 105Q182 62 196 45T238 27Q261 27 281 38T312 61T339 94Q339 95 344 114T358 173T377 247Q415 397 419 404Q432 431 462 431Q475 431 483 424T494 412T496 403Q496 390 447 193T391 -23Q363 -106 294 -155T156 -205Q111 -205 77 -183T43 -117Q43 -95 50 -80T69 -58T89 -48T106 -45Q150 -45 150 -87Q150 -107 138 -122T115 -142T102 -147L99 -148Q101 -153 118 -160T152 -167H160Q177 -167 186 -165Q219 -156 247 -127T290 -65T313 -9T321 21L315 17Q309 13 296 6T270 -6Q250 -11 231 -11Q185 -11 150 11T104 82Q103 89 103 113Q103 170 138 262T173 379Q173 380 173 381Q173 390 173 393T169 400T158 404H154Q131 404 112 385T82 344T65 302T57 280Q55 278 41 278H27Q21 284 21 287",
        119911: "347 338Q337 338 294 349T231 360Q211 360 197 356T174 346T162 335T155 324L153 320Q150 317 138 317Q117 317 117 325Q117 330 120 339Q133 378 163 406T229 440Q241 442 246 442Q271 442 291 425T329 392T367 375Q389 375 411 408T434 441Q435 442 449 442H462Q468 436 468 434Q468 430 463 420T449 399T432 377T418 358L411 349Q368 298 275 214T160 106L148 94L163 93Q185 93 227 82T290 71Q328 71 360 90T402 140Q406 149 409 151T424 153Q443 153 443 143Q443 138 442 134Q425 72 376 31T278 -11Q252 -11 232 6T193 40T155 57Q111 57 76 -3Q70 -11 59 -11H54H41Q35 -5 35 -2Q35 13 93 84Q132 129 225 214T340 322Q352 338 347 338",
        119912: "65 0Q45 0 45 18Q48 52 61 60Q65 62 81 62Q155 62 165 74Q166 74 265 228T465 539T569 699Q576 707 583 709T611 711T637 710T649 700Q650 697 695 380L741 63L784 62H827Q839 50 839 45L835 29Q831 9 827 5T806 0Q803 0 790 0T743 1T657 2Q585 2 547 1T504 0Q481 0 481 17Q484 54 497 60Q501 62 541 62Q580 62 580 63Q580 68 573 121T564 179V181H308L271 124Q236 69 236 67T283 62H287Q316 62 316 46Q316 26 307 8Q302 3 295 0L262 1Q242 2 168 2Q119 2 93 1T65 0ZM537 372Q533 402 528 435T521 486T518 504V505Q517 505 433 375L348 244L451 243Q555 243 555 244L537 372",
        119913: "258 624H235Q214 624 209 626T199 639Q203 678 216 684Q220 686 449 686H477H586Q684 686 733 677T817 634Q853 598 853 547Q853 499 826 460T761 401T695 371T654 360H653L662 358Q670 357 683 354T712 344T744 327T774 303T795 269T804 224Q804 148 732 79T533 1Q524 0 288 0H58Q47 5 43 15Q47 54 60 60Q64 62 113 62H162L302 623Q302 624 258 624ZM703 550Q703 571 695 586T675 609T656 619T643 623L545 624H447L417 504Q386 384 386 383T470 382Q554 383 565 385Q632 397 667 447T703 550ZM651 240Q651 265 645 282T626 309T608 322T592 329Q587 330 479 331H373L340 198Q307 65 306 64Q306 62 406 62L507 63L519 65Q565 76 596 107T639 171T651 240",
        119914: "380 -17Q335 -17 293 -10T207 16T130 65T76 144T55 256Q55 306 70 361T122 476T211 582T345 663T525 702H545Q673 702 731 634L777 668Q783 672 789 677T800 685T808 691T814 695T818 698T822 700T825 702T828 703T830 703T833 703Q855 703 855 690Q855 686 823 558T789 426Q786 421 782 420T756 419Q734 420 729 421T724 432Q724 434 725 447T726 472Q726 552 678 604Q640 640 586 640H574Q533 640 494 632T409 604T324 541T260 437Q243 397 227 333T210 219Q210 152 237 117Q255 90 299 68T420 46H429Q506 46 580 100T678 234Q683 249 687 251T712 254H723Q743 254 743 240Q743 232 736 213T710 162T663 100T586 40T477 -5Q433 -17 380 -17",
        119915: "258 624H235Q214 624 209 626T199 639Q203 678 216 684Q220 686 437 686Q659 686 668 685Q727 680 772 662T842 621T883 568T905 517T913 475Q914 466 914 434Q914 373 892 307T828 179T712 69T548 7Q517 2 494 2T279 0H58Q47 5 43 15Q47 54 60 60Q64 62 113 62H162L302 623Q302 624 258 624ZM768 475Q768 515 753 544T718 588T666 611T613 622T563 624H538H532H452L382 344Q311 64 311 63T363 62H405Q490 62 545 76T656 142Q696 185 724 265T760 399T768 475",
        119916: "257 618H231Q198 618 198 636Q202 672 214 678L219 680H811Q817 677 820 673T824 666L825 664Q825 659 814 549T799 433Q793 424 771 424Q752 424 746 427T740 441Q740 445 742 466T744 505Q744 561 722 585T646 616Q639 617 545 618H456Q456 617 427 502T398 385Q398 384 435 384Q461 385 471 385T499 391T526 405T545 433T562 478Q566 494 571 497T595 501H604Q622 501 626 486Q626 482 593 349T557 213Q552 205 530 205Q499 205 499 219Q499 222 503 242T508 281Q508 308 491 314T429 322Q425 322 423 322H382L317 64Q317 62 390 62Q460 62 493 64T569 80T640 124Q665 149 686 187T719 253T733 283Q739 289 760 289Q791 289 791 274Q791 267 763 201T706 71L678 8Q676 4 667 0H58Q47 5 43 15Q47 54 60 60Q64 62 113 62H162L163 66Q163 67 231 341T301 616Q301 618 257 618",
        119917: "257 618H231Q198 618 198 636Q202 672 214 678L219 680H795Q801 677 804 673T808 666L809 664Q809 659 798 549T783 433Q777 424 755 424Q736 424 730 427T724 444Q724 448 725 468T727 507V524Q727 541 724 554T713 577T698 594T676 605T653 612T625 616T597 617T566 618T538 618H456L455 614Q455 611 424 491L394 371H429Q454 372 463 372T491 378T517 392T536 419T552 464Q556 481 561 484T586 488Q603 488 607 486Q616 482 616 473Q616 467 584 337T549 201Q542 192 521 192Q503 192 497 195T490 209Q490 212 492 224Q499 251 499 269Q499 288 489 296T465 306T417 308L379 309L348 188Q341 161 334 129T322 80L318 65L317 62H375H409Q430 62 438 59T447 45Q444 8 431 2L426 0L377 1Q347 2 231 2Q152 2 111 1T65 0Q48 0 43 15Q47 54 60 60Q64 62 113 62H162L163 66Q163 67 231 341T301 616Q301 618 257 618",
        119918: "379 -16Q233 -16 145 52T56 255Q56 310 73 368T127 483T216 586T347 663T518 702H540Q562 702 582 700T616 696T644 689T667 681T686 670T702 659T717 647T731 635L776 668Q782 672 788 677T799 685T807 691T813 695T817 698T821 700T824 702T827 703T829 703T832 703Q854 703 854 690Q854 686 822 558T788 426Q785 421 781 420T755 419Q734 420 729 422T723 432Q723 434 724 446T725 469Q725 531 702 571T642 628Q616 640 575 640Q468 640 390 593T272 464Q247 415 229 340T210 214Q210 166 228 132T277 79T343 54T419 46Q445 46 465 50T500 59T526 76T544 96T557 123T566 150T574 182T581 214H519Q511 214 498 214T479 213Q443 213 443 230Q443 250 452 268Q457 273 464 276L514 275Q546 274 657 274Q735 274 768 275T803 276Q826 276 826 258Q823 224 810 216Q806 214 771 214H736Q736 211 710 109T683 5Q678 0 671 0Q666 0 637 14T597 36Q593 38 590 40T585 44T582 44T576 40Q511 -16 379 -16",
        119919: "258 624H235Q214 624 209 626T199 639Q203 678 216 684Q220 686 239 686Q290 684 403 684Q475 684 512 685T553 686Q576 686 576 668Q572 632 560 626Q555 624 506 624H457L399 389Q399 388 547 388H695L753 623Q753 624 709 624H686Q665 624 660 626T650 639Q653 678 668 684Q672 686 681 686Q685 686 726 685T847 684Q902 684 937 684T986 685T1004 686Q1027 686 1027 668Q1023 632 1011 626Q1006 624 957 624H908L839 344Q768 64 768 63T812 62H839Q871 62 871 44Q867 6 854 2L850 0L808 1Q782 2 675 2Q600 2 560 1T516 0Q499 0 494 15Q498 54 511 60Q515 62 564 62H613L614 66L679 324Q679 326 531 326H383L382 322L317 64Q317 62 361 62H388Q420 62 420 44Q416 6 403 2L399 0L357 1Q331 2 224 2Q149 2 109 1T65 0Q48 0 43 15Q47 54 60 60Q64 62 113 62H162L302 623Q302 624 258 624",
        119920: "247 624Q242 624 233 624T220 623Q186 623 186 640Q186 647 190 664T202 684Q206 686 226 686Q277 684 393 684Q435 684 471 684T528 685T553 686Q573 686 573 670Q573 650 564 632Q556 624 537 624H501H449L380 344Q309 64 309 63T356 62Q361 62 370 62T384 63Q417 63 417 46Q417 26 408 8Q403 3 396 0L352 1Q325 2 216 2T82 1L45 0Q30 7 30 16Q33 51 46 60Q51 62 102 62H154L294 623Q294 624 247 624",
        119921: "205 131Q205 105 192 84T165 54L152 45Q152 44 160 42T182 37T213 35H216Q255 35 289 65Q314 90 329 129Q331 136 392 378T453 623Q453 624 393 624H332Q318 631 318 640Q318 647 322 664T334 684Q338 686 359 686Q413 684 533 684Q566 684 605 685T652 686Q677 686 685 683T694 669Q694 664 691 652Q686 631 681 628T647 624H602L542 380Q531 336 518 285T500 212T487 161T475 122T463 97T448 74T429 55Q351 -17 213 -17Q142 -17 99 7T43 70Q42 75 42 93Q42 143 73 168T139 194Q168 194 186 177T205 131",
        119922: "536 0Q522 6 522 18Q522 35 533 57Q539 62 557 62Q595 62 601 65L472 330L365 255L342 160Q318 65 317 64Q317 62 361 62H388Q420 62 420 44Q416 6 403 2L399 0L357 1Q331 2 224 2Q149 2 109 1T65 0Q48 0 43 15Q47 54 60 60Q64 62 113 62H162L302 623Q302 624 258 624H235Q214 624 209 626T199 639Q203 678 216 684Q220 686 239 686Q290 684 403 684Q475 684 512 685T553 686Q576 686 576 668Q572 632 560 626Q555 624 506 624H457L422 481Q386 339 386 337L785 621Q779 624 749 624Q726 624 726 641Q726 645 730 659Q734 675 736 679T747 686L786 685Q812 684 888 684Q908 684 934 685T968 686Q1003 686 1003 669Q1003 646 991 629Q985 624 967 624Q918 624 888 617Q884 617 874 613L865 609Q864 608 732 515T599 420Q599 418 686 242T775 65Q784 62 829 62Q847 62 850 61T860 54Q862 52 862 43Q862 10 845 1Q844 1 842 1T836 0T797 1T694 2Q599 2 573 1L536 0",
        119923: "258 624H235Q214 624 209 626T199 639Q203 678 216 684Q220 686 239 686Q290 684 409 684Q454 684 492 684T552 685T579 686Q603 686 603 668Q599 632 587 626Q583 624 520 624H457L388 344Q317 64 317 63T353 62H390Q418 62 440 64T493 78T548 110T598 169T643 261Q651 282 655 285T680 289Q696 289 700 288T709 279Q711 274 711 269Q710 265 663 138T613 8Q611 4 602 0H58Q47 5 43 15Q47 54 60 60Q64 62 113 62H162L302 623Q302 624 258 624",
        119924: "258 624H231Q214 624 208 626T199 639Q203 678 216 684Q220 686 347 686H473Q474 685 478 682T484 677Q487 673 535 413L584 153L608 187Q631 221 672 281T761 410Q935 663 943 671Q949 678 962 686H1082H1166Q1201 686 1210 683T1219 668Q1215 632 1203 626Q1199 624 1149 624H1100L1031 344Q960 64 960 63T1004 62H1031Q1063 62 1063 44Q1060 7 1046 2Q1042 0 1034 0Q1030 0 990 1T875 2Q804 2 767 1T725 0H723Q707 0 703 15Q707 54 720 60Q724 62 773 62H822Q961 618 961 619L754 318Q546 15 543 12Q531 0 510 0Q500 0 495 0T484 5T477 19Q477 20 421 315L367 604L299 335Q234 72 234 68Q234 62 302 62Q334 62 334 46Q332 8 317 2Q313 0 306 0Q301 0 267 1T181 2Q125 2 96 1T63 0Q48 0 43 15Q43 19 47 35Q52 55 57 58T94 62Q147 64 164 69L233 345Q302 619 302 622Q302 624 258 624",
        119925: "258 624H235Q214 624 209 626T199 639Q203 678 216 684Q220 686 344 686H434Q464 686 477 680Q480 677 607 454Q738 227 739 227Q742 227 789 418T836 618Q836 620 835 620L821 622Q811 622 779 624Q755 624 749 625T740 632Q737 635 737 644Q737 656 742 669T754 685Q755 685 757 685T763 686Q768 686 803 685T890 684Q925 684 951 684T990 685T1006 686Q1014 686 1016 684Q1027 679 1027 668Q1023 632 1011 626Q1007 624 978 624Q912 622 907 617Q907 616 831 314T753 8Q749 0 723 0H712Q699 0 692 7Q692 8 671 44T607 155T526 296L361 580L296 323Q234 74 234 68T302 62H307Q334 62 334 44Q330 6 317 2L313 0L280 1Q260 2 181 2Q125 2 96 1T63 0Q48 0 43 15Q43 19 47 35Q52 55 57 58T94 62Q147 64 164 69L233 345Q302 619 302 622Q302 624 258 624",
        119926: "53 245Q53 297 70 356T125 478T216 590T349 671T523 703Q656 703 735 637T815 445Q815 378 791 307Q727 104 527 17Q437 -17 344 -17Q289 -17 242 -5T150 35T79 116T53 245ZM664 489Q664 575 618 611T511 648Q463 648 416 627T334 570Q297 531 270 472T230 355T213 261T208 206Q208 177 215 151T237 98T284 56T358 40Q440 40 510 98T618 270Q664 400 664 489",
        119927: "162 62L302 623Q302 624 258 624H234Q214 624 209 626T200 638Q200 677 217 684Q220 686 439 686Q667 685 684 682Q686 681 693 680Q713 677 733 671T782 649T829 602T847 528Q847 450 784 382T604 293Q571 288 469 287H373L346 176Q340 151 333 122T321 78L317 64Q317 62 361 62H387Q420 62 420 44Q417 10 404 2L399 0L357 1Q331 2 224 2Q149 2 109 1T65 0Q43 0 43 17Q43 21 47 33Q52 54 57 58T89 62H113H162ZM692 558Q692 611 617 622Q610 623 529 624H452L381 343H458H492Q604 343 641 389Q662 414 677 471T692 558",
        119928: "53 245Q53 297 70 356T125 478T216 590T349 671T523 703Q656 703 735 637T815 445Q815 410 808 370T781 277T729 178T643 87T519 14L525 4Q540 -19 553 -25T592 -32Q632 -32 654 -24T680 -7T689 10T704 18Q713 18 717 12T722 0Q722 -8 711 -36T681 -101T624 -166T541 -194Q513 -194 494 -183T465 -157T450 -118T444 -79T443 -41V-7L433 -9Q391 -17 344 -17Q301 -17 263 -10T185 15T118 62T71 138T53 245ZM666 482Q666 529 652 563T614 615T565 640T512 648Q412 648 335 573Q268 506 235 389T201 202Q201 164 210 136T230 95T259 66L262 76Q269 109 302 135T382 162Q401 162 415 159T449 140T484 92L491 78L496 82Q502 86 505 88T515 97T528 107T541 120T555 137T570 156T585 179T599 205T612 235Q629 278 647 351T666 482ZM439 56Q439 58 439 62T435 75T426 92T410 106T383 112Q353 112 332 96T311 63Q311 38 355 38H366Q391 39 415 45T439 56",
        119929: "258 624H235Q214 624 209 626T199 639Q203 678 216 684Q220 686 422 686H446H525Q634 686 698 674T806 620Q843 583 843 535Q843 505 833 478T805 432T768 396T728 370T690 352T662 342L651 338L654 336Q658 334 667 327T688 310Q719 278 719 237Q719 222 710 165T701 94Q701 35 748 35Q775 35 793 57T819 101Q822 112 826 114T843 117H849Q881 117 881 99Q881 78 852 39T781 -11Q765 -17 728 -17Q537 -13 537 94Q537 110 552 169T567 243Q567 292 529 309Q517 316 508 316T441 318H375L374 314Q374 312 343 189T311 64Q311 62 355 62H382Q414 62 414 44Q410 6 397 2L393 0L351 1Q325 2 221 2Q147 2 108 1T65 0Q48 0 43 15Q47 54 60 60Q64 62 113 62H162L302 623Q302 624 258 624ZM687 555Q687 617 589 623Q581 624 513 624H451L420 498Q413 468 405 436T392 388L388 371Q388 369 458 369Q464 369 485 369T515 369T541 372T570 377T596 386T624 400Q649 417 664 457T683 522T687 555",
        119930: "354 45Q429 45 467 91T506 184Q506 225 477 250Q461 262 384 279T294 300Q238 318 210 362T182 452Q182 493 202 540T257 623Q338 702 449 702Q491 702 501 701Q571 690 610 654Q614 649 617 650Q618 650 650 675T683 702Q685 703 692 703Q714 703 714 690Q714 686 687 578T658 466Q653 458 629 458Q606 458 602 463Q600 465 599 466Q599 467 599 469T598 473Q598 475 599 487T600 511Q600 584 557 614T454 645Q386 645 347 606T308 520Q308 506 311 496T323 477T338 464T360 454T384 446T413 439T441 433Q523 416 549 401Q581 384 602 352Q631 309 631 254Q631 214 615 170T567 83T478 12T347 -16Q322 -16 300 -14T261 -8T230 0T205 10T187 20T172 30L162 37L130 11Q124 7 119 3T110 -4T104 -9T100 -13T96 -15T93 -16T91 -17T88 -17H82Q76 -17 73 -16T69 -14T66 -10T63 -5L90 107Q97 133 106 170Q116 211 120 219T136 228H148Q167 228 173 227T179 218Q179 216 176 200T173 168Q173 102 227 74T354 45",
        119931: "498 62Q511 58 511 43Q511 10 494 1L490 0Q487 0 482 0T424 1T271 2Q201 2 157 2T94 1T72 0H70Q46 0 46 17Q49 54 62 60L66 62H137Q208 62 209 63L218 98Q227 134 244 203T278 339L347 613H300Q262 612 246 611T198 599T146 564Q128 545 114 512T91 454T79 425Q73 419 52 419Q22 419 22 434Q22 440 41 498T80 611L100 666Q105 673 111 675H434Q758 675 762 673Q772 668 772 657Q772 655 756 549T738 434Q735 419 711 419H707Q690 419 686 421Q677 425 677 434Q676 436 678 449T683 485T686 529Q686 553 679 569T662 594T631 607T593 612T544 613H502L433 340Q418 279 400 207T374 100L365 65L364 62H498",
        119932: "856 686Q877 686 877 668Q877 663 873 649T867 631Q861 624 828 624Q762 622 757 617Q757 613 705 409T651 200Q620 112 540 48T328 -16Q251 -16 196 2T113 51T75 112T63 176Q63 202 70 232T117 422Q129 469 141 520T160 598L167 623Q167 624 123 624H96Q79 624 73 626T64 639Q68 678 81 684Q85 686 104 686Q155 684 268 684Q340 684 377 685T418 686Q441 686 441 668Q437 632 425 626Q421 624 371 624H322L270 415Q224 232 217 198T209 141Q209 45 336 45Q372 45 406 52T475 77T540 128T585 211L590 229Q594 247 601 274T617 336T636 409T654 482T670 547T681 595T686 618Q686 620 685 620H683Q681 621 678 621T671 622Q660 622 630 624Q616 624 610 624T598 626T589 630T587 640Q587 647 590 659Q594 677 598 681T613 686Q618 686 653 685T740 684Q775 684 801 684T840 685T856 686",
        119933: "401 686Q415 680 415 668Q415 651 404 629Q398 624 356 624Q318 624 318 623Q318 620 337 508T377 284L397 174L472 285Q548 396 623 507T699 620Q698 621 652 624Q634 624 627 627T619 641Q619 648 622 658Q627 677 631 681T650 686Q654 686 686 685T766 684Q794 684 823 684T858 685Q874 685 878 683T886 671Q886 667 882 651Q877 632 873 628T850 624Q800 624 779 617Q774 617 770 613Q767 610 560 304T350 -5Q346 -9 332 -16H306H291Q270 -16 267 -2Q267 -1 260 37T238 161T210 313L156 624H116H94Q62 624 62 642Q66 678 78 684Q82 686 99 686Q144 684 246 684Q330 684 368 685L401 686",
        119934: "111 624Q109 624 102 624T91 623Q61 623 61 640Q61 660 70 678Q78 686 98 686Q140 684 239 684Q277 684 309 684T360 685T383 686H385Q407 686 407 668Q404 634 391 626Q387 624 348 624Q307 624 307 622Q307 618 332 409Q359 198 359 195L570 532L564 576L558 622V624H522H504Q472 624 472 641Q475 678 488 684L493 686L529 685Q551 684 645 684Q716 684 753 685T795 686Q818 686 818 669Q815 632 802 626Q798 624 759 624Q718 624 718 622Q718 615 743 410Q770 199 770 196Q770 195 806 253T903 406Q1035 618 1035 619Q1025 624 968 624Q943 624 943 641Q943 648 946 659Q950 675 952 679T963 686L998 685Q1020 684 1093 684Q1113 684 1139 685T1173 686Q1207 686 1207 669Q1207 664 1204 652Q1199 631 1194 628T1164 624Q1113 622 1101 615Q1098 612 905 305Q715 -1 709 -7Q699 -17 673 -17Q645 -17 639 -8L581 441Q581 444 442 221Q331 44 314 18T288 -14Q279 -17 263 -17H254Q229 -17 227 -5Q225 2 186 311L147 620V624H111",
        119935: "931 686Q953 686 953 670Q953 650 944 632Q936 624 924 624H914Q823 624 803 611Q800 609 696 503T591 396Q591 394 667 229L743 62H787H814Q846 62 846 44Q843 7 829 2Q825 0 817 0Q813 0 775 1T664 2Q590 2 551 1T508 0H507Q484 0 484 18Q484 19 488 37Q492 56 497 58T534 62L566 63Q567 64 520 169T471 274Q469 274 369 172T268 67L315 62Q320 62 328 62L335 61Q347 58 347 44Q344 10 331 2L326 0L287 1Q263 2 177 2Q95 2 78 1L53 0Q38 6 38 17Q38 40 50 57Q56 62 78 62Q169 62 188 75Q194 77 435 324L444 334L439 347Q437 351 373 492L313 624H268H246Q220 624 212 632Q210 636 210 642Q210 655 215 669T227 684Q230 686 247 686Q295 684 398 684Q438 684 472 684T527 685T551 686Q567 686 572 671Q572 667 568 651Q563 631 558 628T523 624T492 623H488L526 540Q563 457 564 457Q564 456 574 466T604 496T645 537L724 619Q716 622 677 624H673Q645 624 645 640Q645 660 654 678Q659 683 666 686L704 685Q728 684 813 684Q847 684 873 684T913 685T931 686",
        119936: "97 624H73Q40 624 40 640Q40 660 49 678Q57 686 77 686Q122 684 228 684Q269 684 304 684T360 685T385 686Q406 686 406 668Q406 662 403 653Q398 631 393 628T361 624H353Q321 624 321 623T376 491T432 360L448 377Q465 394 493 424T553 490L673 620Q662 624 630 624Q606 624 606 640Q608 678 623 684Q627 686 634 686Q638 686 671 685T755 684Q777 684 805 685T841 686Q861 686 868 683T876 669Q876 664 873 652Q868 631 863 628T829 624Q764 622 747 611Q727 590 590 441L437 275L411 170Q385 65 384 64Q384 62 429 62H453Q473 62 478 60T487 48Q488 44 484 29Q479 6 473 3Q468 0 454 0Q450 0 436 0T386 1T294 2Q220 2 181 1T138 0Q121 0 116 15Q120 54 133 60Q137 62 187 62H236L289 275L142 624H97",
        119937: "223 430Q192 430 192 448Q192 450 225 561T261 677Q265 683 270 684Q273 686 534 686Q796 686 797 685Q805 682 805 673Q805 668 804 661T800 648T798 641Q796 637 531 352L266 67L329 66H364Q412 66 446 70T523 96T596 157Q617 186 630 220T649 273T663 297Q667 299 684 299H688Q715 299 715 281Q715 278 673 145T628 8Q626 4 617 0H348Q289 0 221 0T139 -1Q112 -1 99 -1T78 1T69 5T68 12Q68 16 71 31T77 49L84 57Q91 65 104 79T133 110T170 151T213 196L610 624H540Q533 624 514 624T488 624T467 623T443 620T422 616T398 609T373 600Q292 560 255 449Q251 436 246 433T223 430",
        119938: "222 -8Q140 -8 89 34T38 158Q38 191 48 227Q72 329 151 390T327 452Q361 452 385 443T421 425T433 416H434L441 421Q448 426 460 430T486 435Q509 435 523 422T538 386Q538 380 522 315T488 179T467 93Q466 87 466 72Q466 42 483 42Q505 42 521 75Q531 94 541 134Q546 155 550 158T571 162H576H587Q607 162 607 148Q606 142 604 132T590 94T566 47T528 9T474 -8Q396 -8 358 40Q295 -8 222 -8ZM404 351Q383 401 324 401Q300 401 270 385T221 330Q206 296 186 220Q166 136 166 106Q166 72 184 58T228 43Q256 43 284 57T328 84T343 103Q343 106 374 228L404 351",
        119939: "220 -8Q142 -8 94 35T45 155V167Q45 187 52 218T104 426L153 622H149Q148 622 144 622T134 623T122 624T111 624T101 624T96 625Q84 628 84 642Q84 647 88 661T94 679Q98 684 109 685T185 690Q258 694 272 694Q289 694 293 679Q293 676 263 553L232 429L244 434Q256 440 281 446T331 452Q417 452 465 407T513 285Q513 235 494 184T439 90T346 20T220 -8ZM385 337Q385 400 318 400Q269 400 226 360Q214 349 211 341T191 268Q162 149 162 113Q162 44 226 44Q269 44 299 76T339 135T362 215Q364 222 365 226Q385 303 385 337",
        119940: "362 325Q362 344 371 361T390 386L399 394Q390 401 355 401Q276 401 231 338Q207 301 189 230T170 122Q170 43 264 43Q392 43 457 105Q472 120 480 117Q486 114 497 102T509 83Q509 79 502 70T477 47T432 21T360 1T259 -8Q194 -8 148 9T80 54T49 109T40 167Q40 280 129 365T352 451Q390 451 396 450Q448 442 473 416T499 358T477 302T421 274H417Q393 274 378 288T362 325",
        119941: "222 -8Q140 -8 89 34T38 158Q38 220 68 285T151 391Q230 452 329 452Q382 452 416 428L422 424Q423 424 447 523L472 622H468Q467 622 463 622T453 623T441 624T430 624T420 624T415 625Q403 628 403 642Q403 647 407 661T413 679Q417 684 428 685T504 690Q577 694 591 694Q608 694 612 679L467 91Q466 87 466 72Q466 43 483 43Q518 43 541 134Q546 155 550 158T571 162H576H587Q607 162 607 148Q606 142 604 132T590 94T566 47T528 9T474 -8Q396 -8 358 40Q295 -8 222 -8ZM404 351Q383 401 324 401Q300 401 270 385T221 330Q206 296 186 220Q166 136 166 106Q166 72 184 58T228 43Q256 43 284 57T328 84T343 103Q343 106 374 228L404 351",
        119942: "260 -8Q196 -8 151 9T83 54T52 111T42 169Q42 188 44 210Q50 240 58 266Q127 434 335 451L338 452Q342 452 345 452Q347 452 353 452T363 451Q426 451 464 424T502 352Q502 289 442 250Q381 211 222 211H184Q184 210 181 196T175 162T171 126Q171 43 264 43Q391 43 457 105Q472 120 480 117Q486 114 497 102T509 83Q509 79 502 70T477 47T432 21T360 1T260 -8ZM237 262Q427 266 427 349Q427 368 409 384T354 401Q316 401 287 388T242 354T216 314T202 278L197 263Q197 262 237 262",
        119943: "584 444Q597 439 597 426Q597 409 586 387Q580 382 505 382H434V380Q432 378 421 314T395 162T368 30Q324 -164 203 -199Q194 -201 175 -201Q123 -201 94 -177T64 -117T88 -58T145 -33Q169 -33 184 -47T200 -84Q200 -122 166 -150L174 -151H185Q202 -148 217 -112Q222 -94 240 9Q246 40 262 132T293 303T307 382H247H210Q190 382 182 385T173 400Q177 436 189 442Q193 444 256 444H318L319 446Q337 565 355 602Q373 640 404 664T458 694T503 701Q569 701 596 676T624 617Q624 581 599 557T544 533Q520 533 504 547T488 585Q488 596 491 606T499 624T508 637T516 646L520 650Q515 650 509 651Q459 651 459 561V554L458 518L452 484Q446 448 445 447V444H584",
        119944: "227 0Q142 0 93 43T43 166Q43 207 58 252T104 341T188 414T310 451L313 452Q316 452 319 452Q321 452 326 452T335 451Q367 451 390 443T425 425L436 416L443 421Q450 426 462 430T488 435Q511 435 525 422T540 386Q540 378 483 151T424 -82Q401 -139 335 -170T167 -202Q72 -202 36 -183T0 -125Q0 -90 24 -67T81 -43Q103 -43 119 -56T136 -99Q133 -124 114 -149L123 -150H183Q222 -150 254 -127T299 -74Q300 -71 306 -47T318 -1T324 23Q323 23 310 18T274 6T227 0ZM407 353Q406 354 404 358T400 365T395 371T388 379T381 385T371 391T360 396T346 400T329 401Q300 401 277 389T240 355T219 317T205 280Q171 148 171 109Q171 77 190 64T235 51T296 67Q322 82 337 98L345 106L407 353",
        119945: "477 56Q477 48 479 46T490 43Q522 45 544 75T577 140Q582 156 585 159T605 162H611H622Q642 162 642 148Q642 138 632 114T602 62T550 13T478 -8Q429 -8 394 17T358 83Q358 95 395 199T433 350Q433 400 394 400H388H383Q335 400 291 363Q256 332 236 298Q233 293 202 170T169 40Q160 18 141 5T99 -8Q70 -8 58 9T45 39Q45 51 116 336L188 622H184Q183 622 179 622T169 623T157 624T146 624T136 624T131 625Q119 628 119 642Q119 647 123 661T129 679Q133 684 144 685T220 690Q293 694 307 694Q324 694 328 679Q328 672 294 540Q286 507 278 473T264 420L260 403Q260 400 269 408Q327 451 393 451H401H410Q425 451 439 450T476 442T515 424T544 391T556 337Q556 286 517 179T477 56",
        119946: "205 615Q205 646 229 670T283 694Q310 694 324 679T339 641Q339 610 315 586T258 562Q235 562 220 577T205 615ZM24 296Q24 305 34 328T63 380T115 430T187 452Q205 452 223 448T262 435T295 406T308 360Q308 345 287 290T240 170T207 87Q202 67 202 57Q202 42 215 42Q235 42 257 64Q288 92 302 140Q307 156 310 159T330 162H336H347Q367 162 367 148Q367 140 357 117T329 65T276 14T201 -8Q158 -8 121 15T83 84Q83 104 133 229T184 358Q189 376 189 388Q189 402 177 402Q156 402 134 380Q103 352 89 304Q84 288 81 285T61 282H55H44Q24 282 24 296",
        119947: "321 616Q321 648 346 671T400 694Q425 694 440 680T456 640Q456 609 431 586T376 562Q353 562 337 577T321 616ZM297 360T297 373T294 392T288 400T278 401H276Q241 399 210 372T158 303Q151 287 148 285T129 282H123H116Q102 282 97 284T92 298Q96 331 153 391T279 451Q357 451 388 422T420 354V339L371 142Q363 111 353 71T339 13T329 -30T318 -64T308 -88T296 -109T283 -125T264 -142Q190 -202 88 -202Q44 -202 16 -181T-12 -125Q-12 -93 11 -68T68 -43Q92 -43 108 -58T124 -93Q124 -121 106 -144Q101 -150 103 -150Q120 -150 147 -128T191 -64Q194 -57 242 136T294 345Q297 360 297 373",
        119948: "99 -8Q71 -8 58 9T45 39Q45 51 116 336L188 622H184Q183 622 179 622T169 623T157 624T146 624T136 624T131 625Q119 628 119 642Q119 647 123 661T129 679Q133 684 144 685T220 690Q293 694 307 694Q324 694 328 679Q328 674 280 482Q231 290 231 287Q231 285 234 286Q259 302 294 334T356 390T420 433T493 452Q528 452 546 427T564 364Q564 308 538 282T480 256Q456 256 441 269T425 308Q425 339 444 359T483 384L502 389Q502 395 496 398Q493 400 483 400Q465 400 449 395T409 374T373 347T323 305T268 257Q274 256 282 256Q312 251 329 247T371 232T411 202Q431 181 431 146Q431 132 427 110T422 73Q422 44 440 44H442Q462 44 478 64T502 102T514 141Q518 157 522 159T547 162H558Q578 162 578 148Q578 118 537 56T440 -7H432Q374 -7 337 21T299 94Q299 103 301 116T304 139Q304 164 281 181T235 202L212 206H211Q176 47 160 24Q137 -8 99 -8",
        119949: "157 -8Q138 -8 118 -4T77 11T41 42T27 91V106L156 622H152Q151 622 147 622T137 623T125 624T114 624T104 624T99 625Q87 628 87 642Q87 647 91 661T97 679Q101 684 112 685T188 690Q261 694 275 694Q292 694 296 679L151 91Q150 85 150 71Q150 42 167 42Q186 42 205 75Q216 96 225 134Q230 155 234 158T255 162H260H271Q291 162 291 148Q290 145 289 140T283 118T271 87T254 54T229 23T197 1T157 -8",
        119950: "24 296Q25 302 27 312T41 350T65 397T104 435T159 452Q203 452 234 435Q268 419 285 384L295 392Q305 401 317 410T349 429T389 445Q411 451 446 451Q560 451 592 383Q593 380 594 379L595 375L604 384Q675 452 762 452Q893 452 916 367Q918 356 918 334Q918 285 881 183T841 66Q838 43 849 43Q876 43 901 69T940 138Q945 156 949 159T969 162H975H986Q1006 162 1006 148Q1006 138 996 115T966 63T914 13T841 -8Q794 -8 758 16T721 82Q721 96 758 199T796 351Q796 401 753 401Q702 401 662 369T599 298Q597 294 567 172T533 40Q525 22 506 7T462 -8Q435 -8 422 8T409 39Q409 48 425 114T458 248T476 320Q478 330 478 348T474 377T462 393T449 399T433 400H428Q380 400 336 363Q301 332 281 298Q278 293 247 170T214 40Q206 22 187 7T143 -8T104 7T90 39Q90 47 108 124T146 274L164 347Q166 355 166 372Q166 401 149 401Q129 401 115 379T89 306Q84 288 80 285T55 282H44Q24 282 24 296",
        119951: "24 296Q25 302 27 312T41 350T65 397T104 435T159 452Q203 452 234 435Q268 419 285 384L293 391Q363 452 454 452Q575 446 597 367Q599 356 599 334Q599 285 562 183T522 66Q519 43 530 43Q557 43 582 69T621 138Q626 156 630 159T650 162H656H667Q687 162 687 148Q687 138 677 115T647 63T595 13T522 -8Q475 -8 439 16T402 82Q402 96 439 199T477 351Q477 401 434 401Q421 401 409 398Q341 388 285 305L278 295L247 170Q216 46 214 40Q206 22 187 7T143 -8T104 7T90 39Q90 47 108 124T146 274L164 347Q166 355 166 372Q166 401 149 401Q129 401 115 379T89 306Q84 288 80 285T55 282H44Q24 282 24 296",
        119952: "254 -8Q191 -8 146 9T80 54T49 111T39 169Q39 206 53 247T96 329T176 402T292 446Q317 451 336 451L344 452Q353 452 359 452Q457 452 516 408T576 279Q576 169 488 81T254 -8ZM349 400Q321 400 287 385T231 338Q206 301 188 228T170 126Q170 99 178 83Q198 44 260 44Q367 44 409 157Q419 185 432 238T445 317Q445 336 443 348Q435 372 416 384T384 398T349 400",
        119953: "24 296Q25 302 27 312T41 350T65 397T103 435T157 452Q235 452 273 404Q336 452 409 452Q434 452 458 448T507 432T550 402T581 354T593 285Q593 221 564 159T480 53Q401 -8 302 -8Q290 -8 279 -7T259 -3T242 3T228 9T218 14T212 18L209 20Q208 19 190 -55T171 -131T198 -132H213Q240 -132 240 -150Q237 -187 223 -192Q219 -194 212 -194Q208 -194 176 -193T95 -192Q48 -192 24 -193T-3 -194Q-11 -194 -16 -190T-22 -182T-23 -176Q-20 -142 -7 -134Q-3 -132 20 -132H44L164 354Q165 357 165 372Q165 401 148 401Q113 401 90 310Q85 289 82 286T60 282H55H44Q24 282 24 296ZM465 339Q465 373 447 387T403 401Q375 401 347 387T303 360T288 341Q288 338 257 216L227 93Q248 43 306 43Q332 43 361 59T410 115Q425 147 445 224Q465 309 465 339",
        119954: "38 159Q38 209 58 260T113 355T205 425T327 452Q338 452 348 451T366 449T382 444T394 440T405 434T414 429T422 423T429 418Q440 429 481 440T533 452Q540 452 545 447T550 437Q550 432 481 152Q410 -130 410 -131T437 -132H452Q479 -132 479 -150Q476 -187 462 -192Q458 -194 451 -194Q447 -194 414 -193T330 -192Q277 -192 249 -193T217 -194Q202 -194 197 -179Q197 -175 201 -159Q206 -139 211 -136T243 -132H283L319 15L307 10Q295 4 270 -2T220 -8Q134 -8 86 37T38 159ZM402 353Q402 358 395 368T369 390T324 401Q301 401 282 394T249 369T226 338T208 297T196 258T186 218Q166 141 166 107Q166 44 229 44Q265 44 294 61T337 95Q341 100 371 222T402 353",
        119955: "24 296Q24 298 28 313T42 352T67 398T104 436T154 452Q198 452 230 437T273 404L282 411Q334 452 393 452Q441 452 470 423T500 350Q500 301 473 279T418 256Q395 256 379 270T363 308Q363 366 424 386Q424 388 420 391T405 398T385 401Q363 401 343 390Q321 380 289 341L252 192Q214 42 212 39Q190 -8 142 -8Q117 -8 103 7T89 39Q89 52 127 202T165 369Q165 402 148 402Q139 402 128 393T110 369Q100 348 90 310Q85 289 82 286T60 282H55H44Q24 282 24 296",
        119956: "140 290Q140 311 148 336T176 388T235 433T326 451H336Q355 451 373 449T418 439T460 412T476 363Q476 333 456 311T406 289Q384 289 371 302T357 335Q357 351 364 364T379 384L386 391Q386 392 381 394T362 398T330 400Q299 400 278 393T247 373T235 352T232 335Q232 322 242 312Q258 299 315 290T403 260Q457 224 457 167Q457 152 453 134T435 90T397 43T330 7T229 -8Q133 -8 95 22T57 91Q57 127 81 152T139 177Q161 177 177 164T194 121Q189 80 153 56Q179 43 236 43Q275 43 303 52T343 75T361 101T366 124Q366 148 338 161T272 180T232 186Q187 198 164 227T140 290",
        119957: "82 382H55Q21 382 21 399Q21 422 33 439Q39 444 93 444H144L162 517Q163 522 167 541T174 567T181 589T192 611T206 627T226 639T253 643Q276 643 291 630T306 594Q306 586 288 514Q284 499 280 481T273 454L271 445Q271 444 317 444Q322 444 331 444T345 445Q377 445 377 428Q377 408 368 390Q360 382 341 382H306H255Q182 86 182 75Q182 43 201 43H204Q242 46 279 81Q298 101 309 119T323 145T330 157T350 162H356H363Q377 162 382 160T387 146Q385 136 372 114T337 64T275 14T192 -7Q131 -7 95 19T59 90V105L128 381Q128 382 82 382",
        119958: "189 389Q189 397 187 399T176 401Q150 399 126 372T89 304Q84 288 81 285T61 282H55H44Q24 282 24 296Q24 307 35 331T65 383T117 431T187 452Q237 452 272 427T308 362Q308 347 273 254T238 111Q238 43 291 43Q319 43 344 58T380 86T391 103T426 247T464 396Q472 414 491 429T535 444T574 429T588 397Q588 390 570 315T534 168L516 97Q514 89 514 72Q514 42 531 42Q544 42 556 56Q574 76 589 134Q594 155 598 158T619 162H624H635Q655 162 655 148Q654 142 652 132T638 94T614 47T575 9T520 -8Q509 -8 498 -7T478 -3T461 2T446 8T434 16T424 23T416 29T410 35T406 39L405 41L397 34Q347 -7 288 -7H281Q148 -7 122 78Q116 95 116 125V136Q116 174 152 273T189 389",
        119959: "380 367Q380 397 406 425T465 453Q493 453 516 430T540 357Q540 314 524 250T467 115T373 13Q338 -8 292 -8Q218 -8 167 23T116 129Q116 178 152 275T189 388Q189 396 187 398T176 401Q148 398 125 372T89 304Q84 288 81 285T61 282H55H44Q24 282 24 296Q24 306 34 330T64 382T116 431T189 452Q231 452 269 429T308 362Q308 346 273 255T238 114Q238 43 306 43Q336 43 363 65T407 118T437 182T456 239T462 268Q462 290 417 315Q380 335 380 367",
        119960: "636 367Q636 400 664 426T719 453Q748 453 772 431T796 357Q796 321 782 256T727 112T633 6Q604 -8 567 -8Q466 -8 415 43Q414 42 410 38T403 31T396 25T388 18T378 11T367 5T355 0T340 -4T324 -7T306 -8Q249 -8 209 5T151 40T125 84T117 129Q117 176 153 274T190 388Q190 408 158 396Q112 376 90 306Q85 288 81 285T61 282H55H44Q24 282 24 296Q24 305 34 328T63 380T114 430T187 452Q240 452 274 427T309 362Q309 346 275 255T240 117Q240 43 317 43Q325 43 333 45T347 50T359 57T369 66T377 75T383 83T388 90L390 95Q390 99 389 110T387 129Q387 139 391 167Q393 177 419 282T448 396Q456 414 475 429T519 444Q546 444 559 428T572 397Q572 384 542 265T511 114Q511 43 579 43Q608 43 633 66T673 122T699 188T714 244L718 267Q718 291 673 315Q636 335 636 367",
        119961: "74 282H63Q43 282 43 296Q43 298 45 307T56 332T76 365T110 401T159 433Q200 451 233 451H236Q273 451 282 450Q358 437 382 400L392 410Q434 452 483 452Q538 452 568 421T599 346Q599 303 573 280T517 256Q494 256 478 270T462 308Q462 343 488 367Q501 377 520 385Q520 386 516 389T502 396T480 400T462 398Q429 383 415 341Q354 116 354 80T405 44Q449 44 485 74T535 142Q539 156 542 159T562 162H568H579Q599 162 599 148Q599 135 586 111T550 60T485 12T397 -8Q313 -8 266 35L258 44Q215 -7 161 -7H156Q99 -7 71 25T43 95Q43 143 70 165T125 188Q148 188 164 174T180 136Q180 101 154 77Q141 67 122 59Q124 54 136 49T161 43Q183 43 200 61T226 103Q287 328 287 364T236 400Q200 400 164 377T107 302Q103 288 100 285T80 282H74",
        119962: "206 -150Q240 -150 268 -134T314 -95T344 -48T362 -7T367 14Q339 -7 280 -7Q230 -7 195 5T144 39T122 79T115 122Q115 175 152 274T189 388Q189 396 187 398T176 401Q148 398 125 372T89 304Q84 288 81 285T61 282H55H44Q24 282 24 296Q24 306 34 329T64 381T116 431T188 452Q239 452 273 427T308 361Q308 347 273 253T237 109Q237 43 291 43T388 98Q388 99 425 246T463 396Q471 414 490 429T534 444T573 430T587 399Q587 386 537 186T483 -25Q461 -84 410 -126T296 -188Q248 -202 204 -202Q127 -202 96 -175T64 -114Q64 -82 86 -57T144 -31Q169 -31 184 -45T199 -83Q199 -89 198 -94T196 -104T193 -113T189 -120T184 -128T179 -134T173 -141T168 -147Q189 -150 206 -150",
        119963: "66 -8H60Q34 -8 34 5Q34 9 42 22T70 59T115 110Q162 156 255 229T381 332L389 339H381Q348 332 298 329T212 325T172 321Q168 318 151 318H146Q116 318 116 332Q116 334 118 342Q128 374 154 402Q205 452 265 452Q304 452 352 422T426 392Q441 392 462 421T485 451T508 452H518Q539 452 539 438Q539 431 516 401T458 334Q412 289 312 210Q229 146 191 111L183 103H195Q203 103 213 104T240 107T268 110Q301 114 337 116T391 119T428 123T455 134T469 157Q473 166 495 166Q521 166 525 161Q532 156 528 141Q510 81 456 37T337 -7Q297 -7 251 22T177 52Q154 52 134 38T100 8L88 -7Q86 -8 66 -8",
        119964: "76 60Q83 29 135 29Q190 29 264 81Q280 93 280 95T277 99T265 106T248 118Q189 166 189 237Q189 307 245 388Q267 421 299 436Q336 455 386 455Q488 455 550 403L559 395L571 405Q727 544 944 679L957 687L966 701Q968 704 970 707T973 712T975 714T978 716T982 717T989 717H995Q1004 717 1007 717T1013 714T1016 708Q1016 705 829 403L636 92L630 83Q659 93 685 110T728 143L745 158Q758 158 752 138L748 127L740 119Q676 58 605 42L593 22Q590 17 587 12T583 6T579 2T573 0T564 0H530H484Q480 3 480 8Q480 15 489 26T498 39T497 40Q477 40 423 49T327 74L316 78L302 68Q200 -8 121 -8Q85 -8 60 7T35 53T60 113T123 144Q144 144 153 132T162 106Q162 89 143 75T99 61Q90 61 76 65V60ZM904 614L905 615Q901 615 840 573T700 469T581 369L587 359Q600 340 608 315T618 273T622 238T624 216L764 414Q904 612 904 614ZM525 363Q493 405 379 418H375Q342 418 309 378Q251 300 251 234Q251 174 306 137Q318 128 322 131Q323 132 329 139Q351 161 362 180Q430 273 509 348L525 363ZM579 205Q579 245 571 278T556 323T546 337L521 311Q461 248 422 196T362 121L353 111Q427 85 499 79Q517 77 520 77L525 76L549 111Q551 114 556 121T563 131T568 138T573 147T575 157T577 169T578 185T579 205",
        119966: "367 89Q367 84 353 77T334 70Q325 70 312 83T298 120Q298 169 364 233T496 298Q538 298 563 275T588 220V213Q588 132 501 53T306 -26Q251 -26 211 6T170 114Q171 148 181 184T205 248T232 298T255 334T265 349T246 350Q127 350 77 390T26 480Q26 533 71 581T178 656T295 683Q312 683 312 676Q312 674 311 672L302 660Q294 648 292 647L286 646Q280 646 276 646Q197 641 145 583T93 476Q93 387 265 387Q271 387 277 387T287 388T292 388T313 414T373 483T451 562Q618 712 732 727Q733 727 740 727T753 728Q790 727 804 708T819 665Q819 643 810 617T773 553T699 481T572 414T385 361Q381 361 367 341Q247 172 247 86Q247 11 325 11Q404 11 465 95Q518 165 528 208Q529 212 529 220Q529 237 518 249T480 261Q431 261 387 209T343 126Q343 111 355 101T367 89ZM777 658Q777 691 738 691Q704 691 658 662T570 590T491 504T432 432T410 400H411Q416 400 440 405T505 423T589 455T675 506T743 576Q777 627 777 658",
        119967: "251 272Q199 272 168 298T136 374Q136 432 175 496T267 603Q321 645 395 676T552 708Q610 708 655 694T724 659T763 618T784 584L790 569Q792 569 800 572T819 576T840 578Q855 578 855 571Q855 566 846 554T829 541Q824 541 817 539T804 533T799 529Q802 517 802 483Q802 376 742 256T585 53T392 -31Q353 -31 300 -7L289 -2L277 -6Q242 -17 192 -17Q141 -17 113 -13T77 -3T68 14Q68 20 73 28T93 45T131 58Q152 62 197 62Q241 62 272 48L282 44Q308 65 334 93Q380 145 467 266T622 454Q644 476 664 493T694 517T720 534T740 547Q699 671 540 671Q461 671 385 625T276 534Q265 520 251 499T219 438T202 368Q202 309 267 309Q325 309 396 383T491 545Q492 548 493 552Q494 558 496 559T511 564Q513 565 514 565Q523 568 527 568Q534 568 534 560Q534 554 529 537Q507 442 420 357T251 272ZM332 20Q332 19 341 15T368 6T400 2Q425 2 457 13T531 49T614 125T690 248Q750 376 750 476V490L738 479Q698 436 646 366T554 239T455 121T332 20ZM226 20Q226 25 186 25Q181 25 174 24H166Q161 24 158 23H152Q170 21 197 21Q205 21 213 21T223 20H226",
        119970: "206 318L249 320Q249 327 259 352T282 399Q312 447 366 510T465 610Q588 717 661 717Q695 717 716 701T738 653T704 577Q663 522 610 474T512 397T424 346T359 315T333 306Q331 304 327 290T323 267Q323 229 368 229Q402 229 439 254T505 312T571 382T638 435Q642 437 644 437Q658 437 658 409Q655 403 647 399T624 379T595 326Q583 296 564 267T523 179Q504 126 483 91T423 27Q335 -37 231 -37Q191 -37 157 -30T95 -2T67 53Q67 89 94 123T159 158Q180 158 190 146T200 119Q200 102 178 89T136 75Q128 75 120 78T110 81Q105 81 105 62Q105 38 129 24T180 5T238 1H244Q282 1 319 32Q349 55 371 85T436 190L465 239Q413 192 354 192Q300 192 274 217T245 276Q245 284 242 284Q220 280 187 280Q106 280 59 315T12 409Q12 457 43 508T118 597T210 659T295 683Q308 683 308 675Q308 670 299 658T282 646Q266 646 240 633Q182 606 118 511Q76 448 76 400Q76 368 105 343T206 318ZM677 660Q677 680 646 680Q616 680 565 629Q537 601 514 571Q493 544 455 492T389 398T360 355Q366 357 386 367Q463 406 534 473T641 591T677 660",
        119973: "829 148Q845 148 845 143T841 130T823 109T788 83T730 54T644 22Q637 20 634 19T627 16T622 13T618 10T612 3T604 -6Q510 -112 396 -203T201 -312Q190 -314 171 -314H166Q156 -314 147 -312T123 -304T101 -283T92 -245Q92 -203 117 -160T175 -93Q214 -65 280 -41T390 -6T509 22L532 27L547 47Q673 219 673 225L665 228Q657 231 648 235T627 249T606 270T591 300T584 341Q584 389 614 447T686 544Q735 588 799 615T959 667T1108 713Q1118 717 1119 717Q1125 717 1129 705T1133 689Q1133 686 1115 673Q1051 627 1001 579T918 481T867 403T828 328T805 277Q802 271 801 267T798 261T798 259Q849 270 900 317Q956 371 956 421Q956 438 953 457T950 480Q950 481 950 482L951 484Q953 487 966 492T985 498Q989 498 994 473Q1000 441 1000 423Q1000 362 934 302T790 223L775 220L767 207Q757 191 731 158T685 98T662 63Q662 61 690 70T755 99T811 142L816 148H829ZM646 332Q646 308 659 291T685 268L698 263L735 320Q828 465 865 511Q923 582 1003 643L1005 645Q1004 645 924 620Q775 572 716 492Q646 401 646 332ZM184 -278Q233 -278 311 -212T444 -80L498 -15H496Q468 -20 424 -30T293 -70T174 -133Q167 -140 158 -153T138 -190T127 -232Q127 -278 184 -278",
        119974: "521 506Q521 493 549 493Q608 493 660 527Q667 531 690 555L736 604Q750 619 777 646T825 694T848 716T852 717Q857 717 860 711T865 697L866 690Q866 687 812 615Q654 404 654 401Q655 401 656 401T659 402T665 403T680 404Q718 404 734 374Q735 370 743 376Q745 377 752 382Q806 416 852 466T933 563T982 623Q1028 666 1075 686T1155 706Q1165 706 1173 705T1186 703T1194 699T1199 695T1201 692T1202 688V687L1204 677Q1204 667 1191 670Q1189 670 1183 670T1174 671Q1137 671 1086 643T1001 564Q970 517 899 449T749 339L739 333L736 322Q730 295 703 253T652 165T628 77Q628 21 681 21Q692 21 698 23Q751 46 817 134L827 148H844Q861 148 864 146Q869 140 859 127Q818 75 761 29T665 -17Q649 -17 633 -12T598 4T569 40T558 100Q558 128 563 152T585 205T609 245T643 294Q647 300 645 300Q633 297 615 297Q607 297 600 298T589 300T584 301Q581 301 569 284T536 236T488 171T418 97T331 28Q233 -37 155 -37Q104 -37 68 -17T29 44Q29 82 55 120T123 158Q144 158 154 146T164 119Q164 102 143 89T100 75Q92 75 86 76T77 80T72 82Q68 82 68 59Q68 37 85 23T123 5T167 0Q203 0 238 21T311 85T382 174T468 288T563 410Q576 426 588 440T607 462T615 472L605 468Q568 456 533 456H527Q490 456 463 483Q451 496 451 508T468 545T486 581Q486 593 465 593Q448 593 425 568T384 518T364 493Q364 492 347 492Q326 492 326 499T351 537T414 599T477 630Q509 630 528 615T547 576Q547 556 534 533T521 506ZM675 357Q675 368 665 368Q656 368 644 363Q631 355 616 333H628Q640 334 672 341Q675 354 675 357",
        119977: "764 513Q764 482 772 423T780 330Q780 304 778 285T775 256T773 245Q778 252 826 328T932 484T1042 617Q1077 652 1114 678T1173 715T1200 726Q1208 726 1208 717Q1208 711 1206 695L1203 679L1199 675Q1197 675 1187 670T1161 657T1133 639Q1050 583 959 456Q906 381 858 307T779 179T725 83T691 18T679 -6Q677 -8 660 -8H656Q639 -8 639 -1Q639 4 646 17Q685 93 685 173V196Q685 233 681 288T676 380Q676 438 687 487L664 454Q505 230 454 170Q366 64 290 14T163 -36H152Q87 -36 58 -11T29 46Q29 82 55 120T123 158Q144 158 154 146T164 119Q164 102 143 89T100 75Q92 75 86 76T77 80T72 82Q67 82 67 59Q67 37 89 19T167 1Q187 1 197 3Q221 9 246 22T292 52T336 91T375 132T411 174T440 212T463 245T478 266Q779 695 784 698Q786 700 802 700H818Q824 694 824 692T809 668T779 604T764 513",
        119978: "259 -8Q230 -7 205 0T153 24T112 74T96 153Q96 254 174 379T374 599T607 707H621Q732 707 778 661Q805 634 805 598Q805 558 775 517T696 452L684 447V441Q684 378 626 273T484 97Q379 7 288 -7Q279 -8 259 -8ZM760 594Q760 670 608 670Q562 670 493 622T347 472Q174 240 174 131Q174 76 205 53T279 29Q294 29 306 32Q405 60 507 205Q592 325 616 401Q625 426 625 435Q625 436 621 436T603 440T569 449Q524 466 515 475Q513 477 513 481T525 496T541 508L548 504Q555 501 565 497T587 488T609 480T625 476Q627 476 626 481Q626 486 623 494T613 513T589 533T548 541Q495 541 413 454T286 281Q265 241 254 201T240 141T235 120Q234 118 217 111T197 104Q195 104 192 107T189 112Q190 125 193 147T220 231T280 348Q335 428 407 493T539 576Q548 578 563 578Q594 578 617 568T653 546T672 518T681 494T683 482Q683 481 684 481Q690 481 707 495T742 538T760 594",
        119979: "571 345Q571 384 612 418T687 452Q698 452 698 445Q698 436 679 417Q677 415 670 415Q650 412 633 389T615 350Q615 340 621 331T634 319T643 315L663 342Q751 462 817 536Q873 595 896 614L907 625Q843 680 701 680Q594 680 499 632T344 516Q317 486 296 449T267 384Q262 366 262 354Q262 332 276 316T326 299H327Q374 299 426 338Q481 376 537 456T597 598Q597 616 599 617Q601 619 614 624T630 630Q639 630 639 604V587V581Q639 519 597 456Q544 377 462 320T318 262Q278 262 250 282T222 350Q222 418 285 504Q360 597 480 656T702 716Q773 716 825 707T898 688T951 660Q962 670 985 685T1012 700Q1018 700 1022 690T1026 673Q1026 670 1019 664Q988 633 988 631Q988 630 999 618T1020 580T1031 522Q1031 471 1003 419T928 330Q854 275 765 264Q757 262 733 262H714L701 245Q615 121 473 42T218 -37Q159 -37 125 -15T90 46Q90 82 116 120T185 158Q203 158 213 147T224 121Q224 110 219 102Q198 75 159 75Q154 75 149 76T143 77T140 77Q137 72 137 53Q138 37 149 26T177 9T205 2T228 0Q313 0 419 74T602 257L620 281L614 285Q607 289 601 294T587 306T576 323T571 345ZM950 529Q950 576 943 576Q940 576 840 439T741 299H751Q804 300 845 334T924 438Q949 490 950 529",
        119980: "330 387Q330 331 402 331Q463 331 514 371T589 459T613 542Q613 559 608 570T598 588T593 596Q593 601 617 610Q632 617 636 616Q675 585 675 527Q675 464 629 409T516 324T387 294Q271 294 271 394V402Q271 438 292 478Q344 582 457 649T672 717Q765 717 825 675T885 548Q885 433 771 298T498 76Q493 73 491 72T486 69T484 67T485 66Q539 41 607 41Q655 41 703 71T780 139L787 148H804Q806 148 809 148Q826 149 826 140Q826 128 786 91T687 19T589 -16H576Q503 -16 414 20L396 27Q279 -17 192 -17Q130 -17 92 2T54 53Q54 92 107 123T222 155Q303 155 401 106L431 91L441 97Q476 118 527 157Q622 236 711 361T801 573Q801 591 795 607T775 641T732 668T660 679Q592 679 528 644T422 560T355 464T330 387ZM201 20Q232 20 267 27T322 40T342 49Q342 52 315 60T243 77T160 86Q150 88 144 88Q130 88 122 79T112 62L111 53Q111 20 201 20",
        119982: "346 463Q346 419 406 386T576 352H588L613 384L681 476Q767 594 842 651T973 708Q1016 708 1016 661Q1016 621 987 562T894 449Q802 375 696 338L682 334L665 312Q638 279 605 233T547 158T482 97Q418 46 332 5T158 -36Q87 -36 58 -11T29 48Q29 82 55 120T123 158Q144 158 154 146T164 119Q164 102 143 89T100 75Q92 75 86 76T77 80T72 82Q67 82 67 59Q67 28 98 14T166 0Q232 0 320 55T491 226Q530 279 551 305L558 314Q558 315 543 315Q417 321 353 365T289 460Q289 566 488 632Q578 662 660 665H679Q685 660 685 657T676 642Q670 633 666 629L664 628Q663 628 661 628T655 628Q606 628 546 615T426 568T350 486Q346 475 346 463ZM976 653Q976 671 959 671Q938 671 919 661T883 629T858 593T835 554Q832 548 830 545Q802 495 775 455T734 400T721 382L736 388Q876 449 946 568Q948 572 949 573Q976 622 976 653",
        119983: "354 350Q264 350 264 426Q264 442 265 448Q279 514 347 582T503 692T662 735Q719 735 774 714T882 672T983 651Q996 651 996 644Q996 639 977 612T954 581Q953 580 938 580Q909 582 884 587L869 591L870 587Q870 583 849 557T796 491T748 422Q729 391 692 313T620 188Q555 105 454 34T253 -37Q214 -37 181 -30T120 -2T92 53Q92 89 119 123T184 158Q205 158 215 146T225 119Q225 102 203 89T161 75Q153 75 145 78T135 81Q130 81 130 62Q130 39 153 24T204 5T267 0Q311 0 358 29T454 117T539 226T629 358T710 476Q726 496 744 516T778 551T807 577T828 595L836 601L785 623Q743 642 713 651T668 661T626 663Q564 663 509 644T418 596T356 535T317 475T305 431Q305 416 312 408Q323 388 369 388Q429 388 465 411T530 480Q557 526 557 565Q557 573 556 579T555 587T555 590Q555 591 568 600T584 611Q588 612 600 603Q622 581 622 549Q622 516 600 475T536 405Q454 350 354 350",
        119984: "55 377Q55 443 122 523T290 660T478 717Q533 717 575 689T618 594Q618 565 611 538T585 477T552 422T506 355T458 288L357 146Q307 68 307 31Q307 20 318 20Q326 20 331 21Q367 27 411 57T490 128L767 500L861 617H908H939Q953 617 956 616T960 609Q960 605 928 566T816 423T648 198Q587 113 571 86Q540 34 540 21Q540 20 545 20Q580 25 623 55T696 124Q702 132 704 133T722 134H739Q744 130 744 127T735 113Q713 80 655 38T548 -14Q527 -17 524 -17Q475 -17 473 47V63L462 55Q364 -17 302 -17Q235 -17 235 69Q235 88 239 105T248 135T268 171T292 205T328 251T369 304Q376 313 395 338T423 374T450 408T476 445T499 479T519 514T534 546T545 579T548 608Q548 647 522 663T460 680Q355 680 243 591T99 406Q97 399 97 383V377Q97 339 153 339Q169 339 175 340Q215 350 241 373T298 444Q333 496 349 535T367 588T374 603Q402 616 408 616Q416 616 416 608Q416 563 393 492T320 378Q233 302 140 302H132Q75 302 57 353Q55 361 55 377",
        119985: "540 717Q542 717 545 717Q562 717 562 710Q562 708 557 702T541 678T517 632T485 544T448 407Q447 405 443 388T438 366T433 345T427 321T420 299T411 274T400 250T387 223T372 197Q363 181 364 181L388 203Q476 284 527 354T620 490T718 612Q754 647 790 673T835 700Q839 700 842 691T848 672L850 662Q850 657 842 653Q803 630 768 600T699 527T653 467T610 405Q554 322 518 282T368 138Q307 84 273 51T231 9T218 -5L207 -17H175Q169 -11 169 -9Q169 -4 183 10Q227 56 258 120T302 234T330 350T356 445Q357 450 360 458L362 464Q317 434 276 434Q221 437 221 479Q221 498 240 521T259 552Q259 565 235 565Q209 565 174 546T105 482Q103 480 102 478T99 474T97 472T95 470T93 468T90 467T86 467T81 467H75Q56 467 56 475Q56 482 82 511T156 570T253 601Q289 601 311 590T334 557Q334 543 312 517T289 478Q289 471 297 471Q327 471 378 514Q384 519 390 531T412 571T451 632Q482 675 524 717H540",
        119986: "232 504Q232 492 263 492Q304 492 356 515L367 520L379 537Q443 632 515 705L527 717H543H552Q564 717 564 709Q564 705 562 703T554 694T540 677T518 643T488 589T448 504T398 385Q368 309 353 281L349 270L523 472L669 634Q726 695 737 706T757 717H765Q786 717 786 710Q786 704 776 691T738 627T675 497Q630 394 609 354T541 244Q456 120 449 111L447 107L448 108Q630 240 700 327Q734 368 788 463Q821 520 841 550T898 619T980 683Q1010 700 1018 700Q1020 700 1023 697T1026 692Q1026 688 1024 671T1020 652Q1018 650 1007 645T988 635Q940 609 902 565T842 477T781 374T699 272Q653 226 535 133Q423 47 373 -2L358 -17H342Q320 -17 320 -11Q320 -7 328 5T354 46T390 112Q416 161 439 217T488 326T564 453L589 490Q587 490 523 414T352 217T166 14Q138 -16 137 -16Q136 -17 120 -17Q106 -17 103 -16T99 -9Q99 -5 100 -3T106 3T116 14T132 35T154 72T184 129T222 212T270 327Q310 426 337 471L326 467Q278 455 243 455Q209 455 188 462T161 478T155 496Q155 508 176 533T198 576Q198 579 198 581T192 588T178 593Q151 593 100 519Q89 504 86 502T75 499H68Q46 499 46 506Q46 510 63 534T112 587T170 627Q178 629 195 629Q235 629 252 613T270 577Q270 556 251 532T232 504",
        119987: "351 351Q308 351 290 373T272 426Q272 487 329 566T478 688Q538 717 584 717Q635 717 681 696T745 620Q752 598 752 564T745 498L741 485Q742 486 769 516T825 573T889 634T962 689T1027 716Q1035 717 1060 717Q1083 716 1096 714T1120 705T1131 686Q1131 668 1109 647T1055 626Q1035 626 1026 638T1016 663Q1016 667 1020 679H1015Q971 671 886 589T728 413L688 360Q688 359 725 359H750Q762 359 766 357T770 348Q769 345 761 335T750 322Q748 321 704 321H660Q651 311 632 282T589 199T565 107Q565 25 653 20Q684 20 720 44T779 95T826 152T850 183L856 184Q861 184 865 184Q888 184 888 173Q883 163 845 117Q770 37 723 10T638 -17Q584 -14 554 17T523 101Q523 147 534 167L532 166Q530 164 526 160T518 153Q378 15 256 -15Q250 -16 226 -16Q161 -16 132 7T103 59Q103 93 129 125T194 158Q232 158 232 121Q233 118 233 113T221 96T188 77Q182 75 168 75T150 78V70Q150 43 178 32T241 20Q340 20 527 286L552 321H524Q489 321 489 330Q489 333 497 344T509 358Q511 359 545 359H579Q580 362 597 389T631 445T661 514T675 586Q675 637 645 658T572 680Q506 680 444 632T348 527T314 434Q314 388 361 388H364H366Q380 388 389 390T416 408T457 454Q487 497 505 536T526 594L529 613Q531 615 545 622T560 630Q568 630 573 613T578 577Q578 518 532 455Q504 413 453 382T351 351",
        119988: "155 280Q116 280 87 300T57 368Q57 409 87 466T192 589Q269 653 345 684T472 716Q572 716 613 675Q644 644 644 599Q644 585 643 574T637 550T629 529T616 505T600 481T578 450T554 416Q494 330 493 328L480 306Q466 278 466 256Q466 227 492 227H496Q514 227 534 234Q541 237 544 241T571 279L762 559Q777 579 792 595Q818 620 856 646T919 686T946 700Q951 700 955 692T959 677Q959 673 947 665T911 639T866 595Q816 538 749 408T640 225Q574 138 464 61T248 -17Q190 -17 144 1T98 62Q98 81 109 102T131 135Q156 156 183 158Q226 158 226 121Q226 111 224 107Q215 93 196 84T162 74Q154 74 147 77H144V70Q146 41 185 31T263 20Q363 20 493 175L507 192H504Q500 191 498 191Q484 189 476 189Q430 189 405 219T379 287Q379 294 379 299T382 311T385 322T391 335T398 347T408 363T420 379T434 399T450 422Q455 429 469 449T488 475T504 499T520 523T533 543T544 565T552 583T557 603T559 620Q559 680 467 680Q402 680 333 646T213 563T131 462T98 373Q98 343 119 330T169 317Q187 317 212 333Q242 354 291 423T352 555Q354 562 355 588Q355 612 356 612Q357 614 371 622T387 630Q391 630 397 623T409 597T415 556Q415 507 380 448T294 344Q216 280 155 280",
        119989: "221 428Q221 487 280 555T425 670T583 717H587Q641 717 665 695T689 646Q689 625 674 600T658 564Q658 550 671 541T695 530T710 528L718 539Q779 613 821 646Q894 707 964 707H970Q1010 707 1025 675Q1032 661 1032 645Q1032 626 1022 607Q1008 579 980 560T897 522Q867 512 836 505T788 496L771 493Q768 493 760 477T736 429T702 370Q700 367 698 363Q696 360 696 359H805Q809 355 809 350Q809 340 791 322Q789 321 728 321H668Q562 179 433 88L419 78L434 73Q505 54 554 54Q609 54 654 82T720 140H752Q758 134 758 132Q758 128 747 113Q711 67 657 32T552 -14Q540 -16 517 -16T480 -15T439 -3T375 27L354 38L338 30Q257 -8 191 -8H184Q154 -8 133 -5T103 1T88 10T83 19T83 29Q83 35 86 44T100 65T127 88T173 105T241 112Q286 112 342 99L360 95L372 105Q434 157 523 270L560 320Q560 321 533 321L507 322Q502 325 502 330Q502 339 521 358Q523 359 556 359H588L669 474L682 491Q676 492 665 494T647 498T632 503T614 510T596 521Q556 547 556 570Q556 585 579 618T603 663Q603 679 568 679Q510 679 452 650T354 581T288 500T262 431Q262 407 280 397T321 387Q331 387 341 390T360 398T376 409T390 423T400 435T409 447L414 454Q457 514 460 562Q460 575 461 576Q461 577 475 586T492 595Q496 595 503 588T514 572Q520 559 520 539Q520 473 452 412T308 351Q269 351 245 370T221 428ZM989 642Q989 667 953 671Q905 671 871 644Q853 632 832 604T799 554T787 531H788Q801 531 842 539T916 561Q989 592 989 642ZM198 29Q230 29 257 36T295 52L306 59Q306 63 259 73Q251 74 209 74Q177 74 158 66T134 48L130 40Q130 29 198 29",
        120068: "22 505Q22 563 94 624T271 685H280Q416 685 443 560Q447 535 447 504Q444 414 405 330L399 319L229 155Q233 154 241 153T253 150T265 145T281 135T301 119T328 93L357 64L402 92Q438 116 473 137L500 154V339Q500 528 495 593V601L559 649Q621 696 624 696L638 686L629 677Q599 650 593 638Q582 614 581 504Q580 490 580 443Q580 314 584 238Q584 235 584 224T584 210T585 199T586 187T588 176T591 164T595 152T601 137T609 121Q630 77 640 77Q661 77 703 101Q704 95 706 90L707 86V84L636 29Q618 15 601 2T574 -19T564 -25L500 121Q499 121 399 48L299 -26Q298 -26 291 -15T272 11T245 42T209 69T165 80Q120 80 58 43L48 37L40 42L32 48L122 117Q196 173 241 211Q319 280 343 327T368 447Q368 535 317 582Q264 633 199 633Q155 633 122 605T86 542Q86 518 133 467T181 387Q181 348 140 309Q113 281 73 260L64 255L50 265L59 273Q112 307 112 345Q112 363 90 387T45 441T22 505",
        120069: "48 506Q48 568 120 629T268 691Q362 691 425 594L431 585L441 594Q478 628 528 657T629 686Q665 686 687 670Q703 658 718 584T753 506Q756 505 763 505Q778 505 804 512L815 516L820 496Q820 494 808 490T774 476T732 454Q720 445 708 437L675 415L640 394L625 383Q626 382 635 382Q652 382 670 379T712 364T754 336T784 289T797 220Q797 172 776 122Q769 106 766 102T745 84Q654 11 619 -8T538 -27Q483 -27 387 10T249 47Q218 47 186 34T133 8T112 -5T104 7T97 21L196 82Q259 120 284 140Q333 181 351 214Q368 251 368 353Q368 588 228 620Q222 621 205 621Q160 621 139 596Q117 569 117 548Q117 526 162 470T208 387Q208 352 179 320T104 264Q88 256 86 256Q83 256 70 266L82 274Q134 309 134 343Q134 352 130 359Q118 377 100 401T72 439T56 470T48 506ZM453 528Q457 496 457 419L458 357L488 367Q554 390 622 425Q673 449 673 453L671 454Q669 456 665 460T657 473T648 498T639 541Q629 597 616 613Q599 633 567 633Q534 633 493 599Q471 577 457 540L453 528ZM713 176Q713 252 661 295T528 339Q512 339 494 336T466 330T455 325Q454 325 452 311T444 270T425 217L420 207L304 118L319 116Q381 111 475 74T602 37Q655 37 684 79T713 176",
        120071: "346 611Q300 611 261 604T194 584T144 555T107 519T82 481T65 443T55 410T50 383T48 367L37 372L27 378V393Q33 524 115 603Q160 648 230 666T365 685Q423 685 434 684Q745 653 745 405Q745 281 694 151L687 133L657 103Q524 -27 470 -27Q456 -27 331 18T157 64Q122 64 84 28Q67 9 57 -6L50 -16L43 -8L35 0Q35 3 46 22T83 74T141 133H154Q208 136 253 161T299 230Q299 259 277 290T232 348T209 392Q209 434 254 479T358 556L368 561L382 550Q382 549 381 548T377 545T371 541Q353 527 326 496T298 444Q298 430 343 365T389 277Q389 240 353 202T267 136L252 127Q304 118 400 83T513 47Q548 47 582 79T635 145Q671 208 671 323Q671 390 651 441T599 524T523 576T436 603T346 611",
        120072: "301 564Q240 564 203 507T165 361Q165 280 190 218T260 119T358 64T474 46Q491 46 499 47L511 48L628 106V80L499 -5Q498 -6 497 -7T494 -10T490 -12T485 -15T478 -17T468 -19T456 -21T439 -22T418 -23T392 -24Q252 -20 169 67T86 315Q86 409 124 491Q128 500 139 508Q211 560 272 591L293 601L325 585L338 594Q374 617 422 639T502 674L532 685Q533 685 540 663T557 614T574 581Q580 575 591 575Q600 575 616 580T634 585V564L623 559Q572 535 532 529L522 527Q491 547 442 627Q442 628 440 627T435 624T428 620Q410 610 405 597T399 559V553Q399 534 409 487Q419 431 427 369L476 400Q526 431 526 432Q531 426 537 420Q565 382 602 359Q611 353 610 352Q609 351 575 332T537 312Q536 312 505 335T463 358Q451 358 439 352T425 337Q394 243 263 223L251 221L243 229L235 236L245 239Q274 247 303 266Q320 277 325 290T330 336Q330 394 315 451T300 531Q300 549 303 561Q303 564 301 564",
        120073: "198 617Q177 617 159 609T128 587T106 557T91 524T82 494T76 472L75 463Q74 463 67 468T59 474Q59 488 63 510T80 564T114 622T170 667T253 686Q272 686 295 680Q330 672 384 645T468 598Q498 580 524 580Q549 580 595 626L612 643V616L599 599Q522 500 482 500Q466 500 435 514L420 521Q388 516 349 486T309 415Q309 396 323 366T352 315T367 294Q367 293 375 301T398 322T429 352L490 410Q537 355 542 332Q542 330 531 315T510 286L499 273Q479 313 449 313Q437 313 419 303T390 282L378 271L394 250Q444 183 470 129Q484 96 484 71Q484 -19 402 -86T223 -153H220Q175 -153 137 -120Q103 -89 103 -8Q103 12 106 40T109 96Q109 132 103 146T72 161Q46 161 16 143L14 154L11 165Q88 219 143 219Q163 219 177 197T192 127Q192 102 186 65T179 4Q179 -60 210 -88T272 -117Q319 -117 362 -75T405 33Q405 72 363 139T278 271T235 368Q235 385 243 404T264 439T292 472T324 500T353 522T374 538L382 543Q382 544 351 562T274 598T198 617",
        120074: "373 560Q373 543 378 509T388 448T394 421Q396 421 416 433T474 474T548 537L538 543Q481 570 452 628L487 659Q521 690 522 690L526 684Q529 677 535 667T551 646T575 625T607 608Q617 606 621 606Q644 606 660 622L664 600L497 455Q495 453 527 453H546Q628 453 665 407L666 406Q710 357 710 297Q710 196 631 109L621 98L577 69Q471 -7 452 -15Q413 -26 370 -26Q239 -26 155 59Q66 148 66 319Q66 442 113 505L191 552Q269 600 270 600H271Q273 600 280 596T293 589T299 586Q300 586 357 623Q413 659 415 659L426 649Q373 604 373 560ZM219 228Q305 262 305 329V343Q305 384 294 434T282 519Q282 562 287 567Q287 569 286 569Q222 556 191 520Q144 464 144 362Q144 213 228 128T420 42Q514 42 568 103T622 255V260Q622 320 578 357Q526 400 453 400Q434 400 410 396L399 394L400 378V372Q400 330 388 301T348 254T305 232T252 217Q245 215 242 214L234 213L226 220L219 228",
        120077: "194 601Q175 601 155 590T121 564T95 533T76 506L69 495Q55 503 55 507Q55 509 60 521Q87 586 132 636T222 686Q251 686 289 660T363 607T422 580Q442 580 466 588T506 604L522 612V591L487 574Q371 517 359 517H357Q332 522 280 561T194 601ZM383 39Q383 96 356 203T329 361Q329 364 329 370T330 378L331 388L339 399Q362 429 394 462T446 513T469 531Q470 531 477 527T484 521L474 509Q411 434 411 379Q411 341 434 223T458 82Q458 1 390 -69T239 -139Q191 -139 162 -123T123 -83T108 -30T101 23T88 64T52 80Q27 80 -4 64L-10 80Q-5 85 13 98T63 128T118 144Q149 144 163 129T179 93T182 38T187 -19Q199 -96 278 -96Q294 -96 309 -91T343 -73T372 -31T383 39",
        120078: "154 37Q219 41 219 142Q219 203 190 302T160 434Q160 445 172 472T209 534T269 602T354 657T460 680H472Q576 680 618 617V599Q618 578 615 555T608 517T602 501Q596 495 587 495Q586 495 586 499Q586 500 586 505T585 513Q567 628 415 628Q384 628 356 621T302 596T260 546T244 466Q244 416 258 377L261 367L276 382Q294 401 317 422T386 471T468 500Q500 500 518 477T544 422T554 386Q555 382 560 376T576 364T601 357Q612 357 623 361Q623 360 621 351T617 340L541 305L465 272Q469 271 476 270T488 266T502 260L512 255L519 242Q533 211 546 157T564 93Q584 53 617 53Q649 53 682 74V54L675 46Q646 17 612 -5T554 -27Q546 -27 538 -23T517 -9T494 28T478 91Q465 172 448 200T378 228Q337 228 289 207L288 196Q288 160 284 138Q283 125 262 98Q185 1 112 -24L102 -27L91 -25Q47 -13 17 31Q17 33 49 69L80 106Q111 37 154 37ZM421 434Q411 436 405 436Q370 436 336 407T275 337L267 325L271 313Q288 257 288 234Q289 234 395 276T502 319Q501 320 499 323T493 330T485 345T475 371Q473 378 468 388T449 416T421 434",
        120079: "251 231Q251 254 206 341T160 468Q160 529 238 605Q313 677 425 685L432 686Q440 686 445 686Q520 686 545 657T571 576Q571 548 568 517T564 480Q564 466 572 460T608 452H623V431L619 430Q618 430 611 428T591 423T566 417L516 404Q497 415 491 419T480 433T475 461Q475 470 477 498T480 546Q480 561 480 569T474 592T459 615T429 631T379 638Q322 638 283 606T239 526Q237 480 280 394Q319 310 320 268V250Q308 235 244 169L203 128H210Q215 128 256 112T357 80T466 64Q526 64 564 88T625 186L629 196Q643 187 644 186Q618 70 604 41Q577 -15 513 -24Q496 -26 476 -26Q418 -26 344 -3T211 45T133 69Q115 69 97 50T65 7T49 -20L45 -16Q41 -11 37 -6T33 0Q33 8 66 69T111 134Q251 156 251 231",
        120080: "687 578Q690 586 719 612T794 665T877 692Q909 692 926 670T953 614T973 570Q983 561 1000 560Q1023 560 1048 569V553L1034 546Q1003 528 972 504T933 466Q905 403 905 264Q905 205 909 172T920 126T940 91Q951 74 959 74T997 87L1027 100V79L956 27Q940 15 922 2T894 -19L885 -26Q883 -26 854 27L825 80V192Q826 314 830 341Q831 345 833 356Q840 398 844 404Q871 444 920 489L917 491Q914 493 911 495T903 501T898 508Q893 516 877 562T852 616Q840 628 818 628Q751 628 702 541L697 532L700 515Q708 467 708 419Q706 348 690 276T662 169T643 126L634 116Q626 105 611 87T581 51L522 -22L514 -15Q470 21 452 21Q431 21 394 -16L384 5L386 9L426 60Q449 87 460 95T486 104Q487 104 491 104T497 103Q514 99 541 81L559 69Q595 96 606 169T618 350Q618 486 598 543T517 601Q484 601 458 570T432 523Q432 516 434 492T436 443Q436 250 369 133L363 122L280 50Q207 -16 192 -27L182 -18Q136 26 106 26Q83 26 62 9T37 -16L27 0L33 10Q41 22 54 39T94 81T143 106Q178 106 225 62L235 53Q283 82 307 117Q352 190 352 359Q352 408 345 451T320 534T267 597T183 621Q159 621 147 617T120 598Q97 574 96 556Q96 528 143 469T191 377T161 311T102 262T70 245Q69 245 59 252T49 260L56 264Q63 268 73 275T94 291T111 312T118 338Q118 355 95 384T50 446T27 506Q31 567 101 626T255 686Q297 686 330 671T382 632T409 595T421 572V571L430 580Q454 610 496 634T588 659H590Q655 659 683 585L687 578",
        120081: "112 334Q112 356 70 410T27 497Q27 553 94 619T229 685Q230 685 236 685T246 686Q303 686 349 654Q373 636 392 607T419 558L426 538L454 576Q474 604 486 618T520 651T569 678T633 686Q668 684 687 673T713 651T730 609Q730 608 732 600T736 588T741 578T747 568T754 561T765 555T779 553Q789 553 817 562Q819 557 819 555V547L790 526Q743 492 730 479T712 447Q697 369 697 281Q697 166 726 108Q741 76 755 68Q759 66 767 66Q789 66 825 93V82Q825 71 822 70Q821 69 763 27T701 -18L692 -25L668 15Q662 25 650 45T635 70L627 85V107Q627 122 626 162T624 285Q624 381 632 398Q638 409 651 425T675 454T696 477T707 489H696Q683 490 679 492T669 507T653 551Q642 588 627 608T584 628Q572 628 560 625T538 616T519 602T502 586T486 568T473 549T463 532T454 517T448 504L445 497Q437 480 437 474Q437 472 439 461T444 421T446 348Q446 205 405 124Q396 105 392 100T368 78Q312 32 278 9T235 -18T214 -22Q191 -22 170 -10T139 12T129 25T160 66T192 105Q193 102 194 98T200 83T213 64T233 49T261 42Q303 42 339 90Q373 134 373 268Q373 397 339 493T235 618Q215 628 191 628Q155 628 126 604T97 548Q97 524 120 493T168 431T192 381Q192 346 164 318T86 260L70 250L54 266L63 272Q112 300 112 334",
        120082: "428 596Q412 596 386 595T350 593Q289 593 270 625Q267 632 267 640Q267 656 280 672T312 705T336 729H343Q351 729 351 728Q342 710 342 703Q342 683 382 676T493 662T604 643Q648 627 677 599T720 535T739 466T744 392Q744 317 732 260T696 166T659 116T621 83Q617 80 615 78Q485 -27 377 -27Q320 -25 272 -9T187 21T122 36H116Q65 36 29 -13L27 -15L12 0Q12 1 32 26T76 78T109 109Q145 123 166 150T187 207Q187 244 134 318T80 412Q80 454 112 498T176 566T213 590Q216 590 224 585L234 580L225 573Q216 566 207 557T188 536T172 511T165 484Q165 448 213 368T261 259Q261 241 252 219T228 179T200 146T176 122L167 112Q170 111 174 111Q188 110 233 91T339 55T453 37Q508 37 556 68T626 152Q655 219 655 328Q655 543 532 582Q484 596 428 596",
        120083: "112 339Q112 354 91 380T49 438T28 497Q28 565 95 628T242 692Q261 692 277 689T307 682T331 670T351 655T367 637T379 619T388 600T395 582T401 565T405 550Q409 554 422 570T453 603T500 641Q573 692 637 692Q656 692 670 686T692 672T705 647T713 618T718 584Q720 568 721 562T728 546T742 534T768 530Q776 531 782 532T791 535T796 536Q799 536 804 521Q801 519 789 513T764 499T738 480Q697 447 680 414Q677 407 677 396Q677 370 713 312T750 210Q750 125 686 57T560 -11Q540 -11 475 13L410 37V31Q410 -9 412 -50T417 -118T420 -150Q419 -150 373 -184T326 -218L305 -208Q305 -207 307 -196T314 -165T322 -116T328 -46T331 43V63L318 66Q270 80 250 80Q233 80 213 70Q183 57 138 -3L128 -16L118 5L125 20Q193 154 282 154Q309 154 331 146V287Q331 444 327 469Q321 522 301 560Q284 590 251 611T184 633Q146 633 119 607T92 550Q92 539 94 534Q100 516 143 460T186 386Q186 366 170 336T119 281Q102 264 70 250L49 260L56 266Q64 271 72 278T90 296T106 317T112 339ZM602 345Q602 357 608 371T622 397T642 421T661 441T678 456L686 462Q663 473 652 486T639 512T634 553Q631 594 624 608T593 631Q587 632 567 632Q539 632 497 600T416 497L410 484V122L467 103Q481 99 502 92T533 82T557 75T578 69T594 66T610 64Q647 64 672 87T697 144Q697 180 650 250T602 345",
        120084: "428 596Q412 596 386 595T350 593Q313 593 291 605T268 638Q268 644 269 648T274 658T284 669T301 689T326 718L336 729H343Q351 729 351 728Q342 710 342 703Q342 683 382 676T493 662T604 643Q744 592 744 398Q744 299 708 213T646 104L603 68L614 55Q670 -5 710 -5Q726 -5 744 1T772 14L781 20Q782 20 782 7V-6L771 -13Q673 -69 665 -69L647 -63Q552 -30 514 8H512Q509 8 500 3T471 -9T428 -23Q405 -27 377 -27Q305 -24 228 6T124 36Q69 36 27 -16Q23 -13 19 -8L11 0L27 20Q93 102 109 109Q145 123 166 150T187 207Q187 244 134 318T80 412Q80 454 112 498T176 566T213 590Q216 590 224 585L234 580L225 573Q216 566 207 557T188 536T172 511T165 484Q165 448 213 368T261 259Q261 241 252 219T228 179T200 146T176 122L167 112Q170 111 174 111Q188 110 233 91T339 55T453 37Q508 37 556 68T626 152Q655 219 655 328Q655 543 532 582Q484 596 428 596",
        120086: "750 276Q750 141 645 57T378 -27Q224 -27 146 67Q66 163 66 307Q66 361 80 412T127 515T217 609T356 676L388 684L420 692L442 681Q545 625 586 608T654 591Q688 591 710 609T737 646L742 665Q742 665 756 654L752 642Q736 594 706 566T621 515L607 510Q580 513 528 542T421 599T335 627Q272 627 214 569Q139 500 139 373Q139 308 159 247T217 136T316 56T455 26Q520 26 566 43T634 90T666 148T676 207Q676 264 649 297T580 338Q574 339 552 339Q516 339 442 325T327 310H324Q303 310 290 312T259 328T232 369Q230 375 230 390Q230 426 259 461Q286 488 338 507Q351 498 351 495L346 492Q342 490 339 488T330 482T320 473T312 462T305 447T303 428Q303 368 366 368Q393 368 487 388T613 409Q656 409 696 385T748 306Q750 294 750 276",
        120087: "289 686Q338 686 439 668T565 649Q606 649 641 672Q656 683 664 690T674 700L675 701Q676 698 676 692V681L641 636Q608 591 602 588Q577 575 528 575Q490 575 438 583L426 585L416 578Q335 520 335 465Q335 437 393 366T452 259Q452 226 406 171Q387 146 351 115L341 106L358 97Q438 58 475 58Q525 58 598 124L608 133Q617 119 617 118Q617 114 606 103Q513 0 448 -27L438 -25Q401 -19 337 14T234 48Q186 48 122 -3L112 -11L106 -3L101 5L110 15Q160 63 209 105L224 117H310Q384 163 384 210Q384 238 329 303T263 398Q262 400 262 404Q262 427 290 476T368 580Q383 596 381 596Q315 622 228 622Q159 622 118 593T76 516Q76 482 96 461T139 431L107 399L75 367Q34 403 34 472Q34 525 64 572T148 652Q207 686 289 686",
        120088: "160 247Q160 291 110 382T59 505Q59 542 106 597T207 690L218 697L229 682Q229 680 216 669T187 644T158 604T144 552Q144 526 165 482T207 387T228 291Q228 277 228 267T224 247T219 232T210 217T199 202T184 184T166 163L118 107Q124 105 132 105T160 98T220 77Q298 47 317 47Q354 47 409 105Q444 142 451 161T458 244V277Q458 339 455 457T447 596L575 686L591 676L583 668Q550 632 541 587T532 449V372V298Q532 198 550 147Q572 79 605 79Q617 79 631 84T656 95L665 100V79L595 27Q578 15 560 2T532 -19L523 -26Q522 -26 490 42L458 111L397 50Q389 42 374 27T355 8T340 -5T325 -16T311 -22T294 -26T274 -27Q232 -25 152 6T35 37Q28 36 19 30T4 18T-8 4T-16 -5Q-25 10 -25 11T-20 18Q-5 34 15 57L54 101Q70 103 86 116Q94 121 113 140T137 166Q160 201 160 247",
        120089: "54 266Q118 307 118 339Q118 360 74 413T27 493Q26 530 59 578T133 651Q187 686 256 686Q299 686 332 673T382 640T409 600T424 567T429 553Q431 553 463 586T542 653T624 686Q663 686 715 652T798 617Q812 617 825 622V606L815 599Q785 576 762 546Q724 495 724 432Q724 397 737 317T750 217Q750 148 711 96Q697 75 639 34T578 -10Q563 -21 555 -23T522 -26Q458 -26 363 29Q253 89 211 89Q192 89 173 83T139 67T114 49T96 34L90 27L80 43L95 59Q121 87 148 110T191 143T213 154Q261 154 300 195Q328 222 340 267T352 406Q352 562 255 611Q222 627 187 627H182Q143 627 115 598Q96 579 96 559Q96 528 144 470T192 381Q192 348 156 314T80 256L70 250L54 266ZM727 548Q701 550 650 583T567 617Q560 617 554 615Q532 610 501 580T445 501L437 485V465Q432 326 378 223L294 150Q321 143 421 87T560 31Q608 31 634 64Q660 102 660 198Q660 226 655 292T650 387Q650 418 658 452L660 462L735 548H727ZM264 150Q265 151 263 151H261Q261 150 264 150ZM280 150H276V149Q280 149 280 150",
        120090: "32 501Q35 564 103 625T264 686Q326 686 365 652Q402 618 420 564L441 585Q486 630 539 670L559 686L572 672Q637 606 665 559L682 576Q787 686 845 686Q877 686 929 656T992 623Q999 621 1016 621Q1041 621 1054 628L1051 617L1047 606Q1042 602 1037 597Q983 557 969 522T954 434Q954 394 961 336T968 221Q968 201 966 184T963 155T956 131T948 113T936 96T923 82T906 66T887 50L816 -2Q815 -3 810 -6T801 -11T791 -16T777 -20T759 -23T735 -25Q691 -25 619 4T505 37H496L463 21Q420 0 389 -20L378 -27H362Q316 -27 275 -9T202 28T150 46H146Q114 46 59 -5L48 -16L41 -6Q40 -4 38 -2T34 2L33 4Q33 8 77 54Q111 87 142 112L154 122H166Q239 127 288 182Q346 244 346 406Q346 489 326 537T259 610Q227 628 195 628Q155 628 128 606T101 549Q101 517 146 465T192 382Q192 348 156 310T85 254L75 250L64 258L55 266Q56 267 74 276T105 301T118 339Q118 362 75 413T32 501ZM952 547Q927 555 877 586T796 617Q744 617 682 525L676 516L677 498Q678 486 678 425Q678 301 652 206Q649 195 613 151T577 102Q577 100 582 100Q618 100 720 51Q761 32 790 32H794Q843 32 869 83Q884 110 884 189Q884 233 879 294T873 400Q874 433 879 451T889 478T915 507T952 547ZM241 105Q249 98 263 88T317 60T393 42Q478 42 547 109Q607 171 607 358Q607 371 607 380T604 417T595 467T577 517T546 566T500 601L479 580Q449 550 433 526L426 516V503Q426 311 357 200L352 191L296 149Q241 107 241 105",
        120091: "96 511L78 527L149 603Q207 666 227 686L237 685Q278 680 306 667T351 631T376 588T395 533L400 516L406 527Q439 600 523 653Q538 664 587 688Q589 688 596 672T613 635T629 606Q643 588 665 588Q677 588 693 596L709 603V585L607 526Q583 536 554 564T512 614Q461 571 435 507T405 381V367H581L563 347Q561 344 558 341T553 335T549 330T546 326L545 325H541Q537 325 488 329T411 334H405V325Q405 198 454 123Q497 54 568 54Q594 54 619 64T660 84L676 95V74L565 -16L553 -20Q528 -27 512 -27Q492 -27 475 -21T444 -5T418 19T398 47T382 77T371 105T363 128T358 145L357 151Q354 151 339 136T294 91T232 37Q152 -22 113 -22Q90 -22 69 -9T38 17T28 32Q28 33 58 68L86 101Q94 81 115 64T165 47Q206 47 249 84Q302 128 325 222Q334 263 336 312V334H312Q198 334 163 324H161Q162 326 182 348L198 367H336V398Q333 508 308 550Q295 570 274 585T227 601Q204 601 181 589T145 565T115 533T96 511",
        120092: "123 345Q123 358 75 415T27 496Q27 533 63 578T121 639Q181 685 256 685Q305 685 332 676T384 635Q419 588 425 542Q468 585 526 628T618 686Q632 667 658 645T704 609T724 594Q740 512 740 385V375V361Q740 128 682 -3Q656 -64 554 -141T361 -218Q319 -218 287 -203T243 -173T230 -150Q230 -148 267 -109L304 -69Q311 -115 341 -142T411 -170Q474 -170 534 -119T624 11Q660 111 660 312Q660 447 633 528L612 549Q578 583 552 596L543 601L528 592Q501 574 483 558Q454 528 436 494L431 484V473Q431 330 376 230Q366 213 359 206T306 159L250 112Q278 105 327 82T399 58Q421 58 440 69T471 92T484 104H485L493 90L480 73Q453 39 429 13Q393 -22 372 -22Q342 -22 260 15T153 53Q97 53 48 -16L38 5Q46 22 74 54T128 108L143 122H155Q226 127 275 168Q352 236 352 399Q352 501 309 564T197 628Q156 628 129 607T102 553Q102 517 147 463T192 383Q192 323 75 250L59 266Q123 314 123 345",
        120094: "86 363Q86 365 128 391T212 444L255 470Q256 470 263 465T283 453T308 442Q338 431 346 431Q350 431 358 436L414 465L421 459L418 434Q404 339 404 262Q404 147 408 119L425 97Q443 74 444 74L467 86L491 97Q492 97 497 83L436 28Q377 -26 374 -26L331 46L329 91L155 -35Q152 -35 114 10T68 65L67 86Q66 100 66 156Q66 177 66 198T68 236T71 268T74 296T77 320T80 338T83 351T86 360V363ZM314 365Q285 367 255 374T206 386L187 392Q181 392 172 376T154 311T145 197Q145 124 151 118Q156 110 187 78L208 56H214Q221 57 253 76L308 109L329 123V136Q328 143 328 257V365H314",
        120095: "177 427Q177 364 181 364Q184 364 192 370T223 395T271 433Q317 469 323 469Q325 469 338 462T377 440T432 413L440 409L441 396Q441 394 441 372T442 334Q442 203 425 108L423 97L400 83Q347 49 296 21T222 -19T196 -31Q192 -29 149 12T87 71L89 89Q100 155 100 319Q100 500 94 627Q94 632 94 638T94 648T94 656T93 662V664Q93 668 97 669T106 670H110Q114 653 118 633L127 596Q127 595 132 597Q136 599 195 642L255 685L272 673Q269 670 256 659T233 637T211 609T190 565T179 508Q177 494 177 427ZM295 377L274 385Q273 385 264 381T242 370T223 361Q213 355 188 340L178 333V123L198 103Q259 42 285 42Q299 42 314 55T339 85Q363 132 363 232Q363 310 358 343V349L345 355Q330 363 295 377",
        120096: "72 208Q72 323 84 361Q84 363 167 414Q248 466 250 466Q255 465 260 465Q283 460 307 450T344 430L357 422L306 343L301 342L296 340Q267 362 247 372T216 384T177 390Q154 349 154 238Q154 220 156 158V145L168 132Q179 121 208 93T244 59Q245 58 246 58Q255 58 302 83T350 108L352 104Q355 100 356 96L358 92Q358 91 274 32T187 -29L177 -20Q160 -6 120 36T77 84Q77 87 75 118T72 208",
        120097: "13 542Q13 544 77 576T147 609Q154 609 185 598T283 551T414 464L427 454V440Q427 436 427 412T428 372Q428 315 426 270T418 197T409 152T400 121T394 103L304 35Q285 21 261 2T225 -25L214 -33Q149 7 97 59L76 80L75 91V171Q75 221 76 254T79 299T80 313Q80 315 78 321Q78 323 78 326L77 330Q79 336 132 384T211 447L219 445Q221 445 224 444L228 443Q229 443 228 441T221 432T206 415L191 395Q175 378 162 339Q152 306 152 250Q152 217 159 140V134L171 121Q194 99 235 74T284 48Q296 48 310 75T337 156T349 267Q349 346 336 400L315 420Q246 489 176 525Q127 545 94 545H73L27 527L13 542",
        120098: "353 103Q353 97 358 87L337 71Q293 38 247 6Q191 -30 189 -30Q188 -30 173 -16T130 26T76 85L74 99Q70 139 70 190Q70 228 73 271T79 338T84 365L94 372Q105 378 126 392T166 417L246 467Q283 417 349 369L364 358L355 349Q249 249 169 180L151 166L152 152V139L165 126Q186 105 215 84T260 62Q267 62 309 82L353 103ZM267 323Q246 337 230 350T204 371T189 385T179 394T174 397Q149 381 149 219V211Q151 211 171 223T220 258T268 299L282 313L267 323",
        120099: "128 387Q128 391 112 456T92 546V555L101 568Q133 617 183 670L193 681L204 673Q238 648 262 648Q276 648 292 656L302 661L308 653Q308 652 278 618L249 585H234Q194 587 159 595Q158 595 156 596H153L150 597Q151 593 152 581T154 564T157 547T164 524T176 494Q199 436 203 400V392H207L323 386Q323 384 309 368L296 351H203V176Q201 -9 198 -32Q194 -61 166 -114Q158 -129 153 -138Q114 -214 110 -221Q105 -221 98 -220L87 -219V-216Q88 -215 106 -150T124 -82Q128 -73 129 155V351H30L64 386H96Q128 386 128 387",
        120100: "27 -144L17 -131L82 -75L146 -20L126 6Q99 37 92 48L78 65L77 79Q75 103 75 158Q75 217 78 268T86 343T91 368Q92 370 109 382T157 413T222 452Q240 465 249 469L251 470Q296 443 350 428L365 424L437 465L442 459Q442 456 441 453T437 444T432 424T427 385T423 317T421 215V133L423 119Q423 111 455 -17Q455 -21 380 -108T290 -201Q290 -202 284 -204T269 -207T252 -209Q172 -209 75 -135L62 -126Q60 -126 44 -135L27 -144ZM349 351Q267 359 178 389Q177 387 173 376T166 358T161 337T157 303T155 259Q155 195 159 135L160 124L170 112Q180 101 204 77T230 53Q231 53 286 88L340 123V141Q340 235 348 329Q348 334 348 339T348 348L349 351ZM364 -59Q364 -37 358 -1T347 64T341 93Q336 93 252 28T149 -57Q226 -134 293 -134Q325 -134 344 -118T364 -69V-59",
        120101: "88 427Q88 486 87 545T84 634T81 667Q81 673 82 673T89 676H94L117 600L200 661Q208 667 218 674T233 684L238 688L254 678Q222 646 216 637Q164 572 164 483V442V371Q187 390 244 431T312 478Q344 446 411 423L428 417L429 396Q434 297 434 218Q430 8 406 -34Q346 -111 262 -195L251 -205L249 -203Q248 -203 244 -199T236 -193Q226 -183 227 -182Q228 -182 244 -169T278 -140T301 -121Q330 -89 340 -22Q355 60 355 171Q355 200 353 244T348 321T344 354Q333 363 307 376T260 390Q241 390 179 350L164 341V121Q180 96 201 66L213 50Q210 46 172 11T131 -24Q130 -24 123 -11T102 25T77 65V78Q80 104 84 227T88 427",
        120102: "72 617Q72 618 102 645T133 673H134Q134 668 175 627L187 615L130 555L116 568Q72 615 72 617ZM27 369Q21 376 14 382L26 392Q83 440 119 474Q158 435 169 427L179 420L176 395Q166 302 166 227Q166 171 174 139Q178 119 186 103T202 81L208 75Q255 100 261 100Q262 100 264 92T267 83Q267 80 208 30T145 -20Q143 -20 118 17L91 55Q98 117 98 193Q98 339 88 369Q71 390 68 390Q63 390 39 376L27 369",
        120103: "101 644L132 672L145 657Q155 642 169 628L182 614L169 600Q148 579 140 570L125 555L112 568Q109 570 91 592T72 615Q72 617 101 644ZM19 -208Q-9 -185 -9 -183Q57 -134 80 -106Q103 -81 110 -19T118 179Q118 294 113 329T86 383Q78 389 76 389Q73 389 57 379L39 367Q26 380 26 381L33 387Q40 393 53 405T79 428L130 474Q147 457 186 428L195 422L196 376Q196 130 192 58T174 -35Q172 -39 104 -114T19 -208",
        120104: "93 348Q93 379 90 503T87 658V670Q87 671 94 671L100 672L112 636Q124 603 124 600L144 616Q196 659 234 682L246 689Q252 686 256 685T268 680L254 667Q225 641 211 626T184 579T168 505V497L178 504Q203 523 237 544L300 584L310 573Q359 522 359 481Q359 476 359 472T358 464T355 456T351 448T346 440T340 433T332 424T323 414T312 402T299 389L255 343L300 342H346L320 309H177V128L193 113Q214 92 244 68L254 60L303 84Q351 108 352 108L362 96Q355 85 277 30T194 -25L170 -4Q146 18 120 41T89 68Q94 85 94 168Q94 184 94 218T93 268V309H58L24 310L51 342H93V348ZM172 342Q217 342 252 374T287 445Q287 472 255 504Q242 517 241 517Q202 498 187 468T168 365V342H172",
        120105: "221 76L267 99Q268 98 269 96T271 88T270 82L262 76Q255 69 241 57T214 34L148 -20L98 56L99 89Q107 247 107 373Q107 494 101 621Q101 653 99 659V665L106 668L113 672L118 655Q122 642 131 617L138 597Q140 597 157 611L240 670L264 685Q265 685 270 680T276 674T269 667T247 647T219 617Q197 587 186 551T173 493T171 438Q171 376 175 282T179 147V117Q184 109 201 93T221 76",
        120106: "20 367L8 379Q9 380 63 425T118 471Q130 460 143 446L168 421V398L169 376L295 475Q362 433 415 418V399Q415 380 416 380T437 394T484 428T529 462L544 474L556 467Q590 449 614 438T646 424L653 421L665 417L664 412Q664 411 664 407T664 397T663 384Q660 342 660 335Q658 303 658 245Q658 186 660 152L661 126L669 115Q680 96 697 79L707 83Q716 87 723 90T735 96T741 100T746 102L747 103V102L750 95Q753 88 753 87L631 -18Q630 -17 622 -3T589 43L576 60L579 72Q592 146 592 218Q592 265 584 321Q581 345 578 350T560 363Q535 376 496 386L481 390Q475 387 425 358L415 351V238V157Q415 142 415 135T417 120T421 110T430 98T441 81L465 47Q462 44 458 41T443 28T420 8L380 -26L333 47L336 62Q339 77 342 109T345 184Q345 223 341 285T333 348Q322 364 258 382L240 388L169 347L168 240Q168 118 171 110L174 106Q178 101 183 93T195 78L217 48Q217 47 196 30T154 -5T133 -21L130 -16Q127 -10 122 0T111 19Q89 56 89 60Q95 76 95 153Q95 239 88 337V365L62 391L20 367",
        120107: "31 368Q20 379 20 380T72 427L121 470L129 463Q137 455 155 441T176 425V367L320 475L329 469Q351 454 385 437T434 417L432 402Q429 362 429 231V128L439 111Q442 107 445 102T449 95T453 90T456 86T459 84T463 82T467 82Q468 82 489 93T511 105T514 95V88L395 -18L340 65L341 77Q347 111 348 178Q348 343 343 353V358L332 363Q298 377 264 382Q260 382 254 382L249 383Q247 383 211 362L176 341V229V147Q176 134 176 127T177 115T179 106T183 99T189 91T197 81Q201 76 206 69T214 57L217 53Q217 52 175 15T132 -22Q132 -20 114 5T88 41Q84 45 84 50Q94 116 94 203Q94 227 93 263T92 324L90 364L67 388L50 378Q32 368 31 368",
        120108: "67 121Q70 265 84 359V364L97 371Q137 394 177 421T238 464T260 480L278 468Q295 457 327 442T394 418L406 414Q412 388 412 300Q412 263 410 228T405 170T399 130T393 103T391 92L381 86Q274 19 165 -28L161 -24Q157 -21 151 -15T136 -2T118 14T101 30T86 46T74 60L67 68V121ZM335 278Q335 286 335 303T334 335L333 349V356H326Q288 360 208 388L183 397Q178 393 172 383T154 333T142 239Q142 192 151 134Q152 124 155 120T175 99Q197 77 219 64T251 47T267 44T281 52T302 80T320 124Q335 182 335 278",
        120109: "23 25Q15 33 12 38L35 59Q82 102 87 105V351L68 378Q42 414 42 422Q42 437 67 472T114 530L125 541Q126 541 132 537T138 532Q121 507 121 488Q121 453 160 413L167 405L166 390L165 372Q169 372 233 421T305 478Q307 479 315 472Q395 421 423 415Q424 415 424 415T425 414L426 410Q426 407 426 401T426 388Q430 335 430 272Q430 139 408 80Q407 78 340 22L273 -33Q200 23 165 23Q164 23 164 -32Q165 -89 168 -155V-170L93 -212L78 -203Q85 -48 87 16V47H79Q53 44 23 25ZM319 41Q346 94 349 212Q349 278 343 343V351L330 357Q318 363 270 381L255 387L245 383Q212 370 178 345L166 336V287Q165 260 165 166V94H175Q219 90 299 51L319 41ZM132 57L129 60Q130 58 132 57ZM158 29Q159 29 155 34T145 45T138 50Q155 29 158 29",
        120110: "399 19Q399 -123 407 -174V-179L332 -219L322 -210L312 -202L314 -185Q320 -83 323 54V95L311 85Q255 40 162 -19Q146 -29 145 -27Q140 -22 103 20L63 65V73Q61 83 61 115Q61 122 61 135T60 154Q60 263 79 353L83 368L94 375Q123 391 147 405T186 429T212 446T229 458T238 466T243 470T247 471L260 464Q274 457 295 448T330 434L341 432L410 479L412 478Q414 476 416 475T419 473L417 461Q399 358 399 19ZM316 367Q287 370 252 377T196 391L176 397H175Q173 397 166 382T149 314T139 187V158Q139 138 141 132T155 114Q158 111 160 109Q210 58 211 58L218 62Q226 67 240 75T266 91L319 124V196Q319 334 325 361V367H316",
        120111: "357 398Q364 398 375 403L386 408Q386 404 387 400V393L369 377Q361 370 350 360T336 347T327 340T316 336T303 335Q270 335 234 371L224 379Q220 375 214 370T198 355L182 340V243Q182 164 183 152T189 129Q195 117 211 100T239 72T254 60T298 81Q342 101 343 101Q344 100 345 92T346 82L200 -21Q174 -5 117 55L97 75L99 92Q106 147 106 196Q106 216 104 282T97 355Q95 359 95 361Q95 364 77 378L65 387L48 380Q30 372 29 372Q28 371 23 375T17 380Q17 384 50 415T107 467L115 474L128 461Q171 421 182 414V382L235 425Q247 435 261 446T283 462L290 468L295 460Q335 398 357 398",
        120112: "272 33Q284 33 290 70T296 138Q296 181 290 198T262 230Q257 232 246 232Q231 232 218 227T156 194L108 167L101 176Q90 192 75 219L69 230V284Q69 346 70 357V377L146 427Q181 450 202 464T223 477L225 476Q227 475 229 474Q231 472 242 466T270 450T296 431Q309 418 326 418Q342 418 361 429T392 450T403 459Q406 445 406 442Q406 440 384 421T338 382L316 363Q315 362 310 362Q292 362 251 371T173 396Q156 403 155 403Q143 386 143 342Q143 305 150 278T168 244Q171 242 181 242L190 243L315 300Q330 295 357 274Q358 273 362 270T366 266T369 261T372 253T373 239T374 217T374 185Q374 157 372 133T368 98T363 71T358 50L336 40Q288 20 255 2T211 -22T198 -29L190 -22Q181 -14 168 -3T138 19T104 38T70 46Q50 46 32 37T3 20T-9 11L-18 23L-1 41Q46 89 62 99T112 110Q141 110 157 103T225 62Q268 33 272 33",
        120113: "228 640L242 627L227 613Q213 599 211 593T203 553Q197 500 196 435V389H301L272 353H195V274Q195 178 196 159L197 123Q249 71 273 68H280L312 83Q344 99 345 99Q348 99 348 78Q348 76 314 52T246 4L212 -20Q211 -20 164 19T112 62Q112 122 113 196Q113 228 113 262T114 318T114 341V353H27L62 389H116L117 431V558L228 640",
        120114: "171 315Q171 252 165 199T153 124L147 103Q147 102 196 80L244 57L335 107V116Q339 161 339 268Q339 315 338 351T337 412V424L420 468Q424 465 427 461L424 435Q412 331 412 226Q412 170 415 145T434 96Q442 84 452 83Q461 83 492 96L506 102Q507 102 510 96T513 88L493 71Q445 32 401 -9Q392 -18 388 -17L384 -16Q358 39 355 44Q336 77 333 77Q261 45 203 -9Q186 -23 181 -23Q177 -23 162 -11T121 18T69 44L57 48L61 54Q65 60 71 73T82 102Q100 156 100 262Q100 305 93 335T80 373T62 396L23 376Q18 377 9 386L119 474Q149 437 171 421V339V315",
        120115: "55 418Q55 443 100 503Q121 530 123 530Q125 528 127 528T131 528T134 528T135 524T131 516Q123 499 123 486Q123 457 159 416L169 405L170 388L171 372Q171 371 244 424L317 477L334 466Q394 428 432 416L433 402Q433 400 433 377T434 336V305Q434 195 420 131Q413 94 406 87Q403 84 298 29L192 -28L172 -8Q139 25 106 52L92 64V70Q95 97 95 198Q95 293 94 318L92 355L84 367Q55 406 55 418ZM174 306Q174 297 173 255T171 184Q171 153 175 136T198 100Q207 94 224 80T255 57T282 49Q304 49 328 80Q359 129 359 243Q359 284 352 345Q351 358 348 360Q333 373 304 384T265 396L251 390Q215 372 186 351L175 344V337Q175 319 174 306",
        120116: "45 425Q45 439 82 485T126 532Q127 532 128 532T131 531T137 529L132 519Q121 499 121 483Q121 473 131 454T156 419L167 408L169 376L185 388Q237 425 291 473L301 466Q337 443 394 416L419 405L418 387V369Q419 369 487 418T560 471L581 459Q597 450 621 437T664 415T684 406Q688 406 688 323Q688 254 679 193T662 103T648 71Q647 70 554 20L464 -28L443 -15Q416 1 386 17T343 40T331 49Q331 52 333 73T337 133T339 216Q339 309 334 339Q333 341 316 353T277 377T246 389Q235 389 201 369T166 346Q166 345 164 247Q164 232 164 210T163 179Q163 139 170 116T205 57L212 48L136 -27Q115 16 87 44L78 53L80 67Q88 124 88 211Q88 282 87 315T83 356T74 371Q45 410 45 425ZM591 352Q580 359 565 365T540 374T517 381T504 385L418 342L417 318V220Q417 212 417 194T417 170T418 152T420 134T424 120T431 106T440 95T454 83Q508 44 544 44Q566 44 583 77Q603 120 605 235Q605 289 600 322Q598 343 597 345T591 352",
        120117: "14 377Q63 428 117 472Q130 462 144 449L193 408V392V376L247 420Q300 464 301 464L310 451Q331 417 363 390L333 365Q303 340 301 340Q293 343 277 364T250 386Q241 386 215 361L195 341Q194 333 193 327T191 318T190 304T188 269Q188 220 192 148Q193 122 195 118T210 101Q255 60 271 60Q276 60 278 61L318 82Q327 86 336 91T351 98L356 101Q359 82 356 79Q354 77 283 27T210 -24L192 -7Q160 23 137 40L126 49L116 40Q66 -13 66 -54Q66 -117 167 -140L179 -142V-147L180 -152L123 -188L112 -185Q58 -170 31 -145Q10 -122 10 -96Q10 -80 22 -53Q44 -10 95 49Q97 51 100 54T104 59T107 64T109 71T111 81T112 97T113 119T114 149T114 188Q114 284 108 347V354L96 365Q76 385 67 385Q62 385 45 377L27 368L14 377",
        120118: "74 58Q89 124 89 241Q89 265 89 278T89 305T88 324T87 336T84 346T81 352T77 359T71 368Q57 388 52 398L45 409Q62 454 98 507L113 528Q128 528 128 524Q128 523 125 518T120 503T117 483V471Q123 456 130 445Q135 438 140 432T148 422T153 415T157 409T160 405T162 402T163 399T163 395V384V365Q165 365 237 419L311 473Q383 430 420 416Q426 414 426 411V404Q426 398 426 388T427 367Q431 233 431 201Q431 -3 391 -52Q387 -58 305 -138T221 -218L218 -217Q216 -216 211 -214T202 -210L184 -202L199 -194Q259 -162 288 -127T334 -19T350 184Q350 257 342 328L340 356Q282 390 262 390Q248 390 178 346L163 336V111L216 45L131 -26L124 -15Q114 3 85 44L74 58",
        120119: "47 335L36 347L52 362Q112 421 167 461L181 471L192 465Q236 444 260 417T284 369Q284 355 276 343T233 291Q195 246 195 245T205 242T241 228T300 198L302 187Q314 138 314 74Q314 -24 291 -95Q290 -100 222 -157L154 -214H145Q102 -214 53 -189T-7 -117Q41 -21 183 122L207 147Q205 149 186 157T140 172T100 180H97V192L140 231Q192 280 199 293Q205 303 205 315Q205 339 185 363T137 388Q119 388 63 347L47 335ZM179 -153Q212 -153 226 -113T240 14Q240 67 233 98T223 132T211 143L222 130Q216 125 206 116T170 82T124 33T88 -20T72 -70Q72 -99 105 -126T179 -153",
        120120: "130 -1H63Q34 -1 26 2T17 17Q17 24 22 29T35 35Q49 35 64 44T88 66Q101 93 210 383Q331 693 335 697T346 701T357 697Q358 696 493 399Q621 104 633 83Q656 35 686 35Q693 35 698 30T703 17Q703 5 693 2T643 -1H541Q388 -1 386 1Q378 6 378 16Q378 24 383 29T397 35Q412 35 434 45T456 65Q456 93 428 170L419 197H197L195 179Q184 134 184 97Q184 82 186 71T190 55T198 45T205 39T214 36L219 35Q241 31 241 17Q241 5 233 2T196 -1H130ZM493 68Q493 51 481 35H619Q604 56 515 256Q486 321 468 361L348 637Q347 637 330 592T313 543Q313 538 358 436T448 219T493 68ZM404 235Q404 239 355 355T295 488L275 430Q241 348 208 232H306Q404 232 404 235ZM155 48Q151 55 148 88V117L135 86Q118 47 117 46L110 37L135 35H159Q157 41 155 48",
        120121: "11 665Q11 672 22 683H213Q407 681 431 677Q582 649 582 515Q582 488 573 468Q554 413 484 372L474 366H475Q620 317 620 178Q620 115 568 69T420 6Q393 1 207 -1H22Q11 10 11 18Q11 35 51 35Q79 37 88 39T102 52Q107 70 107 341T102 630Q97 640 88 643T51 648H46Q11 648 11 665ZM142 341Q142 129 141 88T134 37Q133 36 133 35H240L233 48L229 61V623L233 635L240 648H133L138 639Q142 621 142 341ZM284 370Q365 378 391 411T417 508Q417 551 406 581T378 624T347 643T320 648Q298 648 278 635Q267 628 266 611T264 492V370H284ZM546 515Q546 551 531 577T494 617T454 635T422 641L411 643L420 630Q439 604 445 579T452 510V504Q452 481 451 467T441 430T415 383Q420 383 439 391T483 413T527 455T546 515ZM585 185Q585 221 570 249T534 294T490 320T453 334T436 337L435 336L440 330Q445 325 452 315T467 288T479 246T484 188Q484 145 474 110T454 62T442 48Q442 47 444 47Q450 47 470 54T517 75T564 119T585 185ZM449 184Q449 316 358 332Q355 332 335 333T302 335H264V199Q266 68 270 57Q275 50 289 43Q300 37 324 37Q449 37 449 184",
        120123: "16 666Q16 675 28 683H193Q329 683 364 682T430 672Q534 650 600 585T686 423Q688 406 688 352Q688 274 673 226Q641 130 565 72T381 1Q368 -1 195 -1H28Q16 5 16 16Q16 35 53 35Q68 36 75 37T87 42T95 52Q98 61 98 341T95 630Q91 640 83 643T53 648Q16 648 16 666ZM237 646Q237 648 184 648H128Q128 647 133 632Q136 620 136 341Q136 64 133 50L128 35H237L230 48L226 61V343Q228 620 231 633Q232 636 237 646ZM264 61Q278 40 310 35Q363 35 401 55T461 112T496 193T513 295Q515 333 515 349Q515 411 504 459Q481 598 373 641Q351 648 321 648Q304 648 292 643T277 635T264 621V61ZM461 628Q462 627 471 616T489 594T509 559T529 509T544 441T550 352Q550 165 479 75L468 59Q474 61 484 65T522 87T573 128T618 195T650 290Q654 322 654 354Q654 418 638 464T581 552Q559 576 529 595T480 621L461 628",
        120124: "12 666Q12 675 24 683H582Q590 680 593 672V588Q593 514 591 502T575 490Q567 490 563 495T555 517Q552 556 517 590Q486 623 445 634T340 648H282Q266 636 264 620T260 492V370H277Q329 375 358 391T404 439Q420 480 420 506Q420 529 436 529Q445 529 451 521Q455 517 455 361Q455 333 455 298T456 253Q456 217 453 207T437 197Q420 196 420 217Q420 240 406 270Q377 328 284 335H260V201Q261 174 261 134Q262 73 264 61T278 38Q281 36 282 35H331Q400 35 449 50Q571 93 602 179Q605 203 622 203Q629 203 634 197T640 183Q638 181 624 95T604 3L600 -1H24Q12 5 12 16Q12 35 51 35Q92 38 97 52Q102 60 102 341T97 632Q91 645 51 648Q12 648 12 666ZM137 341Q137 131 136 89T130 37Q129 36 129 35H235Q233 41 231 48L226 61V623L231 635L235 648H129Q132 641 133 638T135 603T137 517T137 341ZM557 603V648H504Q504 646 515 639Q527 634 542 619L557 603ZM420 317V397L406 383Q394 370 380 363L366 355Q373 350 382 346Q400 333 409 328L420 317ZM582 61L586 88Q585 88 582 83Q557 61 526 46L511 37L542 35H577Q577 36 578 39T580 49T582 61",
        120125: "584 499Q569 490 566 490Q558 490 552 497T546 515Q546 535 533 559Q526 574 506 593T469 621Q415 648 326 648Q293 648 287 647T275 641Q264 630 263 617Q262 609 260 492V370L275 372Q323 376 350 392T393 441Q409 473 409 506Q409 529 427 529Q437 529 442 519Q444 511 444 362Q444 212 442 206Q436 197 426 197Q409 197 409 217Q409 265 375 299Q346 328 280 335H260V206Q260 70 262 63Q265 46 276 41T326 35Q362 35 366 28Q377 17 366 3L360 -1H24Q12 5 12 16Q12 35 51 35Q92 38 97 52Q102 60 102 341T97 632Q91 645 51 648Q12 648 12 666Q12 675 24 683H573Q576 678 584 670V499ZM137 341Q137 131 136 89T130 37Q129 36 129 35H182Q233 35 233 39Q226 54 225 92T224 346L226 623L231 635L235 648H129Q132 641 133 638T135 603T137 517T137 341ZM549 603V648H495L506 641Q531 621 533 619L549 603ZM409 317V395L400 386Q390 376 375 366L357 355L373 346Q394 331 397 328L409 317",
        120126: "737 285Q749 277 749 268Q749 260 744 255T730 250Q695 250 677 217Q666 195 666 119Q666 52 664 50Q656 36 555 3Q483 -16 415 -19Q364 -19 348 -17Q226 -3 146 70T44 261Q39 283 39 341T44 421Q66 538 143 611T341 699Q344 699 364 700T395 701Q449 698 503 677T585 655Q603 655 611 662T620 678T625 694T639 702Q650 702 657 690V481L653 474Q640 467 628 472Q624 476 618 496T595 541Q562 587 507 625T390 663H381Q337 663 299 625Q213 547 213 337Q213 75 341 23Q357 19 397 19Q440 19 462 22T492 30T513 45V119Q513 184 506 203Q491 237 435 250Q421 250 415 257Q404 267 415 281L421 285H737ZM250 43Q250 45 243 55T225 87T203 139T185 224T177 343V361Q184 533 250 625Q264 643 261 643Q238 635 214 620T161 579T110 510T79 414Q74 384 74 341T79 268Q106 117 230 52L250 43ZM621 565V625Q617 623 613 623Q603 619 590 619H575L588 605Q608 583 610 579L621 565ZM655 250H517L524 241Q548 213 548 149V114V39Q549 39 562 44T592 55T615 63L630 70V134Q632 190 634 204T648 237Q655 245 655 250",
        120128: "20 666Q20 676 31 683H358Q369 676 369 666Q369 648 331 648Q288 645 282 632Q278 626 278 341Q278 57 282 50Q286 42 295 40T331 35Q369 35 369 16Q369 6 358 -1H31Q20 4 20 16Q20 35 58 35Q84 37 93 39T107 50Q113 60 113 341Q113 623 107 632Q101 645 58 648Q20 648 20 666ZM249 35Q246 40 246 41T244 54T242 83T242 139V341Q242 632 244 639L249 648H140Q146 634 147 596T149 341Q149 124 148 86T140 35H249",
        120129: "79 103Q108 103 129 83T151 38Q151 9 130 -15Q116 -34 130 -37Q133 -39 157 -39Q208 -39 219 -8L226 3V305Q226 612 224 621Q220 636 211 641T166 647Q137 647 128 654Q119 665 128 679L135 683H466Q478 677 478 666Q478 647 439 647Q399 644 393 632Q388 620 388 347Q386 69 384 59Q364 -6 316 -39T184 -77H172Q102 -77 56 -48T6 30Q6 62 26 82T79 103ZM353 354Q353 556 354 596T361 645Q362 646 362 647H253Q257 639 258 628T261 547T262 312V-4L255 -17Q248 -29 250 -29Q253 -29 258 -28T277 -20T302 -5T327 22T348 65Q350 74 353 354ZM115 36Q115 47 105 57T79 67Q73 67 67 66T52 56T44 34Q44 9 62 -8Q66 -11 71 -15T81 -22T86 -24L90 -13Q100 3 102 5Q115 22 115 36",
        120130: "22 666Q22 676 33 683H351L358 679Q368 665 358 655Q351 648 324 648Q288 645 280 637Q275 631 274 605T273 477L275 343L382 446Q473 530 492 553T512 599Q512 617 502 631T475 648Q455 651 455 666Q455 677 465 680T510 683H593H720Q732 676 732 666Q732 659 727 654T713 648Q670 648 589 581Q567 562 490 489T413 415Q413 413 554 245T711 61Q737 35 751 35Q758 35 763 29T768 15Q768 6 758 -1H624Q491 -1 486 3Q480 10 480 17Q480 25 487 30T506 35Q518 36 520 38T520 48L400 195L302 310L286 297L273 283V170Q275 65 277 57Q280 41 300 38Q302 37 324 35Q349 35 358 28Q367 17 358 3L351 -1H33Q22 4 22 16Q22 35 60 35Q101 38 106 52Q111 60 111 341T106 632Q100 645 60 648Q22 648 22 666ZM240 341V553Q240 635 246 648H138Q141 641 142 638T144 603T146 517T146 341Q146 131 145 89T139 37Q138 36 138 35H246Q240 47 240 129V341ZM595 632L615 648H535L542 637Q542 636 544 625T549 610V595L562 606Q565 608 577 618T595 632ZM524 226L386 388Q386 389 378 382T358 361Q330 338 330 333Q330 332 330 332L331 330L533 90Q558 55 558 41V35H684L671 50Q667 54 524 226",
        120131: "12 666Q12 675 24 683H333L340 679Q350 665 340 655Q333 648 309 648Q287 646 279 643T266 630Q264 623 264 346Q264 68 266 57Q274 40 284 35H340Q413 37 460 55Q514 78 553 117T602 197Q605 221 622 221Q629 221 634 215T640 201Q638 194 625 105T611 12Q611 6 600 -1H24Q12 5 12 16Q12 35 51 35Q92 38 97 52Q102 60 102 341T97 632Q91 645 51 648Q12 648 12 666ZM137 341Q137 131 136 89T130 37Q129 36 129 35H237Q235 41 233 48L229 61L226 339Q226 621 229 628Q230 630 231 636T233 643V648H129Q132 641 133 638T135 603T137 517T137 341ZM580 48Q580 59 583 74T586 97Q586 98 585 97T579 92T571 86Q549 64 513 43L500 35H577L580 48",
        120132: "18 666Q18 677 27 680T73 683H146Q261 683 266 679L465 215Q469 215 566 443Q663 676 668 681Q673 683 790 683H908L915 679Q924 664 915 655Q912 648 897 648Q851 639 835 606L833 346Q833 86 835 79Q838 69 849 58T873 41Q877 40 887 38T901 35Q926 35 926 16Q926 6 915 -1H604L597 3Q588 19 597 28Q600 35 615 35Q660 42 673 68L679 79V339Q679 409 679 443T679 520T679 580T677 597Q646 521 584 375T473 117T424 3Q416 -1 410 -1T401 1Q399 3 273 301L148 599L146 343Q146 86 148 79Q152 69 163 58T186 41Q190 40 200 38T215 35Q226 35 235 28Q244 17 235 3L228 -1H28Q17 4 17 17Q17 35 39 35Q84 42 97 68L104 79V639L88 641Q72 644 53 648Q34 648 26 651T18 666ZM457 166Q451 169 449 171T435 198T404 268T344 412L244 648H157L166 637Q169 633 293 346L413 66Q424 88 435 117L457 166ZM817 646Q817 648 766 648H715V72L708 57Q701 45 697 41L695 37Q695 35 757 35H819L813 46Q802 61 800 76Q797 105 797 346L799 612L804 626Q812 638 815 641L817 646ZM124 42Q119 42 119 38Q119 35 128 35Q132 35 132 36Q125 42 124 42",
        120134: "131 601Q180 652 249 676T387 701Q485 701 562 661Q628 629 671 575T731 448Q742 410 742 341T731 234Q707 140 646 81Q549 -19 389 -19Q228 -19 131 81Q57 155 37 274Q34 292 34 341Q34 392 37 410Q58 528 131 601ZM568 341Q568 613 437 659Q406 664 395 665Q329 665 286 625Q232 571 213 439Q210 408 210 341Q210 275 213 245Q232 111 286 57Q309 37 342 23Q357 19 389 19Q420 19 437 23Q469 38 491 57Q568 132 568 341ZM174 341Q174 403 177 441T197 535T249 639Q246 639 224 627T193 608Q189 606 183 601T169 589T155 577Q69 488 69 344Q69 133 231 52Q244 45 246 45Q248 45 246 48Q231 69 222 85T200 141T177 239Q174 269 174 341ZM708 341Q708 415 684 475T635 563T582 610Q578 612 565 619T546 630Q533 637 531 637Q530 637 530 636V635L531 634Q562 591 577 543Q602 471 602 341V316Q602 264 599 230T580 144T531 48L530 47V46Q530 45 531 45Q533 45 547 52T583 75T622 105Q708 195 708 341",
        120138: "54 238Q72 238 72 212Q72 174 106 121Q113 110 132 90T166 59Q221 23 264 23Q315 23 348 41Q368 50 384 79Q393 102 393 129Q393 181 356 219T221 299Q120 343 74 390T28 501Q28 561 55 610Q98 682 212 699Q214 699 231 700T261 701Q309 698 340 687T408 675Q431 678 445 690T465 702Q474 702 481 690V497L477 490Q464 481 450 490Q446 500 446 501Q446 546 386 606T260 666Q215 666 182 639T148 565Q148 528 186 496T319 428Q352 414 370 405T418 379T468 338T506 284Q528 239 528 191Q528 102 456 46T266 -10Q211 -10 176 2T110 15Q86 9 73 -1T53 -12Q44 -12 37 -1V112V182Q37 214 40 226T54 238ZM446 619Q446 648 444 648Q439 646 435 644Q425 644 415 639H404L417 624Q435 606 439 601L446 592V619ZM124 619L128 635Q126 635 108 617Q64 576 64 502Q64 489 65 479T76 449T102 414T150 376T228 335Q335 291 381 245T427 128Q427 94 419 75L415 61Q421 61 448 88Q490 127 490 190Q490 233 475 264Q456 299 430 321Q402 349 369 367T287 404T204 441Q138 481 119 526Q113 544 113 565Q113 596 124 619ZM75 43Q76 43 90 46T110 50H119L106 64L74 101Q72 101 72 72T75 43",
        120139: "33 672Q36 680 44 683H624Q632 680 635 672V490L631 483Q621 479 617 479Q611 479 606 485T600 499Q600 525 584 552Q577 567 558 588T524 617Q479 642 426 646L415 648V355Q415 62 422 52Q425 42 434 40T473 35Q500 35 509 28Q518 17 509 3L502 -1H166L160 3Q149 17 160 28Q167 35 195 35Q224 37 234 39T249 52Q253 66 253 355V648L242 646Q192 642 144 617Q129 609 110 588T84 552Q69 527 69 499Q69 490 64 484T50 478Q39 478 33 490V672ZM113 639L126 648H69V597L84 612Q93 623 113 639ZM389 35Q382 46 381 86Q380 134 380 350V648H289V350Q289 199 288 131T286 53T280 35H389ZM600 597V648H542L555 639Q575 623 584 612L600 597",
        120140: "16 666Q16 677 28 683H341L348 679Q359 665 348 654Q342 648 315 648Q270 644 266 632Q262 627 262 598T261 399Q261 372 261 325T260 260Q260 149 274 99T339 30Q355 25 393 25Q430 25 457 33T494 49T519 72Q562 115 575 205Q576 219 576 379Q576 538 575 550Q568 597 550 622T506 648Q498 648 493 654T487 667T499 683H697Q709 675 709 667T704 654T690 648Q653 648 633 597Q624 573 622 546T619 377Q617 193 613 174Q596 95 544 41Q477 -19 355 -19H344Q275 -16 226 5T153 57T120 110T106 154Q101 172 99 399Q99 618 95 632Q88 644 53 648Q16 648 16 666ZM228 639L233 648H128Q128 647 133 632Q135 621 135 412Q135 197 137 185Q148 115 181 79Q209 51 235 41Q242 36 258 31T277 25Q276 27 268 38T254 59T241 92T228 145Q226 161 226 399Q226 632 228 639ZM604 621Q606 626 619 648H577L586 634Q587 632 591 625T595 614L597 608L604 621",
        120141: "316 683Q327 676 327 666Q327 648 302 648Q272 642 258 628Q249 621 249 608Q252 589 263 556T289 485T322 406T357 325T388 256T411 205L420 185Q423 185 473 317Q547 497 547 590Q547 621 541 632T516 648Q501 648 498 654Q488 664 498 679L504 683H607H660Q695 683 707 680T719 667Q719 660 714 654T700 648Q678 648 658 628L642 614L513 301Q484 231 449 148T397 25T380 -15Q373 -20 368 -20Q361 -20 358 -15Q354 -13 287 135T149 438T67 610Q45 648 18 648Q11 648 6 653T0 666Q0 677 9 680T59 683H164H316ZM216 614Q216 620 216 622T216 628T216 633T217 635T218 638T219 640T221 644T224 648H84L96 632Q118 592 236 330L367 43L387 88L404 132L380 185Q250 468 222 568Q216 590 216 614ZM576 645Q584 628 584 597L587 568L598 597Q609 624 618 637L624 648H600Q576 648 576 645",
        120142: "785 664Q785 670 795 683H982Q994 675 994 665Q994 650 975 648Q953 643 939 619Q931 593 823 292T710 -15Q706 -19 699 -19T688 -15Q682 -6 639 107T555 328T513 437Q513 438 500 409T462 325T413 212Q315 -14 310 -17Q308 -19 302 -19T288 -15L57 619Q45 643 24 648Q5 650 5 665Q5 677 17 683H146H200Q256 683 270 681T285 666Q285 659 280 654T268 648Q253 648 239 634Q230 630 230 619Q230 598 264 481L362 192Q363 193 428 341T493 492Q493 496 473 546T446 608Q426 648 399 648Q392 648 387 653T382 667Q382 678 393 683H679Q690 670 690 665Q690 662 685 655T673 648Q653 648 633 632L622 625V610Q626 576 657 479T719 300T751 218Q754 218 779 294Q847 492 847 581Q847 648 802 648Q796 648 791 652T785 664ZM194 623Q194 630 199 648H82L90 632Q99 616 199 332L302 50Q303 50 322 94T342 141Q342 142 305 245T231 467T194 623ZM585 620Q585 634 593 648H530Q466 648 466 645Q479 632 595 323L699 54Q701 56 718 103T735 154L702 245Q585 562 585 620ZM884 572L890 587Q896 602 903 620T915 645Q915 648 893 648H868L875 634Q883 598 883 576Q883 572 884 572",
        120143: "22 666Q22 677 31 680T80 683H184H335Q346 675 346 667Q346 660 341 655Q335 648 315 648Q280 644 273 637Q273 630 300 583T356 492T386 448Q430 504 450 535T474 577T478 601Q478 620 469 634T444 648Q428 648 428 666Q428 678 436 680T488 683H559H630Q673 683 681 681T690 666Q690 648 673 648Q652 648 619 637Q571 615 517 550Q490 517 450 464T410 408Q415 399 501 273T617 106Q648 61 661 48T688 35Q705 35 705 16Q705 5 695 -1H539Q384 -1 379 3Q373 10 373 17Q373 27 380 31T408 35Q459 40 459 49Q459 59 418 129T335 259Q334 260 332 260Q328 260 273 197Q210 127 208 117Q199 104 199 82Q199 57 213 46T239 35Q247 35 252 29T257 15Q257 10 256 7T253 3T248 0L246 -1H28Q16 7 16 15T21 29T35 35Q61 35 117 88Q289 279 304 297Q307 303 255 377Q117 586 79 626Q60 648 39 648Q32 648 27 653T22 666ZM237 639V648H173Q113 647 113 646Q113 642 137 612Q186 546 302 373T453 139Q497 63 497 43Q497 39 495 35H559Q622 35 622 37Q622 38 583 94T486 233T373 399T277 552T237 639ZM553 637L566 648H504L508 637Q510 630 515 615V603L528 615Q529 616 539 625T553 637ZM170 46Q169 49 167 58T164 70V83L137 59L113 35H175Q175 38 170 46",
        120144: "16 659T16 667T28 683H295Q306 676 306 666Q306 648 284 648Q258 648 255 641Q255 634 265 615T339 479Q418 339 421 339L455 394Q489 448 523 502L557 557Q560 566 560 582Q560 637 504 648Q489 648 486 655Q475 664 486 679L493 683H693Q704 675 704 667Q704 650 684 648Q672 645 653 623Q633 604 614 576T517 426L439 301V183Q442 62 444 59Q449 35 504 35Q521 35 528 30Q538 16 528 3L521 -1H195L188 3Q178 16 188 30Q195 35 213 35Q266 35 273 59Q274 61 277 163V261L75 621Q64 638 58 643T37 648Q28 648 22 653ZM219 637V648H101Q110 634 215 446L313 270V166Q310 59 306 48L301 35H415L410 48Q404 65 404 175V290L317 443Q230 601 226 612Q219 625 219 637ZM608 630L624 648H575Q584 632 588 623L595 610L608 630",
        120172: "821 97Q822 97 824 88T827 77L793 53Q676 -25 670 -28Q669 -29 656 -27L583 123Q583 124 467 46L352 -31L341 -20Q305 18 264 47T192 77Q161 77 60 32L49 40Q37 47 38 49Q39 49 93 83T212 160T297 219Q411 312 411 452Q411 519 360 571T233 624Q180 624 157 601T133 548Q133 524 160 496T214 441T241 393Q241 356 199 321T100 256L86 249L77 256Q68 263 67 263L84 274Q101 286 118 304T135 339T109 384T56 446T29 504Q29 566 118 624Q207 686 309 686Q349 686 360 685Q405 678 439 661T491 625T520 583T534 543T537 511Q537 436 491 344L478 318L455 299Q420 272 308 179L284 160L294 158Q348 154 426 89L437 79Q513 110 579 153V175Q579 183 579 227T580 330T581 446T582 542L583 582L664 630Q681 640 703 653T734 673L744 679Q750 678 756 676L767 674L716 623V585Q716 568 712 463T708 289V250Q708 237 709 218T710 195L711 180L739 130Q768 79 771 79Q775 79 796 88T821 97",
        120173: "160 345Q160 357 144 376T109 413T73 458T57 509Q57 544 95 584Q142 631 205 657T331 684Q382 684 427 658T500 585L505 577L521 588Q537 599 562 614T616 646T679 673T738 684Q790 684 807 666T840 587Q850 552 863 532T888 508Q894 505 906 505Q917 505 930 507T953 512T963 514L964 504Q965 495 965 494T914 467T808 413T745 384H751Q782 380 802 377T854 362T904 334T937 287T951 217Q951 178 937 143T908 91Q903 86 820 34L734 -21L718 -24Q679 -31 639 -31Q561 -31 451 4T271 40Q190 40 119 -2L99 -13L91 1L84 15L86 16Q88 18 132 42T233 100T315 152Q377 199 386 233Q388 240 393 297T399 363Q399 487 353 551Q337 573 306 597T238 622Q201 622 179 602T157 557T214 476T272 396Q272 371 229 334T143 272T96 246Q95 246 85 252T74 259T95 273T138 306T160 345ZM529 443Q529 409 528 385T526 353L525 346Q526 346 649 390T773 435Q749 451 742 464T727 518Q727 519 725 532T721 548T717 562T712 577T706 589T698 601T688 608T675 614T658 616Q626 616 576 582T525 528Q525 527 526 518T528 489T529 443ZM772 57Q774 57 778 58T792 64T808 77T821 103T827 144Q827 222 784 266T660 322Q652 323 611 323H596Q577 323 535 316L523 314Q520 291 505 255L500 241L356 138L366 137Q443 131 518 110T650 72T748 54Q763 54 772 57",
        120174: "460 -32Q373 -32 305 -11T193 45T122 124T83 214T72 303Q72 395 114 476L119 486L313 592L338 568L359 580Q418 615 479 638T568 668T606 675Q607 675 608 676H610Q612 676 615 661T630 621T660 578Q673 568 694 568Q717 568 721 570H726Q724 565 722 559L717 549L706 545Q608 513 583 513Q568 517 559 522T533 546T493 603L490 609Q452 599 452 558Q452 537 469 481T486 393Q486 353 474 331T422 285T296 231L272 223L262 230L253 237Q279 246 314 274T351 338Q351 376 334 442T316 532Q316 546 319 552Q319 554 316 554Q304 554 288 547T250 523T214 466T199 371Q199 218 299 133T541 47Q571 47 585 51T652 81L712 108Q716 104 716 81L706 74Q695 68 673 54T633 29L550 -22L540 -24Q492 -32 460 -32",
        120175: "380 596Q307 596 250 582T158 546T100 493T67 433T56 373V361Q55 361 43 366L31 372V384Q31 455 69 523T173 627Q213 650 284 666T444 683H452Q629 683 735 629Q896 548 896 369Q896 263 839 163Q835 155 818 140Q746 82 662 27T563 -29Q525 -29 386 16T183 62Q147 62 127 52T63 1L48 -14L40 -4L31 5Q83 73 172 149L186 161H199Q291 161 329 181Q357 199 357 231Q357 258 301 316T245 396Q245 423 282 458T349 512T403 543L413 548L425 545L438 541Q373 491 373 462Q373 446 399 415T453 349T480 288Q480 251 433 212Q394 180 348 156L334 148L353 145Q408 134 513 105T654 76Q711 76 745 132T780 277Q780 434 676 517Q637 549 562 572T380 596",
        120176: "527 55Q574 55 619 69T691 97L717 111V85L562 -18Q520 -29 443 -29Q379 -29 325 -15T235 21T180 61T146 98Q74 186 74 307Q74 395 109 472Q113 482 123 489T190 533Q251 568 295 591L308 598L350 580L361 586Q403 612 464 636T564 673T609 686Q610 686 610 685Q612 683 616 670T627 636T646 601Q666 572 686 572H692Q713 572 726 576H728L725 565L723 554L692 544Q660 535 629 526T595 516Q585 514 574 519Q563 527 543 552T507 597T490 617Q467 604 456 579V564Q456 535 473 471T492 393L494 381L613 460L622 446Q630 433 650 411T696 371L703 365L614 312H596L580 322Q568 329 553 340T528 355T510 360Q496 358 491 354T484 345T471 326T435 297Q408 278 370 261T307 235T277 227Q273 227 266 234L256 240L267 245Q280 251 294 258T330 288T353 336Q353 373 335 444T316 530V537Q316 549 322 567Q270 554 233 499T196 370Q196 253 287 157Q392 55 527 55",
        120177: "424 522Q265 596 208 596Q193 596 180 593T150 579T116 542T89 474Q86 465 86 463L59 481L63 494Q87 578 137 627Q191 684 285 684Q334 684 406 658T538 607T621 581Q644 581 706 629L721 640Q722 640 725 630L727 620Q701 592 654 548T582 486L569 487Q533 490 485 504L468 508Q449 503 429 495T387 466T365 422Q365 373 439 299L453 310Q473 325 528 370L588 418Q614 398 642 368T668 331Q667 331 628 296L590 262L582 274Q557 311 526 311Q511 311 487 297T462 278Q462 277 492 244T551 166T581 88Q581 54 570 25T536 -27T505 -56T478 -76Q376 -146 274 -146H270Q199 -146 162 -118T124 -15Q124 12 128 30T132 96V107Q132 144 117 157Q102 169 85 169Q74 169 59 165T32 156T20 151Q20 152 19 158T17 167Q17 168 17 168T17 169T19 170T22 172T27 175T35 179Q131 230 195 230Q231 230 259 202Q270 190 270 171Q269 150 253 87T236 -16Q236 -67 261 -87T322 -107Q380 -107 428 -68Q467 -35 467 30Q467 60 447 91T383 171T316 251Q290 286 278 308T263 339T261 359Q261 384 284 418Q322 469 424 522",
        120178: "742 611Q784 611 812 631V611Q807 607 783 591T718 544T629 476L606 458Q608 458 628 457T667 453T713 443T762 423T804 388T836 335Q844 313 844 289Q844 231 814 182T746 103Q720 82 655 48T546 -18L520 -21Q456 -29 432 -29Q313 -29 223 33Q204 45 183 65T135 119T91 207T74 320Q74 428 109 480Q116 491 127 497T215 546L308 595L343 583L355 591Q387 613 433 636T488 660H489L491 659Q493 658 495 657T500 655L509 650L500 645Q479 635 460 612T441 552Q441 535 447 498T459 433T466 405L625 513L643 526Q620 530 585 546T535 586Q535 587 532 592T527 602T525 610Q525 613 577 649L630 687Q632 687 638 675T653 649T686 623T742 611ZM349 313Q349 328 327 413T305 510V516Q305 531 308 542T314 559T317 566T315 567Q297 567 270 548Q233 524 212 490T191 392Q191 337 206 288T244 207T284 156T316 128Q410 51 535 51Q632 51 675 102T718 217Q718 269 690 314T599 375Q574 381 535 381Q501 381 477 377L466 376Q469 364 469 349Q469 314 457 295T408 258Q366 236 308 219L288 213L279 220L270 227Q284 232 294 236T309 243T320 252T326 260T331 270T336 281Q349 310 349 313",
        120179: "288 139Q288 172 255 224T189 335T156 442Q156 495 242 579Q289 625 361 668Q364 671 368 673T376 678T380 681L384 683L392 676Q401 670 414 661T443 642T477 626T509 619Q543 619 618 668Q625 672 628 674T631 675Q632 673 633 663T633 651L564 595Q556 589 545 580T528 566T516 556T505 548T497 543T488 539T481 537T472 535T463 534T451 534H442Q385 534 304 581L291 589Q290 588 285 583T277 575T269 566T262 555T257 543T255 529V522Q255 507 260 487T276 446T293 409T311 376L321 359Q321 358 322 358T324 359T327 361T333 366Q386 409 481 460L503 472L543 471Q586 471 599 470Q692 459 714 430Q725 416 738 360T752 245Q752 184 742 127T725 51T703 -8Q700 -13 619 -64T518 -123Q508 -126 493 -126Q438 -126 398 -86L427 -52Q456 -17 457 -17Q460 -17 465 -16H473Q474 -21 481 -32T504 -56T539 -69Q572 -69 599 -34Q625 4 625 158Q625 264 609 311T532 378Q508 386 484 386Q455 386 419 372T360 345T337 330L346 313Q375 263 386 227Q389 215 389 202Q389 192 388 184T384 168T376 152T365 138T350 121T331 103T307 81T278 54L194 -24Q130 30 99 30Q85 30 64 20T31 1T16 -10Q15 -11 13 -7Q12 -6 11 -3Q8 4 6 8L32 35Q88 88 117 107T169 126Q177 126 182 125Q218 118 252 84L263 73Q288 113 288 139",
        120180: "500 615Q523 615 550 628T595 655T614 668L623 654L607 642Q512 569 440 534L427 527L413 529Q384 535 340 547T265 565T209 572Q173 572 145 556T101 522T60 465Q58 460 54 460T41 468L32 477L37 487Q96 599 139 640Q187 681 247 681Q275 681 283 680Q313 674 398 645T500 615ZM418 170Q418 186 410 260T401 382Q403 418 403 424L405 433L415 444Q482 515 571 571L582 578Q591 573 607 568L597 560Q522 504 522 450Q522 427 533 357T545 241V228Q545 190 536 159T508 106T478 73T446 48Q343 -25 238 -25Q179 -25 118 15L107 22L79 5Q51 -12 51 -12L38 2L55 18Q106 67 175 122L192 136Q202 130 206 123Q223 91 252 61Q263 50 266 48T278 39T297 32T320 30Q357 30 389 68Q415 102 418 170",
        120181: "65 510Q68 517 74 528T101 569T144 620T202 661T274 680Q308 680 389 628T503 576Q530 576 596 600Q615 607 616 607Q616 602 615 596V585Q605 581 576 568T531 548T485 531T418 509L400 503L358 522Q347 527 327 537T299 550T277 560T257 568T239 573T220 577T201 578H196Q181 578 169 575T135 554T88 502L83 496Q82 496 74 502T65 510ZM424 4Q424 50 395 151T365 313V320Q365 352 369 361T405 403Q431 432 465 462T521 508T547 525L549 524Q551 524 554 523T560 521L571 517L552 498Q515 461 499 430Q485 399 485 366Q485 326 512 231T539 84Q539 -14 460 -77T273 -141Q248 -141 234 -140T198 -131T160 -106T134 -59Q128 -40 124 -16T117 22T108 49T91 69T59 75T15 65L1 59Q-8 76 -7 77Q4 85 22 97T88 129T170 149Q218 149 234 125Q242 112 242 43V21Q242 -17 248 -41T274 -85T322 -105H325H330Q363 -105 396 -75Q424 -47 424 4",
        120182: "234 109Q234 144 194 245T153 404Q153 445 180 490Q232 572 325 626T517 681H524Q612 681 661 658Q683 647 699 632T717 604Q717 600 708 545L699 490L690 489Q681 488 679 488Q675 488 669 504T640 546T577 592Q520 620 446 620Q415 620 386 614T327 594T280 553T262 487Q262 468 265 447T271 413T279 384T285 362L295 371Q320 396 352 421T439 474T538 502Q577 502 596 484T627 428Q642 386 651 373T677 360H682Q698 360 727 369L724 357Q724 354 724 351T722 346V344Q559 289 539 283Q582 272 589 271L615 265L637 189Q662 109 663 108Q668 97 682 84Q698 68 722 68H730H738Q762 68 799 91L803 80L806 70Q795 59 770 40T703 -3T631 -26Q598 -26 578 -8Q548 24 536 92Q524 154 509 183T477 218T428 224Q409 224 385 220T346 212L331 207Q330 205 330 201T331 189T332 178Q332 158 325 116L305 96Q269 60 240 38Q171 -21 123 -21Q72 -21 33 18L20 32L62 74Q96 107 102 112T116 118Q120 118 122 113T131 95T150 69Q171 48 190 48Q198 48 206 51T224 69T234 109ZM519 367Q497 432 450 432Q379 432 313 333L300 314L304 299Q306 294 309 280T315 260L321 235L542 313Q530 325 519 367",
        120183: "277 226Q277 248 253 286T203 369T178 449Q178 490 212 533T284 607Q380 683 532 683Q610 683 639 660T668 583Q668 568 666 546T663 509Q663 478 683 460Q691 452 719 452L738 450Q732 437 729 437Q728 437 652 416T573 394Q554 394 541 409T527 444Q527 449 532 487T538 542Q536 584 501 606T418 628Q389 628 364 620T317 587T295 523Q295 478 333 401T372 276Q372 269 371 267Q371 264 318 206L264 149Q284 141 317 130T433 101T577 82Q619 82 652 95T701 127T728 164T742 196L744 209Q744 210 749 208T759 203T764 199T760 185T751 154T744 129Q714 42 680 13Q628 -28 566 -28Q490 -28 403 -5T249 42T153 66T106 53T70 15T47 -16Q46 -17 30 -5L39 13Q85 100 138 148L147 156L161 157Q218 165 246 179T277 226",
        120184: "134 338Q134 357 81 417T27 504Q27 516 34 530Q55 568 110 615Q190 683 305 683H314Q445 683 495 580L501 569L512 577Q608 646 681 646Q759 646 801 585L808 576L816 583Q860 619 921 650T1041 682Q1063 682 1077 675T1096 660T1112 631T1132 596Q1160 555 1188 555Q1204 555 1228 564Q1230 565 1231 562Q1231 560 1232 554V547L1215 538Q1179 521 1114 475Q1112 474 1106 470T1099 464T1093 459T1088 452T1085 441T1082 425T1081 404T1079 376T1079 339Q1079 282 1084 236T1098 160T1117 112T1138 85T1159 77Q1166 77 1180 81T1207 90L1219 94Q1220 94 1221 86T1222 76L1045 -32Q1044 -32 1004 15L964 64V167Q965 334 970 372V378L994 402Q1032 440 1057 460Q1061 463 1066 467Q1070 469 1070 470T1068 471T1060 474T1050 481Q1040 488 1021 531T996 583Q979 609 947 609Q922 609 887 592T820 537L821 524Q825 484 825 448Q825 268 768 155L759 137L589 -28L579 -20Q533 17 507 17Q475 17 449 -7L436 -18L424 2L441 20Q446 25 456 36T471 52T484 65T497 79T509 90T522 99T534 106T548 112T561 115T576 117Q602 117 639 86Q648 81 648 81Q650 82 657 94T668 112Q711 202 711 373Q711 484 677 533T600 583Q592 583 583 581T569 577T554 568T542 560T528 549T516 539L519 523Q527 485 527 461Q527 444 522 407Q506 266 447 150L437 130L217 -25L208 -15Q165 28 126 28Q89 28 62 1Q47 -14 43 -14Q42 -14 36 -8L28 0L44 17Q96 73 120 92T166 117Q182 123 204 123Q239 123 284 78L295 67Q307 72 337 102Q400 178 400 346Q400 508 325 571Q270 618 208 618Q180 618 168 614T140 594Q124 578 124 564Q124 540 182 480T240 396Q240 359 197 321Q154 285 94 252L80 245L76 248L67 257L61 262L71 268Q82 275 94 284T120 309T134 338",
        120185: "522 492Q521 492 517 502T512 513Q542 444 542 333Q542 226 503 137L498 125L396 53Q308 -8 292 -17T260 -27Q226 -27 191 -9T136 29L145 39Q162 56 192 89L230 129L235 128H241Q276 57 332 57Q358 57 391 80Q403 89 409 100T422 143T428 227Q428 329 406 408T347 530T272 594T196 615Q152 615 135 596T118 558Q118 535 146 502T203 438T232 385Q232 357 195 322T122 265T83 243Q82 242 72 249T61 258L66 262Q72 265 82 273T103 292Q125 314 125 333Q125 351 101 376T51 432T26 492Q26 549 108 614T290 679Q326 679 335 678Q353 675 370 670T400 658T425 642T445 625T463 606T477 588T487 571T495 556T500 543L504 535L523 553Q553 581 569 595T619 632T686 667T757 678Q778 678 793 675T819 664T833 651T844 633T852 617Q884 548 910 548H916Q938 548 962 556L967 542Q967 540 947 531Q909 509 883 492T847 467T838 458Q825 419 825 328Q825 234 833 191T858 121Q875 94 892 77Q898 71 907 71Q912 71 928 76T957 87T971 91L972 88Q972 84 972 81L973 73L957 63Q891 21 806 -23L794 -30L783 -14Q766 13 728 60L713 79V372L724 384Q743 406 765 427T800 460L813 471Q809 472 806 472Q783 479 766 503T741 551T715 594T672 614Q644 614 622 595Q597 576 572 550T534 508L522 492",
        120186: "254 595Q269 583 269 581L262 577Q256 573 247 566T228 549T212 527T205 502Q205 480 266 386T328 277Q328 234 239 150L221 134L231 133Q264 131 376 99T516 62Q567 50 604 50Q614 50 626 52Q643 57 662 71T703 115T739 198T753 323Q753 454 692 517Q652 555 584 565T382 577Q365 577 357 577H308L300 591L292 606Q292 608 342 665L392 724L403 725Q406 725 411 726H416L417 725L412 715Q408 705 408 698Q408 684 423 679Q431 677 516 672T663 655Q757 634 806 593T873 463Q881 421 881 380Q881 340 874 306Q859 223 809 147Q801 134 789 124Q595 -30 456 -30Q395 -30 289 3T147 36Q134 36 121 33T98 26T76 15T59 4T44 -8T32 -17L22 -7L12 4L56 59L100 114L116 118Q217 142 217 199Q217 230 185 276T120 365T87 430Q87 435 109 464T172 534T254 595",
        120187: "247 398Q247 372 206 334T126 272T83 247Q82 247 72 253T61 261Q60 261 61 262T66 265Q127 306 127 343Q127 364 63 430Q42 451 38 458T33 480V490V497Q33 526 63 567Q112 632 170 660T282 688Q341 688 384 667Q454 633 482 566Q483 565 484 566T496 574Q562 623 630 653Q699 681 751 681Q778 681 797 673Q818 662 830 609Q835 580 843 564Q863 524 895 524H901Q917 524 932 528Q936 522 938 518T942 513T942 511Q873 480 836 454Q789 423 789 395Q789 362 834 298T880 200Q880 170 867 145T820 81Q733 -20 647 -20Q581 -20 499 21V9Q499 -16 502 -53T509 -116L512 -141L370 -223L357 -216Q344 -209 344 -208L348 -196Q370 -113 370 33V52L355 58Q307 76 284 76Q258 76 228 60T183 29T141 -11Q137 -7 133 -2L126 7L134 18Q181 89 210 121T278 170Q304 179 328 179Q336 179 358 177L370 175Q368 268 367 359Q367 416 363 434Q362 438 362 441Q348 527 302 574T203 621Q169 621 148 599T127 557Q127 535 187 476T247 398ZM673 315Q673 357 786 442Q786 443 776 444T750 449T727 462Q719 471 716 484V496Q715 507 715 515Q715 571 698 588Q680 611 643 611Q592 611 547 571Q534 558 511 522L499 505V139L543 123Q702 64 744 64Q770 64 781 79T793 112Q793 143 733 217T673 315",
        120188: "254 595Q269 583 269 581L262 577Q256 573 247 566T228 549T212 527T205 502Q205 480 266 386T328 277Q328 234 239 150L221 134L231 133Q264 131 376 99T516 62Q567 50 604 50Q614 50 626 52Q643 57 662 71T703 115T739 198T753 323Q753 454 692 517Q652 555 584 565T382 577Q365 577 357 577H308L300 591L292 606Q292 608 342 665L392 724L403 725Q406 725 411 726H416L417 725L412 715Q408 705 408 698Q408 684 423 679Q431 677 516 672T663 655Q757 634 806 593T873 463Q881 421 881 380Q881 340 874 306Q864 250 838 196T791 126Q748 93 733 82L715 69Q714 68 723 60T748 40T774 23Q806 2 832 2Q849 2 870 6T904 14L917 17Q917 12 918 6V-3L882 -22Q806 -60 778 -73L755 -83Q640 -36 596 -7L586 0L576 -4Q513 -30 457 -30Q394 -30 289 2T149 35Q119 35 93 22T52 -4T36 -17T24 -7T12 4L56 59L100 114L116 118Q217 142 217 199Q217 230 185 276T120 365T87 430Q87 435 109 464T172 534T254 595",
        120189: "31 498Q34 541 76 586T176 659T279 688H290Q377 688 429 653T506 569L511 558L526 572Q620 663 707 682Q722 685 737 685Q781 685 804 665T830 619T838 565T854 525Q866 511 897 511Q917 511 925 513L937 515Q938 515 941 509T944 501T925 493T870 470T803 438Q735 406 735 401Q735 400 741 399T767 390T814 374L828 367L829 307Q829 233 833 202T852 144Q873 109 896 90Q906 82 928 82T976 95V92Q976 88 978 72L807 -28Q768 39 733 87L718 108V149Q718 230 714 257T693 298Q654 333 580 333Q524 333 520 329Q520 300 489 224T443 133Q441 131 333 53T223 -27Q221 -26 204 -11T169 16T136 28Q110 28 66 -8L56 -16Q52 -13 40 -1L48 7Q165 124 211 124Q232 124 287 77L298 67Q309 73 337 97Q397 150 397 347Q397 419 379 474T330 560T269 604T207 619Q177 619 152 601T126 563Q126 540 185 479T244 387Q240 336 160 289Q144 278 98 255L80 246L62 261L79 272Q96 283 113 301T130 337Q130 353 115 373T81 410T47 451T31 498ZM524 358Q537 358 657 405T777 457Q777 459 768 459Q749 462 738 474T723 499T714 539Q706 585 697 599Q681 618 657 618Q632 618 597 595T532 515L525 502L524 441Q524 375 523 369Q523 358 524 358",
        120190: "457 -31Q356 -31 272 6T135 120T82 304Q82 372 106 430T170 527T241 588T305 626Q341 643 386 657T460 678T495 685T554 660T674 609T778 584Q800 584 818 591T848 610T866 633T878 651T883 659L893 649L901 639Q879 574 803 532T666 490Q661 490 657 490T650 491T641 492T633 495T622 500T610 505T595 513T577 522T554 533T527 547Q436 594 415 602Q393 608 374 608Q303 608 253 545T202 386Q202 229 307 135T568 41Q674 41 748 85T822 198Q822 244 779 283T639 322Q595 322 499 303T383 283Q358 283 335 290T291 318T270 374Q270 418 313 460T424 510H431L435 505L440 500Q425 496 403 475T380 427Q380 382 431 373Q437 372 475 372Q543 372 626 388T742 404Q831 404 868 362T905 260Q905 182 831 108Q692 -31 457 -31",
        120191: "666 641Q737 641 794 686L802 662Q790 648 734 596L677 541L664 538Q630 528 583 528Q540 528 482 537L461 541Q402 512 402 456Q402 427 439 387T512 311T549 253Q549 220 455 139L440 126Q541 75 586 75Q600 75 619 80T654 94T685 110T709 124T719 130Q722 125 725 119L730 108Q700 72 568 -18Q551 -30 542 -30Q495 -30 404 6T270 42H263Q213 42 142 -11L131 -19L129 -8Q126 1 126 4Q218 84 301 126L316 134H406L413 142Q436 165 436 189Q436 202 421 221T364 281Q336 307 318 328T296 356T283 381L290 394Q338 478 410 540Q419 549 417 549Q415 550 369 558T268 575T195 584Q153 584 127 567T100 523Q100 499 116 479T151 447T170 433Q170 429 171 428Q171 427 131 394T88 359Q82 363 73 370T47 403T31 457Q31 513 79 565T197 648T332 679Q369 679 490 660T666 641",
        120192: "273 244Q273 281 244 331T186 428T155 502Q155 524 165 536Q239 634 333 688Q338 684 345 680L356 672L344 664Q310 642 295 624T280 582Q280 550 303 505T348 407T371 300Q371 270 362 248L247 123L358 92Q452 64 484 64Q507 64 523 72Q553 87 573 109Q583 121 586 146T593 283Q594 303 594 344Q594 401 591 461T584 558L581 595Q598 600 623 611T672 634T719 659T754 678L768 686Q770 686 784 673L782 670Q781 668 777 664T768 655Q747 635 738 616T721 535T714 359Q714 205 723 176Q727 164 744 133T771 89Q780 75 804 75Q814 75 853 87L867 92L871 73L671 -39L654 -10Q636 20 619 50T600 83Q600 84 589 75T539 34Q478 -16 475 -19Q469 -22 449 -28T414 -34Q410 -34 394 -32Q356 -28 282 -2L237 15Q169 38 126 38Q106 38 85 27T51 4T37 -8T27 -1T18 8Q18 10 70 63T124 116Q154 123 176 131T223 154T260 191T273 244",
        120193: "133 343Q133 360 79 416T25 496Q25 523 58 563T118 624Q197 685 293 685Q331 685 339 684Q453 665 489 558L493 546Q521 570 553 596T640 653T725 684Q753 684 783 672T844 641T889 618Q895 616 912 616Q924 616 936 617T956 620T965 622T966 612V604L952 595Q924 576 895 549Q864 517 856 496T847 448V434Q847 395 848 388L859 323Q874 241 874 212Q874 142 830 96Q796 62 724 14Q661 -29 603 -29Q555 -29 421 28T242 86Q182 86 110 31Q105 28 102 26T99 25Q88 36 88 42Q95 54 222 142Q252 163 262 165Q319 183 344 218Q378 266 378 377Q378 444 362 494T319 571T266 610T212 623Q181 623 156 603T131 562Q131 539 154 512T206 458T243 416Q246 409 246 399Q246 387 242 377T225 351T178 311T94 259L79 251Q72 256 68 261T62 268L61 270L70 277Q131 318 133 343ZM822 526Q778 531 719 564T628 597Q611 597 579 574Q543 543 513 506L505 495L506 473Q506 469 506 461T507 449Q507 348 467 271L462 261L404 218L348 174Q349 173 356 173Q384 169 450 144L546 105Q665 56 708 56Q737 56 746 72T756 118Q756 129 755 135L741 219Q725 314 725 334V344Q725 416 736 431Q748 450 815 510L832 526H822",
        120194: "133 317T133 338T80 413T26 496Q26 532 83 591Q100 608 111 616T151 644T219 672T304 682Q381 682 434 646T506 564L510 557Q513 557 534 573L677 665L707 683L790 561L803 572Q933 682 1001 682Q1037 682 1098 650T1193 616Q1208 616 1222 619L1235 622Q1239 622 1239 616Q1239 611 1240 609Q1240 608 1206 577T1138 503T1104 430Q1104 409 1123 330T1142 208Q1142 183 1136 147Q1127 118 1117 106Q1114 103 1031 48T935 -14Q930 -18 908 -22T862 -27Q826 -27 759 -6T647 26Q597 38 578 38Q573 38 561 33T533 20T505 4T480 -10L469 -16L452 -26L439 -28Q423 -30 411 -30Q358 -30 279 7T169 45Q125 45 58 -5L47 -14L41 -4L35 8Q35 11 56 29T113 75T181 125L200 139H217Q279 143 320 180T377 270T394 393Q394 453 378 498T334 568T277 605T213 617Q177 617 155 607Q140 600 130 587T119 560Q119 545 137 522T177 479T217 434T236 393Q236 324 98 251L89 246L76 253L63 261Q91 275 112 296ZM1088 526Q1066 526 1004 556T909 586Q863 586 816 539L802 526L804 514Q814 461 814 411Q814 319 781 238Q772 214 760 198T730 165T702 136L715 133Q759 122 848 90T973 57Q1003 57 1017 80Q1022 93 1022 116Q1022 152 1003 241T983 377V391Q983 405 985 409T1002 429Q1019 450 1045 475T1090 514L1107 528Q1104 527 1102 527T1096 527T1088 526ZM699 358Q699 391 696 419T688 467T675 503T660 530T642 550T626 563T608 574T593 582Q581 575 559 554T524 512Q523 510 523 477Q523 315 444 218L435 207L368 169Q301 132 301 131Q307 128 315 125L377 99Q476 57 515 57Q534 57 608 94L627 102L636 111Q699 187 699 358",
        120195: "273 679Q354 674 408 633T477 525L484 533Q496 548 524 574T571 615Q594 633 625 649T675 673T699 681Q724 632 747 607Q754 601 756 599T765 594T777 591T794 590Q818 590 834 594V585L835 577L704 513L693 518Q657 534 631 560T597 599Q596 601 581 584Q495 490 489 379V366H562L681 369Q682 369 679 366T668 355T651 341L620 314H485V295Q490 190 543 125T686 60Q720 60 789 88L801 93V89Q798 83 798 66Q781 59 685 -10L665 -25L634 -30Q596 -35 594 -35Q570 -35 536 -23T477 19Q461 37 445 67T418 118L409 138Q401 131 388 120T340 79T273 28T206 -12T151 -31Q129 -31 90 -12T32 22L113 101Q114 101 120 96T136 84T160 69T189 56T221 51Q256 51 305 90Q376 149 376 301V315H293Q276 315 251 315T210 314T190 313L168 312Q168 313 200 340L231 368L238 367Q275 367 311 366H378V387Q376 470 355 512T291 572Q274 579 252 579Q223 579 197 568T156 544T131 519T117 508Q112 512 108 518L99 527L117 545Q177 604 255 665L273 679",
        120196: "34 496Q34 518 53 549T107 610T195 661T310 682Q357 682 398 663T460 611Q467 600 475 583T489 554T495 542Q495 544 531 570T617 629T700 676L724 688Q742 670 756 657T784 635T806 621T830 606T856 592Q878 416 878 340Q878 154 805 -3L798 -20L779 -40Q706 -113 613 -163T421 -214Q359 -214 317 -196T256 -160L306 -63L313 -64L320 -66L326 -79Q337 -104 349 -120T392 -151T470 -166Q576 -166 644 -101Q750 7 750 292Q750 426 721 495T617 565H611Q563 565 513 509L506 501L508 493Q508 490 509 475T510 445Q510 319 458 236L451 225L436 216Q406 198 365 169T318 134L332 127Q336 126 397 103T489 80H493Q527 80 593 129L604 137L607 127Q610 119 610 116Q610 114 592 95T543 46T484 -4Q450 -27 446 -27Q441 -27 402 -18Q365 -9 290 20T188 50Q135 50 64 -7L52 -17L43 -7L34 2L51 19Q118 87 177 132L192 143H215Q259 145 289 155T335 184T355 214T366 245Q382 306 382 388Q382 426 381 436Q368 520 318 570T214 621Q184 621 165 608T142 583T137 562Q137 541 163 508L201 469Q245 425 251 408Q253 403 253 398Q253 383 240 366T212 335T161 295Q128 271 99 253L89 247L77 256L65 266L76 273Q125 301 134 329Q136 334 136 342Q136 357 124 372T88 410T49 455Q34 479 34 496",
        120197: "278 601Q242 601 212 591T167 570T121 533Q114 528 111 525L93 550Q223 661 244 667Q299 677 356 677Q415 677 456 666T515 634T541 596T549 555Q549 513 529 478T480 421T424 388T377 372Q365 370 365 367Q365 365 389 365T450 358T523 337T588 282T623 183Q624 177 624 161Q624 20 524 -60Q415 -148 285 -148Q242 -148 213 -139Q181 -131 159 -109Q136 -87 127 -56T114 6T104 49Q94 69 57 69Q38 69 13 58L1 53Q1 55 0 59T-3 68T-4 76Q78 130 138 142Q150 144 162 144Q213 144 227 120T242 31Q242 -30 263 -66T345 -102Q397 -102 444 -52T491 107Q491 172 471 211T428 265Q392 288 306 288Q269 288 233 284L218 282Q208 289 208 291L229 324L251 359Q250 360 248 360Q239 360 248 371L256 381H273Q344 385 378 409T413 495Q413 537 384 569T278 601",
        120198: "80 129V151Q80 241 99 363Q99 367 111 372T172 401T285 465L297 472Q340 455 405 443L423 440L455 453Q486 467 489 467L497 461L494 451Q480 390 480 292V283Q480 207 483 155L484 143L535 80L558 90L582 99Q586 95 586 83Q586 81 513 25L443 -29Q410 16 386 40L371 55V61Q371 63 371 67T370 74V80L278 25Q186 -29 184 -31Q182 -32 160 -12T112 35T80 75V129ZM359 366Q334 366 300 371T243 382L221 388Q218 388 212 375T200 323T194 228Q194 191 197 152L198 139L217 120Q245 92 269 74L279 66L304 78Q338 95 349 100L369 110V152Q368 164 368 210T367 275Q367 358 366 361V366H359",
        120199: "99 398Q99 610 86 662Q86 665 95 669T106 674L108 669Q109 664 112 654T119 635Q122 626 125 616T130 601L131 596Q214 649 273 678Q295 690 298 690Q299 690 304 688T313 682L317 679Q275 653 240 612Q210 569 210 469V459Q210 450 210 432T211 406L212 378L285 425Q301 435 321 447T350 466L360 472Q360 473 361 473T368 471T401 456T465 429L501 414V408Q504 386 504 309Q504 255 500 203T491 125T485 97Q485 95 445 74T343 23T237 -24L214 -32Q197 -22 165 3T109 49T87 73Q99 169 99 398ZM386 251Q386 320 380 347V350L305 374L282 382L214 348L213 274Q213 184 214 165V131L230 119Q288 76 349 54Q386 137 386 251",
        120200: "227 393Q215 393 210 351T205 269Q205 161 213 153Q220 145 244 125T290 88L312 72L365 92Q414 113 418 113V93L365 60Q255 -9 221 -26L211 -18Q158 21 91 88L90 107Q87 167 87 225Q87 267 90 302T96 351T100 366L295 473L311 470Q340 464 368 454T410 437T424 429L347 334L342 333H337L325 342Q299 363 271 378T228 393H227",
        120201: "88 117Q88 177 91 231T97 310T102 341Q102 343 118 357T168 397T239 447L257 459L268 454L278 449Q242 416 238 412L219 394Q219 391 216 378T211 349T206 307T203 249Q203 211 206 166L208 148Q224 132 261 108T333 70Q341 66 342 67T350 79Q393 157 393 302Q393 368 388 406V411L371 424Q199 558 101 558Q69 558 28 545L18 542L8 549L-1 557L24 569Q61 587 147 621L177 632Q179 631 194 627T216 621T240 613T269 602T302 589T340 571T382 549T431 522T484 488Q504 475 504 472Q511 449 511 365Q511 248 474 129L468 108L451 96Q427 77 347 28T254 -28Q235 -20 174 21T89 86L88 117",
        120202: "309 69Q391 98 416 108Q418 106 422 100T425 92Q419 86 326 30T229 -27Q228 -27 207 -13T154 27T97 76L85 87L84 106Q81 152 81 194Q81 295 93 359L95 369L286 471L313 449Q376 397 414 372L428 362Q428 360 375 318L188 181V170Q188 156 189 153V148L203 138Q228 119 266 94T309 69ZM209 389Q208 388 204 366T194 307T187 244Q187 225 188 225T201 233L245 261Q283 284 291 291Q324 313 324 316L296 334Q280 343 259 357T224 380L210 390Q209 390 209 389",
        120203: "128 400Q127 401 121 422T108 478T99 540V555L111 569Q135 597 165 626T214 671T235 687L249 678Q263 668 282 659T315 650Q335 650 362 666L372 654L286 569H271Q205 576 173 586V583Q173 558 208 492T252 401Q253 399 310 399T367 398L332 355H254V311Q251 160 235 16Q230 -28 226 -36Q225 -38 221 -45Q171 -140 121 -211L113 -222H104Q94 -222 94 -220Q94 -215 105 -187L121 -145Q139 -80 139 35V93Q139 222 135 314L134 354Q134 355 84 355H35L84 399H106Q128 399 128 400",
        120204: "92 71Q92 74 91 88T88 128T86 183Q86 230 91 275T102 342T109 366Q115 372 207 422T305 472Q407 426 431 426Q435 426 476 445L519 465L525 463L532 461Q497 392 497 268Q496 255 496 233Q496 179 516 92T539 -10L541 -22L526 -38Q441 -126 355 -194L339 -206L327 -207Q324 -207 319 -207T310 -208Q242 -208 171 -179T73 -131L56 -141Q40 -150 38 -150Q17 -140 17 -137Q17 -136 18 -136T98 -79L176 -23Q174 -21 134 24T92 71ZM226 393Q224 393 221 372T214 312T210 235Q210 182 214 144L215 132L230 118Q281 70 301 66Q304 66 331 80T373 105L384 112L383 165Q383 224 387 309Q387 314 387 319T387 329T388 336T388 341V343Q388 344 381 344T339 354T249 384Q246 385 243 386T236 389T231 391T228 392L226 393ZM414 -80Q414 -64 411 -43T403 -1T394 37T386 66T382 79Q381 79 286 15T189 -52Q312 -125 365 -125Q397 -125 405 -115T414 -80",
        120205: "95 661Q95 662 103 667T113 672L126 634L137 596L147 602Q235 656 275 677L292 687L303 680Q305 679 307 677T312 674L313 672L310 670Q307 669 301 667T289 660T274 649T259 634Q250 622 244 611T233 585T226 560T222 528T221 497T220 456T219 413V377L232 384Q244 391 271 409T339 455L362 471L383 461Q425 440 491 415L504 410V406Q507 399 507 269Q507 76 486 -21Q485 -30 483 -33T461 -57Q382 -139 299 -207L281 -197L263 -186L266 -185Q268 -184 280 -177T312 -155Q344 -130 353 -116Q394 -59 394 117Q394 162 391 216T386 301T382 335Q382 338 365 346T323 364T281 376L250 362Q220 347 219 347Q213 336 213 232Q213 177 217 144L218 128L224 119Q244 92 263 71L272 60Q206 21 157 -24Q156 -24 151 -16T132 11T98 52L89 62L91 103Q104 289 104 436Q104 471 103 506T101 568T99 616T96 649L95 661",
        120206: "73 613L164 686L184 666Q200 650 214 637T235 620T242 614T203 577T162 540Q158 540 122 570T73 613ZM92 58Q92 63 94 83T98 142T101 234Q101 318 97 358V366L59 387L40 379L21 371Q20 371 12 376T3 382L38 406Q78 431 125 466L138 477Q149 468 186 444L219 422V389Q215 324 215 247Q215 136 222 123Q226 113 238 98T258 83Q263 83 292 94L322 104Q322 103 324 97T327 89Q327 88 317 82T272 52T190 -7Q166 -25 164 -25L112 35Q92 55 92 58",
        120207: "74 611L155 682Q172 666 186 655T208 636L235 614Q227 606 191 574L154 540L135 556Q101 582 84 601L74 611ZM10 377L144 477Q145 476 184 453T229 428L233 425V416Q238 346 238 252Q238 93 215 -16L213 -30L185 -57Q29 -203 19 -203Q17 -203 -19 -189L-9 -183Q52 -146 78 -116T114 -37Q120 31 120 192V237Q120 327 113 351T72 380L53 372Q34 362 32 364L10 377",
        120208: "106 72Q110 105 111 193T114 294V308H74L34 309L83 346H115V430Q114 591 106 652Q105 662 107 665T114 668T123 672Q125 672 139 635L152 597L154 598Q156 600 160 602T167 607Q193 625 226 644T279 672T302 682L312 676L321 670L312 665Q281 649 263 626T241 587T233 547Q232 541 231 530T230 510T230 501Q231 501 265 522T334 564T369 583L380 570Q428 509 428 481Q428 475 427 470T423 459T416 448T404 434T389 418T369 397T344 371L321 347L365 346H409L372 308H227V294Q227 272 230 208T234 138Q234 136 256 119T302 84L324 68L372 88Q421 108 422 108T432 90L421 83Q373 53 270 -5L234 -25L204 -1Q172 25 124 60L106 72ZM336 434Q336 452 327 472T308 503T297 514Q296 514 290 510T275 499T264 490Q230 458 230 358V346H247Q268 346 276 350T302 372Q328 398 335 423Q335 424 335 428T336 434",
        120209: "111 275Q111 406 108 518T104 650V657Q105 657 109 660T117 665T122 666L133 629L144 594L161 606Q218 642 272 670L294 681Q295 681 300 677T306 672L302 669Q298 666 292 662T278 651T263 637T251 621Q232 587 227 530T222 343Q222 226 230 125L231 112L244 98L258 83Q271 87 285 92L312 102V84Q297 72 231 24T163 -23L100 55Q110 141 111 275",
        120210: "115 203Q115 257 114 291T112 338T111 355Q111 357 93 370L75 384L54 375Q32 366 31 365Q27 365 16 378Q25 383 89 430L152 476Q175 453 228 420Q229 420 229 418T229 410T227 394L225 369Q279 400 315 425T363 461T376 471Q480 424 514 416V412Q514 411 514 404T513 392L511 376L520 382Q529 387 548 399T584 422Q599 432 618 444T648 463L657 469H658Q661 469 681 461T735 440T796 420Q803 418 803 416Q801 414 798 390T791 325T788 247Q788 220 790 172T794 123Q799 115 814 97T835 78H838Q841 78 867 89L895 101Q896 101 896 100T897 92T900 78L873 62Q810 23 761 -12L736 -30Q735 -30 729 -22T707 7T671 48L661 59Q674 93 674 207V219Q674 341 670 344Q655 353 591 372L576 376L544 364Q511 351 510 351Q507 349 507 224V132L535 95Q541 87 548 78T560 63L563 58Q563 57 504 15T444 -28L385 53L387 67Q396 114 396 206Q396 289 393 334Q393 346 390 348Q369 358 306 373Q301 373 265 361L228 349V335Q227 322 227 284Q227 206 231 157Q231 151 231 144T232 133V129Q232 125 259 90Q286 56 286 53Q287 53 284 51T273 43T258 31L173 -31L166 -20Q160 -11 145 7T119 38T108 59Q108 62 110 81T113 133T115 203",
        120211: "608 88Q572 65 535 37T477 -8T455 -25Q432 7 389 53L375 68L378 82Q386 160 386 195V221Q386 284 385 307L384 344Q352 359 306 373L286 379L213 353V273Q214 229 214 161V129L275 62L163 -28L150 -14Q136 0 121 16T91 44Q86 48 86 50Q95 83 96 148Q96 224 89 340L88 366L79 374Q69 384 67 385L64 388L55 383Q52 382 44 378T33 373L21 367L13 374Q5 379 5 381Q5 384 69 428L133 473Q135 473 147 464T179 443T215 424L214 400V376Q271 404 342 457L363 472Q363 473 364 473Q366 473 375 469T418 449T502 414L512 411V407Q502 330 502 217V197V132L523 109Q527 104 533 97T543 87T547 83L550 80L578 92Q603 103 604 103Q606 103 608 88",
        120212: "107 102Q107 178 112 242T123 334T129 362Q129 363 140 368T199 400T315 469L336 482L346 476Q409 439 498 414L514 410L515 389Q515 208 502 141Q494 101 491 94Q490 89 478 81Q430 51 375 23T288 -20T254 -34Q250 -34 200 -1T119 56L108 65L107 76V102ZM389 355Q367 358 346 363T309 372T282 381T264 388L257 390H256Q254 390 249 381T238 348T227 293Q226 280 226 237Q226 183 231 146L232 131L244 122Q285 91 323 74T374 57H377L380 68Q405 154 405 267Q405 315 401 349V354L389 355",
        120213: "66 435Q66 445 117 501T173 557Q174 557 183 555T193 551Q174 526 174 509Q174 496 190 472T233 428V386L377 482L399 471Q450 445 509 425Q519 421 519 420L518 419Q518 418 518 416T517 410Q517 405 518 381T519 335Q519 222 501 137Q492 84 489 84L473 75Q457 66 423 44T354 -6L338 -19L329 -13Q320 -8 313 -4T297 4T284 10T270 14T258 17T245 20T233 22V12L241 -161L214 -172Q187 -184 160 -195T131 -207Q127 -207 112 -202L113 -188Q113 -182 115 -77T118 31Q118 32 109 32Q63 27 23 0L10 -9Q5 -4 -1 8Q1 13 52 57T114 101H115L117 123Q117 141 117 230V359L110 367Q85 394 71 421Q66 433 66 435ZM384 83Q386 83 389 110T396 180T400 254Q400 294 395 339L394 349L379 355Q308 383 294 383Q290 383 263 372L234 360L233 245V130Q270 125 305 113T361 92T384 83",
        120214: "362 -196Q375 -92 375 47V78L282 24Q189 -29 188 -30Q187 -30 139 21T90 75Q87 84 87 158Q88 206 94 259T107 342L113 372L308 478L322 473Q374 452 421 444L433 442L503 485Q515 479 515 477Q485 378 485 56Q485 -100 494 -164V-171L381 -211L371 -207L362 -202V-196ZM280 72Q301 77 323 86T358 101T372 110Q372 268 377 346L378 358H374Q368 360 358 360T323 365T257 380L234 386Q231 386 229 379Q215 353 211 310T207 180Q207 152 208 150Q210 142 235 114T280 72",
        120215: "23 367Q21 370 18 374T14 380L13 382L151 472L236 411L238 381L290 426Q298 432 307 439T322 452T333 461T342 467L344 469Q382 410 404 399Q410 397 416 397Q423 397 432 399T446 403L451 405Q453 405 453 399V393Q430 374 404 356T364 328T350 318L349 317Q321 320 276 356Q257 371 256 371Q253 374 249 366T242 351Q232 321 232 236Q232 214 232 205T232 182T233 162T235 148T238 137T242 129T249 120T257 114T268 105T281 95Q313 70 314 70L358 85Q377 92 389 96T402 100V90L403 80L229 -26L221 -18Q195 6 166 29T121 63T105 76T106 82T110 97T114 121T117 158T119 208Q119 269 114 329L113 341L103 350Q90 362 67 380L45 374L23 367",
        120216: "189 331Q190 304 196 282T207 252T214 244Q239 244 348 292L371 302L382 297Q398 290 415 279T433 265Q442 238 442 166Q442 103 423 45Q416 42 380 29T310 3T244 -26L227 -34Q139 40 73 40Q61 40 48 37T24 30T6 22T-8 14L-13 11Q-14 11 -18 18T-23 26T38 75T102 125Q107 128 146 131H153Q192 131 296 56Q318 40 318 43Q323 48 323 114Q323 157 321 177L319 194Q308 208 291 216T261 225Q239 225 160 185L123 167Q85 205 79 227Q78 230 78 304V377L171 428Q264 479 265 478Q268 478 287 465T334 440T384 427Q423 427 475 463L478 453Q481 446 481 442Q481 439 410 391L339 342H331Q309 345 277 361T222 391T198 406T195 399T191 372T189 331",
        120217: "328 69Q401 102 403 102Q404 102 405 94T406 84Q406 83 318 28L230 -27Q223 -21 206 -5T171 25T132 54L124 60V71Q129 154 129 297V359H43L44 363Q44 365 44 367L45 369L48 372Q51 374 57 378T68 387L90 405H129V553L285 648Q304 641 306 640L260 598V592Q259 589 255 505T249 413V405H353V402Q353 399 328 379L303 360H245V319Q245 150 253 125Q257 115 276 101T311 78T328 69",
        120218: "444 -31Q444 -29 384 66Q382 66 364 58T309 30T231 -17Q214 -29 212 -29L197 -20Q172 -4 140 11T88 34L68 42Q68 43 73 49T85 67T100 98T113 149T118 221Q118 272 105 332L100 356L58 383L23 365L9 379L76 425Q141 472 144 472Q144 471 183 443L221 414V404Q224 365 224 275V253Q224 159 196 113Q191 104 193 104Q203 104 285 72L308 62L374 89L375 106Q375 266 373 340Q373 364 371 396V424L430 445L491 467Q493 467 499 463T505 457Q505 456 503 442Q488 335 488 187V158L529 81L534 80Q541 80 568 90L598 101Q605 94 602 87L524 27Q445 -32 444 -31",
        120219: "95 67Q104 80 104 193Q104 261 100 321L98 355L91 363Q56 402 56 421Q56 441 82 472T132 524T159 546Q174 542 175 542Q159 520 159 501Q159 481 205 432L221 415L220 401Q219 394 219 387L288 429Q309 441 325 451T347 465T358 472T365 476L504 415V409Q504 408 505 374T507 318Q507 155 474 91L469 80L343 26Q314 14 281 0T232 -20L216 -27L202 -15Q192 -5 152 28Q141 35 126 45T103 60T95 67ZM386 349Q302 389 287 389Q271 383 253 375L220 361V136Q226 120 256 100T312 68T342 56Q355 56 360 68Q389 134 389 258Q389 310 386 341V349",
        120220: "90 58T90 59T92 64T97 78T102 105T107 150T109 218Q109 290 103 350V356L83 377Q55 407 55 425Q55 445 138 528Q158 549 162 549L164 548Q165 548 167 548T170 547L175 546L172 540Q168 533 165 523T161 502Q161 479 216 430L229 419V382Q232 382 366 471Q407 445 500 408L511 404V387L512 370L595 420Q678 469 679 469L693 462Q756 431 795 417L815 409L814 380Q812 187 782 96Q774 71 766 62T744 48T684 25T577 -23L557 -32L546 -26Q536 -19 519 -10T481 10T436 31T393 47Q384 50 380 50Q380 52 381 58T384 77T387 104Q391 174 391 256V292L390 333L377 340Q350 357 304 373L294 376L227 355V348Q224 322 224 243Q228 117 232 112L235 108Q238 103 245 95T257 80L281 50Q281 49 227 10T172 -29L159 -13Q133 19 116 36T94 56ZM652 64Q658 64 667 84T685 162T697 303V336L686 341Q653 356 619 367L591 376Q590 376 553 361T514 344T512 324T510 275T508 221Q508 167 510 152T521 126Q537 112 590 88T652 64",
        120221: "8 -90Q8 -68 13 -63Q13 -56 53 -8T120 63L128 71L129 85Q133 120 134 182Q134 308 131 331T106 365Q100 367 97 369L75 381L35 365L20 377Q20 378 47 397T110 440T161 471L253 413V396Q253 378 254 378L309 422Q364 466 365 466Q365 467 366 466T370 461T376 454Q403 419 426 396L441 380L438 377Q438 376 433 372T420 359T404 344L372 314Q351 320 338 327T310 344T277 364Q261 364 252 316Q251 306 251 235Q251 136 255 129Q257 127 258 124T268 113T298 92Q334 68 335 68Q340 70 349 73T377 84T408 95T421 99Q422 99 422 90L423 82L334 26Q246 -28 243 -28L200 8Q156 43 148 43Q144 43 130 36T99 9T83 -36Q83 -67 121 -89T198 -118L237 -124V-129L238 -133L193 -160Q183 -166 171 -173T152 -184L146 -188Q140 -187 131 -185T98 -173T56 -154T23 -127T8 -90",
        120222: "280 53Q272 47 246 27T199 -10T176 -27L167 -18Q137 17 107 44L90 60L93 71Q108 130 109 290V331Q109 339 109 344T108 353T107 359T105 364T102 369T97 374T91 381Q60 412 60 432Q60 448 86 479T138 534L164 557Q168 553 180 553Q163 532 163 511Q165 491 186 468Q206 443 231 423V404L232 385L371 477L389 468Q439 441 498 418L512 412V386Q512 360 507 190T500 14Q488 -26 445 -67Q401 -111 355 -148T282 -203T249 -221Q247 -220 230 -210T213 -199T229 -191T269 -172T306 -151Q361 -120 379 14Q391 92 391 182Q391 218 386 305Q384 339 380 341Q363 353 330 366T288 379Q282 379 258 368L230 356V181V141Q230 127 232 120T236 108T251 89T275 59L280 53",
        120223: "153 371Q141 371 126 365T100 354T78 340L65 331L57 338L50 346L62 356Q133 419 222 471Q274 453 306 422T338 366Q338 356 329 346T283 301L243 264L262 257Q298 246 361 214Q378 154 378 73Q378 33 371 -9T356 -74T345 -104Q340 -106 267 -160L191 -214H177Q60 -214 13 -150Q-7 -122 -7 -115Q-7 -112 19 -77T106 25T241 149Q241 152 227 158T181 173T109 185V190L108 194L158 229Q212 267 223 278T234 306Q234 329 208 350T153 371ZM258 1Q258 42 257 68T254 105T252 118Q235 105 210 85T144 22T102 -45Q102 -79 146 -106T234 -133H238Q248 -128 254 -80Q258 -58 258 1",
        120224: "183 181Q183 179 152 91T118 0H28L154 346L280 693Q281 694 333 694H385L511 349Q636 4 638 2Q638 0 584 0H530L464 183H184L183 181ZM324 606Q319 578 292 492T238 332T210 256Q210 254 324 254T438 255L429 281L419 308Q409 336 395 378T365 465T339 551T324 611V606",
        120225: "425 363Q438 363 465 353T526 324T585 270T610 192Q610 132 561 78T426 7Q404 2 387 2T240 0H90V694H227Q373 693 396 689Q484 673 533 623T583 517Q583 494 574 473T551 437T520 409T487 388T456 374T433 366L425 363ZM490 516Q490 527 485 539T467 568T423 599T347 621Q340 622 262 623H188V399H261H286Q432 399 478 475Q490 496 490 516ZM514 190Q514 245 462 280T343 322Q336 323 259 323H188V71H274Q365 72 388 77Q445 88 479 121T514 190",
        120226: "59 347Q59 440 100 521T218 654T392 705Q473 705 550 680Q577 670 577 667Q576 666 572 642T564 595T559 571Q515 601 479 613T392 626Q300 626 232 549T164 347Q164 231 229 150T397 68Q453 68 489 80T568 120L581 129L582 110Q584 91 585 71T587 46Q580 40 566 31T502 5T396 -11Q296 -11 218 41T99 174T59 347",
        120227: "88 0V694H237H258H316Q383 694 425 686T511 648Q578 604 622 525T666 343Q666 190 564 86Q494 18 400 3Q387 1 237 0H88ZM565 341Q565 409 546 463T495 550T429 600T359 621Q348 623 267 623H189V71H267Q272 71 286 71T310 70Q461 70 527 184Q565 251 565 341",
        120228: "86 0V691H541V611H366L190 612V397H513V321H190V85H372L554 86V0H86",
        120229: "86 0V691H526V611H358L190 612V384H485V308H190V0H86",
        120230: "59 346Q59 499 157 601T384 704Q436 704 466 700T541 679Q551 674 560 670T575 664T583 660T588 658T590 656Q590 652 582 605T573 557L564 564Q489 626 392 626Q301 626 233 549T164 347T233 145T392 68Q441 68 506 84V223H388V299H599V38L588 33Q494 -11 393 -11Q296 -11 219 40T100 172T59 346",
        120231: "86 0V694H190V399H517V694H621V0H517V323H190V0H86",
        120232: "87 0V694H191V0H87",
        120233: "181 53Q200 53 215 56T241 66T259 79T272 95T280 109T285 122L287 129V694H388V415V229Q388 135 385 112T369 63Q364 51 355 39T328 12T280 -12T212 -22Q172 -22 130 -12T66 8T43 20L46 42Q50 65 54 88L58 110Q58 111 65 104Q107 53 181 53",
        120234: "88 0V694H188V519L189 343L525 694H638L375 419L651 0H541L309 351L188 225V0H88",
        120235: "87 0V694H191V79L297 80H451L499 81V0H87",
        120236: "92 0V694H228L233 680Q236 675 284 547T382 275T436 106Q446 149 497 292T594 558L640 680L645 694H782V0H689V305L688 606Q688 577 500 78L479 23H392L364 96Q364 97 342 156T296 280T246 418T203 544T186 609V588Q185 568 185 517T185 427T185 305V0H92",
        120237: "88 0V694H235L252 659Q261 639 364 428T526 84V694H619V0H472L455 35Q453 39 330 294T185 601L181 611V0H88",
        120238: "55 345Q55 504 149 609T361 715Q386 715 406 713Q521 696 600 592T680 344Q680 193 590 86T368 -22Q239 -22 147 84T55 345ZM276 59T368 59T518 146T576 360Q576 473 525 545T401 634Q371 637 362 637Q284 637 222 562T159 360T217 147",
        120239: "88 0V694H230Q347 693 370 692T410 686Q487 667 535 611T583 485Q583 409 527 348T379 276Q369 274 279 274H192V0H88ZM486 485Q486 523 471 551T432 593T391 612T357 621Q350 622 268 623H189V347H268Q350 348 357 349Q370 351 383 354T416 368T450 391T475 429T486 485",
        120240: "55 345Q55 504 149 609T361 715Q386 715 406 713Q521 696 600 592T680 344Q680 284 665 231T629 143T587 85T551 48L536 35L648 -120L652 -125H531L452 -8L440 -12Q407 -22 369 -22Q239 -22 147 85T55 345ZM579 345Q579 473 517 555T369 637Q279 637 218 554T156 345Q156 223 215 141T368 58Q376 58 382 58T392 58T397 59T401 60T403 61H404Q404 63 360 128T315 194H421L453 150Q485 105 486 105Q490 108 496 113T517 138T545 182T567 247T579 334V345",
        120241: "88 0V694H227H259H302Q365 694 399 689T474 663Q528 637 558 595T589 504Q589 482 584 462T569 426T547 396T522 372T495 353T470 338T449 328T434 322L429 320L440 300Q452 280 477 238T523 160L617 1L565 0Q513 0 512 1Q512 2 424 156L337 309H189V0H88ZM492 504Q492 600 367 620Q354 622 271 623H189V385H271Q363 386 388 392Q432 402 462 430T492 504",
        120242: "55 514Q55 589 115 652T283 716Q315 716 345 711T396 699T432 685T457 672T467 667Q467 666 459 618T449 568Q383 634 282 634Q214 634 182 600T150 525Q150 507 155 492T172 465T194 446T222 432T247 423T272 416T289 412Q353 396 378 384Q432 358 466 307T500 194Q500 110 438 44T272 -22Q215 -22 159 -5T73 28T44 50Q45 51 49 75T57 122T62 146L65 143Q68 140 74 136T88 125T107 111T131 98T160 85T194 74T232 66T274 63H286Q327 63 366 96T406 182Q406 245 352 280Q329 296 265 310T173 339Q124 363 90 409T55 514",
        120243: "36 608V688H644V608H518L392 609V0H288V609L162 608H36",
        120244: "87 450V694H191V449Q192 203 193 194Q200 148 220 117T266 72T311 54T347 49Q404 49 446 84T501 178Q505 195 505 218T507 449V694H600V450Q600 414 600 356Q599 198 595 181Q594 178 594 177Q575 89 505 34T345 -22Q258 -22 184 34T89 196Q88 205 87 450",
        120245: "14 692Q14 694 68 694H122L146 633Q325 165 339 90Q340 87 341 87Q341 124 530 619L558 694H605Q652 694 652 692Q650 690 523 354T390 10L387 0H279L276 10Q271 18 144 354T14 692",
        120246: "115 694Q115 693 156 550T233 266T270 90L271 85Q272 86 272 92Q272 153 405 616L427 694H524L553 590Q672 174 681 95L682 84L684 95Q689 138 728 287T803 563T841 692Q841 694 885 694T929 693Q929 691 829 346L730 0H679L628 1L606 75Q478 524 470 600L469 611L467 600Q458 518 338 101L310 0H213L114 346Q14 691 14 693Q14 694 64 694H115",
        120247: "14 0Q16 5 144 184T275 367L153 528Q121 571 88 615T42 674T28 694H150L228 584Q315 463 316 461L326 448L497 694H610L609 692Q606 689 492 528Q440 454 409 410T378 366Q378 365 515 182L652 0H531L326 292Q326 293 299 254T226 146L128 0H14",
        120248: "4 693L64 694H125L174 621Q335 378 340 364L341 362Q361 398 395 450L558 694H663L383 277V0H282V278L143 485Q112 531 75 586T21 668L4 693",
        120249: "69 617V694H555V643L373 362Q190 81 190 79H234Q244 79 272 79T344 80T419 81H560V0H55V53L237 334Q420 615 420 617Q413 618 387 618Q380 618 334 618T245 617H69",
        120250: "236 387Q209 387 184 382T141 370T111 355T91 342T83 337L82 355Q80 373 79 393T77 417Q77 419 81 421Q86 423 91 426Q155 460 227 460H238Q319 460 368 400Q393 371 400 341T408 252Q408 240 408 207T407 152V0H317V39L306 32Q244 -10 159 -10H152Q109 -10 77 22Q38 61 38 126Q38 142 39 146Q55 199 130 223T295 252H314V277Q314 305 313 310Q308 342 287 364T236 387ZM303 186Q124 180 124 126Q124 105 144 86T208 66Q284 66 309 124Q314 137 314 166V186H303",
        120251: "303 -11Q280 -11 259 -6T222 6T194 21T176 33T168 38V0H75V694H165V550L166 405Q247 455 336 455Q397 455 439 389T482 226Q482 115 428 52T303 -11ZM390 221Q390 283 361 331T265 379Q214 379 177 342L168 334V118Q203 66 258 66Q316 66 353 106T390 221",
        120252: "34 223Q34 327 99 393T245 460Q290 460 301 459Q328 455 354 445T395 427T410 415L396 338L386 344Q377 349 362 357T335 370Q305 381 258 381H252Q182 381 146 315Q126 275 126 224Q126 158 159 113T255 68Q329 68 394 106L408 114L410 93Q411 72 412 52L414 32Q407 27 394 20T338 2T252 -10Q156 -10 95 58T34 223",
        120253: "33 224Q33 321 81 388T197 455Q277 455 342 414L351 408V694H441V0H348V44L338 37Q278 -10 198 -10Q177 -10 168 -8Q99 11 62 90Q33 148 33 224ZM348 337Q307 378 263 378Q260 378 256 378T251 379Q239 379 223 374T182 355T142 305T126 220Q126 90 225 67Q231 66 250 66H255Q306 66 342 115L348 124V337",
        120254: "28 226Q28 329 91 395T235 461Q258 461 279 456T325 436T368 397T399 332T415 238V219H113V215Q113 163 151 114T248 65Q273 65 298 70T341 82T373 96T396 108L403 113Q403 106 406 76T409 38Q409 34 408 33T393 24Q325 -10 252 -10Q155 -10 92 59T28 226ZM340 289L338 297Q335 305 333 310T327 326T317 343T304 358T286 372T263 381T233 385Q212 385 193 376T162 353T140 325T127 301T123 289H340",
        120255: "262 705H267Q300 705 347 694V612L336 616Q303 628 274 628H266Q224 628 199 605Q187 590 184 579T181 541V507V444H287V371H184V0H94V371H27V444H94V492Q94 544 95 550Q102 617 151 661T262 705",
        120256: "55 286Q55 357 105 406T224 455Q280 455 323 421L322 423L318 427Q318 428 339 434T396 448T465 455H471L478 416L485 377Q484 377 474 379T445 383T401 385Q397 385 391 385T381 384L362 383L357 387Q358 386 364 375T375 354T384 325T389 287Q389 217 340 168T221 119Q178 119 138 142Q133 145 131 143Q125 131 125 117Q125 82 155 72L227 71Q230 71 251 71T280 71T310 69T343 65T373 57T403 46T428 30T449 7Q471 -26 471 -62V-71Q471 -136 384 -178Q326 -206 250 -206Q159 -206 102 -172T30 -92Q28 -84 28 -68T31 -37T40 -12T52 7T64 21T75 31T82 38Q60 68 60 106Q60 145 80 180L86 189L80 199Q55 240 55 286ZM304 233T304 287T279 362T220 383Q189 383 165 361T140 287Q140 243 161 217T220 191Q253 191 278 212ZM250 -134Q298 -134 331 -122T375 -96T387 -69Q387 -21 306 -7Q288 -5 216 -5Q161 -5 153 -7Q146 -9 139 -13T122 -31T113 -66Q113 -75 113 -80T127 -97T166 -121Q203 -134 250 -134",
        120257: "163 395Q223 455 307 455Q417 455 438 354Q442 331 443 164V0H350V157Q349 315 348 320Q334 378 259 378H253Q224 378 204 358Q180 334 173 301T165 209Q165 198 165 172T166 129V0H73V694H163V395",
        120258: "67 576V680H171V576H67ZM74 0V444H164V0H74",
        120259: "88 576V680H192V576H88ZM31 -126Q40 -126 48 -125T62 -122T73 -117T82 -111T89 -105T94 -99T98 -92L102 -86V444H192V180Q191 -45 191 -70T184 -113Q171 -152 140 -178T63 -205Q34 -205 4 -197T-43 -181T-59 -171T-51 -133T-41 -96L-38 -99Q-34 -102 -28 -106T-13 -115T7 -123T31 -126",
        120260: "76 0V694H163V257L340 444H449L286 272L292 263Q296 259 378 138T463 12L471 0H372L309 92Q294 114 277 139T250 179T237 198L228 211L160 139V0H76",
        120261: "74 0V694H164V0H74",
        120262: "160 392Q223 455 304 455Q359 455 386 436T430 383L437 391Q495 455 584 455Q694 455 715 354Q719 331 720 164V0H627V157Q626 315 625 320Q611 378 536 378H530Q501 378 481 358Q457 334 450 301T442 209Q442 198 442 172T443 129V0H350V157Q349 315 348 320Q334 378 259 378H253Q224 378 204 358Q180 334 173 301T165 209Q165 198 165 172T166 129V0H73V450H160V392",
        120263: "160 392Q214 446 283 454Q285 454 292 454T303 455H306Q417 455 438 354Q442 331 443 164V0H350V157Q349 315 348 320Q334 378 259 378H253Q224 378 204 358Q180 334 173 301T165 209Q165 198 165 172T166 129V0H73V450H160V392",
        120264: "28 222Q28 323 95 391T244 460Q275 460 281 459Q364 445 417 377T471 219Q471 124 408 57T250 -10Q158 -10 93 57T28 222ZM377 230Q377 277 364 310T328 358T287 379T248 385Q233 385 219 382T186 369T155 342T132 297T122 230Q122 146 159 108T250 69H253Q263 69 274 70T305 81T339 106T365 154T377 230",
        120265: "166 404Q194 424 241 439T337 455H341Q410 455 451 370Q483 307 483 222Q483 128 433 59T306 -10Q282 -10 260 -5T222 7T194 21T176 33T168 38V-194H75V444H165V424L166 404ZM390 222Q390 287 354 331T266 376T177 340L168 332V118Q200 66 257 66Q313 66 351 112T390 222",
        120266: "33 220Q33 325 87 389T206 454Q286 454 341 406L351 398V455H441V-194H348V41L338 35Q276 -8 198 -11Q171 -11 154 -5Q102 12 68 74T33 220ZM126 220Q126 160 161 113T251 65Q305 65 351 123V298L350 301Q349 304 347 308T342 319T336 331T327 343T315 355T300 365T283 373Q273 375 256 375Q208 375 167 332T126 220",
        120267: "171 389Q237 455 320 455H327V373H317Q262 369 220 336T167 248Q165 239 164 119V0H74V450H159V377L171 389",
        120268: "33 326Q33 376 60 408T117 450T175 460H190Q245 460 272 454T345 429Q345 428 338 388L331 349Q278 386 188 386H183Q119 386 119 336Q119 307 142 295T210 276T278 256Q360 213 360 130Q360 108 354 88T332 43T281 5T195 -10Q152 -10 111 1T49 22T28 35Q29 36 32 56T39 95T43 115T51 110T72 99T102 85T143 73T193 68Q274 68 274 123Q274 152 248 167Q234 178 187 186T115 207Q66 229 46 273Q33 298 33 326",
        120269: "333 27Q333 24 314 16T257 -1T184 -10H172Q146 -10 128 14T105 58T99 91Q95 113 95 251V371H18V444H98V571H182V444H316V371H182V253Q183 128 189 104Q199 68 234 68Q277 72 314 98Q315 93 323 61T333 27",
        120270: "353 39Q352 38 344 34T331 27T315 19T295 11T270 3T241 -3T207 -8T168 -10H162Q148 -10 137 -8T111 2T87 30T74 81Q73 89 73 268V444H166V268L167 92Q171 79 174 74T192 64T238 59Q317 59 344 116Q349 128 349 148T350 291V444H443V0H353V39",
        120271: "178 0Q15 441 14 442Q14 444 60 444Q107 444 107 442Q108 441 136 364T196 194T232 67Q233 98 280 234T356 442Q356 444 401 444T446 442L282 0H178",
        120272: "14 444H105L108 434Q192 160 200 74V65L201 75Q206 144 282 399L296 444H381L399 381Q480 112 480 69L481 70Q481 113 562 386L580 444H668L534 1L483 0H432L429 10Q343 294 338 367L337 377Q336 375 336 370Q336 340 313 250T269 88T245 11L242 0H195L148 1L14 444",
        120273: "187 229L6 444H107L227 294L344 444H393L442 443Q439 437 299 268L267 229L460 0H359L294 88Q280 107 262 131T236 166L227 177L100 0H0Q1 1 47 58T140 171T187 229",
        120274: "113 -204Q83 -204 63 -200L43 -197Q43 -196 40 -157T36 -117L48 -121Q79 -133 114 -133Q124 -133 130 -132T145 -121T163 -94Q169 -82 184 -42T200 1L188 29Q176 57 152 115T107 223T62 330T26 416L14 443Q14 444 61 444H109L122 411Q230 155 236 75L237 65V74Q245 161 348 424L356 444H401Q446 444 446 443L396 313Q345 183 293 49T236 -93Q191 -204 123 -204H113",
        120275: "42 370V444H400V395L156 76L279 77H402V0H28V51L273 371L157 370H42",
        120276: "110 0H86Q42 0 42 27Q42 37 148 350T258 667Q269 687 291 692Q295 694 366 694H399Q432 694 448 689T474 667Q477 663 583 350T690 27Q690 0 642 0H617H592Q582 0 575 1T561 2T549 6T541 11T533 18T527 26T522 37T517 49T512 64T506 81L490 130H225Q225 128 208 79T189 27Q185 19 180 14T170 7T156 3T143 1T127 0T110 0ZM439 279Q359 524 359 547L357 555L355 543Q347 503 270 263L259 231H357Q455 231 455 232L439 279",
        120277: "119 1Q98 5 92 28V667Q98 686 118 693Q121 694 272 694H289H346Q439 694 500 681T600 625Q640 580 640 513Q640 451 601 414T504 364L518 361Q568 351 602 329T649 280T666 235T671 197Q671 172 665 147T642 91T586 37T488 5Q456 1 282 1H119ZM489 509Q489 532 479 548T450 573T421 585T394 591Q387 592 315 593H247V404H298H325Q432 404 466 444Q489 470 489 509ZM517 194Q517 235 502 261T458 299T407 313T353 317H329H322H247V101H319H357Q387 101 407 103T452 111T492 133T514 171Q516 176 517 194",
        120278: "423 -11Q339 -11 275 9T171 62T106 143T71 240T61 347Q61 450 93 527Q157 664 313 694Q357 704 416 704Q479 704 517 699T608 676Q634 667 635 660Q635 653 624 592L612 528L609 524Q604 521 601 521Q595 521 583 531T555 555T505 578T428 589H424Q298 589 250 494Q224 438 224 347Q224 292 233 251T265 175T329 122T432 104Q488 104 524 115T604 158Q607 160 610 162T615 165T619 168L621 170Q625 172 630 170T637 163Q638 160 642 109T647 54Q646 49 625 37T568 11T499 -7Q463 -11 423 -11",
        120279: "119 1Q98 5 92 28V667Q98 686 118 693H124Q131 693 142 693T168 694T200 694T237 694H296Q416 694 450 692T525 677Q732 617 732 342Q732 169 644 81Q593 32 528 16T372 0Q356 0 324 0T276 1H119ZM573 349Q573 387 571 413T559 473T532 527T482 567T403 591Q395 592 320 593H250V101H321Q418 102 456 114Q553 144 569 263Q573 303 573 349",
        120280: "277 122Q280 122 380 123T544 125Q552 125 557 125T565 124T569 124Q595 115 595 75V62V47Q595 9 569 2Q564 0 341 0L119 1Q99 7 92 28V664Q98 683 118 690Q121 691 335 691T554 689Q580 682 580 644V632V618Q580 582 554 573Q553 573 551 573T542 572T527 572Q464 572 364 573T260 575H253V412H385H459Q524 412 536 404T549 357Q549 341 549 334T542 318T523 305Q518 303 385 303H253V122H277",
        120281: "512 572Q451 572 356 573T258 575H253V400H370H431Q494 400 506 392T518 345Q518 307 507 299T437 291H370H253V161Q253 141 253 113T254 75Q254 23 245 12T195 0H170L119 1Q99 7 92 28V664Q98 683 118 690Q121 691 327 691T538 689Q564 682 564 644V632V618Q564 582 538 573Q537 573 535 573T526 572T512 572",
        120282: "61 347Q61 405 70 454T105 550T171 631T276 685T426 705Q483 705 537 693T620 668T650 646Q650 645 649 637T645 612T639 578L627 514L624 510Q620 507 615 507T597 520T566 548T512 577T430 590Q223 590 223 347T431 104Q478 104 506 112Q508 112 508 164V215H471L434 216L428 222L427 268Q427 315 429 318Q432 323 444 323T544 324H652Q655 320 659 317V45L656 43Q654 39 624 27T536 2T424 -11Q366 -11 317 -2T219 33T137 97T82 200T61 347",
        120283: "92 667Q101 694 143 694H172H198Q244 694 251 669Q253 663 253 539V415H540V539Q540 558 540 585T539 621Q539 673 550 683T611 694H621H646Q671 694 683 690T700 669Q702 663 702 347T700 25Q696 9 684 5T646 0H621H606Q560 0 550 11T539 76Q539 85 539 116T540 169V306H253V169Q253 147 253 116T254 75Q254 23 245 12T194 0H170L119 1Q99 7 92 28V667",
        120284: "85 667Q94 694 136 694H165H191Q237 694 244 669Q246 663 246 347T244 25Q235 0 192 0H163L112 1Q92 7 85 28V667",
        120285: "236 -22Q190 -22 144 -11T72 12T46 29Q63 147 69 153Q80 164 92 146Q124 91 191 91Q222 91 242 102T267 134Q268 139 268 402Q268 663 270 669Q275 687 294 692Q298 694 347 694H367Q393 694 406 690T425 669Q427 663 427 399Q427 132 426 125Q421 87 404 58T366 15T318 -9T273 -20T236 -22",
        120286: "92 667Q101 694 139 694H163H186Q225 694 234 671Q236 663 236 529L237 392L533 682Q550 694 590 694H623H681Q695 680 695 672Q695 670 693 664Q688 657 561 533L431 405L698 33Q701 28 701 23Q701 7 683 0H626H604Q571 0 564 2T545 13Q544 14 530 33T489 90T437 162L332 307Q331 307 284 260L236 214V122V65Q236 32 231 19T210 2Q205 0 161 0L119 1Q99 7 92 28V667",
        120287: "92 667Q98 684 109 689T142 694H172H198Q244 694 251 669Q253 663 253 389V116L278 117Q410 119 490 119H495Q511 119 517 115T534 93V63V48Q534 9 508 2Q503 0 310 0L119 1Q99 7 92 28V667",
        120288: "92 667Q98 684 109 689T146 695Q152 695 167 695T192 694Q200 694 214 694T234 695Q291 695 305 664Q313 651 400 419T487 165Q487 162 488 162T489 165Q489 187 574 413T671 664Q679 680 695 688Q708 694 785 694H828Q855 694 867 689T884 669Q886 663 886 347T884 25Q876 0 832 0H817H802Q758 0 750 25Q748 31 748 293V555L746 544Q737 509 692 386T606 160T564 52Q548 22 502 22H487H472Q423 22 410 52Q407 59 367 160T283 385T231 546L230 548Q229 548 229 293Q229 31 227 25Q222 9 211 5T176 0H158L119 1Q99 7 92 28V667",
        120289: "92 667Q98 684 109 689T146 694H185Q273 694 279 692Q301 689 315 669Q322 660 419 453L554 163L562 143Q564 143 564 401Q564 663 566 669Q574 694 618 694H633H648Q692 694 700 669Q702 663 702 347T700 25Q696 10 683 5T642 0H596H551Q520 0 505 4T478 25Q471 34 374 241L239 532Q231 550 231 552L229 479Q229 440 229 293Q229 31 227 25Q222 9 211 5T176 0H158L119 1Q99 7 92 28V667",
        120290: "362 715Q364 715 376 715T394 716H400Q542 716 626 643T727 426Q731 395 731 342Q731 271 722 225Q674 -22 396 -22Q320 -22 259 -3T148 68T77 201Q62 257 62 342Q62 447 86 522T173 649Q245 707 362 715ZM568 433Q551 623 396 623Q383 623 370 622T333 612T292 591T257 550T233 485Q223 442 223 350Q223 276 232 227T267 137Q309 74 397 74Q433 74 461 85T507 113T537 156T556 205T566 260T569 310T570 357Q570 409 568 433",
        120291: "641 470Q641 426 630 391T603 334T561 295T513 271T459 259T408 254T361 253H350H337H253V142Q253 125 253 100T254 67Q254 32 249 19T227 2Q222 0 170 0L119 1Q99 7 92 28V667Q98 686 118 693Q121 694 271 694Q428 693 462 688Q641 656 641 470ZM487 467Q487 495 485 510T474 546T442 578T382 592Q375 593 310 593H250V347H309H339Q364 347 380 348T418 354T451 368T474 395T486 438Q487 444 487 467",
        120292: "450 -20Q444 -20 429 -21T396 -22Q320 -22 259 -3T148 68T77 201Q62 257 62 342Q62 447 86 522T173 649Q245 707 362 715Q364 715 376 715T394 716Q732 716 732 340Q732 268 719 210T686 120T647 68T615 39T601 29T638 -22T676 -73Q679 -78 679 -83Q679 -98 661 -106H593Q526 -106 521 -104Q514 -103 507 -97T496 -84T477 -55L454 -19L450 -20ZM554 509Q516 622 391 622Q294 622 250 535Q220 475 220 345Q220 299 222 266T234 198T258 140T299 99T363 74Q378 71 393 71H395L381 92Q367 114 353 136T338 161Q336 165 336 170Q336 186 352 193L361 194Q370 194 384 194T412 194H452Q457 194 460 194T466 194T471 192T476 191T480 188T483 185T487 180T492 174T497 167T504 158L526 129Q532 127 552 175Q573 231 573 348Q573 455 554 509",
        120293: "654 24Q654 9 644 5T612 0H577L521 1Q509 5 503 13Q498 20 421 160L343 304H250V168Q250 147 250 118T251 78Q251 24 242 12T192 0H168L119 1Q99 7 92 28V667Q98 686 118 693H124Q131 693 141 693T165 694T195 694T229 694T280 694T332 695Q389 695 428 691T510 675T582 637T627 569Q641 532 641 493Q641 377 537 331L497 317L493 316L571 177Q653 28 654 24ZM487 472T487 492T485 525T476 553T450 577T404 591Q398 592 322 593H250V391H321Q327 391 353 391T385 392T412 395T438 401T457 412T474 430T483 456",
        120294: "61 503Q61 547 72 583T110 650T186 698T305 716Q405 716 496 671Q513 664 514 657Q514 656 513 648T509 623T503 589L491 525L488 521Q484 518 479 518H475L461 532Q430 565 395 581T305 598Q201 598 201 523Q201 480 240 462T345 431T443 394Q549 324 549 204Q549 160 538 123T502 51T427 -2T308 -22Q180 -22 69 41Q50 52 49 57Q49 58 50 66T54 91T60 125L72 189L75 193Q80 196 84 196Q87 196 104 182T145 149T212 117T304 102Q408 102 408 188Q408 215 396 234T362 263T319 278T267 290T219 302Q149 324 105 380T61 503",
        120295: "67 687Q70 688 366 688Q661 688 666 686Q692 680 692 641V629V615Q692 579 666 570H660Q655 569 648 569Q645 569 624 569T581 570Q505 570 475 572H447V302Q447 31 445 25Q436 0 393 0H364L313 1Q293 7 286 28L285 300V572H257Q227 570 151 570Q130 570 109 570T84 569Q77 569 72 570H66Q48 577 44 588T40 631L41 661Q47 680 67 687",
        120296: "92 667Q101 694 143 694H172H200Q242 694 251 671Q253 663 253 430Q254 189 255 185Q262 134 288 107T384 79Q498 79 516 168Q520 191 521 431Q521 663 523 671Q532 694 572 694H596H618Q639 694 648 692T665 679Q671 672 671 653Q672 632 672 555V432Q671 200 670 190Q652 79 581 29T383 -22Q137 -22 98 166Q92 195 92 303V667",
        120297: "27 667Q27 683 39 688T75 694H101Q155 694 159 692Q182 687 194 665Q202 652 283 419T374 142Q376 165 473 445Q552 664 553 666Q568 694 618 694H639H658Q681 694 693 689T705 667Q705 660 592 347Q481 32 477 28Q466 7 441 1H292Q266 7 255 28Q251 32 140 347Q27 660 27 667",
        120298: "994 694Q1012 683 1014 668Q1014 661 977 519T896 217T845 26Q831 0 783 0H747H711Q685 0 672 5T649 26Q644 36 583 272T517 548Q516 552 516 551Q503 479 437 227Q389 37 383 26Q367 0 323 0H288H254Q207 0 193 26Q191 32 108 346T24 665Q24 685 44 693Q47 694 98 694H115Q152 694 168 668Q174 657 235 417T297 144Q297 134 300 153Q307 204 362 421T427 668Q441 694 488 694H523Q586 694 597 688Q612 683 620 661T651 549Q664 496 673 462Q744 194 750 146V140Q767 223 800 354T857 576T883 668Q897 694 938 694H958H994",
        120299: "52 1Q37 11 37 23Q37 26 39 32Q39 34 158 202L275 369Q275 370 221 441T112 586T55 663Q53 669 53 672Q53 687 68 693H72Q77 693 84 693T99 694T118 694T139 694H176Q203 694 212 692T230 682Q231 681 239 669T265 634T296 591L358 504L418 591Q481 682 486 686Q491 691 499 692Q505 694 569 694H632Q650 685 650 672Q650 667 646 660Q643 654 592 582T491 440T441 369T566 201T693 29Q694 27 694 23Q694 11 677 0H607L537 1Q523 6 519 10T437 131Q422 153 411 170T390 200T375 222T365 237T359 245L357 247L348 232Q339 218 319 188T283 131Q222 37 211 22T186 1H52",
        120300: "635 694H668Q688 694 698 690T708 670Q708 664 704 658L446 278L445 152V27Q442 20 440 17T433 9T419 1L368 0H339Q316 0 305 5T288 26Q286 31 286 154V278L157 468Q135 500 101 550Q43 635 34 650T24 671Q24 686 39 693Q42 694 105 694H122H132Q163 694 180 689T214 666Q225 654 336 485Q373 425 373 420L374 418Q375 419 375 421Q378 432 418 493T496 609T536 667Q543 676 551 681T572 689T591 693T615 694T635 694",
        120301: "411 584Q243 581 131 581Q122 581 116 581T106 582T102 582Q84 589 80 600T76 640L77 667Q83 686 103 693Q106 694 343 694Q579 694 584 692Q592 691 599 684T609 668Q610 665 610 646Q610 614 608 608Q605 603 434 361L261 116Q340 117 402 118T490 119T533 120T560 120H572Q605 120 614 95Q616 89 616 60V46Q616 9 590 2Q585 0 339 0Q92 0 87 2Q79 3 72 10T62 26Q61 29 61 49Q61 84 63 90Q65 94 152 217T325 461T411 584",
        120302: "255 394Q218 394 186 383T138 358T109 333T94 321H91Q88 321 86 322T83 325T80 331T79 339T78 349T77 362T75 377Q72 410 72 420Q72 423 72 425T73 429T74 431T77 433T80 435T85 437Q166 475 262 475Q360 475 413 440Q462 406 471 341Q472 332 472 181Q472 155 472 119T473 73Q473 20 462 10T398 0H380Q349 0 337 8T324 48V65Q298 30 257 10T172 -11Q109 -11 70 37T31 145Q31 276 307 289H321V309Q321 337 318 352T300 381T255 394ZM176 146Q176 116 190 97T231 77Q251 77 266 85Q322 110 322 185Q322 189 322 192T322 198L321 201V234L308 232Q176 220 176 146",
        120303: "54 667Q63 694 102 694H127H151Q190 694 199 671Q201 663 201 544L202 422L211 428Q270 468 355 468Q523 468 523 231Q523 -10 321 -10Q286 -10 261 -2T204 33Q197 11 187 6T142 0H126L81 1Q61 7 54 28V667ZM372 230Q372 317 355 349T280 382Q251 382 204 356V107Q235 76 274 76Q301 76 320 84T349 105T364 139T371 180T372 230",
        120304: "188 233Q188 199 190 177T200 131T225 95T271 83H281Q356 83 421 130Q433 138 434 139Q446 141 448 131Q449 128 453 84T457 36Q455 30 432 20T364 -1T273 -11Q37 -11 37 232Q37 456 244 474Q246 474 257 474T276 475Q349 475 400 455Q443 436 448 431L451 425Q451 419 443 377Q442 372 441 366T439 356T438 348T436 340T435 334T433 330T431 327T429 325T426 324Q420 324 406 336Q376 362 350 372T281 382Q254 382 236 373T208 352T194 317T189 278T188 233",
        120305: "225 -11Q192 -11 164 -3T104 29T55 102T37 227Q37 321 63 376Q111 469 223 469Q292 469 349 433L359 426V546Q359 564 359 589T358 623Q358 675 369 684T433 694H451Q497 694 505 669Q507 663 507 347T505 25Q500 9 487 5T450 0H432H413Q356 0 356 36V40Q298 -11 225 -11ZM356 359Q326 382 286 382Q239 382 215 358Q189 330 189 256V229V203V195Q189 102 231 86Q251 76 274 76Q318 76 356 114V359",
        120306: "30 231Q30 301 51 351T107 426T181 463T262 474H268Q293 474 312 472T366 459T422 427T462 363T480 260Q480 230 466 222T405 213Q395 213 364 213T311 214H173V211Q173 183 183 148T216 96Q244 76 287 76Q319 76 350 85T399 104T433 125T451 136Q463 138 465 128Q466 125 469 84T473 39Q471 29 423 13T330 -9Q321 -10 286 -10Q213 -10 161 11T81 68T42 144T30 231ZM353 292Q350 324 342 344T320 373T294 384T264 387Q191 387 175 286V282H353V292",
        120307: "67 458H78V502V509Q78 538 79 556T90 604T117 651T169 685T253 704Q254 704 258 704T265 705T275 705T287 704Q364 704 381 687V638V607Q381 591 378 585T366 579Q362 581 351 591T323 610T282 618Q238 618 226 587Q224 581 223 519V458H253Q288 458 298 453Q315 441 315 415Q315 399 312 390T299 377T282 372T259 371H255H226V201Q226 31 224 25Q215 0 174 0H150L106 1Q86 7 79 28L78 199V371H69Q29 371 29 412Q29 425 30 431T40 447T67 458",
        120308: "63 108Q63 142 83 176L76 184Q35 227 35 300Q35 469 243 469Q330 469 385 437L397 443Q451 469 508 469Q515 468 517 466T522 456T528 425Q534 392 534 386Q532 379 523 377Q520 377 509 381T477 390T431 398L425 399Q453 362 453 297Q453 268 445 242T417 189T351 146T242 130Q169 130 119 153Q117 141 117 136Q117 95 155 83Q161 81 252 81Q354 80 362 79Q437 71 475 48T526 -24Q532 -42 532 -65Q532 -116 489 -156T341 -204Q323 -206 274 -206H256Q39 -206 18 -84Q17 -79 17 -68Q17 15 82 42L76 53Q63 79 63 108ZM310 300Q310 359 298 377T238 396Q217 396 204 390T186 368T179 339T178 300Q178 245 189 224T244 203T299 224T310 300ZM414 -66Q414 -55 411 -47T401 -32T387 -21T368 -14T346 -10T322 -7T297 -6T271 -6T246 -6H193Q163 -6 154 -10T140 -30Q135 -45 135 -62Q135 -134 274 -134Q414 -134 414 -66",
        120309: "53 667Q62 694 101 694H126H148Q191 694 198 669Q200 663 200 526V390Q263 469 361 469Q390 469 412 465T456 449T491 413T507 351Q508 342 508 185Q508 31 506 25Q498 0 450 0H432H413Q368 0 359 23Q357 31 357 186Q356 345 355 350Q349 369 336 376Q324 381 301 381H298Q269 381 242 362Q217 342 210 316T202 239Q202 229 202 202T203 157V82Q203 24 195 12T146 0H125L80 1Q60 7 53 28V667",
        120310: "72 574Q55 583 51 591T46 619V636L47 670L48 673Q50 676 52 678T56 684T63 690T73 694H81Q89 694 102 694T129 695H181Q193 687 196 685T203 676T207 661T208 634Q208 603 204 593T181 574H72ZM54 431Q63 458 102 458H127H149Q192 458 199 433Q201 427 201 229T199 25Q190 0 149 0H125L81 1Q61 7 54 28V431",
        120311: "70 634V648Q70 686 96 693Q100 695 151 695H176Q201 695 213 691T230 670Q232 665 232 634V620Q232 582 206 575Q202 573 151 573H126Q101 573 89 577T72 598Q70 603 70 634ZM-41 -84Q-1 -105 28 -105Q67 -105 78 -85Q83 -77 83 -48T84 180Q84 427 86 433Q93 458 136 458H158H180Q201 458 209 456T225 443Q230 436 231 418Q232 397 232 313V183V124V40Q232 -55 228 -87T203 -147Q166 -205 78 -205Q31 -205 -20 -189T-71 -159Q-71 -156 -62 -124T-52 -89Q-49 -84 -41 -84",
        120312: "496 23Q496 9 487 5T457 0H427H398Q367 0 354 11Q352 12 288 99L226 183L191 150V90V54Q191 30 186 18T165 2Q160 0 124 0L90 1Q70 7 63 28V667Q72 694 108 694H128H146Q183 694 192 671Q194 663 194 496L195 325L254 383Q266 394 281 409T301 429T316 441T329 450T341 455T357 458T376 458H409H436Q461 458 470 454T480 437Q480 430 477 427T445 395Q417 368 396 347L319 271Q319 270 358 217T442 103T494 32Q496 30 496 23",
        120313: "54 667Q63 694 102 694H127H149Q192 694 199 669Q201 663 201 347T199 25Q190 0 149 0H125L81 1Q61 7 54 28V667",
        120314: "197 386Q256 468 366 468Q404 468 430 461T471 438T491 413T503 385Q563 469 666 469Q731 469 769 446T814 350Q815 343 815 185Q815 31 813 25Q808 9 796 5T758 0H737L692 1Q672 7 665 28L664 186V206V290Q664 349 655 365T610 381Q581 381 560 370T529 341T515 311T510 291Q509 286 509 157V82Q509 24 501 12T452 0H431L386 1Q366 7 359 28L358 186V206V290Q358 349 349 365T304 381Q275 381 254 370T223 341T209 311T204 291Q203 286 203 157V82Q203 24 195 12T146 0H125L80 1Q60 7 53 28V437Q58 453 80 464H122H142Q167 464 178 460T195 439Q197 434 197 409V386",
        120315: "197 386Q264 468 350 468Q375 468 390 467T429 460T466 443T492 408T507 351Q508 342 508 185Q508 31 506 25Q498 0 450 0H432H413Q368 0 359 23Q357 31 357 186Q356 345 355 350Q349 369 336 376Q324 381 301 381H298Q269 381 242 362Q217 342 210 316T202 239Q202 229 202 202T203 157V82Q203 24 195 12T146 0H125L80 1Q60 7 53 28V437Q58 453 80 464H122H142Q167 464 178 460T195 439Q197 434 197 409V386",
        120316: "274 -11Q32 -11 32 225Q32 346 85 406T249 474H266H271Q302 474 325 471T385 458T451 419T498 346Q518 300 518 225Q518 -11 274 -11ZM367 233Q367 322 350 354T270 387Q240 387 222 377T195 344T184 298T182 233Q182 151 198 117T275 83H282Q318 83 339 104Q355 119 361 146T367 233",
        120317: "125 458H139Q174 458 185 452T202 420L211 426Q245 448 288 458T354 469Q356 469 361 469T369 468Q443 468 481 412Q523 355 523 223Q523 164 509 120T473 51T423 12T371 -7T323 -11Q260 -11 204 33V-65Q204 -80 204 -102T205 -131Q205 -162 200 -175T178 -192Q173 -194 126 -194L81 -193Q61 -187 54 -166V431Q58 447 81 458H125ZM372 230Q372 376 282 376Q247 376 204 352V107L208 103Q213 99 218 95T232 87T251 79T274 76Q323 76 349 116Q372 153 372 230",
        120318: "226 -11Q37 -11 37 236Q37 294 51 338T86 407T135 445T186 464T233 469H235Q300 469 349 422L359 413V425Q359 452 376 464Q384 469 433 469H455Q498 469 505 444Q507 438 507 137Q507 -163 505 -169Q500 -185 487 -189T450 -194H432H413Q367 -194 358 -171Q356 -163 356 -63V40L348 33Q296 -11 231 -11H226ZM281 375Q188 375 188 228Q188 77 275 77Q322 77 359 120V328Q338 357 324 366T281 375",
        120319: "54 437Q58 453 81 464H122H147Q186 464 194 439Q196 434 196 405V377L203 387Q245 456 324 468Q325 468 331 468T340 469Q347 469 356 462V360Q350 355 346 354T339 353T326 353T300 347Q260 337 234 311T202 252Q201 247 201 138Q201 122 201 98T202 66Q202 33 197 20T175 2Q170 0 125 0L81 1Q61 7 54 28V437",
        120320: "37 328Q37 392 75 433T203 474Q254 474 265 473Q319 465 370 442Q378 439 380 432Q380 426 372 384Q364 336 359 333Q358 331 355 331Q348 331 337 341Q282 388 216 388H208Q190 388 180 387T161 377T151 351Q151 333 164 323T224 306L267 297Q314 285 355 246T396 144Q396 17 282 -5Q260 -10 218 -10Q170 -10 124 2T55 26T30 44Q30 48 39 99T49 153Q52 159 60 159Q66 159 70 153Q100 120 133 101T218 82Q231 82 238 83T258 87T277 101T283 126Q283 149 260 160T200 176T153 186Q109 201 73 236T37 328",
        120321: "225 267Q225 202 226 169T232 115T244 88T265 82Q295 84 318 100T345 116Q352 116 354 110T364 77Q373 46 373 43Q373 28 312 9T190 -10Q160 -10 139 1T107 29T89 77T82 136T80 210V258V371H66H59Q39 371 27 386Q20 394 20 417Q21 432 23 437Q35 458 60 458H65H83V510L84 562Q93 589 131 589H154H174Q216 589 223 564Q225 558 225 508V458H274Q330 458 338 453Q355 441 355 415Q355 388 338 376Q330 371 274 371H225V267",
        120322: "53 431Q62 459 100 459Q105 459 114 459T127 458H152Q192 458 201 435Q203 427 203 262Q204 86 208 77Q209 74 216 71Q227 66 258 66H264Q334 66 354 140L356 150L357 290Q357 427 359 435Q365 449 377 453T412 458H432H450Q498 458 506 433Q508 427 508 229T506 25Q498 0 451 0H434H418Q386 0 374 7T360 43V58L352 49Q298 -11 199 -11Q135 -9 101 11T56 80Q52 100 52 273L53 431",
        120323: "26 429T26 435T32 448T44 456Q48 458 85 458H99Q145 458 161 431Q162 429 207 285L251 145L294 284Q333 410 341 430Q351 451 374 456Q379 458 420 458H430Q450 458 457 456T471 443Q473 437 473 435Q473 426 443 325T381 126L350 28Q339 7 316 2Q312 0 250 0Q187 0 183 2Q160 7 149 28L136 68Q124 109 106 166T70 283T39 385",
        120324: "699 458Q717 447 719 432Q719 426 666 230T610 27Q602 10 588 5T548 0H512H482Q431 0 420 17T384 135Q356 241 352 298V308L351 295Q348 251 322 145T290 28Q279 0 233 0H212H191Q146 0 133 27Q130 33 77 229T24 430Q24 449 44 457Q47 458 79 458Q122 458 126 456Q154 450 163 419L233 153Q241 187 272 304T307 431Q318 458 368 458Q394 458 398 456Q421 451 430 431Q434 423 509 147L547 286Q582 416 588 429Q600 454 624 457Q632 458 647 458H663H699",
        120325: "92 0Q87 0 77 0T62 -1Q24 -1 24 22Q24 29 33 41T106 136Q185 237 184 238Q184 239 147 284T73 376T33 427Q31 430 31 436Q31 451 45 457Q48 458 96 458H122Q152 458 163 450T208 394L247 345L282 394Q288 403 297 416T309 434T319 444T328 452T338 455T352 458T372 458H393H440Q457 449 457 435Q457 428 450 419T379 328Q308 239 308 237L389 137Q409 112 436 79Q475 31 475 23Q475 -1 436 -1Q432 -1 422 -1T407 0Q360 0 352 3Q343 6 336 16T291 83L247 151L245 148Q243 145 239 139T229 124T218 106T204 84Q167 24 160 15T141 1L92 0",
        120326: "454 458Q473 446 473 430Q473 426 394 184L311 -68Q291 -119 245 -162T123 -205Q51 -205 46 -190Q44 -187 40 -142T36 -92Q36 -90 36 -88L37 -87Q41 -80 46 -80Q48 -80 73 -92T126 -105Q146 -105 161 -98T185 -76T197 -53T206 -28L215 0L122 212Q29 427 29 435Q29 448 46 457Q49 458 91 458Q93 458 106 458T125 457T140 454T157 446T170 431Q183 410 224 305T266 158Q266 152 266 151Q267 151 268 163Q271 206 302 310T342 432Q354 458 398 458H418H454",
        120327: "268 376Q250 376 180 375T92 374Q69 374 63 380Q46 390 46 419Q46 428 49 437Q57 451 73 457Q76 458 242 458T413 456Q420 455 427 448Q439 438 439 413Q439 392 433 385Q432 383 318 236T204 88Q235 88 306 89T395 90H399Q408 90 414 89T427 84T438 70T442 45Q442 9 416 2Q411 0 236 0H136Q73 0 62 1T41 12Q31 23 31 47Q31 68 36 77Q37 78 51 97T96 155T153 228L268 376",
        120328: "28 0L429 694H533L585 350Q596 275 610 182T632 46L638 3V0H530L528 18Q527 25 515 103T503 183H223L135 29L118 1L73 0H28ZM492 254Q492 256 473 398T454 589V610Q433 552 290 301L264 255L378 254H492",
        120329: "501 363Q557 355 605 316T653 222Q653 148 586 85T403 2Q394 1 240 0Q90 0 90 1L100 46Q109 90 128 177T164 348L238 694H375Q518 693 546 688Q614 674 655 635T696 544Q696 490 648 441T516 368L501 363ZM601 530Q601 568 566 590T479 621Q472 622 394 623H320L297 513Q292 489 286 459T276 415L273 401V399H339H372Q504 399 571 466Q601 498 601 530ZM257 322Q256 320 230 197T203 73Q203 71 289 71Q379 72 387 73Q459 84 507 122T556 210Q556 255 519 283T428 320Q415 322 336 323Q257 323 257 322",
        120330: "124 266Q124 372 179 473T333 639T544 705Q592 705 635 697T698 679L718 670Q719 669 701 621T681 572L676 576Q670 580 661 586T641 598T614 611T583 620Q558 625 526 625Q406 625 318 516T230 276Q230 238 236 212Q251 148 294 108T412 68Q469 68 508 80T598 123Q608 129 608 128Q606 109 603 87L598 45L573 33Q521 7 486 -1T394 -10Q358 -10 346 -8Q260 5 202 62Q124 145 124 266",
        120331: "162 348L236 694H385Q535 693 543 692Q600 682 641 654T705 586T737 506T747 425Q747 296 672 187Q625 114 548 62T384 1Q376 0 262 0Q88 0 88 1L98 46Q107 90 126 177T162 348ZM622 533Q575 624 443 624Q434 624 419 624T399 623H321L263 348Q249 283 234 213T212 107L204 72Q204 71 289 71Q374 72 386 74Q501 94 573 193T646 422Q646 487 622 533",
        120332: "86 2Q88 4 160 346T233 689Q233 691 461 691Q688 691 688 689Q685 686 671 611H495L320 612L319 609Q319 607 297 501L274 397H436Q597 397 597 396L596 391Q595 386 593 376T589 358L581 322L420 321Q258 321 258 320Q209 89 208 87Q208 85 390 85Q417 85 460 85T518 86L572 85Q556 8 554 2V0H86V2",
        120333: "86 2Q88 4 160 346T233 689Q233 691 453 691T673 689Q670 686 656 611H488L320 612Q314 579 302 523T281 427T272 385Q272 384 419 384H567L551 308H255L223 156Q216 124 207 82T194 20L190 2Q190 0 138 0H86V2",
        120334: "125 267Q125 375 182 476T337 641T544 705Q598 705 644 693T710 669T730 655L712 609L693 560L692 557L681 567Q618 626 526 626Q447 626 378 573T269 440T229 277Q229 185 276 127T406 68Q422 68 451 71T502 78T524 84L526 93Q528 102 532 119T539 153L553 222Q553 223 495 223Q436 223 436 224Q436 230 444 262L452 299H662V296Q661 290 635 166T607 40Q606 37 576 25T492 1T391 -11Q272 -11 199 66T125 267",
        120335: "517 2Q518 3 551 161T585 322Q586 323 557 323T422 323H259L190 0H138Q86 0 86 1L96 46Q105 90 124 177T160 348L234 694H337V691Q336 690 306 545T275 399H602L603 403Q603 407 634 551L665 694H768V691Q768 690 695 348T621 2V0H517V2",
        120336: "161 348L235 694H338V691Q338 690 265 348T191 2V0H139Q87 0 87 1L96 46Q106 90 125 177T161 348",
        120337: "377 424L435 694H535V691Q534 685 476 412T416 135Q401 74 350 26T210 -22Q165 -22 124 -11T65 9T46 21L54 41Q62 61 70 83T81 109Q82 111 85 106Q86 105 87 103Q93 94 103 84T135 64T185 53Q238 53 272 76T317 142Q317 145 325 182T348 289T377 424",
        120338: "236 223Q235 222 213 113T188 2V0H138Q88 0 88 1L98 46Q107 90 126 177T162 348L236 694H285Q335 694 335 693L330 671Q326 649 316 603T298 518Q289 477 280 433T266 366L261 343L672 694H729L784 693L465 420L651 0H596L541 1L384 350Q383 351 310 288T236 223",
        120339: "161 348L235 694H338V691Q338 690 273 385T208 79Q278 80 362 80H516Q502 11 499 2V0H293Q87 0 87 1L96 46Q106 90 125 177T161 348",
        120340: "375 691Q456 215 459 124V106Q488 177 762 641L793 694H929V691Q929 690 856 348T782 2V0H689V2Q691 4 753 304Q817 604 818 606Q819 611 817 608Q817 607 815 603Q798 559 540 117L484 22H440L397 23L393 42Q393 47 373 169T334 422T315 594V609L250 306Q186 3 185 2Q185 0 138 0Q92 0 92 1L102 46Q111 90 130 177T166 348L240 694H375V691",
        120341: "311 609Q310 608 246 306T181 2V0H134Q88 0 88 1L98 46Q107 90 126 177T162 348L236 694H382L383 691Q383 688 418 561T493 286T541 97L544 84L545 89Q545 90 553 128T578 246T610 394L674 694H766V691Q766 690 693 348T619 2V0H472L469 13Q468 17 393 293T312 605L311 609",
        120342: "118 254Q118 366 174 473T324 648T517 716Q627 716 695 638T763 435Q763 321 706 215T555 43T362 -22Q256 -22 187 56T118 254ZM380 58Q452 58 518 116T622 263T661 442Q661 496 646 535T608 594T567 622T534 634Q516 636 496 636Q400 636 313 528T225 264Q225 172 267 115T380 58",
        120343: "162 348L236 694H378Q522 693 530 692Q604 680 647 635T690 524Q690 474 665 430T612 359Q550 299 465 280Q443 275 343 274H250V271Q250 269 235 201T206 68T192 2V0H140Q88 0 88 1L98 46Q107 90 126 177T162 348ZM594 513Q594 560 562 588T477 622Q470 623 394 623H321L293 487L263 349V347H342H347H375Q530 347 578 449Q594 483 594 513",
        120344: "118 254Q118 366 174 473T324 648T517 716Q627 716 695 638T763 435Q763 305 693 194T543 36Q547 29 586 -47T625 -125H504L450 -8Q406 -22 363 -22Q256 -22 187 56T118 254ZM661 437Q661 532 616 584T506 636Q428 636 361 578T257 433T220 258Q220 167 264 113T380 58Q390 58 397 58T408 59T413 60T417 61Q417 63 387 127T356 193Q356 194 409 194H462L485 150L508 105Q509 103 532 125T567 161Q661 278 661 437",
        120345: "162 348L236 694H375H414H445Q507 694 538 690T606 668Q698 623 698 534V528Q698 447 608 377Q582 358 555 345T512 326L497 321L617 0H565L513 1L402 309H255L189 0H138Q88 0 88 1L98 46Q107 90 126 177T162 348ZM603 525Q603 603 499 620Q486 622 403 623H321L297 506Q292 482 285 449T274 402L271 387V385H346Q350 385 363 385T386 384Q548 384 592 479Q603 503 603 525",
        120346: "161 478Q161 568 242 642T435 716Q527 716 599 673L609 667Q595 633 589 615L571 568Q570 568 564 575T546 592T518 611T475 628T417 635Q351 635 305 596T259 507Q259 465 290 444T372 411T432 396Q473 385 509 343T545 236Q545 140 464 59T270 -22Q155 -22 54 48L92 146Q93 146 101 138T124 117T161 92T216 72T288 63Q360 63 403 109T447 204Q447 220 444 233T435 256T421 273T404 285T385 295T366 301T347 306T331 310T315 314T292 321T265 331T235 346T207 367T183 395T168 431T161 478",
        120347: "165 608L182 687Q182 688 486 688H790L789 685L781 645L773 609H521L457 306Q393 3 392 2Q392 0 340 0H288V2Q289 5 353 304T417 605V609L291 608H165",
        120348: "340 -22Q251 -22 191 33T131 177V187Q131 192 131 195T132 205T133 215T136 231T141 253T147 285T156 328T168 384T184 457L235 694H338V691Q338 690 288 451T236 210Q234 194 234 177Q234 138 247 111T280 72T319 54T357 49Q408 49 449 74T510 128Q516 136 521 143T530 158T538 175T545 194T553 220T560 250T569 289T579 336T591 395T606 464L655 694H747V691Q651 243 645 213Q623 149 587 102Q482 -22 340 -22",
        120349: "220 348L161 694H216Q270 694 270 693L283 613Q334 313 346 215Q359 102 359 96Q359 87 358 84Q388 162 684 657L706 694H753Q799 694 799 693L387 0H333Q279 0 279 1L272 45Q264 89 249 177T220 348",
        120350: "596 540Q596 562 597 585T599 609Q599 588 436 255Q402 185 362 104L310 0H213V3Q213 6 188 347T161 694H263L265 664Q290 327 293 184Q293 112 289 85Q290 85 290 87Q290 95 301 123T332 194T373 282T419 380T463 469T498 541T517 579L574 694H671V689L674 646Q678 603 682 538T691 401T699 263T703 160Q703 102 700 87Q719 154 930 576L989 694H1076Q1076 693 903 347L730 0H628V4L626 26Q624 48 622 85T616 168T609 267T603 369T598 464T596 540",
        120351: "14 0Q17 3 184 184T352 367L265 529Q244 567 222 609T188 672L176 692Q176 694 236 694H297L338 612Q387 515 400 489L421 448L645 694H758L708 640Q481 393 456 368Q455 366 500 281T596 104T652 0H531L388 293L128 0H14",
        120352: "151 692Q151 694 212 694H272L418 362L696 683L705 694H758L809 693Q809 692 630 490T444 280Q442 275 413 139L383 1L333 0Q282 0 282 2Q283 3 312 141L341 278L246 484L151 692",
        120353: "67 54Q551 615 551 617Q543 618 517 618Q510 618 463 618T376 617Q200 617 200 618T209 657L216 694H459Q702 694 702 692Q702 689 697 667L692 643L207 80H392Q493 81 577 81Q577 70 560 2V0H55V2L67 54",
        120354: "313 386Q286 386 260 381T217 369T186 355T164 342T155 337Q154 338 159 377T165 418Q251 461 320 461Q322 461 328 461T337 460Q397 460 435 424T473 329Q473 325 473 318T472 308Q432 110 407 2V0H317V2L325 38Q295 21 269 10Q215 -10 156 -10H149Q76 -10 62 69Q61 75 61 90Q61 127 73 150T116 194Q146 215 207 231T348 252H368L373 277Q378 302 378 318Q378 367 339 384Q332 386 313 386ZM150 116Q150 93 171 79T223 65Q259 65 293 85T341 135Q343 140 348 160T353 184Q353 186 342 186Q298 186 231 174T153 134Q150 127 150 116",
        120355: "302 -11Q266 -11 235 1T190 26L176 38Q170 8 168 2V0H121Q75 0 75 1L84 46Q94 90 113 177T149 348L223 694H267Q312 694 312 693T282 551T251 407Q251 406 256 408T271 415Q347 454 430 454H438Q501 454 528 374Q539 339 539 299Q539 179 466 84T302 -11ZM443 275Q443 317 421 348T346 379Q318 379 296 369Q269 359 238 332L193 118L198 109Q220 65 269 65Q350 65 396 130T443 275",
        120356: "75 164Q75 226 100 282T165 377T252 437T342 460H347Q447 460 499 417L483 378Q468 339 468 338Q466 338 455 347T424 366T385 378Q355 382 334 382Q262 382 215 318T168 177Q168 120 196 95T259 69H269Q345 69 420 108Q432 114 432 113T427 72L422 32L402 22Q382 12 344 2T259 -11Q214 -11 180 2T126 36T95 81T79 126T75 164",
        120357: "73 156Q73 224 102 293T184 408T294 455Q375 455 432 413Q438 407 438 410T469 553L499 694H588V691Q588 690 515 348T441 2V0H348V2Q357 29 357 43L352 41Q332 24 288 7T196 -10H190Q178 -10 166 -7T134 8T98 46T75 113Q73 129 73 156ZM419 335Q419 339 412 348T386 368T342 379Q284 379 243 343T184 261T167 168Q167 122 191 94T263 66Q321 66 367 116L374 124L397 229Q419 333 419 335",
        120358: "248 -11Q170 -11 121 41T71 173Q71 265 133 349T285 454Q305 460 318 460H328Q368 460 399 448Q472 414 472 309Q472 274 464 234L462 219H159Q156 198 156 185Q156 137 179 107T237 68Q246 66 268 66Q345 66 427 113V109Q426 108 422 73T417 37Q417 34 409 29Q329 -11 248 -11ZM401 299Q399 337 376 361T316 385Q291 385 266 371Q220 350 184 289H401V299",
        120359: "381 443Q381 440 374 407T366 371H315Q263 371 263 369Q262 368 224 186Q215 145 205 97T189 25L184 2V0H94V2L99 25Q104 48 114 96T134 186Q172 368 173 369Q173 371 139 371H106V373L114 410L121 444H155L188 445L191 455L212 551Q232 612 288 658T415 705Q438 705 464 701T494 694Q478 614 477 614L467 618Q457 621 440 624T406 629H400Q333 629 306 579Q301 568 289 507L275 444H328Q381 444 381 443",
        120360: "113 252Q113 334 177 394T311 454Q332 454 350 451T379 442T398 432T410 424L413 421Q412 423 411 424L409 426Q409 429 434 436T496 449T560 455H568V451Q568 447 567 429T566 394L565 377L553 379Q522 385 479 385Q463 385 456 384L443 383L436 392Q454 357 454 324Q454 243 390 182T249 120Q233 120 219 122T195 128T178 136T167 142L163 145Q149 131 149 105Q149 78 171 72L242 71Q246 71 269 71T303 71T336 68T372 62T403 51T432 32Q461 8 461 -40Q461 -112 383 -159T211 -206Q123 -206 68 -172T12 -86Q12 -55 31 -23T82 32Q90 38 89 39Q89 40 87 44T82 59T80 82Q80 134 126 189Q113 228 113 252ZM369 319Q369 354 350 368T304 383Q274 383 252 369T218 333T202 291T197 255Q197 221 217 206T263 191Q317 191 343 233T369 319ZM373 -59Q373 -41 362 -30T330 -13T291 -7T247 -5H216Q167 -5 158 -6T139 -12Q123 -20 110 -38T97 -76Q97 -102 133 -118T221 -134Q242 -134 267 -130T316 -118T357 -94T373 -59",
        120361: "416 321Q416 379 336 379Q276 379 237 302Q226 276 209 202T180 66T166 2V0H119Q73 0 73 1L82 46Q92 90 111 177T147 348L221 694H265Q310 694 310 693T279 544L247 395Q325 455 403 455Q513 455 513 358Q513 334 508 309Q507 304 476 156T443 2V0H350V2L357 34Q364 65 373 110T392 200T409 281T416 321",
        120362: "189 578Q190 579 199 627T211 678V680H315V678Q313 675 304 627T293 578V576H189V578ZM168 442T168 443T213 444T258 443T212 225T164 2V0H74V2Q75 7 121 224",
        120363: "211 577L233 680H284Q336 680 336 679L315 576H263Q211 576 211 577ZM19 -204Q-12 -204 -40 -196T-82 -179T-96 -170Q-96 -168 -78 -132L-61 -95L-54 -103Q-32 -126 3 -126Q26 -126 50 -116Q76 -101 83 -85Q84 -79 140 180T196 443Q196 444 241 444T286 443Q286 441 232 186T175 -75Q163 -120 122 -162T19 -204",
        120364: "150 348L224 694H310V691Q218 259 218 258L232 270Q245 281 274 306T327 351L435 444H489L542 443Q542 442 443 357L344 272L471 1L422 0H372L366 14Q359 27 347 54T323 105L273 210Q271 210 231 174L190 139L160 0H118Q76 0 76 1L86 46Q95 90 114 177T150 348",
        120365: "148 348L222 694H311V691Q311 690 238 348T164 2V0H119Q74 0 74 1L84 46Q93 90 112 177T148 348",
        120366: "416 321Q416 379 336 379Q276 379 237 302Q226 276 209 202T180 66T166 2V0H119Q73 0 73 2L121 226L169 449Q169 450 213 450H256L249 421Q248 417 247 412T246 404T245 398T244 394T244 392Q250 398 261 407T307 433T379 454H392H400Q451 454 472 439Q482 434 489 427T500 412T506 399T510 388L511 384Q511 384 517 388Q563 431 620 446Q648 455 680 455Q790 455 790 358Q790 334 785 309Q784 304 753 156T720 2V0H627V2L634 34Q641 65 650 110T669 200T686 281T693 321Q693 379 613 379Q553 379 514 302Q503 276 486 202T457 66T443 2V0H350V2L357 34Q364 65 373 110T392 200T409 281T416 321",
        120367: "416 321Q416 379 336 379Q276 379 237 302Q226 276 209 202T180 66T166 2V0H119Q73 0 73 2L121 226L169 449Q169 450 213 450H256L249 421Q248 417 247 412T246 404T245 398T244 394T244 392Q250 398 261 407T307 433T379 454H392Q416 454 433 452T470 440T502 411T513 358Q513 334 508 309Q507 304 476 156T443 2V0H350V2L357 34Q364 65 373 110T392 200T409 281T416 321",
        120368: "69 169Q69 238 107 306T211 417T348 461Q419 461 471 412T523 271Q523 161 438 75T247 -11Q170 -11 120 39T69 169ZM432 279Q432 338 401 361T333 385Q280 385 240 352T182 273T164 178Q164 119 195 94T265 68Q306 68 344 94Q380 115 406 169T432 279",
        120369: "259 443Q251 405 251 404L260 409Q269 414 286 421T324 436T375 449T434 455Q482 455 510 417T538 303Q538 169 463 79T302 -11Q226 -11 176 39V36Q175 35 151 -80L127 -193Q127 -194 80 -194H34V-191L102 127L169 443Q169 444 214 444T259 443ZM269 65Q332 65 386 124T441 262Q441 304 422 334T370 373Q356 375 339 375Q293 375 238 331L193 118Q200 103 206 94T229 75T269 65",
        120370: "72 149Q72 272 146 363T304 455Q340 455 371 442T409 423T436 398Q438 411 442 427L448 455H538L400 -193Q400 -194 354 -194Q307 -194 307 -193L356 37V41Q355 41 350 38T332 27T302 13Q247 -10 191 -10H179Q138 -10 105 32T72 149ZM414 298Q402 376 341 376Q277 376 223 317T169 182Q169 121 198 93T265 65Q319 65 365 111L377 123L414 298",
        120371: "240 377L244 380Q248 384 255 390T272 404T296 419T325 434T361 446T401 454Q403 454 408 454T416 455H424L421 442Q419 435 413 405T406 373Q351 373 294 336T216 237Q213 231 201 173T178 60T164 2V0H119Q74 0 74 2L122 226L170 449Q170 450 213 450H255L247 414Q246 409 245 403T243 393T241 385T240 379T240 377",
        120372: "99 299Q99 318 106 341T133 393T195 441T298 461Q336 461 370 453T420 437L436 429Q436 428 421 389T405 350Q356 386 273 386H265Q248 386 237 384T211 371T191 337Q189 329 189 326Q189 320 190 315T194 306T200 299T209 293T218 289T228 285T239 283T251 281T263 278L270 276Q278 275 283 274T298 270T316 264T333 255T351 243T367 228T380 209T388 186T391 157Q391 96 341 43T193 -11Q171 -11 150 -8T114 -1T84 9T61 19T45 28T35 33Q35 36 67 116L76 109Q132 67 211 67Q258 67 279 88T301 135Q301 159 280 170T224 187T180 197Q141 212 120 239T99 299",
        120373: "245 68Q267 68 289 75T322 90L334 98Q338 94 338 28V24L324 19Q268 -4 218 -8Q198 -11 177 -11Q118 -11 118 75Q118 98 123 127Q125 137 149 251T174 369Q174 371 135 371H97V373L105 410L112 444H152L192 445L200 478Q208 512 213 541L219 571H261Q303 571 303 570T290 506L276 444H343Q410 444 410 443Q410 440 403 407T395 371H328Q261 371 261 369Q211 152 211 118Q211 68 245 68",
        120374: "166 -10H160Q146 -10 137 -8T115 0T97 22T90 63Q90 79 130 268L167 443Q167 444 214 444Q260 444 260 443L224 273Q187 97 187 86Q187 70 202 65T250 59Q303 59 336 83T379 139Q380 143 412 292T444 443Q444 444 491 444Q537 444 537 443T491 225T443 2V0H353V2L361 38L352 34Q344 29 326 22T286 7T232 -5T166 -10",
        120375: "177 6L108 442V444H201V442Q202 441 213 371T235 213T246 90V65Q259 117 429 406L450 444H495Q540 444 540 443Q539 442 411 221L282 1L230 0H178L177 6",
        120376: "148 5Q147 8 128 222T109 440L108 444H199V442Q200 441 204 385T214 253T219 140Q219 108 215 76Q215 72 214 67V65L215 66Q219 95 278 221L390 444H475V437Q497 203 497 121Q497 90 494 70Q494 67 494 67L496 73Q520 143 654 405L674 444H718Q762 444 762 443L534 1L483 0H432V5Q429 28 422 126T413 283Q413 343 416 370L417 378Q416 377 416 376Q401 303 248 12L242 0H148V5",
        120377: "317 229Q453 9 460 0H409L359 1L312 88Q266 176 265 176Q265 177 254 165T223 132T182 88L100 0H1L15 14Q29 28 61 59T118 115L236 229L226 244Q108 433 100 444H201L290 294L438 444H537L528 435Q526 432 512 418T468 376T418 327L317 229",
        120378: "11 -117L20 -120Q28 -124 46 -128T84 -132H100Q124 -122 149 -85Q200 -6 200 1Q200 17 155 204T109 442Q109 444 156 444H203Q203 443 208 419T221 357T235 277T248 190T254 114Q254 81 250 67V65Q251 65 251 67Q256 94 297 177Q339 259 422 397L450 444H540Q540 443 386 186T219 -90Q179 -153 145 -179T73 -205Q52 -205 34 -202Q29 -202 21 -201T7 -198L1 -197Q1 -196 6 -157T11 -117",
        120379: "129 408L136 444H315Q494 444 494 443Q494 441 489 419L484 396L164 76L291 77Q418 77 418 76T411 41T402 2V0H215Q28 0 28 2L34 27L38 50L360 371L240 370Q121 370 121 371Q124 388 129 408",
        120432: "191 76Q212 75 220 68T229 38Q229 10 208 1H129H80Q48 1 38 7T28 38Q28 51 29 57T40 69T70 76Q89 76 89 78Q90 79 117 205T173 461T205 599Q212 623 250 623H262H273Q312 623 319 599Q322 591 350 461T406 205T435 78Q435 76 454 76H458Q484 76 493 59Q496 53 496 38Q496 11 478 3Q474 1 395 1H317Q295 8 295 38Q295 65 311 73Q316 75 333 76L348 77V78Q348 80 341 112L334 143H190L183 112Q176 80 176 78Q175 76 178 76Q180 76 191 76ZM318 221Q313 238 288 366T263 519Q263 526 262 527Q261 527 261 520Q261 493 236 365T206 221Q206 219 262 219T318 221",
        120433: "39 1Q17 10 17 32V38V46Q17 65 34 73Q40 76 61 76H84V535H61H54Q27 535 19 553Q17 557 17 573Q17 583 17 587T23 599T39 610Q40 611 179 611Q320 610 332 607Q332 607 339 605Q394 591 427 547T461 454Q461 413 436 378T369 325L358 320Q405 311 443 270T482 169Q482 112 445 64T345 3L334 1H39ZM309 533Q302 535 234 535H168V356H230Q284 357 296 358T323 368Q346 380 361 402T377 452Q377 482 358 505T309 533ZM398 176Q396 218 371 246T315 279Q310 280 237 280H168V76H239Q316 77 327 81Q329 82 334 84Q398 107 398 176",
        120434: "40 305Q40 437 110 529T281 622Q315 622 343 611T387 589T404 578Q409 585 415 596T425 611T435 618T452 622Q472 622 478 609T485 566Q485 559 485 540T484 508V460Q484 413 478 403T442 393Q417 393 409 402Q400 409 400 420Q400 428 395 445T380 487T347 528T295 546Q235 546 180 483T124 306Q124 245 141 197T186 121T241 80T296 66Q346 66 373 103T400 178Q400 209 435 209H442H450Q484 209 484 172Q480 96 421 43T281 -11Q177 -11 109 84T40 305",
        120435: "38 1Q16 8 16 38Q16 62 32 73Q39 76 58 76H78V535H58Q40 535 32 538Q16 548 16 573Q16 587 17 591Q23 604 34 607T83 611H166H176Q188 611 209 611T239 612Q299 612 337 597T415 530Q485 438 485 300Q485 180 431 100T301 3L291 1H38ZM400 301Q400 363 385 410T346 482T303 519T267 534Q261 535 210 535H162V76H214L267 77Q323 89 361 148T400 301",
        120436: "374 271Q374 241 367 232T332 223Q307 223 299 231Q290 240 290 263V279H173V76H418V118V144Q418 167 426 176T460 186Q491 186 500 166Q502 161 502 93V52Q502 25 499 17T480 1H41Q19 9 19 32V38Q19 63 36 73Q42 76 65 76H89V535H65H55Q44 535 38 537T25 548T19 573Q19 602 41 610H47Q53 610 63 610T88 610T121 610T160 611T204 611T251 611H458Q460 609 465 606T471 602T475 598T478 593T479 586T480 576T480 562V526V488Q480 452 462 444Q458 442 438 442Q413 442 405 450Q398 457 397 463T396 501V535H173V355H290V371Q290 394 299 403T332 412Q363 412 372 392Q374 387 374 317V271",
        120437: "384 260Q384 230 377 221T342 212Q317 212 309 220Q300 229 300 252V268H179V76H249Q264 67 267 61T271 38Q271 10 249 1H44Q22 9 22 32V38Q22 63 39 73Q45 76 69 76H95V535H69H59Q42 535 32 542T22 573Q22 602 44 610H50Q56 610 66 610T91 610T125 610T164 611T208 611T257 611H468Q470 609 475 606T481 602T485 598T488 593T489 586T490 576T490 562V526V488Q490 452 472 444Q468 442 448 442Q423 442 415 450Q408 457 407 463T406 501V535H179V344H300V360Q300 383 309 392T342 401Q373 401 382 381Q384 376 384 306V260",
        120438: "38 306Q38 447 105 534T261 622Q280 622 298 618T329 608T350 596T366 585L371 581Q373 581 377 591T390 612T417 622Q437 622 443 609T450 566Q450 559 450 540T449 508V460Q449 413 443 403T407 393Q392 393 386 394T373 402T364 426Q360 472 335 509T271 546Q214 546 168 477T121 308Q121 210 164 138T271 65Q293 65 310 78T337 109T352 147T360 180T362 195Q362 196 333 196L304 197Q282 204 282 227V234Q282 247 282 251T288 261T304 272H474Q488 263 492 256T496 234Q496 211 479 199Q475 197 461 196H449V21Q441 6 434 3T412 -1H407H402Q385 -1 379 3T364 28Q350 14 322 2T260 -11Q173 -11 106 76T38 306",
        120439: "16 571Q16 597 27 604T74 611H125H208Q223 602 226 596T230 573Q230 559 227 551T217 540T204 536T186 535H165V356H359V535H338H333Q306 535 297 552Q295 556 295 573Q295 586 295 590T301 600T317 611H486Q501 602 504 596T508 573Q508 559 505 551T495 540T482 536T464 535H443V76H464H470Q482 76 489 75T502 64T508 38Q508 10 486 1H317Q306 5 301 11T296 21T295 38V44Q295 66 311 73Q318 76 338 76H359V280H165V76H186H192Q204 76 211 75T224 64T230 38Q230 10 208 1H39Q28 5 23 11T18 21T17 38V44Q17 66 33 73Q40 76 60 76H81V535H60Q45 535 38 536T24 545T16 571",
        120440: "400 76Q431 76 441 69T452 38Q452 29 452 26T450 18T443 9T430 1H95Q84 6 79 12T73 23T72 38Q72 65 90 73Q96 76 157 76H220V535H157H124Q93 535 83 542T72 573Q72 603 93 610Q97 611 264 611H430Q432 609 436 607T444 602T449 594Q452 588 452 573Q452 546 434 538Q428 535 367 535H304V76H367H400",
        120441: "202 543T202 573T224 610H228Q231 610 237 610T251 610T269 610T291 611T315 611T342 611H457Q471 602 475 595T479 573Q479 549 462 538Q454 535 432 535H408V328Q408 159 408 133T402 93Q386 48 340 19T229 -11Q158 -11 108 16T57 100Q57 129 73 141T108 154Q128 154 143 140T159 102Q159 93 155 79Q188 65 228 65H230Q290 65 318 106Q323 115 323 139T324 329V535H274L224 536Q202 543 202 573",
        120442: "18 549T18 573T29 604T70 611H118H193Q207 603 210 596T214 573Q214 549 198 538Q191 535 172 535H152V421Q152 344 152 326T153 309L242 422L329 534Q327 535 322 536T314 538T308 542T303 548T300 558T298 573Q298 600 316 608Q322 611 392 611H463Q477 602 481 595T485 573Q485 535 446 535H441H420L281 357L436 77L454 76Q473 75 478 73Q495 62 495 38Q495 10 473 1H345Q334 5 329 11T324 21T323 38Q323 51 324 56T332 68T355 77L233 296L152 192V76H172Q191 76 198 73Q214 63 214 38Q214 9 193 1H41Q18 8 18 38Q18 61 35 73Q42 76 61 76H81V535H61Q42 535 35 538Q18 549 18 573",
        120443: "27 594Q34 605 43 608T84 611H154H213Q258 611 269 605T281 573Q281 546 263 538Q257 535 222 535H185V76H404V118V145Q404 168 411 177T446 186H453Q478 186 486 167Q488 161 488 93V50Q488 24 485 17T466 1L258 0H147H99Q47 0 36 6T25 38Q25 59 35 69Q44 76 76 76H101V535H76H64Q36 535 27 552Q25 557 25 573T27 594",
        120444: "50 535Q37 536 31 537T18 547T12 573Q12 598 22 604T62 611H91H121Q147 611 158 607T178 587Q183 579 222 446T261 293Q261 289 262 288Q263 288 263 292Q263 311 298 434T346 588Q353 603 365 607T402 611H435H450Q488 611 500 605T512 573Q512 556 506 547T493 537T474 535H459V76H474Q487 75 493 74T505 64T512 38Q512 11 494 3Q490 1 424 1H386Q355 1 345 7T335 38Q335 55 341 64T354 74T373 76H388V302Q388 512 387 519Q382 482 346 359T304 228Q292 204 262 204T220 228Q215 237 179 359T137 519Q136 512 136 302V76H151Q164 75 170 74T182 64T189 38Q189 11 171 3Q167 1 101 1H63Q32 1 22 7T12 38Q12 55 18 64T31 74T50 76H65V535H50",
        120445: "20 571Q20 598 30 604T73 611H105H136Q152 611 160 611T177 607T189 601T198 587T206 568T217 537T231 497Q354 142 365 95L368 84V535H347H342Q314 535 306 552Q304 556 304 573Q304 586 304 590T310 600T326 611H482Q497 602 500 596T504 573Q504 559 501 551T491 540T478 536T460 535H439V25Q432 7 424 4T389 0H374Q334 0 322 31L293 115Q171 468 159 517L156 528V76H177H183Q195 76 202 75T215 64T221 38Q221 10 199 1H43Q32 5 27 11T22 21T21 38V44Q21 66 37 73Q44 76 64 76H85V535H64Q49 535 42 536T28 545T20 571",
        120446: "102 588Q140 621 240 621Q323 621 335 620Q393 613 422 588Q450 560 459 493T468 306Q468 185 460 118T422 23Q382 -10 289 -10H262H235Q142 -10 102 23Q74 50 65 118T56 306Q56 427 64 494T102 588ZM363 513Q357 523 347 530T324 540T302 544T280 546H268Q192 546 167 521Q150 501 145 452T140 300Q140 235 142 197T151 130T172 89T207 71T262 65Q317 65 341 81T374 144T384 300Q384 474 363 513",
        120447: "41 1Q19 9 19 32V38Q19 63 36 73Q42 76 65 76H89V535H65H55Q38 535 29 543T19 576Q19 603 41 610H49Q57 610 70 610T100 610T136 611T175 611Q190 611 216 611T255 612Q321 612 363 598T441 537Q480 486 480 427V421Q480 354 447 311T378 251Q339 230 275 230H239H173V76H197Q220 76 227 73Q244 62 244 38Q244 10 222 1H41ZM396 421Q396 461 369 491T300 533Q294 534 233 535H173V306H233Q294 307 300 308Q345 319 370 352T396 421",
        120448: "56 306Q56 380 58 426T68 510T87 568T120 600T170 617T240 621Q323 621 335 620Q393 613 422 588Q450 560 459 493T468 306Q468 124 447 66Q433 23 394 6L424 -53Q454 -112 454 -118Q454 -128 441 -138H377Q367 -135 363 -129T333 -69L304 -11H254Q205 -10 180 -8T128 6T91 36T70 92T58 178T56 306ZM227 151Q227 171 262 171H276H281Q292 171 296 171T305 170T313 165T317 158T323 145T332 127L353 88Q356 88 361 95T372 131T382 202Q384 228 384 306Q384 452 371 492T304 544Q296 545 251 545Q230 545 215 543T188 534T169 520T155 497T147 466T143 423T141 371T140 306Q140 248 141 217T146 154T157 109T178 83T212 68T262 65H266L264 70Q261 75 256 85T247 105Q227 145 227 151",
        120449: "16 571Q16 598 27 605T76 612Q84 612 108 612T148 611Q268 611 294 605Q346 592 389 550T432 440Q432 394 410 359Q393 329 366 310L358 303Q387 273 399 239Q405 219 405 178T408 106T421 68Q426 65 428 65Q433 65 435 74T438 96T441 112Q450 130 480 130H485Q519 130 522 100Q522 79 516 56T488 11T434 -11Q421 -11 408 -8T377 5T344 37T324 93Q322 101 322 154L321 209Q304 257 257 267Q252 268 207 268H165V76H186H192Q204 76 211 75T224 64T230 38Q230 10 208 1H39Q28 5 23 11T18 21T17 38V44Q17 66 33 73Q40 76 60 76H81V535H60Q45 535 38 536T24 545T16 571ZM348 440Q348 478 321 502T260 532Q252 534 208 535H165V344H208Q212 344 223 344T239 345T252 346T266 348T278 351T293 358Q348 387 348 440",
        120450: "52 454Q52 524 107 572T229 621Q266 621 274 620Q326 610 360 588L371 581Q377 594 379 598T386 610T397 619T412 622Q433 622 439 610T446 570Q446 563 446 545T445 515V479Q445 441 444 432T436 417Q428 408 403 408T370 417Q361 424 361 434Q361 439 360 448T351 476T331 509T295 535T238 546Q194 546 163 522T132 458Q132 435 148 412Q155 401 166 393T192 380T218 371T247 364T270 359Q341 342 349 339Q389 325 418 296T461 229Q472 201 472 164Q469 92 417 41T287 -11Q240 -11 200 -1T143 19L126 29Q117 6 109 -2Q100 -11 84 -11Q64 -11 58 1T51 42Q51 49 51 66T52 95V135Q52 173 53 180T61 194Q70 203 95 203Q119 203 127 194Q136 186 136 168Q143 66 284 66H290Q325 66 350 85Q391 115 391 165Q391 204 369 228T322 260Q320 260 255 275T185 293Q123 309 88 355T52 454",
        120451: "129 38Q129 51 129 55T135 65T151 76H220V535H110V501Q110 470 109 464T101 450Q93 442 68 442H60Q37 442 28 461Q26 466 26 527L27 589Q36 607 49 610H55Q61 610 72 610T97 610T131 610T170 611T215 611T264 611H476Q478 609 483 606T489 602T493 598T496 593T497 586T498 576T498 562V526V488Q498 452 480 444Q476 442 456 442Q431 442 423 450Q416 457 415 463T414 501V535H304V76H374Q389 67 392 61T396 38Q396 10 374 1H151Q140 5 135 11T130 21T129 38",
        120452: "-3 573Q-3 597 8 604T50 612Q57 612 77 612T111 611H200Q214 602 218 595T222 573Q222 549 205 538Q198 535 175 535H151V359Q151 333 151 291Q152 177 156 162Q157 160 157 159Q165 123 193 95T262 66Q303 66 330 94T367 159Q371 175 371 191T373 359V535H349H339Q328 535 322 537T309 548T303 573T306 595T325 611H506Q520 602 524 595T528 573Q528 549 511 538Q504 535 481 535H457V364Q457 189 456 182Q448 101 394 45T262 -11Q189 -11 132 43T68 182Q67 189 67 364V535H43H33Q22 535 16 537T3 548T-3 573",
        120453: "19 578Q19 585 20 590T23 598T29 604T38 608T48 610T62 611T78 612T97 611T119 611H195Q210 602 213 596T217 573Q217 561 216 555T206 542T179 535H164Q166 529 188 435T235 231T261 94L262 84V88Q263 91 263 94Q265 121 289 231T336 438L360 535H345Q308 535 308 566V573Q308 586 308 590T314 600T330 611H484Q499 602 502 595T505 573Q505 560 504 554T493 541T465 535H447L384 278Q321 19 319 14Q309 -7 278 -7H262H246Q215 -7 205 14Q203 19 140 278L78 535H59Q45 535 38 536T25 547T19 573V578",
        120454: "459 611Q491 611 501 605T512 573Q512 538 482 535H474L439 276Q406 26 402 11Q398 2 389 -3Q387 -3 386 -4L380 -7H359H349Q324 -7 313 13Q307 29 285 139T263 275Q263 283 262 283Q261 282 261 274Q261 248 239 137T211 13Q200 -7 175 -7H165H144Q136 -3 127 3Q121 10 117 36T85 276L50 535H42Q26 536 19 545T12 564V573Q12 603 33 610Q37 611 101 611H134Q165 611 175 604T186 573Q186 563 186 559T182 547T169 538T143 535H122V531Q124 517 133 446T155 266T172 96V84L173 102Q176 157 192 243T215 346Q227 367 259 367H262H265Q297 367 309 346Q316 329 332 243T351 102L352 84V96Q356 161 368 266T390 444T402 531V535H381Q366 535 359 536T345 547T338 573Q338 600 356 608Q362 611 425 611H459",
        120455: "39 571Q39 597 49 604T93 611H141H218Q233 602 236 595T239 573Q239 538 210 535Q202 535 202 534T215 507T243 454L257 428L307 535H298Q266 538 266 573Q266 584 267 588T273 598T289 611H366H401Q442 611 454 605T466 573Q466 546 448 538Q442 535 421 535H398L299 327Q299 323 362 201L426 77L449 76Q467 76 475 75T489 65T495 38Q495 11 477 3Q473 1 395 1H317Q295 8 295 38Q295 73 325 76L334 77Q333 78 314 117T276 196L257 235L239 196Q221 157 204 118T186 77Q190 76 196 76Q211 74 218 67T227 55T228 38Q228 28 227 24T221 13T206 1H50Q28 9 28 32V38Q28 63 45 73Q51 76 73 76H96L214 324Q215 327 162 431L108 535H85H79Q67 535 60 536T46 546T39 571",
        120456: "20 573Q20 597 30 604T72 611H121H198Q212 602 216 595T220 573Q220 568 219 563T217 555T214 549T211 544T207 541T203 538T198 537T194 536T190 536L188 535Q179 535 179 534L188 516Q196 497 208 470T232 415T252 363T261 332Q261 329 262 329T263 332Q263 354 333 508L345 534Q345 535 336 535Q305 538 305 567V573Q305 589 308 595T327 611H483Q505 598 505 573Q505 549 488 538Q481 535 460 535H438L304 245V76H325H331Q343 76 350 75T363 64T369 38Q369 10 347 1H178Q167 5 162 11T157 21T156 38V44Q156 66 172 73Q180 76 199 76H220V245L86 535H64Q44 535 36 538Q20 548 20 573",
        120457: "71 1Q60 5 55 11T49 23T48 39V46Q48 56 58 73T131 183Q171 242 197 282L366 535H144V501Q144 470 143 464T135 450Q127 442 102 442H94Q71 442 62 461Q60 466 60 527L61 589Q70 607 83 610H88Q93 610 102 610T124 610T154 610T188 611T227 611T270 611H454Q456 609 461 606T467 601T471 597T474 591T475 584T476 572V565Q476 555 466 538T393 428Q353 369 327 329L158 76H397V120V146Q397 169 405 179T439 189Q470 189 479 169Q481 164 481 95V48Q481 24 478 16T459 1H71",
        120458: "126 306Q105 306 90 321T74 359Q74 439 211 439Q268 439 276 438Q343 426 383 390T430 306Q431 301 431 190V81Q446 79 465 78T492 76T509 72T521 60T524 38Q524 11 506 3Q502 1 466 1Q426 1 406 5T379 14T355 36L345 30Q284 -6 205 -6Q135 -6 92 39T48 141Q48 182 79 212T158 256T252 278T342 285H347V290Q347 315 325 335T267 362Q258 363 224 363Q189 363 185 362H179L178 358Q178 353 178 352T176 345T174 337T170 330T165 322T158 316T150 311T139 308T126 306ZM132 140Q132 115 157 93T224 70Q269 70 302 87T344 133Q346 139 347 175V211H339Q256 209 194 190T132 140",
        120459: "4 573Q4 596 15 603T52 611H90H124Q146 611 155 608T171 591Q173 586 173 491V396L182 402Q217 424 256 431Q280 437 309 437Q376 437 434 379T492 217Q492 162 473 118T422 47T358 8T293 -6Q229 -6 174 38Q171 13 163 7T135 1H131H122Q99 1 90 23L89 279V535H58L27 536Q4 543 4 573ZM409 215Q409 269 377 315T283 361Q255 361 224 344T177 297L173 290V167Q189 124 213 97T278 70Q330 70 369 111T409 215",
        120460: "291 -6Q196 -6 131 60T66 216Q66 296 119 361Q154 403 200 421T273 439Q275 440 293 440H313Q400 440 433 409Q454 388 454 359Q454 335 439 321T402 306Q380 306 365 321T350 357V362L340 363Q339 363 326 363T303 364Q280 364 266 362Q217 352 184 313T151 215Q151 153 199 112T313 70Q341 70 357 85T381 118T394 140Q402 146 424 146Q443 146 447 144Q466 137 466 117Q466 106 457 88T429 47T374 10T291 -6",
        120461: "266 573Q266 596 277 603T314 611H352H385Q411 611 419 607T435 586V76H498Q512 67 516 60T520 38Q520 9 498 1H436Q429 1 417 1T398 0Q375 0 363 7T351 34V43L342 36Q288 -6 223 -6Q143 -6 87 58T31 216Q31 307 88 372T230 437Q292 437 342 405L351 399V535H320L289 536Q266 543 266 573ZM351 290Q347 302 337 316T302 346T244 361Q193 361 154 319T115 215Q115 152 152 111T235 70Q314 70 351 170V290",
        120462: "48 217Q48 295 100 361T248 439L258 440Q268 440 274 440Q329 438 369 416T428 359T456 292T464 228Q464 215 461 208T454 198T442 190L288 189H135L138 179Q153 132 199 102T303 71Q336 71 353 86T380 120T398 143Q404 146 422 146Q453 146 462 126Q464 120 464 116Q464 84 416 39T285 -6Q187 -6 118 59T48 217ZM377 264Q371 291 365 306T341 338T294 362Q288 363 264 363Q225 363 190 336T139 264H377",
        120463: "43 395Q44 405 44 408T47 416T53 423T66 431H176V461Q176 500 182 518Q201 570 252 593T353 617Q399 614 418 593T437 548Q437 528 424 514T387 499Q365 499 353 511T338 537V541H328Q275 536 261 494Q260 490 260 460V431H327Q334 431 346 431T364 432Q392 432 404 425T416 393T405 362T365 355H327H260V76H319Q375 76 388 71T401 38Q401 27 400 23T395 12T379 1H58Q47 6 42 12T36 23T35 38Q35 65 53 73Q59 76 117 76H176V355H121H93Q64 355 54 362T43 395",
        120464: "60 274Q60 337 107 386T233 436Q278 436 316 417L329 410L338 416Q384 442 427 442T489 423T509 381T494 345T460 332Q449 332 440 338Q432 341 427 348T419 360T415 365Q414 364 410 364L383 355Q406 320 406 274Q406 211 358 162T233 112Q189 112 155 128L146 133Q142 125 142 115Q142 99 150 85T175 71Q182 72 187 70Q188 70 195 70T218 70T254 69Q259 69 275 69T297 69T318 68T340 66T361 62T384 57T405 49T428 38Q495 -1 495 -76Q495 -143 427 -186T262 -229Q161 -229 94 -185T29 -73Q30 -60 33 -48T39 -26T47 -8T57 8T67 20T77 30T86 38L91 43Q91 44 86 53T75 80T70 117Q70 142 89 183L83 194Q60 232 60 274ZM321 274Q321 312 296 337T230 362Q197 362 171 338T145 274Q145 235 170 211T233 187Q273 187 297 212T321 274ZM422 -78Q422 -54 408 -38T366 -15T315 -6T255 -4H200Q198 -4 193 -4T183 -3Q148 -3 125 -26T102 -78Q102 -110 151 -132T261 -154Q321 -154 371 -132T422 -78",
        120465: "4 573Q4 596 15 603T52 611H90H124Q146 611 155 608T171 591Q173 586 173 489Q173 394 175 394L186 402Q197 410 219 420T269 434Q278 436 306 436Q343 436 371 423Q411 402 423 365T436 265Q436 257 436 239T435 211V198V76H498Q512 67 516 60T520 38Q520 9 498 1H308Q286 10 286 32V38V46Q286 65 303 73Q309 76 329 76H351V188Q351 204 351 230T352 266Q352 321 341 341T288 361Q253 361 222 341T176 274L174 264L173 170V76H236Q250 67 254 60T258 38Q258 9 236 1H27Q4 8 4 38Q4 53 8 60T27 76H89V535H58L27 536Q4 543 4 573",
        120466: "202 538T202 559T218 596T260 612Q283 612 300 597T317 560Q317 538 300 523T260 507Q235 507 219 522ZM411 76Q441 76 451 69T462 38Q462 29 462 26T460 18T453 9T440 1H94Q72 8 72 33V38Q72 46 72 49T74 58T81 68T94 76H233V355H167L102 356Q80 363 80 393Q80 418 91 425T138 432Q145 432 165 432T200 431H295Q297 429 303 425T310 420T314 415T317 404T317 389T318 363Q318 354 318 314T317 241V76H378H411",
        120467: "261 559Q261 580 277 596T319 612Q342 612 359 597T376 560T360 523T320 507Q296 507 279 523T261 559ZM75 -91T100 -91T138 -107T152 -144V-150L160 -151H193H203Q241 -151 267 -121Q284 -97 288 -73T292 23V151V355H218L145 356Q123 365 123 387V393Q123 422 145 430H148Q151 430 156 430T169 430T185 430T205 431T227 431T251 431H354Q356 430 360 427T365 424T369 420T372 416T373 410T375 402T376 391T377 376T377 356Q377 345 377 286T376 176Q376 -67 371 -88Q362 -123 342 -151T299 -194Q254 -228 180 -228Q84 -226 56 -177Q49 -162 48 -148Q48 -122 61 -107",
        120468: "13 42Q13 63 23 69T69 76H102V535H69H54Q34 535 24 542T13 573Q13 588 15 593Q22 605 29 608T56 611H95Q113 611 122 611T140 610T152 609T159 607T163 603T167 597T173 589V413L174 237L295 355H275Q260 355 253 356T239 367T232 393Q232 419 243 425T304 431H359H464Q479 422 482 415T485 393Q485 364 464 356L431 355H398L293 254L427 76H486Q501 67 504 60T507 38Q507 28 507 24T501 12T486 1H314Q292 8 292 38Q292 62 308 73Q312 75 326 76L338 77L290 140Q279 154 267 171T248 196L242 204L207 171L173 139V76H206H221Q241 76 251 69T262 38Q262 11 244 3Q240 1 138 1Q123 1 100 1T70 0Q32 0 23 7T13 42",
        120469: "51 573Q51 602 73 610H76Q79 610 84 610T97 610T113 610T133 611T155 611T179 611H282Q301 598 304 586V76H452Q466 67 470 60T474 38Q474 10 452 1H73Q51 9 51 32V38Q51 54 54 60T73 76H220V535H146L73 536Q51 545 51 567V573",
        120470: "133 76Q156 74 164 67T172 38Q172 9 151 1H11Q-12 8 -12 38Q-12 61 5 73Q10 75 28 76H45V355H28Q10 356 5 358Q-12 370 -12 393Q-12 419 11 431H52H70Q91 431 100 427T116 405Q163 436 200 436Q255 436 281 390L285 394Q289 398 292 400T301 407T314 415T329 423T346 429T366 434T389 436H392Q425 436 448 411Q469 390 474 360T480 268V232V203V76H497Q520 74 528 67T536 38Q536 9 515 1H396Q374 9 374 32V38Q374 73 402 76H409V191V242Q409 317 404 339T375 361Q343 361 323 332T299 264Q298 258 298 165V76H315Q338 74 346 67T354 38Q354 9 333 1H214Q192 9 192 32V38Q192 73 220 76H227V191V242Q227 317 222 339T193 361Q161 361 141 332T117 264Q116 258 116 165V76H133",
        120471: "89 431Q94 431 105 431T122 432Q173 432 173 399Q173 394 175 394Q176 394 190 404T233 425T298 436Q343 436 371 423Q411 402 423 365T436 265Q436 257 436 239T435 211V198V76H498Q512 67 516 60T520 38Q520 9 498 1H308Q286 9 286 32V38V45Q286 65 303 73Q309 76 329 76H351V188Q351 204 351 230T352 266Q352 321 341 341T288 361Q253 361 222 341T176 274L174 264L173 170V76H236Q250 67 254 60T258 38Q258 9 236 1H27Q4 8 4 38Q4 53 8 60T27 76H89V355H58L27 356Q4 363 4 393Q4 408 8 415T27 431H89",
        120472: "52 216Q52 318 118 379T261 440Q343 440 407 378T472 216Q472 121 410 58T262 -6Q176 -6 114 58T52 216ZM388 225Q388 281 351 322T261 364Q213 364 175 325T136 225Q136 158 174 114T262 70T350 114T388 225",
        120473: "89 431Q93 431 104 431T121 432Q173 432 173 401V396L182 402Q237 437 305 437Q376 437 434 378T492 217Q492 146 459 93T382 17T291 -6Q261 -6 232 5T188 26L174 37Q173 37 173 -54V-146H236Q250 -155 254 -162T258 -184Q258 -213 236 -221H27Q4 -214 4 -184Q4 -169 8 -162T27 -146H89V355H58L27 356Q4 363 4 393Q4 408 8 415T27 431H89ZM409 215Q409 269 377 315T283 361Q255 361 224 344T177 297L173 290V167Q189 124 213 97T278 70Q330 70 369 111T409 215",
        120474: "34 215Q34 309 91 368T222 436Q224 436 231 436T242 437Q309 437 372 390V401Q372 419 381 428T414 437Q426 437 432 436T444 430T456 412V-146H489H504Q524 -146 534 -153T545 -184Q545 -211 527 -219Q523 -221 414 -221Q398 -221 374 -221T342 -222Q304 -222 294 -216T283 -184Q283 -157 301 -149Q307 -146 339 -146H372V-51Q372 43 371 43L364 38Q357 33 345 26T318 12T280 -1T236 -6Q155 -6 95 55T34 215ZM117 215Q117 152 157 111T250 70Q289 70 318 92T363 146Q372 163 372 192V215L371 263Q339 360 254 360Q206 360 162 321T117 215",
        120475: "327 76Q359 76 369 70T380 38Q380 10 359 1H47Q24 8 24 38Q24 54 28 61T47 76H145V355H96L47 356Q24 363 24 393Q24 409 28 416T47 431H207Q223 419 226 414T229 393V387V369Q297 437 394 437Q436 437 461 417T487 368Q487 347 473 332T438 317Q428 317 420 320T407 327T398 337T393 347T390 356L388 361Q348 356 324 345Q228 299 228 170Q228 161 228 151T229 138V76H293H327",
        120476: "72 317Q72 361 108 396T229 439Q231 439 245 439T268 440Q303 439 324 435T353 427T363 423L372 432Q380 440 397 440Q430 440 430 395Q430 390 430 380T429 366V335Q429 311 422 302T387 293Q364 293 355 300T346 316T343 336T325 353Q306 364 257 364Q209 364 178 351T147 317Q147 284 231 272Q327 256 357 247Q458 210 458 129V121Q458 74 413 34T271 -6Q246 -6 224 -3T189 5T165 14T150 22T144 26Q142 23 139 18T135 11T132 6T128 1T124 -2T119 -4T113 -5T104 -6Q84 -6 78 6T71 43Q71 48 71 60T72 79Q72 132 73 141T81 157Q90 166 115 166Q135 166 142 162T157 140Q168 108 191 90T260 70Q297 70 323 76T361 91T379 110T384 129Q384 157 346 171T247 195T165 212Q119 228 96 256T72 317",
        120477: "25 395Q26 405 26 408T29 416T35 423T48 431H145V481L146 532Q154 547 161 550T184 554H189Q218 554 227 534Q229 529 229 480V431H405Q406 430 411 427T418 422T422 416T426 407T427 393Q427 387 427 382T424 374T421 368T417 363T413 360T408 358L405 356L317 355H229V249Q229 237 229 214T228 179Q228 126 241 98T295 70Q354 70 365 149Q366 167 375 174Q383 182 407 182H415Q438 182 446 166Q448 161 448 148Q448 84 398 39T282 -6Q226 -6 189 29T146 128Q145 134 145 247V355H96H72Q45 355 35 362T25 395",
        120478: "4 393Q4 416 15 423T52 431H90Q141 431 151 429T168 417Q171 412 173 409V254L174 100Q182 70 244 70Q320 70 344 119Q349 130 350 144T351 248V355H320L289 356Q266 363 266 393Q266 408 270 415T289 431H351H386Q409 431 418 428T433 411Q435 406 435 241V76H498Q512 67 516 60T520 38Q520 9 498 1H436H394Q372 1 364 5T351 26L342 21Q293 -5 227 -5Q118 -5 96 67Q91 82 90 101T89 227V355H58L27 356Q4 363 4 393",
        120479: "24 392Q24 417 36 424T79 432Q85 432 103 432T132 431H215Q229 422 233 415T237 393Q237 355 198 355H193H172L262 77L352 355H331H323Q288 355 288 393Q288 409 291 415T310 431H478Q491 423 495 416T500 393Q500 364 478 356L452 355H426L374 190Q320 24 318 20Q307 -4 273 -4H262H251Q217 -4 206 20Q204 24 150 190L98 355H72L47 356Q24 363 24 392",
        120480: "54 355Q16 355 16 388V393Q16 423 37 430Q41 431 125 431H162Q206 431 218 425T230 393Q230 366 212 358Q206 355 174 355Q141 355 141 354L150 296Q181 110 181 89V84Q182 85 183 96Q185 118 199 173T218 237Q223 247 245 259H264H268Q294 259 309 240Q315 229 329 174T343 92Q343 84 344 84V86Q344 88 344 91T345 97Q347 125 356 187T374 301T383 354Q383 355 350 355H333Q314 355 304 362T294 393Q294 420 312 428Q318 431 401 431H440Q485 431 496 425T508 393Q508 382 508 377T498 363T470 355L455 354Q455 353 441 271T413 104T396 16Q384 -4 355 -4H351Q315 -4 305 9T280 79Q278 90 276 96Q265 149 265 169Q265 176 264 169Q263 166 263 162Q261 130 248 79T230 18Q220 -4 183 -4H175L151 -3Q134 5 127 17L112 102Q97 188 83 270T69 354Q62 355 54 355",
        120481: "35 393Q35 417 46 424T89 432Q95 432 112 432T141 431H223Q238 422 241 415T244 393Q244 389 244 383T237 367T216 355Q209 355 209 354L234 319Q259 286 260 286L308 354Q308 355 301 355Q285 356 278 365T270 384L271 393Q271 420 289 428Q295 431 376 431H459Q460 430 465 427T472 422T476 416T480 407T481 393Q481 368 470 362T434 355H425H392L344 290Q295 225 295 223Q294 223 309 203T350 149L405 77L439 76H453Q474 76 484 69T495 38Q495 10 473 1H303Q281 9 281 32V38Q281 49 282 54T290 67T313 76Q324 76 324 77L259 173L197 77Q202 76 209 76Q225 75 233 68T241 55T242 38Q242 28 242 24T236 12T221 1H51Q29 9 29 32V38Q29 48 29 51T31 59T38 67T51 76H117L171 149Q224 222 224 223L124 355H90H78Q54 355 45 361T35 393",
        120482: "26 393Q26 417 37 424T80 431H134H217Q232 422 235 416T239 393Q239 379 236 371T226 360T214 356T197 355L179 354V353L188 330Q197 306 209 272T235 201T259 133T271 89V84L274 95Q279 122 298 185T335 300T352 354Q352 355 331 355Q312 355 304 358Q288 368 288 393Q288 408 291 415T310 431H478Q479 430 484 427T491 422T495 416T499 407T500 393Q500 376 493 367T479 357T458 355H452Q426 355 425 353Q420 337 351 124T280 -94Q240 -195 168 -220Q147 -228 125 -228Q89 -228 66 -201T42 -139Q42 -116 56 -102T93 -87Q117 -87 130 -102T144 -135V-138H126Q121 -148 121 -150T130 -152Q182 -147 207 -87Q211 -78 223 -40T236 1Q230 10 102 355H75L49 356Q26 363 26 393",
        120483: "56 1Q40 7 37 14T34 41Q34 59 36 64Q39 67 43 73Q65 95 191 213T341 355H133V334Q133 306 124 297Q116 289 91 289H83Q60 289 51 308Q49 313 49 361L50 409Q59 427 72 430H78Q83 430 92 430T115 430T144 430T179 431T219 431T262 431H450Q452 430 455 428T459 424T463 422T466 419T468 416T469 413T470 409T471 404T472 398T472 391Q472 374 469 368L462 358Q453 349 315 218Q210 122 164 76H391V103Q391 136 400 146Q409 155 433 155Q464 155 473 135Q475 130 475 78V46Q475 24 472 16T453 1H56",
        120488: "296 0Q278 3 164 3Q58 3 49 0H40V62H92Q144 62 144 64Q388 682 397 689Q403 698 434 698Q463 698 471 689Q475 686 538 530T663 218L724 64Q724 62 776 62H828V0H817Q796 3 658 3Q509 3 485 0H472V62H517Q561 62 561 63L517 175H262L240 120Q218 65 217 64Q217 62 261 62H306V0H296ZM390 237L492 238L440 365Q390 491 388 491Q287 239 287 237H390",
        120489: "720 510Q720 476 704 448T665 404T619 377T580 362L564 359L583 356Q602 353 632 342T690 312Q712 292 725 276Q752 235 752 189V183Q752 160 741 125Q698 18 547 2Q543 1 288 0H39V62H147V624H39V686H264H409Q502 686 542 681T624 655Q720 607 720 510ZM563 513Q563 553 548 578T518 611T486 622Q479 624 385 624H293V382H375Q458 383 467 385Q563 405 563 513ZM590 192Q590 307 505 329Q504 330 503 330L398 331H293V62H391H400H444Q496 62 528 75T580 131Q590 155 590 192",
        120490: "425 0L228 3Q63 3 51 0H39V62H147V618H39V680H612V676Q614 670 627 552T643 428V424H581V428Q580 430 576 461T562 524T532 576Q512 596 481 605T426 616T357 618H304V62H439V0H425",
        120491: "901 12Q901 7 892 0H479Q65 0 62 2Q56 6 56 11Q56 14 242 347T433 685Q438 694 450 696Q454 698 480 698H506L523 687Q526 683 711 354T899 17Q901 13 901 12ZM653 137L427 538L202 137L315 136H540L653 137",
        120492: "723 286Q721 284 700 145T677 3V0H39V62H147V618H39V680H660V676Q662 670 675 552T691 428V424H629V428Q629 429 627 448T618 494T601 541Q574 593 527 605T382 618H374H304V384H336Q338 384 347 384T361 384T376 386T392 390T407 397T421 407T432 423Q442 444 443 482V501H505V205H443V224Q442 258 435 278T411 307T380 318T336 322H304V62H375H394Q429 62 449 62T497 66T541 76T577 95T609 126T632 170T651 232Q661 287 661 289H723V286",
        120493: "80 430L92 686H358Q624 686 628 684Q638 679 638 656Q638 640 637 639Q637 638 445 353Q401 288 351 214T277 103L253 67L256 66Q258 66 265 66T279 66T298 66H343Q380 66 406 68T464 81T518 110T557 164T579 250Q583 278 583 298Q583 299 614 299H645V291Q643 281 636 150T627 8V0H353Q79 0 75 2Q64 7 64 31Q64 48 66 52L259 340L451 623Q451 624 384 624Q294 623 259 612Q155 581 143 446Q142 440 142 432V430H80",
        120494: "400 0Q376 3 226 3Q75 3 51 0H39V62H147V624H39V686H51Q75 683 226 683Q376 683 400 686H412V624H304V388H595V624H487V686H499Q523 683 673 683Q824 683 848 686H860V624H752V62H860V0H848Q824 3 674 3Q523 3 499 0H487V62H595V326H304V62H412V0H400",
        120495: "629 -10T446 -10T164 89T64 340Q64 380 71 420T102 510T163 596T266 662T418 696H438Q488 696 499 695Q582 686 644 655T741 584T796 495T823 409T829 338Q829 188 729 89ZM439 645Q416 645 390 638T333 615T275 564T236 480Q221 423 221 341Q221 272 230 228Q247 144 301 94T447 43T592 93T663 228Q672 272 672 341Q672 645 439 645ZM286 242V446H348V412H545V446H607V242H545V276H348V242H286",
        120496: "397 0Q370 3 218 3Q65 3 38 0H25V62H139V624H25V686H38Q65 683 218 683Q370 683 397 686H410V624H296V62H410V0H397",
        120497: "400 0Q376 3 226 3Q75 3 51 0H39V62H147V624H39V686H51Q75 683 226 683Q376 683 400 686H412V624H304V338L472 483L634 624H565V686H576Q597 683 728 683Q814 683 829 686H836V624H730L614 524Q507 432 497 422Q496 422 498 418T514 395T553 342T627 241L759 63L805 62H852V0H842Q830 3 701 3Q550 3 526 0H513V62H549Q584 62 584 63Q583 65 486 196T388 328L304 256V62H412V0H400",
        120498: "285 0Q267 3 154 3Q56 3 47 0H40V62H131Q131 63 167 160T244 369T321 578T359 678Q366 698 393 698H404H413Q437 698 446 678Q448 672 560 369T674 62H765V0H754Q733 3 604 3Q453 3 429 0H416V62H461L507 63L355 470Q353 468 279 265L203 63L249 62H294V0H285",
        120499: "314 0Q296 3 181 3T48 0H39V62H147V624H39V686H305Q316 679 323 667Q330 653 434 414L546 157L658 414Q766 662 773 674Q778 681 788 686H1052V624H944V62H1052V0H1040Q1016 3 874 3T708 0H696V62H804V341L803 618L786 580Q770 543 735 462T671 315Q540 13 536 9Q528 1 507 1Q485 1 477 9Q472 14 408 162T281 457T217 603Q215 603 215 334V62H323V0H314",
        120500: "314 0Q296 3 181 3T48 0H39V62H147V624H39V686H171H265Q288 686 297 686T309 684T315 679Q317 676 500 455T684 233V624H576V686H585Q603 683 718 683T851 686H860V624H752V319Q752 15 750 11Q747 4 742 2T718 0H712Q708 0 706 0T700 0T696 1T693 2T690 4T687 7T684 11T679 16T674 23Q671 27 437 311L215 579V62H323V0H314",
        120501: "54 465L63 674Q63 675 383 675T703 674L712 465Q712 464 681 464H650V467Q650 490 646 516T632 545Q612 550 383 550H283Q169 550 149 548T124 531Q123 530 123 529Q116 506 116 467V464H85Q54 464 54 465ZM160 256V447H222V414H544V447H606V256H544V289H222V256H160ZM57 0L48 222H110V219Q110 147 125 133Q127 130 130 129T160 127T235 126T383 126Q482 126 530 126T604 127T635 129T641 133Q656 146 656 219V222H718L709 0H57",
        120502: "64 339Q64 431 96 502T182 614T295 675T420 696Q469 696 481 695Q620 680 709 589T798 339Q798 173 697 82T432 -10Q262 -10 163 85T64 339ZM625 454Q618 502 600 538T562 593T515 624T469 639T431 642Q331 642 276 563Q232 493 232 353Q232 315 234 285T244 216T267 148T308 94T372 56Q405 46 432 46Q517 46 567 106T627 267Q631 299 631 353Q631 418 625 454",
        120503: "400 0Q376 3 226 3Q75 3 51 0H39V62H147V618H39V680H860V618H752V62H860V0H848Q824 3 674 3Q523 3 499 0H487V62H595V618H304V62H412V0H400",
        120504: "400 0Q376 3 226 3Q75 3 51 0H39V62H147V624H39V686H253Q435 686 470 685T536 678Q585 668 621 648T675 605T705 557T718 514T721 483T718 451T704 409T673 362T616 322T530 293Q500 288 399 287H304V62H412V0H400ZM553 475Q553 554 537 582T459 622Q451 623 373 624H298V343H372Q457 344 480 350Q527 362 540 390T553 475",
        120506: "766 271Q764 266 750 137T735 4V0H407Q74 0 71 4L70 5Q64 9 64 18Q64 24 82 41T213 158L359 288Q360 288 320 336T214 460Q67 633 66 635Q64 638 64 655Q64 679 75 684Q78 686 407 686H735V682Q738 676 751 558T766 434V430H735Q704 430 704 431Q704 434 703 444T696 477T681 520T654 563T613 598Q578 615 527 619T371 624H281L396 489Q506 358 513 351Q517 342 512 334Q503 325 371 208Q338 179 303 147T249 99L231 83L243 81Q258 81 364 81Q382 81 418 81T470 82T513 83T554 88T587 96T619 109T645 129Q689 173 702 260L704 274Q704 275 735 275H766V271",
        120507: "41 425Q41 426 51 545T62 669V675H737V669Q738 665 748 546T758 425V419H696V425Q687 517 669 555T595 607Q578 612 522 613H478V62H631V0H615Q585 3 399 3Q214 3 184 0H168V62H321V613H277H263Q164 613 134 561Q113 527 103 425V419H41V425",
        120508: "64 556Q69 619 114 658T224 697Q271 697 310 677T375 622T417 554T444 484L447 477V479Q456 516 473 551T516 620T582 676T670 697Q735 697 780 656T829 556Q829 539 818 532H772Q761 539 761 548Q761 571 681 571Q664 571 653 570T623 562T587 537T555 490Q536 448 531 410T525 300V210V62H660V0H646L447 3Q257 1 247 0H233V62H368V210V301Q368 373 363 410T338 490Q324 518 307 536T270 561T240 569T212 571Q132 571 132 548Q132 539 121 532H75Q64 538 64 556",
        120509: "609 0Q582 3 415 3T221 0H207V62H342V168L328 169Q193 180 117 241Q64 286 64 343T117 445Q193 506 328 517L342 518V624H207V686H221Q248 683 415 683T609 686H623V624H488V518L502 517Q637 506 713 445Q766 400 766 343T713 241Q637 180 502 169L488 168V62H623V0H609ZM342 219T342 343T340 467Q328 467 304 459Q277 451 261 439T237 409T228 378T226 343Q226 314 229 296T250 259T301 228Q331 219 341 219Q342 219 342 343ZM604 343Q604 365 602 379T591 413T560 446T503 464L489 467Q488 467 488 343T489 219Q499 219 529 228Q554 236 570 248T593 277T602 308T604 343",
        120510: "327 0Q306 3 174 3Q52 3 43 0H33V62H98L162 63L360 333L157 624H48V686H59Q80 683 217 683Q368 683 395 686H408V624H335L393 540L452 458L573 623Q573 624 528 624H483V686H494Q515 683 646 683Q769 683 778 686H787V624H658L575 511Q493 398 493 397L508 376Q522 356 553 312T611 229L727 62H835V0H824Q803 3 667 3Q516 3 489 0H476V62H513L549 63L401 274L247 63Q247 62 292 62H338V0H327",
        120511: "64 515Q64 532 71 536T104 540H139Q200 540 207 538Q225 533 236 521T253 489T260 454T264 414Q264 340 287 296T347 237Q369 226 373 226Q374 226 374 425V624H239V686H253Q280 683 447 683T641 686H655V624H520V226L522 227Q525 228 531 229T552 240T580 261T606 298T624 354Q627 368 628 394T631 440T637 482T654 518T686 538Q693 540 754 540H794Q817 540 823 536T829 515Q829 500 824 495T811 489T796 483T782 461T775 408Q767 212 568 175Q526 168 521 168Q520 168 520 115V62H655V0H641Q614 3 447 3T253 0H239V62H374V168L364 169Q290 178 243 203Q126 261 118 409Q117 443 111 461T98 484T83 489T70 495T64 515",
        120512: "598 645T415 645T232 458Q232 385 275 239T318 26Q318 8 311 4T272 -1Q265 -1 240 -1T196 0H88V3Q86 5 70 108Q52 211 51 212V215H113V212Q123 149 132 133Q136 124 149 122T202 118Q241 118 241 119Q241 132 132 277Q64 378 64 457Q64 564 158 630T403 696Q487 696 543 685T661 638Q722 599 744 549T766 458Q766 434 761 410T749 368T729 327T709 293T684 258T663 229Q632 187 614 160T592 126L589 119Q589 118 628 118Q667 119 680 121T698 133Q702 140 706 160T714 196L717 212V215H779V212Q778 211 760 108Q744 5 742 3V0H634H562Q528 0 520 4T512 26Q512 92 555 238T598 458Q598 645 415 645",
        120513: "56 673Q56 679 65 686H892Q901 679 901 673Q901 668 714 331T521 -15Q518 -18 506 -24H452Q440 -19 436 -15Q431 -8 337 162T150 501L57 669Q57 670 56 672V673ZM528 136L758 553H297Q298 551 414 341L528 136",
        120546: "208 74Q208 50 254 46Q272 46 272 35Q272 34 270 22Q267 8 264 4T251 0Q249 0 239 0T205 1T141 2Q70 2 50 0H42Q35 7 35 11Q37 38 48 46H62Q132 49 164 96Q170 102 345 401T523 704Q530 716 547 716H555H572Q578 707 578 706L606 383Q634 60 636 57Q641 46 701 46Q726 46 726 36Q726 34 723 22Q720 7 718 4T704 0Q701 0 690 0T651 1T578 2Q484 2 455 0H443Q437 6 437 9T439 27Q443 40 445 43L449 46H469Q523 49 533 63L521 213H283L249 155Q208 86 208 74ZM516 260Q516 271 504 416T490 562L463 519Q447 492 400 412L310 260L413 259Q516 259 516 260",
        120547: "231 637Q204 637 199 638T194 649Q194 676 205 682Q206 683 335 683Q594 683 608 681Q671 671 713 636T756 544Q756 480 698 429T565 360L555 357Q619 348 660 311T702 219Q702 146 630 78T453 1Q446 0 242 0Q42 0 39 2Q35 5 35 10Q35 17 37 24Q42 43 47 45Q51 46 62 46H68Q95 46 128 49Q142 52 147 61Q150 65 219 339T288 628Q288 635 231 637ZM649 544Q649 574 634 600T585 634Q578 636 493 637Q473 637 451 637T416 636H403Q388 635 384 626Q382 622 352 506Q352 503 351 500L320 374H401Q482 374 494 376Q554 386 601 434T649 544ZM595 229Q595 273 572 302T512 336Q506 337 429 337Q311 337 310 336Q310 334 293 263T258 122L240 52Q240 48 252 48T333 46Q422 46 429 47Q491 54 543 105T595 229",
        120548: "49 1Q31 1 31 10Q31 12 34 24Q39 43 44 45Q48 46 59 46H65Q92 46 125 49Q139 52 144 61Q146 66 215 342T285 622Q285 629 281 629Q273 632 228 634H197Q191 640 191 642T193 661Q197 674 203 680H714Q721 676 721 669Q721 664 708 557T694 447Q692 440 674 440H662Q655 445 655 454Q655 455 658 480T661 534Q661 572 652 592Q638 619 603 626T501 634H471Q398 633 393 630Q389 628 386 622Q385 619 315 341T245 60Q245 46 333 46H345Q366 46 366 35Q366 33 363 21T358 6Q356 1 339 1Q334 1 292 1T187 2Q122 2 88 2T49 1",
        120549: "574 715L582 716Q589 716 595 716Q612 716 616 714Q621 712 621 709Q622 707 705 359T788 8Q786 5 785 3L781 0H416Q52 0 50 2T48 6Q48 9 305 358T567 711Q572 712 574 715ZM599 346L538 602L442 474Q347 345 252 217T157 87T409 86T661 88L654 120Q646 151 629 220T599 346",
        120550: "492 213Q472 213 472 226Q472 230 477 250T482 285Q482 316 461 323T364 330H312Q311 328 277 192T243 52Q243 48 254 48T334 46Q428 46 458 48T518 61Q567 77 599 117T670 248Q680 270 683 272Q690 274 698 274Q718 274 718 261Q613 7 608 2Q605 0 322 0H133Q31 0 31 11Q31 13 34 25Q38 41 42 43T65 46Q92 46 125 49Q139 52 144 61Q146 66 215 342T285 622Q285 629 281 629Q273 632 228 634H197Q191 640 191 642T193 659Q197 676 203 680H757Q764 676 764 669Q764 664 751 557T737 447Q735 440 717 440H705Q698 445 698 453L701 476Q704 500 704 528Q704 558 697 578T678 609T643 625T596 632T532 634H485Q397 633 392 631Q388 629 386 622Q385 619 355 499T324 377Q347 376 372 376H398Q464 376 489 391T534 472Q538 488 540 490T557 493Q562 493 565 493T570 492T572 491T574 487T577 483L544 351Q511 218 508 216Q505 213 492 213",
        120551: "58 8Q58 23 64 35Q64 36 329 334T596 635L586 637Q575 637 512 637H500H476Q442 637 420 635T365 624T311 598T266 548T228 469Q227 466 226 463T224 458T223 453T222 450L221 448Q218 443 202 443Q185 443 182 453L214 561Q228 606 241 651Q249 679 253 681Q256 683 487 683H718Q723 678 723 675Q723 673 717 649Q189 54 188 52L185 49H274Q369 50 377 51Q452 60 500 100T579 247Q587 272 590 277T603 282H607Q628 282 628 271Q547 5 541 2Q538 0 300 0H124Q58 0 58 8",
        120552: "228 637Q194 637 192 641Q191 643 191 649Q191 673 202 682Q204 683 219 683Q260 681 355 681Q389 681 418 681T463 682T483 682Q499 682 499 672Q499 670 497 658Q492 641 487 638H485Q483 638 480 638T473 638T464 637T455 637Q416 636 405 634T387 623Q384 619 355 500Q348 474 340 442T328 395L324 380Q324 378 469 378H614L615 381Q615 384 646 504Q674 619 674 627T617 637Q594 637 587 639T580 648Q580 650 582 660Q586 677 588 679T604 682Q609 682 646 681T740 680Q802 680 835 681T871 682Q888 682 888 672Q888 645 876 638H874Q872 638 869 638T862 638T853 637T844 637Q805 636 794 634T776 623Q773 618 704 340T634 58Q634 51 638 51Q646 48 692 46H723Q729 38 729 37T726 19Q722 6 716 0H701Q664 2 567 2Q533 2 504 2T458 2T437 1Q420 1 420 10Q420 15 423 24Q428 43 433 45Q437 46 448 46H454Q481 46 514 49Q520 50 522 50T528 55T534 64T540 82T547 110T558 153Q565 181 569 198Q602 330 602 331T457 332H312L279 197Q245 63 245 58Q245 51 253 49T303 46H334Q340 38 340 37T337 19Q333 6 327 0H312Q275 2 178 2Q144 2 115 2T69 2T48 1Q31 1 31 10Q31 12 34 24Q39 43 44 45Q48 46 59 46H65Q92 46 125 49Q139 52 144 61Q147 65 216 339T285 628Q285 635 228 637",
        120553: "740 435Q740 320 676 213T511 42T304 -22Q207 -22 138 35T51 201Q50 209 50 244Q50 346 98 438T227 601Q351 704 476 704Q514 704 524 703Q621 689 680 617T740 435ZM640 466Q640 523 625 565T583 628T532 658T479 668Q370 668 273 559T151 255Q150 245 150 213Q150 156 165 116T207 55T259 26T313 17Q385 17 451 63T561 184Q590 234 615 312T640 466ZM510 276Q510 278 512 288L515 298Q515 299 384 299H253L250 285Q246 271 244 268T231 265H227Q216 265 214 266T207 274Q207 278 223 345T244 416Q247 419 260 419H263Q280 419 280 408Q280 406 278 396L275 386Q275 385 406 385H537L540 399Q544 413 546 416T559 419H563Q574 419 576 418T583 410Q583 403 566 339Q549 271 544 267Q542 265 538 265H530H527Q510 265 510 276",
        120554: "43 1Q26 1 26 10Q26 12 29 24Q34 43 39 45Q42 46 54 46H60Q120 46 136 53Q137 53 138 54Q143 56 149 77T198 273Q210 318 216 344Q286 624 286 626Q284 630 284 631Q274 637 213 637H193Q184 643 189 662Q193 677 195 680T209 683H213Q285 681 359 681Q481 681 487 683H497Q504 676 504 672T501 655T494 639Q491 637 471 637Q440 637 407 634Q393 631 388 623Q381 609 337 432Q326 385 315 341Q245 65 245 59Q245 52 255 50T307 46H339Q345 38 345 37T342 19Q338 6 332 0H316Q279 2 179 2Q143 2 113 2T65 2T43 1",
        120555: "285 628Q285 635 228 637Q205 637 198 638T191 647Q191 649 193 661Q199 681 203 682Q205 683 214 683H219Q260 681 355 681Q389 681 418 681T463 682T483 682Q500 682 500 674Q500 669 497 660Q496 658 496 654T495 648T493 644T490 641T486 639T479 638T470 637T456 637Q416 636 405 634T387 623L306 305Q307 305 490 449T678 597Q692 611 692 620Q692 635 667 637Q651 637 651 648Q651 650 654 662T659 677Q662 682 676 682Q680 682 711 681T791 680Q814 680 839 681T869 682Q889 682 889 672Q889 650 881 642Q878 637 862 637Q787 632 726 586Q710 576 656 534T556 455L509 418L518 396Q527 374 546 329T581 244Q656 67 661 61Q663 59 666 57Q680 47 717 46H738Q744 38 744 37T741 19Q737 6 731 0H720Q680 3 625 3Q503 3 488 0H478Q472 6 472 9T474 27Q478 40 480 43T491 46H494Q544 46 544 71Q544 75 517 141T485 216L427 354L359 301L291 248L268 155Q245 63 245 58Q245 51 253 49T303 46H334Q340 37 340 35Q340 19 333 5Q328 0 317 0Q314 0 280 1T180 2Q118 2 85 2T49 1Q31 1 31 11Q31 13 34 25Q38 41 42 43T65 46Q92 46 125 49Q139 52 144 61Q147 65 216 339T285 628",
        120556: "135 2Q114 2 90 2T60 1Q35 1 35 11Q35 28 42 40Q45 46 55 46Q119 46 151 94Q153 97 325 402T498 709Q505 716 526 716Q543 716 549 710Q550 709 560 548T580 224T591 57Q594 52 595 52Q603 47 638 46H663Q670 39 670 35Q669 12 657 0H644Q613 2 530 2Q497 2 469 2T424 2T405 1Q388 1 388 10Q388 15 391 24Q392 27 393 32T395 38T397 41T401 44T406 45T415 46Q473 46 487 64L472 306Q468 365 465 426T459 518L457 550Q456 550 328 322T198 88Q196 80 196 77Q196 49 243 46Q261 46 261 35Q261 34 259 22Q256 7 254 4T240 0Q237 0 211 1T135 2",
        120557: "289 629Q289 635 232 637Q208 637 201 638T194 648Q194 649 196 659Q197 662 198 666T199 671T201 676T203 679T207 681T212 683T220 683T232 684Q238 684 262 684T307 683Q386 683 398 683T414 678Q415 674 451 396L487 117L510 154Q534 190 574 254T662 394Q837 673 839 675Q840 676 842 678T846 681L852 683H948Q965 683 988 683T1017 684Q1051 684 1051 673Q1051 668 1048 656T1045 643Q1041 637 1008 637Q968 636 957 634T939 623Q936 618 867 340T797 59Q797 55 798 54T805 50T822 48T855 46H886Q892 37 892 35Q892 19 885 5Q880 0 869 0Q864 0 828 1T736 2Q675 2 644 2T609 1Q592 1 592 11Q592 13 594 25Q598 41 602 43T625 46Q652 46 685 49Q699 52 704 61Q706 65 742 207T813 490T848 631L654 322Q458 10 453 5Q451 4 449 3Q444 0 433 0Q418 0 415 7Q413 11 374 317L335 624L267 354Q200 88 200 79Q206 46 272 46H282Q288 41 289 37T286 19Q282 3 278 1Q274 0 267 0Q265 0 255 0T221 1T157 2Q127 2 95 1T58 0Q43 0 39 2T35 11Q35 13 38 25T43 40Q45 46 65 46Q135 46 154 86Q158 92 223 354T289 629",
        120558: "234 637Q231 637 226 637Q201 637 196 638T191 649Q191 676 202 682Q204 683 299 683Q376 683 387 683T401 677Q612 181 616 168L670 381Q723 592 723 606Q723 633 659 637Q635 637 635 648Q635 650 637 660Q641 676 643 679T653 683Q656 683 684 682T767 680Q817 680 843 681T873 682Q888 682 888 672Q888 650 880 642Q878 637 858 637Q787 633 769 597L620 7Q618 0 599 0Q585 0 582 2Q579 5 453 305L326 604L261 344Q196 88 196 79Q201 46 268 46H278Q284 41 284 38T282 19Q278 6 272 0H259Q228 2 151 2Q123 2 100 2T63 2T46 1Q31 1 31 10Q31 14 34 26T39 40Q41 46 62 46Q130 49 150 85Q154 91 221 362L289 634Q287 635 234 637",
        120559: "222 668Q222 670 229 677H654Q677 677 705 677T740 678Q764 678 770 676T777 667Q777 662 764 594Q761 579 757 559T751 528L749 519Q747 512 729 512H717Q710 519 710 525Q712 532 715 559T719 591Q718 595 711 595Q682 598 486 598Q252 598 246 592Q239 587 228 552L216 517Q214 512 197 512H185Q178 517 178 522Q178 524 198 591T222 668ZM227 262Q218 262 215 262T209 266L207 270L227 356Q247 435 250 439Q253 443 260 443H267H280Q287 438 287 433Q287 430 285 420T280 402L278 393Q278 392 431 392H585L590 415Q595 436 598 439T612 443H628Q635 438 635 433Q635 431 615 351T594 268Q592 262 575 262H572Q556 262 556 272Q556 280 560 293L565 313H258L252 292Q248 271 245 267T230 262H227ZM60 0Q53 4 53 11Q53 14 68 89T84 169Q88 176 98 176H104H116Q123 169 123 163Q122 160 117 127T112 88Q112 80 243 80H351H454Q554 80 574 81T597 88V89Q603 100 610 121T622 157T630 174Q633 176 646 176H658Q665 171 665 166Q665 164 643 89T618 7Q616 2 607 1T548 0H335H60",
        120560: "740 435Q740 320 676 213T511 42T304 -22Q207 -22 138 35T51 201Q50 209 50 244Q50 346 98 438T227 601Q351 704 476 704Q514 704 524 703Q621 689 680 617T740 435ZM637 476Q637 565 591 615T476 665Q396 665 322 605Q242 542 200 428T157 216Q157 126 200 73T314 19Q404 19 485 98T608 313Q637 408 637 476",
        120561: "48 1Q31 1 31 10Q31 12 34 24Q39 43 44 45Q48 46 59 46H65Q92 46 125 49Q139 52 144 61Q146 66 215 342T285 622Q285 629 281 629Q273 632 228 634H197Q191 640 191 642T193 661Q197 674 203 680H541Q621 680 709 680T812 681Q841 681 855 681T877 679T886 676T887 670Q887 663 885 656Q880 637 875 635Q871 634 860 634H854Q827 634 794 631Q780 628 775 619Q773 614 704 338T634 58Q634 51 638 51Q646 48 692 46H723Q729 38 729 37T726 19Q722 6 716 0H701Q664 2 567 2Q533 2 504 2T458 2T437 1Q420 1 420 10Q420 15 423 24Q428 43 433 45Q437 46 448 46H454Q481 46 514 49Q528 52 533 61Q536 67 572 209T642 491T678 632Q678 634 533 634H388Q387 631 316 347T245 59Q245 55 246 54T253 50T270 48T303 46H334Q340 38 340 37T337 19Q333 6 327 0H312Q275 2 178 2Q144 2 115 2T69 2T48 1",
        120562: "287 628Q287 635 230 637Q206 637 199 638T192 648Q192 649 194 659Q200 679 203 681T397 683Q587 682 600 680Q664 669 707 631T751 530Q751 453 685 389Q616 321 507 303Q500 302 402 301H307L277 182Q247 66 247 59Q247 55 248 54T255 50T272 48T305 46H336Q342 37 342 35Q342 19 335 5Q330 0 319 0Q316 0 282 1T182 2Q120 2 87 2T51 1Q33 1 33 11Q33 13 36 25Q40 41 44 43T67 46Q94 46 127 49Q141 52 146 61Q149 65 218 339T287 628ZM645 554Q645 567 643 575T634 597T609 619T560 635Q553 636 480 637Q463 637 445 637T416 636T404 636Q391 635 386 627Q384 621 367 550T332 412T314 344Q314 342 395 342H407H430Q542 342 590 392Q617 419 631 471T645 554",
        120564: "65 0Q58 4 58 11Q58 16 114 67Q173 119 222 164L377 304Q378 305 340 386T261 552T218 644Q217 648 219 660Q224 678 228 681Q231 683 515 683H799Q804 678 806 674Q806 667 793 559T778 448Q774 443 759 443Q747 443 743 445T739 456Q739 458 741 477T743 516Q743 552 734 574T710 609T663 627T596 635T502 637Q480 637 469 637H339Q344 627 411 486T478 341V339Q477 337 477 336L457 318Q437 300 398 265T322 196L168 57Q167 56 188 56T258 56H359Q426 56 463 58T537 69T596 97T639 146T680 225Q686 243 689 246T702 250H705Q726 250 726 239Q726 238 683 123T639 5Q637 1 610 1Q577 0 348 0H65",
        120565: "40 437Q21 437 21 445Q21 450 37 501T71 602L88 651Q93 669 101 677H569H659Q691 677 697 676T704 667Q704 661 687 553T668 444Q668 437 649 437Q640 437 637 437T631 442L629 445Q629 451 635 490T641 551Q641 586 628 604T573 629Q568 630 515 631Q469 631 457 630T439 622Q438 621 368 343T298 60Q298 48 386 46Q418 46 427 45T436 36Q436 31 433 22Q429 4 424 1L422 0Q419 0 415 0Q410 0 363 1T228 2Q99 2 64 0H49Q43 6 43 9T45 27Q49 40 55 46H83H94Q174 46 189 55Q190 56 191 56Q196 59 201 76T241 233Q258 301 269 344Q339 619 339 625Q339 630 310 630H279Q212 630 191 624Q146 614 121 583T67 467Q60 445 57 441T43 437H40",
        120566: "45 535Q34 535 31 536T28 544Q28 554 39 578T70 631T126 683T206 705Q230 705 251 698T295 671T330 612T344 514Q344 477 342 473V472Q343 472 347 480T361 509T380 547Q471 704 596 704Q615 704 625 702Q659 692 679 663T700 595Q700 565 696 552T687 537T670 535Q656 535 653 536T649 543Q649 544 649 550T650 562Q650 589 629 605T575 621Q502 621 448 547T365 361Q290 70 290 60Q290 46 379 46H404Q410 40 410 39T408 19Q404 6 398 0H381Q340 2 225 2Q184 2 149 2T94 2T69 1Q61 1 58 1T53 4T51 10Q51 11 53 23Q54 25 55 30T56 36T58 40T60 43T62 44T67 46T73 46T82 46H89Q144 46 163 49T190 62L198 93Q206 124 217 169T241 262T262 350T274 404Q281 445 281 486V494Q281 621 185 621Q147 621 116 601T74 550Q71 539 66 537T45 535",
        120567: "356 624Q356 637 267 637H243Q237 642 237 645T239 664Q243 677 249 683H264Q342 681 429 681Q565 681 571 683H583Q589 677 589 674T587 656Q582 641 578 637H540Q516 637 504 637T479 633T463 630T454 623T448 613T443 597T438 576Q436 566 434 556T430 539L428 533Q442 533 472 526T543 502T613 451T642 373Q642 301 567 241T386 158L336 150Q332 150 331 146Q310 66 310 60Q310 46 399 46H424Q430 40 430 39T428 19Q424 6 418 0H401Q360 2 247 2Q207 2 173 2T119 2T95 1Q87 1 84 1T79 4T77 10Q77 11 79 23Q80 25 81 30T82 36T84 40T86 43T88 44T93 46T99 46T108 46H115Q170 46 189 49T216 62Q220 74 228 107L239 150L223 152Q139 164 82 205T24 311Q24 396 125 462Q207 517 335 533L346 578Q356 619 356 624ZM130 291Q130 203 241 188H249Q249 190 287 342L325 495H324Q313 495 291 491T229 466T168 414Q130 357 130 291ZM536 393Q536 440 507 463T418 496L341 187L351 189Q443 201 487 255Q536 314 536 393",
        120568: "42 0H40Q26 0 26 11Q26 15 29 27Q33 41 36 43T55 46Q141 49 190 98Q200 108 306 224T411 342Q302 620 297 625Q288 636 234 637H206Q200 643 200 645T202 664Q206 677 212 683H226Q260 681 347 681Q380 681 408 681T453 682T473 682Q490 682 490 671Q490 670 488 658Q484 643 481 640T465 637Q434 634 411 620L488 426L541 485Q646 598 646 610Q646 628 622 635Q617 635 609 637Q594 637 594 648Q594 650 596 664Q600 677 606 683H618Q619 683 643 683T697 681T738 680Q828 680 837 683H845Q852 676 852 672Q850 647 840 637H824Q790 636 763 628T722 611T698 593L687 584Q687 585 592 480L505 384Q505 383 536 304T601 142T638 56Q648 47 699 46Q734 46 734 37Q734 35 732 23Q728 7 725 4T711 1Q708 1 678 1T589 2Q528 2 496 2T461 1Q444 1 444 10Q444 11 446 25Q448 35 450 39T455 44T464 46T480 47T506 54Q523 62 523 64Q522 64 476 181L429 299Q241 95 236 84Q232 76 232 72Q232 53 261 47Q262 47 267 47T273 46Q276 46 277 46T280 45T283 42T284 35Q284 26 282 19Q279 6 276 4T261 1Q258 1 243 1T201 2T142 2Q64 2 42 0",
        120569: "216 151Q48 174 48 329Q48 361 56 403T65 458Q65 482 58 494T43 507T28 510T21 520Q21 528 23 534T29 544L32 546H72H94Q110 546 119 544T139 536T154 514T159 476V465Q159 445 149 399T138 314Q142 229 197 201Q223 187 226 190L233 218Q240 246 253 300T280 407Q333 619 333 625Q333 637 244 637H220Q214 642 214 645T216 664Q220 677 226 683H241Q321 681 405 681Q543 681 549 683H560Q566 677 566 674T564 656Q559 641 555 637H517Q448 636 436 628Q429 623 423 600T373 404L320 192Q370 201 419 248Q451 281 469 317T500 400T518 457Q529 486 542 505T569 532T594 543T621 546H644H669Q692 546 692 536Q691 509 676 509Q623 509 593 399Q587 377 579 355T552 301T509 244T446 195T359 159Q324 151 314 151Q311 151 310 150T298 106T287 60Q287 46 376 46H401Q407 40 407 39T405 19Q401 6 395 0H378Q337 2 224 2Q184 2 150 2T96 2T72 1Q64 1 61 1T56 4T54 10Q54 11 56 23Q57 25 58 30T59 36T61 40T63 43T65 44T70 46T76 46T85 46H92Q147 46 166 49T193 62L204 106Q216 149 216 151",
        120570: "125 84Q127 78 194 76H243V78Q243 122 208 215T165 350Q164 359 162 389Q162 522 272 610Q328 656 396 680T525 704Q628 704 698 661Q734 637 755 601T781 544T786 504Q786 439 747 374T635 226T537 109Q518 81 518 77Q537 76 557 76Q608 76 620 78T640 92Q646 100 656 119T673 155T683 172Q690 173 698 173Q718 173 718 162Q718 161 681 82T642 2Q639 0 550 0H461Q455 5 455 9T458 28Q472 78 510 149T584 276T648 402T677 525Q677 594 636 631T530 668Q476 668 423 641T335 568Q284 499 271 400Q270 388 270 348Q270 298 277 228T285 115Q285 82 280 49T271 6Q269 1 258 1T175 0H87Q83 3 80 7V18Q80 22 82 98Q84 156 85 163T91 172Q94 173 104 173T119 172Q124 169 124 126Q125 104 125 84",
        120572: "34 156Q34 270 120 356T309 442Q379 442 421 402T478 304Q484 275 485 237V208Q534 282 560 374Q564 388 566 390T582 393Q603 393 603 385Q603 376 594 346T558 261T497 161L486 147L487 123Q489 67 495 47T514 26Q528 28 540 37T557 60Q559 67 562 68T577 70Q597 70 597 62Q597 56 591 43Q579 19 556 5T512 -10H505Q438 -10 414 62L411 69L400 61Q390 53 370 41T325 18T267 -2T203 -11Q124 -11 79 39T34 156ZM208 26Q257 26 306 47T379 90L403 112Q401 255 396 290Q382 405 304 405Q235 405 183 332Q156 292 139 224T121 120Q121 71 146 49T208 26",
        120573: "29 -194Q23 -188 23 -186Q23 -183 102 134T186 465Q208 533 243 584T309 658Q365 705 429 705H431Q493 705 533 667T573 570Q573 465 469 396L482 383Q533 332 533 252Q533 139 448 65T257 -10Q227 -10 203 -2T165 17T143 40T131 59T126 65L62 -188Q60 -194 42 -194H29ZM353 431Q392 431 427 419L432 422Q436 426 439 429T449 439T461 453T472 471T484 495T493 524T501 560Q503 569 503 593Q503 611 502 616Q487 667 426 667Q384 667 347 643T286 582T247 514T224 455Q219 439 186 308T152 168Q151 163 151 147Q151 99 173 68Q204 26 260 26Q302 26 349 51T425 137Q441 171 449 214T457 279Q457 337 422 372Q380 358 347 358H337Q258 358 258 389Q258 396 261 403Q275 431 353 431",
        120574: "31 249Q11 249 11 258Q11 275 26 304T66 365T129 418T206 441Q233 441 239 440Q287 429 318 386T371 255Q385 195 385 170Q385 166 386 166L398 193Q418 244 443 300T486 391T508 430Q510 431 524 431H537Q543 425 543 422Q543 418 522 378T463 251T391 71Q385 55 378 6T357 -100Q341 -165 330 -190T303 -216Q286 -216 286 -188Q286 -138 340 32L346 51L347 69Q348 79 348 100Q348 257 291 317Q251 355 196 355Q148 355 108 329T51 260Q49 251 47 251Q45 249 31 249",
        120575: "195 609Q195 656 227 686T302 717Q319 716 351 709T407 697T433 690Q451 682 451 662Q451 644 438 628T403 612Q382 612 348 641T288 671T249 657T235 628Q235 584 334 463Q401 379 401 292Q401 169 340 80T205 -10H198Q127 -10 83 36T36 153Q36 286 151 382Q191 413 252 434Q252 435 245 449T230 481T214 521T201 566T195 609ZM112 130Q112 83 136 55T204 27Q233 27 256 51T291 111T309 178T316 232Q316 267 309 298T295 344T269 400L259 396Q215 381 183 342T137 256T118 179T112 130",
        120576: "190 -22Q124 -22 76 11T27 107Q27 174 97 232L107 239L99 248Q76 273 76 304Q76 364 144 408T290 452H302Q360 452 405 421Q428 405 428 392Q428 381 417 369T391 356Q382 356 371 365T338 383T283 392Q217 392 167 368T116 308Q116 289 133 272Q142 263 145 262T157 264Q188 278 238 278H243Q308 278 308 247Q308 206 223 206Q177 206 142 219L132 212Q68 169 68 112Q68 39 201 39Q253 39 286 49T328 72T345 94T362 105Q376 103 376 88Q376 79 365 62T334 26T275 -8T190 -22",
        120577: "296 643Q298 704 324 704Q342 704 342 687Q342 682 339 664T336 633Q336 623 337 618T338 611Q339 612 341 612Q343 614 354 616T374 618L384 619H394Q471 619 471 586Q467 548 386 546H372Q338 546 320 564L311 558Q235 506 175 398T114 190Q114 171 116 155T125 127T137 104T153 86T171 72T192 61T213 53T235 46T256 39L322 16Q389 -10 389 -80Q389 -119 364 -154T300 -202Q292 -204 274 -204Q247 -204 225 -196Q210 -192 193 -182T172 -167Q167 -159 173 -148Q180 -139 191 -139Q195 -139 221 -153T283 -168Q298 -166 310 -152T322 -117Q322 -91 302 -75T250 -51T183 -29T116 4T65 62T44 160Q44 287 121 410T293 590L302 595Q296 613 296 643",
        120578: "21 287Q22 290 23 295T28 317T38 348T53 381T73 411T99 433T132 442Q156 442 175 435T205 417T221 395T229 376L231 369Q231 367 232 367L243 378Q304 442 382 442Q436 442 469 415T503 336V326Q503 302 439 53Q381 -182 377 -189Q364 -216 332 -216Q319 -216 310 -208T299 -186Q299 -177 358 57L420 307Q423 322 423 345Q423 404 379 404H374Q288 404 229 303L222 291L189 157Q156 26 151 16Q138 -11 108 -11Q95 -11 87 -5T76 7T74 17Q74 30 114 189T154 366Q154 405 128 405Q107 405 92 377T68 316T57 280Q55 278 41 278H27Q21 284 21 287",
        120579: "35 200Q35 302 74 415T180 610T319 704Q320 704 327 704T339 705Q393 701 423 656Q462 596 462 495Q462 380 417 261T302 66T168 -10H161Q125 -10 99 10T60 63T41 130T35 200ZM383 566Q383 668 330 668Q294 668 260 623T204 521T170 421T157 371Q206 370 254 370L351 371Q352 372 359 404T375 484T383 566ZM113 132Q113 26 166 26Q181 26 198 36T239 74T287 161T335 307L340 324H145Q145 321 136 286T120 208T113 132",
        120580: "139 -10Q111 -10 92 0T64 25T52 52T48 74Q48 89 55 109T85 199T135 375L137 384Q139 394 140 397T145 409T151 422T160 431T173 439T190 442Q202 442 213 435T225 410Q225 404 214 358T181 238T137 107Q126 74 126 54Q126 43 126 39T130 31T142 27H147Q206 27 255 78Q272 98 281 114T290 138T295 149T313 153Q321 153 324 153T329 152T332 149T332 143Q332 106 276 48T145 -10H139",
        120581: "83 -11Q70 -11 62 -4T51 8T49 17Q49 30 96 217T147 414Q160 442 193 442Q205 441 213 435T223 422T225 412Q225 401 208 337L192 270Q193 269 208 277T235 292Q252 304 306 349T396 412T467 431Q489 431 500 420T512 391Q512 366 494 347T449 327Q430 327 418 338T405 368Q405 370 407 380L397 375Q368 360 315 315L253 266L240 257H245Q262 257 300 251T366 230Q422 203 422 150Q422 140 417 114T411 67Q411 26 437 26Q484 26 513 137Q516 149 519 151T535 153Q554 153 554 144Q554 121 527 64T457 -7Q447 -10 431 -10Q386 -10 360 17T333 90Q333 108 336 122T339 146Q339 170 320 186T271 209T222 218T185 221H180L155 122Q129 22 126 16Q113 -11 83 -11",
        120582: "166 673Q166 685 183 694H202Q292 691 316 644Q322 629 373 486T474 207T524 67Q531 47 537 34T546 15T551 6T555 2T556 -2T550 -11H482Q457 3 450 18T399 152L354 277L340 262Q327 246 293 207T236 141Q211 112 174 69Q123 9 111 -1T83 -12Q47 -12 47 20Q47 37 61 52T199 187Q229 216 266 252T321 306L338 322Q338 323 288 462T234 612Q214 657 183 657Q166 657 166 673",
        120583: "58 -216Q44 -216 34 -208T23 -186Q23 -176 96 116T173 414Q186 442 219 442Q231 441 239 435T249 423T251 413Q251 401 220 279T187 142Q185 131 185 107V99Q185 26 252 26Q261 26 270 27T287 31T302 38T315 45T327 55T338 65T348 77T356 88T365 100L372 110L408 253Q444 395 448 404Q461 431 491 431Q504 431 512 424T523 412T525 402L449 84Q448 79 448 68Q448 43 455 35T476 26Q485 27 496 35Q517 55 537 131Q543 151 547 152Q549 153 557 153H561Q580 153 580 144Q580 138 575 117T555 63T523 13Q510 0 491 -8Q483 -10 467 -10Q446 -10 429 -4T402 11T385 29T376 44T374 51L368 45Q362 39 350 30T324 12T288 -4T246 -11Q199 -11 153 12L129 -85Q108 -167 104 -180T92 -202Q76 -216 58 -216",
        120584: "74 431Q75 431 146 436T219 442Q231 442 231 434Q231 428 185 241L137 51H140L150 55Q161 59 177 67T214 86T261 119T312 165Q410 264 445 394Q458 442 496 442Q509 442 519 434T530 411Q530 390 516 352T469 262T388 162T267 70T106 5Q81 -2 71 -2Q66 -2 59 -1T51 1Q45 5 45 11Q45 13 88 188L132 364Q133 377 125 380T86 385H65Q59 391 59 393T61 412Q65 431 74 431",
        120585: "268 632Q268 704 296 704Q314 704 314 687Q314 682 311 664T308 635T309 620V616H315Q342 619 360 619Q443 619 443 586Q439 548 358 546H344Q326 546 317 549T290 566Q257 550 226 505T195 405Q195 381 201 364T211 342T218 337Q266 347 298 347Q375 347 375 314Q374 297 359 288T327 277T280 275Q234 275 208 283L195 286Q149 260 119 214T88 130Q88 116 90 108Q101 79 129 63T229 20Q238 17 243 15Q337 -21 354 -33Q383 -53 383 -94Q383 -137 351 -171T273 -205Q240 -205 202 -190T158 -167Q156 -163 156 -159Q156 -151 161 -146T176 -140Q182 -140 189 -143Q232 -168 274 -168Q286 -168 292 -165Q313 -151 313 -129Q313 -112 301 -104T232 -75Q214 -68 204 -64Q198 -62 171 -52T136 -38T107 -24T78 -8T56 12T36 37T26 66T21 103Q21 149 55 206T145 301L154 307L148 313Q141 319 136 323T124 338T111 358T103 382T99 413Q99 471 143 524T259 602L271 607Q268 618 268 632",
        120586: "201 -11Q126 -11 80 38T34 156Q34 221 64 279T146 380Q222 441 301 441Q333 441 341 440Q354 437 367 433T402 417T438 387T464 338T476 268Q476 161 390 75T201 -11ZM121 120Q121 70 147 48T206 26Q250 26 289 58T351 142Q360 163 374 216T388 308Q388 352 370 375Q346 405 306 405Q243 405 195 347Q158 303 140 230T121 120",
        120587: "132 -11Q98 -11 98 22V33L111 61Q186 219 220 334L228 358H196Q158 358 142 355T103 336Q92 329 81 318T62 297T53 285Q51 284 38 284Q19 284 19 294Q19 300 38 329T93 391T164 429Q171 431 389 431Q549 431 553 430Q573 423 573 402Q573 371 541 360Q535 358 472 358H408L405 341Q393 269 393 222Q393 170 402 129T421 65T431 37Q431 20 417 5T381 -10Q370 -10 363 -7T347 17T331 77Q330 86 330 121Q330 170 339 226T357 318T367 358H269L268 354Q268 351 249 275T206 114T175 17Q164 -11 132 -11",
        120588: "58 -216Q25 -216 23 -186Q23 -176 73 26T127 234Q143 289 182 341Q252 427 341 441Q343 441 349 441T359 442Q432 442 471 394T510 276Q510 219 486 165T425 74T345 13T266 -10H255H248Q197 -10 165 35L160 41L133 -71Q108 -168 104 -181T92 -202Q76 -216 58 -216ZM424 322Q424 359 407 382T357 405Q322 405 287 376T231 300Q217 269 193 170L176 102Q193 26 260 26Q298 26 334 62Q367 92 389 158T418 266T424 322",
        120589: "31 207Q31 306 115 374T302 442Q341 442 373 430T405 400Q405 392 399 383T379 374Q373 375 348 390T296 405Q222 405 160 357T98 249Q98 232 103 218T112 195T132 175T154 159T186 141T219 122Q234 114 255 102T286 85T299 78L302 74Q306 71 308 69T315 61T322 51T328 40T332 25T334 8Q334 -31 305 -69T224 -107Q194 -107 163 -92Q156 -88 156 -80Q156 -73 162 -67T178 -61Q186 -61 190 -63Q209 -71 224 -71Q244 -71 253 -59T263 -30Q263 -25 263 -21T260 -12T255 -4T248 3T239 9T227 17T213 25T195 34T174 46Q170 48 150 58T122 74T97 90T70 112T51 137T36 169T31 207",
        120590: "184 -11Q116 -11 74 34T31 147Q31 247 104 333T274 430Q275 431 414 431H552Q553 430 555 429T559 427T562 425T565 422T567 420T569 416T570 412T571 407T572 401Q572 357 507 357Q500 357 490 357T476 358H416L421 348Q439 310 439 263Q439 153 359 71T184 -11ZM361 278Q361 358 276 358Q152 358 115 184Q114 180 114 178Q106 141 106 117Q106 67 131 47T188 26Q242 26 287 73Q316 103 334 153T356 233T361 278",
        120591: "39 284Q18 284 18 294Q18 301 45 338T99 398Q134 425 164 429Q170 431 332 431Q492 431 497 429Q517 424 517 402Q517 388 508 376T485 360Q479 358 389 358T299 356Q298 355 283 274T251 109T233 20Q228 5 215 -4T186 -13Q153 -13 153 20V30L203 192Q214 228 227 272T248 336L254 357Q254 358 208 358Q206 358 197 358T183 359Q105 359 61 295Q56 287 53 286T39 284",
        120592: "413 384Q413 406 432 424T473 443Q492 443 507 425T523 367Q523 334 508 270T468 153Q424 63 373 27T282 -10H268Q220 -10 186 2T135 36T111 78T104 121Q104 170 138 262T173 379Q173 380 173 381Q173 390 173 393T169 400T158 404H154Q131 404 112 385T82 344T65 302T57 280Q55 278 41 278H27Q21 284 21 287Q21 299 34 333T82 404T161 441Q200 441 225 419T250 355Q248 336 247 334Q247 331 232 291T201 199T185 118Q185 68 211 47T275 26Q317 26 355 57T416 132T452 216T465 277Q465 301 457 318T439 343T421 361T413 384",
        120593: "92 210Q92 176 106 149T142 108T185 85T220 72L235 70L237 71L250 112Q268 170 283 211T322 299T370 375T429 423T502 442Q547 442 582 410T618 302Q618 224 575 152T457 35T299 -10Q273 -10 273 -12L266 -48Q260 -83 252 -125T241 -179Q236 -203 215 -212Q204 -218 190 -218Q159 -215 159 -185Q159 -175 214 -2L209 0Q204 2 195 5T173 14T147 28T120 46T94 71T71 103T56 142T50 190Q50 238 76 311T149 431H162Q183 431 183 423Q183 417 175 409Q134 361 114 300T92 210ZM574 278Q574 320 550 344T486 369Q437 369 394 329T323 218Q309 184 295 109L286 64Q304 62 306 62Q423 62 498 131T574 278",
        120594: "576 -125Q576 -147 547 -175T487 -204H476Q394 -204 363 -157Q334 -114 293 26L284 59Q283 58 248 19T170 -66T92 -151T53 -191Q49 -194 43 -194Q36 -194 31 -189T25 -177T38 -154T151 -30L272 102L265 131Q189 405 135 405Q104 405 87 358Q86 351 68 351Q48 351 48 361Q48 369 56 386T89 423T148 442Q224 442 258 400Q276 375 297 320T330 222L341 180Q344 180 455 303T573 429Q579 431 582 431Q600 431 600 414Q600 407 587 392T477 270Q356 138 353 134L362 102Q392 -10 428 -89T490 -168Q504 -168 517 -156T536 -126Q539 -116 543 -115T557 -114T571 -115Q576 -118 576 -125",
        120595: "161 441Q202 441 226 417T250 358Q250 338 218 252T187 127Q190 85 214 61Q235 43 257 37Q275 29 288 29H289L371 360Q455 691 456 692Q459 694 472 694Q492 694 492 687Q492 678 411 356Q329 28 329 27T335 26Q421 26 498 114T576 278Q576 302 568 319T550 343T532 361T524 384Q524 405 541 424T583 443Q602 443 618 425T634 366Q634 337 623 288T605 220Q573 125 492 57T329 -11H319L296 -104Q272 -198 272 -199Q270 -205 252 -205H239Q233 -199 233 -197Q233 -192 256 -102T279 -9Q272 -8 265 -8Q106 14 106 139Q106 174 139 264T173 379Q173 380 173 381Q173 390 173 393T169 400T158 404H154Q131 404 112 385T82 344T65 302T57 280Q55 278 41 278H27Q21 284 21 287Q21 299 34 333T82 404T161 441",
        120596: "495 384Q495 406 514 424T555 443Q574 443 589 425T604 364Q604 334 592 278T555 155T483 38T377 -11Q297 -11 267 66Q266 68 260 61Q201 -11 125 -11Q15 -11 15 139Q15 230 56 325T123 434Q135 441 147 436Q160 429 160 418Q160 406 140 379T94 306T62 208Q61 202 61 187Q61 124 85 100T143 76Q201 76 245 129L253 137V156Q258 297 317 297Q348 297 348 261Q348 243 338 213T318 158L308 135Q309 133 310 129T318 115T334 97T358 83T393 76Q456 76 501 148T546 274Q546 305 533 325T508 357T495 384",
        120597: "202 508Q179 508 169 520T158 547Q158 557 164 577T185 624T230 675T301 710L333 715H345Q378 715 384 714Q447 703 489 661T549 568T566 457Q566 362 519 240T402 53Q321 -22 223 -22Q123 -22 73 56Q42 102 42 148V159Q42 276 129 370T322 465Q383 465 414 434T455 367L458 378Q478 461 478 515Q478 603 437 639T344 676Q266 676 223 612Q264 606 264 572Q264 547 246 528T202 508ZM430 306Q430 372 401 400T333 428Q270 428 222 382Q197 354 183 323T150 221Q132 149 132 116Q132 21 232 21Q244 21 250 22Q327 35 374 112Q389 137 409 196T430 306",
        120598: "227 -11Q149 -11 95 41T40 174Q40 262 87 322Q121 367 173 396T287 430Q289 431 329 431H367Q382 426 382 411Q382 385 341 385H325H312Q191 385 154 277L150 265H327Q340 256 340 246Q340 228 320 219H138V217Q128 187 128 143Q128 77 160 52T231 26Q258 26 284 36T326 57T343 68Q350 68 354 58T358 39Q358 36 357 35Q354 31 337 21T289 0T227 -11",
        120599: "537 500Q537 474 533 439T524 383L521 362Q558 355 561 351Q563 349 563 345Q563 321 552 318Q542 318 521 323L510 326Q496 261 459 187T362 51T241 -11Q100 -11 100 105Q100 139 127 242T154 366Q154 405 128 405Q107 405 92 377T68 316T57 280Q55 278 41 278H27Q21 284 21 287Q21 291 27 313T47 368T79 418Q103 442 134 442Q169 442 201 419T233 344Q232 330 206 228T180 98Q180 26 247 26Q292 26 332 90T404 260L427 349Q422 349 398 359T339 392T289 440Q265 476 265 520Q265 590 312 647T417 705Q463 705 491 670T528 592T537 500ZM464 564Q464 668 413 668Q373 668 339 622T304 522Q304 494 317 470T349 431T388 406T421 391T435 387H436L443 415Q450 443 457 485T464 564",
        120600: "228 325Q170 322 156 316T127 309Q108 309 104 314Q99 319 99 322T108 341Q125 376 171 400T268 425H271Q302 425 319 396Q328 377 328 358Q328 332 324 314Q311 270 286 221Q274 194 274 192H275Q339 234 484 325T639 421Q669 434 691 434T723 425T734 406Q734 394 719 381Q715 376 644 330L575 287L566 267Q543 233 526 176Q520 160 515 143T508 115T506 105Q506 103 533 103Q585 103 607 110T641 118Q670 118 670 107Q670 100 661 85Q643 50 598 27T504 3Q465 3 450 36Q441 51 441 73Q441 84 444 96Q452 146 484 205L497 236L324 125Q143 12 135 10Q103 -6 77 -6Q61 -6 49 2T37 21Q37 36 49 46T124 96L195 141L204 156Q219 179 243 248T264 323Q264 325 228 325",
        120601: "409 688Q413 694 421 694H429H442Q448 688 448 686Q448 679 418 563Q411 535 404 504T392 458L388 442Q388 441 397 441T429 435T477 418Q521 397 550 357T579 260T548 151T471 65T374 11T279 -10H275L251 -105Q245 -128 238 -160Q230 -192 227 -198T215 -205H209Q189 -205 189 -198Q189 -193 211 -103L234 -11Q234 -10 226 -10Q221 -10 206 -8T161 6T107 36T62 89T43 171Q43 231 76 284T157 370T254 422T342 441Q347 441 348 445L378 567Q409 686 409 688ZM122 150Q122 116 134 91T167 53T203 35T237 27H244L337 404Q333 404 326 403T297 395T255 379T211 350T170 304Q152 276 137 237Q122 191 122 150ZM500 282Q500 320 484 347T444 385T405 400T381 404H378L332 217L284 29Q284 27 285 27Q293 27 317 33T357 47Q400 66 431 100T475 170T494 234T500 282",
        120602: "205 -174Q136 -174 102 -153T67 -76Q67 -25 91 85T127 234Q143 289 182 341Q252 427 341 441Q343 441 349 441T359 442Q432 442 471 394T510 276Q510 169 431 80T253 -10Q226 -10 204 -2T169 19T146 44T132 64L128 73Q128 72 124 53T116 5T112 -44Q112 -68 117 -78T150 -95T236 -102Q327 -102 356 -111T386 -154Q386 -166 384 -178Q381 -190 378 -192T361 -194H348Q342 -188 342 -179Q342 -169 315 -169Q294 -169 264 -171T205 -174ZM424 322Q424 359 407 382T357 405Q322 405 287 376T231 300Q221 276 204 217Q188 152 188 116Q188 68 210 47T259 26Q297 26 334 62Q367 92 389 158T418 266T424 322",
        120603: "206 -10Q158 -10 136 24T114 110Q114 233 199 349L205 358H184Q144 358 121 347Q108 340 95 330T75 312T61 295T53 285Q51 284 38 284Q19 284 19 294Q19 300 38 329T93 391T164 429Q171 431 532 431Q799 431 803 430Q823 423 823 402Q823 377 801 364Q790 358 766 358Q748 358 748 357Q748 355 749 348T752 327T754 297Q754 258 738 207T693 107T618 24T520 -10Q488 -10 466 2T432 36T416 77T411 120Q411 128 410 128T404 122Q373 71 323 31T206 -10ZM714 296Q714 316 707 358H251Q250 357 244 348T230 328T212 301T193 267T176 229T164 187T159 144Q159 62 222 62Q290 62 349 127T432 285Q433 286 434 288T435 291T437 293T440 294T444 294T452 294H466Q472 288 472 286Q472 285 464 244T456 170Q456 62 534 62Q604 62 659 139T714 296",
        120604: "65 0Q45 0 45 18Q48 52 61 60Q65 62 81 62Q155 62 165 74Q166 74 265 228T465 539T569 699Q576 707 583 709T611 711T637 710T649 700Q650 697 695 380L741 63L784 62H827Q839 50 839 45L835 29Q831 9 827 5T806 0Q803 0 790 0T743 1T657 2Q585 2 547 1T504 0Q481 0 481 17Q484 54 497 60Q501 62 541 62Q580 62 580 63Q580 68 573 121T564 179V181H308L271 124Q236 69 236 67T283 62H287Q316 62 316 46Q316 26 307 8Q302 3 295 0L262 1Q242 2 168 2Q119 2 93 1T65 0ZM537 372Q533 402 528 435T521 486T518 504V505Q517 505 433 375L348 244L451 243Q555 243 555 244L537 372",
        120605: "258 624H235Q214 624 209 626T199 639Q203 678 216 684Q220 686 449 686H477H586Q684 686 733 677T817 634Q853 598 853 547Q853 499 826 460T761 401T695 371T654 360H653L662 358Q670 357 683 354T712 344T744 327T774 303T795 269T804 224Q804 148 732 79T533 1Q524 0 288 0H58Q47 5 43 15Q47 54 60 60Q64 62 113 62H162L302 623Q302 624 258 624ZM703 550Q703 571 695 586T675 609T656 619T643 623L545 624H447L417 504Q386 384 386 383T470 382Q554 383 565 385Q632 397 667 447T703 550ZM651 240Q651 265 645 282T626 309T608 322T592 329Q587 330 479 331H373L340 198Q307 65 306 64Q306 62 406 62L507 63L519 65Q565 76 596 107T639 171T651 240",
        120606: "257 618H231Q198 618 198 636Q202 672 214 678L219 680H763Q769 677 772 673T776 666L777 664Q777 659 766 549T751 433Q745 424 723 424Q704 424 699 427T693 441Q693 444 695 467T697 513Q697 543 689 563T670 594T636 610T592 617T534 618H516H456L455 614Q455 613 387 339T317 64Q317 62 375 62H411Q430 62 438 59T447 44Q444 7 430 2Q426 0 416 0Q409 0 359 1T231 2Q152 2 111 1T65 0Q48 0 43 15Q47 54 60 60Q64 62 113 62H162L163 66Q163 67 231 341T301 616Q301 618 257 618",
        120607: "65 0Q59 6 59 9T61 16Q64 20 334 357T608 698Q616 706 629 710Q630 710 634 710T644 710T656 711Q686 711 694 703Q698 699 700 693Q706 674 805 345T904 14Q904 7 894 1L479 0H65ZM630 342L567 551L232 134L462 133H693Q693 137 630 342",
        120608: "257 618H231Q198 618 198 636Q202 672 214 678L219 680H811Q817 677 820 673T824 666L825 664Q825 659 814 549T799 433Q793 424 771 424Q752 424 746 427T740 441Q740 445 742 466T744 505Q744 561 722 585T646 616Q639 617 545 618H456Q456 617 427 502T398 385Q398 384 435 384Q461 385 471 385T499 391T526 405T545 433T562 478Q566 494 571 497T595 501H604Q622 501 626 486Q626 482 593 349T557 213Q552 205 530 205Q499 205 499 219Q499 222 503 242T508 281Q508 308 491 314T429 322Q425 322 423 322H382L317 64Q317 62 390 62Q460 62 493 64T569 80T640 124Q665 149 686 187T719 253T733 283Q739 289 760 289Q791 289 791 274Q791 267 763 201T706 71L678 8Q676 4 667 0H58Q47 5 43 15Q47 54 60 60Q64 62 113 62H162L163 66Q163 67 231 341T301 616Q301 618 257 618",
        120609: "223 430Q192 430 192 448Q192 450 225 561T261 677Q265 683 270 684Q273 686 534 686Q796 686 797 685Q805 682 805 673Q805 668 804 661T800 648T798 641Q796 637 531 352L266 67L329 66H364Q412 66 446 70T523 96T596 157Q617 186 630 220T649 273T663 297Q667 299 684 299H688Q715 299 715 281Q715 278 673 145T628 8Q626 4 617 0H348Q289 0 221 0T139 -1Q112 -1 99 -1T78 1T69 5T68 12Q68 16 71 31T77 49L84 57Q91 65 104 79T133 110T170 151T213 196L610 624H540Q533 624 514 624T488 624T467 623T443 620T422 616T398 609T373 600Q292 560 255 449Q251 436 246 433T223 430",
        120610: "258 624H235Q214 624 209 626T199 639Q203 678 216 684Q220 686 239 686Q290 684 403 684Q475 684 512 685T553 686Q576 686 576 668Q572 632 560 626Q555 624 506 624H457L399 389Q399 388 547 388H695L753 623Q753 624 709 624H686Q665 624 660 626T650 639Q653 678 668 684Q672 686 681 686Q685 686 726 685T847 684Q902 684 937 684T986 685T1004 686Q1027 686 1027 668Q1023 632 1011 626Q1006 624 957 624H908L839 344Q768 64 768 63T812 62H839Q871 62 871 44Q867 6 854 2L850 0L808 1Q782 2 675 2Q600 2 560 1T516 0Q499 0 494 15Q498 54 511 60Q515 62 564 62H613L614 66L679 324Q679 326 531 326H383L382 322L317 64Q317 62 361 62H388Q420 62 420 44Q416 6 403 2L399 0L357 1Q331 2 224 2Q149 2 109 1T65 0Q48 0 43 15Q47 54 60 60Q64 62 113 62H162L302 623Q302 624 258 624",
        120611: "358 -17Q218 -17 136 49T54 243Q54 298 70 356T123 474T211 582T338 663T504 702H527Q578 702 590 701Q709 688 776 622T844 441Q844 379 825 315T765 192T668 86T532 11T358 -17ZM700 474Q700 525 685 561T642 616T587 643T528 652Q390 652 301 534Q252 472 225 373T198 210Q198 160 214 125T256 71T311 44T372 36Q484 36 571 119Q639 189 669 299T700 474ZM366 428Q366 425 364 419T362 411H466L570 412L573 422Q576 437 581 441T604 445Q620 445 623 444Q636 440 636 429Q636 423 616 340T593 253Q586 243 572 243H566Q545 243 539 249Q536 251 535 253T534 258T534 263T535 270T537 277H329L326 266Q323 251 318 247T295 243Q279 243 276 244Q263 248 263 259Q263 265 283 346Q288 366 295 394Q304 431 308 438T326 445H334H338Q366 445 366 428",
        120612: "247 624Q242 624 233 624T220 623Q186 623 186 640Q186 647 190 664T202 684Q206 686 226 686Q277 684 393 684Q435 684 471 684T528 685T553 686Q573 686 573 670Q573 650 564 632Q556 624 537 624H501H449L380 344Q309 64 309 63T356 62Q361 62 370 62T384 63Q417 63 417 46Q417 26 408 8Q403 3 396 0L352 1Q325 2 216 2T82 1L45 0Q30 7 30 16Q33 51 46 60Q51 62 102 62H154L294 623Q294 624 247 624",
        120613: "536 0Q522 6 522 18Q522 35 533 57Q539 62 557 62Q595 62 601 65L472 330L365 255L342 160Q318 65 317 64Q317 62 361 62H388Q420 62 420 44Q416 6 403 2L399 0L357 1Q331 2 224 2Q149 2 109 1T65 0Q48 0 43 15Q47 54 60 60Q64 62 113 62H162L302 623Q302 624 258 624H235Q214 624 209 626T199 639Q203 678 216 684Q220 686 239 686Q290 684 403 684Q475 684 512 685T553 686Q576 686 576 668Q572 632 560 626Q555 624 506 624H457L422 481Q386 339 386 337L785 621Q779 624 749 624Q726 624 726 641Q726 645 730 659Q734 675 736 679T747 686L786 685Q812 684 888 684Q908 684 934 685T968 686Q1003 686 1003 669Q1003 646 991 629Q985 624 967 624Q918 624 888 617Q884 617 874 613L865 609Q864 608 732 515T599 420Q599 418 686 242T775 65Q784 62 829 62Q847 62 850 61T860 54Q862 52 862 43Q862 10 845 1Q844 1 842 1T836 0T797 1T694 2Q599 2 573 1L536 0",
        120614: "439 0Q425 6 425 18Q425 35 436 57Q442 62 485 62Q525 62 525 64L478 483Q478 484 465 463T422 394T350 277Q222 69 222 68Q223 67 224 67Q229 64 271 62Q290 62 297 59T305 45Q305 38 302 28Q297 9 293 5T274 0Q270 0 238 1T159 2Q133 2 105 2T72 1Q56 1 52 3T44 15Q44 19 48 35Q53 55 58 58T89 62Q142 64 151 73Q154 76 345 387T538 699Q550 711 570 711H580H592Q613 711 618 695Q619 692 654 379T690 63Q690 62 726 62H746Q776 62 776 44Q773 7 759 2Q755 0 747 0Q743 0 707 1T600 2Q502 2 476 1L439 0",
        120615: "258 624H231Q214 624 208 626T199 639Q203 678 216 684Q220 686 347 686H473Q474 685 478 682T484 677Q487 673 535 413L584 153L608 187Q631 221 672 281T761 410Q935 663 943 671Q949 678 962 686H1082H1166Q1201 686 1210 683T1219 668Q1215 632 1203 626Q1199 624 1149 624H1100L1031 344Q960 64 960 63T1004 62H1031Q1063 62 1063 44Q1060 7 1046 2Q1042 0 1034 0Q1030 0 990 1T875 2Q804 2 767 1T725 0H723Q707 0 703 15Q707 54 720 60Q724 62 773 62H822Q961 618 961 619L754 318Q546 15 543 12Q531 0 510 0Q500 0 495 0T484 5T477 19Q477 20 421 315L367 604L299 335Q234 72 234 68Q234 62 302 62Q334 62 334 46Q332 8 317 2Q313 0 306 0Q301 0 267 1T181 2Q125 2 96 1T63 0Q48 0 43 15Q43 19 47 35Q52 55 57 58T94 62Q147 64 164 69L233 345Q302 619 302 622Q302 624 258 624",
        120616: "258 624H235Q214 624 209 626T199 639Q203 678 216 684Q220 686 344 686H434Q464 686 477 680Q480 677 607 454Q738 227 739 227Q742 227 789 418T836 618Q836 620 835 620L821 622Q811 622 779 624Q755 624 749 625T740 632Q737 635 737 644Q737 656 742 669T754 685Q755 685 757 685T763 686Q768 686 803 685T890 684Q925 684 951 684T990 685T1006 686Q1014 686 1016 684Q1027 679 1027 668Q1023 632 1011 626Q1007 624 978 624Q912 622 907 617Q907 616 831 314T753 8Q749 0 723 0H712Q699 0 692 7Q692 8 671 44T607 155T526 296L361 580L296 323Q234 74 234 68T302 62H307Q334 62 334 44Q330 6 317 2L313 0L280 1Q260 2 181 2Q125 2 96 1T63 0Q48 0 43 15Q43 19 47 35Q52 55 57 58T94 62Q147 64 164 69L233 345Q302 619 302 622Q302 624 258 624",
        120617: "206 466Q175 466 175 484Q175 487 201 574T230 666Q235 673 241 675H547Q853 675 857 673Q867 668 867 657Q867 655 850 569T832 478Q827 466 808 466H802H795Q773 466 771 481Q771 486 775 508T779 541V549H774Q755 552 505 552Q281 551 267 548Q262 548 255 533T242 496T233 472Q228 466 206 466ZM259 255H252Q231 255 228 270Q228 275 248 355T270 439Q277 448 288 448H298Q321 448 326 440Q331 434 326 414Q326 413 486 413H647L650 424Q654 441 658 444T678 448H683H693Q702 448 705 446T714 432L694 348Q674 267 669 261Q664 255 652 255H643Q622 255 617 261Q613 265 613 272T613 283T616 289Q616 290 456 290H295L294 285Q293 280 292 275T288 265T281 257Q278 255 259 255ZM150 131Q150 124 281 123Q346 123 390 123Q640 123 664 126Q668 127 675 127Q686 131 704 198Q708 213 713 216T733 220H738Q755 220 759 218Q768 213 768 203Q768 198 741 105T710 8Q708 4 699 0H388Q77 0 73 2Q62 7 62 18Q62 27 81 115Q99 206 102 212Q106 220 120 220H129Q140 220 145 220T155 215T160 202Q160 196 159 192Q150 145 150 131",
        120618: "53 245Q53 297 70 356T125 478T216 590T349 671T523 703Q656 703 735 637T815 445Q815 378 791 307Q727 104 527 17Q437 -17 344 -17Q289 -17 242 -5T150 35T79 116T53 245ZM664 489Q664 575 618 611T511 648Q463 648 416 627T334 570Q297 531 270 472T230 355T213 261T208 206Q208 177 215 151T237 98T284 56T358 40Q440 40 510 98T618 270Q664 400 664 489",
        120619: "257 618H231Q198 618 198 636Q202 672 214 678L219 680H1011Q1022 675 1026 665Q1022 626 1009 620Q1005 618 956 618H907L906 614Q906 613 838 339T768 64Q768 62 812 62H839Q871 62 871 44Q867 6 854 2L850 0L808 1Q782 2 675 2Q600 2 560 1T516 0Q499 0 494 15Q498 54 511 60Q515 62 564 62H613L614 66Q614 67 682 341T752 616Q752 618 604 618H456L455 614Q455 613 387 339T317 64Q317 62 361 62H388Q420 62 420 44Q416 6 403 2L399 0L357 1Q331 2 224 2Q149 2 109 1T65 0Q48 0 43 15Q47 54 60 60Q64 62 113 62H162L163 66Q163 67 231 341T301 616Q301 618 257 618",
        120620: "162 62L302 623Q302 624 258 624H234Q214 624 209 626T200 638Q200 677 217 684Q220 686 439 686Q667 685 684 682Q686 681 693 680Q713 677 733 671T782 649T829 602T847 528Q847 450 784 382T604 293Q571 288 469 287H373L346 176Q340 151 333 122T321 78L317 64Q317 62 361 62H387Q420 62 420 44Q417 10 404 2L399 0L357 1Q331 2 224 2Q149 2 109 1T65 0Q43 0 43 17Q43 21 47 33Q52 54 57 58T89 62H113H162ZM692 558Q692 611 617 622Q610 623 529 624H452L381 343H458H492Q604 343 641 389Q662 414 677 471T692 558",
        120622: "847 430Q828 430 823 434T817 450Q817 454 817 466T818 487Q818 526 809 551T784 591T737 613T675 622T590 624H528H430L513 487Q594 351 596 345Q596 335 590 330Q583 323 418 204L250 81L363 80Q533 80 591 89T694 142Q739 185 765 252Q772 268 776 271T799 274Q816 274 820 272Q832 266 830 254Q829 250 784 130T736 7Q732 3 725 0H405Q84 0 80 2Q69 7 69 18Q69 26 75 32Q76 32 98 48T168 100T255 164L432 293Q429 300 329 465T225 637Q223 675 245 686H888Q900 680 902 671Q902 667 890 556T876 441Q871 430 847 430",
        120623: "498 62Q511 58 511 43Q511 10 494 1L490 0Q487 0 482 0T424 1T271 2Q201 2 157 2T94 1T72 0H70Q46 0 46 17Q49 54 62 60L66 62H137Q208 62 209 63L218 98Q227 134 244 203T278 339L347 613H300Q262 612 246 611T198 599T146 564Q128 545 114 512T91 454T79 425Q73 419 52 419Q22 419 22 434Q22 440 41 498T80 611L100 666Q105 673 111 675H434Q758 675 762 673Q772 668 772 657Q772 655 756 549T738 434Q735 419 711 419H707Q690 419 686 421Q677 425 677 434Q676 436 678 449T683 485T686 529Q686 553 679 569T662 594T631 607T593 612T544 613H502L433 340Q418 279 400 207T374 100L365 65L364 62H498",
        120624: "32 544Q32 586 91 644T229 703Q277 703 311 683T363 628T389 560T397 491V478L404 491Q455 589 526 646T677 703Q730 703 766 671T802 584Q802 551 793 541T766 531H757L736 532L732 535L729 539V549Q731 569 715 575T658 581H650Q545 581 477 443Q453 392 443 351Q441 345 424 273T389 133T371 64Q371 62 428 62H461Q483 62 492 59T501 44Q498 10 485 2L480 0L431 1Q401 2 278 2T127 1L85 0Q71 5 71 17Q71 24 74 33Q77 46 78 49T84 57T95 61T118 62H154H216Q232 126 249 193T273 287T287 345T296 388T299 416T300 452Q294 581 198 581Q154 581 132 575T106 562T99 546T86 533Q82 531 60 531L39 532Q32 537 32 544",
        120625: "323 624H293Q267 624 261 626T251 639Q255 678 268 684Q272 686 293 686Q348 684 475 684Q557 684 600 685T647 686H648Q671 686 671 668Q667 632 655 626Q650 624 588 624H525L500 520Q500 519 520 518T579 507T656 480Q737 440 737 372Q737 294 648 237Q562 180 426 169L412 168L399 118Q386 66 386 65L385 62H443H479Q498 62 506 59T515 44Q511 8 499 2L494 0L447 1Q417 2 298 2Q212 2 167 1T118 0Q100 0 95 15Q99 54 112 60Q116 62 179 62H241Q242 64 254 114T266 167Q266 168 262 168Q256 168 237 170T180 181T110 205T54 249T29 316Q29 391 112 446T327 516Q345 518 349 518Q351 518 353 518L355 519Q356 520 368 570T381 623Q381 624 323 624ZM342 466Q341 467 339 467Q320 467 283 455T225 420Q181 361 181 296Q181 273 193 257T222 233T254 222T277 219L280 220Q281 220 311 342T342 466ZM583 389Q583 409 576 423T557 444T533 456T509 463T492 467H486L455 343Q444 300 437 271T428 231T426 219Q430 219 445 222T483 232T521 250Q551 269 567 310T583 389",
        120626: "931 686Q953 686 953 670Q953 650 944 632Q936 624 924 624H914Q823 624 803 611Q800 609 696 503T591 396Q591 394 667 229L743 62H787H814Q846 62 846 44Q843 7 829 2Q825 0 817 0Q813 0 775 1T664 2Q590 2 551 1T508 0H507Q484 0 484 18Q484 19 488 37Q492 56 497 58T534 62L566 63Q567 64 520 169T471 274Q469 274 369 172T268 67L315 62Q320 62 328 62L335 61Q347 58 347 44Q344 10 331 2L326 0L287 1Q263 2 177 2Q95 2 78 1L53 0Q38 6 38 17Q38 40 50 57Q56 62 78 62Q169 62 188 75Q194 77 435 324L444 334L439 347Q437 351 373 492L313 624H268H246Q220 624 212 632Q210 636 210 642Q210 655 215 669T227 684Q230 686 247 686Q295 684 398 684Q438 684 472 684T527 685T551 686Q567 686 572 671Q572 667 568 651Q563 631 558 628T523 624T492 623H488L526 540Q563 457 564 457Q564 456 574 466T604 496T645 537L724 619Q716 622 677 624H673Q645 624 645 640Q645 660 654 678Q659 683 666 686L704 685Q728 684 813 684Q847 684 873 684T913 685T931 686",
        120627: "205 471Q205 445 196 403T186 333Q186 303 194 281T218 248T240 233T262 224L361 623Q361 624 303 624Q296 624 284 624T266 623Q232 623 232 641Q232 648 235 657Q240 678 244 682T268 686H273Q329 684 457 684Q502 684 540 684T599 685T626 686H628Q651 686 651 668Q649 633 631 624H505L407 227Q410 228 416 229T439 239T472 259T507 294T539 345Q549 365 563 416T597 498T649 538Q657 540 717 540Q725 540 737 540T755 541Q790 541 790 524Q790 512 784 497Q780 491 767 490T742 477Q736 471 731 463T722 449T715 433T710 419T705 403T701 389Q686 340 658 302T599 240T530 201T463 179T404 169L391 168L379 116Q365 67 365 63Q365 62 422 62H455Q477 62 486 59T495 44Q492 10 479 2L474 0L427 1Q397 2 278 2T131 1L90 0Q76 5 76 17Q76 24 79 33Q82 46 83 49T89 57T100 61T123 62H159H221Q247 162 247 168H244Q241 169 239 169Q202 176 178 182T123 207T74 252Q46 291 46 351Q46 375 52 404T59 454Q59 489 40 489Q32 489 27 494T22 507Q22 535 37 538Q40 540 99 540H128Q168 540 186 528T205 471",
        120628: "162 119Q181 115 235 115L273 116Q273 133 231 222T180 345Q173 368 173 391V406V414Q173 477 214 540Q255 600 315 635Q353 661 423 682T585 703Q656 703 711 690T799 656T851 608T879 555T886 503Q886 449 860 401Q840 359 810 322T725 230T643 146Q619 117 619 116T650 115Q707 115 722 120Q730 123 750 165T775 210Q779 212 796 212Q828 212 828 196Q828 191 807 144T764 52L743 7Q740 4 740 4T733 2T717 0T686 0H632H573Q535 0 526 3T517 17Q517 44 544 103T617 243T671 341Q729 454 729 535Q729 599 686 625T583 652Q549 652 517 645T450 616T388 561T344 470T327 340Q327 304 331 237T336 135Q336 93 330 50T313 2Q308 0 208 0H142Q107 0 100 4T93 25Q93 28 93 41T95 77T96 118L100 199Q105 208 109 210T131 212Q147 212 151 210T161 199V160Q161 131 162 125V119",
        120630: "39 166Q39 213 59 261T117 353T219 424T362 452Q420 452 466 433T536 384T573 325T586 269V265Q593 272 609 308T636 381Q640 397 644 399T669 402H680Q700 402 700 388Q700 379 691 351T659 276T604 188L593 173L595 153Q600 79 612 43H618Q634 45 642 51T653 64T658 71Q661 73 684 73Q712 73 712 59Q712 39 685 16T603 -7Q588 -7 575 -5T551 2T532 12T516 24T503 37T494 49T487 60T481 69L469 61Q362 -8 251 -8Q159 -8 99 36T39 166ZM260 43Q310 43 361 63T438 101T465 124Q458 240 453 277Q435 401 354 401Q291 401 245 355Q230 337 217 313Q201 279 186 216T170 126Q170 72 208 54Q230 43 260 43",
        120631: "59 -194H49Q31 -194 28 -182Q28 -178 107 139T192 473Q212 533 248 580T324 652T395 689T450 701H461Q514 701 551 688T605 652T630 607T637 561Q637 546 634 526T611 465T556 393Q572 382 590 347T608 262Q608 146 522 69T299 -8Q279 -8 261 -6T228 2T204 13T183 26T169 37T157 48L150 56L120 -64Q113 -90 104 -128Q93 -175 89 -184T73 -194H59ZM531 592Q531 651 463 651Q399 651 341 600T253 466Q250 458 217 327T182 185Q180 176 180 159Q180 108 212 76T301 44Q330 44 354 51T393 65T423 91T444 118T459 151T468 179T475 206Q490 264 491 296Q491 313 489 326T484 345L482 350Q481 350 477 348T464 344T444 340T413 335T372 333T334 334T301 340T274 355T265 380Q265 444 397 444Q425 444 445 441T476 436L485 433Q489 433 499 458Q509 482 520 527T531 592ZM424 390Q424 393 389 393Q383 393 374 393T362 392Q348 392 333 388Q345 384 379 384Q424 384 424 390",
        120632: "5 269Q5 285 19 312T57 368T124 421T215 451H241Q274 451 303 439T353 406T389 361T416 311T432 266T442 232L444 220L446 216L450 226Q473 278 513 357T561 441Q566 444 584 444H594Q617 444 617 430Q617 426 596 389T536 273T462 110L452 84L451 70Q447 12 427 -76T388 -192Q375 -211 355 -211Q339 -211 332 -198T325 -171Q325 -114 386 64L393 84V98Q393 181 371 241Q360 280 319 303T210 327Q158 327 126 317T84 296T68 272T59 258Q55 256 36 256Q23 256 18 256T9 260T5 269",
        120633: "216 610Q216 640 229 664T262 700T299 719T327 725Q330 725 406 709T487 690Q513 681 513 651Q513 627 494 607T450 587Q417 587 378 631Q346 663 314 663Q286 663 272 639Q271 637 271 634Q271 609 344 536L397 484Q438 448 458 410T478 313Q478 234 443 147T338 18Q298 -8 249 -8Q214 -8 180 0T113 26T60 81T39 168Q39 200 50 237T87 316T160 391T272 442L260 465Q216 553 216 610ZM348 235Q348 274 336 313T310 372L298 392Q295 391 290 390T269 380T241 359T212 323T185 267Q157 168 157 130Q157 83 186 63T255 43Q280 43 300 67Q317 89 332 138T348 235",
        120634: "224 -17Q126 -17 81 22T36 112Q36 178 84 226L93 236L88 246Q79 264 79 289Q79 341 124 388Q201 461 333 461Q402 461 455 425Q480 409 481 390Q481 365 464 350T428 334Q415 334 387 352T313 370Q141 370 141 293Q141 275 146 270Q147 270 148 270T155 272Q202 291 263 291H270Q349 291 349 244Q349 195 281 183Q274 182 239 182Q201 182 184 185T137 200Q123 188 112 168T100 129T112 98T148 81T189 75T237 74H243H251Q288 74 310 75T359 86T398 112Q405 124 417 124Q426 124 432 117T439 100Q439 88 427 70T390 32T322 -3T224 -17ZM286 238Q286 240 253 240Q245 240 234 239T216 237T209 235Q209 232 250 232Q286 232 286 238",
        120635: "361 711Q373 711 381 703T389 683Q389 681 388 676T383 656T376 618V612H379Q385 618 429 618Q521 618 521 572Q521 551 506 534Q483 510 415 507Q385 507 371 511T336 536L326 528Q254 472 204 381T154 209Q154 190 157 177Q159 165 162 154T170 135T182 119T195 106T212 95T229 86T249 78T269 72T290 66T311 60Q385 37 388 36Q437 14 454 -36Q456 -46 456 -64Q456 -83 455 -90Q445 -132 413 -167T333 -202Q300 -202 257 -191T206 -169Q203 -164 203 -158Q203 -148 210 -140T231 -130Q239 -130 263 -139T326 -151H329Q337 -151 342 -150T352 -143T357 -123Q356 -117 355 -113T350 -104T344 -96T335 -90T324 -85T310 -80T294 -74T275 -68T254 -62Q253 -62 231 -56T205 -48T179 -39T150 -26T125 -10T100 11T80 37T62 70T53 109T48 157Q48 281 123 396T317 586V612Q319 638 320 649T325 678T338 703T361 711ZM454 564Q445 567 424 567Q407 567 398 565T387 563Q387 558 411 558Q434 558 450 562L454 564",
        120636: "24 296Q25 302 27 312T41 350T65 397T103 435T157 452Q202 452 233 435Q267 419 284 384L294 392Q304 401 316 410T348 429T388 445Q410 451 445 451H453Q468 451 482 450T519 443T558 425T587 391T600 337V327Q600 311 538 64Q484 -158 478 -168Q457 -211 409 -211Q386 -211 372 -197T357 -161Q357 -158 415 80Q476 330 477 348Q477 366 473 377T461 393T448 399T432 400H427Q379 400 335 363Q300 332 280 298Q277 293 246 170T213 40Q205 22 186 7T142 -8T103 7T89 39Q89 49 106 117T142 260T164 351Q166 363 166 372Q166 402 148 402Q126 402 110 369Q100 350 90 310Q85 289 82 286T60 282H55H44Q24 282 24 296",
        120637: "213 -8Q130 -8 85 50T40 200V207Q40 303 83 428Q122 535 189 608Q279 702 381 702Q410 702 437 693T492 661T537 593T554 486Q554 428 539 362T495 230T425 111T330 25T213 -8ZM433 562Q433 600 419 625T377 651Q363 651 348 644T311 619T268 557T229 453Q225 441 217 411T208 378H401Q433 500 433 562ZM161 140Q161 43 217 43Q249 43 280 74Q310 103 332 150T378 287Q385 313 385 315Q385 316 289 316H192Q191 308 183 275T169 205T161 140",
        120638: "161 -8Q111 -8 75 16T38 85Q38 95 48 121T80 214T123 368L124 374Q126 381 127 386T132 399T139 414T149 428T162 440T180 448T203 452Q226 452 241 439T257 404Q257 386 230 290T171 111Q157 73 157 57Q157 43 166 43Q209 43 258 69T322 144Q326 157 330 159T348 162H355H366Q386 162 386 148Q386 143 383 132T367 100T335 61Q301 27 253 10T161 -8",
        120639: "258 405Q258 394 251 364T237 308T230 281T238 284T270 306T330 349Q365 377 389 394T450 427T519 444Q545 444 559 430T574 391Q574 360 551 336T491 312Q469 312 454 326T439 364Q439 372 438 372Q433 372 395 344T320 289T283 260H285Q287 260 290 260T297 259Q495 248 495 146Q495 132 491 110T486 74Q486 43 505 43Q520 43 531 53Q559 72 578 141Q582 157 586 159T611 162H622Q642 162 642 148T627 100T578 29T504 -7H495Q435 -7 399 22T363 96Q363 111 366 122T369 142Q369 155 364 165T347 182T326 193T298 200T269 204T238 207T212 210L211 206L190 123L169 40Q161 22 142 7T98 -8T59 7T45 39Q45 48 67 139T112 317L134 404Q142 424 161 438T204 452Q226 452 242 440T258 405",
        120640: "95 -13Q70 -13 55 4T40 41Q40 65 61 88Q65 92 210 207T357 322L235 602Q217 640 185 643Q182 643 178 644T173 645Q161 651 161 666Q161 677 167 684T181 692Q189 694 212 694Q335 694 358 660Q362 653 500 340T647 18Q652 10 652 6Q652 -8 622 -8H589H538L526 -5Q506 1 500 8Q494 16 444 128Q442 133 440 138L387 259L265 134Q156 20 137 4T95 -13",
        120641: "294 -8Q265 -8 244 -5T213 1T201 4Q200 4 192 -32T172 -111T155 -168Q134 -211 86 -211Q62 -211 48 -196T34 -158Q37 -144 103 123T174 404Q182 424 201 438T244 452Q271 452 284 436T298 404Q298 392 267 269T235 114Q235 43 305 43Q342 43 375 68T418 110Q420 112 455 253T492 397Q514 444 562 444Q587 444 601 429T615 397Q615 387 599 320T563 178T542 93Q540 81 540 72Q540 42 558 42Q580 42 596 75Q606 94 616 134Q621 155 624 158T646 162H651H662Q682 162 682 148Q681 142 679 132T665 94T641 47T602 9T548 -8Q523 -8 502 -3T468 11T446 27T432 40L429 46Q367 -8 294 -8",
        120642: "88 382Q70 382 65 385T59 402T64 427T78 443Q79 444 157 448T247 452Q256 452 261 448T266 440L267 437Q267 432 223 252L177 71L192 77Q293 117 371 199T480 388Q489 424 511 438T556 452Q579 452 593 438T608 402Q608 378 593 340T540 251T446 152T299 62T96 -1Q91 -2 78 -2Q38 -2 38 15Q38 22 82 198L127 379Q124 382 88 382",
        120643: "287 648Q291 671 293 680T305 700T329 711Q339 711 347 705T356 687Q356 680 351 653T345 619Q345 615 346 615Q358 618 398 618Q490 618 490 572Q490 553 476 536T434 512Q411 508 378 508H366Q332 508 306 534L298 525Q271 496 254 456T237 375Q237 336 244 336Q272 346 319 346H325Q354 346 372 344T406 331T422 300Q422 252 350 238Q332 236 303 236Q286 236 269 238T240 242T218 247T202 252L196 254Q191 254 174 237T141 191T124 139Q124 108 151 92T267 46Q285 40 295 37Q308 33 332 25T366 13T392 3T415 -8T432 -20T445 -36T451 -55T454 -80Q454 -118 427 -153T358 -199Q349 -201 327 -201Q313 -201 298 -200T271 -196T246 -191T226 -185T210 -180T200 -176L196 -174Q187 -170 187 -158T196 -138T216 -130Q217 -130 254 -140T329 -151Q349 -151 349 -135Q349 -127 340 -122T293 -104Q260 -93 238 -85Q130 -48 115 -41Q71 -19 47 15T23 88Q23 126 48 179T130 277L144 288L136 297Q99 336 99 390Q99 456 148 514T285 602V619Q285 624 286 635T287 648ZM355 563Q362 560 376 558Q424 558 423 564Q405 567 390 567Q369 567 355 563ZM279 292Q297 287 315 287Q355 287 355 293Q355 296 321 296Q316 296 308 296L301 295Q295 295 289 294L279 292",
        120644: "254 -8Q191 -8 146 9T80 54T49 111T39 169Q39 206 53 247T96 329T176 402T292 446Q317 451 336 451L344 452Q353 452 359 452Q457 452 516 408T576 279Q576 169 488 81T254 -8ZM349 400Q321 400 287 385T231 338Q206 301 188 228T170 126Q170 99 178 83Q198 44 260 44Q367 44 409 157Q419 185 432 238T445 317Q445 336 443 348Q435 372 416 384T384 398T349 400",
        120645: "55 289H43Q23 289 23 303Q23 308 33 322Q116 434 199 443Q200 444 418 444Q591 444 617 444T652 439Q674 426 674 400Q674 378 661 360T625 335Q621 334 549 333H479L477 321Q476 312 476 279Q476 219 491 174T521 104T536 65Q536 38 511 15T457 -8Q403 -8 386 94Q384 110 384 139Q384 181 391 229T406 304L413 331Q413 333 365 333H316L315 329Q315 328 312 314T301 272T288 220Q274 167 258 103Q244 49 240 38T228 18Q225 16 224 14Q200 -8 172 -8Q146 -8 132 7T118 44Q118 54 121 61Q122 65 142 102T190 195T235 293Q250 329 250 333Q177 333 166 332Q115 328 88 301L77 290L55 289",
        120646: "307 -8Q277 -8 251 0T215 14L205 20Q203 18 193 -25T171 -114T155 -168Q134 -211 87 -211Q64 -211 49 -198T34 -162Q34 -158 137 254Q153 299 179 334T232 390T277 419T311 434Q357 451 403 451Q435 451 455 449T506 435T560 400Q603 357 603 285Q603 172 520 82T307 -8ZM474 343Q474 364 458 382T409 400H406Q339 400 299 341Q281 313 264 257Q261 248 242 170T222 89Q222 84 230 74T260 54T308 43Q334 43 365 57T417 110Q437 145 456 228Q474 298 474 332V343",
        120647: "33 209Q33 277 80 334T195 421T330 451H344Q410 451 439 429Q457 417 457 402Q457 386 445 375T420 363Q415 363 406 368T383 383T354 398Q347 400 330 400Q256 400 196 361T135 265V257Q135 242 147 225T174 199L358 107Q400 77 400 28T362 -63T271 -105Q254 -105 229 -99T195 -86Q188 -82 188 -71Q188 -56 197 -50T216 -44Q225 -44 237 -48T270 -53H282Q293 -44 293 -31Q293 -19 283 -10Q278 -4 200 33T115 76Q77 98 55 133T33 209",
        120648: "35 151Q35 190 51 236T99 327T184 404T306 443Q307 443 316 443T342 443T378 444T425 444T476 444Q606 444 626 444T655 439Q677 426 677 400Q677 358 639 340Q625 333 563 333Q510 333 510 331Q518 319 518 272Q518 155 437 74T226 -8Q123 -8 79 41T35 151ZM396 278Q396 314 375 323T305 332Q249 332 222 310T180 243Q171 219 162 178T153 116V110Q153 43 234 43Q347 43 382 199Q383 203 383 204Q396 255 396 278",
        120649: "55 289H43Q23 289 23 303Q23 308 33 322Q116 434 199 443Q200 444 386 444Q571 444 577 442Q588 441 599 432T610 402Q610 359 572 340Q561 335 547 334T452 333H353V331Q352 330 342 261T320 119T306 40Q300 18 281 3Q257 -13 233 -13Q210 -13 196 0T181 35Q181 44 182 48Q183 53 229 187T279 331Q279 333 228 333H209Q163 333 136 328T88 301L77 290L55 289",
        120650: "189 388Q189 396 187 398T176 401Q144 399 122 369T89 304Q84 288 81 285T61 282H55H44Q24 282 24 296Q24 306 34 330T64 382T116 431T188 452Q232 452 270 430T308 361Q308 345 275 258T241 123Q241 44 336 44H344Q380 44 415 73T474 140T511 214T526 267Q526 280 513 292Q505 301 486 311T456 333T444 367Q444 400 471 426T529 453Q555 453 579 431T604 358Q604 327 592 271T557 172Q550 157 541 142T510 97T464 47T404 9T328 -8Q264 -8 219 5T154 41T125 85T117 131Q117 182 153 277T189 388",
        120651: "238 4Q230 5 218 8T174 26T118 58T73 112T53 190Q53 219 60 246Q77 313 103 362T143 426T163 443Q165 444 186 444Q217 444 217 432Q217 425 188 392Q157 351 137 291T116 206Q116 127 263 109L276 107L288 139Q347 304 414 378T566 452Q621 449 662 412T703 286Q698 167 598 82T357 -8H332V-11Q332 -12 327 -46T317 -116T310 -157Q306 -180 286 -198T234 -216Q211 -216 197 -203T183 -168Q183 -160 184 -155Q184 -152 198 -112T225 -34T238 4ZM637 260Q637 303 607 322T541 341Q502 341 466 319T405 264Q368 218 356 159Q348 111 348 104Q348 103 361 103Q502 103 569 152T637 260",
        120652: "58 -194Q32 -194 32 -164Q32 -153 46 -139L175 -13Q296 104 296 106Q271 232 226 308Q165 401 141 401Q128 401 117 390T100 365Q94 350 91 349T69 346H45Q35 348 35 359Q35 380 62 411T133 450Q143 452 165 452Q286 452 329 402Q347 379 366 333T394 254T404 215Q404 213 405 213Q405 212 420 227T463 268T520 324Q637 437 640 438Q647 444 661 444Q667 444 676 438T685 419Q685 405 670 389T549 271L420 145Q433 85 444 53Q466 -25 509 -88T575 -151Q590 -151 600 -140T617 -114T626 -98Q629 -96 650 -96H655Q681 -96 681 -108Q681 -114 679 -119Q670 -148 646 -169T591 -199Q581 -201 550 -201Q422 -201 381 -143Q345 -88 316 20L311 39L230 -40Q144 -126 114 -153Q85 -182 77 -188T58 -194",
        120653: "244 141Q244 117 254 98T277 70T305 55T329 48T342 47L344 48L424 366Q501 678 505 686Q508 691 512 692T533 694T555 693T562 688T565 683Q565 678 486 362T406 45Q406 43 415 43Q467 49 514 78T590 143T636 213T653 266Q653 282 641 293T613 311T585 332T572 367Q572 397 598 425T657 453Q684 453 708 430T732 358Q732 330 723 287T706 225Q671 124 578 58T401 -8H393L370 -101Q346 -196 345 -197Q340 -202 316 -202H306Q286 -202 286 -188Q286 -187 296 -144T318 -57T331 -8Q331 -6 328 -6Q290 -6 233 11T148 62Q119 97 119 146Q119 181 154 275T190 388Q190 401 181 401Q154 401 129 375T90 306Q85 288 81 285T61 282H55H44Q24 282 24 296Q24 306 34 329T64 381T116 431T189 452Q237 452 273 428T309 362Q309 343 277 260T244 141",
        120654: "532 367Q532 399 559 426T618 453Q645 453 668 430T691 357Q691 319 677 261T649 171Q640 149 626 125T586 68T521 14T438 -7Q401 -7 372 7T333 30T311 57Q246 -8 165 -8Q119 -8 82 19T30 102Q24 126 24 163V178Q24 210 37 255Q61 346 118 424Q141 451 161 451Q174 451 184 443T194 419Q194 402 179 387Q91 273 91 206Q91 159 122 138T189 117T281 145V173Q283 223 294 253Q304 276 323 289T364 303Q386 303 400 287T415 250Q415 219 385 157L378 144Q378 142 388 136T419 124T462 117Q522 117 566 165T610 255Q610 288 561 320Q532 337 532 367",
        120655: "230 475Q202 475 189 492T175 526T186 570T221 631T288 687T389 710Q430 710 438 709Q495 701 537 679T601 629T637 568T653 509T657 459Q657 409 640 341Q617 248 581 180T507 75T424 16T348 -11T282 -17Q171 -17 113 37Q60 88 60 159Q60 192 71 231Q96 336 184 402Q264 462 366 462Q407 462 439 448T497 389L502 380Q503 381 508 403T519 463T525 531Q523 580 499 610T447 648T387 657Q324 657 283 616Q271 604 276 604Q279 604 286 600T302 583T311 555Q311 523 287 499T230 475ZM196 110Q196 41 287 41Q351 41 398 88Q422 111 437 151Q473 243 473 298Q473 386 409 409Q408 409 383 411Q316 411 278 373Q265 360 259 351T241 311T217 226Q196 143 196 110",
        120656: "415 89Q423 89 429 74T436 46Q436 43 434 39Q432 36 420 29T380 11T322 -5Q311 -7 281 -7Q216 -7 168 10T94 54T56 110T44 167V181Q44 262 94 329Q104 343 119 357T162 391T234 425T327 443Q328 443 348 443T383 444Q434 444 442 438Q450 430 450 416Q446 392 424 383L376 382Q306 381 278 369Q230 349 208 294Q199 274 199 268Q199 267 291 267Q305 267 325 267T353 268Q383 268 394 263T406 241Q406 214 380 206Q375 205 279 205T183 203Q174 176 174 140Q174 87 208 65T292 43Q295 43 300 43T307 44Q337 49 372 69T415 89",
        120657: "114 132Q114 153 140 253T166 372Q166 402 148 402Q126 402 110 369Q100 350 90 310Q85 289 82 286T60 282H55H44Q24 282 24 296Q25 302 27 312T41 350T65 397T104 435T158 452Q184 452 211 445T263 414T288 354V339L265 245Q237 134 237 118V107V102Q237 87 239 77T257 56T300 43Q395 43 455 254Q479 346 479 347L460 354Q294 408 294 528Q294 606 350 653T464 701Q536 701 579 659Q634 601 634 491Q634 468 630 438T623 388L620 370Q624 370 631 369T647 364T656 352Q656 347 653 335Q647 317 642 316Q640 315 637 315Q635 315 619 317Q606 319 605 316Q605 315 603 308Q587 248 550 177T457 57Q379 -8 293 -8Q192 -8 153 23T114 116V132ZM519 566Q519 600 507 625T464 651Q425 651 391 617T356 529Q356 501 370 478T404 441T443 417T477 404L491 400Q493 400 499 428T512 497T519 566",
        120658: "228 325Q170 322 156 316T127 309Q108 309 104 314Q99 319 99 322T108 341Q125 376 171 400T268 425H271Q302 425 319 396Q328 377 328 358Q328 332 324 314Q311 270 286 221Q274 194 274 192H275Q339 234 484 325T639 421Q669 434 691 434T723 425T734 406Q734 394 719 381Q715 376 644 330L575 287L566 267Q543 233 526 176Q520 160 515 143T508 115T506 105Q506 103 533 103Q585 103 607 110T641 118Q670 118 670 107Q670 100 661 85Q643 50 598 27T504 3Q465 3 450 36Q441 51 441 73Q441 84 444 96Q452 146 484 205L497 236L324 125Q143 12 135 10Q103 -6 77 -6Q61 -6 49 2T37 21Q37 36 49 46T124 96L195 141L204 156Q219 179 243 248T264 323Q264 325 228 325",
        120659: "274 -7Q232 -4 195 7T125 38T71 94T51 176V190Q51 213 60 242T95 307T156 373T255 425T393 451L397 452L427 568Q434 597 443 636Q452 677 456 685T472 694H486H495Q517 694 517 680L514 665Q510 650 503 621T489 564L460 451H469Q527 447 574 430T657 370T693 266Q693 163 599 82T350 -7H346L322 -100Q301 -190 295 -197Q291 -202 283 -202H269H258Q238 -202 238 -188Q238 -186 260 -96L283 -7H274ZM449 400Q448 400 404 225T359 47T366 45Q464 55 516 119Q542 149 558 199T575 295Q575 387 462 398L449 400ZM384 398Q384 399 381 399Q350 399 298 378T214 308Q168 236 168 149Q168 68 259 49Q282 44 294 44H295L384 398",
        120660: "371 -168Q357 -168 323 -171T245 -175Q143 -175 109 -150T75 -66Q75 -5 100 108T137 254Q153 299 179 334T232 390T277 419T311 434Q357 451 403 451Q435 451 455 449T506 435T560 400Q603 357 603 282Q603 213 569 148T465 38T304 -8Q273 -8 247 -2T204 14T176 31T159 46T152 53Q152 52 148 27T144 -16Q144 -36 150 -44T189 -58T293 -64Q405 -65 432 -75Q466 -88 466 -127Q466 -140 459 -172Q455 -188 451 -191T426 -194H420Q405 -194 400 -191T395 -176Q396 -170 394 -169T378 -168Q373 -168 371 -168ZM236 116Q236 77 258 60T311 43Q369 43 407 94Q429 123 451 206T474 331Q474 400 409 400H406Q339 400 299 341Q276 305 256 227T236 116",
        120661: "55 289H43Q23 289 23 303Q23 308 33 322Q116 434 199 443Q200 444 562 444Q922 444 928 442Q961 434 961 400Q961 376 944 355T886 333H870Q872 322 872 295V279Q872 230 842 165T751 46T618 -8Q581 -8 554 6T513 45T494 84T484 119Q484 121 478 114Q477 113 476 111Q384 -7 268 -7H265Q251 -7 237 -4T199 11T162 54T147 132Q147 149 149 166T155 198T165 229T176 256T189 281T200 301T211 319T220 333H199Q120 333 88 301L77 290L55 289ZM639 103Q674 103 712 122T780 188T811 295Q811 318 808 330V333H289Q274 318 244 263T214 169Q214 133 236 118T288 103Q351 103 412 153T494 278Q497 290 502 292T529 295Q546 295 551 293T556 283Q556 281 553 260T550 218Q550 153 576 128T639 103",
        120662: "110 0H86Q42 0 42 27Q42 37 148 350T258 667Q269 687 291 692Q295 694 366 694H399Q432 694 448 689T474 667Q477 663 583 350T690 27Q690 0 642 0H617H592Q582 0 575 1T561 2T549 6T541 11T533 18T527 26T522 37T517 49T512 64T506 81L490 130H225Q225 128 208 79T189 27Q185 19 180 14T170 7T156 3T143 1T127 0T110 0ZM439 279Q359 524 359 547L357 555L355 543Q347 503 270 263L259 231H357Q455 231 455 232L439 279",
        120663: "119 1Q98 5 92 28V667Q98 686 118 693Q121 694 272 694H289H346Q439 694 500 681T600 625Q640 580 640 513Q640 451 601 414T504 364L518 361Q568 351 602 329T649 280T666 235T671 197Q671 172 665 147T642 91T586 37T488 5Q456 1 282 1H119ZM489 509Q489 532 479 548T450 573T421 585T394 591Q387 592 315 593H247V404H298H325Q432 404 466 444Q489 470 489 509ZM517 194Q517 235 502 261T458 299T407 313T353 317H329H322H247V101H319H357Q387 101 407 103T452 111T492 133T514 171Q516 176 517 194",
        120664: "92 664Q98 683 118 690Q121 691 312 691T508 689Q534 682 534 644V632V618Q534 582 508 573L502 572Q496 572 489 572Q486 572 463 572T416 573Q333 573 291 575H253V303Q253 31 251 25Q242 0 199 0H170L119 1Q99 7 92 28V664",
        120665: "381 692Q386 694 458 694Q516 694 527 693T549 687Q564 680 575 663Q576 658 715 349T856 27Q856 6 838 1H826Q815 1 795 1T747 1T686 1T616 0T539 0T458 0T378 0T300 0T230 0T169 1T122 1T90 1H78Q60 6 60 27Q62 38 201 349T341 663Q356 687 381 692ZM627 148Q626 149 581 250T492 453L447 554Q447 553 446 552Q444 546 326 278L268 148Q268 147 448 147Q627 147 627 148",
        120666: "277 122Q280 122 380 123T544 125Q552 125 557 125T565 124T569 124Q595 115 595 75V62V47Q595 9 569 2Q564 0 341 0L119 1Q99 7 92 28V664Q98 683 118 690Q121 691 335 691T554 689Q580 682 580 644V632V618Q580 582 554 573Q553 573 551 573T542 572T527 572Q464 572 364 573T260 575H253V412H385H459Q524 412 536 404T549 357Q549 341 549 334T542 318T523 305Q518 303 385 303H253V122H277",
        120667: "411 584Q243 581 131 581Q122 581 116 581T106 582T102 582Q84 589 80 600T76 640L77 667Q83 686 103 693Q106 694 343 694Q579 694 584 692Q592 691 599 684T609 668Q610 665 610 646Q610 614 608 608Q605 603 434 361L261 116Q340 117 402 118T490 119T533 120T560 120H572Q605 120 614 95Q616 89 616 60V46Q616 9 590 2Q585 0 339 0Q92 0 87 2Q79 3 72 10T62 26Q61 29 61 49Q61 84 63 90Q65 94 152 217T325 461T411 584",
        120668: "92 667Q101 694 143 694H172H198Q244 694 251 669Q253 663 253 539V415H540V539Q540 558 540 585T539 621Q539 673 550 683T611 694H621H646Q671 694 683 690T700 669Q702 663 702 347T700 25Q696 9 684 5T646 0H621H606Q560 0 550 11T539 76Q539 85 539 116T540 169V306H253V169Q253 147 253 116T254 75Q254 23 245 12T194 0H170L119 1Q99 7 92 28V667",
        120669: "62 340Q62 716 425 716Q511 716 576 696T681 642T747 559T783 458T793 341Q793 264 777 203T721 89T608 7T428 -22Q62 -22 62 340ZM638 333Q638 365 637 387T632 441T621 495T600 542T567 583T518 611T451 628Q443 629 427 629Q402 629 378 624T327 608T276 571T240 511Q217 453 217 345Q217 254 231 204T279 120Q333 69 428 69Q522 69 576 120Q638 183 638 333ZM279 349V373Q279 413 305 420Q309 422 427 422H487Q550 422 563 414T576 369V349Q576 345 576 337T577 324Q577 284 550 277Q545 275 428 275H369Q306 275 293 283T279 329V349",
        120670: "85 667Q94 694 136 694H165H191Q237 694 244 669Q246 663 246 347T244 25Q235 0 192 0H163L112 1Q92 7 85 28V667",
        120671: "92 667Q101 694 139 694H163H186Q225 694 234 671Q236 663 236 529L237 392L533 682Q550 694 590 694H623H681Q695 680 695 672Q695 670 693 664Q688 657 561 533L431 405L698 33Q701 28 701 23Q701 7 683 0H626H604Q571 0 564 2T545 13Q544 14 530 33T489 90T437 162L332 307Q331 307 284 260L236 214V122V65Q236 32 231 19T210 2Q205 0 161 0L119 1Q99 7 92 28V667",
        120672: "106 0H83Q41 0 41 28Q41 39 133 349T229 667Q242 694 296 694H335H375Q403 694 418 689T442 667Q445 660 537 350T630 28Q630 11 619 6T584 0H555H526Q478 0 465 27Q462 32 431 136T366 372T325 555V546Q320 503 287 376T222 141T186 27Q184 22 177 15T165 6Q154 0 106 0",
        120673: "92 667Q98 684 109 689T146 695Q152 695 167 695T192 694Q200 694 214 694T234 695Q291 695 305 664Q313 651 400 419T487 165Q487 162 488 162T489 165Q489 187 574 413T671 664Q679 680 695 688Q708 694 785 694H828Q855 694 867 689T884 669Q886 663 886 347T884 25Q876 0 832 0H817H802Q758 0 750 25Q748 31 748 293V555L746 544Q737 509 692 386T606 160T564 52Q548 22 502 22H487H472Q423 22 410 52Q407 59 367 160T283 385T231 546L230 548Q229 548 229 293Q229 31 227 25Q222 9 211 5T176 0H158L119 1Q99 7 92 28V667",
        120674: "92 667Q98 684 109 689T146 694H185Q273 694 279 692Q301 689 315 669Q322 660 419 453L554 163L562 143Q564 143 564 401Q564 663 566 669Q574 694 618 694H633H648Q692 694 700 669Q702 663 702 347T700 25Q696 10 683 5T642 0H596H551Q520 0 505 4T478 25Q471 34 374 241L239 532Q231 550 231 552L229 479Q229 440 229 293Q229 31 227 25Q222 9 211 5T176 0H158L119 1Q99 7 92 28V667",
        120675: "627 553Q609 553 512 554T366 555Q316 555 220 554T105 553Q96 553 90 553T82 554T78 554Q61 560 57 571T52 605V623L53 661Q59 680 79 687Q82 688 366 688Q649 688 654 686Q680 679 680 639V621V603Q680 563 654 554Q653 554 651 554T642 554T627 553ZM149 423Q152 424 366 424Q579 424 584 422Q610 415 610 376V358V340Q610 300 584 293Q579 291 366 291H232Q162 291 150 293T129 306Q122 315 122 360L123 397Q129 416 149 423ZM108 135Q143 135 226 134T363 133Q407 133 507 134T632 135H645Q675 135 684 110Q686 104 686 68V49Q686 9 660 2Q655 0 364 0L74 1Q57 7 49 21L47 28L46 65V83Q46 126 72 133Q80 135 108 135",
        120676: "362 715Q364 715 376 715T394 716H400Q542 716 626 643T727 426Q731 395 731 342Q731 271 722 225Q674 -22 396 -22Q320 -22 259 -3T148 68T77 201Q62 257 62 342Q62 447 86 522T173 649Q245 707 362 715ZM568 433Q551 623 396 623Q383 623 370 622T333 612T292 591T257 550T233 485Q223 442 223 350Q223 276 232 227T267 137Q309 74 397 74Q433 74 461 85T507 113T537 156T556 205T566 260T569 310T570 357Q570 409 568 433",
        120677: "92 664Q98 683 118 690Q121 691 396 691T676 689Q695 684 700 666Q702 660 702 345Q702 31 700 25Q696 9 684 5T646 0H621H596Q571 0 559 4T542 25Q540 31 540 307V582H253V307Q253 31 251 25Q242 0 199 0H170L119 1Q99 7 92 28V664",
        120678: "641 470Q641 426 630 391T603 334T561 295T513 271T459 259T408 254T361 253H350H337H253V142Q253 125 253 100T254 67Q254 32 249 19T227 2Q222 0 170 0L119 1Q99 7 92 28V667Q98 686 118 693Q121 694 271 694Q428 693 462 688Q641 656 641 470ZM487 467Q487 495 485 510T474 546T442 578T382 592Q375 593 310 593H250V347H309H339Q364 347 380 348T418 354T451 368T474 395T486 438Q487 444 487 467",
        120680: "322 124Q326 124 457 125T672 127H689Q721 127 730 102Q732 96 732 64V48Q732 9 706 2Q701 0 394 0L89 1Q76 5 69 13T62 29V36Q62 37 62 38Q62 47 70 58T126 126Q161 167 185 196Q302 335 302 336L187 463Q74 584 68 594Q61 603 61 639L62 667Q68 686 88 693Q91 694 396 694T706 692Q732 686 732 647V635V621Q732 585 706 576Q705 576 702 576T691 576T670 575L302 578Q302 577 394 475T490 371Q498 362 498 347Q498 336 488 323T408 226L322 124",
        120681: "67 687Q70 688 366 688Q661 688 666 686Q692 680 692 641V629V615Q692 579 666 570H660Q655 569 648 569Q645 569 624 569T581 570Q505 570 475 572H447V302Q447 31 445 25Q436 0 393 0H364L313 1Q293 7 286 28L285 300V572H257Q227 570 151 570Q130 570 109 570T84 569Q77 569 72 570H66Q48 577 44 588T40 631L41 661Q47 680 67 687",
        120682: "62 560Q62 607 94 644T169 698T253 715Q273 715 286 713T322 704T363 677T398 625Q413 597 423 556L428 540Q429 541 436 566T454 620T494 677T561 713Q570 715 593 715Q682 715 737 668T793 560Q793 549 793 545T786 533T767 520H670Q646 532 644 551T632 579Q618 594 591 594Q539 594 524 530T509 321V216Q509 31 507 25Q498 0 455 0H426L375 1Q355 7 348 28L347 232Q346 344 346 441Q346 442 343 468T335 521T312 571T266 594Q252 594 247 593Q228 586 220 576T212 557T209 539T191 523L185 520H88Q75 527 69 534T63 545T62 560",
        120683: "62 292T62 347T80 445T124 511T183 552T243 574T292 584L315 587H319V627L320 667Q329 694 370 694H397H422Q466 694 473 669Q475 663 475 625V587H478Q479 587 500 584T548 575T608 553T668 513T713 446T732 347Q732 253 674 187Q655 167 628 152T576 128T530 116T493 109L478 107H475V69V50Q475 9 449 2Q444 0 395 0L347 1Q327 7 320 28L319 67V107H315L292 110Q269 114 243 119T184 142T124 182T80 249ZM319 197T319 347T318 497Q316 497 307 494T284 485T262 471Q220 438 220 347Q220 285 239 249Q248 234 261 223T286 208T308 200L317 197Q319 197 319 347ZM572 347V357Q572 387 569 407T548 452T496 491Q495 491 494 491T487 493T475 497V197Q518 210 541 232T571 303Q572 312 572 347",
        120684: "52 1Q37 11 37 23Q37 26 39 32Q39 34 158 202L275 369Q275 370 221 441T112 586T55 663Q53 669 53 672Q53 687 68 693H72Q77 693 84 693T99 694T118 694T139 694H176Q203 694 212 692T230 682Q231 681 239 669T265 634T296 591L358 504L418 591Q481 682 486 686Q491 691 499 692Q505 694 569 694H632Q650 685 650 672Q650 667 646 660Q643 654 592 582T491 440T441 369T566 201T693 29Q694 27 694 23Q694 11 677 0H607L537 1Q523 6 519 10T437 131Q422 153 411 170T390 200T375 222T365 237T359 245L357 247L348 232Q339 218 319 188T283 131Q222 37 211 22T186 1H52",
        120685: "61 585Q62 594 62 597T64 606T73 616T89 626H138Q196 626 208 620Q243 602 253 546T261 431T271 309T325 219Q342 205 349 205Q350 205 350 436L351 667Q360 694 401 694H428H454Q495 694 504 671Q506 663 506 436L507 205Q542 222 561 251T586 318T593 392T595 472T602 546Q614 614 661 625Q665 626 708 626H730Q766 626 780 618T794 582Q794 548 768 540Q755 538 754 501T750 410T736 298T680 191T560 120Q550 116 512 109H506V70V50Q506 9 480 2Q475 0 426 0L378 1Q358 7 351 28L350 68V109L335 111Q298 117 267 129T214 156T175 191T146 229T127 272T115 314T109 357T106 395T105 429Q104 537 87 540Q66 548 63 565Q61 570 61 585",
        120686: "241 122Q225 154 191 199T131 278T83 363T61 464Q61 497 68 527T94 591T145 650T228 693T349 715Q354 715 370 715T396 716Q539 716 622 668Q658 647 682 617T715 556T728 505T732 465Q732 415 711 365T663 280T602 200T552 122H632Q649 122 669 122T693 123H697Q736 123 742 98Q744 92 744 62V47Q744 9 718 2Q713 0 591 0L471 1Q454 7 446 21Q444 27 444 45Q444 96 463 154T506 257T549 360T569 469Q569 504 563 530T538 580T485 616T396 629Q313 629 268 594T223 468Q223 419 243 361T286 258T330 152T350 41Q350 14 335 7T276 -1Q267 -1 241 -1T197 0L77 1Q57 7 50 28L49 59V74Q49 114 75 121Q81 123 100 123Q104 123 124 123T161 122H241",
        120782: "266 654H280H282Q500 654 524 418Q529 370 529 320Q529 125 456 52Q397 -10 287 -10Q110 -10 63 154Q45 212 45 316Q45 504 113 585Q140 618 185 636T266 654ZM374 548Q347 604 286 604Q247 604 218 575Q197 552 193 511T188 311Q188 159 196 116Q202 87 225 64T287 41Q339 41 367 87Q379 107 382 152T386 329Q386 518 374 548",
        120783: "481 0L294 3Q136 3 109 0H96V62H227V304Q227 546 225 546Q169 529 97 529H80V591H97Q231 591 308 647L319 655H333Q355 655 359 644Q361 640 361 351V62H494V0H481",
        120784: "175 580Q175 578 185 572T205 551T215 510Q215 467 191 449T137 430Q107 430 83 448T58 511Q58 558 91 592T168 640T259 654Q328 654 383 637Q451 610 484 563T517 459Q517 401 482 360T368 262Q340 243 265 184L210 140H274Q416 140 429 145Q439 148 447 186T455 237H517V233Q516 230 501 119Q489 9 486 4V0H57V25Q57 51 58 54Q60 57 109 106T215 214T288 291Q364 377 364 458Q364 515 328 553T231 592Q214 592 201 589T181 584T175 580",
        120785: "80 503Q80 565 133 610T274 655Q366 655 421 623T491 538Q493 528 493 510Q493 446 453 407T361 348L376 344Q452 324 489 281T526 184Q526 152 514 121T474 58T392 8T265 -11Q175 -11 111 34T48 152Q50 187 72 209T132 232Q171 232 193 208T216 147Q216 136 214 126T207 108T197 94T187 84T178 77T170 72L168 71Q168 70 179 65T215 54T266 48H270Q331 48 350 105Q358 128 358 185Q358 239 348 268T309 313Q292 321 242 322Q205 322 198 324T191 341V348Q191 366 196 369T232 375Q239 375 247 376T260 377T268 378Q284 383 297 393T326 436T341 517Q341 536 339 547T331 573T308 593T266 600Q248 600 241 599Q214 593 183 576Q234 556 234 503Q234 462 210 444T157 426Q126 426 103 446T80 503",
        120786: "531 0Q510 3 381 3Q238 3 214 0H201V62H313V155H32V217L205 434Q342 606 362 630T387 655L391 656Q395 656 401 656T414 656H427Q447 656 451 645Q453 641 453 429V217H542V155H453V62H542V0H531ZM324 217V494L103 218L213 217H324",
        120787: "100 565V605Q100 637 102 646T113 655Q116 655 139 647T202 631T286 623Q332 623 372 631T434 647T459 655Q466 655 469 651T472 643T472 629Q472 613 463 601Q370 487 219 487Q195 487 183 488T169 490T168 433V376Q169 376 174 379T188 387T211 397T244 405T288 409Q390 409 453 352T517 201Q517 106 445 48T253 -11Q169 -11 113 37T57 154Q57 187 79 208T131 229T183 209T206 154Q206 99 155 83Q152 82 157 78Q196 47 253 47Q347 47 358 135Q358 137 358 138Q360 158 360 209Q360 277 355 301T337 338Q315 358 282 358Q202 358 160 303Q153 294 149 292T130 290Q107 290 102 301Q100 304 100 474V565",
        120788: "48 318Q48 395 68 456T120 553T193 613T273 646T350 655Q425 655 461 616T497 524Q497 485 475 468T428 451Q399 451 378 470T357 521Q357 565 403 588Q375 601 351 601Q313 601 282 584Q242 565 222 526Q199 473 199 367Q201 369 210 380T227 396T246 410T275 422T312 426Q438 426 494 332Q526 285 526 208V199Q526 112 465 53Q428 17 388 3T285 -11Q236 -11 195 7T135 43T104 80Q48 165 48 318ZM375 231V244V268Q375 295 373 310T364 342T341 366T299 374H297Q231 374 208 287Q200 257 200 196Q201 120 209 100Q231 47 288 47Q351 47 368 90Q375 112 375 231",
        120789: "256 -11Q231 -11 208 5T185 65Q185 105 193 146T212 220T241 289T275 349T312 402T346 445T377 479T397 502L400 504H301Q156 503 150 497Q142 491 134 456T126 407H64V411Q65 414 82 544T99 675T130 676H161V673Q161 669 162 666T167 661T173 657T181 654T190 652T200 651T210 650T220 649T229 648Q237 648 254 647T276 646Q277 646 426 644H558V620V607Q558 596 551 586T509 537Q489 515 476 500Q390 401 384 393Q349 339 337 259T324 113T322 38Q307 -11 256 -11",
        120790: "80 474Q80 561 139 607T278 654Q357 654 411 632Q490 593 494 509Q494 424 416 376L407 371L418 364Q432 356 447 345T481 312T513 260T526 192Q526 100 461 45T285 -11Q184 -11 116 32T48 164Q48 181 50 196T58 225T69 249T84 270T100 286T117 300T134 311T149 321T162 329L152 336Q120 360 100 397T80 474ZM347 404Q404 446 404 503Q404 579 317 599Q309 600 276 600Q178 600 170 538Q170 532 171 527T173 518T178 509T184 501T194 492T205 484T219 476T235 467T254 456T275 445L347 404ZM289 47Q323 47 351 54T402 82T425 137Q425 147 421 161Q411 183 391 197T303 249Q224 293 223 293Q220 291 215 288T197 273T175 248T157 213T149 167Q149 109 188 78T289 47",
        120791: "178 59Q206 48 238 48Q311 48 345 102Q370 138 375 259V278Q374 278 369 271T350 252T322 232Q297 220 258 220Q172 220 110 275T48 438V446Q54 561 146 618Q199 654 278 654Q321 654 329 653Q526 621 526 330Q526 252 507 190T457 92T388 31T312 -2T240 -11Q165 -11 121 25T77 120Q77 159 99 176T147 193T194 177T217 122Q217 113 216 106T211 92T205 82T198 73T191 67T184 62T178 59ZM374 446V465Q374 523 364 552T315 598Q309 600 293 601Q227 601 210 562Q199 539 199 433Q199 343 204 319T235 279Q250 272 274 271H282Q293 271 303 274T327 288T353 323T371 385Q374 403 374 446",
        120802: "117 621Q174 678 247 678Q305 678 351 647Q396 617 424 557Q460 472 460 328Q460 271 455 224Q448 154 427 104T376 27T314 -10T249 -22Q201 -22 160 1T91 67Q39 154 39 316Q39 541 117 621ZM250 55Q274 55 293 66T324 93T344 136T357 185T364 240T366 291T367 340Q367 373 367 393T363 449T352 507T332 553T299 589T250 601Q217 601 194 584T159 542T141 479T133 411T132 340V331Q132 299 133 277T137 219T147 157T167 107T201 68T250 55",
        120803: "94 612Q172 616 211 632T284 678H307V73H430V0H88V73H213V317Q213 560 212 560Q210 558 197 554T155 546T96 540L83 539V612H94",
        120804: "222 599Q190 599 166 585T128 550T108 509T97 474T93 459L67 492L42 526L47 539Q72 608 120 642T225 677Q304 677 355 644Q449 579 449 454Q449 373 361 290Q351 280 315 250T199 144Q156 103 137 85L293 86H449V0H50V79L216 242Q284 302 317 349T351 456Q351 517 315 558T222 599",
        120805: "333 521Q333 554 313 579T243 604Q154 604 99 514L78 546Q56 577 56 579Q56 580 62 589T82 611T114 637T162 662T222 677Q224 677 231 677T242 678H245Q318 678 374 634T430 520Q430 483 417 452T382 398T351 369T329 354L328 353Q369 333 373 330Q408 306 432 268T457 184Q457 103 397 41T242 -22Q131 -22 51 58L42 68L49 105L55 142L58 138Q62 134 66 130T77 120T91 108T108 96T129 83T152 72T179 63T209 57T242 54Q285 54 319 86T353 184Q353 231 331 267T260 315L213 316H166V354Q166 392 167 392Q233 395 257 405Q290 418 311 450T333 521",
        120806: "271 654L272 656H380V235H471V159H380V0H286V159H28V235L149 443Q269 652 271 654ZM292 235V607Q292 604 290 591T286 571T280 548T269 517T252 476T226 422T189 354T140 267Q136 260 132 253T126 240L123 236Q123 235 207 235H292",
        120807: "257 350Q236 350 218 342T189 323T171 301T160 281L157 273Q157 272 116 272H75V656H416V577H162V486Q162 396 163 396T174 403T207 418T258 426Q339 426 394 360T449 203Q449 113 386 46T226 -21H223Q188 -21 156 -11T102 13T64 42T41 66T33 77Q34 78 44 95T64 128L73 144Q93 112 117 93Q165 54 223 54Q270 54 306 86T345 197Q345 350 257 350",
        120808: "42 318Q42 396 61 460T109 564T173 629T237 666T289 677H301H317Q359 677 408 658V621Q408 585 407 585H406Q359 605 308 605Q246 605 203 556T146 421Q143 403 144 403Q145 402 152 409Q216 469 299 469Q333 469 357 457T407 405Q457 330 457 226Q457 126 402 57Q340 -22 251 -22Q216 -22 183 -7T116 43T63 149T42 318ZM260 393Q216 393 188 365T150 306T141 243Q141 153 172 104Q192 68 230 56Q238 54 251 54Q311 54 342 116Q360 152 360 226Q360 297 344 332Q320 382 277 392Q275 392 270 392T260 393",
        120809: "42 570V656H457V577L447 564Q345 439 295 289T244 0V-11H145V12Q160 330 356 550Q360 556 365 561T374 571L208 570H42",
        120810: "55 500Q55 568 109 623T250 678Q327 678 385 627T444 501Q444 445 410 410T336 357L329 353H330Q378 335 417 293T456 184Q456 93 393 36T249 -22T106 35T43 184Q43 251 82 293T169 353Q171 354 166 356Q165 356 163 357Q113 378 84 416T55 500ZM358 496Q358 557 325 581T250 605Q206 605 174 580T141 496Q141 446 171 420T250 393Q298 393 328 419T358 496ZM245 316Q205 316 172 285T139 185V179Q139 79 222 57Q231 55 250 55H254Q295 55 327 84Q360 120 360 188Q360 254 326 285Q295 316 245 316",
        120811: "44 476Q57 561 116 619T245 677H255Q308 677 349 647Q392 619 424 545T457 334Q457 178 382 78T205 -22Q168 -22 135 -10T86 14L72 25Q73 25 91 58L110 91Q127 78 136 72T163 60T203 54Q238 54 265 71T308 110T335 164T350 214T357 253V257L347 248Q284 187 200 187Q165 187 140 201T87 258Q42 332 42 430Q42 458 44 476ZM269 604Q265 605 254 605Q222 605 199 591T164 554T148 517T141 487Q140 478 140 430T141 373Q146 335 164 307T207 269Q223 263 247 263Q299 266 328 308T358 417Q358 435 356 456T346 511T318 570T269 604",
        120812: "274 -22Q227 -22 190 -9T128 24T87 76T62 135T49 204T44 271T43 336V343V362Q43 407 45 440T56 524T86 613T141 677Q197 715 264 715Q314 715 353 702T418 669T460 616T487 555T500 483T505 413T506 343Q506 310 506 293T503 241T498 185T486 133T467 83T437 42T397 8T343 -13T274 -22ZM355 355V401Q355 448 354 476T349 537T336 587T311 617T272 629Q270 629 266 629T261 628Q219 618 207 568T194 419V355Q194 203 200 156T231 85Q250 66 275 66Q299 66 318 85Q342 109 348 156T355 355",
        120813: "118 560H116Q107 560 100 561T85 572T76 600Q76 612 77 618T83 632T99 644Q102 645 135 646T207 660T275 700Q292 716 310 716Q353 716 360 691Q362 685 362 386V87H446Q464 76 468 69T473 44Q473 12 446 1H118Q105 7 100 13T94 25T93 44V62Q100 79 119 87H210V329Q210 571 208 571Q182 560 118 560",
        120814: "339 477Q339 505 332 531T301 579T242 601Q165 601 136 503Q133 493 130 490T121 486Q116 486 94 514Q86 523 82 528Q46 572 46 577Q46 591 77 632T147 691Q192 716 257 716Q305 716 351 700Q416 674 455 615T494 481Q494 421 463 376T356 266Q326 240 287 205T224 146T199 122H331Q359 122 392 122T431 123H445Q485 123 492 98Q494 92 494 62V47Q494 9 468 2Q463 0 272 0L83 1Q63 7 56 28L55 57V89Q59 97 215 261Q255 303 275 327T317 394T339 477",
        120815: "61 624Q62 630 83 650T153 693T262 716Q328 716 373 698T438 650T465 593T473 536Q473 438 375 376L387 371Q450 350 476 305T503 208Q503 164 492 126T456 53T380 -2T261 -22Q224 -22 189 -15T130 2T86 24T57 43T46 53Q46 56 53 99T62 145Q65 152 71 152Q76 152 90 143T123 121T175 99T248 87Q302 87 321 113T341 202Q341 264 329 292T279 329L232 331L190 332L184 338V411Q190 417 192 417Q193 418 205 419T232 421T252 424Q280 430 299 461T318 539V551Q318 599 283 609Q276 611 257 611Q225 611 199 601T159 577T136 554T120 543T102 560T76 597T62 618T61 624",
        120816: "278 693H282Q285 693 291 693T305 694T322 694T342 694H377Q402 694 411 691T430 677Q434 670 434 646T435 456V249H461H472Q509 249 516 224Q518 219 518 194Q518 178 518 171T511 155T492 142Q488 140 461 140H435V86V53Q435 9 409 2Q405 0 366 0H351Q306 0 298 25Q296 31 296 86V140H179H123Q99 140 80 129T50 106T37 95Q31 95 31 163V208Q31 246 33 251Q251 673 262 684Q268 691 278 693ZM302 249V416L301 576Q301 536 165 276L151 250L226 249H302",
        120817: "109 282Q87 290 83 310V666Q83 667 84 670T87 676T91 682T98 688T108 693Q112 694 269 694T431 692Q457 686 457 648V637V624Q457 588 431 581Q426 579 326 579H227V510Q227 442 229 442Q243 450 288 450Q377 450 435 399T494 222Q494 -22 241 -22Q202 -22 167 -11T109 16T69 49T45 79T37 94T69 151Q91 185 97 185Q105 185 112 170Q127 135 160 111T240 87Q266 87 284 94T311 111T325 142T331 179T332 226Q332 307 324 335T281 363Q228 363 197 306Q189 289 172 282H109",
        120818: "414 589Q410 589 389 600T334 612Q275 612 243 575Q209 538 202 433V422L209 431Q243 487 317 487Q392 487 440 442Q478 402 490 357T503 236Q503 113 454 54Q421 13 381 -4T279 -22Q263 -22 250 -21T214 -15T173 1T133 30T96 77T68 146T50 242Q46 278 46 336Q46 406 52 447Q84 698 312 715L315 716Q318 716 321 716Q323 716 328 716T337 715Q398 715 425 688V596Q419 591 414 589ZM282 87Q324 89 336 117T348 231Q348 310 343 343T324 388T277 399Q249 399 231 373T208 317T202 253Q202 201 207 168T224 117T249 93T282 87",
        120819: "135 38Q135 190 198 335T353 572H215Q185 572 151 572T110 571H96Q55 571 48 596Q46 602 46 633V648Q46 686 72 693Q76 695 124 695Q134 695 183 695T274 694Q472 694 477 692Q503 686 503 648V637Q503 612 502 605T491 588Q300 349 292 46V36Q292 -4 266 -9Q262 -11 214 -11H192Q160 -11 148 -3T135 38",
        120820: "61 518Q61 574 79 614T128 676T192 706T263 715H270Q298 715 318 714T373 701T430 671T470 612T488 517Q488 459 458 423T390 376Q388 375 393 373Q395 372 398 371Q503 330 503 204Q503 -22 275 -22Q209 -22 163 -3T92 49T57 120T46 204Q46 230 50 252T61 289T77 318T96 339T116 353T134 363T148 369T158 373T160 376Q118 389 90 424T61 518ZM344 538Q344 563 340 578T326 600T307 609T279 612Q232 612 218 594T204 518Q204 459 216 439T275 418Q328 418 338 450Q344 464 344 515V538ZM248 88T274 88T315 94T338 117T346 149T349 197Q349 269 342 290Q338 309 320 320T274 331Q246 331 229 320T207 290Q200 269 200 197Q201 163 202 149T210 118T232 94",
        120821: "347 272Q346 272 342 266T330 250T309 230T276 214T230 207Q185 207 150 223Q116 240 90 276T54 357Q46 393 46 468Q46 469 46 484T47 502T48 520T51 540T55 559T61 579T69 599T81 620T96 640T115 661Q174 716 276 716Q299 716 317 714T369 698T426 658T471 580T499 456Q503 402 503 342Q503 115 392 29Q322 -22 231 -22Q163 -22 115 7L82 31Q76 38 81 46Q116 112 127 123Q130 126 134 126T148 116T179 97T226 87Q287 87 318 132Q323 139 326 146T332 165T337 182T340 204T342 225T345 249T347 272ZM201 547T201 454T211 329T262 294Q276 294 285 296T310 312T335 355Q347 391 347 447Q347 520 340 550T317 595Q300 612 277 612Q226 612 214 580",
        120822: "42 305Q42 450 111 535T257 621Q335 621 390 562Q482 468 482 306Q482 174 418 82T262 -10T106 82T42 305ZM257 545Q209 545 168 481T126 320Q126 220 162 147Q204 65 262 65Q318 65 358 139T398 320V328Q395 411 364 470T284 543Q270 545 257 545",
        120823: "99 461Q99 470 99 474T104 487T120 498T151 502Q213 517 251 596Q264 622 283 622Q308 622 319 597V76H373H401Q428 76 439 69T450 38Q450 11 428 1H127Q104 10 104 38Q104 62 115 69T153 76H181H235V269Q235 461 234 461Q184 426 137 424H133Q124 424 119 425T109 431T99 447V461",
        120824: "52 462Q52 528 110 575T247 622H250Q343 622 407 565T472 421Q472 371 446 324T390 248T308 178Q307 177 275 151T214 101L185 77Q185 76 286 76H388V87Q388 105 397 114T430 123T463 114Q470 107 471 100T472 61V42Q472 24 468 16T450 1H75Q53 10 53 32V38V48Q53 57 63 67T127 122Q153 144 169 157L289 256Q388 345 388 419Q388 473 346 509T231 545H224Q176 545 146 499L144 494Q155 476 155 459Q154 459 155 455T154 444T148 430T136 417T114 408Q113 408 110 408T104 407Q80 407 66 422T52 462",
        120825: "260 546Q233 546 211 541T180 531T171 524L174 514Q177 505 177 497Q177 476 162 461T125 446Q106 446 90 459T73 504Q76 540 98 565T150 601T203 616T239 621Q241 622 265 622Q322 620 362 602T420 558T444 513T451 478Q451 386 369 329L375 326Q381 323 386 320T401 311T419 298T436 283T452 263T466 240T475 212T479 180Q479 99 416 44T259 -11T105 28T44 130Q44 154 59 168T95 183Q117 183 132 169T148 131Q148 119 139 101Q175 65 260 65Q316 65 355 97T395 179Q395 211 375 240Q336 292 253 292H234H215Q194 292 185 299T175 330Q175 350 184 359Q192 368 238 370T309 384Q336 398 351 423T367 474Q367 496 350 513Q321 546 260 546",
        120826: "235 1Q213 10 213 32V38V46Q213 65 230 73Q236 76 274 76H314V168H183L52 169Q37 175 33 182T29 205V218L30 244Q53 283 155 443T264 613Q276 623 298 623H323H363Q378 616 385 601V244H429H450Q474 244 484 237T495 206Q495 179 477 171Q471 168 429 168H385V76H425H442Q466 76 476 69T487 38Q487 10 465 1H235ZM314 244V554L117 245L215 244H314",
        120827: "387 189Q387 244 354 278T273 313Q230 313 205 301T163 271T138 249H120Q102 249 97 251Q85 258 83 266T80 311Q80 320 80 359T81 430Q81 587 82 591Q88 605 103 610H108Q112 610 120 610T138 610T163 610T192 611T225 611T260 611H415Q416 610 421 607T428 602T432 596T436 587T437 573Q437 567 437 562T434 554T431 548T427 543T423 540T418 538L415 536L289 535H164V363L170 366Q175 368 184 372T207 380T238 386T276 389Q357 389 414 331T472 187Q472 116 412 53T245 -10Q218 -10 209 -9Q126 5 89 48T52 137Q52 164 68 177T104 191Q130 191 143 175T156 141Q156 132 154 125T149 113T146 107Q146 104 155 95T188 76T245 65Q298 65 342 98T387 189",
        120828: "357 536Q357 546 318 546Q258 546 205 497T133 357V353L144 361Q210 402 285 402Q362 402 414 350Q479 285 479 193Q479 111 418 50T263 -11Q234 -11 207 -3T149 26T97 81T60 171T45 301Q45 444 129 533T319 622Q388 622 421 589T454 510Q454 491 442 475T402 458Q373 458 362 475T350 510Q350 520 354 528L357 536ZM319 326T269 326T179 298T136 223Q136 202 143 174T176 112T237 68Q246 66 265 66Q319 66 360 107Q395 146 395 197Q395 250 356 289Q319 326 269 326",
        120829: "204 -10Q162 -10 162 40Q162 146 198 261T310 477Q311 478 321 491T342 517T358 535H128V524Q128 506 119 497Q111 489 86 489H78Q55 489 46 508Q44 513 44 557V580Q44 605 52 616T88 627H93Q114 627 125 611H458Q474 598 477 593T480 573Q480 559 478 553T469 543T446 521T408 477Q252 290 246 49Q246 43 246 37T246 27T245 22Q243 11 233 1T204 -10",
        120830: "58 460Q58 523 117 572T254 621Q290 621 298 620Q376 607 421 560T466 460Q466 441 460 424T443 393T421 370T397 352T374 340T357 332L350 330L356 328Q363 325 371 321T392 310T415 295T439 274T459 249T473 217T479 179Q479 102 418 46T262 -10T106 46T45 179Q45 202 52 222T70 257T96 284T123 305T148 319T167 328L174 330L170 332Q166 333 159 336T145 343Q104 362 81 393T58 460ZM382 458Q382 491 349 518T263 546Q215 546 179 521T142 458Q142 421 178 395T262 368Q315 368 348 396T382 458ZM396 178Q396 223 358 257T263 292Q206 292 167 258T128 178Q128 137 163 102T262 66Q324 66 360 101T396 178",
        120831: "392 259Q333 210 236 210H233Q163 210 109 262Q46 325 46 411T99 550Q164 622 264 622Q293 622 319 615T376 587T428 532T464 440T479 304Q479 167 400 78T217 -11Q140 -11 105 22T70 101Q70 124 84 138T122 153Q150 153 162 137T174 101Q174 91 168 76Q179 65 216 65Q267 65 300 93Q322 109 339 130T366 173T380 210T388 242T392 259ZM388 389Q388 438 357 492T268 546T185 520Q129 479 129 415Q129 384 138 363Q145 349 156 334T195 302T255 285Q305 285 345 313T388 389"
      }, {
        8243: "′′",
        8244: "′′′",
        8246: "‵‵",
        8247: "‵‵‵",
        8279: "′′′′",
        8708: "∄",
        8716: "∌",
        8772: "≄",
        8777: "≉",
        8802: "≢",
        8813: "≭",
        8820: "≴",
        8821: "≵",
        8824: "≸",
        8825: "≹",
        8836: "⊄",
        8837: "⊅",
        8930: "⋢",
        8931: "⋣",
        10764: "∬∬"
      });
      return normal$1;
    }
    var sansSerifBoldItalic$1 = {};
    var sansSerifBoldItalic = {};
    var hasRequiredSansSerifBoldItalic$1;
    function requireSansSerifBoldItalic$1() {
      if (hasRequiredSansSerifBoldItalic$1) return sansSerifBoldItalic;
      hasRequiredSansSerifBoldItalic$1 = 1;
      Object.defineProperty(sansSerifBoldItalic, "__esModule", { value: true });
      sansSerifBoldItalic.sansSerifBoldItalic = void 0;
      sansSerifBoldItalic.sansSerifBoldItalic = {
        305: [0.458, 0, 0.256],
        567: [0.458, 0.205, 0.286]
      };
      return sansSerifBoldItalic;
    }
    var hasRequiredSansSerifBoldItalic;
    function requireSansSerifBoldItalic() {
      if (hasRequiredSansSerifBoldItalic) return sansSerifBoldItalic$1;
      hasRequiredSansSerifBoldItalic = 1;
      Object.defineProperty(sansSerifBoldItalic$1, "__esModule", { value: true });
      sansSerifBoldItalic$1.sansSerifBoldItalic = void 0;
      var FontData_js_1 = requireFontData();
      var sans_serif_bold_italic_js_1 = requireSansSerifBoldItalic$1();
      sansSerifBoldItalic$1.sansSerifBoldItalic = (0, FontData_js_1.AddPaths)(sans_serif_bold_italic_js_1.sansSerifBoldItalic, {
        305: "54 431Q63 458 102 458H127H149Q192 458 199 433Q201 427 201 229T199 25Q190 0 149 0H125L81 1Q61 7 54 28V431",
        567: "-38 -84Q-36 -84 -14 -95T33 -106H38Q70 -103 78 -86Q83 -78 83 -49T84 180Q84 427 86 433Q93 458 136 458H158H180Q201 458 209 456T225 443Q230 436 231 418Q232 397 232 313V183V124V40Q232 -55 228 -87T203 -147Q166 -205 78 -205Q31 -205 -20 -189T-71 -159Q-71 -156 -59 -123Q-50 -96 -47 -91T-38 -84"
      }, {});
      return sansSerifBoldItalic$1;
    }
    var sansSerifBold$1 = {};
    var sansSerifBold = {};
    var hasRequiredSansSerifBold$1;
    function requireSansSerifBold$1() {
      if (hasRequiredSansSerifBold$1) return sansSerifBold;
      hasRequiredSansSerifBold$1 = 1;
      Object.defineProperty(sansSerifBold, "__esModule", { value: true });
      sansSerifBold.sansSerifBold = void 0;
      sansSerifBold.sansSerifBold = {
        33: [0.694, 0, 0.367],
        34: [0.694, -0.442, 0.558],
        35: [0.694, 0.193, 0.917],
        36: [0.75, 0.056, 0.55],
        37: [0.75, 0.056, 1.029],
        38: [0.716, 0.022, 0.831],
        39: [0.694, -0.442, 0.306],
        40: [0.75, 0.249, 0.428],
        41: [0.75, 0.25, 0.428],
        42: [0.75, -0.293, 0.55],
        43: [0.617, 0.116, 0.856],
        44: [0.146, 0.106, 0.306],
        45: [0.273, -0.186, 0.367],
        46: [0.146, 0, 0.306],
        47: [0.75, 0.249, 0.55],
        58: [0.458, 0, 0.306],
        59: [0.458, 0.106, 0.306],
        61: [0.407, -0.094, 0.856],
        63: [0.705, 0, 0.519],
        64: [0.704, 0.011, 0.733],
        91: [0.75, 0.25, 0.343],
        93: [0.75, 0.25, 0.343],
        94: [0.694, -0.537, 0.55],
        95: [-0.023, 0.11, 0.55],
        126: [0.344, -0.198, 0.55],
        305: [0.458, 0, 0.256],
        567: [0.458, 0.205, 0.286],
        768: [0.694, -0.537, 0],
        769: [0.694, -0.537, 0],
        770: [0.694, -0.537, 0],
        771: [0.694, -0.548, 0],
        772: [0.66, -0.56, 0],
        774: [0.694, -0.552, 0],
        775: [0.695, -0.596, 0],
        776: [0.695, -0.595, 0],
        778: [0.694, -0.538, 0],
        779: [0.694, -0.537, 0],
        780: [0.657, -0.5, 0],
        8211: [0.327, -0.24, 0.55],
        8212: [0.327, -0.24, 1.1],
        8213: [0.327, -0.24, 1.1],
        8215: [-0.023, 0.11, 0.55],
        8216: [0.694, -0.443, 0.306],
        8217: [0.694, -0.442, 0.306],
        8220: [0.694, -0.443, 0.558],
        8221: [0.694, -0.442, 0.558],
        8260: [0.75, 0.249, 0.55],
        8710: [0.694, 0, 0.917]
      };
      return sansSerifBold;
    }
    var hasRequiredSansSerifBold;
    function requireSansSerifBold() {
      if (hasRequiredSansSerifBold) return sansSerifBold$1;
      hasRequiredSansSerifBold = 1;
      Object.defineProperty(sansSerifBold$1, "__esModule", { value: true });
      sansSerifBold$1.sansSerifBold = void 0;
      var FontData_js_1 = requireFontData();
      var sans_serif_bold_js_1 = requireSansSerifBold$1();
      sansSerifBold$1.sansSerifBold = (0, FontData_js_1.AddPaths)(sans_serif_bold_js_1.sansSerifBold, {
        33: "111 669Q111 680 111 682T113 689T121 693T137 694H184H249Q255 686 256 681Q244 220 239 213Q236 208 229 208T183 207T137 207T127 213T118 431T111 669ZM110 71V95Q110 137 136 144Q140 146 183 146H200Q246 146 254 121Q256 115 256 73V51Q256 9 230 2Q225 0 181 0L138 1Q121 7 113 21L111 28L110 71",
        34: "38 687Q42 693 45 693Q46 694 111 694H176Q179 690 183 687V556L144 501Q139 494 134 486T126 474T120 465T114 457T110 451T106 447T102 445T98 443T94 443T89 442H73H62Q37 442 37 453Q37 458 55 501T74 546Q74 548 59 548L44 549L38 555V687ZM275 687Q279 693 282 693Q283 694 348 694H413Q416 690 420 687V556L381 501Q376 494 371 486T363 474T357 465T351 457T347 451T343 447T339 445T335 443T331 443T326 442H310H299Q274 442 274 453Q274 458 292 501T311 546Q311 548 296 548L281 549L275 555V687",
        35: "61 365Q61 370 62 375T65 383T69 390T74 395T80 399T85 403T90 406L94 407H344L381 536Q418 668 426 680Q431 687 445 692Q451 694 457 694Q477 694 488 682T500 651Q500 645 466 528T431 409Q431 407 504 407H577L609 521Q651 668 656 675Q669 693 691 693Q710 693 721 680T733 651Q733 645 699 528T664 409Q664 407 743 407H823L827 405Q831 403 834 402T841 397T848 389T853 379T855 365Q855 337 823 324L731 323H639L619 253Q599 181 598 180V177H823L827 175Q831 173 834 172T841 167T848 159T853 149T855 135Q855 107 823 94L698 93H573L540 -21Q498 -168 493 -175Q480 -193 458 -193Q439 -193 428 -180T416 -151Q416 -144 450 -27T485 91Q485 93 412 93H340L307 -21Q265 -168 260 -175Q247 -193 225 -193Q206 -193 195 -180T183 -151Q183 -144 217 -27T252 91Q252 93 173 93L94 94Q61 105 61 135Q61 140 62 145T65 153T69 160T74 165T80 169T85 173T90 176L94 177H185L277 178L297 248L318 320V323H206L94 324Q61 335 61 365ZM551 320V323H479Q406 323 405 322Q404 319 385 249T365 178T438 177L510 178L530 248L551 320",
        36: "231 712L232 716Q232 719 232 722T234 729T239 736T246 743T256 748T271 750Q318 750 318 711V703Q393 692 451 656Q469 645 470 640Q470 635 461 587L453 537Q445 529 442 529Q438 529 424 540T384 565T330 585Q328 585 325 585T320 586L318 587V434Q322 433 333 429T350 424T365 418T382 409T399 397T419 380Q488 313 488 213Q488 24 334 -5L318 -8V-17Q318 -56 279 -56H272Q253 -56 243 -46T232 -30T231 -18V-8H224Q170 2 127 20T68 50T49 67Q49 71 58 122T68 176Q71 182 79 182Q83 182 98 169T145 138T216 110Q228 108 229 108H231V288Q167 299 114 356T61 496Q61 537 70 570T94 624T126 661T162 684T195 696T219 701L228 702H231V712ZM231 521Q231 583 230 583Q226 582 220 579T204 561T193 521Q193 491 212 472Q226 458 230 458Q231 458 231 521ZM318 112Q356 131 356 187Q356 237 318 263V112",
        37: "61 549Q61 733 218 749Q220 749 228 749T241 750Q286 750 321 735T369 708T389 683Q422 634 422 548V538Q422 519 420 501T408 453T381 401T328 364T243 347Q61 347 61 549ZM292 549Q292 663 242 663Q221 663 211 648T198 615T196 566V548Q196 471 206 454Q218 434 242 434Q292 434 292 549ZM243 -55Q223 -55 212 -42T201 -13Q201 -2 207 7Q209 11 480 371T758 738Q770 750 788 750Q805 750 817 738T830 709Q830 694 820 681L544 315Q273 -43 269 -47Q258 -55 243 -55ZM606 146Q606 330 763 346Q764 346 773 346T786 347Q831 347 866 332T914 305T934 280Q966 233 966 146V135Q966 115 964 97T952 49T925 -2T872 -40T788 -56Q606 -56 606 146ZM742 146V132Q742 107 743 93T748 62T762 39T787 31Q819 31 832 79Q837 97 837 146Q837 260 787 260Q767 260 757 246T744 214T742 169V146",
        38: "757 117Q762 117 769 110V3Q759 -7 718 -14T641 -22T571 -15T518 1T477 19T453 31L437 23Q350 -19 257 -22Q158 -22 103 30T47 155Q47 188 57 216T87 263T119 292T151 313L182 333L187 336L181 349Q150 431 150 506Q150 605 211 660T347 716Q417 716 471 668T526 543Q526 517 518 495T471 432T360 343L342 330Q342 327 358 306T402 250T458 189L467 181Q518 225 556 289T607 395L620 437Q622 443 630 443Q631 443 679 430Q718 420 725 418T733 409Q733 402 722 365T670 255T573 123Q562 111 563 111Q589 94 644 94Q678 94 703 100T740 111T757 117ZM397 544Q397 573 384 601T346 629Q320 629 299 607T277 538Q277 484 295 429Q301 413 301 412Q302 409 309 415Q397 476 397 544ZM227 258Q197 228 197 177Q197 150 207 126T234 95Q242 93 251 93Q288 93 337 107L349 110L328 131Q266 196 234 248L227 258",
        39: "81 687Q85 693 88 693Q89 694 154 694H219Q222 690 226 687V556L187 501Q182 494 177 486T169 474T163 465T157 457T153 451T149 447T145 445T141 443T137 443T132 442H116H105Q80 442 80 453Q80 458 98 501T117 546Q117 548 102 548L87 549L81 555V687",
        40: "79 250Q79 352 100 441T152 585T213 678T266 733L287 749Q288 750 324 750H359Q366 741 366 738Q366 734 356 721T329 682T296 623T262 531T238 407Q230 346 230 250Q230 142 244 55T278 -82T318 -165T352 -215T366 -238Q366 -242 359 -249H286L277 -242Q79 -74 79 250",
        41: "61 737Q61 750 85 750H106H141L150 742Q348 574 348 250T150 -242L141 -249L106 -250H87Q61 -250 61 -238Q61 -233 74 -216Q157 -113 183 51Q197 130 197 250T183 449Q174 505 158 554T126 634T95 687T71 722T61 737",
        42: "241 579Q241 582 228 639T215 702Q215 722 233 736T271 750Q296 750 315 736T334 702V697Q334 693 328 664T314 607L308 579L352 620Q389 654 397 660T417 668Q447 668 464 647T482 602Q482 591 479 583T472 569T459 559T443 552T421 546T397 538L342 521L397 504Q405 501 420 497T442 490T458 483T472 473T479 460T482 440Q482 416 465 395T417 374Q406 375 398 381T352 422L308 463L314 435Q321 407 327 378T334 345Q336 333 327 319T296 295Q288 293 275 293Q241 293 227 311T215 345Q215 349 221 378T234 435L241 463L197 422Q160 388 152 382T132 374Q102 374 85 395T67 440Q67 451 70 459T77 473T90 483T106 490T128 496T152 504L207 521L152 538Q144 541 129 545T107 552T91 559T77 569T70 582T67 602Q67 626 84 647T132 668Q143 667 151 661T197 620L241 579",
        43: "61 250Q61 276 94 292H386V436V535Q386 577 388 589T401 607Q411 617 427 617Q458 617 468 587Q470 581 470 436V292H762L766 290Q770 288 773 287T780 282T787 274T792 264T794 250Q794 222 762 209L616 208H470V64Q470 -81 468 -87Q458 -116 428 -116T388 -87Q386 -81 386 64V208H240L94 209Q61 220 61 250",
        44: "81 139Q85 145 88 145Q89 146 154 146H219Q222 142 226 139V8L187 -47Q182 -54 177 -62T169 -74T163 -83T157 -91T153 -97T149 -101T145 -103T141 -105T137 -105T132 -106H116H105Q80 -106 80 -95Q80 -90 98 -47T117 -2Q117 0 102 0L87 1L81 7V139",
        45: "12 230Q12 257 26 265T80 274Q88 274 114 274T158 273T201 273T235 274Q276 274 290 266T305 230T291 194T235 185Q226 185 201 185T159 186Q143 186 119 186T85 185Q43 185 28 193T12 230",
        46: "219 146Q222 142 226 139V7L222 4L219 1L154 0Q102 0 94 0T82 6Q80 9 80 74L81 139Q85 145 88 145Q89 146 154 146H219",
        47: "103 -249Q81 -249 71 -235T61 -207Q61 -201 62 -198Q64 -192 235 265T409 727Q418 750 445 750Q464 750 476 737T488 707Q488 701 313 234Q143 -225 137 -232Q126 -249 103 -249",
        58: "226 319L219 313H87L81 319L80 384Q80 437 80 445T86 456Q89 458 154 458H219Q222 454 226 451V319ZM219 146Q222 142 226 139V7L222 4L219 1L154 0Q102 0 94 0T82 6Q80 9 80 74L81 139Q85 145 88 145Q89 146 154 146H219",
        59: "226 319L219 313H87L81 319L80 384Q80 437 80 445T86 456Q89 458 154 458H219Q222 454 226 451V319ZM81 139Q85 145 88 145Q89 146 154 146H219Q222 142 226 139V8L187 -47Q182 -54 177 -62T169 -74T163 -83T157 -91T153 -97T149 -101T145 -103T141 -105T137 -105T132 -106H116H105Q80 -106 80 -95Q80 -90 98 -47T117 -2Q117 0 102 0L87 1L81 7V139",
        61: "94 324Q61 335 61 366Q61 396 91 405Q96 407 429 407H762Q763 406 767 404T774 400T781 395T787 387T792 378T794 365Q794 338 762 324H94ZM94 94Q61 105 61 135Q61 149 69 160T92 175Q97 177 430 177H762L766 175Q770 173 773 172T780 167T787 159T792 149T794 135Q794 107 762 94H94",
        63: "61 644Q61 652 87 666T157 693T244 705Q344 705 400 671T457 551Q457 516 446 490T422 451T387 421T356 391Q330 361 318 332T305 292T303 252Q303 218 300 213T290 208T244 207H220Q194 207 188 213Q187 214 186 215V255Q187 282 188 296T198 345T229 417T288 496Q306 515 306 559Q306 596 296 607T253 618Q214 618 185 607T143 583T120 558T103 547Q99 547 95 551Q93 553 77 597T61 644ZM171 71V95Q171 137 197 144Q201 146 244 146H261Q307 146 315 121Q317 115 317 73V51Q317 9 291 2Q286 0 242 0L199 1Q182 7 174 21L172 28L171 71",
        64: "61 264T61 347T82 494T136 596T217 660T311 694T410 704Q460 704 471 703Q534 694 577 666Q633 623 651 552T670 370V342Q670 249 633 195Q583 116 454 116Q238 116 238 347Q238 443 276 499Q328 578 456 578Q488 578 494 577L504 575Q475 617 430 617H421Q196 617 196 347Q196 215 253 143Q310 76 427 76Q499 76 561 102L575 107H664Q671 97 671 94V89L663 81Q566 -11 422 -11Q365 -11 316 -2T219 33T137 97T82 200ZM469 490Q459 492 453 492Q429 492 405 472Q374 439 374 347Q374 233 423 210Q436 202 454 202L486 210Q536 228 536 347Q536 461 486 484Q476 490 469 490",
        91: "318 -206Q318 -235 305 -243T255 -251Q248 -251 229 -251T198 -250H143Q112 -250 99 -246T81 -225Q79 -219 79 250T81 725Q85 741 98 745T143 750H198Q210 750 229 750T255 751Q291 751 304 743T318 707Q318 680 301 668Q293 663 255 663H224V-163H255Q293 -163 301 -168Q318 -180 318 -206",
        93: "24 706Q24 734 39 742T90 751Q97 751 114 751T143 750H198Q230 750 243 746T261 725Q263 719 263 250T261 -225Q257 -241 244 -245T198 -250H143Q131 -250 112 -250T86 -251Q50 -251 37 -243T24 -207Q24 -180 41 -168Q49 -163 87 -163H118V663H87H71Q24 663 24 706",
        94: "108 550Q108 554 135 589T190 658T219 692Q221 694 275 694Q328 694 330 693Q331 692 381 629T438 557Q441 553 441 549T434 538L399 537Q363 537 362 538Q361 538 318 575L275 611Q274 611 231 575Q188 538 187 538Q186 537 150 537L115 538Q108 545 108 550",
        95: "0 -66Q0 -32 26 -25Q30 -23 274 -23Q469 -23 497 -23T532 -28Q549 -40 549 -67Q549 -93 532 -105Q525 -109 498 -109T275 -110Q31 -110 26 -108Q0 -101 0 -66",
        126: "92 215Q92 259 122 301T204 344Q238 344 264 329T310 300T343 285Q356 285 361 295T369 322T377 344H450Q457 334 457 330Q457 281 427 240T344 198Q312 198 285 213T239 242T206 257Q188 257 182 230T172 199L137 198H120Q102 198 97 200T92 215",
        305: "54 431Q63 458 102 458H127H149Q192 458 199 433Q201 427 201 229T199 25Q190 0 149 0H125L81 1Q61 7 54 28V431",
        567: "-38 -84Q-36 -84 -14 -95T33 -106H38Q70 -103 78 -86Q83 -78 83 -49T84 180Q84 427 86 433Q93 458 136 458H158H180Q201 458 209 456T225 443Q230 436 231 418Q232 397 232 313V183V124V40Q232 -55 228 -87T203 -147Q166 -205 78 -205Q31 -205 -20 -189T-71 -159Q-71 -156 -59 -123Q-50 -96 -47 -91T-38 -84",
        768: "-458 682Q-458 690 -452 692T-426 694H-381H-314L-312 691Q-311 691 -305 682T-287 655T-263 622L-218 555V549Q-218 544 -224 538L-259 537Q-295 537 -296 538Q-298 539 -376 606T-456 676Q-458 680 -458 682",
        769: "-290 537H-310Q-334 537 -334 549Q-334 553 -311 588T-264 656L-241 690Q-240 690 -239 691T-236 693Q-235 694 -167 694H-100Q-93 684 -93 681T-94 677Q-95 675 -173 607T-255 538Q-256 537 -290 537",
        770: "-442 550Q-442 554 -415 589T-360 658T-331 692Q-329 694 -275 694Q-222 694 -220 693Q-219 692 -169 629T-112 557Q-109 552 -109 549Q-109 545 -116 538L-151 537Q-187 537 -188 538Q-189 538 -232 575L-275 611Q-276 611 -319 575Q-362 538 -363 538Q-364 537 -400 537L-435 538Q-442 545 -442 550",
        771: "-458 565Q-458 609 -428 651T-346 694Q-312 694 -286 679T-240 650T-207 635Q-194 635 -189 645T-181 672T-173 694H-100Q-93 684 -93 680Q-93 631 -123 590T-206 548Q-238 548 -265 563T-311 592T-344 607Q-362 607 -368 580T-378 549L-413 548H-430Q-448 548 -453 550T-458 565",
        772: "-84 660Q-81 656 -77 653V567L-81 564L-84 561L-274 560H-383Q-469 560 -471 565L-472 566Q-474 569 -474 611L-473 653Q-469 659 -466 659Q-465 660 -274 660H-84",
        774: "-123 694Q-80 694 -80 657Q-80 626 -99 601T-161 563Q-199 552 -275 552Q-352 552 -389 563Q-470 586 -470 655Q-470 667 -468 673Q-457 694 -435 694H-431Q-408 694 -396 685Q-387 676 -387 671Q-384 661 -275 661Q-167 661 -164 671Q-164 674 -163 677T-151 687T-123 694",
        775: "-329 596Q-346 602 -351 611T-356 638V646Q-356 653 -356 654T-356 661T-355 668T-353 673T-351 679T-347 684T-341 689T-332 693T-274 695H-221Q-202 683 -198 676T-194 645Q-194 632 -195 625T-202 610T-221 596H-329",
        776: "-331 695Q-312 683 -308 676T-304 645Q-304 632 -304 626T-311 610T-331 596L-380 595H-408Q-448 595 -457 617Q-459 621 -459 645T-457 673Q-448 696 -409 696Q-405 696 -396 696T-380 695H-331ZM-247 644Q-247 658 -246 665T-239 680T-221 694Q-217 695 -169 695H-143Q-102 695 -93 672Q-91 664 -91 645V635Q-91 613 -106 602Q-113 597 -121 596T-171 595L-219 596Q-232 600 -238 608T-246 622T-247 644",
        778: "-365 616Q-365 658 -331 676T-256 694Q-253 694 -247 694T-236 693Q-166 693 -139 666Q-119 644 -119 616T-139 565Q-166 538 -237 538H-242Q-365 538 -365 616ZM-181 616Q-181 641 -195 647T-242 654Q-258 654 -266 654T-284 650T-298 638T-303 616Q-303 592 -289 585T-242 577Q-209 577 -195 584T-181 616",
        779: "-426 686Q-424 694 -394 694H-350H-283Q-277 686 -277 682Q-277 673 -317 608T-361 538L-396 537H-420Q-432 537 -436 539T-440 548Q-440 560 -434 616Q-432 633 -430 650T-427 677L-426 686ZM-243 686Q-241 694 -211 694H-167H-100Q-94 686 -94 682Q-94 673 -134 608T-178 538L-213 537H-237Q-249 537 -253 539T-257 548Q-257 560 -251 616Q-249 633 -247 650T-244 677L-243 686",
        780: "-442 645Q-442 657 -418 657H-398Q-393 657 -388 657T-379 657T-371 656T-365 656H-363L-319 620L-276 583Q-275 583 -232 619Q-189 656 -188 656Q-187 657 -151 657H-116Q-109 649 -109 645Q-109 642 -112 637Q-118 629 -168 566T-220 501Q-222 500 -275 500Q-329 500 -331 501Q-442 634 -442 645",
        8211: "0 284Q0 318 26 325Q30 327 274 327Q469 327 497 327T532 322Q549 310 549 283Q549 257 532 245Q525 241 498 241T275 240Q31 240 26 242Q0 249 0 284",
        8212: "0 284Q0 318 26 325Q30 327 549 327T1073 325Q1099 318 1099 284Q1099 249 1073 242Q1068 240 549 240Q31 240 26 242Q0 249 0 284",
        8213: "0 284Q0 318 26 325Q30 327 549 327T1073 325Q1099 318 1099 284Q1099 249 1073 242Q1068 240 549 240Q31 240 26 242Q0 249 0 284",
        8215: "0 -66Q0 -32 26 -25Q30 -23 274 -23Q469 -23 497 -23T532 -28Q549 -40 549 -67Q549 -93 532 -105Q525 -109 498 -109T275 -110Q31 -110 26 -108Q0 -101 0 -66",
        8216: "87 443L81 449V581L119 636Q125 644 131 653T141 667T148 677T154 685T158 689T163 692T167 693T173 694H190H201Q226 694 226 683Q226 678 208 635T189 590Q189 588 204 588H219Q222 584 226 581V449L219 443H87",
        8217: "81 687Q85 693 88 693Q89 694 154 694H219Q222 690 226 687V556L187 501Q182 494 177 486T169 474T163 465T157 457T153 451T149 447T145 445T141 443T137 443T132 442H116H105Q80 442 80 453Q80 458 98 501T117 546Q117 548 102 548L87 549L81 555V687",
        8220: "144 443L138 449V581L176 636Q182 644 188 653T198 667T205 677T211 685T215 689T220 692T224 693T230 694H247H258Q283 694 283 683Q283 678 265 635T246 590Q246 588 261 588H276Q279 584 283 581V449L276 443H144ZM381 443L375 449V581L413 636Q419 644 425 653T435 667T442 677T448 685T452 689T457 692T461 693T467 694H484H495Q520 694 520 683Q520 678 502 635T483 590Q483 588 498 588H513Q516 584 520 581V449L513 443H381",
        8221: "38 687Q42 693 45 693Q46 694 111 694H176Q179 690 183 687V556L144 501Q139 494 134 486T126 474T120 465T114 457T110 451T106 447T102 445T98 443T94 443T89 442H73H62Q37 442 37 453Q37 458 55 501T74 546Q74 548 59 548L44 549L38 555V687ZM275 687Q279 693 282 693Q283 694 348 694H413Q416 690 420 687V556L381 501Q376 494 371 486T363 474T357 465T351 457T347 451T343 447T339 445T335 443T331 443T326 442H310H299Q274 442 274 453Q274 458 292 501T311 546Q311 548 296 548L281 549L275 555V687",
        8260: "103 -249Q81 -249 71 -235T61 -207Q61 -201 62 -198Q64 -192 235 265T409 727Q418 750 445 750Q464 750 476 737T488 707Q488 701 313 234Q143 -225 137 -232Q126 -249 103 -249",
        8710: "381 692Q386 694 458 694Q516 694 527 693T549 687Q564 680 575 663Q576 658 715 349T856 27Q856 6 838 1H826Q815 1 795 1T747 1T686 1T616 0T539 0T458 0T378 0T300 0T230 0T169 1T122 1T90 1H78Q60 6 60 27Q62 38 201 349T341 663Q356 687 381 692ZM627 148Q626 149 581 250T492 453L447 554Q447 553 446 552Q444 546 326 278L268 148Q268 147 448 147Q627 147 627 148"
      }, {});
      return sansSerifBold$1;
    }
    var sansSerifItalic$1 = {};
    var sansSerifItalic = {};
    var hasRequiredSansSerifItalic$1;
    function requireSansSerifItalic$1() {
      if (hasRequiredSansSerifItalic$1) return sansSerifItalic;
      hasRequiredSansSerifItalic$1 = 1;
      Object.defineProperty(sansSerifItalic, "__esModule", { value: true });
      sansSerifItalic.sansSerifItalic = void 0;
      sansSerifItalic.sansSerifItalic = {
        33: [0.694, 0, 0.319, { ic: 0.036 }],
        34: [0.694, -0.471, 0.5],
        35: [0.694, 0.194, 0.833, { ic: 0.018 }],
        36: [0.75, 0.056, 0.5, { ic: 0.065 }],
        37: [0.75, 0.056, 0.833],
        38: [0.716, 0.022, 0.758],
        39: [0.694, -0.471, 0.278, { ic: 0.057 }],
        40: [0.75, 0.25, 0.389, { ic: 0.102 }],
        41: [0.75, 0.25, 0.389],
        42: [0.75, -0.306, 0.5, { ic: 0.068 }],
        43: [0.583, 0.083, 0.778],
        44: [0.098, 0.125, 0.278],
        45: [0.259, -0.186, 0.333],
        46: [0.098, 0, 0.278],
        47: [0.75, 0.25, 0.5, { ic: 0.1 }],
        48: [0.678, 0.022, 0.5, { ic: 0.049 }],
        49: [0.678, 0, 0.5],
        50: [0.678, 0, 0.5, { ic: 0.051 }],
        51: [0.678, 0.022, 0.5, { ic: 0.044 }],
        52: [0.656, 0, 0.5, { ic: 0.021 }],
        53: [0.656, 0.022, 0.5, { ic: 0.055 }],
        54: [0.678, 0.022, 0.5, { ic: 0.048 }],
        55: [0.656, 0.011, 0.5, { ic: 0.096 }],
        56: [0.678, 0.022, 0.5, { ic: 0.054 }],
        57: [0.677, 0.022, 0.5, { ic: 0.045 }],
        58: [0.444, 0, 0.278],
        59: [0.444, 0.125, 0.278],
        61: [0.37, -0.13, 0.778, { ic: 0.018 }],
        63: [0.704, 0, 0.472, { ic: 0.064 }],
        64: [0.705, 0.01, 0.667, { ic: 0.04 }],
        91: [0.75, 0.25, 0.289, { ic: 0.136 }],
        93: [0.75, 0.25, 0.289, { ic: 0.064 }],
        94: [0.694, -0.527, 0.5, { ic: 0.033 }],
        95: [-0.038, 0.114, 0.5, { ic: 0.065 }],
        126: [0.327, -0.193, 0.5, { ic: 0.06 }],
        305: [0.444, 0, 0.239, { ic: 0.019 }],
        567: [0.444, 0.204, 0.267, { ic: 0.019 }],
        768: [0.694, -0.527, 0],
        769: [0.694, -0.527, 0, { ic: 0.063 }],
        770: [0.694, -0.527, 0, { ic: 0.033 }],
        771: [0.677, -0.543, 0, { ic: 0.06 }],
        772: [0.631, -0.552, 0, { ic: 0.064 }],
        774: [0.694, -0.508, 0, { ic: 0.073 }],
        775: [0.68, -0.576, 0],
        776: [0.68, -0.582, 0, { ic: 0.04 }],
        778: [0.693, -0.527, 0],
        779: [0.694, -0.527, 0, { ic: 0.063 }],
        780: [0.654, -0.487, 0, { ic: 0.06 }],
        913: [0.694, 0, 0.667],
        914: [0.694, 0, 0.667, { ic: 0.029 }],
        915: [0.691, 0, 0.542, { ic: 0.104 }],
        916: [0.694, 0, 0.833],
        917: [0.691, 0, 0.597, { ic: 0.091 }],
        918: [0.694, 0, 0.611, { ic: 0.091 }],
        919: [0.694, 0, 0.708, { ic: 0.06 }],
        920: [0.715, 0.022, 0.778, { ic: 0.026 }],
        921: [0.694, 0, 0.278, { ic: 0.06 }],
        922: [0.694, 0, 0.694, { ic: 0.091 }],
        923: [0.694, 0, 0.611],
        924: [0.694, 0, 0.875, { ic: 0.054 }],
        925: [0.694, 0, 0.708, { ic: 0.058 }],
        926: [0.688, 0, 0.667, { ic: 0.098 }],
        927: [0.716, 0.022, 0.736, { ic: 0.027 }],
        928: [0.691, 0, 0.708, { ic: 0.06 }],
        929: [0.694, 0, 0.639, { ic: 0.051 }],
        931: [0.694, 0, 0.722, { ic: 0.091 }],
        932: [0.688, 0, 0.681, { ic: 0.109 }],
        933: [0.716, 0, 0.778, { ic: 0.065 }],
        934: [0.694, 0, 0.722, { ic: 0.021 }],
        935: [0.694, 0, 0.667, { ic: 0.091 }],
        936: [0.694, 0, 0.778, { ic: 0.076 }],
        937: [0.716, 0, 0.722, { ic: 0.047 }],
        8211: [0.312, -0.236, 0.5, { ic: 0.065 }],
        8212: [0.312, -0.236, 1, { ic: 0.065 }],
        8213: [0.312, -0.236, 1, { ic: 0.065 }],
        8215: [-0.038, 0.114, 0.5, { ic: 0.065 }],
        8216: [0.694, -0.471, 0.278, { ic: 0.058 }],
        8217: [0.694, -0.471, 0.278, { ic: 0.057 }],
        8220: [0.694, -0.471, 0.5, { ic: 0.114 }],
        8221: [0.694, -0.471, 0.5],
        8260: [0.75, 0.25, 0.5, { ic: 0.1 }],
        8710: [0.694, 0, 0.833]
      };
      return sansSerifItalic;
    }
    var hasRequiredSansSerifItalic;
    function requireSansSerifItalic() {
      if (hasRequiredSansSerifItalic) return sansSerifItalic$1;
      hasRequiredSansSerifItalic = 1;
      Object.defineProperty(sansSerifItalic$1, "__esModule", { value: true });
      sansSerifItalic$1.sansSerifItalic = void 0;
      var FontData_js_1 = requireFontData();
      var sans_serif_italic_js_1 = requireSansSerifItalic$1();
      sansSerifItalic$1.sansSerifItalic = (0, FontData_js_1.AddPaths)(sans_serif_italic_js_1.sansSerifItalic, {
        33: "160 187L257 694H306Q355 694 355 693L238 186H199Q160 186 160 187ZM110 2Q111 3 120 49T131 96Q131 98 180 98T229 96L219 50Q209 3 208 2V0H110V2",
        34: "171 647L180 694H229Q278 694 278 693L276 686Q275 680 273 668T268 644L258 597L182 471H157Q133 471 133 472L189 595Q189 596 174 596H160V598Q160 601 171 647ZM365 647L374 694H423Q472 694 472 693L470 686Q469 680 467 668T462 644L452 597L376 471H351Q327 471 327 472L383 595Q383 596 368 596H354V598Q354 601 365 647",
        35: "793 170Q809 162 809 149Q809 145 807 141T802 135T796 132L793 130H547L472 -27Q397 -184 394 -187Q389 -194 379 -194Q367 -194 362 -183Q359 -179 359 -173Q360 -168 431 -20L503 129Q503 130 410 130H317L242 -27Q167 -184 164 -187Q159 -194 149 -194Q137 -194 132 -183Q129 -179 129 -173Q130 -168 201 -19L273 130H187L100 131Q87 141 87 150Q87 162 102 170H294L331 248Q339 265 349 286T365 318L370 328Q370 330 258 330Q145 330 142 332Q129 338 129 351Q129 362 140 368Q146 370 267 370L391 371L467 527Q542 684 544 686Q544 688 549 691T560 694H562Q565 693 567 692T571 690T575 686T578 681T579 672Q577 665 507 520T436 373L435 370H528L621 371L692 518Q767 675 769 677Q775 694 789 694Q798 694 804 688T809 672Q806 664 737 519L665 371L751 370Q835 370 841 368Q851 362 851 350Q851 337 841 334T799 330H765H741H645L606 250L568 170H793ZM600 328Q600 330 508 330H415Q412 326 338 171Q338 170 431 170H524L561 248Q569 265 579 286T595 318L600 328",
        36: "228 70Q233 92 246 155T270 266T280 316Q271 318 265 320T237 333T200 360T172 403T159 468Q159 537 205 600T325 691Q352 701 360 701Q361 701 361 701T362 703T364 711T368 727L372 750H409Q445 750 445 749L436 705Q436 703 450 702T494 691T554 657L565 649Q562 642 548 604L534 568Q511 591 484 605T440 621L424 623L419 624L372 405Q399 400 424 384Q490 338 490 247V240Q490 156 430 85Q374 13 294 -5L284 -7L280 -30Q279 -35 278 -41T275 -52L274 -55Q274 -56 237 -56Q201 -56 201 -54Q202 -53 205 -34T211 -11Q211 -9 206 -9Q154 -2 115 19Q80 35 56 59L88 141L99 131Q109 121 119 113T141 99T160 89T180 82T197 77T214 73T228 70ZM303 426Q304 427 313 471T332 564T345 620L335 616Q287 596 263 549Q252 525 252 499Q252 470 267 451T298 426Q303 424 303 426ZM302 75Q305 75 315 80T340 98T367 125T390 164T399 214Q399 247 384 268T349 297Q338 247 326 186L302 75",
        37: "268 347Q224 347 195 386T165 488Q165 517 173 552Q191 637 246 693T349 749Q389 749 414 725T448 673T456 614Q456 506 396 427T268 347ZM372 604Q372 674 339 674Q311 674 290 633T261 549T253 482V474Q253 438 272 426Q277 424 286 424Q319 424 345 485T372 604ZM189 -56Q179 -56 173 -49T167 -37Q167 -30 347 198Q425 296 475 360Q780 745 785 747Q790 750 796 750Q814 748 814 730Q814 725 811 719L204 -49Q198 -56 189 -56ZM523 87Q523 184 583 265T713 347Q758 347 786 308T815 207Q815 110 757 28T629 -55Q576 -55 550 -12T523 87ZM729 200Q729 271 696 271Q675 271 658 247T631 189T616 125T611 76Q611 21 644 21H647Q672 21 700 77T729 200",
        38: "219 -22Q158 -22 117 13T71 111Q71 131 74 150T84 185T98 215T118 241T137 262T159 281T179 295T199 308L214 318L258 348L256 362Q254 373 254 413V435Q254 483 271 537T325 641T411 708Q427 715 441 715Q446 716 455 716Q504 716 534 681T565 590Q565 522 519 468T377 347L358 334Q359 333 363 320T374 290T387 262Q404 227 428 187T460 139Q521 183 574 251T651 362T674 409L710 398Q746 388 747 388Q747 381 720 333T635 213T517 94L510 87Q542 57 598 57Q649 57 708 72Q716 75 718 75L709 34L701 -7Q636 -22 578 -22Q531 -22 498 -8T428 34L408 25Q314 -22 219 -22ZM480 579Q480 640 436 640Q410 640 385 615T351 554Q340 513 340 457Q340 413 343 410Q343 406 360 419Q431 471 455 505T480 579ZM245 57Q279 59 311 67T359 81T375 89T358 113T318 178T281 260L274 277L245 257Q167 205 167 135Q167 110 174 93T194 69T217 60T237 57H245",
        39: "228 647L237 694H286Q335 694 335 693L334 686Q332 680 330 668T325 644L315 597L239 471H214Q190 471 190 472L246 595Q246 596 231 596H217V598Q217 601 228 647",
        40: "195 37Q195 -7 200 -47T213 -113T231 -166T250 -204T268 -232T280 -250H204L194 -238Q104 -124 104 55Q104 238 181 432T405 740L417 750H454Q491 750 491 749L468 729Q446 709 411 667T337 565T262 405T208 188Q195 110 195 37",
        41: "300 463Q300 634 222 740L214 750H290L299 740Q300 738 309 726T323 707T337 682T353 651T367 613T379 566T387 510T390 444Q390 314 344 156T203 -125Q179 -155 145 -191Q111 -224 89 -241L78 -250H2Q4 -248 27 -227T65 -189T107 -140T155 -71T200 16T244 129T278 266Q300 372 300 463",
        42: "193 608Q193 628 210 644T246 660Q250 660 252 660T257 658T264 654T272 648T284 638T302 623Q340 590 340 593Q341 594 345 623T354 682T360 715Q365 729 378 739T407 750Q424 750 433 740T443 720Q443 712 427 652L410 591L462 623Q505 650 514 655T534 660Q549 660 558 650T568 625Q568 617 567 611T560 599T551 590T536 580T519 571T496 561T470 548L429 528L474 500Q482 495 492 489T506 481T516 475T523 469T527 464T529 458T530 450Q530 430 514 414T479 397H475Q468 397 460 402T423 433Q414 440 404 448T388 461L383 465L365 344Q348 306 314 306Q302 306 292 313T281 338Q281 347 297 404L313 464L260 433Q201 397 195 397H189Q173 397 165 407T156 432Q156 438 157 443T161 452T166 460T175 468T185 475T198 482T212 489T230 497T250 506L295 528L250 556Q203 582 202 585Q193 591 193 608",
        43: "108 244T108 250T112 261T119 268T124 270H426V272Q428 274 457 419Q489 565 492 573Q497 583 508 583Q516 583 522 577T528 565Q528 553 498 417Q491 384 483 346T471 288L467 270H760Q775 262 775 250T760 230H458Q456 221 426 77T394 -71Q389 -83 375 -83Q367 -83 362 -78T356 -64Q356 -58 387 84Q394 118 401 155T413 210L417 229Q417 230 271 230H124Q123 230 120 232T112 239",
        44: "90 2Q91 3 100 49T111 96Q111 98 160 98T209 96L199 50Q189 3 188 2Q188 0 149 -63L112 -125H63L120 0H105Q90 0 90 2",
        45: "66 257V259H332V257L324 220L317 186H184Q51 186 51 187T58 220T66 257",
        46: "90 2Q91 3 100 49T111 96Q111 98 160 98T209 96L199 50Q189 3 188 2V0H90V2",
        47: "564 744L568 747Q573 750 579 750Q588 750 594 744T599 729Q597 721 321 241T41 -243Q37 -250 27 -250Q6 -250 6 -230Q6 -228 8 -222Q9 -219 285 261T564 744",
        48: "245 -22Q209 -22 181 -11T135 20T107 65T92 116T88 171Q88 235 114 354T194 557Q226 606 269 635T340 671T392 678H395Q422 678 446 670T495 643T534 582T549 481Q549 430 534 350T499 213Q459 89 379 25Q315 -22 247 -22H245ZM430 582Q408 601 378 601Q313 601 269 534Q234 475 205 341Q181 232 181 174Q181 104 209 76Q231 54 260 54T318 73T368 125Q410 194 447 375Q460 445 460 487Q460 555 430 582",
        49: "234 613Q277 613 331 628T428 678H439Q451 678 451 676Q450 671 387 373T323 74T384 73H445L430 0H259L88 1L104 73H229L332 560Q278 541 198 539Q198 540 198 541T199 546T200 554T202 564T205 576L213 612H219Q221 612 226 612T234 613",
        50: "190 460Q189 460 181 475T164 507T155 527Q155 535 182 571Q259 678 380 678Q462 678 506 630T551 513V507Q551 418 487 349Q469 329 441 305T391 265T344 232T316 212Q158 87 158 86T188 85Q194 85 234 85T311 86Q467 86 467 85Q451 9 449 2V0H50Q54 18 58 40L67 79L133 133Q246 226 269 243Q369 318 410 373T452 492Q452 535 433 560T393 592T350 599Q311 599 279 578T231 532T203 484T190 460",
        51: "446 542Q446 576 424 590T372 605Q330 605 288 583T216 524Q209 515 208 516Q207 517 192 549L178 580L187 589Q224 627 276 652T386 678Q456 678 500 642T544 550Q544 515 530 482T495 427T453 387T418 362L403 353L413 348Q440 335 462 313Q500 271 500 217Q500 135 423 57T236 -22T63 59L56 68L85 141Q106 112 125 98Q177 54 254 54Q315 54 355 105T396 218Q396 242 393 254Q380 301 335 313Q327 315 280 316Q233 316 233 318L249 392Q298 392 322 399Q373 408 409 453T446 542",
        52: "78 235L411 656H465Q519 656 519 655T475 447T430 237V235H521V233L505 160Q505 159 459 159H414L380 0H286L320 159H62L63 164Q64 169 66 179T70 198L78 235ZM342 235L421 607Q420 607 419 604Q409 535 197 267Q173 236 173 235H342",
        53: "330 350Q263 350 214 272H133V275Q134 276 174 467L214 655Q214 656 385 656H555V653Q555 652 554 647T550 631T546 613L539 577H284L265 486Q261 464 256 441T248 406L246 395L250 398Q255 401 264 406T286 415T315 423T350 427Q412 427 455 381T498 256Q498 150 415 64T222 -22Q186 -22 155 -12T105 12T74 41T55 65T50 77L51 79Q61 89 78 112L104 145L107 138Q110 130 114 123T125 106T142 88T165 72T196 60T236 55Q282 55 316 79T366 140T389 208T396 267Q396 310 378 330T337 350H330",
        54: "437 605Q397 605 361 585T301 536T261 477T236 426T228 401L236 408Q244 414 260 424T296 445T345 462T402 469H404Q422 469 434 467T465 446T498 394Q515 351 515 307Q515 254 497 193T439 85Q352 -22 246 -22Q220 -22 196 -14T148 15T109 78T94 179Q94 272 123 373Q163 505 257 591T450 678Q474 678 498 674T535 664T548 656L540 621L532 586L520 590Q509 594 485 599T437 605ZM339 392Q281 392 233 334T185 163V158Q185 87 230 61Q244 54 262 54Q325 54 371 122Q395 158 407 217T419 298Q419 337 401 364T339 392",
        55: "173 614L181 656H389Q596 656 596 655L595 650Q594 645 592 635T588 616L580 578L554 551Q313 307 245 4L242 -11H192Q143 -11 143 -10Q144 0 148 17T169 89T212 198T285 327T393 470Q423 504 472 550Q479 555 485 561T496 571L329 570Q163 570 163 571L164 577Q166 583 168 593T173 614",
        56: "159 470Q159 547 229 612T394 678Q467 678 510 636T554 533Q554 512 549 493T535 458T515 429T492 405T467 386T443 372T423 362T409 356L404 354Q404 353 405 353Q411 353 432 341T476 295T500 218Q500 134 424 56T246 -22Q175 -22 126 22T77 143Q77 204 110 251T188 327L202 334Q216 340 229 346T243 353T235 358T214 372T189 393T168 426T159 470ZM467 527Q467 605 375 605Q317 605 281 566T244 472Q244 429 271 411T334 392Q392 392 429 430T467 527ZM405 228Q405 262 384 289T315 316Q257 316 216 266T174 144Q174 95 199 75T262 54Q329 54 367 109T405 228",
        57: "220 594Q303 677 389 677Q545 677 545 479Q545 413 526 327Q493 175 398 77T202 -22Q124 -22 77 25L130 91L137 83Q169 54 218 54Q255 54 290 76T347 129Q364 151 380 182T403 232T411 256Q410 255 390 241T353 217T303 197T236 187Q195 187 173 209Q155 226 140 263T124 352Q124 392 135 435Q154 527 220 594ZM455 497Q455 605 383 605Q340 605 305 577T246 492Q220 411 220 360Q220 278 279 264Q280 264 287 264T299 263Q347 263 387 302Q455 375 455 497",
        58: "174 396L184 444H233Q282 444 282 443Q277 421 272 394L262 346H213Q164 346 164 347Q169 369 174 396ZM90 2Q91 3 100 49T111 96Q111 98 160 98T209 96L199 50Q189 3 188 2V0H90V2",
        59: "174 396L184 444H233Q282 444 282 443Q277 421 272 394L262 346H213Q164 346 164 347Q169 369 174 396ZM90 2Q91 3 100 49T111 96Q111 98 160 98T209 96L199 50Q189 3 188 2Q188 0 149 -63L112 -125H63L120 0H105Q90 0 90 2",
        61: "142 368Q145 370 463 370Q780 370 784 368Q796 364 796 350T784 332Q780 330 463 330Q145 330 142 332Q129 338 129 351Q129 362 142 368ZM88 137T88 150T102 170H738Q739 170 742 168T750 161T754 150T750 139T743 132T738 130H102Q88 137 88 150",
        63: "194 652Q194 654 218 666T284 691T362 704Q444 704 490 678T536 583Q536 541 516 500T459 433Q415 400 387 371T343 313T321 266T307 216L301 186H262Q223 186 223 187Q224 199 228 218T250 288T294 377Q317 413 344 440T391 481T414 499Q442 527 442 574Q442 584 441 590T433 607T409 623T362 629Q335 629 310 624T267 610T235 595T214 582T205 576L200 614Q194 651 194 652ZM173 2Q174 3 183 49T194 96Q194 98 243 98T292 96L282 50Q272 3 271 2V0H173V2",
        64: "120 267Q120 377 179 478T336 642T538 705Q610 705 658 662T707 513Q707 425 681 331Q658 241 590 179T447 117Q386 117 343 163T300 288Q300 397 374 486T544 576Q575 576 608 562Q590 628 517 628Q406 628 309 522T212 278Q212 179 267 122T404 65T550 91H631Q513 -10 390 -10Q265 -10 193 70T120 267ZM600 397Q600 441 581 471T530 501Q476 501 433 436T390 298Q390 254 409 224T462 193Q512 193 556 257T600 397",
        91: "148 252L253 750H339Q425 750 425 749L424 744Q423 739 421 729T417 711L409 675L367 674H325L235 252Q145 -167 145 -172Q145 -174 187 -174H229V-176Q213 -240 213 -250H127Q41 -250 41 -248Q41 -245 148 252",
        93: "353 749Q353 746 303 512T200 27T141 -250H-31Q-31 -240 -15 -176V-174H70L250 674H208L165 675L181 750H267Q353 750 353 749",
        94: "190 527L360 694H434L484 611Q533 528 533 527H457L390 632L385 639L266 527H190",
        95: "59 -75L66 -38H316Q565 -38 565 -39T558 -75T549 -112Q549 -114 299 -114Q50 -114 50 -113L52 -108Q53 -103 55 -93T59 -75",
        126: "330 327Q356 326 388 298T446 269Q470 269 484 327H522Q560 327 560 325L557 316Q554 306 549 292T535 263T512 232T480 208Q453 193 429 193T370 222T315 251Q285 251 275 193H199V197Q214 257 251 292T330 327",
        305: "168 442T168 443T213 444T258 443T212 225T164 2V0H74V2Q75 7 121 224",
        567: "-54 -96L-48 -104Q-41 -111 -27 -118T7 -126Q60 -126 82 -87Q85 -81 140 181L196 443Q196 444 241 444T286 443Q286 441 232 186T175 -75Q163 -120 122 -162T19 -204Q-13 -204 -41 -196T-83 -180T-96 -170Q-55 -96 -54 -96",
        768: "-262 681L-270 694H-177L-132 612Q-89 530 -87 528Q-87 527 -125 527H-163L-208 598Q-254 670 -262 681",
        769: "-96 625L-29 694H63Q42 673 -31 605L-114 527H-190L-176 541Q-160 559 -96 625",
        770: "-310 527L-140 694H-66L-16 611Q33 528 33 527H-43L-110 632L-115 639L-234 527H-310",
        771: "-170 677Q-144 676 -112 648T-54 619Q-30 619 -16 677H22Q60 677 60 675L57 666Q54 656 49 642T35 613T12 582T-20 558Q-47 543 -71 543T-130 572T-185 601Q-215 601 -225 543H-301V547Q-286 607 -249 642T-170 677",
        772: "-314 553L-297 631H-116Q64 631 64 630Q60 612 56 591L47 553L-133 552Q-314 552 -314 553",
        774: "-142 508Q-205 508 -244 548T-284 652Q-284 666 -281 683L-280 694H-204Q-205 689 -205 677Q-205 650 -196 631T-173 604T-147 593T-125 590Q-85 590 -50 618T-5 686L-2 694H73V690Q53 610 -10 559T-142 508",
        775: "-180 578Q-179 579 -170 627T-158 678V680H-54V678Q-56 675 -65 627T-76 578V576H-180V578",
        776: "-273 584Q-272 585 -262 632L-252 678V680H-154V678L-164 632Q-174 585 -175 584Q-175 582 -224 582T-273 584ZM-78 586Q-78 587 -69 632T-58 678V680H40L39 677Q39 676 38 670T34 651T29 628L19 583L-30 582H-79L-78 586",
        778: "-227 597Q-227 639 -186 666T-102 693H-97Q-29 693 -8 649Q-2 637 -2 623Q-2 582 -43 555T-132 527Q-171 527 -199 546T-227 597ZM-59 619Q-59 635 -68 643T-104 652Q-142 652 -156 636T-171 602Q-171 569 -123 569Q-119 569 -111 570T-99 571Q-59 582 -59 619",
        779: "-236 619L-195 694H-149Q-103 694 -103 693L-211 527H-287L-282 536Q-281 539 -236 619ZM-70 619L-29 694H17Q63 694 63 693L-45 527H-121L-116 536Q-115 539 -70 619",
        780: "-283 654H-207L-140 549L-135 542L-16 654H60L-109 487H-147L-184 488L-234 570Q-283 653 -283 654",
        913: "28 0L429 694H533L585 350Q596 275 610 182T632 46L638 3V0H530L528 18Q527 25 515 103T503 183H223L135 29L118 1L73 0H28ZM492 254Q492 256 473 398T454 589V610Q433 552 290 301L264 255L378 254H492",
        914: "501 363Q557 355 605 316T653 222Q653 148 586 85T403 2Q394 1 240 0Q90 0 90 1L100 46Q109 90 128 177T164 348L238 694H375Q518 693 546 688Q614 674 655 635T696 544Q696 490 648 441T516 368L501 363ZM601 530Q601 568 566 590T479 621Q472 622 394 623H320L297 513Q292 489 286 459T276 415L273 401V399H339H372Q504 399 571 466Q601 498 601 530ZM257 322Q256 320 230 197T203 73Q203 71 289 71Q379 72 387 73Q459 84 507 122T556 210Q556 255 519 283T428 320Q415 322 336 323Q257 323 257 322",
        915: "87 2Q88 4 160 346T234 689Q234 691 440 691T646 689Q643 686 629 611H475L321 612Q193 4 191 2V0H87V2",
        916: "273 343L510 694H617Q790 2 790 0H416L42 1L273 343ZM539 576Q536 597 536 600Q536 602 535 605Q534 607 534 607Q527 580 222 130L201 98H651L648 110Q645 123 639 149T627 198Q554 489 539 576",
        917: "86 2Q88 4 160 346T233 689Q233 691 461 691Q688 691 688 689Q685 686 671 611H495L320 612L319 609Q319 607 297 501L274 397H436Q597 397 597 396L596 391Q595 386 593 376T589 358L581 322L420 321Q258 321 258 320Q209 89 208 87Q208 85 390 85Q417 85 460 85T518 86L572 85Q556 8 554 2V0H86V2",
        918: "67 54Q551 615 551 617Q543 618 517 618Q510 618 463 618T376 617Q200 617 200 618T209 657L216 694H459Q702 694 702 692Q702 689 697 667L692 643L207 80H392Q493 81 577 81Q577 70 560 2V0H55V2L67 54",
        919: "517 2Q518 3 551 161T585 322Q586 323 557 323T422 323H259L190 0H138Q86 0 86 1L96 46Q105 90 124 177T160 348L234 694H337V691Q336 690 306 545T275 399H602L603 403Q603 407 634 551L665 694H768V691Q768 690 695 348T621 2V0H517V2",
        920: "119 260Q119 348 157 433T254 579T387 677T533 715Q701 715 772 574Q804 511 804 431Q804 315 744 209T586 41T384 -22Q262 -22 191 59T119 260ZM706 426Q706 524 655 582T525 640Q454 640 395 600T293 502Q256 447 237 383T218 266Q218 168 269 112T401 55Q518 55 612 166T706 426ZM283 349L293 397H473Q652 397 652 396Q647 374 642 347L632 299H452Q273 299 273 300Q278 322 283 349",
        921: "161 348L235 694H338V691Q338 690 265 348T191 2V0H139Q87 0 87 1L96 46Q106 90 125 177T161 348",
        922: "236 223Q235 222 213 113T188 2V0H138Q88 0 88 1L98 46Q107 90 126 177T162 348L236 694H285Q335 694 335 693L330 671Q326 649 316 603T298 518Q289 477 280 433T266 366L261 343L672 694H729L784 693L465 420L651 0H596L541 1L384 350Q383 351 310 288T236 223",
        923: "28 0L401 694H504V690Q505 686 543 345T582 1Q582 0 528 0H473V3Q472 6 460 113T435 359T422 558Q422 593 424 603L425 610L424 608Q414 572 343 431Q287 316 143 49L117 1L73 0H28",
        924: "375 691Q456 215 459 124V106Q488 177 762 641L793 694H929V691Q929 690 856 348T782 2V0H689V2Q691 4 753 304Q817 604 818 606Q819 611 817 608Q817 607 815 603Q798 559 540 117L484 22H440L397 23L393 42Q393 47 373 169T334 422T315 594V609L250 306Q186 3 185 2Q185 0 138 0Q92 0 92 1L102 46Q111 90 130 177T166 348L240 694H375V691",
        925: "311 609Q310 608 246 306T181 2V0H134Q88 0 88 1L98 46Q107 90 126 177T162 348L236 694H382L383 691Q383 688 418 561T493 286T541 97L544 84L545 89Q545 90 553 128T578 246T610 394L674 694H766V691Q766 690 693 348T619 2V0H472L469 13Q468 17 393 293T312 605L311 609",
        926: "193 687Q193 688 479 688H765V686Q764 685 755 642L747 600H461L175 601Q175 602 184 645L193 687ZM196 400Q196 401 418 401T640 400L622 315Q622 314 400 314T178 315L196 400ZM42 2Q43 3 51 44T60 87H64Q68 87 75 87T93 87T119 87T151 88T190 88T237 88T291 88T352 88H643Q638 66 634 44T627 13T624 2V0H42V2",
        927: "118 254Q118 366 174 473T324 648T517 716Q627 716 695 638T763 435Q763 321 706 215T555 43T362 -22Q256 -22 187 56T118 254ZM380 58Q452 58 518 116T622 263T661 442Q661 496 646 535T608 594T567 622T534 634Q516 636 496 636Q400 636 313 528T225 264Q225 172 267 115T380 58",
        928: "86 2Q88 4 160 346T233 689Q233 691 501 691Q768 691 768 689Q766 688 694 346T621 2V0H517V2Q518 3 582 304T646 609L648 615H321L190 0H86V2",
        929: "162 348L236 694H378Q522 693 530 692Q604 680 647 635T690 524Q690 474 665 430T612 359Q550 299 465 280Q443 275 343 274H250V271Q250 269 235 201T206 68T192 2V0H140Q88 0 88 1L98 46Q107 90 126 177T162 348ZM594 513Q594 560 562 588T477 622Q470 623 394 623H321L293 487L263 349V347H342H347H375Q530 347 578 449Q594 483 594 513",
        931: "194 655L202 694H508Q813 694 813 693Q809 675 805 653L797 614H559L321 615Q327 606 405 478L485 347Q449 311 348 203T247 86Q247 84 294 84Q303 84 359 84T465 85H684Q684 84 675 42L666 0H360L55 1L195 154Q346 319 347 320L359 333L273 473Q187 614 186 614L187 620Q188 625 190 635T194 655",
        932: "165 608L182 687Q182 688 486 688H790L789 685L781 645L773 609H521L457 306Q393 3 392 2Q392 0 340 0H288V2Q289 5 353 304T417 605V609L291 608H165",
        933: "357 637Q320 637 297 612T266 555H173Q178 576 188 598Q214 651 265 683T373 716Q497 716 497 542V509L504 526Q579 715 711 715Q773 715 808 677T843 589Q843 576 840 555H747L748 557Q748 559 748 563T749 574V580Q749 604 731 622Q715 638 693 638Q591 638 543 465Q531 425 506 309T462 98T441 2V0H337V2Q425 401 436 486Q438 504 438 526Q438 637 364 637H357",
        934: "124 308Q124 399 208 481T433 587Q437 587 437 589Q438 590 449 643L459 694H508Q557 694 557 693Q557 691 546 641T535 587Q543 587 562 583T614 565T674 531T722 472T743 387Q743 288 656 209T449 110L433 106Q411 3 410 2Q410 0 361 0H312L313 3Q313 5 324 56L335 107H331L321 108Q311 110 297 114T266 124T228 141T190 168Q124 225 124 308ZM227 315Q227 282 239 257T270 218T306 197T338 186L350 184H351L386 346Q420 507 420 509H419Q411 509 393 505T342 485T284 444Q227 387 227 315ZM642 381Q642 413 629 437T599 475T563 496T533 507T519 510Q518 510 484 348T450 184Q544 201 593 258T642 381",
        935: "14 0Q17 3 184 184T352 367L265 529Q244 567 222 609T188 672L176 692Q176 694 236 694H297L338 612Q387 515 400 489L421 448L645 694H758L708 640Q481 393 456 368Q455 366 500 281T596 104T652 0H531L388 293L128 0H14",
        936: "325 556Q325 524 310 447T294 330Q294 289 304 260Q314 234 333 216T364 192T380 187L488 694H585V691Q584 689 531 438L478 188H479Q485 188 503 195T555 231T613 305Q637 352 654 435Q662 470 669 496T681 538T690 562T698 578T704 587Q719 609 733 615T772 621H802H854V619L838 546Q838 545 832 545Q775 539 749 418Q716 274 638 196Q616 173 590 156T543 131T503 117T473 110T460 106Q460 105 450 54T438 2V0H340V2Q341 3 351 54T362 106Q363 107 358 108T344 111T322 117T295 128T267 145T239 171T216 207T200 256T194 319Q194 356 203 408T213 483Q213 517 203 530T182 544T171 546Q184 609 187 619V621H239Q286 621 294 620T309 612Q325 596 325 556",
        937: "148 407Q148 475 182 534T269 633T386 694T511 716Q622 716 695 658T769 507Q769 461 747 409T699 321T628 225T562 136Q533 90 533 86Q542 85 557 85Q564 85 583 85T614 86Q695 86 695 85Q679 9 677 2V0H425Q426 3 433 30T447 72T480 131T549 241L554 248Q558 254 563 261T576 281T592 306T609 335T625 366T640 400T653 434T661 466T664 498Q664 562 618 601T497 640Q416 640 351 596T262 482Q250 441 250 392T276 237T302 70V56Q302 28 296 2V0H44V2L62 85Q62 86 143 86L225 85V88Q224 89 224 89T224 91T224 95T223 101T222 110T220 123T216 140T209 163T200 191T188 227Q148 344 148 407",
        8211: "59 275L66 312H316Q565 312 565 311T558 275T549 238Q549 236 299 236Q50 236 50 237L52 242Q53 247 55 257T59 275",
        8212: "59 275L66 312H566Q1065 312 1065 311T1058 275T1049 238Q1049 236 549 236Q50 236 50 237L52 242Q53 247 55 257T59 275",
        8213: "59 275L66 312H566Q1065 312 1065 311T1058 275T1049 238Q1049 236 549 236Q50 236 50 237L52 242Q53 247 55 257T59 275",
        8215: "59 -75L66 -38H316Q565 -38 565 -39T558 -75T549 -112Q549 -114 299 -114Q50 -114 50 -113L52 -108Q53 -103 55 -93T59 -75",
        8216: "309 567L299 520Q289 474 288 473Q288 471 239 471T190 473L192 480Q193 486 196 499T201 522L211 569L287 694H312L335 693L332 685Q328 677 321 661T307 630L279 570L294 569Q309 569 309 567",
        8217: "228 647L237 694H286Q335 694 335 693L334 686Q332 680 330 668T325 644L315 597L239 471H214Q190 471 190 472L246 595Q246 596 231 596H217V598Q217 601 228 647",
        8220: "393 567L383 520Q373 474 372 473Q372 471 323 471T274 473L276 480Q277 486 280 499T285 522L295 569L371 694H396L419 693L416 685Q412 677 405 661T391 630L363 570L378 569Q393 569 393 567ZM587 567L577 520Q567 474 566 473Q566 471 517 471T468 473L470 480Q471 486 474 499T479 522L489 569L565 694H590L613 693L610 685Q606 677 599 661T585 630L557 570L572 569Q587 569 587 567",
        8221: "171 647L180 694H229Q278 694 278 693L276 686Q275 680 273 668T268 644L258 597L182 471H157Q133 471 133 472L189 595Q189 596 174 596H160V598Q160 601 171 647ZM365 647L374 694H423Q472 694 472 693L470 686Q469 680 467 668T462 644L452 597L376 471H351Q327 471 327 472L383 595Q383 596 368 596H354V598Q354 601 365 647",
        8260: "564 744L568 747Q573 750 579 750Q588 750 594 744T599 729Q597 721 321 241T41 -243Q37 -250 27 -250Q6 -250 6 -230Q6 -228 8 -222Q9 -219 285 261T564 744",
        8710: "273 343L510 694H617Q790 2 790 0H416L42 1L273 343ZM539 576Q536 597 536 600Q536 602 535 605Q534 607 534 607Q527 580 222 130L201 98H651L648 110Q645 123 639 149T627 198Q554 489 539 576"
      }, {});
      return sansSerifItalic$1;
    }
    var sansSerif$1 = {};
    var sansSerif = {};
    var hasRequiredSansSerif$1;
    function requireSansSerif$1() {
      if (hasRequiredSansSerif$1) return sansSerif;
      hasRequiredSansSerif$1 = 1;
      Object.defineProperty(sansSerif, "__esModule", { value: true });
      sansSerif.sansSerif = void 0;
      sansSerif.sansSerif = {
        33: [0.694, 0, 0.319],
        34: [0.694, -0.471, 0.5],
        35: [0.694, 0.194, 0.833],
        36: [0.75, 0.056, 0.5],
        37: [0.75, 0.056, 0.833],
        38: [0.716, 0.022, 0.758],
        39: [0.694, -0.471, 0.278],
        40: [0.75, 0.25, 0.389],
        41: [0.75, 0.25, 0.389],
        42: [0.75, -0.306, 0.5],
        43: [0.583, 0.082, 0.778],
        44: [0.098, 0.125, 0.278],
        45: [0.259, -0.186, 0.333],
        46: [0.098, 0, 0.278],
        47: [0.75, 0.25, 0.5],
        58: [0.444, 0, 0.278],
        59: [0.444, 0.125, 0.278],
        61: [0.37, -0.13, 0.778],
        63: [0.704, 0, 0.472],
        64: [0.704, 0.011, 0.667],
        91: [0.75, 0.25, 0.289],
        93: [0.75, 0.25, 0.289],
        94: [0.694, -0.527, 0.5],
        95: [-0.038, 0.114, 0.5],
        126: [0.327, -0.193, 0.5],
        305: [0.444, 0, 0.239],
        567: [0.444, 0.205, 0.267],
        768: [0.694, -0.527, 0],
        769: [0.694, -0.527, 0],
        770: [0.694, -0.527, 0],
        771: [0.677, -0.543, 0],
        772: [0.631, -0.552, 0],
        774: [0.694, -0.508, 0],
        775: [0.68, -0.576, 0],
        776: [0.68, -0.582, 0],
        778: [0.694, -0.527, 0],
        779: [0.694, -0.527, 0],
        780: [0.654, -0.487, 0],
        913: [0.694, 0, 0.667],
        914: [0.694, 0, 0.667],
        915: [0.691, 0, 0.542],
        916: [0.694, 0, 0.833],
        917: [0.691, 0, 0.597],
        918: [0.694, 0, 0.611],
        919: [0.694, 0, 0.708],
        920: [0.716, 0.021, 0.778],
        921: [0.694, 0, 0.278],
        922: [0.694, 0, 0.694],
        923: [0.694, 0, 0.611],
        924: [0.694, 0, 0.875],
        925: [0.694, 0, 0.708],
        926: [0.688, 0, 0.667],
        927: [0.715, 0.022, 0.736],
        928: [0.691, 0, 0.708],
        929: [0.694, 0, 0.639],
        931: [0.694, 0, 0.722],
        932: [0.688, 0, 0.681],
        933: [0.716, 0, 0.778],
        934: [0.694, 0, 0.722],
        935: [0.694, 0, 0.667],
        936: [0.694, 0, 0.778],
        937: [0.716, 0, 0.722],
        8211: [0.312, -0.236, 0.5],
        8212: [0.312, -0.236, 1],
        8213: [0.312, -0.236, 1],
        8215: [-0.038, 0.114, 0.5],
        8216: [0.694, -0.471, 0.278],
        8217: [0.694, -0.471, 0.278],
        8220: [0.694, -0.471, 0.5],
        8221: [0.694, -0.471, 0.5],
        8260: [0.75, 0.25, 0.5],
        8710: [0.694, 0, 0.833]
      };
      return sansSerif;
    }
    var hasRequiredSansSerif;
    function requireSansSerif() {
      if (hasRequiredSansSerif) return sansSerif$1;
      hasRequiredSansSerif = 1;
      Object.defineProperty(sansSerif$1, "__esModule", { value: true });
      sansSerif$1.sansSerif = void 0;
      var FontData_js_1 = requireFontData();
      var sans_serif_js_1 = requireSansSerif$1();
      sansSerif$1.sansSerif = (0, FontData_js_1.AddPaths)(sans_serif_js_1.sansSerif, {
        33: "120 187Q120 225 115 440T110 693Q110 694 159 694T208 693Q208 655 203 440T198 187Q198 186 159 186T120 187ZM110 0V98H208V0H110",
        34: "33 596V694H131V597L82 471H32L47 532Q62 593 63 594Q63 596 48 596H33ZM227 596V694H325V597L276 471H226L241 532Q256 593 257 594Q257 596 242 596H227",
        35: "56 350Q56 363 70 370H192Q314 370 314 371L356 526Q396 676 401 685Q406 694 416 694Q423 694 429 689T436 677Q436 673 396 523T355 371Q355 370 449 370Q544 370 544 371L586 526Q628 682 630 685Q636 694 646 694Q653 694 659 689T665 678Q665 670 645 593T605 444L585 371Q585 370 673 370H762Q777 362 777 350Q777 337 767 334T723 330H668H573L567 305Q560 282 545 226L530 171L646 170H721Q756 170 766 167T777 150Q777 138 762 130H640Q518 130 518 129L476 -26Q434 -182 432 -185Q426 -194 416 -194Q409 -194 403 -189T397 -178Q397 -170 417 -93T457 56L477 129Q477 130 383 130Q288 130 288 129L246 -26Q204 -182 202 -185Q196 -194 186 -194Q179 -194 173 -189T167 -178Q167 -170 187 -94T227 56L247 129Q247 130 159 130H70Q56 137 56 150Q56 165 72 170H259L265 195Q273 222 287 275L302 330H186L70 331Q63 334 58 339Q56 343 56 350ZM489 170L532 330H343L337 305Q330 282 315 226L300 171L394 170H489",
        36: "55 509Q55 585 103 638T213 701V750H286V703H289Q312 703 354 689Q372 682 399 666T427 646L413 569Q413 568 403 575Q352 615 291 624H286V405Q357 389 400 331T444 199Q444 128 402 69T286 -7V-56H213V-9Q167 -3 125 14T63 44T44 60Q44 61 52 101L59 140L69 132Q78 125 87 119T107 107T124 97T141 90T157 84T173 80T187 76T201 73T213 70V317L202 319Q141 335 98 386T55 509ZM213 424V620L203 615Q143 587 143 522Q143 455 213 424ZM356 187Q356 208 350 227T334 258T315 280T298 293T287 297Q286 297 286 186V75Q356 110 356 187",
        37: "56 549Q56 639 98 694T195 750Q248 750 290 694T332 548Q332 455 290 401T195 347Q141 347 99 403T56 549ZM248 549Q248 602 234 638T195 674Q145 674 145 549Q145 423 195 423Q219 423 233 459T248 549ZM197 -56Q187 -56 182 -49T176 -35Q176 -33 178 -27Q179 -25 399 356T623 741Q626 750 639 750Q648 750 654 744T659 729Q657 721 435 336T207 -52Q203 -56 197 -56ZM500 146Q500 235 542 291T639 347Q692 347 734 293T776 146Q776 53 733 -1T639 -56Q587 -56 544 -2T500 146ZM692 146Q692 199 678 235T639 271Q589 271 589 146Q589 20 639 20Q663 20 677 56T692 146",
        38: "156 502Q156 600 198 658T302 716Q367 716 405 665T444 549Q444 531 442 523Q426 446 304 348L287 334Q305 297 340 249T402 170T430 139T443 149T472 181T509 231T549 303T583 394Q584 398 586 404Q587 408 587 409Q588 409 626 399T665 388Q663 381 660 369T644 322T614 253T567 176T502 98L491 87Q534 57 584 57Q653 57 700 75Q702 75 702 34T700 -7Q652 -22 586 -22H580Q505 -22 434 26L421 34Q419 33 405 25T374 11T336 -4T285 -17T226 -22Q143 -22 93 31T42 152Q42 184 51 211T81 260T111 291T144 317L184 348L178 365Q156 430 156 502ZM359 552Q359 588 345 614T302 640Q292 640 282 636T260 622T241 590T233 535Q236 474 253 417L257 407L271 419Q312 454 330 479Q359 514 359 552ZM345 102Q262 190 216 277Q215 277 204 267T180 247T165 236Q135 208 135 159Q135 123 152 97T198 61Q207 58 227 58Q286 58 357 89L345 102",
        39: "90 596V694H188V597L139 471H89L104 532Q119 593 120 594Q120 596 105 596H90",
        40: "74 250Q74 564 240 733L257 750H333L323 739Q167 573 167 250T323 -239L333 -250H257L240 -233Q74 -63 74 250",
        41: "221 -73T221 250T65 739L55 750H131L148 733Q314 567 314 250T148 -233L131 -250H55L65 -239Q221 -73 221 250",
        42: "208 717Q211 731 222 740T250 750Q265 750 277 741T291 717Q291 706 290 675T286 617L285 591L329 622Q369 651 376 655T393 659Q411 659 423 647T436 616Q436 609 434 603T429 594T419 585T407 577T389 567T368 556L316 528L368 500Q421 472 429 464Q436 455 436 440Q436 422 423 409T393 396Q390 396 388 396T384 397T380 398T375 401T367 406T358 413T346 422T329 434L285 465Q284 465 285 438T289 381T291 347Q291 327 278 317T250 306Q234 306 222 315T208 339Q208 350 209 381T212 439L214 465L170 434Q130 405 123 401T106 397Q88 397 76 409T63 440Q63 447 65 453T70 462T80 471T92 479T110 489T131 500L183 528L131 556Q78 584 70 592Q63 601 63 616Q63 634 76 647T106 660Q109 660 111 660T115 659T119 658T124 655T132 650T141 643T153 634T170 622L214 591L212 617Q211 643 210 674T208 717",
        43: "56 237T56 250T70 270H369V420L370 570Q380 583 389 583Q402 583 409 568V270H707Q722 262 722 250T707 230H409V-68Q401 -82 391 -82H389H387Q375 -82 369 -68V230H70Q56 237 56 250",
        44: "90 0V98H188V1L139 -125H89L104 -64Q119 -3 120 -2Q120 0 105 0H90",
        45: "11 186V259H277V186H11",
        46: "90 0V98H188V0H90",
        47: "423 750Q432 750 438 744T444 730Q444 725 271 248T92 -240Q85 -250 75 -250Q68 -250 62 -245T56 -231Q56 -221 230 257T407 740Q411 750 423 750",
        58: "90 346V444H188V346H90ZM90 0V98H188V0H90",
        59: "90 346V444H188V346H90ZM90 0V98H188V1L139 -125H89L104 -64Q119 -3 120 -2Q120 0 105 0H90",
        61: "56 350Q56 363 70 370H707Q722 362 722 350Q722 339 708 331L390 330H72Q56 335 56 350ZM56 150Q56 165 72 170H708Q722 160 722 150Q722 138 707 130H70Q56 137 56 150",
        63: "55 652Q63 658 77 666T132 689T214 704T265 703Q303 698 332 684T376 653T401 615T413 578T416 546Q416 475 360 426Q325 396 303 365T273 303T263 256T261 216V186H183V225Q184 281 194 322Q206 368 232 409T276 469T306 495Q323 517 323 550Q323 596 297 612T223 629Q187 629 157 618Q122 607 91 583L83 576L55 652ZM173 0V98H271V0H173",
        64: "422 576Q440 576 456 573T480 566L488 563Q488 565 484 571T472 588T452 607T424 622T387 629Q294 629 220 550T146 347Q146 233 210 155T365 66Q376 65 400 65Q465 68 517 86L532 91H612L598 76Q511 -11 388 -11Q250 -11 153 93T56 347Q56 454 107 538T231 663T378 704Q446 704 492 680T564 608T599 506T611 376Q611 320 607 299Q595 227 546 173T422 118Q343 118 288 185T232 347Q232 444 287 510T422 576ZM520 347Q520 429 487 465T421 501Q385 501 354 461T323 347Q323 270 355 232T422 193Q454 193 487 229T520 347",
        91: "94 -250V750H266V674H181V-174H266V-250H94",
        93: "22 674V750H194V-250H22V-174H107V674H22",
        94: "146 612L212 694H287L353 612Q417 532 420 529Q421 528 418 527Q414 527 383 527H345L250 639Q244 633 199 580L154 527H116Q79 528 79 529Q82 532 146 612",
        95: "0 -114V-38H499V-114H0",
        126: "83 204Q86 254 113 290T186 327Q211 327 251 299T312 270Q337 270 340 315V327H416V316Q413 258 382 226T315 193Q289 193 249 221T187 250Q162 250 159 205V193H83V204",
        305: "74 0V444H164V0H74",
        567: "-35 -95Q-4 -126 34 -126Q58 -126 76 -116T100 -88Q102 -82 102 181V444H192V180Q191 -45 191 -70T184 -113Q171 -152 140 -178T63 -205Q34 -205 4 -197T-43 -181T-59 -171L-47 -133L-35 -95",
        768: "-415 692L-417 694H-324L-262 612Q-249 594 -233 572T-208 539L-200 528L-237 527H-275L-344 608Q-359 625 -378 647T-406 680T-415 692",
        769: "-239 612L-177 694H-84L-86 692Q-86 691 -95 681T-123 648T-157 608L-226 527H-264L-301 528L-293 539Q-285 550 -269 572T-239 612",
        770: "-354 612L-288 694H-213L-147 612Q-83 532 -80 529Q-79 528 -82 527Q-86 527 -117 527H-155L-250 639Q-256 633 -301 580L-346 527H-384Q-421 528 -421 529Q-418 532 -354 612",
        771: "-417 554Q-414 604 -387 640T-314 677Q-289 677 -249 649T-188 620Q-163 620 -160 665V677H-84V666Q-87 608 -118 576T-185 543Q-211 543 -251 571T-313 600Q-338 600 -341 555V543H-417V554",
        772: "-431 552V631H-70V552H-431",
        774: "-250 508Q-331 508 -379 567T-427 689V694H-351V685Q-348 649 -321 620T-250 591Q-206 591 -180 619T-150 685V694H-74V689Q-74 624 -122 566T-250 508",
        775: "-302 576V680H-198V576H-302",
        776: "-397 582V680H-299V582H-397ZM-202 582V680H-104V582H-202",
        778: "-319 611Q-319 649 -285 671T-211 694Q-164 694 -132 671T-99 611Q-99 572 -133 550T-209 527T-285 549T-319 611ZM-155 610Q-155 635 -171 643T-215 651Q-263 651 -263 610Q-263 570 -211 570H-209H-207Q-155 570 -155 610",
        779: "-250 693Q-317 544 -323 527H-399L-343 694H-296Q-250 694 -250 693ZM-84 693Q-151 544 -157 527H-233L-177 694H-130Q-84 694 -84 693",
        780: "-421 652Q-422 653 -419 654Q-415 654 -384 654H-346L-301 601Q-287 585 -275 571T-258 551T-250 542L-155 654H-117Q-80 653 -80 652Q-83 649 -147 569L-213 487H-288L-354 569Q-418 649 -421 652",
        913: "183 181Q183 179 152 91T118 0H28L154 346L280 693Q281 694 333 694H385L511 349Q636 4 638 2Q638 0 584 0H530L464 183H184L183 181ZM324 606Q319 578 292 492T238 332T210 256Q210 254 324 254T438 255L429 281L419 308Q409 336 395 378T365 465T339 551T324 611V606",
        914: "425 363Q438 363 465 353T526 324T585 270T610 192Q610 132 561 78T426 7Q404 2 387 2T240 0H90V694H227Q373 693 396 689Q484 673 533 623T583 517Q583 494 574 473T551 437T520 409T487 388T456 374T433 366L425 363ZM490 516Q490 527 485 539T467 568T423 599T347 621Q340 622 262 623H188V399H261H286Q432 399 478 475Q490 496 490 516ZM514 190Q514 245 462 280T343 322Q336 323 259 323H188V71H274Q365 72 388 77Q445 88 479 121T514 190",
        915: "87 0V691H499V611H345L191 612V0H87",
        916: "203 348L362 694H470L629 348Q789 2 790 1Q790 0 416 0T42 1Q43 2 203 348ZM630 98Q630 100 584 198T481 422T407 603L405 610L403 600Q388 544 191 122L180 99L405 98H630",
        917: "86 0V691H541V611H366L190 612V397H513V321H190V85H372L554 86V0H86",
        918: "69 617V694H555V643L373 362Q190 81 190 79H234Q244 79 272 79T344 80T419 81H560V0H55V53L237 334Q420 615 420 617Q413 618 387 618Q380 618 334 618T245 617H69",
        919: "86 0V694H190V399H517V694H621V0H517V323H190V0H86",
        920: "56 344Q56 430 86 502T164 619T271 690T388 716Q448 716 506 691T613 619T692 501T722 344Q722 188 624 84T389 -21Q252 -21 154 83T56 344ZM624 345Q624 423 597 488T513 596T380 639Q343 639 305 621T232 568T175 475T153 344Q153 216 222 136T388 56Q487 56 555 138T624 345ZM209 299V397H568V299H209",
        921: "87 0V694H191V0H87",
        922: "88 0V694H188V519L189 343L525 694H638L375 419L651 0H541L309 351L188 225V0H88",
        923: "294 606Q294 574 252 430T163 144T117 0H72Q28 0 28 1T141 348L254 694H357L469 348Q582 2 582 1T527 0L473 1L469 11Q469 13 427 141T343 411T296 599L294 610V606",
        924: "92 0V694H228L233 680Q236 675 284 547T382 275T436 106Q446 149 497 292T594 558L640 680L645 694H782V0H689V305L688 606Q688 577 500 78L479 23H392L364 96Q364 97 342 156T296 280T246 418T203 544T186 609V588Q185 568 185 517T185 427T185 305V0H92",
        925: "88 0V694H235L252 659Q261 639 364 428T526 84V694H619V0H472L455 35Q453 39 330 294T185 601L181 611V0H88",
        926: "47 600V688H619V600H47ZM111 314V401H555V314H111ZM42 0V88H624V0H42",
        927: "55 345Q55 504 149 609T361 715Q386 715 406 713Q521 696 600 592T680 344Q680 193 590 86T368 -22Q239 -22 147 84T55 345ZM276 59T368 59T518 146T576 360Q576 473 525 545T401 634Q371 637 362 637Q284 637 222 562T159 360T217 147",
        928: "86 0V691H621V0H517V615H190V0H86",
        929: "88 0V694H230Q347 693 370 692T410 686Q487 667 535 611T583 485Q583 409 527 348T379 276Q369 274 279 274H192V0H88ZM486 485Q486 523 471 551T432 593T391 612T357 621Q350 622 268 623H189V347H268Q350 348 357 349Q370 351 383 354T416 368T450 391T475 429T486 485",
        931: "55 0Q56 3 171 167T288 332Q288 334 172 474L55 615V694H666V614H428L190 615L412 347L322 218Q236 97 228 84L447 85H666V0H55",
        932: "36 608V688H644V608H518L392 609V0H288V609L162 608H36",
        933: "55 565Q59 625 105 670T219 716H222Q310 716 353 627Q376 583 386 524L389 510L393 532Q397 555 407 584T433 644T482 695T557 716Q621 716 669 673T722 565V555H629V563Q627 592 607 615T557 638Q530 638 511 629T479 598T459 553T447 488T442 411T441 319V202V0H337V202Q337 453 331 497Q313 634 226 638Q185 638 167 612T148 563V555H55V565",
        934: "666 347Q666 326 661 302T638 247T594 190T520 140T413 107H410V0H312V54Q312 107 311 107Q286 107 229 128T125 192Q55 260 55 347Q55 396 77 438T131 507T200 552T265 579T311 587Q312 587 312 641V694H410V587H413Q476 576 524 552T598 502T640 444T661 390T666 347ZM310 510Q305 510 291 507T252 492T208 464T172 416T157 347T171 279T204 233T247 205T286 190T310 184H312V347Q312 510 310 510ZM564 347Q564 385 549 416T514 463T470 491T433 505T414 509L410 510V184Q413 184 426 187T464 200T510 227T548 275T564 347",
        935: "14 0Q16 5 144 184T275 367L153 528Q121 571 88 615T42 674T28 694H150L228 584Q315 463 316 461L326 448L497 694H610L609 692Q606 689 492 528Q440 454 409 410T378 366Q378 365 515 182L652 0H531L326 292Q326 293 299 254T226 146L128 0H14",
        936: "340 187V694H438V187Q481 206 495 219Q518 239 533 267T553 332T560 386T562 435Q562 576 593 608Q608 621 637 621H670H722V545H719Q718 545 715 545T710 544Q679 536 666 487Q664 474 662 429T654 344T633 259T580 175T486 119Q450 109 438 108V0H340V108L326 110Q122 149 117 415Q116 460 111 487Q98 536 67 544Q65 544 62 544T58 545H55V621H107Q160 621 163 620Q191 613 202 573Q213 536 213 473T220 351T256 249Q262 239 270 230T285 216T301 205T316 197T329 192T340 187",
        937: "55 462Q55 561 141 638T359 716Q492 716 579 640T666 462Q666 407 642 347T579 222T529 126Q515 91 515 86Q517 85 528 85Q530 85 552 85T596 86H677V0H425V14Q429 79 465 168L492 228Q494 232 504 254T516 283T527 310T539 340T548 368T556 399T560 428T562 460Q562 531 510 585T361 639Q263 639 211 585T159 460Q159 422 170 378T192 309T229 228L256 168Q292 79 296 14V0H44V86H125Q146 86 168 86T193 85L206 86Q206 103 183 148T131 241T79 352T55 462",
        8211: "0 236V312H499V236H0",
        8212: "0 236V312H999V236H0",
        8213: "0 236V312H999V236H0",
        8215: "0 -114V-38H499V-114H0",
        8216: "90 568L140 694H189L174 633Q159 572 158 571Q158 569 173 569H188V471H90V568",
        8217: "90 596V694H188V597L139 471H89L104 532Q119 593 120 594Q120 596 105 596H90",
        8220: "174 568L224 694H273L258 633Q243 572 242 571Q242 569 257 569H272V471H174V568ZM368 568L418 694H467L452 633Q437 572 436 571Q436 569 451 569H466V471H368V568",
        8221: "33 596V694H131V597L82 471H32L47 532Q62 593 63 594Q63 596 48 596H33ZM227 596V694H325V597L276 471H226L241 532Q256 593 257 594Q257 596 242 596H227",
        8260: "423 750Q432 750 438 744T444 730Q444 725 271 248T92 -240Q85 -250 75 -250Q68 -250 62 -245T56 -231Q56 -221 230 257T407 740Q411 750 423 750",
        8710: "203 348L362 694H470L629 348Q789 2 790 1Q790 0 416 0T42 1Q43 2 203 348ZM630 98Q630 100 584 198T481 422T407 603L405 610L403 600Q388 544 191 122L180 99L405 98H630"
      }, {});
      return sansSerif$1;
    }
    var scriptBold$1 = {};
    var scriptBold = {};
    var hasRequiredScriptBold$1;
    function requireScriptBold$1() {
      if (hasRequiredScriptBold$1) return scriptBold;
      hasRequiredScriptBold$1 = 1;
      Object.defineProperty(scriptBold, "__esModule", { value: true });
      scriptBold.scriptBold = void 0;
      scriptBold.scriptBold = {};
      return scriptBold;
    }
    var hasRequiredScriptBold;
    function requireScriptBold() {
      if (hasRequiredScriptBold) return scriptBold$1;
      hasRequiredScriptBold = 1;
      (function(exports2) {
        Object.defineProperty(exports2, "__esModule", { value: true });
        exports2.scriptBold = void 0;
        var script_bold_js_1 = requireScriptBold$1();
        Object.defineProperty(exports2, "scriptBold", { enumerable: true, get: function() {
          return script_bold_js_1.scriptBold;
        } });
      })(scriptBold$1);
      return scriptBold$1;
    }
    var script$1 = {};
    var script = {};
    var hasRequiredScript$1;
    function requireScript$1() {
      if (hasRequiredScript$1) return script;
      hasRequiredScript$1 = 1;
      Object.defineProperty(script, "__esModule", { value: true });
      script.script = void 0;
      script.script = {};
      return script;
    }
    var hasRequiredScript;
    function requireScript() {
      if (hasRequiredScript) return script$1;
      hasRequiredScript = 1;
      (function(exports2) {
        Object.defineProperty(exports2, "__esModule", { value: true });
        exports2.script = void 0;
        var script_js_1 = requireScript$1();
        Object.defineProperty(exports2, "script", { enumerable: true, get: function() {
          return script_js_1.script;
        } });
      })(script$1);
      return script$1;
    }
    var smallop$1 = {};
    var smallop = {};
    var hasRequiredSmallop$1;
    function requireSmallop$1() {
      if (hasRequiredSmallop$1) return smallop;
      hasRequiredSmallop$1 = 1;
      Object.defineProperty(smallop, "__esModule", { value: true });
      smallop.smallop = void 0;
      smallop.smallop = {
        40: [0.85, 0.349, 0.458],
        41: [0.85, 0.349, 0.458],
        47: [0.85, 0.349, 0.578],
        91: [0.85, 0.349, 0.417],
        92: [0.85, 0.349, 0.578],
        93: [0.85, 0.349, 0.417],
        123: [0.85, 0.349, 0.583],
        125: [0.85, 0.349, 0.583],
        710: [0.744, -0.551, 0.556],
        732: [0.722, -0.597, 0.556],
        770: [0.744, -0.551, 0],
        771: [0.722, -0.597, 0],
        8214: [0.602, 0, 0.778],
        8260: [0.85, 0.349, 0.578],
        8593: [0.6, 0, 0.667],
        8595: [0.6, 0, 0.667],
        8657: [0.599, 0, 0.778],
        8659: [0.6, 0, 0.778],
        8719: [0.75, 0.25, 0.944],
        8720: [0.75, 0.25, 0.944],
        8721: [0.75, 0.25, 1.056],
        8730: [0.85, 0.35, 1, { ic: 0.02 }],
        8739: [0.627, 0.015, 0.333],
        8741: [0.627, 0.015, 0.556],
        8747: [0.805, 0.306, 0.472, { ic: 0.138 }],
        8748: [0.805, 0.306, 0.819, { ic: 0.138 }],
        8749: [0.805, 0.306, 1.166, { ic: 0.138 }],
        8750: [0.805, 0.306, 0.472, { ic: 0.138 }],
        8896: [0.75, 0.249, 0.833],
        8897: [0.75, 0.249, 0.833],
        8898: [0.75, 0.249, 0.833],
        8899: [0.75, 0.249, 0.833],
        8968: [0.85, 0.349, 0.472],
        8969: [0.85, 0.349, 0.472],
        8970: [0.85, 0.349, 0.472],
        8971: [0.85, 0.349, 0.472],
        9001: [0.85, 0.35, 0.472],
        9002: [0.85, 0.35, 0.472],
        9168: [0.602, 0, 0.667],
        10072: [0.627, 0.015, 0.333],
        10216: [0.85, 0.35, 0.472],
        10217: [0.85, 0.35, 0.472],
        10752: [0.75, 0.25, 1.111],
        10753: [0.75, 0.25, 1.111],
        10754: [0.75, 0.25, 1.111],
        10756: [0.75, 0.249, 0.833],
        10758: [0.75, 0.249, 0.833],
        10764: [0.805, 0.306, 1.638, { ic: 0.138 }],
        12296: [0.85, 0.35, 0.472],
        12297: [0.85, 0.35, 0.472]
      };
      return smallop;
    }
    var hasRequiredSmallop;
    function requireSmallop() {
      if (hasRequiredSmallop) return smallop$1;
      hasRequiredSmallop = 1;
      Object.defineProperty(smallop$1, "__esModule", { value: true });
      smallop$1.smallop = void 0;
      var FontData_js_1 = requireFontData();
      var smallop_js_1 = requireSmallop$1();
      smallop$1.smallop = (0, FontData_js_1.AddPaths)(smallop_js_1.smallop, {
        40: "152 251Q152 646 388 850H416Q422 844 422 841Q422 837 403 816T357 753T302 649T255 482T236 250Q236 124 255 19T301 -147T356 -251T403 -315T422 -340Q422 -343 416 -349H388Q359 -325 332 -296T271 -213T212 -97T170 56T152 251",
        41: "305 251Q305 -145 69 -349H56Q43 -349 39 -347T35 -338Q37 -333 60 -307T108 -239T160 -136T204 27T221 250T204 473T160 636T108 740T60 807T35 839Q35 850 50 850H56H69Q197 743 256 566Q305 425 305 251",
        47: "481 838Q489 850 500 850Q508 850 515 844T522 827Q521 824 311 248T96 -337Q90 -349 77 -349Q68 -349 62 -343T55 -326Q56 -323 266 253T481 838",
        91: "202 -349V850H394V810H242V-309H394V-349H202",
        92: "522 -326Q522 -337 515 -343T500 -349Q487 -349 481 -337Q477 -328 267 248T55 827Q54 835 60 842T76 850Q89 850 96 838Q100 829 310 253T522 -326",
        93: "22 810V850H214V-349H22V-309H174V810H22",
        123: "477 -343L471 -349H458Q432 -349 367 -325T273 -263Q258 -245 250 -212L249 -51Q249 -27 249 12Q248 118 244 128Q243 129 243 130Q220 189 121 228Q109 232 107 235T105 250Q105 256 105 257T105 261T107 265T111 268T118 272T128 276T142 283T162 291Q224 324 243 371Q243 372 244 373Q248 384 249 469Q249 475 249 489Q249 528 249 552L250 714Q253 728 256 736T271 761T299 789T347 816T422 843Q440 849 441 849H443Q445 849 447 849T452 850T457 850H471L477 844V830Q477 820 476 817T470 811T459 807T437 801T404 785Q353 760 338 724Q333 710 333 550Q333 526 333 492T334 447Q334 393 327 368T295 318Q257 280 181 255L169 251L184 245Q318 198 332 112Q333 106 333 -49Q333 -209 338 -223Q351 -255 391 -277T469 -309Q477 -311 477 -329V-343",
        125: "110 849L115 850Q120 850 125 850Q151 850 215 826T309 764Q324 747 332 714L333 552Q333 528 333 489Q334 383 338 373Q339 372 339 371Q353 336 391 310T469 271Q477 268 477 251Q477 241 476 237T472 232T456 225T428 214Q357 179 339 130Q339 129 338 128Q334 117 333 32Q333 26 333 12Q333 -27 333 -51L332 -212Q328 -228 323 -240T302 -271T255 -307T175 -338Q139 -349 125 -349T108 -346T105 -329Q105 -314 107 -312T130 -304Q233 -271 248 -209Q249 -203 249 -49V57Q249 106 253 125T273 167Q307 213 398 245L413 251L401 255Q265 300 250 389Q249 395 249 550Q249 710 244 724Q224 774 112 811Q105 813 105 830Q105 845 110 849",
        710: "279 669Q273 669 142 610T9 551L0 569Q-8 585 -8 587Q-8 588 -7 588L12 598Q30 608 66 628T136 666L277 744L564 587L555 569Q549 556 547 554T544 552Q539 555 410 612T279 669",
        732: "374 597Q337 597 269 627T160 658Q101 658 34 606L24 597L12 611Q1 624 1 626Q1 627 27 648T55 671Q120 722 182 722Q219 722 286 692T395 661Q454 661 521 713L531 722L543 708Q554 695 554 693Q554 692 528 671T500 648Q434 597 374 597",
        770: "-277 669Q-283 669 -414 610T-547 551L-556 569Q-564 585 -564 587Q-564 588 -563 588L-544 598Q-526 608 -490 628T-420 666L-279 744L8 587L-1 569Q-7 556 -9 554T-12 552Q-17 555 -146 612T-277 669",
        771: "-182 597Q-219 597 -287 627T-396 658Q-455 658 -522 606L-532 597L-544 611Q-555 624 -555 626Q-555 627 -529 648T-501 671Q-436 722 -374 722Q-337 722 -270 692T-161 661Q-102 661 -35 713L-25 722L-13 708Q-2 695 -2 693Q-2 692 -28 671T-56 648Q-122 597 -182 597",
        8214: "257 0V602H300V0H257ZM478 0V602H521V0H478",
        8260: "481 838Q489 850 500 850Q508 850 515 844T522 827Q521 824 311 248T96 -337Q90 -349 77 -349Q68 -349 62 -343T55 -326Q56 -323 266 253T481 838",
        8593: "112 421L120 424Q127 427 136 430T161 441T191 458T224 481T260 510T295 546T328 591L333 600L340 589Q380 527 431 489T555 421V377L543 381Q445 418 368 492L355 504V0H312V504L299 492Q222 418 124 381L112 377V421",
        8595: "312 96V600H355V96L368 108Q445 182 543 219L555 223V179L546 176Q538 173 529 169T505 158T475 141T442 119T407 90T372 53T339 9L334 0L327 11Q287 73 236 111T112 179V223L124 219Q222 182 299 108L312 96",
        8657: "142 329Q300 419 389 599Q389 598 399 579T420 541T452 494T497 438T558 383T636 329T708 294L721 289V246Q718 246 694 256T623 293T532 356L522 364L521 182V0H478V405L466 417Q436 450 389 516Q388 515 378 500T352 463T312 417L300 405V0H257V364L247 356Q202 320 155 293T82 256L57 246V289L70 294Q101 305 142 329",
        8659: "257 236V600H300V195L312 183Q342 150 389 84Q390 85 400 100T426 137T466 183L478 195V600H521V418L522 236L532 244Q576 280 623 307T696 344L721 354V311L708 306Q677 295 636 271Q478 181 389 1Q389 2 379 21T358 59T326 106T281 162T220 217T142 271T70 306L57 311V354Q60 354 83 345T154 308T247 244L257 236",
        8719: "158 656Q147 684 131 694Q110 707 69 710H55V750H888V710H874Q840 708 820 698T795 678T786 656V-155Q798 -206 874 -210H888V-250H570V-210H584Q618 -208 638 -197T663 -178T673 -155V710H270V277L271 -155Q283 -206 359 -210H373V-250H55V-210H69Q103 -208 123 -197T148 -178T158 -155V656",
        8720: "158 656Q147 684 131 694Q110 707 69 710H55V750H373V710H359Q325 708 305 698T280 678T271 656L270 223V-210H673V656Q666 672 663 679T639 697T584 710H570V750H888V710H874Q840 708 820 698T795 678T786 656V-155Q798 -206 874 -210H888V-250H55V-210H69Q103 -208 123 -197T148 -178T158 -155V656",
        8721: "61 748Q64 750 489 750H913L954 640Q965 609 976 579T993 533T999 516H979L959 517Q936 579 886 621T777 682Q724 700 655 705T436 710H319Q183 710 183 709Q186 706 348 484T511 259Q517 250 513 244L490 216Q466 188 420 134T330 27L149 -187Q149 -188 362 -188Q388 -188 436 -188T506 -189Q679 -189 778 -162T936 -43Q946 -27 959 6H999L913 -249L489 -250Q65 -250 62 -248Q56 -246 56 -239Q56 -234 118 -161Q186 -81 245 -11L428 206Q428 207 242 462L57 717L56 728Q56 744 61 748",
        8730: "263 249Q264 249 315 130T417 -108T470 -228L725 302Q981 837 982 839Q989 850 1001 850Q1008 850 1013 844T1020 832V826L741 243Q645 43 540 -176Q479 -303 469 -324T453 -348Q449 -350 436 -350L424 -349L315 -96Q206 156 205 156L171 130Q138 104 137 104L111 130L263 249",
        8739: "146 612Q151 627 166 627Q182 627 187 612Q188 610 188 306T187 0Q184 -15 166 -15Q149 -15 146 0V10Q146 19 146 35T146 73T146 122T145 179T145 241T145 306T145 370T145 433T145 489T146 538T146 576T146 602V612",
        8741: "146 612Q151 627 166 627Q182 627 187 612Q188 610 188 306T187 0Q184 -15 166 -15Q149 -15 146 0V10Q146 19 146 35T146 73T146 122T145 179T145 241T145 306T145 370T145 433T145 489T146 538T146 576T146 602V612ZM368 612Q373 627 388 627Q404 627 409 612Q410 610 410 306T409 0Q406 -15 389 -15Q371 -15 368 0V10Q368 19 368 35T368 73T368 122T367 179T367 241T367 306T367 370T367 433T367 489T368 538T368 576T368 602V612",
        8747: "113 -244Q113 -246 119 -251T139 -263T167 -269Q186 -269 199 -260Q220 -247 232 -218T251 -133T262 -15T276 155T297 367Q300 390 305 438T314 512T325 580T340 647T361 703T390 751T428 784T479 804Q481 804 488 804T501 805Q552 802 581 769T610 695Q610 669 594 657T561 645Q542 645 527 658T512 694Q512 705 516 714T526 729T538 737T548 742L552 743Q552 745 545 751T525 762T498 768Q475 768 460 756T434 716T418 652T407 559T398 444T387 300T369 133Q349 -38 337 -102T303 -207Q256 -306 169 -306Q119 -306 87 -272T55 -196Q55 -170 71 -158T104 -146Q123 -146 138 -159T153 -195Q153 -206 149 -215T139 -230T127 -238T117 -242L113 -244",
        8748: "113 -244Q113 -246 119 -251T139 -263T167 -269Q186 -269 199 -260Q220 -247 232 -218T251 -133T262 -15T276 155T297 367Q300 390 305 438T314 512T325 580T340 647T361 703T390 751T428 784T479 804Q481 804 488 804T501 805Q552 802 581 769T610 695Q610 669 594 657T561 645Q542 645 527 658T512 694Q512 705 516 714T526 729T538 737T548 742L552 743Q552 745 545 751T525 762T498 768Q475 768 460 756T434 716T418 652T407 559T398 444T387 300T369 133Q349 -38 337 -102T303 -207Q256 -306 169 -306Q119 -306 87 -272T55 -196Q55 -170 71 -158T104 -146Q123 -146 138 -159T153 -195Q153 -206 149 -215T139 -230T127 -238T117 -242L113 -244ZM460 -244Q460 -246 466 -251T486 -263T514 -269Q532 -269 546 -260Q567 -247 579 -218T598 -133T609 -15T623 155T644 367Q647 390 652 438T661 512T672 580T687 647T708 703T737 751T775 784T826 804Q828 804 835 804T848 805Q899 802 928 769T957 695Q957 669 941 657T908 645Q889 645 874 658T859 694Q859 705 863 714T873 729T885 737T895 742L899 743Q899 745 892 751T872 762T845 768Q822 768 807 756T781 716T765 652T754 559T745 444T734 300T716 133Q696 -38 684 -102T650 -207Q603 -306 516 -306Q466 -306 434 -272T402 -196Q402 -170 418 -158T451 -146Q470 -146 485 -159T500 -195Q500 -206 496 -215T486 -230T474 -238T464 -242L460 -244",
        8749: "113 -244Q113 -246 119 -251T139 -263T167 -269Q186 -269 199 -260Q220 -247 232 -218T251 -133T262 -15T276 155T297 367Q300 390 305 438T314 512T325 580T340 647T361 703T390 751T428 784T479 804Q481 804 488 804T501 805Q552 802 581 769T610 695Q610 669 594 657T561 645Q542 645 527 658T512 694Q512 705 516 714T526 729T538 737T548 742L552 743Q552 745 545 751T525 762T498 768Q475 768 460 756T434 716T418 652T407 559T398 444T387 300T369 133Q349 -38 337 -102T303 -207Q256 -306 169 -306Q119 -306 87 -272T55 -196Q55 -170 71 -158T104 -146Q123 -146 138 -159T153 -195Q153 -206 149 -215T139 -230T127 -238T117 -242L113 -244ZM460 -244Q460 -246 466 -251T486 -263T514 -269Q532 -269 546 -260Q567 -247 579 -218T598 -133T609 -15T623 155T644 367Q647 390 652 438T661 512T672 580T687 647T708 703T737 751T775 784T826 804Q828 804 835 804T848 805Q899 802 928 769T957 695Q957 669 941 657T908 645Q889 645 874 658T859 694Q859 705 863 714T873 729T885 737T895 742L899 743Q899 745 892 751T872 762T845 768Q822 768 807 756T781 716T765 652T754 559T745 444T734 300T716 133Q696 -38 684 -102T650 -207Q603 -306 516 -306Q466 -306 434 -272T402 -196Q402 -170 418 -158T451 -146Q470 -146 485 -159T500 -195Q500 -206 496 -215T486 -230T474 -238T464 -242L460 -244ZM807 -244Q807 -246 813 -251T833 -263T861 -269Q880 -269 893 -260Q914 -247 926 -218T945 -133T956 -15T970 155T991 367Q994 390 999 438T1008 512T1019 580T1034 647T1055 703T1084 751T1122 784T1173 804Q1175 804 1182 804T1195 805Q1246 802 1275 769T1304 695Q1304 669 1288 657T1255 645Q1236 645 1221 658T1206 694Q1206 705 1210 714T1220 729T1232 737T1242 742L1246 743Q1246 745 1239 751T1219 762T1192 768Q1169 768 1154 756T1128 716T1112 652T1101 559T1092 444T1081 300T1063 133Q1043 -38 1031 -102T997 -207Q950 -306 863 -306Q813 -306 781 -272T749 -196Q749 -170 765 -158T798 -146Q817 -146 832 -159T847 -195Q847 -206 843 -215T833 -230T821 -238T811 -242L807 -244",
        8750: "269 74L256 80Q244 85 227 97T191 128T161 179T148 250Q148 332 199 379T302 433L306 434L307 444Q309 456 313 495T321 553T331 607T345 664T365 712T393 756T431 785T479 804Q481 804 488 804T501 805Q552 802 581 769T610 695Q610 669 594 657T561 645Q542 645 527 658T512 694Q512 705 516 714T526 729T538 737T548 742L552 743Q552 745 545 751T525 762T498 768Q471 768 454 752T427 693T414 626T406 536Q405 530 405 527L397 425L404 422Q410 419 421 413T445 399T470 376T494 345T511 303T518 250Q518 205 502 169T460 112T410 80T364 66L360 65L359 55Q357 38 353 4T346 -43T340 -81T333 -118T326 -148T316 -179T303 -207Q256 -306 169 -306Q119 -306 87 -272T55 -196Q55 -170 71 -158T104 -146Q123 -146 138 -159T153 -195Q153 -206 149 -215T139 -230T127 -238T117 -242L113 -244Q113 -246 119 -251T139 -263T167 -269Q186 -269 199 -260Q231 -241 242 -183T266 33L269 74ZM272 122Q272 156 300 391Q300 392 299 392Q287 392 263 379T213 331T187 249Q187 211 205 180T239 137T272 116V122ZM366 107Q378 107 402 119T453 167T479 249Q479 340 394 383V377Q394 375 394 374T393 371T393 366T392 357T391 342T389 321T386 291T382 251T377 199T369 133Q366 112 366 107",
        8896: "119 -249T97 -249T65 -235T55 -207Q55 -201 56 -198Q58 -190 218 268T380 729Q392 750 416 750Q438 750 451 732Q453 728 534 498T695 36L775 -194Q777 -204 777 -208Q777 -222 767 -235T735 -249Q713 -249 700 -231Q696 -225 557 177L416 579L276 177Q136 -226 132 -231Q119 -249 97 -249",
        8897: "55 708Q55 729 68 739T96 750Q119 750 132 731Q136 726 276 323L416 -79L557 323Q696 725 700 731Q713 749 735 749Q756 749 766 736T777 708Q777 700 696 466T533 1T451 -232Q436 -249 416 -249Q402 -249 391 -241Q384 -236 380 -226Q368 -198 219 230Q55 697 55 708",
        8898: "139 -217Q127 -241 114 -246Q106 -249 97 -249Q67 -249 57 -220Q55 -214 55 102Q55 152 55 221T54 312Q54 422 60 464T91 554Q120 612 165 654T257 714T337 741T392 749Q393 750 402 750Q414 750 422 749Q557 749 660 659T776 430Q777 422 777 102Q777 -214 775 -220Q765 -249 735 -249Q716 -249 708 -241T694 -217L692 428L690 441Q674 540 597 603T416 666H409Q388 666 364 662T294 638T212 581Q156 523 142 441L140 428L139 105V-217",
        8899: "96 750Q103 750 109 748T120 744T127 737T133 730T137 723T139 718V395L140 73L142 60Q159 -43 237 -104T416 -166Q521 -166 597 -103T690 60L692 73L694 718Q708 749 735 749Q765 749 775 720Q777 714 777 398Q777 78 776 71Q766 -51 680 -140Q571 -249 416 -249H411Q261 -249 152 -140Q66 -51 56 71Q55 78 55 398Q55 714 57 720Q60 734 70 740Q80 750 96 750",
        8968: "202 -349V850H449V810H242V-349H202",
        8969: "22 810V850H269V-349H229V810H22",
        8970: "202 -349V850H242V-309H449V-349H202",
        8971: "229 -309V850H269V-349H22V-309H229",
        9001: "373 850Q392 850 394 832Q394 825 267 538L139 250L267 -38Q394 -325 394 -332Q392 -350 375 -350Q361 -350 356 -338Q354 -331 289 -186T161 103T97 250T160 397T289 685T356 838Q362 850 373 850",
        9002: "77 832Q77 837 82 843T98 850Q110 849 115 838Q117 831 182 686T310 397T374 250T311 103T182 -185T115 -338Q110 -350 96 -350Q79 -350 77 -332Q77 -325 204 -38L332 250L204 538Q77 825 77 832",
        9168: "312 0V602H355V0H312",
        10072: "146 612Q151 627 166 627Q182 627 187 612Q188 610 188 306T187 0Q184 -15 166 -15Q149 -15 146 0V10Q146 19 146 35T146 73T146 122T145 179T145 241T145 306T145 370T145 433T145 489T146 538T146 576T146 602V612",
        10216: "373 850Q392 850 394 832Q394 825 267 538L139 250L267 -38Q394 -325 394 -332Q392 -350 375 -350Q361 -350 356 -338Q354 -331 289 -186T161 103T97 250T160 397T289 685T356 838Q362 850 373 850",
        10217: "77 832Q77 837 82 843T98 850Q110 849 115 838Q117 831 182 686T310 397T374 250T311 103T182 -185T115 -338Q110 -350 96 -350Q79 -350 77 -332Q77 -325 204 -38L332 250L204 538Q77 825 77 832",
        10752: "555 -250Q420 -250 306 -185T124 -4T56 250Q56 453 193 595T526 749Q528 750 539 750Q554 750 562 749Q688 749 800 687T983 508T1054 250Q1054 112 987 -3T806 -184T555 -250ZM555 -165Q672 -165 767 -108T916 44T970 250Q970 418 861 532T600 664Q591 665 548 665Q446 665 353 614T200 466T140 250V243Q140 88 248 -30Q262 -46 280 -62T338 -105T434 -148T555 -165ZM478 250Q478 288 503 307T551 326Q586 326 609 305T632 250Q632 217 610 196T555 174T500 196T478 250",
        10753: "555 -250Q420 -250 306 -185T124 -4T56 250Q56 453 193 595T526 749Q528 750 539 750Q554 750 562 749Q688 749 800 687T983 508T1054 250Q1054 112 987 -3T806 -184T555 -250ZM513 478Q513 664 512 664Q504 664 481 660T406 637T313 588Q281 564 255 537T211 483T181 431T161 382T150 342T144 310T141 292H513V478ZM798 588Q758 616 711 634T639 658T602 663L597 664V292H969Q969 293 967 309T960 341T949 381T930 430T900 482T856 537T798 588ZM513 -164V208H141Q142 205 144 189T149 160T158 125T173 83T196 39T229 -9Q249 -34 273 -55T318 -92T363 -119T405 -138T444 -150T475 -158T499 -162T513 -164ZM775 -103Q801 -87 823 -68T863 -30T894 10T919 49T937 88T950 123T959 154T964 180T968 198L969 208H597V-164Q599 -163 616 -161T647 -155T683 -145T728 -128T775 -103",
        10754: "555 -250Q420 -250 306 -185T124 -4T56 250Q56 453 193 595T526 749Q528 750 539 750Q554 750 562 749Q688 749 800 687T983 508T1054 250Q1054 112 987 -3T806 -184T555 -250ZM600 664Q591 665 548 665Q414 665 306 583L292 573L423 441L555 310L687 441L818 573L804 583Q714 650 600 664ZM364 118L495 250L364 382L232 513L223 500Q140 391 140 250Q140 107 223 0L232 -13L364 118ZM970 250Q970 389 887 501L878 512Q878 513 861 496T812 447T746 381L615 250L746 118L878 -13L887 0Q970 109 970 250ZM687 59L555 190L423 59L292 -73L306 -83Q416 -166 555 -166T804 -83L818 -73L687 59",
        10756: "96 750Q103 750 109 748T120 744T127 737T133 730T137 723T139 718V395L140 73L142 60Q159 -43 237 -104T416 -166Q521 -166 597 -103T690 60L692 73L694 718Q708 749 735 749Q765 749 775 720Q777 714 777 398Q777 78 776 71Q766 -51 680 -140Q571 -249 416 -249H411Q261 -249 152 -140Q66 -51 56 71Q55 78 55 398Q55 714 57 720Q60 734 70 740Q80 750 96 750ZM223 276Q223 282 224 287T227 296T232 302T238 308T243 313T250 316L254 319H374V376V406Q374 438 382 454T418 470Q443 467 450 453T458 410V376V319H579Q580 319 583 317T589 313T594 308T600 302T604 295T608 287T609 276Q609 253 587 241Q577 235 513 235H458V178Q458 176 458 166T459 148Q459 84 415 84Q401 84 390 93T375 117Q374 120 374 178V235H319Q317 235 307 235T290 234Q223 234 223 276",
        10758: "777 -217Q766 -244 745 -249H88Q64 -242 57 -220Q55 -214 55 250T57 720Q60 734 70 740Q80 750 96 750Q127 750 137 720Q139 714 139 274V-166H693V274Q693 714 695 720Q705 749 735 749Q766 749 775 719Q777 713 777 248V-217",
        12296: "373 850Q392 850 394 832Q394 825 267 538L139 250L267 -38Q394 -325 394 -332Q392 -350 375 -350Q361 -350 356 -338Q354 -331 289 -186T161 103T97 250T160 397T289 685T356 838Q362 850 373 850",
        12297: "77 832Q77 837 82 843T98 850Q110 849 115 838Q117 831 182 686T310 397T374 250T311 103T182 -185T115 -338Q110 -350 96 -350Q79 -350 77 -332Q77 -325 204 -38L332 250L204 538Q77 825 77 832"
      }, {
        10764: "∬∬"
      });
      return smallop$1;
    }
    var texCalligraphicBold$1 = {};
    var texCalligraphicBold = {};
    var hasRequiredTexCalligraphicBold$1;
    function requireTexCalligraphicBold$1() {
      if (hasRequiredTexCalligraphicBold$1) return texCalligraphicBold;
      hasRequiredTexCalligraphicBold$1 = 1;
      Object.defineProperty(texCalligraphicBold, "__esModule", { value: true });
      texCalligraphicBold.texCalligraphicBold = void 0;
      texCalligraphicBold.texCalligraphicBold = {
        65: [0.751, 0.049, 0.921, { ic: 0.068, sk: 0.224 }],
        66: [0.705, 0.017, 0.748, { sk: 0.16 }],
        67: [0.703, 0.02, 0.613, { sk: 0.16 }],
        68: [0.686, 0, 0.892, { sk: 0.0958 }],
        69: [0.703, 0.016, 0.607, { ic: 0.02, sk: 0.128 }],
        70: [0.686, 0.03, 0.814, { ic: 0.116, sk: 0.128 }],
        71: [0.703, 0.113, 0.682, { sk: 0.128 }],
        72: [0.686, 0.048, 0.987, { sk: 0.128 }],
        73: [0.686, 0, 0.642, { ic: 0.104, sk: 0.0319 }],
        74: [0.686, 0.114, 0.779, { ic: 0.158, sk: 0.192 }],
        75: [0.703, 0.017, 0.871, { sk: 0.0639 }],
        76: [0.703, 0.017, 0.788, { sk: 0.16 }],
        77: [0.703, 0.049, 1.378, { sk: 0.16 }],
        78: [0.84, 0.049, 0.937, { ic: 0.168, sk: 0.0958 }],
        79: [0.703, 0.017, 0.906, { sk: 0.128 }],
        80: [0.686, 0.067, 0.81, { ic: 0.036, sk: 0.0958 }],
        81: [0.703, 0.146, 0.939, { sk: 0.128 }],
        82: [0.686, 0.017, 0.99, { sk: 0.0958 }],
        83: [0.703, 0.016, 0.696, { ic: 0.025, sk: 0.16 }],
        84: [0.72, 0.069, 0.644, { ic: 0.303, sk: 0.0319 }],
        85: [0.686, 0.024, 0.715, { ic: 0.056, sk: 0.0958 }],
        86: [0.686, 0.077, 0.737, { ic: 0.037, sk: 0.0319 }],
        87: [0.686, 0.077, 1.169, { ic: 0.037, sk: 0.0958 }],
        88: [0.686, 0, 0.817, { ic: 0.089, sk: 0.16 }],
        89: [0.686, 0.164, 0.759, { ic: 0.038, sk: 0.0958 }],
        90: [0.686, 0, 0.818, { ic: 0.035, sk: 0.16 }],
        305: [0.452, 8e-3, 0.394, { sk: 0.0319 }],
        567: [0.451, 0.201, 0.439, { sk: 0.0958 }]
      };
      return texCalligraphicBold;
    }
    var hasRequiredTexCalligraphicBold;
    function requireTexCalligraphicBold() {
      if (hasRequiredTexCalligraphicBold) return texCalligraphicBold$1;
      hasRequiredTexCalligraphicBold = 1;
      Object.defineProperty(texCalligraphicBold$1, "__esModule", { value: true });
      texCalligraphicBold$1.texCalligraphicBold = void 0;
      var FontData_js_1 = requireFontData();
      var tex_calligraphic_bold_js_1 = requireTexCalligraphicBold$1();
      texCalligraphicBold$1.texCalligraphicBold = (0, FontData_js_1.AddPaths)(tex_calligraphic_bold_js_1.texCalligraphicBold, {
        65: "761 751Q784 751 784 728V711Q784 570 795 417T820 191Q844 76 865 76Q868 76 902 93T962 112H973Q989 104 989 94Q989 92 987 86Q978 47 846 -11Q812 -25 779 -26Q722 -26 708 9Q688 47 669 161H524L379 162L359 136Q286 43 234 -3T142 -49T71 -19T39 55Q39 92 60 131T103 174Q113 174 117 167T124 149T136 128T166 110Q183 105 190 105Q230 105 341 246Q401 322 453 397T531 514T582 601T611 651H640V663Q640 692 676 718T745 750Q747 750 752 750T761 751ZM658 266Q653 312 649 377T644 489T641 541V556L557 415Q500 325 448 253Q467 261 524 261H568H658V266",
        66: "441 83Q571 83 571 195Q571 246 538 279T466 322T386 333Q378 333 357 330T329 327Q307 327 307 345Q307 354 313 365T347 396T419 430Q546 472 581 498Q594 508 594 535Q594 574 567 589T508 604Q469 604 442 583Q390 546 342 457T265 256Q237 148 186 60Q167 29 144 13Q105 -15 68 -17H65Q40 -17 40 1Q40 7 53 29T87 100T124 210Q162 373 190 575Q188 575 174 567T138 550T98 542Q75 542 75 560Q75 588 123 618Q135 625 203 659T281 696Q299 703 316 703Q339 703 339 685Q339 656 328 583L333 588Q338 592 346 599T367 615T394 634T428 654T467 674T511 690T559 701T611 705Q651 704 681 689Q739 659 739 598Q739 507 595 427L584 421Q585 420 595 416T610 410T626 402T644 392T660 380T677 365T691 347T703 325T710 299T715 268Q717 193 665 130Q622 73 531 28T348 -17Q275 -17 225 10Q206 19 200 24T193 36Q193 57 231 86T311 119H322Q386 83 441 83",
        67: "243 -20Q135 -20 78 48T20 218Q20 280 39 344T98 470T193 580T324 661T488 702H490Q491 702 493 702T498 703T507 703T518 702H526Q599 702 599 631Q599 597 577 550T541 486Q523 463 490 447T431 430Q423 430 419 433Q409 437 409 450Q410 456 432 499T454 567Q454 586 446 594T415 603Q316 603 254 532Q216 487 190 421T164 284Q164 228 181 186T226 122T282 90T340 80Q377 80 405 96T449 131T492 167T553 187H555Q580 187 580 168Q580 153 551 123T476 60T367 4T243 -20",
        68: "107 0Q92 5 92 18Q92 33 113 53T160 86Q170 91 182 94T197 100L206 120Q248 226 273 337T304 501T309 585Q278 585 234 577T179 557Q172 550 166 532T156 509Q140 484 105 466T44 447Q20 447 20 465Q20 482 34 510T76 565Q122 608 173 632Q281 686 447 686H480H517Q692 686 784 631Q885 571 885 450Q885 339 805 239T586 75T286 1Q276 0 187 0H107ZM741 391Q741 424 731 452T694 510T613 558T481 584Q476 584 468 584T457 585L449 586V579Q441 501 425 424T391 292T357 193T330 125T319 100H324Q511 100 628 175Q688 215 714 275T741 391",
        69: "495 516Q485 516 478 520T470 532Q470 537 476 550T482 570Q482 589 465 596T401 603Q344 603 319 582Q295 558 295 519Q295 493 312 474T355 445T407 432T455 427Q477 427 477 409Q477 395 453 371T389 333Q380 330 345 327T279 312T223 272Q181 223 181 176Q181 131 225 107T324 83Q366 83 395 98T448 136T487 167Q517 185 547 187H551Q574 187 574 170Q574 151 535 113T421 36T271 -15Q260 -16 226 -16Q181 -16 152 -9Q104 4 71 33T37 111Q37 140 50 176T106 263T216 356Q215 357 207 362T190 374T172 392T156 419T150 456Q150 521 208 580T341 670T474 702Q475 703 499 703Q528 703 547 701T586 693T615 673T627 637Q627 584 581 550T495 516",
        70: "812 567Q804 567 795 570T786 579Q786 586 647 586H559L558 582Q558 575 539 510T506 407L498 384H775Q788 378 790 368Q790 328 746 298T665 268Q646 268 642 284H457L447 261Q396 150 360 94Q329 46 270 8T149 -30Q123 -30 100 -24T63 -10T37 9T22 26T17 36Q17 59 56 88T135 119Q145 119 149 117T165 104Q187 78 227 72Q232 72 234 76Q245 93 273 145T350 323T424 570L428 586H276Q265 575 239 563T190 551Q180 551 174 556T167 569Q167 580 179 597T213 634T278 668T371 685Q374 686 624 686Q863 685 888 682Q917 678 927 663Q930 658 930 650Q930 624 888 596T812 567",
        71: "50 279Q50 361 88 438T190 570T335 661T503 702H514Q524 703 532 703Q671 703 671 626Q671 580 614 514T495 447Q472 447 472 465Q472 477 499 511T527 562Q527 582 507 592T433 602Q351 602 302 569Q252 535 223 469T194 344Q194 266 237 217T352 168Q401 168 442 205T505 316Q515 345 551 368T622 393H625Q649 393 649 376Q649 371 635 318T612 237Q580 129 540 62T442 -49Q353 -114 264 -114Q259 -114 252 -114L246 -113Q190 -113 142 -107T81 -96Q71 -90 71 -81Q71 -57 110 -30T187 2Q196 2 236 -4T338 -14Q371 -14 377 -9Q410 24 446 113L451 127Q353 68 253 68Q157 68 104 129T50 279",
        72: "42 447Q20 447 20 465Q20 481 47 515T119 589T239 657T392 686Q443 686 463 664T484 616Q484 570 473 506T452 401L441 360Q441 359 550 359H660L663 370Q684 435 716 522T758 624Q771 646 806 666T870 686Q894 686 894 668Q894 667 867 597T804 416T752 218Q737 135 737 93Q737 77 746 65T778 53Q799 53 803 54T814 63Q831 86 864 103T924 120Q946 120 946 100Q945 85 931 63T888 16T806 -27T684 -48H681Q625 -48 603 -10Q593 4 593 29Q593 71 603 131T624 230L634 269Q632 269 624 266Q610 261 600 261T507 259H411L399 222Q344 62 322 21Q301 -7 268 -24T209 -41H207Q187 -41 185 -25Q185 -17 192 2T220 71T261 184Q284 256 284 258Q284 259 227 259H170Q169 259 166 261T162 264T158 266T156 271T155 277Q155 296 184 320T250 356Q259 358 286 359Q312 359 312 360Q314 372 318 385Q332 450 339 526Q339 530 339 535T340 543Q340 586 296 586Q255 586 227 576T188 553T165 523T146 497Q127 476 97 462T42 447",
        73: "56 499Q32 499 32 516Q32 540 64 580T165 649Q241 682 365 685Q366 685 376 685T405 685T445 686T496 686T553 686H732Q746 677 746 668Q746 646 711 620T642 587L572 586H503Q479 546 458 479T424 352T383 224T318 111L309 101L412 100H514L523 109Q567 150 618 153Q644 153 644 135Q644 132 642 124Q629 86 581 52T476 6Q454 2 433 2T216 0Q-11 0 -15 2Q-27 6 -27 18Q-27 37 2 61T59 93Q77 100 142 100H198Q255 177 299 369Q337 513 382 574L391 586H348Q261 586 176 576Q163 543 124 521T56 499",
        74: "286 390Q263 390 263 407Q263 432 293 481T367 566Q511 687 724 687Q738 687 761 687T793 686H923Q937 677 937 668Q937 648 905 623T842 589Q829 587 817 586T802 585T795 583T788 578Q709 506 632 189Q622 153 615 134T588 81T537 17Q482 -39 404 -76T247 -114Q192 -114 158 -100Q53 -61 53 32Q53 59 58 73T79 102Q126 147 177 147Q200 147 200 128Q200 123 198 112T196 96Q196 47 238 17T345 -13Q362 -13 377 -9T404 0T426 16T444 34T459 55T470 76T478 97T483 116T488 132L490 141Q511 222 520 257T554 364T608 486T675 576L685 586H634H612Q532 586 484 564Q453 549 436 526T409 478T395 447Q378 424 345 407T286 390",
        75: "98 542Q75 542 75 560Q75 588 123 618Q132 624 199 657T275 694Q291 703 315 703Q327 703 332 699T338 690T339 670Q339 596 323 505T283 337T237 194T198 90L181 53Q170 31 136 8T68 -17H65Q40 -17 40 0L76 92Q112 185 150 322T194 564V578L168 565Q125 542 98 542ZM834 142Q834 125 819 100T774 48T692 3T576 -16H560Q540 -16 508 6Q469 33 422 108T342 267T309 398Q309 411 310 417T320 442T347 482Q401 542 517 615T710 702Q712 702 721 702T735 703Q772 703 791 690Q819 674 819 646T792 597T733 574H722Q704 584 704 599Q706 607 700 610T672 617L660 613Q609 595 524 538T423 450V440Q423 376 488 247T604 83Q621 70 640 70Q677 70 701 82Q713 87 718 101T737 132T783 160Q792 163 807 163Q834 163 834 142",
        76: "63 -17Q41 -17 41 0Q41 22 85 54Q101 68 113 92T133 141T154 219T182 315Q230 462 306 553Q345 599 391 632T478 678T543 697T582 703Q584 703 589 703T598 702Q643 702 666 676T689 613Q689 588 683 575Q674 551 632 524T552 496Q530 496 530 512Q530 517 531 525T533 538Q533 559 522 577T480 596H476Q462 596 451 588T415 544Q350 447 310 281Q284 181 261 136L255 124H285Q342 123 441 107T583 90L596 89Q603 116 647 144T729 173Q751 173 751 157Q751 118 685 60T523 -15Q514 -16 479 -16Q421 -16 320 0T171 18H155L142 10Q98 -17 63 -17",
        77: "38 20Q38 59 60 99T104 139Q106 139 126 125T176 106H181Q200 106 221 139T286 281Q322 370 342 451T368 581T376 634Q384 657 420 680T487 703Q502 703 507 696T522 649Q538 589 554 537Q579 453 609 372T660 248T686 202Q687 201 739 244T830 322L1166 642Q1225 700 1230 701Q1230 701 1237 703Q1258 703 1258 667L1253 637Q1248 607 1241 558T1227 451T1214 326T1209 202Q1209 77 1232 77Q1237 77 1269 94T1326 112H1329Q1353 112 1353 94Q1353 81 1334 60Q1311 37 1248 7T1150 -24H1141H1135Q1085 -24 1074 26Q1064 75 1064 134Q1064 239 1086 426Q1087 430 1087 434L1061 410Q871 227 783 149L694 76Q653 44 647 40T631 34Q620 34 616 37T594 63Q546 125 514 198Q467 307 423 449L418 466L412 444Q376 310 306 153Q278 88 251 45T201 -18T163 -43T131 -49Q102 -48 70 -31T38 20",
        78: "47 139Q81 105 122 105Q137 105 147 117Q159 134 182 199T234 381T274 610Q275 634 284 647Q297 666 327 684T389 703Q403 703 408 695T428 645Q480 490 567 298Q628 163 673 103Q674 102 674 102T675 106Q732 331 803 551Q842 674 875 725Q908 775 966 807T1081 840H1084Q1105 840 1105 803Q1105 768 1088 733T1051 689Q1045 686 1032 686Q986 683 948 663T901 624Q881 579 837 430T760 154L726 28Q725 28 725 28T723 25Q716 0 682 -24T611 -48Q600 -48 595 -45T576 -23Q522 44 480 124Q417 243 332 463L328 473L325 457Q291 293 227 124Q159 -49 72 -49Q38 -49 5 -28Q-24 -8 -24 21Q-24 58 -3 98T41 139H47",
        79: "433 703Q456 703 456 685Q456 672 441 655T407 627Q402 623 378 611T328 579T276 524Q207 434 207 324Q207 222 270 153T441 84Q566 84 651 177T737 400V405Q737 496 693 549T576 603Q542 603 510 560Q490 537 472 502T442 454Q397 412 346 409Q320 409 320 427Q320 430 322 436Q331 465 360 507T433 594T542 671T677 703Q776 703 829 636T882 468Q882 369 831 277T702 122T528 21T343 -17Q214 -17 139 61T63 257Q63 336 94 409T173 534T272 625T367 684T432 703H433",
        80: "170 -67Q147 -67 147 -49Q147 -42 162 -8T204 99T253 254Q274 332 288 415T305 542L308 585Q277 585 234 577T179 557Q172 550 166 532T156 509Q140 484 105 466T44 447Q20 447 20 465Q20 482 34 510T76 565Q122 608 173 632Q279 686 448 686H495H537Q622 686 678 677T784 637Q846 598 846 533Q846 452 776 375T597 252T378 206H366L358 181Q341 130 316 68T282 -7Q262 -33 230 -50T170 -67ZM701 468Q701 512 661 540T570 577T461 586H448V582Q446 576 443 545T428 447T395 301L389 280Q390 280 398 284T419 295T441 303Q443 304 484 306T572 321T651 359Q701 402 701 468",
        81: "874 453Q874 372 836 298T750 177T638 89T543 33T486 8L483 7Q485 5 523 -7T622 -32T726 -46Q741 -46 746 -45T755 -41T762 -27Q770 -1 806 23T878 50H890Q905 42 905 33Q905 -8 838 -68T670 -145Q662 -146 628 -146Q538 -146 389 -100T164 -50Q132 -50 132 -32T162 11T227 47Q231 48 286 51T394 62T518 100T641 180Q730 271 730 387Q730 478 673 540T520 602Q410 602 337 525T264 355Q264 284 310 244T420 203Q476 203 568 222Q594 222 594 204Q594 184 565 161T508 128Q433 103 316 103Q227 103 174 157T120 290Q120 382 182 471T343 620T548 697Q578 703 601 703Q604 703 611 703T623 702Q663 702 687 696Q760 679 817 618T874 453",
        82: "159 0Q159 5 172 34T205 114T245 229T284 386T309 575V585H304Q303 585 295 585T282 584Q233 579 207 570T175 553T165 531T156 509Q140 484 105 466T44 447Q20 447 20 465Q20 482 34 510T76 565Q122 608 173 632Q279 686 448 686H505H582Q683 686 745 672T834 611Q842 594 842 565Q842 523 824 484T780 419T722 370T669 336T632 318L619 312L626 302Q640 279 667 227T696 172Q717 133 735 112T762 88T784 84Q824 84 872 118T957 153Q981 153 981 136Q981 114 937 78T820 13T684 -17Q646 -17 616 8T569 66T526 151T477 234Q461 256 446 265Q437 272 421 274Q400 274 400 291Q400 311 430 336T495 371Q496 371 543 374T627 392T681 436Q699 467 699 503Q699 550 644 568T471 586H449V582Q449 581 447 559T438 499T422 413T393 298T348 165Q313 73 296 45Q282 24 249 4T185 -17Q159 -17 159 0",
        83: "204 476Q204 525 248 577T372 666T539 703T674 683T721 612Q721 588 714 569Q704 547 669 524T601 499Q573 499 573 516Q573 521 575 527T577 543Q577 563 568 574T548 588L539 590Q490 603 444 603Q418 603 394 597T364 583Q348 567 348 533Q348 493 382 466T459 425T555 387T633 330Q662 292 662 249Q662 153 544 69T257 -16Q218 -16 208 -15Q118 1 64 46Q25 76 25 126Q25 185 82 235T203 290H207Q229 290 231 274Q231 243 180 213Q173 209 172 206T170 189T171 170T183 150T216 121Q273 83 356 83Q412 83 459 100Q493 111 507 141Q518 165 518 185Q518 208 506 228T478 262T437 288T398 306T360 320Q316 335 285 352T239 384T215 416T205 443T204 467V476",
        84: "61 462H59Q38 462 38 479Q38 528 109 594T289 683L304 685L837 687L846 693Q889 720 923 720Q947 720 947 702Q945 671 892 631T776 583Q774 583 772 583T769 582T766 582L764 581H758Q753 581 744 581T722 580T693 580T662 580H563L514 385Q507 355 493 299T475 225T460 172T443 119T426 76T402 24Q386 -11 355 -33T304 -61T266 -69Q242 -69 242 -50Q243 -45 253 -25T278 32T307 115L364 340Q405 511 413 538T436 580H207Q202 572 200 568T197 561T195 552T190 537Q176 511 135 487T61 462",
        85: "124 586Q107 586 74 569T15 552H13Q-10 552 -10 570Q-10 605 70 645T222 686Q283 686 283 631Q283 590 246 504T172 326T135 181Q135 130 157 107T205 83Q221 83 259 106Q347 165 453 301T604 548Q607 557 612 569T619 587T624 600T628 612T632 621T637 628T641 634T647 640T654 645T662 652Q706 686 748 686Q771 686 771 669Q771 656 754 614T700 467T630 229Q615 168 610 105Q610 88 617 78L641 90Q681 111 706 112Q733 112 733 95Q733 82 714 60Q694 40 633 10Q567 -23 532 -24Q507 -24 495 -17Q466 -4 466 32Q466 96 500 225Q277 -17 102 -17Q56 -17 23 17T-10 118Q-10 164 13 234T64 363T115 481T139 567Q139 586 124 586",
        86: "25 608Q25 628 60 657T148 686Q184 683 213 671T273 625T327 538T363 394T380 184L381 134L399 148Q503 226 574 302T667 415T689 467Q688 474 684 482T672 502T645 521T600 532Q576 532 576 567Q576 604 597 644T641 685H649Q701 685 737 648T774 545Q774 457 703 333T461 66Q397 13 332 -32T255 -77Q237 -77 237 -30V-23Q241 20 241 109Q241 483 115 569Q91 586 50 589Q25 589 25 608",
        87: "25 607Q25 629 62 657T142 686Q205 686 248 647T312 541T339 411T347 275Q347 249 345 203V189Q375 219 449 316T587 516Q629 584 629 587Q629 589 626 597T622 607Q622 629 658 656T732 686H744Q755 680 757 678Q757 677 769 649T799 577T835 475T874 339T904 183Q908 157 910 151L925 169Q997 252 1059 343T1121 474Q1120 498 1103 513T1059 532Q1036 532 1036 568Q1036 600 1053 636T1090 683L1097 686H1109Q1147 684 1176 652T1206 551Q1206 460 1131 320T897 7Q859 -33 840 -52T816 -74T804 -77Q788 -77 784 -32Q783 -28 783 -26Q774 108 744 239T691 436T665 501Q664 501 649 475T602 400T528 289T420 146T280 -15Q243 -56 231 -66T210 -77Q191 -77 191 -40Q191 -38 195 -4T204 91T209 217Q209 290 202 351T177 469T126 557T45 589Q25 589 25 607",
        88: "762 562Q762 579 737 584T711 604Q711 630 753 658T834 686Q864 686 885 669T906 627Q906 580 834 522T614 379L584 362V357Q585 354 589 315T597 233T603 183Q610 132 627 116T671 100Q678 100 704 113T754 126T778 107Q776 79 733 45T626 2Q615 1 578 1Q542 1 535 3Q521 7 510 15T491 31T477 54T467 78T460 108T456 137T452 170T449 201Q447 220 445 240T442 270L441 281Q435 281 357 233Q240 165 206 135Q200 128 200 124Q200 113 208 108T226 101T244 96T252 82Q252 61 214 31T129 1H120Q97 1 77 16T56 60Q56 105 133 168T414 345Q428 352 431 354T433 359Q422 493 414 522Q407 551 395 566T373 583T350 586H341L332 580Q290 560 265 560Q243 560 243 577Q243 585 248 596T269 624T306 653T365 676T447 686H456Q472 686 484 683T514 671T543 637T562 576Q565 557 570 501L577 437Q577 436 613 457T694 506T756 551Q762 558 762 562",
        89: "73 555Q49 555 49 573Q49 602 110 644T239 686Q319 686 376 624Q416 584 444 511T483 361T499 240T503 173Q503 165 504 165Q506 165 524 184T556 218Q631 297 674 377T718 485Q718 505 699 526Q673 552 628 552Q619 552 613 562T607 590Q607 617 621 645T658 685Q661 686 671 686Q718 686 757 652T797 545Q797 476 749 369T602 146Q500 29 371 -67T176 -164Q112 -164 74 -120T36 -29Q36 5 55 36T95 67Q104 67 108 59T115 39T128 12T154 -12Q183 -30 216 -30Q239 -30 305 7L361 44L367 49V54Q367 95 364 143T351 273T312 429T243 546Q206 581 156 588L146 581Q108 555 73 555",
        90: "622 574Q522 579 420 579H396Q373 579 364 574T351 550Q339 516 297 490T218 462Q195 462 195 479Q195 487 197 492Q218 565 313 625T509 685Q564 685 650 683T755 680Q787 680 807 683T831 686Q853 686 853 669Q853 657 826 626Q742 532 641 437L619 415L622 414Q626 414 631 414T642 414Q697 411 697 388Q697 367 670 345T607 323Q605 323 592 325T546 329H522L490 302Q457 274 400 226T289 136L260 113L318 112Q345 111 452 109T587 106H627Q650 143 656 170Q666 197 710 225T788 253Q811 253 811 237Q811 211 781 160T710 77Q619 0 515 0Q507 0 497 0T484 1Q434 1 319 3T177 6Q123 6 95 2Q83 2 71 0H68Q46 0 46 17Q46 28 58 44Q68 56 100 80T210 165T383 307L408 329H361L314 330Q297 338 297 350Q297 368 320 388T368 413Q375 415 441 415H506L647 555L664 574H622",
        305: "24 296Q24 305 34 328T63 380T115 430T187 452Q205 452 223 448T262 435T295 406T308 360Q308 345 287 290T240 170T207 87Q202 67 202 57Q202 42 215 42Q235 42 257 64Q288 92 302 140Q307 156 310 159T330 162H336H347Q367 162 367 148Q367 140 357 117T329 65T276 14T201 -8Q158 -8 121 15T83 84Q83 104 133 229T184 358Q189 376 189 388Q189 402 177 402Q156 402 134 380Q103 352 89 304Q84 288 81 285T61 282H55H44Q24 282 24 296",
        567: "297 360T297 373T294 392T288 400T278 401H276Q237 398 200 363Q181 343 170 325T156 299T149 287T129 282H123H116Q102 282 97 284T92 298Q93 303 98 315T118 349T151 390T201 427T267 451H279Q357 451 388 422T420 354V339L370 138Q321 -60 317 -69Q287 -157 163 -194Q133 -201 99 -201Q39 -201 14 -178T-12 -125Q-12 -94 11 -69T68 -43Q93 -43 108 -57T123 -95Q123 -121 100 -151H104Q131 -151 155 -125T193 -60Q195 -54 244 141T294 345Q297 360 297 373"
      }, {});
      return texCalligraphicBold$1;
    }
    var texCalligraphic$1 = {};
    var texCalligraphic = {};
    var hasRequiredTexCalligraphic$1;
    function requireTexCalligraphic$1() {
      if (hasRequiredTexCalligraphic$1) return texCalligraphic;
      hasRequiredTexCalligraphic$1 = 1;
      Object.defineProperty(texCalligraphic, "__esModule", { value: true });
      texCalligraphic.texCalligraphic = void 0;
      texCalligraphic.texCalligraphic = {
        65: [0.728, 0.05, 0.798, { ic: 0.021, sk: 0.194 }],
        66: [0.705, 0.022, 0.657, { sk: 0.139 }],
        67: [0.705, 0.025, 0.527, { sk: 0.139 }],
        68: [0.683, 0, 0.771, { sk: 0.0833 }],
        69: [0.705, 0.022, 0.528, { ic: 0.036, sk: 0.111 }],
        70: [0.683, 0.032, 0.719, { ic: 0.11, sk: 0.111 }],
        71: [0.704, 0.119, 0.595, { sk: 0.111 }],
        72: [0.683, 0.048, 0.845, { sk: 0.111 }],
        73: [0.683, 0, 0.545, { ic: 0.097, sk: 0.0278 }],
        74: [0.683, 0.119, 0.678, { ic: 0.161, sk: 0.167 }],
        75: [0.705, 0.022, 0.762, { sk: 0.0556 }],
        76: [0.705, 0.022, 0.69, { sk: 0.139 }],
        77: [0.705, 0.05, 1.201, { sk: 0.139 }],
        78: [0.789, 0.05, 0.82, { ic: 0.159, sk: 0.0833 }],
        79: [0.705, 0.022, 0.796, { sk: 0.111 }],
        80: [0.683, 0.057, 0.696, { ic: 0.037, sk: 0.0833 }],
        81: [0.705, 0.131, 0.817, { sk: 0.111 }],
        82: [0.682, 0.022, 0.848, { sk: 0.0833 }],
        83: [0.705, 0.022, 0.606, { ic: 0.036, sk: 0.139 }],
        84: [0.717, 0.068, 0.545, { ic: 0.288, sk: 0.0278 }],
        85: [0.683, 0.028, 0.626, { ic: 0.061, sk: 0.0833 }],
        86: [0.683, 0.052, 0.613, { ic: 0.045, sk: 0.0278 }],
        87: [0.683, 0.053, 0.988, { ic: 0.046, sk: 0.0833 }],
        88: [0.683, 0, 0.713, { ic: 0.094, sk: 0.139 }],
        89: [0.683, 0.143, 0.668, { ic: 0.046, sk: 0.0833 }],
        90: [0.683, 0, 0.725, { ic: 0.042, sk: 0.139 }]
      };
      return texCalligraphic;
    }
    var hasRequiredTexCalligraphic;
    function requireTexCalligraphic() {
      if (hasRequiredTexCalligraphic) return texCalligraphic$1;
      hasRequiredTexCalligraphic = 1;
      Object.defineProperty(texCalligraphic$1, "__esModule", { value: true });
      texCalligraphic$1.texCalligraphic = void 0;
      var FontData_js_1 = requireFontData();
      var tex_calligraphic_js_1 = requireTexCalligraphic$1();
      texCalligraphic$1.texCalligraphic = (0, FontData_js_1.AddPaths)(tex_calligraphic_js_1.texCalligraphic, {
        65: "576 668Q576 688 606 708T660 728Q676 728 675 712V571Q675 409 688 252Q696 122 720 57Q722 53 723 50T728 46T732 43T737 41T743 39L754 45Q788 61 803 61Q819 61 819 47Q818 43 814 35Q799 15 755 -7T675 -30Q659 -30 648 -25T630 -8T621 11T614 34Q603 77 599 106T594 146T591 160V163H460L329 164L316 145Q241 35 196 -7T119 -50T59 -24T30 43Q30 75 46 100T74 125Q81 125 83 120T88 104T96 84Q118 57 151 57Q189 57 277 182Q432 400 542 625L559 659H567Q574 659 575 660T576 668ZM584 249Q579 333 577 386T575 473T574 520V581L563 560Q497 426 412 290L372 228L370 224H371L383 228L393 232H586L584 249",
        66: "304 342Q292 342 292 353Q292 372 323 391Q331 396 417 428T533 487Q563 512 563 555V562Q563 575 557 589T530 618T475 636Q429 636 396 613T330 539Q263 446 210 238Q196 183 173 120Q135 31 121 16Q108 1 85 -10T47 -22T32 -10Q32 -5 44 18T77 93T112 206Q135 296 154 395T182 550T191 615Q191 616 190 616Q188 616 179 611T157 601T131 594Q113 594 113 605Q113 623 144 644Q154 650 205 676T267 703Q277 705 279 705Q295 705 295 693Q295 686 288 635T278 575Q278 572 287 582Q336 635 402 669T540 704Q603 704 633 673T664 599Q664 559 638 523T580 462Q553 440 504 413L491 407L504 402Q566 381 596 338T627 244Q627 172 575 110T444 13T284 -22Q208 -22 158 28Q144 42 146 50Q150 67 178 85T230 103Q236 103 246 95T267 75T302 56T357 47Q436 47 486 93Q526 136 526 198V210Q526 228 518 249T491 292T436 330T350 345Q335 345 321 344T304 342",
        67: "201 -25Q167 -25 136 -14T75 23T29 94T12 202Q12 290 50 394T161 574Q227 642 303 673T433 704Q435 705 457 705Q533 701 533 640Q533 606 507 548T464 474Q431 444 396 444Q381 444 381 453Q381 459 388 473T407 513T428 563Q433 580 433 594Q433 636 381 636Q314 636 260 594T175 489T128 363T112 247Q112 157 153 101T273 44Q347 44 398 121Q413 144 437 157T481 171Q496 171 496 160Q496 150 476 123Q426 56 350 16T201 -25",
        68: "37 475Q19 475 19 487Q19 536 103 604T327 682H356Q386 683 408 683H419Q475 683 506 681T582 668T667 633Q766 571 766 450Q766 365 723 287T611 152T455 57T279 6Q248 1 160 0Q148 0 131 0T108 -1Q72 -1 72 11Q72 24 90 40T133 64L144 68L152 88Q247 328 272 587Q275 613 272 613Q272 613 269 613Q225 610 195 602T149 579T129 556T119 532Q118 530 116 525T113 518Q102 502 80 490T37 475ZM665 407Q665 596 412 613Q403 614 383 614Q370 614 370 612Q370 598 363 542T323 357T242 103L228 69H265Q391 73 481 119Q536 148 575 188T633 268T658 338T665 392V407",
        69: "144 470Q144 556 240 630T451 705Q564 705 564 637Q564 611 540 573Q529 559 505 547T464 534Q448 534 448 545Q448 552 455 562Q463 577 463 591Q463 600 462 604T456 616T436 627T400 635Q396 635 390 635T380 636Q291 636 258 568Q245 544 245 516Q245 463 290 438T391 410Q415 410 415 398Q415 392 407 380T376 356T326 341Q288 340 260 327Q218 311 187 276T143 208T130 151Q130 113 156 88T211 55T268 47Q349 47 403 125Q415 144 439 157T483 171Q499 171 499 160Q499 148 475 120T413 59T315 3T197 -22Q124 -22 77 14T30 105Q30 126 39 154T66 216T122 288T209 354L223 362Q144 400 144 470",
        70: "199 579Q181 579 181 590Q181 598 188 611T212 639T260 666T335 682Q336 682 349 682T383 682T431 682T493 683T561 683Q776 682 784 681Q826 673 829 647Q829 620 797 600T744 580Q728 580 728 595Q729 607 713 610Q698 613 598 614H500L499 610Q499 598 467 486T428 367Q428 365 551 365H674Q683 360 684 355Q687 346 677 329Q666 312 642 299T598 285Q586 285 582 296H402L394 277Q386 258 373 229T346 167T315 102T286 51Q265 22 225 -5T133 -32Q108 -32 87 -25T54 -7T33 15T21 35T18 47Q18 60 44 80T98 103Q108 103 111 101T119 88Q130 66 150 54T179 39T195 37Q199 37 203 43Q217 67 245 125T318 300T391 532Q393 543 398 564T406 598T409 613T339 614H269Q229 579 199 579",
        71: "216 68Q155 68 115 100T59 177T44 273Q44 299 50 333T73 421T133 533T239 632Q346 704 466 704Q508 704 515 703Q555 696 577 681T599 635Q599 605 570 560T523 496Q490 466 455 466Q440 466 440 475T469 526T499 589Q499 605 489 617Q460 636 403 636Q343 636 295 611T220 548T174 464T150 382T144 318Q144 241 180 189T287 137Q325 137 359 160Q428 205 466 322Q472 342 501 359T551 376Q557 376 560 373T564 368L565 365Q560 341 551 302T512 173T451 31Q359 -119 204 -119Q163 -118 127 -109T74 -91T53 -77Q52 -75 52 -71Q52 -54 79 -35T132 -14H140L151 -19Q210 -49 281 -49H289Q312 -49 329 -31Q351 -7 372 36T405 109T416 142L408 136Q401 131 392 125T369 111T338 96T303 82T261 72T216 68",
        72: "18 487Q18 496 29 517T67 566T127 621T216 665T330 683Q359 683 376 669T397 643T400 622Q400 584 382 488T348 343Q348 342 467 342H587L594 366Q615 440 648 534T690 641Q701 656 723 669T764 683Q783 683 783 672L750 578Q716 485 677 346T625 101Q624 92 623 82T622 65T621 56Q621 20 658 20Q666 20 701 25Q709 52 736 69T785 87Q803 87 803 75T791 44T754 3T685 -33T588 -48Q568 -48 562 -46Q522 -31 522 13V23Q531 129 562 250L569 281L565 280Q561 278 556 277T549 274L438 273H328L321 249Q307 202 275 107T232 0Q219 -16 196 -28T155 -41Q149 -41 145 -39T140 -34T139 -29Q139 -24 148 -3T181 86T233 247Q240 270 240 272Q240 273 194 273H169Q139 273 139 285Q139 295 153 308T187 332Q206 341 236 342L260 343L264 359Q278 414 289 482T300 578Q300 613 260 613H254Q198 613 169 592Q148 578 127 544T104 508Q72 478 37 475Q18 475 18 487",
        73: "174 0H31Q-13 0 -21 2T-30 12Q-30 23 -17 36Q9 60 42 68L155 70Q187 102 214 179T257 333T302 491T366 610L369 614H305Q221 611 188 607T145 596T128 569Q119 543 94 529T47 512Q28 512 28 524Q28 527 32 539Q56 614 159 654Q218 678 312 682Q314 682 339 682T404 682T481 683H632Q642 678 642 671Q642 657 621 641T577 617Q570 615 507 614H444Q427 592 406 542Q382 478 355 366T310 209Q280 123 238 78L230 69H330Q442 70 442 74Q443 74 443 77T447 87T460 105Q490 134 527 137Q545 137 545 125Q545 120 542 112Q531 78 491 49T399 7Q379 2 360 2T174 0",
        74: "148 78Q148 16 189 -17T286 -50Q319 -50 348 -33T396 10T426 59T444 101L471 204Q498 306 521 372Q575 532 649 605L659 614H591Q517 613 494 607Q433 591 400 550T360 477Q353 454 325 437T275 419Q256 419 260 435Q280 523 376 597T583 681Q603 683 713 683H830Q839 674 839 671Q839 654 810 634T754 614Q735 614 721 601Q688 571 654 495T600 351T561 209T541 132Q507 29 412 -45T213 -119Q141 -119 94 -77T47 33Q47 55 50 69T58 90T71 103Q105 131 135 131Q152 131 152 120Q152 119 151 114T149 99T148 78",
        75: "194 618Q193 618 182 613T156 601T131 594Q113 594 113 605Q113 623 144 644Q154 650 205 676T267 703Q277 705 279 705Q295 705 295 691Q295 569 250 397Q225 306 197 217T151 81T128 25Q120 8 94 -7T47 -22Q32 -22 32 -10L64 76Q95 163 133 295T185 530Q198 611 194 618ZM331 429Q331 383 364 290T449 117T542 36Q574 36 607 51T652 103Q660 124 677 133T709 143Q727 143 727 128Q727 119 723 111Q704 56 639 17T497 -22H493Q463 -22 425 16Q401 40 382 71Q335 138 296 243T256 399Q256 434 288 473Q342 540 471 622T670 705Q691 704 703 696Q732 678 732 644Q732 613 714 600T677 586Q671 586 667 587T660 592T657 604V619Q657 647 629 647Q623 647 620 646Q576 635 495 583T365 482Q331 448 331 429",
        76: "62 -22T47 -22T32 -11Q32 -1 56 24T83 55Q113 96 138 172T180 320T234 473T323 609Q364 649 419 677T531 705Q559 705 578 696T604 671T615 645T618 623V611Q618 582 615 571T598 548Q581 531 558 520T518 509Q503 509 503 520Q503 523 505 536T507 560Q507 590 494 610T452 630Q423 630 410 617Q367 578 333 492T271 301T233 170Q211 123 204 112L198 103L224 102Q281 102 369 79T509 52H523Q535 64 544 87T579 128Q616 152 641 152Q656 152 656 142Q656 101 588 40T433 -22Q381 -22 289 1T156 28L141 29L131 20Q111 0 87 -11",
        77: "28 9Q28 37 43 63T73 90Q77 90 83 84T103 70T141 57H146Q162 57 178 79T222 167Q266 279 295 371T334 513T349 598T358 651T371 677Q397 705 432 705Q442 705 445 699T452 666Q453 661 453 659Q475 538 509 405T568 207L574 192Q581 178 587 164T594 150Q596 150 635 189T693 248Q765 324 863 438T1024 626T1089 701Q1093 705 1100 705Q1111 705 1111 682Q1111 675 1108 660T1099 611T1086 540Q1041 277 1041 144Q1041 98 1044 75T1050 48T1059 42Q1064 41 1075 46Q1102 61 1121 61Q1137 61 1137 50Q1137 28 1087 0T1000 -29Q983 -29 972 -23T955 -9T945 16T942 45T941 83V96Q941 158 952 256T974 422L985 489Q984 489 939 436T821 300T698 164Q665 128 620 85T568 37Q564 34 558 34Q550 34 546 37T535 54Q512 91 496 127T450 259T389 498L384 518Q349 367 294 223T198 15Q155 -50 117 -50Q87 -50 61 -35T30 -6Q28 2 28 9",
        78: "343 705Q358 705 358 698Q360 696 370 658T411 524T484 319Q536 174 590 82L595 73L615 152Q646 274 683 407Q729 571 752 637T799 727Q852 780 937 788Q939 788 947 788T958 789H962Q979 789 979 765Q979 722 951 692Q942 683 924 683Q888 681 859 672T818 654T803 639Q784 608 708 322T631 15Q631 14 630 15Q630 17 629 15Q628 14 628 12Q621 -4 601 -17T560 -31Q550 -31 546 -28T530 -7Q484 67 458 123T398 272Q352 392 314 514L306 535V534Q306 533 296 488T272 379T234 239T185 100T127 -7T61 -50Q34 -50 4 -34T-27 8Q-27 33 -12 61T18 90Q21 90 36 77T87 57H92Q109 57 123 78T162 173Q206 299 232 417T265 599T276 667Q284 681 304 693T343 705",
        79: "308 428Q289 428 289 438Q289 457 318 508T378 593Q417 638 475 671T599 705Q688 705 732 643T777 483Q777 380 733 285T620 123T464 18T293 -22Q188 -22 123 51T58 245Q58 327 87 403T159 533T249 626T333 685T388 705Q404 705 404 693Q404 674 363 649Q333 632 304 606T239 537T181 429T158 290Q158 179 214 114T364 48Q489 48 583 165T677 438Q677 473 670 505T648 568T601 617T528 636Q518 636 513 635Q486 629 460 600T419 544T392 490Q383 470 372 459Q341 430 308 428",
        80: "37 475Q19 475 19 487Q19 536 103 604T327 682Q329 682 344 682T380 682T421 683H463Q625 683 695 615Q718 591 726 564Q733 547 733 525Q733 412 607 312T321 205H312Q293 205 293 217Q293 224 302 236T333 260T385 274Q558 287 614 407Q633 445 633 477Q633 515 612 543T556 585T481 607T399 614H370L368 603Q352 463 312 312T242 82T202 -13Q190 -33 164 -45T121 -57Q108 -57 108 -45Q108 -40 120 -10T151 73T192 190T233 349T266 539Q267 546 269 565T272 598T274 613H270Q209 613 163 588Q131 572 113 518Q102 502 80 490T37 475",
        81: "114 286Q114 358 151 433T249 569T392 667T558 705Q653 705 713 641T774 460Q774 389 750 322T687 206T600 114T504 46T412 4L399 -2Q542 -62 636 -62Q660 -62 670 -54T686 -27T700 0Q734 34 770 34Q787 34 787 23Q787 -18 720 -74T563 -131Q485 -131 350 -83T145 -34Q127 -34 127 -22Q127 -12 144 5T190 31L200 34L237 35Q386 38 467 79Q550 120 612 210T675 416Q675 510 625 573T484 636Q410 636 346 587T248 469T214 333Q214 306 221 281T243 229T288 188T360 172Q403 172 441 188T490 205Q510 205 510 192Q505 162 432 132T287 102Q206 102 160 155T114 286",
        82: "37 475Q19 475 19 487Q19 503 35 530T83 589T180 647T327 682H374Q387 682 417 682T464 683Q519 683 559 679T642 663T708 625T731 557Q731 481 668 411T504 300Q506 296 512 286T528 257T553 202Q594 105 611 82Q635 47 665 47Q708 47 742 93Q758 113 786 128Q804 136 819 137Q837 137 837 125Q837 115 818 92T767 43T687 -2T589 -22Q549 -22 517 22T467 120T422 221T362 273Q346 273 346 287Q348 301 373 320T436 342Q437 342 446 343T462 345T481 348T504 353T527 362T553 375T577 393Q598 412 614 443T630 511Q630 545 613 566T541 600T393 614Q370 614 370 613L366 584Q349 446 311 307T243 96L213 25Q205 8 179 -7T132 -22Q125 -22 120 -18T117 -8Q117 -5 130 26T163 113T205 239T246 408T274 606V614Q273 614 259 613T231 609T198 602T163 588Q131 572 113 518Q102 502 80 490T37 475",
        83: "554 512Q536 512 536 522Q536 525 539 539T542 564Q542 588 528 604Q515 616 482 625T410 635Q374 635 349 624T312 594T295 561T290 532Q290 505 303 482T342 442T378 419T409 404Q435 391 451 383T494 357T535 323T562 282T574 231Q574 133 464 56T220 -22Q138 -22 78 21T18 123Q18 184 61 227T156 274Q178 274 178 263Q178 260 177 258Q172 247 164 239T151 227T136 218L127 213L124 202Q118 186 118 163Q120 124 165 86T292 48Q374 48 423 86T473 186V193Q473 267 347 327Q268 364 239 389Q191 431 191 486Q191 547 242 600T356 679T470 705Q472 705 478 705T489 704Q551 704 596 682T642 610Q642 566 621 545Q592 516 554 512",
        84: "49 475Q34 475 34 490Q34 552 106 611T261 681Q272 683 507 683H742Q790 717 816 717Q833 717 833 708Q833 682 795 653T714 615Q691 610 588 609Q490 609 490 607L483 580Q476 554 462 496T435 392Q410 289 395 231T363 116T335 34T309 -15T279 -47T242 -64Q231 -68 218 -68Q203 -68 203 -57Q203 -52 211 -38Q224 -7 234 20T251 66T268 123T283 179T304 261T328 360Q342 415 360 488Q380 567 384 582T397 605Q400 607 401 609H302H244Q200 609 188 607T167 596Q145 572 145 541Q145 520 109 498T49 475",
        85: "8 592Q8 616 70 649T193 683Q246 683 246 631Q246 587 205 492T124 297T83 143Q83 101 100 75T154 48Q202 48 287 135T450 342T560 553Q589 635 593 640Q603 656 626 668T669 683H670Q687 683 687 672T670 616T617 463T547 220Q525 137 521 68Q521 54 522 50T533 42L543 47Q573 61 588 61Q604 61 604 47Q599 16 506 -22Q486 -28 468 -28T436 -18T421 18Q421 92 468 258Q468 259 467 257T459 248Q426 206 391 167T303 81T194 6T83 -22Q66 -22 58 -20Q25 -11 4 19T-17 99Q-17 146 8 220T64 358T120 488T146 586Q146 604 141 608T123 613H120Q99 613 72 597T25 580Q8 580 8 592",
        86: "25 633Q25 647 47 665T100 683Q291 683 291 306Q291 264 288 213T282 132L279 102Q281 102 308 126T378 191T464 279T545 381T596 479Q600 490 600 502Q600 527 581 550T523 577Q505 577 505 601Q505 622 516 647T542 681Q546 683 558 683Q605 679 631 645T658 559Q658 423 487 215Q409 126 308 37T190 -52Q177 -52 177 -28Q177 -26 183 15T196 127T203 270Q203 356 192 421T165 523T126 583T83 613T41 620Q25 620 25 633",
        87: "25 633Q25 647 46 665T103 683Q168 683 207 632Q228 608 243 568Q269 485 269 374Q269 324 265 271T256 184L251 150L252 152Q254 153 257 157T264 167T274 180T286 197Q359 293 424 398T519 558T549 616Q549 618 547 624T545 638Q550 654 572 668T615 683Q626 683 632 672T657 595Q726 370 741 128L742 110Q752 122 767 142T823 217T894 321T950 424T976 511Q976 544 958 560T918 577Q906 577 906 602Q906 629 918 651T942 681Q948 683 954 683Q983 683 1008 658T1034 569T999 421T915 257T813 109T724 -3T681 -49Q666 -59 660 -45Q659 -41 657 35T639 233T591 477Q573 551 570 551Q569 551 554 523T507 439T433 315T323 155T182 -25Q160 -52 151 -53Q137 -53 137 -30Q137 -29 148 25T170 168T181 338Q181 424 168 483T131 571T87 609T40 620Q25 620 25 633",
        88: "324 614Q291 576 250 573Q231 573 231 584Q231 589 232 592Q235 601 244 614T271 643T324 671T400 683H403Q462 683 481 610Q485 594 490 545T498 454L501 413Q504 413 551 442T648 509T705 561Q707 565 707 578Q707 610 682 614Q667 614 667 626Q667 641 695 662T755 683Q765 683 775 680T796 662T807 623Q807 596 792 572T713 499T530 376L505 361V356Q508 346 511 278T524 148T557 75Q569 69 580 69Q585 69 593 77Q624 108 660 110Q667 110 670 110T676 106T678 94Q668 59 624 30T510 0Q487 0 471 9T445 32T430 71T422 117T417 173Q416 183 416 188Q413 214 411 244T407 286T405 299Q403 299 344 263T223 182T154 122Q152 118 152 105Q152 69 180 69Q183 69 187 66T191 60L192 58V56Q192 41 163 21T105 0Q94 0 84 3T63 21T52 60Q52 77 56 90T85 131T155 191Q197 223 259 263T362 327T402 352L391 489Q391 492 390 505T387 526T384 547T379 568T372 586T361 602T348 611Q346 612 341 613T333 614H324",
        89: "65 599Q65 618 107 650T204 683Q267 683 312 643T380 533T414 385T424 217Q424 186 423 160T422 123Q426 123 468 170T567 304T650 469Q661 503 661 519Q661 546 639 570Q615 591 583 591Q569 591 569 616Q569 640 582 661T613 683Q624 683 638 679T671 664T702 625T714 558Q714 472 639 329T426 45Q361 -21 282 -82T154 -143Q97 -143 64 -104T31 -20Q31 4 44 25T70 46Q78 46 81 39T87 16T97 -9Q127 -51 182 -51Q184 -51 187 -50H190Q233 -41 314 25Q330 36 330 40Q336 79 336 178Q336 508 223 594Q199 614 158 619L148 620L139 611Q111 586 83 586Q65 586 65 599",
        90: "694 220Q708 220 708 210Q708 195 695 167T658 105T593 42T502 3Q492 1 458 1Q400 1 293 11T150 22Q116 22 92 11T51 0Q37 0 37 10Q37 21 63 44T179 146T367 319L391 343H343L296 344Q285 350 285 358Q285 365 289 372T300 383T313 392T324 398L329 400H450L561 518Q597 558 607 571L621 587H596Q553 589 484 599T383 609Q342 609 326 596T301 555Q294 533 263 514T208 492Q189 492 189 503Q189 510 197 528T215 559Q249 607 318 645T466 683Q504 683 573 673T669 662L690 661Q734 682 748 683Q767 683 767 673Q767 666 746 640Q655 531 555 428L529 400Q529 399 543 399Q604 397 604 366Q604 350 587 337T551 322Q541 322 539 323Q529 328 529 334Q529 339 487 342L470 343L446 320Q272 153 200 96L235 95Q297 95 392 86T533 74H554Q586 116 597 159Q604 179 635 199T694 220"
      }, {});
      return texCalligraphic$1;
    }
    var texMathit$1 = {};
    var texMathit = {};
    var hasRequiredTexMathit$1;
    function requireTexMathit$1() {
      if (hasRequiredTexMathit$1) return texMathit;
      hasRequiredTexMathit$1 = 1;
      Object.defineProperty(texMathit, "__esModule", { value: true });
      texMathit.texMathit = void 0;
      texMathit.texMathit = {
        65: [0.716, 0, 0.743],
        66: [0.683, 0, 0.704],
        67: [0.705, 0.021, 0.716],
        68: [0.683, 0, 0.755],
        69: [0.68, 0, 0.678],
        70: [0.68, 0, 0.653],
        71: [0.705, 0.022, 0.774],
        72: [0.683, 0, 0.743],
        73: [0.683, 0, 0.386],
        74: [0.683, 0.021, 0.525],
        75: [0.683, 0, 0.769],
        76: [0.683, 0, 0.627],
        77: [0.683, 0, 0.897],
        78: [0.683, 0, 0.743],
        79: [0.704, 0.022, 0.767],
        80: [0.683, 0, 0.678],
        81: [0.704, 0.194, 0.767],
        82: [0.683, 0.022, 0.729],
        83: [0.705, 0.022, 0.562],
        84: [0.677, 0, 0.716],
        85: [0.683, 0.022, 0.743],
        86: [0.683, 0.022, 0.743],
        87: [0.683, 0.022, 0.999],
        88: [0.683, 0, 0.743],
        89: [0.683, 0, 0.743],
        90: [0.683, 0, 0.613],
        97: [0.442, 0.011, 0.511],
        98: [0.694, 0.011, 0.46],
        99: [0.441, 0.01, 0.46],
        100: [0.694, 0.011, 0.511],
        101: [0.442, 0.01, 0.46],
        102: [0.705, 0.204, 0.307],
        103: [0.442, 0.205, 0.46],
        104: [0.694, 0.011, 0.511],
        105: [0.656, 0.01, 0.307],
        106: [0.656, 0.204, 0.307],
        107: [0.694, 0.011, 0.46],
        108: [0.694, 0.011, 0.256],
        109: [0.442, 0.011, 0.818],
        110: [0.442, 0.011, 0.562],
        111: [0.442, 0.011, 0.511],
        112: [0.442, 0.194, 0.511],
        113: [0.442, 0.194, 0.46],
        114: [0.442, 0.011, 0.422],
        115: [0.442, 0.011, 0.409],
        116: [0.626, 0.011, 0.332],
        117: [0.441, 0.011, 0.537],
        118: [0.443, 0.01, 0.46],
        119: [0.443, 0.011, 0.664],
        120: [0.442, 0.011, 0.464],
        121: [0.441, 0.205, 0.486],
        122: [0.442, 0.011, 0.409]
      };
      return texMathit;
    }
    var hasRequiredTexMathit;
    function requireTexMathit() {
      if (hasRequiredTexMathit) return texMathit$1;
      hasRequiredTexMathit = 1;
      Object.defineProperty(texMathit$1, "__esModule", { value: true });
      texMathit$1.texMathit = void 0;
      var FontData_js_1 = requireFontData();
      var tex_mathit_js_1 = requireTexMathit$1();
      texMathit$1.texMathit = (0, FontData_js_1.AddPaths)(tex_mathit_js_1.texMathit, {
        65: "85 46Q112 48 132 56T161 73T176 92T185 104Q185 106 353 407T524 709Q527 716 551 716Q568 716 572 712Q573 711 574 710Q576 708 594 384Q613 54 617 52H618Q626 46 672 46H689Q696 41 696 36Q696 13 683 0H670Q639 2 557 2Q526 2 500 2T459 2T441 1Q425 1 425 10Q425 12 427 24Q428 27 429 31T430 36T432 40T434 43T437 45T443 46T450 46Q514 46 514 69Q514 74 511 136L506 209H292L260 152Q222 84 222 74Q222 48 264 46Q280 46 280 35Q280 33 278 21Q275 7 272 4T259 0Q256 0 232 1T159 2Q135 2 109 1T78 0Q58 0 58 10Q58 14 61 26T66 40Q68 46 85 46ZM504 260Q503 263 496 407T486 553L466 520Q446 486 402 406L318 256Q318 255 411 255H504V260",
        66: "57 11Q57 38 69 45L74 46Q78 46 85 46T99 46Q134 47 145 50T162 62Q164 66 233 344T303 626Q303 627 302 629V631Q296 637 241 637H223Q217 642 217 645T219 664Q223 677 229 683H411L593 682L605 680Q616 678 628 675T660 662T694 639T720 601T732 547Q732 519 726 503Q710 452 662 414T556 360L545 357L556 355Q604 346 641 312T678 221Q678 155 622 92T482 8Q459 2 439 2T256 0H154H105Q74 0 66 2T57 11ZM629 549Q628 550 629 557T627 576T619 600T601 622T570 636Q564 637 490 637Q472 637 454 637T424 636T411 636Q399 635 395 622T364 500Q333 377 332 376Q332 374 408 374L485 375L495 377Q547 390 588 437T629 549ZM504 336Q500 337 410 337Q323 337 322 336Q322 334 305 263T270 122T252 51Q252 47 337 46Q346 46 361 46T384 45Q425 45 455 55T515 95Q574 156 574 235Q574 276 555 304T504 336",
        67: "395 -21Q279 -21 215 56T150 244Q150 402 265 543Q339 630 421 667T562 704Q596 704 604 703Q627 698 647 689T679 669T699 649T711 633T716 627L753 665Q790 704 792 704Q793 705 798 705Q812 705 812 698Q812 694 780 561Q744 422 744 421Q742 416 739 415T721 413H705Q699 419 699 426Q701 432 701 444Q705 464 705 493Q705 524 700 551T681 604T643 644T583 659Q480 659 387 570Q321 502 287 397T252 213Q252 123 297 74Q347 24 421 24Q500 24 564 89T653 240Q656 253 659 255T677 257Q700 257 700 248Q700 242 694 222Q681 183 656 143T593 65T504 3T395 -21",
        68: "56 11Q56 38 68 45L72 46Q77 46 84 46T98 46Q133 47 144 50T161 62Q163 66 232 344T302 626Q302 627 302 629L301 631Q295 637 240 637H222Q216 642 216 645T218 664Q222 677 228 683H403Q582 683 589 682Q672 674 723 608T775 440Q775 312 709 209T562 54Q502 14 432 2Q423 1 243 0H148H102Q72 0 64 2T56 11ZM254 51Q254 46 348 46Q395 46 422 50T484 71Q585 121 633 255Q679 396 679 477Q679 522 665 554T629 603T587 626T548 636Q547 636 536 636T510 636T480 637Q420 637 411 636T398 627Q396 623 325 339T254 51",
        69: "248 634Q216 634 214 638Q213 641 213 646Q213 674 224 678Q226 680 481 680H736Q743 676 743 669Q743 665 729 557T713 447Q711 440 690 440H675Q667 445 667 454Q667 455 671 481T675 536Q675 583 658 604T592 632Q574 634 475 634Q439 634 424 633T405 631T399 625Q397 622 367 501T336 377Q336 376 367 376H388Q451 376 477 389Q493 399 503 419T520 462T528 489Q531 493 549 493Q557 493 561 492T566 491T569 488T572 483L539 351Q507 221 503 216Q503 216 500 213H484Q468 213 465 216Q461 219 461 225Q461 228 466 250T472 290Q472 317 452 323T368 330H324Q323 326 289 191T255 51T331 46H360Q413 46 444 49T511 67T570 113Q589 137 608 175T638 242T652 272Q656 274 670 274Q693 274 693 262L648 148Q590 4 588 2Q585 0 323 0H61Q54 4 54 11Q54 27 61 41Q65 46 95 46Q131 47 142 50T159 62L194 200Q229 337 264 477T299 623Q299 630 292 631T248 634",
        70: "299 623Q299 630 292 631T247 634H219Q213 640 213 642T215 661Q218 673 225 680H724Q731 676 731 669Q731 665 717 557T701 447Q699 440 678 440H663Q656 444 656 452Q656 457 659 485T663 538Q663 586 644 607T566 633Q564 633 535 633T486 634H458Q404 634 399 625Q396 620 364 492L332 363H380Q446 365 464 373Q496 389 514 458Q518 477 523 479Q527 480 541 480H556Q563 475 563 470Q563 467 532 339T498 207Q496 200 475 200H460Q453 207 453 212Q454 213 456 225T461 254T464 278Q464 304 445 310T369 317H321L289 190Q257 66 257 59Q257 54 261 52T283 48T337 46Q348 46 352 46T360 45T366 42T368 37Q368 32 365 23Q360 4 355 2Q352 1 342 1Q336 1 297 1T199 2Q138 2 106 2T71 1H68Q54 1 54 11Q54 38 66 45L70 46Q75 46 82 46T96 46Q131 47 142 50T159 62L194 200Q229 337 264 477T299 623",
        71: "632 -1Q629 -1 622 5T604 25T583 53Q508 -22 394 -22Q287 -22 219 52T150 244Q150 402 265 543Q339 630 421 667T562 704Q596 704 604 703Q627 698 647 689T679 669T699 649T711 633T716 627L753 665Q790 704 792 704Q793 705 798 705Q812 705 812 698Q812 694 780 561Q744 422 744 421Q742 416 739 415T721 413H705Q699 419 699 426Q701 432 701 444Q705 464 705 493Q705 524 700 551T681 604T643 644T583 659Q480 659 387 570Q319 501 286 394T252 208Q252 156 269 118T314 61T369 33T425 24Q470 24 509 46T566 104Q571 116 583 162T595 214Q595 222 583 223Q561 227 517 227H495Q488 230 488 238Q488 254 495 268Q500 273 511 273Q515 273 532 273T581 272T649 271Q731 271 752 273H761Q767 267 767 264T765 246Q761 233 755 227H742Q698 227 693 213L639 4Q636 -1 632 -1",
        72: "61 0Q54 7 54 11Q54 27 61 41Q65 46 95 46Q131 47 142 50T159 62Q161 66 230 344T300 626Q300 627 300 629L299 631Q293 637 238 637H220Q214 642 214 645T216 664Q220 677 226 683H239Q307 681 372 681Q480 681 486 683H496Q502 677 502 674T500 656Q496 643 490 637H472Q418 637 406 630Q400 627 396 612T367 500Q360 474 352 442T340 395L336 380Q336 378 466 378H596Q657 622 657 626Q657 627 656 629V631Q650 637 595 637H577Q571 642 571 645T573 664Q577 677 583 683H596Q664 681 729 681Q837 681 843 683H853Q860 676 860 672Q858 647 848 637H819Q783 636 772 634T756 623Q753 618 684 340T614 57Q614 50 621 49T666 46Q697 46 699 40Q701 37 698 21Q693 3 689 1Q686 0 677 0Q673 0 657 0T611 1T546 2Q453 2 428 0H418Q411 7 411 11Q411 27 418 41Q422 46 452 46Q488 47 499 50T516 62Q517 64 550 196T584 331Q584 332 454 332H324L291 197Q257 64 257 56Q257 50 265 49T309 46Q340 46 342 40Q344 37 341 21Q336 3 332 1Q329 0 320 0Q316 0 300 0T254 1T189 2Q96 2 71 0H61",
        73: "235 637Q217 637 213 638T209 649Q209 673 220 682Q222 683 237 683Q278 681 369 681Q404 681 441 682T483 683Q499 683 503 681T508 672Q508 670 505 658T500 643Q498 637 464 637Q425 635 415 633T398 621Q396 618 327 340T257 58T260 52T278 48T322 46Q349 46 349 36Q349 31 346 22Q342 4 337 1Q336 1 334 1T329 0Q325 0 307 0T258 1T190 2Q95 2 67 0H56Q49 7 49 11Q51 38 62 46H91Q129 47 141 50T159 62Q161 66 230 344T300 625Q300 637 235 637",
        74: "361 637Q333 637 331 641Q330 644 330 649Q330 673 341 682Q343 683 360 683Q405 681 500 681Q551 681 577 681T607 682Q622 682 622 673Q622 665 616 647Q614 640 610 639T587 637Q547 636 541 624Q538 618 477 374T413 124Q391 64 333 22T207 -21T109 12T78 86Q78 130 101 150T149 170Q193 170 196 129Q196 100 178 80T137 58L132 57Q134 52 138 46T160 28T205 16Q242 16 273 48T319 122Q322 129 383 371T444 627Q444 637 361 637",
        75: "668 621Q668 635 645 637Q629 637 629 648Q629 650 632 662T637 677Q640 682 653 682Q657 682 688 681T764 680Q786 680 810 681T839 682Q859 682 859 672Q859 655 852 643Q849 637 839 637Q804 637 768 621T717 595T697 578Q696 578 600 497L505 417L508 408Q543 311 574 227T618 106T632 69Q645 47 688 46H707Q713 38 713 37T710 19Q706 6 700 0H688Q659 2 587 2Q557 2 532 2T492 2T474 1Q458 1 458 10Q458 13 460 23Q464 39 466 42T480 46Q526 46 526 72Q526 75 476 213L427 350Q426 350 396 325T334 272T302 242Q302 241 299 230T290 194T279 150Q257 61 257 55Q257 50 265 49T309 46H337Q343 40 343 38T341 19Q337 6 331 0H316Q280 2 190 2Q158 2 131 2T89 2T70 1Q54 1 54 11Q54 38 66 45L70 46Q75 46 82 46T96 46Q131 47 142 50T159 62Q161 66 230 344T300 626Q300 627 300 629L299 631Q293 637 238 637H220Q214 642 214 645T216 664Q220 677 226 683H239Q307 681 372 681Q386 681 414 681T464 682L487 683H496Q502 677 502 674T500 656Q495 641 491 637H462Q426 636 415 634T399 623Q396 618 358 467L320 314Q321 314 484 452Q510 474 552 509Q625 570 646 590T668 621",
        76: "61 0Q54 4 54 11Q54 27 61 41Q65 46 95 46Q131 47 142 50T159 62Q161 66 230 344T300 626Q300 627 300 629L299 631Q293 637 238 637H220Q214 642 214 645T216 664Q220 677 226 683H240Q275 681 371 681Q407 681 438 681T487 682T509 682Q527 682 527 674Q527 670 524 659Q523 657 523 654T522 649T520 645T519 642T517 640T515 639T512 638T507 637T502 637T494 637H478Q433 636 417 633T396 617Q395 614 325 334T255 51Q255 47 319 47Q387 47 410 52Q459 65 494 98T543 163T570 229T589 273H622Q628 264 628 262Q628 259 584 133T539 5Q537 1 511 1Q482 0 296 0H61",
        77: "72 1Q58 1 58 11Q58 33 66 41Q68 46 87 46Q150 50 168 84Q172 91 238 356T304 626Q304 627 304 629L303 631Q297 637 242 637H224Q218 642 218 645T220 664Q224 677 230 683H326H394Q417 683 422 682T429 676L480 127L502 163Q523 199 560 262T642 400Q801 668 805 676L817 683H1003Q1010 678 1010 672Q1010 650 997 637H979Q915 637 906 623Q903 618 834 340T764 57Q764 50 771 49T817 46H845Q851 38 851 37T848 19Q845 7 838 0H824Q789 2 701 2Q670 2 644 2T603 2T584 1Q569 1 569 11Q569 13 571 25Q576 42 581 45L586 46Q590 46 597 46T611 46Q646 47 657 50T674 62L813 616L634 313Q453 7 452 7Q446 0 428 0Q409 0 407 6Q405 10 379 304T351 604L285 348Q220 83 220 82Q220 65 233 57T279 46H295Q301 38 301 37T298 19Q295 7 288 0H275Q244 2 171 2Q145 2 123 2T88 2T72 1",
        78: "633 637Q624 637 621 639T617 650Q617 670 630 683H641Q682 680 736 680Q836 680 845 683H853Q860 676 860 672Q858 647 848 637H832Q764 633 750 598Q746 590 673 300Q656 230 638 156T610 44L600 7Q598 0 576 0H559Q553 6 448 297L342 588Q341 588 279 336T216 81Q216 49 274 46Q293 46 295 40Q297 37 294 21Q293 19 292 16T291 11T290 7T289 4T287 2T284 1T280 1T275 0T263 0T229 1T167 2Q91 2 70 0H61Q54 7 54 11T57 27Q61 41 64 43T83 46Q146 50 164 84Q167 90 235 362L303 634Q300 635 253 637H220Q214 643 214 645T216 664Q220 677 226 683H314Q386 683 397 683T410 677Q412 675 501 428L591 179Q591 178 592 180T595 189T600 209T610 246T624 303T645 385Q698 595 698 606Q698 618 683 627T633 637",
        79: "149 237Q149 326 186 413T282 563T412 665T552 704Q619 704 667 678T741 611T777 528T788 444Q788 328 728 219T572 44T377 -22Q275 -22 212 50T149 237ZM688 487Q688 570 650 617T548 665Q467 665 398 592T291 413T253 203Q253 119 290 70T387 20Q440 20 489 52T573 135T635 249T675 373T688 487",
        80: "62 0Q55 7 55 11Q55 27 62 41Q66 46 96 46Q132 47 143 50T160 62Q162 66 231 344T301 626Q301 627 300 629V631Q294 637 239 637H221Q215 642 215 645T217 664Q221 677 227 683H404H431H502Q578 683 615 675T684 636Q729 595 729 531Q729 462 671 396T524 308Q499 302 404 301H318L288 182Q258 63 258 55T310 46Q341 46 343 40Q345 37 342 21Q337 3 333 1Q330 0 321 0Q317 0 301 0T255 1T190 2Q97 2 72 0H62ZM626 555V562Q626 620 552 635Q546 636 481 637Q466 637 450 637T423 636T412 636Q401 635 398 627Q396 622 361 484Q353 452 344 416T330 362L325 344Q325 342 390 342H427Q523 342 567 386Q596 415 611 473T626 555",
        81: "460 -107Q460 -72 464 -42T468 -7L457 -10Q446 -14 424 -18T379 -22Q276 -22 213 50T149 237Q149 326 186 413T282 563T412 665T552 704Q664 704 726 631T788 442Q788 305 703 180Q627 64 517 13L506 8Q506 7 508 -12T513 -38T522 -59T538 -79T565 -85Q604 -85 634 -59T672 0Q676 11 684 11Q693 11 695 2Q695 -1 690 -20T673 -69T644 -126T599 -174T538 -194Q464 -194 460 -110Q460 -108 460 -107ZM689 481Q689 578 646 621T551 665Q468 665 391 586Q321 512 285 399T249 202Q249 106 295 58Q310 41 314 41Q315 41 315 46Q315 83 344 118T420 154Q450 154 473 135Q493 114 500 69L502 58L512 65Q571 110 613 192T672 348T689 481ZM472 49Q472 118 415 118Q393 118 373 98T353 51Q353 18 386 18H387Q424 18 472 40V49",
        82: "62 0Q55 7 55 11Q55 27 62 41Q66 46 96 46Q132 47 143 50T160 62Q162 66 231 344T301 626Q301 627 300 629V631Q294 637 239 637H221Q215 642 215 645T217 664Q221 677 227 683H386Q554 682 569 679Q571 678 580 676Q643 662 680 623T717 533Q717 473 667 420T528 337L538 330Q563 314 578 286T594 228Q594 212 588 147T581 65Q581 36 589 26T616 16H618Q637 16 652 37Q668 57 677 94Q679 105 701 105T723 95Q723 89 717 72T698 33T662 -5T610 -22Q555 -22 513 3T471 88Q471 107 486 168T502 244Q502 303 452 320Q445 322 382 323H320L288 192Q255 63 255 55T307 46Q338 46 340 40Q342 37 339 21Q335 3 330 1Q326 0 320 0Q317 0 306 0T265 1T190 2Q99 2 73 0H62ZM612 558Q612 566 612 568T610 581T603 597T590 611T567 625T532 635Q526 636 470 637Q458 637 445 637T422 636T412 636Q402 635 397 627L390 598Q383 570 373 532T354 455T337 389T330 361Q356 360 384 360H415Q483 360 527 382Q557 399 574 424T604 498Q612 533 612 558",
        83: "198 460Q198 551 269 628T432 705Q516 705 557 644L583 673Q589 679 593 684T600 693T605 698T609 702T611 704T614 705T618 705H620Q633 705 633 698T605 577T573 459L570 456H554Q546 456 543 456T536 457T532 460T531 466Q531 469 533 489T536 532Q536 573 525 600T496 640T462 657T427 662Q369 662 325 612T281 503Q281 475 290 458T318 430T356 415T407 401T463 383Q506 360 522 323T538 258V244Q538 141 465 60T300 -22Q198 -22 152 41L143 31Q137 25 126 12T106 -10T95 -21L92 -22Q88 -22 86 -22Q81 -22 78 -20T74 -16V-14Q74 -11 132 221Q134 227 155 227H171Q177 221 177 215Q177 212 175 205T171 182T169 147Q171 99 195 70T246 33T306 25Q358 25 400 70T453 169Q455 180 455 203V210Q455 263 414 285Q409 288 347 305Q271 328 254 339Q239 350 224 371Q198 409 198 460",
        84: "178 437Q173 442 171 446Q171 451 238 654Q243 670 250 677H681H762Q792 677 799 676T806 667Q806 661 788 553T768 444Q768 437 746 437Q727 437 723 445Q723 450 729 492T736 562Q736 589 728 602T693 624Q675 630 622 630H595Q575 630 571 629T564 623Q562 621 492 342T422 59Q422 48 502 46H542Q548 38 548 37T545 19Q541 6 535 0H517Q475 2 357 2Q315 2 279 2T223 2T198 1Q179 1 179 9Q179 14 182 24Q187 42 190 44Q194 46 206 46H232Q289 47 301 49T326 65L395 344Q465 619 465 626Q465 629 462 629Q456 631 411 631Q364 631 336 625T288 597T255 549T224 467Q215 442 210 437H178",
        85: "636 637Q627 637 624 639T620 650Q620 670 633 683H644Q702 681 753 681Q760 681 772 681T796 681T820 682T838 683H845H853Q860 676 860 672Q858 647 848 637H832Q764 633 750 598Q745 588 698 400T648 204Q627 140 584 86Q484 -22 378 -22Q300 -22 247 31T194 167Q194 176 194 182T196 198T200 218T207 248T217 288T231 346T250 422Q300 618 300 626Q300 627 300 629L299 631Q293 637 238 637H220Q214 642 214 645T216 664Q220 677 226 683H239Q307 681 372 681Q480 681 486 683H496Q502 677 502 674T500 656Q496 643 490 637H472Q418 637 406 630Q400 627 394 603T344 410Q299 232 292 198T284 135Q284 102 294 78T322 44T355 29T387 24Q455 24 515 74T604 211Q605 215 653 404T701 607Q701 618 686 627T636 637",
        86: "667 637Q657 637 654 639T650 650Q650 670 663 683H675Q704 681 772 681Q793 681 818 682T847 683Q868 683 868 672Q868 670 865 658T860 643Q857 637 848 637Q785 637 749 587L394 -15Q387 -22 366 -22Q346 -22 342 -16Q341 -13 313 303Q285 622 285 623Q283 631 273 634T229 637Q205 637 205 648Q205 654 208 666T217 682Q219 683 230 683Q276 680 329 680Q444 680 456 683H466Q472 677 472 674T470 656Q466 643 460 637H448Q384 637 384 615Q385 612 406 371T427 126Q427 125 495 240T632 473T704 596Q707 604 707 609Q707 633 667 637",
        87: "234 637H226Q205 637 205 648Q205 673 216 682Q218 683 231 683Q265 681 340 681Q371 681 404 682T443 683Q458 683 462 681T467 672Q467 670 464 658T459 643Q457 637 434 637Q407 636 394 632T378 623T376 613Q376 589 385 377T394 149L511 361Q542 419 596 519L613 551L612 585Q610 621 610 624Q608 637 559 637H555Q537 637 537 647Q537 654 540 664Q544 677 550 683H561Q600 680 656 680Q771 680 783 683H792Q798 677 798 675T796 658Q792 643 790 640T778 637H774Q721 637 708 620L717 385Q726 150 727 149Q727 148 752 193T812 303T882 433T942 546T969 596Q970 600 970 606Q970 610 969 613T966 620T961 625T955 628T949 631T941 633T934 634T927 636T920 637Q903 637 903 648Q903 650 905 664Q909 677 915 683H928Q960 681 1031 681Q1050 681 1073 681T1101 682Q1124 682 1124 672Q1124 655 1117 643Q1114 637 1104 637Q1085 637 1069 632T1043 618T1026 603T1014 588L1009 580L687 -16Q681 -22 660 -22Q643 -22 637 -16Q635 -14 627 223Q617 441 617 464L602 441Q578 397 487 228Q456 171 423 110T372 17T355 -15Q348 -22 328 -22Q312 -22 308 -20T303 -9Q303 -5 291 310T277 627Q273 636 234 637",
        88: "684 0Q670 0 634 1T569 2Q512 2 482 2T449 1Q433 1 433 10Q433 11 435 25Q437 34 438 37T442 43T448 45T459 46T476 49Q506 58 506 64Q506 65 467 179T426 295L382 244Q339 194 295 142T249 86Q245 79 245 72Q245 48 279 46Q293 46 293 32Q293 13 280 0H268Q206 2 151 2Q70 2 64 0Q50 0 50 11Q50 15 53 27Q57 41 60 43T78 46Q154 49 205 100Q207 103 312 225L411 341L407 353Q404 360 381 428T336 560T310 627Q301 636 255 637H229Q223 643 223 645T225 664Q229 677 235 683H246Q288 680 346 680Q462 680 477 683H487Q493 677 493 674T491 656Q488 644 485 641T471 637Q461 635 454 635Q419 626 421 619Q421 617 453 524T486 430T554 509T624 593Q631 604 631 611Q631 622 621 629T598 637Q583 637 583 648Q583 650 585 660Q589 676 591 679T602 683Q606 683 637 682T715 680Q742 680 771 681T804 682Q825 682 825 672Q825 650 817 642Q814 637 797 637Q739 634 700 608Q684 597 659 569T505 389L501 384L557 222Q612 61 616 57Q625 47 671 46Q691 46 697 45T704 36Q704 35 702 23Q701 19 700 14T699 7T696 3T692 1T684 0",
        89: "232 637Q198 637 198 647Q198 651 201 664T210 682Q212 683 223 683Q269 680 325 680Q443 680 455 683H465Q472 676 472 672Q472 656 465 642Q460 637 441 637Q395 634 395 623Q395 621 438 478T482 334T583 460T688 591Q688 593 694 601T700 617Q700 637 668 637H666Q655 637 655 648Q655 654 658 664Q660 672 660 673T663 678T668 682T677 683Q680 683 704 682T776 680Q801 680 828 681T858 682Q875 682 875 673Q875 669 872 657T867 643Q865 637 848 637Q788 634 749 597Q733 581 608 424L487 273L461 170Q454 145 448 118T438 76T434 60Q434 54 436 52T452 48T496 46H514Q520 41 520 38T518 19Q514 6 508 0H495Q427 2 364 2Q350 2 323 2T272 0H250H241Q234 7 234 11Q234 27 241 41Q245 46 275 46Q312 47 323 50T340 64Q340 65 344 79T355 120T368 171L393 274L341 448Q288 622 286 626Q278 636 232 637",
        90: "203 452Q203 455 236 565T270 677Q270 681 274 681Q276 683 488 683H699Q704 678 704 675Q704 663 697 649Q697 647 449 348L201 50L266 49H301Q442 49 495 116Q525 155 556 251Q563 274 565 278T579 282H585Q609 285 609 271Q609 270 570 142T528 8T518 1T466 0H303Q253 0 197 0T131 -1Q112 -1 102 -1T87 1T81 3T80 8Q80 30 89 39Q90 41 204 178T446 470T575 626L584 637H512H504H475Q446 637 426 635T378 624T330 597T289 546T254 467Q247 446 243 444Q239 442 226 442Q203 442 203 452",
        97: "418 53Q418 26 438 26Q466 26 494 131Q500 151 504 152Q507 153 516 153H521Q531 153 534 153T540 150T543 144Q543 141 540 126T529 88T509 43T477 5T434 -11Q404 -11 383 3T354 30T347 48H346Q345 47 342 45T337 40Q282 -11 228 -11Q172 -11 137 34T101 146Q101 260 177 351T333 442Q343 442 352 441T369 437T382 431T393 425T402 417T409 410T414 402T419 396Q423 406 436 414T461 422Q475 422 484 413T494 395Q494 384 459 244T420 88Q418 80 418 58V53ZM397 323Q397 344 382 374T333 405Q302 405 271 372Q249 349 235 316T203 215Q184 135 184 108V100V94Q184 54 207 35Q218 26 235 26Q279 26 330 91Q343 109 346 118T372 217Q397 317 397 323",
        98: "158 683Q163 683 223 688T300 694Q312 694 312 685T279 544Q243 405 243 403L256 412Q268 422 292 432T338 442Q395 442 431 398T467 284Q467 175 393 82T229 -11Q175 -11 142 32T108 142Q108 176 115 207T166 412Q177 458 190 510T209 588T216 616Q216 629 209 632T170 637H149Q143 643 143 645T145 664Q150 683 158 683ZM178 109Q178 27 234 27Q247 27 254 29Q295 44 323 94Q343 129 363 208T384 332Q384 354 382 361Q369 405 332 405Q282 405 228 326L222 317L205 250Q178 142 178 109",
        99: "257 -10Q183 -10 143 37T103 155Q103 257 173 341T337 440Q341 441 348 441H358Q421 441 445 415T469 356Q469 320 450 305T410 289Q392 289 381 299T370 325Q370 362 404 378L414 383Q392 402 365 405Q322 405 285 375T227 294Q217 271 202 213T187 119Q187 27 263 27Q299 27 330 40Q361 51 386 71T424 106T440 121Q444 121 455 110T466 96Q466 92 458 81T432 54T390 24T331 0T257 -10",
        100: "418 54Q418 26 438 26Q466 26 494 131Q500 151 504 152Q507 153 516 153H521H526Q543 153 543 144Q543 143 541 129Q531 91 521 65T487 14T434 -11T383 3T354 30T347 48H346Q345 47 342 45T337 40Q282 -11 228 -11Q172 -11 137 34T101 146Q101 255 174 348T337 441Q354 441 368 437T390 427T404 414T413 404T417 400L471 616Q471 629 464 632T425 637H404Q398 643 398 645T400 664Q405 683 413 683Q418 683 478 688T555 694Q567 694 567 686Q567 676 495 389L419 86Q418 80 418 61V54ZM397 323Q397 329 394 340T385 367T365 394T333 405Q302 405 271 372Q249 349 235 316T203 215Q184 135 184 108V100Q184 71 191 56Q204 26 235 26Q267 26 300 57T344 112Q347 117 372 217T397 323",
        101: "107 166Q107 230 131 283T193 369T270 420T345 441Q346 441 352 441T361 442H364Q409 442 439 418T470 355Q470 270 366 239Q308 223 218 223H205Q189 164 189 125Q189 83 206 55T261 27Q309 27 353 50T426 109Q436 121 440 121T453 111T466 97Q469 92 455 77Q424 41 372 16T258 -10Q184 -10 146 41T107 166ZM416 333T416 354T401 390T360 405Q322 405 292 384T246 336T223 288T215 261Q215 260 240 260Q262 261 276 262T314 266T353 275T384 291T408 317",
        102: "351 608Q351 642 389 661Q368 668 365 668Q358 668 352 664Q349 663 347 661T342 654T337 647T333 637T330 627T327 614T324 601T321 587T318 571L291 432Q291 431 343 431H394Q400 426 400 423T398 404Q394 390 389 386L335 385H282L255 246Q212 20 189 -51Q136 -199 58 -204Q22 -204 0 -185T-23 -134Q-23 -100 -3 -85T37 -69Q54 -69 65 -80T76 -108Q76 -115 75 -119Q70 -134 61 -144T46 -158L39 -161Q39 -162 42 -163T50 -166T61 -168Q77 -168 91 -145Q98 -128 105 -95L125 -1Q145 90 146 98Q149 109 163 180T189 317T202 384T158 385H114Q108 390 108 393T110 412Q113 424 120 431H165Q211 431 211 433Q213 435 219 473T237 561T266 639Q282 667 310 686T367 705Q402 705 426 686T450 635Q450 600 430 585T390 569Q373 569 362 580T351 608",
        103: "103 163Q106 263 173 347T320 441Q322 441 329 441T341 442Q387 439 419 398Q420 399 420 400Q421 402 425 406T440 416T464 422Q476 421 485 413T494 396Q494 386 465 268T407 38T377 -77Q365 -123 310 -164T179 -205Q46 -205 46 -139Q46 -114 64 -97T106 -79Q127 -79 136 -91T146 -115Q146 -127 141 -138T130 -155T124 -162T125 -163Q133 -166 170 -168Q200 -168 217 -162Q242 -153 264 -130T297 -78Q298 -74 305 -46T320 10T327 38Q326 38 317 31T291 15T256 2Q249 1 231 1Q182 1 143 38T103 163ZM398 324Q398 330 395 346T375 383T332 405Q330 405 326 405T320 404Q291 396 263 365Q230 324 208 239T185 115Q185 38 238 38Q258 38 279 50T312 77T336 106L348 122Q349 125 373 223T398 324",
        104: "398 44Q398 26 414 26Q431 26 451 43Q477 71 496 136Q499 148 501 150T515 153H521Q531 153 534 153T541 150T544 143Q544 133 534 105T496 41T432 -8Q424 -10 408 -10Q370 -10 348 12T326 72Q326 93 342 135Q397 288 397 349Q397 367 396 372Q386 405 357 405Q283 405 228 310Q217 290 212 274T180 152Q153 42 148 26T135 3Q121 -11 102 -11Q89 -11 80 -3T69 19L216 616Q216 629 209 632T170 637H149Q143 643 143 645T145 664Q150 683 158 683Q163 683 223 688T300 694Q312 694 312 685Q312 674 277 539Q241 395 241 393Q242 394 249 399T259 407T271 415T285 424T300 431T318 437T338 440T362 442Q423 442 449 410T475 338Q475 290 437 178T398 44",
        105: "234 599Q234 620 251 638T292 656Q306 656 319 647T332 617Q332 594 313 577T273 560Q260 560 247 569T234 599ZM75 287Q75 292 82 313T103 362T142 413T196 441H214Q248 441 270 419T293 357Q292 338 289 330T245 208Q193 72 193 46Q193 26 209 26Q228 26 247 43Q273 71 292 136Q295 148 297 150T311 153H317Q327 153 330 153T337 150T340 143Q340 133 330 105T292 41T228 -8Q220 -10 204 -10Q160 -10 141 15T122 71Q122 98 171 227T221 384Q221 396 218 400T203 405Q175 403 156 374T128 312T116 279Q115 278 97 278H81Q75 284 75 287",
        106: "266 600Q266 622 283 639T322 656Q340 656 352 645T364 616Q364 596 347 578T305 560Q291 560 279 569T266 600ZM75 287Q75 293 86 316T117 369T168 420T236 442Q282 442 304 415T327 358V332L278 134Q269 98 260 60T246 3T236 -36T227 -66T220 -85T213 -101T204 -114Q181 -150 139 -177T46 -204Q8 -204 -12 -186T-32 -140Q-32 -112 -14 -96T27 -79Q48 -79 57 -91T67 -114Q67 -146 38 -166Q42 -168 49 -168Q75 -168 98 -147T130 -108T146 -71Q150 -59 199 138T250 346Q253 359 253 373Q253 405 230 405Q206 405 184 386T149 345T126 301L117 280Q115 278 98 278H81Q75 284 75 287",
        107: "158 683Q163 683 223 688T300 694Q312 694 312 686Q312 679 262 478L211 273Q212 272 219 276T248 299T296 349Q317 371 328 382T360 410T399 434T439 442Q462 442 480 427T498 373Q498 329 479 313T437 296Q420 296 409 305T398 331Q398 357 413 372T445 391Q454 392 448 399Q445 405 431 405Q408 405 377 385Q351 368 314 327T250 261Q243 257 243 254Q249 254 279 243T328 220Q366 192 366 146Q366 131 361 109T355 62V54Q355 26 376 26Q379 26 387 28Q420 36 443 130Q449 151 454 152Q457 153 465 153H470Q484 153 488 152T492 144Q492 141 489 126T476 88T454 42T420 5T372 -11Q331 -11 306 17T280 88Q280 100 283 119T287 146Q287 172 265 190T221 215T198 220Q197 220 173 121Q152 37 148 24T135 3Q121 -11 102 -11Q89 -11 80 -3T69 19L216 616Q216 629 209 632T170 637H149Q143 643 143 645T145 664Q150 683 158 683",
        108: "162 61Q162 26 183 26Q211 26 239 131Q245 151 249 152Q252 153 261 153H266H271Q288 153 288 144Q288 143 286 129Q276 91 266 65T232 14T179 -11Q144 -11 116 12T87 81Q87 96 88 102L216 616Q216 629 209 632T170 637H149Q143 643 143 645T145 664Q150 683 158 683Q163 683 223 688T300 694Q312 694 312 686Q312 676 240 389L164 86Q162 74 162 61",
        109: "81 278Q75 284 75 289Q77 299 89 338Q101 373 114 396T142 428T166 439T186 442H189Q225 440 251 417Q266 401 271 384L275 374L286 386Q342 442 414 442Q428 442 440 440T461 435T479 427T493 418T503 407T511 397T516 387T520 378T523 370L524 366Q546 395 583 418T667 442Q729 442 755 411T782 338Q782 290 743 178T704 45Q704 26 720 26Q773 26 802 136Q805 148 807 150T822 153H828Q838 153 841 153T848 150T851 143Q851 137 843 115T821 63T778 12T715 -10Q671 -10 652 16T632 71Q632 88 668 191T704 349Q704 367 703 372Q693 405 664 405Q637 405 613 393T571 360T547 329T534 309Q523 290 518 274T487 151Q455 24 452 16Q438 -11 408 -11T376 18Q376 26 411 167T447 314Q449 325 449 346Q449 372 444 384Q431 405 408 405Q334 405 276 305Q266 289 262 273T231 151Q199 24 196 16Q182 -11 152 -11T120 18Q120 26 159 182T200 347Q202 361 202 372Q202 405 181 405Q168 405 159 391Q145 374 132 328T117 280T98 278H81",
        110: "449 44Q449 26 465 26Q482 26 502 43Q528 71 547 136Q550 148 552 150T566 153H572Q582 153 585 153T592 150T595 143Q595 133 585 105T547 41T483 -8Q475 -10 459 -10Q421 -10 399 12T377 72Q377 93 393 135Q448 288 448 349Q448 367 447 372Q437 405 408 405Q381 405 357 393T315 360T291 329T278 309Q267 290 262 274T231 151Q199 24 196 16Q182 -11 152 -11T120 18Q120 23 159 181Q199 343 199 346Q202 360 202 372Q202 406 183 406Q163 406 148 374Q142 360 135 338T124 299T117 280T98 278H81Q75 284 75 287Q76 293 78 303T90 341T110 388T141 425T184 442Q195 442 204 441T221 436T235 429T247 421T256 412T262 403T267 394T271 387T273 381L274 378V374L287 387Q342 442 414 442Q474 442 500 410T526 338Q526 290 488 178T449 44",
        111: "103 155Q103 266 185 354T366 442Q435 442 476 394T517 275Q517 169 436 79T255 -11Q194 -11 149 32T103 155ZM187 119Q187 67 209 47T260 26Q290 26 321 47Q354 68 380 113T426 260Q432 291 432 315Q432 361 408 385Q388 405 358 405Q319 405 283 374T227 294Q217 271 202 213T187 119",
        112: "81 278Q75 284 75 287Q93 379 131 417Q154 442 189 442Q222 440 243 423T272 382L280 390Q335 442 389 442Q446 442 482 398T518 284Q518 212 480 137T375 19Q321 -10 291 -10H282H278Q237 -10 204 28L202 32L181 -51Q160 -135 160 -139Q160 -147 205 -148H230Q236 -155 236 -157T233 -175Q230 -187 227 -190T214 -194Q211 -194 202 -194T169 -193T108 -192Q40 -192 21 -194H13Q6 -187 6 -183T9 -167Q13 -153 16 -151T39 -148Q73 -147 78 -136Q82 -128 139 104Q199 337 199 347Q202 362 202 372Q202 406 182 406Q169 406 159 391Q145 374 132 328T117 280T98 278H81ZM221 111Q234 26 286 26Q307 26 336 47T385 116Q398 147 416 217T435 332Q435 354 433 361Q420 405 383 405Q333 405 279 326L273 317L221 111",
        113: "228 -11Q172 -11 137 33T101 147Q101 205 125 266T201 377T318 441Q322 442 333 442Q388 442 420 394L429 403Q439 413 455 423T481 437T494 442Q498 442 501 439T504 434Q504 425 435 149Q364 -135 364 -139Q364 -147 409 -148H434Q440 -155 440 -157T437 -175Q433 -191 429 -193Q425 -194 418 -194Q416 -194 406 -194T372 -193T309 -192Q259 -192 233 -192T204 -193Q190 -193 190 -184Q190 -181 192 -169Q196 -153 199 -151T219 -148Q266 -148 277 -141Q283 -137 305 -51L325 29L316 22Q270 -11 228 -11ZM397 323Q397 329 394 340T385 367T365 394T333 405Q302 405 271 372Q249 349 235 316T203 215Q184 135 184 108V100Q184 71 191 56Q204 26 235 26Q267 26 300 57T344 112Q347 117 372 217T397 323",
        114: "81 278Q75 284 75 289Q77 301 89 339Q122 442 183 442Q219 442 241 425T271 384L283 396Q327 442 384 442Q424 442 454 421T484 362Q484 327 464 312T424 296Q407 296 396 305T385 331Q385 352 394 365T414 384T424 390Q409 405 378 405Q322 405 276 315L268 300L234 161Q200 25 196 16Q182 -11 152 -11T120 18Q120 23 159 181Q199 343 199 346Q202 360 202 372Q202 405 182 405Q164 405 150 377T128 316T117 280Q115 278 98 278H81",
        115: "153 285Q153 349 197 395T311 442Q355 442 386 420T418 356Q418 321 401 308T365 294Q336 294 331 326Q331 336 334 345T343 359T353 368T362 374L366 376Q365 379 362 383T344 396T308 404Q265 404 246 377T226 325T244 289T287 275T339 258T383 212Q395 188 395 163Q395 132 379 95T333 32Q279 -11 207 -11Q154 -11 115 13T76 86Q76 108 83 123T102 145T121 153T135 156Q154 156 164 145T175 117Q175 82 142 66L132 62Q131 62 131 61Q131 57 139 49T166 34T210 26Q250 26 277 44T312 83T321 123Q321 153 301 166T248 185T204 198Q176 211 162 241Q153 258 153 285",
        116: "94 385Q87 392 87 395Q87 399 90 411T95 425Q97 430 103 430T149 431H196L215 511Q218 521 222 539T228 565T234 585T242 603T251 615T264 623T281 626Q311 626 315 597Q315 591 296 513T275 433Q275 431 320 431H366Q373 424 373 420Q373 398 360 385H263L189 86Q188 80 188 61V54Q188 29 201 27Q213 23 229 30Q253 37 276 66T316 138Q321 149 324 151T342 153H347Q364 153 364 146T360 130Q331 63 290 26T202 -11Q158 -11 135 18T111 81Q111 93 129 168T166 314L184 383Q184 385 139 385H94",
        117: "75 287Q75 299 89 333T135 404T205 441Q246 441 269 420T293 357Q292 338 259 245T225 95Q225 26 274 26Q301 26 324 43T358 77T369 99Q369 102 406 249T446 404Q460 431 490 431T522 402Q522 394 485 245T446 89Q443 74 443 56Q443 28 461 26Q487 26 507 86Q524 130 524 146Q524 147 530 153H547Q570 153 570 144Q570 138 561 109T544 62Q530 29 512 12Q492 -11 454 -11Q429 -9 410 2T385 23T376 41L363 28Q350 16 325 3T269 -10Q204 -10 176 25T148 108Q148 161 184 262T221 383Q221 405 206 405Q178 405 158 375T128 313T116 279Q115 278 97 278H81Q75 284 75 287",
        118: "387 386Q387 407 406 425T445 443Q466 443 479 423T492 371Q492 330 473 253Q411 18 307 -8Q298 -10 279 -10Q208 -10 179 26T149 114Q149 162 185 261T221 384Q221 405 206 405Q177 405 157 375T128 313T116 279Q115 278 97 278H81Q75 284 75 287T79 304T93 342T119 388T158 425T210 441H218Q243 441 268 421T293 357Q292 337 259 245T226 102Q226 26 285 26Q328 26 360 72T422 237Q429 265 429 290Q428 324 408 349T387 386",
        119: "591 386Q591 407 610 425T649 443Q670 443 683 423T696 371Q696 327 672 232T621 85Q575 -11 493 -11Q469 -11 449 -6T418 8T398 24T386 38L382 43Q347 -10 293 -10H286Q221 -10 186 21T150 115Q150 164 185 262T221 384Q221 405 206 405Q177 405 157 375T128 313T116 279Q115 278 97 278H81Q75 284 75 287T79 304T93 342T119 388T158 425T210 441H218Q243 441 268 421T293 357Q292 336 260 246T227 108Q227 26 292 26H295Q332 26 361 93L366 103V119Q366 122 367 133T369 150Q372 167 401 282T433 404Q446 431 477 431Q507 431 509 402Q509 396 500 358T474 254T446 140Q444 126 444 104V92Q444 66 459 46T502 26H505Q527 28 545 43T577 88T602 149T623 226Q633 265 633 290Q632 324 612 349T591 386",
        120: "275 356Q275 383 262 394T233 405Q196 405 166 371T121 289Q119 280 116 279T98 278H81Q77 282 76 283T75 288T78 300Q88 332 109 363T153 411Q195 442 235 442Q306 442 333 386Q373 442 427 442Q461 442 487 421T513 364T494 312T453 296Q436 296 425 305T414 331Q414 352 424 366T446 386L456 390Q448 404 421 404H418Q382 404 358 341Q355 332 328 227T298 105Q295 90 295 75Q295 26 339 26Q365 26 388 43T424 82T444 123T451 146L457 153H474Q490 153 493 152T496 144Q496 133 486 110T456 58T404 10T333 -11Q276 -11 237 45Q197 -11 146 -11Q108 -11 83 10T58 67Q58 99 76 117T119 135Q136 135 147 124T158 96Q158 89 157 85Q149 57 125 45L115 41Q125 26 151 26Q171 26 187 45T214 93Q217 102 244 210T273 330Q275 339 275 356",
        121: "75 287Q75 299 89 333T135 404T205 441Q246 441 269 420T293 357Q292 338 259 245T225 95Q225 26 274 26Q325 26 367 93L405 245Q442 393 446 404Q460 431 490 431T522 402Q522 400 416 -24Q389 -102 327 -153T196 -205Q152 -205 122 -181T91 -119Q91 -84 110 -67T152 -49Q170 -49 180 -60T191 -87Q191 -108 174 -128Q167 -134 157 -138T146 -144Q155 -153 159 -156T173 -163T199 -167Q229 -167 255 -149T297 -105T325 -52T342 -6T347 15Q315 -10 269 -10Q204 -10 176 25T148 108Q148 161 184 262T221 383Q221 405 206 405Q178 405 158 375T128 313T116 279Q115 278 97 278H81Q75 284 75 287",
        122: "160 317Q158 317 155 317Q136 317 136 324Q136 351 171 396T260 442Q292 442 321 410T365 375H369Q384 375 404 408L425 441Q427 442 444 442H460Q466 436 466 434Q466 419 426 367Q387 314 294 222T178 105L170 95L181 94Q198 93 236 81T295 68Q328 68 356 89T395 141Q398 150 401 151T419 153Q441 153 441 144Q441 110 394 50T282 -11Q251 -11 221 23T171 57Q157 57 143 47T121 26T104 3T95 -10Q93 -11 76 -11H60Q54 -5 54 -2Q54 3 61 14Q103 88 233 215Q349 329 349 338L302 351Q269 362 247 362Q227 362 212 356T192 342T183 327T178 320Q175 317 160 317"
      }, {});
      return texMathit$1;
    }
    var texOldstyleBold$1 = {};
    var texOldstyleBold = {};
    var hasRequiredTexOldstyleBold$1;
    function requireTexOldstyleBold$1() {
      if (hasRequiredTexOldstyleBold$1) return texOldstyleBold;
      hasRequiredTexOldstyleBold$1 = 1;
      Object.defineProperty(texOldstyleBold, "__esModule", { value: true });
      texOldstyleBold.texOldstyleBold = void 0;
      texOldstyleBold.texOldstyleBold = {
        48: [0.46, 0.017, 0.575],
        49: [0.461, 0, 0.575],
        50: [0.46, 0, 0.575],
        51: [0.461, 0.211, 0.575],
        52: [0.469, 0.194, 0.575],
        53: [0.461, 0.211, 0.575],
        54: [0.66, 0.017, 0.575],
        55: [0.476, 0.211, 0.575],
        56: [0.661, 0.017, 0.575],
        57: [0.461, 0.21, 0.575],
        65: [0.751, 0.049, 0.921, { ic: 0.068, sk: 0.224 }],
        66: [0.705, 0.017, 0.748, { sk: 0.16 }],
        67: [0.703, 0.02, 0.613, { sk: 0.16 }],
        68: [0.686, 0, 0.892, { sk: 0.0958 }],
        69: [0.703, 0.016, 0.607, { ic: 0.02, sk: 0.128 }],
        70: [0.686, 0.03, 0.814, { ic: 0.116, sk: 0.128 }],
        71: [0.703, 0.113, 0.682, { sk: 0.128 }],
        72: [0.686, 0.048, 0.987, { sk: 0.128 }],
        73: [0.686, 0, 0.642, { ic: 0.104, sk: 0.0319 }],
        74: [0.686, 0.114, 0.779, { ic: 0.158, sk: 0.192 }],
        75: [0.703, 0.017, 0.871, { sk: 0.0639 }],
        76: [0.703, 0.017, 0.788, { sk: 0.16 }],
        77: [0.703, 0.049, 1.378, { sk: 0.16 }],
        78: [0.84, 0.049, 0.937, { ic: 0.168, sk: 0.0958 }],
        79: [0.703, 0.017, 0.906, { sk: 0.128 }],
        80: [0.686, 0.067, 0.81, { ic: 0.036, sk: 0.0958 }],
        81: [0.703, 0.146, 0.939, { sk: 0.128 }],
        82: [0.686, 0.017, 0.99, { sk: 0.0958 }],
        83: [0.703, 0.016, 0.696, { ic: 0.025, sk: 0.16 }],
        84: [0.72, 0.069, 0.644, { ic: 0.303, sk: 0.0319 }],
        85: [0.686, 0.024, 0.715, { ic: 0.056, sk: 0.0958 }],
        86: [0.686, 0.077, 0.737, { ic: 0.037, sk: 0.0319 }],
        87: [0.686, 0.077, 1.169, { ic: 0.037, sk: 0.0958 }],
        88: [0.686, 0, 0.817, { ic: 0.089, sk: 0.16 }],
        89: [0.686, 0.164, 0.759, { ic: 0.038, sk: 0.0958 }],
        90: [0.686, 0, 0.818, { ic: 0.035, sk: 0.16 }]
      };
      return texOldstyleBold;
    }
    var hasRequiredTexOldstyleBold;
    function requireTexOldstyleBold() {
      if (hasRequiredTexOldstyleBold) return texOldstyleBold$1;
      hasRequiredTexOldstyleBold = 1;
      Object.defineProperty(texOldstyleBold$1, "__esModule", { value: true });
      texOldstyleBold$1.texOldstyleBold = void 0;
      var FontData_js_1 = requireFontData();
      var tex_oldstyle_bold_js_1 = requireTexOldstyleBold$1();
      texOldstyleBold$1.texOldstyleBold = (0, FontData_js_1.AddPaths)(tex_oldstyle_bold_js_1.texOldstyleBold, {
        48: "259 460H279Q352 460 403 444T491 378Q528 320 528 219Q528 100 475 45Q417 -17 287 -17Q152 -17 99 44T46 219Q46 246 47 265T57 318T82 376T131 422T210 454Q234 460 259 460ZM389 229V271Q389 351 371 380T280 409Q232 409 208 385Q194 371 190 345T185 229V210Q185 108 194 83Q208 35 287 35Q317 35 336 42Q372 55 380 85T389 204V229",
        49: "119 417Q191 417 240 428T310 450T338 461Q353 461 357 452T361 400Q361 389 361 342T360 254V62H420H456Q483 62 488 58T494 35V29Q494 13 491 7T473 0Q468 0 424 1T295 2T167 1T117 0Q114 0 111 0T107 1Q96 8 96 27V35Q96 54 102 58T140 62H170H229V213Q229 363 228 363Q220 360 196 358T150 356L130 355H93Q84 360 82 365T80 386Q80 404 81 407T95 417H119",
        50: "214 399Q202 399 191 398T175 395T170 392L171 390Q172 389 174 386T178 379T181 369T182 355Q182 328 165 312T123 296Q99 296 82 312T64 356Q64 397 105 428T253 460Q301 460 337 456T411 441T476 403T514 338Q516 328 516 310V304Q516 257 470 227Q456 217 427 205T376 184L354 176Q350 174 325 162T277 139L254 128Q414 129 428 130H439Q450 148 453 166T460 188T486 193H493Q515 193 517 178Q517 171 502 94T484 11Q481 3 472 2T410 0H269Q65 0 62 2Q55 5 53 10T51 32Q51 54 56 58Q60 62 173 131Q296 207 318 224Q368 264 368 308Q368 342 342 363T283 392T214 399",
        51: "80 309Q80 367 131 414T276 461Q388 461 441 417T494 313Q494 265 463 223T373 155L361 151L376 147Q436 132 480 92T525 -15T487 -127T393 -192T274 -211Q179 -211 114 -167T48 -53Q48 -18 69 5T128 29Q168 29 188 5T208 -50Q208 -59 207 -67T203 -81T197 -92T190 -101T183 -109T177 -114T170 -118L167 -121Q160 -125 164 -127Q167 -129 176 -133Q215 -152 268 -152H273Q337 -152 356 -92Q364 -69 364 -14Q364 45 352 74T303 120Q287 125 240 125H230Q201 125 196 127T191 146V152Q192 170 196 173T233 178Q234 178 241 178T252 179T262 181T274 183T285 188T297 195T308 205T319 218T328 235T337 257Q345 280 345 320V330Q345 345 343 355T335 379T312 399T270 407Q226 407 177 377Q226 356 226 310Q226 270 204 253T153 235Q123 235 102 253T80 309",
        52: "180 0Q155 0 124 0T84 -1Q48 -1 40 3T32 27V37Q32 59 34 63T204 265T377 465Q380 468 383 468H387Q391 468 398 468T411 469Q432 469 438 468T449 459Q451 455 451 258V62H489H498Q531 62 536 58T542 31Q542 9 537 5T504 0H489H451V-132H489H498Q530 -132 536 -136T542 -163Q542 -181 538 -187T522 -194Q518 -194 483 -193T378 -192Q281 -192 256 -193L217 -194Q203 -189 203 -169V-163V-158Q203 -140 209 -136T246 -132H265H314V0H180ZM325 62V320L105 63L215 62H325",
        53: "131 29Q159 26 175 12T194 -13T197 -35V-41Q197 -58 195 -66Q191 -76 185 -84T173 -97T161 -105T152 -109L148 -110Q148 -112 158 -121T195 -141T252 -152Q274 -152 280 -151Q335 -137 349 -104T363 9Q363 85 356 114T322 157Q305 166 286 166Q251 166 223 154T182 131T162 109Q154 98 150 96T130 93Q107 93 102 104Q100 107 100 279V371V424Q100 461 110 461Q114 461 123 458T149 450T183 441Q234 429 286 429Q313 429 340 432T387 440T422 449T447 457T458 461Q472 461 472 435Q472 420 470 418Q464 405 438 379T352 325T226 297Q189 297 171 301H168V182Q169 182 174 185T190 194T213 205T248 213T292 217Q391 217 454 159T517 5Q517 -92 444 -151T255 -211Q167 -211 112 -160T57 -44Q57 -12 76 8T131 29",
        54: "48 316Q48 398 70 462T124 562T198 621T274 652T339 660Q377 660 384 659Q497 632 497 532Q497 507 482 487T431 466Q397 466 381 486T365 530Q365 569 405 593Q382 603 381 603Q361 607 350 607Q316 607 279 589T221 533Q199 489 196 385L195 370Q196 371 203 379T217 395T237 410T263 424Q283 431 313 431Q409 431 468 368Q526 310 526 208Q526 131 492 81T405 5Q359 -17 289 -17Q256 -17 227 -11T163 17T105 73T65 170T48 316ZM293 380Q244 380 220 331T196 212Q196 104 216 80Q240 41 292 41Q295 41 301 41T309 42Q338 46 355 62Q372 81 375 108T379 230Q378 314 372 333Q358 375 299 380H293",
        55: "95 210H88Q66 210 64 225Q64 229 82 345T102 465Q106 476 125 476H131Q162 476 162 458Q162 451 213 448Q221 448 238 447T260 446Q261 446 410 444Q436 444 468 444T509 445Q544 445 551 440T558 413V404Q558 395 547 380T478 301L392 202Q354 150 339 81T321 -104V-132Q321 -187 286 -203Q273 -211 255 -211Q236 -211 217 -199T190 -160Q189 -153 189 -130Q194 17 282 156Q309 200 370 270Q404 307 400 307H293Q151 306 146 303Q140 300 132 259T120 215Q115 210 95 210",
        56: "48 164Q48 199 59 228T92 277T128 307T163 329Q159 332 155 336Q135 346 110 382Q80 427 80 477Q80 564 147 620Q202 660 264 660Q266 660 275 660T290 661Q384 661 439 619T494 506Q494 486 489 468T477 437T459 413T440 395T421 380T406 370L410 368Q414 365 421 361T437 351T456 335T476 316T495 291T511 262T522 228T526 189Q526 93 460 38T282 -17Q242 -17 205 -9T130 19T71 75T48 164ZM406 506Q406 545 379 576T283 607Q218 606 193 585T168 536Q168 522 172 513T195 490T224 471T275 443L346 403Q406 446 406 506ZM291 42Q365 42 395 70T425 134V141Q425 170 401 190T319 242Q308 248 302 251Q286 260 266 271T235 288L225 294Q222 292 217 289T198 274T175 249T157 212T148 163Q148 116 179 79T291 42",
        57: "175 -140Q198 -152 236 -152Q294 -152 332 -116Q356 -91 366 -54T379 62V78L376 74Q372 70 366 64T352 50T333 35T308 23Q289 17 262 17Q168 17 108 77T48 235Q48 273 59 317Q81 381 141 421T276 461Q279 461 285 461T295 460Q326 460 354 454T415 426T471 371T510 277T526 136Q526 42 501 -28T432 -136T341 -192T240 -210Q199 -210 169 -201T121 -178T94 -146T80 -112T77 -82Q77 -51 95 -33T143 -15Q170 -15 189 -33T209 -81Q209 -116 175 -140ZM377 244V274Q377 300 376 316T368 352T348 384T312 405Q307 406 283 406Q257 406 238 396T213 376T205 361Q196 341 196 259V233V181Q196 122 211 96T278 69H298Q330 82 345 104Q367 134 376 190Q377 200 377 244",
        65: "761 751Q784 751 784 728V711Q784 570 795 417T820 191Q844 76 865 76Q868 76 902 93T962 112H973Q989 104 989 94Q989 92 987 86Q978 47 846 -11Q812 -25 779 -26Q722 -26 708 9Q688 47 669 161H524L379 162L359 136Q286 43 234 -3T142 -49T71 -19T39 55Q39 92 60 131T103 174Q113 174 117 167T124 149T136 128T166 110Q183 105 190 105Q230 105 341 246Q401 322 453 397T531 514T582 601T611 651H640V663Q640 692 676 718T745 750Q747 750 752 750T761 751ZM658 266Q653 312 649 377T644 489T641 541V556L557 415Q500 325 448 253Q467 261 524 261H568H658V266",
        66: "441 83Q571 83 571 195Q571 246 538 279T466 322T386 333Q378 333 357 330T329 327Q307 327 307 345Q307 354 313 365T347 396T419 430Q546 472 581 498Q594 508 594 535Q594 574 567 589T508 604Q469 604 442 583Q390 546 342 457T265 256Q237 148 186 60Q167 29 144 13Q105 -15 68 -17H65Q40 -17 40 1Q40 7 53 29T87 100T124 210Q162 373 190 575Q188 575 174 567T138 550T98 542Q75 542 75 560Q75 588 123 618Q135 625 203 659T281 696Q299 703 316 703Q339 703 339 685Q339 656 328 583L333 588Q338 592 346 599T367 615T394 634T428 654T467 674T511 690T559 701T611 705Q651 704 681 689Q739 659 739 598Q739 507 595 427L584 421Q585 420 595 416T610 410T626 402T644 392T660 380T677 365T691 347T703 325T710 299T715 268Q717 193 665 130Q622 73 531 28T348 -17Q275 -17 225 10Q206 19 200 24T193 36Q193 57 231 86T311 119H322Q386 83 441 83",
        67: "243 -20Q135 -20 78 48T20 218Q20 280 39 344T98 470T193 580T324 661T488 702H490Q491 702 493 702T498 703T507 703T518 702H526Q599 702 599 631Q599 597 577 550T541 486Q523 463 490 447T431 430Q423 430 419 433Q409 437 409 450Q410 456 432 499T454 567Q454 586 446 594T415 603Q316 603 254 532Q216 487 190 421T164 284Q164 228 181 186T226 122T282 90T340 80Q377 80 405 96T449 131T492 167T553 187H555Q580 187 580 168Q580 153 551 123T476 60T367 4T243 -20",
        68: "107 0Q92 5 92 18Q92 33 113 53T160 86Q170 91 182 94T197 100L206 120Q248 226 273 337T304 501T309 585Q278 585 234 577T179 557Q172 550 166 532T156 509Q140 484 105 466T44 447Q20 447 20 465Q20 482 34 510T76 565Q122 608 173 632Q281 686 447 686H480H517Q692 686 784 631Q885 571 885 450Q885 339 805 239T586 75T286 1Q276 0 187 0H107ZM741 391Q741 424 731 452T694 510T613 558T481 584Q476 584 468 584T457 585L449 586V579Q441 501 425 424T391 292T357 193T330 125T319 100H324Q511 100 628 175Q688 215 714 275T741 391",
        69: "495 516Q485 516 478 520T470 532Q470 537 476 550T482 570Q482 589 465 596T401 603Q344 603 319 582Q295 558 295 519Q295 493 312 474T355 445T407 432T455 427Q477 427 477 409Q477 395 453 371T389 333Q380 330 345 327T279 312T223 272Q181 223 181 176Q181 131 225 107T324 83Q366 83 395 98T448 136T487 167Q517 185 547 187H551Q574 187 574 170Q574 151 535 113T421 36T271 -15Q260 -16 226 -16Q181 -16 152 -9Q104 4 71 33T37 111Q37 140 50 176T106 263T216 356Q215 357 207 362T190 374T172 392T156 419T150 456Q150 521 208 580T341 670T474 702Q475 703 499 703Q528 703 547 701T586 693T615 673T627 637Q627 584 581 550T495 516",
        70: "812 567Q804 567 795 570T786 579Q786 586 647 586H559L558 582Q558 575 539 510T506 407L498 384H775Q788 378 790 368Q790 328 746 298T665 268Q646 268 642 284H457L447 261Q396 150 360 94Q329 46 270 8T149 -30Q123 -30 100 -24T63 -10T37 9T22 26T17 36Q17 59 56 88T135 119Q145 119 149 117T165 104Q187 78 227 72Q232 72 234 76Q245 93 273 145T350 323T424 570L428 586H276Q265 575 239 563T190 551Q180 551 174 556T167 569Q167 580 179 597T213 634T278 668T371 685Q374 686 624 686Q863 685 888 682Q917 678 927 663Q930 658 930 650Q930 624 888 596T812 567",
        71: "50 279Q50 361 88 438T190 570T335 661T503 702H514Q524 703 532 703Q671 703 671 626Q671 580 614 514T495 447Q472 447 472 465Q472 477 499 511T527 562Q527 582 507 592T433 602Q351 602 302 569Q252 535 223 469T194 344Q194 266 237 217T352 168Q401 168 442 205T505 316Q515 345 551 368T622 393H625Q649 393 649 376Q649 371 635 318T612 237Q580 129 540 62T442 -49Q353 -114 264 -114Q259 -114 252 -114L246 -113Q190 -113 142 -107T81 -96Q71 -90 71 -81Q71 -57 110 -30T187 2Q196 2 236 -4T338 -14Q371 -14 377 -9Q410 24 446 113L451 127Q353 68 253 68Q157 68 104 129T50 279",
        72: "42 447Q20 447 20 465Q20 481 47 515T119 589T239 657T392 686Q443 686 463 664T484 616Q484 570 473 506T452 401L441 360Q441 359 550 359H660L663 370Q684 435 716 522T758 624Q771 646 806 666T870 686Q894 686 894 668Q894 667 867 597T804 416T752 218Q737 135 737 93Q737 77 746 65T778 53Q799 53 803 54T814 63Q831 86 864 103T924 120Q946 120 946 100Q945 85 931 63T888 16T806 -27T684 -48H681Q625 -48 603 -10Q593 4 593 29Q593 71 603 131T624 230L634 269Q632 269 624 266Q610 261 600 261T507 259H411L399 222Q344 62 322 21Q301 -7 268 -24T209 -41H207Q187 -41 185 -25Q185 -17 192 2T220 71T261 184Q284 256 284 258Q284 259 227 259H170Q169 259 166 261T162 264T158 266T156 271T155 277Q155 296 184 320T250 356Q259 358 286 359Q312 359 312 360Q314 372 318 385Q332 450 339 526Q339 530 339 535T340 543Q340 586 296 586Q255 586 227 576T188 553T165 523T146 497Q127 476 97 462T42 447",
        73: "56 499Q32 499 32 516Q32 540 64 580T165 649Q241 682 365 685Q366 685 376 685T405 685T445 686T496 686T553 686H732Q746 677 746 668Q746 646 711 620T642 587L572 586H503Q479 546 458 479T424 352T383 224T318 111L309 101L412 100H514L523 109Q567 150 618 153Q644 153 644 135Q644 132 642 124Q629 86 581 52T476 6Q454 2 433 2T216 0Q-11 0 -15 2Q-27 6 -27 18Q-27 37 2 61T59 93Q77 100 142 100H198Q255 177 299 369Q337 513 382 574L391 586H348Q261 586 176 576Q163 543 124 521T56 499",
        74: "286 390Q263 390 263 407Q263 432 293 481T367 566Q511 687 724 687Q738 687 761 687T793 686H923Q937 677 937 668Q937 648 905 623T842 589Q829 587 817 586T802 585T795 583T788 578Q709 506 632 189Q622 153 615 134T588 81T537 17Q482 -39 404 -76T247 -114Q192 -114 158 -100Q53 -61 53 32Q53 59 58 73T79 102Q126 147 177 147Q200 147 200 128Q200 123 198 112T196 96Q196 47 238 17T345 -13Q362 -13 377 -9T404 0T426 16T444 34T459 55T470 76T478 97T483 116T488 132L490 141Q511 222 520 257T554 364T608 486T675 576L685 586H634H612Q532 586 484 564Q453 549 436 526T409 478T395 447Q378 424 345 407T286 390",
        75: "98 542Q75 542 75 560Q75 588 123 618Q132 624 199 657T275 694Q291 703 315 703Q327 703 332 699T338 690T339 670Q339 596 323 505T283 337T237 194T198 90L181 53Q170 31 136 8T68 -17H65Q40 -17 40 0L76 92Q112 185 150 322T194 564V578L168 565Q125 542 98 542ZM834 142Q834 125 819 100T774 48T692 3T576 -16H560Q540 -16 508 6Q469 33 422 108T342 267T309 398Q309 411 310 417T320 442T347 482Q401 542 517 615T710 702Q712 702 721 702T735 703Q772 703 791 690Q819 674 819 646T792 597T733 574H722Q704 584 704 599Q706 607 700 610T672 617L660 613Q609 595 524 538T423 450V440Q423 376 488 247T604 83Q621 70 640 70Q677 70 701 82Q713 87 718 101T737 132T783 160Q792 163 807 163Q834 163 834 142",
        76: "63 -17Q41 -17 41 0Q41 22 85 54Q101 68 113 92T133 141T154 219T182 315Q230 462 306 553Q345 599 391 632T478 678T543 697T582 703Q584 703 589 703T598 702Q643 702 666 676T689 613Q689 588 683 575Q674 551 632 524T552 496Q530 496 530 512Q530 517 531 525T533 538Q533 559 522 577T480 596H476Q462 596 451 588T415 544Q350 447 310 281Q284 181 261 136L255 124H285Q342 123 441 107T583 90L596 89Q603 116 647 144T729 173Q751 173 751 157Q751 118 685 60T523 -15Q514 -16 479 -16Q421 -16 320 0T171 18H155L142 10Q98 -17 63 -17",
        77: "38 20Q38 59 60 99T104 139Q106 139 126 125T176 106H181Q200 106 221 139T286 281Q322 370 342 451T368 581T376 634Q384 657 420 680T487 703Q502 703 507 696T522 649Q538 589 554 537Q579 453 609 372T660 248T686 202Q687 201 739 244T830 322L1166 642Q1225 700 1230 701Q1230 701 1237 703Q1258 703 1258 667L1253 637Q1248 607 1241 558T1227 451T1214 326T1209 202Q1209 77 1232 77Q1237 77 1269 94T1326 112H1329Q1353 112 1353 94Q1353 81 1334 60Q1311 37 1248 7T1150 -24H1141H1135Q1085 -24 1074 26Q1064 75 1064 134Q1064 239 1086 426Q1087 430 1087 434L1061 410Q871 227 783 149L694 76Q653 44 647 40T631 34Q620 34 616 37T594 63Q546 125 514 198Q467 307 423 449L418 466L412 444Q376 310 306 153Q278 88 251 45T201 -18T163 -43T131 -49Q102 -48 70 -31T38 20",
        78: "47 139Q81 105 122 105Q137 105 147 117Q159 134 182 199T234 381T274 610Q275 634 284 647Q297 666 327 684T389 703Q403 703 408 695T428 645Q480 490 567 298Q628 163 673 103Q674 102 674 102T675 106Q732 331 803 551Q842 674 875 725Q908 775 966 807T1081 840H1084Q1105 840 1105 803Q1105 768 1088 733T1051 689Q1045 686 1032 686Q986 683 948 663T901 624Q881 579 837 430T760 154L726 28Q725 28 725 28T723 25Q716 0 682 -24T611 -48Q600 -48 595 -45T576 -23Q522 44 480 124Q417 243 332 463L328 473L325 457Q291 293 227 124Q159 -49 72 -49Q38 -49 5 -28Q-24 -8 -24 21Q-24 58 -3 98T41 139H47",
        79: "433 703Q456 703 456 685Q456 672 441 655T407 627Q402 623 378 611T328 579T276 524Q207 434 207 324Q207 222 270 153T441 84Q566 84 651 177T737 400V405Q737 496 693 549T576 603Q542 603 510 560Q490 537 472 502T442 454Q397 412 346 409Q320 409 320 427Q320 430 322 436Q331 465 360 507T433 594T542 671T677 703Q776 703 829 636T882 468Q882 369 831 277T702 122T528 21T343 -17Q214 -17 139 61T63 257Q63 336 94 409T173 534T272 625T367 684T432 703H433",
        80: "170 -67Q147 -67 147 -49Q147 -42 162 -8T204 99T253 254Q274 332 288 415T305 542L308 585Q277 585 234 577T179 557Q172 550 166 532T156 509Q140 484 105 466T44 447Q20 447 20 465Q20 482 34 510T76 565Q122 608 173 632Q279 686 448 686H495H537Q622 686 678 677T784 637Q846 598 846 533Q846 452 776 375T597 252T378 206H366L358 181Q341 130 316 68T282 -7Q262 -33 230 -50T170 -67ZM701 468Q701 512 661 540T570 577T461 586H448V582Q446 576 443 545T428 447T395 301L389 280Q390 280 398 284T419 295T441 303Q443 304 484 306T572 321T651 359Q701 402 701 468",
        81: "874 453Q874 372 836 298T750 177T638 89T543 33T486 8L483 7Q485 5 523 -7T622 -32T726 -46Q741 -46 746 -45T755 -41T762 -27Q770 -1 806 23T878 50H890Q905 42 905 33Q905 -8 838 -68T670 -145Q662 -146 628 -146Q538 -146 389 -100T164 -50Q132 -50 132 -32T162 11T227 47Q231 48 286 51T394 62T518 100T641 180Q730 271 730 387Q730 478 673 540T520 602Q410 602 337 525T264 355Q264 284 310 244T420 203Q476 203 568 222Q594 222 594 204Q594 184 565 161T508 128Q433 103 316 103Q227 103 174 157T120 290Q120 382 182 471T343 620T548 697Q578 703 601 703Q604 703 611 703T623 702Q663 702 687 696Q760 679 817 618T874 453",
        82: "159 0Q159 5 172 34T205 114T245 229T284 386T309 575V585H304Q303 585 295 585T282 584Q233 579 207 570T175 553T165 531T156 509Q140 484 105 466T44 447Q20 447 20 465Q20 482 34 510T76 565Q122 608 173 632Q279 686 448 686H505H582Q683 686 745 672T834 611Q842 594 842 565Q842 523 824 484T780 419T722 370T669 336T632 318L619 312L626 302Q640 279 667 227T696 172Q717 133 735 112T762 88T784 84Q824 84 872 118T957 153Q981 153 981 136Q981 114 937 78T820 13T684 -17Q646 -17 616 8T569 66T526 151T477 234Q461 256 446 265Q437 272 421 274Q400 274 400 291Q400 311 430 336T495 371Q496 371 543 374T627 392T681 436Q699 467 699 503Q699 550 644 568T471 586H449V582Q449 581 447 559T438 499T422 413T393 298T348 165Q313 73 296 45Q282 24 249 4T185 -17Q159 -17 159 0",
        83: "204 476Q204 525 248 577T372 666T539 703T674 683T721 612Q721 588 714 569Q704 547 669 524T601 499Q573 499 573 516Q573 521 575 527T577 543Q577 563 568 574T548 588L539 590Q490 603 444 603Q418 603 394 597T364 583Q348 567 348 533Q348 493 382 466T459 425T555 387T633 330Q662 292 662 249Q662 153 544 69T257 -16Q218 -16 208 -15Q118 1 64 46Q25 76 25 126Q25 185 82 235T203 290H207Q229 290 231 274Q231 243 180 213Q173 209 172 206T170 189T171 170T183 150T216 121Q273 83 356 83Q412 83 459 100Q493 111 507 141Q518 165 518 185Q518 208 506 228T478 262T437 288T398 306T360 320Q316 335 285 352T239 384T215 416T205 443T204 467V476",
        84: "61 462H59Q38 462 38 479Q38 528 109 594T289 683L304 685L837 687L846 693Q889 720 923 720Q947 720 947 702Q945 671 892 631T776 583Q774 583 772 583T769 582T766 582L764 581H758Q753 581 744 581T722 580T693 580T662 580H563L514 385Q507 355 493 299T475 225T460 172T443 119T426 76T402 24Q386 -11 355 -33T304 -61T266 -69Q242 -69 242 -50Q243 -45 253 -25T278 32T307 115L364 340Q405 511 413 538T436 580H207Q202 572 200 568T197 561T195 552T190 537Q176 511 135 487T61 462",
        85: "124 586Q107 586 74 569T15 552H13Q-10 552 -10 570Q-10 605 70 645T222 686Q283 686 283 631Q283 590 246 504T172 326T135 181Q135 130 157 107T205 83Q221 83 259 106Q347 165 453 301T604 548Q607 557 612 569T619 587T624 600T628 612T632 621T637 628T641 634T647 640T654 645T662 652Q706 686 748 686Q771 686 771 669Q771 656 754 614T700 467T630 229Q615 168 610 105Q610 88 617 78L641 90Q681 111 706 112Q733 112 733 95Q733 82 714 60Q694 40 633 10Q567 -23 532 -24Q507 -24 495 -17Q466 -4 466 32Q466 96 500 225Q277 -17 102 -17Q56 -17 23 17T-10 118Q-10 164 13 234T64 363T115 481T139 567Q139 586 124 586",
        86: "25 608Q25 628 60 657T148 686Q184 683 213 671T273 625T327 538T363 394T380 184L381 134L399 148Q503 226 574 302T667 415T689 467Q688 474 684 482T672 502T645 521T600 532Q576 532 576 567Q576 604 597 644T641 685H649Q701 685 737 648T774 545Q774 457 703 333T461 66Q397 13 332 -32T255 -77Q237 -77 237 -30V-23Q241 20 241 109Q241 483 115 569Q91 586 50 589Q25 589 25 608",
        87: "25 607Q25 629 62 657T142 686Q205 686 248 647T312 541T339 411T347 275Q347 249 345 203V189Q375 219 449 316T587 516Q629 584 629 587Q629 589 626 597T622 607Q622 629 658 656T732 686H744Q755 680 757 678Q757 677 769 649T799 577T835 475T874 339T904 183Q908 157 910 151L925 169Q997 252 1059 343T1121 474Q1120 498 1103 513T1059 532Q1036 532 1036 568Q1036 600 1053 636T1090 683L1097 686H1109Q1147 684 1176 652T1206 551Q1206 460 1131 320T897 7Q859 -33 840 -52T816 -74T804 -77Q788 -77 784 -32Q783 -28 783 -26Q774 108 744 239T691 436T665 501Q664 501 649 475T602 400T528 289T420 146T280 -15Q243 -56 231 -66T210 -77Q191 -77 191 -40Q191 -38 195 -4T204 91T209 217Q209 290 202 351T177 469T126 557T45 589Q25 589 25 607",
        88: "762 562Q762 579 737 584T711 604Q711 630 753 658T834 686Q864 686 885 669T906 627Q906 580 834 522T614 379L584 362V357Q585 354 589 315T597 233T603 183Q610 132 627 116T671 100Q678 100 704 113T754 126T778 107Q776 79 733 45T626 2Q615 1 578 1Q542 1 535 3Q521 7 510 15T491 31T477 54T467 78T460 108T456 137T452 170T449 201Q447 220 445 240T442 270L441 281Q435 281 357 233Q240 165 206 135Q200 128 200 124Q200 113 208 108T226 101T244 96T252 82Q252 61 214 31T129 1H120Q97 1 77 16T56 60Q56 105 133 168T414 345Q428 352 431 354T433 359Q422 493 414 522Q407 551 395 566T373 583T350 586H341L332 580Q290 560 265 560Q243 560 243 577Q243 585 248 596T269 624T306 653T365 676T447 686H456Q472 686 484 683T514 671T543 637T562 576Q565 557 570 501L577 437Q577 436 613 457T694 506T756 551Q762 558 762 562",
        89: "73 555Q49 555 49 573Q49 602 110 644T239 686Q319 686 376 624Q416 584 444 511T483 361T499 240T503 173Q503 165 504 165Q506 165 524 184T556 218Q631 297 674 377T718 485Q718 505 699 526Q673 552 628 552Q619 552 613 562T607 590Q607 617 621 645T658 685Q661 686 671 686Q718 686 757 652T797 545Q797 476 749 369T602 146Q500 29 371 -67T176 -164Q112 -164 74 -120T36 -29Q36 5 55 36T95 67Q104 67 108 59T115 39T128 12T154 -12Q183 -30 216 -30Q239 -30 305 7L361 44L367 49V54Q367 95 364 143T351 273T312 429T243 546Q206 581 156 588L146 581Q108 555 73 555",
        90: "622 574Q522 579 420 579H396Q373 579 364 574T351 550Q339 516 297 490T218 462Q195 462 195 479Q195 487 197 492Q218 565 313 625T509 685Q564 685 650 683T755 680Q787 680 807 683T831 686Q853 686 853 669Q853 657 826 626Q742 532 641 437L619 415L622 414Q626 414 631 414T642 414Q697 411 697 388Q697 367 670 345T607 323Q605 323 592 325T546 329H522L490 302Q457 274 400 226T289 136L260 113L318 112Q345 111 452 109T587 106H627Q650 143 656 170Q666 197 710 225T788 253Q811 253 811 237Q811 211 781 160T710 77Q619 0 515 0Q507 0 497 0T484 1Q434 1 319 3T177 6Q123 6 95 2Q83 2 71 0H68Q46 0 46 17Q46 28 58 44Q68 56 100 80T210 165T383 307L408 329H361L314 330Q297 338 297 350Q297 368 320 388T368 413Q375 415 441 415H506L647 555L664 574H622"
      }, {});
      return texOldstyleBold$1;
    }
    var texOldstyle$1 = {};
    var texOldstyle = {};
    var hasRequiredTexOldstyle$1;
    function requireTexOldstyle$1() {
      if (hasRequiredTexOldstyle$1) return texOldstyle;
      hasRequiredTexOldstyle$1 = 1;
      Object.defineProperty(texOldstyle, "__esModule", { value: true });
      texOldstyle.texOldstyle = void 0;
      texOldstyle.texOldstyle = {
        48: [0.452, 0.022, 0.5],
        49: [0.453, 0, 0.5],
        50: [0.453, 0, 0.5],
        51: [0.452, 0.216, 0.5],
        52: [0.464, 0.194, 0.5],
        53: [0.453, 0.216, 0.5],
        54: [0.665, 0.022, 0.5],
        55: [0.463, 0.216, 0.5],
        56: [0.666, 0.021, 0.5],
        57: [0.453, 0.216, 0.5],
        65: [0.728, 0.05, 0.798, { ic: 0.021, sk: 0.194 }],
        66: [0.705, 0.022, 0.657, { sk: 0.139 }],
        67: [0.705, 0.025, 0.527, { sk: 0.139 }],
        68: [0.683, 0, 0.771, { sk: 0.0833 }],
        69: [0.705, 0.022, 0.528, { ic: 0.036, sk: 0.111 }],
        70: [0.683, 0.032, 0.719, { ic: 0.11, sk: 0.111 }],
        71: [0.704, 0.119, 0.595, { sk: 0.111 }],
        72: [0.683, 0.048, 0.845, { sk: 0.111 }],
        73: [0.683, 0, 0.545, { ic: 0.097, sk: 0.0278 }],
        74: [0.683, 0.119, 0.678, { ic: 0.161, sk: 0.167 }],
        75: [0.705, 0.022, 0.762, { sk: 0.0556 }],
        76: [0.705, 0.022, 0.69, { sk: 0.139 }],
        77: [0.705, 0.05, 1.201, { sk: 0.139 }],
        78: [0.789, 0.05, 0.82, { ic: 0.159, sk: 0.0833 }],
        79: [0.705, 0.022, 0.796, { sk: 0.111 }],
        80: [0.683, 0.057, 0.696, { ic: 0.037, sk: 0.0833 }],
        81: [0.705, 0.131, 0.817, { sk: 0.111 }],
        82: [0.682, 0.022, 0.848, { sk: 0.0833 }],
        83: [0.705, 0.022, 0.606, { ic: 0.036, sk: 0.139 }],
        84: [0.717, 0.068, 0.545, { ic: 0.288, sk: 0.0278 }],
        85: [0.683, 0.028, 0.626, { ic: 0.061, sk: 0.0833 }],
        86: [0.683, 0.052, 0.613, { ic: 0.045, sk: 0.0278 }],
        87: [0.683, 0.053, 0.988, { ic: 0.046, sk: 0.0833 }],
        88: [0.683, 0, 0.713, { ic: 0.094, sk: 0.139 }],
        89: [0.683, 0.143, 0.668, { ic: 0.046, sk: 0.0833 }],
        90: [0.683, 0, 0.725, { ic: 0.042, sk: 0.139 }]
      };
      return texOldstyle;
    }
    var hasRequiredTexOldstyle;
    function requireTexOldstyle() {
      if (hasRequiredTexOldstyle) return texOldstyle$1;
      hasRequiredTexOldstyle = 1;
      Object.defineProperty(texOldstyle$1, "__esModule", { value: true });
      texOldstyle$1.texOldstyle = void 0;
      var FontData_js_1 = requireFontData();
      var tex_oldstyle_js_1 = requireTexOldstyle$1();
      texOldstyle$1.texOldstyle = (0, FontData_js_1.AddPaths)(tex_oldstyle_js_1.texOldstyle, {
        48: "39 213Q39 274 53 319T89 389T139 429T192 448T242 452Q347 452 400 400Q460 335 460 213Q460 -22 250 -22Q39 -22 39 213ZM364 242Q364 279 363 301T355 348T338 385T306 406T254 415Q250 415 245 415T238 416Q217 416 190 404T150 368Q136 339 136 221Q136 114 146 78T200 23Q219 16 250 16Q280 16 299 23Q341 41 352 77T364 221V242",
        49: "116 410Q176 412 215 423T269 443T288 453H291Q293 453 301 447V254Q301 62 303 60Q307 52 322 49T394 46Q418 46 422 43T426 23Q426 8 424 4T411 0Q407 0 369 1T258 2T148 1T106 0Q96 0 94 4T91 23Q91 40 95 43T123 46Q180 46 195 49T215 61Q216 63 216 220V376Q192 367 119 364H93L86 371V403L92 410H116",
        50: "55 334Q55 386 105 419T236 453Q333 453 390 413T448 307Q448 278 437 256T406 218T365 193T318 172T277 151L248 134Q219 118 191 102T163 84T267 83L382 85H391Q399 99 406 126Q410 143 413 145T429 148Q440 148 442 147T449 139Q449 137 435 73T420 7Q420 6 414 0H233Q94 0 71 0T46 5Q46 5 46 6Q44 8 44 24Q44 39 46 41Q47 44 98 78T212 155T294 212Q347 257 347 304Q347 354 306 380T203 407Q150 407 120 377Q118 375 123 373Q146 362 146 332Q146 315 133 302T101 288Q85 288 70 298T55 334",
        51: "69 312Q69 377 122 414T233 452Q333 452 381 409T430 313Q430 268 402 223T311 149L301 144Q307 143 317 140T355 123T402 92T439 44T456 -25Q456 -101 396 -158T241 -216Q154 -216 98 -173T42 -68Q42 -58 44 -50T50 -35T57 -25T66 -17T75 -13T82 -10L87 -8Q92 -7 102 -7Q132 -7 147 -25T162 -66Q162 -112 118 -125L113 -126Q113 -129 127 -140T173 -162T239 -173Q268 -173 292 -158Q345 -124 345 -24Q345 33 329 67Q298 125 229 125H210H172Q166 131 166 142Q166 159 172 161Q178 161 208 164T244 169Q251 169 263 176T291 199T316 245T327 314Q327 413 238 413Q182 413 130 369Q177 350 181 312Q181 289 166 273T125 257Q102 257 86 272T69 312",
        52: "163 0Q139 0 109 0T71 -1Q43 -1 36 2T28 15V27V46L190 270Q325 457 330 462Q333 464 352 464H371L377 458V46H464L471 40V6L464 0H377V-65V-108Q377 -131 379 -137T391 -144Q409 -148 446 -148H464Q468 -151 471 -155V-187L464 -194H453Q395 -192 325 -192Q222 -192 210 -194H199L193 -188V-154L199 -148H228Q241 -148 250 -148T265 -146T275 -145T281 -143T284 -141T286 -138T289 -134V0H163ZM295 46V350L75 46H295",
        53: "159 -44Q159 -66 145 -80T109 -96H102L107 -105Q148 -173 228 -173Q255 -173 280 -162Q351 -128 351 -6V8Q351 67 344 98T316 151Q288 176 255 176Q175 176 136 109Q129 100 114 100Q97 100 95 106Q93 110 93 277V403Q93 451 98 451Q100 452 103 452Q105 452 124 445T177 431T251 423Q294 423 328 430T380 445T401 453Q410 453 410 435V422Q332 331 203 331Q152 331 140 339Q139 339 139 254V168Q194 214 256 214Q332 214 390 154T448 0Q448 -95 381 -155T229 -216Q153 -216 104 -166T50 -49Q50 -15 66 -1T105 13Q128 13 143 -3T159 -44",
        54: "42 313Q42 401 68 472T133 583T215 644T296 665H304Q317 665 329 664T360 657T393 640T418 608T432 557Q432 533 422 519T401 502T380 498Q358 498 343 512T328 550Q328 591 367 601L372 602Q372 604 365 609T341 620T307 626Q260 626 226 600T174 537Q147 483 143 376V356Q192 434 266 434Q317 434 357 409Q406 375 435 317Q456 268 456 210V192Q456 169 451 149Q440 90 387 34T253 -22Q225 -22 199 -14T143 16T92 75T56 172T42 313ZM251 396Q211 396 178 354T145 217Q145 159 152 122T166 73T187 47Q216 21 252 21Q294 21 321 47Q342 68 349 99T356 203V232Q356 264 354 285T345 331T322 373T280 395Q274 396 251 396",
        55: "75 246Q64 246 62 247T55 255Q55 259 72 357T90 458L94 462H99Q104 463 109 463H121Q128 460 128 452Q128 445 134 441T165 435T233 432T356 431H478L485 425V392L414 298Q408 290 385 260T358 223T337 191T317 154T302 116T289 68T282 14T275 -55T274 -137Q274 -173 272 -177Q262 -216 223 -216Q170 -216 170 -157V-148Q172 -78 189 -12T237 109T288 196T338 266Q345 275 348 279Q395 340 395 342Q396 343 376 343T274 343Q122 342 117 339T103 294T90 248Q88 246 75 246",
        56: "69 496Q69 570 124 618T247 666Q321 666 375 624T429 515Q429 468 405 433T320 361L346 344Q385 320 403 301T439 250Q456 212 456 181V172V160Q456 141 449 119T426 71T386 26T326 -8T246 -21Q160 -21 102 30T43 155Q43 265 167 332L176 337L161 347Q105 384 87 423Q69 458 69 496ZM371 513Q371 567 334 596T249 626Q198 626 163 598T127 532Q127 521 129 511T138 492T150 476T167 460T185 447T207 433T228 420L284 384L294 391Q346 424 363 469Q371 486 371 513ZM190 21T250 21T351 56T393 140Q393 180 362 213Q354 221 317 246T246 292L212 313Q210 313 200 307T173 287T142 256T117 212T106 157Q106 100 148 61",
        57: "171 -101Q171 -118 163 -130T146 -146T134 -151Q132 -151 132 -152Q132 -154 140 -159T167 -168T206 -173Q274 -173 317 -108Q356 -50 356 79V86L350 77Q308 9 231 9Q150 9 92 81Q42 141 42 228Q42 289 64 333Q93 390 142 421T235 452Q237 452 244 452T255 453Q289 453 321 439T386 391T437 290T457 128Q457 -29 381 -122T206 -216Q148 -216 108 -187T67 -104Q67 -75 84 -62T119 -49Q141 -49 156 -63T171 -101ZM242 46Q293 46 324 94T355 223Q355 323 337 356Q316 401 275 410Q267 412 248 412Q206 412 179 386Q155 360 149 328T143 224Q143 120 163 88Q192 46 242 46",
        65: "576 668Q576 688 606 708T660 728Q676 728 675 712V571Q675 409 688 252Q696 122 720 57Q722 53 723 50T728 46T732 43T737 41T743 39L754 45Q788 61 803 61Q819 61 819 47Q818 43 814 35Q799 15 755 -7T675 -30Q659 -30 648 -25T630 -8T621 11T614 34Q603 77 599 106T594 146T591 160V163H460L329 164L316 145Q241 35 196 -7T119 -50T59 -24T30 43Q30 75 46 100T74 125Q81 125 83 120T88 104T96 84Q118 57 151 57Q189 57 277 182Q432 400 542 625L559 659H567Q574 659 575 660T576 668ZM584 249Q579 333 577 386T575 473T574 520V581L563 560Q497 426 412 290L372 228L370 224H371L383 228L393 232H586L584 249",
        66: "304 342Q292 342 292 353Q292 372 323 391Q331 396 417 428T533 487Q563 512 563 555V562Q563 575 557 589T530 618T475 636Q429 636 396 613T330 539Q263 446 210 238Q196 183 173 120Q135 31 121 16Q108 1 85 -10T47 -22T32 -10Q32 -5 44 18T77 93T112 206Q135 296 154 395T182 550T191 615Q191 616 190 616Q188 616 179 611T157 601T131 594Q113 594 113 605Q113 623 144 644Q154 650 205 676T267 703Q277 705 279 705Q295 705 295 693Q295 686 288 635T278 575Q278 572 287 582Q336 635 402 669T540 704Q603 704 633 673T664 599Q664 559 638 523T580 462Q553 440 504 413L491 407L504 402Q566 381 596 338T627 244Q627 172 575 110T444 13T284 -22Q208 -22 158 28Q144 42 146 50Q150 67 178 85T230 103Q236 103 246 95T267 75T302 56T357 47Q436 47 486 93Q526 136 526 198V210Q526 228 518 249T491 292T436 330T350 345Q335 345 321 344T304 342",
        67: "201 -25Q167 -25 136 -14T75 23T29 94T12 202Q12 290 50 394T161 574Q227 642 303 673T433 704Q435 705 457 705Q533 701 533 640Q533 606 507 548T464 474Q431 444 396 444Q381 444 381 453Q381 459 388 473T407 513T428 563Q433 580 433 594Q433 636 381 636Q314 636 260 594T175 489T128 363T112 247Q112 157 153 101T273 44Q347 44 398 121Q413 144 437 157T481 171Q496 171 496 160Q496 150 476 123Q426 56 350 16T201 -25",
        68: "37 475Q19 475 19 487Q19 536 103 604T327 682H356Q386 683 408 683H419Q475 683 506 681T582 668T667 633Q766 571 766 450Q766 365 723 287T611 152T455 57T279 6Q248 1 160 0Q148 0 131 0T108 -1Q72 -1 72 11Q72 24 90 40T133 64L144 68L152 88Q247 328 272 587Q275 613 272 613Q272 613 269 613Q225 610 195 602T149 579T129 556T119 532Q118 530 116 525T113 518Q102 502 80 490T37 475ZM665 407Q665 596 412 613Q403 614 383 614Q370 614 370 612Q370 598 363 542T323 357T242 103L228 69H265Q391 73 481 119Q536 148 575 188T633 268T658 338T665 392V407",
        69: "144 470Q144 556 240 630T451 705Q564 705 564 637Q564 611 540 573Q529 559 505 547T464 534Q448 534 448 545Q448 552 455 562Q463 577 463 591Q463 600 462 604T456 616T436 627T400 635Q396 635 390 635T380 636Q291 636 258 568Q245 544 245 516Q245 463 290 438T391 410Q415 410 415 398Q415 392 407 380T376 356T326 341Q288 340 260 327Q218 311 187 276T143 208T130 151Q130 113 156 88T211 55T268 47Q349 47 403 125Q415 144 439 157T483 171Q499 171 499 160Q499 148 475 120T413 59T315 3T197 -22Q124 -22 77 14T30 105Q30 126 39 154T66 216T122 288T209 354L223 362Q144 400 144 470",
        70: "199 579Q181 579 181 590Q181 598 188 611T212 639T260 666T335 682Q336 682 349 682T383 682T431 682T493 683T561 683Q776 682 784 681Q826 673 829 647Q829 620 797 600T744 580Q728 580 728 595Q729 607 713 610Q698 613 598 614H500L499 610Q499 598 467 486T428 367Q428 365 551 365H674Q683 360 684 355Q687 346 677 329Q666 312 642 299T598 285Q586 285 582 296H402L394 277Q386 258 373 229T346 167T315 102T286 51Q265 22 225 -5T133 -32Q108 -32 87 -25T54 -7T33 15T21 35T18 47Q18 60 44 80T98 103Q108 103 111 101T119 88Q130 66 150 54T179 39T195 37Q199 37 203 43Q217 67 245 125T318 300T391 532Q393 543 398 564T406 598T409 613T339 614H269Q229 579 199 579",
        71: "216 68Q155 68 115 100T59 177T44 273Q44 299 50 333T73 421T133 533T239 632Q346 704 466 704Q508 704 515 703Q555 696 577 681T599 635Q599 605 570 560T523 496Q490 466 455 466Q440 466 440 475T469 526T499 589Q499 605 489 617Q460 636 403 636Q343 636 295 611T220 548T174 464T150 382T144 318Q144 241 180 189T287 137Q325 137 359 160Q428 205 466 322Q472 342 501 359T551 376Q557 376 560 373T564 368L565 365Q560 341 551 302T512 173T451 31Q359 -119 204 -119Q163 -118 127 -109T74 -91T53 -77Q52 -75 52 -71Q52 -54 79 -35T132 -14H140L151 -19Q210 -49 281 -49H289Q312 -49 329 -31Q351 -7 372 36T405 109T416 142L408 136Q401 131 392 125T369 111T338 96T303 82T261 72T216 68",
        72: "18 487Q18 496 29 517T67 566T127 621T216 665T330 683Q359 683 376 669T397 643T400 622Q400 584 382 488T348 343Q348 342 467 342H587L594 366Q615 440 648 534T690 641Q701 656 723 669T764 683Q783 683 783 672L750 578Q716 485 677 346T625 101Q624 92 623 82T622 65T621 56Q621 20 658 20Q666 20 701 25Q709 52 736 69T785 87Q803 87 803 75T791 44T754 3T685 -33T588 -48Q568 -48 562 -46Q522 -31 522 13V23Q531 129 562 250L569 281L565 280Q561 278 556 277T549 274L438 273H328L321 249Q307 202 275 107T232 0Q219 -16 196 -28T155 -41Q149 -41 145 -39T140 -34T139 -29Q139 -24 148 -3T181 86T233 247Q240 270 240 272Q240 273 194 273H169Q139 273 139 285Q139 295 153 308T187 332Q206 341 236 342L260 343L264 359Q278 414 289 482T300 578Q300 613 260 613H254Q198 613 169 592Q148 578 127 544T104 508Q72 478 37 475Q18 475 18 487",
        73: "174 0H31Q-13 0 -21 2T-30 12Q-30 23 -17 36Q9 60 42 68L155 70Q187 102 214 179T257 333T302 491T366 610L369 614H305Q221 611 188 607T145 596T128 569Q119 543 94 529T47 512Q28 512 28 524Q28 527 32 539Q56 614 159 654Q218 678 312 682Q314 682 339 682T404 682T481 683H632Q642 678 642 671Q642 657 621 641T577 617Q570 615 507 614H444Q427 592 406 542Q382 478 355 366T310 209Q280 123 238 78L230 69H330Q442 70 442 74Q443 74 443 77T447 87T460 105Q490 134 527 137Q545 137 545 125Q545 120 542 112Q531 78 491 49T399 7Q379 2 360 2T174 0",
        74: "148 78Q148 16 189 -17T286 -50Q319 -50 348 -33T396 10T426 59T444 101L471 204Q498 306 521 372Q575 532 649 605L659 614H591Q517 613 494 607Q433 591 400 550T360 477Q353 454 325 437T275 419Q256 419 260 435Q280 523 376 597T583 681Q603 683 713 683H830Q839 674 839 671Q839 654 810 634T754 614Q735 614 721 601Q688 571 654 495T600 351T561 209T541 132Q507 29 412 -45T213 -119Q141 -119 94 -77T47 33Q47 55 50 69T58 90T71 103Q105 131 135 131Q152 131 152 120Q152 119 151 114T149 99T148 78",
        75: "194 618Q193 618 182 613T156 601T131 594Q113 594 113 605Q113 623 144 644Q154 650 205 676T267 703Q277 705 279 705Q295 705 295 691Q295 569 250 397Q225 306 197 217T151 81T128 25Q120 8 94 -7T47 -22Q32 -22 32 -10L64 76Q95 163 133 295T185 530Q198 611 194 618ZM331 429Q331 383 364 290T449 117T542 36Q574 36 607 51T652 103Q660 124 677 133T709 143Q727 143 727 128Q727 119 723 111Q704 56 639 17T497 -22H493Q463 -22 425 16Q401 40 382 71Q335 138 296 243T256 399Q256 434 288 473Q342 540 471 622T670 705Q691 704 703 696Q732 678 732 644Q732 613 714 600T677 586Q671 586 667 587T660 592T657 604V619Q657 647 629 647Q623 647 620 646Q576 635 495 583T365 482Q331 448 331 429",
        76: "62 -22T47 -22T32 -11Q32 -1 56 24T83 55Q113 96 138 172T180 320T234 473T323 609Q364 649 419 677T531 705Q559 705 578 696T604 671T615 645T618 623V611Q618 582 615 571T598 548Q581 531 558 520T518 509Q503 509 503 520Q503 523 505 536T507 560Q507 590 494 610T452 630Q423 630 410 617Q367 578 333 492T271 301T233 170Q211 123 204 112L198 103L224 102Q281 102 369 79T509 52H523Q535 64 544 87T579 128Q616 152 641 152Q656 152 656 142Q656 101 588 40T433 -22Q381 -22 289 1T156 28L141 29L131 20Q111 0 87 -11",
        77: "28 9Q28 37 43 63T73 90Q77 90 83 84T103 70T141 57H146Q162 57 178 79T222 167Q266 279 295 371T334 513T349 598T358 651T371 677Q397 705 432 705Q442 705 445 699T452 666Q453 661 453 659Q475 538 509 405T568 207L574 192Q581 178 587 164T594 150Q596 150 635 189T693 248Q765 324 863 438T1024 626T1089 701Q1093 705 1100 705Q1111 705 1111 682Q1111 675 1108 660T1099 611T1086 540Q1041 277 1041 144Q1041 98 1044 75T1050 48T1059 42Q1064 41 1075 46Q1102 61 1121 61Q1137 61 1137 50Q1137 28 1087 0T1000 -29Q983 -29 972 -23T955 -9T945 16T942 45T941 83V96Q941 158 952 256T974 422L985 489Q984 489 939 436T821 300T698 164Q665 128 620 85T568 37Q564 34 558 34Q550 34 546 37T535 54Q512 91 496 127T450 259T389 498L384 518Q349 367 294 223T198 15Q155 -50 117 -50Q87 -50 61 -35T30 -6Q28 2 28 9",
        78: "343 705Q358 705 358 698Q360 696 370 658T411 524T484 319Q536 174 590 82L595 73L615 152Q646 274 683 407Q729 571 752 637T799 727Q852 780 937 788Q939 788 947 788T958 789H962Q979 789 979 765Q979 722 951 692Q942 683 924 683Q888 681 859 672T818 654T803 639Q784 608 708 322T631 15Q631 14 630 15Q630 17 629 15Q628 14 628 12Q621 -4 601 -17T560 -31Q550 -31 546 -28T530 -7Q484 67 458 123T398 272Q352 392 314 514L306 535V534Q306 533 296 488T272 379T234 239T185 100T127 -7T61 -50Q34 -50 4 -34T-27 8Q-27 33 -12 61T18 90Q21 90 36 77T87 57H92Q109 57 123 78T162 173Q206 299 232 417T265 599T276 667Q284 681 304 693T343 705",
        79: "308 428Q289 428 289 438Q289 457 318 508T378 593Q417 638 475 671T599 705Q688 705 732 643T777 483Q777 380 733 285T620 123T464 18T293 -22Q188 -22 123 51T58 245Q58 327 87 403T159 533T249 626T333 685T388 705Q404 705 404 693Q404 674 363 649Q333 632 304 606T239 537T181 429T158 290Q158 179 214 114T364 48Q489 48 583 165T677 438Q677 473 670 505T648 568T601 617T528 636Q518 636 513 635Q486 629 460 600T419 544T392 490Q383 470 372 459Q341 430 308 428",
        80: "37 475Q19 475 19 487Q19 536 103 604T327 682Q329 682 344 682T380 682T421 683H463Q625 683 695 615Q718 591 726 564Q733 547 733 525Q733 412 607 312T321 205H312Q293 205 293 217Q293 224 302 236T333 260T385 274Q558 287 614 407Q633 445 633 477Q633 515 612 543T556 585T481 607T399 614H370L368 603Q352 463 312 312T242 82T202 -13Q190 -33 164 -45T121 -57Q108 -57 108 -45Q108 -40 120 -10T151 73T192 190T233 349T266 539Q267 546 269 565T272 598T274 613H270Q209 613 163 588Q131 572 113 518Q102 502 80 490T37 475",
        81: "114 286Q114 358 151 433T249 569T392 667T558 705Q653 705 713 641T774 460Q774 389 750 322T687 206T600 114T504 46T412 4L399 -2Q542 -62 636 -62Q660 -62 670 -54T686 -27T700 0Q734 34 770 34Q787 34 787 23Q787 -18 720 -74T563 -131Q485 -131 350 -83T145 -34Q127 -34 127 -22Q127 -12 144 5T190 31L200 34L237 35Q386 38 467 79Q550 120 612 210T675 416Q675 510 625 573T484 636Q410 636 346 587T248 469T214 333Q214 306 221 281T243 229T288 188T360 172Q403 172 441 188T490 205Q510 205 510 192Q505 162 432 132T287 102Q206 102 160 155T114 286",
        82: "37 475Q19 475 19 487Q19 503 35 530T83 589T180 647T327 682H374Q387 682 417 682T464 683Q519 683 559 679T642 663T708 625T731 557Q731 481 668 411T504 300Q506 296 512 286T528 257T553 202Q594 105 611 82Q635 47 665 47Q708 47 742 93Q758 113 786 128Q804 136 819 137Q837 137 837 125Q837 115 818 92T767 43T687 -2T589 -22Q549 -22 517 22T467 120T422 221T362 273Q346 273 346 287Q348 301 373 320T436 342Q437 342 446 343T462 345T481 348T504 353T527 362T553 375T577 393Q598 412 614 443T630 511Q630 545 613 566T541 600T393 614Q370 614 370 613L366 584Q349 446 311 307T243 96L213 25Q205 8 179 -7T132 -22Q125 -22 120 -18T117 -8Q117 -5 130 26T163 113T205 239T246 408T274 606V614Q273 614 259 613T231 609T198 602T163 588Q131 572 113 518Q102 502 80 490T37 475",
        83: "554 512Q536 512 536 522Q536 525 539 539T542 564Q542 588 528 604Q515 616 482 625T410 635Q374 635 349 624T312 594T295 561T290 532Q290 505 303 482T342 442T378 419T409 404Q435 391 451 383T494 357T535 323T562 282T574 231Q574 133 464 56T220 -22Q138 -22 78 21T18 123Q18 184 61 227T156 274Q178 274 178 263Q178 260 177 258Q172 247 164 239T151 227T136 218L127 213L124 202Q118 186 118 163Q120 124 165 86T292 48Q374 48 423 86T473 186V193Q473 267 347 327Q268 364 239 389Q191 431 191 486Q191 547 242 600T356 679T470 705Q472 705 478 705T489 704Q551 704 596 682T642 610Q642 566 621 545Q592 516 554 512",
        84: "49 475Q34 475 34 490Q34 552 106 611T261 681Q272 683 507 683H742Q790 717 816 717Q833 717 833 708Q833 682 795 653T714 615Q691 610 588 609Q490 609 490 607L483 580Q476 554 462 496T435 392Q410 289 395 231T363 116T335 34T309 -15T279 -47T242 -64Q231 -68 218 -68Q203 -68 203 -57Q203 -52 211 -38Q224 -7 234 20T251 66T268 123T283 179T304 261T328 360Q342 415 360 488Q380 567 384 582T397 605Q400 607 401 609H302H244Q200 609 188 607T167 596Q145 572 145 541Q145 520 109 498T49 475",
        85: "8 592Q8 616 70 649T193 683Q246 683 246 631Q246 587 205 492T124 297T83 143Q83 101 100 75T154 48Q202 48 287 135T450 342T560 553Q589 635 593 640Q603 656 626 668T669 683H670Q687 683 687 672T670 616T617 463T547 220Q525 137 521 68Q521 54 522 50T533 42L543 47Q573 61 588 61Q604 61 604 47Q599 16 506 -22Q486 -28 468 -28T436 -18T421 18Q421 92 468 258Q468 259 467 257T459 248Q426 206 391 167T303 81T194 6T83 -22Q66 -22 58 -20Q25 -11 4 19T-17 99Q-17 146 8 220T64 358T120 488T146 586Q146 604 141 608T123 613H120Q99 613 72 597T25 580Q8 580 8 592",
        86: "25 633Q25 647 47 665T100 683Q291 683 291 306Q291 264 288 213T282 132L279 102Q281 102 308 126T378 191T464 279T545 381T596 479Q600 490 600 502Q600 527 581 550T523 577Q505 577 505 601Q505 622 516 647T542 681Q546 683 558 683Q605 679 631 645T658 559Q658 423 487 215Q409 126 308 37T190 -52Q177 -52 177 -28Q177 -26 183 15T196 127T203 270Q203 356 192 421T165 523T126 583T83 613T41 620Q25 620 25 633",
        87: "25 633Q25 647 46 665T103 683Q168 683 207 632Q228 608 243 568Q269 485 269 374Q269 324 265 271T256 184L251 150L252 152Q254 153 257 157T264 167T274 180T286 197Q359 293 424 398T519 558T549 616Q549 618 547 624T545 638Q550 654 572 668T615 683Q626 683 632 672T657 595Q726 370 741 128L742 110Q752 122 767 142T823 217T894 321T950 424T976 511Q976 544 958 560T918 577Q906 577 906 602Q906 629 918 651T942 681Q948 683 954 683Q983 683 1008 658T1034 569T999 421T915 257T813 109T724 -3T681 -49Q666 -59 660 -45Q659 -41 657 35T639 233T591 477Q573 551 570 551Q569 551 554 523T507 439T433 315T323 155T182 -25Q160 -52 151 -53Q137 -53 137 -30Q137 -29 148 25T170 168T181 338Q181 424 168 483T131 571T87 609T40 620Q25 620 25 633",
        88: "324 614Q291 576 250 573Q231 573 231 584Q231 589 232 592Q235 601 244 614T271 643T324 671T400 683H403Q462 683 481 610Q485 594 490 545T498 454L501 413Q504 413 551 442T648 509T705 561Q707 565 707 578Q707 610 682 614Q667 614 667 626Q667 641 695 662T755 683Q765 683 775 680T796 662T807 623Q807 596 792 572T713 499T530 376L505 361V356Q508 346 511 278T524 148T557 75Q569 69 580 69Q585 69 593 77Q624 108 660 110Q667 110 670 110T676 106T678 94Q668 59 624 30T510 0Q487 0 471 9T445 32T430 71T422 117T417 173Q416 183 416 188Q413 214 411 244T407 286T405 299Q403 299 344 263T223 182T154 122Q152 118 152 105Q152 69 180 69Q183 69 187 66T191 60L192 58V56Q192 41 163 21T105 0Q94 0 84 3T63 21T52 60Q52 77 56 90T85 131T155 191Q197 223 259 263T362 327T402 352L391 489Q391 492 390 505T387 526T384 547T379 568T372 586T361 602T348 611Q346 612 341 613T333 614H324",
        89: "65 599Q65 618 107 650T204 683Q267 683 312 643T380 533T414 385T424 217Q424 186 423 160T422 123Q426 123 468 170T567 304T650 469Q661 503 661 519Q661 546 639 570Q615 591 583 591Q569 591 569 616Q569 640 582 661T613 683Q624 683 638 679T671 664T702 625T714 558Q714 472 639 329T426 45Q361 -21 282 -82T154 -143Q97 -143 64 -104T31 -20Q31 4 44 25T70 46Q78 46 81 39T87 16T97 -9Q127 -51 182 -51Q184 -51 187 -50H190Q233 -41 314 25Q330 36 330 40Q336 79 336 178Q336 508 223 594Q199 614 158 619L148 620L139 611Q111 586 83 586Q65 586 65 599",
        90: "694 220Q708 220 708 210Q708 195 695 167T658 105T593 42T502 3Q492 1 458 1Q400 1 293 11T150 22Q116 22 92 11T51 0Q37 0 37 10Q37 21 63 44T179 146T367 319L391 343H343L296 344Q285 350 285 358Q285 365 289 372T300 383T313 392T324 398L329 400H450L561 518Q597 558 607 571L621 587H596Q553 589 484 599T383 609Q342 609 326 596T301 555Q294 533 263 514T208 492Q189 492 189 503Q189 510 197 528T215 559Q249 607 318 645T466 683Q504 683 573 673T669 662L690 661Q734 682 748 683Q767 683 767 673Q767 666 746 640Q655 531 555 428L529 400Q529 399 543 399Q604 397 604 366Q604 350 587 337T551 322Q541 322 539 323Q529 328 529 334Q529 339 487 342L470 343L446 320Q272 153 200 96L235 95Q297 95 392 86T533 74H554Q586 116 597 159Q604 179 635 199T694 220"
      }, {});
      return texOldstyle$1;
    }
    var texSize3$1 = {};
    var texSize3 = {};
    var hasRequiredTexSize3$1;
    function requireTexSize3$1() {
      if (hasRequiredTexSize3$1) return texSize3;
      hasRequiredTexSize3$1 = 1;
      Object.defineProperty(texSize3, "__esModule", { value: true });
      texSize3.texSize3 = void 0;
      texSize3.texSize3 = {
        40: [1.45, 0.949, 0.736],
        41: [1.45, 0.949, 0.736],
        47: [1.45, 0.949, 1.044],
        91: [1.45, 0.949, 0.528],
        92: [1.45, 0.949, 1.044],
        93: [1.45, 0.949, 0.528],
        123: [1.45, 0.949, 0.75],
        125: [1.45, 0.949, 0.75],
        710: [0.772, -0.564, 1.444],
        732: [0.749, -0.61, 1.444],
        770: [0.772, -0.564, 0],
        771: [0.749, -0.61, 0],
        8260: [1.45, 0.949, 1.044],
        8730: [1.45, 0.95, 1, { ic: 0.02 }],
        8968: [1.45, 0.949, 0.583],
        8969: [1.45, 0.949, 0.583],
        8970: [1.45, 0.949, 0.583],
        8971: [1.45, 0.949, 0.583],
        9001: [1.45, 0.95, 0.75],
        9002: [1.45, 0.949, 0.75],
        10216: [1.45, 0.95, 0.75],
        10217: [1.45, 0.949, 0.75],
        12296: [1.45, 0.95, 0.75],
        12297: [1.45, 0.949, 0.75]
      };
      return texSize3;
    }
    var hasRequiredTexSize3;
    function requireTexSize3() {
      if (hasRequiredTexSize3) return texSize3$1;
      hasRequiredTexSize3 = 1;
      Object.defineProperty(texSize3$1, "__esModule", { value: true });
      texSize3$1.texSize3 = void 0;
      var FontData_js_1 = requireFontData();
      var tex_size3_js_1 = requireTexSize3$1();
      texSize3$1.texSize3 = (0, FontData_js_1.AddPaths)(tex_size3_js_1.texSize3, {
        40: "701 -940Q701 -943 695 -949H664Q662 -947 636 -922T591 -879T537 -818T475 -737T412 -636T350 -511T295 -362T250 -186T221 17T209 251Q209 962 573 1361Q596 1386 616 1405T649 1437T664 1450H695Q701 1444 701 1441Q701 1436 681 1415T629 1356T557 1261T476 1118T400 927T340 675T308 359Q306 321 306 250Q306 -139 400 -430T690 -924Q701 -936 701 -940",
        41: "34 1438Q34 1446 37 1448T50 1450H56H71Q73 1448 99 1423T144 1380T198 1319T260 1238T323 1137T385 1013T440 864T485 688T514 485T526 251Q526 134 519 53Q472 -519 162 -860Q139 -885 119 -904T86 -936T71 -949H56Q43 -949 39 -947T34 -937Q88 -883 140 -813Q428 -430 428 251Q428 453 402 628T338 922T245 1146T145 1309T46 1425Q44 1427 42 1429T39 1433T36 1436L34 1438",
        47: "81 -949Q71 -949 63 -941T55 -921Q55 -917 56 -915Q59 -906 498 264T939 1438Q945 1450 960 1450Q972 1450 980 1441T988 1421Q982 1403 839 1020L398 -155Q107 -934 103 -938Q96 -949 81 -949",
        91: "247 -949V1450H516V1388H309V-887H516V-949H247",
        92: "988 -922Q988 -933 980 -941T962 -949Q947 -949 940 -938Q936 -934 645 -155L204 1020Q56 1416 56 1424Q56 1433 62 1441T84 1450Q97 1448 103 1439Q107 1435 398 656L839 -519Q988 -918 988 -922",
        93: "11 1388V1450H280V-949H11V-887H218V1388H11",
        123: "618 -943L612 -949H582L568 -943Q472 -903 411 -841T332 -703Q327 -682 327 -653T325 -350Q324 -28 323 -18Q317 24 301 61T264 124T221 171T179 205T147 225T132 234Q130 238 130 250Q130 255 130 258T131 264T132 267T134 269T139 272T144 275Q207 308 256 367Q310 436 323 519Q324 529 325 851Q326 1124 326 1154T332 1205Q369 1358 566 1443L582 1450H612L618 1444V1429Q618 1413 616 1411L608 1406Q599 1402 585 1393T552 1372T515 1343T479 1305T449 1257T429 1200Q425 1180 425 1152T423 851Q422 579 422 549T416 498Q407 459 388 424T346 364T297 318T250 284T214 264T197 254L188 251L205 242Q290 200 345 138T416 3Q421 -18 421 -48T423 -349Q423 -397 423 -472Q424 -677 428 -694Q429 -697 429 -699Q434 -722 443 -743T465 -782T491 -816T519 -845T548 -868T574 -886T595 -899T610 -908L616 -910Q618 -912 618 -928V-943",
        125: "131 1414T131 1429T133 1447T148 1450H153H167L182 1444Q276 1404 336 1343T415 1207Q421 1184 421 1154T423 851L424 531L426 517Q434 462 460 415T518 339T571 296T608 274Q615 270 616 267T618 251Q618 241 618 238T615 232T608 227Q542 194 491 132T426 -15L424 -29L423 -350Q422 -622 422 -652T415 -706Q397 -780 337 -841T182 -943L167 -949H153Q137 -949 134 -946T131 -928Q131 -914 132 -911T144 -904Q146 -903 148 -902Q299 -820 323 -680Q324 -663 325 -349T327 -19Q355 145 541 241L561 250L541 260Q356 355 327 520Q326 537 325 850T323 1181Q315 1227 293 1267T244 1332T193 1374T151 1401T132 1413Q131 1414 131 1429",
        710: "1439 564Q1434 564 1080 631T722 698Q719 698 362 631Q7 564 4 564L0 583Q-4 602 -4 603L720 772L1083 688Q1446 603 1447 603Q1447 602 1443 583L1439 564",
        732: "1 643Q1 646 76 671T271 722T476 749Q555 749 626 736T742 706T856 676T999 662Q1088 662 1192 684T1363 727T1432 749Q1432 745 1437 731T1442 716Q1442 714 1381 693T1212 645T1012 611Q1000 610 955 610Q851 610 701 653T444 697Q355 697 251 676T80 632T11 610Q11 614 6 628T1 643",
        770: "-5 564Q-9 564 -363 631T-722 698Q-725 698 -1082 631Q-1437 564 -1440 564L-1444 583Q-1448 602 -1448 603L-724 772L-361 688Q2 603 3 603Q3 602 -1 583L-5 564",
        771: "-1443 643Q-1443 646 -1368 671T-1173 722T-968 749Q-889 749 -818 736T-702 706T-588 676T-445 662Q-356 662 -252 684T-81 727T-12 749Q-12 745 -7 731T-2 716Q-2 714 -63 693T-232 645T-432 611Q-444 610 -489 610Q-593 610 -743 653T-1000 697Q-1089 697 -1193 676T-1364 632T-1433 610Q-1433 614 -1438 628T-1443 643",
        8260: "81 -949Q71 -949 63 -941T55 -921Q55 -917 56 -915Q59 -906 498 264T939 1438Q945 1450 960 1450Q972 1450 980 1441T988 1421Q982 1403 839 1020L398 -155Q107 -934 103 -938Q96 -949 81 -949",
        8730: "424 -948Q422 -947 313 -434T202 80L170 31Q165 24 157 10Q137 -21 137 -21Q131 -16 124 -8L111 5L264 248L473 -720Q473 -717 727 359T983 1440Q989 1450 1001 1450Q1007 1450 1013 1445T1020 1433Q1020 1425 742 244T460 -941Q458 -950 439 -950H436Q424 -950 424 -948",
        8968: "246 -949V1450H571V1388H308V-949H246",
        8969: "11 1388V1450H336V-949H274V1388H11",
        8970: "246 -949V1450H308V-887H571V-949H246",
        8971: "274 -887V1450H336V-949H11V-887H274",
        9001: "126 242V259L361 845Q595 1431 597 1435Q610 1450 624 1450Q634 1450 644 1443T654 1419V1411L422 831Q190 253 190 250T422 -331L654 -910V-919Q654 -936 644 -943T624 -950Q612 -950 597 -935Q595 -931 361 -345L126 242",
        9002: "94 1424Q94 1426 97 1432T107 1444T124 1450Q141 1450 152 1435Q154 1431 388 845L623 259V242L388 -345Q153 -933 152 -934Q142 -949 127 -949H125Q95 -949 95 -919V-910L327 -331Q559 247 559 250T327 831Q94 1411 94 1424",
        10216: "126 242V259L361 845Q595 1431 597 1435Q610 1450 624 1450Q634 1450 644 1443T654 1419V1411L422 831Q190 253 190 250T422 -331L654 -910V-919Q654 -936 644 -943T624 -950Q612 -950 597 -935Q595 -931 361 -345L126 242",
        10217: "94 1424Q94 1426 97 1432T107 1444T124 1450Q141 1450 152 1435Q154 1431 388 845L623 259V242L388 -345Q153 -933 152 -934Q142 -949 127 -949H125Q95 -949 95 -919V-910L327 -331Q559 247 559 250T327 831Q94 1411 94 1424",
        12296: "126 242V259L361 845Q595 1431 597 1435Q610 1450 624 1450Q634 1450 644 1443T654 1419V1411L422 831Q190 253 190 250T422 -331L654 -910V-919Q654 -936 644 -943T624 -950Q612 -950 597 -935Q595 -931 361 -345L126 242",
        12297: "94 1424Q94 1426 97 1432T107 1444T124 1450Q141 1450 152 1435Q154 1431 388 845L623 259V242L388 -345Q153 -933 152 -934Q142 -949 127 -949H125Q95 -949 95 -919V-910L327 -331Q559 247 559 250T327 831Q94 1411 94 1424"
      }, {});
      return texSize3$1;
    }
    var texSize4$1 = {};
    var texSize4 = {};
    var hasRequiredTexSize4$1;
    function requireTexSize4$1() {
      if (hasRequiredTexSize4$1) return texSize4;
      hasRequiredTexSize4$1 = 1;
      Object.defineProperty(texSize4, "__esModule", { value: true });
      texSize4.texSize4 = void 0;
      texSize4.texSize4 = {
        40: [1.75, 1.249, 0.792],
        41: [1.75, 1.249, 0.792],
        47: [1.75, 1.249, 1.278],
        91: [1.75, 1.249, 0.583],
        92: [1.75, 1.249, 1.278],
        93: [1.75, 1.249, 0.583],
        123: [1.75, 1.249, 0.806],
        125: [1.75, 1.249, 0.806],
        710: [0.845, -0.561, 1.889, { ic: 0.013 }],
        732: [0.823, -0.583, 1.889],
        770: [0.845, -0.561, 0, { ic: 0.013 }],
        771: [0.823, -0.583, 0],
        8260: [1.75, 1.249, 1.278],
        8730: [1.75, 1.25, 1, { ic: 0.02 }],
        8968: [1.75, 1.249, 0.639],
        8969: [1.75, 1.249, 0.639],
        8970: [1.75, 1.249, 0.639],
        8971: [1.75, 1.249, 0.639],
        9001: [1.75, 1.248, 0.806],
        9002: [1.75, 1.248, 0.806],
        9115: [1.154, 0.655, 0.875],
        9116: [0.61, 0.01, 0.875],
        9117: [1.165, 0.644, 0.875],
        9118: [1.154, 0.655, 0.875],
        9119: [0.61, 0.01, 0.875],
        9120: [1.165, 0.644, 0.875],
        9121: [1.154, 0.645, 0.667],
        9122: [0.602, 0, 0.667],
        9123: [1.155, 0.644, 0.667],
        9124: [1.154, 0.645, 0.667],
        9125: [0.602, 0, 0.667],
        9126: [1.155, 0.644, 0.667],
        9127: [0.899, 0.01, 0.889],
        9128: [1.16, 0.66, 0.889],
        9129: [0.01, 0.899, 0.889],
        9130: [0.29, 0.015, 0.889],
        9131: [0.899, 0.01, 0.889],
        9132: [1.16, 0.66, 0.889],
        9133: [0.01, 0.899, 0.889],
        9143: [0.935, 0.885, 1.056],
        10216: [1.75, 1.248, 0.806],
        10217: [1.75, 1.248, 0.806],
        12296: [1.75, 1.248, 0.806],
        12297: [1.75, 1.248, 0.806],
        57344: [0.625, 0.014, 1.056],
        57345: [0.605, 0.014, 1.056, { ic: 0.02 }],
        57680: [0.12, 0.213, 0.45, { ic: 0.01 }],
        57681: [0.12, 0.213, 0.45, { ic: 0.024 }],
        57682: [0.333, 0, 0.45, { ic: 0.01 }],
        57683: [0.333, 0, 0.45, { ic: 0.024 }],
        57684: [0.32, 0.2, 0.4, { ic: 0.01 }],
        57685: [0.333, 0, 0.9, { ic: 0.01 }],
        57686: [0.12, 0.213, 0.9, { ic: 0.01 }]
      };
      return texSize4;
    }
    var hasRequiredTexSize4;
    function requireTexSize4() {
      if (hasRequiredTexSize4) return texSize4$1;
      hasRequiredTexSize4 = 1;
      Object.defineProperty(texSize4$1, "__esModule", { value: true });
      texSize4$1.texSize4 = void 0;
      var FontData_js_1 = requireFontData();
      var tex_size4_js_1 = requireTexSize4$1();
      texSize4$1.texSize4 = (0, FontData_js_1.AddPaths)(tex_size4_js_1.texSize4, {
        40: "758 -1237T758 -1240T752 -1249H736Q718 -1249 717 -1248Q711 -1245 672 -1199Q237 -706 237 251T672 1700Q697 1730 716 1749Q718 1750 735 1750H752Q758 1744 758 1741Q758 1737 740 1713T689 1644T619 1537T540 1380T463 1176Q348 802 348 251Q348 -242 441 -599T744 -1218Q758 -1237 758 -1240",
        41: "33 1741Q33 1750 51 1750H60H65Q73 1750 81 1743T119 1700Q554 1207 554 251Q554 -707 119 -1199Q76 -1250 66 -1250Q65 -1250 62 -1250T56 -1249Q55 -1249 53 -1249T49 -1250Q33 -1250 33 -1239Q33 -1236 50 -1214T98 -1150T163 -1052T238 -910T311 -727Q443 -335 443 251Q443 402 436 532T405 831T339 1142T224 1438T50 1716Q33 1737 33 1741",
        47: "1166 1738Q1176 1750 1189 1750T1211 1742T1221 1721Q1221 1720 1221 1718T1220 1715Q1219 1708 666 238T111 -1237Q102 -1249 86 -1249Q74 -1249 65 -1240T56 -1220Q56 -1219 56 -1217T57 -1214Q58 -1207 611 263T1166 1738",
        91: "269 -1249V1750H577V1677H342V-1176H577V-1249H269",
        92: "56 1720Q56 1732 64 1741T85 1750Q104 1750 111 1738Q113 1734 666 264T1220 -1214Q1220 -1215 1220 -1217T1221 -1220Q1221 -1231 1212 -1240T1191 -1249Q1175 -1249 1166 -1237Q1164 -1233 611 237T57 1715Q57 1716 56 1718V1720",
        93: "5 1677V1750H313V-1249H5V-1176H240V1677H5",
        123: "661 -1243L655 -1249H622L604 -1240Q503 -1190 434 -1107T348 -909Q346 -897 346 -499L345 -98L343 -82Q335 3 287 87T157 223Q146 232 145 236Q144 240 144 250Q144 265 145 268T157 278Q242 333 288 417T343 583L345 600L346 1001Q346 1398 348 1410Q379 1622 600 1739L622 1750H655L661 1744V1727V1721Q661 1712 661 1710T657 1705T648 1700T630 1690T602 1668Q589 1659 574 1643T531 1593T484 1508T459 1398Q458 1389 458 1001Q458 614 457 605Q441 435 301 316Q254 277 202 251L250 222Q260 216 301 185Q443 66 457 -104Q458 -113 458 -501Q458 -888 459 -897Q463 -944 478 -988T509 -1060T548 -1114T580 -1149T602 -1167Q620 -1183 634 -1192T653 -1202T659 -1207T661 -1220V-1226V-1243",
        125: "144 1727Q144 1743 146 1746T162 1750H167H183L203 1740Q274 1705 325 1658T403 1562T440 1478T456 1410Q458 1398 458 1001Q459 661 459 624T465 558Q470 526 480 496T502 441T529 395T559 356T588 325T615 301T637 284T654 273L660 269V266Q660 263 660 259T661 250V239Q661 236 661 234T660 232T656 229T649 224Q577 179 528 105T465 -57Q460 -86 460 -123T458 -499V-661Q458 -857 457 -893T447 -955Q425 -1048 359 -1120T203 -1239L183 -1249H168Q150 -1249 147 -1246T144 -1226Q144 -1213 145 -1210T153 -1202Q169 -1193 186 -1181T232 -1140T282 -1081T322 -1000T345 -897Q346 -888 346 -501Q346 -113 347 -104Q359 58 503 184Q554 226 603 250Q504 299 430 393T347 605Q346 614 346 1002Q346 1389 345 1398Q338 1493 288 1573T153 1703Q146 1707 145 1710T144 1727",
        710: "5 561Q-4 561 -9 582T-14 618Q-14 623 -13 625Q-11 628 461 736T943 845Q945 845 1417 738T1896 628Q1902 628 1902 618Q1902 607 1897 584T1883 561Q1881 561 1412 654L945 750L476 654Q6 561 5 561",
        732: "1212 583Q1124 583 1048 603T923 647T799 691T635 711Q524 711 375 679T120 615L16 583Q14 584 12 587T9 592Q-2 650 2 659Q2 669 38 687Q54 696 146 723T309 767Q527 823 666 823Q759 823 837 803T964 759T1088 715T1252 695Q1363 695 1512 727T1764 791T1871 823Q1872 822 1874 819T1878 814Q1885 783 1885 753Q1885 748 1884 747Q1884 738 1849 719Q1836 712 1740 682T1484 617T1212 583",
        770: "-1884 561Q-1893 561 -1898 582T-1903 618Q-1903 623 -1902 625Q-1900 628 -1428 736T-946 845Q-944 845 -472 738T7 628Q13 628 13 618Q13 607 8 584T-6 561Q-8 561 -477 654L-944 750L-1413 654Q-1883 561 -1884 561",
        771: "-677 583Q-765 583 -841 603T-966 647T-1090 691T-1254 711Q-1365 711 -1514 679T-1768 615L-1873 583Q-1875 584 -1877 587T-1880 592Q-1891 650 -1887 659Q-1887 669 -1851 687Q-1835 696 -1743 723T-1580 767Q-1362 823 -1223 823Q-1130 823 -1052 803T-925 759T-801 715T-637 695Q-526 695 -377 727T-125 791T-18 823Q-17 822 -15 819T-11 814Q-4 782 -4 753Q-4 748 -5 747Q-5 738 -40 719Q-53 712 -149 682T-405 617T-677 583",
        8260: "1166 1738Q1176 1750 1189 1750T1211 1742T1221 1721Q1221 1720 1221 1718T1220 1715Q1219 1708 666 238T111 -1237Q102 -1249 86 -1249Q74 -1249 65 -1240T56 -1220Q56 -1219 56 -1217T57 -1214Q58 -1207 611 263T1166 1738",
        8730: "983 1739Q988 1750 1001 1750Q1008 1750 1013 1745T1020 1733Q1020 1726 742 244T460 -1241Q458 -1250 439 -1250H436Q424 -1250 424 -1248L410 -1166Q395 -1083 367 -920T312 -601L201 44L137 -83L111 -57L187 96L264 247Q265 246 369 -357Q470 -958 473 -963L727 384Q979 1729 983 1739",
        8968: "269 -1249V1750H633V1677H342V-1249H269",
        8969: "5 1677V1750H369V-1249H296V1677H5",
        8970: "269 -1249V1750H342V-1176H633V-1249H269",
        8971: "296 -1176V1750H369V-1249H5V-1176H296",
        9001: "140 242V260L386 994Q633 1729 635 1732Q643 1745 657 1749Q658 1749 662 1749T668 1750Q682 1749 692 1740T702 1714V1705L214 251L703 -1204L702 -1213Q702 -1230 692 -1239T667 -1248H664Q647 -1248 635 -1231Q633 -1228 386 -493L140 242",
        9002: "103 1714Q103 1732 114 1741T137 1750Q157 1750 170 1732Q172 1729 419 994L665 260V242L419 -493Q172 -1228 170 -1231Q158 -1248 141 -1248H138Q123 -1248 113 -1239T103 -1213V-1204L591 251L103 1705V1714",
        9115: "837 1154Q843 1148 843 1145Q843 1141 818 1106T753 1002T667 841T574 604T494 299Q417 -84 417 -609Q417 -641 416 -647T411 -654Q409 -655 366 -655Q299 -655 297 -654Q292 -652 292 -643T291 -583Q293 -400 304 -242T347 110T432 470T574 813T785 1136Q787 1139 790 1142T794 1147T796 1150T799 1152T802 1153T807 1154T813 1154H819H837",
        9116: "413 -9Q412 -9 407 -9T388 -10T354 -10Q300 -10 297 -9Q294 -8 293 -5Q291 5 291 127V300Q291 602 292 605L296 609Q298 610 366 610Q382 610 392 610T407 610T412 609Q416 609 416 592T417 473V127Q417 -9 413 -9",
        9117: "843 -635Q843 -638 837 -644H820Q801 -644 800 -643Q792 -635 785 -626Q684 -503 605 -363T473 -75T385 216T330 518T302 809T291 1093Q291 1144 291 1153T296 1164Q298 1165 366 1165Q409 1165 411 1164Q415 1163 416 1157T417 1119Q417 529 517 109T833 -617Q843 -631 843 -635",
        9118: "31 1143Q31 1154 49 1154H59Q72 1154 75 1152T89 1136Q190 1013 269 873T401 585T489 294T544 -8T572 -299T583 -583Q583 -634 583 -643T577 -654Q575 -655 508 -655Q465 -655 463 -654Q459 -653 458 -647T457 -609Q457 -58 371 340T100 1037Q87 1059 61 1098T31 1143",
        9119: "579 -9Q578 -9 573 -9T554 -10T520 -10Q466 -10 463 -9Q460 -8 459 -5Q457 5 457 127V300Q457 602 458 605L462 609Q464 610 532 610Q548 610 558 610T573 610T578 609Q582 609 582 592T583 473V127Q583 -9 579 -9",
        9120: "56 -644H50Q31 -644 31 -635Q31 -632 37 -622Q69 -579 100 -527Q286 -228 371 170T457 1119Q457 1161 462 1164Q464 1165 520 1165Q575 1165 577 1164Q582 1162 582 1153T583 1093Q581 910 570 752T527 400T442 40T300 -303T89 -626Q78 -640 75 -642T61 -644H56",
        9121: "319 -645V1154H666V1070H403V-645H319",
        9122: "319 0V602H403V0H319",
        9123: "319 -644V1155H403V-560H666V-644H319",
        9124: "0 1070V1154H347V-645H263V1070H0",
        9125: "263 0V602H347V0H263",
        9126: "263 -560V1155H347V-644H0V-560H263",
        9127: "712 899L718 893V876V865Q718 854 704 846Q627 793 577 710T510 525Q510 524 509 521Q505 493 504 349Q504 345 504 334Q504 277 504 240Q504 -2 503 -4Q502 -8 494 -9T444 -10Q392 -10 390 -9Q387 -8 386 -5Q384 5 384 230Q384 262 384 312T383 382Q383 481 392 535T434 656Q510 806 664 892L677 899H712",
        9128: "389 1159Q391 1160 455 1160Q496 1160 498 1159Q501 1158 502 1155Q504 1145 504 924Q504 691 503 682Q494 549 425 439T243 259L229 250L243 241Q349 175 421 66T503 -182Q504 -191 504 -424Q504 -600 504 -629T499 -659H498Q496 -660 444 -660T390 -659Q387 -658 386 -655Q384 -645 384 -425V-282Q384 -176 377 -116T342 10Q325 54 301 92T255 155T214 196T183 222T171 232Q170 233 170 250T171 268Q171 269 191 284T240 331T300 407T354 524T383 679Q384 691 384 925Q384 1152 385 1155L389 1159",
        9129: "718 -893L712 -899H677L666 -893Q542 -825 468 -714T385 -476Q384 -466 384 -282Q384 3 385 5L389 9Q392 10 444 10Q486 10 494 9T503 4Q504 2 504 -239V-310V-366Q504 -470 508 -513T530 -609Q546 -657 569 -698T617 -767T661 -812T699 -843T717 -856T718 -876V-893",
        9130: "384 150V266Q384 304 389 309Q391 310 455 310Q496 310 498 309Q502 308 503 298Q504 283 504 150Q504 32 504 12T499 -9H498Q496 -10 444 -10T390 -9Q386 -8 385 2Q384 17 384 150",
        9131: "170 875Q170 892 172 895T189 899H194H211L222 893Q345 826 420 715T503 476Q504 467 504 230Q504 51 504 21T499 -9H498Q496 -10 444 -10Q402 -10 394 -9T385 -4Q384 -2 384 240V311V366Q384 469 380 513T358 609Q342 657 319 698T271 767T227 812T189 843T171 856T170 875",
        9132: "389 1159Q391 1160 455 1160Q496 1160 498 1159Q501 1158 502 1155Q504 1145 504 925V782Q504 676 511 616T546 490Q563 446 587 408T633 345T674 304T705 278T717 268Q718 267 718 250T717 232Q717 231 697 216T648 169T588 93T534 -24T505 -179Q504 -191 504 -425Q504 -600 504 -629T499 -659H498Q496 -660 444 -660T390 -659Q387 -658 386 -655Q384 -645 384 -424Q384 -191 385 -182Q394 -49 463 61T645 241L659 250L645 259Q539 325 467 434T385 682Q384 692 384 873Q384 1153 385 1155L389 1159",
        9133: "384 -239V-57Q384 4 389 9Q391 10 455 10Q496 10 498 9Q501 8 502 5Q504 -5 504 -230Q504 -261 504 -311T505 -381Q505 -486 492 -551T435 -691Q357 -820 222 -893L211 -899H195Q176 -899 173 -896T170 -874Q170 -858 171 -855T184 -846Q262 -793 312 -709T378 -525Q378 -524 379 -522Q383 -493 384 -351Q384 -345 384 -334Q384 -276 384 -239",
        9143: "742 -871Q740 -873 737 -876T733 -880T730 -882T724 -884T714 -885H702L222 569L180 484Q138 399 137 399Q131 404 124 412L111 425L265 736L702 -586V168L703 922Q713 935 722 935Q734 935 742 920V-871",
        10216: "140 242V260L386 994Q633 1729 635 1732Q643 1745 657 1749Q658 1749 662 1749T668 1750Q682 1749 692 1740T702 1714V1705L214 251L703 -1204L702 -1213Q702 -1230 692 -1239T667 -1248H664Q647 -1248 635 -1231Q633 -1228 386 -493L140 242",
        10217: "103 1714Q103 1732 114 1741T137 1750Q157 1750 170 1732Q172 1729 419 994L665 260V242L419 -493Q172 -1228 170 -1231Q158 -1248 141 -1248H138Q123 -1248 113 -1239T103 -1213V-1204L591 251L103 1705V1714",
        12296: "140 242V260L386 994Q633 1729 635 1732Q643 1745 657 1749Q658 1749 662 1749T668 1750Q682 1749 692 1740T702 1714V1705L214 251L703 -1204L702 -1213Q702 -1230 692 -1239T667 -1248H664Q647 -1248 635 -1231Q633 -1228 386 -493L140 242",
        12297: "103 1714Q103 1732 114 1741T137 1750Q157 1750 170 1732Q172 1729 419 994L665 260V242L419 -493Q172 -1228 170 -1231Q158 -1248 141 -1248H138Q123 -1248 113 -1239T103 -1213V-1204L591 251L103 1705V1714",
        57344: "722 -14H720Q708 -14 702 0V306L703 612Q713 625 722 625Q734 625 742 610V0Q734 -14 724 -14H722",
        57345: "702 589Q706 601 718 605H1061Q1076 597 1076 585Q1076 572 1061 565H742V0Q734 -14 724 -14H722H720Q708 -14 702 0V589",
        57680: "-18 -213L-24 -207V-172L-16 -158Q75 2 260 84Q334 113 415 119Q418 119 427 119T440 120Q454 120 457 117T460 98V60V25Q460 7 457 4T441 0Q308 0 193 -55T25 -205Q21 -211 18 -212T-1 -213H-18",
        57681: "-10 60Q-10 104 -10 111T-5 118Q-1 120 10 120Q96 120 190 84Q375 2 466 -158L474 -172V-207L468 -213H451H447Q437 -213 434 -213T428 -209T423 -202T414 -187T396 -163Q331 -82 224 -41T9 0Q-4 0 -7 3T-10 25V60",
        57682: "-24 327L-18 333H-1Q11 333 15 333T22 329T27 322T35 308T54 284Q115 203 225 162T441 120Q454 120 457 117T460 95V60V28Q460 8 457 4T442 0Q355 0 260 36Q75 118 -16 278L-24 292V327",
        57683: "-10 60V95Q-10 113 -7 116T9 120Q151 120 250 171T396 284Q404 293 412 305T424 324T431 331Q433 333 451 333H468L474 327V292L466 278Q375 118 190 36Q95 0 8 0Q-5 0 -7 3T-10 24V60",
        57684: "-10 0V120H410V0H-10"
      }, {
        57685: "",
        57686: ""
      });
      return texSize4$1;
    }
    var texVariant$1 = {};
    var texVariant = {};
    var hasRequiredTexVariant$1;
    function requireTexVariant$1() {
      if (hasRequiredTexVariant$1) return texVariant;
      hasRequiredTexVariant$1 = 1;
      Object.defineProperty(texVariant, "__esModule", { value: true });
      texVariant.texVariant = void 0;
      texVariant.texVariant = {
        710: [0.845, -0.561, 2.333, { ic: 0.013 }],
        732: [0.899, -0.628, 2.333],
        770: [0.845, -0.561, 0, { ic: 0.013 }],
        771: [0.899, -0.628, 0],
        1008: [0.434, 6e-3, 0.667, { ic: 0.067 }],
        8463: [0.695, 0.013, 0.54, { ic: 0.022 }],
        8592: [0.437, -0.064, 0.5],
        8594: [0.437, -0.064, 0.5],
        8652: [0.514, 0.014, 1],
        8708: [0.86, 0.166, 0.556],
        8709: [0.587, 0, 0.778],
        8722: [0.27, -0.23, 0.5],
        8726: [0.43, 0.023, 0.778],
        8733: [0.472, -0.028, 0.778],
        8739: [0.43, 0.023, 0.222],
        8740: [0.43, 0.023, 0.222, { ic: 0.018 }],
        8741: [0.431, 0.023, 0.389],
        8742: [0.431, 0.024, 0.389, { ic: 0.018 }],
        8764: [0.365, -0.132, 0.778],
        8776: [0.481, -0.05, 0.778],
        8808: [0.752, 0.284, 0.778],
        8809: [0.752, 0.284, 0.778],
        8816: [0.919, 0.421, 0.778],
        8817: [0.919, 0.421, 0.778],
        8840: [0.828, 0.33, 0.778],
        8841: [0.828, 0.33, 0.778],
        8842: [0.634, 0.255, 0.778],
        8843: [0.634, 0.254, 0.778],
        8872: [0.694, 0, 0.611],
        8901: [0.189, 0, 0.278],
        8994: [0.378, -0.122, 0.778],
        8995: [0.378, -0.143, 0.778],
        9651: [0.575, 0.02, 0.722],
        9661: [0.576, 0.019, 0.722],
        10887: [0.801, 0.303, 0.778],
        10888: [0.801, 0.303, 0.778],
        10955: [0.752, 0.332, 0.778],
        10956: [0.752, 0.333, 0.778]
      };
      return texVariant;
    }
    var hasRequiredTexVariant;
    function requireTexVariant() {
      if (hasRequiredTexVariant) return texVariant$1;
      hasRequiredTexVariant = 1;
      Object.defineProperty(texVariant$1, "__esModule", { value: true });
      texVariant$1.texVariant = void 0;
      var FontData_js_1 = requireFontData();
      var tex_variant_js_1 = requireTexVariant$1();
      texVariant$1.texVariant = (0, FontData_js_1.AddPaths)(tex_variant_js_1.texVariant, {
        710: "1 561Q-3 563 -6 577T-12 604L-14 618Q-14 625 -7 628T23 635Q31 636 36 637Q63 641 621 745Q1148 845 1165 845Q1167 845 1752 739L2338 630Q2346 630 2346 618Q2340 565 2332 561Q2329 561 1749 654Q1617 675 1466 699T1241 736T1167 748Q1165 748 1093 737T867 700T583 654Q3 561 1 561",
        732: "804 788Q717 788 606 772T397 732T213 685T75 645T18 628Q11 628 11 632Q8 637 4 668T2 704Q2 713 36 732Q55 739 242 795Q622 898 826 898Q893 898 947 895Q1009 887 1056 872T1187 819Q1286 776 1356 758T1527 739Q1614 739 1725 755T1934 795T2118 842T2256 882T2313 899Q2320 899 2320 895Q2323 890 2327 860T2329 824Q2329 818 2296 795Q2273 787 2089 732Q1810 657 1598 632Q1562 629 1492 629Q1389 629 1320 644T1144 708Q1048 751 977 769T804 788",
        770: "-2332 561Q-2336 563 -2340 577T-2346 604L-2347 618Q-2347 625 -2340 628T-2310 635Q-2302 636 -2297 637Q-2270 641 -1712 745Q-1185 845 -1168 845Q-1166 845 -581 739L5 630Q13 630 13 618Q7 565 -1 561Q-4 561 -584 654Q-716 675 -867 699T-1092 736T-1166 748Q-1168 748 -1240 737T-1466 700T-1750 654Q-2330 561 -2332 561",
        771: "-1529 788Q-1616 788 -1727 772T-1936 732T-2120 685T-2258 645T-2315 628Q-2322 628 -2322 632Q-2325 637 -2329 668T-2331 704Q-2331 713 -2297 732Q-2278 739 -2091 795Q-1711 898 -1507 898Q-1440 898 -1386 895Q-1324 887 -1277 872T-1146 819Q-1047 776 -977 758T-806 739Q-719 739 -608 755T-399 795T-215 842T-77 882T-20 899Q-13 899 -13 895Q-10 890 -6 860T-4 824Q-4 818 -37 795Q-60 787 -244 732Q-523 657 -735 632Q-771 629 -841 629Q-944 629 -1013 644T-1189 708Q-1285 751 -1356 769T-1529 788",
        1008: "228 325Q170 322 156 316T127 309Q108 309 104 314Q99 319 99 322T108 341Q125 376 171 400T268 425H271Q302 425 319 396Q328 377 328 358Q328 332 324 314Q311 270 286 221Q274 194 274 192H275Q339 234 484 325T639 421Q669 434 691 434T723 425T734 406Q734 394 719 381Q715 376 644 330L575 287L566 267Q543 233 526 176Q520 160 515 143T508 115T506 105Q506 103 533 103Q585 103 607 110T641 118Q670 118 670 107Q670 100 661 85Q643 50 598 27T504 3Q465 3 450 36Q441 51 441 73Q441 84 444 96Q452 146 484 205L497 236L324 125Q143 12 135 10Q103 -6 77 -6Q61 -6 49 2T37 21Q37 36 49 46T124 96L195 141L204 156Q219 179 243 248T264 323Q264 325 228 325",
        8463: "182 599Q182 611 174 615T133 619Q118 619 114 621T109 630Q109 636 114 656T122 681Q125 685 202 688Q272 695 286 695Q304 695 304 684Q304 682 295 644T282 597Q282 592 360 592H399Q430 592 445 587T460 563Q460 552 451 541L442 535H266L251 468Q247 453 243 436T236 409T233 399Q233 395 244 404Q295 441 357 441Q405 441 445 417T485 333Q485 284 449 178T412 58T426 44Q447 44 466 68Q485 87 500 130L509 152H531H543Q562 152 562 144Q562 128 546 93T494 23T415 -13Q385 -13 359 3T322 44Q318 52 318 77Q318 99 352 196T386 337Q386 386 346 386Q318 386 286 370Q267 361 245 338T211 292Q207 287 193 235T162 113T138 21Q128 7 122 4Q105 -12 83 -12Q66 -12 54 -2T42 26L166 530Q166 534 161 534T129 535Q127 535 122 535T112 534Q74 534 74 562Q74 570 77 576T84 585T96 589T109 591T124 592T138 592L182 595V599",
        8592: "292 419Q292 400 261 347T211 275H306Q319 275 338 275T364 276Q399 276 410 271T422 250T411 230T366 225H306H211Q214 222 232 197T271 136T292 82Q292 71 285 68T262 64H250H241Q221 64 216 67T205 83Q186 127 153 167T78 230Q64 238 64 250Q64 258 69 263T82 272T106 288T139 318Q162 342 177 365T198 402T209 425T223 436Q224 437 252 437H258Q292 437 292 419",
        8594: "188 417Q188 437 221 437H233Q256 437 263 434T275 417Q294 373 327 333T402 270Q417 261 417 250Q417 241 410 236T382 217T341 182Q315 155 299 128T275 85T263 66Q259 64 231 64H219Q197 64 191 72T193 100Q202 124 215 147T239 185T257 210T267 223L269 225H174H116Q80 225 69 229T58 250T70 271T114 276Q121 276 140 276T174 275H269L267 277Q266 280 257 291T233 325T205 374Q188 408 188 417",
        8652: "755 512Q755 514 778 514H801L804 503Q805 501 812 486T824 462T839 437T862 408T892 381T932 354L944 347V327H507Q70 327 67 329Q55 335 55 347T67 365Q70 367 454 367H837L828 376Q803 403 785 437T761 489T755 512ZM55 153V173H492Q928 173 932 171Q944 166 944 153T932 135Q928 133 545 133H162L171 124Q198 95 216 61T239 8L244 -12Q244 -14 221 -14H198L195 -4Q160 95 67 146L55 153",
        8708: "55 676Q55 688 66 694H199L333 696L351 772Q364 827 370 843T386 860Q393 860 399 854T406 841Q406 836 391 765L375 696Q375 694 431 694H484Q491 688 497 681V12L493 5L486 1L353 -1H219L202 -79Q184 -153 180 -159Q175 -166 165 -166Q146 -166 146 -148Q146 -141 161 -76T177 -4Q177 -1 122 -1H68Q55 12 55 20T66 39H126L186 41L219 181Q226 215 234 251T246 305T251 325Q251 328 166 328H79Q68 345 68 347Q68 352 75 359L82 368H262L291 505Q298 539 306 575T319 630T324 650V654H68Q55 669 55 676ZM457 368V654H411Q366 654 366 652Q365 651 361 634T349 580T333 514Q303 373 302 372V368H457ZM457 39V328H375Q293 328 293 325Q292 322 260 183T228 41T344 39H457",
        8709: "624 470Q624 468 639 446T668 382T683 291Q683 181 612 99T437 -1Q425 -2 387 -2T337 -1Q245 18 193 70L179 81L131 39Q96 8 89 3T75 -3Q55 -3 55 17Q55 24 61 30T111 73Q154 113 151 113Q151 114 140 130T115 177T95 241Q94 253 94 291T95 341Q112 431 173 495Q265 587 385 587Q410 587 437 581Q522 571 582 513L595 501L642 541Q689 586 695 586Q696 586 697 586T699 587Q706 587 713 583T720 568Q720 560 711 551T664 510Q651 499 642 490T628 475T624 470ZM564 477Q517 522 448 539Q428 546 375 546Q290 546 229 492T144 370Q133 332 133 279Q136 228 151 195Q157 179 168 160T184 141Q186 141 375 307T564 477ZM642 290Q642 318 637 343T625 386T611 416T598 436T593 444Q590 444 402 277T213 108Q213 104 231 89T293 55T392 37Q495 37 568 111T642 290",
        8722: "84 237T84 250T98 270H402Q417 262 417 250T402 230H98Q84 237 84 250",
        8726: "91 404T91 410T97 423T111 430Q117 430 395 224Q676 13 678 10Q685 3 685 -3T678 -16T664 -23Q658 -23 380 184T98 397Q91 404 91 410",
        8733: "56 250Q56 346 122 409T276 472Q349 472 407 430T486 326L489 316Q490 317 493 326T501 345T514 367T531 393Q557 425 602 448T698 472Q722 472 722 452Q722 437 702 435T642 421T571 377Q520 323 520 250Q520 179 568 126T693 68Q722 66 722 48Q722 28 698 28Q636 28 576 67T493 174L490 184Q489 181 483 167T475 150T468 136T458 120T447 107T432 90T412 73Q350 28 277 28Q188 28 122 91T56 250ZM199 68T278 68T408 122T459 250Q459 322 414 370T308 430Q302 431 273 431Q204 431 150 380T96 250Q96 176 147 122",
        8739: "91 417Q104 430 111 430T131 417V-10Q116 -23 111 -23T91 -10V417",
        8740: "91 417Q104 430 111 430T131 417V301L171 341Q201 373 207 378T220 384Q227 384 233 377T240 366Q240 357 187 299L131 244V-10Q116 -23 111 -23T91 -10V201L49 157Q20 127 14 121T0 115Q-8 115 -14 121T-20 132Q-20 139 17 178Q29 191 36 199L91 257V417",
        8741: "55 417Q69 431 76 431T95 419V-12Q84 -23 76 -23Q72 -23 69 -22T62 -16T55 -10V417ZM293 419Q300 431 310 431L324 424L331 417V-10Q316 -23 309 -23L297 -19L293 -12V419",
        8742: "56 417Q68 431 76 431L89 426L96 419V317L98 215L193 273L291 330V375L293 419Q301 431 311 431Q331 431 331 388L333 355L356 370Q381 384 388 384Q394 384 400 377T407 363Q407 354 367 328L331 308V-10Q316 -23 310 -23Q300 -23 293 -12L291 135V284L98 168L96 77V-12Q84 -24 76 -24L62 -19L58 -12L56 66V144L31 128Q5 114 -2 114Q-8 114 -14 121T-20 136Q-20 142 -14 147T20 170L56 190V417",
        8764: "73 132Q55 132 55 172Q55 220 79 272Q95 301 111 319Q148 353 195 363Q199 364 212 364Q262 364 294 350T408 272Q472 222 522 212Q537 208 555 208Q606 208 646 243Q671 268 680 296T691 342T702 365Q713 365 716 354T719 314Q714 236 664 179L660 176Q657 173 654 170T644 163T631 154T615 146T596 139T574 134T549 132Q510 132 465 156T386 211T307 265T223 290Q162 290 124 249T86 165Q86 155 82 144T73 132",
        8776: "55 326Q55 394 101 437T226 481Q268 479 313 460T392 419T469 379T555 361Q622 361 662 401Q686 423 688 450Q693 479 702 479H705Q719 479 719 442Q719 367 670 327T554 286Q512 286 466 304T386 345T307 385T220 404Q184 404 157 394T120 374L111 363Q86 339 86 317Q86 288 71 288Q55 288 55 326ZM55 90Q55 164 105 205T226 246Q269 243 314 224T392 183T470 144T558 126Q622 126 662 166Q686 187 688 214Q693 244 704 244Q716 244 719 210Q719 165 702 132T658 82T605 58T552 50T498 58T447 77T384 110Q322 146 302 152Q263 168 220 168Q179 168 144 152Q128 147 107 125T86 81Q86 52 71 52Q55 52 55 90",
        8808: "86 472Q93 477 381 614T673 752Q680 752 686 746T693 732T689 721Q686 715 418 590L151 461L418 332Q684 207 689 201Q693 195 693 190Q693 183 687 177T675 170Q668 170 380 307T86 450Q82 454 82 461Q82 467 86 472ZM369 101V126Q369 156 382 156H384Q385 157 386 157Q409 157 409 115V98V54H680Q693 39 693 34T680 14H409V-142H680Q693 -155 693 -162Q693 -167 680 -182H409V-273Q396 -284 388 -284Q382 -284 369 -275V-182H95Q82 -167 82 -162Q82 -155 95 -142H369V14H95Q93 17 89 21T84 27T82 34T83 40T89 47T95 54H369V101",
        8809: "89 745Q95 752 100 752Q106 752 394 615T689 472Q693 468 693 461T689 450Q684 445 396 308T100 170Q95 170 89 176T82 190Q82 195 86 201Q91 208 358 332L624 461L358 590Q90 715 86 721Q82 725 82 731Q82 739 89 745ZM369 101V126Q369 156 382 156H384Q385 157 386 157Q409 157 409 115V98V54H680Q693 39 693 34T680 14H409V-142H680Q693 -155 693 -162Q693 -167 680 -182H409V-273Q396 -284 388 -284Q382 -284 369 -275V-182H95Q82 -167 82 -162Q82 -155 95 -142H369V14H95Q93 17 89 21T84 27T82 34T83 40T89 47T95 54H369V101",
        8816: "82 34Q82 44 93 55H198L300 57L342 179Q351 207 362 238T378 286T384 303T238 377Q109 435 86 450Q82 454 82 460T86 472Q90 476 302 579L511 679Q512 679 553 795Q569 842 577 866T592 903T600 917T608 919Q615 919 622 912T629 901Q629 899 595 799Q589 777 581 753T569 717T564 703L618 728Q666 752 673 752T686 746T693 732Q693 723 683 717T615 683L546 650L491 488Q464 410 450 368T438 326Q493 297 562 266Q660 219 677 209T694 190Q694 183 690 177T678 171Q664 171 546 228L424 286Q422 286 382 172L342 57L513 55H682Q694 43 694 34Q694 28 689 21L682 17L506 15H329L322 -8Q320 -13 310 -41T295 -85L275 -141H680Q682 -143 684 -146T688 -151T691 -156T693 -162Q693 -172 682 -179L473 -181H262L220 -303Q192 -388 185 -404T166 -421Q160 -421 153 -415T146 -403Q146 -400 179 -302T220 -185Q220 -181 158 -181L93 -179L86 -174Q82 -169 82 -161Q82 -152 93 -141H164L233 -139L260 -63L286 15H189L93 17L86 21Q82 26 82 34ZM495 623Q495 626 493 626T321 544T151 461L398 343Q399 343 405 360T423 415T446 483Q457 513 469 551T488 606T495 623",
        8817: "97 172Q82 172 82 190Q82 197 86 201Q94 209 173 246T327 319T402 357Q405 360 434 448T462 539L278 628Q96 713 86 721Q82 725 82 732T88 745T102 752Q103 752 125 742T198 709T293 666Q342 642 385 622T453 590T478 579Q479 579 506 659T562 824T598 915Q602 919 609 919T622 913T629 901Q629 898 571 728Q546 656 531 608T518 559Q555 539 602 519Q664 488 679 479T694 461Q694 457 689 450Q680 443 616 413T494 356T435 326L389 190L342 57L513 55H682Q694 43 694 34Q694 28 689 21L682 17L506 15H329L322 -8Q320 -13 310 -41T295 -85L275 -141H680Q682 -143 684 -146T688 -151T691 -156T693 -162Q693 -172 682 -179L473 -181H262L220 -303Q192 -388 185 -404T166 -421Q160 -421 153 -415T146 -403Q146 -400 179 -302T220 -185Q220 -181 158 -181L93 -179L86 -174Q82 -169 82 -161Q82 -152 93 -141H164L233 -139L260 -63L286 15H189L93 17L86 21Q82 26 82 34Q82 44 93 55H198L300 57L342 179Q350 204 361 238T378 286T382 301L246 237Q111 172 97 172ZM624 461Q621 464 560 492Q512 518 503 518Q500 518 500 517Q499 513 488 479T465 413T453 379L624 461",
        8840: "82 -6Q82 1 95 14H262L295 94Q331 171 331 174Q324 175 312 178T267 194T206 227T146 283T98 368Q84 406 84 461T98 554Q126 632 194 685T349 750Q360 752 480 752H591L604 783Q620 819 624 821Q631 828 640 828Q653 825 658 810Q658 808 646 781L635 754Q635 752 658 752Q680 752 686 746Q693 739 693 732Q693 728 692 726T686 719T680 712H615L506 466Q479 407 451 344T408 248T393 214Q393 210 535 210H680Q693 194 693 190T680 170H373L340 92L304 14H680Q693 1 693 -6Q693 -11 680 -26H286L253 -103L218 -179L451 -181H682Q694 -193 694 -201Q694 -212 682 -219L440 -221H200L178 -270Q160 -309 154 -319T139 -330Q122 -330 118 -312L155 -223Q155 -221 126 -221H95Q82 -206 82 -201T95 -181H175L206 -108Q237 -35 242 -30Q242 -26 169 -26H95Q82 -11 82 -6ZM571 710Q571 712 469 712Q443 712 416 712T371 711T351 710Q279 700 221 656T138 548Q124 508 124 461T138 374Q186 245 351 212L460 459Q571 709 571 710",
        8841: "82 732Q82 739 95 752H251H348Q420 752 460 744T551 708Q566 697 566 701Q618 815 624 821Q631 828 640 828Q653 825 658 810L600 677Q600 671 615 656T653 605T689 517Q692 496 692 461T689 406Q668 325 615 266Q572 221 513 196T391 170H373L340 92L304 14H680Q693 1 693 -6Q693 -11 680 -26H286L253 -103L218 -179L451 -181H682Q694 -193 694 -201Q694 -212 682 -219L440 -221H200L178 -270Q160 -309 154 -319T139 -330Q122 -330 118 -312L155 -223Q155 -221 126 -221H95Q82 -206 82 -201T95 -181H175L206 -108Q237 -35 242 -30Q242 -26 169 -26H95Q82 -11 82 -6Q82 1 95 14H262L295 92L331 170H95Q93 172 91 175T87 180T84 185T82 191Q82 199 93 210H220L349 212L549 659Q507 692 462 702T338 712H249H95Q82 727 82 732ZM652 473Q652 513 636 552T603 611T582 632Q581 632 487 422T393 210Q424 210 460 220T535 253T605 316T649 410Q652 427 652 461V473",
        8842: "693 -115T693 -122T680 -144H315L269 -199Q221 -255 213 -255H212Q203 -255 197 -248T193 -231Q195 -225 229 -184L262 -144H186L113 -142L106 -137Q102 -130 102 -125Q102 -119 115 -104H298L426 52H386Q342 54 309 63Q236 79 180 129T98 249Q84 289 84 343Q84 398 98 436Q126 514 193 567T346 632Q347 632 373 632T440 633T520 634H680Q682 631 686 627T691 621T693 614T680 594H526Q364 594 353 592Q268 581 207 528T126 394Q123 378 123 343T126 292Q141 231 181 185T280 114Q329 92 415 92H462L506 147Q554 203 562 203H563Q572 203 578 196T582 178Q579 173 546 132L513 94L598 92H682Q693 81 693 73T680 52H480L349 -102L515 -104H682Q693 -115 693 -122",
        8843: "82 610T82 614T83 620T89 627T95 634H251Q378 634 409 633T469 623Q540 604 596 554T678 436Q691 397 691 343T678 249Q653 181 597 131T469 63Q427 52 362 52H315L213 -102L438 -104H662Q673 -115 673 -123Q673 -129 660 -144H186L151 -197Q114 -250 109 -253Q106 -254 104 -254Q100 -254 98 -253Q91 -253 87 -248T82 -235Q82 -230 109 -186L138 -144H115Q82 -144 82 -125Q82 -119 95 -104H166L266 49Q266 52 182 52H95Q82 65 82 72Q82 76 83 78T89 85T95 92H295L329 143Q365 195 369 198Q372 203 380 203Q385 203 391 197T398 185Q398 184 398 184L399 182Q399 175 369 129L344 94Q344 92 376 92Q402 92 422 94Q496 104 554 147T638 256Q651 295 651 343Q651 390 638 429Q613 494 555 537T422 592Q411 594 249 594H95Q82 610 82 614",
        8872: "55 678Q55 679 56 681T58 684T61 688T65 691T70 693T77 694Q88 692 95 679V464H540Q554 456 555 446Q555 442 554 439T552 434T549 430T546 428T542 426T539 424H95V270H539Q540 270 542 269T545 267T549 264T552 260T554 255T555 248Q554 238 540 230H95V15Q88 2 77 0Q73 0 70 1T65 3T61 6T59 9T57 13T55 16V678",
        8901: "71 0Q59 4 55 16V96L56 176Q59 180 66 187L70 189H209Q219 181 222 174V15Q219 10 209 1L140 0H71",
        8994: "77 122Q68 122 63 126T57 135T55 142Q55 151 68 176T111 235T177 302T271 356T388 378Q451 378 508 355T602 300T668 233T709 174T722 142Q722 124 704 122Q692 122 685 134T658 179T606 243Q511 338 390 338Q354 338 320 329Q251 312 193 263T97 141Q87 123 77 122",
        8995: "389 143Q324 143 266 164T171 215T107 277T67 330T55 358T60 371T77 378Q85 377 92 367T116 331T158 280Q256 182 389 182Q475 182 552 227T675 351Q688 378 704 378Q722 376 722 358Q722 352 710 330T670 276T605 215T511 164T389 143",
        9651: "99 -20Q84 -11 84 0Q84 5 148 145T278 424L342 563Q347 575 360 575Q368 575 375 570Q376 569 441 430T571 148T637 0Q637 -11 622 -20H99ZM476 260L360 509L248 266Q137 24 135 22Q135 20 360 20Q586 20 586 21L476 260",
        9661: "84 556Q84 567 99 576H622Q637 567 637 556Q637 551 572 409T441 127T375 -14Q368 -19 360 -19H358Q349 -19 342 -7T296 92Q249 193 211 275Q84 550 84 556ZM586 534Q586 536 361 536Q135 536 135 535L358 52L361 47L473 290Q584 532 586 534",
        10887: "102 168Q103 168 151 146T247 102T295 81Q299 85 322 144T344 206L218 268Q153 297 123 313T87 333T82 344T86 355Q104 369 291 455Q491 552 491 553L542 673Q581 767 590 784T609 801Q616 801 622 795T629 781Q629 773 586 677Q546 581 546 577L609 606Q669 635 673 635Q680 635 686 629T693 615Q693 610 692 608T670 593T604 561L524 521L400 226L542 157Q617 123 649 107T687 85T694 72Q694 66 690 60T679 54Q665 54 526 119Q394 186 386 186Q385 186 342 88L331 61L509 -23Q680 -105 688 -111Q693 -115 693 -122T688 -135T675 -141H673Q664 -141 491 -59Q320 21 316 21H315L249 -136Q183 -293 178 -299Q172 -303 166 -303T153 -297T146 -283Q146 -282 154 -261T181 -197T213 -119L280 41Q280 46 186 86Q157 101 121 119Q92 133 87 136T82 148Q82 155 88 161T102 168ZM418 370L466 495Q464 495 308 420T151 344T204 317T311 267T364 244Q364 247 418 370",
        10888: "97 54Q82 54 82 72Q82 79 86 84Q95 91 222 153L351 215L398 324L442 433L258 519Q95 597 87 604Q82 608 82 615T88 628T102 635Q107 635 424 484L458 468L524 630Q593 789 597 795Q601 801 609 801Q616 801 622 795T629 781L562 615L493 450L589 406Q665 371 679 362T694 344Q694 339 693 337T677 326T631 302T538 257Q504 241 465 223T406 195T386 186Q383 185 344 92T306 -3L486 81Q662 168 673 168Q680 168 686 162T693 148T689 137Q688 136 482 35L280 -59L233 -176Q184 -291 178 -299Q172 -303 166 -303T153 -297T146 -283Q146 -279 185 -186T224 -90Q225 -88 223 -88Q219 -88 193 -101Q109 -143 98 -143Q82 -138 82 -122Q82 -116 85 -113T108 -98T171 -67L249 -30L289 61Q297 81 307 107T321 144T326 157L218 106Q109 54 97 54ZM553 379Q480 412 480 415Q479 415 460 372T423 285T406 241Q408 240 516 291T624 344L553 379",
        10955: "82 -14T82 -7T95 15H431L529 170H435Q341 170 333 175Q149 218 98 368Q84 406 84 461Q84 515 98 555Q126 633 193 686T346 750Q347 750 373 750T440 751T520 752H680Q693 739 693 732Q693 727 680 712H526Q364 712 353 710Q268 700 207 646T126 512Q123 496 123 461T126 410Q141 350 180 304T280 232Q312 217 344 214T464 210H555L589 261Q613 301 620 311T635 321Q644 321 650 315T657 301Q657 296 651 286T630 252T604 212Q604 210 642 210H680Q693 197 693 190Q693 186 692 184T686 177T680 170H578L526 92L478 17L580 15H682Q693 4 693 -4T680 -25H451L353 -179L518 -181H682Q694 -193 694 -201Q694 -211 682 -219L504 -221H326L293 -272Q257 -332 246 -332Q238 -332 232 -326T225 -313Q225 -310 226 -308Q226 -305 251 -265T278 -223Q278 -221 186 -221H95Q93 -218 89 -214T84 -208T82 -201T95 -181H306L404 -25H249L93 -23L86 -19Q82 -14 82 -7",
        10956: "82 732Q82 739 95 752H251Q415 752 426 750Q539 736 615 657Q667 599 689 517Q692 496 692 461T689 406Q668 325 615 266Q522 170 382 170H355L326 95Q319 80 311 59T298 28T293 17Q293 15 486 15H680Q693 0 693 -6T680 -25H275L213 -179L449 -181H682Q693 -192 693 -199T680 -221H198L178 -270Q153 -333 139 -333Q132 -333 126 -327T119 -314T135 -266T153 -223Q153 -221 124 -221H95Q82 -207 82 -201T95 -181H171L233 -25H162L93 -23L86 -19Q82 -14 82 -7T95 15H251L313 170H202L93 172L86 177Q82 182 82 190Q82 199 93 210H211L329 212L349 261Q366 301 372 311T386 321Q392 321 399 315T407 302Q407 295 390 254T373 210Q374 209 377 209Q412 209 444 217Q512 231 564 273T638 377Q651 414 651 461Q651 509 638 548Q613 613 555 656T422 710Q411 712 249 712H95Q82 727 82 732"
      }, {});
      return texVariant$1;
    }
    var delimiters = {};
    var hasRequiredDelimiters;
    function requireDelimiters() {
      if (hasRequiredDelimiters) return delimiters;
      hasRequiredDelimiters = 1;
      (function(exports2) {
        Object.defineProperty(exports2, "__esModule", { value: true });
        exports2.delimiters = exports2.VSIZES = exports2.HDW3 = exports2.HDW2 = exports2.HDW1 = void 0;
        var FontData_js_1 = requireFontData$1();
        exports2.HDW1 = [0.75, 0.25, 0.875];
        exports2.HDW2 = [0.85, 0.349, 0.667];
        exports2.HDW3 = [0.583, 0.082, 0.5];
        exports2.VSIZES = [1, 1.2, 1.8, 2.4, 3];
        var DELIM2F = { c: 47, dir: FontData_js_1.V, sizes: exports2.VSIZES };
        var DELIMAF = { c: 175, dir: FontData_js_1.H, sizes: [0.5], stretch: [0, 175], HDW: [0.59, -0.544, 0.5] };
        var DELIM2C6 = { c: 710, dir: FontData_js_1.H, sizes: [0.5, 0.556, 1, 1.444, 1.889] };
        var DELIM2DC = { c: 732, dir: FontData_js_1.H, sizes: [0.5, 0.556, 1, 1.444, 1.889] };
        var DELIM2013 = { c: 8211, dir: FontData_js_1.H, sizes: [0.5], stretch: [0, 8211], HDW: [0.285, -0.248, 0.5] };
        var DELIM2190 = { c: 8592, dir: FontData_js_1.H, sizes: [1], stretch: [8592, 8722], HDW: exports2.HDW3 };
        var DELIM2192 = { c: 8594, dir: FontData_js_1.H, sizes: [1], stretch: [0, 8722, 8594], HDW: exports2.HDW3 };
        var DELIM2194 = { c: 8596, dir: FontData_js_1.H, sizes: [1], stretch: [8592, 8722, 8594], HDW: exports2.HDW3 };
        var DELIM21A4 = { c: 8612, dir: FontData_js_1.H, stretch: [8592, 8722, 8739], HDW: exports2.HDW3, min: 1.278 };
        var DELIM21A6 = { c: 8614, dir: FontData_js_1.H, sizes: [1], stretch: [8739, 8722, 8594], HDW: exports2.HDW3 };
        var DELIM21D0 = { c: 8656, dir: FontData_js_1.H, sizes: [1], stretch: [8656, 61], HDW: exports2.HDW3 };
        var DELIM21D2 = { c: 8658, dir: FontData_js_1.H, sizes: [1], stretch: [0, 61, 8658], HDW: exports2.HDW3 };
        var DELIM21D4 = { c: 8660, dir: FontData_js_1.H, sizes: [1], stretch: [8656, 61, 8658], HDW: exports2.HDW3 };
        var DELIM2212 = { c: 8722, dir: FontData_js_1.H, sizes: [0.778], stretch: [0, 8722], HDW: exports2.HDW3 };
        var DELIM2223 = { c: 8739, dir: FontData_js_1.V, sizes: [1], stretch: [0, 8739], HDW: [0.627, 0.015, 0.333] };
        var DELIM23DC = {
          c: 9180,
          dir: FontData_js_1.H,
          sizes: [0.778, 1],
          schar: [8994, 8994],
          variants: [5, 0],
          stretch: [57680, 57684, 57681],
          HDW: [0.32, 0.2, 0.5]
        };
        var DELIM23DD = {
          c: 9181,
          dir: FontData_js_1.H,
          sizes: [0.778, 1],
          schar: [8995, 8995],
          variants: [5, 0],
          stretch: [57682, 57684, 57683],
          HDW: [0.32, 0.2, 0.5]
        };
        var DELIM23DE = { c: 9182, dir: FontData_js_1.H, stretch: [57680, 57684, 57681, 57685], HDW: [0.32, 0.2, 0.5], min: 1.8 };
        var DELIM23DF = { c: 9183, dir: FontData_js_1.H, stretch: [57682, 57684, 57683, 57686], HDW: [0.32, 0.2, 0.5], min: 1.8 };
        var DELIM27E8 = { c: 10216, dir: FontData_js_1.V, sizes: exports2.VSIZES };
        var DELIM27E9 = { c: 10217, dir: FontData_js_1.V, sizes: exports2.VSIZES };
        var DELIM2906 = { c: 10502, dir: FontData_js_1.H, stretch: [8656, 61, 8739], HDW: exports2.HDW3, min: 1.278 };
        var DELIM2907 = { c: 10503, dir: FontData_js_1.H, stretch: [8872, 61, 8658], HDW: exports2.HDW3, min: 1.278 };
        exports2.delimiters = {
          40: { dir: FontData_js_1.V, sizes: exports2.VSIZES, stretch: [9115, 9116, 9117], HDW: [0.85, 0.349, 0.875] },
          41: { dir: FontData_js_1.V, sizes: exports2.VSIZES, stretch: [9118, 9119, 9120], HDW: [0.85, 0.349, 0.875] },
          45: DELIM2212,
          47: DELIM2F,
          61: { dir: FontData_js_1.H, sizes: [0.778], stretch: [0, 61], HDW: exports2.HDW3 },
          91: { dir: FontData_js_1.V, sizes: exports2.VSIZES, stretch: [9121, 9122, 9123], HDW: exports2.HDW2 },
          92: { dir: FontData_js_1.V, sizes: exports2.VSIZES },
          93: { dir: FontData_js_1.V, sizes: exports2.VSIZES, stretch: [9124, 9125, 9126], HDW: exports2.HDW2 },
          94: DELIM2C6,
          95: DELIM2013,
          123: { dir: FontData_js_1.V, sizes: exports2.VSIZES, stretch: [9127, 9130, 9129, 9128], HDW: [0.85, 0.349, 0.889] },
          124: { dir: FontData_js_1.V, sizes: [1], stretch: [0, 8739], HDW: [0.75, 0.25, 0.333] },
          125: { dir: FontData_js_1.V, sizes: exports2.VSIZES, stretch: [9131, 9130, 9133, 9132], HDW: [0.85, 0.349, 0.889] },
          126: DELIM2DC,
          175: DELIMAF,
          710: DELIM2C6,
          713: DELIMAF,
          732: DELIM2DC,
          770: DELIM2C6,
          771: DELIM2DC,
          818: DELIM2013,
          8211: DELIM2013,
          8212: DELIM2013,
          8213: DELIM2013,
          8214: { dir: FontData_js_1.V, sizes: [0.602, 1], schar: [0, 8741], variants: [1, 0], stretch: [0, 8741], HDW: [0.602, 0, 0.556] },
          8215: DELIM2013,
          8254: DELIMAF,
          8407: DELIM2192,
          8592: DELIM2190,
          8593: { dir: FontData_js_1.V, sizes: [0.888], stretch: [8593, 9168], HDW: [0.6, 0, 0.667] },
          8594: DELIM2192,
          8595: { dir: FontData_js_1.V, sizes: [0.888], stretch: [0, 9168, 8595], HDW: [0.6, 0, 0.667] },
          8596: DELIM2194,
          8597: { dir: FontData_js_1.V, sizes: [1.044], stretch: [8593, 9168, 8595], HDW: exports2.HDW1 },
          8606: { dir: FontData_js_1.H, sizes: [1], stretch: [8606, 8722], HDW: exports2.HDW3 },
          8608: { dir: FontData_js_1.H, sizes: [1], stretch: [0, 8722, 8608], HDW: exports2.HDW3 },
          8612: DELIM21A4,
          8613: { dir: FontData_js_1.V, stretch: [8593, 9168, 8869], HDW: exports2.HDW1, min: 1.555 },
          8614: DELIM21A6,
          8615: { dir: FontData_js_1.V, stretch: [8868, 9168, 8595], HDW: exports2.HDW1, min: 1.555 },
          8624: { dir: FontData_js_1.V, sizes: [0.722], stretch: [8624, 9168], HDW: exports2.HDW1 },
          8625: { dir: FontData_js_1.V, sizes: [0.722], stretch: [8625, 9168], HDW: exports2.HDW1 },
          8636: { dir: FontData_js_1.H, sizes: [1], stretch: [8636, 8722], HDW: exports2.HDW3 },
          8637: { dir: FontData_js_1.H, sizes: [1], stretch: [8637, 8722], HDW: exports2.HDW3 },
          8638: { dir: FontData_js_1.V, sizes: [0.888], stretch: [8638, 9168], HDW: exports2.HDW1 },
          8639: { dir: FontData_js_1.V, sizes: [0.888], stretch: [8639, 9168], HDW: exports2.HDW1 },
          8640: { dir: FontData_js_1.H, sizes: [1], stretch: [0, 8722, 8640], HDW: exports2.HDW3 },
          8641: { dir: FontData_js_1.H, sizes: [1], stretch: [0, 8722, 8641], HDW: exports2.HDW3 },
          8642: { dir: FontData_js_1.V, sizes: [0.888], stretch: [0, 9168, 8642], HDW: exports2.HDW1 },
          8643: { dir: FontData_js_1.V, sizes: [0.888], stretch: [0, 9168, 8643], HDW: exports2.HDW1 },
          8656: DELIM21D0,
          8657: { dir: FontData_js_1.V, sizes: [0.888], stretch: [8657, 8214], HDW: [0.599, 0, 0.778] },
          8658: DELIM21D2,
          8659: { dir: FontData_js_1.V, sizes: [0.888], stretch: [0, 8214, 8659], HDW: [0.6, 0, 0.778] },
          8660: DELIM21D4,
          8661: { dir: FontData_js_1.V, sizes: [1.044], stretch: [8657, 8214, 8659], HDW: [0.75, 0.25, 0.778] },
          8666: { dir: FontData_js_1.H, sizes: [1], stretch: [8666, 8801], HDW: [0.464, -0.036, 0.5] },
          8667: { dir: FontData_js_1.H, sizes: [1], stretch: [0, 8801, 8667], HDW: [0.464, -0.036, 0.5] },
          8722: DELIM2212,
          8725: DELIM2F,
          8730: { dir: FontData_js_1.V, sizes: exports2.VSIZES, stretch: [57345, 57344, 9143], fullExt: [0.65, 2.3], HDW: [0.85, 0.35, 1.056] },
          8739: DELIM2223,
          8741: { dir: FontData_js_1.V, sizes: [1], stretch: [0, 8741], HDW: [0.627, 0.015, 0.556] },
          8968: { dir: FontData_js_1.V, sizes: exports2.VSIZES, stretch: [9121, 9122], HDW: exports2.HDW2 },
          8969: { dir: FontData_js_1.V, sizes: exports2.VSIZES, stretch: [9124, 9125], HDW: exports2.HDW2 },
          8970: { dir: FontData_js_1.V, sizes: exports2.VSIZES, stretch: [0, 9122, 9123], HDW: exports2.HDW2 },
          8971: { dir: FontData_js_1.V, sizes: exports2.VSIZES, stretch: [0, 9125, 9126], HDW: exports2.HDW2 },
          8978: DELIM23DC,
          8994: DELIM23DC,
          8995: DELIM23DD,
          9001: DELIM27E8,
          9002: DELIM27E9,
          9130: { dir: FontData_js_1.V, sizes: [0.32], stretch: [9130, 9130, 9130], HDW: [0.29, 0.015, 0.889] },
          9135: DELIM2013,
          9136: { dir: FontData_js_1.V, sizes: [0.989], stretch: [9127, 9130, 9133], HDW: [0.75, 0.25, 0.889] },
          9137: { dir: FontData_js_1.V, sizes: [0.989], stretch: [9131, 9130, 9129], HDW: [0.75, 0.25, 0.889] },
          9140: { dir: FontData_js_1.H, stretch: [9484, 8722, 9488], HDW: exports2.HDW3, min: 1 },
          9141: { dir: FontData_js_1.H, stretch: [9492, 8722, 9496], HDW: exports2.HDW3, min: 1 },
          9168: { dir: FontData_js_1.V, sizes: [0.602, 1], schar: [0, 8739], variants: [1, 0], stretch: [0, 8739], HDW: [0.602, 0, 0.333] },
          9180: DELIM23DC,
          9181: DELIM23DD,
          9182: DELIM23DE,
          9183: DELIM23DF,
          9184: { dir: FontData_js_1.H, stretch: [714, 713, 715], HDW: [0.59, -0.544, 0.5], min: 1 },
          9185: { dir: FontData_js_1.H, stretch: [715, 713, 714], HDW: [0.59, -0.544, 0.5], min: 1 },
          9472: DELIM2013,
          10072: DELIM2223,
          10216: DELIM27E8,
          10217: DELIM27E9,
          10222: { dir: FontData_js_1.V, sizes: [0.989], stretch: [9127, 9130, 9129], HDW: [0.75, 0.25, 0.889] },
          10223: { dir: FontData_js_1.V, sizes: [0.989], stretch: [9131, 9130, 9133], HDW: [0.75, 0.25, 0.889] },
          10229: DELIM2190,
          10230: DELIM2192,
          10231: DELIM2194,
          10232: DELIM21D0,
          10233: DELIM21D2,
          10234: DELIM21D4,
          10235: DELIM21A4,
          10236: DELIM21A6,
          10237: DELIM2906,
          10238: DELIM2907,
          10502: DELIM2906,
          10503: DELIM2907,
          10574: { dir: FontData_js_1.H, stretch: [8636, 8722, 8640], HDW: exports2.HDW3, min: 2 },
          10575: { dir: FontData_js_1.V, stretch: [8638, 9168, 8642], HDW: exports2.HDW1, min: 1.776 },
          10576: { dir: FontData_js_1.H, stretch: [8637, 8722, 8641], HDW: exports2.HDW3, min: 2 },
          10577: { dir: FontData_js_1.V, stretch: [8639, 9168, 8643], HDW: exports2.HDW1, min: 0.5 },
          10586: { dir: FontData_js_1.H, stretch: [8636, 8722, 8739], HDW: exports2.HDW3, min: 1.278 },
          10587: { dir: FontData_js_1.H, stretch: [8739, 8722, 8640], HDW: exports2.HDW3, min: 1.278 },
          10588: { dir: FontData_js_1.V, stretch: [8638, 9168, 8869], HDW: exports2.HDW1, min: 1.556 },
          10589: { dir: FontData_js_1.V, stretch: [8868, 9168, 8642], HDW: exports2.HDW1, min: 1.556 },
          10590: { dir: FontData_js_1.H, stretch: [8637, 8722, 8739], HDW: exports2.HDW3, min: 1.278 },
          10591: { dir: FontData_js_1.H, stretch: [8739, 8722, 8641], HDW: exports2.HDW3, min: 1.278 },
          10592: { dir: FontData_js_1.V, stretch: [8639, 9168, 8869], HDW: exports2.HDW1, min: 1.776 },
          10593: { dir: FontData_js_1.V, stretch: [8868, 9168, 8643], HDW: exports2.HDW1, min: 1.776 },
          12296: DELIM27E8,
          12297: DELIM27E9,
          65079: DELIM23DE,
          65080: DELIM23DF
        };
      })(delimiters);
      return delimiters;
    }
    var hasRequiredTex;
    function requireTex() {
      if (hasRequiredTex) return tex$1;
      hasRequiredTex = 1;
      var __extends2 = tex$1 && tex$1.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      var __values2 = tex$1 && tex$1.__values || function(o) {
        var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i2 = 0;
        if (m) return m.call(o);
        if (o && typeof o.length === "number") return {
          next: function() {
            if (o && i2 >= o.length) o = void 0;
            return { value: o && o[i2++], done: !o };
          }
        };
        throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
      };
      Object.defineProperty(tex$1, "__esModule", { value: true });
      tex$1.TeXFont = void 0;
      var FontData_js_1 = requireFontData();
      var tex_js_1 = requireTex$1();
      var bold_italic_js_1 = requireBoldItalic();
      var bold_js_1 = requireBold();
      var double_struck_js_1 = requireDoubleStruck();
      var fraktur_bold_js_1 = requireFrakturBold();
      var fraktur_js_1 = requireFraktur();
      var italic_js_1 = requireItalic();
      var largeop_js_1 = requireLargeop();
      var monospace_js_1 = requireMonospace();
      var normal_js_1 = requireNormal();
      var sans_serif_bold_italic_js_1 = requireSansSerifBoldItalic();
      var sans_serif_bold_js_1 = requireSansSerifBold();
      var sans_serif_italic_js_1 = requireSansSerifItalic();
      var sans_serif_js_1 = requireSansSerif();
      var script_bold_js_1 = requireScriptBold();
      var script_js_1 = requireScript();
      var smallop_js_1 = requireSmallop();
      var tex_calligraphic_bold_js_1 = requireTexCalligraphicBold();
      var tex_calligraphic_js_1 = requireTexCalligraphic();
      var tex_mathit_js_1 = requireTexMathit();
      var tex_oldstyle_bold_js_1 = requireTexOldstyleBold();
      var tex_oldstyle_js_1 = requireTexOldstyle();
      var tex_size3_js_1 = requireTexSize3();
      var tex_size4_js_1 = requireTexSize4();
      var tex_variant_js_1 = requireTexVariant();
      var delimiters_js_1 = requireDelimiters();
      var TeXFont = (function(_super) {
        __extends2(TeXFont2, _super);
        function TeXFont2(options2) {
          var e_1, _a2;
          if (options2 === void 0) {
            options2 = null;
          }
          var _this = _super.call(this, options2) || this;
          var CLASS = _this.constructor;
          try {
            for (var _b2 = __values2(Object.keys(CLASS.variantCacheIds)), _c = _b2.next(); !_c.done; _c = _b2.next()) {
              var variant = _c.value;
              _this.variant[variant].cacheID = "TEX-" + CLASS.variantCacheIds[variant];
            }
          } catch (e_1_1) {
            e_1 = { error: e_1_1 };
          } finally {
            try {
              if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
            } finally {
              if (e_1) throw e_1.error;
            }
          }
          return _this;
        }
        TeXFont2.defaultDelimiters = delimiters_js_1.delimiters;
        TeXFont2.defaultChars = {
          "normal": normal_js_1.normal,
          "bold": bold_js_1.bold,
          "italic": italic_js_1.italic,
          "bold-italic": bold_italic_js_1.boldItalic,
          "double-struck": double_struck_js_1.doubleStruck,
          "fraktur": fraktur_js_1.fraktur,
          "bold-fraktur": fraktur_bold_js_1.frakturBold,
          "script": script_js_1.script,
          "bold-script": script_bold_js_1.scriptBold,
          "sans-serif": sans_serif_js_1.sansSerif,
          "bold-sans-serif": sans_serif_bold_js_1.sansSerifBold,
          "sans-serif-italic": sans_serif_italic_js_1.sansSerifItalic,
          "sans-serif-bold-italic": sans_serif_bold_italic_js_1.sansSerifBoldItalic,
          "monospace": monospace_js_1.monospace,
          "-smallop": smallop_js_1.smallop,
          "-largeop": largeop_js_1.largeop,
          "-size3": tex_size3_js_1.texSize3,
          "-size4": tex_size4_js_1.texSize4,
          "-tex-calligraphic": tex_calligraphic_js_1.texCalligraphic,
          "-tex-bold-calligraphic": tex_calligraphic_bold_js_1.texCalligraphicBold,
          "-tex-mathit": tex_mathit_js_1.texMathit,
          "-tex-oldstyle": tex_oldstyle_js_1.texOldstyle,
          "-tex-bold-oldstyle": tex_oldstyle_bold_js_1.texOldstyleBold,
          "-tex-variant": tex_variant_js_1.texVariant
        };
        TeXFont2.variantCacheIds = {
          "normal": "N",
          "bold": "B",
          "italic": "I",
          "bold-italic": "BI",
          "double-struck": "D",
          "fraktur": "F",
          "bold-fraktur": "BF",
          "script": "S",
          "bold-script": "BS",
          "sans-serif": "SS",
          "bold-sans-serif": "BSS",
          "sans-serif-italic": "SSI",
          "sans-serif-bold-italic": "SSBI",
          "monospace": "M",
          "-smallop": "SO",
          "-largeop": "LO",
          "-size3": "S3",
          "-size4": "S4",
          "-tex-calligraphic": "C",
          "-tex-bold-calligraphic": "BC",
          "-tex-mathit": "MI",
          "-tex-oldstyle": "OS",
          "-tex-bold-oldstyle": "BOS",
          "-tex-variant": "V"
        };
        return TeXFont2;
      })((0, tex_js_1.CommonTeXFontMixin)(FontData_js_1.SVGFontData));
      tex$1.TeXFont = TeXFont;
      return tex$1;
    }
    var FontCache = {};
    var hasRequiredFontCache;
    function requireFontCache() {
      if (hasRequiredFontCache) return FontCache;
      hasRequiredFontCache = 1;
      Object.defineProperty(FontCache, "__esModule", { value: true });
      FontCache.FontCache = void 0;
      var FontCache$1 = (function() {
        function FontCache2(jax) {
          this.cache = /* @__PURE__ */ new Map();
          this.defs = null;
          this.localID = "";
          this.nextID = 0;
          this.jax = jax;
        }
        FontCache2.prototype.cachePath = function(variant, C2, path) {
          var id = "MJX-" + this.localID + (this.jax.font.getVariant(variant).cacheID || "") + "-" + C2;
          if (!this.cache.has(id)) {
            this.cache.set(id, path);
            this.jax.adaptor.append(this.defs, this.jax.svg("path", { id, d: path }));
          }
          return id;
        };
        FontCache2.prototype.clearLocalID = function() {
          this.localID = "";
        };
        FontCache2.prototype.useLocalID = function(id) {
          if (id === void 0) {
            id = null;
          }
          this.localID = (id == null ? ++this.nextID : id) + (id === "" ? "" : "-");
        };
        FontCache2.prototype.clearCache = function() {
          this.cache = /* @__PURE__ */ new Map();
          this.defs = this.jax.svg("defs");
        };
        FontCache2.prototype.getCache = function() {
          return this.defs;
        };
        return FontCache2;
      })();
      FontCache.FontCache = FontCache$1;
      return FontCache;
    }
    var hasRequiredSvg;
    function requireSvg() {
      if (hasRequiredSvg) return svg$1;
      hasRequiredSvg = 1;
      (function(exports2) {
        var __extends2 = svg$1 && svg$1.__extends || /* @__PURE__ */ (function() {
          var extendStatics2 = function(d, b) {
            extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
              d2.__proto__ = b2;
            } || function(d2, b2) {
              for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
            };
            return extendStatics2(d, b);
          };
          return function(d, b) {
            if (typeof b !== "function" && b !== null)
              throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
            extendStatics2(d, b);
            function __() {
              this.constructor = d;
            }
            d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
          };
        })();
        var __assign2 = svg$1 && svg$1.__assign || function() {
          __assign2 = Object.assign || function(t2) {
            for (var s, i2 = 1, n = arguments.length; i2 < n; i2++) {
              s = arguments[i2];
              for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
                t2[p] = s[p];
            }
            return t2;
          };
          return __assign2.apply(this, arguments);
        };
        var __read2 = svg$1 && svg$1.__read || function(o, n) {
          var m = typeof Symbol === "function" && o[Symbol.iterator];
          if (!m) return o;
          var i2 = m.call(o), r2, ar2 = [], e;
          try {
            while ((n === void 0 || n-- > 0) && !(r2 = i2.next()).done) ar2.push(r2.value);
          } catch (error2) {
            e = { error: error2 };
          } finally {
            try {
              if (r2 && !r2.done && (m = i2["return"])) m.call(i2);
            } finally {
              if (e) throw e.error;
            }
          }
          return ar2;
        };
        Object.defineProperty(exports2, "__esModule", { value: true });
        exports2.SVG = exports2.XLINKNS = exports2.SVGNS = void 0;
        var OutputJax_js_1 = requireOutputJax();
        var WrapperFactory_js_1 = requireWrapperFactory();
        var tex_js_1 = requireTex();
        var FontCache_js_1 = requireFontCache();
        var string_js_1 = requireString();
        var lengths_js_1 = requireLengths();
        exports2.SVGNS = "http://www.w3.org/2000/svg";
        exports2.XLINKNS = "http://www.w3.org/1999/xlink";
        var SVG = (function(_super) {
          __extends2(SVG2, _super);
          function SVG2(options2) {
            if (options2 === void 0) {
              options2 = null;
            }
            var _this = _super.call(this, options2, WrapperFactory_js_1.SVGWrapperFactory, tex_js_1.TeXFont) || this;
            _this.minwidth = 0;
            _this.shift = 0;
            _this.container = null;
            _this.svgStyles = null;
            _this.fontCache = new FontCache_js_1.FontCache(_this);
            return _this;
          }
          SVG2.prototype.initialize = function() {
            if (this.options.fontCache === "global") {
              this.fontCache.clearCache();
            }
          };
          SVG2.prototype.clearFontCache = function() {
            this.fontCache.clearCache();
          };
          SVG2.prototype.reset = function() {
            this.clearFontCache();
          };
          SVG2.prototype.setScale = function(node2) {
            if (this.options.scale !== 1) {
              this.adaptor.setStyle(node2, "fontSize", (0, lengths_js_1.percent)(this.options.scale));
            }
          };
          SVG2.prototype.escaped = function(math2, html2) {
            this.setDocument(html2);
            return this.html("span", {}, [this.text(math2.math)]);
          };
          SVG2.prototype.styleSheet = function(html2) {
            if (this.svgStyles) {
              return this.svgStyles;
            }
            var sheet = this.svgStyles = _super.prototype.styleSheet.call(this, html2);
            this.adaptor.setAttribute(sheet, "id", SVG2.STYLESHEETID);
            return sheet;
          };
          SVG2.prototype.pageElements = function(html2) {
            if (this.options.fontCache === "global" && !this.findCache(html2)) {
              return this.svg("svg", { id: SVG2.FONTCACHEID, style: { display: "none" } }, [this.fontCache.getCache()]);
            }
            return null;
          };
          SVG2.prototype.findCache = function(html2) {
            var adaptor = this.adaptor;
            var svgs = adaptor.tags(adaptor.body(html2.document), "svg");
            for (var i2 = svgs.length - 1; i2 >= 0; i2--) {
              if (this.adaptor.getAttribute(svgs[i2], "id") === SVG2.FONTCACHEID) {
                return true;
              }
            }
            return false;
          };
          SVG2.prototype.processMath = function(math2, parent) {
            var container2 = this.container;
            this.container = parent;
            var wrapper2 = this.factory.wrap(math2);
            var _a2 = __read2(this.createRoot(wrapper2), 2), svg2 = _a2[0], g = _a2[1];
            this.typesetSVG(wrapper2, svg2, g);
            this.container = container2;
          };
          SVG2.prototype.createRoot = function(wrapper2) {
            var _a2 = wrapper2.getOuterBBox(), w = _a2.w, h = _a2.h, d = _a2.d, pwidth = _a2.pwidth;
            var px = wrapper2.metrics.em / 1e3;
            var W = Math.max(w, px);
            var H = Math.max(h + d, px);
            var g = this.svg("g", {
              stroke: "currentColor",
              fill: "currentColor",
              "stroke-width": 0,
              transform: "scale(1,-1)"
            });
            var adaptor = this.adaptor;
            var svg2 = adaptor.append(this.container, this.svg("svg", {
              xmlns: exports2.SVGNS,
              width: this.ex(W),
              height: this.ex(H),
              role: "img",
              focusable: false,
              style: { "vertical-align": this.ex(-d) },
              viewBox: [0, this.fixed(-h * 1e3, 1), this.fixed(W * 1e3, 1), this.fixed(H * 1e3, 1)].join(" ")
            }, [g]));
            if (W === 1e-3) {
              adaptor.setAttribute(svg2, "preserveAspectRatio", "xMidYMid slice");
              if (w < 0) {
                adaptor.setStyle(this.container, "margin-right", this.ex(w));
              }
            }
            if (pwidth) {
              adaptor.setStyle(svg2, "min-width", this.ex(W));
              adaptor.setAttribute(svg2, "width", pwidth);
              adaptor.removeAttribute(svg2, "viewBox");
              var scale = this.fixed(wrapper2.metrics.ex / (this.font.params.x_height * 1e3), 6);
              adaptor.setAttribute(g, "transform", "scale(".concat(scale, ",-").concat(scale, ") translate(0, ").concat(this.fixed(-h * 1e3, 1), ")"));
            }
            if (this.options.fontCache !== "none") {
              adaptor.setAttribute(svg2, "xmlns:xlink", exports2.XLINKNS);
            }
            return [svg2, g];
          };
          SVG2.prototype.typesetSVG = function(wrapper2, svg2, g) {
            var adaptor = this.adaptor;
            this.minwidth = this.shift = 0;
            if (this.options.fontCache === "local") {
              this.fontCache.clearCache();
              this.fontCache.useLocalID(this.options.localID);
              adaptor.insert(this.fontCache.getCache(), g);
            }
            wrapper2.toSVG(g);
            this.fontCache.clearLocalID();
            if (this.minwidth) {
              adaptor.setStyle(svg2, "minWidth", this.ex(this.minwidth));
              adaptor.setStyle(this.container, "minWidth", this.ex(this.minwidth));
            } else if (this.shift) {
              var align = adaptor.getAttribute(this.container, "justify") || "center";
              this.setIndent(svg2, align, this.shift);
            }
          };
          SVG2.prototype.setIndent = function(svg2, align, shift2) {
            if (align === "center" || align === "left") {
              this.adaptor.setStyle(svg2, "margin-left", this.ex(shift2));
            }
            if (align === "center" || align === "right") {
              this.adaptor.setStyle(svg2, "margin-right", this.ex(-shift2));
            }
          };
          SVG2.prototype.ex = function(m) {
            m /= this.font.params.x_height;
            return Math.abs(m) < 1e-3 ? "0" : m.toFixed(3).replace(/\.?0+$/, "") + "ex";
          };
          SVG2.prototype.svg = function(kind, properties, children2) {
            if (properties === void 0) {
              properties = {};
            }
            if (children2 === void 0) {
              children2 = [];
            }
            return this.html(kind, properties, children2, exports2.SVGNS);
          };
          SVG2.prototype.unknownText = function(text2, variant) {
            var metrics = this.math.metrics;
            var scale = this.font.params.x_height / metrics.ex * metrics.em * 1e3;
            var svg2 = this.svg("text", {
              "data-variant": variant,
              transform: "scale(1,-1)",
              "font-size": this.fixed(scale, 1) + "px"
            }, [this.text(text2)]);
            var adaptor = this.adaptor;
            if (variant !== "-explicitFont") {
              var c2 = (0, string_js_1.unicodeChars)(text2);
              if (c2.length !== 1 || c2[0] < 119808 || c2[0] > 120831) {
                var _a2 = __read2(this.font.getCssFont(variant), 3), family = _a2[0], italic2 = _a2[1], bold2 = _a2[2];
                adaptor.setAttribute(svg2, "font-family", family);
                if (italic2) {
                  adaptor.setAttribute(svg2, "font-style", "italic");
                }
                if (bold2) {
                  adaptor.setAttribute(svg2, "font-weight", "bold");
                }
              }
            }
            return svg2;
          };
          SVG2.prototype.measureTextNode = function(text2) {
            var adaptor = this.adaptor;
            text2 = adaptor.clone(text2);
            adaptor.removeAttribute(text2, "transform");
            var ex = this.fixed(this.font.params.x_height * 1e3, 1);
            var svg2 = this.svg("svg", {
              position: "absolute",
              visibility: "hidden",
              width: "1ex",
              height: "1ex",
              viewBox: [0, 0, ex, ex].join(" ")
            }, [text2]);
            adaptor.append(adaptor.body(adaptor.document), svg2);
            var w = adaptor.nodeSize(text2, 1e3, true)[0];
            adaptor.remove(svg2);
            return { w, h: 0.75, d: 0.2 };
          };
          SVG2.NAME = "SVG";
          SVG2.OPTIONS = __assign2(__assign2({}, OutputJax_js_1.CommonOutputJax.OPTIONS), { internalSpeechTitles: true, titleID: 0, fontCache: "local", localID: null });
          SVG2.commonStyles = {
            'mjx-container[jax="SVG"]': {
              direction: "ltr"
            },
            'mjx-container[jax="SVG"] > svg': {
              overflow: "visible",
              "min-height": "1px",
              "min-width": "1px"
            },
            'mjx-container[jax="SVG"] > svg a': {
              fill: "blue",
              stroke: "blue"
            }
          };
          SVG2.FONTCACHEID = "MJX-SVG-global-cache";
          SVG2.STYLESHEETID = "MJX-SVG-styles";
          return SVG2;
        })(OutputJax_js_1.CommonOutputJax);
        exports2.SVG = SVG;
      })(svg$1);
      return svg$1;
    }
    var liteAdaptor = {};
    var DOMAdaptor = {};
    var hasRequiredDOMAdaptor;
    function requireDOMAdaptor() {
      if (hasRequiredDOMAdaptor) return DOMAdaptor;
      hasRequiredDOMAdaptor = 1;
      var __values2 = DOMAdaptor && DOMAdaptor.__values || function(o) {
        var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i2 = 0;
        if (m) return m.call(o);
        if (o && typeof o.length === "number") return {
          next: function() {
            if (o && i2 >= o.length) o = void 0;
            return { value: o && o[i2++], done: !o };
          }
        };
        throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
      };
      Object.defineProperty(DOMAdaptor, "__esModule", { value: true });
      DOMAdaptor.AbstractDOMAdaptor = void 0;
      var AbstractDOMAdaptor = (function() {
        function AbstractDOMAdaptor2(document2) {
          if (document2 === void 0) {
            document2 = null;
          }
          this.document = document2;
        }
        AbstractDOMAdaptor2.prototype.node = function(kind, def, children2, ns) {
          var e_1, _a2;
          if (def === void 0) {
            def = {};
          }
          if (children2 === void 0) {
            children2 = [];
          }
          var node2 = this.create(kind, ns);
          this.setAttributes(node2, def);
          try {
            for (var children_1 = __values2(children2), children_1_1 = children_1.next(); !children_1_1.done; children_1_1 = children_1.next()) {
              var child = children_1_1.value;
              this.append(node2, child);
            }
          } catch (e_1_1) {
            e_1 = { error: e_1_1 };
          } finally {
            try {
              if (children_1_1 && !children_1_1.done && (_a2 = children_1.return)) _a2.call(children_1);
            } finally {
              if (e_1) throw e_1.error;
            }
          }
          return node2;
        };
        AbstractDOMAdaptor2.prototype.setAttributes = function(node2, def) {
          var e_2, _a2, e_3, _b2, e_4, _c;
          if (def.style && typeof def.style !== "string") {
            try {
              for (var _d = __values2(Object.keys(def.style)), _e2 = _d.next(); !_e2.done; _e2 = _d.next()) {
                var key2 = _e2.value;
                this.setStyle(node2, key2.replace(/-([a-z])/g, function(_m, c2) {
                  return c2.toUpperCase();
                }), def.style[key2]);
              }
            } catch (e_2_1) {
              e_2 = { error: e_2_1 };
            } finally {
              try {
                if (_e2 && !_e2.done && (_a2 = _d.return)) _a2.call(_d);
              } finally {
                if (e_2) throw e_2.error;
              }
            }
          }
          if (def.properties) {
            try {
              for (var _f = __values2(Object.keys(def.properties)), _g = _f.next(); !_g.done; _g = _f.next()) {
                var key2 = _g.value;
                node2[key2] = def.properties[key2];
              }
            } catch (e_3_1) {
              e_3 = { error: e_3_1 };
            } finally {
              try {
                if (_g && !_g.done && (_b2 = _f.return)) _b2.call(_f);
              } finally {
                if (e_3) throw e_3.error;
              }
            }
          }
          try {
            for (var _h = __values2(Object.keys(def)), _j = _h.next(); !_j.done; _j = _h.next()) {
              var key2 = _j.value;
              if ((key2 !== "style" || typeof def.style === "string") && key2 !== "properties") {
                this.setAttribute(node2, key2, def[key2]);
              }
            }
          } catch (e_4_1) {
            e_4 = { error: e_4_1 };
          } finally {
            try {
              if (_j && !_j.done && (_c = _h.return)) _c.call(_h);
            } finally {
              if (e_4) throw e_4.error;
            }
          }
        };
        AbstractDOMAdaptor2.prototype.replace = function(nnode, onode) {
          this.insert(nnode, onode);
          this.remove(onode);
          return onode;
        };
        AbstractDOMAdaptor2.prototype.childNode = function(node2, i2) {
          return this.childNodes(node2)[i2];
        };
        AbstractDOMAdaptor2.prototype.allClasses = function(node2) {
          var classes = this.getAttribute(node2, "class");
          return !classes ? [] : classes.replace(/  +/g, " ").replace(/^ /, "").replace(/ $/, "").split(/ /);
        };
        return AbstractDOMAdaptor2;
      })();
      DOMAdaptor.AbstractDOMAdaptor = AbstractDOMAdaptor;
      return DOMAdaptor;
    }
    var NodeMixin = {};
    var hasRequiredNodeMixin;
    function requireNodeMixin() {
      if (hasRequiredNodeMixin) return NodeMixin;
      hasRequiredNodeMixin = 1;
      (function(exports2) {
        var __extends2 = NodeMixin && NodeMixin.__extends || /* @__PURE__ */ (function() {
          var extendStatics2 = function(d, b) {
            extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
              d2.__proto__ = b2;
            } || function(d2, b2) {
              for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
            };
            return extendStatics2(d, b);
          };
          return function(d, b) {
            if (typeof b !== "function" && b !== null)
              throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
            extendStatics2(d, b);
            function __() {
              this.constructor = d;
            }
            d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
          };
        })();
        var __assign2 = NodeMixin && NodeMixin.__assign || function() {
          __assign2 = Object.assign || function(t2) {
            for (var s, i2 = 1, n = arguments.length; i2 < n; i2++) {
              s = arguments[i2];
              for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
                t2[p] = s[p];
            }
            return t2;
          };
          return __assign2.apply(this, arguments);
        };
        Object.defineProperty(exports2, "__esModule", { value: true });
        exports2.NodeMixin = exports2.NodeMixinOptions = void 0;
        var Options_js_1 = requireOptions$1();
        exports2.NodeMixinOptions = {
          badCSS: true,
          badSizes: true
        };
        function NodeMixin$1(Base, options2) {
          var _a2;
          if (options2 === void 0) {
            options2 = {};
          }
          options2 = (0, Options_js_1.userOptions)((0, Options_js_1.defaultOptions)({}, exports2.NodeMixinOptions), options2);
          return _a2 = (function(_super) {
            __extends2(NodeAdaptor, _super);
            function NodeAdaptor() {
              var args2 = [];
              for (var _i = 0; _i < arguments.length; _i++) {
                args2[_i] = arguments[_i];
              }
              var _this = _super.call(this, args2[0]) || this;
              var CLASS = _this.constructor;
              _this.options = (0, Options_js_1.userOptions)((0, Options_js_1.defaultOptions)({}, CLASS.OPTIONS), args2[1]);
              return _this;
            }
            NodeAdaptor.prototype.fontSize = function(node2) {
              return options2.badCSS ? this.options.fontSize : _super.prototype.fontSize.call(this, node2);
            };
            NodeAdaptor.prototype.fontFamily = function(node2) {
              return options2.badCSS ? this.options.fontFamily : _super.prototype.fontFamily.call(this, node2);
            };
            NodeAdaptor.prototype.nodeSize = function(node2, em, local) {
              if (em === void 0) {
                em = 1;
              }
              if (local === void 0) {
                local = null;
              }
              if (!options2.badSizes) {
                return _super.prototype.nodeSize.call(this, node2, em, local);
              }
              var text2 = this.textContent(node2);
              var non = Array.from(text2.replace(NodeAdaptor.cjkPattern, "")).length;
              var CJK = Array.from(text2).length - non;
              return [
                CJK * this.options.cjkCharWidth + non * this.options.unknownCharWidth,
                this.options.unknownCharHeight
              ];
            };
            NodeAdaptor.prototype.nodeBBox = function(node2) {
              return options2.badSizes ? { left: 0, right: 0, top: 0, bottom: 0 } : _super.prototype.nodeBBox.call(this, node2);
            };
            return NodeAdaptor;
          })(Base), _a2.OPTIONS = __assign2(__assign2({}, options2.badCSS ? {
            fontSize: 16,
            fontFamily: "Times"
          } : {}), options2.badSizes ? {
            cjkCharWidth: 1,
            unknownCharWidth: 0.6,
            unknownCharHeight: 0.8
          } : {}), _a2.cjkPattern = new RegExp([
            "[",
            "ᄀ-ᅟ",
            "〈〉",
            "⺀-〾",
            "぀-㉇",
            "㉐-䶿",
            "一-꓆",
            "ꥠ-ꥼ",
            "가-힣",
            "豈-﫿",
            "︐-︙",
            "︰-﹫",
            "！-｠￠-￦",
            "𛀀-𛀁",
            "🈀-🉑",
            "𠀀-𿿽",
            "]"
          ].join(""), "gu"), _a2;
        }
        exports2.NodeMixin = NodeMixin$1;
      })(NodeMixin);
      return NodeMixin;
    }
    var Document$1 = {};
    var Element$2 = {};
    var hasRequiredElement;
    function requireElement() {
      if (hasRequiredElement) return Element$2;
      hasRequiredElement = 1;
      var __assign2 = Element$2 && Element$2.__assign || function() {
        __assign2 = Object.assign || function(t2) {
          for (var s, i2 = 1, n = arguments.length; i2 < n; i2++) {
            s = arguments[i2];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
              t2[p] = s[p];
          }
          return t2;
        };
        return __assign2.apply(this, arguments);
      };
      var __read2 = Element$2 && Element$2.__read || function(o, n) {
        var m = typeof Symbol === "function" && o[Symbol.iterator];
        if (!m) return o;
        var i2 = m.call(o), r2, ar2 = [], e;
        try {
          while ((n === void 0 || n-- > 0) && !(r2 = i2.next()).done) ar2.push(r2.value);
        } catch (error2) {
          e = { error: error2 };
        } finally {
          try {
            if (r2 && !r2.done && (m = i2["return"])) m.call(i2);
          } finally {
            if (e) throw e.error;
          }
        }
        return ar2;
      };
      var __spreadArray2 = Element$2 && Element$2.__spreadArray || function(to2, from, pack) {
        if (pack || arguments.length === 2) for (var i2 = 0, l = from.length, ar2; i2 < l; i2++) {
          if (ar2 || !(i2 in from)) {
            if (!ar2) ar2 = Array.prototype.slice.call(from, 0, i2);
            ar2[i2] = from[i2];
          }
        }
        return to2.concat(ar2 || Array.prototype.slice.call(from));
      };
      var __values2 = Element$2 && Element$2.__values || function(o) {
        var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i2 = 0;
        if (m) return m.call(o);
        if (o && typeof o.length === "number") return {
          next: function() {
            if (o && i2 >= o.length) o = void 0;
            return { value: o && o[i2++], done: !o };
          }
        };
        throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
      };
      Object.defineProperty(Element$2, "__esModule", { value: true });
      Element$2.LiteElement = void 0;
      var LiteElement = /* @__PURE__ */ (function() {
        function LiteElement2(kind, attributes2, children2) {
          var e_1, _a2;
          if (attributes2 === void 0) {
            attributes2 = {};
          }
          if (children2 === void 0) {
            children2 = [];
          }
          this.kind = kind;
          this.attributes = __assign2({}, attributes2);
          this.children = __spreadArray2([], __read2(children2), false);
          try {
            for (var _b2 = __values2(this.children), _c = _b2.next(); !_c.done; _c = _b2.next()) {
              var child = _c.value;
              child.parent = this;
            }
          } catch (e_1_1) {
            e_1 = { error: e_1_1 };
          } finally {
            try {
              if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
            } finally {
              if (e_1) throw e_1.error;
            }
          }
          this.styles = null;
        }
        return LiteElement2;
      })();
      Element$2.LiteElement = LiteElement;
      return Element$2;
    }
    var hasRequiredDocument;
    function requireDocument() {
      if (hasRequiredDocument) return Document$1;
      hasRequiredDocument = 1;
      Object.defineProperty(Document$1, "__esModule", { value: true });
      Document$1.LiteDocument = void 0;
      var Element_js_1 = requireElement();
      var LiteDocument = (function() {
        function LiteDocument2() {
          this.root = new Element_js_1.LiteElement("html", {}, [
            this.head = new Element_js_1.LiteElement("head"),
            this.body = new Element_js_1.LiteElement("body")
          ]);
          this.type = "";
        }
        Object.defineProperty(LiteDocument2.prototype, "kind", {
          get: function() {
            return "#document";
          },
          enumerable: false,
          configurable: true
        });
        return LiteDocument2;
      })();
      Document$1.LiteDocument = LiteDocument;
      return Document$1;
    }
    var Text$1 = {};
    var hasRequiredText;
    function requireText() {
      if (hasRequiredText) return Text$1;
      hasRequiredText = 1;
      var __extends2 = Text$1 && Text$1.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      Object.defineProperty(Text$1, "__esModule", { value: true });
      Text$1.LiteComment = Text$1.LiteText = void 0;
      var LiteText = (function() {
        function LiteText2(text2) {
          if (text2 === void 0) {
            text2 = "";
          }
          this.value = text2;
        }
        Object.defineProperty(LiteText2.prototype, "kind", {
          get: function() {
            return "#text";
          },
          enumerable: false,
          configurable: true
        });
        return LiteText2;
      })();
      Text$1.LiteText = LiteText;
      var LiteComment = (function(_super) {
        __extends2(LiteComment2, _super);
        function LiteComment2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        Object.defineProperty(LiteComment2.prototype, "kind", {
          get: function() {
            return "#comment";
          },
          enumerable: false,
          configurable: true
        });
        return LiteComment2;
      })(LiteText);
      Text$1.LiteComment = LiteComment;
      return Text$1;
    }
    var Window = {};
    var List = {};
    var hasRequiredList;
    function requireList() {
      if (hasRequiredList) return List;
      hasRequiredList = 1;
      var __read2 = List && List.__read || function(o, n) {
        var m = typeof Symbol === "function" && o[Symbol.iterator];
        if (!m) return o;
        var i2 = m.call(o), r2, ar2 = [], e;
        try {
          while ((n === void 0 || n-- > 0) && !(r2 = i2.next()).done) ar2.push(r2.value);
        } catch (error2) {
          e = { error: error2 };
        } finally {
          try {
            if (r2 && !r2.done && (m = i2["return"])) m.call(i2);
          } finally {
            if (e) throw e.error;
          }
        }
        return ar2;
      };
      var __spreadArray2 = List && List.__spreadArray || function(to2, from, pack) {
        if (pack || arguments.length === 2) for (var i2 = 0, l = from.length, ar2; i2 < l; i2++) {
          if (ar2 || !(i2 in from)) {
            if (!ar2) ar2 = Array.prototype.slice.call(from, 0, i2);
            ar2[i2] = from[i2];
          }
        }
        return to2.concat(ar2 || Array.prototype.slice.call(from));
      };
      Object.defineProperty(List, "__esModule", { value: true });
      List.LiteList = void 0;
      var LiteList = (function() {
        function LiteList2(children2) {
          this.nodes = [];
          this.nodes = __spreadArray2([], __read2(children2), false);
        }
        LiteList2.prototype.append = function(node2) {
          this.nodes.push(node2);
        };
        LiteList2.prototype[Symbol.iterator] = function() {
          var i2 = 0;
          return {
            next: function() {
              return i2 === this.nodes.length ? { value: null, done: true } : { value: this.nodes[i2++], done: false };
            }
          };
        };
        return LiteList2;
      })();
      List.LiteList = LiteList;
      return List;
    }
    var Parser$2 = {};
    var hasRequiredParser$4;
    function requireParser$4() {
      if (hasRequiredParser$4) return Parser$2;
      hasRequiredParser$4 = 1;
      (function(exports2) {
        var __createBinding2 = Parser$2 && Parser$2.__createBinding || (Object.create ? (function(o, m, k2, k22) {
          if (k22 === void 0) k22 = k2;
          var desc = Object.getOwnPropertyDescriptor(m, k2);
          if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
            desc = { enumerable: true, get: function() {
              return m[k2];
            } };
          }
          Object.defineProperty(o, k22, desc);
        }) : (function(o, m, k2, k22) {
          if (k22 === void 0) k22 = k2;
          o[k22] = m[k2];
        }));
        var __setModuleDefault2 = Parser$2 && Parser$2.__setModuleDefault || (Object.create ? (function(o, v) {
          Object.defineProperty(o, "default", { enumerable: true, value: v });
        }) : function(o, v) {
          o["default"] = v;
        });
        var __importStar2 = Parser$2 && Parser$2.__importStar || function(mod2) {
          if (mod2 && mod2.__esModule) return mod2;
          var result2 = {};
          if (mod2 != null) {
            for (var k2 in mod2) if (k2 !== "default" && Object.prototype.hasOwnProperty.call(mod2, k2)) __createBinding2(result2, mod2, k2);
          }
          __setModuleDefault2(result2, mod2);
          return result2;
        };
        var __read2 = Parser$2 && Parser$2.__read || function(o, n) {
          var m = typeof Symbol === "function" && o[Symbol.iterator];
          if (!m) return o;
          var i2 = m.call(o), r2, ar2 = [], e;
          try {
            while ((n === void 0 || n-- > 0) && !(r2 = i2.next()).done) ar2.push(r2.value);
          } catch (error2) {
            e = { error: error2 };
          } finally {
            try {
              if (r2 && !r2.done && (m = i2["return"])) m.call(i2);
            } finally {
              if (e) throw e.error;
            }
          }
          return ar2;
        };
        var __values2 = Parser$2 && Parser$2.__values || function(o) {
          var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i2 = 0;
          if (m) return m.call(o);
          if (o && typeof o.length === "number") return {
            next: function() {
              if (o && i2 >= o.length) o = void 0;
              return { value: o && o[i2++], done: !o };
            }
          };
          throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
        };
        Object.defineProperty(exports2, "__esModule", { value: true });
        exports2.LiteParser = exports2.PATTERNS = void 0;
        var Entities2 = __importStar2(requireEntities());
        var Element_js_1 = requireElement();
        var Text_js_1 = requireText();
        var PATTERNS;
        (function(PATTERNS2) {
          PATTERNS2.TAGNAME = "[a-z][^\\s\\n>]*";
          PATTERNS2.ATTNAME = "[a-z][^\\s\\n>=]*";
          PATTERNS2.VALUE = `(?:'[^']*'|"[^"]*"|[^\\s\\n]+)`;
          PATTERNS2.VALUESPLIT = `(?:'([^']*)'|"([^"]*)"|([^\\s\\n]+))`;
          PATTERNS2.SPACE = "(?:\\s|\\n)+";
          PATTERNS2.OPTIONALSPACE = "(?:\\s|\\n)*";
          PATTERNS2.ATTRIBUTE = PATTERNS2.ATTNAME + "(?:" + PATTERNS2.OPTIONALSPACE + "=" + PATTERNS2.OPTIONALSPACE + PATTERNS2.VALUE + ")?";
          PATTERNS2.ATTRIBUTESPLIT = "(" + PATTERNS2.ATTNAME + ")(?:" + PATTERNS2.OPTIONALSPACE + "=" + PATTERNS2.OPTIONALSPACE + PATTERNS2.VALUESPLIT + ")?";
          PATTERNS2.TAG = "(<(?:" + PATTERNS2.TAGNAME + "(?:" + PATTERNS2.SPACE + PATTERNS2.ATTRIBUTE + ")*" + PATTERNS2.OPTIONALSPACE + "/?|/" + PATTERNS2.TAGNAME + "|!--[^]*?--|![^]*?)(?:>|$))";
          PATTERNS2.tag = new RegExp(PATTERNS2.TAG, "i");
          PATTERNS2.attr = new RegExp(PATTERNS2.ATTRIBUTE, "i");
          PATTERNS2.attrsplit = new RegExp(PATTERNS2.ATTRIBUTESPLIT, "i");
        })(PATTERNS = exports2.PATTERNS || (exports2.PATTERNS = {}));
        var LiteParser = (function() {
          function LiteParser2() {
          }
          LiteParser2.prototype.parseFromString = function(text2, _format, adaptor) {
            if (adaptor === void 0) {
              adaptor = null;
            }
            var root2 = adaptor.createDocument();
            var node2 = adaptor.body(root2);
            var parts = text2.replace(/<\?.*?\?>/g, "").split(PATTERNS.tag);
            while (parts.length) {
              var text_1 = parts.shift();
              var tag = parts.shift();
              if (text_1) {
                this.addText(adaptor, node2, text_1);
              }
              if (tag && tag.charAt(tag.length - 1) === ">") {
                if (tag.charAt(1) === "!") {
                  this.addComment(adaptor, node2, tag);
                } else if (tag.charAt(1) === "/") {
                  node2 = this.closeTag(adaptor, node2, tag);
                } else {
                  node2 = this.openTag(adaptor, node2, tag, parts);
                }
              }
            }
            this.checkDocument(adaptor, root2);
            return root2;
          };
          LiteParser2.prototype.addText = function(adaptor, node2, text2) {
            text2 = Entities2.translate(text2);
            return adaptor.append(node2, adaptor.text(text2));
          };
          LiteParser2.prototype.addComment = function(adaptor, node2, comment2) {
            return adaptor.append(node2, new Text_js_1.LiteComment(comment2));
          };
          LiteParser2.prototype.closeTag = function(adaptor, node2, tag) {
            var kind = tag.slice(2, tag.length - 1).toLowerCase();
            while (adaptor.parent(node2) && adaptor.kind(node2) !== kind) {
              node2 = adaptor.parent(node2);
            }
            return adaptor.parent(node2);
          };
          LiteParser2.prototype.openTag = function(adaptor, node2, tag, parts) {
            var PCDATA = this.constructor.PCDATA;
            var SELF_CLOSING = this.constructor.SELF_CLOSING;
            var kind = tag.match(/<(.*?)[\s\n>\/]/)[1].toLowerCase();
            var child = adaptor.node(kind);
            var attributes2 = tag.replace(/^<.*?[\s\n>]/, "").split(PATTERNS.attrsplit);
            if (attributes2.pop().match(/>$/) || attributes2.length < 5) {
              this.addAttributes(adaptor, child, attributes2);
              adaptor.append(node2, child);
              if (!SELF_CLOSING[kind] && !tag.match(/\/>$/)) {
                if (PCDATA[kind]) {
                  this.handlePCDATA(adaptor, child, kind, parts);
                } else {
                  node2 = child;
                }
              }
            }
            return node2;
          };
          LiteParser2.prototype.addAttributes = function(adaptor, node2, attributes2) {
            var CDATA_ATTR = this.constructor.CDATA_ATTR;
            while (attributes2.length) {
              var _a2 = __read2(attributes2.splice(0, 5), 5), name_1 = _a2[1], v1 = _a2[2], v2 = _a2[3], v3 = _a2[4];
              var value2 = v1 || v2 || v3 || "";
              if (!CDATA_ATTR[name_1]) {
                value2 = Entities2.translate(value2);
              }
              adaptor.setAttribute(node2, name_1, value2);
            }
          };
          LiteParser2.prototype.handlePCDATA = function(adaptor, node2, kind, parts) {
            var pcdata = [];
            var etag = "</" + kind + ">";
            var ptag = "";
            while (parts.length && ptag !== etag) {
              pcdata.push(ptag);
              pcdata.push(parts.shift());
              ptag = parts.shift();
            }
            adaptor.append(node2, adaptor.text(pcdata.join("")));
          };
          LiteParser2.prototype.checkDocument = function(adaptor, root2) {
            var e_1, _a2, e_2, _b2;
            var node2 = this.getOnlyChild(adaptor, adaptor.body(root2));
            if (!node2)
              return;
            try {
              for (var _c = __values2(adaptor.childNodes(adaptor.body(root2))), _d = _c.next(); !_d.done; _d = _c.next()) {
                var child = _d.value;
                if (child === node2) {
                  break;
                }
                if (child instanceof Text_js_1.LiteComment && child.value.match(/^<!DOCTYPE/)) {
                  root2.type = child.value;
                }
              }
            } catch (e_1_1) {
              e_1 = { error: e_1_1 };
            } finally {
              try {
                if (_d && !_d.done && (_a2 = _c.return)) _a2.call(_c);
              } finally {
                if (e_1) throw e_1.error;
              }
            }
            switch (adaptor.kind(node2)) {
              case "html":
                try {
                  for (var _e2 = __values2(node2.children), _f = _e2.next(); !_f.done; _f = _e2.next()) {
                    var child = _f.value;
                    switch (adaptor.kind(child)) {
                      case "head":
                        root2.head = child;
                        break;
                      case "body":
                        root2.body = child;
                        break;
                    }
                  }
                } catch (e_2_1) {
                  e_2 = { error: e_2_1 };
                } finally {
                  try {
                    if (_f && !_f.done && (_b2 = _e2.return)) _b2.call(_e2);
                  } finally {
                    if (e_2) throw e_2.error;
                  }
                }
                root2.root = node2;
                adaptor.remove(node2);
                if (adaptor.parent(root2.body) !== node2) {
                  adaptor.append(node2, root2.body);
                }
                if (adaptor.parent(root2.head) !== node2) {
                  adaptor.insert(root2.head, root2.body);
                }
                break;
              case "head":
                root2.head = adaptor.replace(node2, root2.head);
                break;
              case "body":
                root2.body = adaptor.replace(node2, root2.body);
                break;
            }
          };
          LiteParser2.prototype.getOnlyChild = function(adaptor, body2) {
            var e_3, _a2;
            var node2 = null;
            try {
              for (var _b2 = __values2(adaptor.childNodes(body2)), _c = _b2.next(); !_c.done; _c = _b2.next()) {
                var child = _c.value;
                if (child instanceof Element_js_1.LiteElement) {
                  if (node2)
                    return null;
                  node2 = child;
                }
              }
            } catch (e_3_1) {
              e_3 = { error: e_3_1 };
            } finally {
              try {
                if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
              } finally {
                if (e_3) throw e_3.error;
              }
            }
            return node2;
          };
          LiteParser2.prototype.serialize = function(adaptor, node2, xml) {
            var _this = this;
            if (xml === void 0) {
              xml = false;
            }
            var SELF_CLOSING = this.constructor.SELF_CLOSING;
            var CDATA = this.constructor.CDATA_ATTR;
            var tag = adaptor.kind(node2);
            var attributes2 = adaptor.allAttributes(node2).map(function(x2) {
              return x2.name + '="' + (CDATA[x2.name] ? x2.value : _this.protectAttribute(x2.value)) + '"';
            }).join(" ");
            var content2 = this.serializeInner(adaptor, node2, xml);
            var html2 = "<" + tag + (attributes2 ? " " + attributes2 : "") + ((!xml || content2) && !SELF_CLOSING[tag] ? ">".concat(content2, "</").concat(tag, ">") : xml ? "/>" : ">");
            return html2;
          };
          LiteParser2.prototype.serializeInner = function(adaptor, node2, xml) {
            var _this = this;
            if (xml === void 0) {
              xml = false;
            }
            var PCDATA = this.constructor.PCDATA;
            if (PCDATA.hasOwnProperty(node2.kind)) {
              return adaptor.childNodes(node2).map(function(x2) {
                return adaptor.value(x2);
              }).join("");
            }
            return adaptor.childNodes(node2).map(function(x2) {
              var kind = adaptor.kind(x2);
              return kind === "#text" ? _this.protectHTML(adaptor.value(x2)) : kind === "#comment" ? x2.value : _this.serialize(adaptor, x2, xml);
            }).join("");
          };
          LiteParser2.prototype.protectAttribute = function(text2) {
            if (typeof text2 !== "string") {
              text2 = String(text2);
            }
            return text2.replace(/"/g, "&quot;");
          };
          LiteParser2.prototype.protectHTML = function(text2) {
            return text2.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
          };
          LiteParser2.SELF_CLOSING = {
            area: true,
            base: true,
            br: true,
            col: true,
            command: true,
            embed: true,
            hr: true,
            img: true,
            input: true,
            keygen: true,
            link: true,
            menuitem: true,
            meta: true,
            param: true,
            source: true,
            track: true,
            wbr: true
          };
          LiteParser2.PCDATA = {
            option: true,
            textarea: true,
            fieldset: true,
            title: true,
            style: true,
            script: true
          };
          LiteParser2.CDATA_ATTR = {
            style: true,
            datafld: true,
            datasrc: true,
            href: true,
            src: true,
            longdesc: true,
            usemap: true,
            cite: true,
            datetime: true,
            action: true,
            axis: true,
            profile: true,
            content: true,
            scheme: true
          };
          return LiteParser2;
        })();
        exports2.LiteParser = LiteParser;
      })(Parser$2);
      return Parser$2;
    }
    var hasRequiredWindow;
    function requireWindow() {
      if (hasRequiredWindow) return Window;
      hasRequiredWindow = 1;
      Object.defineProperty(Window, "__esModule", { value: true });
      Window.LiteWindow = void 0;
      var Element_js_1 = requireElement();
      var Document_js_1 = requireDocument();
      var List_js_1 = requireList();
      var Parser_js_1 = requireParser$4();
      var LiteWindow = /* @__PURE__ */ (function() {
        function LiteWindow2() {
          this.DOMParser = Parser_js_1.LiteParser;
          this.NodeList = List_js_1.LiteList;
          this.HTMLCollection = List_js_1.LiteList;
          this.HTMLElement = Element_js_1.LiteElement;
          this.DocumentFragment = List_js_1.LiteList;
          this.Document = Document_js_1.LiteDocument;
          this.document = new Document_js_1.LiteDocument();
        }
        return LiteWindow2;
      })();
      Window.LiteWindow = LiteWindow;
      return Window;
    }
    var hasRequiredLiteAdaptor;
    function requireLiteAdaptor() {
      if (hasRequiredLiteAdaptor) return liteAdaptor;
      hasRequiredLiteAdaptor = 1;
      var __extends2 = liteAdaptor && liteAdaptor.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      var __assign2 = liteAdaptor && liteAdaptor.__assign || function() {
        __assign2 = Object.assign || function(t2) {
          for (var s, i2 = 1, n = arguments.length; i2 < n; i2++) {
            s = arguments[i2];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
              t2[p] = s[p];
          }
          return t2;
        };
        return __assign2.apply(this, arguments);
      };
      var __values2 = liteAdaptor && liteAdaptor.__values || function(o) {
        var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i2 = 0;
        if (m) return m.call(o);
        if (o && typeof o.length === "number") return {
          next: function() {
            if (o && i2 >= o.length) o = void 0;
            return { value: o && o[i2++], done: !o };
          }
        };
        throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
      };
      var __read2 = liteAdaptor && liteAdaptor.__read || function(o, n) {
        var m = typeof Symbol === "function" && o[Symbol.iterator];
        if (!m) return o;
        var i2 = m.call(o), r2, ar2 = [], e;
        try {
          while ((n === void 0 || n-- > 0) && !(r2 = i2.next()).done) ar2.push(r2.value);
        } catch (error2) {
          e = { error: error2 };
        } finally {
          try {
            if (r2 && !r2.done && (m = i2["return"])) m.call(i2);
          } finally {
            if (e) throw e.error;
          }
        }
        return ar2;
      };
      var __spreadArray2 = liteAdaptor && liteAdaptor.__spreadArray || function(to2, from, pack) {
        if (pack || arguments.length === 2) for (var i2 = 0, l = from.length, ar2; i2 < l; i2++) {
          if (ar2 || !(i2 in from)) {
            if (!ar2) ar2 = Array.prototype.slice.call(from, 0, i2);
            ar2[i2] = from[i2];
          }
        }
        return to2.concat(ar2 || Array.prototype.slice.call(from));
      };
      Object.defineProperty(liteAdaptor, "__esModule", { value: true });
      liteAdaptor.liteAdaptor = liteAdaptor.LiteAdaptor = liteAdaptor.LiteBase = void 0;
      var DOMAdaptor_js_1 = requireDOMAdaptor();
      var NodeMixin_js_1 = requireNodeMixin();
      var Document_js_1 = requireDocument();
      var Element_js_1 = requireElement();
      var Text_js_1 = requireText();
      var Window_js_1 = requireWindow();
      var Parser_js_1 = requireParser$4();
      var Styles_js_1 = requireStyles();
      var LiteBase = (function(_super) {
        __extends2(LiteBase2, _super);
        function LiteBase2() {
          var _this = _super.call(this) || this;
          _this.parser = new Parser_js_1.LiteParser();
          _this.window = new Window_js_1.LiteWindow();
          return _this;
        }
        LiteBase2.prototype.parse = function(text2, format2) {
          return this.parser.parseFromString(text2, format2, this);
        };
        LiteBase2.prototype.create = function(kind, _ns) {
          return new Element_js_1.LiteElement(kind);
        };
        LiteBase2.prototype.text = function(text2) {
          return new Text_js_1.LiteText(text2);
        };
        LiteBase2.prototype.comment = function(text2) {
          return new Text_js_1.LiteComment(text2);
        };
        LiteBase2.prototype.createDocument = function() {
          return new Document_js_1.LiteDocument();
        };
        LiteBase2.prototype.head = function(doc2) {
          return doc2.head;
        };
        LiteBase2.prototype.body = function(doc2) {
          return doc2.body;
        };
        LiteBase2.prototype.root = function(doc2) {
          return doc2.root;
        };
        LiteBase2.prototype.doctype = function(doc2) {
          return doc2.type;
        };
        LiteBase2.prototype.tags = function(node2, name2, ns) {
          if (ns === void 0) {
            ns = null;
          }
          var stack2 = [];
          var tags2 = [];
          if (ns) {
            return tags2;
          }
          var n = node2;
          while (n) {
            var kind = n.kind;
            if (kind !== "#text" && kind !== "#comment") {
              n = n;
              if (kind === name2) {
                tags2.push(n);
              }
              if (n.children.length) {
                stack2 = n.children.concat(stack2);
              }
            }
            n = stack2.shift();
          }
          return tags2;
        };
        LiteBase2.prototype.elementById = function(node2, id) {
          var stack2 = [];
          var n = node2;
          while (n) {
            if (n.kind !== "#text" && n.kind !== "#comment") {
              n = n;
              if (n.attributes["id"] === id) {
                return n;
              }
              if (n.children.length) {
                stack2 = n.children.concat(stack2);
              }
            }
            n = stack2.shift();
          }
          return null;
        };
        LiteBase2.prototype.elementsByClass = function(node2, name2) {
          var stack2 = [];
          var tags2 = [];
          var n = node2;
          while (n) {
            if (n.kind !== "#text" && n.kind !== "#comment") {
              n = n;
              var classes = (n.attributes["class"] || "").trim().split(/ +/);
              if (classes.includes(name2)) {
                tags2.push(n);
              }
              if (n.children.length) {
                stack2 = n.children.concat(stack2);
              }
            }
            n = stack2.shift();
          }
          return tags2;
        };
        LiteBase2.prototype.getElements = function(nodes, document2) {
          var e_1, _a2;
          var containers = [];
          var body2 = this.body(document2);
          try {
            for (var nodes_1 = __values2(nodes), nodes_1_1 = nodes_1.next(); !nodes_1_1.done; nodes_1_1 = nodes_1.next()) {
              var node2 = nodes_1_1.value;
              if (typeof node2 === "string") {
                if (node2.charAt(0) === "#") {
                  var n = this.elementById(body2, node2.slice(1));
                  if (n) {
                    containers.push(n);
                  }
                } else if (node2.charAt(0) === ".") {
                  containers = containers.concat(this.elementsByClass(body2, node2.slice(1)));
                } else if (node2.match(/^[-a-z][-a-z0-9]*$/i)) {
                  containers = containers.concat(this.tags(body2, node2));
                }
              } else if (Array.isArray(node2)) {
                containers = containers.concat(node2);
              } else if (node2 instanceof this.window.NodeList || node2 instanceof this.window.HTMLCollection) {
                containers = containers.concat(node2.nodes);
              } else {
                containers.push(node2);
              }
            }
          } catch (e_1_1) {
            e_1 = { error: e_1_1 };
          } finally {
            try {
              if (nodes_1_1 && !nodes_1_1.done && (_a2 = nodes_1.return)) _a2.call(nodes_1);
            } finally {
              if (e_1) throw e_1.error;
            }
          }
          return containers;
        };
        LiteBase2.prototype.contains = function(container2, node2) {
          while (node2 && node2 !== container2) {
            node2 = this.parent(node2);
          }
          return !!node2;
        };
        LiteBase2.prototype.parent = function(node2) {
          return node2.parent;
        };
        LiteBase2.prototype.childIndex = function(node2) {
          return node2.parent ? node2.parent.children.findIndex(function(n) {
            return n === node2;
          }) : -1;
        };
        LiteBase2.prototype.append = function(node2, child) {
          if (child.parent) {
            this.remove(child);
          }
          node2.children.push(child);
          child.parent = node2;
          return child;
        };
        LiteBase2.prototype.insert = function(nchild, ochild) {
          if (nchild.parent) {
            this.remove(nchild);
          }
          if (ochild && ochild.parent) {
            var i2 = this.childIndex(ochild);
            ochild.parent.children.splice(i2, 0, nchild);
            nchild.parent = ochild.parent;
          }
        };
        LiteBase2.prototype.remove = function(child) {
          var i2 = this.childIndex(child);
          if (i2 >= 0) {
            child.parent.children.splice(i2, 1);
          }
          child.parent = null;
          return child;
        };
        LiteBase2.prototype.replace = function(nnode, onode) {
          var i2 = this.childIndex(onode);
          if (i2 >= 0) {
            onode.parent.children[i2] = nnode;
            nnode.parent = onode.parent;
            onode.parent = null;
          }
          return onode;
        };
        LiteBase2.prototype.clone = function(node2) {
          var _this = this;
          var nnode = new Element_js_1.LiteElement(node2.kind);
          nnode.attributes = __assign2({}, node2.attributes);
          nnode.children = node2.children.map(function(n) {
            if (n.kind === "#text") {
              return new Text_js_1.LiteText(n.value);
            } else if (n.kind === "#comment") {
              return new Text_js_1.LiteComment(n.value);
            } else {
              var m = _this.clone(n);
              m.parent = nnode;
              return m;
            }
          });
          return nnode;
        };
        LiteBase2.prototype.split = function(node2, n) {
          var text2 = new Text_js_1.LiteText(node2.value.slice(n));
          node2.value = node2.value.slice(0, n);
          node2.parent.children.splice(this.childIndex(node2) + 1, 0, text2);
          text2.parent = node2.parent;
          return text2;
        };
        LiteBase2.prototype.next = function(node2) {
          var parent = node2.parent;
          if (!parent)
            return null;
          var i2 = this.childIndex(node2) + 1;
          return i2 >= 0 && i2 < parent.children.length ? parent.children[i2] : null;
        };
        LiteBase2.prototype.previous = function(node2) {
          var parent = node2.parent;
          if (!parent)
            return null;
          var i2 = this.childIndex(node2) - 1;
          return i2 >= 0 ? parent.children[i2] : null;
        };
        LiteBase2.prototype.firstChild = function(node2) {
          return node2.children[0];
        };
        LiteBase2.prototype.lastChild = function(node2) {
          return node2.children[node2.children.length - 1];
        };
        LiteBase2.prototype.childNodes = function(node2) {
          return __spreadArray2([], __read2(node2.children), false);
        };
        LiteBase2.prototype.childNode = function(node2, i2) {
          return node2.children[i2];
        };
        LiteBase2.prototype.kind = function(node2) {
          return node2.kind;
        };
        LiteBase2.prototype.value = function(node2) {
          return node2.kind === "#text" ? node2.value : node2.kind === "#comment" ? node2.value.replace(/^<!(--)?((?:.|\n)*)\1>$/, "$2") : "";
        };
        LiteBase2.prototype.textContent = function(node2) {
          var _this = this;
          return node2.children.reduce(function(s, n) {
            return s + (n.kind === "#text" ? n.value : n.kind === "#comment" ? "" : _this.textContent(n));
          }, "");
        };
        LiteBase2.prototype.innerHTML = function(node2) {
          return this.parser.serializeInner(this, node2);
        };
        LiteBase2.prototype.outerHTML = function(node2) {
          return this.parser.serialize(this, node2);
        };
        LiteBase2.prototype.serializeXML = function(node2) {
          return this.parser.serialize(this, node2, true);
        };
        LiteBase2.prototype.setAttribute = function(node2, name2, value2, ns) {
          if (ns === void 0) {
            ns = null;
          }
          if (typeof value2 !== "string") {
            value2 = String(value2);
          }
          if (ns) {
            name2 = ns.replace(/.*\//, "") + ":" + name2.replace(/^.*:/, "");
          }
          node2.attributes[name2] = value2;
          if (name2 === "style") {
            node2.styles = null;
          }
        };
        LiteBase2.prototype.getAttribute = function(node2, name2) {
          return node2.attributes[name2];
        };
        LiteBase2.prototype.removeAttribute = function(node2, name2) {
          delete node2.attributes[name2];
        };
        LiteBase2.prototype.hasAttribute = function(node2, name2) {
          return node2.attributes.hasOwnProperty(name2);
        };
        LiteBase2.prototype.allAttributes = function(node2) {
          var e_2, _a2;
          var attributes2 = node2.attributes;
          var list2 = [];
          try {
            for (var _b2 = __values2(Object.keys(attributes2)), _c = _b2.next(); !_c.done; _c = _b2.next()) {
              var name_1 = _c.value;
              list2.push({ name: name_1, value: attributes2[name_1] });
            }
          } catch (e_2_1) {
            e_2 = { error: e_2_1 };
          } finally {
            try {
              if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
            } finally {
              if (e_2) throw e_2.error;
            }
          }
          return list2;
        };
        LiteBase2.prototype.addClass = function(node2, name2) {
          var classes = (node2.attributes["class"] || "").split(/ /);
          if (!classes.find(function(n) {
            return n === name2;
          })) {
            classes.push(name2);
            node2.attributes["class"] = classes.join(" ");
          }
        };
        LiteBase2.prototype.removeClass = function(node2, name2) {
          var classes = (node2.attributes["class"] || "").split(/ /);
          var i2 = classes.findIndex(function(n) {
            return n === name2;
          });
          if (i2 >= 0) {
            classes.splice(i2, 1);
            node2.attributes["class"] = classes.join(" ");
          }
        };
        LiteBase2.prototype.hasClass = function(node2, name2) {
          var classes = (node2.attributes["class"] || "").split(/ /);
          return !!classes.find(function(n) {
            return n === name2;
          });
        };
        LiteBase2.prototype.setStyle = function(node2, name2, value2) {
          if (!node2.styles) {
            node2.styles = new Styles_js_1.Styles(this.getAttribute(node2, "style"));
          }
          node2.styles.set(name2, value2);
          node2.attributes["style"] = node2.styles.cssText;
        };
        LiteBase2.prototype.getStyle = function(node2, name2) {
          if (!node2.styles) {
            var style2 = this.getAttribute(node2, "style");
            if (!style2) {
              return "";
            }
            node2.styles = new Styles_js_1.Styles(style2);
          }
          return node2.styles.get(name2);
        };
        LiteBase2.prototype.allStyles = function(node2) {
          return this.getAttribute(node2, "style");
        };
        LiteBase2.prototype.insertRules = function(node2, rules) {
          node2.children = [this.text(rules.join("\n\n") + "\n\n" + this.textContent(node2))];
        };
        LiteBase2.prototype.fontSize = function(_node) {
          return 0;
        };
        LiteBase2.prototype.fontFamily = function(_node) {
          return "";
        };
        LiteBase2.prototype.nodeSize = function(_node, _em, _local) {
          return [0, 0];
        };
        LiteBase2.prototype.nodeBBox = function(_node) {
          return { left: 0, right: 0, top: 0, bottom: 0 };
        };
        return LiteBase2;
      })(DOMAdaptor_js_1.AbstractDOMAdaptor);
      liteAdaptor.LiteBase = LiteBase;
      var LiteAdaptor = (function(_super) {
        __extends2(LiteAdaptor2, _super);
        function LiteAdaptor2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        return LiteAdaptor2;
      })((0, NodeMixin_js_1.NodeMixin)(LiteBase));
      liteAdaptor.LiteAdaptor = LiteAdaptor;
      function liteAdaptor$1(options2) {
        if (options2 === void 0) {
          options2 = null;
        }
        return new LiteAdaptor(null, options2);
      }
      liteAdaptor.liteAdaptor = liteAdaptor$1;
      return liteAdaptor;
    }
    var html$1 = {};
    var HTMLHandler = {};
    var Handler = {};
    var MathDocument = {};
    var MathList = {};
    var LinkedList = {};
    var hasRequiredLinkedList;
    function requireLinkedList() {
      if (hasRequiredLinkedList) return LinkedList;
      hasRequiredLinkedList = 1;
      (function(exports2) {
        var __generator2 = LinkedList && LinkedList.__generator || function(thisArg, body2) {
          var _ = { label: 0, sent: function() {
            if (t2[0] & 1) throw t2[1];
            return t2[1];
          }, trys: [], ops: [] }, f, y, t2, g;
          return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
            return this;
          }), g;
          function verb(n) {
            return function(v) {
              return step([n, v]);
            };
          }
          function step(op) {
            if (f) throw new TypeError("Generator is already executing.");
            while (_) try {
              if (f = 1, y && (t2 = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t2 = y["return"]) && t2.call(y), 0) : y.next) && !(t2 = t2.call(y, op[1])).done) return t2;
              if (y = 0, t2) op = [op[0] & 2, t2.value];
              switch (op[0]) {
                case 0:
                case 1:
                  t2 = op;
                  break;
                case 4:
                  _.label++;
                  return { value: op[1], done: false };
                case 5:
                  _.label++;
                  y = op[1];
                  op = [0];
                  continue;
                case 7:
                  op = _.ops.pop();
                  _.trys.pop();
                  continue;
                default:
                  if (!(t2 = _.trys, t2 = t2.length > 0 && t2[t2.length - 1]) && (op[0] === 6 || op[0] === 2)) {
                    _ = 0;
                    continue;
                  }
                  if (op[0] === 3 && (!t2 || op[1] > t2[0] && op[1] < t2[3])) {
                    _.label = op[1];
                    break;
                  }
                  if (op[0] === 6 && _.label < t2[1]) {
                    _.label = t2[1];
                    t2 = op;
                    break;
                  }
                  if (t2 && _.label < t2[2]) {
                    _.label = t2[2];
                    _.ops.push(op);
                    break;
                  }
                  if (t2[2]) _.ops.pop();
                  _.trys.pop();
                  continue;
              }
              op = body2.call(thisArg, _);
            } catch (e) {
              op = [6, e];
              y = 0;
            } finally {
              f = t2 = 0;
            }
            if (op[0] & 5) throw op[1];
            return { value: op[0] ? op[1] : void 0, done: true };
          }
        };
        var __read2 = LinkedList && LinkedList.__read || function(o, n) {
          var m = typeof Symbol === "function" && o[Symbol.iterator];
          if (!m) return o;
          var i2 = m.call(o), r2, ar2 = [], e;
          try {
            while ((n === void 0 || n-- > 0) && !(r2 = i2.next()).done) ar2.push(r2.value);
          } catch (error2) {
            e = { error: error2 };
          } finally {
            try {
              if (r2 && !r2.done && (m = i2["return"])) m.call(i2);
            } finally {
              if (e) throw e.error;
            }
          }
          return ar2;
        };
        var __spreadArray2 = LinkedList && LinkedList.__spreadArray || function(to2, from, pack) {
          if (pack || arguments.length === 2) for (var i2 = 0, l = from.length, ar2; i2 < l; i2++) {
            if (ar2 || !(i2 in from)) {
              if (!ar2) ar2 = Array.prototype.slice.call(from, 0, i2);
              ar2[i2] = from[i2];
            }
          }
          return to2.concat(ar2 || Array.prototype.slice.call(from));
        };
        var __values2 = LinkedList && LinkedList.__values || function(o) {
          var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i2 = 0;
          if (m) return m.call(o);
          if (o && typeof o.length === "number") return {
            next: function() {
              if (o && i2 >= o.length) o = void 0;
              return { value: o && o[i2++], done: !o };
            }
          };
          throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
        };
        Object.defineProperty(exports2, "__esModule", { value: true });
        exports2.LinkedList = exports2.ListItem = exports2.END = void 0;
        exports2.END = Symbol();
        var ListItem = /* @__PURE__ */ (function() {
          function ListItem2(data) {
            if (data === void 0) {
              data = null;
            }
            this.next = null;
            this.prev = null;
            this.data = data;
          }
          return ListItem2;
        })();
        exports2.ListItem = ListItem;
        var LinkedList$1 = (function() {
          function LinkedList2() {
            var args2 = [];
            for (var _i = 0; _i < arguments.length; _i++) {
              args2[_i] = arguments[_i];
            }
            this.list = new ListItem(exports2.END);
            this.list.next = this.list.prev = this.list;
            this.push.apply(this, __spreadArray2([], __read2(args2), false));
          }
          LinkedList2.prototype.isBefore = function(a, b) {
            return a < b;
          };
          LinkedList2.prototype.push = function() {
            var e_1, _a2;
            var args2 = [];
            for (var _i = 0; _i < arguments.length; _i++) {
              args2[_i] = arguments[_i];
            }
            try {
              for (var args_1 = __values2(args2), args_1_1 = args_1.next(); !args_1_1.done; args_1_1 = args_1.next()) {
                var data = args_1_1.value;
                var item2 = new ListItem(data);
                item2.next = this.list;
                item2.prev = this.list.prev;
                this.list.prev = item2;
                item2.prev.next = item2;
              }
            } catch (e_1_1) {
              e_1 = { error: e_1_1 };
            } finally {
              try {
                if (args_1_1 && !args_1_1.done && (_a2 = args_1.return)) _a2.call(args_1);
              } finally {
                if (e_1) throw e_1.error;
              }
            }
            return this;
          };
          LinkedList2.prototype.pop = function() {
            var item2 = this.list.prev;
            if (item2.data === exports2.END) {
              return null;
            }
            this.list.prev = item2.prev;
            item2.prev.next = this.list;
            item2.next = item2.prev = null;
            return item2.data;
          };
          LinkedList2.prototype.unshift = function() {
            var e_2, _a2;
            var args2 = [];
            for (var _i = 0; _i < arguments.length; _i++) {
              args2[_i] = arguments[_i];
            }
            try {
              for (var _b2 = __values2(args2.slice(0).reverse()), _c = _b2.next(); !_c.done; _c = _b2.next()) {
                var data = _c.value;
                var item2 = new ListItem(data);
                item2.next = this.list.next;
                item2.prev = this.list;
                this.list.next = item2;
                item2.next.prev = item2;
              }
            } catch (e_2_1) {
              e_2 = { error: e_2_1 };
            } finally {
              try {
                if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
              } finally {
                if (e_2) throw e_2.error;
              }
            }
            return this;
          };
          LinkedList2.prototype.shift = function() {
            var item2 = this.list.next;
            if (item2.data === exports2.END) {
              return null;
            }
            this.list.next = item2.next;
            item2.next.prev = this.list;
            item2.next = item2.prev = null;
            return item2.data;
          };
          LinkedList2.prototype.remove = function() {
            var e_3, _a2;
            var items = [];
            for (var _i = 0; _i < arguments.length; _i++) {
              items[_i] = arguments[_i];
            }
            var map2 = /* @__PURE__ */ new Map();
            try {
              for (var items_1 = __values2(items), items_1_1 = items_1.next(); !items_1_1.done; items_1_1 = items_1.next()) {
                var item_1 = items_1_1.value;
                map2.set(item_1, true);
              }
            } catch (e_3_1) {
              e_3 = { error: e_3_1 };
            } finally {
              try {
                if (items_1_1 && !items_1_1.done && (_a2 = items_1.return)) _a2.call(items_1);
              } finally {
                if (e_3) throw e_3.error;
              }
            }
            var item2 = this.list.next;
            while (item2.data !== exports2.END) {
              var next = item2.next;
              if (map2.has(item2.data)) {
                item2.prev.next = item2.next;
                item2.next.prev = item2.prev;
                item2.next = item2.prev = null;
              }
              item2 = next;
            }
          };
          LinkedList2.prototype.clear = function() {
            this.list.next.prev = this.list.prev.next = null;
            this.list.next = this.list.prev = this.list;
            return this;
          };
          LinkedList2.prototype[Symbol.iterator] = function() {
            var current2;
            return __generator2(this, function(_a2) {
              switch (_a2.label) {
                case 0:
                  current2 = this.list.next;
                  _a2.label = 1;
                case 1:
                  if (!(current2.data !== exports2.END)) return [3, 3];
                  return [4, current2.data];
                case 2:
                  _a2.sent();
                  current2 = current2.next;
                  return [3, 1];
                case 3:
                  return [2];
              }
            });
          };
          LinkedList2.prototype.reversed = function() {
            var current2;
            return __generator2(this, function(_a2) {
              switch (_a2.label) {
                case 0:
                  current2 = this.list.prev;
                  _a2.label = 1;
                case 1:
                  if (!(current2.data !== exports2.END)) return [3, 3];
                  return [4, current2.data];
                case 2:
                  _a2.sent();
                  current2 = current2.prev;
                  return [3, 1];
                case 3:
                  return [2];
              }
            });
          };
          LinkedList2.prototype.insert = function(data, isBefore) {
            if (isBefore === void 0) {
              isBefore = null;
            }
            if (isBefore === null) {
              isBefore = this.isBefore.bind(this);
            }
            var item2 = new ListItem(data);
            var cur2 = this.list.next;
            while (cur2.data !== exports2.END && isBefore(cur2.data, item2.data)) {
              cur2 = cur2.next;
            }
            item2.prev = cur2.prev;
            item2.next = cur2;
            cur2.prev.next = cur2.prev = item2;
            return this;
          };
          LinkedList2.prototype.sort = function(isBefore) {
            var e_4, _a2;
            if (isBefore === void 0) {
              isBefore = null;
            }
            if (isBefore === null) {
              isBefore = this.isBefore.bind(this);
            }
            var lists = [];
            try {
              for (var _b2 = __values2(this), _c = _b2.next(); !_c.done; _c = _b2.next()) {
                var item2 = _c.value;
                lists.push(new LinkedList2(item2));
              }
            } catch (e_4_1) {
              e_4 = { error: e_4_1 };
            } finally {
              try {
                if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
              } finally {
                if (e_4) throw e_4.error;
              }
            }
            this.list.next = this.list.prev = this.list;
            while (lists.length > 1) {
              var l1 = lists.shift();
              var l2 = lists.shift();
              l1.merge(l2, isBefore);
              lists.push(l1);
            }
            if (lists.length) {
              this.list = lists[0].list;
            }
            return this;
          };
          LinkedList2.prototype.merge = function(list2, isBefore) {
            var _a2, _b2, _c, _d, _e2;
            if (isBefore === void 0) {
              isBefore = null;
            }
            if (isBefore === null) {
              isBefore = this.isBefore.bind(this);
            }
            var lcur = this.list.next;
            var mcur = list2.list.next;
            while (lcur.data !== exports2.END && mcur.data !== exports2.END) {
              if (isBefore(mcur.data, lcur.data)) {
                _a2 = __read2([lcur, mcur], 2), mcur.prev.next = _a2[0], lcur.prev.next = _a2[1];
                _b2 = __read2([lcur.prev, mcur.prev], 2), mcur.prev = _b2[0], lcur.prev = _b2[1];
                _c = __read2([list2.list, this.list], 2), this.list.prev.next = _c[0], list2.list.prev.next = _c[1];
                _d = __read2([list2.list.prev, this.list.prev], 2), this.list.prev = _d[0], list2.list.prev = _d[1];
                _e2 = __read2([mcur.next, lcur], 2), lcur = _e2[0], mcur = _e2[1];
              } else {
                lcur = lcur.next;
              }
            }
            if (mcur.data !== exports2.END) {
              this.list.prev.next = list2.list.next;
              list2.list.next.prev = this.list.prev;
              list2.list.prev.next = this.list;
              this.list.prev = list2.list.prev;
              list2.list.next = list2.list.prev = list2.list;
            }
            return this;
          };
          return LinkedList2;
        })();
        exports2.LinkedList = LinkedList$1;
      })(LinkedList);
      return LinkedList;
    }
    var hasRequiredMathList;
    function requireMathList() {
      if (hasRequiredMathList) return MathList;
      hasRequiredMathList = 1;
      var __extends2 = MathList && MathList.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      Object.defineProperty(MathList, "__esModule", { value: true });
      MathList.AbstractMathList = void 0;
      var LinkedList_js_1 = requireLinkedList();
      var AbstractMathList = (function(_super) {
        __extends2(AbstractMathList2, _super);
        function AbstractMathList2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        AbstractMathList2.prototype.isBefore = function(a, b) {
          return a.start.i < b.start.i || a.start.i === b.start.i && a.start.n < b.start.n;
        };
        return AbstractMathList2;
      })(LinkedList_js_1.LinkedList);
      MathList.AbstractMathList = AbstractMathList;
      return MathList;
    }
    var MmlFactory = {};
    var NodeFactory = {};
    var hasRequiredNodeFactory;
    function requireNodeFactory() {
      if (hasRequiredNodeFactory) return NodeFactory;
      hasRequiredNodeFactory = 1;
      var __extends2 = NodeFactory && NodeFactory.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      Object.defineProperty(NodeFactory, "__esModule", { value: true });
      NodeFactory.AbstractNodeFactory = void 0;
      var Factory_js_1 = requireFactory();
      var AbstractNodeFactory = (function(_super) {
        __extends2(AbstractNodeFactory2, _super);
        function AbstractNodeFactory2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        AbstractNodeFactory2.prototype.create = function(kind, properties, children2) {
          if (properties === void 0) {
            properties = {};
          }
          if (children2 === void 0) {
            children2 = [];
          }
          return this.node[kind](properties, children2);
        };
        return AbstractNodeFactory2;
      })(Factory_js_1.AbstractFactory);
      NodeFactory.AbstractNodeFactory = AbstractNodeFactory;
      return NodeFactory;
    }
    var MML = {};
    var mstyle = {};
    var hasRequiredMstyle;
    function requireMstyle() {
      if (hasRequiredMstyle) return mstyle;
      hasRequiredMstyle = 1;
      var __extends2 = mstyle && mstyle.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      var __assign2 = mstyle && mstyle.__assign || function() {
        __assign2 = Object.assign || function(t2) {
          for (var s, i2 = 1, n = arguments.length; i2 < n; i2++) {
            s = arguments[i2];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
              t2[p] = s[p];
          }
          return t2;
        };
        return __assign2.apply(this, arguments);
      };
      Object.defineProperty(mstyle, "__esModule", { value: true });
      mstyle.MmlMstyle = void 0;
      var MmlNode_js_1 = requireMmlNode();
      var Attributes_js_1 = requireAttributes$2();
      var MmlMstyle = (function(_super) {
        __extends2(MmlMstyle2, _super);
        function MmlMstyle2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        Object.defineProperty(MmlMstyle2.prototype, "kind", {
          get: function() {
            return "mstyle";
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(MmlMstyle2.prototype, "notParent", {
          get: function() {
            return this.childNodes[0] && this.childNodes[0].childNodes.length === 1;
          },
          enumerable: false,
          configurable: true
        });
        MmlMstyle2.prototype.setChildInheritedAttributes = function(attributes2, display, level, prime2) {
          var scriptlevel = this.attributes.getExplicit("scriptlevel");
          if (scriptlevel != null) {
            scriptlevel = scriptlevel.toString();
            if (scriptlevel.match(/^\s*[-+]/)) {
              level += parseInt(scriptlevel);
            } else {
              level = parseInt(scriptlevel);
            }
            prime2 = false;
          }
          var displaystyle = this.attributes.getExplicit("displaystyle");
          if (displaystyle != null) {
            display = displaystyle === true;
            prime2 = false;
          }
          var cramped = this.attributes.getExplicit("data-cramped");
          if (cramped != null) {
            prime2 = cramped;
          }
          attributes2 = this.addInheritedAttributes(attributes2, this.attributes.getAllAttributes());
          this.childNodes[0].setInheritedAttributes(attributes2, display, level, prime2);
        };
        MmlMstyle2.defaults = __assign2(__assign2({}, MmlNode_js_1.AbstractMmlLayoutNode.defaults), { scriptlevel: Attributes_js_1.INHERIT, displaystyle: Attributes_js_1.INHERIT, scriptsizemultiplier: 1 / Math.sqrt(2), scriptminsize: "8px", mathbackground: Attributes_js_1.INHERIT, mathcolor: Attributes_js_1.INHERIT, dir: Attributes_js_1.INHERIT, infixlinebreakstyle: "before" });
        return MmlMstyle2;
      })(MmlNode_js_1.AbstractMmlLayoutNode);
      mstyle.MmlMstyle = MmlMstyle;
      return mstyle;
    }
    var maligngroup = {};
    var hasRequiredMaligngroup;
    function requireMaligngroup() {
      if (hasRequiredMaligngroup) return maligngroup;
      hasRequiredMaligngroup = 1;
      var __extends2 = maligngroup && maligngroup.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      var __assign2 = maligngroup && maligngroup.__assign || function() {
        __assign2 = Object.assign || function(t2) {
          for (var s, i2 = 1, n = arguments.length; i2 < n; i2++) {
            s = arguments[i2];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
              t2[p] = s[p];
          }
          return t2;
        };
        return __assign2.apply(this, arguments);
      };
      Object.defineProperty(maligngroup, "__esModule", { value: true });
      maligngroup.MmlMaligngroup = void 0;
      var MmlNode_js_1 = requireMmlNode();
      var Attributes_js_1 = requireAttributes$2();
      var MmlMaligngroup = (function(_super) {
        __extends2(MmlMaligngroup2, _super);
        function MmlMaligngroup2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        Object.defineProperty(MmlMaligngroup2.prototype, "kind", {
          get: function() {
            return "maligngroup";
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(MmlMaligngroup2.prototype, "isSpacelike", {
          get: function() {
            return true;
          },
          enumerable: false,
          configurable: true
        });
        MmlMaligngroup2.prototype.setChildInheritedAttributes = function(attributes2, display, level, prime2) {
          attributes2 = this.addInheritedAttributes(attributes2, this.attributes.getAllAttributes());
          _super.prototype.setChildInheritedAttributes.call(this, attributes2, display, level, prime2);
        };
        MmlMaligngroup2.defaults = __assign2(__assign2({}, MmlNode_js_1.AbstractMmlLayoutNode.defaults), { groupalign: Attributes_js_1.INHERIT });
        return MmlMaligngroup2;
      })(MmlNode_js_1.AbstractMmlLayoutNode);
      maligngroup.MmlMaligngroup = MmlMaligngroup;
      return maligngroup;
    }
    var malignmark = {};
    var hasRequiredMalignmark;
    function requireMalignmark() {
      if (hasRequiredMalignmark) return malignmark;
      hasRequiredMalignmark = 1;
      var __extends2 = malignmark && malignmark.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      var __assign2 = malignmark && malignmark.__assign || function() {
        __assign2 = Object.assign || function(t2) {
          for (var s, i2 = 1, n = arguments.length; i2 < n; i2++) {
            s = arguments[i2];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
              t2[p] = s[p];
          }
          return t2;
        };
        return __assign2.apply(this, arguments);
      };
      Object.defineProperty(malignmark, "__esModule", { value: true });
      malignmark.MmlMalignmark = void 0;
      var MmlNode_js_1 = requireMmlNode();
      var MmlMalignmark = (function(_super) {
        __extends2(MmlMalignmark2, _super);
        function MmlMalignmark2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        Object.defineProperty(MmlMalignmark2.prototype, "kind", {
          get: function() {
            return "malignmark";
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(MmlMalignmark2.prototype, "arity", {
          get: function() {
            return 0;
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(MmlMalignmark2.prototype, "isSpacelike", {
          get: function() {
            return true;
          },
          enumerable: false,
          configurable: true
        });
        MmlMalignmark2.defaults = __assign2(__assign2({}, MmlNode_js_1.AbstractMmlNode.defaults), { edge: "left" });
        return MmlMalignmark2;
      })(MmlNode_js_1.AbstractMmlNode);
      malignmark.MmlMalignmark = MmlMalignmark;
      return malignmark;
    }
    var mathchoice = {};
    var hasRequiredMathchoice;
    function requireMathchoice() {
      if (hasRequiredMathchoice) return mathchoice;
      hasRequiredMathchoice = 1;
      var __extends2 = mathchoice && mathchoice.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      var __assign2 = mathchoice && mathchoice.__assign || function() {
        __assign2 = Object.assign || function(t2) {
          for (var s, i2 = 1, n = arguments.length; i2 < n; i2++) {
            s = arguments[i2];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
              t2[p] = s[p];
          }
          return t2;
        };
        return __assign2.apply(this, arguments);
      };
      Object.defineProperty(mathchoice, "__esModule", { value: true });
      mathchoice.MathChoice = void 0;
      var MmlNode_js_1 = requireMmlNode();
      var MathChoice = (function(_super) {
        __extends2(MathChoice2, _super);
        function MathChoice2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        Object.defineProperty(MathChoice2.prototype, "kind", {
          get: function() {
            return "MathChoice";
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(MathChoice2.prototype, "arity", {
          get: function() {
            return 4;
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(MathChoice2.prototype, "notParent", {
          get: function() {
            return true;
          },
          enumerable: false,
          configurable: true
        });
        MathChoice2.prototype.setInheritedAttributes = function(attributes2, display, level, prime2) {
          var selection = display ? 0 : Math.max(0, Math.min(level, 2)) + 1;
          var child = this.childNodes[selection] || this.factory.create("mrow");
          this.parent.replaceChild(child, this);
          child.setInheritedAttributes(attributes2, display, level, prime2);
        };
        MathChoice2.defaults = __assign2({}, MmlNode_js_1.AbstractMmlBaseNode.defaults);
        return MathChoice2;
      })(MmlNode_js_1.AbstractMmlBaseNode);
      mathchoice.MathChoice = MathChoice;
      return mathchoice;
    }
    var hasRequiredMML;
    function requireMML() {
      if (hasRequiredMML) return MML;
      hasRequiredMML = 1;
      var _a2;
      Object.defineProperty(MML, "__esModule", { value: true });
      MML.MML = void 0;
      var MmlNode_js_1 = requireMmlNode();
      var math_js_1 = requireMath$1();
      var mi_js_1 = requireMi$1();
      var mn_js_1 = requireMn$1();
      var mo_js_1 = requireMo$2();
      var mtext_js_1 = requireMtext$1();
      var mspace_js_1 = requireMspace$1();
      var ms_js_1 = requireMs$1();
      var mrow_js_1 = requireMrow$1();
      var mfrac_js_1 = requireMfrac$1();
      var msqrt_js_1 = requireMsqrt$1();
      var mroot_js_1 = requireMroot$1();
      var mstyle_js_1 = requireMstyle();
      var merror_js_1 = requireMerror$1();
      var mpadded_js_1 = requireMpadded$1();
      var mphantom_js_1 = requireMphantom$1();
      var mfenced_js_1 = requireMfenced$1();
      var menclose_js_1 = requireMenclose$1();
      var maction_js_1 = requireMaction$1();
      var msubsup_js_1 = requireMsubsup$1();
      var munderover_js_1 = requireMunderover$1();
      var mmultiscripts_js_1 = requireMmultiscripts$1();
      var mtable_js_1 = requireMtable$1();
      var mtr_js_1 = requireMtr$1();
      var mtd_js_1 = requireMtd$1();
      var maligngroup_js_1 = requireMaligngroup();
      var malignmark_js_1 = requireMalignmark();
      var mglyph_js_1 = requireMglyph$1();
      var semantics_js_1 = requireSemantics$1();
      var TeXAtom_js_1 = requireTeXAtom$1();
      var mathchoice_js_1 = requireMathchoice();
      MML.MML = (_a2 = {}, _a2[math_js_1.MmlMath.prototype.kind] = math_js_1.MmlMath, _a2[mi_js_1.MmlMi.prototype.kind] = mi_js_1.MmlMi, _a2[mn_js_1.MmlMn.prototype.kind] = mn_js_1.MmlMn, _a2[mo_js_1.MmlMo.prototype.kind] = mo_js_1.MmlMo, _a2[mtext_js_1.MmlMtext.prototype.kind] = mtext_js_1.MmlMtext, _a2[mspace_js_1.MmlMspace.prototype.kind] = mspace_js_1.MmlMspace, _a2[ms_js_1.MmlMs.prototype.kind] = ms_js_1.MmlMs, _a2[mrow_js_1.MmlMrow.prototype.kind] = mrow_js_1.MmlMrow, _a2[mrow_js_1.MmlInferredMrow.prototype.kind] = mrow_js_1.MmlInferredMrow, _a2[mfrac_js_1.MmlMfrac.prototype.kind] = mfrac_js_1.MmlMfrac, _a2[msqrt_js_1.MmlMsqrt.prototype.kind] = msqrt_js_1.MmlMsqrt, _a2[mroot_js_1.MmlMroot.prototype.kind] = mroot_js_1.MmlMroot, _a2[mstyle_js_1.MmlMstyle.prototype.kind] = mstyle_js_1.MmlMstyle, _a2[merror_js_1.MmlMerror.prototype.kind] = merror_js_1.MmlMerror, _a2[mpadded_js_1.MmlMpadded.prototype.kind] = mpadded_js_1.MmlMpadded, _a2[mphantom_js_1.MmlMphantom.prototype.kind] = mphantom_js_1.MmlMphantom, _a2[mfenced_js_1.MmlMfenced.prototype.kind] = mfenced_js_1.MmlMfenced, _a2[menclose_js_1.MmlMenclose.prototype.kind] = menclose_js_1.MmlMenclose, _a2[maction_js_1.MmlMaction.prototype.kind] = maction_js_1.MmlMaction, _a2[msubsup_js_1.MmlMsub.prototype.kind] = msubsup_js_1.MmlMsub, _a2[msubsup_js_1.MmlMsup.prototype.kind] = msubsup_js_1.MmlMsup, _a2[msubsup_js_1.MmlMsubsup.prototype.kind] = msubsup_js_1.MmlMsubsup, _a2[munderover_js_1.MmlMunder.prototype.kind] = munderover_js_1.MmlMunder, _a2[munderover_js_1.MmlMover.prototype.kind] = munderover_js_1.MmlMover, _a2[munderover_js_1.MmlMunderover.prototype.kind] = munderover_js_1.MmlMunderover, _a2[mmultiscripts_js_1.MmlMmultiscripts.prototype.kind] = mmultiscripts_js_1.MmlMmultiscripts, _a2[mmultiscripts_js_1.MmlMprescripts.prototype.kind] = mmultiscripts_js_1.MmlMprescripts, _a2[mmultiscripts_js_1.MmlNone.prototype.kind] = mmultiscripts_js_1.MmlNone, _a2[mtable_js_1.MmlMtable.prototype.kind] = mtable_js_1.MmlMtable, _a2[mtr_js_1.MmlMlabeledtr.prototype.kind] = mtr_js_1.MmlMlabeledtr, _a2[mtr_js_1.MmlMtr.prototype.kind] = mtr_js_1.MmlMtr, _a2[mtd_js_1.MmlMtd.prototype.kind] = mtd_js_1.MmlMtd, _a2[maligngroup_js_1.MmlMaligngroup.prototype.kind] = maligngroup_js_1.MmlMaligngroup, _a2[malignmark_js_1.MmlMalignmark.prototype.kind] = malignmark_js_1.MmlMalignmark, _a2[mglyph_js_1.MmlMglyph.prototype.kind] = mglyph_js_1.MmlMglyph, _a2[semantics_js_1.MmlSemantics.prototype.kind] = semantics_js_1.MmlSemantics, _a2[semantics_js_1.MmlAnnotation.prototype.kind] = semantics_js_1.MmlAnnotation, _a2[semantics_js_1.MmlAnnotationXML.prototype.kind] = semantics_js_1.MmlAnnotationXML, _a2[TeXAtom_js_1.TeXAtom.prototype.kind] = TeXAtom_js_1.TeXAtom, _a2[mathchoice_js_1.MathChoice.prototype.kind] = mathchoice_js_1.MathChoice, _a2[MmlNode_js_1.TextNode.prototype.kind] = MmlNode_js_1.TextNode, _a2[MmlNode_js_1.XMLNode.prototype.kind] = MmlNode_js_1.XMLNode, _a2);
      return MML;
    }
    var hasRequiredMmlFactory;
    function requireMmlFactory() {
      if (hasRequiredMmlFactory) return MmlFactory;
      hasRequiredMmlFactory = 1;
      var __extends2 = MmlFactory && MmlFactory.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      Object.defineProperty(MmlFactory, "__esModule", { value: true });
      MmlFactory.MmlFactory = void 0;
      var NodeFactory_js_1 = requireNodeFactory();
      var MML_js_1 = requireMML();
      var MmlFactory$1 = (function(_super) {
        __extends2(MmlFactory2, _super);
        function MmlFactory2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        Object.defineProperty(MmlFactory2.prototype, "MML", {
          get: function() {
            return this.node;
          },
          enumerable: false,
          configurable: true
        });
        MmlFactory2.defaultNodes = MML_js_1.MML;
        return MmlFactory2;
      })(NodeFactory_js_1.AbstractNodeFactory);
      MmlFactory.MmlFactory = MmlFactory$1;
      return MmlFactory;
    }
    var BitField = {};
    var hasRequiredBitField;
    function requireBitField() {
      if (hasRequiredBitField) return BitField;
      hasRequiredBitField = 1;
      var __extends2 = BitField && BitField.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      var __values2 = BitField && BitField.__values || function(o) {
        var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i2 = 0;
        if (m) return m.call(o);
        if (o && typeof o.length === "number") return {
          next: function() {
            if (o && i2 >= o.length) o = void 0;
            return { value: o && o[i2++], done: !o };
          }
        };
        throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
      };
      var __read2 = BitField && BitField.__read || function(o, n) {
        var m = typeof Symbol === "function" && o[Symbol.iterator];
        if (!m) return o;
        var i2 = m.call(o), r2, ar2 = [], e;
        try {
          while ((n === void 0 || n-- > 0) && !(r2 = i2.next()).done) ar2.push(r2.value);
        } catch (error2) {
          e = { error: error2 };
        } finally {
          try {
            if (r2 && !r2.done && (m = i2["return"])) m.call(i2);
          } finally {
            if (e) throw e.error;
          }
        }
        return ar2;
      };
      var __spreadArray2 = BitField && BitField.__spreadArray || function(to2, from, pack) {
        if (pack || arguments.length === 2) for (var i2 = 0, l = from.length, ar2; i2 < l; i2++) {
          if (ar2 || !(i2 in from)) {
            if (!ar2) ar2 = Array.prototype.slice.call(from, 0, i2);
            ar2[i2] = from[i2];
          }
        }
        return to2.concat(ar2 || Array.prototype.slice.call(from));
      };
      Object.defineProperty(BitField, "__esModule", { value: true });
      BitField.BitFieldClass = BitField.BitField = void 0;
      var BitField$1 = (function() {
        function BitField2() {
          this.bits = 0;
        }
        BitField2.allocate = function() {
          var e_1, _a2;
          var names = [];
          for (var _i = 0; _i < arguments.length; _i++) {
            names[_i] = arguments[_i];
          }
          try {
            for (var names_1 = __values2(names), names_1_1 = names_1.next(); !names_1_1.done; names_1_1 = names_1.next()) {
              var name_1 = names_1_1.value;
              if (this.has(name_1)) {
                throw new Error("Bit already allocated for " + name_1);
              }
              if (this.next === BitField2.MAXBIT) {
                throw new Error("Maximum number of bits already allocated");
              }
              this.names.set(name_1, this.next);
              this.next <<= 1;
            }
          } catch (e_1_1) {
            e_1 = { error: e_1_1 };
          } finally {
            try {
              if (names_1_1 && !names_1_1.done && (_a2 = names_1.return)) _a2.call(names_1);
            } finally {
              if (e_1) throw e_1.error;
            }
          }
        };
        BitField2.has = function(name2) {
          return this.names.has(name2);
        };
        BitField2.prototype.set = function(name2) {
          this.bits |= this.getBit(name2);
        };
        BitField2.prototype.clear = function(name2) {
          this.bits &= ~this.getBit(name2);
        };
        BitField2.prototype.isSet = function(name2) {
          return !!(this.bits & this.getBit(name2));
        };
        BitField2.prototype.reset = function() {
          this.bits = 0;
        };
        BitField2.prototype.getBit = function(name2) {
          var bit = this.constructor.names.get(name2);
          if (!bit) {
            throw new Error("Unknown bit-field name: " + name2);
          }
          return bit;
        };
        BitField2.MAXBIT = 1 << 31;
        BitField2.next = 1;
        BitField2.names = /* @__PURE__ */ new Map();
        return BitField2;
      })();
      BitField.BitField = BitField$1;
      function BitFieldClass() {
        var names = [];
        for (var _i = 0; _i < arguments.length; _i++) {
          names[_i] = arguments[_i];
        }
        var Bits = (function(_super) {
          __extends2(Bits2, _super);
          function Bits2() {
            return _super !== null && _super.apply(this, arguments) || this;
          }
          return Bits2;
        })(BitField$1);
        Bits.allocate.apply(Bits, __spreadArray2([], __read2(names), false));
        return Bits;
      }
      BitField.BitFieldClass = BitFieldClass;
      return BitField;
    }
    var hasRequiredMathDocument;
    function requireMathDocument() {
      if (hasRequiredMathDocument) return MathDocument;
      hasRequiredMathDocument = 1;
      (function(exports2) {
        var __extends2 = MathDocument && MathDocument.__extends || /* @__PURE__ */ (function() {
          var extendStatics2 = function(d, b) {
            extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
              d2.__proto__ = b2;
            } || function(d2, b2) {
              for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
            };
            return extendStatics2(d, b);
          };
          return function(d, b) {
            if (typeof b !== "function" && b !== null)
              throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
            extendStatics2(d, b);
            function __() {
              this.constructor = d;
            }
            d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
          };
        })();
        var __values2 = MathDocument && MathDocument.__values || function(o) {
          var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i2 = 0;
          if (m) return m.call(o);
          if (o && typeof o.length === "number") return {
            next: function() {
              if (o && i2 >= o.length) o = void 0;
              return { value: o && o[i2++], done: !o };
            }
          };
          throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
        };
        var __read2 = MathDocument && MathDocument.__read || function(o, n) {
          var m = typeof Symbol === "function" && o[Symbol.iterator];
          if (!m) return o;
          var i2 = m.call(o), r2, ar2 = [], e;
          try {
            while ((n === void 0 || n-- > 0) && !(r2 = i2.next()).done) ar2.push(r2.value);
          } catch (error2) {
            e = { error: error2 };
          } finally {
            try {
              if (r2 && !r2.done && (m = i2["return"])) m.call(i2);
            } finally {
              if (e) throw e.error;
            }
          }
          return ar2;
        };
        var __spreadArray2 = MathDocument && MathDocument.__spreadArray || function(to2, from, pack) {
          if (pack || arguments.length === 2) for (var i2 = 0, l = from.length, ar2; i2 < l; i2++) {
            if (ar2 || !(i2 in from)) {
              if (!ar2) ar2 = Array.prototype.slice.call(from, 0, i2);
              ar2[i2] = from[i2];
            }
          }
          return to2.concat(ar2 || Array.prototype.slice.call(from));
        };
        Object.defineProperty(exports2, "__esModule", { value: true });
        exports2.AbstractMathDocument = exports2.resetAllOptions = exports2.resetOptions = exports2.RenderList = void 0;
        var Options_js_1 = requireOptions$1();
        var InputJax_js_1 = requireInputJax();
        var OutputJax_js_1 = requireOutputJax$1();
        var MathList_js_1 = requireMathList();
        var MathItem_js_1 = requireMathItem();
        var MmlFactory_js_1 = requireMmlFactory();
        var BitField_js_1 = requireBitField();
        var PrioritizedList_js_1 = requirePrioritizedList();
        var RenderList = (function(_super) {
          __extends2(RenderList2, _super);
          function RenderList2() {
            return _super !== null && _super.apply(this, arguments) || this;
          }
          RenderList2.create = function(actions) {
            var e_1, _a2;
            var list2 = new this();
            try {
              for (var _b2 = __values2(Object.keys(actions)), _c = _b2.next(); !_c.done; _c = _b2.next()) {
                var id = _c.value;
                var _d = __read2(this.action(id, actions[id]), 2), action = _d[0], priority = _d[1];
                if (priority) {
                  list2.add(action, priority);
                }
              }
            } catch (e_1_1) {
              e_1 = { error: e_1_1 };
            } finally {
              try {
                if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
              } finally {
                if (e_1) throw e_1.error;
              }
            }
            return list2;
          };
          RenderList2.action = function(id, action) {
            var _a2, _b2, _c, _d;
            var renderDoc, renderMath;
            var convert = true;
            var priority = action[0];
            if (action.length === 1 || typeof action[1] === "boolean") {
              action.length === 2 && (convert = action[1]);
              _a2 = __read2(this.methodActions(id), 2), renderDoc = _a2[0], renderMath = _a2[1];
            } else if (typeof action[1] === "string") {
              if (typeof action[2] === "string") {
                action.length === 4 && (convert = action[3]);
                var _e2 = __read2(action.slice(1), 2), method1 = _e2[0], method2 = _e2[1];
                _b2 = __read2(this.methodActions(method1, method2), 2), renderDoc = _b2[0], renderMath = _b2[1];
              } else {
                action.length === 3 && (convert = action[2]);
                _c = __read2(this.methodActions(action[1]), 2), renderDoc = _c[0], renderMath = _c[1];
              }
            } else {
              action.length === 4 && (convert = action[3]);
              _d = __read2(action.slice(1), 2), renderDoc = _d[0], renderMath = _d[1];
            }
            return [{ id, renderDoc, renderMath, convert }, priority];
          };
          RenderList2.methodActions = function(method1, method2) {
            if (method2 === void 0) {
              method2 = method1;
            }
            return [
              function(document2) {
                method1 && document2[method1]();
                return false;
              },
              function(math2, document2) {
                method2 && math2[method2](document2);
                return false;
              }
            ];
          };
          RenderList2.prototype.renderDoc = function(document2, start2) {
            var e_2, _a2;
            if (start2 === void 0) {
              start2 = MathItem_js_1.STATE.UNPROCESSED;
            }
            try {
              for (var _b2 = __values2(this.items), _c = _b2.next(); !_c.done; _c = _b2.next()) {
                var item2 = _c.value;
                if (item2.priority >= start2) {
                  if (item2.item.renderDoc(document2))
                    return;
                }
              }
            } catch (e_2_1) {
              e_2 = { error: e_2_1 };
            } finally {
              try {
                if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
              } finally {
                if (e_2) throw e_2.error;
              }
            }
          };
          RenderList2.prototype.renderMath = function(math2, document2, start2) {
            var e_3, _a2;
            if (start2 === void 0) {
              start2 = MathItem_js_1.STATE.UNPROCESSED;
            }
            try {
              for (var _b2 = __values2(this.items), _c = _b2.next(); !_c.done; _c = _b2.next()) {
                var item2 = _c.value;
                if (item2.priority >= start2) {
                  if (item2.item.renderMath(math2, document2))
                    return;
                }
              }
            } catch (e_3_1) {
              e_3 = { error: e_3_1 };
            } finally {
              try {
                if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
              } finally {
                if (e_3) throw e_3.error;
              }
            }
          };
          RenderList2.prototype.renderConvert = function(math2, document2, end2) {
            var e_4, _a2;
            if (end2 === void 0) {
              end2 = MathItem_js_1.STATE.LAST;
            }
            try {
              for (var _b2 = __values2(this.items), _c = _b2.next(); !_c.done; _c = _b2.next()) {
                var item2 = _c.value;
                if (item2.priority > end2)
                  return;
                if (item2.item.convert) {
                  if (item2.item.renderMath(math2, document2))
                    return;
                }
              }
            } catch (e_4_1) {
              e_4 = { error: e_4_1 };
            } finally {
              try {
                if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
              } finally {
                if (e_4) throw e_4.error;
              }
            }
          };
          RenderList2.prototype.findID = function(id) {
            var e_5, _a2;
            try {
              for (var _b2 = __values2(this.items), _c = _b2.next(); !_c.done; _c = _b2.next()) {
                var item2 = _c.value;
                if (item2.item.id === id) {
                  return item2.item;
                }
              }
            } catch (e_5_1) {
              e_5 = { error: e_5_1 };
            } finally {
              try {
                if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
              } finally {
                if (e_5) throw e_5.error;
              }
            }
            return null;
          };
          return RenderList2;
        })(PrioritizedList_js_1.PrioritizedList);
        exports2.RenderList = RenderList;
        exports2.resetOptions = {
          all: false,
          processed: false,
          inputJax: null,
          outputJax: null
        };
        exports2.resetAllOptions = {
          all: true,
          processed: true,
          inputJax: [],
          outputJax: []
        };
        var DefaultInputJax = (function(_super) {
          __extends2(DefaultInputJax2, _super);
          function DefaultInputJax2() {
            return _super !== null && _super.apply(this, arguments) || this;
          }
          DefaultInputJax2.prototype.compile = function(_math) {
            return null;
          };
          return DefaultInputJax2;
        })(InputJax_js_1.AbstractInputJax);
        var DefaultOutputJax = (function(_super) {
          __extends2(DefaultOutputJax2, _super);
          function DefaultOutputJax2() {
            return _super !== null && _super.apply(this, arguments) || this;
          }
          DefaultOutputJax2.prototype.typeset = function(_math, _document) {
            return null;
          };
          DefaultOutputJax2.prototype.escaped = function(_math, _document) {
            return null;
          };
          return DefaultOutputJax2;
        })(OutputJax_js_1.AbstractOutputJax);
        var DefaultMathList = (function(_super) {
          __extends2(DefaultMathList2, _super);
          function DefaultMathList2() {
            return _super !== null && _super.apply(this, arguments) || this;
          }
          return DefaultMathList2;
        })(MathList_js_1.AbstractMathList);
        var DefaultMathItem = (function(_super) {
          __extends2(DefaultMathItem2, _super);
          function DefaultMathItem2() {
            return _super !== null && _super.apply(this, arguments) || this;
          }
          return DefaultMathItem2;
        })(MathItem_js_1.AbstractMathItem);
        var AbstractMathDocument = (function() {
          function AbstractMathDocument2(document2, adaptor, options2) {
            var _this = this;
            var CLASS = this.constructor;
            this.document = document2;
            this.options = (0, Options_js_1.userOptions)((0, Options_js_1.defaultOptions)({}, CLASS.OPTIONS), options2);
            this.math = new (this.options["MathList"] || DefaultMathList)();
            this.renderActions = RenderList.create(this.options["renderActions"]);
            this.processed = new AbstractMathDocument2.ProcessBits();
            this.outputJax = this.options["OutputJax"] || new DefaultOutputJax();
            var inputJax = this.options["InputJax"] || [new DefaultInputJax()];
            if (!Array.isArray(inputJax)) {
              inputJax = [inputJax];
            }
            this.inputJax = inputJax;
            this.adaptor = adaptor;
            this.outputJax.setAdaptor(adaptor);
            this.inputJax.map(function(jax) {
              return jax.setAdaptor(adaptor);
            });
            this.mmlFactory = this.options["MmlFactory"] || new MmlFactory_js_1.MmlFactory();
            this.inputJax.map(function(jax) {
              return jax.setMmlFactory(_this.mmlFactory);
            });
            this.outputJax.initialize();
            this.inputJax.map(function(jax) {
              return jax.initialize();
            });
          }
          Object.defineProperty(AbstractMathDocument2.prototype, "kind", {
            get: function() {
              return this.constructor.KIND;
            },
            enumerable: false,
            configurable: true
          });
          AbstractMathDocument2.prototype.addRenderAction = function(id) {
            var action = [];
            for (var _i = 1; _i < arguments.length; _i++) {
              action[_i - 1] = arguments[_i];
            }
            var _a2 = __read2(RenderList.action(id, action), 2), fn2 = _a2[0], p = _a2[1];
            this.renderActions.add(fn2, p);
          };
          AbstractMathDocument2.prototype.removeRenderAction = function(id) {
            var action = this.renderActions.findID(id);
            if (action) {
              this.renderActions.remove(action);
            }
          };
          AbstractMathDocument2.prototype.render = function() {
            this.renderActions.renderDoc(this);
            return this;
          };
          AbstractMathDocument2.prototype.rerender = function(start2) {
            if (start2 === void 0) {
              start2 = MathItem_js_1.STATE.RERENDER;
            }
            this.state(start2 - 1);
            this.render();
            return this;
          };
          AbstractMathDocument2.prototype.convert = function(math2, options2) {
            if (options2 === void 0) {
              options2 = {};
            }
            var _a2 = (0, Options_js_1.userOptions)({
              format: this.inputJax[0].name,
              display: true,
              end: MathItem_js_1.STATE.LAST,
              em: 16,
              ex: 8,
              containerWidth: null,
              lineWidth: 1e6,
              scale: 1,
              family: ""
            }, options2), format2 = _a2.format, display = _a2.display, end2 = _a2.end, ex = _a2.ex, em = _a2.em, containerWidth = _a2.containerWidth, lineWidth = _a2.lineWidth, scale = _a2.scale, family = _a2.family;
            if (containerWidth === null) {
              containerWidth = 80 * ex;
            }
            var jax = this.inputJax.reduce(function(jax2, ijax) {
              return ijax.name === format2 ? ijax : jax2;
            }, null);
            var mitem = new this.options.MathItem(math2, jax, display);
            mitem.start.node = this.adaptor.body(this.document);
            mitem.setMetrics(em, ex, containerWidth, lineWidth, scale);
            if (this.outputJax.options.mtextInheritFont) {
              mitem.outputData.mtextFamily = family;
            }
            if (this.outputJax.options.merrorInheritFont) {
              mitem.outputData.merrorFamily = family;
            }
            mitem.convert(this, end2);
            return mitem.typesetRoot || mitem.root;
          };
          AbstractMathDocument2.prototype.findMath = function(_options) {
            this.processed.set("findMath");
            return this;
          };
          AbstractMathDocument2.prototype.compile = function() {
            var e_6, _a2, e_7, _b2;
            if (!this.processed.isSet("compile")) {
              var recompile = [];
              try {
                for (var _c = __values2(this.math), _d = _c.next(); !_d.done; _d = _c.next()) {
                  var math2 = _d.value;
                  this.compileMath(math2);
                  if (math2.inputData.recompile !== void 0) {
                    recompile.push(math2);
                  }
                }
              } catch (e_6_1) {
                e_6 = { error: e_6_1 };
              } finally {
                try {
                  if (_d && !_d.done && (_a2 = _c.return)) _a2.call(_c);
                } finally {
                  if (e_6) throw e_6.error;
                }
              }
              try {
                for (var recompile_1 = __values2(recompile), recompile_1_1 = recompile_1.next(); !recompile_1_1.done; recompile_1_1 = recompile_1.next()) {
                  var math2 = recompile_1_1.value;
                  var data = math2.inputData.recompile;
                  math2.state(data.state);
                  math2.inputData.recompile = data;
                  this.compileMath(math2);
                }
              } catch (e_7_1) {
                e_7 = { error: e_7_1 };
              } finally {
                try {
                  if (recompile_1_1 && !recompile_1_1.done && (_b2 = recompile_1.return)) _b2.call(recompile_1);
                } finally {
                  if (e_7) throw e_7.error;
                }
              }
              this.processed.set("compile");
            }
            return this;
          };
          AbstractMathDocument2.prototype.compileMath = function(math2) {
            try {
              math2.compile(this);
            } catch (err2) {
              if (err2.retry || err2.restart) {
                throw err2;
              }
              this.options["compileError"](this, math2, err2);
              math2.inputData["error"] = err2;
            }
          };
          AbstractMathDocument2.prototype.compileError = function(math2, err2) {
            math2.root = this.mmlFactory.create("math", null, [
              this.mmlFactory.create("merror", { "data-mjx-error": err2.message, title: err2.message }, [
                this.mmlFactory.create("mtext", null, [
                  this.mmlFactory.create("text").setText("Math input error")
                ])
              ])
            ]);
            if (math2.display) {
              math2.root.attributes.set("display", "block");
            }
            math2.inputData.error = err2.message;
          };
          AbstractMathDocument2.prototype.typeset = function() {
            var e_8, _a2;
            if (!this.processed.isSet("typeset")) {
              try {
                for (var _b2 = __values2(this.math), _c = _b2.next(); !_c.done; _c = _b2.next()) {
                  var math2 = _c.value;
                  try {
                    math2.typeset(this);
                  } catch (err2) {
                    if (err2.retry || err2.restart) {
                      throw err2;
                    }
                    this.options["typesetError"](this, math2, err2);
                    math2.outputData["error"] = err2;
                  }
                }
              } catch (e_8_1) {
                e_8 = { error: e_8_1 };
              } finally {
                try {
                  if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
                } finally {
                  if (e_8) throw e_8.error;
                }
              }
              this.processed.set("typeset");
            }
            return this;
          };
          AbstractMathDocument2.prototype.typesetError = function(math2, err2) {
            math2.typesetRoot = this.adaptor.node("mjx-container", {
              class: "MathJax mjx-output-error",
              jax: this.outputJax.name
            }, [
              this.adaptor.node("span", {
                "data-mjx-error": err2.message,
                title: err2.message,
                style: {
                  color: "red",
                  "background-color": "yellow",
                  "line-height": "normal"
                }
              }, [
                this.adaptor.text("Math output error")
              ])
            ]);
            if (math2.display) {
              this.adaptor.setAttributes(math2.typesetRoot, {
                style: {
                  display: "block",
                  margin: "1em 0",
                  "text-align": "center"
                }
              });
            }
            math2.outputData.error = err2.message;
          };
          AbstractMathDocument2.prototype.getMetrics = function() {
            if (!this.processed.isSet("getMetrics")) {
              this.outputJax.getMetrics(this);
              this.processed.set("getMetrics");
            }
            return this;
          };
          AbstractMathDocument2.prototype.updateDocument = function() {
            var e_9, _a2;
            if (!this.processed.isSet("updateDocument")) {
              try {
                for (var _b2 = __values2(this.math.reversed()), _c = _b2.next(); !_c.done; _c = _b2.next()) {
                  var math2 = _c.value;
                  math2.updateDocument(this);
                }
              } catch (e_9_1) {
                e_9 = { error: e_9_1 };
              } finally {
                try {
                  if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
                } finally {
                  if (e_9) throw e_9.error;
                }
              }
              this.processed.set("updateDocument");
            }
            return this;
          };
          AbstractMathDocument2.prototype.removeFromDocument = function(_restore) {
            return this;
          };
          AbstractMathDocument2.prototype.state = function(state, restore) {
            var e_10, _a2;
            if (restore === void 0) {
              restore = false;
            }
            try {
              for (var _b2 = __values2(this.math), _c = _b2.next(); !_c.done; _c = _b2.next()) {
                var math2 = _c.value;
                math2.state(state, restore);
              }
            } catch (e_10_1) {
              e_10 = { error: e_10_1 };
            } finally {
              try {
                if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
              } finally {
                if (e_10) throw e_10.error;
              }
            }
            if (state < MathItem_js_1.STATE.INSERTED) {
              this.processed.clear("updateDocument");
            }
            if (state < MathItem_js_1.STATE.TYPESET) {
              this.processed.clear("typeset");
              this.processed.clear("getMetrics");
            }
            if (state < MathItem_js_1.STATE.COMPILED) {
              this.processed.clear("compile");
            }
            return this;
          };
          AbstractMathDocument2.prototype.reset = function(options2) {
            var _a2;
            if (options2 === void 0) {
              options2 = { processed: true };
            }
            options2 = (0, Options_js_1.userOptions)(Object.assign({}, exports2.resetOptions), options2);
            options2.all && Object.assign(options2, exports2.resetAllOptions);
            options2.processed && this.processed.reset();
            options2.inputJax && this.inputJax.forEach(function(jax) {
              return jax.reset.apply(jax, __spreadArray2([], __read2(options2.inputJax), false));
            });
            options2.outputJax && (_a2 = this.outputJax).reset.apply(_a2, __spreadArray2([], __read2(options2.outputJax), false));
            return this;
          };
          AbstractMathDocument2.prototype.clear = function() {
            this.reset();
            this.math.clear();
            return this;
          };
          AbstractMathDocument2.prototype.concat = function(list2) {
            this.math.merge(list2);
            return this;
          };
          AbstractMathDocument2.prototype.clearMathItemsWithin = function(containers) {
            var _a2;
            var items = this.getMathItemsWithin(containers);
            (_a2 = this.math).remove.apply(_a2, __spreadArray2([], __read2(items), false));
            return items;
          };
          AbstractMathDocument2.prototype.getMathItemsWithin = function(elements) {
            var e_11, _a2, e_12, _b2;
            if (!Array.isArray(elements)) {
              elements = [elements];
            }
            var adaptor = this.adaptor;
            var items = [];
            var containers = adaptor.getElements(elements, this.document);
            try {
              ITEMS: for (var _c = __values2(this.math), _d = _c.next(); !_d.done; _d = _c.next()) {
                var item2 = _d.value;
                try {
                  for (var containers_1 = (e_12 = void 0, __values2(containers)), containers_1_1 = containers_1.next(); !containers_1_1.done; containers_1_1 = containers_1.next()) {
                    var container2 = containers_1_1.value;
                    if (item2.start.node && adaptor.contains(container2, item2.start.node)) {
                      items.push(item2);
                      continue ITEMS;
                    }
                  }
                } catch (e_12_1) {
                  e_12 = { error: e_12_1 };
                } finally {
                  try {
                    if (containers_1_1 && !containers_1_1.done && (_b2 = containers_1.return)) _b2.call(containers_1);
                  } finally {
                    if (e_12) throw e_12.error;
                  }
                }
              }
            } catch (e_11_1) {
              e_11 = { error: e_11_1 };
            } finally {
              try {
                if (_d && !_d.done && (_a2 = _c.return)) _a2.call(_c);
              } finally {
                if (e_11) throw e_11.error;
              }
            }
            return items;
          };
          AbstractMathDocument2.KIND = "MathDocument";
          AbstractMathDocument2.OPTIONS = {
            OutputJax: null,
            InputJax: null,
            MmlFactory: null,
            MathList: DefaultMathList,
            MathItem: DefaultMathItem,
            compileError: function(doc2, math2, err2) {
              doc2.compileError(math2, err2);
            },
            typesetError: function(doc2, math2, err2) {
              doc2.typesetError(math2, err2);
            },
            renderActions: (0, Options_js_1.expandable)({
              find: [MathItem_js_1.STATE.FINDMATH, "findMath", "", false],
              compile: [MathItem_js_1.STATE.COMPILED],
              metrics: [MathItem_js_1.STATE.METRICS, "getMetrics", "", false],
              typeset: [MathItem_js_1.STATE.TYPESET],
              update: [MathItem_js_1.STATE.INSERTED, "updateDocument", false]
            })
          };
          AbstractMathDocument2.ProcessBits = (0, BitField_js_1.BitFieldClass)("findMath", "compile", "getMetrics", "typeset", "updateDocument");
          return AbstractMathDocument2;
        })();
        exports2.AbstractMathDocument = AbstractMathDocument;
      })(MathDocument);
      return MathDocument;
    }
    var hasRequiredHandler;
    function requireHandler() {
      if (hasRequiredHandler) return Handler;
      hasRequiredHandler = 1;
      var __extends2 = Handler && Handler.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      Object.defineProperty(Handler, "__esModule", { value: true });
      Handler.AbstractHandler = void 0;
      var MathDocument_js_1 = requireMathDocument();
      var DefaultMathDocument = (function(_super) {
        __extends2(DefaultMathDocument2, _super);
        function DefaultMathDocument2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        return DefaultMathDocument2;
      })(MathDocument_js_1.AbstractMathDocument);
      var AbstractHandler = (function() {
        function AbstractHandler2(adaptor, priority) {
          if (priority === void 0) {
            priority = 5;
          }
          this.documentClass = DefaultMathDocument;
          this.adaptor = adaptor;
          this.priority = priority;
        }
        Object.defineProperty(AbstractHandler2.prototype, "name", {
          get: function() {
            return this.constructor.NAME;
          },
          enumerable: false,
          configurable: true
        });
        AbstractHandler2.prototype.handlesDocument = function(_document) {
          return false;
        };
        AbstractHandler2.prototype.create = function(document2, options2) {
          return new this.documentClass(document2, this.adaptor, options2);
        };
        AbstractHandler2.NAME = "generic";
        return AbstractHandler2;
      })();
      Handler.AbstractHandler = AbstractHandler;
      return Handler;
    }
    var HTMLDocument = {};
    var HTMLMathItem = {};
    var hasRequiredHTMLMathItem;
    function requireHTMLMathItem() {
      if (hasRequiredHTMLMathItem) return HTMLMathItem;
      hasRequiredHTMLMathItem = 1;
      var __extends2 = HTMLMathItem && HTMLMathItem.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      Object.defineProperty(HTMLMathItem, "__esModule", { value: true });
      HTMLMathItem.HTMLMathItem = void 0;
      var MathItem_js_1 = requireMathItem();
      var HTMLMathItem$1 = (function(_super) {
        __extends2(HTMLMathItem2, _super);
        function HTMLMathItem2(math2, jax, display, start2, end2) {
          if (display === void 0) {
            display = true;
          }
          if (start2 === void 0) {
            start2 = { node: null, n: 0, delim: "" };
          }
          if (end2 === void 0) {
            end2 = { node: null, n: 0, delim: "" };
          }
          return _super.call(this, math2, jax, display, start2, end2) || this;
        }
        Object.defineProperty(HTMLMathItem2.prototype, "adaptor", {
          get: function() {
            return this.inputJax.adaptor;
          },
          enumerable: false,
          configurable: true
        });
        HTMLMathItem2.prototype.updateDocument = function(_html) {
          if (this.state() < MathItem_js_1.STATE.INSERTED) {
            if (this.inputJax.processStrings) {
              var node2 = this.start.node;
              if (node2 === this.end.node) {
                if (this.end.n && this.end.n < this.adaptor.value(this.end.node).length) {
                  this.adaptor.split(this.end.node, this.end.n);
                }
                if (this.start.n) {
                  node2 = this.adaptor.split(this.start.node, this.start.n);
                }
                this.adaptor.replace(this.typesetRoot, node2);
              } else {
                if (this.start.n) {
                  node2 = this.adaptor.split(node2, this.start.n);
                }
                while (node2 !== this.end.node) {
                  var next = this.adaptor.next(node2);
                  this.adaptor.remove(node2);
                  node2 = next;
                }
                this.adaptor.insert(this.typesetRoot, node2);
                if (this.end.n < this.adaptor.value(node2).length) {
                  this.adaptor.split(node2, this.end.n);
                }
                this.adaptor.remove(node2);
              }
            } else {
              this.adaptor.replace(this.typesetRoot, this.start.node);
            }
            this.start.node = this.end.node = this.typesetRoot;
            this.start.n = this.end.n = 0;
            this.state(MathItem_js_1.STATE.INSERTED);
          }
        };
        HTMLMathItem2.prototype.updateStyleSheet = function(document2) {
          document2.addStyleSheet();
        };
        HTMLMathItem2.prototype.removeFromDocument = function(restore) {
          if (restore === void 0) {
            restore = false;
          }
          if (this.state() >= MathItem_js_1.STATE.TYPESET) {
            var adaptor = this.adaptor;
            var node2 = this.start.node;
            var math2 = adaptor.text("");
            if (restore) {
              var text2 = this.start.delim + this.math + this.end.delim;
              if (this.inputJax.processStrings) {
                math2 = adaptor.text(text2);
              } else {
                var doc2 = adaptor.parse(text2, "text/html");
                math2 = adaptor.firstChild(adaptor.body(doc2));
              }
            }
            if (adaptor.parent(node2)) {
              adaptor.replace(math2, node2);
            }
            this.start.node = this.end.node = math2;
            this.start.n = this.end.n = 0;
          }
        };
        return HTMLMathItem2;
      })(MathItem_js_1.AbstractMathItem);
      HTMLMathItem.HTMLMathItem = HTMLMathItem$1;
      return HTMLMathItem;
    }
    var HTMLMathList = {};
    var hasRequiredHTMLMathList;
    function requireHTMLMathList() {
      if (hasRequiredHTMLMathList) return HTMLMathList;
      hasRequiredHTMLMathList = 1;
      var __extends2 = HTMLMathList && HTMLMathList.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      Object.defineProperty(HTMLMathList, "__esModule", { value: true });
      HTMLMathList.HTMLMathList = void 0;
      var MathList_js_1 = requireMathList();
      var HTMLMathList$1 = (function(_super) {
        __extends2(HTMLMathList2, _super);
        function HTMLMathList2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        return HTMLMathList2;
      })(MathList_js_1.AbstractMathList);
      HTMLMathList.HTMLMathList = HTMLMathList$1;
      return HTMLMathList;
    }
    var HTMLDomStrings = {};
    var hasRequiredHTMLDomStrings;
    function requireHTMLDomStrings() {
      if (hasRequiredHTMLDomStrings) return HTMLDomStrings;
      hasRequiredHTMLDomStrings = 1;
      var __read2 = HTMLDomStrings && HTMLDomStrings.__read || function(o, n) {
        var m = typeof Symbol === "function" && o[Symbol.iterator];
        if (!m) return o;
        var i2 = m.call(o), r2, ar2 = [], e;
        try {
          while ((n === void 0 || n-- > 0) && !(r2 = i2.next()).done) ar2.push(r2.value);
        } catch (error2) {
          e = { error: error2 };
        } finally {
          try {
            if (r2 && !r2.done && (m = i2["return"])) m.call(i2);
          } finally {
            if (e) throw e.error;
          }
        }
        return ar2;
      };
      Object.defineProperty(HTMLDomStrings, "__esModule", { value: true });
      HTMLDomStrings.HTMLDomStrings = void 0;
      var Options_js_1 = requireOptions$1();
      var HTMLDomStrings$1 = (function() {
        function HTMLDomStrings2(options2) {
          if (options2 === void 0) {
            options2 = null;
          }
          var CLASS = this.constructor;
          this.options = (0, Options_js_1.userOptions)((0, Options_js_1.defaultOptions)({}, CLASS.OPTIONS), options2);
          this.init();
          this.getPatterns();
        }
        HTMLDomStrings2.prototype.init = function() {
          this.strings = [];
          this.string = "";
          this.snodes = [];
          this.nodes = [];
          this.stack = [];
        };
        HTMLDomStrings2.prototype.getPatterns = function() {
          var skip = (0, Options_js_1.makeArray)(this.options["skipHtmlTags"]);
          var ignore = (0, Options_js_1.makeArray)(this.options["ignoreHtmlClass"]);
          var process2 = (0, Options_js_1.makeArray)(this.options["processHtmlClass"]);
          this.skipHtmlTags = new RegExp("^(?:" + skip.join("|") + ")$", "i");
          this.ignoreHtmlClass = new RegExp("(?:^| )(?:" + ignore.join("|") + ")(?: |$)");
          this.processHtmlClass = new RegExp("(?:^| )(?:" + process2 + ")(?: |$)");
        };
        HTMLDomStrings2.prototype.pushString = function() {
          if (this.string.match(/\S/)) {
            this.strings.push(this.string);
            this.nodes.push(this.snodes);
          }
          this.string = "";
          this.snodes = [];
        };
        HTMLDomStrings2.prototype.extendString = function(node2, text2) {
          this.snodes.push([node2, text2.length]);
          this.string += text2;
        };
        HTMLDomStrings2.prototype.handleText = function(node2, ignore) {
          if (!ignore) {
            this.extendString(node2, this.adaptor.value(node2));
          }
          return this.adaptor.next(node2);
        };
        HTMLDomStrings2.prototype.handleTag = function(node2, ignore) {
          if (!ignore) {
            var text2 = this.options["includeHtmlTags"][this.adaptor.kind(node2)];
            this.extendString(node2, text2);
          }
          return this.adaptor.next(node2);
        };
        HTMLDomStrings2.prototype.handleContainer = function(node2, ignore) {
          this.pushString();
          var cname = this.adaptor.getAttribute(node2, "class") || "";
          var tname = this.adaptor.kind(node2) || "";
          var process2 = this.processHtmlClass.exec(cname);
          var next = node2;
          if (this.adaptor.firstChild(node2) && !this.adaptor.getAttribute(node2, "data-MJX") && (process2 || !this.skipHtmlTags.exec(tname))) {
            if (this.adaptor.next(node2)) {
              this.stack.push([this.adaptor.next(node2), ignore]);
            }
            next = this.adaptor.firstChild(node2);
            ignore = (ignore || this.ignoreHtmlClass.exec(cname)) && !process2;
          } else {
            next = this.adaptor.next(node2);
          }
          return [next, ignore];
        };
        HTMLDomStrings2.prototype.handleOther = function(node2, _ignore) {
          this.pushString();
          return this.adaptor.next(node2);
        };
        HTMLDomStrings2.prototype.find = function(node2) {
          var _a2, _b2;
          this.init();
          var stop = this.adaptor.next(node2);
          var ignore = false;
          var include = this.options["includeHtmlTags"];
          while (node2 && node2 !== stop) {
            var kind = this.adaptor.kind(node2);
            if (kind === "#text") {
              node2 = this.handleText(node2, ignore);
            } else if (include.hasOwnProperty(kind)) {
              node2 = this.handleTag(node2, ignore);
            } else if (kind) {
              _a2 = __read2(this.handleContainer(node2, ignore), 2), node2 = _a2[0], ignore = _a2[1];
            } else {
              node2 = this.handleOther(node2, ignore);
            }
            if (!node2 && this.stack.length) {
              this.pushString();
              _b2 = __read2(this.stack.pop(), 2), node2 = _b2[0], ignore = _b2[1];
            }
          }
          this.pushString();
          var result2 = [this.strings, this.nodes];
          this.init();
          return result2;
        };
        HTMLDomStrings2.OPTIONS = {
          skipHtmlTags: ["script", "noscript", "style", "textarea", "pre", "code", "annotation", "annotation-xml"],
          includeHtmlTags: { br: "\n", wbr: "", "#comment": "" },
          ignoreHtmlClass: "mathjax_ignore",
          processHtmlClass: "mathjax_process"
        };
        return HTMLDomStrings2;
      })();
      HTMLDomStrings.HTMLDomStrings = HTMLDomStrings$1;
      return HTMLDomStrings;
    }
    var hasRequiredHTMLDocument;
    function requireHTMLDocument() {
      if (hasRequiredHTMLDocument) return HTMLDocument;
      hasRequiredHTMLDocument = 1;
      var __extends2 = HTMLDocument && HTMLDocument.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      var __assign2 = HTMLDocument && HTMLDocument.__assign || function() {
        __assign2 = Object.assign || function(t2) {
          for (var s, i2 = 1, n = arguments.length; i2 < n; i2++) {
            s = arguments[i2];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
              t2[p] = s[p];
          }
          return t2;
        };
        return __assign2.apply(this, arguments);
      };
      var __read2 = HTMLDocument && HTMLDocument.__read || function(o, n) {
        var m = typeof Symbol === "function" && o[Symbol.iterator];
        if (!m) return o;
        var i2 = m.call(o), r2, ar2 = [], e;
        try {
          while ((n === void 0 || n-- > 0) && !(r2 = i2.next()).done) ar2.push(r2.value);
        } catch (error2) {
          e = { error: error2 };
        } finally {
          try {
            if (r2 && !r2.done && (m = i2["return"])) m.call(i2);
          } finally {
            if (e) throw e.error;
          }
        }
        return ar2;
      };
      var __values2 = HTMLDocument && HTMLDocument.__values || function(o) {
        var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i2 = 0;
        if (m) return m.call(o);
        if (o && typeof o.length === "number") return {
          next: function() {
            if (o && i2 >= o.length) o = void 0;
            return { value: o && o[i2++], done: !o };
          }
        };
        throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
      };
      Object.defineProperty(HTMLDocument, "__esModule", { value: true });
      HTMLDocument.HTMLDocument = void 0;
      var MathDocument_js_1 = requireMathDocument();
      var Options_js_1 = requireOptions$1();
      var HTMLMathItem_js_1 = requireHTMLMathItem();
      var HTMLMathList_js_1 = requireHTMLMathList();
      var HTMLDomStrings_js_1 = requireHTMLDomStrings();
      var MathItem_js_1 = requireMathItem();
      var HTMLDocument$1 = (function(_super) {
        __extends2(HTMLDocument2, _super);
        function HTMLDocument2(document2, adaptor, options2) {
          var _this = this;
          var _a2 = __read2((0, Options_js_1.separateOptions)(options2, HTMLDomStrings_js_1.HTMLDomStrings.OPTIONS), 2), html2 = _a2[0], dom = _a2[1];
          _this = _super.call(this, document2, adaptor, html2) || this;
          _this.domStrings = _this.options["DomStrings"] || new HTMLDomStrings_js_1.HTMLDomStrings(dom);
          _this.domStrings.adaptor = adaptor;
          _this.styles = [];
          return _this;
        }
        HTMLDocument2.prototype.findPosition = function(N, index, delim, nodes) {
          var e_1, _a2;
          var adaptor = this.adaptor;
          try {
            for (var _b2 = __values2(nodes[N]), _c = _b2.next(); !_c.done; _c = _b2.next()) {
              var list2 = _c.value;
              var _d = __read2(list2, 2), node2 = _d[0], n = _d[1];
              if (index <= n && adaptor.kind(node2) === "#text") {
                return { node: node2, n: Math.max(index, 0), delim };
              }
              index -= n;
            }
          } catch (e_1_1) {
            e_1 = { error: e_1_1 };
          } finally {
            try {
              if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
            } finally {
              if (e_1) throw e_1.error;
            }
          }
          return { node: null, n: 0, delim };
        };
        HTMLDocument2.prototype.mathItem = function(item2, jax, nodes) {
          var math2 = item2.math;
          var start2 = this.findPosition(item2.n, item2.start.n, item2.open, nodes);
          var end2 = this.findPosition(item2.n, item2.end.n, item2.close, nodes);
          return new this.options.MathItem(math2, jax, item2.display, start2, end2);
        };
        HTMLDocument2.prototype.findMath = function(options2) {
          var e_2, _a2, e_3, _b2, _c, e_4, _d, e_5, _e2;
          if (!this.processed.isSet("findMath")) {
            this.adaptor.document = this.document;
            options2 = (0, Options_js_1.userOptions)({ elements: this.options.elements || [this.adaptor.body(this.document)] }, options2);
            try {
              for (var _f = __values2(this.adaptor.getElements(options2["elements"], this.document)), _g = _f.next(); !_g.done; _g = _f.next()) {
                var container2 = _g.value;
                var _h = __read2([null, null], 2), strings = _h[0], nodes = _h[1];
                try {
                  for (var _j = (e_3 = void 0, __values2(this.inputJax)), _k = _j.next(); !_k.done; _k = _j.next()) {
                    var jax = _k.value;
                    var list2 = new this.options["MathList"]();
                    if (jax.processStrings) {
                      if (strings === null) {
                        _c = __read2(this.domStrings.find(container2), 2), strings = _c[0], nodes = _c[1];
                      }
                      try {
                        for (var _l = (e_4 = void 0, __values2(jax.findMath(strings))), _m = _l.next(); !_m.done; _m = _l.next()) {
                          var math2 = _m.value;
                          list2.push(this.mathItem(math2, jax, nodes));
                        }
                      } catch (e_4_1) {
                        e_4 = { error: e_4_1 };
                      } finally {
                        try {
                          if (_m && !_m.done && (_d = _l.return)) _d.call(_l);
                        } finally {
                          if (e_4) throw e_4.error;
                        }
                      }
                    } else {
                      try {
                        for (var _o2 = (e_5 = void 0, __values2(jax.findMath(container2))), _p = _o2.next(); !_p.done; _p = _o2.next()) {
                          var math2 = _p.value;
                          var item2 = new this.options.MathItem(math2.math, jax, math2.display, math2.start, math2.end);
                          list2.push(item2);
                        }
                      } catch (e_5_1) {
                        e_5 = { error: e_5_1 };
                      } finally {
                        try {
                          if (_p && !_p.done && (_e2 = _o2.return)) _e2.call(_o2);
                        } finally {
                          if (e_5) throw e_5.error;
                        }
                      }
                    }
                    this.math.merge(list2);
                  }
                } catch (e_3_1) {
                  e_3 = { error: e_3_1 };
                } finally {
                  try {
                    if (_k && !_k.done && (_b2 = _j.return)) _b2.call(_j);
                  } finally {
                    if (e_3) throw e_3.error;
                  }
                }
              }
            } catch (e_2_1) {
              e_2 = { error: e_2_1 };
            } finally {
              try {
                if (_g && !_g.done && (_a2 = _f.return)) _a2.call(_f);
              } finally {
                if (e_2) throw e_2.error;
              }
            }
            this.processed.set("findMath");
          }
          return this;
        };
        HTMLDocument2.prototype.updateDocument = function() {
          if (!this.processed.isSet("updateDocument")) {
            this.addPageElements();
            this.addStyleSheet();
            _super.prototype.updateDocument.call(this);
            this.processed.set("updateDocument");
          }
          return this;
        };
        HTMLDocument2.prototype.addPageElements = function() {
          var body2 = this.adaptor.body(this.document);
          var node2 = this.documentPageElements();
          if (node2) {
            this.adaptor.append(body2, node2);
          }
        };
        HTMLDocument2.prototype.addStyleSheet = function() {
          var sheet = this.documentStyleSheet();
          var adaptor = this.adaptor;
          if (sheet && !adaptor.parent(sheet)) {
            var head = adaptor.head(this.document);
            var styles2 = this.findSheet(head, adaptor.getAttribute(sheet, "id"));
            if (styles2) {
              adaptor.replace(sheet, styles2);
            } else {
              adaptor.append(head, sheet);
            }
          }
        };
        HTMLDocument2.prototype.findSheet = function(head, id) {
          var e_6, _a2;
          if (id) {
            try {
              for (var _b2 = __values2(this.adaptor.tags(head, "style")), _c = _b2.next(); !_c.done; _c = _b2.next()) {
                var sheet = _c.value;
                if (this.adaptor.getAttribute(sheet, "id") === id) {
                  return sheet;
                }
              }
            } catch (e_6_1) {
              e_6 = { error: e_6_1 };
            } finally {
              try {
                if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
              } finally {
                if (e_6) throw e_6.error;
              }
            }
          }
          return null;
        };
        HTMLDocument2.prototype.removeFromDocument = function(restore) {
          var e_7, _a2;
          if (restore === void 0) {
            restore = false;
          }
          if (this.processed.isSet("updateDocument")) {
            try {
              for (var _b2 = __values2(this.math), _c = _b2.next(); !_c.done; _c = _b2.next()) {
                var math2 = _c.value;
                if (math2.state() >= MathItem_js_1.STATE.INSERTED) {
                  math2.state(MathItem_js_1.STATE.TYPESET, restore);
                }
              }
            } catch (e_7_1) {
              e_7 = { error: e_7_1 };
            } finally {
              try {
                if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
              } finally {
                if (e_7) throw e_7.error;
              }
            }
          }
          this.processed.clear("updateDocument");
          return this;
        };
        HTMLDocument2.prototype.documentStyleSheet = function() {
          return this.outputJax.styleSheet(this);
        };
        HTMLDocument2.prototype.documentPageElements = function() {
          return this.outputJax.pageElements(this);
        };
        HTMLDocument2.prototype.addStyles = function(styles2) {
          this.styles.push(styles2);
        };
        HTMLDocument2.prototype.getStyles = function() {
          return this.styles;
        };
        HTMLDocument2.KIND = "HTML";
        HTMLDocument2.OPTIONS = __assign2(__assign2({}, MathDocument_js_1.AbstractMathDocument.OPTIONS), { renderActions: (0, Options_js_1.expandable)(__assign2(__assign2({}, MathDocument_js_1.AbstractMathDocument.OPTIONS.renderActions), { styles: [MathItem_js_1.STATE.INSERTED + 1, "", "updateStyleSheet", false] })), MathList: HTMLMathList_js_1.HTMLMathList, MathItem: HTMLMathItem_js_1.HTMLMathItem, DomStrings: null });
        return HTMLDocument2;
      })(MathDocument_js_1.AbstractMathDocument);
      HTMLDocument.HTMLDocument = HTMLDocument$1;
      return HTMLDocument;
    }
    var hasRequiredHTMLHandler;
    function requireHTMLHandler() {
      if (hasRequiredHTMLHandler) return HTMLHandler;
      hasRequiredHTMLHandler = 1;
      var __extends2 = HTMLHandler && HTMLHandler.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      Object.defineProperty(HTMLHandler, "__esModule", { value: true });
      HTMLHandler.HTMLHandler = void 0;
      var Handler_js_1 = requireHandler();
      var HTMLDocument_js_1 = requireHTMLDocument();
      var HTMLHandler$1 = (function(_super) {
        __extends2(HTMLHandler2, _super);
        function HTMLHandler2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.documentClass = HTMLDocument_js_1.HTMLDocument;
          return _this;
        }
        HTMLHandler2.prototype.handlesDocument = function(document2) {
          var adaptor = this.adaptor;
          if (typeof document2 === "string") {
            try {
              document2 = adaptor.parse(document2, "text/html");
            } catch (err2) {
            }
          }
          if (document2 instanceof adaptor.window.Document || document2 instanceof adaptor.window.HTMLElement || document2 instanceof adaptor.window.DocumentFragment) {
            return true;
          }
          return false;
        };
        HTMLHandler2.prototype.create = function(document2, options2) {
          var adaptor = this.adaptor;
          if (typeof document2 === "string") {
            document2 = adaptor.parse(document2, "text/html");
          } else if (document2 instanceof adaptor.window.HTMLElement || document2 instanceof adaptor.window.DocumentFragment) {
            var child = document2;
            document2 = adaptor.parse("", "text/html");
            adaptor.append(adaptor.body(document2), child);
          }
          return _super.prototype.create.call(this, document2, options2);
        };
        return HTMLHandler2;
      })(Handler_js_1.AbstractHandler);
      HTMLHandler.HTMLHandler = HTMLHandler$1;
      return HTMLHandler;
    }
    var hasRequiredHtml$1;
    function requireHtml$1() {
      if (hasRequiredHtml$1) return html$1;
      hasRequiredHtml$1 = 1;
      Object.defineProperty(html$1, "__esModule", { value: true });
      html$1.RegisterHTMLHandler = void 0;
      var mathjax_js_1 = requireMathjax();
      var HTMLHandler_js_1 = requireHTMLHandler();
      function RegisterHTMLHandler(adaptor) {
        var handler = new HTMLHandler_js_1.HTMLHandler(adaptor);
        mathjax_js_1.mathjax.handlers.register(handler);
        return handler;
      }
      html$1.RegisterHTMLHandler = RegisterHTMLHandler;
      return html$1;
    }
    var AllPackages = {};
    var ActionConfiguration = {};
    var hasRequiredActionConfiguration;
    function requireActionConfiguration() {
      if (hasRequiredActionConfiguration) return ActionConfiguration;
      hasRequiredActionConfiguration = 1;
      (function(exports2) {
        var __importDefault2 = ActionConfiguration && ActionConfiguration.__importDefault || function(mod2) {
          return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
        };
        Object.defineProperty(exports2, "__esModule", { value: true });
        exports2.ActionConfiguration = exports2.ActionMethods = void 0;
        var Configuration_js_1 = requireConfiguration();
        var TexParser_js_1 = __importDefault2(requireTexParser());
        var SymbolMap_js_1 = requireSymbolMap();
        var BaseMethods_js_1 = __importDefault2(requireBaseMethods());
        exports2.ActionMethods = {};
        exports2.ActionMethods.Macro = BaseMethods_js_1.default.Macro;
        exports2.ActionMethods.Toggle = function(parser2, name2) {
          var children2 = [];
          var arg;
          while ((arg = parser2.GetArgument(name2)) !== "\\endtoggle") {
            children2.push(new TexParser_js_1.default(arg, parser2.stack.env, parser2.configuration).mml());
          }
          parser2.Push(parser2.create("node", "maction", children2, { actiontype: "toggle" }));
        };
        exports2.ActionMethods.Mathtip = function(parser2, name2) {
          var arg = parser2.ParseArg(name2);
          var tip = parser2.ParseArg(name2);
          parser2.Push(parser2.create("node", "maction", [arg, tip], { actiontype: "tooltip" }));
        };
        new SymbolMap_js_1.CommandMap("action-macros", {
          toggle: "Toggle",
          mathtip: "Mathtip",
          texttip: ["Macro", "\\mathtip{#1}{\\text{#2}}", 2]
        }, exports2.ActionMethods);
        exports2.ActionConfiguration = Configuration_js_1.Configuration.create("action", { handler: { macro: ["action-macros"] } });
      })(ActionConfiguration);
      return ActionConfiguration;
    }
    var AmsConfiguration = {};
    var AmsItems = {};
    var hasRequiredAmsItems;
    function requireAmsItems() {
      if (hasRequiredAmsItems) return AmsItems;
      hasRequiredAmsItems = 1;
      var __extends2 = AmsItems && AmsItems.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      var __assign2 = AmsItems && AmsItems.__assign || function() {
        __assign2 = Object.assign || function(t2) {
          for (var s, i2 = 1, n = arguments.length; i2 < n; i2++) {
            s = arguments[i2];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
              t2[p] = s[p];
          }
          return t2;
        };
        return __assign2.apply(this, arguments);
      };
      var __importDefault2 = AmsItems && AmsItems.__importDefault || function(mod2) {
        return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
      };
      Object.defineProperty(AmsItems, "__esModule", { value: true });
      AmsItems.FlalignItem = AmsItems.MultlineItem = void 0;
      var BaseItems_js_1 = requireBaseItems();
      var ParseUtil_js_1 = __importDefault2(requireParseUtil());
      var NodeUtil_js_1 = __importDefault2(requireNodeUtil());
      var TexError_js_1 = __importDefault2(requireTexError());
      var TexConstants_js_1 = requireTexConstants();
      var MultlineItem = (function(_super) {
        __extends2(MultlineItem2, _super);
        function MultlineItem2(factory) {
          var args2 = [];
          for (var _i = 1; _i < arguments.length; _i++) {
            args2[_i - 1] = arguments[_i];
          }
          var _this = _super.call(this, factory) || this;
          _this.factory.configuration.tags.start("multline", true, args2[0]);
          return _this;
        }
        Object.defineProperty(MultlineItem2.prototype, "kind", {
          get: function() {
            return "multline";
          },
          enumerable: false,
          configurable: true
        });
        MultlineItem2.prototype.EndEntry = function() {
          if (this.table.length) {
            ParseUtil_js_1.default.fixInitialMO(this.factory.configuration, this.nodes);
          }
          var shove = this.getProperty("shove");
          var mtd2 = this.create("node", "mtd", this.nodes, shove ? { columnalign: shove } : {});
          this.setProperty("shove", null);
          this.row.push(mtd2);
          this.Clear();
        };
        MultlineItem2.prototype.EndRow = function() {
          if (this.row.length !== 1) {
            throw new TexError_js_1.default("MultlineRowsOneCol", "The rows within the %1 environment must have exactly one column", "multline");
          }
          var row2 = this.create("node", "mtr", this.row);
          this.table.push(row2);
          this.row = [];
        };
        MultlineItem2.prototype.EndTable = function() {
          _super.prototype.EndTable.call(this);
          if (this.table.length) {
            var m = this.table.length - 1, label2 = -1;
            if (!NodeUtil_js_1.default.getAttribute(NodeUtil_js_1.default.getChildren(this.table[0])[0], "columnalign")) {
              NodeUtil_js_1.default.setAttribute(NodeUtil_js_1.default.getChildren(this.table[0])[0], "columnalign", TexConstants_js_1.TexConstant.Align.LEFT);
            }
            if (!NodeUtil_js_1.default.getAttribute(NodeUtil_js_1.default.getChildren(this.table[m])[0], "columnalign")) {
              NodeUtil_js_1.default.setAttribute(NodeUtil_js_1.default.getChildren(this.table[m])[0], "columnalign", TexConstants_js_1.TexConstant.Align.RIGHT);
            }
            var tag = this.factory.configuration.tags.getTag();
            if (tag) {
              label2 = this.arraydef.side === TexConstants_js_1.TexConstant.Align.LEFT ? 0 : this.table.length - 1;
              var mtr2 = this.table[label2];
              var mlabel = this.create("node", "mlabeledtr", [tag].concat(NodeUtil_js_1.default.getChildren(mtr2)));
              NodeUtil_js_1.default.copyAttributes(mtr2, mlabel);
              this.table[label2] = mlabel;
            }
          }
          this.factory.configuration.tags.end();
        };
        return MultlineItem2;
      })(BaseItems_js_1.ArrayItem);
      AmsItems.MultlineItem = MultlineItem;
      var FlalignItem = (function(_super) {
        __extends2(FlalignItem2, _super);
        function FlalignItem2(factory, name2, numbered, padded2, center2) {
          var _this = _super.call(this, factory) || this;
          _this.name = name2;
          _this.numbered = numbered;
          _this.padded = padded2;
          _this.center = center2;
          _this.factory.configuration.tags.start(name2, numbered, numbered);
          return _this;
        }
        Object.defineProperty(FlalignItem2.prototype, "kind", {
          get: function() {
            return "flalign";
          },
          enumerable: false,
          configurable: true
        });
        FlalignItem2.prototype.EndEntry = function() {
          _super.prototype.EndEntry.call(this);
          var n = this.getProperty("xalignat");
          if (!n)
            return;
          if (this.row.length > n) {
            throw new TexError_js_1.default("XalignOverflow", "Extra %1 in row of %2", "&", this.name);
          }
        };
        FlalignItem2.prototype.EndRow = function() {
          var cell2;
          var row2 = this.row;
          var n = this.getProperty("xalignat");
          while (row2.length < n) {
            row2.push(this.create("node", "mtd"));
          }
          this.row = [];
          if (this.padded) {
            this.row.push(this.create("node", "mtd"));
          }
          while (cell2 = row2.shift()) {
            this.row.push(cell2);
            cell2 = row2.shift();
            if (cell2)
              this.row.push(cell2);
            if (row2.length || this.padded) {
              this.row.push(this.create("node", "mtd"));
            }
          }
          if (this.row.length > this.maxrow) {
            this.maxrow = this.row.length;
          }
          _super.prototype.EndRow.call(this);
          var mtr2 = this.table[this.table.length - 1];
          if (this.getProperty("zeroWidthLabel") && mtr2.isKind("mlabeledtr")) {
            var mtd2 = NodeUtil_js_1.default.getChildren(mtr2)[0];
            var side = this.factory.configuration.options["tagSide"];
            var def = __assign2({ width: 0 }, side === "right" ? { lspace: "-1width" } : {});
            var mpadded2 = this.create("node", "mpadded", NodeUtil_js_1.default.getChildren(mtd2), def);
            mtd2.setChildren([mpadded2]);
          }
        };
        FlalignItem2.prototype.EndTable = function() {
          _super.prototype.EndTable.call(this);
          if (this.center) {
            if (this.maxrow <= 2) {
              var def = this.arraydef;
              delete def.width;
              delete this.global.indentalign;
            }
          }
        };
        return FlalignItem2;
      })(BaseItems_js_1.EqnArrayItem);
      AmsItems.FlalignItem = FlalignItem;
      return AmsItems;
    }
    var AmsMethods = {};
    var hasRequiredAmsMethods;
    function requireAmsMethods() {
      if (hasRequiredAmsMethods) return AmsMethods;
      hasRequiredAmsMethods = 1;
      (function(exports2) {
        var __assign2 = AmsMethods && AmsMethods.__assign || function() {
          __assign2 = Object.assign || function(t2) {
            for (var s, i2 = 1, n = arguments.length; i2 < n; i2++) {
              s = arguments[i2];
              for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
                t2[p] = s[p];
            }
            return t2;
          };
          return __assign2.apply(this, arguments);
        };
        var __read2 = AmsMethods && AmsMethods.__read || function(o, n) {
          var m = typeof Symbol === "function" && o[Symbol.iterator];
          if (!m) return o;
          var i2 = m.call(o), r2, ar2 = [], e;
          try {
            while ((n === void 0 || n-- > 0) && !(r2 = i2.next()).done) ar2.push(r2.value);
          } catch (error2) {
            e = { error: error2 };
          } finally {
            try {
              if (r2 && !r2.done && (m = i2["return"])) m.call(i2);
            } finally {
              if (e) throw e.error;
            }
          }
          return ar2;
        };
        var __importDefault2 = AmsMethods && AmsMethods.__importDefault || function(mod2) {
          return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
        };
        Object.defineProperty(exports2, "__esModule", { value: true });
        exports2.NEW_OPS = exports2.AmsMethods = void 0;
        var ParseUtil_js_1 = __importDefault2(requireParseUtil());
        var ParseMethods_js_1 = __importDefault2(requireParseMethods());
        var NodeUtil_js_1 = __importDefault2(requireNodeUtil());
        var TexConstants_js_1 = requireTexConstants();
        var TexParser_js_1 = __importDefault2(requireTexParser());
        var TexError_js_1 = __importDefault2(requireTexError());
        var Symbol_js_1 = require_Symbol();
        var BaseMethods_js_1 = __importDefault2(requireBaseMethods());
        var MmlNode_js_1 = requireMmlNode();
        exports2.AmsMethods = {};
        exports2.AmsMethods.AmsEqnArray = function(parser2, begin, numbered, taggable, align, spacing, style2) {
          var args2 = parser2.GetBrackets("\\begin{" + begin.getName() + "}");
          var array = BaseMethods_js_1.default.EqnArray(parser2, begin, numbered, taggable, align, spacing, style2);
          return ParseUtil_js_1.default.setArrayAlign(array, args2);
        };
        exports2.AmsMethods.AlignAt = function(parser2, begin, numbered, taggable) {
          var name2 = begin.getName();
          var n, valign, align = "", spacing = [];
          if (!taggable) {
            valign = parser2.GetBrackets("\\begin{" + name2 + "}");
          }
          n = parser2.GetArgument("\\begin{" + name2 + "}");
          if (n.match(/[^0-9]/)) {
            throw new TexError_js_1.default("PositiveIntegerArg", "Argument to %1 must me a positive integer", "\\begin{" + name2 + "}");
          }
          var count = parseInt(n, 10);
          while (count > 0) {
            align += "rl";
            spacing.push("0em 0em");
            count--;
          }
          var spaceStr = spacing.join(" ");
          if (taggable) {
            return exports2.AmsMethods.EqnArray(parser2, begin, numbered, taggable, align, spaceStr);
          }
          var array = exports2.AmsMethods.EqnArray(parser2, begin, numbered, taggable, align, spaceStr);
          return ParseUtil_js_1.default.setArrayAlign(array, valign);
        };
        exports2.AmsMethods.Multline = function(parser2, begin, numbered) {
          parser2.Push(begin);
          ParseUtil_js_1.default.checkEqnEnv(parser2);
          var item2 = parser2.itemFactory.create("multline", numbered, parser2.stack);
          item2.arraydef = {
            displaystyle: true,
            rowspacing: ".5em",
            columnspacing: "100%",
            width: parser2.options.ams["multlineWidth"],
            side: parser2.options["tagSide"],
            minlabelspacing: parser2.options["tagIndent"],
            framespacing: parser2.options.ams["multlineIndent"] + " 0",
            frame: "",
            "data-width-includes-label": true
          };
          return item2;
        };
        exports2.AmsMethods.XalignAt = function(parser2, begin, numbered, padded2) {
          var n = parser2.GetArgument("\\begin{" + begin.getName() + "}");
          if (n.match(/[^0-9]/)) {
            throw new TexError_js_1.default("PositiveIntegerArg", "Argument to %1 must me a positive integer", "\\begin{" + begin.getName() + "}");
          }
          var align = padded2 ? "crl" : "rlc";
          var width = padded2 ? "fit auto auto" : "auto auto fit";
          var item2 = exports2.AmsMethods.FlalignArray(parser2, begin, numbered, padded2, false, align, width, true);
          item2.setProperty("xalignat", 2 * parseInt(n));
          return item2;
        };
        exports2.AmsMethods.FlalignArray = function(parser2, begin, numbered, padded2, center2, align, width, zeroWidthLabel) {
          if (zeroWidthLabel === void 0) {
            zeroWidthLabel = false;
          }
          parser2.Push(begin);
          ParseUtil_js_1.default.checkEqnEnv(parser2);
          align = align.split("").join(" ").replace(/r/g, "right").replace(/l/g, "left").replace(/c/g, "center");
          var item2 = parser2.itemFactory.create("flalign", begin.getName(), numbered, padded2, center2, parser2.stack);
          item2.arraydef = {
            width: "100%",
            displaystyle: true,
            columnalign: align,
            columnspacing: "0em",
            columnwidth: width,
            rowspacing: "3pt",
            side: parser2.options["tagSide"],
            minlabelspacing: zeroWidthLabel ? "0" : parser2.options["tagIndent"],
            "data-width-includes-label": true
          };
          item2.setProperty("zeroWidthLabel", zeroWidthLabel);
          return item2;
        };
        exports2.NEW_OPS = "ams-declare-ops";
        exports2.AmsMethods.HandleDeclareOp = function(parser2, name2) {
          var star2 = parser2.GetStar() ? "*" : "";
          var cs = ParseUtil_js_1.default.trimSpaces(parser2.GetArgument(name2));
          if (cs.charAt(0) === "\\") {
            cs = cs.substr(1);
          }
          var op = parser2.GetArgument(name2);
          parser2.configuration.handlers.retrieve(exports2.NEW_OPS).add(cs, new Symbol_js_1.Macro(cs, exports2.AmsMethods.Macro, ["\\operatorname".concat(star2, "{").concat(op, "}")]));
        };
        exports2.AmsMethods.HandleOperatorName = function(parser2, name2) {
          var star2 = parser2.GetStar();
          var op = ParseUtil_js_1.default.trimSpaces(parser2.GetArgument(name2));
          var mml = new TexParser_js_1.default(op, __assign2(__assign2({}, parser2.stack.env), { font: TexConstants_js_1.TexConstant.Variant.NORMAL, multiLetterIdentifiers: /^[-*a-z]+/i, operatorLetters: true }), parser2.configuration).mml();
          if (!mml.isKind("mi")) {
            mml = parser2.create("node", "TeXAtom", [mml]);
          }
          NodeUtil_js_1.default.setProperties(mml, { movesupsub: star2, movablelimits: true, texClass: MmlNode_js_1.TEXCLASS.OP });
          if (!star2) {
            var c2 = parser2.GetNext(), i2 = parser2.i;
            if (c2 === "\\" && ++parser2.i && parser2.GetCS() !== "limits") {
              parser2.i = i2;
            }
          }
          parser2.Push(mml);
        };
        exports2.AmsMethods.SideSet = function(parser2, name2) {
          var _a2 = __read2(splitSideSet(parser2.ParseArg(name2)), 2), preScripts = _a2[0], preRest = _a2[1];
          var _b2 = __read2(splitSideSet(parser2.ParseArg(name2)), 2), postScripts = _b2[0], postRest = _b2[1];
          var base2 = parser2.ParseArg(name2);
          var mml = base2;
          if (preScripts) {
            if (preRest) {
              preScripts.replaceChild(parser2.create("node", "mphantom", [
                parser2.create("node", "mpadded", [ParseUtil_js_1.default.copyNode(base2, parser2)], { width: 0 })
              ]), NodeUtil_js_1.default.getChildAt(preScripts, 0));
            } else {
              mml = parser2.create("node", "mmultiscripts", [base2]);
              if (postScripts) {
                NodeUtil_js_1.default.appendChildren(mml, [
                  NodeUtil_js_1.default.getChildAt(postScripts, 1) || parser2.create("node", "none"),
                  NodeUtil_js_1.default.getChildAt(postScripts, 2) || parser2.create("node", "none")
                ]);
              }
              NodeUtil_js_1.default.setProperty(mml, "scriptalign", "left");
              NodeUtil_js_1.default.appendChildren(mml, [
                parser2.create("node", "mprescripts"),
                NodeUtil_js_1.default.getChildAt(preScripts, 1) || parser2.create("node", "none"),
                NodeUtil_js_1.default.getChildAt(preScripts, 2) || parser2.create("node", "none")
              ]);
            }
          }
          if (postScripts && mml === base2) {
            postScripts.replaceChild(base2, NodeUtil_js_1.default.getChildAt(postScripts, 0));
            mml = postScripts;
          }
          var mrow2 = parser2.create("node", "TeXAtom", [], { texClass: MmlNode_js_1.TEXCLASS.OP, movesupsub: true, movablelimits: true });
          if (preRest) {
            preScripts && mrow2.appendChild(preScripts);
            mrow2.appendChild(preRest);
          }
          mrow2.appendChild(mml);
          postRest && mrow2.appendChild(postRest);
          parser2.Push(mrow2);
        };
        function splitSideSet(mml) {
          if (!mml || mml.isInferred && mml.childNodes.length === 0)
            return [null, null];
          if (mml.isKind("msubsup") && checkSideSetBase(mml))
            return [mml, null];
          var child = NodeUtil_js_1.default.getChildAt(mml, 0);
          if (!(mml.isInferred && child && checkSideSetBase(child)))
            return [null, mml];
          mml.childNodes.splice(0, 1);
          return [child, mml];
        }
        function checkSideSetBase(mml) {
          var base2 = mml.childNodes[0];
          return base2 && base2.isKind("mi") && base2.getText() === "";
        }
        exports2.AmsMethods.operatorLetter = function(parser2, c2) {
          return parser2.stack.env.operatorLetters ? ParseMethods_js_1.default.variable(parser2, c2) : false;
        };
        exports2.AmsMethods.MultiIntegral = function(parser2, name2, integral) {
          var next = parser2.GetNext();
          if (next === "\\") {
            var i2 = parser2.i;
            next = parser2.GetArgument(name2);
            parser2.i = i2;
            if (next === "\\limits") {
              if (name2 === "\\idotsint") {
                integral = "\\!\\!\\mathop{\\,\\," + integral + "}";
              } else {
                integral = "\\!\\!\\!\\mathop{\\,\\,\\," + integral + "}";
              }
            }
          }
          parser2.string = integral + " " + parser2.string.slice(parser2.i);
          parser2.i = 0;
        };
        exports2.AmsMethods.xArrow = function(parser2, name2, chr, l, r2) {
          var def = { width: "+" + ParseUtil_js_1.default.Em((l + r2) / 18), lspace: ParseUtil_js_1.default.Em(l / 18) };
          var bot2 = parser2.GetBrackets(name2);
          var first = parser2.ParseArg(name2);
          var dstrut = parser2.create("node", "mspace", [], { depth: ".25em" });
          var arrow2 = parser2.create("token", "mo", { stretchy: true, texClass: MmlNode_js_1.TEXCLASS.REL }, String.fromCodePoint(chr));
          arrow2 = parser2.create("node", "mstyle", [arrow2], { scriptlevel: 0 });
          var mml = parser2.create("node", "munderover", [arrow2]);
          var mpadded2 = parser2.create("node", "mpadded", [first, dstrut], def);
          NodeUtil_js_1.default.setAttribute(mpadded2, "voffset", "-.2em");
          NodeUtil_js_1.default.setAttribute(mpadded2, "height", "-.2em");
          NodeUtil_js_1.default.setChild(mml, mml.over, mpadded2);
          if (bot2) {
            var bottom2 = new TexParser_js_1.default(bot2, parser2.stack.env, parser2.configuration).mml();
            var bstrut = parser2.create("node", "mspace", [], { height: ".75em" });
            mpadded2 = parser2.create("node", "mpadded", [bottom2, bstrut], def);
            NodeUtil_js_1.default.setAttribute(mpadded2, "voffset", ".15em");
            NodeUtil_js_1.default.setAttribute(mpadded2, "depth", "-.15em");
            NodeUtil_js_1.default.setChild(mml, mml.under, mpadded2);
          }
          NodeUtil_js_1.default.setProperty(mml, "subsupOK", true);
          parser2.Push(mml);
        };
        exports2.AmsMethods.HandleShove = function(parser2, _name, shove) {
          var top2 = parser2.stack.Top();
          if (top2.kind !== "multline") {
            throw new TexError_js_1.default("CommandOnlyAllowedInEnv", "%1 only allowed in %2 environment", parser2.currentCS, "multline");
          }
          if (top2.Size()) {
            throw new TexError_js_1.default("CommandAtTheBeginingOfLine", "%1 must come at the beginning of the line", parser2.currentCS);
          }
          top2.setProperty("shove", shove);
        };
        exports2.AmsMethods.CFrac = function(parser2, name2) {
          var lr2 = ParseUtil_js_1.default.trimSpaces(parser2.GetBrackets(name2, ""));
          var num2 = parser2.GetArgument(name2);
          var den = parser2.GetArgument(name2);
          var lrMap = {
            l: TexConstants_js_1.TexConstant.Align.LEFT,
            r: TexConstants_js_1.TexConstant.Align.RIGHT,
            "": ""
          };
          var numNode = new TexParser_js_1.default("\\strut\\textstyle{" + num2 + "}", parser2.stack.env, parser2.configuration).mml();
          var denNode = new TexParser_js_1.default("\\strut\\textstyle{" + den + "}", parser2.stack.env, parser2.configuration).mml();
          var frac = parser2.create("node", "mfrac", [numNode, denNode]);
          lr2 = lrMap[lr2];
          if (lr2 == null) {
            throw new TexError_js_1.default("IllegalAlign", "Illegal alignment specified in %1", parser2.currentCS);
          }
          if (lr2) {
            NodeUtil_js_1.default.setProperties(frac, { numalign: lr2, denomalign: lr2 });
          }
          parser2.Push(frac);
        };
        exports2.AmsMethods.Genfrac = function(parser2, name2, left2, right2, thick, style2) {
          if (left2 == null) {
            left2 = parser2.GetDelimiterArg(name2);
          }
          if (right2 == null) {
            right2 = parser2.GetDelimiterArg(name2);
          }
          if (thick == null) {
            thick = parser2.GetArgument(name2);
          }
          if (style2 == null) {
            style2 = ParseUtil_js_1.default.trimSpaces(parser2.GetArgument(name2));
          }
          var num2 = parser2.ParseArg(name2);
          var den = parser2.ParseArg(name2);
          var frac = parser2.create("node", "mfrac", [num2, den]);
          if (thick !== "") {
            NodeUtil_js_1.default.setAttribute(frac, "linethickness", thick);
          }
          if (left2 || right2) {
            NodeUtil_js_1.default.setProperty(frac, "withDelims", true);
            frac = ParseUtil_js_1.default.fixedFence(parser2.configuration, left2, frac, right2);
          }
          if (style2 !== "") {
            var styleDigit = parseInt(style2, 10);
            var styleAlpha = ["D", "T", "S", "SS"][styleDigit];
            if (styleAlpha == null) {
              throw new TexError_js_1.default("BadMathStyleFor", "Bad math style for %1", parser2.currentCS);
            }
            frac = parser2.create("node", "mstyle", [frac]);
            if (styleAlpha === "D") {
              NodeUtil_js_1.default.setProperties(frac, { displaystyle: true, scriptlevel: 0 });
            } else {
              NodeUtil_js_1.default.setProperties(frac, {
                displaystyle: false,
                scriptlevel: styleDigit - 1
              });
            }
          }
          parser2.Push(frac);
        };
        exports2.AmsMethods.HandleTag = function(parser2, name2) {
          if (!parser2.tags.currentTag.taggable && parser2.tags.env) {
            throw new TexError_js_1.default("CommandNotAllowedInEnv", "%1 not allowed in %2 environment", parser2.currentCS, parser2.tags.env);
          }
          if (parser2.tags.currentTag.tag) {
            throw new TexError_js_1.default("MultipleCommand", "Multiple %1", parser2.currentCS);
          }
          var star2 = parser2.GetStar();
          var tagId = ParseUtil_js_1.default.trimSpaces(parser2.GetArgument(name2));
          parser2.tags.tag(tagId, star2);
        };
        exports2.AmsMethods.HandleNoTag = BaseMethods_js_1.default.HandleNoTag;
        exports2.AmsMethods.HandleRef = BaseMethods_js_1.default.HandleRef;
        exports2.AmsMethods.Macro = BaseMethods_js_1.default.Macro;
        exports2.AmsMethods.Accent = BaseMethods_js_1.default.Accent;
        exports2.AmsMethods.Tilde = BaseMethods_js_1.default.Tilde;
        exports2.AmsMethods.Array = BaseMethods_js_1.default.Array;
        exports2.AmsMethods.Spacer = BaseMethods_js_1.default.Spacer;
        exports2.AmsMethods.NamedOp = BaseMethods_js_1.default.NamedOp;
        exports2.AmsMethods.EqnArray = BaseMethods_js_1.default.EqnArray;
        exports2.AmsMethods.Equation = BaseMethods_js_1.default.Equation;
      })(AmsMethods);
      return AmsMethods;
    }
    var AmsMappings = {};
    var hasRequiredAmsMappings;
    function requireAmsMappings() {
      if (hasRequiredAmsMappings) return AmsMappings;
      hasRequiredAmsMappings = 1;
      var __createBinding2 = AmsMappings && AmsMappings.__createBinding || (Object.create ? (function(o, m, k2, k22) {
        if (k22 === void 0) k22 = k2;
        var desc = Object.getOwnPropertyDescriptor(m, k2);
        if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
          desc = { enumerable: true, get: function() {
            return m[k2];
          } };
        }
        Object.defineProperty(o, k22, desc);
      }) : (function(o, m, k2, k22) {
        if (k22 === void 0) k22 = k2;
        o[k22] = m[k2];
      }));
      var __setModuleDefault2 = AmsMappings && AmsMappings.__setModuleDefault || (Object.create ? (function(o, v) {
        Object.defineProperty(o, "default", { enumerable: true, value: v });
      }) : function(o, v) {
        o["default"] = v;
      });
      var __importStar2 = AmsMappings && AmsMappings.__importStar || function(mod2) {
        if (mod2 && mod2.__esModule) return mod2;
        var result2 = {};
        if (mod2 != null) {
          for (var k2 in mod2) if (k2 !== "default" && Object.prototype.hasOwnProperty.call(mod2, k2)) __createBinding2(result2, mod2, k2);
        }
        __setModuleDefault2(result2, mod2);
        return result2;
      };
      var __importDefault2 = AmsMappings && AmsMappings.__importDefault || function(mod2) {
        return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
      };
      Object.defineProperty(AmsMappings, "__esModule", { value: true });
      var AmsMethods_js_1 = requireAmsMethods();
      var sm = __importStar2(requireSymbolMap());
      var TexConstants_js_1 = requireTexConstants();
      var ParseMethods_js_1 = __importDefault2(requireParseMethods());
      var ParseUtil_js_1 = __importDefault2(requireParseUtil());
      var MmlNode_js_1 = requireMmlNode();
      var lengths_js_1 = requireLengths();
      new sm.CharacterMap("AMSmath-mathchar0mo", ParseMethods_js_1.default.mathchar0mo, {
        iiiint: ["⨌", { texClass: MmlNode_js_1.TEXCLASS.OP }]
      });
      new sm.RegExpMap("AMSmath-operatorLetter", AmsMethods_js_1.AmsMethods.operatorLetter, /[-*]/i);
      new sm.CommandMap("AMSmath-macros", {
        mathring: ["Accent", "02DA"],
        nobreakspace: "Tilde",
        negmedspace: ["Spacer", lengths_js_1.MATHSPACE.negativemediummathspace],
        negthickspace: ["Spacer", lengths_js_1.MATHSPACE.negativethickmathspace],
        idotsint: ["MultiIntegral", "\\int\\cdots\\int"],
        dddot: ["Accent", "20DB"],
        ddddot: ["Accent", "20DC"],
        sideset: "SideSet",
        boxed: ["Macro", "\\fbox{$\\displaystyle{#1}$}", 1],
        tag: "HandleTag",
        notag: "HandleNoTag",
        eqref: ["HandleRef", true],
        substack: ["Macro", "\\begin{subarray}{c}#1\\end{subarray}", 1],
        injlim: ["NamedOp", "inj&thinsp;lim"],
        projlim: ["NamedOp", "proj&thinsp;lim"],
        varliminf: ["Macro", "\\mathop{\\underline{\\mmlToken{mi}{lim}}}"],
        varlimsup: ["Macro", "\\mathop{\\overline{\\mmlToken{mi}{lim}}}"],
        varinjlim: ["Macro", "\\mathop{\\underrightarrow{\\mmlToken{mi}{lim}}}"],
        varprojlim: ["Macro", "\\mathop{\\underleftarrow{\\mmlToken{mi}{lim}}}"],
        DeclareMathOperator: "HandleDeclareOp",
        operatorname: "HandleOperatorName",
        genfrac: "Genfrac",
        frac: ["Genfrac", "", "", "", ""],
        tfrac: ["Genfrac", "", "", "", "1"],
        dfrac: ["Genfrac", "", "", "", "0"],
        binom: ["Genfrac", "(", ")", "0", ""],
        tbinom: ["Genfrac", "(", ")", "0", "1"],
        dbinom: ["Genfrac", "(", ")", "0", "0"],
        cfrac: "CFrac",
        shoveleft: ["HandleShove", TexConstants_js_1.TexConstant.Align.LEFT],
        shoveright: ["HandleShove", TexConstants_js_1.TexConstant.Align.RIGHT],
        xrightarrow: ["xArrow", 8594, 5, 10],
        xleftarrow: ["xArrow", 8592, 10, 5]
      }, AmsMethods_js_1.AmsMethods);
      new sm.EnvironmentMap("AMSmath-environment", ParseMethods_js_1.default.environment, {
        "equation*": ["Equation", null, false],
        "eqnarray*": [
          "EqnArray",
          null,
          false,
          true,
          "rcl",
          ParseUtil_js_1.default.cols(0, lengths_js_1.MATHSPACE.thickmathspace),
          ".5em"
        ],
        align: ["EqnArray", null, true, true, "rl", ParseUtil_js_1.default.cols(0, 2)],
        "align*": ["EqnArray", null, false, true, "rl", ParseUtil_js_1.default.cols(0, 2)],
        multline: ["Multline", null, true],
        "multline*": ["Multline", null, false],
        split: ["EqnArray", null, false, false, "rl", ParseUtil_js_1.default.cols(0)],
        gather: ["EqnArray", null, true, true, "c"],
        "gather*": ["EqnArray", null, false, true, "c"],
        alignat: ["AlignAt", null, true, true],
        "alignat*": ["AlignAt", null, false, true],
        alignedat: ["AlignAt", null, false, false],
        aligned: ["AmsEqnArray", null, null, null, "rl", ParseUtil_js_1.default.cols(0, 2), ".5em", "D"],
        gathered: ["AmsEqnArray", null, null, null, "c", null, ".5em", "D"],
        xalignat: ["XalignAt", null, true, true],
        "xalignat*": ["XalignAt", null, false, true],
        xxalignat: ["XalignAt", null, false, false],
        flalign: ["FlalignArray", null, true, false, true, "rlc", "auto auto fit"],
        "flalign*": ["FlalignArray", null, false, false, true, "rlc", "auto auto fit"],
        subarray: ["Array", null, null, null, null, ParseUtil_js_1.default.cols(0), "0.1em", "S", 1],
        smallmatrix: [
          "Array",
          null,
          null,
          null,
          "c",
          ParseUtil_js_1.default.cols(1 / 3),
          ".2em",
          "S",
          1
        ],
        matrix: ["Array", null, null, null, "c"],
        pmatrix: ["Array", null, "(", ")", "c"],
        bmatrix: ["Array", null, "[", "]", "c"],
        Bmatrix: ["Array", null, "\\{", "\\}", "c"],
        vmatrix: ["Array", null, "\\vert", "\\vert", "c"],
        Vmatrix: ["Array", null, "\\Vert", "\\Vert", "c"],
        cases: ["Array", null, "\\{", ".", "ll", null, ".2em", "T"]
      }, AmsMethods_js_1.AmsMethods);
      new sm.DelimiterMap("AMSmath-delimiter", ParseMethods_js_1.default.delimiter, {
        "\\lvert": ["|", { texClass: MmlNode_js_1.TEXCLASS.OPEN }],
        "\\rvert": ["|", { texClass: MmlNode_js_1.TEXCLASS.CLOSE }],
        "\\lVert": ["‖", { texClass: MmlNode_js_1.TEXCLASS.OPEN }],
        "\\rVert": ["‖", { texClass: MmlNode_js_1.TEXCLASS.CLOSE }]
      });
      new sm.CharacterMap("AMSsymbols-mathchar0mi", ParseMethods_js_1.default.mathchar0mi, {
        digamma: "ϝ",
        varkappa: "ϰ",
        varGamma: ["Γ", { mathvariant: TexConstants_js_1.TexConstant.Variant.ITALIC }],
        varDelta: ["Δ", { mathvariant: TexConstants_js_1.TexConstant.Variant.ITALIC }],
        varTheta: ["Θ", { mathvariant: TexConstants_js_1.TexConstant.Variant.ITALIC }],
        varLambda: ["Λ", { mathvariant: TexConstants_js_1.TexConstant.Variant.ITALIC }],
        varXi: ["Ξ", { mathvariant: TexConstants_js_1.TexConstant.Variant.ITALIC }],
        varPi: ["Π", { mathvariant: TexConstants_js_1.TexConstant.Variant.ITALIC }],
        varSigma: ["Σ", { mathvariant: TexConstants_js_1.TexConstant.Variant.ITALIC }],
        varUpsilon: ["Υ", { mathvariant: TexConstants_js_1.TexConstant.Variant.ITALIC }],
        varPhi: ["Φ", { mathvariant: TexConstants_js_1.TexConstant.Variant.ITALIC }],
        varPsi: ["Ψ", { mathvariant: TexConstants_js_1.TexConstant.Variant.ITALIC }],
        varOmega: ["Ω", { mathvariant: TexConstants_js_1.TexConstant.Variant.ITALIC }],
        beth: "ℶ",
        gimel: "ℷ",
        daleth: "ℸ",
        backprime: ["‵", { variantForm: true }],
        hslash: "ℏ",
        varnothing: ["∅", { variantForm: true }],
        blacktriangle: "▴",
        triangledown: ["▽", { variantForm: true }],
        blacktriangledown: "▾",
        square: "◻",
        Box: "◻",
        blacksquare: "◼",
        lozenge: "◊",
        Diamond: "◊",
        blacklozenge: "⧫",
        circledS: ["Ⓢ", { mathvariant: TexConstants_js_1.TexConstant.Variant.NORMAL }],
        bigstar: "★",
        sphericalangle: "∢",
        measuredangle: "∡",
        nexists: "∄",
        complement: "∁",
        mho: "℧",
        eth: ["ð", { mathvariant: TexConstants_js_1.TexConstant.Variant.NORMAL }],
        Finv: "Ⅎ",
        diagup: "╱",
        Game: "⅁",
        diagdown: "╲",
        Bbbk: [
          "k",
          { mathvariant: TexConstants_js_1.TexConstant.Variant.DOUBLESTRUCK }
        ],
        yen: "¥",
        circledR: "®",
        checkmark: "✓",
        maltese: "✠"
      });
      new sm.CharacterMap("AMSsymbols-mathchar0mo", ParseMethods_js_1.default.mathchar0mo, {
        dotplus: "∔",
        ltimes: "⋉",
        smallsetminus: ["∖", { variantForm: true }],
        rtimes: "⋊",
        Cap: "⋒",
        doublecap: "⋒",
        leftthreetimes: "⋋",
        Cup: "⋓",
        doublecup: "⋓",
        rightthreetimes: "⋌",
        barwedge: "⊼",
        curlywedge: "⋏",
        veebar: "⊻",
        curlyvee: "⋎",
        doublebarwedge: "⩞",
        boxminus: "⊟",
        circleddash: "⊝",
        boxtimes: "⊠",
        circledast: "⊛",
        boxdot: "⊡",
        circledcirc: "⊚",
        boxplus: "⊞",
        centerdot: ["⋅", { variantForm: true }],
        divideontimes: "⋇",
        intercal: "⊺",
        leqq: "≦",
        geqq: "≧",
        leqslant: "⩽",
        geqslant: "⩾",
        eqslantless: "⪕",
        eqslantgtr: "⪖",
        lesssim: "≲",
        gtrsim: "≳",
        lessapprox: "⪅",
        gtrapprox: "⪆",
        approxeq: "≊",
        lessdot: "⋖",
        gtrdot: "⋗",
        lll: "⋘",
        llless: "⋘",
        ggg: "⋙",
        gggtr: "⋙",
        lessgtr: "≶",
        gtrless: "≷",
        lesseqgtr: "⋚",
        gtreqless: "⋛",
        lesseqqgtr: "⪋",
        gtreqqless: "⪌",
        doteqdot: "≑",
        Doteq: "≑",
        eqcirc: "≖",
        risingdotseq: "≓",
        circeq: "≗",
        fallingdotseq: "≒",
        triangleq: "≜",
        backsim: "∽",
        thicksim: ["∼", { variantForm: true }],
        backsimeq: "⋍",
        thickapprox: ["≈", { variantForm: true }],
        subseteqq: "⫅",
        supseteqq: "⫆",
        Subset: "⋐",
        Supset: "⋑",
        sqsubset: "⊏",
        sqsupset: "⊐",
        preccurlyeq: "≼",
        succcurlyeq: "≽",
        curlyeqprec: "⋞",
        curlyeqsucc: "⋟",
        precsim: "≾",
        succsim: "≿",
        precapprox: "⪷",
        succapprox: "⪸",
        vartriangleleft: "⊲",
        lhd: "⊲",
        vartriangleright: "⊳",
        rhd: "⊳",
        trianglelefteq: "⊴",
        unlhd: "⊴",
        trianglerighteq: "⊵",
        unrhd: "⊵",
        vDash: ["⊨", { variantForm: true }],
        Vdash: "⊩",
        Vvdash: "⊪",
        smallsmile: ["⌣", { variantForm: true }],
        shortmid: ["∣", { variantForm: true }],
        smallfrown: ["⌢", { variantForm: true }],
        shortparallel: ["∥", { variantForm: true }],
        bumpeq: "≏",
        between: "≬",
        Bumpeq: "≎",
        pitchfork: "⋔",
        varpropto: ["∝", { variantForm: true }],
        backepsilon: "∍",
        blacktriangleleft: "◂",
        blacktriangleright: "▸",
        therefore: "∴",
        because: "∵",
        eqsim: "≂",
        vartriangle: ["△", { variantForm: true }],
        Join: "⋈",
        nless: "≮",
        ngtr: "≯",
        nleq: "≰",
        ngeq: "≱",
        nleqslant: ["⪇", { variantForm: true }],
        ngeqslant: ["⪈", { variantForm: true }],
        nleqq: ["≰", { variantForm: true }],
        ngeqq: ["≱", { variantForm: true }],
        lneq: "⪇",
        gneq: "⪈",
        lneqq: "≨",
        gneqq: "≩",
        lvertneqq: ["≨", { variantForm: true }],
        gvertneqq: ["≩", { variantForm: true }],
        lnsim: "⋦",
        gnsim: "⋧",
        lnapprox: "⪉",
        gnapprox: "⪊",
        nprec: "⊀",
        nsucc: "⊁",
        npreceq: ["⋠", { variantForm: true }],
        nsucceq: ["⋡", { variantForm: true }],
        precneqq: "⪵",
        succneqq: "⪶",
        precnsim: "⋨",
        succnsim: "⋩",
        precnapprox: "⪹",
        succnapprox: "⪺",
        nsim: "≁",
        ncong: "≇",
        nshortmid: ["∤", { variantForm: true }],
        nshortparallel: ["∦", { variantForm: true }],
        nmid: "∤",
        nparallel: "∦",
        nvdash: "⊬",
        nvDash: "⊭",
        nVdash: "⊮",
        nVDash: "⊯",
        ntriangleleft: "⋪",
        ntriangleright: "⋫",
        ntrianglelefteq: "⋬",
        ntrianglerighteq: "⋭",
        nsubseteq: "⊈",
        nsupseteq: "⊉",
        nsubseteqq: ["⊈", { variantForm: true }],
        nsupseteqq: ["⊉", { variantForm: true }],
        subsetneq: "⊊",
        supsetneq: "⊋",
        varsubsetneq: ["⊊", { variantForm: true }],
        varsupsetneq: ["⊋", { variantForm: true }],
        subsetneqq: "⫋",
        supsetneqq: "⫌",
        varsubsetneqq: ["⫋", { variantForm: true }],
        varsupsetneqq: ["⫌", { variantForm: true }],
        leftleftarrows: "⇇",
        rightrightarrows: "⇉",
        leftrightarrows: "⇆",
        rightleftarrows: "⇄",
        Lleftarrow: "⇚",
        Rrightarrow: "⇛",
        twoheadleftarrow: "↞",
        twoheadrightarrow: "↠",
        leftarrowtail: "↢",
        rightarrowtail: "↣",
        looparrowleft: "↫",
        looparrowright: "↬",
        leftrightharpoons: "⇋",
        rightleftharpoons: ["⇌", { variantForm: true }],
        curvearrowleft: "↶",
        curvearrowright: "↷",
        circlearrowleft: "↺",
        circlearrowright: "↻",
        Lsh: "↰",
        Rsh: "↱",
        upuparrows: "⇈",
        downdownarrows: "⇊",
        upharpoonleft: "↿",
        upharpoonright: "↾",
        downharpoonleft: "⇃",
        restriction: "↾",
        multimap: "⊸",
        downharpoonright: "⇂",
        leftrightsquigarrow: "↭",
        rightsquigarrow: "⇝",
        leadsto: "⇝",
        dashrightarrow: "⇢",
        dashleftarrow: "⇠",
        nleftarrow: "↚",
        nrightarrow: "↛",
        nLeftarrow: "⇍",
        nRightarrow: "⇏",
        nleftrightarrow: "↮",
        nLeftrightarrow: "⇎"
      });
      new sm.DelimiterMap("AMSsymbols-delimiter", ParseMethods_js_1.default.delimiter, {
        "\\ulcorner": "⌜",
        "\\urcorner": "⌝",
        "\\llcorner": "⌞",
        "\\lrcorner": "⌟"
      });
      new sm.CommandMap("AMSsymbols-macros", {
        implies: ["Macro", "\\;\\Longrightarrow\\;"],
        impliedby: ["Macro", "\\;\\Longleftarrow\\;"]
      }, AmsMethods_js_1.AmsMethods);
      return AmsMappings;
    }
    var hasRequiredAmsConfiguration;
    function requireAmsConfiguration() {
      if (hasRequiredAmsConfiguration) return AmsConfiguration;
      hasRequiredAmsConfiguration = 1;
      var __extends2 = AmsConfiguration && AmsConfiguration.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      var _a2;
      Object.defineProperty(AmsConfiguration, "__esModule", { value: true });
      AmsConfiguration.AmsConfiguration = AmsConfiguration.AmsTags = void 0;
      var Configuration_js_1 = requireConfiguration();
      var AmsItems_js_1 = requireAmsItems();
      var Tags_js_1 = requireTags();
      var AmsMethods_js_1 = requireAmsMethods();
      requireAmsMappings();
      var SymbolMap_js_1 = requireSymbolMap();
      var AmsTags = (function(_super) {
        __extends2(AmsTags2, _super);
        function AmsTags2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        return AmsTags2;
      })(Tags_js_1.AbstractTags);
      AmsConfiguration.AmsTags = AmsTags;
      var init2 = function(config2) {
        new SymbolMap_js_1.CommandMap(AmsMethods_js_1.NEW_OPS, {}, {});
        config2.append(Configuration_js_1.Configuration.local({
          handler: { macro: [AmsMethods_js_1.NEW_OPS] },
          priority: -1
        }));
      };
      AmsConfiguration.AmsConfiguration = Configuration_js_1.Configuration.create("ams", {
        handler: {
          character: ["AMSmath-operatorLetter"],
          delimiter: ["AMSsymbols-delimiter", "AMSmath-delimiter"],
          macro: [
            "AMSsymbols-mathchar0mi",
            "AMSsymbols-mathchar0mo",
            "AMSsymbols-delimiter",
            "AMSsymbols-macros",
            "AMSmath-mathchar0mo",
            "AMSmath-macros",
            "AMSmath-delimiter"
          ],
          environment: ["AMSmath-environment"]
        },
        items: (_a2 = {}, _a2[AmsItems_js_1.MultlineItem.prototype.kind] = AmsItems_js_1.MultlineItem, _a2[AmsItems_js_1.FlalignItem.prototype.kind] = AmsItems_js_1.FlalignItem, _a2),
        tags: { "ams": AmsTags },
        init: init2,
        config: function(_config, jax) {
          if (jax.parseOptions.options.multlineWidth) {
            jax.parseOptions.options.ams.multlineWidth = jax.parseOptions.options.multlineWidth;
          }
          delete jax.parseOptions.options.multlineWidth;
        },
        options: {
          multlineWidth: "",
          ams: {
            multlineWidth: "100%",
            multlineIndent: "1em"
          }
        }
      });
      return AmsConfiguration;
    }
    var AmsCdConfiguration = {};
    var AmsCdMappings = {};
    var AmsCdMethods = {};
    var hasRequiredAmsCdMethods;
    function requireAmsCdMethods() {
      if (hasRequiredAmsCdMethods) return AmsCdMethods;
      hasRequiredAmsCdMethods = 1;
      var __importDefault2 = AmsCdMethods && AmsCdMethods.__importDefault || function(mod2) {
        return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
      };
      Object.defineProperty(AmsCdMethods, "__esModule", { value: true });
      var TexParser_js_1 = __importDefault2(requireTexParser());
      var BaseConfiguration_js_1 = requireBaseConfiguration();
      var MmlNode_js_1 = requireMmlNode();
      var NodeUtil_js_1 = __importDefault2(requireNodeUtil());
      var AmsCdMethods$1 = {};
      AmsCdMethods$1.CD = function(parser2, begin) {
        parser2.Push(begin);
        var item2 = parser2.itemFactory.create("array");
        var options2 = parser2.configuration.options.amscd;
        item2.setProperties({
          minw: parser2.stack.env.CD_minw || options2.harrowsize,
          minh: parser2.stack.env.CD_minh || options2.varrowsize
        });
        item2.arraydef = {
          columnalign: "center",
          columnspacing: options2.colspace,
          rowspacing: options2.rowspace,
          displaystyle: true
        };
        return item2;
      };
      AmsCdMethods$1.arrow = function(parser2, name2) {
        var c2 = parser2.string.charAt(parser2.i);
        if (!c2.match(/[><VA.|=]/)) {
          return (0, BaseConfiguration_js_1.Other)(parser2, name2);
        } else {
          parser2.i++;
        }
        var first = parser2.stack.Top();
        if (!first.isKind("array") || first.Size()) {
          AmsCdMethods$1.cell(parser2, name2);
          first = parser2.stack.Top();
        }
        var top2 = first;
        var arrowRow = top2.table.length % 2 === 1;
        var n = (top2.row.length + (arrowRow ? 0 : 1)) % 2;
        while (n) {
          AmsCdMethods$1.cell(parser2, name2);
          n--;
        }
        var mml;
        var hdef = { minsize: top2.getProperty("minw"), stretchy: true }, vdef = {
          minsize: top2.getProperty("minh"),
          stretchy: true,
          symmetric: true,
          lspace: 0,
          rspace: 0
        };
        if (c2 === ".") ;
        else if (c2 === "|") {
          mml = parser2.create("token", "mo", vdef, "∥");
        } else if (c2 === "=") {
          mml = parser2.create("token", "mo", hdef, "=");
        } else {
          var arrow2 = {
            ">": "→",
            "<": "←",
            "V": "↓",
            "A": "↑"
          }[c2];
          var a = parser2.GetUpTo(name2 + c2, c2);
          var b = parser2.GetUpTo(name2 + c2, c2);
          if (c2 === ">" || c2 === "<") {
            mml = parser2.create("token", "mo", hdef, arrow2);
            if (!a) {
              a = "\\kern " + top2.getProperty("minw");
            }
            if (a || b) {
              var pad = { width: "+.67em", lspace: ".33em" };
              mml = parser2.create("node", "munderover", [mml]);
              if (a) {
                var nodeA = new TexParser_js_1.default(a, parser2.stack.env, parser2.configuration).mml();
                var mpadded2 = parser2.create("node", "mpadded", [nodeA], pad);
                NodeUtil_js_1.default.setAttribute(mpadded2, "voffset", ".1em");
                NodeUtil_js_1.default.setChild(mml, mml.over, mpadded2);
              }
              if (b) {
                var nodeB = new TexParser_js_1.default(b, parser2.stack.env, parser2.configuration).mml();
                NodeUtil_js_1.default.setChild(mml, mml.under, parser2.create("node", "mpadded", [nodeB], pad));
              }
              if (parser2.configuration.options.amscd.hideHorizontalLabels) {
                mml = parser2.create("node", "mpadded", mml, { depth: 0, height: ".67em" });
              }
            }
          } else {
            var arrowNode = parser2.create("token", "mo", vdef, arrow2);
            mml = arrowNode;
            if (a || b) {
              mml = parser2.create("node", "mrow");
              if (a) {
                NodeUtil_js_1.default.appendChildren(mml, [new TexParser_js_1.default("\\scriptstyle\\llap{" + a + "}", parser2.stack.env, parser2.configuration).mml()]);
              }
              arrowNode.texClass = MmlNode_js_1.TEXCLASS.ORD;
              NodeUtil_js_1.default.appendChildren(mml, [arrowNode]);
              if (b) {
                NodeUtil_js_1.default.appendChildren(mml, [new TexParser_js_1.default("\\scriptstyle\\rlap{" + b + "}", parser2.stack.env, parser2.configuration).mml()]);
              }
            }
          }
        }
        if (mml) {
          parser2.Push(mml);
        }
        AmsCdMethods$1.cell(parser2, name2);
      };
      AmsCdMethods$1.cell = function(parser2, name2) {
        var top2 = parser2.stack.Top();
        if ((top2.table || []).length % 2 === 0 && (top2.row || []).length === 0) {
          parser2.Push(parser2.create("node", "mpadded", [], { height: "8.5pt", depth: "2pt" }));
        }
        parser2.Push(parser2.itemFactory.create("cell").setProperties({ isEntry: true, name: name2 }));
      };
      AmsCdMethods$1.minCDarrowwidth = function(parser2, name2) {
        parser2.stack.env.CD_minw = parser2.GetDimen(name2);
      };
      AmsCdMethods$1.minCDarrowheight = function(parser2, name2) {
        parser2.stack.env.CD_minh = parser2.GetDimen(name2);
      };
      AmsCdMethods.default = AmsCdMethods$1;
      return AmsCdMethods;
    }
    var hasRequiredAmsCdMappings;
    function requireAmsCdMappings() {
      if (hasRequiredAmsCdMappings) return AmsCdMappings;
      hasRequiredAmsCdMappings = 1;
      var __createBinding2 = AmsCdMappings && AmsCdMappings.__createBinding || (Object.create ? (function(o, m, k2, k22) {
        if (k22 === void 0) k22 = k2;
        var desc = Object.getOwnPropertyDescriptor(m, k2);
        if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
          desc = { enumerable: true, get: function() {
            return m[k2];
          } };
        }
        Object.defineProperty(o, k22, desc);
      }) : (function(o, m, k2, k22) {
        if (k22 === void 0) k22 = k2;
        o[k22] = m[k2];
      }));
      var __setModuleDefault2 = AmsCdMappings && AmsCdMappings.__setModuleDefault || (Object.create ? (function(o, v) {
        Object.defineProperty(o, "default", { enumerable: true, value: v });
      }) : function(o, v) {
        o["default"] = v;
      });
      var __importStar2 = AmsCdMappings && AmsCdMappings.__importStar || function(mod2) {
        if (mod2 && mod2.__esModule) return mod2;
        var result2 = {};
        if (mod2 != null) {
          for (var k2 in mod2) if (k2 !== "default" && Object.prototype.hasOwnProperty.call(mod2, k2)) __createBinding2(result2, mod2, k2);
        }
        __setModuleDefault2(result2, mod2);
        return result2;
      };
      var __importDefault2 = AmsCdMappings && AmsCdMappings.__importDefault || function(mod2) {
        return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
      };
      Object.defineProperty(AmsCdMappings, "__esModule", { value: true });
      var sm = __importStar2(requireSymbolMap());
      var ParseMethods_js_1 = __importDefault2(requireParseMethods());
      var AmsCdMethods_js_1 = __importDefault2(requireAmsCdMethods());
      new sm.EnvironmentMap("amscd_environment", ParseMethods_js_1.default.environment, { CD: "CD" }, AmsCdMethods_js_1.default);
      new sm.CommandMap("amscd_macros", {
        minCDarrowwidth: "minCDarrowwidth",
        minCDarrowheight: "minCDarrowheight"
      }, AmsCdMethods_js_1.default);
      new sm.MacroMap("amscd_special", { "@": "arrow" }, AmsCdMethods_js_1.default);
      return AmsCdMappings;
    }
    var hasRequiredAmsCdConfiguration;
    function requireAmsCdConfiguration() {
      if (hasRequiredAmsCdConfiguration) return AmsCdConfiguration;
      hasRequiredAmsCdConfiguration = 1;
      Object.defineProperty(AmsCdConfiguration, "__esModule", { value: true });
      AmsCdConfiguration.AmsCdConfiguration = void 0;
      var Configuration_js_1 = requireConfiguration();
      requireAmsCdMappings();
      AmsCdConfiguration.AmsCdConfiguration = Configuration_js_1.Configuration.create("amscd", {
        handler: {
          character: ["amscd_special"],
          macro: ["amscd_macros"],
          environment: ["amscd_environment"]
        },
        options: {
          amscd: {
            colspace: "5pt",
            rowspace: "5pt",
            harrowsize: "2.75em",
            varrowsize: "1.75em",
            hideHorizontalLabels: false
          }
        }
      });
      return AmsCdConfiguration;
    }
    var BboxConfiguration = {};
    var hasRequiredBboxConfiguration;
    function requireBboxConfiguration() {
      if (hasRequiredBboxConfiguration) return BboxConfiguration;
      hasRequiredBboxConfiguration = 1;
      (function(exports2) {
        var __importDefault2 = BboxConfiguration && BboxConfiguration.__importDefault || function(mod2) {
          return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
        };
        Object.defineProperty(exports2, "__esModule", { value: true });
        exports2.BboxConfiguration = exports2.BboxMethods = void 0;
        var Configuration_js_1 = requireConfiguration();
        var SymbolMap_js_1 = requireSymbolMap();
        var TexError_js_1 = __importDefault2(requireTexError());
        exports2.BboxMethods = {};
        exports2.BboxMethods.BBox = function(parser2, name2) {
          var bbox = parser2.GetBrackets(name2, "");
          var math2 = parser2.ParseArg(name2);
          var parts = bbox.split(/,/);
          var def, background, style2;
          for (var i2 = 0, m = parts.length; i2 < m; i2++) {
            var part2 = parts[i2].trim();
            var match = part2.match(/^(\.\d+|\d+(\.\d*)?)(pt|em|ex|mu|px|in|cm|mm)$/);
            if (match) {
              if (def) {
                throw new TexError_js_1.default("MultipleBBoxProperty", "%1 specified twice in %2", "Padding", name2);
              }
              var pad = BBoxPadding(match[1] + match[3]);
              if (pad) {
                def = {
                  height: "+" + pad,
                  depth: "+" + pad,
                  lspace: pad,
                  width: "+" + 2 * parseInt(match[1], 10) + match[3]
                };
              }
            } else if (part2.match(/^([a-z0-9]+|\#[0-9a-f]{6}|\#[0-9a-f]{3})$/i)) {
              if (background) {
                throw new TexError_js_1.default("MultipleBBoxProperty", "%1 specified twice in %2", "Background", name2);
              }
              background = part2;
            } else if (part2.match(/^[-a-z]+:/i)) {
              if (style2) {
                throw new TexError_js_1.default("MultipleBBoxProperty", "%1 specified twice in %2", "Style", name2);
              }
              style2 = BBoxStyle(part2);
            } else if (part2 !== "") {
              throw new TexError_js_1.default("InvalidBBoxProperty", `"%1" doesn't look like a color, a padding dimension, or a style`, part2);
            }
          }
          if (def) {
            math2 = parser2.create("node", "mpadded", [math2], def);
          }
          if (background || style2) {
            def = {};
            if (background) {
              Object.assign(def, { mathbackground: background });
            }
            if (style2) {
              Object.assign(def, { style: style2 });
            }
            math2 = parser2.create("node", "mstyle", [math2], def);
          }
          parser2.Push(math2);
        };
        var BBoxStyle = function(styles2) {
          return styles2;
        };
        var BBoxPadding = function(pad) {
          return pad;
        };
        new SymbolMap_js_1.CommandMap("bbox", { bbox: "BBox" }, exports2.BboxMethods);
        exports2.BboxConfiguration = Configuration_js_1.Configuration.create("bbox", { handler: { macro: ["bbox"] } });
      })(BboxConfiguration);
      return BboxConfiguration;
    }
    var BoldsymbolConfiguration = {};
    var hasRequiredBoldsymbolConfiguration;
    function requireBoldsymbolConfiguration() {
      if (hasRequiredBoldsymbolConfiguration) return BoldsymbolConfiguration;
      hasRequiredBoldsymbolConfiguration = 1;
      (function(exports2) {
        var __values2 = BoldsymbolConfiguration && BoldsymbolConfiguration.__values || function(o) {
          var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i2 = 0;
          if (m) return m.call(o);
          if (o && typeof o.length === "number") return {
            next: function() {
              if (o && i2 >= o.length) o = void 0;
              return { value: o && o[i2++], done: !o };
            }
          };
          throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
        };
        var __importDefault2 = BoldsymbolConfiguration && BoldsymbolConfiguration.__importDefault || function(mod2) {
          return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
        };
        Object.defineProperty(exports2, "__esModule", { value: true });
        exports2.BoldsymbolConfiguration = exports2.rewriteBoldTokens = exports2.createBoldToken = exports2.BoldsymbolMethods = void 0;
        var Configuration_js_1 = requireConfiguration();
        var NodeUtil_js_1 = __importDefault2(requireNodeUtil());
        var TexConstants_js_1 = requireTexConstants();
        var SymbolMap_js_1 = requireSymbolMap();
        var NodeFactory_js_1 = requireNodeFactory$1();
        var BOLDVARIANT = {};
        BOLDVARIANT[TexConstants_js_1.TexConstant.Variant.NORMAL] = TexConstants_js_1.TexConstant.Variant.BOLD;
        BOLDVARIANT[TexConstants_js_1.TexConstant.Variant.ITALIC] = TexConstants_js_1.TexConstant.Variant.BOLDITALIC;
        BOLDVARIANT[TexConstants_js_1.TexConstant.Variant.FRAKTUR] = TexConstants_js_1.TexConstant.Variant.BOLDFRAKTUR;
        BOLDVARIANT[TexConstants_js_1.TexConstant.Variant.SCRIPT] = TexConstants_js_1.TexConstant.Variant.BOLDSCRIPT;
        BOLDVARIANT[TexConstants_js_1.TexConstant.Variant.SANSSERIF] = TexConstants_js_1.TexConstant.Variant.BOLDSANSSERIF;
        BOLDVARIANT["-tex-calligraphic"] = "-tex-bold-calligraphic";
        BOLDVARIANT["-tex-oldstyle"] = "-tex-bold-oldstyle";
        BOLDVARIANT["-tex-mathit"] = TexConstants_js_1.TexConstant.Variant.BOLDITALIC;
        exports2.BoldsymbolMethods = {};
        exports2.BoldsymbolMethods.Boldsymbol = function(parser2, name2) {
          var boldsymbol = parser2.stack.env["boldsymbol"];
          parser2.stack.env["boldsymbol"] = true;
          var mml = parser2.ParseArg(name2);
          parser2.stack.env["boldsymbol"] = boldsymbol;
          parser2.Push(mml);
        };
        new SymbolMap_js_1.CommandMap("boldsymbol", { boldsymbol: "Boldsymbol" }, exports2.BoldsymbolMethods);
        function createBoldToken(factory, kind, def, text2) {
          var token2 = NodeFactory_js_1.NodeFactory.createToken(factory, kind, def, text2);
          if (kind !== "mtext" && factory.configuration.parser.stack.env["boldsymbol"]) {
            NodeUtil_js_1.default.setProperty(token2, "fixBold", true);
            factory.configuration.addNode("fixBold", token2);
          }
          return token2;
        }
        exports2.createBoldToken = createBoldToken;
        function rewriteBoldTokens(arg) {
          var e_1, _a2;
          try {
            for (var _b2 = __values2(arg.data.getList("fixBold")), _c = _b2.next(); !_c.done; _c = _b2.next()) {
              var node2 = _c.value;
              if (NodeUtil_js_1.default.getProperty(node2, "fixBold")) {
                var variant = NodeUtil_js_1.default.getAttribute(node2, "mathvariant");
                if (variant == null) {
                  NodeUtil_js_1.default.setAttribute(node2, "mathvariant", TexConstants_js_1.TexConstant.Variant.BOLD);
                } else {
                  NodeUtil_js_1.default.setAttribute(node2, "mathvariant", BOLDVARIANT[variant] || variant);
                }
                NodeUtil_js_1.default.removeProperties(node2, "fixBold");
              }
            }
          } catch (e_1_1) {
            e_1 = { error: e_1_1 };
          } finally {
            try {
              if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
            } finally {
              if (e_1) throw e_1.error;
            }
          }
        }
        exports2.rewriteBoldTokens = rewriteBoldTokens;
        exports2.BoldsymbolConfiguration = Configuration_js_1.Configuration.create("boldsymbol", {
          handler: { macro: ["boldsymbol"] },
          nodes: { "token": createBoldToken },
          postprocessors: [rewriteBoldTokens]
        });
      })(BoldsymbolConfiguration);
      return BoldsymbolConfiguration;
    }
    var BraketConfiguration = {};
    var BraketItems = {};
    var hasRequiredBraketItems;
    function requireBraketItems() {
      if (hasRequiredBraketItems) return BraketItems;
      hasRequiredBraketItems = 1;
      var __extends2 = BraketItems && BraketItems.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      var __importDefault2 = BraketItems && BraketItems.__importDefault || function(mod2) {
        return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
      };
      Object.defineProperty(BraketItems, "__esModule", { value: true });
      BraketItems.BraketItem = void 0;
      var StackItem_js_1 = requireStackItem();
      var MmlNode_js_1 = requireMmlNode();
      var ParseUtil_js_1 = __importDefault2(requireParseUtil());
      var BraketItem = (function(_super) {
        __extends2(BraketItem2, _super);
        function BraketItem2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        Object.defineProperty(BraketItem2.prototype, "kind", {
          get: function() {
            return "braket";
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(BraketItem2.prototype, "isOpen", {
          get: function() {
            return true;
          },
          enumerable: false,
          configurable: true
        });
        BraketItem2.prototype.checkItem = function(item2) {
          if (item2.isKind("close")) {
            return [[this.factory.create("mml", this.toMml())], true];
          }
          if (item2.isKind("mml")) {
            this.Push(item2.toMml());
            if (this.getProperty("single")) {
              return [[this.toMml()], true];
            }
            return StackItem_js_1.BaseItem.fail;
          }
          return _super.prototype.checkItem.call(this, item2);
        };
        BraketItem2.prototype.toMml = function() {
          var inner2 = _super.prototype.toMml.call(this);
          var open = this.getProperty("open");
          var close2 = this.getProperty("close");
          if (this.getProperty("stretchy")) {
            return ParseUtil_js_1.default.fenced(this.factory.configuration, open, inner2, close2);
          }
          var attrs = { fence: true, stretchy: false, symmetric: true, texClass: MmlNode_js_1.TEXCLASS.OPEN };
          var openNode = this.create("token", "mo", attrs, open);
          attrs.texClass = MmlNode_js_1.TEXCLASS.CLOSE;
          var closeNode = this.create("token", "mo", attrs, close2);
          var mrow2 = this.create("node", "mrow", [openNode, inner2, closeNode], { open, close: close2, texClass: MmlNode_js_1.TEXCLASS.INNER });
          return mrow2;
        };
        return BraketItem2;
      })(StackItem_js_1.BaseItem);
      BraketItems.BraketItem = BraketItem;
      return BraketItems;
    }
    var BraketMappings = {};
    var BraketMethods = {};
    var hasRequiredBraketMethods;
    function requireBraketMethods() {
      if (hasRequiredBraketMethods) return BraketMethods;
      hasRequiredBraketMethods = 1;
      var __importDefault2 = BraketMethods && BraketMethods.__importDefault || function(mod2) {
        return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
      };
      Object.defineProperty(BraketMethods, "__esModule", { value: true });
      var BaseMethods_js_1 = __importDefault2(requireBaseMethods());
      var MmlNode_js_1 = requireMmlNode();
      var TexError_js_1 = __importDefault2(requireTexError());
      var BraketMethods$1 = {};
      BraketMethods$1.Macro = BaseMethods_js_1.default.Macro;
      BraketMethods$1.Braket = function(parser2, _name, open, close2, stretchy, barmax) {
        var next = parser2.GetNext();
        if (next === "") {
          throw new TexError_js_1.default("MissingArgFor", "Missing argument for %1", parser2.currentCS);
        }
        var single = true;
        if (next === "{") {
          parser2.i++;
          single = false;
        }
        parser2.Push(parser2.itemFactory.create("braket").setProperties({
          barmax,
          barcount: 0,
          open,
          close: close2,
          stretchy,
          single
        }));
      };
      BraketMethods$1.Bar = function(parser2, name2) {
        var c2 = name2 === "|" ? "|" : "∥";
        var top2 = parser2.stack.Top();
        if (top2.kind !== "braket" || top2.getProperty("barcount") >= top2.getProperty("barmax")) {
          var mml = parser2.create("token", "mo", { texClass: MmlNode_js_1.TEXCLASS.ORD, stretchy: false }, c2);
          parser2.Push(mml);
          return;
        }
        if (c2 === "|" && parser2.GetNext() === "|") {
          parser2.i++;
          c2 = "∥";
        }
        var stretchy = top2.getProperty("stretchy");
        if (!stretchy) {
          var node_1 = parser2.create("token", "mo", { stretchy: false, braketbar: true }, c2);
          parser2.Push(node_1);
          return;
        }
        var node2 = parser2.create("node", "TeXAtom", [], { texClass: MmlNode_js_1.TEXCLASS.CLOSE });
        parser2.Push(node2);
        top2.setProperty("barcount", top2.getProperty("barcount") + 1);
        node2 = parser2.create("token", "mo", { stretchy: true, braketbar: true }, c2);
        parser2.Push(node2);
        node2 = parser2.create("node", "TeXAtom", [], { texClass: MmlNode_js_1.TEXCLASS.OPEN });
        parser2.Push(node2);
      };
      BraketMethods.default = BraketMethods$1;
      return BraketMethods;
    }
    var hasRequiredBraketMappings;
    function requireBraketMappings() {
      if (hasRequiredBraketMappings) return BraketMappings;
      hasRequiredBraketMappings = 1;
      var __importDefault2 = BraketMappings && BraketMappings.__importDefault || function(mod2) {
        return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
      };
      Object.defineProperty(BraketMappings, "__esModule", { value: true });
      var SymbolMap_js_1 = requireSymbolMap();
      var BraketMethods_js_1 = __importDefault2(requireBraketMethods());
      new SymbolMap_js_1.CommandMap("Braket-macros", {
        bra: ["Macro", "{\\langle {#1} \\vert}", 1],
        ket: ["Macro", "{\\vert {#1} \\rangle}", 1],
        braket: ["Braket", "⟨", "⟩", false, Infinity],
        "set": ["Braket", "{", "}", false, 1],
        Bra: ["Macro", "{\\left\\langle {#1} \\right\\vert}", 1],
        Ket: ["Macro", "{\\left\\vert {#1} \\right\\rangle}", 1],
        Braket: ["Braket", "⟨", "⟩", true, Infinity],
        Set: ["Braket", "{", "}", true, 1],
        ketbra: ["Macro", "{\\vert {#1} \\rangle\\langle {#2} \\vert}", 2],
        Ketbra: ["Macro", "{\\left\\vert {#1} \\right\\rangle\\left\\langle {#2} \\right\\vert}", 2],
        "|": "Bar"
      }, BraketMethods_js_1.default);
      new SymbolMap_js_1.MacroMap("Braket-characters", {
        "|": "Bar"
      }, BraketMethods_js_1.default);
      return BraketMappings;
    }
    var hasRequiredBraketConfiguration;
    function requireBraketConfiguration() {
      if (hasRequiredBraketConfiguration) return BraketConfiguration;
      hasRequiredBraketConfiguration = 1;
      var _a2;
      Object.defineProperty(BraketConfiguration, "__esModule", { value: true });
      BraketConfiguration.BraketConfiguration = void 0;
      var Configuration_js_1 = requireConfiguration();
      var BraketItems_js_1 = requireBraketItems();
      requireBraketMappings();
      BraketConfiguration.BraketConfiguration = Configuration_js_1.Configuration.create("braket", {
        handler: {
          character: ["Braket-characters"],
          macro: ["Braket-macros"]
        },
        items: (_a2 = {}, _a2[BraketItems_js_1.BraketItem.prototype.kind] = BraketItems_js_1.BraketItem, _a2)
      });
      return BraketConfiguration;
    }
    var BussproofsConfiguration = {};
    var BussproofsItems = {};
    var BussproofsUtil = {};
    var hasRequiredBussproofsUtil;
    function requireBussproofsUtil() {
      if (hasRequiredBussproofsUtil) return BussproofsUtil;
      hasRequiredBussproofsUtil = 1;
      (function(exports2) {
        var __read2 = BussproofsUtil && BussproofsUtil.__read || function(o, n) {
          var m = typeof Symbol === "function" && o[Symbol.iterator];
          if (!m) return o;
          var i2 = m.call(o), r2, ar2 = [], e;
          try {
            while ((n === void 0 || n-- > 0) && !(r2 = i2.next()).done) ar2.push(r2.value);
          } catch (error2) {
            e = { error: error2 };
          } finally {
            try {
              if (r2 && !r2.done && (m = i2["return"])) m.call(i2);
            } finally {
              if (e) throw e.error;
            }
          }
          return ar2;
        };
        var __values2 = BussproofsUtil && BussproofsUtil.__values || function(o) {
          var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i2 = 0;
          if (m) return m.call(o);
          if (o && typeof o.length === "number") return {
            next: function() {
              if (o && i2 >= o.length) o = void 0;
              return { value: o && o[i2++], done: !o };
            }
          };
          throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
        };
        var __importDefault2 = BussproofsUtil && BussproofsUtil.__importDefault || function(mod2) {
          return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
        };
        var _a2;
        Object.defineProperty(exports2, "__esModule", { value: true });
        exports2.clearDocument = exports2.saveDocument = exports2.makeBsprAttributes = exports2.removeProperty = exports2.getProperty = exports2.setProperty = exports2.balanceRules = void 0;
        var NodeUtil_js_1 = __importDefault2(requireNodeUtil());
        var ParseUtil_js_1 = __importDefault2(requireParseUtil());
        var doc2 = null;
        var item2 = null;
        var getBBox = function(node2) {
          item2.root = node2;
          var width = doc2.outputJax.getBBox(item2, doc2).w;
          return width;
        };
        var getRule = function(node2) {
          var i2 = 0;
          while (node2 && !NodeUtil_js_1.default.isType(node2, "mtable")) {
            if (NodeUtil_js_1.default.isType(node2, "text")) {
              return null;
            }
            if (NodeUtil_js_1.default.isType(node2, "mrow")) {
              node2 = node2.childNodes[0];
              i2 = 0;
              continue;
            }
            node2 = node2.parent.childNodes[i2];
            i2++;
          }
          return node2;
        };
        var getPremises = function(rule, direction) {
          return rule.childNodes[direction === "up" ? 1 : 0].childNodes[0].childNodes[0].childNodes[0].childNodes[0];
        };
        var getPremise = function(premises, n) {
          return premises.childNodes[n].childNodes[0].childNodes[0];
        };
        var firstPremise = function(premises) {
          return getPremise(premises, 0);
        };
        var lastPremise = function(premises) {
          return getPremise(premises, premises.childNodes.length - 1);
        };
        var getConclusion = function(rule, direction) {
          return rule.childNodes[direction === "up" ? 0 : 1].childNodes[0].childNodes[0].childNodes[0];
        };
        var getColumn2 = function(inf) {
          while (inf && !NodeUtil_js_1.default.isType(inf, "mtd")) {
            inf = inf.parent;
          }
          return inf;
        };
        var nextSibling = function(inf) {
          return inf.parent.childNodes[inf.parent.childNodes.indexOf(inf) + 1];
        };
        var getParentInf = function(inf) {
          while (inf && (0, exports2.getProperty)(inf, "inference") == null) {
            inf = inf.parent;
          }
          return inf;
        };
        var getSpaces = function(inf, rule, right2) {
          if (right2 === void 0) {
            right2 = false;
          }
          var result2 = 0;
          if (inf === rule) {
            return result2;
          }
          if (inf !== rule.parent) {
            var children_1 = inf.childNodes;
            var index_1 = right2 ? children_1.length - 1 : 0;
            if (NodeUtil_js_1.default.isType(children_1[index_1], "mspace")) {
              result2 += getBBox(children_1[index_1]);
            }
            inf = rule.parent;
          }
          if (inf === rule) {
            return result2;
          }
          var children2 = inf.childNodes;
          var index = right2 ? children2.length - 1 : 0;
          if (children2[index] !== rule) {
            result2 += getBBox(children2[index]);
          }
          return result2;
        };
        var adjustValue = function(inf, right2) {
          if (right2 === void 0) {
            right2 = false;
          }
          var rule = getRule(inf);
          var conc2 = getConclusion(rule, (0, exports2.getProperty)(rule, "inferenceRule"));
          var w = getSpaces(inf, rule, right2);
          var x2 = getBBox(rule);
          var y = getBBox(conc2);
          return w + (x2 - y) / 2;
        };
        var addSpace = function(config2, inf, space, right2) {
          if (right2 === void 0) {
            right2 = false;
          }
          if ((0, exports2.getProperty)(inf, "inferenceRule") || (0, exports2.getProperty)(inf, "labelledRule")) {
            var mrow2 = config2.nodeFactory.create("node", "mrow");
            inf.parent.replaceChild(mrow2, inf);
            mrow2.setChildren([inf]);
            moveProperties(inf, mrow2);
            inf = mrow2;
          }
          var index = right2 ? inf.childNodes.length - 1 : 0;
          var mspace2 = inf.childNodes[index];
          if (NodeUtil_js_1.default.isType(mspace2, "mspace")) {
            NodeUtil_js_1.default.setAttribute(mspace2, "width", ParseUtil_js_1.default.Em(ParseUtil_js_1.default.dimen2em(NodeUtil_js_1.default.getAttribute(mspace2, "width")) + space));
            return;
          }
          mspace2 = config2.nodeFactory.create("node", "mspace", [], { width: ParseUtil_js_1.default.Em(space) });
          if (right2) {
            inf.appendChild(mspace2);
            return;
          }
          mspace2.parent = inf;
          inf.childNodes.unshift(mspace2);
        };
        var moveProperties = function(src, dest) {
          var props = ["inference", "proof", "maxAdjust", "labelledRule"];
          props.forEach(function(x2) {
            var value2 = (0, exports2.getProperty)(src, x2);
            if (value2 != null) {
              (0, exports2.setProperty)(dest, x2, value2);
              (0, exports2.removeProperty)(src, x2);
            }
          });
        };
        var adjustSequents = function(config2) {
          var sequents = config2.nodeLists["sequent"];
          if (!sequents) {
            return;
          }
          for (var i2 = sequents.length - 1, seq = void 0; seq = sequents[i2]; i2--) {
            if ((0, exports2.getProperty)(seq, "sequentProcessed")) {
              (0, exports2.removeProperty)(seq, "sequentProcessed");
              continue;
            }
            var collect = [];
            var inf = getParentInf(seq);
            if ((0, exports2.getProperty)(inf, "inference") !== 1) {
              continue;
            }
            collect.push(seq);
            while ((0, exports2.getProperty)(inf, "inference") === 1) {
              inf = getRule(inf);
              var premise = firstPremise(getPremises(inf, (0, exports2.getProperty)(inf, "inferenceRule")));
              var sequent = (0, exports2.getProperty)(premise, "inferenceRule") ? getConclusion(premise, (0, exports2.getProperty)(premise, "inferenceRule")) : premise;
              if ((0, exports2.getProperty)(sequent, "sequent")) {
                seq = sequent.childNodes[0];
                collect.push(seq);
                (0, exports2.setProperty)(seq, "sequentProcessed", true);
              }
              inf = premise;
            }
            adjustSequentPairwise(config2, collect);
          }
        };
        var addSequentSpace = function(config2, sequent, position, direction, width) {
          var mspace2 = config2.nodeFactory.create("node", "mspace", [], { width: ParseUtil_js_1.default.Em(width) });
          if (direction === "left") {
            var row2 = sequent.childNodes[position].childNodes[0];
            mspace2.parent = row2;
            row2.childNodes.unshift(mspace2);
          } else {
            sequent.childNodes[position].appendChild(mspace2);
          }
          (0, exports2.setProperty)(sequent.parent, "sequentAdjust_" + direction, width);
        };
        var adjustSequentPairwise = function(config2, sequents) {
          var top2 = sequents.pop();
          while (sequents.length) {
            var bottom2 = sequents.pop();
            var _a3 = __read2(compareSequents(top2, bottom2), 2), left2 = _a3[0], right2 = _a3[1];
            if ((0, exports2.getProperty)(top2.parent, "axiom")) {
              addSequentSpace(config2, left2 < 0 ? top2 : bottom2, 0, "left", Math.abs(left2));
              addSequentSpace(config2, right2 < 0 ? top2 : bottom2, 2, "right", Math.abs(right2));
            }
            top2 = bottom2;
          }
        };
        var compareSequents = function(top2, bottom2) {
          var tr2 = getBBox(top2.childNodes[2]);
          var br = getBBox(bottom2.childNodes[2]);
          var tl = getBBox(top2.childNodes[0]);
          var bl = getBBox(bottom2.childNodes[0]);
          var dl = tl - bl;
          var dr2 = tr2 - br;
          return [dl, dr2];
        };
        var balanceRules = function(arg) {
          var e_1, _a3;
          item2 = new arg.document.options.MathItem("", null, arg.math.display);
          var config2 = arg.data;
          adjustSequents(config2);
          var inferences = config2.nodeLists["inference"] || [];
          try {
            for (var inferences_1 = __values2(inferences), inferences_1_1 = inferences_1.next(); !inferences_1_1.done; inferences_1_1 = inferences_1.next()) {
              var inf = inferences_1_1.value;
              var isProof = (0, exports2.getProperty)(inf, "proof");
              var rule = getRule(inf);
              var premises = getPremises(rule, (0, exports2.getProperty)(rule, "inferenceRule"));
              var premiseF = firstPremise(premises);
              if ((0, exports2.getProperty)(premiseF, "inference")) {
                var adjust_1 = adjustValue(premiseF);
                if (adjust_1) {
                  addSpace(config2, premiseF, -adjust_1);
                  var w_1 = getSpaces(inf, rule, false);
                  addSpace(config2, inf, adjust_1 - w_1);
                }
              }
              var premiseL = lastPremise(premises);
              if ((0, exports2.getProperty)(premiseL, "inference") == null) {
                continue;
              }
              var adjust = adjustValue(premiseL, true);
              addSpace(config2, premiseL, -adjust, true);
              var w = getSpaces(inf, rule, true);
              var maxAdjust = (0, exports2.getProperty)(inf, "maxAdjust");
              if (maxAdjust != null) {
                adjust = Math.max(adjust, maxAdjust);
              }
              var column2 = void 0;
              if (isProof || !(column2 = getColumn2(inf))) {
                addSpace(config2, (0, exports2.getProperty)(inf, "proof") ? inf : inf.parent, adjust - w, true);
                continue;
              }
              var sibling = nextSibling(column2);
              if (sibling) {
                var pos2 = config2.nodeFactory.create("node", "mspace", [], { width: adjust - w + "em" });
                sibling.appendChild(pos2);
                inf.removeProperty("maxAdjust");
                continue;
              }
              var parentRule = getParentInf(column2);
              if (!parentRule) {
                continue;
              }
              adjust = (0, exports2.getProperty)(parentRule, "maxAdjust") ? Math.max((0, exports2.getProperty)(parentRule, "maxAdjust"), adjust) : adjust;
              (0, exports2.setProperty)(parentRule, "maxAdjust", adjust);
            }
          } catch (e_1_1) {
            e_1 = { error: e_1_1 };
          } finally {
            try {
              if (inferences_1_1 && !inferences_1_1.done && (_a3 = inferences_1.return)) _a3.call(inferences_1);
            } finally {
              if (e_1) throw e_1.error;
            }
          }
        };
        exports2.balanceRules = balanceRules;
        var property_prefix = "bspr_";
        var blacklistedProperties = (_a2 = {}, _a2[property_prefix + "maxAdjust"] = true, _a2);
        var setProperty2 = function(node2, property2, value2) {
          NodeUtil_js_1.default.setProperty(node2, property_prefix + property2, value2);
        };
        exports2.setProperty = setProperty2;
        var getProperty = function(node2, property2) {
          return NodeUtil_js_1.default.getProperty(node2, property_prefix + property2);
        };
        exports2.getProperty = getProperty;
        var removeProperty = function(node2, property2) {
          node2.removeProperty(property_prefix + property2);
        };
        exports2.removeProperty = removeProperty;
        var makeBsprAttributes = function(arg) {
          arg.data.root.walkTree(function(mml, _data) {
            var attr = [];
            mml.getPropertyNames().forEach(function(x2) {
              if (!blacklistedProperties[x2] && x2.match(RegExp("^" + property_prefix))) {
                attr.push(x2 + ":" + mml.getProperty(x2));
              }
            });
            if (attr.length) {
              NodeUtil_js_1.default.setAttribute(mml, "semantics", attr.join(";"));
            }
          });
        };
        exports2.makeBsprAttributes = makeBsprAttributes;
        var saveDocument = function(arg) {
          doc2 = arg.document;
          if (!("getBBox" in doc2.outputJax)) {
            throw Error("The bussproofs extension requires an output jax with a getBBox() method");
          }
        };
        exports2.saveDocument = saveDocument;
        var clearDocument = function(_arg) {
          doc2 = null;
        };
        exports2.clearDocument = clearDocument;
      })(BussproofsUtil);
      return BussproofsUtil;
    }
    var hasRequiredBussproofsItems;
    function requireBussproofsItems() {
      if (hasRequiredBussproofsItems) return BussproofsItems;
      hasRequiredBussproofsItems = 1;
      var __extends2 = BussproofsItems && BussproofsItems.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      var __createBinding2 = BussproofsItems && BussproofsItems.__createBinding || (Object.create ? (function(o, m, k2, k22) {
        if (k22 === void 0) k22 = k2;
        var desc = Object.getOwnPropertyDescriptor(m, k2);
        if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
          desc = { enumerable: true, get: function() {
            return m[k2];
          } };
        }
        Object.defineProperty(o, k22, desc);
      }) : (function(o, m, k2, k22) {
        if (k22 === void 0) k22 = k2;
        o[k22] = m[k2];
      }));
      var __setModuleDefault2 = BussproofsItems && BussproofsItems.__setModuleDefault || (Object.create ? (function(o, v) {
        Object.defineProperty(o, "default", { enumerable: true, value: v });
      }) : function(o, v) {
        o["default"] = v;
      });
      var __importStar2 = BussproofsItems && BussproofsItems.__importStar || function(mod2) {
        if (mod2 && mod2.__esModule) return mod2;
        var result2 = {};
        if (mod2 != null) {
          for (var k2 in mod2) if (k2 !== "default" && Object.prototype.hasOwnProperty.call(mod2, k2)) __createBinding2(result2, mod2, k2);
        }
        __setModuleDefault2(result2, mod2);
        return result2;
      };
      var __importDefault2 = BussproofsItems && BussproofsItems.__importDefault || function(mod2) {
        return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
      };
      Object.defineProperty(BussproofsItems, "__esModule", { value: true });
      BussproofsItems.ProofTreeItem = void 0;
      var TexError_js_1 = __importDefault2(requireTexError());
      var StackItem_js_1 = requireStackItem();
      var Stack_js_1 = __importDefault2(requireStack());
      var BussproofsUtil2 = __importStar2(requireBussproofsUtil());
      var ProofTreeItem = (function(_super) {
        __extends2(ProofTreeItem2, _super);
        function ProofTreeItem2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.leftLabel = null;
          _this.rigthLabel = null;
          _this.innerStack = new Stack_js_1.default(_this.factory, {}, true);
          return _this;
        }
        Object.defineProperty(ProofTreeItem2.prototype, "kind", {
          get: function() {
            return "proofTree";
          },
          enumerable: false,
          configurable: true
        });
        ProofTreeItem2.prototype.checkItem = function(item2) {
          if (item2.isKind("end") && item2.getName() === "prooftree") {
            var node2 = this.toMml();
            BussproofsUtil2.setProperty(node2, "proof", true);
            return [[this.factory.create("mml", node2), item2], true];
          }
          if (item2.isKind("stop")) {
            throw new TexError_js_1.default("EnvMissingEnd", "Missing \\end{%1}", this.getName());
          }
          this.innerStack.Push(item2);
          return StackItem_js_1.BaseItem.fail;
        };
        ProofTreeItem2.prototype.toMml = function() {
          var tree = _super.prototype.toMml.call(this);
          var start2 = this.innerStack.Top();
          if (start2.isKind("start") && !start2.Size()) {
            return tree;
          }
          this.innerStack.Push(this.factory.create("stop"));
          var prefix = this.innerStack.Top().toMml();
          return this.create("node", "mrow", [prefix, tree], {});
        };
        return ProofTreeItem2;
      })(StackItem_js_1.BaseItem);
      BussproofsItems.ProofTreeItem = ProofTreeItem;
      return BussproofsItems;
    }
    var BussproofsMappings = {};
    var BussproofsMethods = {};
    var hasRequiredBussproofsMethods;
    function requireBussproofsMethods() {
      if (hasRequiredBussproofsMethods) return BussproofsMethods;
      hasRequiredBussproofsMethods = 1;
      var __createBinding2 = BussproofsMethods && BussproofsMethods.__createBinding || (Object.create ? (function(o, m, k2, k22) {
        if (k22 === void 0) k22 = k2;
        var desc = Object.getOwnPropertyDescriptor(m, k2);
        if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
          desc = { enumerable: true, get: function() {
            return m[k2];
          } };
        }
        Object.defineProperty(o, k22, desc);
      }) : (function(o, m, k2, k22) {
        if (k22 === void 0) k22 = k2;
        o[k22] = m[k2];
      }));
      var __setModuleDefault2 = BussproofsMethods && BussproofsMethods.__setModuleDefault || (Object.create ? (function(o, v) {
        Object.defineProperty(o, "default", { enumerable: true, value: v });
      }) : function(o, v) {
        o["default"] = v;
      });
      var __importStar2 = BussproofsMethods && BussproofsMethods.__importStar || function(mod2) {
        if (mod2 && mod2.__esModule) return mod2;
        var result2 = {};
        if (mod2 != null) {
          for (var k2 in mod2) if (k2 !== "default" && Object.prototype.hasOwnProperty.call(mod2, k2)) __createBinding2(result2, mod2, k2);
        }
        __setModuleDefault2(result2, mod2);
        return result2;
      };
      var __read2 = BussproofsMethods && BussproofsMethods.__read || function(o, n) {
        var m = typeof Symbol === "function" && o[Symbol.iterator];
        if (!m) return o;
        var i2 = m.call(o), r2, ar2 = [], e;
        try {
          while ((n === void 0 || n-- > 0) && !(r2 = i2.next()).done) ar2.push(r2.value);
        } catch (error2) {
          e = { error: error2 };
        } finally {
          try {
            if (r2 && !r2.done && (m = i2["return"])) m.call(i2);
          } finally {
            if (e) throw e.error;
          }
        }
        return ar2;
      };
      var __spreadArray2 = BussproofsMethods && BussproofsMethods.__spreadArray || function(to2, from, pack) {
        if (pack || arguments.length === 2) for (var i2 = 0, l = from.length, ar2; i2 < l; i2++) {
          if (ar2 || !(i2 in from)) {
            if (!ar2) ar2 = Array.prototype.slice.call(from, 0, i2);
            ar2[i2] = from[i2];
          }
        }
        return to2.concat(ar2 || Array.prototype.slice.call(from));
      };
      var __importDefault2 = BussproofsMethods && BussproofsMethods.__importDefault || function(mod2) {
        return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
      };
      Object.defineProperty(BussproofsMethods, "__esModule", { value: true });
      var TexError_js_1 = __importDefault2(requireTexError());
      var TexParser_js_1 = __importDefault2(requireTexParser());
      var ParseUtil_js_1 = __importDefault2(requireParseUtil());
      var BussproofsUtil2 = __importStar2(requireBussproofsUtil());
      var BussproofsMethods$1 = {};
      BussproofsMethods$1.Prooftree = function(parser2, begin) {
        parser2.Push(begin);
        var newItem = parser2.itemFactory.create("proofTree").setProperties({
          name: begin.getName(),
          line: "solid",
          currentLine: "solid",
          rootAtTop: false
        });
        return newItem;
      };
      BussproofsMethods$1.Axiom = function(parser2, name2) {
        var top2 = parser2.stack.Top();
        if (top2.kind !== "proofTree") {
          throw new TexError_js_1.default("IllegalProofCommand", "Proof commands only allowed in prooftree environment.");
        }
        var content2 = paddedContent(parser2, parser2.GetArgument(name2));
        BussproofsUtil2.setProperty(content2, "axiom", true);
        top2.Push(content2);
      };
      var paddedContent = function(parser2, content2) {
        var nodes = ParseUtil_js_1.default.internalMath(parser2, ParseUtil_js_1.default.trimSpaces(content2), 0);
        if (!nodes[0].childNodes[0].childNodes.length) {
          return parser2.create("node", "mrow", []);
        }
        var lpad = parser2.create("node", "mspace", [], { width: ".5ex" });
        var rpad = parser2.create("node", "mspace", [], { width: ".5ex" });
        return parser2.create("node", "mrow", __spreadArray2(__spreadArray2([lpad], __read2(nodes), false), [rpad], false));
      };
      BussproofsMethods$1.Inference = function(parser2, name2, n) {
        var top2 = parser2.stack.Top();
        if (top2.kind !== "proofTree") {
          throw new TexError_js_1.default("IllegalProofCommand", "Proof commands only allowed in prooftree environment.");
        }
        if (top2.Size() < n) {
          throw new TexError_js_1.default("BadProofTree", "Proof tree badly specified.");
        }
        var rootAtTop = top2.getProperty("rootAtTop");
        var childCount = n === 1 && !top2.Peek()[0].childNodes.length ? 0 : n;
        var children2 = [];
        do {
          if (children2.length) {
            children2.unshift(parser2.create("node", "mtd", [], {}));
          }
          children2.unshift(parser2.create("node", "mtd", [top2.Pop()], { "rowalign": rootAtTop ? "top" : "bottom" }));
          n--;
        } while (n > 0);
        var row2 = parser2.create("node", "mtr", children2, {});
        var table2 = parser2.create("node", "mtable", [row2], { framespacing: "0 0" });
        var conclusion = paddedContent(parser2, parser2.GetArgument(name2));
        var style2 = top2.getProperty("currentLine");
        if (style2 !== top2.getProperty("line")) {
          top2.setProperty("currentLine", top2.getProperty("line"));
        }
        var rule = createRule(parser2, table2, [conclusion], top2.getProperty("left"), top2.getProperty("right"), style2, rootAtTop);
        top2.setProperty("left", null);
        top2.setProperty("right", null);
        BussproofsUtil2.setProperty(rule, "inference", childCount);
        parser2.configuration.addNode("inference", rule);
        top2.Push(rule);
      };
      function createRule(parser2, premise, conclusions, left2, right2, style2, rootAtTop) {
        var upper = parser2.create("node", "mtr", [parser2.create("node", "mtd", [premise], {})], {});
        var lower = parser2.create("node", "mtr", [parser2.create("node", "mtd", conclusions, {})], {});
        var rule = parser2.create("node", "mtable", rootAtTop ? [lower, upper] : [upper, lower], { align: "top 2", rowlines: style2, framespacing: "0 0" });
        BussproofsUtil2.setProperty(rule, "inferenceRule", rootAtTop ? "up" : "down");
        var leftLabel, rightLabel;
        if (left2) {
          leftLabel = parser2.create("node", "mpadded", [left2], { height: "+.5em", width: "+.5em", voffset: "-.15em" });
          BussproofsUtil2.setProperty(leftLabel, "prooflabel", "left");
        }
        if (right2) {
          rightLabel = parser2.create("node", "mpadded", [right2], { height: "+.5em", width: "+.5em", voffset: "-.15em" });
          BussproofsUtil2.setProperty(rightLabel, "prooflabel", "right");
        }
        var children2, label2;
        if (left2 && right2) {
          children2 = [leftLabel, rule, rightLabel];
          label2 = "both";
        } else if (left2) {
          children2 = [leftLabel, rule];
          label2 = "left";
        } else if (right2) {
          children2 = [rule, rightLabel];
          label2 = "right";
        } else {
          return rule;
        }
        rule = parser2.create("node", "mrow", children2);
        BussproofsUtil2.setProperty(rule, "labelledRule", label2);
        return rule;
      }
      BussproofsMethods$1.Label = function(parser2, name2, side) {
        var top2 = parser2.stack.Top();
        if (top2.kind !== "proofTree") {
          throw new TexError_js_1.default("IllegalProofCommand", "Proof commands only allowed in prooftree environment.");
        }
        var content2 = ParseUtil_js_1.default.internalMath(parser2, parser2.GetArgument(name2), 0);
        var label2 = content2.length > 1 ? parser2.create("node", "mrow", content2, {}) : content2[0];
        top2.setProperty(side, label2);
      };
      BussproofsMethods$1.SetLine = function(parser2, _name, style2, always) {
        var top2 = parser2.stack.Top();
        if (top2.kind !== "proofTree") {
          throw new TexError_js_1.default("IllegalProofCommand", "Proof commands only allowed in prooftree environment.");
        }
        top2.setProperty("currentLine", style2);
        if (always) {
          top2.setProperty("line", style2);
        }
      };
      BussproofsMethods$1.RootAtTop = function(parser2, _name, where) {
        var top2 = parser2.stack.Top();
        if (top2.kind !== "proofTree") {
          throw new TexError_js_1.default("IllegalProofCommand", "Proof commands only allowed in prooftree environment.");
        }
        top2.setProperty("rootAtTop", where);
      };
      BussproofsMethods$1.AxiomF = function(parser2, name2) {
        var top2 = parser2.stack.Top();
        if (top2.kind !== "proofTree") {
          throw new TexError_js_1.default("IllegalProofCommand", "Proof commands only allowed in prooftree environment.");
        }
        var line2 = parseFCenterLine(parser2, name2);
        BussproofsUtil2.setProperty(line2, "axiom", true);
        top2.Push(line2);
      };
      function parseFCenterLine(parser2, name2) {
        var dollar2 = parser2.GetNext();
        if (dollar2 !== "$") {
          throw new TexError_js_1.default("IllegalUseOfCommand", "Use of %1 does not match it's definition.", name2);
        }
        parser2.i++;
        var axiom = parser2.GetUpTo(name2, "$");
        if (axiom.indexOf("\\fCenter") === -1) {
          throw new TexError_js_1.default("IllegalUseOfCommand", "Missing \\fCenter in %1.", name2);
        }
        var _a2 = __read2(axiom.split("\\fCenter"), 2), prem = _a2[0], conc2 = _a2[1];
        var premise = new TexParser_js_1.default(prem, parser2.stack.env, parser2.configuration).mml();
        var conclusion = new TexParser_js_1.default(conc2, parser2.stack.env, parser2.configuration).mml();
        var fcenter = new TexParser_js_1.default("\\fCenter", parser2.stack.env, parser2.configuration).mml();
        var left2 = parser2.create("node", "mtd", [premise], {});
        var middle = parser2.create("node", "mtd", [fcenter], {});
        var right2 = parser2.create("node", "mtd", [conclusion], {});
        var row2 = parser2.create("node", "mtr", [left2, middle, right2], {});
        var table2 = parser2.create("node", "mtable", [row2], { columnspacing: ".5ex", columnalign: "center 2" });
        BussproofsUtil2.setProperty(table2, "sequent", true);
        parser2.configuration.addNode("sequent", row2);
        return table2;
      }
      BussproofsMethods$1.FCenter = function(_parser2, _name) {
      };
      BussproofsMethods$1.InferenceF = function(parser2, name2, n) {
        var top2 = parser2.stack.Top();
        if (top2.kind !== "proofTree") {
          throw new TexError_js_1.default("IllegalProofCommand", "Proof commands only allowed in prooftree environment.");
        }
        if (top2.Size() < n) {
          throw new TexError_js_1.default("BadProofTree", "Proof tree badly specified.");
        }
        var rootAtTop = top2.getProperty("rootAtTop");
        var childCount = n === 1 && !top2.Peek()[0].childNodes.length ? 0 : n;
        var children2 = [];
        do {
          if (children2.length) {
            children2.unshift(parser2.create("node", "mtd", [], {}));
          }
          children2.unshift(parser2.create("node", "mtd", [top2.Pop()], { "rowalign": rootAtTop ? "top" : "bottom" }));
          n--;
        } while (n > 0);
        var row2 = parser2.create("node", "mtr", children2, {});
        var table2 = parser2.create("node", "mtable", [row2], { framespacing: "0 0" });
        var conclusion = parseFCenterLine(parser2, name2);
        var style2 = top2.getProperty("currentLine");
        if (style2 !== top2.getProperty("line")) {
          top2.setProperty("currentLine", top2.getProperty("line"));
        }
        var rule = createRule(parser2, table2, [conclusion], top2.getProperty("left"), top2.getProperty("right"), style2, rootAtTop);
        top2.setProperty("left", null);
        top2.setProperty("right", null);
        BussproofsUtil2.setProperty(rule, "inference", childCount);
        parser2.configuration.addNode("inference", rule);
        top2.Push(rule);
      };
      BussproofsMethods.default = BussproofsMethods$1;
      return BussproofsMethods;
    }
    var hasRequiredBussproofsMappings;
    function requireBussproofsMappings() {
      if (hasRequiredBussproofsMappings) return BussproofsMappings;
      hasRequiredBussproofsMappings = 1;
      var __importDefault2 = BussproofsMappings && BussproofsMappings.__importDefault || function(mod2) {
        return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
      };
      Object.defineProperty(BussproofsMappings, "__esModule", { value: true });
      var BussproofsMethods_js_1 = __importDefault2(requireBussproofsMethods());
      var ParseMethods_js_1 = __importDefault2(requireParseMethods());
      var SymbolMap_js_1 = requireSymbolMap();
      new SymbolMap_js_1.CommandMap("Bussproofs-macros", {
        AxiomC: "Axiom",
        UnaryInfC: ["Inference", 1],
        BinaryInfC: ["Inference", 2],
        TrinaryInfC: ["Inference", 3],
        QuaternaryInfC: ["Inference", 4],
        QuinaryInfC: ["Inference", 5],
        RightLabel: ["Label", "right"],
        LeftLabel: ["Label", "left"],
        AXC: "Axiom",
        UIC: ["Inference", 1],
        BIC: ["Inference", 2],
        TIC: ["Inference", 3],
        RL: ["Label", "right"],
        LL: ["Label", "left"],
        noLine: ["SetLine", "none", false],
        singleLine: ["SetLine", "solid", false],
        solidLine: ["SetLine", "solid", false],
        dashedLine: ["SetLine", "dashed", false],
        alwaysNoLine: ["SetLine", "none", true],
        alwaysSingleLine: ["SetLine", "solid", true],
        alwaysSolidLine: ["SetLine", "solid", true],
        alwaysDashedLine: ["SetLine", "dashed", true],
        rootAtTop: ["RootAtTop", true],
        alwaysRootAtTop: ["RootAtTop", true],
        rootAtBottom: ["RootAtTop", false],
        alwaysRootAtBottom: ["RootAtTop", false],
        fCenter: "FCenter",
        Axiom: "AxiomF",
        UnaryInf: ["InferenceF", 1],
        BinaryInf: ["InferenceF", 2],
        TrinaryInf: ["InferenceF", 3],
        QuaternaryInf: ["InferenceF", 4],
        QuinaryInf: ["InferenceF", 5]
      }, BussproofsMethods_js_1.default);
      new SymbolMap_js_1.EnvironmentMap("Bussproofs-environments", ParseMethods_js_1.default.environment, {
        prooftree: ["Prooftree", null, false]
      }, BussproofsMethods_js_1.default);
      return BussproofsMappings;
    }
    var hasRequiredBussproofsConfiguration;
    function requireBussproofsConfiguration() {
      if (hasRequiredBussproofsConfiguration) return BussproofsConfiguration;
      hasRequiredBussproofsConfiguration = 1;
      var _a2;
      Object.defineProperty(BussproofsConfiguration, "__esModule", { value: true });
      BussproofsConfiguration.BussproofsConfiguration = void 0;
      var Configuration_js_1 = requireConfiguration();
      var BussproofsItems_js_1 = requireBussproofsItems();
      var BussproofsUtil_js_1 = requireBussproofsUtil();
      requireBussproofsMappings();
      BussproofsConfiguration.BussproofsConfiguration = Configuration_js_1.Configuration.create("bussproofs", {
        handler: {
          macro: ["Bussproofs-macros"],
          environment: ["Bussproofs-environments"]
        },
        items: (_a2 = {}, _a2[BussproofsItems_js_1.ProofTreeItem.prototype.kind] = BussproofsItems_js_1.ProofTreeItem, _a2),
        preprocessors: [
          [BussproofsUtil_js_1.saveDocument, 1]
        ],
        postprocessors: [
          [BussproofsUtil_js_1.clearDocument, 3],
          [BussproofsUtil_js_1.makeBsprAttributes, 2],
          [BussproofsUtil_js_1.balanceRules, 1]
        ]
      });
      return BussproofsConfiguration;
    }
    var CancelConfiguration = {};
    var EncloseConfiguration = {};
    var hasRequiredEncloseConfiguration;
    function requireEncloseConfiguration() {
      if (hasRequiredEncloseConfiguration) return EncloseConfiguration;
      hasRequiredEncloseConfiguration = 1;
      (function(exports2) {
        var __importDefault2 = EncloseConfiguration && EncloseConfiguration.__importDefault || function(mod2) {
          return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
        };
        Object.defineProperty(exports2, "__esModule", { value: true });
        exports2.EncloseConfiguration = exports2.EncloseMethods = exports2.ENCLOSE_OPTIONS = void 0;
        var Configuration_js_1 = requireConfiguration();
        var SymbolMap_js_1 = requireSymbolMap();
        var ParseUtil_js_1 = __importDefault2(requireParseUtil());
        exports2.ENCLOSE_OPTIONS = {
          "data-arrowhead": 1,
          color: 1,
          mathcolor: 1,
          background: 1,
          mathbackground: 1,
          "data-padding": 1,
          "data-thickness": 1
        };
        exports2.EncloseMethods = {};
        exports2.EncloseMethods.Enclose = function(parser2, name2) {
          var notation = parser2.GetArgument(name2).replace(/,/g, " ");
          var attr = parser2.GetBrackets(name2, "");
          var math2 = parser2.ParseArg(name2);
          var def = ParseUtil_js_1.default.keyvalOptions(attr, exports2.ENCLOSE_OPTIONS);
          def.notation = notation;
          parser2.Push(parser2.create("node", "menclose", [math2], def));
        };
        new SymbolMap_js_1.CommandMap("enclose", { enclose: "Enclose" }, exports2.EncloseMethods);
        exports2.EncloseConfiguration = Configuration_js_1.Configuration.create("enclose", { handler: { macro: ["enclose"] } });
      })(EncloseConfiguration);
      return EncloseConfiguration;
    }
    var hasRequiredCancelConfiguration;
    function requireCancelConfiguration() {
      if (hasRequiredCancelConfiguration) return CancelConfiguration;
      hasRequiredCancelConfiguration = 1;
      (function(exports2) {
        var __importDefault2 = CancelConfiguration && CancelConfiguration.__importDefault || function(mod2) {
          return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
        };
        Object.defineProperty(exports2, "__esModule", { value: true });
        exports2.CancelConfiguration = exports2.CancelMethods = void 0;
        var Configuration_js_1 = requireConfiguration();
        var TexConstants_js_1 = requireTexConstants();
        var SymbolMap_js_1 = requireSymbolMap();
        var ParseUtil_js_1 = __importDefault2(requireParseUtil());
        var EncloseConfiguration_js_1 = requireEncloseConfiguration();
        exports2.CancelMethods = {};
        exports2.CancelMethods.Cancel = function(parser2, name2, notation) {
          var attr = parser2.GetBrackets(name2, "");
          var math2 = parser2.ParseArg(name2);
          var def = ParseUtil_js_1.default.keyvalOptions(attr, EncloseConfiguration_js_1.ENCLOSE_OPTIONS);
          def["notation"] = notation;
          parser2.Push(parser2.create("node", "menclose", [math2], def));
        };
        exports2.CancelMethods.CancelTo = function(parser2, name2) {
          var attr = parser2.GetBrackets(name2, "");
          var value2 = parser2.ParseArg(name2);
          var math2 = parser2.ParseArg(name2);
          var def = ParseUtil_js_1.default.keyvalOptions(attr, EncloseConfiguration_js_1.ENCLOSE_OPTIONS);
          def["notation"] = [
            TexConstants_js_1.TexConstant.Notation.UPDIAGONALSTRIKE,
            TexConstants_js_1.TexConstant.Notation.UPDIAGONALARROW,
            TexConstants_js_1.TexConstant.Notation.NORTHEASTARROW
          ].join(" ");
          value2 = parser2.create("node", "mpadded", [value2], { depth: "-.1em", height: "+.1em", voffset: ".1em" });
          parser2.Push(parser2.create("node", "msup", [parser2.create("node", "menclose", [math2], def), value2]));
        };
        new SymbolMap_js_1.CommandMap("cancel", {
          cancel: ["Cancel", TexConstants_js_1.TexConstant.Notation.UPDIAGONALSTRIKE],
          bcancel: ["Cancel", TexConstants_js_1.TexConstant.Notation.DOWNDIAGONALSTRIKE],
          xcancel: ["Cancel", TexConstants_js_1.TexConstant.Notation.UPDIAGONALSTRIKE + " " + TexConstants_js_1.TexConstant.Notation.DOWNDIAGONALSTRIKE],
          cancelto: "CancelTo"
        }, exports2.CancelMethods);
        exports2.CancelConfiguration = Configuration_js_1.Configuration.create("cancel", { handler: { macro: ["cancel"] } });
      })(CancelConfiguration);
      return CancelConfiguration;
    }
    var CasesConfiguration = {};
    var EmpheqUtil = {};
    var hasRequiredEmpheqUtil;
    function requireEmpheqUtil() {
      if (hasRequiredEmpheqUtil) return EmpheqUtil;
      hasRequiredEmpheqUtil = 1;
      (function(exports2) {
        var __read2 = EmpheqUtil && EmpheqUtil.__read || function(o, n) {
          var m = typeof Symbol === "function" && o[Symbol.iterator];
          if (!m) return o;
          var i2 = m.call(o), r2, ar2 = [], e;
          try {
            while ((n === void 0 || n-- > 0) && !(r2 = i2.next()).done) ar2.push(r2.value);
          } catch (error2) {
            e = { error: error2 };
          } finally {
            try {
              if (r2 && !r2.done && (m = i2["return"])) m.call(i2);
            } finally {
              if (e) throw e.error;
            }
          }
          return ar2;
        };
        var __spreadArray2 = EmpheqUtil && EmpheqUtil.__spreadArray || function(to2, from, pack) {
          if (pack || arguments.length === 2) for (var i2 = 0, l = from.length, ar2; i2 < l; i2++) {
            if (ar2 || !(i2 in from)) {
              if (!ar2) ar2 = Array.prototype.slice.call(from, 0, i2);
              ar2[i2] = from[i2];
            }
          }
          return to2.concat(ar2 || Array.prototype.slice.call(from));
        };
        var __values2 = EmpheqUtil && EmpheqUtil.__values || function(o) {
          var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i2 = 0;
          if (m) return m.call(o);
          if (o && typeof o.length === "number") return {
            next: function() {
              if (o && i2 >= o.length) o = void 0;
              return { value: o && o[i2++], done: !o };
            }
          };
          throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
        };
        var __importDefault2 = EmpheqUtil && EmpheqUtil.__importDefault || function(mod2) {
          return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
        };
        Object.defineProperty(exports2, "__esModule", { value: true });
        exports2.EmpheqUtil = void 0;
        var ParseUtil_js_1 = __importDefault2(requireParseUtil());
        var TexParser_js_1 = __importDefault2(requireTexParser());
        exports2.EmpheqUtil = {
          environment: function(parser2, env, func, args2) {
            var name2 = args2[0];
            var item2 = parser2.itemFactory.create(name2 + "-begin").setProperties({ name: env, end: name2 });
            parser2.Push(func.apply(void 0, __spreadArray2([parser2, item2], __read2(args2.slice(1)), false)));
          },
          splitOptions: function(text2, allowed) {
            if (allowed === void 0) {
              allowed = null;
            }
            return ParseUtil_js_1.default.keyvalOptions(text2, allowed, true);
          },
          columnCount: function(table2) {
            var e_1, _a2;
            var m = 0;
            try {
              for (var _b2 = __values2(table2.childNodes), _c = _b2.next(); !_c.done; _c = _b2.next()) {
                var row2 = _c.value;
                var n = row2.childNodes.length - (row2.isKind("mlabeledtr") ? 1 : 0);
                if (n > m)
                  m = n;
              }
            } catch (e_1_1) {
              e_1 = { error: e_1_1 };
            } finally {
              try {
                if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
              } finally {
                if (e_1) throw e_1.error;
              }
            }
            return m;
          },
          cellBlock: function(tex2, table2, parser2, env) {
            var e_2, _a2;
            var mpadded2 = parser2.create("node", "mpadded", [], { height: 0, depth: 0, voffset: "-1height" });
            var result2 = new TexParser_js_1.default(tex2, parser2.stack.env, parser2.configuration);
            var mml = result2.mml();
            if (env && result2.configuration.tags.label) {
              result2.configuration.tags.currentTag.env = env;
              result2.configuration.tags.getTag(true);
            }
            try {
              for (var _b2 = __values2(mml.isInferred ? mml.childNodes : [mml]), _c = _b2.next(); !_c.done; _c = _b2.next()) {
                var child = _c.value;
                mpadded2.appendChild(child);
              }
            } catch (e_2_1) {
              e_2 = { error: e_2_1 };
            } finally {
              try {
                if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
              } finally {
                if (e_2) throw e_2.error;
              }
            }
            mpadded2.appendChild(parser2.create("node", "mphantom", [
              parser2.create("node", "mpadded", [table2], { width: 0 })
            ]));
            return mpadded2;
          },
          topRowTable: function(original, parser2) {
            var table2 = ParseUtil_js_1.default.copyNode(original, parser2);
            table2.setChildren(table2.childNodes.slice(0, 1));
            table2.attributes.set("align", "baseline 1");
            return original.factory.create("mphantom", {}, [parser2.create("node", "mpadded", [table2], { width: 0 })]);
          },
          rowspanCell: function(mtd2, tex2, table2, parser2, env) {
            mtd2.appendChild(parser2.create("node", "mpadded", [
              this.cellBlock(tex2, ParseUtil_js_1.default.copyNode(table2, parser2), parser2, env),
              this.topRowTable(table2, parser2)
            ], { height: 0, depth: 0, voffset: "height" }));
          },
          left: function(table2, original, left2, parser2, env) {
            var e_3, _a2;
            if (env === void 0) {
              env = "";
            }
            table2.attributes.set("columnalign", "right " + (table2.attributes.get("columnalign") || ""));
            table2.attributes.set("columnspacing", "0em " + (table2.attributes.get("columnspacing") || ""));
            var mtd2;
            try {
              for (var _b2 = __values2(table2.childNodes.slice(0).reverse()), _c = _b2.next(); !_c.done; _c = _b2.next()) {
                var row2 = _c.value;
                mtd2 = parser2.create("node", "mtd");
                row2.childNodes.unshift(mtd2);
                mtd2.parent = row2;
                if (row2.isKind("mlabeledtr")) {
                  row2.childNodes[0] = row2.childNodes[1];
                  row2.childNodes[1] = mtd2;
                }
              }
            } catch (e_3_1) {
              e_3 = { error: e_3_1 };
            } finally {
              try {
                if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
              } finally {
                if (e_3) throw e_3.error;
              }
            }
            this.rowspanCell(mtd2, left2, original, parser2, env);
          },
          right: function(table2, original, right2, parser2, env) {
            if (env === void 0) {
              env = "";
            }
            if (table2.childNodes.length === 0) {
              table2.appendChild(parser2.create("node", "mtr"));
            }
            var m = exports2.EmpheqUtil.columnCount(table2);
            var row2 = table2.childNodes[0];
            while (row2.childNodes.length < m)
              row2.appendChild(parser2.create("node", "mtd"));
            var mtd2 = row2.appendChild(parser2.create("node", "mtd"));
            exports2.EmpheqUtil.rowspanCell(mtd2, right2, original, parser2, env);
            table2.attributes.set("columnalign", (table2.attributes.get("columnalign") || "").split(/ /).slice(0, m).join(" ") + " left");
            table2.attributes.set("columnspacing", (table2.attributes.get("columnspacing") || "").split(/ /).slice(0, m - 1).join(" ") + " 0em");
          },
          adjustTable: function(empheq, parser2) {
            var left2 = empheq.getProperty("left");
            var right2 = empheq.getProperty("right");
            if (left2 || right2) {
              var table2 = empheq.Last;
              var original = ParseUtil_js_1.default.copyNode(table2, parser2);
              if (left2)
                this.left(table2, original, left2, parser2);
              if (right2)
                this.right(table2, original, right2, parser2);
            }
          },
          allowEnv: {
            equation: true,
            align: true,
            gather: true,
            flalign: true,
            alignat: true,
            multline: true
          },
          checkEnv: function(env) {
            return this.allowEnv.hasOwnProperty(env.replace(/\*$/, "")) || false;
          }
        };
      })(EmpheqUtil);
      return EmpheqUtil;
    }
    var hasRequiredCasesConfiguration;
    function requireCasesConfiguration() {
      if (hasRequiredCasesConfiguration) return CasesConfiguration;
      hasRequiredCasesConfiguration = 1;
      (function(exports2) {
        var __extends2 = CasesConfiguration && CasesConfiguration.__extends || /* @__PURE__ */ (function() {
          var extendStatics2 = function(d, b) {
            extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
              d2.__proto__ = b2;
            } || function(d2, b2) {
              for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
            };
            return extendStatics2(d, b);
          };
          return function(d, b) {
            if (typeof b !== "function" && b !== null)
              throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
            extendStatics2(d, b);
            function __() {
              this.constructor = d;
            }
            d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
          };
        })();
        var __importDefault2 = CasesConfiguration && CasesConfiguration.__importDefault || function(mod2) {
          return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
        };
        var _a2;
        Object.defineProperty(exports2, "__esModule", { value: true });
        exports2.CasesConfiguration = exports2.CasesMethods = exports2.CasesTags = exports2.CasesBeginItem = void 0;
        var Configuration_js_1 = requireConfiguration();
        var SymbolMap_js_1 = requireSymbolMap();
        var ParseUtil_js_1 = __importDefault2(requireParseUtil());
        var BaseMethods_js_1 = __importDefault2(requireBaseMethods());
        var TexError_js_1 = __importDefault2(requireTexError());
        var BaseItems_js_1 = requireBaseItems();
        var AmsConfiguration_js_1 = requireAmsConfiguration();
        var EmpheqUtil_js_1 = requireEmpheqUtil();
        var CasesBeginItem = (function(_super) {
          __extends2(CasesBeginItem2, _super);
          function CasesBeginItem2() {
            return _super !== null && _super.apply(this, arguments) || this;
          }
          Object.defineProperty(CasesBeginItem2.prototype, "kind", {
            get: function() {
              return "cases-begin";
            },
            enumerable: false,
            configurable: true
          });
          CasesBeginItem2.prototype.checkItem = function(item2) {
            if (item2.isKind("end") && item2.getName() === this.getName()) {
              if (this.getProperty("end")) {
                this.setProperty("end", false);
                return [[], true];
              }
            }
            return _super.prototype.checkItem.call(this, item2);
          };
          return CasesBeginItem2;
        })(BaseItems_js_1.BeginItem);
        exports2.CasesBeginItem = CasesBeginItem;
        var CasesTags = (function(_super) {
          __extends2(CasesTags2, _super);
          function CasesTags2() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this.subcounter = 0;
            return _this;
          }
          CasesTags2.prototype.start = function(env, taggable, defaultTags) {
            this.subcounter = 0;
            _super.prototype.start.call(this, env, taggable, defaultTags);
          };
          CasesTags2.prototype.autoTag = function() {
            if (this.currentTag.tag != null)
              return;
            if (this.currentTag.env === "subnumcases") {
              if (this.subcounter === 0)
                this.counter++;
              this.subcounter++;
              this.tag(this.formatNumber(this.counter, this.subcounter), false);
            } else {
              if (this.subcounter === 0 || this.currentTag.env !== "numcases-left")
                this.counter++;
              this.tag(this.formatNumber(this.counter), false);
            }
          };
          CasesTags2.prototype.formatNumber = function(n, m) {
            if (m === void 0) {
              m = null;
            }
            return n.toString() + (m === null ? "" : String.fromCharCode(96 + m));
          };
          return CasesTags2;
        })(AmsConfiguration_js_1.AmsTags);
        exports2.CasesTags = CasesTags;
        exports2.CasesMethods = {
          NumCases: function(parser2, begin) {
            if (parser2.stack.env.closing === begin.getName()) {
              delete parser2.stack.env.closing;
              parser2.Push(parser2.itemFactory.create("end").setProperty("name", begin.getName()));
              var cases = parser2.stack.Top();
              var table2 = cases.Last;
              var original = ParseUtil_js_1.default.copyNode(table2, parser2);
              var left2 = cases.getProperty("left");
              EmpheqUtil_js_1.EmpheqUtil.left(table2, original, left2 + "\\empheqlbrace\\,", parser2, "numcases-left");
              parser2.Push(parser2.itemFactory.create("end").setProperty("name", begin.getName()));
              return null;
            } else {
              var left2 = parser2.GetArgument("\\begin{" + begin.getName() + "}");
              begin.setProperty("left", left2);
              var array = BaseMethods_js_1.default.EqnArray(parser2, begin, true, true, "ll");
              array.arraydef.displaystyle = false;
              array.arraydef.rowspacing = ".2em";
              array.setProperty("numCases", true);
              parser2.Push(begin);
              return array;
            }
          },
          Entry: function(parser2, name2) {
            if (!parser2.stack.Top().getProperty("numCases")) {
              return BaseMethods_js_1.default.Entry(parser2, name2);
            }
            parser2.Push(parser2.itemFactory.create("cell").setProperties({ isEntry: true, name: name2 }));
            var tex2 = parser2.string;
            var braces = 0, i2 = parser2.i, m = tex2.length;
            while (i2 < m) {
              var c2 = tex2.charAt(i2);
              if (c2 === "{") {
                braces++;
                i2++;
              } else if (c2 === "}") {
                if (braces === 0) {
                  break;
                } else {
                  braces--;
                  i2++;
                }
              } else if (c2 === "&" && braces === 0) {
                throw new TexError_js_1.default("ExtraCasesAlignTab", "Extra alignment tab in text for numcase environment");
              } else if (c2 === "\\" && braces === 0) {
                var cs = (tex2.slice(i2 + 1).match(/^[a-z]+|./i) || [])[0];
                if (cs === "\\" || cs === "cr" || cs === "end" || cs === "label") {
                  break;
                } else {
                  i2 += cs.length;
                }
              } else {
                i2++;
              }
            }
            var text2 = tex2.substr(parser2.i, i2 - parser2.i).replace(/^\s*/, "");
            parser2.PushAll(ParseUtil_js_1.default.internalMath(parser2, text2, 0));
            parser2.i = i2;
          }
        };
        new SymbolMap_js_1.EnvironmentMap("cases-env", EmpheqUtil_js_1.EmpheqUtil.environment, {
          numcases: ["NumCases", "cases"],
          subnumcases: ["NumCases", "cases"]
        }, exports2.CasesMethods);
        new SymbolMap_js_1.MacroMap("cases-macros", {
          "&": "Entry"
        }, exports2.CasesMethods);
        exports2.CasesConfiguration = Configuration_js_1.Configuration.create("cases", {
          handler: {
            environment: ["cases-env"],
            character: ["cases-macros"]
          },
          items: (_a2 = {}, _a2[CasesBeginItem.prototype.kind] = CasesBeginItem, _a2),
          tags: { "cases": CasesTags }
        });
      })(CasesConfiguration);
      return CasesConfiguration;
    }
    var CenternotConfiguration = {};
    var hasRequiredCenternotConfiguration;
    function requireCenternotConfiguration() {
      if (hasRequiredCenternotConfiguration) return CenternotConfiguration;
      hasRequiredCenternotConfiguration = 1;
      var __values2 = CenternotConfiguration && CenternotConfiguration.__values || function(o) {
        var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i2 = 0;
        if (m) return m.call(o);
        if (o && typeof o.length === "number") return {
          next: function() {
            if (o && i2 >= o.length) o = void 0;
            return { value: o && o[i2++], done: !o };
          }
        };
        throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
      };
      var __importDefault2 = CenternotConfiguration && CenternotConfiguration.__importDefault || function(mod2) {
        return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
      };
      Object.defineProperty(CenternotConfiguration, "__esModule", { value: true });
      CenternotConfiguration.CenternotConfiguration = CenternotConfiguration.filterCenterOver = void 0;
      var Configuration_js_1 = requireConfiguration();
      var TexParser_js_1 = __importDefault2(requireTexParser());
      var NodeUtil_js_1 = __importDefault2(requireNodeUtil());
      var SymbolMap_js_1 = requireSymbolMap();
      var BaseMethods_js_1 = __importDefault2(requireBaseMethods());
      new SymbolMap_js_1.CommandMap("centernot", {
        centerOver: "CenterOver",
        centernot: ["Macro", "\\centerOver{#1}{{⧸}}", 1]
      }, {
        CenterOver: function(parser2, name2) {
          var arg = "{" + parser2.GetArgument(name2) + "}";
          var over = parser2.ParseArg(name2);
          var base2 = new TexParser_js_1.default(arg, parser2.stack.env, parser2.configuration).mml();
          var mml = parser2.create("node", "TeXAtom", [
            new TexParser_js_1.default(arg, parser2.stack.env, parser2.configuration).mml(),
            parser2.create("node", "mpadded", [
              parser2.create("node", "mpadded", [over], { width: 0, lspace: "-.5width" }),
              parser2.create("node", "mphantom", [base2])
            ], { width: 0, lspace: "-.5width" })
          ]);
          parser2.configuration.addNode("centerOver", base2);
          parser2.Push(mml);
        },
        Macro: BaseMethods_js_1.default.Macro
      });
      function filterCenterOver(_a2) {
        var e_1, _b2;
        var data = _a2.data;
        try {
          for (var _c = __values2(data.getList("centerOver")), _d = _c.next(); !_d.done; _d = _c.next()) {
            var base2 = _d.value;
            var texClass = NodeUtil_js_1.default.getTexClass(base2.childNodes[0].childNodes[0]);
            if (texClass !== null) {
              NodeUtil_js_1.default.setProperties(base2.parent.parent.parent.parent.parent.parent, { texClass });
            }
          }
        } catch (e_1_1) {
          e_1 = { error: e_1_1 };
        } finally {
          try {
            if (_d && !_d.done && (_b2 = _c.return)) _b2.call(_c);
          } finally {
            if (e_1) throw e_1.error;
          }
        }
      }
      CenternotConfiguration.filterCenterOver = filterCenterOver;
      CenternotConfiguration.CenternotConfiguration = Configuration_js_1.Configuration.create("centernot", {
        handler: { macro: ["centernot"] },
        postprocessors: [filterCenterOver]
      });
      return CenternotConfiguration;
    }
    var ColorConfiguration = {};
    var ColorMethods = {};
    var hasRequiredColorMethods;
    function requireColorMethods() {
      if (hasRequiredColorMethods) return ColorMethods;
      hasRequiredColorMethods = 1;
      (function(exports2) {
        var __importDefault2 = ColorMethods && ColorMethods.__importDefault || function(mod2) {
          return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
        };
        Object.defineProperty(exports2, "__esModule", { value: true });
        exports2.ColorMethods = void 0;
        var NodeUtil_js_1 = __importDefault2(requireNodeUtil());
        var ParseUtil_js_1 = __importDefault2(requireParseUtil());
        function padding(colorPadding) {
          var pad = "+".concat(colorPadding);
          var unit = colorPadding.replace(/^.*?([a-z]*)$/, "$1");
          var pad2 = 2 * parseFloat(pad);
          return {
            width: "+".concat(pad2).concat(unit),
            height: pad,
            depth: pad,
            lspace: colorPadding
          };
        }
        exports2.ColorMethods = {};
        exports2.ColorMethods.Color = function(parser2, name2) {
          var model2 = parser2.GetBrackets(name2, "");
          var colorDef = parser2.GetArgument(name2);
          var colorModel = parser2.configuration.packageData.get("color").model;
          var color = colorModel.getColor(model2, colorDef);
          var style2 = parser2.itemFactory.create("style").setProperties({ styles: { mathcolor: color } });
          parser2.stack.env["color"] = color;
          parser2.Push(style2);
        };
        exports2.ColorMethods.TextColor = function(parser2, name2) {
          var model2 = parser2.GetBrackets(name2, "");
          var colorDef = parser2.GetArgument(name2);
          var colorModel = parser2.configuration.packageData.get("color").model;
          var color = colorModel.getColor(model2, colorDef);
          var old = parser2.stack.env["color"];
          parser2.stack.env["color"] = color;
          var math2 = parser2.ParseArg(name2);
          if (old) {
            parser2.stack.env["color"] = old;
          } else {
            delete parser2.stack.env["color"];
          }
          var node2 = parser2.create("node", "mstyle", [math2], { mathcolor: color });
          parser2.Push(node2);
        };
        exports2.ColorMethods.DefineColor = function(parser2, name2) {
          var cname = parser2.GetArgument(name2);
          var model2 = parser2.GetArgument(name2);
          var def = parser2.GetArgument(name2);
          var colorModel = parser2.configuration.packageData.get("color").model;
          colorModel.defineColor(model2, cname, def);
        };
        exports2.ColorMethods.ColorBox = function(parser2, name2) {
          var cname = parser2.GetArgument(name2);
          var math2 = ParseUtil_js_1.default.internalMath(parser2, parser2.GetArgument(name2));
          var colorModel = parser2.configuration.packageData.get("color").model;
          var node2 = parser2.create("node", "mpadded", math2, {
            mathbackground: colorModel.getColor("named", cname)
          });
          NodeUtil_js_1.default.setProperties(node2, padding(parser2.options.color.padding));
          parser2.Push(node2);
        };
        exports2.ColorMethods.FColorBox = function(parser2, name2) {
          var fname = parser2.GetArgument(name2);
          var cname = parser2.GetArgument(name2);
          var math2 = ParseUtil_js_1.default.internalMath(parser2, parser2.GetArgument(name2));
          var options2 = parser2.options.color;
          var colorModel = parser2.configuration.packageData.get("color").model;
          var node2 = parser2.create("node", "mpadded", math2, {
            mathbackground: colorModel.getColor("named", cname),
            style: "border: ".concat(options2.borderWidth, " solid ").concat(colorModel.getColor("named", fname))
          });
          NodeUtil_js_1.default.setProperties(node2, padding(options2.padding));
          parser2.Push(node2);
        };
      })(ColorMethods);
      return ColorMethods;
    }
    var ColorUtil = {};
    var ColorConstants = {};
    var hasRequiredColorConstants;
    function requireColorConstants() {
      if (hasRequiredColorConstants) return ColorConstants;
      hasRequiredColorConstants = 1;
      Object.defineProperty(ColorConstants, "__esModule", { value: true });
      ColorConstants.COLORS = void 0;
      ColorConstants.COLORS = /* @__PURE__ */ new Map([
        ["Apricot", "#FBB982"],
        ["Aquamarine", "#00B5BE"],
        ["Bittersweet", "#C04F17"],
        ["Black", "#221E1F"],
        ["Blue", "#2D2F92"],
        ["BlueGreen", "#00B3B8"],
        ["BlueViolet", "#473992"],
        ["BrickRed", "#B6321C"],
        ["Brown", "#792500"],
        ["BurntOrange", "#F7921D"],
        ["CadetBlue", "#74729A"],
        ["CarnationPink", "#F282B4"],
        ["Cerulean", "#00A2E3"],
        ["CornflowerBlue", "#41B0E4"],
        ["Cyan", "#00AEEF"],
        ["Dandelion", "#FDBC42"],
        ["DarkOrchid", "#A4538A"],
        ["Emerald", "#00A99D"],
        ["ForestGreen", "#009B55"],
        ["Fuchsia", "#8C368C"],
        ["Goldenrod", "#FFDF42"],
        ["Gray", "#949698"],
        ["Green", "#00A64F"],
        ["GreenYellow", "#DFE674"],
        ["JungleGreen", "#00A99A"],
        ["Lavender", "#F49EC4"],
        ["LimeGreen", "#8DC73E"],
        ["Magenta", "#EC008C"],
        ["Mahogany", "#A9341F"],
        ["Maroon", "#AF3235"],
        ["Melon", "#F89E7B"],
        ["MidnightBlue", "#006795"],
        ["Mulberry", "#A93C93"],
        ["NavyBlue", "#006EB8"],
        ["OliveGreen", "#3C8031"],
        ["Orange", "#F58137"],
        ["OrangeRed", "#ED135A"],
        ["Orchid", "#AF72B0"],
        ["Peach", "#F7965A"],
        ["Periwinkle", "#7977B8"],
        ["PineGreen", "#008B72"],
        ["Plum", "#92268F"],
        ["ProcessBlue", "#00B0F0"],
        ["Purple", "#99479B"],
        ["RawSienna", "#974006"],
        ["Red", "#ED1B23"],
        ["RedOrange", "#F26035"],
        ["RedViolet", "#A1246B"],
        ["Rhodamine", "#EF559F"],
        ["RoyalBlue", "#0071BC"],
        ["RoyalPurple", "#613F99"],
        ["RubineRed", "#ED017D"],
        ["Salmon", "#F69289"],
        ["SeaGreen", "#3FBC9D"],
        ["Sepia", "#671800"],
        ["SkyBlue", "#46C5DD"],
        ["SpringGreen", "#C6DC67"],
        ["Tan", "#DA9D76"],
        ["TealBlue", "#00AEB3"],
        ["Thistle", "#D883B7"],
        ["Turquoise", "#00B4CE"],
        ["Violet", "#58429B"],
        ["VioletRed", "#EF58A0"],
        ["White", "#FFFFFF"],
        ["WildStrawberry", "#EE2967"],
        ["Yellow", "#FFF200"],
        ["YellowGreen", "#98CC70"],
        ["YellowOrange", "#FAA21A"]
      ]);
      return ColorConstants;
    }
    var hasRequiredColorUtil;
    function requireColorUtil() {
      if (hasRequiredColorUtil) return ColorUtil;
      hasRequiredColorUtil = 1;
      var __values2 = ColorUtil && ColorUtil.__values || function(o) {
        var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i2 = 0;
        if (m) return m.call(o);
        if (o && typeof o.length === "number") return {
          next: function() {
            if (o && i2 >= o.length) o = void 0;
            return { value: o && o[i2++], done: !o };
          }
        };
        throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
      };
      var __importDefault2 = ColorUtil && ColorUtil.__importDefault || function(mod2) {
        return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
      };
      Object.defineProperty(ColorUtil, "__esModule", { value: true });
      ColorUtil.ColorModel = void 0;
      var TexError_js_1 = __importDefault2(requireTexError());
      var ColorConstants_js_1 = requireColorConstants();
      var ColorModelProcessors = /* @__PURE__ */ new Map();
      var ColorModel = (function() {
        function ColorModel2() {
          this.userColors = /* @__PURE__ */ new Map();
        }
        ColorModel2.prototype.normalizeColor = function(model2, def) {
          if (!model2 || model2 === "named") {
            return def;
          }
          if (ColorModelProcessors.has(model2)) {
            var modelProcessor = ColorModelProcessors.get(model2);
            return modelProcessor(def);
          }
          throw new TexError_js_1.default("UndefinedColorModel", "Color model '%1' not defined", model2);
        };
        ColorModel2.prototype.getColor = function(model2, def) {
          if (!model2 || model2 === "named") {
            return this.getColorByName(def);
          }
          return this.normalizeColor(model2, def);
        };
        ColorModel2.prototype.getColorByName = function(name2) {
          if (this.userColors.has(name2)) {
            return this.userColors.get(name2);
          }
          if (ColorConstants_js_1.COLORS.has(name2)) {
            return ColorConstants_js_1.COLORS.get(name2);
          }
          return name2;
        };
        ColorModel2.prototype.defineColor = function(model2, name2, def) {
          var normalized = this.normalizeColor(model2, def);
          this.userColors.set(name2, normalized);
        };
        return ColorModel2;
      })();
      ColorUtil.ColorModel = ColorModel;
      ColorModelProcessors.set("rgb", function(rgb) {
        var e_1, _a2;
        var rgbParts = rgb.trim().split(/\s*,\s*/);
        var RGB = "#";
        if (rgbParts.length !== 3) {
          throw new TexError_js_1.default("ModelArg1", "Color values for the %1 model require 3 numbers", "rgb");
        }
        try {
          for (var rgbParts_1 = __values2(rgbParts), rgbParts_1_1 = rgbParts_1.next(); !rgbParts_1_1.done; rgbParts_1_1 = rgbParts_1.next()) {
            var rgbPart = rgbParts_1_1.value;
            if (!rgbPart.match(/^(\d+(\.\d*)?|\.\d+)$/)) {
              throw new TexError_js_1.default("InvalidDecimalNumber", "Invalid decimal number");
            }
            var n = parseFloat(rgbPart);
            if (n < 0 || n > 1) {
              throw new TexError_js_1.default("ModelArg2", "Color values for the %1 model must be between %2 and %3", "rgb", "0", "1");
            }
            var pn2 = Math.floor(n * 255).toString(16);
            if (pn2.length < 2) {
              pn2 = "0" + pn2;
            }
            RGB += pn2;
          }
        } catch (e_1_1) {
          e_1 = { error: e_1_1 };
        } finally {
          try {
            if (rgbParts_1_1 && !rgbParts_1_1.done && (_a2 = rgbParts_1.return)) _a2.call(rgbParts_1);
          } finally {
            if (e_1) throw e_1.error;
          }
        }
        return RGB;
      });
      ColorModelProcessors.set("RGB", function(rgb) {
        var e_2, _a2;
        var rgbParts = rgb.trim().split(/\s*,\s*/);
        var RGB = "#";
        if (rgbParts.length !== 3) {
          throw new TexError_js_1.default("ModelArg1", "Color values for the %1 model require 3 numbers", "RGB");
        }
        try {
          for (var rgbParts_2 = __values2(rgbParts), rgbParts_2_1 = rgbParts_2.next(); !rgbParts_2_1.done; rgbParts_2_1 = rgbParts_2.next()) {
            var rgbPart = rgbParts_2_1.value;
            if (!rgbPart.match(/^\d+$/)) {
              throw new TexError_js_1.default("InvalidNumber", "Invalid number");
            }
            var n = parseInt(rgbPart);
            if (n > 255) {
              throw new TexError_js_1.default("ModelArg2", "Color values for the %1 model must be between %2 and %3", "RGB", "0", "255");
            }
            var pn2 = n.toString(16);
            if (pn2.length < 2) {
              pn2 = "0" + pn2;
            }
            RGB += pn2;
          }
        } catch (e_2_1) {
          e_2 = { error: e_2_1 };
        } finally {
          try {
            if (rgbParts_2_1 && !rgbParts_2_1.done && (_a2 = rgbParts_2.return)) _a2.call(rgbParts_2);
          } finally {
            if (e_2) throw e_2.error;
          }
        }
        return RGB;
      });
      ColorModelProcessors.set("gray", function(gray) {
        if (!gray.match(/^\s*(\d+(\.\d*)?|\.\d+)\s*$/)) {
          throw new TexError_js_1.default("InvalidDecimalNumber", "Invalid decimal number");
        }
        var n = parseFloat(gray);
        if (n < 0 || n > 1) {
          throw new TexError_js_1.default("ModelArg2", "Color values for the %1 model must be between %2 and %3", "gray", "0", "1");
        }
        var pn2 = Math.floor(n * 255).toString(16);
        if (pn2.length < 2) {
          pn2 = "0" + pn2;
        }
        return "#".concat(pn2).concat(pn2).concat(pn2);
      });
      return ColorUtil;
    }
    var hasRequiredColorConfiguration;
    function requireColorConfiguration() {
      if (hasRequiredColorConfiguration) return ColorConfiguration;
      hasRequiredColorConfiguration = 1;
      Object.defineProperty(ColorConfiguration, "__esModule", { value: true });
      ColorConfiguration.ColorConfiguration = void 0;
      var SymbolMap_js_1 = requireSymbolMap();
      var Configuration_js_1 = requireConfiguration();
      var ColorMethods_js_1 = requireColorMethods();
      var ColorUtil_js_1 = requireColorUtil();
      new SymbolMap_js_1.CommandMap("color", {
        color: "Color",
        textcolor: "TextColor",
        definecolor: "DefineColor",
        colorbox: "ColorBox",
        fcolorbox: "FColorBox"
      }, ColorMethods_js_1.ColorMethods);
      var config2 = function(_config, jax) {
        jax.parseOptions.packageData.set("color", { model: new ColorUtil_js_1.ColorModel() });
      };
      ColorConfiguration.ColorConfiguration = Configuration_js_1.Configuration.create("color", {
        handler: {
          macro: ["color"]
        },
        options: {
          color: {
            padding: "5px",
            borderWidth: "2px"
          }
        },
        config: config2
      });
      return ColorConfiguration;
    }
    var ColorV2Configuration = {};
    var hasRequiredColorV2Configuration;
    function requireColorV2Configuration() {
      if (hasRequiredColorV2Configuration) return ColorV2Configuration;
      hasRequiredColorV2Configuration = 1;
      (function(exports2) {
        Object.defineProperty(exports2, "__esModule", { value: true });
        exports2.ColorConfiguration = exports2.ColorV2Methods = void 0;
        var SymbolMap_js_1 = requireSymbolMap();
        var Configuration_js_1 = requireConfiguration();
        exports2.ColorV2Methods = {
          Color: function(parser2, name2) {
            var color = parser2.GetArgument(name2);
            var old = parser2.stack.env["color"];
            parser2.stack.env["color"] = color;
            var math2 = parser2.ParseArg(name2);
            if (old) {
              parser2.stack.env["color"] = old;
            } else {
              delete parser2.stack.env["color"];
            }
            var node2 = parser2.create("node", "mstyle", [math2], { mathcolor: color });
            parser2.Push(node2);
          }
        };
        new SymbolMap_js_1.CommandMap("colorv2", { color: "Color" }, exports2.ColorV2Methods);
        exports2.ColorConfiguration = Configuration_js_1.Configuration.create("colorv2", { handler: { macro: ["colorv2"] } });
      })(ColorV2Configuration);
      return ColorV2Configuration;
    }
    var ColortblConfiguration = {};
    var hasRequiredColortblConfiguration;
    function requireColortblConfiguration() {
      if (hasRequiredColortblConfiguration) return ColortblConfiguration;
      hasRequiredColortblConfiguration = 1;
      var __extends2 = ColortblConfiguration && ColortblConfiguration.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      var __importDefault2 = ColortblConfiguration && ColortblConfiguration.__importDefault || function(mod2) {
        return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
      };
      Object.defineProperty(ColortblConfiguration, "__esModule", { value: true });
      ColortblConfiguration.ColortblConfiguration = ColortblConfiguration.ColorArrayItem = void 0;
      var BaseItems_js_1 = requireBaseItems();
      var Configuration_js_1 = requireConfiguration();
      var SymbolMap_js_1 = requireSymbolMap();
      var TexError_js_1 = __importDefault2(requireTexError());
      var ColorArrayItem = (function(_super) {
        __extends2(ColorArrayItem2, _super);
        function ColorArrayItem2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.color = {
            cell: "",
            row: "",
            col: []
          };
          _this.hasColor = false;
          return _this;
        }
        ColorArrayItem2.prototype.EndEntry = function() {
          _super.prototype.EndEntry.call(this);
          var cell2 = this.row[this.row.length - 1];
          var color = this.color.cell || this.color.row || this.color.col[this.row.length - 1];
          if (color) {
            cell2.attributes.set("mathbackground", color);
            this.color.cell = "";
            this.hasColor = true;
          }
        };
        ColorArrayItem2.prototype.EndRow = function() {
          _super.prototype.EndRow.call(this);
          this.color.row = "";
        };
        ColorArrayItem2.prototype.createMml = function() {
          var mml = _super.prototype.createMml.call(this);
          var table2 = mml.isKind("mrow") ? mml.childNodes[1] : mml;
          if (table2.isKind("menclose")) {
            table2 = table2.childNodes[0].childNodes[0];
          }
          if (this.hasColor && table2.attributes.get("frame") === "none") {
            table2.attributes.set("frame", "");
          }
          return mml;
        };
        return ColorArrayItem2;
      })(BaseItems_js_1.ArrayItem);
      ColortblConfiguration.ColorArrayItem = ColorArrayItem;
      new SymbolMap_js_1.CommandMap("colortbl", {
        cellcolor: ["TableColor", "cell"],
        rowcolor: ["TableColor", "row"],
        columncolor: ["TableColor", "col"]
      }, {
        TableColor: function(parser2, name2, type) {
          var lookup = parser2.configuration.packageData.get("color").model;
          var model2 = parser2.GetBrackets(name2, "");
          var color = lookup.getColor(model2, parser2.GetArgument(name2));
          var top2 = parser2.stack.Top();
          if (!(top2 instanceof ColorArrayItem)) {
            throw new TexError_js_1.default("UnsupportedTableColor", "Unsupported use of %1", parser2.currentCS);
          }
          if (type === "col") {
            if (top2.table.length) {
              throw new TexError_js_1.default("ColumnColorNotTop", "%1 must be in the top row", name2);
            }
            top2.color.col[top2.row.length] = color;
            if (parser2.GetBrackets(name2, "")) {
              parser2.GetBrackets(name2, "");
            }
          } else {
            top2.color[type] = color;
            if (type === "row" && (top2.Size() || top2.row.length)) {
              throw new TexError_js_1.default("RowColorNotFirst", "%1 must be at the beginning of a row", name2);
            }
          }
        }
      });
      var config2 = function(config3, jax) {
        if (!jax.parseOptions.packageData.has("color")) {
          Configuration_js_1.ConfigurationHandler.get("color").config(config3, jax);
        }
      };
      ColortblConfiguration.ColortblConfiguration = Configuration_js_1.Configuration.create("colortbl", {
        handler: { macro: ["colortbl"] },
        items: { "array": ColorArrayItem },
        priority: 10,
        config: [config2, 10]
      });
      return ColortblConfiguration;
    }
    var ConfigMacrosConfiguration = {};
    var NewcommandMethods = {};
    var NewcommandUtil = {};
    var hasRequiredNewcommandUtil;
    function requireNewcommandUtil() {
      if (hasRequiredNewcommandUtil) return NewcommandUtil;
      hasRequiredNewcommandUtil = 1;
      var __importDefault2 = NewcommandUtil && NewcommandUtil.__importDefault || function(mod2) {
        return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
      };
      Object.defineProperty(NewcommandUtil, "__esModule", { value: true });
      var ParseUtil_js_1 = __importDefault2(requireParseUtil());
      var TexError_js_1 = __importDefault2(requireTexError());
      var Symbol_js_1 = require_Symbol();
      var NewcommandUtil$1;
      (function(NewcommandUtil2) {
        function disassembleSymbol(name2, symbol) {
          var newArgs = [name2, symbol.char];
          if (symbol.attributes) {
            for (var key2 in symbol.attributes) {
              newArgs.push(key2);
              newArgs.push(symbol.attributes[key2]);
            }
          }
          return newArgs;
        }
        NewcommandUtil2.disassembleSymbol = disassembleSymbol;
        function assembleSymbol(args2) {
          var name2 = args2[0];
          var char = args2[1];
          var attrs = {};
          for (var i2 = 2; i2 < args2.length; i2 = i2 + 2) {
            attrs[args2[i2]] = args2[i2 + 1];
          }
          return new Symbol_js_1.Symbol(name2, char, attrs);
        }
        NewcommandUtil2.assembleSymbol = assembleSymbol;
        function GetCSname(parser2, cmd2) {
          var c2 = parser2.GetNext();
          if (c2 !== "\\") {
            throw new TexError_js_1.default("MissingCS", "%1 must be followed by a control sequence", cmd2);
          }
          var cs = ParseUtil_js_1.default.trimSpaces(parser2.GetArgument(cmd2));
          return cs.substr(1);
        }
        NewcommandUtil2.GetCSname = GetCSname;
        function GetCsNameArgument(parser2, name2) {
          var cs = ParseUtil_js_1.default.trimSpaces(parser2.GetArgument(name2));
          if (cs.charAt(0) === "\\") {
            cs = cs.substr(1);
          }
          if (!cs.match(/^(.|[a-z]+)$/i)) {
            throw new TexError_js_1.default("IllegalControlSequenceName", "Illegal control sequence name for %1", name2);
          }
          return cs;
        }
        NewcommandUtil2.GetCsNameArgument = GetCsNameArgument;
        function GetArgCount(parser2, name2) {
          var n = parser2.GetBrackets(name2);
          if (n) {
            n = ParseUtil_js_1.default.trimSpaces(n);
            if (!n.match(/^[0-9]+$/)) {
              throw new TexError_js_1.default("IllegalParamNumber", "Illegal number of parameters specified in %1", name2);
            }
          }
          return n;
        }
        NewcommandUtil2.GetArgCount = GetArgCount;
        function GetTemplate(parser2, cmd2, cs) {
          var c2 = parser2.GetNext();
          var params = [];
          var n = 0;
          var i2 = parser2.i;
          while (parser2.i < parser2.string.length) {
            c2 = parser2.GetNext();
            if (c2 === "#") {
              if (i2 !== parser2.i) {
                params[n] = parser2.string.substr(i2, parser2.i - i2);
              }
              c2 = parser2.string.charAt(++parser2.i);
              if (!c2.match(/^[1-9]$/)) {
                throw new TexError_js_1.default("CantUseHash2", "Illegal use of # in template for %1", cs);
              }
              if (parseInt(c2) !== ++n) {
                throw new TexError_js_1.default("SequentialParam", "Parameters for %1 must be numbered sequentially", cs);
              }
              i2 = parser2.i + 1;
            } else if (c2 === "{") {
              if (i2 !== parser2.i) {
                params[n] = parser2.string.substr(i2, parser2.i - i2);
              }
              if (params.length > 0) {
                return [n.toString()].concat(params);
              } else {
                return n;
              }
            }
            parser2.i++;
          }
          throw new TexError_js_1.default("MissingReplacementString", "Missing replacement string for definition of %1", cmd2);
        }
        NewcommandUtil2.GetTemplate = GetTemplate;
        function GetParameter(parser2, name2, param) {
          if (param == null) {
            return parser2.GetArgument(name2);
          }
          var i2 = parser2.i;
          var j = 0;
          var hasBraces = 0;
          while (parser2.i < parser2.string.length) {
            var c2 = parser2.string.charAt(parser2.i);
            if (c2 === "{") {
              if (parser2.i === i2) {
                hasBraces = 1;
              }
              parser2.GetArgument(name2);
              j = parser2.i - i2;
            } else if (MatchParam(parser2, param)) {
              if (hasBraces) {
                i2++;
                j -= 2;
              }
              return parser2.string.substr(i2, j);
            } else if (c2 === "\\") {
              parser2.i++;
              j++;
              hasBraces = 0;
              var match = parser2.string.substr(parser2.i).match(/[a-z]+|./i);
              if (match) {
                parser2.i += match[0].length;
                j = parser2.i - i2;
              }
            } else {
              parser2.i++;
              j++;
              hasBraces = 0;
            }
          }
          throw new TexError_js_1.default("RunawayArgument", "Runaway argument for %1?", name2);
        }
        NewcommandUtil2.GetParameter = GetParameter;
        function MatchParam(parser2, param) {
          if (parser2.string.substr(parser2.i, param.length) !== param) {
            return 0;
          }
          if (param.match(/\\[a-z]+$/i) && parser2.string.charAt(parser2.i + param.length).match(/[a-z]/i)) {
            return 0;
          }
          parser2.i += param.length;
          return 1;
        }
        NewcommandUtil2.MatchParam = MatchParam;
        function addDelimiter(parser2, cs, char, attr) {
          var handlers2 = parser2.configuration.handlers;
          var handler = handlers2.retrieve(NewcommandUtil2.NEW_DELIMITER);
          handler.add(cs, new Symbol_js_1.Symbol(cs, char, attr));
        }
        NewcommandUtil2.addDelimiter = addDelimiter;
        function addMacro(parser2, cs, func, attr, symbol) {
          if (symbol === void 0) {
            symbol = "";
          }
          var handlers2 = parser2.configuration.handlers;
          var handler = handlers2.retrieve(NewcommandUtil2.NEW_COMMAND);
          handler.add(cs, new Symbol_js_1.Macro(symbol ? symbol : cs, func, attr));
        }
        NewcommandUtil2.addMacro = addMacro;
        function addEnvironment(parser2, env, func, attr) {
          var handlers2 = parser2.configuration.handlers;
          var handler = handlers2.retrieve(NewcommandUtil2.NEW_ENVIRONMENT);
          handler.add(env, new Symbol_js_1.Macro(env, func, attr));
        }
        NewcommandUtil2.addEnvironment = addEnvironment;
        NewcommandUtil2.NEW_DELIMITER = "new-Delimiter";
        NewcommandUtil2.NEW_COMMAND = "new-Command";
        NewcommandUtil2.NEW_ENVIRONMENT = "new-Environment";
      })(NewcommandUtil$1 || (NewcommandUtil$1 = {}));
      NewcommandUtil.default = NewcommandUtil$1;
      return NewcommandUtil;
    }
    var hasRequiredNewcommandMethods;
    function requireNewcommandMethods() {
      if (hasRequiredNewcommandMethods) return NewcommandMethods;
      hasRequiredNewcommandMethods = 1;
      var __createBinding2 = NewcommandMethods && NewcommandMethods.__createBinding || (Object.create ? (function(o, m, k2, k22) {
        if (k22 === void 0) k22 = k2;
        var desc = Object.getOwnPropertyDescriptor(m, k2);
        if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
          desc = { enumerable: true, get: function() {
            return m[k2];
          } };
        }
        Object.defineProperty(o, k22, desc);
      }) : (function(o, m, k2, k22) {
        if (k22 === void 0) k22 = k2;
        o[k22] = m[k2];
      }));
      var __setModuleDefault2 = NewcommandMethods && NewcommandMethods.__setModuleDefault || (Object.create ? (function(o, v) {
        Object.defineProperty(o, "default", { enumerable: true, value: v });
      }) : function(o, v) {
        o["default"] = v;
      });
      var __importStar2 = NewcommandMethods && NewcommandMethods.__importStar || function(mod2) {
        if (mod2 && mod2.__esModule) return mod2;
        var result2 = {};
        if (mod2 != null) {
          for (var k2 in mod2) if (k2 !== "default" && Object.prototype.hasOwnProperty.call(mod2, k2)) __createBinding2(result2, mod2, k2);
        }
        __setModuleDefault2(result2, mod2);
        return result2;
      };
      var __importDefault2 = NewcommandMethods && NewcommandMethods.__importDefault || function(mod2) {
        return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
      };
      Object.defineProperty(NewcommandMethods, "__esModule", { value: true });
      var TexError_js_1 = __importDefault2(requireTexError());
      var sm = __importStar2(requireSymbolMap());
      var BaseMethods_js_1 = __importDefault2(requireBaseMethods());
      var ParseUtil_js_1 = __importDefault2(requireParseUtil());
      var NewcommandUtil_js_1 = __importDefault2(requireNewcommandUtil());
      var NewcommandMethods$1 = {};
      NewcommandMethods$1.NewCommand = function(parser2, name2) {
        var cs = NewcommandUtil_js_1.default.GetCsNameArgument(parser2, name2);
        var n = NewcommandUtil_js_1.default.GetArgCount(parser2, name2);
        var opt = parser2.GetBrackets(name2);
        var def = parser2.GetArgument(name2);
        NewcommandUtil_js_1.default.addMacro(parser2, cs, NewcommandMethods$1.Macro, [def, n, opt]);
      };
      NewcommandMethods$1.NewEnvironment = function(parser2, name2) {
        var env = ParseUtil_js_1.default.trimSpaces(parser2.GetArgument(name2));
        var n = NewcommandUtil_js_1.default.GetArgCount(parser2, name2);
        var opt = parser2.GetBrackets(name2);
        var bdef = parser2.GetArgument(name2);
        var edef = parser2.GetArgument(name2);
        NewcommandUtil_js_1.default.addEnvironment(parser2, env, NewcommandMethods$1.BeginEnv, [true, bdef, edef, n, opt]);
      };
      NewcommandMethods$1.MacroDef = function(parser2, name2) {
        var cs = NewcommandUtil_js_1.default.GetCSname(parser2, name2);
        var params = NewcommandUtil_js_1.default.GetTemplate(parser2, name2, "\\" + cs);
        var def = parser2.GetArgument(name2);
        !(params instanceof Array) ? NewcommandUtil_js_1.default.addMacro(parser2, cs, NewcommandMethods$1.Macro, [def, params]) : NewcommandUtil_js_1.default.addMacro(parser2, cs, NewcommandMethods$1.MacroWithTemplate, [def].concat(params));
      };
      NewcommandMethods$1.Let = function(parser2, name2) {
        var cs = NewcommandUtil_js_1.default.GetCSname(parser2, name2);
        var c2 = parser2.GetNext();
        if (c2 === "=") {
          parser2.i++;
          c2 = parser2.GetNext();
        }
        var handlers2 = parser2.configuration.handlers;
        if (c2 === "\\") {
          name2 = NewcommandUtil_js_1.default.GetCSname(parser2, name2);
          var macro_1 = handlers2.get("delimiter").lookup("\\" + name2);
          if (macro_1) {
            NewcommandUtil_js_1.default.addDelimiter(parser2, "\\" + cs, macro_1.char, macro_1.attributes);
            return;
          }
          var map_1 = handlers2.get("macro").applicable(name2);
          if (!map_1) {
            return;
          }
          if (map_1 instanceof sm.MacroMap) {
            var macro_2 = map_1.lookup(name2);
            NewcommandUtil_js_1.default.addMacro(parser2, cs, macro_2.func, macro_2.args, macro_2.symbol);
            return;
          }
          macro_1 = map_1.lookup(name2);
          var newArgs = NewcommandUtil_js_1.default.disassembleSymbol(cs, macro_1);
          var method = function(p, _cs) {
            var rest = [];
            for (var _i = 2; _i < arguments.length; _i++) {
              rest[_i - 2] = arguments[_i];
            }
            var symb = NewcommandUtil_js_1.default.assembleSymbol(rest);
            return map_1.parser(p, symb);
          };
          NewcommandUtil_js_1.default.addMacro(parser2, cs, method, newArgs);
          return;
        }
        parser2.i++;
        var macro = handlers2.get("delimiter").lookup(c2);
        if (macro) {
          NewcommandUtil_js_1.default.addDelimiter(parser2, "\\" + cs, macro.char, macro.attributes);
          return;
        }
        NewcommandUtil_js_1.default.addMacro(parser2, cs, NewcommandMethods$1.Macro, [c2]);
      };
      NewcommandMethods$1.MacroWithTemplate = function(parser2, name2, text2, n) {
        var params = [];
        for (var _i = 4; _i < arguments.length; _i++) {
          params[_i - 4] = arguments[_i];
        }
        var argCount = parseInt(n, 10);
        if (argCount) {
          var args2 = [];
          parser2.GetNext();
          if (params[0] && !NewcommandUtil_js_1.default.MatchParam(parser2, params[0])) {
            throw new TexError_js_1.default("MismatchUseDef", "Use of %1 doesn't match its definition", name2);
          }
          for (var i2 = 0; i2 < argCount; i2++) {
            args2.push(NewcommandUtil_js_1.default.GetParameter(parser2, name2, params[i2 + 1]));
          }
          text2 = ParseUtil_js_1.default.substituteArgs(parser2, args2, text2);
        }
        parser2.string = ParseUtil_js_1.default.addArgs(parser2, text2, parser2.string.slice(parser2.i));
        parser2.i = 0;
        ParseUtil_js_1.default.checkMaxMacros(parser2);
      };
      NewcommandMethods$1.BeginEnv = function(parser2, begin, bdef, edef, n, def) {
        if (begin.getProperty("end") && parser2.stack.env["closing"] === begin.getName()) {
          delete parser2.stack.env["closing"];
          var rest = parser2.string.slice(parser2.i);
          parser2.string = edef;
          parser2.i = 0;
          parser2.Parse();
          parser2.string = rest;
          parser2.i = 0;
          return parser2.itemFactory.create("end").setProperty("name", begin.getName());
        }
        if (n) {
          var args2 = [];
          if (def != null) {
            var optional = parser2.GetBrackets("\\begin{" + begin.getName() + "}");
            args2.push(optional == null ? def : optional);
          }
          for (var i2 = args2.length; i2 < n; i2++) {
            args2.push(parser2.GetArgument("\\begin{" + begin.getName() + "}"));
          }
          bdef = ParseUtil_js_1.default.substituteArgs(parser2, args2, bdef);
          edef = ParseUtil_js_1.default.substituteArgs(parser2, [], edef);
        }
        parser2.string = ParseUtil_js_1.default.addArgs(parser2, bdef, parser2.string.slice(parser2.i));
        parser2.i = 0;
        return parser2.itemFactory.create("beginEnv").setProperty("name", begin.getName());
      };
      NewcommandMethods$1.Macro = BaseMethods_js_1.default.Macro;
      NewcommandMethods.default = NewcommandMethods$1;
      return NewcommandMethods;
    }
    var NewcommandItems = {};
    var hasRequiredNewcommandItems;
    function requireNewcommandItems() {
      if (hasRequiredNewcommandItems) return NewcommandItems;
      hasRequiredNewcommandItems = 1;
      var __extends2 = NewcommandItems && NewcommandItems.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      var __importDefault2 = NewcommandItems && NewcommandItems.__importDefault || function(mod2) {
        return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
      };
      Object.defineProperty(NewcommandItems, "__esModule", { value: true });
      NewcommandItems.BeginEnvItem = void 0;
      var TexError_js_1 = __importDefault2(requireTexError());
      var StackItem_js_1 = requireStackItem();
      var BeginEnvItem = (function(_super) {
        __extends2(BeginEnvItem2, _super);
        function BeginEnvItem2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        Object.defineProperty(BeginEnvItem2.prototype, "kind", {
          get: function() {
            return "beginEnv";
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(BeginEnvItem2.prototype, "isOpen", {
          get: function() {
            return true;
          },
          enumerable: false,
          configurable: true
        });
        BeginEnvItem2.prototype.checkItem = function(item2) {
          if (item2.isKind("end")) {
            if (item2.getName() !== this.getName()) {
              throw new TexError_js_1.default("EnvBadEnd", "\\begin{%1} ended with \\end{%2}", this.getName(), item2.getName());
            }
            return [[this.factory.create("mml", this.toMml())], true];
          }
          if (item2.isKind("stop")) {
            throw new TexError_js_1.default("EnvMissingEnd", "Missing \\end{%1}", this.getName());
          }
          return _super.prototype.checkItem.call(this, item2);
        };
        return BeginEnvItem2;
      })(StackItem_js_1.BaseItem);
      NewcommandItems.BeginEnvItem = BeginEnvItem;
      return NewcommandItems;
    }
    var hasRequiredConfigMacrosConfiguration;
    function requireConfigMacrosConfiguration() {
      if (hasRequiredConfigMacrosConfiguration) return ConfigMacrosConfiguration;
      hasRequiredConfigMacrosConfiguration = 1;
      var __values2 = ConfigMacrosConfiguration && ConfigMacrosConfiguration.__values || function(o) {
        var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i2 = 0;
        if (m) return m.call(o);
        if (o && typeof o.length === "number") return {
          next: function() {
            if (o && i2 >= o.length) o = void 0;
            return { value: o && o[i2++], done: !o };
          }
        };
        throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
      };
      var __importDefault2 = ConfigMacrosConfiguration && ConfigMacrosConfiguration.__importDefault || function(mod2) {
        return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
      };
      var _a2;
      Object.defineProperty(ConfigMacrosConfiguration, "__esModule", { value: true });
      ConfigMacrosConfiguration.ConfigMacrosConfiguration = void 0;
      var Configuration_js_1 = requireConfiguration();
      var Options_js_1 = requireOptions$1();
      var SymbolMap_js_1 = requireSymbolMap();
      var ParseMethods_js_1 = __importDefault2(requireParseMethods());
      var Symbol_js_1 = require_Symbol();
      var NewcommandMethods_js_1 = __importDefault2(requireNewcommandMethods());
      var NewcommandItems_js_1 = requireNewcommandItems();
      var MACROSMAP = "configmacros-map";
      var ENVIRONMENTMAP = "configmacros-env-map";
      function configmacrosInit(config2) {
        new SymbolMap_js_1.CommandMap(MACROSMAP, {}, {});
        new SymbolMap_js_1.EnvironmentMap(ENVIRONMENTMAP, ParseMethods_js_1.default.environment, {}, {});
        config2.append(Configuration_js_1.Configuration.local({
          handler: {
            macro: [MACROSMAP],
            environment: [ENVIRONMENTMAP]
          },
          priority: 3
        }));
      }
      function configmacrosConfig(_config, jax) {
        configMacros(jax);
        configEnvironments(jax);
      }
      function configMacros(jax) {
        var e_1, _a3;
        var handler = jax.parseOptions.handlers.retrieve(MACROSMAP);
        var macros = jax.parseOptions.options.macros;
        try {
          for (var _b2 = __values2(Object.keys(macros)), _c = _b2.next(); !_c.done; _c = _b2.next()) {
            var cs = _c.value;
            var def = typeof macros[cs] === "string" ? [macros[cs]] : macros[cs];
            var macro = Array.isArray(def[2]) ? new Symbol_js_1.Macro(cs, NewcommandMethods_js_1.default.MacroWithTemplate, def.slice(0, 2).concat(def[2])) : new Symbol_js_1.Macro(cs, NewcommandMethods_js_1.default.Macro, def);
            handler.add(cs, macro);
          }
        } catch (e_1_1) {
          e_1 = { error: e_1_1 };
        } finally {
          try {
            if (_c && !_c.done && (_a3 = _b2.return)) _a3.call(_b2);
          } finally {
            if (e_1) throw e_1.error;
          }
        }
      }
      function configEnvironments(jax) {
        var e_2, _a3;
        var handler = jax.parseOptions.handlers.retrieve(ENVIRONMENTMAP);
        var environments = jax.parseOptions.options.environments;
        try {
          for (var _b2 = __values2(Object.keys(environments)), _c = _b2.next(); !_c.done; _c = _b2.next()) {
            var env = _c.value;
            handler.add(env, new Symbol_js_1.Macro(env, NewcommandMethods_js_1.default.BeginEnv, [true].concat(environments[env])));
          }
        } catch (e_2_1) {
          e_2 = { error: e_2_1 };
        } finally {
          try {
            if (_c && !_c.done && (_a3 = _b2.return)) _a3.call(_b2);
          } finally {
            if (e_2) throw e_2.error;
          }
        }
      }
      ConfigMacrosConfiguration.ConfigMacrosConfiguration = Configuration_js_1.Configuration.create("configmacros", {
        init: configmacrosInit,
        config: configmacrosConfig,
        items: (_a2 = {}, _a2[NewcommandItems_js_1.BeginEnvItem.prototype.kind] = NewcommandItems_js_1.BeginEnvItem, _a2),
        options: {
          macros: (0, Options_js_1.expandable)({}),
          environments: (0, Options_js_1.expandable)({})
        }
      });
      return ConfigMacrosConfiguration;
    }
    var EmpheqConfiguration = {};
    var hasRequiredEmpheqConfiguration;
    function requireEmpheqConfiguration() {
      if (hasRequiredEmpheqConfiguration) return EmpheqConfiguration;
      hasRequiredEmpheqConfiguration = 1;
      (function(exports2) {
        var __extends2 = EmpheqConfiguration && EmpheqConfiguration.__extends || /* @__PURE__ */ (function() {
          var extendStatics2 = function(d, b) {
            extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
              d2.__proto__ = b2;
            } || function(d2, b2) {
              for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
            };
            return extendStatics2(d, b);
          };
          return function(d, b) {
            if (typeof b !== "function" && b !== null)
              throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
            extendStatics2(d, b);
            function __() {
              this.constructor = d;
            }
            d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
          };
        })();
        var __read2 = EmpheqConfiguration && EmpheqConfiguration.__read || function(o, n) {
          var m = typeof Symbol === "function" && o[Symbol.iterator];
          if (!m) return o;
          var i2 = m.call(o), r2, ar2 = [], e;
          try {
            while ((n === void 0 || n-- > 0) && !(r2 = i2.next()).done) ar2.push(r2.value);
          } catch (error2) {
            e = { error: error2 };
          } finally {
            try {
              if (r2 && !r2.done && (m = i2["return"])) m.call(i2);
            } finally {
              if (e) throw e.error;
            }
          }
          return ar2;
        };
        var __importDefault2 = EmpheqConfiguration && EmpheqConfiguration.__importDefault || function(mod2) {
          return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
        };
        var _a2;
        Object.defineProperty(exports2, "__esModule", { value: true });
        exports2.EmpheqConfiguration = exports2.EmpheqMethods = exports2.EmpheqBeginItem = void 0;
        var Configuration_js_1 = requireConfiguration();
        var SymbolMap_js_1 = requireSymbolMap();
        var ParseUtil_js_1 = __importDefault2(requireParseUtil());
        var TexError_js_1 = __importDefault2(requireTexError());
        var BaseItems_js_1 = requireBaseItems();
        var EmpheqUtil_js_1 = requireEmpheqUtil();
        var EmpheqBeginItem = (function(_super) {
          __extends2(EmpheqBeginItem2, _super);
          function EmpheqBeginItem2() {
            return _super !== null && _super.apply(this, arguments) || this;
          }
          Object.defineProperty(EmpheqBeginItem2.prototype, "kind", {
            get: function() {
              return "empheq-begin";
            },
            enumerable: false,
            configurable: true
          });
          EmpheqBeginItem2.prototype.checkItem = function(item2) {
            if (item2.isKind("end") && item2.getName() === this.getName()) {
              this.setProperty("end", false);
            }
            return _super.prototype.checkItem.call(this, item2);
          };
          return EmpheqBeginItem2;
        })(BaseItems_js_1.BeginItem);
        exports2.EmpheqBeginItem = EmpheqBeginItem;
        exports2.EmpheqMethods = {
          Empheq: function(parser2, begin) {
            if (parser2.stack.env.closing === begin.getName()) {
              delete parser2.stack.env.closing;
              parser2.Push(parser2.itemFactory.create("end").setProperty("name", parser2.stack.global.empheq));
              parser2.stack.global.empheq = "";
              var empheq = parser2.stack.Top();
              EmpheqUtil_js_1.EmpheqUtil.adjustTable(empheq, parser2);
              parser2.Push(parser2.itemFactory.create("end").setProperty("name", "empheq"));
            } else {
              ParseUtil_js_1.default.checkEqnEnv(parser2);
              delete parser2.stack.global.eqnenv;
              var opts = parser2.GetBrackets("\\begin{" + begin.getName() + "}") || "";
              var _a3 = __read2((parser2.GetArgument("\\begin{" + begin.getName() + "}") || "").split(/=/), 2), env = _a3[0], n = _a3[1];
              if (!EmpheqUtil_js_1.EmpheqUtil.checkEnv(env)) {
                throw new TexError_js_1.default("UnknownEnv", 'Unknown environment "%1"', env);
              }
              if (opts) {
                begin.setProperties(EmpheqUtil_js_1.EmpheqUtil.splitOptions(opts, { left: 1, right: 1 }));
              }
              parser2.stack.global.empheq = env;
              parser2.string = "\\begin{" + env + "}" + (n ? "{" + n + "}" : "") + parser2.string.slice(parser2.i);
              parser2.i = 0;
              parser2.Push(begin);
            }
          },
          EmpheqMO: function(parser2, _name, c2) {
            parser2.Push(parser2.create("token", "mo", {}, c2));
          },
          EmpheqDelim: function(parser2, name2) {
            var c2 = parser2.GetDelimiter(name2);
            parser2.Push(parser2.create("token", "mo", { stretchy: true, symmetric: true }, c2));
          }
        };
        new SymbolMap_js_1.EnvironmentMap("empheq-env", EmpheqUtil_js_1.EmpheqUtil.environment, {
          empheq: ["Empheq", "empheq"]
        }, exports2.EmpheqMethods);
        new SymbolMap_js_1.CommandMap("empheq-macros", {
          empheqlbrace: ["EmpheqMO", "{"],
          empheqrbrace: ["EmpheqMO", "}"],
          empheqlbrack: ["EmpheqMO", "["],
          empheqrbrack: ["EmpheqMO", "]"],
          empheqlangle: ["EmpheqMO", "⟨"],
          empheqrangle: ["EmpheqMO", "⟩"],
          empheqlparen: ["EmpheqMO", "("],
          empheqrparen: ["EmpheqMO", ")"],
          empheqlvert: ["EmpheqMO", "|"],
          empheqrvert: ["EmpheqMO", "|"],
          empheqlVert: ["EmpheqMO", "‖"],
          empheqrVert: ["EmpheqMO", "‖"],
          empheqlfloor: ["EmpheqMO", "⌊"],
          empheqrfloor: ["EmpheqMO", "⌋"],
          empheqlceil: ["EmpheqMO", "⌈"],
          empheqrceil: ["EmpheqMO", "⌉"],
          empheqbiglbrace: ["EmpheqMO", "{"],
          empheqbigrbrace: ["EmpheqMO", "}"],
          empheqbiglbrack: ["EmpheqMO", "["],
          empheqbigrbrack: ["EmpheqMO", "]"],
          empheqbiglangle: ["EmpheqMO", "⟨"],
          empheqbigrangle: ["EmpheqMO", "⟩"],
          empheqbiglparen: ["EmpheqMO", "("],
          empheqbigrparen: ["EmpheqMO", ")"],
          empheqbiglvert: ["EmpheqMO", "|"],
          empheqbigrvert: ["EmpheqMO", "|"],
          empheqbiglVert: ["EmpheqMO", "‖"],
          empheqbigrVert: ["EmpheqMO", "‖"],
          empheqbiglfloor: ["EmpheqMO", "⌊"],
          empheqbigrfloor: ["EmpheqMO", "⌋"],
          empheqbiglceil: ["EmpheqMO", "⌈"],
          empheqbigrceil: ["EmpheqMO", "⌉"],
          empheql: "EmpheqDelim",
          empheqr: "EmpheqDelim",
          empheqbigl: "EmpheqDelim",
          empheqbigr: "EmpheqDelim"
        }, exports2.EmpheqMethods);
        exports2.EmpheqConfiguration = Configuration_js_1.Configuration.create("empheq", {
          handler: {
            macro: ["empheq-macros"],
            environment: ["empheq-env"]
          },
          items: (_a2 = {}, _a2[EmpheqBeginItem.prototype.kind] = EmpheqBeginItem, _a2)
        });
      })(EmpheqConfiguration);
      return EmpheqConfiguration;
    }
    var ExtpfeilConfiguration = {};
    var NewcommandConfiguration = {};
    var NewcommandMappings = {};
    var hasRequiredNewcommandMappings;
    function requireNewcommandMappings() {
      if (hasRequiredNewcommandMappings) return NewcommandMappings;
      hasRequiredNewcommandMappings = 1;
      var __importDefault2 = NewcommandMappings && NewcommandMappings.__importDefault || function(mod2) {
        return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
      };
      Object.defineProperty(NewcommandMappings, "__esModule", { value: true });
      var NewcommandMethods_js_1 = __importDefault2(requireNewcommandMethods());
      var SymbolMap_js_1 = requireSymbolMap();
      new SymbolMap_js_1.CommandMap("Newcommand-macros", {
        newcommand: "NewCommand",
        renewcommand: "NewCommand",
        newenvironment: "NewEnvironment",
        renewenvironment: "NewEnvironment",
        def: "MacroDef",
        "let": "Let"
      }, NewcommandMethods_js_1.default);
      return NewcommandMappings;
    }
    var hasRequiredNewcommandConfiguration;
    function requireNewcommandConfiguration() {
      if (hasRequiredNewcommandConfiguration) return NewcommandConfiguration;
      hasRequiredNewcommandConfiguration = 1;
      var __createBinding2 = NewcommandConfiguration && NewcommandConfiguration.__createBinding || (Object.create ? (function(o, m, k2, k22) {
        if (k22 === void 0) k22 = k2;
        var desc = Object.getOwnPropertyDescriptor(m, k2);
        if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
          desc = { enumerable: true, get: function() {
            return m[k2];
          } };
        }
        Object.defineProperty(o, k22, desc);
      }) : (function(o, m, k2, k22) {
        if (k22 === void 0) k22 = k2;
        o[k22] = m[k2];
      }));
      var __setModuleDefault2 = NewcommandConfiguration && NewcommandConfiguration.__setModuleDefault || (Object.create ? (function(o, v) {
        Object.defineProperty(o, "default", { enumerable: true, value: v });
      }) : function(o, v) {
        o["default"] = v;
      });
      var __importStar2 = NewcommandConfiguration && NewcommandConfiguration.__importStar || function(mod2) {
        if (mod2 && mod2.__esModule) return mod2;
        var result2 = {};
        if (mod2 != null) {
          for (var k2 in mod2) if (k2 !== "default" && Object.prototype.hasOwnProperty.call(mod2, k2)) __createBinding2(result2, mod2, k2);
        }
        __setModuleDefault2(result2, mod2);
        return result2;
      };
      var __importDefault2 = NewcommandConfiguration && NewcommandConfiguration.__importDefault || function(mod2) {
        return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
      };
      var _a2;
      Object.defineProperty(NewcommandConfiguration, "__esModule", { value: true });
      NewcommandConfiguration.NewcommandConfiguration = void 0;
      var Configuration_js_1 = requireConfiguration();
      var NewcommandItems_js_1 = requireNewcommandItems();
      var NewcommandUtil_js_1 = __importDefault2(requireNewcommandUtil());
      requireNewcommandMappings();
      var ParseMethods_js_1 = __importDefault2(requireParseMethods());
      var sm = __importStar2(requireSymbolMap());
      var init2 = function(config2) {
        new sm.DelimiterMap(NewcommandUtil_js_1.default.NEW_DELIMITER, ParseMethods_js_1.default.delimiter, {});
        new sm.CommandMap(NewcommandUtil_js_1.default.NEW_COMMAND, {}, {});
        new sm.EnvironmentMap(NewcommandUtil_js_1.default.NEW_ENVIRONMENT, ParseMethods_js_1.default.environment, {}, {});
        config2.append(Configuration_js_1.Configuration.local({
          handler: {
            character: [],
            delimiter: [NewcommandUtil_js_1.default.NEW_DELIMITER],
            macro: [
              NewcommandUtil_js_1.default.NEW_DELIMITER,
              NewcommandUtil_js_1.default.NEW_COMMAND
            ],
            environment: [NewcommandUtil_js_1.default.NEW_ENVIRONMENT]
          },
          priority: -1
        }));
      };
      NewcommandConfiguration.NewcommandConfiguration = Configuration_js_1.Configuration.create("newcommand", {
        handler: {
          macro: ["Newcommand-macros"]
        },
        items: (_a2 = {}, _a2[NewcommandItems_js_1.BeginEnvItem.prototype.kind] = NewcommandItems_js_1.BeginEnvItem, _a2),
        options: { maxMacros: 1e3 },
        init: init2
      });
      return NewcommandConfiguration;
    }
    var hasRequiredExtpfeilConfiguration;
    function requireExtpfeilConfiguration() {
      if (hasRequiredExtpfeilConfiguration) return ExtpfeilConfiguration;
      hasRequiredExtpfeilConfiguration = 1;
      (function(exports2) {
        var __importDefault2 = ExtpfeilConfiguration && ExtpfeilConfiguration.__importDefault || function(mod2) {
          return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
        };
        Object.defineProperty(exports2, "__esModule", { value: true });
        exports2.ExtpfeilConfiguration = exports2.ExtpfeilMethods = void 0;
        var Configuration_js_1 = requireConfiguration();
        var SymbolMap_js_1 = requireSymbolMap();
        var AmsMethods_js_1 = requireAmsMethods();
        var NewcommandUtil_js_1 = __importDefault2(requireNewcommandUtil());
        var NewcommandConfiguration_js_1 = requireNewcommandConfiguration();
        var TexError_js_1 = __importDefault2(requireTexError());
        exports2.ExtpfeilMethods = {};
        exports2.ExtpfeilMethods.xArrow = AmsMethods_js_1.AmsMethods.xArrow;
        exports2.ExtpfeilMethods.NewExtArrow = function(parser2, name2) {
          var cs = parser2.GetArgument(name2);
          var space = parser2.GetArgument(name2);
          var chr = parser2.GetArgument(name2);
          if (!cs.match(/^\\([a-z]+|.)$/i)) {
            throw new TexError_js_1.default("NewextarrowArg1", "First argument to %1 must be a control sequence name", name2);
          }
          if (!space.match(/^(\d+),(\d+)$/)) {
            throw new TexError_js_1.default("NewextarrowArg2", "Second argument to %1 must be two integers separated by a comma", name2);
          }
          if (!chr.match(/^(\d+|0x[0-9A-F]+)$/i)) {
            throw new TexError_js_1.default("NewextarrowArg3", "Third argument to %1 must be a unicode character number", name2);
          }
          cs = cs.substr(1);
          var spaces = space.split(",");
          NewcommandUtil_js_1.default.addMacro(parser2, cs, exports2.ExtpfeilMethods.xArrow, [parseInt(chr), parseInt(spaces[0]), parseInt(spaces[1])]);
        };
        new SymbolMap_js_1.CommandMap("extpfeil", {
          xtwoheadrightarrow: ["xArrow", 8608, 12, 16],
          xtwoheadleftarrow: ["xArrow", 8606, 17, 13],
          xmapsto: ["xArrow", 8614, 6, 7],
          xlongequal: ["xArrow", 61, 7, 7],
          xtofrom: ["xArrow", 8644, 12, 12],
          Newextarrow: "NewExtArrow"
        }, exports2.ExtpfeilMethods);
        var init2 = function(config2) {
          NewcommandConfiguration_js_1.NewcommandConfiguration.init(config2);
        };
        exports2.ExtpfeilConfiguration = Configuration_js_1.Configuration.create("extpfeil", {
          handler: { macro: ["extpfeil"] },
          init: init2
        });
      })(ExtpfeilConfiguration);
      return ExtpfeilConfiguration;
    }
    var GensymbConfiguration = {};
    var hasRequiredGensymbConfiguration;
    function requireGensymbConfiguration() {
      if (hasRequiredGensymbConfiguration) return GensymbConfiguration;
      hasRequiredGensymbConfiguration = 1;
      Object.defineProperty(GensymbConfiguration, "__esModule", { value: true });
      GensymbConfiguration.GensymbConfiguration = void 0;
      var Configuration_js_1 = requireConfiguration();
      var TexConstants_js_1 = requireTexConstants();
      var SymbolMap_js_1 = requireSymbolMap();
      function mathcharUnit(parser2, mchar) {
        var def = mchar.attributes || {};
        def.mathvariant = TexConstants_js_1.TexConstant.Variant.NORMAL;
        def.class = "MathML-Unit";
        var node2 = parser2.create("token", "mi", def, mchar.char);
        parser2.Push(node2);
      }
      new SymbolMap_js_1.CharacterMap("gensymb-symbols", mathcharUnit, {
        ohm: "Ω",
        degree: "°",
        celsius: "℃",
        perthousand: "‰",
        micro: "µ"
      });
      GensymbConfiguration.GensymbConfiguration = Configuration_js_1.Configuration.create("gensymb", {
        handler: { macro: ["gensymb-symbols"] }
      });
      return GensymbConfiguration;
    }
    var HtmlConfiguration = {};
    var HtmlMethods = {};
    var hasRequiredHtmlMethods;
    function requireHtmlMethods() {
      if (hasRequiredHtmlMethods) return HtmlMethods;
      hasRequiredHtmlMethods = 1;
      var __importDefault2 = HtmlMethods && HtmlMethods.__importDefault || function(mod2) {
        return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
      };
      Object.defineProperty(HtmlMethods, "__esModule", { value: true });
      var NodeUtil_js_1 = __importDefault2(requireNodeUtil());
      var HtmlMethods$1 = {};
      HtmlMethods$1.Href = function(parser2, name2) {
        var url = parser2.GetArgument(name2);
        var arg = GetArgumentMML(parser2, name2);
        NodeUtil_js_1.default.setAttribute(arg, "href", url);
        parser2.Push(arg);
      };
      HtmlMethods$1.Class = function(parser2, name2) {
        var CLASS = parser2.GetArgument(name2);
        var arg = GetArgumentMML(parser2, name2);
        var oldClass = NodeUtil_js_1.default.getAttribute(arg, "class");
        if (oldClass) {
          CLASS = oldClass + " " + CLASS;
        }
        NodeUtil_js_1.default.setAttribute(arg, "class", CLASS);
        parser2.Push(arg);
      };
      HtmlMethods$1.Style = function(parser2, name2) {
        var style2 = parser2.GetArgument(name2);
        var arg = GetArgumentMML(parser2, name2);
        var oldStyle = NodeUtil_js_1.default.getAttribute(arg, "style");
        if (oldStyle) {
          if (style2.charAt(style2.length - 1) !== ";") {
            style2 += ";";
          }
          style2 = oldStyle + " " + style2;
        }
        NodeUtil_js_1.default.setAttribute(arg, "style", style2);
        parser2.Push(arg);
      };
      HtmlMethods$1.Id = function(parser2, name2) {
        var ID = parser2.GetArgument(name2);
        var arg = GetArgumentMML(parser2, name2);
        NodeUtil_js_1.default.setAttribute(arg, "id", ID);
        parser2.Push(arg);
      };
      var GetArgumentMML = function(parser2, name2) {
        var arg = parser2.ParseArg(name2);
        if (!NodeUtil_js_1.default.isInferred(arg)) {
          return arg;
        }
        var children2 = NodeUtil_js_1.default.getChildren(arg);
        if (children2.length === 1) {
          return children2[0];
        }
        var mrow2 = parser2.create("node", "mrow");
        NodeUtil_js_1.default.copyChildren(arg, mrow2);
        NodeUtil_js_1.default.copyAttributes(arg, mrow2);
        return mrow2;
      };
      HtmlMethods.default = HtmlMethods$1;
      return HtmlMethods;
    }
    var hasRequiredHtmlConfiguration;
    function requireHtmlConfiguration() {
      if (hasRequiredHtmlConfiguration) return HtmlConfiguration;
      hasRequiredHtmlConfiguration = 1;
      var __importDefault2 = HtmlConfiguration && HtmlConfiguration.__importDefault || function(mod2) {
        return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
      };
      Object.defineProperty(HtmlConfiguration, "__esModule", { value: true });
      HtmlConfiguration.HtmlConfiguration = void 0;
      var Configuration_js_1 = requireConfiguration();
      var SymbolMap_js_1 = requireSymbolMap();
      var HtmlMethods_js_1 = __importDefault2(requireHtmlMethods());
      new SymbolMap_js_1.CommandMap("html_macros", {
        href: "Href",
        "class": "Class",
        style: "Style",
        cssId: "Id"
      }, HtmlMethods_js_1.default);
      HtmlConfiguration.HtmlConfiguration = Configuration_js_1.Configuration.create("html", { handler: { macro: ["html_macros"] } });
      return HtmlConfiguration;
    }
    var MathtoolsConfiguration = {};
    var MathtoolsMappings = {};
    var MathtoolsMethods = {};
    var MathtoolsUtil = {};
    var hasRequiredMathtoolsUtil;
    function requireMathtoolsUtil() {
      if (hasRequiredMathtoolsUtil) return MathtoolsUtil;
      hasRequiredMathtoolsUtil = 1;
      var __read2 = MathtoolsUtil && MathtoolsUtil.__read || function(o, n) {
        var m = typeof Symbol === "function" && o[Symbol.iterator];
        if (!m) return o;
        var i2 = m.call(o), r2, ar2 = [], e;
        try {
          while ((n === void 0 || n-- > 0) && !(r2 = i2.next()).done) ar2.push(r2.value);
        } catch (error2) {
          e = { error: error2 };
        } finally {
          try {
            if (r2 && !r2.done && (m = i2["return"])) m.call(i2);
          } finally {
            if (e) throw e.error;
          }
        }
        return ar2;
      };
      var __importDefault2 = MathtoolsUtil && MathtoolsUtil.__importDefault || function(mod2) {
        return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
      };
      Object.defineProperty(MathtoolsUtil, "__esModule", { value: true });
      MathtoolsUtil.MathtoolsUtil = void 0;
      var BaseItems_js_1 = requireBaseItems();
      var ParseUtil_js_1 = __importDefault2(requireParseUtil());
      var TexParser_js_1 = __importDefault2(requireTexParser());
      var TexError_js_1 = __importDefault2(requireTexError());
      var Symbol_js_1 = require_Symbol();
      var Options_js_1 = requireOptions$1();
      var MathtoolsMethods_js_1 = requireMathtoolsMethods();
      var MathtoolsConfiguration_js_1 = requireMathtoolsConfiguration();
      MathtoolsUtil.MathtoolsUtil = {
        setDisplayLevel: function(mml, style2) {
          if (!style2)
            return;
          var _a2 = __read2((0, Options_js_1.lookup)(style2, {
            "\\displaystyle": [true, 0],
            "\\textstyle": [false, 0],
            "\\scriptstyle": [false, 1],
            "\\scriptscriptstyle": [false, 2]
          }, [null, null]), 2), display = _a2[0], script2 = _a2[1];
          if (display !== null) {
            mml.attributes.set("displaystyle", display);
            mml.attributes.set("scriptlevel", script2);
          }
        },
        checkAlignment: function(parser2, name2) {
          var top2 = parser2.stack.Top();
          if (top2.kind !== BaseItems_js_1.EqnArrayItem.prototype.kind) {
            throw new TexError_js_1.default("NotInAlignment", "%1 can only be used in aligment environments", name2);
          }
          return top2;
        },
        addPairedDelims: function(config2, cs, args2) {
          var delims2 = config2.handlers.retrieve(MathtoolsConfiguration_js_1.PAIREDDELIMS);
          delims2.add(cs, new Symbol_js_1.Macro(cs, MathtoolsMethods_js_1.MathtoolsMethods.PairedDelimiters, args2));
        },
        spreadLines: function(mtable2, spread) {
          if (!mtable2.isKind("mtable"))
            return;
          var rowspacing = mtable2.attributes.get("rowspacing");
          if (rowspacing) {
            var add_1 = ParseUtil_js_1.default.dimen2em(spread);
            rowspacing = rowspacing.split(/ /).map(function(s) {
              return ParseUtil_js_1.default.Em(Math.max(0, ParseUtil_js_1.default.dimen2em(s) + add_1));
            }).join(" ");
          } else {
            rowspacing = spread;
          }
          mtable2.attributes.set("rowspacing", rowspacing);
        },
        plusOrMinus: function(name2, n) {
          n = n.trim();
          if (!n.match(/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)$/)) {
            throw new TexError_js_1.default("NotANumber", "Argument to %1 is not a number", name2);
          }
          return n.match(/^[-+]/) ? n : "+" + n;
        },
        getScript: function(parser2, name2, pos2) {
          var arg = ParseUtil_js_1.default.trimSpaces(parser2.GetArgument(name2));
          if (arg === "") {
            return parser2.create("node", "none");
          }
          var format2 = parser2.options.mathtools["prescript-".concat(pos2, "-format")];
          format2 && (arg = "".concat(format2, "{").concat(arg, "}"));
          return new TexParser_js_1.default(arg, parser2.stack.env, parser2.configuration).mml();
        }
      };
      return MathtoolsUtil;
    }
    var hasRequiredMathtoolsMethods;
    function requireMathtoolsMethods() {
      if (hasRequiredMathtoolsMethods) return MathtoolsMethods;
      hasRequiredMathtoolsMethods = 1;
      (function(exports2) {
        var __assign2 = MathtoolsMethods && MathtoolsMethods.__assign || function() {
          __assign2 = Object.assign || function(t2) {
            for (var s, i2 = 1, n = arguments.length; i2 < n; i2++) {
              s = arguments[i2];
              for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
                t2[p] = s[p];
            }
            return t2;
          };
          return __assign2.apply(this, arguments);
        };
        var __read2 = MathtoolsMethods && MathtoolsMethods.__read || function(o, n) {
          var m = typeof Symbol === "function" && o[Symbol.iterator];
          if (!m) return o;
          var i2 = m.call(o), r2, ar2 = [], e;
          try {
            while ((n === void 0 || n-- > 0) && !(r2 = i2.next()).done) ar2.push(r2.value);
          } catch (error2) {
            e = { error: error2 };
          } finally {
            try {
              if (r2 && !r2.done && (m = i2["return"])) m.call(i2);
            } finally {
              if (e) throw e.error;
            }
          }
          return ar2;
        };
        var __values2 = MathtoolsMethods && MathtoolsMethods.__values || function(o) {
          var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i2 = 0;
          if (m) return m.call(o);
          if (o && typeof o.length === "number") return {
            next: function() {
              if (o && i2 >= o.length) o = void 0;
              return { value: o && o[i2++], done: !o };
            }
          };
          throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
        };
        var __importDefault2 = MathtoolsMethods && MathtoolsMethods.__importDefault || function(mod2) {
          return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
        };
        Object.defineProperty(exports2, "__esModule", { value: true });
        exports2.MathtoolsMethods = void 0;
        var ParseUtil_js_1 = __importDefault2(requireParseUtil());
        var AmsMethods_js_1 = requireAmsMethods();
        var BaseMethods_js_1 = __importDefault2(requireBaseMethods());
        var TexParser_js_1 = __importDefault2(requireTexParser());
        var TexError_js_1 = __importDefault2(requireTexError());
        var NodeUtil_js_1 = __importDefault2(requireNodeUtil());
        var MmlNode_js_1 = requireMmlNode();
        var lengths_js_1 = requireLengths();
        var Options_js_1 = requireOptions$1();
        var NewcommandUtil_js_1 = __importDefault2(requireNewcommandUtil());
        var NewcommandMethods_js_1 = __importDefault2(requireNewcommandMethods());
        var MathtoolsUtil_js_1 = requireMathtoolsUtil();
        exports2.MathtoolsMethods = {
          MtMatrix: function(parser2, begin, open, close2) {
            var align = parser2.GetBrackets("\\begin{".concat(begin.getName(), "}"), "c");
            return exports2.MathtoolsMethods.Array(parser2, begin, open, close2, align);
          },
          MtSmallMatrix: function(parser2, begin, open, close2, align) {
            if (!align) {
              align = parser2.GetBrackets("\\begin{".concat(begin.getName(), "}"), parser2.options.mathtools["smallmatrix-align"]);
            }
            return exports2.MathtoolsMethods.Array(parser2, begin, open, close2, align, ParseUtil_js_1.default.Em(1 / 3), ".2em", "S", 1);
          },
          MtMultlined: function(parser2, begin) {
            var _a2;
            var name2 = "\\begin{".concat(begin.getName(), "}");
            var pos2 = parser2.GetBrackets(name2, parser2.options.mathtools["multlined-pos"] || "c");
            var width = pos2 ? parser2.GetBrackets(name2, "") : "";
            if (pos2 && !pos2.match(/^[cbt]$/)) {
              _a2 = __read2([pos2, width], 2), width = _a2[0], pos2 = _a2[1];
            }
            parser2.Push(begin);
            var item2 = parser2.itemFactory.create("multlined", parser2, begin);
            item2.arraydef = {
              displaystyle: true,
              rowspacing: ".5em",
              width: width || "auto",
              columnwidth: "100%"
            };
            return ParseUtil_js_1.default.setArrayAlign(item2, pos2 || "c");
          },
          HandleShove: function(parser2, name2, shove) {
            var top2 = parser2.stack.Top();
            if (top2.kind !== "multline" && top2.kind !== "multlined") {
              throw new TexError_js_1.default("CommandInMultlined", "%1 can only appear within the multline or multlined environments", name2);
            }
            if (top2.Size()) {
              throw new TexError_js_1.default("CommandAtTheBeginingOfLine", "%1 must come at the beginning of the line", name2);
            }
            top2.setProperty("shove", shove);
            var shift2 = parser2.GetBrackets(name2);
            var mml = parser2.ParseArg(name2);
            if (shift2) {
              var mrow2 = parser2.create("node", "mrow", []);
              var mspace2 = parser2.create("node", "mspace", [], { width: shift2 });
              if (shove === "left") {
                mrow2.appendChild(mspace2);
                mrow2.appendChild(mml);
              } else {
                mrow2.appendChild(mml);
                mrow2.appendChild(mspace2);
              }
              mml = mrow2;
            }
            parser2.Push(mml);
          },
          SpreadLines: function(parser2, begin) {
            var e_1, _a2;
            if (parser2.stack.env.closing === begin.getName()) {
              delete parser2.stack.env.closing;
              var top_1 = parser2.stack.Pop();
              var mml = top_1.toMml();
              var spread = top_1.getProperty("spread");
              if (mml.isInferred) {
                try {
                  for (var _b2 = __values2(NodeUtil_js_1.default.getChildren(mml)), _c = _b2.next(); !_c.done; _c = _b2.next()) {
                    var child = _c.value;
                    MathtoolsUtil_js_1.MathtoolsUtil.spreadLines(child, spread);
                  }
                } catch (e_1_1) {
                  e_1 = { error: e_1_1 };
                } finally {
                  try {
                    if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
                  } finally {
                    if (e_1) throw e_1.error;
                  }
                }
              } else {
                MathtoolsUtil_js_1.MathtoolsUtil.spreadLines(mml, spread);
              }
              parser2.Push(mml);
            } else {
              var spread = parser2.GetDimen("\\begin{".concat(begin.getName(), "}"));
              begin.setProperty("spread", spread);
              parser2.Push(begin);
            }
          },
          Cases: function(parser2, begin, open, close2, style2) {
            var array = parser2.itemFactory.create("array").setProperty("casesEnv", begin.getName());
            array.arraydef = {
              rowspacing: ".2em",
              columnspacing: "1em",
              columnalign: "left"
            };
            if (style2 === "D") {
              array.arraydef.displaystyle = true;
            }
            array.setProperties({ open, close: close2 });
            parser2.Push(begin);
            return array;
          },
          MathLap: function(parser2, name2, pos2, cramped) {
            var style2 = parser2.GetBrackets(name2, "").trim();
            var mml = parser2.create("node", "mstyle", [
              parser2.create("node", "mpadded", [parser2.ParseArg(name2)], __assign2({ width: 0 }, pos2 === "r" ? {} : { lspace: pos2 === "l" ? "-1width" : "-.5width" }))
            ], { "data-cramped": cramped });
            MathtoolsUtil_js_1.MathtoolsUtil.setDisplayLevel(mml, style2);
            parser2.Push(parser2.create("node", "TeXAtom", [mml]));
          },
          Cramped: function(parser2, name2) {
            var style2 = parser2.GetBrackets(name2, "").trim();
            var arg = parser2.ParseArg(name2);
            var mml = parser2.create("node", "mstyle", [arg], { "data-cramped": true });
            MathtoolsUtil_js_1.MathtoolsUtil.setDisplayLevel(mml, style2);
            parser2.Push(mml);
          },
          MtLap: function(parser2, name2, pos2) {
            var content2 = ParseUtil_js_1.default.internalMath(parser2, parser2.GetArgument(name2), 0);
            var mml = parser2.create("node", "mpadded", content2, { width: 0 });
            if (pos2 !== "r") {
              NodeUtil_js_1.default.setAttribute(mml, "lspace", pos2 === "l" ? "-1width" : "-.5width");
            }
            parser2.Push(mml);
          },
          MathMakeBox: function(parser2, name2) {
            var width = parser2.GetBrackets(name2);
            var pos2 = parser2.GetBrackets(name2, "c");
            var mml = parser2.create("node", "mpadded", [parser2.ParseArg(name2)]);
            if (width) {
              NodeUtil_js_1.default.setAttribute(mml, "width", width);
            }
            var align = (0, Options_js_1.lookup)(pos2, { c: "center", r: "right" }, "");
            if (align) {
              NodeUtil_js_1.default.setAttribute(mml, "data-align", align);
            }
            parser2.Push(mml);
          },
          MathMBox: function(parser2, name2) {
            parser2.Push(parser2.create("node", "mrow", [parser2.ParseArg(name2)]));
          },
          UnderOverBracket: function(parser2, name2) {
            var thickness = (0, lengths_js_1.length2em)(parser2.GetBrackets(name2, ".1em"), 0.1);
            var height = parser2.GetBrackets(name2, ".2em");
            var arg = parser2.GetArgument(name2);
            var _a2 = __read2(name2.charAt(1) === "o" ? ["over", "accent", "bottom"] : ["under", "accentunder", "top"], 3), pos2 = _a2[0], accent = _a2[1], border = _a2[2];
            var t2 = (0, lengths_js_1.em)(thickness);
            var base2 = new TexParser_js_1.default(arg, parser2.stack.env, parser2.configuration).mml();
            var copy2 = new TexParser_js_1.default(arg, parser2.stack.env, parser2.configuration).mml();
            var script2 = parser2.create("node", "mpadded", [
              parser2.create("node", "mphantom", [copy2])
            ], {
              style: "border: ".concat(t2, " solid; border-").concat(border, ": none"),
              height,
              depth: 0
            });
            var node2 = ParseUtil_js_1.default.underOver(parser2, base2, script2, pos2, true);
            var munderover2 = NodeUtil_js_1.default.getChildAt(NodeUtil_js_1.default.getChildAt(node2, 0), 0);
            NodeUtil_js_1.default.setAttribute(munderover2, accent, true);
            parser2.Push(node2);
          },
          Aboxed: function(parser2, name2) {
            var top2 = MathtoolsUtil_js_1.MathtoolsUtil.checkAlignment(parser2, name2);
            if (top2.row.length % 2 === 1) {
              top2.row.push(parser2.create("node", "mtd", []));
            }
            var arg = parser2.GetArgument(name2);
            var rest = parser2.string.substr(parser2.i);
            parser2.string = arg + "&&\\endAboxed";
            parser2.i = 0;
            var left2 = parser2.GetUpTo(name2, "&");
            var right2 = parser2.GetUpTo(name2, "&");
            parser2.GetUpTo(name2, "\\endAboxed");
            var tex2 = ParseUtil_js_1.default.substituteArgs(parser2, [left2, right2], "\\rlap{\\boxed{#1{}#2}}\\kern.267em\\phantom{#1}&\\phantom{{}#2}\\kern.267em");
            parser2.string = tex2 + rest;
            parser2.i = 0;
          },
          ArrowBetweenLines: function(parser2, name2) {
            var top2 = MathtoolsUtil_js_1.MathtoolsUtil.checkAlignment(parser2, name2);
            if (top2.Size() || top2.row.length) {
              throw new TexError_js_1.default("BetweenLines", "%1 must be on a row by itself", name2);
            }
            var star2 = parser2.GetStar();
            var symbol = parser2.GetBrackets(name2, "\\Updownarrow");
            if (star2) {
              top2.EndEntry();
              top2.EndEntry();
            }
            var tex2 = star2 ? "\\quad" + symbol : symbol + "\\quad";
            var mml = new TexParser_js_1.default(tex2, parser2.stack.env, parser2.configuration).mml();
            parser2.Push(mml);
            top2.EndEntry();
            top2.EndRow();
          },
          VDotsWithin: function(parser2, name2) {
            var top2 = parser2.stack.Top();
            var isFlush = top2.getProperty("flushspaceabove") === top2.table.length;
            var arg = "\\mmlToken{mi}{}" + parser2.GetArgument(name2) + "\\mmlToken{mi}{}";
            var base2 = new TexParser_js_1.default(arg, parser2.stack.env, parser2.configuration).mml();
            var mml = parser2.create("node", "mpadded", [
              parser2.create("node", "mpadded", [
                parser2.create("node", "mo", [
                  parser2.create("text", "⋮")
                ])
              ], __assign2({ width: 0, lspace: "-.5width" }, isFlush ? { height: "-.6em", voffset: "-.18em" } : {})),
              parser2.create("node", "mphantom", [base2])
            ], {
              lspace: ".5width"
            });
            parser2.Push(mml);
          },
          ShortVDotsWithin: function(parser2, _name) {
            var top2 = parser2.stack.Top();
            var star2 = parser2.GetStar();
            exports2.MathtoolsMethods.FlushSpaceAbove(parser2, "\\MTFlushSpaceAbove");
            !star2 && top2.EndEntry();
            exports2.MathtoolsMethods.VDotsWithin(parser2, "\\vdotswithin");
            star2 && top2.EndEntry();
            exports2.MathtoolsMethods.FlushSpaceBelow(parser2, "\\MTFlushSpaceBelow");
          },
          FlushSpaceAbove: function(parser2, name2) {
            var top2 = MathtoolsUtil_js_1.MathtoolsUtil.checkAlignment(parser2, name2);
            top2.setProperty("flushspaceabove", top2.table.length);
            top2.addRowSpacing("-" + parser2.options.mathtools["shortvdotsadjustabove"]);
          },
          FlushSpaceBelow: function(parser2, name2) {
            var top2 = MathtoolsUtil_js_1.MathtoolsUtil.checkAlignment(parser2, name2);
            top2.Size() && top2.EndEntry();
            top2.EndRow();
            top2.addRowSpacing("-" + parser2.options.mathtools["shortvdotsadjustbelow"]);
          },
          PairedDelimiters: function(parser2, name2, open, close2, body2, n, pre2, post) {
            if (body2 === void 0) {
              body2 = "#1";
            }
            if (n === void 0) {
              n = 1;
            }
            if (pre2 === void 0) {
              pre2 = "";
            }
            if (post === void 0) {
              post = "";
            }
            var star2 = parser2.GetStar();
            var size = star2 ? "" : parser2.GetBrackets(name2);
            var _a2 = __read2(star2 ? ["\\left", "\\right"] : size ? [size + "l", size + "r"] : ["", ""], 2), left2 = _a2[0], right2 = _a2[1];
            var delim = star2 ? "\\middle" : size || "";
            if (n) {
              var args2 = [];
              for (var i2 = args2.length; i2 < n; i2++) {
                args2.push(parser2.GetArgument(name2));
              }
              pre2 = ParseUtil_js_1.default.substituteArgs(parser2, args2, pre2);
              body2 = ParseUtil_js_1.default.substituteArgs(parser2, args2, body2);
              post = ParseUtil_js_1.default.substituteArgs(parser2, args2, post);
            }
            body2 = body2.replace(/\\delimsize/g, delim);
            parser2.string = [pre2, left2, open, body2, right2, close2, post, parser2.string.substr(parser2.i)].reduce(function(s, part2) {
              return ParseUtil_js_1.default.addArgs(parser2, s, part2);
            }, "");
            parser2.i = 0;
            ParseUtil_js_1.default.checkMaxMacros(parser2);
          },
          DeclarePairedDelimiter: function(parser2, name2) {
            var cs = NewcommandUtil_js_1.default.GetCsNameArgument(parser2, name2);
            var open = parser2.GetArgument(name2);
            var close2 = parser2.GetArgument(name2);
            MathtoolsUtil_js_1.MathtoolsUtil.addPairedDelims(parser2.configuration, cs, [open, close2]);
          },
          DeclarePairedDelimiterX: function(parser2, name2) {
            var cs = NewcommandUtil_js_1.default.GetCsNameArgument(parser2, name2);
            var n = NewcommandUtil_js_1.default.GetArgCount(parser2, name2);
            var open = parser2.GetArgument(name2);
            var close2 = parser2.GetArgument(name2);
            var body2 = parser2.GetArgument(name2);
            MathtoolsUtil_js_1.MathtoolsUtil.addPairedDelims(parser2.configuration, cs, [open, close2, body2, n]);
          },
          DeclarePairedDelimiterXPP: function(parser2, name2) {
            var cs = NewcommandUtil_js_1.default.GetCsNameArgument(parser2, name2);
            var n = NewcommandUtil_js_1.default.GetArgCount(parser2, name2);
            var pre2 = parser2.GetArgument(name2);
            var open = parser2.GetArgument(name2);
            var close2 = parser2.GetArgument(name2);
            var post = parser2.GetArgument(name2);
            var body2 = parser2.GetArgument(name2);
            MathtoolsUtil_js_1.MathtoolsUtil.addPairedDelims(parser2.configuration, cs, [open, close2, body2, n, pre2, post]);
          },
          CenterColon: function(parser2, _name, center2, force, thin) {
            if (force === void 0) {
              force = false;
            }
            if (thin === void 0) {
              thin = false;
            }
            var options2 = parser2.options.mathtools;
            var mml = parser2.create("token", "mo", {}, ":");
            if (center2 && (options2["centercolon"] || force)) {
              var dy = options2["centercolon-offset"];
              mml = parser2.create("node", "mpadded", [mml], __assign2({ voffset: dy, height: "+".concat(dy), depth: "-".concat(dy) }, thin ? { width: options2["thincolon-dw"], lspace: options2["thincolon-dx"] } : {}));
            }
            parser2.Push(mml);
          },
          Relation: function(parser2, _name, tex2, unicode2) {
            var options2 = parser2.options.mathtools;
            if (options2["use-unicode"] && unicode2) {
              parser2.Push(parser2.create("token", "mo", { texClass: MmlNode_js_1.TEXCLASS.REL }, unicode2));
            } else {
              tex2 = "\\mathrel{" + tex2.replace(/:/g, "\\MTThinColon").replace(/-/g, "\\mathrel{-}") + "}";
              parser2.string = ParseUtil_js_1.default.addArgs(parser2, tex2, parser2.string.substr(parser2.i));
              parser2.i = 0;
            }
          },
          NArrow: function(parser2, _name, c2, dy) {
            parser2.Push(parser2.create("node", "TeXAtom", [
              parser2.create("token", "mtext", {}, c2),
              parser2.create("node", "mpadded", [
                parser2.create("node", "mpadded", [
                  parser2.create("node", "menclose", [
                    parser2.create("node", "mspace", [], { height: ".2em", depth: 0, width: ".4em" })
                  ], { notation: "updiagonalstrike", "data-thickness": ".05em", "data-padding": 0 })
                ], { width: 0, lspace: "-.5width", voffset: dy }),
                parser2.create("node", "mphantom", [
                  parser2.create("token", "mtext", {}, c2)
                ])
              ], { width: 0, lspace: "-.5width" })
            ], { texClass: MmlNode_js_1.TEXCLASS.REL }));
          },
          SplitFrac: function(parser2, name2, display) {
            var num2 = parser2.ParseArg(name2);
            var den = parser2.ParseArg(name2);
            parser2.Push(parser2.create("node", "mstyle", [
              parser2.create("node", "mfrac", [
                parser2.create("node", "mstyle", [
                  num2,
                  parser2.create("token", "mi"),
                  parser2.create("token", "mspace", { width: "1em" })
                ], { scriptlevel: 0 }),
                parser2.create("node", "mstyle", [
                  parser2.create("token", "mspace", { width: "1em" }),
                  parser2.create("token", "mi"),
                  den
                ], { scriptlevel: 0 })
              ], { linethickness: 0, numalign: "left", denomalign: "right" })
            ], { displaystyle: display, scriptlevel: 0 }));
          },
          XMathStrut: function(parser2, name2) {
            var dd2 = parser2.GetBrackets(name2);
            var dh = parser2.GetArgument(name2);
            dh = MathtoolsUtil_js_1.MathtoolsUtil.plusOrMinus(name2, dh);
            dd2 = MathtoolsUtil_js_1.MathtoolsUtil.plusOrMinus(name2, dd2 || dh);
            parser2.Push(parser2.create("node", "TeXAtom", [
              parser2.create("node", "mpadded", [
                parser2.create("node", "mphantom", [
                  parser2.create("token", "mo", { stretchy: false }, "(")
                ])
              ], { width: 0, height: dh + "height", depth: dd2 + "depth" })
            ], { texClass: MmlNode_js_1.TEXCLASS.ORD }));
          },
          Prescript: function(parser2, name2) {
            var sup4 = MathtoolsUtil_js_1.MathtoolsUtil.getScript(parser2, name2, "sup");
            var sub2 = MathtoolsUtil_js_1.MathtoolsUtil.getScript(parser2, name2, "sub");
            var base2 = MathtoolsUtil_js_1.MathtoolsUtil.getScript(parser2, name2, "arg");
            if (NodeUtil_js_1.default.isType(sup4, "none") && NodeUtil_js_1.default.isType(sub2, "none")) {
              parser2.Push(base2);
              return;
            }
            var mml = parser2.create("node", "mmultiscripts", [base2]);
            NodeUtil_js_1.default.getChildren(mml).push(null, null);
            NodeUtil_js_1.default.appendChildren(mml, [parser2.create("node", "mprescripts"), sub2, sup4]);
            mml.setProperty("fixPrescript", true);
            parser2.Push(mml);
          },
          NewTagForm: function(parser2, name2, renew) {
            if (renew === void 0) {
              renew = false;
            }
            var tags2 = parser2.tags;
            if (!("mtFormats" in tags2)) {
              throw new TexError_js_1.default("TagsNotMT", "%1 can only be used with ams or mathtools tags", name2);
            }
            var id = parser2.GetArgument(name2).trim();
            if (!id) {
              throw new TexError_js_1.default("InvalidTagFormID", "Tag form name can't be empty");
            }
            var format2 = parser2.GetBrackets(name2, "");
            var left2 = parser2.GetArgument(name2);
            var right2 = parser2.GetArgument(name2);
            if (!renew && tags2.mtFormats.has(id)) {
              throw new TexError_js_1.default("DuplicateTagForm", "Duplicate tag form: %1", id);
            }
            tags2.mtFormats.set(id, [left2, right2, format2]);
          },
          UseTagForm: function(parser2, name2) {
            var tags2 = parser2.tags;
            if (!("mtFormats" in tags2)) {
              throw new TexError_js_1.default("TagsNotMT", "%1 can only be used with ams or mathtools tags", name2);
            }
            var id = parser2.GetArgument(name2).trim();
            if (!id) {
              tags2.mtCurrent = null;
              return;
            }
            if (!tags2.mtFormats.has(id)) {
              throw new TexError_js_1.default("UndefinedTagForm", "Undefined tag form: %1", id);
            }
            tags2.mtCurrent = tags2.mtFormats.get(id);
          },
          SetOptions: function(parser2, name2) {
            var e_2, _a2;
            var options2 = parser2.options.mathtools;
            if (!options2["allow-mathtoolsset"]) {
              throw new TexError_js_1.default("ForbiddenMathtoolsSet", "%1 is disabled", name2);
            }
            var allowed = {};
            Object.keys(options2).forEach(function(id2) {
              if (id2 !== "pariedDelimiters" && id2 !== "tagforms" && id2 !== "allow-mathtoolsset") {
                allowed[id2] = 1;
              }
            });
            var args2 = parser2.GetArgument(name2);
            var keys = ParseUtil_js_1.default.keyvalOptions(args2, allowed, true);
            try {
              for (var _b2 = __values2(Object.keys(keys)), _c = _b2.next(); !_c.done; _c = _b2.next()) {
                var id = _c.value;
                options2[id] = keys[id];
              }
            } catch (e_2_1) {
              e_2 = { error: e_2_1 };
            } finally {
              try {
                if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
              } finally {
                if (e_2) throw e_2.error;
              }
            }
          },
          Array: BaseMethods_js_1.default.Array,
          Macro: BaseMethods_js_1.default.Macro,
          xArrow: AmsMethods_js_1.AmsMethods.xArrow,
          HandleRef: AmsMethods_js_1.AmsMethods.HandleRef,
          AmsEqnArray: AmsMethods_js_1.AmsMethods.AmsEqnArray,
          MacroWithTemplate: NewcommandMethods_js_1.default.MacroWithTemplate
        };
      })(MathtoolsMethods);
      return MathtoolsMethods;
    }
    var hasRequiredMathtoolsMappings;
    function requireMathtoolsMappings() {
      if (hasRequiredMathtoolsMappings) return MathtoolsMappings;
      hasRequiredMathtoolsMappings = 1;
      var __importDefault2 = MathtoolsMappings && MathtoolsMappings.__importDefault || function(mod2) {
        return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
      };
      Object.defineProperty(MathtoolsMappings, "__esModule", { value: true });
      var ParseMethods_js_1 = __importDefault2(requireParseMethods());
      var SymbolMap_js_1 = requireSymbolMap();
      var TexConstants_js_1 = requireTexConstants();
      var MathtoolsMethods_js_1 = requireMathtoolsMethods();
      new SymbolMap_js_1.CommandMap("mathtools-macros", {
        shoveleft: ["HandleShove", TexConstants_js_1.TexConstant.Align.LEFT],
        shoveright: ["HandleShove", TexConstants_js_1.TexConstant.Align.RIGHT],
        xleftrightarrow: ["xArrow", 8596, 10, 10],
        xLeftarrow: ["xArrow", 8656, 12, 7],
        xRightarrow: ["xArrow", 8658, 7, 12],
        xLeftrightarrow: ["xArrow", 8660, 12, 12],
        xhookleftarrow: ["xArrow", 8617, 10, 5],
        xhookrightarrow: ["xArrow", 8618, 5, 10],
        xmapsto: ["xArrow", 8614, 10, 10],
        xrightharpoondown: ["xArrow", 8641, 5, 10],
        xleftharpoondown: ["xArrow", 8637, 10, 5],
        xrightleftharpoons: ["xArrow", 8652, 10, 10],
        xrightharpoonup: ["xArrow", 8640, 5, 10],
        xleftharpoonup: ["xArrow", 8636, 10, 5],
        xleftrightharpoons: ["xArrow", 8651, 10, 10],
        mathllap: ["MathLap", "l", false],
        mathrlap: ["MathLap", "r", false],
        mathclap: ["MathLap", "c", false],
        clap: ["MtLap", "c"],
        textllap: ["MtLap", "l"],
        textrlap: ["MtLap", "r"],
        textclap: ["MtLap", "c"],
        cramped: "Cramped",
        crampedllap: ["MathLap", "l", true],
        crampedrlap: ["MathLap", "r", true],
        crampedclap: ["MathLap", "c", true],
        crampedsubstack: ["Macro", "\\begin{crampedsubarray}{c}#1\\end{crampedsubarray}", 1],
        mathmbox: "MathMBox",
        mathmakebox: "MathMakeBox",
        overbracket: "UnderOverBracket",
        underbracket: "UnderOverBracket",
        refeq: "HandleRef",
        MoveEqLeft: ["Macro", "\\hspace{#1em}&\\hspace{-#1em}", 1, "2"],
        Aboxed: "Aboxed",
        ArrowBetweenLines: "ArrowBetweenLines",
        vdotswithin: "VDotsWithin",
        shortvdotswithin: "ShortVDotsWithin",
        MTFlushSpaceAbove: "FlushSpaceAbove",
        MTFlushSpaceBelow: "FlushSpaceBelow",
        DeclarePairedDelimiter: "DeclarePairedDelimiter",
        DeclarePairedDelimiterX: "DeclarePairedDelimiterX",
        DeclarePairedDelimiterXPP: "DeclarePairedDelimiterXPP",
        DeclarePairedDelimiters: "DeclarePairedDelimiter",
        DeclarePairedDelimitersX: "DeclarePairedDelimiterX",
        DeclarePairedDelimitersXPP: "DeclarePairedDelimiterXPP",
        centercolon: ["CenterColon", true, true],
        ordinarycolon: ["CenterColon", false],
        MTThinColon: ["CenterColon", true, true, true],
        coloneqq: ["Relation", ":=", "≔"],
        Coloneqq: ["Relation", "::=", "⩴"],
        coloneq: ["Relation", ":-"],
        Coloneq: ["Relation", "::-"],
        eqqcolon: ["Relation", "=:", "≕"],
        Eqqcolon: ["Relation", "=::"],
        eqcolon: ["Relation", "-:", "∹"],
        Eqcolon: ["Relation", "-::"],
        colonapprox: ["Relation", ":\\approx"],
        Colonapprox: ["Relation", "::\\approx"],
        colonsim: ["Relation", ":\\sim"],
        Colonsim: ["Relation", "::\\sim"],
        dblcolon: ["Relation", "::", "∷"],
        nuparrow: ["NArrow", "↑", ".06em"],
        ndownarrow: ["NArrow", "↓", ".25em"],
        bigtimes: ["Macro", "\\mathop{\\Large\\kern-.1em\\boldsymbol{\\times}\\kern-.1em}"],
        splitfrac: ["SplitFrac", false],
        splitdfrac: ["SplitFrac", true],
        xmathstrut: "XMathStrut",
        prescript: "Prescript",
        newtagform: ["NewTagForm", false],
        renewtagform: ["NewTagForm", true],
        usetagform: "UseTagForm",
        adjustlimits: [
          "MacroWithTemplate",
          "\\mathop{{#1}\\vphantom{{#3}}}_{{#2}\\vphantom{{#4}}}\\mathop{{#3}\\vphantom{{#1}}}_{{#4}\\vphantom{{#2}}}",
          4,
          ,
          "_",
          ,
          "_"
        ],
        mathtoolsset: "SetOptions"
      }, MathtoolsMethods_js_1.MathtoolsMethods);
      new SymbolMap_js_1.EnvironmentMap("mathtools-environments", ParseMethods_js_1.default.environment, {
        dcases: ["Array", null, "\\{", "", "ll", null, ".2em", "D"],
        rcases: ["Array", null, "", "\\}", "ll", null, ".2em"],
        drcases: ["Array", null, "", "\\}", "ll", null, ".2em", "D"],
        "dcases*": ["Cases", null, "{", "", "D"],
        "rcases*": ["Cases", null, "", "}"],
        "drcases*": ["Cases", null, "", "}", "D"],
        "cases*": ["Cases", null, "{", ""],
        "matrix*": ["MtMatrix", null, null, null],
        "pmatrix*": ["MtMatrix", null, "(", ")"],
        "bmatrix*": ["MtMatrix", null, "[", "]"],
        "Bmatrix*": ["MtMatrix", null, "\\{", "\\}"],
        "vmatrix*": ["MtMatrix", null, "\\vert", "\\vert"],
        "Vmatrix*": ["MtMatrix", null, "\\Vert", "\\Vert"],
        "smallmatrix*": ["MtSmallMatrix", null, null, null],
        psmallmatrix: ["MtSmallMatrix", null, "(", ")", "c"],
        "psmallmatrix*": ["MtSmallMatrix", null, "(", ")"],
        bsmallmatrix: ["MtSmallMatrix", null, "[", "]", "c"],
        "bsmallmatrix*": ["MtSmallMatrix", null, "[", "]"],
        Bsmallmatrix: ["MtSmallMatrix", null, "\\{", "\\}", "c"],
        "Bsmallmatrix*": ["MtSmallMatrix", null, "\\{", "\\}"],
        vsmallmatrix: ["MtSmallMatrix", null, "\\vert", "\\vert", "c"],
        "vsmallmatrix*": ["MtSmallMatrix", null, "\\vert", "\\vert"],
        Vsmallmatrix: ["MtSmallMatrix", null, "\\Vert", "\\Vert", "c"],
        "Vsmallmatrix*": ["MtSmallMatrix", null, "\\Vert", "\\Vert"],
        crampedsubarray: ["Array", null, null, null, null, "0em", "0.1em", "S'", 1],
        multlined: "MtMultlined",
        spreadlines: ["SpreadLines", true],
        lgathered: ["AmsEqnArray", null, null, null, "l", null, ".5em", "D"],
        rgathered: ["AmsEqnArray", null, null, null, "r", null, ".5em", "D"]
      }, MathtoolsMethods_js_1.MathtoolsMethods);
      new SymbolMap_js_1.DelimiterMap("mathtools-delimiters", ParseMethods_js_1.default.delimiter, {
        "\\lparen": "(",
        "\\rparen": ")"
      });
      new SymbolMap_js_1.CommandMap("mathtools-characters", {
        ":": ["CenterColon", true]
      }, MathtoolsMethods_js_1.MathtoolsMethods);
      return MathtoolsMappings;
    }
    var MathtoolsTags = {};
    var hasRequiredMathtoolsTags;
    function requireMathtoolsTags() {
      if (hasRequiredMathtoolsTags) return MathtoolsTags;
      hasRequiredMathtoolsTags = 1;
      var __extends2 = MathtoolsTags && MathtoolsTags.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      var __values2 = MathtoolsTags && MathtoolsTags.__values || function(o) {
        var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i2 = 0;
        if (m) return m.call(o);
        if (o && typeof o.length === "number") return {
          next: function() {
            if (o && i2 >= o.length) o = void 0;
            return { value: o && o[i2++], done: !o };
          }
        };
        throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
      };
      var __read2 = MathtoolsTags && MathtoolsTags.__read || function(o, n) {
        var m = typeof Symbol === "function" && o[Symbol.iterator];
        if (!m) return o;
        var i2 = m.call(o), r2, ar2 = [], e;
        try {
          while ((n === void 0 || n-- > 0) && !(r2 = i2.next()).done) ar2.push(r2.value);
        } catch (error2) {
          e = { error: error2 };
        } finally {
          try {
            if (r2 && !r2.done && (m = i2["return"])) m.call(i2);
          } finally {
            if (e) throw e.error;
          }
        }
        return ar2;
      };
      var __importDefault2 = MathtoolsTags && MathtoolsTags.__importDefault || function(mod2) {
        return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
      };
      Object.defineProperty(MathtoolsTags, "__esModule", { value: true });
      MathtoolsTags.MathtoolsTagFormat = void 0;
      var TexError_js_1 = __importDefault2(requireTexError());
      var Tags_js_1 = requireTags();
      var tagID = 0;
      function MathtoolsTagFormat(config2, jax) {
        var tags2 = jax.parseOptions.options.tags;
        if (tags2 !== "base" && config2.tags.hasOwnProperty(tags2)) {
          Tags_js_1.TagsFactory.add(tags2, config2.tags[tags2]);
        }
        var TagClass = Tags_js_1.TagsFactory.create(jax.parseOptions.options.tags).constructor;
        var TagFormat = (function(_super) {
          __extends2(TagFormat2, _super);
          function TagFormat2() {
            var e_1, _a2;
            var _this = _super.call(this) || this;
            _this.mtFormats = /* @__PURE__ */ new Map();
            _this.mtCurrent = null;
            var forms2 = jax.parseOptions.options.mathtools.tagforms;
            try {
              for (var _b2 = __values2(Object.keys(forms2)), _c = _b2.next(); !_c.done; _c = _b2.next()) {
                var form = _c.value;
                if (!Array.isArray(forms2[form]) || forms2[form].length !== 3) {
                  throw new TexError_js_1.default("InvalidTagFormDef", 'The tag form definition for "%1" should be an array fo three strings', form);
                }
                _this.mtFormats.set(form, forms2[form]);
              }
            } catch (e_1_1) {
              e_1 = { error: e_1_1 };
            } finally {
              try {
                if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
              } finally {
                if (e_1) throw e_1.error;
              }
            }
            return _this;
          }
          TagFormat2.prototype.formatTag = function(tag) {
            if (this.mtCurrent) {
              var _a2 = __read2(this.mtCurrent, 3), left2 = _a2[0], right2 = _a2[1], format2 = _a2[2];
              return format2 ? "".concat(left2).concat(format2, "{").concat(tag, "}").concat(right2) : "".concat(left2).concat(tag).concat(right2);
            }
            return _super.prototype.formatTag.call(this, tag);
          };
          return TagFormat2;
        })(TagClass);
        tagID++;
        var tagName = "MathtoolsTags-" + tagID;
        Tags_js_1.TagsFactory.add(tagName, TagFormat);
        jax.parseOptions.options.tags = tagName;
      }
      MathtoolsTags.MathtoolsTagFormat = MathtoolsTagFormat;
      return MathtoolsTags;
    }
    var MathtoolsItems = {};
    var hasRequiredMathtoolsItems;
    function requireMathtoolsItems() {
      if (hasRequiredMathtoolsItems) return MathtoolsItems;
      hasRequiredMathtoolsItems = 1;
      var __extends2 = MathtoolsItems && MathtoolsItems.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      var __importDefault2 = MathtoolsItems && MathtoolsItems.__importDefault || function(mod2) {
        return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
      };
      Object.defineProperty(MathtoolsItems, "__esModule", { value: true });
      MathtoolsItems.MultlinedItem = void 0;
      var AmsItems_js_1 = requireAmsItems();
      var NodeUtil_js_1 = __importDefault2(requireNodeUtil());
      var TexConstants_js_1 = requireTexConstants();
      var MultlinedItem = (function(_super) {
        __extends2(MultlinedItem2, _super);
        function MultlinedItem2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        Object.defineProperty(MultlinedItem2.prototype, "kind", {
          get: function() {
            return "multlined";
          },
          enumerable: false,
          configurable: true
        });
        MultlinedItem2.prototype.EndTable = function() {
          if (this.Size() || this.row.length) {
            this.EndEntry();
            this.EndRow();
          }
          if (this.table.length > 1) {
            var options2 = this.factory.configuration.options.mathtools;
            var gap2 = options2.multlinegap;
            var firstskip = options2["firstline-afterskip"] || gap2;
            var lastskip = options2["lastline-preskip"] || gap2;
            var first = NodeUtil_js_1.default.getChildren(this.table[0])[0];
            if (NodeUtil_js_1.default.getAttribute(first, "columnalign") !== TexConstants_js_1.TexConstant.Align.RIGHT) {
              first.appendChild(this.create("node", "mspace", [], { width: firstskip }));
            }
            var last = NodeUtil_js_1.default.getChildren(this.table[this.table.length - 1])[0];
            if (NodeUtil_js_1.default.getAttribute(last, "columnalign") !== TexConstants_js_1.TexConstant.Align.LEFT) {
              var top_1 = NodeUtil_js_1.default.getChildren(last)[0];
              top_1.childNodes.unshift(null);
              var space = this.create("node", "mspace", [], { width: lastskip });
              NodeUtil_js_1.default.setChild(top_1, 0, space);
            }
          }
          _super.prototype.EndTable.call(this);
        };
        return MultlinedItem2;
      })(AmsItems_js_1.MultlineItem);
      MathtoolsItems.MultlinedItem = MultlinedItem;
      return MathtoolsItems;
    }
    var hasRequiredMathtoolsConfiguration;
    function requireMathtoolsConfiguration() {
      if (hasRequiredMathtoolsConfiguration) return MathtoolsConfiguration;
      hasRequiredMathtoolsConfiguration = 1;
      (function(exports2) {
        var __values2 = MathtoolsConfiguration && MathtoolsConfiguration.__values || function(o) {
          var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i2 = 0;
          if (m) return m.call(o);
          if (o && typeof o.length === "number") return {
            next: function() {
              if (o && i2 >= o.length) o = void 0;
              return { value: o && o[i2++], done: !o };
            }
          };
          throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
        };
        var __importDefault2 = MathtoolsConfiguration && MathtoolsConfiguration.__importDefault || function(mod2) {
          return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
        };
        var _a2;
        Object.defineProperty(exports2, "__esModule", { value: true });
        exports2.MathtoolsConfiguration = exports2.fixPrescripts = exports2.PAIREDDELIMS = void 0;
        var Configuration_js_1 = requireConfiguration();
        var SymbolMap_js_1 = requireSymbolMap();
        var NodeUtil_js_1 = __importDefault2(requireNodeUtil());
        var Options_js_1 = requireOptions$1();
        requireMathtoolsMappings();
        var MathtoolsUtil_js_1 = requireMathtoolsUtil();
        var MathtoolsTags_js_1 = requireMathtoolsTags();
        var MathtoolsItems_js_1 = requireMathtoolsItems();
        exports2.PAIREDDELIMS = "mathtools-paired-delims";
        function initMathtools(config2) {
          new SymbolMap_js_1.CommandMap(exports2.PAIREDDELIMS, {}, {});
          config2.append(Configuration_js_1.Configuration.local({ handler: { macro: [exports2.PAIREDDELIMS] }, priority: -5 }));
        }
        function configMathtools(config2, jax) {
          var e_1, _a3;
          var parser2 = jax.parseOptions;
          var pairedDelims = parser2.options.mathtools.pairedDelimiters;
          try {
            for (var _b2 = __values2(Object.keys(pairedDelims)), _c = _b2.next(); !_c.done; _c = _b2.next()) {
              var cs = _c.value;
              MathtoolsUtil_js_1.MathtoolsUtil.addPairedDelims(parser2, cs, pairedDelims[cs]);
            }
          } catch (e_1_1) {
            e_1 = { error: e_1_1 };
          } finally {
            try {
              if (_c && !_c.done && (_a3 = _b2.return)) _a3.call(_b2);
            } finally {
              if (e_1) throw e_1.error;
            }
          }
          (0, MathtoolsTags_js_1.MathtoolsTagFormat)(config2, jax);
        }
        function fixPrescripts(_a3) {
          var e_2, _b2, e_3, _c, e_4, _d;
          var data = _a3.data;
          try {
            for (var _e2 = __values2(data.getList("mmultiscripts")), _f = _e2.next(); !_f.done; _f = _e2.next()) {
              var node2 = _f.value;
              if (!node2.getProperty("fixPrescript"))
                continue;
              var childNodes = NodeUtil_js_1.default.getChildren(node2);
              var n = 0;
              try {
                for (var _g = (e_3 = void 0, __values2([1, 2])), _h = _g.next(); !_h.done; _h = _g.next()) {
                  var i2 = _h.value;
                  if (!childNodes[i2]) {
                    NodeUtil_js_1.default.setChild(node2, i2, data.nodeFactory.create("node", "none"));
                    n++;
                  }
                }
              } catch (e_3_1) {
                e_3 = { error: e_3_1 };
              } finally {
                try {
                  if (_h && !_h.done && (_c = _g.return)) _c.call(_g);
                } finally {
                  if (e_3) throw e_3.error;
                }
              }
              try {
                for (var _j = (e_4 = void 0, __values2([4, 5])), _k = _j.next(); !_k.done; _k = _j.next()) {
                  var i2 = _k.value;
                  if (NodeUtil_js_1.default.isType(childNodes[i2], "mrow") && NodeUtil_js_1.default.getChildren(childNodes[i2]).length === 0) {
                    NodeUtil_js_1.default.setChild(node2, i2, data.nodeFactory.create("node", "none"));
                  }
                }
              } catch (e_4_1) {
                e_4 = { error: e_4_1 };
              } finally {
                try {
                  if (_k && !_k.done && (_d = _j.return)) _d.call(_j);
                } finally {
                  if (e_4) throw e_4.error;
                }
              }
              if (n === 2) {
                childNodes.splice(1, 2);
              }
            }
          } catch (e_2_1) {
            e_2 = { error: e_2_1 };
          } finally {
            try {
              if (_f && !_f.done && (_b2 = _e2.return)) _b2.call(_e2);
            } finally {
              if (e_2) throw e_2.error;
            }
          }
        }
        exports2.fixPrescripts = fixPrescripts;
        exports2.MathtoolsConfiguration = Configuration_js_1.Configuration.create("mathtools", {
          handler: {
            macro: ["mathtools-macros", "mathtools-delimiters"],
            environment: ["mathtools-environments"],
            delimiter: ["mathtools-delimiters"],
            character: ["mathtools-characters"]
          },
          items: (_a2 = {}, _a2[MathtoolsItems_js_1.MultlinedItem.prototype.kind] = MathtoolsItems_js_1.MultlinedItem, _a2),
          init: initMathtools,
          config: configMathtools,
          postprocessors: [[fixPrescripts, -6]],
          options: {
            mathtools: {
              "multlinegap": "1em",
              "multlined-pos": "c",
              "firstline-afterskip": "",
              "lastline-preskip": "",
              "smallmatrix-align": "c",
              "shortvdotsadjustabove": ".2em",
              "shortvdotsadjustbelow": ".2em",
              "centercolon": false,
              "centercolon-offset": ".04em",
              "thincolon-dx": "-.04em",
              "thincolon-dw": "-.08em",
              "use-unicode": false,
              "prescript-sub-format": "",
              "prescript-sup-format": "",
              "prescript-arg-format": "",
              "allow-mathtoolsset": true,
              pairedDelimiters: (0, Options_js_1.expandable)({}),
              tagforms: (0, Options_js_1.expandable)({})
            }
          }
        });
      })(MathtoolsConfiguration);
      return MathtoolsConfiguration;
    }
    var MhchemConfiguration = {};
    var mhchemParser = {};
    var hasRequiredMhchemParser;
    function requireMhchemParser() {
      if (hasRequiredMhchemParser) return mhchemParser;
      hasRequiredMhchemParser = 1;
      Object.defineProperty(mhchemParser, "__esModule", { value: true });
      mhchemParser.mhchemParser = void 0;
      var mhchemParser$1 = (function() {
        function mhchemParser2() {
        }
        mhchemParser2.toTex = function(input2, type) {
          return _mhchemTexify.go(_mhchemParser.go(input2, type), type !== "tex");
        };
        return mhchemParser2;
      })();
      mhchemParser.mhchemParser = mhchemParser$1;
      function _mhchemCreateTransitions(o) {
        var pattern, state;
        var transitions = {};
        for (pattern in o) {
          for (state in o[pattern]) {
            var stateArray = state.split("|");
            o[pattern][state].stateArray = stateArray;
            for (var i2 = 0; i2 < stateArray.length; i2++) {
              transitions[stateArray[i2]] = [];
            }
          }
        }
        for (pattern in o) {
          for (state in o[pattern]) {
            var stateArray = o[pattern][state].stateArray || [];
            for (var i2 = 0; i2 < stateArray.length; i2++) {
              var p = o[pattern][state];
              p.action_ = [].concat(p.action_);
              for (var k2 = 0; k2 < p.action_.length; k2++) {
                if (typeof p.action_[k2] === "string") {
                  p.action_[k2] = { type_: p.action_[k2] };
                }
              }
              var patternArray = pattern.split("|");
              for (var j = 0; j < patternArray.length; j++) {
                if (stateArray[i2] === "*") {
                  var t2 = void 0;
                  for (t2 in transitions) {
                    transitions[t2].push({ pattern: patternArray[j], task: p });
                  }
                } else {
                  transitions[stateArray[i2]].push({ pattern: patternArray[j], task: p });
                }
              }
            }
          }
        }
        return transitions;
      }
      var _mhchemParser = {
        go: function(input2, stateMachine) {
          if (!input2) {
            return [];
          }
          if (stateMachine === void 0) {
            stateMachine = "ce";
          }
          var state = "0";
          var buffer2 = {};
          buffer2["parenthesisLevel"] = 0;
          input2 = input2.replace(/\n/g, " ");
          input2 = input2.replace(/[\u2212\u2013\u2014\u2010]/g, "-");
          input2 = input2.replace(/[\u2026]/g, "...");
          var lastInput;
          var watchdog = 10;
          var output2 = [];
          while (true) {
            if (lastInput !== input2) {
              watchdog = 10;
              lastInput = input2;
            } else {
              watchdog--;
            }
            var machine = _mhchemParser.stateMachines[stateMachine];
            var t2 = machine.transitions[state] || machine.transitions["*"];
            iterateTransitions: for (var i2 = 0; i2 < t2.length; i2++) {
              var matches = _mhchemParser.patterns.match_(t2[i2].pattern, input2);
              if (matches) {
                var task = t2[i2].task;
                for (var iA = 0; iA < task.action_.length; iA++) {
                  var o = void 0;
                  if (machine.actions[task.action_[iA].type_]) {
                    o = machine.actions[task.action_[iA].type_](buffer2, matches.match_, task.action_[iA].option);
                  } else if (_mhchemParser.actions[task.action_[iA].type_]) {
                    o = _mhchemParser.actions[task.action_[iA].type_](buffer2, matches.match_, task.action_[iA].option);
                  } else {
                    throw ["MhchemBugA", "mhchem bug A. Please report. (" + task.action_[iA].type_ + ")"];
                  }
                  _mhchemParser.concatArray(output2, o);
                }
                state = task.nextState || state;
                if (input2.length > 0) {
                  if (!task.revisit) {
                    input2 = matches.remainder;
                  }
                  if (!task.toContinue) {
                    break iterateTransitions;
                  }
                } else {
                  return output2;
                }
              }
            }
            if (watchdog <= 0) {
              throw ["MhchemBugU", "mhchem bug U. Please report."];
            }
          }
        },
        concatArray: function(a, b) {
          if (b) {
            if (Array.isArray(b)) {
              for (var iB = 0; iB < b.length; iB++) {
                a.push(b[iB]);
              }
            } else {
              a.push(b);
            }
          }
        },
        patterns: {
          patterns: {
            "empty": /^$/,
            "else": /^./,
            "else2": /^./,
            "space": /^\s/,
            "space A": /^\s(?=[A-Z\\$])/,
            "space$": /^\s$/,
            "a-z": /^[a-z]/,
            "x": /^x/,
            "x$": /^x$/,
            "i$": /^i$/,
            "letters": /^(?:[a-zA-Z\u03B1-\u03C9\u0391-\u03A9?@]|(?:\\(?:alpha|beta|gamma|delta|epsilon|zeta|eta|theta|iota|kappa|lambda|mu|nu|xi|omicron|pi|rho|sigma|tau|upsilon|phi|chi|psi|omega|Gamma|Delta|Theta|Lambda|Xi|Pi|Sigma|Upsilon|Phi|Psi|Omega)(?:\s+|\{\}|(?![a-zA-Z]))))+/,
            "\\greek": /^\\(?:alpha|beta|gamma|delta|epsilon|zeta|eta|theta|iota|kappa|lambda|mu|nu|xi|omicron|pi|rho|sigma|tau|upsilon|phi|chi|psi|omega|Gamma|Delta|Theta|Lambda|Xi|Pi|Sigma|Upsilon|Phi|Psi|Omega)(?:\s+|\{\}|(?![a-zA-Z]))/,
            "one lowercase latin letter $": /^(?:([a-z])(?:$|[^a-zA-Z]))$/,
            "$one lowercase latin letter$ $": /^\$(?:([a-z])(?:$|[^a-zA-Z]))\$$/,
            "one lowercase greek letter $": /^(?:\$?[\u03B1-\u03C9]\$?|\$?\\(?:alpha|beta|gamma|delta|epsilon|zeta|eta|theta|iota|kappa|lambda|mu|nu|xi|omicron|pi|rho|sigma|tau|upsilon|phi|chi|psi|omega)\s*\$?)(?:\s+|\{\}|(?![a-zA-Z]))$/,
            "digits": /^[0-9]+/,
            "-9.,9": /^[+\-]?(?:[0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+))/,
            "-9.,9 no missing 0": /^[+\-]?[0-9]+(?:[.,][0-9]+)?/,
            "(-)(9.,9)(e)(99)": function(input2) {
              var match = input2.match(/^(\+\-|\+\/\-|\+|\-|\\pm\s?)?([0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+))?(\((?:[0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+))\))?(?:(?:([eE])|\s*(\*|x|\\times|\u00D7)\s*10\^)([+\-]?[0-9]+|\{[+\-]?[0-9]+\}))?/);
              if (match && match[0]) {
                return { match_: match.slice(1), remainder: input2.substr(match[0].length) };
              }
              return null;
            },
            "(-)(9)^(-9)": /^(\+\-|\+\/\-|\+|\-|\\pm\s?)?([0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+)?)\^([+\-]?[0-9]+|\{[+\-]?[0-9]+\})/,
            "state of aggregation $": function(input2) {
              var a = _mhchemParser.patterns.findObserveGroups(input2, "", /^\([a-z]{1,3}(?=[\),])/, ")", "");
              if (a && a.remainder.match(/^($|[\s,;\)\]\}])/)) {
                return a;
              }
              var match = input2.match(/^(?:\((?:\\ca\s?)?\$[amothc]\$\))/);
              if (match) {
                return { match_: match[0], remainder: input2.substr(match[0].length) };
              }
              return null;
            },
            "_{(state of aggregation)}$": /^_\{(\([a-z]{1,3}\))\}/,
            "{[(": /^(?:\\\{|\[|\()/,
            ")]}": /^(?:\)|\]|\\\})/,
            ", ": /^[,;]\s*/,
            ",": /^[,;]/,
            ".": /^[.]/,
            ". __* ": /^([.\u22C5\u00B7\u2022]|[*])\s*/,
            "...": /^\.\.\.(?=$|[^.])/,
            "^{(...)}": function(input2) {
              return _mhchemParser.patterns.findObserveGroups(input2, "^{", "", "", "}");
            },
            "^($...$)": function(input2) {
              return _mhchemParser.patterns.findObserveGroups(input2, "^", "$", "$", "");
            },
            "^a": /^\^([0-9]+|[^\\_])/,
            "^\\x{}{}": function(input2) {
              return _mhchemParser.patterns.findObserveGroups(input2, "^", /^\\[a-zA-Z]+\{/, "}", "", "", "{", "}", "", true);
            },
            "^\\x{}": function(input2) {
              return _mhchemParser.patterns.findObserveGroups(input2, "^", /^\\[a-zA-Z]+\{/, "}", "");
            },
            "^\\x": /^\^(\\[a-zA-Z]+)\s*/,
            "^(-1)": /^\^(-?\d+)/,
            "'": /^'/,
            "_{(...)}": function(input2) {
              return _mhchemParser.patterns.findObserveGroups(input2, "_{", "", "", "}");
            },
            "_($...$)": function(input2) {
              return _mhchemParser.patterns.findObserveGroups(input2, "_", "$", "$", "");
            },
            "_9": /^_([+\-]?[0-9]+|[^\\])/,
            "_\\x{}{}": function(input2) {
              return _mhchemParser.patterns.findObserveGroups(input2, "_", /^\\[a-zA-Z]+\{/, "}", "", "", "{", "}", "", true);
            },
            "_\\x{}": function(input2) {
              return _mhchemParser.patterns.findObserveGroups(input2, "_", /^\\[a-zA-Z]+\{/, "}", "");
            },
            "_\\x": /^_(\\[a-zA-Z]+)\s*/,
            "^_": /^(?:\^(?=_)|\_(?=\^)|[\^_]$)/,
            "{}^": /^\{\}(?=\^)/,
            "{}": /^\{\}/,
            "{...}": function(input2) {
              return _mhchemParser.patterns.findObserveGroups(input2, "", "{", "}", "");
            },
            "{(...)}": function(input2) {
              return _mhchemParser.patterns.findObserveGroups(input2, "{", "", "", "}");
            },
            "$...$": function(input2) {
              return _mhchemParser.patterns.findObserveGroups(input2, "", "$", "$", "");
            },
            "${(...)}$__$(...)$": function(input2) {
              return _mhchemParser.patterns.findObserveGroups(input2, "${", "", "", "}$") || _mhchemParser.patterns.findObserveGroups(input2, "$", "", "", "$");
            },
            "=<>": /^[=<>]/,
            "#": /^[#\u2261]/,
            "+": /^\+/,
            "-$": /^-(?=[\s_},;\]/]|$|\([a-z]+\))/,
            "-9": /^-(?=[0-9])/,
            "- orbital overlap": /^-(?=(?:[spd]|sp)(?:$|[\s,;\)\]\}]))/,
            "-": /^-/,
            "pm-operator": /^(?:\\pm|\$\\pm\$|\+-|\+\/-)/,
            "operator": /^(?:\+|(?:[\-=<>]|<<|>>|\\approx|\$\\approx\$)(?=\s|$|-?[0-9]))/,
            "arrowUpDown": /^(?:v|\(v\)|\^|\(\^\))(?=$|[\s,;\)\]\}])/,
            "\\bond{(...)}": function(input2) {
              return _mhchemParser.patterns.findObserveGroups(input2, "\\bond{", "", "", "}");
            },
            "->": /^(?:<->|<-->|->|<-|<=>>|<<=>|<=>|[\u2192\u27F6\u21CC])/,
            "CMT": /^[CMT](?=\[)/,
            "[(...)]": function(input2) {
              return _mhchemParser.patterns.findObserveGroups(input2, "[", "", "", "]");
            },
            "1st-level escape": /^(&|\\\\|\\hline)\s*/,
            "\\,": /^(?:\\[,\ ;:])/,
            "\\x{}{}": function(input2) {
              return _mhchemParser.patterns.findObserveGroups(input2, "", /^\\[a-zA-Z]+\{/, "}", "", "", "{", "}", "", true);
            },
            "\\x{}": function(input2) {
              return _mhchemParser.patterns.findObserveGroups(input2, "", /^\\[a-zA-Z]+\{/, "}", "");
            },
            "\\ca": /^\\ca(?:\s+|(?![a-zA-Z]))/,
            "\\x": /^(?:\\[a-zA-Z]+\s*|\\[_&{}%])/,
            "orbital": /^(?:[0-9]{1,2}[spdfgh]|[0-9]{0,2}sp)(?=$|[^a-zA-Z])/,
            "others": /^[\/~|]/,
            "\\frac{(...)}": function(input2) {
              return _mhchemParser.patterns.findObserveGroups(input2, "\\frac{", "", "", "}", "{", "", "", "}");
            },
            "\\overset{(...)}": function(input2) {
              return _mhchemParser.patterns.findObserveGroups(input2, "\\overset{", "", "", "}", "{", "", "", "}");
            },
            "\\underset{(...)}": function(input2) {
              return _mhchemParser.patterns.findObserveGroups(input2, "\\underset{", "", "", "}", "{", "", "", "}");
            },
            "\\underbrace{(...)}": function(input2) {
              return _mhchemParser.patterns.findObserveGroups(input2, "\\underbrace{", "", "", "}_", "{", "", "", "}");
            },
            "\\color{(...)}": function(input2) {
              return _mhchemParser.patterns.findObserveGroups(input2, "\\color{", "", "", "}");
            },
            "\\color{(...)}{(...)}": function(input2) {
              return _mhchemParser.patterns.findObserveGroups(input2, "\\color{", "", "", "}", "{", "", "", "}") || _mhchemParser.patterns.findObserveGroups(input2, "\\color", "\\", "", /^(?=\{)/, "{", "", "", "}");
            },
            "\\ce{(...)}": function(input2) {
              return _mhchemParser.patterns.findObserveGroups(input2, "\\ce{", "", "", "}");
            },
            "\\pu{(...)}": function(input2) {
              return _mhchemParser.patterns.findObserveGroups(input2, "\\pu{", "", "", "}");
            },
            "oxidation$": /^(?:[+-][IVX]+|(?:\\pm|\$\\pm\$|\+-|\+\/-)\s*0)$/,
            "d-oxidation$": /^(?:[+-]?[IVX]+|(?:\\pm|\$\\pm\$|\+-|\+\/-)\s*0)$/,
            "1/2$": /^[+\-]?(?:[0-9]+|\$[a-z]\$|[a-z])\/[0-9]+(?:\$[a-z]\$|[a-z])?$/,
            "amount": function(input2) {
              var match;
              match = input2.match(/^(?:(?:(?:\([+\-]?[0-9]+\/[0-9]+\)|[+\-]?(?:[0-9]+|\$[a-z]\$|[a-z])\/[0-9]+|[+\-]?[0-9]+[.,][0-9]+|[+\-]?\.[0-9]+|[+\-]?[0-9]+)(?:[a-z](?=\s*[A-Z]))?)|[+\-]?[a-z](?=\s*[A-Z])|\+(?!\s))/);
              if (match) {
                return { match_: match[0], remainder: input2.substr(match[0].length) };
              }
              var a = _mhchemParser.patterns.findObserveGroups(input2, "", "$", "$", "");
              if (a) {
                match = a.match_.match(/^\$(?:\(?[+\-]?(?:[0-9]*[a-z]?[+\-])?[0-9]*[a-z](?:[+\-][0-9]*[a-z]?)?\)?|\+|-)\$$/);
                if (match) {
                  return { match_: match[0], remainder: input2.substr(match[0].length) };
                }
              }
              return null;
            },
            "amount2": function(input2) {
              return this["amount"](input2);
            },
            "(KV letters),": /^(?:[A-Z][a-z]{0,2}|i)(?=,)/,
            "formula$": function(input2) {
              if (input2.match(/^\([a-z]+\)$/)) {
                return null;
              }
              var match = input2.match(/^(?:[a-z]|(?:[0-9\ \+\-\,\.\(\)]+[a-z])+[0-9\ \+\-\,\.\(\)]*|(?:[a-z][0-9\ \+\-\,\.\(\)]+)+[a-z]?)$/);
              if (match) {
                return { match_: match[0], remainder: input2.substr(match[0].length) };
              }
              return null;
            },
            "uprightEntities": /^(?:pH|pOH|pC|pK|iPr|iBu)(?=$|[^a-zA-Z])/,
            "/": /^\s*(\/)\s*/,
            "//": /^\s*(\/\/)\s*/,
            "*": /^\s*[*.]\s*/
          },
          findObserveGroups: function(input2, begExcl, begIncl, endIncl, endExcl, beg2Excl, beg2Incl, end2Incl, end2Excl, combine) {
            var _match = function(input3, pattern) {
              if (typeof pattern === "string") {
                if (input3.indexOf(pattern) !== 0) {
                  return null;
                }
                return pattern;
              } else {
                var match_1 = input3.match(pattern);
                if (!match_1) {
                  return null;
                }
                return match_1[0];
              }
            };
            var _findObserveGroups = function(input3, i2, endChars) {
              var braces = 0;
              while (i2 < input3.length) {
                var a = input3.charAt(i2);
                var match_2 = _match(input3.substr(i2), endChars);
                if (match_2 !== null && braces === 0) {
                  return { endMatchBegin: i2, endMatchEnd: i2 + match_2.length };
                } else if (a === "{") {
                  braces++;
                } else if (a === "}") {
                  if (braces === 0) {
                    throw ["ExtraCloseMissingOpen", "Extra close brace or missing open brace"];
                  } else {
                    braces--;
                  }
                }
                i2++;
              }
              if (braces > 0) {
                return null;
              }
              return null;
            };
            var match = _match(input2, begExcl);
            if (match === null) {
              return null;
            }
            input2 = input2.substr(match.length);
            match = _match(input2, begIncl);
            if (match === null) {
              return null;
            }
            var e = _findObserveGroups(input2, match.length, endIncl || endExcl);
            if (e === null) {
              return null;
            }
            var match1 = input2.substring(0, endIncl ? e.endMatchEnd : e.endMatchBegin);
            if (!(beg2Excl || beg2Incl)) {
              return {
                match_: match1,
                remainder: input2.substr(e.endMatchEnd)
              };
            } else {
              var group2 = this.findObserveGroups(input2.substr(e.endMatchEnd), beg2Excl, beg2Incl, end2Incl, end2Excl);
              if (group2 === null) {
                return null;
              }
              var matchRet = [match1, group2.match_];
              return {
                match_: combine ? matchRet.join("") : matchRet,
                remainder: group2.remainder
              };
            }
          },
          match_: function(m, input2) {
            var pattern = _mhchemParser.patterns.patterns[m];
            if (pattern === void 0) {
              throw ["MhchemBugP", "mhchem bug P. Please report. (" + m + ")"];
            } else if (typeof pattern === "function") {
              return _mhchemParser.patterns.patterns[m](input2);
            } else {
              var match = input2.match(pattern);
              if (match) {
                if (match.length > 2) {
                  return { match_: match.slice(1), remainder: input2.substr(match[0].length) };
                } else {
                  return { match_: match[1] || match[0], remainder: input2.substr(match[0].length) };
                }
              }
              return null;
            }
          }
        },
        actions: {
          "a=": function(buffer2, m) {
            buffer2.a = (buffer2.a || "") + m;
            return void 0;
          },
          "b=": function(buffer2, m) {
            buffer2.b = (buffer2.b || "") + m;
            return void 0;
          },
          "p=": function(buffer2, m) {
            buffer2.p = (buffer2.p || "") + m;
            return void 0;
          },
          "o=": function(buffer2, m) {
            buffer2.o = (buffer2.o || "") + m;
            return void 0;
          },
          "o=+p1": function(buffer2, _m, a) {
            buffer2.o = (buffer2.o || "") + a;
            return void 0;
          },
          "q=": function(buffer2, m) {
            buffer2.q = (buffer2.q || "") + m;
            return void 0;
          },
          "d=": function(buffer2, m) {
            buffer2.d = (buffer2.d || "") + m;
            return void 0;
          },
          "rm=": function(buffer2, m) {
            buffer2.rm = (buffer2.rm || "") + m;
            return void 0;
          },
          "text=": function(buffer2, m) {
            buffer2.text_ = (buffer2.text_ || "") + m;
            return void 0;
          },
          "insert": function(_buffer, _m, a) {
            return { type_: a };
          },
          "insert+p1": function(_buffer, m, a) {
            return { type_: a, p1: m };
          },
          "insert+p1+p2": function(_buffer, m, a) {
            return { type_: a, p1: m[0], p2: m[1] };
          },
          "copy": function(_buffer, m) {
            return m;
          },
          "write": function(_buffer, _m, a) {
            return a;
          },
          "rm": function(_buffer, m) {
            return { type_: "rm", p1: m };
          },
          "text": function(_buffer, m) {
            return _mhchemParser.go(m, "text");
          },
          "tex-math": function(_buffer, m) {
            return _mhchemParser.go(m, "tex-math");
          },
          "tex-math tight": function(_buffer, m) {
            return _mhchemParser.go(m, "tex-math tight");
          },
          "bond": function(_buffer, m, k2) {
            return { type_: "bond", kind_: k2 || m };
          },
          "color0-output": function(_buffer, m) {
            return { type_: "color0", color: m };
          },
          "ce": function(_buffer, m) {
            return _mhchemParser.go(m, "ce");
          },
          "pu": function(_buffer, m) {
            return _mhchemParser.go(m, "pu");
          },
          "1/2": function(_buffer, m) {
            var ret = [];
            if (m.match(/^[+\-]/)) {
              ret.push(m.substr(0, 1));
              m = m.substr(1);
            }
            var n = m.match(/^([0-9]+|\$[a-z]\$|[a-z])\/([0-9]+)(\$[a-z]\$|[a-z])?$/);
            n[1] = n[1].replace(/\$/g, "");
            ret.push({ type_: "frac", p1: n[1], p2: n[2] });
            if (n[3]) {
              n[3] = n[3].replace(/\$/g, "");
              ret.push({ type_: "tex-math", p1: n[3] });
            }
            return ret;
          },
          "9,9": function(_buffer, m) {
            return _mhchemParser.go(m, "9,9");
          }
        },
        stateMachines: {
          "tex": {
            transitions: _mhchemCreateTransitions({
              "empty": {
                "0": { action_: "copy" }
              },
              "\\ce{(...)}": {
                "0": { action_: [{ type_: "write", option: "{" }, "ce", { type_: "write", option: "}" }] }
              },
              "\\pu{(...)}": {
                "0": { action_: [{ type_: "write", option: "{" }, "pu", { type_: "write", option: "}" }] }
              },
              "else": {
                "0": { action_: "copy" }
              }
            }),
            actions: {}
          },
          "ce": {
            transitions: _mhchemCreateTransitions({
              "empty": {
                "*": { action_: "output" }
              },
              "else": {
                "0|1|2": { action_: "beginsWithBond=false", revisit: true, toContinue: true }
              },
              "oxidation$": {
                "0": { action_: "oxidation-output" }
              },
              "CMT": {
                "r": { action_: "rdt=", nextState: "rt" },
                "rd": { action_: "rqt=", nextState: "rdt" }
              },
              "arrowUpDown": {
                "0|1|2|as": { action_: ["sb=false", "output", "operator"], nextState: "1" }
              },
              "uprightEntities": {
                "0|1|2": { action_: ["o=", "output"], nextState: "1" }
              },
              "orbital": {
                "0|1|2|3": { action_: "o=", nextState: "o" }
              },
              "->": {
                "0|1|2|3": { action_: "r=", nextState: "r" },
                "a|as": { action_: ["output", "r="], nextState: "r" },
                "*": { action_: ["output", "r="], nextState: "r" }
              },
              "+": {
                "o": { action_: "d= kv", nextState: "d" },
                "d|D": { action_: "d=", nextState: "d" },
                "q": { action_: "d=", nextState: "qd" },
                "qd|qD": { action_: "d=", nextState: "qd" },
                "dq": { action_: ["output", "d="], nextState: "d" },
                "3": { action_: ["sb=false", "output", "operator"], nextState: "0" }
              },
              "amount": {
                "0|2": { action_: "a=", nextState: "a" }
              },
              "pm-operator": {
                "0|1|2|a|as": { action_: ["sb=false", "output", { type_: "operator", option: "\\pm" }], nextState: "0" }
              },
              "operator": {
                "0|1|2|a|as": { action_: ["sb=false", "output", "operator"], nextState: "0" }
              },
              "-$": {
                "o|q": { action_: ["charge or bond", "output"], nextState: "qd" },
                "d": { action_: "d=", nextState: "d" },
                "D": { action_: ["output", { type_: "bond", option: "-" }], nextState: "3" },
                "q": { action_: "d=", nextState: "qd" },
                "qd": { action_: "d=", nextState: "qd" },
                "qD|dq": { action_: ["output", { type_: "bond", option: "-" }], nextState: "3" }
              },
              "-9": {
                "3|o": { action_: ["output", { type_: "insert", option: "hyphen" }], nextState: "3" }
              },
              "- orbital overlap": {
                "o": { action_: ["output", { type_: "insert", option: "hyphen" }], nextState: "2" },
                "d": { action_: ["output", { type_: "insert", option: "hyphen" }], nextState: "2" }
              },
              "-": {
                "0|1|2": { action_: [{ type_: "output", option: 1 }, "beginsWithBond=true", { type_: "bond", option: "-" }], nextState: "3" },
                "3": { action_: { type_: "bond", option: "-" } },
                "a": { action_: ["output", { type_: "insert", option: "hyphen" }], nextState: "2" },
                "as": { action_: [{ type_: "output", option: 2 }, { type_: "bond", option: "-" }], nextState: "3" },
                "b": { action_: "b=" },
                "o": { action_: { type_: "- after o/d", option: false }, nextState: "2" },
                "q": { action_: { type_: "- after o/d", option: false }, nextState: "2" },
                "d|qd|dq": { action_: { type_: "- after o/d", option: true }, nextState: "2" },
                "D|qD|p": { action_: ["output", { type_: "bond", option: "-" }], nextState: "3" }
              },
              "amount2": {
                "1|3": { action_: "a=", nextState: "a" }
              },
              "letters": {
                "0|1|2|3|a|as|b|p|bp|o": { action_: "o=", nextState: "o" },
                "q|dq": { action_: ["output", "o="], nextState: "o" },
                "d|D|qd|qD": { action_: "o after d", nextState: "o" }
              },
              "digits": {
                "o": { action_: "q=", nextState: "q" },
                "d|D": { action_: "q=", nextState: "dq" },
                "q": { action_: ["output", "o="], nextState: "o" },
                "a": { action_: "o=", nextState: "o" }
              },
              "space A": {
                "b|p|bp": { action_: [] }
              },
              "space": {
                "a": { action_: [], nextState: "as" },
                "0": { action_: "sb=false" },
                "1|2": { action_: "sb=true" },
                "r|rt|rd|rdt|rdq": { action_: "output", nextState: "0" },
                "*": { action_: ["output", "sb=true"], nextState: "1" }
              },
              "1st-level escape": {
                "1|2": { action_: ["output", { type_: "insert+p1", option: "1st-level escape" }] },
                "*": { action_: ["output", { type_: "insert+p1", option: "1st-level escape" }], nextState: "0" }
              },
              "[(...)]": {
                "r|rt": { action_: "rd=", nextState: "rd" },
                "rd|rdt": { action_: "rq=", nextState: "rdq" }
              },
              "...": {
                "o|d|D|dq|qd|qD": { action_: ["output", { type_: "bond", option: "..." }], nextState: "3" },
                "*": { action_: [{ type_: "output", option: 1 }, { type_: "insert", option: "ellipsis" }], nextState: "1" }
              },
              ". __* ": {
                "*": { action_: ["output", { type_: "insert", option: "addition compound" }], nextState: "1" }
              },
              "state of aggregation $": {
                "*": { action_: ["output", "state of aggregation"], nextState: "1" }
              },
              "{[(": {
                "a|as|o": { action_: ["o=", "output", "parenthesisLevel++"], nextState: "2" },
                "0|1|2|3": { action_: ["o=", "output", "parenthesisLevel++"], nextState: "2" },
                "*": { action_: ["output", "o=", "output", "parenthesisLevel++"], nextState: "2" }
              },
              ")]}": {
                "0|1|2|3|b|p|bp|o": { action_: ["o=", "parenthesisLevel--"], nextState: "o" },
                "a|as|d|D|q|qd|qD|dq": { action_: ["output", "o=", "parenthesisLevel--"], nextState: "o" }
              },
              ", ": {
                "*": { action_: ["output", "comma"], nextState: "0" }
              },
              "^_": {
                "*": { action_: [] }
              },
              "^{(...)}|^($...$)": {
                "0|1|2|as": { action_: "b=", nextState: "b" },
                "p": { action_: "b=", nextState: "bp" },
                "3|o": { action_: "d= kv", nextState: "D" },
                "q": { action_: "d=", nextState: "qD" },
                "d|D|qd|qD|dq": { action_: ["output", "d="], nextState: "D" }
              },
              "^a|^\\x{}{}|^\\x{}|^\\x|'": {
                "0|1|2|as": { action_: "b=", nextState: "b" },
                "p": { action_: "b=", nextState: "bp" },
                "3|o": { action_: "d= kv", nextState: "d" },
                "q": { action_: "d=", nextState: "qd" },
                "d|qd|D|qD": { action_: "d=" },
                "dq": { action_: ["output", "d="], nextState: "d" }
              },
              "_{(state of aggregation)}$": {
                "d|D|q|qd|qD|dq": { action_: ["output", "q="], nextState: "q" }
              },
              "_{(...)}|_($...$)|_9|_\\x{}{}|_\\x{}|_\\x": {
                "0|1|2|as": { action_: "p=", nextState: "p" },
                "b": { action_: "p=", nextState: "bp" },
                "3|o": { action_: "q=", nextState: "q" },
                "d|D": { action_: "q=", nextState: "dq" },
                "q|qd|qD|dq": { action_: ["output", "q="], nextState: "q" }
              },
              "=<>": {
                "0|1|2|3|a|as|o|q|d|D|qd|qD|dq": { action_: [{ type_: "output", option: 2 }, "bond"], nextState: "3" }
              },
              "#": {
                "0|1|2|3|a|as|o": { action_: [{ type_: "output", option: 2 }, { type_: "bond", option: "#" }], nextState: "3" }
              },
              "{}^": {
                "*": { action_: [{ type_: "output", option: 1 }, { type_: "insert", option: "tinySkip" }], nextState: "1" }
              },
              "{}": {
                "*": { action_: { type_: "output", option: 1 }, nextState: "1" }
              },
              "{...}": {
                "0|1|2|3|a|as|b|p|bp": { action_: "o=", nextState: "o" },
                "o|d|D|q|qd|qD|dq": { action_: ["output", "o="], nextState: "o" }
              },
              "$...$": {
                "a": { action_: "a=" },
                "0|1|2|3|as|b|p|bp|o": { action_: "o=", nextState: "o" },
                "as|o": { action_: "o=" },
                "q|d|D|qd|qD|dq": { action_: ["output", "o="], nextState: "o" }
              },
              "\\bond{(...)}": {
                "*": { action_: [{ type_: "output", option: 2 }, "bond"], nextState: "3" }
              },
              "\\frac{(...)}": {
                "*": { action_: [{ type_: "output", option: 1 }, "frac-output"], nextState: "3" }
              },
              "\\overset{(...)}": {
                "*": { action_: [{ type_: "output", option: 2 }, "overset-output"], nextState: "3" }
              },
              "\\underset{(...)}": {
                "*": { action_: [{ type_: "output", option: 2 }, "underset-output"], nextState: "3" }
              },
              "\\underbrace{(...)}": {
                "*": { action_: [{ type_: "output", option: 2 }, "underbrace-output"], nextState: "3" }
              },
              "\\color{(...)}{(...)}": {
                "*": { action_: [{ type_: "output", option: 2 }, "color-output"], nextState: "3" }
              },
              "\\color{(...)}": {
                "*": { action_: [{ type_: "output", option: 2 }, "color0-output"] }
              },
              "\\ce{(...)}": {
                "*": { action_: [{ type_: "output", option: 2 }, "ce"], nextState: "3" }
              },
              "\\,": {
                "*": { action_: [{ type_: "output", option: 1 }, "copy"], nextState: "1" }
              },
              "\\pu{(...)}": {
                "*": { action_: ["output", { type_: "write", option: "{" }, "pu", { type_: "write", option: "}" }], nextState: "3" }
              },
              "\\x{}{}|\\x{}|\\x": {
                "0|1|2|3|a|as|b|p|bp|o|c0": { action_: ["o=", "output"], nextState: "3" },
                "*": { action_: ["output", "o=", "output"], nextState: "3" }
              },
              "others": {
                "*": { action_: [{ type_: "output", option: 1 }, "copy"], nextState: "3" }
              },
              "else2": {
                "a": { action_: "a to o", nextState: "o", revisit: true },
                "as": { action_: ["output", "sb=true"], nextState: "1", revisit: true },
                "r|rt|rd|rdt|rdq": { action_: ["output"], nextState: "0", revisit: true },
                "*": { action_: ["output", "copy"], nextState: "3" }
              }
            }),
            actions: {
              "o after d": function(buffer2, m) {
                var ret;
                if ((buffer2.d || "").match(/^[1-9][0-9]*$/)) {
                  var tmp = buffer2.d;
                  buffer2.d = void 0;
                  ret = this["output"](buffer2);
                  ret.push({ type_: "tinySkip" });
                  buffer2.b = tmp;
                } else {
                  ret = this["output"](buffer2);
                }
                _mhchemParser.actions["o="](buffer2, m);
                return ret;
              },
              "d= kv": function(buffer2, m) {
                buffer2.d = m;
                buffer2.dType = "kv";
                return void 0;
              },
              "charge or bond": function(buffer2, m) {
                if (buffer2["beginsWithBond"]) {
                  var ret = [];
                  _mhchemParser.concatArray(ret, this["output"](buffer2));
                  _mhchemParser.concatArray(ret, _mhchemParser.actions["bond"](buffer2, m, "-"));
                  return ret;
                } else {
                  buffer2.d = m;
                  return void 0;
                }
              },
              "- after o/d": function(buffer2, m, isAfterD) {
                var c1 = _mhchemParser.patterns.match_("orbital", buffer2.o || "");
                var c2 = _mhchemParser.patterns.match_("one lowercase greek letter $", buffer2.o || "");
                var c3 = _mhchemParser.patterns.match_("one lowercase latin letter $", buffer2.o || "");
                var c4 = _mhchemParser.patterns.match_("$one lowercase latin letter$ $", buffer2.o || "");
                var hyphenFollows = m === "-" && (c1 && c1.remainder === "" || c2 || c3 || c4);
                if (hyphenFollows && !buffer2.a && !buffer2.b && !buffer2.p && !buffer2.d && !buffer2.q && !c1 && c3) {
                  buffer2.o = "$" + buffer2.o + "$";
                }
                var ret = [];
                if (hyphenFollows) {
                  _mhchemParser.concatArray(ret, this["output"](buffer2));
                  ret.push({ type_: "hyphen" });
                } else {
                  c1 = _mhchemParser.patterns.match_("digits", buffer2.d || "");
                  if (isAfterD && c1 && c1.remainder === "") {
                    _mhchemParser.concatArray(ret, _mhchemParser.actions["d="](buffer2, m));
                    _mhchemParser.concatArray(ret, this["output"](buffer2));
                  } else {
                    _mhchemParser.concatArray(ret, this["output"](buffer2));
                    _mhchemParser.concatArray(ret, _mhchemParser.actions["bond"](buffer2, m, "-"));
                  }
                }
                return ret;
              },
              "a to o": function(buffer2) {
                buffer2.o = buffer2.a;
                buffer2.a = void 0;
                return void 0;
              },
              "sb=true": function(buffer2) {
                buffer2.sb = true;
                return void 0;
              },
              "sb=false": function(buffer2) {
                buffer2.sb = false;
                return void 0;
              },
              "beginsWithBond=true": function(buffer2) {
                buffer2["beginsWithBond"] = true;
                return void 0;
              },
              "beginsWithBond=false": function(buffer2) {
                buffer2["beginsWithBond"] = false;
                return void 0;
              },
              "parenthesisLevel++": function(buffer2) {
                buffer2["parenthesisLevel"]++;
                return void 0;
              },
              "parenthesisLevel--": function(buffer2) {
                buffer2["parenthesisLevel"]--;
                return void 0;
              },
              "state of aggregation": function(_buffer, m) {
                return { type_: "state of aggregation", p1: _mhchemParser.go(m, "o") };
              },
              "comma": function(buffer2, m) {
                var a = m.replace(/\s*$/, "");
                var withSpace = a !== m;
                if (withSpace && buffer2["parenthesisLevel"] === 0) {
                  return { type_: "comma enumeration L", p1: a };
                } else {
                  return { type_: "comma enumeration M", p1: a };
                }
              },
              "output": function(buffer2, _m, entityFollows) {
                var ret;
                if (!buffer2.r) {
                  ret = [];
                  if (!buffer2.a && !buffer2.b && !buffer2.p && !buffer2.o && !buffer2.q && !buffer2.d && !entityFollows) ;
                  else {
                    if (buffer2.sb) {
                      ret.push({ type_: "entitySkip" });
                    }
                    if (!buffer2.o && !buffer2.q && !buffer2.d && !buffer2.b && !buffer2.p && entityFollows !== 2) {
                      buffer2.o = buffer2.a;
                      buffer2.a = void 0;
                    } else if (!buffer2.o && !buffer2.q && !buffer2.d && (buffer2.b || buffer2.p)) {
                      buffer2.o = buffer2.a;
                      buffer2.d = buffer2.b;
                      buffer2.q = buffer2.p;
                      buffer2.a = buffer2.b = buffer2.p = void 0;
                    } else {
                      if (buffer2.o && buffer2.dType === "kv" && _mhchemParser.patterns.match_("d-oxidation$", buffer2.d || "")) {
                        buffer2.dType = "oxidation";
                      } else if (buffer2.o && buffer2.dType === "kv" && !buffer2.q) {
                        buffer2.dType = void 0;
                      }
                    }
                    ret.push({
                      type_: "chemfive",
                      a: _mhchemParser.go(buffer2.a, "a"),
                      b: _mhchemParser.go(buffer2.b, "bd"),
                      p: _mhchemParser.go(buffer2.p, "pq"),
                      o: _mhchemParser.go(buffer2.o, "o"),
                      q: _mhchemParser.go(buffer2.q, "pq"),
                      d: _mhchemParser.go(buffer2.d, buffer2.dType === "oxidation" ? "oxidation" : "bd"),
                      dType: buffer2.dType
                    });
                  }
                } else {
                  var rd = void 0;
                  if (buffer2.rdt === "M") {
                    rd = _mhchemParser.go(buffer2.rd, "tex-math");
                  } else if (buffer2.rdt === "T") {
                    rd = [{ type_: "text", p1: buffer2.rd || "" }];
                  } else {
                    rd = _mhchemParser.go(buffer2.rd, "ce");
                  }
                  var rq = void 0;
                  if (buffer2.rqt === "M") {
                    rq = _mhchemParser.go(buffer2.rq, "tex-math");
                  } else if (buffer2.rqt === "T") {
                    rq = [{ type_: "text", p1: buffer2.rq || "" }];
                  } else {
                    rq = _mhchemParser.go(buffer2.rq, "ce");
                  }
                  ret = {
                    type_: "arrow",
                    r: buffer2.r,
                    rd,
                    rq
                  };
                }
                for (var p in buffer2) {
                  if (p !== "parenthesisLevel" && p !== "beginsWithBond") {
                    delete buffer2[p];
                  }
                }
                return ret;
              },
              "oxidation-output": function(_buffer, m) {
                var ret = ["{"];
                _mhchemParser.concatArray(ret, _mhchemParser.go(m, "oxidation"));
                ret.push("}");
                return ret;
              },
              "frac-output": function(_buffer, m) {
                return { type_: "frac-ce", p1: _mhchemParser.go(m[0], "ce"), p2: _mhchemParser.go(m[1], "ce") };
              },
              "overset-output": function(_buffer, m) {
                return { type_: "overset", p1: _mhchemParser.go(m[0], "ce"), p2: _mhchemParser.go(m[1], "ce") };
              },
              "underset-output": function(_buffer, m) {
                return { type_: "underset", p1: _mhchemParser.go(m[0], "ce"), p2: _mhchemParser.go(m[1], "ce") };
              },
              "underbrace-output": function(_buffer, m) {
                return { type_: "underbrace", p1: _mhchemParser.go(m[0], "ce"), p2: _mhchemParser.go(m[1], "ce") };
              },
              "color-output": function(_buffer, m) {
                return { type_: "color", color1: m[0], color2: _mhchemParser.go(m[1], "ce") };
              },
              "r=": function(buffer2, m) {
                buffer2.r = m;
                return void 0;
              },
              "rdt=": function(buffer2, m) {
                buffer2.rdt = m;
                return void 0;
              },
              "rd=": function(buffer2, m) {
                buffer2.rd = m;
                return void 0;
              },
              "rqt=": function(buffer2, m) {
                buffer2.rqt = m;
                return void 0;
              },
              "rq=": function(buffer2, m) {
                buffer2.rq = m;
                return void 0;
              },
              "operator": function(_buffer, m, p1) {
                return { type_: "operator", kind_: p1 || m };
              }
            }
          },
          "a": {
            transitions: _mhchemCreateTransitions({
              "empty": {
                "*": { action_: [] }
              },
              "1/2$": {
                "0": { action_: "1/2" }
              },
              "else": {
                "0": { action_: [], nextState: "1", revisit: true }
              },
              "${(...)}$__$(...)$": {
                "*": { action_: "tex-math tight", nextState: "1" }
              },
              ",": {
                "*": { action_: { type_: "insert", option: "commaDecimal" } }
              },
              "else2": {
                "*": { action_: "copy" }
              }
            }),
            actions: {}
          },
          "o": {
            transitions: _mhchemCreateTransitions({
              "empty": {
                "*": { action_: [] }
              },
              "1/2$": {
                "0": { action_: "1/2" }
              },
              "else": {
                "0": { action_: [], nextState: "1", revisit: true }
              },
              "letters": {
                "*": { action_: "rm" }
              },
              "\\ca": {
                "*": { action_: { type_: "insert", option: "circa" } }
              },
              "\\pu{(...)}": {
                "*": { action_: [{ type_: "write", option: "{" }, "pu", { type_: "write", option: "}" }] }
              },
              "\\x{}{}|\\x{}|\\x": {
                "*": { action_: "copy" }
              },
              "${(...)}$__$(...)$": {
                "*": { action_: "tex-math" }
              },
              "{(...)}": {
                "*": { action_: [{ type_: "write", option: "{" }, "text", { type_: "write", option: "}" }] }
              },
              "else2": {
                "*": { action_: "copy" }
              }
            }),
            actions: {}
          },
          "text": {
            transitions: _mhchemCreateTransitions({
              "empty": {
                "*": { action_: "output" }
              },
              "{...}": {
                "*": { action_: "text=" }
              },
              "${(...)}$__$(...)$": {
                "*": { action_: "tex-math" }
              },
              "\\greek": {
                "*": { action_: ["output", "rm"] }
              },
              "\\pu{(...)}": {
                "*": { action_: ["output", { type_: "write", option: "{" }, "pu", { type_: "write", option: "}" }] }
              },
              "\\,|\\x{}{}|\\x{}|\\x": {
                "*": { action_: ["output", "copy"] }
              },
              "else": {
                "*": { action_: "text=" }
              }
            }),
            actions: {
              "output": function(buffer2) {
                if (buffer2.text_) {
                  var ret = { type_: "text", p1: buffer2.text_ };
                  for (var p in buffer2) {
                    delete buffer2[p];
                  }
                  return ret;
                }
                return void 0;
              }
            }
          },
          "pq": {
            transitions: _mhchemCreateTransitions({
              "empty": {
                "*": { action_: [] }
              },
              "state of aggregation $": {
                "*": { action_: "state of aggregation" }
              },
              "i$": {
                "0": { action_: [], nextState: "!f", revisit: true }
              },
              "(KV letters),": {
                "0": { action_: "rm", nextState: "0" }
              },
              "formula$": {
                "0": { action_: [], nextState: "f", revisit: true }
              },
              "1/2$": {
                "0": { action_: "1/2" }
              },
              "else": {
                "0": { action_: [], nextState: "!f", revisit: true }
              },
              "${(...)}$__$(...)$": {
                "*": { action_: "tex-math" }
              },
              "{(...)}": {
                "*": { action_: "text" }
              },
              "a-z": {
                "f": { action_: "tex-math" }
              },
              "letters": {
                "*": { action_: "rm" }
              },
              "-9.,9": {
                "*": { action_: "9,9" }
              },
              ",": {
                "*": { action_: { type_: "insert+p1", option: "comma enumeration S" } }
              },
              "\\color{(...)}{(...)}": {
                "*": { action_: "color-output" }
              },
              "\\color{(...)}": {
                "*": { action_: "color0-output" }
              },
              "\\ce{(...)}": {
                "*": { action_: "ce" }
              },
              "\\pu{(...)}": {
                "*": { action_: [{ type_: "write", option: "{" }, "pu", { type_: "write", option: "}" }] }
              },
              "\\,|\\x{}{}|\\x{}|\\x": {
                "*": { action_: "copy" }
              },
              "else2": {
                "*": { action_: "copy" }
              }
            }),
            actions: {
              "state of aggregation": function(_buffer, m) {
                return { type_: "state of aggregation subscript", p1: _mhchemParser.go(m, "o") };
              },
              "color-output": function(_buffer, m) {
                return { type_: "color", color1: m[0], color2: _mhchemParser.go(m[1], "pq") };
              }
            }
          },
          "bd": {
            transitions: _mhchemCreateTransitions({
              "empty": {
                "*": { action_: [] }
              },
              "x$": {
                "0": { action_: [], nextState: "!f", revisit: true }
              },
              "formula$": {
                "0": { action_: [], nextState: "f", revisit: true }
              },
              "else": {
                "0": { action_: [], nextState: "!f", revisit: true }
              },
              "-9.,9 no missing 0": {
                "*": { action_: "9,9" }
              },
              ".": {
                "*": { action_: { type_: "insert", option: "electron dot" } }
              },
              "a-z": {
                "f": { action_: "tex-math" }
              },
              "x": {
                "*": { action_: { type_: "insert", option: "KV x" } }
              },
              "letters": {
                "*": { action_: "rm" }
              },
              "'": {
                "*": { action_: { type_: "insert", option: "prime" } }
              },
              "${(...)}$__$(...)$": {
                "*": { action_: "tex-math" }
              },
              "{(...)}": {
                "*": { action_: "text" }
              },
              "\\color{(...)}{(...)}": {
                "*": { action_: "color-output" }
              },
              "\\color{(...)}": {
                "*": { action_: "color0-output" }
              },
              "\\ce{(...)}": {
                "*": { action_: "ce" }
              },
              "\\pu{(...)}": {
                "*": { action_: [{ type_: "write", option: "{" }, "pu", { type_: "write", option: "}" }] }
              },
              "\\,|\\x{}{}|\\x{}|\\x": {
                "*": { action_: "copy" }
              },
              "else2": {
                "*": { action_: "copy" }
              }
            }),
            actions: {
              "color-output": function(_buffer, m) {
                return { type_: "color", color1: m[0], color2: _mhchemParser.go(m[1], "bd") };
              }
            }
          },
          "oxidation": {
            transitions: _mhchemCreateTransitions({
              "empty": {
                "*": { action_: "roman-numeral" }
              },
              "pm-operator": {
                "*": { action_: { type_: "o=+p1", option: "\\pm" } }
              },
              "else": {
                "*": { action_: "o=" }
              }
            }),
            actions: {
              "roman-numeral": function(buffer2) {
                return { type_: "roman numeral", p1: buffer2.o || "" };
              }
            }
          },
          "tex-math": {
            transitions: _mhchemCreateTransitions({
              "empty": {
                "*": { action_: "output" }
              },
              "\\ce{(...)}": {
                "*": { action_: ["output", "ce"] }
              },
              "\\pu{(...)}": {
                "*": { action_: ["output", { type_: "write", option: "{" }, "pu", { type_: "write", option: "}" }] }
              },
              "{...}|\\,|\\x{}{}|\\x{}|\\x": {
                "*": { action_: "o=" }
              },
              "else": {
                "*": { action_: "o=" }
              }
            }),
            actions: {
              "output": function(buffer2) {
                if (buffer2.o) {
                  var ret = { type_: "tex-math", p1: buffer2.o };
                  for (var p in buffer2) {
                    delete buffer2[p];
                  }
                  return ret;
                }
                return void 0;
              }
            }
          },
          "tex-math tight": {
            transitions: _mhchemCreateTransitions({
              "empty": {
                "*": { action_: "output" }
              },
              "\\ce{(...)}": {
                "*": { action_: ["output", "ce"] }
              },
              "\\pu{(...)}": {
                "*": { action_: ["output", { type_: "write", option: "{" }, "pu", { type_: "write", option: "}" }] }
              },
              "{...}|\\,|\\x{}{}|\\x{}|\\x": {
                "*": { action_: "o=" }
              },
              "-|+": {
                "*": { action_: "tight operator" }
              },
              "else": {
                "*": { action_: "o=" }
              }
            }),
            actions: {
              "tight operator": function(buffer2, m) {
                buffer2.o = (buffer2.o || "") + "{" + m + "}";
                return void 0;
              },
              "output": function(buffer2) {
                if (buffer2.o) {
                  var ret = { type_: "tex-math", p1: buffer2.o };
                  for (var p in buffer2) {
                    delete buffer2[p];
                  }
                  return ret;
                }
                return void 0;
              }
            }
          },
          "9,9": {
            transitions: _mhchemCreateTransitions({
              "empty": {
                "*": { action_: [] }
              },
              ",": {
                "*": { action_: "comma" }
              },
              "else": {
                "*": { action_: "copy" }
              }
            }),
            actions: {
              "comma": function() {
                return { type_: "commaDecimal" };
              }
            }
          },
          "pu": {
            transitions: _mhchemCreateTransitions({
              "empty": {
                "*": { action_: "output" }
              },
              "space$": {
                "*": { action_: ["output", "space"] }
              },
              "{[(|)]}": {
                "0|a": { action_: "copy" }
              },
              "(-)(9)^(-9)": {
                "0": { action_: "number^", nextState: "a" }
              },
              "(-)(9.,9)(e)(99)": {
                "0": { action_: "enumber", nextState: "a" }
              },
              "space": {
                "0|a": { action_: [] }
              },
              "pm-operator": {
                "0|a": { action_: { type_: "operator", option: "\\pm" }, nextState: "0" }
              },
              "operator": {
                "0|a": { action_: "copy", nextState: "0" }
              },
              "//": {
                "d": { action_: "o=", nextState: "/" }
              },
              "/": {
                "d": { action_: "o=", nextState: "/" }
              },
              "{...}|else": {
                "0|d": { action_: "d=", nextState: "d" },
                "a": { action_: ["space", "d="], nextState: "d" },
                "/|q": { action_: "q=", nextState: "q" }
              }
            }),
            actions: {
              "enumber": function(_buffer, m) {
                var ret = [];
                if (m[0] === "+-" || m[0] === "+/-") {
                  ret.push("\\pm ");
                } else if (m[0]) {
                  ret.push(m[0]);
                }
                if (m[1]) {
                  _mhchemParser.concatArray(ret, _mhchemParser.go(m[1], "pu-9,9"));
                  if (m[2]) {
                    if (m[2].match(/[,.]/)) {
                      _mhchemParser.concatArray(ret, _mhchemParser.go(m[2], "pu-9,9"));
                    } else {
                      ret.push(m[2]);
                    }
                  }
                  if (m[3] || m[4]) {
                    if (m[3] === "e" || m[4] === "*") {
                      ret.push({ type_: "cdot" });
                    } else {
                      ret.push({ type_: "times" });
                    }
                  }
                }
                if (m[5]) {
                  ret.push("10^{" + m[5] + "}");
                }
                return ret;
              },
              "number^": function(_buffer, m) {
                var ret = [];
                if (m[0] === "+-" || m[0] === "+/-") {
                  ret.push("\\pm ");
                } else if (m[0]) {
                  ret.push(m[0]);
                }
                _mhchemParser.concatArray(ret, _mhchemParser.go(m[1], "pu-9,9"));
                ret.push("^{" + m[2] + "}");
                return ret;
              },
              "operator": function(_buffer, m, p1) {
                return { type_: "operator", kind_: p1 || m };
              },
              "space": function() {
                return { type_: "pu-space-1" };
              },
              "output": function(buffer2) {
                var ret;
                var md = _mhchemParser.patterns.match_("{(...)}", buffer2.d || "");
                if (md && md.remainder === "") {
                  buffer2.d = md.match_;
                }
                var mq = _mhchemParser.patterns.match_("{(...)}", buffer2.q || "");
                if (mq && mq.remainder === "") {
                  buffer2.q = mq.match_;
                }
                if (buffer2.d) {
                  buffer2.d = buffer2.d.replace(/\u00B0C|\^oC|\^{o}C/g, "{}^{\\circ}C");
                  buffer2.d = buffer2.d.replace(/\u00B0F|\^oF|\^{o}F/g, "{}^{\\circ}F");
                }
                if (buffer2.q) {
                  buffer2.q = buffer2.q.replace(/\u00B0C|\^oC|\^{o}C/g, "{}^{\\circ}C");
                  buffer2.q = buffer2.q.replace(/\u00B0F|\^oF|\^{o}F/g, "{}^{\\circ}F");
                  var b5 = {
                    d: _mhchemParser.go(buffer2.d, "pu"),
                    q: _mhchemParser.go(buffer2.q, "pu")
                  };
                  if (buffer2.o === "//") {
                    ret = { type_: "pu-frac", p1: b5.d, p2: b5.q };
                  } else {
                    ret = b5.d;
                    if (b5.d.length > 1 || b5.q.length > 1) {
                      ret.push({ type_: " / " });
                    } else {
                      ret.push({ type_: "/" });
                    }
                    _mhchemParser.concatArray(ret, b5.q);
                  }
                } else {
                  ret = _mhchemParser.go(buffer2.d, "pu-2");
                }
                for (var p in buffer2) {
                  delete buffer2[p];
                }
                return ret;
              }
            }
          },
          "pu-2": {
            transitions: _mhchemCreateTransitions({
              "empty": {
                "*": { action_: "output" }
              },
              "*": {
                "*": { action_: ["output", "cdot"], nextState: "0" }
              },
              "\\x": {
                "*": { action_: "rm=" }
              },
              "space": {
                "*": { action_: ["output", "space"], nextState: "0" }
              },
              "^{(...)}|^(-1)": {
                "1": { action_: "^(-1)" }
              },
              "-9.,9": {
                "0": { action_: "rm=", nextState: "0" },
                "1": { action_: "^(-1)", nextState: "0" }
              },
              "{...}|else": {
                "*": { action_: "rm=", nextState: "1" }
              }
            }),
            actions: {
              "cdot": function() {
                return { type_: "tight cdot" };
              },
              "^(-1)": function(buffer2, m) {
                buffer2.rm += "^{" + m + "}";
                return void 0;
              },
              "space": function() {
                return { type_: "pu-space-2" };
              },
              "output": function(buffer2) {
                var ret = [];
                if (buffer2.rm) {
                  var mrm = _mhchemParser.patterns.match_("{(...)}", buffer2.rm || "");
                  if (mrm && mrm.remainder === "") {
                    ret = _mhchemParser.go(mrm.match_, "pu");
                  } else {
                    ret = { type_: "rm", p1: buffer2.rm };
                  }
                }
                for (var p in buffer2) {
                  delete buffer2[p];
                }
                return ret;
              }
            }
          },
          "pu-9,9": {
            transitions: _mhchemCreateTransitions({
              "empty": {
                "0": { action_: "output-0" },
                "o": { action_: "output-o" }
              },
              ",": {
                "0": { action_: ["output-0", "comma"], nextState: "o" }
              },
              ".": {
                "0": { action_: ["output-0", "copy"], nextState: "o" }
              },
              "else": {
                "*": { action_: "text=" }
              }
            }),
            actions: {
              "comma": function() {
                return { type_: "commaDecimal" };
              },
              "output-0": function(buffer2) {
                var ret = [];
                buffer2.text_ = buffer2.text_ || "";
                if (buffer2.text_.length > 4) {
                  var a = buffer2.text_.length % 3;
                  if (a === 0) {
                    a = 3;
                  }
                  for (var i2 = buffer2.text_.length - 3; i2 > 0; i2 -= 3) {
                    ret.push(buffer2.text_.substr(i2, 3));
                    ret.push({ type_: "1000 separator" });
                  }
                  ret.push(buffer2.text_.substr(0, a));
                  ret.reverse();
                } else {
                  ret.push(buffer2.text_);
                }
                for (var p in buffer2) {
                  delete buffer2[p];
                }
                return ret;
              },
              "output-o": function(buffer2) {
                var ret = [];
                buffer2.text_ = buffer2.text_ || "";
                if (buffer2.text_.length > 4) {
                  var a = buffer2.text_.length - 3;
                  var i2 = void 0;
                  for (i2 = 0; i2 < a; i2 += 3) {
                    ret.push(buffer2.text_.substr(i2, 3));
                    ret.push({ type_: "1000 separator" });
                  }
                  ret.push(buffer2.text_.substr(i2));
                } else {
                  ret.push(buffer2.text_);
                }
                for (var p in buffer2) {
                  delete buffer2[p];
                }
                return ret;
              }
            }
          }
        }
      };
      var _mhchemTexify = {
        go: function(input2, addOuterBraces) {
          if (!input2) {
            return "";
          }
          var res = "";
          var cee = false;
          for (var i2 = 0; i2 < input2.length; i2++) {
            var inputi = input2[i2];
            if (typeof inputi === "string") {
              res += inputi;
            } else {
              res += _mhchemTexify._go2(inputi);
              if (inputi.type_ === "1st-level escape") {
                cee = true;
              }
            }
          }
          if (addOuterBraces && !cee && res) {
            res = "{" + res + "}";
          }
          return res;
        },
        _goInner: function(input2) {
          return _mhchemTexify.go(input2, false);
        },
        _go2: function(buf) {
          var res;
          switch (buf.type_) {
            case "chemfive":
              res = "";
              var b5 = {
                a: _mhchemTexify._goInner(buf.a),
                b: _mhchemTexify._goInner(buf.b),
                p: _mhchemTexify._goInner(buf.p),
                o: _mhchemTexify._goInner(buf.o),
                q: _mhchemTexify._goInner(buf.q),
                d: _mhchemTexify._goInner(buf.d)
              };
              if (b5.a) {
                if (b5.a.match(/^[+\-]/)) {
                  b5.a = "{" + b5.a + "}";
                }
                res += b5.a + "\\,";
              }
              if (b5.b || b5.p) {
                res += "{\\vphantom{A}}";
                res += "^{\\hphantom{" + (b5.b || "") + "}}_{\\hphantom{" + (b5.p || "") + "}}";
                res += "\\mkern-1.5mu";
                res += "{\\vphantom{A}}";
                res += "^{\\smash[t]{\\vphantom{2}}\\llap{" + (b5.b || "") + "}}";
                res += "_{\\vphantom{2}\\llap{\\smash[t]{" + (b5.p || "") + "}}}";
              }
              if (b5.o) {
                if (b5.o.match(/^[+\-]/)) {
                  b5.o = "{" + b5.o + "}";
                }
                res += b5.o;
              }
              if (buf.dType === "kv") {
                if (b5.d || b5.q) {
                  res += "{\\vphantom{A}}";
                }
                if (b5.d) {
                  res += "^{" + b5.d + "}";
                }
                if (b5.q) {
                  res += "_{\\smash[t]{" + b5.q + "}}";
                }
              } else if (buf.dType === "oxidation") {
                if (b5.d) {
                  res += "{\\vphantom{A}}";
                  res += "^{" + b5.d + "}";
                }
                if (b5.q) {
                  res += "{\\vphantom{A}}";
                  res += "_{\\smash[t]{" + b5.q + "}}";
                }
              } else {
                if (b5.q) {
                  res += "{\\vphantom{A}}";
                  res += "_{\\smash[t]{" + b5.q + "}}";
                }
                if (b5.d) {
                  res += "{\\vphantom{A}}";
                  res += "^{" + b5.d + "}";
                }
              }
              break;
            case "rm":
              res = "\\mathrm{" + buf.p1 + "}";
              break;
            case "text":
              if (buf.p1.match(/[\^_]/)) {
                buf.p1 = buf.p1.replace(" ", "~").replace("-", "\\text{-}");
                res = "\\mathrm{" + buf.p1 + "}";
              } else {
                res = "\\text{" + buf.p1 + "}";
              }
              break;
            case "roman numeral":
              res = "\\mathrm{" + buf.p1 + "}";
              break;
            case "state of aggregation":
              res = "\\mskip2mu " + _mhchemTexify._goInner(buf.p1);
              break;
            case "state of aggregation subscript":
              res = "\\mskip1mu " + _mhchemTexify._goInner(buf.p1);
              break;
            case "bond":
              res = _mhchemTexify._getBond(buf.kind_);
              if (!res) {
                throw ["MhchemErrorBond", "mhchem Error. Unknown bond type (" + buf.kind_ + ")"];
              }
              break;
            case "frac":
              var c2 = "\\frac{" + buf.p1 + "}{" + buf.p2 + "}";
              res = "\\mathchoice{\\textstyle" + c2 + "}{" + c2 + "}{" + c2 + "}{" + c2 + "}";
              break;
            case "pu-frac":
              var d = "\\frac{" + _mhchemTexify._goInner(buf.p1) + "}{" + _mhchemTexify._goInner(buf.p2) + "}";
              res = "\\mathchoice{\\textstyle" + d + "}{" + d + "}{" + d + "}{" + d + "}";
              break;
            case "tex-math":
              res = buf.p1 + " ";
              break;
            case "frac-ce":
              res = "\\frac{" + _mhchemTexify._goInner(buf.p1) + "}{" + _mhchemTexify._goInner(buf.p2) + "}";
              break;
            case "overset":
              res = "\\overset{" + _mhchemTexify._goInner(buf.p1) + "}{" + _mhchemTexify._goInner(buf.p2) + "}";
              break;
            case "underset":
              res = "\\underset{" + _mhchemTexify._goInner(buf.p1) + "}{" + _mhchemTexify._goInner(buf.p2) + "}";
              break;
            case "underbrace":
              res = "\\underbrace{" + _mhchemTexify._goInner(buf.p1) + "}_{" + _mhchemTexify._goInner(buf.p2) + "}";
              break;
            case "color":
              res = "{\\color{" + buf.color1 + "}{" + _mhchemTexify._goInner(buf.color2) + "}}";
              break;
            case "color0":
              res = "\\color{" + buf.color + "}";
              break;
            case "arrow":
              var b6 = {
                rd: _mhchemTexify._goInner(buf.rd),
                rq: _mhchemTexify._goInner(buf.rq)
              };
              var arrow2 = _mhchemTexify._getArrow(buf.r);
              if (b6.rd || b6.rq) {
                if (buf.r === "<=>" || buf.r === "<=>>" || buf.r === "<<=>" || buf.r === "<-->") {
                  arrow2 = "\\long" + arrow2;
                  if (b6.rd) {
                    arrow2 = "\\overset{" + b6.rd + "}{" + arrow2 + "}";
                  }
                  if (b6.rq) {
                    if (buf.r === "<-->") {
                      arrow2 = "\\underset{\\lower2mu{" + b6.rq + "}}{" + arrow2 + "}";
                    } else {
                      arrow2 = "\\underset{\\lower6mu{" + b6.rq + "}}{" + arrow2 + "}";
                    }
                  }
                  arrow2 = " {}\\mathrel{" + arrow2 + "}{} ";
                } else {
                  if (b6.rq) {
                    arrow2 += "[{" + b6.rq + "}]";
                  }
                  arrow2 += "{" + b6.rd + "}";
                  arrow2 = " {}\\mathrel{\\x" + arrow2 + "}{} ";
                }
              } else {
                arrow2 = " {}\\mathrel{\\long" + arrow2 + "}{} ";
              }
              res = arrow2;
              break;
            case "operator":
              res = _mhchemTexify._getOperator(buf.kind_);
              break;
            case "1st-level escape":
              res = buf.p1 + " ";
              break;
            case "space":
              res = " ";
              break;
            case "tinySkip":
              res = "\\mkern2mu";
              break;
            case "entitySkip":
              res = "~";
              break;
            case "pu-space-1":
              res = "~";
              break;
            case "pu-space-2":
              res = "\\mkern3mu ";
              break;
            case "1000 separator":
              res = "\\mkern2mu ";
              break;
            case "commaDecimal":
              res = "{,}";
              break;
            case "comma enumeration L":
              res = "{" + buf.p1 + "}\\mkern6mu ";
              break;
            case "comma enumeration M":
              res = "{" + buf.p1 + "}\\mkern3mu ";
              break;
            case "comma enumeration S":
              res = "{" + buf.p1 + "}\\mkern1mu ";
              break;
            case "hyphen":
              res = "\\text{-}";
              break;
            case "addition compound":
              res = "\\,{\\cdot}\\,";
              break;
            case "electron dot":
              res = "\\mkern1mu \\bullet\\mkern1mu ";
              break;
            case "KV x":
              res = "{\\times}";
              break;
            case "prime":
              res = "\\prime ";
              break;
            case "cdot":
              res = "\\cdot ";
              break;
            case "tight cdot":
              res = "\\mkern1mu{\\cdot}\\mkern1mu ";
              break;
            case "times":
              res = "\\times ";
              break;
            case "circa":
              res = "{\\sim}";
              break;
            case "^":
              res = "uparrow";
              break;
            case "v":
              res = "downarrow";
              break;
            case "ellipsis":
              res = "\\ldots ";
              break;
            case "/":
              res = "/";
              break;
            case " / ":
              res = "\\,/\\,";
              break;
            default:
              throw ["MhchemBugT", "mhchem bug T. Please report."];
          }
          return res;
        },
        _getArrow: function(a) {
          switch (a) {
            case "->":
              return "rightarrow";
            case "→":
              return "rightarrow";
            case "⟶":
              return "rightarrow";
            case "<-":
              return "leftarrow";
            case "<->":
              return "leftrightarrow";
            case "<-->":
              return "leftrightarrows";
            case "<=>":
              return "rightleftharpoons";
            case "⇌":
              return "rightleftharpoons";
            case "<=>>":
              return "Rightleftharpoons";
            case "<<=>":
              return "Leftrightharpoons";
            default:
              throw ["MhchemBugT", "mhchem bug T. Please report."];
          }
        },
        _getBond: function(a) {
          switch (a) {
            case "-":
              return "{-}";
            case "1":
              return "{-}";
            case "=":
              return "{=}";
            case "2":
              return "{=}";
            case "#":
              return "{\\equiv}";
            case "3":
              return "{\\equiv}";
            case "~":
              return "{\\tripledash}";
            case "~-":
              return "{\\rlap{\\lower.1em{-}}\\raise.1em{\\tripledash}}";
            case "~=":
              return "{\\rlap{\\lower.2em{-}}\\rlap{\\raise.2em{\\tripledash}}-}";
            case "~--":
              return "{\\rlap{\\lower.2em{-}}\\rlap{\\raise.2em{\\tripledash}}-}";
            case "-~-":
              return "{\\rlap{\\lower.2em{-}}\\rlap{\\raise.2em{-}}\\tripledash}";
            case "...":
              return "{{\\cdot}{\\cdot}{\\cdot}}";
            case "....":
              return "{{\\cdot}{\\cdot}{\\cdot}{\\cdot}}";
            case "->":
              return "{\\rightarrow}";
            case "<-":
              return "{\\leftarrow}";
            case "<":
              return "{<}";
            case ">":
              return "{>}";
            default:
              throw ["MhchemBugT", "mhchem bug T. Please report."];
          }
        },
        _getOperator: function(a) {
          switch (a) {
            case "+":
              return " {}+{} ";
            case "-":
              return " {}-{} ";
            case "=":
              return " {}={} ";
            case "<":
              return " {}<{} ";
            case ">":
              return " {}>{} ";
            case "<<":
              return " {}\\ll{} ";
            case ">>":
              return " {}\\gg{} ";
            case "\\pm":
              return " {}\\pm{} ";
            case "\\approx":
              return " {}\\approx{} ";
            case "$\\approx$":
              return " {}\\approx{} ";
            case "v":
              return " \\downarrow{} ";
            case "(v)":
              return " \\downarrow{} ";
            case "^":
              return " \\uparrow{} ";
            case "(^)":
              return " \\uparrow{} ";
            default:
              throw ["MhchemBugT", "mhchem bug T. Please report."];
          }
        }
      };
      return mhchemParser;
    }
    var hasRequiredMhchemConfiguration;
    function requireMhchemConfiguration() {
      if (hasRequiredMhchemConfiguration) return MhchemConfiguration;
      hasRequiredMhchemConfiguration = 1;
      var __importDefault2 = MhchemConfiguration && MhchemConfiguration.__importDefault || function(mod2) {
        return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
      };
      Object.defineProperty(MhchemConfiguration, "__esModule", { value: true });
      MhchemConfiguration.MhchemConfiguration = void 0;
      var Configuration_js_1 = requireConfiguration();
      var SymbolMap_js_1 = requireSymbolMap();
      var TexError_js_1 = __importDefault2(requireTexError());
      var BaseMethods_js_1 = __importDefault2(requireBaseMethods());
      var AmsMethods_js_1 = requireAmsMethods();
      var mhchemParser_js_1 = requireMhchemParser();
      var MhchemMethods = {};
      MhchemMethods.Macro = BaseMethods_js_1.default.Macro;
      MhchemMethods.xArrow = AmsMethods_js_1.AmsMethods.xArrow;
      MhchemMethods.Machine = function(parser2, name2, machine) {
        var arg = parser2.GetArgument(name2);
        var tex2;
        try {
          tex2 = mhchemParser_js_1.mhchemParser.toTex(arg, machine);
        } catch (err2) {
          throw new TexError_js_1.default(err2[0], err2[1]);
        }
        parser2.string = tex2 + parser2.string.substr(parser2.i);
        parser2.i = 0;
      };
      new SymbolMap_js_1.CommandMap("mhchem", {
        ce: ["Machine", "ce"],
        pu: ["Machine", "pu"],
        longrightleftharpoons: [
          "Macro",
          "\\stackrel{\\textstyle{-}\\!\\!{\\rightharpoonup}}{\\smash{{\\leftharpoondown}\\!\\!{-}}}"
        ],
        longRightleftharpoons: [
          "Macro",
          "\\stackrel{\\textstyle{-}\\!\\!{\\rightharpoonup}}{\\smash{\\leftharpoondown}}"
        ],
        longLeftrightharpoons: [
          "Macro",
          "\\stackrel{\\textstyle\\vphantom{{-}}{\\rightharpoonup}}{\\smash{{\\leftharpoondown}\\!\\!{-}}}"
        ],
        longleftrightarrows: [
          "Macro",
          "\\stackrel{\\longrightarrow}{\\smash{\\longleftarrow}\\Rule{0px}{.25em}{0px}}"
        ],
        tripledash: [
          "Macro",
          "\\vphantom{-}\\raise2mu{\\kern2mu\\tiny\\text{-}\\kern1mu\\text{-}\\kern1mu\\text{-}\\kern2mu}"
        ],
        xleftrightarrow: ["xArrow", 8596, 6, 6],
        xrightleftharpoons: ["xArrow", 8652, 5, 7],
        xRightleftharpoons: ["xArrow", 8652, 5, 7],
        xLeftrightharpoons: ["xArrow", 8652, 5, 7]
      }, MhchemMethods);
      MhchemConfiguration.MhchemConfiguration = Configuration_js_1.Configuration.create("mhchem", { handler: { macro: ["mhchem"] } });
      return MhchemConfiguration;
    }
    var NoErrorsConfiguration = {};
    var hasRequiredNoErrorsConfiguration;
    function requireNoErrorsConfiguration() {
      if (hasRequiredNoErrorsConfiguration) return NoErrorsConfiguration;
      hasRequiredNoErrorsConfiguration = 1;
      Object.defineProperty(NoErrorsConfiguration, "__esModule", { value: true });
      NoErrorsConfiguration.NoErrorsConfiguration = void 0;
      var Configuration_js_1 = requireConfiguration();
      function noErrors(factory, message2, _id, expr) {
        var mtext2 = factory.create("token", "mtext", {}, expr.replace(/\n/g, " "));
        var error2 = factory.create("node", "merror", [mtext2], { "data-mjx-error": message2, title: message2 });
        return error2;
      }
      NoErrorsConfiguration.NoErrorsConfiguration = Configuration_js_1.Configuration.create("noerrors", { nodes: { "error": noErrors } });
      return NoErrorsConfiguration;
    }
    var NoUndefinedConfiguration = {};
    var hasRequiredNoUndefinedConfiguration;
    function requireNoUndefinedConfiguration() {
      if (hasRequiredNoUndefinedConfiguration) return NoUndefinedConfiguration;
      hasRequiredNoUndefinedConfiguration = 1;
      var __values2 = NoUndefinedConfiguration && NoUndefinedConfiguration.__values || function(o) {
        var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i2 = 0;
        if (m) return m.call(o);
        if (o && typeof o.length === "number") return {
          next: function() {
            if (o && i2 >= o.length) o = void 0;
            return { value: o && o[i2++], done: !o };
          }
        };
        throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
      };
      Object.defineProperty(NoUndefinedConfiguration, "__esModule", { value: true });
      NoUndefinedConfiguration.NoUndefinedConfiguration = void 0;
      var Configuration_js_1 = requireConfiguration();
      function noUndefined(parser2, name2) {
        var e_1, _a2;
        var textNode = parser2.create("text", "\\" + name2);
        var options2 = parser2.options.noundefined || {};
        var def = {};
        try {
          for (var _b2 = __values2(["color", "background", "size"]), _c = _b2.next(); !_c.done; _c = _b2.next()) {
            var id = _c.value;
            if (options2[id]) {
              def["math" + id] = options2[id];
            }
          }
        } catch (e_1_1) {
          e_1 = { error: e_1_1 };
        } finally {
          try {
            if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
          } finally {
            if (e_1) throw e_1.error;
          }
        }
        parser2.Push(parser2.create("node", "mtext", [], def, textNode));
      }
      NoUndefinedConfiguration.NoUndefinedConfiguration = Configuration_js_1.Configuration.create("noundefined", {
        fallback: { macro: noUndefined },
        options: {
          noundefined: {
            color: "red",
            background: "",
            size: ""
          }
        },
        priority: 3
      });
      return NoUndefinedConfiguration;
    }
    var PhysicsConfiguration = {};
    var PhysicsItems = {};
    var hasRequiredPhysicsItems;
    function requirePhysicsItems() {
      if (hasRequiredPhysicsItems) return PhysicsItems;
      hasRequiredPhysicsItems = 1;
      var __extends2 = PhysicsItems && PhysicsItems.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      var __importDefault2 = PhysicsItems && PhysicsItems.__importDefault || function(mod2) {
        return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
      };
      Object.defineProperty(PhysicsItems, "__esModule", { value: true });
      PhysicsItems.AutoOpen = void 0;
      var StackItem_js_1 = requireStackItem();
      var ParseUtil_js_1 = __importDefault2(requireParseUtil());
      var NodeUtil_js_1 = __importDefault2(requireNodeUtil());
      var TexParser_js_1 = __importDefault2(requireTexParser());
      var AutoOpen = (function(_super) {
        __extends2(AutoOpen2, _super);
        function AutoOpen2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.openCount = 0;
          return _this;
        }
        Object.defineProperty(AutoOpen2.prototype, "kind", {
          get: function() {
            return "auto open";
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(AutoOpen2.prototype, "isOpen", {
          get: function() {
            return true;
          },
          enumerable: false,
          configurable: true
        });
        AutoOpen2.prototype.toMml = function() {
          var parser2 = this.factory.configuration.parser;
          var right2 = this.getProperty("right");
          if (this.getProperty("smash")) {
            var mml_1 = _super.prototype.toMml.call(this);
            var smash = parser2.create("node", "mpadded", [mml_1], { height: 0, depth: 0 });
            this.Clear();
            this.Push(parser2.create("node", "TeXAtom", [smash]));
          }
          if (right2) {
            this.Push(new TexParser_js_1.default(right2, parser2.stack.env, parser2.configuration).mml());
          }
          var mml = ParseUtil_js_1.default.fenced(this.factory.configuration, this.getProperty("open"), _super.prototype.toMml.call(this), this.getProperty("close"), this.getProperty("big"));
          NodeUtil_js_1.default.removeProperties(mml, "open", "close", "texClass");
          return mml;
        };
        AutoOpen2.prototype.checkItem = function(item2) {
          if (item2.isKind("mml") && item2.Size() === 1) {
            var mml = item2.toMml();
            if (mml.isKind("mo") && mml.getText() === this.getProperty("open")) {
              this.openCount++;
            }
          }
          var close2 = item2.getProperty("autoclose");
          if (close2 && close2 === this.getProperty("close") && !this.openCount--) {
            if (this.getProperty("ignore")) {
              this.Clear();
              return [[], true];
            }
            return [[this.toMml()], true];
          }
          return _super.prototype.checkItem.call(this, item2);
        };
        AutoOpen2.errors = Object.assign(Object.create(StackItem_js_1.BaseItem.errors), {
          "stop": ["ExtraOrMissingDelims", "Extra open or missing close delimiter"]
        });
        return AutoOpen2;
      })(StackItem_js_1.BaseItem);
      PhysicsItems.AutoOpen = AutoOpen;
      return PhysicsItems;
    }
    var PhysicsMappings = {};
    var PhysicsMethods = {};
    var hasRequiredPhysicsMethods;
    function requirePhysicsMethods() {
      if (hasRequiredPhysicsMethods) return PhysicsMethods;
      hasRequiredPhysicsMethods = 1;
      var __read2 = PhysicsMethods && PhysicsMethods.__read || function(o, n) {
        var m = typeof Symbol === "function" && o[Symbol.iterator];
        if (!m) return o;
        var i2 = m.call(o), r2, ar2 = [], e;
        try {
          while ((n === void 0 || n-- > 0) && !(r2 = i2.next()).done) ar2.push(r2.value);
        } catch (error2) {
          e = { error: error2 };
        } finally {
          try {
            if (r2 && !r2.done && (m = i2["return"])) m.call(i2);
          } finally {
            if (e) throw e.error;
          }
        }
        return ar2;
      };
      var __importDefault2 = PhysicsMethods && PhysicsMethods.__importDefault || function(mod2) {
        return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
      };
      Object.defineProperty(PhysicsMethods, "__esModule", { value: true });
      var BaseMethods_js_1 = __importDefault2(requireBaseMethods());
      var TexParser_js_1 = __importDefault2(requireTexParser());
      var TexError_js_1 = __importDefault2(requireTexError());
      var MmlNode_js_1 = requireMmlNode();
      var ParseUtil_js_1 = __importDefault2(requireParseUtil());
      var NodeUtil_js_1 = __importDefault2(requireNodeUtil());
      var NodeFactory_js_1 = requireNodeFactory$1();
      var PhysicsMethods$1 = {};
      var pairs = {
        "(": ")",
        "[": "]",
        "{": "}",
        "|": "|"
      };
      var biggs = /^(b|B)i(g{1,2})$/;
      PhysicsMethods$1.Quantity = function(parser2, name2, open, close2, arg, named, variant) {
        if (open === void 0) {
          open = "(";
        }
        if (close2 === void 0) {
          close2 = ")";
        }
        if (arg === void 0) {
          arg = false;
        }
        if (named === void 0) {
          named = "";
        }
        if (variant === void 0) {
          variant = "";
        }
        var star2 = arg ? parser2.GetStar() : false;
        var next = parser2.GetNext();
        var position = parser2.i;
        var big = null;
        if (next === "\\") {
          parser2.i++;
          big = parser2.GetCS();
          if (!big.match(biggs)) {
            var empty2 = parser2.create("node", "mrow");
            parser2.Push(ParseUtil_js_1.default.fenced(parser2.configuration, open, empty2, close2));
            parser2.i = position;
            return;
          }
          next = parser2.GetNext();
        }
        var right2 = pairs[next];
        if (arg && next !== "{") {
          throw new TexError_js_1.default("MissingArgFor", "Missing argument for %1", parser2.currentCS);
        }
        if (!right2) {
          var empty2 = parser2.create("node", "mrow");
          parser2.Push(ParseUtil_js_1.default.fenced(parser2.configuration, open, empty2, close2));
          parser2.i = position;
          return;
        }
        if (named) {
          var mml = parser2.create("token", "mi", { texClass: MmlNode_js_1.TEXCLASS.OP }, named);
          if (variant) {
            NodeUtil_js_1.default.setAttribute(mml, "mathvariant", variant);
          }
          parser2.Push(parser2.itemFactory.create("fn", mml));
        }
        if (next === "{") {
          var argument = parser2.GetArgument(name2);
          next = arg ? open : "\\{";
          right2 = arg ? close2 : "\\}";
          argument = star2 ? next + " " + argument + " " + right2 : big ? "\\" + big + "l" + next + " " + argument + " \\" + big + "r" + right2 : "\\left" + next + " " + argument + " \\right" + right2;
          parser2.Push(new TexParser_js_1.default(argument, parser2.stack.env, parser2.configuration).mml());
          return;
        }
        if (arg) {
          next = open;
          right2 = close2;
        }
        parser2.i++;
        parser2.Push(parser2.itemFactory.create("auto open").setProperties({ open: next, close: right2, big }));
      };
      PhysicsMethods$1.Eval = function(parser2, name2) {
        var star2 = parser2.GetStar();
        var next = parser2.GetNext();
        if (next === "{") {
          var arg = parser2.GetArgument(name2);
          var replace2 = "\\left. " + (star2 ? "\\smash{" + arg + "}" : arg) + " \\vphantom{\\int}\\right|";
          parser2.string = parser2.string.slice(0, parser2.i) + replace2 + parser2.string.slice(parser2.i);
          return;
        }
        if (next === "(" || next === "[") {
          parser2.i++;
          parser2.Push(parser2.itemFactory.create("auto open").setProperties({
            open: next,
            close: "|",
            smash: star2,
            right: "\\vphantom{\\int}"
          }));
          return;
        }
        throw new TexError_js_1.default("MissingArgFor", "Missing argument for %1", parser2.currentCS);
      };
      PhysicsMethods$1.Commutator = function(parser2, name2, open, close2) {
        if (open === void 0) {
          open = "[";
        }
        if (close2 === void 0) {
          close2 = "]";
        }
        var star2 = parser2.GetStar();
        var next = parser2.GetNext();
        var big = null;
        if (next === "\\") {
          parser2.i++;
          big = parser2.GetCS();
          if (!big.match(biggs)) {
            throw new TexError_js_1.default("MissingArgFor", "Missing argument for %1", parser2.currentCS);
          }
          next = parser2.GetNext();
        }
        if (next !== "{") {
          throw new TexError_js_1.default("MissingArgFor", "Missing argument for %1", parser2.currentCS);
        }
        var arg1 = parser2.GetArgument(name2);
        var arg2 = parser2.GetArgument(name2);
        var argument = arg1 + "," + arg2;
        argument = star2 ? open + " " + argument + " " + close2 : big ? "\\" + big + "l" + open + " " + argument + " \\" + big + "r" + close2 : "\\left" + open + " " + argument + " \\right" + close2;
        parser2.Push(new TexParser_js_1.default(argument, parser2.stack.env, parser2.configuration).mml());
      };
      var latinCap = [65, 90];
      var latinSmall = [97, 122];
      var greekCap = [913, 937];
      var greekSmall = [945, 969];
      var digits = [48, 57];
      function inRange(value2, range2) {
        return value2 >= range2[0] && value2 <= range2[1];
      }
      function createVectorToken(factory, kind, def, text2) {
        var parser2 = factory.configuration.parser;
        var token2 = NodeFactory_js_1.NodeFactory.createToken(factory, kind, def, text2);
        var code2 = text2.codePointAt(0);
        if (text2.length === 1 && !parser2.stack.env.font && parser2.stack.env.vectorFont && (inRange(code2, latinCap) || inRange(code2, latinSmall) || inRange(code2, greekCap) || inRange(code2, digits) || inRange(code2, greekSmall) && parser2.stack.env.vectorStar || NodeUtil_js_1.default.getAttribute(token2, "accent"))) {
          NodeUtil_js_1.default.setAttribute(token2, "mathvariant", parser2.stack.env.vectorFont);
        }
        return token2;
      }
      PhysicsMethods$1.VectorBold = function(parser2, name2) {
        var star2 = parser2.GetStar();
        var arg = parser2.GetArgument(name2);
        var oldToken = parser2.configuration.nodeFactory.get("token");
        var oldFont = parser2.stack.env.font;
        delete parser2.stack.env.font;
        parser2.configuration.nodeFactory.set("token", createVectorToken);
        parser2.stack.env.vectorFont = star2 ? "bold-italic" : "bold";
        parser2.stack.env.vectorStar = star2;
        var node2 = new TexParser_js_1.default(arg, parser2.stack.env, parser2.configuration).mml();
        if (oldFont) {
          parser2.stack.env.font = oldFont;
        }
        delete parser2.stack.env.vectorFont;
        delete parser2.stack.env.vectorStar;
        parser2.configuration.nodeFactory.set("token", oldToken);
        parser2.Push(node2);
      };
      PhysicsMethods$1.StarMacro = function(parser2, name2, argcount) {
        var parts = [];
        for (var _i = 3; _i < arguments.length; _i++) {
          parts[_i - 3] = arguments[_i];
        }
        var star2 = parser2.GetStar();
        var args2 = [];
        if (argcount) {
          for (var i2 = args2.length; i2 < argcount; i2++) {
            args2.push(parser2.GetArgument(name2));
          }
        }
        var macro = parts.join(star2 ? "*" : "");
        macro = ParseUtil_js_1.default.substituteArgs(parser2, args2, macro);
        parser2.string = ParseUtil_js_1.default.addArgs(parser2, macro, parser2.string.slice(parser2.i));
        parser2.i = 0;
        ParseUtil_js_1.default.checkMaxMacros(parser2);
      };
      var vectorApplication = function(parser2, kind, name2, operator2, fences) {
        var op = new TexParser_js_1.default(operator2, parser2.stack.env, parser2.configuration).mml();
        parser2.Push(parser2.itemFactory.create(kind, op));
        var left2 = parser2.GetNext();
        var right2 = pairs[left2];
        if (!right2) {
          return;
        }
        var lfence = "", rfence = "", arg = "";
        var enlarge = fences.indexOf(left2) !== -1;
        if (left2 === "{") {
          arg = parser2.GetArgument(name2);
          lfence = enlarge ? "\\left\\{" : "";
          rfence = enlarge ? "\\right\\}" : "";
          var macro = lfence + " " + arg + " " + rfence;
          parser2.string = macro + parser2.string.slice(parser2.i);
          parser2.i = 0;
          return;
        }
        if (!enlarge) {
          return;
        }
        parser2.i++;
        parser2.Push(parser2.itemFactory.create("auto open").setProperties({ open: left2, close: right2 }));
      };
      PhysicsMethods$1.OperatorApplication = function(parser2, name2, operator2) {
        var fences = [];
        for (var _i = 3; _i < arguments.length; _i++) {
          fences[_i - 3] = arguments[_i];
        }
        vectorApplication(parser2, "fn", name2, operator2, fences);
      };
      PhysicsMethods$1.VectorOperator = function(parser2, name2, operator2) {
        var fences = [];
        for (var _i = 3; _i < arguments.length; _i++) {
          fences[_i - 3] = arguments[_i];
        }
        vectorApplication(parser2, "mml", name2, operator2, fences);
      };
      PhysicsMethods$1.Expression = function(parser2, name2, opt, id) {
        if (opt === void 0) {
          opt = true;
        }
        if (id === void 0) {
          id = "";
        }
        id = id || name2.slice(1);
        var exp = opt ? parser2.GetBrackets(name2) : null;
        var mml = parser2.create("token", "mi", { texClass: MmlNode_js_1.TEXCLASS.OP }, id);
        if (exp) {
          var sup4 = new TexParser_js_1.default(exp, parser2.stack.env, parser2.configuration).mml();
          mml = parser2.create("node", "msup", [mml, sup4]);
        }
        parser2.Push(parser2.itemFactory.create("fn", mml));
        if (parser2.GetNext() !== "(") {
          return;
        }
        parser2.i++;
        parser2.Push(parser2.itemFactory.create("auto open").setProperties({ open: "(", close: ")" }));
      };
      PhysicsMethods$1.Qqtext = function(parser2, name2, text2) {
        var star2 = parser2.GetStar();
        var arg = text2 ? text2 : parser2.GetArgument(name2);
        var replace2 = (star2 ? "" : "\\quad") + "\\text{" + arg + "}\\quad ";
        parser2.string = parser2.string.slice(0, parser2.i) + replace2 + parser2.string.slice(parser2.i);
      };
      PhysicsMethods$1.Differential = function(parser2, name2, op) {
        var optArg = parser2.GetBrackets(name2);
        var power = optArg != null ? "^{" + optArg + "}" : " ";
        var parens = parser2.GetNext() === "(";
        var braces = parser2.GetNext() === "{";
        var macro = op + power;
        if (!(parens || braces)) {
          macro += parser2.GetArgument(name2, true) || "";
          var mml = new TexParser_js_1.default(macro, parser2.stack.env, parser2.configuration).mml();
          parser2.Push(mml);
          return;
        }
        if (braces) {
          macro += parser2.GetArgument(name2);
          var mml = new TexParser_js_1.default(macro, parser2.stack.env, parser2.configuration).mml();
          parser2.Push(parser2.create("node", "TeXAtom", [mml], { texClass: MmlNode_js_1.TEXCLASS.OP }));
          return;
        }
        parser2.Push(new TexParser_js_1.default(macro, parser2.stack.env, parser2.configuration).mml());
        parser2.i++;
        parser2.Push(parser2.itemFactory.create("auto open").setProperties({ open: "(", close: ")" }));
      };
      PhysicsMethods$1.Derivative = function(parser2, name2, argMax, op) {
        var star2 = parser2.GetStar();
        var optArg = parser2.GetBrackets(name2);
        var argCounter = 1;
        var args2 = [];
        args2.push(parser2.GetArgument(name2));
        while (parser2.GetNext() === "{" && argCounter < argMax) {
          args2.push(parser2.GetArgument(name2));
          argCounter++;
        }
        var ignore = false;
        var power1 = " ";
        var power2 = " ";
        if (argMax > 2 && args2.length > 2) {
          power1 = "^{" + (args2.length - 1) + "}";
          ignore = true;
        } else if (optArg != null) {
          if (argMax > 2 && args2.length > 1) {
            ignore = true;
          }
          power1 = "^{" + optArg + "}";
          power2 = power1;
        }
        var frac = star2 ? "\\flatfrac" : "\\frac";
        var first = args2.length > 1 ? args2[0] : "";
        var second = args2.length > 1 ? args2[1] : args2[0];
        var rest = "";
        for (var i2 = 2, arg = void 0; arg = args2[i2]; i2++) {
          rest += op + " " + arg;
        }
        var macro = frac + "{" + op + power1 + first + "}{" + op + " " + second + power2 + " " + rest + "}";
        parser2.Push(new TexParser_js_1.default(macro, parser2.stack.env, parser2.configuration).mml());
        if (parser2.GetNext() === "(") {
          parser2.i++;
          parser2.Push(parser2.itemFactory.create("auto open").setProperties({ open: "(", close: ")", ignore }));
        }
      };
      PhysicsMethods$1.Bra = function(parser2, name2) {
        var starBra = parser2.GetStar();
        var bra = parser2.GetArgument(name2);
        var ket = "";
        var hasKet = false;
        var starKet = false;
        if (parser2.GetNext() === "\\") {
          var saveI = parser2.i;
          parser2.i++;
          var cs = parser2.GetCS();
          var symbol = parser2.lookup("macro", cs);
          if (symbol && symbol.symbol === "ket") {
            hasKet = true;
            saveI = parser2.i;
            starKet = parser2.GetStar();
            if (parser2.GetNext() === "{") {
              ket = parser2.GetArgument(cs, true);
            } else {
              parser2.i = saveI;
              starKet = false;
            }
          } else {
            parser2.i = saveI;
          }
        }
        var macro = "";
        if (hasKet) {
          macro = starBra || starKet ? "\\langle{".concat(bra, "}\\vert{").concat(ket, "}\\rangle") : "\\left\\langle{".concat(bra, "}\\middle\\vert{").concat(ket, "}\\right\\rangle");
        } else {
          macro = starBra || starKet ? "\\langle{".concat(bra, "}\\vert") : "\\left\\langle{".concat(bra, "}\\right\\vert{").concat(ket, "}");
        }
        parser2.Push(new TexParser_js_1.default(macro, parser2.stack.env, parser2.configuration).mml());
      };
      PhysicsMethods$1.Ket = function(parser2, name2) {
        var star2 = parser2.GetStar();
        var ket = parser2.GetArgument(name2);
        var macro = star2 ? "\\vert{".concat(ket, "}\\rangle") : "\\left\\vert{".concat(ket, "}\\right\\rangle");
        parser2.Push(new TexParser_js_1.default(macro, parser2.stack.env, parser2.configuration).mml());
      };
      PhysicsMethods$1.BraKet = function(parser2, name2) {
        var star2 = parser2.GetStar();
        var bra = parser2.GetArgument(name2);
        var ket = null;
        if (parser2.GetNext() === "{") {
          ket = parser2.GetArgument(name2, true);
        }
        var macro = "";
        if (ket == null) {
          macro = star2 ? "\\langle{".concat(bra, "}\\vert{").concat(bra, "}\\rangle") : "\\left\\langle{".concat(bra, "}\\middle\\vert{").concat(bra, "}\\right\\rangle");
        } else {
          macro = star2 ? "\\langle{".concat(bra, "}\\vert{").concat(ket, "}\\rangle") : "\\left\\langle{".concat(bra, "}\\middle\\vert{").concat(ket, "}\\right\\rangle");
        }
        parser2.Push(new TexParser_js_1.default(macro, parser2.stack.env, parser2.configuration).mml());
      };
      PhysicsMethods$1.KetBra = function(parser2, name2) {
        var star2 = parser2.GetStar();
        var ket = parser2.GetArgument(name2);
        var bra = null;
        if (parser2.GetNext() === "{") {
          bra = parser2.GetArgument(name2, true);
        }
        var macro = "";
        if (bra == null) {
          macro = star2 ? "\\vert{".concat(ket, "}\\rangle\\!\\langle{").concat(ket, "}\\vert") : "\\left\\vert{".concat(ket, "}\\middle\\rangle\\!\\middle\\langle{").concat(ket, "}\\right\\vert");
        } else {
          macro = star2 ? "\\vert{".concat(ket, "}\\rangle\\!\\langle{").concat(bra, "}\\vert") : "\\left\\vert{".concat(ket, "}\\middle\\rangle\\!\\middle\\langle{").concat(bra, "}\\right\\vert");
        }
        parser2.Push(new TexParser_js_1.default(macro, parser2.stack.env, parser2.configuration).mml());
      };
      function outputBraket(_a2, star1, star2) {
        var _b2 = __read2(_a2, 3), arg1 = _b2[0], arg2 = _b2[1], arg3 = _b2[2];
        return star1 && star2 ? "\\left\\langle{".concat(arg1, "}\\middle\\vert{").concat(arg2, "}\\middle\\vert{").concat(arg3, "}\\right\\rangle") : star1 ? "\\langle{".concat(arg1, "}\\vert{").concat(arg2, "}\\vert{").concat(arg3, "}\\rangle") : "\\left\\langle{".concat(arg1, "}\\right\\vert{").concat(arg2, "}\\left\\vert{").concat(arg3, "}\\right\\rangle");
      }
      PhysicsMethods$1.Expectation = function(parser2, name2) {
        var star1 = parser2.GetStar();
        var star2 = star1 && parser2.GetStar();
        var arg1 = parser2.GetArgument(name2);
        var arg2 = null;
        if (parser2.GetNext() === "{") {
          arg2 = parser2.GetArgument(name2, true);
        }
        var macro = arg1 && arg2 ? outputBraket([arg2, arg1, arg2], star1, star2) : star1 ? "\\langle {".concat(arg1, "} \\rangle") : "\\left\\langle {".concat(arg1, "} \\right\\rangle");
        parser2.Push(new TexParser_js_1.default(macro, parser2.stack.env, parser2.configuration).mml());
      };
      PhysicsMethods$1.MatrixElement = function(parser2, name2) {
        var star1 = parser2.GetStar();
        var star2 = star1 && parser2.GetStar();
        var arg1 = parser2.GetArgument(name2);
        var arg2 = parser2.GetArgument(name2);
        var arg3 = parser2.GetArgument(name2);
        var macro = outputBraket([arg1, arg2, arg3], star1, star2);
        parser2.Push(new TexParser_js_1.default(macro, parser2.stack.env, parser2.configuration).mml());
      };
      PhysicsMethods$1.MatrixQuantity = function(parser2, name2, small2) {
        var star2 = parser2.GetStar();
        var next = parser2.GetNext();
        var array = small2 ? "smallmatrix" : "array";
        var arg = "";
        var open = "";
        var close2 = "";
        switch (next) {
          case "{":
            arg = parser2.GetArgument(name2);
            break;
          case "(":
            parser2.i++;
            open = star2 ? "\\lgroup" : "(";
            close2 = star2 ? "\\rgroup" : ")";
            arg = parser2.GetUpTo(name2, ")");
            break;
          case "[":
            parser2.i++;
            open = "[";
            close2 = "]";
            arg = parser2.GetUpTo(name2, "]");
            break;
          case "|":
            parser2.i++;
            open = "|";
            close2 = "|";
            arg = parser2.GetUpTo(name2, "|");
            break;
          default:
            open = "(";
            close2 = ")";
            break;
        }
        var macro = (open ? "\\left" : "") + open + "\\begin{" + array + "}{} " + arg + "\\end{" + array + "}" + (open ? "\\right" : "") + close2;
        parser2.Push(new TexParser_js_1.default(macro, parser2.stack.env, parser2.configuration).mml());
      };
      PhysicsMethods$1.IdentityMatrix = function(parser2, name2) {
        var arg = parser2.GetArgument(name2);
        var size = parseInt(arg, 10);
        if (isNaN(size)) {
          throw new TexError_js_1.default("InvalidNumber", "Invalid number");
        }
        if (size <= 1) {
          parser2.string = "1" + parser2.string.slice(parser2.i);
          parser2.i = 0;
          return;
        }
        var zeros = Array(size).fill("0");
        var columns = [];
        for (var i2 = 0; i2 < size; i2++) {
          var row2 = zeros.slice();
          row2[i2] = "1";
          columns.push(row2.join(" & "));
        }
        parser2.string = columns.join("\\\\ ") + parser2.string.slice(parser2.i);
        parser2.i = 0;
      };
      PhysicsMethods$1.XMatrix = function(parser2, name2) {
        var star2 = parser2.GetStar();
        var arg1 = parser2.GetArgument(name2);
        var arg2 = parser2.GetArgument(name2);
        var arg3 = parser2.GetArgument(name2);
        var n = parseInt(arg2, 10);
        var m = parseInt(arg3, 10);
        if (isNaN(n) || isNaN(m) || m.toString() !== arg3 || n.toString() !== arg2) {
          throw new TexError_js_1.default("InvalidNumber", "Invalid number");
        }
        n = n < 1 ? 1 : n;
        m = m < 1 ? 1 : m;
        if (!star2) {
          var row2 = Array(m).fill(arg1).join(" & ");
          var matrix_1 = Array(n).fill(row2).join("\\\\ ");
          parser2.string = matrix_1 + parser2.string.slice(parser2.i);
          parser2.i = 0;
          return;
        }
        var matrix = "";
        if (n === 1 && m === 1) {
          matrix = arg1;
        } else if (n === 1) {
          var row2 = [];
          for (var i2 = 1; i2 <= m; i2++) {
            row2.push("".concat(arg1, "_{").concat(i2, "}"));
          }
          matrix = row2.join(" & ");
        } else if (m === 1) {
          var row2 = [];
          for (var i2 = 1; i2 <= n; i2++) {
            row2.push("".concat(arg1, "_{").concat(i2, "}"));
          }
          matrix = row2.join("\\\\ ");
        } else {
          var rows = [];
          for (var i2 = 1; i2 <= n; i2++) {
            var row2 = [];
            for (var j = 1; j <= m; j++) {
              row2.push("".concat(arg1, "_{{").concat(i2, "}{").concat(j, "}}"));
            }
            rows.push(row2.join(" & "));
          }
          matrix = rows.join("\\\\ ");
        }
        parser2.string = matrix + parser2.string.slice(parser2.i);
        parser2.i = 0;
        return;
      };
      PhysicsMethods$1.PauliMatrix = function(parser2, name2) {
        var arg = parser2.GetArgument(name2);
        var matrix = arg.slice(1);
        switch (arg[0]) {
          case "0":
            matrix += " 1 & 0\\\\ 0 & 1";
            break;
          case "1":
          case "x":
            matrix += " 0 & 1\\\\ 1 & 0";
            break;
          case "2":
          case "y":
            matrix += " 0 & -i\\\\ i & 0";
            break;
          case "3":
          case "z":
            matrix += " 1 & 0\\\\ 0 & -1";
            break;
        }
        parser2.string = matrix + parser2.string.slice(parser2.i);
        parser2.i = 0;
      };
      PhysicsMethods$1.DiagonalMatrix = function(parser2, name2, anti) {
        if (parser2.GetNext() !== "{") {
          return;
        }
        var startI = parser2.i;
        parser2.GetArgument(name2);
        var endI = parser2.i;
        parser2.i = startI + 1;
        var elements = [];
        var element = "";
        var currentI = parser2.i;
        while (currentI < endI) {
          try {
            element = parser2.GetUpTo(name2, ",");
          } catch (e) {
            parser2.i = endI;
            elements.push(parser2.string.slice(currentI, endI - 1));
            break;
          }
          if (parser2.i >= endI) {
            elements.push(parser2.string.slice(currentI, endI));
            break;
          }
          currentI = parser2.i;
          elements.push(element);
        }
        parser2.string = makeDiagMatrix(elements, anti) + parser2.string.slice(endI);
        parser2.i = 0;
      };
      function makeDiagMatrix(elements, anti) {
        var length = elements.length;
        var matrix = [];
        for (var i2 = 0; i2 < length; i2++) {
          matrix.push(Array(anti ? length - i2 : i2 + 1).join("&") + "\\mqty{" + elements[i2] + "}");
        }
        return matrix.join("\\\\ ");
      }
      PhysicsMethods$1.AutoClose = function(parser2, fence2, _texclass) {
        var mo2 = parser2.create("token", "mo", { stretchy: false }, fence2);
        var item2 = parser2.itemFactory.create("mml", mo2).setProperties({ autoclose: fence2 });
        parser2.Push(item2);
      };
      PhysicsMethods$1.Vnabla = function(parser2, _name) {
        var argument = parser2.options.physics.arrowdel ? "\\vec{\\gradientnabla}" : "{\\gradientnabla}";
        return parser2.Push(new TexParser_js_1.default(argument, parser2.stack.env, parser2.configuration).mml());
      };
      PhysicsMethods$1.DiffD = function(parser2, _name) {
        var argument = parser2.options.physics.italicdiff ? "d" : "{\\rm d}";
        return parser2.Push(new TexParser_js_1.default(argument, parser2.stack.env, parser2.configuration).mml());
      };
      PhysicsMethods$1.Macro = BaseMethods_js_1.default.Macro;
      PhysicsMethods$1.NamedFn = BaseMethods_js_1.default.NamedFn;
      PhysicsMethods$1.Array = BaseMethods_js_1.default.Array;
      PhysicsMethods.default = PhysicsMethods$1;
      return PhysicsMethods;
    }
    var hasRequiredPhysicsMappings;
    function requirePhysicsMappings() {
      if (hasRequiredPhysicsMappings) return PhysicsMappings;
      hasRequiredPhysicsMappings = 1;
      var __importDefault2 = PhysicsMappings && PhysicsMappings.__importDefault || function(mod2) {
        return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
      };
      Object.defineProperty(PhysicsMappings, "__esModule", { value: true });
      var SymbolMap_js_1 = requireSymbolMap();
      var PhysicsMethods_js_1 = __importDefault2(requirePhysicsMethods());
      var TexConstants_js_1 = requireTexConstants();
      var ParseMethods_js_1 = __importDefault2(requireParseMethods());
      var MmlNode_js_1 = requireMmlNode();
      new SymbolMap_js_1.CommandMap("Physics-automatic-bracing-macros", {
        "quantity": "Quantity",
        "qty": "Quantity",
        "pqty": ["Quantity", "(", ")", true],
        "bqty": ["Quantity", "[", "]", true],
        "vqty": ["Quantity", "|", "|", true],
        "Bqty": ["Quantity", "\\{", "\\}", true],
        "absolutevalue": ["Quantity", "|", "|", true],
        "abs": ["Quantity", "|", "|", true],
        "norm": ["Quantity", "\\|", "\\|", true],
        "evaluated": "Eval",
        "eval": "Eval",
        "order": [
          "Quantity",
          "(",
          ")",
          true,
          "O",
          TexConstants_js_1.TexConstant.Variant.CALLIGRAPHIC
        ],
        "commutator": "Commutator",
        "comm": "Commutator",
        "anticommutator": ["Commutator", "\\{", "\\}"],
        "acomm": ["Commutator", "\\{", "\\}"],
        "poissonbracket": ["Commutator", "\\{", "\\}"],
        "pb": ["Commutator", "\\{", "\\}"]
      }, PhysicsMethods_js_1.default);
      new SymbolMap_js_1.CharacterMap("Physics-vector-mo", ParseMethods_js_1.default.mathchar0mo, {
        dotproduct: ["⋅", { mathvariant: TexConstants_js_1.TexConstant.Variant.BOLD }],
        vdot: ["⋅", { mathvariant: TexConstants_js_1.TexConstant.Variant.BOLD }],
        crossproduct: "×",
        cross: "×",
        cp: "×",
        gradientnabla: ["∇", { mathvariant: TexConstants_js_1.TexConstant.Variant.BOLD }]
      });
      new SymbolMap_js_1.CharacterMap("Physics-vector-mi", ParseMethods_js_1.default.mathchar0mi, {
        real: ["ℜ", { mathvariant: TexConstants_js_1.TexConstant.Variant.NORMAL }],
        imaginary: ["ℑ", { mathvariant: TexConstants_js_1.TexConstant.Variant.NORMAL }]
      });
      new SymbolMap_js_1.CommandMap("Physics-vector-macros", {
        "vnabla": "Vnabla",
        "vectorbold": "VectorBold",
        "vb": "VectorBold",
        "vectorarrow": ["StarMacro", 1, "\\vec{\\vb", "{#1}}"],
        "va": ["StarMacro", 1, "\\vec{\\vb", "{#1}}"],
        "vectorunit": ["StarMacro", 1, "\\hat{\\vb", "{#1}}"],
        "vu": ["StarMacro", 1, "\\hat{\\vb", "{#1}}"],
        "gradient": ["OperatorApplication", "\\vnabla", "(", "["],
        "grad": ["OperatorApplication", "\\vnabla", "(", "["],
        "divergence": ["VectorOperator", "\\vnabla\\vdot", "(", "["],
        "div": ["VectorOperator", "\\vnabla\\vdot", "(", "["],
        "curl": ["VectorOperator", "\\vnabla\\crossproduct", "(", "["],
        "laplacian": ["OperatorApplication", "\\nabla^2", "(", "["]
      }, PhysicsMethods_js_1.default);
      new SymbolMap_js_1.CommandMap("Physics-expressions-macros", {
        "sin": "Expression",
        "sinh": "Expression",
        "arcsin": "Expression",
        "asin": "Expression",
        "cos": "Expression",
        "cosh": "Expression",
        "arccos": "Expression",
        "acos": "Expression",
        "tan": "Expression",
        "tanh": "Expression",
        "arctan": "Expression",
        "atan": "Expression",
        "csc": "Expression",
        "csch": "Expression",
        "arccsc": "Expression",
        "acsc": "Expression",
        "sec": "Expression",
        "sech": "Expression",
        "arcsec": "Expression",
        "asec": "Expression",
        "cot": "Expression",
        "coth": "Expression",
        "arccot": "Expression",
        "acot": "Expression",
        "exp": ["Expression", false],
        "log": "Expression",
        "ln": "Expression",
        "det": ["Expression", false],
        "Pr": ["Expression", false],
        "tr": ["Expression", false],
        "trace": ["Expression", false, "tr"],
        "Tr": ["Expression", false],
        "Trace": ["Expression", false, "Tr"],
        "rank": "NamedFn",
        "erf": ["Expression", false],
        "Residue": ["Macro", "\\mathrm{Res}"],
        "Res": ["OperatorApplication", "\\Residue", "(", "[", "{"],
        "principalvalue": ["OperatorApplication", "{\\cal P}"],
        "pv": ["OperatorApplication", "{\\cal P}"],
        "PV": ["OperatorApplication", "{\\rm P.V.}"],
        "Re": ["OperatorApplication", "\\mathrm{Re}", "{"],
        "Im": ["OperatorApplication", "\\mathrm{Im}", "{"],
        "sine": ["NamedFn", "sin"],
        "hypsine": ["NamedFn", "sinh"],
        "arcsine": ["NamedFn", "arcsin"],
        "asine": ["NamedFn", "asin"],
        "cosine": ["NamedFn", "cos"],
        "hypcosine": ["NamedFn", "cosh"],
        "arccosine": ["NamedFn", "arccos"],
        "acosine": ["NamedFn", "acos"],
        "tangent": ["NamedFn", "tan"],
        "hyptangent": ["NamedFn", "tanh"],
        "arctangent": ["NamedFn", "arctan"],
        "atangent": ["NamedFn", "atan"],
        "cosecant": ["NamedFn", "csc"],
        "hypcosecant": ["NamedFn", "csch"],
        "arccosecant": ["NamedFn", "arccsc"],
        "acosecant": ["NamedFn", "acsc"],
        "secant": ["NamedFn", "sec"],
        "hypsecant": ["NamedFn", "sech"],
        "arcsecant": ["NamedFn", "arcsec"],
        "asecant": ["NamedFn", "asec"],
        "cotangent": ["NamedFn", "cot"],
        "hypcotangent": ["NamedFn", "coth"],
        "arccotangent": ["NamedFn", "arccot"],
        "acotangent": ["NamedFn", "acot"],
        "exponential": ["NamedFn", "exp"],
        "logarithm": ["NamedFn", "log"],
        "naturallogarithm": ["NamedFn", "ln"],
        "determinant": ["NamedFn", "det"],
        "Probability": ["NamedFn", "Pr"]
      }, PhysicsMethods_js_1.default);
      new SymbolMap_js_1.CommandMap("Physics-quick-quad-macros", {
        "qqtext": "Qqtext",
        "qq": "Qqtext",
        "qcomma": ["Macro", "\\qqtext*{,}"],
        "qc": ["Macro", "\\qqtext*{,}"],
        "qcc": ["Qqtext", "c.c."],
        "qif": ["Qqtext", "if"],
        "qthen": ["Qqtext", "then"],
        "qelse": ["Qqtext", "else"],
        "qotherwise": ["Qqtext", "otherwise"],
        "qunless": ["Qqtext", "unless"],
        "qgiven": ["Qqtext", "given"],
        "qusing": ["Qqtext", "using"],
        "qassume": ["Qqtext", "assume"],
        "qsince": ["Qqtext", "since"],
        "qlet": ["Qqtext", "let"],
        "qfor": ["Qqtext", "for"],
        "qall": ["Qqtext", "all"],
        "qeven": ["Qqtext", "even"],
        "qodd": ["Qqtext", "odd"],
        "qinteger": ["Qqtext", "integer"],
        "qand": ["Qqtext", "and"],
        "qor": ["Qqtext", "or"],
        "qas": ["Qqtext", "as"],
        "qin": ["Qqtext", "in"]
      }, PhysicsMethods_js_1.default);
      new SymbolMap_js_1.CommandMap("Physics-derivative-macros", {
        "diffd": "DiffD",
        "flatfrac": ["Macro", "\\left.#1\\middle/#2\\right.", 2],
        "differential": ["Differential", "\\diffd"],
        "dd": ["Differential", "\\diffd"],
        "variation": ["Differential", "\\delta"],
        "var": ["Differential", "\\delta"],
        "derivative": ["Derivative", 2, "\\diffd"],
        "dv": ["Derivative", 2, "\\diffd"],
        "partialderivative": ["Derivative", 3, "\\partial"],
        "pderivative": ["Derivative", 3, "\\partial"],
        "pdv": ["Derivative", 3, "\\partial"],
        "functionalderivative": ["Derivative", 2, "\\delta"],
        "fderivative": ["Derivative", 2, "\\delta"],
        "fdv": ["Derivative", 2, "\\delta"]
      }, PhysicsMethods_js_1.default);
      new SymbolMap_js_1.CommandMap("Physics-bra-ket-macros", {
        "bra": "Bra",
        "ket": "Ket",
        "innerproduct": "BraKet",
        "ip": "BraKet",
        "braket": "BraKet",
        "outerproduct": "KetBra",
        "dyad": "KetBra",
        "ketbra": "KetBra",
        "op": "KetBra",
        "expectationvalue": "Expectation",
        "expval": "Expectation",
        "ev": "Expectation",
        "matrixelement": "MatrixElement",
        "matrixel": "MatrixElement",
        "mel": "MatrixElement"
      }, PhysicsMethods_js_1.default);
      new SymbolMap_js_1.CommandMap("Physics-matrix-macros", {
        "matrixquantity": "MatrixQuantity",
        "mqty": "MatrixQuantity",
        "pmqty": ["Macro", "\\mqty(#1)", 1],
        "Pmqty": ["Macro", "\\mqty*(#1)", 1],
        "bmqty": ["Macro", "\\mqty[#1]", 1],
        "vmqty": ["Macro", "\\mqty|#1|", 1],
        "smallmatrixquantity": ["MatrixQuantity", true],
        "smqty": ["MatrixQuantity", true],
        "spmqty": ["Macro", "\\smqty(#1)", 1],
        "sPmqty": ["Macro", "\\smqty*(#1)", 1],
        "sbmqty": ["Macro", "\\smqty[#1]", 1],
        "svmqty": ["Macro", "\\smqty|#1|", 1],
        "matrixdeterminant": ["Macro", "\\vmqty{#1}", 1],
        "mdet": ["Macro", "\\vmqty{#1}", 1],
        "smdet": ["Macro", "\\svmqty{#1}", 1],
        "identitymatrix": "IdentityMatrix",
        "imat": "IdentityMatrix",
        "xmatrix": "XMatrix",
        "xmat": "XMatrix",
        "zeromatrix": ["Macro", "\\xmat{0}{#1}{#2}", 2],
        "zmat": ["Macro", "\\xmat{0}{#1}{#2}", 2],
        "paulimatrix": "PauliMatrix",
        "pmat": "PauliMatrix",
        "diagonalmatrix": "DiagonalMatrix",
        "dmat": "DiagonalMatrix",
        "antidiagonalmatrix": ["DiagonalMatrix", true],
        "admat": ["DiagonalMatrix", true]
      }, PhysicsMethods_js_1.default);
      new SymbolMap_js_1.EnvironmentMap("Physics-aux-envs", ParseMethods_js_1.default.environment, {
        smallmatrix: ["Array", null, null, null, "c", "0.333em", ".2em", "S", 1]
      }, PhysicsMethods_js_1.default);
      new SymbolMap_js_1.MacroMap("Physics-characters", {
        "|": ["AutoClose", MmlNode_js_1.TEXCLASS.ORD],
        ")": "AutoClose",
        "]": "AutoClose"
      }, PhysicsMethods_js_1.default);
      return PhysicsMappings;
    }
    var hasRequiredPhysicsConfiguration;
    function requirePhysicsConfiguration() {
      if (hasRequiredPhysicsConfiguration) return PhysicsConfiguration;
      hasRequiredPhysicsConfiguration = 1;
      var _a2;
      Object.defineProperty(PhysicsConfiguration, "__esModule", { value: true });
      PhysicsConfiguration.PhysicsConfiguration = void 0;
      var Configuration_js_1 = requireConfiguration();
      var PhysicsItems_js_1 = requirePhysicsItems();
      requirePhysicsMappings();
      PhysicsConfiguration.PhysicsConfiguration = Configuration_js_1.Configuration.create("physics", {
        handler: {
          macro: [
            "Physics-automatic-bracing-macros",
            "Physics-vector-macros",
            "Physics-vector-mo",
            "Physics-vector-mi",
            "Physics-derivative-macros",
            "Physics-expressions-macros",
            "Physics-quick-quad-macros",
            "Physics-bra-ket-macros",
            "Physics-matrix-macros"
          ],
          character: ["Physics-characters"],
          environment: ["Physics-aux-envs"]
        },
        items: (_a2 = {}, _a2[PhysicsItems_js_1.AutoOpen.prototype.kind] = PhysicsItems_js_1.AutoOpen, _a2),
        options: {
          physics: {
            italicdiff: false,
            arrowdel: false
          }
        }
      });
      return PhysicsConfiguration;
    }
    var SetOptionsConfiguration = {};
    var hasRequiredSetOptionsConfiguration;
    function requireSetOptionsConfiguration() {
      if (hasRequiredSetOptionsConfiguration) return SetOptionsConfiguration;
      hasRequiredSetOptionsConfiguration = 1;
      (function(exports2) {
        var __values2 = SetOptionsConfiguration && SetOptionsConfiguration.__values || function(o) {
          var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i2 = 0;
          if (m) return m.call(o);
          if (o && typeof o.length === "number") return {
            next: function() {
              if (o && i2 >= o.length) o = void 0;
              return { value: o && o[i2++], done: !o };
            }
          };
          throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
        };
        var __importDefault2 = SetOptionsConfiguration && SetOptionsConfiguration.__importDefault || function(mod2) {
          return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
        };
        Object.defineProperty(exports2, "__esModule", { value: true });
        exports2.SetOptionsConfiguration = exports2.SetOptionsUtil = void 0;
        var Configuration_js_1 = requireConfiguration();
        var SymbolMap_js_1 = requireSymbolMap();
        var TexError_js_1 = __importDefault2(requireTexError());
        var ParseUtil_js_1 = __importDefault2(requireParseUtil());
        var Symbol_js_1 = require_Symbol();
        var BaseMethods_js_1 = __importDefault2(requireBaseMethods());
        var Options_js_1 = requireOptions$1();
        exports2.SetOptionsUtil = {
          filterPackage: function(parser2, extension) {
            if (extension !== "tex" && !Configuration_js_1.ConfigurationHandler.get(extension)) {
              throw new TexError_js_1.default("NotAPackage", "Not a defined package: %1", extension);
            }
            var config2 = parser2.options.setoptions;
            var options2 = config2.allowOptions[extension];
            if (options2 === void 0 && !config2.allowPackageDefault || options2 === false) {
              throw new TexError_js_1.default("PackageNotSettable", `Options can't be set for package "%1"`, extension);
            }
            return true;
          },
          filterOption: function(parser2, extension, option) {
            var _a2;
            var config2 = parser2.options.setoptions;
            var options2 = config2.allowOptions[extension] || {};
            var allow = options2.hasOwnProperty(option) && !(0, Options_js_1.isObject)(options2[option]) ? options2[option] : null;
            if (allow === false || allow === null && !config2.allowOptionsDefault) {
              throw new TexError_js_1.default("OptionNotSettable", 'Option "%1" is not allowed to be set', option);
            }
            if (!((_a2 = extension === "tex" ? parser2.options : parser2.options[extension]) === null || _a2 === void 0 ? void 0 : _a2.hasOwnProperty(option))) {
              if (extension === "tex") {
                throw new TexError_js_1.default("InvalidTexOption", 'Invalid TeX option "%1"', option);
              } else {
                throw new TexError_js_1.default("InvalidOptionKey", 'Invalid option "%1" for package "%2"', option, extension);
              }
            }
            return true;
          },
          filterValue: function(_parser2, _extension, _option, value2) {
            return value2;
          }
        };
        var setOptionsMap = new SymbolMap_js_1.CommandMap("setoptions", {
          setOptions: "SetOptions"
        }, {
          SetOptions: function(parser2, name2) {
            var e_1, _a2;
            var extension = parser2.GetBrackets(name2) || "tex";
            var options2 = ParseUtil_js_1.default.keyvalOptions(parser2.GetArgument(name2));
            var config2 = parser2.options.setoptions;
            if (!config2.filterPackage(parser2, extension))
              return;
            try {
              for (var _b2 = __values2(Object.keys(options2)), _c = _b2.next(); !_c.done; _c = _b2.next()) {
                var key2 = _c.value;
                if (config2.filterOption(parser2, extension, key2)) {
                  (extension === "tex" ? parser2.options : parser2.options[extension])[key2] = config2.filterValue(parser2, extension, key2, options2[key2]);
                }
              }
            } catch (e_1_1) {
              e_1 = { error: e_1_1 };
            } finally {
              try {
                if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
              } finally {
                if (e_1) throw e_1.error;
              }
            }
          }
        });
        function setoptionsConfig(_config, jax) {
          var require2 = jax.parseOptions.handlers.get("macro").lookup("require");
          if (require2) {
            setOptionsMap.add("Require", new Symbol_js_1.Macro("Require", require2._func));
            setOptionsMap.add("require", new Symbol_js_1.Macro("require", BaseMethods_js_1.default.Macro, ["\\Require{#2}\\setOptions[#2]{#1}", 2, ""]));
          }
        }
        exports2.SetOptionsConfiguration = Configuration_js_1.Configuration.create("setoptions", {
          handler: { macro: ["setoptions"] },
          config: setoptionsConfig,
          priority: 3,
          options: {
            setoptions: {
              filterPackage: exports2.SetOptionsUtil.filterPackage,
              filterOption: exports2.SetOptionsUtil.filterOption,
              filterValue: exports2.SetOptionsUtil.filterValue,
              allowPackageDefault: true,
              allowOptionsDefault: true,
              allowOptions: (0, Options_js_1.expandable)({
                tex: {
                  FindTeX: false,
                  formatError: false,
                  package: false,
                  baseURL: false,
                  tags: false,
                  maxBuffer: false,
                  maxMaxros: false,
                  macros: false,
                  environments: false
                },
                setoptions: false,
                autoload: false,
                require: false,
                configmacros: false,
                tagformat: false
              })
            }
          }
        });
      })(SetOptionsConfiguration);
      return SetOptionsConfiguration;
    }
    var TagFormatConfiguration = {};
    var hasRequiredTagFormatConfiguration;
    function requireTagFormatConfiguration() {
      if (hasRequiredTagFormatConfiguration) return TagFormatConfiguration;
      hasRequiredTagFormatConfiguration = 1;
      var __extends2 = TagFormatConfiguration && TagFormatConfiguration.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      Object.defineProperty(TagFormatConfiguration, "__esModule", { value: true });
      TagFormatConfiguration.TagFormatConfiguration = TagFormatConfiguration.tagformatConfig = void 0;
      var Configuration_js_1 = requireConfiguration();
      var Tags_js_1 = requireTags();
      var tagID = 0;
      function tagformatConfig(config2, jax) {
        var tags2 = jax.parseOptions.options.tags;
        if (tags2 !== "base" && config2.tags.hasOwnProperty(tags2)) {
          Tags_js_1.TagsFactory.add(tags2, config2.tags[tags2]);
        }
        var TagClass = Tags_js_1.TagsFactory.create(jax.parseOptions.options.tags).constructor;
        var TagFormat = (function(_super) {
          __extends2(TagFormat2, _super);
          function TagFormat2() {
            return _super !== null && _super.apply(this, arguments) || this;
          }
          TagFormat2.prototype.formatNumber = function(n) {
            return jax.parseOptions.options.tagformat.number(n);
          };
          TagFormat2.prototype.formatTag = function(tag) {
            return jax.parseOptions.options.tagformat.tag(tag);
          };
          TagFormat2.prototype.formatId = function(id) {
            return jax.parseOptions.options.tagformat.id(id);
          };
          TagFormat2.prototype.formatUrl = function(id, base2) {
            return jax.parseOptions.options.tagformat.url(id, base2);
          };
          return TagFormat2;
        })(TagClass);
        tagID++;
        var tagName = "configTags-" + tagID;
        Tags_js_1.TagsFactory.add(tagName, TagFormat);
        jax.parseOptions.options.tags = tagName;
      }
      TagFormatConfiguration.tagformatConfig = tagformatConfig;
      TagFormatConfiguration.TagFormatConfiguration = Configuration_js_1.Configuration.create("tagformat", {
        config: [tagformatConfig, 10],
        options: {
          tagformat: {
            number: function(n) {
              return n.toString();
            },
            tag: function(tag) {
              return "(" + tag + ")";
            },
            id: function(id) {
              return "mjx-eqn:" + id.replace(/\s/g, "_");
            },
            url: function(id, base2) {
              return base2 + "#" + encodeURIComponent(id);
            }
          }
        }
      });
      return TagFormatConfiguration;
    }
    var TextcompConfiguration = {};
    var TextcompMappings = {};
    var TextMacrosMethods = {};
    var hasRequiredTextMacrosMethods;
    function requireTextMacrosMethods() {
      if (hasRequiredTextMacrosMethods) return TextMacrosMethods;
      hasRequiredTextMacrosMethods = 1;
      var __importDefault2 = TextMacrosMethods && TextMacrosMethods.__importDefault || function(mod2) {
        return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
      };
      Object.defineProperty(TextMacrosMethods, "__esModule", { value: true });
      TextMacrosMethods.TextMacrosMethods = void 0;
      var TexParser_js_1 = __importDefault2(requireTexParser());
      var Retries_js_1 = requireRetries();
      var BaseMethods_js_1 = __importDefault2(requireBaseMethods());
      TextMacrosMethods.TextMacrosMethods = {
        Comment: function(parser2, _c) {
          while (parser2.i < parser2.string.length && parser2.string.charAt(parser2.i) !== "\n") {
            parser2.i++;
          }
          parser2.i++;
        },
        Math: function(parser2, open) {
          parser2.saveText();
          var i2 = parser2.i;
          var j, c2;
          var braces = 0;
          while (c2 = parser2.GetNext()) {
            j = parser2.i++;
            switch (c2) {
              case "\\":
                var cs = parser2.GetCS();
                if (cs === ")")
                  c2 = "\\(";
              case "$":
                if (braces === 0 && open === c2) {
                  var config2 = parser2.texParser.configuration;
                  var mml = new TexParser_js_1.default(parser2.string.substr(i2, j - i2), parser2.stack.env, config2).mml();
                  parser2.PushMath(mml);
                  return;
                }
                break;
              case "{":
                braces++;
                break;
              case "}":
                if (braces === 0) {
                  parser2.Error("ExtraCloseMissingOpen", "Extra close brace or missing open brace");
                }
                braces--;
                break;
            }
          }
          parser2.Error("MathNotTerminated", "Math-mode is not properly terminated");
        },
        MathModeOnly: function(parser2, c2) {
          parser2.Error("MathModeOnly", "'%1' allowed only in math mode", c2);
        },
        Misplaced: function(parser2, c2) {
          parser2.Error("Misplaced", "'%1' can not be used here", c2);
        },
        OpenBrace: function(parser2, _c) {
          var env = parser2.stack.env;
          parser2.envStack.push(env);
          parser2.stack.env = Object.assign({}, env);
        },
        CloseBrace: function(parser2, _c) {
          if (parser2.envStack.length) {
            parser2.saveText();
            parser2.stack.env = parser2.envStack.pop();
          } else {
            parser2.Error("ExtraCloseMissingOpen", "Extra close brace or missing open brace");
          }
        },
        OpenQuote: function(parser2, c2) {
          if (parser2.string.charAt(parser2.i) === c2) {
            parser2.text += "“";
            parser2.i++;
          } else {
            parser2.text += "‘";
          }
        },
        CloseQuote: function(parser2, c2) {
          if (parser2.string.charAt(parser2.i) === c2) {
            parser2.text += "”";
            parser2.i++;
          } else {
            parser2.text += "’";
          }
        },
        Tilde: function(parser2, _c) {
          parser2.text += " ";
        },
        Space: function(parser2, _c) {
          parser2.text += " ";
          while (parser2.GetNext().match(/\s/))
            parser2.i++;
        },
        SelfQuote: function(parser2, name2) {
          parser2.text += name2.substr(1);
        },
        Insert: function(parser2, _name, c2) {
          parser2.text += c2;
        },
        Accent: function(parser2, name2, c2) {
          var base2 = parser2.ParseArg(name2);
          var accent = parser2.create("token", "mo", {}, c2);
          parser2.addAttributes(accent);
          parser2.Push(parser2.create("node", "mover", [base2, accent]));
        },
        Emph: function(parser2, name2) {
          var variant = parser2.stack.env.mathvariant === "-tex-mathit" ? "normal" : "-tex-mathit";
          parser2.Push(parser2.ParseTextArg(name2, { mathvariant: variant }));
        },
        SetFont: function(parser2, _name, variant) {
          parser2.saveText();
          parser2.stack.env.mathvariant = variant;
        },
        SetSize: function(parser2, _name, size) {
          parser2.saveText();
          parser2.stack.env.mathsize = size;
        },
        CheckAutoload: function(parser2, name2) {
          var autoload = parser2.configuration.packageData.get("autoload");
          var texParser = parser2.texParser;
          name2 = name2.slice(1);
          var macro = texParser.lookup("macro", name2);
          if (!macro || autoload && macro._func === autoload.Autoload) {
            texParser.parse("macro", [texParser, name2]);
            if (!macro)
              return;
            (0, Retries_js_1.retryAfter)(Promise.resolve());
          }
          texParser.parse("macro", [parser2, name2]);
        },
        Macro: BaseMethods_js_1.default.Macro,
        Spacer: BaseMethods_js_1.default.Spacer,
        Hskip: BaseMethods_js_1.default.Hskip,
        rule: BaseMethods_js_1.default.rule,
        Rule: BaseMethods_js_1.default.Rule,
        HandleRef: BaseMethods_js_1.default.HandleRef
      };
      return TextMacrosMethods;
    }
    var TextParser = {};
    var hasRequiredTextParser;
    function requireTextParser() {
      if (hasRequiredTextParser) return TextParser;
      hasRequiredTextParser = 1;
      var __extends2 = TextParser && TextParser.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      var __values2 = TextParser && TextParser.__values || function(o) {
        var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i2 = 0;
        if (m) return m.call(o);
        if (o && typeof o.length === "number") return {
          next: function() {
            if (o && i2 >= o.length) o = void 0;
            return { value: o && o[i2++], done: !o };
          }
        };
        throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
      };
      var __read2 = TextParser && TextParser.__read || function(o, n) {
        var m = typeof Symbol === "function" && o[Symbol.iterator];
        if (!m) return o;
        var i2 = m.call(o), r2, ar2 = [], e;
        try {
          while ((n === void 0 || n-- > 0) && !(r2 = i2.next()).done) ar2.push(r2.value);
        } catch (error2) {
          e = { error: error2 };
        } finally {
          try {
            if (r2 && !r2.done && (m = i2["return"])) m.call(i2);
          } finally {
            if (e) throw e.error;
          }
        }
        return ar2;
      };
      var __spreadArray2 = TextParser && TextParser.__spreadArray || function(to2, from, pack) {
        if (pack || arguments.length === 2) for (var i2 = 0, l = from.length, ar2; i2 < l; i2++) {
          if (ar2 || !(i2 in from)) {
            if (!ar2) ar2 = Array.prototype.slice.call(from, 0, i2);
            ar2[i2] = from[i2];
          }
        }
        return to2.concat(ar2 || Array.prototype.slice.call(from));
      };
      var __importDefault2 = TextParser && TextParser.__importDefault || function(mod2) {
        return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
      };
      Object.defineProperty(TextParser, "__esModule", { value: true });
      TextParser.TextParser = void 0;
      var TexParser_js_1 = __importDefault2(requireTexParser());
      var TexError_js_1 = __importDefault2(requireTexError());
      var ParseUtil_js_1 = __importDefault2(requireParseUtil());
      var MmlNode_js_1 = requireMmlNode();
      var NodeUtil_js_1 = __importDefault2(requireNodeUtil());
      var BaseItems_js_1 = requireBaseItems();
      var TextParser$1 = (function(_super) {
        __extends2(TextParser2, _super);
        function TextParser2(text2, env, configuration, level) {
          var _this = _super.call(this, text2, env, configuration) || this;
          _this.level = level;
          return _this;
        }
        Object.defineProperty(TextParser2.prototype, "texParser", {
          get: function() {
            return this.configuration.packageData.get("textmacros").texParser;
          },
          enumerable: false,
          configurable: true
        });
        Object.defineProperty(TextParser2.prototype, "tags", {
          get: function() {
            return this.texParser.tags;
          },
          enumerable: false,
          configurable: true
        });
        TextParser2.prototype.mml = function() {
          return this.level != null ? this.create("node", "mstyle", this.nodes, { displaystyle: false, scriptlevel: this.level }) : this.nodes.length === 1 ? this.nodes[0] : this.create("node", "mrow", this.nodes);
        };
        TextParser2.prototype.Parse = function() {
          this.text = "";
          this.nodes = [];
          this.envStack = [];
          _super.prototype.Parse.call(this);
        };
        TextParser2.prototype.saveText = function() {
          if (this.text) {
            var mathvariant = this.stack.env.mathvariant;
            var text2 = ParseUtil_js_1.default.internalText(this, this.text, mathvariant ? { mathvariant } : {});
            this.text = "";
            this.Push(text2);
          }
        };
        TextParser2.prototype.Push = function(mml) {
          if (this.text) {
            this.saveText();
          }
          if (mml instanceof BaseItems_js_1.StopItem) {
            return _super.prototype.Push.call(this, mml);
          }
          if (mml instanceof BaseItems_js_1.StyleItem) {
            this.stack.env.mathcolor = this.stack.env.color;
            return;
          }
          if (mml instanceof MmlNode_js_1.AbstractMmlNode) {
            this.addAttributes(mml);
            this.nodes.push(mml);
          }
        };
        TextParser2.prototype.PushMath = function(mml) {
          var e_1, _a2;
          var env = this.stack.env;
          if (!mml.isKind("TeXAtom")) {
            mml = this.create("node", "TeXAtom", [mml]);
          }
          try {
            for (var _b2 = __values2(["mathsize", "mathcolor"]), _c = _b2.next(); !_c.done; _c = _b2.next()) {
              var name_1 = _c.value;
              if (env[name_1] && !mml.attributes.getExplicit(name_1)) {
                if (!mml.isToken && !mml.isKind("mstyle")) {
                  mml = this.create("node", "mstyle", [mml]);
                }
                NodeUtil_js_1.default.setAttribute(mml, name_1, env[name_1]);
              }
            }
          } catch (e_1_1) {
            e_1 = { error: e_1_1 };
          } finally {
            try {
              if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
            } finally {
              if (e_1) throw e_1.error;
            }
          }
          if (mml.isInferred) {
            mml = this.create("node", "mrow", mml.childNodes);
          }
          this.nodes.push(mml);
        };
        TextParser2.prototype.addAttributes = function(mml) {
          var e_2, _a2;
          var env = this.stack.env;
          if (!mml.isToken)
            return;
          try {
            for (var _b2 = __values2(["mathsize", "mathcolor", "mathvariant"]), _c = _b2.next(); !_c.done; _c = _b2.next()) {
              var name_2 = _c.value;
              if (env[name_2] && !mml.attributes.getExplicit(name_2)) {
                NodeUtil_js_1.default.setAttribute(mml, name_2, env[name_2]);
              }
            }
          } catch (e_2_1) {
            e_2 = { error: e_2_1 };
          } finally {
            try {
              if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
            } finally {
              if (e_2) throw e_2.error;
            }
          }
        };
        TextParser2.prototype.ParseTextArg = function(name2, env) {
          var text2 = this.GetArgument(name2);
          env = Object.assign(Object.assign({}, this.stack.env), env);
          return new TextParser2(text2, env, this.configuration).mml();
        };
        TextParser2.prototype.ParseArg = function(name2) {
          return new TextParser2(this.GetArgument(name2), this.stack.env, this.configuration).mml();
        };
        TextParser2.prototype.Error = function(id, message2) {
          var args2 = [];
          for (var _i = 2; _i < arguments.length; _i++) {
            args2[_i - 2] = arguments[_i];
          }
          throw new (TexError_js_1.default.bind.apply(TexError_js_1.default, __spreadArray2([void 0, id, message2], __read2(args2), false)))();
        };
        return TextParser2;
      })(TexParser_js_1.default);
      TextParser.TextParser = TextParser$1;
      return TextParser;
    }
    var hasRequiredTextcompMappings;
    function requireTextcompMappings() {
      if (hasRequiredTextcompMappings) return TextcompMappings;
      hasRequiredTextcompMappings = 1;
      var __importDefault2 = TextcompMappings && TextcompMappings.__importDefault || function(mod2) {
        return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
      };
      Object.defineProperty(TextcompMappings, "__esModule", { value: true });
      var SymbolMap_js_1 = requireSymbolMap();
      var TexConstants_js_1 = requireTexConstants();
      var TextMacrosMethods_js_1 = requireTextMacrosMethods();
      var ParseUtil_js_1 = __importDefault2(requireParseUtil());
      var TextParser_js_1 = requireTextParser();
      new SymbolMap_js_1.CommandMap("textcomp-macros", {
        "textasciicircum": ["Insert", "^"],
        "textasciitilde": ["Insert", "~"],
        "textasteriskcentered": ["Insert", "*"],
        "textbackslash": ["Insert", "\\"],
        "textbar": ["Insert", "|"],
        "textbraceleft": ["Insert", "{"],
        "textbraceright": ["Insert", "}"],
        "textbullet": ["Insert", "•"],
        "textdagger": ["Insert", "†"],
        "textdaggerdbl": ["Insert", "‡"],
        "textellipsis": ["Insert", "…"],
        "textemdash": ["Insert", "—"],
        "textendash": ["Insert", "–"],
        "textexclamdown": ["Insert", "¡"],
        "textgreater": ["Insert", ">"],
        "textless": ["Insert", "<"],
        "textordfeminine": ["Insert", "ª"],
        "textordmasculine": ["Insert", "º"],
        "textparagraph": ["Insert", "¶"],
        "textperiodcentered": ["Insert", "·"],
        "textquestiondown": ["Insert", "¿"],
        "textquotedblleft": ["Insert", "“"],
        "textquotedblright": ["Insert", "”"],
        "textquoteleft": ["Insert", "‘"],
        "textquoteright": ["Insert", "’"],
        "textsection": ["Insert", "§"],
        "textunderscore": ["Insert", "_"],
        "textvisiblespace": ["Insert", "␣"],
        "textacutedbl": ["Insert", "˝"],
        "textasciiacute": ["Insert", "´"],
        "textasciibreve": ["Insert", "˘"],
        "textasciicaron": ["Insert", "ˇ"],
        "textasciidieresis": ["Insert", "¨"],
        "textasciimacron": ["Insert", "¯"],
        "textgravedbl": ["Insert", "˵"],
        "texttildelow": ["Insert", "˷"],
        "textbaht": ["Insert", "฿"],
        "textcent": ["Insert", "¢"],
        "textcolonmonetary": ["Insert", "₡"],
        "textcurrency": ["Insert", "¤"],
        "textdollar": ["Insert", "$"],
        "textdong": ["Insert", "₫"],
        "texteuro": ["Insert", "€"],
        "textflorin": ["Insert", "ƒ"],
        "textguarani": ["Insert", "₲"],
        "textlira": ["Insert", "₤"],
        "textnaira": ["Insert", "₦"],
        "textpeso": ["Insert", "₱"],
        "textsterling": ["Insert", "£"],
        "textwon": ["Insert", "₩"],
        "textyen": ["Insert", "¥"],
        "textcircledP": ["Insert", "℗"],
        "textcompwordmark": ["Insert", "‌"],
        "textcopyleft": ["Insert", "🄯"],
        "textcopyright": ["Insert", "©"],
        "textregistered": ["Insert", "®"],
        "textservicemark": ["Insert", "℠"],
        "texttrademark": ["Insert", "™"],
        "textbardbl": ["Insert", "‖"],
        "textbigcircle": ["Insert", "◯"],
        "textblank": ["Insert", "␢"],
        "textbrokenbar": ["Insert", "¦"],
        "textdiscount": ["Insert", "⁒"],
        "textestimated": ["Insert", "℮"],
        "textinterrobang": ["Insert", "‽"],
        "textinterrobangdown": ["Insert", "⸘"],
        "textmusicalnote": ["Insert", "♪"],
        "textnumero": ["Insert", "№"],
        "textopenbullet": ["Insert", "◦"],
        "textpertenthousand": ["Insert", "‱"],
        "textperthousand": ["Insert", "‰"],
        "textrecipe": ["Insert", "℞"],
        "textreferencemark": ["Insert", "※"],
        "textlangle": ["Insert", "〈"],
        "textrangle": ["Insert", "〉"],
        "textlbrackdbl": ["Insert", "⟦"],
        "textrbrackdbl": ["Insert", "⟧"],
        "textlquill": ["Insert", "⁅"],
        "textrquill": ["Insert", "⁆"],
        "textcelsius": ["Insert", "℃"],
        "textdegree": ["Insert", "°"],
        "textdiv": ["Insert", "÷"],
        "textdownarrow": ["Insert", "↓"],
        "textfractionsolidus": ["Insert", "⁄"],
        "textleftarrow": ["Insert", "←"],
        "textlnot": ["Insert", "¬"],
        "textmho": ["Insert", "℧"],
        "textminus": ["Insert", "−"],
        "textmu": ["Insert", "µ"],
        "textohm": ["Insert", "Ω"],
        "textonehalf": ["Insert", "½"],
        "textonequarter": ["Insert", "¼"],
        "textonesuperior": ["Insert", "¹"],
        "textpm": ["Insert", "±"],
        "textrightarrow": ["Insert", "→"],
        "textsurd": ["Insert", "√"],
        "textthreequarters": ["Insert", "¾"],
        "textthreesuperior": ["Insert", "³"],
        "texttimes": ["Insert", "×"],
        "texttwosuperior": ["Insert", "²"],
        "textuparrow": ["Insert", "↑"],
        "textborn": ["Insert", "*"],
        "textdied": ["Insert", "†"],
        "textdivorced": ["Insert", "⚮"],
        "textmarried": ["Insert", "⚭"],
        "textcentoldstyle": ["Insert", "¢", TexConstants_js_1.TexConstant.Variant.OLDSTYLE],
        "textdollaroldstyle": ["Insert", "$", TexConstants_js_1.TexConstant.Variant.OLDSTYLE],
        "textzerooldstyle": ["Insert", "0", TexConstants_js_1.TexConstant.Variant.OLDSTYLE],
        "textoneoldstyle": ["Insert", "1", TexConstants_js_1.TexConstant.Variant.OLDSTYLE],
        "texttwooldstyle": ["Insert", "2", TexConstants_js_1.TexConstant.Variant.OLDSTYLE],
        "textthreeoldstyle": ["Insert", "3", TexConstants_js_1.TexConstant.Variant.OLDSTYLE],
        "textfouroldstyle": ["Insert", "4", TexConstants_js_1.TexConstant.Variant.OLDSTYLE],
        "textfiveoldstyle": ["Insert", "5", TexConstants_js_1.TexConstant.Variant.OLDSTYLE],
        "textsixoldstyle": ["Insert", "6", TexConstants_js_1.TexConstant.Variant.OLDSTYLE],
        "textsevenoldstyle": ["Insert", "7", TexConstants_js_1.TexConstant.Variant.OLDSTYLE],
        "texteightoldstyle": ["Insert", "8", TexConstants_js_1.TexConstant.Variant.OLDSTYLE],
        "textnineoldstyle": ["Insert", "9", TexConstants_js_1.TexConstant.Variant.OLDSTYLE]
      }, {
        Insert: function(parser2, name2, c2, font) {
          if (parser2 instanceof TextParser_js_1.TextParser) {
            if (!font) {
              TextMacrosMethods_js_1.TextMacrosMethods.Insert(parser2, name2, c2);
              return;
            }
            parser2.saveText();
          }
          parser2.Push(ParseUtil_js_1.default.internalText(parser2, c2, font ? { mathvariant: font } : {}));
        }
      });
      return TextcompMappings;
    }
    var hasRequiredTextcompConfiguration;
    function requireTextcompConfiguration() {
      if (hasRequiredTextcompConfiguration) return TextcompConfiguration;
      hasRequiredTextcompConfiguration = 1;
      Object.defineProperty(TextcompConfiguration, "__esModule", { value: true });
      TextcompConfiguration.TextcompConfiguration = void 0;
      var Configuration_js_1 = requireConfiguration();
      requireTextcompMappings();
      TextcompConfiguration.TextcompConfiguration = Configuration_js_1.Configuration.create("textcomp", {
        handler: { macro: ["textcomp-macros"] }
      });
      return TextcompConfiguration;
    }
    var TextMacrosConfiguration = {};
    var TextMacrosMappings = {};
    var hasRequiredTextMacrosMappings;
    function requireTextMacrosMappings() {
      if (hasRequiredTextMacrosMappings) return TextMacrosMappings;
      hasRequiredTextMacrosMappings = 1;
      Object.defineProperty(TextMacrosMappings, "__esModule", { value: true });
      var SymbolMap_js_1 = requireSymbolMap();
      var TexConstants_js_1 = requireTexConstants();
      var TextMacrosMethods_js_1 = requireTextMacrosMethods();
      var lengths_js_1 = requireLengths();
      new SymbolMap_js_1.MacroMap("text-special", {
        "$": "Math",
        "%": "Comment",
        "^": "MathModeOnly",
        "_": "MathModeOnly",
        "&": "Misplaced",
        "#": "Misplaced",
        "~": "Tilde",
        " ": "Space",
        "	": "Space",
        "\r": "Space",
        "\n": "Space",
        " ": "Tilde",
        "{": "OpenBrace",
        "}": "CloseBrace",
        "`": "OpenQuote",
        "'": "CloseQuote"
      }, TextMacrosMethods_js_1.TextMacrosMethods);
      new SymbolMap_js_1.CommandMap("text-macros", {
        "(": "Math",
        "$": "SelfQuote",
        "_": "SelfQuote",
        "%": "SelfQuote",
        "{": "SelfQuote",
        "}": "SelfQuote",
        " ": "SelfQuote",
        "&": "SelfQuote",
        "#": "SelfQuote",
        "\\": "SelfQuote",
        "'": ["Accent", "´"],
        "’": ["Accent", "´"],
        "`": ["Accent", "`"],
        "‘": ["Accent", "`"],
        "^": ["Accent", "^"],
        '"': ["Accent", "¨"],
        "~": ["Accent", "~"],
        "=": ["Accent", "¯"],
        ".": ["Accent", "˙"],
        "u": ["Accent", "˘"],
        "v": ["Accent", "ˇ"],
        emph: "Emph",
        rm: ["SetFont", TexConstants_js_1.TexConstant.Variant.NORMAL],
        mit: ["SetFont", TexConstants_js_1.TexConstant.Variant.ITALIC],
        oldstyle: ["SetFont", TexConstants_js_1.TexConstant.Variant.OLDSTYLE],
        cal: ["SetFont", TexConstants_js_1.TexConstant.Variant.CALLIGRAPHIC],
        it: ["SetFont", "-tex-mathit"],
        bf: ["SetFont", TexConstants_js_1.TexConstant.Variant.BOLD],
        bbFont: ["SetFont", TexConstants_js_1.TexConstant.Variant.DOUBLESTRUCK],
        scr: ["SetFont", TexConstants_js_1.TexConstant.Variant.SCRIPT],
        frak: ["SetFont", TexConstants_js_1.TexConstant.Variant.FRAKTUR],
        sf: ["SetFont", TexConstants_js_1.TexConstant.Variant.SANSSERIF],
        tt: ["SetFont", TexConstants_js_1.TexConstant.Variant.MONOSPACE],
        tiny: ["SetSize", 0.5],
        Tiny: ["SetSize", 0.6],
        scriptsize: ["SetSize", 0.7],
        small: ["SetSize", 0.85],
        normalsize: ["SetSize", 1],
        large: ["SetSize", 1.2],
        Large: ["SetSize", 1.44],
        LARGE: ["SetSize", 1.73],
        huge: ["SetSize", 2.07],
        Huge: ["SetSize", 2.49],
        Bbb: ["Macro", "{\\bbFont #1}", 1],
        textnormal: ["Macro", "{\\rm #1}", 1],
        textup: ["Macro", "{\\rm #1}", 1],
        textrm: ["Macro", "{\\rm #1}", 1],
        textit: ["Macro", "{\\it #1}", 1],
        textbf: ["Macro", "{\\bf #1}", 1],
        textsf: ["Macro", "{\\sf #1}", 1],
        texttt: ["Macro", "{\\tt #1}", 1],
        dagger: ["Insert", "†"],
        ddagger: ["Insert", "‡"],
        S: ["Insert", "§"],
        ",": ["Spacer", lengths_js_1.MATHSPACE.thinmathspace],
        ":": ["Spacer", lengths_js_1.MATHSPACE.mediummathspace],
        ">": ["Spacer", lengths_js_1.MATHSPACE.mediummathspace],
        ";": ["Spacer", lengths_js_1.MATHSPACE.thickmathspace],
        "!": ["Spacer", lengths_js_1.MATHSPACE.negativethinmathspace],
        enspace: ["Spacer", 0.5],
        quad: ["Spacer", 1],
        qquad: ["Spacer", 2],
        thinspace: ["Spacer", lengths_js_1.MATHSPACE.thinmathspace],
        negthinspace: ["Spacer", lengths_js_1.MATHSPACE.negativethinmathspace],
        hskip: "Hskip",
        hspace: "Hskip",
        kern: "Hskip",
        mskip: "Hskip",
        mspace: "Hskip",
        mkern: "Hskip",
        rule: "rule",
        Rule: ["Rule"],
        Space: ["Rule", "blank"],
        color: "CheckAutoload",
        textcolor: "CheckAutoload",
        colorbox: "CheckAutoload",
        fcolorbox: "CheckAutoload",
        href: "CheckAutoload",
        style: "CheckAutoload",
        class: "CheckAutoload",
        cssId: "CheckAutoload",
        unicode: "CheckAutoload",
        ref: ["HandleRef", false],
        eqref: ["HandleRef", true]
      }, TextMacrosMethods_js_1.TextMacrosMethods);
      return TextMacrosMappings;
    }
    var hasRequiredTextMacrosConfiguration;
    function requireTextMacrosConfiguration() {
      if (hasRequiredTextMacrosConfiguration) return TextMacrosConfiguration;
      hasRequiredTextMacrosConfiguration = 1;
      var __importDefault2 = TextMacrosConfiguration && TextMacrosConfiguration.__importDefault || function(mod2) {
        return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
      };
      var _a2;
      Object.defineProperty(TextMacrosConfiguration, "__esModule", { value: true });
      TextMacrosConfiguration.TextMacrosConfiguration = TextMacrosConfiguration.TextBaseConfiguration = void 0;
      var Configuration_js_1 = requireConfiguration();
      var ParseOptions_js_1 = __importDefault2(requireParseOptions());
      var Tags_js_1 = requireTags();
      var BaseItems_js_1 = requireBaseItems();
      var TextParser_js_1 = requireTextParser();
      var TextMacrosMethods_js_1 = requireTextMacrosMethods();
      requireTextMacrosMappings();
      TextMacrosConfiguration.TextBaseConfiguration = Configuration_js_1.Configuration.create("text-base", {
        parser: "text",
        handler: {
          character: ["command", "text-special"],
          macro: ["text-macros"]
        },
        fallback: {
          character: function(parser2, c2) {
            parser2.text += c2;
          },
          macro: function(parser2, name2) {
            var texParser = parser2.texParser;
            var macro = texParser.lookup("macro", name2);
            if (macro && macro._func !== TextMacrosMethods_js_1.TextMacrosMethods.Macro) {
              parser2.Error("MathMacro", "%1 is only supported in math mode", "\\" + name2);
            }
            texParser.parse("macro", [parser2, name2]);
          }
        },
        items: (_a2 = {}, _a2[BaseItems_js_1.StartItem.prototype.kind] = BaseItems_js_1.StartItem, _a2[BaseItems_js_1.StopItem.prototype.kind] = BaseItems_js_1.StopItem, _a2[BaseItems_js_1.MmlItem.prototype.kind] = BaseItems_js_1.MmlItem, _a2[BaseItems_js_1.StyleItem.prototype.kind] = BaseItems_js_1.StyleItem, _a2)
      });
      function internalMath(parser2, text2, level, mathvariant) {
        var config2 = parser2.configuration.packageData.get("textmacros");
        if (!(parser2 instanceof TextParser_js_1.TextParser)) {
          config2.texParser = parser2;
        }
        return [new TextParser_js_1.TextParser(text2, mathvariant ? { mathvariant } : {}, config2.parseOptions, level).mml()];
      }
      TextMacrosConfiguration.TextMacrosConfiguration = Configuration_js_1.Configuration.create("textmacros", {
        config: function(_config, jax) {
          var textConf = new Configuration_js_1.ParserConfiguration(jax.parseOptions.options.textmacros.packages, ["tex", "text"]);
          textConf.init();
          var parseOptions = new ParseOptions_js_1.default(textConf, []);
          parseOptions.options = jax.parseOptions.options;
          textConf.config(jax);
          Tags_js_1.TagsFactory.addTags(textConf.tags);
          parseOptions.tags = Tags_js_1.TagsFactory.getDefault();
          parseOptions.tags.configuration = parseOptions;
          parseOptions.packageData = jax.parseOptions.packageData;
          parseOptions.packageData.set("textmacros", { parseOptions, jax, texParser: null });
          parseOptions.options.internalMath = internalMath;
        },
        preprocessors: [function(data) {
          var config2 = data.data.packageData.get("textmacros");
          config2.parseOptions.nodeFactory.setMmlFactory(config2.jax.mmlFactory);
        }],
        options: {
          textmacros: {
            packages: ["text-base"]
          }
        }
      });
      return TextMacrosConfiguration;
    }
    var UpgreekConfiguration = {};
    var hasRequiredUpgreekConfiguration;
    function requireUpgreekConfiguration() {
      if (hasRequiredUpgreekConfiguration) return UpgreekConfiguration;
      hasRequiredUpgreekConfiguration = 1;
      Object.defineProperty(UpgreekConfiguration, "__esModule", { value: true });
      UpgreekConfiguration.UpgreekConfiguration = void 0;
      var Configuration_js_1 = requireConfiguration();
      var SymbolMap_js_1 = requireSymbolMap();
      var TexConstants_js_1 = requireTexConstants();
      function mathchar0miNormal(parser2, mchar) {
        var def = mchar.attributes || {};
        def.mathvariant = TexConstants_js_1.TexConstant.Variant.NORMAL;
        var node2 = parser2.create("token", "mi", def, mchar.char);
        parser2.Push(node2);
      }
      new SymbolMap_js_1.CharacterMap("upgreek", mathchar0miNormal, {
        upalpha: "α",
        upbeta: "β",
        upgamma: "γ",
        updelta: "δ",
        upepsilon: "ϵ",
        upzeta: "ζ",
        upeta: "η",
        uptheta: "θ",
        upiota: "ι",
        upkappa: "κ",
        uplambda: "λ",
        upmu: "μ",
        upnu: "ν",
        upxi: "ξ",
        upomicron: "ο",
        uppi: "π",
        uprho: "ρ",
        upsigma: "σ",
        uptau: "τ",
        upupsilon: "υ",
        upphi: "ϕ",
        upchi: "χ",
        uppsi: "ψ",
        upomega: "ω",
        upvarepsilon: "ε",
        upvartheta: "ϑ",
        upvarpi: "ϖ",
        upvarrho: "ϱ",
        upvarsigma: "ς",
        upvarphi: "φ",
        Upgamma: "Γ",
        Updelta: "Δ",
        Uptheta: "Θ",
        Uplambda: "Λ",
        Upxi: "Ξ",
        Uppi: "Π",
        Upsigma: "Σ",
        Upupsilon: "Υ",
        Upphi: "Φ",
        Uppsi: "Ψ",
        Upomega: "Ω"
      });
      UpgreekConfiguration.UpgreekConfiguration = Configuration_js_1.Configuration.create("upgreek", {
        handler: { macro: ["upgreek"] }
      });
      return UpgreekConfiguration;
    }
    var UnicodeConfiguration = {};
    var hasRequiredUnicodeConfiguration;
    function requireUnicodeConfiguration() {
      if (hasRequiredUnicodeConfiguration) return UnicodeConfiguration;
      hasRequiredUnicodeConfiguration = 1;
      (function(exports2) {
        var __importDefault2 = UnicodeConfiguration && UnicodeConfiguration.__importDefault || function(mod2) {
          return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
        };
        Object.defineProperty(exports2, "__esModule", { value: true });
        exports2.UnicodeConfiguration = exports2.UnicodeMethods = void 0;
        var Configuration_js_1 = requireConfiguration();
        var TexError_js_1 = __importDefault2(requireTexError());
        var SymbolMap_js_1 = requireSymbolMap();
        var ParseUtil_js_1 = __importDefault2(requireParseUtil());
        var NodeUtil_js_1 = __importDefault2(requireNodeUtil());
        var Entities_js_1 = requireEntities();
        exports2.UnicodeMethods = {};
        var UnicodeCache = {};
        exports2.UnicodeMethods.Unicode = function(parser2, name2) {
          var HD = parser2.GetBrackets(name2);
          var HDsplit = null;
          var font = null;
          if (HD) {
            if (HD.replace(/ /g, "").match(/^(\d+(\.\d*)?|\.\d+),(\d+(\.\d*)?|\.\d+)$/)) {
              HDsplit = HD.replace(/ /g, "").split(/,/);
              font = parser2.GetBrackets(name2);
            } else {
              font = HD;
            }
          }
          var n = ParseUtil_js_1.default.trimSpaces(parser2.GetArgument(name2)).replace(/^0x/, "x");
          if (!n.match(/^(x[0-9A-Fa-f]+|[0-9]+)$/)) {
            throw new TexError_js_1.default("BadUnicode", "Argument to \\unicode must be a number");
          }
          var N = parseInt(n.match(/^x/) ? "0" + n : n);
          if (!UnicodeCache[N]) {
            UnicodeCache[N] = [800, 200, font, N];
          } else if (!font) {
            font = UnicodeCache[N][2];
          }
          if (HDsplit) {
            UnicodeCache[N][0] = Math.floor(parseFloat(HDsplit[0]) * 1e3);
            UnicodeCache[N][1] = Math.floor(parseFloat(HDsplit[1]) * 1e3);
          }
          var variant = parser2.stack.env.font;
          var def = {};
          if (font) {
            UnicodeCache[N][2] = def.fontfamily = font.replace(/'/g, "'");
            if (variant) {
              if (variant.match(/bold/)) {
                def.fontweight = "bold";
              }
              if (variant.match(/italic|-mathit/)) {
                def.fontstyle = "italic";
              }
            }
          } else if (variant) {
            def.mathvariant = variant;
          }
          var node2 = parser2.create("token", "mtext", def, (0, Entities_js_1.numeric)(n));
          NodeUtil_js_1.default.setProperty(node2, "unicode", true);
          parser2.Push(node2);
        };
        new SymbolMap_js_1.CommandMap("unicode", { unicode: "Unicode" }, exports2.UnicodeMethods);
        exports2.UnicodeConfiguration = Configuration_js_1.Configuration.create("unicode", { handler: { macro: ["unicode"] } });
      })(UnicodeConfiguration);
      return UnicodeConfiguration;
    }
    var VerbConfiguration = {};
    var hasRequiredVerbConfiguration;
    function requireVerbConfiguration() {
      if (hasRequiredVerbConfiguration) return VerbConfiguration;
      hasRequiredVerbConfiguration = 1;
      (function(exports2) {
        var __importDefault2 = VerbConfiguration && VerbConfiguration.__importDefault || function(mod2) {
          return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
        };
        Object.defineProperty(exports2, "__esModule", { value: true });
        exports2.VerbConfiguration = exports2.VerbMethods = void 0;
        var Configuration_js_1 = requireConfiguration();
        var TexConstants_js_1 = requireTexConstants();
        var SymbolMap_js_1 = requireSymbolMap();
        var TexError_js_1 = __importDefault2(requireTexError());
        exports2.VerbMethods = {};
        exports2.VerbMethods.Verb = function(parser2, name2) {
          var c2 = parser2.GetNext();
          var start2 = ++parser2.i;
          if (c2 === "") {
            throw new TexError_js_1.default("MissingArgFor", "Missing argument for %1", name2);
          }
          while (parser2.i < parser2.string.length && parser2.string.charAt(parser2.i) !== c2) {
            parser2.i++;
          }
          if (parser2.i === parser2.string.length) {
            throw new TexError_js_1.default("NoClosingDelim", "Can't find closing delimiter for %1", parser2.currentCS);
          }
          var text2 = parser2.string.slice(start2, parser2.i).replace(/ /g, " ");
          parser2.i++;
          parser2.Push(parser2.create("token", "mtext", { mathvariant: TexConstants_js_1.TexConstant.Variant.MONOSPACE }, text2));
        };
        new SymbolMap_js_1.CommandMap("verb", { verb: "Verb" }, exports2.VerbMethods);
        exports2.VerbConfiguration = Configuration_js_1.Configuration.create("verb", { handler: { macro: ["verb"] } });
      })(VerbConfiguration);
      return VerbConfiguration;
    }
    var hasRequiredAllPackages;
    function requireAllPackages() {
      if (hasRequiredAllPackages) return AllPackages;
      hasRequiredAllPackages = 1;
      Object.defineProperty(AllPackages, "__esModule", { value: true });
      AllPackages.AllPackages = void 0;
      requireBaseConfiguration();
      requireActionConfiguration();
      requireAmsConfiguration();
      requireAmsCdConfiguration();
      requireBboxConfiguration();
      requireBoldsymbolConfiguration();
      requireBraketConfiguration();
      requireBussproofsConfiguration();
      requireCancelConfiguration();
      requireCasesConfiguration();
      requireCenternotConfiguration();
      requireColorConfiguration();
      requireColorV2Configuration();
      requireColortblConfiguration();
      requireConfigMacrosConfiguration();
      requireEmpheqConfiguration();
      requireEncloseConfiguration();
      requireExtpfeilConfiguration();
      requireGensymbConfiguration();
      requireHtmlConfiguration();
      requireMathtoolsConfiguration();
      requireMhchemConfiguration();
      requireNewcommandConfiguration();
      requireNoErrorsConfiguration();
      requireNoUndefinedConfiguration();
      requirePhysicsConfiguration();
      requireSetOptionsConfiguration();
      requireTagFormatConfiguration();
      requireTextcompConfiguration();
      requireTextMacrosConfiguration();
      requireUpgreekConfiguration();
      requireUnicodeConfiguration();
      requireVerbConfiguration();
      if (typeof MathJax !== "undefined" && MathJax.loader) {
        MathJax.loader.preLoad("[tex]/action", "[tex]/ams", "[tex]/amscd", "[tex]/bbox", "[tex]/boldsymbol", "[tex]/braket", "[tex]/bussproofs", "[tex]/cancel", "[tex]/cases", "[tex]/centernot", "[tex]/color", "[tex]/colorv2", "[tex]/colortbl", "[tex]/empheq", "[tex]/enclose", "[tex]/extpfeil", "[tex]/gensymb", "[tex]/html", "[tex]/mathtools", "[tex]/mhchem", "[tex]/newcommand", "[tex]/noerrors", "[tex]/noundefined", "[tex]/physics", "[tex]/upgreek", "[tex]/unicode", "[tex]/verb", "[tex]/configmacros", "[tex]/tagformat", "[tex]/textcomp", "[tex]/textmacros", "[tex]/setoptions");
      }
      AllPackages.AllPackages = [
        "base",
        "action",
        "ams",
        "amscd",
        "bbox",
        "boldsymbol",
        "braket",
        "bussproofs",
        "cancel",
        "cases",
        "centernot",
        "color",
        "colortbl",
        "empheq",
        "enclose",
        "extpfeil",
        "gensymb",
        "html",
        "mathtools",
        "mhchem",
        "newcommand",
        "noerrors",
        "noundefined",
        "upgreek",
        "unicode",
        "verb",
        "configmacros",
        "tagformat",
        "textcomp",
        "textmacros"
      ];
      return AllPackages;
    }
    var assistiveMml = {};
    var SerializedMmlVisitor = {};
    var MmlVisitor = {};
    var Visitor = {};
    var hasRequiredVisitor;
    function requireVisitor() {
      if (hasRequiredVisitor) return Visitor;
      hasRequiredVisitor = 1;
      var __values2 = Visitor && Visitor.__values || function(o) {
        var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i2 = 0;
        if (m) return m.call(o);
        if (o && typeof o.length === "number") return {
          next: function() {
            if (o && i2 >= o.length) o = void 0;
            return { value: o && o[i2++], done: !o };
          }
        };
        throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
      };
      var __read2 = Visitor && Visitor.__read || function(o, n) {
        var m = typeof Symbol === "function" && o[Symbol.iterator];
        if (!m) return o;
        var i2 = m.call(o), r2, ar2 = [], e;
        try {
          while ((n === void 0 || n-- > 0) && !(r2 = i2.next()).done) ar2.push(r2.value);
        } catch (error2) {
          e = { error: error2 };
        } finally {
          try {
            if (r2 && !r2.done && (m = i2["return"])) m.call(i2);
          } finally {
            if (e) throw e.error;
          }
        }
        return ar2;
      };
      var __spreadArray2 = Visitor && Visitor.__spreadArray || function(to2, from, pack) {
        if (pack || arguments.length === 2) for (var i2 = 0, l = from.length, ar2; i2 < l; i2++) {
          if (ar2 || !(i2 in from)) {
            if (!ar2) ar2 = Array.prototype.slice.call(from, 0, i2);
            ar2[i2] = from[i2];
          }
        }
        return to2.concat(ar2 || Array.prototype.slice.call(from));
      };
      Object.defineProperty(Visitor, "__esModule", { value: true });
      Visitor.AbstractVisitor = void 0;
      var Node_js_1 = requireNode$1();
      var AbstractVisitor = (function() {
        function AbstractVisitor2(factory) {
          var e_1, _a2;
          this.nodeHandlers = /* @__PURE__ */ new Map();
          try {
            for (var _b2 = __values2(factory.getKinds()), _c = _b2.next(); !_c.done; _c = _b2.next()) {
              var kind = _c.value;
              var method = this[AbstractVisitor2.methodName(kind)];
              if (method) {
                this.nodeHandlers.set(kind, method);
              }
            }
          } catch (e_1_1) {
            e_1 = { error: e_1_1 };
          } finally {
            try {
              if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
            } finally {
              if (e_1) throw e_1.error;
            }
          }
        }
        AbstractVisitor2.methodName = function(kind) {
          return "visit" + (kind.charAt(0).toUpperCase() + kind.substr(1)).replace(/[^a-z0-9_]/ig, "_") + "Node";
        };
        AbstractVisitor2.prototype.visitTree = function(tree) {
          var args2 = [];
          for (var _i = 1; _i < arguments.length; _i++) {
            args2[_i - 1] = arguments[_i];
          }
          return this.visitNode.apply(this, __spreadArray2([tree], __read2(args2), false));
        };
        AbstractVisitor2.prototype.visitNode = function(node2) {
          var args2 = [];
          for (var _i = 1; _i < arguments.length; _i++) {
            args2[_i - 1] = arguments[_i];
          }
          var handler = this.nodeHandlers.get(node2.kind) || this.visitDefault;
          return handler.call.apply(handler, __spreadArray2([this, node2], __read2(args2), false));
        };
        AbstractVisitor2.prototype.visitDefault = function(node2) {
          var e_2, _a2;
          var args2 = [];
          for (var _i = 1; _i < arguments.length; _i++) {
            args2[_i - 1] = arguments[_i];
          }
          if (node2 instanceof Node_js_1.AbstractNode) {
            try {
              for (var _b2 = __values2(node2.childNodes), _c = _b2.next(); !_c.done; _c = _b2.next()) {
                var child = _c.value;
                this.visitNode.apply(this, __spreadArray2([child], __read2(args2), false));
              }
            } catch (e_2_1) {
              e_2 = { error: e_2_1 };
            } finally {
              try {
                if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
              } finally {
                if (e_2) throw e_2.error;
              }
            }
          }
        };
        AbstractVisitor2.prototype.setNodeHandler = function(kind, handler) {
          this.nodeHandlers.set(kind, handler);
        };
        AbstractVisitor2.prototype.removeNodeHandler = function(kind) {
          this.nodeHandlers.delete(kind);
        };
        return AbstractVisitor2;
      })();
      Visitor.AbstractVisitor = AbstractVisitor;
      return Visitor;
    }
    var hasRequiredMmlVisitor;
    function requireMmlVisitor() {
      if (hasRequiredMmlVisitor) return MmlVisitor;
      hasRequiredMmlVisitor = 1;
      var __extends2 = MmlVisitor && MmlVisitor.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      Object.defineProperty(MmlVisitor, "__esModule", { value: true });
      MmlVisitor.MmlVisitor = void 0;
      var MmlFactory_js_1 = requireMmlFactory();
      var Visitor_js_1 = requireVisitor();
      var MmlVisitor$1 = (function(_super) {
        __extends2(MmlVisitor2, _super);
        function MmlVisitor2(factory) {
          if (factory === void 0) {
            factory = null;
          }
          if (!factory) {
            factory = new MmlFactory_js_1.MmlFactory();
          }
          return _super.call(this, factory) || this;
        }
        MmlVisitor2.prototype.visitTextNode = function(_node) {
        };
        MmlVisitor2.prototype.visitXMLNode = function(_node) {
        };
        return MmlVisitor2;
      })(Visitor_js_1.AbstractVisitor);
      MmlVisitor.MmlVisitor = MmlVisitor$1;
      return MmlVisitor;
    }
    var hasRequiredSerializedMmlVisitor;
    function requireSerializedMmlVisitor() {
      if (hasRequiredSerializedMmlVisitor) return SerializedMmlVisitor;
      hasRequiredSerializedMmlVisitor = 1;
      (function(exports2) {
        var __extends2 = SerializedMmlVisitor && SerializedMmlVisitor.__extends || /* @__PURE__ */ (function() {
          var extendStatics2 = function(d, b) {
            extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
              d2.__proto__ = b2;
            } || function(d2, b2) {
              for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
            };
            return extendStatics2(d, b);
          };
          return function(d, b) {
            if (typeof b !== "function" && b !== null)
              throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
            extendStatics2(d, b);
            function __() {
              this.constructor = d;
            }
            d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
          };
        })();
        var __values2 = SerializedMmlVisitor && SerializedMmlVisitor.__values || function(o) {
          var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i2 = 0;
          if (m) return m.call(o);
          if (o && typeof o.length === "number") return {
            next: function() {
              if (o && i2 >= o.length) o = void 0;
              return { value: o && o[i2++], done: !o };
            }
          };
          throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
        };
        var __read2 = SerializedMmlVisitor && SerializedMmlVisitor.__read || function(o, n) {
          var m = typeof Symbol === "function" && o[Symbol.iterator];
          if (!m) return o;
          var i2 = m.call(o), r2, ar2 = [], e;
          try {
            while ((n === void 0 || n-- > 0) && !(r2 = i2.next()).done) ar2.push(r2.value);
          } catch (error2) {
            e = { error: error2 };
          } finally {
            try {
              if (r2 && !r2.done && (m = i2["return"])) m.call(i2);
            } finally {
              if (e) throw e.error;
            }
          }
          return ar2;
        };
        Object.defineProperty(exports2, "__esModule", { value: true });
        exports2.SerializedMmlVisitor = exports2.toEntity = exports2.DATAMJX = void 0;
        var MmlVisitor_js_1 = requireMmlVisitor();
        var MmlNode_js_1 = requireMmlNode();
        var mi_js_1 = requireMi$1();
        exports2.DATAMJX = "data-mjx-";
        var toEntity = function(c2) {
          return "&#x" + c2.codePointAt(0).toString(16).toUpperCase() + ";";
        };
        exports2.toEntity = toEntity;
        var SerializedMmlVisitor$1 = (function(_super) {
          __extends2(SerializedMmlVisitor2, _super);
          function SerializedMmlVisitor2() {
            return _super !== null && _super.apply(this, arguments) || this;
          }
          SerializedMmlVisitor2.prototype.visitTree = function(node2) {
            return this.visitNode(node2, "");
          };
          SerializedMmlVisitor2.prototype.visitTextNode = function(node2, _space) {
            return this.quoteHTML(node2.getText());
          };
          SerializedMmlVisitor2.prototype.visitXMLNode = function(node2, space) {
            return space + node2.getSerializedXML();
          };
          SerializedMmlVisitor2.prototype.visitInferredMrowNode = function(node2, space) {
            var e_1, _a2;
            var mml = [];
            try {
              for (var _b2 = __values2(node2.childNodes), _c = _b2.next(); !_c.done; _c = _b2.next()) {
                var child = _c.value;
                mml.push(this.visitNode(child, space));
              }
            } catch (e_1_1) {
              e_1 = { error: e_1_1 };
            } finally {
              try {
                if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
              } finally {
                if (e_1) throw e_1.error;
              }
            }
            return mml.join("\n");
          };
          SerializedMmlVisitor2.prototype.visitTeXAtomNode = function(node2, space) {
            var children2 = this.childNodeMml(node2, space + "  ", "\n");
            var mml = space + "<mrow" + this.getAttributes(node2) + ">" + (children2.match(/\S/) ? "\n" + children2 + space : "") + "</mrow>";
            return mml;
          };
          SerializedMmlVisitor2.prototype.visitAnnotationNode = function(node2, space) {
            return space + "<annotation" + this.getAttributes(node2) + ">" + this.childNodeMml(node2, "", "") + "</annotation>";
          };
          SerializedMmlVisitor2.prototype.visitDefault = function(node2, space) {
            var kind = node2.kind;
            var _a2 = __read2(node2.isToken || node2.childNodes.length === 0 ? ["", ""] : ["\n", space], 2), nl = _a2[0], endspace = _a2[1];
            var children2 = this.childNodeMml(node2, space + "  ", nl);
            return space + "<" + kind + this.getAttributes(node2) + ">" + (children2.match(/\S/) ? nl + children2 + endspace : "") + "</" + kind + ">";
          };
          SerializedMmlVisitor2.prototype.childNodeMml = function(node2, space, nl) {
            var e_2, _a2;
            var mml = "";
            try {
              for (var _b2 = __values2(node2.childNodes), _c = _b2.next(); !_c.done; _c = _b2.next()) {
                var child = _c.value;
                mml += this.visitNode(child, space) + nl;
              }
            } catch (e_2_1) {
              e_2 = { error: e_2_1 };
            } finally {
              try {
                if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
              } finally {
                if (e_2) throw e_2.error;
              }
            }
            return mml;
          };
          SerializedMmlVisitor2.prototype.getAttributes = function(node2) {
            var e_3, _a2;
            var attr = [];
            var defaults = this.constructor.defaultAttributes[node2.kind] || {};
            var attributes2 = Object.assign({}, defaults, this.getDataAttributes(node2), node2.attributes.getAllAttributes());
            var variants = this.constructor.variants;
            if (attributes2.hasOwnProperty("mathvariant") && variants.hasOwnProperty(attributes2.mathvariant)) {
              attributes2.mathvariant = variants[attributes2.mathvariant];
            }
            try {
              for (var _b2 = __values2(Object.keys(attributes2)), _c = _b2.next(); !_c.done; _c = _b2.next()) {
                var name_1 = _c.value;
                var value2 = String(attributes2[name_1]);
                if (value2 === void 0)
                  continue;
                attr.push(name_1 + '="' + this.quoteHTML(value2) + '"');
              }
            } catch (e_3_1) {
              e_3 = { error: e_3_1 };
            } finally {
              try {
                if (_c && !_c.done && (_a2 = _b2.return)) _a2.call(_b2);
              } finally {
                if (e_3) throw e_3.error;
              }
            }
            return attr.length ? " " + attr.join(" ") : "";
          };
          SerializedMmlVisitor2.prototype.getDataAttributes = function(node2) {
            var data = {};
            var variant = node2.attributes.getExplicit("mathvariant");
            var variants = this.constructor.variants;
            variant && variants.hasOwnProperty(variant) && this.setDataAttribute(data, "variant", variant);
            node2.getProperty("variantForm") && this.setDataAttribute(data, "alternate", "1");
            node2.getProperty("pseudoscript") && this.setDataAttribute(data, "pseudoscript", "true");
            node2.getProperty("autoOP") === false && this.setDataAttribute(data, "auto-op", "false");
            var scriptalign = node2.getProperty("scriptalign");
            scriptalign && this.setDataAttribute(data, "script-align", scriptalign);
            var texclass = node2.getProperty("texClass");
            if (texclass !== void 0) {
              var setclass = true;
              if (texclass === MmlNode_js_1.TEXCLASS.OP && node2.isKind("mi")) {
                var name_2 = node2.getText();
                setclass = !(name_2.length > 1 && name_2.match(mi_js_1.MmlMi.operatorName));
              }
              setclass && this.setDataAttribute(data, "texclass", texclass < 0 ? "NONE" : MmlNode_js_1.TEXCLASSNAMES[texclass]);
            }
            node2.getProperty("scriptlevel") && node2.getProperty("useHeight") === false && this.setDataAttribute(data, "smallmatrix", "true");
            return data;
          };
          SerializedMmlVisitor2.prototype.setDataAttribute = function(data, name2, value2) {
            data[exports2.DATAMJX + name2] = value2;
          };
          SerializedMmlVisitor2.prototype.quoteHTML = function(value2) {
            return value2.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/\"/g, "&quot;").replace(/[\uD800-\uDBFF]./g, exports2.toEntity).replace(/[\u0080-\uD7FF\uE000-\uFFFF]/g, exports2.toEntity);
          };
          SerializedMmlVisitor2.variants = {
            "-tex-calligraphic": "script",
            "-tex-bold-calligraphic": "bold-script",
            "-tex-oldstyle": "normal",
            "-tex-bold-oldstyle": "bold",
            "-tex-mathit": "italic"
          };
          SerializedMmlVisitor2.defaultAttributes = {
            math: {
              xmlns: "http://www.w3.org/1998/Math/MathML"
            }
          };
          return SerializedMmlVisitor2;
        })(MmlVisitor_js_1.MmlVisitor);
        exports2.SerializedMmlVisitor = SerializedMmlVisitor$1;
      })(SerializedMmlVisitor);
      return SerializedMmlVisitor;
    }
    var hasRequiredAssistiveMml;
    function requireAssistiveMml() {
      if (hasRequiredAssistiveMml) return assistiveMml;
      hasRequiredAssistiveMml = 1;
      var __extends2 = assistiveMml && assistiveMml.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      var __assign2 = assistiveMml && assistiveMml.__assign || function() {
        __assign2 = Object.assign || function(t2) {
          for (var s, i2 = 1, n = arguments.length; i2 < n; i2++) {
            s = arguments[i2];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
              t2[p] = s[p];
          }
          return t2;
        };
        return __assign2.apply(this, arguments);
      };
      var __read2 = assistiveMml && assistiveMml.__read || function(o, n) {
        var m = typeof Symbol === "function" && o[Symbol.iterator];
        if (!m) return o;
        var i2 = m.call(o), r2, ar2 = [], e;
        try {
          while ((n === void 0 || n-- > 0) && !(r2 = i2.next()).done) ar2.push(r2.value);
        } catch (error2) {
          e = { error: error2 };
        } finally {
          try {
            if (r2 && !r2.done && (m = i2["return"])) m.call(i2);
          } finally {
            if (e) throw e.error;
          }
        }
        return ar2;
      };
      var __spreadArray2 = assistiveMml && assistiveMml.__spreadArray || function(to2, from, pack) {
        if (pack || arguments.length === 2) for (var i2 = 0, l = from.length, ar2; i2 < l; i2++) {
          if (ar2 || !(i2 in from)) {
            if (!ar2) ar2 = Array.prototype.slice.call(from, 0, i2);
            ar2[i2] = from[i2];
          }
        }
        return to2.concat(ar2 || Array.prototype.slice.call(from));
      };
      var __values2 = assistiveMml && assistiveMml.__values || function(o) {
        var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i2 = 0;
        if (m) return m.call(o);
        if (o && typeof o.length === "number") return {
          next: function() {
            if (o && i2 >= o.length) o = void 0;
            return { value: o && o[i2++], done: !o };
          }
        };
        throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
      };
      Object.defineProperty(assistiveMml, "__esModule", { value: true });
      assistiveMml.AssistiveMmlHandler = assistiveMml.AssistiveMmlMathDocumentMixin = assistiveMml.AssistiveMmlMathItemMixin = assistiveMml.LimitedMmlVisitor = void 0;
      var MathItem_js_1 = requireMathItem();
      var SerializedMmlVisitor_js_1 = requireSerializedMmlVisitor();
      var Options_js_1 = requireOptions$1();
      var LimitedMmlVisitor = (function(_super) {
        __extends2(LimitedMmlVisitor2, _super);
        function LimitedMmlVisitor2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        LimitedMmlVisitor2.prototype.getAttributes = function(node2) {
          return _super.prototype.getAttributes.call(this, node2).replace(/ ?id=".*?"/, "");
        };
        return LimitedMmlVisitor2;
      })(SerializedMmlVisitor_js_1.SerializedMmlVisitor);
      assistiveMml.LimitedMmlVisitor = LimitedMmlVisitor;
      (0, MathItem_js_1.newState)("ASSISTIVEMML", 153);
      function AssistiveMmlMathItemMixin(BaseMathItem) {
        return (function(_super) {
          __extends2(class_1, _super);
          function class_1() {
            return _super !== null && _super.apply(this, arguments) || this;
          }
          class_1.prototype.assistiveMml = function(document2, force) {
            if (force === void 0) {
              force = false;
            }
            if (this.state() >= MathItem_js_1.STATE.ASSISTIVEMML)
              return;
            if (!this.isEscaped && (document2.options.enableAssistiveMml || force)) {
              var adaptor = document2.adaptor;
              var mml = document2.toMML(this.root).replace(/\n */g, "").replace(/<!--.*?-->/g, "");
              var mmlNodes = adaptor.firstChild(adaptor.body(adaptor.parse(mml, "text/html")));
              var node2 = adaptor.node("mjx-assistive-mml", {
                unselectable: "on",
                display: this.display ? "block" : "inline"
              }, [mmlNodes]);
              adaptor.setAttribute(adaptor.firstChild(this.typesetRoot), "aria-hidden", "true");
              adaptor.setStyle(this.typesetRoot, "position", "relative");
              adaptor.append(this.typesetRoot, node2);
            }
            this.state(MathItem_js_1.STATE.ASSISTIVEMML);
          };
          return class_1;
        })(BaseMathItem);
      }
      assistiveMml.AssistiveMmlMathItemMixin = AssistiveMmlMathItemMixin;
      function AssistiveMmlMathDocumentMixin(BaseDocument) {
        var _a2;
        return _a2 = (function(_super) {
          __extends2(BaseClass, _super);
          function BaseClass() {
            var args2 = [];
            for (var _i = 0; _i < arguments.length; _i++) {
              args2[_i] = arguments[_i];
            }
            var _this = _super.apply(this, __spreadArray2([], __read2(args2), false)) || this;
            var CLASS = _this.constructor;
            var ProcessBits = CLASS.ProcessBits;
            if (!ProcessBits.has("assistive-mml")) {
              ProcessBits.allocate("assistive-mml");
            }
            _this.visitor = new LimitedMmlVisitor(_this.mmlFactory);
            _this.options.MathItem = AssistiveMmlMathItemMixin(_this.options.MathItem);
            if ("addStyles" in _this) {
              _this.addStyles(CLASS.assistiveStyles);
            }
            return _this;
          }
          BaseClass.prototype.toMML = function(node2) {
            return this.visitor.visitTree(node2);
          };
          BaseClass.prototype.assistiveMml = function() {
            var e_1, _a3;
            if (!this.processed.isSet("assistive-mml")) {
              try {
                for (var _b2 = __values2(this.math), _c = _b2.next(); !_c.done; _c = _b2.next()) {
                  var math2 = _c.value;
                  math2.assistiveMml(this);
                }
              } catch (e_1_1) {
                e_1 = { error: e_1_1 };
              } finally {
                try {
                  if (_c && !_c.done && (_a3 = _b2.return)) _a3.call(_b2);
                } finally {
                  if (e_1) throw e_1.error;
                }
              }
              this.processed.set("assistive-mml");
            }
            return this;
          };
          BaseClass.prototype.state = function(state, restore) {
            if (restore === void 0) {
              restore = false;
            }
            _super.prototype.state.call(this, state, restore);
            if (state < MathItem_js_1.STATE.ASSISTIVEMML) {
              this.processed.clear("assistive-mml");
            }
            return this;
          };
          return BaseClass;
        })(BaseDocument), _a2.OPTIONS = __assign2(__assign2({}, BaseDocument.OPTIONS), { enableAssistiveMml: true, renderActions: (0, Options_js_1.expandable)(__assign2(__assign2({}, BaseDocument.OPTIONS.renderActions), { assistiveMml: [MathItem_js_1.STATE.ASSISTIVEMML] })) }), _a2.assistiveStyles = {
          "mjx-assistive-mml": {
            position: "absolute !important",
            top: "0px",
            left: "0px",
            clip: "rect(1px, 1px, 1px, 1px)",
            padding: "1px 0px 0px 0px !important",
            border: "0px !important",
            display: "block !important",
            width: "auto !important",
            overflow: "hidden !important",
            "-webkit-touch-callout": "none",
            "-webkit-user-select": "none",
            "-khtml-user-select": "none",
            "-moz-user-select": "none",
            "-ms-user-select": "none",
            "user-select": "none"
          },
          'mjx-assistive-mml[display="block"]': {
            width: "100% !important"
          }
        }, _a2;
      }
      assistiveMml.AssistiveMmlMathDocumentMixin = AssistiveMmlMathDocumentMixin;
      function AssistiveMmlHandler(handler) {
        handler.documentClass = AssistiveMmlMathDocumentMixin(handler.documentClass);
        return handler;
      }
      assistiveMml.AssistiveMmlHandler = AssistiveMmlHandler;
      return assistiveMml;
    }
    var cheerio$1 = { exports: {} };
    var lib$b = {};
    var extendStatics = function(d, b) {
      extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
        d2.__proto__ = b2;
      } || function(d2, b2) {
        for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
      };
      return extendStatics(d, b);
    };
    function __extends(d, b) {
      if (typeof b !== "function" && b !== null)
        throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
      extendStatics(d, b);
      function __() {
        this.constructor = d;
      }
      d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    }
    var __assign = function() {
      __assign = Object.assign || function __assign2(t2) {
        for (var s, i2 = 1, n = arguments.length; i2 < n; i2++) {
          s = arguments[i2];
          for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t2[p] = s[p];
        }
        return t2;
      };
      return __assign.apply(this, arguments);
    };
    function __rest(s, e) {
      var t2 = {};
      for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
        t2[p] = s[p];
      if (s != null && typeof Object.getOwnPropertySymbols === "function")
        for (var i2 = 0, p = Object.getOwnPropertySymbols(s); i2 < p.length; i2++) {
          if (e.indexOf(p[i2]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i2]))
            t2[p[i2]] = s[p[i2]];
        }
      return t2;
    }
    function __decorate(decorators, target2, key2, desc) {
      var c2 = arguments.length, r2 = c2 < 3 ? target2 : desc === null ? desc = Object.getOwnPropertyDescriptor(target2, key2) : desc, d;
      if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target2, key2, desc);
      else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r2 = (c2 < 3 ? d(r2) : c2 > 3 ? d(target2, key2, r2) : d(target2, key2)) || r2;
      return c2 > 3 && r2 && Object.defineProperty(target2, key2, r2), r2;
    }
    function __param(paramIndex, decorator) {
      return function(target2, key2) {
        decorator(target2, key2, paramIndex);
      };
    }
    function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
      function accept(f) {
        if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected");
        return f;
      }
      var kind = contextIn.kind, key2 = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
      var target2 = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
      var descriptor = descriptorIn || (target2 ? Object.getOwnPropertyDescriptor(target2, contextIn.name) : {});
      var _, done = false;
      for (var i2 = decorators.length - 1; i2 >= 0; i2--) {
        var context = {};
        for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
        for (var p in contextIn.access) context.access[p] = contextIn.access[p];
        context.addInitializer = function(f) {
          if (done) throw new TypeError("Cannot add initializers after decoration has completed");
          extraInitializers.push(accept(f || null));
        };
        var result2 = (0, decorators[i2])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key2], context);
        if (kind === "accessor") {
          if (result2 === void 0) continue;
          if (result2 === null || typeof result2 !== "object") throw new TypeError("Object expected");
          if (_ = accept(result2.get)) descriptor.get = _;
          if (_ = accept(result2.set)) descriptor.set = _;
          if (_ = accept(result2.init)) initializers.unshift(_);
        } else if (_ = accept(result2)) {
          if (kind === "field") initializers.unshift(_);
          else descriptor[key2] = _;
        }
      }
      if (target2) Object.defineProperty(target2, contextIn.name, descriptor);
      done = true;
    }
    function __runInitializers(thisArg, initializers, value2) {
      var useValue = arguments.length > 2;
      for (var i2 = 0; i2 < initializers.length; i2++) {
        value2 = useValue ? initializers[i2].call(thisArg, value2) : initializers[i2].call(thisArg);
      }
      return useValue ? value2 : void 0;
    }
    function __propKey(x2) {
      return typeof x2 === "symbol" ? x2 : "".concat(x2);
    }
    function __setFunctionName(f, name2, prefix) {
      if (typeof name2 === "symbol") name2 = name2.description ? "[".concat(name2.description, "]") : "";
      return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name2) : name2 });
    }
    function __metadata(metadataKey, metadataValue) {
      if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
    }
    function __awaiter(thisArg, _arguments, P2, generator) {
      function adopt(value2) {
        return value2 instanceof P2 ? value2 : new P2(function(resolve) {
          resolve(value2);
        });
      }
      return new (P2 || (P2 = Promise))(function(resolve, reject) {
        function fulfilled(value2) {
          try {
            step(generator.next(value2));
          } catch (e) {
            reject(e);
          }
        }
        function rejected(value2) {
          try {
            step(generator["throw"](value2));
          } catch (e) {
            reject(e);
          }
        }
        function step(result2) {
          result2.done ? resolve(result2.value) : adopt(result2.value).then(fulfilled, rejected);
        }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
      });
    }
    function __generator(thisArg, body2) {
      var _ = { label: 0, sent: function() {
        if (t2[0] & 1) throw t2[1];
        return t2[1];
      }, trys: [], ops: [] }, f, y, t2, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
      return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
        return this;
      }), g;
      function verb(n) {
        return function(v) {
          return step([n, v]);
        };
      }
      function step(op) {
        if (f) throw new TypeError("Generator is already executing.");
        while (g && (g = 0, op[0] && (_ = 0)), _) try {
          if (f = 1, y && (t2 = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t2 = y["return"]) && t2.call(y), 0) : y.next) && !(t2 = t2.call(y, op[1])).done) return t2;
          if (y = 0, t2) op = [op[0] & 2, t2.value];
          switch (op[0]) {
            case 0:
            case 1:
              t2 = op;
              break;
            case 4:
              _.label++;
              return { value: op[1], done: false };
            case 5:
              _.label++;
              y = op[1];
              op = [0];
              continue;
            case 7:
              op = _.ops.pop();
              _.trys.pop();
              continue;
            default:
              if (!(t2 = _.trys, t2 = t2.length > 0 && t2[t2.length - 1]) && (op[0] === 6 || op[0] === 2)) {
                _ = 0;
                continue;
              }
              if (op[0] === 3 && (!t2 || op[1] > t2[0] && op[1] < t2[3])) {
                _.label = op[1];
                break;
              }
              if (op[0] === 6 && _.label < t2[1]) {
                _.label = t2[1];
                t2 = op;
                break;
              }
              if (t2 && _.label < t2[2]) {
                _.label = t2[2];
                _.ops.push(op);
                break;
              }
              if (t2[2]) _.ops.pop();
              _.trys.pop();
              continue;
          }
          op = body2.call(thisArg, _);
        } catch (e) {
          op = [6, e];
          y = 0;
        } finally {
          f = t2 = 0;
        }
        if (op[0] & 5) throw op[1];
        return { value: op[0] ? op[1] : void 0, done: true };
      }
    }
    var __createBinding = Object.create ? (function(o, m, k2, k22) {
      if (k22 === void 0) k22 = k2;
      var desc = Object.getOwnPropertyDescriptor(m, k2);
      if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
        desc = { enumerable: true, get: function() {
          return m[k2];
        } };
      }
      Object.defineProperty(o, k22, desc);
    }) : (function(o, m, k2, k22) {
      if (k22 === void 0) k22 = k2;
      o[k22] = m[k2];
    });
    function __exportStar(m, o) {
      for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);
    }
    function __values(o) {
      var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i2 = 0;
      if (m) return m.call(o);
      if (o && typeof o.length === "number") return {
        next: function() {
          if (o && i2 >= o.length) o = void 0;
          return { value: o && o[i2++], done: !o };
        }
      };
      throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
    }
    function __read(o, n) {
      var m = typeof Symbol === "function" && o[Symbol.iterator];
      if (!m) return o;
      var i2 = m.call(o), r2, ar2 = [], e;
      try {
        while ((n === void 0 || n-- > 0) && !(r2 = i2.next()).done) ar2.push(r2.value);
      } catch (error2) {
        e = { error: error2 };
      } finally {
        try {
          if (r2 && !r2.done && (m = i2["return"])) m.call(i2);
        } finally {
          if (e) throw e.error;
        }
      }
      return ar2;
    }
    function __spread() {
      for (var ar2 = [], i2 = 0; i2 < arguments.length; i2++)
        ar2 = ar2.concat(__read(arguments[i2]));
      return ar2;
    }
    function __spreadArrays() {
      for (var s = 0, i2 = 0, il = arguments.length; i2 < il; i2++) s += arguments[i2].length;
      for (var r2 = Array(s), k2 = 0, i2 = 0; i2 < il; i2++)
        for (var a = arguments[i2], j = 0, jl = a.length; j < jl; j++, k2++)
          r2[k2] = a[j];
      return r2;
    }
    function __spreadArray(to2, from, pack) {
      if (pack || arguments.length === 2) for (var i2 = 0, l = from.length, ar2; i2 < l; i2++) {
        if (ar2 || !(i2 in from)) {
          if (!ar2) ar2 = Array.prototype.slice.call(from, 0, i2);
          ar2[i2] = from[i2];
        }
      }
      return to2.concat(ar2 || Array.prototype.slice.call(from));
    }
    function __await(v) {
      return this instanceof __await ? (this.v = v, this) : new __await(v);
    }
    function __asyncGenerator(thisArg, _arguments, generator) {
      if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
      var g = generator.apply(thisArg, _arguments || []), i2, q = [];
      return i2 = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i2[Symbol.asyncIterator] = function() {
        return this;
      }, i2;
      function awaitReturn(f) {
        return function(v) {
          return Promise.resolve(v).then(f, reject);
        };
      }
      function verb(n, f) {
        if (g[n]) {
          i2[n] = function(v) {
            return new Promise(function(a, b) {
              q.push([n, v, a, b]) > 1 || resume(n, v);
            });
          };
          if (f) i2[n] = f(i2[n]);
        }
      }
      function resume(n, v) {
        try {
          step(g[n](v));
        } catch (e) {
          settle(q[0][3], e);
        }
      }
      function step(r2) {
        r2.value instanceof __await ? Promise.resolve(r2.value.v).then(fulfill, reject) : settle(q[0][2], r2);
      }
      function fulfill(value2) {
        resume("next", value2);
      }
      function reject(value2) {
        resume("throw", value2);
      }
      function settle(f, v) {
        if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]);
      }
    }
    function __asyncDelegator(o) {
      var i2, p;
      return i2 = {}, verb("next"), verb("throw", function(e) {
        throw e;
      }), verb("return"), i2[Symbol.iterator] = function() {
        return this;
      }, i2;
      function verb(n, f) {
        i2[n] = o[n] ? function(v) {
          return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v;
        } : f;
      }
    }
    function __asyncValues(o) {
      if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
      var m = o[Symbol.asyncIterator], i2;
      return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i2 = {}, verb("next"), verb("throw"), verb("return"), i2[Symbol.asyncIterator] = function() {
        return this;
      }, i2);
      function verb(n) {
        i2[n] = o[n] && function(v) {
          return new Promise(function(resolve, reject) {
            v = o[n](v), settle(resolve, reject, v.done, v.value);
          });
        };
      }
      function settle(resolve, reject, d, v) {
        Promise.resolve(v).then(function(v2) {
          resolve({ value: v2, done: d });
        }, reject);
      }
    }
    function __makeTemplateObject(cooked, raw) {
      if (Object.defineProperty) {
        Object.defineProperty(cooked, "raw", { value: raw });
      } else {
        cooked.raw = raw;
      }
      return cooked;
    }
    var __setModuleDefault = Object.create ? (function(o, v) {
      Object.defineProperty(o, "default", { enumerable: true, value: v });
    }) : function(o, v) {
      o["default"] = v;
    };
    var ownKeys$1 = function(o) {
      ownKeys$1 = Object.getOwnPropertyNames || function(o2) {
        var ar2 = [];
        for (var k2 in o2) if (Object.prototype.hasOwnProperty.call(o2, k2)) ar2[ar2.length] = k2;
        return ar2;
      };
      return ownKeys$1(o);
    };
    function __importStar(mod2) {
      if (mod2 && mod2.__esModule) return mod2;
      var result2 = {};
      if (mod2 != null) {
        for (var k2 = ownKeys$1(mod2), i2 = 0; i2 < k2.length; i2++) if (k2[i2] !== "default") __createBinding(result2, mod2, k2[i2]);
      }
      __setModuleDefault(result2, mod2);
      return result2;
    }
    function __importDefault(mod2) {
      return mod2 && mod2.__esModule ? mod2 : { default: mod2 };
    }
    function __classPrivateFieldGet(receiver, state, kind, f) {
      if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
      if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
      return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
    }
    function __classPrivateFieldSet(receiver, state, value2, kind, f) {
      if (kind === "m") throw new TypeError("Private method is not writable");
      if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
      if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
      return kind === "a" ? f.call(receiver, value2) : f ? f.value = value2 : state.set(receiver, value2), value2;
    }
    function __classPrivateFieldIn(state, receiver) {
      if (receiver === null || typeof receiver !== "object" && typeof receiver !== "function") throw new TypeError("Cannot use 'in' operator on non-object");
      return typeof state === "function" ? receiver === state : state.has(receiver);
    }
    function __addDisposableResource(env, value2, async) {
      if (value2 !== null && value2 !== void 0) {
        if (typeof value2 !== "object" && typeof value2 !== "function") throw new TypeError("Object expected.");
        var dispose2, inner2;
        if (async) {
          if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
          dispose2 = value2[Symbol.asyncDispose];
        }
        if (dispose2 === void 0) {
          if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
          dispose2 = value2[Symbol.dispose];
          if (async) inner2 = dispose2;
        }
        if (typeof dispose2 !== "function") throw new TypeError("Object not disposable.");
        if (inner2) dispose2 = function() {
          try {
            inner2.call(this);
          } catch (e) {
            return Promise.reject(e);
          }
        };
        env.stack.push({ value: value2, dispose: dispose2, async });
      } else if (async) {
        env.stack.push({ async: true });
      }
      return value2;
    }
    var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function(error2, suppressed, message2) {
      var e = new Error(message2);
      return e.name = "SuppressedError", e.error = error2, e.suppressed = suppressed, e;
    };
    function __disposeResources(env) {
      function fail(e) {
        env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
        env.hasError = true;
      }
      var r2, s = 0;
      function next() {
        while (r2 = env.stack.pop()) {
          try {
            if (!r2.async && s === 1) return s = 0, env.stack.push(r2), Promise.resolve().then(next);
            if (r2.dispose) {
              var result2 = r2.dispose.call(r2.value);
              if (r2.async) return s |= 2, Promise.resolve(result2).then(next, function(e) {
                fail(e);
                return next();
              });
            } else s |= 1;
          } catch (e) {
            fail(e);
          }
        }
        if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();
        if (env.hasError) throw env.error;
      }
      return next();
    }
    function __rewriteRelativeImportExtension(path, preserveJsx) {
      if (typeof path === "string" && /^\.\.?\//.test(path)) {
        return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function(m, tsx, d, ext, cm) {
          return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : d + ext + "." + cm.toLowerCase() + "js";
        });
      }
      return path;
    }
    const tslib_es6 = {
      __extends,
      __assign,
      __rest,
      __decorate,
      __param,
      __esDecorate,
      __runInitializers,
      __propKey,
      __setFunctionName,
      __metadata,
      __awaiter,
      __generator,
      __createBinding,
      __exportStar,
      __values,
      __read,
      __spread,
      __spreadArrays,
      __spreadArray,
      __await,
      __asyncGenerator,
      __asyncDelegator,
      __asyncValues,
      __makeTemplateObject,
      __importStar,
      __importDefault,
      __classPrivateFieldGet,
      __classPrivateFieldSet,
      __classPrivateFieldIn,
      __addDisposableResource,
      __disposeResources,
      __rewriteRelativeImportExtension
    };
    const tslib_es6$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
      __proto__: null,
      __addDisposableResource,
      get __assign() {
        return __assign;
      },
      __asyncDelegator,
      __asyncGenerator,
      __asyncValues,
      __await,
      __awaiter,
      __classPrivateFieldGet,
      __classPrivateFieldIn,
      __classPrivateFieldSet,
      __createBinding,
      __decorate,
      __disposeResources,
      __esDecorate,
      __exportStar,
      __extends,
      __generator,
      __importDefault,
      __importStar,
      __makeTemplateObject,
      __metadata,
      __param,
      __propKey,
      __read,
      __rest,
      __rewriteRelativeImportExtension,
      __runInitializers,
      __setFunctionName,
      __spread,
      __spreadArray,
      __spreadArrays,
      __values,
      default: tslib_es6
    }, Symbol.toStringTag, { value: "Module" }));
    const require$$0$2 = /* @__PURE__ */ getAugmentedNamespace(tslib_es6$1);
    var types$1 = {};
    var hasRequiredTypes;
    function requireTypes() {
      if (hasRequiredTypes) return types$1;
      hasRequiredTypes = 1;
      Object.defineProperty(types$1, "__esModule", { value: true });
      return types$1;
    }
    var load = {};
    var options = {};
    var hasRequiredOptions;
    function requireOptions() {
      if (hasRequiredOptions) return options;
      hasRequiredOptions = 1;
      Object.defineProperty(options, "__esModule", { value: true });
      options.flatten = void 0;
      var tslib_1 = require$$0$2;
      var defaultOpts = {
        xml: false,
        decodeEntities: true
      };
      options.default = defaultOpts;
      var xmlModeDefault = {
        _useHtmlParser2: true,
        xmlMode: true
      };
      function flatten2(options2) {
        return (options2 === null || options2 === void 0 ? void 0 : options2.xml) ? typeof options2.xml === "boolean" ? xmlModeDefault : tslib_1.__assign(tslib_1.__assign({}, xmlModeDefault), options2.xml) : options2 !== null && options2 !== void 0 ? options2 : void 0;
      }
      options.flatten = flatten2;
      return options;
    }
    var _static = {};
    var lib$a = {};
    var SelectorType;
    (function(SelectorType2) {
      SelectorType2["Attribute"] = "attribute";
      SelectorType2["Pseudo"] = "pseudo";
      SelectorType2["PseudoElement"] = "pseudo-element";
      SelectorType2["Tag"] = "tag";
      SelectorType2["Universal"] = "universal";
      SelectorType2["Adjacent"] = "adjacent";
      SelectorType2["Child"] = "child";
      SelectorType2["Descendant"] = "descendant";
      SelectorType2["Parent"] = "parent";
      SelectorType2["Sibling"] = "sibling";
      SelectorType2["ColumnCombinator"] = "column-combinator";
    })(SelectorType || (SelectorType = {}));
    const IgnoreCaseMode = {
      Unknown: null,
      QuirksMode: "quirks",
      IgnoreCase: true,
      CaseSensitive: false
    };
    var AttributeAction;
    (function(AttributeAction2) {
      AttributeAction2["Any"] = "any";
      AttributeAction2["Element"] = "element";
      AttributeAction2["End"] = "end";
      AttributeAction2["Equals"] = "equals";
      AttributeAction2["Exists"] = "exists";
      AttributeAction2["Hyphen"] = "hyphen";
      AttributeAction2["Not"] = "not";
      AttributeAction2["Start"] = "start";
    })(AttributeAction || (AttributeAction = {}));
    const reName = /^[^\\#]?(?:\\(?:[\da-f]{1,6}\s?|.)|[\w\-\u00b0-\uFFFF])+/;
    const reEscape = /\\([\da-f]{1,6}\s?|(\s)|.)/gi;
    const actionTypes = /* @__PURE__ */ new Map([
      [126, AttributeAction.Element],
      [94, AttributeAction.Start],
      [36, AttributeAction.End],
      [42, AttributeAction.Any],
      [33, AttributeAction.Not],
      [124, AttributeAction.Hyphen]
    ]);
    const unpackPseudos = /* @__PURE__ */ new Set([
      "has",
      "not",
      "matches",
      "is",
      "where",
      "host",
      "host-context"
    ]);
    function isTraversal(selector2) {
      switch (selector2.type) {
        case SelectorType.Adjacent:
        case SelectorType.Child:
        case SelectorType.Descendant:
        case SelectorType.Parent:
        case SelectorType.Sibling:
        case SelectorType.ColumnCombinator:
          return true;
        default:
          return false;
      }
    }
    const stripQuotesFromPseudos = /* @__PURE__ */ new Set(["contains", "icontains"]);
    function funescape(_, escaped, escapedWhitespace) {
      const high = parseInt(escaped, 16) - 65536;
      return high !== high || escapedWhitespace ? escaped : high < 0 ? (
        // BMP codepoint
        String.fromCharCode(high + 65536)
      ) : (
        // Supplemental Plane codepoint (surrogate pair)
        String.fromCharCode(high >> 10 | 55296, high & 1023 | 56320)
      );
    }
    function unescapeCSS(str2) {
      return str2.replace(reEscape, funescape);
    }
    function isQuote(c2) {
      return c2 === 39 || c2 === 34;
    }
    function isWhitespace(c2) {
      return c2 === 32 || c2 === 9 || c2 === 10 || c2 === 12 || c2 === 13;
    }
    function parse$5(selector2) {
      const subselects2 = [];
      const endIndex = parseSelector(subselects2, `${selector2}`, 0);
      if (endIndex < selector2.length) {
        throw new Error(`Unmatched selector: ${selector2.slice(endIndex)}`);
      }
      return subselects2;
    }
    function parseSelector(subselects2, selector2, selectorIndex) {
      let tokens = [];
      function getName(offset2) {
        const match = selector2.slice(selectorIndex + offset2).match(reName);
        if (!match) {
          throw new Error(`Expected name, found ${selector2.slice(selectorIndex)}`);
        }
        const [name2] = match;
        selectorIndex += offset2 + name2.length;
        return unescapeCSS(name2);
      }
      function stripWhitespace(offset2) {
        selectorIndex += offset2;
        while (selectorIndex < selector2.length && isWhitespace(selector2.charCodeAt(selectorIndex))) {
          selectorIndex++;
        }
      }
      function readValueWithParenthesis() {
        selectorIndex += 1;
        const start2 = selectorIndex;
        let counter2 = 1;
        for (; counter2 > 0 && selectorIndex < selector2.length; selectorIndex++) {
          if (selector2.charCodeAt(selectorIndex) === 40 && !isEscaped(selectorIndex)) {
            counter2++;
          } else if (selector2.charCodeAt(selectorIndex) === 41 && !isEscaped(selectorIndex)) {
            counter2--;
          }
        }
        if (counter2) {
          throw new Error("Parenthesis not matched");
        }
        return unescapeCSS(selector2.slice(start2, selectorIndex - 1));
      }
      function isEscaped(pos2) {
        let slashCount = 0;
        while (selector2.charCodeAt(--pos2) === 92)
          slashCount++;
        return (slashCount & 1) === 1;
      }
      function ensureNotTraversal() {
        if (tokens.length > 0 && isTraversal(tokens[tokens.length - 1])) {
          throw new Error("Did not expect successive traversals.");
        }
      }
      function addTraversal(type) {
        if (tokens.length > 0 && tokens[tokens.length - 1].type === SelectorType.Descendant) {
          tokens[tokens.length - 1].type = type;
          return;
        }
        ensureNotTraversal();
        tokens.push({ type });
      }
      function addSpecialAttribute(name2, action) {
        tokens.push({
          type: SelectorType.Attribute,
          name: name2,
          action,
          value: getName(1),
          namespace: null,
          ignoreCase: "quirks"
        });
      }
      function finalizeSubselector() {
        if (tokens.length && tokens[tokens.length - 1].type === SelectorType.Descendant) {
          tokens.pop();
        }
        if (tokens.length === 0) {
          throw new Error("Empty sub-selector");
        }
        subselects2.push(tokens);
      }
      stripWhitespace(0);
      if (selector2.length === selectorIndex) {
        return selectorIndex;
      }
      loop: while (selectorIndex < selector2.length) {
        const firstChar = selector2.charCodeAt(selectorIndex);
        switch (firstChar) {
          // Whitespace
          case 32:
          case 9:
          case 10:
          case 12:
          case 13: {
            if (tokens.length === 0 || tokens[0].type !== SelectorType.Descendant) {
              ensureNotTraversal();
              tokens.push({ type: SelectorType.Descendant });
            }
            stripWhitespace(1);
            break;
          }
          // Traversals
          case 62: {
            addTraversal(SelectorType.Child);
            stripWhitespace(1);
            break;
          }
          case 60: {
            addTraversal(SelectorType.Parent);
            stripWhitespace(1);
            break;
          }
          case 126: {
            addTraversal(SelectorType.Sibling);
            stripWhitespace(1);
            break;
          }
          case 43: {
            addTraversal(SelectorType.Adjacent);
            stripWhitespace(1);
            break;
          }
          // Special attribute selectors: .class, #id
          case 46: {
            addSpecialAttribute("class", AttributeAction.Element);
            break;
          }
          case 35: {
            addSpecialAttribute("id", AttributeAction.Equals);
            break;
          }
          case 91: {
            stripWhitespace(1);
            let name2;
            let namespace = null;
            if (selector2.charCodeAt(selectorIndex) === 124) {
              name2 = getName(1);
            } else if (selector2.startsWith("*|", selectorIndex)) {
              namespace = "*";
              name2 = getName(2);
            } else {
              name2 = getName(0);
              if (selector2.charCodeAt(selectorIndex) === 124 && selector2.charCodeAt(selectorIndex + 1) !== 61) {
                namespace = name2;
                name2 = getName(1);
              }
            }
            stripWhitespace(0);
            let action = AttributeAction.Exists;
            const possibleAction = actionTypes.get(selector2.charCodeAt(selectorIndex));
            if (possibleAction) {
              action = possibleAction;
              if (selector2.charCodeAt(selectorIndex + 1) !== 61) {
                throw new Error("Expected `=`");
              }
              stripWhitespace(2);
            } else if (selector2.charCodeAt(selectorIndex) === 61) {
              action = AttributeAction.Equals;
              stripWhitespace(1);
            }
            let value2 = "";
            let ignoreCase = null;
            if (action !== "exists") {
              if (isQuote(selector2.charCodeAt(selectorIndex))) {
                const quote2 = selector2.charCodeAt(selectorIndex);
                let sectionEnd = selectorIndex + 1;
                while (sectionEnd < selector2.length && (selector2.charCodeAt(sectionEnd) !== quote2 || isEscaped(sectionEnd))) {
                  sectionEnd += 1;
                }
                if (selector2.charCodeAt(sectionEnd) !== quote2) {
                  throw new Error("Attribute value didn't end");
                }
                value2 = unescapeCSS(selector2.slice(selectorIndex + 1, sectionEnd));
                selectorIndex = sectionEnd + 1;
              } else {
                const valueStart = selectorIndex;
                while (selectorIndex < selector2.length && (!isWhitespace(selector2.charCodeAt(selectorIndex)) && selector2.charCodeAt(selectorIndex) !== 93 || isEscaped(selectorIndex))) {
                  selectorIndex += 1;
                }
                value2 = unescapeCSS(selector2.slice(valueStart, selectorIndex));
              }
              stripWhitespace(0);
              const forceIgnore = selector2.charCodeAt(selectorIndex) | 32;
              if (forceIgnore === 115) {
                ignoreCase = false;
                stripWhitespace(1);
              } else if (forceIgnore === 105) {
                ignoreCase = true;
                stripWhitespace(1);
              }
            }
            if (selector2.charCodeAt(selectorIndex) !== 93) {
              throw new Error("Attribute selector didn't terminate");
            }
            selectorIndex += 1;
            const attributeSelector = {
              type: SelectorType.Attribute,
              name: name2,
              action,
              value: value2,
              namespace,
              ignoreCase
            };
            tokens.push(attributeSelector);
            break;
          }
          case 58: {
            if (selector2.charCodeAt(selectorIndex + 1) === 58) {
              tokens.push({
                type: SelectorType.PseudoElement,
                name: getName(2).toLowerCase(),
                data: selector2.charCodeAt(selectorIndex) === 40 ? readValueWithParenthesis() : null
              });
              continue;
            }
            const name2 = getName(1).toLowerCase();
            let data = null;
            if (selector2.charCodeAt(selectorIndex) === 40) {
              if (unpackPseudos.has(name2)) {
                if (isQuote(selector2.charCodeAt(selectorIndex + 1))) {
                  throw new Error(`Pseudo-selector ${name2} cannot be quoted`);
                }
                data = [];
                selectorIndex = parseSelector(data, selector2, selectorIndex + 1);
                if (selector2.charCodeAt(selectorIndex) !== 41) {
                  throw new Error(`Missing closing parenthesis in :${name2} (${selector2})`);
                }
                selectorIndex += 1;
              } else {
                data = readValueWithParenthesis();
                if (stripQuotesFromPseudos.has(name2)) {
                  const quot2 = data.charCodeAt(0);
                  if (quot2 === data.charCodeAt(data.length - 1) && isQuote(quot2)) {
                    data = data.slice(1, -1);
                  }
                }
                data = unescapeCSS(data);
              }
            }
            tokens.push({ type: SelectorType.Pseudo, name: name2, data });
            break;
          }
          case 44: {
            finalizeSubselector();
            tokens = [];
            stripWhitespace(1);
            break;
          }
          default: {
            if (selector2.startsWith("/*", selectorIndex)) {
              const endIndex = selector2.indexOf("*/", selectorIndex + 2);
              if (endIndex < 0) {
                throw new Error("Comment was not terminated");
              }
              selectorIndex = endIndex + 2;
              if (tokens.length === 0) {
                stripWhitespace(0);
              }
              break;
            }
            let namespace = null;
            let name2;
            if (firstChar === 42) {
              selectorIndex += 1;
              name2 = "*";
            } else if (firstChar === 124) {
              name2 = "";
              if (selector2.charCodeAt(selectorIndex + 1) === 124) {
                addTraversal(SelectorType.ColumnCombinator);
                stripWhitespace(2);
                break;
              }
            } else if (reName.test(selector2.slice(selectorIndex))) {
              name2 = getName(0);
            } else {
              break loop;
            }
            if (selector2.charCodeAt(selectorIndex) === 124 && selector2.charCodeAt(selectorIndex + 1) !== 124) {
              namespace = name2;
              if (selector2.charCodeAt(selectorIndex + 1) === 42) {
                name2 = "*";
                selectorIndex += 2;
              } else {
                name2 = getName(1);
              }
            }
            tokens.push(name2 === "*" ? { type: SelectorType.Universal, namespace } : { type: SelectorType.Tag, name: name2, namespace });
          }
        }
      }
      finalizeSubselector();
      return selectorIndex;
    }
    const attribValChars = ["\\", '"'];
    const pseudoValChars = [...attribValChars, "(", ")"];
    const charsToEscapeInAttributeValue = new Set(attribValChars.map((c2) => c2.charCodeAt(0)));
    const charsToEscapeInPseudoValue = new Set(pseudoValChars.map((c2) => c2.charCodeAt(0)));
    const charsToEscapeInName = new Set([
      ...pseudoValChars,
      "~",
      "^",
      "$",
      "*",
      "+",
      "!",
      "|",
      ":",
      "[",
      "]",
      " ",
      "."
    ].map((c2) => c2.charCodeAt(0)));
    function stringify$2(selector2) {
      return selector2.map((token2) => token2.map(stringifyToken).join("")).join(", ");
    }
    function stringifyToken(token2, index, arr2) {
      switch (token2.type) {
        // Simple types
        case SelectorType.Child:
          return index === 0 ? "> " : " > ";
        case SelectorType.Parent:
          return index === 0 ? "< " : " < ";
        case SelectorType.Sibling:
          return index === 0 ? "~ " : " ~ ";
        case SelectorType.Adjacent:
          return index === 0 ? "+ " : " + ";
        case SelectorType.Descendant:
          return " ";
        case SelectorType.ColumnCombinator:
          return index === 0 ? "|| " : " || ";
        case SelectorType.Universal:
          return token2.namespace === "*" && index + 1 < arr2.length && "name" in arr2[index + 1] ? "" : `${getNamespace(token2.namespace)}*`;
        case SelectorType.Tag:
          return getNamespacedName(token2);
        case SelectorType.PseudoElement:
          return `::${escapeName(token2.name, charsToEscapeInName)}${token2.data === null ? "" : `(${escapeName(token2.data, charsToEscapeInPseudoValue)})`}`;
        case SelectorType.Pseudo:
          return `:${escapeName(token2.name, charsToEscapeInName)}${token2.data === null ? "" : `(${typeof token2.data === "string" ? escapeName(token2.data, charsToEscapeInPseudoValue) : stringify$2(token2.data)})`}`;
        case SelectorType.Attribute: {
          if (token2.name === "id" && token2.action === AttributeAction.Equals && token2.ignoreCase === "quirks" && !token2.namespace) {
            return `#${escapeName(token2.value, charsToEscapeInName)}`;
          }
          if (token2.name === "class" && token2.action === AttributeAction.Element && token2.ignoreCase === "quirks" && !token2.namespace) {
            return `.${escapeName(token2.value, charsToEscapeInName)}`;
          }
          const name2 = getNamespacedName(token2);
          if (token2.action === AttributeAction.Exists) {
            return `[${name2}]`;
          }
          return `[${name2}${getActionValue(token2.action)}="${escapeName(token2.value, charsToEscapeInAttributeValue)}"${token2.ignoreCase === null ? "" : token2.ignoreCase ? " i" : " s"}]`;
        }
      }
    }
    function getActionValue(action) {
      switch (action) {
        case AttributeAction.Equals:
          return "";
        case AttributeAction.Element:
          return "~";
        case AttributeAction.Start:
          return "^";
        case AttributeAction.End:
          return "$";
        case AttributeAction.Any:
          return "*";
        case AttributeAction.Not:
          return "!";
        case AttributeAction.Hyphen:
          return "|";
        case AttributeAction.Exists:
          throw new Error("Shouldn't be here");
      }
    }
    function getNamespacedName(token2) {
      return `${getNamespace(token2.namespace)}${escapeName(token2.name, charsToEscapeInName)}`;
    }
    function getNamespace(namespace) {
      return namespace !== null ? `${namespace === "*" ? "*" : escapeName(namespace, charsToEscapeInName)}|` : "";
    }
    function escapeName(str2, charsToEscape) {
      let lastIdx = 0;
      let ret = "";
      for (let i2 = 0; i2 < str2.length; i2++) {
        if (charsToEscape.has(str2.charCodeAt(i2))) {
          ret += `${str2.slice(lastIdx, i2)}\\${str2.charAt(i2)}`;
          lastIdx = i2 + 1;
        }
      }
      return ret.length > 0 ? ret + str2.slice(lastIdx) : str2;
    }
    const es = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
      __proto__: null,
      get AttributeAction() {
        return AttributeAction;
      },
      IgnoreCaseMode,
      get SelectorType() {
        return SelectorType;
      },
      isTraversal,
      parse: parse$5,
      stringify: stringify$2
    }, Symbol.toStringTag, { value: "Module" }));
    const require$$0$1 = /* @__PURE__ */ getAugmentedNamespace(es);
    var lib$9 = {};
    var lib$8 = {};
    var stringify$1 = {};
    var lib$7 = {};
    var lib$6 = {};
    var hasRequiredLib$b;
    function requireLib$b() {
      if (hasRequiredLib$b) return lib$6;
      hasRequiredLib$b = 1;
      (function(exports2) {
        Object.defineProperty(exports2, "__esModule", { value: true });
        exports2.Doctype = exports2.CDATA = exports2.Tag = exports2.Style = exports2.Script = exports2.Comment = exports2.Directive = exports2.Text = exports2.Root = exports2.isTag = exports2.ElementType = void 0;
        var ElementType;
        (function(ElementType2) {
          ElementType2["Root"] = "root";
          ElementType2["Text"] = "text";
          ElementType2["Directive"] = "directive";
          ElementType2["Comment"] = "comment";
          ElementType2["Script"] = "script";
          ElementType2["Style"] = "style";
          ElementType2["Tag"] = "tag";
          ElementType2["CDATA"] = "cdata";
          ElementType2["Doctype"] = "doctype";
        })(ElementType = exports2.ElementType || (exports2.ElementType = {}));
        function isTag(elem) {
          return elem.type === ElementType.Tag || elem.type === ElementType.Script || elem.type === ElementType.Style;
        }
        exports2.isTag = isTag;
        exports2.Root = ElementType.Root;
        exports2.Text = ElementType.Text;
        exports2.Directive = ElementType.Directive;
        exports2.Comment = ElementType.Comment;
        exports2.Script = ElementType.Script;
        exports2.Style = ElementType.Style;
        exports2.Tag = ElementType.Tag;
        exports2.CDATA = ElementType.CDATA;
        exports2.Doctype = ElementType.Doctype;
      })(lib$6);
      return lib$6;
    }
    var node$1 = {};
    var hasRequiredNode;
    function requireNode() {
      if (hasRequiredNode) return node$1;
      hasRequiredNode = 1;
      var __extends2 = node$1 && node$1.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      var __assign2 = node$1 && node$1.__assign || function() {
        __assign2 = Object.assign || function(t2) {
          for (var s, i2 = 1, n = arguments.length; i2 < n; i2++) {
            s = arguments[i2];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
              t2[p] = s[p];
          }
          return t2;
        };
        return __assign2.apply(this, arguments);
      };
      Object.defineProperty(node$1, "__esModule", { value: true });
      node$1.cloneNode = node$1.hasChildren = node$1.isDocument = node$1.isDirective = node$1.isComment = node$1.isText = node$1.isCDATA = node$1.isTag = node$1.Element = node$1.Document = node$1.NodeWithChildren = node$1.ProcessingInstruction = node$1.Comment = node$1.Text = node$1.DataNode = node$1.Node = void 0;
      var domelementtype_1 = /* @__PURE__ */ requireLib$b();
      var nodeTypes = /* @__PURE__ */ new Map([
        [domelementtype_1.ElementType.Tag, 1],
        [domelementtype_1.ElementType.Script, 1],
        [domelementtype_1.ElementType.Style, 1],
        [domelementtype_1.ElementType.Directive, 1],
        [domelementtype_1.ElementType.Text, 3],
        [domelementtype_1.ElementType.CDATA, 4],
        [domelementtype_1.ElementType.Comment, 8],
        [domelementtype_1.ElementType.Root, 9]
      ]);
      var Node2 = (
        /** @class */
        (function() {
          function Node3(type) {
            this.type = type;
            this.parent = null;
            this.prev = null;
            this.next = null;
            this.startIndex = null;
            this.endIndex = null;
          }
          Object.defineProperty(Node3.prototype, "nodeType", {
            // Read-only aliases
            /**
             * [DOM spec](https://dom.spec.whatwg.org/#dom-node-nodetype)-compatible
             * node {@link type}.
             */
            get: function() {
              var _a2;
              return (_a2 = nodeTypes.get(this.type)) !== null && _a2 !== void 0 ? _a2 : 1;
            },
            enumerable: false,
            configurable: true
          });
          Object.defineProperty(Node3.prototype, "parentNode", {
            // Read-write aliases for properties
            /**
             * Same as {@link parent}.
             * [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
             */
            get: function() {
              return this.parent;
            },
            set: function(parent) {
              this.parent = parent;
            },
            enumerable: false,
            configurable: true
          });
          Object.defineProperty(Node3.prototype, "previousSibling", {
            /**
             * Same as {@link prev}.
             * [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
             */
            get: function() {
              return this.prev;
            },
            set: function(prev) {
              this.prev = prev;
            },
            enumerable: false,
            configurable: true
          });
          Object.defineProperty(Node3.prototype, "nextSibling", {
            /**
             * Same as {@link next}.
             * [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
             */
            get: function() {
              return this.next;
            },
            set: function(next) {
              this.next = next;
            },
            enumerable: false,
            configurable: true
          });
          Node3.prototype.cloneNode = function(recursive) {
            if (recursive === void 0) {
              recursive = false;
            }
            return cloneNode(this, recursive);
          };
          return Node3;
        })()
      );
      node$1.Node = Node2;
      var DataNode = (
        /** @class */
        (function(_super) {
          __extends2(DataNode2, _super);
          function DataNode2(type, data) {
            var _this = _super.call(this, type) || this;
            _this.data = data;
            return _this;
          }
          Object.defineProperty(DataNode2.prototype, "nodeValue", {
            /**
             * Same as {@link data}.
             * [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
             */
            get: function() {
              return this.data;
            },
            set: function(data) {
              this.data = data;
            },
            enumerable: false,
            configurable: true
          });
          return DataNode2;
        })(Node2)
      );
      node$1.DataNode = DataNode;
      var Text2 = (
        /** @class */
        (function(_super) {
          __extends2(Text3, _super);
          function Text3(data) {
            return _super.call(this, domelementtype_1.ElementType.Text, data) || this;
          }
          return Text3;
        })(DataNode)
      );
      node$1.Text = Text2;
      var Comment = (
        /** @class */
        (function(_super) {
          __extends2(Comment2, _super);
          function Comment2(data) {
            return _super.call(this, domelementtype_1.ElementType.Comment, data) || this;
          }
          return Comment2;
        })(DataNode)
      );
      node$1.Comment = Comment;
      var ProcessingInstruction = (
        /** @class */
        (function(_super) {
          __extends2(ProcessingInstruction2, _super);
          function ProcessingInstruction2(name2, data) {
            var _this = _super.call(this, domelementtype_1.ElementType.Directive, data) || this;
            _this.name = name2;
            return _this;
          }
          return ProcessingInstruction2;
        })(DataNode)
      );
      node$1.ProcessingInstruction = ProcessingInstruction;
      var NodeWithChildren = (
        /** @class */
        (function(_super) {
          __extends2(NodeWithChildren2, _super);
          function NodeWithChildren2(type, children2) {
            var _this = _super.call(this, type) || this;
            _this.children = children2;
            return _this;
          }
          Object.defineProperty(NodeWithChildren2.prototype, "firstChild", {
            // Aliases
            /** First child of the node. */
            get: function() {
              var _a2;
              return (_a2 = this.children[0]) !== null && _a2 !== void 0 ? _a2 : null;
            },
            enumerable: false,
            configurable: true
          });
          Object.defineProperty(NodeWithChildren2.prototype, "lastChild", {
            /** Last child of the node. */
            get: function() {
              return this.children.length > 0 ? this.children[this.children.length - 1] : null;
            },
            enumerable: false,
            configurable: true
          });
          Object.defineProperty(NodeWithChildren2.prototype, "childNodes", {
            /**
             * Same as {@link children}.
             * [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
             */
            get: function() {
              return this.children;
            },
            set: function(children2) {
              this.children = children2;
            },
            enumerable: false,
            configurable: true
          });
          return NodeWithChildren2;
        })(Node2)
      );
      node$1.NodeWithChildren = NodeWithChildren;
      var Document2 = (
        /** @class */
        (function(_super) {
          __extends2(Document3, _super);
          function Document3(children2) {
            return _super.call(this, domelementtype_1.ElementType.Root, children2) || this;
          }
          return Document3;
        })(NodeWithChildren)
      );
      node$1.Document = Document2;
      var Element2 = (
        /** @class */
        (function(_super) {
          __extends2(Element3, _super);
          function Element3(name2, attribs, children2, type) {
            if (children2 === void 0) {
              children2 = [];
            }
            if (type === void 0) {
              type = name2 === "script" ? domelementtype_1.ElementType.Script : name2 === "style" ? domelementtype_1.ElementType.Style : domelementtype_1.ElementType.Tag;
            }
            var _this = _super.call(this, type, children2) || this;
            _this.name = name2;
            _this.attribs = attribs;
            return _this;
          }
          Object.defineProperty(Element3.prototype, "tagName", {
            // DOM Level 1 aliases
            /**
             * Same as {@link name}.
             * [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
             */
            get: function() {
              return this.name;
            },
            set: function(name2) {
              this.name = name2;
            },
            enumerable: false,
            configurable: true
          });
          Object.defineProperty(Element3.prototype, "attributes", {
            get: function() {
              var _this = this;
              return Object.keys(this.attribs).map(function(name2) {
                var _a2, _b2;
                return {
                  name: name2,
                  value: _this.attribs[name2],
                  namespace: (_a2 = _this["x-attribsNamespace"]) === null || _a2 === void 0 ? void 0 : _a2[name2],
                  prefix: (_b2 = _this["x-attribsPrefix"]) === null || _b2 === void 0 ? void 0 : _b2[name2]
                };
              });
            },
            enumerable: false,
            configurable: true
          });
          return Element3;
        })(NodeWithChildren)
      );
      node$1.Element = Element2;
      function isTag(node2) {
        return (0, domelementtype_1.isTag)(node2);
      }
      node$1.isTag = isTag;
      function isCDATA(node2) {
        return node2.type === domelementtype_1.ElementType.CDATA;
      }
      node$1.isCDATA = isCDATA;
      function isText(node2) {
        return node2.type === domelementtype_1.ElementType.Text;
      }
      node$1.isText = isText;
      function isComment(node2) {
        return node2.type === domelementtype_1.ElementType.Comment;
      }
      node$1.isComment = isComment;
      function isDirective(node2) {
        return node2.type === domelementtype_1.ElementType.Directive;
      }
      node$1.isDirective = isDirective;
      function isDocument(node2) {
        return node2.type === domelementtype_1.ElementType.Root;
      }
      node$1.isDocument = isDocument;
      function hasChildren(node2) {
        return Object.prototype.hasOwnProperty.call(node2, "children");
      }
      node$1.hasChildren = hasChildren;
      function cloneNode(node2, recursive) {
        if (recursive === void 0) {
          recursive = false;
        }
        var result2;
        if (isText(node2)) {
          result2 = new Text2(node2.data);
        } else if (isComment(node2)) {
          result2 = new Comment(node2.data);
        } else if (isTag(node2)) {
          var children2 = recursive ? cloneChildren(node2.children) : [];
          var clone_1 = new Element2(node2.name, __assign2({}, node2.attribs), children2);
          children2.forEach(function(child) {
            return child.parent = clone_1;
          });
          if (node2.namespace != null) {
            clone_1.namespace = node2.namespace;
          }
          if (node2["x-attribsNamespace"]) {
            clone_1["x-attribsNamespace"] = __assign2({}, node2["x-attribsNamespace"]);
          }
          if (node2["x-attribsPrefix"]) {
            clone_1["x-attribsPrefix"] = __assign2({}, node2["x-attribsPrefix"]);
          }
          result2 = clone_1;
        } else if (isCDATA(node2)) {
          var children2 = recursive ? cloneChildren(node2.children) : [];
          var clone_2 = new NodeWithChildren(domelementtype_1.ElementType.CDATA, children2);
          children2.forEach(function(child) {
            return child.parent = clone_2;
          });
          result2 = clone_2;
        } else if (isDocument(node2)) {
          var children2 = recursive ? cloneChildren(node2.children) : [];
          var clone_3 = new Document2(children2);
          children2.forEach(function(child) {
            return child.parent = clone_3;
          });
          if (node2["x-mode"]) {
            clone_3["x-mode"] = node2["x-mode"];
          }
          result2 = clone_3;
        } else if (isDirective(node2)) {
          var instruction = new ProcessingInstruction(node2.name, node2.data);
          if (node2["x-name"] != null) {
            instruction["x-name"] = node2["x-name"];
            instruction["x-publicId"] = node2["x-publicId"];
            instruction["x-systemId"] = node2["x-systemId"];
          }
          result2 = instruction;
        } else {
          throw new Error("Not implemented yet: ".concat(node2.type));
        }
        result2.startIndex = node2.startIndex;
        result2.endIndex = node2.endIndex;
        if (node2.sourceCodeLocation != null) {
          result2.sourceCodeLocation = node2.sourceCodeLocation;
        }
        return result2;
      }
      node$1.cloneNode = cloneNode;
      function cloneChildren(childs) {
        var children2 = childs.map(function(child) {
          return cloneNode(child, true);
        });
        for (var i2 = 1; i2 < children2.length; i2++) {
          children2[i2].prev = children2[i2 - 1];
          children2[i2 - 1].next = children2[i2];
        }
        return children2;
      }
      return node$1;
    }
    var hasRequiredLib$a;
    function requireLib$a() {
      if (hasRequiredLib$a) return lib$7;
      hasRequiredLib$a = 1;
      (function(exports2) {
        var __createBinding2 = lib$7 && lib$7.__createBinding || (Object.create ? (function(o, m, k2, k22) {
          if (k22 === void 0) k22 = k2;
          var desc = Object.getOwnPropertyDescriptor(m, k2);
          if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
            desc = { enumerable: true, get: function() {
              return m[k2];
            } };
          }
          Object.defineProperty(o, k22, desc);
        }) : (function(o, m, k2, k22) {
          if (k22 === void 0) k22 = k2;
          o[k22] = m[k2];
        }));
        var __exportStar2 = lib$7 && lib$7.__exportStar || function(m, exports3) {
          for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p)) __createBinding2(exports3, m, p);
        };
        Object.defineProperty(exports2, "__esModule", { value: true });
        exports2.DomHandler = void 0;
        var domelementtype_1 = /* @__PURE__ */ requireLib$b();
        var node_1 = /* @__PURE__ */ requireNode();
        __exportStar2(/* @__PURE__ */ requireNode(), exports2);
        var reWhitespace = /\s+/g;
        var defaultOpts = {
          normalizeWhitespace: false,
          withStartIndices: false,
          withEndIndices: false,
          xmlMode: false
        };
        var DomHandler = (
          /** @class */
          (function() {
            function DomHandler2(callback, options2, elementCB) {
              this.dom = [];
              this.root = new node_1.Document(this.dom);
              this.done = false;
              this.tagStack = [this.root];
              this.lastNode = null;
              this.parser = null;
              if (typeof options2 === "function") {
                elementCB = options2;
                options2 = defaultOpts;
              }
              if (typeof callback === "object") {
                options2 = callback;
                callback = void 0;
              }
              this.callback = callback !== null && callback !== void 0 ? callback : null;
              this.options = options2 !== null && options2 !== void 0 ? options2 : defaultOpts;
              this.elementCB = elementCB !== null && elementCB !== void 0 ? elementCB : null;
            }
            DomHandler2.prototype.onparserinit = function(parser2) {
              this.parser = parser2;
            };
            DomHandler2.prototype.onreset = function() {
              this.dom = [];
              this.root = new node_1.Document(this.dom);
              this.done = false;
              this.tagStack = [this.root];
              this.lastNode = null;
              this.parser = null;
            };
            DomHandler2.prototype.onend = function() {
              if (this.done)
                return;
              this.done = true;
              this.parser = null;
              this.handleCallback(null);
            };
            DomHandler2.prototype.onerror = function(error2) {
              this.handleCallback(error2);
            };
            DomHandler2.prototype.onclosetag = function() {
              this.lastNode = null;
              var elem = this.tagStack.pop();
              if (this.options.withEndIndices) {
                elem.endIndex = this.parser.endIndex;
              }
              if (this.elementCB)
                this.elementCB(elem);
            };
            DomHandler2.prototype.onopentag = function(name2, attribs) {
              var type = this.options.xmlMode ? domelementtype_1.ElementType.Tag : void 0;
              var element = new node_1.Element(name2, attribs, void 0, type);
              this.addNode(element);
              this.tagStack.push(element);
            };
            DomHandler2.prototype.ontext = function(data) {
              var normalizeWhitespace = this.options.normalizeWhitespace;
              var lastNode = this.lastNode;
              if (lastNode && lastNode.type === domelementtype_1.ElementType.Text) {
                if (normalizeWhitespace) {
                  lastNode.data = (lastNode.data + data).replace(reWhitespace, " ");
                } else {
                  lastNode.data += data;
                }
                if (this.options.withEndIndices) {
                  lastNode.endIndex = this.parser.endIndex;
                }
              } else {
                if (normalizeWhitespace) {
                  data = data.replace(reWhitespace, " ");
                }
                var node2 = new node_1.Text(data);
                this.addNode(node2);
                this.lastNode = node2;
              }
            };
            DomHandler2.prototype.oncomment = function(data) {
              if (this.lastNode && this.lastNode.type === domelementtype_1.ElementType.Comment) {
                this.lastNode.data += data;
                return;
              }
              var node2 = new node_1.Comment(data);
              this.addNode(node2);
              this.lastNode = node2;
            };
            DomHandler2.prototype.oncommentend = function() {
              this.lastNode = null;
            };
            DomHandler2.prototype.oncdatastart = function() {
              var text2 = new node_1.Text("");
              var node2 = new node_1.NodeWithChildren(domelementtype_1.ElementType.CDATA, [text2]);
              this.addNode(node2);
              text2.parent = node2;
              this.lastNode = text2;
            };
            DomHandler2.prototype.oncdataend = function() {
              this.lastNode = null;
            };
            DomHandler2.prototype.onprocessinginstruction = function(name2, data) {
              var node2 = new node_1.ProcessingInstruction(name2, data);
              this.addNode(node2);
            };
            DomHandler2.prototype.handleCallback = function(error2) {
              if (typeof this.callback === "function") {
                this.callback(error2, this.dom);
              } else if (error2) {
                throw error2;
              }
            };
            DomHandler2.prototype.addNode = function(node2) {
              var parent = this.tagStack[this.tagStack.length - 1];
              var previousSibling = parent.children[parent.children.length - 1];
              if (this.options.withStartIndices) {
                node2.startIndex = this.parser.startIndex;
              }
              if (this.options.withEndIndices) {
                node2.endIndex = this.parser.endIndex;
              }
              parent.children.push(node2);
              if (previousSibling) {
                node2.prev = previousSibling;
                previousSibling.next = node2;
              }
              node2.parent = parent;
              this.lastNode = null;
            };
            return DomHandler2;
          })()
        );
        exports2.DomHandler = DomHandler;
        exports2.default = DomHandler;
      })(lib$7);
      return lib$7;
    }
    var lib$5 = {};
    var lib$4 = {};
    var decode = {};
    const Aacute$1 = "Á";
    const aacute$1 = "á";
    const Abreve = "Ă";
    const abreve = "ă";
    const ac = "∾";
    const acd = "∿";
    const acE = "∾̳";
    const Acirc$1 = "Â";
    const acirc$1 = "â";
    const acute$1 = "´";
    const Acy = "А";
    const acy = "а";
    const AElig$1 = "Æ";
    const aelig$1 = "æ";
    const af = "⁡";
    const Afr = "𝔄";
    const afr = "𝔞";
    const Agrave$1 = "À";
    const agrave$1 = "à";
    const alefsym = "ℵ";
    const aleph = "ℵ";
    const Alpha = "Α";
    const alpha = "α";
    const Amacr = "Ā";
    const amacr = "ā";
    const amalg = "⨿";
    const amp$2 = "&";
    const AMP$1 = "&";
    const andand = "⩕";
    const And = "⩓";
    const and = "∧";
    const andd = "⩜";
    const andslope = "⩘";
    const andv = "⩚";
    const ang = "∠";
    const ange = "⦤";
    const angle = "∠";
    const angmsdaa = "⦨";
    const angmsdab = "⦩";
    const angmsdac = "⦪";
    const angmsdad = "⦫";
    const angmsdae = "⦬";
    const angmsdaf = "⦭";
    const angmsdag = "⦮";
    const angmsdah = "⦯";
    const angmsd = "∡";
    const angrt = "∟";
    const angrtvb = "⊾";
    const angrtvbd = "⦝";
    const angsph = "∢";
    const angst = "Å";
    const angzarr = "⍼";
    const Aogon = "Ą";
    const aogon = "ą";
    const Aopf = "𝔸";
    const aopf = "𝕒";
    const apacir = "⩯";
    const ap = "≈";
    const apE = "⩰";
    const ape = "≊";
    const apid = "≋";
    const apos$1 = "'";
    const ApplyFunction = "⁡";
    const approx = "≈";
    const approxeq = "≊";
    const Aring$1 = "Å";
    const aring$1 = "å";
    const Ascr = "𝒜";
    const ascr = "𝒶";
    const Assign = "≔";
    const ast = "*";
    const asymp = "≈";
    const asympeq = "≍";
    const Atilde$1 = "Ã";
    const atilde$1 = "ã";
    const Auml$1 = "Ä";
    const auml$1 = "ä";
    const awconint = "∳";
    const awint = "⨑";
    const backcong = "≌";
    const backepsilon = "϶";
    const backprime = "‵";
    const backsim = "∽";
    const backsimeq = "⋍";
    const Backslash = "∖";
    const Barv = "⫧";
    const barvee = "⊽";
    const barwed = "⌅";
    const Barwed = "⌆";
    const barwedge = "⌅";
    const bbrk = "⎵";
    const bbrktbrk = "⎶";
    const bcong = "≌";
    const Bcy = "Б";
    const bcy = "б";
    const bdquo = "„";
    const becaus = "∵";
    const because = "∵";
    const Because = "∵";
    const bemptyv = "⦰";
    const bepsi = "϶";
    const bernou = "ℬ";
    const Bernoullis = "ℬ";
    const Beta = "Β";
    const beta = "β";
    const beth = "ℶ";
    const between = "≬";
    const Bfr = "𝔅";
    const bfr = "𝔟";
    const bigcap = "⋂";
    const bigcirc = "◯";
    const bigcup = "⋃";
    const bigodot = "⨀";
    const bigoplus = "⨁";
    const bigotimes = "⨂";
    const bigsqcup = "⨆";
    const bigstar = "★";
    const bigtriangledown = "▽";
    const bigtriangleup = "△";
    const biguplus = "⨄";
    const bigvee = "⋁";
    const bigwedge = "⋀";
    const bkarow = "⤍";
    const blacklozenge = "⧫";
    const blacksquare = "▪";
    const blacktriangle = "▴";
    const blacktriangledown = "▾";
    const blacktriangleleft = "◂";
    const blacktriangleright = "▸";
    const blank = "␣";
    const blk12 = "▒";
    const blk14 = "░";
    const blk34 = "▓";
    const block = "█";
    const bne = "=⃥";
    const bnequiv = "≡⃥";
    const bNot = "⫭";
    const bnot = "⌐";
    const Bopf = "𝔹";
    const bopf = "𝕓";
    const bot = "⊥";
    const bottom$1 = "⊥";
    const bowtie = "⋈";
    const boxbox = "⧉";
    const boxdl = "┐";
    const boxdL = "╕";
    const boxDl = "╖";
    const boxDL = "╗";
    const boxdr = "┌";
    const boxdR = "╒";
    const boxDr = "╓";
    const boxDR = "╔";
    const boxh = "─";
    const boxH = "═";
    const boxhd = "┬";
    const boxHd = "╤";
    const boxhD = "╥";
    const boxHD = "╦";
    const boxhu = "┴";
    const boxHu = "╧";
    const boxhU = "╨";
    const boxHU = "╩";
    const boxminus = "⊟";
    const boxplus = "⊞";
    const boxtimes = "⊠";
    const boxul = "┘";
    const boxuL = "╛";
    const boxUl = "╜";
    const boxUL = "╝";
    const boxur = "└";
    const boxuR = "╘";
    const boxUr = "╙";
    const boxUR = "╚";
    const boxv = "│";
    const boxV = "║";
    const boxvh = "┼";
    const boxvH = "╪";
    const boxVh = "╫";
    const boxVH = "╬";
    const boxvl = "┤";
    const boxvL = "╡";
    const boxVl = "╢";
    const boxVL = "╣";
    const boxvr = "├";
    const boxvR = "╞";
    const boxVr = "╟";
    const boxVR = "╠";
    const bprime = "‵";
    const breve = "˘";
    const Breve = "˘";
    const brvbar$1 = "¦";
    const bscr = "𝒷";
    const Bscr = "ℬ";
    const bsemi = "⁏";
    const bsim = "∽";
    const bsime = "⋍";
    const bsolb = "⧅";
    const bsol = "\\";
    const bsolhsub = "⟈";
    const bull = "•";
    const bullet = "•";
    const bump = "≎";
    const bumpE = "⪮";
    const bumpe = "≏";
    const Bumpeq = "≎";
    const bumpeq = "≏";
    const Cacute = "Ć";
    const cacute = "ć";
    const capand = "⩄";
    const capbrcup = "⩉";
    const capcap = "⩋";
    const cap = "∩";
    const Cap = "⋒";
    const capcup = "⩇";
    const capdot = "⩀";
    const CapitalDifferentialD = "ⅅ";
    const caps = "∩︀";
    const caret = "⁁";
    const caron = "ˇ";
    const Cayleys = "ℭ";
    const ccaps = "⩍";
    const Ccaron = "Č";
    const ccaron = "č";
    const Ccedil$1 = "Ç";
    const ccedil$1 = "ç";
    const Ccirc = "Ĉ";
    const ccirc = "ĉ";
    const Cconint = "∰";
    const ccups = "⩌";
    const ccupssm = "⩐";
    const Cdot = "Ċ";
    const cdot = "ċ";
    const cedil$1 = "¸";
    const Cedilla = "¸";
    const cemptyv = "⦲";
    const cent$1 = "¢";
    const centerdot = "·";
    const CenterDot = "·";
    const cfr = "𝔠";
    const Cfr = "ℭ";
    const CHcy = "Ч";
    const chcy = "ч";
    const check = "✓";
    const checkmark = "✓";
    const Chi = "Χ";
    const chi = "χ";
    const circ = "ˆ";
    const circeq = "≗";
    const circlearrowleft = "↺";
    const circlearrowright = "↻";
    const circledast = "⊛";
    const circledcirc = "⊚";
    const circleddash = "⊝";
    const CircleDot = "⊙";
    const circledR = "®";
    const circledS = "Ⓢ";
    const CircleMinus = "⊖";
    const CirclePlus = "⊕";
    const CircleTimes = "⊗";
    const cir = "○";
    const cirE = "⧃";
    const cire = "≗";
    const cirfnint = "⨐";
    const cirmid = "⫯";
    const cirscir = "⧂";
    const ClockwiseContourIntegral = "∲";
    const CloseCurlyDoubleQuote = "”";
    const CloseCurlyQuote = "’";
    const clubs = "♣";
    const clubsuit = "♣";
    const colon = ":";
    const Colon = "∷";
    const Colone = "⩴";
    const colone = "≔";
    const coloneq = "≔";
    const comma = ",";
    const commat = "@";
    const comp = "∁";
    const compfn = "∘";
    const complement = "∁";
    const complexes = "ℂ";
    const cong = "≅";
    const congdot = "⩭";
    const Congruent = "≡";
    const conint = "∮";
    const Conint = "∯";
    const ContourIntegral = "∮";
    const copf = "𝕔";
    const Copf = "ℂ";
    const coprod = "∐";
    const Coproduct = "∐";
    const copy$1 = "©";
    const COPY$1 = "©";
    const copysr = "℗";
    const CounterClockwiseContourIntegral = "∳";
    const crarr = "↵";
    const cross = "✗";
    const Cross = "⨯";
    const Cscr = "𝒞";
    const cscr = "𝒸";
    const csub = "⫏";
    const csube = "⫑";
    const csup = "⫐";
    const csupe = "⫒";
    const ctdot = "⋯";
    const cudarrl = "⤸";
    const cudarrr = "⤵";
    const cuepr = "⋞";
    const cuesc = "⋟";
    const cularr = "↶";
    const cularrp = "⤽";
    const cupbrcap = "⩈";
    const cupcap = "⩆";
    const CupCap = "≍";
    const cup = "∪";
    const Cup = "⋓";
    const cupcup = "⩊";
    const cupdot = "⊍";
    const cupor = "⩅";
    const cups = "∪︀";
    const curarr = "↷";
    const curarrm = "⤼";
    const curlyeqprec = "⋞";
    const curlyeqsucc = "⋟";
    const curlyvee = "⋎";
    const curlywedge = "⋏";
    const curren$1 = "¤";
    const curvearrowleft = "↶";
    const curvearrowright = "↷";
    const cuvee = "⋎";
    const cuwed = "⋏";
    const cwconint = "∲";
    const cwint = "∱";
    const cylcty = "⌭";
    const dagger = "†";
    const Dagger = "‡";
    const daleth = "ℸ";
    const darr = "↓";
    const Darr = "↡";
    const dArr = "⇓";
    const dash = "‐";
    const Dashv = "⫤";
    const dashv = "⊣";
    const dbkarow = "⤏";
    const dblac = "˝";
    const Dcaron = "Ď";
    const dcaron = "ď";
    const Dcy = "Д";
    const dcy = "д";
    const ddagger = "‡";
    const ddarr = "⇊";
    const DD = "ⅅ";
    const dd = "ⅆ";
    const DDotrahd = "⤑";
    const ddotseq = "⩷";
    const deg$1 = "°";
    const Del = "∇";
    const Delta = "Δ";
    const delta = "δ";
    const demptyv = "⦱";
    const dfisht = "⥿";
    const Dfr = "𝔇";
    const dfr = "𝔡";
    const dHar = "⥥";
    const dharl = "⇃";
    const dharr = "⇂";
    const DiacriticalAcute = "´";
    const DiacriticalDot = "˙";
    const DiacriticalDoubleAcute = "˝";
    const DiacriticalGrave = "`";
    const DiacriticalTilde = "˜";
    const diam = "⋄";
    const diamond = "⋄";
    const Diamond = "⋄";
    const diamondsuit = "♦";
    const diams = "♦";
    const die = "¨";
    const DifferentialD = "ⅆ";
    const digamma = "ϝ";
    const disin = "⋲";
    const div = "÷";
    const divide$1 = "÷";
    const divideontimes = "⋇";
    const divonx = "⋇";
    const DJcy = "Ђ";
    const djcy = "ђ";
    const dlcorn = "⌞";
    const dlcrop = "⌍";
    const dollar = "$";
    const Dopf = "𝔻";
    const dopf = "𝕕";
    const Dot = "¨";
    const dot$1 = "˙";
    const DotDot = "⃜";
    const doteq = "≐";
    const doteqdot = "≑";
    const DotEqual = "≐";
    const dotminus = "∸";
    const dotplus = "∔";
    const dotsquare = "⊡";
    const doublebarwedge = "⌆";
    const DoubleContourIntegral = "∯";
    const DoubleDot = "¨";
    const DoubleDownArrow = "⇓";
    const DoubleLeftArrow = "⇐";
    const DoubleLeftRightArrow = "⇔";
    const DoubleLeftTee = "⫤";
    const DoubleLongLeftArrow = "⟸";
    const DoubleLongLeftRightArrow = "⟺";
    const DoubleLongRightArrow = "⟹";
    const DoubleRightArrow = "⇒";
    const DoubleRightTee = "⊨";
    const DoubleUpArrow = "⇑";
    const DoubleUpDownArrow = "⇕";
    const DoubleVerticalBar = "∥";
    const DownArrowBar = "⤓";
    const downarrow = "↓";
    const DownArrow = "↓";
    const Downarrow = "⇓";
    const DownArrowUpArrow = "⇵";
    const DownBreve = "̑";
    const downdownarrows = "⇊";
    const downharpoonleft = "⇃";
    const downharpoonright = "⇂";
    const DownLeftRightVector = "⥐";
    const DownLeftTeeVector = "⥞";
    const DownLeftVectorBar = "⥖";
    const DownLeftVector = "↽";
    const DownRightTeeVector = "⥟";
    const DownRightVectorBar = "⥗";
    const DownRightVector = "⇁";
    const DownTeeArrow = "↧";
    const DownTee = "⊤";
    const drbkarow = "⤐";
    const drcorn = "⌟";
    const drcrop = "⌌";
    const Dscr = "𝒟";
    const dscr = "𝒹";
    const DScy = "Ѕ";
    const dscy = "ѕ";
    const dsol = "⧶";
    const Dstrok = "Đ";
    const dstrok = "đ";
    const dtdot = "⋱";
    const dtri = "▿";
    const dtrif = "▾";
    const duarr = "⇵";
    const duhar = "⥯";
    const dwangle = "⦦";
    const DZcy = "Џ";
    const dzcy = "џ";
    const dzigrarr = "⟿";
    const Eacute$1 = "É";
    const eacute$1 = "é";
    const easter = "⩮";
    const Ecaron = "Ě";
    const ecaron = "ě";
    const Ecirc$1 = "Ê";
    const ecirc$1 = "ê";
    const ecir = "≖";
    const ecolon = "≕";
    const Ecy = "Э";
    const ecy = "э";
    const eDDot = "⩷";
    const Edot = "Ė";
    const edot = "ė";
    const eDot = "≑";
    const ee = "ⅇ";
    const efDot = "≒";
    const Efr = "𝔈";
    const efr = "𝔢";
    const eg = "⪚";
    const Egrave$1 = "È";
    const egrave$1 = "è";
    const egs = "⪖";
    const egsdot = "⪘";
    const el = "⪙";
    const Element$1 = "∈";
    const elinters = "⏧";
    const ell = "ℓ";
    const els = "⪕";
    const elsdot = "⪗";
    const Emacr = "Ē";
    const emacr = "ē";
    const empty = "∅";
    const emptyset = "∅";
    const EmptySmallSquare = "◻";
    const emptyv = "∅";
    const EmptyVerySmallSquare = "▫";
    const emsp13 = " ";
    const emsp14 = " ";
    const emsp = " ";
    const ENG = "Ŋ";
    const eng = "ŋ";
    const ensp = " ";
    const Eogon = "Ę";
    const eogon = "ę";
    const Eopf = "𝔼";
    const eopf = "𝕖";
    const epar = "⋕";
    const eparsl = "⧣";
    const eplus = "⩱";
    const epsi = "ε";
    const Epsilon$1 = "Ε";
    const epsilon = "ε";
    const epsiv = "ϵ";
    const eqcirc = "≖";
    const eqcolon = "≕";
    const eqsim = "≂";
    const eqslantgtr = "⪖";
    const eqslantless = "⪕";
    const Equal = "⩵";
    const equals = "=";
    const EqualTilde = "≂";
    const equest = "≟";
    const Equilibrium = "⇌";
    const equiv = "≡";
    const equivDD = "⩸";
    const eqvparsl = "⧥";
    const erarr = "⥱";
    const erDot = "≓";
    const escr = "ℯ";
    const Escr = "ℰ";
    const esdot = "≐";
    const Esim = "⩳";
    const esim = "≂";
    const Eta = "Η";
    const eta = "η";
    const ETH$1 = "Ð";
    const eth$1 = "ð";
    const Euml$1 = "Ë";
    const euml$1 = "ë";
    const euro = "€";
    const excl = "!";
    const exist = "∃";
    const Exists = "∃";
    const expectation = "ℰ";
    const exponentiale = "ⅇ";
    const ExponentialE = "ⅇ";
    const fallingdotseq = "≒";
    const Fcy = "Ф";
    const fcy = "ф";
    const female = "♀";
    const ffilig = "ﬃ";
    const fflig = "ﬀ";
    const ffllig = "ﬄ";
    const Ffr = "𝔉";
    const ffr = "𝔣";
    const filig = "ﬁ";
    const FilledSmallSquare = "◼";
    const FilledVerySmallSquare = "▪";
    const fjlig = "fj";
    const flat = "♭";
    const fllig = "ﬂ";
    const fltns = "▱";
    const fnof = "ƒ";
    const Fopf = "𝔽";
    const fopf = "𝕗";
    const forall = "∀";
    const ForAll = "∀";
    const fork = "⋔";
    const forkv = "⫙";
    const Fouriertrf = "ℱ";
    const fpartint = "⨍";
    const frac12$1 = "½";
    const frac13 = "⅓";
    const frac14$1 = "¼";
    const frac15 = "⅕";
    const frac16 = "⅙";
    const frac18 = "⅛";
    const frac23 = "⅔";
    const frac25 = "⅖";
    const frac34$1 = "¾";
    const frac35 = "⅗";
    const frac38 = "⅜";
    const frac45 = "⅘";
    const frac56 = "⅚";
    const frac58 = "⅝";
    const frac78 = "⅞";
    const frasl = "⁄";
    const frown = "⌢";
    const fscr = "𝒻";
    const Fscr = "ℱ";
    const gacute = "ǵ";
    const Gamma = "Γ";
    const gamma = "γ";
    const Gammad = "Ϝ";
    const gammad = "ϝ";
    const gap = "⪆";
    const Gbreve = "Ğ";
    const gbreve = "ğ";
    const Gcedil = "Ģ";
    const Gcirc = "Ĝ";
    const gcirc = "ĝ";
    const Gcy = "Г";
    const gcy = "г";
    const Gdot = "Ġ";
    const gdot = "ġ";
    const ge = "≥";
    const gE = "≧";
    const gEl = "⪌";
    const gel = "⋛";
    const geq = "≥";
    const geqq = "≧";
    const geqslant = "⩾";
    const gescc = "⪩";
    const ges = "⩾";
    const gesdot = "⪀";
    const gesdoto = "⪂";
    const gesdotol = "⪄";
    const gesl = "⋛︀";
    const gesles = "⪔";
    const Gfr = "𝔊";
    const gfr = "𝔤";
    const gg = "≫";
    const Gg = "⋙";
    const ggg = "⋙";
    const gimel = "ℷ";
    const GJcy = "Ѓ";
    const gjcy = "ѓ";
    const gla = "⪥";
    const gl = "≷";
    const glE = "⪒";
    const glj = "⪤";
    const gnap = "⪊";
    const gnapprox = "⪊";
    const gne = "⪈";
    const gnE = "≩";
    const gneq = "⪈";
    const gneqq = "≩";
    const gnsim = "⋧";
    const Gopf = "𝔾";
    const gopf = "𝕘";
    const grave = "`";
    const GreaterEqual = "≥";
    const GreaterEqualLess = "⋛";
    const GreaterFullEqual = "≧";
    const GreaterGreater = "⪢";
    const GreaterLess = "≷";
    const GreaterSlantEqual = "⩾";
    const GreaterTilde = "≳";
    const Gscr = "𝒢";
    const gscr = "ℊ";
    const gsim = "≳";
    const gsime = "⪎";
    const gsiml = "⪐";
    const gtcc = "⪧";
    const gtcir = "⩺";
    const gt$2 = ">";
    const GT$1 = ">";
    const Gt = "≫";
    const gtdot = "⋗";
    const gtlPar = "⦕";
    const gtquest = "⩼";
    const gtrapprox = "⪆";
    const gtrarr = "⥸";
    const gtrdot = "⋗";
    const gtreqless = "⋛";
    const gtreqqless = "⪌";
    const gtrless = "≷";
    const gtrsim = "≳";
    const gvertneqq = "≩︀";
    const gvnE = "≩︀";
    const Hacek = "ˇ";
    const hairsp = " ";
    const half = "½";
    const hamilt = "ℋ";
    const HARDcy = "Ъ";
    const hardcy = "ъ";
    const harrcir = "⥈";
    const harr = "↔";
    const hArr = "⇔";
    const harrw = "↭";
    const Hat = "^";
    const hbar = "ℏ";
    const Hcirc = "Ĥ";
    const hcirc = "ĥ";
    const hearts = "♥";
    const heartsuit = "♥";
    const hellip = "…";
    const hercon = "⊹";
    const hfr = "𝔥";
    const Hfr = "ℌ";
    const HilbertSpace = "ℋ";
    const hksearow = "⤥";
    const hkswarow = "⤦";
    const hoarr = "⇿";
    const homtht = "∻";
    const hookleftarrow = "↩";
    const hookrightarrow = "↪";
    const hopf = "𝕙";
    const Hopf = "ℍ";
    const horbar = "―";
    const HorizontalLine = "─";
    const hscr = "𝒽";
    const Hscr = "ℋ";
    const hslash = "ℏ";
    const Hstrok = "Ħ";
    const hstrok = "ħ";
    const HumpDownHump = "≎";
    const HumpEqual = "≏";
    const hybull = "⁃";
    const hyphen = "‐";
    const Iacute$1 = "Í";
    const iacute$1 = "í";
    const ic = "⁣";
    const Icirc$1 = "Î";
    const icirc$1 = "î";
    const Icy = "И";
    const icy = "и";
    const Idot = "İ";
    const IEcy = "Е";
    const iecy = "е";
    const iexcl$1 = "¡";
    const iff = "⇔";
    const ifr = "𝔦";
    const Ifr = "ℑ";
    const Igrave$1 = "Ì";
    const igrave$1 = "ì";
    const ii = "ⅈ";
    const iiiint = "⨌";
    const iiint = "∭";
    const iinfin = "⧜";
    const iiota = "℩";
    const IJlig = "Ĳ";
    const ijlig = "ĳ";
    const Imacr = "Ī";
    const imacr = "ī";
    const image$1 = "ℑ";
    const ImaginaryI = "ⅈ";
    const imagline = "ℐ";
    const imagpart = "ℑ";
    const imath = "ı";
    const Im = "ℑ";
    const imof = "⊷";
    const imped = "Ƶ";
    const Implies = "⇒";
    const incare = "℅";
    const infin = "∞";
    const infintie = "⧝";
    const inodot = "ı";
    const intcal = "⊺";
    const int = "∫";
    const Int = "∬";
    const integers = "ℤ";
    const Integral = "∫";
    const intercal = "⊺";
    const Intersection = "⋂";
    const intlarhk = "⨗";
    const intprod = "⨼";
    const InvisibleComma = "⁣";
    const InvisibleTimes = "⁢";
    const IOcy = "Ё";
    const iocy = "ё";
    const Iogon = "Į";
    const iogon = "į";
    const Iopf = "𝕀";
    const iopf = "𝕚";
    const Iota = "Ι";
    const iota = "ι";
    const iprod = "⨼";
    const iquest$1 = "¿";
    const iscr = "𝒾";
    const Iscr = "ℐ";
    const isin = "∈";
    const isindot = "⋵";
    const isinE = "⋹";
    const isins = "⋴";
    const isinsv = "⋳";
    const isinv = "∈";
    const it = "⁢";
    const Itilde = "Ĩ";
    const itilde = "ĩ";
    const Iukcy = "І";
    const iukcy = "і";
    const Iuml$1 = "Ï";
    const iuml$1 = "ï";
    const Jcirc = "Ĵ";
    const jcirc = "ĵ";
    const Jcy = "Й";
    const jcy = "й";
    const Jfr = "𝔍";
    const jfr = "𝔧";
    const jmath = "ȷ";
    const Jopf = "𝕁";
    const jopf = "𝕛";
    const Jscr = "𝒥";
    const jscr = "𝒿";
    const Jsercy = "Ј";
    const jsercy = "ј";
    const Jukcy = "Є";
    const jukcy = "є";
    const Kappa = "Κ";
    const kappa = "κ";
    const kappav = "ϰ";
    const Kcedil = "Ķ";
    const kcedil = "ķ";
    const Kcy = "К";
    const kcy = "к";
    const Kfr = "𝔎";
    const kfr = "𝔨";
    const kgreen = "ĸ";
    const KHcy = "Х";
    const khcy = "х";
    const KJcy = "Ќ";
    const kjcy = "ќ";
    const Kopf = "𝕂";
    const kopf = "𝕜";
    const Kscr = "𝒦";
    const kscr = "𝓀";
    const lAarr = "⇚";
    const Lacute = "Ĺ";
    const lacute = "ĺ";
    const laemptyv = "⦴";
    const lagran = "ℒ";
    const Lambda = "Λ";
    const lambda = "λ";
    const lang = "⟨";
    const Lang = "⟪";
    const langd = "⦑";
    const langle = "⟨";
    const lap = "⪅";
    const Laplacetrf = "ℒ";
    const laquo$1 = "«";
    const larrb = "⇤";
    const larrbfs = "⤟";
    const larr = "←";
    const Larr = "↞";
    const lArr = "⇐";
    const larrfs = "⤝";
    const larrhk = "↩";
    const larrlp = "↫";
    const larrpl = "⤹";
    const larrsim = "⥳";
    const larrtl = "↢";
    const latail = "⤙";
    const lAtail = "⤛";
    const lat = "⪫";
    const late = "⪭";
    const lates = "⪭︀";
    const lbarr = "⤌";
    const lBarr = "⤎";
    const lbbrk = "❲";
    const lbrace = "{";
    const lbrack = "[";
    const lbrke = "⦋";
    const lbrksld = "⦏";
    const lbrkslu = "⦍";
    const Lcaron = "Ľ";
    const lcaron = "ľ";
    const Lcedil = "Ļ";
    const lcedil = "ļ";
    const lceil = "⌈";
    const lcub = "{";
    const Lcy = "Л";
    const lcy = "л";
    const ldca = "⤶";
    const ldquo = "“";
    const ldquor = "„";
    const ldrdhar = "⥧";
    const ldrushar = "⥋";
    const ldsh = "↲";
    const le = "≤";
    const lE = "≦";
    const LeftAngleBracket = "⟨";
    const LeftArrowBar = "⇤";
    const leftarrow = "←";
    const LeftArrow = "←";
    const Leftarrow = "⇐";
    const LeftArrowRightArrow = "⇆";
    const leftarrowtail = "↢";
    const LeftCeiling = "⌈";
    const LeftDoubleBracket = "⟦";
    const LeftDownTeeVector = "⥡";
    const LeftDownVectorBar = "⥙";
    const LeftDownVector = "⇃";
    const LeftFloor = "⌊";
    const leftharpoondown = "↽";
    const leftharpoonup = "↼";
    const leftleftarrows = "⇇";
    const leftrightarrow = "↔";
    const LeftRightArrow = "↔";
    const Leftrightarrow = "⇔";
    const leftrightarrows = "⇆";
    const leftrightharpoons = "⇋";
    const leftrightsquigarrow = "↭";
    const LeftRightVector = "⥎";
    const LeftTeeArrow = "↤";
    const LeftTee = "⊣";
    const LeftTeeVector = "⥚";
    const leftthreetimes = "⋋";
    const LeftTriangleBar = "⧏";
    const LeftTriangle = "⊲";
    const LeftTriangleEqual = "⊴";
    const LeftUpDownVector = "⥑";
    const LeftUpTeeVector = "⥠";
    const LeftUpVectorBar = "⥘";
    const LeftUpVector = "↿";
    const LeftVectorBar = "⥒";
    const LeftVector = "↼";
    const lEg = "⪋";
    const leg = "⋚";
    const leq = "≤";
    const leqq = "≦";
    const leqslant = "⩽";
    const lescc = "⪨";
    const les = "⩽";
    const lesdot = "⩿";
    const lesdoto = "⪁";
    const lesdotor = "⪃";
    const lesg = "⋚︀";
    const lesges = "⪓";
    const lessapprox = "⪅";
    const lessdot = "⋖";
    const lesseqgtr = "⋚";
    const lesseqqgtr = "⪋";
    const LessEqualGreater = "⋚";
    const LessFullEqual = "≦";
    const LessGreater = "≶";
    const lessgtr = "≶";
    const LessLess = "⪡";
    const lesssim = "≲";
    const LessSlantEqual = "⩽";
    const LessTilde = "≲";
    const lfisht = "⥼";
    const lfloor = "⌊";
    const Lfr = "𝔏";
    const lfr = "𝔩";
    const lg = "≶";
    const lgE = "⪑";
    const lHar = "⥢";
    const lhard = "↽";
    const lharu = "↼";
    const lharul = "⥪";
    const lhblk = "▄";
    const LJcy = "Љ";
    const ljcy = "љ";
    const llarr = "⇇";
    const ll = "≪";
    const Ll = "⋘";
    const llcorner = "⌞";
    const Lleftarrow = "⇚";
    const llhard = "⥫";
    const lltri = "◺";
    const Lmidot = "Ŀ";
    const lmidot = "ŀ";
    const lmoustache = "⎰";
    const lmoust = "⎰";
    const lnap = "⪉";
    const lnapprox = "⪉";
    const lne = "⪇";
    const lnE = "≨";
    const lneq = "⪇";
    const lneqq = "≨";
    const lnsim = "⋦";
    const loang = "⟬";
    const loarr = "⇽";
    const lobrk = "⟦";
    const longleftarrow = "⟵";
    const LongLeftArrow = "⟵";
    const Longleftarrow = "⟸";
    const longleftrightarrow = "⟷";
    const LongLeftRightArrow = "⟷";
    const Longleftrightarrow = "⟺";
    const longmapsto = "⟼";
    const longrightarrow = "⟶";
    const LongRightArrow = "⟶";
    const Longrightarrow = "⟹";
    const looparrowleft = "↫";
    const looparrowright = "↬";
    const lopar = "⦅";
    const Lopf = "𝕃";
    const lopf = "𝕝";
    const loplus = "⨭";
    const lotimes = "⨴";
    const lowast = "∗";
    const lowbar = "_";
    const LowerLeftArrow = "↙";
    const LowerRightArrow = "↘";
    const loz = "◊";
    const lozenge = "◊";
    const lozf = "⧫";
    const lpar = "(";
    const lparlt = "⦓";
    const lrarr = "⇆";
    const lrcorner = "⌟";
    const lrhar = "⇋";
    const lrhard = "⥭";
    const lrm = "‎";
    const lrtri = "⊿";
    const lsaquo = "‹";
    const lscr = "𝓁";
    const Lscr = "ℒ";
    const lsh = "↰";
    const Lsh = "↰";
    const lsim = "≲";
    const lsime = "⪍";
    const lsimg = "⪏";
    const lsqb = "[";
    const lsquo = "‘";
    const lsquor = "‚";
    const Lstrok = "Ł";
    const lstrok = "ł";
    const ltcc = "⪦";
    const ltcir = "⩹";
    const lt$2 = "<";
    const LT$1 = "<";
    const Lt = "≪";
    const ltdot = "⋖";
    const lthree = "⋋";
    const ltimes = "⋉";
    const ltlarr = "⥶";
    const ltquest = "⩻";
    const ltri = "◃";
    const ltrie = "⊴";
    const ltrif = "◂";
    const ltrPar = "⦖";
    const lurdshar = "⥊";
    const luruhar = "⥦";
    const lvertneqq = "≨︀";
    const lvnE = "≨︀";
    const macr$1 = "¯";
    const male = "♂";
    const malt = "✠";
    const maltese = "✠";
    const map = "↦";
    const mapsto = "↦";
    const mapstodown = "↧";
    const mapstoleft = "↤";
    const mapstoup = "↥";
    const marker = "▮";
    const mcomma = "⨩";
    const Mcy = "М";
    const mcy = "м";
    const mdash = "—";
    const mDDot = "∺";
    const measuredangle = "∡";
    const MediumSpace = " ";
    const Mellintrf = "ℳ";
    const Mfr = "𝔐";
    const mfr = "𝔪";
    const mho = "℧";
    const micro$1 = "µ";
    const midast = "*";
    const midcir = "⫰";
    const mid = "∣";
    const middot$1 = "·";
    const minusb = "⊟";
    const minus = "−";
    const minusd = "∸";
    const minusdu = "⨪";
    const MinusPlus = "∓";
    const mlcp = "⫛";
    const mldr = "…";
    const mnplus = "∓";
    const models = "⊧";
    const Mopf = "𝕄";
    const mopf = "𝕞";
    const mp = "∓";
    const mscr = "𝓂";
    const Mscr = "ℳ";
    const mstpos = "∾";
    const Mu = "Μ";
    const mu = "μ";
    const multimap = "⊸";
    const mumap = "⊸";
    const nabla = "∇";
    const Nacute = "Ń";
    const nacute = "ń";
    const nang = "∠⃒";
    const nap = "≉";
    const napE = "⩰̸";
    const napid = "≋̸";
    const napos = "ŉ";
    const napprox = "≉";
    const natural = "♮";
    const naturals = "ℕ";
    const natur = "♮";
    const nbsp$1 = " ";
    const nbump = "≎̸";
    const nbumpe = "≏̸";
    const ncap = "⩃";
    const Ncaron = "Ň";
    const ncaron = "ň";
    const Ncedil = "Ņ";
    const ncedil = "ņ";
    const ncong = "≇";
    const ncongdot = "⩭̸";
    const ncup = "⩂";
    const Ncy = "Н";
    const ncy = "н";
    const ndash = "–";
    const nearhk = "⤤";
    const nearr = "↗";
    const neArr = "⇗";
    const nearrow = "↗";
    const ne = "≠";
    const nedot = "≐̸";
    const NegativeMediumSpace = "​";
    const NegativeThickSpace = "​";
    const NegativeThinSpace = "​";
    const NegativeVeryThinSpace = "​";
    const nequiv = "≢";
    const nesear = "⤨";
    const nesim = "≂̸";
    const NestedGreaterGreater = "≫";
    const NestedLessLess = "≪";
    const NewLine = "\n";
    const nexist = "∄";
    const nexists = "∄";
    const Nfr = "𝔑";
    const nfr = "𝔫";
    const ngE = "≧̸";
    const nge = "≱";
    const ngeq = "≱";
    const ngeqq = "≧̸";
    const ngeqslant = "⩾̸";
    const nges = "⩾̸";
    const nGg = "⋙̸";
    const ngsim = "≵";
    const nGt = "≫⃒";
    const ngt = "≯";
    const ngtr = "≯";
    const nGtv = "≫̸";
    const nharr = "↮";
    const nhArr = "⇎";
    const nhpar = "⫲";
    const ni = "∋";
    const nis = "⋼";
    const nisd = "⋺";
    const niv = "∋";
    const NJcy = "Њ";
    const njcy = "њ";
    const nlarr = "↚";
    const nlArr = "⇍";
    const nldr = "‥";
    const nlE = "≦̸";
    const nle = "≰";
    const nleftarrow = "↚";
    const nLeftarrow = "⇍";
    const nleftrightarrow = "↮";
    const nLeftrightarrow = "⇎";
    const nleq = "≰";
    const nleqq = "≦̸";
    const nleqslant = "⩽̸";
    const nles = "⩽̸";
    const nless = "≮";
    const nLl = "⋘̸";
    const nlsim = "≴";
    const nLt = "≪⃒";
    const nlt = "≮";
    const nltri = "⋪";
    const nltrie = "⋬";
    const nLtv = "≪̸";
    const nmid = "∤";
    const NoBreak = "⁠";
    const NonBreakingSpace = " ";
    const nopf = "𝕟";
    const Nopf = "ℕ";
    const Not = "⫬";
    const not$1 = "¬";
    const NotCongruent = "≢";
    const NotCupCap = "≭";
    const NotDoubleVerticalBar = "∦";
    const NotElement = "∉";
    const NotEqual = "≠";
    const NotEqualTilde = "≂̸";
    const NotExists = "∄";
    const NotGreater = "≯";
    const NotGreaterEqual = "≱";
    const NotGreaterFullEqual = "≧̸";
    const NotGreaterGreater = "≫̸";
    const NotGreaterLess = "≹";
    const NotGreaterSlantEqual = "⩾̸";
    const NotGreaterTilde = "≵";
    const NotHumpDownHump = "≎̸";
    const NotHumpEqual = "≏̸";
    const notin = "∉";
    const notindot = "⋵̸";
    const notinE = "⋹̸";
    const notinva = "∉";
    const notinvb = "⋷";
    const notinvc = "⋶";
    const NotLeftTriangleBar = "⧏̸";
    const NotLeftTriangle = "⋪";
    const NotLeftTriangleEqual = "⋬";
    const NotLess = "≮";
    const NotLessEqual = "≰";
    const NotLessGreater = "≸";
    const NotLessLess = "≪̸";
    const NotLessSlantEqual = "⩽̸";
    const NotLessTilde = "≴";
    const NotNestedGreaterGreater = "⪢̸";
    const NotNestedLessLess = "⪡̸";
    const notni = "∌";
    const notniva = "∌";
    const notnivb = "⋾";
    const notnivc = "⋽";
    const NotPrecedes = "⊀";
    const NotPrecedesEqual = "⪯̸";
    const NotPrecedesSlantEqual = "⋠";
    const NotReverseElement = "∌";
    const NotRightTriangleBar = "⧐̸";
    const NotRightTriangle = "⋫";
    const NotRightTriangleEqual = "⋭";
    const NotSquareSubset = "⊏̸";
    const NotSquareSubsetEqual = "⋢";
    const NotSquareSuperset = "⊐̸";
    const NotSquareSupersetEqual = "⋣";
    const NotSubset = "⊂⃒";
    const NotSubsetEqual = "⊈";
    const NotSucceeds = "⊁";
    const NotSucceedsEqual = "⪰̸";
    const NotSucceedsSlantEqual = "⋡";
    const NotSucceedsTilde = "≿̸";
    const NotSuperset = "⊃⃒";
    const NotSupersetEqual = "⊉";
    const NotTilde = "≁";
    const NotTildeEqual = "≄";
    const NotTildeFullEqual = "≇";
    const NotTildeTilde = "≉";
    const NotVerticalBar = "∤";
    const nparallel = "∦";
    const npar = "∦";
    const nparsl = "⫽⃥";
    const npart = "∂̸";
    const npolint = "⨔";
    const npr = "⊀";
    const nprcue = "⋠";
    const nprec = "⊀";
    const npreceq = "⪯̸";
    const npre = "⪯̸";
    const nrarrc = "⤳̸";
    const nrarr = "↛";
    const nrArr = "⇏";
    const nrarrw = "↝̸";
    const nrightarrow = "↛";
    const nRightarrow = "⇏";
    const nrtri = "⋫";
    const nrtrie = "⋭";
    const nsc = "⊁";
    const nsccue = "⋡";
    const nsce = "⪰̸";
    const Nscr = "𝒩";
    const nscr = "𝓃";
    const nshortmid = "∤";
    const nshortparallel = "∦";
    const nsim = "≁";
    const nsime = "≄";
    const nsimeq = "≄";
    const nsmid = "∤";
    const nspar = "∦";
    const nsqsube = "⋢";
    const nsqsupe = "⋣";
    const nsub = "⊄";
    const nsubE = "⫅̸";
    const nsube = "⊈";
    const nsubset = "⊂⃒";
    const nsubseteq = "⊈";
    const nsubseteqq = "⫅̸";
    const nsucc = "⊁";
    const nsucceq = "⪰̸";
    const nsup = "⊅";
    const nsupE = "⫆̸";
    const nsupe = "⊉";
    const nsupset = "⊃⃒";
    const nsupseteq = "⊉";
    const nsupseteqq = "⫆̸";
    const ntgl = "≹";
    const Ntilde$1 = "Ñ";
    const ntilde$1 = "ñ";
    const ntlg = "≸";
    const ntriangleleft = "⋪";
    const ntrianglelefteq = "⋬";
    const ntriangleright = "⋫";
    const ntrianglerighteq = "⋭";
    const Nu = "Ν";
    const nu = "ν";
    const num$1 = "#";
    const numero = "№";
    const numsp = " ";
    const nvap = "≍⃒";
    const nvdash = "⊬";
    const nvDash = "⊭";
    const nVdash = "⊮";
    const nVDash = "⊯";
    const nvge = "≥⃒";
    const nvgt = ">⃒";
    const nvHarr = "⤄";
    const nvinfin = "⧞";
    const nvlArr = "⤂";
    const nvle = "≤⃒";
    const nvlt = "<⃒";
    const nvltrie = "⊴⃒";
    const nvrArr = "⤃";
    const nvrtrie = "⊵⃒";
    const nvsim = "∼⃒";
    const nwarhk = "⤣";
    const nwarr = "↖";
    const nwArr = "⇖";
    const nwarrow = "↖";
    const nwnear = "⤧";
    const Oacute$1 = "Ó";
    const oacute$1 = "ó";
    const oast = "⊛";
    const Ocirc$1 = "Ô";
    const ocirc$1 = "ô";
    const ocir = "⊚";
    const Ocy = "О";
    const ocy = "о";
    const odash = "⊝";
    const Odblac = "Ő";
    const odblac = "ő";
    const odiv = "⨸";
    const odot = "⊙";
    const odsold = "⦼";
    const OElig = "Œ";
    const oelig = "œ";
    const ofcir = "⦿";
    const Ofr = "𝔒";
    const ofr = "𝔬";
    const ogon = "˛";
    const Ograve$1 = "Ò";
    const ograve$1 = "ò";
    const ogt = "⧁";
    const ohbar = "⦵";
    const ohm = "Ω";
    const oint = "∮";
    const olarr = "↺";
    const olcir = "⦾";
    const olcross = "⦻";
    const oline = "‾";
    const olt = "⧀";
    const Omacr = "Ō";
    const omacr = "ō";
    const Omega = "Ω";
    const omega = "ω";
    const Omicron = "Ο";
    const omicron = "ο";
    const omid = "⦶";
    const ominus = "⊖";
    const Oopf = "𝕆";
    const oopf = "𝕠";
    const opar = "⦷";
    const OpenCurlyDoubleQuote = "“";
    const OpenCurlyQuote = "‘";
    const operp = "⦹";
    const oplus = "⊕";
    const orarr = "↻";
    const Or = "⩔";
    const or = "∨";
    const ord = "⩝";
    const order$1 = "ℴ";
    const orderof = "ℴ";
    const ordf$1 = "ª";
    const ordm$1 = "º";
    const origof = "⊶";
    const oror = "⩖";
    const orslope = "⩗";
    const orv = "⩛";
    const oS = "Ⓢ";
    const Oscr = "𝒪";
    const oscr = "ℴ";
    const Oslash$1 = "Ø";
    const oslash$1 = "ø";
    const osol = "⊘";
    const Otilde$1 = "Õ";
    const otilde$1 = "õ";
    const otimesas = "⨶";
    const Otimes = "⨷";
    const otimes = "⊗";
    const Ouml$1 = "Ö";
    const ouml$1 = "ö";
    const ovbar = "⌽";
    const OverBar = "‾";
    const OverBrace = "⏞";
    const OverBracket = "⎴";
    const OverParenthesis = "⏜";
    const para$1 = "¶";
    const parallel = "∥";
    const par = "∥";
    const parsim = "⫳";
    const parsl = "⫽";
    const part = "∂";
    const PartialD = "∂";
    const Pcy = "П";
    const pcy = "п";
    const percnt = "%";
    const period = ".";
    const permil = "‰";
    const perp = "⊥";
    const pertenk = "‱";
    const Pfr = "𝔓";
    const pfr = "𝔭";
    const Phi = "Φ";
    const phi = "φ";
    const phiv = "ϕ";
    const phmmat = "ℳ";
    const phone = "☎";
    const Pi = "Π";
    const pi = "π";
    const pitchfork = "⋔";
    const piv = "ϖ";
    const planck = "ℏ";
    const planckh = "ℎ";
    const plankv = "ℏ";
    const plusacir = "⨣";
    const plusb = "⊞";
    const pluscir = "⨢";
    const plus = "+";
    const plusdo = "∔";
    const plusdu = "⨥";
    const pluse = "⩲";
    const PlusMinus = "±";
    const plusmn$1 = "±";
    const plussim = "⨦";
    const plustwo = "⨧";
    const pm = "±";
    const Poincareplane = "ℌ";
    const pointint = "⨕";
    const popf = "𝕡";
    const Popf = "ℙ";
    const pound$1 = "£";
    const prap = "⪷";
    const Pr = "⪻";
    const pr = "≺";
    const prcue = "≼";
    const precapprox = "⪷";
    const prec$1 = "≺";
    const preccurlyeq = "≼";
    const Precedes = "≺";
    const PrecedesEqual = "⪯";
    const PrecedesSlantEqual = "≼";
    const PrecedesTilde = "≾";
    const preceq = "⪯";
    const precnapprox = "⪹";
    const precneqq = "⪵";
    const precnsim = "⋨";
    const pre = "⪯";
    const prE = "⪳";
    const precsim = "≾";
    const prime = "′";
    const Prime = "″";
    const primes = "ℙ";
    const prnap = "⪹";
    const prnE = "⪵";
    const prnsim = "⋨";
    const prod = "∏";
    const Product = "∏";
    const profalar = "⌮";
    const profline = "⌒";
    const profsurf = "⌓";
    const prop = "∝";
    const Proportional = "∝";
    const Proportion = "∷";
    const propto = "∝";
    const prsim = "≾";
    const prurel = "⊰";
    const Pscr = "𝒫";
    const pscr = "𝓅";
    const Psi = "Ψ";
    const psi = "ψ";
    const puncsp = " ";
    const Qfr = "𝔔";
    const qfr = "𝔮";
    const qint = "⨌";
    const qopf = "𝕢";
    const Qopf = "ℚ";
    const qprime = "⁗";
    const Qscr = "𝒬";
    const qscr = "𝓆";
    const quaternions = "ℍ";
    const quatint = "⨖";
    const quest = "?";
    const questeq = "≟";
    const quot$2 = '"';
    const QUOT$1 = '"';
    const rAarr = "⇛";
    const race = "∽̱";
    const Racute = "Ŕ";
    const racute = "ŕ";
    const radic = "√";
    const raemptyv = "⦳";
    const rang = "⟩";
    const Rang = "⟫";
    const rangd = "⦒";
    const range = "⦥";
    const rangle = "⟩";
    const raquo$1 = "»";
    const rarrap = "⥵";
    const rarrb = "⇥";
    const rarrbfs = "⤠";
    const rarrc = "⤳";
    const rarr = "→";
    const Rarr = "↠";
    const rArr = "⇒";
    const rarrfs = "⤞";
    const rarrhk = "↪";
    const rarrlp = "↬";
    const rarrpl = "⥅";
    const rarrsim = "⥴";
    const Rarrtl = "⤖";
    const rarrtl = "↣";
    const rarrw = "↝";
    const ratail = "⤚";
    const rAtail = "⤜";
    const ratio = "∶";
    const rationals = "ℚ";
    const rbarr = "⤍";
    const rBarr = "⤏";
    const RBarr = "⤐";
    const rbbrk = "❳";
    const rbrace = "}";
    const rbrack = "]";
    const rbrke = "⦌";
    const rbrksld = "⦎";
    const rbrkslu = "⦐";
    const Rcaron = "Ř";
    const rcaron = "ř";
    const Rcedil = "Ŗ";
    const rcedil = "ŗ";
    const rceil = "⌉";
    const rcub = "}";
    const Rcy = "Р";
    const rcy = "р";
    const rdca = "⤷";
    const rdldhar = "⥩";
    const rdquo = "”";
    const rdquor = "”";
    const rdsh = "↳";
    const real = "ℜ";
    const realine = "ℛ";
    const realpart = "ℜ";
    const reals = "ℝ";
    const Re = "ℜ";
    const rect = "▭";
    const reg$1 = "®";
    const REG$1 = "®";
    const ReverseElement = "∋";
    const ReverseEquilibrium = "⇋";
    const ReverseUpEquilibrium = "⥯";
    const rfisht = "⥽";
    const rfloor = "⌋";
    const rfr = "𝔯";
    const Rfr = "ℜ";
    const rHar = "⥤";
    const rhard = "⇁";
    const rharu = "⇀";
    const rharul = "⥬";
    const Rho = "Ρ";
    const rho = "ρ";
    const rhov = "ϱ";
    const RightAngleBracket = "⟩";
    const RightArrowBar = "⇥";
    const rightarrow = "→";
    const RightArrow = "→";
    const Rightarrow = "⇒";
    const RightArrowLeftArrow = "⇄";
    const rightarrowtail = "↣";
    const RightCeiling = "⌉";
    const RightDoubleBracket = "⟧";
    const RightDownTeeVector = "⥝";
    const RightDownVectorBar = "⥕";
    const RightDownVector = "⇂";
    const RightFloor = "⌋";
    const rightharpoondown = "⇁";
    const rightharpoonup = "⇀";
    const rightleftarrows = "⇄";
    const rightleftharpoons = "⇌";
    const rightrightarrows = "⇉";
    const rightsquigarrow = "↝";
    const RightTeeArrow = "↦";
    const RightTee = "⊢";
    const RightTeeVector = "⥛";
    const rightthreetimes = "⋌";
    const RightTriangleBar = "⧐";
    const RightTriangle = "⊳";
    const RightTriangleEqual = "⊵";
    const RightUpDownVector = "⥏";
    const RightUpTeeVector = "⥜";
    const RightUpVectorBar = "⥔";
    const RightUpVector = "↾";
    const RightVectorBar = "⥓";
    const RightVector = "⇀";
    const ring = "˚";
    const risingdotseq = "≓";
    const rlarr = "⇄";
    const rlhar = "⇌";
    const rlm = "‏";
    const rmoustache = "⎱";
    const rmoust = "⎱";
    const rnmid = "⫮";
    const roang = "⟭";
    const roarr = "⇾";
    const robrk = "⟧";
    const ropar = "⦆";
    const ropf = "𝕣";
    const Ropf = "ℝ";
    const roplus = "⨮";
    const rotimes = "⨵";
    const RoundImplies = "⥰";
    const rpar = ")";
    const rpargt = "⦔";
    const rppolint = "⨒";
    const rrarr = "⇉";
    const Rrightarrow = "⇛";
    const rsaquo = "›";
    const rscr = "𝓇";
    const Rscr = "ℛ";
    const rsh = "↱";
    const Rsh = "↱";
    const rsqb = "]";
    const rsquo = "’";
    const rsquor = "’";
    const rthree = "⋌";
    const rtimes = "⋊";
    const rtri = "▹";
    const rtrie = "⊵";
    const rtrif = "▸";
    const rtriltri = "⧎";
    const RuleDelayed = "⧴";
    const ruluhar = "⥨";
    const rx = "℞";
    const Sacute = "Ś";
    const sacute = "ś";
    const sbquo = "‚";
    const scap = "⪸";
    const Scaron = "Š";
    const scaron = "š";
    const Sc = "⪼";
    const sc = "≻";
    const sccue = "≽";
    const sce = "⪰";
    const scE = "⪴";
    const Scedil = "Ş";
    const scedil = "ş";
    const Scirc = "Ŝ";
    const scirc = "ŝ";
    const scnap = "⪺";
    const scnE = "⪶";
    const scnsim = "⋩";
    const scpolint = "⨓";
    const scsim = "≿";
    const Scy = "С";
    const scy = "с";
    const sdotb = "⊡";
    const sdot = "⋅";
    const sdote = "⩦";
    const searhk = "⤥";
    const searr = "↘";
    const seArr = "⇘";
    const searrow = "↘";
    const sect$1 = "§";
    const semi = ";";
    const seswar = "⤩";
    const setminus = "∖";
    const setmn = "∖";
    const sext = "✶";
    const Sfr = "𝔖";
    const sfr = "𝔰";
    const sfrown = "⌢";
    const sharp = "♯";
    const SHCHcy = "Щ";
    const shchcy = "щ";
    const SHcy = "Ш";
    const shcy = "ш";
    const ShortDownArrow = "↓";
    const ShortLeftArrow = "←";
    const shortmid = "∣";
    const shortparallel = "∥";
    const ShortRightArrow = "→";
    const ShortUpArrow = "↑";
    const shy$1 = "­";
    const Sigma = "Σ";
    const sigma = "σ";
    const sigmaf = "ς";
    const sigmav = "ς";
    const sim = "∼";
    const simdot = "⩪";
    const sime = "≃";
    const simeq = "≃";
    const simg = "⪞";
    const simgE = "⪠";
    const siml = "⪝";
    const simlE = "⪟";
    const simne = "≆";
    const simplus = "⨤";
    const simrarr = "⥲";
    const slarr = "←";
    const SmallCircle = "∘";
    const smallsetminus = "∖";
    const smashp = "⨳";
    const smeparsl = "⧤";
    const smid = "∣";
    const smile = "⌣";
    const smt = "⪪";
    const smte = "⪬";
    const smtes = "⪬︀";
    const SOFTcy = "Ь";
    const softcy = "ь";
    const solbar = "⌿";
    const solb = "⧄";
    const sol = "/";
    const Sopf = "𝕊";
    const sopf = "𝕤";
    const spades = "♠";
    const spadesuit = "♠";
    const spar = "∥";
    const sqcap = "⊓";
    const sqcaps = "⊓︀";
    const sqcup = "⊔";
    const sqcups = "⊔︀";
    const Sqrt = "√";
    const sqsub = "⊏";
    const sqsube = "⊑";
    const sqsubset = "⊏";
    const sqsubseteq = "⊑";
    const sqsup = "⊐";
    const sqsupe = "⊒";
    const sqsupset = "⊐";
    const sqsupseteq = "⊒";
    const square = "□";
    const Square = "□";
    const SquareIntersection = "⊓";
    const SquareSubset = "⊏";
    const SquareSubsetEqual = "⊑";
    const SquareSuperset = "⊐";
    const SquareSupersetEqual = "⊒";
    const SquareUnion = "⊔";
    const squarf = "▪";
    const squ = "□";
    const squf = "▪";
    const srarr = "→";
    const Sscr = "𝒮";
    const sscr = "𝓈";
    const ssetmn = "∖";
    const ssmile = "⌣";
    const sstarf = "⋆";
    const Star = "⋆";
    const star = "☆";
    const starf = "★";
    const straightepsilon = "ϵ";
    const straightphi = "ϕ";
    const strns = "¯";
    const sub = "⊂";
    const Sub = "⋐";
    const subdot = "⪽";
    const subE = "⫅";
    const sube = "⊆";
    const subedot = "⫃";
    const submult = "⫁";
    const subnE = "⫋";
    const subne = "⊊";
    const subplus = "⪿";
    const subrarr = "⥹";
    const subset = "⊂";
    const Subset = "⋐";
    const subseteq = "⊆";
    const subseteqq = "⫅";
    const SubsetEqual = "⊆";
    const subsetneq = "⊊";
    const subsetneqq = "⫋";
    const subsim = "⫇";
    const subsub = "⫕";
    const subsup = "⫓";
    const succapprox = "⪸";
    const succ = "≻";
    const succcurlyeq = "≽";
    const Succeeds = "≻";
    const SucceedsEqual = "⪰";
    const SucceedsSlantEqual = "≽";
    const SucceedsTilde = "≿";
    const succeq = "⪰";
    const succnapprox = "⪺";
    const succneqq = "⪶";
    const succnsim = "⋩";
    const succsim = "≿";
    const SuchThat = "∋";
    const sum = "∑";
    const Sum = "∑";
    const sung = "♪";
    const sup1$1 = "¹";
    const sup2$1 = "²";
    const sup3$1 = "³";
    const sup = "⊃";
    const Sup = "⋑";
    const supdot = "⪾";
    const supdsub = "⫘";
    const supE = "⫆";
    const supe = "⊇";
    const supedot = "⫄";
    const Superset = "⊃";
    const SupersetEqual = "⊇";
    const suphsol = "⟉";
    const suphsub = "⫗";
    const suplarr = "⥻";
    const supmult = "⫂";
    const supnE = "⫌";
    const supne = "⊋";
    const supplus = "⫀";
    const supset = "⊃";
    const Supset = "⋑";
    const supseteq = "⊇";
    const supseteqq = "⫆";
    const supsetneq = "⊋";
    const supsetneqq = "⫌";
    const supsim = "⫈";
    const supsub = "⫔";
    const supsup = "⫖";
    const swarhk = "⤦";
    const swarr = "↙";
    const swArr = "⇙";
    const swarrow = "↙";
    const swnwar = "⤪";
    const szlig$1 = "ß";
    const Tab$1 = "	";
    const target$1 = "⌖";
    const Tau = "Τ";
    const tau = "τ";
    const tbrk = "⎴";
    const Tcaron = "Ť";
    const tcaron = "ť";
    const Tcedil = "Ţ";
    const tcedil = "ţ";
    const Tcy = "Т";
    const tcy = "т";
    const tdot = "⃛";
    const telrec = "⌕";
    const Tfr = "𝔗";
    const tfr = "𝔱";
    const there4 = "∴";
    const therefore = "∴";
    const Therefore = "∴";
    const Theta = "Θ";
    const theta = "θ";
    const thetasym = "ϑ";
    const thetav = "ϑ";
    const thickapprox = "≈";
    const thicksim = "∼";
    const ThickSpace = "  ";
    const ThinSpace = " ";
    const thinsp = " ";
    const thkap = "≈";
    const thksim = "∼";
    const THORN$1 = "Þ";
    const thorn$1 = "þ";
    const tilde = "˜";
    const Tilde = "∼";
    const TildeEqual = "≃";
    const TildeFullEqual = "≅";
    const TildeTilde = "≈";
    const timesbar = "⨱";
    const timesb = "⊠";
    const times$1 = "×";
    const timesd = "⨰";
    const tint = "∭";
    const toea = "⤨";
    const topbot = "⌶";
    const topcir = "⫱";
    const top$2 = "⊤";
    const Topf = "𝕋";
    const topf = "𝕥";
    const topfork = "⫚";
    const tosa = "⤩";
    const tprime = "‴";
    const trade = "™";
    const TRADE = "™";
    const triangle = "▵";
    const triangledown = "▿";
    const triangleleft = "◃";
    const trianglelefteq = "⊴";
    const triangleq = "≜";
    const triangleright = "▹";
    const trianglerighteq = "⊵";
    const tridot = "◬";
    const trie = "≜";
    const triminus = "⨺";
    const TripleDot = "⃛";
    const triplus = "⨹";
    const trisb = "⧍";
    const tritime = "⨻";
    const trpezium = "⏢";
    const Tscr = "𝒯";
    const tscr = "𝓉";
    const TScy = "Ц";
    const tscy = "ц";
    const TSHcy = "Ћ";
    const tshcy = "ћ";
    const Tstrok = "Ŧ";
    const tstrok = "ŧ";
    const twixt = "≬";
    const twoheadleftarrow = "↞";
    const twoheadrightarrow = "↠";
    const Uacute$1 = "Ú";
    const uacute$1 = "ú";
    const uarr = "↑";
    const Uarr = "↟";
    const uArr = "⇑";
    const Uarrocir = "⥉";
    const Ubrcy = "Ў";
    const ubrcy = "ў";
    const Ubreve = "Ŭ";
    const ubreve = "ŭ";
    const Ucirc$1 = "Û";
    const ucirc$1 = "û";
    const Ucy = "У";
    const ucy = "у";
    const udarr = "⇅";
    const Udblac = "Ű";
    const udblac = "ű";
    const udhar = "⥮";
    const ufisht = "⥾";
    const Ufr = "𝔘";
    const ufr = "𝔲";
    const Ugrave$1 = "Ù";
    const ugrave$1 = "ù";
    const uHar = "⥣";
    const uharl = "↿";
    const uharr = "↾";
    const uhblk = "▀";
    const ulcorn = "⌜";
    const ulcorner = "⌜";
    const ulcrop = "⌏";
    const ultri = "◸";
    const Umacr = "Ū";
    const umacr = "ū";
    const uml$1 = "¨";
    const UnderBar = "_";
    const UnderBrace = "⏟";
    const UnderBracket = "⎵";
    const UnderParenthesis = "⏝";
    const Union = "⋃";
    const UnionPlus = "⊎";
    const Uogon = "Ų";
    const uogon = "ų";
    const Uopf = "𝕌";
    const uopf = "𝕦";
    const UpArrowBar = "⤒";
    const uparrow = "↑";
    const UpArrow = "↑";
    const Uparrow = "⇑";
    const UpArrowDownArrow = "⇅";
    const updownarrow = "↕";
    const UpDownArrow = "↕";
    const Updownarrow = "⇕";
    const UpEquilibrium = "⥮";
    const upharpoonleft = "↿";
    const upharpoonright = "↾";
    const uplus = "⊎";
    const UpperLeftArrow = "↖";
    const UpperRightArrow = "↗";
    const upsi = "υ";
    const Upsi = "ϒ";
    const upsih = "ϒ";
    const Upsilon = "Υ";
    const upsilon = "υ";
    const UpTeeArrow = "↥";
    const UpTee = "⊥";
    const upuparrows = "⇈";
    const urcorn = "⌝";
    const urcorner = "⌝";
    const urcrop = "⌎";
    const Uring = "Ů";
    const uring = "ů";
    const urtri = "◹";
    const Uscr = "𝒰";
    const uscr = "𝓊";
    const utdot = "⋰";
    const Utilde = "Ũ";
    const utilde = "ũ";
    const utri = "▵";
    const utrif = "▴";
    const uuarr = "⇈";
    const Uuml$1 = "Ü";
    const uuml$1 = "ü";
    const uwangle = "⦧";
    const vangrt = "⦜";
    const varepsilon = "ϵ";
    const varkappa = "ϰ";
    const varnothing = "∅";
    const varphi = "ϕ";
    const varpi = "ϖ";
    const varpropto = "∝";
    const varr = "↕";
    const vArr = "⇕";
    const varrho = "ϱ";
    const varsigma = "ς";
    const varsubsetneq = "⊊︀";
    const varsubsetneqq = "⫋︀";
    const varsupsetneq = "⊋︀";
    const varsupsetneqq = "⫌︀";
    const vartheta = "ϑ";
    const vartriangleleft = "⊲";
    const vartriangleright = "⊳";
    const vBar = "⫨";
    const Vbar = "⫫";
    const vBarv = "⫩";
    const Vcy = "В";
    const vcy = "в";
    const vdash = "⊢";
    const vDash = "⊨";
    const Vdash = "⊩";
    const VDash = "⊫";
    const Vdashl = "⫦";
    const veebar = "⊻";
    const vee = "∨";
    const Vee = "⋁";
    const veeeq = "≚";
    const vellip = "⋮";
    const verbar = "|";
    const Verbar = "‖";
    const vert = "|";
    const Vert = "‖";
    const VerticalBar = "∣";
    const VerticalLine = "|";
    const VerticalSeparator = "❘";
    const VerticalTilde = "≀";
    const VeryThinSpace = " ";
    const Vfr = "𝔙";
    const vfr = "𝔳";
    const vltri = "⊲";
    const vnsub = "⊂⃒";
    const vnsup = "⊃⃒";
    const Vopf = "𝕍";
    const vopf = "𝕧";
    const vprop = "∝";
    const vrtri = "⊳";
    const Vscr = "𝒱";
    const vscr = "𝓋";
    const vsubnE = "⫋︀";
    const vsubne = "⊊︀";
    const vsupnE = "⫌︀";
    const vsupne = "⊋︀";
    const Vvdash = "⊪";
    const vzigzag = "⦚";
    const Wcirc = "Ŵ";
    const wcirc = "ŵ";
    const wedbar = "⩟";
    const wedge = "∧";
    const Wedge = "⋀";
    const wedgeq = "≙";
    const weierp = "℘";
    const Wfr = "𝔚";
    const wfr = "𝔴";
    const Wopf = "𝕎";
    const wopf = "𝕨";
    const wp = "℘";
    const wr = "≀";
    const wreath = "≀";
    const Wscr = "𝒲";
    const wscr = "𝓌";
    const xcap = "⋂";
    const xcirc = "◯";
    const xcup = "⋃";
    const xdtri = "▽";
    const Xfr = "𝔛";
    const xfr = "𝔵";
    const xharr = "⟷";
    const xhArr = "⟺";
    const Xi = "Ξ";
    const xi = "ξ";
    const xlarr = "⟵";
    const xlArr = "⟸";
    const xmap = "⟼";
    const xnis = "⋻";
    const xodot = "⨀";
    const Xopf = "𝕏";
    const xopf = "𝕩";
    const xoplus = "⨁";
    const xotime = "⨂";
    const xrarr = "⟶";
    const xrArr = "⟹";
    const Xscr = "𝒳";
    const xscr = "𝓍";
    const xsqcup = "⨆";
    const xuplus = "⨄";
    const xutri = "△";
    const xvee = "⋁";
    const xwedge = "⋀";
    const Yacute$1 = "Ý";
    const yacute$1 = "ý";
    const YAcy = "Я";
    const yacy = "я";
    const Ycirc = "Ŷ";
    const ycirc = "ŷ";
    const Ycy = "Ы";
    const ycy = "ы";
    const yen$1 = "¥";
    const Yfr = "𝔜";
    const yfr = "𝔶";
    const YIcy = "Ї";
    const yicy = "ї";
    const Yopf = "𝕐";
    const yopf = "𝕪";
    const Yscr = "𝒴";
    const yscr = "𝓎";
    const YUcy = "Ю";
    const yucy = "ю";
    const yuml$1 = "ÿ";
    const Yuml = "Ÿ";
    const Zacute = "Ź";
    const zacute = "ź";
    const Zcaron = "Ž";
    const zcaron = "ž";
    const Zcy = "З";
    const zcy = "з";
    const Zdot = "Ż";
    const zdot = "ż";
    const zeetrf = "ℨ";
    const ZeroWidthSpace = "​";
    const Zeta = "Ζ";
    const zeta = "ζ";
    const zfr = "𝔷";
    const Zfr = "ℨ";
    const ZHcy = "Ж";
    const zhcy = "ж";
    const zigrarr = "⇝";
    const zopf = "𝕫";
    const Zopf = "ℤ";
    const Zscr = "𝒵";
    const zscr = "𝓏";
    const zwj = "‍";
    const zwnj = "‌";
    const require$$1 = {
      Aacute: Aacute$1,
      aacute: aacute$1,
      Abreve,
      abreve,
      ac,
      acd,
      acE,
      Acirc: Acirc$1,
      acirc: acirc$1,
      acute: acute$1,
      Acy,
      acy,
      AElig: AElig$1,
      aelig: aelig$1,
      af,
      Afr,
      afr,
      Agrave: Agrave$1,
      agrave: agrave$1,
      alefsym,
      aleph,
      Alpha,
      alpha,
      Amacr,
      amacr,
      amalg,
      amp: amp$2,
      AMP: AMP$1,
      andand,
      And,
      and,
      andd,
      andslope,
      andv,
      ang,
      ange,
      angle,
      angmsdaa,
      angmsdab,
      angmsdac,
      angmsdad,
      angmsdae,
      angmsdaf,
      angmsdag,
      angmsdah,
      angmsd,
      angrt,
      angrtvb,
      angrtvbd,
      angsph,
      angst,
      angzarr,
      Aogon,
      aogon,
      Aopf,
      aopf,
      apacir,
      ap,
      apE,
      ape,
      apid,
      apos: apos$1,
      ApplyFunction,
      approx,
      approxeq,
      Aring: Aring$1,
      aring: aring$1,
      Ascr,
      ascr,
      Assign,
      ast,
      asymp,
      asympeq,
      Atilde: Atilde$1,
      atilde: atilde$1,
      Auml: Auml$1,
      auml: auml$1,
      awconint,
      awint,
      backcong,
      backepsilon,
      backprime,
      backsim,
      backsimeq,
      Backslash,
      Barv,
      barvee,
      barwed,
      Barwed,
      barwedge,
      bbrk,
      bbrktbrk,
      bcong,
      Bcy,
      bcy,
      bdquo,
      becaus,
      because,
      Because,
      bemptyv,
      bepsi,
      bernou,
      Bernoullis,
      Beta,
      beta,
      beth,
      between,
      Bfr,
      bfr,
      bigcap,
      bigcirc,
      bigcup,
      bigodot,
      bigoplus,
      bigotimes,
      bigsqcup,
      bigstar,
      bigtriangledown,
      bigtriangleup,
      biguplus,
      bigvee,
      bigwedge,
      bkarow,
      blacklozenge,
      blacksquare,
      blacktriangle,
      blacktriangledown,
      blacktriangleleft,
      blacktriangleright,
      blank,
      blk12,
      blk14,
      blk34,
      block,
      bne,
      bnequiv,
      bNot,
      bnot,
      Bopf,
      bopf,
      bot,
      bottom: bottom$1,
      bowtie,
      boxbox,
      boxdl,
      boxdL,
      boxDl,
      boxDL,
      boxdr,
      boxdR,
      boxDr,
      boxDR,
      boxh,
      boxH,
      boxhd,
      boxHd,
      boxhD,
      boxHD,
      boxhu,
      boxHu,
      boxhU,
      boxHU,
      boxminus,
      boxplus,
      boxtimes,
      boxul,
      boxuL,
      boxUl,
      boxUL,
      boxur,
      boxuR,
      boxUr,
      boxUR,
      boxv,
      boxV,
      boxvh,
      boxvH,
      boxVh,
      boxVH,
      boxvl,
      boxvL,
      boxVl,
      boxVL,
      boxvr,
      boxvR,
      boxVr,
      boxVR,
      bprime,
      breve,
      Breve,
      brvbar: brvbar$1,
      bscr,
      Bscr,
      bsemi,
      bsim,
      bsime,
      bsolb,
      bsol,
      bsolhsub,
      bull,
      bullet,
      bump,
      bumpE,
      bumpe,
      Bumpeq,
      bumpeq,
      Cacute,
      cacute,
      capand,
      capbrcup,
      capcap,
      cap,
      Cap,
      capcup,
      capdot,
      CapitalDifferentialD,
      caps,
      caret,
      caron,
      Cayleys,
      ccaps,
      Ccaron,
      ccaron,
      Ccedil: Ccedil$1,
      ccedil: ccedil$1,
      Ccirc,
      ccirc,
      Cconint,
      ccups,
      ccupssm,
      Cdot,
      cdot,
      cedil: cedil$1,
      Cedilla,
      cemptyv,
      cent: cent$1,
      centerdot,
      CenterDot,
      cfr,
      Cfr,
      CHcy,
      chcy,
      check,
      checkmark,
      Chi,
      chi,
      circ,
      circeq,
      circlearrowleft,
      circlearrowright,
      circledast,
      circledcirc,
      circleddash,
      CircleDot,
      circledR,
      circledS,
      CircleMinus,
      CirclePlus,
      CircleTimes,
      cir,
      cirE,
      cire,
      cirfnint,
      cirmid,
      cirscir,
      ClockwiseContourIntegral,
      CloseCurlyDoubleQuote,
      CloseCurlyQuote,
      clubs,
      clubsuit,
      colon,
      Colon,
      Colone,
      colone,
      coloneq,
      comma,
      commat,
      comp,
      compfn,
      complement,
      complexes,
      cong,
      congdot,
      Congruent,
      conint,
      Conint,
      ContourIntegral,
      copf,
      Copf,
      coprod,
      Coproduct,
      copy: copy$1,
      COPY: COPY$1,
      copysr,
      CounterClockwiseContourIntegral,
      crarr,
      cross,
      Cross,
      Cscr,
      cscr,
      csub,
      csube,
      csup,
      csupe,
      ctdot,
      cudarrl,
      cudarrr,
      cuepr,
      cuesc,
      cularr,
      cularrp,
      cupbrcap,
      cupcap,
      CupCap,
      cup,
      Cup,
      cupcup,
      cupdot,
      cupor,
      cups,
      curarr,
      curarrm,
      curlyeqprec,
      curlyeqsucc,
      curlyvee,
      curlywedge,
      curren: curren$1,
      curvearrowleft,
      curvearrowright,
      cuvee,
      cuwed,
      cwconint,
      cwint,
      cylcty,
      dagger,
      Dagger,
      daleth,
      darr,
      Darr,
      dArr,
      dash,
      Dashv,
      dashv,
      dbkarow,
      dblac,
      Dcaron,
      dcaron,
      Dcy,
      dcy,
      ddagger,
      ddarr,
      DD,
      dd,
      DDotrahd,
      ddotseq,
      deg: deg$1,
      Del,
      Delta,
      delta,
      demptyv,
      dfisht,
      Dfr,
      dfr,
      dHar,
      dharl,
      dharr,
      DiacriticalAcute,
      DiacriticalDot,
      DiacriticalDoubleAcute,
      DiacriticalGrave,
      DiacriticalTilde,
      diam,
      diamond,
      Diamond,
      diamondsuit,
      diams,
      die,
      DifferentialD,
      digamma,
      disin,
      div,
      divide: divide$1,
      divideontimes,
      divonx,
      DJcy,
      djcy,
      dlcorn,
      dlcrop,
      dollar,
      Dopf,
      dopf,
      Dot,
      dot: dot$1,
      DotDot,
      doteq,
      doteqdot,
      DotEqual,
      dotminus,
      dotplus,
      dotsquare,
      doublebarwedge,
      DoubleContourIntegral,
      DoubleDot,
      DoubleDownArrow,
      DoubleLeftArrow,
      DoubleLeftRightArrow,
      DoubleLeftTee,
      DoubleLongLeftArrow,
      DoubleLongLeftRightArrow,
      DoubleLongRightArrow,
      DoubleRightArrow,
      DoubleRightTee,
      DoubleUpArrow,
      DoubleUpDownArrow,
      DoubleVerticalBar,
      DownArrowBar,
      downarrow,
      DownArrow,
      Downarrow,
      DownArrowUpArrow,
      DownBreve,
      downdownarrows,
      downharpoonleft,
      downharpoonright,
      DownLeftRightVector,
      DownLeftTeeVector,
      DownLeftVectorBar,
      DownLeftVector,
      DownRightTeeVector,
      DownRightVectorBar,
      DownRightVector,
      DownTeeArrow,
      DownTee,
      drbkarow,
      drcorn,
      drcrop,
      Dscr,
      dscr,
      DScy,
      dscy,
      dsol,
      Dstrok,
      dstrok,
      dtdot,
      dtri,
      dtrif,
      duarr,
      duhar,
      dwangle,
      DZcy,
      dzcy,
      dzigrarr,
      Eacute: Eacute$1,
      eacute: eacute$1,
      easter,
      Ecaron,
      ecaron,
      Ecirc: Ecirc$1,
      ecirc: ecirc$1,
      ecir,
      ecolon,
      Ecy,
      ecy,
      eDDot,
      Edot,
      edot,
      eDot,
      ee,
      efDot,
      Efr,
      efr,
      eg,
      Egrave: Egrave$1,
      egrave: egrave$1,
      egs,
      egsdot,
      el,
      Element: Element$1,
      elinters,
      ell,
      els,
      elsdot,
      Emacr,
      emacr,
      empty,
      emptyset,
      EmptySmallSquare,
      emptyv,
      EmptyVerySmallSquare,
      emsp13,
      emsp14,
      emsp,
      ENG,
      eng,
      ensp,
      Eogon,
      eogon,
      Eopf,
      eopf,
      epar,
      eparsl,
      eplus,
      epsi,
      Epsilon: Epsilon$1,
      epsilon,
      epsiv,
      eqcirc,
      eqcolon,
      eqsim,
      eqslantgtr,
      eqslantless,
      Equal,
      equals,
      EqualTilde,
      equest,
      Equilibrium,
      equiv,
      equivDD,
      eqvparsl,
      erarr,
      erDot,
      escr,
      Escr,
      esdot,
      Esim,
      esim,
      Eta,
      eta,
      ETH: ETH$1,
      eth: eth$1,
      Euml: Euml$1,
      euml: euml$1,
      euro,
      excl,
      exist,
      Exists,
      expectation,
      exponentiale,
      ExponentialE,
      fallingdotseq,
      Fcy,
      fcy,
      female,
      ffilig,
      fflig,
      ffllig,
      Ffr,
      ffr,
      filig,
      FilledSmallSquare,
      FilledVerySmallSquare,
      fjlig,
      flat,
      fllig,
      fltns,
      fnof,
      Fopf,
      fopf,
      forall,
      ForAll,
      fork,
      forkv,
      Fouriertrf,
      fpartint,
      frac12: frac12$1,
      frac13,
      frac14: frac14$1,
      frac15,
      frac16,
      frac18,
      frac23,
      frac25,
      frac34: frac34$1,
      frac35,
      frac38,
      frac45,
      frac56,
      frac58,
      frac78,
      frasl,
      frown,
      fscr,
      Fscr,
      gacute,
      Gamma,
      gamma,
      Gammad,
      gammad,
      gap,
      Gbreve,
      gbreve,
      Gcedil,
      Gcirc,
      gcirc,
      Gcy,
      gcy,
      Gdot,
      gdot,
      ge,
      gE,
      gEl,
      gel,
      geq,
      geqq,
      geqslant,
      gescc,
      ges,
      gesdot,
      gesdoto,
      gesdotol,
      gesl,
      gesles,
      Gfr,
      gfr,
      gg,
      Gg,
      ggg,
      gimel,
      GJcy,
      gjcy,
      gla,
      gl,
      glE,
      glj,
      gnap,
      gnapprox,
      gne,
      gnE,
      gneq,
      gneqq,
      gnsim,
      Gopf,
      gopf,
      grave,
      GreaterEqual,
      GreaterEqualLess,
      GreaterFullEqual,
      GreaterGreater,
      GreaterLess,
      GreaterSlantEqual,
      GreaterTilde,
      Gscr,
      gscr,
      gsim,
      gsime,
      gsiml,
      gtcc,
      gtcir,
      gt: gt$2,
      GT: GT$1,
      Gt,
      gtdot,
      gtlPar,
      gtquest,
      gtrapprox,
      gtrarr,
      gtrdot,
      gtreqless,
      gtreqqless,
      gtrless,
      gtrsim,
      gvertneqq,
      gvnE,
      Hacek,
      hairsp,
      half,
      hamilt,
      HARDcy,
      hardcy,
      harrcir,
      harr,
      hArr,
      harrw,
      Hat,
      hbar,
      Hcirc,
      hcirc,
      hearts,
      heartsuit,
      hellip,
      hercon,
      hfr,
      Hfr,
      HilbertSpace,
      hksearow,
      hkswarow,
      hoarr,
      homtht,
      hookleftarrow,
      hookrightarrow,
      hopf,
      Hopf,
      horbar,
      HorizontalLine,
      hscr,
      Hscr,
      hslash,
      Hstrok,
      hstrok,
      HumpDownHump,
      HumpEqual,
      hybull,
      hyphen,
      Iacute: Iacute$1,
      iacute: iacute$1,
      ic,
      Icirc: Icirc$1,
      icirc: icirc$1,
      Icy,
      icy,
      Idot,
      IEcy,
      iecy,
      iexcl: iexcl$1,
      iff,
      ifr,
      Ifr,
      Igrave: Igrave$1,
      igrave: igrave$1,
      ii,
      iiiint,
      iiint,
      iinfin,
      iiota,
      IJlig,
      ijlig,
      Imacr,
      imacr,
      image: image$1,
      ImaginaryI,
      imagline,
      imagpart,
      imath,
      Im,
      imof,
      imped,
      Implies,
      incare,
      "in": "∈",
      infin,
      infintie,
      inodot,
      intcal,
      int,
      Int,
      integers,
      Integral,
      intercal,
      Intersection,
      intlarhk,
      intprod,
      InvisibleComma,
      InvisibleTimes,
      IOcy,
      iocy,
      Iogon,
      iogon,
      Iopf,
      iopf,
      Iota,
      iota,
      iprod,
      iquest: iquest$1,
      iscr,
      Iscr,
      isin,
      isindot,
      isinE,
      isins,
      isinsv,
      isinv,
      it,
      Itilde,
      itilde,
      Iukcy,
      iukcy,
      Iuml: Iuml$1,
      iuml: iuml$1,
      Jcirc,
      jcirc,
      Jcy,
      jcy,
      Jfr,
      jfr,
      jmath,
      Jopf,
      jopf,
      Jscr,
      jscr,
      Jsercy,
      jsercy,
      Jukcy,
      jukcy,
      Kappa,
      kappa,
      kappav,
      Kcedil,
      kcedil,
      Kcy,
      kcy,
      Kfr,
      kfr,
      kgreen,
      KHcy,
      khcy,
      KJcy,
      kjcy,
      Kopf,
      kopf,
      Kscr,
      kscr,
      lAarr,
      Lacute,
      lacute,
      laemptyv,
      lagran,
      Lambda,
      lambda,
      lang,
      Lang,
      langd,
      langle,
      lap,
      Laplacetrf,
      laquo: laquo$1,
      larrb,
      larrbfs,
      larr,
      Larr,
      lArr,
      larrfs,
      larrhk,
      larrlp,
      larrpl,
      larrsim,
      larrtl,
      latail,
      lAtail,
      lat,
      late,
      lates,
      lbarr,
      lBarr,
      lbbrk,
      lbrace,
      lbrack,
      lbrke,
      lbrksld,
      lbrkslu,
      Lcaron,
      lcaron,
      Lcedil,
      lcedil,
      lceil,
      lcub,
      Lcy,
      lcy,
      ldca,
      ldquo,
      ldquor,
      ldrdhar,
      ldrushar,
      ldsh,
      le,
      lE,
      LeftAngleBracket,
      LeftArrowBar,
      leftarrow,
      LeftArrow,
      Leftarrow,
      LeftArrowRightArrow,
      leftarrowtail,
      LeftCeiling,
      LeftDoubleBracket,
      LeftDownTeeVector,
      LeftDownVectorBar,
      LeftDownVector,
      LeftFloor,
      leftharpoondown,
      leftharpoonup,
      leftleftarrows,
      leftrightarrow,
      LeftRightArrow,
      Leftrightarrow,
      leftrightarrows,
      leftrightharpoons,
      leftrightsquigarrow,
      LeftRightVector,
      LeftTeeArrow,
      LeftTee,
      LeftTeeVector,
      leftthreetimes,
      LeftTriangleBar,
      LeftTriangle,
      LeftTriangleEqual,
      LeftUpDownVector,
      LeftUpTeeVector,
      LeftUpVectorBar,
      LeftUpVector,
      LeftVectorBar,
      LeftVector,
      lEg,
      leg,
      leq,
      leqq,
      leqslant,
      lescc,
      les,
      lesdot,
      lesdoto,
      lesdotor,
      lesg,
      lesges,
      lessapprox,
      lessdot,
      lesseqgtr,
      lesseqqgtr,
      LessEqualGreater,
      LessFullEqual,
      LessGreater,
      lessgtr,
      LessLess,
      lesssim,
      LessSlantEqual,
      LessTilde,
      lfisht,
      lfloor,
      Lfr,
      lfr,
      lg,
      lgE,
      lHar,
      lhard,
      lharu,
      lharul,
      lhblk,
      LJcy,
      ljcy,
      llarr,
      ll,
      Ll,
      llcorner,
      Lleftarrow,
      llhard,
      lltri,
      Lmidot,
      lmidot,
      lmoustache,
      lmoust,
      lnap,
      lnapprox,
      lne,
      lnE,
      lneq,
      lneqq,
      lnsim,
      loang,
      loarr,
      lobrk,
      longleftarrow,
      LongLeftArrow,
      Longleftarrow,
      longleftrightarrow,
      LongLeftRightArrow,
      Longleftrightarrow,
      longmapsto,
      longrightarrow,
      LongRightArrow,
      Longrightarrow,
      looparrowleft,
      looparrowright,
      lopar,
      Lopf,
      lopf,
      loplus,
      lotimes,
      lowast,
      lowbar,
      LowerLeftArrow,
      LowerRightArrow,
      loz,
      lozenge,
      lozf,
      lpar,
      lparlt,
      lrarr,
      lrcorner,
      lrhar,
      lrhard,
      lrm,
      lrtri,
      lsaquo,
      lscr,
      Lscr,
      lsh,
      Lsh,
      lsim,
      lsime,
      lsimg,
      lsqb,
      lsquo,
      lsquor,
      Lstrok,
      lstrok,
      ltcc,
      ltcir,
      lt: lt$2,
      LT: LT$1,
      Lt,
      ltdot,
      lthree,
      ltimes,
      ltlarr,
      ltquest,
      ltri,
      ltrie,
      ltrif,
      ltrPar,
      lurdshar,
      luruhar,
      lvertneqq,
      lvnE,
      macr: macr$1,
      male,
      malt,
      maltese,
      "Map": "⤅",
      map,
      mapsto,
      mapstodown,
      mapstoleft,
      mapstoup,
      marker,
      mcomma,
      Mcy,
      mcy,
      mdash,
      mDDot,
      measuredangle,
      MediumSpace,
      Mellintrf,
      Mfr,
      mfr,
      mho,
      micro: micro$1,
      midast,
      midcir,
      mid,
      middot: middot$1,
      minusb,
      minus,
      minusd,
      minusdu,
      MinusPlus,
      mlcp,
      mldr,
      mnplus,
      models,
      Mopf,
      mopf,
      mp,
      mscr,
      Mscr,
      mstpos,
      Mu,
      mu,
      multimap,
      mumap,
      nabla,
      Nacute,
      nacute,
      nang,
      nap,
      napE,
      napid,
      napos,
      napprox,
      natural,
      naturals,
      natur,
      nbsp: nbsp$1,
      nbump,
      nbumpe,
      ncap,
      Ncaron,
      ncaron,
      Ncedil,
      ncedil,
      ncong,
      ncongdot,
      ncup,
      Ncy,
      ncy,
      ndash,
      nearhk,
      nearr,
      neArr,
      nearrow,
      ne,
      nedot,
      NegativeMediumSpace,
      NegativeThickSpace,
      NegativeThinSpace,
      NegativeVeryThinSpace,
      nequiv,
      nesear,
      nesim,
      NestedGreaterGreater,
      NestedLessLess,
      NewLine,
      nexist,
      nexists,
      Nfr,
      nfr,
      ngE,
      nge,
      ngeq,
      ngeqq,
      ngeqslant,
      nges,
      nGg,
      ngsim,
      nGt,
      ngt,
      ngtr,
      nGtv,
      nharr,
      nhArr,
      nhpar,
      ni,
      nis,
      nisd,
      niv,
      NJcy,
      njcy,
      nlarr,
      nlArr,
      nldr,
      nlE,
      nle,
      nleftarrow,
      nLeftarrow,
      nleftrightarrow,
      nLeftrightarrow,
      nleq,
      nleqq,
      nleqslant,
      nles,
      nless,
      nLl,
      nlsim,
      nLt,
      nlt,
      nltri,
      nltrie,
      nLtv,
      nmid,
      NoBreak,
      NonBreakingSpace,
      nopf,
      Nopf,
      Not,
      not: not$1,
      NotCongruent,
      NotCupCap,
      NotDoubleVerticalBar,
      NotElement,
      NotEqual,
      NotEqualTilde,
      NotExists,
      NotGreater,
      NotGreaterEqual,
      NotGreaterFullEqual,
      NotGreaterGreater,
      NotGreaterLess,
      NotGreaterSlantEqual,
      NotGreaterTilde,
      NotHumpDownHump,
      NotHumpEqual,
      notin,
      notindot,
      notinE,
      notinva,
      notinvb,
      notinvc,
      NotLeftTriangleBar,
      NotLeftTriangle,
      NotLeftTriangleEqual,
      NotLess,
      NotLessEqual,
      NotLessGreater,
      NotLessLess,
      NotLessSlantEqual,
      NotLessTilde,
      NotNestedGreaterGreater,
      NotNestedLessLess,
      notni,
      notniva,
      notnivb,
      notnivc,
      NotPrecedes,
      NotPrecedesEqual,
      NotPrecedesSlantEqual,
      NotReverseElement,
      NotRightTriangleBar,
      NotRightTriangle,
      NotRightTriangleEqual,
      NotSquareSubset,
      NotSquareSubsetEqual,
      NotSquareSuperset,
      NotSquareSupersetEqual,
      NotSubset,
      NotSubsetEqual,
      NotSucceeds,
      NotSucceedsEqual,
      NotSucceedsSlantEqual,
      NotSucceedsTilde,
      NotSuperset,
      NotSupersetEqual,
      NotTilde,
      NotTildeEqual,
      NotTildeFullEqual,
      NotTildeTilde,
      NotVerticalBar,
      nparallel,
      npar,
      nparsl,
      npart,
      npolint,
      npr,
      nprcue,
      nprec,
      npreceq,
      npre,
      nrarrc,
      nrarr,
      nrArr,
      nrarrw,
      nrightarrow,
      nRightarrow,
      nrtri,
      nrtrie,
      nsc,
      nsccue,
      nsce,
      Nscr,
      nscr,
      nshortmid,
      nshortparallel,
      nsim,
      nsime,
      nsimeq,
      nsmid,
      nspar,
      nsqsube,
      nsqsupe,
      nsub,
      nsubE,
      nsube,
      nsubset,
      nsubseteq,
      nsubseteqq,
      nsucc,
      nsucceq,
      nsup,
      nsupE,
      nsupe,
      nsupset,
      nsupseteq,
      nsupseteqq,
      ntgl,
      Ntilde: Ntilde$1,
      ntilde: ntilde$1,
      ntlg,
      ntriangleleft,
      ntrianglelefteq,
      ntriangleright,
      ntrianglerighteq,
      Nu,
      nu,
      num: num$1,
      numero,
      numsp,
      nvap,
      nvdash,
      nvDash,
      nVdash,
      nVDash,
      nvge,
      nvgt,
      nvHarr,
      nvinfin,
      nvlArr,
      nvle,
      nvlt,
      nvltrie,
      nvrArr,
      nvrtrie,
      nvsim,
      nwarhk,
      nwarr,
      nwArr,
      nwarrow,
      nwnear,
      Oacute: Oacute$1,
      oacute: oacute$1,
      oast,
      Ocirc: Ocirc$1,
      ocirc: ocirc$1,
      ocir,
      Ocy,
      ocy,
      odash,
      Odblac,
      odblac,
      odiv,
      odot,
      odsold,
      OElig,
      oelig,
      ofcir,
      Ofr,
      ofr,
      ogon,
      Ograve: Ograve$1,
      ograve: ograve$1,
      ogt,
      ohbar,
      ohm,
      oint,
      olarr,
      olcir,
      olcross,
      oline,
      olt,
      Omacr,
      omacr,
      Omega,
      omega,
      Omicron,
      omicron,
      omid,
      ominus,
      Oopf,
      oopf,
      opar,
      OpenCurlyDoubleQuote,
      OpenCurlyQuote,
      operp,
      oplus,
      orarr,
      Or,
      or,
      ord,
      order: order$1,
      orderof,
      ordf: ordf$1,
      ordm: ordm$1,
      origof,
      oror,
      orslope,
      orv,
      oS,
      Oscr,
      oscr,
      Oslash: Oslash$1,
      oslash: oslash$1,
      osol,
      Otilde: Otilde$1,
      otilde: otilde$1,
      otimesas,
      Otimes,
      otimes,
      Ouml: Ouml$1,
      ouml: ouml$1,
      ovbar,
      OverBar,
      OverBrace,
      OverBracket,
      OverParenthesis,
      para: para$1,
      parallel,
      par,
      parsim,
      parsl,
      part,
      PartialD,
      Pcy,
      pcy,
      percnt,
      period,
      permil,
      perp,
      pertenk,
      Pfr,
      pfr,
      Phi,
      phi,
      phiv,
      phmmat,
      phone,
      Pi,
      pi,
      pitchfork,
      piv,
      planck,
      planckh,
      plankv,
      plusacir,
      plusb,
      pluscir,
      plus,
      plusdo,
      plusdu,
      pluse,
      PlusMinus,
      plusmn: plusmn$1,
      plussim,
      plustwo,
      pm,
      Poincareplane,
      pointint,
      popf,
      Popf,
      pound: pound$1,
      prap,
      Pr,
      pr,
      prcue,
      precapprox,
      prec: prec$1,
      preccurlyeq,
      Precedes,
      PrecedesEqual,
      PrecedesSlantEqual,
      PrecedesTilde,
      preceq,
      precnapprox,
      precneqq,
      precnsim,
      pre,
      prE,
      precsim,
      prime,
      Prime,
      primes,
      prnap,
      prnE,
      prnsim,
      prod,
      Product,
      profalar,
      profline,
      profsurf,
      prop,
      Proportional,
      Proportion,
      propto,
      prsim,
      prurel,
      Pscr,
      pscr,
      Psi,
      psi,
      puncsp,
      Qfr,
      qfr,
      qint,
      qopf,
      Qopf,
      qprime,
      Qscr,
      qscr,
      quaternions,
      quatint,
      quest,
      questeq,
      quot: quot$2,
      QUOT: QUOT$1,
      rAarr,
      race,
      Racute,
      racute,
      radic,
      raemptyv,
      rang,
      Rang,
      rangd,
      range,
      rangle,
      raquo: raquo$1,
      rarrap,
      rarrb,
      rarrbfs,
      rarrc,
      rarr,
      Rarr,
      rArr,
      rarrfs,
      rarrhk,
      rarrlp,
      rarrpl,
      rarrsim,
      Rarrtl,
      rarrtl,
      rarrw,
      ratail,
      rAtail,
      ratio,
      rationals,
      rbarr,
      rBarr,
      RBarr,
      rbbrk,
      rbrace,
      rbrack,
      rbrke,
      rbrksld,
      rbrkslu,
      Rcaron,
      rcaron,
      Rcedil,
      rcedil,
      rceil,
      rcub,
      Rcy,
      rcy,
      rdca,
      rdldhar,
      rdquo,
      rdquor,
      rdsh,
      real,
      realine,
      realpart,
      reals,
      Re,
      rect,
      reg: reg$1,
      REG: REG$1,
      ReverseElement,
      ReverseEquilibrium,
      ReverseUpEquilibrium,
      rfisht,
      rfloor,
      rfr,
      Rfr,
      rHar,
      rhard,
      rharu,
      rharul,
      Rho,
      rho,
      rhov,
      RightAngleBracket,
      RightArrowBar,
      rightarrow,
      RightArrow,
      Rightarrow,
      RightArrowLeftArrow,
      rightarrowtail,
      RightCeiling,
      RightDoubleBracket,
      RightDownTeeVector,
      RightDownVectorBar,
      RightDownVector,
      RightFloor,
      rightharpoondown,
      rightharpoonup,
      rightleftarrows,
      rightleftharpoons,
      rightrightarrows,
      rightsquigarrow,
      RightTeeArrow,
      RightTee,
      RightTeeVector,
      rightthreetimes,
      RightTriangleBar,
      RightTriangle,
      RightTriangleEqual,
      RightUpDownVector,
      RightUpTeeVector,
      RightUpVectorBar,
      RightUpVector,
      RightVectorBar,
      RightVector,
      ring,
      risingdotseq,
      rlarr,
      rlhar,
      rlm,
      rmoustache,
      rmoust,
      rnmid,
      roang,
      roarr,
      robrk,
      ropar,
      ropf,
      Ropf,
      roplus,
      rotimes,
      RoundImplies,
      rpar,
      rpargt,
      rppolint,
      rrarr,
      Rrightarrow,
      rsaquo,
      rscr,
      Rscr,
      rsh,
      Rsh,
      rsqb,
      rsquo,
      rsquor,
      rthree,
      rtimes,
      rtri,
      rtrie,
      rtrif,
      rtriltri,
      RuleDelayed,
      ruluhar,
      rx,
      Sacute,
      sacute,
      sbquo,
      scap,
      Scaron,
      scaron,
      Sc,
      sc,
      sccue,
      sce,
      scE,
      Scedil,
      scedil,
      Scirc,
      scirc,
      scnap,
      scnE,
      scnsim,
      scpolint,
      scsim,
      Scy,
      scy,
      sdotb,
      sdot,
      sdote,
      searhk,
      searr,
      seArr,
      searrow,
      sect: sect$1,
      semi,
      seswar,
      setminus,
      setmn,
      sext,
      Sfr,
      sfr,
      sfrown,
      sharp,
      SHCHcy,
      shchcy,
      SHcy,
      shcy,
      ShortDownArrow,
      ShortLeftArrow,
      shortmid,
      shortparallel,
      ShortRightArrow,
      ShortUpArrow,
      shy: shy$1,
      Sigma,
      sigma,
      sigmaf,
      sigmav,
      sim,
      simdot,
      sime,
      simeq,
      simg,
      simgE,
      siml,
      simlE,
      simne,
      simplus,
      simrarr,
      slarr,
      SmallCircle,
      smallsetminus,
      smashp,
      smeparsl,
      smid,
      smile,
      smt,
      smte,
      smtes,
      SOFTcy,
      softcy,
      solbar,
      solb,
      sol,
      Sopf,
      sopf,
      spades,
      spadesuit,
      spar,
      sqcap,
      sqcaps,
      sqcup,
      sqcups,
      Sqrt,
      sqsub,
      sqsube,
      sqsubset,
      sqsubseteq,
      sqsup,
      sqsupe,
      sqsupset,
      sqsupseteq,
      square,
      Square,
      SquareIntersection,
      SquareSubset,
      SquareSubsetEqual,
      SquareSuperset,
      SquareSupersetEqual,
      SquareUnion,
      squarf,
      squ,
      squf,
      srarr,
      Sscr,
      sscr,
      ssetmn,
      ssmile,
      sstarf,
      Star,
      star,
      starf,
      straightepsilon,
      straightphi,
      strns,
      sub,
      Sub,
      subdot,
      subE,
      sube,
      subedot,
      submult,
      subnE,
      subne,
      subplus,
      subrarr,
      subset,
      Subset,
      subseteq,
      subseteqq,
      SubsetEqual,
      subsetneq,
      subsetneqq,
      subsim,
      subsub,
      subsup,
      succapprox,
      succ,
      succcurlyeq,
      Succeeds,
      SucceedsEqual,
      SucceedsSlantEqual,
      SucceedsTilde,
      succeq,
      succnapprox,
      succneqq,
      succnsim,
      succsim,
      SuchThat,
      sum,
      Sum,
      sung,
      sup1: sup1$1,
      sup2: sup2$1,
      sup3: sup3$1,
      sup,
      Sup,
      supdot,
      supdsub,
      supE,
      supe,
      supedot,
      Superset,
      SupersetEqual,
      suphsol,
      suphsub,
      suplarr,
      supmult,
      supnE,
      supne,
      supplus,
      supset,
      Supset,
      supseteq,
      supseteqq,
      supsetneq,
      supsetneqq,
      supsim,
      supsub,
      supsup,
      swarhk,
      swarr,
      swArr,
      swarrow,
      swnwar,
      szlig: szlig$1,
      Tab: Tab$1,
      target: target$1,
      Tau,
      tau,
      tbrk,
      Tcaron,
      tcaron,
      Tcedil,
      tcedil,
      Tcy,
      tcy,
      tdot,
      telrec,
      Tfr,
      tfr,
      there4,
      therefore,
      Therefore,
      Theta,
      theta,
      thetasym,
      thetav,
      thickapprox,
      thicksim,
      ThickSpace,
      ThinSpace,
      thinsp,
      thkap,
      thksim,
      THORN: THORN$1,
      thorn: thorn$1,
      tilde,
      Tilde,
      TildeEqual,
      TildeFullEqual,
      TildeTilde,
      timesbar,
      timesb,
      times: times$1,
      timesd,
      tint,
      toea,
      topbot,
      topcir,
      top: top$2,
      Topf,
      topf,
      topfork,
      tosa,
      tprime,
      trade,
      TRADE,
      triangle,
      triangledown,
      triangleleft,
      trianglelefteq,
      triangleq,
      triangleright,
      trianglerighteq,
      tridot,
      trie,
      triminus,
      TripleDot,
      triplus,
      trisb,
      tritime,
      trpezium,
      Tscr,
      tscr,
      TScy,
      tscy,
      TSHcy,
      tshcy,
      Tstrok,
      tstrok,
      twixt,
      twoheadleftarrow,
      twoheadrightarrow,
      Uacute: Uacute$1,
      uacute: uacute$1,
      uarr,
      Uarr,
      uArr,
      Uarrocir,
      Ubrcy,
      ubrcy,
      Ubreve,
      ubreve,
      Ucirc: Ucirc$1,
      ucirc: ucirc$1,
      Ucy,
      ucy,
      udarr,
      Udblac,
      udblac,
      udhar,
      ufisht,
      Ufr,
      ufr,
      Ugrave: Ugrave$1,
      ugrave: ugrave$1,
      uHar,
      uharl,
      uharr,
      uhblk,
      ulcorn,
      ulcorner,
      ulcrop,
      ultri,
      Umacr,
      umacr,
      uml: uml$1,
      UnderBar,
      UnderBrace,
      UnderBracket,
      UnderParenthesis,
      Union,
      UnionPlus,
      Uogon,
      uogon,
      Uopf,
      uopf,
      UpArrowBar,
      uparrow,
      UpArrow,
      Uparrow,
      UpArrowDownArrow,
      updownarrow,
      UpDownArrow,
      Updownarrow,
      UpEquilibrium,
      upharpoonleft,
      upharpoonright,
      uplus,
      UpperLeftArrow,
      UpperRightArrow,
      upsi,
      Upsi,
      upsih,
      Upsilon,
      upsilon,
      UpTeeArrow,
      UpTee,
      upuparrows,
      urcorn,
      urcorner,
      urcrop,
      Uring,
      uring,
      urtri,
      Uscr,
      uscr,
      utdot,
      Utilde,
      utilde,
      utri,
      utrif,
      uuarr,
      Uuml: Uuml$1,
      uuml: uuml$1,
      uwangle,
      vangrt,
      varepsilon,
      varkappa,
      varnothing,
      varphi,
      varpi,
      varpropto,
      varr,
      vArr,
      varrho,
      varsigma,
      varsubsetneq,
      varsubsetneqq,
      varsupsetneq,
      varsupsetneqq,
      vartheta,
      vartriangleleft,
      vartriangleright,
      vBar,
      Vbar,
      vBarv,
      Vcy,
      vcy,
      vdash,
      vDash,
      Vdash,
      VDash,
      Vdashl,
      veebar,
      vee,
      Vee,
      veeeq,
      vellip,
      verbar,
      Verbar,
      vert,
      Vert,
      VerticalBar,
      VerticalLine,
      VerticalSeparator,
      VerticalTilde,
      VeryThinSpace,
      Vfr,
      vfr,
      vltri,
      vnsub,
      vnsup,
      Vopf,
      vopf,
      vprop,
      vrtri,
      Vscr,
      vscr,
      vsubnE,
      vsubne,
      vsupnE,
      vsupne,
      Vvdash,
      vzigzag,
      Wcirc,
      wcirc,
      wedbar,
      wedge,
      Wedge,
      wedgeq,
      weierp,
      Wfr,
      wfr,
      Wopf,
      wopf,
      wp,
      wr,
      wreath,
      Wscr,
      wscr,
      xcap,
      xcirc,
      xcup,
      xdtri,
      Xfr,
      xfr,
      xharr,
      xhArr,
      Xi,
      xi,
      xlarr,
      xlArr,
      xmap,
      xnis,
      xodot,
      Xopf,
      xopf,
      xoplus,
      xotime,
      xrarr,
      xrArr,
      Xscr,
      xscr,
      xsqcup,
      xuplus,
      xutri,
      xvee,
      xwedge,
      Yacute: Yacute$1,
      yacute: yacute$1,
      YAcy,
      yacy,
      Ycirc,
      ycirc,
      Ycy,
      ycy,
      yen: yen$1,
      Yfr,
      yfr,
      YIcy,
      yicy,
      Yopf,
      yopf,
      Yscr,
      yscr,
      YUcy,
      yucy,
      yuml: yuml$1,
      Yuml,
      Zacute,
      zacute,
      Zcaron,
      zcaron,
      Zcy,
      zcy,
      Zdot,
      zdot,
      zeetrf,
      ZeroWidthSpace,
      Zeta,
      zeta,
      zfr,
      Zfr,
      ZHcy,
      zhcy,
      zigrarr,
      zopf,
      Zopf,
      Zscr,
      zscr,
      zwj,
      zwnj
    };
    const Aacute = "Á";
    const aacute = "á";
    const Acirc = "Â";
    const acirc = "â";
    const acute = "´";
    const AElig = "Æ";
    const aelig = "æ";
    const Agrave = "À";
    const agrave = "à";
    const amp$1 = "&";
    const AMP = "&";
    const Aring = "Å";
    const aring = "å";
    const Atilde = "Ã";
    const atilde = "ã";
    const Auml = "Ä";
    const auml = "ä";
    const brvbar = "¦";
    const Ccedil = "Ç";
    const ccedil = "ç";
    const cedil = "¸";
    const cent = "¢";
    const copy = "©";
    const COPY = "©";
    const curren = "¤";
    const deg = "°";
    const divide = "÷";
    const Eacute = "É";
    const eacute = "é";
    const Ecirc = "Ê";
    const ecirc = "ê";
    const Egrave = "È";
    const egrave = "è";
    const ETH = "Ð";
    const eth = "ð";
    const Euml = "Ë";
    const euml = "ë";
    const frac12 = "½";
    const frac14 = "¼";
    const frac34 = "¾";
    const gt$1 = ">";
    const GT = ">";
    const Iacute = "Í";
    const iacute = "í";
    const Icirc = "Î";
    const icirc = "î";
    const iexcl = "¡";
    const Igrave = "Ì";
    const igrave = "ì";
    const iquest = "¿";
    const Iuml = "Ï";
    const iuml = "ï";
    const laquo = "«";
    const lt$1 = "<";
    const LT = "<";
    const macr = "¯";
    const micro = "µ";
    const middot = "·";
    const nbsp = " ";
    const not = "¬";
    const Ntilde = "Ñ";
    const ntilde = "ñ";
    const Oacute = "Ó";
    const oacute = "ó";
    const Ocirc = "Ô";
    const ocirc = "ô";
    const Ograve = "Ò";
    const ograve = "ò";
    const ordf = "ª";
    const ordm = "º";
    const Oslash = "Ø";
    const oslash = "ø";
    const Otilde = "Õ";
    const otilde = "õ";
    const Ouml = "Ö";
    const ouml = "ö";
    const para = "¶";
    const plusmn = "±";
    const pound = "£";
    const quot$1 = '"';
    const QUOT = '"';
    const raquo = "»";
    const reg = "®";
    const REG = "®";
    const sect = "§";
    const shy = "­";
    const sup1 = "¹";
    const sup2 = "²";
    const sup3 = "³";
    const szlig = "ß";
    const THORN = "Þ";
    const thorn = "þ";
    const times = "×";
    const Uacute = "Ú";
    const uacute = "ú";
    const Ucirc = "Û";
    const ucirc = "û";
    const Ugrave = "Ù";
    const ugrave = "ù";
    const uml = "¨";
    const Uuml = "Ü";
    const uuml = "ü";
    const Yacute = "Ý";
    const yacute = "ý";
    const yen = "¥";
    const yuml = "ÿ";
    const require$$2 = {
      Aacute,
      aacute,
      Acirc,
      acirc,
      acute,
      AElig,
      aelig,
      Agrave,
      agrave,
      amp: amp$1,
      AMP,
      Aring,
      aring,
      Atilde,
      atilde,
      Auml,
      auml,
      brvbar,
      Ccedil,
      ccedil,
      cedil,
      cent,
      copy,
      COPY,
      curren,
      deg,
      divide,
      Eacute,
      eacute,
      Ecirc,
      ecirc,
      Egrave,
      egrave,
      ETH,
      eth,
      Euml,
      euml,
      frac12,
      frac14,
      frac34,
      gt: gt$1,
      GT,
      Iacute,
      iacute,
      Icirc,
      icirc,
      iexcl,
      Igrave,
      igrave,
      iquest,
      Iuml,
      iuml,
      laquo,
      lt: lt$1,
      LT,
      macr,
      micro,
      middot,
      nbsp,
      not,
      Ntilde,
      ntilde,
      Oacute,
      oacute,
      Ocirc,
      ocirc,
      Ograve,
      ograve,
      ordf,
      ordm,
      Oslash,
      oslash,
      Otilde,
      otilde,
      Ouml,
      ouml,
      para,
      plusmn,
      pound,
      quot: quot$1,
      QUOT,
      raquo,
      reg,
      REG,
      sect,
      shy,
      sup1,
      sup2,
      sup3,
      szlig,
      THORN,
      thorn,
      times,
      Uacute,
      uacute,
      Ucirc,
      ucirc,
      Ugrave,
      ugrave,
      uml,
      Uuml,
      uuml,
      Yacute,
      yacute,
      yen,
      yuml
    };
    const amp = "&";
    const apos = "'";
    const gt = ">";
    const lt = "<";
    const quot = '"';
    const require$$3 = {
      amp,
      apos,
      gt,
      lt,
      quot
    };
    var decode_codepoint = {};
    const require$$0 = {
      "0": 65533,
      "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
    };
    var hasRequiredDecode_codepoint;
    function requireDecode_codepoint() {
      if (hasRequiredDecode_codepoint) return decode_codepoint;
      hasRequiredDecode_codepoint = 1;
      var __importDefault2 = decode_codepoint && decode_codepoint.__importDefault || function(mod2) {
        return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
      };
      Object.defineProperty(decode_codepoint, "__esModule", { value: true });
      var decode_json_1 = __importDefault2(require$$0);
      var fromCodePoint2 = (
        // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
        String.fromCodePoint || function(codePoint) {
          var output2 = "";
          if (codePoint > 65535) {
            codePoint -= 65536;
            output2 += String.fromCharCode(codePoint >>> 10 & 1023 | 55296);
            codePoint = 56320 | codePoint & 1023;
          }
          output2 += String.fromCharCode(codePoint);
          return output2;
        }
      );
      function decodeCodePoint(codePoint) {
        if (codePoint >= 55296 && codePoint <= 57343 || codePoint > 1114111) {
          return "�";
        }
        if (codePoint in decode_json_1.default) {
          codePoint = decode_json_1.default[codePoint];
        }
        return fromCodePoint2(codePoint);
      }
      decode_codepoint.default = decodeCodePoint;
      return decode_codepoint;
    }
    var hasRequiredDecode;
    function requireDecode() {
      if (hasRequiredDecode) return decode;
      hasRequiredDecode = 1;
      var __importDefault2 = decode && decode.__importDefault || function(mod2) {
        return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
      };
      Object.defineProperty(decode, "__esModule", { value: true });
      decode.decodeHTML = decode.decodeHTMLStrict = decode.decodeXML = void 0;
      var entities_json_1 = __importDefault2(require$$1);
      var legacy_json_1 = __importDefault2(require$$2);
      var xml_json_1 = __importDefault2(require$$3);
      var decode_codepoint_1 = __importDefault2(/* @__PURE__ */ requireDecode_codepoint());
      var strictEntityRe = /&(?:[a-zA-Z0-9]+|#[xX][\da-fA-F]+|#\d+);/g;
      decode.decodeXML = getStrictDecoder(xml_json_1.default);
      decode.decodeHTMLStrict = getStrictDecoder(entities_json_1.default);
      function getStrictDecoder(map2) {
        var replace2 = getReplacer(map2);
        return function(str2) {
          return String(str2).replace(strictEntityRe, replace2);
        };
      }
      var sorter = function(a, b) {
        return a < b ? 1 : -1;
      };
      decode.decodeHTML = (function() {
        var legacy2 = Object.keys(legacy_json_1.default).sort(sorter);
        var keys = Object.keys(entities_json_1.default).sort(sorter);
        for (var i2 = 0, j = 0; i2 < keys.length; i2++) {
          if (legacy2[j] === keys[i2]) {
            keys[i2] += ";?";
            j++;
          } else {
            keys[i2] += ";";
          }
        }
        var re2 = new RegExp("&(?:" + keys.join("|") + "|#[xX][\\da-fA-F]+;?|#\\d+;?)", "g");
        var replace2 = getReplacer(entities_json_1.default);
        function replacer(str2) {
          if (str2.substr(-1) !== ";")
            str2 += ";";
          return replace2(str2);
        }
        return function(str2) {
          return String(str2).replace(re2, replacer);
        };
      })();
      function getReplacer(map2) {
        return function replace2(str2) {
          if (str2.charAt(1) === "#") {
            var secondChar = str2.charAt(2);
            if (secondChar === "X" || secondChar === "x") {
              return decode_codepoint_1.default(parseInt(str2.substr(3), 16));
            }
            return decode_codepoint_1.default(parseInt(str2.substr(2), 10));
          }
          return map2[str2.slice(1, -1)] || str2;
        };
      }
      return decode;
    }
    var encode = {};
    var hasRequiredEncode;
    function requireEncode() {
      if (hasRequiredEncode) return encode;
      hasRequiredEncode = 1;
      var __importDefault2 = encode && encode.__importDefault || function(mod2) {
        return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
      };
      Object.defineProperty(encode, "__esModule", { value: true });
      encode.escapeUTF8 = encode.escape = encode.encodeNonAsciiHTML = encode.encodeHTML = encode.encodeXML = void 0;
      var xml_json_1 = __importDefault2(require$$3);
      var inverseXML = getInverseObj(xml_json_1.default);
      var xmlReplacer = getInverseReplacer(inverseXML);
      encode.encodeXML = getASCIIEncoder(inverseXML);
      var entities_json_1 = __importDefault2(require$$1);
      var inverseHTML = getInverseObj(entities_json_1.default);
      var htmlReplacer = getInverseReplacer(inverseHTML);
      encode.encodeHTML = getInverse(inverseHTML, htmlReplacer);
      encode.encodeNonAsciiHTML = getASCIIEncoder(inverseHTML);
      function getInverseObj(obj) {
        return Object.keys(obj).sort().reduce(function(inverse, name2) {
          inverse[obj[name2]] = "&" + name2 + ";";
          return inverse;
        }, {});
      }
      function getInverseReplacer(inverse) {
        var single = [];
        var multiple = [];
        for (var _i = 0, _a2 = Object.keys(inverse); _i < _a2.length; _i++) {
          var k2 = _a2[_i];
          if (k2.length === 1) {
            single.push("\\" + k2);
          } else {
            multiple.push(k2);
          }
        }
        single.sort();
        for (var start2 = 0; start2 < single.length - 1; start2++) {
          var end2 = start2;
          while (end2 < single.length - 1 && single[end2].charCodeAt(1) + 1 === single[end2 + 1].charCodeAt(1)) {
            end2 += 1;
          }
          var count = 1 + end2 - start2;
          if (count < 3)
            continue;
          single.splice(start2, count, single[start2] + "-" + single[end2]);
        }
        multiple.unshift("[" + single.join("") + "]");
        return new RegExp(multiple.join("|"), "g");
      }
      var reNonASCII = /(?:[\x80-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/g;
      var getCodePoint = (
        // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
        String.prototype.codePointAt != null ? (
          // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
          function(str2) {
            return str2.codePointAt(0);
          }
        ) : (
          // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
          function(c2) {
            return (c2.charCodeAt(0) - 55296) * 1024 + c2.charCodeAt(1) - 56320 + 65536;
          }
        )
      );
      function singleCharReplacer(c2) {
        return "&#x" + (c2.length > 1 ? getCodePoint(c2) : c2.charCodeAt(0)).toString(16).toUpperCase() + ";";
      }
      function getInverse(inverse, re2) {
        return function(data) {
          return data.replace(re2, function(name2) {
            return inverse[name2];
          }).replace(reNonASCII, singleCharReplacer);
        };
      }
      var reEscapeChars = new RegExp(xmlReplacer.source + "|" + reNonASCII.source, "g");
      function escape2(data) {
        return data.replace(reEscapeChars, singleCharReplacer);
      }
      encode.escape = escape2;
      function escapeUTF8(data) {
        return data.replace(xmlReplacer, singleCharReplacer);
      }
      encode.escapeUTF8 = escapeUTF8;
      function getASCIIEncoder(obj) {
        return function(data) {
          return data.replace(reEscapeChars, function(c2) {
            return obj[c2] || singleCharReplacer(c2);
          });
        };
      }
      return encode;
    }
    var hasRequiredLib$9;
    function requireLib$9() {
      if (hasRequiredLib$9) return lib$4;
      hasRequiredLib$9 = 1;
      (function(exports2) {
        Object.defineProperty(exports2, "__esModule", { value: true });
        exports2.decodeXMLStrict = exports2.decodeHTML5Strict = exports2.decodeHTML4Strict = exports2.decodeHTML5 = exports2.decodeHTML4 = exports2.decodeHTMLStrict = exports2.decodeHTML = exports2.decodeXML = exports2.encodeHTML5 = exports2.encodeHTML4 = exports2.escapeUTF8 = exports2.escape = exports2.encodeNonAsciiHTML = exports2.encodeHTML = exports2.encodeXML = exports2.encode = exports2.decodeStrict = exports2.decode = void 0;
        var decode_1 = /* @__PURE__ */ requireDecode();
        var encode_1 = /* @__PURE__ */ requireEncode();
        function decode2(data, level) {
          return (!level || level <= 0 ? decode_1.decodeXML : decode_1.decodeHTML)(data);
        }
        exports2.decode = decode2;
        function decodeStrict(data, level) {
          return (!level || level <= 0 ? decode_1.decodeXML : decode_1.decodeHTMLStrict)(data);
        }
        exports2.decodeStrict = decodeStrict;
        function encode2(data, level) {
          return (!level || level <= 0 ? encode_1.encodeXML : encode_1.encodeHTML)(data);
        }
        exports2.encode = encode2;
        var encode_2 = /* @__PURE__ */ requireEncode();
        Object.defineProperty(exports2, "encodeXML", { enumerable: true, get: function() {
          return encode_2.encodeXML;
        } });
        Object.defineProperty(exports2, "encodeHTML", { enumerable: true, get: function() {
          return encode_2.encodeHTML;
        } });
        Object.defineProperty(exports2, "encodeNonAsciiHTML", { enumerable: true, get: function() {
          return encode_2.encodeNonAsciiHTML;
        } });
        Object.defineProperty(exports2, "escape", { enumerable: true, get: function() {
          return encode_2.escape;
        } });
        Object.defineProperty(exports2, "escapeUTF8", { enumerable: true, get: function() {
          return encode_2.escapeUTF8;
        } });
        Object.defineProperty(exports2, "encodeHTML4", { enumerable: true, get: function() {
          return encode_2.encodeHTML;
        } });
        Object.defineProperty(exports2, "encodeHTML5", { enumerable: true, get: function() {
          return encode_2.encodeHTML;
        } });
        var decode_2 = /* @__PURE__ */ requireDecode();
        Object.defineProperty(exports2, "decodeXML", { enumerable: true, get: function() {
          return decode_2.decodeXML;
        } });
        Object.defineProperty(exports2, "decodeHTML", { enumerable: true, get: function() {
          return decode_2.decodeHTML;
        } });
        Object.defineProperty(exports2, "decodeHTMLStrict", { enumerable: true, get: function() {
          return decode_2.decodeHTMLStrict;
        } });
        Object.defineProperty(exports2, "decodeHTML4", { enumerable: true, get: function() {
          return decode_2.decodeHTML;
        } });
        Object.defineProperty(exports2, "decodeHTML5", { enumerable: true, get: function() {
          return decode_2.decodeHTML;
        } });
        Object.defineProperty(exports2, "decodeHTML4Strict", { enumerable: true, get: function() {
          return decode_2.decodeHTMLStrict;
        } });
        Object.defineProperty(exports2, "decodeHTML5Strict", { enumerable: true, get: function() {
          return decode_2.decodeHTMLStrict;
        } });
        Object.defineProperty(exports2, "decodeXMLStrict", { enumerable: true, get: function() {
          return decode_2.decodeXML;
        } });
      })(lib$4);
      return lib$4;
    }
    var foreignNames = {};
    var hasRequiredForeignNames;
    function requireForeignNames() {
      if (hasRequiredForeignNames) return foreignNames;
      hasRequiredForeignNames = 1;
      Object.defineProperty(foreignNames, "__esModule", { value: true });
      foreignNames.attributeNames = foreignNames.elementNames = void 0;
      foreignNames.elementNames = /* @__PURE__ */ new Map([
        ["altglyph", "altGlyph"],
        ["altglyphdef", "altGlyphDef"],
        ["altglyphitem", "altGlyphItem"],
        ["animatecolor", "animateColor"],
        ["animatemotion", "animateMotion"],
        ["animatetransform", "animateTransform"],
        ["clippath", "clipPath"],
        ["feblend", "feBlend"],
        ["fecolormatrix", "feColorMatrix"],
        ["fecomponenttransfer", "feComponentTransfer"],
        ["fecomposite", "feComposite"],
        ["feconvolvematrix", "feConvolveMatrix"],
        ["fediffuselighting", "feDiffuseLighting"],
        ["fedisplacementmap", "feDisplacementMap"],
        ["fedistantlight", "feDistantLight"],
        ["fedropshadow", "feDropShadow"],
        ["feflood", "feFlood"],
        ["fefunca", "feFuncA"],
        ["fefuncb", "feFuncB"],
        ["fefuncg", "feFuncG"],
        ["fefuncr", "feFuncR"],
        ["fegaussianblur", "feGaussianBlur"],
        ["feimage", "feImage"],
        ["femerge", "feMerge"],
        ["femergenode", "feMergeNode"],
        ["femorphology", "feMorphology"],
        ["feoffset", "feOffset"],
        ["fepointlight", "fePointLight"],
        ["fespecularlighting", "feSpecularLighting"],
        ["fespotlight", "feSpotLight"],
        ["fetile", "feTile"],
        ["feturbulence", "feTurbulence"],
        ["foreignobject", "foreignObject"],
        ["glyphref", "glyphRef"],
        ["lineargradient", "linearGradient"],
        ["radialgradient", "radialGradient"],
        ["textpath", "textPath"]
      ]);
      foreignNames.attributeNames = /* @__PURE__ */ new Map([
        ["definitionurl", "definitionURL"],
        ["attributename", "attributeName"],
        ["attributetype", "attributeType"],
        ["basefrequency", "baseFrequency"],
        ["baseprofile", "baseProfile"],
        ["calcmode", "calcMode"],
        ["clippathunits", "clipPathUnits"],
        ["diffuseconstant", "diffuseConstant"],
        ["edgemode", "edgeMode"],
        ["filterunits", "filterUnits"],
        ["glyphref", "glyphRef"],
        ["gradienttransform", "gradientTransform"],
        ["gradientunits", "gradientUnits"],
        ["kernelmatrix", "kernelMatrix"],
        ["kernelunitlength", "kernelUnitLength"],
        ["keypoints", "keyPoints"],
        ["keysplines", "keySplines"],
        ["keytimes", "keyTimes"],
        ["lengthadjust", "lengthAdjust"],
        ["limitingconeangle", "limitingConeAngle"],
        ["markerheight", "markerHeight"],
        ["markerunits", "markerUnits"],
        ["markerwidth", "markerWidth"],
        ["maskcontentunits", "maskContentUnits"],
        ["maskunits", "maskUnits"],
        ["numoctaves", "numOctaves"],
        ["pathlength", "pathLength"],
        ["patterncontentunits", "patternContentUnits"],
        ["patterntransform", "patternTransform"],
        ["patternunits", "patternUnits"],
        ["pointsatx", "pointsAtX"],
        ["pointsaty", "pointsAtY"],
        ["pointsatz", "pointsAtZ"],
        ["preservealpha", "preserveAlpha"],
        ["preserveaspectratio", "preserveAspectRatio"],
        ["primitiveunits", "primitiveUnits"],
        ["refx", "refX"],
        ["refy", "refY"],
        ["repeatcount", "repeatCount"],
        ["repeatdur", "repeatDur"],
        ["requiredextensions", "requiredExtensions"],
        ["requiredfeatures", "requiredFeatures"],
        ["specularconstant", "specularConstant"],
        ["specularexponent", "specularExponent"],
        ["spreadmethod", "spreadMethod"],
        ["startoffset", "startOffset"],
        ["stddeviation", "stdDeviation"],
        ["stitchtiles", "stitchTiles"],
        ["surfacescale", "surfaceScale"],
        ["systemlanguage", "systemLanguage"],
        ["tablevalues", "tableValues"],
        ["targetx", "targetX"],
        ["targety", "targetY"],
        ["textlength", "textLength"],
        ["viewbox", "viewBox"],
        ["viewtarget", "viewTarget"],
        ["xchannelselector", "xChannelSelector"],
        ["ychannelselector", "yChannelSelector"],
        ["zoomandpan", "zoomAndPan"]
      ]);
      return foreignNames;
    }
    var hasRequiredLib$8;
    function requireLib$8() {
      if (hasRequiredLib$8) return lib$5;
      hasRequiredLib$8 = 1;
      var __assign2 = lib$5 && lib$5.__assign || function() {
        __assign2 = Object.assign || function(t2) {
          for (var s, i2 = 1, n = arguments.length; i2 < n; i2++) {
            s = arguments[i2];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
              t2[p] = s[p];
          }
          return t2;
        };
        return __assign2.apply(this, arguments);
      };
      var __createBinding2 = lib$5 && lib$5.__createBinding || (Object.create ? (function(o, m, k2, k22) {
        if (k22 === void 0) k22 = k2;
        Object.defineProperty(o, k22, { enumerable: true, get: function() {
          return m[k2];
        } });
      }) : (function(o, m, k2, k22) {
        if (k22 === void 0) k22 = k2;
        o[k22] = m[k2];
      }));
      var __setModuleDefault2 = lib$5 && lib$5.__setModuleDefault || (Object.create ? (function(o, v) {
        Object.defineProperty(o, "default", { enumerable: true, value: v });
      }) : function(o, v) {
        o["default"] = v;
      });
      var __importStar2 = lib$5 && lib$5.__importStar || function(mod2) {
        if (mod2 && mod2.__esModule) return mod2;
        var result2 = {};
        if (mod2 != null) {
          for (var k2 in mod2) if (k2 !== "default" && Object.prototype.hasOwnProperty.call(mod2, k2)) __createBinding2(result2, mod2, k2);
        }
        __setModuleDefault2(result2, mod2);
        return result2;
      };
      Object.defineProperty(lib$5, "__esModule", { value: true });
      var ElementType = __importStar2(/* @__PURE__ */ requireLib$b());
      var entities_1 = /* @__PURE__ */ requireLib$9();
      var foreignNames_1 = /* @__PURE__ */ requireForeignNames();
      var unencodedElements = /* @__PURE__ */ new Set([
        "style",
        "script",
        "xmp",
        "iframe",
        "noembed",
        "noframes",
        "plaintext",
        "noscript"
      ]);
      function formatAttributes(attributes2, opts) {
        if (!attributes2)
          return;
        return Object.keys(attributes2).map(function(key2) {
          var _a2, _b2;
          var value2 = (_a2 = attributes2[key2]) !== null && _a2 !== void 0 ? _a2 : "";
          if (opts.xmlMode === "foreign") {
            key2 = (_b2 = foreignNames_1.attributeNames.get(key2)) !== null && _b2 !== void 0 ? _b2 : key2;
          }
          if (!opts.emptyAttrs && !opts.xmlMode && value2 === "") {
            return key2;
          }
          return key2 + '="' + (opts.decodeEntities !== false ? entities_1.encodeXML(value2) : value2.replace(/"/g, "&quot;")) + '"';
        }).join(" ");
      }
      var singleTag = /* @__PURE__ */ new Set([
        "area",
        "base",
        "basefont",
        "br",
        "col",
        "command",
        "embed",
        "frame",
        "hr",
        "img",
        "input",
        "isindex",
        "keygen",
        "link",
        "meta",
        "param",
        "source",
        "track",
        "wbr"
      ]);
      function render2(node2, options2) {
        if (options2 === void 0) {
          options2 = {};
        }
        var nodes = "length" in node2 ? node2 : [node2];
        var output2 = "";
        for (var i2 = 0; i2 < nodes.length; i2++) {
          output2 += renderNode(nodes[i2], options2);
        }
        return output2;
      }
      lib$5.default = render2;
      function renderNode(node2, options2) {
        switch (node2.type) {
          case ElementType.Root:
            return render2(node2.children, options2);
          case ElementType.Directive:
          case ElementType.Doctype:
            return renderDirective(node2);
          case ElementType.Comment:
            return renderComment(node2);
          case ElementType.CDATA:
            return renderCdata(node2);
          case ElementType.Script:
          case ElementType.Style:
          case ElementType.Tag:
            return renderTag(node2, options2);
          case ElementType.Text:
            return renderText(node2, options2);
        }
      }
      var foreignModeIntegrationPoints = /* @__PURE__ */ new Set([
        "mi",
        "mo",
        "mn",
        "ms",
        "mtext",
        "annotation-xml",
        "foreignObject",
        "desc",
        "title"
      ]);
      var foreignElements = /* @__PURE__ */ new Set(["svg", "math"]);
      function renderTag(elem, opts) {
        var _a2;
        if (opts.xmlMode === "foreign") {
          elem.name = (_a2 = foreignNames_1.elementNames.get(elem.name)) !== null && _a2 !== void 0 ? _a2 : elem.name;
          if (elem.parent && foreignModeIntegrationPoints.has(elem.parent.name)) {
            opts = __assign2(__assign2({}, opts), { xmlMode: false });
          }
        }
        if (!opts.xmlMode && foreignElements.has(elem.name)) {
          opts = __assign2(__assign2({}, opts), { xmlMode: "foreign" });
        }
        var tag = "<" + elem.name;
        var attribs = formatAttributes(elem.attribs, opts);
        if (attribs) {
          tag += " " + attribs;
        }
        if (elem.children.length === 0 && (opts.xmlMode ? (
          // In XML mode or foreign mode, and user hasn't explicitly turned off self-closing tags
          opts.selfClosingTags !== false
        ) : (
          // User explicitly asked for self-closing tags, even in HTML mode
          opts.selfClosingTags && singleTag.has(elem.name)
        ))) {
          if (!opts.xmlMode)
            tag += " ";
          tag += "/>";
        } else {
          tag += ">";
          if (elem.children.length > 0) {
            tag += render2(elem.children, opts);
          }
          if (opts.xmlMode || !singleTag.has(elem.name)) {
            tag += "</" + elem.name + ">";
          }
        }
        return tag;
      }
      function renderDirective(elem) {
        return "<" + elem.data + ">";
      }
      function renderText(elem, opts) {
        var data = elem.data || "";
        if (opts.decodeEntities !== false && !(!opts.xmlMode && elem.parent && unencodedElements.has(elem.parent.name))) {
          data = entities_1.encodeXML(data);
        }
        return data;
      }
      function renderCdata(elem) {
        return "<![CDATA[" + elem.children[0].data + "]]>";
      }
      function renderComment(elem) {
        return "<!--" + elem.data + "-->";
      }
      return lib$5;
    }
    var hasRequiredStringify$1;
    function requireStringify$1() {
      if (hasRequiredStringify$1) return stringify$1;
      hasRequiredStringify$1 = 1;
      var __importDefault2 = stringify$1 && stringify$1.__importDefault || function(mod2) {
        return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
      };
      Object.defineProperty(stringify$1, "__esModule", { value: true });
      stringify$1.innerText = stringify$1.textContent = stringify$1.getText = stringify$1.getInnerHTML = stringify$1.getOuterHTML = void 0;
      var domhandler_1 = /* @__PURE__ */ requireLib$a();
      var dom_serializer_1 = __importDefault2(/* @__PURE__ */ requireLib$8());
      var domelementtype_1 = /* @__PURE__ */ requireLib$b();
      function getOuterHTML(node2, options2) {
        return (0, dom_serializer_1.default)(node2, options2);
      }
      stringify$1.getOuterHTML = getOuterHTML;
      function getInnerHTML(node2, options2) {
        return (0, domhandler_1.hasChildren)(node2) ? node2.children.map(function(node3) {
          return getOuterHTML(node3, options2);
        }).join("") : "";
      }
      stringify$1.getInnerHTML = getInnerHTML;
      function getText(node2) {
        if (Array.isArray(node2))
          return node2.map(getText).join("");
        if ((0, domhandler_1.isTag)(node2))
          return node2.name === "br" ? "\n" : getText(node2.children);
        if ((0, domhandler_1.isCDATA)(node2))
          return getText(node2.children);
        if ((0, domhandler_1.isText)(node2))
          return node2.data;
        return "";
      }
      stringify$1.getText = getText;
      function textContent(node2) {
        if (Array.isArray(node2))
          return node2.map(textContent).join("");
        if ((0, domhandler_1.hasChildren)(node2) && !(0, domhandler_1.isComment)(node2)) {
          return textContent(node2.children);
        }
        if ((0, domhandler_1.isText)(node2))
          return node2.data;
        return "";
      }
      stringify$1.textContent = textContent;
      function innerText(node2) {
        if (Array.isArray(node2))
          return node2.map(innerText).join("");
        if ((0, domhandler_1.hasChildren)(node2) && (node2.type === domelementtype_1.ElementType.Tag || (0, domhandler_1.isCDATA)(node2))) {
          return innerText(node2.children);
        }
        if ((0, domhandler_1.isText)(node2))
          return node2.data;
        return "";
      }
      stringify$1.innerText = innerText;
      return stringify$1;
    }
    var traversal = {};
    var hasRequiredTraversal;
    function requireTraversal() {
      if (hasRequiredTraversal) return traversal;
      hasRequiredTraversal = 1;
      Object.defineProperty(traversal, "__esModule", { value: true });
      traversal.prevElementSibling = traversal.nextElementSibling = traversal.getName = traversal.hasAttrib = traversal.getAttributeValue = traversal.getSiblings = traversal.getParent = traversal.getChildren = void 0;
      var domhandler_1 = /* @__PURE__ */ requireLib$a();
      var emptyArray = [];
      function getChildren2(elem) {
        var _a2;
        return (_a2 = elem.children) !== null && _a2 !== void 0 ? _a2 : emptyArray;
      }
      traversal.getChildren = getChildren2;
      function getParent(elem) {
        return elem.parent || null;
      }
      traversal.getParent = getParent;
      function getSiblings(elem) {
        var _a2, _b2;
        var parent = getParent(elem);
        if (parent != null)
          return getChildren2(parent);
        var siblings = [elem];
        var prev = elem.prev, next = elem.next;
        while (prev != null) {
          siblings.unshift(prev);
          _a2 = prev, prev = _a2.prev;
        }
        while (next != null) {
          siblings.push(next);
          _b2 = next, next = _b2.next;
        }
        return siblings;
      }
      traversal.getSiblings = getSiblings;
      function getAttributeValue(elem, name2) {
        var _a2;
        return (_a2 = elem.attribs) === null || _a2 === void 0 ? void 0 : _a2[name2];
      }
      traversal.getAttributeValue = getAttributeValue;
      function hasAttrib(elem, name2) {
        return elem.attribs != null && Object.prototype.hasOwnProperty.call(elem.attribs, name2) && elem.attribs[name2] != null;
      }
      traversal.hasAttrib = hasAttrib;
      function getName(elem) {
        return elem.name;
      }
      traversal.getName = getName;
      function nextElementSibling(elem) {
        var _a2;
        var next = elem.next;
        while (next !== null && !(0, domhandler_1.isTag)(next))
          _a2 = next, next = _a2.next;
        return next;
      }
      traversal.nextElementSibling = nextElementSibling;
      function prevElementSibling(elem) {
        var _a2;
        var prev = elem.prev;
        while (prev !== null && !(0, domhandler_1.isTag)(prev))
          _a2 = prev, prev = _a2.prev;
        return prev;
      }
      traversal.prevElementSibling = prevElementSibling;
      return traversal;
    }
    var manipulation$1 = {};
    var hasRequiredManipulation$1;
    function requireManipulation$1() {
      if (hasRequiredManipulation$1) return manipulation$1;
      hasRequiredManipulation$1 = 1;
      Object.defineProperty(manipulation$1, "__esModule", { value: true });
      manipulation$1.prepend = manipulation$1.prependChild = manipulation$1.append = manipulation$1.appendChild = manipulation$1.replaceElement = manipulation$1.removeElement = void 0;
      function removeElement(elem) {
        if (elem.prev)
          elem.prev.next = elem.next;
        if (elem.next)
          elem.next.prev = elem.prev;
        if (elem.parent) {
          var childs = elem.parent.children;
          childs.splice(childs.lastIndexOf(elem), 1);
        }
      }
      manipulation$1.removeElement = removeElement;
      function replaceElement(elem, replacement) {
        var prev = replacement.prev = elem.prev;
        if (prev) {
          prev.next = replacement;
        }
        var next = replacement.next = elem.next;
        if (next) {
          next.prev = replacement;
        }
        var parent = replacement.parent = elem.parent;
        if (parent) {
          var childs = parent.children;
          childs[childs.lastIndexOf(elem)] = replacement;
        }
      }
      manipulation$1.replaceElement = replaceElement;
      function appendChild(elem, child) {
        removeElement(child);
        child.next = null;
        child.parent = elem;
        if (elem.children.push(child) > 1) {
          var sibling = elem.children[elem.children.length - 2];
          sibling.next = child;
          child.prev = sibling;
        } else {
          child.prev = null;
        }
      }
      manipulation$1.appendChild = appendChild;
      function append(elem, next) {
        removeElement(next);
        var parent = elem.parent;
        var currNext = elem.next;
        next.next = currNext;
        next.prev = elem;
        elem.next = next;
        next.parent = parent;
        if (currNext) {
          currNext.prev = next;
          if (parent) {
            var childs = parent.children;
            childs.splice(childs.lastIndexOf(currNext), 0, next);
          }
        } else if (parent) {
          parent.children.push(next);
        }
      }
      manipulation$1.append = append;
      function prependChild(elem, child) {
        removeElement(child);
        child.parent = elem;
        child.prev = null;
        if (elem.children.unshift(child) !== 1) {
          var sibling = elem.children[1];
          sibling.prev = child;
          child.next = sibling;
        } else {
          child.next = null;
        }
      }
      manipulation$1.prependChild = prependChild;
      function prepend(elem, prev) {
        removeElement(prev);
        var parent = elem.parent;
        if (parent) {
          var childs = parent.children;
          childs.splice(childs.indexOf(elem), 0, prev);
        }
        if (elem.prev) {
          elem.prev.next = prev;
        }
        prev.parent = parent;
        prev.prev = elem.prev;
        prev.next = elem;
        elem.prev = prev;
      }
      manipulation$1.prepend = prepend;
      return manipulation$1;
    }
    var querying = {};
    var hasRequiredQuerying;
    function requireQuerying() {
      if (hasRequiredQuerying) return querying;
      hasRequiredQuerying = 1;
      Object.defineProperty(querying, "__esModule", { value: true });
      querying.findAll = querying.existsOne = querying.findOne = querying.findOneChild = querying.find = querying.filter = void 0;
      var domhandler_1 = /* @__PURE__ */ requireLib$a();
      function filter(test, node2, recurse, limit) {
        if (recurse === void 0) {
          recurse = true;
        }
        if (limit === void 0) {
          limit = Infinity;
        }
        if (!Array.isArray(node2))
          node2 = [node2];
        return find2(test, node2, recurse, limit);
      }
      querying.filter = filter;
      function find2(test, nodes, recurse, limit) {
        var result2 = [];
        for (var _i = 0, nodes_1 = nodes; _i < nodes_1.length; _i++) {
          var elem = nodes_1[_i];
          if (test(elem)) {
            result2.push(elem);
            if (--limit <= 0)
              break;
          }
          if (recurse && (0, domhandler_1.hasChildren)(elem) && elem.children.length > 0) {
            var children2 = find2(test, elem.children, recurse, limit);
            result2.push.apply(result2, children2);
            limit -= children2.length;
            if (limit <= 0)
              break;
          }
        }
        return result2;
      }
      querying.find = find2;
      function findOneChild(test, nodes) {
        return nodes.find(test);
      }
      querying.findOneChild = findOneChild;
      function findOne(test, nodes, recurse) {
        if (recurse === void 0) {
          recurse = true;
        }
        var elem = null;
        for (var i2 = 0; i2 < nodes.length && !elem; i2++) {
          var checked = nodes[i2];
          if (!(0, domhandler_1.isTag)(checked)) {
            continue;
          } else if (test(checked)) {
            elem = checked;
          } else if (recurse && checked.children.length > 0) {
            elem = findOne(test, checked.children);
          }
        }
        return elem;
      }
      querying.findOne = findOne;
      function existsOne(test, nodes) {
        return nodes.some(function(checked) {
          return (0, domhandler_1.isTag)(checked) && (test(checked) || checked.children.length > 0 && existsOne(test, checked.children));
        });
      }
      querying.existsOne = existsOne;
      function findAll(test, nodes) {
        var _a2;
        var result2 = [];
        var stack2 = nodes.filter(domhandler_1.isTag);
        var elem;
        while (elem = stack2.shift()) {
          var children2 = (_a2 = elem.children) === null || _a2 === void 0 ? void 0 : _a2.filter(domhandler_1.isTag);
          if (children2 && children2.length > 0) {
            stack2.unshift.apply(stack2, children2);
          }
          if (test(elem))
            result2.push(elem);
        }
        return result2;
      }
      querying.findAll = findAll;
      return querying;
    }
    var legacy = {};
    var hasRequiredLegacy;
    function requireLegacy() {
      if (hasRequiredLegacy) return legacy;
      hasRequiredLegacy = 1;
      Object.defineProperty(legacy, "__esModule", { value: true });
      legacy.getElementsByTagType = legacy.getElementsByTagName = legacy.getElementById = legacy.getElements = legacy.testElement = void 0;
      var domhandler_1 = /* @__PURE__ */ requireLib$a();
      var querying_1 = /* @__PURE__ */ requireQuerying();
      var Checks = {
        tag_name: function(name2) {
          if (typeof name2 === "function") {
            return function(elem) {
              return (0, domhandler_1.isTag)(elem) && name2(elem.name);
            };
          } else if (name2 === "*") {
            return domhandler_1.isTag;
          }
          return function(elem) {
            return (0, domhandler_1.isTag)(elem) && elem.name === name2;
          };
        },
        tag_type: function(type) {
          if (typeof type === "function") {
            return function(elem) {
              return type(elem.type);
            };
          }
          return function(elem) {
            return elem.type === type;
          };
        },
        tag_contains: function(data) {
          if (typeof data === "function") {
            return function(elem) {
              return (0, domhandler_1.isText)(elem) && data(elem.data);
            };
          }
          return function(elem) {
            return (0, domhandler_1.isText)(elem) && elem.data === data;
          };
        }
      };
      function getAttribCheck(attrib, value2) {
        if (typeof value2 === "function") {
          return function(elem) {
            return (0, domhandler_1.isTag)(elem) && value2(elem.attribs[attrib]);
          };
        }
        return function(elem) {
          return (0, domhandler_1.isTag)(elem) && elem.attribs[attrib] === value2;
        };
      }
      function combineFuncs(a, b) {
        return function(elem) {
          return a(elem) || b(elem);
        };
      }
      function compileTest(options2) {
        var funcs = Object.keys(options2).map(function(key2) {
          var value2 = options2[key2];
          return Object.prototype.hasOwnProperty.call(Checks, key2) ? Checks[key2](value2) : getAttribCheck(key2, value2);
        });
        return funcs.length === 0 ? null : funcs.reduce(combineFuncs);
      }
      function testElement(options2, node2) {
        var test = compileTest(options2);
        return test ? test(node2) : true;
      }
      legacy.testElement = testElement;
      function getElements(options2, nodes, recurse, limit) {
        if (limit === void 0) {
          limit = Infinity;
        }
        var test = compileTest(options2);
        return test ? (0, querying_1.filter)(test, nodes, recurse, limit) : [];
      }
      legacy.getElements = getElements;
      function getElementById(id, nodes, recurse) {
        if (recurse === void 0) {
          recurse = true;
        }
        if (!Array.isArray(nodes))
          nodes = [nodes];
        return (0, querying_1.findOne)(getAttribCheck("id", id), nodes, recurse);
      }
      legacy.getElementById = getElementById;
      function getElementsByTagName(tagName, nodes, recurse, limit) {
        if (recurse === void 0) {
          recurse = true;
        }
        if (limit === void 0) {
          limit = Infinity;
        }
        return (0, querying_1.filter)(Checks.tag_name(tagName), nodes, recurse, limit);
      }
      legacy.getElementsByTagName = getElementsByTagName;
      function getElementsByTagType(type, nodes, recurse, limit) {
        if (recurse === void 0) {
          recurse = true;
        }
        if (limit === void 0) {
          limit = Infinity;
        }
        return (0, querying_1.filter)(Checks.tag_type(type), nodes, recurse, limit);
      }
      legacy.getElementsByTagType = getElementsByTagType;
      return legacy;
    }
    var helpers$1 = {};
    var hasRequiredHelpers$1;
    function requireHelpers$1() {
      if (hasRequiredHelpers$1) return helpers$1;
      hasRequiredHelpers$1 = 1;
      Object.defineProperty(helpers$1, "__esModule", { value: true });
      helpers$1.uniqueSort = helpers$1.compareDocumentPosition = helpers$1.removeSubsets = void 0;
      var domhandler_1 = /* @__PURE__ */ requireLib$a();
      function removeSubsets(nodes) {
        var idx = nodes.length;
        while (--idx >= 0) {
          var node2 = nodes[idx];
          if (idx > 0 && nodes.lastIndexOf(node2, idx - 1) >= 0) {
            nodes.splice(idx, 1);
            continue;
          }
          for (var ancestor = node2.parent; ancestor; ancestor = ancestor.parent) {
            if (nodes.includes(ancestor)) {
              nodes.splice(idx, 1);
              break;
            }
          }
        }
        return nodes;
      }
      helpers$1.removeSubsets = removeSubsets;
      function compareDocumentPosition(nodeA, nodeB) {
        var aParents = [];
        var bParents = [];
        if (nodeA === nodeB) {
          return 0;
        }
        var current2 = (0, domhandler_1.hasChildren)(nodeA) ? nodeA : nodeA.parent;
        while (current2) {
          aParents.unshift(current2);
          current2 = current2.parent;
        }
        current2 = (0, domhandler_1.hasChildren)(nodeB) ? nodeB : nodeB.parent;
        while (current2) {
          bParents.unshift(current2);
          current2 = current2.parent;
        }
        var maxIdx = Math.min(aParents.length, bParents.length);
        var idx = 0;
        while (idx < maxIdx && aParents[idx] === bParents[idx]) {
          idx++;
        }
        if (idx === 0) {
          return 1;
        }
        var sharedParent = aParents[idx - 1];
        var siblings = sharedParent.children;
        var aSibling = aParents[idx];
        var bSibling = bParents[idx];
        if (siblings.indexOf(aSibling) > siblings.indexOf(bSibling)) {
          if (sharedParent === nodeB) {
            return 4 | 16;
          }
          return 4;
        }
        if (sharedParent === nodeA) {
          return 2 | 8;
        }
        return 2;
      }
      helpers$1.compareDocumentPosition = compareDocumentPosition;
      function uniqueSort(nodes) {
        nodes = nodes.filter(function(node2, i2, arr2) {
          return !arr2.includes(node2, i2 + 1);
        });
        nodes.sort(function(a, b) {
          var relative = compareDocumentPosition(a, b);
          if (relative & 2) {
            return -1;
          } else if (relative & 4) {
            return 1;
          }
          return 0;
        });
        return nodes;
      }
      helpers$1.uniqueSort = uniqueSort;
      return helpers$1;
    }
    var feeds = {};
    var hasRequiredFeeds;
    function requireFeeds() {
      if (hasRequiredFeeds) return feeds;
      hasRequiredFeeds = 1;
      Object.defineProperty(feeds, "__esModule", { value: true });
      feeds.getFeed = void 0;
      var stringify_1 = /* @__PURE__ */ requireStringify$1();
      var legacy_1 = /* @__PURE__ */ requireLegacy();
      function getFeed(doc2) {
        var feedRoot = getOneElement(isValidFeed, doc2);
        return !feedRoot ? null : feedRoot.name === "feed" ? getAtomFeed(feedRoot) : getRssFeed(feedRoot);
      }
      feeds.getFeed = getFeed;
      function getAtomFeed(feedRoot) {
        var _a2;
        var childs = feedRoot.children;
        var feed = {
          type: "atom",
          items: (0, legacy_1.getElementsByTagName)("entry", childs).map(function(item2) {
            var _a3;
            var children2 = item2.children;
            var entry = { media: getMediaElements(children2) };
            addConditionally(entry, "id", "id", children2);
            addConditionally(entry, "title", "title", children2);
            var href2 = (_a3 = getOneElement("link", children2)) === null || _a3 === void 0 ? void 0 : _a3.attribs.href;
            if (href2) {
              entry.link = href2;
            }
            var description2 = fetch2("summary", children2) || fetch2("content", children2);
            if (description2) {
              entry.description = description2;
            }
            var pubDate = fetch2("updated", children2);
            if (pubDate) {
              entry.pubDate = new Date(pubDate);
            }
            return entry;
          })
        };
        addConditionally(feed, "id", "id", childs);
        addConditionally(feed, "title", "title", childs);
        var href = (_a2 = getOneElement("link", childs)) === null || _a2 === void 0 ? void 0 : _a2.attribs.href;
        if (href) {
          feed.link = href;
        }
        addConditionally(feed, "description", "subtitle", childs);
        var updated = fetch2("updated", childs);
        if (updated) {
          feed.updated = new Date(updated);
        }
        addConditionally(feed, "author", "email", childs, true);
        return feed;
      }
      function getRssFeed(feedRoot) {
        var _a2, _b2;
        var childs = (_b2 = (_a2 = getOneElement("channel", feedRoot.children)) === null || _a2 === void 0 ? void 0 : _a2.children) !== null && _b2 !== void 0 ? _b2 : [];
        var feed = {
          type: feedRoot.name.substr(0, 3),
          id: "",
          items: (0, legacy_1.getElementsByTagName)("item", feedRoot.children).map(function(item2) {
            var children2 = item2.children;
            var entry = { media: getMediaElements(children2) };
            addConditionally(entry, "id", "guid", children2);
            addConditionally(entry, "title", "title", children2);
            addConditionally(entry, "link", "link", children2);
            addConditionally(entry, "description", "description", children2);
            var pubDate = fetch2("pubDate", children2);
            if (pubDate)
              entry.pubDate = new Date(pubDate);
            return entry;
          })
        };
        addConditionally(feed, "title", "title", childs);
        addConditionally(feed, "link", "link", childs);
        addConditionally(feed, "description", "description", childs);
        var updated = fetch2("lastBuildDate", childs);
        if (updated) {
          feed.updated = new Date(updated);
        }
        addConditionally(feed, "author", "managingEditor", childs, true);
        return feed;
      }
      var MEDIA_KEYS_STRING = ["url", "type", "lang"];
      var MEDIA_KEYS_INT = [
        "fileSize",
        "bitrate",
        "framerate",
        "samplingrate",
        "channels",
        "duration",
        "height",
        "width"
      ];
      function getMediaElements(where) {
        return (0, legacy_1.getElementsByTagName)("media:content", where).map(function(elem) {
          var attribs = elem.attribs;
          var media = {
            medium: attribs.medium,
            isDefault: !!attribs.isDefault
          };
          for (var _i = 0, MEDIA_KEYS_STRING_1 = MEDIA_KEYS_STRING; _i < MEDIA_KEYS_STRING_1.length; _i++) {
            var attrib = MEDIA_KEYS_STRING_1[_i];
            if (attribs[attrib]) {
              media[attrib] = attribs[attrib];
            }
          }
          for (var _a2 = 0, MEDIA_KEYS_INT_1 = MEDIA_KEYS_INT; _a2 < MEDIA_KEYS_INT_1.length; _a2++) {
            var attrib = MEDIA_KEYS_INT_1[_a2];
            if (attribs[attrib]) {
              media[attrib] = parseInt(attribs[attrib], 10);
            }
          }
          if (attribs.expression) {
            media.expression = attribs.expression;
          }
          return media;
        });
      }
      function getOneElement(tagName, node2) {
        return (0, legacy_1.getElementsByTagName)(tagName, node2, true, 1)[0];
      }
      function fetch2(tagName, where, recurse) {
        if (recurse === void 0) {
          recurse = false;
        }
        return (0, stringify_1.textContent)((0, legacy_1.getElementsByTagName)(tagName, where, recurse, 1)).trim();
      }
      function addConditionally(obj, prop2, tagName, where, recurse) {
        if (recurse === void 0) {
          recurse = false;
        }
        var val = fetch2(tagName, where, recurse);
        if (val)
          obj[prop2] = val;
      }
      function isValidFeed(value2) {
        return value2 === "rss" || value2 === "feed" || value2 === "rdf:RDF";
      }
      return feeds;
    }
    var hasRequiredLib$7;
    function requireLib$7() {
      if (hasRequiredLib$7) return lib$8;
      hasRequiredLib$7 = 1;
      (function(exports2) {
        var __createBinding2 = lib$8 && lib$8.__createBinding || (Object.create ? (function(o, m, k2, k22) {
          if (k22 === void 0) k22 = k2;
          Object.defineProperty(o, k22, { enumerable: true, get: function() {
            return m[k2];
          } });
        }) : (function(o, m, k2, k22) {
          if (k22 === void 0) k22 = k2;
          o[k22] = m[k2];
        }));
        var __exportStar2 = lib$8 && lib$8.__exportStar || function(m, exports3) {
          for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p)) __createBinding2(exports3, m, p);
        };
        Object.defineProperty(exports2, "__esModule", { value: true });
        exports2.hasChildren = exports2.isDocument = exports2.isComment = exports2.isText = exports2.isCDATA = exports2.isTag = void 0;
        __exportStar2(/* @__PURE__ */ requireStringify$1(), exports2);
        __exportStar2(/* @__PURE__ */ requireTraversal(), exports2);
        __exportStar2(/* @__PURE__ */ requireManipulation$1(), exports2);
        __exportStar2(/* @__PURE__ */ requireQuerying(), exports2);
        __exportStar2(/* @__PURE__ */ requireLegacy(), exports2);
        __exportStar2(/* @__PURE__ */ requireHelpers$1(), exports2);
        __exportStar2(/* @__PURE__ */ requireFeeds(), exports2);
        var domhandler_1 = /* @__PURE__ */ requireLib$a();
        Object.defineProperty(exports2, "isTag", { enumerable: true, get: function() {
          return domhandler_1.isTag;
        } });
        Object.defineProperty(exports2, "isCDATA", { enumerable: true, get: function() {
          return domhandler_1.isCDATA;
        } });
        Object.defineProperty(exports2, "isText", { enumerable: true, get: function() {
          return domhandler_1.isText;
        } });
        Object.defineProperty(exports2, "isComment", { enumerable: true, get: function() {
          return domhandler_1.isComment;
        } });
        Object.defineProperty(exports2, "isDocument", { enumerable: true, get: function() {
          return domhandler_1.isDocument;
        } });
        Object.defineProperty(exports2, "hasChildren", { enumerable: true, get: function() {
          return domhandler_1.hasChildren;
        } });
      })(lib$8);
      return lib$8;
    }
    var boolbase;
    var hasRequiredBoolbase;
    function requireBoolbase() {
      if (hasRequiredBoolbase) return boolbase;
      hasRequiredBoolbase = 1;
      boolbase = {
        trueFunc: function trueFunc() {
          return true;
        },
        falseFunc: function falseFunc() {
          return false;
        }
      };
      return boolbase;
    }
    var compile$1 = {};
    var sort = {};
    var procedure = {};
    var hasRequiredProcedure;
    function requireProcedure() {
      if (hasRequiredProcedure) return procedure;
      hasRequiredProcedure = 1;
      (function(exports2) {
        Object.defineProperty(exports2, "__esModule", { value: true });
        exports2.isTraversal = exports2.procedure = void 0;
        exports2.procedure = {
          universal: 50,
          tag: 30,
          attribute: 1,
          pseudo: 0,
          "pseudo-element": 0,
          "column-combinator": -1,
          descendant: -1,
          child: -1,
          parent: -1,
          sibling: -1,
          adjacent: -1,
          _flexibleDescendant: -1
        };
        function isTraversal2(t2) {
          return exports2.procedure[t2.type] < 0;
        }
        exports2.isTraversal = isTraversal2;
      })(procedure);
      return procedure;
    }
    var hasRequiredSort;
    function requireSort() {
      if (hasRequiredSort) return sort;
      hasRequiredSort = 1;
      Object.defineProperty(sort, "__esModule", { value: true });
      var css_what_1 = require$$0$1;
      var procedure_1 = requireProcedure();
      var attributes2 = {
        exists: 10,
        equals: 8,
        not: 7,
        start: 6,
        end: 6,
        any: 5,
        hyphen: 4,
        element: 4
      };
      function sortByProcedure(arr2) {
        var procs = arr2.map(getProcedure);
        for (var i2 = 1; i2 < arr2.length; i2++) {
          var procNew = procs[i2];
          if (procNew < 0)
            continue;
          for (var j = i2 - 1; j >= 0 && procNew < procs[j]; j--) {
            var token2 = arr2[j + 1];
            arr2[j + 1] = arr2[j];
            arr2[j] = token2;
            procs[j + 1] = procs[j];
            procs[j] = procNew;
          }
        }
      }
      sort.default = sortByProcedure;
      function getProcedure(token2) {
        var proc = procedure_1.procedure[token2.type];
        if (token2.type === css_what_1.SelectorType.Attribute) {
          proc = attributes2[token2.action];
          if (proc === attributes2.equals && token2.name === "id") {
            proc = 9;
          }
          if (token2.ignoreCase) {
            proc >>= 1;
          }
        } else if (token2.type === css_what_1.SelectorType.Pseudo) {
          if (!token2.data) {
            proc = 3;
          } else if (token2.name === "has" || token2.name === "contains") {
            proc = 0;
          } else if (Array.isArray(token2.data)) {
            proc = 0;
            for (var i2 = 0; i2 < token2.data.length; i2++) {
              if (token2.data[i2].length !== 1)
                continue;
              var cur2 = getProcedure(token2.data[i2][0]);
              if (cur2 === 0) {
                proc = 0;
                break;
              }
              if (cur2 > proc)
                proc = cur2;
            }
            if (token2.data.length > 1 && proc > 0)
              proc -= 1;
          } else {
            proc = 1;
          }
        }
        return proc;
      }
      return sort;
    }
    var general = {};
    var attributes$1 = {};
    var hasRequiredAttributes$1;
    function requireAttributes$1() {
      if (hasRequiredAttributes$1) return attributes$1;
      hasRequiredAttributes$1 = 1;
      Object.defineProperty(attributes$1, "__esModule", { value: true });
      attributes$1.attributeRules = void 0;
      var boolbase_1 = requireBoolbase();
      var reChars = /[-[\]{}()*+?.,\\^$|#\s]/g;
      function escapeRegex(value2) {
        return value2.replace(reChars, "\\$&");
      }
      var caseInsensitiveAttributes = /* @__PURE__ */ new Set([
        "accept",
        "accept-charset",
        "align",
        "alink",
        "axis",
        "bgcolor",
        "charset",
        "checked",
        "clear",
        "codetype",
        "color",
        "compact",
        "declare",
        "defer",
        "dir",
        "direction",
        "disabled",
        "enctype",
        "face",
        "frame",
        "hreflang",
        "http-equiv",
        "lang",
        "language",
        "link",
        "media",
        "method",
        "multiple",
        "nohref",
        "noresize",
        "noshade",
        "nowrap",
        "readonly",
        "rel",
        "rev",
        "rules",
        "scope",
        "scrolling",
        "selected",
        "shape",
        "target",
        "text",
        "type",
        "valign",
        "valuetype",
        "vlink"
      ]);
      function shouldIgnoreCase(selector2, options2) {
        return typeof selector2.ignoreCase === "boolean" ? selector2.ignoreCase : selector2.ignoreCase === "quirks" ? !!options2.quirksMode : !options2.xmlMode && caseInsensitiveAttributes.has(selector2.name);
      }
      attributes$1.attributeRules = {
        equals: function(next, data, options2) {
          var adapter = options2.adapter;
          var name2 = data.name;
          var value2 = data.value;
          if (shouldIgnoreCase(data, options2)) {
            value2 = value2.toLowerCase();
            return function(elem) {
              var attr = adapter.getAttributeValue(elem, name2);
              return attr != null && attr.length === value2.length && attr.toLowerCase() === value2 && next(elem);
            };
          }
          return function(elem) {
            return adapter.getAttributeValue(elem, name2) === value2 && next(elem);
          };
        },
        hyphen: function(next, data, options2) {
          var adapter = options2.adapter;
          var name2 = data.name;
          var value2 = data.value;
          var len = value2.length;
          if (shouldIgnoreCase(data, options2)) {
            value2 = value2.toLowerCase();
            return function hyphenIC(elem) {
              var attr = adapter.getAttributeValue(elem, name2);
              return attr != null && (attr.length === len || attr.charAt(len) === "-") && attr.substr(0, len).toLowerCase() === value2 && next(elem);
            };
          }
          return function hyphen2(elem) {
            var attr = adapter.getAttributeValue(elem, name2);
            return attr != null && (attr.length === len || attr.charAt(len) === "-") && attr.substr(0, len) === value2 && next(elem);
          };
        },
        element: function(next, data, options2) {
          var adapter = options2.adapter;
          var name2 = data.name, value2 = data.value;
          if (/\s/.test(value2)) {
            return boolbase_1.falseFunc;
          }
          var regex2 = new RegExp("(?:^|\\s)".concat(escapeRegex(value2), "(?:$|\\s)"), shouldIgnoreCase(data, options2) ? "i" : "");
          return function element(elem) {
            var attr = adapter.getAttributeValue(elem, name2);
            return attr != null && attr.length >= value2.length && regex2.test(attr) && next(elem);
          };
        },
        exists: function(next, _a2, _b2) {
          var name2 = _a2.name;
          var adapter = _b2.adapter;
          return function(elem) {
            return adapter.hasAttrib(elem, name2) && next(elem);
          };
        },
        start: function(next, data, options2) {
          var adapter = options2.adapter;
          var name2 = data.name;
          var value2 = data.value;
          var len = value2.length;
          if (len === 0) {
            return boolbase_1.falseFunc;
          }
          if (shouldIgnoreCase(data, options2)) {
            value2 = value2.toLowerCase();
            return function(elem) {
              var attr = adapter.getAttributeValue(elem, name2);
              return attr != null && attr.length >= len && attr.substr(0, len).toLowerCase() === value2 && next(elem);
            };
          }
          return function(elem) {
            var _a2;
            return !!((_a2 = adapter.getAttributeValue(elem, name2)) === null || _a2 === void 0 ? void 0 : _a2.startsWith(value2)) && next(elem);
          };
        },
        end: function(next, data, options2) {
          var adapter = options2.adapter;
          var name2 = data.name;
          var value2 = data.value;
          var len = -value2.length;
          if (len === 0) {
            return boolbase_1.falseFunc;
          }
          if (shouldIgnoreCase(data, options2)) {
            value2 = value2.toLowerCase();
            return function(elem) {
              var _a2;
              return ((_a2 = adapter.getAttributeValue(elem, name2)) === null || _a2 === void 0 ? void 0 : _a2.substr(len).toLowerCase()) === value2 && next(elem);
            };
          }
          return function(elem) {
            var _a2;
            return !!((_a2 = adapter.getAttributeValue(elem, name2)) === null || _a2 === void 0 ? void 0 : _a2.endsWith(value2)) && next(elem);
          };
        },
        any: function(next, data, options2) {
          var adapter = options2.adapter;
          var name2 = data.name, value2 = data.value;
          if (value2 === "") {
            return boolbase_1.falseFunc;
          }
          if (shouldIgnoreCase(data, options2)) {
            var regex_1 = new RegExp(escapeRegex(value2), "i");
            return function anyIC(elem) {
              var attr = adapter.getAttributeValue(elem, name2);
              return attr != null && attr.length >= value2.length && regex_1.test(attr) && next(elem);
            };
          }
          return function(elem) {
            var _a2;
            return !!((_a2 = adapter.getAttributeValue(elem, name2)) === null || _a2 === void 0 ? void 0 : _a2.includes(value2)) && next(elem);
          };
        },
        not: function(next, data, options2) {
          var adapter = options2.adapter;
          var name2 = data.name;
          var value2 = data.value;
          if (value2 === "") {
            return function(elem) {
              return !!adapter.getAttributeValue(elem, name2) && next(elem);
            };
          } else if (shouldIgnoreCase(data, options2)) {
            value2 = value2.toLowerCase();
            return function(elem) {
              var attr = adapter.getAttributeValue(elem, name2);
              return (attr == null || attr.length !== value2.length || attr.toLowerCase() !== value2) && next(elem);
            };
          }
          return function(elem) {
            return adapter.getAttributeValue(elem, name2) !== value2 && next(elem);
          };
        }
      };
      return attributes$1;
    }
    var pseudoSelectors = {};
    var filters = {};
    var lib$3 = {};
    var parse$4 = {};
    var hasRequiredParse$1;
    function requireParse$1() {
      if (hasRequiredParse$1) return parse$4;
      hasRequiredParse$1 = 1;
      Object.defineProperty(parse$4, "__esModule", { value: true });
      parse$4.parse = void 0;
      var whitespace = /* @__PURE__ */ new Set([9, 10, 12, 13, 32]);
      var ZERO = "0".charCodeAt(0);
      var NINE = "9".charCodeAt(0);
      function parse2(formula) {
        formula = formula.trim().toLowerCase();
        if (formula === "even") {
          return [2, 0];
        } else if (formula === "odd") {
          return [2, 1];
        }
        var idx = 0;
        var a = 0;
        var sign2 = readSign();
        var number2 = readNumber();
        if (idx < formula.length && formula.charAt(idx) === "n") {
          idx++;
          a = sign2 * (number2 !== null && number2 !== void 0 ? number2 : 1);
          skipWhitespace();
          if (idx < formula.length) {
            sign2 = readSign();
            skipWhitespace();
            number2 = readNumber();
          } else {
            sign2 = number2 = 0;
          }
        }
        if (number2 === null || idx < formula.length) {
          throw new Error("n-th rule couldn't be parsed ('".concat(formula, "')"));
        }
        return [a, sign2 * number2];
        function readSign() {
          if (formula.charAt(idx) === "-") {
            idx++;
            return -1;
          }
          if (formula.charAt(idx) === "+") {
            idx++;
          }
          return 1;
        }
        function readNumber() {
          var start2 = idx;
          var value2 = 0;
          while (idx < formula.length && formula.charCodeAt(idx) >= ZERO && formula.charCodeAt(idx) <= NINE) {
            value2 = value2 * 10 + (formula.charCodeAt(idx) - ZERO);
            idx++;
          }
          return idx === start2 ? null : value2;
        }
        function skipWhitespace() {
          while (idx < formula.length && whitespace.has(formula.charCodeAt(idx))) {
            idx++;
          }
        }
      }
      parse$4.parse = parse2;
      return parse$4;
    }
    var compile = {};
    var hasRequiredCompile$1;
    function requireCompile$1() {
      if (hasRequiredCompile$1) return compile;
      hasRequiredCompile$1 = 1;
      var __importDefault2 = compile && compile.__importDefault || function(mod2) {
        return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
      };
      Object.defineProperty(compile, "__esModule", { value: true });
      compile.generate = compile.compile = void 0;
      var boolbase_1 = __importDefault2(requireBoolbase());
      function compile$12(parsed) {
        var a = parsed[0];
        var b = parsed[1] - 1;
        if (b < 0 && a <= 0)
          return boolbase_1.default.falseFunc;
        if (a === -1)
          return function(index) {
            return index <= b;
          };
        if (a === 0)
          return function(index) {
            return index === b;
          };
        if (a === 1)
          return b < 0 ? boolbase_1.default.trueFunc : function(index) {
            return index >= b;
          };
        var absA = Math.abs(a);
        var bMod = (b % absA + absA) % absA;
        return a > 1 ? function(index) {
          return index >= b && index % absA === bMod;
        } : function(index) {
          return index <= b && index % absA === bMod;
        };
      }
      compile.compile = compile$12;
      function generate(parsed) {
        var a = parsed[0];
        var b = parsed[1] - 1;
        var n = 0;
        if (a < 0) {
          var aPos_1 = -a;
          var minValue_1 = (b % aPos_1 + aPos_1) % aPos_1;
          return function() {
            var val = minValue_1 + aPos_1 * n++;
            return val > b ? null : val;
          };
        }
        if (a === 0)
          return b < 0 ? (
            // There are no result — always return `null`
            function() {
              return null;
            }
          ) : (
            // Return `b` exactly once
            function() {
              return n++ === 0 ? b : null;
            }
          );
        if (b < 0) {
          b += a * Math.ceil(-b / a);
        }
        return function() {
          return a * n++ + b;
        };
      }
      compile.generate = generate;
      return compile;
    }
    var hasRequiredLib$6;
    function requireLib$6() {
      if (hasRequiredLib$6) return lib$3;
      hasRequiredLib$6 = 1;
      (function(exports2) {
        Object.defineProperty(exports2, "__esModule", { value: true });
        exports2.sequence = exports2.generate = exports2.compile = exports2.parse = void 0;
        var parse_js_1 = /* @__PURE__ */ requireParse$1();
        Object.defineProperty(exports2, "parse", { enumerable: true, get: function() {
          return parse_js_1.parse;
        } });
        var compile_js_1 = /* @__PURE__ */ requireCompile$1();
        Object.defineProperty(exports2, "compile", { enumerable: true, get: function() {
          return compile_js_1.compile;
        } });
        Object.defineProperty(exports2, "generate", { enumerable: true, get: function() {
          return compile_js_1.generate;
        } });
        function nthCheck(formula) {
          return (0, compile_js_1.compile)((0, parse_js_1.parse)(formula));
        }
        exports2.default = nthCheck;
        function sequence(formula) {
          return (0, compile_js_1.generate)((0, parse_js_1.parse)(formula));
        }
        exports2.sequence = sequence;
      })(lib$3);
      return lib$3;
    }
    var hasRequiredFilters;
    function requireFilters() {
      if (hasRequiredFilters) return filters;
      hasRequiredFilters = 1;
      (function(exports2) {
        var __importDefault2 = filters && filters.__importDefault || function(mod2) {
          return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
        };
        Object.defineProperty(exports2, "__esModule", { value: true });
        exports2.filters = void 0;
        var nth_check_1 = __importDefault2(/* @__PURE__ */ requireLib$6());
        var boolbase_1 = requireBoolbase();
        function getChildFunc(next, adapter) {
          return function(elem) {
            var parent = adapter.getParent(elem);
            return parent != null && adapter.isTag(parent) && next(elem);
          };
        }
        exports2.filters = {
          contains: function(next, text2, _a2) {
            var adapter = _a2.adapter;
            return function contains2(elem) {
              return next(elem) && adapter.getText(elem).includes(text2);
            };
          },
          icontains: function(next, text2, _a2) {
            var adapter = _a2.adapter;
            var itext = text2.toLowerCase();
            return function icontains(elem) {
              return next(elem) && adapter.getText(elem).toLowerCase().includes(itext);
            };
          },
          // Location specific methods
          "nth-child": function(next, rule, _a2) {
            var adapter = _a2.adapter, equals2 = _a2.equals;
            var func = (0, nth_check_1.default)(rule);
            if (func === boolbase_1.falseFunc)
              return boolbase_1.falseFunc;
            if (func === boolbase_1.trueFunc)
              return getChildFunc(next, adapter);
            return function nthChild(elem) {
              var siblings = adapter.getSiblings(elem);
              var pos2 = 0;
              for (var i2 = 0; i2 < siblings.length; i2++) {
                if (equals2(elem, siblings[i2]))
                  break;
                if (adapter.isTag(siblings[i2])) {
                  pos2++;
                }
              }
              return func(pos2) && next(elem);
            };
          },
          "nth-last-child": function(next, rule, _a2) {
            var adapter = _a2.adapter, equals2 = _a2.equals;
            var func = (0, nth_check_1.default)(rule);
            if (func === boolbase_1.falseFunc)
              return boolbase_1.falseFunc;
            if (func === boolbase_1.trueFunc)
              return getChildFunc(next, adapter);
            return function nthLastChild(elem) {
              var siblings = adapter.getSiblings(elem);
              var pos2 = 0;
              for (var i2 = siblings.length - 1; i2 >= 0; i2--) {
                if (equals2(elem, siblings[i2]))
                  break;
                if (adapter.isTag(siblings[i2])) {
                  pos2++;
                }
              }
              return func(pos2) && next(elem);
            };
          },
          "nth-of-type": function(next, rule, _a2) {
            var adapter = _a2.adapter, equals2 = _a2.equals;
            var func = (0, nth_check_1.default)(rule);
            if (func === boolbase_1.falseFunc)
              return boolbase_1.falseFunc;
            if (func === boolbase_1.trueFunc)
              return getChildFunc(next, adapter);
            return function nthOfType(elem) {
              var siblings = adapter.getSiblings(elem);
              var pos2 = 0;
              for (var i2 = 0; i2 < siblings.length; i2++) {
                var currentSibling = siblings[i2];
                if (equals2(elem, currentSibling))
                  break;
                if (adapter.isTag(currentSibling) && adapter.getName(currentSibling) === adapter.getName(elem)) {
                  pos2++;
                }
              }
              return func(pos2) && next(elem);
            };
          },
          "nth-last-of-type": function(next, rule, _a2) {
            var adapter = _a2.adapter, equals2 = _a2.equals;
            var func = (0, nth_check_1.default)(rule);
            if (func === boolbase_1.falseFunc)
              return boolbase_1.falseFunc;
            if (func === boolbase_1.trueFunc)
              return getChildFunc(next, adapter);
            return function nthLastOfType(elem) {
              var siblings = adapter.getSiblings(elem);
              var pos2 = 0;
              for (var i2 = siblings.length - 1; i2 >= 0; i2--) {
                var currentSibling = siblings[i2];
                if (equals2(elem, currentSibling))
                  break;
                if (adapter.isTag(currentSibling) && adapter.getName(currentSibling) === adapter.getName(elem)) {
                  pos2++;
                }
              }
              return func(pos2) && next(elem);
            };
          },
          // TODO determine the actual root element
          root: function(next, _rule, _a2) {
            var adapter = _a2.adapter;
            return function(elem) {
              var parent = adapter.getParent(elem);
              return (parent == null || !adapter.isTag(parent)) && next(elem);
            };
          },
          scope: function(next, rule, options2, context) {
            var equals2 = options2.equals;
            if (!context || context.length === 0) {
              return exports2.filters.root(next, rule, options2);
            }
            if (context.length === 1) {
              return function(elem) {
                return equals2(context[0], elem) && next(elem);
              };
            }
            return function(elem) {
              return context.includes(elem) && next(elem);
            };
          },
          hover: dynamicStatePseudo("isHovered"),
          visited: dynamicStatePseudo("isVisited"),
          active: dynamicStatePseudo("isActive")
        };
        function dynamicStatePseudo(name2) {
          return function dynamicPseudo(next, _rule, _a2) {
            var adapter = _a2.adapter;
            var func = adapter[name2];
            if (typeof func !== "function") {
              return boolbase_1.falseFunc;
            }
            return function active(elem) {
              return func(elem) && next(elem);
            };
          };
        }
      })(filters);
      return filters;
    }
    var pseudos = {};
    var hasRequiredPseudos;
    function requirePseudos() {
      if (hasRequiredPseudos) return pseudos;
      hasRequiredPseudos = 1;
      Object.defineProperty(pseudos, "__esModule", { value: true });
      pseudos.verifyPseudoArgs = pseudos.pseudos = void 0;
      pseudos.pseudos = {
        empty: function(elem, _a2) {
          var adapter = _a2.adapter;
          return !adapter.getChildren(elem).some(function(elem2) {
            return adapter.isTag(elem2) || adapter.getText(elem2) !== "";
          });
        },
        "first-child": function(elem, _a2) {
          var adapter = _a2.adapter, equals2 = _a2.equals;
          var firstChild = adapter.getSiblings(elem).find(function(elem2) {
            return adapter.isTag(elem2);
          });
          return firstChild != null && equals2(elem, firstChild);
        },
        "last-child": function(elem, _a2) {
          var adapter = _a2.adapter, equals2 = _a2.equals;
          var siblings = adapter.getSiblings(elem);
          for (var i2 = siblings.length - 1; i2 >= 0; i2--) {
            if (equals2(elem, siblings[i2]))
              return true;
            if (adapter.isTag(siblings[i2]))
              break;
          }
          return false;
        },
        "first-of-type": function(elem, _a2) {
          var adapter = _a2.adapter, equals2 = _a2.equals;
          var siblings = adapter.getSiblings(elem);
          var elemName = adapter.getName(elem);
          for (var i2 = 0; i2 < siblings.length; i2++) {
            var currentSibling = siblings[i2];
            if (equals2(elem, currentSibling))
              return true;
            if (adapter.isTag(currentSibling) && adapter.getName(currentSibling) === elemName) {
              break;
            }
          }
          return false;
        },
        "last-of-type": function(elem, _a2) {
          var adapter = _a2.adapter, equals2 = _a2.equals;
          var siblings = adapter.getSiblings(elem);
          var elemName = adapter.getName(elem);
          for (var i2 = siblings.length - 1; i2 >= 0; i2--) {
            var currentSibling = siblings[i2];
            if (equals2(elem, currentSibling))
              return true;
            if (adapter.isTag(currentSibling) && adapter.getName(currentSibling) === elemName) {
              break;
            }
          }
          return false;
        },
        "only-of-type": function(elem, _a2) {
          var adapter = _a2.adapter, equals2 = _a2.equals;
          var elemName = adapter.getName(elem);
          return adapter.getSiblings(elem).every(function(sibling) {
            return equals2(elem, sibling) || !adapter.isTag(sibling) || adapter.getName(sibling) !== elemName;
          });
        },
        "only-child": function(elem, _a2) {
          var adapter = _a2.adapter, equals2 = _a2.equals;
          return adapter.getSiblings(elem).every(function(sibling) {
            return equals2(elem, sibling) || !adapter.isTag(sibling);
          });
        }
      };
      function verifyPseudoArgs(func, name2, subselect) {
        if (subselect === null) {
          if (func.length > 2) {
            throw new Error("pseudo-selector :".concat(name2, " requires an argument"));
          }
        } else if (func.length === 2) {
          throw new Error("pseudo-selector :".concat(name2, " doesn't have any arguments"));
        }
      }
      pseudos.verifyPseudoArgs = verifyPseudoArgs;
      return pseudos;
    }
    var aliases = {};
    var hasRequiredAliases;
    function requireAliases() {
      if (hasRequiredAliases) return aliases;
      hasRequiredAliases = 1;
      Object.defineProperty(aliases, "__esModule", { value: true });
      aliases.aliases = void 0;
      aliases.aliases = {
        // Links
        "any-link": ":is(a, area, link)[href]",
        link: ":any-link:not(:visited)",
        // Forms
        // https://html.spec.whatwg.org/multipage/scripting.html#disabled-elements
        disabled: ":is(\n        :is(button, input, select, textarea, optgroup, option)[disabled],\n        optgroup[disabled] > option,\n        fieldset[disabled]:not(fieldset[disabled] legend:first-of-type *)\n    )",
        enabled: ":not(:disabled)",
        checked: ":is(:is(input[type=radio], input[type=checkbox])[checked], option:selected)",
        required: ":is(input, select, textarea)[required]",
        optional: ":is(input, select, textarea):not([required])",
        // JQuery extensions
        // https://html.spec.whatwg.org/multipage/form-elements.html#concept-option-selectedness
        selected: "option:is([selected], select:not([multiple]):not(:has(> option[selected])) > :first-of-type)",
        checkbox: "[type=checkbox]",
        file: "[type=file]",
        password: "[type=password]",
        radio: "[type=radio]",
        reset: "[type=reset]",
        image: "[type=image]",
        submit: "[type=submit]",
        parent: ":not(:empty)",
        header: ":is(h1, h2, h3, h4, h5, h6)",
        button: ":is(button, input[type=button])",
        input: ":is(input, textarea, select, button)",
        text: "input:is(:not([type!='']), [type=text])"
      };
      return aliases;
    }
    var subselects = {};
    var hasRequiredSubselects;
    function requireSubselects() {
      if (hasRequiredSubselects) return subselects;
      hasRequiredSubselects = 1;
      (function(exports2) {
        var __spreadArray2 = subselects && subselects.__spreadArray || function(to2, from, pack) {
          if (pack || arguments.length === 2) for (var i2 = 0, l = from.length, ar2; i2 < l; i2++) {
            if (ar2 || !(i2 in from)) {
              if (!ar2) ar2 = Array.prototype.slice.call(from, 0, i2);
              ar2[i2] = from[i2];
            }
          }
          return to2.concat(ar2 || Array.prototype.slice.call(from));
        };
        Object.defineProperty(exports2, "__esModule", { value: true });
        exports2.subselects = exports2.getNextSiblings = exports2.ensureIsTag = exports2.PLACEHOLDER_ELEMENT = void 0;
        var boolbase_1 = requireBoolbase();
        var procedure_1 = requireProcedure();
        exports2.PLACEHOLDER_ELEMENT = {};
        function ensureIsTag(next, adapter) {
          if (next === boolbase_1.falseFunc)
            return boolbase_1.falseFunc;
          return function(elem) {
            return adapter.isTag(elem) && next(elem);
          };
        }
        exports2.ensureIsTag = ensureIsTag;
        function getNextSiblings(elem, adapter) {
          var siblings = adapter.getSiblings(elem);
          if (siblings.length <= 1)
            return [];
          var elemIndex = siblings.indexOf(elem);
          if (elemIndex < 0 || elemIndex === siblings.length - 1)
            return [];
          return siblings.slice(elemIndex + 1).filter(adapter.isTag);
        }
        exports2.getNextSiblings = getNextSiblings;
        var is2 = function(next, token2, options2, context, compileToken) {
          var opts = {
            xmlMode: !!options2.xmlMode,
            adapter: options2.adapter,
            equals: options2.equals
          };
          var func = compileToken(token2, opts, context);
          return function(elem) {
            return func(elem) && next(elem);
          };
        };
        exports2.subselects = {
          is: is2,
          /**
           * `:matches` and `:where` are aliases for `:is`.
           */
          matches: is2,
          where: is2,
          not: function(next, token2, options2, context, compileToken) {
            var opts = {
              xmlMode: !!options2.xmlMode,
              adapter: options2.adapter,
              equals: options2.equals
            };
            var func = compileToken(token2, opts, context);
            if (func === boolbase_1.falseFunc)
              return next;
            if (func === boolbase_1.trueFunc)
              return boolbase_1.falseFunc;
            return function not2(elem) {
              return !func(elem) && next(elem);
            };
          },
          has: function(next, subselect, options2, _context, compileToken) {
            var adapter = options2.adapter;
            var opts = {
              xmlMode: !!options2.xmlMode,
              adapter,
              equals: options2.equals
            };
            var context = subselect.some(function(s) {
              return s.some(procedure_1.isTraversal);
            }) ? [exports2.PLACEHOLDER_ELEMENT] : void 0;
            var compiled = compileToken(subselect, opts, context);
            if (compiled === boolbase_1.falseFunc)
              return boolbase_1.falseFunc;
            if (compiled === boolbase_1.trueFunc) {
              return function(elem) {
                return adapter.getChildren(elem).some(adapter.isTag) && next(elem);
              };
            }
            var hasElement = ensureIsTag(compiled, adapter);
            var _a2 = compiled.shouldTestNextSiblings, shouldTestNextSiblings = _a2 === void 0 ? false : _a2;
            if (context) {
              return function(elem) {
                context[0] = elem;
                var childs = adapter.getChildren(elem);
                var nextElements = shouldTestNextSiblings ? __spreadArray2(__spreadArray2([], childs, true), getNextSiblings(elem, adapter), true) : childs;
                return next(elem) && adapter.existsOne(hasElement, nextElements);
              };
            }
            return function(elem) {
              return next(elem) && adapter.existsOne(hasElement, adapter.getChildren(elem));
            };
          }
        };
      })(subselects);
      return subselects;
    }
    var hasRequiredPseudoSelectors;
    function requirePseudoSelectors() {
      if (hasRequiredPseudoSelectors) return pseudoSelectors;
      hasRequiredPseudoSelectors = 1;
      (function(exports2) {
        Object.defineProperty(exports2, "__esModule", { value: true });
        exports2.compilePseudoSelector = exports2.aliases = exports2.pseudos = exports2.filters = void 0;
        var boolbase_1 = requireBoolbase();
        var css_what_1 = require$$0$1;
        var filters_1 = requireFilters();
        Object.defineProperty(exports2, "filters", { enumerable: true, get: function() {
          return filters_1.filters;
        } });
        var pseudos_1 = requirePseudos();
        Object.defineProperty(exports2, "pseudos", { enumerable: true, get: function() {
          return pseudos_1.pseudos;
        } });
        var aliases_1 = requireAliases();
        Object.defineProperty(exports2, "aliases", { enumerable: true, get: function() {
          return aliases_1.aliases;
        } });
        var subselects_1 = requireSubselects();
        function compilePseudoSelector(next, selector2, options2, context, compileToken) {
          var name2 = selector2.name, data = selector2.data;
          if (Array.isArray(data)) {
            return subselects_1.subselects[name2](next, data, options2, context, compileToken);
          }
          if (name2 in aliases_1.aliases) {
            if (data != null) {
              throw new Error("Pseudo ".concat(name2, " doesn't have any arguments"));
            }
            var alias = (0, css_what_1.parse)(aliases_1.aliases[name2]);
            return subselects_1.subselects.is(next, alias, options2, context, compileToken);
          }
          if (name2 in filters_1.filters) {
            return filters_1.filters[name2](next, data, options2, context);
          }
          if (name2 in pseudos_1.pseudos) {
            var pseudo_1 = pseudos_1.pseudos[name2];
            (0, pseudos_1.verifyPseudoArgs)(pseudo_1, name2, data);
            return pseudo_1 === boolbase_1.falseFunc ? boolbase_1.falseFunc : next === boolbase_1.trueFunc ? function(elem) {
              return pseudo_1(elem, options2, data);
            } : function(elem) {
              return pseudo_1(elem, options2, data) && next(elem);
            };
          }
          throw new Error("unmatched pseudo-class :".concat(name2));
        }
        exports2.compilePseudoSelector = compilePseudoSelector;
      })(pseudoSelectors);
      return pseudoSelectors;
    }
    var hasRequiredGeneral;
    function requireGeneral() {
      if (hasRequiredGeneral) return general;
      hasRequiredGeneral = 1;
      Object.defineProperty(general, "__esModule", { value: true });
      general.compileGeneralSelector = void 0;
      var attributes_1 = requireAttributes$1();
      var pseudo_selectors_1 = requirePseudoSelectors();
      var css_what_1 = require$$0$1;
      function compileGeneralSelector(next, selector2, options2, context, compileToken) {
        var adapter = options2.adapter, equals2 = options2.equals;
        switch (selector2.type) {
          case css_what_1.SelectorType.PseudoElement: {
            throw new Error("Pseudo-elements are not supported by css-select");
          }
          case css_what_1.SelectorType.ColumnCombinator: {
            throw new Error("Column combinators are not yet supported by css-select");
          }
          case css_what_1.SelectorType.Attribute: {
            if (selector2.namespace != null) {
              throw new Error("Namespaced attributes are not yet supported by css-select");
            }
            if (!options2.xmlMode || options2.lowerCaseAttributeNames) {
              selector2.name = selector2.name.toLowerCase();
            }
            return attributes_1.attributeRules[selector2.action](next, selector2, options2);
          }
          case css_what_1.SelectorType.Pseudo: {
            return (0, pseudo_selectors_1.compilePseudoSelector)(next, selector2, options2, context, compileToken);
          }
          // Tags
          case css_what_1.SelectorType.Tag: {
            if (selector2.namespace != null) {
              throw new Error("Namespaced tag names are not yet supported by css-select");
            }
            var name_1 = selector2.name;
            if (!options2.xmlMode || options2.lowerCaseTags) {
              name_1 = name_1.toLowerCase();
            }
            return function tag(elem) {
              return adapter.getName(elem) === name_1 && next(elem);
            };
          }
          // Traversal
          case css_what_1.SelectorType.Descendant: {
            if (options2.cacheResults === false || typeof WeakSet === "undefined") {
              return function descendant(elem) {
                var current2 = elem;
                while (current2 = adapter.getParent(current2)) {
                  if (adapter.isTag(current2) && next(current2)) {
                    return true;
                  }
                }
                return false;
              };
            }
            var isFalseCache_1 = /* @__PURE__ */ new WeakSet();
            return function cachedDescendant(elem) {
              var current2 = elem;
              while (current2 = adapter.getParent(current2)) {
                if (!isFalseCache_1.has(current2)) {
                  if (adapter.isTag(current2) && next(current2)) {
                    return true;
                  }
                  isFalseCache_1.add(current2);
                }
              }
              return false;
            };
          }
          case "_flexibleDescendant": {
            return function flexibleDescendant(elem) {
              var current2 = elem;
              do {
                if (adapter.isTag(current2) && next(current2))
                  return true;
              } while (current2 = adapter.getParent(current2));
              return false;
            };
          }
          case css_what_1.SelectorType.Parent: {
            return function parent(elem) {
              return adapter.getChildren(elem).some(function(elem2) {
                return adapter.isTag(elem2) && next(elem2);
              });
            };
          }
          case css_what_1.SelectorType.Child: {
            return function child(elem) {
              var parent = adapter.getParent(elem);
              return parent != null && adapter.isTag(parent) && next(parent);
            };
          }
          case css_what_1.SelectorType.Sibling: {
            return function sibling(elem) {
              var siblings = adapter.getSiblings(elem);
              for (var i2 = 0; i2 < siblings.length; i2++) {
                var currentSibling = siblings[i2];
                if (equals2(elem, currentSibling))
                  break;
                if (adapter.isTag(currentSibling) && next(currentSibling)) {
                  return true;
                }
              }
              return false;
            };
          }
          case css_what_1.SelectorType.Adjacent: {
            if (adapter.prevElementSibling) {
              return function adjacent(elem) {
                var previous = adapter.prevElementSibling(elem);
                return previous != null && next(previous);
              };
            }
            return function adjacent(elem) {
              var siblings = adapter.getSiblings(elem);
              var lastElement;
              for (var i2 = 0; i2 < siblings.length; i2++) {
                var currentSibling = siblings[i2];
                if (equals2(elem, currentSibling))
                  break;
                if (adapter.isTag(currentSibling)) {
                  lastElement = currentSibling;
                }
              }
              return !!lastElement && next(lastElement);
            };
          }
          case css_what_1.SelectorType.Universal: {
            if (selector2.namespace != null && selector2.namespace !== "*") {
              throw new Error("Namespaced universal selectors are not yet supported by css-select");
            }
            return next;
          }
        }
      }
      general.compileGeneralSelector = compileGeneralSelector;
      return general;
    }
    var hasRequiredCompile;
    function requireCompile() {
      if (hasRequiredCompile) return compile$1;
      hasRequiredCompile = 1;
      var __importDefault2 = compile$1 && compile$1.__importDefault || function(mod2) {
        return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
      };
      Object.defineProperty(compile$1, "__esModule", { value: true });
      compile$1.compileToken = compile$1.compileUnsafe = compile$1.compile = void 0;
      var css_what_1 = require$$0$1;
      var boolbase_1 = requireBoolbase();
      var sort_1 = __importDefault2(requireSort());
      var procedure_1 = requireProcedure();
      var general_1 = requireGeneral();
      var subselects_1 = requireSubselects();
      function compile2(selector2, options2, context) {
        var next = compileUnsafe(selector2, options2, context);
        return (0, subselects_1.ensureIsTag)(next, options2.adapter);
      }
      compile$1.compile = compile2;
      function compileUnsafe(selector2, options2, context) {
        var token2 = typeof selector2 === "string" ? (0, css_what_1.parse)(selector2) : selector2;
        return compileToken(token2, options2, context);
      }
      compile$1.compileUnsafe = compileUnsafe;
      function includesScopePseudo(t2) {
        return t2.type === "pseudo" && (t2.name === "scope" || Array.isArray(t2.data) && t2.data.some(function(data) {
          return data.some(includesScopePseudo);
        }));
      }
      var DESCENDANT_TOKEN = { type: css_what_1.SelectorType.Descendant };
      var FLEXIBLE_DESCENDANT_TOKEN = {
        type: "_flexibleDescendant"
      };
      var SCOPE_TOKEN = {
        type: css_what_1.SelectorType.Pseudo,
        name: "scope",
        data: null
      };
      function absolutize(token2, _a2, context) {
        var adapter = _a2.adapter;
        var hasContext = !!(context === null || context === void 0 ? void 0 : context.every(function(e) {
          var parent = adapter.isTag(e) && adapter.getParent(e);
          return e === subselects_1.PLACEHOLDER_ELEMENT || parent && adapter.isTag(parent);
        }));
        for (var _i = 0, token_1 = token2; _i < token_1.length; _i++) {
          var t2 = token_1[_i];
          if (t2.length > 0 && (0, procedure_1.isTraversal)(t2[0]) && t2[0].type !== "descendant") ;
          else if (hasContext && !t2.some(includesScopePseudo)) {
            t2.unshift(DESCENDANT_TOKEN);
          } else {
            continue;
          }
          t2.unshift(SCOPE_TOKEN);
        }
      }
      function compileToken(token2, options2, context) {
        var _a2;
        token2 = token2.filter(function(t2) {
          return t2.length > 0;
        });
        token2.forEach(sort_1.default);
        context = (_a2 = options2.context) !== null && _a2 !== void 0 ? _a2 : context;
        var isArrayContext = Array.isArray(context);
        var finalContext = context && (Array.isArray(context) ? context : [context]);
        absolutize(token2, options2, finalContext);
        var shouldTestNextSiblings = false;
        var query2 = token2.map(function(rules) {
          if (rules.length >= 2) {
            var first = rules[0], second = rules[1];
            if (first.type !== "pseudo" || first.name !== "scope") ;
            else if (isArrayContext && second.type === "descendant") {
              rules[1] = FLEXIBLE_DESCENDANT_TOKEN;
            } else if (second.type === "adjacent" || second.type === "sibling") {
              shouldTestNextSiblings = true;
            }
          }
          return compileRules(rules, options2, finalContext);
        }).reduce(reduceRules, boolbase_1.falseFunc);
        query2.shouldTestNextSiblings = shouldTestNextSiblings;
        return query2;
      }
      compile$1.compileToken = compileToken;
      function compileRules(rules, options2, context) {
        var _a2;
        return rules.reduce(function(previous, rule) {
          return previous === boolbase_1.falseFunc ? boolbase_1.falseFunc : (0, general_1.compileGeneralSelector)(previous, rule, options2, context, compileToken);
        }, (_a2 = options2.rootFunc) !== null && _a2 !== void 0 ? _a2 : boolbase_1.trueFunc);
      }
      function reduceRules(a, b) {
        if (b === boolbase_1.falseFunc || a === boolbase_1.trueFunc) {
          return a;
        }
        if (a === boolbase_1.falseFunc || b === boolbase_1.trueFunc) {
          return b;
        }
        return function combine(elem) {
          return a(elem) || b(elem);
        };
      }
      return compile$1;
    }
    var hasRequiredLib$5;
    function requireLib$5() {
      if (hasRequiredLib$5) return lib$9;
      hasRequiredLib$5 = 1;
      (function(exports2) {
        var __createBinding2 = lib$9 && lib$9.__createBinding || (Object.create ? (function(o, m, k2, k22) {
          if (k22 === void 0) k22 = k2;
          var desc = Object.getOwnPropertyDescriptor(m, k2);
          if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
            desc = { enumerable: true, get: function() {
              return m[k2];
            } };
          }
          Object.defineProperty(o, k22, desc);
        }) : (function(o, m, k2, k22) {
          if (k22 === void 0) k22 = k2;
          o[k22] = m[k2];
        }));
        var __setModuleDefault2 = lib$9 && lib$9.__setModuleDefault || (Object.create ? (function(o, v) {
          Object.defineProperty(o, "default", { enumerable: true, value: v });
        }) : function(o, v) {
          o["default"] = v;
        });
        var __importStar2 = lib$9 && lib$9.__importStar || function(mod2) {
          if (mod2 && mod2.__esModule) return mod2;
          var result2 = {};
          if (mod2 != null) {
            for (var k2 in mod2) if (k2 !== "default" && Object.prototype.hasOwnProperty.call(mod2, k2)) __createBinding2(result2, mod2, k2);
          }
          __setModuleDefault2(result2, mod2);
          return result2;
        };
        Object.defineProperty(exports2, "__esModule", { value: true });
        exports2.aliases = exports2.pseudos = exports2.filters = exports2.is = exports2.selectOne = exports2.selectAll = exports2.prepareContext = exports2._compileToken = exports2._compileUnsafe = exports2.compile = void 0;
        var DomUtils = __importStar2(/* @__PURE__ */ requireLib$7());
        var boolbase_1 = requireBoolbase();
        var compile_1 = requireCompile();
        var subselects_1 = requireSubselects();
        var defaultEquals = function(a, b) {
          return a === b;
        };
        var defaultOptions2 = {
          adapter: DomUtils,
          equals: defaultEquals
        };
        function convertOptionFormats(options2) {
          var _a2, _b2, _c, _d;
          var opts = options2 !== null && options2 !== void 0 ? options2 : defaultOptions2;
          (_a2 = opts.adapter) !== null && _a2 !== void 0 ? _a2 : opts.adapter = DomUtils;
          (_b2 = opts.equals) !== null && _b2 !== void 0 ? _b2 : opts.equals = (_d = (_c = opts.adapter) === null || _c === void 0 ? void 0 : _c.equals) !== null && _d !== void 0 ? _d : defaultEquals;
          return opts;
        }
        function wrapCompile(func) {
          return function addAdapter(selector2, options2, context) {
            var opts = convertOptionFormats(options2);
            return func(selector2, opts, context);
          };
        }
        exports2.compile = wrapCompile(compile_1.compile);
        exports2._compileUnsafe = wrapCompile(compile_1.compileUnsafe);
        exports2._compileToken = wrapCompile(compile_1.compileToken);
        function getSelectorFunc(searchFunc) {
          return function select(query2, elements, options2) {
            var opts = convertOptionFormats(options2);
            if (typeof query2 !== "function") {
              query2 = (0, compile_1.compileUnsafe)(query2, opts, elements);
            }
            var filteredElements = prepareContext(elements, opts.adapter, query2.shouldTestNextSiblings);
            return searchFunc(query2, filteredElements, opts);
          };
        }
        function prepareContext(elems, adapter, shouldTestNextSiblings) {
          if (shouldTestNextSiblings === void 0) {
            shouldTestNextSiblings = false;
          }
          if (shouldTestNextSiblings) {
            elems = appendNextSiblings(elems, adapter);
          }
          return Array.isArray(elems) ? adapter.removeSubsets(elems) : adapter.getChildren(elems);
        }
        exports2.prepareContext = prepareContext;
        function appendNextSiblings(elem, adapter) {
          var elems = Array.isArray(elem) ? elem.slice(0) : [elem];
          var elemsLength = elems.length;
          for (var i2 = 0; i2 < elemsLength; i2++) {
            var nextSiblings = (0, subselects_1.getNextSiblings)(elems[i2], adapter);
            elems.push.apply(elems, nextSiblings);
          }
          return elems;
        }
        exports2.selectAll = getSelectorFunc(function(query2, elems, options2) {
          return query2 === boolbase_1.falseFunc || !elems || elems.length === 0 ? [] : options2.adapter.findAll(query2, elems);
        });
        exports2.selectOne = getSelectorFunc(function(query2, elems, options2) {
          return query2 === boolbase_1.falseFunc || !elems || elems.length === 0 ? null : options2.adapter.findOne(query2, elems);
        });
        function is2(elem, query2, options2) {
          var opts = convertOptionFormats(options2);
          return (typeof query2 === "function" ? query2 : (0, compile_1.compile)(query2, opts))(elem);
        }
        exports2.is = is2;
        exports2.default = exports2.selectAll;
        var pseudo_selectors_1 = requirePseudoSelectors();
        Object.defineProperty(exports2, "filters", { enumerable: true, get: function() {
          return pseudo_selectors_1.filters;
        } });
        Object.defineProperty(exports2, "pseudos", { enumerable: true, get: function() {
          return pseudo_selectors_1.pseudos;
        } });
        Object.defineProperty(exports2, "aliases", { enumerable: true, get: function() {
          return pseudo_selectors_1.aliases;
        } });
      })(lib$9);
      return lib$9;
    }
    var helpers = {};
    var positionals = {};
    var hasRequiredPositionals;
    function requirePositionals() {
      if (hasRequiredPositionals) return positionals;
      hasRequiredPositionals = 1;
      (function(exports2) {
        Object.defineProperty(exports2, "__esModule", { value: true });
        exports2.getLimit = exports2.isFilter = exports2.filterNames = void 0;
        exports2.filterNames = /* @__PURE__ */ new Set([
          "first",
          "last",
          "eq",
          "gt",
          "nth",
          "lt",
          "even",
          "odd"
        ]);
        function isFilter(s) {
          if (s.type !== "pseudo")
            return false;
          if (exports2.filterNames.has(s.name))
            return true;
          if (s.name === "not" && Array.isArray(s.data)) {
            return s.data.some(function(s2) {
              return s2.some(isFilter);
            });
          }
          return false;
        }
        exports2.isFilter = isFilter;
        function getLimit(filter, data) {
          var num2 = data != null ? parseInt(data, 10) : NaN;
          switch (filter) {
            case "first":
              return 1;
            case "nth":
            case "eq":
              return isFinite(num2) ? num2 >= 0 ? num2 + 1 : Infinity : 0;
            case "lt":
              return isFinite(num2) ? num2 >= 0 ? num2 : Infinity : 0;
            case "gt":
              return isFinite(num2) ? Infinity : 0;
            default:
              return Infinity;
          }
        }
        exports2.getLimit = getLimit;
      })(positionals);
      return positionals;
    }
    var hasRequiredHelpers;
    function requireHelpers() {
      if (hasRequiredHelpers) return helpers;
      hasRequiredHelpers = 1;
      Object.defineProperty(helpers, "__esModule", { value: true });
      helpers.groupSelectors = helpers.getDocumentRoot = void 0;
      var positionals_1 = /* @__PURE__ */ requirePositionals();
      function getDocumentRoot(node2) {
        while (node2.parent)
          node2 = node2.parent;
        return node2;
      }
      helpers.getDocumentRoot = getDocumentRoot;
      function groupSelectors(selectors) {
        var filteredSelectors = [];
        var plainSelectors = [];
        for (var _i = 0, selectors_1 = selectors; _i < selectors_1.length; _i++) {
          var selector2 = selectors_1[_i];
          if (selector2.some(positionals_1.isFilter)) {
            filteredSelectors.push(selector2);
          } else {
            plainSelectors.push(selector2);
          }
        }
        return [plainSelectors, filteredSelectors];
      }
      helpers.groupSelectors = groupSelectors;
      return helpers;
    }
    var hasRequiredLib$4;
    function requireLib$4() {
      if (hasRequiredLib$4) return lib$a;
      hasRequiredLib$4 = 1;
      (function(exports2) {
        var __assign2 = lib$a && lib$a.__assign || function() {
          __assign2 = Object.assign || function(t2) {
            for (var s, i2 = 1, n = arguments.length; i2 < n; i2++) {
              s = arguments[i2];
              for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
                t2[p] = s[p];
            }
            return t2;
          };
          return __assign2.apply(this, arguments);
        };
        var __createBinding2 = lib$a && lib$a.__createBinding || (Object.create ? (function(o, m, k2, k22) {
          if (k22 === void 0) k22 = k2;
          var desc = Object.getOwnPropertyDescriptor(m, k2);
          if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
            desc = { enumerable: true, get: function() {
              return m[k2];
            } };
          }
          Object.defineProperty(o, k22, desc);
        }) : (function(o, m, k2, k22) {
          if (k22 === void 0) k22 = k2;
          o[k22] = m[k2];
        }));
        var __setModuleDefault2 = lib$a && lib$a.__setModuleDefault || (Object.create ? (function(o, v) {
          Object.defineProperty(o, "default", { enumerable: true, value: v });
        }) : function(o, v) {
          o["default"] = v;
        });
        var __importStar2 = lib$a && lib$a.__importStar || function(mod2) {
          if (mod2 && mod2.__esModule) return mod2;
          var result2 = {};
          if (mod2 != null) {
            for (var k2 in mod2) if (k2 !== "default" && Object.prototype.hasOwnProperty.call(mod2, k2)) __createBinding2(result2, mod2, k2);
          }
          __setModuleDefault2(result2, mod2);
          return result2;
        };
        var __spreadArray2 = lib$a && lib$a.__spreadArray || function(to2, from, pack) {
          if (pack || arguments.length === 2) for (var i2 = 0, l = from.length, ar2; i2 < l; i2++) {
            if (ar2 || !(i2 in from)) {
              if (!ar2) ar2 = Array.prototype.slice.call(from, 0, i2);
              ar2[i2] = from[i2];
            }
          }
          return to2.concat(ar2 || Array.prototype.slice.call(from));
        };
        Object.defineProperty(exports2, "__esModule", { value: true });
        exports2.select = exports2.filter = exports2.some = exports2.is = exports2.aliases = exports2.pseudos = exports2.filters = void 0;
        var css_what_1 = require$$0$1;
        var css_select_1 = requireLib$5();
        var DomUtils = __importStar2(/* @__PURE__ */ requireLib$7());
        var helpers_1 = /* @__PURE__ */ requireHelpers();
        var positionals_1 = /* @__PURE__ */ requirePositionals();
        var css_select_2 = requireLib$5();
        Object.defineProperty(exports2, "filters", { enumerable: true, get: function() {
          return css_select_2.filters;
        } });
        Object.defineProperty(exports2, "pseudos", { enumerable: true, get: function() {
          return css_select_2.pseudos;
        } });
        Object.defineProperty(exports2, "aliases", { enumerable: true, get: function() {
          return css_select_2.aliases;
        } });
        var SCOPE_PSEUDO = {
          type: css_what_1.SelectorType.Pseudo,
          name: "scope",
          data: null
        };
        var CUSTOM_SCOPE_PSEUDO = __assign2({}, SCOPE_PSEUDO);
        var UNIVERSAL_SELECTOR = {
          type: css_what_1.SelectorType.Universal,
          namespace: null
        };
        function is2(element, selector2, options2) {
          if (options2 === void 0) {
            options2 = {};
          }
          return some([element], selector2, options2);
        }
        exports2.is = is2;
        function some(elements, selector2, options2) {
          if (options2 === void 0) {
            options2 = {};
          }
          if (typeof selector2 === "function")
            return elements.some(selector2);
          var _a2 = (0, helpers_1.groupSelectors)((0, css_what_1.parse)(selector2)), plain = _a2[0], filtered = _a2[1];
          return plain.length > 0 && elements.some((0, css_select_1._compileToken)(plain, options2)) || filtered.some(function(sel) {
            return filterBySelector(sel, elements, options2).length > 0;
          });
        }
        exports2.some = some;
        function filterByPosition(filter2, elems, data, options2) {
          var num2 = typeof data === "string" ? parseInt(data, 10) : NaN;
          switch (filter2) {
            case "first":
            case "lt":
              return elems;
            case "last":
              return elems.length > 0 ? [elems[elems.length - 1]] : elems;
            case "nth":
            case "eq":
              return isFinite(num2) && Math.abs(num2) < elems.length ? [num2 < 0 ? elems[elems.length + num2] : elems[num2]] : [];
            case "gt":
              return isFinite(num2) ? elems.slice(num2 + 1) : [];
            case "even":
              return elems.filter(function(_, i2) {
                return i2 % 2 === 0;
              });
            case "odd":
              return elems.filter(function(_, i2) {
                return i2 % 2 === 1;
              });
            case "not": {
              var filtered_1 = new Set(filterParsed(data, elems, options2));
              return elems.filter(function(e) {
                return !filtered_1.has(e);
              });
            }
          }
        }
        function filter(selector2, elements, options2) {
          if (options2 === void 0) {
            options2 = {};
          }
          return filterParsed((0, css_what_1.parse)(selector2), elements, options2);
        }
        exports2.filter = filter;
        function filterParsed(selector2, elements, options2) {
          if (elements.length === 0)
            return [];
          var _a2 = (0, helpers_1.groupSelectors)(selector2), plainSelectors = _a2[0], filteredSelectors = _a2[1];
          var found;
          if (plainSelectors.length) {
            var filtered = filterElements(elements, plainSelectors, options2);
            if (filteredSelectors.length === 0) {
              return filtered;
            }
            if (filtered.length) {
              found = new Set(filtered);
            }
          }
          for (var i2 = 0; i2 < filteredSelectors.length && (found === null || found === void 0 ? void 0 : found.size) !== elements.length; i2++) {
            var filteredSelector = filteredSelectors[i2];
            var missing = found ? elements.filter(function(e) {
              return DomUtils.isTag(e) && !found.has(e);
            }) : elements;
            if (missing.length === 0)
              break;
            var filtered = filterBySelector(filteredSelector, elements, options2);
            if (filtered.length) {
              if (!found) {
                if (i2 === filteredSelectors.length - 1) {
                  return filtered;
                }
                found = new Set(filtered);
              } else {
                filtered.forEach(function(el2) {
                  return found.add(el2);
                });
              }
            }
          }
          return typeof found !== "undefined" ? found.size === elements.length ? elements : (
            // Filter elements to preserve order
            elements.filter(function(el2) {
              return found.has(el2);
            })
          ) : [];
        }
        function filterBySelector(selector2, elements, options2) {
          var _a2;
          if (selector2.some(css_what_1.isTraversal)) {
            var root2 = (_a2 = options2.root) !== null && _a2 !== void 0 ? _a2 : (0, helpers_1.getDocumentRoot)(elements[0]);
            var sel = __spreadArray2(__spreadArray2([], selector2, true), [CUSTOM_SCOPE_PSEUDO], false);
            return findFilterElements(root2, sel, options2, true, elements);
          }
          return findFilterElements(elements, selector2, options2, false);
        }
        function select(selector2, root2, options2) {
          if (options2 === void 0) {
            options2 = {};
          }
          if (typeof selector2 === "function") {
            return find2(root2, selector2);
          }
          var _a2 = (0, helpers_1.groupSelectors)((0, css_what_1.parse)(selector2)), plain = _a2[0], filtered = _a2[1];
          var results = filtered.map(function(sel) {
            return findFilterElements(root2, sel, options2, true);
          });
          if (plain.length) {
            results.push(findElements(root2, plain, options2, Infinity));
          }
          if (results.length === 0) {
            return [];
          }
          if (results.length === 1) {
            return results[0];
          }
          return DomUtils.uniqueSort(results.reduce(function(a, b) {
            return __spreadArray2(__spreadArray2([], a, true), b, true);
          }));
        }
        exports2.select = select;
        var specialTraversal = /* @__PURE__ */ new Set([
          css_what_1.SelectorType.Descendant,
          css_what_1.SelectorType.Adjacent
        ]);
        function includesScopePseudo(t2) {
          return t2 !== SCOPE_PSEUDO && t2.type === "pseudo" && (t2.name === "scope" || Array.isArray(t2.data) && t2.data.some(function(data) {
            return data.some(includesScopePseudo);
          }));
        }
        function addContextIfScope(selector2, options2, scopeContext) {
          return scopeContext && selector2.some(includesScopePseudo) ? __assign2(__assign2({}, options2), { context: scopeContext }) : options2;
        }
        function findFilterElements(root2, selector2, options2, queryForSelector, scopeContext) {
          var filterIndex = selector2.findIndex(positionals_1.isFilter);
          var sub2 = selector2.slice(0, filterIndex);
          var filter2 = selector2[filterIndex];
          var limit = (0, positionals_1.getLimit)(filter2.name, filter2.data);
          if (limit === 0)
            return [];
          var subOpts = addContextIfScope(sub2, options2, scopeContext);
          var elemsNoLimit = sub2.length === 0 && !Array.isArray(root2) ? DomUtils.getChildren(root2).filter(DomUtils.isTag) : sub2.length === 0 || sub2.length === 1 && sub2[0] === SCOPE_PSEUDO ? (Array.isArray(root2) ? root2 : [root2]).filter(DomUtils.isTag) : queryForSelector || sub2.some(css_what_1.isTraversal) ? findElements(root2, [sub2], subOpts, limit) : filterElements(root2, [sub2], subOpts);
          var elems = elemsNoLimit.slice(0, limit);
          var result2 = filterByPosition(filter2.name, elems, filter2.data, options2);
          if (result2.length === 0 || selector2.length === filterIndex + 1) {
            return result2;
          }
          var remainingSelector = selector2.slice(filterIndex + 1);
          var remainingHasTraversal = remainingSelector.some(css_what_1.isTraversal);
          var remainingOpts = addContextIfScope(remainingSelector, options2, scopeContext);
          if (remainingHasTraversal) {
            if (specialTraversal.has(remainingSelector[0].type)) {
              remainingSelector.unshift(UNIVERSAL_SELECTOR);
            }
            remainingSelector.unshift(SCOPE_PSEUDO);
          }
          return remainingSelector.some(positionals_1.isFilter) ? findFilterElements(result2, remainingSelector, options2, false, scopeContext) : remainingHasTraversal ? (
            // Query existing elements to resolve traversal.
            findElements(result2, [remainingSelector], remainingOpts, Infinity)
          ) : (
            // If we don't have any more traversals, simply filter elements.
            filterElements(result2, [remainingSelector], remainingOpts)
          );
        }
        function findElements(root2, sel, options2, limit) {
          if (limit === 0)
            return [];
          var query2 = (0, css_select_1._compileToken)(sel, options2, root2);
          return find2(root2, query2, limit);
        }
        function find2(root2, query2, limit) {
          if (limit === void 0) {
            limit = Infinity;
          }
          var elems = (0, css_select_1.prepareContext)(root2, DomUtils, query2.shouldTestNextSiblings);
          return DomUtils.find(function(node2) {
            return DomUtils.isTag(node2) && query2(node2);
          }, elems, true, limit);
        }
        function filterElements(elements, sel, options2) {
          var els2 = (Array.isArray(elements) ? elements : [elements]).filter(DomUtils.isTag);
          if (els2.length === 0)
            return els2;
          var query2 = (0, css_select_1._compileToken)(sel, options2);
          return els2.filter(query2);
        }
      })(lib$a);
      return lib$a;
    }
    var lib$2 = {};
    var Parser$1 = {};
    var Tokenizer = {};
    var hasRequiredTokenizer$1;
    function requireTokenizer$1() {
      if (hasRequiredTokenizer$1) return Tokenizer;
      hasRequiredTokenizer$1 = 1;
      var __importDefault2 = Tokenizer && Tokenizer.__importDefault || function(mod2) {
        return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
      };
      Object.defineProperty(Tokenizer, "__esModule", { value: true });
      var decode_codepoint_1 = __importDefault2(/* @__PURE__ */ requireDecode_codepoint());
      var entities_json_1 = __importDefault2(require$$1);
      var legacy_json_1 = __importDefault2(require$$2);
      var xml_json_1 = __importDefault2(require$$3);
      function whitespace(c2) {
        return c2 === " " || c2 === "\n" || c2 === "	" || c2 === "\f" || c2 === "\r";
      }
      function isASCIIAlpha(c2) {
        return c2 >= "a" && c2 <= "z" || c2 >= "A" && c2 <= "Z";
      }
      function ifElseState(upper, SUCCESS, FAILURE) {
        var lower = upper.toLowerCase();
        if (upper === lower) {
          return function(t2, c2) {
            if (c2 === lower) {
              t2._state = SUCCESS;
            } else {
              t2._state = FAILURE;
              t2._index--;
            }
          };
        }
        return function(t2, c2) {
          if (c2 === lower || c2 === upper) {
            t2._state = SUCCESS;
          } else {
            t2._state = FAILURE;
            t2._index--;
          }
        };
      }
      function consumeSpecialNameChar(upper, NEXT_STATE) {
        var lower = upper.toLowerCase();
        return function(t2, c2) {
          if (c2 === lower || c2 === upper) {
            t2._state = NEXT_STATE;
          } else {
            t2._state = 3;
            t2._index--;
          }
        };
      }
      var stateBeforeCdata1 = ifElseState(
        "C",
        24,
        16
        /* InDeclaration */
      );
      var stateBeforeCdata2 = ifElseState(
        "D",
        25,
        16
        /* InDeclaration */
      );
      var stateBeforeCdata3 = ifElseState(
        "A",
        26,
        16
        /* InDeclaration */
      );
      var stateBeforeCdata4 = ifElseState(
        "T",
        27,
        16
        /* InDeclaration */
      );
      var stateBeforeCdata5 = ifElseState(
        "A",
        28,
        16
        /* InDeclaration */
      );
      var stateBeforeScript1 = consumeSpecialNameChar(
        "R",
        35
        /* BeforeScript2 */
      );
      var stateBeforeScript2 = consumeSpecialNameChar(
        "I",
        36
        /* BeforeScript3 */
      );
      var stateBeforeScript3 = consumeSpecialNameChar(
        "P",
        37
        /* BeforeScript4 */
      );
      var stateBeforeScript4 = consumeSpecialNameChar(
        "T",
        38
        /* BeforeScript5 */
      );
      var stateAfterScript1 = ifElseState(
        "R",
        40,
        1
        /* Text */
      );
      var stateAfterScript2 = ifElseState(
        "I",
        41,
        1
        /* Text */
      );
      var stateAfterScript3 = ifElseState(
        "P",
        42,
        1
        /* Text */
      );
      var stateAfterScript4 = ifElseState(
        "T",
        43,
        1
        /* Text */
      );
      var stateBeforeStyle1 = consumeSpecialNameChar(
        "Y",
        45
        /* BeforeStyle2 */
      );
      var stateBeforeStyle2 = consumeSpecialNameChar(
        "L",
        46
        /* BeforeStyle3 */
      );
      var stateBeforeStyle3 = consumeSpecialNameChar(
        "E",
        47
        /* BeforeStyle4 */
      );
      var stateAfterStyle1 = ifElseState(
        "Y",
        49,
        1
        /* Text */
      );
      var stateAfterStyle2 = ifElseState(
        "L",
        50,
        1
        /* Text */
      );
      var stateAfterStyle3 = ifElseState(
        "E",
        51,
        1
        /* Text */
      );
      var stateBeforeSpecialT = consumeSpecialNameChar(
        "I",
        54
        /* BeforeTitle1 */
      );
      var stateBeforeTitle1 = consumeSpecialNameChar(
        "T",
        55
        /* BeforeTitle2 */
      );
      var stateBeforeTitle2 = consumeSpecialNameChar(
        "L",
        56
        /* BeforeTitle3 */
      );
      var stateBeforeTitle3 = consumeSpecialNameChar(
        "E",
        57
        /* BeforeTitle4 */
      );
      var stateAfterSpecialTEnd = ifElseState(
        "I",
        58,
        1
        /* Text */
      );
      var stateAfterTitle1 = ifElseState(
        "T",
        59,
        1
        /* Text */
      );
      var stateAfterTitle2 = ifElseState(
        "L",
        60,
        1
        /* Text */
      );
      var stateAfterTitle3 = ifElseState(
        "E",
        61,
        1
        /* Text */
      );
      var stateBeforeEntity = ifElseState(
        "#",
        63,
        64
        /* InNamedEntity */
      );
      var stateBeforeNumericEntity = ifElseState(
        "X",
        66,
        65
        /* InNumericEntity */
      );
      var Tokenizer$1 = (
        /** @class */
        (function() {
          function Tokenizer2(options2, cbs) {
            var _a2;
            this._state = 1;
            this.buffer = "";
            this.sectionStart = 0;
            this._index = 0;
            this.bufferOffset = 0;
            this.baseState = 1;
            this.special = 1;
            this.running = true;
            this.ended = false;
            this.cbs = cbs;
            this.xmlMode = !!(options2 === null || options2 === void 0 ? void 0 : options2.xmlMode);
            this.decodeEntities = (_a2 = options2 === null || options2 === void 0 ? void 0 : options2.decodeEntities) !== null && _a2 !== void 0 ? _a2 : true;
          }
          Tokenizer2.prototype.reset = function() {
            this._state = 1;
            this.buffer = "";
            this.sectionStart = 0;
            this._index = 0;
            this.bufferOffset = 0;
            this.baseState = 1;
            this.special = 1;
            this.running = true;
            this.ended = false;
          };
          Tokenizer2.prototype.write = function(chunk) {
            if (this.ended)
              this.cbs.onerror(Error(".write() after done!"));
            this.buffer += chunk;
            this.parse();
          };
          Tokenizer2.prototype.end = function(chunk) {
            if (this.ended)
              this.cbs.onerror(Error(".end() after done!"));
            if (chunk)
              this.write(chunk);
            this.ended = true;
            if (this.running)
              this.finish();
          };
          Tokenizer2.prototype.pause = function() {
            this.running = false;
          };
          Tokenizer2.prototype.resume = function() {
            this.running = true;
            if (this._index < this.buffer.length) {
              this.parse();
            }
            if (this.ended) {
              this.finish();
            }
          };
          Tokenizer2.prototype.getAbsoluteIndex = function() {
            return this.bufferOffset + this._index;
          };
          Tokenizer2.prototype.stateText = function(c2) {
            if (c2 === "<") {
              if (this._index > this.sectionStart) {
                this.cbs.ontext(this.getSection());
              }
              this._state = 2;
              this.sectionStart = this._index;
            } else if (this.decodeEntities && c2 === "&" && (this.special === 1 || this.special === 4)) {
              if (this._index > this.sectionStart) {
                this.cbs.ontext(this.getSection());
              }
              this.baseState = 1;
              this._state = 62;
              this.sectionStart = this._index;
            }
          };
          Tokenizer2.prototype.isTagStartChar = function(c2) {
            return isASCIIAlpha(c2) || this.xmlMode && !whitespace(c2) && c2 !== "/" && c2 !== ">";
          };
          Tokenizer2.prototype.stateBeforeTagName = function(c2) {
            if (c2 === "/") {
              this._state = 5;
            } else if (c2 === "<") {
              this.cbs.ontext(this.getSection());
              this.sectionStart = this._index;
            } else if (c2 === ">" || this.special !== 1 || whitespace(c2)) {
              this._state = 1;
            } else if (c2 === "!") {
              this._state = 15;
              this.sectionStart = this._index + 1;
            } else if (c2 === "?") {
              this._state = 17;
              this.sectionStart = this._index + 1;
            } else if (!this.isTagStartChar(c2)) {
              this._state = 1;
            } else {
              this._state = !this.xmlMode && (c2 === "s" || c2 === "S") ? 32 : !this.xmlMode && (c2 === "t" || c2 === "T") ? 52 : 3;
              this.sectionStart = this._index;
            }
          };
          Tokenizer2.prototype.stateInTagName = function(c2) {
            if (c2 === "/" || c2 === ">" || whitespace(c2)) {
              this.emitToken("onopentagname");
              this._state = 8;
              this._index--;
            }
          };
          Tokenizer2.prototype.stateBeforeClosingTagName = function(c2) {
            if (whitespace(c2)) ;
            else if (c2 === ">") {
              this._state = 1;
            } else if (this.special !== 1) {
              if (this.special !== 4 && (c2 === "s" || c2 === "S")) {
                this._state = 33;
              } else if (this.special === 4 && (c2 === "t" || c2 === "T")) {
                this._state = 53;
              } else {
                this._state = 1;
                this._index--;
              }
            } else if (!this.isTagStartChar(c2)) {
              this._state = 20;
              this.sectionStart = this._index;
            } else {
              this._state = 6;
              this.sectionStart = this._index;
            }
          };
          Tokenizer2.prototype.stateInClosingTagName = function(c2) {
            if (c2 === ">" || whitespace(c2)) {
              this.emitToken("onclosetag");
              this._state = 7;
              this._index--;
            }
          };
          Tokenizer2.prototype.stateAfterClosingTagName = function(c2) {
            if (c2 === ">") {
              this._state = 1;
              this.sectionStart = this._index + 1;
            }
          };
          Tokenizer2.prototype.stateBeforeAttributeName = function(c2) {
            if (c2 === ">") {
              this.cbs.onopentagend();
              this._state = 1;
              this.sectionStart = this._index + 1;
            } else if (c2 === "/") {
              this._state = 4;
            } else if (!whitespace(c2)) {
              this._state = 9;
              this.sectionStart = this._index;
            }
          };
          Tokenizer2.prototype.stateInSelfClosingTag = function(c2) {
            if (c2 === ">") {
              this.cbs.onselfclosingtag();
              this._state = 1;
              this.sectionStart = this._index + 1;
              this.special = 1;
            } else if (!whitespace(c2)) {
              this._state = 8;
              this._index--;
            }
          };
          Tokenizer2.prototype.stateInAttributeName = function(c2) {
            if (c2 === "=" || c2 === "/" || c2 === ">" || whitespace(c2)) {
              this.cbs.onattribname(this.getSection());
              this.sectionStart = -1;
              this._state = 10;
              this._index--;
            }
          };
          Tokenizer2.prototype.stateAfterAttributeName = function(c2) {
            if (c2 === "=") {
              this._state = 11;
            } else if (c2 === "/" || c2 === ">") {
              this.cbs.onattribend(void 0);
              this._state = 8;
              this._index--;
            } else if (!whitespace(c2)) {
              this.cbs.onattribend(void 0);
              this._state = 9;
              this.sectionStart = this._index;
            }
          };
          Tokenizer2.prototype.stateBeforeAttributeValue = function(c2) {
            if (c2 === '"') {
              this._state = 12;
              this.sectionStart = this._index + 1;
            } else if (c2 === "'") {
              this._state = 13;
              this.sectionStart = this._index + 1;
            } else if (!whitespace(c2)) {
              this._state = 14;
              this.sectionStart = this._index;
              this._index--;
            }
          };
          Tokenizer2.prototype.handleInAttributeValue = function(c2, quote2) {
            if (c2 === quote2) {
              this.emitToken("onattribdata");
              this.cbs.onattribend(quote2);
              this._state = 8;
            } else if (this.decodeEntities && c2 === "&") {
              this.emitToken("onattribdata");
              this.baseState = this._state;
              this._state = 62;
              this.sectionStart = this._index;
            }
          };
          Tokenizer2.prototype.stateInAttributeValueDoubleQuotes = function(c2) {
            this.handleInAttributeValue(c2, '"');
          };
          Tokenizer2.prototype.stateInAttributeValueSingleQuotes = function(c2) {
            this.handleInAttributeValue(c2, "'");
          };
          Tokenizer2.prototype.stateInAttributeValueNoQuotes = function(c2) {
            if (whitespace(c2) || c2 === ">") {
              this.emitToken("onattribdata");
              this.cbs.onattribend(null);
              this._state = 8;
              this._index--;
            } else if (this.decodeEntities && c2 === "&") {
              this.emitToken("onattribdata");
              this.baseState = this._state;
              this._state = 62;
              this.sectionStart = this._index;
            }
          };
          Tokenizer2.prototype.stateBeforeDeclaration = function(c2) {
            this._state = c2 === "[" ? 23 : c2 === "-" ? 18 : 16;
          };
          Tokenizer2.prototype.stateInDeclaration = function(c2) {
            if (c2 === ">") {
              this.cbs.ondeclaration(this.getSection());
              this._state = 1;
              this.sectionStart = this._index + 1;
            }
          };
          Tokenizer2.prototype.stateInProcessingInstruction = function(c2) {
            if (c2 === ">") {
              this.cbs.onprocessinginstruction(this.getSection());
              this._state = 1;
              this.sectionStart = this._index + 1;
            }
          };
          Tokenizer2.prototype.stateBeforeComment = function(c2) {
            if (c2 === "-") {
              this._state = 19;
              this.sectionStart = this._index + 1;
            } else {
              this._state = 16;
            }
          };
          Tokenizer2.prototype.stateInComment = function(c2) {
            if (c2 === "-")
              this._state = 21;
          };
          Tokenizer2.prototype.stateInSpecialComment = function(c2) {
            if (c2 === ">") {
              this.cbs.oncomment(this.buffer.substring(this.sectionStart, this._index));
              this._state = 1;
              this.sectionStart = this._index + 1;
            }
          };
          Tokenizer2.prototype.stateAfterComment1 = function(c2) {
            if (c2 === "-") {
              this._state = 22;
            } else {
              this._state = 19;
            }
          };
          Tokenizer2.prototype.stateAfterComment2 = function(c2) {
            if (c2 === ">") {
              this.cbs.oncomment(this.buffer.substring(this.sectionStart, this._index - 2));
              this._state = 1;
              this.sectionStart = this._index + 1;
            } else if (c2 !== "-") {
              this._state = 19;
            }
          };
          Tokenizer2.prototype.stateBeforeCdata6 = function(c2) {
            if (c2 === "[") {
              this._state = 29;
              this.sectionStart = this._index + 1;
            } else {
              this._state = 16;
              this._index--;
            }
          };
          Tokenizer2.prototype.stateInCdata = function(c2) {
            if (c2 === "]")
              this._state = 30;
          };
          Tokenizer2.prototype.stateAfterCdata1 = function(c2) {
            if (c2 === "]")
              this._state = 31;
            else
              this._state = 29;
          };
          Tokenizer2.prototype.stateAfterCdata2 = function(c2) {
            if (c2 === ">") {
              this.cbs.oncdata(this.buffer.substring(this.sectionStart, this._index - 2));
              this._state = 1;
              this.sectionStart = this._index + 1;
            } else if (c2 !== "]") {
              this._state = 29;
            }
          };
          Tokenizer2.prototype.stateBeforeSpecialS = function(c2) {
            if (c2 === "c" || c2 === "C") {
              this._state = 34;
            } else if (c2 === "t" || c2 === "T") {
              this._state = 44;
            } else {
              this._state = 3;
              this._index--;
            }
          };
          Tokenizer2.prototype.stateBeforeSpecialSEnd = function(c2) {
            if (this.special === 2 && (c2 === "c" || c2 === "C")) {
              this._state = 39;
            } else if (this.special === 3 && (c2 === "t" || c2 === "T")) {
              this._state = 48;
            } else
              this._state = 1;
          };
          Tokenizer2.prototype.stateBeforeSpecialLast = function(c2, special) {
            if (c2 === "/" || c2 === ">" || whitespace(c2)) {
              this.special = special;
            }
            this._state = 3;
            this._index--;
          };
          Tokenizer2.prototype.stateAfterSpecialLast = function(c2, sectionStartOffset) {
            if (c2 === ">" || whitespace(c2)) {
              this.special = 1;
              this._state = 6;
              this.sectionStart = this._index - sectionStartOffset;
              this._index--;
            } else
              this._state = 1;
          };
          Tokenizer2.prototype.parseFixedEntity = function(map2) {
            if (map2 === void 0) {
              map2 = this.xmlMode ? xml_json_1.default : entities_json_1.default;
            }
            if (this.sectionStart + 1 < this._index) {
              var entity2 = this.buffer.substring(this.sectionStart + 1, this._index);
              if (Object.prototype.hasOwnProperty.call(map2, entity2)) {
                this.emitPartial(map2[entity2]);
                this.sectionStart = this._index + 1;
              }
            }
          };
          Tokenizer2.prototype.parseLegacyEntity = function() {
            var start2 = this.sectionStart + 1;
            var limit = Math.min(this._index - start2, 6);
            while (limit >= 2) {
              var entity2 = this.buffer.substr(start2, limit);
              if (Object.prototype.hasOwnProperty.call(legacy_json_1.default, entity2)) {
                this.emitPartial(legacy_json_1.default[entity2]);
                this.sectionStart += limit + 1;
                return;
              }
              limit--;
            }
          };
          Tokenizer2.prototype.stateInNamedEntity = function(c2) {
            if (c2 === ";") {
              this.parseFixedEntity();
              if (this.baseState === 1 && this.sectionStart + 1 < this._index && !this.xmlMode) {
                this.parseLegacyEntity();
              }
              this._state = this.baseState;
            } else if ((c2 < "0" || c2 > "9") && !isASCIIAlpha(c2)) {
              if (this.xmlMode || this.sectionStart + 1 === this._index) ;
              else if (this.baseState !== 1) {
                if (c2 !== "=") {
                  this.parseFixedEntity(legacy_json_1.default);
                }
              } else {
                this.parseLegacyEntity();
              }
              this._state = this.baseState;
              this._index--;
            }
          };
          Tokenizer2.prototype.decodeNumericEntity = function(offset2, base2, strict) {
            var sectionStart = this.sectionStart + offset2;
            if (sectionStart !== this._index) {
              var entity2 = this.buffer.substring(sectionStart, this._index);
              var parsed = parseInt(entity2, base2);
              this.emitPartial(decode_codepoint_1.default(parsed));
              this.sectionStart = strict ? this._index + 1 : this._index;
            }
            this._state = this.baseState;
          };
          Tokenizer2.prototype.stateInNumericEntity = function(c2) {
            if (c2 === ";") {
              this.decodeNumericEntity(2, 10, true);
            } else if (c2 < "0" || c2 > "9") {
              if (!this.xmlMode) {
                this.decodeNumericEntity(2, 10, false);
              } else {
                this._state = this.baseState;
              }
              this._index--;
            }
          };
          Tokenizer2.prototype.stateInHexEntity = function(c2) {
            if (c2 === ";") {
              this.decodeNumericEntity(3, 16, true);
            } else if ((c2 < "a" || c2 > "f") && (c2 < "A" || c2 > "F") && (c2 < "0" || c2 > "9")) {
              if (!this.xmlMode) {
                this.decodeNumericEntity(3, 16, false);
              } else {
                this._state = this.baseState;
              }
              this._index--;
            }
          };
          Tokenizer2.prototype.cleanup = function() {
            if (this.sectionStart < 0) {
              this.buffer = "";
              this.bufferOffset += this._index;
              this._index = 0;
            } else if (this.running) {
              if (this._state === 1) {
                if (this.sectionStart !== this._index) {
                  this.cbs.ontext(this.buffer.substr(this.sectionStart));
                }
                this.buffer = "";
                this.bufferOffset += this._index;
                this._index = 0;
              } else if (this.sectionStart === this._index) {
                this.buffer = "";
                this.bufferOffset += this._index;
                this._index = 0;
              } else {
                this.buffer = this.buffer.substr(this.sectionStart);
                this._index -= this.sectionStart;
                this.bufferOffset += this.sectionStart;
              }
              this.sectionStart = 0;
            }
          };
          Tokenizer2.prototype.parse = function() {
            while (this._index < this.buffer.length && this.running) {
              var c2 = this.buffer.charAt(this._index);
              if (this._state === 1) {
                this.stateText(c2);
              } else if (this._state === 12) {
                this.stateInAttributeValueDoubleQuotes(c2);
              } else if (this._state === 9) {
                this.stateInAttributeName(c2);
              } else if (this._state === 19) {
                this.stateInComment(c2);
              } else if (this._state === 20) {
                this.stateInSpecialComment(c2);
              } else if (this._state === 8) {
                this.stateBeforeAttributeName(c2);
              } else if (this._state === 3) {
                this.stateInTagName(c2);
              } else if (this._state === 6) {
                this.stateInClosingTagName(c2);
              } else if (this._state === 2) {
                this.stateBeforeTagName(c2);
              } else if (this._state === 10) {
                this.stateAfterAttributeName(c2);
              } else if (this._state === 13) {
                this.stateInAttributeValueSingleQuotes(c2);
              } else if (this._state === 11) {
                this.stateBeforeAttributeValue(c2);
              } else if (this._state === 5) {
                this.stateBeforeClosingTagName(c2);
              } else if (this._state === 7) {
                this.stateAfterClosingTagName(c2);
              } else if (this._state === 32) {
                this.stateBeforeSpecialS(c2);
              } else if (this._state === 21) {
                this.stateAfterComment1(c2);
              } else if (this._state === 14) {
                this.stateInAttributeValueNoQuotes(c2);
              } else if (this._state === 4) {
                this.stateInSelfClosingTag(c2);
              } else if (this._state === 16) {
                this.stateInDeclaration(c2);
              } else if (this._state === 15) {
                this.stateBeforeDeclaration(c2);
              } else if (this._state === 22) {
                this.stateAfterComment2(c2);
              } else if (this._state === 18) {
                this.stateBeforeComment(c2);
              } else if (this._state === 33) {
                this.stateBeforeSpecialSEnd(c2);
              } else if (this._state === 53) {
                stateAfterSpecialTEnd(this, c2);
              } else if (this._state === 39) {
                stateAfterScript1(this, c2);
              } else if (this._state === 40) {
                stateAfterScript2(this, c2);
              } else if (this._state === 41) {
                stateAfterScript3(this, c2);
              } else if (this._state === 34) {
                stateBeforeScript1(this, c2);
              } else if (this._state === 35) {
                stateBeforeScript2(this, c2);
              } else if (this._state === 36) {
                stateBeforeScript3(this, c2);
              } else if (this._state === 37) {
                stateBeforeScript4(this, c2);
              } else if (this._state === 38) {
                this.stateBeforeSpecialLast(
                  c2,
                  2
                  /* Script */
                );
              } else if (this._state === 42) {
                stateAfterScript4(this, c2);
              } else if (this._state === 43) {
                this.stateAfterSpecialLast(c2, 6);
              } else if (this._state === 44) {
                stateBeforeStyle1(this, c2);
              } else if (this._state === 29) {
                this.stateInCdata(c2);
              } else if (this._state === 45) {
                stateBeforeStyle2(this, c2);
              } else if (this._state === 46) {
                stateBeforeStyle3(this, c2);
              } else if (this._state === 47) {
                this.stateBeforeSpecialLast(
                  c2,
                  3
                  /* Style */
                );
              } else if (this._state === 48) {
                stateAfterStyle1(this, c2);
              } else if (this._state === 49) {
                stateAfterStyle2(this, c2);
              } else if (this._state === 50) {
                stateAfterStyle3(this, c2);
              } else if (this._state === 51) {
                this.stateAfterSpecialLast(c2, 5);
              } else if (this._state === 52) {
                stateBeforeSpecialT(this, c2);
              } else if (this._state === 54) {
                stateBeforeTitle1(this, c2);
              } else if (this._state === 55) {
                stateBeforeTitle2(this, c2);
              } else if (this._state === 56) {
                stateBeforeTitle3(this, c2);
              } else if (this._state === 57) {
                this.stateBeforeSpecialLast(
                  c2,
                  4
                  /* Title */
                );
              } else if (this._state === 58) {
                stateAfterTitle1(this, c2);
              } else if (this._state === 59) {
                stateAfterTitle2(this, c2);
              } else if (this._state === 60) {
                stateAfterTitle3(this, c2);
              } else if (this._state === 61) {
                this.stateAfterSpecialLast(c2, 5);
              } else if (this._state === 17) {
                this.stateInProcessingInstruction(c2);
              } else if (this._state === 64) {
                this.stateInNamedEntity(c2);
              } else if (this._state === 23) {
                stateBeforeCdata1(this, c2);
              } else if (this._state === 62) {
                stateBeforeEntity(this, c2);
              } else if (this._state === 24) {
                stateBeforeCdata2(this, c2);
              } else if (this._state === 25) {
                stateBeforeCdata3(this, c2);
              } else if (this._state === 30) {
                this.stateAfterCdata1(c2);
              } else if (this._state === 31) {
                this.stateAfterCdata2(c2);
              } else if (this._state === 26) {
                stateBeforeCdata4(this, c2);
              } else if (this._state === 27) {
                stateBeforeCdata5(this, c2);
              } else if (this._state === 28) {
                this.stateBeforeCdata6(c2);
              } else if (this._state === 66) {
                this.stateInHexEntity(c2);
              } else if (this._state === 65) {
                this.stateInNumericEntity(c2);
              } else if (this._state === 63) {
                stateBeforeNumericEntity(this, c2);
              } else {
                this.cbs.onerror(Error("unknown _state"), this._state);
              }
              this._index++;
            }
            this.cleanup();
          };
          Tokenizer2.prototype.finish = function() {
            if (this.sectionStart < this._index) {
              this.handleTrailingData();
            }
            this.cbs.onend();
          };
          Tokenizer2.prototype.handleTrailingData = function() {
            var data = this.buffer.substr(this.sectionStart);
            if (this._state === 29 || this._state === 30 || this._state === 31) {
              this.cbs.oncdata(data);
            } else if (this._state === 19 || this._state === 21 || this._state === 22) {
              this.cbs.oncomment(data);
            } else if (this._state === 64 && !this.xmlMode) {
              this.parseLegacyEntity();
              if (this.sectionStart < this._index) {
                this._state = this.baseState;
                this.handleTrailingData();
              }
            } else if (this._state === 65 && !this.xmlMode) {
              this.decodeNumericEntity(2, 10, false);
              if (this.sectionStart < this._index) {
                this._state = this.baseState;
                this.handleTrailingData();
              }
            } else if (this._state === 66 && !this.xmlMode) {
              this.decodeNumericEntity(3, 16, false);
              if (this.sectionStart < this._index) {
                this._state = this.baseState;
                this.handleTrailingData();
              }
            } else if (this._state !== 3 && this._state !== 8 && this._state !== 11 && this._state !== 10 && this._state !== 9 && this._state !== 13 && this._state !== 12 && this._state !== 14 && this._state !== 6) {
              this.cbs.ontext(data);
            }
          };
          Tokenizer2.prototype.getSection = function() {
            return this.buffer.substring(this.sectionStart, this._index);
          };
          Tokenizer2.prototype.emitToken = function(name2) {
            this.cbs[name2](this.getSection());
            this.sectionStart = -1;
          };
          Tokenizer2.prototype.emitPartial = function(value2) {
            if (this.baseState !== 1) {
              this.cbs.onattribdata(value2);
            } else {
              this.cbs.ontext(value2);
            }
          };
          return Tokenizer2;
        })()
      );
      Tokenizer.default = Tokenizer$1;
      return Tokenizer;
    }
    var hasRequiredParser$3;
    function requireParser$3() {
      if (hasRequiredParser$3) return Parser$1;
      hasRequiredParser$3 = 1;
      var __importDefault2 = Parser$1 && Parser$1.__importDefault || function(mod2) {
        return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
      };
      Object.defineProperty(Parser$1, "__esModule", { value: true });
      Parser$1.Parser = void 0;
      var Tokenizer_1 = __importDefault2(/* @__PURE__ */ requireTokenizer$1());
      var formTags = /* @__PURE__ */ new Set([
        "input",
        "option",
        "optgroup",
        "select",
        "button",
        "datalist",
        "textarea"
      ]);
      var pTag = /* @__PURE__ */ new Set(["p"]);
      var openImpliesClose = {
        tr: /* @__PURE__ */ new Set(["tr", "th", "td"]),
        th: /* @__PURE__ */ new Set(["th"]),
        td: /* @__PURE__ */ new Set(["thead", "th", "td"]),
        body: /* @__PURE__ */ new Set(["head", "link", "script"]),
        li: /* @__PURE__ */ new Set(["li"]),
        p: pTag,
        h1: pTag,
        h2: pTag,
        h3: pTag,
        h4: pTag,
        h5: pTag,
        h6: pTag,
        select: formTags,
        input: formTags,
        output: formTags,
        button: formTags,
        datalist: formTags,
        textarea: formTags,
        option: /* @__PURE__ */ new Set(["option"]),
        optgroup: /* @__PURE__ */ new Set(["optgroup", "option"]),
        dd: /* @__PURE__ */ new Set(["dt", "dd"]),
        dt: /* @__PURE__ */ new Set(["dt", "dd"]),
        address: pTag,
        article: pTag,
        aside: pTag,
        blockquote: pTag,
        details: pTag,
        div: pTag,
        dl: pTag,
        fieldset: pTag,
        figcaption: pTag,
        figure: pTag,
        footer: pTag,
        form: pTag,
        header: pTag,
        hr: pTag,
        main: pTag,
        nav: pTag,
        ol: pTag,
        pre: pTag,
        section: pTag,
        table: pTag,
        ul: pTag,
        rt: /* @__PURE__ */ new Set(["rt", "rp"]),
        rp: /* @__PURE__ */ new Set(["rt", "rp"]),
        tbody: /* @__PURE__ */ new Set(["thead", "tbody"]),
        tfoot: /* @__PURE__ */ new Set(["thead", "tbody"])
      };
      var voidElements = /* @__PURE__ */ new Set([
        "area",
        "base",
        "basefont",
        "br",
        "col",
        "command",
        "embed",
        "frame",
        "hr",
        "img",
        "input",
        "isindex",
        "keygen",
        "link",
        "meta",
        "param",
        "source",
        "track",
        "wbr"
      ]);
      var foreignContextElements = /* @__PURE__ */ new Set(["math", "svg"]);
      var htmlIntegrationElements = /* @__PURE__ */ new Set([
        "mi",
        "mo",
        "mn",
        "ms",
        "mtext",
        "annotation-xml",
        "foreignObject",
        "desc",
        "title"
      ]);
      var reNameEnd = /\s|\//;
      var Parser2 = (
        /** @class */
        (function() {
          function Parser3(cbs, options2) {
            if (options2 === void 0) {
              options2 = {};
            }
            var _a2, _b2, _c, _d, _e2;
            this.startIndex = 0;
            this.endIndex = null;
            this.tagname = "";
            this.attribname = "";
            this.attribvalue = "";
            this.attribs = null;
            this.stack = [];
            this.foreignContext = [];
            this.options = options2;
            this.cbs = cbs !== null && cbs !== void 0 ? cbs : {};
            this.lowerCaseTagNames = (_a2 = options2.lowerCaseTags) !== null && _a2 !== void 0 ? _a2 : !options2.xmlMode;
            this.lowerCaseAttributeNames = (_b2 = options2.lowerCaseAttributeNames) !== null && _b2 !== void 0 ? _b2 : !options2.xmlMode;
            this.tokenizer = new ((_c = options2.Tokenizer) !== null && _c !== void 0 ? _c : Tokenizer_1.default)(this.options, this);
            (_e2 = (_d = this.cbs).onparserinit) === null || _e2 === void 0 ? void 0 : _e2.call(_d, this);
          }
          Parser3.prototype.updatePosition = function(initialOffset) {
            if (this.endIndex === null) {
              if (this.tokenizer.sectionStart <= initialOffset) {
                this.startIndex = 0;
              } else {
                this.startIndex = this.tokenizer.sectionStart - initialOffset;
              }
            } else {
              this.startIndex = this.endIndex + 1;
            }
            this.endIndex = this.tokenizer.getAbsoluteIndex();
          };
          Parser3.prototype.ontext = function(data) {
            var _a2, _b2;
            this.updatePosition(1);
            this.endIndex--;
            (_b2 = (_a2 = this.cbs).ontext) === null || _b2 === void 0 ? void 0 : _b2.call(_a2, data);
          };
          Parser3.prototype.onopentagname = function(name2) {
            var _a2, _b2;
            if (this.lowerCaseTagNames) {
              name2 = name2.toLowerCase();
            }
            this.tagname = name2;
            if (!this.options.xmlMode && Object.prototype.hasOwnProperty.call(openImpliesClose, name2)) {
              var el2 = void 0;
              while (this.stack.length > 0 && openImpliesClose[name2].has(el2 = this.stack[this.stack.length - 1])) {
                this.onclosetag(el2);
              }
            }
            if (this.options.xmlMode || !voidElements.has(name2)) {
              this.stack.push(name2);
              if (foreignContextElements.has(name2)) {
                this.foreignContext.push(true);
              } else if (htmlIntegrationElements.has(name2)) {
                this.foreignContext.push(false);
              }
            }
            (_b2 = (_a2 = this.cbs).onopentagname) === null || _b2 === void 0 ? void 0 : _b2.call(_a2, name2);
            if (this.cbs.onopentag)
              this.attribs = {};
          };
          Parser3.prototype.onopentagend = function() {
            var _a2, _b2;
            this.updatePosition(1);
            if (this.attribs) {
              (_b2 = (_a2 = this.cbs).onopentag) === null || _b2 === void 0 ? void 0 : _b2.call(_a2, this.tagname, this.attribs);
              this.attribs = null;
            }
            if (!this.options.xmlMode && this.cbs.onclosetag && voidElements.has(this.tagname)) {
              this.cbs.onclosetag(this.tagname);
            }
            this.tagname = "";
          };
          Parser3.prototype.onclosetag = function(name2) {
            this.updatePosition(1);
            if (this.lowerCaseTagNames) {
              name2 = name2.toLowerCase();
            }
            if (foreignContextElements.has(name2) || htmlIntegrationElements.has(name2)) {
              this.foreignContext.pop();
            }
            if (this.stack.length && (this.options.xmlMode || !voidElements.has(name2))) {
              var pos2 = this.stack.lastIndexOf(name2);
              if (pos2 !== -1) {
                if (this.cbs.onclosetag) {
                  pos2 = this.stack.length - pos2;
                  while (pos2--) {
                    this.cbs.onclosetag(this.stack.pop());
                  }
                } else
                  this.stack.length = pos2;
              } else if (name2 === "p" && !this.options.xmlMode) {
                this.onopentagname(name2);
                this.closeCurrentTag();
              }
            } else if (!this.options.xmlMode && (name2 === "br" || name2 === "p")) {
              this.onopentagname(name2);
              this.closeCurrentTag();
            }
          };
          Parser3.prototype.onselfclosingtag = function() {
            if (this.options.xmlMode || this.options.recognizeSelfClosing || this.foreignContext[this.foreignContext.length - 1]) {
              this.closeCurrentTag();
            } else {
              this.onopentagend();
            }
          };
          Parser3.prototype.closeCurrentTag = function() {
            var _a2, _b2;
            var name2 = this.tagname;
            this.onopentagend();
            if (this.stack[this.stack.length - 1] === name2) {
              (_b2 = (_a2 = this.cbs).onclosetag) === null || _b2 === void 0 ? void 0 : _b2.call(_a2, name2);
              this.stack.pop();
            }
          };
          Parser3.prototype.onattribname = function(name2) {
            if (this.lowerCaseAttributeNames) {
              name2 = name2.toLowerCase();
            }
            this.attribname = name2;
          };
          Parser3.prototype.onattribdata = function(value2) {
            this.attribvalue += value2;
          };
          Parser3.prototype.onattribend = function(quote2) {
            var _a2, _b2;
            (_b2 = (_a2 = this.cbs).onattribute) === null || _b2 === void 0 ? void 0 : _b2.call(_a2, this.attribname, this.attribvalue, quote2);
            if (this.attribs && !Object.prototype.hasOwnProperty.call(this.attribs, this.attribname)) {
              this.attribs[this.attribname] = this.attribvalue;
            }
            this.attribname = "";
            this.attribvalue = "";
          };
          Parser3.prototype.getInstructionName = function(value2) {
            var idx = value2.search(reNameEnd);
            var name2 = idx < 0 ? value2 : value2.substr(0, idx);
            if (this.lowerCaseTagNames) {
              name2 = name2.toLowerCase();
            }
            return name2;
          };
          Parser3.prototype.ondeclaration = function(value2) {
            if (this.cbs.onprocessinginstruction) {
              var name_1 = this.getInstructionName(value2);
              this.cbs.onprocessinginstruction("!" + name_1, "!" + value2);
            }
          };
          Parser3.prototype.onprocessinginstruction = function(value2) {
            if (this.cbs.onprocessinginstruction) {
              var name_2 = this.getInstructionName(value2);
              this.cbs.onprocessinginstruction("?" + name_2, "?" + value2);
            }
          };
          Parser3.prototype.oncomment = function(value2) {
            var _a2, _b2, _c, _d;
            this.updatePosition(4);
            (_b2 = (_a2 = this.cbs).oncomment) === null || _b2 === void 0 ? void 0 : _b2.call(_a2, value2);
            (_d = (_c = this.cbs).oncommentend) === null || _d === void 0 ? void 0 : _d.call(_c);
          };
          Parser3.prototype.oncdata = function(value2) {
            var _a2, _b2, _c, _d, _e2, _f;
            this.updatePosition(1);
            if (this.options.xmlMode || this.options.recognizeCDATA) {
              (_b2 = (_a2 = this.cbs).oncdatastart) === null || _b2 === void 0 ? void 0 : _b2.call(_a2);
              (_d = (_c = this.cbs).ontext) === null || _d === void 0 ? void 0 : _d.call(_c, value2);
              (_f = (_e2 = this.cbs).oncdataend) === null || _f === void 0 ? void 0 : _f.call(_e2);
            } else {
              this.oncomment("[CDATA[" + value2 + "]]");
            }
          };
          Parser3.prototype.onerror = function(err2) {
            var _a2, _b2;
            (_b2 = (_a2 = this.cbs).onerror) === null || _b2 === void 0 ? void 0 : _b2.call(_a2, err2);
          };
          Parser3.prototype.onend = function() {
            var _a2, _b2;
            if (this.cbs.onclosetag) {
              for (var i2 = this.stack.length; i2 > 0; this.cbs.onclosetag(this.stack[--i2]))
                ;
            }
            (_b2 = (_a2 = this.cbs).onend) === null || _b2 === void 0 ? void 0 : _b2.call(_a2);
          };
          Parser3.prototype.reset = function() {
            var _a2, _b2, _c, _d;
            (_b2 = (_a2 = this.cbs).onreset) === null || _b2 === void 0 ? void 0 : _b2.call(_a2);
            this.tokenizer.reset();
            this.tagname = "";
            this.attribname = "";
            this.attribs = null;
            this.stack = [];
            (_d = (_c = this.cbs).onparserinit) === null || _d === void 0 ? void 0 : _d.call(_c, this);
          };
          Parser3.prototype.parseComplete = function(data) {
            this.reset();
            this.end(data);
          };
          Parser3.prototype.write = function(chunk) {
            this.tokenizer.write(chunk);
          };
          Parser3.prototype.end = function(chunk) {
            this.tokenizer.end(chunk);
          };
          Parser3.prototype.pause = function() {
            this.tokenizer.pause();
          };
          Parser3.prototype.resume = function() {
            this.tokenizer.resume();
          };
          Parser3.prototype.parseChunk = function(chunk) {
            this.write(chunk);
          };
          Parser3.prototype.done = function(chunk) {
            this.end(chunk);
          };
          return Parser3;
        })()
      );
      Parser$1.Parser = Parser2;
      return Parser$1;
    }
    var FeedHandler = {};
    var hasRequiredFeedHandler;
    function requireFeedHandler() {
      if (hasRequiredFeedHandler) return FeedHandler;
      hasRequiredFeedHandler = 1;
      var __extends2 = FeedHandler && FeedHandler.__extends || /* @__PURE__ */ (function() {
        var extendStatics2 = function(d, b) {
          extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
            d2.__proto__ = b2;
          } || function(d2, b2) {
            for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
          };
          return extendStatics2(d, b);
        };
        return function(d, b) {
          if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
          extendStatics2(d, b);
          function __() {
            this.constructor = d;
          }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };
      })();
      var __createBinding2 = FeedHandler && FeedHandler.__createBinding || (Object.create ? (function(o, m, k2, k22) {
        if (k22 === void 0) k22 = k2;
        Object.defineProperty(o, k22, { enumerable: true, get: function() {
          return m[k2];
        } });
      }) : (function(o, m, k2, k22) {
        if (k22 === void 0) k22 = k2;
        o[k22] = m[k2];
      }));
      var __setModuleDefault2 = FeedHandler && FeedHandler.__setModuleDefault || (Object.create ? (function(o, v) {
        Object.defineProperty(o, "default", { enumerable: true, value: v });
      }) : function(o, v) {
        o["default"] = v;
      });
      var __importStar2 = FeedHandler && FeedHandler.__importStar || function(mod2) {
        if (mod2 && mod2.__esModule) return mod2;
        var result2 = {};
        if (mod2 != null) {
          for (var k2 in mod2) if (k2 !== "default" && Object.prototype.hasOwnProperty.call(mod2, k2)) __createBinding2(result2, mod2, k2);
        }
        __setModuleDefault2(result2, mod2);
        return result2;
      };
      var __importDefault2 = FeedHandler && FeedHandler.__importDefault || function(mod2) {
        return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
      };
      Object.defineProperty(FeedHandler, "__esModule", { value: true });
      FeedHandler.parseFeed = FeedHandler.FeedHandler = void 0;
      var domhandler_1 = __importDefault2(/* @__PURE__ */ requireLib$a());
      var DomUtils = __importStar2(/* @__PURE__ */ requireLib$7());
      var Parser_1 = /* @__PURE__ */ requireParser$3();
      var FeedItemMediaMedium;
      (function(FeedItemMediaMedium2) {
        FeedItemMediaMedium2[FeedItemMediaMedium2["image"] = 0] = "image";
        FeedItemMediaMedium2[FeedItemMediaMedium2["audio"] = 1] = "audio";
        FeedItemMediaMedium2[FeedItemMediaMedium2["video"] = 2] = "video";
        FeedItemMediaMedium2[FeedItemMediaMedium2["document"] = 3] = "document";
        FeedItemMediaMedium2[FeedItemMediaMedium2["executable"] = 4] = "executable";
      })(FeedItemMediaMedium || (FeedItemMediaMedium = {}));
      var FeedItemMediaExpression;
      (function(FeedItemMediaExpression2) {
        FeedItemMediaExpression2[FeedItemMediaExpression2["sample"] = 0] = "sample";
        FeedItemMediaExpression2[FeedItemMediaExpression2["full"] = 1] = "full";
        FeedItemMediaExpression2[FeedItemMediaExpression2["nonstop"] = 2] = "nonstop";
      })(FeedItemMediaExpression || (FeedItemMediaExpression = {}));
      var FeedHandler$1 = (
        /** @class */
        (function(_super) {
          __extends2(FeedHandler2, _super);
          function FeedHandler2(callback, options2) {
            var _this = this;
            if (typeof callback === "object") {
              callback = void 0;
              options2 = callback;
            }
            _this = _super.call(this, callback, options2) || this;
            return _this;
          }
          FeedHandler2.prototype.onend = function() {
            var _a2, _b2;
            var feedRoot = getOneElement(isValidFeed, this.dom);
            if (!feedRoot) {
              this.handleCallback(new Error("couldn't find root of feed"));
              return;
            }
            var feed = {};
            if (feedRoot.name === "feed") {
              var childs = feedRoot.children;
              feed.type = "atom";
              addConditionally(feed, "id", "id", childs);
              addConditionally(feed, "title", "title", childs);
              var href = getAttribute("href", getOneElement("link", childs));
              if (href) {
                feed.link = href;
              }
              addConditionally(feed, "description", "subtitle", childs);
              var updated = fetch2("updated", childs);
              if (updated) {
                feed.updated = new Date(updated);
              }
              addConditionally(feed, "author", "email", childs, true);
              feed.items = getElements("entry", childs).map(function(item2) {
                var entry = {};
                var children2 = item2.children;
                addConditionally(entry, "id", "id", children2);
                addConditionally(entry, "title", "title", children2);
                var href2 = getAttribute("href", getOneElement("link", children2));
                if (href2) {
                  entry.link = href2;
                }
                var description2 = fetch2("summary", children2) || fetch2("content", children2);
                if (description2) {
                  entry.description = description2;
                }
                var pubDate = fetch2("updated", children2);
                if (pubDate) {
                  entry.pubDate = new Date(pubDate);
                }
                entry.media = getMediaElements(children2);
                return entry;
              });
            } else {
              var childs = (_b2 = (_a2 = getOneElement("channel", feedRoot.children)) === null || _a2 === void 0 ? void 0 : _a2.children) !== null && _b2 !== void 0 ? _b2 : [];
              feed.type = feedRoot.name.substr(0, 3);
              feed.id = "";
              addConditionally(feed, "title", "title", childs);
              addConditionally(feed, "link", "link", childs);
              addConditionally(feed, "description", "description", childs);
              var updated = fetch2("lastBuildDate", childs);
              if (updated) {
                feed.updated = new Date(updated);
              }
              addConditionally(feed, "author", "managingEditor", childs, true);
              feed.items = getElements("item", feedRoot.children).map(function(item2) {
                var entry = {};
                var children2 = item2.children;
                addConditionally(entry, "id", "guid", children2);
                addConditionally(entry, "title", "title", children2);
                addConditionally(entry, "link", "link", children2);
                addConditionally(entry, "description", "description", children2);
                var pubDate = fetch2("pubDate", children2);
                if (pubDate)
                  entry.pubDate = new Date(pubDate);
                entry.media = getMediaElements(children2);
                return entry;
              });
            }
            this.feed = feed;
            this.handleCallback(null);
          };
          return FeedHandler2;
        })(domhandler_1.default)
      );
      FeedHandler.FeedHandler = FeedHandler$1;
      function getMediaElements(where) {
        return getElements("media:content", where).map(function(elem) {
          var media = {
            medium: elem.attribs.medium,
            isDefault: !!elem.attribs.isDefault
          };
          if (elem.attribs.url) {
            media.url = elem.attribs.url;
          }
          if (elem.attribs.fileSize) {
            media.fileSize = parseInt(elem.attribs.fileSize, 10);
          }
          if (elem.attribs.type) {
            media.type = elem.attribs.type;
          }
          if (elem.attribs.expression) {
            media.expression = elem.attribs.expression;
          }
          if (elem.attribs.bitrate) {
            media.bitrate = parseInt(elem.attribs.bitrate, 10);
          }
          if (elem.attribs.framerate) {
            media.framerate = parseInt(elem.attribs.framerate, 10);
          }
          if (elem.attribs.samplingrate) {
            media.samplingrate = parseInt(elem.attribs.samplingrate, 10);
          }
          if (elem.attribs.channels) {
            media.channels = parseInt(elem.attribs.channels, 10);
          }
          if (elem.attribs.duration) {
            media.duration = parseInt(elem.attribs.duration, 10);
          }
          if (elem.attribs.height) {
            media.height = parseInt(elem.attribs.height, 10);
          }
          if (elem.attribs.width) {
            media.width = parseInt(elem.attribs.width, 10);
          }
          if (elem.attribs.lang) {
            media.lang = elem.attribs.lang;
          }
          return media;
        });
      }
      function getElements(tagName, where) {
        return DomUtils.getElementsByTagName(tagName, where, true);
      }
      function getOneElement(tagName, node2) {
        return DomUtils.getElementsByTagName(tagName, node2, true, 1)[0];
      }
      function fetch2(tagName, where, recurse) {
        if (recurse === void 0) {
          recurse = false;
        }
        return DomUtils.getText(DomUtils.getElementsByTagName(tagName, where, recurse, 1)).trim();
      }
      function getAttribute(name2, elem) {
        if (!elem) {
          return null;
        }
        var attribs = elem.attribs;
        return attribs[name2];
      }
      function addConditionally(obj, prop2, what, where, recurse) {
        if (recurse === void 0) {
          recurse = false;
        }
        var tmp = fetch2(what, where, recurse);
        if (tmp)
          obj[prop2] = tmp;
      }
      function isValidFeed(value2) {
        return value2 === "rss" || value2 === "feed" || value2 === "rdf:RDF";
      }
      function parseFeed(feed, options2) {
        if (options2 === void 0) {
          options2 = { xmlMode: true };
        }
        var handler = new FeedHandler$1(options2);
        new Parser_1.Parser(handler, options2).end(feed);
        return handler.feed;
      }
      FeedHandler.parseFeed = parseFeed;
      return FeedHandler;
    }
    var hasRequiredLib$3;
    function requireLib$3() {
      if (hasRequiredLib$3) return lib$2;
      hasRequiredLib$3 = 1;
      (function(exports2) {
        var __createBinding2 = lib$2 && lib$2.__createBinding || (Object.create ? (function(o, m, k2, k22) {
          if (k22 === void 0) k22 = k2;
          Object.defineProperty(o, k22, { enumerable: true, get: function() {
            return m[k2];
          } });
        }) : (function(o, m, k2, k22) {
          if (k22 === void 0) k22 = k2;
          o[k22] = m[k2];
        }));
        var __setModuleDefault2 = lib$2 && lib$2.__setModuleDefault || (Object.create ? (function(o, v) {
          Object.defineProperty(o, "default", { enumerable: true, value: v });
        }) : function(o, v) {
          o["default"] = v;
        });
        var __importStar2 = lib$2 && lib$2.__importStar || function(mod2) {
          if (mod2 && mod2.__esModule) return mod2;
          var result2 = {};
          if (mod2 != null) {
            for (var k2 in mod2) if (k2 !== "default" && Object.prototype.hasOwnProperty.call(mod2, k2)) __createBinding2(result2, mod2, k2);
          }
          __setModuleDefault2(result2, mod2);
          return result2;
        };
        var __exportStar2 = lib$2 && lib$2.__exportStar || function(m, exports3) {
          for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p)) __createBinding2(exports3, m, p);
        };
        var __importDefault2 = lib$2 && lib$2.__importDefault || function(mod2) {
          return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
        };
        Object.defineProperty(exports2, "__esModule", { value: true });
        exports2.RssHandler = exports2.DefaultHandler = exports2.DomUtils = exports2.ElementType = exports2.Tokenizer = exports2.createDomStream = exports2.parseDOM = exports2.parseDocument = exports2.DomHandler = exports2.Parser = void 0;
        var Parser_1 = /* @__PURE__ */ requireParser$3();
        Object.defineProperty(exports2, "Parser", { enumerable: true, get: function() {
          return Parser_1.Parser;
        } });
        var domhandler_1 = /* @__PURE__ */ requireLib$a();
        Object.defineProperty(exports2, "DomHandler", { enumerable: true, get: function() {
          return domhandler_1.DomHandler;
        } });
        Object.defineProperty(exports2, "DefaultHandler", { enumerable: true, get: function() {
          return domhandler_1.DomHandler;
        } });
        function parseDocument(data, options2) {
          var handler = new domhandler_1.DomHandler(void 0, options2);
          new Parser_1.Parser(handler, options2).end(data);
          return handler.root;
        }
        exports2.parseDocument = parseDocument;
        function parseDOM(data, options2) {
          return parseDocument(data, options2).children;
        }
        exports2.parseDOM = parseDOM;
        function createDomStream(cb, options2, elementCb) {
          var handler = new domhandler_1.DomHandler(cb, options2, elementCb);
          return new Parser_1.Parser(handler, options2);
        }
        exports2.createDomStream = createDomStream;
        var Tokenizer_1 = /* @__PURE__ */ requireTokenizer$1();
        Object.defineProperty(exports2, "Tokenizer", { enumerable: true, get: function() {
          return __importDefault2(Tokenizer_1).default;
        } });
        var ElementType = __importStar2(/* @__PURE__ */ requireLib$b());
        exports2.ElementType = ElementType;
        __exportStar2(/* @__PURE__ */ requireFeedHandler(), exports2);
        exports2.DomUtils = __importStar2(/* @__PURE__ */ requireLib$7());
        var FeedHandler_1 = /* @__PURE__ */ requireFeedHandler();
        Object.defineProperty(exports2, "RssHandler", { enumerable: true, get: function() {
          return FeedHandler_1.FeedHandler;
        } });
      })(lib$2);
      return lib$2;
    }
    var parse5Adapter = {};
    var lib$1 = {};
    var unicode = {};
    var hasRequiredUnicode;
    function requireUnicode() {
      if (hasRequiredUnicode) return unicode;
      hasRequiredUnicode = 1;
      const UNDEFINED_CODE_POINTS = [
        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
      ];
      unicode.REPLACEMENT_CHARACTER = "�";
      unicode.CODE_POINTS = {
        EOF: -1,
        NULL: 0,
        TABULATION: 9,
        CARRIAGE_RETURN: 13,
        LINE_FEED: 10,
        FORM_FEED: 12,
        SPACE: 32,
        EXCLAMATION_MARK: 33,
        QUOTATION_MARK: 34,
        NUMBER_SIGN: 35,
        AMPERSAND: 38,
        APOSTROPHE: 39,
        HYPHEN_MINUS: 45,
        SOLIDUS: 47,
        DIGIT_0: 48,
        DIGIT_9: 57,
        SEMICOLON: 59,
        LESS_THAN_SIGN: 60,
        EQUALS_SIGN: 61,
        GREATER_THAN_SIGN: 62,
        QUESTION_MARK: 63,
        LATIN_CAPITAL_A: 65,
        LATIN_CAPITAL_F: 70,
        LATIN_CAPITAL_X: 88,
        LATIN_CAPITAL_Z: 90,
        RIGHT_SQUARE_BRACKET: 93,
        GRAVE_ACCENT: 96,
        LATIN_SMALL_A: 97,
        LATIN_SMALL_F: 102,
        LATIN_SMALL_X: 120,
        LATIN_SMALL_Z: 122,
        REPLACEMENT_CHARACTER: 65533
      };
      unicode.CODE_POINT_SEQUENCES = {
        DASH_DASH_STRING: [45, 45],
        //--
        DOCTYPE_STRING: [68, 79, 67, 84, 89, 80, 69],
        //DOCTYPE
        CDATA_START_STRING: [91, 67, 68, 65, 84, 65, 91],
        //[CDATA[
        SCRIPT_STRING: [115, 99, 114, 105, 112, 116],
        //script
        PUBLIC_STRING: [80, 85, 66, 76, 73, 67],
        //PUBLIC
        SYSTEM_STRING: [83, 89, 83, 84, 69, 77]
        //SYSTEM
      };
      unicode.isSurrogate = function(cp) {
        return cp >= 55296 && cp <= 57343;
      };
      unicode.isSurrogatePair = function(cp) {
        return cp >= 56320 && cp <= 57343;
      };
      unicode.getSurrogatePairCodePoint = function(cp1, cp2) {
        return (cp1 - 55296) * 1024 + 9216 + cp2;
      };
      unicode.isControlCodePoint = function(cp) {
        return cp !== 32 && cp !== 10 && cp !== 13 && cp !== 9 && cp !== 12 && cp >= 1 && cp <= 31 || cp >= 127 && cp <= 159;
      };
      unicode.isUndefinedCodePoint = function(cp) {
        return cp >= 64976 && cp <= 65007 || UNDEFINED_CODE_POINTS.indexOf(cp) > -1;
      };
      return unicode;
    }
    var errorCodes;
    var hasRequiredErrorCodes;
    function requireErrorCodes() {
      if (hasRequiredErrorCodes) return errorCodes;
      hasRequiredErrorCodes = 1;
      errorCodes = {
        controlCharacterInInputStream: "control-character-in-input-stream",
        noncharacterInInputStream: "noncharacter-in-input-stream",
        surrogateInInputStream: "surrogate-in-input-stream",
        nonVoidHtmlElementStartTagWithTrailingSolidus: "non-void-html-element-start-tag-with-trailing-solidus",
        endTagWithAttributes: "end-tag-with-attributes",
        endTagWithTrailingSolidus: "end-tag-with-trailing-solidus",
        unexpectedSolidusInTag: "unexpected-solidus-in-tag",
        unexpectedNullCharacter: "unexpected-null-character",
        unexpectedQuestionMarkInsteadOfTagName: "unexpected-question-mark-instead-of-tag-name",
        invalidFirstCharacterOfTagName: "invalid-first-character-of-tag-name",
        unexpectedEqualsSignBeforeAttributeName: "unexpected-equals-sign-before-attribute-name",
        missingEndTagName: "missing-end-tag-name",
        unexpectedCharacterInAttributeName: "unexpected-character-in-attribute-name",
        unknownNamedCharacterReference: "unknown-named-character-reference",
        missingSemicolonAfterCharacterReference: "missing-semicolon-after-character-reference",
        unexpectedCharacterAfterDoctypeSystemIdentifier: "unexpected-character-after-doctype-system-identifier",
        unexpectedCharacterInUnquotedAttributeValue: "unexpected-character-in-unquoted-attribute-value",
        eofBeforeTagName: "eof-before-tag-name",
        eofInTag: "eof-in-tag",
        missingAttributeValue: "missing-attribute-value",
        missingWhitespaceBetweenAttributes: "missing-whitespace-between-attributes",
        missingWhitespaceAfterDoctypePublicKeyword: "missing-whitespace-after-doctype-public-keyword",
        missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers: "missing-whitespace-between-doctype-public-and-system-identifiers",
        missingWhitespaceAfterDoctypeSystemKeyword: "missing-whitespace-after-doctype-system-keyword",
        missingQuoteBeforeDoctypePublicIdentifier: "missing-quote-before-doctype-public-identifier",
        missingQuoteBeforeDoctypeSystemIdentifier: "missing-quote-before-doctype-system-identifier",
        missingDoctypePublicIdentifier: "missing-doctype-public-identifier",
        missingDoctypeSystemIdentifier: "missing-doctype-system-identifier",
        abruptDoctypePublicIdentifier: "abrupt-doctype-public-identifier",
        abruptDoctypeSystemIdentifier: "abrupt-doctype-system-identifier",
        cdataInHtmlContent: "cdata-in-html-content",
        incorrectlyOpenedComment: "incorrectly-opened-comment",
        eofInScriptHtmlCommentLikeText: "eof-in-script-html-comment-like-text",
        eofInDoctype: "eof-in-doctype",
        nestedComment: "nested-comment",
        abruptClosingOfEmptyComment: "abrupt-closing-of-empty-comment",
        eofInComment: "eof-in-comment",
        incorrectlyClosedComment: "incorrectly-closed-comment",
        eofInCdata: "eof-in-cdata",
        absenceOfDigitsInNumericCharacterReference: "absence-of-digits-in-numeric-character-reference",
        nullCharacterReference: "null-character-reference",
        surrogateCharacterReference: "surrogate-character-reference",
        characterReferenceOutsideUnicodeRange: "character-reference-outside-unicode-range",
        controlCharacterReference: "control-character-reference",
        noncharacterCharacterReference: "noncharacter-character-reference",
        missingWhitespaceBeforeDoctypeName: "missing-whitespace-before-doctype-name",
        missingDoctypeName: "missing-doctype-name",
        invalidCharacterSequenceAfterDoctypeName: "invalid-character-sequence-after-doctype-name",
        duplicateAttribute: "duplicate-attribute",
        nonConformingDoctype: "non-conforming-doctype",
        missingDoctype: "missing-doctype",
        misplacedDoctype: "misplaced-doctype",
        endTagWithoutMatchingOpenElement: "end-tag-without-matching-open-element",
        closingOfElementWithOpenChildElements: "closing-of-element-with-open-child-elements",
        disallowedContentInNoscriptInHead: "disallowed-content-in-noscript-in-head",
        openElementsLeftAfterEof: "open-elements-left-after-eof",
        abandonedHeadElementChild: "abandoned-head-element-child",
        misplacedStartTagForHeadElement: "misplaced-start-tag-for-head-element",
        nestedNoscriptInHead: "nested-noscript-in-head",
        eofInElementThatCanContainOnlyText: "eof-in-element-that-can-contain-only-text"
      };
      return errorCodes;
    }
    var preprocessor;
    var hasRequiredPreprocessor;
    function requirePreprocessor() {
      if (hasRequiredPreprocessor) return preprocessor;
      hasRequiredPreprocessor = 1;
      const unicode2 = requireUnicode();
      const ERR = requireErrorCodes();
      const $2 = unicode2.CODE_POINTS;
      const DEFAULT_BUFFER_WATERLINE = 1 << 16;
      class Preprocessor {
        constructor() {
          this.html = null;
          this.pos = -1;
          this.lastGapPos = -1;
          this.lastCharPos = -1;
          this.gapStack = [];
          this.skipNextNewLine = false;
          this.lastChunkWritten = false;
          this.endOfChunkHit = false;
          this.bufferWaterline = DEFAULT_BUFFER_WATERLINE;
        }
        _err() {
        }
        _addGap() {
          this.gapStack.push(this.lastGapPos);
          this.lastGapPos = this.pos;
        }
        _processSurrogate(cp) {
          if (this.pos !== this.lastCharPos) {
            const nextCp = this.html.charCodeAt(this.pos + 1);
            if (unicode2.isSurrogatePair(nextCp)) {
              this.pos++;
              this._addGap();
              return unicode2.getSurrogatePairCodePoint(cp, nextCp);
            }
          } else if (!this.lastChunkWritten) {
            this.endOfChunkHit = true;
            return $2.EOF;
          }
          this._err(ERR.surrogateInInputStream);
          return cp;
        }
        dropParsedChunk() {
          if (this.pos > this.bufferWaterline) {
            this.lastCharPos -= this.pos;
            this.html = this.html.substring(this.pos);
            this.pos = 0;
            this.lastGapPos = -1;
            this.gapStack = [];
          }
        }
        write(chunk, isLastChunk) {
          if (this.html) {
            this.html += chunk;
          } else {
            this.html = chunk;
          }
          this.lastCharPos = this.html.length - 1;
          this.endOfChunkHit = false;
          this.lastChunkWritten = isLastChunk;
        }
        insertHtmlAtCurrentPos(chunk) {
          this.html = this.html.substring(0, this.pos + 1) + chunk + this.html.substring(this.pos + 1, this.html.length);
          this.lastCharPos = this.html.length - 1;
          this.endOfChunkHit = false;
        }
        advance() {
          this.pos++;
          if (this.pos > this.lastCharPos) {
            this.endOfChunkHit = !this.lastChunkWritten;
            return $2.EOF;
          }
          let cp = this.html.charCodeAt(this.pos);
          if (this.skipNextNewLine && cp === $2.LINE_FEED) {
            this.skipNextNewLine = false;
            this._addGap();
            return this.advance();
          }
          if (cp === $2.CARRIAGE_RETURN) {
            this.skipNextNewLine = true;
            return $2.LINE_FEED;
          }
          this.skipNextNewLine = false;
          if (unicode2.isSurrogate(cp)) {
            cp = this._processSurrogate(cp);
          }
          const isCommonValidRange = cp > 31 && cp < 127 || cp === $2.LINE_FEED || cp === $2.CARRIAGE_RETURN || cp > 159 && cp < 64976;
          if (!isCommonValidRange) {
            this._checkForProblematicCharacters(cp);
          }
          return cp;
        }
        _checkForProblematicCharacters(cp) {
          if (unicode2.isControlCodePoint(cp)) {
            this._err(ERR.controlCharacterInInputStream);
          } else if (unicode2.isUndefinedCodePoint(cp)) {
            this._err(ERR.noncharacterInInputStream);
          }
        }
        retreat() {
          if (this.pos === this.lastGapPos) {
            this.lastGapPos = this.gapStack.pop();
            this.pos--;
          }
          this.pos--;
        }
      }
      preprocessor = Preprocessor;
      return preprocessor;
    }
    var namedEntityData;
    var hasRequiredNamedEntityData;
    function requireNamedEntityData() {
      if (hasRequiredNamedEntityData) return namedEntityData;
      hasRequiredNamedEntityData = 1;
      namedEntityData = new Uint16Array([4, 52, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 106, 303, 412, 810, 1432, 1701, 1796, 1987, 2114, 2360, 2420, 2484, 3170, 3251, 4140, 4393, 4575, 4610, 5106, 5512, 5728, 6117, 6274, 6315, 6345, 6427, 6516, 7002, 7910, 8733, 9323, 9870, 10170, 10631, 10893, 11318, 11386, 11467, 12773, 13092, 14474, 14922, 15448, 15542, 16419, 17666, 18166, 18611, 19004, 19095, 19298, 19397, 4, 16, 69, 77, 97, 98, 99, 102, 103, 108, 109, 110, 111, 112, 114, 115, 116, 117, 140, 150, 158, 169, 176, 194, 199, 210, 216, 222, 226, 242, 256, 266, 283, 294, 108, 105, 103, 5, 198, 1, 59, 148, 1, 198, 80, 5, 38, 1, 59, 156, 1, 38, 99, 117, 116, 101, 5, 193, 1, 59, 167, 1, 193, 114, 101, 118, 101, 59, 1, 258, 4, 2, 105, 121, 182, 191, 114, 99, 5, 194, 1, 59, 189, 1, 194, 59, 1, 1040, 114, 59, 3, 55349, 56580, 114, 97, 118, 101, 5, 192, 1, 59, 208, 1, 192, 112, 104, 97, 59, 1, 913, 97, 99, 114, 59, 1, 256, 100, 59, 1, 10835, 4, 2, 103, 112, 232, 237, 111, 110, 59, 1, 260, 102, 59, 3, 55349, 56632, 112, 108, 121, 70, 117, 110, 99, 116, 105, 111, 110, 59, 1, 8289, 105, 110, 103, 5, 197, 1, 59, 264, 1, 197, 4, 2, 99, 115, 272, 277, 114, 59, 3, 55349, 56476, 105, 103, 110, 59, 1, 8788, 105, 108, 100, 101, 5, 195, 1, 59, 292, 1, 195, 109, 108, 5, 196, 1, 59, 301, 1, 196, 4, 8, 97, 99, 101, 102, 111, 114, 115, 117, 321, 350, 354, 383, 388, 394, 400, 405, 4, 2, 99, 114, 327, 336, 107, 115, 108, 97, 115, 104, 59, 1, 8726, 4, 2, 118, 119, 342, 345, 59, 1, 10983, 101, 100, 59, 1, 8966, 121, 59, 1, 1041, 4, 3, 99, 114, 116, 362, 369, 379, 97, 117, 115, 101, 59, 1, 8757, 110, 111, 117, 108, 108, 105, 115, 59, 1, 8492, 97, 59, 1, 914, 114, 59, 3, 55349, 56581, 112, 102, 59, 3, 55349, 56633, 101, 118, 101, 59, 1, 728, 99, 114, 59, 1, 8492, 109, 112, 101, 113, 59, 1, 8782, 4, 14, 72, 79, 97, 99, 100, 101, 102, 104, 105, 108, 111, 114, 115, 117, 442, 447, 456, 504, 542, 547, 569, 573, 577, 616, 678, 784, 790, 796, 99, 121, 59, 1, 1063, 80, 89, 5, 169, 1, 59, 454, 1, 169, 4, 3, 99, 112, 121, 464, 470, 497, 117, 116, 101, 59, 1, 262, 4, 2, 59, 105, 476, 478, 1, 8914, 116, 97, 108, 68, 105, 102, 102, 101, 114, 101, 110, 116, 105, 97, 108, 68, 59, 1, 8517, 108, 101, 121, 115, 59, 1, 8493, 4, 4, 97, 101, 105, 111, 514, 520, 530, 535, 114, 111, 110, 59, 1, 268, 100, 105, 108, 5, 199, 1, 59, 528, 1, 199, 114, 99, 59, 1, 264, 110, 105, 110, 116, 59, 1, 8752, 111, 116, 59, 1, 266, 4, 2, 100, 110, 553, 560, 105, 108, 108, 97, 59, 1, 184, 116, 101, 114, 68, 111, 116, 59, 1, 183, 114, 59, 1, 8493, 105, 59, 1, 935, 114, 99, 108, 101, 4, 4, 68, 77, 80, 84, 591, 596, 603, 609, 111, 116, 59, 1, 8857, 105, 110, 117, 115, 59, 1, 8854, 108, 117, 115, 59, 1, 8853, 105, 109, 101, 115, 59, 1, 8855, 111, 4, 2, 99, 115, 623, 646, 107, 119, 105, 115, 101, 67, 111, 110, 116, 111, 117, 114, 73, 110, 116, 101, 103, 114, 97, 108, 59, 1, 8754, 101, 67, 117, 114, 108, 121, 4, 2, 68, 81, 658, 671, 111, 117, 98, 108, 101, 81, 117, 111, 116, 101, 59, 1, 8221, 117, 111, 116, 101, 59, 1, 8217, 4, 4, 108, 110, 112, 117, 688, 701, 736, 753, 111, 110, 4, 2, 59, 101, 696, 698, 1, 8759, 59, 1, 10868, 4, 3, 103, 105, 116, 709, 717, 722, 114, 117, 101, 110, 116, 59, 1, 8801, 110, 116, 59, 1, 8751, 111, 117, 114, 73, 110, 116, 101, 103, 114, 97, 108, 59, 1, 8750, 4, 2, 102, 114, 742, 745, 59, 1, 8450, 111, 100, 117, 99, 116, 59, 1, 8720, 110, 116, 101, 114, 67, 108, 111, 99, 107, 119, 105, 115, 101, 67, 111, 110, 116, 111, 117, 114, 73, 110, 116, 101, 103, 114, 97, 108, 59, 1, 8755, 111, 115, 115, 59, 1, 10799, 99, 114, 59, 3, 55349, 56478, 112, 4, 2, 59, 67, 803, 805, 1, 8915, 97, 112, 59, 1, 8781, 4, 11, 68, 74, 83, 90, 97, 99, 101, 102, 105, 111, 115, 834, 850, 855, 860, 865, 888, 903, 916, 921, 1011, 1415, 4, 2, 59, 111, 840, 842, 1, 8517, 116, 114, 97, 104, 100, 59, 1, 10513, 99, 121, 59, 1, 1026, 99, 121, 59, 1, 1029, 99, 121, 59, 1, 1039, 4, 3, 103, 114, 115, 873, 879, 883, 103, 101, 114, 59, 1, 8225, 114, 59, 1, 8609, 104, 118, 59, 1, 10980, 4, 2, 97, 121, 894, 900, 114, 111, 110, 59, 1, 270, 59, 1, 1044, 108, 4, 2, 59, 116, 910, 912, 1, 8711, 97, 59, 1, 916, 114, 59, 3, 55349, 56583, 4, 2, 97, 102, 927, 998, 4, 2, 99, 109, 933, 992, 114, 105, 116, 105, 99, 97, 108, 4, 4, 65, 68, 71, 84, 950, 957, 978, 985, 99, 117, 116, 101, 59, 1, 180, 111, 4, 2, 116, 117, 964, 967, 59, 1, 729, 98, 108, 101, 65, 99, 117, 116, 101, 59, 1, 733, 114, 97, 118, 101, 59, 1, 96, 105, 108, 100, 101, 59, 1, 732, 111, 110, 100, 59, 1, 8900, 102, 101, 114, 101, 110, 116, 105, 97, 108, 68, 59, 1, 8518, 4, 4, 112, 116, 117, 119, 1021, 1026, 1048, 1249, 102, 59, 3, 55349, 56635, 4, 3, 59, 68, 69, 1034, 1036, 1041, 1, 168, 111, 116, 59, 1, 8412, 113, 117, 97, 108, 59, 1, 8784, 98, 108, 101, 4, 6, 67, 68, 76, 82, 85, 86, 1065, 1082, 1101, 1189, 1211, 1236, 111, 110, 116, 111, 117, 114, 73, 110, 116, 101, 103, 114, 97, 108, 59, 1, 8751, 111, 4, 2, 116, 119, 1089, 1092, 59, 1, 168, 110, 65, 114, 114, 111, 119, 59, 1, 8659, 4, 2, 101, 111, 1107, 1141, 102, 116, 4, 3, 65, 82, 84, 1117, 1124, 1136, 114, 114, 111, 119, 59, 1, 8656, 105, 103, 104, 116, 65, 114, 114, 111, 119, 59, 1, 8660, 101, 101, 59, 1, 10980, 110, 103, 4, 2, 76, 82, 1149, 1177, 101, 102, 116, 4, 2, 65, 82, 1158, 1165, 114, 114, 111, 119, 59, 1, 10232, 105, 103, 104, 116, 65, 114, 114, 111, 119, 59, 1, 10234, 105, 103, 104, 116, 65, 114, 114, 111, 119, 59, 1, 10233, 105, 103, 104, 116, 4, 2, 65, 84, 1199, 1206, 114, 114, 111, 119, 59, 1, 8658, 101, 101, 59, 1, 8872, 112, 4, 2, 65, 68, 1218, 1225, 114, 114, 111, 119, 59, 1, 8657, 111, 119, 110, 65, 114, 114, 111, 119, 59, 1, 8661, 101, 114, 116, 105, 99, 97, 108, 66, 97, 114, 59, 1, 8741, 110, 4, 6, 65, 66, 76, 82, 84, 97, 1264, 1292, 1299, 1352, 1391, 1408, 114, 114, 111, 119, 4, 3, 59, 66, 85, 1276, 1278, 1283, 1, 8595, 97, 114, 59, 1, 10515, 112, 65, 114, 114, 111, 119, 59, 1, 8693, 114, 101, 118, 101, 59, 1, 785, 101, 102, 116, 4, 3, 82, 84, 86, 1310, 1323, 1334, 105, 103, 104, 116, 86, 101, 99, 116, 111, 114, 59, 1, 10576, 101, 101, 86, 101, 99, 116, 111, 114, 59, 1, 10590, 101, 99, 116, 111, 114, 4, 2, 59, 66, 1345, 1347, 1, 8637, 97, 114, 59, 1, 10582, 105, 103, 104, 116, 4, 2, 84, 86, 1362, 1373, 101, 101, 86, 101, 99, 116, 111, 114, 59, 1, 10591, 101, 99, 116, 111, 114, 4, 2, 59, 66, 1384, 1386, 1, 8641, 97, 114, 59, 1, 10583, 101, 101, 4, 2, 59, 65, 1399, 1401, 1, 8868, 114, 114, 111, 119, 59, 1, 8615, 114, 114, 111, 119, 59, 1, 8659, 4, 2, 99, 116, 1421, 1426, 114, 59, 3, 55349, 56479, 114, 111, 107, 59, 1, 272, 4, 16, 78, 84, 97, 99, 100, 102, 103, 108, 109, 111, 112, 113, 115, 116, 117, 120, 1466, 1470, 1478, 1489, 1515, 1520, 1525, 1536, 1544, 1593, 1609, 1617, 1650, 1664, 1668, 1677, 71, 59, 1, 330, 72, 5, 208, 1, 59, 1476, 1, 208, 99, 117, 116, 101, 5, 201, 1, 59, 1487, 1, 201, 4, 3, 97, 105, 121, 1497, 1503, 1512, 114, 111, 110, 59, 1, 282, 114, 99, 5, 202, 1, 59, 1510, 1, 202, 59, 1, 1069, 111, 116, 59, 1, 278, 114, 59, 3, 55349, 56584, 114, 97, 118, 101, 5, 200, 1, 59, 1534, 1, 200, 101, 109, 101, 110, 116, 59, 1, 8712, 4, 2, 97, 112, 1550, 1555, 99, 114, 59, 1, 274, 116, 121, 4, 2, 83, 86, 1563, 1576, 109, 97, 108, 108, 83, 113, 117, 97, 114, 101, 59, 1, 9723, 101, 114, 121, 83, 109, 97, 108, 108, 83, 113, 117, 97, 114, 101, 59, 1, 9643, 4, 2, 103, 112, 1599, 1604, 111, 110, 59, 1, 280, 102, 59, 3, 55349, 56636, 115, 105, 108, 111, 110, 59, 1, 917, 117, 4, 2, 97, 105, 1624, 1640, 108, 4, 2, 59, 84, 1631, 1633, 1, 10869, 105, 108, 100, 101, 59, 1, 8770, 108, 105, 98, 114, 105, 117, 109, 59, 1, 8652, 4, 2, 99, 105, 1656, 1660, 114, 59, 1, 8496, 109, 59, 1, 10867, 97, 59, 1, 919, 109, 108, 5, 203, 1, 59, 1675, 1, 203, 4, 2, 105, 112, 1683, 1689, 115, 116, 115, 59, 1, 8707, 111, 110, 101, 110, 116, 105, 97, 108, 69, 59, 1, 8519, 4, 5, 99, 102, 105, 111, 115, 1713, 1717, 1722, 1762, 1791, 121, 59, 1, 1060, 114, 59, 3, 55349, 56585, 108, 108, 101, 100, 4, 2, 83, 86, 1732, 1745, 109, 97, 108, 108, 83, 113, 117, 97, 114, 101, 59, 1, 9724, 101, 114, 121, 83, 109, 97, 108, 108, 83, 113, 117, 97, 114, 101, 59, 1, 9642, 4, 3, 112, 114, 117, 1770, 1775, 1781, 102, 59, 3, 55349, 56637, 65, 108, 108, 59, 1, 8704, 114, 105, 101, 114, 116, 114, 102, 59, 1, 8497, 99, 114, 59, 1, 8497, 4, 12, 74, 84, 97, 98, 99, 100, 102, 103, 111, 114, 115, 116, 1822, 1827, 1834, 1848, 1855, 1877, 1882, 1887, 1890, 1896, 1978, 1984, 99, 121, 59, 1, 1027, 5, 62, 1, 59, 1832, 1, 62, 109, 109, 97, 4, 2, 59, 100, 1843, 1845, 1, 915, 59, 1, 988, 114, 101, 118, 101, 59, 1, 286, 4, 3, 101, 105, 121, 1863, 1869, 1874, 100, 105, 108, 59, 1, 290, 114, 99, 59, 1, 284, 59, 1, 1043, 111, 116, 59, 1, 288, 114, 59, 3, 55349, 56586, 59, 1, 8921, 112, 102, 59, 3, 55349, 56638, 101, 97, 116, 101, 114, 4, 6, 69, 70, 71, 76, 83, 84, 1915, 1933, 1944, 1953, 1959, 1971, 113, 117, 97, 108, 4, 2, 59, 76, 1925, 1927, 1, 8805, 101, 115, 115, 59, 1, 8923, 117, 108, 108, 69, 113, 117, 97, 108, 59, 1, 8807, 114, 101, 97, 116, 101, 114, 59, 1, 10914, 101, 115, 115, 59, 1, 8823, 108, 97, 110, 116, 69, 113, 117, 97, 108, 59, 1, 10878, 105, 108, 100, 101, 59, 1, 8819, 99, 114, 59, 3, 55349, 56482, 59, 1, 8811, 4, 8, 65, 97, 99, 102, 105, 111, 115, 117, 2005, 2012, 2026, 2032, 2036, 2049, 2073, 2089, 82, 68, 99, 121, 59, 1, 1066, 4, 2, 99, 116, 2018, 2023, 101, 107, 59, 1, 711, 59, 1, 94, 105, 114, 99, 59, 1, 292, 114, 59, 1, 8460, 108, 98, 101, 114, 116, 83, 112, 97, 99, 101, 59, 1, 8459, 4, 2, 112, 114, 2055, 2059, 102, 59, 1, 8461, 105, 122, 111, 110, 116, 97, 108, 76, 105, 110, 101, 59, 1, 9472, 4, 2, 99, 116, 2079, 2083, 114, 59, 1, 8459, 114, 111, 107, 59, 1, 294, 109, 112, 4, 2, 68, 69, 2097, 2107, 111, 119, 110, 72, 117, 109, 112, 59, 1, 8782, 113, 117, 97, 108, 59, 1, 8783, 4, 14, 69, 74, 79, 97, 99, 100, 102, 103, 109, 110, 111, 115, 116, 117, 2144, 2149, 2155, 2160, 2171, 2189, 2194, 2198, 2209, 2245, 2307, 2329, 2334, 2341, 99, 121, 59, 1, 1045, 108, 105, 103, 59, 1, 306, 99, 121, 59, 1, 1025, 99, 117, 116, 101, 5, 205, 1, 59, 2169, 1, 205, 4, 2, 105, 121, 2177, 2186, 114, 99, 5, 206, 1, 59, 2184, 1, 206, 59, 1, 1048, 111, 116, 59, 1, 304, 114, 59, 1, 8465, 114, 97, 118, 101, 5, 204, 1, 59, 2207, 1, 204, 4, 3, 59, 97, 112, 2217, 2219, 2238, 1, 8465, 4, 2, 99, 103, 2225, 2229, 114, 59, 1, 298, 105, 110, 97, 114, 121, 73, 59, 1, 8520, 108, 105, 101, 115, 59, 1, 8658, 4, 2, 116, 118, 2251, 2281, 4, 2, 59, 101, 2257, 2259, 1, 8748, 4, 2, 103, 114, 2265, 2271, 114, 97, 108, 59, 1, 8747, 115, 101, 99, 116, 105, 111, 110, 59, 1, 8898, 105, 115, 105, 98, 108, 101, 4, 2, 67, 84, 2293, 2300, 111, 109, 109, 97, 59, 1, 8291, 105, 109, 101, 115, 59, 1, 8290, 4, 3, 103, 112, 116, 2315, 2320, 2325, 111, 110, 59, 1, 302, 102, 59, 3, 55349, 56640, 97, 59, 1, 921, 99, 114, 59, 1, 8464, 105, 108, 100, 101, 59, 1, 296, 4, 2, 107, 109, 2347, 2352, 99, 121, 59, 1, 1030, 108, 5, 207, 1, 59, 2358, 1, 207, 4, 5, 99, 102, 111, 115, 117, 2372, 2386, 2391, 2397, 2414, 4, 2, 105, 121, 2378, 2383, 114, 99, 59, 1, 308, 59, 1, 1049, 114, 59, 3, 55349, 56589, 112, 102, 59, 3, 55349, 56641, 4, 2, 99, 101, 2403, 2408, 114, 59, 3, 55349, 56485, 114, 99, 121, 59, 1, 1032, 107, 99, 121, 59, 1, 1028, 4, 7, 72, 74, 97, 99, 102, 111, 115, 2436, 2441, 2446, 2452, 2467, 2472, 2478, 99, 121, 59, 1, 1061, 99, 121, 59, 1, 1036, 112, 112, 97, 59, 1, 922, 4, 2, 101, 121, 2458, 2464, 100, 105, 108, 59, 1, 310, 59, 1, 1050, 114, 59, 3, 55349, 56590, 112, 102, 59, 3, 55349, 56642, 99, 114, 59, 3, 55349, 56486, 4, 11, 74, 84, 97, 99, 101, 102, 108, 109, 111, 115, 116, 2508, 2513, 2520, 2562, 2585, 2981, 2986, 3004, 3011, 3146, 3167, 99, 121, 59, 1, 1033, 5, 60, 1, 59, 2518, 1, 60, 4, 5, 99, 109, 110, 112, 114, 2532, 2538, 2544, 2548, 2558, 117, 116, 101, 59, 1, 313, 98, 100, 97, 59, 1, 923, 103, 59, 1, 10218, 108, 97, 99, 101, 116, 114, 102, 59, 1, 8466, 114, 59, 1, 8606, 4, 3, 97, 101, 121, 2570, 2576, 2582, 114, 111, 110, 59, 1, 317, 100, 105, 108, 59, 1, 315, 59, 1, 1051, 4, 2, 102, 115, 2591, 2907, 116, 4, 10, 65, 67, 68, 70, 82, 84, 85, 86, 97, 114, 2614, 2663, 2672, 2728, 2735, 2760, 2820, 2870, 2888, 2895, 4, 2, 110, 114, 2620, 2633, 103, 108, 101, 66, 114, 97, 99, 107, 101, 116, 59, 1, 10216, 114, 111, 119, 4, 3, 59, 66, 82, 2644, 2646, 2651, 1, 8592, 97, 114, 59, 1, 8676, 105, 103, 104, 116, 65, 114, 114, 111, 119, 59, 1, 8646, 101, 105, 108, 105, 110, 103, 59, 1, 8968, 111, 4, 2, 117, 119, 2679, 2692, 98, 108, 101, 66, 114, 97, 99, 107, 101, 116, 59, 1, 10214, 110, 4, 2, 84, 86, 2699, 2710, 101, 101, 86, 101, 99, 116, 111, 114, 59, 1, 10593, 101, 99, 116, 111, 114, 4, 2, 59, 66, 2721, 2723, 1, 8643, 97, 114, 59, 1, 10585, 108, 111, 111, 114, 59, 1, 8970, 105, 103, 104, 116, 4, 2, 65, 86, 2745, 2752, 114, 114, 111, 119, 59, 1, 8596, 101, 99, 116, 111, 114, 59, 1, 10574, 4, 2, 101, 114, 2766, 2792, 101, 4, 3, 59, 65, 86, 2775, 2777, 2784, 1, 8867, 114, 114, 111, 119, 59, 1, 8612, 101, 99, 116, 111, 114, 59, 1, 10586, 105, 97, 110, 103, 108, 101, 4, 3, 59, 66, 69, 2806, 2808, 2813, 1, 8882, 97, 114, 59, 1, 10703, 113, 117, 97, 108, 59, 1, 8884, 112, 4, 3, 68, 84, 86, 2829, 2841, 2852, 111, 119, 110, 86, 101, 99, 116, 111, 114, 59, 1, 10577, 101, 101, 86, 101, 99, 116, 111, 114, 59, 1, 10592, 101, 99, 116, 111, 114, 4, 2, 59, 66, 2863, 2865, 1, 8639, 97, 114, 59, 1, 10584, 101, 99, 116, 111, 114, 4, 2, 59, 66, 2881, 2883, 1, 8636, 97, 114, 59, 1, 10578, 114, 114, 111, 119, 59, 1, 8656, 105, 103, 104, 116, 97, 114, 114, 111, 119, 59, 1, 8660, 115, 4, 6, 69, 70, 71, 76, 83, 84, 2922, 2936, 2947, 2956, 2962, 2974, 113, 117, 97, 108, 71, 114, 101, 97, 116, 101, 114, 59, 1, 8922, 117, 108, 108, 69, 113, 117, 97, 108, 59, 1, 8806, 114, 101, 97, 116, 101, 114, 59, 1, 8822, 101, 115, 115, 59, 1, 10913, 108, 97, 110, 116, 69, 113, 117, 97, 108, 59, 1, 10877, 105, 108, 100, 101, 59, 1, 8818, 114, 59, 3, 55349, 56591, 4, 2, 59, 101, 2992, 2994, 1, 8920, 102, 116, 97, 114, 114, 111, 119, 59, 1, 8666, 105, 100, 111, 116, 59, 1, 319, 4, 3, 110, 112, 119, 3019, 3110, 3115, 103, 4, 4, 76, 82, 108, 114, 3030, 3058, 3070, 3098, 101, 102, 116, 4, 2, 65, 82, 3039, 3046, 114, 114, 111, 119, 59, 1, 10229, 105, 103, 104, 116, 65, 114, 114, 111, 119, 59, 1, 10231, 105, 103, 104, 116, 65, 114, 114, 111, 119, 59, 1, 10230, 101, 102, 116, 4, 2, 97, 114, 3079, 3086, 114, 114, 111, 119, 59, 1, 10232, 105, 103, 104, 116, 97, 114, 114, 111, 119, 59, 1, 10234, 105, 103, 104, 116, 97, 114, 114, 111, 119, 59, 1, 10233, 102, 59, 3, 55349, 56643, 101, 114, 4, 2, 76, 82, 3123, 3134, 101, 102, 116, 65, 114, 114, 111, 119, 59, 1, 8601, 105, 103, 104, 116, 65, 114, 114, 111, 119, 59, 1, 8600, 4, 3, 99, 104, 116, 3154, 3158, 3161, 114, 59, 1, 8466, 59, 1, 8624, 114, 111, 107, 59, 1, 321, 59, 1, 8810, 4, 8, 97, 99, 101, 102, 105, 111, 115, 117, 3188, 3192, 3196, 3222, 3227, 3237, 3243, 3248, 112, 59, 1, 10501, 121, 59, 1, 1052, 4, 2, 100, 108, 3202, 3213, 105, 117, 109, 83, 112, 97, 99, 101, 59, 1, 8287, 108, 105, 110, 116, 114, 102, 59, 1, 8499, 114, 59, 3, 55349, 56592, 110, 117, 115, 80, 108, 117, 115, 59, 1, 8723, 112, 102, 59, 3, 55349, 56644, 99, 114, 59, 1, 8499, 59, 1, 924, 4, 9, 74, 97, 99, 101, 102, 111, 115, 116, 117, 3271, 3276, 3283, 3306, 3422, 3427, 4120, 4126, 4137, 99, 121, 59, 1, 1034, 99, 117, 116, 101, 59, 1, 323, 4, 3, 97, 101, 121, 3291, 3297, 3303, 114, 111, 110, 59, 1, 327, 100, 105, 108, 59, 1, 325, 59, 1, 1053, 4, 3, 103, 115, 119, 3314, 3380, 3415, 97, 116, 105, 118, 101, 4, 3, 77, 84, 86, 3327, 3340, 3365, 101, 100, 105, 117, 109, 83, 112, 97, 99, 101, 59, 1, 8203, 104, 105, 4, 2, 99, 110, 3348, 3357, 107, 83, 112, 97, 99, 101, 59, 1, 8203, 83, 112, 97, 99, 101, 59, 1, 8203, 101, 114, 121, 84, 104, 105, 110, 83, 112, 97, 99, 101, 59, 1, 8203, 116, 101, 100, 4, 2, 71, 76, 3389, 3405, 114, 101, 97, 116, 101, 114, 71, 114, 101, 97, 116, 101, 114, 59, 1, 8811, 101, 115, 115, 76, 101, 115, 115, 59, 1, 8810, 76, 105, 110, 101, 59, 1, 10, 114, 59, 3, 55349, 56593, 4, 4, 66, 110, 112, 116, 3437, 3444, 3460, 3464, 114, 101, 97, 107, 59, 1, 8288, 66, 114, 101, 97, 107, 105, 110, 103, 83, 112, 97, 99, 101, 59, 1, 160, 102, 59, 1, 8469, 4, 13, 59, 67, 68, 69, 71, 72, 76, 78, 80, 82, 83, 84, 86, 3492, 3494, 3517, 3536, 3578, 3657, 3685, 3784, 3823, 3860, 3915, 4066, 4107, 1, 10988, 4, 2, 111, 117, 3500, 3510, 110, 103, 114, 117, 101, 110, 116, 59, 1, 8802, 112, 67, 97, 112, 59, 1, 8813, 111, 117, 98, 108, 101, 86, 101, 114, 116, 105, 99, 97, 108, 66, 97, 114, 59, 1, 8742, 4, 3, 108, 113, 120, 3544, 3552, 3571, 101, 109, 101, 110, 116, 59, 1, 8713, 117, 97, 108, 4, 2, 59, 84, 3561, 3563, 1, 8800, 105, 108, 100, 101, 59, 3, 8770, 824, 105, 115, 116, 115, 59, 1, 8708, 114, 101, 97, 116, 101, 114, 4, 7, 59, 69, 70, 71, 76, 83, 84, 3600, 3602, 3609, 3621, 3631, 3637, 3650, 1, 8815, 113, 117, 97, 108, 59, 1, 8817, 117, 108, 108, 69, 113, 117, 97, 108, 59, 3, 8807, 824, 114, 101, 97, 116, 101, 114, 59, 3, 8811, 824, 101, 115, 115, 59, 1, 8825, 108, 97, 110, 116, 69, 113, 117, 97, 108, 59, 3, 10878, 824, 105, 108, 100, 101, 59, 1, 8821, 117, 109, 112, 4, 2, 68, 69, 3666, 3677, 111, 119, 110, 72, 117, 109, 112, 59, 3, 8782, 824, 113, 117, 97, 108, 59, 3, 8783, 824, 101, 4, 2, 102, 115, 3692, 3724, 116, 84, 114, 105, 97, 110, 103, 108, 101, 4, 3, 59, 66, 69, 3709, 3711, 3717, 1, 8938, 97, 114, 59, 3, 10703, 824, 113, 117, 97, 108, 59, 1, 8940, 115, 4, 6, 59, 69, 71, 76, 83, 84, 3739, 3741, 3748, 3757, 3764, 3777, 1, 8814, 113, 117, 97, 108, 59, 1, 8816, 114, 101, 97, 116, 101, 114, 59, 1, 8824, 101, 115, 115, 59, 3, 8810, 824, 108, 97, 110, 116, 69, 113, 117, 97, 108, 59, 3, 10877, 824, 105, 108, 100, 101, 59, 1, 8820, 101, 115, 116, 101, 100, 4, 2, 71, 76, 3795, 3812, 114, 101, 97, 116, 101, 114, 71, 114, 101, 97, 116, 101, 114, 59, 3, 10914, 824, 101, 115, 115, 76, 101, 115, 115, 59, 3, 10913, 824, 114, 101, 99, 101, 100, 101, 115, 4, 3, 59, 69, 83, 3838, 3840, 3848, 1, 8832, 113, 117, 97, 108, 59, 3, 10927, 824, 108, 97, 110, 116, 69, 113, 117, 97, 108, 59, 1, 8928, 4, 2, 101, 105, 3866, 3881, 118, 101, 114, 115, 101, 69, 108, 101, 109, 101, 110, 116, 59, 1, 8716, 103, 104, 116, 84, 114, 105, 97, 110, 103, 108, 101, 4, 3, 59, 66, 69, 3900, 3902, 3908, 1, 8939, 97, 114, 59, 3, 10704, 824, 113, 117, 97, 108, 59, 1, 8941, 4, 2, 113, 117, 3921, 3973, 117, 97, 114, 101, 83, 117, 4, 2, 98, 112, 3933, 3952, 115, 101, 116, 4, 2, 59, 69, 3942, 3945, 3, 8847, 824, 113, 117, 97, 108, 59, 1, 8930, 101, 114, 115, 101, 116, 4, 2, 59, 69, 3963, 3966, 3, 8848, 824, 113, 117, 97, 108, 59, 1, 8931, 4, 3, 98, 99, 112, 3981, 4e3, 4045, 115, 101, 116, 4, 2, 59, 69, 3990, 3993, 3, 8834, 8402, 113, 117, 97, 108, 59, 1, 8840, 99, 101, 101, 100, 115, 4, 4, 59, 69, 83, 84, 4015, 4017, 4025, 4037, 1, 8833, 113, 117, 97, 108, 59, 3, 10928, 824, 108, 97, 110, 116, 69, 113, 117, 97, 108, 59, 1, 8929, 105, 108, 100, 101, 59, 3, 8831, 824, 101, 114, 115, 101, 116, 4, 2, 59, 69, 4056, 4059, 3, 8835, 8402, 113, 117, 97, 108, 59, 1, 8841, 105, 108, 100, 101, 4, 4, 59, 69, 70, 84, 4080, 4082, 4089, 4100, 1, 8769, 113, 117, 97, 108, 59, 1, 8772, 117, 108, 108, 69, 113, 117, 97, 108, 59, 1, 8775, 105, 108, 100, 101, 59, 1, 8777, 101, 114, 116, 105, 99, 97, 108, 66, 97, 114, 59, 1, 8740, 99, 114, 59, 3, 55349, 56489, 105, 108, 100, 101, 5, 209, 1, 59, 4135, 1, 209, 59, 1, 925, 4, 14, 69, 97, 99, 100, 102, 103, 109, 111, 112, 114, 115, 116, 117, 118, 4170, 4176, 4187, 4205, 4212, 4217, 4228, 4253, 4259, 4292, 4295, 4316, 4337, 4346, 108, 105, 103, 59, 1, 338, 99, 117, 116, 101, 5, 211, 1, 59, 4185, 1, 211, 4, 2, 105, 121, 4193, 4202, 114, 99, 5, 212, 1, 59, 4200, 1, 212, 59, 1, 1054, 98, 108, 97, 99, 59, 1, 336, 114, 59, 3, 55349, 56594, 114, 97, 118, 101, 5, 210, 1, 59, 4226, 1, 210, 4, 3, 97, 101, 105, 4236, 4241, 4246, 99, 114, 59, 1, 332, 103, 97, 59, 1, 937, 99, 114, 111, 110, 59, 1, 927, 112, 102, 59, 3, 55349, 56646, 101, 110, 67, 117, 114, 108, 121, 4, 2, 68, 81, 4272, 4285, 111, 117, 98, 108, 101, 81, 117, 111, 116, 101, 59, 1, 8220, 117, 111, 116, 101, 59, 1, 8216, 59, 1, 10836, 4, 2, 99, 108, 4301, 4306, 114, 59, 3, 55349, 56490, 97, 115, 104, 5, 216, 1, 59, 4314, 1, 216, 105, 4, 2, 108, 109, 4323, 4332, 100, 101, 5, 213, 1, 59, 4330, 1, 213, 101, 115, 59, 1, 10807, 109, 108, 5, 214, 1, 59, 4344, 1, 214, 101, 114, 4, 2, 66, 80, 4354, 4380, 4, 2, 97, 114, 4360, 4364, 114, 59, 1, 8254, 97, 99, 4, 2, 101, 107, 4372, 4375, 59, 1, 9182, 101, 116, 59, 1, 9140, 97, 114, 101, 110, 116, 104, 101, 115, 105, 115, 59, 1, 9180, 4, 9, 97, 99, 102, 104, 105, 108, 111, 114, 115, 4413, 4422, 4426, 4431, 4435, 4438, 4448, 4471, 4561, 114, 116, 105, 97, 108, 68, 59, 1, 8706, 121, 59, 1, 1055, 114, 59, 3, 55349, 56595, 105, 59, 1, 934, 59, 1, 928, 117, 115, 77, 105, 110, 117, 115, 59, 1, 177, 4, 2, 105, 112, 4454, 4467, 110, 99, 97, 114, 101, 112, 108, 97, 110, 101, 59, 1, 8460, 102, 59, 1, 8473, 4, 4, 59, 101, 105, 111, 4481, 4483, 4526, 4531, 1, 10939, 99, 101, 100, 101, 115, 4, 4, 59, 69, 83, 84, 4498, 4500, 4507, 4519, 1, 8826, 113, 117, 97, 108, 59, 1, 10927, 108, 97, 110, 116, 69, 113, 117, 97, 108, 59, 1, 8828, 105, 108, 100, 101, 59, 1, 8830, 109, 101, 59, 1, 8243, 4, 2, 100, 112, 4537, 4543, 117, 99, 116, 59, 1, 8719, 111, 114, 116, 105, 111, 110, 4, 2, 59, 97, 4555, 4557, 1, 8759, 108, 59, 1, 8733, 4, 2, 99, 105, 4567, 4572, 114, 59, 3, 55349, 56491, 59, 1, 936, 4, 4, 85, 102, 111, 115, 4585, 4594, 4599, 4604, 79, 84, 5, 34, 1, 59, 4592, 1, 34, 114, 59, 3, 55349, 56596, 112, 102, 59, 1, 8474, 99, 114, 59, 3, 55349, 56492, 4, 12, 66, 69, 97, 99, 101, 102, 104, 105, 111, 114, 115, 117, 4636, 4642, 4650, 4681, 4704, 4763, 4767, 4771, 5047, 5069, 5081, 5094, 97, 114, 114, 59, 1, 10512, 71, 5, 174, 1, 59, 4648, 1, 174, 4, 3, 99, 110, 114, 4658, 4664, 4668, 117, 116, 101, 59, 1, 340, 103, 59, 1, 10219, 114, 4, 2, 59, 116, 4675, 4677, 1, 8608, 108, 59, 1, 10518, 4, 3, 97, 101, 121, 4689, 4695, 4701, 114, 111, 110, 59, 1, 344, 100, 105, 108, 59, 1, 342, 59, 1, 1056, 4, 2, 59, 118, 4710, 4712, 1, 8476, 101, 114, 115, 101, 4, 2, 69, 85, 4722, 4748, 4, 2, 108, 113, 4728, 4736, 101, 109, 101, 110, 116, 59, 1, 8715, 117, 105, 108, 105, 98, 114, 105, 117, 109, 59, 1, 8651, 112, 69, 113, 117, 105, 108, 105, 98, 114, 105, 117, 109, 59, 1, 10607, 114, 59, 1, 8476, 111, 59, 1, 929, 103, 104, 116, 4, 8, 65, 67, 68, 70, 84, 85, 86, 97, 4792, 4840, 4849, 4905, 4912, 4972, 5022, 5040, 4, 2, 110, 114, 4798, 4811, 103, 108, 101, 66, 114, 97, 99, 107, 101, 116, 59, 1, 10217, 114, 111, 119, 4, 3, 59, 66, 76, 4822, 4824, 4829, 1, 8594, 97, 114, 59, 1, 8677, 101, 102, 116, 65, 114, 114, 111, 119, 59, 1, 8644, 101, 105, 108, 105, 110, 103, 59, 1, 8969, 111, 4, 2, 117, 119, 4856, 4869, 98, 108, 101, 66, 114, 97, 99, 107, 101, 116, 59, 1, 10215, 110, 4, 2, 84, 86, 4876, 4887, 101, 101, 86, 101, 99, 116, 111, 114, 59, 1, 10589, 101, 99, 116, 111, 114, 4, 2, 59, 66, 4898, 4900, 1, 8642, 97, 114, 59, 1, 10581, 108, 111, 111, 114, 59, 1, 8971, 4, 2, 101, 114, 4918, 4944, 101, 4, 3, 59, 65, 86, 4927, 4929, 4936, 1, 8866, 114, 114, 111, 119, 59, 1, 8614, 101, 99, 116, 111, 114, 59, 1, 10587, 105, 97, 110, 103, 108, 101, 4, 3, 59, 66, 69, 4958, 4960, 4965, 1, 8883, 97, 114, 59, 1, 10704, 113, 117, 97, 108, 59, 1, 8885, 112, 4, 3, 68, 84, 86, 4981, 4993, 5004, 111, 119, 110, 86, 101, 99, 116, 111, 114, 59, 1, 10575, 101, 101, 86, 101, 99, 116, 111, 114, 59, 1, 10588, 101, 99, 116, 111, 114, 4, 2, 59, 66, 5015, 5017, 1, 8638, 97, 114, 59, 1, 10580, 101, 99, 116, 111, 114, 4, 2, 59, 66, 5033, 5035, 1, 8640, 97, 114, 59, 1, 10579, 114, 114, 111, 119, 59, 1, 8658, 4, 2, 112, 117, 5053, 5057, 102, 59, 1, 8477, 110, 100, 73, 109, 112, 108, 105, 101, 115, 59, 1, 10608, 105, 103, 104, 116, 97, 114, 114, 111, 119, 59, 1, 8667, 4, 2, 99, 104, 5087, 5091, 114, 59, 1, 8475, 59, 1, 8625, 108, 101, 68, 101, 108, 97, 121, 101, 100, 59, 1, 10740, 4, 13, 72, 79, 97, 99, 102, 104, 105, 109, 111, 113, 115, 116, 117, 5134, 5150, 5157, 5164, 5198, 5203, 5259, 5265, 5277, 5283, 5374, 5380, 5385, 4, 2, 67, 99, 5140, 5146, 72, 99, 121, 59, 1, 1065, 121, 59, 1, 1064, 70, 84, 99, 121, 59, 1, 1068, 99, 117, 116, 101, 59, 1, 346, 4, 5, 59, 97, 101, 105, 121, 5176, 5178, 5184, 5190, 5195, 1, 10940, 114, 111, 110, 59, 1, 352, 100, 105, 108, 59, 1, 350, 114, 99, 59, 1, 348, 59, 1, 1057, 114, 59, 3, 55349, 56598, 111, 114, 116, 4, 4, 68, 76, 82, 85, 5216, 5227, 5238, 5250, 111, 119, 110, 65, 114, 114, 111, 119, 59, 1, 8595, 101, 102, 116, 65, 114, 114, 111, 119, 59, 1, 8592, 105, 103, 104, 116, 65, 114, 114, 111, 119, 59, 1, 8594, 112, 65, 114, 114, 111, 119, 59, 1, 8593, 103, 109, 97, 59, 1, 931, 97, 108, 108, 67, 105, 114, 99, 108, 101, 59, 1, 8728, 112, 102, 59, 3, 55349, 56650, 4, 2, 114, 117, 5289, 5293, 116, 59, 1, 8730, 97, 114, 101, 4, 4, 59, 73, 83, 85, 5306, 5308, 5322, 5367, 1, 9633, 110, 116, 101, 114, 115, 101, 99, 116, 105, 111, 110, 59, 1, 8851, 117, 4, 2, 98, 112, 5329, 5347, 115, 101, 116, 4, 2, 59, 69, 5338, 5340, 1, 8847, 113, 117, 97, 108, 59, 1, 8849, 101, 114, 115, 101, 116, 4, 2, 59, 69, 5358, 5360, 1, 8848, 113, 117, 97, 108, 59, 1, 8850, 110, 105, 111, 110, 59, 1, 8852, 99, 114, 59, 3, 55349, 56494, 97, 114, 59, 1, 8902, 4, 4, 98, 99, 109, 112, 5395, 5420, 5475, 5478, 4, 2, 59, 115, 5401, 5403, 1, 8912, 101, 116, 4, 2, 59, 69, 5411, 5413, 1, 8912, 113, 117, 97, 108, 59, 1, 8838, 4, 2, 99, 104, 5426, 5468, 101, 101, 100, 115, 4, 4, 59, 69, 83, 84, 5440, 5442, 5449, 5461, 1, 8827, 113, 117, 97, 108, 59, 1, 10928, 108, 97, 110, 116, 69, 113, 117, 97, 108, 59, 1, 8829, 105, 108, 100, 101, 59, 1, 8831, 84, 104, 97, 116, 59, 1, 8715, 59, 1, 8721, 4, 3, 59, 101, 115, 5486, 5488, 5507, 1, 8913, 114, 115, 101, 116, 4, 2, 59, 69, 5498, 5500, 1, 8835, 113, 117, 97, 108, 59, 1, 8839, 101, 116, 59, 1, 8913, 4, 11, 72, 82, 83, 97, 99, 102, 104, 105, 111, 114, 115, 5536, 5546, 5552, 5567, 5579, 5602, 5607, 5655, 5695, 5701, 5711, 79, 82, 78, 5, 222, 1, 59, 5544, 1, 222, 65, 68, 69, 59, 1, 8482, 4, 2, 72, 99, 5558, 5563, 99, 121, 59, 1, 1035, 121, 59, 1, 1062, 4, 2, 98, 117, 5573, 5576, 59, 1, 9, 59, 1, 932, 4, 3, 97, 101, 121, 5587, 5593, 5599, 114, 111, 110, 59, 1, 356, 100, 105, 108, 59, 1, 354, 59, 1, 1058, 114, 59, 3, 55349, 56599, 4, 2, 101, 105, 5613, 5631, 4, 2, 114, 116, 5619, 5627, 101, 102, 111, 114, 101, 59, 1, 8756, 97, 59, 1, 920, 4, 2, 99, 110, 5637, 5647, 107, 83, 112, 97, 99, 101, 59, 3, 8287, 8202, 83, 112, 97, 99, 101, 59, 1, 8201, 108, 100, 101, 4, 4, 59, 69, 70, 84, 5668, 5670, 5677, 5688, 1, 8764, 113, 117, 97, 108, 59, 1, 8771, 117, 108, 108, 69, 113, 117, 97, 108, 59, 1, 8773, 105, 108, 100, 101, 59, 1, 8776, 112, 102, 59, 3, 55349, 56651, 105, 112, 108, 101, 68, 111, 116, 59, 1, 8411, 4, 2, 99, 116, 5717, 5722, 114, 59, 3, 55349, 56495, 114, 111, 107, 59, 1, 358, 4, 14, 97, 98, 99, 100, 102, 103, 109, 110, 111, 112, 114, 115, 116, 117, 5758, 5789, 5805, 5823, 5830, 5835, 5846, 5852, 5921, 5937, 6089, 6095, 6101, 6108, 4, 2, 99, 114, 5764, 5774, 117, 116, 101, 5, 218, 1, 59, 5772, 1, 218, 114, 4, 2, 59, 111, 5781, 5783, 1, 8607, 99, 105, 114, 59, 1, 10569, 114, 4, 2, 99, 101, 5796, 5800, 121, 59, 1, 1038, 118, 101, 59, 1, 364, 4, 2, 105, 121, 5811, 5820, 114, 99, 5, 219, 1, 59, 5818, 1, 219, 59, 1, 1059, 98, 108, 97, 99, 59, 1, 368, 114, 59, 3, 55349, 56600, 114, 97, 118, 101, 5, 217, 1, 59, 5844, 1, 217, 97, 99, 114, 59, 1, 362, 4, 2, 100, 105, 5858, 5905, 101, 114, 4, 2, 66, 80, 5866, 5892, 4, 2, 97, 114, 5872, 5876, 114, 59, 1, 95, 97, 99, 4, 2, 101, 107, 5884, 5887, 59, 1, 9183, 101, 116, 59, 1, 9141, 97, 114, 101, 110, 116, 104, 101, 115, 105, 115, 59, 1, 9181, 111, 110, 4, 2, 59, 80, 5913, 5915, 1, 8899, 108, 117, 115, 59, 1, 8846, 4, 2, 103, 112, 5927, 5932, 111, 110, 59, 1, 370, 102, 59, 3, 55349, 56652, 4, 8, 65, 68, 69, 84, 97, 100, 112, 115, 5955, 5985, 5996, 6009, 6026, 6033, 6044, 6075, 114, 114, 111, 119, 4, 3, 59, 66, 68, 5967, 5969, 5974, 1, 8593, 97, 114, 59, 1, 10514, 111, 119, 110, 65, 114, 114, 111, 119, 59, 1, 8645, 111, 119, 110, 65, 114, 114, 111, 119, 59, 1, 8597, 113, 117, 105, 108, 105, 98, 114, 105, 117, 109, 59, 1, 10606, 101, 101, 4, 2, 59, 65, 6017, 6019, 1, 8869, 114, 114, 111, 119, 59, 1, 8613, 114, 114, 111, 119, 59, 1, 8657, 111, 119, 110, 97, 114, 114, 111, 119, 59, 1, 8661, 101, 114, 4, 2, 76, 82, 6052, 6063, 101, 102, 116, 65, 114, 114, 111, 119, 59, 1, 8598, 105, 103, 104, 116, 65, 114, 114, 111, 119, 59, 1, 8599, 105, 4, 2, 59, 108, 6082, 6084, 1, 978, 111, 110, 59, 1, 933, 105, 110, 103, 59, 1, 366, 99, 114, 59, 3, 55349, 56496, 105, 108, 100, 101, 59, 1, 360, 109, 108, 5, 220, 1, 59, 6115, 1, 220, 4, 9, 68, 98, 99, 100, 101, 102, 111, 115, 118, 6137, 6143, 6148, 6152, 6166, 6250, 6255, 6261, 6267, 97, 115, 104, 59, 1, 8875, 97, 114, 59, 1, 10987, 121, 59, 1, 1042, 97, 115, 104, 4, 2, 59, 108, 6161, 6163, 1, 8873, 59, 1, 10982, 4, 2, 101, 114, 6172, 6175, 59, 1, 8897, 4, 3, 98, 116, 121, 6183, 6188, 6238, 97, 114, 59, 1, 8214, 4, 2, 59, 105, 6194, 6196, 1, 8214, 99, 97, 108, 4, 4, 66, 76, 83, 84, 6209, 6214, 6220, 6231, 97, 114, 59, 1, 8739, 105, 110, 101, 59, 1, 124, 101, 112, 97, 114, 97, 116, 111, 114, 59, 1, 10072, 105, 108, 100, 101, 59, 1, 8768, 84, 104, 105, 110, 83, 112, 97, 99, 101, 59, 1, 8202, 114, 59, 3, 55349, 56601, 112, 102, 59, 3, 55349, 56653, 99, 114, 59, 3, 55349, 56497, 100, 97, 115, 104, 59, 1, 8874, 4, 5, 99, 101, 102, 111, 115, 6286, 6292, 6298, 6303, 6309, 105, 114, 99, 59, 1, 372, 100, 103, 101, 59, 1, 8896, 114, 59, 3, 55349, 56602, 112, 102, 59, 3, 55349, 56654, 99, 114, 59, 3, 55349, 56498, 4, 4, 102, 105, 111, 115, 6325, 6330, 6333, 6339, 114, 59, 3, 55349, 56603, 59, 1, 926, 112, 102, 59, 3, 55349, 56655, 99, 114, 59, 3, 55349, 56499, 4, 9, 65, 73, 85, 97, 99, 102, 111, 115, 117, 6365, 6370, 6375, 6380, 6391, 6405, 6410, 6416, 6422, 99, 121, 59, 1, 1071, 99, 121, 59, 1, 1031, 99, 121, 59, 1, 1070, 99, 117, 116, 101, 5, 221, 1, 59, 6389, 1, 221, 4, 2, 105, 121, 6397, 6402, 114, 99, 59, 1, 374, 59, 1, 1067, 114, 59, 3, 55349, 56604, 112, 102, 59, 3, 55349, 56656, 99, 114, 59, 3, 55349, 56500, 109, 108, 59, 1, 376, 4, 8, 72, 97, 99, 100, 101, 102, 111, 115, 6445, 6450, 6457, 6472, 6477, 6501, 6505, 6510, 99, 121, 59, 1, 1046, 99, 117, 116, 101, 59, 1, 377, 4, 2, 97, 121, 6463, 6469, 114, 111, 110, 59, 1, 381, 59, 1, 1047, 111, 116, 59, 1, 379, 4, 2, 114, 116, 6483, 6497, 111, 87, 105, 100, 116, 104, 83, 112, 97, 99, 101, 59, 1, 8203, 97, 59, 1, 918, 114, 59, 1, 8488, 112, 102, 59, 1, 8484, 99, 114, 59, 3, 55349, 56501, 4, 16, 97, 98, 99, 101, 102, 103, 108, 109, 110, 111, 112, 114, 115, 116, 117, 119, 6550, 6561, 6568, 6612, 6622, 6634, 6645, 6672, 6699, 6854, 6870, 6923, 6933, 6963, 6974, 6983, 99, 117, 116, 101, 5, 225, 1, 59, 6559, 1, 225, 114, 101, 118, 101, 59, 1, 259, 4, 6, 59, 69, 100, 105, 117, 121, 6582, 6584, 6588, 6591, 6600, 6609, 1, 8766, 59, 3, 8766, 819, 59, 1, 8767, 114, 99, 5, 226, 1, 59, 6598, 1, 226, 116, 101, 5, 180, 1, 59, 6607, 1, 180, 59, 1, 1072, 108, 105, 103, 5, 230, 1, 59, 6620, 1, 230, 4, 2, 59, 114, 6628, 6630, 1, 8289, 59, 3, 55349, 56606, 114, 97, 118, 101, 5, 224, 1, 59, 6643, 1, 224, 4, 2, 101, 112, 6651, 6667, 4, 2, 102, 112, 6657, 6663, 115, 121, 109, 59, 1, 8501, 104, 59, 1, 8501, 104, 97, 59, 1, 945, 4, 2, 97, 112, 6678, 6692, 4, 2, 99, 108, 6684, 6688, 114, 59, 1, 257, 103, 59, 1, 10815, 5, 38, 1, 59, 6697, 1, 38, 4, 2, 100, 103, 6705, 6737, 4, 5, 59, 97, 100, 115, 118, 6717, 6719, 6724, 6727, 6734, 1, 8743, 110, 100, 59, 1, 10837, 59, 1, 10844, 108, 111, 112, 101, 59, 1, 10840, 59, 1, 10842, 4, 7, 59, 101, 108, 109, 114, 115, 122, 6753, 6755, 6758, 6762, 6814, 6835, 6848, 1, 8736, 59, 1, 10660, 101, 59, 1, 8736, 115, 100, 4, 2, 59, 97, 6770, 6772, 1, 8737, 4, 8, 97, 98, 99, 100, 101, 102, 103, 104, 6790, 6793, 6796, 6799, 6802, 6805, 6808, 6811, 59, 1, 10664, 59, 1, 10665, 59, 1, 10666, 59, 1, 10667, 59, 1, 10668, 59, 1, 10669, 59, 1, 10670, 59, 1, 10671, 116, 4, 2, 59, 118, 6821, 6823, 1, 8735, 98, 4, 2, 59, 100, 6830, 6832, 1, 8894, 59, 1, 10653, 4, 2, 112, 116, 6841, 6845, 104, 59, 1, 8738, 59, 1, 197, 97, 114, 114, 59, 1, 9084, 4, 2, 103, 112, 6860, 6865, 111, 110, 59, 1, 261, 102, 59, 3, 55349, 56658, 4, 7, 59, 69, 97, 101, 105, 111, 112, 6886, 6888, 6891, 6897, 6900, 6904, 6908, 1, 8776, 59, 1, 10864, 99, 105, 114, 59, 1, 10863, 59, 1, 8778, 100, 59, 1, 8779, 115, 59, 1, 39, 114, 111, 120, 4, 2, 59, 101, 6917, 6919, 1, 8776, 113, 59, 1, 8778, 105, 110, 103, 5, 229, 1, 59, 6931, 1, 229, 4, 3, 99, 116, 121, 6941, 6946, 6949, 114, 59, 3, 55349, 56502, 59, 1, 42, 109, 112, 4, 2, 59, 101, 6957, 6959, 1, 8776, 113, 59, 1, 8781, 105, 108, 100, 101, 5, 227, 1, 59, 6972, 1, 227, 109, 108, 5, 228, 1, 59, 6981, 1, 228, 4, 2, 99, 105, 6989, 6997, 111, 110, 105, 110, 116, 59, 1, 8755, 110, 116, 59, 1, 10769, 4, 16, 78, 97, 98, 99, 100, 101, 102, 105, 107, 108, 110, 111, 112, 114, 115, 117, 7036, 7041, 7119, 7135, 7149, 7155, 7219, 7224, 7347, 7354, 7463, 7489, 7786, 7793, 7814, 7866, 111, 116, 59, 1, 10989, 4, 2, 99, 114, 7047, 7094, 107, 4, 4, 99, 101, 112, 115, 7058, 7064, 7073, 7080, 111, 110, 103, 59, 1, 8780, 112, 115, 105, 108, 111, 110, 59, 1, 1014, 114, 105, 109, 101, 59, 1, 8245, 105, 109, 4, 2, 59, 101, 7088, 7090, 1, 8765, 113, 59, 1, 8909, 4, 2, 118, 119, 7100, 7105, 101, 101, 59, 1, 8893, 101, 100, 4, 2, 59, 103, 7113, 7115, 1, 8965, 101, 59, 1, 8965, 114, 107, 4, 2, 59, 116, 7127, 7129, 1, 9141, 98, 114, 107, 59, 1, 9142, 4, 2, 111, 121, 7141, 7146, 110, 103, 59, 1, 8780, 59, 1, 1073, 113, 117, 111, 59, 1, 8222, 4, 5, 99, 109, 112, 114, 116, 7167, 7181, 7188, 7193, 7199, 97, 117, 115, 4, 2, 59, 101, 7176, 7178, 1, 8757, 59, 1, 8757, 112, 116, 121, 118, 59, 1, 10672, 115, 105, 59, 1, 1014, 110, 111, 117, 59, 1, 8492, 4, 3, 97, 104, 119, 7207, 7210, 7213, 59, 1, 946, 59, 1, 8502, 101, 101, 110, 59, 1, 8812, 114, 59, 3, 55349, 56607, 103, 4, 7, 99, 111, 115, 116, 117, 118, 119, 7241, 7262, 7288, 7305, 7328, 7335, 7340, 4, 3, 97, 105, 117, 7249, 7253, 7258, 112, 59, 1, 8898, 114, 99, 59, 1, 9711, 112, 59, 1, 8899, 4, 3, 100, 112, 116, 7270, 7275, 7281, 111, 116, 59, 1, 10752, 108, 117, 115, 59, 1, 10753, 105, 109, 101, 115, 59, 1, 10754, 4, 2, 113, 116, 7294, 7300, 99, 117, 112, 59, 1, 10758, 97, 114, 59, 1, 9733, 114, 105, 97, 110, 103, 108, 101, 4, 2, 100, 117, 7318, 7324, 111, 119, 110, 59, 1, 9661, 112, 59, 1, 9651, 112, 108, 117, 115, 59, 1, 10756, 101, 101, 59, 1, 8897, 101, 100, 103, 101, 59, 1, 8896, 97, 114, 111, 119, 59, 1, 10509, 4, 3, 97, 107, 111, 7362, 7436, 7458, 4, 2, 99, 110, 7368, 7432, 107, 4, 3, 108, 115, 116, 7377, 7386, 7394, 111, 122, 101, 110, 103, 101, 59, 1, 10731, 113, 117, 97, 114, 101, 59, 1, 9642, 114, 105, 97, 110, 103, 108, 101, 4, 4, 59, 100, 108, 114, 7411, 7413, 7419, 7425, 1, 9652, 111, 119, 110, 59, 1, 9662, 101, 102, 116, 59, 1, 9666, 105, 103, 104, 116, 59, 1, 9656, 107, 59, 1, 9251, 4, 2, 49, 51, 7442, 7454, 4, 2, 50, 52, 7448, 7451, 59, 1, 9618, 59, 1, 9617, 52, 59, 1, 9619, 99, 107, 59, 1, 9608, 4, 2, 101, 111, 7469, 7485, 4, 2, 59, 113, 7475, 7478, 3, 61, 8421, 117, 105, 118, 59, 3, 8801, 8421, 116, 59, 1, 8976, 4, 4, 112, 116, 119, 120, 7499, 7504, 7517, 7523, 102, 59, 3, 55349, 56659, 4, 2, 59, 116, 7510, 7512, 1, 8869, 111, 109, 59, 1, 8869, 116, 105, 101, 59, 1, 8904, 4, 12, 68, 72, 85, 86, 98, 100, 104, 109, 112, 116, 117, 118, 7549, 7571, 7597, 7619, 7655, 7660, 7682, 7708, 7715, 7721, 7728, 7750, 4, 4, 76, 82, 108, 114, 7559, 7562, 7565, 7568, 59, 1, 9559, 59, 1, 9556, 59, 1, 9558, 59, 1, 9555, 4, 5, 59, 68, 85, 100, 117, 7583, 7585, 7588, 7591, 7594, 1, 9552, 59, 1, 9574, 59, 1, 9577, 59, 1, 9572, 59, 1, 9575, 4, 4, 76, 82, 108, 114, 7607, 7610, 7613, 7616, 59, 1, 9565, 59, 1, 9562, 59, 1, 9564, 59, 1, 9561, 4, 7, 59, 72, 76, 82, 104, 108, 114, 7635, 7637, 7640, 7643, 7646, 7649, 7652, 1, 9553, 59, 1, 9580, 59, 1, 9571, 59, 1, 9568, 59, 1, 9579, 59, 1, 9570, 59, 1, 9567, 111, 120, 59, 1, 10697, 4, 4, 76, 82, 108, 114, 7670, 7673, 7676, 7679, 59, 1, 9557, 59, 1, 9554, 59, 1, 9488, 59, 1, 9484, 4, 5, 59, 68, 85, 100, 117, 7694, 7696, 7699, 7702, 7705, 1, 9472, 59, 1, 9573, 59, 1, 9576, 59, 1, 9516, 59, 1, 9524, 105, 110, 117, 115, 59, 1, 8863, 108, 117, 115, 59, 1, 8862, 105, 109, 101, 115, 59, 1, 8864, 4, 4, 76, 82, 108, 114, 7738, 7741, 7744, 7747, 59, 1, 9563, 59, 1, 9560, 59, 1, 9496, 59, 1, 9492, 4, 7, 59, 72, 76, 82, 104, 108, 114, 7766, 7768, 7771, 7774, 7777, 7780, 7783, 1, 9474, 59, 1, 9578, 59, 1, 9569, 59, 1, 9566, 59, 1, 9532, 59, 1, 9508, 59, 1, 9500, 114, 105, 109, 101, 59, 1, 8245, 4, 2, 101, 118, 7799, 7804, 118, 101, 59, 1, 728, 98, 97, 114, 5, 166, 1, 59, 7812, 1, 166, 4, 4, 99, 101, 105, 111, 7824, 7829, 7834, 7846, 114, 59, 3, 55349, 56503, 109, 105, 59, 1, 8271, 109, 4, 2, 59, 101, 7841, 7843, 1, 8765, 59, 1, 8909, 108, 4, 3, 59, 98, 104, 7855, 7857, 7860, 1, 92, 59, 1, 10693, 115, 117, 98, 59, 1, 10184, 4, 2, 108, 109, 7872, 7885, 108, 4, 2, 59, 101, 7879, 7881, 1, 8226, 116, 59, 1, 8226, 112, 4, 3, 59, 69, 101, 7894, 7896, 7899, 1, 8782, 59, 1, 10926, 4, 2, 59, 113, 7905, 7907, 1, 8783, 59, 1, 8783, 4, 15, 97, 99, 100, 101, 102, 104, 105, 108, 111, 114, 115, 116, 117, 119, 121, 7942, 8021, 8075, 8080, 8121, 8126, 8157, 8279, 8295, 8430, 8446, 8485, 8491, 8707, 8726, 4, 3, 99, 112, 114, 7950, 7956, 8007, 117, 116, 101, 59, 1, 263, 4, 6, 59, 97, 98, 99, 100, 115, 7970, 7972, 7977, 7984, 7998, 8003, 1, 8745, 110, 100, 59, 1, 10820, 114, 99, 117, 112, 59, 1, 10825, 4, 2, 97, 117, 7990, 7994, 112, 59, 1, 10827, 112, 59, 1, 10823, 111, 116, 59, 1, 10816, 59, 3, 8745, 65024, 4, 2, 101, 111, 8013, 8017, 116, 59, 1, 8257, 110, 59, 1, 711, 4, 4, 97, 101, 105, 117, 8031, 8046, 8056, 8061, 4, 2, 112, 114, 8037, 8041, 115, 59, 1, 10829, 111, 110, 59, 1, 269, 100, 105, 108, 5, 231, 1, 59, 8054, 1, 231, 114, 99, 59, 1, 265, 112, 115, 4, 2, 59, 115, 8069, 8071, 1, 10828, 109, 59, 1, 10832, 111, 116, 59, 1, 267, 4, 3, 100, 109, 110, 8088, 8097, 8104, 105, 108, 5, 184, 1, 59, 8095, 1, 184, 112, 116, 121, 118, 59, 1, 10674, 116, 5, 162, 2, 59, 101, 8112, 8114, 1, 162, 114, 100, 111, 116, 59, 1, 183, 114, 59, 3, 55349, 56608, 4, 3, 99, 101, 105, 8134, 8138, 8154, 121, 59, 1, 1095, 99, 107, 4, 2, 59, 109, 8146, 8148, 1, 10003, 97, 114, 107, 59, 1, 10003, 59, 1, 967, 114, 4, 7, 59, 69, 99, 101, 102, 109, 115, 8174, 8176, 8179, 8258, 8261, 8268, 8273, 1, 9675, 59, 1, 10691, 4, 3, 59, 101, 108, 8187, 8189, 8193, 1, 710, 113, 59, 1, 8791, 101, 4, 2, 97, 100, 8200, 8223, 114, 114, 111, 119, 4, 2, 108, 114, 8210, 8216, 101, 102, 116, 59, 1, 8634, 105, 103, 104, 116, 59, 1, 8635, 4, 5, 82, 83, 97, 99, 100, 8235, 8238, 8241, 8246, 8252, 59, 1, 174, 59, 1, 9416, 115, 116, 59, 1, 8859, 105, 114, 99, 59, 1, 8858, 97, 115, 104, 59, 1, 8861, 59, 1, 8791, 110, 105, 110, 116, 59, 1, 10768, 105, 100, 59, 1, 10991, 99, 105, 114, 59, 1, 10690, 117, 98, 115, 4, 2, 59, 117, 8288, 8290, 1, 9827, 105, 116, 59, 1, 9827, 4, 4, 108, 109, 110, 112, 8305, 8326, 8376, 8400, 111, 110, 4, 2, 59, 101, 8313, 8315, 1, 58, 4, 2, 59, 113, 8321, 8323, 1, 8788, 59, 1, 8788, 4, 2, 109, 112, 8332, 8344, 97, 4, 2, 59, 116, 8339, 8341, 1, 44, 59, 1, 64, 4, 3, 59, 102, 108, 8352, 8354, 8358, 1, 8705, 110, 59, 1, 8728, 101, 4, 2, 109, 120, 8365, 8371, 101, 110, 116, 59, 1, 8705, 101, 115, 59, 1, 8450, 4, 2, 103, 105, 8382, 8395, 4, 2, 59, 100, 8388, 8390, 1, 8773, 111, 116, 59, 1, 10861, 110, 116, 59, 1, 8750, 4, 3, 102, 114, 121, 8408, 8412, 8417, 59, 3, 55349, 56660, 111, 100, 59, 1, 8720, 5, 169, 2, 59, 115, 8424, 8426, 1, 169, 114, 59, 1, 8471, 4, 2, 97, 111, 8436, 8441, 114, 114, 59, 1, 8629, 115, 115, 59, 1, 10007, 4, 2, 99, 117, 8452, 8457, 114, 59, 3, 55349, 56504, 4, 2, 98, 112, 8463, 8474, 4, 2, 59, 101, 8469, 8471, 1, 10959, 59, 1, 10961, 4, 2, 59, 101, 8480, 8482, 1, 10960, 59, 1, 10962, 100, 111, 116, 59, 1, 8943, 4, 7, 100, 101, 108, 112, 114, 118, 119, 8507, 8522, 8536, 8550, 8600, 8697, 8702, 97, 114, 114, 4, 2, 108, 114, 8516, 8519, 59, 1, 10552, 59, 1, 10549, 4, 2, 112, 115, 8528, 8532, 114, 59, 1, 8926, 99, 59, 1, 8927, 97, 114, 114, 4, 2, 59, 112, 8545, 8547, 1, 8630, 59, 1, 10557, 4, 6, 59, 98, 99, 100, 111, 115, 8564, 8566, 8573, 8587, 8592, 8596, 1, 8746, 114, 99, 97, 112, 59, 1, 10824, 4, 2, 97, 117, 8579, 8583, 112, 59, 1, 10822, 112, 59, 1, 10826, 111, 116, 59, 1, 8845, 114, 59, 1, 10821, 59, 3, 8746, 65024, 4, 4, 97, 108, 114, 118, 8610, 8623, 8663, 8672, 114, 114, 4, 2, 59, 109, 8618, 8620, 1, 8631, 59, 1, 10556, 121, 4, 3, 101, 118, 119, 8632, 8651, 8656, 113, 4, 2, 112, 115, 8639, 8645, 114, 101, 99, 59, 1, 8926, 117, 99, 99, 59, 1, 8927, 101, 101, 59, 1, 8910, 101, 100, 103, 101, 59, 1, 8911, 101, 110, 5, 164, 1, 59, 8670, 1, 164, 101, 97, 114, 114, 111, 119, 4, 2, 108, 114, 8684, 8690, 101, 102, 116, 59, 1, 8630, 105, 103, 104, 116, 59, 1, 8631, 101, 101, 59, 1, 8910, 101, 100, 59, 1, 8911, 4, 2, 99, 105, 8713, 8721, 111, 110, 105, 110, 116, 59, 1, 8754, 110, 116, 59, 1, 8753, 108, 99, 116, 121, 59, 1, 9005, 4, 19, 65, 72, 97, 98, 99, 100, 101, 102, 104, 105, 106, 108, 111, 114, 115, 116, 117, 119, 122, 8773, 8778, 8783, 8821, 8839, 8854, 8887, 8914, 8930, 8944, 9036, 9041, 9058, 9197, 9227, 9258, 9281, 9297, 9305, 114, 114, 59, 1, 8659, 97, 114, 59, 1, 10597, 4, 4, 103, 108, 114, 115, 8793, 8799, 8805, 8809, 103, 101, 114, 59, 1, 8224, 101, 116, 104, 59, 1, 8504, 114, 59, 1, 8595, 104, 4, 2, 59, 118, 8816, 8818, 1, 8208, 59, 1, 8867, 4, 2, 107, 108, 8827, 8834, 97, 114, 111, 119, 59, 1, 10511, 97, 99, 59, 1, 733, 4, 2, 97, 121, 8845, 8851, 114, 111, 110, 59, 1, 271, 59, 1, 1076, 4, 3, 59, 97, 111, 8862, 8864, 8880, 1, 8518, 4, 2, 103, 114, 8870, 8876, 103, 101, 114, 59, 1, 8225, 114, 59, 1, 8650, 116, 115, 101, 113, 59, 1, 10871, 4, 3, 103, 108, 109, 8895, 8902, 8907, 5, 176, 1, 59, 8900, 1, 176, 116, 97, 59, 1, 948, 112, 116, 121, 118, 59, 1, 10673, 4, 2, 105, 114, 8920, 8926, 115, 104, 116, 59, 1, 10623, 59, 3, 55349, 56609, 97, 114, 4, 2, 108, 114, 8938, 8941, 59, 1, 8643, 59, 1, 8642, 4, 5, 97, 101, 103, 115, 118, 8956, 8986, 8989, 8996, 9001, 109, 4, 3, 59, 111, 115, 8965, 8967, 8983, 1, 8900, 110, 100, 4, 2, 59, 115, 8975, 8977, 1, 8900, 117, 105, 116, 59, 1, 9830, 59, 1, 9830, 59, 1, 168, 97, 109, 109, 97, 59, 1, 989, 105, 110, 59, 1, 8946, 4, 3, 59, 105, 111, 9009, 9011, 9031, 1, 247, 100, 101, 5, 247, 2, 59, 111, 9020, 9022, 1, 247, 110, 116, 105, 109, 101, 115, 59, 1, 8903, 110, 120, 59, 1, 8903, 99, 121, 59, 1, 1106, 99, 4, 2, 111, 114, 9048, 9053, 114, 110, 59, 1, 8990, 111, 112, 59, 1, 8973, 4, 5, 108, 112, 116, 117, 119, 9070, 9076, 9081, 9130, 9144, 108, 97, 114, 59, 1, 36, 102, 59, 3, 55349, 56661, 4, 5, 59, 101, 109, 112, 115, 9093, 9095, 9109, 9116, 9122, 1, 729, 113, 4, 2, 59, 100, 9102, 9104, 1, 8784, 111, 116, 59, 1, 8785, 105, 110, 117, 115, 59, 1, 8760, 108, 117, 115, 59, 1, 8724, 113, 117, 97, 114, 101, 59, 1, 8865, 98, 108, 101, 98, 97, 114, 119, 101, 100, 103, 101, 59, 1, 8966, 110, 4, 3, 97, 100, 104, 9153, 9160, 9172, 114, 114, 111, 119, 59, 1, 8595, 111, 119, 110, 97, 114, 114, 111, 119, 115, 59, 1, 8650, 97, 114, 112, 111, 111, 110, 4, 2, 108, 114, 9184, 9190, 101, 102, 116, 59, 1, 8643, 105, 103, 104, 116, 59, 1, 8642, 4, 2, 98, 99, 9203, 9211, 107, 97, 114, 111, 119, 59, 1, 10512, 4, 2, 111, 114, 9217, 9222, 114, 110, 59, 1, 8991, 111, 112, 59, 1, 8972, 4, 3, 99, 111, 116, 9235, 9248, 9252, 4, 2, 114, 121, 9241, 9245, 59, 3, 55349, 56505, 59, 1, 1109, 108, 59, 1, 10742, 114, 111, 107, 59, 1, 273, 4, 2, 100, 114, 9264, 9269, 111, 116, 59, 1, 8945, 105, 4, 2, 59, 102, 9276, 9278, 1, 9663, 59, 1, 9662, 4, 2, 97, 104, 9287, 9292, 114, 114, 59, 1, 8693, 97, 114, 59, 1, 10607, 97, 110, 103, 108, 101, 59, 1, 10662, 4, 2, 99, 105, 9311, 9315, 121, 59, 1, 1119, 103, 114, 97, 114, 114, 59, 1, 10239, 4, 18, 68, 97, 99, 100, 101, 102, 103, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 120, 9361, 9376, 9398, 9439, 9444, 9447, 9462, 9495, 9531, 9585, 9598, 9614, 9659, 9755, 9771, 9792, 9808, 9826, 4, 2, 68, 111, 9367, 9372, 111, 116, 59, 1, 10871, 116, 59, 1, 8785, 4, 2, 99, 115, 9382, 9392, 117, 116, 101, 5, 233, 1, 59, 9390, 1, 233, 116, 101, 114, 59, 1, 10862, 4, 4, 97, 105, 111, 121, 9408, 9414, 9430, 9436, 114, 111, 110, 59, 1, 283, 114, 4, 2, 59, 99, 9421, 9423, 1, 8790, 5, 234, 1, 59, 9428, 1, 234, 108, 111, 110, 59, 1, 8789, 59, 1, 1101, 111, 116, 59, 1, 279, 59, 1, 8519, 4, 2, 68, 114, 9453, 9458, 111, 116, 59, 1, 8786, 59, 3, 55349, 56610, 4, 3, 59, 114, 115, 9470, 9472, 9482, 1, 10906, 97, 118, 101, 5, 232, 1, 59, 9480, 1, 232, 4, 2, 59, 100, 9488, 9490, 1, 10902, 111, 116, 59, 1, 10904, 4, 4, 59, 105, 108, 115, 9505, 9507, 9515, 9518, 1, 10905, 110, 116, 101, 114, 115, 59, 1, 9191, 59, 1, 8467, 4, 2, 59, 100, 9524, 9526, 1, 10901, 111, 116, 59, 1, 10903, 4, 3, 97, 112, 115, 9539, 9544, 9564, 99, 114, 59, 1, 275, 116, 121, 4, 3, 59, 115, 118, 9554, 9556, 9561, 1, 8709, 101, 116, 59, 1, 8709, 59, 1, 8709, 112, 4, 2, 49, 59, 9571, 9583, 4, 2, 51, 52, 9577, 9580, 59, 1, 8196, 59, 1, 8197, 1, 8195, 4, 2, 103, 115, 9591, 9594, 59, 1, 331, 112, 59, 1, 8194, 4, 2, 103, 112, 9604, 9609, 111, 110, 59, 1, 281, 102, 59, 3, 55349, 56662, 4, 3, 97, 108, 115, 9622, 9635, 9640, 114, 4, 2, 59, 115, 9629, 9631, 1, 8917, 108, 59, 1, 10723, 117, 115, 59, 1, 10865, 105, 4, 3, 59, 108, 118, 9649, 9651, 9656, 1, 949, 111, 110, 59, 1, 949, 59, 1, 1013, 4, 4, 99, 115, 117, 118, 9669, 9686, 9716, 9747, 4, 2, 105, 111, 9675, 9680, 114, 99, 59, 1, 8790, 108, 111, 110, 59, 1, 8789, 4, 2, 105, 108, 9692, 9696, 109, 59, 1, 8770, 97, 110, 116, 4, 2, 103, 108, 9705, 9710, 116, 114, 59, 1, 10902, 101, 115, 115, 59, 1, 10901, 4, 3, 97, 101, 105, 9724, 9729, 9734, 108, 115, 59, 1, 61, 115, 116, 59, 1, 8799, 118, 4, 2, 59, 68, 9741, 9743, 1, 8801, 68, 59, 1, 10872, 112, 97, 114, 115, 108, 59, 1, 10725, 4, 2, 68, 97, 9761, 9766, 111, 116, 59, 1, 8787, 114, 114, 59, 1, 10609, 4, 3, 99, 100, 105, 9779, 9783, 9788, 114, 59, 1, 8495, 111, 116, 59, 1, 8784, 109, 59, 1, 8770, 4, 2, 97, 104, 9798, 9801, 59, 1, 951, 5, 240, 1, 59, 9806, 1, 240, 4, 2, 109, 114, 9814, 9822, 108, 5, 235, 1, 59, 9820, 1, 235, 111, 59, 1, 8364, 4, 3, 99, 105, 112, 9834, 9838, 9843, 108, 59, 1, 33, 115, 116, 59, 1, 8707, 4, 2, 101, 111, 9849, 9859, 99, 116, 97, 116, 105, 111, 110, 59, 1, 8496, 110, 101, 110, 116, 105, 97, 108, 101, 59, 1, 8519, 4, 12, 97, 99, 101, 102, 105, 106, 108, 110, 111, 112, 114, 115, 9896, 9910, 9914, 9921, 9954, 9960, 9967, 9989, 9994, 10027, 10036, 10164, 108, 108, 105, 110, 103, 100, 111, 116, 115, 101, 113, 59, 1, 8786, 121, 59, 1, 1092, 109, 97, 108, 101, 59, 1, 9792, 4, 3, 105, 108, 114, 9929, 9935, 9950, 108, 105, 103, 59, 1, 64259, 4, 2, 105, 108, 9941, 9945, 103, 59, 1, 64256, 105, 103, 59, 1, 64260, 59, 3, 55349, 56611, 108, 105, 103, 59, 1, 64257, 108, 105, 103, 59, 3, 102, 106, 4, 3, 97, 108, 116, 9975, 9979, 9984, 116, 59, 1, 9837, 105, 103, 59, 1, 64258, 110, 115, 59, 1, 9649, 111, 102, 59, 1, 402, 4, 2, 112, 114, 1e4, 10005, 102, 59, 3, 55349, 56663, 4, 2, 97, 107, 10011, 10016, 108, 108, 59, 1, 8704, 4, 2, 59, 118, 10022, 10024, 1, 8916, 59, 1, 10969, 97, 114, 116, 105, 110, 116, 59, 1, 10765, 4, 2, 97, 111, 10042, 10159, 4, 2, 99, 115, 10048, 10155, 4, 6, 49, 50, 51, 52, 53, 55, 10062, 10102, 10114, 10135, 10139, 10151, 4, 6, 50, 51, 52, 53, 54, 56, 10076, 10083, 10086, 10093, 10096, 10099, 5, 189, 1, 59, 10081, 1, 189, 59, 1, 8531, 5, 188, 1, 59, 10091, 1, 188, 59, 1, 8533, 59, 1, 8537, 59, 1, 8539, 4, 2, 51, 53, 10108, 10111, 59, 1, 8532, 59, 1, 8534, 4, 3, 52, 53, 56, 10122, 10129, 10132, 5, 190, 1, 59, 10127, 1, 190, 59, 1, 8535, 59, 1, 8540, 53, 59, 1, 8536, 4, 2, 54, 56, 10145, 10148, 59, 1, 8538, 59, 1, 8541, 56, 59, 1, 8542, 108, 59, 1, 8260, 119, 110, 59, 1, 8994, 99, 114, 59, 3, 55349, 56507, 4, 17, 69, 97, 98, 99, 100, 101, 102, 103, 105, 106, 108, 110, 111, 114, 115, 116, 118, 10206, 10217, 10247, 10254, 10268, 10273, 10358, 10363, 10374, 10380, 10385, 10406, 10458, 10464, 10470, 10497, 10610, 4, 2, 59, 108, 10212, 10214, 1, 8807, 59, 1, 10892, 4, 3, 99, 109, 112, 10225, 10231, 10244, 117, 116, 101, 59, 1, 501, 109, 97, 4, 2, 59, 100, 10239, 10241, 1, 947, 59, 1, 989, 59, 1, 10886, 114, 101, 118, 101, 59, 1, 287, 4, 2, 105, 121, 10260, 10265, 114, 99, 59, 1, 285, 59, 1, 1075, 111, 116, 59, 1, 289, 4, 4, 59, 108, 113, 115, 10283, 10285, 10288, 10308, 1, 8805, 59, 1, 8923, 4, 3, 59, 113, 115, 10296, 10298, 10301, 1, 8805, 59, 1, 8807, 108, 97, 110, 116, 59, 1, 10878, 4, 4, 59, 99, 100, 108, 10318, 10320, 10324, 10345, 1, 10878, 99, 59, 1, 10921, 111, 116, 4, 2, 59, 111, 10332, 10334, 1, 10880, 4, 2, 59, 108, 10340, 10342, 1, 10882, 59, 1, 10884, 4, 2, 59, 101, 10351, 10354, 3, 8923, 65024, 115, 59, 1, 10900, 114, 59, 3, 55349, 56612, 4, 2, 59, 103, 10369, 10371, 1, 8811, 59, 1, 8921, 109, 101, 108, 59, 1, 8503, 99, 121, 59, 1, 1107, 4, 4, 59, 69, 97, 106, 10395, 10397, 10400, 10403, 1, 8823, 59, 1, 10898, 59, 1, 10917, 59, 1, 10916, 4, 4, 69, 97, 101, 115, 10416, 10419, 10434, 10453, 59, 1, 8809, 112, 4, 2, 59, 112, 10426, 10428, 1, 10890, 114, 111, 120, 59, 1, 10890, 4, 2, 59, 113, 10440, 10442, 1, 10888, 4, 2, 59, 113, 10448, 10450, 1, 10888, 59, 1, 8809, 105, 109, 59, 1, 8935, 112, 102, 59, 3, 55349, 56664, 97, 118, 101, 59, 1, 96, 4, 2, 99, 105, 10476, 10480, 114, 59, 1, 8458, 109, 4, 3, 59, 101, 108, 10489, 10491, 10494, 1, 8819, 59, 1, 10894, 59, 1, 10896, 5, 62, 6, 59, 99, 100, 108, 113, 114, 10512, 10514, 10527, 10532, 10538, 10545, 1, 62, 4, 2, 99, 105, 10520, 10523, 59, 1, 10919, 114, 59, 1, 10874, 111, 116, 59, 1, 8919, 80, 97, 114, 59, 1, 10645, 117, 101, 115, 116, 59, 1, 10876, 4, 5, 97, 100, 101, 108, 115, 10557, 10574, 10579, 10599, 10605, 4, 2, 112, 114, 10563, 10570, 112, 114, 111, 120, 59, 1, 10886, 114, 59, 1, 10616, 111, 116, 59, 1, 8919, 113, 4, 2, 108, 113, 10586, 10592, 101, 115, 115, 59, 1, 8923, 108, 101, 115, 115, 59, 1, 10892, 101, 115, 115, 59, 1, 8823, 105, 109, 59, 1, 8819, 4, 2, 101, 110, 10616, 10626, 114, 116, 110, 101, 113, 113, 59, 3, 8809, 65024, 69, 59, 3, 8809, 65024, 4, 10, 65, 97, 98, 99, 101, 102, 107, 111, 115, 121, 10653, 10658, 10713, 10718, 10724, 10760, 10765, 10786, 10850, 10875, 114, 114, 59, 1, 8660, 4, 4, 105, 108, 109, 114, 10668, 10674, 10678, 10684, 114, 115, 112, 59, 1, 8202, 102, 59, 1, 189, 105, 108, 116, 59, 1, 8459, 4, 2, 100, 114, 10690, 10695, 99, 121, 59, 1, 1098, 4, 3, 59, 99, 119, 10703, 10705, 10710, 1, 8596, 105, 114, 59, 1, 10568, 59, 1, 8621, 97, 114, 59, 1, 8463, 105, 114, 99, 59, 1, 293, 4, 3, 97, 108, 114, 10732, 10748, 10754, 114, 116, 115, 4, 2, 59, 117, 10741, 10743, 1, 9829, 105, 116, 59, 1, 9829, 108, 105, 112, 59, 1, 8230, 99, 111, 110, 59, 1, 8889, 114, 59, 3, 55349, 56613, 115, 4, 2, 101, 119, 10772, 10779, 97, 114, 111, 119, 59, 1, 10533, 97, 114, 111, 119, 59, 1, 10534, 4, 5, 97, 109, 111, 112, 114, 10798, 10803, 10809, 10839, 10844, 114, 114, 59, 1, 8703, 116, 104, 116, 59, 1, 8763, 107, 4, 2, 108, 114, 10816, 10827, 101, 102, 116, 97, 114, 114, 111, 119, 59, 1, 8617, 105, 103, 104, 116, 97, 114, 114, 111, 119, 59, 1, 8618, 102, 59, 3, 55349, 56665, 98, 97, 114, 59, 1, 8213, 4, 3, 99, 108, 116, 10858, 10863, 10869, 114, 59, 3, 55349, 56509, 97, 115, 104, 59, 1, 8463, 114, 111, 107, 59, 1, 295, 4, 2, 98, 112, 10881, 10887, 117, 108, 108, 59, 1, 8259, 104, 101, 110, 59, 1, 8208, 4, 15, 97, 99, 101, 102, 103, 105, 106, 109, 110, 111, 112, 113, 115, 116, 117, 10925, 10936, 10958, 10977, 10990, 11001, 11039, 11045, 11101, 11192, 11220, 11226, 11237, 11285, 11299, 99, 117, 116, 101, 5, 237, 1, 59, 10934, 1, 237, 4, 3, 59, 105, 121, 10944, 10946, 10955, 1, 8291, 114, 99, 5, 238, 1, 59, 10953, 1, 238, 59, 1, 1080, 4, 2, 99, 120, 10964, 10968, 121, 59, 1, 1077, 99, 108, 5, 161, 1, 59, 10975, 1, 161, 4, 2, 102, 114, 10983, 10986, 59, 1, 8660, 59, 3, 55349, 56614, 114, 97, 118, 101, 5, 236, 1, 59, 10999, 1, 236, 4, 4, 59, 105, 110, 111, 11011, 11013, 11028, 11034, 1, 8520, 4, 2, 105, 110, 11019, 11024, 110, 116, 59, 1, 10764, 116, 59, 1, 8749, 102, 105, 110, 59, 1, 10716, 116, 97, 59, 1, 8489, 108, 105, 103, 59, 1, 307, 4, 3, 97, 111, 112, 11053, 11092, 11096, 4, 3, 99, 103, 116, 11061, 11065, 11088, 114, 59, 1, 299, 4, 3, 101, 108, 112, 11073, 11076, 11082, 59, 1, 8465, 105, 110, 101, 59, 1, 8464, 97, 114, 116, 59, 1, 8465, 104, 59, 1, 305, 102, 59, 1, 8887, 101, 100, 59, 1, 437, 4, 5, 59, 99, 102, 111, 116, 11113, 11115, 11121, 11136, 11142, 1, 8712, 97, 114, 101, 59, 1, 8453, 105, 110, 4, 2, 59, 116, 11129, 11131, 1, 8734, 105, 101, 59, 1, 10717, 100, 111, 116, 59, 1, 305, 4, 5, 59, 99, 101, 108, 112, 11154, 11156, 11161, 11179, 11186, 1, 8747, 97, 108, 59, 1, 8890, 4, 2, 103, 114, 11167, 11173, 101, 114, 115, 59, 1, 8484, 99, 97, 108, 59, 1, 8890, 97, 114, 104, 107, 59, 1, 10775, 114, 111, 100, 59, 1, 10812, 4, 4, 99, 103, 112, 116, 11202, 11206, 11211, 11216, 121, 59, 1, 1105, 111, 110, 59, 1, 303, 102, 59, 3, 55349, 56666, 97, 59, 1, 953, 114, 111, 100, 59, 1, 10812, 117, 101, 115, 116, 5, 191, 1, 59, 11235, 1, 191, 4, 2, 99, 105, 11243, 11248, 114, 59, 3, 55349, 56510, 110, 4, 5, 59, 69, 100, 115, 118, 11261, 11263, 11266, 11271, 11282, 1, 8712, 59, 1, 8953, 111, 116, 59, 1, 8949, 4, 2, 59, 118, 11277, 11279, 1, 8948, 59, 1, 8947, 59, 1, 8712, 4, 2, 59, 105, 11291, 11293, 1, 8290, 108, 100, 101, 59, 1, 297, 4, 2, 107, 109, 11305, 11310, 99, 121, 59, 1, 1110, 108, 5, 239, 1, 59, 11316, 1, 239, 4, 6, 99, 102, 109, 111, 115, 117, 11332, 11346, 11351, 11357, 11363, 11380, 4, 2, 105, 121, 11338, 11343, 114, 99, 59, 1, 309, 59, 1, 1081, 114, 59, 3, 55349, 56615, 97, 116, 104, 59, 1, 567, 112, 102, 59, 3, 55349, 56667, 4, 2, 99, 101, 11369, 11374, 114, 59, 3, 55349, 56511, 114, 99, 121, 59, 1, 1112, 107, 99, 121, 59, 1, 1108, 4, 8, 97, 99, 102, 103, 104, 106, 111, 115, 11404, 11418, 11433, 11438, 11445, 11450, 11455, 11461, 112, 112, 97, 4, 2, 59, 118, 11413, 11415, 1, 954, 59, 1, 1008, 4, 2, 101, 121, 11424, 11430, 100, 105, 108, 59, 1, 311, 59, 1, 1082, 114, 59, 3, 55349, 56616, 114, 101, 101, 110, 59, 1, 312, 99, 121, 59, 1, 1093, 99, 121, 59, 1, 1116, 112, 102, 59, 3, 55349, 56668, 99, 114, 59, 3, 55349, 56512, 4, 23, 65, 66, 69, 72, 97, 98, 99, 100, 101, 102, 103, 104, 106, 108, 109, 110, 111, 112, 114, 115, 116, 117, 118, 11515, 11538, 11544, 11555, 11560, 11721, 11780, 11818, 11868, 12136, 12160, 12171, 12203, 12208, 12246, 12275, 12327, 12509, 12523, 12569, 12641, 12732, 12752, 4, 3, 97, 114, 116, 11523, 11528, 11532, 114, 114, 59, 1, 8666, 114, 59, 1, 8656, 97, 105, 108, 59, 1, 10523, 97, 114, 114, 59, 1, 10510, 4, 2, 59, 103, 11550, 11552, 1, 8806, 59, 1, 10891, 97, 114, 59, 1, 10594, 4, 9, 99, 101, 103, 109, 110, 112, 113, 114, 116, 11580, 11586, 11594, 11600, 11606, 11624, 11627, 11636, 11694, 117, 116, 101, 59, 1, 314, 109, 112, 116, 121, 118, 59, 1, 10676, 114, 97, 110, 59, 1, 8466, 98, 100, 97, 59, 1, 955, 103, 4, 3, 59, 100, 108, 11615, 11617, 11620, 1, 10216, 59, 1, 10641, 101, 59, 1, 10216, 59, 1, 10885, 117, 111, 5, 171, 1, 59, 11634, 1, 171, 114, 4, 8, 59, 98, 102, 104, 108, 112, 115, 116, 11655, 11657, 11669, 11673, 11677, 11681, 11685, 11690, 1, 8592, 4, 2, 59, 102, 11663, 11665, 1, 8676, 115, 59, 1, 10527, 115, 59, 1, 10525, 107, 59, 1, 8617, 112, 59, 1, 8619, 108, 59, 1, 10553, 105, 109, 59, 1, 10611, 108, 59, 1, 8610, 4, 3, 59, 97, 101, 11702, 11704, 11709, 1, 10923, 105, 108, 59, 1, 10521, 4, 2, 59, 115, 11715, 11717, 1, 10925, 59, 3, 10925, 65024, 4, 3, 97, 98, 114, 11729, 11734, 11739, 114, 114, 59, 1, 10508, 114, 107, 59, 1, 10098, 4, 2, 97, 107, 11745, 11758, 99, 4, 2, 101, 107, 11752, 11755, 59, 1, 123, 59, 1, 91, 4, 2, 101, 115, 11764, 11767, 59, 1, 10635, 108, 4, 2, 100, 117, 11774, 11777, 59, 1, 10639, 59, 1, 10637, 4, 4, 97, 101, 117, 121, 11790, 11796, 11811, 11815, 114, 111, 110, 59, 1, 318, 4, 2, 100, 105, 11802, 11807, 105, 108, 59, 1, 316, 108, 59, 1, 8968, 98, 59, 1, 123, 59, 1, 1083, 4, 4, 99, 113, 114, 115, 11828, 11832, 11845, 11864, 97, 59, 1, 10550, 117, 111, 4, 2, 59, 114, 11840, 11842, 1, 8220, 59, 1, 8222, 4, 2, 100, 117, 11851, 11857, 104, 97, 114, 59, 1, 10599, 115, 104, 97, 114, 59, 1, 10571, 104, 59, 1, 8626, 4, 5, 59, 102, 103, 113, 115, 11880, 11882, 12008, 12011, 12031, 1, 8804, 116, 4, 5, 97, 104, 108, 114, 116, 11895, 11913, 11935, 11947, 11996, 114, 114, 111, 119, 4, 2, 59, 116, 11905, 11907, 1, 8592, 97, 105, 108, 59, 1, 8610, 97, 114, 112, 111, 111, 110, 4, 2, 100, 117, 11925, 11931, 111, 119, 110, 59, 1, 8637, 112, 59, 1, 8636, 101, 102, 116, 97, 114, 114, 111, 119, 115, 59, 1, 8647, 105, 103, 104, 116, 4, 3, 97, 104, 115, 11959, 11974, 11984, 114, 114, 111, 119, 4, 2, 59, 115, 11969, 11971, 1, 8596, 59, 1, 8646, 97, 114, 112, 111, 111, 110, 115, 59, 1, 8651, 113, 117, 105, 103, 97, 114, 114, 111, 119, 59, 1, 8621, 104, 114, 101, 101, 116, 105, 109, 101, 115, 59, 1, 8907, 59, 1, 8922, 4, 3, 59, 113, 115, 12019, 12021, 12024, 1, 8804, 59, 1, 8806, 108, 97, 110, 116, 59, 1, 10877, 4, 5, 59, 99, 100, 103, 115, 12043, 12045, 12049, 12070, 12083, 1, 10877, 99, 59, 1, 10920, 111, 116, 4, 2, 59, 111, 12057, 12059, 1, 10879, 4, 2, 59, 114, 12065, 12067, 1, 10881, 59, 1, 10883, 4, 2, 59, 101, 12076, 12079, 3, 8922, 65024, 115, 59, 1, 10899, 4, 5, 97, 100, 101, 103, 115, 12095, 12103, 12108, 12126, 12131, 112, 112, 114, 111, 120, 59, 1, 10885, 111, 116, 59, 1, 8918, 113, 4, 2, 103, 113, 12115, 12120, 116, 114, 59, 1, 8922, 103, 116, 114, 59, 1, 10891, 116, 114, 59, 1, 8822, 105, 109, 59, 1, 8818, 4, 3, 105, 108, 114, 12144, 12150, 12156, 115, 104, 116, 59, 1, 10620, 111, 111, 114, 59, 1, 8970, 59, 3, 55349, 56617, 4, 2, 59, 69, 12166, 12168, 1, 8822, 59, 1, 10897, 4, 2, 97, 98, 12177, 12198, 114, 4, 2, 100, 117, 12184, 12187, 59, 1, 8637, 4, 2, 59, 108, 12193, 12195, 1, 8636, 59, 1, 10602, 108, 107, 59, 1, 9604, 99, 121, 59, 1, 1113, 4, 5, 59, 97, 99, 104, 116, 12220, 12222, 12227, 12235, 12241, 1, 8810, 114, 114, 59, 1, 8647, 111, 114, 110, 101, 114, 59, 1, 8990, 97, 114, 100, 59, 1, 10603, 114, 105, 59, 1, 9722, 4, 2, 105, 111, 12252, 12258, 100, 111, 116, 59, 1, 320, 117, 115, 116, 4, 2, 59, 97, 12267, 12269, 1, 9136, 99, 104, 101, 59, 1, 9136, 4, 4, 69, 97, 101, 115, 12285, 12288, 12303, 12322, 59, 1, 8808, 112, 4, 2, 59, 112, 12295, 12297, 1, 10889, 114, 111, 120, 59, 1, 10889, 4, 2, 59, 113, 12309, 12311, 1, 10887, 4, 2, 59, 113, 12317, 12319, 1, 10887, 59, 1, 8808, 105, 109, 59, 1, 8934, 4, 8, 97, 98, 110, 111, 112, 116, 119, 122, 12345, 12359, 12364, 12421, 12446, 12467, 12474, 12490, 4, 2, 110, 114, 12351, 12355, 103, 59, 1, 10220, 114, 59, 1, 8701, 114, 107, 59, 1, 10214, 103, 4, 3, 108, 109, 114, 12373, 12401, 12409, 101, 102, 116, 4, 2, 97, 114, 12382, 12389, 114, 114, 111, 119, 59, 1, 10229, 105, 103, 104, 116, 97, 114, 114, 111, 119, 59, 1, 10231, 97, 112, 115, 116, 111, 59, 1, 10236, 105, 103, 104, 116, 97, 114, 114, 111, 119, 59, 1, 10230, 112, 97, 114, 114, 111, 119, 4, 2, 108, 114, 12433, 12439, 101, 102, 116, 59, 1, 8619, 105, 103, 104, 116, 59, 1, 8620, 4, 3, 97, 102, 108, 12454, 12458, 12462, 114, 59, 1, 10629, 59, 3, 55349, 56669, 117, 115, 59, 1, 10797, 105, 109, 101, 115, 59, 1, 10804, 4, 2, 97, 98, 12480, 12485, 115, 116, 59, 1, 8727, 97, 114, 59, 1, 95, 4, 3, 59, 101, 102, 12498, 12500, 12506, 1, 9674, 110, 103, 101, 59, 1, 9674, 59, 1, 10731, 97, 114, 4, 2, 59, 108, 12517, 12519, 1, 40, 116, 59, 1, 10643, 4, 5, 97, 99, 104, 109, 116, 12535, 12540, 12548, 12561, 12564, 114, 114, 59, 1, 8646, 111, 114, 110, 101, 114, 59, 1, 8991, 97, 114, 4, 2, 59, 100, 12556, 12558, 1, 8651, 59, 1, 10605, 59, 1, 8206, 114, 105, 59, 1, 8895, 4, 6, 97, 99, 104, 105, 113, 116, 12583, 12589, 12594, 12597, 12614, 12635, 113, 117, 111, 59, 1, 8249, 114, 59, 3, 55349, 56513, 59, 1, 8624, 109, 4, 3, 59, 101, 103, 12606, 12608, 12611, 1, 8818, 59, 1, 10893, 59, 1, 10895, 4, 2, 98, 117, 12620, 12623, 59, 1, 91, 111, 4, 2, 59, 114, 12630, 12632, 1, 8216, 59, 1, 8218, 114, 111, 107, 59, 1, 322, 5, 60, 8, 59, 99, 100, 104, 105, 108, 113, 114, 12660, 12662, 12675, 12680, 12686, 12692, 12698, 12705, 1, 60, 4, 2, 99, 105, 12668, 12671, 59, 1, 10918, 114, 59, 1, 10873, 111, 116, 59, 1, 8918, 114, 101, 101, 59, 1, 8907, 109, 101, 115, 59, 1, 8905, 97, 114, 114, 59, 1, 10614, 117, 101, 115, 116, 59, 1, 10875, 4, 2, 80, 105, 12711, 12716, 97, 114, 59, 1, 10646, 4, 3, 59, 101, 102, 12724, 12726, 12729, 1, 9667, 59, 1, 8884, 59, 1, 9666, 114, 4, 2, 100, 117, 12739, 12746, 115, 104, 97, 114, 59, 1, 10570, 104, 97, 114, 59, 1, 10598, 4, 2, 101, 110, 12758, 12768, 114, 116, 110, 101, 113, 113, 59, 3, 8808, 65024, 69, 59, 3, 8808, 65024, 4, 14, 68, 97, 99, 100, 101, 102, 104, 105, 108, 110, 111, 112, 115, 117, 12803, 12809, 12893, 12908, 12914, 12928, 12933, 12937, 13011, 13025, 13032, 13049, 13052, 13069, 68, 111, 116, 59, 1, 8762, 4, 4, 99, 108, 112, 114, 12819, 12827, 12849, 12887, 114, 5, 175, 1, 59, 12825, 1, 175, 4, 2, 101, 116, 12833, 12836, 59, 1, 9794, 4, 2, 59, 101, 12842, 12844, 1, 10016, 115, 101, 59, 1, 10016, 4, 2, 59, 115, 12855, 12857, 1, 8614, 116, 111, 4, 4, 59, 100, 108, 117, 12869, 12871, 12877, 12883, 1, 8614, 111, 119, 110, 59, 1, 8615, 101, 102, 116, 59, 1, 8612, 112, 59, 1, 8613, 107, 101, 114, 59, 1, 9646, 4, 2, 111, 121, 12899, 12905, 109, 109, 97, 59, 1, 10793, 59, 1, 1084, 97, 115, 104, 59, 1, 8212, 97, 115, 117, 114, 101, 100, 97, 110, 103, 108, 101, 59, 1, 8737, 114, 59, 3, 55349, 56618, 111, 59, 1, 8487, 4, 3, 99, 100, 110, 12945, 12954, 12985, 114, 111, 5, 181, 1, 59, 12952, 1, 181, 4, 4, 59, 97, 99, 100, 12964, 12966, 12971, 12976, 1, 8739, 115, 116, 59, 1, 42, 105, 114, 59, 1, 10992, 111, 116, 5, 183, 1, 59, 12983, 1, 183, 117, 115, 4, 3, 59, 98, 100, 12995, 12997, 13e3, 1, 8722, 59, 1, 8863, 4, 2, 59, 117, 13006, 13008, 1, 8760, 59, 1, 10794, 4, 2, 99, 100, 13017, 13021, 112, 59, 1, 10971, 114, 59, 1, 8230, 112, 108, 117, 115, 59, 1, 8723, 4, 2, 100, 112, 13038, 13044, 101, 108, 115, 59, 1, 8871, 102, 59, 3, 55349, 56670, 59, 1, 8723, 4, 2, 99, 116, 13058, 13063, 114, 59, 3, 55349, 56514, 112, 111, 115, 59, 1, 8766, 4, 3, 59, 108, 109, 13077, 13079, 13087, 1, 956, 116, 105, 109, 97, 112, 59, 1, 8888, 97, 112, 59, 1, 8888, 4, 24, 71, 76, 82, 86, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 108, 109, 111, 112, 114, 115, 116, 117, 118, 119, 13142, 13165, 13217, 13229, 13247, 13330, 13359, 13414, 13420, 13508, 13513, 13579, 13602, 13626, 13631, 13762, 13767, 13855, 13936, 13995, 14214, 14285, 14312, 14432, 4, 2, 103, 116, 13148, 13152, 59, 3, 8921, 824, 4, 2, 59, 118, 13158, 13161, 3, 8811, 8402, 59, 3, 8811, 824, 4, 3, 101, 108, 116, 13173, 13200, 13204, 102, 116, 4, 2, 97, 114, 13181, 13188, 114, 114, 111, 119, 59, 1, 8653, 105, 103, 104, 116, 97, 114, 114, 111, 119, 59, 1, 8654, 59, 3, 8920, 824, 4, 2, 59, 118, 13210, 13213, 3, 8810, 8402, 59, 3, 8810, 824, 105, 103, 104, 116, 97, 114, 114, 111, 119, 59, 1, 8655, 4, 2, 68, 100, 13235, 13241, 97, 115, 104, 59, 1, 8879, 97, 115, 104, 59, 1, 8878, 4, 5, 98, 99, 110, 112, 116, 13259, 13264, 13270, 13275, 13308, 108, 97, 59, 1, 8711, 117, 116, 101, 59, 1, 324, 103, 59, 3, 8736, 8402, 4, 5, 59, 69, 105, 111, 112, 13287, 13289, 13293, 13298, 13302, 1, 8777, 59, 3, 10864, 824, 100, 59, 3, 8779, 824, 115, 59, 1, 329, 114, 111, 120, 59, 1, 8777, 117, 114, 4, 2, 59, 97, 13316, 13318, 1, 9838, 108, 4, 2, 59, 115, 13325, 13327, 1, 9838, 59, 1, 8469, 4, 2, 115, 117, 13336, 13344, 112, 5, 160, 1, 59, 13342, 1, 160, 109, 112, 4, 2, 59, 101, 13352, 13355, 3, 8782, 824, 59, 3, 8783, 824, 4, 5, 97, 101, 111, 117, 121, 13371, 13385, 13391, 13407, 13411, 4, 2, 112, 114, 13377, 13380, 59, 1, 10819, 111, 110, 59, 1, 328, 100, 105, 108, 59, 1, 326, 110, 103, 4, 2, 59, 100, 13399, 13401, 1, 8775, 111, 116, 59, 3, 10861, 824, 112, 59, 1, 10818, 59, 1, 1085, 97, 115, 104, 59, 1, 8211, 4, 7, 59, 65, 97, 100, 113, 115, 120, 13436, 13438, 13443, 13466, 13472, 13478, 13494, 1, 8800, 114, 114, 59, 1, 8663, 114, 4, 2, 104, 114, 13450, 13454, 107, 59, 1, 10532, 4, 2, 59, 111, 13460, 13462, 1, 8599, 119, 59, 1, 8599, 111, 116, 59, 3, 8784, 824, 117, 105, 118, 59, 1, 8802, 4, 2, 101, 105, 13484, 13489, 97, 114, 59, 1, 10536, 109, 59, 3, 8770, 824, 105, 115, 116, 4, 2, 59, 115, 13503, 13505, 1, 8708, 59, 1, 8708, 114, 59, 3, 55349, 56619, 4, 4, 69, 101, 115, 116, 13523, 13527, 13563, 13568, 59, 3, 8807, 824, 4, 3, 59, 113, 115, 13535, 13537, 13559, 1, 8817, 4, 3, 59, 113, 115, 13545, 13547, 13551, 1, 8817, 59, 3, 8807, 824, 108, 97, 110, 116, 59, 3, 10878, 824, 59, 3, 10878, 824, 105, 109, 59, 1, 8821, 4, 2, 59, 114, 13574, 13576, 1, 8815, 59, 1, 8815, 4, 3, 65, 97, 112, 13587, 13592, 13597, 114, 114, 59, 1, 8654, 114, 114, 59, 1, 8622, 97, 114, 59, 1, 10994, 4, 3, 59, 115, 118, 13610, 13612, 13623, 1, 8715, 4, 2, 59, 100, 13618, 13620, 1, 8956, 59, 1, 8954, 59, 1, 8715, 99, 121, 59, 1, 1114, 4, 7, 65, 69, 97, 100, 101, 115, 116, 13647, 13652, 13656, 13661, 13665, 13737, 13742, 114, 114, 59, 1, 8653, 59, 3, 8806, 824, 114, 114, 59, 1, 8602, 114, 59, 1, 8229, 4, 4, 59, 102, 113, 115, 13675, 13677, 13703, 13725, 1, 8816, 116, 4, 2, 97, 114, 13684, 13691, 114, 114, 111, 119, 59, 1, 8602, 105, 103, 104, 116, 97, 114, 114, 111, 119, 59, 1, 8622, 4, 3, 59, 113, 115, 13711, 13713, 13717, 1, 8816, 59, 3, 8806, 824, 108, 97, 110, 116, 59, 3, 10877, 824, 4, 2, 59, 115, 13731, 13734, 3, 10877, 824, 59, 1, 8814, 105, 109, 59, 1, 8820, 4, 2, 59, 114, 13748, 13750, 1, 8814, 105, 4, 2, 59, 101, 13757, 13759, 1, 8938, 59, 1, 8940, 105, 100, 59, 1, 8740, 4, 2, 112, 116, 13773, 13778, 102, 59, 3, 55349, 56671, 5, 172, 3, 59, 105, 110, 13787, 13789, 13829, 1, 172, 110, 4, 4, 59, 69, 100, 118, 13800, 13802, 13806, 13812, 1, 8713, 59, 3, 8953, 824, 111, 116, 59, 3, 8949, 824, 4, 3, 97, 98, 99, 13820, 13823, 13826, 59, 1, 8713, 59, 1, 8951, 59, 1, 8950, 105, 4, 2, 59, 118, 13836, 13838, 1, 8716, 4, 3, 97, 98, 99, 13846, 13849, 13852, 59, 1, 8716, 59, 1, 8958, 59, 1, 8957, 4, 3, 97, 111, 114, 13863, 13892, 13899, 114, 4, 4, 59, 97, 115, 116, 13874, 13876, 13883, 13888, 1, 8742, 108, 108, 101, 108, 59, 1, 8742, 108, 59, 3, 11005, 8421, 59, 3, 8706, 824, 108, 105, 110, 116, 59, 1, 10772, 4, 3, 59, 99, 101, 13907, 13909, 13914, 1, 8832, 117, 101, 59, 1, 8928, 4, 2, 59, 99, 13920, 13923, 3, 10927, 824, 4, 2, 59, 101, 13929, 13931, 1, 8832, 113, 59, 3, 10927, 824, 4, 4, 65, 97, 105, 116, 13946, 13951, 13971, 13982, 114, 114, 59, 1, 8655, 114, 114, 4, 3, 59, 99, 119, 13961, 13963, 13967, 1, 8603, 59, 3, 10547, 824, 59, 3, 8605, 824, 103, 104, 116, 97, 114, 114, 111, 119, 59, 1, 8603, 114, 105, 4, 2, 59, 101, 13990, 13992, 1, 8939, 59, 1, 8941, 4, 7, 99, 104, 105, 109, 112, 113, 117, 14011, 14036, 14060, 14080, 14085, 14090, 14106, 4, 4, 59, 99, 101, 114, 14021, 14023, 14028, 14032, 1, 8833, 117, 101, 59, 1, 8929, 59, 3, 10928, 824, 59, 3, 55349, 56515, 111, 114, 116, 4, 2, 109, 112, 14045, 14050, 105, 100, 59, 1, 8740, 97, 114, 97, 108, 108, 101, 108, 59, 1, 8742, 109, 4, 2, 59, 101, 14067, 14069, 1, 8769, 4, 2, 59, 113, 14075, 14077, 1, 8772, 59, 1, 8772, 105, 100, 59, 1, 8740, 97, 114, 59, 1, 8742, 115, 117, 4, 2, 98, 112, 14098, 14102, 101, 59, 1, 8930, 101, 59, 1, 8931, 4, 3, 98, 99, 112, 14114, 14157, 14171, 4, 4, 59, 69, 101, 115, 14124, 14126, 14130, 14133, 1, 8836, 59, 3, 10949, 824, 59, 1, 8840, 101, 116, 4, 2, 59, 101, 14141, 14144, 3, 8834, 8402, 113, 4, 2, 59, 113, 14151, 14153, 1, 8840, 59, 3, 10949, 824, 99, 4, 2, 59, 101, 14164, 14166, 1, 8833, 113, 59, 3, 10928, 824, 4, 4, 59, 69, 101, 115, 14181, 14183, 14187, 14190, 1, 8837, 59, 3, 10950, 824, 59, 1, 8841, 101, 116, 4, 2, 59, 101, 14198, 14201, 3, 8835, 8402, 113, 4, 2, 59, 113, 14208, 14210, 1, 8841, 59, 3, 10950, 824, 4, 4, 103, 105, 108, 114, 14224, 14228, 14238, 14242, 108, 59, 1, 8825, 108, 100, 101, 5, 241, 1, 59, 14236, 1, 241, 103, 59, 1, 8824, 105, 97, 110, 103, 108, 101, 4, 2, 108, 114, 14254, 14269, 101, 102, 116, 4, 2, 59, 101, 14263, 14265, 1, 8938, 113, 59, 1, 8940, 105, 103, 104, 116, 4, 2, 59, 101, 14279, 14281, 1, 8939, 113, 59, 1, 8941, 4, 2, 59, 109, 14291, 14293, 1, 957, 4, 3, 59, 101, 115, 14301, 14303, 14308, 1, 35, 114, 111, 59, 1, 8470, 112, 59, 1, 8199, 4, 9, 68, 72, 97, 100, 103, 105, 108, 114, 115, 14332, 14338, 14344, 14349, 14355, 14369, 14376, 14408, 14426, 97, 115, 104, 59, 1, 8877, 97, 114, 114, 59, 1, 10500, 112, 59, 3, 8781, 8402, 97, 115, 104, 59, 1, 8876, 4, 2, 101, 116, 14361, 14365, 59, 3, 8805, 8402, 59, 3, 62, 8402, 110, 102, 105, 110, 59, 1, 10718, 4, 3, 65, 101, 116, 14384, 14389, 14393, 114, 114, 59, 1, 10498, 59, 3, 8804, 8402, 4, 2, 59, 114, 14399, 14402, 3, 60, 8402, 105, 101, 59, 3, 8884, 8402, 4, 2, 65, 116, 14414, 14419, 114, 114, 59, 1, 10499, 114, 105, 101, 59, 3, 8885, 8402, 105, 109, 59, 3, 8764, 8402, 4, 3, 65, 97, 110, 14440, 14445, 14468, 114, 114, 59, 1, 8662, 114, 4, 2, 104, 114, 14452, 14456, 107, 59, 1, 10531, 4, 2, 59, 111, 14462, 14464, 1, 8598, 119, 59, 1, 8598, 101, 97, 114, 59, 1, 10535, 4, 18, 83, 97, 99, 100, 101, 102, 103, 104, 105, 108, 109, 111, 112, 114, 115, 116, 117, 118, 14512, 14515, 14535, 14560, 14597, 14603, 14618, 14643, 14657, 14662, 14701, 14741, 14747, 14769, 14851, 14877, 14907, 14916, 59, 1, 9416, 4, 2, 99, 115, 14521, 14531, 117, 116, 101, 5, 243, 1, 59, 14529, 1, 243, 116, 59, 1, 8859, 4, 2, 105, 121, 14541, 14557, 114, 4, 2, 59, 99, 14548, 14550, 1, 8858, 5, 244, 1, 59, 14555, 1, 244, 59, 1, 1086, 4, 5, 97, 98, 105, 111, 115, 14572, 14577, 14583, 14587, 14591, 115, 104, 59, 1, 8861, 108, 97, 99, 59, 1, 337, 118, 59, 1, 10808, 116, 59, 1, 8857, 111, 108, 100, 59, 1, 10684, 108, 105, 103, 59, 1, 339, 4, 2, 99, 114, 14609, 14614, 105, 114, 59, 1, 10687, 59, 3, 55349, 56620, 4, 3, 111, 114, 116, 14626, 14630, 14640, 110, 59, 1, 731, 97, 118, 101, 5, 242, 1, 59, 14638, 1, 242, 59, 1, 10689, 4, 2, 98, 109, 14649, 14654, 97, 114, 59, 1, 10677, 59, 1, 937, 110, 116, 59, 1, 8750, 4, 4, 97, 99, 105, 116, 14672, 14677, 14693, 14698, 114, 114, 59, 1, 8634, 4, 2, 105, 114, 14683, 14687, 114, 59, 1, 10686, 111, 115, 115, 59, 1, 10683, 110, 101, 59, 1, 8254, 59, 1, 10688, 4, 3, 97, 101, 105, 14709, 14714, 14719, 99, 114, 59, 1, 333, 103, 97, 59, 1, 969, 4, 3, 99, 100, 110, 14727, 14733, 14736, 114, 111, 110, 59, 1, 959, 59, 1, 10678, 117, 115, 59, 1, 8854, 112, 102, 59, 3, 55349, 56672, 4, 3, 97, 101, 108, 14755, 14759, 14764, 114, 59, 1, 10679, 114, 112, 59, 1, 10681, 117, 115, 59, 1, 8853, 4, 7, 59, 97, 100, 105, 111, 115, 118, 14785, 14787, 14792, 14831, 14837, 14841, 14848, 1, 8744, 114, 114, 59, 1, 8635, 4, 4, 59, 101, 102, 109, 14802, 14804, 14817, 14824, 1, 10845, 114, 4, 2, 59, 111, 14811, 14813, 1, 8500, 102, 59, 1, 8500, 5, 170, 1, 59, 14822, 1, 170, 5, 186, 1, 59, 14829, 1, 186, 103, 111, 102, 59, 1, 8886, 114, 59, 1, 10838, 108, 111, 112, 101, 59, 1, 10839, 59, 1, 10843, 4, 3, 99, 108, 111, 14859, 14863, 14873, 114, 59, 1, 8500, 97, 115, 104, 5, 248, 1, 59, 14871, 1, 248, 108, 59, 1, 8856, 105, 4, 2, 108, 109, 14884, 14893, 100, 101, 5, 245, 1, 59, 14891, 1, 245, 101, 115, 4, 2, 59, 97, 14901, 14903, 1, 8855, 115, 59, 1, 10806, 109, 108, 5, 246, 1, 59, 14914, 1, 246, 98, 97, 114, 59, 1, 9021, 4, 12, 97, 99, 101, 102, 104, 105, 108, 109, 111, 114, 115, 117, 14948, 14992, 14996, 15033, 15038, 15068, 15090, 15189, 15192, 15222, 15427, 15441, 114, 4, 4, 59, 97, 115, 116, 14959, 14961, 14976, 14989, 1, 8741, 5, 182, 2, 59, 108, 14968, 14970, 1, 182, 108, 101, 108, 59, 1, 8741, 4, 2, 105, 108, 14982, 14986, 109, 59, 1, 10995, 59, 1, 11005, 59, 1, 8706, 121, 59, 1, 1087, 114, 4, 5, 99, 105, 109, 112, 116, 15009, 15014, 15019, 15024, 15027, 110, 116, 59, 1, 37, 111, 100, 59, 1, 46, 105, 108, 59, 1, 8240, 59, 1, 8869, 101, 110, 107, 59, 1, 8241, 114, 59, 3, 55349, 56621, 4, 3, 105, 109, 111, 15046, 15057, 15063, 4, 2, 59, 118, 15052, 15054, 1, 966, 59, 1, 981, 109, 97, 116, 59, 1, 8499, 110, 101, 59, 1, 9742, 4, 3, 59, 116, 118, 15076, 15078, 15087, 1, 960, 99, 104, 102, 111, 114, 107, 59, 1, 8916, 59, 1, 982, 4, 2, 97, 117, 15096, 15119, 110, 4, 2, 99, 107, 15103, 15115, 107, 4, 2, 59, 104, 15110, 15112, 1, 8463, 59, 1, 8462, 118, 59, 1, 8463, 115, 4, 9, 59, 97, 98, 99, 100, 101, 109, 115, 116, 15140, 15142, 15148, 15151, 15156, 15168, 15171, 15179, 15184, 1, 43, 99, 105, 114, 59, 1, 10787, 59, 1, 8862, 105, 114, 59, 1, 10786, 4, 2, 111, 117, 15162, 15165, 59, 1, 8724, 59, 1, 10789, 59, 1, 10866, 110, 5, 177, 1, 59, 15177, 1, 177, 105, 109, 59, 1, 10790, 119, 111, 59, 1, 10791, 59, 1, 177, 4, 3, 105, 112, 117, 15200, 15208, 15213, 110, 116, 105, 110, 116, 59, 1, 10773, 102, 59, 3, 55349, 56673, 110, 100, 5, 163, 1, 59, 15220, 1, 163, 4, 10, 59, 69, 97, 99, 101, 105, 110, 111, 115, 117, 15244, 15246, 15249, 15253, 15258, 15334, 15347, 15367, 15416, 15421, 1, 8826, 59, 1, 10931, 112, 59, 1, 10935, 117, 101, 59, 1, 8828, 4, 2, 59, 99, 15264, 15266, 1, 10927, 4, 6, 59, 97, 99, 101, 110, 115, 15280, 15282, 15290, 15299, 15303, 15329, 1, 8826, 112, 112, 114, 111, 120, 59, 1, 10935, 117, 114, 108, 121, 101, 113, 59, 1, 8828, 113, 59, 1, 10927, 4, 3, 97, 101, 115, 15311, 15319, 15324, 112, 112, 114, 111, 120, 59, 1, 10937, 113, 113, 59, 1, 10933, 105, 109, 59, 1, 8936, 105, 109, 59, 1, 8830, 109, 101, 4, 2, 59, 115, 15342, 15344, 1, 8242, 59, 1, 8473, 4, 3, 69, 97, 115, 15355, 15358, 15362, 59, 1, 10933, 112, 59, 1, 10937, 105, 109, 59, 1, 8936, 4, 3, 100, 102, 112, 15375, 15378, 15404, 59, 1, 8719, 4, 3, 97, 108, 115, 15386, 15392, 15398, 108, 97, 114, 59, 1, 9006, 105, 110, 101, 59, 1, 8978, 117, 114, 102, 59, 1, 8979, 4, 2, 59, 116, 15410, 15412, 1, 8733, 111, 59, 1, 8733, 105, 109, 59, 1, 8830, 114, 101, 108, 59, 1, 8880, 4, 2, 99, 105, 15433, 15438, 114, 59, 3, 55349, 56517, 59, 1, 968, 110, 99, 115, 112, 59, 1, 8200, 4, 6, 102, 105, 111, 112, 115, 117, 15462, 15467, 15472, 15478, 15485, 15491, 114, 59, 3, 55349, 56622, 110, 116, 59, 1, 10764, 112, 102, 59, 3, 55349, 56674, 114, 105, 109, 101, 59, 1, 8279, 99, 114, 59, 3, 55349, 56518, 4, 3, 97, 101, 111, 15499, 15520, 15534, 116, 4, 2, 101, 105, 15506, 15515, 114, 110, 105, 111, 110, 115, 59, 1, 8461, 110, 116, 59, 1, 10774, 115, 116, 4, 2, 59, 101, 15528, 15530, 1, 63, 113, 59, 1, 8799, 116, 5, 34, 1, 59, 15540, 1, 34, 4, 21, 65, 66, 72, 97, 98, 99, 100, 101, 102, 104, 105, 108, 109, 110, 111, 112, 114, 115, 116, 117, 120, 15586, 15609, 15615, 15620, 15796, 15855, 15893, 15931, 15977, 16001, 16039, 16183, 16204, 16222, 16228, 16285, 16312, 16318, 16363, 16408, 16416, 4, 3, 97, 114, 116, 15594, 15599, 15603, 114, 114, 59, 1, 8667, 114, 59, 1, 8658, 97, 105, 108, 59, 1, 10524, 97, 114, 114, 59, 1, 10511, 97, 114, 59, 1, 10596, 4, 7, 99, 100, 101, 110, 113, 114, 116, 15636, 15651, 15656, 15664, 15687, 15696, 15770, 4, 2, 101, 117, 15642, 15646, 59, 3, 8765, 817, 116, 101, 59, 1, 341, 105, 99, 59, 1, 8730, 109, 112, 116, 121, 118, 59, 1, 10675, 103, 4, 4, 59, 100, 101, 108, 15675, 15677, 15680, 15683, 1, 10217, 59, 1, 10642, 59, 1, 10661, 101, 59, 1, 10217, 117, 111, 5, 187, 1, 59, 15694, 1, 187, 114, 4, 11, 59, 97, 98, 99, 102, 104, 108, 112, 115, 116, 119, 15721, 15723, 15727, 15739, 15742, 15746, 15750, 15754, 15758, 15763, 15767, 1, 8594, 112, 59, 1, 10613, 4, 2, 59, 102, 15733, 15735, 1, 8677, 115, 59, 1, 10528, 59, 1, 10547, 115, 59, 1, 10526, 107, 59, 1, 8618, 112, 59, 1, 8620, 108, 59, 1, 10565, 105, 109, 59, 1, 10612, 108, 59, 1, 8611, 59, 1, 8605, 4, 2, 97, 105, 15776, 15781, 105, 108, 59, 1, 10522, 111, 4, 2, 59, 110, 15788, 15790, 1, 8758, 97, 108, 115, 59, 1, 8474, 4, 3, 97, 98, 114, 15804, 15809, 15814, 114, 114, 59, 1, 10509, 114, 107, 59, 1, 10099, 4, 2, 97, 107, 15820, 15833, 99, 4, 2, 101, 107, 15827, 15830, 59, 1, 125, 59, 1, 93, 4, 2, 101, 115, 15839, 15842, 59, 1, 10636, 108, 4, 2, 100, 117, 15849, 15852, 59, 1, 10638, 59, 1, 10640, 4, 4, 97, 101, 117, 121, 15865, 15871, 15886, 15890, 114, 111, 110, 59, 1, 345, 4, 2, 100, 105, 15877, 15882, 105, 108, 59, 1, 343, 108, 59, 1, 8969, 98, 59, 1, 125, 59, 1, 1088, 4, 4, 99, 108, 113, 115, 15903, 15907, 15914, 15927, 97, 59, 1, 10551, 100, 104, 97, 114, 59, 1, 10601, 117, 111, 4, 2, 59, 114, 15922, 15924, 1, 8221, 59, 1, 8221, 104, 59, 1, 8627, 4, 3, 97, 99, 103, 15939, 15966, 15970, 108, 4, 4, 59, 105, 112, 115, 15950, 15952, 15957, 15963, 1, 8476, 110, 101, 59, 1, 8475, 97, 114, 116, 59, 1, 8476, 59, 1, 8477, 116, 59, 1, 9645, 5, 174, 1, 59, 15975, 1, 174, 4, 3, 105, 108, 114, 15985, 15991, 15997, 115, 104, 116, 59, 1, 10621, 111, 111, 114, 59, 1, 8971, 59, 3, 55349, 56623, 4, 2, 97, 111, 16007, 16028, 114, 4, 2, 100, 117, 16014, 16017, 59, 1, 8641, 4, 2, 59, 108, 16023, 16025, 1, 8640, 59, 1, 10604, 4, 2, 59, 118, 16034, 16036, 1, 961, 59, 1, 1009, 4, 3, 103, 110, 115, 16047, 16167, 16171, 104, 116, 4, 6, 97, 104, 108, 114, 115, 116, 16063, 16081, 16103, 16130, 16143, 16155, 114, 114, 111, 119, 4, 2, 59, 116, 16073, 16075, 1, 8594, 97, 105, 108, 59, 1, 8611, 97, 114, 112, 111, 111, 110, 4, 2, 100, 117, 16093, 16099, 111, 119, 110, 59, 1, 8641, 112, 59, 1, 8640, 101, 102, 116, 4, 2, 97, 104, 16112, 16120, 114, 114, 111, 119, 115, 59, 1, 8644, 97, 114, 112, 111, 111, 110, 115, 59, 1, 8652, 105, 103, 104, 116, 97, 114, 114, 111, 119, 115, 59, 1, 8649, 113, 117, 105, 103, 97, 114, 114, 111, 119, 59, 1, 8605, 104, 114, 101, 101, 116, 105, 109, 101, 115, 59, 1, 8908, 103, 59, 1, 730, 105, 110, 103, 100, 111, 116, 115, 101, 113, 59, 1, 8787, 4, 3, 97, 104, 109, 16191, 16196, 16201, 114, 114, 59, 1, 8644, 97, 114, 59, 1, 8652, 59, 1, 8207, 111, 117, 115, 116, 4, 2, 59, 97, 16214, 16216, 1, 9137, 99, 104, 101, 59, 1, 9137, 109, 105, 100, 59, 1, 10990, 4, 4, 97, 98, 112, 116, 16238, 16252, 16257, 16278, 4, 2, 110, 114, 16244, 16248, 103, 59, 1, 10221, 114, 59, 1, 8702, 114, 107, 59, 1, 10215, 4, 3, 97, 102, 108, 16265, 16269, 16273, 114, 59, 1, 10630, 59, 3, 55349, 56675, 117, 115, 59, 1, 10798, 105, 109, 101, 115, 59, 1, 10805, 4, 2, 97, 112, 16291, 16304, 114, 4, 2, 59, 103, 16298, 16300, 1, 41, 116, 59, 1, 10644, 111, 108, 105, 110, 116, 59, 1, 10770, 97, 114, 114, 59, 1, 8649, 4, 4, 97, 99, 104, 113, 16328, 16334, 16339, 16342, 113, 117, 111, 59, 1, 8250, 114, 59, 3, 55349, 56519, 59, 1, 8625, 4, 2, 98, 117, 16348, 16351, 59, 1, 93, 111, 4, 2, 59, 114, 16358, 16360, 1, 8217, 59, 1, 8217, 4, 3, 104, 105, 114, 16371, 16377, 16383, 114, 101, 101, 59, 1, 8908, 109, 101, 115, 59, 1, 8906, 105, 4, 4, 59, 101, 102, 108, 16394, 16396, 16399, 16402, 1, 9657, 59, 1, 8885, 59, 1, 9656, 116, 114, 105, 59, 1, 10702, 108, 117, 104, 97, 114, 59, 1, 10600, 59, 1, 8478, 4, 19, 97, 98, 99, 100, 101, 102, 104, 105, 108, 109, 111, 112, 113, 114, 115, 116, 117, 119, 122, 16459, 16466, 16472, 16572, 16590, 16672, 16687, 16746, 16844, 16850, 16924, 16963, 16988, 17115, 17121, 17154, 17206, 17614, 17656, 99, 117, 116, 101, 59, 1, 347, 113, 117, 111, 59, 1, 8218, 4, 10, 59, 69, 97, 99, 101, 105, 110, 112, 115, 121, 16494, 16496, 16499, 16513, 16518, 16531, 16536, 16556, 16564, 16569, 1, 8827, 59, 1, 10932, 4, 2, 112, 114, 16505, 16508, 59, 1, 10936, 111, 110, 59, 1, 353, 117, 101, 59, 1, 8829, 4, 2, 59, 100, 16524, 16526, 1, 10928, 105, 108, 59, 1, 351, 114, 99, 59, 1, 349, 4, 3, 69, 97, 115, 16544, 16547, 16551, 59, 1, 10934, 112, 59, 1, 10938, 105, 109, 59, 1, 8937, 111, 108, 105, 110, 116, 59, 1, 10771, 105, 109, 59, 1, 8831, 59, 1, 1089, 111, 116, 4, 3, 59, 98, 101, 16582, 16584, 16587, 1, 8901, 59, 1, 8865, 59, 1, 10854, 4, 7, 65, 97, 99, 109, 115, 116, 120, 16606, 16611, 16634, 16642, 16646, 16652, 16668, 114, 114, 59, 1, 8664, 114, 4, 2, 104, 114, 16618, 16622, 107, 59, 1, 10533, 4, 2, 59, 111, 16628, 16630, 1, 8600, 119, 59, 1, 8600, 116, 5, 167, 1, 59, 16640, 1, 167, 105, 59, 1, 59, 119, 97, 114, 59, 1, 10537, 109, 4, 2, 105, 110, 16659, 16665, 110, 117, 115, 59, 1, 8726, 59, 1, 8726, 116, 59, 1, 10038, 114, 4, 2, 59, 111, 16679, 16682, 3, 55349, 56624, 119, 110, 59, 1, 8994, 4, 4, 97, 99, 111, 121, 16697, 16702, 16716, 16739, 114, 112, 59, 1, 9839, 4, 2, 104, 121, 16708, 16713, 99, 121, 59, 1, 1097, 59, 1, 1096, 114, 116, 4, 2, 109, 112, 16724, 16729, 105, 100, 59, 1, 8739, 97, 114, 97, 108, 108, 101, 108, 59, 1, 8741, 5, 173, 1, 59, 16744, 1, 173, 4, 2, 103, 109, 16752, 16770, 109, 97, 4, 3, 59, 102, 118, 16762, 16764, 16767, 1, 963, 59, 1, 962, 59, 1, 962, 4, 8, 59, 100, 101, 103, 108, 110, 112, 114, 16788, 16790, 16795, 16806, 16817, 16828, 16832, 16838, 1, 8764, 111, 116, 59, 1, 10858, 4, 2, 59, 113, 16801, 16803, 1, 8771, 59, 1, 8771, 4, 2, 59, 69, 16812, 16814, 1, 10910, 59, 1, 10912, 4, 2, 59, 69, 16823, 16825, 1, 10909, 59, 1, 10911, 101, 59, 1, 8774, 108, 117, 115, 59, 1, 10788, 97, 114, 114, 59, 1, 10610, 97, 114, 114, 59, 1, 8592, 4, 4, 97, 101, 105, 116, 16860, 16883, 16891, 16904, 4, 2, 108, 115, 16866, 16878, 108, 115, 101, 116, 109, 105, 110, 117, 115, 59, 1, 8726, 104, 112, 59, 1, 10803, 112, 97, 114, 115, 108, 59, 1, 10724, 4, 2, 100, 108, 16897, 16900, 59, 1, 8739, 101, 59, 1, 8995, 4, 2, 59, 101, 16910, 16912, 1, 10922, 4, 2, 59, 115, 16918, 16920, 1, 10924, 59, 3, 10924, 65024, 4, 3, 102, 108, 112, 16932, 16938, 16958, 116, 99, 121, 59, 1, 1100, 4, 2, 59, 98, 16944, 16946, 1, 47, 4, 2, 59, 97, 16952, 16954, 1, 10692, 114, 59, 1, 9023, 102, 59, 3, 55349, 56676, 97, 4, 2, 100, 114, 16970, 16985, 101, 115, 4, 2, 59, 117, 16978, 16980, 1, 9824, 105, 116, 59, 1, 9824, 59, 1, 8741, 4, 3, 99, 115, 117, 16996, 17028, 17089, 4, 2, 97, 117, 17002, 17015, 112, 4, 2, 59, 115, 17009, 17011, 1, 8851, 59, 3, 8851, 65024, 112, 4, 2, 59, 115, 17022, 17024, 1, 8852, 59, 3, 8852, 65024, 117, 4, 2, 98, 112, 17035, 17062, 4, 3, 59, 101, 115, 17043, 17045, 17048, 1, 8847, 59, 1, 8849, 101, 116, 4, 2, 59, 101, 17056, 17058, 1, 8847, 113, 59, 1, 8849, 4, 3, 59, 101, 115, 17070, 17072, 17075, 1, 8848, 59, 1, 8850, 101, 116, 4, 2, 59, 101, 17083, 17085, 1, 8848, 113, 59, 1, 8850, 4, 3, 59, 97, 102, 17097, 17099, 17112, 1, 9633, 114, 4, 2, 101, 102, 17106, 17109, 59, 1, 9633, 59, 1, 9642, 59, 1, 9642, 97, 114, 114, 59, 1, 8594, 4, 4, 99, 101, 109, 116, 17131, 17136, 17142, 17148, 114, 59, 3, 55349, 56520, 116, 109, 110, 59, 1, 8726, 105, 108, 101, 59, 1, 8995, 97, 114, 102, 59, 1, 8902, 4, 2, 97, 114, 17160, 17172, 114, 4, 2, 59, 102, 17167, 17169, 1, 9734, 59, 1, 9733, 4, 2, 97, 110, 17178, 17202, 105, 103, 104, 116, 4, 2, 101, 112, 17188, 17197, 112, 115, 105, 108, 111, 110, 59, 1, 1013, 104, 105, 59, 1, 981, 115, 59, 1, 175, 4, 5, 98, 99, 109, 110, 112, 17218, 17351, 17420, 17423, 17427, 4, 9, 59, 69, 100, 101, 109, 110, 112, 114, 115, 17238, 17240, 17243, 17248, 17261, 17267, 17279, 17285, 17291, 1, 8834, 59, 1, 10949, 111, 116, 59, 1, 10941, 4, 2, 59, 100, 17254, 17256, 1, 8838, 111, 116, 59, 1, 10947, 117, 108, 116, 59, 1, 10945, 4, 2, 69, 101, 17273, 17276, 59, 1, 10955, 59, 1, 8842, 108, 117, 115, 59, 1, 10943, 97, 114, 114, 59, 1, 10617, 4, 3, 101, 105, 117, 17299, 17335, 17339, 116, 4, 3, 59, 101, 110, 17308, 17310, 17322, 1, 8834, 113, 4, 2, 59, 113, 17317, 17319, 1, 8838, 59, 1, 10949, 101, 113, 4, 2, 59, 113, 17330, 17332, 1, 8842, 59, 1, 10955, 109, 59, 1, 10951, 4, 2, 98, 112, 17345, 17348, 59, 1, 10965, 59, 1, 10963, 99, 4, 6, 59, 97, 99, 101, 110, 115, 17366, 17368, 17376, 17385, 17389, 17415, 1, 8827, 112, 112, 114, 111, 120, 59, 1, 10936, 117, 114, 108, 121, 101, 113, 59, 1, 8829, 113, 59, 1, 10928, 4, 3, 97, 101, 115, 17397, 17405, 17410, 112, 112, 114, 111, 120, 59, 1, 10938, 113, 113, 59, 1, 10934, 105, 109, 59, 1, 8937, 105, 109, 59, 1, 8831, 59, 1, 8721, 103, 59, 1, 9834, 4, 13, 49, 50, 51, 59, 69, 100, 101, 104, 108, 109, 110, 112, 115, 17455, 17462, 17469, 17476, 17478, 17481, 17496, 17509, 17524, 17530, 17536, 17548, 17554, 5, 185, 1, 59, 17460, 1, 185, 5, 178, 1, 59, 17467, 1, 178, 5, 179, 1, 59, 17474, 1, 179, 1, 8835, 59, 1, 10950, 4, 2, 111, 115, 17487, 17491, 116, 59, 1, 10942, 117, 98, 59, 1, 10968, 4, 2, 59, 100, 17502, 17504, 1, 8839, 111, 116, 59, 1, 10948, 115, 4, 2, 111, 117, 17516, 17520, 108, 59, 1, 10185, 98, 59, 1, 10967, 97, 114, 114, 59, 1, 10619, 117, 108, 116, 59, 1, 10946, 4, 2, 69, 101, 17542, 17545, 59, 1, 10956, 59, 1, 8843, 108, 117, 115, 59, 1, 10944, 4, 3, 101, 105, 117, 17562, 17598, 17602, 116, 4, 3, 59, 101, 110, 17571, 17573, 17585, 1, 8835, 113, 4, 2, 59, 113, 17580, 17582, 1, 8839, 59, 1, 10950, 101, 113, 4, 2, 59, 113, 17593, 17595, 1, 8843, 59, 1, 10956, 109, 59, 1, 10952, 4, 2, 98, 112, 17608, 17611, 59, 1, 10964, 59, 1, 10966, 4, 3, 65, 97, 110, 17622, 17627, 17650, 114, 114, 59, 1, 8665, 114, 4, 2, 104, 114, 17634, 17638, 107, 59, 1, 10534, 4, 2, 59, 111, 17644, 17646, 1, 8601, 119, 59, 1, 8601, 119, 97, 114, 59, 1, 10538, 108, 105, 103, 5, 223, 1, 59, 17664, 1, 223, 4, 13, 97, 98, 99, 100, 101, 102, 104, 105, 111, 112, 114, 115, 119, 17694, 17709, 17714, 17737, 17742, 17749, 17754, 17860, 17905, 17957, 17964, 18090, 18122, 4, 2, 114, 117, 17700, 17706, 103, 101, 116, 59, 1, 8982, 59, 1, 964, 114, 107, 59, 1, 9140, 4, 3, 97, 101, 121, 17722, 17728, 17734, 114, 111, 110, 59, 1, 357, 100, 105, 108, 59, 1, 355, 59, 1, 1090, 111, 116, 59, 1, 8411, 108, 114, 101, 99, 59, 1, 8981, 114, 59, 3, 55349, 56625, 4, 4, 101, 105, 107, 111, 17764, 17805, 17836, 17851, 4, 2, 114, 116, 17770, 17786, 101, 4, 2, 52, 102, 17777, 17780, 59, 1, 8756, 111, 114, 101, 59, 1, 8756, 97, 4, 3, 59, 115, 118, 17795, 17797, 17802, 1, 952, 121, 109, 59, 1, 977, 59, 1, 977, 4, 2, 99, 110, 17811, 17831, 107, 4, 2, 97, 115, 17818, 17826, 112, 112, 114, 111, 120, 59, 1, 8776, 105, 109, 59, 1, 8764, 115, 112, 59, 1, 8201, 4, 2, 97, 115, 17842, 17846, 112, 59, 1, 8776, 105, 109, 59, 1, 8764, 114, 110, 5, 254, 1, 59, 17858, 1, 254, 4, 3, 108, 109, 110, 17868, 17873, 17901, 100, 101, 59, 1, 732, 101, 115, 5, 215, 3, 59, 98, 100, 17884, 17886, 17898, 1, 215, 4, 2, 59, 97, 17892, 17894, 1, 8864, 114, 59, 1, 10801, 59, 1, 10800, 116, 59, 1, 8749, 4, 3, 101, 112, 115, 17913, 17917, 17953, 97, 59, 1, 10536, 4, 4, 59, 98, 99, 102, 17927, 17929, 17934, 17939, 1, 8868, 111, 116, 59, 1, 9014, 105, 114, 59, 1, 10993, 4, 2, 59, 111, 17945, 17948, 3, 55349, 56677, 114, 107, 59, 1, 10970, 97, 59, 1, 10537, 114, 105, 109, 101, 59, 1, 8244, 4, 3, 97, 105, 112, 17972, 17977, 18082, 100, 101, 59, 1, 8482, 4, 7, 97, 100, 101, 109, 112, 115, 116, 17993, 18051, 18056, 18059, 18066, 18072, 18076, 110, 103, 108, 101, 4, 5, 59, 100, 108, 113, 114, 18009, 18011, 18017, 18032, 18035, 1, 9653, 111, 119, 110, 59, 1, 9663, 101, 102, 116, 4, 2, 59, 101, 18026, 18028, 1, 9667, 113, 59, 1, 8884, 59, 1, 8796, 105, 103, 104, 116, 4, 2, 59, 101, 18045, 18047, 1, 9657, 113, 59, 1, 8885, 111, 116, 59, 1, 9708, 59, 1, 8796, 105, 110, 117, 115, 59, 1, 10810, 108, 117, 115, 59, 1, 10809, 98, 59, 1, 10701, 105, 109, 101, 59, 1, 10811, 101, 122, 105, 117, 109, 59, 1, 9186, 4, 3, 99, 104, 116, 18098, 18111, 18116, 4, 2, 114, 121, 18104, 18108, 59, 3, 55349, 56521, 59, 1, 1094, 99, 121, 59, 1, 1115, 114, 111, 107, 59, 1, 359, 4, 2, 105, 111, 18128, 18133, 120, 116, 59, 1, 8812, 104, 101, 97, 100, 4, 2, 108, 114, 18143, 18154, 101, 102, 116, 97, 114, 114, 111, 119, 59, 1, 8606, 105, 103, 104, 116, 97, 114, 114, 111, 119, 59, 1, 8608, 4, 18, 65, 72, 97, 98, 99, 100, 102, 103, 104, 108, 109, 111, 112, 114, 115, 116, 117, 119, 18204, 18209, 18214, 18234, 18250, 18268, 18292, 18308, 18319, 18343, 18379, 18397, 18413, 18504, 18547, 18553, 18584, 18603, 114, 114, 59, 1, 8657, 97, 114, 59, 1, 10595, 4, 2, 99, 114, 18220, 18230, 117, 116, 101, 5, 250, 1, 59, 18228, 1, 250, 114, 59, 1, 8593, 114, 4, 2, 99, 101, 18241, 18245, 121, 59, 1, 1118, 118, 101, 59, 1, 365, 4, 2, 105, 121, 18256, 18265, 114, 99, 5, 251, 1, 59, 18263, 1, 251, 59, 1, 1091, 4, 3, 97, 98, 104, 18276, 18281, 18287, 114, 114, 59, 1, 8645, 108, 97, 99, 59, 1, 369, 97, 114, 59, 1, 10606, 4, 2, 105, 114, 18298, 18304, 115, 104, 116, 59, 1, 10622, 59, 3, 55349, 56626, 114, 97, 118, 101, 5, 249, 1, 59, 18317, 1, 249, 4, 2, 97, 98, 18325, 18338, 114, 4, 2, 108, 114, 18332, 18335, 59, 1, 8639, 59, 1, 8638, 108, 107, 59, 1, 9600, 4, 2, 99, 116, 18349, 18374, 4, 2, 111, 114, 18355, 18369, 114, 110, 4, 2, 59, 101, 18363, 18365, 1, 8988, 114, 59, 1, 8988, 111, 112, 59, 1, 8975, 114, 105, 59, 1, 9720, 4, 2, 97, 108, 18385, 18390, 99, 114, 59, 1, 363, 5, 168, 1, 59, 18395, 1, 168, 4, 2, 103, 112, 18403, 18408, 111, 110, 59, 1, 371, 102, 59, 3, 55349, 56678, 4, 6, 97, 100, 104, 108, 115, 117, 18427, 18434, 18445, 18470, 18475, 18494, 114, 114, 111, 119, 59, 1, 8593, 111, 119, 110, 97, 114, 114, 111, 119, 59, 1, 8597, 97, 114, 112, 111, 111, 110, 4, 2, 108, 114, 18457, 18463, 101, 102, 116, 59, 1, 8639, 105, 103, 104, 116, 59, 1, 8638, 117, 115, 59, 1, 8846, 105, 4, 3, 59, 104, 108, 18484, 18486, 18489, 1, 965, 59, 1, 978, 111, 110, 59, 1, 965, 112, 97, 114, 114, 111, 119, 115, 59, 1, 8648, 4, 3, 99, 105, 116, 18512, 18537, 18542, 4, 2, 111, 114, 18518, 18532, 114, 110, 4, 2, 59, 101, 18526, 18528, 1, 8989, 114, 59, 1, 8989, 111, 112, 59, 1, 8974, 110, 103, 59, 1, 367, 114, 105, 59, 1, 9721, 99, 114, 59, 3, 55349, 56522, 4, 3, 100, 105, 114, 18561, 18566, 18572, 111, 116, 59, 1, 8944, 108, 100, 101, 59, 1, 361, 105, 4, 2, 59, 102, 18579, 18581, 1, 9653, 59, 1, 9652, 4, 2, 97, 109, 18590, 18595, 114, 114, 59, 1, 8648, 108, 5, 252, 1, 59, 18601, 1, 252, 97, 110, 103, 108, 101, 59, 1, 10663, 4, 15, 65, 66, 68, 97, 99, 100, 101, 102, 108, 110, 111, 112, 114, 115, 122, 18643, 18648, 18661, 18667, 18847, 18851, 18857, 18904, 18909, 18915, 18931, 18937, 18943, 18949, 18996, 114, 114, 59, 1, 8661, 97, 114, 4, 2, 59, 118, 18656, 18658, 1, 10984, 59, 1, 10985, 97, 115, 104, 59, 1, 8872, 4, 2, 110, 114, 18673, 18679, 103, 114, 116, 59, 1, 10652, 4, 7, 101, 107, 110, 112, 114, 115, 116, 18695, 18704, 18711, 18720, 18742, 18754, 18810, 112, 115, 105, 108, 111, 110, 59, 1, 1013, 97, 112, 112, 97, 59, 1, 1008, 111, 116, 104, 105, 110, 103, 59, 1, 8709, 4, 3, 104, 105, 114, 18728, 18732, 18735, 105, 59, 1, 981, 59, 1, 982, 111, 112, 116, 111, 59, 1, 8733, 4, 2, 59, 104, 18748, 18750, 1, 8597, 111, 59, 1, 1009, 4, 2, 105, 117, 18760, 18766, 103, 109, 97, 59, 1, 962, 4, 2, 98, 112, 18772, 18791, 115, 101, 116, 110, 101, 113, 4, 2, 59, 113, 18784, 18787, 3, 8842, 65024, 59, 3, 10955, 65024, 115, 101, 116, 110, 101, 113, 4, 2, 59, 113, 18803, 18806, 3, 8843, 65024, 59, 3, 10956, 65024, 4, 2, 104, 114, 18816, 18822, 101, 116, 97, 59, 1, 977, 105, 97, 110, 103, 108, 101, 4, 2, 108, 114, 18834, 18840, 101, 102, 116, 59, 1, 8882, 105, 103, 104, 116, 59, 1, 8883, 121, 59, 1, 1074, 97, 115, 104, 59, 1, 8866, 4, 3, 101, 108, 114, 18865, 18884, 18890, 4, 3, 59, 98, 101, 18873, 18875, 18880, 1, 8744, 97, 114, 59, 1, 8891, 113, 59, 1, 8794, 108, 105, 112, 59, 1, 8942, 4, 2, 98, 116, 18896, 18901, 97, 114, 59, 1, 124, 59, 1, 124, 114, 59, 3, 55349, 56627, 116, 114, 105, 59, 1, 8882, 115, 117, 4, 2, 98, 112, 18923, 18927, 59, 3, 8834, 8402, 59, 3, 8835, 8402, 112, 102, 59, 3, 55349, 56679, 114, 111, 112, 59, 1, 8733, 116, 114, 105, 59, 1, 8883, 4, 2, 99, 117, 18955, 18960, 114, 59, 3, 55349, 56523, 4, 2, 98, 112, 18966, 18981, 110, 4, 2, 69, 101, 18973, 18977, 59, 3, 10955, 65024, 59, 3, 8842, 65024, 110, 4, 2, 69, 101, 18988, 18992, 59, 3, 10956, 65024, 59, 3, 8843, 65024, 105, 103, 122, 97, 103, 59, 1, 10650, 4, 7, 99, 101, 102, 111, 112, 114, 115, 19020, 19026, 19061, 19066, 19072, 19075, 19089, 105, 114, 99, 59, 1, 373, 4, 2, 100, 105, 19032, 19055, 4, 2, 98, 103, 19038, 19043, 97, 114, 59, 1, 10847, 101, 4, 2, 59, 113, 19050, 19052, 1, 8743, 59, 1, 8793, 101, 114, 112, 59, 1, 8472, 114, 59, 3, 55349, 56628, 112, 102, 59, 3, 55349, 56680, 59, 1, 8472, 4, 2, 59, 101, 19081, 19083, 1, 8768, 97, 116, 104, 59, 1, 8768, 99, 114, 59, 3, 55349, 56524, 4, 14, 99, 100, 102, 104, 105, 108, 109, 110, 111, 114, 115, 117, 118, 119, 19125, 19146, 19152, 19157, 19173, 19176, 19192, 19197, 19202, 19236, 19252, 19269, 19286, 19291, 4, 3, 97, 105, 117, 19133, 19137, 19142, 112, 59, 1, 8898, 114, 99, 59, 1, 9711, 112, 59, 1, 8899, 116, 114, 105, 59, 1, 9661, 114, 59, 3, 55349, 56629, 4, 2, 65, 97, 19163, 19168, 114, 114, 59, 1, 10234, 114, 114, 59, 1, 10231, 59, 1, 958, 4, 2, 65, 97, 19182, 19187, 114, 114, 59, 1, 10232, 114, 114, 59, 1, 10229, 97, 112, 59, 1, 10236, 105, 115, 59, 1, 8955, 4, 3, 100, 112, 116, 19210, 19215, 19230, 111, 116, 59, 1, 10752, 4, 2, 102, 108, 19221, 19225, 59, 3, 55349, 56681, 117, 115, 59, 1, 10753, 105, 109, 101, 59, 1, 10754, 4, 2, 65, 97, 19242, 19247, 114, 114, 59, 1, 10233, 114, 114, 59, 1, 10230, 4, 2, 99, 113, 19258, 19263, 114, 59, 3, 55349, 56525, 99, 117, 112, 59, 1, 10758, 4, 2, 112, 116, 19275, 19281, 108, 117, 115, 59, 1, 10756, 114, 105, 59, 1, 9651, 101, 101, 59, 1, 8897, 101, 100, 103, 101, 59, 1, 8896, 4, 8, 97, 99, 101, 102, 105, 111, 115, 117, 19316, 19335, 19349, 19357, 19362, 19367, 19373, 19379, 99, 4, 2, 117, 121, 19323, 19332, 116, 101, 5, 253, 1, 59, 19330, 1, 253, 59, 1, 1103, 4, 2, 105, 121, 19341, 19346, 114, 99, 59, 1, 375, 59, 1, 1099, 110, 5, 165, 1, 59, 19355, 1, 165, 114, 59, 3, 55349, 56630, 99, 121, 59, 1, 1111, 112, 102, 59, 3, 55349, 56682, 99, 114, 59, 3, 55349, 56526, 4, 2, 99, 109, 19385, 19389, 121, 59, 1, 1102, 108, 5, 255, 1, 59, 19395, 1, 255, 4, 10, 97, 99, 100, 101, 102, 104, 105, 111, 115, 119, 19419, 19426, 19441, 19446, 19462, 19467, 19472, 19480, 19486, 19492, 99, 117, 116, 101, 59, 1, 378, 4, 2, 97, 121, 19432, 19438, 114, 111, 110, 59, 1, 382, 59, 1, 1079, 111, 116, 59, 1, 380, 4, 2, 101, 116, 19452, 19458, 116, 114, 102, 59, 1, 8488, 97, 59, 1, 950, 114, 59, 3, 55349, 56631, 99, 121, 59, 1, 1078, 103, 114, 97, 114, 114, 59, 1, 8669, 112, 102, 59, 3, 55349, 56683, 99, 114, 59, 3, 55349, 56527, 4, 2, 106, 110, 19498, 19501, 59, 1, 8205, 106, 59, 1, 8204]);
      return namedEntityData;
    }
    var tokenizer;
    var hasRequiredTokenizer;
    function requireTokenizer() {
      if (hasRequiredTokenizer) return tokenizer;
      hasRequiredTokenizer = 1;
      const Preprocessor = requirePreprocessor();
      const unicode2 = requireUnicode();
      const neTree = requireNamedEntityData();
      const ERR = requireErrorCodes();
      const $2 = unicode2.CODE_POINTS;
      const $$ = unicode2.CODE_POINT_SEQUENCES;
      const C1_CONTROLS_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
      };
      const HAS_DATA_FLAG = 1 << 0;
      const DATA_DUPLET_FLAG = 1 << 1;
      const HAS_BRANCHES_FLAG = 1 << 2;
      const MAX_BRANCH_MARKER_VALUE = HAS_DATA_FLAG | DATA_DUPLET_FLAG | HAS_BRANCHES_FLAG;
      const DATA_STATE = "DATA_STATE";
      const RCDATA_STATE = "RCDATA_STATE";
      const RAWTEXT_STATE = "RAWTEXT_STATE";
      const SCRIPT_DATA_STATE = "SCRIPT_DATA_STATE";
      const PLAINTEXT_STATE = "PLAINTEXT_STATE";
      const TAG_OPEN_STATE = "TAG_OPEN_STATE";
      const END_TAG_OPEN_STATE = "END_TAG_OPEN_STATE";
      const TAG_NAME_STATE = "TAG_NAME_STATE";
      const RCDATA_LESS_THAN_SIGN_STATE = "RCDATA_LESS_THAN_SIGN_STATE";
      const RCDATA_END_TAG_OPEN_STATE = "RCDATA_END_TAG_OPEN_STATE";
      const RCDATA_END_TAG_NAME_STATE = "RCDATA_END_TAG_NAME_STATE";
      const RAWTEXT_LESS_THAN_SIGN_STATE = "RAWTEXT_LESS_THAN_SIGN_STATE";
      const RAWTEXT_END_TAG_OPEN_STATE = "RAWTEXT_END_TAG_OPEN_STATE";
      const RAWTEXT_END_TAG_NAME_STATE = "RAWTEXT_END_TAG_NAME_STATE";
      const SCRIPT_DATA_LESS_THAN_SIGN_STATE = "SCRIPT_DATA_LESS_THAN_SIGN_STATE";
      const SCRIPT_DATA_END_TAG_OPEN_STATE = "SCRIPT_DATA_END_TAG_OPEN_STATE";
      const SCRIPT_DATA_END_TAG_NAME_STATE = "SCRIPT_DATA_END_TAG_NAME_STATE";
      const SCRIPT_DATA_ESCAPE_START_STATE = "SCRIPT_DATA_ESCAPE_START_STATE";
      const SCRIPT_DATA_ESCAPE_START_DASH_STATE = "SCRIPT_DATA_ESCAPE_START_DASH_STATE";
      const SCRIPT_DATA_ESCAPED_STATE = "SCRIPT_DATA_ESCAPED_STATE";
      const SCRIPT_DATA_ESCAPED_DASH_STATE = "SCRIPT_DATA_ESCAPED_DASH_STATE";
      const SCRIPT_DATA_ESCAPED_DASH_DASH_STATE = "SCRIPT_DATA_ESCAPED_DASH_DASH_STATE";
      const SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN_STATE = "SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN_STATE";
      const SCRIPT_DATA_ESCAPED_END_TAG_OPEN_STATE = "SCRIPT_DATA_ESCAPED_END_TAG_OPEN_STATE";
      const SCRIPT_DATA_ESCAPED_END_TAG_NAME_STATE = "SCRIPT_DATA_ESCAPED_END_TAG_NAME_STATE";
      const SCRIPT_DATA_DOUBLE_ESCAPE_START_STATE = "SCRIPT_DATA_DOUBLE_ESCAPE_START_STATE";
      const SCRIPT_DATA_DOUBLE_ESCAPED_STATE = "SCRIPT_DATA_DOUBLE_ESCAPED_STATE";
      const SCRIPT_DATA_DOUBLE_ESCAPED_DASH_STATE = "SCRIPT_DATA_DOUBLE_ESCAPED_DASH_STATE";
      const SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH_STATE = "SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH_STATE";
      const SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN_STATE = "SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN_STATE";
      const SCRIPT_DATA_DOUBLE_ESCAPE_END_STATE = "SCRIPT_DATA_DOUBLE_ESCAPE_END_STATE";
      const BEFORE_ATTRIBUTE_NAME_STATE = "BEFORE_ATTRIBUTE_NAME_STATE";
      const ATTRIBUTE_NAME_STATE = "ATTRIBUTE_NAME_STATE";
      const AFTER_ATTRIBUTE_NAME_STATE = "AFTER_ATTRIBUTE_NAME_STATE";
      const BEFORE_ATTRIBUTE_VALUE_STATE = "BEFORE_ATTRIBUTE_VALUE_STATE";
      const ATTRIBUTE_VALUE_DOUBLE_QUOTED_STATE = "ATTRIBUTE_VALUE_DOUBLE_QUOTED_STATE";
      const ATTRIBUTE_VALUE_SINGLE_QUOTED_STATE = "ATTRIBUTE_VALUE_SINGLE_QUOTED_STATE";
      const ATTRIBUTE_VALUE_UNQUOTED_STATE = "ATTRIBUTE_VALUE_UNQUOTED_STATE";
      const AFTER_ATTRIBUTE_VALUE_QUOTED_STATE = "AFTER_ATTRIBUTE_VALUE_QUOTED_STATE";
      const SELF_CLOSING_START_TAG_STATE = "SELF_CLOSING_START_TAG_STATE";
      const BOGUS_COMMENT_STATE = "BOGUS_COMMENT_STATE";
      const MARKUP_DECLARATION_OPEN_STATE = "MARKUP_DECLARATION_OPEN_STATE";
      const COMMENT_START_STATE = "COMMENT_START_STATE";
      const COMMENT_START_DASH_STATE = "COMMENT_START_DASH_STATE";
      const COMMENT_STATE = "COMMENT_STATE";
      const COMMENT_LESS_THAN_SIGN_STATE = "COMMENT_LESS_THAN_SIGN_STATE";
      const COMMENT_LESS_THAN_SIGN_BANG_STATE = "COMMENT_LESS_THAN_SIGN_BANG_STATE";
      const COMMENT_LESS_THAN_SIGN_BANG_DASH_STATE = "COMMENT_LESS_THAN_SIGN_BANG_DASH_STATE";
      const COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH_STATE = "COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH_STATE";
      const COMMENT_END_DASH_STATE = "COMMENT_END_DASH_STATE";
      const COMMENT_END_STATE = "COMMENT_END_STATE";
      const COMMENT_END_BANG_STATE = "COMMENT_END_BANG_STATE";
      const DOCTYPE_STATE = "DOCTYPE_STATE";
      const BEFORE_DOCTYPE_NAME_STATE = "BEFORE_DOCTYPE_NAME_STATE";
      const DOCTYPE_NAME_STATE = "DOCTYPE_NAME_STATE";
      const AFTER_DOCTYPE_NAME_STATE = "AFTER_DOCTYPE_NAME_STATE";
      const AFTER_DOCTYPE_PUBLIC_KEYWORD_STATE = "AFTER_DOCTYPE_PUBLIC_KEYWORD_STATE";
      const BEFORE_DOCTYPE_PUBLIC_IDENTIFIER_STATE = "BEFORE_DOCTYPE_PUBLIC_IDENTIFIER_STATE";
      const DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED_STATE = "DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED_STATE";
      const DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED_STATE = "DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED_STATE";
      const AFTER_DOCTYPE_PUBLIC_IDENTIFIER_STATE = "AFTER_DOCTYPE_PUBLIC_IDENTIFIER_STATE";
      const BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS_STATE = "BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS_STATE";
      const AFTER_DOCTYPE_SYSTEM_KEYWORD_STATE = "AFTER_DOCTYPE_SYSTEM_KEYWORD_STATE";
      const BEFORE_DOCTYPE_SYSTEM_IDENTIFIER_STATE = "BEFORE_DOCTYPE_SYSTEM_IDENTIFIER_STATE";
      const DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED_STATE = "DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED_STATE";
      const DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED_STATE = "DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED_STATE";
      const AFTER_DOCTYPE_SYSTEM_IDENTIFIER_STATE = "AFTER_DOCTYPE_SYSTEM_IDENTIFIER_STATE";
      const BOGUS_DOCTYPE_STATE = "BOGUS_DOCTYPE_STATE";
      const CDATA_SECTION_STATE = "CDATA_SECTION_STATE";
      const CDATA_SECTION_BRACKET_STATE = "CDATA_SECTION_BRACKET_STATE";
      const CDATA_SECTION_END_STATE = "CDATA_SECTION_END_STATE";
      const CHARACTER_REFERENCE_STATE = "CHARACTER_REFERENCE_STATE";
      const NAMED_CHARACTER_REFERENCE_STATE = "NAMED_CHARACTER_REFERENCE_STATE";
      const AMBIGUOUS_AMPERSAND_STATE = "AMBIGUOS_AMPERSAND_STATE";
      const NUMERIC_CHARACTER_REFERENCE_STATE = "NUMERIC_CHARACTER_REFERENCE_STATE";
      const HEXADEMICAL_CHARACTER_REFERENCE_START_STATE = "HEXADEMICAL_CHARACTER_REFERENCE_START_STATE";
      const DECIMAL_CHARACTER_REFERENCE_START_STATE = "DECIMAL_CHARACTER_REFERENCE_START_STATE";
      const HEXADEMICAL_CHARACTER_REFERENCE_STATE = "HEXADEMICAL_CHARACTER_REFERENCE_STATE";
      const DECIMAL_CHARACTER_REFERENCE_STATE = "DECIMAL_CHARACTER_REFERENCE_STATE";
      const NUMERIC_CHARACTER_REFERENCE_END_STATE = "NUMERIC_CHARACTER_REFERENCE_END_STATE";
      function isWhitespace2(cp) {
        return cp === $2.SPACE || cp === $2.LINE_FEED || cp === $2.TABULATION || cp === $2.FORM_FEED;
      }
      function isAsciiDigit(cp) {
        return cp >= $2.DIGIT_0 && cp <= $2.DIGIT_9;
      }
      function isAsciiUpper(cp) {
        return cp >= $2.LATIN_CAPITAL_A && cp <= $2.LATIN_CAPITAL_Z;
      }
      function isAsciiLower(cp) {
        return cp >= $2.LATIN_SMALL_A && cp <= $2.LATIN_SMALL_Z;
      }
      function isAsciiLetter(cp) {
        return isAsciiLower(cp) || isAsciiUpper(cp);
      }
      function isAsciiAlphaNumeric2(cp) {
        return isAsciiLetter(cp) || isAsciiDigit(cp);
      }
      function isAsciiUpperHexDigit(cp) {
        return cp >= $2.LATIN_CAPITAL_A && cp <= $2.LATIN_CAPITAL_F;
      }
      function isAsciiLowerHexDigit(cp) {
        return cp >= $2.LATIN_SMALL_A && cp <= $2.LATIN_SMALL_F;
      }
      function isAsciiHexDigit(cp) {
        return isAsciiDigit(cp) || isAsciiUpperHexDigit(cp) || isAsciiLowerHexDigit(cp);
      }
      function toAsciiLowerCodePoint(cp) {
        return cp + 32;
      }
      function toChar(cp) {
        if (cp <= 65535) {
          return String.fromCharCode(cp);
        }
        cp -= 65536;
        return String.fromCharCode(cp >>> 10 & 1023 | 55296) + String.fromCharCode(56320 | cp & 1023);
      }
      function toAsciiLowerChar(cp) {
        return String.fromCharCode(toAsciiLowerCodePoint(cp));
      }
      function findNamedEntityTreeBranch(nodeIx, cp) {
        const branchCount = neTree[++nodeIx];
        let lo2 = ++nodeIx;
        let hi = lo2 + branchCount - 1;
        while (lo2 <= hi) {
          const mid2 = lo2 + hi >>> 1;
          const midCp = neTree[mid2];
          if (midCp < cp) {
            lo2 = mid2 + 1;
          } else if (midCp > cp) {
            hi = mid2 - 1;
          } else {
            return neTree[mid2 + branchCount];
          }
        }
        return -1;
      }
      class Tokenizer2 {
        constructor() {
          this.preprocessor = new Preprocessor();
          this.tokenQueue = [];
          this.allowCDATA = false;
          this.state = DATA_STATE;
          this.returnState = "";
          this.charRefCode = -1;
          this.tempBuff = [];
          this.lastStartTagName = "";
          this.consumedAfterSnapshot = -1;
          this.active = false;
          this.currentCharacterToken = null;
          this.currentToken = null;
          this.currentAttr = null;
        }
        //Errors
        _err() {
        }
        _errOnNextCodePoint(err2) {
          this._consume();
          this._err(err2);
          this._unconsume();
        }
        //API
        getNextToken() {
          while (!this.tokenQueue.length && this.active) {
            this.consumedAfterSnapshot = 0;
            const cp = this._consume();
            if (!this._ensureHibernation()) {
              this[this.state](cp);
            }
          }
          return this.tokenQueue.shift();
        }
        write(chunk, isLastChunk) {
          this.active = true;
          this.preprocessor.write(chunk, isLastChunk);
        }
        insertHtmlAtCurrentPos(chunk) {
          this.active = true;
          this.preprocessor.insertHtmlAtCurrentPos(chunk);
        }
        //Hibernation
        _ensureHibernation() {
          if (this.preprocessor.endOfChunkHit) {
            for (; this.consumedAfterSnapshot > 0; this.consumedAfterSnapshot--) {
              this.preprocessor.retreat();
            }
            this.active = false;
            this.tokenQueue.push({ type: Tokenizer2.HIBERNATION_TOKEN });
            return true;
          }
          return false;
        }
        //Consumption
        _consume() {
          this.consumedAfterSnapshot++;
          return this.preprocessor.advance();
        }
        _unconsume() {
          this.consumedAfterSnapshot--;
          this.preprocessor.retreat();
        }
        _reconsumeInState(state) {
          this.state = state;
          this._unconsume();
        }
        _consumeSequenceIfMatch(pattern, startCp, caseSensitive) {
          let consumedCount = 0;
          let isMatch = true;
          const patternLength = pattern.length;
          let patternPos = 0;
          let cp = startCp;
          let patternCp = void 0;
          for (; patternPos < patternLength; patternPos++) {
            if (patternPos > 0) {
              cp = this._consume();
              consumedCount++;
            }
            if (cp === $2.EOF) {
              isMatch = false;
              break;
            }
            patternCp = pattern[patternPos];
            if (cp !== patternCp && (caseSensitive || cp !== toAsciiLowerCodePoint(patternCp))) {
              isMatch = false;
              break;
            }
          }
          if (!isMatch) {
            while (consumedCount--) {
              this._unconsume();
            }
          }
          return isMatch;
        }
        //Temp buffer
        _isTempBufferEqualToScriptString() {
          if (this.tempBuff.length !== $$.SCRIPT_STRING.length) {
            return false;
          }
          for (let i2 = 0; i2 < this.tempBuff.length; i2++) {
            if (this.tempBuff[i2] !== $$.SCRIPT_STRING[i2]) {
              return false;
            }
          }
          return true;
        }
        //Token creation
        _createStartTagToken() {
          this.currentToken = {
            type: Tokenizer2.START_TAG_TOKEN,
            tagName: "",
            selfClosing: false,
            ackSelfClosing: false,
            attrs: []
          };
        }
        _createEndTagToken() {
          this.currentToken = {
            type: Tokenizer2.END_TAG_TOKEN,
            tagName: "",
            selfClosing: false,
            attrs: []
          };
        }
        _createCommentToken() {
          this.currentToken = {
            type: Tokenizer2.COMMENT_TOKEN,
            data: ""
          };
        }
        _createDoctypeToken(initialName) {
          this.currentToken = {
            type: Tokenizer2.DOCTYPE_TOKEN,
            name: initialName,
            forceQuirks: false,
            publicId: null,
            systemId: null
          };
        }
        _createCharacterToken(type, ch3) {
          this.currentCharacterToken = {
            type,
            chars: ch3
          };
        }
        _createEOFToken() {
          this.currentToken = { type: Tokenizer2.EOF_TOKEN };
        }
        //Tag attributes
        _createAttr(attrNameFirstCh) {
          this.currentAttr = {
            name: attrNameFirstCh,
            value: ""
          };
        }
        _leaveAttrName(toState) {
          if (Tokenizer2.getTokenAttr(this.currentToken, this.currentAttr.name) === null) {
            this.currentToken.attrs.push(this.currentAttr);
          } else {
            this._err(ERR.duplicateAttribute);
          }
          this.state = toState;
        }
        _leaveAttrValue(toState) {
          this.state = toState;
        }
        //Token emission
        _emitCurrentToken() {
          this._emitCurrentCharacterToken();
          const ct = this.currentToken;
          this.currentToken = null;
          if (ct.type === Tokenizer2.START_TAG_TOKEN) {
            this.lastStartTagName = ct.tagName;
          } else if (ct.type === Tokenizer2.END_TAG_TOKEN) {
            if (ct.attrs.length > 0) {
              this._err(ERR.endTagWithAttributes);
            }
            if (ct.selfClosing) {
              this._err(ERR.endTagWithTrailingSolidus);
            }
          }
          this.tokenQueue.push(ct);
        }
        _emitCurrentCharacterToken() {
          if (this.currentCharacterToken) {
            this.tokenQueue.push(this.currentCharacterToken);
            this.currentCharacterToken = null;
          }
        }
        _emitEOFToken() {
          this._createEOFToken();
          this._emitCurrentToken();
        }
        //Characters emission
        //OPTIMIZATION: specification uses only one type of character tokens (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, parser can process it
        //as a single solid character token.
        //So, there are 3 types of character tokens in parse5:
        //1)NULL_CHARACTER_TOKEN - \u0000-character sequences (e.g. '\u0000\u0000\u0000')
        //2)WHITESPACE_CHARACTER_TOKEN - any whitespace/new-line character sequences (e.g. '\n  \r\t   \f')
        //3)CHARACTER_TOKEN - any character sequence which don't belong to groups 1 and 2 (e.g. 'abcdef1234@@#$%^')
        _appendCharToCurrentCharacterToken(type, ch3) {
          if (this.currentCharacterToken && this.currentCharacterToken.type !== type) {
            this._emitCurrentCharacterToken();
          }
          if (this.currentCharacterToken) {
            this.currentCharacterToken.chars += ch3;
          } else {
            this._createCharacterToken(type, ch3);
          }
        }
        _emitCodePoint(cp) {
          let type = Tokenizer2.CHARACTER_TOKEN;
          if (isWhitespace2(cp)) {
            type = Tokenizer2.WHITESPACE_CHARACTER_TOKEN;
          } else if (cp === $2.NULL) {
            type = Tokenizer2.NULL_CHARACTER_TOKEN;
          }
          this._appendCharToCurrentCharacterToken(type, toChar(cp));
        }
        _emitSeveralCodePoints(codePoints) {
          for (let i2 = 0; i2 < codePoints.length; i2++) {
            this._emitCodePoint(codePoints[i2]);
          }
        }
        //NOTE: used then we emit character explicitly. This is always a non-whitespace and a non-null character.
        //So we can avoid additional checks here.
        _emitChars(ch3) {
          this._appendCharToCurrentCharacterToken(Tokenizer2.CHARACTER_TOKEN, ch3);
        }
        // Character reference helpers
        _matchNamedCharacterReference(startCp) {
          let result2 = null;
          let excess = 1;
          let i2 = findNamedEntityTreeBranch(0, startCp);
          this.tempBuff.push(startCp);
          while (i2 > -1) {
            const current2 = neTree[i2];
            const inNode = current2 < MAX_BRANCH_MARKER_VALUE;
            const nodeWithData = inNode && current2 & HAS_DATA_FLAG;
            if (nodeWithData) {
              result2 = current2 & DATA_DUPLET_FLAG ? [neTree[++i2], neTree[++i2]] : [neTree[++i2]];
              excess = 0;
            }
            const cp = this._consume();
            this.tempBuff.push(cp);
            excess++;
            if (cp === $2.EOF) {
              break;
            }
            if (inNode) {
              i2 = current2 & HAS_BRANCHES_FLAG ? findNamedEntityTreeBranch(i2, cp) : -1;
            } else {
              i2 = cp === current2 ? ++i2 : -1;
            }
          }
          while (excess--) {
            this.tempBuff.pop();
            this._unconsume();
          }
          return result2;
        }
        _isCharacterReferenceInAttribute() {
          return this.returnState === ATTRIBUTE_VALUE_DOUBLE_QUOTED_STATE || this.returnState === ATTRIBUTE_VALUE_SINGLE_QUOTED_STATE || this.returnState === ATTRIBUTE_VALUE_UNQUOTED_STATE;
        }
        _isCharacterReferenceAttributeQuirk(withSemicolon) {
          if (!withSemicolon && this._isCharacterReferenceInAttribute()) {
            const nextCp = this._consume();
            this._unconsume();
            return nextCp === $2.EQUALS_SIGN || isAsciiAlphaNumeric2(nextCp);
          }
          return false;
        }
        _flushCodePointsConsumedAsCharacterReference() {
          if (this._isCharacterReferenceInAttribute()) {
            for (let i2 = 0; i2 < this.tempBuff.length; i2++) {
              this.currentAttr.value += toChar(this.tempBuff[i2]);
            }
          } else {
            this._emitSeveralCodePoints(this.tempBuff);
          }
          this.tempBuff = [];
        }
        // State machine
        // Data state
        //------------------------------------------------------------------
        [DATA_STATE](cp) {
          this.preprocessor.dropParsedChunk();
          if (cp === $2.LESS_THAN_SIGN) {
            this.state = TAG_OPEN_STATE;
          } else if (cp === $2.AMPERSAND) {
            this.returnState = DATA_STATE;
            this.state = CHARACTER_REFERENCE_STATE;
          } else if (cp === $2.NULL) {
            this._err(ERR.unexpectedNullCharacter);
            this._emitCodePoint(cp);
          } else if (cp === $2.EOF) {
            this._emitEOFToken();
          } else {
            this._emitCodePoint(cp);
          }
        }
        //  RCDATA state
        //------------------------------------------------------------------
        [RCDATA_STATE](cp) {
          this.preprocessor.dropParsedChunk();
          if (cp === $2.AMPERSAND) {
            this.returnState = RCDATA_STATE;
            this.state = CHARACTER_REFERENCE_STATE;
          } else if (cp === $2.LESS_THAN_SIGN) {
            this.state = RCDATA_LESS_THAN_SIGN_STATE;
          } else if (cp === $2.NULL) {
            this._err(ERR.unexpectedNullCharacter);
            this._emitChars(unicode2.REPLACEMENT_CHARACTER);
          } else if (cp === $2.EOF) {
            this._emitEOFToken();
          } else {
            this._emitCodePoint(cp);
          }
        }
        // RAWTEXT state
        //------------------------------------------------------------------
        [RAWTEXT_STATE](cp) {
          this.preprocessor.dropParsedChunk();
          if (cp === $2.LESS_THAN_SIGN) {
            this.state = RAWTEXT_LESS_THAN_SIGN_STATE;
          } else if (cp === $2.NULL) {
            this._err(ERR.unexpectedNullCharacter);
            this._emitChars(unicode2.REPLACEMENT_CHARACTER);
          } else if (cp === $2.EOF) {
            this._emitEOFToken();
          } else {
            this._emitCodePoint(cp);
          }
        }
        // Script data state
        //------------------------------------------------------------------
        [SCRIPT_DATA_STATE](cp) {
          this.preprocessor.dropParsedChunk();
          if (cp === $2.LESS_THAN_SIGN) {
            this.state = SCRIPT_DATA_LESS_THAN_SIGN_STATE;
          } else if (cp === $2.NULL) {
            this._err(ERR.unexpectedNullCharacter);
            this._emitChars(unicode2.REPLACEMENT_CHARACTER);
          } else if (cp === $2.EOF) {
            this._emitEOFToken();
          } else {
            this._emitCodePoint(cp);
          }
        }
        // PLAINTEXT state
        //------------------------------------------------------------------
        [PLAINTEXT_STATE](cp) {
          this.preprocessor.dropParsedChunk();
          if (cp === $2.NULL) {
            this._err(ERR.unexpectedNullCharacter);
            this._emitChars(unicode2.REPLACEMENT_CHARACTER);
          } else if (cp === $2.EOF) {
            this._emitEOFToken();
          } else {
            this._emitCodePoint(cp);
          }
        }
        // Tag open state
        //------------------------------------------------------------------
        [TAG_OPEN_STATE](cp) {
          if (cp === $2.EXCLAMATION_MARK) {
            this.state = MARKUP_DECLARATION_OPEN_STATE;
          } else if (cp === $2.SOLIDUS) {
            this.state = END_TAG_OPEN_STATE;
          } else if (isAsciiLetter(cp)) {
            this._createStartTagToken();
            this._reconsumeInState(TAG_NAME_STATE);
          } else if (cp === $2.QUESTION_MARK) {
            this._err(ERR.unexpectedQuestionMarkInsteadOfTagName);
            this._createCommentToken();
            this._reconsumeInState(BOGUS_COMMENT_STATE);
          } else if (cp === $2.EOF) {
            this._err(ERR.eofBeforeTagName);
            this._emitChars("<");
            this._emitEOFToken();
          } else {
            this._err(ERR.invalidFirstCharacterOfTagName);
            this._emitChars("<");
            this._reconsumeInState(DATA_STATE);
          }
        }
        // End tag open state
        //------------------------------------------------------------------
        [END_TAG_OPEN_STATE](cp) {
          if (isAsciiLetter(cp)) {
            this._createEndTagToken();
            this._reconsumeInState(TAG_NAME_STATE);
          } else if (cp === $2.GREATER_THAN_SIGN) {
            this._err(ERR.missingEndTagName);
            this.state = DATA_STATE;
          } else if (cp === $2.EOF) {
            this._err(ERR.eofBeforeTagName);
            this._emitChars("</");
            this._emitEOFToken();
          } else {
            this._err(ERR.invalidFirstCharacterOfTagName);
            this._createCommentToken();
            this._reconsumeInState(BOGUS_COMMENT_STATE);
          }
        }
        // Tag name state
        //------------------------------------------------------------------
        [TAG_NAME_STATE](cp) {
          if (isWhitespace2(cp)) {
            this.state = BEFORE_ATTRIBUTE_NAME_STATE;
          } else if (cp === $2.SOLIDUS) {
            this.state = SELF_CLOSING_START_TAG_STATE;
          } else if (cp === $2.GREATER_THAN_SIGN) {
            this.state = DATA_STATE;
            this._emitCurrentToken();
          } else if (isAsciiUpper(cp)) {
            this.currentToken.tagName += toAsciiLowerChar(cp);
          } else if (cp === $2.NULL) {
            this._err(ERR.unexpectedNullCharacter);
            this.currentToken.tagName += unicode2.REPLACEMENT_CHARACTER;
          } else if (cp === $2.EOF) {
            this._err(ERR.eofInTag);
            this._emitEOFToken();
          } else {
            this.currentToken.tagName += toChar(cp);
          }
        }
        // RCDATA less-than sign state
        //------------------------------------------------------------------
        [RCDATA_LESS_THAN_SIGN_STATE](cp) {
          if (cp === $2.SOLIDUS) {
            this.tempBuff = [];
            this.state = RCDATA_END_TAG_OPEN_STATE;
          } else {
            this._emitChars("<");
            this._reconsumeInState(RCDATA_STATE);
          }
        }
        // RCDATA end tag open state
        //------------------------------------------------------------------
        [RCDATA_END_TAG_OPEN_STATE](cp) {
          if (isAsciiLetter(cp)) {
            this._createEndTagToken();
            this._reconsumeInState(RCDATA_END_TAG_NAME_STATE);
          } else {
            this._emitChars("</");
            this._reconsumeInState(RCDATA_STATE);
          }
        }
        // RCDATA end tag name state
        //------------------------------------------------------------------
        [RCDATA_END_TAG_NAME_STATE](cp) {
          if (isAsciiUpper(cp)) {
            this.currentToken.tagName += toAsciiLowerChar(cp);
            this.tempBuff.push(cp);
          } else if (isAsciiLower(cp)) {
            this.currentToken.tagName += toChar(cp);
            this.tempBuff.push(cp);
          } else {
            if (this.lastStartTagName === this.currentToken.tagName) {
              if (isWhitespace2(cp)) {
                this.state = BEFORE_ATTRIBUTE_NAME_STATE;
                return;
              }
              if (cp === $2.SOLIDUS) {
                this.state = SELF_CLOSING_START_TAG_STATE;
                return;
              }
              if (cp === $2.GREATER_THAN_SIGN) {
                this.state = DATA_STATE;
                this._emitCurrentToken();
                return;
              }
            }
            this._emitChars("</");
            this._emitSeveralCodePoints(this.tempBuff);
            this._reconsumeInState(RCDATA_STATE);
          }
        }
        // RAWTEXT less-than sign state
        //------------------------------------------------------------------
        [RAWTEXT_LESS_THAN_SIGN_STATE](cp) {
          if (cp === $2.SOLIDUS) {
            this.tempBuff = [];
            this.state = RAWTEXT_END_TAG_OPEN_STATE;
          } else {
            this._emitChars("<");
            this._reconsumeInState(RAWTEXT_STATE);
          }
        }
        // RAWTEXT end tag open state
        //------------------------------------------------------------------
        [RAWTEXT_END_TAG_OPEN_STATE](cp) {
          if (isAsciiLetter(cp)) {
            this._createEndTagToken();
            this._reconsumeInState(RAWTEXT_END_TAG_NAME_STATE);
          } else {
            this._emitChars("</");
            this._reconsumeInState(RAWTEXT_STATE);
          }
        }
        // RAWTEXT end tag name state
        //------------------------------------------------------------------
        [RAWTEXT_END_TAG_NAME_STATE](cp) {
          if (isAsciiUpper(cp)) {
            this.currentToken.tagName += toAsciiLowerChar(cp);
            this.tempBuff.push(cp);
          } else if (isAsciiLower(cp)) {
            this.currentToken.tagName += toChar(cp);
            this.tempBuff.push(cp);
          } else {
            if (this.lastStartTagName === this.currentToken.tagName) {
              if (isWhitespace2(cp)) {
                this.state = BEFORE_ATTRIBUTE_NAME_STATE;
                return;
              }
              if (cp === $2.SOLIDUS) {
                this.state = SELF_CLOSING_START_TAG_STATE;
                return;
              }
              if (cp === $2.GREATER_THAN_SIGN) {
                this._emitCurrentToken();
                this.state = DATA_STATE;
                return;
              }
            }
            this._emitChars("</");
            this._emitSeveralCodePoints(this.tempBuff);
            this._reconsumeInState(RAWTEXT_STATE);
          }
        }
        // Script data less-than sign state
        //------------------------------------------------------------------
        [SCRIPT_DATA_LESS_THAN_SIGN_STATE](cp) {
          if (cp === $2.SOLIDUS) {
            this.tempBuff = [];
            this.state = SCRIPT_DATA_END_TAG_OPEN_STATE;
          } else if (cp === $2.EXCLAMATION_MARK) {
            this.state = SCRIPT_DATA_ESCAPE_START_STATE;
            this._emitChars("<!");
          } else {
            this._emitChars("<");
            this._reconsumeInState(SCRIPT_DATA_STATE);
          }
        }
        // Script data end tag open state
        //------------------------------------------------------------------
        [SCRIPT_DATA_END_TAG_OPEN_STATE](cp) {
          if (isAsciiLetter(cp)) {
            this._createEndTagToken();
            this._reconsumeInState(SCRIPT_DATA_END_TAG_NAME_STATE);
          } else {
            this._emitChars("</");
            this._reconsumeInState(SCRIPT_DATA_STATE);
          }
        }
        // Script data end tag name state
        //------------------------------------------------------------------
        [SCRIPT_DATA_END_TAG_NAME_STATE](cp) {
          if (isAsciiUpper(cp)) {
            this.currentToken.tagName += toAsciiLowerChar(cp);
            this.tempBuff.push(cp);
          } else if (isAsciiLower(cp)) {
            this.currentToken.tagName += toChar(cp);
            this.tempBuff.push(cp);
          } else {
            if (this.lastStartTagName === this.currentToken.tagName) {
              if (isWhitespace2(cp)) {
                this.state = BEFORE_ATTRIBUTE_NAME_STATE;
                return;
              } else if (cp === $2.SOLIDUS) {
                this.state = SELF_CLOSING_START_TAG_STATE;
                return;
              } else if (cp === $2.GREATER_THAN_SIGN) {
                this._emitCurrentToken();
                this.state = DATA_STATE;
                return;
              }
            }
            this._emitChars("</");
            this._emitSeveralCodePoints(this.tempBuff);
            this._reconsumeInState(SCRIPT_DATA_STATE);
          }
        }
        // Script data escape start state
        //------------------------------------------------------------------
        [SCRIPT_DATA_ESCAPE_START_STATE](cp) {
          if (cp === $2.HYPHEN_MINUS) {
            this.state = SCRIPT_DATA_ESCAPE_START_DASH_STATE;
            this._emitChars("-");
          } else {
            this._reconsumeInState(SCRIPT_DATA_STATE);
          }
        }
        // Script data escape start dash state
        //------------------------------------------------------------------
        [SCRIPT_DATA_ESCAPE_START_DASH_STATE](cp) {
          if (cp === $2.HYPHEN_MINUS) {
            this.state = SCRIPT_DATA_ESCAPED_DASH_DASH_STATE;
            this._emitChars("-");
          } else {
            this._reconsumeInState(SCRIPT_DATA_STATE);
          }
        }
        // Script data escaped state
        //------------------------------------------------------------------
        [SCRIPT_DATA_ESCAPED_STATE](cp) {
          if (cp === $2.HYPHEN_MINUS) {
            this.state = SCRIPT_DATA_ESCAPED_DASH_STATE;
            this._emitChars("-");
          } else if (cp === $2.LESS_THAN_SIGN) {
            this.state = SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN_STATE;
          } else if (cp === $2.NULL) {
            this._err(ERR.unexpectedNullCharacter);
            this._emitChars(unicode2.REPLACEMENT_CHARACTER);
          } else if (cp === $2.EOF) {
            this._err(ERR.eofInScriptHtmlCommentLikeText);
            this._emitEOFToken();
          } else {
            this._emitCodePoint(cp);
          }
        }
        // Script data escaped dash state
        //------------------------------------------------------------------
        [SCRIPT_DATA_ESCAPED_DASH_STATE](cp) {
          if (cp === $2.HYPHEN_MINUS) {
            this.state = SCRIPT_DATA_ESCAPED_DASH_DASH_STATE;
            this._emitChars("-");
          } else if (cp === $2.LESS_THAN_SIGN) {
            this.state = SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN_STATE;
          } else if (cp === $2.NULL) {
            this._err(ERR.unexpectedNullCharacter);
            this.state = SCRIPT_DATA_ESCAPED_STATE;
            this._emitChars(unicode2.REPLACEMENT_CHARACTER);
          } else if (cp === $2.EOF) {
            this._err(ERR.eofInScriptHtmlCommentLikeText);
            this._emitEOFToken();
          } else {
            this.state = SCRIPT_DATA_ESCAPED_STATE;
            this._emitCodePoint(cp);
          }
        }
        // Script data escaped dash dash state
        //------------------------------------------------------------------
        [SCRIPT_DATA_ESCAPED_DASH_DASH_STATE](cp) {
          if (cp === $2.HYPHEN_MINUS) {
            this._emitChars("-");
          } else if (cp === $2.LESS_THAN_SIGN) {
            this.state = SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN_STATE;
          } else if (cp === $2.GREATER_THAN_SIGN) {
            this.state = SCRIPT_DATA_STATE;
            this._emitChars(">");
          } else if (cp === $2.NULL) {
            this._err(ERR.unexpectedNullCharacter);
            this.state = SCRIPT_DATA_ESCAPED_STATE;
            this._emitChars(unicode2.REPLACEMENT_CHARACTER);
          } else if (cp === $2.EOF) {
            this._err(ERR.eofInScriptHtmlCommentLikeText);
            this._emitEOFToken();
          } else {
            this.state = SCRIPT_DATA_ESCAPED_STATE;
            this._emitCodePoint(cp);
          }
        }
        // Script data escaped less-than sign state
        //------------------------------------------------------------------
        [SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN_STATE](cp) {
          if (cp === $2.SOLIDUS) {
            this.tempBuff = [];
            this.state = SCRIPT_DATA_ESCAPED_END_TAG_OPEN_STATE;
          } else if (isAsciiLetter(cp)) {
            this.tempBuff = [];
            this._emitChars("<");
            this._reconsumeInState(SCRIPT_DATA_DOUBLE_ESCAPE_START_STATE);
          } else {
            this._emitChars("<");
            this._reconsumeInState(SCRIPT_DATA_ESCAPED_STATE);
          }
        }
        // Script data escaped end tag open state
        //------------------------------------------------------------------
        [SCRIPT_DATA_ESCAPED_END_TAG_OPEN_STATE](cp) {
          if (isAsciiLetter(cp)) {
            this._createEndTagToken();
            this._reconsumeInState(SCRIPT_DATA_ESCAPED_END_TAG_NAME_STATE);
          } else {
            this._emitChars("</");
            this._reconsumeInState(SCRIPT_DATA_ESCAPED_STATE);
          }
        }
        // Script data escaped end tag name state
        //------------------------------------------------------------------
        [SCRIPT_DATA_ESCAPED_END_TAG_NAME_STATE](cp) {
          if (isAsciiUpper(cp)) {
            this.currentToken.tagName += toAsciiLowerChar(cp);
            this.tempBuff.push(cp);
          } else if (isAsciiLower(cp)) {
            this.currentToken.tagName += toChar(cp);
            this.tempBuff.push(cp);
          } else {
            if (this.lastStartTagName === this.currentToken.tagName) {
              if (isWhitespace2(cp)) {
                this.state = BEFORE_ATTRIBUTE_NAME_STATE;
                return;
              }
              if (cp === $2.SOLIDUS) {
                this.state = SELF_CLOSING_START_TAG_STATE;
                return;
              }
              if (cp === $2.GREATER_THAN_SIGN) {
                this._emitCurrentToken();
                this.state = DATA_STATE;
                return;
              }
            }
            this._emitChars("</");
            this._emitSeveralCodePoints(this.tempBuff);
            this._reconsumeInState(SCRIPT_DATA_ESCAPED_STATE);
          }
        }
        // Script data double escape start state
        //------------------------------------------------------------------
        [SCRIPT_DATA_DOUBLE_ESCAPE_START_STATE](cp) {
          if (isWhitespace2(cp) || cp === $2.SOLIDUS || cp === $2.GREATER_THAN_SIGN) {
            this.state = this._isTempBufferEqualToScriptString() ? SCRIPT_DATA_DOUBLE_ESCAPED_STATE : SCRIPT_DATA_ESCAPED_STATE;
            this._emitCodePoint(cp);
          } else if (isAsciiUpper(cp)) {
            this.tempBuff.push(toAsciiLowerCodePoint(cp));
            this._emitCodePoint(cp);
          } else if (isAsciiLower(cp)) {
            this.tempBuff.push(cp);
            this._emitCodePoint(cp);
          } else {
            this._reconsumeInState(SCRIPT_DATA_ESCAPED_STATE);
          }
        }
        // Script data double escaped state
        //------------------------------------------------------------------
        [SCRIPT_DATA_DOUBLE_ESCAPED_STATE](cp) {
          if (cp === $2.HYPHEN_MINUS) {
            this.state = SCRIPT_DATA_DOUBLE_ESCAPED_DASH_STATE;
            this._emitChars("-");
          } else if (cp === $2.LESS_THAN_SIGN) {
            this.state = SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN_STATE;
            this._emitChars("<");
          } else if (cp === $2.NULL) {
            this._err(ERR.unexpectedNullCharacter);
            this._emitChars(unicode2.REPLACEMENT_CHARACTER);
          } else if (cp === $2.EOF) {
            this._err(ERR.eofInScriptHtmlCommentLikeText);
            this._emitEOFToken();
          } else {
            this._emitCodePoint(cp);
          }
        }
        // Script data double escaped dash state
        //------------------------------------------------------------------
        [SCRIPT_DATA_DOUBLE_ESCAPED_DASH_STATE](cp) {
          if (cp === $2.HYPHEN_MINUS) {
            this.state = SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH_STATE;
            this._emitChars("-");
          } else if (cp === $2.LESS_THAN_SIGN) {
            this.state = SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN_STATE;
            this._emitChars("<");
          } else if (cp === $2.NULL) {
            this._err(ERR.unexpectedNullCharacter);
            this.state = SCRIPT_DATA_DOUBLE_ESCAPED_STATE;
            this._emitChars(unicode2.REPLACEMENT_CHARACTER);
          } else if (cp === $2.EOF) {
            this._err(ERR.eofInScriptHtmlCommentLikeText);
            this._emitEOFToken();
          } else {
            this.state = SCRIPT_DATA_DOUBLE_ESCAPED_STATE;
            this._emitCodePoint(cp);
          }
        }
        // Script data double escaped dash dash state
        //------------------------------------------------------------------
        [SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH_STATE](cp) {
          if (cp === $2.HYPHEN_MINUS) {
            this._emitChars("-");
          } else if (cp === $2.LESS_THAN_SIGN) {
            this.state = SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN_STATE;
            this._emitChars("<");
          } else if (cp === $2.GREATER_THAN_SIGN) {
            this.state = SCRIPT_DATA_STATE;
            this._emitChars(">");
          } else if (cp === $2.NULL) {
            this._err(ERR.unexpectedNullCharacter);
            this.state = SCRIPT_DATA_DOUBLE_ESCAPED_STATE;
            this._emitChars(unicode2.REPLACEMENT_CHARACTER);
          } else if (cp === $2.EOF) {
            this._err(ERR.eofInScriptHtmlCommentLikeText);
            this._emitEOFToken();
          } else {
            this.state = SCRIPT_DATA_DOUBLE_ESCAPED_STATE;
            this._emitCodePoint(cp);
          }
        }
        // Script data double escaped less-than sign state
        //------------------------------------------------------------------
        [SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN_STATE](cp) {
          if (cp === $2.SOLIDUS) {
            this.tempBuff = [];
            this.state = SCRIPT_DATA_DOUBLE_ESCAPE_END_STATE;
            this._emitChars("/");
          } else {
            this._reconsumeInState(SCRIPT_DATA_DOUBLE_ESCAPED_STATE);
          }
        }
        // Script data double escape end state
        //------------------------------------------------------------------
        [SCRIPT_DATA_DOUBLE_ESCAPE_END_STATE](cp) {
          if (isWhitespace2(cp) || cp === $2.SOLIDUS || cp === $2.GREATER_THAN_SIGN) {
            this.state = this._isTempBufferEqualToScriptString() ? SCRIPT_DATA_ESCAPED_STATE : SCRIPT_DATA_DOUBLE_ESCAPED_STATE;
            this._emitCodePoint(cp);
          } else if (isAsciiUpper(cp)) {
            this.tempBuff.push(toAsciiLowerCodePoint(cp));
            this._emitCodePoint(cp);
          } else if (isAsciiLower(cp)) {
            this.tempBuff.push(cp);
            this._emitCodePoint(cp);
          } else {
            this._reconsumeInState(SCRIPT_DATA_DOUBLE_ESCAPED_STATE);
          }
        }
        // Before attribute name state
        //------------------------------------------------------------------
        [BEFORE_ATTRIBUTE_NAME_STATE](cp) {
          if (isWhitespace2(cp)) {
            return;
          }
          if (cp === $2.SOLIDUS || cp === $2.GREATER_THAN_SIGN || cp === $2.EOF) {
            this._reconsumeInState(AFTER_ATTRIBUTE_NAME_STATE);
          } else if (cp === $2.EQUALS_SIGN) {
            this._err(ERR.unexpectedEqualsSignBeforeAttributeName);
            this._createAttr("=");
            this.state = ATTRIBUTE_NAME_STATE;
          } else {
            this._createAttr("");
            this._reconsumeInState(ATTRIBUTE_NAME_STATE);
          }
        }
        // Attribute name state
        //------------------------------------------------------------------
        [ATTRIBUTE_NAME_STATE](cp) {
          if (isWhitespace2(cp) || cp === $2.SOLIDUS || cp === $2.GREATER_THAN_SIGN || cp === $2.EOF) {
            this._leaveAttrName(AFTER_ATTRIBUTE_NAME_STATE);
            this._unconsume();
          } else if (cp === $2.EQUALS_SIGN) {
            this._leaveAttrName(BEFORE_ATTRIBUTE_VALUE_STATE);
          } else if (isAsciiUpper(cp)) {
            this.currentAttr.name += toAsciiLowerChar(cp);
          } else if (cp === $2.QUOTATION_MARK || cp === $2.APOSTROPHE || cp === $2.LESS_THAN_SIGN) {
            this._err(ERR.unexpectedCharacterInAttributeName);
            this.currentAttr.name += toChar(cp);
          } else if (cp === $2.NULL) {
            this._err(ERR.unexpectedNullCharacter);
            this.currentAttr.name += unicode2.REPLACEMENT_CHARACTER;
          } else {
            this.currentAttr.name += toChar(cp);
          }
        }
        // After attribute name state
        //------------------------------------------------------------------
        [AFTER_ATTRIBUTE_NAME_STATE](cp) {
          if (isWhitespace2(cp)) {
            return;
          }
          if (cp === $2.SOLIDUS) {
            this.state = SELF_CLOSING_START_TAG_STATE;
          } else if (cp === $2.EQUALS_SIGN) {
            this.state = BEFORE_ATTRIBUTE_VALUE_STATE;
          } else if (cp === $2.GREATER_THAN_SIGN) {
            this.state = DATA_STATE;
            this._emitCurrentToken();
          } else if (cp === $2.EOF) {
            this._err(ERR.eofInTag);
            this._emitEOFToken();
          } else {
            this._createAttr("");
            this._reconsumeInState(ATTRIBUTE_NAME_STATE);
          }
        }
        // Before attribute value state
        //------------------------------------------------------------------
        [BEFORE_ATTRIBUTE_VALUE_STATE](cp) {
          if (isWhitespace2(cp)) {
            return;
          }
          if (cp === $2.QUOTATION_MARK) {
            this.state = ATTRIBUTE_VALUE_DOUBLE_QUOTED_STATE;
          } else if (cp === $2.APOSTROPHE) {
            this.state = ATTRIBUTE_VALUE_SINGLE_QUOTED_STATE;
          } else if (cp === $2.GREATER_THAN_SIGN) {
            this._err(ERR.missingAttributeValue);
            this.state = DATA_STATE;
            this._emitCurrentToken();
          } else {
            this._reconsumeInState(ATTRIBUTE_VALUE_UNQUOTED_STATE);
          }
        }
        // Attribute value (double-quoted) state
        //------------------------------------------------------------------
        [ATTRIBUTE_VALUE_DOUBLE_QUOTED_STATE](cp) {
          if (cp === $2.QUOTATION_MARK) {
            this.state = AFTER_ATTRIBUTE_VALUE_QUOTED_STATE;
          } else if (cp === $2.AMPERSAND) {
            this.returnState = ATTRIBUTE_VALUE_DOUBLE_QUOTED_STATE;
            this.state = CHARACTER_REFERENCE_STATE;
          } else if (cp === $2.NULL) {
            this._err(ERR.unexpectedNullCharacter);
            this.currentAttr.value += unicode2.REPLACEMENT_CHARACTER;
          } else if (cp === $2.EOF) {
            this._err(ERR.eofInTag);
            this._emitEOFToken();
          } else {
            this.currentAttr.value += toChar(cp);
          }
        }
        // Attribute value (single-quoted) state
        //------------------------------------------------------------------
        [ATTRIBUTE_VALUE_SINGLE_QUOTED_STATE](cp) {
          if (cp === $2.APOSTROPHE) {
            this.state = AFTER_ATTRIBUTE_VALUE_QUOTED_STATE;
          } else if (cp === $2.AMPERSAND) {
            this.returnState = ATTRIBUTE_VALUE_SINGLE_QUOTED_STATE;
            this.state = CHARACTER_REFERENCE_STATE;
          } else if (cp === $2.NULL) {
            this._err(ERR.unexpectedNullCharacter);
            this.currentAttr.value += unicode2.REPLACEMENT_CHARACTER;
          } else if (cp === $2.EOF) {
            this._err(ERR.eofInTag);
            this._emitEOFToken();
          } else {
            this.currentAttr.value += toChar(cp);
          }
        }
        // Attribute value (unquoted) state
        //------------------------------------------------------------------
        [ATTRIBUTE_VALUE_UNQUOTED_STATE](cp) {
          if (isWhitespace2(cp)) {
            this._leaveAttrValue(BEFORE_ATTRIBUTE_NAME_STATE);
          } else if (cp === $2.AMPERSAND) {
            this.returnState = ATTRIBUTE_VALUE_UNQUOTED_STATE;
            this.state = CHARACTER_REFERENCE_STATE;
          } else if (cp === $2.GREATER_THAN_SIGN) {
            this._leaveAttrValue(DATA_STATE);
            this._emitCurrentToken();
          } else if (cp === $2.NULL) {
            this._err(ERR.unexpectedNullCharacter);
            this.currentAttr.value += unicode2.REPLACEMENT_CHARACTER;
          } else if (cp === $2.QUOTATION_MARK || cp === $2.APOSTROPHE || cp === $2.LESS_THAN_SIGN || cp === $2.EQUALS_SIGN || cp === $2.GRAVE_ACCENT) {
            this._err(ERR.unexpectedCharacterInUnquotedAttributeValue);
            this.currentAttr.value += toChar(cp);
          } else if (cp === $2.EOF) {
            this._err(ERR.eofInTag);
            this._emitEOFToken();
          } else {
            this.currentAttr.value += toChar(cp);
          }
        }
        // After attribute value (quoted) state
        //------------------------------------------------------------------
        [AFTER_ATTRIBUTE_VALUE_QUOTED_STATE](cp) {
          if (isWhitespace2(cp)) {
            this._leaveAttrValue(BEFORE_ATTRIBUTE_NAME_STATE);
          } else if (cp === $2.SOLIDUS) {
            this._leaveAttrValue(SELF_CLOSING_START_TAG_STATE);
          } else if (cp === $2.GREATER_THAN_SIGN) {
            this._leaveAttrValue(DATA_STATE);
            this._emitCurrentToken();
          } else if (cp === $2.EOF) {
            this._err(ERR.eofInTag);
            this._emitEOFToken();
          } else {
            this._err(ERR.missingWhitespaceBetweenAttributes);
            this._reconsumeInState(BEFORE_ATTRIBUTE_NAME_STATE);
          }
        }
        // Self-closing start tag state
        //------------------------------------------------------------------
        [SELF_CLOSING_START_TAG_STATE](cp) {
          if (cp === $2.GREATER_THAN_SIGN) {
            this.currentToken.selfClosing = true;
            this.state = DATA_STATE;
            this._emitCurrentToken();
          } else if (cp === $2.EOF) {
            this._err(ERR.eofInTag);
            this._emitEOFToken();
          } else {
            this._err(ERR.unexpectedSolidusInTag);
            this._reconsumeInState(BEFORE_ATTRIBUTE_NAME_STATE);
          }
        }
        // Bogus comment state
        //------------------------------------------------------------------
        [BOGUS_COMMENT_STATE](cp) {
          if (cp === $2.GREATER_THAN_SIGN) {
            this.state = DATA_STATE;
            this._emitCurrentToken();
          } else if (cp === $2.EOF) {
            this._emitCurrentToken();
            this._emitEOFToken();
          } else if (cp === $2.NULL) {
            this._err(ERR.unexpectedNullCharacter);
            this.currentToken.data += unicode2.REPLACEMENT_CHARACTER;
          } else {
            this.currentToken.data += toChar(cp);
          }
        }
        // Markup declaration open state
        //------------------------------------------------------------------
        [MARKUP_DECLARATION_OPEN_STATE](cp) {
          if (this._consumeSequenceIfMatch($$.DASH_DASH_STRING, cp, true)) {
            this._createCommentToken();
            this.state = COMMENT_START_STATE;
          } else if (this._consumeSequenceIfMatch($$.DOCTYPE_STRING, cp, false)) {
            this.state = DOCTYPE_STATE;
          } else if (this._consumeSequenceIfMatch($$.CDATA_START_STRING, cp, true)) {
            if (this.allowCDATA) {
              this.state = CDATA_SECTION_STATE;
            } else {
              this._err(ERR.cdataInHtmlContent);
              this._createCommentToken();
              this.currentToken.data = "[CDATA[";
              this.state = BOGUS_COMMENT_STATE;
            }
          } else if (!this._ensureHibernation()) {
            this._err(ERR.incorrectlyOpenedComment);
            this._createCommentToken();
            this._reconsumeInState(BOGUS_COMMENT_STATE);
          }
        }
        // Comment start state
        //------------------------------------------------------------------
        [COMMENT_START_STATE](cp) {
          if (cp === $2.HYPHEN_MINUS) {
            this.state = COMMENT_START_DASH_STATE;
          } else if (cp === $2.GREATER_THAN_SIGN) {
            this._err(ERR.abruptClosingOfEmptyComment);
            this.state = DATA_STATE;
            this._emitCurrentToken();
          } else {
            this._reconsumeInState(COMMENT_STATE);
          }
        }
        // Comment start dash state
        //------------------------------------------------------------------
        [COMMENT_START_DASH_STATE](cp) {
          if (cp === $2.HYPHEN_MINUS) {
            this.state = COMMENT_END_STATE;
          } else if (cp === $2.GREATER_THAN_SIGN) {
            this._err(ERR.abruptClosingOfEmptyComment);
            this.state = DATA_STATE;
            this._emitCurrentToken();
          } else if (cp === $2.EOF) {
            this._err(ERR.eofInComment);
            this._emitCurrentToken();
            this._emitEOFToken();
          } else {
            this.currentToken.data += "-";
            this._reconsumeInState(COMMENT_STATE);
          }
        }
        // Comment state
        //------------------------------------------------------------------
        [COMMENT_STATE](cp) {
          if (cp === $2.HYPHEN_MINUS) {
            this.state = COMMENT_END_DASH_STATE;
          } else if (cp === $2.LESS_THAN_SIGN) {
            this.currentToken.data += "<";
            this.state = COMMENT_LESS_THAN_SIGN_STATE;
          } else if (cp === $2.NULL) {
            this._err(ERR.unexpectedNullCharacter);
            this.currentToken.data += unicode2.REPLACEMENT_CHARACTER;
          } else if (cp === $2.EOF) {
            this._err(ERR.eofInComment);
            this._emitCurrentToken();
            this._emitEOFToken();
          } else {
            this.currentToken.data += toChar(cp);
          }
        }
        // Comment less-than sign state
        //------------------------------------------------------------------
        [COMMENT_LESS_THAN_SIGN_STATE](cp) {
          if (cp === $2.EXCLAMATION_MARK) {
            this.currentToken.data += "!";
            this.state = COMMENT_LESS_THAN_SIGN_BANG_STATE;
          } else if (cp === $2.LESS_THAN_SIGN) {
            this.currentToken.data += "!";
          } else {
            this._reconsumeInState(COMMENT_STATE);
          }
        }
        // Comment less-than sign bang state
        //------------------------------------------------------------------
        [COMMENT_LESS_THAN_SIGN_BANG_STATE](cp) {
          if (cp === $2.HYPHEN_MINUS) {
            this.state = COMMENT_LESS_THAN_SIGN_BANG_DASH_STATE;
          } else {
            this._reconsumeInState(COMMENT_STATE);
          }
        }
        // Comment less-than sign bang dash state
        //------------------------------------------------------------------
        [COMMENT_LESS_THAN_SIGN_BANG_DASH_STATE](cp) {
          if (cp === $2.HYPHEN_MINUS) {
            this.state = COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH_STATE;
          } else {
            this._reconsumeInState(COMMENT_END_DASH_STATE);
          }
        }
        // Comment less-than sign bang dash dash state
        //------------------------------------------------------------------
        [COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH_STATE](cp) {
          if (cp !== $2.GREATER_THAN_SIGN && cp !== $2.EOF) {
            this._err(ERR.nestedComment);
          }
          this._reconsumeInState(COMMENT_END_STATE);
        }
        // Comment end dash state
        //------------------------------------------------------------------
        [COMMENT_END_DASH_STATE](cp) {
          if (cp === $2.HYPHEN_MINUS) {
            this.state = COMMENT_END_STATE;
          } else if (cp === $2.EOF) {
            this._err(ERR.eofInComment);
            this._emitCurrentToken();
            this._emitEOFToken();
          } else {
            this.currentToken.data += "-";
            this._reconsumeInState(COMMENT_STATE);
          }
        }
        // Comment end state
        //------------------------------------------------------------------
        [COMMENT_END_STATE](cp) {
          if (cp === $2.GREATER_THAN_SIGN) {
            this.state = DATA_STATE;
            this._emitCurrentToken();
          } else if (cp === $2.EXCLAMATION_MARK) {
            this.state = COMMENT_END_BANG_STATE;
          } else if (cp === $2.HYPHEN_MINUS) {
            this.currentToken.data += "-";
          } else if (cp === $2.EOF) {
            this._err(ERR.eofInComment);
            this._emitCurrentToken();
            this._emitEOFToken();
          } else {
            this.currentToken.data += "--";
            this._reconsumeInState(COMMENT_STATE);
          }
        }
        // Comment end bang state
        //------------------------------------------------------------------
        [COMMENT_END_BANG_STATE](cp) {
          if (cp === $2.HYPHEN_MINUS) {
            this.currentToken.data += "--!";
            this.state = COMMENT_END_DASH_STATE;
          } else if (cp === $2.GREATER_THAN_SIGN) {
            this._err(ERR.incorrectlyClosedComment);
            this.state = DATA_STATE;
            this._emitCurrentToken();
          } else if (cp === $2.EOF) {
            this._err(ERR.eofInComment);
            this._emitCurrentToken();
            this._emitEOFToken();
          } else {
            this.currentToken.data += "--!";
            this._reconsumeInState(COMMENT_STATE);
          }
        }
        // DOCTYPE state
        //------------------------------------------------------------------
        [DOCTYPE_STATE](cp) {
          if (isWhitespace2(cp)) {
            this.state = BEFORE_DOCTYPE_NAME_STATE;
          } else if (cp === $2.GREATER_THAN_SIGN) {
            this._reconsumeInState(BEFORE_DOCTYPE_NAME_STATE);
          } else if (cp === $2.EOF) {
            this._err(ERR.eofInDoctype);
            this._createDoctypeToken(null);
            this.currentToken.forceQuirks = true;
            this._emitCurrentToken();
            this._emitEOFToken();
          } else {
            this._err(ERR.missingWhitespaceBeforeDoctypeName);
            this._reconsumeInState(BEFORE_DOCTYPE_NAME_STATE);
          }
        }
        // Before DOCTYPE name state
        //------------------------------------------------------------------
        [BEFORE_DOCTYPE_NAME_STATE](cp) {
          if (isWhitespace2(cp)) {
            return;
          }
          if (isAsciiUpper(cp)) {
            this._createDoctypeToken(toAsciiLowerChar(cp));
            this.state = DOCTYPE_NAME_STATE;
          } else if (cp === $2.NULL) {
            this._err(ERR.unexpectedNullCharacter);
            this._createDoctypeToken(unicode2.REPLACEMENT_CHARACTER);
            this.state = DOCTYPE_NAME_STATE;
          } else if (cp === $2.GREATER_THAN_SIGN) {
            this._err(ERR.missingDoctypeName);
            this._createDoctypeToken(null);
            this.currentToken.forceQuirks = true;
            this._emitCurrentToken();
            this.state = DATA_STATE;
          } else if (cp === $2.EOF) {
            this._err(ERR.eofInDoctype);
            this._createDoctypeToken(null);
            this.currentToken.forceQuirks = true;
            this._emitCurrentToken();
            this._emitEOFToken();
          } else {
            this._createDoctypeToken(toChar(cp));
            this.state = DOCTYPE_NAME_STATE;
          }
        }
        // DOCTYPE name state
        //------------------------------------------------------------------
        [DOCTYPE_NAME_STATE](cp) {
          if (isWhitespace2(cp)) {
            this.state = AFTER_DOCTYPE_NAME_STATE;
          } else if (cp === $2.GREATER_THAN_SIGN) {
            this.state = DATA_STATE;
            this._emitCurrentToken();
          } else if (isAsciiUpper(cp)) {
            this.currentToken.name += toAsciiLowerChar(cp);
          } else if (cp === $2.NULL) {
            this._err(ERR.unexpectedNullCharacter);
            this.currentToken.name += unicode2.REPLACEMENT_CHARACTER;
          } else if (cp === $2.EOF) {
            this._err(ERR.eofInDoctype);
            this.currentToken.forceQuirks = true;
            this._emitCurrentToken();
            this._emitEOFToken();
          } else {
            this.currentToken.name += toChar(cp);
          }
        }
        // After DOCTYPE name state
        //------------------------------------------------------------------
        [AFTER_DOCTYPE_NAME_STATE](cp) {
          if (isWhitespace2(cp)) {
            return;
          }
          if (cp === $2.GREATER_THAN_SIGN) {
            this.state = DATA_STATE;
            this._emitCurrentToken();
          } else if (cp === $2.EOF) {
            this._err(ERR.eofInDoctype);
            this.currentToken.forceQuirks = true;
            this._emitCurrentToken();
            this._emitEOFToken();
          } else if (this._consumeSequenceIfMatch($$.PUBLIC_STRING, cp, false)) {
            this.state = AFTER_DOCTYPE_PUBLIC_KEYWORD_STATE;
          } else if (this._consumeSequenceIfMatch($$.SYSTEM_STRING, cp, false)) {
            this.state = AFTER_DOCTYPE_SYSTEM_KEYWORD_STATE;
          } else if (!this._ensureHibernation()) {
            this._err(ERR.invalidCharacterSequenceAfterDoctypeName);
            this.currentToken.forceQuirks = true;
            this._reconsumeInState(BOGUS_DOCTYPE_STATE);
          }
        }
        // After DOCTYPE public keyword state
        //------------------------------------------------------------------
        [AFTER_DOCTYPE_PUBLIC_KEYWORD_STATE](cp) {
          if (isWhitespace2(cp)) {
            this.state = BEFORE_DOCTYPE_PUBLIC_IDENTIFIER_STATE;
          } else if (cp === $2.QUOTATION_MARK) {
            this._err(ERR.missingWhitespaceAfterDoctypePublicKeyword);
            this.currentToken.publicId = "";
            this.state = DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED_STATE;
          } else if (cp === $2.APOSTROPHE) {
            this._err(ERR.missingWhitespaceAfterDoctypePublicKeyword);
            this.currentToken.publicId = "";
            this.state = DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED_STATE;
          } else if (cp === $2.GREATER_THAN_SIGN) {
            this._err(ERR.missingDoctypePublicIdentifier);
            this.currentToken.forceQuirks = true;
            this.state = DATA_STATE;
            this._emitCurrentToken();
          } else if (cp === $2.EOF) {
            this._err(ERR.eofInDoctype);
            this.currentToken.forceQuirks = true;
            this._emitCurrentToken();
            this._emitEOFToken();
          } else {
            this._err(ERR.missingQuoteBeforeDoctypePublicIdentifier);
            this.currentToken.forceQuirks = true;
            this._reconsumeInState(BOGUS_DOCTYPE_STATE);
          }
        }
        // Before DOCTYPE public identifier state
        //------------------------------------------------------------------
        [BEFORE_DOCTYPE_PUBLIC_IDENTIFIER_STATE](cp) {
          if (isWhitespace2(cp)) {
            return;
          }
          if (cp === $2.QUOTATION_MARK) {
            this.currentToken.publicId = "";
            this.state = DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED_STATE;
          } else if (cp === $2.APOSTROPHE) {
            this.currentToken.publicId = "";
            this.state = DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED_STATE;
          } else if (cp === $2.GREATER_THAN_SIGN) {
            this._err(ERR.missingDoctypePublicIdentifier);
            this.currentToken.forceQuirks = true;
            this.state = DATA_STATE;
            this._emitCurrentToken();
          } else if (cp === $2.EOF) {
            this._err(ERR.eofInDoctype);
            this.currentToken.forceQuirks = true;
            this._emitCurrentToken();
            this._emitEOFToken();
          } else {
            this._err(ERR.missingQuoteBeforeDoctypePublicIdentifier);
            this.currentToken.forceQuirks = true;
            this._reconsumeInState(BOGUS_DOCTYPE_STATE);
          }
        }
        // DOCTYPE public identifier (double-quoted) state
        //------------------------------------------------------------------
        [DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED_STATE](cp) {
          if (cp === $2.QUOTATION_MARK) {
            this.state = AFTER_DOCTYPE_PUBLIC_IDENTIFIER_STATE;
          } else if (cp === $2.NULL) {
            this._err(ERR.unexpectedNullCharacter);
            this.currentToken.publicId += unicode2.REPLACEMENT_CHARACTER;
          } else if (cp === $2.GREATER_THAN_SIGN) {
            this._err(ERR.abruptDoctypePublicIdentifier);
            this.currentToken.forceQuirks = true;
            this._emitCurrentToken();
            this.state = DATA_STATE;
          } else if (cp === $2.EOF) {
            this._err(ERR.eofInDoctype);
            this.currentToken.forceQuirks = true;
            this._emitCurrentToken();
            this._emitEOFToken();
          } else {
            this.currentToken.publicId += toChar(cp);
          }
        }
        // DOCTYPE public identifier (single-quoted) state
        //------------------------------------------------------------------
        [DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED_STATE](cp) {
          if (cp === $2.APOSTROPHE) {
            this.state = AFTER_DOCTYPE_PUBLIC_IDENTIFIER_STATE;
          } else if (cp === $2.NULL) {
            this._err(ERR.unexpectedNullCharacter);
            this.currentToken.publicId += unicode2.REPLACEMENT_CHARACTER;
          } else if (cp === $2.GREATER_THAN_SIGN) {
            this._err(ERR.abruptDoctypePublicIdentifier);
            this.currentToken.forceQuirks = true;
            this._emitCurrentToken();
            this.state = DATA_STATE;
          } else if (cp === $2.EOF) {
            this._err(ERR.eofInDoctype);
            this.currentToken.forceQuirks = true;
            this._emitCurrentToken();
            this._emitEOFToken();
          } else {
            this.currentToken.publicId += toChar(cp);
          }
        }
        // After DOCTYPE public identifier state
        //------------------------------------------------------------------
        [AFTER_DOCTYPE_PUBLIC_IDENTIFIER_STATE](cp) {
          if (isWhitespace2(cp)) {
            this.state = BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS_STATE;
          } else if (cp === $2.GREATER_THAN_SIGN) {
            this.state = DATA_STATE;
            this._emitCurrentToken();
          } else if (cp === $2.QUOTATION_MARK) {
            this._err(ERR.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers);
            this.currentToken.systemId = "";
            this.state = DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED_STATE;
          } else if (cp === $2.APOSTROPHE) {
            this._err(ERR.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers);
            this.currentToken.systemId = "";
            this.state = DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED_STATE;
          } else if (cp === $2.EOF) {
            this._err(ERR.eofInDoctype);
            this.currentToken.forceQuirks = true;
            this._emitCurrentToken();
            this._emitEOFToken();
          } else {
            this._err(ERR.missingQuoteBeforeDoctypeSystemIdentifier);
            this.currentToken.forceQuirks = true;
            this._reconsumeInState(BOGUS_DOCTYPE_STATE);
          }
        }
        // Between DOCTYPE public and system identifiers state
        //------------------------------------------------------------------
        [BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS_STATE](cp) {
          if (isWhitespace2(cp)) {
            return;
          }
          if (cp === $2.GREATER_THAN_SIGN) {
            this._emitCurrentToken();
            this.state = DATA_STATE;
          } else if (cp === $2.QUOTATION_MARK) {
            this.currentToken.systemId = "";
            this.state = DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED_STATE;
          } else if (cp === $2.APOSTROPHE) {
            this.currentToken.systemId = "";
            this.state = DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED_STATE;
          } else if (cp === $2.EOF) {
            this._err(ERR.eofInDoctype);
            this.currentToken.forceQuirks = true;
            this._emitCurrentToken();
            this._emitEOFToken();
          } else {
            this._err(ERR.missingQuoteBeforeDoctypeSystemIdentifier);
            this.currentToken.forceQuirks = true;
            this._reconsumeInState(BOGUS_DOCTYPE_STATE);
          }
        }
        // After DOCTYPE system keyword state
        //------------------------------------------------------------------
        [AFTER_DOCTYPE_SYSTEM_KEYWORD_STATE](cp) {
          if (isWhitespace2(cp)) {
            this.state = BEFORE_DOCTYPE_SYSTEM_IDENTIFIER_STATE;
          } else if (cp === $2.QUOTATION_MARK) {
            this._err(ERR.missingWhitespaceAfterDoctypeSystemKeyword);
            this.currentToken.systemId = "";
            this.state = DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED_STATE;
          } else if (cp === $2.APOSTROPHE) {
            this._err(ERR.missingWhitespaceAfterDoctypeSystemKeyword);
            this.currentToken.systemId = "";
            this.state = DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED_STATE;
          } else if (cp === $2.GREATER_THAN_SIGN) {
            this._err(ERR.missingDoctypeSystemIdentifier);
            this.currentToken.forceQuirks = true;
            this.state = DATA_STATE;
            this._emitCurrentToken();
          } else if (cp === $2.EOF) {
            this._err(ERR.eofInDoctype);
            this.currentToken.forceQuirks = true;
            this._emitCurrentToken();
            this._emitEOFToken();
          } else {
            this._err(ERR.missingQuoteBeforeDoctypeSystemIdentifier);
            this.currentToken.forceQuirks = true;
            this._reconsumeInState(BOGUS_DOCTYPE_STATE);
          }
        }
        // Before DOCTYPE system identifier state
        //------------------------------------------------------------------
        [BEFORE_DOCTYPE_SYSTEM_IDENTIFIER_STATE](cp) {
          if (isWhitespace2(cp)) {
            return;
          }
          if (cp === $2.QUOTATION_MARK) {
            this.currentToken.systemId = "";
            this.state = DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED_STATE;
          } else if (cp === $2.APOSTROPHE) {
            this.currentToken.systemId = "";
            this.state = DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED_STATE;
          } else if (cp === $2.GREATER_THAN_SIGN) {
            this._err(ERR.missingDoctypeSystemIdentifier);
            this.currentToken.forceQuirks = true;
            this.state = DATA_STATE;
            this._emitCurrentToken();
          } else if (cp === $2.EOF) {
            this._err(ERR.eofInDoctype);
            this.currentToken.forceQuirks = true;
            this._emitCurrentToken();
            this._emitEOFToken();
          } else {
            this._err(ERR.missingQuoteBeforeDoctypeSystemIdentifier);
            this.currentToken.forceQuirks = true;
            this._reconsumeInState(BOGUS_DOCTYPE_STATE);
          }
        }
        // DOCTYPE system identifier (double-quoted) state
        //------------------------------------------------------------------
        [DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED_STATE](cp) {
          if (cp === $2.QUOTATION_MARK) {
            this.state = AFTER_DOCTYPE_SYSTEM_IDENTIFIER_STATE;
          } else if (cp === $2.NULL) {
            this._err(ERR.unexpectedNullCharacter);
            this.currentToken.systemId += unicode2.REPLACEMENT_CHARACTER;
          } else if (cp === $2.GREATER_THAN_SIGN) {
            this._err(ERR.abruptDoctypeSystemIdentifier);
            this.currentToken.forceQuirks = true;
            this._emitCurrentToken();
            this.state = DATA_STATE;
          } else if (cp === $2.EOF) {
            this._err(ERR.eofInDoctype);
            this.currentToken.forceQuirks = true;
            this._emitCurrentToken();
            this._emitEOFToken();
          } else {
            this.currentToken.systemId += toChar(cp);
          }
        }
        // DOCTYPE system identifier (single-quoted) state
        //------------------------------------------------------------------
        [DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED_STATE](cp) {
          if (cp === $2.APOSTROPHE) {
            this.state = AFTER_DOCTYPE_SYSTEM_IDENTIFIER_STATE;
          } else if (cp === $2.NULL) {
            this._err(ERR.unexpectedNullCharacter);
            this.currentToken.systemId += unicode2.REPLACEMENT_CHARACTER;
          } else if (cp === $2.GREATER_THAN_SIGN) {
            this._err(ERR.abruptDoctypeSystemIdentifier);
            this.currentToken.forceQuirks = true;
            this._emitCurrentToken();
            this.state = DATA_STATE;
          } else if (cp === $2.EOF) {
            this._err(ERR.eofInDoctype);
            this.currentToken.forceQuirks = true;
            this._emitCurrentToken();
            this._emitEOFToken();
          } else {
            this.currentToken.systemId += toChar(cp);
          }
        }
        // After DOCTYPE system identifier state
        //------------------------------------------------------------------
        [AFTER_DOCTYPE_SYSTEM_IDENTIFIER_STATE](cp) {
          if (isWhitespace2(cp)) {
            return;
          }
          if (cp === $2.GREATER_THAN_SIGN) {
            this._emitCurrentToken();
            this.state = DATA_STATE;
          } else if (cp === $2.EOF) {
            this._err(ERR.eofInDoctype);
            this.currentToken.forceQuirks = true;
            this._emitCurrentToken();
            this._emitEOFToken();
          } else {
            this._err(ERR.unexpectedCharacterAfterDoctypeSystemIdentifier);
            this._reconsumeInState(BOGUS_DOCTYPE_STATE);
          }
        }
        // Bogus DOCTYPE state
        //------------------------------------------------------------------
        [BOGUS_DOCTYPE_STATE](cp) {
          if (cp === $2.GREATER_THAN_SIGN) {
            this._emitCurrentToken();
            this.state = DATA_STATE;
          } else if (cp === $2.NULL) {
            this._err(ERR.unexpectedNullCharacter);
          } else if (cp === $2.EOF) {
            this._emitCurrentToken();
            this._emitEOFToken();
          }
        }
        // CDATA section state
        //------------------------------------------------------------------
        [CDATA_SECTION_STATE](cp) {
          if (cp === $2.RIGHT_SQUARE_BRACKET) {
            this.state = CDATA_SECTION_BRACKET_STATE;
          } else if (cp === $2.EOF) {
            this._err(ERR.eofInCdata);
            this._emitEOFToken();
          } else {
            this._emitCodePoint(cp);
          }
        }
        // CDATA section bracket state
        //------------------------------------------------------------------
        [CDATA_SECTION_BRACKET_STATE](cp) {
          if (cp === $2.RIGHT_SQUARE_BRACKET) {
            this.state = CDATA_SECTION_END_STATE;
          } else {
            this._emitChars("]");
            this._reconsumeInState(CDATA_SECTION_STATE);
          }
        }
        // CDATA section end state
        //------------------------------------------------------------------
        [CDATA_SECTION_END_STATE](cp) {
          if (cp === $2.GREATER_THAN_SIGN) {
            this.state = DATA_STATE;
          } else if (cp === $2.RIGHT_SQUARE_BRACKET) {
            this._emitChars("]");
          } else {
            this._emitChars("]]");
            this._reconsumeInState(CDATA_SECTION_STATE);
          }
        }
        // Character reference state
        //------------------------------------------------------------------
        [CHARACTER_REFERENCE_STATE](cp) {
          this.tempBuff = [$2.AMPERSAND];
          if (cp === $2.NUMBER_SIGN) {
            this.tempBuff.push(cp);
            this.state = NUMERIC_CHARACTER_REFERENCE_STATE;
          } else if (isAsciiAlphaNumeric2(cp)) {
            this._reconsumeInState(NAMED_CHARACTER_REFERENCE_STATE);
          } else {
            this._flushCodePointsConsumedAsCharacterReference();
            this._reconsumeInState(this.returnState);
          }
        }
        // Named character reference state
        //------------------------------------------------------------------
        [NAMED_CHARACTER_REFERENCE_STATE](cp) {
          const matchResult = this._matchNamedCharacterReference(cp);
          if (this._ensureHibernation()) {
            this.tempBuff = [$2.AMPERSAND];
          } else if (matchResult) {
            const withSemicolon = this.tempBuff[this.tempBuff.length - 1] === $2.SEMICOLON;
            if (!this._isCharacterReferenceAttributeQuirk(withSemicolon)) {
              if (!withSemicolon) {
                this._errOnNextCodePoint(ERR.missingSemicolonAfterCharacterReference);
              }
              this.tempBuff = matchResult;
            }
            this._flushCodePointsConsumedAsCharacterReference();
            this.state = this.returnState;
          } else {
            this._flushCodePointsConsumedAsCharacterReference();
            this.state = AMBIGUOUS_AMPERSAND_STATE;
          }
        }
        // Ambiguos ampersand state
        //------------------------------------------------------------------
        [AMBIGUOUS_AMPERSAND_STATE](cp) {
          if (isAsciiAlphaNumeric2(cp)) {
            if (this._isCharacterReferenceInAttribute()) {
              this.currentAttr.value += toChar(cp);
            } else {
              this._emitCodePoint(cp);
            }
          } else {
            if (cp === $2.SEMICOLON) {
              this._err(ERR.unknownNamedCharacterReference);
            }
            this._reconsumeInState(this.returnState);
          }
        }
        // Numeric character reference state
        //------------------------------------------------------------------
        [NUMERIC_CHARACTER_REFERENCE_STATE](cp) {
          this.charRefCode = 0;
          if (cp === $2.LATIN_SMALL_X || cp === $2.LATIN_CAPITAL_X) {
            this.tempBuff.push(cp);
            this.state = HEXADEMICAL_CHARACTER_REFERENCE_START_STATE;
          } else {
            this._reconsumeInState(DECIMAL_CHARACTER_REFERENCE_START_STATE);
          }
        }
        // Hexademical character reference start state
        //------------------------------------------------------------------
        [HEXADEMICAL_CHARACTER_REFERENCE_START_STATE](cp) {
          if (isAsciiHexDigit(cp)) {
            this._reconsumeInState(HEXADEMICAL_CHARACTER_REFERENCE_STATE);
          } else {
            this._err(ERR.absenceOfDigitsInNumericCharacterReference);
            this._flushCodePointsConsumedAsCharacterReference();
            this._reconsumeInState(this.returnState);
          }
        }
        // Decimal character reference start state
        //------------------------------------------------------------------
        [DECIMAL_CHARACTER_REFERENCE_START_STATE](cp) {
          if (isAsciiDigit(cp)) {
            this._reconsumeInState(DECIMAL_CHARACTER_REFERENCE_STATE);
          } else {
            this._err(ERR.absenceOfDigitsInNumericCharacterReference);
            this._flushCodePointsConsumedAsCharacterReference();
            this._reconsumeInState(this.returnState);
          }
        }
        // Hexademical character reference state
        //------------------------------------------------------------------
        [HEXADEMICAL_CHARACTER_REFERENCE_STATE](cp) {
          if (isAsciiUpperHexDigit(cp)) {
            this.charRefCode = this.charRefCode * 16 + cp - 55;
          } else if (isAsciiLowerHexDigit(cp)) {
            this.charRefCode = this.charRefCode * 16 + cp - 87;
          } else if (isAsciiDigit(cp)) {
            this.charRefCode = this.charRefCode * 16 + cp - 48;
          } else if (cp === $2.SEMICOLON) {
            this.state = NUMERIC_CHARACTER_REFERENCE_END_STATE;
          } else {
            this._err(ERR.missingSemicolonAfterCharacterReference);
            this._reconsumeInState(NUMERIC_CHARACTER_REFERENCE_END_STATE);
          }
        }
        // Decimal character reference state
        //------------------------------------------------------------------
        [DECIMAL_CHARACTER_REFERENCE_STATE](cp) {
          if (isAsciiDigit(cp)) {
            this.charRefCode = this.charRefCode * 10 + cp - 48;
          } else if (cp === $2.SEMICOLON) {
            this.state = NUMERIC_CHARACTER_REFERENCE_END_STATE;
          } else {
            this._err(ERR.missingSemicolonAfterCharacterReference);
            this._reconsumeInState(NUMERIC_CHARACTER_REFERENCE_END_STATE);
          }
        }
        // Numeric character reference end state
        //------------------------------------------------------------------
        [NUMERIC_CHARACTER_REFERENCE_END_STATE]() {
          if (this.charRefCode === $2.NULL) {
            this._err(ERR.nullCharacterReference);
            this.charRefCode = $2.REPLACEMENT_CHARACTER;
          } else if (this.charRefCode > 1114111) {
            this._err(ERR.characterReferenceOutsideUnicodeRange);
            this.charRefCode = $2.REPLACEMENT_CHARACTER;
          } else if (unicode2.isSurrogate(this.charRefCode)) {
            this._err(ERR.surrogateCharacterReference);
            this.charRefCode = $2.REPLACEMENT_CHARACTER;
          } else if (unicode2.isUndefinedCodePoint(this.charRefCode)) {
            this._err(ERR.noncharacterCharacterReference);
          } else if (unicode2.isControlCodePoint(this.charRefCode) || this.charRefCode === $2.CARRIAGE_RETURN) {
            this._err(ERR.controlCharacterReference);
            const replacement = C1_CONTROLS_REFERENCE_REPLACEMENTS[this.charRefCode];
            if (replacement) {
              this.charRefCode = replacement;
            }
          }
          this.tempBuff = [this.charRefCode];
          this._flushCodePointsConsumedAsCharacterReference();
          this._reconsumeInState(this.returnState);
        }
      }
      Tokenizer2.CHARACTER_TOKEN = "CHARACTER_TOKEN";
      Tokenizer2.NULL_CHARACTER_TOKEN = "NULL_CHARACTER_TOKEN";
      Tokenizer2.WHITESPACE_CHARACTER_TOKEN = "WHITESPACE_CHARACTER_TOKEN";
      Tokenizer2.START_TAG_TOKEN = "START_TAG_TOKEN";
      Tokenizer2.END_TAG_TOKEN = "END_TAG_TOKEN";
      Tokenizer2.COMMENT_TOKEN = "COMMENT_TOKEN";
      Tokenizer2.DOCTYPE_TOKEN = "DOCTYPE_TOKEN";
      Tokenizer2.EOF_TOKEN = "EOF_TOKEN";
      Tokenizer2.HIBERNATION_TOKEN = "HIBERNATION_TOKEN";
      Tokenizer2.MODE = {
        DATA: DATA_STATE,
        RCDATA: RCDATA_STATE,
        RAWTEXT: RAWTEXT_STATE,
        SCRIPT_DATA: SCRIPT_DATA_STATE,
        PLAINTEXT: PLAINTEXT_STATE
      };
      Tokenizer2.getTokenAttr = function(token2, attrName) {
        for (let i2 = token2.attrs.length - 1; i2 >= 0; i2--) {
          if (token2.attrs[i2].name === attrName) {
            return token2.attrs[i2].value;
          }
        }
        return null;
      };
      tokenizer = Tokenizer2;
      return tokenizer;
    }
    var html = {};
    var hasRequiredHtml;
    function requireHtml() {
      if (hasRequiredHtml) return html;
      hasRequiredHtml = 1;
      const NS = html.NAMESPACES = {
        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/"
      };
      html.ATTRS = {
        TYPE: "type",
        ACTION: "action",
        ENCODING: "encoding",
        PROMPT: "prompt",
        NAME: "name",
        COLOR: "color",
        FACE: "face",
        SIZE: "size"
      };
      html.DOCUMENT_MODE = {
        NO_QUIRKS: "no-quirks",
        QUIRKS: "quirks",
        LIMITED_QUIRKS: "limited-quirks"
      };
      const $2 = html.TAG_NAMES = {
        A: "a",
        ADDRESS: "address",
        ANNOTATION_XML: "annotation-xml",
        APPLET: "applet",
        AREA: "area",
        ARTICLE: "article",
        ASIDE: "aside",
        B: "b",
        BASE: "base",
        BASEFONT: "basefont",
        BGSOUND: "bgsound",
        BIG: "big",
        BLOCKQUOTE: "blockquote",
        BODY: "body",
        BR: "br",
        BUTTON: "button",
        CAPTION: "caption",
        CENTER: "center",
        CODE: "code",
        COL: "col",
        COLGROUP: "colgroup",
        DD: "dd",
        DESC: "desc",
        DETAILS: "details",
        DIALOG: "dialog",
        DIR: "dir",
        DIV: "div",
        DL: "dl",
        DT: "dt",
        EM: "em",
        EMBED: "embed",
        FIELDSET: "fieldset",
        FIGCAPTION: "figcaption",
        FIGURE: "figure",
        FONT: "font",
        FOOTER: "footer",
        FOREIGN_OBJECT: "foreignObject",
        FORM: "form",
        FRAME: "frame",
        FRAMESET: "frameset",
        H1: "h1",
        H2: "h2",
        H3: "h3",
        H4: "h4",
        H5: "h5",
        H6: "h6",
        HEAD: "head",
        HEADER: "header",
        HGROUP: "hgroup",
        HR: "hr",
        HTML: "html",
        I: "i",
        IMG: "img",
        IMAGE: "image",
        INPUT: "input",
        IFRAME: "iframe",
        KEYGEN: "keygen",
        LABEL: "label",
        LI: "li",
        LINK: "link",
        LISTING: "listing",
        MAIN: "main",
        MALIGNMARK: "malignmark",
        MARQUEE: "marquee",
        MATH: "math",
        MENU: "menu",
        META: "meta",
        MGLYPH: "mglyph",
        MI: "mi",
        MO: "mo",
        MN: "mn",
        MS: "ms",
        MTEXT: "mtext",
        NAV: "nav",
        NOBR: "nobr",
        NOFRAMES: "noframes",
        NOEMBED: "noembed",
        NOSCRIPT: "noscript",
        OBJECT: "object",
        OL: "ol",
        OPTGROUP: "optgroup",
        OPTION: "option",
        P: "p",
        PARAM: "param",
        PLAINTEXT: "plaintext",
        PRE: "pre",
        RB: "rb",
        RP: "rp",
        RT: "rt",
        RTC: "rtc",
        RUBY: "ruby",
        S: "s",
        SCRIPT: "script",
        SECTION: "section",
        SELECT: "select",
        SOURCE: "source",
        SMALL: "small",
        SPAN: "span",
        STRIKE: "strike",
        STRONG: "strong",
        STYLE: "style",
        SUB: "sub",
        SUMMARY: "summary",
        SUP: "sup",
        TABLE: "table",
        TBODY: "tbody",
        TEMPLATE: "template",
        TEXTAREA: "textarea",
        TFOOT: "tfoot",
        TD: "td",
        TH: "th",
        THEAD: "thead",
        TITLE: "title",
        TR: "tr",
        TRACK: "track",
        TT: "tt",
        U: "u",
        UL: "ul",
        SVG: "svg",
        VAR: "var",
        WBR: "wbr",
        XMP: "xmp"
      };
      html.SPECIAL_ELEMENTS = {
        [NS.HTML]: {
          [$2.ADDRESS]: true,
          [$2.APPLET]: true,
          [$2.AREA]: true,
          [$2.ARTICLE]: true,
          [$2.ASIDE]: true,
          [$2.BASE]: true,
          [$2.BASEFONT]: true,
          [$2.BGSOUND]: true,
          [$2.BLOCKQUOTE]: true,
          [$2.BODY]: true,
          [$2.BR]: true,
          [$2.BUTTON]: true,
          [$2.CAPTION]: true,
          [$2.CENTER]: true,
          [$2.COL]: true,
          [$2.COLGROUP]: true,
          [$2.DD]: true,
          [$2.DETAILS]: true,
          [$2.DIR]: true,
          [$2.DIV]: true,
          [$2.DL]: true,
          [$2.DT]: true,
          [$2.EMBED]: true,
          [$2.FIELDSET]: true,
          [$2.FIGCAPTION]: true,
          [$2.FIGURE]: true,
          [$2.FOOTER]: true,
          [$2.FORM]: true,
          [$2.FRAME]: true,
          [$2.FRAMESET]: true,
          [$2.H1]: true,
          [$2.H2]: true,
          [$2.H3]: true,
          [$2.H4]: true,
          [$2.H5]: true,
          [$2.H6]: true,
          [$2.HEAD]: true,
          [$2.HEADER]: true,
          [$2.HGROUP]: true,
          [$2.HR]: true,
          [$2.HTML]: true,
          [$2.IFRAME]: true,
          [$2.IMG]: true,
          [$2.INPUT]: true,
          [$2.LI]: true,
          [$2.LINK]: true,
          [$2.LISTING]: true,
          [$2.MAIN]: true,
          [$2.MARQUEE]: true,
          [$2.MENU]: true,
          [$2.META]: true,
          [$2.NAV]: true,
          [$2.NOEMBED]: true,
          [$2.NOFRAMES]: true,
          [$2.NOSCRIPT]: true,
          [$2.OBJECT]: true,
          [$2.OL]: true,
          [$2.P]: true,
          [$2.PARAM]: true,
          [$2.PLAINTEXT]: true,
          [$2.PRE]: true,
          [$2.SCRIPT]: true,
          [$2.SECTION]: true,
          [$2.SELECT]: true,
          [$2.SOURCE]: true,
          [$2.STYLE]: true,
          [$2.SUMMARY]: true,
          [$2.TABLE]: true,
          [$2.TBODY]: true,
          [$2.TD]: true,
          [$2.TEMPLATE]: true,
          [$2.TEXTAREA]: true,
          [$2.TFOOT]: true,
          [$2.TH]: true,
          [$2.THEAD]: true,
          [$2.TITLE]: true,
          [$2.TR]: true,
          [$2.TRACK]: true,
          [$2.UL]: true,
          [$2.WBR]: true,
          [$2.XMP]: true
        },
        [NS.MATHML]: {
          [$2.MI]: true,
          [$2.MO]: true,
          [$2.MN]: true,
          [$2.MS]: true,
          [$2.MTEXT]: true,
          [$2.ANNOTATION_XML]: true
        },
        [NS.SVG]: {
          [$2.TITLE]: true,
          [$2.FOREIGN_OBJECT]: true,
          [$2.DESC]: true
        }
      };
      return html;
    }
    var openElementStack;
    var hasRequiredOpenElementStack;
    function requireOpenElementStack() {
      if (hasRequiredOpenElementStack) return openElementStack;
      hasRequiredOpenElementStack = 1;
      const HTML = requireHtml();
      const $2 = HTML.TAG_NAMES;
      const NS = HTML.NAMESPACES;
      function isImpliedEndTagRequired(tn2) {
        switch (tn2.length) {
          case 1:
            return tn2 === $2.P;
          case 2:
            return tn2 === $2.RB || tn2 === $2.RP || tn2 === $2.RT || tn2 === $2.DD || tn2 === $2.DT || tn2 === $2.LI;
          case 3:
            return tn2 === $2.RTC;
          case 6:
            return tn2 === $2.OPTION;
          case 8:
            return tn2 === $2.OPTGROUP;
        }
        return false;
      }
      function isImpliedEndTagRequiredThoroughly(tn2) {
        switch (tn2.length) {
          case 1:
            return tn2 === $2.P;
          case 2:
            return tn2 === $2.RB || tn2 === $2.RP || tn2 === $2.RT || tn2 === $2.DD || tn2 === $2.DT || tn2 === $2.LI || tn2 === $2.TD || tn2 === $2.TH || tn2 === $2.TR;
          case 3:
            return tn2 === $2.RTC;
          case 5:
            return tn2 === $2.TBODY || tn2 === $2.TFOOT || tn2 === $2.THEAD;
          case 6:
            return tn2 === $2.OPTION;
          case 7:
            return tn2 === $2.CAPTION;
          case 8:
            return tn2 === $2.OPTGROUP || tn2 === $2.COLGROUP;
        }
        return false;
      }
      function isScopingElement(tn2, ns) {
        switch (tn2.length) {
          case 2:
            if (tn2 === $2.TD || tn2 === $2.TH) {
              return ns === NS.HTML;
            } else if (tn2 === $2.MI || tn2 === $2.MO || tn2 === $2.MN || tn2 === $2.MS) {
              return ns === NS.MATHML;
            }
            break;
          case 4:
            if (tn2 === $2.HTML) {
              return ns === NS.HTML;
            } else if (tn2 === $2.DESC) {
              return ns === NS.SVG;
            }
            break;
          case 5:
            if (tn2 === $2.TABLE) {
              return ns === NS.HTML;
            } else if (tn2 === $2.MTEXT) {
              return ns === NS.MATHML;
            } else if (tn2 === $2.TITLE) {
              return ns === NS.SVG;
            }
            break;
          case 6:
            return (tn2 === $2.APPLET || tn2 === $2.OBJECT) && ns === NS.HTML;
          case 7:
            return (tn2 === $2.CAPTION || tn2 === $2.MARQUEE) && ns === NS.HTML;
          case 8:
            return tn2 === $2.TEMPLATE && ns === NS.HTML;
          case 13:
            return tn2 === $2.FOREIGN_OBJECT && ns === NS.SVG;
          case 14:
            return tn2 === $2.ANNOTATION_XML && ns === NS.MATHML;
        }
        return false;
      }
      class OpenElementStack {
        constructor(document2, treeAdapter) {
          this.stackTop = -1;
          this.items = [];
          this.current = document2;
          this.currentTagName = null;
          this.currentTmplContent = null;
          this.tmplCount = 0;
          this.treeAdapter = treeAdapter;
        }
        //Index of element
        _indexOf(element) {
          let idx = -1;
          for (let i2 = this.stackTop; i2 >= 0; i2--) {
            if (this.items[i2] === element) {
              idx = i2;
              break;
            }
          }
          return idx;
        }
        //Update current element
        _isInTemplate() {
          return this.currentTagName === $2.TEMPLATE && this.treeAdapter.getNamespaceURI(this.current) === NS.HTML;
        }
        _updateCurrentElement() {
          this.current = this.items[this.stackTop];
          this.currentTagName = this.current && this.treeAdapter.getTagName(this.current);
          this.currentTmplContent = this._isInTemplate() ? this.treeAdapter.getTemplateContent(this.current) : null;
        }
        //Mutations
        push(element) {
          this.items[++this.stackTop] = element;
          this._updateCurrentElement();
          if (this._isInTemplate()) {
            this.tmplCount++;
          }
        }
        pop() {
          this.stackTop--;
          if (this.tmplCount > 0 && this._isInTemplate()) {
            this.tmplCount--;
          }
          this._updateCurrentElement();
        }
        replace(oldElement, newElement) {
          const idx = this._indexOf(oldElement);
          this.items[idx] = newElement;
          if (idx === this.stackTop) {
            this._updateCurrentElement();
          }
        }
        insertAfter(referenceElement, newElement) {
          const insertionIdx = this._indexOf(referenceElement) + 1;
          this.items.splice(insertionIdx, 0, newElement);
          if (insertionIdx === ++this.stackTop) {
            this._updateCurrentElement();
          }
        }
        popUntilTagNamePopped(tagName) {
          while (this.stackTop > -1) {
            const tn2 = this.currentTagName;
            const ns = this.treeAdapter.getNamespaceURI(this.current);
            this.pop();
            if (tn2 === tagName && ns === NS.HTML) {
              break;
            }
          }
        }
        popUntilElementPopped(element) {
          while (this.stackTop > -1) {
            const poppedElement = this.current;
            this.pop();
            if (poppedElement === element) {
              break;
            }
          }
        }
        popUntilNumberedHeaderPopped() {
          while (this.stackTop > -1) {
            const tn2 = this.currentTagName;
            const ns = this.treeAdapter.getNamespaceURI(this.current);
            this.pop();
            if (tn2 === $2.H1 || tn2 === $2.H2 || tn2 === $2.H3 || tn2 === $2.H4 || tn2 === $2.H5 || tn2 === $2.H6 && ns === NS.HTML) {
              break;
            }
          }
        }
        popUntilTableCellPopped() {
          while (this.stackTop > -1) {
            const tn2 = this.currentTagName;
            const ns = this.treeAdapter.getNamespaceURI(this.current);
            this.pop();
            if (tn2 === $2.TD || tn2 === $2.TH && ns === NS.HTML) {
              break;
            }
          }
        }
        popAllUpToHtmlElement() {
          this.stackTop = 0;
          this._updateCurrentElement();
        }
        clearBackToTableContext() {
          while (this.currentTagName !== $2.TABLE && this.currentTagName !== $2.TEMPLATE && this.currentTagName !== $2.HTML || this.treeAdapter.getNamespaceURI(this.current) !== NS.HTML) {
            this.pop();
          }
        }
        clearBackToTableBodyContext() {
          while (this.currentTagName !== $2.TBODY && this.currentTagName !== $2.TFOOT && this.currentTagName !== $2.THEAD && this.currentTagName !== $2.TEMPLATE && this.currentTagName !== $2.HTML || this.treeAdapter.getNamespaceURI(this.current) !== NS.HTML) {
            this.pop();
          }
        }
        clearBackToTableRowContext() {
          while (this.currentTagName !== $2.TR && this.currentTagName !== $2.TEMPLATE && this.currentTagName !== $2.HTML || this.treeAdapter.getNamespaceURI(this.current) !== NS.HTML) {
            this.pop();
          }
        }
        remove(element) {
          for (let i2 = this.stackTop; i2 >= 0; i2--) {
            if (this.items[i2] === element) {
              this.items.splice(i2, 1);
              this.stackTop--;
              this._updateCurrentElement();
              break;
            }
          }
        }
        //Search
        tryPeekProperlyNestedBodyElement() {
          const element = this.items[1];
          return element && this.treeAdapter.getTagName(element) === $2.BODY ? element : null;
        }
        contains(element) {
          return this._indexOf(element) > -1;
        }
        getCommonAncestor(element) {
          let elementIdx = this._indexOf(element);
          return --elementIdx >= 0 ? this.items[elementIdx] : null;
        }
        isRootHtmlElementCurrent() {
          return this.stackTop === 0 && this.currentTagName === $2.HTML;
        }
        //Element in scope
        hasInScope(tagName) {
          for (let i2 = this.stackTop; i2 >= 0; i2--) {
            const tn2 = this.treeAdapter.getTagName(this.items[i2]);
            const ns = this.treeAdapter.getNamespaceURI(this.items[i2]);
            if (tn2 === tagName && ns === NS.HTML) {
              return true;
            }
            if (isScopingElement(tn2, ns)) {
              return false;
            }
          }
          return true;
        }
        hasNumberedHeaderInScope() {
          for (let i2 = this.stackTop; i2 >= 0; i2--) {
            const tn2 = this.treeAdapter.getTagName(this.items[i2]);
            const ns = this.treeAdapter.getNamespaceURI(this.items[i2]);
            if ((tn2 === $2.H1 || tn2 === $2.H2 || tn2 === $2.H3 || tn2 === $2.H4 || tn2 === $2.H5 || tn2 === $2.H6) && ns === NS.HTML) {
              return true;
            }
            if (isScopingElement(tn2, ns)) {
              return false;
            }
          }
          return true;
        }
        hasInListItemScope(tagName) {
          for (let i2 = this.stackTop; i2 >= 0; i2--) {
            const tn2 = this.treeAdapter.getTagName(this.items[i2]);
            const ns = this.treeAdapter.getNamespaceURI(this.items[i2]);
            if (tn2 === tagName && ns === NS.HTML) {
              return true;
            }
            if ((tn2 === $2.UL || tn2 === $2.OL) && ns === NS.HTML || isScopingElement(tn2, ns)) {
              return false;
            }
          }
          return true;
        }
        hasInButtonScope(tagName) {
          for (let i2 = this.stackTop; i2 >= 0; i2--) {
            const tn2 = this.treeAdapter.getTagName(this.items[i2]);
            const ns = this.treeAdapter.getNamespaceURI(this.items[i2]);
            if (tn2 === tagName && ns === NS.HTML) {
              return true;
            }
            if (tn2 === $2.BUTTON && ns === NS.HTML || isScopingElement(tn2, ns)) {
              return false;
            }
          }
          return true;
        }
        hasInTableScope(tagName) {
          for (let i2 = this.stackTop; i2 >= 0; i2--) {
            const tn2 = this.treeAdapter.getTagName(this.items[i2]);
            const ns = this.treeAdapter.getNamespaceURI(this.items[i2]);
            if (ns !== NS.HTML) {
              continue;
            }
            if (tn2 === tagName) {
              return true;
            }
            if (tn2 === $2.TABLE || tn2 === $2.TEMPLATE || tn2 === $2.HTML) {
              return false;
            }
          }
          return true;
        }
        hasTableBodyContextInTableScope() {
          for (let i2 = this.stackTop; i2 >= 0; i2--) {
            const tn2 = this.treeAdapter.getTagName(this.items[i2]);
            const ns = this.treeAdapter.getNamespaceURI(this.items[i2]);
            if (ns !== NS.HTML) {
              continue;
            }
            if (tn2 === $2.TBODY || tn2 === $2.THEAD || tn2 === $2.TFOOT) {
              return true;
            }
            if (tn2 === $2.TABLE || tn2 === $2.HTML) {
              return false;
            }
          }
          return true;
        }
        hasInSelectScope(tagName) {
          for (let i2 = this.stackTop; i2 >= 0; i2--) {
            const tn2 = this.treeAdapter.getTagName(this.items[i2]);
            const ns = this.treeAdapter.getNamespaceURI(this.items[i2]);
            if (ns !== NS.HTML) {
              continue;
            }
            if (tn2 === tagName) {
              return true;
            }
            if (tn2 !== $2.OPTION && tn2 !== $2.OPTGROUP) {
              return false;
            }
          }
          return true;
        }
        //Implied end tags
        generateImpliedEndTags() {
          while (isImpliedEndTagRequired(this.currentTagName)) {
            this.pop();
          }
        }
        generateImpliedEndTagsThoroughly() {
          while (isImpliedEndTagRequiredThoroughly(this.currentTagName)) {
            this.pop();
          }
        }
        generateImpliedEndTagsWithExclusion(exclusionTagName) {
          while (isImpliedEndTagRequired(this.currentTagName) && this.currentTagName !== exclusionTagName) {
            this.pop();
          }
        }
      }
      openElementStack = OpenElementStack;
      return openElementStack;
    }
    var formattingElementList;
    var hasRequiredFormattingElementList;
    function requireFormattingElementList() {
      if (hasRequiredFormattingElementList) return formattingElementList;
      hasRequiredFormattingElementList = 1;
      const NOAH_ARK_CAPACITY = 3;
      class FormattingElementList {
        constructor(treeAdapter) {
          this.length = 0;
          this.entries = [];
          this.treeAdapter = treeAdapter;
          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(newElement) {
          const candidates = [];
          if (this.length >= NOAH_ARK_CAPACITY) {
            const neAttrsLength = this.treeAdapter.getAttrList(newElement).length;
            const neTagName = this.treeAdapter.getTagName(newElement);
            const neNamespaceURI = this.treeAdapter.getNamespaceURI(newElement);
            for (let i2 = this.length - 1; i2 >= 0; i2--) {
              const entry = this.entries[i2];
              if (entry.type === FormattingElementList.MARKER_ENTRY) {
                break;
              }
              const element = entry.element;
              const elementAttrs = this.treeAdapter.getAttrList(element);
              const isCandidate = this.treeAdapter.getTagName(element) === neTagName && this.treeAdapter.getNamespaceURI(element) === neNamespaceURI && elementAttrs.length === neAttrsLength;
              if (isCandidate) {
                candidates.push({ idx: i2, attrs: elementAttrs });
              }
            }
          }
          return candidates.length < NOAH_ARK_CAPACITY ? [] : candidates;
        }
        _ensureNoahArkCondition(newElement) {
          const candidates = this._getNoahArkConditionCandidates(newElement);
          let cLength = candidates.length;
          if (cLength) {
            const neAttrs = this.treeAdapter.getAttrList(newElement);
            const neAttrsLength = neAttrs.length;
            const neAttrsMap = /* @__PURE__ */ Object.create(null);
            for (let i2 = 0; i2 < neAttrsLength; i2++) {
              const neAttr = neAttrs[i2];
              neAttrsMap[neAttr.name] = neAttr.value;
            }
            for (let i2 = 0; i2 < neAttrsLength; i2++) {
              for (let j = 0; j < cLength; j++) {
                const cAttr = candidates[j].attrs[i2];
                if (neAttrsMap[cAttr.name] !== cAttr.value) {
                  candidates.splice(j, 1);
                  cLength--;
                }
                if (candidates.length < NOAH_ARK_CAPACITY) {
                  return;
                }
              }
            }
            for (let i2 = cLength - 1; i2 >= NOAH_ARK_CAPACITY - 1; i2--) {
              this.entries.splice(candidates[i2].idx, 1);
              this.length--;
            }
          }
        }
        //Mutations
        insertMarker() {
          this.entries.push({ type: FormattingElementList.MARKER_ENTRY });
          this.length++;
        }
        pushElement(element, token2) {
          this._ensureNoahArkCondition(element);
          this.entries.push({
            type: FormattingElementList.ELEMENT_ENTRY,
            element,
            token: token2
          });
          this.length++;
        }
        insertElementAfterBookmark(element, token2) {
          let bookmarkIdx = this.length - 1;
          for (; bookmarkIdx >= 0; bookmarkIdx--) {
            if (this.entries[bookmarkIdx] === this.bookmark) {
              break;
            }
          }
          this.entries.splice(bookmarkIdx + 1, 0, {
            type: FormattingElementList.ELEMENT_ENTRY,
            element,
            token: token2
          });
          this.length++;
        }
        removeEntry(entry) {
          for (let i2 = this.length - 1; i2 >= 0; i2--) {
            if (this.entries[i2] === entry) {
              this.entries.splice(i2, 1);
              this.length--;
              break;
            }
          }
        }
        clearToLastMarker() {
          while (this.length) {
            const entry = this.entries.pop();
            this.length--;
            if (entry.type === FormattingElementList.MARKER_ENTRY) {
              break;
            }
          }
        }
        //Search
        getElementEntryInScopeWithTagName(tagName) {
          for (let i2 = this.length - 1; i2 >= 0; i2--) {
            const entry = this.entries[i2];
            if (entry.type === FormattingElementList.MARKER_ENTRY) {
              return null;
            }
            if (this.treeAdapter.getTagName(entry.element) === tagName) {
              return entry;
            }
          }
          return null;
        }
        getElementEntry(element) {
          for (let i2 = this.length - 1; i2 >= 0; i2--) {
            const entry = this.entries[i2];
            if (entry.type === FormattingElementList.ELEMENT_ENTRY && entry.element === element) {
              return entry;
            }
          }
          return null;
        }
      }
      FormattingElementList.MARKER_ENTRY = "MARKER_ENTRY";
      FormattingElementList.ELEMENT_ENTRY = "ELEMENT_ENTRY";
      formattingElementList = FormattingElementList;
      return formattingElementList;
    }
    var mixin;
    var hasRequiredMixin;
    function requireMixin() {
      if (hasRequiredMixin) return mixin;
      hasRequiredMixin = 1;
      class Mixin {
        constructor(host) {
          const originalMethods = {};
          const overriddenMethods = this._getOverriddenMethods(this, originalMethods);
          for (const key2 of Object.keys(overriddenMethods)) {
            if (typeof overriddenMethods[key2] === "function") {
              originalMethods[key2] = host[key2];
              host[key2] = overriddenMethods[key2];
            }
          }
        }
        _getOverriddenMethods() {
          throw new Error("Not implemented");
        }
      }
      Mixin.install = function(host, Ctor, opts) {
        if (!host.__mixins) {
          host.__mixins = [];
        }
        for (let i2 = 0; i2 < host.__mixins.length; i2++) {
          if (host.__mixins[i2].constructor === Ctor) {
            return host.__mixins[i2];
          }
        }
        const mixin2 = new Ctor(host, opts);
        host.__mixins.push(mixin2);
        return mixin2;
      };
      mixin = Mixin;
      return mixin;
    }
    var preprocessorMixin$1;
    var hasRequiredPreprocessorMixin$1;
    function requirePreprocessorMixin$1() {
      if (hasRequiredPreprocessorMixin$1) return preprocessorMixin$1;
      hasRequiredPreprocessorMixin$1 = 1;
      const Mixin = requireMixin();
      class PositionTrackingPreprocessorMixin extends Mixin {
        constructor(preprocessor2) {
          super(preprocessor2);
          this.preprocessor = preprocessor2;
          this.isEol = false;
          this.lineStartPos = 0;
          this.droppedBufferSize = 0;
          this.offset = 0;
          this.col = 0;
          this.line = 1;
        }
        _getOverriddenMethods(mxn, orig) {
          return {
            advance() {
              const pos2 = this.pos + 1;
              const ch3 = this.html[pos2];
              if (mxn.isEol) {
                mxn.isEol = false;
                mxn.line++;
                mxn.lineStartPos = pos2;
              }
              if (ch3 === "\n" || ch3 === "\r" && this.html[pos2 + 1] !== "\n") {
                mxn.isEol = true;
              }
              mxn.col = pos2 - mxn.lineStartPos + 1;
              mxn.offset = mxn.droppedBufferSize + pos2;
              return orig.advance.call(this);
            },
            retreat() {
              orig.retreat.call(this);
              mxn.isEol = false;
              mxn.col = this.pos - mxn.lineStartPos + 1;
            },
            dropParsedChunk() {
              const prevPos = this.pos;
              orig.dropParsedChunk.call(this);
              const reduction = prevPos - this.pos;
              mxn.lineStartPos -= reduction;
              mxn.droppedBufferSize += reduction;
              mxn.offset = mxn.droppedBufferSize + this.pos;
            }
          };
        }
      }
      preprocessorMixin$1 = PositionTrackingPreprocessorMixin;
      return preprocessorMixin$1;
    }
    var tokenizerMixin$1;
    var hasRequiredTokenizerMixin$1;
    function requireTokenizerMixin$1() {
      if (hasRequiredTokenizerMixin$1) return tokenizerMixin$1;
      hasRequiredTokenizerMixin$1 = 1;
      const Mixin = requireMixin();
      const Tokenizer2 = requireTokenizer();
      const PositionTrackingPreprocessorMixin = requirePreprocessorMixin$1();
      class LocationInfoTokenizerMixin extends Mixin {
        constructor(tokenizer2) {
          super(tokenizer2);
          this.tokenizer = tokenizer2;
          this.posTracker = Mixin.install(tokenizer2.preprocessor, PositionTrackingPreprocessorMixin);
          this.currentAttrLocation = null;
          this.ctLoc = null;
        }
        _getCurrentLocation() {
          return {
            startLine: this.posTracker.line,
            startCol: this.posTracker.col,
            startOffset: this.posTracker.offset,
            endLine: -1,
            endCol: -1,
            endOffset: -1
          };
        }
        _attachCurrentAttrLocationInfo() {
          this.currentAttrLocation.endLine = this.posTracker.line;
          this.currentAttrLocation.endCol = this.posTracker.col;
          this.currentAttrLocation.endOffset = this.posTracker.offset;
          const currentToken = this.tokenizer.currentToken;
          const currentAttr = this.tokenizer.currentAttr;
          if (!currentToken.location.attrs) {
            currentToken.location.attrs = /* @__PURE__ */ Object.create(null);
          }
          currentToken.location.attrs[currentAttr.name] = this.currentAttrLocation;
        }
        _getOverriddenMethods(mxn, orig) {
          const methods = {
            _createStartTagToken() {
              orig._createStartTagToken.call(this);
              this.currentToken.location = mxn.ctLoc;
            },
            _createEndTagToken() {
              orig._createEndTagToken.call(this);
              this.currentToken.location = mxn.ctLoc;
            },
            _createCommentToken() {
              orig._createCommentToken.call(this);
              this.currentToken.location = mxn.ctLoc;
            },
            _createDoctypeToken(initialName) {
              orig._createDoctypeToken.call(this, initialName);
              this.currentToken.location = mxn.ctLoc;
            },
            _createCharacterToken(type, ch3) {
              orig._createCharacterToken.call(this, type, ch3);
              this.currentCharacterToken.location = mxn.ctLoc;
            },
            _createEOFToken() {
              orig._createEOFToken.call(this);
              this.currentToken.location = mxn._getCurrentLocation();
            },
            _createAttr(attrNameFirstCh) {
              orig._createAttr.call(this, attrNameFirstCh);
              mxn.currentAttrLocation = mxn._getCurrentLocation();
            },
            _leaveAttrName(toState) {
              orig._leaveAttrName.call(this, toState);
              mxn._attachCurrentAttrLocationInfo();
            },
            _leaveAttrValue(toState) {
              orig._leaveAttrValue.call(this, toState);
              mxn._attachCurrentAttrLocationInfo();
            },
            _emitCurrentToken() {
              const ctLoc = this.currentToken.location;
              if (this.currentCharacterToken) {
                this.currentCharacterToken.location.endLine = ctLoc.startLine;
                this.currentCharacterToken.location.endCol = ctLoc.startCol;
                this.currentCharacterToken.location.endOffset = ctLoc.startOffset;
              }
              if (this.currentToken.type === Tokenizer2.EOF_TOKEN) {
                ctLoc.endLine = ctLoc.startLine;
                ctLoc.endCol = ctLoc.startCol;
                ctLoc.endOffset = ctLoc.startOffset;
              } else {
                ctLoc.endLine = mxn.posTracker.line;
                ctLoc.endCol = mxn.posTracker.col + 1;
                ctLoc.endOffset = mxn.posTracker.offset + 1;
              }
              orig._emitCurrentToken.call(this);
            },
            _emitCurrentCharacterToken() {
              const ctLoc = this.currentCharacterToken && this.currentCharacterToken.location;
              if (ctLoc && ctLoc.endOffset === -1) {
                ctLoc.endLine = mxn.posTracker.line;
                ctLoc.endCol = mxn.posTracker.col;
                ctLoc.endOffset = mxn.posTracker.offset;
              }
              orig._emitCurrentCharacterToken.call(this);
            }
          };
          Object.keys(Tokenizer2.MODE).forEach((modeName) => {
            const state = Tokenizer2.MODE[modeName];
            methods[state] = function(cp) {
              mxn.ctLoc = mxn._getCurrentLocation();
              orig[state].call(this, cp);
            };
          });
          return methods;
        }
      }
      tokenizerMixin$1 = LocationInfoTokenizerMixin;
      return tokenizerMixin$1;
    }
    var openElementStackMixin;
    var hasRequiredOpenElementStackMixin;
    function requireOpenElementStackMixin() {
      if (hasRequiredOpenElementStackMixin) return openElementStackMixin;
      hasRequiredOpenElementStackMixin = 1;
      const Mixin = requireMixin();
      class LocationInfoOpenElementStackMixin extends Mixin {
        constructor(stack2, opts) {
          super(stack2);
          this.onItemPop = opts.onItemPop;
        }
        _getOverriddenMethods(mxn, orig) {
          return {
            pop() {
              mxn.onItemPop(this.current);
              orig.pop.call(this);
            },
            popAllUpToHtmlElement() {
              for (let i2 = this.stackTop; i2 > 0; i2--) {
                mxn.onItemPop(this.items[i2]);
              }
              orig.popAllUpToHtmlElement.call(this);
            },
            remove(element) {
              mxn.onItemPop(this.current);
              orig.remove.call(this, element);
            }
          };
        }
      }
      openElementStackMixin = LocationInfoOpenElementStackMixin;
      return openElementStackMixin;
    }
    var parserMixin$1;
    var hasRequiredParserMixin$1;
    function requireParserMixin$1() {
      if (hasRequiredParserMixin$1) return parserMixin$1;
      hasRequiredParserMixin$1 = 1;
      const Mixin = requireMixin();
      const Tokenizer2 = requireTokenizer();
      const LocationInfoTokenizerMixin = requireTokenizerMixin$1();
      const LocationInfoOpenElementStackMixin = requireOpenElementStackMixin();
      const HTML = requireHtml();
      const $2 = HTML.TAG_NAMES;
      class LocationInfoParserMixin extends Mixin {
        constructor(parser2) {
          super(parser2);
          this.parser = parser2;
          this.treeAdapter = this.parser.treeAdapter;
          this.posTracker = null;
          this.lastStartTagToken = null;
          this.lastFosterParentingLocation = null;
          this.currentToken = null;
        }
        _setStartLocation(element) {
          let loc = null;
          if (this.lastStartTagToken) {
            loc = Object.assign({}, this.lastStartTagToken.location);
            loc.startTag = this.lastStartTagToken.location;
          }
          this.treeAdapter.setNodeSourceCodeLocation(element, loc);
        }
        _setEndLocation(element, closingToken) {
          const loc = this.treeAdapter.getNodeSourceCodeLocation(element);
          if (loc) {
            if (closingToken.location) {
              const ctLoc = closingToken.location;
              const tn2 = this.treeAdapter.getTagName(element);
              const isClosingEndTag = closingToken.type === Tokenizer2.END_TAG_TOKEN && tn2 === closingToken.tagName;
              const endLoc = {};
              if (isClosingEndTag) {
                endLoc.endTag = Object.assign({}, ctLoc);
                endLoc.endLine = ctLoc.endLine;
                endLoc.endCol = ctLoc.endCol;
                endLoc.endOffset = ctLoc.endOffset;
              } else {
                endLoc.endLine = ctLoc.startLine;
                endLoc.endCol = ctLoc.startCol;
                endLoc.endOffset = ctLoc.startOffset;
              }
              this.treeAdapter.updateNodeSourceCodeLocation(element, endLoc);
            }
          }
        }
        _getOverriddenMethods(mxn, orig) {
          return {
            _bootstrap(document2, fragmentContext) {
              orig._bootstrap.call(this, document2, fragmentContext);
              mxn.lastStartTagToken = null;
              mxn.lastFosterParentingLocation = null;
              mxn.currentToken = null;
              const tokenizerMixin2 = Mixin.install(this.tokenizer, LocationInfoTokenizerMixin);
              mxn.posTracker = tokenizerMixin2.posTracker;
              Mixin.install(this.openElements, LocationInfoOpenElementStackMixin, {
                onItemPop: function(element) {
                  mxn._setEndLocation(element, mxn.currentToken);
                }
              });
            },
            _runParsingLoop(scriptHandler) {
              orig._runParsingLoop.call(this, scriptHandler);
              for (let i2 = this.openElements.stackTop; i2 >= 0; i2--) {
                mxn._setEndLocation(this.openElements.items[i2], mxn.currentToken);
              }
            },
            //Token processing
            _processTokenInForeignContent(token2) {
              mxn.currentToken = token2;
              orig._processTokenInForeignContent.call(this, token2);
            },
            _processToken(token2) {
              mxn.currentToken = token2;
              orig._processToken.call(this, token2);
              const requireExplicitUpdate = token2.type === Tokenizer2.END_TAG_TOKEN && (token2.tagName === $2.HTML || token2.tagName === $2.BODY && this.openElements.hasInScope($2.BODY));
              if (requireExplicitUpdate) {
                for (let i2 = this.openElements.stackTop; i2 >= 0; i2--) {
                  const element = this.openElements.items[i2];
                  if (this.treeAdapter.getTagName(element) === token2.tagName) {
                    mxn._setEndLocation(element, token2);
                    break;
                  }
                }
              }
            },
            //Doctype
            _setDocumentType(token2) {
              orig._setDocumentType.call(this, token2);
              const documentChildren = this.treeAdapter.getChildNodes(this.document);
              const cnLength = documentChildren.length;
              for (let i2 = 0; i2 < cnLength; i2++) {
                const node2 = documentChildren[i2];
                if (this.treeAdapter.isDocumentTypeNode(node2)) {
                  this.treeAdapter.setNodeSourceCodeLocation(node2, token2.location);
                  break;
                }
              }
            },
            //Elements
            _attachElementToTree(element) {
              mxn._setStartLocation(element);
              mxn.lastStartTagToken = null;
              orig._attachElementToTree.call(this, element);
            },
            _appendElement(token2, namespaceURI) {
              mxn.lastStartTagToken = token2;
              orig._appendElement.call(this, token2, namespaceURI);
            },
            _insertElement(token2, namespaceURI) {
              mxn.lastStartTagToken = token2;
              orig._insertElement.call(this, token2, namespaceURI);
            },
            _insertTemplate(token2) {
              mxn.lastStartTagToken = token2;
              orig._insertTemplate.call(this, token2);
              const tmplContent = this.treeAdapter.getTemplateContent(this.openElements.current);
              this.treeAdapter.setNodeSourceCodeLocation(tmplContent, null);
            },
            _insertFakeRootElement() {
              orig._insertFakeRootElement.call(this);
              this.treeAdapter.setNodeSourceCodeLocation(this.openElements.current, null);
            },
            //Comments
            _appendCommentNode(token2, parent) {
              orig._appendCommentNode.call(this, token2, parent);
              const children2 = this.treeAdapter.getChildNodes(parent);
              const commentNode = children2[children2.length - 1];
              this.treeAdapter.setNodeSourceCodeLocation(commentNode, token2.location);
            },
            //Text
            _findFosterParentingLocation() {
              mxn.lastFosterParentingLocation = orig._findFosterParentingLocation.call(this);
              return mxn.lastFosterParentingLocation;
            },
            _insertCharacters(token2) {
              orig._insertCharacters.call(this, token2);
              const hasFosterParent = this._shouldFosterParentOnInsertion();
              const parent = hasFosterParent && mxn.lastFosterParentingLocation.parent || this.openElements.currentTmplContent || this.openElements.current;
              const siblings = this.treeAdapter.getChildNodes(parent);
              const textNodeIdx = hasFosterParent && mxn.lastFosterParentingLocation.beforeElement ? siblings.indexOf(mxn.lastFosterParentingLocation.beforeElement) - 1 : siblings.length - 1;
              const textNode = siblings[textNodeIdx];
              const tnLoc = this.treeAdapter.getNodeSourceCodeLocation(textNode);
              if (tnLoc) {
                const { endLine, endCol, endOffset } = token2.location;
                this.treeAdapter.updateNodeSourceCodeLocation(textNode, { endLine, endCol, endOffset });
              } else {
                this.treeAdapter.setNodeSourceCodeLocation(textNode, token2.location);
              }
            }
          };
        }
      }
      parserMixin$1 = LocationInfoParserMixin;
      return parserMixin$1;
    }
    var mixinBase;
    var hasRequiredMixinBase;
    function requireMixinBase() {
      if (hasRequiredMixinBase) return mixinBase;
      hasRequiredMixinBase = 1;
      const Mixin = requireMixin();
      class ErrorReportingMixinBase extends Mixin {
        constructor(host, opts) {
          super(host);
          this.posTracker = null;
          this.onParseError = opts.onParseError;
        }
        _setErrorLocation(err2) {
          err2.startLine = err2.endLine = this.posTracker.line;
          err2.startCol = err2.endCol = this.posTracker.col;
          err2.startOffset = err2.endOffset = this.posTracker.offset;
        }
        _reportError(code2) {
          const err2 = {
            code: code2,
            startLine: -1,
            startCol: -1,
            startOffset: -1,
            endLine: -1,
            endCol: -1,
            endOffset: -1
          };
          this._setErrorLocation(err2);
          this.onParseError(err2);
        }
        _getOverriddenMethods(mxn) {
          return {
            _err(code2) {
              mxn._reportError(code2);
            }
          };
        }
      }
      mixinBase = ErrorReportingMixinBase;
      return mixinBase;
    }
    var preprocessorMixin;
    var hasRequiredPreprocessorMixin;
    function requirePreprocessorMixin() {
      if (hasRequiredPreprocessorMixin) return preprocessorMixin;
      hasRequiredPreprocessorMixin = 1;
      const ErrorReportingMixinBase = requireMixinBase();
      const PositionTrackingPreprocessorMixin = requirePreprocessorMixin$1();
      const Mixin = requireMixin();
      class ErrorReportingPreprocessorMixin extends ErrorReportingMixinBase {
        constructor(preprocessor2, opts) {
          super(preprocessor2, opts);
          this.posTracker = Mixin.install(preprocessor2, PositionTrackingPreprocessorMixin);
          this.lastErrOffset = -1;
        }
        _reportError(code2) {
          if (this.lastErrOffset !== this.posTracker.offset) {
            this.lastErrOffset = this.posTracker.offset;
            super._reportError(code2);
          }
        }
      }
      preprocessorMixin = ErrorReportingPreprocessorMixin;
      return preprocessorMixin;
    }
    var tokenizerMixin;
    var hasRequiredTokenizerMixin;
    function requireTokenizerMixin() {
      if (hasRequiredTokenizerMixin) return tokenizerMixin;
      hasRequiredTokenizerMixin = 1;
      const ErrorReportingMixinBase = requireMixinBase();
      const ErrorReportingPreprocessorMixin = requirePreprocessorMixin();
      const Mixin = requireMixin();
      class ErrorReportingTokenizerMixin extends ErrorReportingMixinBase {
        constructor(tokenizer2, opts) {
          super(tokenizer2, opts);
          const preprocessorMixin2 = Mixin.install(tokenizer2.preprocessor, ErrorReportingPreprocessorMixin, opts);
          this.posTracker = preprocessorMixin2.posTracker;
        }
      }
      tokenizerMixin = ErrorReportingTokenizerMixin;
      return tokenizerMixin;
    }
    var parserMixin;
    var hasRequiredParserMixin;
    function requireParserMixin() {
      if (hasRequiredParserMixin) return parserMixin;
      hasRequiredParserMixin = 1;
      const ErrorReportingMixinBase = requireMixinBase();
      const ErrorReportingTokenizerMixin = requireTokenizerMixin();
      const LocationInfoTokenizerMixin = requireTokenizerMixin$1();
      const Mixin = requireMixin();
      class ErrorReportingParserMixin extends ErrorReportingMixinBase {
        constructor(parser2, opts) {
          super(parser2, opts);
          this.opts = opts;
          this.ctLoc = null;
          this.locBeforeToken = false;
        }
        _setErrorLocation(err2) {
          if (this.ctLoc) {
            err2.startLine = this.ctLoc.startLine;
            err2.startCol = this.ctLoc.startCol;
            err2.startOffset = this.ctLoc.startOffset;
            err2.endLine = this.locBeforeToken ? this.ctLoc.startLine : this.ctLoc.endLine;
            err2.endCol = this.locBeforeToken ? this.ctLoc.startCol : this.ctLoc.endCol;
            err2.endOffset = this.locBeforeToken ? this.ctLoc.startOffset : this.ctLoc.endOffset;
          }
        }
        _getOverriddenMethods(mxn, orig) {
          return {
            _bootstrap(document2, fragmentContext) {
              orig._bootstrap.call(this, document2, fragmentContext);
              Mixin.install(this.tokenizer, ErrorReportingTokenizerMixin, mxn.opts);
              Mixin.install(this.tokenizer, LocationInfoTokenizerMixin);
            },
            _processInputToken(token2) {
              mxn.ctLoc = token2.location;
              orig._processInputToken.call(this, token2);
            },
            _err(code2, options2) {
              mxn.locBeforeToken = options2 && options2.beforeToken;
              mxn._reportError(code2);
            }
          };
        }
      }
      parserMixin = ErrorReportingParserMixin;
      return parserMixin;
    }
    var _default = {};
    var hasRequired_default;
    function require_default() {
      if (hasRequired_default) return _default;
      hasRequired_default = 1;
      const { DOCUMENT_MODE } = requireHtml();
      _default.createDocument = function() {
        return {
          nodeName: "#document",
          mode: DOCUMENT_MODE.NO_QUIRKS,
          childNodes: []
        };
      };
      _default.createDocumentFragment = function() {
        return {
          nodeName: "#document-fragment",
          childNodes: []
        };
      };
      _default.createElement = function(tagName, namespaceURI, attrs) {
        return {
          nodeName: tagName,
          tagName,
          attrs,
          namespaceURI,
          childNodes: [],
          parentNode: null
        };
      };
      _default.createCommentNode = function(data) {
        return {
          nodeName: "#comment",
          data,
          parentNode: null
        };
      };
      const createTextNode = function(value2) {
        return {
          nodeName: "#text",
          value: value2,
          parentNode: null
        };
      };
      const appendChild = _default.appendChild = function(parentNode, newNode) {
        parentNode.childNodes.push(newNode);
        newNode.parentNode = parentNode;
      };
      const insertBefore = _default.insertBefore = function(parentNode, newNode, referenceNode) {
        const insertionIdx = parentNode.childNodes.indexOf(referenceNode);
        parentNode.childNodes.splice(insertionIdx, 0, newNode);
        newNode.parentNode = parentNode;
      };
      _default.setTemplateContent = function(templateElement, contentElement) {
        templateElement.content = contentElement;
      };
      _default.getTemplateContent = function(templateElement) {
        return templateElement.content;
      };
      _default.setDocumentType = function(document2, name2, publicId, systemId) {
        let doctypeNode = null;
        for (let i2 = 0; i2 < document2.childNodes.length; i2++) {
          if (document2.childNodes[i2].nodeName === "#documentType") {
            doctypeNode = document2.childNodes[i2];
            break;
          }
        }
        if (doctypeNode) {
          doctypeNode.name = name2;
          doctypeNode.publicId = publicId;
          doctypeNode.systemId = systemId;
        } else {
          appendChild(document2, {
            nodeName: "#documentType",
            name: name2,
            publicId,
            systemId
          });
        }
      };
      _default.setDocumentMode = function(document2, mode) {
        document2.mode = mode;
      };
      _default.getDocumentMode = function(document2) {
        return document2.mode;
      };
      _default.detachNode = function(node2) {
        if (node2.parentNode) {
          const idx = node2.parentNode.childNodes.indexOf(node2);
          node2.parentNode.childNodes.splice(idx, 1);
          node2.parentNode = null;
        }
      };
      _default.insertText = function(parentNode, text2) {
        if (parentNode.childNodes.length) {
          const prevNode = parentNode.childNodes[parentNode.childNodes.length - 1];
          if (prevNode.nodeName === "#text") {
            prevNode.value += text2;
            return;
          }
        }
        appendChild(parentNode, createTextNode(text2));
      };
      _default.insertTextBefore = function(parentNode, text2, referenceNode) {
        const prevNode = parentNode.childNodes[parentNode.childNodes.indexOf(referenceNode) - 1];
        if (prevNode && prevNode.nodeName === "#text") {
          prevNode.value += text2;
        } else {
          insertBefore(parentNode, createTextNode(text2), referenceNode);
        }
      };
      _default.adoptAttributes = function(recipient, attrs) {
        const recipientAttrsMap = [];
        for (let i2 = 0; i2 < recipient.attrs.length; i2++) {
          recipientAttrsMap.push(recipient.attrs[i2].name);
        }
        for (let j = 0; j < attrs.length; j++) {
          if (recipientAttrsMap.indexOf(attrs[j].name) === -1) {
            recipient.attrs.push(attrs[j]);
          }
        }
      };
      _default.getFirstChild = function(node2) {
        return node2.childNodes[0];
      };
      _default.getChildNodes = function(node2) {
        return node2.childNodes;
      };
      _default.getParentNode = function(node2) {
        return node2.parentNode;
      };
      _default.getAttrList = function(element) {
        return element.attrs;
      };
      _default.getTagName = function(element) {
        return element.tagName;
      };
      _default.getNamespaceURI = function(element) {
        return element.namespaceURI;
      };
      _default.getTextNodeContent = function(textNode) {
        return textNode.value;
      };
      _default.getCommentNodeContent = function(commentNode) {
        return commentNode.data;
      };
      _default.getDocumentTypeNodeName = function(doctypeNode) {
        return doctypeNode.name;
      };
      _default.getDocumentTypeNodePublicId = function(doctypeNode) {
        return doctypeNode.publicId;
      };
      _default.getDocumentTypeNodeSystemId = function(doctypeNode) {
        return doctypeNode.systemId;
      };
      _default.isTextNode = function(node2) {
        return node2.nodeName === "#text";
      };
      _default.isCommentNode = function(node2) {
        return node2.nodeName === "#comment";
      };
      _default.isDocumentTypeNode = function(node2) {
        return node2.nodeName === "#documentType";
      };
      _default.isElementNode = function(node2) {
        return !!node2.tagName;
      };
      _default.setNodeSourceCodeLocation = function(node2, location2) {
        node2.sourceCodeLocation = location2;
      };
      _default.getNodeSourceCodeLocation = function(node2) {
        return node2.sourceCodeLocation;
      };
      _default.updateNodeSourceCodeLocation = function(node2, endLocation) {
        node2.sourceCodeLocation = Object.assign(node2.sourceCodeLocation, endLocation);
      };
      return _default;
    }
    var mergeOptions;
    var hasRequiredMergeOptions;
    function requireMergeOptions() {
      if (hasRequiredMergeOptions) return mergeOptions;
      hasRequiredMergeOptions = 1;
      mergeOptions = function mergeOptions2(defaults, options2) {
        options2 = options2 || /* @__PURE__ */ Object.create(null);
        return [defaults, options2].reduce((merged, optObj) => {
          Object.keys(optObj).forEach((key2) => {
            merged[key2] = optObj[key2];
          });
          return merged;
        }, /* @__PURE__ */ Object.create(null));
      };
      return mergeOptions;
    }
    var doctype = {};
    var hasRequiredDoctype;
    function requireDoctype() {
      if (hasRequiredDoctype) return doctype;
      hasRequiredDoctype = 1;
      const { DOCUMENT_MODE } = requireHtml();
      const VALID_DOCTYPE_NAME = "html";
      const VALID_SYSTEM_ID = "about:legacy-compat";
      const QUIRKS_MODE_SYSTEM_ID = "http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd";
      const QUIRKS_MODE_PUBLIC_ID_PREFIXES = [
        "+//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//"
      ];
      const QUIRKS_MODE_NO_SYSTEM_ID_PUBLIC_ID_PREFIXES = QUIRKS_MODE_PUBLIC_ID_PREFIXES.concat([
        "-//w3c//dtd html 4.01 frameset//",
        "-//w3c//dtd html 4.01 transitional//"
      ]);
      const QUIRKS_MODE_PUBLIC_IDS = ["-//w3o//dtd w3 html strict 3.0//en//", "-/w3c/dtd html 4.0 transitional/en", "html"];
      const LIMITED_QUIRKS_PUBLIC_ID_PREFIXES = ["-//w3c//dtd xhtml 1.0 frameset//", "-//w3c//dtd xhtml 1.0 transitional//"];
      const LIMITED_QUIRKS_WITH_SYSTEM_ID_PUBLIC_ID_PREFIXES = LIMITED_QUIRKS_PUBLIC_ID_PREFIXES.concat([
        "-//w3c//dtd html 4.01 frameset//",
        "-//w3c//dtd html 4.01 transitional//"
      ]);
      function enquoteDoctypeId(id) {
        const quote2 = id.indexOf('"') !== -1 ? "'" : '"';
        return quote2 + id + quote2;
      }
      function hasPrefix(publicId, prefixes) {
        for (let i2 = 0; i2 < prefixes.length; i2++) {
          if (publicId.indexOf(prefixes[i2]) === 0) {
            return true;
          }
        }
        return false;
      }
      doctype.isConforming = function(token2) {
        return token2.name === VALID_DOCTYPE_NAME && token2.publicId === null && (token2.systemId === null || token2.systemId === VALID_SYSTEM_ID);
      };
      doctype.getDocumentMode = function(token2) {
        if (token2.name !== VALID_DOCTYPE_NAME) {
          return DOCUMENT_MODE.QUIRKS;
        }
        const systemId = token2.systemId;
        if (systemId && systemId.toLowerCase() === QUIRKS_MODE_SYSTEM_ID) {
          return DOCUMENT_MODE.QUIRKS;
        }
        let publicId = token2.publicId;
        if (publicId !== null) {
          publicId = publicId.toLowerCase();
          if (QUIRKS_MODE_PUBLIC_IDS.indexOf(publicId) > -1) {
            return DOCUMENT_MODE.QUIRKS;
          }
          let prefixes = systemId === null ? QUIRKS_MODE_NO_SYSTEM_ID_PUBLIC_ID_PREFIXES : QUIRKS_MODE_PUBLIC_ID_PREFIXES;
          if (hasPrefix(publicId, prefixes)) {
            return DOCUMENT_MODE.QUIRKS;
          }
          prefixes = systemId === null ? LIMITED_QUIRKS_PUBLIC_ID_PREFIXES : LIMITED_QUIRKS_WITH_SYSTEM_ID_PUBLIC_ID_PREFIXES;
          if (hasPrefix(publicId, prefixes)) {
            return DOCUMENT_MODE.LIMITED_QUIRKS;
          }
        }
        return DOCUMENT_MODE.NO_QUIRKS;
      };
      doctype.serializeContent = function(name2, publicId, systemId) {
        let str2 = "!DOCTYPE ";
        if (name2) {
          str2 += name2;
        }
        if (publicId) {
          str2 += " PUBLIC " + enquoteDoctypeId(publicId);
        } else if (systemId) {
          str2 += " SYSTEM";
        }
        if (systemId !== null) {
          str2 += " " + enquoteDoctypeId(systemId);
        }
        return str2;
      };
      return doctype;
    }
    var foreignContent = {};
    var hasRequiredForeignContent;
    function requireForeignContent() {
      if (hasRequiredForeignContent) return foreignContent;
      hasRequiredForeignContent = 1;
      const Tokenizer2 = requireTokenizer();
      const HTML = requireHtml();
      const $2 = HTML.TAG_NAMES;
      const NS = HTML.NAMESPACES;
      const ATTRS = HTML.ATTRS;
      const MIME_TYPES = {
        TEXT_HTML: "text/html",
        APPLICATION_XML: "application/xhtml+xml"
      };
      const DEFINITION_URL_ATTR = "definitionurl";
      const ADJUSTED_DEFINITION_URL_ATTR = "definitionURL";
      const SVG_ATTRS_ADJUSTMENT_MAP = {
        attributename: "attributeName",
        attributetype: "attributeType",
        basefrequency: "baseFrequency",
        baseprofile: "baseProfile",
        calcmode: "calcMode",
        clippathunits: "clipPathUnits",
        diffuseconstant: "diffuseConstant",
        edgemode: "edgeMode",
        filterunits: "filterUnits",
        glyphref: "glyphRef",
        gradienttransform: "gradientTransform",
        gradientunits: "gradientUnits",
        kernelmatrix: "kernelMatrix",
        kernelunitlength: "kernelUnitLength",
        keypoints: "keyPoints",
        keysplines: "keySplines",
        keytimes: "keyTimes",
        lengthadjust: "lengthAdjust",
        limitingconeangle: "limitingConeAngle",
        markerheight: "markerHeight",
        markerunits: "markerUnits",
        markerwidth: "markerWidth",
        maskcontentunits: "maskContentUnits",
        maskunits: "maskUnits",
        numoctaves: "numOctaves",
        pathlength: "pathLength",
        patterncontentunits: "patternContentUnits",
        patterntransform: "patternTransform",
        patternunits: "patternUnits",
        pointsatx: "pointsAtX",
        pointsaty: "pointsAtY",
        pointsatz: "pointsAtZ",
        preservealpha: "preserveAlpha",
        preserveaspectratio: "preserveAspectRatio",
        primitiveunits: "primitiveUnits",
        refx: "refX",
        refy: "refY",
        repeatcount: "repeatCount",
        repeatdur: "repeatDur",
        requiredextensions: "requiredExtensions",
        requiredfeatures: "requiredFeatures",
        specularconstant: "specularConstant",
        specularexponent: "specularExponent",
        spreadmethod: "spreadMethod",
        startoffset: "startOffset",
        stddeviation: "stdDeviation",
        stitchtiles: "stitchTiles",
        surfacescale: "surfaceScale",
        systemlanguage: "systemLanguage",
        tablevalues: "tableValues",
        targetx: "targetX",
        targety: "targetY",
        textlength: "textLength",
        viewbox: "viewBox",
        viewtarget: "viewTarget",
        xchannelselector: "xChannelSelector",
        ychannelselector: "yChannelSelector",
        zoomandpan: "zoomAndPan"
      };
      const XML_ATTRS_ADJUSTMENT_MAP = {
        "xlink:actuate": { prefix: "xlink", name: "actuate", namespace: NS.XLINK },
        "xlink:arcrole": { prefix: "xlink", name: "arcrole", namespace: NS.XLINK },
        "xlink:href": { prefix: "xlink", name: "href", namespace: NS.XLINK },
        "xlink:role": { prefix: "xlink", name: "role", namespace: NS.XLINK },
        "xlink:show": { prefix: "xlink", name: "show", namespace: NS.XLINK },
        "xlink:title": { prefix: "xlink", name: "title", namespace: NS.XLINK },
        "xlink:type": { prefix: "xlink", name: "type", namespace: NS.XLINK },
        "xml:base": { prefix: "xml", name: "base", namespace: NS.XML },
        "xml:lang": { prefix: "xml", name: "lang", namespace: NS.XML },
        "xml:space": { prefix: "xml", name: "space", namespace: NS.XML },
        xmlns: { prefix: "", name: "xmlns", namespace: NS.XMLNS },
        "xmlns:xlink": { prefix: "xmlns", name: "xlink", namespace: NS.XMLNS }
      };
      const SVG_TAG_NAMES_ADJUSTMENT_MAP = foreignContent.SVG_TAG_NAMES_ADJUSTMENT_MAP = {
        altglyph: "altGlyph",
        altglyphdef: "altGlyphDef",
        altglyphitem: "altGlyphItem",
        animatecolor: "animateColor",
        animatemotion: "animateMotion",
        animatetransform: "animateTransform",
        clippath: "clipPath",
        feblend: "feBlend",
        fecolormatrix: "feColorMatrix",
        fecomponenttransfer: "feComponentTransfer",
        fecomposite: "feComposite",
        feconvolvematrix: "feConvolveMatrix",
        fediffuselighting: "feDiffuseLighting",
        fedisplacementmap: "feDisplacementMap",
        fedistantlight: "feDistantLight",
        feflood: "feFlood",
        fefunca: "feFuncA",
        fefuncb: "feFuncB",
        fefuncg: "feFuncG",
        fefuncr: "feFuncR",
        fegaussianblur: "feGaussianBlur",
        feimage: "feImage",
        femerge: "feMerge",
        femergenode: "feMergeNode",
        femorphology: "feMorphology",
        feoffset: "feOffset",
        fepointlight: "fePointLight",
        fespecularlighting: "feSpecularLighting",
        fespotlight: "feSpotLight",
        fetile: "feTile",
        feturbulence: "feTurbulence",
        foreignobject: "foreignObject",
        glyphref: "glyphRef",
        lineargradient: "linearGradient",
        radialgradient: "radialGradient",
        textpath: "textPath"
      };
      const EXITS_FOREIGN_CONTENT = {
        [$2.B]: true,
        [$2.BIG]: true,
        [$2.BLOCKQUOTE]: true,
        [$2.BODY]: true,
        [$2.BR]: true,
        [$2.CENTER]: true,
        [$2.CODE]: true,
        [$2.DD]: true,
        [$2.DIV]: true,
        [$2.DL]: true,
        [$2.DT]: true,
        [$2.EM]: true,
        [$2.EMBED]: true,
        [$2.H1]: true,
        [$2.H2]: true,
        [$2.H3]: true,
        [$2.H4]: true,
        [$2.H5]: true,
        [$2.H6]: true,
        [$2.HEAD]: true,
        [$2.HR]: true,
        [$2.I]: true,
        [$2.IMG]: true,
        [$2.LI]: true,
        [$2.LISTING]: true,
        [$2.MENU]: true,
        [$2.META]: true,
        [$2.NOBR]: true,
        [$2.OL]: true,
        [$2.P]: true,
        [$2.PRE]: true,
        [$2.RUBY]: true,
        [$2.S]: true,
        [$2.SMALL]: true,
        [$2.SPAN]: true,
        [$2.STRONG]: true,
        [$2.STRIKE]: true,
        [$2.SUB]: true,
        [$2.SUP]: true,
        [$2.TABLE]: true,
        [$2.TT]: true,
        [$2.U]: true,
        [$2.UL]: true,
        [$2.VAR]: true
      };
      foreignContent.causesExit = function(startTagToken) {
        const tn2 = startTagToken.tagName;
        const isFontWithAttrs = tn2 === $2.FONT && (Tokenizer2.getTokenAttr(startTagToken, ATTRS.COLOR) !== null || Tokenizer2.getTokenAttr(startTagToken, ATTRS.SIZE) !== null || Tokenizer2.getTokenAttr(startTagToken, ATTRS.FACE) !== null);
        return isFontWithAttrs ? true : EXITS_FOREIGN_CONTENT[tn2];
      };
      foreignContent.adjustTokenMathMLAttrs = function(token2) {
        for (let i2 = 0; i2 < token2.attrs.length; i2++) {
          if (token2.attrs[i2].name === DEFINITION_URL_ATTR) {
            token2.attrs[i2].name = ADJUSTED_DEFINITION_URL_ATTR;
            break;
          }
        }
      };
      foreignContent.adjustTokenSVGAttrs = function(token2) {
        for (let i2 = 0; i2 < token2.attrs.length; i2++) {
          const adjustedAttrName = SVG_ATTRS_ADJUSTMENT_MAP[token2.attrs[i2].name];
          if (adjustedAttrName) {
            token2.attrs[i2].name = adjustedAttrName;
          }
        }
      };
      foreignContent.adjustTokenXMLAttrs = function(token2) {
        for (let i2 = 0; i2 < token2.attrs.length; i2++) {
          const adjustedAttrEntry = XML_ATTRS_ADJUSTMENT_MAP[token2.attrs[i2].name];
          if (adjustedAttrEntry) {
            token2.attrs[i2].prefix = adjustedAttrEntry.prefix;
            token2.attrs[i2].name = adjustedAttrEntry.name;
            token2.attrs[i2].namespace = adjustedAttrEntry.namespace;
          }
        }
      };
      foreignContent.adjustTokenSVGTagName = function(token2) {
        const adjustedTagName = SVG_TAG_NAMES_ADJUSTMENT_MAP[token2.tagName];
        if (adjustedTagName) {
          token2.tagName = adjustedTagName;
        }
      };
      function isMathMLTextIntegrationPoint(tn2, ns) {
        return ns === NS.MATHML && (tn2 === $2.MI || tn2 === $2.MO || tn2 === $2.MN || tn2 === $2.MS || tn2 === $2.MTEXT);
      }
      function isHtmlIntegrationPoint(tn2, ns, attrs) {
        if (ns === NS.MATHML && tn2 === $2.ANNOTATION_XML) {
          for (let i2 = 0; i2 < attrs.length; i2++) {
            if (attrs[i2].name === ATTRS.ENCODING) {
              const value2 = attrs[i2].value.toLowerCase();
              return value2 === MIME_TYPES.TEXT_HTML || value2 === MIME_TYPES.APPLICATION_XML;
            }
          }
        }
        return ns === NS.SVG && (tn2 === $2.FOREIGN_OBJECT || tn2 === $2.DESC || tn2 === $2.TITLE);
      }
      foreignContent.isIntegrationPoint = function(tn2, ns, attrs, foreignNS) {
        if ((!foreignNS || foreignNS === NS.HTML) && isHtmlIntegrationPoint(tn2, ns, attrs)) {
          return true;
        }
        if ((!foreignNS || foreignNS === NS.MATHML) && isMathMLTextIntegrationPoint(tn2, ns)) {
          return true;
        }
        return false;
      };
      return foreignContent;
    }
    var parser$3;
    var hasRequiredParser$2;
    function requireParser$2() {
      if (hasRequiredParser$2) return parser$3;
      hasRequiredParser$2 = 1;
      const Tokenizer2 = requireTokenizer();
      const OpenElementStack = requireOpenElementStack();
      const FormattingElementList = requireFormattingElementList();
      const LocationInfoParserMixin = requireParserMixin$1();
      const ErrorReportingParserMixin = requireParserMixin();
      const Mixin = requireMixin();
      const defaultTreeAdapter = require_default();
      const mergeOptions2 = requireMergeOptions();
      const doctype2 = requireDoctype();
      const foreignContent2 = requireForeignContent();
      const ERR = requireErrorCodes();
      const unicode2 = requireUnicode();
      const HTML = requireHtml();
      const $2 = HTML.TAG_NAMES;
      const NS = HTML.NAMESPACES;
      const ATTRS = HTML.ATTRS;
      const DEFAULT_OPTIONS2 = {
        scriptingEnabled: true,
        sourceCodeLocationInfo: false,
        onParseError: null,
        treeAdapter: defaultTreeAdapter
      };
      const HIDDEN_INPUT_TYPE = "hidden";
      const AA_OUTER_LOOP_ITER = 8;
      const AA_INNER_LOOP_ITER = 3;
      const INITIAL_MODE = "INITIAL_MODE";
      const BEFORE_HTML_MODE = "BEFORE_HTML_MODE";
      const BEFORE_HEAD_MODE = "BEFORE_HEAD_MODE";
      const IN_HEAD_MODE = "IN_HEAD_MODE";
      const IN_HEAD_NO_SCRIPT_MODE = "IN_HEAD_NO_SCRIPT_MODE";
      const AFTER_HEAD_MODE = "AFTER_HEAD_MODE";
      const IN_BODY_MODE = "IN_BODY_MODE";
      const TEXT_MODE = "TEXT_MODE";
      const IN_TABLE_MODE = "IN_TABLE_MODE";
      const IN_TABLE_TEXT_MODE = "IN_TABLE_TEXT_MODE";
      const IN_CAPTION_MODE = "IN_CAPTION_MODE";
      const IN_COLUMN_GROUP_MODE = "IN_COLUMN_GROUP_MODE";
      const IN_TABLE_BODY_MODE = "IN_TABLE_BODY_MODE";
      const IN_ROW_MODE = "IN_ROW_MODE";
      const IN_CELL_MODE = "IN_CELL_MODE";
      const IN_SELECT_MODE = "IN_SELECT_MODE";
      const IN_SELECT_IN_TABLE_MODE = "IN_SELECT_IN_TABLE_MODE";
      const IN_TEMPLATE_MODE = "IN_TEMPLATE_MODE";
      const AFTER_BODY_MODE = "AFTER_BODY_MODE";
      const IN_FRAMESET_MODE = "IN_FRAMESET_MODE";
      const AFTER_FRAMESET_MODE = "AFTER_FRAMESET_MODE";
      const AFTER_AFTER_BODY_MODE = "AFTER_AFTER_BODY_MODE";
      const AFTER_AFTER_FRAMESET_MODE = "AFTER_AFTER_FRAMESET_MODE";
      const INSERTION_MODE_RESET_MAP = {
        [$2.TR]: IN_ROW_MODE,
        [$2.TBODY]: IN_TABLE_BODY_MODE,
        [$2.THEAD]: IN_TABLE_BODY_MODE,
        [$2.TFOOT]: IN_TABLE_BODY_MODE,
        [$2.CAPTION]: IN_CAPTION_MODE,
        [$2.COLGROUP]: IN_COLUMN_GROUP_MODE,
        [$2.TABLE]: IN_TABLE_MODE,
        [$2.BODY]: IN_BODY_MODE,
        [$2.FRAMESET]: IN_FRAMESET_MODE
      };
      const TEMPLATE_INSERTION_MODE_SWITCH_MAP = {
        [$2.CAPTION]: IN_TABLE_MODE,
        [$2.COLGROUP]: IN_TABLE_MODE,
        [$2.TBODY]: IN_TABLE_MODE,
        [$2.TFOOT]: IN_TABLE_MODE,
        [$2.THEAD]: IN_TABLE_MODE,
        [$2.COL]: IN_COLUMN_GROUP_MODE,
        [$2.TR]: IN_TABLE_BODY_MODE,
        [$2.TD]: IN_ROW_MODE,
        [$2.TH]: IN_ROW_MODE
      };
      const TOKEN_HANDLERS = {
        [INITIAL_MODE]: {
          [Tokenizer2.CHARACTER_TOKEN]: tokenInInitialMode,
          [Tokenizer2.NULL_CHARACTER_TOKEN]: tokenInInitialMode,
          [Tokenizer2.WHITESPACE_CHARACTER_TOKEN]: ignoreToken,
          [Tokenizer2.COMMENT_TOKEN]: appendComment,
          [Tokenizer2.DOCTYPE_TOKEN]: doctypeInInitialMode,
          [Tokenizer2.START_TAG_TOKEN]: tokenInInitialMode,
          [Tokenizer2.END_TAG_TOKEN]: tokenInInitialMode,
          [Tokenizer2.EOF_TOKEN]: tokenInInitialMode
        },
        [BEFORE_HTML_MODE]: {
          [Tokenizer2.CHARACTER_TOKEN]: tokenBeforeHtml,
          [Tokenizer2.NULL_CHARACTER_TOKEN]: tokenBeforeHtml,
          [Tokenizer2.WHITESPACE_CHARACTER_TOKEN]: ignoreToken,
          [Tokenizer2.COMMENT_TOKEN]: appendComment,
          [Tokenizer2.DOCTYPE_TOKEN]: ignoreToken,
          [Tokenizer2.START_TAG_TOKEN]: startTagBeforeHtml,
          [Tokenizer2.END_TAG_TOKEN]: endTagBeforeHtml,
          [Tokenizer2.EOF_TOKEN]: tokenBeforeHtml
        },
        [BEFORE_HEAD_MODE]: {
          [Tokenizer2.CHARACTER_TOKEN]: tokenBeforeHead,
          [Tokenizer2.NULL_CHARACTER_TOKEN]: tokenBeforeHead,
          [Tokenizer2.WHITESPACE_CHARACTER_TOKEN]: ignoreToken,
          [Tokenizer2.COMMENT_TOKEN]: appendComment,
          [Tokenizer2.DOCTYPE_TOKEN]: misplacedDoctype,
          [Tokenizer2.START_TAG_TOKEN]: startTagBeforeHead,
          [Tokenizer2.END_TAG_TOKEN]: endTagBeforeHead,
          [Tokenizer2.EOF_TOKEN]: tokenBeforeHead
        },
        [IN_HEAD_MODE]: {
          [Tokenizer2.CHARACTER_TOKEN]: tokenInHead,
          [Tokenizer2.NULL_CHARACTER_TOKEN]: tokenInHead,
          [Tokenizer2.WHITESPACE_CHARACTER_TOKEN]: insertCharacters,
          [Tokenizer2.COMMENT_TOKEN]: appendComment,
          [Tokenizer2.DOCTYPE_TOKEN]: misplacedDoctype,
          [Tokenizer2.START_TAG_TOKEN]: startTagInHead,
          [Tokenizer2.END_TAG_TOKEN]: endTagInHead,
          [Tokenizer2.EOF_TOKEN]: tokenInHead
        },
        [IN_HEAD_NO_SCRIPT_MODE]: {
          [Tokenizer2.CHARACTER_TOKEN]: tokenInHeadNoScript,
          [Tokenizer2.NULL_CHARACTER_TOKEN]: tokenInHeadNoScript,
          [Tokenizer2.WHITESPACE_CHARACTER_TOKEN]: insertCharacters,
          [Tokenizer2.COMMENT_TOKEN]: appendComment,
          [Tokenizer2.DOCTYPE_TOKEN]: misplacedDoctype,
          [Tokenizer2.START_TAG_TOKEN]: startTagInHeadNoScript,
          [Tokenizer2.END_TAG_TOKEN]: endTagInHeadNoScript,
          [Tokenizer2.EOF_TOKEN]: tokenInHeadNoScript
        },
        [AFTER_HEAD_MODE]: {
          [Tokenizer2.CHARACTER_TOKEN]: tokenAfterHead,
          [Tokenizer2.NULL_CHARACTER_TOKEN]: tokenAfterHead,
          [Tokenizer2.WHITESPACE_CHARACTER_TOKEN]: insertCharacters,
          [Tokenizer2.COMMENT_TOKEN]: appendComment,
          [Tokenizer2.DOCTYPE_TOKEN]: misplacedDoctype,
          [Tokenizer2.START_TAG_TOKEN]: startTagAfterHead,
          [Tokenizer2.END_TAG_TOKEN]: endTagAfterHead,
          [Tokenizer2.EOF_TOKEN]: tokenAfterHead
        },
        [IN_BODY_MODE]: {
          [Tokenizer2.CHARACTER_TOKEN]: characterInBody,
          [Tokenizer2.NULL_CHARACTER_TOKEN]: ignoreToken,
          [Tokenizer2.WHITESPACE_CHARACTER_TOKEN]: whitespaceCharacterInBody,
          [Tokenizer2.COMMENT_TOKEN]: appendComment,
          [Tokenizer2.DOCTYPE_TOKEN]: ignoreToken,
          [Tokenizer2.START_TAG_TOKEN]: startTagInBody,
          [Tokenizer2.END_TAG_TOKEN]: endTagInBody,
          [Tokenizer2.EOF_TOKEN]: eofInBody
        },
        [TEXT_MODE]: {
          [Tokenizer2.CHARACTER_TOKEN]: insertCharacters,
          [Tokenizer2.NULL_CHARACTER_TOKEN]: insertCharacters,
          [Tokenizer2.WHITESPACE_CHARACTER_TOKEN]: insertCharacters,
          [Tokenizer2.COMMENT_TOKEN]: ignoreToken,
          [Tokenizer2.DOCTYPE_TOKEN]: ignoreToken,
          [Tokenizer2.START_TAG_TOKEN]: ignoreToken,
          [Tokenizer2.END_TAG_TOKEN]: endTagInText,
          [Tokenizer2.EOF_TOKEN]: eofInText
        },
        [IN_TABLE_MODE]: {
          [Tokenizer2.CHARACTER_TOKEN]: characterInTable,
          [Tokenizer2.NULL_CHARACTER_TOKEN]: characterInTable,
          [Tokenizer2.WHITESPACE_CHARACTER_TOKEN]: characterInTable,
          [Tokenizer2.COMMENT_TOKEN]: appendComment,
          [Tokenizer2.DOCTYPE_TOKEN]: ignoreToken,
          [Tokenizer2.START_TAG_TOKEN]: startTagInTable,
          [Tokenizer2.END_TAG_TOKEN]: endTagInTable,
          [Tokenizer2.EOF_TOKEN]: eofInBody
        },
        [IN_TABLE_TEXT_MODE]: {
          [Tokenizer2.CHARACTER_TOKEN]: characterInTableText,
          [Tokenizer2.NULL_CHARACTER_TOKEN]: ignoreToken,
          [Tokenizer2.WHITESPACE_CHARACTER_TOKEN]: whitespaceCharacterInTableText,
          [Tokenizer2.COMMENT_TOKEN]: tokenInTableText,
          [Tokenizer2.DOCTYPE_TOKEN]: tokenInTableText,
          [Tokenizer2.START_TAG_TOKEN]: tokenInTableText,
          [Tokenizer2.END_TAG_TOKEN]: tokenInTableText,
          [Tokenizer2.EOF_TOKEN]: tokenInTableText
        },
        [IN_CAPTION_MODE]: {
          [Tokenizer2.CHARACTER_TOKEN]: characterInBody,
          [Tokenizer2.NULL_CHARACTER_TOKEN]: ignoreToken,
          [Tokenizer2.WHITESPACE_CHARACTER_TOKEN]: whitespaceCharacterInBody,
          [Tokenizer2.COMMENT_TOKEN]: appendComment,
          [Tokenizer2.DOCTYPE_TOKEN]: ignoreToken,
          [Tokenizer2.START_TAG_TOKEN]: startTagInCaption,
          [Tokenizer2.END_TAG_TOKEN]: endTagInCaption,
          [Tokenizer2.EOF_TOKEN]: eofInBody
        },
        [IN_COLUMN_GROUP_MODE]: {
          [Tokenizer2.CHARACTER_TOKEN]: tokenInColumnGroup,
          [Tokenizer2.NULL_CHARACTER_TOKEN]: tokenInColumnGroup,
          [Tokenizer2.WHITESPACE_CHARACTER_TOKEN]: insertCharacters,
          [Tokenizer2.COMMENT_TOKEN]: appendComment,
          [Tokenizer2.DOCTYPE_TOKEN]: ignoreToken,
          [Tokenizer2.START_TAG_TOKEN]: startTagInColumnGroup,
          [Tokenizer2.END_TAG_TOKEN]: endTagInColumnGroup,
          [Tokenizer2.EOF_TOKEN]: eofInBody
        },
        [IN_TABLE_BODY_MODE]: {
          [Tokenizer2.CHARACTER_TOKEN]: characterInTable,
          [Tokenizer2.NULL_CHARACTER_TOKEN]: characterInTable,
          [Tokenizer2.WHITESPACE_CHARACTER_TOKEN]: characterInTable,
          [Tokenizer2.COMMENT_TOKEN]: appendComment,
          [Tokenizer2.DOCTYPE_TOKEN]: ignoreToken,
          [Tokenizer2.START_TAG_TOKEN]: startTagInTableBody,
          [Tokenizer2.END_TAG_TOKEN]: endTagInTableBody,
          [Tokenizer2.EOF_TOKEN]: eofInBody
        },
        [IN_ROW_MODE]: {
          [Tokenizer2.CHARACTER_TOKEN]: characterInTable,
          [Tokenizer2.NULL_CHARACTER_TOKEN]: characterInTable,
          [Tokenizer2.WHITESPACE_CHARACTER_TOKEN]: characterInTable,
          [Tokenizer2.COMMENT_TOKEN]: appendComment,
          [Tokenizer2.DOCTYPE_TOKEN]: ignoreToken,
          [Tokenizer2.START_TAG_TOKEN]: startTagInRow,
          [Tokenizer2.END_TAG_TOKEN]: endTagInRow,
          [Tokenizer2.EOF_TOKEN]: eofInBody
        },
        [IN_CELL_MODE]: {
          [Tokenizer2.CHARACTER_TOKEN]: characterInBody,
          [Tokenizer2.NULL_CHARACTER_TOKEN]: ignoreToken,
          [Tokenizer2.WHITESPACE_CHARACTER_TOKEN]: whitespaceCharacterInBody,
          [Tokenizer2.COMMENT_TOKEN]: appendComment,
          [Tokenizer2.DOCTYPE_TOKEN]: ignoreToken,
          [Tokenizer2.START_TAG_TOKEN]: startTagInCell,
          [Tokenizer2.END_TAG_TOKEN]: endTagInCell,
          [Tokenizer2.EOF_TOKEN]: eofInBody
        },
        [IN_SELECT_MODE]: {
          [Tokenizer2.CHARACTER_TOKEN]: insertCharacters,
          [Tokenizer2.NULL_CHARACTER_TOKEN]: ignoreToken,
          [Tokenizer2.WHITESPACE_CHARACTER_TOKEN]: insertCharacters,
          [Tokenizer2.COMMENT_TOKEN]: appendComment,
          [Tokenizer2.DOCTYPE_TOKEN]: ignoreToken,
          [Tokenizer2.START_TAG_TOKEN]: startTagInSelect,
          [Tokenizer2.END_TAG_TOKEN]: endTagInSelect,
          [Tokenizer2.EOF_TOKEN]: eofInBody
        },
        [IN_SELECT_IN_TABLE_MODE]: {
          [Tokenizer2.CHARACTER_TOKEN]: insertCharacters,
          [Tokenizer2.NULL_CHARACTER_TOKEN]: ignoreToken,
          [Tokenizer2.WHITESPACE_CHARACTER_TOKEN]: insertCharacters,
          [Tokenizer2.COMMENT_TOKEN]: appendComment,
          [Tokenizer2.DOCTYPE_TOKEN]: ignoreToken,
          [Tokenizer2.START_TAG_TOKEN]: startTagInSelectInTable,
          [Tokenizer2.END_TAG_TOKEN]: endTagInSelectInTable,
          [Tokenizer2.EOF_TOKEN]: eofInBody
        },
        [IN_TEMPLATE_MODE]: {
          [Tokenizer2.CHARACTER_TOKEN]: characterInBody,
          [Tokenizer2.NULL_CHARACTER_TOKEN]: ignoreToken,
          [Tokenizer2.WHITESPACE_CHARACTER_TOKEN]: whitespaceCharacterInBody,
          [Tokenizer2.COMMENT_TOKEN]: appendComment,
          [Tokenizer2.DOCTYPE_TOKEN]: ignoreToken,
          [Tokenizer2.START_TAG_TOKEN]: startTagInTemplate,
          [Tokenizer2.END_TAG_TOKEN]: endTagInTemplate,
          [Tokenizer2.EOF_TOKEN]: eofInTemplate
        },
        [AFTER_BODY_MODE]: {
          [Tokenizer2.CHARACTER_TOKEN]: tokenAfterBody,
          [Tokenizer2.NULL_CHARACTER_TOKEN]: tokenAfterBody,
          [Tokenizer2.WHITESPACE_CHARACTER_TOKEN]: whitespaceCharacterInBody,
          [Tokenizer2.COMMENT_TOKEN]: appendCommentToRootHtmlElement,
          [Tokenizer2.DOCTYPE_TOKEN]: ignoreToken,
          [Tokenizer2.START_TAG_TOKEN]: startTagAfterBody,
          [Tokenizer2.END_TAG_TOKEN]: endTagAfterBody,
          [Tokenizer2.EOF_TOKEN]: stopParsing
        },
        [IN_FRAMESET_MODE]: {
          [Tokenizer2.CHARACTER_TOKEN]: ignoreToken,
          [Tokenizer2.NULL_CHARACTER_TOKEN]: ignoreToken,
          [Tokenizer2.WHITESPACE_CHARACTER_TOKEN]: insertCharacters,
          [Tokenizer2.COMMENT_TOKEN]: appendComment,
          [Tokenizer2.DOCTYPE_TOKEN]: ignoreToken,
          [Tokenizer2.START_TAG_TOKEN]: startTagInFrameset,
          [Tokenizer2.END_TAG_TOKEN]: endTagInFrameset,
          [Tokenizer2.EOF_TOKEN]: stopParsing
        },
        [AFTER_FRAMESET_MODE]: {
          [Tokenizer2.CHARACTER_TOKEN]: ignoreToken,
          [Tokenizer2.NULL_CHARACTER_TOKEN]: ignoreToken,
          [Tokenizer2.WHITESPACE_CHARACTER_TOKEN]: insertCharacters,
          [Tokenizer2.COMMENT_TOKEN]: appendComment,
          [Tokenizer2.DOCTYPE_TOKEN]: ignoreToken,
          [Tokenizer2.START_TAG_TOKEN]: startTagAfterFrameset,
          [Tokenizer2.END_TAG_TOKEN]: endTagAfterFrameset,
          [Tokenizer2.EOF_TOKEN]: stopParsing
        },
        [AFTER_AFTER_BODY_MODE]: {
          [Tokenizer2.CHARACTER_TOKEN]: tokenAfterAfterBody,
          [Tokenizer2.NULL_CHARACTER_TOKEN]: tokenAfterAfterBody,
          [Tokenizer2.WHITESPACE_CHARACTER_TOKEN]: whitespaceCharacterInBody,
          [Tokenizer2.COMMENT_TOKEN]: appendCommentToDocument,
          [Tokenizer2.DOCTYPE_TOKEN]: ignoreToken,
          [Tokenizer2.START_TAG_TOKEN]: startTagAfterAfterBody,
          [Tokenizer2.END_TAG_TOKEN]: tokenAfterAfterBody,
          [Tokenizer2.EOF_TOKEN]: stopParsing
        },
        [AFTER_AFTER_FRAMESET_MODE]: {
          [Tokenizer2.CHARACTER_TOKEN]: ignoreToken,
          [Tokenizer2.NULL_CHARACTER_TOKEN]: ignoreToken,
          [Tokenizer2.WHITESPACE_CHARACTER_TOKEN]: whitespaceCharacterInBody,
          [Tokenizer2.COMMENT_TOKEN]: appendCommentToDocument,
          [Tokenizer2.DOCTYPE_TOKEN]: ignoreToken,
          [Tokenizer2.START_TAG_TOKEN]: startTagAfterAfterFrameset,
          [Tokenizer2.END_TAG_TOKEN]: ignoreToken,
          [Tokenizer2.EOF_TOKEN]: stopParsing
        }
      };
      class Parser2 {
        constructor(options2) {
          this.options = mergeOptions2(DEFAULT_OPTIONS2, options2);
          this.treeAdapter = this.options.treeAdapter;
          this.pendingScript = null;
          if (this.options.sourceCodeLocationInfo) {
            Mixin.install(this, LocationInfoParserMixin);
          }
          if (this.options.onParseError) {
            Mixin.install(this, ErrorReportingParserMixin, { onParseError: this.options.onParseError });
          }
        }
        // API
        parse(html2) {
          const document2 = this.treeAdapter.createDocument();
          this._bootstrap(document2, null);
          this.tokenizer.write(html2, true);
          this._runParsingLoop(null);
          return document2;
        }
        parseFragment(html2, fragmentContext) {
          if (!fragmentContext) {
            fragmentContext = this.treeAdapter.createElement($2.TEMPLATE, NS.HTML, []);
          }
          const documentMock = this.treeAdapter.createElement("documentmock", NS.HTML, []);
          this._bootstrap(documentMock, fragmentContext);
          if (this.treeAdapter.getTagName(fragmentContext) === $2.TEMPLATE) {
            this._pushTmplInsertionMode(IN_TEMPLATE_MODE);
          }
          this._initTokenizerForFragmentParsing();
          this._insertFakeRootElement();
          this._resetInsertionMode();
          this._findFormInFragmentContext();
          this.tokenizer.write(html2, true);
          this._runParsingLoop(null);
          const rootElement = this.treeAdapter.getFirstChild(documentMock);
          const fragment = this.treeAdapter.createDocumentFragment();
          this._adoptNodes(rootElement, fragment);
          return fragment;
        }
        //Bootstrap parser
        _bootstrap(document2, fragmentContext) {
          this.tokenizer = new Tokenizer2(this.options);
          this.stopped = false;
          this.insertionMode = INITIAL_MODE;
          this.originalInsertionMode = "";
          this.document = document2;
          this.fragmentContext = fragmentContext;
          this.headElement = null;
          this.formElement = null;
          this.openElements = new OpenElementStack(this.document, this.treeAdapter);
          this.activeFormattingElements = new FormattingElementList(this.treeAdapter);
          this.tmplInsertionModeStack = [];
          this.tmplInsertionModeStackTop = -1;
          this.currentTmplInsertionMode = null;
          this.pendingCharacterTokens = [];
          this.hasNonWhitespacePendingCharacterToken = false;
          this.framesetOk = true;
          this.skipNextNewLine = false;
          this.fosterParentingEnabled = false;
        }
        //Errors
        _err() {
        }
        //Parsing loop
        _runParsingLoop(scriptHandler) {
          while (!this.stopped) {
            this._setupTokenizerCDATAMode();
            const token2 = this.tokenizer.getNextToken();
            if (token2.type === Tokenizer2.HIBERNATION_TOKEN) {
              break;
            }
            if (this.skipNextNewLine) {
              this.skipNextNewLine = false;
              if (token2.type === Tokenizer2.WHITESPACE_CHARACTER_TOKEN && token2.chars[0] === "\n") {
                if (token2.chars.length === 1) {
                  continue;
                }
                token2.chars = token2.chars.substr(1);
              }
            }
            this._processInputToken(token2);
            if (scriptHandler && this.pendingScript) {
              break;
            }
          }
        }
        runParsingLoopForCurrentChunk(writeCallback, scriptHandler) {
          this._runParsingLoop(scriptHandler);
          if (scriptHandler && this.pendingScript) {
            const script2 = this.pendingScript;
            this.pendingScript = null;
            scriptHandler(script2);
            return;
          }
          if (writeCallback) {
            writeCallback();
          }
        }
        //Text parsing
        _setupTokenizerCDATAMode() {
          const current2 = this._getAdjustedCurrentElement();
          this.tokenizer.allowCDATA = current2 && current2 !== this.document && this.treeAdapter.getNamespaceURI(current2) !== NS.HTML && !this._isIntegrationPoint(current2);
        }
        _switchToTextParsing(currentToken, nextTokenizerState) {
          this._insertElement(currentToken, NS.HTML);
          this.tokenizer.state = nextTokenizerState;
          this.originalInsertionMode = this.insertionMode;
          this.insertionMode = TEXT_MODE;
        }
        switchToPlaintextParsing() {
          this.insertionMode = TEXT_MODE;
          this.originalInsertionMode = IN_BODY_MODE;
          this.tokenizer.state = Tokenizer2.MODE.PLAINTEXT;
        }
        //Fragment parsing
        _getAdjustedCurrentElement() {
          return this.openElements.stackTop === 0 && this.fragmentContext ? this.fragmentContext : this.openElements.current;
        }
        _findFormInFragmentContext() {
          let node2 = this.fragmentContext;
          do {
            if (this.treeAdapter.getTagName(node2) === $2.FORM) {
              this.formElement = node2;
              break;
            }
            node2 = this.treeAdapter.getParentNode(node2);
          } while (node2);
        }
        _initTokenizerForFragmentParsing() {
          if (this.treeAdapter.getNamespaceURI(this.fragmentContext) === NS.HTML) {
            const tn2 = this.treeAdapter.getTagName(this.fragmentContext);
            if (tn2 === $2.TITLE || tn2 === $2.TEXTAREA) {
              this.tokenizer.state = Tokenizer2.MODE.RCDATA;
            } else if (tn2 === $2.STYLE || tn2 === $2.XMP || tn2 === $2.IFRAME || tn2 === $2.NOEMBED || tn2 === $2.NOFRAMES || tn2 === $2.NOSCRIPT) {
              this.tokenizer.state = Tokenizer2.MODE.RAWTEXT;
            } else if (tn2 === $2.SCRIPT) {
              this.tokenizer.state = Tokenizer2.MODE.SCRIPT_DATA;
            } else if (tn2 === $2.PLAINTEXT) {
              this.tokenizer.state = Tokenizer2.MODE.PLAINTEXT;
            }
          }
        }
        //Tree mutation
        _setDocumentType(token2) {
          const name2 = token2.name || "";
          const publicId = token2.publicId || "";
          const systemId = token2.systemId || "";
          this.treeAdapter.setDocumentType(this.document, name2, publicId, systemId);
        }
        _attachElementToTree(element) {
          if (this._shouldFosterParentOnInsertion()) {
            this._fosterParentElement(element);
          } else {
            const parent = this.openElements.currentTmplContent || this.openElements.current;
            this.treeAdapter.appendChild(parent, element);
          }
        }
        _appendElement(token2, namespaceURI) {
          const element = this.treeAdapter.createElement(token2.tagName, namespaceURI, token2.attrs);
          this._attachElementToTree(element);
        }
        _insertElement(token2, namespaceURI) {
          const element = this.treeAdapter.createElement(token2.tagName, namespaceURI, token2.attrs);
          this._attachElementToTree(element);
          this.openElements.push(element);
        }
        _insertFakeElement(tagName) {
          const element = this.treeAdapter.createElement(tagName, NS.HTML, []);
          this._attachElementToTree(element);
          this.openElements.push(element);
        }
        _insertTemplate(token2) {
          const tmpl = this.treeAdapter.createElement(token2.tagName, NS.HTML, token2.attrs);
          const content2 = this.treeAdapter.createDocumentFragment();
          this.treeAdapter.setTemplateContent(tmpl, content2);
          this._attachElementToTree(tmpl);
          this.openElements.push(tmpl);
        }
        _insertFakeRootElement() {
          const element = this.treeAdapter.createElement($2.HTML, NS.HTML, []);
          this.treeAdapter.appendChild(this.openElements.current, element);
          this.openElements.push(element);
        }
        _appendCommentNode(token2, parent) {
          const commentNode = this.treeAdapter.createCommentNode(token2.data);
          this.treeAdapter.appendChild(parent, commentNode);
        }
        _insertCharacters(token2) {
          if (this._shouldFosterParentOnInsertion()) {
            this._fosterParentText(token2.chars);
          } else {
            const parent = this.openElements.currentTmplContent || this.openElements.current;
            this.treeAdapter.insertText(parent, token2.chars);
          }
        }
        _adoptNodes(donor, recipient) {
          for (let child = this.treeAdapter.getFirstChild(donor); child; child = this.treeAdapter.getFirstChild(donor)) {
            this.treeAdapter.detachNode(child);
            this.treeAdapter.appendChild(recipient, child);
          }
        }
        //Token processing
        _shouldProcessTokenInForeignContent(token2) {
          const current2 = this._getAdjustedCurrentElement();
          if (!current2 || current2 === this.document) {
            return false;
          }
          const ns = this.treeAdapter.getNamespaceURI(current2);
          if (ns === NS.HTML) {
            return false;
          }
          if (this.treeAdapter.getTagName(current2) === $2.ANNOTATION_XML && ns === NS.MATHML && token2.type === Tokenizer2.START_TAG_TOKEN && token2.tagName === $2.SVG) {
            return false;
          }
          const isCharacterToken = token2.type === Tokenizer2.CHARACTER_TOKEN || token2.type === Tokenizer2.NULL_CHARACTER_TOKEN || token2.type === Tokenizer2.WHITESPACE_CHARACTER_TOKEN;
          const isMathMLTextStartTag = token2.type === Tokenizer2.START_TAG_TOKEN && token2.tagName !== $2.MGLYPH && token2.tagName !== $2.MALIGNMARK;
          if ((isMathMLTextStartTag || isCharacterToken) && this._isIntegrationPoint(current2, NS.MATHML)) {
            return false;
          }
          if ((token2.type === Tokenizer2.START_TAG_TOKEN || isCharacterToken) && this._isIntegrationPoint(current2, NS.HTML)) {
            return false;
          }
          return token2.type !== Tokenizer2.EOF_TOKEN;
        }
        _processToken(token2) {
          TOKEN_HANDLERS[this.insertionMode][token2.type](this, token2);
        }
        _processTokenInBodyMode(token2) {
          TOKEN_HANDLERS[IN_BODY_MODE][token2.type](this, token2);
        }
        _processTokenInForeignContent(token2) {
          if (token2.type === Tokenizer2.CHARACTER_TOKEN) {
            characterInForeignContent(this, token2);
          } else if (token2.type === Tokenizer2.NULL_CHARACTER_TOKEN) {
            nullCharacterInForeignContent(this, token2);
          } else if (token2.type === Tokenizer2.WHITESPACE_CHARACTER_TOKEN) {
            insertCharacters(this, token2);
          } else if (token2.type === Tokenizer2.COMMENT_TOKEN) {
            appendComment(this, token2);
          } else if (token2.type === Tokenizer2.START_TAG_TOKEN) {
            startTagInForeignContent(this, token2);
          } else if (token2.type === Tokenizer2.END_TAG_TOKEN) {
            endTagInForeignContent(this, token2);
          }
        }
        _processInputToken(token2) {
          if (this._shouldProcessTokenInForeignContent(token2)) {
            this._processTokenInForeignContent(token2);
          } else {
            this._processToken(token2);
          }
          if (token2.type === Tokenizer2.START_TAG_TOKEN && token2.selfClosing && !token2.ackSelfClosing) {
            this._err(ERR.nonVoidHtmlElementStartTagWithTrailingSolidus);
          }
        }
        //Integration points
        _isIntegrationPoint(element, foreignNS) {
          const tn2 = this.treeAdapter.getTagName(element);
          const ns = this.treeAdapter.getNamespaceURI(element);
          const attrs = this.treeAdapter.getAttrList(element);
          return foreignContent2.isIntegrationPoint(tn2, ns, attrs, foreignNS);
        }
        //Active formatting elements reconstruction
        _reconstructActiveFormattingElements() {
          const listLength = this.activeFormattingElements.length;
          if (listLength) {
            let unopenIdx = listLength;
            let entry = null;
            do {
              unopenIdx--;
              entry = this.activeFormattingElements.entries[unopenIdx];
              if (entry.type === FormattingElementList.MARKER_ENTRY || this.openElements.contains(entry.element)) {
                unopenIdx++;
                break;
              }
            } while (unopenIdx > 0);
            for (let i2 = unopenIdx; i2 < listLength; i2++) {
              entry = this.activeFormattingElements.entries[i2];
              this._insertElement(entry.token, this.treeAdapter.getNamespaceURI(entry.element));
              entry.element = this.openElements.current;
            }
          }
        }
        //Close elements
        _closeTableCell() {
          this.openElements.generateImpliedEndTags();
          this.openElements.popUntilTableCellPopped();
          this.activeFormattingElements.clearToLastMarker();
          this.insertionMode = IN_ROW_MODE;
        }
        _closePElement() {
          this.openElements.generateImpliedEndTagsWithExclusion($2.P);
          this.openElements.popUntilTagNamePopped($2.P);
        }
        //Insertion modes
        _resetInsertionMode() {
          for (let i2 = this.openElements.stackTop, last = false; i2 >= 0; i2--) {
            let element = this.openElements.items[i2];
            if (i2 === 0) {
              last = true;
              if (this.fragmentContext) {
                element = this.fragmentContext;
              }
            }
            const tn2 = this.treeAdapter.getTagName(element);
            const newInsertionMode = INSERTION_MODE_RESET_MAP[tn2];
            if (newInsertionMode) {
              this.insertionMode = newInsertionMode;
              break;
            } else if (!last && (tn2 === $2.TD || tn2 === $2.TH)) {
              this.insertionMode = IN_CELL_MODE;
              break;
            } else if (!last && tn2 === $2.HEAD) {
              this.insertionMode = IN_HEAD_MODE;
              break;
            } else if (tn2 === $2.SELECT) {
              this._resetInsertionModeForSelect(i2);
              break;
            } else if (tn2 === $2.TEMPLATE) {
              this.insertionMode = this.currentTmplInsertionMode;
              break;
            } else if (tn2 === $2.HTML) {
              this.insertionMode = this.headElement ? AFTER_HEAD_MODE : BEFORE_HEAD_MODE;
              break;
            } else if (last) {
              this.insertionMode = IN_BODY_MODE;
              break;
            }
          }
        }
        _resetInsertionModeForSelect(selectIdx) {
          if (selectIdx > 0) {
            for (let i2 = selectIdx - 1; i2 > 0; i2--) {
              const ancestor = this.openElements.items[i2];
              const tn2 = this.treeAdapter.getTagName(ancestor);
              if (tn2 === $2.TEMPLATE) {
                break;
              } else if (tn2 === $2.TABLE) {
                this.insertionMode = IN_SELECT_IN_TABLE_MODE;
                return;
              }
            }
          }
          this.insertionMode = IN_SELECT_MODE;
        }
        _pushTmplInsertionMode(mode) {
          this.tmplInsertionModeStack.push(mode);
          this.tmplInsertionModeStackTop++;
          this.currentTmplInsertionMode = mode;
        }
        _popTmplInsertionMode() {
          this.tmplInsertionModeStack.pop();
          this.tmplInsertionModeStackTop--;
          this.currentTmplInsertionMode = this.tmplInsertionModeStack[this.tmplInsertionModeStackTop];
        }
        //Foster parenting
        _isElementCausesFosterParenting(element) {
          const tn2 = this.treeAdapter.getTagName(element);
          return tn2 === $2.TABLE || tn2 === $2.TBODY || tn2 === $2.TFOOT || tn2 === $2.THEAD || tn2 === $2.TR;
        }
        _shouldFosterParentOnInsertion() {
          return this.fosterParentingEnabled && this._isElementCausesFosterParenting(this.openElements.current);
        }
        _findFosterParentingLocation() {
          const location2 = {
            parent: null,
            beforeElement: null
          };
          for (let i2 = this.openElements.stackTop; i2 >= 0; i2--) {
            const openElement = this.openElements.items[i2];
            const tn2 = this.treeAdapter.getTagName(openElement);
            const ns = this.treeAdapter.getNamespaceURI(openElement);
            if (tn2 === $2.TEMPLATE && ns === NS.HTML) {
              location2.parent = this.treeAdapter.getTemplateContent(openElement);
              break;
            } else if (tn2 === $2.TABLE) {
              location2.parent = this.treeAdapter.getParentNode(openElement);
              if (location2.parent) {
                location2.beforeElement = openElement;
              } else {
                location2.parent = this.openElements.items[i2 - 1];
              }
              break;
            }
          }
          if (!location2.parent) {
            location2.parent = this.openElements.items[0];
          }
          return location2;
        }
        _fosterParentElement(element) {
          const location2 = this._findFosterParentingLocation();
          if (location2.beforeElement) {
            this.treeAdapter.insertBefore(location2.parent, element, location2.beforeElement);
          } else {
            this.treeAdapter.appendChild(location2.parent, element);
          }
        }
        _fosterParentText(chars) {
          const location2 = this._findFosterParentingLocation();
          if (location2.beforeElement) {
            this.treeAdapter.insertTextBefore(location2.parent, chars, location2.beforeElement);
          } else {
            this.treeAdapter.insertText(location2.parent, chars);
          }
        }
        //Special elements
        _isSpecialElement(element) {
          const tn2 = this.treeAdapter.getTagName(element);
          const ns = this.treeAdapter.getNamespaceURI(element);
          return HTML.SPECIAL_ELEMENTS[ns][tn2];
        }
      }
      parser$3 = Parser2;
      function aaObtainFormattingElementEntry(p, token2) {
        let formattingElementEntry = p.activeFormattingElements.getElementEntryInScopeWithTagName(token2.tagName);
        if (formattingElementEntry) {
          if (!p.openElements.contains(formattingElementEntry.element)) {
            p.activeFormattingElements.removeEntry(formattingElementEntry);
            formattingElementEntry = null;
          } else if (!p.openElements.hasInScope(token2.tagName)) {
            formattingElementEntry = null;
          }
        } else {
          genericEndTagInBody(p, token2);
        }
        return formattingElementEntry;
      }
      function aaObtainFurthestBlock(p, formattingElementEntry) {
        let furthestBlock = null;
        for (let i2 = p.openElements.stackTop; i2 >= 0; i2--) {
          const element = p.openElements.items[i2];
          if (element === formattingElementEntry.element) {
            break;
          }
          if (p._isSpecialElement(element)) {
            furthestBlock = element;
          }
        }
        if (!furthestBlock) {
          p.openElements.popUntilElementPopped(formattingElementEntry.element);
          p.activeFormattingElements.removeEntry(formattingElementEntry);
        }
        return furthestBlock;
      }
      function aaInnerLoop(p, furthestBlock, formattingElement) {
        let lastElement = furthestBlock;
        let nextElement = p.openElements.getCommonAncestor(furthestBlock);
        for (let i2 = 0, element = nextElement; element !== formattingElement; i2++, element = nextElement) {
          nextElement = p.openElements.getCommonAncestor(element);
          const elementEntry = p.activeFormattingElements.getElementEntry(element);
          const counterOverflow = elementEntry && i2 >= AA_INNER_LOOP_ITER;
          const shouldRemoveFromOpenElements = !elementEntry || counterOverflow;
          if (shouldRemoveFromOpenElements) {
            if (counterOverflow) {
              p.activeFormattingElements.removeEntry(elementEntry);
            }
            p.openElements.remove(element);
          } else {
            element = aaRecreateElementFromEntry(p, elementEntry);
            if (lastElement === furthestBlock) {
              p.activeFormattingElements.bookmark = elementEntry;
            }
            p.treeAdapter.detachNode(lastElement);
            p.treeAdapter.appendChild(element, lastElement);
            lastElement = element;
          }
        }
        return lastElement;
      }
      function aaRecreateElementFromEntry(p, elementEntry) {
        const ns = p.treeAdapter.getNamespaceURI(elementEntry.element);
        const newElement = p.treeAdapter.createElement(elementEntry.token.tagName, ns, elementEntry.token.attrs);
        p.openElements.replace(elementEntry.element, newElement);
        elementEntry.element = newElement;
        return newElement;
      }
      function aaInsertLastNodeInCommonAncestor(p, commonAncestor, lastElement) {
        if (p._isElementCausesFosterParenting(commonAncestor)) {
          p._fosterParentElement(lastElement);
        } else {
          const tn2 = p.treeAdapter.getTagName(commonAncestor);
          const ns = p.treeAdapter.getNamespaceURI(commonAncestor);
          if (tn2 === $2.TEMPLATE && ns === NS.HTML) {
            commonAncestor = p.treeAdapter.getTemplateContent(commonAncestor);
          }
          p.treeAdapter.appendChild(commonAncestor, lastElement);
        }
      }
      function aaReplaceFormattingElement(p, furthestBlock, formattingElementEntry) {
        const ns = p.treeAdapter.getNamespaceURI(formattingElementEntry.element);
        const token2 = formattingElementEntry.token;
        const newElement = p.treeAdapter.createElement(token2.tagName, ns, token2.attrs);
        p._adoptNodes(furthestBlock, newElement);
        p.treeAdapter.appendChild(furthestBlock, newElement);
        p.activeFormattingElements.insertElementAfterBookmark(newElement, formattingElementEntry.token);
        p.activeFormattingElements.removeEntry(formattingElementEntry);
        p.openElements.remove(formattingElementEntry.element);
        p.openElements.insertAfter(furthestBlock, newElement);
      }
      function callAdoptionAgency(p, token2) {
        let formattingElementEntry;
        for (let i2 = 0; i2 < AA_OUTER_LOOP_ITER; i2++) {
          formattingElementEntry = aaObtainFormattingElementEntry(p, token2);
          if (!formattingElementEntry) {
            break;
          }
          const furthestBlock = aaObtainFurthestBlock(p, formattingElementEntry);
          if (!furthestBlock) {
            break;
          }
          p.activeFormattingElements.bookmark = formattingElementEntry;
          const lastElement = aaInnerLoop(p, furthestBlock, formattingElementEntry.element);
          const commonAncestor = p.openElements.getCommonAncestor(formattingElementEntry.element);
          p.treeAdapter.detachNode(lastElement);
          aaInsertLastNodeInCommonAncestor(p, commonAncestor, lastElement);
          aaReplaceFormattingElement(p, furthestBlock, formattingElementEntry);
        }
      }
      function ignoreToken() {
      }
      function misplacedDoctype(p) {
        p._err(ERR.misplacedDoctype);
      }
      function appendComment(p, token2) {
        p._appendCommentNode(token2, p.openElements.currentTmplContent || p.openElements.current);
      }
      function appendCommentToRootHtmlElement(p, token2) {
        p._appendCommentNode(token2, p.openElements.items[0]);
      }
      function appendCommentToDocument(p, token2) {
        p._appendCommentNode(token2, p.document);
      }
      function insertCharacters(p, token2) {
        p._insertCharacters(token2);
      }
      function stopParsing(p) {
        p.stopped = true;
      }
      function doctypeInInitialMode(p, token2) {
        p._setDocumentType(token2);
        const mode = token2.forceQuirks ? HTML.DOCUMENT_MODE.QUIRKS : doctype2.getDocumentMode(token2);
        if (!doctype2.isConforming(token2)) {
          p._err(ERR.nonConformingDoctype);
        }
        p.treeAdapter.setDocumentMode(p.document, mode);
        p.insertionMode = BEFORE_HTML_MODE;
      }
      function tokenInInitialMode(p, token2) {
        p._err(ERR.missingDoctype, { beforeToken: true });
        p.treeAdapter.setDocumentMode(p.document, HTML.DOCUMENT_MODE.QUIRKS);
        p.insertionMode = BEFORE_HTML_MODE;
        p._processToken(token2);
      }
      function startTagBeforeHtml(p, token2) {
        if (token2.tagName === $2.HTML) {
          p._insertElement(token2, NS.HTML);
          p.insertionMode = BEFORE_HEAD_MODE;
        } else {
          tokenBeforeHtml(p, token2);
        }
      }
      function endTagBeforeHtml(p, token2) {
        const tn2 = token2.tagName;
        if (tn2 === $2.HTML || tn2 === $2.HEAD || tn2 === $2.BODY || tn2 === $2.BR) {
          tokenBeforeHtml(p, token2);
        }
      }
      function tokenBeforeHtml(p, token2) {
        p._insertFakeRootElement();
        p.insertionMode = BEFORE_HEAD_MODE;
        p._processToken(token2);
      }
      function startTagBeforeHead(p, token2) {
        const tn2 = token2.tagName;
        if (tn2 === $2.HTML) {
          startTagInBody(p, token2);
        } else if (tn2 === $2.HEAD) {
          p._insertElement(token2, NS.HTML);
          p.headElement = p.openElements.current;
          p.insertionMode = IN_HEAD_MODE;
        } else {
          tokenBeforeHead(p, token2);
        }
      }
      function endTagBeforeHead(p, token2) {
        const tn2 = token2.tagName;
        if (tn2 === $2.HEAD || tn2 === $2.BODY || tn2 === $2.HTML || tn2 === $2.BR) {
          tokenBeforeHead(p, token2);
        } else {
          p._err(ERR.endTagWithoutMatchingOpenElement);
        }
      }
      function tokenBeforeHead(p, token2) {
        p._insertFakeElement($2.HEAD);
        p.headElement = p.openElements.current;
        p.insertionMode = IN_HEAD_MODE;
        p._processToken(token2);
      }
      function startTagInHead(p, token2) {
        const tn2 = token2.tagName;
        if (tn2 === $2.HTML) {
          startTagInBody(p, token2);
        } else if (tn2 === $2.BASE || tn2 === $2.BASEFONT || tn2 === $2.BGSOUND || tn2 === $2.LINK || tn2 === $2.META) {
          p._appendElement(token2, NS.HTML);
          token2.ackSelfClosing = true;
        } else if (tn2 === $2.TITLE) {
          p._switchToTextParsing(token2, Tokenizer2.MODE.RCDATA);
        } else if (tn2 === $2.NOSCRIPT) {
          if (p.options.scriptingEnabled) {
            p._switchToTextParsing(token2, Tokenizer2.MODE.RAWTEXT);
          } else {
            p._insertElement(token2, NS.HTML);
            p.insertionMode = IN_HEAD_NO_SCRIPT_MODE;
          }
        } else if (tn2 === $2.NOFRAMES || tn2 === $2.STYLE) {
          p._switchToTextParsing(token2, Tokenizer2.MODE.RAWTEXT);
        } else if (tn2 === $2.SCRIPT) {
          p._switchToTextParsing(token2, Tokenizer2.MODE.SCRIPT_DATA);
        } else if (tn2 === $2.TEMPLATE) {
          p._insertTemplate(token2, NS.HTML);
          p.activeFormattingElements.insertMarker();
          p.framesetOk = false;
          p.insertionMode = IN_TEMPLATE_MODE;
          p._pushTmplInsertionMode(IN_TEMPLATE_MODE);
        } else if (tn2 === $2.HEAD) {
          p._err(ERR.misplacedStartTagForHeadElement);
        } else {
          tokenInHead(p, token2);
        }
      }
      function endTagInHead(p, token2) {
        const tn2 = token2.tagName;
        if (tn2 === $2.HEAD) {
          p.openElements.pop();
          p.insertionMode = AFTER_HEAD_MODE;
        } else if (tn2 === $2.BODY || tn2 === $2.BR || tn2 === $2.HTML) {
          tokenInHead(p, token2);
        } else if (tn2 === $2.TEMPLATE) {
          if (p.openElements.tmplCount > 0) {
            p.openElements.generateImpliedEndTagsThoroughly();
            if (p.openElements.currentTagName !== $2.TEMPLATE) {
              p._err(ERR.closingOfElementWithOpenChildElements);
            }
            p.openElements.popUntilTagNamePopped($2.TEMPLATE);
            p.activeFormattingElements.clearToLastMarker();
            p._popTmplInsertionMode();
            p._resetInsertionMode();
          } else {
            p._err(ERR.endTagWithoutMatchingOpenElement);
          }
        } else {
          p._err(ERR.endTagWithoutMatchingOpenElement);
        }
      }
      function tokenInHead(p, token2) {
        p.openElements.pop();
        p.insertionMode = AFTER_HEAD_MODE;
        p._processToken(token2);
      }
      function startTagInHeadNoScript(p, token2) {
        const tn2 = token2.tagName;
        if (tn2 === $2.HTML) {
          startTagInBody(p, token2);
        } else if (tn2 === $2.BASEFONT || tn2 === $2.BGSOUND || tn2 === $2.HEAD || tn2 === $2.LINK || tn2 === $2.META || tn2 === $2.NOFRAMES || tn2 === $2.STYLE) {
          startTagInHead(p, token2);
        } else if (tn2 === $2.NOSCRIPT) {
          p._err(ERR.nestedNoscriptInHead);
        } else {
          tokenInHeadNoScript(p, token2);
        }
      }
      function endTagInHeadNoScript(p, token2) {
        const tn2 = token2.tagName;
        if (tn2 === $2.NOSCRIPT) {
          p.openElements.pop();
          p.insertionMode = IN_HEAD_MODE;
        } else if (tn2 === $2.BR) {
          tokenInHeadNoScript(p, token2);
        } else {
          p._err(ERR.endTagWithoutMatchingOpenElement);
        }
      }
      function tokenInHeadNoScript(p, token2) {
        const errCode = token2.type === Tokenizer2.EOF_TOKEN ? ERR.openElementsLeftAfterEof : ERR.disallowedContentInNoscriptInHead;
        p._err(errCode);
        p.openElements.pop();
        p.insertionMode = IN_HEAD_MODE;
        p._processToken(token2);
      }
      function startTagAfterHead(p, token2) {
        const tn2 = token2.tagName;
        if (tn2 === $2.HTML) {
          startTagInBody(p, token2);
        } else if (tn2 === $2.BODY) {
          p._insertElement(token2, NS.HTML);
          p.framesetOk = false;
          p.insertionMode = IN_BODY_MODE;
        } else if (tn2 === $2.FRAMESET) {
          p._insertElement(token2, NS.HTML);
          p.insertionMode = IN_FRAMESET_MODE;
        } else if (tn2 === $2.BASE || tn2 === $2.BASEFONT || tn2 === $2.BGSOUND || tn2 === $2.LINK || tn2 === $2.META || tn2 === $2.NOFRAMES || tn2 === $2.SCRIPT || tn2 === $2.STYLE || tn2 === $2.TEMPLATE || tn2 === $2.TITLE) {
          p._err(ERR.abandonedHeadElementChild);
          p.openElements.push(p.headElement);
          startTagInHead(p, token2);
          p.openElements.remove(p.headElement);
        } else if (tn2 === $2.HEAD) {
          p._err(ERR.misplacedStartTagForHeadElement);
        } else {
          tokenAfterHead(p, token2);
        }
      }
      function endTagAfterHead(p, token2) {
        const tn2 = token2.tagName;
        if (tn2 === $2.BODY || tn2 === $2.HTML || tn2 === $2.BR) {
          tokenAfterHead(p, token2);
        } else if (tn2 === $2.TEMPLATE) {
          endTagInHead(p, token2);
        } else {
          p._err(ERR.endTagWithoutMatchingOpenElement);
        }
      }
      function tokenAfterHead(p, token2) {
        p._insertFakeElement($2.BODY);
        p.insertionMode = IN_BODY_MODE;
        p._processToken(token2);
      }
      function whitespaceCharacterInBody(p, token2) {
        p._reconstructActiveFormattingElements();
        p._insertCharacters(token2);
      }
      function characterInBody(p, token2) {
        p._reconstructActiveFormattingElements();
        p._insertCharacters(token2);
        p.framesetOk = false;
      }
      function htmlStartTagInBody(p, token2) {
        if (p.openElements.tmplCount === 0) {
          p.treeAdapter.adoptAttributes(p.openElements.items[0], token2.attrs);
        }
      }
      function bodyStartTagInBody(p, token2) {
        const bodyElement = p.openElements.tryPeekProperlyNestedBodyElement();
        if (bodyElement && p.openElements.tmplCount === 0) {
          p.framesetOk = false;
          p.treeAdapter.adoptAttributes(bodyElement, token2.attrs);
        }
      }
      function framesetStartTagInBody(p, token2) {
        const bodyElement = p.openElements.tryPeekProperlyNestedBodyElement();
        if (p.framesetOk && bodyElement) {
          p.treeAdapter.detachNode(bodyElement);
          p.openElements.popAllUpToHtmlElement();
          p._insertElement(token2, NS.HTML);
          p.insertionMode = IN_FRAMESET_MODE;
        }
      }
      function addressStartTagInBody(p, token2) {
        if (p.openElements.hasInButtonScope($2.P)) {
          p._closePElement();
        }
        p._insertElement(token2, NS.HTML);
      }
      function numberedHeaderStartTagInBody(p, token2) {
        if (p.openElements.hasInButtonScope($2.P)) {
          p._closePElement();
        }
        const tn2 = p.openElements.currentTagName;
        if (tn2 === $2.H1 || tn2 === $2.H2 || tn2 === $2.H3 || tn2 === $2.H4 || tn2 === $2.H5 || tn2 === $2.H6) {
          p.openElements.pop();
        }
        p._insertElement(token2, NS.HTML);
      }
      function preStartTagInBody(p, token2) {
        if (p.openElements.hasInButtonScope($2.P)) {
          p._closePElement();
        }
        p._insertElement(token2, NS.HTML);
        p.skipNextNewLine = true;
        p.framesetOk = false;
      }
      function formStartTagInBody(p, token2) {
        const inTemplate = p.openElements.tmplCount > 0;
        if (!p.formElement || inTemplate) {
          if (p.openElements.hasInButtonScope($2.P)) {
            p._closePElement();
          }
          p._insertElement(token2, NS.HTML);
          if (!inTemplate) {
            p.formElement = p.openElements.current;
          }
        }
      }
      function listItemStartTagInBody(p, token2) {
        p.framesetOk = false;
        const tn2 = token2.tagName;
        for (let i2 = p.openElements.stackTop; i2 >= 0; i2--) {
          const element = p.openElements.items[i2];
          const elementTn = p.treeAdapter.getTagName(element);
          let closeTn = null;
          if (tn2 === $2.LI && elementTn === $2.LI) {
            closeTn = $2.LI;
          } else if ((tn2 === $2.DD || tn2 === $2.DT) && (elementTn === $2.DD || elementTn === $2.DT)) {
            closeTn = elementTn;
          }
          if (closeTn) {
            p.openElements.generateImpliedEndTagsWithExclusion(closeTn);
            p.openElements.popUntilTagNamePopped(closeTn);
            break;
          }
          if (elementTn !== $2.ADDRESS && elementTn !== $2.DIV && elementTn !== $2.P && p._isSpecialElement(element)) {
            break;
          }
        }
        if (p.openElements.hasInButtonScope($2.P)) {
          p._closePElement();
        }
        p._insertElement(token2, NS.HTML);
      }
      function plaintextStartTagInBody(p, token2) {
        if (p.openElements.hasInButtonScope($2.P)) {
          p._closePElement();
        }
        p._insertElement(token2, NS.HTML);
        p.tokenizer.state = Tokenizer2.MODE.PLAINTEXT;
      }
      function buttonStartTagInBody(p, token2) {
        if (p.openElements.hasInScope($2.BUTTON)) {
          p.openElements.generateImpliedEndTags();
          p.openElements.popUntilTagNamePopped($2.BUTTON);
        }
        p._reconstructActiveFormattingElements();
        p._insertElement(token2, NS.HTML);
        p.framesetOk = false;
      }
      function aStartTagInBody(p, token2) {
        const activeElementEntry = p.activeFormattingElements.getElementEntryInScopeWithTagName($2.A);
        if (activeElementEntry) {
          callAdoptionAgency(p, token2);
          p.openElements.remove(activeElementEntry.element);
          p.activeFormattingElements.removeEntry(activeElementEntry);
        }
        p._reconstructActiveFormattingElements();
        p._insertElement(token2, NS.HTML);
        p.activeFormattingElements.pushElement(p.openElements.current, token2);
      }
      function bStartTagInBody(p, token2) {
        p._reconstructActiveFormattingElements();
        p._insertElement(token2, NS.HTML);
        p.activeFormattingElements.pushElement(p.openElements.current, token2);
      }
      function nobrStartTagInBody(p, token2) {
        p._reconstructActiveFormattingElements();
        if (p.openElements.hasInScope($2.NOBR)) {
          callAdoptionAgency(p, token2);
          p._reconstructActiveFormattingElements();
        }
        p._insertElement(token2, NS.HTML);
        p.activeFormattingElements.pushElement(p.openElements.current, token2);
      }
      function appletStartTagInBody(p, token2) {
        p._reconstructActiveFormattingElements();
        p._insertElement(token2, NS.HTML);
        p.activeFormattingElements.insertMarker();
        p.framesetOk = false;
      }
      function tableStartTagInBody(p, token2) {
        if (p.treeAdapter.getDocumentMode(p.document) !== HTML.DOCUMENT_MODE.QUIRKS && p.openElements.hasInButtonScope($2.P)) {
          p._closePElement();
        }
        p._insertElement(token2, NS.HTML);
        p.framesetOk = false;
        p.insertionMode = IN_TABLE_MODE;
      }
      function areaStartTagInBody(p, token2) {
        p._reconstructActiveFormattingElements();
        p._appendElement(token2, NS.HTML);
        p.framesetOk = false;
        token2.ackSelfClosing = true;
      }
      function inputStartTagInBody(p, token2) {
        p._reconstructActiveFormattingElements();
        p._appendElement(token2, NS.HTML);
        const inputType = Tokenizer2.getTokenAttr(token2, ATTRS.TYPE);
        if (!inputType || inputType.toLowerCase() !== HIDDEN_INPUT_TYPE) {
          p.framesetOk = false;
        }
        token2.ackSelfClosing = true;
      }
      function paramStartTagInBody(p, token2) {
        p._appendElement(token2, NS.HTML);
        token2.ackSelfClosing = true;
      }
      function hrStartTagInBody(p, token2) {
        if (p.openElements.hasInButtonScope($2.P)) {
          p._closePElement();
        }
        p._appendElement(token2, NS.HTML);
        p.framesetOk = false;
        token2.ackSelfClosing = true;
      }
      function imageStartTagInBody(p, token2) {
        token2.tagName = $2.IMG;
        areaStartTagInBody(p, token2);
      }
      function textareaStartTagInBody(p, token2) {
        p._insertElement(token2, NS.HTML);
        p.skipNextNewLine = true;
        p.tokenizer.state = Tokenizer2.MODE.RCDATA;
        p.originalInsertionMode = p.insertionMode;
        p.framesetOk = false;
        p.insertionMode = TEXT_MODE;
      }
      function xmpStartTagInBody(p, token2) {
        if (p.openElements.hasInButtonScope($2.P)) {
          p._closePElement();
        }
        p._reconstructActiveFormattingElements();
        p.framesetOk = false;
        p._switchToTextParsing(token2, Tokenizer2.MODE.RAWTEXT);
      }
      function iframeStartTagInBody(p, token2) {
        p.framesetOk = false;
        p._switchToTextParsing(token2, Tokenizer2.MODE.RAWTEXT);
      }
      function noembedStartTagInBody(p, token2) {
        p._switchToTextParsing(token2, Tokenizer2.MODE.RAWTEXT);
      }
      function selectStartTagInBody(p, token2) {
        p._reconstructActiveFormattingElements();
        p._insertElement(token2, NS.HTML);
        p.framesetOk = false;
        if (p.insertionMode === IN_TABLE_MODE || p.insertionMode === IN_CAPTION_MODE || p.insertionMode === IN_TABLE_BODY_MODE || p.insertionMode === IN_ROW_MODE || p.insertionMode === IN_CELL_MODE) {
          p.insertionMode = IN_SELECT_IN_TABLE_MODE;
        } else {
          p.insertionMode = IN_SELECT_MODE;
        }
      }
      function optgroupStartTagInBody(p, token2) {
        if (p.openElements.currentTagName === $2.OPTION) {
          p.openElements.pop();
        }
        p._reconstructActiveFormattingElements();
        p._insertElement(token2, NS.HTML);
      }
      function rbStartTagInBody(p, token2) {
        if (p.openElements.hasInScope($2.RUBY)) {
          p.openElements.generateImpliedEndTags();
        }
        p._insertElement(token2, NS.HTML);
      }
      function rtStartTagInBody(p, token2) {
        if (p.openElements.hasInScope($2.RUBY)) {
          p.openElements.generateImpliedEndTagsWithExclusion($2.RTC);
        }
        p._insertElement(token2, NS.HTML);
      }
      function menuStartTagInBody(p, token2) {
        if (p.openElements.hasInButtonScope($2.P)) {
          p._closePElement();
        }
        p._insertElement(token2, NS.HTML);
      }
      function mathStartTagInBody(p, token2) {
        p._reconstructActiveFormattingElements();
        foreignContent2.adjustTokenMathMLAttrs(token2);
        foreignContent2.adjustTokenXMLAttrs(token2);
        if (token2.selfClosing) {
          p._appendElement(token2, NS.MATHML);
        } else {
          p._insertElement(token2, NS.MATHML);
        }
        token2.ackSelfClosing = true;
      }
      function svgStartTagInBody(p, token2) {
        p._reconstructActiveFormattingElements();
        foreignContent2.adjustTokenSVGAttrs(token2);
        foreignContent2.adjustTokenXMLAttrs(token2);
        if (token2.selfClosing) {
          p._appendElement(token2, NS.SVG);
        } else {
          p._insertElement(token2, NS.SVG);
        }
        token2.ackSelfClosing = true;
      }
      function genericStartTagInBody(p, token2) {
        p._reconstructActiveFormattingElements();
        p._insertElement(token2, NS.HTML);
      }
      function startTagInBody(p, token2) {
        const tn2 = token2.tagName;
        switch (tn2.length) {
          case 1:
            if (tn2 === $2.I || tn2 === $2.S || tn2 === $2.B || tn2 === $2.U) {
              bStartTagInBody(p, token2);
            } else if (tn2 === $2.P) {
              addressStartTagInBody(p, token2);
            } else if (tn2 === $2.A) {
              aStartTagInBody(p, token2);
            } else {
              genericStartTagInBody(p, token2);
            }
            break;
          case 2:
            if (tn2 === $2.DL || tn2 === $2.OL || tn2 === $2.UL) {
              addressStartTagInBody(p, token2);
            } else if (tn2 === $2.H1 || tn2 === $2.H2 || tn2 === $2.H3 || tn2 === $2.H4 || tn2 === $2.H5 || tn2 === $2.H6) {
              numberedHeaderStartTagInBody(p, token2);
            } else if (tn2 === $2.LI || tn2 === $2.DD || tn2 === $2.DT) {
              listItemStartTagInBody(p, token2);
            } else if (tn2 === $2.EM || tn2 === $2.TT) {
              bStartTagInBody(p, token2);
            } else if (tn2 === $2.BR) {
              areaStartTagInBody(p, token2);
            } else if (tn2 === $2.HR) {
              hrStartTagInBody(p, token2);
            } else if (tn2 === $2.RB) {
              rbStartTagInBody(p, token2);
            } else if (tn2 === $2.RT || tn2 === $2.RP) {
              rtStartTagInBody(p, token2);
            } else if (tn2 !== $2.TH && tn2 !== $2.TD && tn2 !== $2.TR) {
              genericStartTagInBody(p, token2);
            }
            break;
          case 3:
            if (tn2 === $2.DIV || tn2 === $2.DIR || tn2 === $2.NAV) {
              addressStartTagInBody(p, token2);
            } else if (tn2 === $2.PRE) {
              preStartTagInBody(p, token2);
            } else if (tn2 === $2.BIG) {
              bStartTagInBody(p, token2);
            } else if (tn2 === $2.IMG || tn2 === $2.WBR) {
              areaStartTagInBody(p, token2);
            } else if (tn2 === $2.XMP) {
              xmpStartTagInBody(p, token2);
            } else if (tn2 === $2.SVG) {
              svgStartTagInBody(p, token2);
            } else if (tn2 === $2.RTC) {
              rbStartTagInBody(p, token2);
            } else if (tn2 !== $2.COL) {
              genericStartTagInBody(p, token2);
            }
            break;
          case 4:
            if (tn2 === $2.HTML) {
              htmlStartTagInBody(p, token2);
            } else if (tn2 === $2.BASE || tn2 === $2.LINK || tn2 === $2.META) {
              startTagInHead(p, token2);
            } else if (tn2 === $2.BODY) {
              bodyStartTagInBody(p, token2);
            } else if (tn2 === $2.MAIN || tn2 === $2.MENU) {
              addressStartTagInBody(p, token2);
            } else if (tn2 === $2.FORM) {
              formStartTagInBody(p, token2);
            } else if (tn2 === $2.CODE || tn2 === $2.FONT) {
              bStartTagInBody(p, token2);
            } else if (tn2 === $2.NOBR) {
              nobrStartTagInBody(p, token2);
            } else if (tn2 === $2.AREA) {
              areaStartTagInBody(p, token2);
            } else if (tn2 === $2.MATH) {
              mathStartTagInBody(p, token2);
            } else if (tn2 === $2.MENU) {
              menuStartTagInBody(p, token2);
            } else if (tn2 !== $2.HEAD) {
              genericStartTagInBody(p, token2);
            }
            break;
          case 5:
            if (tn2 === $2.STYLE || tn2 === $2.TITLE) {
              startTagInHead(p, token2);
            } else if (tn2 === $2.ASIDE) {
              addressStartTagInBody(p, token2);
            } else if (tn2 === $2.SMALL) {
              bStartTagInBody(p, token2);
            } else if (tn2 === $2.TABLE) {
              tableStartTagInBody(p, token2);
            } else if (tn2 === $2.EMBED) {
              areaStartTagInBody(p, token2);
            } else if (tn2 === $2.INPUT) {
              inputStartTagInBody(p, token2);
            } else if (tn2 === $2.PARAM || tn2 === $2.TRACK) {
              paramStartTagInBody(p, token2);
            } else if (tn2 === $2.IMAGE) {
              imageStartTagInBody(p, token2);
            } else if (tn2 !== $2.FRAME && tn2 !== $2.TBODY && tn2 !== $2.TFOOT && tn2 !== $2.THEAD) {
              genericStartTagInBody(p, token2);
            }
            break;
          case 6:
            if (tn2 === $2.SCRIPT) {
              startTagInHead(p, token2);
            } else if (tn2 === $2.CENTER || tn2 === $2.FIGURE || tn2 === $2.FOOTER || tn2 === $2.HEADER || tn2 === $2.HGROUP || tn2 === $2.DIALOG) {
              addressStartTagInBody(p, token2);
            } else if (tn2 === $2.BUTTON) {
              buttonStartTagInBody(p, token2);
            } else if (tn2 === $2.STRIKE || tn2 === $2.STRONG) {
              bStartTagInBody(p, token2);
            } else if (tn2 === $2.APPLET || tn2 === $2.OBJECT) {
              appletStartTagInBody(p, token2);
            } else if (tn2 === $2.KEYGEN) {
              areaStartTagInBody(p, token2);
            } else if (tn2 === $2.SOURCE) {
              paramStartTagInBody(p, token2);
            } else if (tn2 === $2.IFRAME) {
              iframeStartTagInBody(p, token2);
            } else if (tn2 === $2.SELECT) {
              selectStartTagInBody(p, token2);
            } else if (tn2 === $2.OPTION) {
              optgroupStartTagInBody(p, token2);
            } else {
              genericStartTagInBody(p, token2);
            }
            break;
          case 7:
            if (tn2 === $2.BGSOUND) {
              startTagInHead(p, token2);
            } else if (tn2 === $2.DETAILS || tn2 === $2.ADDRESS || tn2 === $2.ARTICLE || tn2 === $2.SECTION || tn2 === $2.SUMMARY) {
              addressStartTagInBody(p, token2);
            } else if (tn2 === $2.LISTING) {
              preStartTagInBody(p, token2);
            } else if (tn2 === $2.MARQUEE) {
              appletStartTagInBody(p, token2);
            } else if (tn2 === $2.NOEMBED) {
              noembedStartTagInBody(p, token2);
            } else if (tn2 !== $2.CAPTION) {
              genericStartTagInBody(p, token2);
            }
            break;
          case 8:
            if (tn2 === $2.BASEFONT) {
              startTagInHead(p, token2);
            } else if (tn2 === $2.FRAMESET) {
              framesetStartTagInBody(p, token2);
            } else if (tn2 === $2.FIELDSET) {
              addressStartTagInBody(p, token2);
            } else if (tn2 === $2.TEXTAREA) {
              textareaStartTagInBody(p, token2);
            } else if (tn2 === $2.TEMPLATE) {
              startTagInHead(p, token2);
            } else if (tn2 === $2.NOSCRIPT) {
              if (p.options.scriptingEnabled) {
                noembedStartTagInBody(p, token2);
              } else {
                genericStartTagInBody(p, token2);
              }
            } else if (tn2 === $2.OPTGROUP) {
              optgroupStartTagInBody(p, token2);
            } else if (tn2 !== $2.COLGROUP) {
              genericStartTagInBody(p, token2);
            }
            break;
          case 9:
            if (tn2 === $2.PLAINTEXT) {
              plaintextStartTagInBody(p, token2);
            } else {
              genericStartTagInBody(p, token2);
            }
            break;
          case 10:
            if (tn2 === $2.BLOCKQUOTE || tn2 === $2.FIGCAPTION) {
              addressStartTagInBody(p, token2);
            } else {
              genericStartTagInBody(p, token2);
            }
            break;
          default:
            genericStartTagInBody(p, token2);
        }
      }
      function bodyEndTagInBody(p) {
        if (p.openElements.hasInScope($2.BODY)) {
          p.insertionMode = AFTER_BODY_MODE;
        }
      }
      function htmlEndTagInBody(p, token2) {
        if (p.openElements.hasInScope($2.BODY)) {
          p.insertionMode = AFTER_BODY_MODE;
          p._processToken(token2);
        }
      }
      function addressEndTagInBody(p, token2) {
        const tn2 = token2.tagName;
        if (p.openElements.hasInScope(tn2)) {
          p.openElements.generateImpliedEndTags();
          p.openElements.popUntilTagNamePopped(tn2);
        }
      }
      function formEndTagInBody(p) {
        const inTemplate = p.openElements.tmplCount > 0;
        const formElement = p.formElement;
        if (!inTemplate) {
          p.formElement = null;
        }
        if ((formElement || inTemplate) && p.openElements.hasInScope($2.FORM)) {
          p.openElements.generateImpliedEndTags();
          if (inTemplate) {
            p.openElements.popUntilTagNamePopped($2.FORM);
          } else {
            p.openElements.remove(formElement);
          }
        }
      }
      function pEndTagInBody(p) {
        if (!p.openElements.hasInButtonScope($2.P)) {
          p._insertFakeElement($2.P);
        }
        p._closePElement();
      }
      function liEndTagInBody(p) {
        if (p.openElements.hasInListItemScope($2.LI)) {
          p.openElements.generateImpliedEndTagsWithExclusion($2.LI);
          p.openElements.popUntilTagNamePopped($2.LI);
        }
      }
      function ddEndTagInBody(p, token2) {
        const tn2 = token2.tagName;
        if (p.openElements.hasInScope(tn2)) {
          p.openElements.generateImpliedEndTagsWithExclusion(tn2);
          p.openElements.popUntilTagNamePopped(tn2);
        }
      }
      function numberedHeaderEndTagInBody(p) {
        if (p.openElements.hasNumberedHeaderInScope()) {
          p.openElements.generateImpliedEndTags();
          p.openElements.popUntilNumberedHeaderPopped();
        }
      }
      function appletEndTagInBody(p, token2) {
        const tn2 = token2.tagName;
        if (p.openElements.hasInScope(tn2)) {
          p.openElements.generateImpliedEndTags();
          p.openElements.popUntilTagNamePopped(tn2);
          p.activeFormattingElements.clearToLastMarker();
        }
      }
      function brEndTagInBody(p) {
        p._reconstructActiveFormattingElements();
        p._insertFakeElement($2.BR);
        p.openElements.pop();
        p.framesetOk = false;
      }
      function genericEndTagInBody(p, token2) {
        const tn2 = token2.tagName;
        for (let i2 = p.openElements.stackTop; i2 > 0; i2--) {
          const element = p.openElements.items[i2];
          if (p.treeAdapter.getTagName(element) === tn2) {
            p.openElements.generateImpliedEndTagsWithExclusion(tn2);
            p.openElements.popUntilElementPopped(element);
            break;
          }
          if (p._isSpecialElement(element)) {
            break;
          }
        }
      }
      function endTagInBody(p, token2) {
        const tn2 = token2.tagName;
        switch (tn2.length) {
          case 1:
            if (tn2 === $2.A || tn2 === $2.B || tn2 === $2.I || tn2 === $2.S || tn2 === $2.U) {
              callAdoptionAgency(p, token2);
            } else if (tn2 === $2.P) {
              pEndTagInBody(p);
            } else {
              genericEndTagInBody(p, token2);
            }
            break;
          case 2:
            if (tn2 === $2.DL || tn2 === $2.UL || tn2 === $2.OL) {
              addressEndTagInBody(p, token2);
            } else if (tn2 === $2.LI) {
              liEndTagInBody(p);
            } else if (tn2 === $2.DD || tn2 === $2.DT) {
              ddEndTagInBody(p, token2);
            } else if (tn2 === $2.H1 || tn2 === $2.H2 || tn2 === $2.H3 || tn2 === $2.H4 || tn2 === $2.H5 || tn2 === $2.H6) {
              numberedHeaderEndTagInBody(p);
            } else if (tn2 === $2.BR) {
              brEndTagInBody(p);
            } else if (tn2 === $2.EM || tn2 === $2.TT) {
              callAdoptionAgency(p, token2);
            } else {
              genericEndTagInBody(p, token2);
            }
            break;
          case 3:
            if (tn2 === $2.BIG) {
              callAdoptionAgency(p, token2);
            } else if (tn2 === $2.DIR || tn2 === $2.DIV || tn2 === $2.NAV || tn2 === $2.PRE) {
              addressEndTagInBody(p, token2);
            } else {
              genericEndTagInBody(p, token2);
            }
            break;
          case 4:
            if (tn2 === $2.BODY) {
              bodyEndTagInBody(p);
            } else if (tn2 === $2.HTML) {
              htmlEndTagInBody(p, token2);
            } else if (tn2 === $2.FORM) {
              formEndTagInBody(p);
            } else if (tn2 === $2.CODE || tn2 === $2.FONT || tn2 === $2.NOBR) {
              callAdoptionAgency(p, token2);
            } else if (tn2 === $2.MAIN || tn2 === $2.MENU) {
              addressEndTagInBody(p, token2);
            } else {
              genericEndTagInBody(p, token2);
            }
            break;
          case 5:
            if (tn2 === $2.ASIDE) {
              addressEndTagInBody(p, token2);
            } else if (tn2 === $2.SMALL) {
              callAdoptionAgency(p, token2);
            } else {
              genericEndTagInBody(p, token2);
            }
            break;
          case 6:
            if (tn2 === $2.CENTER || tn2 === $2.FIGURE || tn2 === $2.FOOTER || tn2 === $2.HEADER || tn2 === $2.HGROUP || tn2 === $2.DIALOG) {
              addressEndTagInBody(p, token2);
            } else if (tn2 === $2.APPLET || tn2 === $2.OBJECT) {
              appletEndTagInBody(p, token2);
            } else if (tn2 === $2.STRIKE || tn2 === $2.STRONG) {
              callAdoptionAgency(p, token2);
            } else {
              genericEndTagInBody(p, token2);
            }
            break;
          case 7:
            if (tn2 === $2.ADDRESS || tn2 === $2.ARTICLE || tn2 === $2.DETAILS || tn2 === $2.SECTION || tn2 === $2.SUMMARY || tn2 === $2.LISTING) {
              addressEndTagInBody(p, token2);
            } else if (tn2 === $2.MARQUEE) {
              appletEndTagInBody(p, token2);
            } else {
              genericEndTagInBody(p, token2);
            }
            break;
          case 8:
            if (tn2 === $2.FIELDSET) {
              addressEndTagInBody(p, token2);
            } else if (tn2 === $2.TEMPLATE) {
              endTagInHead(p, token2);
            } else {
              genericEndTagInBody(p, token2);
            }
            break;
          case 10:
            if (tn2 === $2.BLOCKQUOTE || tn2 === $2.FIGCAPTION) {
              addressEndTagInBody(p, token2);
            } else {
              genericEndTagInBody(p, token2);
            }
            break;
          default:
            genericEndTagInBody(p, token2);
        }
      }
      function eofInBody(p, token2) {
        if (p.tmplInsertionModeStackTop > -1) {
          eofInTemplate(p, token2);
        } else {
          p.stopped = true;
        }
      }
      function endTagInText(p, token2) {
        if (token2.tagName === $2.SCRIPT) {
          p.pendingScript = p.openElements.current;
        }
        p.openElements.pop();
        p.insertionMode = p.originalInsertionMode;
      }
      function eofInText(p, token2) {
        p._err(ERR.eofInElementThatCanContainOnlyText);
        p.openElements.pop();
        p.insertionMode = p.originalInsertionMode;
        p._processToken(token2);
      }
      function characterInTable(p, token2) {
        const curTn = p.openElements.currentTagName;
        if (curTn === $2.TABLE || curTn === $2.TBODY || curTn === $2.TFOOT || curTn === $2.THEAD || curTn === $2.TR) {
          p.pendingCharacterTokens = [];
          p.hasNonWhitespacePendingCharacterToken = false;
          p.originalInsertionMode = p.insertionMode;
          p.insertionMode = IN_TABLE_TEXT_MODE;
          p._processToken(token2);
        } else {
          tokenInTable(p, token2);
        }
      }
      function captionStartTagInTable(p, token2) {
        p.openElements.clearBackToTableContext();
        p.activeFormattingElements.insertMarker();
        p._insertElement(token2, NS.HTML);
        p.insertionMode = IN_CAPTION_MODE;
      }
      function colgroupStartTagInTable(p, token2) {
        p.openElements.clearBackToTableContext();
        p._insertElement(token2, NS.HTML);
        p.insertionMode = IN_COLUMN_GROUP_MODE;
      }
      function colStartTagInTable(p, token2) {
        p.openElements.clearBackToTableContext();
        p._insertFakeElement($2.COLGROUP);
        p.insertionMode = IN_COLUMN_GROUP_MODE;
        p._processToken(token2);
      }
      function tbodyStartTagInTable(p, token2) {
        p.openElements.clearBackToTableContext();
        p._insertElement(token2, NS.HTML);
        p.insertionMode = IN_TABLE_BODY_MODE;
      }
      function tdStartTagInTable(p, token2) {
        p.openElements.clearBackToTableContext();
        p._insertFakeElement($2.TBODY);
        p.insertionMode = IN_TABLE_BODY_MODE;
        p._processToken(token2);
      }
      function tableStartTagInTable(p, token2) {
        if (p.openElements.hasInTableScope($2.TABLE)) {
          p.openElements.popUntilTagNamePopped($2.TABLE);
          p._resetInsertionMode();
          p._processToken(token2);
        }
      }
      function inputStartTagInTable(p, token2) {
        const inputType = Tokenizer2.getTokenAttr(token2, ATTRS.TYPE);
        if (inputType && inputType.toLowerCase() === HIDDEN_INPUT_TYPE) {
          p._appendElement(token2, NS.HTML);
        } else {
          tokenInTable(p, token2);
        }
        token2.ackSelfClosing = true;
      }
      function formStartTagInTable(p, token2) {
        if (!p.formElement && p.openElements.tmplCount === 0) {
          p._insertElement(token2, NS.HTML);
          p.formElement = p.openElements.current;
          p.openElements.pop();
        }
      }
      function startTagInTable(p, token2) {
        const tn2 = token2.tagName;
        switch (tn2.length) {
          case 2:
            if (tn2 === $2.TD || tn2 === $2.TH || tn2 === $2.TR) {
              tdStartTagInTable(p, token2);
            } else {
              tokenInTable(p, token2);
            }
            break;
          case 3:
            if (tn2 === $2.COL) {
              colStartTagInTable(p, token2);
            } else {
              tokenInTable(p, token2);
            }
            break;
          case 4:
            if (tn2 === $2.FORM) {
              formStartTagInTable(p, token2);
            } else {
              tokenInTable(p, token2);
            }
            break;
          case 5:
            if (tn2 === $2.TABLE) {
              tableStartTagInTable(p, token2);
            } else if (tn2 === $2.STYLE) {
              startTagInHead(p, token2);
            } else if (tn2 === $2.TBODY || tn2 === $2.TFOOT || tn2 === $2.THEAD) {
              tbodyStartTagInTable(p, token2);
            } else if (tn2 === $2.INPUT) {
              inputStartTagInTable(p, token2);
            } else {
              tokenInTable(p, token2);
            }
            break;
          case 6:
            if (tn2 === $2.SCRIPT) {
              startTagInHead(p, token2);
            } else {
              tokenInTable(p, token2);
            }
            break;
          case 7:
            if (tn2 === $2.CAPTION) {
              captionStartTagInTable(p, token2);
            } else {
              tokenInTable(p, token2);
            }
            break;
          case 8:
            if (tn2 === $2.COLGROUP) {
              colgroupStartTagInTable(p, token2);
            } else if (tn2 === $2.TEMPLATE) {
              startTagInHead(p, token2);
            } else {
              tokenInTable(p, token2);
            }
            break;
          default:
            tokenInTable(p, token2);
        }
      }
      function endTagInTable(p, token2) {
        const tn2 = token2.tagName;
        if (tn2 === $2.TABLE) {
          if (p.openElements.hasInTableScope($2.TABLE)) {
            p.openElements.popUntilTagNamePopped($2.TABLE);
            p._resetInsertionMode();
          }
        } else if (tn2 === $2.TEMPLATE) {
          endTagInHead(p, token2);
        } else if (tn2 !== $2.BODY && tn2 !== $2.CAPTION && tn2 !== $2.COL && tn2 !== $2.COLGROUP && tn2 !== $2.HTML && tn2 !== $2.TBODY && tn2 !== $2.TD && tn2 !== $2.TFOOT && tn2 !== $2.TH && tn2 !== $2.THEAD && tn2 !== $2.TR) {
          tokenInTable(p, token2);
        }
      }
      function tokenInTable(p, token2) {
        const savedFosterParentingState = p.fosterParentingEnabled;
        p.fosterParentingEnabled = true;
        p._processTokenInBodyMode(token2);
        p.fosterParentingEnabled = savedFosterParentingState;
      }
      function whitespaceCharacterInTableText(p, token2) {
        p.pendingCharacterTokens.push(token2);
      }
      function characterInTableText(p, token2) {
        p.pendingCharacterTokens.push(token2);
        p.hasNonWhitespacePendingCharacterToken = true;
      }
      function tokenInTableText(p, token2) {
        let i2 = 0;
        if (p.hasNonWhitespacePendingCharacterToken) {
          for (; i2 < p.pendingCharacterTokens.length; i2++) {
            tokenInTable(p, p.pendingCharacterTokens[i2]);
          }
        } else {
          for (; i2 < p.pendingCharacterTokens.length; i2++) {
            p._insertCharacters(p.pendingCharacterTokens[i2]);
          }
        }
        p.insertionMode = p.originalInsertionMode;
        p._processToken(token2);
      }
      function startTagInCaption(p, token2) {
        const tn2 = token2.tagName;
        if (tn2 === $2.CAPTION || tn2 === $2.COL || tn2 === $2.COLGROUP || tn2 === $2.TBODY || tn2 === $2.TD || tn2 === $2.TFOOT || tn2 === $2.TH || tn2 === $2.THEAD || tn2 === $2.TR) {
          if (p.openElements.hasInTableScope($2.CAPTION)) {
            p.openElements.generateImpliedEndTags();
            p.openElements.popUntilTagNamePopped($2.CAPTION);
            p.activeFormattingElements.clearToLastMarker();
            p.insertionMode = IN_TABLE_MODE;
            p._processToken(token2);
          }
        } else {
          startTagInBody(p, token2);
        }
      }
      function endTagInCaption(p, token2) {
        const tn2 = token2.tagName;
        if (tn2 === $2.CAPTION || tn2 === $2.TABLE) {
          if (p.openElements.hasInTableScope($2.CAPTION)) {
            p.openElements.generateImpliedEndTags();
            p.openElements.popUntilTagNamePopped($2.CAPTION);
            p.activeFormattingElements.clearToLastMarker();
            p.insertionMode = IN_TABLE_MODE;
            if (tn2 === $2.TABLE) {
              p._processToken(token2);
            }
          }
        } else if (tn2 !== $2.BODY && tn2 !== $2.COL && tn2 !== $2.COLGROUP && tn2 !== $2.HTML && tn2 !== $2.TBODY && tn2 !== $2.TD && tn2 !== $2.TFOOT && tn2 !== $2.TH && tn2 !== $2.THEAD && tn2 !== $2.TR) {
          endTagInBody(p, token2);
        }
      }
      function startTagInColumnGroup(p, token2) {
        const tn2 = token2.tagName;
        if (tn2 === $2.HTML) {
          startTagInBody(p, token2);
        } else if (tn2 === $2.COL) {
          p._appendElement(token2, NS.HTML);
          token2.ackSelfClosing = true;
        } else if (tn2 === $2.TEMPLATE) {
          startTagInHead(p, token2);
        } else {
          tokenInColumnGroup(p, token2);
        }
      }
      function endTagInColumnGroup(p, token2) {
        const tn2 = token2.tagName;
        if (tn2 === $2.COLGROUP) {
          if (p.openElements.currentTagName === $2.COLGROUP) {
            p.openElements.pop();
            p.insertionMode = IN_TABLE_MODE;
          }
        } else if (tn2 === $2.TEMPLATE) {
          endTagInHead(p, token2);
        } else if (tn2 !== $2.COL) {
          tokenInColumnGroup(p, token2);
        }
      }
      function tokenInColumnGroup(p, token2) {
        if (p.openElements.currentTagName === $2.COLGROUP) {
          p.openElements.pop();
          p.insertionMode = IN_TABLE_MODE;
          p._processToken(token2);
        }
      }
      function startTagInTableBody(p, token2) {
        const tn2 = token2.tagName;
        if (tn2 === $2.TR) {
          p.openElements.clearBackToTableBodyContext();
          p._insertElement(token2, NS.HTML);
          p.insertionMode = IN_ROW_MODE;
        } else if (tn2 === $2.TH || tn2 === $2.TD) {
          p.openElements.clearBackToTableBodyContext();
          p._insertFakeElement($2.TR);
          p.insertionMode = IN_ROW_MODE;
          p._processToken(token2);
        } else if (tn2 === $2.CAPTION || tn2 === $2.COL || tn2 === $2.COLGROUP || tn2 === $2.TBODY || tn2 === $2.TFOOT || tn2 === $2.THEAD) {
          if (p.openElements.hasTableBodyContextInTableScope()) {
            p.openElements.clearBackToTableBodyContext();
            p.openElements.pop();
            p.insertionMode = IN_TABLE_MODE;
            p._processToken(token2);
          }
        } else {
          startTagInTable(p, token2);
        }
      }
      function endTagInTableBody(p, token2) {
        const tn2 = token2.tagName;
        if (tn2 === $2.TBODY || tn2 === $2.TFOOT || tn2 === $2.THEAD) {
          if (p.openElements.hasInTableScope(tn2)) {
            p.openElements.clearBackToTableBodyContext();
            p.openElements.pop();
            p.insertionMode = IN_TABLE_MODE;
          }
        } else if (tn2 === $2.TABLE) {
          if (p.openElements.hasTableBodyContextInTableScope()) {
            p.openElements.clearBackToTableBodyContext();
            p.openElements.pop();
            p.insertionMode = IN_TABLE_MODE;
            p._processToken(token2);
          }
        } else if (tn2 !== $2.BODY && tn2 !== $2.CAPTION && tn2 !== $2.COL && tn2 !== $2.COLGROUP || tn2 !== $2.HTML && tn2 !== $2.TD && tn2 !== $2.TH && tn2 !== $2.TR) {
          endTagInTable(p, token2);
        }
      }
      function startTagInRow(p, token2) {
        const tn2 = token2.tagName;
        if (tn2 === $2.TH || tn2 === $2.TD) {
          p.openElements.clearBackToTableRowContext();
          p._insertElement(token2, NS.HTML);
          p.insertionMode = IN_CELL_MODE;
          p.activeFormattingElements.insertMarker();
        } else if (tn2 === $2.CAPTION || tn2 === $2.COL || tn2 === $2.COLGROUP || tn2 === $2.TBODY || tn2 === $2.TFOOT || tn2 === $2.THEAD || tn2 === $2.TR) {
          if (p.openElements.hasInTableScope($2.TR)) {
            p.openElements.clearBackToTableRowContext();
            p.openElements.pop();
            p.insertionMode = IN_TABLE_BODY_MODE;
            p._processToken(token2);
          }
        } else {
          startTagInTable(p, token2);
        }
      }
      function endTagInRow(p, token2) {
        const tn2 = token2.tagName;
        if (tn2 === $2.TR) {
          if (p.openElements.hasInTableScope($2.TR)) {
            p.openElements.clearBackToTableRowContext();
            p.openElements.pop();
            p.insertionMode = IN_TABLE_BODY_MODE;
          }
        } else if (tn2 === $2.TABLE) {
          if (p.openElements.hasInTableScope($2.TR)) {
            p.openElements.clearBackToTableRowContext();
            p.openElements.pop();
            p.insertionMode = IN_TABLE_BODY_MODE;
            p._processToken(token2);
          }
        } else if (tn2 === $2.TBODY || tn2 === $2.TFOOT || tn2 === $2.THEAD) {
          if (p.openElements.hasInTableScope(tn2) || p.openElements.hasInTableScope($2.TR)) {
            p.openElements.clearBackToTableRowContext();
            p.openElements.pop();
            p.insertionMode = IN_TABLE_BODY_MODE;
            p._processToken(token2);
          }
        } else if (tn2 !== $2.BODY && tn2 !== $2.CAPTION && tn2 !== $2.COL && tn2 !== $2.COLGROUP || tn2 !== $2.HTML && tn2 !== $2.TD && tn2 !== $2.TH) {
          endTagInTable(p, token2);
        }
      }
      function startTagInCell(p, token2) {
        const tn2 = token2.tagName;
        if (tn2 === $2.CAPTION || tn2 === $2.COL || tn2 === $2.COLGROUP || tn2 === $2.TBODY || tn2 === $2.TD || tn2 === $2.TFOOT || tn2 === $2.TH || tn2 === $2.THEAD || tn2 === $2.TR) {
          if (p.openElements.hasInTableScope($2.TD) || p.openElements.hasInTableScope($2.TH)) {
            p._closeTableCell();
            p._processToken(token2);
          }
        } else {
          startTagInBody(p, token2);
        }
      }
      function endTagInCell(p, token2) {
        const tn2 = token2.tagName;
        if (tn2 === $2.TD || tn2 === $2.TH) {
          if (p.openElements.hasInTableScope(tn2)) {
            p.openElements.generateImpliedEndTags();
            p.openElements.popUntilTagNamePopped(tn2);
            p.activeFormattingElements.clearToLastMarker();
            p.insertionMode = IN_ROW_MODE;
          }
        } else if (tn2 === $2.TABLE || tn2 === $2.TBODY || tn2 === $2.TFOOT || tn2 === $2.THEAD || tn2 === $2.TR) {
          if (p.openElements.hasInTableScope(tn2)) {
            p._closeTableCell();
            p._processToken(token2);
          }
        } else if (tn2 !== $2.BODY && tn2 !== $2.CAPTION && tn2 !== $2.COL && tn2 !== $2.COLGROUP && tn2 !== $2.HTML) {
          endTagInBody(p, token2);
        }
      }
      function startTagInSelect(p, token2) {
        const tn2 = token2.tagName;
        if (tn2 === $2.HTML) {
          startTagInBody(p, token2);
        } else if (tn2 === $2.OPTION) {
          if (p.openElements.currentTagName === $2.OPTION) {
            p.openElements.pop();
          }
          p._insertElement(token2, NS.HTML);
        } else if (tn2 === $2.OPTGROUP) {
          if (p.openElements.currentTagName === $2.OPTION) {
            p.openElements.pop();
          }
          if (p.openElements.currentTagName === $2.OPTGROUP) {
            p.openElements.pop();
          }
          p._insertElement(token2, NS.HTML);
        } else if (tn2 === $2.INPUT || tn2 === $2.KEYGEN || tn2 === $2.TEXTAREA || tn2 === $2.SELECT) {
          if (p.openElements.hasInSelectScope($2.SELECT)) {
            p.openElements.popUntilTagNamePopped($2.SELECT);
            p._resetInsertionMode();
            if (tn2 !== $2.SELECT) {
              p._processToken(token2);
            }
          }
        } else if (tn2 === $2.SCRIPT || tn2 === $2.TEMPLATE) {
          startTagInHead(p, token2);
        }
      }
      function endTagInSelect(p, token2) {
        const tn2 = token2.tagName;
        if (tn2 === $2.OPTGROUP) {
          const prevOpenElement = p.openElements.items[p.openElements.stackTop - 1];
          const prevOpenElementTn = prevOpenElement && p.treeAdapter.getTagName(prevOpenElement);
          if (p.openElements.currentTagName === $2.OPTION && prevOpenElementTn === $2.OPTGROUP) {
            p.openElements.pop();
          }
          if (p.openElements.currentTagName === $2.OPTGROUP) {
            p.openElements.pop();
          }
        } else if (tn2 === $2.OPTION) {
          if (p.openElements.currentTagName === $2.OPTION) {
            p.openElements.pop();
          }
        } else if (tn2 === $2.SELECT && p.openElements.hasInSelectScope($2.SELECT)) {
          p.openElements.popUntilTagNamePopped($2.SELECT);
          p._resetInsertionMode();
        } else if (tn2 === $2.TEMPLATE) {
          endTagInHead(p, token2);
        }
      }
      function startTagInSelectInTable(p, token2) {
        const tn2 = token2.tagName;
        if (tn2 === $2.CAPTION || tn2 === $2.TABLE || tn2 === $2.TBODY || tn2 === $2.TFOOT || tn2 === $2.THEAD || tn2 === $2.TR || tn2 === $2.TD || tn2 === $2.TH) {
          p.openElements.popUntilTagNamePopped($2.SELECT);
          p._resetInsertionMode();
          p._processToken(token2);
        } else {
          startTagInSelect(p, token2);
        }
      }
      function endTagInSelectInTable(p, token2) {
        const tn2 = token2.tagName;
        if (tn2 === $2.CAPTION || tn2 === $2.TABLE || tn2 === $2.TBODY || tn2 === $2.TFOOT || tn2 === $2.THEAD || tn2 === $2.TR || tn2 === $2.TD || tn2 === $2.TH) {
          if (p.openElements.hasInTableScope(tn2)) {
            p.openElements.popUntilTagNamePopped($2.SELECT);
            p._resetInsertionMode();
            p._processToken(token2);
          }
        } else {
          endTagInSelect(p, token2);
        }
      }
      function startTagInTemplate(p, token2) {
        const tn2 = token2.tagName;
        if (tn2 === $2.BASE || tn2 === $2.BASEFONT || tn2 === $2.BGSOUND || tn2 === $2.LINK || tn2 === $2.META || tn2 === $2.NOFRAMES || tn2 === $2.SCRIPT || tn2 === $2.STYLE || tn2 === $2.TEMPLATE || tn2 === $2.TITLE) {
          startTagInHead(p, token2);
        } else {
          const newInsertionMode = TEMPLATE_INSERTION_MODE_SWITCH_MAP[tn2] || IN_BODY_MODE;
          p._popTmplInsertionMode();
          p._pushTmplInsertionMode(newInsertionMode);
          p.insertionMode = newInsertionMode;
          p._processToken(token2);
        }
      }
      function endTagInTemplate(p, token2) {
        if (token2.tagName === $2.TEMPLATE) {
          endTagInHead(p, token2);
        }
      }
      function eofInTemplate(p, token2) {
        if (p.openElements.tmplCount > 0) {
          p.openElements.popUntilTagNamePopped($2.TEMPLATE);
          p.activeFormattingElements.clearToLastMarker();
          p._popTmplInsertionMode();
          p._resetInsertionMode();
          p._processToken(token2);
        } else {
          p.stopped = true;
        }
      }
      function startTagAfterBody(p, token2) {
        if (token2.tagName === $2.HTML) {
          startTagInBody(p, token2);
        } else {
          tokenAfterBody(p, token2);
        }
      }
      function endTagAfterBody(p, token2) {
        if (token2.tagName === $2.HTML) {
          if (!p.fragmentContext) {
            p.insertionMode = AFTER_AFTER_BODY_MODE;
          }
        } else {
          tokenAfterBody(p, token2);
        }
      }
      function tokenAfterBody(p, token2) {
        p.insertionMode = IN_BODY_MODE;
        p._processToken(token2);
      }
      function startTagInFrameset(p, token2) {
        const tn2 = token2.tagName;
        if (tn2 === $2.HTML) {
          startTagInBody(p, token2);
        } else if (tn2 === $2.FRAMESET) {
          p._insertElement(token2, NS.HTML);
        } else if (tn2 === $2.FRAME) {
          p._appendElement(token2, NS.HTML);
          token2.ackSelfClosing = true;
        } else if (tn2 === $2.NOFRAMES) {
          startTagInHead(p, token2);
        }
      }
      function endTagInFrameset(p, token2) {
        if (token2.tagName === $2.FRAMESET && !p.openElements.isRootHtmlElementCurrent()) {
          p.openElements.pop();
          if (!p.fragmentContext && p.openElements.currentTagName !== $2.FRAMESET) {
            p.insertionMode = AFTER_FRAMESET_MODE;
          }
        }
      }
      function startTagAfterFrameset(p, token2) {
        const tn2 = token2.tagName;
        if (tn2 === $2.HTML) {
          startTagInBody(p, token2);
        } else if (tn2 === $2.NOFRAMES) {
          startTagInHead(p, token2);
        }
      }
      function endTagAfterFrameset(p, token2) {
        if (token2.tagName === $2.HTML) {
          p.insertionMode = AFTER_AFTER_FRAMESET_MODE;
        }
      }
      function startTagAfterAfterBody(p, token2) {
        if (token2.tagName === $2.HTML) {
          startTagInBody(p, token2);
        } else {
          tokenAfterAfterBody(p, token2);
        }
      }
      function tokenAfterAfterBody(p, token2) {
        p.insertionMode = IN_BODY_MODE;
        p._processToken(token2);
      }
      function startTagAfterAfterFrameset(p, token2) {
        const tn2 = token2.tagName;
        if (tn2 === $2.HTML) {
          startTagInBody(p, token2);
        } else if (tn2 === $2.NOFRAMES) {
          startTagInHead(p, token2);
        }
      }
      function nullCharacterInForeignContent(p, token2) {
        token2.chars = unicode2.REPLACEMENT_CHARACTER;
        p._insertCharacters(token2);
      }
      function characterInForeignContent(p, token2) {
        p._insertCharacters(token2);
        p.framesetOk = false;
      }
      function startTagInForeignContent(p, token2) {
        if (foreignContent2.causesExit(token2) && !p.fragmentContext) {
          while (p.treeAdapter.getNamespaceURI(p.openElements.current) !== NS.HTML && !p._isIntegrationPoint(p.openElements.current)) {
            p.openElements.pop();
          }
          p._processToken(token2);
        } else {
          const current2 = p._getAdjustedCurrentElement();
          const currentNs = p.treeAdapter.getNamespaceURI(current2);
          if (currentNs === NS.MATHML) {
            foreignContent2.adjustTokenMathMLAttrs(token2);
          } else if (currentNs === NS.SVG) {
            foreignContent2.adjustTokenSVGTagName(token2);
            foreignContent2.adjustTokenSVGAttrs(token2);
          }
          foreignContent2.adjustTokenXMLAttrs(token2);
          if (token2.selfClosing) {
            p._appendElement(token2, currentNs);
          } else {
            p._insertElement(token2, currentNs);
          }
          token2.ackSelfClosing = true;
        }
      }
      function endTagInForeignContent(p, token2) {
        for (let i2 = p.openElements.stackTop; i2 > 0; i2--) {
          const element = p.openElements.items[i2];
          if (p.treeAdapter.getNamespaceURI(element) === NS.HTML) {
            p._processToken(token2);
            break;
          }
          if (p.treeAdapter.getTagName(element).toLowerCase() === token2.tagName) {
            p.openElements.popUntilElementPopped(element);
            break;
          }
        }
      }
      return parser$3;
    }
    var serializer;
    var hasRequiredSerializer;
    function requireSerializer() {
      if (hasRequiredSerializer) return serializer;
      hasRequiredSerializer = 1;
      const defaultTreeAdapter = require_default();
      const mergeOptions2 = requireMergeOptions();
      const doctype2 = requireDoctype();
      const HTML = requireHtml();
      const $2 = HTML.TAG_NAMES;
      const NS = HTML.NAMESPACES;
      const DEFAULT_OPTIONS2 = {
        treeAdapter: defaultTreeAdapter
      };
      const AMP_REGEX = /&/g;
      const NBSP_REGEX = /\u00a0/g;
      const DOUBLE_QUOTE_REGEX = /"/g;
      const LT_REGEX = /</g;
      const GT_REGEX = />/g;
      class Serializer {
        constructor(node2, options2) {
          this.options = mergeOptions2(DEFAULT_OPTIONS2, options2);
          this.treeAdapter = this.options.treeAdapter;
          this.html = "";
          this.startNode = node2;
        }
        //API
        serialize() {
          this._serializeChildNodes(this.startNode);
          return this.html;
        }
        //Internals
        _serializeChildNodes(parentNode) {
          const childNodes = this.treeAdapter.getChildNodes(parentNode);
          if (childNodes) {
            for (let i2 = 0, cnLength = childNodes.length; i2 < cnLength; i2++) {
              const currentNode = childNodes[i2];
              if (this.treeAdapter.isElementNode(currentNode)) {
                this._serializeElement(currentNode);
              } else if (this.treeAdapter.isTextNode(currentNode)) {
                this._serializeTextNode(currentNode);
              } else if (this.treeAdapter.isCommentNode(currentNode)) {
                this._serializeCommentNode(currentNode);
              } else if (this.treeAdapter.isDocumentTypeNode(currentNode)) {
                this._serializeDocumentTypeNode(currentNode);
              }
            }
          }
        }
        _serializeElement(node2) {
          const tn2 = this.treeAdapter.getTagName(node2);
          const ns = this.treeAdapter.getNamespaceURI(node2);
          this.html += "<" + tn2;
          this._serializeAttributes(node2);
          this.html += ">";
          if (tn2 !== $2.AREA && tn2 !== $2.BASE && tn2 !== $2.BASEFONT && tn2 !== $2.BGSOUND && tn2 !== $2.BR && tn2 !== $2.COL && tn2 !== $2.EMBED && tn2 !== $2.FRAME && tn2 !== $2.HR && tn2 !== $2.IMG && tn2 !== $2.INPUT && tn2 !== $2.KEYGEN && tn2 !== $2.LINK && tn2 !== $2.META && tn2 !== $2.PARAM && tn2 !== $2.SOURCE && tn2 !== $2.TRACK && tn2 !== $2.WBR) {
            const childNodesHolder = tn2 === $2.TEMPLATE && ns === NS.HTML ? this.treeAdapter.getTemplateContent(node2) : node2;
            this._serializeChildNodes(childNodesHolder);
            this.html += "</" + tn2 + ">";
          }
        }
        _serializeAttributes(node2) {
          const attrs = this.treeAdapter.getAttrList(node2);
          for (let i2 = 0, attrsLength = attrs.length; i2 < attrsLength; i2++) {
            const attr = attrs[i2];
            const value2 = Serializer.escapeString(attr.value, true);
            this.html += " ";
            if (!attr.namespace) {
              this.html += attr.name;
            } else if (attr.namespace === NS.XML) {
              this.html += "xml:" + attr.name;
            } else if (attr.namespace === NS.XMLNS) {
              if (attr.name !== "xmlns") {
                this.html += "xmlns:";
              }
              this.html += attr.name;
            } else if (attr.namespace === NS.XLINK) {
              this.html += "xlink:" + attr.name;
            } else {
              this.html += attr.prefix + ":" + attr.name;
            }
            this.html += '="' + value2 + '"';
          }
        }
        _serializeTextNode(node2) {
          const content2 = this.treeAdapter.getTextNodeContent(node2);
          const parent = this.treeAdapter.getParentNode(node2);
          let parentTn = void 0;
          if (parent && this.treeAdapter.isElementNode(parent)) {
            parentTn = this.treeAdapter.getTagName(parent);
          }
          if (parentTn === $2.STYLE || parentTn === $2.SCRIPT || parentTn === $2.XMP || parentTn === $2.IFRAME || parentTn === $2.NOEMBED || parentTn === $2.NOFRAMES || parentTn === $2.PLAINTEXT || parentTn === $2.NOSCRIPT) {
            this.html += content2;
          } else {
            this.html += Serializer.escapeString(content2, false);
          }
        }
        _serializeCommentNode(node2) {
          this.html += "<!--" + this.treeAdapter.getCommentNodeContent(node2) + "-->";
        }
        _serializeDocumentTypeNode(node2) {
          const name2 = this.treeAdapter.getDocumentTypeNodeName(node2);
          this.html += "<" + doctype2.serializeContent(name2, null, null) + ">";
        }
      }
      Serializer.escapeString = function(str2, attrMode) {
        str2 = str2.replace(AMP_REGEX, "&amp;").replace(NBSP_REGEX, "&nbsp;");
        if (attrMode) {
          str2 = str2.replace(DOUBLE_QUOTE_REGEX, "&quot;");
        } else {
          str2 = str2.replace(LT_REGEX, "&lt;").replace(GT_REGEX, "&gt;");
        }
        return str2;
      };
      serializer = Serializer;
      return serializer;
    }
    var hasRequiredLib$2;
    function requireLib$2() {
      if (hasRequiredLib$2) return lib$1;
      hasRequiredLib$2 = 1;
      const Parser2 = requireParser$2();
      const Serializer = requireSerializer();
      lib$1.parse = function parse2(html2, options2) {
        const parser2 = new Parser2(options2);
        return parser2.parse(html2);
      };
      lib$1.parseFragment = function parseFragment(fragmentContext, html2, options2) {
        if (typeof fragmentContext === "string") {
          options2 = html2;
          html2 = fragmentContext;
          fragmentContext = null;
        }
        const parser2 = new Parser2(options2);
        return parser2.parseFragment(html2, fragmentContext);
      };
      lib$1.serialize = function(node2, options2) {
        const serializer2 = new Serializer(node2, options2);
        return serializer2.serialize();
      };
      return lib$1;
    }
    var lib = {};
    var hasRequiredLib$1;
    function requireLib$1() {
      if (hasRequiredLib$1) return lib;
      hasRequiredLib$1 = 1;
      const doctype2 = requireDoctype();
      const { DOCUMENT_MODE } = requireHtml();
      const nodeTypes = {
        element: 1,
        text: 3,
        cdata: 4,
        comment: 8
      };
      const nodePropertyShorthands = {
        tagName: "name",
        childNodes: "children",
        parentNode: "parent",
        previousSibling: "prev",
        nextSibling: "next",
        nodeValue: "data"
      };
      class Node2 {
        constructor(props) {
          for (const key2 of Object.keys(props)) {
            this[key2] = props[key2];
          }
        }
        get firstChild() {
          const children2 = this.children;
          return children2 && children2[0] || null;
        }
        get lastChild() {
          const children2 = this.children;
          return children2 && children2[children2.length - 1] || null;
        }
        get nodeType() {
          return nodeTypes[this.type] || nodeTypes.element;
        }
      }
      Object.keys(nodePropertyShorthands).forEach((key2) => {
        const shorthand = nodePropertyShorthands[key2];
        Object.defineProperty(Node2.prototype, key2, {
          get: function() {
            return this[shorthand] || null;
          },
          set: function(val) {
            this[shorthand] = val;
            return val;
          }
        });
      });
      lib.createDocument = function() {
        return new Node2({
          type: "root",
          name: "root",
          parent: null,
          prev: null,
          next: null,
          children: [],
          "x-mode": DOCUMENT_MODE.NO_QUIRKS
        });
      };
      lib.createDocumentFragment = function() {
        return new Node2({
          type: "root",
          name: "root",
          parent: null,
          prev: null,
          next: null,
          children: []
        });
      };
      lib.createElement = function(tagName, namespaceURI, attrs) {
        const attribs = /* @__PURE__ */ Object.create(null);
        const attribsNamespace = /* @__PURE__ */ Object.create(null);
        const attribsPrefix = /* @__PURE__ */ Object.create(null);
        for (let i2 = 0; i2 < attrs.length; i2++) {
          const attrName = attrs[i2].name;
          attribs[attrName] = attrs[i2].value;
          attribsNamespace[attrName] = attrs[i2].namespace;
          attribsPrefix[attrName] = attrs[i2].prefix;
        }
        return new Node2({
          type: tagName === "script" || tagName === "style" ? tagName : "tag",
          name: tagName,
          namespace: namespaceURI,
          attribs,
          "x-attribsNamespace": attribsNamespace,
          "x-attribsPrefix": attribsPrefix,
          children: [],
          parent: null,
          prev: null,
          next: null
        });
      };
      lib.createCommentNode = function(data) {
        return new Node2({
          type: "comment",
          data,
          parent: null,
          prev: null,
          next: null
        });
      };
      const createTextNode = function(value2) {
        return new Node2({
          type: "text",
          data: value2,
          parent: null,
          prev: null,
          next: null
        });
      };
      const appendChild = lib.appendChild = function(parentNode, newNode) {
        const prev = parentNode.children[parentNode.children.length - 1];
        if (prev) {
          prev.next = newNode;
          newNode.prev = prev;
        }
        parentNode.children.push(newNode);
        newNode.parent = parentNode;
      };
      const insertBefore = lib.insertBefore = function(parentNode, newNode, referenceNode) {
        const insertionIdx = parentNode.children.indexOf(referenceNode);
        const prev = referenceNode.prev;
        if (prev) {
          prev.next = newNode;
          newNode.prev = prev;
        }
        referenceNode.prev = newNode;
        newNode.next = referenceNode;
        parentNode.children.splice(insertionIdx, 0, newNode);
        newNode.parent = parentNode;
      };
      lib.setTemplateContent = function(templateElement, contentElement) {
        appendChild(templateElement, contentElement);
      };
      lib.getTemplateContent = function(templateElement) {
        return templateElement.children[0];
      };
      lib.setDocumentType = function(document2, name2, publicId, systemId) {
        const data = doctype2.serializeContent(name2, publicId, systemId);
        let doctypeNode = null;
        for (let i2 = 0; i2 < document2.children.length; i2++) {
          if (document2.children[i2].type === "directive" && document2.children[i2].name === "!doctype") {
            doctypeNode = document2.children[i2];
            break;
          }
        }
        if (doctypeNode) {
          doctypeNode.data = data;
          doctypeNode["x-name"] = name2;
          doctypeNode["x-publicId"] = publicId;
          doctypeNode["x-systemId"] = systemId;
        } else {
          appendChild(
            document2,
            new Node2({
              type: "directive",
              name: "!doctype",
              data,
              "x-name": name2,
              "x-publicId": publicId,
              "x-systemId": systemId
            })
          );
        }
      };
      lib.setDocumentMode = function(document2, mode) {
        document2["x-mode"] = mode;
      };
      lib.getDocumentMode = function(document2) {
        return document2["x-mode"];
      };
      lib.detachNode = function(node2) {
        if (node2.parent) {
          const idx = node2.parent.children.indexOf(node2);
          const prev = node2.prev;
          const next = node2.next;
          node2.prev = null;
          node2.next = null;
          if (prev) {
            prev.next = next;
          }
          if (next) {
            next.prev = prev;
          }
          node2.parent.children.splice(idx, 1);
          node2.parent = null;
        }
      };
      lib.insertText = function(parentNode, text2) {
        const lastChild = parentNode.children[parentNode.children.length - 1];
        if (lastChild && lastChild.type === "text") {
          lastChild.data += text2;
        } else {
          appendChild(parentNode, createTextNode(text2));
        }
      };
      lib.insertTextBefore = function(parentNode, text2, referenceNode) {
        const prevNode = parentNode.children[parentNode.children.indexOf(referenceNode) - 1];
        if (prevNode && prevNode.type === "text") {
          prevNode.data += text2;
        } else {
          insertBefore(parentNode, createTextNode(text2), referenceNode);
        }
      };
      lib.adoptAttributes = function(recipient, attrs) {
        for (let i2 = 0; i2 < attrs.length; i2++) {
          const attrName = attrs[i2].name;
          if (typeof recipient.attribs[attrName] === "undefined") {
            recipient.attribs[attrName] = attrs[i2].value;
            recipient["x-attribsNamespace"][attrName] = attrs[i2].namespace;
            recipient["x-attribsPrefix"][attrName] = attrs[i2].prefix;
          }
        }
      };
      lib.getFirstChild = function(node2) {
        return node2.children[0];
      };
      lib.getChildNodes = function(node2) {
        return node2.children;
      };
      lib.getParentNode = function(node2) {
        return node2.parent;
      };
      lib.getAttrList = function(element) {
        const attrList = [];
        for (const name2 in element.attribs) {
          attrList.push({
            name: name2,
            value: element.attribs[name2],
            namespace: element["x-attribsNamespace"][name2],
            prefix: element["x-attribsPrefix"][name2]
          });
        }
        return attrList;
      };
      lib.getTagName = function(element) {
        return element.name;
      };
      lib.getNamespaceURI = function(element) {
        return element.namespace;
      };
      lib.getTextNodeContent = function(textNode) {
        return textNode.data;
      };
      lib.getCommentNodeContent = function(commentNode) {
        return commentNode.data;
      };
      lib.getDocumentTypeNodeName = function(doctypeNode) {
        return doctypeNode["x-name"];
      };
      lib.getDocumentTypeNodePublicId = function(doctypeNode) {
        return doctypeNode["x-publicId"];
      };
      lib.getDocumentTypeNodeSystemId = function(doctypeNode) {
        return doctypeNode["x-systemId"];
      };
      lib.isTextNode = function(node2) {
        return node2.type === "text";
      };
      lib.isCommentNode = function(node2) {
        return node2.type === "comment";
      };
      lib.isDocumentTypeNode = function(node2) {
        return node2.type === "directive" && node2.name === "!doctype";
      };
      lib.isElementNode = function(node2) {
        return !!node2.attribs;
      };
      lib.setNodeSourceCodeLocation = function(node2, location2) {
        node2.sourceCodeLocation = location2;
      };
      lib.getNodeSourceCodeLocation = function(node2) {
        return node2.sourceCodeLocation;
      };
      lib.updateNodeSourceCodeLocation = function(node2, endLocation) {
        node2.sourceCodeLocation = Object.assign(node2.sourceCodeLocation, endLocation);
      };
      return lib;
    }
    var hasRequiredParse5Adapter;
    function requireParse5Adapter() {
      if (hasRequiredParse5Adapter) return parse5Adapter;
      hasRequiredParse5Adapter = 1;
      Object.defineProperty(parse5Adapter, "__esModule", { value: true });
      parse5Adapter.render = parse5Adapter.parse = void 0;
      var tslib_1 = require$$0$2;
      var domhandler_1 = /* @__PURE__ */ requireLib$a();
      var parse5_1 = requireLib$2();
      var parse5_htmlparser2_tree_adapter_1 = tslib_1.__importDefault(requireLib$1());
      function parse2(content2, options2, isDocument) {
        var opts = {
          scriptingEnabled: typeof options2.scriptingEnabled === "boolean" ? options2.scriptingEnabled : true,
          treeAdapter: parse5_htmlparser2_tree_adapter_1.default,
          sourceCodeLocationInfo: options2.sourceCodeLocationInfo
        };
        var context = options2.context;
        return isDocument ? parse5_1.parse(content2, opts) : (
          // @ts-expect-error Same issue again.
          parse5_1.parseFragment(context, content2, opts)
        );
      }
      parse5Adapter.parse = parse2;
      function render2(dom) {
        var _a2;
        var nodes = "length" in dom ? dom : [dom];
        for (var index = 0; index < nodes.length; index += 1) {
          var node2 = nodes[index];
          if (domhandler_1.isDocument(node2)) {
            (_a2 = Array.prototype.splice).call.apply(_a2, tslib_1.__spreadArray([nodes, index, 1], node2.children));
          }
        }
        return parse5_1.serialize({ children: nodes }, { treeAdapter: parse5_htmlparser2_tree_adapter_1.default });
      }
      parse5Adapter.render = render2;
      return parse5Adapter;
    }
    var htmlparser2Adapter = {};
    var hasRequiredHtmlparser2Adapter;
    function requireHtmlparser2Adapter() {
      if (hasRequiredHtmlparser2Adapter) return htmlparser2Adapter;
      hasRequiredHtmlparser2Adapter = 1;
      (function(exports2) {
        var __importDefault2 = htmlparser2Adapter && htmlparser2Adapter.__importDefault || function(mod2) {
          return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
        };
        Object.defineProperty(exports2, "__esModule", { value: true });
        exports2.render = exports2.parse = void 0;
        var htmlparser2_1 = /* @__PURE__ */ requireLib$3();
        Object.defineProperty(exports2, "parse", { enumerable: true, get: function() {
          return htmlparser2_1.parseDocument;
        } });
        var dom_serializer_1 = /* @__PURE__ */ requireLib$8();
        Object.defineProperty(exports2, "render", { enumerable: true, get: function() {
          return __importDefault2(dom_serializer_1).default;
        } });
      })(htmlparser2Adapter);
      return htmlparser2Adapter;
    }
    var hasRequired_static;
    function require_static() {
      if (hasRequired_static) return _static;
      hasRequired_static = 1;
      Object.defineProperty(_static, "__esModule", { value: true });
      _static.merge = _static.contains = _static.root = _static.parseHTML = _static.text = _static.xml = _static.html = void 0;
      var tslib_1 = require$$0$2;
      var options_1 = tslib_1.__importStar(requireOptions());
      var cheerio_select_1 = /* @__PURE__ */ requireLib$4();
      var htmlparser2_1 = /* @__PURE__ */ requireLib$3();
      var parse5_adapter_1 = requireParse5Adapter();
      var htmlparser2_adapter_1 = requireHtmlparser2Adapter();
      function render2(that, dom, options2) {
        var _a2;
        var toRender = dom ? typeof dom === "string" ? cheerio_select_1.select(dom, (_a2 = that === null || that === void 0 ? void 0 : that._root) !== null && _a2 !== void 0 ? _a2 : [], options2) : dom : that === null || that === void 0 ? void 0 : that._root.children;
        if (!toRender)
          return "";
        return options2.xmlMode || options2._useHtmlParser2 ? htmlparser2_adapter_1.render(toRender, options2) : parse5_adapter_1.render(toRender);
      }
      function isOptions(dom) {
        return typeof dom === "object" && dom != null && !("length" in dom) && !("type" in dom);
      }
      function html2(dom, options2) {
        if (!options2 && isOptions(dom)) {
          options2 = dom;
          dom = void 0;
        }
        var opts = tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({}, options_1.default), this ? this._options : {}), options_1.flatten(options2 !== null && options2 !== void 0 ? options2 : {}));
        return render2(this || void 0, dom, opts);
      }
      _static.html = html2;
      function xml(dom) {
        var options2 = tslib_1.__assign(tslib_1.__assign({}, this._options), { xmlMode: true });
        return render2(this, dom, options2);
      }
      _static.xml = xml;
      function text2(elements) {
        var elems = elements ? elements : this ? this.root() : [];
        var ret = "";
        for (var i2 = 0; i2 < elems.length; i2++) {
          var elem = elems[i2];
          if (htmlparser2_1.DomUtils.isText(elem))
            ret += elem.data;
          else if (htmlparser2_1.DomUtils.hasChildren(elem) && elem.type !== htmlparser2_1.ElementType.Comment && elem.type !== htmlparser2_1.ElementType.Script && elem.type !== htmlparser2_1.ElementType.Style) {
            ret += text2(elem.children);
          }
        }
        return ret;
      }
      _static.text = text2;
      function parseHTML(data, context, keepScripts) {
        if (keepScripts === void 0) {
          keepScripts = typeof context === "boolean" ? context : false;
        }
        if (!data || typeof data !== "string") {
          return null;
        }
        if (typeof context === "boolean") {
          keepScripts = context;
        }
        var parsed = this.load(data, options_1.default, false);
        if (!keepScripts) {
          parsed("script").remove();
        }
        return parsed.root()[0].children.slice();
      }
      _static.parseHTML = parseHTML;
      function root2() {
        return this(this._root);
      }
      _static.root = root2;
      function contains2(container2, contained) {
        if (contained === container2) {
          return false;
        }
        var next = contained;
        while (next && next !== next.parent) {
          next = next.parent;
          if (next === container2) {
            return true;
          }
        }
        return false;
      }
      _static.contains = contains2;
      function merge(arr1, arr2) {
        if (!isArrayLike(arr1) || !isArrayLike(arr2)) {
          return;
        }
        var newLength = arr1.length;
        var len = +arr2.length;
        for (var i2 = 0; i2 < len; i2++) {
          arr1[newLength++] = arr2[i2];
        }
        arr1.length = newLength;
        return arr1;
      }
      _static.merge = merge;
      function isArrayLike(item2) {
        if (Array.isArray(item2)) {
          return true;
        }
        if (typeof item2 !== "object" || !Object.prototype.hasOwnProperty.call(item2, "length") || typeof item2.length !== "number" || item2.length < 0) {
          return false;
        }
        for (var i2 = 0; i2 < item2.length; i2++) {
          if (!(i2 in item2)) {
            return false;
          }
        }
        return true;
      }
      return _static;
    }
    var cheerio = {};
    var parse$3 = {};
    var hasRequiredParse;
    function requireParse() {
      if (hasRequiredParse) return parse$3;
      hasRequiredParse = 1;
      Object.defineProperty(parse$3, "__esModule", { value: true });
      parse$3.update = void 0;
      var htmlparser2_1 = /* @__PURE__ */ requireLib$3();
      var htmlparser2_adapter_1 = requireHtmlparser2Adapter();
      var parse5_adapter_1 = requireParse5Adapter();
      var domhandler_1 = /* @__PURE__ */ requireLib$a();
      function parse2(content2, options2, isDocument) {
        if (typeof Buffer !== "undefined" && Buffer.isBuffer(content2)) {
          content2 = content2.toString();
        }
        if (typeof content2 === "string") {
          return options2.xmlMode || options2._useHtmlParser2 ? htmlparser2_adapter_1.parse(content2, options2) : parse5_adapter_1.parse(content2, options2, isDocument);
        }
        var doc2 = content2;
        if (!Array.isArray(doc2) && domhandler_1.isDocument(doc2)) {
          return doc2;
        }
        var root2 = new domhandler_1.Document([]);
        update(doc2, root2);
        return root2;
      }
      parse$3.default = parse2;
      function update(newChilds, parent) {
        var arr2 = Array.isArray(newChilds) ? newChilds : [newChilds];
        if (parent) {
          parent.children = arr2;
        } else {
          parent = null;
        }
        for (var i2 = 0; i2 < arr2.length; i2++) {
          var node2 = arr2[i2];
          if (node2.parent && node2.parent.children !== arr2) {
            htmlparser2_1.DomUtils.removeElement(node2);
          }
          if (parent) {
            node2.prev = arr2[i2 - 1] || null;
            node2.next = arr2[i2 + 1] || null;
          } else {
            node2.prev = node2.next = null;
          }
          node2.parent = parent;
        }
        return parent;
      }
      parse$3.update = update;
      return parse$3;
    }
    var utils$1 = {};
    var hasRequiredUtils$1;
    function requireUtils$1() {
      if (hasRequiredUtils$1) return utils$1;
      hasRequiredUtils$1 = 1;
      Object.defineProperty(utils$1, "__esModule", { value: true });
      utils$1.isHtml = utils$1.cloneDom = utils$1.domEach = utils$1.cssCase = utils$1.camelCase = utils$1.isCheerio = utils$1.isTag = void 0;
      var htmlparser2_1 = /* @__PURE__ */ requireLib$3();
      var domhandler_1 = /* @__PURE__ */ requireLib$a();
      utils$1.isTag = htmlparser2_1.DomUtils.isTag;
      function isCheerio(maybeCheerio) {
        return maybeCheerio.cheerio != null;
      }
      utils$1.isCheerio = isCheerio;
      function camelCase(str2) {
        return str2.replace(/[_.-](\w|$)/g, function(_, x2) {
          return x2.toUpperCase();
        });
      }
      utils$1.camelCase = camelCase;
      function cssCase(str2) {
        return str2.replace(/[A-Z]/g, "-$&").toLowerCase();
      }
      utils$1.cssCase = cssCase;
      function domEach(array, fn2) {
        var len = array.length;
        for (var i2 = 0; i2 < len; i2++)
          fn2(array[i2], i2);
        return array;
      }
      utils$1.domEach = domEach;
      function cloneDom(dom) {
        var clone2 = "length" in dom ? Array.prototype.map.call(dom, function(el2) {
          return domhandler_1.cloneNode(el2, true);
        }) : [domhandler_1.cloneNode(dom, true)];
        var root2 = new domhandler_1.Document(clone2);
        clone2.forEach(function(node2) {
          node2.parent = root2;
        });
        return clone2;
      }
      utils$1.cloneDom = cloneDom;
      var quickExpr = /<[a-zA-Z][^]*>/;
      function isHtml(str2) {
        return quickExpr.test(str2);
      }
      utils$1.isHtml = isHtml;
      return utils$1;
    }
    var attributes = {};
    var hasRequiredAttributes;
    function requireAttributes() {
      if (hasRequiredAttributes) return attributes;
      hasRequiredAttributes = 1;
      Object.defineProperty(attributes, "__esModule", { value: true });
      attributes.toggleClass = attributes.removeClass = attributes.addClass = attributes.hasClass = attributes.removeAttr = attributes.val = attributes.data = attributes.prop = attributes.attr = void 0;
      var static_1 = require_static();
      var utils_1 = requireUtils$1();
      var hasOwn = Object.prototype.hasOwnProperty;
      var rspace = /\s+/;
      var dataAttrPrefix = "data-";
      var primitives = {
        null: null,
        true: true,
        false: false
      };
      var rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i;
      var rbrace2 = /^{[^]*}$|^\[[^]*]$/;
      function getAttr(elem, name2, xmlMode) {
        var _a2;
        if (!elem || !utils_1.isTag(elem))
          return void 0;
        (_a2 = elem.attribs) !== null && _a2 !== void 0 ? _a2 : elem.attribs = {};
        if (!name2) {
          return elem.attribs;
        }
        if (hasOwn.call(elem.attribs, name2)) {
          return !xmlMode && rboolean.test(name2) ? name2 : elem.attribs[name2];
        }
        if (elem.name === "option" && name2 === "value") {
          return static_1.text(elem.children);
        }
        if (elem.name === "input" && (elem.attribs.type === "radio" || elem.attribs.type === "checkbox") && name2 === "value") {
          return "on";
        }
        return void 0;
      }
      function setAttr(el2, name2, value2) {
        if (value2 === null) {
          removeAttribute(el2, name2);
        } else {
          el2.attribs[name2] = "" + value2;
        }
      }
      function attr(name2, value2) {
        if (typeof name2 === "object" || value2 !== void 0) {
          if (typeof value2 === "function") {
            if (typeof name2 !== "string") {
              {
                throw new Error("Bad combination of arguments.");
              }
            }
            return utils_1.domEach(this, function(el2, i2) {
              if (utils_1.isTag(el2))
                setAttr(el2, name2, value2.call(el2, i2, el2.attribs[name2]));
            });
          }
          return utils_1.domEach(this, function(el2) {
            if (!utils_1.isTag(el2))
              return;
            if (typeof name2 === "object") {
              Object.keys(name2).forEach(function(objName) {
                var objValue = name2[objName];
                setAttr(el2, objName, objValue);
              });
            } else {
              setAttr(el2, name2, value2);
            }
          });
        }
        return arguments.length > 1 ? this : getAttr(this[0], name2, this.options.xmlMode);
      }
      attributes.attr = attr;
      function getProp(el2, name2, xmlMode) {
        if (!el2 || !utils_1.isTag(el2))
          return;
        return name2 in el2 ? (
          // @ts-expect-error TS doesn't like us accessing the value directly here.
          el2[name2]
        ) : !xmlMode && rboolean.test(name2) ? getAttr(el2, name2, false) !== void 0 : getAttr(el2, name2, xmlMode);
      }
      function setProp(el2, name2, value2, xmlMode) {
        if (name2 in el2) {
          el2[name2] = value2;
        } else {
          setAttr(el2, name2, !xmlMode && rboolean.test(name2) ? value2 ? "" : null : "" + value2);
        }
      }
      function prop2(name2, value2) {
        var _this = this;
        if (typeof name2 === "string" && value2 === void 0) {
          switch (name2) {
            case "style": {
              var property_1 = this.css();
              var keys = Object.keys(property_1);
              keys.forEach(function(p, i2) {
                property_1[i2] = p;
              });
              property_1.length = keys.length;
              return property_1;
            }
            case "tagName":
            case "nodeName": {
              var el2 = this[0];
              return utils_1.isTag(el2) ? el2.name.toUpperCase() : void 0;
            }
            case "outerHTML":
              return this.clone().wrap("<container />").parent().html();
            case "innerHTML":
              return this.html();
            default:
              return getProp(this[0], name2, this.options.xmlMode);
          }
        }
        if (typeof name2 === "object" || value2 !== void 0) {
          if (typeof value2 === "function") {
            if (typeof name2 === "object") {
              throw new Error("Bad combination of arguments.");
            }
            return utils_1.domEach(this, function(el3, i2) {
              if (utils_1.isTag(el3))
                setProp(el3, name2, value2.call(el3, i2, getProp(el3, name2, _this.options.xmlMode)), _this.options.xmlMode);
            });
          }
          return utils_1.domEach(this, function(el3) {
            if (!utils_1.isTag(el3))
              return;
            if (typeof name2 === "object") {
              Object.keys(name2).forEach(function(key2) {
                var val2 = name2[key2];
                setProp(el3, key2, val2, _this.options.xmlMode);
              });
            } else {
              setProp(el3, name2, value2, _this.options.xmlMode);
            }
          });
        }
        return void 0;
      }
      attributes.prop = prop2;
      function setData(el2, name2, value2) {
        var _a2;
        var elem = el2;
        (_a2 = elem.data) !== null && _a2 !== void 0 ? _a2 : elem.data = {};
        if (typeof name2 === "object")
          Object.assign(elem.data, name2);
        else if (typeof name2 === "string" && value2 !== void 0) {
          elem.data[name2] = value2;
        }
      }
      function readData(el2, name2) {
        var domNames;
        var jsNames;
        var value2;
        if (name2 == null) {
          domNames = Object.keys(el2.attribs).filter(function(attrName) {
            return attrName.startsWith(dataAttrPrefix);
          });
          jsNames = domNames.map(function(domName2) {
            return utils_1.camelCase(domName2.slice(dataAttrPrefix.length));
          });
        } else {
          domNames = [dataAttrPrefix + utils_1.cssCase(name2)];
          jsNames = [name2];
        }
        for (var idx = 0; idx < domNames.length; ++idx) {
          var domName = domNames[idx];
          var jsName = jsNames[idx];
          if (hasOwn.call(el2.attribs, domName) && !hasOwn.call(el2.data, jsName)) {
            value2 = el2.attribs[domName];
            if (hasOwn.call(primitives, value2)) {
              value2 = primitives[value2];
            } else if (value2 === String(Number(value2))) {
              value2 = Number(value2);
            } else if (rbrace2.test(value2)) {
              try {
                value2 = JSON.parse(value2);
              } catch (e) {
              }
            }
            el2.data[jsName] = value2;
          }
        }
        return name2 == null ? el2.data : value2;
      }
      function data(name2, value2) {
        var _a2;
        var elem = this[0];
        if (!elem || !utils_1.isTag(elem))
          return;
        var dataEl = elem;
        (_a2 = dataEl.data) !== null && _a2 !== void 0 ? _a2 : dataEl.data = {};
        if (!name2) {
          return readData(dataEl);
        }
        if (typeof name2 === "object" || value2 !== void 0) {
          utils_1.domEach(this, function(el2) {
            if (utils_1.isTag(el2))
              if (typeof name2 === "object")
                setData(el2, name2);
              else
                setData(el2, name2, value2);
          });
          return this;
        }
        if (hasOwn.call(dataEl.data, name2)) {
          return dataEl.data[name2];
        }
        return readData(dataEl, name2);
      }
      attributes.data = data;
      function val(value2) {
        var querying2 = arguments.length === 0;
        var element = this[0];
        if (!element || !utils_1.isTag(element))
          return querying2 ? void 0 : this;
        switch (element.name) {
          case "textarea":
            return this.text(value2);
          case "select": {
            var option = this.find("option:selected");
            if (!querying2) {
              if (this.attr("multiple") == null && typeof value2 === "object") {
                return this;
              }
              this.find("option").removeAttr("selected");
              var values = typeof value2 !== "object" ? [value2] : value2;
              for (var i2 = 0; i2 < values.length; i2++) {
                this.find('option[value="' + values[i2] + '"]').attr("selected", "");
              }
              return this;
            }
            return this.attr("multiple") ? option.toArray().map(function(el2) {
              return static_1.text(el2.children);
            }) : option.attr("value");
          }
          case "input":
          case "option":
            return querying2 ? this.attr("value") : this.attr("value", value2);
        }
        return void 0;
      }
      attributes.val = val;
      function removeAttribute(elem, name2) {
        if (!elem.attribs || !hasOwn.call(elem.attribs, name2))
          return;
        delete elem.attribs[name2];
      }
      function splitNames(names) {
        return names ? names.trim().split(rspace) : [];
      }
      function removeAttr(name2) {
        var attrNames = splitNames(name2);
        var _loop_1 = function(i3) {
          utils_1.domEach(this_1, function(elem) {
            if (utils_1.isTag(elem))
              removeAttribute(elem, attrNames[i3]);
          });
        };
        var this_1 = this;
        for (var i2 = 0; i2 < attrNames.length; i2++) {
          _loop_1(i2);
        }
        return this;
      }
      attributes.removeAttr = removeAttr;
      function hasClass(className2) {
        return this.toArray().some(function(elem) {
          var clazz = utils_1.isTag(elem) && elem.attribs.class;
          var idx = -1;
          if (clazz && className2.length) {
            while ((idx = clazz.indexOf(className2, idx + 1)) > -1) {
              var end2 = idx + className2.length;
              if ((idx === 0 || rspace.test(clazz[idx - 1])) && (end2 === clazz.length || rspace.test(clazz[end2]))) {
                return true;
              }
            }
          }
          return false;
        });
      }
      attributes.hasClass = hasClass;
      function addClass(value2) {
        if (typeof value2 === "function") {
          return utils_1.domEach(this, function(el3, i3) {
            if (utils_1.isTag(el3)) {
              var className3 = el3.attribs.class || "";
              addClass.call([el3], value2.call(el3, i3, className3));
            }
          });
        }
        if (!value2 || typeof value2 !== "string")
          return this;
        var classNames = value2.split(rspace);
        var numElements = this.length;
        for (var i2 = 0; i2 < numElements; i2++) {
          var el2 = this[i2];
          if (!utils_1.isTag(el2))
            continue;
          var className2 = getAttr(el2, "class", false);
          if (!className2) {
            setAttr(el2, "class", classNames.join(" ").trim());
          } else {
            var setClass = " " + className2 + " ";
            for (var j = 0; j < classNames.length; j++) {
              var appendClass = classNames[j] + " ";
              if (!setClass.includes(" " + appendClass))
                setClass += appendClass;
            }
            setAttr(el2, "class", setClass.trim());
          }
        }
        return this;
      }
      attributes.addClass = addClass;
      function removeClass(name2) {
        if (typeof name2 === "function") {
          return utils_1.domEach(this, function(el2, i2) {
            if (utils_1.isTag(el2))
              removeClass.call([el2], name2.call(el2, i2, el2.attribs.class || ""));
          });
        }
        var classes = splitNames(name2);
        var numClasses = classes.length;
        var removeAll = arguments.length === 0;
        return utils_1.domEach(this, function(el2) {
          if (!utils_1.isTag(el2))
            return;
          if (removeAll) {
            el2.attribs.class = "";
          } else {
            var elClasses = splitNames(el2.attribs.class);
            var changed = false;
            for (var j = 0; j < numClasses; j++) {
              var index = elClasses.indexOf(classes[j]);
              if (index >= 0) {
                elClasses.splice(index, 1);
                changed = true;
                j--;
              }
            }
            if (changed) {
              el2.attribs.class = elClasses.join(" ");
            }
          }
        });
      }
      attributes.removeClass = removeClass;
      function toggleClass(value2, stateVal) {
        if (typeof value2 === "function") {
          return utils_1.domEach(this, function(el3, i3) {
            if (utils_1.isTag(el3)) {
              toggleClass.call([el3], value2.call(el3, i3, el3.attribs.class || "", stateVal), stateVal);
            }
          });
        }
        if (!value2 || typeof value2 !== "string")
          return this;
        var classNames = value2.split(rspace);
        var numClasses = classNames.length;
        var state = typeof stateVal === "boolean" ? stateVal ? 1 : -1 : 0;
        var numElements = this.length;
        for (var i2 = 0; i2 < numElements; i2++) {
          var el2 = this[i2];
          if (!utils_1.isTag(el2))
            continue;
          var elementClasses = splitNames(el2.attribs.class);
          for (var j = 0; j < numClasses; j++) {
            var index = elementClasses.indexOf(classNames[j]);
            if (state >= 0 && index < 0) {
              elementClasses.push(classNames[j]);
            } else if (state <= 0 && index >= 0) {
              elementClasses.splice(index, 1);
            }
          }
          el2.attribs.class = elementClasses.join(" ");
        }
        return this;
      }
      attributes.toggleClass = toggleClass;
      return attributes;
    }
    var traversing = {};
    var hasRequiredTraversing;
    function requireTraversing() {
      if (hasRequiredTraversing) return traversing;
      hasRequiredTraversing = 1;
      Object.defineProperty(traversing, "__esModule", { value: true });
      traversing.addBack = traversing.add = traversing.end = traversing.slice = traversing.index = traversing.toArray = traversing.get = traversing.eq = traversing.last = traversing.first = traversing.has = traversing.not = traversing.is = traversing.filterArray = traversing.filter = traversing.map = traversing.each = traversing.contents = traversing.children = traversing.siblings = traversing.prevUntil = traversing.prevAll = traversing.prev = traversing.nextUntil = traversing.nextAll = traversing.next = traversing.closest = traversing.parentsUntil = traversing.parents = traversing.parent = traversing.find = void 0;
      var tslib_1 = require$$0$2;
      var domhandler_1 = /* @__PURE__ */ requireLib$a();
      var select = tslib_1.__importStar(/* @__PURE__ */ requireLib$4());
      var utils_1 = requireUtils$1();
      var static_1 = require_static();
      var htmlparser2_1 = /* @__PURE__ */ requireLib$3();
      var uniqueSort = htmlparser2_1.DomUtils.uniqueSort;
      var reSiblingSelector = /^\s*[~+]/;
      function find2(selectorOrHaystack) {
        var _a2;
        if (!selectorOrHaystack) {
          return this._make([]);
        }
        var context = this.toArray();
        if (typeof selectorOrHaystack !== "string") {
          var haystack = utils_1.isCheerio(selectorOrHaystack) ? selectorOrHaystack.toArray() : [selectorOrHaystack];
          return this._make(haystack.filter(function(elem) {
            return context.some(function(node2) {
              return static_1.contains(node2, elem);
            });
          }));
        }
        var elems = reSiblingSelector.test(selectorOrHaystack) ? context : this.children().toArray();
        var options2 = {
          context,
          root: (_a2 = this._root) === null || _a2 === void 0 ? void 0 : _a2[0],
          xmlMode: this.options.xmlMode
        };
        return this._make(select.select(selectorOrHaystack, elems, options2));
      }
      traversing.find = find2;
      function _getMatcher(matchMap) {
        return function(fn2) {
          var postFns = [];
          for (var _i = 1; _i < arguments.length; _i++) {
            postFns[_i - 1] = arguments[_i];
          }
          return function(selector2) {
            var _a2;
            var matched = matchMap(fn2, this);
            if (selector2) {
              matched = filterArray(matched, selector2, this.options.xmlMode, (_a2 = this._root) === null || _a2 === void 0 ? void 0 : _a2[0]);
            }
            return this._make(
              // Post processing is only necessary if there is more than one element.
              this.length > 1 && matched.length > 1 ? postFns.reduce(function(elems, fn3) {
                return fn3(elems);
              }, matched) : matched
            );
          };
        };
      }
      var _matcher = _getMatcher(function(fn2, elems) {
        var _a2;
        var ret = [];
        for (var i2 = 0; i2 < elems.length; i2++) {
          var value2 = fn2(elems[i2]);
          ret.push(value2);
        }
        return (_a2 = new Array()).concat.apply(_a2, ret);
      });
      var _singleMatcher = _getMatcher(function(fn2, elems) {
        var ret = [];
        for (var i2 = 0; i2 < elems.length; i2++) {
          var value2 = fn2(elems[i2]);
          if (value2 !== null) {
            ret.push(value2);
          }
        }
        return ret;
      });
      function _matchUntil(nextElem) {
        var postFns = [];
        for (var _i = 1; _i < arguments.length; _i++) {
          postFns[_i - 1] = arguments[_i];
        }
        var matches = null;
        var innerMatcher = _getMatcher(function(nextElem2, elems) {
          var matched = [];
          utils_1.domEach(elems, function(elem) {
            for (var next_1; next_1 = nextElem2(elem); elem = next_1) {
              if (matches === null || matches === void 0 ? void 0 : matches(next_1, matched.length))
                break;
              matched.push(next_1);
            }
          });
          return matched;
        }).apply(void 0, tslib_1.__spreadArray([nextElem], postFns));
        return function(selector2, filterSelector) {
          var _this = this;
          matches = typeof selector2 === "string" ? function(elem) {
            return select.is(elem, selector2, _this.options);
          } : selector2 ? getFilterFn(selector2) : null;
          var ret = innerMatcher.call(this, filterSelector);
          matches = null;
          return ret;
        };
      }
      function _removeDuplicates(elems) {
        return Array.from(new Set(elems));
      }
      traversing.parent = _singleMatcher(function(_a2) {
        var parent = _a2.parent;
        return parent && !domhandler_1.isDocument(parent) ? parent : null;
      }, _removeDuplicates);
      traversing.parents = _matcher(function(elem) {
        var matched = [];
        while (elem.parent && !domhandler_1.isDocument(elem.parent)) {
          matched.push(elem.parent);
          elem = elem.parent;
        }
        return matched;
      }, uniqueSort, function(elems) {
        return elems.reverse();
      });
      traversing.parentsUntil = _matchUntil(function(_a2) {
        var parent = _a2.parent;
        return parent && !domhandler_1.isDocument(parent) ? parent : null;
      }, uniqueSort, function(elems) {
        return elems.reverse();
      });
      function closest(selector2) {
        var _this = this;
        var set2 = [];
        if (!selector2) {
          return this._make(set2);
        }
        utils_1.domEach(this, function(elem) {
          var _a2;
          while (elem && elem.type !== "root") {
            if (!selector2 || filterArray([elem], selector2, _this.options.xmlMode, (_a2 = _this._root) === null || _a2 === void 0 ? void 0 : _a2[0]).length) {
              if (elem && !set2.includes(elem)) {
                set2.push(elem);
              }
              break;
            }
            elem = elem.parent;
          }
        });
        return this._make(set2);
      }
      traversing.closest = closest;
      traversing.next = _singleMatcher(function(elem) {
        return htmlparser2_1.DomUtils.nextElementSibling(elem);
      });
      traversing.nextAll = _matcher(function(elem) {
        var matched = [];
        while (elem.next) {
          elem = elem.next;
          if (utils_1.isTag(elem))
            matched.push(elem);
        }
        return matched;
      }, _removeDuplicates);
      traversing.nextUntil = _matchUntil(function(el2) {
        return htmlparser2_1.DomUtils.nextElementSibling(el2);
      }, _removeDuplicates);
      traversing.prev = _singleMatcher(function(elem) {
        return htmlparser2_1.DomUtils.prevElementSibling(elem);
      });
      traversing.prevAll = _matcher(function(elem) {
        var matched = [];
        while (elem.prev) {
          elem = elem.prev;
          if (utils_1.isTag(elem))
            matched.push(elem);
        }
        return matched;
      }, _removeDuplicates);
      traversing.prevUntil = _matchUntil(function(el2) {
        return htmlparser2_1.DomUtils.prevElementSibling(el2);
      }, _removeDuplicates);
      traversing.siblings = _matcher(function(elem) {
        return htmlparser2_1.DomUtils.getSiblings(elem).filter(function(el2) {
          return utils_1.isTag(el2) && el2 !== elem;
        });
      }, uniqueSort);
      traversing.children = _matcher(function(elem) {
        return htmlparser2_1.DomUtils.getChildren(elem).filter(utils_1.isTag);
      }, _removeDuplicates);
      function contents2() {
        var elems = this.toArray().reduce(function(newElems, elem) {
          return domhandler_1.hasChildren(elem) ? newElems.concat(elem.children) : newElems;
        }, []);
        return this._make(elems);
      }
      traversing.contents = contents2;
      function each2(fn2) {
        var i2 = 0;
        var len = this.length;
        while (i2 < len && fn2.call(this[i2], i2, this[i2]) !== false)
          ++i2;
        return this;
      }
      traversing.each = each2;
      function map2(fn2) {
        var elems = [];
        for (var i2 = 0; i2 < this.length; i2++) {
          var el2 = this[i2];
          var val = fn2.call(el2, i2, el2);
          if (val != null) {
            elems = elems.concat(val);
          }
        }
        return this._make(elems);
      }
      traversing.map = map2;
      function getFilterFn(match) {
        if (typeof match === "function") {
          return function(el2, i2) {
            return match.call(el2, i2, el2);
          };
        }
        if (utils_1.isCheerio(match)) {
          return function(el2) {
            return Array.prototype.includes.call(match, el2);
          };
        }
        return function(el2) {
          return match === el2;
        };
      }
      function filter(match) {
        var _a2;
        return this._make(filterArray(this.toArray(), match, this.options.xmlMode, (_a2 = this._root) === null || _a2 === void 0 ? void 0 : _a2[0]));
      }
      traversing.filter = filter;
      function filterArray(nodes, match, xmlMode, root2) {
        return typeof match === "string" ? select.filter(match, nodes, { xmlMode, root: root2 }) : nodes.filter(getFilterFn(match));
      }
      traversing.filterArray = filterArray;
      function is2(selector2) {
        var nodes = this.toArray();
        return typeof selector2 === "string" ? select.some(nodes.filter(utils_1.isTag), selector2, this.options) : selector2 ? nodes.some(getFilterFn(selector2)) : false;
      }
      traversing.is = is2;
      function not2(match) {
        var nodes = this.toArray();
        if (typeof match === "string") {
          var matches_1 = new Set(select.filter(match, nodes, this.options));
          nodes = nodes.filter(function(el2) {
            return !matches_1.has(el2);
          });
        } else {
          var filterFn_1 = getFilterFn(match);
          nodes = nodes.filter(function(el2, i2) {
            return !filterFn_1(el2, i2);
          });
        }
        return this._make(nodes);
      }
      traversing.not = not2;
      function has2(selectorOrHaystack) {
        var _this = this;
        return this.filter(typeof selectorOrHaystack === "string" ? (
          // Using the `:has` selector here short-circuits searches.
          ":has(" + selectorOrHaystack + ")"
        ) : function(_, el2) {
          return _this._make(el2).find(selectorOrHaystack).length > 0;
        });
      }
      traversing.has = has2;
      function first() {
        return this.length > 1 ? this._make(this[0]) : this;
      }
      traversing.first = first;
      function last() {
        return this.length > 0 ? this._make(this[this.length - 1]) : this;
      }
      traversing.last = last;
      function eq(i2) {
        var _a2;
        i2 = +i2;
        if (i2 === 0 && this.length <= 1)
          return this;
        if (i2 < 0)
          i2 = this.length + i2;
        return this._make((_a2 = this[i2]) !== null && _a2 !== void 0 ? _a2 : []);
      }
      traversing.eq = eq;
      function get2(i2) {
        if (i2 == null) {
          return this.toArray();
        }
        return this[i2 < 0 ? this.length + i2 : i2];
      }
      traversing.get = get2;
      function toArray2() {
        return Array.prototype.slice.call(this);
      }
      traversing.toArray = toArray2;
      function index(selectorOrNeedle) {
        var $haystack;
        var needle;
        if (selectorOrNeedle == null) {
          $haystack = this.parent().children();
          needle = this[0];
        } else if (typeof selectorOrNeedle === "string") {
          $haystack = this._make(selectorOrNeedle);
          needle = this[0];
        } else {
          $haystack = this;
          needle = utils_1.isCheerio(selectorOrNeedle) ? selectorOrNeedle[0] : selectorOrNeedle;
        }
        return Array.prototype.indexOf.call($haystack, needle);
      }
      traversing.index = index;
      function slice(start2, end3) {
        return this._make(Array.prototype.slice.call(this, start2, end3));
      }
      traversing.slice = slice;
      function end2() {
        var _a2;
        return (_a2 = this.prevObject) !== null && _a2 !== void 0 ? _a2 : this._make([]);
      }
      traversing.end = end2;
      function add2(other, context) {
        var selection = this._make(other, context);
        var contents3 = uniqueSort(tslib_1.__spreadArray(tslib_1.__spreadArray([], this.get()), selection.get()));
        return this._make(contents3);
      }
      traversing.add = add2;
      function addBack(selector2) {
        return this.prevObject ? this.add(selector2 ? this.prevObject.filter(selector2) : this.prevObject) : this;
      }
      traversing.addBack = addBack;
      return traversing;
    }
    var manipulation = {};
    var hasRequiredManipulation;
    function requireManipulation() {
      if (hasRequiredManipulation) return manipulation;
      hasRequiredManipulation = 1;
      Object.defineProperty(manipulation, "__esModule", { value: true });
      manipulation.clone = manipulation.text = manipulation.toString = manipulation.html = manipulation.empty = manipulation.replaceWith = manipulation.remove = manipulation.insertBefore = manipulation.before = manipulation.insertAfter = manipulation.after = manipulation.wrapAll = manipulation.unwrap = manipulation.wrapInner = manipulation.wrap = manipulation.prepend = manipulation.append = manipulation.prependTo = manipulation.appendTo = manipulation._makeDomArray = void 0;
      var tslib_1 = require$$0$2;
      var domhandler_1 = /* @__PURE__ */ requireLib$a();
      var domhandler_2 = /* @__PURE__ */ requireLib$a();
      var parse_1 = tslib_1.__importStar(requireParse());
      var static_1 = require_static();
      var utils_1 = requireUtils$1();
      var htmlparser2_1 = /* @__PURE__ */ requireLib$3();
      function _makeDomArray(elem, clone3) {
        var _this = this;
        if (elem == null) {
          return [];
        }
        if (utils_1.isCheerio(elem)) {
          return clone3 ? utils_1.cloneDom(elem.get()) : elem.get();
        }
        if (Array.isArray(elem)) {
          return elem.reduce(function(newElems, el2) {
            return newElems.concat(_this._makeDomArray(el2, clone3));
          }, []);
        }
        if (typeof elem === "string") {
          return parse_1.default(elem, this.options, false).children;
        }
        return clone3 ? utils_1.cloneDom([elem]) : [elem];
      }
      manipulation._makeDomArray = _makeDomArray;
      function _insert(concatenator) {
        return function() {
          var _this = this;
          var elems = [];
          for (var _i = 0; _i < arguments.length; _i++) {
            elems[_i] = arguments[_i];
          }
          var lastIdx = this.length - 1;
          return utils_1.domEach(this, function(el2, i2) {
            if (!domhandler_1.hasChildren(el2))
              return;
            var domSrc = typeof elems[0] === "function" ? elems[0].call(el2, i2, static_1.html(el2.children)) : elems;
            var dom = _this._makeDomArray(domSrc, i2 < lastIdx);
            concatenator(dom, el2.children, el2);
          });
        };
      }
      function uniqueSplice(array, spliceIdx, spliceCount, newElems, parent) {
        var _a2, _b2;
        var spliceArgs = tslib_1.__spreadArray([
          spliceIdx,
          spliceCount
        ], newElems);
        var prev = array[spliceIdx - 1] || null;
        var next = array[spliceIdx + spliceCount] || null;
        for (var idx = 0; idx < newElems.length; ++idx) {
          var node2 = newElems[idx];
          var oldParent = node2.parent;
          if (oldParent) {
            var prevIdx = oldParent.children.indexOf(newElems[idx]);
            if (prevIdx > -1) {
              oldParent.children.splice(prevIdx, 1);
              if (parent === oldParent && spliceIdx > prevIdx) {
                spliceArgs[0]--;
              }
            }
          }
          node2.parent = parent;
          if (node2.prev) {
            node2.prev.next = (_a2 = node2.next) !== null && _a2 !== void 0 ? _a2 : null;
          }
          if (node2.next) {
            node2.next.prev = (_b2 = node2.prev) !== null && _b2 !== void 0 ? _b2 : null;
          }
          node2.prev = newElems[idx - 1] || prev;
          node2.next = newElems[idx + 1] || next;
        }
        if (prev) {
          prev.next = newElems[0];
        }
        if (next) {
          next.prev = newElems[newElems.length - 1];
        }
        return array.splice.apply(array, spliceArgs);
      }
      function appendTo(target2) {
        var appendTarget = utils_1.isCheerio(target2) ? target2 : this._make(target2);
        appendTarget.append(this);
        return this;
      }
      manipulation.appendTo = appendTo;
      function prependTo(target2) {
        var prependTarget = utils_1.isCheerio(target2) ? target2 : this._make(target2);
        prependTarget.prepend(this);
        return this;
      }
      manipulation.prependTo = prependTo;
      manipulation.append = _insert(function(dom, children2, parent) {
        uniqueSplice(children2, children2.length, 0, dom, parent);
      });
      manipulation.prepend = _insert(function(dom, children2, parent) {
        uniqueSplice(children2, 0, 0, dom, parent);
      });
      function _wrap(insert2) {
        return function(wrapper2) {
          var lastIdx = this.length - 1;
          var lastParent = this.parents().last();
          for (var i2 = 0; i2 < this.length; i2++) {
            var el2 = this[i2];
            var wrap_1 = typeof wrapper2 === "function" ? wrapper2.call(el2, i2, el2) : typeof wrapper2 === "string" && !utils_1.isHtml(wrapper2) ? lastParent.find(wrapper2).clone() : wrapper2;
            var wrapperDom = this._makeDomArray(wrap_1, i2 < lastIdx)[0];
            if (!wrapperDom || !htmlparser2_1.DomUtils.hasChildren(wrapperDom))
              continue;
            var elInsertLocation = wrapperDom;
            var j = 0;
            while (j < elInsertLocation.children.length) {
              var child = elInsertLocation.children[j];
              if (utils_1.isTag(child)) {
                elInsertLocation = child;
                j = 0;
              } else {
                j++;
              }
            }
            insert2(el2, elInsertLocation, [wrapperDom]);
          }
          return this;
        };
      }
      manipulation.wrap = _wrap(function(el2, elInsertLocation, wrapperDom) {
        var parent = el2.parent;
        if (!parent)
          return;
        var siblings = parent.children;
        var index = siblings.indexOf(el2);
        parse_1.update([el2], elInsertLocation);
        uniqueSplice(siblings, index, 0, wrapperDom, parent);
      });
      manipulation.wrapInner = _wrap(function(el2, elInsertLocation, wrapperDom) {
        if (!domhandler_1.hasChildren(el2))
          return;
        parse_1.update(el2.children, elInsertLocation);
        parse_1.update(wrapperDom, el2);
      });
      function unwrap2(selector2) {
        var _this = this;
        this.parent(selector2).not("body").each(function(_, el2) {
          _this._make(el2).replaceWith(el2.children);
        });
        return this;
      }
      manipulation.unwrap = unwrap2;
      function wrapAll(wrapper2) {
        var el2 = this[0];
        if (el2) {
          var wrap_2 = this._make(typeof wrapper2 === "function" ? wrapper2.call(el2, 0, el2) : wrapper2).insertBefore(el2);
          var elInsertLocation = void 0;
          for (var i2 = 0; i2 < wrap_2.length; i2++) {
            if (wrap_2[i2].type === "tag")
              elInsertLocation = wrap_2[i2];
          }
          var j = 0;
          while (elInsertLocation && j < elInsertLocation.children.length) {
            var child = elInsertLocation.children[j];
            if (child.type === "tag") {
              elInsertLocation = child;
              j = 0;
            } else {
              j++;
            }
          }
          if (elInsertLocation)
            this._make(elInsertLocation).append(this);
        }
        return this;
      }
      manipulation.wrapAll = wrapAll;
      function after() {
        var _this = this;
        var elems = [];
        for (var _i = 0; _i < arguments.length; _i++) {
          elems[_i] = arguments[_i];
        }
        var lastIdx = this.length - 1;
        return utils_1.domEach(this, function(el2, i2) {
          var parent = el2.parent;
          if (!htmlparser2_1.DomUtils.hasChildren(el2) || !parent) {
            return;
          }
          var siblings = parent.children;
          var index = siblings.indexOf(el2);
          if (index < 0)
            return;
          var domSrc = typeof elems[0] === "function" ? elems[0].call(el2, i2, static_1.html(el2.children)) : elems;
          var dom = _this._makeDomArray(domSrc, i2 < lastIdx);
          uniqueSplice(siblings, index + 1, 0, dom, parent);
        });
      }
      manipulation.after = after;
      function insertAfter(target2) {
        var _this = this;
        if (typeof target2 === "string") {
          target2 = this._make(target2);
        }
        this.remove();
        var clones = [];
        this._makeDomArray(target2).forEach(function(el2) {
          var clonedSelf = _this.clone().toArray();
          var parent = el2.parent;
          if (!parent) {
            return;
          }
          var siblings = parent.children;
          var index = siblings.indexOf(el2);
          if (index < 0)
            return;
          uniqueSplice(siblings, index + 1, 0, clonedSelf, parent);
          clones.push.apply(clones, clonedSelf);
        });
        return this._make(clones);
      }
      manipulation.insertAfter = insertAfter;
      function before() {
        var _this = this;
        var elems = [];
        for (var _i = 0; _i < arguments.length; _i++) {
          elems[_i] = arguments[_i];
        }
        var lastIdx = this.length - 1;
        return utils_1.domEach(this, function(el2, i2) {
          var parent = el2.parent;
          if (!htmlparser2_1.DomUtils.hasChildren(el2) || !parent) {
            return;
          }
          var siblings = parent.children;
          var index = siblings.indexOf(el2);
          if (index < 0)
            return;
          var domSrc = typeof elems[0] === "function" ? elems[0].call(el2, i2, static_1.html(el2.children)) : elems;
          var dom = _this._makeDomArray(domSrc, i2 < lastIdx);
          uniqueSplice(siblings, index, 0, dom, parent);
        });
      }
      manipulation.before = before;
      function insertBefore(target2) {
        var _this = this;
        var targetArr = this._make(target2);
        this.remove();
        var clones = [];
        utils_1.domEach(targetArr, function(el2) {
          var clonedSelf = _this.clone().toArray();
          var parent = el2.parent;
          if (!parent) {
            return;
          }
          var siblings = parent.children;
          var index = siblings.indexOf(el2);
          if (index < 0)
            return;
          uniqueSplice(siblings, index, 0, clonedSelf, parent);
          clones.push.apply(clones, clonedSelf);
        });
        return this._make(clones);
      }
      manipulation.insertBefore = insertBefore;
      function remove2(selector2) {
        var elems = selector2 ? this.filter(selector2) : this;
        utils_1.domEach(elems, function(el2) {
          htmlparser2_1.DomUtils.removeElement(el2);
          el2.prev = el2.next = el2.parent = null;
        });
        return this;
      }
      manipulation.remove = remove2;
      function replaceWith(content2) {
        var _this = this;
        return utils_1.domEach(this, function(el2, i2) {
          var parent = el2.parent;
          if (!parent) {
            return;
          }
          var siblings = parent.children;
          var cont = typeof content2 === "function" ? content2.call(el2, i2, el2) : content2;
          var dom = _this._makeDomArray(cont);
          parse_1.update(dom, null);
          var index = siblings.indexOf(el2);
          uniqueSplice(siblings, index, 1, dom, parent);
          if (!dom.includes(el2)) {
            el2.parent = el2.prev = el2.next = null;
          }
        });
      }
      manipulation.replaceWith = replaceWith;
      function empty2() {
        return utils_1.domEach(this, function(el2) {
          if (!htmlparser2_1.DomUtils.hasChildren(el2))
            return;
          el2.children.forEach(function(child) {
            child.next = child.prev = child.parent = null;
          });
          el2.children.length = 0;
        });
      }
      manipulation.empty = empty2;
      function html2(str2) {
        if (str2 === void 0) {
          var el2 = this[0];
          if (!el2 || !htmlparser2_1.DomUtils.hasChildren(el2))
            return null;
          return static_1.html(el2.children, this.options);
        }
        var opts = tslib_1.__assign(tslib_1.__assign({}, this.options), { context: null });
        return utils_1.domEach(this, function(el3) {
          if (!htmlparser2_1.DomUtils.hasChildren(el3))
            return;
          el3.children.forEach(function(child) {
            child.next = child.prev = child.parent = null;
          });
          opts.context = el3;
          var content2 = utils_1.isCheerio(str2) ? str2.toArray() : parse_1.default("" + str2, opts, false).children;
          parse_1.update(content2, el3);
        });
      }
      manipulation.html = html2;
      function toString2() {
        return static_1.html(this, this.options);
      }
      manipulation.toString = toString2;
      function text2(str2) {
        var _this = this;
        if (str2 === void 0) {
          return static_1.text(this);
        }
        if (typeof str2 === "function") {
          return utils_1.domEach(this, function(el2, i2) {
            text2.call(_this._make(el2), str2.call(el2, i2, static_1.text([el2])));
          });
        }
        return utils_1.domEach(this, function(el2) {
          if (!htmlparser2_1.DomUtils.hasChildren(el2))
            return;
          el2.children.forEach(function(child) {
            child.next = child.prev = child.parent = null;
          });
          var textNode = new domhandler_2.Text(str2);
          parse_1.update(textNode, el2);
        });
      }
      manipulation.text = text2;
      function clone2() {
        return this._make(utils_1.cloneDom(this.get()));
      }
      manipulation.clone = clone2;
      return manipulation;
    }
    var css = {};
    var hasRequiredCss;
    function requireCss() {
      if (hasRequiredCss) return css;
      hasRequiredCss = 1;
      Object.defineProperty(css, "__esModule", { value: true });
      css.css = void 0;
      var utils_1 = requireUtils$1();
      function css$1(prop2, val) {
        if (prop2 != null && val != null || // When `prop` is a "plain" object
        typeof prop2 === "object" && !Array.isArray(prop2)) {
          return utils_1.domEach(this, function(el2, i2) {
            if (utils_1.isTag(el2)) {
              setCss(el2, prop2, val, i2);
            }
          });
        }
        return getCss(this[0], prop2);
      }
      css.css = css$1;
      function setCss(el2, prop2, value2, idx) {
        if (typeof prop2 === "string") {
          var styles2 = getCss(el2);
          var val = typeof value2 === "function" ? value2.call(el2, idx, styles2[prop2]) : value2;
          if (val === "") {
            delete styles2[prop2];
          } else if (val != null) {
            styles2[prop2] = val;
          }
          el2.attribs.style = stringify2(styles2);
        } else if (typeof prop2 === "object") {
          Object.keys(prop2).forEach(function(k2, i2) {
            setCss(el2, k2, prop2[k2], i2);
          });
        }
      }
      function getCss(el2, prop2) {
        if (!el2 || !utils_1.isTag(el2))
          return;
        var styles2 = parse2(el2.attribs.style);
        if (typeof prop2 === "string") {
          return styles2[prop2];
        }
        if (Array.isArray(prop2)) {
          var newStyles_1 = {};
          prop2.forEach(function(item2) {
            if (styles2[item2] != null) {
              newStyles_1[item2] = styles2[item2];
            }
          });
          return newStyles_1;
        }
        return styles2;
      }
      function stringify2(obj) {
        return Object.keys(obj).reduce(function(str2, prop2) {
          return "" + str2 + (str2 ? " " : "") + prop2 + ": " + obj[prop2] + ";";
        }, "");
      }
      function parse2(styles2) {
        styles2 = (styles2 || "").trim();
        if (!styles2)
          return {};
        return styles2.split(";").reduce(function(obj, str2) {
          var n = str2.indexOf(":");
          if (n < 1 || n === str2.length - 1)
            return obj;
          obj[str2.slice(0, n).trim()] = str2.slice(n + 1).trim();
          return obj;
        }, {});
      }
      return css;
    }
    var forms = {};
    var hasRequiredForms;
    function requireForms() {
      if (hasRequiredForms) return forms;
      hasRequiredForms = 1;
      Object.defineProperty(forms, "__esModule", { value: true });
      forms.serializeArray = forms.serialize = void 0;
      var utils_1 = requireUtils$1();
      var submittableSelector = "input,select,textarea,keygen";
      var r20 = /%20/g;
      var rCRLF = /\r?\n/g;
      function serialize() {
        var arr2 = this.serializeArray();
        var retArr = arr2.map(function(data) {
          return encodeURIComponent(data.name) + "=" + encodeURIComponent(data.value);
        });
        return retArr.join("&").replace(r20, "+");
      }
      forms.serialize = serialize;
      function serializeArray() {
        var _this = this;
        return this.map(function(_, elem) {
          var $elem = _this._make(elem);
          if (utils_1.isTag(elem) && elem.name === "form") {
            return $elem.find(submittableSelector).toArray();
          }
          return $elem.filter(submittableSelector).toArray();
        }).filter(
          // Verify elements have a name (`attr.name`) and are not disabled (`:enabled`)
          '[name!=""]:enabled:not(:submit, :button, :image, :reset, :file):matches([checked], :not(:checkbox, :radio))'
          // Convert each of the elements to its value(s)
        ).map(function(_, elem) {
          var _a2;
          var $elem = _this._make(elem);
          var name2 = $elem.attr("name");
          var value2 = (_a2 = $elem.val()) !== null && _a2 !== void 0 ? _a2 : "";
          if (Array.isArray(value2)) {
            return value2.map(function(val) {
              return { name: name2, value: val.replace(rCRLF, "\r\n") };
            });
          }
          return { name: name2, value: value2.replace(rCRLF, "\r\n") };
        }).toArray();
      }
      forms.serializeArray = serializeArray;
      return forms;
    }
    var hasRequiredCheerio$1;
    function requireCheerio$1() {
      if (hasRequiredCheerio$1) return cheerio;
      hasRequiredCheerio$1 = 1;
      Object.defineProperty(cheerio, "__esModule", { value: true });
      cheerio.Cheerio = void 0;
      var tslib_1 = require$$0$2;
      var parse_1 = tslib_1.__importDefault(requireParse());
      var options_1 = tslib_1.__importDefault(requireOptions());
      var utils_1 = requireUtils$1();
      var Attributes2 = tslib_1.__importStar(requireAttributes());
      var Traversing = tslib_1.__importStar(requireTraversing());
      var Manipulation = tslib_1.__importStar(requireManipulation());
      var Css = tslib_1.__importStar(requireCss());
      var Forms = tslib_1.__importStar(requireForms());
      var Cheerio = (
        /** @class */
        (function() {
          function Cheerio2(selector2, context, root2, options2) {
            var _this = this;
            if (options2 === void 0) {
              options2 = options_1.default;
            }
            this.length = 0;
            this.options = options2;
            if (!selector2)
              return this;
            if (root2) {
              if (typeof root2 === "string")
                root2 = parse_1.default(root2, this.options, false);
              this._root = new this.constructor(root2, null, null, this.options);
              this._root._root = this._root;
            }
            if (utils_1.isCheerio(selector2))
              return selector2;
            var elements = typeof selector2 === "string" && utils_1.isHtml(selector2) ? (
              // $(<html>)
              parse_1.default(selector2, this.options, false).children
            ) : isNode(selector2) ? (
              // $(dom)
              [selector2]
            ) : Array.isArray(selector2) ? (
              // $([dom])
              selector2
            ) : null;
            if (elements) {
              elements.forEach(function(elem, idx) {
                _this[idx] = elem;
              });
              this.length = elements.length;
              return this;
            }
            var search = selector2;
            var searchContext = !context ? (
              // If we don't have a context, maybe we have a root, from loading
              this._root
            ) : typeof context === "string" ? utils_1.isHtml(context) ? (
              // $('li', '<ul>...</ul>')
              this._make(parse_1.default(context, this.options, false))
            ) : (
              // $('li', 'ul')
              (search = context + " " + search, this._root)
            ) : utils_1.isCheerio(context) ? (
              // $('li', $)
              context
            ) : (
              // $('li', node), $('li', [nodes])
              this._make(context)
            );
            if (!searchContext)
              return this;
            return searchContext.find(search);
          }
          Cheerio2.prototype._make = function(dom, context) {
            var cheerio2 = new this.constructor(dom, context, this._root, this.options);
            cheerio2.prevObject = this;
            return cheerio2;
          };
          return Cheerio2;
        })()
      );
      cheerio.Cheerio = Cheerio;
      Cheerio.prototype.cheerio = "[cheerio object]";
      Cheerio.prototype.splice = Array.prototype.splice;
      Cheerio.prototype[Symbol.iterator] = Array.prototype[Symbol.iterator];
      Object.assign(Cheerio.prototype, Attributes2, Traversing, Manipulation, Css, Forms);
      function isNode(obj) {
        return !!obj.name || obj.type === "root" || obj.type === "text" || obj.type === "comment";
      }
      return cheerio;
    }
    var hasRequiredLoad;
    function requireLoad() {
      if (hasRequiredLoad) return load;
      hasRequiredLoad = 1;
      Object.defineProperty(load, "__esModule", { value: true });
      load.load = void 0;
      var tslib_1 = require$$0$2;
      var options_1 = tslib_1.__importStar(requireOptions());
      var staticMethods = tslib_1.__importStar(require_static());
      var cheerio_1 = requireCheerio$1();
      var parse_1 = tslib_1.__importDefault(requireParse());
      function load$1(content2, options2, isDocument) {
        if (isDocument === void 0) {
          isDocument = true;
        }
        if (content2 == null) {
          throw new Error("cheerio.load() expects a string");
        }
        var internalOpts = tslib_1.__assign(tslib_1.__assign({}, options_1.default), options_1.flatten(options2));
        var root2 = parse_1.default(content2, internalOpts, isDocument);
        var LoadedCheerio = (
          /** @class */
          (function(_super) {
            tslib_1.__extends(LoadedCheerio2, _super);
            function LoadedCheerio2() {
              return _super !== null && _super.apply(this, arguments) || this;
            }
            return LoadedCheerio2;
          })(cheerio_1.Cheerio)
        );
        function initialize(selector2, context, r2, opts) {
          if (r2 === void 0) {
            r2 = root2;
          }
          return new LoadedCheerio(selector2, context, r2, tslib_1.__assign(tslib_1.__assign({}, internalOpts), options_1.flatten(opts)));
        }
        Object.assign(initialize, staticMethods, {
          load: load$1,
          // `_root` and `_options` are used in static methods.
          _root: root2,
          _options: internalOpts,
          // Add `fn` for plugins
          fn: LoadedCheerio.prototype,
          // Add the prototype here to maintain `instanceof` behavior.
          prototype: LoadedCheerio.prototype
        });
        return initialize;
      }
      load.load = load$1;
      return load;
    }
    var hasRequiredLib;
    function requireLib() {
      if (hasRequiredLib) return lib$b;
      hasRequiredLib = 1;
      (function(exports2) {
        Object.defineProperty(exports2, "__esModule", { value: true });
        exports2.root = exports2.parseHTML = exports2.merge = exports2.contains = void 0;
        var tslib_1 = require$$0$2;
        tslib_1.__exportStar(requireTypes(), exports2);
        tslib_1.__exportStar(requireLoad(), exports2);
        var load_1 = requireLoad();
        exports2.default = load_1.load([]);
        var staticMethods = tslib_1.__importStar(require_static());
        exports2.contains = staticMethods.contains;
        exports2.merge = staticMethods.merge;
        exports2.parseHTML = staticMethods.parseHTML;
        exports2.root = staticMethods.root;
      })(lib$b);
      return lib$b;
    }
    var utils = {};
    var lexer = { exports: {} };
    var debug = { exports: {} };
    var hasRequiredDebug;
    function requireDebug() {
      if (hasRequiredDebug) return debug.exports;
      hasRequiredDebug = 1;
      (function(module2, exports2) {
        module2.exports = debug2;
        function debug2(label2) {
          return _debug.bind(null, label2);
        }
        function _debug(label2) {
          var args2 = [].slice.call(arguments, 1);
          args2.unshift("[" + label2 + "]");
          process.stderr.write(args2.join(" ") + "\n");
        }
      })(debug);
      return debug.exports;
    }
    var hasRequiredLexer;
    function requireLexer() {
      if (hasRequiredLexer) return lexer.exports;
      hasRequiredLexer = 1;
      (function(module2, exports2) {
        requireDebug()("lex");
        module2.exports = lex2;
        function lex2(css2) {
          var buffer2 = "";
          var ch3;
          var column2 = 0;
          var cursor = -1;
          var depth = 0;
          var line2 = 1;
          var state = "before-selector";
          var stack2 = [state];
          var token2 = {};
          var tokens = [];
          var atRules = [
            "media",
            "keyframes",
            { name: "-webkit-keyframes", type: "keyframes", prefix: "-webkit-" },
            { name: "-moz-keyframes", type: "keyframes", prefix: "-moz-" },
            { name: "-ms-keyframes", type: "keyframes", prefix: "-ms-" },
            { name: "-o-keyframes", type: "keyframes", prefix: "-o-" },
            "font-face",
            { name: "import", state: "before-at-value" },
            { name: "charset", state: "before-at-value" },
            "supports",
            "viewport",
            { name: "namespace", state: "before-at-value" },
            "document",
            { name: "-moz-document", type: "document", prefix: "-moz-" },
            "page"
          ];
          function getCh() {
            skip();
            return css2[cursor];
          }
          function getState2(index) {
            return index ? stack2[stack2.length - 1 - index] : state;
          }
          function isNextString(str2) {
            var start2 = cursor + 1;
            return str2 === css2.slice(start2, start2 + str2.length);
          }
          function find2(str2) {
            var pos3 = css2.slice(cursor).indexOf(str2);
            return pos3 > 0 ? pos3 : false;
          }
          function isNextChar(ch4) {
            return ch4 === peek2(1);
          }
          function peek2(offset2) {
            return css2[cursor + (offset2 || 1)];
          }
          function popState() {
            var removed = stack2.pop();
            state = stack2[stack2.length - 1];
            return removed;
          }
          function pushState(newState) {
            state = newState;
            stack2.push(state);
            return stack2.length;
          }
          function replaceState(newState) {
            var previousState = state;
            stack2[stack2.length - 1] = state = newState;
            return previousState;
          }
          function skip(n) {
            if ((n || 1) == 1) {
              if (css2[cursor] == "\n") {
                line2++;
                column2 = 1;
              } else {
                column2++;
              }
              cursor++;
            } else {
              var skipStr = css2.slice(cursor, cursor + n).split("\n");
              if (skipStr.length > 1) {
                line2 += skipStr.length - 1;
                column2 = 1;
              }
              column2 += skipStr[skipStr.length - 1].length;
              cursor = cursor + n;
            }
          }
          function addToken() {
            token2.end = {
              line: line2,
              col: column2
            };
            tokens.push(token2);
            buffer2 = "";
            token2 = {};
          }
          function initializeToken(type) {
            token2 = {
              type,
              start: {
                line: line2,
                col: column2
              }
            };
          }
          while (ch3 = getCh()) {
            switch (ch3) {
              // Space
              case " ":
                switch (getState2()) {
                  case "selector":
                  case "value":
                  case "value-paren":
                  case "at-group":
                  case "at-value":
                  case "comment":
                  case "double-string":
                  case "single-string":
                    buffer2 += ch3;
                    break;
                }
                break;
              // Newline or tab
              case "\n":
              case "	":
              case "\r":
              case "\f":
                switch (getState2()) {
                  case "value":
                  case "value-paren":
                  case "at-group":
                  case "comment":
                  case "single-string":
                  case "double-string":
                  case "selector":
                    buffer2 += ch3;
                    break;
                  case "at-value":
                    if ("\n" === ch3) {
                      token2.value = buffer2.trim();
                      addToken();
                      popState();
                    }
                    break;
                }
                break;
              case ":":
                switch (getState2()) {
                  case "name":
                    token2.name = buffer2.trim();
                    buffer2 = "";
                    replaceState("before-value");
                    break;
                  case "before-selector":
                    buffer2 += ch3;
                    initializeToken("selector");
                    pushState("selector");
                    break;
                  case "before-value":
                    replaceState("value");
                    buffer2 += ch3;
                    break;
                  default:
                    buffer2 += ch3;
                    break;
                }
                break;
              case ";":
                switch (getState2()) {
                  case "name":
                  case "before-value":
                  case "value":
                    if (buffer2.trim().length > 0) {
                      token2.value = buffer2.trim(), addToken();
                    }
                    replaceState("before-name");
                    break;
                  case "value-paren":
                    buffer2 += ch3;
                    break;
                  case "at-value":
                    token2.value = buffer2.trim();
                    addToken();
                    popState();
                    break;
                  case "before-name":
                    break;
                  default:
                    buffer2 += ch3;
                    break;
                }
                break;
              case "{":
                switch (getState2()) {
                  case "selector":
                    if (peek2(-1) === "\\") {
                      buffer2 += ch3;
                      break;
                    }
                    token2.text = buffer2.trim();
                    addToken();
                    replaceState("before-name");
                    depth = depth + 1;
                    break;
                  case "at-group":
                    token2.name = buffer2.trim();
                    switch (token2.type) {
                      case "font-face":
                      case "viewport":
                      case "page":
                        pushState("before-name");
                        break;
                      default:
                        pushState("before-selector");
                    }
                    addToken();
                    depth = depth + 1;
                    break;
                  case "name":
                  case "at-rule":
                    token2.name = buffer2.trim();
                    addToken();
                    pushState("before-name");
                    depth = depth + 1;
                    break;
                  case "comment":
                  case "double-string":
                  case "single-string":
                    buffer2 += ch3;
                    break;
                  case "before-value":
                    replaceState("value");
                    buffer2 += ch3;
                    break;
                }
                break;
              case "}":
                switch (getState2()) {
                  case "before-name":
                  case "name":
                  case "before-value":
                  case "value":
                    if (buffer2) {
                      token2.value = buffer2.trim();
                    }
                    if (token2.name && token2.value) {
                      addToken();
                    }
                    initializeToken("end");
                    addToken();
                    popState();
                    if ("at-group" === getState2()) {
                      initializeToken("at-group-end");
                      addToken();
                      popState();
                    }
                    if (depth > 0) {
                      depth = depth - 1;
                    }
                    break;
                  case "at-group":
                  case "before-selector":
                  case "selector":
                    if (peek2(-1) === "\\") {
                      buffer2 += ch3;
                      break;
                    }
                    if (depth > 0) {
                      if ("at-group" === getState2(1)) {
                        initializeToken("at-group-end");
                        addToken();
                      }
                    }
                    if (depth > 1) {
                      popState();
                    }
                    if (depth > 0) {
                      depth = depth - 1;
                    }
                    break;
                  case "double-string":
                  case "single-string":
                  case "comment":
                    buffer2 += ch3;
                    break;
                }
                break;
              // Strings
              case '"':
              case "'":
                switch (getState2()) {
                  case "double-string":
                    if ('"' === ch3 && "\\" !== peek2(-1)) {
                      popState();
                    }
                    break;
                  case "single-string":
                    if ("'" === ch3 && "\\" !== peek2(-1)) {
                      popState();
                    }
                    break;
                  case "before-at-value":
                    replaceState("at-value");
                    pushState('"' === ch3 ? "double-string" : "single-string");
                    break;
                  case "before-value":
                    replaceState("value");
                    pushState('"' === ch3 ? "double-string" : "single-string");
                    break;
                  case "comment":
                    break;
                  default:
                    if ("\\" !== peek2(-1)) {
                      pushState('"' === ch3 ? "double-string" : "single-string");
                    }
                }
                buffer2 += ch3;
                break;
              // Comments
              case "/":
                switch (getState2()) {
                  case "comment":
                  case "double-string":
                  case "single-string":
                    buffer2 += ch3;
                    break;
                  case "before-value":
                  case "selector":
                  case "name":
                  case "value":
                    if (isNextChar("*")) {
                      var pos2 = find2("*/");
                      if (pos2) {
                        skip(pos2 + 1);
                      }
                    } else {
                      if (getState2() == "before-value") replaceState("value");
                      buffer2 += ch3;
                    }
                    break;
                  default:
                    if (isNextChar("*")) {
                      initializeToken("comment");
                      pushState("comment");
                      skip();
                    } else {
                      buffer2 += ch3;
                    }
                    break;
                }
                break;
              // Comment end or universal selector
              case "*":
                switch (getState2()) {
                  case "comment":
                    if (isNextChar("/")) {
                      token2.text = buffer2;
                      skip();
                      addToken();
                      popState();
                    } else {
                      buffer2 += ch3;
                    }
                    break;
                  case "before-selector":
                    buffer2 += ch3;
                    initializeToken("selector");
                    pushState("selector");
                    break;
                  case "before-value":
                    replaceState("value");
                    buffer2 += ch3;
                    break;
                  default:
                    buffer2 += ch3;
                }
                break;
              // @-rules
              case "@":
                switch (getState2()) {
                  case "comment":
                  case "double-string":
                  case "single-string":
                    buffer2 += ch3;
                    break;
                  case "before-value":
                    replaceState("value");
                    buffer2 += ch3;
                    break;
                  default:
                    var tokenized = false;
                    var name2;
                    var rule;
                    for (var j = 0, len = atRules.length; !tokenized && j < len; ++j) {
                      rule = atRules[j];
                      name2 = rule.name || rule;
                      if (!isNextString(name2)) {
                        continue;
                      }
                      tokenized = true;
                      initializeToken(name2);
                      pushState(rule.state || "at-group");
                      skip(name2.length);
                      if (rule.prefix) {
                        token2.prefix = rule.prefix;
                      }
                      if (rule.type) {
                        token2.type = rule.type;
                      }
                    }
                    if (!tokenized) {
                      buffer2 += ch3;
                    }
                    break;
                }
                break;
              // Parentheses are tracked to disambiguate semi-colons, such as within a
              // data URI.
              case "(":
                switch (getState2()) {
                  case "value":
                    pushState("value-paren");
                    break;
                  case "before-value":
                    replaceState("value");
                    break;
                }
                buffer2 += ch3;
                break;
              case ")":
                switch (getState2()) {
                  case "value-paren":
                    popState();
                    break;
                  case "before-value":
                    replaceState("value");
                    break;
                }
                buffer2 += ch3;
                break;
              default:
                switch (getState2()) {
                  case "before-selector":
                    initializeToken("selector");
                    pushState("selector");
                    break;
                  case "before-name":
                    initializeToken("property");
                    replaceState("name");
                    break;
                  case "before-value":
                    replaceState("value");
                    break;
                  case "before-at-value":
                    replaceState("at-value");
                    break;
                }
                buffer2 += ch3;
                break;
            }
          }
          return tokens;
        }
      })(lexer);
      return lexer.exports;
    }
    var parser$2 = { exports: {} };
    var hasRequiredParser$1;
    function requireParser$1() {
      if (hasRequiredParser$1) return parser$2.exports;
      hasRequiredParser$1 = 1;
      (function(module2, exports2) {
        requireDebug()("parse");
        var lex2 = requireLexer();
        module2.exports = parse2;
        var _comments;
        var _depth;
        var _position;
        var _tokens;
        function parse2(css2, options2) {
          options2 || (options2 = {});
          _comments = !!options2.comments;
          _position = !!options2.position;
          _depth = 0;
          _tokens = Array.isArray(css2) ? css2.slice() : lex2(css2);
          var rule;
          var rules = [];
          var token2;
          while (token2 = next()) {
            rule = parseToken(token2);
            rule && rules.push(rule);
          }
          return {
            type: "stylesheet",
            stylesheet: {
              rules
            }
          };
        }
        function astNode(token2, override) {
          override || (override = {});
          var key2;
          var keys = ["type", "name", "value"];
          var node2 = {};
          for (var i2 = 0; i2 < keys.length; ++i2) {
            key2 = keys[i2];
            if (token2[key2]) {
              node2[key2] = override[key2] || token2[key2];
            }
          }
          keys = Object.keys(override);
          for (i2 = 0; i2 < keys.length; ++i2) {
            key2 = keys[i2];
            if (!node2[key2]) {
              node2[key2] = override[key2];
            }
          }
          if (_position) {
            node2.position = {
              start: token2.start,
              end: token2.end
            };
          }
          return node2;
        }
        function next() {
          var token2 = _tokens.shift();
          return token2;
        }
        function parseAtGroup(token2) {
          _depth = _depth + 1;
          var overrides = {};
          switch (token2.type) {
            case "font-face":
            case "viewport":
              overrides.declarations = parseDeclarations();
              break;
            case "page":
              overrides.prefix = token2.prefix;
              overrides.declarations = parseDeclarations();
              break;
            default:
              overrides.prefix = token2.prefix;
              overrides.rules = parseRules();
          }
          return astNode(token2, overrides);
        }
        function parseAtImport(token2) {
          return astNode(token2);
        }
        function parseCharset(token2) {
          return astNode(token2);
        }
        function parseComment(token2) {
          return astNode(token2, { text: token2.text });
        }
        function parseNamespace(token2) {
          return astNode(token2);
        }
        function parseProperty(token2) {
          return astNode(token2);
        }
        function parseSelector2(token2) {
          function trim(str2) {
            return str2.trim();
          }
          return astNode(token2, {
            type: "rule",
            selectors: token2.text.split(",").map(trim),
            declarations: parseDeclarations()
          });
        }
        function parseToken(token2) {
          switch (token2.type) {
            // Cases are listed in roughly descending order of probability.
            case "property":
              return parseProperty(token2);
            case "selector":
              return parseSelector2(token2);
            case "at-group-end":
              _depth = _depth - 1;
              return;
            case "media":
            case "keyframes":
              return parseAtGroup(token2);
            case "comment":
              if (_comments) {
                return parseComment(token2);
              }
              break;
            case "charset":
              return parseCharset(token2);
            case "import":
              return parseAtImport(token2);
            case "namespace":
              return parseNamespace(token2);
            case "font-face":
            case "supports":
            case "viewport":
            case "document":
            case "page":
              return parseAtGroup(token2);
          }
        }
        function parseTokensWhile(conditionFn) {
          var node2;
          var nodes = [];
          var token2;
          while ((token2 = next()) && (conditionFn && conditionFn(token2))) {
            node2 = parseToken(token2);
            node2 && nodes.push(node2);
          }
          if (token2 && token2.type !== "end") {
            _tokens.unshift(token2);
          }
          return nodes;
        }
        function parseDeclarations() {
          return parseTokensWhile(function(token2) {
            return token2.type === "property" || token2.type === "comment";
          });
        }
        function parseRules() {
          return parseTokensWhile(function() {
            return _depth;
          });
        }
      })(parser$2);
      return parser$2.exports;
    }
    var stringify = { exports: {} };
    var hasRequiredStringify;
    function requireStringify() {
      if (hasRequiredStringify) return stringify.exports;
      hasRequiredStringify = 1;
      (function(module2, exports2) {
        requireDebug()("stringify");
        var _comments;
        var _compress;
        var _indentation;
        var _level;
        var _n2;
        var _s;
        module2.exports = stringify2;
        function stringify2(ast2, options2) {
          options2 || (options2 = {});
          _indentation = options2.indentation || "";
          _compress = !!options2.compress;
          _comments = !!options2.comments;
          _level = 1;
          if (_compress) {
            _n2 = _s = "";
          } else {
            _n2 = "\n";
            _s = " ";
          }
          var css2 = reduce(ast2.stylesheet.rules, stringifyNode).join("\n").trim();
          return css2;
        }
        function indent(level) {
          if (level) {
            _level += level;
            return;
          }
          if (_compress) {
            return "";
          }
          return Array(_level).join(_indentation || "");
        }
        function stringifyAtRule(node2) {
          return "@" + node2.type + " " + node2.value + ";" + _n2;
        }
        function stringifyAtGroup(node2) {
          var label2 = "";
          var prefix = node2.prefix || "";
          if (node2.name) {
            label2 = " " + node2.name;
          }
          var chomp = node2.type !== "page";
          return "@" + prefix + node2.type + label2 + _s + stringifyBlock(node2, chomp) + _n2;
        }
        function stringifyComment(node2) {
          if (!_comments) {
            return "";
          }
          return "/*" + (node2.text || "") + "*/" + _n2;
        }
        function stringifyRule(node2) {
          var label2;
          if (node2.selectors) {
            label2 = node2.selectors.join("," + _n2);
          } else {
            label2 = "@" + node2.type;
            label2 += node2.name ? " " + node2.name : "";
          }
          return indent() + label2 + _s + stringifyBlock(node2) + _n2;
        }
        function reduce(items, fn2) {
          return items.reduce(function(results, item2) {
            var result2 = item2.type === "comment" ? stringifyComment(item2) : fn2(item2);
            result2 && results.push(result2);
            return results;
          }, []);
        }
        function stringifyBlock(node2, chomp) {
          var children2 = node2.declarations;
          var fn2 = stringifyDeclaration;
          if (node2.rules) {
            children2 = node2.rules;
            fn2 = stringifyRule;
          }
          children2 = stringifyChildren(children2, fn2);
          children2 && (children2 = _n2 + children2 + (chomp ? "" : _n2));
          return "{" + children2 + indent() + "}";
        }
        function stringifyChildren(children2, fn2) {
          if (!children2) {
            return "";
          }
          indent(1);
          var results = reduce(children2, fn2);
          indent(-1);
          if (!results.length) {
            return "";
          }
          return results.join(_n2);
        }
        function stringifyDeclaration(node2) {
          if (node2.type === "property") {
            return stringifyProperty(node2);
          }
        }
        function stringifyNode(node2) {
          switch (node2.type) {
            // Cases are listed in roughly descending order of probability.
            case "rule":
              return stringifyRule(node2);
            case "media":
            case "keyframes":
              return stringifyAtGroup(node2);
            case "comment":
              return stringifyComment(node2);
            case "import":
            case "charset":
            case "namespace":
              return stringifyAtRule(node2);
            case "font-face":
            case "supports":
            case "viewport":
            case "document":
            case "page":
              return stringifyAtGroup(node2);
          }
        }
        function stringifyProperty(node2) {
          var name2 = node2.name ? node2.name + ":" + _s : "";
          return indent() + name2 + node2.value + ";";
        }
      })(stringify);
      return stringify.exports;
    }
    var mensch;
    var hasRequiredMensch;
    function requireMensch() {
      if (hasRequiredMensch) return mensch;
      hasRequiredMensch = 1;
      mensch = {
        lex: requireLexer(),
        parse: requireParser$1(),
        stringify: requireStringify()
      };
      return mensch;
    }
    var selector = { exports: {} };
    var parser$1;
    var hasRequiredParser;
    function requireParser() {
      if (hasRequiredParser) return parser$1;
      hasRequiredParser = 1;
      var escapeRe = /([-.*+?^${}()|[\]\/\\])/g, unescapeRe = /\\/g;
      var escape2 = function(string2) {
        return (string2 + "").replace(escapeRe, "\\$1");
      };
      var unescape = function(string2) {
        return (string2 + "").replace(unescapeRe, "");
      };
      var slickRe = RegExp(
        /*
        #!/usr/bin/env ruby
        puts "\t\t" + DATA.read.gsub(/\(\?x\)|\s+#.*$|\s+|\\$|\\n/,'')
        __END__
            "(?x)^(?:\
              \\s* ( , ) \\s*               # Separator          \n\
            | \\s* ( <combinator>+ ) \\s*   # Combinator         \n\
            |      ( \\s+ )                 # CombinatorChildren \n\
            |      ( <unicode>+ | \\* )     # Tag                \n\
            | \\#  ( <unicode>+       )     # ID                 \n\
            | \\.  ( <unicode>+       )     # ClassName          \n\
            |                               # Attribute          \n\
            \\[  \
                \\s* (<unicode1>+)  (?:  \
                    \\s* ([*^$!~|]?=)  (?:  \
                        \\s* (?:\
                            ([\"']?)(.*?)\\9 \
                        )\
                    )  \
                )?  \\s*  \
            \\](?!\\]) \n\
            |   :+ ( <unicode>+ )(?:\
            \\( (?:\
                (?:([\"'])([^\\12]*)\\12)|((?:\\([^)]+\\)|[^()]*)+)\
            ) \\)\
            )?\
            )"
        */
        `^(?:\\s*(,)\\s*|\\s*(<combinator>+)\\s*|(\\s+)|(<unicode>+|\\*)|\\#(<unicode>+)|\\.(<unicode>+)|\\[\\s*(<unicode1>+)(?:\\s*([*^$!~|]?=)(?:\\s*(?:(["']?)(.*?)\\9)))?\\s*\\](?!\\])|(:+)(<unicode>+)(?:\\((?:(?:(["'])([^\\13]*)\\13)|((?:\\([^)]+\\)|[^()]*)+))\\))?)`.replace(/<combinator>/, "[" + escape2(">+~`!@$%^&={}\\;</") + "]").replace(/<unicode>/g, "(?:[\\w\\u00a1-\\uFFFF-]|\\\\[^\\s0-9a-f])").replace(/<unicode1>/g, "(?:[:\\w\\u00a1-\\uFFFF-]|\\\\[^\\s0-9a-f])")
      );
      var Part = function Part2(combinator) {
        this.combinator = combinator || " ";
        this.tag = "*";
      };
      Part.prototype.toString = function() {
        if (!this.raw) {
          var xpr = "", k2, part2;
          xpr += this.tag || "*";
          if (this.id) xpr += "#" + this.id;
          if (this.classes) xpr += "." + this.classList.join(".");
          if (this.attributes) for (k2 = 0; part2 = this.attributes[k2++]; ) {
            xpr += "[" + part2.name + (part2.operator ? part2.operator + '"' + part2.value + '"' : "") + "]";
          }
          if (this.pseudos) for (k2 = 0; part2 = this.pseudos[k2++]; ) {
            xpr += ":" + part2.name;
            if (part2.value) xpr += "(" + part2.value + ")";
          }
          this.raw = xpr;
        }
        return this.raw;
      };
      var Expression = function Expression2() {
        this.length = 0;
      };
      Expression.prototype.toString = function() {
        if (!this.raw) {
          var xpr = "";
          for (var j = 0, bit; bit = this[j++]; ) {
            if (j !== 1) xpr += " ";
            if (bit.combinator !== " ") xpr += bit.combinator + " ";
            xpr += bit;
          }
          this.raw = xpr;
        }
        return this.raw;
      };
      var replacer = function(rawMatch, separator2, combinator, combinatorChildren, tagName, id, className2, attributeKey, attributeOperator, attributeQuote, attributeValue, pseudoMarker, pseudoClass, pseudoQuote, pseudoClassQuotedValue, pseudoClassValue) {
        var expression, current2;
        if (separator2 || !this.length) {
          expression = this[this.length++] = new Expression();
          if (separator2) return "";
        }
        if (!expression) expression = this[this.length - 1];
        if (combinator || combinatorChildren || !expression.length) {
          current2 = expression[expression.length++] = new Part(combinator);
        }
        if (!current2) current2 = expression[expression.length - 1];
        if (tagName) {
          current2.tag = unescape(tagName);
        } else if (id) {
          current2.id = unescape(id);
        } else if (className2) {
          var unescaped = unescape(className2);
          var classes = current2.classes || (current2.classes = {});
          if (!classes[unescaped]) {
            classes[unescaped] = escape2(className2);
            var classList = current2.classList || (current2.classList = []);
            classList.push(unescaped);
            classList.sort();
          }
        } else if (pseudoClass) {
          pseudoClassValue = pseudoClassValue || pseudoClassQuotedValue;
          (current2.pseudos || (current2.pseudos = [])).push({
            type: pseudoMarker.length == 1 ? "class" : "element",
            name: unescape(pseudoClass),
            escapedName: escape2(pseudoClass),
            value: pseudoClassValue ? unescape(pseudoClassValue) : null,
            escapedValue: pseudoClassValue ? escape2(pseudoClassValue) : null
          });
        } else if (attributeKey) {
          attributeValue = attributeValue ? escape2(attributeValue) : null;
          (current2.attributes || (current2.attributes = [])).push({
            operator: attributeOperator,
            name: unescape(attributeKey),
            escapedName: escape2(attributeKey),
            value: attributeValue ? unescape(attributeValue) : null,
            escapedValue: attributeValue ? escape2(attributeValue) : null
          });
        }
        return "";
      };
      var Expressions = function Expressions2(expression) {
        this.length = 0;
        var self2 = this;
        var original = expression, replaced;
        while (expression) {
          replaced = expression.replace(slickRe, function() {
            return replacer.apply(self2, arguments);
          });
          if (replaced === expression) throw new Error(original + " is an invalid expression");
          expression = replaced;
        }
      };
      Expressions.prototype.toString = function() {
        if (!this.raw) {
          var expressions = [];
          for (var i2 = 0, expression; expression = this[i2++]; ) expressions.push(expression);
          this.raw = expressions.join(", ");
        }
        return this.raw;
      };
      var cache = {};
      var parse2 = function(expression) {
        if (expression == null) return null;
        expression = ("" + expression).replace(/^\s+|\s+$/g, "");
        return cache[expression] || (cache[expression] = new Expressions(expression));
      };
      parser$1 = parse2;
      return parser$1;
    }
    var hasRequiredSelector;
    function requireSelector() {
      if (hasRequiredSelector) return selector.exports;
      hasRequiredSelector = 1;
      (function(module2, exports2) {
        var parser2 = requireParser();
        module2.exports = Selector;
        function Selector(text2, styleAttribute) {
          this.text = text2;
          this.spec = void 0;
          this.styleAttribute = styleAttribute || false;
        }
        Selector.prototype.parsed = function() {
          if (!this.tokens) {
            this.tokens = parse2(this.text);
          }
          return this.tokens;
        };
        Selector.prototype.specificity = function() {
          var styleAttribute = this.styleAttribute;
          if (!this.spec) {
            this.spec = specificity(this.text, this.parsed());
          }
          return this.spec;
          function specificity(text2, parsed) {
            var expressions = parsed || parse2(text2);
            var spec = [styleAttribute ? 1 : 0, 0, 0, 0];
            var nots = [];
            for (var i2 = 0; i2 < expressions.length; i2++) {
              var expression = expressions[i2];
              var pseudos2 = expression.pseudos;
              if (expression.id) {
                spec[1]++;
              }
              if (expression.attributes) {
                spec[2] += expression.attributes.length;
              }
              if (expression.classList) {
                spec[2] += expression.classList.length;
              }
              if (expression.tag && expression.tag !== "*") {
                spec[3]++;
              }
              if (pseudos2) {
                spec[3] += pseudos2.length;
                for (var p = 0; p < pseudos2.length; p++) {
                  if (pseudos2[p].name === "not") {
                    nots.push(pseudos2[p].value);
                    spec[3]--;
                  }
                }
              }
            }
            for (var ii2 = nots.length; ii2--; ) {
              var not2 = specificity(nots[ii2]);
              for (var jj = 4; jj--; ) {
                spec[jj] += not2[jj];
              }
            }
            return spec;
          }
        };
        function parse2(text2) {
          try {
            return parser2(text2)[0];
          } catch (e) {
            return [];
          }
        }
      })(selector);
      return selector.exports;
    }
    var property = { exports: {} };
    var hasRequiredProperty;
    function requireProperty() {
      if (hasRequiredProperty) return property.exports;
      hasRequiredProperty = 1;
      (function(module2, exports2) {
        module2.exports = Property;
        var utils2 = requireUtils();
        function Property(prop2, value2, selector2, priority, additionalPriority) {
          this.prop = prop2;
          this.value = value2;
          this.selector = selector2;
          this.priority = priority || 0;
          this.additionalPriority = additionalPriority || [];
        }
        Property.prototype.compareFunc = function(property2) {
          var a = [];
          a.push.apply(a, this.selector.specificity());
          a.push.apply(a, this.additionalPriority);
          a[0] += this.priority;
          var b = [];
          b.push.apply(b, property2.selector.specificity());
          b.push.apply(b, property2.additionalPriority);
          b[0] += property2.priority;
          return utils2.compareFunc(a, b);
        };
        Property.prototype.compare = function(property2) {
          var winner = this.compareFunc(property2);
          if (winner === 1) {
            return this;
          }
          return property2;
        };
        Property.prototype.toString = function() {
          return this.prop + ": " + this.value.replace(/['"]+/g, "") + ";";
        };
      })(property);
      return property.exports;
    }
    var hasRequiredUtils;
    function requireUtils() {
      if (hasRequiredUtils) return utils;
      hasRequiredUtils = 1;
      (function(exports2) {
        var mensch2 = requireMensch();
        var Selector = requireSelector();
        var Property = requireProperty();
        exports2.Selector = Selector;
        exports2.Property = Property;
        exports2.extract = function extract(selectorText) {
          var attr = 0;
          var sels = [];
          var sel = "";
          for (var i2 = 0, l = selectorText.length; i2 < l; i2++) {
            var c2 = selectorText.charAt(i2);
            if (attr) {
              if ("]" === c2 || ")" === c2) {
                attr--;
              }
              sel += c2;
            } else {
              if ("," === c2) {
                sels.push(sel);
                sel = "";
              } else {
                if ("[" === c2 || "(" === c2) {
                  attr++;
                }
                if (sel.length || c2 !== "," && c2 !== "\n" && c2 !== " ") {
                  sel += c2;
                }
              }
            }
          }
          if (sel.length) {
            sels.push(sel);
          }
          return sels;
        };
        exports2.parseCSS = function(css2) {
          var parsed = mensch2.parse(css2, { position: true, comments: true });
          var rules = typeof parsed.stylesheet != "undefined" && parsed.stylesheet.rules ? parsed.stylesheet.rules : [];
          var ret = [];
          for (var i2 = 0, l = rules.length; i2 < l; i2++) {
            if (rules[i2].type == "rule") {
              var rule = rules[i2];
              var selectors = rule.selectors;
              for (var ii2 = 0, ll2 = selectors.length; ii2 < ll2; ii2++) {
                ret.push([selectors[ii2], rule.declarations]);
              }
            }
          }
          return ret;
        };
        exports2.getPreservedText = function(css2, options2, ignoredPseudos) {
          var parsed = mensch2.parse(css2, { position: true, comments: true });
          var rules = typeof parsed.stylesheet != "undefined" && parsed.stylesheet.rules ? parsed.stylesheet.rules : [];
          var preserved = [];
          for (var i2 = rules.length - 1; i2 >= 0; i2--) {
            if (options2.fontFaces && rules[i2].type === "font-face" || options2.mediaQueries && rules[i2].type === "media" || options2.keyFrames && rules[i2].type === "keyframes" || options2.pseudos && rules[i2].selectors && this.matchesPseudo(rules[i2].selectors[0], ignoredPseudos)) {
              preserved.unshift(
                mensch2.stringify(
                  { stylesheet: { rules: [rules[i2]] } },
                  { comments: false, indentation: "  " }
                )
              );
            }
            rules[i2].position.start;
          }
          if (preserved.length === 0) {
            return false;
          }
          return "\n" + preserved.join("\n") + "\n";
        };
        exports2.normalizeLineEndings = function(text2) {
          return text2.replace(/\r\n/g, "\n").replace(/\n/g, "\r\n");
        };
        exports2.matchesPseudo = function(needle, haystack) {
          return haystack.find(function(element) {
            return needle.indexOf(element) > -1;
          });
        };
        exports2.compareFunc = function(a, b) {
          var min2 = Math.min(a.length, b.length);
          for (var i2 = 0; i2 < min2; i2++) {
            if (a[i2] === b[i2]) {
              continue;
            }
            if (a[i2] > b[i2]) {
              return 1;
            }
            return -1;
          }
          return a.length - b.length;
        };
        exports2.compare = function(a, b) {
          return exports2.compareFunc(a, b) == 1 ? a : b;
        };
        exports2.getDefaultOptions = function(options2) {
          var result2 = Object.assign({
            extraCss: "",
            insertPreservedExtraCss: true,
            applyStyleTags: true,
            removeStyleTags: true,
            preserveMediaQueries: true,
            preserveFontFaces: true,
            preserveKeyFrames: true,
            preservePseudos: true,
            applyWidthAttributes: true,
            applyHeightAttributes: true,
            applyAttributesTableElements: true,
            url: ""
          }, options2);
          result2.webResources = result2.webResources || {};
          return result2;
        };
      })(utils);
      return utils;
    }
    var hasRequiredCheerio;
    function requireCheerio() {
      if (hasRequiredCheerio) return cheerio$1.exports;
      hasRequiredCheerio = 1;
      (function(module2) {
        var cheerio2 = requireLib();
        requireUtils();
        var cheerioLoad = function(html2, options2, encodeEntities) {
          options2 = Object.assign({ decodeEntities: false, _useHtmlParser2: true }, options2);
          html2 = encodeEntities(html2);
          return cheerio2.load(html2, options2);
        };
        var createEntityConverters = function() {
          var codeBlockLookup = [];
          var encodeCodeBlocks = function(html2) {
            var blocks = module2.exports.codeBlocks;
            Object.keys(blocks).forEach(function(key2) {
              var re2 = new RegExp(blocks[key2].start + "([\\S\\s]*?)" + blocks[key2].end, "g");
              html2 = html2.replace(re2, function(match, subMatch) {
                codeBlockLookup.push(match);
                return "JUICE_CODE_BLOCK_" + (codeBlockLookup.length - 1) + "_";
              });
            });
            return html2;
          };
          var decodeCodeBlocks = function(html2) {
            for (var index = 0; index < codeBlockLookup.length; index++) {
              var re2 = new RegExp("JUICE_CODE_BLOCK_" + index + '_(="")?', "gi");
              html2 = html2.replace(re2, function() {
                return codeBlockLookup[index];
              });
            }
            return html2;
          };
          return {
            encodeEntities: encodeCodeBlocks,
            decodeEntities: decodeCodeBlocks
          };
        };
        module2.exports = function(html2, options2, callback, callbackExtraArguments) {
          var entityConverters = createEntityConverters();
          var $2 = cheerioLoad(html2, options2, entityConverters.encodeEntities);
          var args2 = [$2];
          args2.push.apply(args2, callbackExtraArguments);
          var doc2 = callback.apply(void 0, args2) || $2;
          if (options2 && options2.xmlMode) {
            return entityConverters.decodeEntities(doc2.xml());
          }
          return entityConverters.decodeEntities(doc2.html());
        };
        module2.exports.codeBlocks = {
          EJS: { start: "<%", end: "%>" },
          HBS: { start: "{{", end: "}}" }
        };
      })(cheerio$1);
      return cheerio$1.exports;
    }
    var numbers = {};
    var hasRequiredNumbers;
    function requireNumbers() {
      if (hasRequiredNumbers) return numbers;
      hasRequiredNumbers = 1;
      numbers.romanize = function(num2) {
        if (isNaN(num2))
          return NaN;
        var digits = String(+num2).split(""), key2 = [
          "",
          "C",
          "CC",
          "CCC",
          "CD",
          "D",
          "DC",
          "DCC",
          "DCCC",
          "CM",
          "",
          "X",
          "XX",
          "XXX",
          "XL",
          "L",
          "LX",
          "LXX",
          "LXXX",
          "XC",
          "",
          "I",
          "II",
          "III",
          "IV",
          "V",
          "VI",
          "VII",
          "VIII",
          "IX"
        ], roman = "", i2 = 3;
        while (i2--)
          roman = (key2[+digits.pop() + i2 * 10] || "") + roman;
        return Array(+digits.join("") + 1).join("M") + roman;
      };
      numbers.alphanumeric = function(num2) {
        var s = "", t2;
        while (num2 > 0) {
          t2 = (num2 - 1) % 26;
          s = String.fromCharCode(65 + t2) + s;
          num2 = (num2 - t2) / 26 | 0;
        }
        return s || void 0;
      };
      return numbers;
    }
    var inline;
    var hasRequiredInline;
    function requireInline() {
      if (hasRequiredInline) return inline;
      hasRequiredInline = 1;
      var utils2 = requireUtils();
      var numbers2 = requireNumbers();
      inline = function makeJuiceClient(juiceClient) {
        juiceClient.ignoredPseudos = ["hover", "active", "focus", "visited", "link"];
        juiceClient.widthElements = ["TABLE", "TD", "TH", "IMG"];
        juiceClient.heightElements = ["TABLE", "TD", "TH", "IMG"];
        juiceClient.tableElements = ["TABLE", "TH", "TR", "TD", "CAPTION", "COLGROUP", "COL", "THEAD", "TBODY", "TFOOT"];
        juiceClient.nonVisualElements = ["HEAD", "TITLE", "BASE", "LINK", "STYLE", "META", "SCRIPT", "NOSCRIPT"];
        juiceClient.styleToAttribute = {
          "background-color": "bgcolor",
          "background-image": "background",
          "text-align": "align",
          "vertical-align": "valign"
        };
        juiceClient.excludedProperties = [];
        juiceClient.juiceDocument = juiceDocument;
        juiceClient.inlineDocument = inlineDocument;
        function inlineDocument($2, css2, options2) {
          options2 = options2 || {};
          var rules = utils2.parseCSS(css2);
          var editedElements = [];
          var styleAttributeName = "style";
          var counters = {};
          if (options2.styleAttributeName) {
            styleAttributeName = options2.styleAttributeName;
          }
          rules.forEach(handleRule);
          editedElements.forEach(setStyleAttrs);
          if (options2.inlinePseudoElements) {
            editedElements.forEach(inlinePseudoElements);
          }
          if (options2.applyWidthAttributes) {
            editedElements.forEach(function(el2) {
              setDimensionAttrs(el2, "width");
            });
          }
          if (options2.applyHeightAttributes) {
            editedElements.forEach(function(el2) {
              setDimensionAttrs(el2, "height");
            });
          }
          if (options2.applyAttributesTableElements) {
            editedElements.forEach(setAttributesOnTableElements);
          }
          if (options2.insertPreservedExtraCss && options2.extraCss) {
            var preservedText = utils2.getPreservedText(options2.extraCss, {
              mediaQueries: options2.preserveMediaQueries,
              fontFaces: options2.preserveFontFaces,
              keyFrames: options2.preserveKeyFrames
            });
            if (preservedText) {
              var $appendTo = null;
              if (options2.insertPreservedExtraCss !== true) {
                $appendTo = $2(options2.insertPreservedExtraCss);
              } else {
                $appendTo = $2("head");
                if (!$appendTo.length) {
                  $appendTo = $2("body");
                }
                if (!$appendTo.length) {
                  $appendTo = $2.root();
                }
              }
              $appendTo.first().append("<style>" + preservedText + "</style>");
            }
          }
          function handleRule(rule) {
            var sel = rule[0];
            var style2 = rule[1];
            var selector2 = new utils2.Selector(sel);
            var parsedSelector = selector2.parsed();
            if (!parsedSelector) {
              return;
            }
            var pseudoElementType = getPseudoElementType(parsedSelector);
            for (var i2 = 0; i2 < parsedSelector.length; ++i2) {
              var subSel = parsedSelector[i2];
              if (subSel.pseudos) {
                for (var j = 0; j < subSel.pseudos.length; ++j) {
                  var subSelPseudo = subSel.pseudos[j];
                  if (juiceClient.ignoredPseudos.indexOf(subSelPseudo.name) >= 0) {
                    return;
                  }
                }
              }
            }
            if (pseudoElementType) {
              var last = parsedSelector[parsedSelector.length - 1];
              var pseudos2 = last.pseudos;
              last.pseudos = filterElementPseudos(last.pseudos);
              sel = parsedSelector.toString();
              last.pseudos = pseudos2;
            }
            var els2;
            try {
              els2 = $2(sel);
            } catch (err2) {
              return;
            }
            els2.each(function() {
              var el2 = this;
              if (el2.name && juiceClient.nonVisualElements.indexOf(el2.name.toUpperCase()) >= 0) {
                return;
              }
              if (pseudoElementType) {
                var pseudoElPropName = "pseudo" + pseudoElementType;
                var pseudoEl = el2[pseudoElPropName];
                if (!pseudoEl) {
                  pseudoEl = el2[pseudoElPropName] = $2("<span />").get(0);
                  pseudoEl.pseudoElementType = pseudoElementType;
                  pseudoEl.pseudoElementParent = el2;
                  pseudoEl.counterProps = el2.counterProps;
                  el2[pseudoElPropName] = pseudoEl;
                }
                el2 = pseudoEl;
              }
              if (!el2.styleProps) {
                el2.styleProps = {};
                if ($2(el2).attr(styleAttributeName)) {
                  var cssText = "* { " + $2(el2).attr(styleAttributeName) + " } ";
                  addProps(utils2.parseCSS(cssText)[0][1], new utils2.Selector("<style>", true));
                }
                editedElements.push(el2);
              }
              if (!el2.counterProps) {
                el2.counterProps = el2.parent && el2.parent.counterProps ? Object.create(el2.parent.counterProps) : {};
              }
              function resetCounter(el3, value2) {
                var tokens = value2.split(/\s+/);
                for (var j2 = 0; j2 < tokens.length; j2++) {
                  var counter2 = tokens[j2];
                  var resetval = parseInt(tokens[j2 + 1], 10);
                  isNaN(resetval) ? el3.counterProps[counter2] = counters[counter2] = 0 : el3.counterProps[counter2] = counters[tokens[j2++]] = resetval;
                }
              }
              function incrementCounter(el3, value2) {
                var tokens = value2.split(/\s+/);
                for (var j2 = 0; j2 < tokens.length; j2++) {
                  var counter2 = tokens[j2];
                  if (el3.counterProps[counter2] === void 0) {
                    continue;
                  }
                  var incrval = parseInt(tokens[j2 + 1], 10);
                  isNaN(incrval) ? el3.counterProps[counter2] = counters[counter2] += 1 : el3.counterProps[counter2] = counters[tokens[j2++]] += incrval;
                }
              }
              function addProps(style3, selector3) {
                for (var i3 = 0, l = style3.length; i3 < l; i3++) {
                  if (style3[i3].type == "property") {
                    var name2 = style3[i3].name;
                    var value2 = style3[i3].value;
                    if (name2 === "counter-reset") {
                      resetCounter(el2, value2);
                    }
                    if (name2 === "counter-increment") {
                      incrementCounter(el2, value2);
                    }
                    var important = value2.match(/!important$/) !== null;
                    if (important && !options2.preserveImportant) value2 = removeImportant(value2);
                    var additionalPriority = [style3[i3].position.start.line, style3[i3].position.start.col];
                    var prop2 = new utils2.Property(name2, value2, selector3, important ? 2 : 0, additionalPriority);
                    var existing = el2.styleProps[name2];
                    if (juiceClient.excludedProperties.indexOf(name2) < 0) {
                      if (existing && existing.compare(prop2) === prop2 || !existing) {
                        if (existing && existing.selector !== selector3) {
                          delete el2.styleProps[name2];
                        } else if (existing) {
                          prop2.nextProp = existing;
                        }
                        el2.styleProps[name2] = prop2;
                      }
                    }
                  }
                }
              }
              addProps(style2, selector2);
            });
          }
          function setStyleAttrs(el2) {
            Object.keys(el2.styleProps).length;
            var props = [];
            Object.keys(el2.styleProps).forEach(function(key2) {
              var np = el2.styleProps[key2];
              while (typeof np !== "undefined") {
                props.push(np);
                np = np.nextProp;
              }
            });
            props.sort(function(a, b) {
              return a.compareFunc(b);
            });
            var string2 = props.filter(function(prop2) {
              return prop2.prop !== "content";
            }).map(function(prop2) {
              return prop2.prop + ": " + prop2.value.replace(/["]/g, "'") + ";";
            }).join(" ");
            if (string2) {
              $2(el2).attr(styleAttributeName, string2);
            }
          }
          function inlinePseudoElements(el2) {
            if (el2.pseudoElementType && el2.styleProps.content) {
              var parsed = parseContent(el2);
              if (parsed.img) {
                el2.name = "img";
                $2(el2).attr("src", parsed.img);
              } else {
                $2(el2).text(parsed);
              }
              var parent = el2.pseudoElementParent;
              if (el2.pseudoElementType === "before") {
                $2(parent).prepend(el2);
              } else {
                $2(parent).append(el2);
              }
            }
          }
          function setDimensionAttrs(el2, dimension) {
            if (!el2.name) {
              return;
            }
            var elName = el2.name.toUpperCase();
            if (juiceClient[dimension + "Elements"].indexOf(elName) > -1) {
              for (var i2 in el2.styleProps) {
                if (el2.styleProps[i2].prop === dimension) {
                  var value2 = el2.styleProps[i2].value;
                  if (options2.preserveImportant) {
                    value2 = removeImportant(value2);
                  }
                  if (value2.match(/px/)) {
                    var pxSize = value2.replace("px", "");
                    $2(el2).attr(dimension, pxSize);
                    return;
                  }
                  if (juiceClient.tableElements.indexOf(elName) > -1 && value2.match(/\%/)) {
                    $2(el2).attr(dimension, value2);
                    return;
                  }
                }
              }
            }
          }
          function extractBackgroundUrl(value2) {
            return value2.indexOf("url(") !== 0 ? value2 : value2.replace(/^url\((["'])?([^"']+)\1\)$/, "$2");
          }
          function setAttributesOnTableElements(el2) {
            if (!el2.name) {
              return;
            }
            var elName = el2.name.toUpperCase();
            var styleProps = Object.keys(juiceClient.styleToAttribute);
            if (juiceClient.tableElements.indexOf(elName) > -1) {
              for (var i2 in el2.styleProps) {
                if (styleProps.indexOf(el2.styleProps[i2].prop) > -1) {
                  var prop2 = juiceClient.styleToAttribute[el2.styleProps[i2].prop];
                  var value2 = el2.styleProps[i2].value;
                  if (options2.preserveImportant) {
                    value2 = removeImportant(value2);
                  }
                  if (prop2 === "background") {
                    value2 = extractBackgroundUrl(value2);
                  }
                  if (/(linear|radial)-gradient\(/i.test(value2)) {
                    continue;
                  }
                  $2(el2).attr(prop2, value2);
                }
              }
            }
          }
        }
        function removeImportant(value2) {
          return value2.replace(/\s*!important$/, "");
        }
        function findVariableValue(el2, variable) {
          while (el2) {
            if (variable in el2.styleProps) {
              return el2.styleProps[variable].value;
            }
            var el2 = el2.pseudoElementParent || el2.parent;
          }
        }
        function applyCounterStyle(counter2, style2) {
          switch (style2) {
            case "lower-roman":
              return numbers2.romanize(counter2).toLowerCase();
            case "upper-roman":
              return numbers2.romanize(counter2);
            case "lower-latin":
            case "lower-alpha":
              return numbers2.alphanumeric(counter2).toLowerCase();
            case "upper-latin":
            case "upper-alpha":
              return numbers2.alphanumeric(counter2);
            // TODO support more counter styles
            default:
              return counter2.toString();
          }
        }
        function parseContent(el2) {
          var content2 = el2.styleProps.content.value;
          if (content2 === "none" || content2 === "normal") {
            return "";
          }
          var imageUrlMatch = content2.match(/^\s*url\s*\(\s*(.*?)\s*\)\s*$/i);
          if (imageUrlMatch) {
            var url = imageUrlMatch[1].replace(/^['"]|['"]$/g, "");
            return { img: url };
          }
          var parsed = [];
          var tokens = content2.split(/['"]/);
          for (var i2 = 0; i2 < tokens.length; i2++) {
            if (tokens[i2] === "") continue;
            var varMatch = tokens[i2].match(/var\s*\(\s*(.*?)\s*(,\s*(.*?)\s*)?\s*\)/i);
            if (varMatch) {
              var variable = findVariableValue(el2, varMatch[1]) || varMatch[2];
              parsed.push(variable.replace(/^['"]|['"]$/g, ""));
              continue;
            }
            var counterMatch = tokens[i2].match(/counter\s*\(\s*(.*?)\s*(,\s*(.*?)\s*)?\s*\)/i);
            if (counterMatch && counterMatch[1] in el2.counterProps) {
              var counter2 = el2.counterProps[counterMatch[1]];
              parsed.push(applyCounterStyle(counter2, counterMatch[3]));
              continue;
            }
            var attrMatch = tokens[i2].match(/attr\s*\(\s*(.*?)\s*\)/i);
            if (attrMatch) {
              var attr = attrMatch[1];
              parsed.push(
                el2.pseudoElementParent ? el2.pseudoElementParent.attribs[attr] : el2.attribs[attr]
              );
              continue;
            }
            parsed.push(tokens[i2]);
          }
          content2 = parsed.join("");
          content2 = content2.replace(/\\/g, "");
          return content2;
        }
        function getPseudoElementType(selector2) {
          if (selector2.length === 0) {
            return;
          }
          var pseudos2 = selector2[selector2.length - 1].pseudos;
          if (!pseudos2) {
            return;
          }
          for (var i2 = 0; i2 < pseudos2.length; i2++) {
            if (isPseudoElementName(pseudos2[i2])) {
              return pseudos2[i2].name;
            }
          }
        }
        function isPseudoElementName(pseudo) {
          return pseudo.name === "before" || pseudo.name === "after";
        }
        function filterElementPseudos(pseudos2) {
          return pseudos2.filter(function(pseudo) {
            return !isPseudoElementName(pseudo);
          });
        }
        function juiceDocument($2, options2) {
          options2 = utils2.getDefaultOptions(options2);
          var css2 = extractCssFromDocument($2, options2);
          css2 += "\n" + options2.extraCss;
          inlineDocument($2, css2, options2);
          return $2;
        }
        function getStylesData($2, options2) {
          var results = [];
          var stylesList = $2("style");
          var styleDataList, styleData, styleElement;
          stylesList.each(function() {
            styleElement = this;
            var usingParse5 = !!styleElement.childNodes;
            styleDataList = usingParse5 ? styleElement.childNodes : styleElement.children;
            if (styleDataList.length !== 1) {
              if (options2.removeStyleTags) {
                $2(styleElement).remove();
              }
              return;
            }
            styleData = styleDataList[0].data;
            if (options2.applyStyleTags && $2(styleElement).attr("data-embed") === void 0) {
              results.push(styleData);
            }
            if (options2.removeStyleTags && $2(styleElement).attr("data-embed") === void 0) {
              var text2 = usingParse5 ? styleElement.childNodes[0].nodeValue : styleElement.children[0].data;
              var preservedText = utils2.getPreservedText(text2, {
                mediaQueries: options2.preserveMediaQueries,
                fontFaces: options2.preserveFontFaces,
                keyFrames: options2.preserveKeyFrames,
                pseudos: options2.preservePseudos
              }, juiceClient.ignoredPseudos);
              if (preservedText) {
                if (usingParse5) {
                  styleElement.childNodes[0].nodeValue = preservedText;
                } else {
                  styleElement.children[0].data = preservedText;
                }
              } else {
                $2(styleElement).remove();
              }
            }
            $2(styleElement).removeAttr("data-embed");
          });
          return results;
        }
        function extractCssFromDocument($2, options2) {
          var results = getStylesData($2, options2);
          var css2 = results.join("\n");
          return css2;
        }
        return juiceClient;
      };
      return inline;
    }
    var client;
    var hasRequiredClient;
    function requireClient() {
      if (hasRequiredClient) return client;
      hasRequiredClient = 1;
      var cheerio2 = requireCheerio();
      var makeJuiceClient = requireInline();
      var juiceClient = makeJuiceClient(function(html2, options2) {
        return cheerio2(html2, { xmlMode: options2 && options2.xmlMode }, juiceDocument, [options2]);
      });
      var juiceDocument = function(html2, options2) {
        return juiceClient.juiceDocument(html2, options2);
      };
      juiceClient.inlineContent = function(html2, css2, options2) {
        return cheerio2(html2, { xmlMode: options2 && options2.xmlMode }, juiceClient.inlineDocument, [css2, options2]);
      };
      client = juiceClient;
      return client;
    }
    var markdownItMathjax3;
    var hasRequiredMarkdownItMathjax3;
    function requireMarkdownItMathjax3() {
      if (hasRequiredMarkdownItMathjax3) return markdownItMathjax3;
      hasRequiredMarkdownItMathjax3 = 1;
      var __importDefault2 = markdownItMathjax3 && markdownItMathjax3.__importDefault || function(mod2) {
        return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
      };
      const mathjax_js_1 = requireMathjax();
      const tex_js_1 = requireTex$2();
      const svg_js_1 = requireSvg();
      const liteAdaptor_js_1 = requireLiteAdaptor();
      const html_js_1 = requireHtml$1();
      const AllPackages_js_1 = requireAllPackages();
      const assistive_mml_js_1 = requireAssistiveMml();
      const client_1 = __importDefault2(requireClient());
      function renderMath(content2, documentOptions, convertOptions) {
        const adaptor = (0, liteAdaptor_js_1.liteAdaptor)();
        const handler = (0, html_js_1.RegisterHTMLHandler)(adaptor);
        (0, assistive_mml_js_1.AssistiveMmlHandler)(handler);
        const mathDocument = mathjax_js_1.mathjax.document(content2, documentOptions);
        const html2 = adaptor.outerHTML(mathDocument.convert(content2, convertOptions));
        const stylesheet = adaptor.outerHTML(documentOptions.OutputJax.styleSheet(mathDocument));
        return (0, client_1.default)(html2 + stylesheet);
      }
      function isValidDelim(state, pos2) {
        let max2 = state.posMax, can_open = true, can_close = true;
        const prevChar = pos2 > 0 ? state.src.charCodeAt(pos2 - 1) : -1, nextChar = pos2 + 1 <= max2 ? state.src.charCodeAt(pos2 + 1) : -1;
        if (prevChar === 32 || prevChar === 9 || nextChar >= 48 && nextChar <= 57) {
          can_close = false;
        }
        if (nextChar === 32 || nextChar === 9) {
          can_open = false;
        }
        return {
          can_open,
          can_close
        };
      }
      function math_inline(state, silent) {
        if (state.src[state.pos] !== "$") {
          return false;
        }
        let res = isValidDelim(state, state.pos);
        if (!res.can_open) {
          if (!silent) {
            state.pending += "$";
          }
          state.pos += 1;
          return true;
        }
        const start2 = state.pos + 1;
        let match = start2;
        while ((match = state.src.indexOf("$", match)) !== -1) {
          let pos2 = match - 1;
          while (state.src[pos2] === "\\") {
            pos2 -= 1;
          }
          if ((match - pos2) % 2 == 1) {
            break;
          }
          match += 1;
        }
        if (match === -1) {
          if (!silent) {
            state.pending += "$";
          }
          state.pos = start2;
          return true;
        }
        if (match - start2 === 0) {
          if (!silent) {
            state.pending += "$$";
          }
          state.pos = start2 + 1;
          return true;
        }
        res = isValidDelim(state, match);
        if (!res.can_close) {
          if (!silent) {
            state.pending += "$";
          }
          state.pos = start2;
          return true;
        }
        if (!silent) {
          const token2 = state.push("math_inline", "math", 0);
          token2.markup = "$";
          token2.content = state.src.slice(start2, match);
        }
        state.pos = match + 1;
        return true;
      }
      function math_block(state, start2, end2, silent) {
        let next, lastPos;
        let found = false, pos2 = state.bMarks[start2] + state.tShift[start2], max2 = state.eMarks[start2], lastLine = "";
        if (pos2 + 2 > max2) {
          return false;
        }
        if (state.src.slice(pos2, pos2 + 2) !== "$$") {
          return false;
        }
        pos2 += 2;
        let firstLine = state.src.slice(pos2, max2);
        if (silent) {
          return true;
        }
        if (firstLine.trim().slice(-2) === "$$") {
          firstLine = firstLine.trim().slice(0, -2);
          found = true;
        }
        for (next = start2; !found; ) {
          next++;
          if (next >= end2) {
            break;
          }
          pos2 = state.bMarks[next] + state.tShift[next];
          max2 = state.eMarks[next];
          if (pos2 < max2 && state.tShift[next] < state.blkIndent) {
            break;
          }
          if (state.src.slice(pos2, max2).trim().slice(-2) === "$$") {
            lastPos = state.src.slice(0, max2).lastIndexOf("$$");
            lastLine = state.src.slice(pos2, lastPos);
            found = true;
          }
        }
        state.line = next + 1;
        const token2 = state.push("math_block", "math", 0);
        token2.block = true;
        token2.content = (firstLine && firstLine.trim() ? firstLine + "\n" : "") + state.getLines(start2 + 1, next, state.tShift[start2], true) + (lastLine && lastLine.trim() ? lastLine : "");
        token2.map = [start2, state.line];
        token2.markup = "$$";
        return true;
      }
      function plugin(md, options2) {
        const documentOptions = {
          InputJax: new tex_js_1.TeX(Object.assign({ packages: AllPackages_js_1.AllPackages }, options2 === null || options2 === void 0 ? void 0 : options2.tex)),
          OutputJax: new svg_js_1.SVG(Object.assign({ fontCache: "none" }, options2 === null || options2 === void 0 ? void 0 : options2.svg))
        };
        const convertOptions = {
          display: false
        };
        md.inline.ruler.after("escape", "math_inline", math_inline);
        md.block.ruler.after("blockquote", "math_block", math_block, {
          alt: ["paragraph", "reference", "blockquote", "list"]
        });
        md.renderer.rules.math_inline = function(tokens, idx) {
          convertOptions.display = false;
          return renderMath(tokens[idx].content, documentOptions, convertOptions);
        };
        md.renderer.rules.math_block = function(tokens, idx) {
          convertOptions.display = true;
          return renderMath(tokens[idx].content, documentOptions, convertOptions);
        };
      }
      plugin.default = plugin;
      markdownItMathjax3 = plugin;
      return markdownItMathjax3;
    }
    var markdownItMathjax3Exports = requireMarkdownItMathjax3();
    const markdownitMathjax3 = /* @__PURE__ */ getDefaultExportFromCjs(markdownItMathjax3Exports);
    const MarkdownDivComponent = reactExports.forwardRef(
      ({ markdown, omitMedia, style: style2, className: className2 }, ref) => {
        const cacheKey = `${markdown}:${omitMedia ? "1" : "0"}`;
        const cachedHtml = renderCache.get(cacheKey);
        const [renderedHtml, setRenderedHtml] = reactExports.useState(() => {
          if (cachedHtml) {
            return cachedHtml;
          }
          return markdown.replace(/\n/g, "<br/>");
        });
        reactExports.useEffect(() => {
          if (cachedHtml) {
            if (renderedHtml !== cachedHtml) {
              reactExports.startTransition(() => {
                setRenderedHtml(cachedHtml);
              });
            }
            return;
          }
          setRenderedHtml(markdown.replace(/\n/g, "<br/>"));
          const { promise, cancel } = renderQueue.enqueue(async () => {
            const protectedContent = protectBackslashesInLatex(markdown);
            const escaped = escapeHtmlCharacters(protectedContent);
            const preRendered = preRenderText(escaped);
            const protectedText = protectMarkdown(preRendered);
            const preparedForMarkdown = restoreBackslashesForLatex(protectedText);
            let html2 = preparedForMarkdown;
            try {
              const md = omitMedia ? mdInstanceNoMedia : mdInstance;
              html2 = md.render(preparedForMarkdown);
            } catch (ex) {
              console.log("Unable to markdown render content");
              console.error(ex);
            }
            const unescaped = unprotectMarkdown(html2);
            const withCode = unescapeCodeHtmlEntities(unescaped);
            const withSup = unescapeSupHtmlEntities(withCode);
            return withSup;
          });
          promise.then((result2) => {
            if (renderCache.size >= MAX_CACHE_SIZE) {
              const firstKey = renderCache.keys().next().value;
              if (firstKey) {
                renderCache.delete(firstKey);
              }
            }
            renderCache.set(cacheKey, result2);
            reactExports.startTransition(() => {
              setRenderedHtml(result2);
            });
          }).catch((error2) => {
            console.error("Markdown rendering error:", error2);
          });
          return () => {
            cancel();
          };
        }, [markdown, omitMedia, cachedHtml, renderedHtml, cacheKey]);
        return /* @__PURE__ */ jsxRuntimeExports.jsx(
          "div",
          {
            ref,
            dangerouslySetInnerHTML: { __html: renderedHtml },
            style: style2,
            className: clsx(className2, "markdown-content")
          }
        );
      }
    );
    const MarkdownDiv = reactExports.memo(MarkdownDivComponent);
    const renderCache = /* @__PURE__ */ new Map();
    const MAX_CACHE_SIZE = 500;
    const mdInstance = MarkdownIt({ breaks: true, html: true }).use(
      markdownitMathjax3
    );
    const mdInstanceNoMedia = MarkdownIt({ breaks: true, html: true }).use(markdownitMathjax3).disable(["image"]);
    class MarkdownRenderQueue {
      queue = [];
      activeCount = 0;
      maxConcurrent;
      constructor(maxConcurrent = 10) {
        this.maxConcurrent = maxConcurrent;
      }
      enqueue(task) {
        let cancelled2 = false;
        const promise = new Promise((resolve, reject) => {
          const wrappedTask = async () => {
            if (cancelled2) {
              return;
            }
            try {
              const result2 = await task();
              if (!cancelled2) {
                resolve(result2);
              }
            } catch (error2) {
              if (!cancelled2) {
                reject(error2);
              }
            }
          };
          const queueTask = {
            task: wrappedTask,
            cancelled: false
          };
          this.queue.push(queueTask);
          this.processQueue();
        });
        const cancel = () => {
          cancelled2 = true;
          const index = this.queue.findIndex((t2) => !t2.cancelled);
          if (index !== -1) {
            this.queue[index].cancelled = true;
          }
        };
        return { promise, cancel };
      }
      async processQueue() {
        if (this.activeCount >= this.maxConcurrent || this.queue.length === 0) {
          return;
        }
        let queueTask;
        while (this.queue.length > 0) {
          const task = this.queue.shift();
          if (task && !task.cancelled) {
            queueTask = task;
            break;
          }
        }
        if (!queueTask) {
          return;
        }
        this.activeCount++;
        try {
          await queueTask.task();
        } finally {
          this.activeCount--;
          this.processQueue();
        }
      }
    }
    const renderQueue = new MarkdownRenderQueue(10);
    const kLetterListPattern = /^([a-zA-Z][).]\s.*?)$/gm;
    const kCommonmarkReferenceLinkPattern = /\[([^\]]*)\]: (?!http)(.*)/g;
    const protectBackslashesInLatex = (content2) => {
      if (!content2) return content2;
      try {
        const inlineRegex = /\$(.*?)\$/g;
        const blockRegex = /\$\$([\s\S]*?)\$\$/g;
        let result2 = content2.replace(inlineRegex, (_match, latex) => {
          const protectedTex = latex.replace(/\\/g, "___LATEX_BACKSLASH___").replace(/</g, "___LATEX_LT___").replace(/>/g, "___LATEX_GT___").replace(/&/g, "___LATEX_AMP___").replace(/'/g, "___LATEX_APOS___").replace(/"/g, "___LATEX_QUOT___");
          return `$${protectedTex}$`;
        });
        result2 = result2.replace(blockRegex, (_match, latex) => {
          const protectedTex = latex.replace(/\\/g, "___LATEX_BACKSLASH___").replace(/</g, "___LATEX_LT___").replace(/>/g, "___LATEX_GT___").replace(/&/g, "___LATEX_AMP___").replace(/'/g, "___LATEX_APOS___").replace(/"/g, "___LATEX_QUOT___");
          return `$$${protectedTex}$$`;
        });
        return result2;
      } catch (error2) {
        console.error("Error protecting LaTeX content:", error2);
        return content2;
      }
    };
    const restoreBackslashesForLatex = (content2) => {
      if (!content2) {
        return content2;
      }
      try {
        let result2 = content2.replace(/___LATEX_BACKSLASH___/g, "\\").replace(/___LATEX_LT___/g, "<").replace(/___LATEX_GT___/g, ">").replace(/___LATEX_AMP___/g, "&").replace(/___LATEX_APOS___/g, "'").replace(/___LATEX_QUOT___/g, '"');
        result2 = fixDotsNotation(result2);
        return result2;
      } catch (error2) {
        console.error("Error restoring LaTeX content:", error2);
        return content2;
      }
    };
    const fixDotsNotation = (content2) => {
      if (!content2) return content2;
      try {
        let result2 = content2.replace(/(\$[^$]*?)\\dots([^$]*?\$)/g, "$1\\ldots$2");
        result2 = result2.replace(/(\$\$[^$]*?)\\dots([^$]*?\$\$)/g, "$1\\ldots$2");
        return result2;
      } catch (error2) {
        console.error("Error fixing dots notation:", error2);
        return content2;
      }
    };
    const escapeHtmlCharacters = (content2) => {
      if (!content2) return content2;
      return content2.replace(/[<>&'"]/g, (c2) => {
        switch (c2) {
          case "<":
            return "&lt;";
          case ">":
            return "&gt;";
          case "&":
            return "&amp;";
          case "'":
            return "&apos;";
          case '"':
            return "&quot;";
          default:
            throw new Error("Matched a value that isn't replaceable");
        }
      });
    };
    const preRenderText = (txt) => {
      if (!txt) return txt;
      txt = txt.replace(/^[\u200B\u200C\u200D\u200E\u200F\uFEFF]/, "");
      return txt.replaceAll(
        kLetterListPattern,
        "<p class='markdown-ordered-list-item'>$1</p>"
      );
    };
    const protectMarkdown = (txt) => {
      if (!txt) return txt;
      return txt.replaceAll(
        kCommonmarkReferenceLinkPattern,
        "(open:767A125E)$1(close:767A125E) $2 "
      );
    };
    const unprotectMarkdown = (txt) => {
      if (!txt) return txt;
      txt = txt.replaceAll("(open:767A125E)", "[");
      txt = txt.replaceAll("(close:767A125E)", "]");
      return txt;
    };
    function unescapeSupHtmlEntities(str2) {
      if (!str2) {
        return str2;
      }
      return str2.replace(/&lt;sup&gt;/g, "<sup>").replace(/&lt;\/sup&gt;/g, "</sup>");
    }
    function unescapeCodeHtmlEntities(str2) {
      if (!str2) return str2;
      const htmlEntities = {
        "&lt;": "<",
        "&gt;": ">",
        "&amp;": "&",
        "&#x5C;": "\\",
        "&quot;": '"'
      };
      return str2.replace(
        /(<code[^>]*>)([\s\S]*?)(<\/code>)/gi,
        (_match, starttag, content2, endtag) => {
          return starttag + content2.replace(
            /&(?:amp|lt|gt|quot|#39|#x2F|#x5C|#96);/g,
            (entity2) => htmlEntities[entity2] || entity2
          ) + endtag;
        }
      );
    }
    const content$7 = "_content_13ihw_1";
    const styles$1F = {
      content: content$7
    };
    const Preformatted = reactExports.forwardRef(
      ({ text: text2, style: style2, className: className2 }, ref) => {
        return /* @__PURE__ */ jsxRuntimeExports.jsx(
          "pre",
          {
            ref,
            className: clsx(styles$1F.content, "text-size-smaller", className2),
            style: style2,
            children: text2
          }
        );
      }
    );
    const RenderedText = reactExports.forwardRef(({ markdown, style: style2, className: className2, forceRender, omitMedia }, ref) => {
      const displayMode = useStore((state) => state.app.displayMode);
      if (forceRender || displayMode === "rendered") {
        return /* @__PURE__ */ jsxRuntimeExports.jsx(
          MarkdownDiv,
          {
            ref,
            markdown,
            style: style2,
            className: className2,
            omitMedia
          }
        );
      } else {
        return /* @__PURE__ */ jsxRuntimeExports.jsx(
          Preformatted,
          {
            ref,
            text: markdown,
            style: style2,
            className: className2
          }
        );
      }
    });
    const webSearch = "_webSearch_1376z_1";
    const query$1 = "_query_1376z_8";
    const styles$1E = {
      webSearch,
      query: query$1
    };
    const WebSearch = ({ query: query2 }) => {
      return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$1E.webSearch, "text-size-smaller"), children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: clsx("text-style-label", "text-style-secondary"), children: "Web Search:" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: clsx(styles$1E.query, "text-size-smallest"), children: query2 })
      ] });
    };
    const contentData = "_contentData_1sd1z_1";
    const styles$1D = {
      contentData
    };
    const result$1 = "_result_1mixg_12";
    const styles$1C = {
      result: result$1
    };
    const WebSearchResults = ({
      results
    }) => {
      return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          "div",
          {
            className: clsx(
              styles$1C.label,
              "text-style-label",
              "text-style-secondary",
              "text-size-smaller"
            ),
            children: "Results"
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsx("ol", { className: clsx(styles$1C.results, "text-size-smaller"), children: results.map((result2, index) => /* @__PURE__ */ jsxRuntimeExports.jsx(
          "li",
          {
            className: clsx(styles$1C.result, "text-style-secondary"),
            children: /* @__PURE__ */ jsxRuntimeExports.jsx(
              "a",
              {
                href: result2.url,
                target: "_blank",
                rel: "noopener noreferrer",
                title: result2.url + (result2.page_age ? `
(Age: ${result2.page_age})` : ""),
                children: result2.title
              }
            )
          },
          index
        )) })
      ] });
    };
    const ContentDataView = ({ id, contentData: contentData2 }) => {
      const renderableData = contentData2.data;
      const renderer = contentDataRenderers.find(
        (r2) => r2.canRender(renderableData)
      );
      if (!renderer) {
        const { encrypted_content, ...record } = renderableData;
        return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$1D.contentData), children: /* @__PURE__ */ jsxRuntimeExports.jsx(
          RecordTree,
          {
            id: `${id}-tree`,
            record,
            className: clsx(styles$1D.data),
            defaultExpandLevel: 0
          }
        ) });
      }
      return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$1D.contentData), children: renderer.render(renderableData) });
    };
    const webSearchServerToolRenderer = {
      name: "WebSearch",
      canRender: (data) => {
        return data.type === "server_tool_use" && data.name === "web_search";
      },
      render: (data) => {
        return /* @__PURE__ */ jsxRuntimeExports.jsx(WebSearch, { query: data.input.query });
      }
    };
    const webSearchResultsServerToolRenderer = {
      name: "WebSearchResults",
      canRender: (data) => {
        return data.type === "web_search_tool_result" && Array.isArray(data.content);
      },
      render: (data) => {
        const results = data.content;
        return /* @__PURE__ */ jsxRuntimeExports.jsx(WebSearchResults, { results });
      }
    };
    const serverToolRenderer = {
      name: "ServerTool",
      canRender: (data) => data.type === "server_tool_use",
      render: (data) => {
        return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "div",
            {
              className: clsx(
                "text-style-label",
                "text-style-secondary",
                "text-size-smaller"
              ),
              children: "Server Tool"
            }
          ),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            RecordTree,
            {
              id: data.name || "server-tool",
              record: data,
              className: clsx(styles$1D.data)
            }
          )
        ] });
      }
    };
    const contentDataRenderers = [
      webSearchServerToolRenderer,
      webSearchResultsServerToolRenderer,
      serverToolRenderer
    ];
    const isImage = (mimeType) => {
      return mimeType.startsWith("image/");
    };
    let vscodeApi;
    const getVscodeApi = () => {
      if (window.acquireVsCodeApi) {
        if (vscodeApi === void 0) {
          vscodeApi = window.acquireVsCodeApi();
        }
        return vscodeApi;
      } else {
        return void 0;
      }
    };
    const isVscode = () => {
      const bodyEl = document.querySelector("body");
      return bodyEl !== null && !!bodyEl.getAttributeNames().find((attr) => {
        return attr.includes("data-vscode-");
      });
    };
    const MAX_EVENTS_SIZE_BYTES = 350 * 1024 * 1024;
    function findEventsArrayStart(data) {
      const pattern = new TextEncoder().encode('"events"');
      for (let i2 = 0; i2 < data.length - pattern.length - 10; i2++) {
        let matches = true;
        for (let j = 0; j < pattern.length; j++) {
          if (data[i2 + j] !== pattern[j]) {
            matches = false;
            break;
          }
        }
        if (matches) {
          let pos2 = i2 + pattern.length;
          while (pos2 < data.length && (data[pos2] === 32 || data[pos2] === 9 || data[pos2] === 10 || data[pos2] === 13)) {
            pos2++;
          }
          if (pos2 < data.length && data[pos2] === 58) {
            pos2++;
            while (pos2 < data.length && (data[pos2] === 32 || data[pos2] === 9 || data[pos2] === 10 || data[pos2] === 13)) {
              pos2++;
            }
            if (pos2 < data.length && data[pos2] === 91) {
              return pos2;
            }
          }
        }
      }
      return -1;
    }
    function findArrayEnd(data, arrayStart) {
      let depth = 0;
      let inString = false;
      let escaped = false;
      for (let i2 = arrayStart; i2 < data.length; i2++) {
        const byte = data[i2];
        if (escaped) {
          escaped = false;
          continue;
        }
        if (byte === 92) {
          escaped = true;
          continue;
        }
        if (byte === 34) {
          inString = !inString;
          continue;
        }
        if (inString) {
          continue;
        }
        if (byte === 91 || byte === 123) {
          depth++;
        } else if (byte === 93 || byte === 125) {
          depth--;
          if (depth === 0 && byte === 93) {
            return i2;
          }
        }
      }
      return -1;
    }
    function clearLargeEventsArray(data) {
      if (data.length <= MAX_EVENTS_SIZE_BYTES) {
        return data;
      }
      const arrayStart = findEventsArrayStart(data);
      if (arrayStart === -1) {
        return data;
      }
      const arrayEnd = findArrayEnd(data, arrayStart);
      if (arrayEnd === -1) {
        return data;
      }
      const eventsSize = arrayEnd - arrayStart - 1;
      if (eventsSize <= MAX_EVENTS_SIZE_BYTES) {
        return data;
      }
      const before = data.slice(0, arrayStart + 1);
      const after = data.slice(arrayEnd);
      const result2 = new Uint8Array(before.length + after.length);
      let offset2 = 0;
      result2.set(before, offset2);
      offset2 += before.length;
      result2.set(after, offset2);
      return result2;
    }
    class AsyncQueue {
      constructor(concurrentLimit = 6) {
        this.concurrentLimit = concurrentLimit;
        this.queue = [];
        this.runningCount = 0;
      }
      // Max concurrency
      concurrentLimit;
      // The queue
      queue;
      // Count of currently running tasks
      runningCount;
      // Adds a task to the queue and runs it if the concurrency limit allows.
      async enqueue(task) {
        return new Promise((resolve, reject) => {
          this.queue.push(async () => {
            try {
              const result2 = await task();
              resolve(result2);
            } catch (error2) {
              reject(error2);
            } finally {
              this.runningCount--;
              this.runNext();
            }
          });
          if (this.runningCount < this.concurrentLimit) {
            this.runNext();
          }
        });
      }
      // Runs the next task in the queue if there are available slots for concurrent execution.
      runNext() {
        if (this.queue.length > 0 && this.runningCount < this.concurrentLimit) {
          const task = this.queue.shift();
          if (task) {
            this.runningCount++;
            task();
          }
        }
      }
    }
    var ch2 = {};
    var wk = (function(c2, id, msg, transfer, cb) {
      var w = new Worker(ch2[id] || (ch2[id] = URL.createObjectURL(new Blob([
        c2 + ';addEventListener("error",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'
      ], { type: "text/javascript" }))));
      w.onmessage = function(e) {
        var d = e.data, ed = d.$e$;
        if (ed) {
          var err2 = new Error(ed[0]);
          err2["code"] = ed[1];
          err2.stack = ed[2];
          cb(err2, null);
        } else
          cb(null, d);
      };
      w.postMessage(msg, transfer);
      return w;
    });
    var u8 = Uint8Array, u16 = Uint16Array, i32 = Int32Array;
    var fleb = new u8([
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      1,
      1,
      1,
      1,
      2,
      2,
      2,
      2,
      3,
      3,
      3,
      3,
      4,
      4,
      4,
      4,
      5,
      5,
      5,
      5,
      0,
      /* unused */
      0,
      0,
      /* impossible */
      0
    ]);
    var fdeb = new u8([
      0,
      0,
      0,
      0,
      1,
      1,
      2,
      2,
      3,
      3,
      4,
      4,
      5,
      5,
      6,
      6,
      7,
      7,
      8,
      8,
      9,
      9,
      10,
      10,
      11,
      11,
      12,
      12,
      13,
      13,
      /* unused */
      0,
      0
    ]);
    var clim = new u8([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]);
    var freb = function(eb, start2) {
      var b = new u16(31);
      for (var i2 = 0; i2 < 31; ++i2) {
        b[i2] = start2 += 1 << eb[i2 - 1];
      }
      var r2 = new i32(b[30]);
      for (var i2 = 1; i2 < 30; ++i2) {
        for (var j = b[i2]; j < b[i2 + 1]; ++j) {
          r2[j] = j - b[i2] << 5 | i2;
        }
      }
      return { b, r: r2 };
    };
    var _a$5 = freb(fleb, 2), fl = _a$5.b, revfl = _a$5.r;
    fl[28] = 258, revfl[258] = 28;
    var _b = freb(fdeb, 0), fd = _b.b;
    var rev = new u16(32768);
    for (var i$1 = 0; i$1 < 32768; ++i$1) {
      var x = (i$1 & 43690) >> 1 | (i$1 & 21845) << 1;
      x = (x & 52428) >> 2 | (x & 13107) << 2;
      x = (x & 61680) >> 4 | (x & 3855) << 4;
      rev[i$1] = ((x & 65280) >> 8 | (x & 255) << 8) >> 1;
    }
    var hMap = (function(cd, mb, r2) {
      var s = cd.length;
      var i2 = 0;
      var l = new u16(mb);
      for (; i2 < s; ++i2) {
        if (cd[i2])
          ++l[cd[i2] - 1];
      }
      var le2 = new u16(mb);
      for (i2 = 1; i2 < mb; ++i2) {
        le2[i2] = le2[i2 - 1] + l[i2 - 1] << 1;
      }
      var co;
      if (r2) {
        co = new u16(1 << mb);
        var rvb = 15 - mb;
        for (i2 = 0; i2 < s; ++i2) {
          if (cd[i2]) {
            var sv = i2 << 4 | cd[i2];
            var r_1 = mb - cd[i2];
            var v = le2[cd[i2] - 1]++ << r_1;
            for (var m = v | (1 << r_1) - 1; v <= m; ++v) {
              co[rev[v] >> rvb] = sv;
            }
          }
        }
      } else {
        co = new u16(s);
        for (i2 = 0; i2 < s; ++i2) {
          if (cd[i2]) {
            co[i2] = rev[le2[cd[i2] - 1]++] >> 15 - cd[i2];
          }
        }
      }
      return co;
    });
    var flt = new u8(288);
    for (var i$1 = 0; i$1 < 144; ++i$1)
      flt[i$1] = 8;
    for (var i$1 = 144; i$1 < 256; ++i$1)
      flt[i$1] = 9;
    for (var i$1 = 256; i$1 < 280; ++i$1)
      flt[i$1] = 7;
    for (var i$1 = 280; i$1 < 288; ++i$1)
      flt[i$1] = 8;
    var fdt = new u8(32);
    for (var i$1 = 0; i$1 < 32; ++i$1)
      fdt[i$1] = 5;
    var flrm = /* @__PURE__ */ hMap(flt, 9, 1);
    var fdrm = /* @__PURE__ */ hMap(fdt, 5, 1);
    var max$1 = function(a) {
      var m = a[0];
      for (var i2 = 1; i2 < a.length; ++i2) {
        if (a[i2] > m)
          m = a[i2];
      }
      return m;
    };
    var bits = function(d, p, m) {
      var o = p / 8 | 0;
      return (d[o] | d[o + 1] << 8) >> (p & 7) & m;
    };
    var bits16 = function(d, p) {
      var o = p / 8 | 0;
      return (d[o] | d[o + 1] << 8 | d[o + 2] << 16) >> (p & 7);
    };
    var shft = function(p) {
      return (p + 7) / 8 | 0;
    };
    var slc = function(v, s, e) {
      if (s == null || s < 0)
        s = 0;
      if (e == null || e > v.length)
        e = v.length;
      return new u8(v.subarray(s, e));
    };
    var ec = [
      "unexpected EOF",
      "invalid block type",
      "invalid length/literal",
      "invalid distance",
      "stream finished",
      "no stream handler",
      ,
      "no callback",
      "invalid UTF-8 data",
      "extra field too long",
      "date not in range 1980-2099",
      "filename too long",
      "stream finishing",
      "invalid zip data"
      // determined by unknown compression method
    ];
    var err = function(ind, msg, nt) {
      var e = new Error(msg || ec[ind]);
      e.code = ind;
      if (Error.captureStackTrace)
        Error.captureStackTrace(e, err);
      if (!nt)
        throw e;
      return e;
    };
    var inflt = function(dat, st, buf, dict) {
      var sl = dat.length, dl = dict ? dict.length : 0;
      if (!sl || st.f && !st.l)
        return buf || new u8(0);
      var noBuf = !buf;
      var resize = noBuf || st.i != 2;
      var noSt = st.i;
      if (noBuf)
        buf = new u8(sl * 3);
      var cbuf = function(l2) {
        var bl = buf.length;
        if (l2 > bl) {
          var nbuf = new u8(Math.max(bl * 2, l2));
          nbuf.set(buf);
          buf = nbuf;
        }
      };
      var final = st.f || 0, pos2 = st.p || 0, bt2 = st.b || 0, lm = st.l, dm = st.d, lbt = st.m, dbt = st.n;
      var tbts = sl * 8;
      do {
        if (!lm) {
          final = bits(dat, pos2, 1);
          var type = bits(dat, pos2 + 1, 3);
          pos2 += 3;
          if (!type) {
            var s = shft(pos2) + 4, l = dat[s - 4] | dat[s - 3] << 8, t2 = s + l;
            if (t2 > sl) {
              if (noSt)
                err(0);
              break;
            }
            if (resize)
              cbuf(bt2 + l);
            buf.set(dat.subarray(s, t2), bt2);
            st.b = bt2 += l, st.p = pos2 = t2 * 8, st.f = final;
            continue;
          } else if (type == 1)
            lm = flrm, dm = fdrm, lbt = 9, dbt = 5;
          else if (type == 2) {
            var hLit = bits(dat, pos2, 31) + 257, hcLen = bits(dat, pos2 + 10, 15) + 4;
            var tl = hLit + bits(dat, pos2 + 5, 31) + 1;
            pos2 += 14;
            var ldt = new u8(tl);
            var clt = new u8(19);
            for (var i2 = 0; i2 < hcLen; ++i2) {
              clt[clim[i2]] = bits(dat, pos2 + i2 * 3, 7);
            }
            pos2 += hcLen * 3;
            var clb = max$1(clt), clbmsk = (1 << clb) - 1;
            var clm = hMap(clt, clb, 1);
            for (var i2 = 0; i2 < tl; ) {
              var r2 = clm[bits(dat, pos2, clbmsk)];
              pos2 += r2 & 15;
              var s = r2 >> 4;
              if (s < 16) {
                ldt[i2++] = s;
              } else {
                var c2 = 0, n = 0;
                if (s == 16)
                  n = 3 + bits(dat, pos2, 3), pos2 += 2, c2 = ldt[i2 - 1];
                else if (s == 17)
                  n = 3 + bits(dat, pos2, 7), pos2 += 3;
                else if (s == 18)
                  n = 11 + bits(dat, pos2, 127), pos2 += 7;
                while (n--)
                  ldt[i2++] = c2;
              }
            }
            var lt2 = ldt.subarray(0, hLit), dt2 = ldt.subarray(hLit);
            lbt = max$1(lt2);
            dbt = max$1(dt2);
            lm = hMap(lt2, lbt, 1);
            dm = hMap(dt2, dbt, 1);
          } else
            err(1);
          if (pos2 > tbts) {
            if (noSt)
              err(0);
            break;
          }
        }
        if (resize)
          cbuf(bt2 + 131072);
        var lms = (1 << lbt) - 1, dms = (1 << dbt) - 1;
        var lpos = pos2;
        for (; ; lpos = pos2) {
          var c2 = lm[bits16(dat, pos2) & lms], sym = c2 >> 4;
          pos2 += c2 & 15;
          if (pos2 > tbts) {
            if (noSt)
              err(0);
            break;
          }
          if (!c2)
            err(2);
          if (sym < 256)
            buf[bt2++] = sym;
          else if (sym == 256) {
            lpos = pos2, lm = null;
            break;
          } else {
            var add2 = sym - 254;
            if (sym > 264) {
              var i2 = sym - 257, b = fleb[i2];
              add2 = bits(dat, pos2, (1 << b) - 1) + fl[i2];
              pos2 += b;
            }
            var d = dm[bits16(dat, pos2) & dms], dsym = d >> 4;
            if (!d)
              err(3);
            pos2 += d & 15;
            var dt2 = fd[dsym];
            if (dsym > 3) {
              var b = fdeb[dsym];
              dt2 += bits16(dat, pos2) & (1 << b) - 1, pos2 += b;
            }
            if (pos2 > tbts) {
              if (noSt)
                err(0);
              break;
            }
            if (resize)
              cbuf(bt2 + 131072);
            var end2 = bt2 + add2;
            if (bt2 < dt2) {
              var shift2 = dl - dt2, dend = Math.min(dt2, end2);
              if (shift2 + bt2 < 0)
                err(3);
              for (; bt2 < dend; ++bt2)
                buf[bt2] = dict[shift2 + bt2];
            }
            for (; bt2 < end2; ++bt2)
              buf[bt2] = buf[bt2 - dt2];
          }
        }
        st.l = lm, st.p = lpos, st.b = bt2, st.f = final;
        if (lm)
          final = 1, st.m = lbt, st.d = dm, st.n = dbt;
      } while (!final);
      return bt2 != buf.length && noBuf ? slc(buf, 0, bt2) : buf.subarray(0, bt2);
    };
    var et = /* @__PURE__ */ new u8(0);
    var mrg = function(a, b) {
      var o = {};
      for (var k2 in a)
        o[k2] = a[k2];
      for (var k2 in b)
        o[k2] = b[k2];
      return o;
    };
    var wcln = function(fn2, fnStr, td2) {
      var dt2 = fn2();
      var st = fn2.toString();
      var ks = st.slice(st.indexOf("[") + 1, st.lastIndexOf("]")).replace(/\s+/g, "").split(",");
      for (var i2 = 0; i2 < dt2.length; ++i2) {
        var v = dt2[i2], k2 = ks[i2];
        if (typeof v == "function") {
          fnStr += ";" + k2 + "=";
          var st_1 = v.toString();
          if (v.prototype) {
            if (st_1.indexOf("[native code]") != -1) {
              var spInd = st_1.indexOf(" ", 8) + 1;
              fnStr += st_1.slice(spInd, st_1.indexOf("(", spInd));
            } else {
              fnStr += st_1;
              for (var t2 in v.prototype)
                fnStr += ";" + k2 + ".prototype." + t2 + "=" + v.prototype[t2].toString();
            }
          } else
            fnStr += st_1;
        } else
          td2[k2] = v;
      }
      return fnStr;
    };
    var ch = [];
    var cbfs = function(v) {
      var tl = [];
      for (var k2 in v) {
        if (v[k2].buffer) {
          tl.push((v[k2] = new v[k2].constructor(v[k2])).buffer);
        }
      }
      return tl;
    };
    var wrkr = function(fns, init2, id, cb) {
      if (!ch[id]) {
        var fnStr = "", td_1 = {}, m = fns.length - 1;
        for (var i2 = 0; i2 < m; ++i2)
          fnStr = wcln(fns[i2], fnStr, td_1);
        ch[id] = { c: wcln(fns[m], fnStr, td_1), e: td_1 };
      }
      var td2 = mrg({}, ch[id].e);
      return wk(ch[id].c + ";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage=" + init2.toString() + "}", id, td2, cbfs(td2), cb);
    };
    var bInflt = function() {
      return [u8, u16, i32, fleb, fdeb, clim, fl, fd, flrm, fdrm, rev, ec, hMap, max$1, bits, bits16, shft, slc, err, inflt, inflateSync, pbf, gopt];
    };
    var guze = function() {
      return [gzs, gzl];
    };
    var zule = function() {
      return [zls];
    };
    var pbf = function(msg) {
      return postMessage(msg, [msg.buffer]);
    };
    var gopt = function(o) {
      return o && {
        out: o.size && new u8(o.size),
        dictionary: o.dictionary
      };
    };
    var cbify = function(dat, opts, fns, init2, id, cb) {
      var w = wrkr(fns, init2, id, function(err2, dat2) {
        w.terminate();
        cb(err2, dat2);
      });
      w.postMessage([dat, opts], opts.consume ? [dat.buffer] : []);
      return function() {
        w.terminate();
      };
    };
    var gzs = function(d) {
      if (d[0] != 31 || d[1] != 139 || d[2] != 8)
        err(6, "invalid gzip data");
      var flg = d[3];
      var st = 10;
      if (flg & 4)
        st += (d[10] | d[11] << 8) + 2;
      for (var zs = (flg >> 3 & 1) + (flg >> 4 & 1); zs > 0; zs -= !d[st++])
        ;
      return st + (flg & 2);
    };
    var gzl = function(d) {
      var l = d.length;
      return (d[l - 4] | d[l - 3] << 8 | d[l - 2] << 16 | d[l - 1] << 24) >>> 0;
    };
    var zls = function(d, dict) {
      if ((d[0] & 15) != 8 || d[0] >> 4 > 7 || (d[0] << 8 | d[1]) % 31)
        err(6, "invalid zlib data");
      if ((d[1] >> 5 & 1) == +!dict)
        err(6, "invalid zlib data: " + (d[1] & 32 ? "need" : "unexpected") + " dictionary");
      return (d[1] >> 3 & 4) + 2;
    };
    function inflate(data, opts, cb) {
      if (!cb)
        cb = opts, opts = {};
      if (typeof cb != "function")
        err(7);
      return cbify(data, opts, [
        bInflt
      ], function(ev) {
        return pbf(inflateSync(ev.data[0], gopt(ev.data[1])));
      }, 1, cb);
    }
    function inflateSync(data, opts) {
      return inflt(data, { i: 2 }, opts && opts.out, opts && opts.dictionary);
    }
    function gunzip(data, opts, cb) {
      if (!cb)
        cb = opts, opts = {};
      if (typeof cb != "function")
        err(7);
      return cbify(data, opts, [
        bInflt,
        guze,
        function() {
          return [gunzipSync];
        }
      ], function(ev) {
        return pbf(gunzipSync(ev.data[0], ev.data[1]));
      }, 3, cb);
    }
    function gunzipSync(data, opts) {
      var st = gzs(data);
      if (st + 8 > data.length)
        err(6, "invalid gzip data");
      return inflt(data.subarray(st, -8), { i: 2 }, opts && opts.out || new u8(gzl(data)), opts && opts.dictionary);
    }
    function unzlib(data, opts, cb) {
      if (!cb)
        cb = opts, opts = {};
      if (typeof cb != "function")
        err(7);
      return cbify(data, opts, [
        bInflt,
        zule,
        function() {
          return [unzlibSync];
        }
      ], function(ev) {
        return pbf(unzlibSync(ev.data[0], gopt(ev.data[1])));
      }, 5, cb);
    }
    function unzlibSync(data, opts) {
      return inflt(data.subarray(zls(data, opts && opts.dictionary), -4), { i: 2 }, opts && opts.out, opts && opts.dictionary);
    }
    function decompress(data, opts, cb) {
      if (!cb)
        cb = opts, opts = {};
      if (typeof cb != "function")
        err(7);
      return data[0] == 31 && data[1] == 139 && data[2] == 8 ? gunzip(data, opts, cb) : (data[0] & 15) != 8 || data[0] >> 4 > 7 || (data[0] << 8 | data[1]) % 31 ? inflate(data, opts, cb) : unzlib(data, opts, cb);
    }
    var td = typeof TextDecoder != "undefined" && /* @__PURE__ */ new TextDecoder();
    var tds = 0;
    try {
      td.decode(et, { stream: true });
      tds = 1;
    } catch (e) {
    }
    class FileSizeLimitError extends Error {
      file;
      maxBytes;
      constructor(file, maxBytes) {
        super(
          `File "${file}" exceeds the maximum size (${maxBytes} bytes) and cannot be loaded.`
        );
        this.name = "FileSizeLimitError";
        this.file = file;
        this.maxBytes = maxBytes;
        Object.setPrototypeOf(this, FileSizeLimitError.prototype);
      }
    }
    const openRemoteZipFile = async (url, fetchContentLength = fetchSize, fetchBytes = fetchRange) => {
      const contentLength = await fetchContentLength(url);
      const eocdrBuffer = await fetchBytes(
        url,
        contentLength - 22,
        contentLength - 1
      );
      const eocdrView = new DataView(eocdrBuffer.buffer);
      if (eocdrView.getUint32(0, true) !== 101010256) {
        if (eocdrBuffer.length !== 22) {
          throw new Error(
            "Unexpected central directory size - does the HTTP server serving this file support HTTP range requests?"
          );
        } else {
          throw new Error("End of central directory record not found");
        }
      }
      let centralDirOffset = eocdrView.getUint32(16, true);
      let centralDirSize = eocdrView.getUint32(12, true);
      const needsZip64 = centralDirOffset === 4294967295 || centralDirSize === 4294967295;
      if (needsZip64) {
        const locatorBuffer = await fetchBytes(
          url,
          contentLength - 22 - 20,
          contentLength - 23
        );
        const locatorView = new DataView(locatorBuffer.buffer);
        if (locatorView.getUint32(0, true) !== 117853008) {
          throw new Error("ZIP64 End of central directory locator not found");
        }
        const zip64EOCDOffset = Number(locatorView.getBigUint64(8, true));
        const zip64EOCDBuffer = await fetchBytes(
          url,
          zip64EOCDOffset,
          zip64EOCDOffset + 56
        );
        const zip64EOCDView = new DataView(zip64EOCDBuffer.buffer);
        if (zip64EOCDView.getUint32(0, true) !== 101075792) {
          throw new Error("ZIP64 End of central directory record not found");
        }
        centralDirSize = Number(zip64EOCDView.getBigUint64(40, true));
        centralDirOffset = Number(zip64EOCDView.getBigUint64(48, true));
      }
      const centralDirBuffer = await fetchBytes(
        url,
        centralDirOffset,
        centralDirOffset + centralDirSize - 1
      );
      const centralDirectory = parseCentralDirectory(centralDirBuffer);
      return {
        centralDirectory,
        readFile: async (file, maxBytes) => {
          const entry = centralDirectory.get(file);
          if (!entry) {
            throw new Error(`File not found: ${file}`);
          }
          const headerSize = 30;
          const headerData = await fetchBytes(
            url,
            entry.fileOffset,
            entry.fileOffset + headerSize - 1
          );
          const filenameLength = headerData[26] + (headerData[27] << 8);
          const extraFieldLength = headerData[28] + (headerData[29] << 8);
          const totalSizeToFetch = headerSize + filenameLength + extraFieldLength + entry.compressedSize;
          if (maxBytes && totalSizeToFetch > maxBytes) {
            throw new FileSizeLimitError(file, maxBytes);
          }
          const fileData = await fetchBytes(
            url,
            entry.fileOffset,
            entry.fileOffset + totalSizeToFetch - 1
          );
          const zipFileEntry = await parseZipFileEntry(file, fileData);
          if (zipFileEntry.compressionMethod === 0) {
            return zipFileEntry.data;
          } else if (zipFileEntry.compressionMethod === 8) {
            const results = await decompressAsync(zipFileEntry.data, {
              size: zipFileEntry.uncompressedSize
            });
            return results;
          } else {
            throw new Error(`Unsupported compression method for file ${file}`);
          }
        }
      };
    };
    const fetchSize = async (url) => {
      const acceptResponse = await fetch(url, { method: "HEAD" });
      const acceptsRanges = acceptResponse.headers.get("Accept-Ranges");
      if (acceptsRanges === "bytes") {
        const getResponse = await fetch(`${url}`, {
          method: "GET",
          headers: { Range: "bytes=0-0" }
        });
        const contentRange = getResponse.headers.get("Content-Range");
        if (contentRange !== null) {
          const rangeMatch = contentRange.match(/bytes (\d+)-(\d+)\/(\d+)/);
          if (rangeMatch !== null) {
            await getResponse.arrayBuffer();
            return Number(rangeMatch[3]);
          }
        }
        await getResponse.arrayBuffer();
      }
      const contentLength = acceptResponse.headers.get("Content-Length");
      if (contentLength !== null) {
        return Number(contentLength);
      }
      throw new Error(`Could not determine content length for ${url}`);
    };
    const fetchRange = async (url, start2, end2) => {
      const response = await fetch(`${url}`, {
        headers: { Range: `bytes=${start2}-${end2}` }
      });
      const arrayBuffer = await response.arrayBuffer();
      return new Uint8Array(arrayBuffer);
    };
    const decompressAsync = async (data, opts) => {
      return new Promise((resolve, reject) => {
        decompress(data, opts, (err2, result2) => {
          if (err2) {
            reject(err2);
          } else {
            resolve(result2);
          }
        });
      });
    };
    const parseZipFileEntry = async (file, rawData) => {
      const view = new DataView(rawData.buffer);
      let offset2 = 0;
      const signature = view.getUint32(offset2, true);
      if (signature !== 67324752) {
        throw new Error(`Invalid ZIP entry signature for ${file}`);
      }
      offset2 += 4;
      const versionNeeded = view.getUint16(offset2, true);
      offset2 += 2;
      const bitFlag = view.getUint16(offset2, true);
      offset2 += 2;
      const compressionMethod = view.getUint16(offset2, true);
      offset2 += 2;
      offset2 += 4;
      const crc32 = view.getUint32(offset2, true);
      offset2 += 4;
      let compressedSize = view.getUint32(offset2, true);
      offset2 += 4;
      let uncompressedSize = view.getUint32(offset2, true);
      offset2 += 4;
      const filenameLength = view.getUint16(offset2, true);
      offset2 += 2;
      const extraFieldLength = view.getUint16(offset2, true);
      offset2 += 2;
      const headerOffset = offset2;
      const needsZip64 = compressedSize === 4294967295 || uncompressedSize === 4294967295;
      if (needsZip64) {
        offset2 += filenameLength;
        const extraFieldEnd = offset2 + extraFieldLength;
        while (offset2 < extraFieldEnd) {
          const tag = view.getUint16(offset2, true);
          const size = view.getUint16(offset2 + 2, true);
          if (tag === 1) {
            let zip64Offset = offset2 + 4;
            if (uncompressedSize === 4294967295 && zip64Offset + 8 <= extraFieldEnd) {
              uncompressedSize = Number(view.getBigUint64(zip64Offset, true));
              zip64Offset += 8;
            }
            if (compressedSize === 4294967295 && zip64Offset + 8 <= extraFieldEnd) {
              compressedSize = Number(view.getBigUint64(zip64Offset, true));
            }
            break;
          }
          offset2 += 4 + size;
        }
        offset2 = headerOffset;
      }
      offset2 += filenameLength + extraFieldLength;
      const data = rawData.subarray(offset2, offset2 + compressedSize);
      return {
        versionNeeded,
        bitFlag,
        compressionMethod,
        crc32,
        compressedSize,
        uncompressedSize,
        filenameLength,
        extraFieldLength,
        data
      };
    };
    const kFileHeaderSize = 46;
    const parseCentralDirectory = (buffer2) => {
      let offset2 = 0;
      const view = new DataView(buffer2.buffer);
      const entries = /* @__PURE__ */ new Map();
      while (offset2 < buffer2.length) {
        if (view.getUint32(offset2, true) !== 33639248) break;
        const filenameLength = view.getUint16(offset2 + 28, true);
        const extraFieldLength = view.getUint16(offset2 + 30, true);
        const fileCommentLength = view.getUint16(offset2 + 32, true);
        let compressedSize = view.getUint32(offset2 + 20, true);
        let uncompressedSize = view.getUint32(offset2 + 24, true);
        let fileOffset = view.getUint32(offset2 + 42, true);
        const filename2 = new TextDecoder().decode(
          buffer2.subarray(
            offset2 + kFileHeaderSize,
            offset2 + kFileHeaderSize + filenameLength
          )
        );
        const needsZip64 = fileOffset === 4294967295 || compressedSize === 4294967295 || uncompressedSize === 4294967295;
        if (needsZip64) {
          let extraOffset = offset2 + kFileHeaderSize + filenameLength;
          const extraEnd = extraOffset + extraFieldLength;
          while (extraOffset < extraEnd) {
            const tag = view.getUint16(extraOffset, true);
            const size = view.getUint16(extraOffset + 2, true);
            if (tag === 1) {
              let zip64Offset = extraOffset + 4;
              if (uncompressedSize === 4294967295 && zip64Offset + 8 <= extraEnd) {
                uncompressedSize = Number(view.getBigUint64(zip64Offset, true));
                zip64Offset += 8;
              }
              if (compressedSize === 4294967295 && zip64Offset + 8 <= extraEnd) {
                compressedSize = Number(view.getBigUint64(zip64Offset, true));
                zip64Offset += 8;
              }
              if (fileOffset === 4294967295 && zip64Offset + 8 <= extraEnd) {
                fileOffset = Number(view.getBigUint64(zip64Offset, true));
              }
              break;
            }
            extraOffset += 4 + size;
          }
        }
        const entry = {
          filename: filename2,
          compressionMethod: view.getUint16(offset2 + 10, true),
          compressedSize,
          uncompressedSize,
          fileOffset
        };
        entries.set(filename2, entry);
        offset2 += kFileHeaderSize + filenameLength + extraFieldLength + fileCommentLength;
      }
      return entries;
    };
    const OPEN_RETRY_LIMIT = 5;
    class SampleNotFoundError extends Error {
      constructor(message2) {
        super(message2 || "Sample not found");
        this.name = "SampleNotFoundError";
        Object.setPrototypeOf(this, SampleNotFoundError.prototype);
      }
    }
    const openRemoteLogFile = async (api2, url, concurrency) => {
      const queue = new AsyncQueue(concurrency);
      let remoteZipFile = void 0;
      let retryCount = 0;
      while (!remoteZipFile && retryCount < OPEN_RETRY_LIMIT) {
        try {
          remoteZipFile = await openRemoteZipFile(
            url,
            api2.get_log_size,
            api2.get_log_bytes
          );
        } catch {
          retryCount++;
          console.warn(
            `Failed to open remote log file at ${url}, retrying (${retryCount}/${OPEN_RETRY_LIMIT})...`
          );
          await new Promise(
            (resolve) => setTimeout(resolve, 100 * (retryCount + retryCount))
          );
        }
      }
      if (!remoteZipFile) {
        throw new Error(
          `Failed to open remote log file at ${url} after ${OPEN_RETRY_LIMIT} attempts.`
        );
      }
      const readJSONFile = async (file, maxBytes, preprocessor2) => {
        try {
          let data = await remoteZipFile.readFile(file, maxBytes);
          if (preprocessor2) {
            data = preprocessor2.preprocess(data);
          }
          const textDecoder = new TextDecoder("utf-8");
          const jsonString = textDecoder.decode(data);
          if (data.length > 0 && jsonString.length === 0) {
            throw new Error(
              `Failed to decode ${file} (${(data.length / 1024 / 1024).toFixed(0)}MB). The file may be corrupted or contain invalid UTF-8 sequences.`
            );
          }
          return asyncJsonParse(jsonString);
        } catch (error2) {
          if (error2 instanceof FileSizeLimitError) {
            throw error2;
          } else if (error2 instanceof Error) {
            throw new Error(
              `Failed to read or parse file ${file}: ${error2.message}`
            );
          } else {
            throw new Error(
              `Failed to read or parse file ${file} - an unknown error occurred`
            );
          }
        }
      };
      const listSamples = async () => {
        return Array.from(remoteZipFile.centralDirectory.keys()).filter(
          (filename2) => filename2.startsWith("samples/") && filename2.endsWith(".json")
        ).map((filename2) => {
          const [sampleId, epochStr] = filename2.split("/")[1].split("_epoch_");
          return {
            sampleId,
            epoch: parseInt(epochStr.split(".")[0], 10)
          };
        });
      };
      const readSample = async (sampleId, epoch) => {
        const sampleFile = `samples/${sampleId}_epoch_${epoch}.json`;
        if (!remoteZipFile.centralDirectory.has(sampleFile)) {
          throw new SampleNotFoundError(
            `Unable to read sample file ${sampleFile} - it is not present in the manifest.`
          );
        }
        const eventsPreprocessor = {
          preprocess: clearLargeEventsArray
        };
        return await readJSONFile(
          sampleFile,
          void 0,
          eventsPreprocessor
        );
      };
      const readHeader = async () => {
        if (remoteZipFile.centralDirectory.has("header.json")) {
          return await readJSONFile("header.json");
        } else {
          const evalSpec = await readJSONFile("_journal/start.json");
          return {
            status: "started",
            eval: evalSpec.eval,
            plan: evalSpec.plan
          };
        }
      };
      const readEvalBasicInfo = async () => {
        const header2 = await readHeader();
        return toLogPreview(header2);
      };
      const readFallbackSummaries = async () => {
        const summaryFiles = Array.from(
          remoteZipFile.centralDirectory.keys()
        ).filter(
          (filename2) => filename2.startsWith("_journal/summaries/") && filename2.endsWith(".json")
        );
        const summaries = [];
        const errors2 = [];
        await Promise.all(
          summaryFiles.map(
            (filename2) => queue.enqueue(async () => {
              try {
                const partialSummary = await readJSONFile(
                  filename2
                );
                summaries.push(...partialSummary);
              } catch (error2) {
                errors2.push(error2);
              }
            })
          )
        );
        if (errors2.length > 0) {
          console.error(
            `Encountered ${errors2.length} errors while reading summary files:`,
            errors2
          );
        }
        return summaries;
      };
      const readSampleSummaries = async () => {
        if (remoteZipFile.centralDirectory.has("summaries.json")) {
          return await readJSONFile("summaries.json");
        } else {
          return readFallbackSummaries();
        }
      };
      return {
        readEvalBasicInfo,
        readLogSummary: async () => {
          const [header2, sampleSummaries] = await Promise.all([
            readHeader(),
            readSampleSummaries()
          ]);
          const result2 = {
            status: header2.status,
            eval: header2.eval,
            plan: header2.plan,
            results: header2.results,
            stats: header2.stats,
            error: header2.error,
            sampleSummaries
          };
          return result2;
        },
        readSample,
        /**
         * Reads the complete log file.
         */
        readCompleteLog: async () => {
          const [evalLog, samples] = await Promise.all([
            readHeader(),
            listSamples().then(
              (sampleIds) => Promise.all(
                sampleIds.map(
                  ({ sampleId, epoch }) => readSample(sampleId, epoch).then(
                    (sample2) => sample2
                  )
                )
              )
            )
          ]);
          return {
            status: evalLog.status,
            eval: evalLog.eval,
            plan: evalLog.plan,
            results: evalLog.results,
            stats: evalLog.stats,
            error: evalLog.error,
            samples
          };
        }
      };
    };
    const isEvalFile = (file) => {
      return file.endsWith(".eval");
    };
    class SampleSizeLimitedExceededError extends Error {
      id;
      epoch;
      maxBytes;
      displayStack;
      constructor(id, epoch, maxBytes) {
        super(
          `Sample ${id} in epoch ${epoch} exceeds the maximum supported size (${maxBytes / 1024 / 1024}MB) and cannot be loaded.`
        );
        this.name = "SampleSizeLimitedExceededError";
        this.id = id;
        this.epoch = epoch;
        this.maxBytes = maxBytes;
        this.displayStack = false;
        Object.setPrototypeOf(this, SampleSizeLimitedExceededError.prototype);
      }
    }
    const clientApi = (api2, log_file, debug2 = false) => {
      let current_log = void 0;
      let current_path = void 0;
      const loadedEvalFile = {
        file: void 0,
        remoteLog: void 0
      };
      const remoteEvalFile = async (log_file2, cached = false) => {
        if (cached && loadedEvalFile.file === log_file2) {
          return loadedEvalFile.remoteLog;
        }
        const remoteLog = await openRemoteLogFile(
          api2,
          encodePathParts(log_file2),
          5
        );
        if (cached) {
          loadedEvalFile.file = log_file2;
          loadedEvalFile.remoteLog = remoteLog;
        }
        return remoteLog;
      };
      const get_log = async (log_file2, cached = false) => {
        if (!cached || log_file2 !== current_path || !current_log) {
          if (pending_log_promise) {
            return pending_log_promise;
          }
          pending_log_promise = api2.get_log_contents(log_file2, 100).then((log2) => {
            current_log = log2;
            current_path = log_file2;
            pending_log_promise = null;
            return log2;
          }).catch((err2) => {
            pending_log_promise = null;
            throw err2;
          });
          return pending_log_promise;
        }
        return current_log;
      };
      let pending_log_promise = null;
      const get_log_details = async (log_file2) => {
        if (isEvalFile(log_file2)) {
          const remoteLogFile = await remoteEvalFile(log_file2);
          if (remoteLogFile) {
            return await remoteLogFile.readLogSummary();
          } else {
            throw new Error("Unable to read remote eval file");
          }
        } else {
          const logContents = await get_log(log_file2);
          const sampleSummaries = logContents.parsed.samples ? logContents.parsed.samples?.map((sample2) => {
            return {
              id: sample2.id,
              epoch: sample2.epoch,
              input: sample2.input,
              target: sample2.target,
              scores: sample2.scores,
              metadata: sample2.metadata,
              error: sample2.error?.message
            };
          }) : [];
          const parsed = logContents.parsed;
          return {
            version: parsed.version,
            status: parsed.status,
            eval: parsed.eval,
            plan: parsed.plan,
            results: parsed.results,
            stats: parsed.stats,
            error: parsed.error,
            sampleSummaries
          };
        }
      };
      const get_log_sample = async (log_file2, id, epoch) => {
        if (isEvalFile(log_file2)) {
          let handleError2 = function(error2) {
            if (error2 instanceof FileSizeLimitError) {
              throw new SampleSizeLimitedExceededError(id, epoch, error2.maxBytes);
            }
            throw error2;
          };
          async function fetchSample(useCache) {
            const remoteLogFile = await remoteEvalFile(log_file2, useCache);
            if (!remoteLogFile) {
              throw new Error(`Unable to read remote eval file ${log_file2}`);
            }
            return await remoteLogFile.readSample(String(id), epoch);
          }
          try {
            return await fetchSample(true);
          } catch (error2) {
            if (error2 instanceof SampleNotFoundError) {
              try {
                return await fetchSample(false);
              } catch (retryError) {
                handleError2(retryError);
              }
            } else {
              handleError2(error2);
            }
          }
        } else {
          const logContents = await get_log(log_file2, true);
          if (logContents.parsed.samples && logContents.parsed.samples.length > 0) {
            return logContents.parsed.samples.find((sample2) => {
              return sampleIdsEqual(sample2.id, id) && sample2.epoch === epoch;
            });
          }
        }
        return void 0;
      };
      const read_eval_file_log_summary = async (log_file2) => {
        if (api2.get_log_summary) {
          return api2.get_log_summary(log_file2);
        } else {
          const remoteLogFile = await openRemoteLogFile(
            api2,
            encodePathParts(log_file2),
            5
          );
          return remoteLogFile.readEvalBasicInfo();
        }
      };
      const get_log_summaries2 = async (log_files) => {
        const eval_files = {};
        const json_files = {};
        let index = 0;
        for (const file of log_files) {
          if (isEvalFile(file)) {
            eval_files[file] = index;
          } else {
            json_files[file] = index;
          }
          index++;
        }
        const evalLogHeadersPromises = Object.keys(eval_files).map(
          (file) => read_eval_file_log_summary(file).then((summary2) => ({
            index: eval_files[file],
            // Store original index
            summary: summary2
          }))
        );
        const jsonLogHeadersPromise = api2.get_log_summaries(Object.keys(json_files)).then(
          (summaries2) => summaries2.map((summary2, i2) => ({
            index: json_files[Object.keys(json_files)[i2]],
            // Store original index
            summary: summary2
          }))
        );
        const summaries = await Promise.all([
          ...evalLogHeadersPromises,
          jsonLogHeadersPromise
        ]);
        const orderedSummaries = summaries.flat().sort((a, b) => a.index - b.index);
        return orderedSummaries.map(({ summary: summary2 }) => summary2);
      };
      const get_log_dir2 = async () => {
        if (api2.get_log_dir) {
          return await api2.get_log_dir();
        } else {
          const logRoot = await api2.get_log_root();
          return logRoot?.log_dir;
        }
      };
      const get_logs2 = async (mtime, clientFileCount) => {
        if (api2.get_logs) {
          const result2 = await api2.get_logs(mtime, clientFileCount);
          return result2;
        } else {
          const logRoot = await api2.get_log_root();
          return {
            files: logRoot?.logs || [],
            response_type: "full"
          };
        }
      };
      const get_log_root2 = async () => {
        const logFiles = await api2.get_log_root();
        if (logFiles) {
          return logFiles;
        } else if (log_file) {
          const summary2 = await get_log_details(log_file);
          if (summary2) {
            return {
              logs: [
                {
                  name: log_file,
                  task: summary2.eval.task,
                  task_id: summary2.eval.task_id
                }
              ]
            };
          }
        }
        throw new Error("Unable to determine log paths.");
      };
      const get_log_pending_samples = (log_file2, etag) => {
        if (!api2.eval_pending_samples) {
          throw new Error("API doesn't support streamed samples");
        }
        return api2.eval_pending_samples(log_file2, etag);
      };
      const get_log_sample_data = (log_file2, id, epoch, last_event, last_attachment) => {
        if (!api2.eval_log_sample_data) {
          throw new Error("API doesn't supported streamed sample data");
        }
        return api2.eval_log_sample_data(
          log_file2,
          id,
          epoch,
          last_event,
          last_attachment
        );
      };
      const middleware = debug2 ? createMiddlewareWrapper([debugMiddleware]) : (_name, fn2) => fn2;
      return {
        client_events: middleware("client_events", () => {
          return api2.client_events();
        }),
        get_log_dir: middleware("get_log_dir", get_log_dir2),
        get_log_dir_handle: middleware(
          "get_log_dir_handle",
          (log_dir) => {
            return api2.get_log_dir_handle ? api2.get_log_dir_handle(log_dir) : log_dir || "default_log_dir";
          }
        ),
        get_logs: middleware("get_log_files", get_logs2),
        get_log_root: middleware("get_log_root", get_log_root2),
        get_eval_set: middleware("get_eval_set", (dir) => {
          return api2.get_eval_set(dir);
        }),
        get_flow: middleware("get_flow", (dir) => {
          return api2.get_flow(dir);
        }),
        get_log_summaries: middleware("get_log_summaries", get_log_summaries2),
        get_log_details: middleware("get_log_details", get_log_details),
        get_log_sample: middleware("get_log_sample", get_log_sample),
        open_log_file: middleware("open_log_file", (log_file2, log_dir) => {
          return api2.open_log_file(log_file2, log_dir);
        }),
        download_file: middleware(
          "download_file",
          (download_file2, file_contents) => {
            return api2.download_file(download_file2, file_contents);
          }
        ),
        download_log: api2.download_log ? middleware("download_log", (log_file2) => {
          return api2.download_log(log_file2);
        }) : void 0,
        log_message: middleware(
          "log_message",
          (log_file2, message2) => {
            return api2.log_message(log_file2, message2);
          }
        ),
        get_log_pending_samples: api2.eval_pending_samples ? middleware("get_log_pending_samples", get_log_pending_samples) : void 0,
        get_log_sample_data: api2.eval_log_sample_data ? middleware("get_log_sample_data", get_log_sample_data) : void 0
      };
    };
    const debugMiddleware = (name2, _fn, args2, result2) => {
      if (result2 instanceof Promise) {
        const startTime = performance.now();
        return result2.then((returned) => {
          const duration = performance.now() - startTime;
          console.log(`[ClientAPI] ${name2}`, {
            args: args2,
            returned,
            duration: `${duration.toFixed(2)}ms`
          });
          return returned;
        });
      } else {
        console.log(`[ClientAPI] ${name2}`, { args: args2, returned: result2 });
        return result2;
      }
    };
    const applyMiddleware = (name2, fn2, middlewares) => {
      if (middlewares.length === 0) return fn2;
      return ((...args2) => {
        let result2 = fn2(...args2);
        for (const middleware of middlewares) {
          result2 = middleware(name2, fn2, args2, result2);
        }
        return result2;
      });
    };
    const createMiddlewareWrapper = (middlewares) => {
      return (name2, fn2) => {
        return applyMiddleware(name2, fn2, middlewares);
      };
    };
    async function download_file$1(filename2, filecontents) {
      let blob;
      if (typeof filecontents === "string" && filecontents.startsWith("data:")) {
        const response = await fetch(filecontents);
        blob = await response.blob();
      } else {
        blob = new Blob([filecontents], { type: "text/plain" });
      }
      const link2 = document.createElement("a");
      link2.href = URL.createObjectURL(blob);
      link2.download = filename2;
      document.body.appendChild(link2);
      link2.click();
      document.body.removeChild(link2);
      URL.revokeObjectURL(link2.href);
    }
    async function fetchTextFile(url, handleError2) {
      const safe_url = encodePathParts(url);
      const response = await fetch(`${safe_url}`, { method: "GET" });
      if (response.ok) {
        const text2 = await response.text();
        return text2;
      } else if (response.status !== 200) {
        if (handleError2 && handleError2(response)) {
          return void 0;
        }
        const message2 = await response.text() || response.statusText;
        const error2 = new Error(`${response.status}: ${message2})`);
        throw error2;
      } else {
        throw new Error(`${response.status} - ${response.statusText} `);
      }
    }
    async function fetchFile(url, parse2, handleError2) {
      const safe_url = encodePathParts(url);
      const response = await fetch(`${safe_url}`, { method: "GET" });
      if (response.ok) {
        const text2 = await response.text();
        return await parse2(text2);
      } else if (response.status !== 200) {
        if (handleError2 && handleError2(response)) {
          return void 0;
        }
        const message2 = await response.text() || response.statusText;
        const error2 = new Error(`${response.status}: ${message2})`);
        throw error2;
      } else {
        throw new Error(`${response.status} - ${response.statusText} `);
      }
    }
    const fetchLogFile = async (file) => {
      return fetchFile(file, async (text2) => {
        const log2 = await asyncJsonParse(text2);
        if (log2.version === 1) {
          if (log2.results) {
            const untypedLog = log2;
            log2.results.scores = [];
            untypedLog.results.scorer.scorer = untypedLog.results.scorer.name;
            log2.results.scores.push(untypedLog.results.scorer);
            delete untypedLog.results.scorer;
            log2.results.scores[0].metrics = untypedLog.results.metrics;
            delete untypedLog.results.metrics;
            const scorerName = log2.results.scores[0].name;
            log2.samples?.forEach((sample2) => {
              const untypedSample = sample2;
              sample2.scores = { [scorerName]: untypedSample.score };
              delete untypedSample.score;
            });
          }
        }
        return {
          raw: text2,
          parsed: log2
        };
      });
    };
    const fetchManifest = async (log_dir) => {
      const logs = await fetchFile(
        log_dir + "/listing.json",
        async (text2) => {
          const parsed = await asyncJsonParse(text2);
          return {
            raw: text2,
            parsed
          };
        },
        (response) => {
          if (response.status === 404) {
            return true;
          } else {
            return false;
          }
        }
      );
      return logs;
    };
    const fetchJsonFile = async (file, handleError2) => {
      return fetchFile(
        file,
        async (text2) => {
          return await asyncJsonParse(text2);
        },
        handleError2
      );
    };
    function joinURI(...segments2) {
      return segments2.map((segment2) => segment2.replace(/(^\/+|\/+$)/g, "")).join("/");
    }
    function staticHttpApi(log_dir, log_file) {
      const resolved_log_dir = log_dir?.replace(" ", "+");
      log_file ? log_file.replace(" ", "+") : void 0;
      return staticHttpApiForLog({
        log_dir: resolved_log_dir
      });
    }
    function staticHttpApiForLog(logInfo) {
      const log_dir = logInfo.log_dir;
      let manifest = void 0;
      let manifestPromise = void 0;
      const getManifest = async () => {
        if (!manifest && log_dir) {
          if (!manifestPromise) {
            manifestPromise = fetchManifest(log_dir).then((manifestRaw) => {
              manifest = manifestRaw?.parsed || {};
              return manifest;
            });
          }
          await manifestPromise;
        }
        return manifest || {};
      };
      async function open_log_file2() {
      }
      return {
        client_events: async () => {
          return Promise.resolve([]);
        },
        get_log_root: async () => {
          if (log_dir) {
            const manifest2 = await getManifest();
            if (manifest2) {
              const logs = Object.keys(manifest2).map((key2) => {
                return {
                  name: joinURI(log_dir, key2),
                  task: manifest2[key2].task,
                  task_id: manifest2[key2].task_id
                };
              });
              return Promise.resolve({
                logs,
                log_dir
              });
            }
          }
          return void 0;
        },
        get_log_dir_handle: (log_dir2) => {
          const currentDirUrl = `${window.location.origin}${window.location.pathname.substring(0, window.location.pathname.lastIndexOf("/"))}`;
          return joinURI(currentDirUrl, log_dir2 || "default_log_dir");
        },
        get_eval_set: async (dir) => {
          const dirSegments = [];
          if (log_dir) {
            dirSegments.push(log_dir);
          }
          if (dir) {
            dirSegments.push(dir);
          }
          const result2 = await fetchJsonFile(
            joinURI(...dirSegments, "eval-set.json"),
            (response) => {
              if (400 <= response.status && response.status < 500) {
                return true;
              } else {
                return false;
              }
            }
          );
          console.log({ f: joinURI(...dirSegments, "eval-set.json"), result: result2 });
          return result2;
        },
        get_flow: async (dir) => {
          const dirSegments = [];
          if (log_dir) {
            dirSegments.push(log_dir);
          }
          if (dir) {
            dirSegments.push(dir);
          }
          return await fetchTextFile(
            joinURI(...dirSegments, "flow.yaml"),
            (response) => {
              if (400 <= response.status && response.status < 500) {
                return true;
              } else {
                return false;
              }
            }
          );
        },
        log_message: async (log_file, message2) => {
          console.log(`[CLIENT MESSAGE] (${log_file}): ${message2}`);
        },
        get_log_contents: async (log_file, _headerOnly, _capabilities) => {
          const response = await fetchLogFile(log_file);
          if (response) {
            return response;
          } else {
            throw new Error(`"Unable to load eval log ${log_file}`);
          }
        },
        get_log_size: async (log_file) => {
          return await fetchSize(log_file);
        },
        get_log_bytes: async (log_file, start2, end2) => {
          return await fetchRange(log_file, start2, end2);
        },
        get_log_summary: async (log_file) => {
          const manifest2 = await getManifest();
          if (manifest2) {
            const manifestAbs = {};
            Object.keys(manifest2).forEach((key2) => {
              manifestAbs[joinURI(log_dir || "", key2)] = manifest2[key2];
            });
            const header2 = manifestAbs[log_file];
            if (header2) {
              return header2;
            }
          }
          throw new Error(`Unable to load eval log header for ${log_file}`);
        },
        get_log_summaries: async (files) => {
          if (files.length === 0) {
            return [];
          }
          if (log_dir) {
            const manifest2 = await getManifest();
            if (manifest2) {
              const keys = Object.keys(manifest2);
              const result2 = [];
              files.forEach((file) => {
                const fileKey = keys.find((key2) => {
                  return file.endsWith(key2);
                });
                if (fileKey) {
                  result2.push(manifest2[fileKey]);
                }
              });
              return result2;
            }
          }
          throw new Error(
            `Failed to load a listing file using the directory: ${log_dir}. Please be sure you have deployed a manifest file (listing.json).`
          );
        },
        download_file: download_file$1,
        open_log_file: open_log_file2
      };
    }
    class ApiError extends Error {
      status;
      constructor(status2, message2) {
        super(message2);
        this.status = status2;
      }
    }
    function serverRequestApi(baseUrl2, getHeaders) {
      const apiUrl = baseUrl2;
      function buildApiUrl(path) {
        const base2 = apiUrl.endsWith("/") ? apiUrl.slice(0, -1) : apiUrl;
        const cleanPath = path.startsWith("/") ? path : `/${path}`;
        return base2 + cleanPath;
      }
      function isApiCrossOrigin() {
        try {
          return Boolean(
            apiUrl && new URL(apiUrl).origin !== window.location.origin
          );
        } catch (error2) {
          return false;
        }
      }
      const fetchType = async (method, path, request) => {
        const url = buildApiUrl(path);
        const responseHeaders = {
          Accept: "application/json",
          Pragma: "no-cache",
          Expires: "0",
          "Cache-Control": "no-cache",
          ...request.headers
        };
        if (getHeaders) {
          const globalHeaders = await getHeaders();
          Object.assign(responseHeaders, globalHeaders);
        }
        if (request.body) {
          responseHeaders["Content-Type"] = "application/json";
        }
        const response = await fetch(url, {
          method,
          headers: responseHeaders,
          body: request.body,
          credentials: isApiCrossOrigin() ? "include" : "same-origin"
        });
        if (!response.ok) {
          const errorResponse = request.handleError?.(response.status);
          if (errorResponse) {
            return {
              raw: response.statusText,
              parsed: errorResponse
            };
          }
          const message2 = await response.text() || response.statusText;
          throw new ApiError(
            response.status,
            `API Error ${response.status}: ${message2}`
          );
        }
        const text2 = await response.text();
        const parse2 = request.parse || asyncJsonParse;
        return {
          parsed: await parse2(text2),
          raw: text2
        };
      };
      const fetchString = async (method, path, headers, body2) => {
        const url = buildApiUrl(path);
        const requestHeaders = {
          Accept: "application/json",
          Pragma: "no-cache",
          Expires: "0",
          "Cache-Control": "no-cache",
          ...headers
        };
        if (getHeaders) {
          const globalHeaders = await getHeaders();
          Object.assign(requestHeaders, globalHeaders);
        }
        if (body2) {
          requestHeaders["Content-Type"] = "application/json";
        }
        const response = await fetch(url, {
          method,
          headers: requestHeaders,
          body: body2,
          credentials: isApiCrossOrigin() ? "include" : "same-origin"
        });
        if (response.ok) {
          const text2 = await response.text();
          return {
            parsed: await asyncJsonParse(text2),
            raw: text2
          };
        }
        const message2 = await response.text() || response.statusText;
        throw new ApiError(response.status, `HTTP ${response.status}: ${message2}`);
      };
      const fetchBytes = async (method, path) => {
        const url = buildApiUrl(path);
        const headers = {
          Accept: "application/octet-stream",
          Pragma: "no-cache",
          Expires: "0",
          "Cache-Control": "no-cache"
        };
        if (getHeaders) {
          const globalHeaders = await getHeaders();
          Object.assign(headers, globalHeaders);
        }
        const response = await fetch(url, {
          method,
          headers,
          credentials: isApiCrossOrigin() ? "include" : "same-origin"
        });
        if (!response.ok) {
          const message2 = await response.text() || response.statusText;
          throw new ApiError(
            response.status,
            `HTTP ${response.status}: ${message2}`
          );
        }
        const buffer2 = await response.arrayBuffer();
        return new Uint8Array(buffer2);
      };
      return {
        fetchString,
        fetchBytes,
        fetchType
      };
    }
    const LOADED_TIME = Date.now();
    let lastEvalTime = 0;
    function viewServerApi(options2 = {}) {
      const { apiBaseUrl, logDir: logDir2, headerProvider } = options2;
      const requestApi = serverRequestApi(
        apiBaseUrl || "/api",
        headerProvider
      );
      const client_events2 = async () => {
        const params = new URLSearchParams();
        params.append("loaded_time", String(LOADED_TIME.valueOf()));
        params.append("last_eval_time", String(lastEvalTime.valueOf()));
        const result2 = await requestApi.fetchString(
          "GET",
          `/events?${params.toString()}`
        );
        return result2.parsed;
      };
      const get_log_dir2 = async () => {
        if (logDir2) {
          return logDir2;
        }
        const obj = (await requestApi.fetchString("GET", "/log-dir")).parsed;
        return obj.log_dir;
      };
      const get_log_root2 = async () => {
        const path = logDir2 ? `/logs?log_dir=${encodeURIComponent(logDir2)}` : "/logs";
        const logs = await requestApi.fetchString("GET", path);
        lastEvalTime = Date.now();
        return logs.parsed;
      };
      const get_logs2 = async (mtime, clientFileCount) => {
        const path = logDir2 ? `/log-files?log_dir=${encodeURIComponent(logDir2)}` : "/log-files";
        const headers = {};
        const token2 = log_file_token(mtime, clientFileCount);
        if (token2) {
          headers["If-None-Match"] = token2;
        }
        lastEvalTime = Date.now();
        const envelope = await requestApi.fetchString("GET", path, headers);
        return envelope.parsed;
      };
      const log_file_token = (mtime, fileCount) => {
        return `W/"${mtime}-${fileCount}"`;
      };
      const get_eval_set2 = async (dir) => {
        const basePath = "/eval-set";
        const params = new URLSearchParams();
        if (logDir2) {
          params.append("log_dir", logDir2);
        }
        if (dir) {
          params.append("dir", dir);
        }
        const query2 = params.toString();
        const path = query2 ? `${basePath}?${query2}` : basePath;
        try {
          const result2 = await requestApi.fetchString("GET", path);
          return result2.parsed;
        } catch (error2) {
          if (error2 instanceof ApiError && (error2.status === 404 || error2.status === 403)) {
            return void 0;
          }
          throw error2;
        }
      };
      const get_flow2 = async (dir) => {
        const basePath = "/flow";
        const params = new URLSearchParams();
        if (logDir2) {
          params.append("log_dir", logDir2);
        }
        if (dir) {
          params.append("dir", dir);
        }
        const query2 = params.toString();
        const path = query2 ? `${basePath}?${query2}` : basePath;
        try {
          const bytes = await requestApi.fetchBytes("GET", path);
          return new TextDecoder().decode(bytes);
        } catch (error2) {
          if (error2 instanceof ApiError && (error2.status === 404 || error2.status === 403)) {
            return void 0;
          }
          throw error2;
        }
      };
      const get_log_contents2 = async (file, headerOnly, _capabilities) => {
        const result2 = await requestApi.fetchString(
          "GET",
          `/logs/${encodeURIComponent(file)}?header-only=${headerOnly}`
        );
        return result2;
      };
      const get_log_size2 = async (file) => {
        const result2 = await requestApi.fetchString(
          "GET",
          `/log-size/${encodeURIComponent(file)}`
        );
        return result2.parsed;
      };
      const toLogPreview2 = (header2) => {
        const scores2 = Object.values(header2.results?.scores || {});
        const metric = scores2.length > 0 ? scores2[0].metrics : void 0;
        const evalMetrics = Object.values(metric || {});
        const primary_metric = evalMetrics.length > 0 ? evalMetrics[0] : void 0;
        return {
          eval_id: header2.eval.eval_id,
          run_id: header2.eval.run_id,
          task: header2.eval.task,
          task_id: header2.eval.task_id,
          task_version: header2.eval.task_version,
          version: header2.version,
          status: header2.status,
          error: header2.error,
          model: header2.eval.model,
          started_at: header2.stats?.started_at,
          completed_at: header2.stats?.completed_at,
          primary_metric
        };
      };
      const get_log_bytes2 = async (file, start2, end2) => requestApi.fetchBytes(
        "GET",
        `/log-bytes/${encodeURIComponent(file)}?start=${start2}&end=${end2}`
      );
      const get_log_summaries2 = async (files) => {
        const params = new URLSearchParams();
        for (const file of files) {
          params.append("file", file);
        }
        const result2 = await requestApi.fetchString(
          "GET",
          `/log-headers?${params.toString()}`
        );
        const logHeaders = result2.parsed;
        return logHeaders.map(toLogPreview2);
      };
      const log_message2 = async (log_file, message2) => {
        const params = new URLSearchParams();
        params.append("log_file", log_file);
        params.append("message", message2);
        const request = {
          headers: {
            "Content-Type": "text/plain"
          },
          parse: async (text2) => {
            if (text2 !== "") {
              throw new Error(`Unexpected response from log_message: ${text2}`);
            }
            return;
          }
        };
        await requestApi.fetchType(
          "GET",
          `/log-message?${params.toString()}`,
          request
        );
      };
      const eval_pending_samples2 = async (log_file, etag) => {
        const params = new URLSearchParams();
        params.append("log", log_file);
        const headers = {};
        if (etag) {
          headers["If-None-Match"] = etag;
        }
        const request = {
          headers,
          parse: async (text2) => {
            const pendingSamples = await asyncJsonParse(
              text2
            );
            return {
              status: "OK",
              pendingSamples
            };
          },
          handleError: (status2) => {
            if (status2 === 404) {
              return {
                status: "NotFound"
              };
            } else if (status2 === 304) {
              return {
                status: "NotModified"
              };
            }
          }
        };
        const result2 = await requestApi.fetchType(
          "GET",
          `/pending-samples?${params.toString()}`,
          request
        );
        return result2.parsed;
      };
      const eval_log_sample_data2 = async (log_file, id, epoch, last_event, last_attachment) => {
        const params = new URLSearchParams();
        params.append("log", log_file);
        params.append("id", String(id));
        params.append("epoch", String(epoch));
        if (last_event !== void 0) {
          params.append("last-event-id", String(last_event));
        }
        if (last_attachment !== void 0) {
          params.append("after-attachment-id", String(last_attachment));
        }
        const request = {
          headers: {},
          parse: async (text2) => {
            const sampleData = await asyncJsonParse(text2);
            return {
              status: "OK",
              sampleData
            };
          },
          handleError: (status2) => {
            if (status2 === 404) {
              return {
                status: "NotFound"
              };
            } else if (status2 === 304) {
              return {
                status: "NotModified"
              };
            }
          }
        };
        const result2 = await requestApi.fetchType(
          "GET",
          `/pending-sample-data?${params.toString()}`,
          request
        );
        return result2.parsed;
      };
      const download_log = async (log_file) => {
        const baseUrl2 = apiBaseUrl || "/api";
        const url = `${baseUrl2}/log-download/${encodeURIComponent(log_file)}`;
        const link2 = document.createElement("a");
        link2.href = url;
        link2.download = "";
        document.body.appendChild(link2);
        link2.click();
        document.body.removeChild(link2);
      };
      return {
        client_events: client_events2,
        get_log_root: get_log_root2,
        get_logs: get_logs2,
        get_log_dir: get_log_dir2,
        get_eval_set: get_eval_set2,
        get_flow: get_flow2,
        get_log_contents: get_log_contents2,
        get_log_size: get_log_size2,
        get_log_bytes: get_log_bytes2,
        get_log_summaries: get_log_summaries2,
        log_message: log_message2,
        download_file: download_file$1,
        download_log,
        open_log_file: async () => {
        },
        eval_pending_samples: eval_pending_samples2,
        eval_log_sample_data: eval_log_sample_data2
      };
    }
    const kMethodEvalLogDir = "eval_log_dir";
    const kMethodEvalLogs = "eval_logs";
    const kMethodEvalLogFiles = "eval_log_files";
    const kMethodEvalLog = "eval_log";
    const kMethodEvalLogSize = "eval_log_size";
    const kMethodEvalLogBytes = "eval_log_bytes";
    const kMethodEvalLogHeaders = "eval_log_headers";
    const kMethodPendingSamples = "eval_log_pending_samples";
    const kMethodSampleData = "eval_log_sample_data";
    const kMethodLogMessage = "log_message";
    const kJsonRpcVersion = "2.0";
    function webViewJsonRpcClient(vscode2) {
      const target2 = {
        postMessage: (data) => {
          vscode2.postMessage(data);
        },
        onMessage: (handler) => {
          const onMessage = (ev) => {
            handler(ev.data);
          };
          window.addEventListener("message", onMessage);
          return () => {
            window.removeEventListener("message", onMessage);
          };
        }
      };
      return jsonRpcPostMessageRequestTransport(target2).request;
    }
    function jsonRpcPostMessageRequestTransport(target2) {
      const requests = /* @__PURE__ */ new Map();
      const disconnect = target2.onMessage((ev) => {
        const response = asJsonRpcResponse(ev);
        if (response) {
          const request = requests.get(response.id);
          if (request) {
            requests.delete(response.id);
            if (response.error) {
              request.reject(response.error);
            } else {
              request.resolve(response.result);
            }
          }
        }
      });
      return {
        request: (method, params) => {
          return new Promise((resolve, reject) => {
            const requestId = Math.floor(Math.random() * 1e6);
            requests.set(requestId, { resolve, reject });
            const request = {
              jsonrpc: kJsonRpcVersion,
              id: requestId,
              method,
              params
            };
            target2.postMessage(request);
          });
        },
        disconnect
      };
    }
    function isJsonRpcMessage(message2) {
      return message2.jsonrpc !== void 0 && message2.id !== void 0;
    }
    function asJsonRpcMessage(data) {
      if (isJsonRpcMessage(data) && data.jsonrpc === kJsonRpcVersion) {
        return data;
      }
      return null;
    }
    function asJsonRpcResponse(data) {
      const message2 = asJsonRpcMessage(data);
      if (message2) {
        return message2;
      }
      return null;
    }
    const kNotFoundSignal = "NotFound";
    const kNotModifiedSignal = "NotModified";
    const vscodeClient = webViewJsonRpcClient(getVscodeApi());
    async function client_events() {
      return [];
    }
    async function get_log_root() {
      const response = await vscodeClient(kMethodEvalLogs, []);
      if (response) {
        const parsed = lib$d.parse(response);
        if (Array.isArray(parsed)) {
          return {
            log_dir: "",
            files: parsed
          };
        } else {
          return parsed;
        }
      } else {
        return void 0;
      }
    }
    const get_log_dir = async () => {
      const response = await vscodeClient(kMethodEvalLogDir, []);
      if (response) {
        const parsed = lib$d.parse(response);
        return parsed.log_dir;
      }
      return void 0;
    };
    const get_logs = async (mtime, clientFileCount) => {
      const response = await vscodeClient(kMethodEvalLogFiles, [
        mtime,
        clientFileCount
      ]);
      if (response) {
        const parsed = lib$d.parse(response);
        return parsed;
      } else {
        return [];
      }
    };
    async function get_eval_set() {
      return void 0;
    }
    async function get_flow() {
      return void 0;
    }
    async function get_log_contents(log_file, headerOnly, capabilities2) {
      const response = await vscodeClient(kMethodEvalLog, [log_file, headerOnly]);
      if (response) {
        let json;
        if (capabilities2?.webWorkers) {
          json = await asyncJsonParse(response);
        } else {
          json = lib$d.parse(response);
        }
        return {
          parsed: json,
          raw: response
        };
      } else {
        throw new Error(`Unable to load eval log ${log_file}.`);
      }
    }
    async function get_log_size(log_file) {
      return await vscodeClient(kMethodEvalLogSize, [log_file]);
    }
    async function get_log_bytes(log_file, start2, end2) {
      return await vscodeClient(kMethodEvalLogBytes, [log_file, start2, end2]);
    }
    async function get_log_summaries(files) {
      const response = await vscodeClient(kMethodEvalLogHeaders, [files]);
      if (response) {
        return lib$d.parse(response);
      } else {
        return void 0;
      }
    }
    async function eval_pending_samples(log_file, etag) {
      const response = await vscodeClient(kMethodPendingSamples, [log_file, etag]);
      if (response) {
        if (response === kNotModifiedSignal) {
          return {
            status: "NotModified"
          };
        } else if (response === kNotFoundSignal) {
          return {
            status: "NotFound"
          };
        }
        const json = await asyncJsonParse(response);
        return {
          status: "OK",
          pendingSamples: json
        };
      } else {
        throw new Error(`Unable to load pending samples ${log_file}.`);
      }
    }
    async function eval_log_sample_data(log_file, id, epoch, last_event, last_attachment) {
      const response = await vscodeClient(kMethodSampleData, [
        log_file,
        id,
        epoch,
        last_event,
        last_attachment
      ]);
      if (response) {
        if (response === kNotModifiedSignal) {
          return {
            status: "NotModified"
          };
        } else if (response === kNotFoundSignal) {
          return {
            status: "NotFound"
          };
        }
        const json = await asyncJsonParse(response);
        return {
          status: "OK",
          sampleData: json
        };
      } else {
        throw new Error(`Unable to load live sample data ${log_file}.`);
      }
    }
    async function log_message(log_file, message2) {
      await vscodeClient(kMethodLogMessage, [log_file, message2]);
    }
    async function download_file() {
      throw Error("Downloading files is not supported in VS Code");
    }
    async function open_log_file(log_file, log_dir) {
      const msg = {
        type: "displayLogFile",
        url: log_file,
        log_dir
      };
      getVscodeApi()?.postMessage(msg);
    }
    const api$1 = {
      client_events,
      get_log_root,
      get_log_dir,
      get_logs,
      get_eval_set,
      get_flow,
      get_log_contents,
      get_log_size,
      get_log_bytes,
      get_log_summaries,
      log_message,
      download_file,
      open_log_file,
      eval_pending_samples,
      eval_log_sample_data
    };
    const resolveApi = () => {
      const debug2 = false;
      if (getVscodeApi()) {
        return clientApi(api$1, void 0, debug2);
      } else {
        const scriptEl = document.getElementById("log_dir_context");
        if (scriptEl) {
          const context = scriptEl.textContent;
          if (context !== null) {
            const data = lib$d.parse(context);
            if (data.log_dir || data.log_file) {
              const log_dir2 = data.log_dir || dirname(data.log_file);
              const api2 = staticHttpApi(log_dir2, data.log_file);
              return clientApi(api2, data.log_file, debug2);
            }
          }
        }
        const urlParams = new URLSearchParams(window.location.search);
        const log_file = urlParams.get("log_file");
        const log_dir = urlParams.get("log_dir");
        const forceViewServerApi = urlParams.get("inspect_server") === "true";
        const resolved_log_dir = log_dir ?? void 0;
        const resolved_log_file = log_file ?? void 0;
        if (forceViewServerApi) {
          return clientApi(
            viewServerApi({ logDir: resolved_log_dir }),
            resolved_log_file,
            debug2
          );
        }
        if (resolved_log_dir !== void 0 || resolved_log_file !== void 0) {
          return clientApi(
            staticHttpApi(resolved_log_dir, resolved_log_file),
            resolved_log_file,
            debug2
          );
        }
        return clientApi(viewServerApi(), void 0, debug2);
      }
    };
    const api = resolveApi();
    const documentFrame = "_documentFrame_1576h_1";
    const documentFrameTitle = "_documentFrameTitle_1576h_9";
    const downloadLink = "_downloadLink_1576h_16";
    const imageDocument = "_imageDocument_1576h_21";
    const styles$1B = {
      documentFrame,
      documentFrameTitle,
      downloadLink,
      imageDocument
    };
    const ContentDocumentView = ({
      id,
      document: document2
    }) => {
      const canDownloadFiles = useStore(
        (state) => state.capabilities.downloadFiles
      );
      if (isImage(document2.mime_type)) {
        return /* @__PURE__ */ jsxRuntimeExports.jsx(ContentDocumentFrame, { document: document2, downloadable: canDownloadFiles, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
          "img",
          {
            className: clsx(styles$1B.imageDocument),
            src: document2.document,
            alt: document2.filename,
            id
          }
        ) });
      } else {
        return /* @__PURE__ */ jsxRuntimeExports.jsx(
          ContentDocumentFrame,
          {
            document: document2,
            downloadable: canDownloadFiles
          }
        );
      }
    };
    const ContentDocumentFrame = ({
      document: document2,
      children: children2,
      downloadable
    }) => {
      return /* @__PURE__ */ jsxRuntimeExports.jsxs(
        "div",
        {
          className: clsx(
            styles$1B.documentFrame,
            "text-size-small",
            "text-style-secondary"
          ),
          children: [
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$1B.documentFrameTitle), children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: clsx(iconForMimeType(document2.mime_type)) }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: downloadable ? /* @__PURE__ */ jsxRuntimeExports.jsx(
                "a",
                {
                  className: clsx(styles$1B.downloadLink),
                  onClick: () => {
                    api.download_file(document2.filename, document2.document);
                  },
                  children: document2.filename
                }
              ) : document2.filename })
            ] }),
            children2
          ]
        }
      );
    };
    const jsonMessage = "_jsonMessage_oxf8d_1";
    const styles$1A = {
      jsonMessage
    };
    const JsonMessageContent = ({
      id,
      json,
      className: className2
    }) => {
      return /* @__PURE__ */ jsxRuntimeExports.jsx(
        RecordTree,
        {
          id,
          record: json,
          className: clsx(styles$1A.jsonMessage, className2),
          useBorders: false
        }
      );
    };
    function escapeSelector(id) {
      return id.replace(/([ #.;,?!+*~'":^$[\]()=>|/\\])/g, "\\$1");
    }
    const decodeHtmlEntities = (text2) => {
      const parser2 = new DOMParser();
      const doc2 = parser2.parseFromString(text2, "text/html");
      return doc2.documentElement.textContent || text2;
    };
    const citations = "_citations_1ggvf_1";
    const citationLink = "_citationLink_1ggvf_9";
    const styles$1z = {
      citations,
      citationLink
    };
    const MessageCitations = ({ citations: citations2 }) => {
      if (citations2.length === 0) {
        return void 0;
      }
      return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$1z.citations, "text-size-smallest"), children: citations2.map((citation, index) => /* @__PURE__ */ jsxRuntimeExports.jsxs(reactExports.Fragment, { children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: index + 1 }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(MessageCitation, { citation })
      ] }, index)) });
    };
    const MessageCitation = ({ citation }) => {
      const innards = decodeHtmlEntities(
        citation.title ?? (typeof citation.cited_text === "string" ? citation.cited_text : citation.type === "url" ? citation.url : "")
      );
      return citation.type === "url" ? /* @__PURE__ */ jsxRuntimeExports.jsx(UrlCitation, { citation, children: innards }) : /* @__PURE__ */ jsxRuntimeExports.jsx(OtherCitation, { children: innards });
    };
    const UrlCitation = ({
      children: children2,
      citation
    }) => /* @__PURE__ */ jsxRuntimeExports.jsx(
      "a",
      {
        href: citation.url,
        target: "_blank",
        rel: "noopener noreferrer",
        className: clsx(styles$1z.citationLink),
        title: citation.cited_text ? `${citation.cited_text}
${citation.url}` : citation.url,
        children: children2
      }
    );
    const OtherCitation = ({ children: children2 }) => /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: children2 });
    const contentImage = "_contentImage_srbm0_1";
    const reasoning = "_reasoning_srbm0_6";
    const styles$1y = {
      contentImage,
      reasoning
    };
    const mcpToolUse = "_mcpToolUse_1792k_1";
    const title$3 = "_title_1792k_9";
    const titleText = "_titleText_1792k_18";
    const args = "_args_1792k_22";
    const argLabel = "_argLabel_1792k_31";
    const error$2 = "_error_1792k_35";
    const toolPanel = "_toolPanel_1792k_40";
    const styles$1x = {
      mcpToolUse,
      title: title$3,
      titleText,
      args,
      argLabel,
      error: error$2,
      toolPanel
    };
    const ServerToolCall = ({
      id,
      content: content2,
      className: className2
    }) => {
      return /* @__PURE__ */ jsxRuntimeExports.jsx(McpToolUse, { id, content: content2, className: className2 });
    };
    const McpToolUse = ({ id, content: content2, className: className2 }) => {
      const args2 = resolveArgs(content2);
      const titleStr = content2.context ? `${content2.context} — ${content2.name}()` : `${content2.name}()`;
      const listToolsResult = maybeListTools(content2);
      const webSearchResult = maybeWebSearchResult(content2);
      return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { id, className: clsx(styles$1x.mcpToolUse, className2), children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs(
          "div",
          {
            className: clsx(
              styles$1x.title,
              "text-size-small",
              "text-style-secondary"
            ),
            children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: ApplicationIcons.role.tool }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: styles$1x.titleText, children: titleStr }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$1x.type, children: content2.type })
            ]
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$1x.args, children: [
          Object.keys(args2).map((key2, index) => {
            const value2 = args2[key2];
            let valueRecord = void 0;
            if (Array.isArray(value2)) {
              valueRecord = {};
              for (var i2 = 0; i2 < value2.length; i2++) {
                valueRecord[`[${i2}]`] = value2[i2];
              }
            } else if (value2 && typeof value2 === "object") {
              valueRecord = value2;
            }
            return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx(LabelDiv, { label: key2 }),
              valueRecord ? /* @__PURE__ */ jsxRuntimeExports.jsx(RecordTree, { id: `${id}-val-${index}`, record: valueRecord }) : /* @__PURE__ */ jsxRuntimeExports.jsx(ValueDiv, { children: value2 })
            ] });
          }),
          webSearchResult ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx(LabelDiv, { label: "results" }),
            /* @__PURE__ */ jsxRuntimeExports.jsx(ValueDiv, { children: webSearchResult.result.map((result2, index) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$1x.result, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
              "a",
              {
                href: result2.url,
                target: "_blank",
                rel: "noopener noreferrer",
                children: result2.title
              }
            ) }, index)) })
          ] }) : void 0,
          listToolsResult ? listToolsResult.result.map((tool2, index) => /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
            ExpandablePanel,
            {
              id: `${id}-output`,
              collapse: true,
              className: clsx(styles$1x.toolPanel),
              children: [
                /* @__PURE__ */ jsxRuntimeExports.jsx(LabelDiv, { label: tool2.name }),
                /* @__PURE__ */ jsxRuntimeExports.jsxs(ValueDiv, { children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: tool2.description }),
                  /* @__PURE__ */ jsxRuntimeExports.jsx(
                    RecordTree,
                    {
                      id: `${id}-tool-${index}`,
                      record: { schema: tool2.input_schema },
                      defaultExpandLevel: 0
                    }
                  )
                ] })
              ]
            }
          ) })) : void 0
        ] }),
        content2.error ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$1x.error, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [
          "Error: ",
          content2.error
        ] }) }) : !listToolsResult && !webSearchResult ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx("text-size-small"), children: /* @__PURE__ */ jsxRuntimeExports.jsx(ExpandablePanel, { id: `${id}-output`, collapse: true, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
          RenderedContent,
          {
            id: `${id}-output`,
            entry: { name: "Output", value: content2.result },
            renderOptions: { renderString: "markdown" }
          }
        ) }) }) : void 0
      ] });
    };
    const resolveArgs = (content2) => {
      if (typeof content2.arguments === "string") {
        if (isJson(content2.arguments)) {
          try {
            return JSON.parse(content2.arguments);
          } catch (e) {
            console.warn("Failed to parse arguments as JSON", e);
          }
        }
        if (content2.arguments) {
          return { arguments: content2.arguments };
        }
        return {};
      } else if (typeof content2.arguments === "object") {
        return content2.arguments;
      } else if (content2.arguments) {
        return { arguments: content2.arguments };
      } else {
        return {};
      }
    };
    const maybeWebSearchResult = (content2) => {
      if (content2.name !== "web_search") {
        return void 0;
      }
      const objArray = asJsonObjArray(content2.result);
      if (objArray !== void 0) {
        return { result: objArray };
      }
    };
    const maybeListTools = (content2) => {
      if (content2.name !== "mcp_list_tools") {
        return void 0;
      }
      const objArray = asJsonObjArray(content2.result);
      if (objArray !== void 0) {
        return { result: objArray };
      }
    };
    const LabelDiv = ({ label: label2 }) => {
      return /* @__PURE__ */ jsxRuntimeExports.jsx(
        "div",
        {
          className: clsx(
            styles$1x.argLabel,
            "text-style-secondary",
            "text-size-smaller"
          ),
          children: /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { children: label2 })
        }
      );
    };
    const ValueDiv = ({ children: children2 }) => {
      return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx("text-size-smaller"), children: children2 });
    };
    const isAnsiOutput = (text2) => {
      const ansiRegex = (
        // eslint-disable-next-line no-control-regex
        /\x1b(?:\[[\x30-\x3f]*[\x20-\x2f]*[\x40-\x7e]|\].*?(?:\x07|\x1b\\)|[^[\]>])/g
      );
      return ansiRegex.test(text2);
    };
    const toolImage = "_toolImage_1wvgr_1";
    const output = "_output_1wvgr_6";
    const textOutput = "_textOutput_1wvgr_10";
    const textCode = "_textCode_1wvgr_18";
    const styles$1w = {
      toolImage,
      output,
      textOutput,
      textCode
    };
    const ToolOutput = ({ output: output2, className: className2 }) => {
      if (!output2) {
        return null;
      }
      const outputs = [];
      if (Array.isArray(output2)) {
        output2.forEach((out, idx) => {
          const key2 = `tool-output-${idx}`;
          if (out.type === "text") {
            outputs.push(/* @__PURE__ */ jsxRuntimeExports.jsx(ToolTextOutput, { text: out.text }, key2));
          } else {
            if (out.image.startsWith("data:")) {
              outputs.push(
                /* @__PURE__ */ jsxRuntimeExports.jsx(
                  "img",
                  {
                    className: clsx(styles$1w.toolImage),
                    src: out.image
                  },
                  key2
                )
              );
            } else {
              outputs.push(/* @__PURE__ */ jsxRuntimeExports.jsx(ToolTextOutput, { text: String(out.image) }, key2));
            }
          }
        });
      } else {
        outputs.push(
          /* @__PURE__ */ jsxRuntimeExports.jsx(ToolTextOutput, { text: String(output2) }, "tool-output-single")
        );
      }
      return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$1w.output, className2), children: outputs });
    };
    const ToolTextOutput = ({ text: text2 }) => {
      if (isJson(text2)) {
        const obj = JSON.parse(text2);
        return /* @__PURE__ */ jsxRuntimeExports.jsx(JsonMessageContent, { id: `1-json`, json: obj });
      }
      if (isAnsiOutput(text2)) {
        return /* @__PURE__ */ jsxRuntimeExports.jsx(
          ANSIDisplay,
          {
            className: styles$1w.ansiOutput,
            output: text2,
            style: { fontSize: "clamp(0.4rem, 1.15vw, 0.9rem)" }
          }
        );
      }
      return /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: clsx(styles$1w.textOutput, "tool-output"), children: /* @__PURE__ */ jsxRuntimeExports.jsx("code", { className: clsx("sourceCode", styles$1w.textCode), children: text2.trim() }) });
    };
    const isMessageContent = (content2) => {
      return typeof content2 === "object" && content2 !== null && "type" in content2 && typeof content2.type === "string";
    };
    const MessageContent = ({
      contents: contents2,
      context
    }) => {
      const normalized = normalizeContent$2(contents2);
      if (Array.isArray(normalized)) {
        return normalized.map((content2, index) => {
          if (typeof content2 === "string") {
            return messageRenderers["text"].render(
              `text-content-${index}`,
              {
                type: "text",
                text: content2,
                refusal: null,
                internal: null,
                citations: null
              },
              index === contents2.length - 1,
              context
            );
          } else {
            if (content2) {
              const renderer = messageRenderers[content2.type];
              if (renderer) {
                return renderer.render(
                  `text-${content2.type}-${index}`,
                  content2,
                  index === contents2.length - 1,
                  context
                );
              } else {
                console.error(`Unknown message content type '${content2.type}'`);
              }
            }
          }
        });
      } else {
        const contentText = {
          type: "text",
          text: normalized,
          refusal: null,
          internal: null,
          citations: null
        };
        return messageRenderers["text"].render(
          "text-message-content",
          contentText,
          true,
          context
        );
      }
    };
    const messageRenderers = {
      text: {
        render: (key2, content2, isLast, _context) => {
          const c2 = content2;
          const cites = c2.citations ?? [];
          if (!c2.text && !cites.length) {
            return void 0;
          }
          const purgeInternalContainers = (text2) => {
            const internalTags = ["internal", "content-internal", "think"];
            internalTags.forEach((tag) => {
              const regex2 = new RegExp(`<${tag}[^>]*>[\\s\\S]*?<\\/${tag}>`, "gm");
              text2 = text2.replace(regex2, "");
            });
            return text2.trim();
          };
          if (isJson(c2.text)) {
            const obj = JSON.parse(c2.text);
            return /* @__PURE__ */ jsxRuntimeExports.jsx(JsonMessageContent, { id: `${key2}-json`, json: obj });
          } else {
            return /* @__PURE__ */ jsxRuntimeExports.jsxs(reactExports.Fragment, { children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx(
                RenderedText,
                {
                  markdown: purgeInternalContainers(c2.text) || "",
                  className: isLast ? "no-last-para-padding" : ""
                }
              ),
              c2.citations ? /* @__PURE__ */ jsxRuntimeExports.jsx(MessageCitations, { citations: c2.citations }) : void 0
            ] }, key2);
          }
        }
      },
      reasoning: {
        render: (key2, content2, isLast, _context) => {
          const r2 = content2;
          let title2 = "Reasoning";
          let text2 = r2.reasoning;
          if (r2.redacted) {
            text2 = r2.summary || "Reasoning encrypted by model provider.";
            if (r2.summary) {
              title2 = "Reasoning (Summary)";
            }
          } else if (!text2) {
            text2 = r2.summary || "Reasoning text not provided.";
            if (r2.summary) {
              title2 = "Reasoning (Summary)";
            }
          }
          const renderReasoningCode = isOpenRouterReasoning(text2);
          const codeFormatted = renderReasoningCode ? JSON.stringify(jsonParse(text2), null, 2) : text2;
          return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$1y.reasoning, "text-size-small"), children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              "div",
              {
                className: clsx(
                  "text-style-label",
                  "text-style-secondary",
                  isLast ? "no-last-para-padding" : ""
                ),
                children: title2
              }
            ),
            /* @__PURE__ */ jsxRuntimeExports.jsxs(ExpandablePanel, { id: `${key2}-reasoning`, collapse: true, children: [
              !renderReasoningCode && /* @__PURE__ */ jsxRuntimeExports.jsx(RenderedText, { markdown: codeFormatted }),
              renderReasoningCode && /* @__PURE__ */ jsxRuntimeExports.jsx(CodePanel, { language: "json", code: codeFormatted })
            ] })
          ] }, key2);
        }
      },
      image: {
        render: (key2, content2, _isLast, _context) => {
          const c2 = content2;
          if (c2.image.startsWith("data:")) {
            return /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: c2.image, className: styles$1y.contentImage }, key2);
          } else {
            return /* @__PURE__ */ jsxRuntimeExports.jsx("code", { children: c2.image }, key2);
          }
        }
      },
      audio: {
        render: (key2, content2, _isLast, _context) => {
          const c2 = content2;
          return /* @__PURE__ */ jsxRuntimeExports.jsx("audio", { controls: true, children: /* @__PURE__ */ jsxRuntimeExports.jsx("source", { src: c2.audio, type: mimeTypeForFormat(c2.format) }) }, key2);
        }
      },
      video: {
        render: (key2, content2, _isLast, _context) => {
          const c2 = content2;
          return /* @__PURE__ */ jsxRuntimeExports.jsx("video", { width: "500", height: "375", controls: true, children: /* @__PURE__ */ jsxRuntimeExports.jsx("source", { src: c2.video, type: mimeTypeForFormat(c2.format) }) }, key2);
        }
      },
      tool: {
        render: (key2, content2, _isLast, _context) => {
          const c2 = content2;
          return /* @__PURE__ */ jsxRuntimeExports.jsx(ToolOutput, { output: c2.content }, key2);
        }
      },
      // server-side tool use
      tool_use: {
        render: (key2, content2, _isLast, _context) => {
          const c2 = content2;
          return /* @__PURE__ */ jsxRuntimeExports.jsx(ServerToolCall, { id: key2, content: c2 });
        }
      },
      data: {
        render: (key2, content2, _isLast, _context) => {
          const c2 = content2;
          return /* @__PURE__ */ jsxRuntimeExports.jsx(ContentDataView, { id: key2, contentData: c2 });
        }
      },
      document: {
        render: (key2, content2, _isLast, _context) => {
          const c2 = content2;
          return /* @__PURE__ */ jsxRuntimeExports.jsx(ContentDocumentView, { id: key2, document: c2 });
        }
      }
    };
    const mimeTypeForFormat = (format2) => {
      switch (format2) {
        case "mov":
          return "video/quicktime";
        case "wav":
          return "audio/wav";
        case "mp3":
          return "audio/mpeg";
        case "mp4":
          return "video/mp4";
        case "mpeg":
          return "video/mpeg";
        default:
          return "video/mp4";
      }
    };
    const normalizeContent$2 = (contents2) => {
      if (typeof contents2 === "string") {
        return contents2;
      }
      if (contents2.length > 0 && typeof contents2[0] === "string") {
        return contents2;
      }
      const result2 = [];
      const collection = [];
      const collect = () => {
        if (collection.length > 0) {
          const filteredCitations = collection.flatMap((c2) => c2.citations || []);
          let citeCount = 0;
          const textWithCites = collection.map((c2) => {
            const positionalCites = (c2.citations ?? []).filter(isCitationWithRange).sort((a, b) => b.cited_text[1] - a.cited_text[1]);
            const endCites = c2.citations?.filter(
              (citation) => !isCitationWithRange(citation)
            );
            let textWithCites2 = c2.text;
            for (let i2 = 0; i2 < positionalCites.length; i2++) {
              const end_index = positionalCites[i2].cited_text[1];
              textWithCites2 = textWithCites2.slice(0, end_index) + `<sup>${positionalCites.length - i2}</sup>` + textWithCites2.slice(end_index);
            }
            citeCount = citeCount + positionalCites.length;
            const citeText = endCites?.map((_citation) => `${++citeCount}`);
            let inlineCites = "";
            if (citeText && citeText.length > 0) {
              inlineCites = `<sup>${citeText.join(",")}</sup>`;
            }
            return (textWithCites2 || "") + inlineCites;
          }).join("");
          result2.push({
            type: "text",
            text: textWithCites,
            refusal: null,
            internal: null,
            citations: filteredCitations
          });
          collection.length = 0;
        }
      };
      for (const content2 of contents2) {
        if (typeof content2 === "string") {
          result2.push({
            type: "text",
            text: content2,
            refusal: null,
            internal: null,
            citations: null
          });
          continue;
        }
        if (content2.type === "text") {
          collection.push(content2);
          continue;
        } else {
          collect();
          result2.push(content2);
        }
      }
      collect();
      return result2;
    };
    const isCitationWithRange = (citation) => Array.isArray(citation.cited_text);
    const isOpenRouterReasoning = (text2) => {
      return text2.startsWith("[{'format'");
    };
    const kToolTodoContentType = "agent/todo-list";
    const resolveToolInput = (fn2, toolArgs) => {
      const toolName = fn2;
      const inputDescriptor = extractInputMetadata(toolName);
      const { input: input2, description: description2, args: args2 } = extractInput(
        toolArgs,
        inputDescriptor
      );
      const functionCall = args2.length > 0 ? `${toolName}(${args2.join(", ")})` : toolName;
      return {
        functionCall,
        input: input2,
        description: description2,
        contentType: inputDescriptor?.contentType
      };
    };
    const extractInputMetadata = (toolName) => {
      if (toolName === "bash") {
        return {
          inputArg: "cmd",
          contentType: "bash"
        };
      } else if (toolName === "python") {
        return {
          inputArg: "code",
          contentType: "python"
        };
      } else if (toolName === "web_search") {
        return {
          inputArg: "query",
          contentType: "json"
        };
      } else if (toolName === "Bash") {
        return {
          inputArg: "command",
          descriptionArg: "description",
          contentType: "bash"
        };
      } else if (toolName === "shell_command") {
        return {
          inputArg: "command",
          descriptionArg: "description",
          contentType: "bash"
        };
      } else if (toolName === "shell") {
        return {
          inputArg: "command",
          contentType: "bash",
          inputToStr: (input2) => {
            if (Array.isArray(input2)) {
              return input2.join(" ");
            }
            return void 0;
          }
        };
      } else if (toolName == "TodoWrite") {
        return {
          inputArg: "todos",
          contentType: kToolTodoContentType
        };
      } else if (toolName == "update_plan") {
        return {
          inputArg: "plan",
          contentType: kToolTodoContentType
        };
      } else {
        return void 0;
      }
    };
    const extractInput = (args2, inputDescriptor) => {
      const formatArg = (key2, value2) => {
        const quotedValue = value2 === null ? "None" : typeof value2 === "string" ? `"${value2}"` : typeof value2 === "object" || Array.isArray(value2) ? JSON.stringify(value2, void 0, 2) : String(value2);
        return `${key2}: ${quotedValue}`;
      };
      if (!args2) {
        return {
          args: []
        };
      }
      if (inputDescriptor) {
        const filterKeys = /* @__PURE__ */ new Set();
        const base2 = {};
        if (inputDescriptor.inputArg && args2[inputDescriptor.inputArg]) {
          filterKeys.add(inputDescriptor.inputArg);
          base2.input = inputDescriptor.inputToStr ? inputDescriptor.inputToStr(args2[inputDescriptor.inputArg]) || args2[inputDescriptor.inputArg] : args2[inputDescriptor.inputArg];
        }
        if (inputDescriptor.descriptionArg && args2[inputDescriptor.descriptionArg]) {
          filterKeys.add(inputDescriptor.descriptionArg);
          base2.description = String(args2[inputDescriptor.descriptionArg]);
        }
        const filteredArgs = Object.keys(args2).filter((key2) => {
          return !filterKeys.has(key2);
        }).map((key2) => {
          return formatArg(key2, args2[key2]);
        });
        return {
          ...base2,
          args: filteredArgs
        };
      } else {
        const formattedArgs = Object.keys(args2).map((key2) => {
          return formatArg(key2, args2[key2]);
        });
        return {
          args: formattedArgs
        };
      }
    };
    const toolCallView = "_toolCallView_l6wae_1";
    const styles$1v = {
      toolCallView
    };
    const outputPre = "_outputPre_1jznn_1";
    const toolView = "_toolView_1jznn_7";
    const outputCode = "_outputCode_1jznn_15";
    const styles$1u = {
      outputPre,
      toolView,
      outputCode
    };
    const todoList = "_todoList_1t8rx_1";
    const inProgress = "_inProgress_1t8rx_9";
    const styles$1t = {
      todoList,
      inProgress
    };
    const toToolTodos = (obj) => {
      if (Array.isArray(obj) && obj.every((item2) => typeof item2 === "object") && obj.every(
        (item2) => item2 !== null && ("content" in item2 || "step" in item2) && "status" in item2
      )) {
        return obj.map((o) => {
          return {
            content: o.content || o.step || "",
            status: o.status
          };
        });
      } else {
        return [];
      }
    };
    const TodoWriteInput = ({ contents: contents2, parentRef }) => {
      const todoItems = toToolTodos(contents2);
      return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: parentRef, className: clsx(styles$1t.todoList), children: todoItems.map((todo) => {
        return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "i",
            {
              className: clsx(
                todo.status === "completed" ? ApplicationIcons.checkbox.checked : ApplicationIcons.checkbox.unchecked,
                "text-size-smallest"
              )
            }
          ),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "span",
            {
              className: clsx(
                styles$1t.todoItem,
                "text-size-smallest",
                todo.status === "in_progress" ? styles$1t.inProgress : void 0
              ),
              children: todo.content
            }
          )
        ] });
      }) });
    };
    const ToolInput = (props) => {
      const { contentType, contents: contents2, toolCallView: toolCallView2, className: className2 } = props;
      const sourceCodeRef = reactExports.useRef(null);
      const sourceCodeLength = toolCallView2 ? toolCallView2.content.length : contents2 ? typeof contents2 === "string" ? contents2.length : JSON.stringify(contents2).length : 0;
      usePrismHighlight(sourceCodeRef, sourceCodeLength);
      if (!contents2 && !toolCallView2?.content) return null;
      if (toolCallView2) {
        return /* @__PURE__ */ jsxRuntimeExports.jsx(
          RenderedText,
          {
            markdown: toolCallView2.content,
            ref: sourceCodeRef,
            className: clsx("tool-output", styles$1u.toolView, className2)
          }
        );
      } else {
        return /* @__PURE__ */ jsxRuntimeExports.jsx(
          RenderTool,
          {
            contents: contents2,
            contentType: contentType || "",
            parentRef: sourceCodeRef,
            className: className2
          }
        );
      }
    };
    const RenderTool = ({
      contents: contents2,
      contentType,
      parentRef,
      className: className2
    }) => {
      if (contentType === kToolTodoContentType) {
        return /* @__PURE__ */ jsxRuntimeExports.jsx(TodoWriteInput, { contents: contents2, parentRef });
      }
      const formattedContent = typeof contents2 === "object" ? JSON.stringify(contents2) : contents2;
      return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: parentRef, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
        "pre",
        {
          className: clsx(
            "tool-output",
            styles$1u.outputPre,
            styles$1u.bottomMargin,
            className2
          ),
          children: /* @__PURE__ */ jsxRuntimeExports.jsx(
            "code",
            {
              className: clsx(
                "source-code",
                "sourceCode",
                contentType ? `language-${contentType}` : void 0,
                styles$1u.outputCode
              ),
              children: formattedContent
            }
          )
        }
      ) });
    };
    const image = "_image_1vcac_1";
    const toolTitle = "_toolTitle_1vcac_6";
    const description = "_description_1vcac_10";
    const styles$1s = {
      image,
      toolTitle,
      description
    };
    const ToolTitle = ({ title: title2, description: description2 }) => {
      return /* @__PURE__ */ jsxRuntimeExports.jsxs(reactExports.Fragment, { children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: clsx("bi", "bi-tools", styles$1s.image) }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("code", { className: clsx("text-size-small", styles$1s.toolTitle), children: title2 }),
        description2 ? /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: clsx(styles$1s.description, "text-size-smallest"), children: [
          "- ",
          description2
        ] }) : void 0
      ] });
    };
    const ToolCallView = ({
      id,
      functionCall,
      input: input2,
      description: description2,
      contentType,
      view,
      output: output2,
      mode,
      collapsible = true
    }) => {
      function isContentImage(value2) {
        if (value2 && typeof value2 === "object") {
          if (value2.type === "image") {
            return true;
          } else if (value2.type === "tool") {
            if (Array.isArray(value2.content) && value2.content.some(isContentImage)) {
              return true;
            }
          }
        }
        return false;
      }
      const collapse = Array.isArray(output2) ? output2.every((item2) => !isContentImage(item2)) : !isContentImage(output2);
      const normalizedContent = reactExports.useMemo(() => normalizeContent$1(output2), [output2]);
      const hasContent = normalizedContent.find((c2) => {
        if (c2.type === "tool") {
          for (const t2 of c2.content) {
            if (t2.type === "text") {
              if (t2.text) {
                return true;
              }
            } else {
              return true;
            }
          }
          return false;
        } else {
          return true;
        }
      });
      const contents2 = mode !== "compact" ? input2 : input2 || functionCall;
      const context = defaultContext();
      return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$1v.toolCallView), children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
          mode !== "compact" && (!view || view.title) ? /* @__PURE__ */ jsxRuntimeExports.jsx(
            ToolTitle,
            {
              title: view?.title || functionCall,
              description: description2
            }
          ) : "",
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            ToolInput,
            {
              contentType,
              contents: contents2,
              toolCallView: view
            }
          )
        ] }),
        hasContent && collapsible ? /* @__PURE__ */ jsxRuntimeExports.jsx(
          ExpandablePanel,
          {
            id: `${id}-tool-input`,
            collapse,
            border: true,
            lines: 15,
            className: clsx("text-size-small"),
            children: /* @__PURE__ */ jsxRuntimeExports.jsx(MessageContent, { contents: normalizedContent, context })
          }
        ) : /* @__PURE__ */ jsxRuntimeExports.jsx(MessageContent, { contents: normalizedContent, context })
      ] });
    };
    const normalizeContent$1 = (output2) => {
      if (Array.isArray(output2)) {
        return output2;
      } else {
        return [
          {
            type: "tool",
            content: [
              {
                type: "text",
                text: String(output2),
                refusal: null,
                internal: null,
                citations: null
              }
            ]
          }
        ];
      }
    };
    const content$6 = "_content_1b2jp_1";
    const codeCompact = "_codeCompact_1b2jp_5";
    const styles$1r = {
      content: content$6,
      codeCompact
    };
    const defaultContext = () => {
      return {
        citeOffset: 0,
        citations: []
      };
    };
    const MessageContents = ({
      id,
      message: message2,
      toolMessages,
      toolCallStyle
    }) => {
      const context = defaultContext();
      if (message2.role === "assistant" && message2.tool_calls && message2.tool_calls.length) {
        const toolCalls = message2.tool_calls.map((tool_call, idx) => {
          const { input: input2, description: description2, functionCall, contentType } = resolveToolInput(tool_call.function, tool_call.arguments);
          let toolMessage;
          if (tool_call.id) {
            toolMessage = toolMessages.find((msg) => {
              return msg.tool_call_id === tool_call.id;
            });
          } else {
            toolMessage = toolMessages[idx];
          }
          const resolvedToolOutput = resolveToolMessage(toolMessage);
          if (toolCallStyle === "compact") {
            return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: /* @__PURE__ */ jsxRuntimeExports.jsxs("code", { className: clsx(styles$1r.codeCompact), children: [
              "tool: ",
              functionCall
            ] }) }, `tool-call-${idx}`);
          } else if (toolCallStyle === "omit") {
            return void 0;
          } else {
            return /* @__PURE__ */ jsxRuntimeExports.jsx(
              ToolCallView,
              {
                id: `${id}-tool-call`,
                functionCall,
                input: input2,
                description: description2,
                contentType,
                output: resolvedToolOutput,
                collapsible: false,
                view: tool_call.view ? tool_call.view : void 0
              },
              `tool-call-${idx}`
            );
          }
        });
        return /* @__PURE__ */ jsxRuntimeExports.jsxs(reactExports.Fragment, { children: [
          message2.content && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$1r.content, children: /* @__PURE__ */ jsxRuntimeExports.jsx(MessageContent, { contents: message2.content, context }) }),
          toolCalls
        ] });
      } else {
        return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: message2.content && /* @__PURE__ */ jsxRuntimeExports.jsx(MessageContent, { contents: message2.content, context }) });
      }
    };
    const resolveToolMessage = (toolMessage) => {
      if (!toolMessage) {
        return [];
      }
      const content2 = toolMessage.error !== null && toolMessage.error ? toolMessage.error.message : toolMessage.content;
      if (typeof content2 === "string") {
        return [
          {
            type: "tool",
            content: [
              {
                type: "text",
                text: content2,
                refusal: null,
                internal: null,
                citations: null
              }
            ]
          }
        ];
      } else {
        const result2 = content2.map((con) => {
          if (typeof con === "string") {
            return {
              type: "tool",
              content: [
                {
                  type: "text",
                  text: con,
                  refusal: null,
                  internal: null,
                  citations: null
                }
              ]
            };
          } else if (con.type === "text") {
            return {
              content: [con],
              type: "tool"
            };
          } else if (con.type === "image") {
            return {
              content: [con],
              type: "tool"
            };
          }
        }).filter((con) => con !== void 0);
        return result2;
      }
    };
    const ChatMessage = reactExports.memo(
      ({
        id,
        message: message2,
        toolMessages,
        indented: indented2,
        toolCallStyle,
        allowLinking = true
      }) => {
        const messageUrl = useSampleMessageUrl(message2.id);
        const collapse = message2.role === "system" || message2.role === "user";
        const [mouseOver, setMouseOver] = reactExports.useState(false);
        return /* @__PURE__ */ jsxRuntimeExports.jsxs(
          "div",
          {
            className: clsx(
              message2.role,
              "text-size-base",
              styles$1H.message,
              message2.role === "system" ? styles$1H.systemRole : void 0,
              message2.role === "user" ? styles$1H.userRole : void 0,
              mouseOver ? styles$1H.hover : void 0
            ),
            onMouseEnter: () => setMouseOver(true),
            onMouseLeave: () => setMouseOver(false),
            children: [
              /* @__PURE__ */ jsxRuntimeExports.jsxs(
                "div",
                {
                  className: clsx(
                    styles$1H.messageGrid,
                    message2.role === "tool" ? styles$1H.toolMessageGrid : void 0,
                    "text-style-label"
                  ),
                  children: [
                    message2.role,
                    message2.role === "tool" ? `: ${message2.function}` : "",
                    supportsLinking() && messageUrl && allowLinking ? /* @__PURE__ */ jsxRuntimeExports.jsx(
                      CopyButton,
                      {
                        icon: ApplicationIcons.link,
                        value: toFullUrl(messageUrl),
                        className: clsx(styles$1H.copyLink)
                      }
                    ) : ""
                  ]
                }
              ),
              /* @__PURE__ */ jsxRuntimeExports.jsxs(
                "div",
                {
                  className: clsx(
                    styles$1H.messageContents,
                    indented2 ? styles$1H.indented : void 0
                  ),
                  children: [
                    /* @__PURE__ */ jsxRuntimeExports.jsx(
                      ExpandablePanel,
                      {
                        id: `${id}-message`,
                        collapse,
                        lines: collapse ? 15 : 25,
                        children: /* @__PURE__ */ jsxRuntimeExports.jsx(
                          MessageContents,
                          {
                            id: `${id}-contents`,
                            message: message2,
                            toolMessages,
                            toolCallStyle
                          },
                          `${id}-contents`
                        )
                      }
                    ),
                    message2.metadata && Object.keys(message2.metadata).length > 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx(
                      LabeledValue,
                      {
                        label: "Metadata",
                        className: clsx(styles$1H.metadataLabel, "text-size-smaller"),
                        children: /* @__PURE__ */ jsxRuntimeExports.jsx(
                          RecordTree,
                          {
                            record: message2.metadata,
                            id: `${id}-metadata`,
                            defaultExpandLevel: 0
                          }
                        )
                      }
                    ) : ""
                  ]
                }
              )
            ]
          }
        );
      }
    );
    const grid$9 = "_grid_3x3ql_1";
    const number$5 = "_number_3x3ql_10";
    const user = "_user_3x3ql_14";
    const container$m = "_container_3x3ql_19";
    const styles$1q = {
      grid: grid$9,
      number: number$5,
      user,
      container: container$m
    };
    const ChatMessageRow = ({
      parentName,
      number: number2,
      resolvedMessage,
      toolCallStyle,
      indented: indented2,
      highlightUserMessage,
      allowLinking = true
    }) => {
      if (number2) {
        return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
          "div",
          {
            className: clsx(
              styles$1q.grid,
              styles$1q.container,
              highlightUserMessage && resolvedMessage.message.role === "user" ? styles$1q.user : void 0
            ),
            children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx(
                "div",
                {
                  className: clsx(
                    "text-size-smaller",
                    "text-style-secondary",
                    styles$1q.number
                  ),
                  children: number2
                }
              ),
              /* @__PURE__ */ jsxRuntimeExports.jsx(
                ChatMessage,
                {
                  id: `${parentName}-chat-messages`,
                  message: resolvedMessage.message,
                  toolMessages: resolvedMessage.toolMessages,
                  indented: indented2,
                  toolCallStyle,
                  allowLinking
                }
              )
            ]
          }
        ) });
      } else {
        return /* @__PURE__ */ jsxRuntimeExports.jsxs(
          "div",
          {
            className: clsx(
              styles$1q.container,
              styles$1q.simple,
              highlightUserMessage && resolvedMessage.message.role === "user" ? styles$1q.user : void 0
            ),
            children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx(
                ChatMessage,
                {
                  id: `${parentName}-chat-messages`,
                  message: resolvedMessage.message,
                  toolMessages: resolvedMessage.toolMessages,
                  indented: indented2,
                  toolCallStyle,
                  allowLinking
                }
              ),
              resolvedMessage.message.role === "user" ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { height: "10px" } }) : void 0
            ]
          }
        );
      }
    };
    const resolveMessages = (messages2) => {
      const resolvedMessages = [];
      let index = 0;
      for (const message2 of messages2) {
        if (message2.role === "tool") {
          if (resolvedMessages.length > 0) {
            const msg = resolvedMessages[resolvedMessages.length - 1];
            msg.toolMessages = msg.toolMessages || [];
            msg.toolMessages.push(message2);
          }
        } else {
          resolvedMessages.push({ message: message2, toolMessages: [] });
        }
        if (message2.id === void 0) {
          message2.id = `msg-${index}`;
        }
        index++;
      }
      const systemMessages = [];
      const collapsedMessages = resolvedMessages.map((resolved) => {
        if (resolved.message.role === "system") {
          systemMessages.push(resolved.message);
        }
        return resolved;
      }).filter((resolved) => {
        return resolved.message.role !== "system";
      });
      const systemContent = [];
      for (const systemMessage2 of systemMessages) {
        const contents2 = Array.isArray(systemMessage2.content) ? systemMessage2.content : [systemMessage2.content];
        systemContent.push(...contents2.map(normalizeContent));
      }
      const systemMessage = {
        id: "sys-message-6815A84B062A",
        role: "system",
        content: systemContent,
        source: "input",
        metadata: null
      };
      if (systemMessage && systemMessage.content.length > 0) {
        collapsedMessages.unshift({ message: systemMessage, toolMessages: [] });
      }
      return collapsedMessages;
    };
    const normalizeContent = (content2) => {
      if (typeof content2 === "string") {
        return {
          type: "text",
          text: content2,
          refusal: null,
          internal: null,
          citations: null
        };
      } else {
        return content2;
      }
    };
    const messagesFromEvents = (runningEvents) => {
      const messages2 = /* @__PURE__ */ new Map();
      runningEvents.filter((e) => e.event === "model").forEach((e) => {
        for (const m of e.input) {
          const inputMessage = m;
          if (inputMessage.id && !messages2.has(inputMessage.id)) {
            messages2.set(inputMessage.id, inputMessage);
          }
        }
        const outputMessage = e.output.choices[0].message;
        if (outputMessage.id) {
          messages2.set(outputMessage.id, outputMessage);
        }
      });
      if (messages2.size > 0) {
        return messages2.values().toArray();
      } else {
        return [];
      }
    };
    const ChatView = ({
      id,
      messages: messages2,
      toolCallStyle = "complete",
      resolveToolCallsIntoPreviousMessage = true,
      indented: indented2,
      numbered = true,
      className: className2,
      allowLinking = true
    }) => {
      const collapsedMessages = resolveToolCallsIntoPreviousMessage ? resolveMessages(messages2) : messages2.map((msg) => {
        return {
          message: msg,
          toolMessages: []
        };
      });
      const result2 = /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(className2), children: collapsedMessages.map((msg, index) => {
        const number2 = collapsedMessages.length > 1 && numbered ? index + 1 : void 0;
        return /* @__PURE__ */ jsxRuntimeExports.jsx(
          ChatMessageRow,
          {
            parentName: id || "chat-view",
            number: number2,
            resolvedMessage: msg,
            indented: indented2,
            toolCallStyle,
            allowLinking,
            highlightUserMessage: true
          },
          `${id}-msg-${index}`
        );
      }) });
      return result2;
    };
    const ChatMessageRenderer = {
      bucket: Buckets.first,
      canRender: (entry) => {
        const val = entry.value;
        return Array.isArray(val) && val.length > 0 && val[0]?.role !== void 0 && val[0]?.content !== void 0;
      },
      render: (id, entry) => {
        return {
          rendered: /* @__PURE__ */ jsxRuntimeExports.jsxs(NavPills, { id: `${id}-navpills`, children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx(ChatSummary, { title: "Last Turn", id, messages: entry.value }),
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              ChatView,
              {
                title: "All",
                id,
                messages: entry.value,
                allowLinking: false
              }
            )
          ] })
        };
      }
    };
    const ChatSummary = ({ id, messages: messages2 }) => {
      const summaryMessages = [];
      for (const message2 of messages2.slice().reverse()) {
        summaryMessages.unshift(message2);
        if (message2.role === "user") {
          break;
        }
      }
      return /* @__PURE__ */ jsxRuntimeExports.jsx(ChatView, { id, messages: summaryMessages });
    };
    const grid$8 = "_grid_14885_1";
    const cell$2 = "_cell_14885_8";
    const styles$1p = {
      grid: grid$8,
      cell: cell$2
    };
    const MetaDataGrid = ({
      id,
      entries,
      className: className2,
      size,
      style: style2,
      plain
    }) => {
      const baseId = "metadata-grid";
      const fontStyle = size === "mini" ? "text-size-smallest" : "text-size-smaller";
      const entryEls = entryRecords(entries).map((entry, index) => {
        const id2 = `${baseId}-value-${index}`;
        return /* @__PURE__ */ jsxRuntimeExports.jsxs(reactExports.Fragment, { children: [
          index !== 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx(
            "div",
            {
              style: {
                gridColumn: "1 / -1",
                borderBottom: `${!plain ? "solid 1px var(--bs-light-border-subtle" : ""}`
              }
            }
          ) : void 0,
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "div",
            {
              className: clsx(
                `${baseId}-key`,
                styles$1p.cell,
                "text-style-label",
                "text-style-secondary",
                fontStyle
              ),
              children: entry?.name
            }
          ),
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$1p.value, `${baseId}-value`, fontStyle), children: entry && /* @__PURE__ */ jsxRuntimeExports.jsx(
            RenderedContent,
            {
              id: id2,
              entry,
              renderObject: (obj) => {
                return /* @__PURE__ */ jsxRuntimeExports.jsx(
                  MetaDataGrid,
                  {
                    id: id2,
                    className: clsx(styles$1p.nested),
                    entries: obj,
                    size,
                    plain
                  }
                );
              }
            }
          ) })
        ] }, `${baseId}-record-${index}`);
      });
      return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { id, className: clsx(className2, styles$1p.grid), style: style2, children: entryEls });
    };
    const entryRecords = (entries) => {
      if (!entries) {
        return [];
      }
      if (!Array.isArray(entries)) {
        return Object.entries(entries || {}).map(([key2, value2]) => {
          return { name: key2, value: value2 };
        });
      } else {
        return entries;
      }
    };
    const query = "_query_seqs2_1";
    const summary$3 = "_summary_seqs2_6";
    const preWrap = "_preWrap_seqs2_10";
    const preCompact = "_preCompact_seqs2_15";
    const styles$1o = {
      query,
      summary: summary$3,
      preWrap,
      preCompact
    };
    const RenderedContent = ({
      id,
      entry,
      renderOptions = { renderString: "markdown" },
      renderObject
    }) => {
      if (entry.value === null) {
        return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "[null]" });
      }
      const renderers = contentRenderers(renderObject);
      const renderer = Object.keys(renderers).map((key2) => {
        return renderers[key2];
      }).sort((a, b) => {
        return a.bucket - b.bucket;
      }).find((renderer2) => {
        return renderer2.canRender(entry);
      });
      if (renderer) {
        const { rendered } = renderer.render(id, entry, renderOptions);
        if (rendered !== void 0 && reactExports.isValidElement(rendered)) {
          return rendered;
        }
      }
      const displayValue = (() => {
        try {
          if (typeof entry.value === "object") {
            return JSON.stringify(entry.value);
          }
          return String(entry.value).trim();
        } catch (e) {
          return "[Unable to display value]";
        }
      })();
      return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: displayValue });
    };
    const contentRenderers = (renderObject) => {
      const contentRenderers2 = {
        AnsiString: {
          bucket: Buckets.first,
          canRender: (entry) => {
            return typeof entry.value === "string" && entry.value.indexOf("\x1B") > -1;
          },
          render: (_id, entry, _options) => {
            return {
              rendered: /* @__PURE__ */ jsxRuntimeExports.jsx(ANSIDisplay, { output: entry.value })
            };
          }
        },
        JsonString: {
          bucket: Buckets.first,
          canRender: (entry) => {
            if (typeof entry.value === "string") {
              const trimmed = entry.value.trim();
              return isJson(trimmed);
            }
            return false;
          },
          render: (_id, entry, _options) => {
            const obj = lib$d.parse(entry.value);
            return {
              rendered: /* @__PURE__ */ jsxRuntimeExports.jsx(JSONPanel, { data: obj })
            };
          }
        },
        Model: {
          bucket: Buckets.intermediate,
          canRender: (entry) => {
            return typeof entry.value === "object" && entry.value._model;
          },
          render: (_id, entry, _options) => {
            return {
              rendered: /* @__PURE__ */ jsxRuntimeExports.jsxs(reactExports.Fragment, { children: [
                /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: ApplicationIcons.model }),
                " ",
                entry.value._model
              ] })
            };
          }
        },
        Boolean: {
          bucket: Buckets.intermediate,
          canRender: (entry) => {
            return typeof entry.value === "boolean";
          },
          render: (id, entry, options2) => {
            entry.value = entry.value.toString();
            return contentRenderers2.String.render(id, entry, options2);
          }
        },
        Number: {
          bucket: Buckets.intermediate,
          canRender: (entry) => {
            return typeof entry.value === "number";
          },
          render: (id, entry, options2) => {
            entry.value = formatNumber(entry.value);
            return contentRenderers2.String.render(id, entry, options2);
          }
        },
        String: {
          bucket: Buckets.final,
          canRender: (entry) => {
            return typeof entry.value === "string";
          },
          render: (_id, entry, options2) => {
            const rendered = entry.value.trim();
            if (options2.renderString === "markdown") {
              return {
                rendered: /* @__PURE__ */ jsxRuntimeExports.jsx(RenderedText, { markdown: rendered })
              };
            } else {
              return {
                rendered: /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: clsx(styles$1o.preWrap, styles$1o.preCompact), children: rendered })
              };
            }
          }
        },
        Array: {
          bucket: Buckets.intermediate,
          canRender: (entry) => {
            const isArray = Array.isArray(entry.value);
            if (isArray) {
              if (entry.value.length === 0 || entry.value.length === 1) {
                return true;
              }
              const types2 = new Set(
                entry.value.filter((e) => e !== null).map((e) => {
                  return typeof e;
                })
              );
              return types2.size === 1;
            } else {
              return false;
            }
          },
          render: (id, entry, _options) => {
            const arrayMap = {};
            entry.value.forEach((e, index) => {
              arrayMap[`[${index}]`] = e;
            });
            const arrayRendered = renderObject ? renderObject(arrayMap) : /* @__PURE__ */ jsxRuntimeExports.jsx(
              MetaDataGrid,
              {
                id,
                className: "font-size-small",
                entries: arrayMap,
                plain: true
              }
            );
            return { rendered: arrayRendered };
          }
        },
        ChatMessage: ChatMessageRenderer,
        web_search: {
          bucket: Buckets.intermediate,
          canRender: (entry) => {
            return typeof entry.value === "object" && entry.name === "web_search";
          },
          render: (_id, entry, _options) => {
            const results = [];
            results.push(
              /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$1o.query, children: [
                /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: ApplicationIcons.search }),
                " ",
                entry.value.query
              ] })
            );
            entry.value.results.forEach(
              (result2) => {
                results.push(
                  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: /* @__PURE__ */ jsxRuntimeExports.jsx("a", { href: result2.url, children: result2.url }) })
                );
                results.push(
                  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx("text-size-smaller", styles$1o.summary), children: result2.summary })
                );
              }
            );
            return {
              rendered: results
            };
          }
        },
        web_browser: {
          bucket: Buckets.intermediate,
          canRender: (entry) => {
            return typeof entry.value === "string" && entry.name?.startsWith("web_browser");
          },
          render: (_id, entry, _options) => {
            return {
              rendered: /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: styles$1o.preWrap, children: entry.value })
            };
          }
        },
        Html: {
          bucket: Buckets.intermediate,
          canRender: (entry) => {
            return typeof entry.value === "object" && entry.value._html;
          },
          render: (_id, entry, _options) => {
            return {
              rendered: entry.value._html
            };
          }
        },
        MessageContent: {
          bucket: Buckets.first,
          canRender: (entry) => {
            return Array.isArray(entry.value) && entry.value.every((item2) => {
              return isMessageContent(item2);
            });
          },
          render: (_id, entry, _options) => {
            return {
              rendered: /* @__PURE__ */ jsxRuntimeExports.jsx(MessageContent, { contents: entry.value, context: defaultContext() })
            };
          }
        },
        Image: {
          bucket: Buckets.intermediate,
          canRender: (entry) => {
            return typeof entry.value === "string" && entry.value.startsWith("data:image/");
          },
          render: (_id, entry, _options) => {
            return {
              rendered: /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: entry.value })
            };
          }
        },
        Object: {
          bucket: Buckets.intermediate,
          canRender: (entry) => {
            return typeof entry.value === "object";
          },
          render: (id, entry, _options) => {
            if (renderObject) {
              return { rendered: renderObject(entry.value) };
            } else {
              return {
                rendered: /* @__PURE__ */ jsxRuntimeExports.jsx(
                  MetaDataGrid,
                  {
                    id,
                    className: "font-size-small",
                    entries: entry.value,
                    plain: true
                  }
                )
              };
            }
          }
        }
      };
      return contentRenderers2;
    };
    const otherScoreDescriptor = () => {
      return {
        scoreType: kScoreTypeOther,
        compare: () => {
          return 0;
        },
        render: (score2) => {
          return /* @__PURE__ */ jsxRuntimeExports.jsx(
            RenderedContent,
            {
              id: "other-score-value",
              entry: { name: "other-score-value", value: score2 }
            }
          );
        }
      };
    };
    const circle = "_circle_1iagp_1";
    const green = "_green_1iagp_12";
    const red = "_red_1iagp_18";
    const orange = "_orange_1iagp_24";
    const styles$1n = {
      circle,
      green,
      red,
      orange
    };
    const passFailScoreDescriptor = (values) => {
      const categories = [];
      if (values.includes("C")) {
        categories.push({
          val: "C",
          text: "Correct"
        });
      }
      if (values.includes("P")) {
        categories.push({
          val: "P",
          text: "Partial"
        });
      }
      if (values.includes("I")) {
        categories.push({
          val: "I",
          text: "Incorrect"
        });
      }
      if (values.includes("N")) {
        categories.push({
          val: "N",
          text: "Refusal"
        });
      }
      const order2 = ["C", "P", "I", "N"];
      return {
        scoreType: kScoreTypePassFail,
        categories,
        render: (score2) => {
          if (score2 === "C") {
            return /* @__PURE__ */ jsxRuntimeExports.jsx(
              "span",
              {
                className: clsx("text-size-small", styles$1n.circle, styles$1n.green),
                children: "C"
              }
            );
          } else if (score2 === "I") {
            return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: clsx("text-size-small", styles$1n.circle, styles$1n.red), children: "I" });
          } else if (score2 === "P") {
            return /* @__PURE__ */ jsxRuntimeExports.jsx(
              "span",
              {
                className: clsx("text-size-small", styles$1n.circle, styles$1n.orange),
                children: "P"
              }
            );
          } else if (score2 === "N") {
            return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: clsx("text-size-small", styles$1n.circle, styles$1n.red), children: "N" });
          } else {
            return String(score2);
          }
        },
        compare: (a, b) => {
          if (typeof a.value !== "string" && typeof b.value !== "string") {
            return 0;
          } else if (typeof a.value === "string" && typeof b.value !== "string") {
            return -1;
          } else if (typeof a.value !== "string" && typeof b.value === "string") {
            return 1;
          } else {
            const sort2 = order2.indexOf(String(a.value || "")) - order2.indexOf(String(b.value || ""));
            return sort2;
          }
        }
      };
    };
    const getScoreDescriptorForValues = (uniqScoreValues, uniqScoreTypes) => {
      for (const categorizer of scoreCategorizers) {
        const scoreDescriptor = categorizer.describe(
          uniqScoreValues,
          uniqScoreTypes
        );
        if (scoreDescriptor) {
          return scoreDescriptor;
        }
      }
    };
    const scoreCategorizers = [
      {
        describe: (_values, types2) => {
          if (types2 && types2.length === 1 && types2[0] === "boolean") {
            return booleanScoreDescriptor();
          }
        }
      },
      {
        describe: (values, _types) => {
          if (values.length === 2 && values.every((val) => {
            return val === 1 || val === 0;
          })) {
            return numericScoreDescriptor(values);
          }
        }
      },
      {
        describe: (values, types2) => {
          if (types2 && types2[0] === "string" && types2.length === 1 && values.length < 5 && !values.find((val) => {
            return val !== "I" && val !== "C" && val !== "P" && val !== "N";
          })) {
            return passFailScoreDescriptor(values);
          }
        }
      },
      {
        describe: (values, types2) => {
          if (values.length < 10 && types2 && types2.length === 1 && types2[0] === "string") {
            return categoricalScoreDescriptor(values);
          }
        }
      },
      {
        describe: (values, types2) => {
          if (types2 && types2.length !== 0 && types2[0] === "number") {
            return numericScoreDescriptor(values);
          }
        }
      },
      {
        describe: (values, types2) => {
          if (types2 && types2.length !== 0 && types2[0] === "object") {
            if (values.length > 0 && Array.isArray(values[0])) {
              return listScoreDescriptor();
            } else {
              return objectScoreDescriptor(values);
            }
          }
        }
      },
      {
        describe: (_values, _types) => {
          return otherScoreDescriptor();
        }
      }
    ];
    const createEvalDescriptor = (scores2, samples) => {
      if (!samples) {
        return void 0;
      }
      const scoreValue = (sample2, scoreLabel) => {
        if (sample2.scores === null || Object.keys(sample2.scores).length === 0 || !scoreLabel) {
          return void 0;
        }
        if (scoreLabel.scorer !== scoreLabel.name && sample2.scores[scoreLabel.scorer] && sample2.scores[scoreLabel.scorer].value) {
          if (typeof sample2.scores[scoreLabel.scorer].value === "object") {
            return sample2.scores[scoreLabel.scorer].value[scoreLabel.name];
          } else {
            return sample2.scores[scoreLabel.scorer].value;
          }
        } else if (sample2.scores[scoreLabel.name]) {
          return sample2.scores[scoreLabel.name].value;
        } else {
          return void 0;
        }
      };
      const scoreAnswer = (sample2, scorer2) => {
        if (sample2 && sample2.scores) {
          const sampleScore = sample2.scores[scorer2.scorer];
          if (sampleScore && sampleScore.answer) {
            return sampleScore.answer;
          }
        } else {
          return void 0;
        }
      };
      const scoreExplanation = (sample2, scorer2) => {
        if (sample2 && sample2.scores) {
          const sampleScore = sample2.scores[scorer2];
          if (sampleScore && sampleScore.explanation) {
            return sampleScore.explanation;
          }
        }
        return void 0;
      };
      const scoreMetadata = (sample2, scorer2) => {
        if (sample2 && sample2.scores) {
          const sampleScore = sample2.scores[scorer2];
          if (sampleScore && sampleScore.metadata) {
            return sampleScore.metadata;
          }
        }
        return void 0;
      };
      const scoreDescriptorMap = {};
      for (const scoreLabel of scores2) {
        const uniqScoreValues = [
          ...new Set(
            samples.filter((sample2) => !!sample2.scores).filter((sample2) => {
              if (!scoreLabel) {
                return true;
              }
              if (!sample2.scores) {
                return false;
              }
              if (scoreLabel.scorer !== scoreLabel.name) {
                return Object.keys(sample2.scores).includes(scoreLabel.scorer) && Object.keys(sample2.scores[scoreLabel.scorer].value).includes(
                  scoreLabel.name
                );
              } else {
                return Object.keys(sample2.scores).includes(scoreLabel.name);
              }
            }).map((sample2) => {
              return scoreValue(sample2, scoreLabel);
            }).filter((value2) => {
              return value2 !== null;
            }).filter((value2) => {
              return value2 !== void 0;
            })
          )
        ];
        const uniqScoreTypes = [
          ...new Set(uniqScoreValues.map((scoreValue2) => typeof scoreValue2))
        ];
        const scoreDescriptor2 = getScoreDescriptorForValues(
          uniqScoreValues,
          uniqScoreTypes
        );
        if (scoreDescriptor2) {
          scoreDescriptorMap[scoreLabelKey(scoreLabel)] = scoreDescriptor2;
        }
      }
      const scoreDescriptor = (scoreLabel) => {
        return scoreDescriptorMap[scoreLabelKey(scoreLabel)];
      };
      const scoreRendered = (sample2, scoreLabel) => {
        const descriptor = scoreDescriptor(scoreLabel);
        const score22 = scoreValue(sample2, scoreLabel);
        if (score22 === null) {
          return "null";
        } else if (score22 === void 0) {
          return "";
        } else if (descriptor && descriptor.render) {
          return descriptor.render(score22);
        } else {
          return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: String(score22) });
        }
      };
      const scorerDescriptor = (sample2, scoreLabel) => {
        return {
          metadata: () => {
            return scoreMetadata(sample2, scoreLabel.scorer) || {};
          },
          explanation: () => {
            return scoreExplanation(sample2, scoreLabel.scorer) || "";
          },
          answer: () => {
            return scoreAnswer(sample2, scoreLabel) || "";
          },
          scores: () => {
            if (!sample2 || !sample2.scores) {
              return [];
            }
            const myScoreDescriptor = scoreDescriptor(scoreLabel);
            if (!myScoreDescriptor) {
              return [];
            }
            const scoreNames = scores2.map((score22) => {
              return score22.name;
            });
            const sampleScorer = sample2.scores[scoreLabel.scorer];
            const scoreVal = sampleScorer.value;
            if (typeof scoreVal === "object") {
              const names = Object.keys(scoreVal);
              if (names.find((name2) => {
                return scoreNames.includes(name2);
              })) {
                const scores22 = names.map((name2) => {
                  return {
                    name: name2,
                    rendered: () => {
                      return myScoreDescriptor.render(scoreVal);
                    }
                  };
                });
                return scores22;
              } else {
                return [
                  {
                    name: scoreLabel.scorer,
                    rendered: () => {
                      return myScoreDescriptor.render(scoreVal);
                    }
                  }
                ];
              }
            } else {
              return [
                {
                  name: scoreLabel.scorer,
                  rendered: () => {
                    return myScoreDescriptor.render(scoreVal);
                  }
                }
              ];
            }
          }
        };
      };
      const score2 = (sample2, scoreLabel) => {
        if (!scoreLabel) {
          return void 0;
        }
        return {
          value: scoreValue(sample2, scoreLabel),
          render: () => {
            return scoreRendered(sample2, scoreLabel);
          }
        };
      };
      return {
        scores: scores2,
        scorerDescriptor,
        scoreDescriptor,
        score: score2,
        scoreAnswer
      };
    };
    const createSamplesDescriptor = (samples, evalDescriptor, selectedScores) => {
      const sizes = samples.reduce(
        (previous, current2) => {
          const text2 = inputString(current2.input).join(" ");
          let answerLength = 0;
          if (selectedScores.length > 0) {
            selectedScores.forEach((scoreLabel, index) => {
              const score2 = evalDescriptor.score(current2, scoreLabel);
              const scoreValue = score2?.value;
              const scoreText = scoreValue ? String(scoreValue) : current2.error ? errorType(current2.error) : "";
              const currentSize = Math.max(
                scoreText.length,
                scoreLabel.name.length
              );
              previous.scores[index] = Math.max(
                previous.scores[index] || 0,
                currentSize
              );
            });
            answerLength = evalDescriptor.scoreAnswer(current2, selectedScores[0])?.length || 0;
          } else {
            previous.scores = [];
            previous.scores[0] = 3;
          }
          previous.input = Math.min(Math.max(previous.input, text2.length), 200);
          previous.target = Math.min(
            Math.max(previous.target, arrayToString(current2.target).length),
            300
          );
          previous.answer = Math.min(Math.max(previous.answer, answerLength), 300);
          previous.limit = Math.min(
            Math.max(previous.limit, current2.limit ? current2.limit.length : 0),
            50
          );
          previous.retries = Math.min(
            Math.max(
              previous.retries,
              current2.retries ? String(current2.retries).length : 0
            ),
            50
          );
          previous.id = Math.min(
            Math.max(previous.id, String(current2.id).length),
            10
          );
          return previous;
        },
        {
          input: 0,
          target: 0,
          answer: 0,
          limit: 0,
          retries: 0,
          id: 0,
          scores: []
        }
      );
      const totalScoreSizes = sizes.scores.reduce((sum2, size) => sum2 + size, 0);
      const normalizedScoreSizes = totalScoreSizes > 0 ? sizes.scores.map((size) => Math.round(size / totalScoreSizes * 30)) : [];
      const maxSizes = {
        input: Math.min(sizes.input, 300),
        target: Math.min(sizes.target, 300),
        answer: Math.min(sizes.answer, 300),
        limit: Math.min(sizes.limit, 50),
        retries: Math.min(sizes.retries, 50),
        id: Math.min(sizes.id, 10),
        score: normalizedScoreSizes
      };
      const base2 = maxSizes.input + maxSizes.target + maxSizes.answer + maxSizes.limit + maxSizes.retries + maxSizes.id + maxSizes.score.reduce((sum2, size) => {
        return sum2 + size;
      }, 0) || 1;
      const inputNormalized = maxSizes.input / base2;
      const targetNormalized = maxSizes.target / base2 > 0 ? Math.max(maxSizes.target / base2, inputNormalized / 10) : 0;
      const answerNormalized = maxSizes.answer / base2 > 0 ? Math.max(maxSizes.answer / base2, inputNormalized / 10) : 0;
      const messageShape = {
        raw: sizes,
        normalized: {
          input: inputNormalized,
          target: targetNormalized,
          answer: answerNormalized,
          limit: maxSizes.limit / base2,
          retries: maxSizes.retries / base2,
          id: maxSizes.id / base2,
          scores: maxSizes.score.map((val) => {
            return val / base2;
          })
        }
      };
      const firstSelectedScore = selectedScores?.[0];
      return {
        evalDescriptor,
        messageShape,
        selectedScore: (sample2) => firstSelectedScore ? evalDescriptor.score(sample2, firstSelectedScore) : void 0,
        selectedScorerDescriptor: (sample2) => firstSelectedScore ? evalDescriptor.scorerDescriptor(sample2, firstSelectedScore) : void 0
      };
    };
    const scoreLabelKey = (scoreLabel) => {
      return `${scoreLabel?.scorer}.${scoreLabel.name}`;
    };
    var _parser = (function() {
      var parser2 = {
        trace: function trace() {
        },
        yy: {},
        symbols_: {
          error: 2,
          expressions: 3,
          e: 4,
          EndOfExpression: 5,
          "-": 6,
          "+": 7,
          "*": 8,
          "/": 9,
          "^": 10,
          mod: 11,
          and: 12,
          or: 13,
          not: 14,
          if: 15,
          then: 16,
          else: 17,
          in: 18,
          notIn: 19,
          "(": 20,
          ")": 21,
          Arguments: 22,
          ",": 23,
          Number: 24,
          Symbol: 25,
          String: 26,
          of: 27,
          Relation: 28,
          "%": 29,
          "?": 30,
          ":": 31,
          RelationalOperator: 32,
          "==": 33,
          "!=": 34,
          "~=": 35,
          "<": 36,
          "<=": 37,
          ">=": 38,
          ">": 39,
          $accept: 0,
          $end: 1
        },
        terminals_: {
          2: "error",
          5: "EndOfExpression",
          6: "-",
          7: "+",
          8: "*",
          9: "/",
          10: "^",
          11: "mod",
          12: "and",
          13: "or",
          14: "not",
          15: "if",
          16: "then",
          17: "else",
          18: "in",
          19: "notIn",
          20: "(",
          21: ")",
          23: ",",
          24: "Number",
          25: "Symbol",
          26: "String",
          27: "of",
          29: "%",
          30: "?",
          31: ":",
          33: "==",
          34: "!=",
          35: "~=",
          36: "<",
          37: "<=",
          38: ">=",
          39: ">"
        },
        productions_: [
          0,
          [3, 2],
          [4, 2],
          [4, 3],
          [4, 3],
          [4, 3],
          [4, 3],
          [4, 3],
          [4, 3],
          [4, 3],
          [4, 3],
          [4, 2],
          [4, 6],
          [4, 3],
          [4, 3],
          [4, 3],
          [4, 5],
          [4, 1],
          [4, 1],
          [4, 1],
          [4, 3],
          [4, 3],
          [4, 4],
          [4, 1],
          [4, 3],
          [4, 5],
          [32, 1],
          [32, 1],
          [32, 1],
          [32, 1],
          [32, 1],
          [32, 1],
          [32, 1],
          [28, 3],
          [28, 3],
          [22, 1],
          [22, 3]
        ],
        performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) {
          var $0 = $$.length - 1;
          switch (yystate) {
            case 1:
              return $$[$0 - 1];
            case 2:
              this.$ = ["(", "ops['-'](", $$[$0], ")", ")"];
              break;
            case 3:
              this.$ = [
                "(",
                "ops['",
                $$[$0 - 1],
                "'](",
                $$[$0 - 2],
                ", ",
                $$[$0],
                ")",
                ")"
              ];
              break;
            case 4:
              this.$ = [
                "(",
                "ops['",
                $$[$0 - 1],
                "'](",
                $$[$0 - 2],
                ", ",
                $$[$0],
                ")",
                ")"
              ];
              break;
            case 5:
              this.$ = [
                "(",
                "ops['",
                $$[$0 - 1],
                "'](",
                $$[$0 - 2],
                ", ",
                $$[$0],
                ")",
                ")"
              ];
              break;
            case 6:
              this.$ = [
                "(",
                "ops['",
                $$[$0 - 1],
                "'](",
                $$[$0 - 2],
                ", ",
                $$[$0],
                ")",
                ")"
              ];
              break;
            case 7:
              this.$ = [
                "(",
                "ops['",
                $$[$0 - 1],
                "'](",
                $$[$0 - 2],
                ", ",
                $$[$0],
                ")",
                ")"
              ];
              break;
            case 8:
              this.$ = ["(", "ops.mod(", $$[$0 - 2], ", ", $$[$0], ")", ")"];
              break;
            case 9:
              this.$ = [
                "(",
                "",
                "std.coerceBoolean",
                "(",
                $$[$0 - 2],
                ") && ",
                "std.coerceBoolean",
                "(",
                $$[$0],
                ")",
                ")"
              ];
              break;
            case 10:
              this.$ = [
                "(",
                "",
                "std.coerceBoolean",
                "(",
                $$[$0 - 2],
                ") || ",
                "std.coerceBoolean",
                "(",
                $$[$0],
                ")",
                ")"
              ];
              break;
            case 11:
              this.$ = ["(", "! ", "std.coerceBoolean", "(", $$[$0], ")", ")"];
              break;
            case 12:
              this.$ = [
                "(",
                "",
                "std.coerceBoolean",
                "(",
                $$[$0 - 4],
                ") ? ",
                $$[$0 - 2],
                " : ",
                $$[$0],
                "",
                ")"
              ];
              break;
            case 13:
              this.$ = ["(", "std.isSubset(", $$[$0 - 2], ", ", $$[$0], ")", ")"];
              break;
            case 14:
              this.$ = ["(", "!std.isSubset(", $$[$0 - 2], ", ", $$[$0], ")", ")"];
              break;
            case 15:
              this.$ = ["(", "", $$[$0 - 1], "", ")"];
              break;
            case 16:
              this.$ = ["(", "[ ", $$[$0 - 3], ", ", $$[$0 - 1], " ]", ")"];
              break;
            case 17:
              this.$ = ["", $$[$0], ""];
              break;
            case 18:
              this.$ = ["prop(", $$[$0], ", data)"];
              break;
            case 19:
              this.$ = ["", $$[$0], ""];
              break;
            case 20:
              this.$ = ["prop(", $$[$0 - 2], ", ", $$[$0], ")"];
              break;
            case 21:
              this.$ = ["call(", $$[$0 - 2], ")"];
              break;
            case 22:
              this.$ = ["call(", $$[$0 - 3], ", ", $$[$0 - 1], ")"];
              break;
            case 23:
              this.$ = yy.reduceRelation($$[$0]);
              break;
            case 24:
              this.$ = [
                "std.warnDeprecated('modulo', ops['mod'](",
                $$[$0 - 2],
                ", ",
                $$[$0],
                "))"
              ];
              break;
            case 25:
              this.$ = [
                "std.warnDeprecated('ternary', ",
                "std.coerceBoolean",
                "(",
                $$[$0 - 4],
                ") ? ",
                $$[$0 - 2],
                " : ",
                $$[$0],
                ")"
              ];
              break;
            case 26:
              this.$ = ["=="];
              break;
            case 27:
              this.$ = ["!="];
              break;
            case 28:
              this.$ = ["~="];
              break;
            case 29:
              this.$ = ["<"];
              break;
            case 30:
              this.$ = ["<="];
              break;
            case 31:
              this.$ = [">="];
              break;
            case 32:
              this.$ = [">"];
              break;
            case 33:
              this.$ = [$$[$0 - 2], $$[$0 - 1], ...$$[$0]];
              break;
            case 34:
              this.$ = [$$[$0 - 2], $$[$0 - 1], $$[$0]];
              break;
            case 35:
              this.$ = ["", $$[$0], ""];
              break;
            case 36:
              this.$ = ["", $$[$0 - 2], ", ", $$[$0], ""];
              break;
          }
        },
        table: [
          {
            3: 1,
            4: 2,
            6: [1, 3],
            14: [1, 4],
            15: [1, 5],
            20: [1, 6],
            24: [1, 7],
            25: [1, 8],
            26: [1, 9],
            28: 10
          },
          {
            1: [3]
          },
          {
            5: [1, 11],
            6: [1, 13],
            7: [1, 12],
            8: [1, 14],
            9: [1, 15],
            10: [1, 16],
            11: [1, 17],
            12: [1, 18],
            13: [1, 19],
            18: [1, 20],
            19: [1, 21],
            29: [1, 22],
            30: [1, 23],
            32: 24,
            33: [1, 25],
            34: [1, 26],
            35: [1, 27],
            36: [1, 28],
            37: [1, 29],
            38: [1, 30],
            39: [1, 31]
          },
          {
            4: 32,
            6: [1, 3],
            14: [1, 4],
            15: [1, 5],
            20: [1, 6],
            24: [1, 7],
            25: [1, 8],
            26: [1, 9],
            28: 10
          },
          {
            4: 33,
            6: [1, 3],
            14: [1, 4],
            15: [1, 5],
            20: [1, 6],
            24: [1, 7],
            25: [1, 8],
            26: [1, 9],
            28: 10
          },
          {
            4: 34,
            6: [1, 3],
            14: [1, 4],
            15: [1, 5],
            20: [1, 6],
            24: [1, 7],
            25: [1, 8],
            26: [1, 9],
            28: 10
          },
          {
            4: 35,
            6: [1, 3],
            14: [1, 4],
            15: [1, 5],
            20: [1, 6],
            22: 36,
            24: [1, 7],
            25: [1, 8],
            26: [1, 9],
            28: 10
          },
          {
            5: [2, 17],
            6: [2, 17],
            7: [2, 17],
            8: [2, 17],
            9: [2, 17],
            10: [2, 17],
            11: [2, 17],
            12: [2, 17],
            13: [2, 17],
            16: [2, 17],
            17: [2, 17],
            18: [2, 17],
            19: [2, 17],
            21: [2, 17],
            23: [2, 17],
            29: [2, 17],
            30: [2, 17],
            31: [2, 17],
            33: [2, 17],
            34: [2, 17],
            35: [2, 17],
            36: [2, 17],
            37: [2, 17],
            38: [2, 17],
            39: [2, 17]
          },
          {
            5: [2, 18],
            6: [2, 18],
            7: [2, 18],
            8: [2, 18],
            9: [2, 18],
            10: [2, 18],
            11: [2, 18],
            12: [2, 18],
            13: [2, 18],
            16: [2, 18],
            17: [2, 18],
            18: [2, 18],
            19: [2, 18],
            20: [1, 38],
            21: [2, 18],
            23: [2, 18],
            27: [1, 37],
            29: [2, 18],
            30: [2, 18],
            31: [2, 18],
            33: [2, 18],
            34: [2, 18],
            35: [2, 18],
            36: [2, 18],
            37: [2, 18],
            38: [2, 18],
            39: [2, 18]
          },
          {
            5: [2, 19],
            6: [2, 19],
            7: [2, 19],
            8: [2, 19],
            9: [2, 19],
            10: [2, 19],
            11: [2, 19],
            12: [2, 19],
            13: [2, 19],
            16: [2, 19],
            17: [2, 19],
            18: [2, 19],
            19: [2, 19],
            21: [2, 19],
            23: [2, 19],
            29: [2, 19],
            30: [2, 19],
            31: [2, 19],
            33: [2, 19],
            34: [2, 19],
            35: [2, 19],
            36: [2, 19],
            37: [2, 19],
            38: [2, 19],
            39: [2, 19]
          },
          {
            5: [2, 23],
            6: [2, 23],
            7: [2, 23],
            8: [2, 23],
            9: [2, 23],
            10: [2, 23],
            11: [2, 23],
            12: [2, 23],
            13: [2, 23],
            16: [2, 23],
            17: [2, 23],
            18: [2, 23],
            19: [2, 23],
            21: [2, 23],
            23: [2, 23],
            29: [2, 23],
            30: [2, 23],
            31: [2, 23],
            33: [2, 23],
            34: [2, 23],
            35: [2, 23],
            36: [2, 23],
            37: [2, 23],
            38: [2, 23],
            39: [2, 23]
          },
          {
            1: [2, 1]
          },
          {
            4: 39,
            6: [1, 3],
            14: [1, 4],
            15: [1, 5],
            20: [1, 6],
            24: [1, 7],
            25: [1, 8],
            26: [1, 9],
            28: 10
          },
          {
            4: 40,
            6: [1, 3],
            14: [1, 4],
            15: [1, 5],
            20: [1, 6],
            24: [1, 7],
            25: [1, 8],
            26: [1, 9],
            28: 10
          },
          {
            4: 41,
            6: [1, 3],
            14: [1, 4],
            15: [1, 5],
            20: [1, 6],
            24: [1, 7],
            25: [1, 8],
            26: [1, 9],
            28: 10
          },
          {
            4: 42,
            6: [1, 3],
            14: [1, 4],
            15: [1, 5],
            20: [1, 6],
            24: [1, 7],
            25: [1, 8],
            26: [1, 9],
            28: 10
          },
          {
            4: 43,
            6: [1, 3],
            14: [1, 4],
            15: [1, 5],
            20: [1, 6],
            24: [1, 7],
            25: [1, 8],
            26: [1, 9],
            28: 10
          },
          {
            4: 44,
            6: [1, 3],
            14: [1, 4],
            15: [1, 5],
            20: [1, 6],
            24: [1, 7],
            25: [1, 8],
            26: [1, 9],
            28: 10
          },
          {
            4: 45,
            6: [1, 3],
            14: [1, 4],
            15: [1, 5],
            20: [1, 6],
            24: [1, 7],
            25: [1, 8],
            26: [1, 9],
            28: 10
          },
          {
            4: 46,
            6: [1, 3],
            14: [1, 4],
            15: [1, 5],
            20: [1, 6],
            24: [1, 7],
            25: [1, 8],
            26: [1, 9],
            28: 10
          },
          {
            4: 47,
            6: [1, 3],
            14: [1, 4],
            15: [1, 5],
            20: [1, 6],
            24: [1, 7],
            25: [1, 8],
            26: [1, 9],
            28: 10
          },
          {
            4: 48,
            6: [1, 3],
            14: [1, 4],
            15: [1, 5],
            20: [1, 6],
            24: [1, 7],
            25: [1, 8],
            26: [1, 9],
            28: 10
          },
          {
            4: 49,
            6: [1, 3],
            14: [1, 4],
            15: [1, 5],
            20: [1, 6],
            24: [1, 7],
            25: [1, 8],
            26: [1, 9],
            28: 10
          },
          {
            4: 50,
            6: [1, 3],
            14: [1, 4],
            15: [1, 5],
            20: [1, 6],
            24: [1, 7],
            25: [1, 8],
            26: [1, 9],
            28: 10
          },
          {
            4: 52,
            6: [1, 3],
            14: [1, 4],
            15: [1, 5],
            20: [1, 6],
            24: [1, 7],
            25: [1, 8],
            26: [1, 9],
            28: 51
          },
          {
            6: [2, 26],
            14: [2, 26],
            15: [2, 26],
            20: [2, 26],
            24: [2, 26],
            25: [2, 26],
            26: [2, 26]
          },
          {
            6: [2, 27],
            14: [2, 27],
            15: [2, 27],
            20: [2, 27],
            24: [2, 27],
            25: [2, 27],
            26: [2, 27]
          },
          {
            6: [2, 28],
            14: [2, 28],
            15: [2, 28],
            20: [2, 28],
            24: [2, 28],
            25: [2, 28],
            26: [2, 28]
          },
          {
            6: [2, 29],
            14: [2, 29],
            15: [2, 29],
            20: [2, 29],
            24: [2, 29],
            25: [2, 29],
            26: [2, 29]
          },
          {
            6: [2, 30],
            14: [2, 30],
            15: [2, 30],
            20: [2, 30],
            24: [2, 30],
            25: [2, 30],
            26: [2, 30]
          },
          {
            6: [2, 31],
            14: [2, 31],
            15: [2, 31],
            20: [2, 31],
            24: [2, 31],
            25: [2, 31],
            26: [2, 31]
          },
          {
            6: [2, 32],
            14: [2, 32],
            15: [2, 32],
            20: [2, 32],
            24: [2, 32],
            25: [2, 32],
            26: [2, 32]
          },
          {
            5: [2, 2],
            6: [2, 2],
            7: [2, 2],
            8: [2, 2],
            9: [2, 2],
            10: [1, 16],
            11: [2, 2],
            12: [2, 2],
            13: [2, 2],
            16: [2, 2],
            17: [2, 2],
            18: [2, 2],
            19: [2, 2],
            21: [2, 2],
            23: [2, 2],
            29: [2, 2],
            30: [2, 2],
            31: [2, 2],
            32: 24,
            33: [2, 2],
            34: [2, 2],
            35: [2, 2],
            36: [2, 2],
            37: [2, 2],
            38: [2, 2],
            39: [2, 2]
          },
          {
            5: [2, 11],
            6: [2, 11],
            7: [2, 11],
            8: [2, 11],
            9: [2, 11],
            10: [1, 16],
            11: [2, 11],
            12: [2, 11],
            13: [2, 11],
            16: [2, 11],
            17: [2, 11],
            18: [2, 11],
            19: [2, 11],
            21: [2, 11],
            23: [2, 11],
            29: [2, 11],
            30: [2, 11],
            31: [2, 11],
            32: 24,
            33: [2, 11],
            34: [2, 11],
            35: [2, 11],
            36: [2, 11],
            37: [2, 11],
            38: [2, 11],
            39: [2, 11]
          },
          {
            6: [1, 13],
            7: [1, 12],
            8: [1, 14],
            9: [1, 15],
            10: [1, 16],
            11: [1, 17],
            12: [1, 18],
            13: [1, 19],
            16: [1, 53],
            18: [1, 20],
            19: [1, 21],
            29: [1, 22],
            30: [1, 23],
            32: 24,
            33: [1, 25],
            34: [1, 26],
            35: [1, 27],
            36: [1, 28],
            37: [1, 29],
            38: [1, 30],
            39: [1, 31]
          },
          {
            6: [1, 13],
            7: [1, 12],
            8: [1, 14],
            9: [1, 15],
            10: [1, 16],
            11: [1, 17],
            12: [1, 18],
            13: [1, 19],
            18: [1, 20],
            19: [1, 21],
            21: [1, 54],
            23: [2, 35],
            29: [1, 22],
            30: [1, 23],
            32: 24,
            33: [1, 25],
            34: [1, 26],
            35: [1, 27],
            36: [1, 28],
            37: [1, 29],
            38: [1, 30],
            39: [1, 31]
          },
          {
            23: [1, 55]
          },
          {
            4: 56,
            6: [1, 3],
            14: [1, 4],
            15: [1, 5],
            20: [1, 6],
            24: [1, 7],
            25: [1, 8],
            26: [1, 9],
            28: 10
          },
          {
            4: 59,
            6: [1, 3],
            14: [1, 4],
            15: [1, 5],
            20: [1, 6],
            21: [1, 57],
            22: 58,
            24: [1, 7],
            25: [1, 8],
            26: [1, 9],
            28: 10
          },
          {
            5: [2, 3],
            6: [2, 3],
            7: [2, 3],
            8: [1, 14],
            9: [1, 15],
            10: [1, 16],
            11: [1, 17],
            12: [2, 3],
            13: [2, 3],
            16: [2, 3],
            17: [2, 3],
            18: [2, 3],
            19: [2, 3],
            21: [2, 3],
            23: [2, 3],
            29: [1, 22],
            30: [2, 3],
            31: [2, 3],
            32: 24,
            33: [2, 3],
            34: [2, 3],
            35: [2, 3],
            36: [2, 3],
            37: [2, 3],
            38: [2, 3],
            39: [2, 3]
          },
          {
            5: [2, 4],
            6: [2, 4],
            7: [2, 4],
            8: [1, 14],
            9: [1, 15],
            10: [1, 16],
            11: [1, 17],
            12: [2, 4],
            13: [2, 4],
            16: [2, 4],
            17: [2, 4],
            18: [2, 4],
            19: [2, 4],
            21: [2, 4],
            23: [2, 4],
            29: [1, 22],
            30: [2, 4],
            31: [2, 4],
            32: 24,
            33: [2, 4],
            34: [2, 4],
            35: [2, 4],
            36: [2, 4],
            37: [2, 4],
            38: [2, 4],
            39: [2, 4]
          },
          {
            5: [2, 5],
            6: [2, 5],
            7: [2, 5],
            8: [2, 5],
            9: [2, 5],
            10: [1, 16],
            11: [2, 5],
            12: [2, 5],
            13: [2, 5],
            16: [2, 5],
            17: [2, 5],
            18: [2, 5],
            19: [2, 5],
            21: [2, 5],
            23: [2, 5],
            29: [2, 5],
            30: [2, 5],
            31: [2, 5],
            32: 24,
            33: [2, 5],
            34: [2, 5],
            35: [2, 5],
            36: [2, 5],
            37: [2, 5],
            38: [2, 5],
            39: [2, 5]
          },
          {
            5: [2, 6],
            6: [2, 6],
            7: [2, 6],
            8: [2, 6],
            9: [2, 6],
            10: [1, 16],
            11: [2, 6],
            12: [2, 6],
            13: [2, 6],
            16: [2, 6],
            17: [2, 6],
            18: [2, 6],
            19: [2, 6],
            21: [2, 6],
            23: [2, 6],
            29: [2, 6],
            30: [2, 6],
            31: [2, 6],
            32: 24,
            33: [2, 6],
            34: [2, 6],
            35: [2, 6],
            36: [2, 6],
            37: [2, 6],
            38: [2, 6],
            39: [2, 6]
          },
          {
            5: [2, 7],
            6: [2, 7],
            7: [2, 7],
            8: [2, 7],
            9: [2, 7],
            10: [1, 16],
            11: [2, 7],
            12: [2, 7],
            13: [2, 7],
            16: [2, 7],
            17: [2, 7],
            18: [2, 7],
            19: [2, 7],
            21: [2, 7],
            23: [2, 7],
            29: [2, 7],
            30: [2, 7],
            31: [2, 7],
            32: 24,
            33: [2, 7],
            34: [2, 7],
            35: [2, 7],
            36: [2, 7],
            37: [2, 7],
            38: [2, 7],
            39: [2, 7]
          },
          {
            5: [2, 8],
            6: [2, 8],
            7: [2, 8],
            8: [2, 8],
            9: [2, 8],
            10: [1, 16],
            11: [2, 8],
            12: [2, 8],
            13: [2, 8],
            16: [2, 8],
            17: [2, 8],
            18: [2, 8],
            19: [2, 8],
            21: [2, 8],
            23: [2, 8],
            29: [2, 8],
            30: [2, 8],
            31: [2, 8],
            32: 24,
            33: [2, 8],
            34: [2, 8],
            35: [2, 8],
            36: [2, 8],
            37: [2, 8],
            38: [2, 8],
            39: [2, 8]
          },
          {
            5: [2, 9],
            6: [1, 13],
            7: [1, 12],
            8: [1, 14],
            9: [1, 15],
            10: [1, 16],
            11: [1, 17],
            12: [2, 9],
            13: [2, 9],
            16: [2, 9],
            17: [2, 9],
            18: [1, 20],
            19: [1, 21],
            21: [2, 9],
            23: [2, 9],
            29: [1, 22],
            30: [2, 9],
            31: [2, 9],
            32: 24,
            33: [1, 25],
            34: [1, 26],
            35: [1, 27],
            36: [1, 28],
            37: [1, 29],
            38: [1, 30],
            39: [1, 31]
          },
          {
            5: [2, 10],
            6: [1, 13],
            7: [1, 12],
            8: [1, 14],
            9: [1, 15],
            10: [1, 16],
            11: [1, 17],
            12: [1, 18],
            13: [2, 10],
            16: [2, 10],
            17: [2, 10],
            18: [1, 20],
            19: [1, 21],
            21: [2, 10],
            23: [2, 10],
            29: [1, 22],
            30: [2, 10],
            31: [2, 10],
            32: 24,
            33: [1, 25],
            34: [1, 26],
            35: [1, 27],
            36: [1, 28],
            37: [1, 29],
            38: [1, 30],
            39: [1, 31]
          },
          {
            5: [2, 13],
            6: [1, 13],
            7: [1, 12],
            8: [1, 14],
            9: [1, 15],
            10: [1, 16],
            11: [1, 17],
            12: [2, 13],
            13: [2, 13],
            16: [2, 13],
            17: [2, 13],
            18: [2, 13],
            19: [2, 13],
            21: [2, 13],
            23: [2, 13],
            29: [1, 22],
            30: [2, 13],
            31: [2, 13],
            32: 24,
            33: [1, 25],
            34: [1, 26],
            35: [1, 27],
            36: [1, 28],
            37: [1, 29],
            38: [1, 30],
            39: [1, 31]
          },
          {
            5: [2, 14],
            6: [1, 13],
            7: [1, 12],
            8: [1, 14],
            9: [1, 15],
            10: [1, 16],
            11: [1, 17],
            12: [2, 14],
            13: [2, 14],
            16: [2, 14],
            17: [2, 14],
            18: [2, 14],
            19: [2, 14],
            21: [2, 14],
            23: [2, 14],
            29: [1, 22],
            30: [2, 14],
            31: [2, 14],
            32: 24,
            33: [1, 25],
            34: [1, 26],
            35: [1, 27],
            36: [1, 28],
            37: [1, 29],
            38: [1, 30],
            39: [1, 31]
          },
          {
            5: [2, 24],
            6: [2, 24],
            7: [2, 24],
            8: [2, 24],
            9: [2, 24],
            10: [1, 16],
            11: [2, 24],
            12: [2, 24],
            13: [2, 24],
            16: [2, 24],
            17: [2, 24],
            18: [2, 24],
            19: [2, 24],
            21: [2, 24],
            23: [2, 24],
            29: [2, 24],
            30: [2, 24],
            31: [2, 24],
            32: 24,
            33: [2, 24],
            34: [2, 24],
            35: [2, 24],
            36: [2, 24],
            37: [2, 24],
            38: [2, 24],
            39: [2, 24]
          },
          {
            6: [1, 13],
            7: [1, 12],
            8: [1, 14],
            9: [1, 15],
            10: [1, 16],
            11: [1, 17],
            12: [1, 18],
            13: [1, 19],
            18: [1, 20],
            19: [1, 21],
            29: [1, 22],
            30: [1, 23],
            31: [1, 60],
            32: 24,
            33: [1, 25],
            34: [1, 26],
            35: [1, 27],
            36: [1, 28],
            37: [1, 29],
            38: [1, 30],
            39: [1, 31]
          },
          {
            5: [2, 33],
            6: [2, 33],
            7: [2, 33],
            8: [2, 33],
            9: [2, 33],
            10: [2, 33],
            11: [2, 33],
            12: [2, 33],
            13: [2, 33],
            16: [2, 33],
            17: [2, 33],
            18: [2, 33],
            19: [2, 33],
            21: [2, 33],
            23: [2, 33],
            29: [2, 33],
            30: [2, 33],
            31: [2, 33],
            33: [2, 33],
            34: [2, 33],
            35: [2, 33],
            36: [2, 33],
            37: [2, 33],
            38: [2, 33],
            39: [2, 33]
          },
          {
            5: [2, 34],
            6: [1, 13],
            7: [1, 12],
            8: [1, 14],
            9: [1, 15],
            10: [1, 16],
            11: [1, 17],
            12: [2, 34],
            13: [2, 34],
            16: [2, 34],
            17: [2, 34],
            18: [2, 34],
            19: [2, 34],
            21: [2, 34],
            23: [2, 34],
            29: [1, 22],
            30: [2, 34],
            31: [2, 34],
            32: 24,
            33: [1, 25],
            34: [1, 26],
            35: [1, 27],
            36: [1, 28],
            37: [1, 29],
            38: [1, 30],
            39: [1, 31]
          },
          {
            4: 61,
            6: [1, 3],
            14: [1, 4],
            15: [1, 5],
            20: [1, 6],
            24: [1, 7],
            25: [1, 8],
            26: [1, 9],
            28: 10
          },
          {
            5: [2, 15],
            6: [2, 15],
            7: [2, 15],
            8: [2, 15],
            9: [2, 15],
            10: [2, 15],
            11: [2, 15],
            12: [2, 15],
            13: [2, 15],
            16: [2, 15],
            17: [2, 15],
            18: [2, 15],
            19: [2, 15],
            21: [2, 15],
            23: [2, 15],
            29: [2, 15],
            30: [2, 15],
            31: [2, 15],
            33: [2, 15],
            34: [2, 15],
            35: [2, 15],
            36: [2, 15],
            37: [2, 15],
            38: [2, 15],
            39: [2, 15]
          },
          {
            4: 62,
            6: [1, 3],
            14: [1, 4],
            15: [1, 5],
            20: [1, 6],
            24: [1, 7],
            25: [1, 8],
            26: [1, 9],
            28: 10
          },
          {
            5: [2, 20],
            6: [2, 20],
            7: [2, 20],
            8: [2, 20],
            9: [2, 20],
            10: [2, 20],
            11: [2, 20],
            12: [2, 20],
            13: [2, 20],
            16: [2, 20],
            17: [2, 20],
            18: [2, 20],
            19: [2, 20],
            21: [2, 20],
            23: [2, 20],
            29: [2, 20],
            30: [2, 20],
            31: [2, 20],
            32: 24,
            33: [2, 20],
            34: [2, 20],
            35: [2, 20],
            36: [2, 20],
            37: [2, 20],
            38: [2, 20],
            39: [2, 20]
          },
          {
            5: [2, 21],
            6: [2, 21],
            7: [2, 21],
            8: [2, 21],
            9: [2, 21],
            10: [2, 21],
            11: [2, 21],
            12: [2, 21],
            13: [2, 21],
            16: [2, 21],
            17: [2, 21],
            18: [2, 21],
            19: [2, 21],
            21: [2, 21],
            23: [2, 21],
            29: [2, 21],
            30: [2, 21],
            31: [2, 21],
            33: [2, 21],
            34: [2, 21],
            35: [2, 21],
            36: [2, 21],
            37: [2, 21],
            38: [2, 21],
            39: [2, 21]
          },
          {
            21: [1, 63],
            23: [1, 64]
          },
          {
            6: [1, 13],
            7: [1, 12],
            8: [1, 14],
            9: [1, 15],
            10: [1, 16],
            11: [1, 17],
            12: [1, 18],
            13: [1, 19],
            18: [1, 20],
            19: [1, 21],
            21: [2, 35],
            23: [2, 35],
            29: [1, 22],
            30: [1, 23],
            32: 24,
            33: [1, 25],
            34: [1, 26],
            35: [1, 27],
            36: [1, 28],
            37: [1, 29],
            38: [1, 30],
            39: [1, 31]
          },
          {
            4: 65,
            6: [1, 3],
            14: [1, 4],
            15: [1, 5],
            20: [1, 6],
            24: [1, 7],
            25: [1, 8],
            26: [1, 9],
            28: 10
          },
          {
            6: [1, 13],
            7: [1, 12],
            8: [1, 14],
            9: [1, 15],
            10: [1, 16],
            11: [1, 17],
            12: [1, 18],
            13: [1, 19],
            17: [1, 66],
            18: [1, 20],
            19: [1, 21],
            29: [1, 22],
            30: [1, 23],
            32: 24,
            33: [1, 25],
            34: [1, 26],
            35: [1, 27],
            36: [1, 28],
            37: [1, 29],
            38: [1, 30],
            39: [1, 31]
          },
          {
            6: [1, 13],
            7: [1, 12],
            8: [1, 14],
            9: [1, 15],
            10: [1, 16],
            11: [1, 17],
            12: [1, 18],
            13: [1, 19],
            18: [1, 20],
            19: [1, 21],
            21: [1, 67],
            23: [2, 36],
            29: [1, 22],
            30: [1, 23],
            32: 24,
            33: [1, 25],
            34: [1, 26],
            35: [1, 27],
            36: [1, 28],
            37: [1, 29],
            38: [1, 30],
            39: [1, 31]
          },
          {
            5: [2, 22],
            6: [2, 22],
            7: [2, 22],
            8: [2, 22],
            9: [2, 22],
            10: [2, 22],
            11: [2, 22],
            12: [2, 22],
            13: [2, 22],
            16: [2, 22],
            17: [2, 22],
            18: [2, 22],
            19: [2, 22],
            21: [2, 22],
            23: [2, 22],
            29: [2, 22],
            30: [2, 22],
            31: [2, 22],
            33: [2, 22],
            34: [2, 22],
            35: [2, 22],
            36: [2, 22],
            37: [2, 22],
            38: [2, 22],
            39: [2, 22]
          },
          {
            4: 68,
            6: [1, 3],
            14: [1, 4],
            15: [1, 5],
            20: [1, 6],
            24: [1, 7],
            25: [1, 8],
            26: [1, 9],
            28: 10
          },
          {
            5: [2, 25],
            6: [1, 13],
            7: [1, 12],
            8: [1, 14],
            9: [1, 15],
            10: [1, 16],
            11: [1, 17],
            12: [1, 18],
            13: [1, 19],
            16: [2, 25],
            17: [2, 25],
            18: [1, 20],
            19: [1, 21],
            21: [2, 25],
            23: [2, 25],
            29: [1, 22],
            30: [1, 23],
            31: [2, 25],
            32: 24,
            33: [1, 25],
            34: [1, 26],
            35: [1, 27],
            36: [1, 28],
            37: [1, 29],
            38: [1, 30],
            39: [1, 31]
          },
          {
            4: 69,
            6: [1, 3],
            14: [1, 4],
            15: [1, 5],
            20: [1, 6],
            24: [1, 7],
            25: [1, 8],
            26: [1, 9],
            28: 10
          },
          {
            5: [2, 16],
            6: [2, 16],
            7: [2, 16],
            8: [2, 16],
            9: [2, 16],
            10: [2, 16],
            11: [2, 16],
            12: [2, 16],
            13: [2, 16],
            16: [2, 16],
            17: [2, 16],
            18: [2, 16],
            19: [2, 16],
            21: [2, 16],
            23: [2, 16],
            29: [2, 16],
            30: [2, 16],
            31: [2, 16],
            33: [2, 16],
            34: [2, 16],
            35: [2, 16],
            36: [2, 16],
            37: [2, 16],
            38: [2, 16],
            39: [2, 16]
          },
          {
            6: [1, 13],
            7: [1, 12],
            8: [1, 14],
            9: [1, 15],
            10: [1, 16],
            11: [1, 17],
            12: [1, 18],
            13: [1, 19],
            18: [1, 20],
            19: [1, 21],
            21: [2, 36],
            23: [2, 36],
            29: [1, 22],
            30: [1, 23],
            32: 24,
            33: [1, 25],
            34: [1, 26],
            35: [1, 27],
            36: [1, 28],
            37: [1, 29],
            38: [1, 30],
            39: [1, 31]
          },
          {
            5: [2, 12],
            6: [1, 13],
            7: [1, 12],
            8: [1, 14],
            9: [1, 15],
            10: [1, 16],
            11: [1, 17],
            12: [1, 18],
            13: [1, 19],
            16: [2, 12],
            17: [2, 12],
            18: [1, 20],
            19: [1, 21],
            21: [2, 12],
            23: [2, 12],
            29: [1, 22],
            30: [1, 23],
            31: [2, 12],
            32: 24,
            33: [1, 25],
            34: [1, 26],
            35: [1, 27],
            36: [1, 28],
            37: [1, 29],
            38: [1, 30],
            39: [1, 31]
          }
        ],
        defaultActions: {
          11: [2, 1]
        },
        parseError: function parseError(str2, hash2) {
          throw new Error(str2);
        },
        parse: function parse2(input2) {
          var self2 = this, stack2 = [0], vstack = [null], lstack = [], table2 = this.table, yytext = "", yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;
          this.lexer.setInput(input2);
          this.lexer.yy = this.yy;
          this.yy.lexer = this.lexer;
          this.yy.parser = this;
          if (typeof this.lexer.yylloc == "undefined") this.lexer.yylloc = {};
          var yyloc = this.lexer.yylloc;
          lstack.push(yyloc);
          var ranges = this.lexer.options && this.lexer.options.ranges;
          if (typeof this.yy.parseError === "function")
            this.parseError = this.yy.parseError;
          function popStack(n) {
            stack2.length = stack2.length - 2 * n;
            vstack.length = vstack.length - n;
            lstack.length = lstack.length - n;
          }
          function lex2() {
            var token2;
            token2 = self2.lexer.lex() || 1;
            if (typeof token2 !== "number") {
              token2 = self2.symbols_[token2] || token2;
            }
            return token2;
          }
          var symbol, preErrorSymbol, state, action, r2, yyval = {}, p, len, newState, expected;
          while (true) {
            state = stack2[stack2.length - 1];
            if (this.defaultActions[state]) {
              action = this.defaultActions[state];
            } else {
              if (symbol === null || typeof symbol == "undefined") {
                symbol = lex2();
              }
              action = table2[state] && table2[state][symbol];
            }
            if (typeof action === "undefined" || !action.length || !action[0]) {
              var errStr = "";
              if (!recovering) {
                expected = [];
                for (p in table2[state])
                  if (this.terminals_[p] && p > 2) {
                    expected.push("'" + this.terminals_[p] + "'");
                  }
                if (this.lexer.showPosition) {
                  errStr = "Parse error on line " + (yylineno + 1) + ":\n" + this.lexer.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'";
                } else {
                  errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == 1 ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'");
                }
                this.parseError(errStr, {
                  text: this.lexer.match,
                  token: this.terminals_[symbol] || symbol,
                  line: this.lexer.yylineno,
                  loc: yyloc,
                  expected
                });
              }
              if (recovering == 3) {
                if (symbol == EOF) {
                  throw new Error(errStr || "Parsing halted.");
                }
                yyleng = this.lexer.yyleng;
                yytext = this.lexer.yytext;
                yylineno = this.lexer.yylineno;
                yyloc = this.lexer.yylloc;
                symbol = lex2();
              }
              while (1) {
                if (TERROR.toString() in table2[state]) {
                  break;
                }
                if (state === 0) {
                  throw new Error(errStr || "Parsing halted.");
                }
                popStack(1);
                state = stack2[stack2.length - 1];
              }
              preErrorSymbol = symbol == 2 ? null : symbol;
              symbol = TERROR;
              state = stack2[stack2.length - 1];
              action = table2[state] && table2[state][TERROR];
              recovering = 3;
            }
            if (action[0] instanceof Array && action.length > 1) {
              throw new Error(
                "Parse Error: multiple actions possible at state: " + state + ", token: " + symbol
              );
            }
            switch (action[0]) {
              case 1:
                stack2.push(symbol);
                vstack.push(this.lexer.yytext);
                lstack.push(this.lexer.yylloc);
                stack2.push(action[1]);
                symbol = null;
                if (!preErrorSymbol) {
                  yyleng = this.lexer.yyleng;
                  yytext = this.lexer.yytext;
                  yylineno = this.lexer.yylineno;
                  yyloc = this.lexer.yylloc;
                  if (recovering > 0) recovering--;
                } else {
                  symbol = preErrorSymbol;
                  preErrorSymbol = null;
                }
                break;
              case 2:
                len = this.productions_[action[1]][1];
                yyval.$ = vstack[vstack.length - len];
                yyval._$ = {
                  first_line: lstack[lstack.length - (len || 1)].first_line,
                  last_line: lstack[lstack.length - 1].last_line,
                  first_column: lstack[lstack.length - (len || 1)].first_column,
                  last_column: lstack[lstack.length - 1].last_column
                };
                if (ranges) {
                  yyval._$.range = [
                    lstack[lstack.length - (len || 1)].range[0],
                    lstack[lstack.length - 1].range[1]
                  ];
                }
                r2 = this.performAction.call(
                  yyval,
                  yytext,
                  yyleng,
                  yylineno,
                  this.yy,
                  action[1],
                  vstack,
                  lstack
                );
                if (typeof r2 !== "undefined") {
                  return r2;
                }
                if (len) {
                  stack2 = stack2.slice(0, -1 * len * 2);
                  vstack = vstack.slice(0, -1 * len);
                  lstack = lstack.slice(0, -1 * len);
                }
                stack2.push(this.productions_[action[1]][0]);
                vstack.push(yyval.$);
                lstack.push(yyval._$);
                newState = table2[stack2[stack2.length - 2]][stack2[stack2.length - 1]];
                stack2.push(newState);
                break;
              case 3:
                return true;
            }
          }
          return true;
        }
      };
      var lexer2 = (function() {
        var lexer3 = {
          EOF: 1,
          parseError: function parseError(str2, hash2) {
            if (this.yy.parser) {
              this.yy.parser.parseError(str2, hash2);
            } else {
              throw new Error(str2);
            }
          },
          setInput: function(input2) {
            this._input = input2;
            this._more = this._less = this.done = false;
            this.yylineno = this.yyleng = 0;
            this.yytext = this.matched = this.match = "";
            this.conditionStack = ["INITIAL"];
            this.yylloc = {
              first_line: 1,
              first_column: 0,
              last_line: 1,
              last_column: 0
            };
            if (this.options.ranges) this.yylloc.range = [0, 0];
            this.offset = 0;
            return this;
          },
          input: function() {
            var ch3 = this._input[0];
            this.yytext += ch3;
            this.yyleng++;
            this.offset++;
            this.match += ch3;
            this.matched += ch3;
            var lines = ch3.match(/(?:\r\n?|\n).*/g);
            if (lines) {
              this.yylineno++;
              this.yylloc.last_line++;
            } else {
              this.yylloc.last_column++;
            }
            if (this.options.ranges) this.yylloc.range[1]++;
            this._input = this._input.slice(1);
            return ch3;
          },
          unput: function(ch3) {
            var len = ch3.length;
            var lines = ch3.split(/(?:\r\n?|\n)/g);
            this._input = ch3 + this._input;
            this.yytext = this.yytext.substr(0, this.yytext.length - len - 1);
            this.offset -= len;
            var oldLines = this.match.split(/(?:\r\n?|\n)/g);
            this.match = this.match.substr(0, this.match.length - 1);
            this.matched = this.matched.substr(0, this.matched.length - 1);
            if (lines.length - 1) this.yylineno -= lines.length - 1;
            var r2 = this.yylloc.range;
            this.yylloc = {
              first_line: this.yylloc.first_line,
              last_line: this.yylineno + 1,
              first_column: this.yylloc.first_column,
              last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len
            };
            if (this.options.ranges) {
              this.yylloc.range = [r2[0], r2[0] + this.yyleng - len];
            }
            return this;
          },
          more: function() {
            this._more = true;
            return this;
          },
          less: function(n) {
            this.unput(this.match.slice(n));
          },
          pastInput: function() {
            var past = this.matched.substr(
              0,
              this.matched.length - this.match.length
            );
            return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, "");
          },
          upcomingInput: function() {
            var next = this.match;
            if (next.length < 20) {
              next += this._input.substr(0, 20 - next.length);
            }
            return (next.substr(0, 20) + (next.length > 20 ? "..." : "")).replace(
              /\n/g,
              ""
            );
          },
          showPosition: function() {
            var pre2 = this.pastInput();
            var c2 = new Array(pre2.length + 1).join("-");
            return pre2 + this.upcomingInput() + "\n" + c2 + "^";
          },
          next: function() {
            if (this.done) {
              return this.EOF;
            }
            if (!this._input) this.done = true;
            var token2, match, tempMatch, index, lines;
            if (!this._more) {
              this.yytext = "";
              this.match = "";
            }
            var rules = this._currentRules();
            for (var i2 = 0; i2 < rules.length; i2++) {
              tempMatch = this._input.match(this.rules[rules[i2]]);
              if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
                match = tempMatch;
                index = i2;
                if (!this.options.flex) break;
              }
            }
            if (match) {
              lines = match[0].match(/(?:\r\n?|\n).*/g);
              if (lines) this.yylineno += lines.length;
              this.yylloc = {
                first_line: this.yylloc.last_line,
                last_line: this.yylineno + 1,
                first_column: this.yylloc.last_column,
                last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length
              };
              this.yytext += match[0];
              this.match += match[0];
              this.matches = match;
              this.yyleng = this.yytext.length;
              if (this.options.ranges) {
                this.yylloc.range = [this.offset, this.offset += this.yyleng];
              }
              this._more = false;
              this._input = this._input.slice(match[0].length);
              this.matched += match[0];
              token2 = this.performAction.call(
                this,
                this.yy,
                this,
                rules[index],
                this.conditionStack[this.conditionStack.length - 1]
              );
              if (this.done && this._input) this.done = false;
              if (token2) return token2;
              else return;
            }
            if (this._input === "") {
              return this.EOF;
            } else {
              return this.parseError(
                "Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(),
                {
                  text: "",
                  token: null,
                  line: this.yylineno
                }
              );
            }
          },
          lex: function lex2() {
            var r2 = this.next();
            if (typeof r2 !== "undefined") {
              return r2;
            } else {
              return this.lex();
            }
          },
          begin: function begin(condition) {
            this.conditionStack.push(condition);
          },
          popState: function popState() {
            return this.conditionStack.pop();
          },
          _currentRules: function _currentRules() {
            return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
          },
          topState: function() {
            return this.conditionStack[this.conditionStack.length - 2];
          },
          pushState: function begin(condition) {
            this.begin(condition);
          }
        };
        lexer3.options = {};
        lexer3.performAction = function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {
          switch ($avoiding_name_collisions) {
            case 0:
              return "*";
            case 1:
              return "/";
            case 2:
              return "-";
            case 3:
              return "+";
            case 4:
              return "^";
            case 5:
              return "(";
            case 6:
              return ")";
            case 7:
              return ",";
            case 8:
              return "==";
            case 9:
              return "!=";
            case 10:
              return "~=";
            case 11:
              return ">=";
            case 12:
              return "<=";
            case 13:
              return "<";
            case 14:
              return ">";
            case 15:
              return "notIn";
            case 16:
              return "and";
            case 17:
              return "or";
            case 18:
              return "not";
            case 19:
              return "in";
            case 20:
              return "of";
            case 21:
              return "if";
            case 22:
              return "then";
            case 23:
              return "else";
            case 24:
              return "mod";
            case 25:
              break;
            case 26:
              return "Number";
            case 27:
              yy_.yytext = JSON.stringify({
                name: yy_.yytext,
                type: "unescaped"
              });
              return "Symbol";
            case 28:
              yy_.yytext = JSON.stringify({
                name: yy.buildString("'", yy_.yytext),
                type: "single-quoted"
              });
              return "Symbol";
            case 29:
              yy_.yytext = JSON.stringify(yy.buildString('"', yy_.yytext));
              return "String";
            case 30:
              return "%";
            case 31:
              return "?";
            case 32:
              return ":";
            case 33:
              return "EndOfExpression";
          }
        };
        lexer3.rules = [
          /^(?:\*)/,
          /^(?:\/)/,
          /^(?:-)/,
          /^(?:\+)/,
          /^(?:\^)/,
          /^(?:\()/,
          /^(?:\))/,
          /^(?:\,)/,
          /^(?:==)/,
          /^(?:\!=)/,
          /^(?:\~=)/,
          /^(?:>=)/,
          /^(?:<=)/,
          /^(?:<)/,
          /^(?:>)/,
          /^(?:not\s+in[^\w])/,
          /^(?:and[^\w])/,
          /^(?:or[^\w])/,
          /^(?:not[^\w])/,
          /^(?:in[^\w])/,
          /^(?:of[^\w])/,
          /^(?:if[^\w])/,
          /^(?:then[^\w])/,
          /^(?:else[^\w])/,
          /^(?:mod[^\w])/,
          /^(?:\s+)/,
          /^(?:[0-9]+(?:\.[0-9]+)?(?![0-9\.]))/,
          /^(?:[a-zA-Z$_][\.a-zA-Z0-9$_]*)/,
          /^(?:'(?:\\'|\\\\|[^'\\])*')/,
          /^(?:"(?:\\"|\\\\|[^"\\])*")/,
          /^(?:\%)/,
          /^(?:\?)/,
          /^(?::)/,
          /^(?:$)/
        ];
        lexer3.conditions = {
          INITIAL: {
            rules: [
              0,
              1,
              2,
              3,
              4,
              5,
              6,
              7,
              8,
              9,
              10,
              11,
              12,
              13,
              14,
              15,
              16,
              17,
              18,
              19,
              20,
              21,
              22,
              23,
              24,
              25,
              26,
              27,
              28,
              29,
              30,
              31,
              32,
              33
            ],
            inclusive: true
          }
        };
        return lexer3;
      })();
      parser2.lexer = lexer2;
      function Parser2() {
        this.yy = {};
      }
      Parser2.prototype = parser2;
      parser2.Parser = Parser2;
      return new Parser2();
    })();
    const parser = _parser;
    _parser.Parser;
    class UnknownFunctionError extends ReferenceError {
      I18N_STRING = "UNKNOWN_FUNCTION";
      constructor(funcName) {
        super(`Unknown function: ${funcName}()`);
        this.functionName = funcName;
      }
    }
    class UnknownPropertyError extends ReferenceError {
      I18N_STRING = "UNKNOWN_PROPERTY";
      constructor(propName) {
        super(`Property “${propName}” does not exist.`);
        this.propertyName = propName;
      }
    }
    class UnknownOptionError extends TypeError {
      I18N_STRING = "UNKNOWN_OPTION";
      constructor(key2) {
        super(`Unknown option: ${key2}`);
        this.keyName = key2;
      }
    }
    class UnexpectedTypeError extends TypeError {
      I18N_STRING = "UNEXPECTED_TYPE";
      constructor(expected, got) {
        super(`Expected a ${expected}, but got a ${got} instead.`);
        this.expectedType = expected;
        this.recievedType = got;
      }
    }
    class InternalError extends Error {
      I18N_STRING = "INTERNAL";
      constructor(message2) {
        super(message2);
      }
    }
    function hasOwnProperty(obj, prop2) {
      if (typeof obj === "object" || typeof obj === "function") {
        return Object.prototype.hasOwnProperty.call(obj, prop2);
      }
      return false;
    }
    function mod$1(a, b) {
      return (a % b + b) % b;
    }
    function unbox(value2) {
      if (typeof value2 !== "object") return value2;
      if (value2 instanceof Number || value2 instanceof String || value2 instanceof Boolean)
        return value2.valueOf();
    }
    function unwrap$1(value2) {
      if (Array.isArray(value2) && value2.length === 1) value2 = value2[0];
      return unbox(value2);
    }
    function prettyType(value2) {
      value2 = unwrap$1(value2);
      if (value2 === void 0) return "undefined";
      if (value2 === null) return "null";
      if (value2 === true) return "true";
      if (value2 === false) return "false";
      if (typeof value2 === "number") return "number";
      if (typeof value2 === "string") return "text";
      if (typeof value2 !== "object" && typeof value2 !== "function")
        return "unknown type";
      if (Array.isArray(value2)) return "list";
      return "object";
    }
    function num(value2) {
      value2 = unwrap$1(value2);
      if (typeof value2 === "number") return value2;
      throw new UnexpectedTypeError("number", prettyType(value2));
    }
    function str(value2) {
      value2 = unwrap$1(value2);
      if (typeof value2 === "string") return value2;
      throw new UnexpectedTypeError("text", prettyType(value2));
    }
    function numstr(value2) {
      value2 = unwrap$1(value2);
      if (typeof value2 === "string" || typeof value2 === "number") return value2;
      throw new UnexpectedTypeError("text or number", prettyType(value2));
    }
    function bool(value2) {
      value2 = unwrap$1(value2);
      if (typeof value2 === "boolean") return value2;
      throw new UnexpectedTypeError(
        "logical value (“true” or “false”)",
        prettyType(value2)
      );
    }
    function arr(value2) {
      if (value2 === void 0 || value2 === null) {
        throw new UnexpectedTypeError("list", prettyType(value2));
      }
      if (Array.isArray(value2)) {
        return value2;
      } else {
        return [value2];
      }
    }
    function flatten$1(input2) {
      const stack2 = [...input2];
      const res = [];
      while (stack2.length) {
        const next = stack2.pop();
        if (Array.isArray(next)) {
          stack2.push(...next);
        } else {
          res.push(next);
        }
      }
      return res.reverse();
    }
    const std = {
      isfn(fns, funcName) {
        return hasOwnProperty(fns, funcName) && typeof fns[funcName] === "function";
      },
      unknown(funcName) {
        throw new UnknownFunctionError(funcName);
      },
      coerceArray: arr,
      coerceNumber: num,
      coerceNumberOrString: numstr,
      coerceBoolean: bool,
      isSubset(a, b) {
        const A2 = arr(a);
        const B = arr(b);
        return A2.every((val) => B.includes(val));
      },
      warnDeprecated: /* @__PURE__ */ (function() {
        const warnMax = 3;
        let warnedTimes = {
          ternary: 0,
          modulo: 0
        };
        return (cause, value2) => {
          switch (cause) {
            case "ternary":
              if (warnedTimes.ternary++ >= warnMax) break;
              console.warn(
                "The use of ? and : as conditional operators has been deprecated in Filtrex v3 in favor of the if..then..else ternary operator. See issue #34 for more information."
              );
              break;
            case "modulo":
              if (warnedTimes.modulo++ >= warnMax) break;
              console.warn(
                "The use of '%' as a modulo operator has been deprecated in Filtrex v3 in favor of the 'mod' operator. You can use it like this: '3 mod 2 == 1'. See issue #48 for more information."
              );
              break;
          }
          return value2;
        };
      })(),
      buildString(quote2, literal2) {
        quote2 = String(quote2)[0];
        literal2 = String(literal2);
        let built = "";
        if (literal2[0] !== quote2 || literal2[literal2.length - 1] !== quote2)
          throw new InternalError(
            `Unexpected internal error: String literal doesn't begin/end with the right quotation mark.`
          );
        for (let i2 = 1; i2 < literal2.length - 1; i2++) {
          if (literal2[i2] === "\\") {
            i2++;
            if (i2 >= literal2.length - 1)
              throw new InternalError(
                `Unexpected internal error: Unescaped backslash at the end of string literal.`
              );
            if (literal2[i2] === "\\") built += "\\";
            else if (literal2[i2] === quote2) built += quote2;
            else
              throw new InternalError(
                `Unexpected internal error: Invalid escaped character in string literal: ${literal2[i2]}`
              );
          } else if (literal2[i2] === quote2) {
            throw new InternalError(
              `Unexpected internal error: String literal contains unescaped quotation mark.`
            );
          } else {
            built += literal2[i2];
          }
        }
        return built;
      },
      reduceRelation(arr2) {
        const declarations = [];
        const comparisons = [];
        let previousExpression = flatten$1([arr2[0]]).join("");
        let j = 0;
        for (let i2 = 1; i2 < arr2.length - 1; i2 += 2) {
          const expr = flatten$1([arr2[i2 + 1]]).join("");
          const tempVar = `tmp${j++}`;
          comparisons.push(
            `ops["${arr2[i2]}"](${previousExpression}, ${tempVar} = ${expr})`
          );
          previousExpression = tempVar;
          declarations.push(tempVar);
        }
        return `(function(){ var ${declarations.join(", ")}; return ${comparisons.join(" && ")};})()`;
      }
    };
    parser.yy = Object.create(std);
    function compileExpression(expression, options2) {
      if (arguments.length > 2) throw new TypeError("Too many arguments.");
      options2 = typeof options2 === "object" ? options2 : {};
      const knownOptions = [
        "extraFunctions",
        "constants",
        "customProp",
        "operators"
      ];
      let { extraFunctions, constants, customProp, operators } = options2;
      for (const key2 of Object.keys(options2))
        if (!knownOptions.includes(key2)) throw new UnknownOptionError(key2);
      let functions = {
        abs: Math.abs,
        ceil: Math.ceil,
        floor: Math.floor,
        log: Math.log,
        log2: Math.log2,
        log10: Math.log10,
        max: Math.max,
        min: Math.min,
        round: Math.round,
        sqrt: Math.sqrt,
        exists: (v) => v !== void 0 && v !== null,
        empty: (v) => v === void 0 || v === null || v === "" || Array.isArray(v) && v.length === 0
      };
      if (extraFunctions) {
        for (const name2 of Object.keys(extraFunctions)) {
          functions[name2] = extraFunctions[name2];
        }
      }
      let defaultOperators = {
        "+": (a, b) => numstr(a) + numstr(b),
        "-": (a, b) => b === void 0 ? -num(a) : num(a) - num(b),
        "*": (a, b) => num(a) * num(b),
        "/": (a, b) => num(a) / num(b),
        "^": (a, b) => Math.pow(num(a), num(b)),
        mod: (a, b) => mod$1(num(a), num(b)),
        "==": (a, b) => a === b,
        "!=": (a, b) => a !== b,
        "<": (a, b) => num(a) < num(b),
        "<=": (a, b) => num(a) <= num(b),
        ">=": (a, b) => num(a) >= num(b),
        ">": (a, b) => num(a) > num(b),
        "~=": (a, b) => RegExp(str(b)).test(str(a))
      };
      if (operators) {
        for (const name2 of Object.keys(operators)) {
          defaultOperators[name2] = operators[name2];
        }
      }
      operators = defaultOperators;
      constants = constants ?? {};
      let js = flatten$1(parser.parse(expression));
      js.unshift("return ");
      js.push(";");
      function nakedProp(name2, obj, type) {
        if (hasOwnProperty(obj ?? {}, name2)) return obj[name2];
        throw new UnknownPropertyError(name2);
      }
      function safeGetter(obj) {
        return function get2(name2) {
          if (hasOwnProperty(obj ?? {}, name2)) return obj[name2];
          throw new UnknownPropertyError(name2);
        };
      }
      if (typeof customProp === "function") {
        nakedProp = (name2, obj, type) => customProp(name2, safeGetter(obj), obj, type);
      }
      function createCall(fns) {
        return function call(_ref) {
          let { name: name2 } = _ref;
          for (var _len = arguments.length, args2 = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
            args2[_key - 1] = arguments[_key];
          }
          if (hasOwnProperty(fns, name2) && typeof fns[name2] === "function")
            return fns[name2](...args2);
          throw new UnknownFunctionError(name2);
        };
      }
      function prop2(_ref2, obj) {
        let { name: name2, type } = _ref2;
        if (type === "unescaped" && hasOwnProperty(constants, name2))
          return constants[name2];
        return nakedProp(name2, obj, type);
      }
      let func = new Function("call", "ops", "std", "prop", "data", js.join(""));
      return function(data) {
        try {
          return func(createCall(functions), operators, std, prop2, data);
        } catch (e) {
          return e;
        }
      };
    }
    const kSampleIdVariable = "id";
    const kSampleMetadataVariable = "metadata";
    const kSampleMetadataPrefix = kSampleMetadataVariable + ".";
    const KEYWORDS = ["and", "or", "not", "in", "not in", "mod"];
    const MATH_FUNCTIONS = [
      ["min", "Minimum of two or more values"],
      ["max", "Maximum of two or more values"],
      ["abs", "Absolute value"],
      ["round", "Round to the nearest integer"],
      ["floor", "Round down to the nearest integer"],
      ["ceil", "Round up to the nearest integer"],
      ["sqrt", "Square root"],
      ["log", "Natural logarithm"],
      ["log2", "Base 2 logarithm"],
      ["log10", "Base 10 logarithm"]
    ];
    const SAMPLE_VARIABLES = [
      ["has_error", "Checks if the sample has an error"],
      ["has_retries", "Checks if the sample has been retried"],
      [kSampleIdVariable, "The unique identifier of the sample"],
      [kSampleMetadataVariable, "Metadata associated with the sample"]
    ];
    const SAMPLE_FUNCTIONS = [
      ["input_contains", "Checks if input contains a regular expression"],
      ["target_contains", "Checks if target contains a regular expression"],
      ["error_contains", "Checks if error contains a regular expression"]
    ];
    const coerceValue = (value2, descriptor) => {
      if (descriptor && descriptor.scoreType === kScoreTypeBoolean) {
        return Boolean(value2);
      } else {
        return value2;
      }
    };
    const isFilteringSupportedForValue = (value2) => ["string", "number", "boolean"].includes(typeof value2) || value2 === null;
    const bannedShortScoreNames = (scores2) => {
      const used = /* @__PURE__ */ new Set();
      const banned = /* @__PURE__ */ new Set();
      for (const { scorer: scorer2, name: name2 } of scores2) {
        banned.add(scorer2);
        if (used.has(name2)) {
          banned.add(name2);
        } else {
          used.add(name2);
        }
      }
      return banned;
    };
    const filterExpressionConstants = {
      True: true,
      False: false,
      None: null
    };
    const scoreVariables = (evalDescriptor, sampleScores) => {
      const bannedShortNames = bannedShortScoreNames(evalDescriptor.scores);
      const variables = {};
      const addScore = (variableName, scoreLabel, value2) => {
        const coercedValue = coerceValue(
          value2,
          evalDescriptor.scoreDescriptor(scoreLabel)
        );
        if (isFilteringSupportedForValue(coercedValue)) {
          variables[variableName] = coercedValue;
        }
      };
      for (const [scorer2, score2] of Object.entries(sampleScores || {})) {
        addScore(scorer2, { scorer: scorer2, name: scorer2 }, score2.value);
        if (typeof score2.value === "object") {
          for (const [name2, value2] of Object.entries(score2.value)) {
            addScore(`${scorer2}.${name2}`, { scorer: scorer2, name: name2 }, value2);
            if (!bannedShortNames.has(name2)) {
              addScore(name2, { scorer: scorer2, name: name2 }, value2);
            }
          }
        }
      }
      return variables;
    };
    const getNestedPropertyValue = (obj, path) => {
      const keys = path.split(".");
      let current2 = obj;
      for (const key2 of keys) {
        if (current2 && typeof current2 === "object" && key2 in current2) {
          current2 = current2[key2];
        } else {
          return void 0;
        }
      }
      return current2;
    };
    const sampleVariables = (sample2) => {
      return {
        has_error: !!sample2.error,
        has_retries: sample2.retries !== void 0 && sample2.retries > 0,
        id: sample2.id,
        metadata: sample2.metadata
      };
    };
    const sampleFilterItems = (evalDescriptor) => {
      const items = [];
      const bannedShortNames = bannedShortScoreNames(evalDescriptor.scores);
      const valueToString = (value2) => typeof value2 === "string" ? `"${value2}"` : String(value2);
      const addScore = (scoreLabel, shortName, qualifiedName) => {
        const canonicalName = shortName || qualifiedName;
        if (!canonicalName) {
          throw new Error("Unable to create a canonical name for a score");
        }
        const descriptor = evalDescriptor.scoreDescriptor(scoreLabel);
        if (descriptor.filterable === false) {
          return;
        }
        const scoreType = descriptor?.scoreType;
        if (!descriptor) {
          items.push({
            shortName,
            qualifiedName,
            canonicalName,
            tooltip: void 0,
            categories: [],
            scoreType
          });
          return;
        }
        var tooltip = `${canonicalName}: ${descriptor.scoreType}`;
        var categories = [];
        if (descriptor.min !== void 0 || descriptor.max !== void 0) {
          const rounded = (num2) => {
            return parseFloat(num2.toPrecision(3)).toString();
          };
          tooltip += `
range: ${rounded(descriptor.min || 0)} to ${rounded(descriptor.max || 0)}`;
        }
        if (descriptor.categories) {
          categories = descriptor.categories.map((cat) => {
            const val = cat.val;
            return valueToString(val);
          });
          tooltip += `
categories: ${categories.join(" ")}`;
        }
        items.push({
          shortName,
          qualifiedName,
          canonicalName,
          tooltip,
          categories,
          scoreType
        });
      };
      for (const { name: name2, scorer: scorer2 } of evalDescriptor.scores) {
        const hasShortName = name2 === scorer2 || !bannedShortNames.has(name2);
        const hasQualifiedName = name2 !== scorer2;
        const shortName = hasShortName ? name2 : void 0;
        const qualifiedName = hasQualifiedName ? `${scorer2}.${name2}` : void 0;
        addScore({ name: name2, scorer: scorer2 }, shortName, qualifiedName);
      }
      return items;
    };
    const filterExpression = (evalDescriptor, sample2, filterValue) => {
      try {
        const inputContains = (regex2) => {
          return inputString(sample2.input).some(
            (msg) => msg.match(new RegExp(regex2, "i"))
          );
        };
        const targetContains = (regex2) => {
          let targets = Array.isArray(sample2.target) ? sample2.target : [sample2.target];
          return targets.some((target2) => target2.match(new RegExp(regex2, "i")));
        };
        const errorContains = (regex2) => {
          return !!sample2.error?.match(new RegExp(regex2, "i"));
        };
        const extraFunctions = {
          input_contains: inputContains,
          target_contains: targetContains,
          error_contains: errorContains
        };
        const mySampleVariables = sampleVariables(sample2);
        const vars = {
          ...mySampleVariables,
          ...scoreVariables(evalDescriptor, sample2.scores)
        };
        const resolveVariable = (name2, get2) => {
          if (name2 in mySampleVariables) {
            const value2 = get2(name2);
            return value2;
          }
          if (name2.startsWith(kSampleMetadataPrefix)) {
            const propertyPath = name2.substring(kSampleMetadataPrefix.length);
            const metadata2 = sample2.metadata || {};
            return getNestedPropertyValue(metadata2, propertyPath);
          }
          return sample2.error ? void 0 : get2(name2);
        };
        const expression = compileExpression(filterValue, {
          extraFunctions,
          constants: filterExpressionConstants,
          customProp: resolveVariable
        });
        const result2 = expression(vars);
        if (typeof result2 === "boolean") {
          return { matches: result2, error: void 0 };
        } else if (result2 instanceof Error) {
          throw result2;
        } else {
          throw new TypeError(
            `Filter expression returned a non-boolean value: ${result2}`
          );
        }
      } catch (error2) {
        if (error2 instanceof ReferenceError) {
          const errorObj = error2;
          const propertyName2 = errorObj["propertyName"] || "";
          if (propertyName2) {
            if (propertyName2.startsWith(kSampleMetadataPrefix)) {
              return { matches: false, error: void 0 };
            }
            const regex2 = new RegExp(`\\b${propertyName2}\\b`);
            const match = regex2.exec(filterValue);
            if (match) {
              return {
                matches: false,
                error: {
                  from: match.index,
                  to: match.index + propertyName2.length,
                  message: error2.message,
                  severity: "warning"
                }
              };
            }
          }
        }
        const message2 = error2 instanceof Error ? error2.message : "";
        if (message2.startsWith("Parse error") || message2.startsWith("Lexical error")) {
          const from = message2.match(/^(-*)\^$/m)?.[1]?.length;
          return {
            matches: false,
            error: {
              from,
              message: "Syntax error",
              severity: "error"
            }
          };
        }
        return {
          matches: false,
          error: {
            message: message2,
            severity: "error"
          }
        };
      }
    };
    const filterSamples = (evalDescriptor, samples, filterValue) => {
      let error2 = void 0;
      let errorCount = 0;
      const result2 = samples.filter((sample2) => {
        if (filterValue) {
          const { matches, error: sampleError } = filterExpression(
            evalDescriptor,
            sample2,
            filterValue
          );
          error2 ||= sampleError;
          if (sampleError) {
            errorCount++;
          }
          return matches;
        } else {
          return true;
        }
      });
      return { result: result2, error: error2, allErrors: errorCount === samples.length };
    };
    const flex = "_flex_1kye9_1";
    const label$a = "_label_1kye9_5";
    const styles$1m = {
      flex,
      label: label$a
    };
    const SortFilter = ({ sort: sort2, setSort, epochs }) => {
      const options2 = [
        { label: "sample asc", val: kSampleAscVal },
        { label: "sample desc", val: kSampleDescVal }
      ];
      if (epochs > 1) {
        options2.push({
          label: "epoch asc",
          val: kEpochAscVal
        });
        options2.push({
          label: "epoch desc",
          val: kEpochDescVal
        });
      }
      options2.push({
        label: "score asc",
        val: kScoreAscVal
      });
      options2.push({
        label: "score desc",
        val: kScoreDescVal
      });
      const handleChange = reactExports.useCallback(
        (e) => {
          const sel = e.target;
          setSort(sel.value);
        },
        [setSort]
      );
      return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$1m.flex, children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          "span",
          {
            className: clsx(
              "sort-filter-label",
              "text-size-smaller",
              "text-style-label",
              "text-style-secondary",
              styles$1m.label
            ),
            children: "Sort:"
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          "select",
          {
            className: clsx("form-select", "form-select-sm", "text-size-smaller"),
            "aria-label": ".sort-filter-label",
            value: sort2,
            onChange: handleChange,
            children: options2.map((option) => {
              return /* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: option.val, children: option.label }, option.val);
            })
          }
        )
      ] });
    };
    const byEpoch = (sort2) => {
      return sort2 === kEpochAscVal || sort2 === kEpochDescVal;
    };
    const bySample = (sort2) => {
      return sort2 === kSampleAscVal || sort2 === kSampleDescVal;
    };
    const sortId = (a, b) => {
      if (isNumeric$1(a.id) && isNumeric$1(b.id)) {
        return Number(a.id) - Number(b.id);
      } else {
        return String(a.id).localeCompare(String(b.id));
      }
    };
    const sortSamples = (sort2, samples, samplesDescriptor, scores2) => {
      const scoreDescriptors = scores2.map((score2) => samplesDescriptor.evalDescriptor.scoreDescriptor(score2)).filter((scoreDescriptor) => scoreDescriptor !== void 0);
      const sortedSamples = samples.sort((a, b) => {
        const aScores = scores2.map((score2) => samplesDescriptor.evalDescriptor.score(a, score2)).filter((score2) => score2 !== void 0);
        const bScores = scores2.map((score2) => samplesDescriptor.evalDescriptor.score(b, score2)).filter((score2) => score2 !== void 0);
        switch (sort2) {
          case kSampleAscVal: {
            const result2 = sortId(a, b);
            if (result2 !== 0) {
              return result2;
            } else {
              return a.epoch - b.epoch;
            }
          }
          case kSampleDescVal: {
            const result2 = sortId(b, a);
            if (result2 !== 0) {
              return result2;
            } else {
              return a.epoch - b.epoch;
            }
          }
          case kEpochAscVal: {
            const result2 = a.epoch - b.epoch;
            if (result2 !== 0) {
              return result2;
            } else {
              return sortId(a, b);
            }
          }
          case kEpochDescVal: {
            const result2 = b.epoch - a.epoch;
            if (result2 !== 0) {
              return result2;
            } else {
              return sortId(b, a);
            }
          }
          case kScoreAscVal: {
            if (aScores.length === 0 || bScores.length === 0 || scoreDescriptors.length === 0) {
              return 0;
            }
            return aScores.reduce((cmp2, score2, index) => {
              if (cmp2 !== 0) {
                return cmp2;
              }
              return scoreDescriptors[index]?.compare(score2, bScores[index]);
            }, 0);
          }
          case kScoreDescVal: {
            if (aScores.length === 0 || bScores.length === 0 || scoreDescriptors.length === 0) {
              return 0;
            }
            return bScores.reduce((cmp2, score2, index) => {
              if (cmp2 !== 0) {
                return cmp2;
              }
              return scoreDescriptors[index]?.compare(score2, aScores[index]);
            }, 0);
          }
          default:
            return 0;
        }
      });
      return sortedSamples;
    };
    const getScorersFromSamples = (samples) => {
      const scoreLabelsMap = /* @__PURE__ */ new Map();
      for (const sample2 of samples) {
        if (!sample2.error && sample2.scores) {
          for (const [scorerKey, scoreValue] of Object.entries(sample2.scores)) {
            if (scoreValue.value && typeof scoreValue.value === "object" && !Array.isArray(scoreValue.value)) {
              const valueDict = scoreValue.value;
              for (const innerKey of Object.keys(valueDict)) {
                const label2 = `${scorerKey}:${innerKey}`;
                if (!scoreLabelsMap.has(label2)) {
                  scoreLabelsMap.set(label2, {
                    name: innerKey,
                    scorer: scorerKey
                  });
                }
              }
            } else {
              if (!scoreLabelsMap.has(scorerKey)) {
                scoreLabelsMap.set(scorerKey, {
                  name: scorerKey,
                  scorer: scorerKey
                });
              }
            }
          }
        }
      }
      return Array.from(scoreLabelsMap.values());
    };
    const getAvailableScorers = (_log, sampleSummaries) => {
      const sampleScorers = getScorersFromSamples(sampleSummaries);
      if (sampleScorers.length > 0) {
        return sampleScorers;
      }
      return void 0;
    };
    const getDefaultScorer = (log2, sampleSummaries) => {
      if (sampleSummaries.length === 0) {
        return void 0;
      }
      const allScorers = getAvailableScorers(log2, sampleSummaries);
      if (allScorers) {
        return allScorers[0];
      } else {
        return void 0;
      }
    };
    const mergeSampleSummaries = (logSamples, pendingSamples) => {
      const existingSampleIds = new Set(
        logSamples.map((sample2) => `${sample2.id}-${sample2.epoch}`)
      );
      const uniquePendingSamples = pendingSamples.filter((sample2) => !existingSampleIds.has(`${sample2.id}-${sample2.epoch}`)).map((sample2) => {
        return { ...sample2, completed: false };
      });
      return [...logSamples, ...uniquePendingSamples];
    };
    const log$1 = createLogger("hooks");
    const useEvalSpec = () => {
      const selectedLogDetails = useStore((state) => state.log.selectedLogDetails);
      return selectedLogDetails?.eval;
    };
    const useRefreshLog = () => {
      const setLoading = useStore((state) => state.appActions.setLoading);
      const refreshLog = useStore((state) => state.logActions.refreshLog);
      const resetFiltering = useStore((state) => state.logActions.resetFiltering);
      return reactExports.useCallback(() => {
        try {
          setLoading(true);
          refreshLog();
          resetFiltering();
          setLoading(false);
        } catch (e) {
          console.log(e);
          setLoading(false, e);
        }
      }, [refreshLog, resetFiltering, setLoading]);
    };
    const useSampleSummaries = () => {
      const selectedLogDetails = useStore((state) => state.log.selectedLogDetails);
      const pendingSampleSummaries = useStore(
        (state) => state.log.pendingSampleSummaries
      );
      return reactExports.useMemo(() => {
        return mergeSampleSummaries(
          selectedLogDetails?.sampleSummaries || [],
          pendingSampleSummaries?.samples || []
        );
      }, [selectedLogDetails, pendingSampleSummaries]);
    };
    const useTotalSampleCount = () => {
      const sampleSummaries = useSampleSummaries();
      return reactExports.useMemo(() => {
        return sampleSummaries.length;
      }, [sampleSummaries]);
    };
    const useSelectedScores = () => {
      const selectedLogDetails = useStore((state) => state.log.selectedLogDetails);
      const sampleSummaries = useSampleSummaries();
      const selected2 = useStore((state) => state.log.selectedScores);
      return reactExports.useMemo(() => {
        if (selected2 !== void 0) {
          return selected2;
        } else if (selectedLogDetails) {
          const defaultScorer = getDefaultScorer(
            selectedLogDetails,
            sampleSummaries
          );
          if (defaultScorer) {
            return [defaultScorer];
          }
        }
        return [];
      }, [selectedLogDetails, sampleSummaries, selected2]);
    };
    const useScores = () => {
      const selectedLogDetails = useStore((state) => state.log.selectedLogDetails);
      const sampleSummaries = useSampleSummaries();
      return reactExports.useMemo(() => {
        if (!selectedLogDetails) {
          return [];
        }
        const result2 = getAvailableScorers(selectedLogDetails, sampleSummaries) || [];
        return result2;
      }, [selectedLogDetails, sampleSummaries]);
    };
    const useEvalDescriptor = () => {
      const scores2 = useScores();
      const sampleSummaries = useSampleSummaries();
      return reactExports.useMemo(() => {
        return scores2 ? createEvalDescriptor(scores2, sampleSummaries) : null;
      }, [scores2, sampleSummaries]);
    };
    const useSampleDescriptor = () => {
      const evalDescriptor = useEvalDescriptor();
      const sampleSummaries = useSampleSummaries();
      const selectedScores = useSelectedScores();
      return reactExports.useMemo(() => {
        return evalDescriptor ? createSamplesDescriptor(sampleSummaries, evalDescriptor, selectedScores) : void 0;
      }, [evalDescriptor, sampleSummaries, selectedScores]);
    };
    const useFilteredSamples = () => {
      const evalDescriptor = useEvalDescriptor();
      const sampleSummaries = useSampleSummaries();
      const filter = useStore((state) => state.log.filter);
      const setFilterError = useStore((state) => state.logActions.setFilterError);
      const clearFilterError = useStore(
        (state) => state.logActions.clearFilterError
      );
      const epoch = useStore((state) => state.log.epoch);
      const sort2 = useStore((state) => state.log.sort);
      const samplesDescriptor = useSampleDescriptor();
      const selectedScores = useSelectedScores();
      return reactExports.useMemo(() => {
        const { result: result2, error: error2, allErrors } = evalDescriptor && filter ? filterSamples(evalDescriptor, sampleSummaries, filter) : { result: sampleSummaries, error: void 0, allErrors: false };
        if (error2 && allErrors) {
          setFilterError(error2);
        } else {
          clearFilterError();
        }
        const prefiltered = error2 === void 0 || !allErrors ? result2 : sampleSummaries;
        const filtered = epoch && epoch !== "all" ? prefiltered.filter((sample2) => epoch === String(sample2.epoch)) : prefiltered;
        const sorted = samplesDescriptor ? sortSamples(sort2, filtered, samplesDescriptor, selectedScores) : filtered;
        return [...sorted];
      }, [
        evalDescriptor,
        sampleSummaries,
        filter,
        setFilterError,
        clearFilterError,
        epoch,
        sort2,
        samplesDescriptor,
        selectedScores
      ]);
    };
    const useGroupBy = () => {
      const selectedLogDetails = useStore((state) => state.log.selectedLogDetails);
      const sort2 = useStore((state) => state.log.sort);
      const epoch = useStore((state) => state.log.epoch);
      return reactExports.useMemo(() => {
        const epochs = selectedLogDetails?.eval?.config?.epochs || 1;
        if (epochs > 1) {
          if (byEpoch(sort2) || epoch !== "all") {
            return "epoch";
          } else if (bySample(sort2)) {
            return "sample";
          }
        }
        return "none";
      }, [selectedLogDetails, sort2, epoch]);
    };
    const useGroupByOrder = () => {
      const sort2 = useStore((state) => state.log.sort);
      return reactExports.useMemo(() => {
        return sort2 === kSampleAscVal || sort2 === kEpochAscVal || sort2 === kScoreAscVal ? "asc" : "desc";
      }, [sort2]);
    };
    const useSelectedSampleSummary = () => {
      const sampleSummaries = useSampleSummaries();
      const selectedSampleHandle = useStore(
        (state) => state.log.selectedSampleHandle
      );
      return reactExports.useMemo(() => {
        const selectedSampleSummary = sampleSummaries.find((sample2) => {
          return sampleIdsEqual(sample2.id, selectedSampleHandle?.id) && sample2.epoch === selectedSampleHandle?.epoch;
        });
        return selectedSampleSummary;
      }, [selectedSampleHandle, sampleSummaries]);
    };
    const useSampleData = () => {
      const sampleStatus = useStore((state) => state.sample.sampleStatus);
      const sampleError = useStore((state) => state.sample.sampleError);
      const getSelectedSample = useStore(
        (state) => state.sampleActions.getSelectedSample
      );
      const selectedSampleIdentifier = useStore(
        (state) => state.sample.sample_identifier
      );
      const sampleNeedsReload = useStore((state) => state.sample.sampleNeedsReload);
      const runningEvents = useStore(
        (state) => state.sample.runningEvents
      );
      return reactExports.useMemo(() => {
        return {
          selectedSampleIdentifier,
          status: sampleStatus,
          sampleNeedsReload,
          error: sampleError,
          getSelectedSample,
          running: runningEvents
        };
      }, [
        sampleStatus,
        sampleError,
        getSelectedSample,
        selectedSampleIdentifier,
        sampleNeedsReload,
        runningEvents
      ]);
    };
    const useLogSelection = () => {
      const selectedSampleSummary = useSelectedSampleSummary();
      const selectedLogFile = useStore((state) => state.logs.selectedLogFile);
      const loadedLog = useStore((state) => state.log.loadedLog);
      return reactExports.useMemo(() => {
        return {
          logFile: selectedLogFile,
          loadedLog,
          sample: selectedSampleSummary
        };
      }, [loadedLog, selectedLogFile, selectedSampleSummary]);
    };
    const useCollapseSampleEvent = (scope, id) => {
      const collapsed2 = useStore((state) => state.sample.collapsedEvents);
      const collapseEvent = useStore((state) => state.sampleActions.collapseEvent);
      return reactExports.useMemo(() => {
        const isCollapsed = collapsed2 !== null && collapsed2[scope]?.[id] === true;
        const set2 = (value2) => {
          log$1.debug("Set collapsed", id, value2);
          collapseEvent(scope, id, value2);
        };
        return [isCollapsed, set2];
      }, [collapsed2, scope, id, collapseEvent]);
    };
    const useCollapsibleIds = (key2) => {
      const collapsedIds = useStore(
        (state) => state.sample.collapsedIdBuckets[key2]
      );
      const setCollapsed = useStore((state) => state.sampleActions.collapseId);
      const collapseId = reactExports.useCallback(
        (id, value2) => {
          setCollapsed(key2, id, value2);
        },
        [setCollapsed, key2]
      );
      const clearCollapsedIds = useStore(
        (state) => state.sampleActions.clearCollapsedIds
      );
      const clearIds = reactExports.useCallback(() => {
        clearCollapsedIds(key2);
      }, [clearCollapsedIds, key2]);
      return reactExports.useMemo(() => {
        return [collapsedIds, collapseId, clearIds];
      }, [collapsedIds, collapseId, clearIds]);
    };
    const useCollapsedState = (id, defaultValue, scope) => {
      const stateId = id;
      const collapsed2 = useStore(
        (state) => state.appActions.getCollapsed(stateId, defaultValue)
      );
      const setCollapsed = useStore((state) => state.appActions.setCollapsed);
      return reactExports.useMemo(() => {
        const set2 = (value2) => {
          log$1.debug("Set collapsed", id, scope, value2);
          setCollapsed(stateId, value2);
        };
        return [collapsed2, set2];
      }, [collapsed2, id, scope, setCollapsed, stateId]);
    };
    const useMessageVisibility = (id, scope) => {
      const visible2 = useStore(
        (state) => state.appActions.getMessageVisible(id, true)
      );
      const setVisible = useStore((state) => state.appActions.setMessageVisible);
      const clearVisible = useStore(
        (state) => state.appActions.clearMessageVisible
      );
      const isFirstRender = reactExports.useRef(true);
      const selectedLogFile = useStore((state) => state.logs.selectedLogFile);
      reactExports.useEffect(() => {
        if (isFirstRender.current) {
          isFirstRender.current = false;
          return;
        }
        log$1.debug("clear message (eval)", id);
        clearVisible(id);
      }, [selectedLogFile, clearVisible, id]);
      const selectedSampleHandle = useStore(
        (state) => state.log.selectedSampleHandle
      );
      reactExports.useEffect(() => {
        if (isFirstRender.current) {
          return;
        }
        if (scope === "sample") {
          log$1.debug("clear message (sample)", id);
          clearVisible(id);
        }
      }, [selectedSampleHandle, clearVisible, id, scope]);
      return reactExports.useMemo(() => {
        log$1.debug("visibility", id, visible2);
        const set2 = (visible22) => {
          log$1.debug("set visiblity", id);
          setVisible(id, visible22);
        };
        return [visible2, set2];
      }, [visible2, setVisible, id]);
    };
    function useProperty(id, propertyName2, options2) {
      options2 = options2 || { cleanup: true };
      const setPropertyValue = useStore(
        (state) => state.appActions.setPropertyValue
      );
      const removePropertyValue = useStore(
        (state) => state.appActions.removePropertyValue
      );
      const propertyValue = useStore(
        reactExports.useCallback(
          (state) => state.appActions.getPropertyValue(
            id,
            propertyName2,
            options2.defaultValue
          ),
          [id, propertyName2, options2.defaultValue]
        )
      );
      const setValue = reactExports.useCallback(
        (value2) => {
          setPropertyValue(id, propertyName2, value2);
        },
        [id, propertyName2, setPropertyValue]
      );
      const removeValue = reactExports.useCallback(() => {
        removePropertyValue(id, propertyName2);
      }, [id, propertyName2, removePropertyValue]);
      reactExports.useEffect(() => {
        return () => {
          if (options2.cleanup) {
            removePropertyValue(id, propertyName2);
          }
        };
      }, [id, options2.cleanup, propertyName2, removePropertyValue]);
      return [propertyValue, setValue, removeValue];
    }
    const usePrevious = (value2) => {
      const ref = reactExports.useRef(void 0);
      reactExports.useEffect(() => {
        ref.current = value2;
      }, [value2]);
      return ref.current;
    };
    const kPrismRenderMaxSize = 25e4;
    const usePrismHighlight = (containerRef, contentLength) => {
      reactExports.useEffect(() => {
        requestAnimationFrame(() => {
          if (contentLength > 0 && containerRef.current !== null && contentLength <= kPrismRenderMaxSize) {
            const codeBlocks = containerRef.current?.querySelectorAll("pre code");
            codeBlocks?.forEach((block2) => {
              if (block2.className.includes("language-")) {
                block2.classList.add("sourceCode");
                prismExports.highlightElement(block2);
              }
            });
          }
        });
      }, [contentLength, containerRef]);
    };
    const useSamplePopover = (id) => {
      const setVisiblePopover = useStore(
        (store) => store.sampleActions.setVisiblePopover
      );
      const clearVisiblePopover = useStore(
        (store) => store.sampleActions.clearVisiblePopover
      );
      const visiblePopover = useStore((store) => store.sample.visiblePopover);
      const timerRef = reactExports.useRef(null);
      const show = reactExports.useCallback(() => {
        if (timerRef.current) {
          return;
        }
        timerRef.current = window.setTimeout(() => {
          setVisiblePopover(id);
          timerRef.current = null;
        }, 250);
      }, [id, setVisiblePopover]);
      const hide2 = reactExports.useCallback(() => {
        if (timerRef.current) {
          clearTimeout(timerRef.current);
          timerRef.current = null;
        }
        clearVisiblePopover();
      }, [clearVisiblePopover]);
      reactExports.useEffect(() => {
        return () => {
          if (timerRef.current) {
            clearTimeout(timerRef.current);
          }
        };
      }, []);
      const isShowing = reactExports.useMemo(() => {
        return visiblePopover === id;
      }, [id, visiblePopover]);
      return {
        show,
        hide: hide2,
        setShowing: (shouldShow) => {
          if (shouldShow) {
            show();
          } else {
            hide2();
          }
        },
        isShowing
      };
    };
    const useLogs = () => {
      const syncLogs = useStore((state) => state.logsActions.syncLogs);
      const syncEvalSetInfo = useStore(
        (state) => state.logsActions.syncEvalSetInfo
      );
      const setLoading = useStore((state) => state.appActions.setLoading);
      const loadLogs = reactExports.useCallback(
        async (logPath) => {
          await Promise.all([syncEvalSetInfo(logPath), syncLogs()]).catch((e) => {
            log$1.error("Error loading logs", e);
            setLoading(false, e);
          });
        },
        [syncLogs, setLoading, syncEvalSetInfo]
      );
      const syncLogPreviews = useStore(
        (state) => state.logsActions.syncLogPreviews
      );
      const logPreviews = useStore((state) => state.logs.logPreviews);
      const allLogFiles = useStore((state) => state.logs.logs);
      const loadLogOverviews = reactExports.useCallback(
        async (logs = allLogFiles) => {
          await syncLogPreviews(logs);
        },
        [syncLogPreviews, allLogFiles]
      );
      const loadAllLogOverviews = reactExports.useCallback(async () => {
        const logsToLoad = allLogFiles.filter((logFile) => {
          const existingHeader = logPreviews[logFile.name];
          return !existingHeader || existingHeader.status === "started";
        });
        if (logsToLoad.length > 0) {
          await loadLogOverviews(logsToLoad);
        }
      }, [loadLogOverviews, allLogFiles, logPreviews]);
      return { loadLogs, loadLogOverviews, loadAllLogOverviews };
    };
    const useLogsListing = () => {
      const filteredCount = useStore((state) => state.logs.listing.filteredCount);
      const setFilteredCount = useStore(
        (state) => state.logsActions.setFilteredCount
      );
      const gridState = useStore((state) => state.logs.listing.gridState);
      const setGridState = useStore((state) => state.logsActions.setLogsGridState);
      const clearGridState = useStore(
        (state) => state.logsActions.clearLogsGridState
      );
      const previousLogPath = useStore(
        (state) => state.logs.listing.previousLogPath
      );
      const setPreviousLogPath = useStore(
        (state) => state.logsActions.setPreviousLogsPath
      );
      return {
        filteredCount,
        setFilteredCount,
        gridState,
        setGridState,
        clearGridState,
        previousLogPath,
        setPreviousLogPath
      };
    };
    const useDocumentTitle = () => {
      const setDocumentTitle = (context) => {
        const title2 = [];
        if (context.sample) {
          title2.push(`${context.sample.id}_${context.sample.epoch}`);
        }
        if (context.evalSpec) {
          title2.push(`${context.evalSpec.model} - ${context.evalSpec.task}`);
        }
        if (context.logDir) {
          title2.push(prettyDirUri(context.logDir));
        }
        if (title2.length === 0) {
          title2.push("Inspect View");
        }
        document.title = title2.join(" - ");
      };
      return { setDocumentTitle };
    };
    const simplifiedStatusForDeduplication = (status2) => status2 === "started" || status2 === "success" ? status2 : "_other_";
    const useLogsWithretried = () => {
      const logs = useStore((state) => state.logs.logs);
      const logPreviews = useStore((state) => state.logs.logPreviews);
      const logsWithEvalSetRetry = reactExports.useMemo(() => {
        const logsByTaskId = logs.reduce(
          (acc, log2) => {
            const taskId = log2.task_id;
            if (taskId) {
              if (!(taskId in acc)) acc[taskId] = [];
              acc[taskId].push(log2);
            }
            return acc;
          },
          {}
        );
        const bestByName = {};
        for (const items of Object.values(logsByTaskId)) {
          items.sort((a, b) => {
            const as = simplifiedStatusForDeduplication(
              logPreviews[a.name]?.status
            );
            const bs = simplifiedStatusForDeduplication(
              logPreviews[b.name]?.status
            );
            const am = a.mtime ?? 0;
            const bm = b.mtime ?? 0;
            if (as === bs) return bm - am;
            if (as === "started") return -1;
            if (bs === "started") return 1;
            if (as === "success") return -1;
            if (bs === "success") return 1;
            console.warn(`Unexpected status combination: ${as}, ${bs}`, a, b);
            return 0;
          });
          const { name: name2 } = items[0];
          bestByName[name2] = { ...items[0], retried: false };
        }
        return logs.map(
          (log2) => bestByName[log2.name] ?? {
            ...log2,
            // task_id is optional for backward compatibility, only new logs files can be skippable
            retried: log2.task_id ? true : void 0
          }
        );
      }, [logs, logPreviews]);
      return logsWithEvalSetRetry;
    };
    const log = createLogger("Client-Events");
    function useClientEvents() {
      const syncLogs = useStore((state) => state.logsActions.syncLogs);
      const logPreviews = useStore((state) => state.logs.logPreviews);
      const api2 = useStore((state) => state.api);
      const { loadLogOverviews } = useLogs();
      const refreshCallback = reactExports.useCallback(
        async (logs) => {
          log.debug("Refresh Log Files");
          await syncLogs();
          const toRefresh = [];
          for (const log2 of logs) {
            const header2 = logPreviews[log2.name];
            if (!header2 || header2.status === "started") {
              toRefresh.push(log2);
            }
          }
          if (toRefresh.length > 0) {
            log.debug(`Refreshing ${toRefresh.length} log files`, toRefresh);
            await loadLogOverviews(toRefresh);
          }
        },
        [logPreviews, syncLogs, loadLogOverviews]
      );
      reactExports.useEffect(() => {
        clientEventsService.setRefreshCallback(refreshCallback);
      }, [refreshCallback]);
      const startPolling = reactExports.useCallback(
        (logs) => {
          clientEventsService.startPolling(logs, api2);
        },
        [api2]
      );
      const stopPolling = reactExports.useCallback(() => {
        clientEventsService.stopPolling();
      }, []);
      const cleanup = reactExports.useCallback(() => {
        clientEventsService.cleanup();
      }, []);
      reactExports.useEffect(() => {
        return () => {
          cleanup();
        };
      }, [cleanup]);
      return {
        startPolling,
        stopPolling,
        cleanup
      };
    }
    const button$3 = "_button_1bbut_1";
    const viewerOptions$1 = "_viewerOptions_1bbut_7";
    const styles$1l = {
      button: button$3,
      viewerOptions: viewerOptions$1
    };
    const FlowButton = reactExports.forwardRef(
      (_, ref) => {
        const navigateRouter = useNavigate();
        const location2 = useLocation();
        const { logPath } = useLogOrSampleRouteParams();
        const navigate = () => {
          const isSamplesRoute = location2.pathname.startsWith("/samples/");
          const routePrefix = isSamplesRoute ? "/samples" : "/logs";
          const flowPath = logPath ? `${routePrefix}/${logPath}/flow.yaml` : `${routePrefix}/flow.yaml`;
          navigateRouter(flowPath);
        };
        return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
          "button",
          {
            ref,
            type: "button",
            className: clsx(styles$1l.button),
            onClick: navigate,
            title: "View Flow configuration for this directory",
            children: /* @__PURE__ */ jsxRuntimeExports.jsx(
              "i",
              {
                ref,
                className: clsx(ApplicationIcons.flow, styles$1l.viewerOptions)
              }
            )
          }
        ) });
      }
    );
    const useFlowServerData = (dir) => {
      const api2 = useStore((state) => state.api);
      const flowDir = useStore((state) => state.logs.flowDir);
      const updateFlowData = useStore((state) => state.logsActions.updateFlowData);
      reactExports.useEffect(() => {
        const fetchFlow = async () => {
          const flowStr = await api2?.get_flow(dir);
          updateFlowData(dir, flowStr);
        };
        if (dir !== flowDir) {
          fetchFlow();
        }
      }, [dir, flowDir, api2, updateFlowData]);
    };
    const wrapper$4 = "_wrapper_1tajk_1";
    const container$l = "_container_1tajk_12";
    const animate = "_animate_1tajk_21";
    const styles$1k = {
      wrapper: wrapper$4,
      container: container$l,
      animate
    };
    const ActivityBar = ({ animating }) => {
      return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$1k.wrapper), children: /* @__PURE__ */ jsxRuntimeExports.jsx(
        "div",
        {
          className: clsx(styles$1k.container),
          role: "progressbar",
          "aria-label": "Progress bar",
          "aria-valuenow": 25,
          "aria-valuemin": 0,
          "aria-valuemax": 100,
          children: animating && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$1k.animate })
        }
      ) });
    };
    const button$2 = "_button_1bbut_1";
    const viewerOptions = "_viewerOptions_1bbut_7";
    const styles$1j = {
      button: button$2,
      viewerOptions
    };
    const ViewerOptionsButton = reactExports.forwardRef(({ showing, setShowing }, ref) => {
      const toggleShowing = reactExports.useCallback(() => {
        setShowing(!showing);
      }, [showing, setShowing]);
      return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
        "button",
        {
          ref,
          type: "button",
          className: clsx(styles$1j.button),
          onClick: toggleShowing,
          title: "Viewer information and options",
          children: /* @__PURE__ */ jsxRuntimeExports.jsx(
            "i",
            {
              ref,
              className: clsx(ApplicationIcons.info, styles$1j.viewerOptions)
            }
          )
        }
      ) });
    });
    var fromEntries = function fromEntries2(entries) {
      return entries.reduce(function(acc, _ref) {
        var key2 = _ref[0], value2 = _ref[1];
        acc[key2] = value2;
        return acc;
      }, {});
    };
    var useIsomorphicLayoutEffect = typeof window !== "undefined" && window.document && window.document.createElement ? reactExports.useLayoutEffect : reactExports.useEffect;
    var top$1 = "top";
    var bottom = "bottom";
    var right$2 = "right";
    var left$2 = "left";
    var auto = "auto";
    var basePlacements = [top$1, bottom, right$2, left$2];
    var start = "start";
    var end = "end";
    var clippingParents = "clippingParents";
    var viewport = "viewport";
    var popper = "popper";
    var reference = "reference";
    var variationPlacements = /* @__PURE__ */ basePlacements.reduce(function(acc, placement) {
      return acc.concat([placement + "-" + start, placement + "-" + end]);
    }, []);
    var placements = /* @__PURE__ */ [].concat(basePlacements, [auto]).reduce(function(acc, placement) {
      return acc.concat([placement, placement + "-" + start, placement + "-" + end]);
    }, []);
    var beforeRead = "beforeRead";
    var read = "read";
    var afterRead = "afterRead";
    var beforeMain = "beforeMain";
    var main = "main";
    var afterMain = "afterMain";
    var beforeWrite = "beforeWrite";
    var write = "write";
    var afterWrite = "afterWrite";
    var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite];
    function getNodeName(element) {
      return element ? (element.nodeName || "").toLowerCase() : null;
    }
    function getWindow(node2) {
      if (node2 == null) {
        return window;
      }
      if (node2.toString() !== "[object Window]") {
        var ownerDocument = node2.ownerDocument;
        return ownerDocument ? ownerDocument.defaultView || window : window;
      }
      return node2;
    }
    function isElement(node2) {
      var OwnElement = getWindow(node2).Element;
      return node2 instanceof OwnElement || node2 instanceof Element;
    }
    function isHTMLElement(node2) {
      var OwnElement = getWindow(node2).HTMLElement;
      return node2 instanceof OwnElement || node2 instanceof HTMLElement;
    }
    function isShadowRoot(node2) {
      if (typeof ShadowRoot === "undefined") {
        return false;
      }
      var OwnElement = getWindow(node2).ShadowRoot;
      return node2 instanceof OwnElement || node2 instanceof ShadowRoot;
    }
    function applyStyles(_ref) {
      var state = _ref.state;
      Object.keys(state.elements).forEach(function(name2) {
        var style2 = state.styles[name2] || {};
        var attributes2 = state.attributes[name2] || {};
        var element = state.elements[name2];
        if (!isHTMLElement(element) || !getNodeName(element)) {
          return;
        }
        Object.assign(element.style, style2);
        Object.keys(attributes2).forEach(function(name3) {
          var value2 = attributes2[name3];
          if (value2 === false) {
            element.removeAttribute(name3);
          } else {
            element.setAttribute(name3, value2 === true ? "" : value2);
          }
        });
      });
    }
    function effect$2(_ref2) {
      var state = _ref2.state;
      var initialStyles = {
        popper: {
          position: state.options.strategy,
          left: "0",
          top: "0",
          margin: "0"
        },
        arrow: {
          position: "absolute"
        },
        reference: {}
      };
      Object.assign(state.elements.popper.style, initialStyles.popper);
      state.styles = initialStyles;
      if (state.elements.arrow) {
        Object.assign(state.elements.arrow.style, initialStyles.arrow);
      }
      return function() {
        Object.keys(state.elements).forEach(function(name2) {
          var element = state.elements[name2];
          var attributes2 = state.attributes[name2] || {};
          var styleProperties = Object.keys(state.styles.hasOwnProperty(name2) ? state.styles[name2] : initialStyles[name2]);
          var style2 = styleProperties.reduce(function(style3, property2) {
            style3[property2] = "";
            return style3;
          }, {});
          if (!isHTMLElement(element) || !getNodeName(element)) {
            return;
          }
          Object.assign(element.style, style2);
          Object.keys(attributes2).forEach(function(attribute2) {
            element.removeAttribute(attribute2);
          });
        });
      };
    }
    const applyStyles$1 = {
      name: "applyStyles",
      enabled: true,
      phase: "write",
      fn: applyStyles,
      effect: effect$2,
      requires: ["computeStyles"]
    };
    function getBasePlacement(placement) {
      return placement.split("-")[0];
    }
    var max = Math.max;
    var min = Math.min;
    var round = Math.round;
    function getUAString() {
      var uaData = navigator.userAgentData;
      if (uaData != null && uaData.brands && Array.isArray(uaData.brands)) {
        return uaData.brands.map(function(item2) {
          return item2.brand + "/" + item2.version;
        }).join(" ");
      }
      return navigator.userAgent;
    }
    function isLayoutViewport() {
      return !/^((?!chrome|android).)*safari/i.test(getUAString());
    }
    function getBoundingClientRect(element, includeScale, isFixedStrategy) {
      if (includeScale === void 0) {
        includeScale = false;
      }
      if (isFixedStrategy === void 0) {
        isFixedStrategy = false;
      }
      var clientRect = element.getBoundingClientRect();
      var scaleX = 1;
      var scaleY = 1;
      if (includeScale && isHTMLElement(element)) {
        scaleX = element.offsetWidth > 0 ? round(clientRect.width) / element.offsetWidth || 1 : 1;
        scaleY = element.offsetHeight > 0 ? round(clientRect.height) / element.offsetHeight || 1 : 1;
      }
      var _ref = isElement(element) ? getWindow(element) : window, visualViewport = _ref.visualViewport;
      var addVisualOffsets = !isLayoutViewport() && isFixedStrategy;
      var x2 = (clientRect.left + (addVisualOffsets && visualViewport ? visualViewport.offsetLeft : 0)) / scaleX;
      var y = (clientRect.top + (addVisualOffsets && visualViewport ? visualViewport.offsetTop : 0)) / scaleY;
      var width = clientRect.width / scaleX;
      var height = clientRect.height / scaleY;
      return {
        width,
        height,
        top: y,
        right: x2 + width,
        bottom: y + height,
        left: x2,
        x: x2,
        y
      };
    }
    function getLayoutRect(element) {
      var clientRect = getBoundingClientRect(element);
      var width = element.offsetWidth;
      var height = element.offsetHeight;
      if (Math.abs(clientRect.width - width) <= 1) {
        width = clientRect.width;
      }
      if (Math.abs(clientRect.height - height) <= 1) {
        height = clientRect.height;
      }
      return {
        x: element.offsetLeft,
        y: element.offsetTop,
        width,
        height
      };
    }
    function contains$1(parent, child) {
      var rootNode = child.getRootNode && child.getRootNode();
      if (parent.contains(child)) {
        return true;
      } else if (rootNode && isShadowRoot(rootNode)) {
        var next = child;
        do {
          if (next && parent.isSameNode(next)) {
            return true;
          }
          next = next.parentNode || next.host;
        } while (next);
      }
      return false;
    }
    function getComputedStyle$1(element) {
      return getWindow(element).getComputedStyle(element);
    }
    function isTableElement(element) {
      return ["table", "td", "th"].indexOf(getNodeName(element)) >= 0;
    }
    function getDocumentElement(element) {
      return ((isElement(element) ? element.ownerDocument : (
        // $FlowFixMe[prop-missing]
        element.document
      )) || window.document).documentElement;
    }
    function getParentNode(element) {
      if (getNodeName(element) === "html") {
        return element;
      }
      return (
        // this is a quicker (but less type safe) way to save quite some bytes from the bundle
        // $FlowFixMe[incompatible-return]
        // $FlowFixMe[prop-missing]
        element.assignedSlot || // step into the shadow DOM of the parent of a slotted node
        element.parentNode || // DOM Element detected
        (isShadowRoot(element) ? element.host : null) || // ShadowRoot detected
        // $FlowFixMe[incompatible-call]: HTMLElement is a Node
        getDocumentElement(element)
      );
    }
    function getTrueOffsetParent(element) {
      if (!isHTMLElement(element) || // https://github.com/popperjs/popper-core/issues/837
      getComputedStyle$1(element).position === "fixed") {
        return null;
      }
      return element.offsetParent;
    }
    function getContainingBlock(element) {
      var isFirefox2 = /firefox/i.test(getUAString());
      var isIE = /Trident/i.test(getUAString());
      if (isIE && isHTMLElement(element)) {
        var elementCss = getComputedStyle$1(element);
        if (elementCss.position === "fixed") {
          return null;
        }
      }
      var currentNode = getParentNode(element);
      if (isShadowRoot(currentNode)) {
        currentNode = currentNode.host;
      }
      while (isHTMLElement(currentNode) && ["html", "body"].indexOf(getNodeName(currentNode)) < 0) {
        var css2 = getComputedStyle$1(currentNode);
        if (css2.transform !== "none" || css2.perspective !== "none" || css2.contain === "paint" || ["transform", "perspective"].indexOf(css2.willChange) !== -1 || isFirefox2 && css2.willChange === "filter" || isFirefox2 && css2.filter && css2.filter !== "none") {
          return currentNode;
        } else {
          currentNode = currentNode.parentNode;
        }
      }
      return null;
    }
    function getOffsetParent(element) {
      var window2 = getWindow(element);
      var offsetParent = getTrueOffsetParent(element);
      while (offsetParent && isTableElement(offsetParent) && getComputedStyle$1(offsetParent).position === "static") {
        offsetParent = getTrueOffsetParent(offsetParent);
      }
      if (offsetParent && (getNodeName(offsetParent) === "html" || getNodeName(offsetParent) === "body" && getComputedStyle$1(offsetParent).position === "static")) {
        return window2;
      }
      return offsetParent || getContainingBlock(element) || window2;
    }
    function getMainAxisFromPlacement(placement) {
      return ["top", "bottom"].indexOf(placement) >= 0 ? "x" : "y";
    }
    function within(min$1, value2, max$12) {
      return max(min$1, min(value2, max$12));
    }
    function withinMaxClamp(min2, value2, max2) {
      var v = within(min2, value2, max2);
      return v > max2 ? max2 : v;
    }
    function getFreshSideObject() {
      return {
        top: 0,
        right: 0,
        bottom: 0,
        left: 0
      };
    }
    function mergePaddingObject(paddingObject) {
      return Object.assign({}, getFreshSideObject(), paddingObject);
    }
    function expandToHashMap(value2, keys) {
      return keys.reduce(function(hashMap, key2) {
        hashMap[key2] = value2;
        return hashMap;
      }, {});
    }
    var toPaddingObject = function toPaddingObject2(padding, state) {
      padding = typeof padding === "function" ? padding(Object.assign({}, state.rects, {
        placement: state.placement
      })) : padding;
      return mergePaddingObject(typeof padding !== "number" ? padding : expandToHashMap(padding, basePlacements));
    };
    function arrow(_ref) {
      var _state$modifiersData$;
      var state = _ref.state, name2 = _ref.name, options2 = _ref.options;
      var arrowElement = state.elements.arrow;
      var popperOffsets2 = state.modifiersData.popperOffsets;
      var basePlacement = getBasePlacement(state.placement);
      var axis = getMainAxisFromPlacement(basePlacement);
      var isVertical = [left$2, right$2].indexOf(basePlacement) >= 0;
      var len = isVertical ? "height" : "width";
      if (!arrowElement || !popperOffsets2) {
        return;
      }
      var paddingObject = toPaddingObject(options2.padding, state);
      var arrowRect = getLayoutRect(arrowElement);
      var minProp = axis === "y" ? top$1 : left$2;
      var maxProp = axis === "y" ? bottom : right$2;
      var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets2[axis] - state.rects.popper[len];
      var startDiff = popperOffsets2[axis] - state.rects.reference[axis];
      var arrowOffsetParent = getOffsetParent(arrowElement);
      var clientSize = arrowOffsetParent ? axis === "y" ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0;
      var centerToReference = endDiff / 2 - startDiff / 2;
      var min2 = paddingObject[minProp];
      var max2 = clientSize - arrowRect[len] - paddingObject[maxProp];
      var center2 = clientSize / 2 - arrowRect[len] / 2 + centerToReference;
      var offset2 = within(min2, center2, max2);
      var axisProp = axis;
      state.modifiersData[name2] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset2, _state$modifiersData$.centerOffset = offset2 - center2, _state$modifiersData$);
    }
    function effect$1(_ref2) {
      var state = _ref2.state, options2 = _ref2.options;
      var _options$element = options2.element, arrowElement = _options$element === void 0 ? "[data-popper-arrow]" : _options$element;
      if (arrowElement == null) {
        return;
      }
      if (typeof arrowElement === "string") {
        arrowElement = state.elements.popper.querySelector(arrowElement);
        if (!arrowElement) {
          return;
        }
      }
      if (!contains$1(state.elements.popper, arrowElement)) {
        return;
      }
      state.elements.arrow = arrowElement;
    }
    const arrow$1 = {
      name: "arrow",
      enabled: true,
      phase: "main",
      fn: arrow,
      effect: effect$1,
      requires: ["popperOffsets"],
      requiresIfExists: ["preventOverflow"]
    };
    function getVariation(placement) {
      return placement.split("-")[1];
    }
    var unsetSides = {
      top: "auto",
      right: "auto",
      bottom: "auto",
      left: "auto"
    };
    function roundOffsetsByDPR(_ref, win) {
      var x2 = _ref.x, y = _ref.y;
      var dpr = win.devicePixelRatio || 1;
      return {
        x: round(x2 * dpr) / dpr || 0,
        y: round(y * dpr) / dpr || 0
      };
    }
    function mapToStyles(_ref2) {
      var _Object$assign2;
      var popper2 = _ref2.popper, popperRect = _ref2.popperRect, placement = _ref2.placement, variation = _ref2.variation, offsets = _ref2.offsets, position = _ref2.position, gpuAcceleration = _ref2.gpuAcceleration, adaptive = _ref2.adaptive, roundOffsets = _ref2.roundOffsets, isFixed = _ref2.isFixed;
      var _offsets$x = offsets.x, x2 = _offsets$x === void 0 ? 0 : _offsets$x, _offsets$y = offsets.y, y = _offsets$y === void 0 ? 0 : _offsets$y;
      var _ref3 = typeof roundOffsets === "function" ? roundOffsets({
        x: x2,
        y
      }) : {
        x: x2,
        y
      };
      x2 = _ref3.x;
      y = _ref3.y;
      var hasX = offsets.hasOwnProperty("x");
      var hasY = offsets.hasOwnProperty("y");
      var sideX = left$2;
      var sideY = top$1;
      var win = window;
      if (adaptive) {
        var offsetParent = getOffsetParent(popper2);
        var heightProp = "clientHeight";
        var widthProp = "clientWidth";
        if (offsetParent === getWindow(popper2)) {
          offsetParent = getDocumentElement(popper2);
          if (getComputedStyle$1(offsetParent).position !== "static" && position === "absolute") {
            heightProp = "scrollHeight";
            widthProp = "scrollWidth";
          }
        }
        offsetParent = offsetParent;
        if (placement === top$1 || (placement === left$2 || placement === right$2) && variation === end) {
          sideY = bottom;
          var offsetY = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.height : (
            // $FlowFixMe[prop-missing]
            offsetParent[heightProp]
          );
          y -= offsetY - popperRect.height;
          y *= gpuAcceleration ? 1 : -1;
        }
        if (placement === left$2 || (placement === top$1 || placement === bottom) && variation === end) {
          sideX = right$2;
          var offsetX = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.width : (
            // $FlowFixMe[prop-missing]
            offsetParent[widthProp]
          );
          x2 -= offsetX - popperRect.width;
          x2 *= gpuAcceleration ? 1 : -1;
        }
      }
      var commonStyles = Object.assign({
        position
      }, adaptive && unsetSides);
      var _ref4 = roundOffsets === true ? roundOffsetsByDPR({
        x: x2,
        y
      }, getWindow(popper2)) : {
        x: x2,
        y
      };
      x2 = _ref4.x;
      y = _ref4.y;
      if (gpuAcceleration) {
        var _Object$assign;
        return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? "0" : "", _Object$assign[sideX] = hasX ? "0" : "", _Object$assign.transform = (win.devicePixelRatio || 1) <= 1 ? "translate(" + x2 + "px, " + y + "px)" : "translate3d(" + x2 + "px, " + y + "px, 0)", _Object$assign));
      }
      return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : "", _Object$assign2[sideX] = hasX ? x2 + "px" : "", _Object$assign2.transform = "", _Object$assign2));
    }
    function computeStyles(_ref5) {
      var state = _ref5.state, options2 = _ref5.options;
      var _options$gpuAccelerat = options2.gpuAcceleration, gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat, _options$adaptive = options2.adaptive, adaptive = _options$adaptive === void 0 ? true : _options$adaptive, _options$roundOffsets = options2.roundOffsets, roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets;
      var commonStyles = {
        placement: getBasePlacement(state.placement),
        variation: getVariation(state.placement),
        popper: state.elements.popper,
        popperRect: state.rects.popper,
        gpuAcceleration,
        isFixed: state.options.strategy === "fixed"
      };
      if (state.modifiersData.popperOffsets != null) {
        state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, {
          offsets: state.modifiersData.popperOffsets,
          position: state.options.strategy,
          adaptive,
          roundOffsets
        })));
      }
      if (state.modifiersData.arrow != null) {
        state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, {
          offsets: state.modifiersData.arrow,
          position: "absolute",
          adaptive: false,
          roundOffsets
        })));
      }
      state.attributes.popper = Object.assign({}, state.attributes.popper, {
        "data-popper-placement": state.placement
      });
    }
    const computeStyles$1 = {
      name: "computeStyles",
      enabled: true,
      phase: "beforeWrite",
      fn: computeStyles,
      data: {}
    };
    var passive = {
      passive: true
    };
    function effect(_ref) {
      var state = _ref.state, instance = _ref.instance, options2 = _ref.options;
      var _options$scroll = options2.scroll, scroll = _options$scroll === void 0 ? true : _options$scroll, _options$resize = options2.resize, resize = _options$resize === void 0 ? true : _options$resize;
      var window2 = getWindow(state.elements.popper);
      var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper);
      if (scroll) {
        scrollParents.forEach(function(scrollParent) {
          scrollParent.addEventListener("scroll", instance.update, passive);
        });
      }
      if (resize) {
        window2.addEventListener("resize", instance.update, passive);
      }
      return function() {
        if (scroll) {
          scrollParents.forEach(function(scrollParent) {
            scrollParent.removeEventListener("scroll", instance.update, passive);
          });
        }
        if (resize) {
          window2.removeEventListener("resize", instance.update, passive);
        }
      };
    }
    const eventListeners = {
      name: "eventListeners",
      enabled: true,
      phase: "write",
      fn: function fn2() {
      },
      effect,
      data: {}
    };
    var hash$1 = {
      left: "right",
      right: "left",
      bottom: "top",
      top: "bottom"
    };
    function getOppositePlacement(placement) {
      return placement.replace(/left|right|bottom|top/g, function(matched) {
        return hash$1[matched];
      });
    }
    var hash = {
      start: "end",
      end: "start"
    };
    function getOppositeVariationPlacement(placement) {
      return placement.replace(/start|end/g, function(matched) {
        return hash[matched];
      });
    }
    function getWindowScroll(node2) {
      var win = getWindow(node2);
      var scrollLeft = win.pageXOffset;
      var scrollTop = win.pageYOffset;
      return {
        scrollLeft,
        scrollTop
      };
    }
    function getWindowScrollBarX(element) {
      return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft;
    }
    function getViewportRect(element, strategy) {
      var win = getWindow(element);
      var html2 = getDocumentElement(element);
      var visualViewport = win.visualViewport;
      var width = html2.clientWidth;
      var height = html2.clientHeight;
      var x2 = 0;
      var y = 0;
      if (visualViewport) {
        width = visualViewport.width;
        height = visualViewport.height;
        var layoutViewport = isLayoutViewport();
        if (layoutViewport || !layoutViewport && strategy === "fixed") {
          x2 = visualViewport.offsetLeft;
          y = visualViewport.offsetTop;
        }
      }
      return {
        width,
        height,
        x: x2 + getWindowScrollBarX(element),
        y
      };
    }
    function getDocumentRect(element) {
      var _element$ownerDocumen;
      var html2 = getDocumentElement(element);
      var winScroll = getWindowScroll(element);
      var body2 = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;
      var width = max(html2.scrollWidth, html2.clientWidth, body2 ? body2.scrollWidth : 0, body2 ? body2.clientWidth : 0);
      var height = max(html2.scrollHeight, html2.clientHeight, body2 ? body2.scrollHeight : 0, body2 ? body2.clientHeight : 0);
      var x2 = -winScroll.scrollLeft + getWindowScrollBarX(element);
      var y = -winScroll.scrollTop;
      if (getComputedStyle$1(body2 || html2).direction === "rtl") {
        x2 += max(html2.clientWidth, body2 ? body2.clientWidth : 0) - width;
      }
      return {
        width,
        height,
        x: x2,
        y
      };
    }
    function isScrollParent(element) {
      var _getComputedStyle = getComputedStyle$1(element), overflow = _getComputedStyle.overflow, overflowX = _getComputedStyle.overflowX, overflowY = _getComputedStyle.overflowY;
      return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);
    }
    function getScrollParent(node2) {
      if (["html", "body", "#document"].indexOf(getNodeName(node2)) >= 0) {
        return node2.ownerDocument.body;
      }
      if (isHTMLElement(node2) && isScrollParent(node2)) {
        return node2;
      }
      return getScrollParent(getParentNode(node2));
    }
    function listScrollParents(element, list2) {
      var _element$ownerDocumen;
      if (list2 === void 0) {
        list2 = [];
      }
      var scrollParent = getScrollParent(element);
      var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body);
      var win = getWindow(scrollParent);
      var target2 = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent;
      var updatedList = list2.concat(target2);
      return isBody ? updatedList : (
        // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here
        updatedList.concat(listScrollParents(getParentNode(target2)))
      );
    }
    function rectToClientRect(rect2) {
      return Object.assign({}, rect2, {
        left: rect2.x,
        top: rect2.y,
        right: rect2.x + rect2.width,
        bottom: rect2.y + rect2.height
      });
    }
    function getInnerBoundingClientRect(element, strategy) {
      var rect2 = getBoundingClientRect(element, false, strategy === "fixed");
      rect2.top = rect2.top + element.clientTop;
      rect2.left = rect2.left + element.clientLeft;
      rect2.bottom = rect2.top + element.clientHeight;
      rect2.right = rect2.left + element.clientWidth;
      rect2.width = element.clientWidth;
      rect2.height = element.clientHeight;
      rect2.x = rect2.left;
      rect2.y = rect2.top;
      return rect2;
    }
    function getClientRectFromMixedType(element, clippingParent, strategy) {
      return clippingParent === viewport ? rectToClientRect(getViewportRect(element, strategy)) : isElement(clippingParent) ? getInnerBoundingClientRect(clippingParent, strategy) : rectToClientRect(getDocumentRect(getDocumentElement(element)));
    }
    function getClippingParents(element) {
      var clippingParents2 = listScrollParents(getParentNode(element));
      var canEscapeClipping = ["absolute", "fixed"].indexOf(getComputedStyle$1(element).position) >= 0;
      var clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element;
      if (!isElement(clipperElement)) {
        return [];
      }
      return clippingParents2.filter(function(clippingParent) {
        return isElement(clippingParent) && contains$1(clippingParent, clipperElement) && getNodeName(clippingParent) !== "body";
      });
    }
    function getClippingRect(element, boundary, rootBoundary, strategy) {
      var mainClippingParents = boundary === "clippingParents" ? getClippingParents(element) : [].concat(boundary);
      var clippingParents2 = [].concat(mainClippingParents, [rootBoundary]);
      var firstClippingParent = clippingParents2[0];
      var clippingRect = clippingParents2.reduce(function(accRect, clippingParent) {
        var rect2 = getClientRectFromMixedType(element, clippingParent, strategy);
        accRect.top = max(rect2.top, accRect.top);
        accRect.right = min(rect2.right, accRect.right);
        accRect.bottom = min(rect2.bottom, accRect.bottom);
        accRect.left = max(rect2.left, accRect.left);
        return accRect;
      }, getClientRectFromMixedType(element, firstClippingParent, strategy));
      clippingRect.width = clippingRect.right - clippingRect.left;
      clippingRect.height = clippingRect.bottom - clippingRect.top;
      clippingRect.x = clippingRect.left;
      clippingRect.y = clippingRect.top;
      return clippingRect;
    }
    function computeOffsets(_ref) {
      var reference2 = _ref.reference, element = _ref.element, placement = _ref.placement;
      var basePlacement = placement ? getBasePlacement(placement) : null;
      var variation = placement ? getVariation(placement) : null;
      var commonX = reference2.x + reference2.width / 2 - element.width / 2;
      var commonY = reference2.y + reference2.height / 2 - element.height / 2;
      var offsets;
      switch (basePlacement) {
        case top$1:
          offsets = {
            x: commonX,
            y: reference2.y - element.height
          };
          break;
        case bottom:
          offsets = {
            x: commonX,
            y: reference2.y + reference2.height
          };
          break;
        case right$2:
          offsets = {
            x: reference2.x + reference2.width,
            y: commonY
          };
          break;
        case left$2:
          offsets = {
            x: reference2.x - element.width,
            y: commonY
          };
          break;
        default:
          offsets = {
            x: reference2.x,
            y: reference2.y
          };
      }
      var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null;
      if (mainAxis != null) {
        var len = mainAxis === "y" ? "height" : "width";
        switch (variation) {
          case start:
            offsets[mainAxis] = offsets[mainAxis] - (reference2[len] / 2 - element[len] / 2);
            break;
          case end:
            offsets[mainAxis] = offsets[mainAxis] + (reference2[len] / 2 - element[len] / 2);
            break;
        }
      }
      return offsets;
    }
    function detectOverflow(state, options2) {
      if (options2 === void 0) {
        options2 = {};
      }
      var _options = options2, _options$placement = _options.placement, placement = _options$placement === void 0 ? state.placement : _options$placement, _options$strategy = _options.strategy, strategy = _options$strategy === void 0 ? state.strategy : _options$strategy, _options$boundary = _options.boundary, boundary = _options$boundary === void 0 ? clippingParents : _options$boundary, _options$rootBoundary = _options.rootBoundary, rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary, _options$elementConte = _options.elementContext, elementContext = _options$elementConte === void 0 ? popper : _options$elementConte, _options$altBoundary = _options.altBoundary, altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary, _options$padding = _options.padding, padding = _options$padding === void 0 ? 0 : _options$padding;
      var paddingObject = mergePaddingObject(typeof padding !== "number" ? padding : expandToHashMap(padding, basePlacements));
      var altContext = elementContext === popper ? reference : popper;
      var popperRect = state.rects.popper;
      var element = state.elements[altBoundary ? altContext : elementContext];
      var clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary, strategy);
      var referenceClientRect = getBoundingClientRect(state.elements.reference);
      var popperOffsets2 = computeOffsets({
        reference: referenceClientRect,
        element: popperRect,
        placement
      });
      var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets2));
      var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect;
      var overflowOffsets = {
        top: clippingClientRect.top - elementClientRect.top + paddingObject.top,
        bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,
        left: clippingClientRect.left - elementClientRect.left + paddingObject.left,
        right: elementClientRect.right - clippingClientRect.right + paddingObject.right
      };
      var offsetData = state.modifiersData.offset;
      if (elementContext === popper && offsetData) {
        var offset2 = offsetData[placement];
        Object.keys(overflowOffsets).forEach(function(key2) {
          var multiply = [right$2, bottom].indexOf(key2) >= 0 ? 1 : -1;
          var axis = [top$1, bottom].indexOf(key2) >= 0 ? "y" : "x";
          overflowOffsets[key2] += offset2[axis] * multiply;
        });
      }
      return overflowOffsets;
    }
    function computeAutoPlacement(state, options2) {
      if (options2 === void 0) {
        options2 = {};
      }
      var _options = options2, placement = _options.placement, boundary = _options.boundary, rootBoundary = _options.rootBoundary, padding = _options.padding, flipVariations = _options.flipVariations, _options$allowedAutoP = _options.allowedAutoPlacements, allowedAutoPlacements = _options$allowedAutoP === void 0 ? placements : _options$allowedAutoP;
      var variation = getVariation(placement);
      var placements$1 = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function(placement2) {
        return getVariation(placement2) === variation;
      }) : basePlacements;
      var allowedPlacements = placements$1.filter(function(placement2) {
        return allowedAutoPlacements.indexOf(placement2) >= 0;
      });
      if (allowedPlacements.length === 0) {
        allowedPlacements = placements$1;
      }
      var overflows = allowedPlacements.reduce(function(acc, placement2) {
        acc[placement2] = detectOverflow(state, {
          placement: placement2,
          boundary,
          rootBoundary,
          padding
        })[getBasePlacement(placement2)];
        return acc;
      }, {});
      return Object.keys(overflows).sort(function(a, b) {
        return overflows[a] - overflows[b];
      });
    }
    function getExpandedFallbackPlacements(placement) {
      if (getBasePlacement(placement) === auto) {
        return [];
      }
      var oppositePlacement = getOppositePlacement(placement);
      return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)];
    }
    function flip(_ref) {
      var state = _ref.state, options2 = _ref.options, name2 = _ref.name;
      if (state.modifiersData[name2]._skip) {
        return;
      }
      var _options$mainAxis = options2.mainAxis, checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis, _options$altAxis = options2.altAxis, checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis, specifiedFallbackPlacements = options2.fallbackPlacements, padding = options2.padding, boundary = options2.boundary, rootBoundary = options2.rootBoundary, altBoundary = options2.altBoundary, _options$flipVariatio = options2.flipVariations, flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio, allowedAutoPlacements = options2.allowedAutoPlacements;
      var preferredPlacement = state.options.placement;
      var basePlacement = getBasePlacement(preferredPlacement);
      var isBasePlacement = basePlacement === preferredPlacement;
      var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement));
      var placements2 = [preferredPlacement].concat(fallbackPlacements).reduce(function(acc, placement2) {
        return acc.concat(getBasePlacement(placement2) === auto ? computeAutoPlacement(state, {
          placement: placement2,
          boundary,
          rootBoundary,
          padding,
          flipVariations,
          allowedAutoPlacements
        }) : placement2);
      }, []);
      var referenceRect = state.rects.reference;
      var popperRect = state.rects.popper;
      var checksMap = /* @__PURE__ */ new Map();
      var makeFallbackChecks = true;
      var firstFittingPlacement = placements2[0];
      for (var i2 = 0; i2 < placements2.length; i2++) {
        var placement = placements2[i2];
        var _basePlacement = getBasePlacement(placement);
        var isStartVariation = getVariation(placement) === start;
        var isVertical = [top$1, bottom].indexOf(_basePlacement) >= 0;
        var len = isVertical ? "width" : "height";
        var overflow = detectOverflow(state, {
          placement,
          boundary,
          rootBoundary,
          altBoundary,
          padding
        });
        var mainVariationSide = isVertical ? isStartVariation ? right$2 : left$2 : isStartVariation ? bottom : top$1;
        if (referenceRect[len] > popperRect[len]) {
          mainVariationSide = getOppositePlacement(mainVariationSide);
        }
        var altVariationSide = getOppositePlacement(mainVariationSide);
        var checks = [];
        if (checkMainAxis) {
          checks.push(overflow[_basePlacement] <= 0);
        }
        if (checkAltAxis) {
          checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0);
        }
        if (checks.every(function(check2) {
          return check2;
        })) {
          firstFittingPlacement = placement;
          makeFallbackChecks = false;
          break;
        }
        checksMap.set(placement, checks);
      }
      if (makeFallbackChecks) {
        var numberOfChecks = flipVariations ? 3 : 1;
        var _loop = function _loop2(_i2) {
          var fittingPlacement = placements2.find(function(placement2) {
            var checks2 = checksMap.get(placement2);
            if (checks2) {
              return checks2.slice(0, _i2).every(function(check2) {
                return check2;
              });
            }
          });
          if (fittingPlacement) {
            firstFittingPlacement = fittingPlacement;
            return "break";
          }
        };
        for (var _i = numberOfChecks; _i > 0; _i--) {
          var _ret = _loop(_i);
          if (_ret === "break") break;
        }
      }
      if (state.placement !== firstFittingPlacement) {
        state.modifiersData[name2]._skip = true;
        state.placement = firstFittingPlacement;
        state.reset = true;
      }
    }
    const flip$1 = {
      name: "flip",
      enabled: true,
      phase: "main",
      fn: flip,
      requiresIfExists: ["offset"],
      data: {
        _skip: false
      }
    };
    function getSideOffsets(overflow, rect2, preventedOffsets) {
      if (preventedOffsets === void 0) {
        preventedOffsets = {
          x: 0,
          y: 0
        };
      }
      return {
        top: overflow.top - rect2.height - preventedOffsets.y,
        right: overflow.right - rect2.width + preventedOffsets.x,
        bottom: overflow.bottom - rect2.height + preventedOffsets.y,
        left: overflow.left - rect2.width - preventedOffsets.x
      };
    }
    function isAnySideFullyClipped(overflow) {
      return [top$1, right$2, bottom, left$2].some(function(side) {
        return overflow[side] >= 0;
      });
    }
    function hide(_ref) {
      var state = _ref.state, name2 = _ref.name;
      var referenceRect = state.rects.reference;
      var popperRect = state.rects.popper;
      var preventedOffsets = state.modifiersData.preventOverflow;
      var referenceOverflow = detectOverflow(state, {
        elementContext: "reference"
      });
      var popperAltOverflow = detectOverflow(state, {
        altBoundary: true
      });
      var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect);
      var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets);
      var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets);
      var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets);
      state.modifiersData[name2] = {
        referenceClippingOffsets,
        popperEscapeOffsets,
        isReferenceHidden,
        hasPopperEscaped
      };
      state.attributes.popper = Object.assign({}, state.attributes.popper, {
        "data-popper-reference-hidden": isReferenceHidden,
        "data-popper-escaped": hasPopperEscaped
      });
    }
    const hide$1 = {
      name: "hide",
      enabled: true,
      phase: "main",
      requiresIfExists: ["preventOverflow"],
      fn: hide
    };
    function distanceAndSkiddingToXY(placement, rects, offset2) {
      var basePlacement = getBasePlacement(placement);
      var invertDistance = [left$2, top$1].indexOf(basePlacement) >= 0 ? -1 : 1;
      var _ref = typeof offset2 === "function" ? offset2(Object.assign({}, rects, {
        placement
      })) : offset2, skidding = _ref[0], distance = _ref[1];
      skidding = skidding || 0;
      distance = (distance || 0) * invertDistance;
      return [left$2, right$2].indexOf(basePlacement) >= 0 ? {
        x: distance,
        y: skidding
      } : {
        x: skidding,
        y: distance
      };
    }
    function offset(_ref2) {
      var state = _ref2.state, options2 = _ref2.options, name2 = _ref2.name;
      var _options$offset = options2.offset, offset2 = _options$offset === void 0 ? [0, 0] : _options$offset;
      var data = placements.reduce(function(acc, placement) {
        acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset2);
        return acc;
      }, {});
      var _data$state$placement = data[state.placement], x2 = _data$state$placement.x, y = _data$state$placement.y;
      if (state.modifiersData.popperOffsets != null) {
        state.modifiersData.popperOffsets.x += x2;
        state.modifiersData.popperOffsets.y += y;
      }
      state.modifiersData[name2] = data;
    }
    const offset$1 = {
      name: "offset",
      enabled: true,
      phase: "main",
      requires: ["popperOffsets"],
      fn: offset
    };
    function popperOffsets(_ref) {
      var state = _ref.state, name2 = _ref.name;
      state.modifiersData[name2] = computeOffsets({
        reference: state.rects.reference,
        element: state.rects.popper,
        placement: state.placement
      });
    }
    const popperOffsets$1 = {
      name: "popperOffsets",
      enabled: true,
      phase: "read",
      fn: popperOffsets,
      data: {}
    };
    function getAltAxis(axis) {
      return axis === "x" ? "y" : "x";
    }
    function preventOverflow(_ref) {
      var state = _ref.state, options2 = _ref.options, name2 = _ref.name;
      var _options$mainAxis = options2.mainAxis, checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis, _options$altAxis = options2.altAxis, checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis, boundary = options2.boundary, rootBoundary = options2.rootBoundary, altBoundary = options2.altBoundary, padding = options2.padding, _options$tether = options2.tether, tether = _options$tether === void 0 ? true : _options$tether, _options$tetherOffset = options2.tetherOffset, tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset;
      var overflow = detectOverflow(state, {
        boundary,
        rootBoundary,
        padding,
        altBoundary
      });
      var basePlacement = getBasePlacement(state.placement);
      var variation = getVariation(state.placement);
      var isBasePlacement = !variation;
      var mainAxis = getMainAxisFromPlacement(basePlacement);
      var altAxis = getAltAxis(mainAxis);
      var popperOffsets2 = state.modifiersData.popperOffsets;
      var referenceRect = state.rects.reference;
      var popperRect = state.rects.popper;
      var tetherOffsetValue = typeof tetherOffset === "function" ? tetherOffset(Object.assign({}, state.rects, {
        placement: state.placement
      })) : tetherOffset;
      var normalizedTetherOffsetValue = typeof tetherOffsetValue === "number" ? {
        mainAxis: tetherOffsetValue,
        altAxis: tetherOffsetValue
      } : Object.assign({
        mainAxis: 0,
        altAxis: 0
      }, tetherOffsetValue);
      var offsetModifierState = state.modifiersData.offset ? state.modifiersData.offset[state.placement] : null;
      var data = {
        x: 0,
        y: 0
      };
      if (!popperOffsets2) {
        return;
      }
      if (checkMainAxis) {
        var _offsetModifierState$;
        var mainSide = mainAxis === "y" ? top$1 : left$2;
        var altSide = mainAxis === "y" ? bottom : right$2;
        var len = mainAxis === "y" ? "height" : "width";
        var offset2 = popperOffsets2[mainAxis];
        var min$1 = offset2 + overflow[mainSide];
        var max$12 = offset2 - overflow[altSide];
        var additive = tether ? -popperRect[len] / 2 : 0;
        var minLen = variation === start ? referenceRect[len] : popperRect[len];
        var maxLen = variation === start ? -popperRect[len] : -referenceRect[len];
        var arrowElement = state.elements.arrow;
        var arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : {
          width: 0,
          height: 0
        };
        var arrowPaddingObject = state.modifiersData["arrow#persistent"] ? state.modifiersData["arrow#persistent"].padding : getFreshSideObject();
        var arrowPaddingMin = arrowPaddingObject[mainSide];
        var arrowPaddingMax = arrowPaddingObject[altSide];
        var arrowLen = within(0, referenceRect[len], arrowRect[len]);
        var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis;
        var maxOffset2 = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis;
        var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow);
        var clientOffset = arrowOffsetParent ? mainAxis === "y" ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0;
        var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0;
        var tetherMin = offset2 + minOffset - offsetModifierValue - clientOffset;
        var tetherMax = offset2 + maxOffset2 - offsetModifierValue;
        var preventedOffset = within(tether ? min(min$1, tetherMin) : min$1, offset2, tether ? max(max$12, tetherMax) : max$12);
        popperOffsets2[mainAxis] = preventedOffset;
        data[mainAxis] = preventedOffset - offset2;
      }
      if (checkAltAxis) {
        var _offsetModifierState$2;
        var _mainSide = mainAxis === "x" ? top$1 : left$2;
        var _altSide = mainAxis === "x" ? bottom : right$2;
        var _offset = popperOffsets2[altAxis];
        var _len = altAxis === "y" ? "height" : "width";
        var _min = _offset + overflow[_mainSide];
        var _max = _offset - overflow[_altSide];
        var isOriginSide = [top$1, left$2].indexOf(basePlacement) !== -1;
        var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0;
        var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis;
        var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max;
        var _preventedOffset = tether && isOriginSide ? withinMaxClamp(_tetherMin, _offset, _tetherMax) : within(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max);
        popperOffsets2[altAxis] = _preventedOffset;
        data[altAxis] = _preventedOffset - _offset;
      }
      state.modifiersData[name2] = data;
    }
    const preventOverflow$1 = {
      name: "preventOverflow",
      enabled: true,
      phase: "main",
      fn: preventOverflow,
      requiresIfExists: ["offset"]
    };
    function getHTMLElementScroll(element) {
      return {
        scrollLeft: element.scrollLeft,
        scrollTop: element.scrollTop
      };
    }
    function getNodeScroll(node2) {
      if (node2 === getWindow(node2) || !isHTMLElement(node2)) {
        return getWindowScroll(node2);
      } else {
        return getHTMLElementScroll(node2);
      }
    }
    function isElementScaled(element) {
      var rect2 = element.getBoundingClientRect();
      var scaleX = round(rect2.width) / element.offsetWidth || 1;
      var scaleY = round(rect2.height) / element.offsetHeight || 1;
      return scaleX !== 1 || scaleY !== 1;
    }
    function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {
      if (isFixed === void 0) {
        isFixed = false;
      }
      var isOffsetParentAnElement = isHTMLElement(offsetParent);
      var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent);
      var documentElement = getDocumentElement(offsetParent);
      var rect2 = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled, isFixed);
      var scroll = {
        scrollLeft: 0,
        scrollTop: 0
      };
      var offsets = {
        x: 0,
        y: 0
      };
      if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
        if (getNodeName(offsetParent) !== "body" || // https://github.com/popperjs/popper-core/issues/1078
        isScrollParent(documentElement)) {
          scroll = getNodeScroll(offsetParent);
        }
        if (isHTMLElement(offsetParent)) {
          offsets = getBoundingClientRect(offsetParent, true);
          offsets.x += offsetParent.clientLeft;
          offsets.y += offsetParent.clientTop;
        } else if (documentElement) {
          offsets.x = getWindowScrollBarX(documentElement);
        }
      }
      return {
        x: rect2.left + scroll.scrollLeft - offsets.x,
        y: rect2.top + scroll.scrollTop - offsets.y,
        width: rect2.width,
        height: rect2.height
      };
    }
    function order(modifiers2) {
      var map2 = /* @__PURE__ */ new Map();
      var visited = /* @__PURE__ */ new Set();
      var result2 = [];
      modifiers2.forEach(function(modifier) {
        map2.set(modifier.name, modifier);
      });
      function sort2(modifier) {
        visited.add(modifier.name);
        var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []);
        requires.forEach(function(dep) {
          if (!visited.has(dep)) {
            var depModifier = map2.get(dep);
            if (depModifier) {
              sort2(depModifier);
            }
          }
        });
        result2.push(modifier);
      }
      modifiers2.forEach(function(modifier) {
        if (!visited.has(modifier.name)) {
          sort2(modifier);
        }
      });
      return result2;
    }
    function orderModifiers(modifiers2) {
      var orderedModifiers = order(modifiers2);
      return modifierPhases.reduce(function(acc, phase) {
        return acc.concat(orderedModifiers.filter(function(modifier) {
          return modifier.phase === phase;
        }));
      }, []);
    }
    function debounce$1(fn2) {
      var pending;
      return function() {
        if (!pending) {
          pending = new Promise(function(resolve) {
            Promise.resolve().then(function() {
              pending = void 0;
              resolve(fn2());
            });
          });
        }
        return pending;
      };
    }
    function mergeByName(modifiers2) {
      var merged = modifiers2.reduce(function(merged2, current2) {
        var existing = merged2[current2.name];
        merged2[current2.name] = existing ? Object.assign({}, existing, current2, {
          options: Object.assign({}, existing.options, current2.options),
          data: Object.assign({}, existing.data, current2.data)
        }) : current2;
        return merged2;
      }, {});
      return Object.keys(merged).map(function(key2) {
        return merged[key2];
      });
    }
    var DEFAULT_OPTIONS = {
      placement: "bottom",
      modifiers: [],
      strategy: "absolute"
    };
    function areValidElements() {
      for (var _len = arguments.length, args2 = new Array(_len), _key = 0; _key < _len; _key++) {
        args2[_key] = arguments[_key];
      }
      return !args2.some(function(element) {
        return !(element && typeof element.getBoundingClientRect === "function");
      });
    }
    function popperGenerator(generatorOptions) {
      if (generatorOptions === void 0) {
        generatorOptions = {};
      }
      var _generatorOptions = generatorOptions, _generatorOptions$def = _generatorOptions.defaultModifiers, defaultModifiers2 = _generatorOptions$def === void 0 ? [] : _generatorOptions$def, _generatorOptions$def2 = _generatorOptions.defaultOptions, defaultOptions2 = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2;
      return function createPopper2(reference2, popper2, options2) {
        if (options2 === void 0) {
          options2 = defaultOptions2;
        }
        var state = {
          placement: "bottom",
          orderedModifiers: [],
          options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions2),
          modifiersData: {},
          elements: {
            reference: reference2,
            popper: popper2
          },
          attributes: {},
          styles: {}
        };
        var effectCleanupFns = [];
        var isDestroyed2 = false;
        var instance = {
          state,
          setOptions: function setOptions(setOptionsAction) {
            var options3 = typeof setOptionsAction === "function" ? setOptionsAction(state.options) : setOptionsAction;
            cleanupModifierEffects();
            state.options = Object.assign({}, defaultOptions2, state.options, options3);
            state.scrollParents = {
              reference: isElement(reference2) ? listScrollParents(reference2) : reference2.contextElement ? listScrollParents(reference2.contextElement) : [],
              popper: listScrollParents(popper2)
            };
            var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers2, state.options.modifiers)));
            state.orderedModifiers = orderedModifiers.filter(function(m) {
              return m.enabled;
            });
            runModifierEffects();
            return instance.update();
          },
          // Sync update – it will always be executed, even if not necessary. This
          // is useful for low frequency updates where sync behavior simplifies the
          // logic.
          // For high frequency updates (e.g. `resize` and `scroll` events), always
          // prefer the async Popper#update method
          forceUpdate: function forceUpdate() {
            if (isDestroyed2) {
              return;
            }
            var _state$elements = state.elements, reference3 = _state$elements.reference, popper3 = _state$elements.popper;
            if (!areValidElements(reference3, popper3)) {
              return;
            }
            state.rects = {
              reference: getCompositeRect(reference3, getOffsetParent(popper3), state.options.strategy === "fixed"),
              popper: getLayoutRect(popper3)
            };
            state.reset = false;
            state.placement = state.options.placement;
            state.orderedModifiers.forEach(function(modifier) {
              return state.modifiersData[modifier.name] = Object.assign({}, modifier.data);
            });
            for (var index = 0; index < state.orderedModifiers.length; index++) {
              if (state.reset === true) {
                state.reset = false;
                index = -1;
                continue;
              }
              var _state$orderedModifie = state.orderedModifiers[index], fn2 = _state$orderedModifie.fn, _state$orderedModifie2 = _state$orderedModifie.options, _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2, name2 = _state$orderedModifie.name;
              if (typeof fn2 === "function") {
                state = fn2({
                  state,
                  options: _options,
                  name: name2,
                  instance
                }) || state;
              }
            }
          },
          // Async and optimistically optimized update – it will not be executed if
          // not necessary (debounced to run at most once-per-tick)
          update: debounce$1(function() {
            return new Promise(function(resolve) {
              instance.forceUpdate();
              resolve(state);
            });
          }),
          destroy: function destroy2() {
            cleanupModifierEffects();
            isDestroyed2 = true;
          }
        };
        if (!areValidElements(reference2, popper2)) {
          return instance;
        }
        instance.setOptions(options2).then(function(state2) {
          if (!isDestroyed2 && options2.onFirstUpdate) {
            options2.onFirstUpdate(state2);
          }
        });
        function runModifierEffects() {
          state.orderedModifiers.forEach(function(_ref) {
            var name2 = _ref.name, _ref$options = _ref.options, options3 = _ref$options === void 0 ? {} : _ref$options, effect2 = _ref.effect;
            if (typeof effect2 === "function") {
              var cleanupFn = effect2({
                state,
                name: name2,
                instance,
                options: options3
              });
              var noopFn = function noopFn2() {
              };
              effectCleanupFns.push(cleanupFn || noopFn);
            }
          });
        }
        function cleanupModifierEffects() {
          effectCleanupFns.forEach(function(fn2) {
            return fn2();
          });
          effectCleanupFns = [];
        }
        return instance;
      };
    }
    var defaultModifiers = [eventListeners, popperOffsets$1, computeStyles$1, applyStyles$1, offset$1, flip$1, preventOverflow$1, arrow$1, hide$1];
    var createPopper = /* @__PURE__ */ popperGenerator({
      defaultModifiers
    });
    var reactFastCompare;
    var hasRequiredReactFastCompare;
    function requireReactFastCompare() {
      if (hasRequiredReactFastCompare) return reactFastCompare;
      hasRequiredReactFastCompare = 1;
      var hasElementType = typeof Element !== "undefined";
      var hasMap = typeof Map === "function";
      var hasSet = typeof Set === "function";
      var hasArrayBuffer = typeof ArrayBuffer === "function" && !!ArrayBuffer.isView;
      function equal(a, b) {
        if (a === b) return true;
        if (a && b && typeof a == "object" && typeof b == "object") {
          if (a.constructor !== b.constructor) return false;
          var length, i2, keys;
          if (Array.isArray(a)) {
            length = a.length;
            if (length != b.length) return false;
            for (i2 = length; i2-- !== 0; )
              if (!equal(a[i2], b[i2])) return false;
            return true;
          }
          var it2;
          if (hasMap && a instanceof Map && b instanceof Map) {
            if (a.size !== b.size) return false;
            it2 = a.entries();
            while (!(i2 = it2.next()).done)
              if (!b.has(i2.value[0])) return false;
            it2 = a.entries();
            while (!(i2 = it2.next()).done)
              if (!equal(i2.value[1], b.get(i2.value[0]))) return false;
            return true;
          }
          if (hasSet && a instanceof Set && b instanceof Set) {
            if (a.size !== b.size) return false;
            it2 = a.entries();
            while (!(i2 = it2.next()).done)
              if (!b.has(i2.value[0])) return false;
            return true;
          }
          if (hasArrayBuffer && ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) {
            length = a.length;
            if (length != b.length) return false;
            for (i2 = length; i2-- !== 0; )
              if (a[i2] !== b[i2]) return false;
            return true;
          }
          if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;
          if (a.valueOf !== Object.prototype.valueOf && typeof a.valueOf === "function" && typeof b.valueOf === "function") return a.valueOf() === b.valueOf();
          if (a.toString !== Object.prototype.toString && typeof a.toString === "function" && typeof b.toString === "function") return a.toString() === b.toString();
          keys = Object.keys(a);
          length = keys.length;
          if (length !== Object.keys(b).length) return false;
          for (i2 = length; i2-- !== 0; )
            if (!Object.prototype.hasOwnProperty.call(b, keys[i2])) return false;
          if (hasElementType && a instanceof Element) return false;
          for (i2 = length; i2-- !== 0; ) {
            if ((keys[i2] === "_owner" || keys[i2] === "__v" || keys[i2] === "__o") && a.$$typeof) {
              continue;
            }
            if (!equal(a[keys[i2]], b[keys[i2]])) return false;
          }
          return true;
        }
        return a !== a && b !== b;
      }
      reactFastCompare = function isEqual2(a, b) {
        try {
          return equal(a, b);
        } catch (error2) {
          if ((error2.message || "").match(/stack|recursion/i)) {
            console.warn("react-fast-compare cannot handle circular refs");
            return false;
          }
          throw error2;
        }
      };
      return reactFastCompare;
    }
    var reactFastCompareExports = requireReactFastCompare();
    const isEqual = /* @__PURE__ */ getDefaultExportFromCjs(reactFastCompareExports);
    var EMPTY_MODIFIERS = [];
    var usePopper = function usePopper2(referenceElement, popperElement, options2) {
      if (options2 === void 0) {
        options2 = {};
      }
      var prevOptions = reactExports.useRef(null);
      var optionsWithDefaults = {
        onFirstUpdate: options2.onFirstUpdate,
        placement: options2.placement || "bottom",
        strategy: options2.strategy || "absolute",
        modifiers: options2.modifiers || EMPTY_MODIFIERS
      };
      var _React$useState = reactExports.useState({
        styles: {
          popper: {
            position: optionsWithDefaults.strategy,
            left: "0",
            top: "0"
          },
          arrow: {
            position: "absolute"
          }
        },
        attributes: {}
      }), state = _React$useState[0], setState2 = _React$useState[1];
      var updateStateModifier = reactExports.useMemo(function() {
        return {
          name: "updateState",
          enabled: true,
          phase: "write",
          fn: function fn2(_ref) {
            var state2 = _ref.state;
            var elements = Object.keys(state2.elements);
            reactDomExports.flushSync(function() {
              setState2({
                styles: fromEntries(elements.map(function(element) {
                  return [element, state2.styles[element] || {}];
                })),
                attributes: fromEntries(elements.map(function(element) {
                  return [element, state2.attributes[element]];
                }))
              });
            });
          },
          requires: ["computeStyles"]
        };
      }, []);
      var popperOptions = reactExports.useMemo(function() {
        var newOptions = {
          onFirstUpdate: optionsWithDefaults.onFirstUpdate,
          placement: optionsWithDefaults.placement,
          strategy: optionsWithDefaults.strategy,
          modifiers: [].concat(optionsWithDefaults.modifiers, [updateStateModifier, {
            name: "applyStyles",
            enabled: false
          }])
        };
        if (isEqual(prevOptions.current, newOptions)) {
          return prevOptions.current || newOptions;
        } else {
          prevOptions.current = newOptions;
          return newOptions;
        }
      }, [optionsWithDefaults.onFirstUpdate, optionsWithDefaults.placement, optionsWithDefaults.strategy, optionsWithDefaults.modifiers, updateStateModifier]);
      var popperInstanceRef = reactExports.useRef();
      useIsomorphicLayoutEffect(function() {
        if (popperInstanceRef.current) {
          popperInstanceRef.current.setOptions(popperOptions);
        }
      }, [popperOptions]);
      useIsomorphicLayoutEffect(function() {
        if (referenceElement == null || popperElement == null) {
          return;
        }
        var createPopper$1 = options2.createPopper || createPopper;
        var popperInstance = createPopper$1(referenceElement, popperElement, popperOptions);
        popperInstanceRef.current = popperInstance;
        return function() {
          popperInstance.destroy();
          popperInstanceRef.current = null;
        };
      }, [referenceElement, popperElement, options2.createPopper]);
      return {
        state: popperInstanceRef.current ? popperInstanceRef.current.state : null,
        styles: state.styles,
        attributes: state.attributes,
        update: popperInstanceRef.current ? popperInstanceRef.current.update : null,
        forceUpdate: popperInstanceRef.current ? popperInstanceRef.current.forceUpdate : null
      };
    };
    const PopOver = ({
      id,
      isOpen,
      setIsOpen,
      positionEl,
      children: children2,
      placement = "bottom",
      showArrow = true,
      offset: offset2 = [0, 8],
      className: className2 = "",
      arrowClassName = "",
      usePortal = true,
      hoverDelay = 250,
      styles: styles2 = {}
    }) => {
      const popperRef = reactExports.useRef(null);
      const arrowRef = reactExports.useRef(null);
      const [portalContainer, setPortalContainer] = reactExports.useState(
        null
      );
      const [shouldShowPopover, setShouldShowPopover] = reactExports.useState(false);
      const hoverTimerRef = reactExports.useRef(null);
      const isMouseMovingRef = reactExports.useRef(false);
      reactExports.useEffect(() => {
        const handleMouseMove = () => {
          isMouseMovingRef.current = true;
          if (hoverTimerRef.current !== null) {
            window.clearTimeout(hoverTimerRef.current);
          }
          hoverTimerRef.current = window.setTimeout(() => {
            if (isOpen) {
              isMouseMovingRef.current = false;
              setShouldShowPopover(true);
            }
          }, hoverDelay);
        };
        const handleMouseLeave = () => {
          if (hoverTimerRef.current !== null) {
            window.clearTimeout(hoverTimerRef.current);
          }
          isMouseMovingRef.current = false;
          setShouldShowPopover(false);
        };
        const handleMouseDown = (event) => {
          if (popperRef.current && !popperRef.current.contains(event.target)) {
            if (hoverTimerRef.current !== null) {
              window.clearTimeout(hoverTimerRef.current);
            }
            setShouldShowPopover(false);
            setIsOpen(false);
          }
        };
        if (!isOpen || hoverDelay <= 0) {
          setShouldShowPopover(isOpen);
          const listener = (event) => {
            if (popperRef.current && !popperRef.current.contains(event.target)) {
              event.preventDefault();
              event.stopPropagation();
              setIsOpen(false);
            }
          };
          document.addEventListener("click", listener, true);
          return () => {
            document.removeEventListener("click", listener, true);
          };
        }
        if (positionEl && isOpen) {
          positionEl.addEventListener("mousemove", handleMouseMove);
          positionEl.addEventListener("mouseleave", handleMouseLeave);
          document.addEventListener("mousedown", handleMouseDown);
          handleMouseMove();
        } else {
          setShouldShowPopover(false);
        }
        return () => {
          if (positionEl) {
            positionEl.removeEventListener("mousemove", handleMouseMove);
            positionEl.removeEventListener("mouseleave", handleMouseLeave);
          }
          document.removeEventListener("mousedown", handleMouseDown);
          if (hoverTimerRef.current !== null) {
            window.clearTimeout(hoverTimerRef.current);
          }
        };
      }, [isOpen, positionEl, hoverDelay, setIsOpen]);
      reactExports.useEffect(() => {
        if (usePortal && isOpen && shouldShowPopover) {
          let container2 = document.getElementById(id);
          if (!container2) {
            container2 = document.createElement("div");
            container2.id = id;
            container2.style.position = "absolute";
            container2.style.top = "0";
            container2.style.left = "0";
            container2.style.zIndex = "9999";
            container2.style.width = "0";
            container2.style.height = "0";
            container2.style.overflow = "visible";
            document.body.appendChild(container2);
          }
          setPortalContainer(container2);
          return () => {
            if (document.body.contains(container2)) {
              document.body.removeChild(container2);
              setPortalContainer(null);
            }
          };
        }
        return void 0;
      }, [usePortal, isOpen, shouldShowPopover, id]);
      const modifiers2 = [
        { name: "offset", options: { offset: offset2 } },
        { name: "preventOverflow", options: { padding: 8 } },
        {
          name: "arrow",
          enabled: showArrow,
          options: {
            element: arrowRef.current,
            padding: 5
            // This keeps the arrow from getting too close to the corner
          }
        },
        {
          name: "computeStyles",
          options: {
            gpuAcceleration: false,
            adaptive: true
          }
        },
        // Ensure popper is positioned correctly with respect to its reference element
        {
          name: "flip",
          options: {
            fallbackPlacements: ["top", "right", "bottom", "left"]
          }
        }
      ];
      const {
        styles: popperStyles,
        attributes: attributes2,
        state,
        update
      } = usePopper(positionEl, popperRef.current, {
        placement,
        strategy: "fixed",
        modifiers: modifiers2
      });
      reactExports.useEffect(() => {
        if (update && isOpen && shouldShowPopover) {
          const timer = setTimeout(() => {
            update();
          }, 10);
          return () => clearTimeout(timer);
        }
      }, [update, isOpen, shouldShowPopover, showArrow]);
      const getArrowDataPlacement = () => {
        if (!state || !state.placement) return placement;
        return state.placement;
      };
      const actualPlacement = state?.placement || placement;
      const defaultPopperStyles = {
        backgroundColor: "var(--bs-body-bg)",
        padding: "12px",
        borderRadius: "4px",
        boxShadow: "0 2px 10px rgba(0,0,0,0.1)",
        border: "solid 1px var(--bs-border-color)",
        zIndex: 1200,
        position: "relative",
        // Apply opacity transition to smooth the appearance
        opacity: state?.placement ? 1 : 0,
        transition: "opacity 0.1s"
      };
      if (!isOpen || hoverDelay > 0 && !shouldShowPopover) {
        return null;
      }
      const positionedStyle = state && state.styles && state.styles.popper ? {
        ...popperStyles.popper,
        opacity: 1
      } : {
        ...popperStyles.popper,
        opacity: 0,
        // Position offscreen initially to prevent flicker
        position: "fixed",
        top: "-9999px",
        left: "-9999px"
      };
      const popperContent = /* @__PURE__ */ jsxRuntimeExports.jsxs(
        "div",
        {
          ref: popperRef,
          style: { ...defaultPopperStyles, ...positionedStyle, ...styles2 },
          className: clsx(className2),
          ...attributes2.popper,
          children: [
            children2,
            showArrow && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx(
                "div",
                {
                  ref: arrowRef,
                  style: { position: "absolute", visibility: "hidden" },
                  "data-placement": getArrowDataPlacement()
                }
              ),
              /* @__PURE__ */ jsxRuntimeExports.jsxs(
                "div",
                {
                  className: clsx("popper-arrow-container", arrowClassName),
                  style: {
                    ...popperStyles.arrow,
                    position: "absolute",
                    zIndex: 1,
                    // Size and positioning based on placement - smaller arrow
                    ...actualPlacement.startsWith("top") && {
                      bottom: "-8px",
                      width: "16px",
                      height: "8px"
                    },
                    ...actualPlacement.startsWith("bottom") && {
                      top: "-8px",
                      width: "16px",
                      height: "8px"
                    },
                    ...actualPlacement.startsWith("left") && {
                      right: "-8px",
                      width: "8px",
                      height: "16px"
                    },
                    ...actualPlacement.startsWith("right") && {
                      left: "-8px",
                      width: "8px",
                      height: "16px"
                    },
                    // Content positioning
                    overflow: "hidden"
                  },
                  children: [
                    actualPlacement.startsWith("top") && /* @__PURE__ */ jsxRuntimeExports.jsx(
                      "div",
                      {
                        style: {
                          position: "absolute",
                          width: 0,
                          height: 0,
                          borderStyle: "solid",
                          borderWidth: "8px 8px 0 8px",
                          borderColor: "#eee transparent transparent transparent",
                          top: "0px",
                          left: "0px"
                        }
                      }
                    ),
                    actualPlacement.startsWith("bottom") && /* @__PURE__ */ jsxRuntimeExports.jsx(
                      "div",
                      {
                        style: {
                          position: "absolute",
                          width: 0,
                          height: 0,
                          borderStyle: "solid",
                          borderWidth: "0 8px 8px 8px",
                          borderColor: "transparent transparent #eee transparent",
                          top: "0px",
                          left: "0px"
                        }
                      }
                    ),
                    actualPlacement.startsWith("left") && /* @__PURE__ */ jsxRuntimeExports.jsx(
                      "div",
                      {
                        style: {
                          position: "absolute",
                          width: 0,
                          height: 0,
                          borderStyle: "solid",
                          borderWidth: "8px 0 8px 8px",
                          borderColor: "transparent transparent transparent #eee",
                          top: "0px",
                          left: "0px"
                        }
                      }
                    ),
                    actualPlacement.startsWith("right") && /* @__PURE__ */ jsxRuntimeExports.jsx(
                      "div",
                      {
                        style: {
                          position: "absolute",
                          width: 0,
                          height: 0,
                          borderStyle: "solid",
                          borderWidth: "8px 8px 8px 0",
                          borderColor: "transparent #eee transparent transparent",
                          top: "0px",
                          left: "0px"
                        }
                      }
                    ),
                    /* @__PURE__ */ jsxRuntimeExports.jsx(
                      "div",
                      {
                        style: {
                          position: "absolute",
                          width: 0,
                          height: 0,
                          borderStyle: "solid",
                          backgroundColor: "transparent",
                          // Position relative to border triangle
                          left: "0px",
                          zIndex: 1,
                          // Top placement - pointing down
                          ...actualPlacement.startsWith("top") && {
                            borderWidth: "7px 7px 0 7px",
                            borderColor: "white transparent transparent transparent",
                            top: "0px"
                          },
                          // Bottom placement - pointing up
                          ...actualPlacement.startsWith("bottom") && {
                            borderWidth: "0 7px 7px 7px",
                            borderColor: "transparent transparent white transparent",
                            top: "1px"
                          },
                          // Left placement - pointing right
                          ...actualPlacement.startsWith("left") && {
                            borderWidth: "7px 0 7px 7px",
                            borderColor: "transparent transparent transparent white",
                            left: "0px"
                          },
                          // Right placement - pointing left
                          ...actualPlacement.startsWith("right") && {
                            borderWidth: "7px 7px 7px 0",
                            borderColor: "transparent white transparent transparent",
                            left: "1px"
                          }
                        }
                      }
                    )
                  ]
                }
              )
            ] })
          ]
        }
      );
      if (usePortal && portalContainer) {
        return reactDomExports.createPortal(popperContent, portalContainer);
      }
      return popperContent;
    };
    const container$k = "_container_e3s30_1";
    const fullWidth$2 = "_fullWidth_e3s30_9";
    const fullWidthPadded = "_fullWidthPadded_e3s30_13";
    const spacer$1 = "_spacer_e3s30_18";
    const logDir = "_logDir_e3s30_38";
    const clearButton = "_clearButton_e3s30_52";
    const message$2 = "_message_e3s30_56";
    const messageSuccess = "_messageSuccess_e3s30_64";
    const messageError = "_messageError_e3s30_69";
    const styles$1i = {
      container: container$k,
      fullWidth: fullWidth$2,
      fullWidthPadded,
      spacer: spacer$1,
      logDir,
      clearButton,
      message: message$2,
      messageSuccess,
      messageError
    };
    const ViewerOptionsPopover = ({
      showing,
      positionEl,
      setShowing
    }) => {
      const [isClearing, setIsClearing] = reactExports.useState(false);
      const [clearMessage, setClearMessage] = reactExports.useState(null);
      const replicationService = useStore((state) => state.replicationService);
      const dbStats = useStore((state) => state.logs.dbStats);
      const logDir2 = useStore((state) => state.logs.logDir);
      const handleClearDatabase = async () => {
        if (!replicationService) {
          setClearMessage("Database service not available");
          setTimeout(() => setClearMessage(null), 3e3);
          return;
        }
        setIsClearing(true);
        setClearMessage(null);
        try {
          await replicationService.clearData();
          setClearMessage("Database cleared successfully");
          setTimeout(() => setClearMessage(null), 3e3);
        } catch (error2) {
          console.error("Failed to clear database:", error2);
          setClearMessage("Failed to clear database");
          setTimeout(() => setClearMessage(null), 3e3);
        } finally {
          setIsClearing(false);
        }
      };
      return /* @__PURE__ */ jsxRuntimeExports.jsx(
        PopOver,
        {
          id: `viewer-options-filter-popover`,
          positionEl,
          isOpen: showing,
          setIsOpen: setShowing,
          placement: "auto",
          hoverDelay: -1,
          offset: [-10, 5],
          showArrow: false,
          children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$1i.container, "text-size-smaller"), children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              "div",
              {
                className: clsx(
                  "text-style-label",
                  "text-style-secondary",
                  styles$1i.fullWidth
                ),
                children: "Log Directory"
              }
            ),
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$1i.fullWidth, styles$1i.fullWidthPadded), children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: styles$1i.logDir, children: logDir2 }) }),
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$1i.spacer) }),
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx("text-style-label", "text-style-secondary"), children: "Version" }),
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(), children: "0.3.160-7-ga0412a414" }),
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx("text-style-label", "text-style-secondary"), children: "Schema" }),
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(), children: DB_VERSION }),
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$1i.spacer) }),
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx("text-style-label", "text-style-secondary"), children: "Logs" }),
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(), children: dbStats?.logCount || 0 }),
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx("text-style-label", "text-style-secondary"), children: "Log Previews" }),
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(), children: dbStats?.previewCount || 0 }),
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx("text-style-label", "text-style-secondary"), children: "Log Details" }),
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(), children: dbStats?.detailsCount || 0 }),
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$1i.spacer) }),
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx("text-style-label", "text-style-secondary"), children: "Tools" }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(), children: [
              " ",
              /* @__PURE__ */ jsxRuntimeExports.jsx(
                "button",
                {
                  onClick: handleClearDatabase,
                  disabled: isClearing,
                  className: clsx(
                    "btn",
                    "btn-tools",
                    "text-size-smallest",
                    styles$1i.clearButton
                  ),
                  children: isClearing ? "Clearing..." : "Clear Local Database"
                }
              )
            ] }),
            clearMessage && /* @__PURE__ */ jsxRuntimeExports.jsx(
              "div",
              {
                className: clsx(
                  styles$1i.fullWidth,
                  styles$1i.message,
                  clearMessage.includes("success") ? styles$1i.messageSuccess : styles$1i.messageError
                ),
                children: clearMessage
              }
            )
          ] })
        }
      );
    };
    const header$3 = "_header_1u3sd_1";
    const bordered = "_bordered_1u3sd_11";
    const breadcrumbs = "_breadcrumbs_1u3sd_15";
    const ellipsis = "_ellipsis_1u3sd_26";
    const left$1 = "_left_1u3sd_31";
    const right$1 = "_right_1u3sd_41";
    const toolbarButton = "_toolbarButton_1u3sd_50";
    const pathContainer = "_pathContainer_1u3sd_58";
    const styles$1h = {
      header: header$3,
      bordered,
      breadcrumbs,
      ellipsis,
      left: left$1,
      right: right$1,
      toolbarButton,
      pathContainer
    };
    const useBreadcrumbTruncation = (segments2, containerRef) => {
      const [truncatedData, setTruncatedData] = reactExports.useState({
        visibleSegments: segments2,
        hiddenCount: 0,
        showEllipsis: false
      });
      const measureAndTruncate = reactExports.useCallback(() => {
        if (!containerRef.current || segments2.length <= 3) {
          setTruncatedData({
            visibleSegments: segments2,
            hiddenCount: 0,
            showEllipsis: false
          });
          return;
        }
        const container2 = containerRef.current;
        const containerWidth = container2.offsetWidth;
        const testElement = document.createElement("ol");
        testElement.className = "breadcrumb";
        testElement.style.position = "absolute";
        testElement.style.visibility = "hidden";
        testElement.style.whiteSpace = "nowrap";
        testElement.style.margin = "0";
        testElement.style.padding = "0";
        container2.appendChild(testElement);
        testElement.innerHTML = segments2.map((segment2) => `<li class="breadcrumb-item">${segment2.text}</li>`).join("");
        if (testElement.scrollWidth <= containerWidth) {
          container2.removeChild(testElement);
          setTruncatedData({
            visibleSegments: segments2,
            hiddenCount: 0,
            showEllipsis: false
          });
          return;
        }
        const firstSegment = segments2[0];
        const lastSegment = segments2[segments2.length - 1];
        let maxVisible = 2;
        for (let endCount = 1; endCount < segments2.length - 1; endCount++) {
          const candidateSegments = [
            firstSegment,
            ...segments2.slice(segments2.length - 1 - endCount, -1),
            lastSegment
          ];
          const testHTML = [
            `<li class="breadcrumb-item">${firstSegment.text}</li>`,
            `<li class="breadcrumb-item">...</li>`,
            ...segments2.slice(segments2.length - 1 - endCount, -1).map((s) => `<li class="breadcrumb-item">${s.text}</li>`),
            `<li class="breadcrumb-item">${lastSegment.text}</li>`
          ].join("");
          testElement.innerHTML = testHTML;
          if (testElement.scrollWidth <= containerWidth) {
            maxVisible = candidateSegments.length;
            setTruncatedData({
              visibleSegments: candidateSegments,
              hiddenCount: segments2.length - candidateSegments.length,
              showEllipsis: true
            });
          } else {
            break;
          }
        }
        if (maxVisible === 2) {
          setTruncatedData({
            visibleSegments: [firstSegment, lastSegment],
            hiddenCount: segments2.length - 2,
            showEllipsis: true
          });
        }
        container2.removeChild(testElement);
      }, [segments2, containerRef]);
      reactExports.useEffect(() => {
        measureAndTruncate();
        const resizeObserver = new ResizeObserver(measureAndTruncate);
        if (containerRef.current) {
          resizeObserver.observe(containerRef.current);
        }
        return () => {
          resizeObserver.disconnect();
        };
      }, [containerRef, measureAndTruncate]);
      return truncatedData;
    };
    const Navbar = ({
      fnNavigationUrl,
      bordered: bordered2,
      children: children2,
      currentPath
    }) => {
      const logDir2 = useStore((state) => state.logs.logDir);
      const baseLogDir = dirname(logDir2 || "");
      const baseLogName = basename(logDir2 || "");
      const pathContainerRef = reactExports.useRef(null);
      const backUrl = fnNavigationUrl(
        ensureTrailingSlash(dirname(currentPath || "")),
        logDir2
      );
      const segments2 = reactExports.useMemo(() => {
        const pathSegments = currentPath ? currentPath.split("/") : [];
        const dirSegments = [];
        const currentSegment = [];
        for (const pathSegment of pathSegments) {
          currentSegment.push(pathSegment);
          const segmentUrl = fnNavigationUrl(currentSegment.join("/"), logDir2);
          dirSegments.push({
            text: pathSegment,
            url: segmentUrl
          });
        }
        return [
          { text: prettyDirUri(baseLogDir) },
          { text: baseLogName, url: fnNavigationUrl("", logDir2) },
          ...dirSegments
        ];
      }, [baseLogDir, baseLogName, currentPath, fnNavigationUrl, logDir2]);
      const { visibleSegments, showEllipsis } = useBreadcrumbTruncation(
        segments2,
        pathContainerRef
      );
      return /* @__PURE__ */ jsxRuntimeExports.jsxs(
        "nav",
        {
          className: clsx(
            "text-size-smaller",
            "header-nav",
            styles$1h.header,
            bordered2 === false ? null : styles$1h.bordered
          ),
          "aria-label": "breadcrumb",
          "data-unsearchable": true,
          children: [
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$1h.left), children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx(Link, { to: backUrl, className: clsx(styles$1h.toolbarButton), children: /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: clsx(ApplicationIcons.navbar.back) }) }),
              /* @__PURE__ */ jsxRuntimeExports.jsx(
                Link,
                {
                  to: fnNavigationUrl("", logDir2),
                  className: clsx(styles$1h.toolbarButton),
                  children: /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: clsx(ApplicationIcons.navbar.home) })
                }
              ),
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$1h.pathContainer), ref: pathContainerRef, children: logDir2 ? /* @__PURE__ */ jsxRuntimeExports.jsx("ol", { className: clsx("breadcrumb", styles$1h.breadcrumbs), children: visibleSegments?.map((segment2, index) => {
                const isLast = index === visibleSegments.length - 1;
                const shouldShowEllipsis = showEllipsis && index === 1 && visibleSegments.length >= 2;
                return /* @__PURE__ */ jsxRuntimeExports.jsxs(reactExports.Fragment, { children: [
                  shouldShowEllipsis && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { className: clsx("breadcrumb-item", styles$1h.ellipsis), children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "..." }) }),
                  /* @__PURE__ */ jsxRuntimeExports.jsx(
                    "li",
                    {
                      className: clsx(
                        styles$1h.pathLink,
                        "breadcrumb-item",
                        isLast ? "active" : void 0
                      ),
                      children: segment2.url && !isLast ? /* @__PURE__ */ jsxRuntimeExports.jsx(Link, { to: segment2.url, children: segment2.text }) : /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: clsx(styles$1h.pathSegment), children: segment2.text })
                    }
                  )
                ] }, index);
              }) }) : "" })
            ] }),
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$1h.right), children: children2 })
          ]
        }
      );
    };
    const ApplicationNavbar = ({
      currentPath,
      fnNavigationUrl,
      bordered: bordered2,
      children: children2,
      showActivity = "all"
    }) => {
      const optionsRef = reactExports.useRef(null);
      const loading = useStore((state) => state.app.status.loading);
      const sampleStatus = useStore((state) => state.sample.sampleStatus);
      const isShowing = useStore((state) => state.app.dialogs.options);
      const setShowing = useStore(
        (state) => state.appActions.setShowingOptionsDialog
      );
      const hasActivity = reactExports.useMemo(() => {
        if (showActivity === "all") {
          return !!loading || sampleStatus === "loading";
        } else if (showActivity === "log") {
          return !!loading;
        } else if (showActivity === "sample") {
          return sampleStatus === "loading";
        } else {
          return false;
        }
      }, [showActivity, loading, sampleStatus]);
      return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs(
          Navbar,
          {
            currentPath,
            fnNavigationUrl,
            bordered: bordered2,
            children: [
              children2,
              /* @__PURE__ */ jsxRuntimeExports.jsx(
                ViewerOptionsButton,
                {
                  showing: isShowing,
                  setShowing,
                  ref: optionsRef
                }
              ),
              /* @__PURE__ */ jsxRuntimeExports.jsx(
                ViewerOptionsPopover,
                {
                  positionEl: optionsRef.current,
                  showing: isShowing,
                  setShowing
                }
              )
            ]
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsx(ActivityBar, { animating: hasActivity })
      ] });
    };
    const navbarButton = "_navbarButton_1gksz_1";
    const styles$1g = {
      navbarButton
    };
    const NavbarButton = reactExports.forwardRef(
      ({ label: label2, className: className2, icon: icon2, latched: latched2, ...rest }, ref) => {
        return /* @__PURE__ */ jsxRuntimeExports.jsx(
          ToolButton,
          {
            ref,
            label: label2,
            className: clsx(className2, styles$1g.navbarButton),
            icon: icon2,
            latched: latched2,
            ...rest
          }
        );
      }
    );
    NavbarButton.displayName = "NavbarButton";
    const rootControl = "_rootControl_mhb7y_1";
    const segment = "_segment_mhb7y_9";
    const selected$4 = "_selected_mhb7y_9";
    const styles$1f = {
      rootControl,
      segment,
      selected: selected$4
    };
    const SegmentedControl = ({
      segments: segments2,
      onSegmentChange,
      selectedId
    }) => {
      const handleSegmentClick = reactExports.useCallback(
        (segmentId, index) => {
          onSegmentChange(segmentId, index);
        },
        [onSegmentChange]
      );
      if (selectedId === void 0) {
        selectedId = segments2[0]?.id;
      }
      return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$1f.rootControl), children: segments2.map((segment2, index) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
        "button",
        {
          className: clsx(
            styles$1f.segment,
            {
              [styles$1f.selected]: selectedId === segment2.id
            },
            "text-size-smallest",
            "text-style-secondary"
          ),
          onClick: () => handleSegmentClick(segment2.id, index),
          "aria-pressed": selectedId === segment2.id,
          children: [
            segment2.icon && /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: segment2.icon }),
            /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: segment2.label })
          ]
        },
        segment2.id
      )) });
    };
    const segments = [
      { id: "logs", label: "Tasks", icon: ApplicationIcons.navbar.tasks },
      { id: "samples", label: "Samples", icon: ApplicationIcons.sample }
    ];
    const ViewSegmentedControl = ({
      selectedSegment
    }) => {
      const navigate = useNavigate();
      const { logPath } = useLogRouteParams();
      const { samplesPath } = useSamplesRouteParams();
      return /* @__PURE__ */ jsxRuntimeExports.jsx(
        SegmentedControl,
        {
          segments,
          selectedId: selectedSegment,
          onSegmentChange: (segment2) => {
            if (segment2 === "samples") {
              const path = logPath || samplesPath || "";
              const sampleUrl = samplesUrl(path);
              navigate(sampleUrl);
            } else {
              const path = samplesPath || logPath || "";
              const logUrl = logsUrl(path);
              navigate(logUrl);
            }
          }
        }
      );
    };
    const checkboxWrapper = "_checkboxWrapper_vtlwq_1";
    const label$9 = "_label_vtlwq_5";
    const checkbox = "_checkbox_vtlwq_1";
    const filterIcon = "_filterIcon_vtlwq_16";
    const scrollableContainer = "_scrollableContainer_vtlwq_21";
    const section$2 = "_section_vtlwq_26";
    const headerRow = "_headerRow_vtlwq_30";
    const buttonContainer = "_buttonContainer_vtlwq_39";
    const button$1 = "_button_vtlwq_39";
    const columnsLayout = "_columnsLayout_vtlwq_54";
    const styles$1e = {
      checkboxWrapper,
      label: label$9,
      checkbox,
      filterIcon,
      scrollableContainer,
      section: section$2,
      headerRow,
      buttonContainer,
      button: button$1,
      columnsLayout
    };
    const getFieldKey = (col) => {
      return col.field || col.headerName || "?";
    };
    const createGridColumnResizer = (gridRef, delayMs = 10) => {
      return debounce$2(() => {
        gridRef.current?.api?.sizeColumnsToFit();
      }, delayMs);
    };
    const ColumnSelectorPopover = ({
      showing,
      setShowing,
      columns,
      onVisibilityChange,
      positionEl,
      filteredFields = []
    }) => {
      const currentVisibility = reactExports.useMemo(
        () => columns.reduce(
          (acc, col) => ({ ...acc, [getFieldKey(col)]: !col.hide }),
          {}
        ),
        [columns]
      );
      const handleToggle = (field) => {
        onVisibilityChange({
          ...currentVisibility,
          [field]: !currentVisibility[field]
        });
      };
      const columnGroups = reactExports.useMemo(() => {
        return {
          base: columns.filter((col) => !getFieldKey(col).startsWith("score_")),
          scores: columns.filter((col) => getFieldKey(col).startsWith("score_"))
        };
      }, [columns]);
      const handleSelectAllBase = () => {
        onVisibilityChange({
          ...currentVisibility,
          ...Object.fromEntries(
            columnGroups.base.map((col) => [getFieldKey(col), true])
          )
        });
      };
      const handleDeselectAllBase = () => {
        onVisibilityChange({
          ...currentVisibility,
          ...Object.fromEntries(
            columnGroups.base.map((col) => [getFieldKey(col), false])
          )
        });
      };
      const handleSelectAllScores = () => {
        onVisibilityChange({
          ...currentVisibility,
          ...Object.fromEntries(
            columnGroups.scores.map((col) => [getFieldKey(col), true])
          )
        });
      };
      const handleDeselectAllScores = () => {
        onVisibilityChange({
          ...currentVisibility,
          ...Object.fromEntries(
            columnGroups.scores.map((col) => [getFieldKey(col), false])
          )
        });
      };
      const renderColumnCheckbox = (col) => {
        const field = getFieldKey(col);
        const hasFilter = filteredFields.includes(field);
        return /* @__PURE__ */ jsxRuntimeExports.jsx(
          "div",
          {
            className: styles$1e.checkboxWrapper,
            title: hasFilter ? "Unselecting will remove an active filter on this column" : void 0,
            children: /* @__PURE__ */ jsxRuntimeExports.jsxs("label", { className: styles$1e.label, children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx(
                "input",
                {
                  type: "checkbox",
                  checked: currentVisibility[field],
                  onChange: () => handleToggle(field),
                  className: styles$1e.checkbox
                }
              ),
              /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: col.headerName || field }),
              hasFilter && /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: `${ApplicationIcons.filter} ${styles$1e.filterIcon}` })
            ] })
          },
          field
        );
      };
      return /* @__PURE__ */ jsxRuntimeExports.jsx(
        PopOver,
        {
          id: "column-selector-popover",
          isOpen: showing,
          setIsOpen: setShowing,
          positionEl,
          placement: "bottom-start",
          showArrow: false,
          hoverDelay: -1,
          className: styles$1e.popover,
          children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$1e.scrollableContainer, "text-size-small"), children: [
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$1e.section), children: [
              /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$1e.headerRow, children: [
                /* @__PURE__ */ jsxRuntimeExports.jsx("b", { children: "Base" }),
                /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$1e.buttonContainer, "text-size-small"), children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsx(
                    "a",
                    {
                      className: clsx(styles$1e.button, "text-size-small"),
                      onClick: handleSelectAllBase,
                      children: "All"
                    }
                  ),
                  "|",
                  /* @__PURE__ */ jsxRuntimeExports.jsx(
                    "a",
                    {
                      className: clsx(styles$1e.button),
                      onClick: handleDeselectAllBase,
                      children: "None"
                    }
                  )
                ] })
              ] }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$1e.columnsLayout, children: columnGroups.base.map((col) => renderColumnCheckbox(col)) })
            ] }),
            columnGroups.scores.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
              /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$1e.headerRow, children: [
                /* @__PURE__ */ jsxRuntimeExports.jsx("b", { children: "Scorers" }),
                /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$1e.buttonContainer, children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsx(
                    "a",
                    {
                      className: clsx(styles$1e.button),
                      onClick: handleSelectAllScores,
                      children: "All"
                    }
                  ),
                  "|",
                  /* @__PURE__ */ jsxRuntimeExports.jsx(
                    "a",
                    {
                      className: clsx(styles$1e.button),
                      onClick: handleDeselectAllScores,
                      children: "None"
                    }
                  )
                ] })
              ] }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$1e.columnsLayout, children: columnGroups.scores.map((col) => renderColumnCheckbox(col)) })
            ] })
          ] })
        }
      );
    };
    const kLogFilePattern = /^(\d{4}-\d{2}-\d{2}T\d{2}-\d{2}-\d{2}[-+]\d{2}-\d{2})_(.+)_([0-9A-Za-z]+)\.(eval|json)$/;
    const parseLogFileName = (logFileName) => {
      const match = logFileName.match(kLogFilePattern);
      if (!match) {
        return {
          timestamp: void 0,
          name: filename(logFileName),
          taskId: void 0,
          extension: logFileName.endsWith(".eval") ? "eval" : "json"
        };
      }
      return {
        timestamp: new Date(Date.parse(match[1])),
        name: match[2],
        taskId: match[3],
        extension: match[4]
      };
    };
    function createFolderFirstComparator(compareFn) {
      return (valueA, valueB, nodeA, nodeB) => {
        const itemA = nodeA.data;
        const itemB = nodeB.data;
        if (!itemA || !itemB) return 0;
        if (itemA.type !== itemB.type) {
          return itemA.type === "folder" ? -1 : 1;
        }
        return compareFn(valueA, valueB, itemA, itemB);
      };
    }
    const comparators = {
      /** Compare values as numbers */
      number: (a, b) => {
        return Number(a || 0) - Number(b || 0);
      },
      /** Compare values as dates */
      date: (a, b) => {
        const timeA = a ? new Date(a).getTime() : 0;
        const timeB = b ? new Date(b).getTime() : 0;
        return timeA - timeB;
      }
    };
    const gridWrapper = "_gridWrapper_oveew_5";
    const gridContainer = "_gridContainer_oveew_11";
    const iconCell = "_iconCell_oveew_19";
    const numberCell = "_numberCell_oveew_32";
    const taskText = "_taskText_oveew_42";
    const folder = "_folder_oveew_49";
    const styles$1d = {
      gridWrapper,
      gridContainer,
      iconCell,
      numberCell,
      taskText,
      folder
    };
    const nameCell = "_nameCell_mdto2_1";
    const modelCell = "_modelCell_mdto2_8";
    const scoreCell = "_scoreCell_mdto2_15";
    const error$1 = "_error_mdto2_22";
    const started = "_started_mdto2_26";
    const success = "_success_mdto2_30";
    const cancelled = "_cancelled_mdto2_34";
    const statusCell = "_statusCell_mdto2_38";
    const dateCell = "_dateCell_mdto2_44";
    const localStyles = {
      nameCell,
      modelCell,
      scoreCell,
      error: error$1,
      started,
      success,
      cancelled,
      statusCell,
      dateCell
    };
    const styles$1c = { ...styles$1d, ...localStyles };
    const EmptyCell = () => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "-" });
    const useLogListColumns = () => {
      const columnVisibility = useStore(
        (state) => state.logs.listing.columnVisibility
      );
      const setColumnVisibility = useStore(
        (state) => state.logsActions.setLogsColumnVisibility
      );
      const logDetails = useStore((state) => state.logs.logDetails);
      const scorerMap = reactExports.useMemo(() => {
        const scoreTypes = {};
        for (const details of Object.values(logDetails)) {
          if (details.results?.scores) {
            for (const evalScore of details.results.scores) {
              if (evalScore.metrics) {
                for (const [metricName, metric] of Object.entries(
                  evalScore.metrics
                )) {
                  scoreTypes[metricName] = typeof metric.value;
                }
              }
            }
          }
        }
        return scoreTypes;
      }, [logDetails]);
      reactExports.useEffect(() => {
        const scorerNames = Object.keys(scorerMap);
        if (scorerNames.length === 0) return;
        const needsUpdate = scorerNames.some(
          (name2) => !(`score_${name2}` in columnVisibility)
        );
        if (needsUpdate) {
          const newVisibility = { ...columnVisibility };
          for (const scorerName of scorerNames) {
            const field = `score_${scorerName}`;
            if (!(field in columnVisibility)) {
              newVisibility[field] = false;
            }
          }
          setColumnVisibility(newVisibility);
        }
      }, [scorerMap, columnVisibility, setColumnVisibility]);
      const allColumns = reactExports.useMemo(() => {
        const baseColumns = [
          {
            field: "type",
            headerName: "",
            initialWidth: 32,
            minWidth: 32,
            maxWidth: 32,
            suppressSizeToFit: true,
            sortable: true,
            filter: false,
            resizable: false,
            pinned: "left",
            cellRenderer: (params) => {
              const type = params.data?.type;
              const icon2 = type === "file" || type === "pending-task" ? ApplicationIcons.inspectFile : ApplicationIcons.folder;
              return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$1c.iconCell, children: /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: clsx(icon2) }) });
            }
          },
          {
            field: "task",
            headerName: "Task",
            initialWidth: 250,
            minWidth: 150,
            sortable: true,
            filter: true,
            resizable: true,
            valueGetter: (params) => {
              const item2 = params.data;
              if (!item2) return "";
              if (item2.type === "file") {
                return item2.task || parseLogFileName(item2.name).name;
              }
              return item2.name;
            },
            cellRenderer: (params) => {
              const item2 = params.data;
              if (!item2) return null;
              let value2 = item2.name;
              if (item2.type === "file") {
                value2 = item2.task || parseLogFileName(item2.name).name;
              }
              return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$1c.nameCell, children: item2.type === "folder" && item2.url ? /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: styles$1c.folder, children: value2 }) : /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: styles$1c.taskText, children: value2 }) });
            }
          },
          {
            field: "model",
            headerName: "Model",
            initialWidth: 300,
            minWidth: 100,
            maxWidth: 400,
            sortable: true,
            filter: true,
            resizable: true,
            cellRenderer: (params) => {
              const item2 = params.data;
              if (!item2) return null;
              if (item2.model) {
                return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$1c.modelCell, children: item2.model });
              }
              return /* @__PURE__ */ jsxRuntimeExports.jsx(EmptyCell, {});
            }
          },
          {
            field: "score",
            headerName: "Score",
            initialWidth: 80,
            minWidth: 60,
            maxWidth: 120,
            sortable: true,
            filter: "agNumberColumnFilter",
            resizable: true,
            valueFormatter: (params) => {
              if (params.value === void 0 || params.value === null) return "";
              return formatPrettyDecimal(params.value);
            },
            cellRenderer: (params) => {
              const item2 = params.data;
              if (!item2 || item2.score === void 0) {
                return /* @__PURE__ */ jsxRuntimeExports.jsx(EmptyCell, {});
              }
              return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$1c.scoreCell, children: formatPrettyDecimal(item2.score) });
            }
          },
          {
            field: "status",
            headerName: "Status",
            initialWidth: 80,
            minWidth: 60,
            maxWidth: 100,
            sortable: true,
            filter: true,
            resizable: true,
            cellRenderer: (params) => {
              const item2 = params.data;
              if (!item2) return null;
              const status2 = item2.status;
              if (!status2 && item2.type !== "pending-task") {
                return /* @__PURE__ */ jsxRuntimeExports.jsx(EmptyCell, {});
              }
              const icon2 = item2.type === "pending-task" ? ApplicationIcons.pendingTask : status2 === "error" ? ApplicationIcons.error : status2 === "started" ? ApplicationIcons.running : status2 === "cancelled" ? ApplicationIcons.cancelled : ApplicationIcons.success;
              const clz = item2.type === "pending-task" ? styles$1c.started : status2 === "error" ? styles$1c.error : status2 === "started" ? styles$1c.started : status2 === "cancelled" ? styles$1c.cancelled : styles$1c.success;
              return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$1c.statusCell, children: /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: clsx(icon2, clz) }) });
            }
          },
          {
            field: "completedAt",
            headerName: "Completed",
            initialWidth: 200,
            minWidth: 120,
            maxWidth: 300,
            sortable: true,
            filter: true,
            resizable: true,
            valueGetter: (params) => {
              const completed = params.data?.completedAt;
              if (!completed) return "";
              const time = new Date(completed);
              return `${time.toDateString()} ${time.toLocaleTimeString([], {
                hour: "2-digit",
                minute: "2-digit"
              })}`;
            },
            cellRenderer: (params) => {
              const item2 = params.data;
              if (!item2 || !item2.completedAt) {
                return /* @__PURE__ */ jsxRuntimeExports.jsx(EmptyCell, {});
              }
              const time = new Date(item2.completedAt);
              const timeStr = `${time.toDateString()} ${time.toLocaleTimeString(
                [],
                {
                  hour: "2-digit",
                  minute: "2-digit"
                }
              )}`;
              return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$1c.dateCell, children: timeStr });
            },
            comparator: createFolderFirstComparator(comparators.date)
          },
          {
            field: "name",
            headerName: "File Name",
            initialWidth: 600,
            minWidth: 150,
            sortable: true,
            filter: true,
            resizable: true,
            valueGetter: (params) => {
              const item2 = params.data;
              if (!item2 || item2.type !== "file") return "";
              return basename(item2.name);
            },
            cellRenderer: (params) => {
              const item2 = params.data;
              if (!item2 || item2.type === "folder" || item2.type === "pending-task") {
                return /* @__PURE__ */ jsxRuntimeExports.jsx(EmptyCell, {});
              }
              const value2 = basename(item2.name);
              return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$1c.nameCell, children: value2 });
            }
          }
        ];
        const scorerColumns = Object.keys(scorerMap).map(
          (scorerName) => {
            const scoreType = scorerMap[scorerName];
            return {
              field: `score_${scorerName}`,
              headerName: scorerName,
              initialWidth: 100,
              minWidth: 100,
              sortable: true,
              filter: scoreType === "number" ? "agNumberColumnFilter" : "agTextColumnFilter",
              resizable: true,
              valueFormatter: (params) => {
                const value2 = params.value;
                if (value2 === "" || value2 === null || value2 === void 0) {
                  return "";
                }
                if (typeof value2 === "number") {
                  return formatPrettyDecimal(value2);
                }
                return String(value2);
              },
              cellRenderer: (params) => {
                const value2 = params.value;
                if (value2 === void 0 || value2 === null || value2 === "") {
                  return /* @__PURE__ */ jsxRuntimeExports.jsx(EmptyCell, {});
                }
                return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$1c.scoreCell, children: formatPrettyDecimal(value2) });
              },
              comparator: createFolderFirstComparator((valA, valB) => {
                if (typeof valA === "number" && typeof valB === "number") {
                  return valA - valB;
                }
                return String(valA || "").localeCompare(String(valB || ""));
              })
            };
          }
        );
        return [...baseColumns, ...scorerColumns];
      }, [scorerMap]);
      const columns = reactExports.useMemo(() => {
        const columnsWithVisibility = allColumns.map((col) => {
          const field = getFieldKey(col);
          const isScoreColumn = field.startsWith("score_");
          const isVisible = columnVisibility[field] ?? (isScoreColumn ? false : true);
          return {
            ...col,
            hide: !isVisible
          };
        });
        return columnsWithVisibility;
      }, [allColumns, columnVisibility]);
      return {
        columns,
        setColumnVisibility
      };
    };
    var LocalEventService = class {
      constructor() {
        this.allSyncListeners = /* @__PURE__ */ new Map();
        this.allAsyncListeners = /* @__PURE__ */ new Map();
        this.globalSyncListeners = /* @__PURE__ */ new Set();
        this.globalAsyncListeners = /* @__PURE__ */ new Set();
        this.asyncFunctionsQueue = [];
        this.scheduled = false;
        this.firedEvents = {};
      }
      setFrameworkOverrides(frameworkOverrides) {
        this.frameworkOverrides = frameworkOverrides;
      }
      getListeners(eventType, async, autoCreateListenerCollection) {
        const listenerMap = async ? this.allAsyncListeners : this.allSyncListeners;
        let listeners = listenerMap.get(eventType);
        if (!listeners && autoCreateListenerCollection) {
          listeners = /* @__PURE__ */ new Set();
          listenerMap.set(eventType, listeners);
        }
        return listeners;
      }
      noRegisteredListenersExist() {
        return this.allSyncListeners.size === 0 && this.allAsyncListeners.size === 0 && this.globalSyncListeners.size === 0 && this.globalAsyncListeners.size === 0;
      }
      addEventListener(eventType, listener, async = false) {
        this.getListeners(eventType, async, true).add(listener);
      }
      removeEventListener(eventType, listener, async = false) {
        const listeners = this.getListeners(eventType, async, false);
        if (!listeners) {
          return;
        }
        listeners.delete(listener);
        if (listeners.size === 0) {
          (async ? this.allAsyncListeners : this.allSyncListeners).delete(eventType);
        }
      }
      addGlobalListener(listener, async = false) {
        this.getGlobalListeners(async).add(listener);
      }
      removeGlobalListener(listener, async = false) {
        this.getGlobalListeners(async).delete(listener);
      }
      dispatchEvent(event) {
        this.dispatchToListeners(event, true);
        this.dispatchToListeners(event, false);
        this.firedEvents[event.type] = true;
      }
      dispatchEventOnce(event) {
        if (!this.firedEvents[event.type]) {
          this.dispatchEvent(event);
        }
      }
      dispatchToListeners(event, async) {
        const eventType = event.type;
        if (async && "event" in event) {
          const browserEvent = event.event;
          if (browserEvent instanceof Event) {
            event.eventPath = browserEvent.composedPath();
          }
        }
        const { frameworkOverrides } = this;
        const runCallback = (func) => {
          const callback = frameworkOverrides ? () => frameworkOverrides.wrapIncoming(func) : func;
          if (async) {
            this.dispatchAsync(callback);
          } else {
            callback();
          }
        };
        const originalListeners = this.getListeners(eventType, async, false);
        if ((originalListeners?.size ?? 0) > 0) {
          const listeners = new Set(originalListeners);
          for (const listener of listeners) {
            if (!originalListeners?.has(listener)) {
              continue;
            }
            runCallback(() => listener(event));
          }
        }
        const globalListenersSrc = this.getGlobalListeners(async);
        if (globalListenersSrc.size > 0) {
          const globalListeners = new Set(globalListenersSrc);
          for (const listener of globalListeners) {
            runCallback(() => listener(eventType, event));
          }
        }
      }
      getGlobalListeners(async) {
        return async ? this.globalAsyncListeners : this.globalSyncListeners;
      }
      // this gets called inside the grid's thread, for each event that it
      // wants to set async. the grid then batches the events into one setTimeout()
      // because setTimeout() is an expensive operation. ideally we would have
      // each event in it's own setTimeout(), but we batch for performance.
      dispatchAsync(func) {
        this.asyncFunctionsQueue.push(func);
        if (!this.scheduled) {
          const flush = () => {
            window.setTimeout(this.flushAsyncQueue.bind(this), 0);
          };
          this.frameworkOverrides ? this.frameworkOverrides.wrapIncoming(flush) : flush();
          this.scheduled = true;
        }
      }
      // this happens in the next VM turn only, and empties the queue of events
      flushAsyncQueue() {
        this.scheduled = false;
        const queueCopy = this.asyncFunctionsQueue.slice();
        this.asyncFunctionsQueue = [];
        for (const func of queueCopy) {
          func();
        }
      }
    };
    function _makeNull(value2) {
      if (value2 == null || value2 === "") {
        return null;
      }
      return value2;
    }
    function _exists(value2) {
      return value2 != null && value2 !== "";
    }
    function _missing(value2) {
      return !_exists(value2);
    }
    function _toStringOrNull(value2) {
      return value2 != null && typeof value2.toString === "function" ? value2.toString() : null;
    }
    function _jsonEquals(val1, val2) {
      const val1Json = val1 ? JSON.stringify(val1) : null;
      const val2Json = val2 ? JSON.stringify(val2) : null;
      return val1Json === val2Json;
    }
    function _defaultComparator(valueA, valueB, accentedCompare = false) {
      const valueAMissing = valueA == null;
      const valueBMissing = valueB == null;
      if (valueA?.toNumber) {
        valueA = valueA.toNumber();
      }
      if (valueB?.toNumber) {
        valueB = valueB.toNumber();
      }
      if (valueAMissing && valueBMissing) {
        return 0;
      }
      if (valueAMissing) {
        return -1;
      }
      if (valueBMissing) {
        return 1;
      }
      function doQuickCompare(a, b) {
        return a > b ? 1 : a < b ? -1 : 0;
      }
      if (typeof valueA !== "string") {
        return doQuickCompare(valueA, valueB);
      }
      if (!accentedCompare) {
        return doQuickCompare(valueA, valueB);
      }
      try {
        return valueA.localeCompare(valueB);
      } catch (e) {
        return doQuickCompare(valueA, valueB);
      }
    }
    var reUnescapedHtml = /[&<>"']/g;
    var HTML_ESCAPES = {
      "&": "&amp;",
      "<": "&lt;",
      ">": "&gt;",
      '"': "&quot;",
      "'": "&#39;"
    };
    function _toString(toEscape) {
      return toEscape?.toString().toString() ?? null;
    }
    function _escapeString(toEscape) {
      return _toString(toEscape)?.replace(reUnescapedHtml, (chr) => HTML_ESCAPES[chr]) ?? null;
    }
    function _getRootNode(beans) {
      return beans.eRootDiv.getRootNode();
    }
    function _getActiveDomElement(beans) {
      return _getRootNode(beans).activeElement;
    }
    function _getDocument(beans) {
      const { gos, eRootDiv } = beans;
      let result2 = null;
      const optionsGetDocument = gos.get("getDocument");
      if (optionsGetDocument && _exists(optionsGetDocument)) {
        result2 = optionsGetDocument();
      } else if (eRootDiv) {
        result2 = eRootDiv.ownerDocument;
      }
      if (result2 && _exists(result2)) {
        return result2;
      }
      return document;
    }
    function _isNothingFocused(beans) {
      const activeEl = _getActiveDomElement(beans);
      return activeEl === null || activeEl === _getDocument(beans).body;
    }
    function _getWindow(beans) {
      const eDocument = _getDocument(beans);
      return eDocument.defaultView || window;
    }
    function _getPageBody(beans) {
      let rootNode = null;
      let targetEl = null;
      try {
        rootNode = _getDocument(beans).fullscreenElement;
      } catch (e) {
      } finally {
        if (!rootNode) {
          rootNode = _getRootNode(beans);
        }
        const body2 = rootNode.querySelector("body");
        if (body2) {
          targetEl = body2;
        } else if (rootNode instanceof ShadowRoot) {
          targetEl = rootNode;
        } else if (rootNode instanceof Document) {
          targetEl = rootNode?.documentElement;
        } else {
          targetEl = rootNode;
        }
      }
      return targetEl;
    }
    function _getBodyWidth(beans) {
      const body2 = _getPageBody(beans);
      return body2?.clientWidth ?? (window.innerWidth || -1);
    }
    function _getBodyHeight(beans) {
      const body2 = _getPageBody(beans);
      return body2?.clientHeight ?? (window.innerHeight || -1);
    }
    function _toggleAriaAttribute(element, attribute2, value2) {
      if (value2 == null || typeof value2 === "string" && value2 == "") {
        _removeAriaAttribute(element, attribute2);
      } else {
        _setAriaAttribute(element, attribute2, value2);
      }
    }
    function _setAriaAttribute(element, attribute2, value2) {
      element.setAttribute(_ariaAttributeName(attribute2), value2.toString());
    }
    function _removeAriaAttribute(element, attribute2) {
      element.removeAttribute(_ariaAttributeName(attribute2));
    }
    function _ariaAttributeName(attribute2) {
      return `aria-${attribute2}`;
    }
    function _setAriaRole(element, role2) {
      if (role2) {
        element.setAttribute("role", role2);
      } else {
        element.removeAttribute("role");
      }
    }
    function _getAriaSortState(sortDirection) {
      let sort2;
      if (sortDirection === "asc") {
        sort2 = "ascending";
      } else if (sortDirection === "desc") {
        sort2 = "descending";
      } else if (sortDirection === "mixed") {
        sort2 = "other";
      } else {
        sort2 = "none";
      }
      return sort2;
    }
    function _getAriaLabel(element) {
      return element.getAttribute("aria-label");
    }
    function _setAriaLabel(element, label2) {
      _toggleAriaAttribute(element, "label", label2);
    }
    function _setAriaLabelledBy(element, labelledBy) {
      _toggleAriaAttribute(element, "labelledby", labelledBy);
    }
    function _setAriaLive(element, live) {
      _toggleAriaAttribute(element, "live", live);
    }
    function _setAriaAtomic(element, atomic) {
      _toggleAriaAttribute(element, "atomic", atomic);
    }
    function _setAriaRelevant(element, relevant) {
      _toggleAriaAttribute(element, "relevant", relevant);
    }
    function _setAriaInvalid(element, invalid) {
      _toggleAriaAttribute(element, "invalid", invalid);
    }
    function _setAriaDisabled(element, disabled2) {
      _toggleAriaAttribute(element, "disabled", disabled2);
    }
    function _setAriaHidden(element, hidden2) {
      _toggleAriaAttribute(element, "hidden", hidden2);
    }
    function _setAriaExpanded(element, expanded) {
      _setAriaAttribute(element, "expanded", expanded);
    }
    function _setAriaSetSize(element, setsize) {
      _setAriaAttribute(element, "setsize", setsize);
    }
    function _setAriaPosInSet(element, position) {
      _setAriaAttribute(element, "posinset", position);
    }
    function _setAriaRowCount(element, rowCount) {
      _setAriaAttribute(element, "rowcount", rowCount);
    }
    function _setAriaRowIndex(element, rowIndex) {
      _setAriaAttribute(element, "rowindex", rowIndex);
    }
    function _setAriaRowSpan(element, spanCount) {
      _setAriaAttribute(element, "rowspan", spanCount);
    }
    function _setAriaColCount(element, colCount) {
      _setAriaAttribute(element, "colcount", colCount);
    }
    function _setAriaColIndex(element, colIndex) {
      _setAriaAttribute(element, "colindex", colIndex);
    }
    function _setAriaColSpan(element, colSpan) {
      _setAriaAttribute(element, "colspan", colSpan);
    }
    function _setAriaSort(element, sort2) {
      _setAriaAttribute(element, "sort", sort2);
    }
    function _removeAriaSort(element) {
      _removeAriaAttribute(element, "sort");
    }
    function _setAriaSelected(element, selected2) {
      _toggleAriaAttribute(element, "selected", selected2);
    }
    function _setAriaControls(controllerElement, controlledId) {
      _toggleAriaAttribute(controllerElement, "controls", controlledId);
    }
    function _setAriaControlsAndLabel(controllerElement, controlledElement) {
      _setAriaControls(controllerElement, controlledElement.id);
      _setAriaLabelledBy(controlledElement, controllerElement.id);
    }
    function _setAriaOwns(ownerElement, ownedId) {
      _toggleAriaAttribute(ownerElement, "owns", ownedId);
    }
    function _getAriaCheckboxStateName(translate, state) {
      return state === void 0 ? translate("ariaIndeterminate", "indeterminate") : state === true ? translate("ariaChecked", "checked") : translate("ariaUnchecked", "unchecked");
    }
    var FOCUSABLE_SELECTOR = "[tabindex], input, select, button, textarea, [href]";
    var FOCUSABLE_EXCLUDE = "[disabled], .ag-disabled:not(.ag-button), .ag-disabled *";
    function _isFocusableFormField(element) {
      if (!element) {
        return false;
      }
      const isFocusable = element.matches("input, select, button, textarea");
      if (!isFocusable) {
        return false;
      }
      const isNotFocusable = element.matches(FOCUSABLE_EXCLUDE);
      if (!isNotFocusable) {
        return false;
      }
      return _isVisible(element);
    }
    function _setDisplayed(element, displayed, options2 = {}) {
      const { skipAriaHidden } = options2;
      element.classList.toggle("ag-hidden", !displayed);
      if (!skipAriaHidden) {
        _setAriaHidden(element, !displayed);
      }
    }
    function _setVisible(element, visible2, options2 = {}) {
      const { skipAriaHidden } = options2;
      element.classList.toggle("ag-invisible", !visible2);
      if (!skipAriaHidden) {
        _setAriaHidden(element, !visible2);
      }
    }
    function _setDisabled(element, disabled2) {
      const attributeName = "disabled";
      const addOrRemoveDisabledAttribute = disabled2 ? (e) => e.setAttribute(attributeName, "") : (e) => e.removeAttribute(attributeName);
      addOrRemoveDisabledAttribute(element);
      const inputs = element.querySelectorAll("input") ?? [];
      for (const input2 of inputs) {
        addOrRemoveDisabledAttribute(input2);
      }
    }
    function _isElementChildOfClass(element, cls, maxNest) {
      let counter2 = 0;
      while (element) {
        if (element.classList.contains(cls)) {
          return true;
        }
        element = element.parentElement;
        if (typeof maxNest == "number") {
          if (++counter2 > maxNest) {
            break;
          }
        } else if (element === maxNest) {
          break;
        }
      }
      return false;
    }
    function _getElementSize(el2) {
      const {
        height,
        width,
        borderTopWidth,
        borderRightWidth,
        borderBottomWidth,
        borderLeftWidth,
        paddingTop,
        paddingRight,
        paddingBottom,
        paddingLeft,
        marginTop,
        marginRight,
        marginBottom,
        marginLeft,
        boxSizing
      } = window.getComputedStyle(el2);
      const pf = Number.parseFloat;
      return {
        height: pf(height || "0"),
        width: pf(width || "0"),
        borderTopWidth: pf(borderTopWidth || "0"),
        borderRightWidth: pf(borderRightWidth || "0"),
        borderBottomWidth: pf(borderBottomWidth || "0"),
        borderLeftWidth: pf(borderLeftWidth || "0"),
        paddingTop: pf(paddingTop || "0"),
        paddingRight: pf(paddingRight || "0"),
        paddingBottom: pf(paddingBottom || "0"),
        paddingLeft: pf(paddingLeft || "0"),
        marginTop: pf(marginTop || "0"),
        marginRight: pf(marginRight || "0"),
        marginBottom: pf(marginBottom || "0"),
        marginLeft: pf(marginLeft || "0"),
        boxSizing
      };
    }
    function _getInnerHeight(el2) {
      const size = _getElementSize(el2);
      if (size.boxSizing === "border-box") {
        return size.height - size.paddingTop - size.paddingBottom - size.borderTopWidth - size.borderBottomWidth;
      }
      return size.height;
    }
    function _getInnerWidth(el2) {
      const size = _getElementSize(el2);
      if (size.boxSizing === "border-box") {
        return size.width - size.paddingLeft - size.paddingRight - size.borderLeftWidth - size.borderRightWidth;
      }
      return size.width;
    }
    function _getAbsoluteHeight(el2) {
      const { height, marginBottom, marginTop } = _getElementSize(el2);
      return Math.floor(height + marginBottom + marginTop);
    }
    function _getAbsoluteWidth(el2) {
      const { width, marginLeft, marginRight } = _getElementSize(el2);
      return Math.floor(width + marginLeft + marginRight);
    }
    function _getElementRectWithOffset(el2) {
      const offsetElementRect = el2.getBoundingClientRect();
      const { borderTopWidth, borderLeftWidth, borderRightWidth, borderBottomWidth } = _getElementSize(el2);
      return {
        top: offsetElementRect.top + (borderTopWidth || 0),
        left: offsetElementRect.left + (borderLeftWidth || 0),
        right: offsetElementRect.right + (borderRightWidth || 0),
        bottom: offsetElementRect.bottom + (borderBottomWidth || 0)
      };
    }
    function _getScrollLeft(element, rtl) {
      let scrollLeft = element.scrollLeft;
      if (rtl) {
        scrollLeft = Math.abs(scrollLeft);
      }
      return scrollLeft;
    }
    function _setScrollLeft(element, value2, rtl) {
      if (rtl) {
        value2 *= -1;
      }
      element.scrollLeft = value2;
    }
    function _clearElement(el2) {
      while (el2?.firstChild) {
        el2.firstChild.remove();
      }
    }
    function _removeFromParent(node2) {
      if (node2?.parentNode) {
        node2.remove();
      }
    }
    function _isInDOM(element) {
      return !!element.offsetParent;
    }
    function _isVisible(element) {
      if (element.checkVisibility) {
        return element.checkVisibility({ checkVisibilityCSS: true });
      }
      const isHidden = !_isInDOM(element) || window.getComputedStyle(element).visibility !== "visible";
      return !isHidden;
    }
    function _loadTemplate(template2) {
      const tempDiv = document.createElement("div");
      tempDiv.innerHTML = (template2 || "").trim();
      return tempDiv.firstChild;
    }
    function _isElementOverflowingCallback(getElement2) {
      return () => {
        const element = getElement2();
        if (!element) {
          return true;
        }
        return _isHorizontalScrollShowing(element) || _isVerticalScrollShowing(element);
      };
    }
    function _isHorizontalScrollShowing(element) {
      return element.clientWidth < element.scrollWidth;
    }
    function _isVerticalScrollShowing(element) {
      return element.clientHeight < element.scrollHeight;
    }
    function _setElementWidth(element, width) {
      if (width === "flex") {
        element.style.removeProperty("width");
        element.style.removeProperty("minWidth");
        element.style.removeProperty("maxWidth");
        element.style.flex = "1 1 auto";
      } else {
        _setFixedWidth(element, width);
      }
    }
    function _setFixedWidth(element, width) {
      width = _formatSize(width);
      element.style.width = width;
      element.style.maxWidth = width;
      element.style.minWidth = width;
    }
    function _setFixedHeight(element, height) {
      height = _formatSize(height);
      element.style.height = height;
      element.style.maxHeight = height;
      element.style.minHeight = height;
    }
    function _formatSize(size) {
      return typeof size === "number" ? `${size}px` : size;
    }
    function _isNodeOrElement(o) {
      return o instanceof Node || o instanceof HTMLElement;
    }
    function _addOrRemoveAttribute(element, name2, value2) {
      if (value2 == null || value2 === "") {
        element.removeAttribute(name2);
      } else {
        element.setAttribute(name2, value2.toString());
      }
    }
    function _observeResize(beans, element, callback) {
      const win = _getWindow(beans);
      const ResizeObserverImpl = win.ResizeObserver;
      const resizeObserver = ResizeObserverImpl ? new ResizeObserverImpl(callback) : null;
      resizeObserver?.observe(element);
      return () => resizeObserver?.disconnect();
    }
    function _requestAnimationFrame(beans, callback) {
      const win = _getWindow(beans);
      if (win.requestAnimationFrame) {
        win.requestAnimationFrame(callback);
      } else if (win.webkitRequestAnimationFrame) {
        win.webkitRequestAnimationFrame(callback);
      } else {
        win.setTimeout(callback, 0);
      }
    }
    var DataRefAttribute = "data-ref";
    var whitespaceNode;
    function getWhitespaceNode() {
      whitespaceNode ?? (whitespaceNode = document.createTextNode(" "));
      return whitespaceNode.cloneNode();
    }
    function _createAgElement(params) {
      const { attrs, children: children2, cls, ref, role: role2, tag } = params;
      const element = document.createElement(tag);
      if (cls) {
        element.className = cls;
      }
      if (ref) {
        element.setAttribute(DataRefAttribute, ref);
      }
      if (role2) {
        element.setAttribute("role", role2);
      }
      if (attrs) {
        for (const key2 of Object.keys(attrs)) {
          element.setAttribute(key2, attrs[key2]);
        }
      }
      if (children2) {
        if (typeof children2 === "string") {
          element.textContent = children2;
        } else {
          let addFirstWhitespace = true;
          for (const child of children2) {
            if (child) {
              if (typeof child === "string") {
                element.appendChild(document.createTextNode(child));
                addFirstWhitespace = false;
              } else if (typeof child === "function") {
                element.appendChild(child());
              } else {
                if (addFirstWhitespace) {
                  element.appendChild(getWhitespaceNode());
                  addFirstWhitespace = false;
                }
                element.append(_createAgElement(child));
                element.appendChild(getWhitespaceNode());
              }
            }
          }
        }
      }
      return element;
    }
    var PASSIVE_EVENTS = ["touchstart", "touchend", "touchmove", "touchcancel", "scroll"];
    var NON_PASSIVE_EVENTS = ["wheel"];
    var supports = {};
    var _isEventSupported = /* @__PURE__ */ (() => {
      const tags2 = {
        select: "input",
        change: "input",
        submit: "form",
        reset: "form",
        error: "img",
        load: "img",
        abort: "img"
      };
      const eventChecker = (eventName) => {
        if (typeof supports[eventName] === "boolean") {
          return supports[eventName];
        }
        const el2 = document.createElement(tags2[eventName] || "div");
        eventName = "on" + eventName;
        return supports[eventName] = eventName in el2;
      };
      return eventChecker;
    })();
    function _isElementInEventPath(element, event) {
      if (!event || !element) {
        return false;
      }
      return _getEventPath(event).indexOf(element) >= 0;
    }
    function _createEventPath(event) {
      const res = [];
      let pointer = event.target;
      while (pointer) {
        res.push(pointer);
        pointer = pointer.parentElement;
      }
      return res;
    }
    function _getEventPath(event) {
      const eventNoType = event;
      if (eventNoType.path) {
        return eventNoType.path;
      }
      if (eventNoType.composedPath) {
        return eventNoType.composedPath();
      }
      return _createEventPath(eventNoType);
    }
    function _addSafePassiveEventListener(eElement, event, listener) {
      const passive2 = getPassiveStateForEvent(event);
      let options2;
      if (passive2 != null) {
        options2 = { passive: passive2 };
      }
      eElement.addEventListener(event, listener, options2);
    }
    var getPassiveStateForEvent = (event) => {
      const isPassive = PASSIVE_EVENTS.includes(event);
      const isNonPassive = NON_PASSIVE_EVENTS.includes(event);
      if (isPassive) {
        return true;
      }
      if (isNonPassive) {
        return false;
      }
    };
    function _areEventsNear(e1, e2, pixelCount) {
      if (pixelCount === 0) {
        return false;
      }
      const diffX = Math.abs(e1.clientX - e2.clientX);
      const diffY = Math.abs(e1.clientY - e2.clientY);
      return Math.max(diffX, diffY) <= pixelCount;
    }
    var _getFirstActiveTouch = (touch, touchList) => {
      const identifier = touch.identifier;
      for (let i2 = 0, len = touchList.length; i2 < len; ++i2) {
        const item2 = touchList[i2];
        if (item2.identifier === identifier) {
          return item2;
        }
      }
      return null;
    };
    function _isEventFromThisInstance(beans, event) {
      return beans.gos.isElementInThisInstance(event.target);
    }
    function _anchorElementToMouseMoveEvent(element, mouseMoveEvent, beans) {
      const eRect = element.getBoundingClientRect();
      const height = eRect.height;
      const browserWidth = _getBodyWidth(beans) - 2;
      const browserHeight = _getBodyHeight(beans) - 2;
      const offsetParent = element.offsetParent;
      if (!offsetParent) {
        return;
      }
      const offsetParentSize = _getElementRectWithOffset(element.offsetParent);
      const { clientY, clientX } = mouseMoveEvent;
      let top2 = clientY - offsetParentSize.top - height / 2;
      let left2 = clientX - offsetParentSize.left - 10;
      const eDocument = _getDocument(beans);
      const win = eDocument.defaultView || window;
      const windowScrollY = win.pageYOffset || eDocument.documentElement.scrollTop;
      const windowScrollX = win.pageXOffset || eDocument.documentElement.scrollLeft;
      if (browserWidth > 0 && left2 + element.clientWidth > browserWidth + windowScrollX) {
        left2 = browserWidth + windowScrollX - element.clientWidth;
      }
      if (left2 < 0) {
        left2 = 0;
      }
      if (browserHeight > 0 && top2 + element.clientHeight > browserHeight + windowScrollY) {
        top2 = browserHeight + windowScrollY - element.clientHeight;
      }
      if (top2 < 0) {
        top2 = 0;
      }
      element.style.left = `${left2}px`;
      element.style.top = `${top2}px`;
    }
    var addTempEventHandlers = (list2, ...handlers2) => {
      for (const handler of handlers2) {
        const [target2, type, eventListener, options2] = handler;
        target2.addEventListener(type, eventListener, options2);
        list2.push(handler);
      }
    };
    var clearTempEventHandlers = (list2) => {
      if (list2) {
        for (const [target2, type, listener, options2] of list2) {
          target2.removeEventListener(type, listener, options2);
        }
        list2.length = 0;
      }
    };
    var preventEventDefault = (event) => {
      if (event.cancelable) {
        event.preventDefault();
      }
    };
    function defaultLocaleTextFunc(_key, defaultValue) {
      return defaultValue;
    }
    function _getLocaleTextFunc(localeSvc) {
      return localeSvc?.getLocaleTextFunc() ?? defaultLocaleTextFunc;
    }
    function _translate(bean, localeValues, key2, variableValues) {
      const defaultValue = localeValues[key2];
      return bean.getLocaleTextFunc()(
        key2,
        typeof defaultValue === "function" ? defaultValue(variableValues) : defaultValue,
        variableValues
      );
    }
    function _getLocaleTextFromFunc(getLocaleText) {
      return (key2, defaultValue, variableValues) => {
        return getLocaleText({
          key: key2,
          defaultValue,
          variableValues
        });
      };
    }
    function _getLocaleTextFromMap(localeText) {
      return (key2, defaultValue, variableValues) => {
        let localisedText = localeText?.[key2];
        if (localisedText && variableValues?.length) {
          let found = 0;
          while (true) {
            if (found >= variableValues.length) {
              break;
            }
            const idx = localisedText.indexOf("${variable}");
            if (idx === -1) {
              break;
            }
            localisedText = localisedText.replace("${variable}", variableValues[found++]);
          }
        }
        return localisedText ?? defaultValue;
      };
    }
    var AgBeanStub = class {
      constructor() {
        this.destroyFunctions = [];
        this.destroyed = false;
        this.__v_skip = true;
        this.propertyListenerId = 0;
        this.lastChangeSetIdLookup = {};
        this.isAlive = () => !this.destroyed;
      }
      preWireBeans(beans) {
        this.beans = beans;
        this.stubContext = beans.context;
        this.eventSvc = beans.eventSvc;
        this.gos = beans.gos;
      }
      // this was a test constructor niall built, when active, it prints after 5 seconds all beans/components that are
      // not destroyed. to use, create a new grid, then api.destroy() before 5 seconds. then anything that gets printed
      // points to a bean or component that was not properly disposed of.
      // constructor() {
      //     setTimeout(()=> {
      //         if (this.isAlive()) {
      //             let prototype: any = Object.getPrototypeOf(this);
      //             const constructor: any = prototype.constructor;
      //             const constructorString = constructor.toString();
      //             const beanName = constructorString.substring(9, constructorString.indexOf("("));
      //             console.log('is alive ' + beanName);
      //         }
      //     }, 5000);
      // }
      destroy() {
        const { destroyFunctions } = this;
        for (let i2 = 0; i2 < destroyFunctions.length; i2++) {
          destroyFunctions[i2]();
        }
        destroyFunctions.length = 0;
        this.destroyed = true;
        this.dispatchLocalEvent({ type: "destroyed" });
      }
      /** Add a local event listener against this BeanStub */
      addEventListener(eventType, listener, async) {
        if (!this.localEventService) {
          this.localEventService = new LocalEventService();
        }
        this.localEventService.addEventListener(eventType, listener, async);
      }
      /** Remove a local event listener from this BeanStub */
      removeEventListener(eventType, listener, async) {
        this.localEventService?.removeEventListener(eventType, listener, async);
      }
      dispatchLocalEvent(event) {
        this.localEventService?.dispatchEvent(event);
      }
      addManagedElementListeners(object, handlers2) {
        return this._setupListeners(object, handlers2);
      }
      addManagedEventListeners(handlers2) {
        return this._setupListeners(this.eventSvc, handlers2);
      }
      addManagedListeners(object, handlers2) {
        return this._setupListeners(object, handlers2);
      }
      _setupListeners(object, handlers2) {
        const destroyFuncs = [];
        for (const k2 of Object.keys(handlers2)) {
          const handler = handlers2[k2];
          if (handler) {
            destroyFuncs.push(this._setupListener(object, k2, handler));
          }
        }
        return destroyFuncs;
      }
      _setupListener(object, event, listener) {
        if (this.destroyed) {
          return () => null;
        }
        let destroyFunc;
        if (isAgEventEmitter(object)) {
          object.__addEventListener(event, listener);
          destroyFunc = () => {
            object.__removeEventListener(event, listener);
            return null;
          };
        } else {
          const objIsEventService = isEventService(object);
          if (object instanceof HTMLElement) {
            _addSafePassiveEventListener(object, event, listener);
          } else if (objIsEventService) {
            object.addListener(event, listener);
          } else {
            object.addEventListener(event, listener);
          }
          destroyFunc = objIsEventService ? () => {
            object.removeListener(event, listener);
            return null;
          } : () => {
            object.removeEventListener(event, listener);
            return null;
          };
        }
        this.destroyFunctions.push(destroyFunc);
        return () => {
          destroyFunc();
          this.destroyFunctions = this.destroyFunctions.filter((fn2) => fn2 !== destroyFunc);
          return null;
        };
      }
      /**
       * Setup a managed property listener for the given property.
       * However, stores the destroy function in the beanStub so that if this bean
       * is a component the destroy function will be called when the component is destroyed
       * as opposed to being cleaned up only when the properties service is destroyed.
       */
      setupPropertyListener(event, listener) {
        const { gos } = this;
        gos.addPropertyEventListener(event, listener);
        const destroyFunc = () => {
          gos.removePropertyEventListener(event, listener);
          return null;
        };
        this.destroyFunctions.push(destroyFunc);
        return () => {
          destroyFunc();
          this.destroyFunctions = this.destroyFunctions.filter((fn2) => fn2 !== destroyFunc);
          return null;
        };
      }
      /**
       * Setup a managed property listener for the given GridOption property.
       * @param event GridOption property to listen to changes for.
       * @param listener Listener to run when property value changes
       */
      addManagedPropertyListener(event, listener) {
        if (this.destroyed) {
          return () => null;
        }
        return this.setupPropertyListener(event, listener);
      }
      /**
       * Setup managed property listeners for the given set of GridOption properties.
       * The listener will be run if any of the property changes but will only run once if
       * multiple of the properties change within the same framework lifecycle event.
       * Works on the basis that GridOptionsService updates all properties *before* any property change events are fired.
       * @param events Array of GridOption properties to listen for changes too.
       * @param listener Shared listener to run if any of the properties change
       */
      addManagedPropertyListeners(events, listener) {
        if (this.destroyed) {
          return;
        }
        const eventsKey = events.join("-") + this.propertyListenerId++;
        const wrappedListener = (event) => {
          if (event.changeSet) {
            if (event.changeSet && event.changeSet.id === this.lastChangeSetIdLookup[eventsKey]) {
              return;
            }
            this.lastChangeSetIdLookup[eventsKey] = event.changeSet.id;
          }
          const propertiesChangeEvent = {
            type: "propertyChanged",
            changeSet: event.changeSet,
            source: event.source
          };
          listener(propertiesChangeEvent);
        };
        for (const event of events) {
          this.setupPropertyListener(event, wrappedListener);
        }
      }
      getLocaleTextFunc() {
        return _getLocaleTextFunc(this.beans.localeSvc);
      }
      addDestroyFunc(func) {
        if (this.isAlive()) {
          this.destroyFunctions.push(func);
        } else {
          func();
        }
      }
      /** doesn't throw an error if `bean` is undefined */
      createOptionalManagedBean(bean, context) {
        return bean ? this.createManagedBean(bean, context) : void 0;
      }
      createManagedBean(bean, context) {
        const res = this.createBean(bean, context);
        this.addDestroyFunc(this.destroyBean.bind(this, bean, context));
        return res;
      }
      createBean(bean, context, afterPreCreateCallback) {
        return (context || this.stubContext).createBean(bean, afterPreCreateCallback);
      }
      /**
       * Destroys a bean and returns undefined to support destruction and clean up in a single line.
       * this.dateComp = this.context.destroyBean(this.dateComp);
       */
      destroyBean(bean, context) {
        return (context || this.stubContext).destroyBean(bean);
      }
      /**
       * Destroys an array of beans and returns an empty array to support destruction and clean up in a single line.
       * this.dateComps = this.context.destroyBeans(this.dateComps);
       */
      destroyBeans(beans, context) {
        return (context || this.stubContext).destroyBeans(beans);
      }
    };
    function isAgEventEmitter(object) {
      return object.__addEventListener !== void 0;
    }
    function isEventService(object) {
      return object.eventServiceType === "global";
    }
    var BeanStub = class extends AgBeanStub {
    };
    var doOnceFlags = {};
    function _doOnce(func, key2) {
      if (doOnceFlags[key2]) {
        return;
      }
      func();
      doOnceFlags[key2] = true;
    }
    var batchedCallsSetTimeout = {
      pending: false,
      funcs: []
    };
    var batchedCallsRaf = {
      pending: false,
      funcs: []
    };
    function _batchCall(func, mode = "setTimeout", beans) {
      const batch2 = mode === "raf" ? batchedCallsRaf : batchedCallsSetTimeout;
      batch2.funcs.push(func);
      if (batch2.pending) {
        return;
      }
      batch2.pending = true;
      const runBatch = () => {
        const funcsCopy = batch2.funcs.slice();
        batch2.funcs.length = 0;
        batch2.pending = false;
        for (const func2 of funcsCopy) {
          func2();
        }
      };
      if (mode === "raf") {
        _requestAnimationFrame(beans, runBatch);
      } else {
        window.setTimeout(runBatch, 0);
      }
    }
    function _debounce(bean, func, delay) {
      let timeout;
      return function(...args2) {
        const context = this;
        window.clearTimeout(timeout);
        timeout = window.setTimeout(function() {
          if (bean.isAlive()) {
            func.apply(context, args2);
          }
        }, delay);
      };
    }
    function _throttle(func, wait) {
      let previousCall = 0;
      return function(...args2) {
        const context = this;
        const currentCall = Date.now();
        if (currentCall - previousCall < wait) {
          return;
        }
        previousCall = currentCall;
        func.apply(context, args2);
      };
    }
    function _waitUntil(bean, condition, callback, timeout = 100) {
      const timeStamp = Date.now();
      let interval = null;
      let executed = false;
      const clearWait = () => {
        if (interval != null) {
          window.clearInterval(interval);
          interval = null;
        }
      };
      bean.addDestroyFunc(clearWait);
      const internalCallback = () => {
        const reachedTimeout = Date.now() - timeStamp > timeout;
        if (condition() || reachedTimeout) {
          callback();
          executed = true;
          clearWait();
        }
      };
      internalCallback();
      if (!executed) {
        interval = window.setInterval(internalCallback, 10);
      }
    }
    var SKIP_JS_BUILTINS = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]);
    function _iterateObject(object, callback) {
      if (object == null) {
        return;
      }
      if (Array.isArray(object)) {
        for (let i2 = 0; i2 < object.length; i2++) {
          callback(i2.toString(), object[i2]);
        }
        return;
      }
      for (const key2 of Object.keys(object).filter((key22) => !SKIP_JS_BUILTINS.has(key22))) {
        callback(key2, object[key2]);
      }
    }
    function _mergeDeep(dest, source2, copyUndefined = true, makeCopyOfSimpleObjects = false) {
      if (!_exists(source2)) {
        return;
      }
      _iterateObject(source2, (key2, sourceValue) => {
        let destValue = dest[key2];
        if (destValue === sourceValue) {
          return;
        }
        if (makeCopyOfSimpleObjects) {
          const objectIsDueToBeCopied = destValue == null && sourceValue != null;
          if (objectIsDueToBeCopied) {
            const doNotCopyAsSourceIsSimpleObject = typeof sourceValue === "object" && sourceValue.constructor === Object;
            if (doNotCopyAsSourceIsSimpleObject) {
              destValue = {};
              dest[key2] = destValue;
            }
          }
        }
        if (_isNonNullObject(sourceValue) && _isNonNullObject(destValue) && !Array.isArray(destValue)) {
          _mergeDeep(destValue, sourceValue, copyUndefined, makeCopyOfSimpleObjects);
        } else if (copyUndefined || sourceValue !== void 0) {
          dest[key2] = sourceValue;
        }
      });
    }
    function _isNonNullObject(value2) {
      return typeof value2 === "object" && value2 !== null;
    }
    var _GlobalGridOptions = class _GlobalGridOptions2 {
      /**
       * @param providedOptions
       * @returns Shallow copy of the provided options with global options merged in.
       */
      static applyGlobalGridOptions(providedOptions) {
        if (!_GlobalGridOptions2.gridOptions) {
          return { ...providedOptions };
        }
        let mergedGridOps = {};
        _mergeDeep(mergedGridOps, _GlobalGridOptions2.gridOptions, true, true);
        if (_GlobalGridOptions2.mergeStrategy === "deep") {
          _mergeDeep(mergedGridOps, providedOptions, true, true);
        } else {
          mergedGridOps = { ...mergedGridOps, ...providedOptions };
        }
        if (_GlobalGridOptions2.gridOptions.context) {
          mergedGridOps.context = _GlobalGridOptions2.gridOptions.context;
        }
        if (providedOptions.context) {
          if (_GlobalGridOptions2.mergeStrategy === "deep" && mergedGridOps.context) {
            _mergeDeep(providedOptions.context, mergedGridOps.context, true, true);
          }
          mergedGridOps.context = providedOptions.context;
        }
        return mergedGridOps;
      }
      /**
       * Apply global grid option for a specific option key.
       * If the merge strategy is 'deep' and both global and provided values are objects, they will be merged deeply.
       * Otherwise, the provided value is returned as is.
       * @param optionKey - The key of the grid option to apply.
       * @param providedValue - The value provided to the grid instance.
       * @returns The merged value if applicable, otherwise the provided value.
       */
      static applyGlobalGridOption(optionKey, providedValue) {
        if (_GlobalGridOptions2.mergeStrategy === "deep") {
          const globalValue = _getGlobalGridOption(optionKey);
          if (globalValue && typeof globalValue === "object" && typeof providedValue === "object") {
            return _GlobalGridOptions2.applyGlobalGridOptions({ [optionKey]: providedValue })[optionKey];
          }
        }
        return providedValue;
      }
    };
    _GlobalGridOptions.gridOptions = void 0;
    _GlobalGridOptions.mergeStrategy = "shallow";
    var GlobalGridOptions = _GlobalGridOptions;
    function _getGlobalGridOption(gridOption) {
      return GlobalGridOptions.gridOptions?.[gridOption];
    }
    var GRID_OPTION_DEFAULTS = {
      suppressContextMenu: false,
      preventDefaultOnContextMenu: false,
      allowContextMenuWithControlKey: false,
      suppressMenuHide: true,
      enableBrowserTooltips: false,
      tooltipTrigger: "hover",
      tooltipShowDelay: 2e3,
      tooltipHideDelay: 1e4,
      tooltipMouseTrack: false,
      tooltipShowMode: "standard",
      tooltipInteraction: false,
      copyHeadersToClipboard: false,
      copyGroupHeadersToClipboard: false,
      clipboardDelimiter: "	",
      suppressCopyRowsToClipboard: false,
      suppressCopySingleCellRanges: false,
      suppressLastEmptyLineOnPaste: false,
      suppressClipboardPaste: false,
      suppressClipboardApi: false,
      suppressCutToClipboard: false,
      maintainColumnOrder: false,
      enableStrictPivotColumnOrder: false,
      suppressFieldDotNotation: false,
      allowDragFromColumnsToolPanel: false,
      suppressMovableColumns: false,
      suppressColumnMoveAnimation: false,
      suppressMoveWhenColumnDragging: false,
      suppressDragLeaveHidesColumns: false,
      suppressRowGroupHidesColumns: false,
      suppressAutoSize: false,
      autoSizePadding: 20,
      skipHeaderOnAutoSize: false,
      singleClickEdit: false,
      suppressClickEdit: false,
      readOnlyEdit: false,
      stopEditingWhenCellsLoseFocus: false,
      enterNavigatesVertically: false,
      enterNavigatesVerticallyAfterEdit: false,
      enableCellEditingOnBackspace: false,
      undoRedoCellEditing: false,
      undoRedoCellEditingLimit: 10,
      suppressCsvExport: false,
      suppressExcelExport: false,
      cacheQuickFilter: false,
      includeHiddenColumnsInQuickFilter: false,
      excludeChildrenWhenTreeDataFiltering: false,
      enableAdvancedFilter: false,
      includeHiddenColumnsInAdvancedFilter: false,
      enableCharts: false,
      masterDetail: false,
      keepDetailRows: false,
      keepDetailRowsCount: 10,
      detailRowAutoHeight: false,
      tabIndex: 0,
      rowBuffer: 10,
      valueCache: false,
      valueCacheNeverExpires: false,
      enableCellExpressions: false,
      suppressTouch: false,
      suppressFocusAfterRefresh: false,
      suppressBrowserResizeObserver: false,
      suppressPropertyNamesCheck: false,
      suppressChangeDetection: false,
      debug: false,
      suppressLoadingOverlay: false,
      suppressNoRowsOverlay: false,
      pagination: false,
      paginationPageSize: 100,
      paginationPageSizeSelector: true,
      paginationAutoPageSize: false,
      paginateChildRows: false,
      suppressPaginationPanel: false,
      pivotMode: false,
      pivotPanelShow: "never",
      pivotDefaultExpanded: 0,
      pivotSuppressAutoColumn: false,
      suppressExpandablePivotGroups: false,
      functionsReadOnly: false,
      suppressAggFuncInHeader: false,
      alwaysAggregateAtRootLevel: false,
      aggregateOnlyChangedColumns: false,
      suppressAggFilteredOnly: false,
      removePivotHeaderRowWhenSingleValueColumn: false,
      animateRows: true,
      cellFlashDuration: 500,
      cellFadeDuration: 1e3,
      allowShowChangeAfterFilter: false,
      domLayout: "normal",
      ensureDomOrder: false,
      enableRtl: false,
      suppressColumnVirtualisation: false,
      suppressMaxRenderedRowRestriction: false,
      suppressRowVirtualisation: false,
      rowDragManaged: false,
      rowDragInsertDelay: 500,
      suppressRowDrag: false,
      suppressMoveWhenRowDragging: false,
      rowDragEntireRow: false,
      rowDragMultiRow: false,
      embedFullWidthRows: false,
      groupDisplayType: "singleColumn",
      groupDefaultExpanded: 0,
      groupMaintainOrder: false,
      groupSelectsChildren: false,
      groupSuppressBlankHeader: false,
      groupSelectsFiltered: false,
      showOpenedGroup: false,
      groupRemoveSingleChildren: false,
      groupRemoveLowestSingleChildren: false,
      groupHideOpenParents: false,
      groupAllowUnbalanced: false,
      rowGroupPanelShow: "never",
      suppressMakeColumnVisibleAfterUnGroup: false,
      treeData: false,
      rowGroupPanelSuppressSort: false,
      suppressGroupRowsSticky: false,
      rowModelType: "clientSide",
      asyncTransactionWaitMillis: 50,
      suppressModelUpdateAfterUpdateTransaction: false,
      cacheOverflowSize: 1,
      infiniteInitialRowCount: 1,
      serverSideInitialRowCount: 1,
      cacheBlockSize: 100,
      maxBlocksInCache: -1,
      maxConcurrentDatasourceRequests: 2,
      blockLoadDebounceMillis: 0,
      purgeClosedRowNodes: false,
      serverSideSortAllLevels: false,
      serverSideOnlyRefreshFilteredGroups: false,
      serverSidePivotResultFieldSeparator: "_",
      viewportRowModelPageSize: 5,
      viewportRowModelBufferSize: 5,
      alwaysShowHorizontalScroll: false,
      alwaysShowVerticalScroll: false,
      debounceVerticalScrollbar: false,
      suppressHorizontalScroll: false,
      suppressScrollOnNewData: false,
      suppressScrollWhenPopupsAreOpen: false,
      suppressAnimationFrame: false,
      suppressMiddleClickScrolls: false,
      suppressPreventDefaultOnMouseWheel: false,
      rowMultiSelectWithClick: false,
      suppressRowDeselection: false,
      suppressRowClickSelection: false,
      suppressCellFocus: false,
      suppressHeaderFocus: false,
      suppressMultiRangeSelection: false,
      enableCellTextSelection: false,
      enableRangeSelection: false,
      enableRangeHandle: false,
      enableFillHandle: false,
      fillHandleDirection: "xy",
      suppressClearOnFillReduction: false,
      accentedSort: false,
      unSortIcon: false,
      suppressMultiSort: false,
      alwaysMultiSort: false,
      suppressMaintainUnsortedOrder: false,
      suppressRowHoverHighlight: false,
      suppressRowTransform: false,
      columnHoverHighlight: false,
      deltaSort: false,
      enableGroupEdit: false,
      groupLockGroupColumns: 0,
      serverSideEnableClientSideSort: false,
      suppressServerSideFullWidthLoadingRow: false,
      pivotMaxGeneratedColumns: -1,
      columnMenu: "new",
      reactiveCustomComponents: true,
      suppressSetFilterByDefault: false,
      rowNumbers: false,
      enableFilterHandlers: false
    };
    var BASE_URL = "https://www.ag-grid.com";
    function _logIfDebug(gos, message2, ...args2) {
      if (gos.get("debug")) {
        console.log("AG Grid: " + message2, ...args2);
      }
    }
    function _warnOnce(msg, ...args2) {
      _doOnce(() => console.warn("AG Grid: " + msg, ...args2), msg + args2?.join(""));
    }
    function _errorOnce(msg, ...args2) {
      _doOnce(() => console.error("AG Grid: " + msg, ...args2), msg + args2?.join(""));
    }
    var allRegisteredModules = /* @__PURE__ */ new Set();
    var globalModulesMap = {};
    var gridModulesMap = {};
    var currentModuleVersion;
    var userHasRegistered = false;
    var areGridScopedModules = false;
    var isUmd = false;
    function isValidModuleVersion(module2) {
      const [moduleMajor, moduleMinor] = module2.version.split(".") || [];
      const [currentModuleMajor, currentModuleMinor] = currentModuleVersion.split(".") || [];
      return moduleMajor === currentModuleMajor && moduleMinor === currentModuleMinor;
    }
    function runVersionChecks(module2) {
      if (!currentModuleVersion) {
        currentModuleVersion = module2.version;
      }
      const errorMsg = (details) => `You are using incompatible versions of AG Grid modules. Major and minor versions should always match across modules. ${details} Please update all modules to the same version.`;
      if (!module2.version) {
        _errorOnce(errorMsg(`'${module2.moduleName}' is incompatible.`));
      } else if (!isValidModuleVersion(module2)) {
        _errorOnce(
          errorMsg(
            `'${module2.moduleName}' is version ${module2.version} but the other modules are version ${currentModuleVersion}.`
          )
        );
      }
      const result2 = module2.validate?.();
      if (result2 && !result2.isValid) {
        _errorOnce(`${result2.message}`);
      }
    }
    function _registerModule(module2, gridId, isInternalRegistration = false) {
      if (!isInternalRegistration) {
        userHasRegistered = true;
      }
      runVersionChecks(module2);
      const rowModels = module2.rowModels ?? ["all"];
      allRegisteredModules.add(module2);
      let moduleStore;
      if (gridId !== void 0) {
        areGridScopedModules = true;
        if (gridModulesMap[gridId] === void 0) {
          gridModulesMap[gridId] = {};
        }
        moduleStore = gridModulesMap[gridId];
      } else {
        moduleStore = globalModulesMap;
      }
      for (const rowModel of rowModels) {
        if (moduleStore[rowModel] === void 0) {
          moduleStore[rowModel] = {};
        }
        moduleStore[rowModel][module2.moduleName] = module2;
      }
      if (module2.dependsOn) {
        for (const dependency of module2.dependsOn) {
          _registerModule(dependency, gridId, isInternalRegistration);
        }
      }
    }
    function _unRegisterGridModules(gridId) {
      delete gridModulesMap[gridId];
    }
    function _isModuleRegistered(moduleName, gridId, rowModel) {
      const isRegisteredForRowModel = (model2) => !!globalModulesMap[model2]?.[moduleName] || !!gridModulesMap[gridId]?.[model2]?.[moduleName];
      return isRegisteredForRowModel(rowModel) || isRegisteredForRowModel("all");
    }
    function _areModulesGridScoped() {
      return areGridScopedModules;
    }
    function _getRegisteredModules(gridId, rowModel) {
      const gridModules = gridModulesMap[gridId] ?? {};
      return [
        ...Object.values(globalModulesMap["all"] ?? {}),
        ...Object.values(gridModules["all"] ?? {}),
        ...Object.values(globalModulesMap[rowModel] ?? {}),
        ...Object.values(gridModules[rowModel] ?? {})
      ];
    }
    function _getAllRegisteredModules() {
      return new Set(allRegisteredModules);
    }
    function _getGridRegisteredModules(gridId, rowModel) {
      const gridModules = gridModulesMap[gridId] ?? {};
      return [...Object.values(gridModules["all"] ?? {}), ...Object.values(gridModules[rowModel] ?? {})];
    }
    function _hasUserRegistered() {
      return userHasRegistered;
    }
    function _isUmd() {
      return isUmd;
    }
    var ModuleRegistry = class {
      /**
       * @deprecated v33 Use `registerModules([module])` instead.
       */
      static register(module2) {
        _registerModule(module2, void 0);
      }
      /**
       * Globally register the given modules for all grids.
       * @param modules - modules to register
       */
      static registerModules(modules) {
        for (const module2 of modules) {
          _registerModule(module2, void 0);
        }
      }
    };
    var VERSION = "34.3.1";
    var MAX_URL_LENGTH = 2e3;
    var MIN_PARAM_LENGTH = 100;
    var VERSION_PARAM_NAME = "_version_";
    var getConsoleMessage = null;
    var baseDocLink = `${BASE_URL}/javascript-data-grid`;
    function provideValidationServiceLogger(logger) {
      getConsoleMessage = logger;
    }
    function setValidationDocLink(docLink) {
      baseDocLink = docLink;
    }
    function getErrorParts(id, args2, defaultMessage) {
      return getConsoleMessage?.(id, args2) ?? [minifiedLog(id, args2, defaultMessage)];
    }
    function getMsgOrDefault(logger, id, args2, isWarning, defaultMessage) {
      logger(`${isWarning ? "warning" : "error"} #${id}`, ...getErrorParts(id, args2, defaultMessage));
    }
    function stringifyObject(inputObj) {
      if (!inputObj) {
        return String(inputObj);
      }
      const object = {};
      for (const prop2 of Object.keys(inputObj)) {
        if (typeof inputObj[prop2] !== "object" && typeof inputObj[prop2] !== "function") {
          object[prop2] = inputObj[prop2];
        }
      }
      return JSON.stringify(object);
    }
    function stringifyValue(value2) {
      let output2 = value2;
      if (value2 instanceof Error) {
        output2 = value2.toString();
      } else if (typeof value2 === "object") {
        output2 = stringifyObject(value2);
      }
      return output2;
    }
    function toStringWithNullUndefined(str2) {
      return str2 === void 0 ? "undefined" : str2 === null ? "null" : str2;
    }
    function getParamsUrl(baseUrl2, params) {
      return `${baseUrl2}?${params.toString()}`;
    }
    function truncateUrl(baseUrl2, params, maxLength) {
      const sortedParams = Array.from(params.entries()).sort((a, b) => b[1].length - a[1].length);
      let url = getParamsUrl(baseUrl2, params);
      for (const [key2, value2] of sortedParams) {
        if (key2 === VERSION_PARAM_NAME) {
          continue;
        }
        const excessLength = url.length - maxLength;
        if (excessLength <= 0) {
          break;
        }
        const ellipse = "...";
        const truncateAmount = excessLength + ellipse.length;
        const truncatedValue = value2.length - truncateAmount > MIN_PARAM_LENGTH ? value2.slice(0, value2.length - truncateAmount) + ellipse : value2.slice(0, MIN_PARAM_LENGTH) + ellipse;
        params.set(key2, truncatedValue);
        url = getParamsUrl(baseUrl2, params);
      }
      return url;
    }
    function getErrorLink(errorNum, args2) {
      const params = new URLSearchParams();
      params.append(VERSION_PARAM_NAME, VERSION);
      if (args2) {
        for (const key2 of Object.keys(args2)) {
          params.append(key2, stringifyValue(args2[key2]));
        }
      }
      const baseUrl2 = `${baseDocLink}/errors/${errorNum}`;
      const url = getParamsUrl(baseUrl2, params);
      return url.length <= MAX_URL_LENGTH ? url : truncateUrl(baseUrl2, params, MAX_URL_LENGTH);
    }
    var minifiedLog = (errorNum, args2, defaultMessage) => {
      const errorLink = getErrorLink(errorNum, args2);
      const prefix = `${defaultMessage ? defaultMessage + " \n" : ""}Visit ${errorLink}`;
      return `${prefix}${defaultMessage ? "" : " \n  Alternatively register the ValidationModule to see the full message in the console."}`;
    };
    function _warn(...args2) {
      getMsgOrDefault(_warnOnce, args2[0], args2[1], true);
    }
    function _error(...args2) {
      getMsgOrDefault(_errorOnce, args2[0], args2[1], false);
    }
    function _logPreInitErr(id, args2, defaultMessage) {
      getMsgOrDefault(_errorOnce, id, args2, false, defaultMessage);
    }
    function getErrMsg(defaultMessage, args2) {
      const id = args2[0];
      return `error #${id} ` + getErrorParts(id, args2[1], defaultMessage).join(" ");
    }
    function _errMsg(...args2) {
      return getErrMsg(void 0, args2);
    }
    function isRowModelType(gos, rowModelType) {
      return gos.get("rowModelType") === rowModelType;
    }
    function _isClientSideRowModel(gos, rowModel) {
      return isRowModelType(gos, "clientSide");
    }
    function _isServerSideRowModel(gos, rowModel) {
      return isRowModelType(gos, "serverSide");
    }
    function _isDomLayout(gos, domLayout) {
      return gos.get("domLayout") === domLayout;
    }
    function _isRowSelection(gos) {
      return _getRowSelectionMode(gos) !== void 0;
    }
    function _isGetRowHeightFunction(gos) {
      return typeof gos.get("getRowHeight") === "function";
    }
    function _shouldMaintainColumnOrder(gos, isPivotColumns) {
      if (isPivotColumns) {
        return !gos.get("enableStrictPivotColumnOrder");
      }
      return gos.get("maintainColumnOrder");
    }
    function _getRowHeightForNode(beans, rowNode, allowEstimate = false, defaultRowHeight) {
      const { gos, environment } = beans;
      if (defaultRowHeight == null) {
        defaultRowHeight = environment.getDefaultRowHeight();
      }
      if (_isGetRowHeightFunction(gos)) {
        if (allowEstimate) {
          return { height: defaultRowHeight, estimated: true };
        }
        const params = {
          node: rowNode,
          data: rowNode.data
        };
        const height = gos.getCallback("getRowHeight")(params);
        if (isNumeric(height)) {
          if (height === 0) {
            _warn(23);
          }
          return { height: Math.max(1, height), estimated: false };
        }
      }
      if (rowNode.detail && gos.get("masterDetail")) {
        return getMasterDetailRowHeight(gos);
      }
      const gridOptionsRowHeight = gos.get("rowHeight");
      const rowHeight = gridOptionsRowHeight && isNumeric(gridOptionsRowHeight) ? gridOptionsRowHeight : defaultRowHeight;
      return { height: rowHeight, estimated: false };
    }
    function getMasterDetailRowHeight(gos) {
      if (gos.get("detailRowAutoHeight")) {
        return { height: 1, estimated: false };
      }
      const defaultRowHeight = gos.get("detailRowHeight");
      if (isNumeric(defaultRowHeight)) {
        return { height: defaultRowHeight, estimated: false };
      }
      return { height: 300, estimated: false };
    }
    function _getRowHeightAsNumber(beans) {
      const { environment, gos } = beans;
      const gridOptionsRowHeight = gos.get("rowHeight");
      if (!gridOptionsRowHeight || _missing(gridOptionsRowHeight)) {
        return environment.getDefaultRowHeight();
      }
      const rowHeight = environment.refreshRowHeightVariable();
      if (rowHeight !== -1) {
        return rowHeight;
      }
      _warn(24);
      return environment.getDefaultRowHeight();
    }
    function isNumeric(value2) {
      return !isNaN(value2) && typeof value2 === "number" && isFinite(value2);
    }
    function _getDomData(gos, element, key2) {
      const domData = element[gos.getDomDataKey()];
      return domData ? domData[key2] : void 0;
    }
    function _setDomData(gos, element, key2, value2) {
      const domDataKey = gos.getDomDataKey();
      let domData = element[domDataKey];
      if (_missing(domData)) {
        domData = {};
        element[domDataKey] = domData;
      }
      domData[key2] = value2;
    }
    function _isAnimateRows(gos) {
      if (gos.get("ensureDomOrder")) {
        return false;
      }
      return gos.get("animateRows");
    }
    function _isGroupRowsSticky(gos) {
      return !(gos.get("paginateChildRows") || gos.get("groupHideOpenParents") || _isDomLayout(gos, "print"));
    }
    function _isColumnsSortingCoupledToGroup(gos) {
      const autoGroupColumnDef = gos.get("autoGroupColumnDef");
      return !autoGroupColumnDef?.comparator && !gos.get("treeData");
    }
    function _getGroupAggFiltering(gos) {
      const userValue = gos.get("groupAggFiltering");
      if (typeof userValue === "function") {
        return gos.getCallback("groupAggFiltering");
      }
      if (userValue === true) {
        return () => true;
      }
      return void 0;
    }
    function _getGrandTotalRow(gos) {
      return gos.get("grandTotalRow");
    }
    function _isGroupUseEntireRow(gos, pivotMode) {
      if (pivotMode) {
        return false;
      }
      return gos.get("groupDisplayType") === "groupRows";
    }
    function _isFullWidthGroupRow(gos, node2, pivotMode) {
      return !!node2.group && !node2.footer && _isGroupUseEntireRow(gos, pivotMode);
    }
    function _getRowIdCallback(gos) {
      const getRowId = gos.getCallback("getRowId");
      if (getRowId === void 0) {
        return getRowId;
      }
      return (params) => {
        let id = getRowId(params);
        if (typeof id !== "string") {
          _doOnce(() => _warn(25, { id }), "getRowIdString");
          id = String(id);
        }
        return id;
      };
    }
    function _canSkipShowingRowGroup(gos, node2) {
      const isSkippingGroups = gos.get("groupHideParentOfSingleChild");
      if (isSkippingGroups === true) {
        return true;
      }
      if (isSkippingGroups === "leafGroupsOnly" && node2.leafGroup) {
        return true;
      }
      if (gos.get("groupRemoveSingleChildren")) {
        return true;
      }
      if (gos.get("groupRemoveLowestSingleChildren") && node2.leafGroup) {
        return true;
      }
      return false;
    }
    function _getMaxConcurrentDatasourceRequests(gos) {
      const res = gos.get("maxConcurrentDatasourceRequests");
      return res > 0 ? res : void 0;
    }
    function _getCheckboxes(selection) {
      return selection?.checkboxes ?? true;
    }
    function _getHeaderCheckbox(selection) {
      return selection?.mode === "multiRow" && (selection.headerCheckbox ?? true);
    }
    function _getCheckboxLocation(rowSelection) {
      if (typeof rowSelection !== "object") {
        return void 0;
      }
      return rowSelection.checkboxLocation ?? "selectionColumn";
    }
    function _getHideDisabledCheckboxes(selection) {
      return selection?.hideDisabledCheckboxes ?? false;
    }
    function _isUsingNewRowSelectionAPI(gos) {
      const rowSelection = gos.get("rowSelection");
      return typeof rowSelection !== "string";
    }
    function _isCellSelectionEnabled(gos) {
      const selection = gos.get("cellSelection");
      const useNewAPI = selection !== void 0;
      return useNewAPI ? !!selection : gos.get("enableRangeSelection");
    }
    function _getEnableClickSelection(gos) {
      const selection = gos.get("rowSelection") ?? "single";
      if (typeof selection === "string") {
        const suppressRowClickSelection = gos.get("suppressRowClickSelection");
        const suppressRowDeselection = gos.get("suppressRowDeselection");
        if (suppressRowClickSelection && suppressRowDeselection) {
          return false;
        } else if (suppressRowClickSelection) {
          return "enableDeselection";
        } else if (suppressRowDeselection) {
          return "enableSelection";
        } else {
          return true;
        }
      }
      return selection.mode === "singleRow" || selection.mode === "multiRow" ? selection.enableClickSelection ?? false : false;
    }
    function _getEnableSelection(gos) {
      const enableClickSelection = _getEnableClickSelection(gos);
      return enableClickSelection === true || enableClickSelection === "enableSelection";
    }
    function _getEnableDeselection(gos) {
      const enableClickSelection = _getEnableClickSelection(gos);
      return enableClickSelection === true || enableClickSelection === "enableDeselection";
    }
    function _getIsRowSelectable(gos) {
      const selection = gos.get("rowSelection");
      if (typeof selection === "string") {
        return gos.get("isRowSelectable");
      }
      return selection?.isRowSelectable;
    }
    function _getRowSelectionMode(arg) {
      const selection = "beanName" in arg && arg.beanName === "gos" ? arg.get("rowSelection") : arg.rowSelection;
      if (typeof selection === "string") {
        switch (selection) {
          case "multiple":
            return "multiRow";
          case "single":
            return "singleRow";
          default:
            return;
        }
      }
      switch (selection?.mode) {
        case "multiRow":
        case "singleRow":
          return selection.mode;
        default:
          return;
      }
    }
    function _isMultiRowSelection(arg) {
      const mode = _getRowSelectionMode(arg);
      return mode === "multiRow";
    }
    function _getEnableSelectionWithoutKeys(gos) {
      const selection = gos.get("rowSelection");
      if (typeof selection === "string") {
        return gos.get("rowMultiSelectWithClick");
      }
      return selection?.enableSelectionWithoutKeys ?? false;
    }
    function _getGroupSelection(gos) {
      const selection = gos.get("rowSelection");
      if (typeof selection === "string") {
        const groupSelectsChildren = gos.get("groupSelectsChildren");
        const groupSelectsFiltered = gos.get("groupSelectsFiltered");
        if (groupSelectsChildren && groupSelectsFiltered) {
          return "filteredDescendants";
        } else if (groupSelectsChildren) {
          return "descendants";
        } else {
          return "self";
        }
      }
      return selection?.mode === "multiRow" ? selection.groupSelects : void 0;
    }
    function _getSelectAll(gos, defaultValue = true) {
      const rowSelection = gos.get("rowSelection");
      if (typeof rowSelection !== "object") {
        return defaultValue ? "all" : void 0;
      }
      return rowSelection.mode === "multiRow" ? rowSelection.selectAll : "all";
    }
    function _getCtrlASelectsRows(gos) {
      const rowSelection = gos.get("rowSelection");
      if (typeof rowSelection === "string") {
        return false;
      }
      return rowSelection?.mode === "multiRow" ? rowSelection.ctrlASelectsRows ?? false : false;
    }
    function _getGroupSelectsDescendants(gos) {
      const groupSelection = _getGroupSelection(gos);
      return groupSelection === "descendants" || groupSelection === "filteredDescendants";
    }
    function _getMasterSelects(gos) {
      const rowSelection = gos.get("rowSelection");
      return typeof rowSelection === "object" && rowSelection.masterSelects || "self";
    }
    function _isSetFilterByDefault(gos) {
      return gos.isModuleRegistered("SetFilter") && !gos.get("suppressSetFilterByDefault");
    }
    function _isLegacyMenuEnabled(gos) {
      return gos.get("columnMenu") === "legacy";
    }
    function _isColumnMenuAnchoringEnabled(gos) {
      return !_isLegacyMenuEnabled(gos);
    }
    function _getCallbackForEvent(eventName) {
      if (!eventName || eventName.length < 2) {
        return eventName;
      }
      return "on" + eventName[0].toUpperCase() + eventName.substring(1);
    }
    function _combineAttributesAndGridOptions(gridOptions, component, gridOptionsKeys) {
      if (typeof gridOptions !== "object") {
        gridOptions = {};
      }
      const mergedOptions = { ...gridOptions };
      for (const key2 of gridOptionsKeys) {
        const value2 = component[key2];
        if (typeof value2 !== "undefined") {
          mergedOptions[key2] = value2;
        }
      }
      return mergedOptions;
    }
    function _processOnChange(changes, api2) {
      if (!changes) {
        return;
      }
      const gridChanges = {};
      let hasChanges = false;
      for (const key2 of Object.keys(changes)) {
        gridChanges[key2] = changes[key2];
        hasChanges = true;
      }
      if (!hasChanges) {
        return;
      }
      const internalUpdateEvent = {
        type: "gridOptionsChanged",
        options: gridChanges
      };
      api2.dispatchEvent(internalUpdateEvent);
      const event = {
        type: "componentStateChanged",
        ...gridChanges
      };
      api2.dispatchEvent(event);
    }
    function _addGridCommonParams(gos, params) {
      return gos.addCommon(params);
    }
    function _getGridOption(providedGridOptions, gridOption) {
      return providedGridOptions[gridOption] ?? providedGridOptions[`gridOptions`]?.[gridOption] ?? _getGlobalGridOption(gridOption) ?? GRID_OPTION_DEFAULTS[gridOption];
    }
    function _interpretAsRightClick({ gos }, event) {
      return event.button === 2 || event.ctrlKey && gos.get("allowContextMenuWithControlKey");
    }
    var COL_DEF_DEFAULTS = {
      resizable: true,
      sortable: true
    };
    var instanceIdSequence = 0;
    function getNextColInstanceId() {
      return instanceIdSequence++;
    }
    function isColumn(col) {
      return col instanceof AgColumn;
    }
    var AgColumn = class extends BeanStub {
      constructor(colDef, userProvidedColDef, colId, primary2) {
        super();
        this.colDef = colDef;
        this.userProvidedColDef = userProvidedColDef;
        this.colId = colId;
        this.primary = primary2;
        this.isColumn = true;
        this.instanceId = getNextColInstanceId();
        this.autoHeaderHeight = null;
        this.moving = false;
        this.resizing = false;
        this.menuVisible = false;
        this.lastLeftPinned = false;
        this.firstRightPinned = false;
        this.filterActive = false;
        this.colEventSvc = new LocalEventService();
        this.tooltipEnabled = false;
        this.rowGroupActive = false;
        this.pivotActive = false;
        this.aggregationActive = false;
        this.flex = null;
        this.colIdSanitised = _escapeString(colId);
      }
      destroy() {
        super.destroy();
        this.beans.rowSpanSvc?.deregister(this);
      }
      getInstanceId() {
        return this.instanceId;
      }
      setState() {
        const {
          colDef,
          beans: { sortSvc, pinnedCols, colFlex }
        } = this;
        sortSvc?.initCol(this);
        const hide2 = colDef.hide;
        if (hide2 !== void 0) {
          this.visible = !hide2;
        } else {
          this.visible = !colDef.initialHide;
        }
        pinnedCols?.initCol(this);
        colFlex?.initCol(this);
      }
      // gets called when user provides an alternative colDef, eg
      setColDef(colDef, userProvidedColDef, source2) {
        const colSpanChanged = colDef.spanRows !== this.colDef.spanRows;
        this.colDef = colDef;
        this.userProvidedColDef = userProvidedColDef;
        this.initMinAndMaxWidths();
        this.initDotNotation();
        this.initTooltip();
        if (colSpanChanged) {
          this.beans.rowSpanSvc?.deregister(this);
          this.initRowSpan();
        }
        this.dispatchColEvent("colDefChanged", source2);
      }
      getUserProvidedColDef() {
        return this.userProvidedColDef;
      }
      getParent() {
        return this.parent;
      }
      getOriginalParent() {
        return this.originalParent;
      }
      // this is done after constructor as it uses gridOptionsService
      postConstruct() {
        this.setState();
        this.initMinAndMaxWidths();
        this.resetActualWidth("gridInitializing");
        this.initDotNotation();
        this.initTooltip();
        this.initRowSpan();
        this.addPivotListener();
      }
      initDotNotation() {
        const {
          gos,
          colDef: { field, tooltipField }
        } = this;
        const suppressDotNotation = gos.get("suppressFieldDotNotation");
        this.fieldContainsDots = _exists(field) && field.includes(".") && !suppressDotNotation;
        this.tooltipFieldContainsDots = _exists(tooltipField) && tooltipField.includes(".") && !suppressDotNotation;
      }
      initMinAndMaxWidths() {
        const colDef = this.colDef;
        this.minWidth = colDef.minWidth ?? this.beans.environment.getDefaultColumnMinWidth();
        this.maxWidth = colDef.maxWidth ?? Number.MAX_SAFE_INTEGER;
      }
      initTooltip() {
        this.beans.tooltipSvc?.initCol(this);
      }
      initRowSpan() {
        if (this.colDef.spanRows) {
          this.beans.rowSpanSvc?.register(this);
        }
      }
      addPivotListener() {
        const pivotColDefSvc = this.beans.pivotColDefSvc;
        const pivotValueColumn = this.colDef.pivotValueColumn;
        if (!pivotColDefSvc || !pivotValueColumn) {
          return;
        }
        this.addManagedListeners(pivotValueColumn, {
          colDefChanged: (evt) => {
            const colDef = pivotColDefSvc.recreateColDef(this.colDef);
            this.setColDef(colDef, colDef, evt.source);
          }
        });
      }
      resetActualWidth(source2) {
        const initialWidth = this.calculateColInitialWidth(this.colDef);
        this.setActualWidth(initialWidth, source2, true);
      }
      calculateColInitialWidth(colDef) {
        let width;
        const colDefWidth = colDef.width;
        const colDefInitialWidth = colDef.initialWidth;
        if (colDefWidth != null) {
          width = colDefWidth;
        } else if (colDefInitialWidth != null) {
          width = colDefInitialWidth;
        } else {
          width = 200;
        }
        return Math.max(Math.min(width, this.maxWidth), this.minWidth);
      }
      isEmptyGroup() {
        return false;
      }
      isRowGroupDisplayed(colId) {
        return this.beans.showRowGroupCols?.isRowGroupDisplayed(this, colId) ?? false;
      }
      isPrimary() {
        return this.primary;
      }
      isFilterAllowed() {
        const filterDefined = !!this.colDef.filter;
        return filterDefined;
      }
      isFieldContainsDots() {
        return this.fieldContainsDots;
      }
      isTooltipEnabled() {
        return this.tooltipEnabled;
      }
      isTooltipFieldContainsDots() {
        return this.tooltipFieldContainsDots;
      }
      getHighlighted() {
        return this.highlighted;
      }
      __addEventListener(eventType, listener) {
        this.colEventSvc.addEventListener(eventType, listener);
      }
      __removeEventListener(eventType, listener) {
        this.colEventSvc.removeEventListener(eventType, listener);
      }
      /**
       * PUBLIC USE ONLY: for internal use within AG Grid use the `__addEventListener` and `__removeEventListener` methods.
       */
      addEventListener(eventType, userListener) {
        this.frameworkEventListenerService = this.beans.frameworkOverrides.createLocalEventListenerWrapper?.(
          this.frameworkEventListenerService,
          this.colEventSvc
        );
        const listener = this.frameworkEventListenerService?.wrap(eventType, userListener) ?? userListener;
        this.colEventSvc.addEventListener(eventType, listener);
      }
      /**
       * PUBLIC USE ONLY: for internal use within AG Grid use the `__addEventListener` and `__removeEventListener` methods.
       */
      removeEventListener(eventType, userListener) {
        const listener = this.frameworkEventListenerService?.unwrap(eventType, userListener) ?? userListener;
        this.colEventSvc.removeEventListener(eventType, listener);
      }
      createColumnFunctionCallbackParams(rowNode) {
        return _addGridCommonParams(this.gos, {
          node: rowNode,
          data: rowNode.data,
          column: this,
          colDef: this.colDef
        });
      }
      isSuppressNavigable(rowNode) {
        return this.beans.cellNavigation?.isSuppressNavigable(this, rowNode) ?? false;
      }
      isCellEditable(rowNode) {
        return this.beans.editSvc?.isCellEditable({ rowNode, column: this }) ?? false;
      }
      isSuppressFillHandle() {
        return !!this.colDef.suppressFillHandle;
      }
      isAutoHeight() {
        return !!this.colDef.autoHeight;
      }
      isAutoHeaderHeight() {
        return !!this.colDef.autoHeaderHeight;
      }
      isRowDrag(rowNode) {
        return this.isColumnFunc(rowNode, this.colDef.rowDrag);
      }
      isDndSource(rowNode) {
        return this.isColumnFunc(rowNode, this.colDef.dndSource);
      }
      isCellCheckboxSelection(rowNode) {
        return this.beans.selectionSvc?.isCellCheckboxSelection(this, rowNode) ?? false;
      }
      isSuppressPaste(rowNode) {
        return this.isColumnFunc(rowNode, this.colDef?.suppressPaste ?? null);
      }
      isResizable() {
        return !!this.getColDefValue("resizable");
      }
      /** Get value from ColDef or default if it exists. */
      getColDefValue(key2) {
        return this.colDef[key2] ?? COL_DEF_DEFAULTS[key2];
      }
      isColumnFunc(rowNode, value2) {
        if (typeof value2 === "boolean") {
          return value2;
        }
        if (typeof value2 === "function") {
          const params = this.createColumnFunctionCallbackParams(rowNode);
          const editableFunc = value2;
          return editableFunc(params);
        }
        return false;
      }
      createColumnEvent(type, source2) {
        return _addGridCommonParams(this.gos, {
          type,
          column: this,
          columns: [this],
          source: source2
        });
      }
      isMoving() {
        return this.moving;
      }
      getSort() {
        return this.sort;
      }
      isSortable() {
        return !!this.getColDefValue("sortable");
      }
      /** @deprecated v32 use col.getSort() === 'asc */
      isSortAscending() {
        return this.sort === "asc";
      }
      /** @deprecated v32 use col.getSort() === 'desc */
      isSortDescending() {
        return this.sort === "desc";
      }
      /** @deprecated v32 use col.getSort() === undefined */
      isSortNone() {
        return _missing(this.sort);
      }
      /** @deprecated v32 use col.getSort() !== undefined */
      isSorting() {
        return _exists(this.sort);
      }
      getSortIndex() {
        return this.sortIndex;
      }
      isMenuVisible() {
        return this.menuVisible;
      }
      getAggFunc() {
        return this.aggFunc;
      }
      getLeft() {
        return this.left;
      }
      getOldLeft() {
        return this.oldLeft;
      }
      getRight() {
        return this.left + this.actualWidth;
      }
      setLeft(left2, source2) {
        this.oldLeft = this.left;
        if (this.left !== left2) {
          this.left = left2;
          this.dispatchColEvent("leftChanged", source2);
        }
      }
      isFilterActive() {
        return this.filterActive;
      }
      /** @deprecated v33 Use `api.isColumnHovered(column)` instead. */
      isHovered() {
        _warn(261);
        return !!this.beans.colHover?.isHovered(this);
      }
      setFirstRightPinned(firstRightPinned, source2) {
        if (this.firstRightPinned !== firstRightPinned) {
          this.firstRightPinned = firstRightPinned;
          this.dispatchColEvent("firstRightPinnedChanged", source2);
        }
      }
      setLastLeftPinned(lastLeftPinned, source2) {
        if (this.lastLeftPinned !== lastLeftPinned) {
          this.lastLeftPinned = lastLeftPinned;
          this.dispatchColEvent("lastLeftPinnedChanged", source2);
        }
      }
      isFirstRightPinned() {
        return this.firstRightPinned;
      }
      isLastLeftPinned() {
        return this.lastLeftPinned;
      }
      isPinned() {
        return this.pinned === "left" || this.pinned === "right";
      }
      isPinnedLeft() {
        return this.pinned === "left";
      }
      isPinnedRight() {
        return this.pinned === "right";
      }
      getPinned() {
        return this.pinned;
      }
      setVisible(visible2, source2) {
        const newValue = visible2 === true;
        if (this.visible !== newValue) {
          this.visible = newValue;
          this.dispatchColEvent("visibleChanged", source2);
        }
        this.dispatchStateUpdatedEvent("hide");
      }
      isVisible() {
        return this.visible;
      }
      isSpanHeaderHeight() {
        const colDef = this.getColDef();
        return !colDef.suppressSpanHeaderHeight;
      }
      /**
       * Returns the first parent that is not a padding group.
       */
      getFirstRealParent() {
        let parent = this.getOriginalParent();
        while (parent?.isPadding()) {
          parent = parent.getOriginalParent();
        }
        return parent;
      }
      getColumnGroupPaddingInfo() {
        let parent = this.getParent();
        if (!parent?.isPadding()) {
          return { numberOfParents: 0, isSpanningTotal: false };
        }
        const numberOfParents = parent.getPaddingLevel() + 1;
        let isSpanningTotal = true;
        while (parent) {
          if (!parent.isPadding()) {
            isSpanningTotal = false;
            break;
          }
          parent = parent.getParent();
        }
        return { numberOfParents, isSpanningTotal };
      }
      getColDef() {
        return this.colDef;
      }
      getDefinition() {
        return this.colDef;
      }
      getColumnGroupShow() {
        return this.colDef.columnGroupShow;
      }
      getColId() {
        return this.colId;
      }
      getId() {
        return this.colId;
      }
      getUniqueId() {
        return this.colId;
      }
      getActualWidth() {
        return this.actualWidth;
      }
      getAutoHeaderHeight() {
        return this.autoHeaderHeight;
      }
      /** Returns true if the header height has changed */
      setAutoHeaderHeight(height) {
        const changed = height !== this.autoHeaderHeight;
        this.autoHeaderHeight = height;
        return changed;
      }
      createBaseColDefParams(rowNode) {
        const params = _addGridCommonParams(this.gos, {
          node: rowNode,
          data: rowNode.data,
          colDef: this.colDef,
          column: this
        });
        return params;
      }
      getColSpan(rowNode) {
        if (_missing(this.colDef.colSpan)) {
          return 1;
        }
        const params = this.createBaseColDefParams(rowNode);
        const colSpan = this.colDef.colSpan(params);
        return Math.max(colSpan, 1);
      }
      getRowSpan(rowNode) {
        if (_missing(this.colDef.rowSpan)) {
          return 1;
        }
        const params = this.createBaseColDefParams(rowNode);
        const rowSpan = this.colDef.rowSpan(params);
        return Math.max(rowSpan, 1);
      }
      setActualWidth(actualWidth, source2, silent = false) {
        actualWidth = Math.max(actualWidth, this.minWidth);
        actualWidth = Math.min(actualWidth, this.maxWidth);
        if (this.actualWidth !== actualWidth) {
          this.actualWidth = actualWidth;
          if (this.flex != null && source2 !== "flex" && source2 !== "gridInitializing") {
            this.flex = null;
          }
          if (!silent) {
            this.fireColumnWidthChangedEvent(source2);
          }
        }
        this.dispatchStateUpdatedEvent("width");
      }
      fireColumnWidthChangedEvent(source2) {
        this.dispatchColEvent("widthChanged", source2);
      }
      isGreaterThanMax(width) {
        return width > this.maxWidth;
      }
      getMinWidth() {
        return this.minWidth;
      }
      getMaxWidth() {
        return this.maxWidth;
      }
      getFlex() {
        return this.flex;
      }
      isRowGroupActive() {
        return this.rowGroupActive;
      }
      isPivotActive() {
        return this.pivotActive;
      }
      isAnyFunctionActive() {
        return this.isPivotActive() || this.isRowGroupActive() || this.isValueActive();
      }
      isAnyFunctionAllowed() {
        return this.isAllowPivot() || this.isAllowRowGroup() || this.isAllowValue();
      }
      isValueActive() {
        return this.aggregationActive;
      }
      isAllowPivot() {
        return this.colDef.enablePivot === true;
      }
      isAllowValue() {
        return this.colDef.enableValue === true;
      }
      isAllowRowGroup() {
        return this.colDef.enableRowGroup === true;
      }
      dispatchColEvent(type, source2, additionalEventAttributes) {
        const colEvent = this.createColumnEvent(type, source2);
        if (additionalEventAttributes) {
          _mergeDeep(colEvent, additionalEventAttributes);
        }
        this.colEventSvc.dispatchEvent(colEvent);
      }
      dispatchStateUpdatedEvent(key2) {
        this.colEventSvc.dispatchEvent({
          type: "columnStateUpdated",
          key: key2
        });
      }
    };
    function isProvidedColumnGroup(col) {
      return col instanceof AgProvidedColumnGroup;
    }
    var AgProvidedColumnGroup = class extends BeanStub {
      constructor(colGroupDef, groupId, padding, level) {
        super();
        this.colGroupDef = colGroupDef;
        this.groupId = groupId;
        this.padding = padding;
        this.level = level;
        this.isColumn = false;
        this.expandable = false;
        this.instanceId = getNextColInstanceId();
        this.expandableListenerRemoveCallback = null;
        this.expanded = !!colGroupDef?.openByDefault;
      }
      destroy() {
        if (this.expandableListenerRemoveCallback) {
          this.reset(null, void 0);
        }
        super.destroy();
      }
      reset(colGroupDef, level) {
        this.colGroupDef = colGroupDef;
        this.level = level;
        this.originalParent = null;
        if (this.expandableListenerRemoveCallback) {
          this.expandableListenerRemoveCallback();
        }
        this.children = void 0;
        this.expandable = void 0;
      }
      getInstanceId() {
        return this.instanceId;
      }
      getOriginalParent() {
        return this.originalParent;
      }
      getLevel() {
        return this.level;
      }
      isVisible() {
        if (this.children) {
          return this.children.some((child) => child.isVisible());
        }
        return false;
      }
      isPadding() {
        return this.padding;
      }
      setExpanded(expanded) {
        this.expanded = expanded === void 0 ? false : expanded;
        this.dispatchLocalEvent({ type: "expandedChanged" });
      }
      isExpandable() {
        return this.expandable;
      }
      isExpanded() {
        return this.expanded;
      }
      getGroupId() {
        return this.groupId;
      }
      getId() {
        return this.getGroupId();
      }
      setChildren(children2) {
        this.children = children2;
      }
      getChildren() {
        return this.children;
      }
      getColGroupDef() {
        return this.colGroupDef;
      }
      getLeafColumns() {
        const result2 = [];
        this.addLeafColumns(result2);
        return result2;
      }
      forEachLeafColumn(callback) {
        if (!this.children) {
          return;
        }
        for (const child of this.children) {
          if (isColumn(child)) {
            callback(child);
          } else if (isProvidedColumnGroup(child)) {
            child.forEachLeafColumn(callback);
          }
        }
      }
      addLeafColumns(leafColumns) {
        if (!this.children) {
          return;
        }
        for (const child of this.children) {
          if (isColumn(child)) {
            leafColumns.push(child);
          } else if (isProvidedColumnGroup(child)) {
            child.addLeafColumns(leafColumns);
          }
        }
      }
      getColumnGroupShow() {
        const colGroupDef = this.colGroupDef;
        if (!colGroupDef) {
          return;
        }
        return colGroupDef.columnGroupShow;
      }
      // need to check that this group has at least one col showing when both expanded and contracted.
      // if not, then we don't allow expanding and contracting on this group
      setupExpandable() {
        this.setExpandable();
        if (this.expandableListenerRemoveCallback) {
          this.expandableListenerRemoveCallback();
        }
        const listener = this.onColumnVisibilityChanged.bind(this);
        for (const col of this.getLeafColumns()) {
          col.__addEventListener("visibleChanged", listener);
        }
        this.expandableListenerRemoveCallback = () => {
          for (const col of this.getLeafColumns()) {
            col.__removeEventListener("visibleChanged", listener);
          }
          this.expandableListenerRemoveCallback = null;
        };
      }
      setExpandable() {
        if (this.isPadding()) {
          return;
        }
        let atLeastOneShowingWhenOpen = false;
        let atLeastOneShowingWhenClosed = false;
        let atLeastOneChangeable = false;
        const children2 = this.findChildrenRemovingPadding();
        for (let i2 = 0, j = children2.length; i2 < j; i2++) {
          const abstractColumn = children2[i2];
          if (!abstractColumn.isVisible()) {
            continue;
          }
          const headerGroupShow = abstractColumn.getColumnGroupShow();
          if (headerGroupShow === "open") {
            atLeastOneShowingWhenOpen = true;
            atLeastOneChangeable = true;
          } else if (headerGroupShow === "closed") {
            atLeastOneShowingWhenClosed = true;
            atLeastOneChangeable = true;
          } else {
            atLeastOneShowingWhenOpen = true;
            atLeastOneShowingWhenClosed = true;
          }
        }
        const expandable = atLeastOneShowingWhenOpen && atLeastOneShowingWhenClosed && atLeastOneChangeable;
        if (this.expandable !== expandable) {
          this.expandable = expandable;
          this.dispatchLocalEvent({ type: "expandableChanged" });
        }
      }
      findChildrenRemovingPadding() {
        const res = [];
        const process2 = (items) => {
          for (const item2 of items) {
            const skipBecausePadding = isProvidedColumnGroup(item2) && item2.isPadding();
            if (skipBecausePadding) {
              process2(item2.children);
            } else {
              res.push(item2);
            }
          }
        };
        process2(this.children);
        return res;
      }
      onColumnVisibilityChanged() {
        this.setExpandable();
      }
    };
    var DefaultColumnTypes = {
      numericColumn: {
        headerClass: "ag-right-aligned-header",
        cellClass: "ag-right-aligned-cell"
      },
      rightAligned: {
        headerClass: "ag-right-aligned-header",
        cellClass: "ag-right-aligned-cell"
      }
    };
    function createMergedColGroupDef(beans, colGroupDef, groupId) {
      const colGroupDefMerged = {};
      const gos = beans.gos;
      Object.assign(colGroupDefMerged, gos.get("defaultColGroupDef"));
      Object.assign(colGroupDefMerged, colGroupDef);
      gos.validateColDef(colGroupDefMerged, groupId);
      return colGroupDefMerged;
    }
    var ColumnKeyCreator = class {
      constructor() {
        this.existingKeys = {};
      }
      addExistingKeys(keys) {
        for (let i2 = 0; i2 < keys.length; i2++) {
          this.existingKeys[keys[i2]] = true;
        }
      }
      getUniqueKey(colId, colField) {
        colId = _toStringOrNull(colId);
        let count = 0;
        while (true) {
          let idToTry = colId ?? colField;
          if (idToTry) {
            if (count !== 0) {
              idToTry += "_" + count;
            }
          } else {
            idToTry = count;
          }
          if (!this.existingKeys[idToTry]) {
            const usedId = String(idToTry);
            if (colId && count > 0) {
              _warn(273, { providedId: colId, usedId });
            }
            this.existingKeys[usedId] = true;
            return usedId;
          }
          count++;
        }
      }
    };
    function _last(arr2) {
      if (!arr2?.length) {
        return;
      }
      return arr2[arr2.length - 1];
    }
    function _areEqual(a, b, comparator) {
      if (a === b) {
        return true;
      }
      if (!a || !b) {
        return a == null && b == null;
      }
      const len = a.length;
      if (len !== b.length) {
        return false;
      }
      for (let i2 = 0; i2 < len; i2++) {
        if (a[i2] !== b[i2] && !comparator?.(a[i2], b[i2])) {
          return false;
        }
      }
      return true;
    }
    function _forAll(array, callback) {
      if (!array) {
        return;
      }
      for (const value2 of array) {
        callback(value2);
      }
    }
    function _removeFromArray(array, object) {
      const index = array.indexOf(object);
      if (index >= 0) {
        array.splice(index, 1);
      }
    }
    function _moveInArray(array, objectsToMove, toIndex) {
      for (let i2 = 0; i2 < objectsToMove.length; i2++) {
        _removeFromArray(array, objectsToMove[i2]);
      }
      for (let i2 = objectsToMove.length - 1; i2 >= 0; i2--) {
        array.splice(toIndex, 0, objectsToMove[i2]);
      }
    }
    var GROUP_AUTO_COLUMN_ID = "ag-Grid-AutoColumn";
    var SELECTION_COLUMN_ID = "ag-Grid-SelectionColumn";
    var ROW_NUMBERS_COLUMN_ID = "ag-Grid-RowNumbersColumn";
    function _getColumnsFromTree(rootColumns) {
      const result2 = [];
      const recursiveFindColumns = (childColumns) => {
        for (let i2 = 0; i2 < childColumns.length; i2++) {
          const child = childColumns[i2];
          if (isColumn(child)) {
            result2.push(child);
          } else if (isProvidedColumnGroup(child)) {
            recursiveFindColumns(child.getChildren());
          }
        }
      };
      recursiveFindColumns(rootColumns);
      return result2;
    }
    function getWidthOfColsInList(columnList) {
      return columnList.reduce((width, col) => width + col.getActualWidth(), 0);
    }
    function _destroyColumnTree(beans, oldTree, newTree) {
      const oldObjectsById = {};
      if (!oldTree) {
        return;
      }
      depthFirstOriginalTreeSearch(null, oldTree, (child) => {
        oldObjectsById[child.getInstanceId()] = child;
      });
      if (newTree) {
        depthFirstOriginalTreeSearch(null, newTree, (child) => {
          oldObjectsById[child.getInstanceId()] = null;
        });
      }
      const colsToDestroy = Object.values(oldObjectsById).filter((item2) => item2 != null);
      beans.context.destroyBeans(colsToDestroy);
    }
    function isColumnGroupAutoCol(col) {
      const colId = col.getId();
      return colId.startsWith(GROUP_AUTO_COLUMN_ID);
    }
    function isColumnSelectionCol(col) {
      const id = typeof col === "string" ? col : "getColId" in col ? col.getColId() : col.colId;
      return id?.startsWith(SELECTION_COLUMN_ID) ?? false;
    }
    function isRowNumberCol(col) {
      const id = typeof col === "string" ? col : "getColId" in col ? col.getColId() : col.colId;
      return id?.startsWith(ROW_NUMBERS_COLUMN_ID) ?? false;
    }
    function isSpecialCol(col) {
      return isColumnSelectionCol(col) || isRowNumberCol(col);
    }
    function convertColumnTypes(type) {
      let typeKeys = [];
      if (type instanceof Array) {
        typeKeys = type;
      } else if (typeof type === "string") {
        typeKeys = type.split(",");
      }
      return typeKeys;
    }
    function _areColIdsEqual(colsA, colsB) {
      return _areEqual(colsA, colsB, (a, b) => a.getColId() === b.getColId());
    }
    function _updateColsMap(cols) {
      cols.map = {};
      for (const col of cols.list) {
        cols.map[col.getId()] = col;
      }
    }
    function _convertColumnEventSourceType(source2) {
      return source2 === "optionsUpdated" ? "gridOptionsChanged" : source2;
    }
    function _columnsMatch(column2, key2) {
      const columnMatches = column2 === key2;
      const colDefMatches = column2.getColDef() === key2;
      const idMatches = column2.getColId() == key2;
      return columnMatches || colDefMatches || idMatches;
    }
    var getValueFactory = (stateItem, defaultState) => (key1, key2) => {
      const obj = {
        value1: void 0,
        value2: void 0
      };
      let calculated = false;
      if (stateItem) {
        if (stateItem[key1] !== void 0) {
          obj.value1 = stateItem[key1];
          calculated = true;
        }
        if (_exists(key2) && stateItem[key2] !== void 0) {
          obj.value2 = stateItem[key2];
          calculated = true;
        }
      }
      if (!calculated && defaultState) {
        if (defaultState[key1] !== void 0) {
          obj.value1 = defaultState[key1];
        }
        if (_exists(key2) && defaultState[key2] !== void 0) {
          obj.value2 = defaultState[key2];
        }
      }
      return obj;
    };
    var depthFirstCallback = (child, parent) => {
      if (isProvidedColumnGroup(child)) {
        child.setupExpandable();
      }
      child.originalParent = parent;
    };
    function _createColumnTree(beans, defs = null, primaryColumns, existingTree, source2) {
      const columnKeyCreator = new ColumnKeyCreator();
      const { existingCols, existingGroups, existingColKeys } = extractExistingTreeData(existingTree);
      columnKeyCreator.addExistingKeys(existingColKeys);
      const unbalancedTree = _recursivelyCreateColumns(
        beans,
        defs,
        0,
        primaryColumns,
        existingCols,
        columnKeyCreator,
        existingGroups,
        source2
      );
      const { colGroupSvc } = beans;
      const treeDepth = colGroupSvc?.findMaxDepth(unbalancedTree, 0) ?? 0;
      const columnTree = colGroupSvc ? colGroupSvc.balanceColumnTree(unbalancedTree, 0, treeDepth, columnKeyCreator) : unbalancedTree;
      depthFirstOriginalTreeSearch(null, columnTree, depthFirstCallback);
      return {
        columnTree,
        treeDepth
      };
    }
    function extractExistingTreeData(existingTree) {
      const existingCols = [];
      const existingGroups = [];
      const existingColKeys = [];
      if (existingTree) {
        depthFirstOriginalTreeSearch(null, existingTree, (item2) => {
          if (isProvidedColumnGroup(item2)) {
            const group = item2;
            existingGroups.push(group);
          } else {
            const col = item2;
            existingColKeys.push(col.getId());
            existingCols.push(col);
          }
        });
      }
      return { existingCols, existingGroups, existingColKeys };
    }
    function _recursivelyCreateColumns(beans, defs, level, primaryColumns, existingColsCopy, columnKeyCreator, existingGroups, source2) {
      if (!defs) {
        return [];
      }
      const { colGroupSvc } = beans;
      const result2 = new Array(defs.length);
      for (let i2 = 0; i2 < result2.length; i2++) {
        const def = defs[i2];
        if (colGroupSvc && isColumnGroupDef(def)) {
          result2[i2] = colGroupSvc.createProvidedColumnGroup(
            primaryColumns,
            def,
            level,
            existingColsCopy,
            columnKeyCreator,
            existingGroups,
            source2
          );
        } else {
          result2[i2] = createColumn(beans, primaryColumns, def, existingColsCopy, columnKeyCreator, source2);
        }
      }
      return result2;
    }
    function createColumn(beans, primaryColumns, colDef, existingColsCopy, columnKeyCreator, source2) {
      const existingColAndIndex = findExistingColumn(colDef, existingColsCopy);
      if (existingColAndIndex) {
        existingColsCopy?.splice(existingColAndIndex.idx, 1);
      }
      let column2 = existingColAndIndex?.column;
      if (!column2) {
        const colId = columnKeyCreator.getUniqueKey(colDef.colId, colDef.field);
        const colDefMerged = _addColumnDefaultAndTypes(beans, colDef, colId);
        column2 = new AgColumn(colDefMerged, colDef, colId, primaryColumns);
        beans.context.createBean(column2);
      } else {
        const colDefMerged = _addColumnDefaultAndTypes(beans, colDef, column2.getColId());
        column2.setColDef(colDefMerged, colDef, source2);
        _updateColumnState(beans, column2, colDefMerged, source2);
      }
      beans.dataTypeSvc?.addColumnListeners(column2);
      return column2;
    }
    function updateSomeColumnState(beans, column2, hide2, sort2, sortIndex, pinned, flex2, source2) {
      const { sortSvc, pinnedCols, colFlex } = beans;
      if (hide2 !== void 0) {
        column2.setVisible(!hide2, source2);
      }
      if (sortSvc) {
        sortSvc.updateColSort(column2, sort2, source2);
        if (sortIndex !== void 0) {
          sortSvc.setColSortIndex(column2, sortIndex);
        }
      }
      if (pinned !== void 0) {
        pinnedCols?.setColPinned(column2, pinned);
      }
      if (flex2 !== void 0) {
        colFlex?.setColFlex(column2, flex2);
      }
    }
    function _updateColumnState(beans, column2, colDef, source2) {
      updateSomeColumnState(
        beans,
        column2,
        colDef.hide,
        colDef.sort,
        colDef.sortIndex,
        colDef.pinned,
        colDef.flex,
        source2
      );
      const colFlex = column2.getFlex();
      if (colFlex != null && colFlex > 0) {
        return;
      }
      if (colDef.width != null) {
        column2.setActualWidth(colDef.width, source2);
      } else {
        const widthBeforeUpdate = column2.getActualWidth();
        column2.setActualWidth(widthBeforeUpdate, source2);
      }
    }
    function findExistingColumn(newColDef, existingColsCopy) {
      if (!existingColsCopy) {
        return void 0;
      }
      for (let i2 = 0; i2 < existingColsCopy.length; i2++) {
        const def = existingColsCopy[i2].getUserProvidedColDef();
        if (!def) {
          continue;
        }
        const newHasId = newColDef.colId != null;
        if (newHasId) {
          if (existingColsCopy[i2].getId() === newColDef.colId) {
            return { idx: i2, column: existingColsCopy[i2] };
          }
          continue;
        }
        const newHasField = newColDef.field != null;
        if (newHasField) {
          if (def.field === newColDef.field) {
            return { idx: i2, column: existingColsCopy[i2] };
          }
          continue;
        }
        if (def === newColDef) {
          return { idx: i2, column: existingColsCopy[i2] };
        }
      }
      return void 0;
    }
    function _addColumnDefaultAndTypes(beans, colDef, colId, isAutoCol) {
      const { gos, dataTypeSvc } = beans;
      const res = {};
      const defaultColDef = gos.get("defaultColDef");
      _mergeDeep(res, defaultColDef, false, true);
      const columnType = updateColDefAndGetColumnType(beans, res, colDef, colId);
      if (columnType) {
        assignColumnTypes(beans, columnType, res);
      }
      const cellDataType = res.cellDataType;
      _mergeDeep(res, colDef, false, true);
      if (cellDataType !== void 0) {
        res.cellDataType = cellDataType;
      }
      const autoGroupColDef = gos.get("autoGroupColumnDef");
      const isSortingCoupled = _isColumnsSortingCoupledToGroup(gos);
      if (colDef.rowGroup && autoGroupColDef && isSortingCoupled) {
        _mergeDeep(
          res,
          { sort: autoGroupColDef.sort, initialSort: autoGroupColDef.initialSort },
          false,
          true
        );
      }
      if (dataTypeSvc) {
        dataTypeSvc.postProcess(res);
        dataTypeSvc.validateColDef(res);
      }
      gos.validateColDef(res, colId, isAutoCol);
      return res;
    }
    function updateColDefAndGetColumnType(beans, colDef, userColDef, colId) {
      const dataTypeDefinitionColumnType = beans.dataTypeSvc?.updateColDefAndGetColumnType(colDef, userColDef, colId);
      const columnTypes = userColDef.type ?? dataTypeDefinitionColumnType ?? colDef.type;
      colDef.type = columnTypes;
      return columnTypes ? convertColumnTypes(columnTypes) : void 0;
    }
    function assignColumnTypes(beans, typeKeys, colDefMerged) {
      if (!typeKeys.length) {
        return;
      }
      const allColumnTypes = Object.assign({}, DefaultColumnTypes);
      const userTypes = beans.gos.get("columnTypes") || {};
      for (const key2 of Object.keys(userTypes)) {
        const value2 = userTypes[key2];
        if (key2 in allColumnTypes) {
          _warn(34, { key: key2 });
        } else {
          const colType = value2;
          if (colType.type) {
            _warn(35);
          }
          allColumnTypes[key2] = value2;
        }
      }
      for (const t2 of typeKeys) {
        const typeColDef = allColumnTypes[t2.trim()];
        if (typeColDef) {
          _mergeDeep(colDefMerged, typeColDef, false, true);
        } else {
          _warn(36, { t: t2 });
        }
      }
    }
    function isColumnGroupDef(abstractColDef) {
      return abstractColDef.children !== void 0;
    }
    function depthFirstOriginalTreeSearch(parent, tree, callback) {
      if (!tree) {
        return;
      }
      for (let i2 = 0; i2 < tree.length; i2++) {
        const child = tree[i2];
        if (isProvidedColumnGroup(child)) {
          depthFirstOriginalTreeSearch(child, child.getChildren(), callback);
        }
        callback(child, parent);
      }
    }
    function placeLockedColumns(cols, gos) {
      const left2 = [];
      const normal2 = [];
      const right2 = [];
      cols.forEach((col) => {
        const position = col.getColDef().lockPosition;
        if (position === "right") {
          right2.push(col);
        } else if (position === "left" || position === true) {
          left2.push(col);
        } else {
          normal2.push(col);
        }
      });
      const isRtl = gos.get("enableRtl");
      if (isRtl) {
        return [...right2, ...normal2, ...left2];
      }
      return [...left2, ...normal2, ...right2];
    }
    function doesMovePassMarryChildren(allColumnsCopy, gridBalancedTree) {
      let rulePassed = true;
      depthFirstOriginalTreeSearch(null, gridBalancedTree, (child) => {
        if (!isProvidedColumnGroup(child)) {
          return;
        }
        const columnGroup = child;
        const colGroupDef = columnGroup.getColGroupDef();
        const marryChildren = colGroupDef?.marryChildren;
        if (!marryChildren) {
          return;
        }
        const newIndexes = [];
        for (const col of columnGroup.getLeafColumns()) {
          const newColIndex = allColumnsCopy.indexOf(col);
          newIndexes.push(newColIndex);
        }
        const maxIndex = Math.max.apply(Math, newIndexes);
        const minIndex = Math.min.apply(Math, newIndexes);
        const spread = maxIndex - minIndex;
        const maxSpread = columnGroup.getLeafColumns().length - 1;
        if (spread > maxSpread) {
          rulePassed = false;
        }
      });
      return rulePassed;
    }
    function getCommonValue(cols, valueGetter) {
      if (!cols || cols.length == 0) {
        return void 0;
      }
      const firstValue = valueGetter(cols[0]);
      for (let i2 = 1; i2 < cols.length; i2++) {
        if (firstValue !== valueGetter(cols[i2])) {
          return void 0;
        }
      }
      return firstValue;
    }
    function dispatchColumnPinnedEvent(eventSvc, changedColumns, source2) {
      if (!changedColumns.length) {
        return;
      }
      const column2 = changedColumns.length === 1 ? changedColumns[0] : null;
      const pinned = getCommonValue(changedColumns, (col) => col.getPinned());
      eventSvc.dispatchEvent({
        type: "columnPinned",
        // mistake in typing, 'undefined' should be allowed, as 'null' means 'not pinned'
        pinned: pinned != null ? pinned : null,
        columns: changedColumns,
        column: column2,
        source: source2
      });
    }
    function dispatchColumnVisibleEvent(eventSvc, changedColumns, source2) {
      if (!changedColumns.length) {
        return;
      }
      const column2 = changedColumns.length === 1 ? changedColumns[0] : null;
      const visible2 = getCommonValue(changedColumns, (col) => col.isVisible());
      eventSvc.dispatchEvent({
        type: "columnVisible",
        visible: visible2,
        columns: changedColumns,
        column: column2,
        source: source2
      });
    }
    function dispatchColumnChangedEvent(eventSvc, type, columns, source2) {
      eventSvc.dispatchEvent({
        type,
        columns,
        column: columns && columns.length == 1 ? columns[0] : null,
        source: source2
      });
    }
    function dispatchColumnResizedEvent(eventSvc, columns, finished, source2, flexColumns = null) {
      if (columns?.length) {
        eventSvc.dispatchEvent({
          type: "columnResized",
          columns,
          column: columns.length === 1 ? columns[0] : null,
          flexColumns,
          finished,
          source: source2
        });
      }
    }
    function _applyColumnState(beans, params, source2) {
      const {
        colModel,
        rowGroupColsSvc,
        pivotColsSvc,
        autoColSvc,
        selectionColSvc,
        colAnimation,
        visibleCols,
        pivotResultCols,
        environment,
        valueColsSvc,
        eventSvc,
        gos
      } = beans;
      const providedCols = colModel.getColDefCols() ?? [];
      const selectionCols = selectionColSvc?.getColumns();
      if (!providedCols.length && !selectionCols?.length) {
        return false;
      }
      if (params?.state && !params.state.forEach) {
        _warn(32);
        return false;
      }
      const syncColumnWithStateItem = (column2, stateItem, rowGroupIndexes, pivotIndexes, autoCol) => {
        if (!column2) {
          return;
        }
        const getValue = getValueFactory(stateItem, params.defaultState);
        const flex2 = getValue("flex").value1;
        updateSomeColumnState(
          beans,
          column2,
          getValue("hide").value1,
          getValue("sort").value1,
          getValue("sortIndex").value1,
          getValue("pinned").value1,
          flex2,
          source2
        );
        if (flex2 == null) {
          const width = getValue("width").value1;
          if (width != null) {
            const minColWidth = column2.getColDef().minWidth ?? environment.getDefaultColumnMinWidth();
            if (minColWidth != null && width >= minColWidth) {
              column2.setActualWidth(width, source2);
            }
          }
        }
        if (autoCol || !column2.isPrimary()) {
          return;
        }
        valueColsSvc?.syncColumnWithState(column2, source2, getValue);
        rowGroupColsSvc?.syncColumnWithState(column2, source2, getValue, rowGroupIndexes);
        pivotColsSvc?.syncColumnWithState(column2, source2, getValue, pivotIndexes);
      };
      const applyStates = (states, existingColumns, getById2) => {
        const dispatchEventsFunc = _compareColumnStatesAndDispatchEvents(beans, source2);
        const columnsWithNoState = existingColumns.slice();
        const rowGroupIndexes = {};
        const pivotIndexes = {};
        const autoColStates = [];
        const selectionColStates = [];
        const unmatchedAndAutoStates2 = [];
        let unmatchedCount2 = 0;
        const previousRowGroupCols = rowGroupColsSvc?.columns.slice() ?? [];
        const previousPivotCols = pivotColsSvc?.columns.slice() ?? [];
        for (const state of states) {
          const colId = state.colId;
          const isAutoGroupColumn = colId.startsWith(GROUP_AUTO_COLUMN_ID);
          if (isAutoGroupColumn) {
            autoColStates.push(state);
            unmatchedAndAutoStates2.push(state);
            continue;
          }
          if (isColumnSelectionCol(colId)) {
            selectionColStates.push(state);
            unmatchedAndAutoStates2.push(state);
            continue;
          }
          const column2 = getById2(colId);
          if (!column2) {
            unmatchedAndAutoStates2.push(state);
            unmatchedCount2 += 1;
          } else {
            syncColumnWithStateItem(column2, state, rowGroupIndexes, pivotIndexes, false);
            _removeFromArray(columnsWithNoState, column2);
          }
        }
        const applyDefaultsFunc = (col) => syncColumnWithStateItem(col, null, rowGroupIndexes, pivotIndexes, false);
        columnsWithNoState.forEach(applyDefaultsFunc);
        rowGroupColsSvc?.sortColumns(comparatorByIndex.bind(rowGroupColsSvc, rowGroupIndexes, previousRowGroupCols));
        pivotColsSvc?.sortColumns(comparatorByIndex.bind(pivotColsSvc, pivotIndexes, previousPivotCols));
        colModel.refreshCols(false, source2);
        const syncColStates = (getCol, colStates, columns = []) => {
          for (const stateItem of colStates) {
            const col = getCol(stateItem.colId);
            _removeFromArray(columns, col);
            syncColumnWithStateItem(col, stateItem, null, null, true);
          }
          columns.forEach(applyDefaultsFunc);
        };
        syncColStates(
          (colId) => autoColSvc?.getColumn(colId) ?? null,
          autoColStates,
          autoColSvc?.getColumns()?.slice()
        );
        syncColStates(
          (colId) => selectionColSvc?.getColumn(colId) ?? null,
          selectionColStates,
          selectionColSvc?.getColumns()?.slice()
        );
        orderLiveColsLikeState(params, colModel, gos);
        visibleCols.refresh(source2);
        eventSvc.dispatchEvent({
          type: "columnEverythingChanged",
          source: source2
        });
        dispatchEventsFunc();
        return { unmatchedAndAutoStates: unmatchedAndAutoStates2, unmatchedCount: unmatchedCount2 };
      };
      colAnimation?.start();
      let { unmatchedAndAutoStates, unmatchedCount } = applyStates(
        params.state || [],
        providedCols,
        (id) => colModel.getColDefCol(id)
      );
      if (unmatchedAndAutoStates.length > 0 || _exists(params.defaultState)) {
        const pivotResultColsList = pivotResultCols?.getPivotResultCols()?.list ?? [];
        unmatchedCount = applyStates(
          unmatchedAndAutoStates,
          pivotResultColsList,
          (id) => pivotResultCols?.getPivotResultCol(id) ?? null
        ).unmatchedCount;
      }
      colAnimation?.finish();
      return unmatchedCount === 0;
    }
    function _resetColumnState(beans, source2) {
      const { colModel, autoColSvc, selectionColSvc, eventSvc, gos } = beans;
      const primaryCols = colModel.getColDefCols();
      if (!primaryCols?.length) {
        return;
      }
      const primaryColumnTree = colModel.getColDefColTree();
      const primaryColumns = _getColumnsFromTree(primaryColumnTree);
      const columnStates = [];
      let letRowGroupIndex = 1e3;
      let letPivotIndex = 1e3;
      const addColState = (col) => {
        const stateItem = getColumnStateFromColDef(col);
        if (_missing(stateItem.rowGroupIndex) && stateItem.rowGroup) {
          stateItem.rowGroupIndex = letRowGroupIndex++;
        }
        if (_missing(stateItem.pivotIndex) && stateItem.pivot) {
          stateItem.pivotIndex = letPivotIndex++;
        }
        columnStates.push(stateItem);
      };
      autoColSvc?.getColumns()?.forEach(addColState);
      selectionColSvc?.getColumns()?.forEach(addColState);
      primaryColumns?.forEach(addColState);
      _applyColumnState(beans, { state: columnStates }, source2);
      const autoCols = autoColSvc?.getColumns() ?? [];
      const selectionCols = selectionColSvc?.getColumns() ?? [];
      const orderedCols = [...selectionCols, ...autoCols, ...primaryCols];
      const orderedColState = orderedCols.map((col) => ({ colId: col.colId }));
      _applyColumnState(beans, { state: orderedColState, applyOrder: true }, source2);
      eventSvc.dispatchEvent(_addGridCommonParams(gos, { type: "columnsReset", source: source2 }));
    }
    function _compareColumnStatesAndDispatchEvents(beans, source2) {
      const { rowGroupColsSvc, pivotColsSvc, valueColsSvc, colModel, sortSvc, eventSvc } = beans;
      const startState = {
        rowGroupColumns: rowGroupColsSvc?.columns.slice() ?? [],
        pivotColumns: pivotColsSvc?.columns.slice() ?? [],
        valueColumns: valueColsSvc?.columns.slice() ?? []
      };
      const columnStateBefore = _getColumnState(beans);
      const columnStateBeforeMap = {};
      for (const col of columnStateBefore) {
        columnStateBeforeMap[col.colId] = col;
      }
      return () => {
        const dispatchWhenListsDifferent = (eventType, colsBefore, colsAfter, idMapper) => {
          const beforeList = colsBefore.map(idMapper);
          const afterList = colsAfter.map(idMapper);
          const unchanged2 = _areEqual(beforeList, afterList);
          if (unchanged2) {
            return;
          }
          const changes = new Set(colsBefore);
          for (const id of colsAfter) {
            if (!changes.delete(id)) {
              changes.add(id);
            }
          }
          const changesArr = [...changes];
          eventSvc.dispatchEvent({
            type: eventType,
            columns: changesArr,
            column: changesArr.length === 1 ? changesArr[0] : null,
            source: source2
          });
        };
        const getChangedColumns = (changedPredicate) => {
          const changedColumns2 = [];
          colModel.forAllCols((column2) => {
            const colStateBefore = columnStateBeforeMap[column2.getColId()];
            if (colStateBefore && changedPredicate(colStateBefore, column2)) {
              changedColumns2.push(column2);
            }
          });
          return changedColumns2;
        };
        const columnIdMapper = (c2) => c2.getColId();
        dispatchWhenListsDifferent(
          "columnRowGroupChanged",
          startState.rowGroupColumns,
          rowGroupColsSvc?.columns ?? [],
          columnIdMapper
        );
        dispatchWhenListsDifferent(
          "columnPivotChanged",
          startState.pivotColumns,
          pivotColsSvc?.columns ?? [],
          columnIdMapper
        );
        const valueChangePredicate = (cs, c2) => {
          const oldActive = cs.aggFunc != null;
          const activeChanged = oldActive != c2.isValueActive();
          const aggFuncChanged = oldActive && cs.aggFunc != c2.getAggFunc();
          return activeChanged || aggFuncChanged;
        };
        const changedValues = getChangedColumns(valueChangePredicate);
        if (changedValues.length > 0) {
          dispatchColumnChangedEvent(eventSvc, "columnValueChanged", changedValues, source2);
        }
        const resizeChangePredicate = (cs, c2) => cs.width != c2.getActualWidth();
        dispatchColumnResizedEvent(eventSvc, getChangedColumns(resizeChangePredicate), true, source2);
        const pinnedChangePredicate = (cs, c2) => cs.pinned != c2.getPinned();
        dispatchColumnPinnedEvent(eventSvc, getChangedColumns(pinnedChangePredicate), source2);
        const visibilityChangePredicate = (cs, c2) => cs.hide == c2.isVisible();
        dispatchColumnVisibleEvent(eventSvc, getChangedColumns(visibilityChangePredicate), source2);
        const sortChangePredicate = (cs, c2) => cs.sort != c2.getSort() || cs.sortIndex != c2.getSortIndex();
        const changedColumns = getChangedColumns(sortChangePredicate);
        if (changedColumns.length > 0) {
          sortSvc?.dispatchSortChangedEvents(source2, changedColumns);
        }
        const colStateAfter = _getColumnState(beans);
        normaliseColumnMovedEventForColumnState(columnStateBefore, colStateAfter, source2, colModel, eventSvc);
      };
    }
    function _getColumnState(beans) {
      const { colModel, rowGroupColsSvc, pivotColsSvc } = beans;
      const primaryCols = colModel.getColDefCols();
      if (_missing(primaryCols) || !colModel.isAlive()) {
        return [];
      }
      const rowGroupColumns = rowGroupColsSvc?.columns;
      const pivotColumns = pivotColsSvc?.columns;
      const res = [];
      const createStateItemFromColumn = (column2) => {
        const rowGroupIndex = column2.isRowGroupActive() && rowGroupColumns ? rowGroupColumns.indexOf(column2) : null;
        const pivotIndex = column2.isPivotActive() && pivotColumns ? pivotColumns.indexOf(column2) : null;
        const aggFunc = column2.isValueActive() ? column2.getAggFunc() : null;
        const sort2 = column2.getSort() != null ? column2.getSort() : null;
        const sortIndex = column2.getSortIndex() != null ? column2.getSortIndex() : null;
        res.push({
          colId: column2.getColId(),
          width: column2.getActualWidth(),
          hide: !column2.isVisible(),
          pinned: column2.getPinned(),
          sort: sort2,
          sortIndex,
          aggFunc,
          rowGroup: column2.isRowGroupActive(),
          rowGroupIndex,
          pivot: column2.isPivotActive(),
          pivotIndex,
          flex: column2.getFlex() ?? null
        });
      };
      colModel.forAllCols((col) => createStateItemFromColumn(col));
      const colIdToGridIndexMap = new Map(
        colModel.getCols().map((col, index) => [col.getColId(), index])
      );
      res.sort((itemA, itemB) => {
        const posA = colIdToGridIndexMap.has(itemA.colId) ? colIdToGridIndexMap.get(itemA.colId) : -1;
        const posB = colIdToGridIndexMap.has(itemB.colId) ? colIdToGridIndexMap.get(itemB.colId) : -1;
        return posA - posB;
      });
      return res;
    }
    function getColumnStateFromColDef(column2) {
      const getValueOrNull = (a, b) => a != null ? a : b != null ? b : null;
      const colDef = column2.getColDef();
      const sort2 = getValueOrNull(colDef.sort, colDef.initialSort);
      const sortIndex = getValueOrNull(colDef.sortIndex, colDef.initialSortIndex);
      const hide2 = getValueOrNull(colDef.hide, colDef.initialHide);
      const pinned = getValueOrNull(colDef.pinned, colDef.initialPinned);
      const width = getValueOrNull(colDef.width, colDef.initialWidth);
      const flex2 = getValueOrNull(colDef.flex, colDef.initialFlex);
      let rowGroupIndex = getValueOrNull(colDef.rowGroupIndex, colDef.initialRowGroupIndex);
      let rowGroup = getValueOrNull(colDef.rowGroup, colDef.initialRowGroup);
      if (rowGroupIndex == null && !rowGroup) {
        rowGroupIndex = null;
        rowGroup = null;
      }
      let pivotIndex = getValueOrNull(colDef.pivotIndex, colDef.initialPivotIndex);
      let pivot = getValueOrNull(colDef.pivot, colDef.initialPivot);
      if (pivotIndex == null && !pivot) {
        pivotIndex = null;
        pivot = null;
      }
      const aggFunc = getValueOrNull(colDef.aggFunc, colDef.initialAggFunc);
      return {
        colId: column2.getColId(),
        sort: sort2,
        sortIndex,
        hide: hide2,
        pinned,
        width,
        flex: flex2,
        rowGroup,
        rowGroupIndex,
        pivot,
        pivotIndex,
        aggFunc
      };
    }
    function orderLiveColsLikeState(params, colModel, gos) {
      if (!params.applyOrder || !params.state) {
        return;
      }
      const colIds = [];
      for (const item2 of params.state) {
        if (item2.colId != null) {
          colIds.push(item2.colId);
        }
      }
      sortColsLikeKeys(colModel.cols, colIds, colModel, gos);
    }
    function sortColsLikeKeys(cols, colIds, colModel, gos) {
      if (cols == null) {
        return;
      }
      let newOrder = [];
      const processedColIds = {};
      for (const colId of colIds) {
        if (processedColIds[colId]) {
          continue;
        }
        const col = cols.map[colId];
        if (col) {
          newOrder.push(col);
          processedColIds[colId] = true;
        }
      }
      let autoGroupInsertIndex = 0;
      for (const col of cols.list) {
        const colId = col.getColId();
        const alreadyProcessed = processedColIds[colId] != null;
        if (alreadyProcessed) {
          continue;
        }
        const isAutoGroupCol = colId.startsWith(GROUP_AUTO_COLUMN_ID);
        if (isAutoGroupCol) {
          newOrder.splice(autoGroupInsertIndex++, 0, col);
        } else {
          newOrder.push(col);
        }
      }
      newOrder = placeLockedColumns(newOrder, gos);
      if (!doesMovePassMarryChildren(newOrder, colModel.getColTree())) {
        _warn(39);
        return;
      }
      cols.list = newOrder;
    }
    function normaliseColumnMovedEventForColumnState(colStateBefore, colStateAfter, source2, colModel, eventSvc) {
      const colStateAfterMapped = {};
      for (const s of colStateAfter) {
        colStateAfterMapped[s.colId] = s;
      }
      const colsIntersectIds = {};
      for (const s of colStateBefore) {
        if (colStateAfterMapped[s.colId]) {
          colsIntersectIds[s.colId] = true;
        }
      }
      const beforeFiltered = colStateBefore.filter((c2) => colsIntersectIds[c2.colId]);
      const afterFiltered = colStateAfter.filter((c2) => colsIntersectIds[c2.colId]);
      const movedColumns = [];
      afterFiltered.forEach((csAfter, index) => {
        const csBefore = beforeFiltered?.[index];
        if (csBefore && csBefore.colId !== csAfter.colId) {
          const gridCol = colModel.getCol(csBefore.colId);
          if (gridCol) {
            movedColumns.push(gridCol);
          }
        }
      });
      if (!movedColumns.length) {
        return;
      }
      eventSvc.dispatchEvent({
        type: "columnMoved",
        columns: movedColumns,
        column: movedColumns.length === 1 ? movedColumns[0] : null,
        finished: true,
        source: source2
      });
    }
    var comparatorByIndex = (indexes, oldList, colA, colB) => {
      const indexA = indexes[colA.getId()];
      const indexB = indexes[colB.getId()];
      const aHasIndex = indexA != null;
      const bHasIndex = indexB != null;
      if (aHasIndex && bHasIndex) {
        return indexA - indexB;
      }
      if (aHasIndex) {
        return -1;
      }
      if (bHasIndex) {
        return 1;
      }
      const oldIndexA = oldList.indexOf(colA);
      const oldIndexB = oldList.indexOf(colB);
      const aHasOldIndex = oldIndexA >= 0;
      const bHasOldIndex = oldIndexB >= 0;
      if (aHasOldIndex && bHasOldIndex) {
        return oldIndexA - oldIndexB;
      }
      if (aHasOldIndex) {
        return -1;
      }
      return 1;
    };
    var ColumnModel = class extends BeanStub {
      constructor() {
        super(...arguments);
        this.beanName = "colModel";
        this.pivotMode = false;
        this.ready = false;
        this.changeEventsDispatching = false;
      }
      postConstruct() {
        this.pivotMode = this.gos.get("pivotMode");
        this.addManagedPropertyListeners(
          [
            "groupDisplayType",
            "treeData",
            "treeDataDisplayType",
            "groupHideOpenParents",
            "rowNumbers",
            "hidePaddedHeaderRows"
          ],
          (event) => this.refreshAll(_convertColumnEventSourceType(event.source))
        );
        this.addManagedPropertyListeners(
          ["defaultColDef", "defaultColGroupDef", "columnTypes", "suppressFieldDotNotation"],
          this.recreateColumnDefs.bind(this)
        );
        this.addManagedPropertyListener(
          "pivotMode",
          (event) => this.setPivotMode(this.gos.get("pivotMode"), _convertColumnEventSourceType(event.source))
        );
      }
      // called from SyncService, when grid has finished initialising
      createColsFromColDefs(source2) {
        const { beans } = this;
        const {
          valueCache,
          colAutosize,
          rowGroupColsSvc,
          pivotColsSvc,
          valueColsSvc,
          visibleCols,
          eventSvc,
          groupHierarchyColSvc
        } = beans;
        const dispatchEventsFunc = this.colDefs ? _compareColumnStatesAndDispatchEvents(beans, source2) : void 0;
        valueCache?.expire();
        const oldCols = this.colDefCols?.list;
        const oldTree = this.colDefCols?.tree;
        const newTree = _createColumnTree(beans, this.colDefs, true, oldTree, source2);
        _destroyColumnTree(beans, this.colDefCols?.tree, newTree.columnTree);
        const tree = newTree.columnTree;
        const treeDepth = newTree.treeDepth;
        const list2 = _getColumnsFromTree(tree);
        const map2 = {};
        for (const col of list2) {
          map2[col.getId()] = col;
        }
        this.colDefCols = { tree, treeDepth, list: list2, map: map2 };
        this.createColumnsForService([groupHierarchyColSvc], this.colDefCols, source2);
        rowGroupColsSvc?.extractCols(source2, oldCols);
        pivotColsSvc?.extractCols(source2, oldCols);
        valueColsSvc?.extractCols(source2, oldCols);
        this.ready = true;
        this.refreshCols(true, source2);
        visibleCols.refresh(source2);
        eventSvc.dispatchEvent({
          type: "columnEverythingChanged",
          source: source2
        });
        if (dispatchEventsFunc) {
          this.changeEventsDispatching = true;
          dispatchEventsFunc();
          this.changeEventsDispatching = false;
        }
        eventSvc.dispatchEvent({
          type: "newColumnsLoaded",
          source: source2
        });
        if (source2 === "gridInitializing") {
          colAutosize?.applyAutosizeStrategy();
        }
      }
      // called from: buildAutoGroupColumns (events 'groupDisplayType', 'treeData', 'treeDataDisplayType', 'groupHideOpenParents')
      // createColsFromColDefs (recreateColumnDefs, setColumnsDefs),
      // setPivotMode, applyColumnState,
      // functionColsService.setPrimaryColList, functionColsService.updatePrimaryColList,
      // pivotResultCols.setPivotResultCols
      refreshCols(newColDefs, source2) {
        if (!this.colDefCols) {
          return;
        }
        const prevColTree = this.cols?.tree;
        this.saveColOrder();
        const {
          autoColSvc,
          selectionColSvc,
          rowNumbersSvc,
          quickFilter,
          pivotResultCols,
          showRowGroupCols,
          rowAutoHeight,
          visibleCols,
          colViewport,
          eventSvc
        } = this.beans;
        const cols = this.selectCols(pivotResultCols, this.colDefCols);
        this.createColumnsForService([autoColSvc, selectionColSvc, rowNumbersSvc], cols, source2);
        const shouldSortNewColDefs = _shouldMaintainColumnOrder(this.gos, this.showingPivotResult);
        if (!newColDefs || shouldSortNewColDefs) {
          this.restoreColOrder(cols);
        }
        this.positionLockedCols(cols);
        showRowGroupCols?.refresh();
        quickFilter?.refreshCols();
        this.setColSpanActive();
        rowAutoHeight?.setAutoHeightActive(cols);
        visibleCols.clear();
        colViewport.clear();
        const dispatchChangedEvent = !_areEqual(prevColTree, this.cols.tree);
        if (dispatchChangedEvent) {
          eventSvc.dispatchEvent({
            type: "gridColumnsChanged"
          });
        }
      }
      createColumnsForService(services, cols, source2) {
        for (const service of services) {
          if (!service) {
            continue;
          }
          service.createColumns(
            cols,
            (updateOrder) => {
              this.lastOrder = updateOrder(this.lastOrder);
              this.lastPivotOrder = updateOrder(this.lastPivotOrder);
            },
            source2
          );
          service.addColumns(cols);
        }
      }
      selectCols(pivotResultColsSvc, colDefCols) {
        const pivotResultCols = pivotResultColsSvc?.getPivotResultCols() ?? null;
        this.showingPivotResult = pivotResultCols != null;
        const { map: map2, list: list2, tree, treeDepth } = pivotResultCols ?? colDefCols;
        this.cols = {
          list: list2.slice(),
          map: { ...map2 },
          tree: tree.slice(),
          treeDepth
        };
        if (pivotResultCols) {
          const hasSameColumns = pivotResultCols.list.some((col) => this.cols?.map[col.getColId()] !== void 0);
          if (!hasSameColumns) {
            this.lastPivotOrder = null;
          }
        }
        return this.cols;
      }
      getColsToShow() {
        if (!this.cols) {
          return [];
        }
        const { valueColsSvc, selectionColSvc, gos } = this.beans;
        const showAutoGroupAndValuesOnly = this.isPivotMode() && !this.showingPivotResult;
        const showSelectionColumn = selectionColSvc?.isSelectionColumnEnabled();
        const showRowNumbers = gos.get("rowNumbers");
        const valueColumns = valueColsSvc?.columns;
        const res = this.cols.list.filter((col) => {
          const isAutoGroupCol = isColumnGroupAutoCol(col);
          if (showAutoGroupAndValuesOnly) {
            const isValueCol = valueColumns?.includes(col);
            return isAutoGroupCol || isValueCol || showSelectionColumn && isColumnSelectionCol(col) || showRowNumbers && isRowNumberCol(col);
          } else {
            return isAutoGroupCol || col.isVisible();
          }
        });
        return res;
      }
      // on events 'groupDisplayType', 'treeData', 'treeDataDisplayType', 'groupHideOpenParents'
      refreshAll(source2) {
        if (!this.ready) {
          return;
        }
        this.refreshCols(false, source2);
        this.beans.visibleCols.refresh(source2);
      }
      setColsVisible(keys, visible2 = false, source2) {
        _applyColumnState(
          this.beans,
          {
            state: keys.map((key2) => ({
              colId: typeof key2 === "string" ? key2 : key2.getColId(),
              hide: !visible2
            }))
          },
          source2
        );
      }
      /**
       * Restores provided columns order to the previous order in this.lastPivotOrder / this.lastOrder
       * If columns are not in the last order:
       *  - Check column groups, and apply column after the last column in the lowest shared group
       *  - If no sibling is found, apply the column at the end of the cols
       */
      restoreColOrder(cols) {
        const lastOrder = this.showingPivotResult ? this.lastPivotOrder : this.lastOrder;
        if (!lastOrder) {
          return;
        }
        const preservedOrder = lastOrder.filter((col) => cols.map[col.getId()] != null);
        if (preservedOrder.length === 0) {
          return;
        }
        if (preservedOrder.length === cols.list.length) {
          cols.list = preservedOrder;
          return;
        }
        const hasSiblings = (col) => {
          const ancestor = col.getOriginalParent();
          if (!ancestor) {
            return false;
          }
          const children2 = ancestor.getChildren();
          if (children2.length > 1) {
            return true;
          }
          return hasSiblings(ancestor);
        };
        if (!preservedOrder.some((col) => hasSiblings(col))) {
          const preservedOrderSet = new Set(preservedOrder);
          for (const col of cols.list) {
            if (!preservedOrderSet.has(col)) {
              preservedOrder.push(col);
            }
          }
          cols.list = preservedOrder;
          return;
        }
        const colPositionMap = /* @__PURE__ */ new Map();
        for (let i2 = 0; i2 < preservedOrder.length; i2++) {
          const col = preservedOrder[i2];
          colPositionMap.set(col, i2);
        }
        const additionalCols = cols.list.filter((col) => !colPositionMap.has(col));
        if (additionalCols.length === 0) {
          cols.list = preservedOrder;
          return;
        }
        const getPreviousSibling = (col, group) => {
          const parent = group ? group.getOriginalParent() : col.getOriginalParent();
          if (!parent) {
            return null;
          }
          let highestIdx = null;
          let highestSibling = null;
          for (const child of parent.getChildren()) {
            if (child === group || child === col) {
              continue;
            }
            if (child instanceof AgColumn) {
              const colIdx = colPositionMap.get(child);
              if (colIdx == null) {
                continue;
              }
              if (highestIdx == null || highestIdx < colIdx) {
                highestIdx = colIdx;
                highestSibling = child;
              }
              continue;
            }
            child.forEachLeafColumn((leafCol) => {
              const colIdx = colPositionMap.get(leafCol);
              if (colIdx == null) {
                return;
              }
              if (highestIdx == null || highestIdx < colIdx) {
                highestIdx = colIdx;
                highestSibling = leafCol;
              }
            });
          }
          if (highestSibling == null) {
            return getPreviousSibling(col, parent);
          }
          return highestSibling;
        };
        const noSiblingsAvailable = [];
        const previousSiblingPosMap = /* @__PURE__ */ new Map();
        for (const col of additionalCols) {
          const prevSiblingIdx = getPreviousSibling(col, null);
          if (prevSiblingIdx == null) {
            noSiblingsAvailable.push(col);
            continue;
          }
          const prev = previousSiblingPosMap.get(prevSiblingIdx);
          if (prev === void 0) {
            previousSiblingPosMap.set(prevSiblingIdx, col);
          } else if (Array.isArray(prev)) {
            prev.push(col);
          } else {
            previousSiblingPosMap.set(prevSiblingIdx, [prev, col]);
          }
        }
        const result2 = new Array(cols.list.length);
        let resultPointer = result2.length - 1;
        for (let i2 = noSiblingsAvailable.length - 1; i2 >= 0; i2--) {
          result2[resultPointer--] = noSiblingsAvailable[i2];
        }
        for (let i2 = preservedOrder.length - 1; i2 >= 0; i2--) {
          const nextCol = preservedOrder[i2];
          const extraCols = previousSiblingPosMap.get(nextCol);
          if (extraCols) {
            if (Array.isArray(extraCols)) {
              for (let x2 = extraCols.length - 1; x2 >= 0; x2--) {
                const col = extraCols[x2];
                result2[resultPointer--] = col;
              }
            } else {
              result2[resultPointer--] = extraCols;
            }
          }
          result2[resultPointer--] = nextCol;
        }
        cols.list = result2;
      }
      positionLockedCols(cols) {
        cols.list = placeLockedColumns(cols.list, this.gos);
      }
      saveColOrder() {
        if (this.showingPivotResult) {
          this.lastPivotOrder = this.cols?.list ?? null;
        } else {
          this.lastOrder = this.cols?.list ?? null;
        }
      }
      getColumnDefs(sorted) {
        return this.colDefCols && this.beans.colDefFactory?.getColumnDefs(
          this.colDefCols.list,
          this.showingPivotResult,
          this.lastOrder,
          this.cols?.list ?? [],
          sorted
        );
      }
      setColSpanActive() {
        this.colSpanActive = !!this.cols?.list.some((col) => col.getColDef().colSpan != null);
      }
      isPivotMode() {
        return this.pivotMode;
      }
      setPivotMode(pivotMode, source2) {
        if (pivotMode === this.pivotMode) {
          return;
        }
        this.pivotMode = pivotMode;
        if (!this.ready) {
          return;
        }
        this.refreshCols(false, source2);
        const { visibleCols, eventSvc } = this.beans;
        visibleCols.refresh(source2);
        eventSvc.dispatchEvent({
          type: "columnPivotModeChanged"
        });
      }
      // + clientSideRowModel
      isPivotActive() {
        const pivotColumns = this.beans.pivotColsSvc?.columns;
        return this.pivotMode && !!pivotColumns?.length;
      }
      // called when dataTypes change
      recreateColumnDefs(e) {
        if (!this.cols) {
          return;
        }
        this.beans.autoColSvc?.updateColumns(e);
        const source2 = _convertColumnEventSourceType(e.source);
        this.createColsFromColDefs(source2);
      }
      setColumnDefs(columnDefs, source2) {
        this.colDefs = columnDefs;
        this.createColsFromColDefs(source2);
      }
      destroy() {
        _destroyColumnTree(this.beans, this.colDefCols?.tree);
        super.destroy();
      }
      getColTree() {
        return this.cols?.tree ?? [];
      }
      // + columnSelectPanel
      getColDefColTree() {
        return this.colDefCols?.tree ?? [];
      }
      // + clientSideRowController -> sorting, building quick filter text
      // + headerRenderer -> sorting (clearing icon)
      getColDefCols() {
        return this.colDefCols?.list ?? null;
      }
      // + moveColumnController
      getCols() {
        return this.cols?.list ?? [];
      }
      forAllCols(callback) {
        const { pivotResultCols, autoColSvc, selectionColSvc, groupHierarchyColSvc } = this.beans;
        _forAll(this.colDefCols?.list, callback);
        _forAll(autoColSvc?.columns?.list, callback);
        _forAll(selectionColSvc?.columns?.list, callback);
        _forAll(groupHierarchyColSvc?.columns?.list, callback);
        _forAll(pivotResultCols?.getPivotResultCols()?.list, callback);
      }
      getColsForKeys(keys) {
        if (!keys) {
          return [];
        }
        return keys.map((key2) => this.getCol(key2)).filter((col) => col != null);
      }
      getColDefCol(key2) {
        if (!this.colDefCols?.list) {
          return null;
        }
        return this.getColFromCollection(key2, this.colDefCols);
      }
      getCol(key2) {
        if (key2 == null) {
          return null;
        }
        return this.getColFromCollection(key2, this.cols);
      }
      /**
       * Get column exclusively by ID.
       *
       * Note getCol/getColFromCollection have poor performance when col has been removed.
       */
      getColById(key2) {
        return this.cols?.map[key2] ?? null;
      }
      getColFromCollection(key2, cols) {
        if (cols == null) {
          return null;
        }
        const { map: map2, list: list2 } = cols;
        if (typeof key2 == "string" && map2[key2]) {
          return map2[key2];
        }
        for (let i2 = 0; i2 < list2.length; i2++) {
          if (_columnsMatch(list2[i2], key2)) {
            return list2[i2];
          }
        }
        const { autoColSvc, selectionColSvc, groupHierarchyColSvc } = this.beans;
        return autoColSvc?.getColumn(key2) ?? selectionColSvc?.getColumn(key2) ?? groupHierarchyColSvc?.getColumn(key2) ?? null;
      }
    };
    var GroupInstanceIdCreator = class {
      constructor() {
        this.existingIds = {};
      }
      getInstanceIdForKey(key2) {
        const lastResult = this.existingIds[key2];
        let result2;
        if (typeof lastResult !== "number") {
          result2 = 0;
        } else {
          result2 = lastResult + 1;
        }
        this.existingIds[key2] = result2;
        return result2;
      }
    };
    var EmptyBean = class extends BeanStub {
    };
    function setupCompBean(ctrl, ctx, compBean) {
      if (compBean) {
        ctrl.addDestroyFunc(() => ctx.destroyBean(compBean));
      }
      return compBean ?? ctrl;
    }
    var RefPlaceholder = null;
    function _isComponent(item2) {
      return typeof item2?.getGui === "function";
    }
    var CssClassManager = class {
      constructor(getGui) {
        this.cssClassStates = {};
        this.getGui = getGui;
      }
      toggleCss(className2, addOrRemove) {
        if (!className2) {
          return;
        }
        if (className2.indexOf(" ") >= 0) {
          const list2 = (className2 || "").split(" ");
          if (list2.length > 1) {
            for (const cls of list2) {
              this.toggleCss(cls, addOrRemove);
            }
            return;
          }
        }
        const updateNeeded = this.cssClassStates[className2] !== addOrRemove;
        if (updateNeeded && className2.length) {
          this.getGui()?.classList.toggle(className2, addOrRemove);
          this.cssClassStates[className2] = addOrRemove;
        }
      }
    };
    var compIdSequence = 0;
    var AgComponentStub = class extends AgBeanStub {
      constructor(templateOrParams, componentSelectors) {
        super();
        this.suppressDataRefValidation = false;
        this.displayed = true;
        this.visible = true;
        this.compId = compIdSequence++;
        this.cssManager = new CssClassManager(() => this.eGui);
        this.componentSelectors = new Map((componentSelectors ?? []).map((comp2) => [comp2.selector, comp2]));
        if (templateOrParams) {
          this.setTemplate(templateOrParams);
        }
      }
      preConstruct() {
        this.wireTemplate(this.getGui());
        const debugId = "component-" + Object.getPrototypeOf(this)?.constructor?.name;
        for (const css2 of this.css ?? []) {
          this.beans.environment.addGlobalCSS(css2, debugId);
        }
      }
      wireTemplate(element, paramsMap) {
        if (element && this.gos) {
          this.applyElementsToComponent(element);
          this.createChildComponentsFromTags(element, paramsMap);
        }
      }
      getCompId() {
        return this.compId;
      }
      getDataRefAttribute(element) {
        if (element.getAttribute) {
          return element.getAttribute(DataRefAttribute);
        }
        return null;
      }
      applyElementsToComponent(element, elementRef, paramsMap, newComponent = null) {
        if (elementRef === void 0) {
          elementRef = this.getDataRefAttribute(element);
        }
        if (elementRef) {
          const current2 = this[elementRef];
          if (current2 === RefPlaceholder) {
            this[elementRef] = newComponent ?? element;
          } else {
            const usedAsParamRef = paramsMap?.[elementRef];
            if (!this.suppressDataRefValidation && !usedAsParamRef) {
              throw new Error(`data-ref: ${elementRef} on ${this.constructor.name} with ${current2}`);
            }
          }
        }
      }
      // for registered components only, eg creates AgCheckbox instance from ag-checkbox HTML tag
      createChildComponentsFromTags(parentNode, paramsMap) {
        const childNodeList = [];
        for (const childNode of parentNode.childNodes ?? []) {
          childNodeList.push(childNode);
        }
        for (const childNode of childNodeList) {
          if (!(childNode instanceof HTMLElement)) {
            continue;
          }
          const childComp = this.createComponentFromElement(
            childNode,
            (childComp2) => {
              const childGui = childComp2.getGui();
              if (childGui) {
                for (const attr of childNode.attributes ?? []) {
                  childGui.setAttribute(attr.name, attr.value);
                }
              }
            },
            paramsMap
          );
          if (childComp) {
            if (childComp.addItems && childNode.children.length) {
              this.createChildComponentsFromTags(childNode, paramsMap);
              const items = Array.prototype.slice.call(childNode.children);
              childComp.addItems(items);
            }
            this.swapComponentForNode(childComp, parentNode, childNode);
          } else if (childNode.childNodes) {
            this.createChildComponentsFromTags(childNode, paramsMap);
          }
        }
      }
      createComponentFromElement(element, afterPreCreateCallback, paramsMap) {
        const key2 = element.nodeName;
        const elementRef = this.getDataRefAttribute(element);
        const isAgGridComponent = key2.indexOf("AG-") === 0;
        const componentSelector = isAgGridComponent ? this.componentSelectors.get(key2) : null;
        let newComponent = null;
        if (componentSelector) {
          const componentParams = paramsMap && elementRef ? paramsMap[elementRef] : void 0;
          newComponent = new componentSelector.component(componentParams);
          newComponent.setParentComponent(
            this
          );
          this.createBean(newComponent, null, afterPreCreateCallback);
        } else if (isAgGridComponent) {
          throw new Error(`selector: ${key2}`);
        }
        this.applyElementsToComponent(element, elementRef, paramsMap, newComponent);
        return newComponent;
      }
      swapComponentForNode(newComponent, parentNode, childNode) {
        const eComponent = newComponent.getGui();
        parentNode.replaceChild(eComponent, childNode);
        parentNode.insertBefore(document.createComment(childNode.nodeName), eComponent);
        this.addDestroyFunc(this.destroyBean.bind(this, newComponent));
      }
      activateTabIndex(elements) {
        const tabIndex = this.gos.get("tabIndex");
        if (!elements) {
          elements = [];
        }
        if (!elements.length) {
          elements.push(this.getGui());
        }
        for (const el2 of elements) {
          el2.setAttribute("tabindex", tabIndex.toString());
        }
      }
      setTemplate(templateOrParams, componentSelectors, paramsMap) {
        let eGui;
        if (typeof templateOrParams === "string" || templateOrParams == null) {
          eGui = _loadTemplate(templateOrParams);
        } else {
          eGui = _createAgElement(templateOrParams);
        }
        this.setTemplateFromElement(eGui, componentSelectors, paramsMap);
      }
      setTemplateFromElement(element, components, paramsMap, suppressDataRefValidation = false) {
        this.eGui = element;
        this.suppressDataRefValidation = suppressDataRefValidation;
        if (components) {
          for (let i2 = 0; i2 < components.length; i2++) {
            const component = components[i2];
            this.componentSelectors.set(component.selector, component);
          }
        }
        this.wireTemplate(element, paramsMap);
      }
      getGui() {
        return this.eGui;
      }
      getFocusableElement() {
        return this.eGui;
      }
      getAriaElement() {
        return this.getFocusableElement();
      }
      setParentComponent(component) {
        this.parentComponent = component;
      }
      getParentComponent() {
        return this.parentComponent;
      }
      // this method is for older code, that wants to provide the gui element,
      // it is not intended for this to be in ag-Stack
      setGui(eGui) {
        this.eGui = eGui;
      }
      queryForHtmlElement(cssSelector) {
        return this.eGui.querySelector(cssSelector);
      }
      getContainerAndElement(newChild, container2) {
        let parent = container2;
        if (newChild == null) {
          return null;
        }
        if (!parent) {
          parent = this.eGui;
        }
        if (_isNodeOrElement(newChild)) {
          return {
            element: newChild,
            parent
          };
        }
        return {
          element: newChild.getGui(),
          parent
        };
      }
      prependChild(newChild, container2) {
        const { element, parent } = this.getContainerAndElement(newChild, container2) || {};
        if (!element || !parent) {
          return;
        }
        parent.insertAdjacentElement("afterbegin", element);
      }
      appendChild(newChild, container2) {
        const { element, parent } = this.getContainerAndElement(newChild, container2) || {};
        if (!element || !parent) {
          return;
        }
        parent.appendChild(element);
      }
      isDisplayed() {
        return this.displayed;
      }
      setVisible(visible2, options2 = {}) {
        if (visible2 !== this.visible) {
          this.visible = visible2;
          const { skipAriaHidden } = options2;
          _setVisible(this.eGui, visible2, { skipAriaHidden });
        }
      }
      setDisplayed(displayed, options2 = {}) {
        if (displayed !== this.displayed) {
          this.displayed = displayed;
          const { skipAriaHidden } = options2;
          _setDisplayed(this.eGui, displayed, { skipAriaHidden });
          const event = {
            type: "displayChanged",
            visible: this.displayed
          };
          this.dispatchLocalEvent(event);
        }
      }
      destroy() {
        if (this.parentComponent) {
          this.parentComponent = void 0;
        }
        super.destroy();
      }
      addGuiEventListener(event, listener, options2) {
        this.eGui.addEventListener(event, listener, options2);
        this.addDestroyFunc(() => this.eGui.removeEventListener(event, listener));
      }
      addCss(className2) {
        this.cssManager.toggleCss(className2, true);
      }
      removeCss(className2) {
        this.cssManager.toggleCss(className2, false);
      }
      toggleCss(className2, addOrRemove) {
        this.cssManager.toggleCss(className2, addOrRemove);
      }
      registerCSS(css2) {
        this.css || (this.css = []);
        this.css.push(css2);
      }
    };
    var Component = class extends AgComponentStub {
    };
    function isColumnFilterComp(filter) {
      return typeof filter === "object" && !!filter.component;
    }
    function _wrapInterval(action, timeout) {
      return new AgPromise((resolve) => {
        resolve(window.setInterval(action, timeout));
      });
    }
    var AgPromise = class _AgPromise {
      constructor(callback) {
        this.status = 0;
        this.resolution = null;
        this.waiters = [];
        callback(
          (value2) => this.onDone(value2),
          (params) => this.onReject(params)
        );
      }
      static all(promises) {
        return promises.length ? new _AgPromise((resolve) => {
          let remainingToResolve = promises.length;
          const combinedValues = new Array(remainingToResolve);
          promises.forEach((promise, index) => {
            promise.then((value2) => {
              combinedValues[index] = value2;
              remainingToResolve--;
              if (remainingToResolve === 0) {
                resolve(combinedValues);
              }
            });
          });
        }) : _AgPromise.resolve();
      }
      static resolve(value2 = null) {
        return new _AgPromise((resolve) => resolve(value2));
      }
      then(func) {
        return new _AgPromise((resolve) => {
          if (this.status === 1) {
            resolve(func(this.resolution));
          } else {
            this.waiters.push((value2) => resolve(func(value2)));
          }
        });
      }
      onDone(value2) {
        this.status = 1;
        this.resolution = value2;
        for (const waiter of this.waiters) {
          waiter(value2);
        }
      }
      onReject(_) {
      }
    };
    function doesImplementIComponent(candidate) {
      if (!candidate) {
        return false;
      }
      return candidate.prototype && "getGui" in candidate.prototype;
    }
    function _getUserCompKeys(frameworkOverrides, defObject, type, params) {
      const { name: name2 } = type;
      let compName;
      let jsComp;
      let fwComp;
      let paramsFromSelector;
      let popupFromSelector;
      let popupPositionFromSelector;
      if (defObject) {
        const defObjectAny = defObject;
        const selectorFunc = defObjectAny[name2 + "Selector"];
        const selectorRes = selectorFunc ? selectorFunc(params) : null;
        const assignComp = (providedJsComp) => {
          if (typeof providedJsComp === "string") {
            compName = providedJsComp;
          } else if (providedJsComp != null && providedJsComp !== true) {
            const isFwkComp = frameworkOverrides.isFrameworkComponent(providedJsComp);
            if (isFwkComp) {
              fwComp = providedJsComp;
            } else {
              jsComp = providedJsComp;
            }
          }
        };
        if (selectorRes) {
          assignComp(selectorRes.component);
          paramsFromSelector = selectorRes.params;
          popupFromSelector = selectorRes.popup;
          popupPositionFromSelector = selectorRes.popupPosition;
        } else {
          assignComp(defObjectAny[name2]);
        }
      }
      return { compName, jsComp, fwComp, paramsFromSelector, popupFromSelector, popupPositionFromSelector };
    }
    var UserComponentFactory = class extends BeanStub {
      constructor() {
        super(...arguments);
        this.beanName = "userCompFactory";
      }
      wireBeans(beans) {
        this.agCompUtils = beans.agCompUtils;
        this.registry = beans.registry;
        this.frameworkCompWrapper = beans.frameworkCompWrapper;
        this.gridOptions = beans.gridOptions;
      }
      getCompDetailsFromGridOptions(type, defaultName, params, mandatory = false) {
        return this.getCompDetails(this.gridOptions, type, defaultName, params, mandatory);
      }
      getCompDetails(defObject, type, defaultName, params, mandatory = false) {
        const { name: name2, cellRenderer } = type;
        let { compName, jsComp, fwComp, paramsFromSelector, popupFromSelector, popupPositionFromSelector } = _getUserCompKeys(this.beans.frameworkOverrides, defObject, type, params);
        let defaultCompParams;
        let defaultCompProcessParams;
        const lookupFromRegistry = (key2) => {
          const item2 = this.registry.getUserComponent(name2, key2);
          if (item2) {
            jsComp = !item2.componentFromFramework ? item2.component : void 0;
            fwComp = item2.componentFromFramework ? item2.component : void 0;
            defaultCompParams = item2.params;
            defaultCompProcessParams = item2.processParams;
          }
        };
        if (compName != null) {
          lookupFromRegistry(compName);
        }
        if (jsComp == null && fwComp == null && defaultName != null) {
          lookupFromRegistry(defaultName);
        }
        if (jsComp && cellRenderer && !doesImplementIComponent(jsComp)) {
          jsComp = this.agCompUtils?.adaptFunction(type, jsComp);
        }
        if (!jsComp && !fwComp) {
          const { validation } = this.beans;
          if (mandatory && (compName !== defaultName || !defaultName)) {
            if (compName) {
              if (!validation?.isProvidedUserComp(compName)) {
                _error(50, { compName });
              }
            } else if (defaultName) {
              if (!validation) {
                _error(260, {
                  ...this.gos.getModuleErrorParams(),
                  propName: name2,
                  compName: defaultName
                });
              }
            } else {
              _error(216, { name: name2 });
            }
          } else if (defaultName && !validation) {
            _error(146, { comp: defaultName });
          }
          return;
        }
        const paramsMerged = this.mergeParams(
          defObject,
          type,
          params,
          paramsFromSelector,
          defaultCompParams,
          defaultCompProcessParams
        );
        const componentFromFramework = jsComp == null;
        const componentClass = jsComp ?? fwComp;
        return {
          componentFromFramework,
          componentClass,
          params: paramsMerged,
          type,
          popupFromSelector,
          popupPositionFromSelector,
          newAgStackInstance: () => this.newAgStackInstance(componentClass, componentFromFramework, paramsMerged, type)
        };
      }
      newAgStackInstance(ComponentClass, componentFromFramework, params, type) {
        const jsComponent = !componentFromFramework;
        let instance;
        if (jsComponent) {
          instance = new ComponentClass();
        } else {
          instance = this.frameworkCompWrapper.wrap(
            ComponentClass,
            type.mandatoryMethods,
            type.optionalMethods,
            type
          );
        }
        this.createBean(instance);
        const deferredInit = instance.init?.(params);
        if (deferredInit == null) {
          return AgPromise.resolve(instance);
        }
        return deferredInit.then(() => instance);
      }
      /**
       * merges params with application provided params
       * used by Floating Filter
       */
      mergeParams(defObject, type, paramsFromGrid, paramsFromSelector = null, defaultCompParams, defaultCompProcessParams) {
        const params = { ...paramsFromGrid, ...defaultCompParams };
        const defObjectAny = defObject;
        const userParams = defObjectAny?.[type.name + "Params"];
        if (typeof userParams === "function") {
          const userParamsFromFunc = userParams(paramsFromGrid);
          _mergeDeep(params, userParamsFromFunc);
        } else if (typeof userParams === "object") {
          _mergeDeep(params, userParams);
        }
        _mergeDeep(params, paramsFromSelector);
        return defaultCompProcessParams ? defaultCompProcessParams(params) : params;
      }
    };
    var DateComponent = {
      name: "dateComponent",
      mandatoryMethods: ["getDate", "setDate"],
      optionalMethods: ["afterGuiAttached", "setInputPlaceholder", "setInputAriaLabel", "setDisabled", "refresh"]
    };
    var DragAndDropImageComponent = {
      name: "dragAndDropImageComponent",
      mandatoryMethods: ["setIcon", "setLabel"]
    };
    var HeaderComponent = { name: "headerComponent", optionalMethods: ["refresh"] };
    var InnerHeaderComponent = { name: "innerHeaderComponent" };
    var InnerHeaderGroupComponent = { name: "innerHeaderGroupComponent" };
    var HeaderGroupComponent = { name: "headerGroupComponent" };
    var CellRendererComponent = {
      name: "cellRenderer",
      optionalMethods: ["refresh", "afterGuiAttached"],
      cellRenderer: true
    };
    var LoadingCellRendererComponent = { name: "loadingCellRenderer", cellRenderer: true };
    var CellEditorComponent = {
      name: "cellEditor",
      mandatoryMethods: ["getValue"],
      optionalMethods: [
        "isPopup",
        "isCancelBeforeStart",
        "isCancelAfterEnd",
        "getPopupPosition",
        "focusIn",
        "focusOut",
        "afterGuiAttached",
        "refresh"
      ]
    };
    var LoadingOverlayComponent = { name: "loadingOverlayComponent", optionalMethods: ["refresh"] };
    var NoRowsOverlayComponent = { name: "noRowsOverlayComponent", optionalMethods: ["refresh"] };
    var TooltipComponent = { name: "tooltipComponent" };
    var FilterComponent = {
      name: "filter",
      mandatoryMethods: ["isFilterActive", "doesFilterPass", "getModel", "setModel"],
      optionalMethods: [
        "afterGuiAttached",
        "afterGuiDetached",
        "onNewRowsLoaded",
        "getModelAsString",
        "onFloatingFilterChanged",
        "onAnyFilterChanged",
        "refresh"
      ]
    };
    var FloatingFilterComponent = {
      name: "floatingFilterComponent",
      mandatoryMethods: ["onParentModelChanged"],
      optionalMethods: ["afterGuiAttached", "refresh"]
    };
    var FullWidth = {
      name: "fullWidthCellRenderer",
      optionalMethods: ["refresh", "afterGuiAttached"],
      cellRenderer: true
    };
    var FullWidthLoading = { name: "loadingCellRenderer", cellRenderer: true };
    var FullWidthGroup = {
      name: "groupRowRenderer",
      optionalMethods: ["afterGuiAttached"],
      cellRenderer: true
    };
    var FullWidthDetail = { name: "detailCellRenderer", optionalMethods: ["refresh"], cellRenderer: true };
    function _getDragAndDropImageCompDetails(userCompFactory, params) {
      return userCompFactory.getCompDetailsFromGridOptions(DragAndDropImageComponent, "agDragAndDropImage", params, true);
    }
    function _getHeaderCompDetails(userCompFactory, colDef, params) {
      return userCompFactory.getCompDetails(colDef, HeaderComponent, "agColumnHeader", params);
    }
    function _getInnerHeaderCompDetails(userCompFactory, headerCompParams, params) {
      return userCompFactory.getCompDetails(headerCompParams, InnerHeaderComponent, void 0, params);
    }
    function _getHeaderGroupCompDetails(userCompFactory, params) {
      const colGroupDef = params.columnGroup.getColGroupDef();
      return userCompFactory.getCompDetails(colGroupDef, HeaderGroupComponent, "agColumnGroupHeader", params);
    }
    function _getInnerHeaderGroupCompDetails(userCompFactory, headerGroupCompParams, params) {
      return userCompFactory.getCompDetails(headerGroupCompParams, InnerHeaderGroupComponent, void 0, params);
    }
    function _getFullWidthCellRendererDetails(userCompFactory, params) {
      return userCompFactory.getCompDetailsFromGridOptions(FullWidth, void 0, params, true);
    }
    function _getFullWidthLoadingCellRendererDetails(userCompFactory, params) {
      return userCompFactory.getCompDetailsFromGridOptions(FullWidthLoading, "agLoadingCellRenderer", params, true);
    }
    function _getFullWidthGroupCellRendererDetails(userCompFactory, params) {
      return userCompFactory.getCompDetailsFromGridOptions(FullWidthGroup, "agGroupRowRenderer", params, true);
    }
    function _getFullWidthDetailCellRendererDetails(userCompFactory, params) {
      return userCompFactory.getCompDetailsFromGridOptions(FullWidthDetail, "agDetailCellRenderer", params, true);
    }
    function _getCellRendererDetails(userCompFactory, def, params) {
      return userCompFactory.getCompDetails(def, CellRendererComponent, void 0, params);
    }
    function _getLoadingCellRendererDetails(userCompFactory, def, params) {
      return userCompFactory.getCompDetails(def, LoadingCellRendererComponent, "agSkeletonCellRenderer", params, true);
    }
    function _getCellEditorDetails(userCompFactory, def, params) {
      return userCompFactory.getCompDetails(def, CellEditorComponent, "agCellEditor", params, true);
    }
    function _getFilterDetails(userCompFactory, def, params, defaultFilter) {
      const filter = def.filter;
      if (isColumnFilterComp(filter)) {
        def = {
          filter: filter.component,
          filterParams: def.filterParams
        };
      }
      return userCompFactory.getCompDetails(def, FilterComponent, defaultFilter, params, true);
    }
    function _getDateCompDetails(userCompFactory, def, params) {
      return userCompFactory.getCompDetails(def, DateComponent, "agDateInput", params, true);
    }
    function _getLoadingOverlayCompDetails(userCompFactory, params) {
      return userCompFactory.getCompDetailsFromGridOptions(LoadingOverlayComponent, "agLoadingOverlay", params, true);
    }
    function _getNoRowsOverlayCompDetails(userCompFactory, params) {
      return userCompFactory.getCompDetailsFromGridOptions(NoRowsOverlayComponent, "agNoRowsOverlay", params, true);
    }
    function _getTooltipCompDetails(userCompFactory, params) {
      return userCompFactory.getCompDetails(params.colDef, TooltipComponent, "agTooltipComponent", params, true);
    }
    function _getFloatingFilterCompDetails(userCompFactory, def, params, defaultFloatingFilter) {
      return userCompFactory.getCompDetails(def, FloatingFilterComponent, defaultFloatingFilter, params);
    }
    function _getFilterCompKeys(frameworkOverrides, def) {
      return _getUserCompKeys(frameworkOverrides, def, FilterComponent);
    }
    function _mergeFilterParamsWithApplicationProvidedParams(userCompFactory, defObject, paramsFromGrid) {
      return userCompFactory.mergeParams(defObject, FilterComponent, paramsFromGrid);
    }
    function _unwrapUserComp(comp2) {
      const compAsAny = comp2;
      const isProxy = compAsAny?.getFrameworkComponentInstance != null;
      return isProxy ? compAsAny.getFrameworkComponentInstance() : comp2;
    }
    function isComponentMetaFunc(componentMeta) {
      return typeof componentMeta === "object" && !!componentMeta.getComp;
    }
    var KeyCode = {
      BACKSPACE: "Backspace",
      TAB: "Tab",
      ENTER: "Enter",
      ESCAPE: "Escape",
      SPACE: " ",
      LEFT: "ArrowLeft",
      UP: "ArrowUp",
      RIGHT: "ArrowRight",
      DOWN: "ArrowDown",
      DELETE: "Delete",
      F2: "F2",
      PAGE_UP: "PageUp",
      PAGE_DOWN: "PageDown",
      PAGE_HOME: "Home",
      PAGE_END: "End",
      // these should be used with `event.code` instead of `event.key`
      // as `event.key` changes when non-latin keyboards are used
      A: "KeyA",
      C: "KeyC",
      D: "KeyD",
      V: "KeyV",
      X: "KeyX",
      Y: "KeyY",
      Z: "KeyZ"
    };
    var AgPopupComponent = class extends AgComponentStub {
      isPopup() {
        return true;
      }
      setParentComponent(container2) {
        container2.addCss("ag-has-popup");
        super.setParentComponent(container2);
      }
      destroy() {
        const parentComp = this.parentComponent;
        const hasParent = parentComp?.isAlive();
        if (hasParent) {
          parentComp.getGui().classList.remove("ag-has-popup");
        }
        super.destroy();
      }
    };
    var isSafari;
    var isFirefox;
    var isMacOs;
    var isIOS;
    var invisibleScrollbar;
    var browserScrollbarWidth;
    var maxDivHeight;
    function _isBrowserSafari() {
      if (isSafari === void 0) {
        isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
      }
      return isSafari;
    }
    function _isBrowserFirefox() {
      if (isFirefox === void 0) {
        isFirefox = /(firefox)/i.test(navigator.userAgent);
      }
      return isFirefox;
    }
    function _isMacOsUserAgent() {
      if (isMacOs === void 0) {
        isMacOs = /(Mac|iPhone|iPod|iPad)/i.test(navigator.platform);
      }
      return isMacOs;
    }
    function _isIOSUserAgent() {
      if (isIOS === void 0) {
        isIOS = /iPad|iPhone|iPod/.test(navigator.platform) || navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1;
      }
      return isIOS;
    }
    function _getTabIndex(el2) {
      if (!el2) {
        return null;
      }
      const numberTabIndex = el2.tabIndex;
      const tabIndex = el2.getAttribute("tabIndex");
      if (numberTabIndex === -1 && (tabIndex === null || tabIndex === "" && !_isBrowserFirefox())) {
        return null;
      }
      return numberTabIndex.toString();
    }
    function _getMaxDivHeight() {
      if (maxDivHeight !== void 0) {
        return maxDivHeight;
      }
      if (!document.body) {
        return -1;
      }
      let res = 1e6;
      const testUpTo = _isBrowserFirefox() ? 6e6 : 1e9;
      const div2 = document.createElement("div");
      document.body.appendChild(div2);
      while (true) {
        const test = res * 2;
        div2.style.height = test + "px";
        if (test > testUpTo || div2.clientHeight !== test) {
          break;
        } else {
          res = test;
        }
      }
      div2.remove();
      maxDivHeight = res;
      return res;
    }
    function _getScrollbarWidth() {
      if (browserScrollbarWidth == null) {
        initScrollbarWidthAndVisibility();
      }
      return browserScrollbarWidth;
    }
    function initScrollbarWidthAndVisibility() {
      const body2 = document.body;
      const div2 = document.createElement("div");
      div2.style.width = div2.style.height = "100px";
      div2.style.opacity = "0";
      div2.style.overflow = "scroll";
      div2.style.msOverflowStyle = "scrollbar";
      div2.style.position = "absolute";
      body2.appendChild(div2);
      let width = div2.offsetWidth - div2.clientWidth;
      if (width === 0 && div2.clientWidth === 0) {
        width = null;
      }
      if (div2.parentNode) {
        div2.remove();
      }
      if (width != null) {
        browserScrollbarWidth = width;
        invisibleScrollbar = width === 0;
      }
    }
    function _isInvisibleScrollbar() {
      if (invisibleScrollbar == null) {
        initScrollbarWidthAndVisibility();
      }
      return invisibleScrollbar;
    }
    var DATE_TIME_SEPARATOR = "T";
    var DATE_TIME_SEPARATOR_REGEXP = new RegExp(`[${DATE_TIME_SEPARATOR} ]`);
    var DATE_TIME_REGEXP = new RegExp(`^\\d{4}-\\d{2}-\\d{2}(${DATE_TIME_SEPARATOR}\\d{2}:\\d{2}:\\d{2}\\D?)?`);
    function _padStartWidthZeros(value2, totalStringSize) {
      return value2.toString().padStart(totalStringSize, "0");
    }
    function _serialiseDate(date, includeTime = true, separator2 = DATE_TIME_SEPARATOR) {
      if (!date) {
        return null;
      }
      let serialised = [date.getFullYear(), date.getMonth() + 1, date.getDate()].map((part2) => _padStartWidthZeros(part2, 2)).join("-");
      if (includeTime) {
        serialised += separator2 + [date.getHours(), date.getMinutes(), date.getSeconds()].map((part2) => _padStartWidthZeros(part2, 2)).join(":");
      }
      return serialised;
    }
    function _getDateParts(d, includeTime = true) {
      if (!d) {
        return null;
      }
      if (includeTime) {
        return [
          String(d.getFullYear()),
          String(d.getMonth() + 1),
          _padStartWidthZeros(d.getDate(), 2),
          _padStartWidthZeros(d.getHours(), 2),
          `:${_padStartWidthZeros(d.getMinutes(), 2)}`,
          `:${_padStartWidthZeros(d.getSeconds(), 2)}`
        ];
      }
      return [d.getFullYear(), d.getMonth() + 1, _padStartWidthZeros(d.getDate(), 2)].map(String);
    }
    var calculateOrdinal = (value2) => {
      if (value2 > 3 && value2 < 21) {
        return "th";
      }
      const remainder = value2 % 10;
      switch (remainder) {
        case 1:
          return "st";
        case 2:
          return "nd";
        case 3:
          return "rd";
      }
      return "th";
    };
    var MONTHS = [
      "January",
      "February",
      "March",
      "April",
      "May",
      "June",
      "July",
      "August",
      "September",
      "October",
      "November",
      "December"
    ];
    var DAYS = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
    function _dateToFormattedString(date, format2) {
      if (format2 == null) {
        return _serialiseDate(date, false);
      }
      const fullYear = _padStartWidthZeros(date.getFullYear(), 4);
      const replace2 = {
        YYYY: () => fullYear.slice(fullYear.length - 4, fullYear.length),
        YY: () => fullYear.slice(fullYear.length - 2, fullYear.length),
        Y: () => `${date.getFullYear()}`,
        MMMM: () => MONTHS[date.getMonth()],
        MMM: () => MONTHS[date.getMonth()].slice(0, 3),
        MM: () => _padStartWidthZeros(date.getMonth() + 1, 2),
        Mo: () => `${date.getMonth() + 1}${calculateOrdinal(date.getMonth() + 1)}`,
        M: () => `${date.getMonth() + 1}`,
        Do: () => `${date.getDate()}${calculateOrdinal(date.getDate())}`,
        DD: () => _padStartWidthZeros(date.getDate(), 2),
        D: () => `${date.getDate()}`,
        dddd: () => DAYS[date.getDay()],
        ddd: () => DAYS[date.getDay()].slice(0, 3),
        dd: () => DAYS[date.getDay()].slice(0, 2),
        do: () => `${date.getDay()}${calculateOrdinal(date.getDay())}`,
        d: () => `${date.getDay()}`
      };
      const regexp = new RegExp(Object.keys(replace2).join("|"), "g");
      return format2.replace(regexp, (match) => {
        if (match in replace2) {
          return replace2[match]();
        }
        return match;
      });
    }
    function _isValidDate(value2, bailIfInvalidTime = false) {
      return !!_parseDateTimeFromString(value2, bailIfInvalidTime);
    }
    function _isValidDateTime(value2) {
      return _isValidDate(value2, true);
    }
    function _parseDateTimeFromString(value2, bailIfInvalidTime = false, skipValidation) {
      if (!value2) {
        return null;
      }
      if (!skipValidation && !DATE_TIME_REGEXP.test(value2)) {
        return null;
      }
      const [dateStr, timeStr] = value2.split(DATE_TIME_SEPARATOR_REGEXP);
      if (!dateStr) {
        return null;
      }
      const fields = dateStr.split("-").map((f) => Number.parseInt(f, 10));
      if (fields.filter((f) => !isNaN(f)).length !== 3) {
        return null;
      }
      const [year, month, day] = fields;
      const date = new Date(year, month - 1, day);
      if (date.getFullYear() !== year || date.getMonth() !== month - 1 || date.getDate() !== day) {
        return null;
      }
      if (!timeStr && bailIfInvalidTime) {
        return null;
      }
      if (!timeStr || timeStr === "00:00:00") {
        return date;
      }
      const [hours, minutes, seconds] = timeStr.split(":").map((part2) => Number.parseInt(part2, 10));
      if (hours >= 0 && hours < 24) {
        date.setHours(hours);
      } else if (bailIfInvalidTime) {
        return null;
      }
      if (minutes >= 0 && minutes < 60) {
        date.setMinutes(minutes);
      } else if (bailIfInvalidTime) {
        return null;
      }
      if (seconds >= 0 && seconds < 60) {
        date.setSeconds(seconds);
      } else if (bailIfInvalidTime) {
        return null;
      }
      return date;
    }
    function _fuzzySuggestions(params) {
      const { inputValue, allSuggestions, hideIrrelevant, filterByPercentageOfBestMatch } = params;
      let thisSuggestions = (allSuggestions ?? []).map(
        (text2, idx) => ({
          value: text2,
          relevance: _getLevenshteinSimilarityDistance(inputValue, text2),
          idx
        })
      );
      thisSuggestions.sort((a, b) => a.relevance - b.relevance);
      if (hideIrrelevant) {
        thisSuggestions = thisSuggestions.filter(
          (suggestion) => suggestion.relevance < Math.max(suggestion.value.length, inputValue.length)
        );
      }
      if (thisSuggestions.length > 0 && filterByPercentageOfBestMatch && filterByPercentageOfBestMatch > 0) {
        const bestMatch = thisSuggestions[0].relevance;
        const limit = bestMatch * filterByPercentageOfBestMatch;
        thisSuggestions = thisSuggestions.filter((suggestion) => limit - suggestion.relevance < 0);
      }
      const values = [];
      const indices = [];
      for (const suggestion of thisSuggestions) {
        values.push(suggestion.value);
        indices.push(suggestion.idx);
      }
      return { values, indices };
    }
    function _getLevenshteinSimilarityDistance(inputText, suggestion) {
      if (inputText.length < suggestion.length) {
        [inputText, suggestion] = [suggestion, inputText];
      }
      let previousRow = [];
      let currentRow = [];
      const sourceLength = inputText.length;
      const targetLength = suggestion.length;
      for (let j = 0; j <= targetLength; j++) {
        previousRow[j] = j;
      }
      let secondaryScore = 0;
      for (let i2 = 1; i2 <= sourceLength; i2++) {
        currentRow[0] = i2;
        for (let j = 1; j <= targetLength; j++) {
          const sourceChar = inputText[i2 - 1];
          const targetChar = suggestion[j - 1];
          if (sourceChar.toLocaleLowerCase() === targetChar.toLocaleLowerCase()) {
            ++secondaryScore;
            if (sourceChar === targetChar) {
              ++secondaryScore;
            }
            if (i2 > 1 && j > 1) {
              if (inputText[i2 - 2].toLocaleLowerCase() === suggestion[j - 2].toLocaleLowerCase()) {
                ++secondaryScore;
                if (inputText[i2 - 2] === suggestion[j - 2]) {
                  ++secondaryScore;
                }
              }
            }
            if (i2 < sourceLength / 2 - 10) {
              ++secondaryScore;
            }
            currentRow[j] = previousRow[j - 1];
          } else {
            const insertCost = currentRow[j - 1];
            const deleteCost = previousRow[j];
            const replaceCost = previousRow[j - 1];
            currentRow[j] = 1 + Math.min(insertCost, deleteCost, replaceCost);
          }
        }
        [previousRow, currentRow] = [currentRow, previousRow];
      }
      return previousRow[targetLength] / (secondaryScore + 1);
    }
    function _isEventFromPrintableCharacter(event) {
      if (event.altKey || event.ctrlKey || event.metaKey) {
        return false;
      }
      const printableCharacter = event.key?.length === 1;
      return printableCharacter;
    }
    var keyboardModeActive = false;
    var instanceCount = 0;
    function addKeyboardModeEvents(doc2) {
      if (instanceCount > 0) {
        return;
      }
      doc2.addEventListener("keydown", toggleKeyboardMode);
      doc2.addEventListener("mousedown", toggleKeyboardMode);
    }
    function removeKeyboardModeEvents(doc2) {
      if (instanceCount > 0) {
        return;
      }
      doc2.removeEventListener("keydown", toggleKeyboardMode);
      doc2.removeEventListener("mousedown", toggleKeyboardMode);
    }
    function toggleKeyboardMode(event) {
      const isKeyboardActive = keyboardModeActive;
      const isKeyboardEvent = event.type === "keydown";
      if (isKeyboardEvent) {
        if (event.ctrlKey || event.metaKey || event.altKey) {
          return;
        }
      }
      if (isKeyboardActive === isKeyboardEvent) {
        return;
      }
      keyboardModeActive = isKeyboardEvent;
    }
    function _registerKeyboardFocusEvents(beans) {
      const eDocument = _getDocument(beans);
      addKeyboardModeEvents(eDocument);
      instanceCount++;
      return () => {
        instanceCount--;
        removeKeyboardModeEvents(eDocument);
      };
    }
    function _isKeyboardMode() {
      return keyboardModeActive;
    }
    function _findFocusableElements(rootNode, exclude, onlyUnmanaged = false) {
      const focusableString = FOCUSABLE_SELECTOR;
      let excludeString = FOCUSABLE_EXCLUDE;
      if (exclude) {
        excludeString += ", " + exclude;
      }
      if (onlyUnmanaged) {
        excludeString += ', [tabindex="-1"]';
      }
      const nodes = Array.prototype.slice.apply(rootNode.querySelectorAll(focusableString)).filter((node2) => {
        return _isVisible(node2);
      });
      const excludeNodes = Array.prototype.slice.apply(rootNode.querySelectorAll(excludeString));
      if (!excludeNodes.length) {
        return nodes;
      }
      const diff2 = (a, b) => a.filter((element) => b.indexOf(element) === -1);
      return diff2(nodes, excludeNodes);
    }
    function _focusInto(rootNode, up = false, onlyUnmanaged = false, excludeTabGuards = false) {
      const focusableElements = _findFocusableElements(
        rootNode,
        excludeTabGuards ? ".ag-tab-guard" : null,
        onlyUnmanaged
      );
      const toFocus = up ? _last(focusableElements) : focusableElements[0];
      if (toFocus) {
        toFocus.focus({ preventScroll: true });
        return true;
      }
      return false;
    }
    function _findNextFocusableElement(beans, rootNode, onlyManaged, backwards) {
      const focusable = _findFocusableElements(rootNode, onlyManaged ? ':not([tabindex="-1"])' : null);
      const activeEl = _getActiveDomElement(beans);
      let currentIndex;
      if (onlyManaged) {
        currentIndex = focusable.findIndex((el2) => el2.contains(activeEl));
      } else {
        currentIndex = focusable.indexOf(activeEl);
      }
      const nextIndex = currentIndex + (backwards ? -1 : 1);
      if (nextIndex < 0 || nextIndex >= focusable.length) {
        return null;
      }
      return focusable[nextIndex];
    }
    function _findTabbableParent(node2, limit = 5) {
      let counter2 = 0;
      while (node2 && _getTabIndex(node2) === null && ++counter2 <= limit) {
        node2 = node2.parentElement;
      }
      if (_getTabIndex(node2) === null) {
        return null;
      }
      return node2;
    }
    var agAbstractLabelCSS = (
      /*css*/
      `.ag-label{white-space:nowrap}:where(.ag-ltr) .ag-label{margin-right:var(--ag-spacing)}:where(.ag-rtl) .ag-label{margin-left:var(--ag-spacing)}:where(.ag-label-align-right) .ag-label{order:1}:where(.ag-ltr) :where(.ag-label-align-right) .ag-label{margin-left:var(--ag-spacing)}:where(.ag-rtl) :where(.ag-label-align-right) .ag-label{margin-right:var(--ag-spacing)}.ag-label-align-right>*{flex:none}.ag-label-align-top{align-items:flex-start;flex-direction:column;>*{align-self:stretch}}.ag-label-ellipsis{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:where(.ag-label-align-top) .ag-label{margin-bottom:calc(var(--ag-spacing)*.5)}`
    );
    var AgAbstractLabel = class extends AgComponentStub {
      constructor(config2, template2, components) {
        super(template2, components);
        this.labelSeparator = "";
        this.labelAlignment = "left";
        this.disabled = false;
        this.label = "";
        this.config = config2 || {};
        this.registerCSS(agAbstractLabelCSS);
      }
      postConstruct() {
        this.addCss("ag-labeled");
        this.eLabel.classList.add("ag-label");
        const { labelSeparator, label: label2, labelWidth, labelAlignment, disabled: disabled2 } = this.config;
        if (disabled2 != null) {
          this.setDisabled(disabled2);
        }
        if (labelSeparator != null) {
          this.setLabelSeparator(labelSeparator);
        }
        if (label2 != null) {
          this.setLabel(label2);
        }
        if (labelWidth != null) {
          this.setLabelWidth(labelWidth);
        }
        this.setLabelAlignment(labelAlignment || this.labelAlignment);
        this.refreshLabel();
      }
      refreshLabel() {
        const { label: label2, eLabel } = this;
        _clearElement(eLabel);
        if (typeof label2 === "string") {
          eLabel.innerText = label2 + this.labelSeparator;
        } else if (label2) {
          eLabel.appendChild(label2);
        }
        if (label2 === "") {
          _setDisplayed(eLabel, false);
          _setAriaRole(eLabel, "presentation");
        } else {
          _setDisplayed(eLabel, true);
          _setAriaRole(eLabel, null);
        }
      }
      setLabelSeparator(labelSeparator) {
        if (this.labelSeparator === labelSeparator) {
          return this;
        }
        this.labelSeparator = labelSeparator;
        if (this.label != null) {
          this.refreshLabel();
        }
        return this;
      }
      getLabelId() {
        const eLabel = this.eLabel;
        eLabel.id = eLabel.id || `ag-${this.getCompId()}-label`;
        return eLabel.id;
      }
      getLabel() {
        return this.label;
      }
      setLabel(label2) {
        if (this.label === label2) {
          return this;
        }
        this.label = label2;
        this.refreshLabel();
        return this;
      }
      setLabelAlignment(alignment) {
        const eGui = this.getGui();
        const eGuiClassList = eGui.classList;
        eGuiClassList.toggle("ag-label-align-left", alignment === "left");
        eGuiClassList.toggle("ag-label-align-right", alignment === "right");
        eGuiClassList.toggle("ag-label-align-top", alignment === "top");
        return this;
      }
      setLabelEllipsis(hasEllipsis) {
        this.eLabel.classList.toggle("ag-label-ellipsis", hasEllipsis);
        return this;
      }
      setLabelWidth(width) {
        if (this.label == null) {
          return this;
        }
        _setElementWidth(this.eLabel, width);
        return this;
      }
      setDisabled(disabled2) {
        disabled2 = !!disabled2;
        const element = this.getGui();
        _setDisabled(element, disabled2);
        element.classList.toggle("ag-disabled", disabled2);
        this.disabled = disabled2;
        return this;
      }
      isDisabled() {
        return !!this.disabled;
      }
    };
    var AgAbstractField = class extends AgAbstractLabel {
      constructor(config2, template2, components, className2) {
        super(config2, template2, components);
        this.className = className2;
      }
      postConstruct() {
        super.postConstruct();
        const { width, value: value2, onValueChange } = this.config;
        if (width != null) {
          this.setWidth(width);
        }
        if (value2 != null) {
          this.setValue(value2);
        }
        if (onValueChange != null) {
          this.onValueChange(onValueChange);
        }
        if (this.className) {
          this.addCss(this.className);
        }
        this.refreshAriaLabelledBy();
      }
      setLabel(label2) {
        super.setLabel(label2);
        this.refreshAriaLabelledBy();
        return this;
      }
      refreshAriaLabelledBy() {
        const ariaEl = this.getAriaElement();
        const labelId = this.getLabelId();
        const label2 = this.getLabel();
        if (label2 == null || label2 == "" || _getAriaLabel(ariaEl) !== null) {
          _setAriaLabelledBy(ariaEl, "");
        } else {
          _setAriaLabelledBy(ariaEl, labelId ?? "");
        }
      }
      setAriaLabel(label2) {
        _setAriaLabel(this.getAriaElement(), label2);
        this.refreshAriaLabelledBy();
        return this;
      }
      onValueChange(callbackFn) {
        this.addManagedListeners(this, { fieldValueChanged: () => callbackFn(this.getValue()) });
        return this;
      }
      getWidth() {
        return this.getGui().clientWidth;
      }
      setWidth(width) {
        _setFixedWidth(this.getGui(), width);
        return this;
      }
      getPreviousValue() {
        return this.previousValue;
      }
      getValue() {
        return this.value;
      }
      setValue(value2, silent) {
        if (this.value === value2) {
          return this;
        }
        this.previousValue = this.value;
        this.value = value2;
        if (!silent) {
          this.dispatchLocalEvent({ type: "fieldValueChanged" });
        }
        return this;
      }
    };
    function buildTemplate(displayFieldTag) {
      return {
        tag: "div",
        role: "presentation",
        children: [
          { tag: "div", ref: "eLabel", cls: "ag-input-field-label" },
          {
            tag: "div",
            ref: "eWrapper",
            cls: "ag-wrapper ag-input-wrapper",
            role: "presentation",
            children: [{ tag: displayFieldTag, ref: "eInput", cls: "ag-input-field-input" }]
          }
        ]
      };
    }
    var AgAbstractInputField = class extends AgAbstractField {
      constructor(config2, className2, inputType = "text", displayFieldTag = "input") {
        super(config2, config2?.template ?? buildTemplate(displayFieldTag), [], className2);
        this.inputType = inputType;
        this.displayFieldTag = displayFieldTag;
        this.eLabel = RefPlaceholder;
        this.eWrapper = RefPlaceholder;
        this.eInput = RefPlaceholder;
      }
      postConstruct() {
        super.postConstruct();
        this.setInputType(this.inputType);
        const { eLabel, eWrapper, eInput, className: className2 } = this;
        eLabel.classList.add(`${className2}-label`);
        eWrapper.classList.add(`${className2}-input-wrapper`);
        eInput.classList.add(`${className2}-input`);
        this.addCss("ag-input-field");
        eInput.id = eInput.id || `ag-${this.getCompId()}-input`;
        const { inputName, inputWidth } = this.config;
        if (inputName != null) {
          this.setInputName(inputName);
        }
        if (inputWidth != null) {
          this.setInputWidth(inputWidth);
        }
        this.addInputListeners();
        this.activateTabIndex([eInput]);
      }
      addInputListeners() {
        this.addManagedElementListeners(this.eInput, {
          input: (e) => this.setValue(e.target.value)
        });
      }
      setInputType(inputType) {
        if (this.displayFieldTag === "input") {
          this.inputType = inputType;
          _addOrRemoveAttribute(this.eInput, "type", inputType);
        }
      }
      getInputElement() {
        return this.eInput;
      }
      setInputWidth(width) {
        _setElementWidth(this.eWrapper, width);
        return this;
      }
      setInputName(name2) {
        this.getInputElement().setAttribute("name", name2);
        return this;
      }
      getFocusableElement() {
        return this.eInput;
      }
      setMaxLength(length) {
        const eInput = this.eInput;
        eInput.maxLength = length;
        return this;
      }
      setInputPlaceholder(placeholder) {
        _addOrRemoveAttribute(this.eInput, "placeholder", placeholder);
        return this;
      }
      setInputAriaLabel(label2) {
        _setAriaLabel(this.eInput, label2);
        this.refreshAriaLabelledBy();
        return this;
      }
      setDisabled(disabled2) {
        _setDisabled(this.eInput, disabled2);
        return super.setDisabled(disabled2);
      }
      setAutoComplete(value2) {
        if (value2 === true) {
          _addOrRemoveAttribute(this.eInput, "autocomplete", null);
        } else {
          const autoCompleteValue = typeof value2 === "string" ? value2 : "off";
          _addOrRemoveAttribute(this.eInput, "autocomplete", autoCompleteValue);
        }
        return this;
      }
    };
    var AgCheckbox = class extends AgAbstractInputField {
      constructor(config2, className2 = "ag-checkbox", inputType = "checkbox") {
        super(config2, className2, inputType);
        this.labelAlignment = "right";
        this.selected = false;
        this.readOnly = false;
        this.passive = false;
      }
      postConstruct() {
        super.postConstruct();
        const { readOnly: readOnly2, passive: passive2 } = this.config;
        if (typeof readOnly2 === "boolean") {
          this.setReadOnly(readOnly2);
        }
        if (typeof passive2 === "boolean") {
          this.setPassive(passive2);
        }
      }
      addInputListeners() {
        this.addManagedElementListeners(this.eInput, { click: this.onCheckboxClick.bind(this) });
        this.addManagedElementListeners(this.eLabel, { click: this.toggle.bind(this) });
      }
      getNextValue() {
        return this.selected === void 0 ? true : !this.selected;
      }
      setPassive(passive2) {
        this.passive = passive2;
      }
      isReadOnly() {
        return this.readOnly;
      }
      setReadOnly(readOnly2) {
        this.eWrapper.classList.toggle("ag-disabled", readOnly2);
        this.eInput.disabled = readOnly2;
        this.readOnly = readOnly2;
      }
      setDisabled(disabled2) {
        this.eWrapper.classList.toggle("ag-disabled", disabled2);
        return super.setDisabled(disabled2);
      }
      toggle() {
        if (this.eInput.disabled) {
          return;
        }
        const previousValue = this.isSelected();
        const nextValue = this.getNextValue();
        if (this.passive) {
          this.dispatchChange(nextValue, previousValue);
        } else {
          this.setValue(nextValue);
        }
      }
      getValue() {
        return this.isSelected();
      }
      setValue(value2, silent) {
        this.refreshSelectedClass(value2);
        this.setSelected(value2, silent);
        return this;
      }
      setName(name2) {
        const input2 = this.getInputElement();
        input2.name = name2;
        return this;
      }
      isSelected() {
        return this.selected;
      }
      setSelected(selected2, silent) {
        if (this.isSelected() === selected2) {
          return;
        }
        this.previousValue = this.isSelected();
        selected2 = this.selected = typeof selected2 === "boolean" ? selected2 : void 0;
        const eInput = this.eInput;
        eInput.checked = selected2;
        eInput.indeterminate = selected2 === void 0;
        if (!silent) {
          this.dispatchChange(this.selected, this.previousValue);
        }
      }
      dispatchChange(selected2, previousValue, event) {
        this.dispatchLocalEvent({ type: "fieldValueChanged", selected: selected2, previousValue, event });
        const input2 = this.getInputElement();
        this.eventSvc.dispatchEvent({
          type: "checkboxChanged",
          id: input2.id,
          name: input2.name,
          selected: selected2,
          previousValue
        });
      }
      onCheckboxClick(e) {
        if (this.passive || this.eInput.disabled) {
          return;
        }
        const previousValue = this.isSelected();
        const selected2 = this.selected = e.target.checked;
        this.refreshSelectedClass(selected2);
        this.dispatchChange(selected2, previousValue, e);
      }
      refreshSelectedClass(value2) {
        const classList = this.eWrapper.classList;
        classList.toggle("ag-checked", value2 === true);
        classList.toggle("ag-indeterminate", value2 == null);
      }
    };
    var AgCheckboxSelector = {
      selector: "AG-CHECKBOX",
      component: AgCheckbox
    };
    var AgRadioButton = class extends AgCheckbox {
      constructor(config2) {
        super(config2, "ag-radio-button", "radio");
      }
      isSelected() {
        return this.eInput.checked;
      }
      toggle() {
        if (this.eInput.disabled) {
          return;
        }
        if (!this.isSelected()) {
          this.setValue(true);
        }
      }
      addInputListeners() {
        super.addInputListeners();
        this.addManagedEventListeners({ checkboxChanged: this.onChange.bind(this) });
      }
      /**
       * This ensures that if another radio button in the same named group is selected, we deselect this radio button.
       * By default the browser does this for you, but we are managing classes ourselves in order to ensure input
       * elements are styled correctly in IE11, and the DOM 'changed' event is only fired when a button is selected,
       * not deselected, so we need to use our own event.
       */
      onChange(event) {
        const eInput = this.eInput;
        if (event.selected && event.name && eInput.name && eInput.name === event.name && event.id && eInput.id !== event.id) {
          this.setValue(false, true);
        }
      }
    };
    var AgInputTextField = class extends AgAbstractInputField {
      constructor(config2, className2 = "ag-text-field", inputType = "text") {
        super(config2, className2, inputType);
      }
      postConstruct() {
        super.postConstruct();
        if (this.config.allowedCharPattern) {
          this.preventDisallowedCharacters();
        }
      }
      setValue(value2, silent) {
        const eInput = this.eInput;
        if (eInput.value !== value2) {
          eInput.value = _exists(value2) ? value2 : "";
        }
        return super.setValue(value2, silent);
      }
      /** Used to set an initial value into the input without necessarily setting `this.value` or triggering events (e.g. to set an invalid value) */
      setStartValue(value2) {
        this.setValue(value2, true);
      }
      preventDisallowedCharacters() {
        const pattern = new RegExp(`[${this.config.allowedCharPattern}]`);
        const preventCharacters = (event) => {
          if (!_isEventFromPrintableCharacter(event)) {
            return;
          }
          if (event.key && !pattern.test(event.key)) {
            event.preventDefault();
          }
        };
        this.addManagedListeners(this.eInput, {
          keydown: preventCharacters,
          paste: (e) => {
            const text2 = e.clipboardData?.getData("text");
            if (text2?.split("").some((c2) => !pattern.test(c2))) {
              e.preventDefault();
            }
          }
        });
      }
    };
    var AgInputTextFieldSelector = {
      selector: "AG-INPUT-TEXT-FIELD",
      component: AgInputTextField
    };
    var AgInputTextArea = class extends AgAbstractInputField {
      constructor(config2) {
        super(config2, "ag-text-area", null, "textarea");
      }
      setValue(value2, silent) {
        const ret = super.setValue(value2, silent);
        this.eInput.value = value2;
        return ret;
      }
      setCols(cols) {
        this.eInput.cols = cols;
        return this;
      }
      setRows(rows) {
        this.eInput.rows = rows;
        return this;
      }
    };
    var AgInputTextAreaSelector = {
      selector: "AG-INPUT-TEXT-AREA",
      component: AgInputTextArea
    };
    var AgInputNumberField = class extends AgInputTextField {
      constructor(config2) {
        super(config2, "ag-number-field", "number");
      }
      postConstruct() {
        super.postConstruct();
        const eInput = this.eInput;
        this.addManagedListeners(eInput, {
          blur: () => {
            const floatedValue = Number.parseFloat(eInput.value);
            const value2 = isNaN(floatedValue) ? "" : this.normalizeValue(floatedValue.toString());
            if (this.value !== value2) {
              this.setValue(value2);
            }
          },
          wheel: this.onWheel.bind(this)
        });
        eInput.step = "any";
        const { precision, min: min2, max: max2, step } = this.config;
        if (typeof precision === "number") {
          this.setPrecision(precision);
        }
        if (typeof min2 === "number") {
          this.setMin(min2);
        }
        if (typeof max2 === "number") {
          this.setMax(max2);
        }
        if (typeof step === "number") {
          this.setStep(step);
        }
      }
      onWheel(e) {
        if (_getActiveDomElement(this.beans) === this.eInput) {
          e.preventDefault();
        }
      }
      normalizeValue(value2) {
        if (value2 === "") {
          return "";
        }
        if (this.precision != null) {
          value2 = this.adjustPrecision(value2);
        }
        return value2;
      }
      adjustPrecision(value2, isScientificNotation) {
        const precision = this.precision;
        if (precision == null) {
          return value2;
        }
        if (isScientificNotation) {
          const floatString = Number.parseFloat(value2).toFixed(precision);
          return Number.parseFloat(floatString).toString();
        }
        const parts = String(value2).split(".");
        if (parts.length > 1) {
          if (parts[1].length <= precision) {
            return value2;
          } else if (precision > 0) {
            return `${parts[0]}.${parts[1].slice(0, precision)}`;
          }
        }
        return parts[0];
      }
      setMin(min2) {
        if (this.min === min2) {
          return this;
        }
        this.min = min2;
        _addOrRemoveAttribute(this.eInput, "min", min2);
        return this;
      }
      setMax(max2) {
        if (this.max === max2) {
          return this;
        }
        this.max = max2;
        _addOrRemoveAttribute(this.eInput, "max", max2);
        return this;
      }
      setPrecision(precision) {
        this.precision = precision;
        return this;
      }
      setStep(step) {
        if (this.step === step) {
          return this;
        }
        this.step = step;
        _addOrRemoveAttribute(this.eInput, "step", step);
        return this;
      }
      setValue(value2, silent) {
        return this.setValueOrInputValue(
          (v) => super.setValue(v, silent),
          () => this,
          value2
        );
      }
      setStartValue(value2) {
        return this.setValueOrInputValue(
          (v) => super.setValue(v, true),
          (v) => {
            this.eInput.value = v;
          },
          value2
        );
      }
      setValueOrInputValue(setValueFunc, setInputValueOnlyFunc, value2) {
        if (_exists(value2)) {
          let setInputValueOnly = this.isScientificNotation(value2);
          if (setInputValueOnly && this.eInput.validity.valid) {
            return setValueFunc(value2);
          }
          if (!setInputValueOnly) {
            value2 = this.adjustPrecision(value2);
            const normalizedValue = this.normalizeValue(value2);
            setInputValueOnly = value2 != normalizedValue;
          }
          if (setInputValueOnly) {
            return setInputValueOnlyFunc(value2);
          }
        }
        return setValueFunc(value2);
      }
      getValue() {
        const eInput = this.eInput;
        if (!eInput.validity.valid) {
          return void 0;
        }
        const inputValue = eInput.value;
        if (this.isScientificNotation(inputValue)) {
          return this.adjustPrecision(inputValue, true);
        }
        return super.getValue();
      }
      isScientificNotation(value2) {
        return typeof value2 === "string" && value2.includes("e");
      }
    };
    var AgInputNumberFieldSelector = {
      selector: "AG-INPUT-NUMBER-FIELD",
      component: AgInputNumberField
    };
    var AgInputDateField = class extends AgInputTextField {
      constructor(config2) {
        super(config2, "ag-date-field", "date");
      }
      postConstruct() {
        super.postConstruct();
        const usingSafari = _isBrowserSafari();
        this.addManagedListeners(this.eInput, {
          wheel: this.onWheel.bind(this),
          mousedown: () => {
            if (this.isDisabled() || usingSafari) {
              return;
            }
            this.eInput.focus();
          }
        });
        this.eInput.step = "any";
      }
      onWheel(e) {
        if (_getActiveDomElement(this.beans) === this.eInput) {
          e.preventDefault();
        }
      }
      setMin(minDate) {
        const min2 = minDate instanceof Date ? _serialiseDate(minDate ?? null, !!this.includeTime) ?? void 0 : minDate;
        if (this.min === min2) {
          return this;
        }
        this.min = min2;
        _addOrRemoveAttribute(this.eInput, "min", min2);
        return this;
      }
      setMax(maxDate) {
        const max2 = maxDate instanceof Date ? _serialiseDate(maxDate ?? null, !!this.includeTime) ?? void 0 : maxDate;
        if (this.max === max2) {
          return this;
        }
        this.max = max2;
        _addOrRemoveAttribute(this.eInput, "max", max2);
        return this;
      }
      setStep(step) {
        if (this.step === step) {
          return this;
        }
        this.step = step;
        _addOrRemoveAttribute(this.eInput, "step", step);
        return this;
      }
      setIncludeTime(includeTime) {
        if (this.includeTime === includeTime) {
          return this;
        }
        this.includeTime = includeTime;
        super.setInputType(includeTime ? "datetime-local" : "date");
        if (includeTime) {
          this.setStep(1);
        }
        return this;
      }
      getDate() {
        if (!this.eInput.validity.valid) {
          return void 0;
        }
        return _parseDateTimeFromString(this.getValue()) ?? void 0;
      }
      setDate(date, silent) {
        this.setValue(_serialiseDate(date ?? null, this.includeTime), silent);
      }
    };
    var AgInputDateFieldSelector = {
      selector: "AG-INPUT-DATE-FIELD",
      component: AgInputDateField
    };
    var agListCSS = (
      /*css*/
      `.ag-list-item{align-items:center;display:flex;height:var(--ag-list-item-height);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;&.ag-active-item{background-color:var(--ag-row-hover-color)}}`
    );
    var ACTIVE_CLASS = "ag-active-item";
    var getAgListElement = (cssIdentifier, label2) => ({
      tag: "div",
      cls: `ag-list-item ag-${cssIdentifier}-list-item`,
      attrs: { role: "option" },
      children: [
        {
          tag: "span",
          ref: "eText",
          children: label2
        }
      ]
    });
    var AgListItem = class extends AgComponentStub {
      constructor(cssIdentifier, label2, value2) {
        super(getAgListElement(cssIdentifier, label2));
        this.label = label2;
        this.value = value2;
        this.eText = RefPlaceholder;
      }
      postConstruct() {
        this.createTooltip();
        this.addEventListeners();
      }
      setHighlighted(highlighted) {
        const eGui = this.getGui();
        eGui.classList.toggle(ACTIVE_CLASS, highlighted);
        _setAriaSelected(eGui, highlighted);
        this.dispatchLocalEvent({
          type: "itemHighlighted",
          highlighted
        });
      }
      getHeight() {
        return this.getGui().clientHeight;
      }
      setIndex(idx, setSize) {
        const eGui = this.getGui();
        _setAriaPosInSet(eGui, idx);
        _setAriaSetSize(eGui, setSize);
      }
      createTooltip() {
        const tooltipCtrl = {
          getTooltipValue: () => this.label,
          getGui: () => this.getGui(),
          getLocation: () => "UNKNOWN",
          // only show tooltips for items where the text cannot be fully displayed
          shouldDisplayTooltip: () => _isHorizontalScrollShowing(this.eText)
        };
        const tooltipFeature = this.createOptionalManagedBean(
          this.beans.registry.createDynamicBean(
            "highlightTooltipFeature",
            false,
            tooltipCtrl,
            this
          )
        );
        if (tooltipFeature) {
          this.tooltipFeature = tooltipFeature;
        }
      }
      addEventListeners() {
        const parentComponent = this.getParentComponent();
        if (!parentComponent) {
          return;
        }
        this.addGuiEventListener("mouseover", () => {
          parentComponent.highlightItem(this);
        });
        this.addGuiEventListener("mousedown", (e) => {
          e.preventDefault();
          e.stopPropagation();
          parentComponent.setValue(this.value);
        });
      }
    };
    var AgList = class extends AgComponentStub {
      constructor(cssIdentifier = "default") {
        super({ tag: "div", cls: `ag-list ag-${cssIdentifier}-list` });
        this.cssIdentifier = cssIdentifier;
        this.options = [];
        this.listItems = [];
        this.highlightedItem = null;
        this.registerCSS(agListCSS);
      }
      postConstruct() {
        const eGui = this.getGui();
        this.addManagedElementListeners(eGui, { mouseleave: () => this.clearHighlighted() });
      }
      handleKeyDown(e) {
        const key2 = e.key;
        switch (key2) {
          case KeyCode.ENTER:
            if (!this.highlightedItem) {
              this.setValue(this.getValue());
            } else {
              const pos2 = this.listItems.indexOf(this.highlightedItem);
              this.setValueByIndex(pos2);
            }
            break;
          case KeyCode.DOWN:
          case KeyCode.UP:
            e.preventDefault();
            this.navigate(key2);
            break;
          case KeyCode.PAGE_DOWN:
          case KeyCode.PAGE_UP:
          case KeyCode.PAGE_HOME:
          case KeyCode.PAGE_END:
            e.preventDefault();
            this.navigateToPage(key2);
            break;
        }
      }
      addOptions(listOptions) {
        for (const listOption of listOptions) {
          this.addOption(listOption);
        }
        return this;
      }
      addOption(listOption) {
        const { value: value2, text: text2 } = listOption;
        const valueToRender = text2 ?? value2;
        this.options.push({ value: value2, text: valueToRender });
        this.renderOption(value2, valueToRender);
        this.updateIndices();
        return this;
      }
      clearOptions() {
        this.options = [];
        this.reset(true);
        for (const item2 of this.listItems) {
          item2.destroy();
        }
        _clearElement(this.getGui());
        this.listItems = [];
        this.refreshAriaRole();
      }
      setValue(value2, silent) {
        if (this.value === value2) {
          this.fireItemSelected();
          return this;
        }
        if (value2 == null) {
          this.reset(silent);
          return this;
        }
        const idx = this.options.findIndex((option) => option.value === value2);
        if (idx !== -1) {
          const option = this.options[idx];
          this.value = option.value;
          this.displayValue = option.text;
          this.highlightItem(this.listItems[idx]);
          if (!silent) {
            this.fireChangeEvent();
          }
        }
        return this;
      }
      setValueByIndex(idx) {
        return this.setValue(this.options[idx].value);
      }
      getValue() {
        return this.value;
      }
      getDisplayValue() {
        return this.displayValue;
      }
      refreshHighlighted() {
        this.clearHighlighted();
        const idx = this.options.findIndex((option) => option.value === this.value);
        if (idx !== -1) {
          this.highlightItem(this.listItems[idx]);
        }
      }
      highlightItem(item2) {
        const itemEl = item2.getGui();
        if (!_isVisible(itemEl)) {
          return;
        }
        this.clearHighlighted();
        item2.setHighlighted(true);
        this.highlightedItem = item2;
        const eGui = this.getGui();
        const { scrollTop, clientHeight } = eGui;
        const { offsetTop, offsetHeight } = itemEl;
        if (offsetTop + offsetHeight > scrollTop + clientHeight || offsetTop < scrollTop) {
          itemEl.scrollIntoView({ block: "nearest" });
        }
      }
      hideItemTooltip() {
        this.highlightedItem?.tooltipFeature?.attemptToHideTooltip();
      }
      destroy() {
        this.hideItemTooltip();
        super.destroy();
      }
      reset(silent) {
        this.value = null;
        this.displayValue = null;
        this.clearHighlighted();
        if (!silent) {
          this.fireChangeEvent();
        }
      }
      clearHighlighted() {
        this.highlightedItem?.setHighlighted(false);
        this.highlightedItem = null;
      }
      renderOption(value2, text2) {
        const item2 = new AgListItem(this.cssIdentifier, text2, value2);
        item2.setParentComponent(this);
        const listItem = this.createManagedBean(item2);
        this.listItems.push(listItem);
        this.getGui().appendChild(listItem.getGui());
      }
      navigate(key2) {
        const isDown = key2 === KeyCode.DOWN;
        let itemToHighlight;
        const { listItems, highlightedItem } = this;
        if (!highlightedItem) {
          itemToHighlight = isDown ? listItems[0] : _last(listItems);
        } else {
          const currentIdx = listItems.indexOf(highlightedItem);
          let nextPos = currentIdx + (isDown ? 1 : -1);
          nextPos = Math.min(Math.max(nextPos, 0), listItems.length - 1);
          itemToHighlight = listItems[nextPos];
        }
        this.highlightItem(itemToHighlight);
      }
      navigateToPage(key2) {
        const { listItems, highlightedItem } = this;
        if (!highlightedItem || listItems.length === 0) {
          return;
        }
        const currentIdx = listItems.indexOf(highlightedItem);
        const rowCount = this.options.length - 1;
        const itemHeight = listItems[0].getHeight();
        const pageSize = Math.floor(this.getGui().clientHeight / itemHeight);
        let newIndex = -1;
        if (key2 === KeyCode.PAGE_HOME) {
          newIndex = 0;
        } else if (key2 === KeyCode.PAGE_END) {
          newIndex = rowCount;
        } else if (key2 === KeyCode.PAGE_DOWN) {
          newIndex = Math.min(currentIdx + pageSize, rowCount);
        } else if (key2 === KeyCode.PAGE_UP) {
          newIndex = Math.max(currentIdx - pageSize, 0);
        }
        if (newIndex === -1) {
          return;
        }
        this.highlightItem(listItems[newIndex]);
      }
      refreshAriaRole() {
        _setAriaRole(this.getGui(), this.options.length === 0 ? "presentation" : "listbox");
      }
      updateIndices() {
        this.refreshAriaRole();
        const listItems = this.listItems;
        const len = listItems.length;
        listItems.forEach((item2, idx) => {
          item2.setIndex(idx + 1, len);
        });
      }
      fireChangeEvent() {
        this.dispatchLocalEvent({ type: "fieldValueChanged" });
        this.fireItemSelected();
      }
      fireItemSelected() {
        this.dispatchLocalEvent({ type: "selectedItem" });
      }
    };
    var agPickerFieldCSS = (
      /*css*/
      `.ag-picker-field-display{flex:1 1 auto}.ag-picker-field{align-items:center;display:flex}.ag-picker-field-icon{border:0;cursor:pointer;display:flex;margin:0;padding:0}.ag-picker-field-wrapper{background-color:var(--ag-picker-button-background-color);border:var(--ag-picker-button-border);border-radius:5px;min-height:max(var(--ag-list-item-height),calc(var(--ag-spacing)*4));overflow:hidden;&:where(.ag-picker-has-focus),&:where(:focus-within){background-color:var(--ag-picker-button-focus-background-color);border:var(--ag-picker-button-focus-border);box-shadow:var(--ag-focus-shadow);&:where(.invalid){box-shadow:var(--ag-focus-error-shadow)}}&:where(.invalid){background-color:var(--ag-input-invalid-background-color);border:var(--ag-input-invalid-border);color:var(--ag-input-invalid-text-color)}&:disabled{opacity:.5}}`
    );
    var AgPickerFieldElement = {
      tag: "div",
      cls: "ag-picker-field",
      role: "presentation",
      children: [
        { tag: "div", ref: "eLabel" },
        {
          tag: "div",
          ref: "eWrapper",
          cls: "ag-wrapper ag-picker-field-wrapper ag-picker-collapsed",
          children: [
            { tag: "div", ref: "eDisplayField", cls: "ag-picker-field-display" },
            { tag: "div", ref: "eIcon", cls: "ag-picker-field-icon", attrs: { "aria-hidden": "true" } }
          ]
        }
      ]
    };
    var AgPickerField = class extends AgAbstractField {
      constructor(config2) {
        super(config2, config2?.template || AgPickerFieldElement, config2?.agComponents || [], config2?.className);
        this.isPickerDisplayed = false;
        this.skipClick = false;
        this.pickerGap = 4;
        this.hideCurrentPicker = null;
        this.eLabel = RefPlaceholder;
        this.eWrapper = RefPlaceholder;
        this.eDisplayField = RefPlaceholder;
        this.eIcon = RefPlaceholder;
        this.registerCSS(agPickerFieldCSS);
        this.ariaRole = config2?.ariaRole;
        this.onPickerFocusIn = this.onPickerFocusIn.bind(this);
        this.onPickerFocusOut = this.onPickerFocusOut.bind(this);
        if (!config2) {
          return;
        }
        const { pickerGap, maxPickerHeight, variableWidth, minPickerWidth, maxPickerWidth } = config2;
        if (pickerGap != null) {
          this.pickerGap = pickerGap;
        }
        this.variableWidth = !!variableWidth;
        if (maxPickerHeight != null) {
          this.setPickerMaxHeight(maxPickerHeight);
        }
        if (minPickerWidth != null) {
          this.setPickerMinWidth(minPickerWidth);
        }
        if (maxPickerWidth != null) {
          this.setPickerMaxWidth(maxPickerWidth);
        }
      }
      postConstruct() {
        super.postConstruct();
        this.setupAria();
        const displayId = `ag-${this.getCompId()}-display`;
        this.eDisplayField.setAttribute("id", displayId);
        const ariaEl = this.getAriaElement();
        this.addManagedElementListeners(ariaEl, { keydown: this.onKeyDown.bind(this) });
        this.addManagedElementListeners(this.eLabel, { mousedown: this.onLabelOrWrapperMouseDown.bind(this) });
        this.addManagedElementListeners(this.eWrapper, { mousedown: this.onLabelOrWrapperMouseDown.bind(this) });
        const { pickerIcon, inputWidth } = this.config;
        if (pickerIcon) {
          const icon2 = this.beans.iconSvc.createIconNoSpan(pickerIcon);
          if (icon2) {
            this.eIcon.appendChild(icon2);
          }
        }
        if (inputWidth != null) {
          this.setInputWidth(inputWidth);
        }
      }
      setupAria() {
        const ariaEl = this.getAriaElement();
        ariaEl.setAttribute("tabindex", this.gos.get("tabIndex").toString());
        _setAriaExpanded(ariaEl, false);
        if (this.ariaRole) {
          _setAriaRole(ariaEl, this.ariaRole);
        }
      }
      onLabelOrWrapperMouseDown(e) {
        if (e) {
          const focusableEl = this.getFocusableElement();
          if (focusableEl !== this.eWrapper && e?.target === focusableEl) {
            return;
          }
          e.preventDefault();
          this.getFocusableElement().focus();
        }
        if (this.skipClick) {
          this.skipClick = false;
          return;
        }
        if (this.isDisabled()) {
          return;
        }
        if (this.isPickerDisplayed) {
          this.hidePicker();
        } else {
          this.showPicker();
        }
      }
      onKeyDown(e) {
        switch (e.key) {
          case KeyCode.UP:
          case KeyCode.DOWN:
          case KeyCode.ENTER:
          case KeyCode.SPACE:
            e.preventDefault();
            this.onLabelOrWrapperMouseDown();
            break;
          case KeyCode.ESCAPE:
            if (this.isPickerDisplayed) {
              e.preventDefault();
              e.stopPropagation();
              if (this.hideCurrentPicker) {
                this.hideCurrentPicker();
              }
            }
            break;
        }
      }
      showPicker() {
        this.isPickerDisplayed = true;
        if (!this.pickerComponent) {
          this.pickerComponent = this.createPickerComponent();
        }
        const pickerGui = this.pickerComponent.getGui();
        pickerGui.addEventListener("focusin", this.onPickerFocusIn);
        pickerGui.addEventListener("focusout", this.onPickerFocusOut);
        this.hideCurrentPicker = this.renderAndPositionPicker();
        this.toggleExpandedStyles(true);
      }
      renderAndPositionPicker() {
        const ePicker = this.pickerComponent.getGui();
        if (!this.gos.get("suppressScrollWhenPopupsAreOpen")) {
          [this.destroyMouseWheelFunc] = this.addManagedEventListeners({
            bodyScroll: () => {
              this.hidePicker();
            }
          });
        }
        const translate = this.getLocaleTextFunc();
        const {
          config: { pickerAriaLabelKey, pickerAriaLabelValue, modalPicker = true },
          maxPickerHeight,
          minPickerWidth,
          maxPickerWidth,
          variableWidth,
          beans,
          eWrapper
        } = this;
        const popupParams = {
          modal: modalPicker,
          eChild: ePicker,
          closeOnEsc: true,
          closedCallback: () => {
            const shouldRestoreFocus = _isNothingFocused(beans);
            this.beforeHidePicker();
            if (shouldRestoreFocus && this.isAlive()) {
              this.getFocusableElement().focus();
            }
          },
          ariaLabel: translate(pickerAriaLabelKey, pickerAriaLabelValue),
          anchorToElement: eWrapper
        };
        ePicker.style.position = "absolute";
        const popupSvc = beans.popupSvc;
        const addPopupRes = popupSvc.addPopup(popupParams);
        if (variableWidth) {
          if (minPickerWidth) {
            ePicker.style.minWidth = minPickerWidth;
          }
          ePicker.style.width = _formatSize(_getAbsoluteWidth(eWrapper));
          if (maxPickerWidth) {
            ePicker.style.maxWidth = maxPickerWidth;
          }
        } else {
          _setElementWidth(ePicker, maxPickerWidth ?? _getAbsoluteWidth(eWrapper));
        }
        const maxHeight = maxPickerHeight ?? `${_getInnerHeight(popupSvc.getPopupParent())}px`;
        ePicker.style.setProperty("max-height", maxHeight);
        this.alignPickerToComponent();
        return addPopupRes.hideFunc;
      }
      alignPickerToComponent() {
        if (!this.pickerComponent) {
          return;
        }
        const {
          pickerGap,
          config: { pickerType },
          beans: { popupSvc, gos },
          eWrapper,
          pickerComponent
        } = this;
        const alignSide = gos.get("enableRtl") ? "right" : "left";
        popupSvc.positionPopupByComponent({
          type: pickerType,
          eventSource: eWrapper,
          ePopup: pickerComponent.getGui(),
          position: "under",
          alignSide,
          keepWithinBounds: true,
          nudgeY: pickerGap
        });
      }
      beforeHidePicker() {
        if (this.destroyMouseWheelFunc) {
          this.destroyMouseWheelFunc();
          this.destroyMouseWheelFunc = void 0;
        }
        this.toggleExpandedStyles(false);
        const pickerGui = this.pickerComponent.getGui();
        pickerGui.removeEventListener("focusin", this.onPickerFocusIn);
        pickerGui.removeEventListener("focusout", this.onPickerFocusOut);
        this.isPickerDisplayed = false;
        this.pickerComponent = void 0;
        this.hideCurrentPicker = null;
      }
      toggleExpandedStyles(expanded) {
        if (!this.isAlive()) {
          return;
        }
        const ariaEl = this.getAriaElement();
        _setAriaExpanded(ariaEl, expanded);
        const classList = this.eWrapper.classList;
        classList.toggle("ag-picker-expanded", expanded);
        classList.toggle("ag-picker-collapsed", !expanded);
      }
      onPickerFocusIn() {
        this.togglePickerHasFocus(true);
      }
      onPickerFocusOut(e) {
        if (!this.pickerComponent?.getGui().contains(e.relatedTarget)) {
          this.togglePickerHasFocus(false);
        }
      }
      togglePickerHasFocus(focused) {
        if (!this.pickerComponent) {
          return;
        }
        this.eWrapper.classList.toggle("ag-picker-has-focus", focused);
      }
      hidePicker() {
        if (this.hideCurrentPicker) {
          this.hideCurrentPicker();
          this.dispatchLocalEvent({
            type: "pickerHidden"
          });
        }
      }
      setInputWidth(width) {
        _setElementWidth(this.eWrapper, width);
        return this;
      }
      getFocusableElement() {
        return this.eWrapper;
      }
      setPickerGap(gap2) {
        this.pickerGap = gap2;
        return this;
      }
      setPickerMinWidth(width) {
        if (typeof width === "number") {
          width = `${width}px`;
        }
        this.minPickerWidth = width == null ? void 0 : width;
        return this;
      }
      setPickerMaxWidth(width) {
        if (typeof width === "number") {
          width = `${width}px`;
        }
        this.maxPickerWidth = width == null ? void 0 : width;
        return this;
      }
      setPickerMaxHeight(height) {
        if (typeof height === "number") {
          height = `${height}px`;
        }
        this.maxPickerHeight = height == null ? void 0 : height;
        return this;
      }
      destroy() {
        this.hidePicker();
        super.destroy();
      }
    };
    var agSelectCSS = (
      /*css*/
      `.ag-select{align-items:center;display:flex;&.ag-disabled{opacity:.5}}:where(.ag-select){.ag-picker-field-wrapper{cursor:default}&.ag-disabled .ag-picker-field-wrapper:focus{box-shadow:none}&:not(.ag-cell-editor,.ag-label-align-top){min-height:var(--ag-list-item-height)}.ag-picker-field-display{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ag-picker-field-icon{align-items:center;display:flex}}:where(.ag-ltr) :where(.ag-select){.ag-picker-field-wrapper{padding-left:calc(var(--ag-cell-horizontal-padding)/2);padding-right:var(--ag-spacing)}}:where(.ag-rtl) :where(.ag-select){.ag-picker-field-wrapper{padding-left:var(--ag-spacing);padding-right:calc(var(--ag-cell-horizontal-padding)/2)}}.ag-select-list{background-color:var(--ag-picker-list-background-color);border:var(--ag-picker-list-border);border-radius:var(--ag-border-radius);box-shadow:var(--ag-dropdown-shadow);overflow:hidden auto}.ag-select-list-item{cursor:default;-webkit-user-select:none;-moz-user-select:none;user-select:none;:where(span){overflow:hidden;text-overflow:ellipsis;white-space:nowrap}}:where(.ag-ltr) .ag-select-list-item{padding-left:calc(var(--ag-cell-horizontal-padding)/2)}:where(.ag-rtl) .ag-select-list-item{padding-right:calc(var(--ag-cell-horizontal-padding)/2)}`
    );
    var AgSelect = class extends AgPickerField {
      constructor(config2) {
        super({
          pickerAriaLabelKey: "ariaLabelSelectField",
          pickerAriaLabelValue: "Select Field",
          pickerType: "ag-list",
          className: "ag-select",
          pickerIcon: "selectOpen",
          ariaRole: "combobox",
          ...config2
        });
        this.registerCSS(agSelectCSS);
      }
      postConstruct() {
        this.tooltipFeature = this.createOptionalManagedBean(
          this.beans.registry.createDynamicBean(
            "tooltipFeature",
            false,
            {
              shouldDisplayTooltip: _isElementOverflowingCallback(() => this.eDisplayField),
              getGui: () => this.getGui()
            }
          )
        );
        super.postConstruct();
        this.createListComponent();
        this.eWrapper.tabIndex = this.gos.get("tabIndex");
        const { options: options2, value: value2, placeholder } = this.config;
        if (options2 != null) {
          this.addOptions(options2);
        }
        if (value2 != null) {
          this.setValue(value2, true);
        }
        if (placeholder && value2 == null) {
          this.eDisplayField.textContent = placeholder;
        }
        this.addManagedElementListeners(this.eWrapper, { focusout: this.onWrapperFocusOut.bind(this) });
      }
      onWrapperFocusOut(e) {
        if (!this.eWrapper.contains(e.relatedTarget)) {
          this.hidePicker();
        }
      }
      createListComponent() {
        const listComponent = this.createBean(
          new AgList("select")
        );
        this.listComponent = listComponent;
        listComponent.setParentComponent(this);
        const eListAriaEl = listComponent.getAriaElement();
        const listId = `ag-select-list-${listComponent.getCompId()}`;
        eListAriaEl.setAttribute("id", listId);
        _setAriaControlsAndLabel(this.getAriaElement(), eListAriaEl);
        listComponent.addManagedElementListeners(listComponent.getGui(), {
          mousedown: (e) => {
            e?.preventDefault();
          }
        });
        listComponent.addManagedListeners(listComponent, {
          selectedItem: () => {
            this.hidePicker();
            this.dispatchLocalEvent({ type: "selectedItem" });
          },
          fieldValueChanged: () => {
            if (!this.listComponent) {
              return;
            }
            this.setValue(this.listComponent.getValue(), false, true);
            this.hidePicker();
          }
        });
      }
      createPickerComponent() {
        return this.listComponent;
      }
      beforeHidePicker() {
        this.listComponent?.hideItemTooltip();
        super.beforeHidePicker();
      }
      onKeyDown(e) {
        const { key: key2 } = e;
        if (key2 === KeyCode.TAB) {
          this.hidePicker();
        }
        switch (key2) {
          case KeyCode.ENTER:
          case KeyCode.UP:
          case KeyCode.DOWN:
          case KeyCode.PAGE_UP:
          case KeyCode.PAGE_DOWN:
          case KeyCode.PAGE_HOME:
          case KeyCode.PAGE_END:
            e.preventDefault();
            if (this.isPickerDisplayed) {
              this.listComponent?.handleKeyDown(e);
            } else {
              super.onKeyDown(e);
            }
            break;
          case KeyCode.ESCAPE:
            super.onKeyDown(e);
            break;
          case KeyCode.SPACE:
            if (this.isPickerDisplayed) {
              e.preventDefault();
            } else {
              super.onKeyDown(e);
            }
            break;
        }
      }
      showPicker() {
        const listComponent = this.listComponent;
        if (!listComponent) {
          return;
        }
        super.showPicker();
        listComponent.refreshHighlighted();
      }
      addOptions(options2) {
        for (const option of options2) {
          this.addOption(option);
        }
        return this;
      }
      addOption(option) {
        this.listComponent.addOption(option);
        return this;
      }
      clearOptions() {
        this.listComponent?.clearOptions();
        this.setValue(void 0, true);
        return this;
      }
      setValue(value2, silent, fromPicker) {
        const {
          listComponent,
          config: { placeholder },
          eDisplayField,
          tooltipFeature
        } = this;
        if (this.value === value2 || !listComponent) {
          return this;
        }
        if (!fromPicker) {
          listComponent.setValue(value2, true);
        }
        const newValue = listComponent.getValue();
        if (newValue === this.getValue()) {
          return this;
        }
        let displayValue = listComponent.getDisplayValue();
        if (displayValue == null && placeholder) {
          displayValue = placeholder;
        }
        eDisplayField.textContent = displayValue;
        tooltipFeature?.setTooltipAndRefresh(displayValue ?? null);
        return super.setValue(value2, silent);
      }
      destroy() {
        this.listComponent = this.destroyBean(this.listComponent);
        super.destroy();
      }
    };
    var AgSelectSelector = {
      selector: "AG-SELECT",
      component: AgSelect
    };
    var sharedCSS = (
      /*css*/
      `:where(.ag-root-wrapper,.ag-external,.ag-popup,.ag-dnd-ghost,.ag-chart),:where(.ag-root-wrapper,.ag-external,.ag-popup,.ag-dnd-ghost,.ag-chart) :where([class^=ag-]){box-sizing:border-box;&:after,&:before{box-sizing:border-box}&:where(div,span,label):focus-visible{box-shadow:inset var(--ag-focus-shadow);outline:none;&:where(.invalid){box-shadow:inset var(--ag-focus-error-shadow)}}&:where(button){color:inherit}}:where(.ag-root-wrapper,ag-external,.ag-popup,.ag-dnd-ghost,.ag-chart) :where([class^=ag-]) ::-ms-clear{display:none}.ag-hidden{display:none!important}.ag-invisible{visibility:hidden!important}.ag-popup-child{top:0;z-index:5;&:where(:not(.ag-tooltip-custom)){box-shadow:var(--ag-popup-shadow)}}.ag-input-wrapper,.ag-picker-field-wrapper{align-items:center;display:flex;flex:1 1 auto;line-height:normal;position:relative}.ag-input-field{align-items:center;display:flex;flex-direction:row}.ag-input-field-input:where(:not([type=checkbox],[type=radio])){flex:1 1 auto;min-width:0;width:100%}.ag-chart,.ag-dnd-ghost,.ag-external,.ag-popup,.ag-root-wrapper{cursor:default;line-height:normal;white-space:normal;-webkit-font-smoothing:antialiased;background-color:var(--ag-background-color);color:var(--ag-text-color);color-scheme:var(--ag-browser-color-scheme);font-family:var(--ag-font-family);font-size:var(--ag-font-size);--ag-indentation-level:0}:where(.ag-icon):before{align-items:center;background-color:currentcolor;color:inherit;content:"";display:flex;font-family:inherit;font-size:var(--ag-icon-size);font-style:normal;font-variant:normal;height:var(--ag-icon-size);justify-content:center;line-height:var(--ag-icon-size);-webkit-mask-size:contain;mask-size:contain;text-transform:none;width:var(--ag-icon-size)}.ag-icon{background-position:50%;background-repeat:no-repeat;background-size:contain;color:var(--ag-icon-color);display:block;height:var(--ag-icon-size);position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:var(--ag-icon-size)}.ag-disabled,[disabled]{.ag-icon{opacity:.5}&.ag-icon-grip{opacity:.35}}.ag-resizer{pointer-events:none;position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none;z-index:1}:where(.ag-resizer){&.ag-resizer-topLeft{cursor:nwse-resize;height:5px;left:0;top:0;width:5px}&.ag-resizer-top{cursor:ns-resize;height:5px;left:5px;right:5px;top:0}&.ag-resizer-topRight{cursor:nesw-resize;height:5px;right:0;top:0;width:5px}&.ag-resizer-right{bottom:5px;cursor:ew-resize;right:0;top:5px;width:5px}&.ag-resizer-bottomRight{bottom:0;cursor:nwse-resize;height:5px;right:0;width:5px}&.ag-resizer-bottom{bottom:0;cursor:ns-resize;height:5px;left:5px;right:5px}&.ag-resizer-bottomLeft{bottom:0;cursor:nesw-resize;height:5px;left:0;width:5px}&.ag-resizer-left{bottom:5px;cursor:ew-resize;left:0;top:5px;width:5px}}`
    );
    var IS_SSR = typeof window !== "object" || !window?.document?.fonts?.forEach;
    var _injectGlobalCSS = (css2, styleContainer, debugId, layer2, priority, nonce) => {
      if (IS_SSR) {
        return;
      }
      if (layer2) {
        css2 = `@layer ${CSS.escape(layer2)} { ${css2} }`;
      }
      let injections = injectionState.map.get(styleContainer);
      if (!injections) {
        injections = [];
        injectionState.map.set(styleContainer, injections);
      }
      if (injections.some((i2) => i2.css === css2)) {
        return;
      }
      const el2 = document.createElement("style");
      if (nonce) {
        el2.setAttribute("nonce", nonce);
      }
      el2.dataset.agGlobalCss = debugId;
      el2.textContent = css2;
      const newInjection = { css: css2, el: el2, priority };
      let insertAfter;
      for (const injection of injections) {
        if (injection.priority > priority) {
          break;
        }
        insertAfter = injection;
      }
      if (insertAfter) {
        insertAfter.el.insertAdjacentElement("afterend", el2);
        const index = injections.indexOf(insertAfter);
        injections.splice(index + 1, 0, newInjection);
      } else {
        styleContainer.insertBefore(el2, styleContainer.querySelector(":not(title, meta)"));
        injections.push(newInjection);
      }
    };
    var _injectCoreAndModuleCSS = (styleContainer, layer2, nonce, moduleCss) => {
      _injectGlobalCSS(sharedCSS, styleContainer, "shared", layer2, 0, nonce);
      moduleCss?.forEach(
        (css2, debugId) => css2.forEach((singleCss) => _injectGlobalCSS(singleCss, styleContainer, debugId, layer2, 0, nonce))
      );
    };
    var _registerInstanceUsingThemingAPI = (environment) => {
      injectionState.grids.add(environment);
    };
    var _unregisterInstanceUsingThemingAPI = (environment) => {
      injectionState.grids.delete(environment);
      if (injectionState.grids.size === 0) {
        injectionState.map = /* @__PURE__ */ new WeakMap();
        for (const style2 of document.head.querySelectorAll("style[data-ag-global-css]")) {
          style2.remove();
        }
      }
    };
    var _a$4;
    var injectionState = (_a$4 = typeof window === "object" ? window : {}).agStyleInjectionState ?? (_a$4.agStyleInjectionState = {
      map: /* @__PURE__ */ new WeakMap(),
      grids: /* @__PURE__ */ new Set()
    });
    var createPart = (args2) => {
      return new PartImpl(args2);
    };
    var defaultModeName = "$default";
    var partCounter = 0;
    var PartImpl = class {
      constructor({ feature, params, modeParams = {}, css: css2, cssImports }) {
        this.feature = feature;
        this.css = css2;
        this.cssImports = cssImports;
        this.modeParams = {
          // NOTE: it's important that default is defined first, putting it
          // first in iteration order, because when merging params the default
          // params override any prior modal params, so modal params in this
          // part need to come after default params to prevent them from being
          // immediately overridden.
          [defaultModeName]: {
            ...modeParams[defaultModeName] ?? {},
            ...params ?? {}
          },
          ...modeParams
        };
      }
      use(styleContainer, layer2, nonce) {
        let inject = this._inject;
        if (inject == null) {
          let { css: css2 } = this;
          if (css2) {
            const className2 = `ag-theme-${this.feature ?? "part"}-${++partCounter}`;
            if (typeof css2 === "function") {
              css2 = css2();
            }
            css2 = `:where(.${className2}) {
${css2}
}
`;
            for (const cssImport of this.cssImports ?? []) {
              css2 = `@import url(${JSON.stringify(cssImport)});
${css2}`;
            }
            inject = { css: css2, class: className2 };
          } else {
            inject = false;
          }
          this._inject = inject;
        }
        if (inject && styleContainer) {
          _injectGlobalCSS(inject.css, styleContainer, inject.class, layer2, 1, nonce);
        }
        return inject ? inject.class : false;
      }
    };
    var kebabCase = (str2) => str2.replace(/[A-Z]/g, (m) => `-${m}`).toLowerCase();
    var paramToVariableName = (paramName) => `--ag-${kebabCase(paramName)}`;
    var paramToVariableExpression = (paramName) => `var(${paramToVariableName(paramName)})`;
    var clamp$1 = (value2, min2, max2) => Math.max(min2, Math.min(max2, value2));
    var memoize = (fn2) => {
      const values = /* @__PURE__ */ new Map();
      return (a) => {
        const key2 = a;
        if (!values.has(key2)) {
          values.set(key2, fn2(a));
        }
        return values.get(key2);
      };
    };
    var accentMix = (mix) => ({ ref: "accentColor", mix });
    var foregroundMix = (mix) => ({ ref: "foregroundColor", mix });
    var foregroundBackgroundMix = (mix) => ({
      ref: "foregroundColor",
      mix,
      onto: "backgroundColor"
    });
    var foregroundHeaderBackgroundMix = (mix) => ({
      ref: "foregroundColor",
      mix,
      onto: "headerBackgroundColor"
    });
    var backgroundColor = { ref: "backgroundColor" };
    var foregroundColor = { ref: "foregroundColor" };
    var accentColor = { ref: "accentColor" };
    var defaultLightColorSchemeParams = {
      backgroundColor: "#fff",
      foregroundColor: "#181d1f",
      borderColor: foregroundMix(0.15),
      chromeBackgroundColor: foregroundBackgroundMix(0.02),
      browserColorScheme: "light"
    };
    var sharedDefaults = {
      ...defaultLightColorSchemeParams,
      textColor: foregroundColor,
      accentColor: "#2196f3",
      invalidColor: "#e02525",
      fontFamily: [
        "-apple-system",
        "BlinkMacSystemFont",
        "Segoe UI",
        "Roboto",
        "Oxygen-Sans",
        "Ubuntu",
        "Cantarell",
        "Helvetica Neue",
        "sans-serif"
      ],
      subtleTextColor: {
        ref: "textColor",
        mix: 0.5
      },
      borderWidth: 1,
      borderRadius: 4,
      spacing: 8,
      fontSize: 14,
      focusShadow: {
        spread: 3,
        color: accentMix(0.5)
      },
      focusErrorShadow: {
        spread: 3,
        color: {
          ref: "invalidColor",
          onto: "backgroundColor",
          mix: 0.5
        }
      },
      popupShadow: "0 0 16px #00000026",
      cardShadow: "0 1px 4px 1px #00000018",
      dropdownShadow: { ref: "cardShadow" },
      listItemHeight: {
        calc: "max(iconSize, dataFontSize) + widgetVerticalSpacing"
      },
      dragAndDropImageBackgroundColor: backgroundColor,
      dragAndDropImageBorder: true,
      dragAndDropImageNotAllowedBorder: {
        color: {
          ref: "invalidColor",
          onto: "dragAndDropImageBackgroundColor",
          mix: 0.5
        }
      },
      dragAndDropImageShadow: {
        ref: "popupShadow"
      },
      iconSize: 16,
      iconColor: "inherit",
      toggleButtonWidth: 28,
      toggleButtonHeight: 18,
      toggleButtonOnBackgroundColor: accentColor,
      toggleButtonOffBackgroundColor: foregroundBackgroundMix(0.3),
      toggleButtonSwitchBackgroundColor: backgroundColor,
      toggleButtonSwitchInset: 2,
      tooltipBackgroundColor: {
        ref: "chromeBackgroundColor"
      },
      tooltipErrorBackgroundColor: {
        ref: "invalidColor",
        onto: "backgroundColor",
        mix: 0.1
      },
      tooltipTextColor: {
        ref: "textColor"
      },
      tooltipErrorTextColor: {
        ref: "invalidColor"
      },
      tooltipBorder: true,
      tooltipErrorBorder: {
        color: {
          ref: "invalidColor",
          onto: "backgroundColor",
          mix: 0.25
        }
      }
    };
    var paramTypes = [
      "colorScheme",
      "color",
      "length",
      "scale",
      "borderStyle",
      "border",
      "shadow",
      "image",
      "fontFamily",
      "fontWeight",
      "duration"
    ];
    var getParamType = memoize((param) => {
      param = param.toLowerCase();
      return paramTypes.find((type) => param.endsWith(type.toLowerCase())) ?? "length";
    });
    var literalToCSS = (value2) => {
      if (typeof value2 === "object" && value2?.ref) {
        return paramToVariableExpression(value2.ref);
      }
      if (typeof value2 === "string") {
        return value2;
      }
      if (typeof value2 === "number") {
        return String(value2);
      }
      return false;
    };
    var colorValueToCss = (value2) => {
      if (typeof value2 === "string") {
        return value2;
      }
      if (value2 && "ref" in value2) {
        const colorExpr = paramToVariableExpression(value2.ref);
        if (value2.mix == null) {
          return colorExpr;
        }
        const backgroundExpr = value2.onto ? paramToVariableExpression(value2.onto) : "transparent";
        return `color-mix(in srgb, ${backgroundExpr}, ${colorExpr} ${clamp$1(value2.mix * 100, 0, 100)}%)`;
      }
      return false;
    };
    var colorSchemeValueToCss = literalToCSS;
    var lengthValueToCss = (value2) => {
      if (typeof value2 === "string") {
        return value2;
      }
      if (typeof value2 === "number") {
        return `${value2}px`;
      }
      if (value2 && "calc" in value2) {
        const valueWithSpaces = value2.calc.replace(/ ?[*/+] ?/g, " $& ");
        return `calc(${valueWithSpaces.replace(/-?\b[a-z][a-z0-9]*\b(?![-(])/gi, (p) => p[0] === "-" ? p : " " + paramToVariableExpression(p) + " ")})`;
      }
      if (value2 && "ref" in value2) {
        return paramToVariableExpression(value2.ref);
      }
      return false;
    };
    var scaleValueToCss = literalToCSS;
    var borderValueToCss = (value2, param) => {
      if (typeof value2 === "string") {
        return value2;
      }
      if (value2 === true) {
        return borderValueToCss({}, param);
      }
      if (value2 === false) {
        return param === "columnBorder" ? borderValueToCss({ color: "transparent" }, param) : "none";
      }
      if (value2 && "ref" in value2) {
        return paramToVariableExpression(value2.ref);
      }
      return borderStyleValueToCss(value2.style ?? "solid") + " " + lengthValueToCss(value2.width ?? { ref: "borderWidth" }) + " " + colorValueToCss(value2.color ?? { ref: "borderColor" });
    };
    var shadowValueToCss = (value2) => {
      if (typeof value2 === "string") {
        return value2;
      }
      if (value2 === false) {
        return "none";
      }
      if (value2 && "ref" in value2) {
        return paramToVariableExpression(value2.ref);
      }
      return [
        lengthValueToCss(value2.offsetX ?? 0),
        lengthValueToCss(value2.offsetY ?? 0),
        lengthValueToCss(value2.radius ?? 0),
        lengthValueToCss(value2.spread ?? 0),
        colorValueToCss(value2.color ?? { ref: "foregroundColor" })
      ].join(" ");
    };
    var borderStyleValueToCss = literalToCSS;
    var fontFamilyValueToCss = (value2) => {
      if (typeof value2 === "string") {
        return value2.includes(",") ? value2 : quoteUnsafeChars(value2);
      }
      if (value2 && "googleFont" in value2) {
        return fontFamilyValueToCss(value2.googleFont);
      }
      if (value2 && "ref" in value2) {
        return paramToVariableExpression(value2.ref);
      }
      if (Array.isArray(value2)) {
        return value2.map((font) => {
          if (typeof font === "object" && "googleFont" in font) {
            font = font.googleFont;
          }
          return quoteUnsafeChars(font);
        }).join(", ");
      }
      return false;
    };
    var quoteUnsafeChars = (font) => (
      // don't quote var() expressions or quote safe identifier names, so that
      // people can specify fonts like sans-serif which are keywords not strings,
      // or var(--my-var)
      /^[\w-]+$|\w\(/.test(font) ? font : JSON.stringify(font)
    );
    var fontWeightValueToCss = literalToCSS;
    var imageValueToCss = (value2) => {
      if (typeof value2 === "string") {
        return value2;
      }
      if (value2 && "url" in value2) {
        return `url(${JSON.stringify(value2.url)})`;
      }
      if (value2 && "svg" in value2) {
        return imageValueToCss({ url: `data:image/svg+xml,${encodeURIComponent(value2.svg)}` });
      }
      if (value2 && "ref" in value2) {
        return paramToVariableExpression(value2.ref);
      }
      return false;
    };
    var durationValueToCss = (value2, param, themeLogger) => {
      if (typeof value2 === "string") {
        return value2;
      }
      if (typeof value2 === "number") {
        if (value2 >= 10) {
          themeLogger.warn(104, { value: value2, param });
        }
        return `${value2}s`;
      }
      if (value2 && "ref" in value2) {
        return paramToVariableExpression(value2.ref);
      }
      return false;
    };
    var paramValidators = {
      color: colorValueToCss,
      colorScheme: colorSchemeValueToCss,
      length: lengthValueToCss,
      scale: scaleValueToCss,
      border: borderValueToCss,
      borderStyle: borderStyleValueToCss,
      shadow: shadowValueToCss,
      image: imageValueToCss,
      fontFamily: fontFamilyValueToCss,
      fontWeight: fontWeightValueToCss,
      duration: durationValueToCss
    };
    var paramValueToCss = (param, value2, themeLogger) => {
      const type = getParamType(param);
      return paramValidators[type](value2, param, themeLogger);
    };
    var createSharedTheme = (themeLogger) => new ThemeImpl(themeLogger);
    var ThemeImpl = class _ThemeImpl {
      constructor(themeLogger, parts = []) {
        this.themeLogger = themeLogger;
        this.parts = parts;
      }
      withPart(part2) {
        if (typeof part2 === "function") {
          part2 = part2();
        }
        if (!(part2 instanceof PartImpl)) {
          this.themeLogger.preInitErr(259, "Invalid part", { part: part2 });
          return this;
        }
        return new _ThemeImpl(this.themeLogger, [...this.parts, part2]);
      }
      withoutPart(feature) {
        return this.withPart(createPart({ feature }));
      }
      withParams(params, mode = defaultModeName) {
        return this.withPart(
          createPart({
            modeParams: { [mode]: params }
          })
        );
      }
      /**
       * Called by a grid instance when it starts using the theme. This installs
       * the theme's parts into document head, or the shadow DOM if the provided
       * container is within a shadow root.
       */
      _startUse({ styleContainer, cssLayer, nonce, loadThemeGoogleFonts, moduleCss }) {
        if (IS_SSR) {
          return;
        }
        uninstallLegacyCSS();
        _injectCoreAndModuleCSS(styleContainer, cssLayer, nonce, moduleCss);
        const googleFontsUsed = getGoogleFontsUsed(this);
        if (googleFontsUsed.length > 0) {
          for (const googleFont of googleFontsUsed) {
            if (loadThemeGoogleFonts) {
              loadGoogleFont(googleFont, nonce);
            }
          }
        }
        for (const part2 of this.parts) {
          part2.use(styleContainer, cssLayer, nonce);
        }
      }
      /**
       * Return CSS that that applies the params of this theme to elements with
       * the provided class name
       */
      _getCssClass() {
        return this._cssClassCache ?? (this._cssClassCache = deduplicatePartsByFeature(this.parts).map((part2) => part2.use(void 0, void 0, void 0)).filter(Boolean).join(" "));
      }
      _getModeParams() {
        let paramsCache = this._paramsCache;
        if (!paramsCache) {
          const mergedModeParams = {
            // NOTE: defining the default mode here is important, it ensures
            // that the default mode is first in iteration order, which puts
            // it first in outputted CSS, allowing other modes to override it
            [defaultModeName]: { ...sharedDefaults }
          };
          for (const part2 of deduplicatePartsByFeature(this.parts)) {
            for (const partMode of Object.keys(part2.modeParams)) {
              const partParams = part2.modeParams[partMode];
              if (partParams) {
                const mergedParams = mergedModeParams[partMode] ?? (mergedModeParams[partMode] = {});
                const partParamNames = /* @__PURE__ */ new Set();
                for (const partParamName of Object.keys(partParams)) {
                  const partParamValue = partParams[partParamName];
                  if (partParamValue !== void 0) {
                    mergedParams[partParamName] = partParamValue;
                    partParamNames.add(partParamName);
                  }
                }
                if (partMode === defaultModeName) {
                  for (const mergedMode of Object.keys(mergedModeParams)) {
                    const mergedParams2 = mergedModeParams[mergedMode];
                    if (mergedMode !== defaultModeName) {
                      for (const partParamName of partParamNames) {
                        delete mergedParams2[partParamName];
                      }
                    }
                  }
                }
              }
            }
          }
          this._paramsCache = paramsCache = mergedModeParams;
        }
        return paramsCache;
      }
      /**
       * Return the CSS chunk that is inserted into the grid DOM, and will
       * therefore be removed automatically when the grid is destroyed or it
       * starts to use a new theme.
       *
       * @param className a unique class name on the grid wrapper used to scope the returned CSS to the grid instance
       */
      _getPerInstanceCss(className2) {
        const selectorPlaceholder = "##SELECTOR##";
        let innerParamsCss = this._paramsCssCache;
        if (!innerParamsCss) {
          let variablesCss = "";
          let inheritanceCss = "";
          const modeParams = this._getModeParams();
          for (const mode of Object.keys(modeParams)) {
            const params = modeParams[mode];
            if (mode !== defaultModeName) {
              const escapedMode = typeof CSS === "object" ? CSS.escape(mode) : mode;
              const wrapPrefix = `:where([data-ag-theme-mode="${escapedMode}"]) & {
`;
              variablesCss += wrapPrefix;
              inheritanceCss += wrapPrefix;
            }
            for (const key2 of Object.keys(params).sort()) {
              const value2 = params[key2];
              const cssValue = paramValueToCss(key2, value2, this.themeLogger);
              if (cssValue === false) {
                this.themeLogger.error(107, { key: key2, value: value2 });
              } else {
                const cssName = paramToVariableName(key2);
                const inheritedName = cssName.replace("--ag-", "--ag-inherited-");
                variablesCss += `	${cssName}: var(${inheritedName}, ${cssValue});
`;
                inheritanceCss += `	${inheritedName}: var(${cssName});
`;
              }
            }
            if (mode !== defaultModeName) {
              variablesCss += "}\n";
              inheritanceCss += "}\n";
            }
          }
          let css2 = `${selectorPlaceholder} {
${variablesCss}}
`;
          css2 += `:has(> ${selectorPlaceholder}):not(${selectorPlaceholder}) {
${inheritanceCss}}
`;
          this._paramsCssCache = innerParamsCss = css2;
        }
        return innerParamsCss.replaceAll(selectorPlaceholder, `:where(.${className2})`);
      }
    };
    var deduplicatePartsByFeature = (parts) => {
      const lastPartByFeature = /* @__PURE__ */ new Map();
      for (const part2 of parts) {
        lastPartByFeature.set(part2.feature, part2);
      }
      const result2 = [];
      for (const part2 of parts) {
        if (!part2.feature || lastPartByFeature.get(part2.feature) === part2) {
          result2.push(part2);
        }
      }
      return result2;
    };
    var getGoogleFontsUsed = (theme2) => {
      const googleFontsUsed = /* @__PURE__ */ new Set();
      const visitParamValue = (paramValue) => {
        if (Array.isArray(paramValue)) {
          paramValue.forEach(visitParamValue);
        } else {
          const googleFont = paramValue?.googleFont;
          if (typeof googleFont === "string") {
            googleFontsUsed.add(googleFont);
          }
        }
      };
      const allModeValues = Object.values(theme2._getModeParams());
      const allValues = allModeValues.flatMap((mv) => Object.values(mv));
      allValues.forEach(visitParamValue);
      return Array.from(googleFontsUsed).sort();
    };
    var uninstalledLegacyCSS = false;
    var uninstallLegacyCSS = () => {
      if (uninstalledLegacyCSS) {
        return;
      }
      uninstalledLegacyCSS = true;
      for (const style2 of Array.from(document.head.querySelectorAll('style[data-ag-scope="legacy"]'))) {
        style2.remove();
      }
    };
    var loadGoogleFont = async (font, nonce) => {
      const css2 = `@import url('https://${googleFontsDomain}/css2?family=${encodeURIComponent(font)}:wght@100;200;300;400;500;600;700;800;900&display=swap');
`;
      _injectGlobalCSS(css2, document.head, `googleFont:${font}`, void 0, 0, nonce);
    };
    var googleFontsDomain = "fonts.googleapis.com";
    var contextId = 1;
    var AgContext = class {
      constructor(params) {
        this.beans = {};
        this.createdBeans = [];
        this.destroyed = false;
        this.instanceId = contextId++;
        if (!params?.beanClasses) {
          return;
        }
        this.beanDestroyComparator = params.beanDestroyComparator;
        this.init(params);
      }
      init(params) {
        this.id = params.id;
        this.beans.context = this;
        this.destroyCallback = params.destroyCallback;
        for (const beanName of Object.keys(params.providedBeanInstances)) {
          this.beans[beanName] = params.providedBeanInstances[beanName];
        }
        for (const BeanClass of params.beanClasses) {
          const instance = new BeanClass();
          if (instance.beanName) {
            this.beans[instance.beanName] = instance;
          } else {
            console.error(`Bean ${BeanClass.name} is missing beanName`);
          }
          this.createdBeans.push(instance);
        }
        for (const beanFunc of params.derivedBeans ?? []) {
          const { beanName, bean } = beanFunc(this);
          this.beans[beanName] = bean;
          this.createdBeans.push(bean);
        }
        if (params.beanInitComparator) {
          this.createdBeans.sort(params.beanInitComparator);
        }
        this.initBeans(this.createdBeans);
      }
      getBeanInstances() {
        return Object.values(this.beans);
      }
      createBean(bean, afterPreCreateCallback) {
        this.initBeans([bean], afterPreCreateCallback);
        return bean;
      }
      initBeans(beanInstances, afterPreCreateCallback) {
        const beans = this.beans;
        for (const instance of beanInstances) {
          instance.preWireBeans?.(beans);
          instance.wireBeans?.(beans);
        }
        for (const instance of beanInstances) {
          instance.preConstruct?.();
        }
        if (afterPreCreateCallback) {
          beanInstances.forEach(afterPreCreateCallback);
        }
        for (const instance of beanInstances) {
          instance.postConstruct?.();
        }
      }
      getBeans() {
        return this.beans;
      }
      getBean(name2) {
        return this.beans[name2];
      }
      getId() {
        return this.id;
      }
      destroy() {
        if (this.destroyed) {
          return;
        }
        this.destroyed = true;
        const beanInstances = this.getBeanInstances();
        if (this.beanDestroyComparator) {
          beanInstances.sort(this.beanDestroyComparator);
        }
        this.destroyBeans(beanInstances);
        this.beans = {};
        this.createdBeans = [];
        this.destroyCallback?.();
      }
      /**
       * Destroys a bean and returns undefined to support destruction and clean up in a single line.
       * this.dateComp = this.context.destroyBean(this.dateComp);
       */
      destroyBean(bean) {
        bean?.destroy?.();
      }
      /**
       * Destroys an array of beans and returns an empty array to support destruction and clean up in a single line.
       * this.dateComps = this.context.destroyBeans(this.dateComps);
       */
      destroyBeans(beans) {
        if (beans) {
          for (let i2 = 0; i2 < beans.length; i2++) {
            this.destroyBean(beans[i2]);
          }
        }
        return [];
      }
      isDestroyed() {
        return this.destroyed;
      }
    };
    var paramsId = 0;
    var BaseEnvironment = class extends AgBeanStub {
      constructor() {
        super(...arguments);
        this.beanName = "environment";
        this.paramsClass = `ag-theme-params-${++paramsId}`;
        this.globalCSS = [];
      }
      wireBeans(beans) {
        this.eRootDiv = beans.eRootDiv;
      }
      postConstruct() {
        const { gos, eRootDiv } = this;
        gos.setInstanceDomData(eRootDiv);
        this.eStyleContainer = gos.get("themeStyleContainer") ?? (eRootDiv.getRootNode() === document ? document.head : eRootDiv);
        this.cssLayer = gos.get("themeCssLayer");
        this.styleNonce = gos.get("styleNonce");
        this.addManagedPropertyListener("theme", () => this.handleThemeChange());
        this.handleThemeChange();
        this.initVariables();
        this.addDestroyFunc(() => _unregisterInstanceUsingThemingAPI(this));
        this.mutationObserver = new MutationObserver(() => {
          this.fireStylesChangedEvent("themeChanged");
        });
        this.addDestroyFunc(() => this.mutationObserver.disconnect());
      }
      applyThemeClasses(el2, extraClasses = []) {
        const { theme: theme2 } = this;
        let themeClass;
        if (theme2) {
          themeClass = `${this.paramsClass} ${theme2._getCssClass()}`;
        } else {
          themeClass = this.applyLegacyThemeClasses();
        }
        for (const className2 of Array.from(el2.classList)) {
          if (className2.startsWith("ag-theme-")) {
            el2.classList.remove(className2);
          }
        }
        if (themeClass) {
          const oldClass = el2.className;
          el2.className = `${oldClass}${oldClass ? " " : ""}${themeClass}${extraClasses?.length ? " " + extraClasses.join(" ") : ""}`;
        }
      }
      applyLegacyThemeClasses() {
        let themeClass = "";
        this.mutationObserver.disconnect();
        let node2 = this.eRootDiv;
        while (node2) {
          let isThemeEl = false;
          for (const className2 of Array.from(node2.classList)) {
            if (className2.startsWith("ag-theme-")) {
              isThemeEl = true;
              themeClass = themeClass ? `${themeClass} ${className2}` : className2;
            }
          }
          if (isThemeEl) {
            this.mutationObserver.observe(node2, {
              attributes: true,
              attributeFilter: ["class"]
            });
          }
          node2 = node2.parentElement;
        }
        return themeClass;
      }
      addGlobalCSS(css2, debugId) {
        if (this.theme) {
          _injectGlobalCSS(css2, this.eStyleContainer, debugId, this.cssLayer, 0, this.styleNonce);
        } else {
          this.globalCSS.push([css2, debugId]);
        }
      }
      handleThemeChange() {
        const { gos, theme: oldTheme } = this;
        const themeProperty = gos.get("theme");
        let newTheme;
        if (themeProperty === "legacy") {
          newTheme = void 0;
        } else {
          const themeOrDefault = themeProperty ?? this.getDefaultTheme();
          if (themeOrDefault instanceof ThemeImpl) {
            newTheme = themeOrDefault;
          } else {
            this.themeError(themeOrDefault);
          }
        }
        if (newTheme !== oldTheme) {
          this.handleNewTheme(newTheme);
        }
        this.postProcessThemeChange(newTheme, themeProperty);
      }
      handleNewTheme(newTheme) {
        const { gos, eRootDiv, globalCSS } = this;
        const additionalCss = this.getAdditionalCss();
        if (newTheme) {
          _registerInstanceUsingThemingAPI(this);
          _injectCoreAndModuleCSS(this.eStyleContainer, this.cssLayer, this.styleNonce, additionalCss);
          for (const [css2, debugId] of globalCSS) {
            _injectGlobalCSS(css2, this.eStyleContainer, debugId, this.cssLayer, 0, this.styleNonce);
          }
          globalCSS.length = 0;
        }
        this.theme = newTheme;
        newTheme?._startUse({
          loadThemeGoogleFonts: gos.get("loadThemeGoogleFonts"),
          styleContainer: this.eStyleContainer,
          cssLayer: this.cssLayer,
          nonce: this.styleNonce,
          moduleCss: additionalCss
        });
        let eParamsStyle = this.eParamsStyle;
        if (!eParamsStyle) {
          eParamsStyle = this.eParamsStyle = _createAgElement({ tag: "style" });
          const styleNonce = gos.get("styleNonce");
          if (styleNonce) {
            eParamsStyle.setAttribute("nonce", styleNonce);
          }
          eRootDiv.appendChild(eParamsStyle);
        }
        if (!IS_SSR) {
          eParamsStyle.textContent = newTheme?._getPerInstanceCss(this.paramsClass) || "";
        }
        this.applyThemeClasses(eRootDiv);
        this.fireStylesChangedEvent("themeChanged");
      }
    };
    var BaseRegistry = class extends AgBeanStub {
      constructor() {
        super(...arguments);
        this.beanName = "registry";
      }
      registerDynamicBeans(dynamicBeans) {
        if (dynamicBeans) {
          this.dynamicBeans ?? (this.dynamicBeans = {});
          for (const name2 of Object.keys(dynamicBeans)) {
            this.dynamicBeans[name2] = dynamicBeans[name2];
          }
        }
      }
      createDynamicBean(name2, mandatory, ...args2) {
        if (!this.dynamicBeans) {
          throw new Error(this.getDynamicError(name2, true));
        }
        const BeanClass = this.dynamicBeans[name2];
        if (BeanClass == null) {
          if (mandatory) {
            throw new Error(this.getDynamicError(name2, false));
          }
          return void 0;
        }
        return new BeanClass(...args2);
      }
    };
    var BaseEventService = class extends AgBeanStub {
      constructor() {
        super(...arguments);
        this.beanName = "eventSvc";
        this.eventServiceType = "global";
        this.globalSvc = new LocalEventService();
      }
      addListener(eventType, listener, async) {
        this.globalSvc.addEventListener(eventType, listener, async);
      }
      removeListener(eventType, listener, async) {
        this.globalSvc.removeEventListener(eventType, listener, async);
      }
      addGlobalListener(listener, async = false) {
        this.globalSvc.addGlobalListener(listener, async);
      }
      removeGlobalListener(listener, async = false) {
        this.globalSvc.removeGlobalListener(listener, async);
      }
      dispatchEvent(event) {
        this.globalSvc.dispatchEvent(this.gos.addCommon(event));
      }
      dispatchEventOnce(event) {
        this.globalSvc.dispatchEventOnce(this.gos.addCommon(event));
      }
    };
    var AgTooltipFeature = class extends AgBeanStub {
      constructor(ctrl, beans) {
        super();
        this.ctrl = ctrl;
        if (beans) {
          this.beans = beans;
        }
      }
      postConstruct() {
        this.refreshTooltip();
      }
      /**
       *
       * @param tooltip The tooltip value
       * @param allowEmptyString Set it to true to allow the title to be set to `''`. This is necessary
       * when the browser adds a default tooltip the element and the tooltip service will be displayed
       * next to a browser tooltip causing confusion.
       */
      setBrowserTooltip(tooltip, allowEmptyString) {
        const name2 = "title";
        const eGui = this.ctrl.getGui();
        if (!eGui) {
          return;
        }
        if (tooltip != null && (tooltip != "" || allowEmptyString)) {
          eGui.setAttribute(name2, tooltip);
        } else {
          eGui.removeAttribute(name2);
        }
      }
      updateTooltipText() {
        const { getTooltipValue } = this.ctrl;
        if (getTooltipValue) {
          this.tooltip = getTooltipValue();
        }
      }
      createTooltipFeatureIfNeeded() {
        if (this.tooltipManager == null) {
          const tooltipManager = this.beans.registry.createDynamicBean("tooltipStateManager", true, this.ctrl, () => this.tooltip);
          if (tooltipManager) {
            this.tooltipManager = this.createBean(tooltipManager, this.beans.context);
          }
        }
      }
      attemptToShowTooltip() {
        this.tooltipManager?.prepareToShowTooltip();
      }
      attemptToHideTooltip() {
        this.tooltipManager?.hideTooltip();
      }
      setTooltipAndRefresh(tooltip) {
        this.tooltip = tooltip;
        this.refreshTooltip();
      }
      refreshTooltip(clearWithEmptyString) {
        this.browserTooltips = this.beans.gos.get("enableBrowserTooltips");
        this.updateTooltipText();
        if (this.browserTooltips) {
          this.setBrowserTooltip(this.tooltip);
          this.tooltipManager = this.destroyBean(this.tooltipManager, this.beans.context);
        } else {
          this.setBrowserTooltip(clearWithEmptyString ? "" : null, clearWithEmptyString);
          this.createTooltipFeatureIfNeeded();
        }
      }
      destroy() {
        this.tooltipManager = this.destroyBean(this.tooltipManager, this.beans.context);
        super.destroy();
      }
    };
    var SHOW_QUICK_TOOLTIP_DIFF = 1e3;
    var FADE_OUT_TOOLTIP_TIMEOUT = 1e3;
    var INTERACTIVE_HIDE_DELAY = 100;
    var lastTooltipHideTime;
    var isLocked = false;
    var BaseTooltipStateManager = class extends AgBeanStub {
      constructor(tooltipCtrl, getTooltipValue) {
        super();
        this.tooltipCtrl = tooltipCtrl;
        this.getTooltipValue = getTooltipValue;
        this.interactionEnabled = false;
        this.isInteractingWithTooltip = false;
        this.state = 0;
        this.tooltipInstanceCount = 0;
        this.tooltipMouseTrack = false;
      }
      wireBeans(beans) {
        this.popupSvc = beans.popupSvc;
      }
      postConstruct() {
        if (this.gos.get("tooltipInteraction")) {
          this.interactionEnabled = true;
        }
        this.tooltipTrigger = this.getTooltipTrigger();
        this.tooltipMouseTrack = this.gos.get("tooltipMouseTrack");
        const el2 = this.tooltipCtrl.getGui();
        if (this.tooltipTrigger === 0) {
          this.addManagedListeners(el2, {
            mouseenter: this.onMouseEnter.bind(this),
            mouseleave: this.onMouseLeave.bind(this)
          });
        }
        if (this.tooltipTrigger === 1) {
          this.addManagedListeners(el2, {
            focusin: this.onFocusIn.bind(this),
            focusout: this.onFocusOut.bind(this)
          });
        }
        this.addManagedListeners(el2, { mousemove: this.onMouseMove.bind(this) });
        if (!this.interactionEnabled) {
          this.addManagedListeners(el2, {
            mousedown: this.onMouseDown.bind(this),
            keydown: this.onKeyDown.bind(this)
          });
        }
      }
      getGridOptionsTooltipDelay(delayOption) {
        const delay = this.gos.get(delayOption);
        return Math.max(200, delay);
      }
      getTooltipDelay(type) {
        if (type === "show") {
          return this.tooltipCtrl.getTooltipShowDelayOverride?.() ?? this.getGridOptionsTooltipDelay("tooltipShowDelay");
        }
        return this.tooltipCtrl.getTooltipHideDelayOverride?.() ?? this.getGridOptionsTooltipDelay("tooltipHideDelay");
      }
      destroy() {
        this.setToDoNothing();
        super.destroy();
      }
      getTooltipTrigger() {
        const trigger = this.gos.get("tooltipTrigger");
        if (!trigger || trigger === "hover") {
          return 0;
        }
        return 1;
      }
      onMouseEnter(e) {
        if (this.interactionEnabled && this.interactiveTooltipTimeoutId) {
          this.unlockService();
          this.startHideTimeout();
        }
        if (_isIOSUserAgent()) {
          return;
        }
        if (isLocked) {
          this.showTooltipTimeoutId = window.setTimeout(() => {
            this.prepareToShowTooltip(e);
          }, INTERACTIVE_HIDE_DELAY);
        } else {
          this.prepareToShowTooltip(e);
        }
      }
      onMouseMove(e) {
        if (this.lastMouseEvent) {
          this.lastMouseEvent = e;
        }
        if (this.tooltipMouseTrack && this.state === 2 && this.tooltipComp) {
          this.positionTooltip();
        }
      }
      onMouseDown() {
        this.setToDoNothing();
      }
      onMouseLeave() {
        if (this.interactionEnabled) {
          this.lockService();
        } else {
          this.setToDoNothing();
        }
      }
      onFocusIn() {
        this.prepareToShowTooltip();
      }
      onFocusOut(e) {
        const relatedTarget = e.relatedTarget;
        const parentCompGui = this.tooltipCtrl.getGui();
        const tooltipGui = this.tooltipComp?.getGui();
        if (this.isInteractingWithTooltip || parentCompGui.contains(relatedTarget) || this.interactionEnabled && tooltipGui?.contains(relatedTarget)) {
          return;
        }
        this.setToDoNothing();
      }
      onKeyDown() {
        if (this.isInteractingWithTooltip) {
          this.isInteractingWithTooltip = false;
        }
        this.setToDoNothing();
      }
      prepareToShowTooltip(mouseEvent) {
        if (this.state != 0 || isLocked) {
          return;
        }
        let delay = 0;
        if (mouseEvent) {
          delay = this.isLastTooltipHiddenRecently() ? 200 : this.getTooltipDelay("show");
        }
        this.lastMouseEvent = mouseEvent || null;
        this.showTooltipTimeoutId = window.setTimeout(this.showTooltip.bind(this), delay);
        this.state = 1;
      }
      isLastTooltipHiddenRecently() {
        const now = Date.now();
        const then = lastTooltipHideTime;
        return now - then < SHOW_QUICK_TOOLTIP_DIFF;
      }
      setToDoNothing(fromHideTooltip) {
        if (!fromHideTooltip && this.state === 2) {
          this.hideTooltip();
        }
        if (this.onBodyScrollEventCallback) {
          this.onBodyScrollEventCallback();
          this.onBodyScrollEventCallback = void 0;
        }
        this.clearEventHandlers();
        if (this.onDocumentKeyDownCallback) {
          this.onDocumentKeyDownCallback();
          this.onDocumentKeyDownCallback = void 0;
        }
        this.clearTimeouts();
        this.state = 0;
        this.lastMouseEvent = null;
      }
      showTooltip() {
        const value2 = this.getTooltipValue();
        const ctrl = this.tooltipCtrl;
        if (!_exists(value2) || ctrl.shouldDisplayTooltip && !ctrl.shouldDisplayTooltip()) {
          this.setToDoNothing();
          return;
        }
        const params = this.gos.addCommon({
          location: ctrl.getLocation?.() ?? "UNKNOWN",
          value: value2,
          hideTooltipCallback: () => this.hideTooltip(true),
          ...ctrl.getAdditionalParams?.()
        });
        this.state = 2;
        this.tooltipInstanceCount++;
        const callback = this.newTooltipComponentCallback.bind(this, this.tooltipInstanceCount);
        this.createTooltipComp(params, callback);
      }
      hideTooltip(forceHide) {
        if (!forceHide && this.isInteractingWithTooltip) {
          return;
        }
        if (this.tooltipComp) {
          this.destroyTooltipComp();
          lastTooltipHideTime = Date.now();
        }
        this.eventSvc.dispatchEvent({
          type: "tooltipHide",
          parentGui: this.tooltipCtrl.getGui()
        });
        if (forceHide) {
          this.isInteractingWithTooltip = false;
        }
        this.setToDoNothing(true);
      }
      newTooltipComponentCallback(tooltipInstanceCopy, tooltipComp) {
        const compNoLongerNeeded = this.state !== 2 || this.tooltipInstanceCount !== tooltipInstanceCopy;
        if (compNoLongerNeeded) {
          this.destroyBean(tooltipComp);
          return;
        }
        const eGui = tooltipComp.getGui();
        this.tooltipComp = tooltipComp;
        if (!eGui.classList.contains("ag-tooltip")) {
          eGui.classList.add("ag-tooltip-custom");
        }
        if (this.tooltipTrigger === 0) {
          eGui.classList.add("ag-tooltip-animate");
        }
        if (this.interactionEnabled) {
          eGui.classList.add("ag-tooltip-interactive");
        }
        const translate = this.getLocaleTextFunc();
        const addPopupRes = this.popupSvc?.addPopup({
          eChild: eGui,
          ariaLabel: translate("ariaLabelTooltip", "Tooltip")
        });
        if (addPopupRes) {
          this.tooltipPopupDestroyFunc = addPopupRes.hideFunc;
        }
        this.positionTooltip();
        if (this.tooltipTrigger === 1) {
          const listener = () => this.setToDoNothing();
          [this.onBodyScrollEventCallback] = this.addManagedEventListeners({
            bodyScroll: listener
          });
          this.setEventHandlers(listener);
        }
        if (this.interactionEnabled) {
          [this.tooltipMouseEnterListener, this.tooltipMouseLeaveListener] = this.addManagedElementListeners(eGui, {
            mouseenter: this.onTooltipMouseEnter.bind(this),
            mouseleave: this.onTooltipMouseLeave.bind(this)
          });
          [this.onDocumentKeyDownCallback] = this.addManagedElementListeners(_getDocument(this.beans), {
            keydown: (e) => {
              if (!eGui.contains(e?.target)) {
                this.onKeyDown();
              }
            }
          });
          if (this.tooltipTrigger === 1) {
            [this.tooltipFocusInListener, this.tooltipFocusOutListener] = this.addManagedElementListeners(eGui, {
              focusin: this.onTooltipFocusIn.bind(this),
              focusout: this.onTooltipFocusOut.bind(this)
            });
          }
        }
        this.eventSvc.dispatchEvent({
          type: "tooltipShow",
          tooltipGui: eGui,
          parentGui: this.tooltipCtrl.getGui()
        });
        this.startHideTimeout();
      }
      onTooltipMouseEnter() {
        this.isInteractingWithTooltip = true;
        this.unlockService();
      }
      onTooltipMouseLeave() {
        if (this.isTooltipFocused()) {
          return;
        }
        this.isInteractingWithTooltip = false;
        this.lockService();
      }
      onTooltipFocusIn() {
        this.isInteractingWithTooltip = true;
      }
      isTooltipFocused() {
        const tooltipGui = this.tooltipComp?.getGui();
        const activeEl = _getActiveDomElement(this.beans);
        return !!tooltipGui && tooltipGui.contains(activeEl);
      }
      onTooltipFocusOut(e) {
        const parentGui = this.tooltipCtrl.getGui();
        if (this.isTooltipFocused()) {
          return;
        }
        this.isInteractingWithTooltip = false;
        if (parentGui.contains(e.relatedTarget)) {
          this.startHideTimeout();
        } else {
          this.hideTooltip();
        }
      }
      positionTooltip() {
        const params = {
          type: "tooltip",
          ePopup: this.tooltipComp.getGui(),
          nudgeY: 18,
          skipObserver: this.tooltipMouseTrack
        };
        if (this.lastMouseEvent) {
          this.popupSvc?.positionPopupUnderMouseEvent({
            ...params,
            mouseEvent: this.lastMouseEvent
          });
        } else {
          this.popupSvc?.positionPopupByComponent({
            ...params,
            eventSource: this.tooltipCtrl.getGui(),
            position: "under",
            keepWithinBounds: true,
            nudgeY: 5
          });
        }
      }
      destroyTooltipComp() {
        this.tooltipComp.getGui().classList.add("ag-tooltip-hiding");
        const tooltipPopupDestroyFunc = this.tooltipPopupDestroyFunc;
        const tooltipComp = this.tooltipComp;
        const delay = this.tooltipTrigger === 0 ? FADE_OUT_TOOLTIP_TIMEOUT : 0;
        window.setTimeout(() => {
          tooltipPopupDestroyFunc();
          this.destroyBean(tooltipComp);
        }, delay);
        this.clearTooltipListeners();
        this.tooltipPopupDestroyFunc = void 0;
        this.tooltipComp = void 0;
      }
      clearTooltipListeners() {
        for (const listener of [
          this.tooltipMouseEnterListener,
          this.tooltipMouseLeaveListener,
          this.tooltipFocusInListener,
          this.tooltipFocusOutListener
        ]) {
          if (listener) {
            listener();
          }
        }
        this.tooltipMouseEnterListener = this.tooltipMouseLeaveListener = this.tooltipFocusInListener = this.tooltipFocusOutListener = null;
      }
      lockService() {
        isLocked = true;
        this.interactiveTooltipTimeoutId = window.setTimeout(() => {
          this.unlockService();
          this.setToDoNothing();
        }, INTERACTIVE_HIDE_DELAY);
      }
      unlockService() {
        isLocked = false;
        this.clearInteractiveTimeout();
      }
      startHideTimeout() {
        this.clearHideTimeout();
        this.hideTooltipTimeoutId = window.setTimeout(this.hideTooltip.bind(this), this.getTooltipDelay("hide"));
      }
      clearShowTimeout() {
        if (!this.showTooltipTimeoutId) {
          return;
        }
        window.clearTimeout(this.showTooltipTimeoutId);
        this.showTooltipTimeoutId = void 0;
      }
      clearHideTimeout() {
        if (!this.hideTooltipTimeoutId) {
          return;
        }
        window.clearTimeout(this.hideTooltipTimeoutId);
        this.hideTooltipTimeoutId = void 0;
      }
      clearInteractiveTimeout() {
        if (!this.interactiveTooltipTimeoutId) {
          return;
        }
        window.clearTimeout(this.interactiveTooltipTimeoutId);
        this.interactiveTooltipTimeoutId = void 0;
      }
      clearTimeouts() {
        this.clearShowTimeout();
        this.clearHideTimeout();
        this.clearInteractiveTimeout();
      }
    };
    var AgHighlightTooltipFeature = class extends AgTooltipFeature {
      constructor(ctrl, highlightTracker, beans) {
        super(ctrl, beans);
        this.highlightTracker = highlightTracker;
        this.onHighlight = this.onHighlight.bind(this);
      }
      postConstruct() {
        super.postConstruct();
        this.wireHighlightListeners();
      }
      wireHighlightListeners() {
        this.addManagedPropertyListener("tooltipTrigger", ({ currentValue }) => {
          this.setTooltipMode(currentValue);
        });
        this.setTooltipMode(this.gos.get("tooltipTrigger"));
        this.highlightTracker.addEventListener("itemHighlighted", this.onHighlight);
      }
      onHighlight(event) {
        if (this.tooltipMode !== 1) {
          return;
        }
        if (event.highlighted) {
          this.attemptToShowTooltip();
        } else {
          this.attemptToHideTooltip();
        }
      }
      setTooltipMode(tooltipTriggerMode = "focus") {
        this.tooltipMode = tooltipTriggerMode === "focus" ? 1 : 0;
      }
      destroy() {
        this.highlightTracker.removeEventListener("itemHighlighted", this.onHighlight);
        super.destroy();
      }
    };
    var instanceIdSeq = 0;
    var WAIT_FOR_POPUP_CONTENT_RESIZE = 200;
    var BasePopupService = class extends AgBeanStub {
      constructor() {
        super(...arguments);
        this.beanName = "popupSvc";
        this.popupList = [];
      }
      getPopupParent() {
        const ePopupParent = this.gos.get("popupParent");
        if (ePopupParent) {
          return ePopupParent;
        }
        return this.getDefaultPopupParent();
      }
      positionPopupUnderMouseEvent(params) {
        const { ePopup, nudgeX, nudgeY, skipObserver } = params;
        this.positionPopup({
          ePopup,
          nudgeX,
          nudgeY,
          keepWithinBounds: true,
          skipObserver,
          updatePosition: () => this.calculatePointerAlign(params.mouseEvent),
          postProcessCallback: () => this.callPostProcessPopup(params, params.type, params.ePopup, null, params.mouseEvent)
        });
      }
      calculatePointerAlign(e) {
        const parentRect = this.getParentRect();
        return {
          x: e.clientX - parentRect.left,
          y: e.clientY - parentRect.top
        };
      }
      positionPopupByComponent(params) {
        const {
          ePopup,
          nudgeX,
          nudgeY,
          keepWithinBounds,
          eventSource,
          alignSide = "left",
          position = "over",
          type
        } = params;
        const sourceRect = eventSource.getBoundingClientRect();
        const parentRect = this.getParentRect();
        this.setAlignedTo(eventSource, ePopup);
        const updatePosition = () => {
          let x2 = sourceRect.left - parentRect.left;
          if (alignSide === "right") {
            x2 -= ePopup.offsetWidth - sourceRect.width;
          }
          let y;
          if (position === "over") {
            y = sourceRect.top - parentRect.top;
            this.setAlignedStyles(ePopup, "over");
          } else {
            this.setAlignedStyles(ePopup, "under");
            const alignSide2 = this.shouldRenderUnderOrAbove(ePopup, sourceRect, parentRect, params.nudgeY || 0);
            if (alignSide2 === "under") {
              y = sourceRect.top - parentRect.top + sourceRect.height;
            } else {
              y = sourceRect.top - ePopup.offsetHeight - (nudgeY || 0) * 2 - parentRect.top;
            }
          }
          return { x: x2, y };
        };
        this.positionPopup({
          ePopup,
          nudgeX,
          nudgeY,
          keepWithinBounds,
          updatePosition,
          postProcessCallback: () => this.callPostProcessPopup(params, type, ePopup, eventSource, null)
        });
      }
      shouldRenderUnderOrAbove(ePopup, targetCompRect, parentRect, nudgeY) {
        const spaceAvailableUnder = parentRect.bottom - targetCompRect.bottom;
        const spaceAvailableAbove = targetCompRect.top - parentRect.top;
        const spaceRequired = ePopup.offsetHeight + nudgeY;
        if (spaceAvailableUnder > spaceRequired) {
          return "under";
        }
        if (spaceAvailableAbove > spaceRequired || spaceAvailableAbove > spaceAvailableUnder) {
          return "above";
        }
        return "under";
      }
      setAlignedStyles(ePopup, positioned) {
        const popupIdx = this.getPopupIndex(ePopup);
        if (popupIdx === -1) {
          return;
        }
        const popup = this.popupList[popupIdx];
        const { alignedToElement } = popup;
        if (!alignedToElement) {
          return;
        }
        const positions = ["right", "left", "over", "above", "under"];
        for (const position of positions) {
          alignedToElement.classList.remove(`ag-has-popup-positioned-${position}`);
          ePopup.classList.remove(`ag-popup-positioned-${position}`);
        }
        if (!positioned) {
          return;
        }
        alignedToElement.classList.add(`ag-has-popup-positioned-${positioned}`);
        ePopup.classList.add(`ag-popup-positioned-${positioned}`);
      }
      setAlignedTo(eventSource, ePopup) {
        const popupIdx = this.getPopupIndex(ePopup);
        if (popupIdx !== -1) {
          const popup = this.popupList[popupIdx];
          popup.alignedToElement = eventSource;
        }
      }
      positionPopup(params) {
        const { ePopup, keepWithinBounds, nudgeX, nudgeY, skipObserver, updatePosition } = params;
        const lastSize = { width: 0, height: 0 };
        const updatePopupPosition = (fromResizeObserver = false) => {
          let { x: x2, y } = updatePosition();
          if (fromResizeObserver && ePopup.clientWidth === lastSize.width && ePopup.clientHeight === lastSize.height) {
            return;
          }
          lastSize.width = ePopup.clientWidth;
          lastSize.height = ePopup.clientHeight;
          if (nudgeX) {
            x2 += nudgeX;
          }
          if (nudgeY) {
            y += nudgeY;
          }
          if (keepWithinBounds) {
            x2 = this.keepXYWithinBounds(
              ePopup,
              x2,
              1
              /* Horizontal */
            );
            y = this.keepXYWithinBounds(
              ePopup,
              y,
              0
              /* Vertical */
            );
          }
          ePopup.style.left = `${x2}px`;
          ePopup.style.top = `${y}px`;
          if (params.postProcessCallback) {
            params.postProcessCallback();
          }
        };
        updatePopupPosition();
        if (!skipObserver) {
          const resizeObserverDestroyFunc = _observeResize(this.beans, ePopup, () => updatePopupPosition(true));
          setTimeout(() => resizeObserverDestroyFunc(), WAIT_FOR_POPUP_CONTENT_RESIZE);
        }
      }
      getParentRect() {
        const eDocument = _getDocument(this.beans);
        let popupParent = this.getPopupParent();
        if (popupParent === eDocument.body) {
          popupParent = eDocument.documentElement;
        } else if (getComputedStyle(popupParent).position === "static") {
          popupParent = popupParent.offsetParent;
        }
        return _getElementRectWithOffset(popupParent);
      }
      keepXYWithinBounds(ePopup, position, direction) {
        const isVertical = direction === 0;
        const sizeProperty = isVertical ? "clientHeight" : "clientWidth";
        const anchorProperty = isVertical ? "top" : "left";
        const offsetProperty = isVertical ? "height" : "width";
        const scrollPositionProperty = isVertical ? "scrollTop" : "scrollLeft";
        const eDocument = _getDocument(this.beans);
        const docElement = eDocument.documentElement;
        const popupParent = this.getPopupParent();
        const popupRect = ePopup.getBoundingClientRect();
        const parentRect = popupParent.getBoundingClientRect();
        const documentRect = eDocument.documentElement.getBoundingClientRect();
        const isBody = popupParent === eDocument.body;
        const offsetSize = Math.ceil(popupRect[offsetProperty]);
        const getSize2 = isVertical ? _getAbsoluteHeight : _getAbsoluteWidth;
        let sizeOfParent = isBody ? getSize2(docElement) + docElement[scrollPositionProperty] : popupParent[sizeProperty];
        if (isBody) {
          sizeOfParent -= Math.abs(documentRect[anchorProperty] - parentRect[anchorProperty]);
        }
        const max2 = sizeOfParent - offsetSize;
        return Math.min(Math.max(position, 0), Math.max(max2, 0));
      }
      addPopup(params) {
        const { eChild, ariaLabel, ariaOwns, alwaysOnTop, positionCallback, anchorToElement } = params;
        const pos2 = this.getPopupIndex(eChild);
        if (pos2 !== -1) {
          const popup = this.popupList[pos2];
          return { hideFunc: popup.hideFunc };
        }
        this.initialisePopupPosition(eChild);
        const wrapperEl = this.createPopupWrapper(eChild, !!alwaysOnTop, ariaLabel, ariaOwns);
        const removeListeners = this.addEventListenersToPopup({ ...params, wrapperEl });
        if (positionCallback) {
          positionCallback();
        }
        this.addPopupToPopupList(eChild, wrapperEl, removeListeners, anchorToElement);
        return {
          hideFunc: removeListeners
        };
      }
      initialisePopupPosition(element) {
        const ePopupParent = this.getPopupParent();
        const ePopupParentRect = ePopupParent.getBoundingClientRect();
        if (!_exists(element.style.top)) {
          element.style.top = `${ePopupParentRect.top * -1}px`;
        }
        if (!_exists(element.style.left)) {
          element.style.left = `${ePopupParentRect.left * -1}px`;
        }
      }
      createPopupWrapper(element, alwaysOnTop, ariaLabel, ariaOwns) {
        const ePopupParent = this.getPopupParent();
        const { environment, gos } = this.beans;
        const eWrapper = _createAgElement({ tag: "div" });
        environment.applyThemeClasses(eWrapper);
        eWrapper.classList.add("ag-popup");
        element.classList.add(gos.get("enableRtl") ? "ag-rtl" : "ag-ltr", "ag-popup-child");
        if (!element.hasAttribute("role")) {
          _setAriaRole(element, "dialog");
        }
        if (ariaLabel) {
          _setAriaLabel(element, ariaLabel);
        } else if (ariaOwns) {
          element.id || (element.id = `popup-component-${instanceIdSeq}`);
          _setAriaOwns(ariaOwns, element.id);
        }
        eWrapper.appendChild(element);
        ePopupParent.appendChild(eWrapper);
        if (alwaysOnTop) {
          this.setAlwaysOnTop(element, true);
        } else {
          this.bringPopupToFront(element);
        }
        return eWrapper;
      }
      addEventListenersToPopup(params) {
        const beans = this.beans;
        const eDocument = _getDocument(beans);
        const { wrapperEl, eChild: popupEl, closedCallback, afterGuiAttached, closeOnEsc, modal: modal2, ariaOwns } = params;
        let popupHidden = false;
        const hidePopupOnKeyboardEvent = (event) => {
          if (!wrapperEl.contains(_getActiveDomElement(beans))) {
            return;
          }
          const key2 = event.key;
          if (key2 === KeyCode.ESCAPE && !this.isStopPropagation(event)) {
            removeListeners({ keyboardEvent: event });
          }
        };
        const hidePopupOnMouseEvent = (event) => removeListeners({ mouseEvent: event });
        const hidePopupOnTouchEvent = (event) => removeListeners({ touchEvent: event });
        const removeListeners = (popupParams = {}) => {
          const { mouseEvent, touchEvent, keyboardEvent, forceHide } = popupParams;
          if (!forceHide && // we don't hide popup if the event was on the child, or any
          // children of this child
          (this.isEventFromCurrentPopup({ mouseEvent, touchEvent }, popupEl) || // this method should only be called once. the client can have different
          // paths, each one wanting to close, so this method may be called multiple times.
          popupHidden)) {
            return;
          }
          popupHidden = true;
          wrapperEl.remove();
          eDocument.removeEventListener("keydown", hidePopupOnKeyboardEvent);
          eDocument.removeEventListener("mousedown", hidePopupOnMouseEvent);
          eDocument.removeEventListener("touchstart", hidePopupOnTouchEvent);
          eDocument.removeEventListener("contextmenu", hidePopupOnMouseEvent);
          this.eventSvc.removeListener("dragStarted", hidePopupOnMouseEvent);
          if (closedCallback) {
            closedCallback(mouseEvent || touchEvent || keyboardEvent);
          }
          this.removePopupFromPopupList(popupEl, ariaOwns);
        };
        if (afterGuiAttached) {
          afterGuiAttached({ hidePopup: removeListeners });
        }
        window.setTimeout(() => {
          if (closeOnEsc) {
            eDocument.addEventListener("keydown", hidePopupOnKeyboardEvent);
          }
          if (modal2) {
            eDocument.addEventListener("mousedown", hidePopupOnMouseEvent);
            this.eventSvc.addListener("dragStarted", hidePopupOnMouseEvent);
            eDocument.addEventListener("touchstart", hidePopupOnTouchEvent);
            eDocument.addEventListener("contextmenu", hidePopupOnMouseEvent);
          }
        }, 0);
        return removeListeners;
      }
      addPopupToPopupList(element, wrapperEl, removeListeners, anchorToElement) {
        this.popupList.push({
          element,
          wrapper: wrapperEl,
          hideFunc: removeListeners,
          instanceId: instanceIdSeq,
          isAnchored: !!anchorToElement
        });
        if (anchorToElement) {
          this.setPopupPositionRelatedToElement(element, anchorToElement);
        }
        instanceIdSeq = instanceIdSeq + 1;
      }
      getPopupIndex(el2) {
        return this.popupList.findIndex((p) => p.element === el2);
      }
      setPopupPositionRelatedToElement(popupEl, relativeElement) {
        const popupIndex = this.getPopupIndex(popupEl);
        if (popupIndex === -1) {
          return;
        }
        const popup = this.popupList[popupIndex];
        if (popup.stopAnchoringPromise) {
          popup.stopAnchoringPromise.then((destroyFunc) => destroyFunc && destroyFunc());
        }
        popup.stopAnchoringPromise = void 0;
        popup.isAnchored = false;
        if (!relativeElement) {
          return;
        }
        const destroyPositionTracker = this.keepPopupPositionedRelativeTo({
          element: relativeElement,
          ePopup: popupEl,
          hidePopup: popup.hideFunc
        });
        popup.stopAnchoringPromise = destroyPositionTracker;
        popup.isAnchored = true;
        return destroyPositionTracker;
      }
      removePopupFromPopupList(element, ariaOwns) {
        this.setAlignedStyles(element, null);
        this.setPopupPositionRelatedToElement(element, null);
        if (ariaOwns) {
          _setAriaOwns(ariaOwns, null);
        }
        this.popupList = this.popupList.filter((p) => p.element !== element);
      }
      keepPopupPositionedRelativeTo(params) {
        const eParent = this.getPopupParent();
        const parentRect = eParent.getBoundingClientRect();
        const { element, ePopup } = params;
        const sourceRect = element.getBoundingClientRect();
        const extractFromPixelValue = (pxSize) => Number.parseInt(pxSize.substring(0, pxSize.length - 1), 10);
        const createPosition = (prop2, direction) => {
          const initialDiff = parentRect[prop2] - sourceRect[prop2];
          const initial = extractFromPixelValue(ePopup.style[prop2]);
          return {
            initialDiff,
            lastDiff: initialDiff,
            initial,
            last: initial,
            direction
          };
        };
        const topPosition = createPosition(
          "top",
          0
          /* Vertical */
        );
        const leftPosition = createPosition(
          "left",
          1
          /* Horizontal */
        );
        const fwOverrides = this.beans.frameworkOverrides;
        return new AgPromise((resolve) => {
          fwOverrides.wrapIncoming(() => {
            _wrapInterval(() => {
              const pRect = eParent.getBoundingClientRect();
              const sRect = element.getBoundingClientRect();
              const elementNotInDom = sRect.top == 0 && sRect.left == 0 && sRect.height == 0 && sRect.width == 0;
              if (elementNotInDom) {
                params.hidePopup();
                return;
              }
              const calculateNewPosition = (position, prop2) => {
                const current2 = extractFromPixelValue(ePopup.style[prop2]);
                if (position.last !== current2) {
                  position.initial = current2;
                  position.last = current2;
                }
                const currentDiff = pRect[prop2] - sRect[prop2];
                if (currentDiff != position.lastDiff) {
                  const newValue = this.keepXYWithinBounds(
                    ePopup,
                    position.initial + position.initialDiff - currentDiff,
                    position.direction
                  );
                  ePopup.style[prop2] = `${newValue}px`;
                  position.last = newValue;
                }
                position.lastDiff = currentDiff;
              };
              calculateNewPosition(topPosition, "top");
              calculateNewPosition(leftPosition, "left");
            }, 200).then((intervalId) => {
              const result2 = () => {
                if (intervalId != null) {
                  window.clearInterval(intervalId);
                }
              };
              resolve(result2);
            });
          }, "popupPositioning");
        });
      }
      isEventFromCurrentPopup(params, target2) {
        const { mouseEvent, touchEvent } = params;
        const event = mouseEvent ? mouseEvent : touchEvent;
        if (!event) {
          return false;
        }
        const indexOfThisChild = this.getPopupIndex(target2);
        if (indexOfThisChild === -1) {
          return false;
        }
        for (let i2 = indexOfThisChild; i2 < this.popupList.length; i2++) {
          const popup = this.popupList[i2];
          if (_isElementInEventPath(popup.element, event)) {
            return true;
          }
        }
        return this.isElementWithinCustomPopup(event.target);
      }
      isElementWithinCustomPopup(el2) {
        const eDocument = _getDocument(this.beans);
        while (el2 && el2 !== eDocument.body) {
          if (el2.classList.contains("ag-custom-component-popup") || el2.parentElement === null) {
            return true;
          }
          el2 = el2.parentElement;
        }
        return false;
      }
      getWrapper(ePopup) {
        while (!ePopup.classList.contains("ag-popup") && ePopup.parentElement) {
          ePopup = ePopup.parentElement;
        }
        return ePopup.classList.contains("ag-popup") ? ePopup : null;
      }
      setAlwaysOnTop(ePopup, alwaysOnTop) {
        const eWrapper = this.getWrapper(ePopup);
        if (!eWrapper) {
          return;
        }
        eWrapper.classList.toggle("ag-always-on-top", !!alwaysOnTop);
        if (alwaysOnTop) {
          this.bringPopupToFront(eWrapper);
        }
      }
      /** @returns true if moved */
      bringPopupToFront(ePopup) {
        const parent = this.getPopupParent();
        const popupList = Array.prototype.slice.call(parent.querySelectorAll(".ag-popup"));
        const popupLen = popupList.length;
        const eWrapper = this.getWrapper(ePopup);
        if (!eWrapper || popupLen <= 1 || !parent.contains(ePopup)) {
          return;
        }
        const standardPopupList = [];
        const alwaysOnTopList = [];
        for (const popup of popupList) {
          if (popup === eWrapper) {
            continue;
          }
          if (popup.classList.contains("ag-always-on-top")) {
            alwaysOnTopList.push(popup);
          } else {
            standardPopupList.push(popup);
          }
        }
        const innerElsScrollMap = [];
        const onTopLength = alwaysOnTopList.length;
        const isPopupAlwaysOnTop = eWrapper.classList.contains("ag-always-on-top");
        const shouldBeLast = isPopupAlwaysOnTop || !onTopLength;
        const targetList = shouldBeLast ? [...standardPopupList, ...alwaysOnTopList, eWrapper] : [...standardPopupList, eWrapper, ...alwaysOnTopList];
        for (let i2 = 0; i2 <= popupLen; i2++) {
          const currentPopup = targetList[i2];
          if (popupList[i2] === targetList[i2] || currentPopup === eWrapper) {
            continue;
          }
          const innerEls = currentPopup.querySelectorAll("div");
          for (const el2 of innerEls) {
            if (el2.scrollTop !== 0) {
              innerElsScrollMap.push([el2, el2.scrollTop]);
            }
          }
          if (i2 === 0) {
            parent.insertAdjacentElement("afterbegin", currentPopup);
          } else {
            targetList[i2 - 1].insertAdjacentElement("afterend", currentPopup);
          }
        }
        while (innerElsScrollMap.length) {
          const currentEl = innerElsScrollMap.pop();
          currentEl[0].scrollTop = currentEl[1];
        }
      }
    };
    var AgTooltipComponent = class extends AgPopupComponent {
      constructor() {
        super({ tag: "div", cls: "ag-tooltip" });
      }
      // will need to type params
      init(params) {
        const { value: value2 } = params;
        const eGui = this.getGui();
        eGui.textContent = _toString(value2);
        const locationKebabCase = params.location.replace(/([a-z])([A-Z0-9])/g, "$1-$2").toLowerCase();
        eGui.classList.add(`ag-${locationKebabCase}-tooltip`);
      }
    };
    var tryPointerCapture = (eElement, pointerId) => {
      if (pointerId != null && eElement?.setPointerCapture) {
        try {
          eElement.setPointerCapture(pointerId);
          return eElement.hasPointerCapture(pointerId);
        } catch {
        }
      }
      return false;
    };
    var capturePointer = (eElement, mouseEvent) => {
      if (typeof PointerEvent === "undefined" || !(mouseEvent instanceof PointerEvent)) {
        return null;
      }
      const pointerId = mouseEvent.pointerId;
      if (!tryPointerCapture(eElement, pointerId)) {
        return null;
      }
      const capture = {
        eElement,
        pointerId,
        onLost(pointerEvent) {
          pointerLostHandler(capture, pointerEvent);
        }
      };
      eElement.addEventListener("lostpointercapture", capture.onLost);
      return capture;
    };
    var releasePointerCapture = (capture) => {
      if (!capture) {
        return;
      }
      removeLostHandler(capture);
      const { eElement, pointerId } = capture;
      if (!eElement) {
        return;
      }
      try {
        eElement.releasePointerCapture(pointerId);
      } catch {
      }
      capture.eElement = null;
    };
    var removeLostHandler = (capture) => {
      const { eElement, onLost } = capture;
      if (eElement && onLost) {
        eElement.removeEventListener("lostpointercapture", onLost);
        capture.onLost = null;
      }
    };
    var pointerLostHandler = (capture, pointerEvent) => {
      removeLostHandler(capture);
      const { eElement, pointerId } = capture;
      if (eElement && pointerEvent.pointerId === pointerId) {
        tryPointerCapture(eElement, pointerId);
      }
    };
    var activePointerDrags;
    var handledDragEvents;
    var addHandledDragEvent = (event) => {
      if (!handledDragEvents) {
        handledDragEvents = /* @__PURE__ */ new WeakSet();
      } else if (handledDragEvents.has(event)) {
        return false;
      }
      handledDragEvents.add(event);
      return true;
    };
    var BaseDragService = class extends AgBeanStub {
      constructor() {
        super(...arguments);
        this.beanName = "dragSvc";
        this.dragging = false;
        this.drag = null;
        this.dragSources = [];
      }
      get startTarget() {
        return this.drag?.start.target ?? null;
      }
      /** True if there is at least one active pointer drag in any BaseDragService instance in the page */
      isPointer() {
        return !!activePointerDrags?.has(_getRootNode(this.beans));
      }
      hasPointerCapture() {
        const capture = this.drag?.pointerCapture;
        return !!(capture && this.beans.eRootDiv.hasPointerCapture?.(capture.pointerId));
      }
      destroy() {
        if (this.drag) {
          this.cancelDrag();
        }
        const dragSources = this.dragSources;
        for (const entry of dragSources) {
          destroyDragSourceEntry(entry);
        }
        dragSources.length = 0;
        super.destroy();
      }
      removeDragSource(params) {
        const dragSources = this.dragSources;
        for (let i2 = 0, len = dragSources.length; i2 < len; ++i2) {
          const entry = dragSources[i2];
          if (entry.params === params) {
            dragSources.splice(i2, 1);
            destroyDragSourceEntry(entry);
            break;
          }
        }
      }
      addDragSource(params) {
        if (!this.isAlive()) {
          return;
        }
        const { eElement, includeTouch } = params;
        const handlers2 = [];
        let oldTouchAction;
        if (includeTouch) {
          const style2 = eElement.style;
          if (style2) {
            oldTouchAction = style2.touchAction;
            style2.touchAction = "none";
          }
        }
        const dragSource = { handlers: handlers2, params, oldTouchAction };
        this.dragSources.push(dragSource);
        const pointerDownListener = (event) => this.onPointerDown(params, event);
        const mouseListener = (event) => this.onMouseDown(params, event);
        addTempEventHandlers(
          handlers2,
          [eElement, "pointerdown", pointerDownListener, { passive: false }],
          [eElement, "mousedown", mouseListener]
        );
        const suppressTouch = this.gos.get("suppressTouch");
        if (includeTouch && !suppressTouch) {
          const touchListener = (touchEvent) => this.onTouchStart(params, touchEvent);
          addTempEventHandlers(handlers2, [eElement, "touchstart", touchListener, { passive: false }]);
        }
      }
      cancelDrag(eElement) {
        const drag = this.drag;
        eElement ?? (eElement = drag?.eElement);
        if (eElement) {
          this.eventSvc.dispatchEvent({ type: "dragCancelled", target: eElement });
        }
        drag?.params.onDragCancel?.();
        this.destroyDrag();
      }
      shouldPreventMouseEvent(mouseEvent) {
        const type = mouseEvent.type;
        const isMouseMove = type === "mousemove" || type === "pointermove";
        return isMouseMove && mouseEvent.cancelable && _isEventFromThisInstance(this.beans, mouseEvent) && !_isFocusableFormField(getEventTargetElement(mouseEvent));
      }
      initDrag(drag, ...handlers2) {
        this.drag = drag;
        const beans = this.beans;
        const onScroll = (event) => this.onScroll(event);
        const keydownEvent = (ev) => this.onKeyDown(ev);
        const rootEl = _getRootNode(beans);
        const eDocument = _getDocument(beans);
        addTempEventHandlers(
          drag.handlers,
          [rootEl, "contextmenu", preventEventDefault],
          [rootEl, "keydown", keydownEvent],
          [eDocument, "scroll", onScroll, { capture: true }],
          [eDocument.defaultView || window, "scroll", onScroll],
          ...handlers2
        );
      }
      destroyDrag() {
        this.dragging = false;
        const drag = this.drag;
        if (drag) {
          const rootEl = drag.rootEl;
          if (activePointerDrags?.get(rootEl) === drag) {
            activePointerDrags?.delete(rootEl);
          }
          this.drag = null;
          releasePointerCapture(drag.pointerCapture);
          clearTempEventHandlers(drag.handlers);
        }
      }
      // Pointer Events path (preferred when supported)
      onPointerDown(params, pointerEvent) {
        if (this.isPointer()) {
          return;
        }
        const beans = this.beans;
        if (handledDragEvents?.has(pointerEvent)) {
          return;
        }
        const pointerType = pointerEvent.pointerType;
        if (pointerType === "touch") {
          if (beans.gos.get("suppressTouch") || !params.includeTouch) {
            return;
          }
          if (params.stopPropagationForTouch) {
            pointerEvent.stopPropagation();
          }
          if (_isFocusableFormField(getEventTargetElement(pointerEvent))) {
            return;
          }
        }
        if (!pointerEvent.isPrimary) {
          return;
        }
        if (pointerType === "mouse" && pointerEvent.button !== 0) {
          return;
        }
        this.destroyDrag();
        const rootEl = _getRootNode(beans);
        const eElement = params.eElement;
        const pointerId = pointerEvent.pointerId;
        const pointerDrag = new Dragging(rootEl, params, pointerEvent, pointerId);
        activePointerDrags ?? (activePointerDrags = /* @__PURE__ */ new WeakMap());
        activePointerDrags.set(rootEl, pointerDrag);
        const onPointerMove = (ev) => {
          if (ev.pointerId === pointerId) {
            this.onMouseOrPointerMove(ev);
          }
        };
        const onUp = (ev) => {
          if (ev.pointerId === pointerId) {
            this.onMouseOrPointerUp(ev);
          }
        };
        const onCancel = (ev) => {
          if (ev.pointerId === pointerId && addHandledDragEvent(ev)) {
            this.cancelDrag();
          }
        };
        this.initDrag(
          pointerDrag,
          [rootEl, "pointerup", onUp],
          [rootEl, "pointercancel", onCancel],
          [rootEl, "pointermove", onPointerMove, { passive: false }],
          [rootEl, "touchmove", preventEventDefault, { passive: false }],
          [eElement, "mousemove", preventEventDefault, { passive: false }]
        );
        if (params.dragStartPixels === 0) {
          this.onMouseOrPointerMove(pointerEvent);
        } else {
          addHandledDragEvent(pointerEvent);
        }
      }
      // gets called whenever mouse down on any drag source
      onTouchStart(params, touchEvent) {
        const suppressTouch = this.gos.get("suppressTouch");
        if (suppressTouch || !params.includeTouch) {
          return;
        }
        if (!addHandledDragEvent(touchEvent)) {
          return;
        }
        if (_isFocusableFormField(getEventTargetElement(touchEvent))) {
          return;
        }
        if (params.stopPropagationForTouch) {
          touchEvent.stopPropagation();
        }
        if (this.isPointer()) {
          preventEventDefault(touchEvent);
          return;
        }
        this.destroyDrag();
        const beans = this.beans;
        const rootEl = _getRootNode(beans);
        const touchDrag = new Dragging(rootEl, params, touchEvent.touches[0]);
        const touchMoveEvent = (e) => this.onTouchMove(e);
        const touchEndEvent = (e) => this.onTouchUp(e);
        const target2 = touchEvent.target ?? params.eElement;
        this.initDrag(
          touchDrag,
          [_getRootNode(beans), "touchmove", preventEventDefault, { passive: false }],
          [target2, "touchmove", touchMoveEvent, { passive: true }],
          [target2, "touchend", touchEndEvent, { passive: true }],
          [target2, "touchcancel", touchEndEvent, { passive: true }]
        );
        if (params.dragStartPixels === 0) {
          this.onMove(touchDrag.start);
        }
      }
      // gets called whenever mouse down on any drag source
      onMouseDown(params, mouseEvent) {
        if (mouseEvent.button !== 0) {
          return;
        }
        if (handledDragEvents?.has(mouseEvent)) {
          return;
        }
        if (this.isPointer()) {
          return;
        }
        const beans = this.beans;
        this.destroyDrag();
        const mouseDrag = new Dragging(_getRootNode(beans), params, mouseEvent);
        const mouseMoveEvent = (event) => this.onMouseOrPointerMove(event);
        const mouseUpEvent = (event) => this.onMouseOrPointerUp(event);
        const target2 = _getRootNode(beans);
        this.initDrag(mouseDrag, [target2, "mousemove", mouseMoveEvent], [target2, "mouseup", mouseUpEvent]);
        if (params.dragStartPixels === 0) {
          this.onMouseOrPointerMove(mouseEvent);
        } else {
          addHandledDragEvent(mouseEvent);
        }
      }
      onScroll(event) {
        if (!addHandledDragEvent(event)) {
          return;
        }
        const drag = this.drag;
        const lastDrag = drag?.lastDrag;
        if (lastDrag && this.dragging) {
          drag.params?.onDragging(lastDrag);
        }
      }
      /** only gets called after a mouse down - as this is only added after mouseDown and is removed when mouseUp happens */
      onMouseOrPointerMove(mouseEvent) {
        if (!addHandledDragEvent(mouseEvent)) {
          return;
        }
        if (_isBrowserSafari()) {
          _getDocument(this.beans).getSelection()?.removeAllRanges();
        }
        if (this.shouldPreventMouseEvent(mouseEvent)) {
          preventEventDefault(mouseEvent);
        }
        this.onMove(mouseEvent);
      }
      onTouchMove(touchEvent) {
        const drag = this.drag;
        if (!drag || !addHandledDragEvent(touchEvent)) {
          return;
        }
        const touch = _getFirstActiveTouch(drag.start, touchEvent.touches);
        if (touch) {
          touchEvent.preventDefault();
          this.onMove(touch);
        }
      }
      onMove(currentEvent) {
        const drag = this.drag;
        if (!drag) {
          return;
        }
        drag.lastDrag = currentEvent;
        const dragSource = drag.params;
        if (!this.dragging) {
          const start2 = drag.start;
          const dragStartPixels = dragSource.dragStartPixels;
          const requiredPixelDiff = dragStartPixels ?? 4;
          if (_areEventsNear(currentEvent, start2, requiredPixelDiff)) {
            return;
          }
          this.dragging = true;
          if (dragSource.capturePointer) {
            drag.pointerCapture = capturePointer(this.beans.eRootDiv, currentEvent);
          }
          this.eventSvc.dispatchEvent({
            type: "dragStarted",
            target: dragSource.eElement
          });
          dragSource.onDragStart(start2);
          if (this.drag !== drag) {
            return;
          }
          dragSource.onDragging(start2);
          if (this.drag !== drag) {
            return;
          }
        }
        dragSource.onDragging(currentEvent);
      }
      onTouchUp(touchEvent) {
        const drag = this.drag;
        if (drag && addHandledDragEvent(touchEvent)) {
          this.onUp(_getFirstActiveTouch(drag.start, touchEvent.changedTouches));
        }
      }
      onMouseOrPointerUp(mouseEvent) {
        if (addHandledDragEvent(mouseEvent)) {
          this.onUp(mouseEvent);
        }
      }
      onUp(eventOrTouch) {
        const drag = this.drag;
        if (!drag) {
          return;
        }
        if (!eventOrTouch) {
          eventOrTouch = drag.lastDrag;
        }
        if (eventOrTouch && this.dragging) {
          this.dragging = false;
          drag.params.onDragStop(eventOrTouch);
          this.eventSvc.dispatchEvent({
            type: "dragStopped",
            target: drag.params.eElement
          });
        }
        this.destroyDrag();
      }
      // shared keydown handler to cancel current drag with ESC
      onKeyDown(event) {
        if (event.key === KeyCode.ESCAPE) {
          this.cancelDrag();
        }
      }
    };
    var destroyDragSourceEntry = (dragSource) => {
      clearTempEventHandlers(dragSource.handlers);
      const oldTouchAction = dragSource.oldTouchAction;
      if (oldTouchAction != null) {
        const style2 = dragSource.params.eElement.style;
        if (style2) {
          style2.touchAction = oldTouchAction;
        }
      }
    };
    var Dragging = class {
      constructor(rootEl, params, start2, pointerId = null) {
        this.rootEl = rootEl;
        this.params = params;
        this.start = start2;
        this.pointerId = pointerId;
        this.handlers = [];
        this.lastDrag = null;
        this.pointerCapture = null;
        this.eElement = params.eElement;
      }
    };
    var getEventTargetElement = (event) => {
      const target2 = event.target;
      return target2 instanceof Element ? target2 : null;
    };
    var BaseDragAndDropService = class extends AgBeanStub {
      constructor() {
        super(...arguments);
        this.beanName = "dragAndDrop";
        this.dragSourceAndParamsList = [];
        this.dragItem = null;
        this.dragInitialSourcePointerOffsetX = 0;
        this.dragInitialSourcePointerOffsetY = 0;
        this.lastMouseEvent = null;
        this.lastDraggingEvent = null;
        this.dragSource = null;
        this.dragImageParent = null;
        this.dragImageCompPromise = null;
        this.dragImageComp = null;
        this.dragImageLastIcon = void 0;
        this.dragImageLastLabel = void 0;
        this.dropTargets = [];
        this.lastDropTarget = null;
      }
      addDragSource(dragSource, allowTouch = false) {
        const entry = {
          capturePointer: true,
          dragSource,
          eElement: dragSource.eElement,
          dragStartPixels: dragSource.dragStartPixels,
          onDragStart: (mouseEvent) => this.onDragStart(dragSource, mouseEvent),
          onDragStop: this.onDragStop.bind(this),
          onDragging: this.onDragging.bind(this),
          onDragCancel: this.onDragCancel.bind(this),
          includeTouch: allowTouch
        };
        this.dragSourceAndParamsList.push(entry);
        this.beans.dragSvc.addDragSource(entry);
      }
      setDragImageCompIcon(iconName, shake = false) {
        const component = this.dragImageComp;
        if (component && (shake || this.dragImageLastIcon !== iconName)) {
          this.dragImageLastIcon = iconName;
          component.setIcon(iconName, shake);
        }
      }
      removeDragSource(dragSource) {
        const { dragSourceAndParamsList, beans } = this;
        const sourceAndParams = dragSourceAndParamsList.find((item2) => item2.dragSource === dragSource);
        if (sourceAndParams) {
          beans.dragSvc?.removeDragSource(sourceAndParams);
          _removeFromArray(dragSourceAndParamsList, sourceAndParams);
        }
      }
      destroy() {
        const { dragSourceAndParamsList, dropTargets, beans } = this;
        const dragSvc = beans.dragSvc;
        for (const sourceAndParams of dragSourceAndParamsList) {
          dragSvc?.removeDragSource(sourceAndParams);
        }
        dragSourceAndParamsList.length = 0;
        dropTargets.length = 0;
        this.clearDragAndDropProperties();
        super.destroy();
      }
      nudge() {
        const lastMouseEvent = this.lastMouseEvent;
        if (lastMouseEvent) {
          this.onDragging(lastMouseEvent, true);
        }
      }
      onDragStart(dragSource, mouseEvent) {
        this.lastMouseEvent = mouseEvent;
        this.dragSource = dragSource;
        this.dragItem = dragSource.getDragItem();
        const rect2 = dragSource.eElement.getBoundingClientRect();
        this.dragInitialSourcePointerOffsetX = mouseEvent.clientX - rect2.left;
        this.dragInitialSourcePointerOffsetY = mouseEvent.clientY - rect2.top;
        dragSource.onDragStarted?.();
        this.createAndUpdateDragImageComp(dragSource);
      }
      onDragStop(mouseEvent) {
        const { dragSource, lastDropTarget } = this;
        dragSource?.onDragStopped?.();
        if (lastDropTarget) {
          const dragEndEvent = this.dropTargetEvent(lastDropTarget, mouseEvent, false);
          lastDropTarget.onDragStop?.(dragEndEvent);
        }
        this.clearDragAndDropProperties();
      }
      onDragCancel() {
        const { dragSource, lastDropTarget, lastMouseEvent } = this;
        dragSource?.onDragCancelled?.();
        if (lastDropTarget && lastMouseEvent) {
          const dragCancelEvent = this.dropTargetEvent(lastDropTarget, lastMouseEvent, false);
          lastDropTarget.onDragCancel?.(dragCancelEvent);
        }
        this.clearDragAndDropProperties();
      }
      onDragging(mouseEvent, fromNudge = false) {
        this.positionDragImageComp(mouseEvent);
        const dropTarget = this.findCurrentDropTarget(mouseEvent);
        const { lastDropTarget, dragSource, dragItem } = this;
        let needUpdate = false;
        if (dropTarget !== lastDropTarget) {
          needUpdate = true;
          if (lastDropTarget) {
            const dragLeaveEvent = this.dropTargetEvent(lastDropTarget, mouseEvent, fromNudge);
            lastDropTarget.onDragLeave?.(dragLeaveEvent);
          }
          if (lastDropTarget !== null && !dropTarget) {
            this.handleExit(dragSource, dragItem);
          } else if (lastDropTarget === null && dropTarget) {
            this.handleEnter(dragSource, dragItem);
          }
          if (dropTarget) {
            const dragEnterEvent = this.dropTargetEvent(dropTarget, mouseEvent, fromNudge);
            dropTarget.onDragEnter?.(dragEnterEvent);
          }
          this.lastDropTarget = dropTarget;
        } else if (dropTarget) {
          const dragMoveEvent = this.dropTargetEvent(dropTarget, mouseEvent, fromNudge);
          dropTarget.onDragging?.(dragMoveEvent);
          if (dragMoveEvent?.changed) {
            needUpdate = true;
          }
        }
        this.lastMouseEvent = mouseEvent;
        if (needUpdate) {
          this.updateDragImageComp();
        }
      }
      clearDragAndDropProperties() {
        this.removeDragImageComp(this.dragImageComp);
        this.dragImageCompPromise = null;
        this.dragImageParent = null;
        this.dragImageLastIcon = void 0;
        this.dragImageLastLabel = void 0;
        this.lastMouseEvent = null;
        this.lastDraggingEvent = null;
        this.lastDropTarget = null;
        this.dragItem = null;
        this.dragInitialSourcePointerOffsetX = 0;
        this.dragInitialSourcePointerOffsetY = 0;
        this.dragSource = null;
      }
      getAllContainersFromDropTarget(dropTarget) {
        const secondaryContainers = dropTarget.getSecondaryContainers ? dropTarget.getSecondaryContainers() : null;
        const containers = [[dropTarget.getContainer()]];
        return secondaryContainers ? containers.concat(secondaryContainers) : containers;
      }
      // checks if the mouse is on the drop target. it checks eContainer and eSecondaryContainers
      isMouseOnDropTarget(mouseEvent, dropTarget) {
        const allContainersFromDropTarget = this.getAllContainersFromDropTarget(dropTarget);
        let mouseOverTarget = false;
        const allContainersIntersect = (mouseEvent2, containers) => {
          for (const container2 of containers) {
            const { width, height, left: left2, right: right2, top: top2, bottom: bottom2 } = container2.getBoundingClientRect();
            if (width === 0 || height === 0) {
              return false;
            }
            const horizontalFit = mouseEvent2.clientX >= left2 && mouseEvent2.clientX < right2;
            const verticalFit = mouseEvent2.clientY >= top2 && mouseEvent2.clientY < bottom2;
            if (!horizontalFit || !verticalFit) {
              return false;
            }
          }
          return true;
        };
        for (const currentContainers of allContainersFromDropTarget) {
          if (allContainersIntersect(mouseEvent, currentContainers)) {
            mouseOverTarget = true;
            break;
          }
        }
        const { eElement, type } = this.dragSource;
        if (dropTarget.targetContainsSource && !dropTarget.getContainer().contains(eElement)) {
          return false;
        }
        return mouseOverTarget && dropTarget.isInterestedIn(type, eElement);
      }
      findCurrentDropTarget(mouseEvent) {
        const validDropTargets = this.dropTargets.filter((target2) => this.isMouseOnDropTarget(mouseEvent, target2));
        const len = validDropTargets.length;
        if (len === 0) {
          return null;
        }
        if (len === 1) {
          return validDropTargets[0];
        }
        const rootNode = _getRootNode(this.beans);
        const elementStack = rootNode.elementsFromPoint(mouseEvent.clientX, mouseEvent.clientY);
        for (const el2 of elementStack) {
          for (const dropTarget of validDropTargets) {
            const containers = this.getAllContainersFromDropTarget(dropTarget).flatMap((a) => a);
            if (containers.indexOf(el2) !== -1) {
              return dropTarget;
            }
          }
        }
        return null;
      }
      addDropTarget(dropTarget) {
        this.dropTargets.push(dropTarget);
      }
      removeDropTarget(dropTarget) {
        this.dropTargets = this.dropTargets.filter((target2) => target2.getContainer() !== dropTarget.getContainer());
      }
      hasExternalDropZones() {
        return this.dropTargets.some((zones) => zones.external);
      }
      findExternalZone(container2) {
        return this.dropTargets.find((zone) => zone.external && zone.getContainer() === container2) || null;
      }
      dropTargetEvent(dropTarget, mouseEvent, fromNudge) {
        const {
          dragSource,
          dragItem,
          lastDraggingEvent,
          lastMouseEvent,
          dragInitialSourcePointerOffsetX,
          dragInitialSourcePointerOffsetY
        } = this;
        const dropZoneTarget = dropTarget.getContainer();
        const rect2 = dropZoneTarget.getBoundingClientRect();
        const { clientX, clientY } = mouseEvent;
        const xDir = clientX - (lastMouseEvent?.clientX || 0);
        const yDir = clientY - (lastMouseEvent?.clientY || 0);
        const draggingEvent = this.createEvent({
          event: mouseEvent,
          x: clientX - rect2.left,
          // relative x
          y: clientY - rect2.top,
          // relative y
          vDirection: yDir > 0 ? "down" : yDir < 0 ? "up" : null,
          hDirection: xDir < 0 ? "left" : xDir > 0 ? "right" : null,
          initialSourcePointerOffsetX: dragInitialSourcePointerOffsetX,
          initialSourcePointerOffsetY: dragInitialSourcePointerOffsetY,
          dragSource,
          fromNudge,
          dragItem,
          dropZoneTarget,
          dropTarget: lastDraggingEvent?.dropTarget ?? null,
          // updated by rowDragFeature
          changed: !!lastDraggingEvent?.changed
        });
        this.lastDraggingEvent = draggingEvent;
        return draggingEvent;
      }
      positionDragImageComp(event) {
        const gui = this.dragImageComp?.getGui();
        if (gui) {
          _anchorElementToMouseMoveEvent(gui, event, this.beans);
        }
      }
      removeDragImageComp(comp2) {
        if (this.dragImageComp === comp2) {
          this.dragImageComp = null;
        }
        if (comp2) {
          comp2.getGui()?.remove();
          this.destroyBean(comp2);
        }
      }
      createAndUpdateDragImageComp(dragSource) {
        const promise = this.createDragImageComp(dragSource) ?? null;
        this.dragImageCompPromise = promise;
        promise?.then((dragImageComp) => {
          if (promise !== this.dragImageCompPromise || !this.lastMouseEvent || !this.isAlive()) {
            this.destroyBean(dragImageComp);
            return;
          }
          this.dragImageCompPromise = null;
          this.dragImageLastIcon = void 0;
          this.dragImageLastLabel = void 0;
          const oldDragImageComp = this.dragImageComp;
          if (oldDragImageComp !== dragImageComp) {
            this.dragImageComp = dragImageComp;
            this.removeDragImageComp(oldDragImageComp);
          }
          if (dragImageComp) {
            this.appendDragImageComp(dragImageComp);
            this.updateDragImageComp();
          }
        });
      }
      appendDragImageComp(component) {
        const eGui = component.getGui();
        const style2 = eGui.style;
        style2.position = "absolute";
        style2.zIndex = "9999";
        if (this.beans.dragSvc?.hasPointerCapture()) {
          style2.pointerEvents = "none";
        }
        this.gos.setInstanceDomData(eGui);
        this.beans.environment.applyThemeClasses(eGui);
        style2.top = "20px";
        style2.left = "20px";
        const targetEl = _getPageBody(this.beans);
        this.dragImageParent = targetEl;
        if (!targetEl) {
          this.warnNoBody();
        } else {
          targetEl.appendChild(eGui);
        }
      }
      updateDragImageComp() {
        const { dragImageComp, dragSource, lastDropTarget, lastDraggingEvent, dragImageLastLabel } = this;
        if (!dragImageComp) {
          return;
        }
        this.setDragImageCompIcon(lastDropTarget?.getIconName?.(lastDraggingEvent) ?? null);
        let label2 = dragSource?.dragItemName;
        if (typeof label2 === "function") {
          label2 = label2(lastDraggingEvent);
        }
        label2 || (label2 = "");
        if (dragImageLastLabel !== label2) {
          this.dragImageLastLabel = label2;
          dragImageComp.setLabel(label2);
        }
      }
    };
    var DragAndDropService = class extends BaseDragAndDropService {
      createEvent(event) {
        return _addGridCommonParams(this.gos, event);
      }
      createDragImageComp(dragSource) {
        const { gos, beans } = this;
        const userCompDetails = _getDragAndDropImageCompDetails(
          beans.userCompFactory,
          _addGridCommonParams(gos, {
            dragSource
          })
        );
        return userCompDetails?.newAgStackInstance();
      }
      handleEnter(dragSource, dragItem) {
        dragSource?.onGridEnter?.(dragItem);
      }
      handleExit(dragSource, dragItem) {
        dragSource?.onGridExit?.(dragItem);
      }
      warnNoBody() {
        _warn(54);
      }
      isDropZoneWithinThisGrid(draggingEvent) {
        return this.beans.ctrlsSvc.getGridBodyCtrl().eGridBody.contains(draggingEvent.dropZoneTarget);
      }
      registerGridDropTarget(elementFn, ctrl) {
        const dropTarget = {
          getContainer: elementFn,
          isInterestedIn: (type) => type === 1 || type === 0,
          getIconName: () => "notAllowed"
        };
        this.addDropTarget(dropTarget);
        ctrl.addDestroyFunc(() => this.removeDropTarget(dropTarget));
      }
    };
    function createUniqueColumnGroupId(groupId, instanceId) {
      return groupId + "_" + instanceId;
    }
    function isColumnGroup(col) {
      return col instanceof AgColumnGroup;
    }
    var AgColumnGroup = class extends BeanStub {
      constructor(providedColumnGroup, groupId, partId, pinned) {
        super();
        this.providedColumnGroup = providedColumnGroup;
        this.groupId = groupId;
        this.partId = partId;
        this.pinned = pinned;
        this.isColumn = false;
        this.displayedChildren = [];
        this.autoHeaderHeight = null;
        this.parent = null;
        this.colIdSanitised = _escapeString(this.getUniqueId());
      }
      // as the user is adding and removing columns, the groups are recalculated.
      // this reset clears out all children, ready for children to be added again
      reset() {
        this.parent = null;
        this.children = null;
        this.displayedChildren = null;
      }
      getParent() {
        return this.parent;
      }
      getUniqueId() {
        return createUniqueColumnGroupId(this.groupId, this.partId);
      }
      isEmptyGroup() {
        return this.displayedChildren.length === 0;
      }
      isMoving() {
        const allLeafColumns = this.getProvidedColumnGroup().getLeafColumns();
        if (!allLeafColumns || allLeafColumns.length === 0) {
          return false;
        }
        return allLeafColumns.every((col) => col.isMoving());
      }
      checkLeft() {
        for (const child of this.displayedChildren) {
          if (isColumnGroup(child)) {
            child.checkLeft();
          }
        }
        if (this.displayedChildren.length > 0) {
          if (this.gos.get("enableRtl")) {
            const lastChild = _last(this.displayedChildren);
            const lastChildLeft = lastChild.getLeft();
            this.setLeft(lastChildLeft);
          } else {
            const firstChildLeft = this.displayedChildren[0].getLeft();
            this.setLeft(firstChildLeft);
          }
        } else {
          this.setLeft(null);
        }
      }
      getLeft() {
        return this.left;
      }
      getOldLeft() {
        return this.oldLeft;
      }
      setLeft(left2) {
        this.oldLeft = this.left;
        if (this.left !== left2) {
          this.left = left2;
          this.dispatchLocalEvent({ type: "leftChanged" });
        }
      }
      getPinned() {
        return this.pinned;
      }
      getGroupId() {
        return this.groupId;
      }
      getPartId() {
        return this.partId;
      }
      getActualWidth() {
        let groupActualWidth = 0;
        for (const child of this.displayedChildren ?? []) {
          groupActualWidth += child.getActualWidth();
        }
        return groupActualWidth;
      }
      isResizable() {
        if (!this.displayedChildren) {
          return false;
        }
        let result2 = false;
        for (const child of this.displayedChildren) {
          if (child.isResizable()) {
            result2 = true;
          }
        }
        return result2;
      }
      getMinWidth() {
        let result2 = 0;
        for (const groupChild of this.displayedChildren) {
          result2 += groupChild.getMinWidth();
        }
        return result2;
      }
      addChild(child) {
        if (!this.children) {
          this.children = [];
        }
        this.children.push(child);
      }
      getDisplayedChildren() {
        return this.displayedChildren;
      }
      getLeafColumns() {
        const result2 = [];
        this.addLeafColumns(result2);
        return result2;
      }
      getDisplayedLeafColumns() {
        const result2 = [];
        this.addDisplayedLeafColumns(result2);
        return result2;
      }
      getDefinition() {
        return this.providedColumnGroup.getColGroupDef();
      }
      getColGroupDef() {
        return this.providedColumnGroup.getColGroupDef();
      }
      isPadding() {
        return this.providedColumnGroup.isPadding();
      }
      isExpandable() {
        return this.providedColumnGroup.isExpandable();
      }
      isExpanded() {
        return this.providedColumnGroup.isExpanded();
      }
      setExpanded(expanded) {
        this.providedColumnGroup.setExpanded(expanded);
      }
      isAutoHeaderHeight() {
        return !!this.getColGroupDef()?.autoHeaderHeight;
      }
      getAutoHeaderHeight() {
        return this.autoHeaderHeight;
      }
      /** Returns true if the header height has changed */
      setAutoHeaderHeight(height) {
        const changed = height !== this.autoHeaderHeight;
        this.autoHeaderHeight = height;
        return changed;
      }
      addDisplayedLeafColumns(leafColumns) {
        for (const child of this.displayedChildren ?? []) {
          if (isColumn(child)) {
            leafColumns.push(child);
          } else if (isColumnGroup(child)) {
            child.addDisplayedLeafColumns(leafColumns);
          }
        }
      }
      addLeafColumns(leafColumns) {
        for (const child of this.children ?? []) {
          if (isColumn(child)) {
            leafColumns.push(child);
          } else if (isColumnGroup(child)) {
            child.addLeafColumns(leafColumns);
          }
        }
      }
      getChildren() {
        return this.children;
      }
      getColumnGroupShow() {
        return this.providedColumnGroup.getColumnGroupShow();
      }
      getProvidedColumnGroup() {
        return this.providedColumnGroup;
      }
      getPaddingLevel() {
        const parent = this.getParent();
        if (!this.isPadding() || !parent?.isPadding()) {
          return 0;
        }
        return 1 + parent.getPaddingLevel();
      }
      calculateDisplayedColumns() {
        this.displayedChildren = [];
        let parentWithExpansion = this;
        while (parentWithExpansion?.isPadding()) {
          parentWithExpansion = parentWithExpansion.getParent();
        }
        const isExpandable = parentWithExpansion ? parentWithExpansion.getProvidedColumnGroup().isExpandable() : false;
        if (!isExpandable) {
          this.displayedChildren = this.children;
          this.dispatchLocalEvent({ type: "displayedChildrenChanged" });
          return;
        }
        for (const child of this.children ?? []) {
          const emptyGroup = isColumnGroup(child) && !child.displayedChildren?.length;
          if (emptyGroup) {
            continue;
          }
          const headerGroupShow = child.getColumnGroupShow();
          switch (headerGroupShow) {
            case "open":
              if (parentWithExpansion.getProvidedColumnGroup().isExpanded()) {
                this.displayedChildren.push(child);
              }
              break;
            case "closed":
              if (!parentWithExpansion.getProvidedColumnGroup().isExpanded()) {
                this.displayedChildren.push(child);
              }
              break;
            default:
              this.displayedChildren.push(child);
              break;
          }
        }
        this.dispatchLocalEvent({ type: "displayedChildrenChanged" });
      }
    };
    var ROW_ID_PREFIX_ROW_GROUP = "row-group-";
    var ROW_ID_PREFIX_TOP_PINNED = "t-";
    var ROW_ID_PREFIX_BOTTOM_PINNED = "b-";
    var OBJECT_ID_SEQUENCE = 0;
    var RowNode = class {
      constructor(beans) {
        this.master = false;
        this.detail = void 0;
        this.rowIndex = null;
        this.key = null;
        this.sourceRowIndex = -1;
        this._leafs = void 0;
        this.childrenMapped = null;
        this.treeParent = null;
        this.treeNodeFlags = 0;
        this.displayed = false;
        this.rowTop = null;
        this.oldRowTop = null;
        this.selectable = true;
        this.__objectId = OBJECT_ID_SEQUENCE++;
        this.alreadyRendered = false;
        this.hovered = false;
        this.__selected = false;
        this.beans = beans;
      }
      /** CSRM only - do not use this property internally, this is exposed to the end user only. Use `_leafs` instead. */
      get allLeafChildren() {
        const leafs = this._leafs;
        return leafs === void 0 ? this.beans.groupStage?.loadLeafs?.(this) ?? null : leafs;
      }
      set allLeafChildren(value2) {
        this._leafs = value2;
      }
      /**
       * Replaces the data on the `rowNode`. When this method is called, the grid refreshes the entire rendered row if it is displayed.
       */
      setData(data) {
        this.setDataCommon(data, false);
      }
      // similar to setRowData, however it is expected that the data is the same data item. this
      // is intended to be used with Redux type stores, where the whole data can be changed. we are
      // guaranteed that the data is the same entity (so grid doesn't need to worry about the id of the
      // underlying data changing, hence doesn't need to worry about selection). the grid, upon receiving
      // dataChanged event, refreshes the cells rather than rip them all out (so user can show transitions).
      /**
       * Updates the data on the `rowNode`. When this method is called, the grid refreshes the entire rendered row if it is displayed.
       */
      updateData(data) {
        this.setDataCommon(data, true);
      }
      setDataCommon(data, update) {
        const { valueCache, eventSvc } = this.beans;
        const oldData = this.data;
        this.data = data;
        valueCache?.onDataChanged();
        this.updateDataOnDetailNode();
        this.resetQuickFilterAggregateText();
        const event = this.createDataChangedEvent(data, oldData, update);
        this.__localEventService?.dispatchEvent(event);
        if (this.sibling) {
          this.sibling.data = data;
          const event2 = this.sibling.createDataChangedEvent(data, oldData, update);
          this.sibling.__localEventService?.dispatchEvent(event2);
        }
        eventSvc.dispatchEvent({ type: "rowNodeDataChanged", node: this });
        const pinnedSibling = this.pinnedSibling;
        if (pinnedSibling) {
          pinnedSibling.data = data;
          pinnedSibling.__localEventService?.dispatchEvent(
            pinnedSibling.createDataChangedEvent(data, oldData, update)
          );
          eventSvc.dispatchEvent({ type: "rowNodeDataChanged", node: pinnedSibling });
        }
      }
      // when we are doing master / detail, the detail node is lazy created, but then kept around.
      // so if we show / hide the detail, the same detail rowNode is used. so we need to keep the data
      // in sync, otherwise expand/collapse of the detail would still show the old values.
      updateDataOnDetailNode() {
        const detailNode = this.detailNode;
        if (detailNode) {
          detailNode.data = this.data;
        }
      }
      createDataChangedEvent(newData, oldData, update) {
        return {
          type: "dataChanged",
          node: this,
          oldData,
          newData,
          update
        };
      }
      getRowIndexString() {
        if (this.rowIndex == null) {
          _error(13);
          return null;
        }
        if (this.rowPinned === "top") {
          return ROW_ID_PREFIX_TOP_PINNED + this.rowIndex;
        }
        if (this.rowPinned === "bottom") {
          return ROW_ID_PREFIX_BOTTOM_PINNED + this.rowIndex;
        }
        return this.rowIndex.toString();
      }
      setDataAndId(data, id) {
        const { selectionSvc } = this.beans;
        const oldNode = selectionSvc?.createDaemonNode?.(this);
        const oldData = this.data;
        this.data = data;
        this.updateDataOnDetailNode();
        this.setId(id);
        if (selectionSvc) {
          selectionSvc.updateRowSelectable(this);
          selectionSvc.syncInRowNode(this, oldNode);
        }
        const event = this.createDataChangedEvent(data, oldData, false);
        this.__localEventService?.dispatchEvent(event);
      }
      setId(id) {
        const getRowIdFunc = _getRowIdCallback(this.beans.gos);
        if (getRowIdFunc) {
          if (this.data) {
            const parentKeys = this.parent?.getRoute() ?? [];
            this.id = getRowIdFunc({
              data: this.data,
              parentKeys: parentKeys.length > 0 ? parentKeys : void 0,
              level: this.level,
              rowPinned: this.rowPinned
            });
            if (this.id.startsWith(ROW_ID_PREFIX_ROW_GROUP)) {
              _error(14, {
                groupPrefix: ROW_ID_PREFIX_ROW_GROUP
              });
            }
          } else {
            this.id = void 0;
          }
        } else {
          this.id = id;
        }
      }
      setRowTop(rowTop) {
        this.oldRowTop = this.rowTop;
        if (this.rowTop === rowTop) {
          return;
        }
        this.rowTop = rowTop;
        this.dispatchRowEvent("topChanged");
        const displayed = rowTop !== null;
        if (this.displayed !== displayed) {
          this.displayed = displayed;
          this.dispatchRowEvent("displayedChanged");
        }
      }
      clearRowTopAndRowIndex() {
        this.oldRowTop = null;
        this.setRowTop(null);
        this.setRowIndex(null);
      }
      setHovered(hovered) {
        this.hovered = hovered;
      }
      isHovered() {
        return this.hovered;
      }
      /**
       * Sets the row height.
       * Call if you want to change the height initially assigned to the row.
       * After calling, you must call `api.onRowHeightChanged()` so the grid knows it needs to work out the placement of the rows. */
      setRowHeight(rowHeight, estimated = false) {
        this.rowHeight = rowHeight;
        this.rowHeightEstimated = estimated;
        this.dispatchRowEvent("heightChanged");
      }
      setExpanded(expanded, e, forceSync) {
        this.beans.expansionSvc?.setExpanded(this, expanded, e, forceSync);
      }
      /**
       * Replaces the value on the `rowNode` for the specified column. When complete,
       * the grid refreshes the rendered cell on the required row only.
       * **Note**: This method only fires `onCellEditRequest` when the Grid is in **Read Only** mode.
       * **Note**: This method defers to EditModule if available and batches the edit when `fullRow` or `batchEdit` is enabled.
       *
       * @param colKey The column where the value should be updated
       * @param newValue The new value
       * @param eventSource The source of the event
       * @returns `true` if the value was changed, otherwise `false`.
       */
      setDataValue(colKey, newValue, eventSource) {
        const { colModel, valueSvc, gos, editSvc } = this.beans;
        const column2 = typeof colKey !== "string" ? colKey : colModel.getCol(colKey) ?? colModel.getColDefCol(colKey);
        if (!column2) {
          return false;
        }
        const oldValue = valueSvc.getValueForDisplay(column2, this, void 0, void 0, "api").value;
        if (gos.get("readOnlyEdit")) {
          const {
            beans: { eventSvc },
            data,
            rowIndex,
            rowPinned
          } = this;
          eventSvc.dispatchEvent({
            type: "cellEditRequest",
            event: null,
            rowIndex,
            rowPinned,
            column: column2,
            colDef: column2.colDef,
            data,
            node: this,
            oldValue,
            newValue,
            value: newValue,
            source: eventSource
          });
          return false;
        }
        if (editSvc && !editSvc.committing) {
          const result2 = editSvc.setDataValue({ rowNode: this, column: column2 }, newValue, eventSource);
          if (result2 != null) {
            return result2;
          }
        }
        const valueChanged = valueSvc.setValue(this, column2, newValue, eventSource);
        this.dispatchCellChangedEvent(column2, newValue, oldValue);
        if (valueChanged) {
          this.pinnedSibling?.dispatchCellChangedEvent(column2, newValue, oldValue);
        }
        return valueChanged;
      }
      updateHasChildren() {
        let newValue = this.group && !this.footer || !!this.childrenAfterGroup?.length;
        const { rowChildrenSvc } = this.beans;
        if (rowChildrenSvc) {
          newValue = rowChildrenSvc.getHasChildrenValue(this);
        }
        if (newValue !== this.__hasChildren) {
          this.__hasChildren = !!newValue;
          this.dispatchRowEvent("hasChildrenChanged");
        }
      }
      hasChildren() {
        if (this.__hasChildren == null) {
          this.updateHasChildren();
        }
        return this.__hasChildren;
      }
      dispatchCellChangedEvent(column2, newValue, oldValue) {
        const cellChangedEvent = {
          type: "cellChanged",
          node: this,
          column: column2,
          newValue,
          oldValue
        };
        this.__localEventService?.dispatchEvent(cellChangedEvent);
      }
      /**
       * The first time `quickFilter` runs, the grid creates a one-off string representation of the row.
       * This string is then used for the quick filter instead of hitting each column separately.
       * When you edit, using grid editing, this string gets cleared down.
       * However, if you edit without using grid editing, you need to clear this string down for the row to be updated with the new values.
       * Otherwise, new values would not work with the `quickFilter`. */
      resetQuickFilterAggregateText() {
        this.quickFilterAggregateText = null;
      }
      /** Returns:
       * - `true` if the node can be expanded, i.e it is a group or master row.
       * - `false` if the node cannot be expanded
       */
      isExpandable() {
        return this.beans.expansionSvc?.isExpandable(this) ?? false;
      }
      /** Returns:
       * - `true` if node is selected,
       * - `false` if the node isn't selected
       * - `undefined` if it's partially selected (group where not all children are selected). */
      isSelected() {
        if (this.footer) {
          return this.sibling.isSelected();
        }
        const pinnedSibling = this.rowPinned && this.pinnedSibling;
        if (pinnedSibling) {
          return pinnedSibling.isSelected();
        }
        return this.__selected;
      }
      /** Perform a depth-first search of this node and its children. */
      depthFirstSearch(callback) {
        const childrenAfterGroup = this.childrenAfterGroup;
        if (childrenAfterGroup) {
          for (let i2 = 0, len = childrenAfterGroup.length; i2 < len; ++i2) {
            childrenAfterGroup[i2].depthFirstSearch(callback);
          }
        }
        callback(this);
      }
      dispatchRowEvent(type) {
        this.__localEventService?.dispatchEvent({
          type,
          node: this
        });
      }
      /**
       * Select (or deselect) the node.
       * @param newValue -`true` for selection, `false` for deselection.
       * @param clearSelection - If selecting, then passing `true` selects the node exclusively (i.e. NOT do multi select). If doing deselection, `clearSelection` has no impact.
       * @param source - Source property that appears in the `selectionChanged` event.
       */
      setSelected(newValue, clearSelection = false, source2 = "api") {
        this.beans.selectionSvc?.setNodesSelected({
          nodes: [this],
          newValue,
          clearSelection,
          source: source2
        });
      }
      /**
       * Returns:
       * - `true` if node is either pinned to the `top` or `bottom`
       * - `false` if the node isn't pinned
       */
      isRowPinned() {
        return !!this.rowPinned;
      }
      __addEventListener(eventType, listener) {
        const localEventService = this.__localEventService ?? (this.__localEventService = new LocalEventService());
        localEventService.addEventListener(eventType, listener);
      }
      __removeEventListener(eventType, listener) {
        this.removeLocalListener(eventType, listener);
      }
      /**
       * PUBLIC USE ONLY: for internal use within AG Grid use the `__addEventListener` and `__removeEventListener` methods.
       */
      addEventListener(eventType, userListener) {
        this.beans.validation?.checkRowEvents(eventType);
        const localEventService = this.__localEventService ?? (this.__localEventService = new LocalEventService());
        this.frameworkEventListenerService = this.beans.frameworkOverrides.createLocalEventListenerWrapper?.(
          this.frameworkEventListenerService,
          localEventService
        );
        const listener = this.frameworkEventListenerService?.wrap(eventType, userListener) ?? userListener;
        localEventService.addEventListener(eventType, listener);
      }
      /**
       * PUBLIC USE ONLY: for internal use within AG Grid use the `__addEventListener` and `__removeEventListener` methods.
       */
      removeEventListener(eventType, userListener) {
        const listener = this.frameworkEventListenerService?.unwrap(eventType, userListener) ?? userListener;
        this.removeLocalListener(eventType, listener);
      }
      removeLocalListener(eventType, listener) {
        const localEventService = this.__localEventService;
        if (localEventService) {
          localEventService.removeEventListener(eventType, listener);
          if (localEventService.noRegisteredListenersExist()) {
            this.__localEventService = null;
          }
        }
      }
      /**
       * @deprecated v32.2.0 Check `node.detail` then user provided callback `isFullWidthRow` instead.
       *
       * Returns:
       * - `true` if the node is a full width cell
       * - `false` if the node is not a full width cell
       */
      isFullWidthCell() {
        _warn(61);
        if (this.detail) {
          return true;
        }
        const isFullWidthCellFunc = this.beans.gos.getCallback("isFullWidthRow");
        return isFullWidthCellFunc ? isFullWidthCellFunc({ rowNode: this }) : false;
      }
      /**
       * Returns the route of keys to the row node. Returns undefined if the node has no key.
       */
      getRoute() {
        if (this.level === -1) {
          return [];
        }
        if (this.key == null) {
          return void 0;
        }
        const res = [];
        let pointer = this;
        while (pointer?.key != null) {
          res.push(pointer.key);
          pointer = pointer.parent;
        }
        return res.reverse();
      }
      setRowIndex(rowIndex) {
        if (this.rowIndex !== rowIndex) {
          this.rowIndex = rowIndex;
          this.dispatchRowEvent("rowIndexChanged");
        }
      }
      setAllChildrenCount(allChildrenCount) {
        if (this.allChildrenCount !== allChildrenCount) {
          this.allChildrenCount = allChildrenCount;
          this.dispatchRowEvent("allChildrenCountChanged");
        }
      }
      setUiLevel(uiLevel) {
        if (this.uiLevel !== uiLevel) {
          this.uiLevel = uiLevel;
          this.dispatchRowEvent("uiLevelChanged");
        }
      }
      getFirstChild() {
        const childStore = this.childStore;
        if (childStore) {
          return childStore.getFirstNode();
        }
        return this.childrenAfterSort?.[0] ?? null;
      }
    };
    function _createGlobalRowEvent(rowNode, gos, type) {
      return _addGridCommonParams(gos, {
        type,
        node: rowNode,
        data: rowNode.data,
        rowIndex: rowNode.rowIndex,
        rowPinned: rowNode.rowPinned
      });
    }
    var IGNORED_SIBLING_PROPERTIES = /* @__PURE__ */ new Set([
      "__autoHeights",
      "__checkAutoHeightsDebounced",
      "__localEventService",
      "__objectId",
      "_leafs",
      "childStore",
      "oldRowTop",
      "sticky",
      "treeNodeFlags",
      "treeParent"
    ]);
    var _createRowNodeSibling = (rowNode, beans) => {
      const sibling = new RowNode(beans);
      for (const key2 of Object.keys(rowNode)) {
        if (IGNORED_SIBLING_PROPERTIES.has(key2)) {
          continue;
        }
        sibling[key2] = rowNode[key2];
      }
      sibling.oldRowTop = null;
      return sibling;
    };
    var _firstLeaf = (childrenAfterGroup) => {
      while (childrenAfterGroup?.length) {
        const node2 = childrenAfterGroup[0];
        if (node2.data) {
          return node2;
        }
        childrenAfterGroup = node2.childrenAfterGroup;
      }
    };
    var FILTER_HANDLER_MAP = {
      agSetColumnFilter: "agSetColumnFilterHandler",
      agMultiColumnFilter: "agMultiColumnFilterHandler",
      agGroupColumnFilter: "agGroupColumnFilterHandler",
      agNumberColumnFilter: "agNumberColumnFilterHandler",
      agDateColumnFilter: "agDateColumnFilterHandler",
      agTextColumnFilter: "agTextColumnFilterHandler"
    };
    var FILTER_HANDLERS = new Set(Object.values(FILTER_HANDLER_MAP));
    function getFilterUiFromWrapper(filterWrapper, skipCreate) {
      const filterUi = filterWrapper.filterUi;
      if (!filterUi) {
        return null;
      }
      if (filterUi.created) {
        return filterUi.promise;
      }
      if (skipCreate) {
        return null;
      }
      const promise = filterUi.create(filterUi.refreshed);
      const createdFilterUi = filterUi;
      createdFilterUi.created = true;
      createdFilterUi.promise = promise;
      return promise;
    }
    function _refreshHandlerAndUi(getFilterUi, handler, handlerParams, model2, state, source2, additionalEventAttributes) {
      handler.refresh?.({ ...handlerParams, model: model2, source: source2, additionalEventAttributes });
      return getFilterUi().then((filterUi) => {
        if (filterUi) {
          const { filter, filterParams } = filterUi;
          _refreshFilterUi(filter, filterParams, model2, state, source2, additionalEventAttributes);
        }
      });
    }
    function _refreshFilterUi(filter, filterParams, model2, state, source2, additionalEventAttributes) {
      filter?.refresh?.({
        ...filterParams,
        model: model2,
        state,
        source: source2,
        additionalEventAttributes
      });
    }
    function getAndRefreshFilterUi(getFilterUi, getModel, getState2) {
      const filterUi = getFilterUi();
      if (filterUi?.created) {
        filterUi.promise.then((filter) => {
          const model2 = getModel();
          _refreshFilterUi(filter, filterUi.filterParams, model2, getState2() ?? { model: model2 }, "ui");
        });
      }
    }
    function _updateFilterModel(action, getFilterUi, getModel, getState2, updateState, updateModel, processModelToApply) {
      let state;
      let shouldUpdateModel = false;
      let model2;
      switch (action) {
        case "apply": {
          const oldState = getState2();
          model2 = oldState?.model ?? null;
          if (processModelToApply) {
            model2 = processModelToApply(model2);
          }
          state = {
            // keep the other UI state
            state: oldState?.state,
            model: model2
          };
          shouldUpdateModel = true;
          break;
        }
        case "clear": {
          state = {
            // wipe other UI state
            model: null
          };
          break;
        }
        case "reset": {
          state = {
            // wipe other UI state
            model: null
          };
          shouldUpdateModel = true;
          model2 = null;
          break;
        }
        case "cancel": {
          state = {
            // wipe other UI state
            model: getModel()
          };
          break;
        }
      }
      updateState(state);
      if (shouldUpdateModel) {
        updateModel(model2);
      } else {
        getAndRefreshFilterUi(getFilterUi, getModel, getState2);
      }
    }
    function _getFilterModel(model2, colId) {
      return model2[colId] ?? null;
    }
    function _createElement(params) {
      return _createAgElement(params);
    }
    function getElement(className2) {
      return {
        tag: "div",
        cls: className2
      };
    }
    var FilterButtonComp = class extends Component {
      constructor(config2) {
        const { className: className2 = "ag-filter-apply-panel" } = config2 ?? {};
        super(getElement(className2));
        this.listeners = [];
        this.validationMessage = null;
        this.className = className2;
      }
      updateButtons(buttons, useForm) {
        const oldButtons = this.buttons;
        this.buttons = buttons;
        if (oldButtons === buttons) {
          return;
        }
        const eGui = this.getGui();
        _clearElement(eGui);
        let eApplyButton;
        this.destroyListeners();
        const fragment = document.createDocumentFragment();
        const className2 = this.className;
        const addButton = ({ type, label: label2 }) => {
          const clickListener = (event) => {
            this.dispatchLocalEvent({
              type,
              event
            });
          };
          if (!["apply", "clear", "reset", "cancel"].includes(type)) {
            _warn(75);
          }
          const isApply = type === "apply";
          const buttonType = isApply && useForm ? "submit" : "button";
          const button2 = _createElement({
            tag: "button",
            attrs: { type: buttonType },
            ref: `${type}FilterButton`,
            cls: `ag-button ag-standard-button ${className2}-button${isApply ? " " + className2 + "-apply-button" : ""}`,
            children: label2
          });
          this.activateTabIndex([button2]);
          if (isApply) {
            eApplyButton = button2;
          }
          const keydownListener = (event) => {
            if (event.key === KeyCode.ENTER) {
              event.preventDefault();
              clickListener(event);
            }
          };
          const listeners = this.listeners;
          button2.addEventListener("click", clickListener);
          listeners.push(() => button2.removeEventListener("click", clickListener));
          button2.addEventListener("keydown", keydownListener);
          listeners.push(() => button2.removeEventListener("keydown", keydownListener));
          fragment.append(button2);
        };
        for (const button2 of buttons) {
          addButton(button2);
        }
        this.eApply = eApplyButton;
        const tooltip = this.validationTooltipFeature;
        if (eApplyButton && !tooltip) {
          this.validationTooltipFeature = this.createOptionalManagedBean(
            this.beans.registry.createDynamicBean("tooltipFeature", false, {
              getGui: () => this.eApply,
              getLocation: () => "advancedFilter",
              getTooltipShowDelayOverride: () => 1e3
            })
          );
        } else if (!eApplyButton && tooltip) {
          this.validationTooltipFeature = this.destroyBean(tooltip);
        }
        eGui.append(fragment);
      }
      getApplyButton() {
        return this.eApply;
      }
      updateValidity(valid, message2 = null) {
        const eApplyButton = this.eApply;
        if (!eApplyButton) {
          return;
        }
        _setDisabled(eApplyButton, valid === false);
        this.validationMessage = message2 ?? null;
        this.validationTooltipFeature?.setTooltipAndRefresh(this.validationMessage);
      }
      destroyListeners() {
        for (const destroyFunc of this.listeners) {
          destroyFunc();
        }
        this.listeners = [];
      }
      destroy() {
        this.destroyListeners();
        super.destroy();
      }
    };
    var FILTER_LOCALE_TEXT = {
      applyFilter: "Apply",
      clearFilter: "Clear",
      resetFilter: "Reset",
      cancelFilter: "Cancel",
      textFilter: "Text Filter",
      numberFilter: "Number Filter",
      dateFilter: "Date Filter",
      setFilter: "Set Filter",
      filterOoo: "Filter...",
      empty: "Choose one",
      equals: "Equals",
      notEqual: "Does not equal",
      lessThan: "Less than",
      greaterThan: "Greater than",
      inRange: "Between",
      inRangeStart: "From",
      inRangeEnd: "To",
      lessThanOrEqual: "Less than or equal to",
      greaterThanOrEqual: "Greater than or equal to",
      contains: "Contains",
      notContains: "Does not contain",
      startsWith: "Begins with",
      endsWith: "Ends with",
      blank: "Blank",
      notBlank: "Not blank",
      before: "Before",
      after: "After",
      andCondition: "AND",
      orCondition: "OR",
      dateFormatOoo: "yyyy-mm-dd",
      filterSummaryInactive: "is (All)",
      filterSummaryContains: "contains",
      filterSummaryNotContains: "does not contain",
      filterSummaryTextEquals: "equals",
      filterSummaryTextNotEqual: "does not equal",
      filterSummaryStartsWith: "begins with",
      filterSummaryEndsWith: "ends with",
      filterSummaryBlank: "is blank",
      filterSummaryNotBlank: "is not blank",
      filterSummaryEquals: "=",
      filterSummaryNotEqual: "!=",
      filterSummaryGreaterThan: ">",
      filterSummaryGreaterThanOrEqual: ">=",
      filterSummaryLessThan: "<",
      filterSummaryLessThanOrEqual: "<=",
      filterSummaryInRange: "between",
      filterSummaryInRangeValues: (variableValues) => `(${variableValues[0]}, ${variableValues[1]})`,
      filterSummaryTextQuote: (variableValues) => `"${variableValues[0]}"`
    };
    function translateForFilter(bean, key2, variableValues) {
      return _translate(bean, FILTER_LOCALE_TEXT, key2, variableValues);
    }
    function getDebounceMs(params, debounceDefault) {
      const { debounceMs } = params;
      if (_isUseApplyButton(params)) {
        if (debounceMs != null) {
          _warn(71);
        }
        return 0;
      }
      return debounceMs ?? debounceDefault;
    }
    function _isUseApplyButton(params) {
      return (params.buttons?.indexOf("apply") ?? -1) >= 0;
    }
    var FilterWrapperComp = class extends Component {
      constructor(column2, wrapper2, eventParent, updateModel, isGlobalButtons, enableGlobalButtonCheck) {
        super();
        this.column = column2;
        this.wrapper = wrapper2;
        this.eventParent = eventParent;
        this.updateModel = updateModel;
        this.isGlobalButtons = isGlobalButtons;
        this.enableGlobalButtonCheck = enableGlobalButtonCheck;
        this.hidePopup = null;
        this.applyActive = false;
      }
      postConstruct() {
        const { comp: comp2, params: originalParams } = this.wrapper;
        const params = originalParams;
        const useForm = params.useForm;
        const tag = useForm ? "form" : "div";
        this.setTemplate({
          tag,
          cls: "ag-filter-wrapper"
        });
        if (useForm) {
          this.addManagedElementListeners(this.getGui(), {
            submit: (e) => {
              e?.preventDefault();
            },
            keydown: this.handleKeyDown.bind(this)
          });
        }
        this.appendChild(comp2.getGui());
        this.params = params;
        this.resetButtonsPanel(params);
        this.addManagedListeners(this.eventParent, {
          filterParamsChanged: ({ column: column2, params: eventParams }) => {
            if (column2 === this.column) {
              this.resetButtonsPanel(eventParams, this.params);
            }
          },
          filterStateChanged: ({ column: column2, state }) => {
            if (column2 === this.column) {
              this.eButtons?.updateValidity(state.valid !== false);
            }
          },
          filterAction: ({ column: column2, action, event: keyboardEvent }) => {
            if (column2 === this.column) {
              this.afterAction(action, keyboardEvent);
            }
          },
          ...this.enableGlobalButtonCheck ? {
            filterGlobalButtons: ({ isGlobal }) => {
              if (isGlobal !== this.isGlobalButtons) {
                this.isGlobalButtons = isGlobal;
                const currentParams = this.params;
                this.resetButtonsPanel(currentParams, currentParams, true);
              }
            }
          } : void 0
        });
      }
      afterGuiAttached(params) {
        if (params) {
          this.hidePopup = params.hidePopup;
        }
      }
      resetButtonsPanel(newParams, oldParams, forceUpdate) {
        const { buttons: oldButtons, readOnly: oldReadOnly } = oldParams ?? {};
        const { buttons: newButtons, readOnly: readOnly2, useForm } = newParams;
        if (!forceUpdate && oldReadOnly === readOnly2 && _jsonEquals(oldButtons, newButtons)) {
          return;
        }
        const hasButtons = newButtons && newButtons.length > 0 && !newParams.readOnly && !this.isGlobalButtons;
        let eButtonsPanel = this.eButtons;
        if (hasButtons) {
          const buttons = newButtons.map((type) => {
            const localeKey = `${type}Filter`;
            return { type, label: translateForFilter(this, localeKey) };
          });
          this.applyActive = _isUseApplyButton(this.params);
          if (!eButtonsPanel) {
            eButtonsPanel = this.createBean(new FilterButtonComp());
            this.appendChild(eButtonsPanel.getGui());
            const column2 = this.column;
            const getListener2 = (action) => ({ event }) => {
              this.updateModel(column2, action, { fromButtons: true });
              this.afterAction(action, event);
            };
            eButtonsPanel?.addManagedListeners(eButtonsPanel, {
              apply: getListener2("apply"),
              clear: getListener2("clear"),
              reset: getListener2("reset"),
              cancel: getListener2("cancel")
            });
            this.eButtons = eButtonsPanel;
          }
          eButtonsPanel.updateButtons(buttons, useForm);
        } else {
          this.applyActive = false;
          if (eButtonsPanel) {
            _removeFromParent(eButtonsPanel.getGui());
            this.eButtons = this.destroyBean(eButtonsPanel);
          }
        }
      }
      close(e) {
        const hidePopup = this.hidePopup;
        if (!hidePopup) {
          return;
        }
        const keyboardEvent = e;
        const key2 = keyboardEvent?.key;
        let params;
        if (key2 === KeyCode.ENTER || key2 === KeyCode.SPACE) {
          params = { keyboardEvent };
        }
        hidePopup(params);
        this.hidePopup = null;
      }
      afterAction(action, event) {
        const { params, applyActive } = this;
        const closeOnApply = params?.closeOnApply;
        switch (action) {
          case "apply": {
            event?.preventDefault();
            if (closeOnApply && applyActive) {
              this.close(event);
            }
            break;
          }
          case "reset": {
            if (closeOnApply && applyActive) {
              this.close();
            }
            break;
          }
          case "cancel": {
            if (closeOnApply) {
              this.close(event);
            }
            break;
          }
        }
      }
      handleKeyDown(event) {
        if (!event.defaultPrevented && event.key === KeyCode.ENTER && this.applyActive) {
          this.updateModel(this.column, "apply", { fromButtons: true });
          this.afterAction("apply", event);
        }
      }
      destroy() {
        this.hidePopup = null;
        this.eButtons = this.destroyBean(this.eButtons);
      }
    };
    var FilterElement = { tag: "div", cls: "ag-filter" };
    var FilterComp = class extends Component {
      constructor(column2, source2, enableGlobalButtonCheck) {
        super(FilterElement);
        this.column = column2;
        this.source = source2;
        this.enableGlobalButtonCheck = enableGlobalButtonCheck;
        this.wrapper = null;
      }
      postConstruct() {
        this.beans.colFilter?.activeFilterComps.add(this);
        this.createFilter(true);
        this.addManagedEventListeners({ filterDestroyed: this.onFilterDestroyed.bind(this) });
      }
      hasFilter() {
        return this.wrapper != null;
      }
      getFilter() {
        return this.wrapper?.then((wrapper2) => wrapper2.comp) ?? null;
      }
      afterInit() {
        return this.wrapper?.then(() => {
        }) ?? AgPromise.resolve();
      }
      afterGuiAttached(params) {
        this.afterGuiAttachedParams = params;
        this.wrapper?.then((wrapper2) => {
          this.comp?.afterGuiAttached(params);
          wrapper2?.comp?.afterGuiAttached?.(params);
        });
      }
      afterGuiDetached() {
        this.wrapper?.then((wrapper2) => {
          wrapper2?.comp?.afterGuiDetached?.();
        });
      }
      createFilter(init2) {
        const {
          column: column2,
          source: source2,
          beans: { colFilter }
        } = this;
        const filterPromise = colFilter.getFilterUiForDisplay(column2) ?? null;
        this.wrapper = filterPromise;
        filterPromise?.then((wrapper2) => {
          if (!wrapper2) {
            return;
          }
          const { isHandler, comp: comp2 } = wrapper2;
          let filterGui;
          if (isHandler) {
            const enableGlobalButtonCheck = !!this.enableGlobalButtonCheck;
            const displayComp = this.createBean(
              new FilterWrapperComp(
                column2,
                wrapper2,
                colFilter,
                colFilter.updateModel.bind(colFilter),
                enableGlobalButtonCheck && colFilter.isGlobalButtons,
                enableGlobalButtonCheck
              )
            );
            this.comp = displayComp;
            filterGui = displayComp.getGui();
          } else {
            filterGui = comp2.getGui();
            if (!_exists(filterGui)) {
              _warn(69, { guiFromFilter: filterGui });
            }
          }
          this.appendChild(filterGui);
          if (init2) {
            this.eventSvc.dispatchEvent({
              type: "filterOpened",
              column: column2,
              source: source2,
              eGui: this.getGui()
            });
          } else {
            comp2.afterGuiAttached?.(this.afterGuiAttachedParams);
          }
        });
      }
      onFilterDestroyed(event) {
        const { source: source2, column: column2 } = event;
        if ((source2 === "api" || source2 === "paramsUpdated") && column2.getId() === this.column.getId() && this.beans.colModel.getColDefCol(this.column)) {
          _clearElement(this.getGui());
          this.comp = this.destroyBean(this.comp);
          this.createFilter();
        }
      }
      destroy() {
        this.beans.colFilter?.activeFilterComps.delete(this);
        this.eventSvc.dispatchEvent({
          type: "filterClosed",
          column: this.column
        });
        this.wrapper = null;
        this.comp = this.destroyBean(this.comp);
        this.afterGuiAttachedParams = void 0;
        super.destroy();
      }
    };
    var MONTH_LOCALE_TEXT = {
      january: "January",
      february: "February",
      march: "March",
      april: "April",
      may: "May",
      june: "June",
      july: "July",
      august: "August",
      september: "September",
      october: "October",
      november: "November",
      december: "December"
    };
    var MONTH_KEYS = [
      "january",
      "february",
      "march",
      "april",
      "may",
      "june",
      "july",
      "august",
      "september",
      "october",
      "november",
      "december"
    ];
    function setFilterNumberComparator(a, b) {
      if (a == null) {
        return -1;
      }
      if (b == null) {
        return 1;
      }
      return Number.parseFloat(a) - Number.parseFloat(b);
    }
    function isValidDate(value2) {
      return value2 instanceof Date && !isNaN(value2.getTime());
    }
    var filterParamsForEachDataType = {
      number: () => void 0,
      boolean: () => ({
        maxNumConditions: 1,
        debounceMs: 0,
        filterOptions: [
          "empty",
          {
            displayKey: "true",
            displayName: "True",
            predicate: (_filterValues, cellValue) => cellValue,
            numberOfInputs: 0
          },
          {
            displayKey: "false",
            displayName: "False",
            predicate: (_filterValues, cellValue) => cellValue === false,
            numberOfInputs: 0
          }
        ]
      }),
      date: () => ({ isValidDate }),
      dateString: ({ dataTypeDefinition }) => ({
        comparator: (filterDate, cellValue) => {
          const cellAsDate = dataTypeDefinition.dateParser(cellValue);
          if (cellValue == null || cellAsDate < filterDate) {
            return -1;
          }
          if (cellAsDate > filterDate) {
            return 1;
          }
          return 0;
        },
        isValidDate: (value2) => typeof value2 === "string" && isValidDate(dataTypeDefinition.dateParser(value2))
      }),
      dateTime: (args2) => filterParamsForEachDataType.date(args2),
      dateTimeString: (args2) => filterParamsForEachDataType.dateString(args2),
      object: () => void 0,
      text: () => void 0
    };
    var setFilterParamsForEachDataType = {
      number: () => ({ comparator: setFilterNumberComparator }),
      boolean: ({ t: t2 }) => ({
        valueFormatter: (params) => _exists(params.value) ? t2(String(params.value), params.value ? "True" : "False") : t2("blanks", "(Blanks)")
      }),
      date: ({ formatValue, t: t2 }) => ({
        valueFormatter: (params) => {
          const valueFormatted = formatValue(params);
          return _exists(valueFormatted) ? valueFormatted : t2("blanks", "(Blanks)");
        },
        treeList: true,
        treeListFormatter: (pathKey, level) => {
          if (pathKey === "NaN") {
            return t2("invalidDate", "Invalid Date");
          }
          if (level === 1 && pathKey != null) {
            const monthKey = MONTH_KEYS[Number(pathKey) - 1];
            return t2(monthKey, MONTH_LOCALE_TEXT[monthKey]);
          }
          return pathKey ?? t2("blanks", "(Blanks)");
        },
        treeListPathGetter: (date) => _getDateParts(date, false)
      }),
      dateString: ({ formatValue, dataTypeDefinition, t: t2 }) => ({
        valueFormatter: (params) => {
          const valueFormatted = formatValue(params);
          return _exists(valueFormatted) ? valueFormatted : t2("blanks", "(Blanks)");
        },
        treeList: true,
        treeListPathGetter: (value2) => _getDateParts(dataTypeDefinition.dateParser(value2 ?? void 0), false),
        treeListFormatter: (pathKey, level) => {
          if (level === 1 && pathKey != null) {
            const monthKey = MONTH_KEYS[Number(pathKey) - 1];
            return t2(monthKey, MONTH_LOCALE_TEXT[monthKey]);
          }
          return pathKey ?? t2("blanks", "(Blanks)");
        }
      }),
      dateTime: (args2) => {
        const params = setFilterParamsForEachDataType.date(args2);
        params.treeListPathGetter = _getDateParts;
        return params;
      },
      dateTimeString(args2) {
        const convertToDate = args2.dataTypeDefinition.dateParser;
        const params = setFilterParamsForEachDataType.dateString(args2);
        params.treeListPathGetter = (value2) => _getDateParts(convertToDate(value2 ?? void 0));
        return params;
      },
      object: ({ formatValue, t: t2 }) => ({
        valueFormatter: (params) => {
          const valueFormatted = formatValue(params);
          return _exists(valueFormatted) ? valueFormatted : t2("blanks", "(Blanks)");
        }
      }),
      text: () => void 0
    };
    function _getFilterParamsForDataType(filter, existingFilterParams, existingFilterValueGetter, dataTypeDefinition, formatValue, beans, translate) {
      let filterParams = existingFilterParams;
      let filterValueGetter = existingFilterValueGetter;
      const usingSetFilter = filter === "agSetColumnFilter";
      if (!filterValueGetter && dataTypeDefinition.baseDataType === "object" && !usingSetFilter) {
        filterValueGetter = ({ column: column2, node: node2 }) => formatValue({ column: column2, node: node2, value: beans.valueSvc.getValue(column2, node2) });
      }
      const filterParamsMap = usingSetFilter ? setFilterParamsForEachDataType : filterParamsForEachDataType;
      const filterParamsGetter = filterParamsMap[dataTypeDefinition.baseDataType];
      const newFilterParams = filterParamsGetter({ dataTypeDefinition, formatValue, t: translate });
      filterParams = typeof existingFilterParams === "object" ? {
        ...newFilterParams,
        ...existingFilterParams
      } : newFilterParams;
      return { filterParams, filterValueGetter };
    }
    var defaultFilters = {
      boolean: "agTextColumnFilter",
      date: "agDateColumnFilter",
      dateString: "agDateColumnFilter",
      dateTime: "agDateColumnFilter",
      dateTimeString: "agDateColumnFilter",
      number: "agNumberColumnFilter",
      object: "agTextColumnFilter",
      text: "agTextColumnFilter"
    };
    var defaultFloatingFilters = {
      boolean: "agTextColumnFloatingFilter",
      date: "agDateColumnFloatingFilter",
      dateString: "agDateColumnFloatingFilter",
      dateTime: "agDateColumnFloatingFilter",
      dateTimeString: "agDateColumnFloatingFilter",
      number: "agNumberColumnFloatingFilter",
      object: "agTextColumnFloatingFilter",
      text: "agTextColumnFloatingFilter"
    };
    function _getDefaultSimpleFilter(cellDataType, isFloating = false) {
      const filterSet = isFloating ? defaultFloatingFilters : defaultFilters;
      return filterSet[cellDataType ?? "text"];
    }
    var RESIZE_CONTAINER_STYLE = "ag-resizer-wrapper";
    var makeDiv = (dataRefPrefix, classSuffix) => ({
      tag: "div",
      ref: `${dataRefPrefix}Resizer`,
      cls: `ag-resizer ag-resizer-${classSuffix}`
    });
    var RESIZE_TEMPLATE = {
      tag: "div",
      cls: RESIZE_CONTAINER_STYLE,
      children: [
        makeDiv("eTopLeft", "topLeft"),
        makeDiv("eTop", "top"),
        makeDiv("eTopRight", "topRight"),
        makeDiv("eRight", "right"),
        makeDiv("eBottomRight", "bottomRight"),
        makeDiv("eBottom", "bottom"),
        makeDiv("eBottomLeft", "bottomLeft"),
        makeDiv("eLeft", "left")
      ]
    };
    var PositionableFeature = class extends BeanStub {
      constructor(element, config2) {
        super();
        this.element = element;
        this.dragStartPosition = {
          x: 0,
          y: 0
        };
        this.position = {
          x: 0,
          y: 0
        };
        this.lastSize = {
          width: -1,
          height: -1
        };
        this.positioned = false;
        this.resizersAdded = false;
        this.resizeListeners = [];
        this.boundaryEl = null;
        this.isResizing = false;
        this.isMoving = false;
        this.resizable = {};
        this.movable = false;
        this.currentResizer = null;
        this.config = Object.assign({}, { popup: false }, config2);
      }
      wireBeans(beans) {
        this.popupSvc = beans.popupSvc;
        this.dragSvc = beans.dragSvc;
      }
      center(postProcessCallback) {
        const { clientHeight, clientWidth } = this.offsetParent;
        const x2 = clientWidth / 2 - this.getWidth() / 2;
        const y = clientHeight / 2 - this.getHeight() / 2;
        this.offsetElement(x2, y, postProcessCallback);
      }
      initialisePosition(postProcessCallback) {
        if (this.positioned) {
          return;
        }
        const { centered: centered2, forcePopupParentAsOffsetParent, minWidth, width, minHeight, height, x: x2, y } = this.config;
        if (!this.offsetParent) {
          this.setOffsetParent();
        }
        let computedMinHeight = 0;
        let computedMinWidth = 0;
        const isElementVisible = _isVisible(this.element);
        if (isElementVisible) {
          const boundaryEl = this.findBoundaryElement();
          const offsetParentComputedStyles = window.getComputedStyle(boundaryEl);
          if (offsetParentComputedStyles.minWidth != null) {
            const paddingWidth = boundaryEl.offsetWidth - this.element.offsetWidth;
            computedMinWidth = Number.parseInt(offsetParentComputedStyles.minWidth, 10) - paddingWidth;
          }
          if (offsetParentComputedStyles.minHeight != null) {
            const paddingHeight = boundaryEl.offsetHeight - this.element.offsetHeight;
            computedMinHeight = Number.parseInt(offsetParentComputedStyles.minHeight, 10) - paddingHeight;
          }
        }
        this.minHeight = minHeight || computedMinHeight;
        this.minWidth = minWidth || computedMinWidth;
        if (width) {
          this.setWidth(width);
        }
        if (height) {
          this.setHeight(height);
        }
        if (!width || !height) {
          this.refreshSize();
        }
        if (centered2) {
          this.center(postProcessCallback);
        } else if (x2 || y) {
          this.offsetElement(x2, y, postProcessCallback);
        } else if (isElementVisible && forcePopupParentAsOffsetParent) {
          let boundaryEl = this.boundaryEl;
          let initialisedDuringPositioning = true;
          if (!boundaryEl) {
            boundaryEl = this.findBoundaryElement();
            initialisedDuringPositioning = false;
          }
          if (boundaryEl) {
            const top2 = Number.parseFloat(boundaryEl.style.top);
            const left2 = Number.parseFloat(boundaryEl.style.left);
            if (initialisedDuringPositioning) {
              this.offsetElement(isNaN(left2) ? 0 : left2, isNaN(top2) ? 0 : top2, postProcessCallback);
            } else {
              this.setPosition(left2, top2);
            }
          }
        }
        this.positioned = !!this.offsetParent;
      }
      isPositioned() {
        return this.positioned;
      }
      getPosition() {
        return this.position;
      }
      setMovable(movable, moveElement) {
        if (!this.config.popup || movable === this.movable) {
          return;
        }
        this.movable = movable;
        const params = this.moveElementDragListener || {
          eElement: moveElement,
          onDragStart: this.onMoveStart.bind(this),
          onDragging: this.onMove.bind(this),
          onDragStop: this.onMoveEnd.bind(this)
        };
        if (movable) {
          this.dragSvc?.addDragSource(params);
          this.moveElementDragListener = params;
        } else {
          this.dragSvc?.removeDragSource(params);
          this.moveElementDragListener = void 0;
        }
      }
      setResizable(resizable) {
        this.clearResizeListeners();
        if (resizable) {
          this.addResizers();
        } else {
          this.removeResizers();
        }
        if (typeof resizable === "boolean") {
          if (resizable === false) {
            return;
          }
          resizable = {
            topLeft: resizable,
            top: resizable,
            topRight: resizable,
            right: resizable,
            bottomRight: resizable,
            bottom: resizable,
            bottomLeft: resizable,
            left: resizable
          };
        }
        Object.keys(resizable).forEach((side) => {
          const resizableStructure = resizable;
          const isSideResizable = !!resizableStructure[side];
          const resizerEl = this.getResizerElement(side);
          const params = {
            dragStartPixels: 0,
            eElement: resizerEl,
            onDragStart: (e) => this.onResizeStart(e, side),
            onDragging: this.onResize.bind(this),
            onDragStop: (e) => this.onResizeEnd(e, side)
          };
          if (isSideResizable || !this.isAlive() && !isSideResizable) {
            if (isSideResizable) {
              this.dragSvc?.addDragSource(params);
              this.resizeListeners.push(params);
              resizerEl.style.pointerEvents = "all";
            } else {
              resizerEl.style.pointerEvents = "none";
            }
            this.resizable[side] = isSideResizable;
          }
        });
      }
      removeSizeFromEl() {
        this.element.style.removeProperty("height");
        this.element.style.removeProperty("width");
        this.element.style.removeProperty("flex");
      }
      restoreLastSize() {
        this.element.style.flex = "0 0 auto";
        const { height, width } = this.lastSize;
        if (width !== -1) {
          this.element.style.width = `${width}px`;
        }
        if (height !== -1) {
          this.element.style.height = `${height}px`;
        }
      }
      getHeight() {
        return this.element.offsetHeight;
      }
      setHeight(height) {
        const { popup } = this.config;
        const eGui = this.element;
        let isPercent = false;
        if (typeof height === "string" && height.includes("%")) {
          _setFixedHeight(eGui, height);
          height = _getAbsoluteHeight(eGui);
          isPercent = true;
        } else {
          height = Math.max(this.minHeight, height);
          if (this.positioned) {
            const availableHeight = this.getAvailableHeight();
            if (availableHeight && height > availableHeight) {
              height = availableHeight;
            }
          }
        }
        if (this.getHeight() === height) {
          return;
        }
        if (!isPercent) {
          if (popup) {
            _setFixedHeight(eGui, height);
          } else {
            eGui.style.height = `${height}px`;
            eGui.style.flex = "0 0 auto";
            this.lastSize.height = typeof height === "number" ? height : Number.parseFloat(height);
          }
        } else {
          eGui.style.maxHeight = "unset";
          eGui.style.minHeight = "unset";
        }
      }
      getAvailableHeight() {
        const { popup, forcePopupParentAsOffsetParent } = this.config;
        if (!this.positioned) {
          this.initialisePosition();
        }
        const { clientHeight } = this.offsetParent;
        if (!clientHeight) {
          return null;
        }
        const elRect = this.element.getBoundingClientRect();
        const offsetParentRect = this.offsetParent.getBoundingClientRect();
        const yPosition = popup ? this.position.y : elRect.top;
        const parentTop = popup ? 0 : offsetParentRect.top;
        let additionalHeight = 0;
        if (forcePopupParentAsOffsetParent) {
          const parentEl = this.element.parentElement;
          if (parentEl) {
            const { bottom: bottom2 } = parentEl.getBoundingClientRect();
            additionalHeight = bottom2 - elRect.bottom;
          }
        }
        const availableHeight = clientHeight + parentTop - yPosition - additionalHeight;
        return availableHeight;
      }
      getWidth() {
        return this.element.offsetWidth;
      }
      setWidth(width) {
        const eGui = this.element;
        const { popup } = this.config;
        let isPercent = false;
        if (typeof width === "string" && width.includes("%")) {
          _setFixedWidth(eGui, width);
          width = _getAbsoluteWidth(eGui);
          isPercent = true;
        } else if (this.positioned) {
          width = Math.max(this.minWidth, width);
          const { clientWidth } = this.offsetParent;
          const xPosition = popup ? this.position.x : this.element.getBoundingClientRect().left;
          if (clientWidth && width + xPosition > clientWidth) {
            width = clientWidth - xPosition;
          }
        }
        if (this.getWidth() === width) {
          return;
        }
        if (!isPercent) {
          if (this.config.popup) {
            _setFixedWidth(eGui, width);
          } else {
            eGui.style.width = `${width}px`;
            eGui.style.flex = " unset";
            this.lastSize.width = typeof width === "number" ? width : Number.parseFloat(width);
          }
        } else {
          eGui.style.maxWidth = "unset";
          eGui.style.minWidth = "unset";
        }
      }
      offsetElement(x2 = 0, y = 0, postProcessCallback) {
        const { forcePopupParentAsOffsetParent } = this.config;
        const ePopup = forcePopupParentAsOffsetParent ? this.boundaryEl : this.element;
        if (!ePopup) {
          return;
        }
        this.popupSvc?.positionPopup({
          ePopup,
          keepWithinBounds: true,
          skipObserver: this.movable || this.isResizable(),
          updatePosition: () => ({ x: x2, y }),
          postProcessCallback
        });
        this.setPosition(Number.parseFloat(ePopup.style.left), Number.parseFloat(ePopup.style.top));
      }
      constrainSizeToAvailableHeight(constrain) {
        if (!this.config.forcePopupParentAsOffsetParent) {
          return;
        }
        const applyMaxHeightToElement = () => {
          const availableHeight = this.getAvailableHeight();
          this.element.style.setProperty("max-height", `${availableHeight}px`);
        };
        if (constrain && this.popupSvc) {
          this.resizeObserverSubscriber?.();
          this.resizeObserverSubscriber = _observeResize(
            this.beans,
            this.popupSvc?.getPopupParent(),
            applyMaxHeightToElement
          );
        } else {
          this.element.style.removeProperty("max-height");
          if (this.resizeObserverSubscriber) {
            this.resizeObserverSubscriber();
            this.resizeObserverSubscriber = void 0;
          }
        }
      }
      setPosition(x2, y) {
        this.position.x = x2;
        this.position.y = y;
      }
      updateDragStartPosition(x2, y) {
        this.dragStartPosition = { x: x2, y };
      }
      calculateMouseMovement(params) {
        const { e, isLeft, isTop, anywhereWithin, topBuffer } = params;
        const xDiff = e.clientX - this.dragStartPosition.x;
        const yDiff = e.clientY - this.dragStartPosition.y;
        const movementX = this.shouldSkipX(e, !!isLeft, !!anywhereWithin, xDiff) ? 0 : xDiff;
        const movementY = this.shouldSkipY(e, !!isTop, topBuffer, yDiff) ? 0 : yDiff;
        return { movementX, movementY };
      }
      shouldSkipX(e, isLeft, anywhereWithin, diff2) {
        const elRect = this.element.getBoundingClientRect();
        const parentRect = this.offsetParent.getBoundingClientRect();
        const boundaryElRect = this.boundaryEl.getBoundingClientRect();
        const xPosition = this.config.popup ? this.position.x : elRect.left;
        let skipX = xPosition <= 0 && parentRect.left >= e.clientX || parentRect.right <= e.clientX && parentRect.right <= boundaryElRect.right;
        if (skipX) {
          return true;
        }
        if (isLeft) {
          skipX = // skip if we are moving to the left and the cursor
          // is positioned to the right of the left side anchor
          diff2 < 0 && e.clientX > xPosition + parentRect.left || // skip if we are moving to the right and the cursor
          // is positioned to the left of the dialog
          diff2 > 0 && e.clientX < xPosition + parentRect.left;
        } else if (anywhereWithin) {
          skipX = diff2 < 0 && e.clientX > boundaryElRect.right || diff2 > 0 && e.clientX < xPosition + parentRect.left;
        } else {
          skipX = // if the movement is bound to the right side of the dialog
          // we skip if we are moving to the left and the cursor
          // is to the right of the dialog
          diff2 < 0 && e.clientX > boundaryElRect.right || // or skip if we are moving to the right and the cursor
          // is to the left of the right side anchor
          diff2 > 0 && e.clientX < boundaryElRect.right;
        }
        return skipX;
      }
      shouldSkipY(e, isTop, topBuffer = 0, diff2) {
        const elRect = this.element.getBoundingClientRect();
        const parentRect = this.offsetParent.getBoundingClientRect();
        const boundaryElRect = this.boundaryEl.getBoundingClientRect();
        const yPosition = this.config.popup ? this.position.y : elRect.top;
        let skipY = yPosition <= 0 && parentRect.top >= e.clientY || parentRect.bottom <= e.clientY && parentRect.bottom <= boundaryElRect.bottom;
        if (skipY) {
          return true;
        }
        if (isTop) {
          skipY = // skip if we are moving to towards top and the cursor is
          // below the top anchor + topBuffer
          // note: topBuffer is used when moving the dialog using the title bar
          diff2 < 0 && e.clientY > yPosition + parentRect.top + topBuffer || // skip if we are moving to the bottom and the cursor is
          // above the top anchor
          diff2 > 0 && e.clientY < yPosition + parentRect.top;
        } else {
          skipY = // skip if we are moving towards the top and the cursor
          // is below the bottom anchor
          diff2 < 0 && e.clientY > boundaryElRect.bottom || // skip if we are moving towards the bottom and the cursor
          // is above the bottom anchor
          diff2 > 0 && e.clientY < boundaryElRect.bottom;
        }
        return skipY;
      }
      createResizeMap() {
        const getElement2 = (ref) => ({
          element: this.element.querySelector(`[data-ref=${ref}Resizer]`)
        });
        this.resizerMap = {
          topLeft: getElement2("eTopLeft"),
          top: getElement2("eTop"),
          topRight: getElement2("eTopRight"),
          right: getElement2("eRight"),
          bottomRight: getElement2("eBottomRight"),
          bottom: getElement2("eBottom"),
          bottomLeft: getElement2("eBottomLeft"),
          left: getElement2("eLeft")
        };
      }
      addResizers() {
        if (this.resizersAdded) {
          return;
        }
        const eGui = this.element;
        if (!eGui) {
          return;
        }
        eGui.appendChild(_createElement(RESIZE_TEMPLATE));
        this.createResizeMap();
        this.resizersAdded = true;
      }
      removeResizers() {
        this.resizerMap = void 0;
        const resizerEl = this.element.querySelector(`.${RESIZE_CONTAINER_STYLE}`);
        resizerEl?.remove();
        this.resizersAdded = false;
      }
      getResizerElement(side) {
        return this.resizerMap[side].element;
      }
      onResizeStart(e, side) {
        this.boundaryEl = this.findBoundaryElement();
        if (!this.positioned) {
          this.initialisePosition();
        }
        this.currentResizer = {
          isTop: !!side.match(/top/i),
          isRight: !!side.match(/right/i),
          isBottom: !!side.match(/bottom/i),
          isLeft: !!side.match(/left/i)
        };
        this.element.classList.add("ag-resizing");
        this.resizerMap[side].element.classList.add("ag-active");
        const { popup, forcePopupParentAsOffsetParent } = this.config;
        if (!popup && !forcePopupParentAsOffsetParent) {
          this.applySizeToSiblings(this.currentResizer.isBottom || this.currentResizer.isTop);
        }
        this.isResizing = true;
        this.updateDragStartPosition(e.clientX, e.clientY);
      }
      getSiblings() {
        const element = this.element;
        const parent = element.parentElement;
        if (!parent) {
          return null;
        }
        return Array.prototype.slice.call(parent.children).filter((el2) => !el2.classList.contains("ag-hidden"));
      }
      getMinSizeOfSiblings() {
        const siblings = this.getSiblings() || [];
        let height = 0;
        let width = 0;
        for (let i2 = 0; i2 < siblings.length; i2++) {
          const currentEl = siblings[i2];
          const isFlex = !!currentEl.style.flex && currentEl.style.flex !== "0 0 auto";
          if (currentEl === this.element) {
            continue;
          }
          let nextHeight = this.minHeight || 0;
          let nextWidth = this.minWidth || 0;
          if (isFlex) {
            const computedStyle = window.getComputedStyle(currentEl);
            if (computedStyle.minHeight) {
              nextHeight = Number.parseInt(computedStyle.minHeight, 10);
            }
            if (computedStyle.minWidth) {
              nextWidth = Number.parseInt(computedStyle.minWidth, 10);
            }
          } else {
            nextHeight = currentEl.offsetHeight;
            nextWidth = currentEl.offsetWidth;
          }
          height += nextHeight;
          width += nextWidth;
        }
        return { height, width };
      }
      applySizeToSiblings(vertical) {
        let containerToFlex = null;
        const siblings = this.getSiblings();
        if (!siblings) {
          return;
        }
        for (let i2 = 0; i2 < siblings.length; i2++) {
          const el2 = siblings[i2];
          if (el2 === containerToFlex) {
            continue;
          }
          if (vertical) {
            el2.style.height = `${el2.offsetHeight}px`;
          } else {
            el2.style.width = `${el2.offsetWidth}px`;
          }
          el2.style.flex = "0 0 auto";
          if (el2 === this.element) {
            containerToFlex = siblings[i2 + 1];
          }
        }
        if (containerToFlex) {
          containerToFlex.style.removeProperty("height");
          containerToFlex.style.removeProperty("min-height");
          containerToFlex.style.removeProperty("max-height");
          containerToFlex.style.flex = "1 1 auto";
        }
      }
      isResizable() {
        return Object.values(this.resizable).some((value2) => value2);
      }
      onResize(e) {
        if (!this.isResizing || !this.currentResizer) {
          return;
        }
        const { popup, forcePopupParentAsOffsetParent } = this.config;
        const { isTop, isRight, isBottom, isLeft } = this.currentResizer;
        const isHorizontal = isRight || isLeft;
        const isVertical = isBottom || isTop;
        const { movementX, movementY } = this.calculateMouseMovement({ e, isLeft, isTop });
        const xPosition = this.position.x;
        const yPosition = this.position.y;
        let offsetLeft = 0;
        let offsetTop = 0;
        if (isHorizontal && movementX) {
          const direction = isLeft ? -1 : 1;
          const oldWidth = this.getWidth();
          const newWidth = oldWidth + movementX * direction;
          let skipWidth = false;
          if (isLeft) {
            offsetLeft = oldWidth - newWidth;
            if (xPosition + offsetLeft <= 0 || newWidth <= this.minWidth) {
              skipWidth = true;
              offsetLeft = 0;
            }
          }
          if (!skipWidth) {
            this.setWidth(newWidth);
          }
        }
        if (isVertical && movementY) {
          const direction = isTop ? -1 : 1;
          const oldHeight = this.getHeight();
          const newHeight = oldHeight + movementY * direction;
          let skipHeight = false;
          if (isTop) {
            offsetTop = oldHeight - newHeight;
            if (yPosition + offsetTop <= 0 || newHeight <= this.minHeight) {
              skipHeight = true;
              offsetTop = 0;
            }
          } else if (
            // do not let the size of all siblings be higher than the parent container
            !this.config.popup && !this.config.forcePopupParentAsOffsetParent && oldHeight < newHeight && this.getMinSizeOfSiblings().height + newHeight > this.element.parentElement.offsetHeight
          ) {
            skipHeight = true;
          }
          if (!skipHeight) {
            this.setHeight(newHeight);
          }
        }
        this.updateDragStartPosition(e.clientX, e.clientY);
        if ((popup || forcePopupParentAsOffsetParent) && offsetLeft || offsetTop) {
          this.offsetElement(xPosition + offsetLeft, yPosition + offsetTop);
        }
      }
      onResizeEnd(e, side) {
        this.isResizing = false;
        this.currentResizer = null;
        this.boundaryEl = null;
        this.element.classList.remove("ag-resizing");
        this.resizerMap[side].element.classList.remove("ag-active");
        this.dispatchLocalEvent({ type: "resize" });
      }
      refreshSize() {
        const eGui = this.element;
        if (this.config.popup) {
          if (!this.config.width) {
            this.setWidth(eGui.offsetWidth);
          }
          if (!this.config.height) {
            this.setHeight(eGui.offsetHeight);
          }
        }
      }
      onMoveStart(e) {
        this.boundaryEl = this.findBoundaryElement();
        if (!this.positioned) {
          this.initialisePosition();
        }
        this.isMoving = true;
        this.element.classList.add("ag-moving");
        this.updateDragStartPosition(e.clientX, e.clientY);
      }
      onMove(e) {
        if (!this.isMoving) {
          return;
        }
        const { x: x2, y } = this.position;
        let topBuffer;
        if (this.config.calculateTopBuffer) {
          topBuffer = this.config.calculateTopBuffer();
        }
        const { movementX, movementY } = this.calculateMouseMovement({
          e,
          isTop: true,
          anywhereWithin: true,
          topBuffer
        });
        this.offsetElement(x2 + movementX, y + movementY);
        this.updateDragStartPosition(e.clientX, e.clientY);
      }
      onMoveEnd() {
        this.isMoving = false;
        this.boundaryEl = null;
        this.element.classList.remove("ag-moving");
      }
      setOffsetParent() {
        if (this.config.forcePopupParentAsOffsetParent && this.popupSvc) {
          this.offsetParent = this.popupSvc.getPopupParent();
        } else {
          this.offsetParent = this.element.offsetParent;
        }
      }
      findBoundaryElement() {
        let el2 = this.element;
        while (el2) {
          if (window.getComputedStyle(el2).position !== "static") {
            return el2;
          }
          el2 = el2.parentElement;
        }
        return this.element;
      }
      clearResizeListeners() {
        while (this.resizeListeners.length) {
          const params = this.resizeListeners.pop();
          this.dragSvc?.removeDragSource(params);
        }
      }
      destroy() {
        super.destroy();
        if (this.moveElementDragListener) {
          this.dragSvc?.removeDragSource(this.moveElementDragListener);
        }
        this.constrainSizeToAvailableHeight(false);
        this.clearResizeListeners();
        this.removeResizers();
      }
    };
    var AG_GRID_STOP_PROPAGATION = "__ag_Grid_Stop_Propagation";
    function _stopPropagationForAgGrid(event) {
      event[AG_GRID_STOP_PROPAGATION] = true;
    }
    function _isStopPropagationForAgGrid(event) {
      return event[AG_GRID_STOP_PROPAGATION] === true;
    }
    var FOCUS_MANAGED_CLASS = "ag-focus-managed";
    var ManagedFocusFeature = class extends BeanStub {
      constructor(eFocusable, callbacks = {}) {
        super();
        this.eFocusable = eFocusable;
        this.callbacks = callbacks;
        this.callbacks = {
          shouldStopEventPropagation: () => false,
          onTabKeyDown: (e) => {
            if (e.defaultPrevented) {
              return;
            }
            const nextRoot = _findNextFocusableElement(this.beans, this.eFocusable, false, e.shiftKey);
            if (!nextRoot) {
              return;
            }
            nextRoot.focus();
            e.preventDefault();
          },
          ...callbacks
        };
      }
      postConstruct() {
        const {
          eFocusable,
          callbacks: { onFocusIn, onFocusOut }
        } = this;
        eFocusable.classList.add(FOCUS_MANAGED_CLASS);
        this.addKeyDownListeners(eFocusable);
        if (onFocusIn) {
          this.addManagedElementListeners(eFocusable, { focusin: onFocusIn });
        }
        if (onFocusOut) {
          this.addManagedElementListeners(eFocusable, { focusout: onFocusOut });
        }
      }
      addKeyDownListeners(eGui) {
        this.addManagedElementListeners(eGui, {
          keydown: (e) => {
            if (e.defaultPrevented || _isStopPropagationForAgGrid(e)) {
              return;
            }
            const { callbacks } = this;
            if (callbacks.shouldStopEventPropagation(e)) {
              _stopPropagationForAgGrid(e);
              return;
            }
            if (e.key === KeyCode.TAB) {
              callbacks.onTabKeyDown(e);
            } else if (callbacks.handleKeyDown) {
              callbacks.handleKeyDown(e);
            }
          }
        });
      }
    };
    var ProvidedFilter = class extends Component {
      constructor(filterNameKey, cssIdentifier) {
        super();
        this.filterNameKey = filterNameKey;
        this.cssIdentifier = cssIdentifier;
        this.applyActive = false;
        this.debouncePending = false;
        this.defaultDebounceMs = 0;
      }
      postConstruct() {
        const element = {
          tag: "div",
          cls: `ag-filter-body-wrapper ag-${this.cssIdentifier}-body-wrapper`,
          children: [this.createBodyTemplate()]
        };
        this.setTemplate(element, this.getAgComponents());
        this.createManagedBean(
          new ManagedFocusFeature(this.getFocusableElement(), {
            handleKeyDown: this.handleKeyDown.bind(this)
          })
        );
        this.positionableFeature = this.createBean(
          new PositionableFeature(this.getPositionableElement(), {
            forcePopupParentAsOffsetParent: true
          })
        );
      }
      handleKeyDown(_e2) {
      }
      init(legacyParams) {
        const params = legacyParams;
        this.setParams(params);
        this.setModelIntoUi(params.state.model, true).then(() => this.updateUiVisibility());
      }
      refresh(legacyNewParams) {
        const newParams = legacyNewParams;
        const oldParams = this.params;
        this.params = newParams;
        const source2 = newParams.source;
        if (source2 === "colDef") {
          this.updateParams(newParams, oldParams);
        }
        const newState = newParams.state;
        const oldState = this.state;
        this.state = newState;
        if (newState.model !== oldState.model || newState.state !== oldState.state) {
          this.setModelIntoUi(newState.model);
        }
        return true;
      }
      /** Called on init only. Override in subclasses */
      setParams(params) {
        this.params = params;
        this.state = params.state;
        this.commonUpdateParams(params);
      }
      /** Called on refresh only. Override in subclasses */
      updateParams(newParams, oldParams) {
        this.commonUpdateParams(newParams, oldParams);
      }
      commonUpdateParams(newParams, _oldParams) {
        this.applyActive = _isUseApplyButton(newParams);
        this.setupApplyDebounced();
      }
      /**
       * @deprecated v34 Use the same method on the filter handler (`api.getColumnFilterHandler()`) instead.
       */
      doesFilterPass(params) {
        _warn(283);
        const { getHandler, model: model2, column: column2 } = this.params;
        return getHandler().doesFilterPass({
          ...params,
          model: model2,
          handlerParams: this.beans.colFilter.getHandlerParams(column2)
        });
      }
      getFilterTitle() {
        return this.translate(this.filterNameKey);
      }
      /**
       * @deprecated v34 Filters are active when they have a model. Use `api.getColumnFilterModel()` instead.
       */
      isFilterActive() {
        _warn(284);
        return this.params.model != null;
      }
      setupApplyDebounced() {
        const debounceMs = getDebounceMs(this.params, this.defaultDebounceMs);
        const debounceFunc = _debounce(this, this.checkApplyDebounce.bind(this), debounceMs);
        this.applyDebounced = () => {
          this.debouncePending = true;
          debounceFunc();
        };
      }
      checkApplyDebounce() {
        if (this.debouncePending) {
          this.debouncePending = false;
          this.doApplyModel();
        }
      }
      /**
       * @deprecated v34 Use (`api.getColumnFilterModel()`) instead.
       */
      getModel() {
        _warn(285);
        return this.params.model;
      }
      /**
       * @deprecated v34 Use (`api.setColumnFilterModel()`) instead.
       */
      setModel(model2) {
        _warn(286);
        const { beans, params } = this;
        return beans.colFilter.setModelForColumnLegacy(params.column, model2);
      }
      /**
       * Applies changes made in the UI to the filter, and returns true if the model has changed.
       */
      applyModel(_source = "api") {
        return this.doApplyModel();
      }
      canApply(_model) {
        return true;
      }
      doApplyModel(additionalEventAttributes) {
        const { params, state } = this;
        const changed = !this.areModelsEqual(params.model, state.model);
        if (changed) {
          params.onAction("apply", additionalEventAttributes);
        }
        return changed;
      }
      /**
       * @deprecated v34 Internal method - should only be called by the grid.
       */
      onNewRowsLoaded() {
      }
      /**
       * By default, if the change came from a floating filter it will be applied immediately, otherwise if there is no
       * apply button it will be applied after a debounce, otherwise it will not be applied at all. This behaviour can
       * be adjusted by using the apply parameter.
       */
      onUiChanged(apply, afterFloatingFilter = false) {
        this.updateUiVisibility();
        const model2 = this.getModelFromUi();
        const state = {
          model: model2,
          state: this.getState(),
          valid: this.canApply(model2)
        };
        this.state = state;
        const params = this.params;
        params.onStateChange(state);
        params.onUiChange(this.getUiChangeEventParams());
        if (!this.gos.get("enableFilterHandlers")) {
          this.eventSvc.dispatchEvent({
            type: "filterModified",
            column: params.column,
            filterInstance: this
          });
        }
        apply ?? (apply = this.applyActive ? void 0 : "debounce");
        if (apply === "immediately") {
          this.doApplyModel({ afterFloatingFilter, afterDataChange: false });
        } else if (apply === "debounce") {
          this.applyDebounced();
        }
      }
      getState() {
        return void 0;
      }
      getUiChangeEventParams() {
        return void 0;
      }
      afterGuiAttached(params) {
        this.lastContainerType = params?.container;
        this.refreshFilterResizer(params?.container);
      }
      refreshFilterResizer(containerType) {
        const { positionableFeature, gos } = this;
        if (!positionableFeature) {
          return;
        }
        const isResizable = containerType === "floatingFilter" || containerType === "columnFilter";
        if (isResizable) {
          positionableFeature.restoreLastSize();
          positionableFeature.setResizable(
            gos.get("enableRtl") ? { bottom: true, bottomLeft: true, left: true } : { bottom: true, bottomRight: true, right: true }
          );
        } else {
          positionableFeature.removeSizeFromEl();
          positionableFeature.setResizable(false);
        }
        positionableFeature.constrainSizeToAvailableHeight(isResizable);
      }
      afterGuiDetached() {
        this.checkApplyDebounce();
        this.positionableFeature?.constrainSizeToAvailableHeight(false);
      }
      destroy() {
        this.positionableFeature = this.destroyBean(this.positionableFeature);
        super.destroy();
      }
      translate(key2) {
        return translateForFilter(this, key2);
      }
      // override to control positionable feature
      getPositionableElement() {
        return this.getGui();
      }
      areModelsEqual(a, b) {
        if (a === b || a == null && b == null) {
          return true;
        }
        if (a == null || b == null) {
          return false;
        }
        return this.areNonNullModelsEqual(a, b);
      }
    };
    function isCombinedFilterModel(model2) {
      return !!model2.operator;
    }
    function _getDefaultFloatingFilterType(frameworkOverrides, def, getFromDefault) {
      if (def == null) {
        return null;
      }
      let defaultFloatingFilterType = null;
      const { compName, jsComp, fwComp } = _getFilterCompKeys(frameworkOverrides, def);
      if (compName) {
        const floatingFilterTypeMap = {
          agSetColumnFilter: "agSetColumnFloatingFilter",
          agMultiColumnFilter: "agMultiColumnFloatingFilter",
          agGroupColumnFilter: "agGroupColumnFloatingFilter",
          agNumberColumnFilter: "agNumberColumnFloatingFilter",
          agDateColumnFilter: "agDateColumnFloatingFilter",
          agTextColumnFilter: "agTextColumnFloatingFilter"
        };
        defaultFloatingFilterType = floatingFilterTypeMap[compName];
      } else {
        const usingDefaultFilter = jsComp == null && fwComp == null && def.filter === true;
        if (usingDefaultFilter) {
          defaultFloatingFilterType = getFromDefault();
        }
      }
      return defaultFloatingFilterType;
    }
    var LayoutCssClasses = {
      AUTO_HEIGHT: "ag-layout-auto-height",
      NORMAL: "ag-layout-normal",
      PRINT: "ag-layout-print"
    };
    var LayoutFeature = class extends BeanStub {
      constructor(view) {
        super();
        this.view = view;
      }
      postConstruct() {
        this.addManagedPropertyListener("domLayout", this.updateLayoutClasses.bind(this));
        this.updateLayoutClasses();
      }
      updateLayoutClasses() {
        const domLayout = this.gos.get("domLayout");
        const params = {
          autoHeight: domLayout === "autoHeight",
          normal: domLayout === "normal",
          print: domLayout === "print"
        };
        const cssClass = params.autoHeight ? LayoutCssClasses.AUTO_HEIGHT : params.print ? LayoutCssClasses.PRINT : LayoutCssClasses.NORMAL;
        this.view.updateLayoutClasses(cssClass, params);
      }
    };
    var VIEWPORT = "Viewport";
    var FAKE_V_SCROLLBAR = "fakeVScrollComp";
    var HORIZONTAL_SOURCES = [
      "fakeHScrollComp",
      "centerHeader",
      "topCenter",
      "bottomCenter",
      "stickyTopCenter",
      "stickyBottomCenter"
    ];
    var SCROLL_DEBOUNCE_TIMEOUT = 100;
    var SCROLL_END_TIMEOUT = 150;
    var GridBodyScrollFeature = class extends BeanStub {
      constructor(eBodyViewport) {
        super();
        this.clearRetryListenerFncs = [];
        this.lastScrollSource = [null, null];
        this.scrollLeft = -1;
        this.nextScrollTop = -1;
        this.scrollTop = -1;
        this.lastOffsetHeight = -1;
        this.lastScrollTop = -1;
        this.lastIsHorizontalScrollShowing = false;
        this.scrollTimer = 0;
        this.isScrollActive = false;
        this.isVerticalPositionInvalidated = true;
        this.isHorizontalPositionInvalidated = true;
        this.eBodyViewport = eBodyViewport;
        this.resetLastHScrollDebounced = _debounce(
          this,
          () => this.lastScrollSource[
            1
            /* Horizontal */
          ] = null,
          SCROLL_END_TIMEOUT
        );
        this.resetLastVScrollDebounced = _debounce(
          this,
          () => this.lastScrollSource[
            0
            /* Vertical */
          ] = null,
          SCROLL_END_TIMEOUT
        );
      }
      wireBeans(beans) {
        this.ctrlsSvc = beans.ctrlsSvc;
        this.animationFrameSvc = beans.animationFrameSvc;
        this.visibleCols = beans.visibleCols;
      }
      destroy() {
        super.destroy();
        this.clearRetryListenerFncs = [];
        window.clearTimeout(this.scrollTimer);
      }
      postConstruct() {
        this.enableRtl = this.gos.get("enableRtl");
        const invalidateVerticalScroll = this.invalidateVerticalScroll.bind(this);
        const invalidateHorizontalScroll = this.invalidateHorizontalScroll.bind(this);
        this.addManagedEventListeners({
          displayedColumnsWidthChanged: this.onDisplayedColumnsWidthChanged.bind(this),
          bodyHeightChanged: invalidateVerticalScroll,
          // We only invalidate horizontal scrolling when the viewport switches
          // between scrollable and non-scrollable, avoiding unnecessary
          // invalidation on every gridSizeChanged event. If more properties
          // require invalidation, read/write DOM cycles may be needed.
          scrollGapChanged: invalidateHorizontalScroll
        });
        this.addManagedElementListeners(this.eBodyViewport, {
          scroll: invalidateVerticalScroll
        });
        this.ctrlsSvc.whenReady(this, (p) => {
          this.centerRowsCtrl = p.center;
          this.onDisplayedColumnsWidthChanged();
          this.addScrollListener();
        });
      }
      invalidateHorizontalScroll() {
        this.isHorizontalPositionInvalidated = true;
      }
      invalidateVerticalScroll() {
        this.isVerticalPositionInvalidated = true;
      }
      addScrollListener() {
        this.addHorizontalScrollListeners();
        this.addVerticalScrollListeners();
      }
      addHorizontalScrollListeners() {
        this.addManagedElementListeners(this.centerRowsCtrl.eViewport, {
          scroll: this.onHScroll.bind(this, VIEWPORT)
        });
        for (const source2 of HORIZONTAL_SOURCES) {
          const scrollPartner = this.ctrlsSvc.get(source2);
          this.registerScrollPartner(scrollPartner, this.onHScroll.bind(this, source2));
        }
      }
      addVerticalScrollListeners() {
        const fakeVScrollComp = this.ctrlsSvc.get("fakeVScrollComp");
        const isDebounce = this.gos.get("debounceVerticalScrollbar");
        const onVScroll = isDebounce ? _debounce(this, this.onVScroll.bind(this, VIEWPORT), SCROLL_DEBOUNCE_TIMEOUT) : this.onVScroll.bind(this, VIEWPORT);
        const onFakeVScroll = isDebounce ? _debounce(this, this.onVScroll.bind(this, FAKE_V_SCROLLBAR), SCROLL_DEBOUNCE_TIMEOUT) : this.onVScroll.bind(this, FAKE_V_SCROLLBAR);
        this.addManagedElementListeners(this.eBodyViewport, { scroll: onVScroll });
        this.registerScrollPartner(fakeVScrollComp, onFakeVScroll);
      }
      registerScrollPartner(comp2, callback) {
        comp2.onScrollCallback(callback);
      }
      onDisplayedColumnsWidthChanged() {
        if (this.enableRtl) {
          this.horizontallyScrollHeaderCenterAndFloatingCenter();
        }
      }
      horizontallyScrollHeaderCenterAndFloatingCenter(scrollLeft) {
        const notYetInitialised = this.centerRowsCtrl == null;
        if (notYetInitialised) {
          return;
        }
        if (scrollLeft === void 0) {
          scrollLeft = this.centerRowsCtrl.getCenterViewportScrollLeft();
        }
        this.setScrollLeftForAllContainersExceptCurrent(Math.abs(scrollLeft));
      }
      setScrollLeftForAllContainersExceptCurrent(scrollLeft) {
        for (const container2 of [...HORIZONTAL_SOURCES, VIEWPORT]) {
          if (this.lastScrollSource[
            1
            /* Horizontal */
          ] === container2) {
            continue;
          }
          const viewport2 = this.getViewportForSource(container2);
          _setScrollLeft(viewport2, scrollLeft, this.enableRtl);
        }
      }
      getViewportForSource(source2) {
        if (source2 === VIEWPORT) {
          return this.centerRowsCtrl.eViewport;
        }
        return this.ctrlsSvc.get(source2).eViewport;
      }
      isControllingScroll(source2, direction) {
        if (this.lastScrollSource[direction] == null) {
          if (direction === 0) {
            this.lastScrollSource[0] = source2;
          } else {
            this.lastScrollSource[1] = source2;
          }
          return true;
        }
        return this.lastScrollSource[direction] === source2;
      }
      onHScroll(source2) {
        if (!this.isControllingScroll(
          source2,
          1
          /* Horizontal */
        )) {
          return;
        }
        const centerContainerViewport = this.centerRowsCtrl.eViewport;
        const { scrollLeft } = centerContainerViewport;
        if (this.shouldBlockScrollUpdate(1, scrollLeft, true)) {
          return;
        }
        const newScrollLeft = _getScrollLeft(this.getViewportForSource(source2), this.enableRtl);
        this.doHorizontalScroll(newScrollLeft);
        this.resetLastHScrollDebounced();
      }
      onVScroll(source2) {
        if (!this.isControllingScroll(
          source2,
          0
          /* Vertical */
        )) {
          return;
        }
        let scrollTop;
        if (source2 === VIEWPORT) {
          scrollTop = this.eBodyViewport.scrollTop;
        } else {
          scrollTop = this.ctrlsSvc.get("fakeVScrollComp").getScrollPosition();
        }
        if (this.shouldBlockScrollUpdate(0, scrollTop, true)) {
          return;
        }
        const { animationFrameSvc } = this;
        animationFrameSvc?.setScrollTop(scrollTop);
        this.nextScrollTop = scrollTop;
        if (source2 === VIEWPORT) {
          this.ctrlsSvc.get("fakeVScrollComp").setScrollPosition(scrollTop);
        } else {
          this.eBodyViewport.scrollTop = scrollTop;
        }
        if (animationFrameSvc?.active) {
          animationFrameSvc.schedule();
        } else {
          this.scrollGridIfNeeded(true);
        }
        this.resetLastVScrollDebounced();
      }
      doHorizontalScroll(scrollLeft) {
        const fakeScrollLeft = this.ctrlsSvc.get("fakeHScrollComp").getScrollPosition();
        if (this.scrollLeft === scrollLeft && scrollLeft === fakeScrollLeft) {
          return;
        }
        this.scrollLeft = scrollLeft;
        this.fireScrollEvent(
          1
          /* Horizontal */
        );
        this.horizontallyScrollHeaderCenterAndFloatingCenter(scrollLeft);
        this.centerRowsCtrl.onHorizontalViewportChanged(true);
      }
      isScrolling() {
        return this.isScrollActive;
      }
      fireScrollEvent(direction) {
        const bodyScrollEvent = {
          type: "bodyScroll",
          direction: direction === 1 ? "horizontal" : "vertical",
          left: this.scrollLeft,
          top: this.scrollTop
        };
        this.isScrollActive = true;
        this.eventSvc.dispatchEvent(bodyScrollEvent);
        window.clearTimeout(this.scrollTimer);
        this.scrollTimer = window.setTimeout(() => {
          this.scrollTimer = 0;
          this.isScrollActive = false;
          this.eventSvc.dispatchEvent({
            ...bodyScrollEvent,
            type: "bodyScrollEnd"
          });
        }, SCROLL_END_TIMEOUT);
      }
      shouldBlockScrollUpdate(direction, scrollTo, touchOnly = false) {
        if (touchOnly && !_isIOSUserAgent()) {
          return false;
        }
        if (direction === 0) {
          return this.shouldBlockVerticalScroll(scrollTo);
        }
        return this.shouldBlockHorizontalScroll(scrollTo);
      }
      shouldBlockVerticalScroll(scrollTo) {
        const clientHeight = _getInnerHeight(this.eBodyViewport);
        const { scrollHeight } = this.eBodyViewport;
        return !!(scrollTo < 0 || scrollTo + clientHeight > scrollHeight);
      }
      shouldBlockHorizontalScroll(scrollTo) {
        const clientWidth = this.centerRowsCtrl.getCenterWidth();
        const { scrollWidth } = this.centerRowsCtrl.eViewport;
        if (this.enableRtl) {
          if (scrollTo > 0) {
            return true;
          }
        } else if (scrollTo < 0) {
          return true;
        }
        return Math.abs(scrollTo) + clientWidth > scrollWidth;
      }
      redrawRowsAfterScroll() {
        this.fireScrollEvent(
          0
          /* Vertical */
        );
      }
      // this is to cater for AG-3274, where grid is removed from the dom and then inserted back in again.
      // (which happens with some implementations of tabbing). this can result in horizontal scroll getting
      // reset back to the left, however no scroll event is fired. so we need to get header to also scroll
      // back to the left to be kept in sync.
      // adding and removing the grid from the DOM both resets the scroll position and
      // triggers a resize event, so notify listeners if the scroll position has changed
      checkScrollLeft() {
        const scrollLeft = this.scrollLeft;
        let hasHorizontalScrollersOutOfSync = false;
        for (const source2 of HORIZONTAL_SOURCES) {
          const viewport2 = this.getViewportForSource(source2);
          if (viewport2.scrollLeft !== scrollLeft) {
            hasHorizontalScrollersOutOfSync = true;
            break;
          }
        }
        if (hasHorizontalScrollersOutOfSync) {
          this.onHScroll(VIEWPORT);
        }
      }
      scrollGridIfNeeded(suppressedAnimationFrame = false) {
        const frameNeeded = this.scrollTop != this.nextScrollTop;
        if (frameNeeded) {
          this.scrollTop = this.nextScrollTop;
          if (suppressedAnimationFrame) {
            this.invalidateVerticalScroll();
          }
          this.redrawRowsAfterScroll();
        }
        return frameNeeded;
      }
      // called by scrollHorizontally method and alignedGridsService
      setHorizontalScrollPosition(hScrollPosition, fromAlignedGridsService = false) {
        const minScrollLeft = 0;
        const maxScrollLeft = this.centerRowsCtrl.eViewport.scrollWidth - this.centerRowsCtrl.getCenterWidth();
        if (!fromAlignedGridsService && this.shouldBlockScrollUpdate(1, hScrollPosition)) {
          if (this.enableRtl) {
            hScrollPosition = hScrollPosition > 0 ? 0 : maxScrollLeft;
          } else {
            hScrollPosition = Math.min(Math.max(hScrollPosition, minScrollLeft), maxScrollLeft);
          }
        }
        _setScrollLeft(this.centerRowsCtrl.eViewport, Math.abs(hScrollPosition), this.enableRtl);
        this.doHorizontalScroll(hScrollPosition);
      }
      setVerticalScrollPosition(vScrollPosition) {
        this.invalidateVerticalScroll();
        this.eBodyViewport.scrollTop = vScrollPosition;
      }
      getVScrollPosition() {
        if (!this.isVerticalPositionInvalidated) {
          const { lastOffsetHeight, lastScrollTop } = this;
          return {
            top: lastScrollTop,
            bottom: lastScrollTop + lastOffsetHeight
          };
        }
        this.isVerticalPositionInvalidated = false;
        const { scrollTop, offsetHeight } = this.eBodyViewport;
        this.lastScrollTop = scrollTop;
        this.lastOffsetHeight = offsetHeight;
        return {
          top: scrollTop,
          bottom: scrollTop + offsetHeight
        };
      }
      /** Get an approximate scroll position that returns the last real value read.
       * This is useful for avoiding repeated DOM reads that force the browser to recalculate styles.
       * This can have big performance improvements but may not be 100% accurate so only use if this is acceptable.
       */
      getApproximateVScollPosition() {
        if (this.lastScrollTop >= 0 && this.lastOffsetHeight >= 0) {
          return {
            top: this.scrollTop,
            bottom: this.scrollTop + this.lastOffsetHeight
          };
        }
        return this.getVScrollPosition();
      }
      getHScrollPosition() {
        return this.centerRowsCtrl.getHScrollPosition();
      }
      isHorizontalScrollShowing() {
        if (this.isHorizontalPositionInvalidated) {
          this.lastIsHorizontalScrollShowing = this.centerRowsCtrl.isHorizontalScrollShowing();
          this.isHorizontalPositionInvalidated = false;
        }
        return this.lastIsHorizontalScrollShowing;
      }
      // called by the headerRootComp and moveColumnController
      scrollHorizontally(pixels) {
        const oldScrollPosition = this.centerRowsCtrl.eViewport.scrollLeft;
        this.setHorizontalScrollPosition(oldScrollPosition + pixels);
        return this.centerRowsCtrl.eViewport.scrollLeft - oldScrollPosition;
      }
      // gets called by rowRenderer when new data loaded, as it will want to scroll to the top
      scrollToTop() {
        this.eBodyViewport.scrollTop = 0;
      }
      // Valid values for position are bottom, middle and top
      ensureNodeVisible(comparator, position = null) {
        const { rowModel } = this.beans;
        const rowCount = rowModel.getRowCount();
        let indexToSelect = -1;
        for (let i2 = 0; i2 < rowCount; i2++) {
          const node2 = rowModel.getRow(i2);
          if (typeof comparator === "function") {
            const predicate = comparator;
            if (node2 && predicate(node2)) {
              indexToSelect = i2;
              break;
            }
          } else if (comparator === node2 || comparator === node2.data) {
            indexToSelect = i2;
            break;
          }
        }
        if (indexToSelect >= 0) {
          this.ensureIndexVisible(indexToSelect, position);
        }
      }
      // Valid values for position are bottom, middle and top
      // position should be {'top','middle','bottom', or undefined/null}.
      // if undefined/null, then the grid will to the minimal amount of scrolling,
      // eg if grid needs to scroll up, it scrolls until row is on top,
      //    if grid needs to scroll down, it scrolls until row is on bottom,
      //    if row is already in view, grid does not scroll
      ensureIndexVisible(index, position, retry = 0) {
        if (_isDomLayout(this.gos, "print")) {
          return;
        }
        const { rowModel } = this.beans;
        const rowCount = rowModel.getRowCount();
        if (typeof index !== "number" || index < 0 || index >= rowCount) {
          _warn(88, { index });
          return;
        }
        this.clearRetryListeners();
        const { frameworkOverrides, pageBounds, rowContainerHeight: heightScaler, rowRenderer } = this.beans;
        frameworkOverrides.wrapIncoming(() => {
          const gridBodyCtrl = this.ctrlsSvc.getGridBodyCtrl();
          const rowNode = rowModel.getRow(index);
          let rowGotShiftedDuringOperation;
          let stickyHeightsChanged;
          let attempt = 0;
          this.invalidateVerticalScroll();
          do {
            const { stickyTopHeight, stickyBottomHeight } = gridBodyCtrl;
            const startingRowTop = rowNode.rowTop;
            const startingRowHeight = rowNode.rowHeight;
            const paginationOffset = pageBounds.getPixelOffset();
            const rowTopPixel = rowNode.rowTop - paginationOffset;
            const rowBottomPixel = rowTopPixel + rowNode.rowHeight;
            const scrollPosition = this.getVScrollPosition();
            const heightOffset = heightScaler.divStretchOffset;
            const vScrollTop = scrollPosition.top + heightOffset;
            const vScrollBottom = scrollPosition.bottom + heightOffset;
            const viewportHeight = vScrollBottom - vScrollTop;
            const pxTop = heightScaler.getScrollPositionForPixel(rowTopPixel);
            const pxBottom = heightScaler.getScrollPositionForPixel(rowBottomPixel - viewportHeight);
            const pxMiddle = Math.min((pxTop + pxBottom) / 2, rowTopPixel);
            const rowAboveViewport = vScrollTop + stickyTopHeight > rowTopPixel;
            const rowBelowViewport = vScrollBottom - stickyBottomHeight < rowBottomPixel;
            let newScrollPosition = null;
            if (position === "top") {
              newScrollPosition = pxTop - stickyTopHeight;
            } else if (position === "bottom") {
              newScrollPosition = pxBottom + stickyBottomHeight;
            } else if (position === "middle") {
              newScrollPosition = pxMiddle;
            } else if (rowAboveViewport) {
              newScrollPosition = pxTop - stickyTopHeight;
            } else if (rowBelowViewport) {
              if (pxBottom - pxTop > viewportHeight) {
                newScrollPosition = pxTop - stickyTopHeight;
              } else {
                newScrollPosition = pxBottom + stickyBottomHeight;
              }
            }
            if (newScrollPosition !== null) {
              this.setVerticalScrollPosition(newScrollPosition);
              rowRenderer.redraw({ afterScroll: true });
            }
            rowGotShiftedDuringOperation = startingRowTop !== rowNode.rowTop || startingRowHeight !== rowNode.rowHeight;
            stickyHeightsChanged = stickyTopHeight !== gridBodyCtrl.stickyTopHeight || stickyBottomHeight !== gridBodyCtrl.stickyBottomHeight;
            attempt++;
          } while ((rowGotShiftedDuringOperation || stickyHeightsChanged) && attempt < 10);
          this.animationFrameSvc?.flushAllFrames();
          if (retry < 10 && (rowNode?.stub || !this.beans.rowAutoHeight?.areRowsMeasured())) {
            const scrollTop = this.getVScrollPosition().top;
            this.clearRetryListenerFncs = this.addManagedEventListeners({
              bodyScroll: () => {
                const newScrollTop = this.getVScrollPosition().top;
                if (scrollTop === newScrollTop) {
                  return;
                }
                this.clearRetryListeners();
              },
              modelUpdated: () => {
                this.clearRetryListeners();
                if (index >= rowModel.getRowCount()) {
                  return;
                }
                this.ensureIndexVisible(index, position, retry + 1);
              }
            });
          }
        });
      }
      clearRetryListeners() {
        for (const callback of this.clearRetryListenerFncs) {
          callback();
        }
        this.clearRetryListenerFncs = [];
      }
      ensureColumnVisible(key2, position = "auto") {
        const { colModel, frameworkOverrides } = this.beans;
        const column2 = colModel.getCol(key2);
        if (!column2) {
          return;
        }
        if (column2.isPinned()) {
          return;
        }
        if (!this.visibleCols.isColDisplayed(column2)) {
          return;
        }
        const newHorizontalScroll = this.getPositionedHorizontalScroll(column2, position);
        frameworkOverrides.wrapIncoming(() => {
          if (newHorizontalScroll !== null) {
            this.centerRowsCtrl.setCenterViewportScrollLeft(newHorizontalScroll);
          }
          this.centerRowsCtrl.onHorizontalViewportChanged();
          this.animationFrameSvc?.flushAllFrames();
        });
      }
      getPositionedHorizontalScroll(column2, position) {
        const { columnBeforeStart, columnAfterEnd } = this.isColumnOutsideViewport(column2);
        const viewportTooSmallForColumn = this.centerRowsCtrl.getCenterWidth() < column2.getActualWidth();
        const viewportWidth = this.centerRowsCtrl.getCenterWidth();
        const isRtl = this.enableRtl;
        let alignColToStart = (isRtl ? columnBeforeStart : columnAfterEnd) || viewportTooSmallForColumn;
        let alignColToEnd = isRtl ? columnAfterEnd : columnBeforeStart;
        if (position !== "auto") {
          alignColToStart = position === "start";
          alignColToEnd = position === "end";
        }
        const isMiddle = position === "middle";
        if (alignColToStart || alignColToEnd || isMiddle) {
          const { colLeft, colMiddle, colRight } = this.getColumnBounds(column2);
          if (isMiddle) {
            return colMiddle - viewportWidth / 2;
          }
          if (alignColToStart) {
            return isRtl ? colRight : colLeft;
          }
          return isRtl ? colLeft - viewportWidth : colRight - viewportWidth;
        }
        return null;
      }
      isColumnOutsideViewport(column2) {
        const { start: viewportStart, end: viewportEnd } = this.getViewportBounds();
        const { colLeft, colRight } = this.getColumnBounds(column2);
        const isRtl = this.enableRtl;
        const columnBeforeStart = isRtl ? viewportStart > colRight : viewportEnd < colRight;
        const columnAfterEnd = isRtl ? viewportEnd < colLeft : viewportStart > colLeft;
        return { columnBeforeStart, columnAfterEnd };
      }
      getColumnBounds(column2) {
        const isRtl = this.enableRtl;
        const bodyWidth = this.visibleCols.bodyWidth;
        const colWidth = column2.getActualWidth();
        const colLeft = column2.getLeft();
        const multiplier = isRtl ? -1 : 1;
        const colLeftPixel = isRtl ? bodyWidth - colLeft : colLeft;
        const colRightPixel = colLeftPixel + colWidth * multiplier;
        const colMidPixel = colLeftPixel + colWidth / 2 * multiplier;
        return { colLeft: colLeftPixel, colMiddle: colMidPixel, colRight: colRightPixel };
      }
      getViewportBounds() {
        const viewportWidth = this.centerRowsCtrl.getCenterWidth();
        const scrollPosition = this.centerRowsCtrl.getCenterViewportScrollLeft();
        const viewportStartPixel = scrollPosition;
        const viewportEndPixel = viewportWidth + scrollPosition;
        return { start: viewportStartPixel, end: viewportEndPixel, width: viewportWidth };
      }
    };
    var CenterWidthFeature = class extends BeanStub {
      constructor(callback, addSpacer = false) {
        super();
        this.callback = callback;
        this.addSpacer = addSpacer;
      }
      postConstruct() {
        const listener = this.setWidth.bind(this);
        this.addManagedPropertyListener("domLayout", listener);
        this.addManagedEventListeners({
          columnContainerWidthChanged: listener,
          displayedColumnsChanged: listener,
          leftPinnedWidthChanged: listener
        });
        if (this.addSpacer) {
          this.addManagedEventListeners({
            rightPinnedWidthChanged: listener,
            scrollVisibilityChanged: listener,
            scrollbarWidthChanged: listener
          });
        }
        this.setWidth();
      }
      setWidth() {
        const printLayout = _isDomLayout(this.gos, "print");
        const { visibleCols, scrollVisibleSvc } = this.beans;
        const centerWidth = visibleCols.bodyWidth;
        const leftWidth = visibleCols.getColsLeftWidth();
        const rightWidth = visibleCols.getDisplayedColumnsRightWidth();
        let totalWidth;
        if (printLayout) {
          totalWidth = centerWidth + leftWidth + rightWidth;
        } else {
          totalWidth = centerWidth;
          if (this.addSpacer) {
            const relevantWidth = this.gos.get("enableRtl") ? leftWidth : rightWidth;
            if (relevantWidth === 0 && scrollVisibleSvc.verticalScrollShowing) {
              totalWidth += scrollVisibleSvc.getScrollbarWidth();
            }
          }
        }
        this.callback(totalWidth);
      }
    };
    var ViewportSizeFeature = class extends BeanStub {
      constructor(centerContainerCtrl) {
        super();
        this.centerContainerCtrl = centerContainerCtrl;
      }
      wireBeans(beans) {
        this.scrollVisibleSvc = beans.scrollVisibleSvc;
      }
      postConstruct() {
        this.beans.ctrlsSvc.whenReady(this, (p) => {
          this.gridBodyCtrl = p.gridBodyCtrl;
          this.listenForResize();
        });
        this.addManagedEventListeners({ scrollbarWidthChanged: this.onScrollbarWidthChanged.bind(this) });
        this.addManagedPropertyListeners(["alwaysShowHorizontalScroll", "alwaysShowVerticalScroll"], () => {
          this.checkViewportAndScrolls();
        });
      }
      listenForResize() {
        const { beans, centerContainerCtrl, gridBodyCtrl } = this;
        const listener = () => {
          _requestAnimationFrame(beans, () => {
            this.onCenterViewportResized();
          });
        };
        centerContainerCtrl.registerViewportResizeListener(listener);
        gridBodyCtrl.registerBodyViewportResizeListener(listener);
      }
      onScrollbarWidthChanged() {
        this.checkViewportAndScrolls();
      }
      onCenterViewportResized() {
        this.scrollVisibleSvc.updateScrollGap();
        if (this.centerContainerCtrl.isViewportInTheDOMTree()) {
          const { pinnedCols, colFlex } = this.beans;
          pinnedCols?.keepPinnedColumnsNarrowerThanViewport();
          this.checkViewportAndScrolls();
          const newWidth = this.centerContainerCtrl.getCenterWidth();
          if (newWidth !== this.centerWidth) {
            this.centerWidth = newWidth;
            colFlex?.refreshFlexedColumns({
              viewportWidth: this.centerWidth,
              updateBodyWidths: true,
              fireResizedEvent: true
            });
          }
        } else {
          this.bodyHeight = 0;
        }
      }
      // gets called every time the viewport size changes. we use this to check visibility of scrollbars
      // in the grid panel, and also to check size and position of viewport for row and column virtualisation.
      checkViewportAndScrolls() {
        this.updateScrollVisibleService();
        this.checkBodyHeight();
        this.onHorizontalViewportChanged();
        this.gridBodyCtrl.scrollFeature.checkScrollLeft();
      }
      getBodyHeight() {
        return this.bodyHeight;
      }
      checkBodyHeight() {
        const eBodyViewport = this.gridBodyCtrl.eBodyViewport;
        const bodyHeight = _getInnerHeight(eBodyViewport);
        if (this.bodyHeight !== bodyHeight) {
          this.bodyHeight = bodyHeight;
          this.eventSvc.dispatchEvent({
            type: "bodyHeightChanged"
          });
        }
      }
      updateScrollVisibleService() {
        this.updateScrollVisibleServiceImpl();
        setTimeout(this.updateScrollVisibleServiceImpl.bind(this), 500);
      }
      updateScrollVisibleServiceImpl() {
        if (!this.isAlive()) {
          return;
        }
        const params = {
          horizontalScrollShowing: this.centerContainerCtrl.isHorizontalScrollShowing(),
          verticalScrollShowing: this.gridBodyCtrl.isVerticalScrollShowing()
        };
        this.scrollVisibleSvc.setScrollsVisible(params);
      }
      // this gets called whenever a change in the viewport, so we can inform column controller it has to work
      // out the virtual columns again. gets called from following locations:
      // + ensureColVisible, scroll, init, layoutChanged, displayedColumnsChanged
      onHorizontalViewportChanged() {
        const scrollWidth = this.centerContainerCtrl.getCenterWidth();
        const scrollPosition = this.centerContainerCtrl.getViewportScrollLeft();
        this.beans.colViewport.setScrollPosition(scrollWidth, scrollPosition);
      }
    };
    function _suppressCellMouseEvent(gos, column2, node2, event) {
      const suppressMouseEventHandling = column2.getColDef().cellRendererParams?.suppressMouseEventHandling;
      return suppressMouseEvent(gos, column2, node2, event, suppressMouseEventHandling);
    }
    function _suppressFullWidthMouseEvent(gos, cellRendererParams, node2, event) {
      const suppressMouseEventHandling = cellRendererParams?.suppressMouseEventHandling;
      return suppressMouseEvent(gos, void 0, node2, event, suppressMouseEventHandling);
    }
    function suppressMouseEvent(gos, column2, node2, event, suppressMouseEventHandling) {
      if (!suppressMouseEventHandling) {
        return false;
      }
      return suppressMouseEventHandling(
        _addGridCommonParams(gos, {
          column: column2,
          node: node2,
          event
        })
      );
    }
    function _getCtrlForEventTarget(gos, eventTarget, type) {
      let sourceElement = eventTarget;
      while (sourceElement) {
        const renderedComp = _getDomData(gos, sourceElement, type);
        if (renderedComp) {
          return renderedComp;
        }
        sourceElement = sourceElement.parentElement;
      }
      return null;
    }
    var DOM_DATA_KEY_CELL_CTRL = "cellCtrl";
    function _getCellCtrlForEventTarget(gos, eventTarget) {
      return _getCtrlForEventTarget(gos, eventTarget, DOM_DATA_KEY_CELL_CTRL);
    }
    var DOM_DATA_KEY_ROW_CTRL = "renderedRow";
    function _getRowCtrlForEventTarget(gos, eventTarget) {
      return _getCtrlForEventTarget(gos, eventTarget, DOM_DATA_KEY_ROW_CTRL);
    }
    function _isUserSuppressingKeyboardEvent(gos, keyboardEvent, rowNode, column2, editing) {
      const colDefFunc = column2 ? column2.getColDef().suppressKeyboardEvent : void 0;
      if (!colDefFunc) {
        return false;
      }
      const params = _addGridCommonParams(gos, {
        event: keyboardEvent,
        editing,
        column: column2,
        node: rowNode,
        data: rowNode.data,
        colDef: column2.getColDef()
      });
      if (colDefFunc) {
        const colDefFuncResult = colDefFunc(params);
        if (colDefFuncResult) {
          return true;
        }
      }
      return false;
    }
    function _selectAllCells(beans) {
      const { pinnedRowModel, rowModel } = beans;
      const [isEmptyPinnedTop, isEmptyPinnedBottom] = [
        pinnedRowModel?.isEmpty("top") ?? true,
        pinnedRowModel?.isEmpty("bottom") ?? true
      ];
      const floatingStart = isEmptyPinnedTop ? null : "top";
      let floatingEnd;
      let rowEnd;
      if (isEmptyPinnedBottom) {
        floatingEnd = null;
        rowEnd = rowModel.getRowCount() - 1;
      } else {
        floatingEnd = "bottom";
        rowEnd = pinnedRowModel?.getPinnedBottomRowCount() ?? 0 - 1;
      }
      const { visibleCols, rangeSvc } = beans;
      const allDisplayedColumns = visibleCols.allCols;
      if (!rangeSvc || !allDisplayedColumns?.length) {
        return;
      }
      rangeSvc.setCellRange({
        rowStartIndex: 0,
        rowStartPinned: floatingStart,
        rowEndIndex: rowEnd,
        rowEndPinned: floatingEnd
      });
    }
    var A_KEYCODE = 65;
    var C_KEYCODE = 67;
    var V_KEYCODE = 86;
    var D_KEYCODE = 68;
    var Z_KEYCODE = 90;
    var Y_KEYCODE = 89;
    function _normaliseQwertyAzerty(keyboardEvent) {
      const { keyCode } = keyboardEvent;
      let code2;
      switch (keyCode) {
        case A_KEYCODE:
          code2 = KeyCode.A;
          break;
        case C_KEYCODE:
          code2 = KeyCode.C;
          break;
        case V_KEYCODE:
          code2 = KeyCode.V;
          break;
        case D_KEYCODE:
          code2 = KeyCode.D;
          break;
        case Z_KEYCODE:
          code2 = KeyCode.Z;
          break;
        case Y_KEYCODE:
          code2 = KeyCode.Y;
          break;
        default:
          code2 = keyboardEvent.code;
      }
      return code2;
    }
    var RowContainerEventsFeature = class extends BeanStub {
      constructor(element) {
        super();
        this.element = element;
      }
      postConstruct() {
        this.addKeyboardListeners();
        this.addMouseListeners();
        this.beans.touchSvc?.mockRowContextMenu(this);
        this.editSvc = this.beans.editSvc;
      }
      addKeyboardListeners() {
        const eventName = "keydown";
        const listener = this.processKeyboardEvent.bind(this, eventName);
        this.addManagedElementListeners(this.element, { [eventName]: listener });
      }
      addMouseListeners() {
        const mouseDownEvent = _isEventSupported("touchstart") ? "touchstart" : "mousedown";
        const eventNames = ["dblclick", "contextmenu", "mouseover", "mouseout", "click", mouseDownEvent];
        for (const eventName of eventNames) {
          const listener = this.processMouseEvent.bind(this, eventName);
          this.addManagedElementListeners(this.element, { [eventName]: listener });
        }
      }
      processMouseEvent(eventName, mouseEvent) {
        if (!_isEventFromThisInstance(this.beans, mouseEvent) || _isStopPropagationForAgGrid(mouseEvent)) {
          return;
        }
        const { cellCtrl, rowCtrl } = this.getControlsForEventTarget(mouseEvent.target);
        if (eventName === "contextmenu") {
          if (cellCtrl?.column) {
            cellCtrl.dispatchCellContextMenuEvent(mouseEvent);
          }
          this.beans.contextMenuSvc?.handleContextMenuMouseEvent(mouseEvent, void 0, rowCtrl, cellCtrl);
        } else {
          if (cellCtrl) {
            cellCtrl.onMouseEvent(eventName, mouseEvent);
          }
          if (rowCtrl) {
            rowCtrl.onMouseEvent(eventName, mouseEvent);
          }
        }
      }
      getControlsForEventTarget(target2) {
        const { gos } = this;
        return {
          cellCtrl: _getCellCtrlForEventTarget(gos, target2),
          rowCtrl: _getRowCtrlForEventTarget(gos, target2)
        };
      }
      processKeyboardEvent(eventName, keyboardEvent) {
        const { cellCtrl, rowCtrl } = this.getControlsForEventTarget(keyboardEvent.target);
        if (keyboardEvent.defaultPrevented) {
          return;
        }
        if (cellCtrl) {
          this.processCellKeyboardEvent(cellCtrl, eventName, keyboardEvent);
        } else if (rowCtrl?.isFullWidth()) {
          this.processFullWidthRowKeyboardEvent(rowCtrl, eventName, keyboardEvent);
        }
      }
      processCellKeyboardEvent(cellCtrl, eventName, keyboardEvent) {
        const editing = this.editSvc?.isEditing(cellCtrl, { withOpenEditor: true }) ?? false;
        const gridProcessingAllowed = !_isUserSuppressingKeyboardEvent(
          this.gos,
          keyboardEvent,
          cellCtrl.rowNode,
          cellCtrl.column,
          editing
        );
        if (gridProcessingAllowed) {
          if (eventName === "keydown") {
            const wasScrollKey = !editing && this.beans.navigation?.handlePageScrollingKey(keyboardEvent);
            if (!wasScrollKey) {
              cellCtrl.onKeyDown(keyboardEvent);
            }
            this.doGridOperations(keyboardEvent, editing);
            if (_isEventFromPrintableCharacter(keyboardEvent)) {
              cellCtrl.processCharacter(keyboardEvent);
            }
          }
        }
        if (eventName === "keydown") {
          this.eventSvc.dispatchEvent(cellCtrl.createEvent(keyboardEvent, "cellKeyDown"));
        }
      }
      processFullWidthRowKeyboardEvent(rowCtrl, eventName, keyboardEvent) {
        const { rowNode } = rowCtrl;
        const { focusSvc, navigation: navigation2 } = this.beans;
        const focusedCell = focusSvc.getFocusedCell();
        const column2 = focusedCell?.column;
        const gridProcessingAllowed = !_isUserSuppressingKeyboardEvent(this.gos, keyboardEvent, rowNode, column2, false);
        if (gridProcessingAllowed) {
          const key2 = keyboardEvent.key;
          if (eventName === "keydown") {
            switch (key2) {
              case KeyCode.PAGE_HOME:
              case KeyCode.PAGE_END:
              case KeyCode.PAGE_UP:
              case KeyCode.PAGE_DOWN:
                navigation2?.handlePageScrollingKey(keyboardEvent, true);
                break;
              case KeyCode.LEFT:
              case KeyCode.RIGHT:
                if (!this.gos.get("embedFullWidthRows")) {
                  break;
                }
              case KeyCode.UP:
              case KeyCode.DOWN:
                rowCtrl.onKeyboardNavigate(keyboardEvent);
                break;
              case KeyCode.TAB:
                rowCtrl.onTabKeyDown(keyboardEvent);
                break;
            }
          }
        }
        if (eventName === "keydown") {
          this.eventSvc.dispatchEvent(rowCtrl.createRowEvent("cellKeyDown", keyboardEvent));
        }
      }
      doGridOperations(keyboardEvent, editing) {
        if (!keyboardEvent.ctrlKey && !keyboardEvent.metaKey) {
          return;
        }
        if (editing) {
          return;
        }
        if (!_isEventFromThisInstance(this.beans, keyboardEvent)) {
          return;
        }
        const keyCode = _normaliseQwertyAzerty(keyboardEvent);
        const { clipboardSvc, undoRedo } = this.beans;
        if (keyCode === KeyCode.A) {
          return this.onCtrlAndA(keyboardEvent);
        }
        if (keyCode === KeyCode.C) {
          return this.onCtrlAndC(clipboardSvc, keyboardEvent);
        }
        if (keyCode === KeyCode.D) {
          return this.onCtrlAndD(clipboardSvc, keyboardEvent);
        }
        if (keyCode === KeyCode.V) {
          return this.onCtrlAndV(clipboardSvc, keyboardEvent);
        }
        if (keyCode === KeyCode.X) {
          return this.onCtrlAndX(clipboardSvc, keyboardEvent);
        }
        if (keyCode === KeyCode.Y) {
          return this.onCtrlAndY(undoRedo);
        }
        if (keyCode === KeyCode.Z) {
          return this.onCtrlAndZ(undoRedo, keyboardEvent);
        }
      }
      onCtrlAndA(event) {
        const {
          beans: { rowModel, rangeSvc, selectionSvc },
          gos
        } = this;
        if (rangeSvc && _isCellSelectionEnabled(gos) && !_getCtrlASelectsRows(gos) && rowModel.isRowsToRender()) {
          _selectAllCells(this.beans);
        } else if (selectionSvc) {
          selectionSvc.selectAllRowNodes({ source: "keyboardSelectAll", selectAll: _getSelectAll(gos) });
        }
        event.preventDefault();
      }
      onCtrlAndC(clipboardSvc, event) {
        if (!clipboardSvc || this.gos.get("enableCellTextSelection")) {
          return;
        }
        const { cellCtrl } = this.getControlsForEventTarget(event.target);
        if (this.editSvc?.isEditing(cellCtrl, { withOpenEditor: true })) {
          return;
        }
        event.preventDefault();
        clipboardSvc.copyToClipboard();
      }
      onCtrlAndX(clipboardSvc, event) {
        if (!clipboardSvc || this.gos.get("enableCellTextSelection") || this.gos.get("suppressCutToClipboard")) {
          return;
        }
        const { cellCtrl } = this.getControlsForEventTarget(event.target);
        if (this.editSvc?.isEditing(cellCtrl, { withOpenEditor: true })) {
          return;
        }
        event.preventDefault();
        clipboardSvc.cutToClipboard(void 0, "ui");
      }
      onCtrlAndV(clipboardSvc, event) {
        const { cellCtrl } = this.getControlsForEventTarget(event.target);
        if (this.editSvc?.isEditing(cellCtrl, { withOpenEditor: true })) {
          return;
        }
        if (clipboardSvc && !this.gos.get("suppressClipboardPaste")) {
          clipboardSvc.pasteFromClipboard();
        }
      }
      onCtrlAndD(clipboardSvc, event) {
        if (clipboardSvc && !this.gos.get("suppressClipboardPaste")) {
          clipboardSvc.copyRangeDown();
        }
        event.preventDefault();
      }
      onCtrlAndZ(undoRedo, event) {
        if (!this.gos.get("undoRedoCellEditing") || !undoRedo) {
          return;
        }
        event.preventDefault();
        if (event.shiftKey) {
          undoRedo.redo("ui");
        } else {
          undoRedo.undo("ui");
        }
      }
      onCtrlAndY(undoRedo) {
        undoRedo?.redo("ui");
      }
    };
    var SetHeightFeature = class extends BeanStub {
      constructor(eContainer, eViewport) {
        super();
        this.eContainer = eContainer;
        this.eViewport = eViewport;
      }
      postConstruct() {
        this.addManagedEventListeners({
          rowContainerHeightChanged: this.onHeightChanged.bind(this, this.beans.rowContainerHeight)
        });
      }
      onHeightChanged(maxDivHeightScaler) {
        const height = maxDivHeightScaler.uiContainerHeight;
        const heightString = height != null ? `${height}px` : ``;
        this.eContainer.style.height = heightString;
        if (this.eViewport) {
          this.eViewport.style.height = heightString;
        }
      }
    };
    var getTopRowCtrls = (r2) => r2.topRowCtrls;
    var getStickyTopRowCtrls = (r2) => r2.getStickyTopRowCtrls();
    var getStickyBottomRowCtrls = (r2) => r2.getStickyBottomRowCtrls();
    var getBottomRowCtrls = (r2) => r2.bottomRowCtrls;
    var getCentreRowCtrls = (r2) => r2.allRowCtrls;
    var getSpannedTopRowCtrls = (r2) => r2.getCtrls("top");
    var getSpannedCenterRowCtrls = (r2) => r2.getCtrls("center");
    var getSpannedBottomRowCtrls = (r2) => r2.getCtrls("bottom");
    var ContainerCssClasses = {
      center: {
        type: "center",
        name: "center-cols",
        getRowCtrls: getCentreRowCtrls,
        getSpannedRowCtrls: getSpannedCenterRowCtrls
      },
      left: {
        type: "left",
        name: "pinned-left-cols",
        pinnedType: "left",
        getRowCtrls: getCentreRowCtrls,
        getSpannedRowCtrls: getSpannedCenterRowCtrls
      },
      right: {
        type: "right",
        name: "pinned-right-cols",
        pinnedType: "right",
        getRowCtrls: getCentreRowCtrls,
        getSpannedRowCtrls: getSpannedCenterRowCtrls
      },
      fullWidth: {
        type: "fullWidth",
        name: "full-width",
        fullWidth: true,
        getRowCtrls: getCentreRowCtrls
      },
      topCenter: {
        type: "center",
        name: "floating-top",
        getRowCtrls: getTopRowCtrls,
        getSpannedRowCtrls: getSpannedTopRowCtrls
      },
      topLeft: {
        type: "left",
        name: "pinned-left-floating",
        container: "ag-pinned-left-floating-top",
        pinnedType: "left",
        getRowCtrls: getTopRowCtrls,
        getSpannedRowCtrls: getSpannedTopRowCtrls
      },
      topRight: {
        type: "right",
        name: "pinned-right-floating",
        container: "ag-pinned-right-floating-top",
        pinnedType: "right",
        getRowCtrls: getTopRowCtrls,
        getSpannedRowCtrls: getSpannedTopRowCtrls
      },
      topFullWidth: {
        type: "fullWidth",
        name: "floating-top-full-width",
        fullWidth: true,
        getRowCtrls: getTopRowCtrls
      },
      stickyTopCenter: {
        type: "center",
        name: "sticky-top",
        getRowCtrls: getStickyTopRowCtrls
      },
      stickyTopLeft: {
        type: "left",
        name: "pinned-left-sticky-top",
        container: "ag-pinned-left-sticky-top",
        pinnedType: "left",
        getRowCtrls: getStickyTopRowCtrls
      },
      stickyTopRight: {
        type: "right",
        name: "pinned-right-sticky-top",
        container: "ag-pinned-right-sticky-top",
        pinnedType: "right",
        getRowCtrls: getStickyTopRowCtrls
      },
      stickyTopFullWidth: {
        type: "fullWidth",
        name: "sticky-top-full-width",
        fullWidth: true,
        getRowCtrls: getStickyTopRowCtrls
      },
      stickyBottomCenter: {
        type: "center",
        name: "sticky-bottom",
        getRowCtrls: getStickyBottomRowCtrls
      },
      stickyBottomLeft: {
        type: "left",
        name: "pinned-left-sticky-bottom",
        container: "ag-pinned-left-sticky-bottom",
        pinnedType: "left",
        getRowCtrls: getStickyBottomRowCtrls
      },
      stickyBottomRight: {
        type: "right",
        name: "pinned-right-sticky-bottom",
        container: "ag-pinned-right-sticky-bottom",
        pinnedType: "right",
        getRowCtrls: getStickyBottomRowCtrls
      },
      stickyBottomFullWidth: {
        type: "fullWidth",
        name: "sticky-bottom-full-width",
        fullWidth: true,
        getRowCtrls: getStickyBottomRowCtrls
      },
      bottomCenter: {
        type: "center",
        name: "floating-bottom",
        getRowCtrls: getBottomRowCtrls,
        getSpannedRowCtrls: getSpannedBottomRowCtrls
      },
      bottomLeft: {
        type: "left",
        name: "pinned-left-floating-bottom",
        container: "ag-pinned-left-floating-bottom",
        pinnedType: "left",
        getRowCtrls: getBottomRowCtrls,
        getSpannedRowCtrls: getSpannedBottomRowCtrls
      },
      bottomRight: {
        type: "right",
        name: "pinned-right-floating-bottom",
        container: "ag-pinned-right-floating-bottom",
        pinnedType: "right",
        getRowCtrls: getBottomRowCtrls,
        getSpannedRowCtrls: getSpannedBottomRowCtrls
      },
      bottomFullWidth: {
        type: "fullWidth",
        name: "floating-bottom-full-width",
        fullWidth: true,
        getRowCtrls: getBottomRowCtrls
      }
    };
    function _getRowViewportClass(name2) {
      const options2 = _getRowContainerOptions(name2);
      return `ag-${options2.name}-viewport`;
    }
    function _getRowContainerClass(name2) {
      const options2 = _getRowContainerOptions(name2);
      return options2.container ?? `ag-${options2.name}-container`;
    }
    function _getRowSpanContainerClass(name2) {
      const options2 = _getRowContainerOptions(name2);
      return `ag-${options2.name}-spanned-cells-container`;
    }
    function _getRowContainerOptions(name2) {
      return ContainerCssClasses[name2];
    }
    var allTopNoFW = ["topCenter", "topLeft", "topRight"];
    var allBottomNoFW = ["bottomCenter", "bottomLeft", "bottomRight"];
    var allMiddleNoFW = ["center", "left", "right"];
    var allMiddle = ["center", "left", "right", "fullWidth"];
    var allCenter = ["stickyTopCenter", "stickyBottomCenter", "center", "topCenter", "bottomCenter"];
    var allLeft = ["left", "bottomLeft", "topLeft", "stickyTopLeft", "stickyBottomLeft"];
    var allRight = ["right", "bottomRight", "topRight", "stickyTopRight", "stickyBottomRight"];
    var allStickyTopNoFW = ["stickyTopCenter", "stickyTopLeft", "stickyTopRight"];
    var allStickyBottomNoFW = ["stickyBottomCenter", "stickyBottomLeft", "stickyBottomRight"];
    var allStickyContainers = [
      ...allStickyTopNoFW,
      "stickyTopFullWidth",
      ...allStickyBottomNoFW,
      "stickyBottomFullWidth"
    ];
    var allNoFW = [
      ...allTopNoFW,
      ...allBottomNoFW,
      ...allMiddleNoFW,
      ...allStickyTopNoFW,
      ...allStickyBottomNoFW
    ];
    var RowContainerCtrl = class extends BeanStub {
      constructor(name2) {
        super();
        this.name = name2;
        this.visible = true;
        this.EMPTY_CTRLS = [];
        this.options = _getRowContainerOptions(name2);
      }
      postConstruct() {
        this.enableRtl = this.gos.get("enableRtl");
        this.forContainers(["center"], () => {
          this.viewportSizeFeature = this.createManagedBean(new ViewportSizeFeature(this));
          this.addManagedEventListeners({
            stickyTopOffsetChanged: this.onStickyTopOffsetChanged.bind(this)
          });
        });
      }
      onStickyTopOffsetChanged(event) {
        this.comp.setOffsetTop(`${event.offset}px`);
      }
      registerWithCtrlsService() {
        if (this.options.fullWidth) {
          return;
        }
        this.beans.ctrlsSvc.register(this.name, this);
      }
      forContainers(names, callback) {
        if (names.indexOf(this.name) >= 0) {
          callback();
        }
      }
      setComp(view, eContainer, eSpannedContainer, eViewport) {
        this.comp = view;
        this.eContainer = eContainer;
        this.eSpannedContainer = eSpannedContainer;
        this.eViewport = eViewport;
        this.createManagedBean(new RowContainerEventsFeature(this.eViewport ?? this.eContainer));
        this.addPreventScrollWhileDragging();
        this.listenOnDomOrder();
        const { pinnedCols, rangeSvc } = this.beans;
        const pinnedWidthChanged = () => this.onPinnedWidthChanged();
        this.forContainers(allLeft, () => {
          this.pinnedWidthFeature = this.createOptionalManagedBean(
            pinnedCols?.createPinnedWidthFeature(true, this.eContainer, this.eSpannedContainer)
          );
          this.addManagedEventListeners({ leftPinnedWidthChanged: pinnedWidthChanged });
        });
        this.forContainers(allRight, () => {
          this.pinnedWidthFeature = this.createOptionalManagedBean(
            pinnedCols?.createPinnedWidthFeature(false, this.eContainer, this.eSpannedContainer)
          );
          this.addManagedEventListeners({ rightPinnedWidthChanged: pinnedWidthChanged });
        });
        this.forContainers(
          allMiddle,
          () => this.createManagedBean(
            new SetHeightFeature(this.eContainer, this.name === "center" ? eViewport : void 0)
          )
        );
        if (rangeSvc) {
          this.forContainers(
            allNoFW,
            () => this.createManagedBean(rangeSvc.createDragListenerFeature(this.eContainer))
          );
        }
        this.forContainers(
          allCenter,
          () => this.createManagedBean(new CenterWidthFeature((width) => this.comp.setContainerWidth(`${width}px`)))
        );
        this.visible = this.isContainerVisible();
        this.addListeners();
        this.registerWithCtrlsService();
      }
      onScrollCallback(fn2) {
        this.addManagedElementListeners(this.eViewport, { scroll: fn2 });
      }
      addListeners() {
        const { spannedRowRenderer, gos } = this.beans;
        const onDisplayedColumnsChanged = this.onDisplayedColumnsChanged.bind(this);
        this.addManagedEventListeners({
          displayedColumnsChanged: onDisplayedColumnsChanged,
          displayedColumnsWidthChanged: onDisplayedColumnsChanged,
          displayedRowsChanged: (params) => this.onDisplayedRowsChanged(params.afterScroll)
        });
        onDisplayedColumnsChanged();
        this.onDisplayedRowsChanged();
        if (spannedRowRenderer && this.options.getSpannedRowCtrls && gos.get("enableCellSpan")) {
          this.addManagedListeners(spannedRowRenderer, {
            spannedRowsUpdated: () => {
              const spannedCtrls = this.options.getSpannedRowCtrls(spannedRowRenderer);
              if (!spannedCtrls) {
                return;
              }
              this.comp.setSpannedRowCtrls(spannedCtrls, false);
            }
          });
        }
      }
      listenOnDomOrder() {
        const isStickContainer = allStickyContainers.indexOf(this.name) >= 0;
        if (isStickContainer) {
          this.comp.setDomOrder(true);
          return;
        }
        const listener = () => {
          const isEnsureDomOrder = this.gos.get("ensureDomOrder");
          const isPrintLayout = _isDomLayout(this.gos, "print");
          this.comp.setDomOrder(isEnsureDomOrder || isPrintLayout);
        };
        this.addManagedPropertyListener("domLayout", listener);
        listener();
      }
      onDisplayedColumnsChanged() {
        this.forContainers(["center"], () => this.onHorizontalViewportChanged());
      }
      // this methods prevents the grid views from being scrolled while the dragService is being used
      // eg. the view should not scroll up and down while dragging rows using the rowDragComp.
      addPreventScrollWhileDragging() {
        const { dragSvc } = this.beans;
        if (!dragSvc) {
          return;
        }
        const preventScroll = (e) => {
          if (dragSvc.dragging) {
            if (e.cancelable) {
              e.preventDefault();
            }
          }
        };
        this.eContainer.addEventListener("touchmove", preventScroll, { passive: false });
        this.addDestroyFunc(() => this.eContainer.removeEventListener("touchmove", preventScroll));
      }
      // this gets called whenever a change in the viewport, so we can inform column controller it has to work
      // out the virtual columns again. gets called from following locations:
      // + ensureColVisible, scroll, init, layoutChanged, displayedColumnsChanged
      onHorizontalViewportChanged(afterScroll = false) {
        const scrollWidth = this.getCenterWidth();
        const scrollPosition = this.getCenterViewportScrollLeft();
        this.beans.colViewport.setScrollPosition(scrollWidth, scrollPosition, afterScroll);
      }
      hasHorizontalScrollGap() {
        return this.eContainer.clientWidth - this.eViewport.clientWidth < 0;
      }
      hasVerticalScrollGap() {
        return this.eContainer.clientHeight - this.eViewport.clientHeight < 0;
      }
      getCenterWidth() {
        return _getInnerWidth(this.eViewport);
      }
      getCenterViewportScrollLeft() {
        return _getScrollLeft(this.eViewport, this.enableRtl);
      }
      registerViewportResizeListener(listener) {
        const unsubscribeFromResize = _observeResize(this.beans, this.eViewport, listener);
        this.addDestroyFunc(() => unsubscribeFromResize());
      }
      isViewportInTheDOMTree() {
        return _isInDOM(this.eViewport);
      }
      getViewportScrollLeft() {
        return _getScrollLeft(this.eViewport, this.enableRtl);
      }
      isHorizontalScrollShowing() {
        const isAlwaysShowHorizontalScroll = this.gos.get("alwaysShowHorizontalScroll");
        return isAlwaysShowHorizontalScroll || _isHorizontalScrollShowing(this.eViewport);
      }
      setHorizontalScroll(offset2) {
        this.comp.setHorizontalScroll(offset2);
      }
      getHScrollPosition() {
        const res = {
          left: this.eViewport.scrollLeft,
          right: this.eViewport.scrollLeft + this.eViewport.offsetWidth
        };
        return res;
      }
      setCenterViewportScrollLeft(value2) {
        _setScrollLeft(this.eViewport, value2, this.enableRtl);
      }
      isContainerVisible() {
        const pinned = this.options.pinnedType != null;
        return !pinned || !!this.pinnedWidthFeature && this.pinnedWidthFeature.getWidth() > 0;
      }
      onPinnedWidthChanged() {
        const visible2 = this.isContainerVisible();
        if (this.visible != visible2) {
          this.visible = visible2;
          this.onDisplayedRowsChanged();
        }
      }
      onDisplayedRowsChanged(afterScroll = false) {
        const rows = this.options.getRowCtrls(this.beans.rowRenderer);
        if (!this.visible || rows.length === 0) {
          this.comp.setRowCtrls({ rowCtrls: this.EMPTY_CTRLS });
          return;
        }
        const printLayout = _isDomLayout(this.gos, "print");
        const embedFullWidthRows = this.gos.get("embedFullWidthRows");
        const embedFW = embedFullWidthRows || printLayout;
        const rowsThisContainer = rows.filter((rowCtrl) => {
          const fullWidthRow = rowCtrl.isFullWidth();
          const match = this.options.fullWidth ? !embedFW && fullWidthRow : embedFW || !fullWidthRow;
          return match;
        });
        this.comp.setRowCtrls({ rowCtrls: rowsThisContainer, useFlushSync: afterScroll });
      }
    };
    var CSS_CLASS_FORCE_VERTICAL_SCROLL = "ag-force-vertical-scroll";
    var CSS_CLASS_CELL_SELECTABLE = "ag-selectable";
    var CSS_CLASS_COLUMN_MOVING = "ag-column-moving";
    var GridBodyCtrl = class extends BeanStub {
      constructor() {
        super(...arguments);
        this.stickyTopHeight = 0;
        this.stickyBottomHeight = 0;
      }
      wireBeans(beans) {
        this.ctrlsSvc = beans.ctrlsSvc;
        this.colModel = beans.colModel;
        this.scrollVisibleSvc = beans.scrollVisibleSvc;
        this.pinnedRowModel = beans.pinnedRowModel;
        this.filterManager = beans.filterManager;
        this.rowGroupColsSvc = beans.rowGroupColsSvc;
      }
      setComp(comp2, eGridBody, eBodyViewport, eTop, eBottom, eStickyTop, eStickyBottom) {
        this.comp = comp2;
        this.eGridBody = eGridBody;
        this.eBodyViewport = eBodyViewport;
        this.eTop = eTop;
        this.eBottom = eBottom;
        this.eStickyTop = eStickyTop;
        this.eStickyBottom = eStickyBottom;
        this.eCenterColsViewport = eBodyViewport.querySelector(`.${_getRowViewportClass("center")}`);
        this.eFullWidthContainer = eBodyViewport.querySelector(`.${_getRowContainerClass("fullWidth")}`);
        this.eStickyTopFullWidthContainer = eStickyTop.querySelector(
          `.${_getRowContainerClass("stickyTopFullWidth")}`
        );
        this.eStickyBottomFullWidthContainer = eStickyBottom.querySelector(
          `.${_getRowContainerClass("stickyBottomFullWidth")}`
        );
        this.setCellTextSelection(this.gos.get("enableCellTextSelection"));
        this.addManagedPropertyListener(
          "enableCellTextSelection",
          (props) => this.setCellTextSelection(props.currentValue)
        );
        this.createManagedBean(new LayoutFeature(this.comp));
        this.scrollFeature = this.createManagedBean(new GridBodyScrollFeature(eBodyViewport));
        this.beans.rowDragSvc?.setupRowDrag(eBodyViewport, this);
        this.setupRowAnimationCssClass();
        this.addEventListeners();
        this.addFocusListeners([eTop, eBodyViewport, eBottom, eStickyTop, eStickyBottom]);
        this.setGridRootRole();
        this.onGridColumnsChanged();
        this.addBodyViewportListener();
        this.setFloatingHeights();
        this.disableBrowserDragging();
        this.addStopEditingWhenGridLosesFocus();
        this.updateScrollingClasses();
        this.filterManager?.setupAdvFilterHeaderComp(eTop);
        this.ctrlsSvc.register("gridBodyCtrl", this);
      }
      addEventListeners() {
        const setFloatingHeights = this.setFloatingHeights.bind(this);
        const setGridRootRole = this.setGridRootRole.bind(this);
        const toggleRowResizeStyle = this.toggleRowResizeStyles.bind(this);
        this.addManagedEventListeners({
          gridColumnsChanged: this.onGridColumnsChanged.bind(this),
          scrollVisibilityChanged: this.onScrollVisibilityChanged.bind(this),
          scrollGapChanged: this.updateScrollingClasses.bind(this),
          pinnedRowDataChanged: setFloatingHeights,
          pinnedHeightChanged: setFloatingHeights,
          pinnedRowsChanged: setFloatingHeights,
          headerHeightChanged: this.setStickyTopOffsetTop.bind(this),
          columnRowGroupChanged: setGridRootRole,
          columnPivotChanged: setGridRootRole,
          rowResizeStarted: toggleRowResizeStyle,
          rowResizeEnded: toggleRowResizeStyle
        });
        this.addManagedPropertyListener("treeData", setGridRootRole);
      }
      toggleRowResizeStyles(params) {
        const isResizingRow = params.type === "rowResizeStarted";
        this.eBodyViewport.classList.toggle("ag-prevent-animation", isResizingRow);
      }
      onGridColumnsChanged() {
        const columns = this.beans.colModel.getCols();
        this.comp.setColumnCount(columns.length);
      }
      onScrollVisibilityChanged() {
        const { scrollVisibleSvc } = this;
        const visible2 = scrollVisibleSvc.verticalScrollShowing;
        this.setVerticalScrollPaddingVisible(visible2);
        this.setStickyWidth(visible2);
        this.setStickyBottomOffsetBottom();
        const scrollbarWidth = visible2 ? scrollVisibleSvc.getScrollbarWidth() || 0 : 0;
        const pad = _isInvisibleScrollbar() ? 16 : 0;
        const width = `calc(100% + ${scrollbarWidth + pad}px)`;
        _requestAnimationFrame(this.beans, () => this.comp.setBodyViewportWidth(width));
        this.updateScrollingClasses();
      }
      setGridRootRole() {
        const { rowGroupColsSvc, colModel } = this;
        let isTreeGrid = this.gos.get("treeData");
        if (!isTreeGrid) {
          const isPivotActive = colModel.isPivotMode();
          const rowGroupColumnLen = !rowGroupColsSvc ? 0 : rowGroupColsSvc.columns.length;
          const columnsNeededForGrouping = isPivotActive ? 2 : 1;
          isTreeGrid = rowGroupColumnLen >= columnsNeededForGrouping;
        }
        this.comp.setGridRootRole(isTreeGrid ? "treegrid" : "grid");
      }
      addFocusListeners(elements) {
        for (const element of elements) {
          this.addManagedElementListeners(element, {
            focusin: (e) => {
              const { target: target2 } = e;
              const isFocusedElementNested = _isElementChildOfClass(target2, "ag-root", element);
              element.classList.toggle("ag-has-focus", !isFocusedElementNested);
            },
            focusout: (e) => {
              const { target: target2, relatedTarget } = e;
              const gridContainRelatedTarget = element.contains(relatedTarget);
              const isNestedRelatedTarget = _isElementChildOfClass(
                relatedTarget,
                "ag-root",
                element
              );
              const isNestedTarget = _isElementChildOfClass(target2, "ag-root", element);
              if (isNestedTarget) {
                return;
              }
              if (!gridContainRelatedTarget || isNestedRelatedTarget) {
                element.classList.remove("ag-has-focus");
              }
            }
          });
        }
      }
      // used by ColumnAnimationService
      setColumnMovingCss(moving) {
        this.comp.setColumnMovingCss(CSS_CLASS_COLUMN_MOVING, moving);
      }
      setCellTextSelection(selectable = false) {
        this.comp.setCellSelectableCss(CSS_CLASS_CELL_SELECTABLE, selectable);
      }
      updateScrollingClasses() {
        const {
          eGridBody: { classList },
          scrollVisibleSvc
        } = this;
        classList.toggle("ag-body-vertical-content-no-gap", !scrollVisibleSvc.verticalScrollGap);
        classList.toggle("ag-body-horizontal-content-no-gap", !scrollVisibleSvc.horizontalScrollGap);
      }
      // if we do not do this, then the user can select a pic in the grid (eg an image in a custom cell renderer)
      // and then that will start the browser native drag n' drop, which messes up with our own drag and drop.
      disableBrowserDragging() {
        this.addManagedElementListeners(this.eGridBody, {
          dragstart: (event) => {
            if (event.target instanceof HTMLImageElement) {
              event.preventDefault();
              return false;
            }
          }
        });
      }
      addStopEditingWhenGridLosesFocus() {
        this.beans.editSvc?.addStopEditingWhenGridLosesFocus([
          this.eBodyViewport,
          this.eBottom,
          this.eTop,
          this.eStickyTop,
          this.eStickyBottom
        ]);
      }
      updateRowCount() {
        const headerCount = (this.ctrlsSvc.getHeaderRowContainerCtrl()?.getRowCount() ?? 0) + (this.filterManager?.getHeaderRowCount() ?? 0);
        const { rowModel } = this.beans;
        const rowCount = rowModel.isLastRowIndexKnown() ? rowModel.getRowCount() : -1;
        const total = rowCount === -1 ? -1 : headerCount + rowCount;
        this.comp.setRowCount(total);
      }
      registerBodyViewportResizeListener(listener) {
        this.comp.registerBodyViewportResizeListener(listener);
      }
      setVerticalScrollPaddingVisible(visible2) {
        const overflowY = visible2 ? "scroll" : "hidden";
        this.comp.setPinnedTopBottomOverflowY(overflowY);
      }
      isVerticalScrollShowing() {
        const show = this.gos.get("alwaysShowVerticalScroll");
        const cssClass = show ? CSS_CLASS_FORCE_VERTICAL_SCROLL : null;
        const allowVerticalScroll = _isDomLayout(this.gos, "normal");
        this.comp.setAlwaysVerticalScrollClass(cssClass, show);
        return show || allowVerticalScroll && _isVerticalScrollShowing(this.eBodyViewport);
      }
      setupRowAnimationCssClass() {
        const { rowContainerHeight, environment } = this.beans;
        let initialSizeMeasurementComplete = environment.sizesMeasured;
        const updateAnimationClass = () => {
          const animateRows = initialSizeMeasurementComplete && _isAnimateRows(this.gos) && !rowContainerHeight.stretching;
          const animateRowsCssClass = animateRows ? "ag-row-animation" : "ag-row-no-animation";
          this.comp.setRowAnimationCssOnBodyViewport(animateRowsCssClass, animateRows);
        };
        updateAnimationClass();
        this.addManagedEventListeners({ heightScaleChanged: updateAnimationClass });
        this.addManagedPropertyListener("animateRows", updateAnimationClass);
        this.addManagedEventListeners({
          gridStylesChanged: () => {
            if (!initialSizeMeasurementComplete && environment.sizesMeasured) {
              initialSizeMeasurementComplete = true;
              updateAnimationClass();
            }
          }
        });
      }
      addBodyViewportListener() {
        const {
          eBodyViewport,
          eStickyTop,
          eStickyBottom,
          eTop,
          eBottom,
          beans: { popupSvc, touchSvc }
        } = this;
        const listener = this.onBodyViewportContextMenu.bind(this);
        this.addManagedElementListeners(eBodyViewport, { contextmenu: listener });
        touchSvc?.mockBodyContextMenu(this, listener);
        this.addManagedElementListeners(eBodyViewport, {
          wheel: this.onBodyViewportWheel.bind(this, popupSvc)
        });
        const onStickyWheel = this.onStickyWheel.bind(this);
        for (const container2 of [eStickyTop, eStickyBottom, eTop, eBottom]) {
          this.addManagedElementListeners(container2, { wheel: onStickyWheel });
        }
        const onHorizontalWheel = this.onHorizontalWheel.bind(this);
        for (const container2 of ["left", "right", "topLeft", "topRight", "bottomLeft", "bottomRight"]) {
          this.addManagedElementListeners(this.ctrlsSvc.get(container2).eContainer, {
            wheel: onHorizontalWheel
          });
        }
        this.addFullWidthContainerWheelListener();
      }
      addFullWidthContainerWheelListener() {
        this.addManagedElementListeners(this.eFullWidthContainer, {
          wheel: (e) => this.onFullWidthContainerWheel(e)
        });
      }
      onFullWidthContainerWheel(e) {
        const { deltaX, deltaY, shiftKey } = e;
        const isHorizontalScroll = shiftKey || Math.abs(deltaX) > Math.abs(deltaY);
        if (isHorizontalScroll && _isEventFromThisInstance(this.beans, e)) {
          this.scrollGridBodyToMatchEvent(e);
        }
      }
      onStickyWheel(e) {
        const { deltaY } = e;
        const scrolled = this.scrollVertically(deltaY);
        if (scrolled > 0) {
          e.preventDefault();
        }
      }
      onHorizontalWheel(e) {
        const { deltaX, deltaY, shiftKey } = e;
        const isHorizontalScroll = shiftKey || Math.abs(deltaX) > Math.abs(deltaY);
        if (!isHorizontalScroll) {
          return;
        }
        this.scrollGridBodyToMatchEvent(e);
      }
      scrollGridBodyToMatchEvent(e) {
        const { deltaX, deltaY } = e;
        e.preventDefault();
        this.eCenterColsViewport.scrollBy({ left: deltaX || deltaY });
      }
      onBodyViewportContextMenu(mouseEvent, touch, touchEvent) {
        if (!mouseEvent && !touchEvent) {
          return;
        }
        if (this.gos.get("preventDefaultOnContextMenu")) {
          const event = mouseEvent || touchEvent;
          event.preventDefault();
        }
        const { target: target2 } = mouseEvent || touch;
        if (target2 === this.eBodyViewport || target2 === this.ctrlsSvc.get("center").eViewport) {
          this.beans.contextMenuSvc?.showContextMenu({
            mouseEvent,
            touchEvent,
            value: null,
            anchorToElement: this.eGridBody,
            source: "ui"
          });
        }
      }
      onBodyViewportWheel(popupSvc, e) {
        if (!this.gos.get("suppressScrollWhenPopupsAreOpen")) {
          return;
        }
        if (popupSvc?.hasAnchoredPopup()) {
          e.preventDefault();
        }
      }
      // called by rowDragFeature
      scrollVertically(pixels) {
        const oldScrollPosition = this.eBodyViewport.scrollTop;
        this.scrollFeature.setVerticalScrollPosition(oldScrollPosition + pixels);
        return this.eBodyViewport.scrollTop - oldScrollPosition;
      }
      setFloatingHeights() {
        const {
          pinnedRowModel,
          beans: { environment }
        } = this;
        const floatingTopHeight = pinnedRowModel?.getPinnedTopTotalHeight();
        const floatingBottomHeight = pinnedRowModel?.getPinnedBottomTotalHeight();
        const pinnedBorderWidth = environment.getPinnedRowBorderWidth();
        const rowBorderWidth = environment.getRowBorderWidth();
        const additionalHeight = pinnedBorderWidth - rowBorderWidth;
        const normalisedFloatingTopHeight = !floatingTopHeight ? 0 : additionalHeight + floatingTopHeight;
        const normalisedFloatingBottomHeight = !floatingBottomHeight ? 0 : additionalHeight + floatingBottomHeight;
        this.comp.setTopHeight(normalisedFloatingTopHeight);
        this.comp.setBottomHeight(normalisedFloatingBottomHeight);
        this.comp.setTopInvisible(normalisedFloatingTopHeight <= 0);
        this.comp.setBottomInvisible(normalisedFloatingBottomHeight <= 0);
        this.setStickyTopOffsetTop();
        this.setStickyBottomOffsetBottom();
      }
      setStickyTopHeight(height = 0) {
        this.comp.setStickyTopHeight(`${height}px`);
        this.stickyTopHeight = height;
      }
      setStickyBottomHeight(height = 0) {
        this.comp.setStickyBottomHeight(`${height}px`);
        this.stickyBottomHeight = height;
      }
      setStickyWidth(vScrollVisible) {
        if (!vScrollVisible) {
          this.comp.setStickyTopWidth("100%");
          this.comp.setStickyBottomWidth("100%");
        } else {
          const scrollbarWidth = this.scrollVisibleSvc.getScrollbarWidth();
          this.comp.setStickyTopWidth(`calc(100% - ${scrollbarWidth}px)`);
          this.comp.setStickyBottomWidth(`calc(100% - ${scrollbarWidth}px)`);
        }
      }
      setStickyTopOffsetTop() {
        const headerCtrl = this.ctrlsSvc.get("gridHeaderCtrl");
        const headerHeight = headerCtrl.headerHeight + (this.filterManager?.getHeaderHeight() ?? 0);
        const pinnedTopHeight = this.pinnedRowModel?.getPinnedTopTotalHeight() ?? 0;
        let height = 0;
        if (headerHeight > 0) {
          height += headerHeight;
        }
        if (pinnedTopHeight > 0) {
          height += pinnedTopHeight;
        }
        if (height > 0) {
          height += 1;
        }
        this.comp.setStickyTopTop(`${height}px`);
      }
      setStickyBottomOffsetBottom() {
        const { pinnedRowModel, scrollVisibleSvc, comp: comp2 } = this;
        const pinnedBottomHeight = pinnedRowModel?.getPinnedBottomTotalHeight() ?? 0;
        const hScrollShowing = scrollVisibleSvc.horizontalScrollShowing;
        const scrollbarWidth = hScrollShowing ? scrollVisibleSvc.getScrollbarWidth() || 0 : 0;
        const height = pinnedBottomHeight + scrollbarWidth;
        comp2.setStickyBottomBottom(`${height}px`);
      }
    };
    function _getCellPositionForEvent(gos, event) {
      return _getCellCtrlForEventTarget(gos, event.target)?.getFocusedCellPosition() ?? null;
    }
    function _getNormalisedMousePosition(beans, event) {
      const gridPanelHasScrolls = _isDomLayout(beans.gos, "normal");
      const e = event;
      let x2;
      let y;
      if (e.clientX != null || e.clientY != null) {
        x2 = e.clientX;
        y = e.clientY;
      } else {
        x2 = e.x;
        y = e.y;
      }
      const { pageFirstPixel } = beans.pageBounds.getCurrentPagePixelRange();
      y += pageFirstPixel;
      if (gridPanelHasScrolls) {
        const scrollFeature = beans.ctrlsSvc.getScrollFeature();
        const vRange = scrollFeature.getVScrollPosition();
        const hRange = scrollFeature.getHScrollPosition();
        x2 += hRange.left;
        y += vRange.top;
      }
      return { x: x2, y };
    }
    var AbstractFakeScrollComp = class extends Component {
      constructor(template2, direction) {
        super();
        this.direction = direction;
        this.eViewport = RefPlaceholder;
        this.eContainer = RefPlaceholder;
        this.hideTimeout = 0;
        this.setTemplate(template2);
      }
      postConstruct() {
        this.addManagedEventListeners({
          scrollVisibilityChanged: this.onScrollVisibilityChanged.bind(this)
        });
        this.onScrollVisibilityChanged();
        this.toggleCss("ag-apple-scrollbar", _isMacOsUserAgent() || _isIOSUserAgent());
      }
      destroy() {
        super.destroy();
        window.clearTimeout(this.hideTimeout);
      }
      initialiseInvisibleScrollbar() {
        if (this.invisibleScrollbar !== void 0) {
          return;
        }
        this.invisibleScrollbar = _isInvisibleScrollbar();
        if (this.invisibleScrollbar) {
          this.hideAndShowInvisibleScrollAsNeeded();
          this.addActiveListenerToggles();
        }
      }
      addActiveListenerToggles() {
        const eGui = this.getGui();
        const onActivate = () => this.toggleCss("ag-scrollbar-active", true);
        const onDeactivate = () => this.toggleCss("ag-scrollbar-active", false);
        this.addManagedListeners(eGui, {
          mouseenter: onActivate,
          mousedown: onActivate,
          touchstart: onActivate,
          mouseleave: onDeactivate,
          touchend: onDeactivate
        });
      }
      onScrollVisibilityChanged() {
        if (this.invisibleScrollbar === void 0) {
          this.initialiseInvisibleScrollbar();
        }
        _requestAnimationFrame(this.beans, () => this.setScrollVisible());
      }
      hideAndShowInvisibleScrollAsNeeded() {
        this.addManagedEventListeners({
          bodyScroll: (params) => {
            if (params.direction === this.direction) {
              if (this.hideTimeout) {
                window.clearTimeout(this.hideTimeout);
                this.hideTimeout = 0;
              }
              this.toggleCss("ag-scrollbar-scrolling", true);
            }
          },
          bodyScrollEnd: () => {
            this.hideTimeout = window.setTimeout(() => {
              this.toggleCss("ag-scrollbar-scrolling", false);
              this.hideTimeout = 0;
            }, 400);
          }
        });
      }
      attemptSettingScrollPosition(value2) {
        const viewport2 = this.eViewport;
        _waitUntil(
          this,
          () => _isVisible(viewport2),
          () => this.setScrollPosition(value2),
          100
        );
      }
      onScrollCallback(fn2) {
        this.addManagedElementListeners(this.eViewport, { scroll: fn2 });
      }
    };
    var FakeHScrollElement = {
      tag: "div",
      cls: "ag-body-horizontal-scroll",
      attrs: { "aria-hidden": "true" },
      children: [
        { tag: "div", ref: "eLeftSpacer", cls: "ag-horizontal-left-spacer" },
        {
          tag: "div",
          ref: "eViewport",
          cls: "ag-body-horizontal-scroll-viewport",
          children: [{ tag: "div", ref: "eContainer", cls: "ag-body-horizontal-scroll-container" }]
        },
        { tag: "div", ref: "eRightSpacer", cls: "ag-horizontal-right-spacer" }
      ]
    };
    var FakeHScrollComp = class extends AbstractFakeScrollComp {
      constructor() {
        super(FakeHScrollElement, "horizontal");
        this.eLeftSpacer = RefPlaceholder;
        this.eRightSpacer = RefPlaceholder;
        this.setScrollVisibleDebounce = 0;
      }
      wireBeans(beans) {
        this.visibleCols = beans.visibleCols;
        this.scrollVisibleSvc = beans.scrollVisibleSvc;
      }
      postConstruct() {
        super.postConstruct();
        const spacerWidthsListener = this.setFakeHScrollSpacerWidths.bind(this);
        this.addManagedEventListeners({
          displayedColumnsChanged: spacerWidthsListener,
          displayedColumnsWidthChanged: spacerWidthsListener,
          pinnedRowDataChanged: this.refreshCompBottom.bind(this)
        });
        this.addManagedPropertyListener("domLayout", spacerWidthsListener);
        this.beans.ctrlsSvc.register("fakeHScrollComp", this);
        this.createManagedBean(new CenterWidthFeature((width) => this.eContainer.style.width = `${width}px`));
        this.addManagedPropertyListeners(["suppressHorizontalScroll"], this.onScrollVisibilityChanged.bind(this));
      }
      destroy() {
        window.clearTimeout(this.setScrollVisibleDebounce);
        super.destroy();
      }
      initialiseInvisibleScrollbar() {
        if (this.invisibleScrollbar !== void 0) {
          return;
        }
        this.enableRtl = this.gos.get("enableRtl");
        super.initialiseInvisibleScrollbar();
        if (this.invisibleScrollbar) {
          this.refreshCompBottom();
        }
      }
      refreshCompBottom() {
        if (!this.invisibleScrollbar) {
          return;
        }
        const bottomPinnedHeight = this.beans.pinnedRowModel?.getPinnedBottomTotalHeight() ?? 0;
        this.getGui().style.bottom = `${bottomPinnedHeight}px`;
      }
      onScrollVisibilityChanged() {
        super.onScrollVisibilityChanged();
        this.setFakeHScrollSpacerWidths();
      }
      setFakeHScrollSpacerWidths() {
        const vScrollShowing = this.scrollVisibleSvc.verticalScrollShowing;
        let rightSpacing = this.visibleCols.getDisplayedColumnsRightWidth();
        const scrollOnRight = !this.enableRtl && vScrollShowing;
        const scrollbarWidth = this.scrollVisibleSvc.getScrollbarWidth();
        if (scrollOnRight) {
          rightSpacing += scrollbarWidth;
        }
        _setFixedWidth(this.eRightSpacer, rightSpacing);
        this.eRightSpacer.classList.toggle("ag-scroller-corner", rightSpacing <= scrollbarWidth);
        let leftSpacing = this.visibleCols.getColsLeftWidth();
        const scrollOnLeft = this.enableRtl && vScrollShowing;
        if (scrollOnLeft) {
          leftSpacing += scrollbarWidth;
        }
        _setFixedWidth(this.eLeftSpacer, leftSpacing);
        this.eLeftSpacer.classList.toggle("ag-scroller-corner", leftSpacing <= scrollbarWidth);
      }
      setScrollVisible() {
        const hScrollShowing = this.scrollVisibleSvc.horizontalScrollShowing;
        const invisibleScrollbar2 = this.invisibleScrollbar;
        const isSuppressHorizontalScroll = this.gos.get("suppressHorizontalScroll");
        const scrollbarWidth = hScrollShowing ? this.scrollVisibleSvc.getScrollbarWidth() || 0 : 0;
        const adjustedScrollbarWidth = scrollbarWidth === 0 && invisibleScrollbar2 ? 16 : scrollbarWidth;
        const scrollContainerSize = !isSuppressHorizontalScroll ? adjustedScrollbarWidth : 0;
        const apply = () => {
          this.setScrollVisibleDebounce = 0;
          this.toggleCss("ag-scrollbar-invisible", invisibleScrollbar2);
          _setFixedHeight(this.getGui(), scrollContainerSize);
          _setFixedHeight(this.eViewport, scrollContainerSize);
          _setFixedHeight(this.eContainer, scrollContainerSize);
          if (!scrollContainerSize) {
            this.eContainer.style.setProperty("min-height", "1px");
          }
          this.setVisible(hScrollShowing, { skipAriaHidden: true });
        };
        window.clearTimeout(this.setScrollVisibleDebounce);
        if (!hScrollShowing) {
          apply();
        } else {
          this.setScrollVisibleDebounce = window.setTimeout(apply, 100);
        }
      }
      getScrollPosition() {
        return _getScrollLeft(this.eViewport, this.enableRtl);
      }
      setScrollPosition(value2) {
        if (!_isVisible(this.eViewport)) {
          this.attemptSettingScrollPosition(value2);
        }
        _setScrollLeft(this.eViewport, value2, this.enableRtl);
      }
    };
    var FakeVScrollElement = {
      tag: "div",
      cls: "ag-body-vertical-scroll",
      attrs: { "aria-hidden": "true" },
      children: [
        {
          tag: "div",
          ref: "eViewport",
          cls: "ag-body-vertical-scroll-viewport",
          children: [{ tag: "div", ref: "eContainer", cls: "ag-body-vertical-scroll-container" }]
        }
      ]
    };
    var FakeVScrollComp = class extends AbstractFakeScrollComp {
      constructor() {
        super(FakeVScrollElement, "vertical");
      }
      postConstruct() {
        super.postConstruct();
        this.createManagedBean(new SetHeightFeature(this.eContainer));
        const { ctrlsSvc } = this.beans;
        ctrlsSvc.register("fakeVScrollComp", this);
        this.addManagedEventListeners({
          rowContainerHeightChanged: this.onRowContainerHeightChanged.bind(this, ctrlsSvc)
        });
      }
      setScrollVisible() {
        const { scrollVisibleSvc } = this.beans;
        const vScrollShowing = scrollVisibleSvc.verticalScrollShowing;
        const invisibleScrollbar2 = this.invisibleScrollbar;
        const scrollbarWidth = vScrollShowing ? scrollVisibleSvc.getScrollbarWidth() || 0 : 0;
        const adjustedScrollbarWidth = scrollbarWidth === 0 && invisibleScrollbar2 ? 16 : scrollbarWidth;
        this.toggleCss("ag-scrollbar-invisible", invisibleScrollbar2);
        _setFixedWidth(this.getGui(), adjustedScrollbarWidth);
        _setFixedWidth(this.eViewport, adjustedScrollbarWidth);
        _setFixedWidth(this.eContainer, adjustedScrollbarWidth);
        this.setDisplayed(vScrollShowing, { skipAriaHidden: true });
      }
      onRowContainerHeightChanged(ctrlsSvc) {
        const gridBodyCtrl = ctrlsSvc.getGridBodyCtrl();
        const gridBodyViewportEl = gridBodyCtrl.eBodyViewport;
        const eViewportScrollTop = this.getScrollPosition();
        const gridBodyViewportScrollTop = gridBodyViewportEl.scrollTop;
        if (eViewportScrollTop != gridBodyViewportScrollTop) {
          this.setScrollPosition(gridBodyViewportScrollTop, true);
        }
      }
      getScrollPosition() {
        return this.eViewport.scrollTop;
      }
      setScrollPosition(value2, force) {
        if (!force && !_isVisible(this.eViewport)) {
          this.attemptSettingScrollPosition(value2);
        }
        this.eViewport.scrollTop = value2;
      }
    };
    var CSS_FIRST_COLUMN = "ag-column-first";
    var CSS_LAST_COLUMN = "ag-column-last";
    function _getHeaderClassesFromColDef(abstractColDef, gos, column2, columnGroup) {
      if (_missing(abstractColDef)) {
        return [];
      }
      return getColumnClassesFromCollDef(abstractColDef.headerClass, abstractColDef, gos, column2, columnGroup);
    }
    function refreshFirstAndLastStyles(comp2, column2, presentedColsService) {
      comp2.toggleCss(CSS_FIRST_COLUMN, presentedColsService.isColAtEdge(column2, "first"));
      comp2.toggleCss(CSS_LAST_COLUMN, presentedColsService.isColAtEdge(column2, "last"));
    }
    function getClassParams(abstractColDef, gos, column2, columnGroup) {
      return _addGridCommonParams(gos, {
        // bad naming, as colDef here can be a group or a column,
        // however most people won't appreciate the difference,
        // so keeping it as colDef to avoid confusion.
        colDef: abstractColDef,
        column: column2,
        columnGroup
      });
    }
    function getColumnClassesFromCollDef(classesOrFunc, abstractColDef, gos, column2, columnGroup) {
      if (_missing(classesOrFunc)) {
        return [];
      }
      let classToUse;
      if (typeof classesOrFunc === "function") {
        const params = getClassParams(abstractColDef, gos, column2, columnGroup);
        classToUse = classesOrFunc(params);
      } else {
        classToUse = classesOrFunc;
      }
      if (typeof classToUse === "string") {
        return [classToUse];
      }
      if (Array.isArray(classToUse)) {
        return [...classToUse];
      }
      return [];
    }
    function _addFocusableContainerListener(beans, comp2, eGui) {
      comp2.addManagedElementListeners(eGui, {
        keydown: (e) => {
          if (!e.defaultPrevented && e.key === KeyCode.TAB) {
            const backwards = e.shiftKey;
            if (!_findNextFocusableElement(beans, eGui, false, backwards)) {
              if (_focusNextGridCoreContainer(beans, backwards)) {
                e.preventDefault();
              }
            }
          }
        }
      });
    }
    function _focusGridInnerElement(beans, fromBottom) {
      return beans.ctrlsSvc.get("gridCtrl").focusInnerElement(fromBottom);
    }
    function _isHeaderFocusSuppressed(beans) {
      return beans.gos.get("suppressHeaderFocus") || !!beans.overlays?.isExclusive();
    }
    function _isCellFocusSuppressed(beans) {
      return beans.gos.get("suppressCellFocus") || !!beans.overlays?.isExclusive();
    }
    function _focusNextGridCoreContainer(beans, backwards, forceOut = false) {
      const gridCtrl = beans.ctrlsSvc.get("gridCtrl");
      if (!forceOut && gridCtrl.focusNextInnerContainer(backwards)) {
        return true;
      }
      if (forceOut || !backwards && !gridCtrl.isDetailGrid()) {
        gridCtrl.forceFocusOutOfContainer(backwards);
      }
      return false;
    }
    function getFocusHeaderRowCount(beans) {
      return beans.ctrlsSvc.getHeaderRowContainerCtrl()?.getRowCount() ?? 0;
    }
    function getGroupRowsHeight(beans) {
      const heights = [];
      const headerRowContainerCtrls = beans.ctrlsSvc.getHeaderRowContainerCtrls();
      for (const headerRowContainerCtrl of headerRowContainerCtrls) {
        if (!headerRowContainerCtrl) {
          continue;
        }
        const groupRowCount = headerRowContainerCtrl.getGroupRowCount() || 0;
        for (let i2 = 0; i2 < groupRowCount; i2++) {
          const headerRowCtrl = headerRowContainerCtrl.getGroupRowCtrlAtIndex(i2);
          const currentHeightAtPos = heights[i2];
          if (headerRowCtrl) {
            const newHeight = getColumnGroupHeaderRowHeight(beans, headerRowCtrl);
            if (currentHeightAtPos == null || newHeight > currentHeightAtPos) {
              heights[i2] = newHeight;
            }
          }
        }
      }
      return heights;
    }
    function getColumnGroupHeaderRowHeight(beans, headerRowCtrl) {
      const defaultHeight = beans.colModel.isPivotMode() ? getPivotGroupHeaderHeight(beans) : getGroupHeaderHeight(beans);
      let maxDisplayedHeight = defaultHeight;
      const headerRowCellCtrls = headerRowCtrl.getHeaderCellCtrls();
      for (const headerCellCtrl of headerRowCellCtrls) {
        const { column: column2 } = headerCellCtrl;
        const height = column2.getAutoHeaderHeight();
        if (height != null && height > maxDisplayedHeight && column2.isAutoHeaderHeight()) {
          maxDisplayedHeight = height;
        }
      }
      return maxDisplayedHeight;
    }
    function getColumnHeaderRowHeight(beans) {
      const defaultHeight = beans.colModel.isPivotMode() ? getPivotHeaderHeight(beans) : getHeaderHeight(beans);
      let maxDisplayedHeight = defaultHeight;
      beans.colModel.forAllCols((col) => {
        const height = col.getAutoHeaderHeight();
        if (height != null && height > maxDisplayedHeight && col.isAutoHeaderHeight()) {
          maxDisplayedHeight = height;
        }
      });
      return maxDisplayedHeight;
    }
    function getHeaderHeight(beans) {
      return beans.gos.get("headerHeight") ?? beans.environment.getDefaultHeaderHeight();
    }
    function getFloatingFiltersHeight(beans) {
      return beans.gos.get("floatingFiltersHeight") ?? getHeaderHeight(beans);
    }
    function getGroupHeaderHeight(beans) {
      return beans.gos.get("groupHeaderHeight") ?? getHeaderHeight(beans);
    }
    function getPivotHeaderHeight(beans) {
      return beans.gos.get("pivotHeaderHeight") ?? getHeaderHeight(beans);
    }
    function getPivotGroupHeaderHeight(beans) {
      return beans.gos.get("pivotGroupHeaderHeight") ?? getGroupHeaderHeight(beans);
    }
    function isHeaderPositionEqual(headerPosA, headerPosB) {
      return headerPosA.headerRowIndex === headerPosB.headerRowIndex && headerPosA.column === headerPosB.column;
    }
    var GridHeaderCtrl = class extends BeanStub {
      setComp(comp2, eGui, eFocusableElement) {
        this.comp = comp2;
        this.eGui = eGui;
        const { beans } = this;
        const { headerNavigation, touchSvc, ctrlsSvc } = beans;
        if (headerNavigation) {
          this.createManagedBean(
            new ManagedFocusFeature(eFocusableElement, {
              onTabKeyDown: this.onTabKeyDown.bind(this),
              handleKeyDown: this.handleKeyDown.bind(this),
              onFocusOut: this.onFocusOut.bind(this)
            })
          );
        }
        this.addManagedEventListeners({
          columnPivotModeChanged: this.onPivotModeChanged.bind(this, beans),
          displayedColumnsChanged: this.onDisplayedColumnsChanged.bind(this, beans)
        });
        this.onPivotModeChanged(beans);
        this.setupHeaderHeight();
        const listener = this.onHeaderContextMenu.bind(this);
        this.addManagedElementListeners(this.eGui, { contextmenu: listener });
        touchSvc?.mockHeaderContextMenu(this, listener);
        ctrlsSvc.register("gridHeaderCtrl", this);
      }
      setupHeaderHeight() {
        const listener = this.setHeaderHeight.bind(this);
        listener();
        this.addManagedPropertyListeners(
          [
            "headerHeight",
            "pivotHeaderHeight",
            "groupHeaderHeight",
            "pivotGroupHeaderHeight",
            "floatingFiltersHeight"
          ],
          listener
        );
        this.addManagedEventListeners({
          headerRowsChanged: listener,
          columnHeaderHeightChanged: listener,
          // add this to the animation frame to avoid a feedback loop
          columnGroupHeaderHeightChanged: () => _requestAnimationFrame(this.beans, () => listener()),
          gridStylesChanged: listener,
          advancedFilterEnabledChanged: listener
        });
      }
      setHeaderHeight() {
        const { beans } = this;
        let totalHeaderHeight = 0;
        const groupHeight = getGroupRowsHeight(beans).reduce((prev, curr) => prev + curr, 0);
        const headerHeight = getColumnHeaderRowHeight(beans);
        if (beans.filterManager?.hasFloatingFilters()) {
          totalHeaderHeight += getFloatingFiltersHeight(beans);
        }
        totalHeaderHeight += groupHeight;
        totalHeaderHeight += headerHeight;
        if (this.headerHeight === totalHeaderHeight) {
          return;
        }
        this.headerHeight = totalHeaderHeight;
        const px = `${totalHeaderHeight + 1}px`;
        this.comp.setHeightAndMinHeight(px);
        this.eventSvc.dispatchEvent({
          type: "headerHeightChanged"
        });
      }
      onPivotModeChanged(beans) {
        const pivotMode = beans.colModel.isPivotMode();
        this.comp.toggleCss("ag-pivot-on", pivotMode);
        this.comp.toggleCss("ag-pivot-off", !pivotMode);
      }
      onDisplayedColumnsChanged(beans) {
        const columns = beans.visibleCols.allCols;
        const shouldAllowOverflow = columns.some((col) => col.isSpanHeaderHeight());
        this.comp.toggleCss("ag-header-allow-overflow", shouldAllowOverflow);
      }
      onTabKeyDown(e) {
        const isRtl = this.gos.get("enableRtl");
        const backwards = e.shiftKey;
        const direction = backwards !== isRtl ? "LEFT" : "RIGHT";
        const { beans } = this;
        const { headerNavigation, focusSvc } = beans;
        if (headerNavigation.navigateHorizontally(direction, true, e) || !backwards && focusSvc.focusOverlay(false) || _focusNextGridCoreContainer(beans, backwards, true)) {
          e.preventDefault();
        }
      }
      handleKeyDown(e) {
        let direction = null;
        const { headerNavigation } = this.beans;
        switch (e.key) {
          case KeyCode.LEFT:
            direction = "LEFT";
          case KeyCode.RIGHT: {
            if (!_exists(direction)) {
              direction = "RIGHT";
            }
            if (headerNavigation.navigateHorizontally(direction, false, e)) {
              e.preventDefault();
            }
            break;
          }
          case KeyCode.UP:
            direction = "UP";
          case KeyCode.DOWN: {
            if (!_exists(direction)) {
              direction = "DOWN";
            }
            if (headerNavigation.navigateVertically(direction, e)) {
              e.preventDefault();
            }
            break;
          }
          default:
            return;
        }
      }
      onFocusOut(e) {
        const { relatedTarget } = e;
        const { eGui, beans } = this;
        if (!relatedTarget && eGui.contains(_getActiveDomElement(beans))) {
          return;
        }
        if (!eGui.contains(relatedTarget)) {
          beans.focusSvc.focusedHeader = null;
        }
      }
      onHeaderContextMenu(mouseEvent, touch, touchEvent) {
        const { menuSvc, ctrlsSvc } = this.beans;
        if (!mouseEvent && !touchEvent || !menuSvc?.isHeaderContextMenuEnabled()) {
          return;
        }
        const { target: target2 } = mouseEvent ?? touch;
        if (target2 === this.eGui || target2 === ctrlsSvc.getHeaderRowContainerCtrl()?.eViewport) {
          menuSvc.showHeaderContextMenu(void 0, mouseEvent, touchEvent);
        }
      }
    };
    var SetLeftFeature = class extends BeanStub {
      constructor(columnOrGroup, eCell, beans, colsSpanning) {
        super();
        this.columnOrGroup = columnOrGroup;
        this.eCell = eCell;
        this.colsSpanning = colsSpanning;
        this.columnOrGroup = columnOrGroup;
        this.ariaEl = eCell.querySelector("[role=columnheader]") || eCell;
        this.beans = beans;
      }
      setColsSpanning(colsSpanning) {
        this.colsSpanning = colsSpanning;
        this.onLeftChanged();
      }
      getColumnOrGroup() {
        const { beans, colsSpanning } = this;
        if (beans.gos.get("enableRtl") && colsSpanning) {
          return _last(colsSpanning);
        }
        return this.columnOrGroup;
      }
      postConstruct() {
        const onLeftChanged = this.onLeftChanged.bind(this);
        this.addManagedListeners(this.columnOrGroup, { leftChanged: onLeftChanged });
        this.setLeftFirstTime();
        this.addManagedEventListeners({ displayedColumnsWidthChanged: onLeftChanged });
        this.addManagedPropertyListener("domLayout", onLeftChanged);
      }
      setLeftFirstTime() {
        const { gos, colAnimation } = this.beans;
        const suppressMoveAnimation = gos.get("suppressColumnMoveAnimation");
        const oldLeftExists = _exists(this.columnOrGroup.getOldLeft());
        const animateColumnMove = colAnimation?.isActive() && oldLeftExists && !suppressMoveAnimation;
        if (animateColumnMove) {
          this.animateInLeft();
        } else {
          this.onLeftChanged();
        }
      }
      animateInLeft() {
        const colOrGroup = this.getColumnOrGroup();
        const oldActualLeft = this.modifyLeftForPrintLayout(colOrGroup, colOrGroup.getOldLeft());
        const actualLeft = this.modifyLeftForPrintLayout(colOrGroup, colOrGroup.getLeft());
        this.setLeft(oldActualLeft);
        this.actualLeft = actualLeft;
        this.beans.colAnimation.executeNextVMTurn(() => {
          if (this.actualLeft === actualLeft) {
            this.setLeft(actualLeft);
          }
        });
      }
      onLeftChanged() {
        const colOrGroup = this.getColumnOrGroup();
        const left2 = colOrGroup.getLeft();
        this.actualLeft = this.modifyLeftForPrintLayout(colOrGroup, left2);
        this.setLeft(this.actualLeft);
      }
      modifyLeftForPrintLayout(colOrGroup, leftPosition) {
        const { gos, visibleCols } = this.beans;
        const printLayout = _isDomLayout(gos, "print");
        if (!printLayout) {
          return leftPosition;
        }
        if (colOrGroup.getPinned() === "left") {
          return leftPosition;
        }
        const leftWidth = visibleCols.getColsLeftWidth();
        if (colOrGroup.getPinned() === "right") {
          const bodyWidth = visibleCols.bodyWidth;
          return leftWidth + bodyWidth + leftPosition;
        }
        return leftWidth + leftPosition;
      }
      setLeft(value2) {
        if (_exists(value2)) {
          this.eCell.style.left = `${value2}px`;
        }
        if (isColumnGroup(this.columnOrGroup)) {
          const children2 = this.columnOrGroup.getLeafColumns();
          if (!children2.length) {
            return;
          }
          if (children2.length > 1) {
            _setAriaColSpan(this.ariaEl, children2.length);
          }
        }
      }
    };
    var instanceIdSequence2 = 0;
    var DOM_DATA_KEY_HEADER_CTRL = "headerCtrl";
    var AbstractHeaderCellCtrl = class extends BeanStub {
      constructor(column2, rowCtrl) {
        super();
        this.column = column2;
        this.rowCtrl = rowCtrl;
        this.resizeToggleTimeout = 0;
        this.resizeMultiplier = 1;
        this.resizeFeature = null;
        this.lastFocusEvent = null;
        this.dragSource = null;
        this.reAttemptToFocus = false;
        this.instanceId = column2.getUniqueId() + "-" + instanceIdSequence2++;
      }
      postConstruct() {
        const refreshTabIndex = this.refreshTabIndex.bind(this);
        this.addManagedPropertyListeners(["suppressHeaderFocus"], refreshTabIndex);
        this.addManagedEventListeners({
          overlayExclusiveChanged: refreshTabIndex
        });
      }
      setComp(comp2, eGui, eResize, eHeaderCompWrapper, compBean) {
        eGui.setAttribute("col-id", this.column.colIdSanitised);
        this.wireComp(comp2, eGui, eResize, eHeaderCompWrapper, compBean);
        if (this.reAttemptToFocus) {
          this.reAttemptToFocus = false;
          this.focus(this.lastFocusEvent ?? void 0);
        }
      }
      shouldStopEventPropagation(event) {
        const { headerRowIndex, column: column2 } = this.beans.focusSvc.focusedHeader;
        const colDef = column2.getDefinition();
        const colDefFunc = colDef?.suppressHeaderKeyboardEvent;
        if (!_exists(colDefFunc)) {
          return false;
        }
        const params = _addGridCommonParams(this.gos, {
          colDef,
          column: column2,
          headerRowIndex,
          event
        });
        return !!colDefFunc(params);
      }
      getWrapperHasFocus() {
        const activeEl = _getActiveDomElement(this.beans);
        return activeEl === this.eGui;
      }
      setGui(eGui, compBean) {
        this.eGui = eGui;
        this.addDomData(compBean);
        compBean.addManagedListeners(this.beans.eventSvc, {
          displayedColumnsChanged: this.onDisplayedColumnsChanged.bind(this)
        });
        compBean.addManagedElementListeners(this.eGui, {
          focus: this.onGuiFocus.bind(this)
        });
        this.onDisplayedColumnsChanged();
        this.refreshTabIndex();
      }
      refreshHeaderStyles() {
        const colDef = this.column.getDefinition();
        if (!colDef) {
          return;
        }
        const { headerStyle } = colDef;
        let styles2;
        if (typeof headerStyle === "function") {
          const cellStyleParams = this.getHeaderClassParams();
          styles2 = headerStyle(cellStyleParams);
        } else {
          styles2 = headerStyle;
        }
        if (styles2) {
          this.comp.setUserStyles(styles2);
        }
      }
      onGuiFocus() {
        this.eventSvc.dispatchEvent({
          type: "headerFocused",
          column: this.column
        });
      }
      setupAutoHeight(params) {
        const { wrapperElement, checkMeasuringCallback, compBean } = params;
        const { beans } = this;
        const measureHeight = (timesCalled) => {
          if (!this.isAlive() || !compBean.isAlive()) {
            return;
          }
          const { paddingTop, paddingBottom, borderBottomWidth, borderTopWidth } = _getElementSize(this.eGui);
          const extraHeight = paddingTop + paddingBottom + borderBottomWidth + borderTopWidth;
          const wrapperHeight = wrapperElement.offsetHeight;
          const autoHeight = wrapperHeight + extraHeight;
          if (timesCalled < 5) {
            const doc2 = _getDocument(beans);
            const notYetInDom = !doc2?.contains(wrapperElement);
            const possiblyNoContentYet = autoHeight == 0;
            if (notYetInDom || possiblyNoContentYet) {
              _batchCall(() => measureHeight(timesCalled + 1), "raf", beans);
              return;
            }
          }
          this.setColHeaderHeight(this.column, autoHeight);
        };
        let isMeasuring = false;
        let stopResizeObserver;
        const checkMeasuring = () => {
          const newValue = this.column.isAutoHeaderHeight();
          if (newValue && !isMeasuring) {
            startMeasuring();
          }
          if (!newValue && isMeasuring) {
            stopMeasuring();
          }
        };
        const startMeasuring = () => {
          isMeasuring = true;
          this.comp.toggleCss("ag-header-cell-auto-height", true);
          measureHeight(0);
          stopResizeObserver = _observeResize(this.beans, wrapperElement, () => measureHeight(0));
        };
        const stopMeasuring = () => {
          isMeasuring = false;
          if (stopResizeObserver) {
            stopResizeObserver();
          }
          this.comp.toggleCss("ag-header-cell-auto-height", false);
          stopResizeObserver = void 0;
        };
        checkMeasuring();
        compBean.addDestroyFunc(() => stopMeasuring());
        compBean.addManagedListeners(this.column, { widthChanged: () => isMeasuring && measureHeight(0) });
        compBean.addManagedEventListeners({
          sortChanged: () => {
            if (isMeasuring) {
              window.setTimeout(() => measureHeight(0));
            }
          }
        });
        if (checkMeasuringCallback) {
          checkMeasuringCallback(checkMeasuring);
        }
      }
      onDisplayedColumnsChanged() {
        const { comp: comp2, column: column2, beans, eGui } = this;
        if (!comp2 || !column2 || !eGui) {
          return;
        }
        refreshFirstAndLastStyles(comp2, column2, beans.visibleCols);
        _setAriaColIndex(eGui, beans.visibleCols.getAriaColIndex(column2));
      }
      addResizeAndMoveKeyboardListeners(compBean) {
        compBean.addManagedListeners(this.eGui, {
          keydown: this.onGuiKeyDown.bind(this),
          keyup: this.onGuiKeyUp.bind(this)
        });
      }
      refreshTabIndex() {
        const suppressHeaderFocus = _isHeaderFocusSuppressed(this.beans);
        if (this.eGui) {
          _addOrRemoveAttribute(this.eGui, "tabindex", suppressHeaderFocus ? null : "-1");
        }
      }
      onGuiKeyDown(e) {
        const activeEl = _getActiveDomElement(this.beans);
        const isLeftOrRight = e.key === KeyCode.LEFT || e.key === KeyCode.RIGHT;
        if (this.isResizing) {
          e.preventDefault();
          e.stopImmediatePropagation();
        }
        if (
          // if elements within the header are focused, we don't process the event
          activeEl !== this.eGui || // if shiftKey and altKey are not pressed, it's cell navigation so we don't process the event
          !e.shiftKey && !e.altKey
        ) {
          return;
        }
        if (this.isResizing || isLeftOrRight) {
          e.preventDefault();
          e.stopImmediatePropagation();
        }
        if (!isLeftOrRight) {
          return;
        }
        const isLeft = e.key === KeyCode.LEFT !== this.gos.get("enableRtl");
        const direction = isLeft ? "left" : "right";
        if (e.altKey) {
          this.isResizing = true;
          this.resizeMultiplier += 1;
          const diff2 = this.getViewportAdjustedResizeDiff(e);
          this.resizeHeader(diff2, e.shiftKey);
          this.resizeFeature?.toggleColumnResizing(true);
        } else {
          this.moveHeader(direction);
        }
      }
      moveHeader(hDirection) {
        this.beans.colMoves?.moveHeader(hDirection, this.eGui, this.column, this.rowCtrl.pinned, this);
      }
      getViewportAdjustedResizeDiff(e) {
        const diff2 = this.getResizeDiff(e);
        const { pinnedCols } = this.beans;
        return pinnedCols ? pinnedCols.getHeaderResizeDiff(diff2, this.column) : diff2;
      }
      getResizeDiff(e) {
        const { gos, column: column2 } = this;
        let isLeft = e.key === KeyCode.LEFT !== gos.get("enableRtl");
        const pinned = column2.getPinned();
        const isRtl = gos.get("enableRtl");
        if (pinned) {
          if (isRtl !== (pinned === "right")) {
            isLeft = !isLeft;
          }
        }
        return (isLeft ? -1 : 1) * this.resizeMultiplier;
      }
      onGuiKeyUp() {
        if (!this.isResizing) {
          return;
        }
        if (this.resizeToggleTimeout) {
          window.clearTimeout(this.resizeToggleTimeout);
          this.resizeToggleTimeout = 0;
        }
        this.isResizing = false;
        this.resizeMultiplier = 1;
        this.resizeToggleTimeout = window.setTimeout(() => {
          this.resizeFeature?.toggleColumnResizing(false);
        }, 150);
      }
      handleKeyDown(e) {
        const wrapperHasFocus = this.getWrapperHasFocus();
        switch (e.key) {
          case KeyCode.PAGE_DOWN:
          case KeyCode.PAGE_UP:
          case KeyCode.PAGE_HOME:
          case KeyCode.PAGE_END:
            if (wrapperHasFocus) {
              e.preventDefault();
            }
        }
      }
      addDomData(compBean) {
        const key2 = DOM_DATA_KEY_HEADER_CTRL;
        const { eGui, gos } = this;
        _setDomData(gos, eGui, key2, this);
        compBean.addDestroyFunc(() => _setDomData(gos, eGui, key2, null));
      }
      focus(event) {
        if (!this.isAlive()) {
          return false;
        }
        const { eGui } = this;
        if (!eGui) {
          this.reAttemptToFocus = true;
        } else {
          eGui.focus();
          this.lastFocusEvent = event || null;
        }
        return true;
      }
      focusThis() {
        this.beans.focusSvc.focusedHeader = { headerRowIndex: this.rowCtrl.rowIndex, column: this.column };
      }
      removeDragSource() {
        if (this.dragSource) {
          this.beans.dragAndDrop?.removeDragSource(this.dragSource);
          this.dragSource = null;
        }
      }
      handleContextMenuMouseEvent(mouseEvent, touchEvent, column2) {
        const event = mouseEvent ?? touchEvent;
        const { menuSvc, gos } = this.beans;
        if (gos.get("preventDefaultOnContextMenu")) {
          event.preventDefault();
        }
        if (menuSvc?.isHeaderContextMenuEnabled(column2)) {
          menuSvc.showHeaderContextMenu(column2, mouseEvent, touchEvent);
        }
        this.dispatchColumnMouseEvent("columnHeaderContextMenu", column2);
      }
      dispatchColumnMouseEvent(eventType, column2) {
        this.eventSvc.dispatchEvent({
          type: eventType,
          column: column2
        });
      }
      setColHeaderHeight(col, height) {
        if (!col.setAutoHeaderHeight(height)) {
          return;
        }
        const { eventSvc } = this;
        if (col.isColumn) {
          eventSvc.dispatchEvent({
            type: "columnHeaderHeightChanged",
            column: col,
            columns: [col],
            source: "autosizeColumnHeaderHeight"
          });
        } else {
          eventSvc.dispatchEvent({
            type: "columnGroupHeaderHeightChanged",
            columnGroup: col,
            source: "autosizeColumnGroupHeaderHeight"
          });
        }
      }
      clearComponent() {
        this.removeDragSource();
        this.resizeFeature = null;
        this.comp = null;
        this.eGui = null;
      }
      destroy() {
        super.destroy();
        this.column = null;
        this.lastFocusEvent = null;
        this.rowCtrl = null;
      }
    };
    var HeaderCellCtrl = class extends AbstractHeaderCellCtrl {
      constructor() {
        super(...arguments);
        this.refreshFunctions = {};
        this.userHeaderClasses = /* @__PURE__ */ new Set();
        this.ariaDescriptionProperties = /* @__PURE__ */ new Map();
      }
      wireComp(comp2, eGui, eResize, eHeaderCompWrapper, compBeanInput) {
        this.comp = comp2;
        const { rowCtrl, column: column2, beans } = this;
        const { colResize, context, colHover, rangeSvc } = beans;
        const compBean = setupCompBean(this, context, compBeanInput);
        this.setGui(eGui, compBean);
        this.updateState();
        this.setupWidth(compBean);
        this.setupMovingCss(compBean);
        this.setupMenuClass(compBean);
        this.setupSortableClass(compBean);
        this.setupWrapTextClass();
        this.refreshSpanHeaderHeight();
        this.setupAutoHeight({
          wrapperElement: eHeaderCompWrapper,
          checkMeasuringCallback: (checkMeasuring) => this.setRefreshFunction("measuring", checkMeasuring),
          compBean
        });
        this.addColumnHoverListener(compBean);
        this.setupFilterClass(compBean);
        this.setupStylesFromColDef();
        this.setupClassesFromColDef();
        this.setupTooltip();
        this.addActiveHeaderMouseListeners(compBean);
        this.setupSelectAll(compBean);
        this.setupUserComp();
        this.refreshAria();
        if (colResize) {
          this.resizeFeature = compBean.createManagedBean(
            colResize.createResizeFeature(rowCtrl.pinned, column2, eResize, comp2, this)
          );
        } else {
          _setDisplayed(eResize, false);
        }
        colHover?.createHoverFeature(compBean, [column2], eGui);
        rangeSvc?.createRangeHighlightFeature(compBean, column2, comp2);
        compBean.createManagedBean(new SetLeftFeature(column2, eGui, beans));
        compBean.createManagedBean(
          new ManagedFocusFeature(eGui, {
            shouldStopEventPropagation: (e) => this.shouldStopEventPropagation(e),
            onTabKeyDown: () => null,
            handleKeyDown: this.handleKeyDown.bind(this),
            onFocusIn: this.onFocusIn.bind(this),
            onFocusOut: this.onFocusOut.bind(this)
          })
        );
        this.addResizeAndMoveKeyboardListeners(compBean);
        compBean.addManagedPropertyListeners(
          ["suppressMovableColumns", "suppressMenuHide", "suppressAggFuncInHeader", "enableAdvancedFilter"],
          () => this.refresh()
        );
        compBean.addManagedListeners(column2, { colDefChanged: () => this.refresh() });
        compBean.addManagedListeners(column2, { headerHighlightChanged: this.onHeaderHighlightChanged.bind(this) });
        const listener = () => this.checkDisplayName();
        compBean.addManagedEventListeners({
          columnValueChanged: listener,
          columnRowGroupChanged: listener,
          columnPivotChanged: listener,
          headerHeightChanged: this.onHeaderHeightChanged.bind(this)
        });
        compBean.addDestroyFunc(() => {
          this.refreshFunctions = {};
          this.selectAllFeature = null;
          this.dragSourceElement = void 0;
          this.userCompDetails = null;
          this.userHeaderClasses.clear();
          this.ariaDescriptionProperties.clear();
          this.clearComponent();
        });
      }
      resizeHeader(delta2, shiftKey) {
        this.beans.colResize?.resizeHeader(this.column, delta2, shiftKey);
      }
      getHeaderClassParams() {
        const { column: column2, beans } = this;
        const colDef = column2.colDef;
        return _addGridCommonParams(beans.gos, {
          colDef,
          column: column2,
          floatingFilter: false
        });
      }
      setupUserComp() {
        const compDetails = this.lookupUserCompDetails();
        if (compDetails) {
          this.setCompDetails(compDetails);
        }
      }
      setCompDetails(compDetails) {
        this.userCompDetails = compDetails;
        this.comp.setUserCompDetails(compDetails);
      }
      lookupUserCompDetails() {
        const params = this.createParams();
        const colDef = this.column.getColDef();
        return _getHeaderCompDetails(this.beans.userCompFactory, colDef, params);
      }
      createParams() {
        const { menuSvc, sortSvc, colFilter, gos } = this.beans;
        const params = _addGridCommonParams(gos, {
          column: this.column,
          displayName: this.displayName,
          enableSorting: this.column.isSortable(),
          enableMenu: this.menuEnabled,
          enableFilterButton: this.openFilterEnabled && !!menuSvc?.isHeaderFilterButtonEnabled(this.column),
          enableFilterIcon: !!colFilter && (!this.openFilterEnabled || _isLegacyMenuEnabled(this.gos)),
          showColumnMenu: (buttonElement, onClosedCallback) => {
            menuSvc?.showColumnMenu({
              column: this.column,
              buttonElement,
              positionBy: "button",
              onClosedCallback
            });
          },
          showColumnMenuAfterMouseClick: (mouseEvent, onClosedCallback) => {
            menuSvc?.showColumnMenu({
              column: this.column,
              mouseEvent,
              positionBy: "mouse",
              onClosedCallback
            });
          },
          showFilter: (buttonElement) => {
            menuSvc?.showFilterMenu({
              column: this.column,
              buttonElement,
              containerType: "columnFilter",
              positionBy: "button"
            });
          },
          progressSort: (multiSort) => {
            sortSvc?.progressSort(this.column, !!multiSort, "uiColumnSorted");
          },
          setSort: (sort2, multiSort) => {
            sortSvc?.setSortForColumn(this.column, sort2, !!multiSort, "uiColumnSorted");
          },
          eGridHeader: this.eGui,
          setTooltip: (value2, shouldDisplayTooltip) => {
            gos.assertModuleRegistered("Tooltip", 3);
            this.setupTooltip(value2, shouldDisplayTooltip);
          }
        });
        return params;
      }
      setupSelectAll(compBean) {
        const { selectionSvc } = this.beans;
        if (!selectionSvc) {
          return;
        }
        this.selectAllFeature = compBean.createOptionalManagedBean(selectionSvc.createSelectAllFeature(this.column));
        this.selectAllFeature?.setComp(this);
        compBean.addManagedPropertyListener("rowSelection", () => {
          const selectAllFeature = selectionSvc.createSelectAllFeature(this.column);
          if (selectAllFeature && !this.selectAllFeature) {
            this.selectAllFeature = compBean.createManagedBean(selectAllFeature);
            this.selectAllFeature?.setComp(this);
            this.comp.refreshSelectAllGui();
          } else if (this.selectAllFeature && !selectAllFeature) {
            this.comp.removeSelectAllGui();
            this.selectAllFeature = this.destroyBean(this.selectAllFeature);
          }
        });
      }
      getSelectAllGui() {
        return this.selectAllFeature?.getCheckboxGui();
      }
      handleKeyDown(e) {
        super.handleKeyDown(e);
        if (e.key === KeyCode.SPACE) {
          this.selectAllFeature?.onSpaceKeyDown(e);
        }
        if (e.key === KeyCode.ENTER) {
          this.onEnterKeyDown(e);
        }
        if (e.key === KeyCode.DOWN && e.altKey) {
          this.showMenuOnKeyPress(e, false);
        }
      }
      onEnterKeyDown(e) {
        if (e.ctrlKey || e.metaKey) {
          this.showMenuOnKeyPress(e, true);
        } else if (this.sortable) {
          this.beans.sortSvc?.progressSort(this.column, e.shiftKey, "uiColumnSorted");
        }
      }
      showMenuOnKeyPress(e, isFilterShortcut) {
        const headerComp = this.comp.getUserCompInstance();
        if (!isHeaderComp(headerComp)) {
          return;
        }
        if (headerComp.onMenuKeyboardShortcut(isFilterShortcut)) {
          e.preventDefault();
        }
      }
      onFocusIn(e) {
        if (!this.eGui.contains(e.relatedTarget)) {
          this.focusThis();
          this.announceAriaDescription();
        }
        if (_isKeyboardMode()) {
          this.setActiveHeader(true);
        }
      }
      onFocusOut(e) {
        if (this.eGui.contains(e.relatedTarget)) {
          return;
        }
        this.setActiveHeader(false);
      }
      setupTooltip(value2, shouldDisplayTooltip) {
        this.tooltipFeature = this.beans.tooltipSvc?.setupHeaderTooltip(
          this.tooltipFeature,
          this,
          value2,
          shouldDisplayTooltip
        );
      }
      setupStylesFromColDef() {
        this.setRefreshFunction("headerStyles", this.refreshHeaderStyles.bind(this));
        this.refreshHeaderStyles();
      }
      setupClassesFromColDef() {
        const refreshHeaderClasses = () => {
          const colDef = this.column.getColDef();
          const classes = _getHeaderClassesFromColDef(colDef, this.gos, this.column, null);
          const oldClasses = this.userHeaderClasses;
          this.userHeaderClasses = new Set(classes);
          for (const c2 of classes) {
            if (oldClasses.has(c2)) {
              oldClasses.delete(c2);
            } else {
              this.comp.toggleCss(c2, true);
            }
          }
          for (const c2 of oldClasses) {
            this.comp.toggleCss(c2, false);
          }
        };
        this.setRefreshFunction("headerClasses", refreshHeaderClasses);
        refreshHeaderClasses();
      }
      setDragSource(eSource) {
        this.dragSourceElement = eSource;
        this.removeDragSource();
        if (!eSource || !this.draggable) {
          return;
        }
        this.dragSource = this.beans.colMoves?.setDragSourceForHeader(eSource, this.column, this.displayName) ?? null;
      }
      updateState() {
        const { menuSvc } = this.beans;
        this.menuEnabled = !!menuSvc?.isColumnMenuInHeaderEnabled(this.column);
        this.openFilterEnabled = !!menuSvc?.isFilterMenuInHeaderEnabled(this.column);
        this.sortable = this.column.isSortable();
        this.displayName = this.calculateDisplayName();
        this.draggable = this.workOutDraggable();
      }
      setRefreshFunction(name2, func) {
        this.refreshFunctions[name2] = func;
      }
      refresh() {
        this.updateState();
        this.refreshHeaderComp();
        this.refreshAria();
        for (const f of Object.values(this.refreshFunctions)) {
          f();
        }
      }
      refreshHeaderComp() {
        const newCompDetails = this.lookupUserCompDetails();
        if (!newCompDetails) {
          return;
        }
        const compInstance = this.comp.getUserCompInstance();
        const attemptRefresh = compInstance != null && this.userCompDetails.componentClass == newCompDetails.componentClass;
        const headerCompRefreshed = attemptRefresh ? this.attemptHeaderCompRefresh(newCompDetails.params) : false;
        if (headerCompRefreshed) {
          this.setDragSource(this.dragSourceElement);
        } else {
          this.setCompDetails(newCompDetails);
        }
      }
      attemptHeaderCompRefresh(params) {
        const headerComp = this.comp.getUserCompInstance();
        if (!headerComp) {
          return false;
        }
        if (!headerComp.refresh) {
          return false;
        }
        const res = headerComp.refresh(params);
        return res;
      }
      calculateDisplayName() {
        return this.beans.colNames.getDisplayNameForColumn(this.column, "header", true);
      }
      checkDisplayName() {
        if (this.displayName !== this.calculateDisplayName()) {
          this.refresh();
        }
      }
      workOutDraggable() {
        const colDef = this.column.getColDef();
        const isSuppressMovableColumns = this.gos.get("suppressMovableColumns");
        const colCanMove = !isSuppressMovableColumns && !colDef.suppressMovable && !colDef.lockPosition;
        return !!colCanMove || !!colDef.enableRowGroup || !!colDef.enablePivot;
      }
      setupWidth(compBean) {
        const listener = () => {
          const columnWidth = this.column.getActualWidth();
          this.comp.setWidth(`${columnWidth}px`);
        };
        compBean.addManagedListeners(this.column, { widthChanged: listener });
        listener();
      }
      setupMovingCss(compBean) {
        const listener = () => {
          this.comp.toggleCss("ag-header-cell-moving", this.column.isMoving());
        };
        compBean.addManagedListeners(this.column, { movingChanged: listener });
        listener();
      }
      setupMenuClass(compBean) {
        const listener = () => {
          this.comp?.toggleCss("ag-column-menu-visible", this.column.isMenuVisible());
        };
        compBean.addManagedListeners(this.column, { menuVisibleChanged: listener });
        listener();
      }
      setupSortableClass(compBean) {
        const updateSortableCssClass = () => {
          this.comp.toggleCss("ag-header-cell-sortable", !!this.sortable);
        };
        updateSortableCssClass();
        this.setRefreshFunction("updateSortable", updateSortableCssClass);
        compBean.addManagedEventListeners({ sortChanged: this.refreshAriaSort.bind(this) });
      }
      setupFilterClass(compBean) {
        const listener = () => {
          const isFilterActive = this.column.isFilterActive();
          this.comp.toggleCss("ag-header-cell-filtered", isFilterActive);
          this.refreshAria();
        };
        compBean.addManagedListeners(this.column, { filterActiveChanged: listener });
        listener();
      }
      setupWrapTextClass() {
        const listener = () => {
          const wrapText = !!this.column.getColDef().wrapHeaderText;
          this.comp.toggleCss("ag-header-cell-wrap-text", wrapText);
        };
        listener();
        this.setRefreshFunction("wrapText", listener);
      }
      onHeaderHighlightChanged() {
        const highlighted = this.column.getHighlighted();
        const beforeOn = highlighted === 0;
        const afterOn = highlighted === 1;
        this.comp.toggleCss("ag-header-highlight-before", beforeOn);
        this.comp.toggleCss("ag-header-highlight-after", afterOn);
      }
      onDisplayedColumnsChanged() {
        super.onDisplayedColumnsChanged();
        if (!this.isAlive()) {
          return;
        }
        this.onHeaderHeightChanged();
      }
      onHeaderHeightChanged() {
        this.refreshSpanHeaderHeight();
      }
      refreshSpanHeaderHeight() {
        const { eGui, column: column2, comp: comp2, beans } = this;
        const groupHeaderHeight = getGroupRowsHeight(this.beans);
        const isZeroGroupHeight = groupHeaderHeight.reduce((total, next) => total + next, 0) === 0;
        comp2.toggleCss("ag-header-parent-hidden", isZeroGroupHeight);
        if (!column2.isSpanHeaderHeight()) {
          eGui.style.removeProperty("top");
          eGui.style.removeProperty("height");
          comp2.toggleCss("ag-header-span-height", false);
          comp2.toggleCss("ag-header-span-total", false);
          return;
        }
        const { numberOfParents, isSpanningTotal } = this.column.getColumnGroupPaddingInfo();
        comp2.toggleCss("ag-header-span-height", numberOfParents > 0);
        const headerHeight = getColumnHeaderRowHeight(beans);
        if (numberOfParents === 0) {
          comp2.toggleCss("ag-header-span-total", false);
          eGui.style.setProperty("top", `0px`);
          eGui.style.setProperty("height", `${headerHeight}px`);
          return;
        }
        comp2.toggleCss("ag-header-span-total", isSpanningTotal);
        const indexToStartSpanning = (this.column.getFirstRealParent()?.getLevel() ?? -1) + 1;
        const rowsToSpan = groupHeaderHeight.length - indexToStartSpanning;
        let extraHeight = 0;
        for (let i2 = 0; i2 < rowsToSpan; i2++) {
          extraHeight += groupHeaderHeight[groupHeaderHeight.length - 1 - i2];
        }
        eGui.style.setProperty("top", `${-extraHeight}px`);
        eGui.style.setProperty("height", `${headerHeight + extraHeight}px`);
      }
      refreshAriaSort() {
        if (this.sortable) {
          const translate = this.getLocaleTextFunc();
          const sort2 = this.beans.sortSvc?.getDisplaySortForColumn(this.column) || null;
          this.comp.setAriaSort(_getAriaSortState(sort2));
          this.setAriaDescriptionProperty("sort", translate("ariaSortableColumn", "Press ENTER to sort"));
        } else {
          this.comp.setAriaSort();
          this.setAriaDescriptionProperty("sort", null);
        }
      }
      refreshAriaMenu() {
        if (this.menuEnabled) {
          const translate = this.getLocaleTextFunc();
          this.setAriaDescriptionProperty("menu", translate("ariaMenuColumn", "Press ALT DOWN to open column menu"));
        } else {
          this.setAriaDescriptionProperty("menu", null);
        }
      }
      refreshAriaFilterButton() {
        if (this.openFilterEnabled && !_isLegacyMenuEnabled(this.gos)) {
          const translate = this.getLocaleTextFunc();
          this.setAriaDescriptionProperty(
            "filterButton",
            translate("ariaFilterColumn", "Press CTRL ENTER to open filter")
          );
        } else {
          this.setAriaDescriptionProperty("filterButton", null);
        }
      }
      refreshAriaFiltered() {
        const translate = this.getLocaleTextFunc();
        const isFilterActive = this.column.isFilterActive();
        if (isFilterActive) {
          this.setAriaDescriptionProperty("filter", translate("ariaColumnFiltered", "Column Filtered"));
        } else {
          this.setAriaDescriptionProperty("filter", null);
        }
      }
      setAriaDescriptionProperty(property2, value2) {
        if (value2 != null) {
          this.ariaDescriptionProperties.set(property2, value2);
        } else {
          this.ariaDescriptionProperties.delete(property2);
        }
      }
      announceAriaDescription() {
        if (!this.eGui.contains(_getActiveDomElement(this.beans))) {
          return;
        }
        const ariaDescription = Array.from(this.ariaDescriptionProperties.keys()).sort((a, b) => a === "filter" ? -1 : b.charCodeAt(0) - a.charCodeAt(0)).map((key2) => this.ariaDescriptionProperties.get(key2)).join(". ");
        this.beans.ariaAnnounce?.announceValue(ariaDescription, "columnHeader");
      }
      refreshAria() {
        this.refreshAriaSort();
        this.refreshAriaMenu();
        this.refreshAriaFilterButton();
        this.refreshAriaFiltered();
      }
      addColumnHoverListener(compBean) {
        this.beans.colHover?.addHeaderColumnHoverListener(compBean, this.comp, this.column);
      }
      addActiveHeaderMouseListeners(compBean) {
        const listener = (e) => this.handleMouseOverChange(e.type === "mouseenter");
        const clickListener = () => {
          this.setActiveHeader(true);
          this.dispatchColumnMouseEvent("columnHeaderClicked", this.column);
        };
        const contextMenuListener = (event) => this.handleContextMenuMouseEvent(event, void 0, this.column);
        compBean.addManagedListeners(this.eGui, {
          mouseenter: listener,
          mouseleave: listener,
          click: clickListener,
          contextmenu: contextMenuListener
        });
      }
      handleMouseOverChange(isMouseOver) {
        this.setActiveHeader(isMouseOver);
        this.eventSvc.dispatchEvent({
          type: isMouseOver ? "columnHeaderMouseOver" : "columnHeaderMouseLeave",
          column: this.column
        });
      }
      setActiveHeader(active) {
        this.comp.toggleCss("ag-header-active", active);
      }
      getAnchorElementForMenu(isFilter) {
        const headerComp = this.comp.getUserCompInstance();
        if (isHeaderComp(headerComp)) {
          return headerComp.getAnchorElementForMenu(isFilter);
        }
        return this.eGui;
      }
      destroy() {
        this.tooltipFeature = this.destroyBean(this.tooltipFeature);
        super.destroy();
      }
    };
    function isHeaderComp(headerComp) {
      return typeof headerComp?.getAnchorElementForMenu === "function" && typeof headerComp.onMenuKeyboardShortcut === "function";
    }
    var instanceIdSequence3 = 0;
    var HeaderRowCtrl = class extends BeanStub {
      constructor(rowIndex, pinned, type) {
        super();
        this.rowIndex = rowIndex;
        this.pinned = pinned;
        this.type = type;
        this.instanceId = instanceIdSequence3++;
        this.comp = null;
        this.allCtrls = [];
        let typeClass = "ag-header-row-column";
        if (type === "group") {
          typeClass = "ag-header-row-group";
        } else if (type === "filter") {
          typeClass = "ag-header-row-filter";
        }
        this.headerRowClass = `ag-header-row ${typeClass}`;
      }
      setRowIndex(rowIndex) {
        this.rowIndex = rowIndex;
        this.comp?.setRowIndex(this.getAriaRowIndex());
        this.onRowHeightChanged();
      }
      postConstruct() {
        this.isPrintLayout = _isDomLayout(this.gos, "print");
        this.isEnsureDomOrder = this.gos.get("ensureDomOrder");
      }
      /** Checks that every header cell that is currently visible has been rendered.
       * Can only be false under some circumstances when using React
       */
      areCellsRendered() {
        if (!this.comp) {
          return false;
        }
        return this.allCtrls.every((ctrl) => ctrl.eGui != null);
      }
      /**
       *
       * @param comp Proxy to the actual component
       * @param initCompState Should the component be initialised with the current state of the controller. Default: true
       */
      setComp(comp2, compBean, initCompState = true) {
        this.comp = comp2;
        compBean = setupCompBean(this, this.beans.context, compBean);
        if (initCompState) {
          this.setRowIndex(this.rowIndex);
          this.onVirtualColumnsChanged();
        }
        this.setWidth();
        this.addEventListeners(compBean);
      }
      getAriaRowIndex() {
        return this.rowIndex + 1;
      }
      addEventListeners(compBean) {
        const onHeightChanged = this.onRowHeightChanged.bind(this);
        const onDisplayedColumnsChanged = this.onDisplayedColumnsChanged.bind(this);
        compBean.addManagedEventListeners({
          columnResized: this.setWidth.bind(this),
          displayedColumnsChanged: onDisplayedColumnsChanged,
          virtualColumnsChanged: (params) => this.onVirtualColumnsChanged(params.afterScroll),
          columnGroupHeaderHeightChanged: onHeightChanged,
          columnHeaderHeightChanged: onHeightChanged,
          gridStylesChanged: onHeightChanged,
          advancedFilterEnabledChanged: onHeightChanged
        });
        compBean.addManagedPropertyListener("domLayout", onDisplayedColumnsChanged);
        compBean.addManagedPropertyListener("ensureDomOrder", (e) => this.isEnsureDomOrder = e.currentValue);
        compBean.addManagedPropertyListeners(
          [
            "headerHeight",
            "pivotHeaderHeight",
            "groupHeaderHeight",
            "pivotGroupHeaderHeight",
            "floatingFiltersHeight"
          ],
          onHeightChanged
        );
      }
      onDisplayedColumnsChanged() {
        this.isPrintLayout = _isDomLayout(this.gos, "print");
        this.onVirtualColumnsChanged();
        this.setWidth();
        this.onRowHeightChanged();
      }
      setWidth() {
        if (!this.comp) {
          return;
        }
        const width = this.getWidthForRow();
        this.comp.setWidth(`${width}px`);
      }
      getWidthForRow() {
        const { visibleCols } = this.beans;
        if (this.isPrintLayout) {
          const pinned = this.pinned != null;
          if (pinned) {
            return 0;
          }
          return visibleCols.getContainerWidth("right") + visibleCols.getContainerWidth("left") + visibleCols.getContainerWidth(null);
        }
        return visibleCols.getContainerWidth(this.pinned);
      }
      onRowHeightChanged() {
        if (!this.comp) {
          return;
        }
        const { topOffset, rowHeight } = this.getTopAndHeight();
        this.comp.setTop(topOffset + "px");
        this.comp.setHeight(rowHeight + "px");
      }
      getTopAndHeight() {
        let topOffset = 0;
        const groupHeadersHeight = getGroupRowsHeight(this.beans);
        for (let i2 = 0; i2 < groupHeadersHeight.length; i2++) {
          if (i2 === this.rowIndex && this.type === "group") {
            return { topOffset, rowHeight: groupHeadersHeight[i2] };
          }
          topOffset += groupHeadersHeight[i2];
        }
        const headerHeight = getColumnHeaderRowHeight(this.beans);
        if (this.type === "column") {
          return { topOffset, rowHeight: headerHeight };
        }
        topOffset += headerHeight;
        const filterHeight = getFloatingFiltersHeight(this.beans);
        return { topOffset, rowHeight: filterHeight };
      }
      onVirtualColumnsChanged(afterScroll = false) {
        if (!this.comp) {
          return;
        }
        const ctrlsToDisplay = this.getUpdatedHeaderCtrls();
        const forceOrder = this.isEnsureDomOrder || this.isPrintLayout;
        this.comp.setHeaderCtrls(ctrlsToDisplay, forceOrder, afterScroll);
      }
      /**
       * Recycles the header cell ctrls and creates new ones for the columns in the viewport
       * @returns The updated header cell ctrls
       */
      getUpdatedHeaderCtrls() {
        const oldCtrls = this.ctrlsById;
        this.ctrlsById = /* @__PURE__ */ new Map();
        const columns = this.getColumnsInViewport();
        for (const child of columns) {
          this.recycleAndCreateHeaderCtrls(child, this.ctrlsById, oldCtrls);
        }
        const isFocusedAndDisplayed = (ctrl) => {
          const { focusSvc, visibleCols } = this.beans;
          const isFocused = focusSvc.isHeaderWrapperFocused(ctrl);
          if (!isFocused) {
            return false;
          }
          const isDisplayed = visibleCols.isVisible(ctrl.column);
          return isDisplayed;
        };
        if (oldCtrls) {
          for (const [id, oldCtrl] of oldCtrls) {
            const keepCtrl = isFocusedAndDisplayed(oldCtrl);
            if (keepCtrl) {
              this.ctrlsById.set(id, oldCtrl);
            } else {
              this.destroyBean(oldCtrl);
            }
          }
        }
        this.allCtrls = Array.from(this.ctrlsById.values());
        return this.allCtrls;
      }
      /** Get the current header cell ctrls */
      getHeaderCellCtrls() {
        return this.allCtrls;
      }
      recycleAndCreateHeaderCtrls(headerColumn, currCtrls, oldCtrls) {
        if (headerColumn.isEmptyGroup()) {
          return;
        }
        const idOfChild = headerColumn.getUniqueId();
        let headerCtrl;
        if (oldCtrls) {
          headerCtrl = oldCtrls.get(idOfChild);
          oldCtrls.delete(idOfChild);
        }
        const forOldColumn = headerCtrl && headerCtrl.column != headerColumn;
        if (forOldColumn) {
          this.destroyBean(headerCtrl);
          headerCtrl = void 0;
        }
        if (headerCtrl == null) {
          switch (this.type) {
            case "filter": {
              headerCtrl = this.createBean(
                this.beans.registry.createDynamicBean(
                  "headerFilterCellCtrl",
                  true,
                  headerColumn,
                  this
                )
              );
              break;
            }
            case "group":
              headerCtrl = this.createBean(
                this.beans.registry.createDynamicBean(
                  "headerGroupCellCtrl",
                  true,
                  headerColumn,
                  this
                )
              );
              break;
            default:
              headerCtrl = this.createBean(new HeaderCellCtrl(headerColumn, this));
              break;
          }
        }
        currCtrls.set(idOfChild, headerCtrl);
      }
      getColumnsInViewport() {
        if (!this.isPrintLayout) {
          return this.getComponentsToRender();
        }
        if (this.pinned) {
          return [];
        }
        const viewportColumns = [];
        for (const pinned of ["left", null, "right"]) {
          viewportColumns.push(...this.getComponentsToRender(pinned));
        }
        return viewportColumns;
      }
      getComponentsToRender(pinned = this.pinned) {
        if (this.type === "group") {
          return this.beans.colViewport.getHeadersToRender(pinned, this.rowIndex);
        }
        return this.beans.colViewport.getColumnHeadersToRender(pinned);
      }
      focusHeader(column2, event) {
        const ctrl = this.allCtrls.find((ctrl2) => ctrl2.column == column2);
        if (!ctrl) {
          return false;
        }
        const focused = ctrl.focus(event);
        return focused;
      }
      destroy() {
        this.allCtrls = this.destroyBeans(this.allCtrls);
        this.ctrlsById = void 0;
        this.comp = null;
        super.destroy();
      }
    };
    var HeaderRowContainerCtrl = class extends BeanStub {
      constructor(pinned) {
        super();
        this.pinned = pinned;
        this.hidden = false;
        this.includeFloatingFilter = false;
        this.groupsRowCtrls = [];
      }
      setComp(comp2, eGui) {
        this.comp = comp2;
        this.eViewport = eGui;
        const { pinnedCols, ctrlsSvc, colModel, colMoves } = this.beans;
        this.setupCenterWidth();
        pinnedCols?.setupHeaderPinnedWidth(this);
        this.setupDragAndDrop(colMoves, this.eViewport);
        const onDisplayedColsChanged = this.refresh.bind(this, true);
        this.addManagedEventListeners({
          displayedColumnsChanged: onDisplayedColsChanged,
          advancedFilterEnabledChanged: onDisplayedColsChanged
        });
        const headerType = `${typeof this.pinned === "string" ? this.pinned : "center"}Header`;
        ctrlsSvc.register(headerType, this);
        if (colModel.ready) {
          this.refresh();
        }
      }
      getAllCtrls() {
        const res = [...this.groupsRowCtrls];
        if (this.columnsRowCtrl) {
          res.push(this.columnsRowCtrl);
        }
        if (this.filtersRowCtrl) {
          res.push(this.filtersRowCtrl);
        }
        return res;
      }
      refresh(keepColumns = false) {
        const { focusSvc, filterManager, visibleCols } = this.beans;
        let sequence = 0;
        const focusedHeaderPosition = focusSvc.getFocusHeaderToUseAfterRefresh();
        const refreshColumnGroups = () => {
          const groupRowCount = visibleCols.headerGroupRowCount;
          sequence = groupRowCount;
          if (!keepColumns) {
            this.groupsRowCtrls = this.destroyBeans(this.groupsRowCtrls);
          }
          const currentGroupCount = this.groupsRowCtrls.length;
          if (currentGroupCount === groupRowCount) {
            return;
          }
          if (currentGroupCount > groupRowCount) {
            for (let i2 = groupRowCount; i2 < currentGroupCount; i2++) {
              this.destroyBean(this.groupsRowCtrls[i2]);
            }
            this.groupsRowCtrls.length = groupRowCount;
            return;
          }
          for (let i2 = currentGroupCount; i2 < groupRowCount; i2++) {
            const ctrl = this.createBean(new HeaderRowCtrl(i2, this.pinned, "group"));
            this.groupsRowCtrls.push(ctrl);
          }
        };
        const refreshColumns = () => {
          const rowIndex = sequence++;
          if (this.hidden) {
            this.columnsRowCtrl = this.destroyBean(this.columnsRowCtrl);
            return;
          }
          if (this.columnsRowCtrl == null || !keepColumns) {
            this.columnsRowCtrl = this.destroyBean(this.columnsRowCtrl);
            this.columnsRowCtrl = this.createBean(new HeaderRowCtrl(rowIndex, this.pinned, "column"));
          } else if (this.columnsRowCtrl.rowIndex !== rowIndex) {
            this.columnsRowCtrl.setRowIndex(rowIndex);
          }
        };
        const refreshFilters = () => {
          this.includeFloatingFilter = !!filterManager?.hasFloatingFilters() && !this.hidden;
          const destroyPreviousComp = () => {
            this.filtersRowCtrl = this.destroyBean(this.filtersRowCtrl);
          };
          if (!this.includeFloatingFilter) {
            destroyPreviousComp();
            return;
          }
          if (!keepColumns) {
            destroyPreviousComp();
          }
          const rowIndex = sequence++;
          if (this.filtersRowCtrl) {
            const rowIndexMismatch = this.filtersRowCtrl.rowIndex !== rowIndex;
            if (rowIndexMismatch) {
              this.filtersRowCtrl.setRowIndex(rowIndex);
            }
          } else {
            this.filtersRowCtrl = this.createBean(new HeaderRowCtrl(rowIndex, this.pinned, "filter"));
          }
        };
        const oldCtrls = this.getAllCtrls();
        refreshColumnGroups();
        refreshColumns();
        refreshFilters();
        const allCtrls = this.getAllCtrls();
        this.comp.setCtrls(allCtrls);
        this.restoreFocusOnHeader(focusSvc, focusedHeaderPosition);
        if (oldCtrls.length !== allCtrls.length) {
          this.beans.eventSvc.dispatchEvent({
            type: "headerRowsChanged"
          });
        }
      }
      getHeaderCtrlForColumn(column2) {
        const findCtrl = (ctrl) => ctrl?.getHeaderCellCtrls().find((ctrl2) => ctrl2.column === column2);
        if (isColumn(column2)) {
          return findCtrl(this.columnsRowCtrl);
        }
        if (this.groupsRowCtrls.length === 0) {
          return;
        }
        for (let i2 = 0; i2 < this.groupsRowCtrls.length; i2++) {
          const ctrl = findCtrl(this.groupsRowCtrls[i2]);
          if (ctrl) {
            return ctrl;
          }
        }
      }
      getHtmlElementForColumnHeader(column2) {
        return this.getHeaderCtrlForColumn(column2)?.eGui ?? null;
      }
      getRowType(rowIndex) {
        return this.getAllCtrls()[rowIndex]?.type;
      }
      focusHeader(rowIndex, column2, event) {
        const allCtrls = this.getAllCtrls();
        const ctrl = allCtrls[rowIndex];
        if (!ctrl) {
          return false;
        }
        return ctrl.focusHeader(column2, event);
      }
      getGroupRowCount() {
        return this.groupsRowCtrls.length;
      }
      getGroupRowCtrlAtIndex(index) {
        return this.groupsRowCtrls[index];
      }
      getRowCount() {
        return this.groupsRowCtrls.length + (this.columnsRowCtrl ? 1 : 0) + (this.filtersRowCtrl ? 1 : 0);
      }
      setHorizontalScroll(offset2) {
        this.comp.setViewportScrollLeft(offset2);
      }
      onScrollCallback(fn2) {
        this.addManagedElementListeners(this.eViewport, { scroll: fn2 });
      }
      destroy() {
        this.filtersRowCtrl = this.destroyBean(this.filtersRowCtrl);
        this.columnsRowCtrl = this.destroyBean(this.columnsRowCtrl);
        this.groupsRowCtrls = this.destroyBeans(this.groupsRowCtrls);
        super.destroy();
      }
      setupDragAndDrop(colMoves, dropContainer) {
        const bodyDropTarget = colMoves?.createBodyDropTarget(this.pinned, dropContainer);
        if (bodyDropTarget) {
          this.createManagedBean(bodyDropTarget);
        }
      }
      restoreFocusOnHeader(focusSvc, position) {
        if (!position) {
          return;
        }
        const { column: column2 } = position;
        if (column2.getPinned() != this.pinned) {
          return;
        }
        focusSvc.focusHeaderPosition({ headerPosition: position, scroll: false });
      }
      setupCenterWidth() {
        if (this.pinned != null) {
          return;
        }
        this.createManagedBean(new CenterWidthFeature((width) => this.comp.setCenterWidth(`${width}px`), true));
      }
    };
    var MenuService = class extends BeanStub {
      constructor() {
        super(...arguments);
        this.beanName = "menuSvc";
      }
      postConstruct() {
        const { enterpriseMenuFactory, filterMenuFactory } = this.beans;
        this.activeMenuFactory = enterpriseMenuFactory ?? filterMenuFactory;
      }
      showColumnMenu(params) {
        this.showColumnMenuCommon(this.activeMenuFactory, params, "columnMenu");
      }
      showFilterMenu(params) {
        this.showColumnMenuCommon(getFilterMenuFactory(this.beans), params, params.containerType, true);
      }
      showHeaderContextMenu(column2, mouseEvent, touchEvent) {
        this.activeMenuFactory?.showMenuAfterContextMenuEvent(column2, mouseEvent, touchEvent);
      }
      hidePopupMenu() {
        this.beans.contextMenuSvc?.hideActiveMenu();
        this.activeMenuFactory?.hideActiveMenu();
      }
      hideFilterMenu() {
        getFilterMenuFactory(this.beans)?.hideActiveMenu();
      }
      isColumnMenuInHeaderEnabled(column2) {
        const { suppressHeaderMenuButton } = column2.getColDef();
        return !suppressHeaderMenuButton && !!this.activeMenuFactory?.isMenuEnabled(column2) && (_isLegacyMenuEnabled(this.gos) || !!this.beans.enterpriseMenuFactory);
      }
      isFilterMenuInHeaderEnabled(column2) {
        return !column2.getColDef().suppressHeaderFilterButton && !!this.beans.filterManager?.isFilterAllowed(column2);
      }
      isHeaderContextMenuEnabled(column2) {
        const colDef = column2 && isColumn(column2) ? column2.getColDef() : column2?.getColGroupDef();
        return !colDef?.suppressHeaderContextMenu && this.gos.get("columnMenu") === "new";
      }
      isHeaderMenuButtonAlwaysShowEnabled() {
        return this.isSuppressMenuHide();
      }
      isHeaderMenuButtonEnabled() {
        const menuHides = !this.isSuppressMenuHide();
        const onIpadAndMenuHides = _isIOSUserAgent() && menuHides;
        return !onIpadAndMenuHides;
      }
      isHeaderFilterButtonEnabled(column2) {
        return this.isFilterMenuInHeaderEnabled(column2) && !_isLegacyMenuEnabled(this.gos) && !this.isFloatingFilterButtonDisplayed(column2);
      }
      isFilterMenuItemEnabled(column2) {
        return !!this.beans.filterManager?.isFilterAllowed(column2) && !_isLegacyMenuEnabled(this.gos) && !this.isFilterMenuInHeaderEnabled(column2) && !this.isFloatingFilterButtonDisplayed(column2);
      }
      isFloatingFilterButtonEnabled(column2) {
        return !column2.getColDef().suppressFloatingFilterButton;
      }
      isFloatingFilterButtonDisplayed(column2) {
        return !!column2.getColDef().floatingFilter && this.isFloatingFilterButtonEnabled(column2);
      }
      isSuppressMenuHide() {
        const gos = this.gos;
        const suppressMenuHide = gos.get("suppressMenuHide");
        if (_isLegacyMenuEnabled(gos)) {
          return gos.exists("suppressMenuHide") ? suppressMenuHide : false;
        }
        return suppressMenuHide;
      }
      showColumnMenuCommon(menuFactory, params, containerType, filtersOnly) {
        const { positionBy, onClosedCallback } = params;
        const column2 = params.column;
        if (positionBy === "button") {
          const { buttonElement } = params;
          menuFactory?.showMenuAfterButtonClick(column2, buttonElement, containerType, onClosedCallback, filtersOnly);
        } else if (positionBy === "mouse") {
          const { mouseEvent } = params;
          menuFactory?.showMenuAfterMouseEvent(column2, mouseEvent, containerType, onClosedCallback, filtersOnly);
        } else if (column2) {
          const beans = this.beans;
          const ctrlsSvc = beans.ctrlsSvc;
          ctrlsSvc.getScrollFeature().ensureColumnVisible(column2, "auto");
          _requestAnimationFrame(beans, () => {
            const headerCellCtrl = ctrlsSvc.getHeaderRowContainerCtrl(column2.getPinned())?.getHeaderCtrlForColumn(column2);
            if (headerCellCtrl) {
              menuFactory?.showMenuAfterButtonClick(
                column2,
                headerCellCtrl.getAnchorElementForMenu(filtersOnly),
                containerType,
                onClosedCallback,
                filtersOnly
              );
            }
          });
        }
      }
    };
    function _setColMenuVisible(column2, visible2, source2) {
      if (column2.menuVisible !== visible2) {
        column2.menuVisible = visible2;
        column2.dispatchColEvent("menuVisibleChanged", source2);
      }
    }
    function getFilterMenuFactory(beans) {
      const { enterpriseMenuFactory, filterMenuFactory, gos } = beans;
      return enterpriseMenuFactory && _isLegacyMenuEnabled(gos) ? enterpriseMenuFactory : filterMenuFactory;
    }
    var AgAbstractCellEditor = class extends AgPopupComponent {
      constructor() {
        super(...arguments);
        this.errorMessages = null;
      }
      init(params) {
        this.params = params;
        this.initialiseEditor(params);
        this.eEditor.onValueChange(() => params.validate());
      }
      destroy() {
        this.errorMessages = null;
      }
    };
    var OverlayComponent = class extends Component {
      constructor() {
        super();
      }
    };
    var LoadingOverlayElement = {
      tag: "span",
      cls: "ag-overlay-loading-center"
    };
    var LoadingOverlayComponent2 = class extends OverlayComponent {
      init() {
        const customTemplate = _makeNull(this.gos.get("overlayLoadingTemplate")?.trim());
        this.setTemplate(customTemplate ?? LoadingOverlayElement);
        if (!customTemplate) {
          const localeTextFunc = this.getLocaleTextFunc();
          const loadingText = localeTextFunc("loadingOoo", "Loading...");
          this.getGui().textContent = loadingText;
          this.beans.ariaAnnounce.announceValue(loadingText, "overlay");
        }
      }
    };
    var NoRowsOverlayElement = { tag: "span", cls: "ag-overlay-no-rows-center" };
    var NoRowsOverlayComponent2 = class extends OverlayComponent {
      init() {
        const customTemplate = _makeNull(this.gos.get("overlayNoRowsTemplate")?.trim());
        this.setTemplate(customTemplate ?? NoRowsOverlayElement);
        if (!customTemplate) {
          const localeTextFunc = this.getLocaleTextFunc();
          const noRowsText = localeTextFunc("noRowsToShow", "No Rows To Show");
          this.getGui().textContent = noRowsText;
          this.beans.ariaAnnounce.announceValue(noRowsText, "overlay");
        }
      }
    };
    function _createIcon(iconName, beans, column2) {
      const iconContents = _createIconNoSpan(iconName, beans, column2);
      if (iconContents) {
        const { className: className2 } = iconContents;
        if (typeof className2 === "string" && className2.includes("ag-icon") || typeof className2 === "object" && className2["ag-icon"]) {
          return iconContents;
        }
      }
      const eResult = _createElement({ tag: "span" });
      eResult.appendChild(iconContents);
      return eResult;
    }
    function _createIconNoSpan(iconName, beans, column2) {
      let userProvidedIcon = null;
      if (iconName === "smallDown") {
        _warn(262);
      } else if (iconName === "smallLeft") {
        _warn(263);
      } else if (iconName === "smallRight") {
        _warn(264);
      }
      const icons = column2?.getColDef().icons;
      if (icons) {
        userProvidedIcon = icons[iconName];
      }
      if (beans.gos && !userProvidedIcon) {
        const optionsIcons = beans.gos.get("icons");
        if (optionsIcons) {
          userProvidedIcon = optionsIcons[iconName];
        }
      }
      if (userProvidedIcon) {
        let rendererResult;
        if (typeof userProvidedIcon === "function") {
          rendererResult = userProvidedIcon();
        } else if (typeof userProvidedIcon === "string") {
          rendererResult = userProvidedIcon;
        } else {
          _warn(38, { iconName });
          return void 0;
        }
        if (typeof rendererResult === "string") {
          return _loadTemplate(rendererResult);
        }
        if (_isNodeOrElement(rendererResult)) {
          return rendererResult;
        }
        _warn(133, { iconName });
        return void 0;
      } else {
        const iconValue = beans.registry.getIcon(iconName);
        if (!iconValue) {
          beans.validation?.validateIcon(iconName);
        }
        return _createElement({
          tag: "span",
          cls: `ag-icon ag-icon-${iconValue ?? iconName}`,
          role: "presentation",
          attrs: { unselectable: "on" }
        });
      }
    }
    var dragAndDropImageComponentCSS = (
      /*css*/
      `.ag-dnd-ghost{align-items:center;background-color:var(--ag-drag-and-drop-image-background-color);border:var(--ag-drag-and-drop-image-border);border-radius:var(--ag-border-radius);box-shadow:var(--ag-drag-and-drop-image-shadow);color:var(--ag-text-color);cursor:move;display:flex;font-weight:500;gap:var(--ag-cell-widget-spacing);height:var(--ag-header-height);overflow:hidden;padding-left:var(--ag-cell-horizontal-padding);padding-right:var(--ag-cell-horizontal-padding);text-overflow:ellipsis;transform:translateY(calc(var(--ag-spacing)*2));white-space:nowrap}.ag-dnd-ghost-not-allowed{border:var(--ag-drag-and-drop-image-not-allowed-border)}`
    );
    var DragAndDropElement = {
      tag: "div",
      children: [
        {
          tag: "div",
          ref: "eGhost",
          cls: "ag-dnd-ghost ag-unselectable",
          children: [
            { tag: "span", ref: "eIcon", cls: "ag-dnd-ghost-icon ag-shake-left-to-right" },
            { tag: "div", ref: "eLabel", cls: "ag-dnd-ghost-label" }
          ]
        }
      ]
    };
    var DragAndDropImageComponent2 = class extends Component {
      constructor() {
        super();
        this.dragSource = null;
        this.eIcon = RefPlaceholder;
        this.eLabel = RefPlaceholder;
        this.eGhost = RefPlaceholder;
        this.registerCSS(dragAndDropImageComponentCSS);
      }
      postConstruct() {
        const create2 = (iconName) => _createIcon(iconName, this.beans, null);
        this.dropIconMap = {
          pinned: create2("columnMovePin"),
          hide: create2("columnMoveHide"),
          move: create2("columnMoveMove"),
          left: create2("columnMoveLeft"),
          right: create2("columnMoveRight"),
          group: create2("columnMoveGroup"),
          aggregate: create2("columnMoveValue"),
          pivot: create2("columnMovePivot"),
          notAllowed: create2("dropNotAllowed")
        };
      }
      init(params) {
        this.dragSource = params.dragSource;
        this.setTemplate(DragAndDropElement);
        this.beans.environment.applyThemeClasses(this.eGhost);
      }
      destroy() {
        this.dragSource = null;
        super.destroy();
      }
      setIcon(iconName, shake) {
        const { eGhost, eIcon, dragSource, dropIconMap, gos } = this;
        _clearElement(eIcon);
        let eIconChild = null;
        if (!iconName) {
          iconName = dragSource?.getDefaultIconName ? dragSource.getDefaultIconName() : "notAllowed";
        }
        eIconChild = dropIconMap[iconName];
        eGhost.classList.toggle("ag-dnd-ghost-not-allowed", iconName === "notAllowed");
        eIcon.classList.toggle("ag-shake-left-to-right", shake);
        if (eIconChild === dropIconMap["hide"] && gos.get("suppressDragLeaveHidesColumns")) {
          return;
        }
        if (eIconChild) {
          eIcon.appendChild(eIconChild);
        }
      }
      setLabel(label2) {
        this.eLabel.textContent = label2;
      }
    };
    var checkboxCellRendererCSS = (
      /*css*/
      `.ag-checkbox-cell{height:100%}`
    );
    var CheckboxCellRendererElement = {
      tag: "div",
      cls: "ag-cell-wrapper ag-checkbox-cell",
      role: "presentation",
      children: [
        {
          tag: "ag-checkbox",
          ref: "eCheckbox",
          role: "presentation"
        }
      ]
    };
    var CheckboxCellRenderer = class extends Component {
      constructor() {
        super(CheckboxCellRendererElement, [AgCheckboxSelector]);
        this.eCheckbox = RefPlaceholder;
        this.registerCSS(checkboxCellRendererCSS);
      }
      init(params) {
        this.refresh(params);
        const { eCheckbox, beans } = this;
        const inputEl = eCheckbox.getInputElement();
        inputEl.setAttribute("tabindex", "-1");
        _setAriaLive(inputEl, "polite");
        this.addManagedListeners(inputEl, {
          click: (event) => {
            _stopPropagationForAgGrid(event);
            if (eCheckbox.isDisabled()) {
              return;
            }
            const isSelected = eCheckbox.getValue();
            this.onCheckboxChanged(isSelected);
          },
          dblclick: (event) => {
            _stopPropagationForAgGrid(event);
          }
        });
        this.addManagedElementListeners(params.eGridCell, {
          keydown: (event) => {
            if (event.key === KeyCode.SPACE && !eCheckbox.isDisabled()) {
              if (params.eGridCell === _getActiveDomElement(beans)) {
                eCheckbox.toggle();
              }
              const isSelected = eCheckbox.getValue();
              this.onCheckboxChanged(isSelected);
              event.preventDefault();
            }
          }
        });
      }
      refresh(params) {
        this.params = params;
        this.updateCheckbox(params);
        return true;
      }
      updateCheckbox(params) {
        let isSelected;
        let displayed = true;
        const { value: value2, column: column2, node: node2 } = params;
        if (node2.group && column2) {
          if (typeof value2 === "boolean") {
            isSelected = value2;
          } else {
            const colId = column2.getColId();
            if (colId.startsWith(GROUP_AUTO_COLUMN_ID)) {
              isSelected = value2 == null || value2 === "" ? void 0 : value2 === "true";
            } else if (node2.aggData && node2.aggData[colId] !== void 0) {
              isSelected = value2 ?? void 0;
            } else if (node2.sourceRowIndex >= 0) {
              isSelected = value2 ?? void 0;
            } else {
              displayed = false;
            }
          }
        } else {
          isSelected = value2 ?? void 0;
        }
        const { eCheckbox } = this;
        if (!displayed) {
          eCheckbox.setDisplayed(false);
          return;
        }
        eCheckbox.setValue(isSelected);
        const disabled2 = params.disabled ?? !column2?.isCellEditable(node2);
        eCheckbox.setDisabled(disabled2);
        const translate = this.getLocaleTextFunc();
        const stateName = _getAriaCheckboxStateName(translate, isSelected);
        const ariaLabel = disabled2 ? stateName : `${translate("ariaToggleCellValue", "Press SPACE to toggle cell value")} (${stateName})`;
        eCheckbox.setInputAriaLabel(ariaLabel);
      }
      onCheckboxChanged(isSelected) {
        const { params } = this;
        const { column: column2, node: node2, value: value2 } = params;
        this.beans?.editSvc?.setEditingCells(
          [
            {
              column: column2,
              colId: column2.getColId(),
              rowIndex: node2.rowIndex,
              rowPinned: node2.rowPinned,
              state: "changed",
              oldValue: value2,
              newValue: value2
            }
          ],
          { update: true, forceRefreshOfEditCellsOnly: true }
        );
        const valueChanged = node2.setDataValue(column2, isSelected, "renderer");
        this.beans.editSvc?.stopEditing(
          {
            rowNode: node2,
            column: column2
          },
          { source: this.beans.editSvc?.isBatchEditing() ? "ui" : "api" }
        );
        if (!valueChanged) {
          this.updateCheckbox(params);
        }
      }
    };
    var PinnedRows = class {
      constructor(beans, floating) {
        this.beans = beans;
        this.floating = floating;
        this.all = /* @__PURE__ */ new Set();
        this.visible = /* @__PURE__ */ new Set();
        this.order = [];
        this.queued = /* @__PURE__ */ new Set();
      }
      size() {
        return this.visible.size;
      }
      add(node2) {
        const { all: all2, visible: visible2, order: order2 } = this;
        if (all2.has(node2)) {
          return;
        }
        all2.add(node2);
        visible2.add(node2);
        order2.push(node2);
        this.sort();
      }
      delete(item2) {
        this.all.delete(item2);
        this.visible.delete(item2);
        this.queued.delete(item2.id);
        _removeFromArray(this.order, item2);
      }
      has(item2) {
        return this.visible.has(item2);
      }
      forEach(fn2) {
        this.order.forEach(fn2);
      }
      getByIndex(i2) {
        return this.order[i2];
      }
      getById(id) {
        for (const node2 of this.visible) {
          if (node2.id == id) {
            return node2;
          }
        }
      }
      clear() {
        const { all: all2, visible: visible2, order: order2, queued } = this;
        all2.clear();
        queued.clear();
        visible2.clear();
        order2.length = 0;
      }
      sort() {
        const { sortSvc, rowNodeSorter, gos } = this.beans;
        const sortOptions2 = sortSvc?.getSortOptions() ?? [];
        const grandTotalNode = _removeGrandTotalRow(this.order);
        this.order.sort((a, b) => (a.pinnedSibling?.rowIndex ?? 0) - (b.pinnedSibling?.rowIndex ?? 0));
        this.order = rowNodeSorter?.doFullSort(this.order, sortOptions2) ?? this.order;
        if (!grandTotalNode) {
          return;
        }
        const grandTotalRow = _getGrandTotalRow(gos);
        if (grandTotalRow === "bottom" || grandTotalRow === "pinnedBottom") {
          this.order.push(grandTotalNode);
        } else {
          this.order.unshift(grandTotalNode);
        }
      }
      hide(shouldHide) {
        const { all: all2, visible: visible2 } = this;
        all2.forEach((node2) => shouldHide(node2) ? visible2.delete(node2) : visible2.add(node2));
        this.order = Array.from(visible2);
        this.sort();
      }
      queue(id) {
        this.queued.add(id);
      }
      unqueue(id) {
        this.queued.delete(id);
      }
      forEachQueued(fn2) {
        this.queued.forEach(fn2);
      }
    };
    function _isDisplayedAfterFilterCSRM(node2) {
      if (node2.level === -1) {
        return true;
      }
      const parent = node2.parent;
      if (parent?.childrenAfterSort?.some((child) => child == node2)) {
        return _isDisplayedAfterFilterCSRM(parent);
      }
      return false;
    }
    function _shouldHidePinnedRows(beans, node2) {
      const { gos, rowModel, filterManager } = beans;
      if (_isServerSideRowModel(gos)) {
        return !rowModel.getRowNode(node2.id);
      }
      if (filterManager?.isAnyFilterPresent()) {
        return !_isDisplayedAfterFilterCSRM(node2);
      }
      if (gos.get("pivotMode")) {
        return !node2.group;
      }
      return false;
    }
    function _isNodeGrandTotal(node2) {
      return !!node2.footer && node2.level === -1;
    }
    function _isPinnedNodeGrandTotal(node2) {
      return !!node2.pinnedSibling && _isNodeGrandTotal(node2.pinnedSibling);
    }
    function _removeGrandTotalRow(order2) {
      const index = order2.findIndex(_isPinnedNodeGrandTotal);
      if (index > -1) {
        return order2.splice(index, 1)?.[0];
      }
    }
    var ManualPinnedRowModel = class extends BeanStub {
      postConstruct() {
        const { gos, beans } = this;
        this.top = new PinnedRows(beans, "top");
        this.bottom = new PinnedRows(beans, "bottom");
        const shouldHide = (node2) => _shouldHidePinnedRows(beans, node2.pinnedSibling);
        const runIsRowPinned = () => {
          const isRowPinned = gos.get("isRowPinned");
          if (isRowPinned && gos.get("enableRowPinning")) {
            beans.rowModel.forEachNode((node2) => this.pinRow(node2, isRowPinned(node2)), true);
          }
          this.refreshRowPositions();
          this.dispatchRowPinnedEvents();
        };
        this.addManagedEventListeners({
          gridStylesChanged: this.onGridStylesChanges.bind(this),
          modelUpdated: ({ keepRenderedRows }) => {
            this.tryToEmptyQueues();
            this.pinGrandTotalRow();
            this.forContainers((container2) => container2.hide(shouldHide));
            const positionsChanged = this.refreshRowPositions();
            if (!keepRenderedRows || positionsChanged) {
              this.dispatchRowPinnedEvents();
            }
          },
          columnRowGroupChanged: () => {
            this.forContainers(removeGroupRows);
            this.refreshRowPositions();
          },
          rowNodeDataChanged: ({ node: node2 }) => {
            const isRowPinnable = gos.get("isRowPinnable");
            const pinnable = isRowPinnable?.(node2) ?? true;
            if (!pinnable) {
              this.pinRow(node2, null);
            }
          },
          firstDataRendered: runIsRowPinned
        });
        this.addManagedPropertyListener("pivotMode", () => {
          this.forContainers((container2) => container2.hide(shouldHide));
          this.dispatchRowPinnedEvents();
        });
        this.addManagedPropertyListener("grandTotalRow", ({ currentValue }) => {
          this._grandTotalPinned = currentValue === "pinnedBottom" ? "bottom" : currentValue === "pinnedTop" ? "top" : null;
        });
        this.addManagedPropertyListener("isRowPinned", runIsRowPinned);
      }
      destroy() {
        this.reset(false);
        super.destroy();
      }
      reset(dispatch = true) {
        this.forContainers((container2) => {
          const nodesToUnpin = [];
          container2.forEach((n) => nodesToUnpin.push(n));
          nodesToUnpin.forEach((n) => this.pinRow(n, null));
          container2.clear();
        });
        if (dispatch) {
          this.dispatchRowPinnedEvents();
        }
      }
      pinRow(rowNode, float, column2) {
        if (rowNode.footer && rowNode.level > -1) {
          return;
        }
        if (rowNode.footer && rowNode.level === -1) {
          this._grandTotalPinned = float;
          refreshCSRM(this.beans);
          return;
        }
        const currentFloat = rowNode.rowPinned ?? rowNode.pinnedSibling?.rowPinned;
        const switching = currentFloat != null && float != null && float != currentFloat;
        if (switching) {
          const pinned = rowNode.rowPinned ? rowNode : rowNode.pinnedSibling;
          const source2 = rowNode.rowPinned ? rowNode.pinnedSibling : rowNode;
          this.pinRow(pinned, null, column2);
          this.pinRow(source2, float, column2);
          return;
        }
        const spannedRows = column2 && getSpannedRows(this.beans, rowNode, column2);
        if (spannedRows) {
          spannedRows.forEach((node2) => this.pinRow(node2, float));
          return;
        }
        if (float == null) {
          const node2 = rowNode.rowPinned ? rowNode : rowNode.pinnedSibling;
          const found = this.findPinnedRowNode(node2);
          if (!found) {
            return;
          }
          found.delete(node2);
          const source2 = node2.pinnedSibling;
          _destroyRowNodeSibling(node2);
          this.refreshRowPositions(float);
          this.dispatchRowPinnedEvents(source2);
        } else {
          const sibling = _createPinnedSibling(this.beans, rowNode, float);
          const container2 = this.getContainer(float);
          container2.add(sibling);
          if (_shouldHidePinnedRows(this.beans, rowNode)) {
            container2.hide((node2) => _shouldHidePinnedRows(this.beans, node2.pinnedSibling));
          }
          this.refreshRowPositions(float);
          this.dispatchRowPinnedEvents(rowNode);
        }
      }
      isManual() {
        return true;
      }
      isEmpty(floating) {
        return this.getContainer(floating).size() === 0;
      }
      isRowsToRender(floating) {
        return !this.isEmpty(floating);
      }
      ensureRowHeightsValid() {
        let anyChange = false;
        let rowTop = 0;
        const updateRowHeight = (rowNode) => {
          if (rowNode.rowHeightEstimated) {
            const rowHeight = _getRowHeightForNode(this.beans, rowNode);
            rowNode.setRowTop(rowTop);
            rowNode.setRowHeight(rowHeight.height);
            rowTop += rowHeight.height;
            anyChange = true;
          }
        };
        this.bottom.forEach(updateRowHeight);
        rowTop = 0;
        this.top.forEach(updateRowHeight);
        this.eventSvc.dispatchEvent({
          type: "pinnedHeightChanged"
        });
        return anyChange;
      }
      getPinnedTopTotalHeight() {
        return getTotalHeight(this.top);
      }
      getPinnedBottomTotalHeight() {
        return getTotalHeight(this.bottom);
      }
      getPinnedTopRowCount() {
        return this.top.size();
      }
      getPinnedBottomRowCount() {
        return this.bottom.size();
      }
      getPinnedTopRow(index) {
        return this.top.getByIndex(index);
      }
      getPinnedBottomRow(index) {
        return this.bottom.getByIndex(index);
      }
      getPinnedRowById(id, floating) {
        return this.getContainer(floating).getById(id);
      }
      forEachPinnedRow(floating, callback) {
        this.getContainer(floating).forEach(callback);
      }
      getPinnedState() {
        const buildState = (floating) => {
          const list2 = [];
          this.forEachPinnedRow(floating, (node2) => list2.push(node2.pinnedSibling.id));
          return list2;
        };
        return {
          top: buildState("top"),
          bottom: buildState("bottom")
        };
      }
      setPinnedState(state) {
        this.forContainers((pinned, floating) => {
          for (const id of state[floating]) {
            const node2 = this.beans.rowModel.getRowNode(id);
            if (node2) {
              this.pinRow(node2, floating);
            } else {
              pinned.queue(id);
            }
          }
        });
      }
      getGrandTotalPinned() {
        return this._grandTotalPinned;
      }
      setGrandTotalPinned(value2) {
        this._grandTotalPinned = value2;
      }
      tryToEmptyQueues() {
        this.forContainers((pinned, container2) => {
          const nodesToPin = /* @__PURE__ */ new Set();
          pinned.forEachQueued((id) => {
            const node2 = this.beans.rowModel.getRowNode(id);
            if (node2) {
              nodesToPin.add(node2);
            }
          });
          for (const node2 of nodesToPin) {
            pinned.unqueue(node2.id);
            this.pinRow(node2, container2);
          }
        });
      }
      pinGrandTotalRow() {
        const { gos, beans, _grandTotalPinned: float } = this;
        const rowModel = beans.rowModel;
        if (!_isClientSideRowModel(gos)) {
          return;
        }
        const sibling = rowModel.rootNode?.sibling;
        if (!sibling) {
          return;
        }
        const pinnedSibling = sibling.pinnedSibling;
        const container2 = pinnedSibling && this.findPinnedRowNode(pinnedSibling);
        if (!float) {
          if (!container2) {
            return;
          }
          container2.delete(pinnedSibling);
          _destroyRowNodeSibling(pinnedSibling);
        } else {
          if (container2 && container2.floating !== float) {
            container2.delete(pinnedSibling);
            _destroyRowNodeSibling(pinnedSibling);
          }
          if (!container2 || container2.floating !== float) {
            const newPinnedSibling = _createPinnedSibling(beans, sibling, float);
            this.getContainer(float).add(newPinnedSibling);
          }
        }
      }
      onGridStylesChanges(e) {
        if (e.rowHeightChanged) {
          this.forContainers(
            (container2) => container2.forEach((rowNode) => rowNode.setRowHeight(rowNode.rowHeight, true))
          );
        }
      }
      getContainer(floating) {
        return floating === "top" ? this.top : this.bottom;
      }
      findPinnedRowNode(node2) {
        if (this.top.has(node2)) {
          return this.top;
        }
        if (this.bottom.has(node2)) {
          return this.bottom;
        }
      }
      refreshRowPositions(floating) {
        const refreshAll = (pinned) => refreshRowPositions(this.beans, pinned);
        if (floating) {
          return refreshAll(this.getContainer(floating));
        }
        let changed = false;
        this.forContainers((container2) => {
          const updated = refreshAll(container2);
          changed || (changed = updated);
        });
        return changed;
      }
      forContainers(fn2) {
        fn2(this.top, "top");
        fn2(this.bottom, "bottom");
      }
      dispatchRowPinnedEvents(node2) {
        this.eventSvc.dispatchEvent({ type: "pinnedRowsChanged" });
        node2?.dispatchRowEvent("rowPinned");
      }
    };
    function refreshRowPositions(beans, container2) {
      let rowTop = 0;
      let changed = false;
      container2.forEach((node2, index) => {
        changed || (changed = node2.rowTop !== rowTop);
        node2.setRowTop(rowTop);
        if (node2.rowHeightEstimated || node2.rowHeight == null) {
          const rowHeight = _getRowHeightForNode(beans, node2).height;
          changed || (changed = node2.rowHeight !== rowHeight);
          node2.setRowHeight(rowHeight);
        }
        node2.setRowIndex(index);
        rowTop += node2.rowHeight;
      });
      return changed;
    }
    function _createPinnedSibling(beans, rowNode, floating) {
      if (rowNode.pinnedSibling) {
        return rowNode.pinnedSibling;
      }
      const sibling = _createRowNodeSibling(rowNode, beans);
      sibling.setRowTop(null);
      sibling.setRowIndex(null);
      sibling.rowPinned = floating;
      const prefix = floating === "top" ? ROW_ID_PREFIX_TOP_PINNED : ROW_ID_PREFIX_BOTTOM_PINNED;
      sibling.id = `${prefix}${floating}-${rowNode.id}`;
      sibling.pinnedSibling = rowNode;
      rowNode.pinnedSibling = sibling;
      return sibling;
    }
    function _destroyRowNodeSibling(rowNode) {
      if (!rowNode.pinnedSibling) {
        return;
      }
      rowNode.rowPinned = null;
      rowNode.setRowTop(null);
      rowNode.setRowIndex(null);
      const mainNode = rowNode.pinnedSibling;
      rowNode.pinnedSibling = void 0;
      if (mainNode) {
        mainNode.pinnedSibling = void 0;
        mainNode.rowPinned = null;
      }
    }
    function removeGroupRows(set2) {
      const rowsToRemove = /* @__PURE__ */ new Set();
      set2.forEach((node2) => {
        if (node2.group) {
          rowsToRemove.add(node2);
        }
      });
      rowsToRemove.forEach((node2) => set2.delete(node2));
    }
    function getSpannedRows(beans, rowNode, column2) {
      const { rowSpanSvc } = beans;
      const isCellSpanning = (column2 && rowSpanSvc?.isCellSpanning(column2, rowNode)) ?? false;
      if (column2 && isCellSpanning) {
        return rowSpanSvc?.getCellSpan(column2, rowNode)?.spannedNodes;
      }
    }
    function getTotalHeight(container2) {
      const size = container2.size();
      if (size === 0) {
        return 0;
      }
      const node2 = container2.getByIndex(size - 1);
      if (node2 === void 0) {
        return 0;
      }
      return node2.rowTop + node2.rowHeight;
    }
    function refreshCSRM({ gos, rowModel }) {
      if (_isClientSideRowModel(gos)) {
        rowModel.refreshModel({ step: "map" });
      }
    }
    var StaticPinnedRowModel = class extends BeanStub {
      constructor() {
        super(...arguments);
        this.nextId = 0;
        this.pinnedTopRows = { cache: {}, order: [] };
        this.pinnedBottomRows = { cache: {}, order: [] };
      }
      postConstruct() {
        const gos = this.gos;
        this.setPinnedRowData(gos.get("pinnedTopRowData"), "top");
        this.setPinnedRowData(gos.get("pinnedBottomRowData"), "bottom");
        this.addManagedPropertyListener("pinnedTopRowData", (e) => this.setPinnedRowData(e.currentValue, "top"));
        this.addManagedPropertyListener("pinnedBottomRowData", (e) => this.setPinnedRowData(e.currentValue, "bottom"));
        this.addManagedEventListeners({ gridStylesChanged: this.onGridStylesChanges.bind(this) });
      }
      reset() {
      }
      isEmpty(floating) {
        return this.getCache(floating).order.length === 0;
      }
      isRowsToRender(floating) {
        return !this.isEmpty(floating);
      }
      isManual() {
        return false;
      }
      pinRow(_node, _container) {
      }
      onGridStylesChanges(e) {
        if (e.rowHeightChanged) {
          const estimateRowHeight = (rowNode) => {
            rowNode.setRowHeight(rowNode.rowHeight, true);
          };
          forEach(this.pinnedBottomRows, estimateRowHeight);
          forEach(this.pinnedTopRows, estimateRowHeight);
        }
      }
      ensureRowHeightsValid() {
        let anyChange = false;
        let rowTop = 0;
        const updateRowHeight = (rowNode) => {
          if (rowNode.rowHeightEstimated) {
            const rowHeight = _getRowHeightForNode(this.beans, rowNode);
            rowNode.setRowTop(rowTop);
            rowNode.setRowHeight(rowHeight.height);
            rowTop += rowHeight.height;
            anyChange = true;
          }
        };
        forEach(this.pinnedBottomRows, updateRowHeight);
        rowTop = 0;
        forEach(this.pinnedTopRows, updateRowHeight);
        this.eventSvc.dispatchEvent({
          type: "pinnedHeightChanged"
        });
        return anyChange;
      }
      setPinnedRowData(rowData, floating) {
        this.updateNodesFromRowData(rowData, floating);
        this.eventSvc.dispatchEvent({
          type: "pinnedRowDataChanged"
        });
      }
      /**
       * Updates existing RowNode instances and creates new ones if necessary
       *
       * Setting data as `undefined` will clear row nodes
       */
      updateNodesFromRowData(allData, floating) {
        const nodes = this.getCache(floating);
        if (allData === void 0) {
          nodes.order.length = 0;
          nodes.cache = {};
          return;
        }
        const getRowId = _getRowIdCallback(this.gos);
        const idPrefix = floating === "top" ? ROW_ID_PREFIX_TOP_PINNED : ROW_ID_PREFIX_BOTTOM_PINNED;
        const nodesToRemove = new Set(nodes.order);
        const newOrder = [];
        const dataIds = /* @__PURE__ */ new Set();
        let nextRowTop = 0;
        let i2 = -1;
        for (const data of allData) {
          const id = getRowId?.({ data, level: 0, rowPinned: floating }) ?? idPrefix + this.nextId++;
          if (dataIds.has(id)) {
            _warn(96, { id, data });
            continue;
          }
          i2++;
          dataIds.add(id);
          newOrder.push(id);
          const existingNode = getById(nodes, id);
          if (existingNode !== void 0) {
            if (existingNode.data !== data) {
              existingNode.updateData(data);
            }
            nextRowTop += this.setRowTopAndRowIndex(existingNode, nextRowTop, i2);
            nodesToRemove.delete(id);
          } else {
            const rowNode = new RowNode(this.beans);
            rowNode.id = id;
            rowNode.data = data;
            rowNode.rowPinned = floating;
            nextRowTop += this.setRowTopAndRowIndex(rowNode, nextRowTop, i2);
            nodes.cache[id] = rowNode;
            nodes.order.push(id);
          }
        }
        for (const id of nodesToRemove) {
          getById(nodes, id)?.clearRowTopAndRowIndex();
          delete nodes.cache[id];
        }
        nodes.order = newOrder;
      }
      setRowTopAndRowIndex(rowNode, rowTop, rowIndex) {
        rowNode.setRowTop(rowTop);
        rowNode.setRowHeight(_getRowHeightForNode(this.beans, rowNode).height);
        rowNode.setRowIndex(rowIndex);
        return rowNode.rowHeight;
      }
      getPinnedTopTotalHeight() {
        return getTotalHeight2(this.pinnedTopRows);
      }
      getPinnedBottomTotalHeight() {
        return getTotalHeight2(this.pinnedBottomRows);
      }
      getPinnedTopRowCount() {
        return getSize(this.pinnedTopRows);
      }
      getPinnedBottomRowCount() {
        return getSize(this.pinnedBottomRows);
      }
      getPinnedTopRow(index) {
        return getByIndex(this.pinnedTopRows, index);
      }
      getPinnedBottomRow(index) {
        return getByIndex(this.pinnedBottomRows, index);
      }
      getPinnedRowById(id, floating) {
        return getById(this.getCache(floating), id);
      }
      forEachPinnedRow(floating, callback) {
        return forEach(this.getCache(floating), callback);
      }
      getCache(floating) {
        return floating === "top" ? this.pinnedTopRows : this.pinnedBottomRows;
      }
      getPinnedState() {
        return { top: [], bottom: [] };
      }
      setPinnedState() {
      }
      getGrandTotalPinned() {
        return;
      }
      setGrandTotalPinned() {
      }
    };
    function getTotalHeight2(rowNodes) {
      const size = getSize(rowNodes);
      if (size === 0) {
        return 0;
      }
      const node2 = getByIndex(rowNodes, size - 1);
      if (node2 === void 0) {
        return 0;
      }
      return node2.rowTop + node2.rowHeight;
    }
    function getById(cache, id) {
      return cache.cache[id];
    }
    function getByIndex(cache, i2) {
      return getById(cache, cache.order[i2]);
    }
    function forEach(cache, callback) {
      cache.order.forEach((id, index) => {
        const node2 = getById(cache, id);
        node2 && callback(node2, index);
      });
    }
    function getSize(cache) {
      return cache.order.length;
    }
    var PinnedRowModel = class extends BeanStub {
      constructor() {
        super(...arguments);
        this.beanName = "pinnedRowModel";
      }
      postConstruct() {
        const { gos } = this;
        const initialiseRowModel = () => {
          const enableRowPinning = gos.get("enableRowPinning");
          const grandTotalRow = _getGrandTotalRow(gos);
          const isGrandTotalRowPinned = grandTotalRow === "pinnedBottom" || grandTotalRow === "pinnedTop";
          const useManualPinnedRowModel = !!enableRowPinning || isGrandTotalRowPinned;
          const shouldDestroy = useManualPinnedRowModel ? this.inner instanceof StaticPinnedRowModel : this.inner instanceof ManualPinnedRowModel;
          if (this.inner && shouldDestroy) {
            this.destroyBean(this.inner);
          }
          if (shouldDestroy || !this.inner) {
            this.inner = this.createManagedBean(
              useManualPinnedRowModel ? new ManualPinnedRowModel() : new StaticPinnedRowModel()
            );
          }
        };
        this.addManagedPropertyListeners(["enableRowPinning", "grandTotalRow"], initialiseRowModel);
        initialiseRowModel();
      }
      reset() {
        return this.inner.reset();
      }
      isEmpty(container2) {
        return this.inner.isEmpty(container2);
      }
      isManual() {
        return this.inner.isManual();
      }
      isRowsToRender(container2) {
        return this.inner.isRowsToRender(container2);
      }
      pinRow(node2, container2, column2) {
        return this.inner.pinRow(node2, container2, column2);
      }
      ensureRowHeightsValid() {
        return this.inner.ensureRowHeightsValid();
      }
      getPinnedRowById(id, container2) {
        return this.inner.getPinnedRowById(id, container2);
      }
      getPinnedTopTotalHeight() {
        return this.inner.getPinnedTopTotalHeight();
      }
      getPinnedBottomTotalHeight() {
        return this.inner.getPinnedBottomTotalHeight();
      }
      getPinnedTopRowCount() {
        return this.inner.getPinnedTopRowCount();
      }
      getPinnedBottomRowCount() {
        return this.inner.getPinnedBottomRowCount();
      }
      getPinnedTopRow(index) {
        return this.inner.getPinnedTopRow(index);
      }
      getPinnedBottomRow(index) {
        return this.inner.getPinnedBottomRow(index);
      }
      forEachPinnedRow(container2, callback) {
        return this.inner.forEachPinnedRow(container2, callback);
      }
      getPinnedState() {
        return this.inner.getPinnedState();
      }
      setPinnedState(state) {
        return this.inner.setPinnedState(state);
      }
      setGrandTotalPinned(value2) {
        return this.inner.setGrandTotalPinned(value2);
      }
      getGrandTotalPinned() {
        return this.inner.getGrandTotalPinned();
      }
    };
    function _isManualPinnedRow(rowNode) {
      return !!(rowNode.rowPinned && rowNode.pinnedSibling);
    }
    function _getNodesInRangeForSelection(rowModel, float, start2, end2) {
      const isTop = float === "top";
      if (!start2) {
        return _getNodesInRangeForSelection(
          rowModel,
          float,
          isTop ? rowModel.getPinnedTopRow(0) : rowModel.getPinnedBottomRow(0),
          end2
        );
      }
      if (!end2) {
        const count = isTop ? rowModel.getPinnedTopRowCount() : rowModel.getPinnedBottomRowCount();
        return _getNodesInRangeForSelection(
          rowModel,
          float,
          start2,
          isTop ? rowModel.getPinnedTopRow(count - 1) : rowModel.getPinnedBottomRow(count - 1)
        );
      }
      let started2 = false;
      let finished = false;
      const range2 = [];
      rowModel.forEachPinnedRow(float, (node2) => {
        if (node2 === start2 && !started2) {
          started2 = true;
          range2.push(node2);
          return;
        }
        if (started2 && node2 === end2) {
          finished = true;
          range2.push(node2);
          return;
        }
        if (started2 && !finished) {
          range2.push(node2);
        }
      });
      return range2;
    }
    var CheckboxSelectionComponentElement = {
      tag: "div",
      cls: "ag-selection-checkbox",
      role: "presentation",
      children: [
        {
          tag: "ag-checkbox",
          ref: "eCheckbox",
          role: "presentation"
        }
      ]
    };
    var CheckboxSelectionComponent = class extends Component {
      constructor() {
        super(CheckboxSelectionComponentElement, [AgCheckboxSelector]);
        this.eCheckbox = RefPlaceholder;
      }
      postConstruct() {
        this.eCheckbox.setPassive(true);
      }
      onDataChanged() {
        this.onSelectionChanged();
      }
      onSelectableChanged() {
        this.showOrHideSelect();
      }
      onSelectionChanged() {
        const translate = this.getLocaleTextFunc();
        const { rowNode, eCheckbox } = this;
        const state = rowNode.isSelected();
        const stateName = _getAriaCheckboxStateName(translate, state);
        const [ariaKey, ariaLabel] = rowNode.selectable ? ["ariaRowToggleSelection", "Press Space to toggle row selection"] : ["ariaRowSelectionDisabled", "Row Selection is disabled for this row"];
        const translatedLabel = translate(ariaKey, ariaLabel);
        eCheckbox.setValue(state, true);
        eCheckbox.setInputAriaLabel(`${translatedLabel} (${stateName})`);
      }
      init(params) {
        this.rowNode = params.rowNode;
        this.column = params.column;
        this.overrides = params.overrides;
        this.onSelectionChanged();
        this.addManagedListeners(this.eCheckbox.getInputElement(), {
          // we don't want double click on this icon to open a group
          dblclick: _stopPropagationForAgGrid,
          click: (event) => {
            _stopPropagationForAgGrid(event);
            this.beans.selectionSvc?.handleSelectionEvent(event, this.rowNode, "checkboxSelected");
          }
        });
        this.addManagedListeners(this.rowNode, {
          rowSelected: this.onSelectionChanged.bind(this),
          dataChanged: this.onDataChanged.bind(this),
          selectableChanged: this.onSelectableChanged.bind(this)
        });
        this.addManagedPropertyListener("rowSelection", ({ currentValue, previousValue }) => {
          const curr = typeof currentValue === "object" ? _getHideDisabledCheckboxes(currentValue) : void 0;
          const prev = typeof previousValue === "object" ? _getHideDisabledCheckboxes(previousValue) : void 0;
          if (curr !== prev) {
            this.onSelectableChanged();
          }
        });
        const isRowSelectableFunc = _getIsRowSelectable(this.gos);
        const checkboxVisibleIsDynamic = isRowSelectableFunc || typeof this.getIsVisible() === "function";
        if (checkboxVisibleIsDynamic) {
          const showOrHideSelectListener = this.showOrHideSelect.bind(this);
          this.addManagedEventListeners({ displayedColumnsChanged: showOrHideSelectListener });
          this.addManagedListeners(this.rowNode, {
            dataChanged: showOrHideSelectListener,
            cellChanged: showOrHideSelectListener
          });
          this.showOrHideSelect();
        }
        this.eCheckbox.getInputElement().setAttribute("tabindex", "-1");
      }
      showOrHideSelect() {
        const { column: column2, rowNode, overrides, gos } = this;
        const selectable = rowNode.selectable;
        const isVisible = this.getIsVisible();
        let checkboxes = void 0;
        if (typeof isVisible === "function") {
          const extraParams = overrides?.callbackParams;
          if (!column2) {
            checkboxes = isVisible({ ...extraParams, node: rowNode, data: rowNode.data });
          } else {
            const params = column2.createColumnFunctionCallbackParams(rowNode);
            checkboxes = isVisible({ ...extraParams, ...params });
          }
        } else {
          checkboxes = isVisible ?? false;
        }
        const disabled2 = selectable && !checkboxes || !selectable && checkboxes;
        const visible2 = selectable || checkboxes;
        const so = gos.get("rowSelection");
        const showDisabledCheckboxes = so && typeof so !== "string" ? !_getHideDisabledCheckboxes(so) : !!column2?.getColDef().showDisabledCheckboxes;
        this.setVisible(visible2 && (disabled2 ? showDisabledCheckboxes : true));
        this.setDisplayed(visible2 && (disabled2 ? showDisabledCheckboxes : true));
        if (visible2) {
          this.eCheckbox.setDisabled(disabled2);
        }
        if (overrides?.removeHidden) {
          this.setDisplayed(visible2);
        }
      }
      getIsVisible() {
        const overrides = this.overrides;
        if (overrides) {
          return overrides.isVisible;
        }
        const so = this.gos.get("rowSelection");
        if (so && typeof so !== "string") {
          return _getCheckboxes(so);
        }
        return this.column?.getColDef()?.checkboxSelection;
      }
    };
    var RowRangeSelectionContext = class {
      constructor(rowModel, pinnedRowModel) {
        this.rowModel = rowModel;
        this.pinnedRowModel = pinnedRowModel;
        this.selectAll = false;
        this.rootId = null;
        this.endId = null;
        this.cachedRange = [];
      }
      reset() {
        this.rootId = null;
        this.endId = null;
        this.cachedRange.length = 0;
      }
      setRoot(node2) {
        this.rootId = node2.id;
        this.endId = null;
        this.cachedRange.length = 0;
      }
      setEndRange(end2) {
        this.endId = end2.id;
        this.cachedRange.length = 0;
      }
      getRange() {
        if (this.cachedRange.length === 0) {
          const root2 = this.getRoot();
          const end2 = this.getEnd();
          if (root2 == null || end2 == null) {
            return this.cachedRange;
          }
          this.cachedRange = this.getNodesInRange(root2, end2) ?? [];
        }
        return this.cachedRange;
      }
      isInRange(node2) {
        if (this.rootId === null) {
          return false;
        }
        return this.getRange().some((nodeInRange) => nodeInRange.id === node2.id);
      }
      getRoot(fallback) {
        if (this.rootId) {
          return this.getRowNode(this.rootId);
        }
        if (fallback) {
          this.setRoot(fallback);
          return fallback;
        }
      }
      getEnd() {
        if (this.endId) {
          return this.getRowNode(this.endId);
        }
      }
      getRowNode(id) {
        let node2;
        const { rowModel, pinnedRowModel } = this;
        node2 ?? (node2 = rowModel.getRowNode(id));
        if (pinnedRowModel?.isManual()) {
          node2 ?? (node2 = pinnedRowModel.getPinnedRowById(id, "top"));
          node2 ?? (node2 = pinnedRowModel.getPinnedRowById(id, "bottom"));
        }
        return node2;
      }
      /**
       * Truncates the range to the given node (assumed to be within the current range).
       * Returns nodes that remain in the current range and those that should be removed
       *
       * @param node - Node at which to truncate the range
       * @returns Object of nodes to either keep or discard (i.e. deselect) from the range
       */
      truncate(node2) {
        const range2 = this.getRange();
        if (range2.length === 0) {
          return { keep: [], discard: [] };
        }
        const discardAfter = range2[0].id === this.rootId;
        const idx = range2.findIndex((rowNode) => rowNode.id === node2.id);
        if (idx > -1) {
          const above = range2.slice(0, idx);
          const below = range2.slice(idx + 1);
          this.setEndRange(node2);
          return discardAfter ? { keep: above, discard: below } : { keep: below, discard: above };
        } else {
          return { keep: range2, discard: [] };
        }
      }
      /**
       * Extends the range to the given node. Returns nodes that remain in the current range
       * and those that should be removed.
       *
       * @param node - Node marking the new end of the range
       * @returns Object of nodes to either keep or discard (i.e. deselect) from the range
       */
      extend(node2, groupSelectsChildren = false) {
        const root2 = this.getRoot();
        if (root2 == null) {
          const keep = this.getRange().slice();
          if (groupSelectsChildren) {
            node2.depthFirstSearch((node22) => !node22.group && keep.push(node22));
          }
          keep.push(node2);
          this.setRoot(node2);
          return { keep, discard: [] };
        }
        const newRange = this.getNodesInRange(root2, node2);
        if (!newRange) {
          this.setRoot(node2);
          return { keep: [node2], discard: [] };
        }
        if (newRange.find((newRangeNode) => newRangeNode.id === this.endId)) {
          this.setEndRange(node2);
          return { keep: this.getRange(), discard: [] };
        } else {
          const discard = this.getRange().slice();
          this.setEndRange(node2);
          return { keep: this.getRange(), discard };
        }
      }
      getNodesInRange(start2, end2) {
        const { pinnedRowModel, rowModel } = this;
        if (!pinnedRowModel?.isManual()) {
          return rowModel.getNodesInRangeForSelection(start2, end2);
        }
        if (start2.rowPinned === "top" && !end2.rowPinned) {
          const pinnedRange = _getNodesInRangeForSelection(pinnedRowModel, "top", start2, void 0);
          return pinnedRange.concat(rowModel.getNodesInRangeForSelection(rowModel.getRow(0), end2) ?? []);
        }
        if (start2.rowPinned === "bottom" && !end2.rowPinned) {
          const pinnedRange = _getNodesInRangeForSelection(pinnedRowModel, "bottom", void 0, start2);
          const count = rowModel.getRowCount();
          const lastMain = rowModel.getRow(count - 1);
          return (rowModel.getNodesInRangeForSelection(end2, lastMain) ?? []).concat(pinnedRange);
        }
        if (!start2.rowPinned && !end2.rowPinned) {
          return rowModel.getNodesInRangeForSelection(start2, end2);
        }
        if (start2.rowPinned === "top" && end2.rowPinned === "top") {
          return _getNodesInRangeForSelection(pinnedRowModel, "top", start2, end2);
        }
        if (start2.rowPinned === "bottom" && end2.rowPinned === "top") {
          const top2 = _getNodesInRangeForSelection(pinnedRowModel, "top", end2, void 0);
          const bottom2 = _getNodesInRangeForSelection(pinnedRowModel, "bottom", void 0, start2);
          const first = rowModel.getRow(0);
          const last = rowModel.getRow(rowModel.getRowCount() - 1);
          return top2.concat(rowModel.getNodesInRangeForSelection(first, last) ?? []).concat(bottom2);
        }
        if (!start2.rowPinned && end2.rowPinned === "top") {
          const pinned = _getNodesInRangeForSelection(pinnedRowModel, "top", end2, void 0);
          return pinned.concat(rowModel.getNodesInRangeForSelection(rowModel.getRow(0), start2) ?? []);
        }
        if (start2.rowPinned === "top" && end2.rowPinned === "bottom") {
          const top2 = _getNodesInRangeForSelection(pinnedRowModel, "top", start2, void 0);
          const bottom2 = _getNodesInRangeForSelection(pinnedRowModel, "bottom", void 0, end2);
          const first = rowModel.getRow(0);
          const last = rowModel.getRow(rowModel.getRowCount() - 1);
          return top2.concat(rowModel.getNodesInRangeForSelection(first, last) ?? []).concat(bottom2);
        }
        if (start2.rowPinned === "bottom" && end2.rowPinned === "bottom") {
          return _getNodesInRangeForSelection(pinnedRowModel, "bottom", start2, end2);
        }
        if (!start2.rowPinned && end2.rowPinned === "bottom") {
          const pinned = _getNodesInRangeForSelection(pinnedRowModel, "bottom", void 0, end2);
          const last = rowModel.getRow(rowModel.getRowCount());
          return (rowModel.getNodesInRangeForSelection(start2, last) ?? []).concat(pinned);
        }
        return null;
      }
    };
    var SelectAllFeature = class extends BeanStub {
      constructor(column2) {
        super();
        this.column = column2;
        this.cbSelectAllVisible = false;
        this.processingEventFromCheckbox = false;
      }
      onSpaceKeyDown(e) {
        const checkbox2 = this.cbSelectAll;
        if (checkbox2.isDisplayed() && !checkbox2.getGui().contains(_getActiveDomElement(this.beans))) {
          e.preventDefault();
          checkbox2.setValue(!checkbox2.getValue());
        }
      }
      getCheckboxGui() {
        return this.cbSelectAll.getGui();
      }
      setComp(ctrl) {
        this.headerCellCtrl = ctrl;
        const cbSelectAll = this.createManagedBean(new AgCheckbox());
        this.cbSelectAll = cbSelectAll;
        cbSelectAll.addCss("ag-header-select-all");
        _setAriaRole(cbSelectAll.getGui(), "presentation");
        this.showOrHideSelectAll();
        const updateStateOfCheckbox = this.updateStateOfCheckbox.bind(this);
        this.addManagedEventListeners({
          newColumnsLoaded: () => this.showOrHideSelectAll(),
          displayedColumnsChanged: this.onDisplayedColumnsChanged.bind(this),
          selectionChanged: updateStateOfCheckbox,
          paginationChanged: updateStateOfCheckbox,
          modelUpdated: updateStateOfCheckbox
        });
        this.addManagedPropertyListener("rowSelection", ({ currentValue, previousValue }) => {
          const getSelectAll = (rowSelection) => typeof rowSelection === "string" || !rowSelection || rowSelection.mode === "singleRow" ? void 0 : rowSelection.selectAll;
          if (getSelectAll(currentValue) !== getSelectAll(previousValue)) {
            this.showOrHideSelectAll();
          }
          this.updateStateOfCheckbox();
        });
        this.addManagedListeners(cbSelectAll, { fieldValueChanged: this.onCbSelectAll.bind(this) });
        cbSelectAll.getInputElement().setAttribute("tabindex", "-1");
        this.refreshSelectAllLabel();
      }
      onDisplayedColumnsChanged(e) {
        if (!this.isAlive()) {
          return;
        }
        this.showOrHideSelectAll(e.source === "uiColumnMoved");
      }
      showOrHideSelectAll(fromColumnMoved = false) {
        const cbSelectAllVisible = this.isCheckboxSelection();
        this.cbSelectAllVisible = cbSelectAllVisible;
        this.cbSelectAll.setDisplayed(cbSelectAllVisible);
        if (cbSelectAllVisible) {
          this.checkRightRowModelType("selectAllCheckbox");
          this.checkSelectionType("selectAllCheckbox");
          this.updateStateOfCheckbox();
        }
        this.refreshSelectAllLabel(fromColumnMoved);
      }
      updateStateOfCheckbox() {
        if (!this.cbSelectAllVisible || this.processingEventFromCheckbox) {
          return;
        }
        this.processingEventFromCheckbox = true;
        const selectAllMode = this.getSelectAllMode();
        const selectionSvc = this.beans.selectionSvc;
        const cbSelectAll = this.cbSelectAll;
        const allSelected = selectionSvc.getSelectAllState(selectAllMode);
        cbSelectAll.setValue(allSelected);
        const hasNodesToSelect = selectionSvc.hasNodesToSelect(selectAllMode);
        cbSelectAll.setDisabled(!hasNodesToSelect);
        this.refreshSelectAllLabel();
        this.processingEventFromCheckbox = false;
      }
      refreshSelectAllLabel(fromColumnMoved = false) {
        const translate = this.getLocaleTextFunc();
        const { headerCellCtrl, cbSelectAll, cbSelectAllVisible } = this;
        const checked = cbSelectAll.getValue();
        const ariaStatus = _getAriaCheckboxStateName(translate, checked);
        const ariaLabel = translate("ariaRowSelectAll", "Press Space to toggle all rows selection");
        headerCellCtrl.setAriaDescriptionProperty(
          "selectAll",
          cbSelectAllVisible ? `${ariaLabel} (${ariaStatus})` : null
        );
        cbSelectAll.setInputAriaLabel(translate("ariaHeaderSelection", "Column with Header Selection"));
        if (!fromColumnMoved) {
          headerCellCtrl.announceAriaDescription();
        }
      }
      checkSelectionType(feature) {
        const isMultiSelect = _isMultiRowSelection(this.gos);
        if (!isMultiSelect) {
          _warn(128, { feature });
          return false;
        }
        return true;
      }
      checkRightRowModelType(feature) {
        const { gos, rowModel } = this.beans;
        const rowModelMatches = _isClientSideRowModel(gos) || _isServerSideRowModel(gos);
        if (!rowModelMatches) {
          _warn(129, { feature, rowModel: rowModel.getType() });
          return false;
        }
        return true;
      }
      onCbSelectAll() {
        if (this.processingEventFromCheckbox) {
          return;
        }
        if (!this.cbSelectAllVisible) {
          return;
        }
        const value2 = this.cbSelectAll.getValue();
        const selectAll2 = this.getSelectAllMode();
        let source2 = "uiSelectAll";
        if (selectAll2 === "currentPage") {
          source2 = "uiSelectAllCurrentPage";
        } else if (selectAll2 === "filtered") {
          source2 = "uiSelectAllFiltered";
        }
        const params = { source: source2, selectAll: selectAll2 };
        const selectionSvc = this.beans.selectionSvc;
        if (value2) {
          selectionSvc.selectAllRowNodes(params);
        } else {
          selectionSvc.deselectAllRowNodes(params);
        }
      }
      /**
       * Checkbox is enabled when either the `headerCheckbox` option is enabled in the new selection API
       * or `headerCheckboxSelection` is enabled in the legacy API.
       */
      isCheckboxSelection() {
        const { column: column2, gos, beans } = this;
        const rowSelection = gos.get("rowSelection");
        const newHeaderCheckbox = typeof rowSelection === "object";
        const featureName = newHeaderCheckbox ? "headerCheckbox" : "headerCheckboxSelection";
        return isCheckboxSelection(beans, column2) && this.checkRightRowModelType(featureName) && this.checkSelectionType(featureName);
      }
      getSelectAllMode() {
        const selectAll2 = _getSelectAll(this.gos, false);
        if (selectAll2) {
          return selectAll2;
        }
        const { headerCheckboxSelectionCurrentPageOnly, headerCheckboxSelectionFilteredOnly } = this.column.getColDef();
        if (headerCheckboxSelectionCurrentPageOnly) {
          return "currentPage";
        }
        if (headerCheckboxSelectionFilteredOnly) {
          return "filtered";
        }
        return "all";
      }
      destroy() {
        super.destroy();
        this.cbSelectAll = void 0;
        this.headerCellCtrl = void 0;
      }
    };
    function isCheckboxSelection({ gos, selectionColSvc }, column2) {
      const rowSelection = gos.get("rowSelection");
      const colDef = column2.getColDef();
      const { headerCheckboxSelection } = colDef;
      let result2 = false;
      const newHeaderCheckbox = typeof rowSelection === "object";
      if (newHeaderCheckbox) {
        const isSelectionCol = isColumnSelectionCol(column2);
        const isAutoCol = isColumnGroupAutoCol(column2);
        const location2 = _getCheckboxLocation(rowSelection);
        if (location2 === "autoGroupColumn" && isAutoCol || isSelectionCol && selectionColSvc?.isSelectionColumnEnabled()) {
          result2 = _getHeaderCheckbox(rowSelection);
        }
      } else if (typeof headerCheckboxSelection === "function") {
        result2 = headerCheckboxSelection(_addGridCommonParams(gos, { column: column2, colDef }));
      } else {
        result2 = !!headerCheckboxSelection;
      }
      return result2;
    }
    var BaseSelectionService = class extends BeanStub {
      postConstruct() {
        const { gos, beans } = this;
        this.selectionCtx = new RowRangeSelectionContext(beans.rowModel, beans.pinnedRowModel);
        this.addManagedPropertyListeners(["isRowSelectable", "rowSelection"], () => {
          const callback = _getIsRowSelectable(gos);
          if (callback !== this.isRowSelectable) {
            this.isRowSelectable = callback;
            this.updateSelectable();
          }
        });
        this.isRowSelectable = _getIsRowSelectable(gos);
        this.addManagedEventListeners({
          cellValueChanged: (e) => this.updateRowSelectable(e.node),
          rowNodeDataChanged: (e) => this.updateRowSelectable(e.node)
        });
      }
      destroy() {
        super.destroy();
        this.selectionCtx.reset();
      }
      createCheckboxSelectionComponent() {
        return new CheckboxSelectionComponent();
      }
      createSelectAllFeature(column2) {
        if (isCheckboxSelection(this.beans, column2)) {
          return new SelectAllFeature(column2);
        }
      }
      isMultiSelect() {
        return _isMultiRowSelection(this.gos);
      }
      onRowCtrlSelected(rowCtrl, hasFocusFunc, gui) {
        const selected2 = !!rowCtrl.rowNode.isSelected();
        rowCtrl.forEachGui(gui, (gui2) => {
          gui2.rowComp.toggleCss("ag-row-selected", selected2);
          const element = gui2.element;
          _setAriaSelected(element, selected2);
          const hasFocus = element.contains(_getActiveDomElement(this.beans));
          if (hasFocus) {
            hasFocusFunc(gui2);
          }
        });
      }
      announceAriaRowSelection(rowNode) {
        if (this.isRowSelectionBlocked(rowNode)) {
          return;
        }
        const selected2 = rowNode.isSelected();
        const isEditing2 = this.beans.editSvc?.isEditing({ rowNode });
        if (!rowNode.selectable || isEditing2) {
          return;
        }
        const translate = this.getLocaleTextFunc();
        const label2 = translate(
          selected2 ? "ariaRowDeselect" : "ariaRowSelect",
          `Press SPACE to ${selected2 ? "deselect" : "select"} this row`
        );
        this.beans.ariaAnnounce?.announceValue(label2, "rowSelection");
      }
      isRowSelectionBlocked(rowNode) {
        return !rowNode.selectable || rowNode.rowPinned && !_isManualPinnedRow(rowNode) || !_isRowSelection(this.gos);
      }
      updateRowSelectable(rowNode, suppressSelectionUpdate) {
        const selectable = rowNode.rowPinned && rowNode.pinnedSibling ? (
          // If row node is pinned sibling, copy selectable status over from sibling row node
          rowNode.pinnedSibling.selectable
        ) : (
          // otherwise calculate selectable state directly
          this.isRowSelectable?.(rowNode) ?? true
        );
        this.setRowSelectable(rowNode, selectable, suppressSelectionUpdate);
        return selectable;
      }
      setRowSelectable(rowNode, newVal, suppressSelectionUpdate) {
        if (rowNode.selectable !== newVal) {
          rowNode.selectable = newVal;
          rowNode.dispatchRowEvent("selectableChanged");
          if (suppressSelectionUpdate) {
            return;
          }
          const isGroupSelectsChildren = _getGroupSelectsDescendants(this.gos);
          if (isGroupSelectsChildren) {
            const selected2 = this.calculateSelectedFromChildren(rowNode);
            this.setNodesSelected({ nodes: [rowNode], newValue: selected2 ?? false, source: "selectableChanged" });
            return;
          }
          if (rowNode.isSelected() && !rowNode.selectable) {
            this.setNodesSelected({ nodes: [rowNode], newValue: false, source: "selectableChanged" });
          }
        }
      }
      calculateSelectedFromChildren(rowNode) {
        let atLeastOneSelected = false;
        let atLeastOneDeSelected = false;
        if (!rowNode.childrenAfterGroup?.length) {
          return rowNode.selectable ? rowNode.__selected : null;
        }
        for (let i2 = 0; i2 < rowNode.childrenAfterGroup.length; i2++) {
          const child = rowNode.childrenAfterGroup[i2];
          let childState = child.isSelected();
          if (!child.selectable) {
            const selectable = this.calculateSelectedFromChildren(child);
            if (selectable === null) {
              continue;
            }
            childState = selectable;
          }
          switch (childState) {
            case true:
              atLeastOneSelected = true;
              break;
            case false:
              atLeastOneDeSelected = true;
              break;
            default:
              return void 0;
          }
        }
        if (atLeastOneSelected && atLeastOneDeSelected) {
          return void 0;
        }
        if (atLeastOneSelected) {
          return true;
        }
        if (atLeastOneDeSelected) {
          return false;
        }
        if (!rowNode.selectable) {
          return null;
        }
        return rowNode.__selected;
      }
      selectRowNode(rowNode, newValue, e, source2 = "api") {
        const selectionNotAllowed = !rowNode.selectable && newValue;
        const selectionNotChanged = rowNode.__selected === newValue;
        if (selectionNotAllowed || selectionNotChanged) {
          return false;
        }
        rowNode.__selected = newValue;
        rowNode.dispatchRowEvent("rowSelected");
        const sibling = rowNode.sibling;
        if (sibling && sibling.footer && sibling.__localEventService) {
          sibling.dispatchRowEvent("rowSelected");
        }
        const pinnedSibling = rowNode.pinnedSibling;
        if (pinnedSibling?.rowPinned && pinnedSibling.__localEventService) {
          pinnedSibling.dispatchRowEvent("rowSelected");
        }
        this.eventSvc.dispatchEvent({
          ..._createGlobalRowEvent(rowNode, this.gos, "rowSelected"),
          event: e || null,
          source: source2
        });
        return true;
      }
      isCellCheckboxSelection(column2, rowNode) {
        const so = this.gos.get("rowSelection");
        if (so && typeof so !== "string") {
          const checkbox2 = isColumnSelectionCol(column2) && _getCheckboxes(so);
          return column2.isColumnFunc(rowNode, checkbox2);
        } else {
          return column2.isColumnFunc(rowNode, column2.colDef.checkboxSelection);
        }
      }
      inferNodeSelections(node2, shiftKey, metaKey, source2) {
        const { gos, selectionCtx } = this;
        const currentSelection = node2.isSelected();
        const groupSelectsDescendants = _getGroupSelectsDescendants(gos);
        const enableClickSelection = _getEnableSelection(gos);
        const enableDeselection = _getEnableDeselection(gos);
        const isMultiSelect = this.isMultiSelect();
        const isRowClicked = source2 === "rowClicked";
        if (isRowClicked && !(enableClickSelection || enableDeselection)) {
          return null;
        }
        if (shiftKey && metaKey && isMultiSelect) {
          const root2 = selectionCtx.getRoot();
          if (!root2) {
            return null;
          } else if (!root2.isSelected()) {
            const partition = selectionCtx.extend(node2, groupSelectsDescendants);
            return {
              select: [],
              deselect: partition.keep,
              reset: false
            };
          } else {
            const partition = selectionCtx.isInRange(node2) ? selectionCtx.truncate(node2) : selectionCtx.extend(node2, groupSelectsDescendants);
            return {
              deselect: partition.discard,
              select: partition.keep,
              reset: false
            };
          }
        } else if (shiftKey && isMultiSelect) {
          const fallback = selectionCtx.selectAll ? this.beans.rowModel.getRow(0) : void 0;
          const root2 = selectionCtx.getRoot(fallback);
          const partition = selectionCtx.isInRange(node2) ? selectionCtx.truncate(node2) : selectionCtx.extend(node2, groupSelectsDescendants);
          return {
            select: partition.keep,
            deselect: partition.discard,
            reset: selectionCtx.selectAll || !!(root2 && !root2.isSelected())
          };
        } else if (metaKey) {
          if (isRowClicked) {
            const newValue = !currentSelection;
            const selectingWhenDisabled = newValue && !enableClickSelection;
            const deselectingWhenDisabled = !newValue && !enableDeselection;
            if (selectingWhenDisabled || deselectingWhenDisabled) {
              return null;
            }
            selectionCtx.setRoot(node2);
            return {
              node: node2,
              newValue,
              clearSelection: false
            };
          }
          selectionCtx.setRoot(node2);
          return {
            node: node2,
            newValue: !currentSelection,
            clearSelection: !isMultiSelect
          };
        } else {
          selectionCtx.setRoot(node2);
          const enableSelectionWithoutKeys = _getEnableSelectionWithoutKeys(gos);
          const groupSelectsFiltered = _getGroupSelection(gos) === "filteredDescendants";
          const shouldClear = isRowClicked && (!enableSelectionWithoutKeys || !enableClickSelection);
          if (groupSelectsFiltered && currentSelection === void 0 && _isClientSideRowModel(gos)) {
            return {
              node: node2,
              newValue: false,
              checkFilteredNodes: true,
              clearSelection: !isMultiSelect || shouldClear
            };
          }
          if (isRowClicked) {
            const newValue = currentSelection ? !enableSelectionWithoutKeys : enableClickSelection;
            const selectingWhenDisabled = newValue && !enableClickSelection;
            const deselectingWhenDisabled = !newValue && !enableDeselection;
            const wouldStateBeUnchanged = newValue === currentSelection && !shouldClear;
            if (wouldStateBeUnchanged || selectingWhenDisabled || deselectingWhenDisabled) {
              return null;
            }
            return {
              node: node2,
              newValue,
              clearSelection: !isMultiSelect || shouldClear,
              keepDescendants: node2.group && groupSelectsDescendants
            };
          }
          return {
            node: node2,
            newValue: !currentSelection,
            clearSelection: !isMultiSelect || shouldClear
          };
        }
      }
    };
    var TabGuardClassNames = {
      TAB_GUARD: "ag-tab-guard",
      TAB_GUARD_TOP: "ag-tab-guard-top",
      TAB_GUARD_BOTTOM: "ag-tab-guard-bottom"
    };
    var TabGuardCtrl = class extends BeanStub {
      constructor(params) {
        super();
        this.skipTabGuardFocus = false;
        this.forcingFocusOut = false;
        this.allowFocus = false;
        const {
          comp: comp2,
          eTopGuard,
          eBottomGuard,
          focusTrapActive,
          forceFocusOutWhenTabGuardsAreEmpty,
          isFocusableContainer,
          focusInnerElement,
          onFocusIn,
          onFocusOut,
          shouldStopEventPropagation,
          onTabKeyDown,
          handleKeyDown,
          isEmpty,
          eFocusableElement
        } = params;
        this.comp = comp2;
        this.eTopGuard = eTopGuard;
        this.eBottomGuard = eBottomGuard;
        this.providedFocusInnerElement = focusInnerElement;
        this.eFocusableElement = eFocusableElement;
        this.focusTrapActive = !!focusTrapActive;
        this.forceFocusOutWhenTabGuardsAreEmpty = !!forceFocusOutWhenTabGuardsAreEmpty;
        this.isFocusableContainer = !!isFocusableContainer;
        this.providedFocusIn = onFocusIn;
        this.providedFocusOut = onFocusOut;
        this.providedShouldStopEventPropagation = shouldStopEventPropagation;
        this.providedOnTabKeyDown = onTabKeyDown;
        this.providedHandleKeyDown = handleKeyDown;
        this.providedIsEmpty = isEmpty;
      }
      postConstruct() {
        this.createManagedBean(
          new ManagedFocusFeature(this.eFocusableElement, {
            shouldStopEventPropagation: () => this.shouldStopEventPropagation(),
            onTabKeyDown: (e) => this.onTabKeyDown(e),
            handleKeyDown: (e) => this.handleKeyDown(e),
            onFocusIn: (e) => this.onFocusIn(e),
            onFocusOut: (e) => this.onFocusOut(e)
          })
        );
        this.activateTabGuards();
        for (const guard of [this.eTopGuard, this.eBottomGuard]) {
          this.addManagedElementListeners(guard, { focus: this.onFocus.bind(this) });
        }
      }
      handleKeyDown(e) {
        if (this.providedHandleKeyDown) {
          this.providedHandleKeyDown(e);
        }
      }
      tabGuardsAreActive() {
        return !!this.eTopGuard && this.eTopGuard.hasAttribute("tabIndex");
      }
      shouldStopEventPropagation() {
        if (this.providedShouldStopEventPropagation) {
          return this.providedShouldStopEventPropagation();
        }
        return false;
      }
      activateTabGuards() {
        if (this.forcingFocusOut) {
          return;
        }
        const tabIndex = this.gos.get("tabIndex");
        this.comp.setTabIndex(tabIndex.toString());
      }
      deactivateTabGuards() {
        this.comp.setTabIndex();
      }
      onFocus(e) {
        if (this.isFocusableContainer && !this.eFocusableElement.contains(e.relatedTarget)) {
          if (!this.allowFocus) {
            this.findNextElementOutsideAndFocus(e.target === this.eBottomGuard);
            return;
          }
        }
        if (this.skipTabGuardFocus) {
          this.skipTabGuardFocus = false;
          return;
        }
        if (this.forceFocusOutWhenTabGuardsAreEmpty) {
          const isEmpty = this.providedIsEmpty ? this.providedIsEmpty() : _findFocusableElements(this.eFocusableElement, ".ag-tab-guard").length === 0;
          if (isEmpty) {
            this.findNextElementOutsideAndFocus(e.target === this.eBottomGuard);
            return;
          }
        }
        if (this.isFocusableContainer && this.eFocusableElement.contains(e.relatedTarget)) {
          return;
        }
        const fromBottom = e.target === this.eBottomGuard;
        const hasFocusedInnerElement = this.providedFocusInnerElement ? this.providedFocusInnerElement(fromBottom) : this.focusInnerElement(fromBottom);
        if (!hasFocusedInnerElement && this.forceFocusOutWhenTabGuardsAreEmpty) {
          this.findNextElementOutsideAndFocus(e.target === this.eBottomGuard);
        }
      }
      findNextElementOutsideAndFocus(up) {
        const eDocument = _getDocument(this.beans);
        const focusableEls = _findFocusableElements(eDocument.body, null, true);
        const index = focusableEls.indexOf(up ? this.eTopGuard : this.eBottomGuard);
        if (index === -1) {
          return;
        }
        let start2;
        let end2;
        if (up) {
          start2 = 0;
          end2 = index;
        } else {
          start2 = index + 1;
          end2 = focusableEls.length;
        }
        const focusableRange = focusableEls.slice(start2, end2);
        const targetTabIndex = this.gos.get("tabIndex");
        focusableRange.sort((a, b) => {
          const indexA = Number.parseInt(a.getAttribute("tabindex") || "0");
          const indexB = Number.parseInt(b.getAttribute("tabindex") || "0");
          if (indexB === targetTabIndex) {
            return 1;
          }
          if (indexA === targetTabIndex) {
            return -1;
          }
          if (indexA === 0) {
            return 1;
          }
          if (indexB === 0) {
            return -1;
          }
          return indexA - indexB;
        });
        focusableRange[up ? focusableRange.length - 1 : 0]?.focus();
      }
      onFocusIn(e) {
        if (this.focusTrapActive || this.forcingFocusOut) {
          return;
        }
        if (this.providedFocusIn) {
          this.providedFocusIn(e);
        }
        if (!this.isFocusableContainer) {
          this.deactivateTabGuards();
        }
      }
      onFocusOut(e) {
        if (this.focusTrapActive) {
          return;
        }
        if (this.providedFocusOut) {
          this.providedFocusOut(e);
        }
        if (!this.eFocusableElement.contains(e.relatedTarget)) {
          this.activateTabGuards();
        }
      }
      onTabKeyDown(e) {
        if (this.providedOnTabKeyDown) {
          this.providedOnTabKeyDown(e);
          return;
        }
        if (this.focusTrapActive) {
          return;
        }
        if (e.defaultPrevented) {
          return;
        }
        const tabGuardsAreActive = this.tabGuardsAreActive();
        if (tabGuardsAreActive) {
          this.deactivateTabGuards();
        }
        const nextRoot = this.getNextFocusableElement(e.shiftKey);
        if (tabGuardsAreActive) {
          setTimeout(() => this.activateTabGuards(), 0);
        }
        if (!nextRoot) {
          return;
        }
        nextRoot.focus();
        e.preventDefault();
      }
      focusInnerElement(fromBottom = false) {
        const focusable = _findFocusableElements(this.eFocusableElement);
        if (this.tabGuardsAreActive()) {
          focusable.splice(0, 1);
          focusable.splice(focusable.length - 1, 1);
        }
        if (!focusable.length) {
          return false;
        }
        focusable[fromBottom ? focusable.length - 1 : 0].focus({ preventScroll: true });
        return true;
      }
      getNextFocusableElement(backwards) {
        return _findNextFocusableElement(this.beans, this.eFocusableElement, false, backwards);
      }
      forceFocusOutOfContainer(up = false) {
        if (this.forcingFocusOut) {
          return;
        }
        const tabGuardToFocus = up ? this.eTopGuard : this.eBottomGuard;
        this.activateTabGuards();
        this.skipTabGuardFocus = true;
        this.forcingFocusOut = true;
        tabGuardToFocus.focus();
        window.setTimeout(() => {
          this.forcingFocusOut = false;
          this.activateTabGuards();
        });
      }
      isTabGuard(element, bottom2) {
        return element === this.eTopGuard && !bottom2 || element === this.eBottomGuard && (bottom2 ?? true);
      }
      setAllowFocus(allowFocus) {
        this.allowFocus = allowFocus;
      }
    };
    var TabGuardFeature = class extends BeanStub {
      constructor(comp2) {
        super();
        this.comp = comp2;
      }
      initialiseTabGuard(params) {
        this.eTopGuard = this.createTabGuard("top");
        this.eBottomGuard = this.createTabGuard("bottom");
        this.eFocusableElement = this.comp.getFocusableElement();
        const { eTopGuard, eBottomGuard, eFocusableElement } = this;
        const tabGuards = [eTopGuard, eBottomGuard];
        const compProxy = {
          setTabIndex: (tabIndex) => {
            for (const tabGuard of tabGuards) {
              tabIndex != null ? tabGuard.setAttribute("tabindex", tabIndex) : tabGuard.removeAttribute("tabindex");
            }
          }
        };
        this.addTabGuards(eTopGuard, eBottomGuard);
        const {
          focusTrapActive = false,
          onFocusIn,
          onFocusOut,
          focusInnerElement,
          handleKeyDown,
          onTabKeyDown,
          shouldStopEventPropagation,
          isEmpty,
          forceFocusOutWhenTabGuardsAreEmpty,
          isFocusableContainer
        } = params;
        this.tabGuardCtrl = this.createManagedBean(
          new TabGuardCtrl({
            comp: compProxy,
            focusTrapActive,
            eTopGuard,
            eBottomGuard,
            eFocusableElement,
            onFocusIn,
            onFocusOut,
            focusInnerElement,
            handleKeyDown,
            onTabKeyDown,
            shouldStopEventPropagation,
            isEmpty,
            forceFocusOutWhenTabGuardsAreEmpty,
            isFocusableContainer
          })
        );
      }
      getTabGuardCtrl() {
        return this.tabGuardCtrl;
      }
      createTabGuard(side) {
        const tabGuard = _getDocument(this.beans).createElement("div");
        const cls = side === "top" ? TabGuardClassNames.TAB_GUARD_TOP : TabGuardClassNames.TAB_GUARD_BOTTOM;
        tabGuard.classList.add(TabGuardClassNames.TAB_GUARD, cls);
        _setAriaRole(tabGuard, "presentation");
        return tabGuard;
      }
      addTabGuards(topTabGuard, bottomTabGuard) {
        const eFocusableElement = this.eFocusableElement;
        eFocusableElement.insertAdjacentElement("afterbegin", topTabGuard);
        eFocusableElement.insertAdjacentElement("beforeend", bottomTabGuard);
      }
      removeAllChildrenExceptTabGuards() {
        const tabGuards = [this.eTopGuard, this.eBottomGuard];
        _clearElement(this.comp.getFocusableElement());
        this.addTabGuards(...tabGuards);
      }
      forceFocusOutOfContainer(up = false) {
        this.tabGuardCtrl.forceFocusOutOfContainer(up);
      }
      appendChild(appendChild, newChild, container2) {
        if (!_isNodeOrElement(newChild)) {
          newChild = newChild.getGui();
        }
        const { eBottomGuard: bottomTabGuard } = this;
        if (bottomTabGuard) {
          bottomTabGuard.insertAdjacentElement("beforebegin", newChild);
        } else {
          appendChild(newChild, container2);
        }
      }
      destroy() {
        const { eTopGuard, eBottomGuard } = this;
        _removeFromParent(eTopGuard);
        _removeFromParent(eBottomGuard);
        super.destroy();
      }
    };
    var TabGuardComp$1 = class TabGuardComp extends Component {
      initialiseTabGuard(params) {
        this.tabGuardFeature = this.createManagedBean(new TabGuardFeature(this));
        this.tabGuardFeature.initialiseTabGuard(params);
      }
      forceFocusOutOfContainer(up = false) {
        this.tabGuardFeature.forceFocusOutOfContainer(up);
      }
      appendChild(newChild, container2) {
        this.tabGuardFeature.appendChild(super.appendChild.bind(this), newChild, container2);
      }
    };
    var DOUBLE_TAP_MILLISECONDS = 500;
    var LONG_PRESS_MILLISECONDS = 550;
    var handledTouchEvents;
    var addHandledTouchEvent = (event) => {
      if (!handledTouchEvents) {
        handledTouchEvents = /* @__PURE__ */ new WeakSet();
      } else if (handledTouchEvents.has(event)) {
        return false;
      }
      handledTouchEvents.add(event);
      return true;
    };
    var TouchListener = class {
      constructor(eElement, preventClick = false) {
        this.eElement = eElement;
        this.preventClick = preventClick;
        this.startListener = null;
        this.handlers = [];
        this.eventSvc = void 0;
        this.touchStart = null;
        this.lastTapTime = null;
        this.longPressTimer = 0;
        this.moved = false;
      }
      addEventListener(eventType, listener) {
        let eventSvc = this.eventSvc;
        if (!eventSvc) {
          if (eventSvc === null) {
            return;
          }
          this.eventSvc = eventSvc = new LocalEventService();
          const startListener = this.onTouchStart.bind(this);
          this.startListener = startListener;
          this.eElement.addEventListener("touchstart", startListener, { passive: true });
        }
        eventSvc.addEventListener(eventType, listener);
      }
      removeEventListener(eventType, listener) {
        this.eventSvc?.removeEventListener(eventType, listener);
      }
      onTouchStart(touchEvent) {
        if (this.touchStart || !addHandledTouchEvent(touchEvent)) {
          return;
        }
        const touchStart = touchEvent.touches[0];
        this.touchStart = touchStart;
        const handlers2 = this.handlers;
        if (!handlers2.length) {
          const eElement = this.eElement;
          const doc2 = eElement.ownerDocument;
          const touchMove = this.onTouchMove.bind(this);
          const touchEnd = this.onTouchEnd.bind(this);
          const touchCancel = this.onTouchCancel.bind(this);
          const passiveTrue = { passive: true };
          const passiveFalse = { passive: false };
          addTempEventHandlers(
            handlers2,
            [eElement, "touchmove", touchMove, passiveTrue],
            [doc2, "touchcancel", touchCancel, passiveTrue],
            // we set passive=false, as we want to prevent default on this event
            [doc2, "touchend", touchEnd, passiveFalse],
            [doc2, "contextmenu", preventEventDefault, passiveFalse]
          );
        }
        this.clearLongPress();
        this.longPressTimer = window.setTimeout(() => {
          this.longPressTimer = 0;
          if (this.touchStart === touchStart && !this.moved) {
            this.moved = true;
            this.eventSvc?.dispatchEvent({ type: "longTap", touchStart, touchEvent });
          }
        }, LONG_PRESS_MILLISECONDS);
      }
      onTouchMove(touchEvent) {
        const { moved, touchStart } = this;
        if (!moved && touchStart) {
          const touch = _getFirstActiveTouch(touchStart, touchEvent.touches);
          const eventIsFarAway = touch && !_areEventsNear(touch, touchStart, 4);
          if (eventIsFarAway) {
            this.clearLongPress();
            this.moved = true;
          }
        }
      }
      onTouchEnd(touchEvent) {
        const touchStart = this.touchStart;
        if (!touchStart || !_getFirstActiveTouch(touchStart, touchEvent.changedTouches)) {
          return;
        }
        if (!this.moved) {
          this.eventSvc?.dispatchEvent({ type: "tap", touchStart });
          this.checkDoubleTap(touchStart);
        }
        if (this.preventClick) {
          preventEventDefault(touchEvent);
        }
        this.cancel();
      }
      onTouchCancel(touchEvent) {
        const touchStart = this.touchStart;
        if (!touchStart || !_getFirstActiveTouch(touchStart, touchEvent.changedTouches)) {
          return;
        }
        this.lastTapTime = null;
        this.cancel();
      }
      checkDoubleTap(touchStart) {
        let now = Date.now();
        const lastTapTime = this.lastTapTime;
        if (lastTapTime) {
          const interval = now - lastTapTime;
          if (interval > DOUBLE_TAP_MILLISECONDS) {
            this.eventSvc?.dispatchEvent({ type: "doubleTap", touchStart });
            now = null;
          }
        }
        this.lastTapTime = now;
      }
      cancel() {
        this.clearLongPress();
        clearTempEventHandlers(this.handlers);
        this.touchStart = null;
      }
      clearLongPress() {
        window.clearTimeout(this.longPressTimer);
        this.longPressTimer = 0;
        this.moved = false;
      }
      destroy() {
        const startListener = this.startListener;
        if (startListener) {
          this.startListener = null;
          this.eElement.removeEventListener("touchstart", startListener);
        }
        this.cancel();
        this.eElement = null;
        this.eventSvc = null;
      }
    };
    var AutoScrollService = class {
      constructor(params) {
        this.tickingInterval = null;
        this.onScrollCallback = null;
        this.scrollContainer = params.scrollContainer;
        this.scrollHorizontally = params.scrollAxis.includes("x");
        this.scrollVertically = params.scrollAxis.includes("y");
        this.scrollByTick = params.scrollByTick != null ? params.scrollByTick : 20;
        if (params.onScrollCallback) {
          this.onScrollCallback = params.onScrollCallback;
        }
        if (this.scrollVertically) {
          this.getVerticalPosition = params.getVerticalPosition;
          this.setVerticalPosition = params.setVerticalPosition;
        }
        if (this.scrollHorizontally) {
          this.getHorizontalPosition = params.getHorizontalPosition;
          this.setHorizontalPosition = params.setHorizontalPosition;
        }
        this.shouldSkipVerticalScroll = params.shouldSkipVerticalScroll || (() => false);
        this.shouldSkipHorizontalScroll = params.shouldSkipHorizontalScroll || (() => false);
      }
      /** True while auto-scrolling */
      get scrolling() {
        return this.tickingInterval !== null;
      }
      check(mouseEvent, forceSkipVerticalScroll = false) {
        const skipVerticalScroll = forceSkipVerticalScroll || this.shouldSkipVerticalScroll();
        if (skipVerticalScroll && this.shouldSkipHorizontalScroll()) {
          return;
        }
        const rect2 = this.scrollContainer.getBoundingClientRect();
        const scrollTick = this.scrollByTick;
        this.tickLeft = mouseEvent.clientX < rect2.left + scrollTick;
        this.tickRight = mouseEvent.clientX > rect2.right - scrollTick;
        this.tickUp = mouseEvent.clientY < rect2.top + scrollTick && !skipVerticalScroll;
        this.tickDown = mouseEvent.clientY > rect2.bottom - scrollTick && !skipVerticalScroll;
        if (this.tickLeft || this.tickRight || this.tickUp || this.tickDown) {
          this.ensureTickingStarted();
        } else {
          this.ensureCleared();
        }
      }
      ensureTickingStarted() {
        if (this.tickingInterval === null) {
          this.tickingInterval = window.setInterval(this.doTick.bind(this), 100);
          this.tickCount = 0;
        }
      }
      doTick() {
        this.tickCount++;
        const tickAmount = this.tickCount > 20 ? 200 : this.tickCount > 10 ? 80 : 40;
        if (this.scrollVertically) {
          const vScrollPosition = this.getVerticalPosition();
          if (this.tickUp) {
            this.setVerticalPosition(vScrollPosition - tickAmount);
          }
          if (this.tickDown) {
            this.setVerticalPosition(vScrollPosition + tickAmount);
          }
        }
        if (this.scrollHorizontally) {
          const hScrollPosition = this.getHorizontalPosition();
          if (this.tickLeft) {
            this.setHorizontalPosition(hScrollPosition - tickAmount);
          }
          if (this.tickRight) {
            this.setHorizontalPosition(hScrollPosition + tickAmount);
          }
        }
        if (this.onScrollCallback) {
          this.onScrollCallback();
        }
      }
      ensureCleared() {
        if (this.tickingInterval) {
          window.clearInterval(this.tickingInterval);
          this.tickingInterval = null;
        }
      }
    };
    var VanillaFrameworkOverrides = class {
      constructor(frameworkName = "javascript") {
        this.frameworkName = frameworkName;
        this.renderingEngine = "vanilla";
        this.batchFrameworkComps = false;
        this.wrapIncoming = (callback) => callback();
        this.wrapOutgoing = (callback) => callback();
        this.baseDocLink = `${BASE_URL}/${this.frameworkName}-data-grid`;
        setValidationDocLink(this.baseDocLink);
      }
      frameworkComponent(_) {
        return null;
      }
      isFrameworkComponent(_) {
        return false;
      }
      getDocLink(path) {
        return this.baseDocLink + (path ? "/" + path : "");
      }
    };
    function createGridApi(context) {
      return {
        beanName: "gridApi",
        bean: context.getBean("apiFunctionSvc").api
      };
    }
    var orderedCoreBeans = [
      // Validate license first
      "licenseManager",
      // core beans only
      "environment",
      "eventSvc",
      "gos",
      "paginationAutoPageSizeSvc",
      "apiFunctionSvc",
      "gridApi",
      "registry",
      "agCompUtils",
      "userCompFactory",
      "rowContainerHeight",
      "horizontalResizeSvc",
      "localeSvc",
      "pinnedRowModel",
      "dragSvc",
      "colGroupSvc",
      "visibleCols",
      "popupSvc",
      "selectionSvc",
      "colFilter",
      "quickFilter",
      "filterManager",
      "colModel",
      "headerNavigation",
      "pageBounds",
      "pagination",
      "pageBoundsListener",
      "rowSpanSvc",
      "stickyRowSvc",
      "rowRenderer",
      "expressionSvc",
      "alignedGridsSvc",
      "navigation",
      "valueCache",
      "valueSvc",
      "autoWidthCalc",
      "filterMenuFactory",
      "dragAndDrop",
      "focusSvc",
      "cellNavigation",
      "cellStyles",
      "scrollVisibleSvc",
      "sortSvc",
      "colHover",
      "colAnimation",
      "autoColSvc",
      "selectionColSvc",
      "changeDetectionSvc",
      "animationFrameSvc",
      "undoRedo",
      "colDefFactory",
      "rowStyleSvc",
      "rowNodeBlockLoader",
      "rowNodeSorter",
      "ctrlsSvc",
      "pinnedCols",
      "dataTypeSvc",
      "syncSvc",
      "overlays",
      "stateSvc",
      "expansionSvc",
      "apiEventSvc",
      "ariaAnnounce",
      "menuSvc",
      "colMoves",
      "colAutosize",
      "colFlex",
      "colResize",
      "pivotColsSvc",
      "valueColsSvc",
      "rowGroupColsSvc",
      "colNames",
      "colViewport",
      "pivotResultCols",
      "showRowGroupCols",
      "validation"
      // Have validations run last
    ];
    var beanNamePosition = Object.fromEntries(
      orderedCoreBeans.map((beanName, index) => [beanName, index])
    );
    function gridBeanInitComparator(bean1, bean2) {
      const index1 = (bean1.beanName ? beanNamePosition[bean1.beanName] : void 0) ?? Number.MAX_SAFE_INTEGER;
      const index2 = (bean2.beanName ? beanNamePosition[bean2.beanName] : void 0) ?? Number.MAX_SAFE_INTEGER;
      return index1 - index2;
    }
    function gridBeanDestroyComparator(bean1, bean2) {
      if (bean1?.beanName === "gridDestroySvc") {
        return -1;
      }
      if (bean2?.beanName === "gridDestroySvc") {
        return 1;
      }
      return 0;
    }
    var GridCtrl = class extends BeanStub {
      constructor() {
        super(...arguments);
        this.additionalFocusableContainers = /* @__PURE__ */ new Set();
      }
      setComp(view, eGridDiv, eGui) {
        this.view = view;
        this.eGridHostDiv = eGridDiv;
        this.eGui = eGui;
        this.eGui.setAttribute("grid-id", this.beans.context.getId());
        const { dragAndDrop, ctrlsSvc } = this.beans;
        dragAndDrop?.registerGridDropTarget(() => this.eGui, this);
        this.createManagedBean(new LayoutFeature(this.view));
        this.view.setRtlClass(this.gos.get("enableRtl") ? "ag-rtl" : "ag-ltr");
        const unsubscribeFromResize = _observeResize(this.beans, this.eGridHostDiv, this.onGridSizeChanged.bind(this));
        this.addDestroyFunc(() => unsubscribeFromResize());
        ctrlsSvc.register("gridCtrl", this);
      }
      isDetailGrid() {
        const el2 = _findTabbableParent(this.getGui());
        return el2?.getAttribute("row-id")?.startsWith("detail") || false;
      }
      getOptionalSelectors() {
        const beans = this.beans;
        return {
          paginationSelector: beans.pagination?.getPaginationSelector(),
          gridHeaderDropZonesSelector: beans.registry?.getSelector("AG-GRID-HEADER-DROP-ZONES"),
          sideBarSelector: beans.sideBar?.getSelector(),
          statusBarSelector: beans.registry?.getSelector("AG-STATUS-BAR"),
          watermarkSelector: beans.licenseManager?.getWatermarkSelector()
        };
      }
      onGridSizeChanged() {
        this.eventSvc.dispatchEvent({
          type: "gridSizeChanged",
          clientWidth: this.eGridHostDiv.clientWidth,
          clientHeight: this.eGridHostDiv.clientHeight
        });
      }
      destroyGridUi() {
        this.view.destroyGridUi();
      }
      getGui() {
        return this.eGui;
      }
      setResizeCursor(direction) {
        const { view } = this;
        if (direction === false) {
          view.setCursor(null);
        } else {
          const cursor = direction === 1 ? "ew-resize" : "ns-resize";
          view.setCursor(cursor);
        }
      }
      disableUserSelect(on) {
        this.view.setUserSelect(on ? "none" : null);
      }
      focusNextInnerContainer(backwards) {
        const focusableContainers = this.getFocusableContainers();
        const { indexWithFocus, nextIndex } = this.getNextFocusableIndex(focusableContainers, backwards);
        if (nextIndex < 0 || nextIndex >= focusableContainers.length) {
          return false;
        }
        if (nextIndex === 0) {
          if (indexWithFocus > 0) {
            const { visibleCols, focusSvc } = this.beans;
            const allColumns = visibleCols.allCols;
            const lastColumn = _last(allColumns);
            if (focusSvc.focusGridView({ column: lastColumn, backwards: true })) {
              return true;
            }
          }
          return false;
        }
        return this.focusContainer(focusableContainers[nextIndex], backwards);
      }
      focusInnerElement(fromBottom) {
        const userCallbackFunction = this.gos.getCallback("focusGridInnerElement");
        if (userCallbackFunction?.({ fromBottom: !!fromBottom })) {
          return true;
        }
        const focusableContainers = this.getFocusableContainers();
        const { focusSvc, visibleCols } = this.beans;
        const allColumns = visibleCols.allCols;
        if (fromBottom) {
          if (focusableContainers.length > 1) {
            return this.focusContainer(_last(focusableContainers), fromBottom);
          }
          const lastColumn = _last(allColumns);
          if (focusSvc.focusGridView({ column: lastColumn, backwards: fromBottom })) {
            return true;
          }
        }
        if (this.gos.get("headerHeight") === 0 || _isHeaderFocusSuppressed(this.beans)) {
          if (focusSvc.focusGridView({ column: allColumns[0], backwards: fromBottom })) {
            return true;
          }
          for (let i2 = 1; i2 < focusableContainers.length; i2++) {
            if (_focusInto(focusableContainers[i2].getGui(), fromBottom)) {
              return true;
            }
          }
          return false;
        }
        return focusSvc.focusFirstHeader();
      }
      forceFocusOutOfContainer(up = false) {
        this.view.forceFocusOutOfContainer(up);
      }
      addFocusableContainer(container2) {
        this.additionalFocusableContainers.add(container2);
      }
      removeFocusableContainer(container2) {
        this.additionalFocusableContainers.delete(container2);
      }
      allowFocusForNextCoreContainer(up) {
        const coreContainers = this.view.getFocusableContainers();
        const { nextIndex, indexWithFocus } = this.getNextFocusableIndex(coreContainers, up);
        if (indexWithFocus === -1 || nextIndex < 0 || nextIndex >= coreContainers.length) {
          return;
        }
        const comp2 = coreContainers[nextIndex];
        comp2.setAllowFocus?.(true);
        setTimeout(() => {
          comp2.setAllowFocus?.(false);
        });
      }
      isFocusable() {
        const beans = this.beans;
        return !_isCellFocusSuppressed(beans) || !_isHeaderFocusSuppressed(beans) || !!beans.sideBar?.comp?.isDisplayed();
      }
      getNextFocusableIndex(focusableContainers, backwards) {
        const activeEl = _getActiveDomElement(this.beans);
        const indexWithFocus = focusableContainers.findIndex((container2) => container2.getGui().contains(activeEl));
        const nextIndex = indexWithFocus + (backwards ? -1 : 1);
        return {
          indexWithFocus,
          nextIndex
        };
      }
      focusContainer(comp2, up) {
        comp2.setAllowFocus?.(true);
        const result2 = _focusInto(comp2.getGui(), up, false, true);
        comp2.setAllowFocus?.(false);
        return result2;
      }
      getFocusableContainers() {
        return [...this.view.getFocusableContainers(), ...this.additionalFocusableContainers];
      }
      destroy() {
        this.additionalFocusableContainers.clear();
        super.destroy();
      }
    };
    var mod = (moduleName, input2) => {
      for (const key2 of Object.keys(input2)) {
        input2[key2] = moduleName;
      }
      return input2;
    };
    var gridApiFunctionsMap = {
      dispatchEvent: "CommunityCore",
      // this is always registered
      ...mod("CommunityCore", {
        destroy: 0,
        getGridId: 0,
        getGridOption: 0,
        isDestroyed: 0,
        setGridOption: 0,
        updateGridOptions: 0,
        isModuleRegistered: 0
      }),
      ...mod("GridState", {
        getState: 0,
        setState: 0
      }),
      ...mod("SharedRowSelection", {
        setNodesSelected: 0,
        selectAll: 0,
        deselectAll: 0,
        selectAllFiltered: 0,
        deselectAllFiltered: 0,
        selectAllOnCurrentPage: 0,
        deselectAllOnCurrentPage: 0,
        getSelectedNodes: 0,
        getSelectedRows: 0
      }),
      ...mod("RowApi", {
        redrawRows: 0,
        setRowNodeExpanded: 0,
        getRowNode: 0,
        addRenderedRowListener: 0,
        getRenderedNodes: 0,
        forEachNode: 0,
        getFirstDisplayedRowIndex: 0,
        getLastDisplayedRowIndex: 0,
        getDisplayedRowAtIndex: 0,
        getDisplayedRowCount: 0
      }),
      ...mod("ScrollApi", {
        getVerticalPixelRange: 0,
        getHorizontalPixelRange: 0,
        ensureColumnVisible: 0,
        ensureIndexVisible: 0,
        ensureNodeVisible: 0
      }),
      ...mod("KeyboardNavigation", {
        getFocusedCell: 0,
        clearFocusedCell: 0,
        setFocusedCell: 0,
        tabToNextCell: 0,
        tabToPreviousCell: 0,
        setFocusedHeader: 0
      }),
      ...mod("EventApi", {
        addEventListener: 0,
        addGlobalListener: 0,
        removeEventListener: 0,
        removeGlobalListener: 0
      }),
      ...mod("ValueCache", {
        expireValueCache: 0
      }),
      ...mod("CellApi", {
        getCellValue: 0
      }),
      ...mod("SharedMenu", {
        showColumnMenu: 0,
        hidePopupMenu: 0
      }),
      ...mod("Sort", {
        onSortChanged: 0
      }),
      ...mod("PinnedRow", {
        getPinnedTopRowCount: 0,
        getPinnedBottomRowCount: 0,
        getPinnedTopRow: 0,
        getPinnedBottomRow: 0,
        forEachPinnedRow: 0
      }),
      ...mod("Overlay", {
        showLoadingOverlay: 0,
        showNoRowsOverlay: 0,
        hideOverlay: 0
      }),
      ...mod("RenderApi", {
        setGridAriaProperty: 0,
        refreshCells: 0,
        refreshHeader: 0,
        isAnimationFrameQueueEmpty: 0,
        flushAllAnimationFrames: 0,
        getSizesForCurrentTheme: 0,
        getCellRendererInstances: 0
      }),
      ...mod("HighlightChanges", {
        flashCells: 0
      }),
      ...mod("RowDrag", {
        addRowDropZone: 0,
        removeRowDropZone: 0,
        getRowDropZoneParams: 0,
        getRowDropPositionIndicator: 0,
        setRowDropPositionIndicator: 0
      }),
      ...mod("ColumnApi", {
        getColumnDefs: 0,
        getColumnDef: 0,
        getDisplayNameForColumn: 0,
        getColumn: 0,
        getColumns: 0,
        applyColumnState: 0,
        getColumnState: 0,
        resetColumnState: 0,
        isPinning: 0,
        isPinningLeft: 0,
        isPinningRight: 0,
        getDisplayedColAfter: 0,
        getDisplayedColBefore: 0,
        setColumnsVisible: 0,
        setColumnsPinned: 0,
        getAllGridColumns: 0,
        getDisplayedLeftColumns: 0,
        getDisplayedCenterColumns: 0,
        getDisplayedRightColumns: 0,
        getAllDisplayedColumns: 0,
        getAllDisplayedVirtualColumns: 0
      }),
      ...mod("ColumnAutoSize", {
        sizeColumnsToFit: 0,
        autoSizeColumns: 0,
        autoSizeAllColumns: 0
      }),
      ...mod("ColumnGroup", {
        setColumnGroupOpened: 0,
        getColumnGroup: 0,
        getProvidedColumnGroup: 0,
        getDisplayNameForColumnGroup: 0,
        getColumnGroupState: 0,
        setColumnGroupState: 0,
        resetColumnGroupState: 0,
        getLeftDisplayedColumnGroups: 0,
        getCenterDisplayedColumnGroups: 0,
        getRightDisplayedColumnGroups: 0,
        getAllDisplayedColumnGroups: 0
      }),
      ...mod("ColumnMove", {
        moveColumnByIndex: 0,
        moveColumns: 0
      }),
      ...mod("ColumnResize", {
        setColumnWidths: 0
      }),
      ...mod("ColumnHover", {
        isColumnHovered: 0
      }),
      ...mod("EditCore", {
        getCellEditorInstances: 0,
        getEditingCells: 0,
        getEditRowValues: 0,
        stopEditing: 0,
        startEditingCell: 0,
        isEditing: 0,
        validateEdit: 0
      }),
      ...mod("BatchEdit", {
        startBatchEdit: 0,
        cancelBatchEdit: 0,
        commitBatchEdit: 0,
        isBatchEditing: 0
      }),
      ...mod("UndoRedoEdit", {
        undoCellEditing: 0,
        redoCellEditing: 0,
        getCurrentUndoSize: 0,
        getCurrentRedoSize: 0
      }),
      ...mod("FilterCore", {
        isAnyFilterPresent: 0,
        onFilterChanged: 0
      }),
      ...mod("ColumnFilter", {
        isColumnFilterPresent: 0,
        getColumnFilterInstance: 0,
        destroyFilter: 0,
        setFilterModel: 0,
        getFilterModel: 0,
        getColumnFilterModel: 0,
        setColumnFilterModel: 0,
        showColumnFilter: 0,
        hideColumnFilter: 0,
        getColumnFilterHandler: 0,
        doFilterAction: 0
      }),
      ...mod("QuickFilter", {
        isQuickFilterPresent: 0,
        getQuickFilter: 0,
        resetQuickFilter: 0
      }),
      ...mod("Find", {
        findGetActiveMatch: 0,
        findGetTotalMatches: 0,
        findGoTo: 0,
        findNext: 0,
        findPrevious: 0,
        findGetNumMatches: 0,
        findGetParts: 0,
        findClearActive: 0,
        findRefresh: 0
      }),
      ...mod("Pagination", {
        paginationIsLastPageFound: 0,
        paginationGetPageSize: 0,
        paginationGetCurrentPage: 0,
        paginationGetTotalPages: 0,
        paginationGetRowCount: 0,
        paginationGoToNextPage: 0,
        paginationGoToPreviousPage: 0,
        paginationGoToFirstPage: 0,
        paginationGoToLastPage: 0,
        paginationGoToPage: 0
      }),
      ...mod("CsrmSsrmSharedApi", {
        expandAll: 0,
        collapseAll: 0
      }),
      ...mod("SsrmInfiniteSharedApi", {
        setRowCount: 0,
        getCacheBlockState: 0,
        isLastRowIndexKnown: 0
      }),
      ...mod("ClientSideRowModelApi", {
        onGroupExpandedOrCollapsed: 0,
        refreshClientSideRowModel: 0,
        isRowDataEmpty: 0,
        forEachLeafNode: 0,
        forEachNodeAfterFilter: 0,
        forEachNodeAfterFilterAndSort: 0,
        applyTransaction: 0,
        applyTransactionAsync: 0,
        flushAsyncTransactions: 0,
        getBestCostNodeSelection: 0,
        onRowHeightChanged: 0,
        resetRowHeights: 0
      }),
      ...mod("CsvExport", {
        getDataAsCsv: 0,
        exportDataAsCsv: 0
      }),
      ...mod("InfiniteRowModel", {
        refreshInfiniteCache: 0,
        purgeInfiniteCache: 0,
        getInfiniteRowCount: 0
      }),
      ...mod("AdvancedFilter", {
        getAdvancedFilterModel: 0,
        setAdvancedFilterModel: 0,
        showAdvancedFilterBuilder: 0,
        hideAdvancedFilterBuilder: 0
      }),
      ...mod("IntegratedCharts", {
        getChartModels: 0,
        getChartRef: 0,
        getChartImageDataURL: 0,
        downloadChart: 0,
        openChartToolPanel: 0,
        closeChartToolPanel: 0,
        createRangeChart: 0,
        createPivotChart: 0,
        createCrossFilterChart: 0,
        updateChart: 0,
        restoreChart: 0
      }),
      ...mod("Clipboard", {
        copyToClipboard: 0,
        cutToClipboard: 0,
        copySelectedRowsToClipboard: 0,
        copySelectedRangeToClipboard: 0,
        copySelectedRangeDown: 0,
        pasteFromClipboard: 0
      }),
      ...mod("ExcelExport", {
        getDataAsExcel: 0,
        exportDataAsExcel: 0,
        getSheetDataForExcel: 0,
        getMultipleSheetsAsExcel: 0,
        exportMultipleSheetsAsExcel: 0
      }),
      ...mod("SharedMasterDetail", {
        addDetailGridInfo: 0,
        removeDetailGridInfo: 0,
        getDetailGridInfo: 0,
        forEachDetailGridInfo: 0
      }),
      ...mod("ContextMenu", {
        showContextMenu: 0
      }),
      ...mod("ColumnMenu", {
        showColumnChooser: 0,
        hideColumnChooser: 0
      }),
      ...mod("CellSelection", {
        getCellRanges: 0,
        addCellRange: 0,
        clearRangeSelection: 0,
        clearCellSelection: 0
      }),
      ...mod("SharedRowGrouping", {
        setRowGroupColumns: 0,
        removeRowGroupColumns: 0,
        addRowGroupColumns: 0,
        getRowGroupColumns: 0,
        moveRowGroupColumn: 0
      }),
      ...mod("SharedAggregation", {
        addAggFuncs: 0,
        clearAggFuncs: 0,
        setColumnAggFunc: 0
      }),
      ...mod("SharedPivot", {
        isPivotMode: 0,
        getPivotResultColumn: 0,
        setValueColumns: 0,
        getValueColumns: 0,
        removeValueColumns: 0,
        addValueColumns: 0,
        setPivotColumns: 0,
        removePivotColumns: 0,
        addPivotColumns: 0,
        getPivotColumns: 0,
        setPivotResultColumns: 0,
        getPivotResultColumns: 0
      }),
      ...mod("ServerSideRowModelApi", {
        getServerSideSelectionState: 0,
        setServerSideSelectionState: 0,
        applyServerSideTransaction: 0,
        applyServerSideTransactionAsync: 0,
        applyServerSideRowData: 0,
        retryServerSideLoads: 0,
        flushServerSideAsyncTransactions: 0,
        refreshServerSide: 0,
        getServerSideGroupLevelState: 0,
        onRowHeightChanged: 0,
        resetRowHeights: 0
      }),
      ...mod("SideBar", {
        isSideBarVisible: 0,
        setSideBarVisible: 0,
        setSideBarPosition: 0,
        openToolPanel: 0,
        closeToolPanel: 0,
        getOpenedToolPanel: 0,
        refreshToolPanel: 0,
        isToolPanelShowing: 0,
        getToolPanelInstance: 0,
        getSideBar: 0
      }),
      ...mod("StatusBar", {
        getStatusPanel: 0
      }),
      ...mod("AiToolkit", {
        getStructuredSchema: 0
      })
    };
    var defaultFns = {
      isDestroyed: () => true,
      destroy() {
      },
      preConstruct() {
      },
      postConstruct() {
      },
      preWireBeans() {
      },
      wireBeans() {
      }
    };
    var dispatchEvent$1 = (beans, event) => beans.eventSvc.dispatchEvent(event);
    var GridApiClass = class {
    };
    Reflect.defineProperty(GridApiClass, "name", { value: "GridApi" });
    var ApiFunctionService = class extends BeanStub {
      constructor() {
        super();
        this.beanName = "apiFunctionSvc";
        this.api = new GridApiClass();
        this.fns = {
          ...defaultFns,
          // dispatchEvent is used by frameworks, also used by aligned grids to identify a grid api instance
          dispatchEvent: dispatchEvent$1
        };
        this.preDestroyLink = "";
        const { api: api2 } = this;
        for (const key2 of Object.keys(gridApiFunctionsMap)) {
          api2[key2] = this.makeApi(key2)[key2];
        }
      }
      postConstruct() {
        this.preDestroyLink = this.beans.frameworkOverrides.getDocLink("grid-lifecycle/#grid-pre-destroyed");
      }
      addFunction(functionName, func) {
        const { fns, beans } = this;
        if (fns !== defaultFns) {
          fns[functionName] = beans?.validation?.validateApiFunction(functionName, func) ?? func;
        }
      }
      makeApi(apiName) {
        return {
          [apiName]: (...args2) => {
            const {
              beans,
              fns: { [apiName]: fn2 }
            } = this;
            return fn2 ? fn2(beans, ...args2) : this.apiNotFound(apiName);
          }
        };
      }
      apiNotFound(fnName) {
        const { beans, gos, preDestroyLink } = this;
        if (!beans) {
          _warn(26, { fnName, preDestroyLink });
        } else {
          const module2 = gridApiFunctionsMap[fnName];
          if (gos.assertModuleRegistered(module2, `api.${fnName}`)) {
            _warn(27, { fnName, module: module2 });
          }
        }
      }
      destroy() {
        super.destroy();
        this.fns = defaultFns;
        this.beans = null;
      }
    };
    function getGridId(beans) {
      return beans.context.getId();
    }
    function destroy(beans) {
      beans.gridDestroySvc.destroy();
    }
    function isDestroyed(beans) {
      return beans.gridDestroySvc.destroyCalled;
    }
    function getGridOption(beans, key2) {
      return beans.gos.get(key2);
    }
    function setGridOption(beans, key2, value2) {
      updateGridOptions(beans, { [key2]: value2 });
    }
    function updateGridOptions(beans, options2) {
      beans.gos.updateGridOptions({ options: options2 });
    }
    function isModuleRegistered(beans, moduleName) {
      const withoutSuffix = moduleName.replace(/Module$/, "");
      return beans.gos.isModuleRegistered(withoutSuffix);
    }
    var DndSourceElement = { tag: "div", cls: "ag-drag-handle ag-row-drag", attrs: { draggable: "true" } };
    var DndSourceComp = class extends Component {
      constructor(rowNode, column2, eCell) {
        super(DndSourceElement);
        this.rowNode = rowNode;
        this.column = column2;
        this.eCell = eCell;
      }
      postConstruct() {
        const eGui = this.getGui();
        eGui.appendChild(_createIconNoSpan("rowDrag", this.beans, null));
        this.addGuiEventListener("mousedown", (e) => {
          e.stopPropagation();
        });
        this.addDragSource();
        this.checkVisibility();
      }
      addDragSource() {
        this.addGuiEventListener("dragstart", this.onDragStart.bind(this));
      }
      onDragStart(dragEvent) {
        const { rowNode, column: column2, eCell, gos } = this;
        const providedOnRowDrag = column2.getColDef().dndSourceOnRowDrag;
        const dataTransfer = dragEvent.dataTransfer;
        dataTransfer.setDragImage(eCell, 0, 0);
        if (providedOnRowDrag) {
          const params = _addGridCommonParams(gos, {
            rowNode,
            dragEvent
          });
          providedOnRowDrag(params);
        } else {
          try {
            const jsonData = JSON.stringify(rowNode.data);
            dataTransfer.setData("application/json", jsonData);
            dataTransfer.setData("text/plain", jsonData);
          } catch (e) {
          }
        }
      }
      checkVisibility() {
        const visible2 = this.column.isDndSource(this.rowNode);
        this.setDisplayed(visible2);
      }
    };
    function addRowDropZone(beans, params) {
      beans.rowDragSvc?.rowDragFeature?.addRowDropZone(params);
    }
    function removeRowDropZone(beans, params) {
      const activeDropTarget = beans.dragAndDrop?.findExternalZone(params.getContainer());
      if (activeDropTarget) {
        beans.dragAndDrop?.removeDropTarget(activeDropTarget);
      }
    }
    function getRowDropZoneParams(beans, events) {
      return beans.rowDragSvc?.rowDragFeature?.getRowDropZone(events);
    }
    function getRowDropPositionIndicator(beans) {
      const rowDropHighlightSvc = beans.rowDropHighlightSvc;
      return rowDropHighlightSvc ? { row: rowDropHighlightSvc.row, dropIndicatorPosition: rowDropHighlightSvc.position } : { row: null, dropIndicatorPosition: "none" };
    }
    function setRowDropPositionIndicator(beans, params) {
      const rowDropHighlightSvc = beans.rowDropHighlightSvc;
      if (!rowDropHighlightSvc) {
        return;
      }
      const rowNode = params?.row;
      let position = params?.dropIndicatorPosition;
      if (position !== "above" && position !== "below" && position !== "inside") {
        position = "none";
      }
      const rowIndex = rowNode?.rowIndex;
      if (rowIndex === null || rowIndex === void 0 || position === "none") {
        rowDropHighlightSvc.clear();
      } else {
        rowDropHighlightSvc.set(rowNode, position);
      }
    }
    var DragService = class extends BaseDragService {
      shouldPreventMouseEvent(mouseEvent) {
        const isEnableCellTextSelect = this.gos.get("enableCellTextSelection");
        return isEnableCellTextSelect && super.shouldPreventMouseEvent(mouseEvent);
      }
    };
    var HorizontalResizeService = class extends BeanStub {
      constructor() {
        super(...arguments);
        this.beanName = "horizontalResizeSvc";
      }
      addResizeBar(params) {
        const dragSource = {
          dragStartPixels: params.dragStartPixels || 0,
          eElement: params.eResizeBar,
          onDragStart: this.onDragStart.bind(this, params),
          onDragStop: this.onDragStop.bind(this, params),
          onDragging: this.onDragging.bind(this, params),
          onDragCancel: this.onDragStop.bind(this, params),
          includeTouch: true,
          stopPropagationForTouch: true
        };
        const { dragSvc } = this.beans;
        dragSvc.addDragSource(dragSource);
        const finishedWithResizeFunc = () => dragSvc.removeDragSource(dragSource);
        return finishedWithResizeFunc;
      }
      onDragStart(params, mouseEvent) {
        this.dragStartX = mouseEvent.clientX;
        this.setResizeIcons();
        const shiftKey = mouseEvent instanceof MouseEvent && mouseEvent.shiftKey === true;
        params.onResizeStart(shiftKey);
      }
      setResizeIcons() {
        const ctrl = this.beans.ctrlsSvc.get("gridCtrl");
        ctrl.setResizeCursor(
          1
          /* Horizontal */
        );
        ctrl.disableUserSelect(true);
      }
      onDragStop(params) {
        params.onResizeEnd(this.resizeAmount);
        this.resetIcons();
      }
      resetIcons() {
        const ctrl = this.beans.ctrlsSvc.get("gridCtrl");
        ctrl.setResizeCursor(false);
        ctrl.disableUserSelect(false);
      }
      onDragging(params, mouseEvent) {
        this.resizeAmount = mouseEvent.clientX - this.dragStartX;
        params.onResizing(this.resizeAmount);
      }
    };
    var RowDragElement = {
      tag: "div",
      cls: "ag-drag-handle ag-row-drag",
      attrs: { "aria-hidden": "true" }
    };
    var RowDragComp = class extends Component {
      constructor(cellValueFn, rowNode, column2, customGui, dragStartPixels, alwaysVisible = false) {
        super();
        this.cellValueFn = cellValueFn;
        this.rowNode = rowNode;
        this.column = column2;
        this.customGui = customGui;
        this.dragStartPixels = dragStartPixels;
        this.alwaysVisible = alwaysVisible;
        this.dragSource = null;
      }
      isCustomGui() {
        return this.customGui != null;
      }
      postConstruct() {
        const { beans, customGui } = this;
        if (customGui) {
          this.setDragElement(customGui, this.dragStartPixels);
        } else {
          this.setTemplate(RowDragElement);
          this.getGui().appendChild(_createIconNoSpan("rowDrag", beans, null));
          this.addDragSource();
        }
        if (!this.alwaysVisible) {
          this.initCellDrag();
        }
      }
      initCellDrag() {
        const { beans, gos, rowNode } = this;
        const refreshVisibility = this.refreshVisibility.bind(this);
        this.addManagedPropertyListener("suppressRowDrag", refreshVisibility);
        this.addManagedListeners(rowNode, {
          dataChanged: refreshVisibility,
          cellChanged: refreshVisibility
        });
        this.addManagedListeners(
          beans.eventSvc,
          // For managed row drag, we do not show the component if sort, filter or grouping is active
          gos.get("rowDragManaged") ? {
            sortChanged: refreshVisibility,
            filterChanged: refreshVisibility,
            columnRowGroupChanged: refreshVisibility,
            newColumnsLoaded: refreshVisibility
          } : { newColumnsLoaded: refreshVisibility }
        );
      }
      setDragElement(dragElement, dragStartPixels) {
        this.setTemplateFromElement(dragElement, void 0, void 0, true);
        this.addDragSource(dragStartPixels);
      }
      refreshVisibility() {
        if (this.alwaysVisible) {
          return;
        }
        const displayedOptions = { skipAriaHidden: true };
        if (this.isNeverDisplayed()) {
          this.setDisplayed(false, displayedOptions);
          return;
        }
        const column2 = this.column;
        let shownSometimes = typeof column2?.getColDef().rowDrag === "function";
        let visible2 = !column2 || this.isCustomGui() || column2.isRowDrag(this.rowNode);
        if (visible2 && this.rowNode.footer && this.gos.get("rowDragManaged")) {
          visible2 = false;
          shownSometimes = true;
        }
        this.setDisplayed(shownSometimes || visible2, displayedOptions);
        this.setVisible(visible2, displayedOptions);
      }
      isNeverDisplayed() {
        const { gos, beans } = this;
        if (gos.get("suppressRowDrag")) {
          return true;
        }
        if (gos.get("rowDragManaged") && !!beans.rowDragSvc.rowDragFeature?.shouldPreventRowMove() && !beans.dragAndDrop?.hasExternalDropZones()) {
          return true;
        }
        return false;
      }
      getSelectedNodes() {
        const rowNode = this.rowNode;
        const isRowDragMultiRow = this.gos.get("rowDragMultiRow");
        if (!isRowDragMultiRow) {
          return [rowNode];
        }
        const selection = this.beans.selectionSvc?.getSelectedNodes() ?? [];
        return selection.indexOf(rowNode) !== -1 ? selection : [rowNode];
      }
      getDragItem() {
        const { column: column2, rowNode } = this;
        return {
          rowNode,
          rowNodes: this.getSelectedNodes(),
          columns: column2 ? [column2] : void 0,
          defaultTextValue: this.cellValueFn()
        };
      }
      getRowDragText(column2) {
        if (column2) {
          const colDef = column2.getColDef();
          if (colDef.rowDragText) {
            return colDef.rowDragText;
          }
        }
        return this.gos.get("rowDragText");
      }
      addDragSource(dragStartPixels = 4) {
        if (this.dragSource) {
          this.removeDragSource();
        }
        if (this.gos.get("rowDragManaged") && this.rowNode.footer) {
          return;
        }
        const eGui = this.getGui();
        if (this.gos.get("enableCellTextSelection")) {
          this.removeMouseDownListener();
          this.mouseDownListener = this.addManagedElementListeners(eGui, {
            mousedown: (e) => {
              e?.preventDefault();
            }
          })[0];
        }
        const translate = this.getLocaleTextFunc();
        this.dragSource = {
          type: 2,
          eElement: eGui,
          dragItemName: (draggingEvent) => {
            const dragItem = draggingEvent?.dragItem || this.getDragItem();
            const dragItemCount = (draggingEvent?.dropTarget?.rows.length ?? dragItem.rowNodes?.length) || 1;
            const rowDragText = this.getRowDragText(this.column);
            if (rowDragText) {
              return rowDragText(dragItem, dragItemCount);
            }
            return dragItemCount === 1 ? this.cellValueFn() : `${dragItemCount} ${translate("rowDragRows", "rows")}`;
          },
          getDragItem: () => this.getDragItem(),
          dragStartPixels,
          dragSourceDomDataKey: this.gos.getDomDataKey()
        };
        this.beans.dragAndDrop.addDragSource(this.dragSource, true);
      }
      destroy() {
        this.removeDragSource();
        this.removeMouseDownListener();
        super.destroy();
      }
      removeDragSource() {
        if (!this.dragSource) {
          return;
        }
        this.beans.dragAndDrop.removeDragSource(this.dragSource);
        this.dragSource = null;
      }
      removeMouseDownListener() {
        if (!this.mouseDownListener) {
          return;
        }
        this.mouseDownListener();
        this.mouseDownListener = void 0;
      }
    };
    var ChangedRowNodes = class {
      constructor() {
        this.reordered = false;
        this.removals = /* @__PURE__ */ new Set();
        this.updates = /* @__PURE__ */ new Set();
        this.adds = /* @__PURE__ */ new Set();
      }
    };
    function _createCellId(cellPosition) {
      const { rowIndex, rowPinned, column: column2 } = cellPosition;
      return `${rowIndex}.${rowPinned == null ? "null" : rowPinned}.${column2.getId()}`;
    }
    function _areCellsEqual(cellA, cellB) {
      const colsMatch = cellA.column === cellB.column;
      const floatingMatch = cellA.rowPinned === cellB.rowPinned;
      const indexMatch = cellA.rowIndex === cellB.rowIndex;
      return colsMatch && floatingMatch && indexMatch;
    }
    function _isRowBefore(rowA, rowB) {
      switch (rowA.rowPinned) {
        case "top":
          if (rowB.rowPinned !== "top") {
            return true;
          }
          break;
        case "bottom":
          if (rowB.rowPinned !== "bottom") {
            return false;
          }
          break;
        default:
          if (_exists(rowB.rowPinned)) {
            return rowB.rowPinned !== "top";
          }
          break;
      }
      return rowA.rowIndex < rowB.rowIndex;
    }
    function _isSameRow(rowA, rowB) {
      if (!rowA && !rowB) {
        return true;
      }
      if (rowA && !rowB || !rowA && rowB) {
        return false;
      }
      return rowA.rowIndex === rowB.rowIndex && rowA.rowPinned == rowB.rowPinned;
    }
    function _getFirstRow(beans) {
      let rowIndex = 0;
      let rowPinned;
      const { pinnedRowModel, rowModel, pageBounds } = beans;
      if (pinnedRowModel?.getPinnedTopRowCount()) {
        rowPinned = "top";
      } else if (rowModel.getRowCount()) {
        rowPinned = null;
        rowIndex = pageBounds.getFirstRow();
      } else if (pinnedRowModel?.getPinnedBottomRowCount()) {
        rowPinned = "bottom";
      }
      return rowPinned === void 0 ? null : { rowIndex, rowPinned };
    }
    function _getLastRow(beans) {
      let rowIndex;
      let rowPinned = null;
      const { pinnedRowModel, pageBounds } = beans;
      const pinnedBottomCount = pinnedRowModel?.getPinnedBottomRowCount();
      const pinnedTopCount = pinnedRowModel?.getPinnedTopRowCount();
      if (pinnedBottomCount) {
        rowPinned = "bottom";
        rowIndex = pinnedBottomCount - 1;
      } else if (beans.rowModel.getRowCount()) {
        rowIndex = pageBounds.getLastRow();
      } else if (pinnedTopCount) {
        rowPinned = "top";
        rowIndex = pinnedTopCount - 1;
      }
      return rowIndex === void 0 ? null : { rowIndex, rowPinned };
    }
    function _getRowNode(beans, gridRow) {
      switch (gridRow.rowPinned) {
        case "top":
          return beans.pinnedRowModel?.getPinnedTopRow(gridRow.rowIndex);
        case "bottom":
          return beans.pinnedRowModel?.getPinnedBottomRow(gridRow.rowIndex);
        default:
          return beans.rowModel.getRow(gridRow.rowIndex);
      }
    }
    function _getCellByPosition(beans, cellPosition) {
      const spannedCellCtrl = beans.spannedRowRenderer?.getCellByPosition(cellPosition);
      if (spannedCellCtrl) {
        return spannedCellCtrl;
      }
      const rowCtrl = beans.rowRenderer.getRowByPosition(cellPosition);
      if (!rowCtrl) {
        return null;
      }
      return rowCtrl.getCellCtrl(cellPosition.column);
    }
    function _getRowById(beans, rowId, rowPinned) {
      const { rowModel: rm2, pinnedRowModel: prm } = beans;
      let node2;
      node2 ?? (node2 = rm2?.getRowNode(rowId));
      if (rowPinned) {
        node2 ?? (node2 = prm?.getPinnedRowById(rowId, rowPinned));
      } else {
        node2 ?? (node2 = prm?.getPinnedRowById(rowId, "top"));
        node2 ?? (node2 = prm?.getPinnedRowById(rowId, "bottom"));
      }
      return node2;
    }
    function _getRowAbove(beans, rowPosition, checkSticky = false) {
      const { rowIndex: index, rowPinned: pinned } = rowPosition;
      const { pageBounds, pinnedRowModel, rowModel } = beans;
      if (index === 0) {
        if (pinned === "top") {
          return null;
        }
        if (pinned === "bottom" && rowModel.isRowsToRender()) {
          return { rowIndex: pageBounds.getLastRow(), rowPinned: null };
        }
        return pinnedRowModel?.isRowsToRender("top") ? { rowIndex: pinnedRowModel.getPinnedTopRowCount() - 1, rowPinned: "top" } : null;
      }
      if (checkSticky) {
        const rowNode = pinned ? void 0 : rowModel.getRow(index);
        return getNextStickyPosition(beans, rowNode, true) ?? { rowIndex: index - 1, rowPinned: pinned };
      }
      return { rowIndex: index - 1, rowPinned: pinned };
    }
    function _getRowBelow(beans, rowPosition, checkSticky = false) {
      const { rowIndex: index, rowPinned: pinned } = rowPosition;
      const { pageBounds, pinnedRowModel, rowModel } = beans;
      if (isLastRowInContainer(beans, rowPosition)) {
        if (pinned === "bottom") {
          return null;
        }
        if (pinned === "top" && rowModel.isRowsToRender()) {
          return { rowIndex: pageBounds.getFirstRow(), rowPinned: null };
        }
        return pinnedRowModel?.isRowsToRender("bottom") ? { rowIndex: 0, rowPinned: "bottom" } : null;
      }
      if (checkSticky) {
        const rowNode = pinned ? void 0 : rowModel.getRow(index);
        return getNextStickyPosition(beans, rowNode) ?? { rowIndex: index + 1, rowPinned: pinned };
      }
      return { rowIndex: index + 1, rowPinned: pinned };
    }
    function getNextStickyPosition(beans, rowNode, up = false) {
      const { gos, rowRenderer } = beans;
      if (!rowNode?.sticky || !_isGroupRowsSticky(gos)) {
        return;
      }
      const stickyTopCtrls = rowRenderer.getStickyTopRowCtrls();
      const stickyBottomCtrls = rowRenderer.getStickyBottomRowCtrls();
      const isStickyTop = !stickyBottomCtrls.some((ctrl) => ctrl.rowNode.rowIndex === rowNode.rowIndex);
      const stickyRowCtrls = isStickyTop ? stickyTopCtrls : stickyBottomCtrls;
      const increment = (up ? -1 : 1) * (isStickyTop ? -1 : 1);
      let nextCtrl;
      for (let i2 = 0; i2 < stickyRowCtrls.length; i2++) {
        if (stickyRowCtrls[i2].rowNode.rowIndex === rowNode.rowIndex) {
          nextCtrl = stickyRowCtrls[i2 + increment];
          break;
        }
      }
      return nextCtrl ? { rowIndex: nextCtrl.rowNode.rowIndex, rowPinned: null } : void 0;
    }
    function isLastRowInContainer(beans, rowPosition) {
      const { rowPinned, rowIndex } = rowPosition;
      const { pinnedRowModel, pageBounds } = beans;
      if (rowPinned === "top") {
        const lastTopIndex = (pinnedRowModel?.getPinnedTopRowCount() ?? 0) - 1;
        return lastTopIndex <= rowIndex;
      }
      if (rowPinned === "bottom") {
        const lastBottomIndex = (pinnedRowModel?.getPinnedBottomRowCount() ?? 0) - 1;
        return lastBottomIndex <= rowIndex;
      }
      const lastBodyIndex = pageBounds.getLastRow();
      return lastBodyIndex <= rowIndex;
    }
    var ChangedPath = class {
      constructor(keepingColumns, rootNode) {
        this.active = true;
        this.nodeIdsToColumns = {};
        this.mapToItems = {};
        this.keepingColumns = keepingColumns;
        this.pathRoot = {
          rowNode: rootNode,
          children: null
        };
        this.mapToItems[rootNode.id] = this.pathRoot;
      }
      depthFirstSearchChangedPath(pathItem, callback) {
        const { rowNode, children: children2 } = pathItem;
        if (children2) {
          for (let i2 = 0; i2 < children2.length; ++i2) {
            this.depthFirstSearchChangedPath(children2[i2], callback);
          }
        }
        callback(rowNode);
      }
      depthFirstSearchEverything(rowNode, callback, traverseEverything) {
        const childrenAfterGroup = rowNode.childrenAfterGroup;
        if (childrenAfterGroup) {
          for (let i2 = 0, len = childrenAfterGroup.length; i2 < len; ++i2) {
            const childNode = childrenAfterGroup[i2];
            if (childNode.childrenAfterGroup) {
              this.depthFirstSearchEverything(childNode, callback, traverseEverything);
            } else if (traverseEverything) {
              callback(childNode);
            }
          }
        }
        callback(rowNode);
      }
      // traverseLeafNodes -> used when NOT doing changed path, ie traversing everything. the callback
      // will be called for child nodes in addition to parent nodes.
      forEachChangedNodeDepthFirst(callback, traverseLeafNodes = false, includeUnchangedNodes = false) {
        if (this.active && !includeUnchangedNodes) {
          this.depthFirstSearchChangedPath(this.pathRoot, callback);
        } else {
          this.depthFirstSearchEverything(this.pathRoot.rowNode, callback, traverseLeafNodes);
        }
      }
      executeFromRootNode(callback) {
        callback(this.pathRoot.rowNode);
      }
      createPathItems(rowNode) {
        let pointer = rowNode;
        let newEntryCount = 0;
        while (!this.mapToItems[pointer.id]) {
          const newEntry = {
            rowNode: pointer,
            children: null
          };
          this.mapToItems[pointer.id] = newEntry;
          newEntryCount++;
          pointer = pointer.parent;
        }
        return newEntryCount;
      }
      populateColumnsMap(rowNode, columns) {
        if (!this.keepingColumns || !columns) {
          return;
        }
        let pointer = rowNode;
        while (pointer) {
          if (!this.nodeIdsToColumns[pointer.id]) {
            this.nodeIdsToColumns[pointer.id] = {};
          }
          for (const col of columns) {
            this.nodeIdsToColumns[pointer.id][col.getId()] = true;
          }
          pointer = pointer.parent;
        }
      }
      linkPathItems(rowNode, newEntryCount) {
        let pointer = rowNode;
        for (let i2 = 0; i2 < newEntryCount; i2++) {
          const thisItem = this.mapToItems[pointer.id];
          const parentItem = this.mapToItems[pointer.parent.id];
          if (!parentItem.children) {
            parentItem.children = [];
          }
          parentItem.children.push(thisItem);
          pointer = pointer.parent;
        }
      }
      // called by
      // 1) change detection (provides cols) and
      // 2) groupStage if doing transaction update (doesn't provide cols)
      addParentNode(rowNode, columns) {
        if (!rowNode || rowNode.isRowPinned()) {
          return;
        }
        const newEntryCount = this.createPathItems(rowNode);
        this.linkPathItems(rowNode, newEntryCount);
        this.populateColumnsMap(rowNode, columns);
      }
      canSkip(rowNode) {
        return this.active && !this.mapToItems[rowNode.id];
      }
      getValueColumnsForNode(rowNode, valueColumns) {
        if (!this.keepingColumns) {
          return valueColumns;
        }
        const colsForThisNode = this.nodeIdsToColumns[rowNode.id];
        const result2 = valueColumns.filter((col) => colsForThisNode[col.getId()]);
        return result2;
      }
      getNotValueColumnsForNode(rowNode, valueColumns) {
        if (!this.keepingColumns) {
          return null;
        }
        const colsForThisNode = this.nodeIdsToColumns[rowNode.id];
        const result2 = valueColumns.filter((col) => !colsForThisNode[col.getId()]);
        return result2;
      }
    };
    var RowDragFeatureNudger = class {
      constructor(beans, gridBodyCtrl) {
        this.beans = beans;
        this.groupThrottled = false;
        this.scrollChanged = false;
        this.scrollChanging = false;
        this.oldVScroll = null;
        this.groupTimer = null;
        this.groupTarget = null;
        this.onGroupThrottle = () => {
          this.groupTimer = null;
          this.groupThrottled = true;
          this.beans.dragAndDrop?.nudge();
        };
        const getScrollY = () => gridBodyCtrl.scrollFeature.getVScrollPosition().top;
        this.autoScroll = new AutoScrollService({
          scrollContainer: gridBodyCtrl.eBodyViewport,
          scrollAxis: "y",
          getVerticalPosition: getScrollY,
          setVerticalPosition: (position) => gridBodyCtrl.scrollFeature.setVerticalScrollPosition(position),
          onScrollCallback: () => {
            const newVScroll = getScrollY();
            if (this.oldVScroll !== newVScroll) {
              this.oldVScroll = newVScroll;
              this.scrollChanging = true;
              return;
            }
            const scrollChanged = this.scrollChanging;
            this.scrollChanged = scrollChanged;
            this.scrollChanging = false;
            if (scrollChanged) {
              this.beans.dragAndDrop?.nudge();
              this.scrollChanged = false;
            }
          }
        });
      }
      updateGroup(target2, canExpand) {
        if (this.groupTarget && this.groupTarget !== target2) {
          this.clearGroup();
        }
        if (target2) {
          if (canExpand && this.groupThrottled && !target2.expanded && target2.childrenAfterSort?.length && target2.isExpandable()) {
            target2.setExpanded(true, void 0, true);
          }
          if (target2.expanded && target2.childrenAfterSort?.length) {
            this.groupThrottled = true;
            this.groupTarget = target2;
          }
        }
      }
      startGroup(target2) {
        this.groupTarget = target2;
        if (this.groupTimer === null) {
          this.groupTimer = window.setTimeout(this.onGroupThrottle, this.beans.gos.get("rowDragInsertDelay"));
        }
      }
      clearGroup() {
        this.groupThrottled = false;
        this.groupTarget = null;
        const timer = this.groupTimer;
        if (timer !== null) {
          this.groupTimer = null;
          window.clearTimeout(timer);
        }
      }
      clear() {
        this.clearGroup();
        this.autoScroll.ensureCleared();
        this.oldVScroll = null;
        this.scrollChanged = false;
        this.scrollChanging = false;
      }
    };
    var RowDragFeature = class extends BeanStub {
      constructor(eContainer) {
        super();
        this.eContainer = eContainer;
        this.lastDraggingEvent = null;
        this.nudger = null;
      }
      postConstruct() {
        const beans = this.beans;
        beans.ctrlsSvc.whenReady(this, (p) => {
          this.nudger = new RowDragFeatureNudger(beans, p.gridBodyCtrl);
        });
      }
      destroy() {
        super.destroy();
        this.nudger?.clear();
        this.nudger = null;
        this.lastDraggingEvent = null;
        this.eContainer = null;
      }
      getContainer() {
        return this.eContainer;
      }
      isInterestedIn(type) {
        return type === 2;
      }
      getIconName(draggingEvent) {
        if (draggingEvent?.dropTarget?.allowed === false) {
          return "notAllowed";
        }
        if (this.gos.get("rowDragManaged") && this.shouldPreventRowMove()) {
          return "notAllowed";
        }
        return "move";
      }
      shouldPreventRowMove() {
        const { rowGroupColsSvc, filterManager, sortSvc } = this.beans;
        const rowGroupCols = rowGroupColsSvc?.columns ?? [];
        if (rowGroupCols.length) {
          return true;
        }
        const isFilterPresent = filterManager?.isAnyFilterPresent();
        if (isFilterPresent) {
          return true;
        }
        const isSortActive = sortSvc?.isSortActive();
        if (isSortActive) {
          return true;
        }
        return false;
      }
      getRowNodes(draggingEvent) {
        if (!this.isFromThisGrid(draggingEvent)) {
          return draggingEvent.dragItem.rowNodes || [];
        }
        const currentNode = draggingEvent.dragItem.rowNode;
        if (this.gos.get("rowDragMultiRow")) {
          const selectedNodes = this.beans.selectionSvc?.getSelectedNodes();
          if (selectedNodes && selectedNodes.indexOf(currentNode) >= 0) {
            return selectedNodes.slice().sort(compareRowIndex);
          }
        }
        return [currentNode];
      }
      onDragEnter(draggingEvent) {
        this.dragging(draggingEvent, true);
      }
      onDragging(draggingEvent) {
        this.dragging(draggingEvent, false);
      }
      dragging(draggingEvent, enter) {
        const { lastDraggingEvent, beans } = this;
        if (enter) {
          const rowNodes = this.getRowNodes(draggingEvent);
          draggingEvent.dragItem.rowNodes = rowNodes;
          setRowNodesDragging(rowNodes, true);
        }
        this.lastDraggingEvent = draggingEvent;
        const fromNudge = draggingEvent.fromNudge;
        const rowsDrop = this.makeRowsDrop(lastDraggingEvent, draggingEvent, fromNudge, false);
        beans.rowDropHighlightSvc?.fromDrag(draggingEvent);
        if (enter) {
          this.dispatchGridEvent("rowDragEnter", draggingEvent);
        }
        this.dispatchGridEvent("rowDragMove", draggingEvent);
        if (rowsDrop?.rowDragManaged && rowsDrop.moved && rowsDrop.allowed && rowsDrop.sameGrid && !rowsDrop.suppressMoveWhenRowDragging && // Avoid flickering by only dropping while auto-scrolling is not happening
        (!fromNudge && !this.nudger?.autoScroll.scrolling || this.nudger?.scrollChanged)) {
          this.dropRows(rowsDrop);
        }
        this.nudger?.autoScroll.check(draggingEvent.event);
      }
      isFromThisGrid(draggingEvent) {
        return draggingEvent.dragSource.dragSourceDomDataKey === this.gos.getDomDataKey();
      }
      makeRowsDrop(lastDraggingEvent, draggingEvent, moving, dropping) {
        const { beans, gos } = this;
        const rowsDrop = this.newRowsDrop(draggingEvent, dropping);
        const rowModel = beans.rowModel;
        draggingEvent.dropTarget = rowsDrop;
        draggingEvent.changed = false;
        if (!rowsDrop) {
          return null;
        }
        let { sameGrid, rootNode, source: source2, target: target2, rows } = rowsDrop;
        target2 ?? (target2 = rowModel.getRow(rowModel.getRowCount() - 1) ?? null);
        const canSetParent = (
          // We don't yet support drag and drop with grouping
          !!this.beans.groupStage?.treeData && // We don't yet support moving tree rows from a different grid in a structured way
          sameGrid
        );
        let newParent = null;
        if (target2?.footer) {
          const found = getPrevOrNext(rowModel, -1, target2) ?? getPrevOrNext(rowModel, 1, target2);
          newParent = target2.sibling ?? rootNode;
          target2 = found ?? null;
        }
        if (target2?.detail) {
          target2 = target2.parent;
        }
        rowsDrop.moved && (rowsDrop.moved = source2 !== target2);
        let yDelta = 0.5;
        if (target2) {
          if (sameGrid && rowsDrop.moved && (newParent || !canSetParent)) {
            yDelta = source2.rowIndex > target2.rowIndex ? -0.5 : 0.5;
          } else {
            yDelta = (rowsDrop.y - target2.rowTop - target2.rowHeight / 2) / target2.rowHeight || 0;
          }
        }
        if (!canSetParent && sameGrid && target2 && rowsDrop.moved && _isClientSideRowModel(gos)) {
          const newTarget = deltaDraggingTarget(rowModel, rowsDrop);
          if (newTarget) {
            yDelta = source2.rowIndex > newTarget.rowIndex ? -0.5 : 0.5;
            target2 = newTarget;
            rowsDrop.moved && (rowsDrop.moved = source2 !== target2);
          }
        }
        const nudger = this.nudger;
        nudger?.updateGroup(target2, moving);
        if (canSetParent && !newParent && nudger) {
          if (!target2 || yDelta >= 0.5 && target2.rowIndex === beans.pageBounds.getLastRow()) {
            newParent = rootNode;
          } else if (rowsDrop.moved && this.targetShouldBeParent(target2, yDelta, rows)) {
            if (nudger.groupThrottled) {
              newParent = target2;
            }
            if (!moving && (!newParent || target2 && !target2.expanded && !!target2.childrenAfterSort?.length)) {
              nudger.startGroup(target2);
            }
          }
          newParent ?? (newParent = target2?.parent ?? rootNode);
        }
        let inside2 = false;
        if (newParent) {
          if (newParent === target2 && newParent !== rootNode) {
            const firstRow = newParent.expanded ? getPrevOrNext(rowModel, 1, target2) : null;
            if (firstRow?.parent === newParent) {
              target2 = firstRow;
              yDelta = -0.5;
            } else {
              inside2 = true;
            }
          }
          if (target2 && !inside2) {
            let current2 = target2;
            while (current2 && current2 !== rootNode && current2 !== newParent) {
              target2 = current2;
              current2 = current2.parent;
            }
          }
        }
        rowsDrop.target = target2;
        rowsDrop.newParent = newParent;
        rowsDrop.moved && (rowsDrop.moved = source2 !== target2);
        const aboveOrBelow = yDelta < 0 ? "above" : "below";
        rowsDrop.position = rowsDrop.moved ? inside2 ? "inside" : aboveOrBelow : "none";
        this.validateRowsDrop(rowsDrop, canSetParent, aboveOrBelow, dropping);
        draggingEvent.changed || (draggingEvent.changed = rowsDropChanged(lastDraggingEvent?.dropTarget, rowsDrop));
        return rowsDrop;
      }
      newRowsDrop(draggingEvent, dropping) {
        const { beans, gos } = this;
        const rootNode = beans.rowModel.rootNode;
        const rowDragManaged = _isClientSideRowModel(gos) ? gos.get("rowDragManaged") : false;
        const suppressMoveWhenRowDragging = gos.get("suppressMoveWhenRowDragging");
        const sameGrid = this.isFromThisGrid(draggingEvent);
        let { rowNode: source2, rowNodes: rows } = draggingEvent.dragItem;
        rows || (rows = source2 ? [source2] : []);
        source2 || (source2 = rows[0]);
        if (!source2 || !rootNode) {
          return null;
        }
        const withinGrid = this.beans.dragAndDrop.isDropZoneWithinThisGrid(draggingEvent);
        let allowed = true;
        if (rowDragManaged && (!rows.length || this.shouldPreventRowMove() || (suppressMoveWhenRowDragging || !sameGrid) && !withinGrid)) {
          allowed = false;
        }
        const y = _getNormalisedMousePosition(beans, draggingEvent).y;
        const overNode = this.getOverNode(y);
        return {
          api: beans.gridApi,
          context: beans.gridOptions.context,
          draggingEvent,
          rowDragManaged,
          suppressMoveWhenRowDragging,
          sameGrid,
          withinGrid,
          rootNode,
          moved: source2 !== overNode,
          y,
          overNode,
          overIndex: overNode?.rowIndex ?? -1,
          position: "none",
          source: source2,
          target: overNode ?? null,
          newParent: null,
          rows,
          allowed,
          highlight: !dropping && rowDragManaged && suppressMoveWhenRowDragging && (withinGrid || !sameGrid)
        };
      }
      validateRowsDrop(rowsDrop, canSetParent, aboveOrBelow, dropping) {
        const { rowDragManaged, suppressMoveWhenRowDragging } = rowsDrop;
        if (!canSetParent) {
          rowsDrop.newParent = null;
        }
        if (suppressMoveWhenRowDragging && !rowsDrop.moved) {
          rowsDrop.allowed = false;
        }
        const isRowValidDropPosition = (!rowDragManaged || rowsDrop.allowed) && this.gos.get("isRowValidDropPosition");
        if (isRowValidDropPosition) {
          if (canSetParent && rowsDrop.newParent && rowsHaveSameParent(rowsDrop.rows, rowsDrop.newParent)) {
            rowsDrop.newParent = null;
          }
          const canDropResult = isRowValidDropPosition(rowsDrop);
          if (!canDropResult) {
            rowsDrop.allowed = false;
          } else if (typeof canDropResult === "object") {
            if (canDropResult.rows !== void 0) {
              rowsDrop.rows = canDropResult.rows ?? [];
            }
            if (canSetParent && canDropResult.newParent !== void 0) {
              rowsDrop.newParent = canDropResult.newParent;
            }
            if (canDropResult.target !== void 0) {
              rowsDrop.target = canDropResult.target;
            }
            if (canDropResult.position) {
              rowsDrop.position = canDropResult.position;
            }
            if (canDropResult.allowed !== void 0) {
              rowsDrop.allowed = canDropResult.allowed;
            } else if (!rowDragManaged) {
              rowsDrop.allowed = true;
            }
            const draggingEvent = rowsDrop.draggingEvent;
            if (canDropResult.changed && draggingEvent) {
              draggingEvent.changed = true;
            }
            if (!dropping && canDropResult.highlight !== void 0) {
              rowsDrop.highlight = canDropResult.highlight;
            }
          }
        }
        if (rowDragManaged) {
          rowsDrop.rows = this.filterRows(rowsDrop);
        }
        if (canSetParent && rowsDrop.newParent && rowsHaveSameParent(rowsDrop.rows, rowsDrop.newParent)) {
          rowsDrop.newParent = null;
        }
        if (suppressMoveWhenRowDragging && (!rowsDrop.rows.length || rowsDrop.position === "none")) {
          rowsDrop.allowed = false;
        }
        if ((!rowsDrop.allowed || !rowsDrop.newParent) && rowsDrop.position === "inside") {
          rowsDrop.position = aboveOrBelow;
        }
      }
      targetShouldBeParent(target2, yDelta, rows) {
        const targetRowIndex = target2.rowIndex;
        const INSIDE_THRESHOLD = 0.25;
        if (yDelta < -0.5 + INSIDE_THRESHOLD) {
          return false;
        }
        if (yDelta < 0.5 - INSIDE_THRESHOLD) {
          return true;
        }
        let nextRow;
        let nextRowIndex = targetRowIndex + 1;
        const rowModel = this.beans.rowModel;
        do {
          nextRow = rowModel.getRow(nextRowIndex++);
        } while (nextRow?.footer);
        const childrenAfterGroup = target2.childrenAfterGroup;
        if (nextRow && nextRow.parent === target2 && childrenAfterGroup?.length) {
          const rowsSet = new Set(rows);
          for (const child of childrenAfterGroup) {
            if (child.rowIndex !== null && !rowsSet.has(child)) {
              return true;
            }
          }
        }
        return false;
      }
      addRowDropZone(params) {
        if (!params.getContainer()) {
          _warn(55);
          return;
        }
        const dragAndDrop = this.beans.dragAndDrop;
        if (dragAndDrop.findExternalZone(params.getContainer())) {
          _warn(56);
          return;
        }
        const processedParams = params.fromGrid ? params : {
          getContainer: params.getContainer,
          onDragEnter: params.onDragEnter && ((e) => params.onDragEnter(this.rowDragEvent("rowDragEnter", e))),
          onDragLeave: params.onDragLeave && ((e) => params.onDragLeave(this.rowDragEvent("rowDragLeave", e))),
          onDragging: params.onDragging && ((e) => params.onDragging(this.rowDragEvent("rowDragMove", e))),
          onDragStop: params.onDragStop && ((e) => params.onDragStop(this.rowDragEvent("rowDragEnd", e))),
          onDragCancel: params.onDragCancel && ((e) => params.onDragCancel(this.rowDragEvent("rowDragCancel", e)))
        };
        const dropTarget = {
          isInterestedIn: (type) => type === 2,
          getIconName: () => "move",
          external: true,
          ...processedParams
        };
        dragAndDrop.addDropTarget(dropTarget);
        this.addDestroyFunc(() => dragAndDrop.removeDropTarget(dropTarget));
      }
      getRowDropZone(events) {
        const result2 = {
          getContainer: this.getContainer.bind(this),
          onDragEnter: (e) => {
            this.onDragEnter(e);
            events?.onDragEnter?.(this.rowDragEvent("rowDragEnter", e));
          },
          onDragLeave: (e) => {
            this.onDragLeave(e);
            events?.onDragLeave?.(this.rowDragEvent("rowDragLeave", e));
          },
          onDragging: (e) => {
            this.onDragging(e);
            events?.onDragging?.(this.rowDragEvent("rowDragMove", e));
          },
          onDragStop: (e) => {
            this.onDragStop(e);
            events?.onDragStop?.(this.rowDragEvent("rowDragEnd", e));
          },
          onDragCancel: (e) => {
            this.onDragCancel(e);
            events?.onDragCancel?.(this.rowDragEvent("rowDragCancel", e));
          },
          fromGrid: true
        };
        return result2;
      }
      getOverNode(y) {
        const { pageBounds, rowModel } = this.beans;
        const mouseIsPastLastRow = y > pageBounds.getCurrentPagePixelRange().pageLastPixel;
        const overIndex = mouseIsPastLastRow ? -1 : rowModel.getRowIndexAtPixel(y);
        return overIndex >= 0 ? rowModel.getRow(overIndex) : void 0;
      }
      rowDragEvent(type, draggingEvent) {
        const beans = this.beans;
        const { dragItem, dropTarget: rowsDrop, event, vDirection } = draggingEvent;
        const withRowsDrop = rowsDrop?.rootNode === beans.rowModel.rootNode;
        const y = withRowsDrop ? rowsDrop.y : _getNormalisedMousePosition(beans, draggingEvent).y;
        const overNode = withRowsDrop ? rowsDrop.overNode : this.getOverNode(y);
        const overIndex = withRowsDrop ? rowsDrop.overIndex : overNode?.rowIndex ?? -1;
        return {
          api: beans.gridApi,
          context: beans.gridOptions.context,
          type,
          event,
          node: dragItem.rowNode,
          nodes: dragItem.rowNodes,
          overIndex,
          overNode,
          y,
          vDirection,
          rowsDrop
        };
      }
      dispatchGridEvent(type, draggingEvent) {
        const event = this.rowDragEvent(type, draggingEvent);
        this.eventSvc.dispatchEvent(event);
      }
      onDragLeave(draggingEvent) {
        this.dispatchGridEvent("rowDragLeave", draggingEvent);
        this.stopDragging(draggingEvent);
      }
      onDragStop(draggingEvent) {
        const rowsDrop = this.makeRowsDrop(this.lastDraggingEvent, draggingEvent, false, true);
        this.dispatchGridEvent("rowDragEnd", draggingEvent);
        if (rowsDrop?.allowed && rowsDrop.rowDragManaged && (rowsDrop.suppressMoveWhenRowDragging || !rowsDrop.sameGrid || this.nudger?.autoScroll.scrolling)) {
          this.dropRows(rowsDrop);
        }
        this.stopDragging(draggingEvent);
      }
      onDragCancel(draggingEvent) {
        this.dispatchGridEvent("rowDragCancel", draggingEvent);
        this.stopDragging(draggingEvent);
      }
      stopDragging(draggingEvent) {
        this.nudger?.clear();
        this.beans.rowDropHighlightSvc?.fromDrag(null);
        setRowNodesDragging(draggingEvent.dragItem.rowNodes, false);
      }
      /** Drag and drop. Returns false if at least a row was moved, otherwise true */
      dropRows(rowsDrop) {
        return rowsDrop.sameGrid ? this.csrmMoveRows(rowsDrop) : this.csrmAddRows(rowsDrop);
      }
      csrmAddRows({ position, target: target2, rows }) {
        const getRowIdFunc = _getRowIdCallback(this.gos);
        const clientSideRowModel = this.beans.rowModel;
        const add2 = rows.filter(
          ({ data, rowPinned }) => !clientSideRowModel.getRowNode(getRowIdFunc?.({ data, level: 0, rowPinned }) ?? data.id)
        ).map(({ data }) => data);
        if (add2.length === 0) {
          return false;
        }
        const addIndex = target2 ? getLeafSourceRowIndex(target2) + (position === "above" ? 0 : 1) : void 0;
        clientSideRowModel.updateRowData({ add: add2, addIndex });
        return true;
      }
      filterRows({ newParent, rows }) {
        let filtered;
        for (let i2 = 0, len = rows.length; i2 < len; ++i2) {
          let valid = true;
          const row2 = rows[i2];
          if (!row2 || row2.footer || row2.rowTop === null && row2 !== this.beans.rowModel.getRowNode(row2.id) || // This row cannot be dragged, not in allLeafChildren and not a filler
          newParent && row2.parent !== newParent && wouldFormCycle(row2, newParent) || // Cannot move to a parent that would create a cycle
          !getLeafRow(row2)) {
            valid = false;
          }
          if (valid) {
            filtered?.push(row2);
          } else {
            filtered ?? (filtered = rows.slice(0, i2));
          }
        }
        return filtered ?? rows;
      }
      csrmMoveRows({ position, target: target2, rows, newParent, rootNode }) {
        let changed = false;
        const leafs = /* @__PURE__ */ new Set();
        for (const row2 of rows) {
          if (newParent && row2.parent !== newParent) {
            row2.treeParent = newParent;
            changed = true;
          }
          const leafRow = getLeafRow(row2);
          if (leafRow) {
            leafs.add(leafRow);
          }
        }
        if (!changed && leafs.size === 0) {
          return false;
        }
        const focusSvc = this.beans.focusSvc;
        const cellPosition = focusSvc.getFocusedCell();
        const cellCtrl = cellPosition && _getCellByPosition(this.beans, cellPosition);
        if (leafs.size && this.reorderLeafChildren(leafs, ...this.getMoveRowsBounds(leafs, target2, position === "above"))) {
          changed = true;
        }
        if (!changed) {
          return false;
        }
        const clientSideRowModel = this.beans.rowModel;
        const changedRowNodes = new ChangedRowNodes();
        changedRowNodes.reordered = true;
        clientSideRowModel.refreshModel({
          step: "group",
          keepRenderedRows: true,
          animate: !this.gos.get("suppressAnimationFrame"),
          changedPath: new ChangedPath(false, rootNode),
          changedRowNodes
        });
        if (cellCtrl) {
          cellCtrl.focusCell();
        } else {
          focusSvc.clearFocusedCell();
        }
        return true;
      }
      /** For reorderLeafChildren, returns min index of the rows to move, the target index and the max index of the rows to move. */
      getMoveRowsBounds(leafs, target2, above) {
        const totalRows = this.beans.rowModel.rootNode?._leafs?.length ?? 0;
        let targetPositionIdx = target2 ? getLeafSourceRowIndex(target2) : -1;
        if (targetPositionIdx < 0 || targetPositionIdx >= totalRows) {
          targetPositionIdx = totalRows;
        } else if (!above) {
          ++targetPositionIdx;
        }
        let firstAffectedLeafIdx = targetPositionIdx;
        let lastAffectedLeafIndex = Math.min(targetPositionIdx, totalRows - 1);
        for (const row2 of leafs) {
          const sourceRowIndex = row2.sourceRowIndex;
          if (sourceRowIndex < firstAffectedLeafIdx) {
            firstAffectedLeafIdx = sourceRowIndex;
          }
          if (sourceRowIndex > lastAffectedLeafIndex) {
            lastAffectedLeafIndex = sourceRowIndex;
          }
        }
        return [firstAffectedLeafIdx, targetPositionIdx, lastAffectedLeafIndex];
      }
      /** Reorders the children of the root node, so that the rows to move are in the correct order.
       * @param leafs The valid set of rows to move, as returned by getValidRowsToMove
       * @param firstAffectedLeafIdx The first index of the rows to move
       * @param targetPositionIdx The target index, where the rows will be moved
       * @param lastAffectedLeafIndex The last index of the rows to move
       * @returns True if the order of the rows changed, false otherwise
       */
      reorderLeafChildren(leafs, firstAffectedLeafIdx, targetPositionIdx, lastAffectedLeafIndex) {
        let orderChanged = false;
        const allLeafs = this.beans.rowModel.rootNode?._leafs;
        if (!leafs.size || !allLeafs) {
          return false;
        }
        let writeIdxLeft = firstAffectedLeafIdx;
        for (let readIdx = firstAffectedLeafIdx; readIdx < targetPositionIdx; ++readIdx) {
          const row2 = allLeafs[readIdx];
          if (!leafs.has(row2)) {
            if (row2.sourceRowIndex !== writeIdxLeft) {
              row2.sourceRowIndex = writeIdxLeft;
              allLeafs[writeIdxLeft] = row2;
              orderChanged = true;
            }
            ++writeIdxLeft;
          }
        }
        let writeIdxRight = lastAffectedLeafIndex;
        for (let readIdx = lastAffectedLeafIndex; readIdx >= targetPositionIdx; --readIdx) {
          const row2 = allLeafs[readIdx];
          if (!leafs.has(row2)) {
            if (row2.sourceRowIndex !== writeIdxRight) {
              row2.sourceRowIndex = writeIdxRight;
              allLeafs[writeIdxRight] = row2;
              orderChanged = true;
            }
            --writeIdxRight;
          }
        }
        for (const row2 of leafs) {
          if (row2.sourceRowIndex !== writeIdxLeft) {
            row2.sourceRowIndex = writeIdxLeft;
            allLeafs[writeIdxLeft] = row2;
            orderChanged = true;
          }
          ++writeIdxLeft;
        }
        return orderChanged;
      }
    };
    var getPrevOrNext = (rowModel, direction, initial) => {
      if (initial) {
        const rowCount = rowModel.getRowCount();
        let rowIndex = initial.rowIndex + direction;
        while (rowIndex >= 0 && rowIndex < rowCount) {
          const row2 = rowModel.getRow(rowIndex);
          if (!row2 || !row2.footer && !row2.detail) {
            return row2;
          }
          rowIndex += direction;
        }
      }
      return void 0;
    };
    var wouldFormCycle = (row2, newParent) => {
      let parent = newParent;
      while (parent) {
        if (parent === row2) {
          return true;
        }
        parent = parent.parent;
      }
      return false;
    };
    var rowsHaveSameParent = (rows, newParent) => {
      for (let i2 = 0, len = rows.length; i2 < len; ++i2) {
        if (rows[i2].parent !== newParent) {
          return false;
        }
      }
      return true;
    };
    var getLeafSourceRowIndex = (row2) => {
      const leaf = getLeafRow(row2);
      return leaf !== void 0 ? leaf.sourceRowIndex : -1;
    };
    var getLeafRow = (row2) => row2.data ? row2 : _firstLeaf(row2.childrenAfterGroup);
    var rowsDropChanged = (a, b) => a !== b && (!a || a.sameGrid !== b.sameGrid || a.allowed !== b.allowed || a.position !== b.position || a.target !== b.target || a.source !== b.source || a.newParent !== b.newParent || !_areEqual(a.rows, b.rows));
    var compareRowIndex = ({ rowIndex: a }, { rowIndex: b }) => a !== null && b !== null ? a - b : 0;
    var setRowNodesDragging = (rowNodes, dragging) => {
      for (let i2 = 0, len = rowNodes?.length || 0; i2 < len; ++i2) {
        const rowNode = rowNodes[i2];
        if (rowNode.dragging !== dragging) {
          rowNode.dragging = dragging;
          rowNode.dispatchRowEvent("draggingChanged");
        }
      }
    };
    var deltaDraggingTarget = (rowModel, rowsDrop) => {
      let bestTarget = null;
      let current2 = rowsDrop.target;
      if (current2 && rowsDrop.rows.indexOf(current2) < 0) {
        return null;
      }
      const source2 = rowsDrop.source;
      if (!current2 || !source2) {
        return null;
      }
      let count = current2.rowIndex - source2.rowIndex;
      const increment = count < 0 ? -1 : 1;
      count = rowsDrop.suppressMoveWhenRowDragging ? Math.abs(count) : 1;
      const rowsSet = new Set(rowsDrop.rows);
      do {
        const candidate = getPrevOrNext(rowModel, increment, current2);
        if (!candidate) {
          break;
        }
        if (!rowsSet.has(candidate)) {
          bestTarget = candidate;
          --count;
        }
        current2 = candidate;
      } while (count > 0);
      return bestTarget;
    };
    var RowDragService = class extends BeanStub {
      constructor() {
        super(...arguments);
        this.beanName = "rowDragSvc";
      }
      setupRowDrag(element, ctrl) {
        const rowDragFeature = ctrl.createManagedBean(new RowDragFeature(element));
        const dragAndDrop = this.beans.dragAndDrop;
        dragAndDrop.addDropTarget(rowDragFeature);
        ctrl.addDestroyFunc(() => dragAndDrop.removeDropTarget(rowDragFeature));
        this.rowDragFeature = rowDragFeature;
      }
      createRowDragComp(cellValueFn, rowNode, column2, customGui, dragStartPixels, alwaysVisible) {
        return new RowDragComp(cellValueFn, rowNode, column2, customGui, dragStartPixels, alwaysVisible);
      }
      createRowDragCompForRow(rowNode, element) {
        if (_isCellSelectionEnabled(this.gos)) {
          return void 0;
        }
        const translate = this.getLocaleTextFunc();
        return this.createRowDragComp(
          () => `1 ${translate("rowDragRow", "row")}`,
          rowNode,
          void 0,
          element,
          void 0,
          true
        );
      }
      createRowDragCompForCell(rowNode, column2, cellValueFn, element, dragStartPixels, alwaysVisible) {
        const gos = this.gos;
        if (gos.get("rowDragManaged")) {
          if (!_isClientSideRowModel(gos) || gos.get("pagination")) {
            return void 0;
          }
        }
        const rowDragComp = this.createRowDragComp(
          cellValueFn,
          rowNode,
          column2,
          element,
          dragStartPixels,
          alwaysVisible
        );
        return rowDragComp;
      }
    };
    var RowDropHighlightService = class extends BeanStub {
      constructor() {
        super(...arguments);
        this.beanName = "rowDropHighlightSvc";
        this.uiLevel = 0;
        this.dragging = false;
        this.row = null;
        this.position = "none";
      }
      postConstruct() {
        this.addManagedEventListeners({
          modelUpdated: this.onModelUpdated.bind(this)
        });
      }
      onModelUpdated() {
        const row2 = this.row;
        const oldDragging = this.dragging;
        if (!row2 || row2?.rowIndex === null || this.position === "none") {
          this.clear();
        } else {
          this.set(row2, this.position);
        }
        this.dragging = oldDragging;
      }
      destroy() {
        this.clear();
        super.destroy();
      }
      clear() {
        const last = this.row;
        this.dragging = false;
        if (last) {
          this.uiLevel = 0;
          this.position = "none";
          this.row = null;
          last.dispatchRowEvent("rowHighlightChanged");
        }
      }
      set(row2, dropIndicatorPosition) {
        const nodeChanged = row2 !== this.row;
        const uiLevel = row2.uiLevel;
        const highlightChanged = dropIndicatorPosition !== this.position;
        const uiLevelChanged = uiLevel !== this.uiLevel;
        this.dragging = false;
        if (nodeChanged || highlightChanged || uiLevelChanged) {
          if (nodeChanged) {
            this.clear();
          }
          this.uiLevel = uiLevel;
          this.position = dropIndicatorPosition;
          this.row = row2;
          row2.dispatchRowEvent("rowHighlightChanged");
        }
      }
      fromDrag(draggingEvent) {
        const rowsDrop = draggingEvent?.dropTarget;
        if (rowsDrop) {
          const { highlight, target: target2, position } = rowsDrop;
          if (highlight && target2 && position !== "none") {
            this.set(target2, position);
            this.dragging = true;
            return;
          }
        }
        if (this.dragging) {
          this.clear();
        }
      }
    };
    var DragModule = {
      moduleName: "Drag",
      version: VERSION,
      beans: [DragService]
    };
    var DragAndDropModule = {
      moduleName: "DragAndDrop",
      version: VERSION,
      dynamicBeans: {
        dndSourceComp: DndSourceComp
      },
      icons: {
        // drag handle used to pick up draggable rows
        rowDrag: "grip"
      }
    };
    var SharedDragAndDropModule = {
      moduleName: "SharedDragAndDrop",
      version: VERSION,
      beans: [DragAndDropService],
      dependsOn: [DragModule],
      userComponents: {
        agDragAndDropImage: DragAndDropImageComponent2
      },
      icons: {
        // shown on drag and drop image component icon while dragging column to the side of the grid to pin
        columnMovePin: "pin",
        // shown on drag and drop image component icon while dragging over part of the page that is not a drop zone
        columnMoveHide: "eye-slash",
        // shown on drag and drop image component icon while dragging columns to reorder
        columnMoveMove: "arrows",
        // animating icon shown when dragging a column to the right of the grid causes horizontal scrolling
        columnMoveLeft: "left",
        // animating icon shown when dragging a column to the left of the grid causes horizontal scrolling
        columnMoveRight: "right",
        // shown on drag and drop image component icon while dragging over Row Groups drop zone
        columnMoveGroup: "group",
        // shown on drag and drop image component icon while dragging over Values drop zone
        columnMoveValue: "aggregation",
        // shown on drag and drop image component icon while dragging over pivot drop zone
        columnMovePivot: "pivot",
        // shown on drag and drop image component icon while dragging over drop zone that doesn't support it, e.g.
        // string column over aggregation drop zone
        dropNotAllowed: "not-allowed",
        // drag handle used to pick up draggable rows
        rowDrag: "grip"
      }
    };
    var RowDragModule = {
      moduleName: "RowDrag",
      version: VERSION,
      beans: [RowDropHighlightService, RowDragService],
      apiFunctions: {
        addRowDropZone,
        removeRowDropZone,
        getRowDropZoneParams,
        getRowDropPositionIndicator,
        setRowDropPositionIndicator
      },
      dependsOn: [SharedDragAndDropModule]
    };
    var HorizontalResizeModule = {
      moduleName: "HorizontalResize",
      version: VERSION,
      beans: [HorizontalResizeService],
      dependsOn: [DragModule]
    };
    var columnMovingCSS = (
      /*css*/
      `:where(.ag-ltr) :where(.ag-column-moving){.ag-cell,.ag-header-cell,.ag-spanned-cell-wrapper{transition:left .2s}.ag-header-group-cell{transition:left .2s,width .2s}}:where(.ag-rtl) :where(.ag-column-moving){.ag-cell,.ag-header-cell,.ag-spanned-cell-wrapper{transition:right .2s}.ag-header-group-cell{transition:right .2s,width .2s}}`
    );
    var ColumnAnimationService = class extends BeanStub {
      constructor() {
        super(...arguments);
        this.beanName = "colAnimation";
        this.executeNextFuncs = [];
        this.executeLaterFuncs = [];
        this.active = false;
        this.activeNext = false;
        this.suppressAnimation = false;
        this.animationThreadCount = 0;
      }
      postConstruct() {
        this.beans.ctrlsSvc.whenReady(this, (p) => this.gridBodyCtrl = p.gridBodyCtrl);
      }
      isActive() {
        return this.active && !this.suppressAnimation;
      }
      setSuppressAnimation(suppress) {
        this.suppressAnimation = suppress;
      }
      start() {
        if (this.active) {
          return;
        }
        const { gos } = this;
        if (gos.get("suppressColumnMoveAnimation")) {
          return;
        }
        if (gos.get("enableRtl")) {
          return;
        }
        this.ensureAnimationCssClassPresent();
        this.active = true;
        this.activeNext = true;
      }
      finish() {
        if (!this.active) {
          return;
        }
        this.flush(
          () => this.activeNext = false,
          () => this.active = false
        );
      }
      executeNextVMTurn(func) {
        if (this.activeNext) {
          this.executeNextFuncs.push(func);
        } else {
          func();
        }
      }
      executeLaterVMTurn(func) {
        if (this.active) {
          this.executeLaterFuncs.push(func);
        } else {
          func();
        }
      }
      ensureAnimationCssClassPresent() {
        this.animationThreadCount++;
        const animationThreadCountCopy = this.animationThreadCount;
        const { gridBodyCtrl } = this;
        gridBodyCtrl.setColumnMovingCss(true);
        this.executeLaterFuncs.push(() => {
          if (this.animationThreadCount === animationThreadCountCopy) {
            gridBodyCtrl.setColumnMovingCss(false);
          }
        });
      }
      flush(callbackNext, callbackLater) {
        const { executeNextFuncs, executeLaterFuncs } = this;
        if (executeNextFuncs.length === 0 && executeLaterFuncs.length === 0) {
          callbackNext();
          callbackLater();
          return;
        }
        const runFuncs = (queue) => {
          while (queue.length) {
            const func = queue.pop();
            if (func) {
              func();
            }
          }
        };
        this.beans.frameworkOverrides.wrapIncoming(() => {
          window.setTimeout(() => {
            callbackNext();
            runFuncs(executeNextFuncs);
          }, 0);
          window.setTimeout(() => {
            callbackLater();
            runFuncs(executeLaterFuncs);
          }, 200);
        });
      }
    };
    function moveColumnByIndex(beans, fromIndex, toIndex) {
      beans.colMoves?.moveColumnByIndex(fromIndex, toIndex, "api");
    }
    function moveColumns(beans, columnsToMoveKeys, toIndex) {
      beans.colMoves?.moveColumns(columnsToMoveKeys, toIndex, "api");
    }
    var BodyDropPivotTarget = class extends BeanStub {
      constructor(pinned) {
        super();
        this.pinned = pinned;
        this.columnsToAggregate = [];
        this.columnsToGroup = [];
        this.columnsToPivot = [];
      }
      /** Callback for when drag enters */
      onDragEnter(draggingEvent) {
        this.clearColumnsList();
        if (this.gos.get("functionsReadOnly")) {
          return;
        }
        const dragColumns = draggingEvent.dragItem.columns;
        if (!dragColumns) {
          return;
        }
        for (const column2 of dragColumns) {
          if (!column2.isPrimary()) {
            continue;
          }
          if (column2.isAnyFunctionActive()) {
            continue;
          }
          if (column2.isAllowValue()) {
            this.columnsToAggregate.push(column2);
          } else if (column2.isAllowRowGroup()) {
            this.columnsToGroup.push(column2);
          } else if (column2.isAllowPivot()) {
            this.columnsToPivot.push(column2);
          }
        }
      }
      getIconName() {
        const totalColumns = this.columnsToAggregate.length + this.columnsToGroup.length + this.columnsToPivot.length;
        if (totalColumns > 0) {
          return this.pinned ? "pinned" : "move";
        }
        return null;
      }
      /** Callback for when drag leaves */
      // eslint-disable-next-line @typescript-eslint/no-unused-vars
      onDragLeave(draggingEvent) {
        this.clearColumnsList();
      }
      clearColumnsList() {
        this.columnsToAggregate.length = 0;
        this.columnsToGroup.length = 0;
        this.columnsToPivot.length = 0;
      }
      /** Callback for when dragging */
      // eslint-disable-next-line @typescript-eslint/no-unused-vars
      onDragging(draggingEvent) {
      }
      /** Callback for when drag stops */
      // eslint-disable-next-line @typescript-eslint/no-unused-vars
      onDragStop(draggingEvent) {
        const { valueColsSvc, rowGroupColsSvc, pivotColsSvc } = this.beans;
        if (this.columnsToAggregate.length > 0) {
          valueColsSvc?.addColumns(this.columnsToAggregate, "toolPanelDragAndDrop");
        }
        if (this.columnsToGroup.length > 0) {
          rowGroupColsSvc?.addColumns(this.columnsToGroup, "toolPanelDragAndDrop");
        }
        if (this.columnsToPivot.length > 0) {
          pivotColsSvc?.addColumns(this.columnsToPivot, "toolPanelDragAndDrop");
        }
      }
      onDragCancel() {
        this.clearColumnsList();
      }
    };
    function sortColsLikeCols(colsList, cols) {
      if (!cols || cols.length <= 1) {
        return;
      }
      const notAllColsPresent = cols.filter((c2) => colsList.indexOf(c2) < 0).length > 0;
      if (notAllColsPresent) {
        return;
      }
      cols.sort((a, b) => {
        const indexA = colsList.indexOf(a);
        const indexB = colsList.indexOf(b);
        return indexA - indexB;
      });
    }
    function getColsToMove(allMovingColumns) {
      const newCols = [...allMovingColumns];
      for (const col of allMovingColumns) {
        let movingGroup = null;
        let parent = col.getParent();
        while (parent != null && parent.getDisplayedLeafColumns().length === 1) {
          movingGroup = parent;
          parent = parent.getParent();
        }
        if (movingGroup != null) {
          const isMarryChildren = !!movingGroup.getColGroupDef()?.marryChildren;
          const columnsToMove = isMarryChildren ? (
            // when marry children is true, we also have to move hidden
            // columns within the group, so grab them from the `providedColumnGroup`
            movingGroup.getProvidedColumnGroup().getLeafColumns()
          ) : movingGroup.getLeafColumns();
          for (const newCol of columnsToMove) {
            if (!newCols.includes(newCol)) {
              newCols.push(newCol);
            }
          }
        }
      }
      return newCols;
    }
    function getLowestFragMove(validMoves, allMovingColumnsOrdered, colMoves, visibleCols) {
      const displayedCols = visibleCols.allCols;
      let lowestFragMove = null;
      let targetOrder = null;
      for (let i2 = 0; i2 < validMoves.length; i2++) {
        const move = validMoves[i2];
        const order2 = colMoves.getProposedColumnOrder(allMovingColumnsOrdered, move);
        if (!colMoves.doesOrderPassRules(order2)) {
          continue;
        }
        const displayedOrder = order2.filter((col) => displayedCols.includes(col));
        if (targetOrder === null) {
          targetOrder = displayedOrder;
        } else if (!_areEqual(displayedOrder, targetOrder)) {
          break;
        }
        const fragCount = groupFragCount(order2);
        if (lowestFragMove === null || fragCount < lowestFragMove.fragCount) {
          lowestFragMove = { move, fragCount };
        }
      }
      return lowestFragMove;
    }
    function getBestColumnMoveIndexFromXPosition(params) {
      const { isFromHeader, fromLeft, xPosition, fromEnter, fakeEvent, pinned, gos, colModel, colMoves, visibleCols } = params;
      let { allMovingColumns } = params;
      if (isFromHeader) {
        allMovingColumns = getColsToMove(allMovingColumns);
      }
      const allMovingColumnsOrdered = allMovingColumns.slice();
      sortColsLikeCols(colModel.getCols(), allMovingColumnsOrdered);
      const validMoves = calculateValidMoves({
        movingCols: allMovingColumnsOrdered,
        draggingRight: fromLeft,
        xPosition,
        pinned,
        gos,
        colModel,
        visibleCols
      });
      const oldIndex = calculateOldIndex(allMovingColumnsOrdered, colModel);
      if (validMoves.length === 0) {
        return;
      }
      const firstValidMove = validMoves[0];
      const constrainDirection = oldIndex !== null && (isFromHeader || !fromEnter);
      if (constrainDirection && !fakeEvent) {
        if (!fromLeft && firstValidMove >= oldIndex) {
          return;
        }
        if (fromLeft && firstValidMove <= oldIndex) {
          return;
        }
      }
      const lowestFragMove = getLowestFragMove(validMoves, allMovingColumnsOrdered, colMoves, visibleCols);
      if (!lowestFragMove) {
        return;
      }
      const toIndex = lowestFragMove.move;
      if (toIndex > colModel.getCols().length - allMovingColumnsOrdered.length) {
        return;
      }
      return { columns: allMovingColumnsOrdered, toIndex };
    }
    function attemptMoveColumns(params) {
      const { columns, toIndex } = getBestColumnMoveIndexFromXPosition(params) || {};
      const { finished, colMoves } = params;
      if (!columns || toIndex == null) {
        return null;
      }
      colMoves.moveColumns(columns, toIndex, "uiColumnMoved", finished);
      return finished ? null : { columns, toIndex };
    }
    function calculateOldIndex(movingCols, colModel) {
      const gridCols = colModel.getCols();
      const indexes = movingCols.map((col) => gridCols.indexOf(col)).sort((a, b) => a - b);
      const firstIndex = indexes[0];
      const lastIndex = _last(indexes);
      const spread = lastIndex - firstIndex;
      const gapsExist = spread !== indexes.length - 1;
      return gapsExist ? null : firstIndex;
    }
    function groupFragCount(columns) {
      function parents(col) {
        const result2 = [];
        let parent = col.getOriginalParent();
        while (parent != null) {
          result2.push(parent);
          parent = parent.getOriginalParent();
        }
        return result2;
      }
      let count = 0;
      for (let i2 = 0; i2 < columns.length - 1; i2++) {
        let a = parents(columns[i2]);
        let b = parents(columns[i2 + 1]);
        [a, b] = a.length > b.length ? [a, b] : [b, a];
        for (const parent of a) {
          if (b.indexOf(parent) === -1) {
            count++;
          }
        }
      }
      return count;
    }
    function getDisplayedColumns(visibleCols, type) {
      switch (type) {
        case "left":
          return visibleCols.leftCols;
        case "right":
          return visibleCols.rightCols;
        default:
          return visibleCols.centerCols;
      }
    }
    function calculateValidMoves(params) {
      const { movingCols, draggingRight, xPosition, pinned, gos, colModel, visibleCols } = params;
      const isMoveBlocked = gos.get("suppressMovableColumns") || movingCols.some((col) => col.getColDef().suppressMovable);
      if (isMoveBlocked) {
        return [];
      }
      const allDisplayedCols = getDisplayedColumns(visibleCols, pinned);
      const allGridCols = colModel.getCols();
      const movingDisplayedCols = allDisplayedCols.filter((col) => movingCols.includes(col));
      const otherDisplayedCols = allDisplayedCols.filter((col) => !movingCols.includes(col));
      const otherGridCols = allGridCols.filter((col) => !movingCols.includes(col));
      let displayIndex = 0;
      let availableWidth = xPosition;
      if (draggingRight) {
        let widthOfMovingDisplayedCols = 0;
        for (const col of movingDisplayedCols) {
          widthOfMovingDisplayedCols += col.getActualWidth();
        }
        availableWidth -= widthOfMovingDisplayedCols;
      }
      if (availableWidth > 0) {
        for (let i2 = 0; i2 < otherDisplayedCols.length; i2++) {
          const col = otherDisplayedCols[i2];
          availableWidth -= col.getActualWidth();
          if (availableWidth < 0) {
            break;
          }
          displayIndex++;
        }
        if (draggingRight) {
          displayIndex++;
        }
      }
      let firstValidMove;
      if (displayIndex > 0) {
        const leftColumn = otherDisplayedCols[displayIndex - 1];
        firstValidMove = otherGridCols.indexOf(leftColumn) + 1;
      } else {
        firstValidMove = otherGridCols.indexOf(otherDisplayedCols[0]);
        if (firstValidMove === -1) {
          firstValidMove = 0;
        }
      }
      const validMoves = [firstValidMove];
      const numberComparator = (a, b) => a - b;
      if (draggingRight) {
        let pointer = firstValidMove + 1;
        const lastIndex = allGridCols.length - 1;
        while (pointer <= lastIndex) {
          validMoves.push(pointer);
          pointer++;
        }
        validMoves.sort(numberComparator);
      } else {
        let pointer = firstValidMove;
        const lastIndex = allGridCols.length - 1;
        let displacedCol = allGridCols[pointer];
        while (pointer <= lastIndex && allDisplayedCols.indexOf(displacedCol) < 0) {
          pointer++;
          validMoves.push(pointer);
          displacedCol = allGridCols[pointer];
        }
        pointer = firstValidMove - 1;
        const firstDisplayIndex = 0;
        while (pointer >= firstDisplayIndex) {
          validMoves.push(pointer);
          pointer--;
        }
        validMoves.sort(numberComparator).reverse();
      }
      return validMoves;
    }
    function normaliseX(params) {
      const { pinned, fromKeyboard, gos, ctrlsSvc, useHeaderRow, skipScrollPadding } = params;
      let eViewport = ctrlsSvc.getHeaderRowContainerCtrl(pinned)?.eViewport;
      let { x: x2 } = params;
      if (!eViewport) {
        return 0;
      }
      if (fromKeyboard) {
        x2 -= eViewport.getBoundingClientRect().left;
      }
      if (gos.get("enableRtl")) {
        if (useHeaderRow) {
          eViewport = eViewport.querySelector(".ag-header-row");
        }
        x2 = eViewport.clientWidth - x2;
      }
      if (pinned == null && !skipScrollPadding) {
        x2 += ctrlsSvc.get("center").getCenterViewportScrollLeft();
      }
      return x2;
    }
    function setColumnsMoving(columns, isMoving) {
      for (const column2 of columns) {
        column2.moving = isMoving;
        column2.dispatchColEvent("movingChanged", "uiColumnMoved");
      }
    }
    var MOVE_FAIL_THRESHOLD = 7;
    var SCROLL_MOVE_WIDTH = 100;
    var SCROLL_GAP_NEEDED_BEFORE_MOVE = SCROLL_MOVE_WIDTH / 2;
    var SCROLL_ACCELERATION_RATE = 5;
    var SCROLL_TIME_INTERVAL = 100;
    var MoveColumnFeature = class extends BeanStub {
      constructor(pinned) {
        super();
        this.pinned = pinned;
        this.needToMoveLeft = false;
        this.needToMoveRight = false;
        this.lastMovedInfo = null;
        this.isCenterContainer = !_exists(pinned);
      }
      postConstruct() {
        this.beans.ctrlsSvc.whenReady(this, (p) => {
          this.gridBodyCon = p.gridBodyCtrl;
        });
      }
      getIconName() {
        const { pinned, lastDraggingEvent } = this;
        const { dragItem } = lastDraggingEvent || {};
        const columns = dragItem?.columns ?? [];
        for (const col of columns) {
          const colPinned = col.getPinned();
          if (col.getColDef().lockPinned) {
            if (colPinned == pinned) {
              return "move";
            }
            continue;
          }
          const initialPinnedState = dragItem?.containerType;
          if (initialPinnedState === pinned || !pinned) {
            return "move";
          }
          if (pinned && (!colPinned || initialPinnedState !== pinned)) {
            return "pinned";
          }
        }
        return "notAllowed";
      }
      onDragEnter(draggingEvent) {
        const dragItem = draggingEvent.dragItem;
        const columns = dragItem.columns;
        const dragCameFromToolPanel = draggingEvent.dragSource.type === 0;
        if (dragCameFromToolPanel) {
          this.setColumnsVisible(columns, true, "uiColumnDragged");
        } else {
          const visibleState = dragItem.visibleState;
          const visibleColumns = (columns || []).filter(
            (column2) => visibleState[column2.getId()] && !column2.isVisible()
          );
          this.setColumnsVisible(visibleColumns, true, "uiColumnDragged");
        }
        if (!this.gos.get("suppressMoveWhenColumnDragging")) {
          this.attemptToPinColumns(columns, this.pinned);
        }
        this.onDragging(draggingEvent, true, true);
      }
      onDragging(draggingEvent = this.lastDraggingEvent, fromEnter = false, fakeEvent = false, finished = false) {
        const { gos, ctrlsSvc } = this.beans;
        const isSuppressMoveWhenDragging = gos.get("suppressMoveWhenColumnDragging");
        if (finished && !isSuppressMoveWhenDragging) {
          this.finishColumnMoving();
          return;
        }
        this.lastDraggingEvent = draggingEvent;
        if (!draggingEvent || !finished && _missing(draggingEvent.hDirection)) {
          return;
        }
        const mouseX = normaliseX({
          x: draggingEvent.x,
          pinned: this.pinned,
          gos,
          ctrlsSvc
        });
        if (!fromEnter) {
          this.checkCenterForScrolling(mouseX);
        }
        if (isSuppressMoveWhenDragging) {
          this.handleColumnDragWhileSuppressingMovement(draggingEvent, fromEnter, fakeEvent, mouseX, finished);
        } else {
          this.handleColumnDragWhileAllowingMovement(draggingEvent, fromEnter, fakeEvent, mouseX, finished);
        }
      }
      onDragLeave() {
        this.ensureIntervalCleared();
        this.clearHighlighted();
        this.updateDragItemContainerType();
        this.lastMovedInfo = null;
      }
      onDragStop() {
        this.onDragging(this.lastDraggingEvent, false, true, true);
        this.ensureIntervalCleared();
        this.lastMovedInfo = null;
      }
      onDragCancel() {
        this.clearHighlighted();
        this.ensureIntervalCleared();
        this.lastMovedInfo = null;
      }
      setColumnsVisible(columns, visible2, source2) {
        if (!columns?.length) {
          return;
        }
        const allowedCols = columns.filter((c2) => !c2.getColDef().lockVisible);
        if (!allowedCols.length) {
          return;
        }
        this.beans.colModel.setColsVisible(allowedCols, visible2, source2);
      }
      finishColumnMoving() {
        this.clearHighlighted();
        const lastMovedInfo = this.lastMovedInfo;
        if (!lastMovedInfo) {
          return;
        }
        const { columns, toIndex } = lastMovedInfo;
        this.beans.colMoves.moveColumns(columns, toIndex, "uiColumnMoved", true);
      }
      updateDragItemContainerType() {
        const { lastDraggingEvent } = this;
        if (this.gos.get("suppressMoveWhenColumnDragging") || !lastDraggingEvent) {
          return;
        }
        const dragItem = lastDraggingEvent.dragItem;
        if (!dragItem) {
          return;
        }
        dragItem.containerType = this.pinned;
      }
      handleColumnDragWhileSuppressingMovement(draggingEvent, fromEnter, fakeEvent, mouseX, finished) {
        const allMovingColumns = this.getAllMovingColumns(draggingEvent, true);
        if (finished) {
          const isAttemptingToPin = this.isAttemptingToPin(allMovingColumns);
          if (isAttemptingToPin) {
            this.attemptToPinColumns(allMovingColumns, void 0, true);
          }
          const { fromLeft, xPosition } = this.getNormalisedXPositionInfo(allMovingColumns, isAttemptingToPin) || {};
          if (fromLeft == null || xPosition == null) {
            this.finishColumnMoving();
            return;
          }
          this.moveColumnsAfterHighlight({
            allMovingColumns,
            xPosition,
            fromEnter,
            fakeEvent,
            fromLeft
          });
        } else {
          if (!this.beans.dragAndDrop.isDropZoneWithinThisGrid(draggingEvent)) {
            return;
          }
          this.highlightHoveredColumn(allMovingColumns, mouseX);
        }
      }
      handleColumnDragWhileAllowingMovement(draggingEvent, fromEnter, fakeEvent, mouseX, finished) {
        const allMovingColumns = this.getAllMovingColumns(draggingEvent);
        const fromLeft = this.normaliseDirection(draggingEvent.hDirection) === "right";
        const isFromHeader = draggingEvent.dragSource.type === 1;
        const params = this.getMoveColumnParams({
          allMovingColumns,
          isFromHeader,
          xPosition: mouseX,
          fromLeft,
          fromEnter,
          fakeEvent
        });
        const lastMovedInfo = attemptMoveColumns({ ...params, finished });
        if (lastMovedInfo) {
          this.lastMovedInfo = lastMovedInfo;
        }
      }
      getAllMovingColumns(draggingEvent, useSplit = false) {
        const dragItem = draggingEvent.dragSource.getDragItem();
        let columns = null;
        if (useSplit) {
          columns = dragItem.columnsInSplit;
          if (!columns) {
            columns = dragItem.columns;
          }
        } else {
          columns = dragItem.columns;
        }
        const conditionCallback = (col) => col.getColDef().lockPinned ? col.getPinned() == this.pinned : true;
        if (!columns) {
          return [];
        }
        return columns.filter(conditionCallback);
      }
      getMoveColumnParams(params) {
        const { allMovingColumns, isFromHeader, xPosition, fromLeft, fromEnter, fakeEvent } = params;
        const { gos, colModel, colMoves, visibleCols } = this.beans;
        return {
          allMovingColumns,
          isFromHeader,
          fromLeft,
          xPosition,
          pinned: this.pinned,
          fromEnter,
          fakeEvent,
          gos,
          colModel,
          colMoves,
          visibleCols
        };
      }
      highlightHoveredColumn(movingColumns, mouseX) {
        const { gos, colModel } = this.beans;
        const isRtl = gos.get("enableRtl");
        const consideredColumns = colModel.getCols().filter((col) => col.isVisible() && col.getPinned() === this.pinned);
        let start2 = null;
        let width = null;
        let targetColumn = null;
        for (const col of consideredColumns) {
          width = col.getActualWidth();
          start2 = this.getNormalisedColumnLeft(col, 0, isRtl);
          if (start2 != null) {
            const end2 = start2 + width;
            if (start2 <= mouseX && end2 >= mouseX) {
              targetColumn = col;
              break;
            }
          }
          start2 = null;
          width = null;
        }
        if (!targetColumn) {
          for (let i2 = consideredColumns.length - 1; i2 >= 0; i2--) {
            const currentColumn = consideredColumns[i2];
            const parent = consideredColumns[i2].getParent();
            if (!parent) {
              targetColumn = currentColumn;
              break;
            }
            const leafDisplayedCols = parent?.getDisplayedLeafColumns();
            if (leafDisplayedCols.length) {
              targetColumn = _last(leafDisplayedCols);
              break;
            }
          }
          if (!targetColumn) {
            return;
          }
          start2 = this.getNormalisedColumnLeft(targetColumn, 0, isRtl);
          width = targetColumn.getActualWidth();
        } else if (movingColumns.indexOf(targetColumn) !== -1) {
          targetColumn = null;
        }
        if (this.lastHighlightedColumn?.column !== targetColumn) {
          this.clearHighlighted();
        }
        if (targetColumn == null || start2 == null || width == null) {
          return;
        }
        let position;
        if (mouseX - start2 < width / 2 !== isRtl) {
          position = 0;
        } else {
          position = 1;
        }
        setColumnHighlighted(targetColumn, position);
        this.lastHighlightedColumn = { column: targetColumn, position };
      }
      getNormalisedXPositionInfo(allMovingColumns, isAttemptingToPin) {
        const { gos, visibleCols } = this.beans;
        const isRtl = gos.get("enableRtl");
        const { firstMovingCol, column: column2, position } = this.getColumnMoveAndTargetInfo(
          allMovingColumns,
          isAttemptingToPin,
          isRtl
        );
        if (!firstMovingCol || !column2 || position == null) {
          return;
        }
        const visibleColumns = visibleCols.allCols;
        const movingColIndex = visibleColumns.indexOf(firstMovingCol);
        const targetIndex = visibleColumns.indexOf(column2);
        const isBefore = position === 0 !== isRtl;
        const fromLeft = movingColIndex < targetIndex || movingColIndex === targetIndex && !isBefore;
        let diff2 = 0;
        if (isBefore) {
          if (fromLeft) {
            diff2 -= 1;
          }
        } else if (!fromLeft) {
          diff2 += 1;
        }
        if (targetIndex + diff2 === movingColIndex) {
          return;
        }
        const targetColumn = visibleColumns[targetIndex + diff2];
        if (!targetColumn) {
          return;
        }
        const xPosition = this.getNormalisedColumnLeft(targetColumn, 20, isRtl);
        return { fromLeft, xPosition };
      }
      getColumnMoveAndTargetInfo(allMovingColumns, isAttemptingToPin, isRtl) {
        const lastHighlightedColumn = this.lastHighlightedColumn || {};
        const { firstMovingCol, lastMovingCol } = findFirstAndLastMovingColumns(allMovingColumns);
        if (!firstMovingCol || !lastMovingCol || lastHighlightedColumn.column || !isAttemptingToPin) {
          return {
            firstMovingCol,
            ...lastHighlightedColumn
          };
        }
        const pinned = this.getPinDirection();
        const isLeft = pinned === "left";
        return {
          firstMovingCol,
          position: isLeft ? 1 : 0,
          column: isLeft !== isRtl ? firstMovingCol : lastMovingCol
        };
      }
      normaliseDirection(hDirection) {
        if (this.gos.get("enableRtl")) {
          switch (hDirection) {
            case "left":
              return "right";
            case "right":
              return "left";
          }
        }
        return hDirection;
      }
      getNormalisedColumnLeft(col, padding, isRtl) {
        const { gos, ctrlsSvc } = this.beans;
        const left2 = col.getLeft();
        if (left2 == null) {
          return null;
        }
        const width = col.getActualWidth();
        return normaliseX({
          x: isRtl ? left2 + width - padding : left2 + padding,
          pinned: col.getPinned(),
          useHeaderRow: isRtl,
          skipScrollPadding: true,
          gos,
          ctrlsSvc
        });
      }
      isAttemptingToPin(columns) {
        const isMovingHorizontally = this.needToMoveLeft || this.needToMoveRight;
        const isFailedMoreThanThreshold = this.failedMoveAttempts > MOVE_FAIL_THRESHOLD;
        return isMovingHorizontally && isFailedMoreThanThreshold || columns.some((col) => col.getPinned() !== this.pinned);
      }
      moveColumnsAfterHighlight(params) {
        const { allMovingColumns, xPosition, fromEnter, fakeEvent, fromLeft } = params;
        const columnMoveParams = this.getMoveColumnParams({
          allMovingColumns,
          isFromHeader: true,
          xPosition,
          fromLeft,
          fromEnter,
          fakeEvent
        });
        const { columns, toIndex } = getBestColumnMoveIndexFromXPosition(columnMoveParams) || {};
        if (columns && toIndex != null) {
          this.lastMovedInfo = {
            columns,
            toIndex
          };
        }
        this.finishColumnMoving();
      }
      clearHighlighted() {
        const { lastHighlightedColumn } = this;
        if (!lastHighlightedColumn) {
          return;
        }
        setColumnHighlighted(lastHighlightedColumn.column, null);
        this.lastHighlightedColumn = null;
      }
      checkCenterForScrolling(xAdjustedForScroll) {
        if (!this.isCenterContainer) {
          return;
        }
        const centerCtrl = this.beans.ctrlsSvc.get("center");
        const firstVisiblePixel = centerCtrl.getCenterViewportScrollLeft();
        const lastVisiblePixel = firstVisiblePixel + centerCtrl.getCenterWidth();
        let needToMoveRight;
        let needToMoveLeft;
        if (this.gos.get("enableRtl")) {
          needToMoveRight = xAdjustedForScroll < firstVisiblePixel + SCROLL_GAP_NEEDED_BEFORE_MOVE;
          needToMoveLeft = xAdjustedForScroll > lastVisiblePixel - SCROLL_GAP_NEEDED_BEFORE_MOVE;
        } else {
          needToMoveLeft = xAdjustedForScroll < firstVisiblePixel + SCROLL_GAP_NEEDED_BEFORE_MOVE;
          needToMoveRight = xAdjustedForScroll > lastVisiblePixel - SCROLL_GAP_NEEDED_BEFORE_MOVE;
        }
        this.needToMoveRight = needToMoveRight;
        this.needToMoveLeft = needToMoveLeft;
        if (needToMoveLeft || needToMoveRight) {
          this.ensureIntervalStarted();
        } else {
          this.ensureIntervalCleared();
        }
      }
      ensureIntervalStarted() {
        if (this.movingIntervalId) {
          return;
        }
        this.intervalCount = 0;
        this.failedMoveAttempts = 0;
        this.movingIntervalId = window.setInterval(this.moveInterval.bind(this), SCROLL_TIME_INTERVAL);
        this.beans.dragAndDrop.setDragImageCompIcon(this.needToMoveLeft ? "left" : "right", true);
      }
      ensureIntervalCleared() {
        if (!this.movingIntervalId) {
          return;
        }
        window.clearInterval(this.movingIntervalId);
        this.movingIntervalId = null;
        this.failedMoveAttempts = 0;
        this.beans.dragAndDrop.setDragImageCompIcon(this.getIconName());
      }
      moveInterval() {
        let pixelsToMove;
        this.intervalCount++;
        pixelsToMove = 10 + this.intervalCount * SCROLL_ACCELERATION_RATE;
        if (pixelsToMove > SCROLL_MOVE_WIDTH) {
          pixelsToMove = SCROLL_MOVE_WIDTH;
        }
        let pixelsMoved = null;
        const scrollFeature = this.gridBodyCon.scrollFeature;
        if (this.needToMoveLeft) {
          pixelsMoved = scrollFeature.scrollHorizontally(-pixelsToMove);
        } else if (this.needToMoveRight) {
          pixelsMoved = scrollFeature.scrollHorizontally(pixelsToMove);
        }
        if (pixelsMoved !== 0) {
          this.onDragging(this.lastDraggingEvent);
          this.failedMoveAttempts = 0;
        } else {
          this.failedMoveAttempts++;
          const { pinnedCols, dragAndDrop, gos } = this.beans;
          if (this.failedMoveAttempts <= MOVE_FAIL_THRESHOLD + 1 || !pinnedCols) {
            return;
          }
          dragAndDrop.setDragImageCompIcon("pinned");
          if (!gos.get("suppressMoveWhenColumnDragging")) {
            const columns = this.lastDraggingEvent?.dragItem.columns;
            this.attemptToPinColumns(columns, void 0, true);
          }
        }
      }
      getPinDirection() {
        if (this.needToMoveLeft || this.pinned === "left") {
          return "left";
        }
        if (this.needToMoveRight || this.pinned === "right") {
          return "right";
        }
      }
      attemptToPinColumns(columns, pinned, fromMoving = false) {
        const allowedCols = (columns || []).filter((c2) => !c2.getColDef().lockPinned);
        if (!allowedCols.length) {
          return 0;
        }
        if (fromMoving) {
          pinned = this.getPinDirection();
        }
        const { pinnedCols, dragAndDrop } = this.beans;
        pinnedCols?.setColsPinned(allowedCols, pinned, "uiColumnDragged");
        if (fromMoving) {
          dragAndDrop.nudge();
        }
        return allowedCols.length;
      }
      destroy() {
        super.destroy();
        this.lastDraggingEvent = null;
        this.clearHighlighted();
        this.lastMovedInfo = null;
      }
    };
    function setColumnHighlighted(column2, highlighted) {
      if (column2.highlighted === highlighted) {
        return;
      }
      column2.highlighted = highlighted;
      column2.dispatchColEvent("headerHighlightChanged", "uiColumnMoved");
    }
    function findFirstAndLastMovingColumns(allMovingColumns) {
      const moveLen = allMovingColumns.length;
      let firstMovingCol;
      let lastMovingCol;
      for (let i2 = 0; i2 < moveLen; i2++) {
        if (!firstMovingCol) {
          const leftCol = allMovingColumns[i2];
          if (leftCol.getLeft() != null) {
            firstMovingCol = leftCol;
          }
        }
        if (!lastMovingCol) {
          const rightCol = allMovingColumns[moveLen - 1 - i2];
          if (rightCol.getLeft() != null) {
            lastMovingCol = rightCol;
          }
        }
        if (firstMovingCol && lastMovingCol) {
          break;
        }
      }
      return { firstMovingCol, lastMovingCol };
    }
    var BodyDropTarget = class extends BeanStub {
      constructor(pinned, eContainer) {
        super();
        this.pinned = pinned;
        this.eContainer = eContainer;
      }
      postConstruct() {
        const { ctrlsSvc, dragAndDrop } = this.beans;
        const pinned = this.pinned;
        ctrlsSvc.whenReady(this, (p) => {
          let eSecondaryContainers;
          const eBodyViewport = p.gridBodyCtrl.eBodyViewport;
          switch (pinned) {
            case "left":
              eSecondaryContainers = [
                [eBodyViewport, p.left.eContainer],
                [p.bottomLeft.eContainer],
                [p.topLeft.eContainer]
              ];
              break;
            case "right":
              eSecondaryContainers = [
                [eBodyViewport, p.right.eContainer],
                [p.bottomRight.eContainer],
                [p.topRight.eContainer]
              ];
              break;
            default:
              eSecondaryContainers = [
                [eBodyViewport, p.center.eViewport],
                [p.bottomCenter.eViewport],
                [p.topCenter.eViewport]
              ];
              break;
          }
          this.eSecondaryContainers = eSecondaryContainers;
        });
        this.moveColumnFeature = this.createManagedBean(new MoveColumnFeature(pinned));
        this.bodyDropPivotTarget = this.createManagedBean(new BodyDropPivotTarget(pinned));
        dragAndDrop.addDropTarget(this);
        this.addDestroyFunc(() => dragAndDrop.removeDropTarget(this));
      }
      isInterestedIn(type) {
        return type === 1 || type === 0 && this.gos.get("allowDragFromColumnsToolPanel");
      }
      getSecondaryContainers() {
        return this.eSecondaryContainers;
      }
      getContainer() {
        return this.eContainer;
      }
      getIconName() {
        return this.currentDropListener.getIconName();
      }
      // we want to use the bodyPivotTarget if the user is dragging columns in from the toolPanel
      // and we are in pivot mode, as it has to logic to set pivot/value/group on the columns when
      // dropped into the grid's body.
      isDropColumnInPivotMode(draggingEvent) {
        return this.beans.colModel.isPivotMode() && draggingEvent.dragSource.type === 0;
      }
      onDragEnter(draggingEvent) {
        this.currentDropListener = this.isDropColumnInPivotMode(draggingEvent) ? this.bodyDropPivotTarget : this.moveColumnFeature;
        this.currentDropListener.onDragEnter(draggingEvent);
      }
      onDragLeave(params) {
        this.currentDropListener.onDragLeave(params);
      }
      onDragging(params) {
        this.currentDropListener.onDragging(params);
      }
      onDragStop(params) {
        this.currentDropListener.onDragStop(params);
      }
      onDragCancel() {
        this.currentDropListener.onDragCancel();
      }
    };
    var ColumnMoveService = class extends BeanStub {
      constructor() {
        super(...arguments);
        this.beanName = "colMoves";
      }
      moveColumnByIndex(fromIndex, toIndex, source2) {
        const gridColumns2 = this.beans.colModel.getCols();
        if (!gridColumns2) {
          return;
        }
        const column2 = gridColumns2[fromIndex];
        this.moveColumns([column2], toIndex, source2);
      }
      moveColumns(columnsToMoveKeys, toIndex, source2, finished = true) {
        const { colModel, colAnimation, visibleCols, eventSvc } = this.beans;
        const gridColumns2 = colModel.getCols();
        if (!gridColumns2) {
          return;
        }
        if (toIndex > gridColumns2.length - columnsToMoveKeys.length) {
          _warn(30, { toIndex });
          return;
        }
        colAnimation?.start();
        const movedColumns = colModel.getColsForKeys(columnsToMoveKeys);
        if (this.doesMovePassRules(movedColumns, toIndex)) {
          _moveInArray(colModel.getCols(), movedColumns, toIndex);
          visibleCols.refresh(source2);
          eventSvc.dispatchEvent({
            type: "columnMoved",
            columns: movedColumns,
            column: movedColumns.length === 1 ? movedColumns[0] : null,
            toIndex,
            finished,
            source: source2
          });
        }
        colAnimation?.finish();
      }
      doesMovePassRules(columnsToMove, toIndex) {
        const proposedColumnOrder = this.getProposedColumnOrder(columnsToMove, toIndex);
        return this.doesOrderPassRules(proposedColumnOrder);
      }
      doesOrderPassRules(gridOrder) {
        const { colModel, gos } = this.beans;
        if (!doesMovePassMarryChildren(gridOrder, colModel.getColTree())) {
          return false;
        }
        const doesMovePassLockedPositions = (proposedColumnOrder) => {
          const lockPositionToPlacement = (position) => {
            if (!position) {
              return 0;
            }
            return position === "left" || position === true ? -1 : 1;
          };
          const isRtl = gos.get("enableRtl");
          let lastPlacement = isRtl ? 1 : -1;
          let rulePassed = true;
          for (const col of proposedColumnOrder) {
            const placement = lockPositionToPlacement(col.getColDef().lockPosition);
            if (isRtl) {
              if (placement > lastPlacement) {
                rulePassed = false;
              }
            } else if (placement < lastPlacement) {
              rulePassed = false;
            }
            lastPlacement = placement;
          }
          return rulePassed;
        };
        if (!doesMovePassLockedPositions(gridOrder)) {
          return false;
        }
        return true;
      }
      getProposedColumnOrder(columnsToMove, toIndex) {
        const gridColumns2 = this.beans.colModel.getCols();
        const proposedColumnOrder = gridColumns2.slice();
        _moveInArray(proposedColumnOrder, columnsToMove, toIndex);
        return proposedColumnOrder;
      }
      createBodyDropTarget(pinned, dropContainer) {
        return new BodyDropTarget(pinned, dropContainer);
      }
      moveHeader(hDirection, eGui, column2, pinned, bean) {
        const { ctrlsSvc, gos, colModel, visibleCols, focusSvc } = this.beans;
        const rect2 = eGui.getBoundingClientRect();
        const left2 = rect2.left;
        const isGroup = isColumnGroup(column2);
        const width = isGroup ? rect2.width : column2.getActualWidth();
        const isLeft = hDirection === "left" !== gos.get("enableRtl");
        const xPosition = normaliseX({
          x: isLeft ? left2 - 20 : left2 + width + 20,
          pinned,
          fromKeyboard: true,
          gos,
          ctrlsSvc
        });
        const headerPosition = focusSvc.focusedHeader;
        attemptMoveColumns({
          allMovingColumns: isGroup ? column2.getLeafColumns() : [column2],
          isFromHeader: true,
          fromLeft: hDirection === "right",
          xPosition,
          pinned,
          fromEnter: false,
          fakeEvent: false,
          gos,
          colModel,
          colMoves: this,
          visibleCols,
          finished: true
        });
        let targetColumn;
        if (isGroup) {
          const displayedLeafColumns = column2.getDisplayedLeafColumns();
          targetColumn = isLeft ? displayedLeafColumns[0] : _last(displayedLeafColumns);
        } else {
          targetColumn = column2;
        }
        ctrlsSvc.getScrollFeature().ensureColumnVisible(targetColumn, "auto");
        if ((!bean.isAlive() || gos.get("ensureDomOrder")) && headerPosition) {
          let restoreFocusColumn;
          if (isGroup) {
            const groupId = column2.getGroupId();
            const leafCols = column2.getLeafColumns();
            if (!leafCols.length) {
              return;
            }
            const parent = leafCols[0].getParent();
            if (!parent) {
              return;
            }
            restoreFocusColumn = findGroupWidthId(parent, groupId);
          } else {
            restoreFocusColumn = column2;
          }
          if (restoreFocusColumn) {
            focusSvc.focusHeaderPosition({
              headerPosition: {
                ...headerPosition,
                column: restoreFocusColumn
              }
            });
          }
        }
      }
      setDragSourceForHeader(eSource, column2, displayName) {
        const { gos, colModel, dragAndDrop, visibleCols } = this.beans;
        let hideColumnOnExit = !gos.get("suppressDragLeaveHidesColumns");
        const isGroup = isColumnGroup(column2);
        const columns = isGroup ? column2.getProvidedColumnGroup().getLeafColumns() : [column2];
        const getDragItem = isGroup ? () => createDragItemForGroup(column2, visibleCols.allCols) : () => createDragItem(column2);
        const dragSource = {
          type: 1,
          eElement: eSource,
          getDefaultIconName: () => hideColumnOnExit ? "hide" : "notAllowed",
          getDragItem,
          dragItemName: displayName,
          onDragStarted: () => {
            hideColumnOnExit = !gos.get("suppressDragLeaveHidesColumns");
            setColumnsMoving(columns, true);
          },
          onDragStopped: () => setColumnsMoving(columns, false),
          onDragCancelled: () => setColumnsMoving(columns, false),
          onGridEnter: (dragItem) => {
            if (hideColumnOnExit) {
              const { columns: columns2 = [], visibleState } = dragItem ?? {};
              const hasVisibleState = isGroup ? (col) => !visibleState || visibleState[col.getColId()] : () => true;
              const unlockedColumns = columns2.filter(
                (col) => !col.getColDef().lockVisible && hasVisibleState(col)
              );
              colModel.setColsVisible(unlockedColumns, true, "uiColumnMoved");
            }
          },
          onGridExit: (dragItem) => {
            if (hideColumnOnExit) {
              const unlockedColumns = dragItem?.columns?.filter((col) => !col.getColDef().lockVisible) || [];
              colModel.setColsVisible(unlockedColumns, false, "uiColumnMoved");
            }
          }
        };
        dragAndDrop.addDragSource(dragSource, true);
        return dragSource;
      }
    };
    function findGroupWidthId(columnGroup, id) {
      while (columnGroup) {
        if (columnGroup.getGroupId() === id) {
          return columnGroup;
        }
        columnGroup = columnGroup.getParent();
      }
      return void 0;
    }
    function createDragItem(column2) {
      const visibleState = {};
      visibleState[column2.getId()] = column2.isVisible();
      return {
        columns: [column2],
        visibleState,
        containerType: column2.pinned
      };
    }
    function createDragItemForGroup(columnGroup, allCols) {
      const allColumnsOriginalOrder = columnGroup.getProvidedColumnGroup().getLeafColumns();
      const visibleState = {};
      for (const column2 of allColumnsOriginalOrder) {
        visibleState[column2.getId()] = column2.isVisible();
      }
      const allColumnsCurrentOrder = [];
      for (const column2 of allCols) {
        if (allColumnsOriginalOrder.indexOf(column2) >= 0) {
          allColumnsCurrentOrder.push(column2);
          _removeFromArray(allColumnsOriginalOrder, column2);
        }
      }
      for (const column2 of allColumnsOriginalOrder) {
        allColumnsCurrentOrder.push(column2);
      }
      const columnsInSplit = [];
      const columnGroupColumns = columnGroup.getLeafColumns();
      for (const col of allColumnsCurrentOrder) {
        if (columnGroupColumns.indexOf(col) !== -1) {
          columnsInSplit.push(col);
        }
      }
      return {
        columns: allColumnsCurrentOrder,
        columnsInSplit,
        visibleState,
        containerType: columnsInSplit[0]?.pinned
      };
    }
    var ColumnMoveModule = {
      moduleName: "ColumnMove",
      version: VERSION,
      beans: [ColumnMoveService, ColumnAnimationService],
      apiFunctions: {
        moveColumnByIndex,
        moveColumns
      },
      dependsOn: [SharedDragAndDropModule],
      css: [columnMovingCSS]
    };
    var AutoWidthCalculator = class extends BeanStub {
      constructor() {
        super(...arguments);
        this.beanName = "autoWidthCalc";
      }
      postConstruct() {
        this.beans.ctrlsSvc.whenReady(this, (p) => {
          this.centerRowContainerCtrl = p.center;
        });
      }
      // this is the trick: we create a dummy container and clone all the cells
      // into the dummy, then check the dummy's width. then destroy the dummy
      // as we don't need it any more.
      // drawback: only the cells visible on the screen are considered
      getPreferredWidthForColumn(column2, skipHeader) {
        const eHeaderCell = this.getHeaderCellForColumn(column2);
        if (!eHeaderCell) {
          return -1;
        }
        const elements = this.beans.rowRenderer.getAllCellsNotSpanningForColumn(column2);
        if (!skipHeader) {
          elements.push(eHeaderCell);
        }
        return this.getPreferredWidthForElements(elements);
      }
      getPreferredWidthForColumnGroup(columnGroup) {
        const eHeaderCell = this.getHeaderCellForColumn(columnGroup);
        if (!eHeaderCell) {
          return -1;
        }
        return this.getPreferredWidthForElements([eHeaderCell]);
      }
      getPreferredWidthForElements(elements, extraPadding) {
        const eDummyContainer = document.createElement("form");
        eDummyContainer.style.position = "fixed";
        const eBodyContainer = this.centerRowContainerCtrl.eContainer;
        for (const el2 of elements) {
          this.cloneItemIntoDummy(el2, eDummyContainer);
        }
        eBodyContainer.appendChild(eDummyContainer);
        const dummyContainerWidth = eDummyContainer.offsetWidth;
        eDummyContainer.remove();
        extraPadding = extraPadding ?? this.gos.get("autoSizePadding");
        return dummyContainerWidth + extraPadding;
      }
      getHeaderCellForColumn(column2) {
        let element = null;
        for (const container2 of this.beans.ctrlsSvc.getHeaderRowContainerCtrls()) {
          const res = container2.getHtmlElementForColumnHeader(column2);
          if (res != null) {
            element = res;
          }
        }
        return element;
      }
      cloneItemIntoDummy(eCell, eDummyContainer) {
        const eCellClone = eCell.cloneNode(true);
        eCellClone.style.width = "";
        eCellClone.style.position = "static";
        eCellClone.style.left = "";
        const eCloneParent = document.createElement("div");
        const eCloneParentClassList = eCloneParent.classList;
        const isHeader = ["ag-header-cell", "ag-header-group-cell"].some((cls) => eCellClone.classList.contains(cls));
        if (isHeader) {
          eCloneParentClassList.add("ag-header", "ag-header-row");
          eCloneParent.style.position = "static";
        } else {
          eCloneParentClassList.add("ag-row");
        }
        let pointer = eCell.parentElement;
        while (pointer) {
          const isRow = ["ag-header-row", "ag-row"].some((cls) => pointer.classList.contains(cls));
          if (isRow) {
            for (let i2 = 0; i2 < pointer.classList.length; i2++) {
              const item2 = pointer.classList[i2];
              if (item2 != "ag-row-position-absolute") {
                eCloneParentClassList.add(item2);
              }
            }
            break;
          }
          pointer = pointer.parentElement;
        }
        eCloneParent.appendChild(eCellClone);
        eDummyContainer.appendChild(eCloneParent);
      }
    };
    var AutoWidthModule = {
      moduleName: "AutoWidth",
      version: VERSION,
      beans: [AutoWidthCalculator]
    };
    function setColumnWidths(beans, columnWidths, finished = true, source2 = "api") {
      beans.colResize?.setColumnWidths(columnWidths, false, finished, source2);
    }
    var GroupResizeFeature = class extends BeanStub {
      constructor(comp2, eResize, pinned, columnGroup) {
        super();
        this.comp = comp2;
        this.eResize = eResize;
        this.pinned = pinned;
        this.columnGroup = columnGroup;
      }
      postConstruct() {
        if (!this.columnGroup.isResizable()) {
          this.comp.setResizableDisplayed(false);
          return;
        }
        const { horizontalResizeSvc, gos, colAutosize } = this.beans;
        const finishedWithResizeFunc = horizontalResizeSvc.addResizeBar({
          eResizeBar: this.eResize,
          onResizeStart: this.onResizeStart.bind(this),
          onResizing: this.onResizing.bind(this, false),
          onResizeEnd: this.onResizing.bind(this, true)
        });
        this.addDestroyFunc(finishedWithResizeFunc);
        if (!gos.get("suppressAutoSize") && colAutosize) {
          this.addDestroyFunc(
            colAutosize.addColumnGroupResize(
              this.eResize,
              this.columnGroup,
              () => this.resizeLeafColumnsToFit("uiColumnResized")
            )
          );
        }
      }
      onResizeStart(shiftKey) {
        const {
          columnsToResize,
          resizeStartWidth,
          resizeRatios,
          groupAfterColumns,
          groupAfterStartWidth,
          groupAfterRatios
        } = this.getInitialValues(shiftKey);
        this.resizeCols = columnsToResize;
        this.resizeStartWidth = resizeStartWidth;
        this.resizeRatios = resizeRatios;
        this.resizeTakeFromCols = groupAfterColumns;
        this.resizeTakeFromStartWidth = groupAfterStartWidth;
        this.resizeTakeFromRatios = groupAfterRatios;
        this.toggleColumnResizing(true);
      }
      onResizing(finished, resizeAmount, source2 = "uiColumnResized") {
        const resizeAmountNormalised = this.normaliseDragChange(resizeAmount);
        const width = this.resizeStartWidth + resizeAmountNormalised;
        this.resizeColumnsFromLocalValues(width, source2, finished);
      }
      getInitialValues(shiftKey) {
        const getInitialSizeOfColumns = (columns) => columns.reduce((totalWidth, column2) => totalWidth + column2.getActualWidth(), 0);
        const getSizeRatiosOfColumns = (columns, initialSizeOfColumns) => columns.map((column2) => column2.getActualWidth() / initialSizeOfColumns);
        const columnsToResize = this.getColumnsToResize();
        const resizeStartWidth = getInitialSizeOfColumns(columnsToResize);
        const resizeRatios = getSizeRatiosOfColumns(columnsToResize, resizeStartWidth);
        const columnSizeAndRatios = {
          columnsToResize,
          resizeStartWidth,
          resizeRatios
        };
        let groupAfter = null;
        if (shiftKey) {
          groupAfter = this.beans.colGroupSvc?.getGroupAtDirection(this.columnGroup, "After") ?? null;
        }
        if (groupAfter) {
          const takeFromLeafCols = groupAfter.getDisplayedLeafColumns();
          const groupAfterColumns = columnSizeAndRatios.groupAfterColumns = takeFromLeafCols.filter(
            (col) => col.isResizable()
          );
          const groupAfterStartWidth = columnSizeAndRatios.groupAfterStartWidth = getInitialSizeOfColumns(groupAfterColumns);
          columnSizeAndRatios.groupAfterRatios = getSizeRatiosOfColumns(groupAfterColumns, groupAfterStartWidth);
        } else {
          columnSizeAndRatios.groupAfterColumns = void 0;
          columnSizeAndRatios.groupAfterStartWidth = void 0;
          columnSizeAndRatios.groupAfterRatios = void 0;
        }
        return columnSizeAndRatios;
      }
      resizeLeafColumnsToFit(source2) {
        const preferredSize = this.beans.autoWidthCalc.getPreferredWidthForColumnGroup(this.columnGroup);
        const initialValues = this.getInitialValues();
        if (preferredSize > initialValues.resizeStartWidth) {
          this.resizeColumns(initialValues, preferredSize, source2, true);
        }
      }
      resizeColumnsFromLocalValues(totalWidth, source2, finished = true) {
        if (!this.resizeCols || !this.resizeRatios) {
          return;
        }
        const initialValues = {
          columnsToResize: this.resizeCols,
          resizeStartWidth: this.resizeStartWidth,
          resizeRatios: this.resizeRatios,
          groupAfterColumns: this.resizeTakeFromCols,
          groupAfterStartWidth: this.resizeTakeFromStartWidth,
          groupAfterRatios: this.resizeTakeFromRatios
        };
        this.resizeColumns(initialValues, totalWidth, source2, finished);
      }
      resizeColumns(initialValues, totalWidth, source2, finished = true) {
        const {
          columnsToResize,
          resizeStartWidth,
          resizeRatios,
          groupAfterColumns,
          groupAfterStartWidth,
          groupAfterRatios
        } = initialValues;
        const resizeSets = [];
        resizeSets.push({
          columns: columnsToResize,
          ratios: resizeRatios,
          width: totalWidth
        });
        if (groupAfterColumns) {
          const diff2 = totalWidth - resizeStartWidth;
          resizeSets.push({
            columns: groupAfterColumns,
            ratios: groupAfterRatios,
            width: groupAfterStartWidth - diff2
          });
        }
        this.beans.colResize?.resizeColumnSets({
          resizeSets,
          finished,
          source: source2
        });
        if (finished) {
          this.toggleColumnResizing(false);
        }
      }
      toggleColumnResizing(resizing) {
        this.comp.toggleCss("ag-column-resizing", resizing);
      }
      getColumnsToResize() {
        const leafCols = this.columnGroup.getDisplayedLeafColumns();
        return leafCols.filter((col) => col.isResizable());
      }
      // optionally inverts the drag, depending on pinned and RTL
      // note - this method is duplicated in RenderedHeaderCell - should refactor out?
      normaliseDragChange(dragChange) {
        let result2 = dragChange;
        if (this.gos.get("enableRtl")) {
          if (this.pinned !== "left") {
            result2 *= -1;
          }
        } else if (this.pinned === "right") {
          result2 *= -1;
        }
        return result2;
      }
      destroy() {
        super.destroy();
        this.resizeCols = void 0;
        this.resizeRatios = void 0;
        this.resizeTakeFromCols = void 0;
        this.resizeTakeFromRatios = void 0;
      }
    };
    var ResizeFeature = class extends BeanStub {
      constructor(pinned, column2, eResize, comp2, ctrl) {
        super();
        this.pinned = pinned;
        this.column = column2;
        this.eResize = eResize;
        this.comp = comp2;
        this.ctrl = ctrl;
      }
      postConstruct() {
        const destroyResizeFuncs = [];
        let canResize;
        let canAutosize;
        const addResize = () => {
          _setDisplayed(this.eResize, canResize);
          if (!canResize) {
            return;
          }
          const { horizontalResizeSvc, colAutosize } = this.beans;
          const finishedWithResizeFunc = horizontalResizeSvc.addResizeBar({
            eResizeBar: this.eResize,
            onResizeStart: this.onResizeStart.bind(this),
            onResizing: this.onResizing.bind(this, false),
            onResizeEnd: this.onResizing.bind(this, true)
          });
          destroyResizeFuncs.push(finishedWithResizeFunc);
          if (canAutosize && colAutosize) {
            destroyResizeFuncs.push(colAutosize.addColumnAutosizeListeners(this.eResize, this.column));
          }
        };
        const removeResize = () => {
          for (const f of destroyResizeFuncs) {
            f();
          }
          destroyResizeFuncs.length = 0;
        };
        const refresh = () => {
          const resize = this.column.isResizable();
          const autoSize = !this.gos.get("suppressAutoSize") && !this.column.getColDef().suppressAutoSize;
          const propertyChange = resize !== canResize || autoSize !== canAutosize;
          if (propertyChange) {
            canResize = resize;
            canAutosize = autoSize;
            removeResize();
            addResize();
          }
        };
        refresh();
        this.addDestroyFunc(removeResize);
        this.ctrl.setRefreshFunction("resize", refresh);
      }
      onResizing(finished, resizeAmount) {
        const { column: key2, lastResizeAmount, resizeStartWidth, beans } = this;
        const resizeAmountNormalised = this.normaliseResizeAmount(resizeAmount);
        const newWidth = resizeStartWidth + resizeAmountNormalised;
        const columnWidths = [{ key: key2, newWidth }];
        const { pinnedCols, ctrlsSvc, colResize } = beans;
        if (this.column.getPinned()) {
          const leftWidth = pinnedCols?.leftWidth ?? 0;
          const rightWidth = pinnedCols?.rightWidth ?? 0;
          const bodyWidth = _getInnerWidth(ctrlsSvc.getGridBodyCtrl().eBodyViewport) - 50;
          if (leftWidth + rightWidth + (resizeAmountNormalised - lastResizeAmount) > bodyWidth) {
            return;
          }
        }
        this.lastResizeAmount = resizeAmountNormalised;
        colResize?.setColumnWidths(columnWidths, this.resizeWithShiftKey, finished, "uiColumnResized");
        if (finished) {
          this.toggleColumnResizing(false);
        }
      }
      onResizeStart(shiftKey) {
        this.resizeStartWidth = this.column.getActualWidth();
        this.lastResizeAmount = 0;
        this.resizeWithShiftKey = shiftKey;
        this.toggleColumnResizing(true);
      }
      toggleColumnResizing(resizing) {
        this.column.resizing = resizing;
        this.comp.toggleCss("ag-column-resizing", resizing);
      }
      // optionally inverts the drag, depending on pinned and RTL
      // note - this method is duplicated in RenderedHeaderGroupCell - should refactor out?
      normaliseResizeAmount(dragChange) {
        let result2 = dragChange;
        const notPinningLeft = this.pinned !== "left";
        const pinningRight = this.pinned === "right";
        if (this.gos.get("enableRtl")) {
          if (notPinningLeft) {
            result2 *= -1;
          }
        } else if (pinningRight) {
          result2 *= -1;
        }
        return result2;
      }
    };
    var ColumnResizeService = class extends BeanStub {
      constructor() {
        super(...arguments);
        this.beanName = "colResize";
      }
      setColumnWidths(columnWidths, shiftKey, finished, source2) {
        const sets = [];
        const { colModel, gos, visibleCols } = this.beans;
        for (const columnWidth of columnWidths) {
          const col = colModel.getColDefCol(columnWidth.key) || colModel.getCol(columnWidth.key);
          if (!col) {
            continue;
          }
          sets.push({
            width: columnWidth.newWidth,
            ratios: [1],
            columns: [col]
          });
          const defaultIsShift = gos.get("colResizeDefault") === "shift";
          if (defaultIsShift) {
            shiftKey = !shiftKey;
          }
          if (shiftKey) {
            const otherCol = visibleCols.getColAfter(col);
            if (!otherCol) {
              continue;
            }
            const widthDiff = col.getActualWidth() - columnWidth.newWidth;
            const otherColWidth = otherCol.getActualWidth() + widthDiff;
            sets.push({
              width: otherColWidth,
              ratios: [1],
              columns: [otherCol]
            });
          }
        }
        if (sets.length === 0) {
          return;
        }
        this.resizeColumnSets({
          resizeSets: sets,
          finished,
          source: source2
        });
      }
      // method takes sets of columns and resizes them. either all sets will be resized, or nothing
      // be resized. this is used for example when user tries to resize a group and holds shift key,
      // then both the current group (grows), and the adjacent group (shrinks), will get resized,
      // so that's two sets for this method.
      resizeColumnSets(params) {
        const { resizeSets, finished, source: source2 } = params;
        const passMinMaxCheck = !resizeSets || resizeSets.every((columnResizeSet) => checkMinAndMaxWidthsForSet(columnResizeSet));
        if (!passMinMaxCheck) {
          if (finished) {
            const columns = resizeSets && resizeSets.length > 0 ? resizeSets[0].columns : null;
            dispatchColumnResizedEvent(this.eventSvc, columns, finished, source2);
          }
          return;
        }
        const changedCols = [];
        const allResizedCols = [];
        for (const set2 of resizeSets) {
          const { width, columns, ratios } = set2;
          const newWidths = {};
          const finishedCols = {};
          for (const col of columns) {
            allResizedCols.push(col);
          }
          let finishedColsGrew = true;
          let loopCount = 0;
          while (finishedColsGrew) {
            loopCount++;
            if (loopCount > 1e3) {
              _error(31);
              break;
            }
            finishedColsGrew = false;
            const subsetCols = [];
            let subsetRatioTotal = 0;
            let pixelsToDistribute = width;
            columns.forEach((col, index) => {
              const thisColFinished = finishedCols[col.getId()];
              if (thisColFinished) {
                pixelsToDistribute -= newWidths[col.getId()];
              } else {
                subsetCols.push(col);
                const ratioThisCol = ratios[index];
                subsetRatioTotal += ratioThisCol;
              }
            });
            const ratioScale = 1 / subsetRatioTotal;
            subsetCols.forEach((col, index) => {
              const lastCol = index === subsetCols.length - 1;
              let colNewWidth;
              if (lastCol) {
                colNewWidth = pixelsToDistribute;
              } else {
                colNewWidth = Math.round(ratios[index] * width * ratioScale);
                pixelsToDistribute -= colNewWidth;
              }
              const minWidth = col.getMinWidth();
              const maxWidth = col.getMaxWidth();
              if (colNewWidth < minWidth) {
                colNewWidth = minWidth;
                finishedCols[col.getId()] = true;
                finishedColsGrew = true;
              } else if (maxWidth > 0 && colNewWidth > maxWidth) {
                colNewWidth = maxWidth;
                finishedCols[col.getId()] = true;
                finishedColsGrew = true;
              }
              newWidths[col.getId()] = colNewWidth;
            });
          }
          for (const col of columns) {
            const newWidth = newWidths[col.getId()];
            const actualWidth = col.getActualWidth();
            if (actualWidth !== newWidth) {
              col.setActualWidth(newWidth, source2);
              changedCols.push(col);
            }
          }
        }
        const atLeastOneColChanged = changedCols.length > 0;
        let flexedCols = [];
        if (atLeastOneColChanged) {
          const { colFlex, visibleCols, colViewport } = this.beans;
          flexedCols = colFlex?.refreshFlexedColumns({
            resizingCols: allResizedCols,
            skipSetLeft: true
          }) ?? [];
          visibleCols.setLeftValues(source2);
          visibleCols.updateBodyWidths();
          colViewport.checkViewportColumns();
        }
        const colsForEvent = allResizedCols.concat(flexedCols);
        if (atLeastOneColChanged || finished) {
          dispatchColumnResizedEvent(this.eventSvc, colsForEvent, finished, source2, flexedCols);
        }
      }
      resizeHeader(column2, delta2, shiftKey) {
        if (!column2.isResizable()) {
          return;
        }
        const actualWidth = column2.getActualWidth();
        const minWidth = column2.getMinWidth();
        const maxWidth = column2.getMaxWidth();
        const newWidth = Math.min(Math.max(actualWidth + delta2, minWidth), maxWidth);
        this.setColumnWidths([{ key: column2, newWidth }], shiftKey, true, "uiColumnResized");
      }
      createResizeFeature(pinned, column2, eResize, comp2, ctrl) {
        return new ResizeFeature(pinned, column2, eResize, comp2, ctrl);
      }
      createGroupResizeFeature(comp2, eResize, pinned, columnGroup) {
        return new GroupResizeFeature(comp2, eResize, pinned, columnGroup);
      }
    };
    function checkMinAndMaxWidthsForSet(columnResizeSet) {
      const { columns, width } = columnResizeSet;
      let minWidthAccumulated = 0;
      let maxWidthAccumulated = 0;
      let maxWidthActive = true;
      for (const col of columns) {
        const minWidth = col.getMinWidth();
        minWidthAccumulated += minWidth || 0;
        const maxWidth = col.getMaxWidth();
        if (maxWidth > 0) {
          maxWidthAccumulated += maxWidth;
        } else {
          maxWidthActive = false;
        }
      }
      const minWidthPasses = width >= minWidthAccumulated;
      const maxWidthPasses = !maxWidthActive || width <= maxWidthAccumulated;
      return minWidthPasses && maxWidthPasses;
    }
    var ColumnResizeModule = {
      moduleName: "ColumnResize",
      version: VERSION,
      beans: [ColumnResizeService],
      apiFunctions: {
        setColumnWidths
      },
      dependsOn: [HorizontalResizeModule, AutoWidthModule]
    };
    var GroupWidthFeature = class extends BeanStub {
      constructor(comp2, columnGroup) {
        super();
        this.removeChildListenersFuncs = [];
        this.columnGroup = columnGroup;
        this.comp = comp2;
      }
      postConstruct() {
        this.addListenersToChildrenColumns();
        this.addManagedListeners(this.columnGroup, {
          displayedChildrenChanged: this.onDisplayedChildrenChanged.bind(this)
        });
        this.onWidthChanged();
        this.addDestroyFunc(this.removeListenersOnChildrenColumns.bind(this));
      }
      addListenersToChildrenColumns() {
        this.removeListenersOnChildrenColumns();
        const widthChangedListener = this.onWidthChanged.bind(this);
        for (const column2 of this.columnGroup.getLeafColumns()) {
          column2.__addEventListener("widthChanged", widthChangedListener);
          column2.__addEventListener("visibleChanged", widthChangedListener);
          this.removeChildListenersFuncs.push(() => {
            column2.__removeEventListener("widthChanged", widthChangedListener);
            column2.__removeEventListener("visibleChanged", widthChangedListener);
          });
        }
      }
      removeListenersOnChildrenColumns() {
        for (const func of this.removeChildListenersFuncs) {
          func();
        }
        this.removeChildListenersFuncs = [];
      }
      onDisplayedChildrenChanged() {
        this.addListenersToChildrenColumns();
        this.onWidthChanged();
      }
      onWidthChanged() {
        const columnWidth = this.columnGroup.getActualWidth();
        this.comp.setWidth(`${columnWidth}px`);
        this.comp.toggleCss("ag-hidden", columnWidth === 0);
      }
    };
    var HeaderGroupCellCtrl = class extends AbstractHeaderCellCtrl {
      constructor() {
        super(...arguments);
        this.onSuppressColMoveChange = () => {
          if (!this.isAlive() || this.isSuppressMoving()) {
            this.removeDragSource();
          } else if (!this.dragSource) {
            this.setDragSource(this.eGui);
          }
        };
      }
      wireComp(comp2, eGui, eResize, eHeaderCompWrapper, compBean) {
        const { column: column2, beans } = this;
        const { context, colNames, colHover, rangeSvc, colResize } = beans;
        this.comp = comp2;
        compBean = setupCompBean(this, context, compBean);
        this.setGui(eGui, compBean);
        this.displayName = colNames.getDisplayNameForColumnGroup(column2, "header");
        this.refreshHeaderStyles();
        this.addClasses();
        this.setupMovingCss(compBean);
        this.setupExpandable(compBean);
        this.setupTooltip();
        this.setupAutoHeight({
          wrapperElement: eHeaderCompWrapper,
          compBean
        });
        this.setupUserComp();
        this.addHeaderMouseListeners(compBean);
        this.addManagedPropertyListener("groupHeaderHeight", this.refreshMaxHeaderHeight.bind(this));
        this.refreshMaxHeaderHeight();
        const pinned = this.rowCtrl.pinned;
        const leafCols = column2.getProvidedColumnGroup().getLeafColumns();
        colHover?.createHoverFeature(compBean, leafCols, eGui);
        rangeSvc?.createRangeHighlightFeature(compBean, column2, comp2);
        compBean.createManagedBean(new SetLeftFeature(column2, eGui, beans));
        compBean.createManagedBean(new GroupWidthFeature(comp2, column2));
        if (colResize) {
          this.resizeFeature = compBean.createManagedBean(
            colResize.createGroupResizeFeature(comp2, eResize, pinned, column2)
          );
        } else {
          comp2.setResizableDisplayed(false);
        }
        compBean.createManagedBean(
          new ManagedFocusFeature(eGui, {
            shouldStopEventPropagation: this.shouldStopEventPropagation.bind(this),
            onTabKeyDown: () => void 0,
            handleKeyDown: this.handleKeyDown.bind(this),
            onFocusIn: this.onFocusIn.bind(this)
          })
        );
        this.addHighlightListeners(compBean, leafCols);
        compBean.addManagedPropertyListener("suppressMovableColumns", this.onSuppressColMoveChange);
        this.addResizeAndMoveKeyboardListeners(compBean);
        compBean.addDestroyFunc(() => this.clearComponent());
      }
      getHeaderClassParams() {
        const { column: column2, beans } = this;
        const colDef = column2.getDefinition();
        return _addGridCommonParams(beans.gos, {
          colDef,
          columnGroup: column2,
          floatingFilter: false
        });
      }
      refreshMaxHeaderHeight() {
        const { gos, comp: comp2 } = this;
        const groupHeaderHeight = gos.get("groupHeaderHeight");
        if (groupHeaderHeight != null) {
          if (groupHeaderHeight === 0) {
            comp2.setHeaderWrapperHidden(true);
          } else {
            comp2.setHeaderWrapperMaxHeight(groupHeaderHeight);
          }
        } else {
          comp2.setHeaderWrapperHidden(false);
          comp2.setHeaderWrapperMaxHeight(null);
        }
      }
      addHighlightListeners(compBean, columns) {
        if (!this.beans.gos.get("suppressMoveWhenColumnDragging")) {
          return;
        }
        for (const column2 of columns) {
          compBean.addManagedListeners(column2, {
            headerHighlightChanged: this.onLeafColumnHighlightChanged.bind(this, column2)
          });
        }
      }
      onLeafColumnHighlightChanged(column2) {
        const displayedColumns = this.column.getDisplayedLeafColumns();
        const isFirst = displayedColumns[0] === column2;
        const isLast = _last(displayedColumns) === column2;
        if (!isFirst && !isLast) {
          return;
        }
        const highlighted = column2.getHighlighted();
        const isColumnMoveAtThisLevel = !!this.rowCtrl.getHeaderCellCtrls().find((ctrl) => {
          return ctrl.column.isMoving();
        });
        let beforeOn = false;
        let afterOn = false;
        if (isColumnMoveAtThisLevel) {
          const isRtl = this.beans.gos.get("enableRtl");
          const isHighlightAfter = highlighted === 1;
          const isHighlightBefore = highlighted === 0;
          if (isFirst) {
            if (isRtl) {
              afterOn = isHighlightAfter;
            } else {
              beforeOn = isHighlightBefore;
            }
          }
          if (isLast) {
            if (isRtl) {
              beforeOn = isHighlightBefore;
            } else {
              afterOn = isHighlightAfter;
            }
          }
        }
        this.comp.toggleCss("ag-header-highlight-before", beforeOn);
        this.comp.toggleCss("ag-header-highlight-after", afterOn);
      }
      resizeHeader(delta2, shiftKey) {
        const { resizeFeature } = this;
        if (!resizeFeature) {
          return;
        }
        const initialValues = resizeFeature.getInitialValues(shiftKey);
        resizeFeature.resizeColumns(initialValues, initialValues.resizeStartWidth + delta2, "uiColumnResized", true);
      }
      resizeLeafColumnsToFit(source2) {
        this.resizeFeature?.resizeLeafColumnsToFit(source2);
      }
      setupUserComp() {
        const { colGroupSvc, userCompFactory, gos, enterpriseMenuFactory } = this.beans;
        const columnGroup = this.column;
        const providedColumnGroup = columnGroup.getProvidedColumnGroup();
        const params = _addGridCommonParams(gos, {
          displayName: this.displayName,
          columnGroup,
          setExpanded: (expanded) => {
            colGroupSvc.setColumnGroupOpened(providedColumnGroup, expanded, "gridInitializing");
          },
          setTooltip: (value2, shouldDisplayTooltip) => {
            gos.assertModuleRegistered("Tooltip", 3);
            this.setupTooltip(value2, shouldDisplayTooltip);
          },
          showColumnMenu: (buttonElement, onClosedCallback) => enterpriseMenuFactory?.showMenuAfterButtonClick(
            providedColumnGroup,
            buttonElement,
            "columnMenu",
            onClosedCallback
          ),
          showColumnMenuAfterMouseClick: (mouseEvent, onClosedCallback) => enterpriseMenuFactory?.showMenuAfterMouseEvent(
            providedColumnGroup,
            mouseEvent,
            "columnMenu",
            onClosedCallback
          ),
          eGridHeader: this.eGui
        });
        const compDetails = _getHeaderGroupCompDetails(userCompFactory, params);
        if (compDetails) {
          this.comp.setUserCompDetails(compDetails);
        }
      }
      addHeaderMouseListeners(compBean) {
        const listener = (e) => this.handleMouseOverChange(e.type === "mouseenter");
        const clickListener = () => this.dispatchColumnMouseEvent("columnHeaderClicked", this.column.getProvidedColumnGroup());
        const contextMenuListener = (event) => this.handleContextMenuMouseEvent(event, void 0, this.column.getProvidedColumnGroup());
        compBean.addManagedListeners(this.eGui, {
          mouseenter: listener,
          mouseleave: listener,
          click: clickListener,
          contextmenu: contextMenuListener
        });
      }
      handleMouseOverChange(isMouseOver) {
        this.eventSvc.dispatchEvent({
          type: isMouseOver ? "columnHeaderMouseOver" : "columnHeaderMouseLeave",
          column: this.column.getProvidedColumnGroup()
        });
      }
      setupTooltip(value2, shouldDisplayTooltip) {
        this.tooltipFeature = this.beans.tooltipSvc?.setupHeaderGroupTooltip(
          this.tooltipFeature,
          this,
          value2,
          shouldDisplayTooltip
        );
      }
      setupExpandable(compBean) {
        const providedColGroup = this.column.getProvidedColumnGroup();
        this.refreshExpanded();
        const listener = this.refreshExpanded.bind(this);
        compBean.addManagedListeners(providedColGroup, {
          expandedChanged: listener,
          expandableChanged: listener
        });
      }
      refreshExpanded() {
        const { column: column2 } = this;
        this.expandable = column2.isExpandable();
        const expanded = column2.isExpanded();
        if (this.expandable) {
          this.comp.setAriaExpanded(expanded ? "true" : "false");
        } else {
          this.comp.setAriaExpanded(void 0);
        }
        this.refreshHeaderStyles();
      }
      addClasses() {
        const { column: column2 } = this;
        const colGroupDef = column2.getColGroupDef();
        const classes = _getHeaderClassesFromColDef(colGroupDef, this.gos, null, column2);
        if (column2.isPadding()) {
          classes.push("ag-header-group-cell-no-group");
          const leafCols = column2.getLeafColumns();
          if (leafCols.every((col) => col.isSpanHeaderHeight())) {
            classes.push("ag-header-span-height");
          }
        } else {
          classes.push("ag-header-group-cell-with-group");
          if (colGroupDef?.wrapHeaderText) {
            classes.push("ag-header-cell-wrap-text");
          }
        }
        for (const c2 of classes) {
          this.comp.toggleCss(c2, true);
        }
      }
      setupMovingCss(compBean) {
        const { column: column2 } = this;
        const providedColumnGroup = column2.getProvidedColumnGroup();
        const leafColumns = providedColumnGroup.getLeafColumns();
        const listener = () => this.comp.toggleCss("ag-header-cell-moving", column2.isMoving());
        for (const col of leafColumns) {
          compBean.addManagedListeners(col, { movingChanged: listener });
        }
        listener();
      }
      onFocusIn(e) {
        if (!this.eGui.contains(e.relatedTarget)) {
          this.focusThis();
        }
      }
      handleKeyDown(e) {
        super.handleKeyDown(e);
        const wrapperHasFocus = this.getWrapperHasFocus();
        if (!this.expandable || !wrapperHasFocus) {
          return;
        }
        if (e.key === KeyCode.ENTER) {
          const column2 = this.column;
          const newExpandedValue = !column2.isExpanded();
          this.beans.colGroupSvc.setColumnGroupOpened(
            column2.getProvidedColumnGroup(),
            newExpandedValue,
            "uiColumnExpanded"
          );
        }
      }
      // unlike columns, this will only get called once, as we don't react on props on column groups
      // (we will always destroy and recreate this comp if something changes)
      setDragSource(eHeaderGroup) {
        if (!this.isAlive() || this.isSuppressMoving()) {
          return;
        }
        this.removeDragSource();
        if (!eHeaderGroup) {
          return;
        }
        this.dragSource = this.beans.colMoves?.setDragSourceForHeader(eHeaderGroup, this.column, this.displayName) ?? null;
      }
      isSuppressMoving() {
        return this.gos.get("suppressMovableColumns") || this.column.getLeafColumns().some((column2) => column2.getColDef().suppressMovable || column2.getColDef().lockPosition);
      }
      destroy() {
        this.tooltipFeature = this.destroyBean(this.tooltipFeature);
        super.destroy();
      }
    };
    function setColumnGroupOpened(beans, group, newValue) {
      beans.colGroupSvc?.setColumnGroupOpened(group, newValue, "api");
    }
    function getColumnGroup(beans, name2, instanceId) {
      return beans.colGroupSvc?.getColumnGroup(name2, instanceId) ?? null;
    }
    function getProvidedColumnGroup(beans, name2) {
      return beans.colGroupSvc?.getProvidedColGroup(name2) ?? null;
    }
    function getDisplayNameForColumnGroup(beans, columnGroup, location2) {
      return beans.colNames.getDisplayNameForColumnGroup(columnGroup, location2) || "";
    }
    function getColumnGroupState(beans) {
      return beans.colGroupSvc?.getColumnGroupState() ?? [];
    }
    function setColumnGroupState(beans, stateItems) {
      beans.colGroupSvc?.setColumnGroupState(stateItems, "api");
    }
    function resetColumnGroupState(beans) {
      beans.colGroupSvc?.resetColumnGroupState("api");
    }
    function getLeftDisplayedColumnGroups(beans) {
      return beans.visibleCols.treeLeft;
    }
    function getCenterDisplayedColumnGroups(beans) {
      return beans.visibleCols.treeCenter;
    }
    function getRightDisplayedColumnGroups(beans) {
      return beans.visibleCols.treeRight;
    }
    function getAllDisplayedColumnGroups(beans) {
      return beans.visibleCols.getAllTrees();
    }
    function _removeAllFromUnorderedArray(array, toRemove) {
      for (let i2 = 0; i2 < toRemove.length; i2++) {
        const index = array.indexOf(toRemove[i2]);
        if (index >= 0) {
          array[index] = array[array.length - 1];
          array.pop();
        }
      }
    }
    var VisibleColsService = class extends BeanStub {
      constructor() {
        super(...arguments);
        this.beanName = "visibleCols";
        this.colsAndGroupsMap = {};
        this.leftCols = [];
        this.rightCols = [];
        this.centerCols = [];
        this.allCols = [];
        this.headerGroupRowCount = 0;
        this.bodyWidth = 0;
        this.leftWidth = 0;
        this.rightWidth = 0;
        this.isBodyWidthDirty = true;
      }
      refresh(source2, skipTreeBuild = false) {
        const { colFlex, colModel, colGroupSvc, colViewport, selectionColSvc } = this.beans;
        if (!skipTreeBuild) {
          this.buildTrees(colModel, colGroupSvc);
        }
        colGroupSvc?.updateOpenClosedVisibility();
        this.leftCols = pickDisplayedCols(this.treeLeft);
        this.centerCols = pickDisplayedCols(this.treeCenter);
        this.rightCols = pickDisplayedCols(this.treeRight);
        selectionColSvc?.refreshVisibility(this.leftCols, this.centerCols, this.rightCols);
        this.joinColsAriaOrder(colModel);
        this.joinCols();
        this.headerGroupRowCount = this.getHeaderRowCount();
        this.setLeftValues(source2);
        this.autoHeightCols = this.allCols.filter((col) => col.isAutoHeight());
        colFlex?.refreshFlexedColumns();
        this.updateBodyWidths();
        this.setFirstRightAndLastLeftPinned(colModel, this.leftCols, this.rightCols, source2);
        colViewport.checkViewportColumns(false);
        this.eventSvc.dispatchEvent({
          type: "displayedColumnsChanged",
          source: source2
        });
      }
      getHeaderRowCount() {
        if (!this.gos.get("hidePaddedHeaderRows")) {
          return this.beans.colModel.cols.treeDepth;
        }
        let headerGroupRowCount = 0;
        for (const col of this.allCols) {
          let parent = col.getParent();
          while (parent) {
            if (!parent.isPadding()) {
              const level = parent.getProvidedColumnGroup().getLevel() + 1;
              if (level > headerGroupRowCount) {
                headerGroupRowCount = level;
              }
              break;
            }
            parent = parent.getParent();
          }
        }
        return headerGroupRowCount;
      }
      // after setColumnWidth or updateGroupsAndPresentedCols
      updateBodyWidths() {
        const newBodyWidth = getWidthOfColsInList(this.centerCols);
        const newLeftWidth = getWidthOfColsInList(this.leftCols);
        const newRightWidth = getWidthOfColsInList(this.rightCols);
        this.isBodyWidthDirty = this.bodyWidth !== newBodyWidth;
        const atLeastOneChanged = this.bodyWidth !== newBodyWidth || this.leftWidth !== newLeftWidth || this.rightWidth !== newRightWidth;
        if (atLeastOneChanged) {
          this.bodyWidth = newBodyWidth;
          this.leftWidth = newLeftWidth;
          this.rightWidth = newRightWidth;
          this.eventSvc.dispatchEvent({
            type: "columnContainerWidthChanged"
          });
          this.eventSvc.dispatchEvent({
            type: "displayedColumnsWidthChanged"
          });
        }
      }
      // sets the left pixel position of each column
      setLeftValues(source2) {
        this.setLeftValuesOfCols(source2);
        this.setLeftValuesOfGroups();
      }
      setFirstRightAndLastLeftPinned(colModel, leftCols, rightCols, source2) {
        let lastLeft;
        let firstRight;
        if (this.gos.get("enableRtl")) {
          lastLeft = leftCols ? leftCols[0] : null;
          firstRight = rightCols ? _last(rightCols) : null;
        } else {
          lastLeft = leftCols ? _last(leftCols) : null;
          firstRight = rightCols ? rightCols[0] : null;
        }
        for (const col of colModel.getCols()) {
          col.setLastLeftPinned(col === lastLeft, source2);
          col.setFirstRightPinned(col === firstRight, source2);
        }
      }
      buildTrees(colModel, columnGroupSvc) {
        const cols = colModel.getColsToShow();
        const leftCols = cols.filter((col) => col.getPinned() == "left");
        const rightCols = cols.filter((col) => col.getPinned() == "right");
        const centerCols = cols.filter((col) => col.getPinned() != "left" && col.getPinned() != "right");
        const idCreator = new GroupInstanceIdCreator();
        const createGroups = (params) => {
          return columnGroupSvc ? columnGroupSvc.createColumnGroups(params) : params.columns;
        };
        this.treeLeft = createGroups({
          columns: leftCols,
          idCreator,
          pinned: "left",
          oldDisplayedGroups: this.treeLeft
        });
        this.treeRight = createGroups({
          columns: rightCols,
          idCreator,
          pinned: "right",
          oldDisplayedGroups: this.treeRight
        });
        this.treeCenter = createGroups({
          columns: centerCols,
          idCreator,
          pinned: null,
          oldDisplayedGroups: this.treeCenter
        });
        this.updateColsAndGroupsMap();
      }
      clear() {
        this.leftCols = [];
        this.rightCols = [];
        this.centerCols = [];
        this.allCols = [];
        this.ariaOrderColumns = [];
      }
      joinColsAriaOrder(colModel) {
        const allColumns = colModel.getCols();
        const pinnedLeft = [];
        const center2 = [];
        const pinnedRight = [];
        for (const col of allColumns) {
          const pinned = col.getPinned();
          if (!pinned) {
            center2.push(col);
          } else if (pinned === true || pinned === "left") {
            pinnedLeft.push(col);
          } else {
            pinnedRight.push(col);
          }
        }
        this.ariaOrderColumns = pinnedLeft.concat(center2).concat(pinnedRight);
      }
      getAriaColIndex(colOrGroup) {
        let col;
        if (isColumnGroup(colOrGroup)) {
          col = colOrGroup.getLeafColumns()[0];
        } else {
          col = colOrGroup;
        }
        return this.ariaOrderColumns.indexOf(col) + 1;
      }
      setLeftValuesOfGroups() {
        for (const columns of [this.treeLeft, this.treeRight, this.treeCenter]) {
          for (const column2 of columns) {
            if (isColumnGroup(column2)) {
              const columnGroup = column2;
              columnGroup.checkLeft();
            }
          }
        }
      }
      setLeftValuesOfCols(source2) {
        const { colModel } = this.beans;
        const primaryCols = colModel.getColDefCols();
        if (!primaryCols) {
          return;
        }
        const allColumns = colModel.getCols().slice(0);
        const doingRtl = this.gos.get("enableRtl");
        for (const columns of [this.leftCols, this.rightCols, this.centerCols]) {
          if (doingRtl) {
            let left2 = getWidthOfColsInList(columns);
            for (const column2 of columns) {
              left2 -= column2.getActualWidth();
              column2.setLeft(left2, source2);
            }
          } else {
            let left2 = 0;
            for (const column2 of columns) {
              column2.setLeft(left2, source2);
              left2 += column2.getActualWidth();
            }
          }
          _removeAllFromUnorderedArray(allColumns, columns);
        }
        for (const column2 of allColumns) {
          column2.setLeft(null, source2);
        }
      }
      joinCols() {
        if (this.gos.get("enableRtl")) {
          this.allCols = this.rightCols.concat(this.centerCols).concat(this.leftCols);
        } else {
          this.allCols = this.leftCols.concat(this.centerCols).concat(this.rightCols);
        }
      }
      getAllTrees() {
        if (this.treeLeft && this.treeRight && this.treeCenter) {
          return this.treeLeft.concat(this.treeCenter).concat(this.treeRight);
        }
        return null;
      }
      // gridPanel -> ensureColumnVisible
      isColDisplayed(column2) {
        return this.allCols.indexOf(column2) >= 0;
      }
      getLeftColsForRow(rowNode) {
        const {
          leftCols,
          beans: { colModel }
        } = this;
        const colSpanActive = colModel.colSpanActive;
        if (!colSpanActive) {
          return leftCols;
        }
        return this.getColsForRow(rowNode, leftCols);
      }
      getRightColsForRow(rowNode) {
        const {
          rightCols,
          beans: { colModel }
        } = this;
        const colSpanActive = colModel.colSpanActive;
        if (!colSpanActive) {
          return rightCols;
        }
        return this.getColsForRow(rowNode, rightCols);
      }
      getColsForRow(rowNode, displayedColumns, filterCallback, emptySpaceBeforeColumn) {
        const result2 = [];
        let lastConsideredCol = null;
        for (let i2 = 0; i2 < displayedColumns.length; i2++) {
          const col = displayedColumns[i2];
          const maxAllowedColSpan = displayedColumns.length - i2;
          const colSpan = Math.min(col.getColSpan(rowNode), maxAllowedColSpan);
          const columnsToCheckFilter = [col];
          if (colSpan > 1) {
            const colsToRemove = colSpan - 1;
            for (let j = 1; j <= colsToRemove; j++) {
              columnsToCheckFilter.push(displayedColumns[i2 + j]);
            }
            i2 += colsToRemove;
          }
          let filterPasses;
          if (filterCallback) {
            filterPasses = false;
            for (const colForFilter of columnsToCheckFilter) {
              if (filterCallback(colForFilter)) {
                filterPasses = true;
              }
            }
          } else {
            filterPasses = true;
          }
          if (filterPasses) {
            if (result2.length === 0 && lastConsideredCol) {
              const gapBeforeColumn = emptySpaceBeforeColumn ? emptySpaceBeforeColumn(col) : false;
              if (gapBeforeColumn) {
                result2.push(lastConsideredCol);
              }
            }
            result2.push(col);
          }
          lastConsideredCol = col;
        }
        return result2;
      }
      getContainerWidth(pinned) {
        switch (pinned) {
          case "left":
            return this.leftWidth;
          case "right":
            return this.rightWidth;
          default:
            return this.bodyWidth;
        }
      }
      getColBefore(col) {
        const allDisplayedColumns = this.allCols;
        const oldIndex = allDisplayedColumns.indexOf(col);
        if (oldIndex > 0) {
          return allDisplayedColumns[oldIndex - 1];
        }
        return null;
      }
      isPinningLeft() {
        return this.leftCols.length > 0;
      }
      isPinningRight() {
        return this.rightCols.length > 0;
      }
      updateColsAndGroupsMap() {
        this.colsAndGroupsMap = {};
        const func = (child) => {
          this.colsAndGroupsMap[child.getUniqueId()] = child;
        };
        depthFirstAllColumnTreeSearch(this.treeCenter, false, func);
        depthFirstAllColumnTreeSearch(this.treeLeft, false, func);
        depthFirstAllColumnTreeSearch(this.treeRight, false, func);
      }
      isVisible(item2) {
        const fromMap = this.colsAndGroupsMap[item2.getUniqueId()];
        return fromMap === item2;
      }
      getFirstColumn() {
        const isRtl = this.gos.get("enableRtl");
        const queryOrder = ["leftCols", "centerCols", "rightCols"];
        if (isRtl) {
          queryOrder.reverse();
        }
        for (let i2 = 0; i2 < queryOrder.length; i2++) {
          const container2 = this[queryOrder[i2]];
          if (container2.length) {
            return isRtl ? _last(container2) : container2[0];
          }
        }
        return null;
      }
      // used by:
      // + rowRenderer -> for navigation
      getColAfter(col) {
        const allDisplayedColumns = this.allCols;
        const oldIndex = allDisplayedColumns.indexOf(col);
        if (oldIndex < allDisplayedColumns.length - 1) {
          return allDisplayedColumns[oldIndex + 1];
        }
        return null;
      }
      // used by:
      // + angularGrid -> setting pinned body width
      // note: this should be cached
      getColsLeftWidth() {
        return getWidthOfColsInList(this.leftCols);
      }
      // note: this should be cached
      getDisplayedColumnsRightWidth() {
        return getWidthOfColsInList(this.rightCols);
      }
      isColAtEdge(col, edge) {
        const allColumns = this.allCols;
        if (!allColumns.length) {
          return false;
        }
        const isFirst = edge === "first";
        let columnToCompare;
        if (isColumnGroup(col)) {
          const leafColumns = col.getDisplayedLeafColumns();
          if (!leafColumns.length) {
            return false;
          }
          columnToCompare = isFirst ? leafColumns[0] : _last(leafColumns);
        } else {
          columnToCompare = col;
        }
        return (isFirst ? allColumns[0] : _last(allColumns)) === columnToCompare;
      }
    };
    function depthFirstAllColumnTreeSearch(tree, useDisplayedChildren, callback) {
      if (!tree) {
        return;
      }
      for (let i2 = 0; i2 < tree.length; i2++) {
        const child = tree[i2];
        if (isColumnGroup(child)) {
          const childTree = useDisplayedChildren ? child.getDisplayedChildren() : child.getChildren();
          depthFirstAllColumnTreeSearch(childTree, useDisplayedChildren, callback);
        }
        callback(child);
      }
    }
    function pickDisplayedCols(tree) {
      const res = [];
      depthFirstAllColumnTreeSearch(tree, true, (child) => {
        if (isColumn(child)) {
          res.push(child);
        }
      });
      return res;
    }
    var ColumnGroupService = class extends BeanStub {
      constructor() {
        super(...arguments);
        this.beanName = "colGroupSvc";
      }
      getColumnGroupState() {
        const columnGroupState = [];
        const gridBalancedTree = this.beans.colModel.getColTree();
        depthFirstOriginalTreeSearch(null, gridBalancedTree, (node2) => {
          if (isProvidedColumnGroup(node2)) {
            columnGroupState.push({
              groupId: node2.getGroupId(),
              open: node2.isExpanded()
            });
          }
        });
        return columnGroupState;
      }
      resetColumnGroupState(source2) {
        const primaryColumnTree = this.beans.colModel.getColDefColTree();
        if (!primaryColumnTree) {
          return;
        }
        const stateItems = [];
        depthFirstOriginalTreeSearch(null, primaryColumnTree, (child) => {
          if (isProvidedColumnGroup(child)) {
            const colGroupDef = child.getColGroupDef();
            const groupState = {
              groupId: child.getGroupId(),
              open: !colGroupDef ? void 0 : colGroupDef.openByDefault
            };
            stateItems.push(groupState);
          }
        });
        this.setColumnGroupState(stateItems, source2);
      }
      setColumnGroupState(stateItems, source2) {
        const { colModel, colAnimation, visibleCols, eventSvc } = this.beans;
        const gridBalancedTree = colModel.getColTree();
        if (!gridBalancedTree.length) {
          return;
        }
        colAnimation?.start();
        const impactedGroups = [];
        for (const stateItem of stateItems) {
          const groupKey = stateItem.groupId;
          const newValue = stateItem.open;
          const providedColumnGroup = this.getProvidedColGroup(groupKey);
          if (!providedColumnGroup) {
            continue;
          }
          if (providedColumnGroup.isExpanded() === newValue) {
            continue;
          }
          providedColumnGroup.setExpanded(newValue);
          impactedGroups.push(providedColumnGroup);
        }
        visibleCols.refresh(source2, true);
        if (impactedGroups.length) {
          eventSvc.dispatchEvent({
            type: "columnGroupOpened",
            columnGroup: impactedGroups.length === 1 ? impactedGroups[0] : void 0,
            columnGroups: impactedGroups
          });
        }
        colAnimation?.finish();
      }
      // called by headerRenderer - when a header is opened or closed
      setColumnGroupOpened(key2, newValue, source2) {
        let keyAsString;
        if (isProvidedColumnGroup(key2)) {
          keyAsString = key2.getId();
        } else {
          keyAsString = key2 || "";
        }
        this.setColumnGroupState([{ groupId: keyAsString, open: newValue }], source2);
      }
      getProvidedColGroup(key2) {
        let res = null;
        depthFirstOriginalTreeSearch(null, this.beans.colModel.getColTree(), (node2) => {
          if (isProvidedColumnGroup(node2)) {
            if (node2.getId() === key2) {
              res = node2;
            }
          }
        });
        return res;
      }
      getGroupAtDirection(columnGroup, direction) {
        const requiredLevel = columnGroup.getProvidedColumnGroup().getLevel() + columnGroup.getPaddingLevel();
        const colGroupLeafColumns = columnGroup.getDisplayedLeafColumns();
        const col = direction === "After" ? _last(colGroupLeafColumns) : colGroupLeafColumns[0];
        const getDisplayColMethod = `getCol${direction}`;
        while (true) {
          const column2 = this.beans.visibleCols[getDisplayColMethod](col);
          if (!column2) {
            return null;
          }
          const groupPointer = this.getColGroupAtLevel(column2, requiredLevel);
          if (groupPointer !== columnGroup) {
            return groupPointer;
          }
        }
      }
      getColGroupAtLevel(column2, level) {
        let groupPointer = column2.getParent();
        let originalGroupLevel;
        let groupPointerLevel;
        while (true) {
          const groupPointerProvidedColumnGroup = groupPointer.getProvidedColumnGroup();
          originalGroupLevel = groupPointerProvidedColumnGroup.getLevel();
          groupPointerLevel = groupPointer.getPaddingLevel();
          if (originalGroupLevel + groupPointerLevel <= level) {
            break;
          }
          groupPointer = groupPointer.getParent();
        }
        return groupPointer;
      }
      updateOpenClosedVisibility() {
        const allColumnGroups = this.beans.visibleCols.getAllTrees();
        depthFirstAllColumnTreeSearch(allColumnGroups, false, (child) => {
          if (isColumnGroup(child)) {
            child.calculateDisplayedColumns();
          }
        });
      }
      // returns the group with matching colId and instanceId. If instanceId is missing,
      // matches only on the colId.
      getColumnGroup(colId, partId) {
        if (!colId) {
          return null;
        }
        if (isColumnGroup(colId)) {
          return colId;
        }
        const allColumnGroups = this.beans.visibleCols.getAllTrees();
        const checkPartId = typeof partId === "number";
        let result2 = null;
        depthFirstAllColumnTreeSearch(allColumnGroups, false, (child) => {
          if (isColumnGroup(child)) {
            const columnGroup = child;
            let matched;
            if (checkPartId) {
              matched = colId === columnGroup.getGroupId() && partId === columnGroup.getPartId();
            } else {
              matched = colId === columnGroup.getGroupId();
            }
            if (matched) {
              result2 = columnGroup;
            }
          }
        });
        return result2;
      }
      createColumnGroups(params) {
        const { columns, idCreator, pinned, oldDisplayedGroups, isStandaloneStructure } = params;
        const oldColumnsMapped = this.mapOldGroupsById(oldDisplayedGroups);
        const topLevelResultCols = [];
        let groupsOrColsAtCurrentLevel = columns;
        while (groupsOrColsAtCurrentLevel.length) {
          const currentlyIterating = groupsOrColsAtCurrentLevel;
          groupsOrColsAtCurrentLevel = [];
          let lastGroupedColIdx = 0;
          const createGroupToIndex = (to2) => {
            const from = lastGroupedColIdx;
            lastGroupedColIdx = to2;
            const previousNode = currentlyIterating[from];
            const previousNodeProvided = isColumnGroup(previousNode) ? previousNode.getProvidedColumnGroup() : previousNode;
            const previousNodeParent = previousNodeProvided.getOriginalParent();
            if (previousNodeParent == null) {
              for (let i2 = from; i2 < to2; i2++) {
                topLevelResultCols.push(currentlyIterating[i2]);
              }
              return;
            }
            const newGroup = this.createColumnGroup(
              previousNodeParent,
              idCreator,
              oldColumnsMapped,
              pinned,
              isStandaloneStructure
            );
            for (let i2 = from; i2 < to2; i2++) {
              newGroup.addChild(currentlyIterating[i2]);
            }
            groupsOrColsAtCurrentLevel.push(newGroup);
          };
          for (let i2 = 1; i2 < currentlyIterating.length; i2++) {
            const thisNode = currentlyIterating[i2];
            const thisNodeProvided = isColumnGroup(thisNode) ? thisNode.getProvidedColumnGroup() : thisNode;
            const thisNodeParent = thisNodeProvided.getOriginalParent();
            const previousNode = currentlyIterating[lastGroupedColIdx];
            const previousNodeProvided = isColumnGroup(previousNode) ? previousNode.getProvidedColumnGroup() : previousNode;
            const previousNodeParent = previousNodeProvided.getOriginalParent();
            if (thisNodeParent !== previousNodeParent) {
              createGroupToIndex(i2);
            }
          }
          if (lastGroupedColIdx < currentlyIterating.length) {
            createGroupToIndex(currentlyIterating.length);
          }
        }
        if (!isStandaloneStructure) {
          this.setupParentsIntoCols(topLevelResultCols, null);
        }
        return topLevelResultCols;
      }
      createProvidedColumnGroup(primaryColumns, colGroupDef, level, existingColumns, columnKeyCreator, existingGroups, source2) {
        const groupId = columnKeyCreator.getUniqueKey(colGroupDef.groupId || null, null);
        const colGroupDefMerged = createMergedColGroupDef(this.beans, colGroupDef, groupId);
        const providedGroup = new AgProvidedColumnGroup(colGroupDefMerged, groupId, false, level);
        this.createBean(providedGroup);
        const existingGroupAndIndex = this.findExistingGroup(colGroupDef, existingGroups);
        if (existingGroupAndIndex) {
          existingGroups.splice(existingGroupAndIndex.idx, 1);
        }
        const existingGroup = existingGroupAndIndex?.group;
        if (existingGroup) {
          providedGroup.setExpanded(existingGroup.isExpanded());
        }
        const children2 = _recursivelyCreateColumns(
          this.beans,
          colGroupDefMerged.children,
          level + 1,
          primaryColumns,
          existingColumns,
          columnKeyCreator,
          existingGroups,
          source2
        );
        providedGroup.setChildren(children2);
        return providedGroup;
      }
      balanceColumnTree(unbalancedTree, currentDepth, columnDepth, columnKeyCreator) {
        const result2 = [];
        for (let i2 = 0; i2 < unbalancedTree.length; i2++) {
          const child = unbalancedTree[i2];
          if (isProvidedColumnGroup(child)) {
            const originalGroup = child;
            const newChildren = this.balanceColumnTree(
              originalGroup.getChildren(),
              currentDepth + 1,
              columnDepth,
              columnKeyCreator
            );
            originalGroup.setChildren(newChildren);
            result2.push(originalGroup);
          } else {
            let firstPaddedGroup;
            let currentPaddedGroup;
            for (let j = currentDepth; j < columnDepth; j++) {
              const newColId = columnKeyCreator.getUniqueKey(null, null);
              const colGroupDefMerged = createMergedColGroupDef(this.beans, null, newColId);
              const paddedGroup = new AgProvidedColumnGroup(colGroupDefMerged, newColId, true, j);
              this.createBean(paddedGroup);
              if (currentPaddedGroup) {
                currentPaddedGroup.setChildren([paddedGroup]);
              }
              currentPaddedGroup = paddedGroup;
              if (!firstPaddedGroup) {
                firstPaddedGroup = currentPaddedGroup;
              }
            }
            if (firstPaddedGroup && currentPaddedGroup) {
              result2.push(firstPaddedGroup);
              const hasGroups = unbalancedTree.some((leaf) => isProvidedColumnGroup(leaf));
              if (hasGroups) {
                currentPaddedGroup.setChildren([child]);
                continue;
              } else {
                currentPaddedGroup.setChildren(unbalancedTree);
                break;
              }
            }
            result2.push(child);
          }
        }
        return result2;
      }
      findDepth(balancedColumnTree) {
        let depth = 0;
        let pointer = balancedColumnTree;
        while (pointer?.[0] && isProvidedColumnGroup(pointer[0])) {
          depth++;
          pointer = pointer[0].getChildren();
        }
        return depth;
      }
      findMaxDepth(treeChildren, depth) {
        let maxDepthThisLevel = depth;
        for (let i2 = 0; i2 < treeChildren.length; i2++) {
          const abstractColumn = treeChildren[i2];
          if (isProvidedColumnGroup(abstractColumn)) {
            const originalGroup = abstractColumn;
            const newDepth = this.findMaxDepth(originalGroup.getChildren(), depth + 1);
            if (maxDepthThisLevel < newDepth) {
              maxDepthThisLevel = newDepth;
            }
          }
        }
        return maxDepthThisLevel;
      }
      /**
       * Inserts dummy group columns in the hierarchy above auto-generated columns
       * in order to ensure auto-generated columns are leaf nodes (and therefore are
       * displayed correctly)
       */
      balanceTreeForAutoCols(autoCols, depth) {
        const tree = [];
        for (const col of autoCols) {
          let nextChild = col;
          for (let i2 = depth - 1; i2 >= 0; i2--) {
            const autoGroup = new AgProvidedColumnGroup(null, `FAKE_PATH_${col.getId()}}_${i2}`, true, i2);
            this.createBean(autoGroup);
            autoGroup.setChildren([nextChild]);
            nextChild.originalParent = autoGroup;
            nextChild = autoGroup;
          }
          if (depth === 0) {
            col.originalParent = null;
          }
          tree.push(nextChild);
        }
        return tree;
      }
      findExistingGroup(newGroupDef, existingGroups) {
        const newHasId = newGroupDef.groupId != null;
        if (!newHasId) {
          return void 0;
        }
        for (let i2 = 0; i2 < existingGroups.length; i2++) {
          const existingGroup = existingGroups[i2];
          const existingDef = existingGroup.getColGroupDef();
          if (!existingDef) {
            continue;
          }
          if (existingGroup.getId() === newGroupDef.groupId) {
            return { idx: i2, group: existingGroup };
          }
        }
        return void 0;
      }
      createColumnGroup(providedGroup, groupInstanceIdCreator, oldColumnsMapped, pinned, isStandaloneStructure) {
        const groupId = providedGroup.getGroupId();
        const instanceId = groupInstanceIdCreator.getInstanceIdForKey(groupId);
        const uniqueId = createUniqueColumnGroupId(groupId, instanceId);
        let columnGroup = oldColumnsMapped[uniqueId];
        if (columnGroup && columnGroup.getProvidedColumnGroup() !== providedGroup) {
          columnGroup = null;
        }
        if (_exists(columnGroup)) {
          columnGroup.reset();
        } else {
          columnGroup = new AgColumnGroup(providedGroup, groupId, instanceId, pinned);
          if (!isStandaloneStructure) {
            this.createBean(columnGroup);
          }
        }
        return columnGroup;
      }
      // returns back a 2d map of ColumnGroup as follows: groupId -> instanceId -> ColumnGroup
      mapOldGroupsById(displayedGroups) {
        const result2 = {};
        const recursive = (columnsOrGroups) => {
          for (const columnOrGroup of columnsOrGroups) {
            if (isColumnGroup(columnOrGroup)) {
              const columnGroup = columnOrGroup;
              result2[columnOrGroup.getUniqueId()] = columnGroup;
              recursive(columnGroup.getChildren());
            }
          }
        };
        if (displayedGroups) {
          recursive(displayedGroups);
        }
        return result2;
      }
      setupParentsIntoCols(columnsOrGroups, parent) {
        for (const columnsOrGroup of columnsOrGroups ?? []) {
          if (columnsOrGroup.parent !== parent) {
            this.beans.colViewport.colsWithinViewportHash = "";
          }
          columnsOrGroup.parent = parent;
          if (isColumnGroup(columnsOrGroup)) {
            const columnGroup = columnsOrGroup;
            this.setupParentsIntoCols(columnGroup.getChildren(), columnGroup);
          }
        }
      }
    };
    var ColumnGroupModule = {
      moduleName: "ColumnGroup",
      version: VERSION,
      dynamicBeans: { headerGroupCellCtrl: HeaderGroupCellCtrl },
      beans: [ColumnGroupService],
      apiFunctions: {
        getAllDisplayedColumnGroups,
        getCenterDisplayedColumnGroups,
        getColumnGroup,
        getColumnGroupState,
        getDisplayNameForColumnGroup,
        getLeftDisplayedColumnGroups,
        getProvidedColumnGroup,
        getRightDisplayedColumnGroups,
        resetColumnGroupState,
        setColumnGroupOpened,
        setColumnGroupState
      }
    };
    var SkeletonCellRendererElement = { tag: "div", cls: "ag-skeleton-container" };
    var SkeletonCellRenderer$1 = class SkeletonCellRenderer extends Component {
      constructor() {
        super(SkeletonCellRendererElement);
      }
      init(params) {
        const id = `ag-cell-skeleton-renderer-${this.getCompId()}`;
        this.getGui().setAttribute("id", id);
        this.addDestroyFunc(() => _setAriaLabelledBy(params.eParentOfValue));
        _setAriaLabelledBy(params.eParentOfValue, id);
        if (params.deferRender) {
          this.setupLoading(params);
        } else {
          params.node.failedLoad ? this.setupFailed() : this.setupLoading(params);
        }
      }
      setupFailed() {
        const localeTextFunc = this.getLocaleTextFunc();
        this.getGui().textContent = localeTextFunc("loadingError", "ERR");
        const ariaFailed = localeTextFunc("ariaSkeletonCellLoadingFailed", "Row failed to load");
        _setAriaLabel(this.getGui(), ariaFailed);
      }
      setupLoading(params) {
        const skeletonEffect = _createElement({
          tag: "div",
          cls: "ag-skeleton-effect"
        });
        const rowIndex = params.node.rowIndex;
        if (rowIndex != null) {
          const width = 75 + 25 * (rowIndex % 2 === 0 ? Math.sin(rowIndex) : Math.cos(rowIndex));
          skeletonEffect.style.width = `${width}%`;
        }
        this.getGui().appendChild(skeletonEffect);
        const localeTextFunc = this.getLocaleTextFunc();
        const ariaLoading = params.deferRender ? localeTextFunc("ariaDeferSkeletonCellLoading", "Cell is loading") : localeTextFunc("ariaSkeletonCellLoading", "Row data is loading");
        _setAriaLabel(this.getGui(), ariaLoading);
      }
      refresh(_params) {
        return false;
      }
    };
    var CheckboxCellRendererModule = {
      moduleName: "CheckboxCellRenderer",
      version: VERSION,
      userComponents: {
        agCheckboxCellRenderer: CheckboxCellRenderer
      }
    };
    var SkeletonCellRendererModule = {
      moduleName: "SkeletonCellRenderer",
      version: VERSION,
      userComponents: {
        agSkeletonCellRenderer: SkeletonCellRenderer$1
      }
    };
    function getColumnDef(beans, key2) {
      const column2 = beans.colModel.getColDefCol(key2);
      if (column2) {
        return column2.getColDef();
      }
      return null;
    }
    function getColumnDefs(beans) {
      return beans.colModel.getColumnDefs(true);
    }
    function getDisplayNameForColumn(beans, column2, location2) {
      return beans.colNames.getDisplayNameForColumn(column2, location2) || "";
    }
    function getColumn(beans, key2) {
      return beans.colModel.getColDefCol(key2);
    }
    function getColumns(beans) {
      return beans.colModel.getColDefCols();
    }
    function applyColumnState(beans, params) {
      return _applyColumnState(beans, params, "api");
    }
    function getColumnState(beans) {
      return _getColumnState(beans);
    }
    function resetColumnState(beans) {
      _resetColumnState(beans, "api");
    }
    function isPinning(beans) {
      return beans.visibleCols.isPinningLeft() || beans.visibleCols.isPinningRight();
    }
    function isPinningLeft(beans) {
      return beans.visibleCols.isPinningLeft();
    }
    function isPinningRight(beans) {
      return beans.visibleCols.isPinningRight();
    }
    function getDisplayedColAfter(beans, col) {
      return beans.visibleCols.getColAfter(col);
    }
    function getDisplayedColBefore(beans, col) {
      return beans.visibleCols.getColBefore(col);
    }
    function setColumnsVisible(beans, keys, visible2) {
      beans.colModel.setColsVisible(keys, visible2, "api");
    }
    function setColumnsPinned(beans, keys, pinned) {
      beans.pinnedCols?.setColsPinned(keys, pinned, "api");
    }
    function getAllGridColumns(beans) {
      return beans.colModel.getCols();
    }
    function getDisplayedLeftColumns(beans) {
      return beans.visibleCols.leftCols;
    }
    function getDisplayedCenterColumns(beans) {
      return beans.visibleCols.centerCols;
    }
    function getDisplayedRightColumns(beans) {
      return beans.visibleCols.rightCols;
    }
    function getAllDisplayedColumns(beans) {
      return beans.visibleCols.allCols;
    }
    function getAllDisplayedVirtualColumns(beans) {
      return beans.colViewport.getViewportColumns();
    }
    function _deepCloneDefinition(object, keysToSkip) {
      if (!object) {
        return;
      }
      const obj = object;
      const res = {};
      for (const key2 of Object.keys(obj)) {
        if (keysToSkip && keysToSkip.indexOf(key2) >= 0 || SKIP_JS_BUILTINS.has(key2)) {
          continue;
        }
        const value2 = obj[key2];
        const sourceIsSimpleObject = typeof value2 === "object" && value2 !== null && value2.constructor === Object;
        if (sourceIsSimpleObject) {
          res[key2] = _deepCloneDefinition(value2);
        } else {
          res[key2] = value2;
        }
      }
      return res;
    }
    var ColumnDefFactory = class extends BeanStub {
      constructor() {
        super(...arguments);
        this.beanName = "colDefFactory";
      }
      wireBeans(beans) {
        this.rowGroupColsSvc = beans.rowGroupColsSvc;
        this.pivotColsSvc = beans.pivotColsSvc;
      }
      getColumnDefs(colDefColsList, showingPivotResult, lastOrder, colsList, sorted = false) {
        const cols = colDefColsList.slice();
        if (showingPivotResult) {
          cols.sort((a, b) => lastOrder.indexOf(a) - lastOrder.indexOf(b));
        } else if (lastOrder || sorted) {
          cols.sort((a, b) => colsList.indexOf(a) - colsList.indexOf(b));
        }
        const rowGroupColumns = this.rowGroupColsSvc?.columns;
        const pivotColumns = this.pivotColsSvc?.columns;
        return this.buildColumnDefs(cols, rowGroupColumns, pivotColumns);
      }
      buildColumnDefs(cols, rowGroupColumns = [], pivotColumns = []) {
        const res = [];
        const colGroupDefs = {};
        for (const col of cols) {
          const colDef = this.createDefFromColumn(col, rowGroupColumns, pivotColumns);
          let addToResult = true;
          let childDef = colDef;
          let pointer = col.getOriginalParent();
          let lastPointer = null;
          while (pointer) {
            let parentDef = null;
            if (pointer.isPadding()) {
              pointer = pointer.getOriginalParent();
              continue;
            }
            const existingParentDef = colGroupDefs[pointer.getGroupId()];
            if (existingParentDef) {
              existingParentDef.children.push(childDef);
              addToResult = false;
              break;
            }
            parentDef = this.createDefFromGroup(pointer);
            if (parentDef) {
              parentDef.children = [childDef];
              colGroupDefs[parentDef.groupId] = parentDef;
              childDef = parentDef;
              pointer = pointer.getOriginalParent();
            }
            if (pointer != null && lastPointer === pointer) {
              addToResult = false;
              break;
            }
            lastPointer = pointer;
          }
          if (addToResult) {
            res.push(childDef);
          }
        }
        return res;
      }
      createDefFromGroup(group) {
        const defCloned = _deepCloneDefinition(group.getColGroupDef(), ["children"]);
        if (defCloned) {
          defCloned.groupId = group.getGroupId();
        }
        return defCloned;
      }
      createDefFromColumn(col, rowGroupColumns, pivotColumns) {
        const colDefCloned = _deepCloneDefinition(col.getColDef());
        colDefCloned.colId = col.getColId();
        colDefCloned.width = col.getActualWidth();
        colDefCloned.rowGroup = col.isRowGroupActive();
        colDefCloned.rowGroupIndex = col.isRowGroupActive() ? rowGroupColumns.indexOf(col) : null;
        colDefCloned.pivot = col.isPivotActive();
        colDefCloned.pivotIndex = col.isPivotActive() ? pivotColumns.indexOf(col) : null;
        colDefCloned.aggFunc = col.isValueActive() ? col.getAggFunc() : null;
        colDefCloned.hide = col.isVisible() ? void 0 : true;
        colDefCloned.pinned = col.isPinned() ? col.getPinned() : null;
        colDefCloned.sort = col.getSort() ? col.getSort() : null;
        colDefCloned.sortIndex = col.getSortIndex() != null ? col.getSortIndex() : null;
        return colDefCloned;
      }
    };
    var ColumnFlexService = class extends BeanStub {
      constructor() {
        super(...arguments);
        this.beanName = "colFlex";
        this.columnsHidden = false;
      }
      refreshFlexedColumns(params = {}) {
        const source2 = params.source ?? "flex";
        if (params.viewportWidth != null) {
          this.flexViewportWidth = params.viewportWidth;
        }
        const totalSpace = this.flexViewportWidth;
        const { visibleCols, colDelayRenderSvc } = this.beans;
        const visibleCenterCols = visibleCols.centerCols;
        let flexAfterDisplayIndex = -1;
        if (params.resizingCols) {
          const allResizingCols = new Set(params.resizingCols);
          for (let i2 = visibleCenterCols.length - 1; i2 >= 0; i2--) {
            if (allResizingCols.has(visibleCenterCols[i2])) {
              flexAfterDisplayIndex = i2;
              break;
            }
          }
        }
        let hasFlexItems = false;
        const items = visibleCenterCols.map((col, i2) => {
          const flex2 = col.getFlex();
          const isFlex = flex2 != null && flex2 > 0 && i2 > flexAfterDisplayIndex;
          hasFlexItems || (hasFlexItems = isFlex);
          return {
            col,
            isFlex,
            flex: Math.max(0, flex2 ?? 0),
            initialSize: col.getActualWidth(),
            min: col.getMinWidth(),
            max: col.getMaxWidth(),
            targetSize: 0
          };
        });
        if (hasFlexItems) {
          colDelayRenderSvc?.hideColumns("colFlex");
          this.columnsHidden = true;
        } else if (this.columnsHidden) {
          this.revealColumns(colDelayRenderSvc);
        }
        if (!totalSpace || !hasFlexItems) {
          return [];
        }
        let unfrozenItemCount = items.length;
        let unfrozenFlex = items.reduce((acc, item2) => acc + item2.flex, 0);
        let unfrozenSpace = totalSpace;
        const freeze2 = (item2, width) => {
          item2.frozenSize = width;
          item2.col.setActualWidth(width, source2);
          unfrozenSpace -= width;
          unfrozenFlex -= item2.flex;
          unfrozenItemCount -= 1;
        };
        const isFrozen2 = (item2) => item2.frozenSize != null;
        for (const item2 of items) {
          if (!item2.isFlex) {
            freeze2(item2, item2.initialSize);
          }
        }
        while (unfrozenItemCount > 0) {
          const spaceToFill = Math.round(unfrozenFlex < 1 ? unfrozenSpace * unfrozenFlex : unfrozenSpace);
          let lastUnfrozenItem;
          let actualLeft = 0;
          let idealRight = 0;
          for (const item2 of items) {
            if (isFrozen2(item2)) {
              continue;
            }
            lastUnfrozenItem = item2;
            idealRight += spaceToFill * (item2.flex / unfrozenFlex);
            const idealSize = idealRight - actualLeft;
            const roundedSize = Math.round(idealSize);
            item2.targetSize = roundedSize;
            actualLeft += roundedSize;
          }
          if (lastUnfrozenItem) {
            lastUnfrozenItem.targetSize += spaceToFill - actualLeft;
          }
          let totalViolation = 0;
          for (const item2 of items) {
            if (isFrozen2(item2)) {
              continue;
            }
            const unclampedSize = item2.targetSize;
            const clampedSize = Math.min(Math.max(unclampedSize, item2.min), item2.max);
            totalViolation += clampedSize - unclampedSize;
            item2.violationType = clampedSize === unclampedSize ? void 0 : clampedSize < unclampedSize ? "max" : "min";
            item2.targetSize = clampedSize;
          }
          const freezeType = totalViolation === 0 ? "all" : totalViolation > 0 ? "min" : "max";
          for (const item2 of items) {
            if (isFrozen2(item2)) {
              continue;
            }
            if (freezeType === "all" || item2.violationType === freezeType) {
              freeze2(item2, item2.targetSize);
            }
          }
        }
        if (!params.skipSetLeft) {
          visibleCols.setLeftValues(source2);
        }
        if (params.updateBodyWidths) {
          visibleCols.updateBodyWidths();
        }
        const unconstrainedFlexColumns = items.filter((item2) => item2.isFlex && !item2.violationType).map((item2) => item2.col);
        if (params.fireResizedEvent) {
          const changedColumns = items.filter((item2) => item2.initialSize !== item2.frozenSize).map((item2) => item2.col);
          const flexingColumns = items.filter((item2) => item2.flex).map((item2) => item2.col);
          dispatchColumnResizedEvent(this.eventSvc, changedColumns, true, source2, flexingColumns);
        }
        this.revealColumns(colDelayRenderSvc);
        return unconstrainedFlexColumns;
      }
      revealColumns(colDelayRenderSvc) {
        if (this.columnsHidden) {
          colDelayRenderSvc?.revealColumns("colFlex");
          this.columnsHidden = false;
        }
      }
      initCol(column2) {
        const { flex: flex2, initialFlex } = column2.colDef;
        if (flex2 !== void 0) {
          column2.flex = flex2;
        } else if (initialFlex !== void 0) {
          column2.flex = initialFlex;
        }
      }
      // this method should only be used by the colModel to
      // change flex when required by the applyColumnState method.
      setColFlex(column2, flex2) {
        column2.flex = flex2 ?? null;
        column2.dispatchStateUpdatedEvent("flex");
      }
    };
    function _getValueUsingField(data, field, fieldContainsDots) {
      if (!field || !data) {
        return;
      }
      if (!fieldContainsDots) {
        return data[field];
      }
      const fields = field.split(".");
      let currentObject = data;
      for (let i2 = 0; i2 < fields.length; i2++) {
        if (currentObject == null) {
          return void 0;
        }
        currentObject = currentObject[fields[i2]];
      }
      return currentObject;
    }
    var SORTED_CELL_DATA_TYPES_FOR_MATCHING = [
      "dateTimeString",
      "dateString",
      "text",
      "number",
      "boolean",
      "date"
    ];
    var DataTypeService = class extends BeanStub {
      constructor() {
        super(...arguments);
        this.beanName = "dataTypeSvc";
        this.dataTypeDefinitions = {};
        this.isPendingInference = false;
        this.isColumnTypeOverrideInDataTypeDefinitions = false;
        this.columnStateUpdatesPendingInference = {};
        this.columnStateUpdateListenerDestroyFuncs = [];
        this.columnDefinitionPropsPerDataType = {
          number() {
            return { cellEditor: "agNumberCellEditor" };
          },
          boolean() {
            return {
              cellEditor: "agCheckboxCellEditor",
              cellRenderer: "agCheckboxCellRenderer",
              getFindText: () => null,
              suppressKeyboardEvent: (params) => !!params.colDef.editable && params.event.key === KeyCode.SPACE
            };
          },
          date({ formatValue }) {
            return { cellEditor: "agDateCellEditor", keyCreator: formatValue };
          },
          dateString({ formatValue }) {
            return { cellEditor: "agDateStringCellEditor", keyCreator: formatValue };
          },
          dateTime(args2) {
            return this.date(args2);
          },
          dateTimeString(args2) {
            return this.dateString(args2);
          },
          object({ formatValue, colModel, colId }) {
            return {
              cellEditorParams: {
                useFormatter: true
              },
              comparator: (a, b) => {
                const column2 = colModel.getColDefCol(colId);
                const colDef = column2?.getColDef();
                if (!column2 || !colDef) {
                  return 0;
                }
                const valA = a == null ? "" : formatValue({ column: column2, node: null, value: a });
                const valB = b == null ? "" : formatValue({ column: column2, node: null, value: b });
                if (valA === valB) {
                  return 0;
                }
                return valA > valB ? 1 : -1;
              },
              keyCreator: formatValue
            };
          },
          text() {
            return {};
          }
        };
      }
      wireBeans(beans) {
        this.colModel = beans.colModel;
      }
      postConstruct() {
        this.processDataTypeDefinitions();
        this.addManagedPropertyListener("dataTypeDefinitions", (event) => {
          this.processDataTypeDefinitions();
          this.colModel.recreateColumnDefs(event);
        });
      }
      processDataTypeDefinitions() {
        const defaultDataTypes = this.getDefaultDataTypes();
        const newDataTypeDefinitions = {};
        const newFormatValueFuncs = {};
        const generateFormatValueFunc = (dataTypeDefinition) => {
          return (params) => {
            const { column: column2, node: node2, value: value2 } = params;
            let valueFormatter = column2.getColDef().valueFormatter;
            if (valueFormatter === dataTypeDefinition.groupSafeValueFormatter) {
              valueFormatter = dataTypeDefinition.valueFormatter;
            }
            return this.beans.valueSvc.formatValue(column2, node2, value2, valueFormatter);
          };
        };
        for (const cellDataType of Object.keys(defaultDataTypes)) {
          const defaultDataTypeDef = defaultDataTypes[cellDataType];
          const mergedDataTypeDefinition = {
            ...defaultDataTypeDef,
            groupSafeValueFormatter: createGroupSafeValueFormatter(defaultDataTypeDef, this.gos)
          };
          newDataTypeDefinitions[cellDataType] = mergedDataTypeDefinition;
          newFormatValueFuncs[cellDataType] = generateFormatValueFunc(mergedDataTypeDefinition);
        }
        const userDataTypeDefs = this.gos.get("dataTypeDefinitions") ?? {};
        const newDataTypeMatchers = {};
        for (const cellDataType of Object.keys(userDataTypeDefs)) {
          const userDataTypeDef = userDataTypeDefs[cellDataType];
          const mergedDataTypeDefinition = this.processDataTypeDefinition(
            userDataTypeDef,
            userDataTypeDefs,
            [cellDataType],
            defaultDataTypes
          );
          if (mergedDataTypeDefinition) {
            newDataTypeDefinitions[cellDataType] = mergedDataTypeDefinition;
            if (userDataTypeDef.dataTypeMatcher) {
              newDataTypeMatchers[cellDataType] = userDataTypeDef.dataTypeMatcher;
            }
            newFormatValueFuncs[cellDataType] = generateFormatValueFunc(mergedDataTypeDefinition);
          }
        }
        const { valueParser: defaultValueParser, valueFormatter: defaultValueFormatter } = defaultDataTypes.object;
        const { valueParser: userValueParser, valueFormatter: userValueFormatter } = newDataTypeDefinitions.object;
        this.hasObjectValueParser = userValueParser !== defaultValueParser;
        this.hasObjectValueFormatter = userValueFormatter !== defaultValueFormatter;
        this.formatValueFuncs = newFormatValueFuncs;
        this.dataTypeDefinitions = newDataTypeDefinitions;
        this.dataTypeMatchers = this.sortKeysInMatchers(newDataTypeMatchers, defaultDataTypes);
      }
      /**
       * Sorts the keys in the matchers object.
       * Does not mutate the original object, creates a copy of it with sorted keys instead.
       */
      sortKeysInMatchers(matchers, dataTypes) {
        const sortedMatchers = { ...matchers };
        for (const cellDataType of SORTED_CELL_DATA_TYPES_FOR_MATCHING) {
          delete sortedMatchers[cellDataType];
          sortedMatchers[cellDataType] = matchers[cellDataType] ?? dataTypes[cellDataType].dataTypeMatcher;
        }
        return sortedMatchers;
      }
      processDataTypeDefinition(userDataTypeDef, userDataTypeDefs, alreadyProcessedDataTypes, defaultDataTypes) {
        let mergedDataTypeDefinition;
        const extendsCellDataType = userDataTypeDef.extendsDataType;
        if (userDataTypeDef.columnTypes) {
          this.isColumnTypeOverrideInDataTypeDefinitions = true;
        }
        if (userDataTypeDef.extendsDataType === userDataTypeDef.baseDataType) {
          let baseDataTypeDefinition = defaultDataTypes[extendsCellDataType];
          const overriddenBaseDataTypeDefinition = userDataTypeDefs[extendsCellDataType];
          if (baseDataTypeDefinition && overriddenBaseDataTypeDefinition) {
            baseDataTypeDefinition = overriddenBaseDataTypeDefinition;
          }
          if (!validateDataTypeDefinition(userDataTypeDef, baseDataTypeDefinition, extendsCellDataType)) {
            return void 0;
          }
          mergedDataTypeDefinition = mergeDataTypeDefinitions(baseDataTypeDefinition, userDataTypeDef);
        } else {
          if (alreadyProcessedDataTypes.includes(extendsCellDataType)) {
            _warn(44);
            return void 0;
          }
          const extendedDataTypeDefinition = userDataTypeDefs[extendsCellDataType];
          if (!validateDataTypeDefinition(userDataTypeDef, extendedDataTypeDefinition, extendsCellDataType)) {
            return void 0;
          }
          const mergedExtendedDataTypeDefinition = this.processDataTypeDefinition(
            extendedDataTypeDefinition,
            userDataTypeDefs,
            [...alreadyProcessedDataTypes, extendsCellDataType],
            defaultDataTypes
          );
          if (!mergedExtendedDataTypeDefinition) {
            return void 0;
          }
          mergedDataTypeDefinition = mergeDataTypeDefinitions(mergedExtendedDataTypeDefinition, userDataTypeDef);
        }
        return {
          ...mergedDataTypeDefinition,
          groupSafeValueFormatter: createGroupSafeValueFormatter(mergedDataTypeDefinition, this.gos)
        };
      }
      updateColDefAndGetColumnType(colDef, userColDef, colId) {
        let { cellDataType } = userColDef;
        const { field } = userColDef;
        if (cellDataType === void 0) {
          cellDataType = colDef.cellDataType;
        }
        if (cellDataType == null || cellDataType === true) {
          cellDataType = this.canInferCellDataType(colDef, userColDef) ? this.inferCellDataType(field, colId) : false;
        }
        if (!cellDataType) {
          colDef.cellDataType = false;
          return void 0;
        }
        const dataTypeDefinition = this.dataTypeDefinitions[cellDataType];
        if (!dataTypeDefinition) {
          _warn(47, { cellDataType });
          return void 0;
        }
        colDef.cellDataType = cellDataType;
        if (dataTypeDefinition.groupSafeValueFormatter) {
          colDef.valueFormatter = dataTypeDefinition.groupSafeValueFormatter;
        }
        if (dataTypeDefinition.valueParser) {
          colDef.valueParser = dataTypeDefinition.valueParser;
        }
        if (!dataTypeDefinition.suppressDefaultProperties) {
          this.setColDefPropertiesForBaseDataType(colDef, cellDataType, dataTypeDefinition, colId);
        }
        return dataTypeDefinition.columnTypes;
      }
      addColumnListeners(column2) {
        if (!this.isPendingInference) {
          return;
        }
        const columnStateUpdates = this.columnStateUpdatesPendingInference[column2.getColId()];
        if (!columnStateUpdates) {
          return;
        }
        const columnListener = (event) => {
          columnStateUpdates.add(event.key);
        };
        column2.__addEventListener("columnStateUpdated", columnListener);
        this.columnStateUpdateListenerDestroyFuncs.push(
          () => column2.__removeEventListener("columnStateUpdated", columnListener)
        );
      }
      canInferCellDataType(colDef, userColDef) {
        const { gos } = this;
        if (!_isClientSideRowModel(gos)) {
          return false;
        }
        const propsToCheckForInference = { cellRenderer: true, valueGetter: true, valueParser: true, refData: true };
        if (doColDefPropsPreventInference(userColDef, propsToCheckForInference)) {
          return false;
        }
        const columnTypes = userColDef.type === null ? colDef.type : userColDef.type;
        if (columnTypes) {
          const columnTypeDefs = gos.get("columnTypes") ?? {};
          const hasPropsPreventingInference = convertColumnTypes(columnTypes).some((columnType) => {
            const columnTypeDef = columnTypeDefs[columnType.trim()];
            return columnTypeDef && doColDefPropsPreventInference(columnTypeDef, propsToCheckForInference);
          });
          if (hasPropsPreventingInference) {
            return false;
          }
        }
        return !doColDefPropsPreventInference(colDef, propsToCheckForInference);
      }
      inferCellDataType(field, colId) {
        if (!field) {
          return void 0;
        }
        let value2;
        const initialData = this.getInitialData();
        if (initialData) {
          const fieldContainsDots = field.includes(".") && !this.gos.get("suppressFieldDotNotation");
          value2 = _getValueUsingField(initialData, field, fieldContainsDots);
        } else {
          this.initWaitForRowData(colId);
        }
        if (value2 == null) {
          return void 0;
        }
        const matchedType = Object.keys(this.dataTypeMatchers).find(
          (_cellDataType) => this.dataTypeMatchers[_cellDataType](value2)
        );
        return matchedType ?? "object";
      }
      getInitialData() {
        const rowData = this.gos.get("rowData");
        if (rowData?.length) {
          return rowData[0];
        } else if (this.initialData) {
          return this.initialData;
        } else {
          const rowNodes = this.beans.rowModel.rootNode?._leafs;
          if (rowNodes?.length) {
            return rowNodes[0].data;
          }
        }
        return null;
      }
      initWaitForRowData(colId) {
        this.columnStateUpdatesPendingInference[colId] = /* @__PURE__ */ new Set();
        if (this.isPendingInference) {
          return;
        }
        this.isPendingInference = true;
        const columnTypeOverridesExist = this.isColumnTypeOverrideInDataTypeDefinitions;
        const { colAutosize, eventSvc } = this.beans;
        if (columnTypeOverridesExist && colAutosize) {
          colAutosize.shouldQueueResizeOperations = true;
        }
        const [destroyFunc] = this.addManagedEventListeners({
          rowDataUpdateStarted: (event) => {
            const { firstRowData } = event;
            if (!firstRowData) {
              return;
            }
            destroyFunc?.();
            this.isPendingInference = false;
            this.processColumnsPendingInference(firstRowData, columnTypeOverridesExist);
            this.columnStateUpdatesPendingInference = {};
            if (columnTypeOverridesExist) {
              colAutosize?.processResizeOperations();
            }
            eventSvc.dispatchEvent({
              type: "dataTypesInferred"
            });
          }
        });
      }
      processColumnsPendingInference(firstRowData, columnTypeOverridesExist) {
        this.initialData = firstRowData;
        const state = [];
        this.destroyColumnStateUpdateListeners();
        const newRowGroupColumnStateWithoutIndex = {};
        const newPivotColumnStateWithoutIndex = {};
        for (const colId of Object.keys(this.columnStateUpdatesPendingInference)) {
          const columnStateUpdates = this.columnStateUpdatesPendingInference[colId];
          const column2 = this.colModel.getCol(colId);
          if (!column2) {
            return;
          }
          const oldColDef = column2.getColDef();
          if (!this.resetColDefIntoCol(column2, "cellDataTypeInferred")) {
            return;
          }
          const newColDef = column2.getColDef();
          if (columnTypeOverridesExist && newColDef.type && newColDef.type !== oldColDef.type) {
            const updatedColumnState = getUpdatedColumnState(column2, columnStateUpdates);
            if (updatedColumnState.rowGroup && updatedColumnState.rowGroupIndex == null) {
              newRowGroupColumnStateWithoutIndex[colId] = updatedColumnState;
            }
            if (updatedColumnState.pivot && updatedColumnState.pivotIndex == null) {
              newPivotColumnStateWithoutIndex[colId] = updatedColumnState;
            }
            state.push(updatedColumnState);
          }
        }
        if (columnTypeOverridesExist) {
          state.push(
            ...this.generateColumnStateForRowGroupAndPivotIndexes(
              newRowGroupColumnStateWithoutIndex,
              newPivotColumnStateWithoutIndex
            )
          );
        }
        if (state.length) {
          _applyColumnState(this.beans, { state }, "cellDataTypeInferred");
        }
        this.initialData = null;
      }
      generateColumnStateForRowGroupAndPivotIndexes(updatedRowGroupColumnState, updatedPivotColumnState) {
        const existingColumnStateUpdates = {};
        const { rowGroupColsSvc, pivotColsSvc } = this.beans;
        rowGroupColsSvc?.restoreColumnOrder(existingColumnStateUpdates, updatedRowGroupColumnState);
        pivotColsSvc?.restoreColumnOrder(existingColumnStateUpdates, updatedPivotColumnState);
        return Object.values(existingColumnStateUpdates);
      }
      resetColDefIntoCol(column2, source2) {
        const userColDef = column2.getUserProvidedColDef();
        if (!userColDef) {
          return false;
        }
        const newColDef = _addColumnDefaultAndTypes(this.beans, userColDef, column2.getColId());
        column2.setColDef(newColDef, userColDef, source2);
        return true;
      }
      getDateStringTypeDefinition(column2) {
        const { dateString } = this.dataTypeDefinitions;
        if (!column2) {
          return dateString;
        }
        return this.getDataTypeDefinition(column2) ?? dateString;
      }
      getDateParserFunction(column2) {
        return this.getDateStringTypeDefinition(column2).dateParser;
      }
      getDateFormatterFunction(column2) {
        return this.getDateStringTypeDefinition(column2).dateFormatter;
      }
      getDateIncludesTimeFlag(cellDataType) {
        return cellDataType === "dateTime" || cellDataType === "dateTimeString";
      }
      getDataTypeDefinition(column2) {
        const colDef = column2.getColDef();
        if (!colDef.cellDataType) {
          return void 0;
        }
        return this.dataTypeDefinitions[colDef.cellDataType];
      }
      getBaseDataType(column2) {
        return this.getDataTypeDefinition(column2)?.baseDataType;
      }
      checkType(column2, value2) {
        if (value2 == null) {
          return true;
        }
        const dataTypeMatcher = this.getDataTypeDefinition(column2)?.dataTypeMatcher;
        if (!dataTypeMatcher) {
          return true;
        }
        return dataTypeMatcher(value2);
      }
      validateColDef(colDef) {
        const warning2 = (property2) => _warn(48, { property: property2 });
        if (colDef.cellDataType === "object") {
          const { object } = this.dataTypeDefinitions;
          if (colDef.valueFormatter === object.groupSafeValueFormatter && !this.hasObjectValueFormatter) {
            warning2("Formatter");
          }
          if (colDef.editable && colDef.valueParser === object.valueParser && !this.hasObjectValueParser) {
            warning2("Parser");
          }
        }
      }
      postProcess(colDef) {
        const cellDataType = colDef.cellDataType;
        if (!cellDataType || typeof cellDataType !== "string") {
          return;
        }
        const { dataTypeDefinitions, beans, formatValueFuncs } = this;
        const dataTypeDefinition = dataTypeDefinitions[cellDataType];
        if (!dataTypeDefinition) {
          return;
        }
        beans.colFilter?.setColDefPropsForDataType(colDef, dataTypeDefinition, formatValueFuncs[cellDataType]);
      }
      // noinspection JSUnusedGlobalSymbols
      getFormatValue(cellDataType) {
        return this.formatValueFuncs[cellDataType];
      }
      isColPendingInference(colId) {
        return this.isPendingInference && !!this.columnStateUpdatesPendingInference[colId];
      }
      setColDefPropertiesForBaseDataType(colDef, cellDataType, dataTypeDefinition, colId) {
        const formatValue = this.formatValueFuncs[cellDataType];
        const partialColDef = this.columnDefinitionPropsPerDataType[dataTypeDefinition.baseDataType]({
          colDef,
          cellDataType,
          colModel: this.colModel,
          dataTypeDefinition,
          colId,
          formatValue
        });
        Object.assign(colDef, partialColDef);
      }
      getDateObjectTypeDef(baseDataType) {
        const translate = this.getLocaleTextFunc();
        const includeTime = this.getDateIncludesTimeFlag(baseDataType);
        return {
          baseDataType,
          valueParser: (params) => _parseDateTimeFromString(params.newValue && String(params.newValue)),
          valueFormatter: (params) => {
            if (params.value == null) {
              return "";
            }
            if (!(params.value instanceof Date) || isNaN(params.value.getTime())) {
              return translate("invalidDate", "Invalid Date");
            }
            return _serialiseDate(params.value, includeTime) ?? "";
          },
          dataTypeMatcher: (value2) => value2 instanceof Date
        };
      }
      getDateStringTypeDef(baseDataType) {
        const includeTime = this.getDateIncludesTimeFlag(baseDataType);
        return {
          baseDataType,
          dateParser: (value2) => _parseDateTimeFromString(value2) ?? void 0,
          dateFormatter: (value2) => _serialiseDate(value2 ?? null, includeTime) ?? void 0,
          valueParser: (params) => _isValidDate(String(params.newValue)) ? params.newValue : null,
          valueFormatter: (params) => _isValidDate(String(params.value)) ? String(params.value) : "",
          dataTypeMatcher: (value2) => typeof value2 === "string" && _isValidDate(value2)
        };
      }
      getDefaultDataTypes() {
        const translate = this.getLocaleTextFunc();
        return {
          number: {
            baseDataType: "number",
            // can be empty space with legacy copy
            valueParser: (params) => params.newValue?.trim?.() === "" ? null : Number(params.newValue),
            valueFormatter: (params) => {
              if (params.value == null) {
                return "";
              }
              if (typeof params.value !== "number" || isNaN(params.value)) {
                return translate("invalidNumber", "Invalid Number");
              }
              return String(params.value);
            },
            dataTypeMatcher: (value2) => typeof value2 === "number"
          },
          text: {
            baseDataType: "text",
            valueParser: (params) => params.newValue === "" ? null : _toStringOrNull(params.newValue),
            dataTypeMatcher: (value2) => typeof value2 === "string"
          },
          boolean: {
            baseDataType: "boolean",
            valueParser: (params) => {
              if (params.newValue == null) {
                return params.newValue;
              }
              return params.newValue?.trim?.() === "" ? null : String(params.newValue).toLowerCase() === "true";
            },
            valueFormatter: (params) => params.value == null ? "" : String(params.value),
            dataTypeMatcher: (value2) => typeof value2 === "boolean"
          },
          date: this.getDateObjectTypeDef("date"),
          dateString: this.getDateStringTypeDef("dateString"),
          dateTime: this.getDateObjectTypeDef("dateTime"),
          dateTimeString: {
            ...this.getDateStringTypeDef("dateTimeString"),
            dataTypeMatcher: (value2) => typeof value2 === "string" && _isValidDateTime(value2)
          },
          object: {
            baseDataType: "object",
            valueParser: () => null,
            valueFormatter: (params) => _toStringOrNull(params.value) ?? ""
          }
        };
      }
      destroyColumnStateUpdateListeners() {
        for (const destroyFunc of this.columnStateUpdateListenerDestroyFuncs) {
          destroyFunc();
        }
        this.columnStateUpdateListenerDestroyFuncs = [];
      }
      destroy() {
        this.dataTypeDefinitions = {};
        this.dataTypeMatchers = {};
        this.formatValueFuncs = {};
        this.columnStateUpdatesPendingInference = {};
        this.destroyColumnStateUpdateListeners();
        super.destroy();
      }
    };
    function mergeDataTypeDefinitions(parentDataTypeDefinition, childDataTypeDefinition) {
      const mergedDataTypeDefinition = {
        ...parentDataTypeDefinition,
        ...childDataTypeDefinition
      };
      if (parentDataTypeDefinition.columnTypes && childDataTypeDefinition.columnTypes && childDataTypeDefinition.appendColumnTypes) {
        mergedDataTypeDefinition.columnTypes = [
          ...convertColumnTypes(parentDataTypeDefinition.columnTypes),
          ...convertColumnTypes(childDataTypeDefinition.columnTypes)
        ];
      }
      return mergedDataTypeDefinition;
    }
    function validateDataTypeDefinition(dataTypeDefinition, parentDataTypeDefinition, parentCellDataType) {
      if (!parentDataTypeDefinition) {
        _warn(45, { parentCellDataType });
        return false;
      }
      if (parentDataTypeDefinition.baseDataType !== dataTypeDefinition.baseDataType) {
        _warn(46);
        return false;
      }
      return true;
    }
    function createGroupSafeValueFormatter(dataTypeDefinition, gos) {
      if (!dataTypeDefinition.valueFormatter) {
        return void 0;
      }
      return (params) => {
        if (params.node?.group) {
          const aggFunc = (params.colDef.pivotValueColumn ?? params.column).getAggFunc();
          if (aggFunc) {
            if (aggFunc === "first" || aggFunc === "last") {
              return dataTypeDefinition.valueFormatter(params);
            }
            if (dataTypeDefinition.baseDataType === "number" && aggFunc !== "count") {
              if (typeof params.value === "number") {
                return dataTypeDefinition.valueFormatter(params);
              }
              if (typeof params.value === "object") {
                if (!params.value) {
                  return void 0;
                }
                if ("toNumber" in params.value) {
                  return dataTypeDefinition.valueFormatter({
                    ...params,
                    value: params.value.toNumber()
                  });
                }
                if ("value" in params.value) {
                  return dataTypeDefinition.valueFormatter({
                    ...params,
                    value: params.value.value
                  });
                }
              }
            }
            return void 0;
          }
        } else if (gos.get("groupHideOpenParents") && params.column.isRowGroupActive()) {
          if (typeof params.value === "string" && !dataTypeDefinition.dataTypeMatcher?.(params.value)) {
            return void 0;
          }
        }
        return dataTypeDefinition.valueFormatter(params);
      };
    }
    function doesColDefPropPreventInference(colDef, checkProps, prop2, comparisonValue) {
      if (!checkProps[prop2]) {
        return false;
      }
      const value2 = colDef[prop2];
      if (value2 === null) {
        checkProps[prop2] = false;
        return false;
      } else {
        return comparisonValue === void 0 ? !!value2 : value2 === comparisonValue;
      }
    }
    function doColDefPropsPreventInference(colDef, propsToCheckForInference) {
      return [
        ["cellRenderer", "agSparklineCellRenderer"],
        ["valueGetter", void 0],
        ["valueParser", void 0],
        ["refData", void 0]
      ].some(
        ([prop2, comparisonValue]) => doesColDefPropPreventInference(colDef, propsToCheckForInference, prop2, comparisonValue)
      );
    }
    function getUpdatedColumnState(column2, columnStateUpdates) {
      const columnState = getColumnStateFromColDef(column2);
      for (const key2 of columnStateUpdates) {
        delete columnState[key2];
        if (key2 === "rowGroup") {
          delete columnState.rowGroupIndex;
        } else if (key2 === "pivot") {
          delete columnState.pivotIndex;
        }
      }
      return columnState;
    }
    var DataTypeModule = {
      moduleName: "DataType",
      version: VERSION,
      beans: [DataTypeService],
      dependsOn: [CheckboxCellRendererModule]
    };
    var ColumnFlexModule = {
      moduleName: "ColumnFlex",
      version: VERSION,
      beans: [ColumnFlexService]
    };
    var ColumnApiModule = {
      moduleName: "ColumnApi",
      version: VERSION,
      beans: [ColumnDefFactory],
      apiFunctions: {
        getColumnDef,
        getDisplayNameForColumn,
        getColumn,
        getColumns,
        applyColumnState,
        getColumnState,
        resetColumnState,
        isPinning,
        isPinningLeft,
        isPinningRight,
        getDisplayedColAfter,
        getDisplayedColBefore,
        setColumnsVisible,
        setColumnsPinned,
        getAllGridColumns,
        getDisplayedLeftColumns,
        getDisplayedCenterColumns,
        getDisplayedRightColumns,
        getAllDisplayedColumns,
        getAllDisplayedVirtualColumns,
        getColumnDefs
      }
    };
    function _camelCaseToHumanText(camelCase) {
      if (!camelCase || camelCase == null) {
        return null;
      }
      const rex = /([a-z])([A-Z])/g;
      const rexCaps = /([A-Z]+)([A-Z])([a-z])/g;
      const words = camelCase.replace(rex, "$1 $2").replace(rexCaps, "$1 $2$3").replace(/\./g, " ").split(" ");
      return words.map((word) => word.substring(0, 1).toUpperCase() + (word.length > 1 ? word.substring(1, word.length) : "")).join(" ");
    }
    var ColumnNameService = class extends BeanStub {
      constructor() {
        super(...arguments);
        this.beanName = "colNames";
      }
      getDisplayNameForColumn(column2, location2, includeAggFunc = false) {
        if (!column2) {
          return null;
        }
        const headerName = this.getHeaderName(column2.getColDef(), column2, null, null, location2);
        const { aggColNameSvc } = this.beans;
        if (includeAggFunc && aggColNameSvc) {
          return aggColNameSvc.getHeaderName(column2, headerName);
        }
        return headerName;
      }
      getDisplayNameForProvidedColumnGroup(columnGroup, providedColumnGroup, location2) {
        const colGroupDef = providedColumnGroup?.getColGroupDef();
        if (colGroupDef) {
          return this.getHeaderName(colGroupDef, null, columnGroup, providedColumnGroup, location2);
        }
        return null;
      }
      getDisplayNameForColumnGroup(columnGroup, location2) {
        return this.getDisplayNameForProvidedColumnGroup(columnGroup, columnGroup.getProvidedColumnGroup(), location2);
      }
      // location is where the column is going to appear, ie who is calling us
      getHeaderName(colDef, column2, columnGroup, providedColumnGroup, location2) {
        const headerValueGetter = colDef.headerValueGetter;
        if (headerValueGetter) {
          const params = _addGridCommonParams(this.gos, {
            colDef,
            column: column2,
            columnGroup,
            providedColumnGroup,
            location: location2
          });
          if (typeof headerValueGetter === "function") {
            return headerValueGetter(params);
          } else if (typeof headerValueGetter === "string") {
            return this.beans.expressionSvc?.evaluate(headerValueGetter, params) ?? null;
          }
          return "";
        } else if (colDef.headerName != null) {
          return colDef.headerName;
        } else if (colDef.field) {
          return _camelCaseToHumanText(colDef.field);
        }
        return "";
      }
    };
    var ColumnViewportService = class extends BeanStub {
      constructor() {
        super(...arguments);
        this.beanName = "colViewport";
        this.colsWithinViewport = [];
        this.headerColsWithinViewport = [];
        this.colsWithinViewportHash = "";
        this.rowsOfHeadersToRenderLeft = {};
        this.rowsOfHeadersToRenderRight = {};
        this.rowsOfHeadersToRenderCenter = {};
        this.columnsToRenderLeft = [];
        this.columnsToRenderRight = [];
        this.columnsToRenderCenter = [];
      }
      wireBeans(beans) {
        this.visibleCols = beans.visibleCols;
        this.colModel = beans.colModel;
      }
      postConstruct() {
        this.suppressColumnVirtualisation = this.gos.get("suppressColumnVirtualisation");
      }
      setScrollPosition(scrollWidth, scrollPosition, afterScroll = false) {
        const { visibleCols } = this;
        const bodyWidthDirty = visibleCols.isBodyWidthDirty;
        const noChange = scrollWidth === this.scrollWidth && scrollPosition === this.scrollPosition && !bodyWidthDirty;
        if (noChange) {
          return;
        }
        this.scrollWidth = scrollWidth;
        this.scrollPosition = scrollPosition;
        visibleCols.isBodyWidthDirty = true;
        if (this.gos.get("enableRtl")) {
          const bodyWidth = visibleCols.bodyWidth;
          this.viewportLeft = bodyWidth - scrollPosition - scrollWidth;
          this.viewportRight = bodyWidth - scrollPosition;
        } else {
          this.viewportLeft = scrollPosition;
          this.viewportRight = scrollWidth + scrollPosition;
        }
        if (this.colModel.ready) {
          this.checkViewportColumns(afterScroll);
        }
      }
      /**
       * Returns the columns that are currently rendered in the viewport.
       */
      getColumnHeadersToRender(type) {
        switch (type) {
          case "left":
            return this.columnsToRenderLeft;
          case "right":
            return this.columnsToRenderRight;
          default:
            return this.columnsToRenderCenter;
        }
      }
      /**
       * Returns the column groups that are currently rendered in the viewport at a specific header row index.
       */
      getHeadersToRender(type, depth) {
        let result2;
        switch (type) {
          case "left":
            result2 = this.rowsOfHeadersToRenderLeft[depth];
            break;
          case "right":
            result2 = this.rowsOfHeadersToRenderRight[depth];
            break;
          default:
            result2 = this.rowsOfHeadersToRenderCenter[depth];
            break;
        }
        return result2 ?? [];
      }
      extractViewportColumns() {
        const displayedColumnsCenter = this.visibleCols.centerCols;
        if (this.isColumnVirtualisationSuppressed()) {
          this.colsWithinViewport = displayedColumnsCenter;
          this.headerColsWithinViewport = displayedColumnsCenter;
        } else {
          this.colsWithinViewport = displayedColumnsCenter.filter(this.isColumnInRowViewport.bind(this));
          this.headerColsWithinViewport = displayedColumnsCenter.filter(this.isColumnInHeaderViewport.bind(this));
        }
      }
      isColumnVirtualisationSuppressed() {
        return this.suppressColumnVirtualisation || this.viewportRight === 0;
      }
      clear() {
        this.rowsOfHeadersToRenderLeft = {};
        this.rowsOfHeadersToRenderRight = {};
        this.rowsOfHeadersToRenderCenter = {};
        this.colsWithinViewportHash = "";
      }
      isColumnInHeaderViewport(col) {
        if (col.isAutoHeaderHeight() || isAnyParentAutoHeaderHeight(col)) {
          return true;
        }
        return this.isColumnInRowViewport(col);
      }
      isColumnInRowViewport(col) {
        if (col.isAutoHeight()) {
          return true;
        }
        const columnLeft = col.getLeft() || 0;
        const columnRight = columnLeft + col.getActualWidth();
        const leftBounds = this.viewportLeft - 200;
        const rightBounds = this.viewportRight + 200;
        const columnToMuchLeft = columnLeft < leftBounds && columnRight < leftBounds;
        const columnToMuchRight = columnLeft > rightBounds && columnRight > rightBounds;
        return !columnToMuchLeft && !columnToMuchRight;
      }
      // used by Grid API only
      getViewportColumns() {
        const { leftCols, rightCols } = this.visibleCols;
        const res = this.colsWithinViewport.concat(leftCols).concat(rightCols);
        return res;
      }
      // + rowRenderer
      // if we are not column spanning, this just returns back the virtual centre columns,
      // however if we are column spanning, then different rows can have different virtual
      // columns, so we have to work out the list for each individual row.
      getColsWithinViewport(rowNode) {
        if (!this.colModel.colSpanActive) {
          return this.colsWithinViewport;
        }
        const emptySpaceBeforeColumn = (col) => {
          const left2 = col.getLeft();
          return _exists(left2) && left2 > this.viewportLeft;
        };
        const inViewportCallback = this.isColumnVirtualisationSuppressed() ? void 0 : this.isColumnInRowViewport.bind(this);
        const { visibleCols } = this;
        const displayedColumnsCenter = visibleCols.centerCols;
        return visibleCols.getColsForRow(rowNode, displayedColumnsCenter, inViewportCallback, emptySpaceBeforeColumn);
      }
      // checks what columns are currently displayed due to column virtualisation. dispatches an event
      // if the list of columns has changed.
      // + setColumnWidth(), setViewportPosition(), setColumnDefs(), sizeColumnsToFit()
      checkViewportColumns(afterScroll = false) {
        const viewportColumnsChanged = this.extractViewport();
        if (viewportColumnsChanged) {
          this.eventSvc.dispatchEvent({
            type: "virtualColumnsChanged",
            afterScroll
          });
        }
      }
      calculateHeaderRows() {
        const { leftCols, rightCols } = this.visibleCols;
        this.columnsToRenderLeft = leftCols;
        this.columnsToRenderRight = rightCols;
        this.columnsToRenderCenter = this.colsWithinViewport;
        const workOutGroupsToRender = (cols) => {
          const groupsToRenderSet = /* @__PURE__ */ new Set();
          const groupsToRender = {};
          for (const col of cols) {
            let group = col.getParent();
            const skipFillers = col.isSpanHeaderHeight();
            while (group) {
              if (groupsToRenderSet.has(group)) {
                break;
              }
              const skipFillerGroup = skipFillers && group.isPadding();
              if (skipFillerGroup) {
                group = group.getParent();
                continue;
              }
              const level = group.getProvidedColumnGroup().getLevel();
              groupsToRender[level] ?? (groupsToRender[level] = []);
              groupsToRender[level].push(group);
              groupsToRenderSet.add(group);
              group = group.getParent();
            }
          }
          return groupsToRender;
        };
        this.rowsOfHeadersToRenderLeft = workOutGroupsToRender(leftCols);
        this.rowsOfHeadersToRenderRight = workOutGroupsToRender(rightCols);
        this.rowsOfHeadersToRenderCenter = workOutGroupsToRender(this.headerColsWithinViewport);
      }
      extractViewport() {
        const hashColumn = (c2) => `${c2.getId()}-${c2.getPinned() || "normal"}`;
        this.extractViewportColumns();
        const newHash = this.getViewportColumns().map(hashColumn).join("#");
        const changed = this.colsWithinViewportHash !== newHash;
        if (changed) {
          this.colsWithinViewportHash = newHash;
          this.calculateHeaderRows();
        }
        return changed;
      }
    };
    function isAnyParentAutoHeaderHeight(col) {
      while (col) {
        if (col.isAutoHeaderHeight()) {
          return true;
        }
        col = col.getParent();
      }
      return false;
    }
    var AgComponentUtils = class extends BeanStub {
      constructor() {
        super(...arguments);
        this.beanName = "agCompUtils";
      }
      adaptFunction(type, jsCompFunc) {
        if (!type.cellRenderer) {
          return null;
        }
        class Adapter {
          refresh() {
            return false;
          }
          getGui() {
            return this.eGui;
          }
          init(params) {
            const callbackResult = jsCompFunc(params);
            const type2 = typeof callbackResult;
            if (type2 === "string" || type2 === "number" || type2 === "boolean") {
              this.eGui = _loadTemplate("<span>" + callbackResult + "</span>");
              return;
            }
            if (callbackResult == null) {
              this.eGui = _createElement({ tag: "span" });
              return;
            }
            this.eGui = callbackResult;
          }
        }
        return Adapter;
      }
    };
    var CellRendererFunctionModule = {
      moduleName: "CellRendererFunction",
      version: VERSION,
      beans: [AgComponentUtils]
    };
    var Registry = class extends BaseRegistry {
      constructor() {
        super(...arguments);
        this.agGridDefaults = {};
        this.agGridDefaultOverrides = {};
        this.jsComps = {};
        this.selectors = {};
        this.icons = {};
      }
      postConstruct() {
        const comps = this.gos.get("components");
        if (comps != null) {
          for (const key2 of Object.keys(comps)) {
            this.jsComps[key2] = comps[key2];
          }
        }
      }
      registerModule(module2) {
        const { icons, userComponents, dynamicBeans, selectors } = module2;
        if (userComponents) {
          const registerUserComponent = (name2, component, params, processParams) => {
            this.agGridDefaults[name2] = component;
            if (params || processParams) {
              this.agGridDefaultOverrides[name2] = { params, processParams };
            }
          };
          for (const name2 of Object.keys(userComponents)) {
            let comp2 = userComponents[name2];
            if (isComponentMetaFunc(comp2)) {
              comp2 = comp2.getComp(this.beans);
            }
            if (typeof comp2 === "object") {
              const { classImp, params, processParams } = comp2;
              registerUserComponent(name2, classImp, params, processParams);
            } else {
              registerUserComponent(name2, comp2);
            }
          }
        }
        this.registerDynamicBeans(dynamicBeans);
        for (const selector2 of selectors ?? []) {
          this.selectors[selector2.selector] = selector2;
        }
        if (icons) {
          for (const name2 of Object.keys(icons)) {
            this.icons[name2] = icons[name2];
          }
        }
      }
      getUserComponent(propertyName2, name2) {
        const createResult = (component, componentFromFramework, params, processParams) => ({
          componentFromFramework,
          component,
          params,
          processParams
        });
        const { frameworkOverrides } = this.beans;
        const registeredViaFrameworkComp = frameworkOverrides.frameworkComponent(name2, this.gos.get("components"));
        if (registeredViaFrameworkComp != null) {
          return createResult(registeredViaFrameworkComp, true);
        }
        const jsComponent = this.jsComps[name2];
        if (jsComponent) {
          const isFwkComp = frameworkOverrides.isFrameworkComponent(jsComponent);
          return createResult(jsComponent, isFwkComp);
        }
        const defaultComponent = this.agGridDefaults[name2];
        if (defaultComponent) {
          const overrides = this.agGridDefaultOverrides[name2];
          return createResult(defaultComponent, false, overrides?.params, overrides?.processParams);
        }
        this.beans.validation?.missingUserComponent(propertyName2, name2, this.agGridDefaults, this.jsComps);
        return null;
      }
      getSelector(name2) {
        return this.selectors[name2];
      }
      getIcon(name2) {
        return this.icons[name2];
      }
      getDynamicError(name2, init2) {
        if (init2) {
          return _errMsg(279, { name: name2 });
        }
        return this.beans.validation?.missingDynamicBean(name2) ?? _errMsg(256);
      }
    };
    var NUM_CTRLS = 23;
    var CtrlsService = class extends BeanStub {
      constructor() {
        super(...arguments);
        this.beanName = "ctrlsSvc";
        this.params = {};
        this.ready = false;
        this.readyCallbacks = [];
      }
      postConstruct() {
        this.addEventListener(
          "ready",
          () => {
            this.updateReady();
            if (this.ready) {
              for (const callback of this.readyCallbacks) {
                callback(this.params);
              }
              this.readyCallbacks.length = 0;
            }
          },
          this.beans.frameworkOverrides.runWhenReadyAsync?.() ?? false
        );
      }
      updateReady() {
        const values = Object.values(this.params);
        this.ready = values.length === NUM_CTRLS && values.every((ctrl) => {
          return ctrl?.isAlive() ?? false;
        });
      }
      whenReady(caller, callback) {
        if (this.ready) {
          callback(this.params);
        } else {
          this.readyCallbacks.push(callback);
        }
        caller.addDestroyFunc(() => {
          const index = this.readyCallbacks.indexOf(callback);
          if (index >= 0) {
            this.readyCallbacks.splice(index, 1);
          }
        });
      }
      register(ctrlType, ctrl) {
        this.params[ctrlType] = ctrl;
        this.updateReady();
        if (this.ready) {
          this.dispatchLocalEvent({ type: "ready" });
        }
        ctrl.addDestroyFunc(() => {
          this.updateReady();
        });
      }
      get(ctrlType) {
        return this.params[ctrlType];
      }
      getGridBodyCtrl() {
        return this.params.gridBodyCtrl;
      }
      getHeaderRowContainerCtrls() {
        const { leftHeader, centerHeader, rightHeader } = this.params;
        return [leftHeader, rightHeader, centerHeader];
      }
      getHeaderRowContainerCtrl(pinned) {
        const params = this.params;
        switch (pinned) {
          case "left":
            return params.leftHeader;
          case "right":
            return params.rightHeader;
          default:
            return params.centerHeader;
        }
      }
      getScrollFeature() {
        return this.getGridBodyCtrl().scrollFeature;
      }
    };
    var coreCSS = (
      /*css*/
      `.ag-aria-description-container{border:0;z-index:9999;clip:rect(1px,1px,1px,1px);height:1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}.ag-unselectable{-webkit-user-select:none;-moz-user-select:none;user-select:none}.ag-selectable{-webkit-user-select:text;-moz-user-select:text;user-select:text}.ag-tab-guard{display:block;height:0;position:absolute;width:0}:where(.ag-virtual-list-viewport) .ag-tab-guard{position:sticky}.ag-tab-guard-top{top:1px}.ag-tab-guard-bottom{bottom:1px}.ag-shake-left-to-right{animation-direction:alternate;animation-duration:.2s;animation-iteration-count:infinite;animation-name:ag-shake-left-to-right}@keyframes ag-shake-left-to-right{0%{padding-left:6px;padding-right:2px}to{padding-left:2px;padding-right:6px}}.ag-body-horizontal-scroll-viewport,.ag-body-vertical-scroll-viewport,.ag-body-viewport,.ag-center-cols-viewport,.ag-floating-bottom-viewport,.ag-floating-top-viewport,.ag-header-viewport,.ag-sticky-bottom-viewport,.ag-sticky-top-viewport,.ag-virtual-list-viewport{flex:1 1 auto;height:100%;min-width:0;overflow:hidden;position:relative}.ag-viewport{position:relative}.ag-spanning-container{position:absolute;top:0;z-index:1}.ag-body-viewport,.ag-center-cols-viewport,.ag-floating-bottom-viewport,.ag-floating-top-viewport,.ag-header-viewport,.ag-sticky-bottom-viewport,.ag-sticky-top-viewport{overflow-x:auto;-ms-overflow-style:none!important;scrollbar-width:none!important;&::-webkit-scrollbar{display:none!important}}.ag-body-viewport{display:flex;overflow-x:hidden;&:where(.ag-layout-normal){overflow-y:auto;-webkit-overflow-scrolling:touch}}.ag-floating-bottom-container,.ag-floating-top-container,.ag-sticky-bottom-container,.ag-sticky-top-container{min-height:1px}.ag-center-cols-viewport{min-height:100%;width:100%}.ag-body-horizontal-scroll-viewport{overflow-x:scroll}.ag-body-vertical-scroll-viewport{overflow-y:scroll}.ag-virtual-list-viewport{overflow:auto;width:100%}.ag-body-container,.ag-body-horizontal-scroll-container,.ag-body-vertical-scroll-container,.ag-center-cols-container,.ag-floating-bottom-container,.ag-floating-bottom-full-width-container,.ag-floating-top-container,.ag-full-width-container,.ag-header-container,.ag-pinned-left-cols-container,.ag-pinned-right-cols-container,.ag-sticky-bottom-container,.ag-sticky-top-container,.ag-virtual-list-container{position:relative}.ag-floating-bottom-container,.ag-floating-top-container,.ag-header-container,.ag-pinned-left-floating-bottom,.ag-pinned-left-floating-top,.ag-pinned-right-floating-bottom,.ag-pinned-right-floating-top,.ag-sticky-bottom-container,.ag-sticky-top-container{height:100%;white-space:nowrap}.ag-center-cols-container,.ag-pinned-right-cols-container{display:block}.ag-body-horizontal-scroll-container{height:100%}.ag-body-vertical-scroll-container{width:100%}.ag-floating-bottom-full-width-container,.ag-floating-top-full-width-container,.ag-full-width-container,.ag-sticky-bottom-full-width-container,.ag-sticky-top-full-width-container{pointer-events:none;position:absolute;top:0}:where(.ag-ltr) .ag-floating-bottom-full-width-container,:where(.ag-ltr) .ag-floating-top-full-width-container,:where(.ag-ltr) .ag-full-width-container,:where(.ag-ltr) .ag-sticky-bottom-full-width-container,:where(.ag-ltr) .ag-sticky-top-full-width-container{left:0}:where(.ag-rtl) .ag-floating-bottom-full-width-container,:where(.ag-rtl) .ag-floating-top-full-width-container,:where(.ag-rtl) .ag-full-width-container,:where(.ag-rtl) .ag-sticky-bottom-full-width-container,:where(.ag-rtl) .ag-sticky-top-full-width-container{right:0}.ag-full-width-container{width:100%}.ag-floating-bottom-full-width-container,.ag-floating-top-full-width-container{display:inline-block;height:100%;overflow:hidden;width:100%}.ag-virtual-list-container{overflow:hidden}.ag-body{display:flex;flex:1 1 auto;flex-direction:row!important;min-height:0;position:relative}.ag-body-horizontal-scroll,.ag-body-vertical-scroll{display:flex;min-height:0;min-width:0;position:relative;&:where(.ag-scrollbar-invisible){bottom:0;position:absolute;&:where(.ag-apple-scrollbar){opacity:0;transition:opacity .4s;visibility:hidden;&:where(.ag-scrollbar-scrolling,.ag-scrollbar-active){opacity:1;visibility:visible}}}}.ag-body-horizontal-scroll{width:100%;&:where(.ag-scrollbar-invisible){left:0;right:0}}.ag-body-vertical-scroll{height:100%;&:where(.ag-scrollbar-invisible){top:0;z-index:10}}:where(.ag-ltr) .ag-body-vertical-scroll{&:where(.ag-scrollbar-invisible){right:0}}:where(.ag-rtl) .ag-body-vertical-scroll{&:where(.ag-scrollbar-invisible){left:0}}.ag-force-vertical-scroll{overflow-y:scroll!important}.ag-horizontal-left-spacer,.ag-horizontal-right-spacer{height:100%;min-width:0;overflow-x:scroll;&:where(.ag-scroller-corner){overflow-x:hidden}}:where(.ag-row-animation) .ag-row{transition:transform .4s,top .4s,opacity .2s;&:where(.ag-after-created){transition:transform .4s,top .4s,height .4s,opacity .2s}}:where(.ag-row-animation.ag-prevent-animation) .ag-row{transition:none!important;&:where(.ag-row.ag-after-created){transition:none!important}}:where(.ag-row-no-animation) .ag-row{transition:none}.ag-row-loading{align-items:center;display:flex}.ag-row-position-absolute{position:absolute}.ag-row-position-relative{position:relative}.ag-full-width-row{overflow:hidden;pointer-events:all}.ag-row-inline-editing{z-index:1}.ag-row-dragging{z-index:2}.ag-stub-cell{align-items:center;display:flex}.ag-cell{display:inline-block;height:100%;position:absolute;white-space:nowrap;&:focus-visible{box-shadow:none}}.ag-cell-value{flex:1 1 auto}.ag-cell-value:not(.ag-allow-overflow),.ag-group-value{overflow:hidden;text-overflow:ellipsis}.ag-cell-wrap-text{white-space:normal;word-break:break-word}:where(.ag-cell) .ag-icon{display:inline-block;vertical-align:middle}.ag-floating-top{display:flex;overflow:hidden;position:relative;white-space:nowrap;width:100%}:where(.ag-floating-top:not(.ag-invisible)){border-bottom:var(--ag-pinned-row-border)}.ag-floating-bottom{display:flex;overflow:hidden;position:relative;white-space:nowrap;width:100%}:where(.ag-floating-bottom:not(.ag-invisible)){border-top:var(--ag-pinned-row-border)}.ag-sticky-bottom,.ag-sticky-top{background-color:var(--ag-data-background-color);display:flex;height:0;overflow:hidden;position:absolute;width:100%;z-index:1}.ag-opacity-zero{opacity:0!important}.ag-cell-label-container{align-items:center;display:flex;flex-direction:row-reverse;height:100%;justify-content:space-between;width:100%}:where(.ag-right-aligned-header){.ag-cell-label-container{flex-direction:row}.ag-header-cell-text{text-align:end}}.ag-column-group-icons{display:block;>*{cursor:pointer}}:where(.ag-ltr){direction:ltr;.ag-body,.ag-body-horizontal-scroll,.ag-body-viewport,.ag-floating-bottom,.ag-floating-top,.ag-header,.ag-sticky-bottom,.ag-sticky-top{flex-direction:row}}:where(.ag-rtl){direction:rtl;text-align:right;.ag-body,.ag-body-horizontal-scroll,.ag-body-viewport,.ag-floating-bottom,.ag-floating-top,.ag-header,.ag-sticky-bottom,.ag-sticky-top{flex-direction:row-reverse}.ag-icon-contracted,.ag-icon-expanded,.ag-icon-tree-closed{display:block}}:where(.ag-rtl){.ag-icon-contracted,.ag-icon-expanded,.ag-icon-tree-closed{transform:rotate(180deg)}}:where(.ag-rtl){.ag-icon-contracted,.ag-icon-expanded,.ag-icon-tree-closed{transform:rotate(-180deg)}}.ag-measurement-container{height:0;overflow:hidden;visibility:hidden;width:0}.ag-measurement-element-border{display:inline-block;&:before{border-left:var(--ag-internal-measurement-border);content:"";display:block}}.ag-group{position:relative;width:100%}.ag-group-title-bar{align-items:center;display:flex;padding:var(--ag-spacing)}.ag-group-title{display:inline;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:where(.ag-group-title-bar) .ag-group-title{cursor:default}.ag-group-toolbar{align-items:center;display:flex;padding:var(--ag-spacing)}.ag-group-container{display:flex}.ag-disabled .ag-group-container{pointer-events:none}.ag-disabled-group-container,.ag-disabled-group-title-bar{opacity:.5}.ag-group-container-horizontal{flex-flow:row wrap}.ag-group-container-vertical{flex-direction:column}.ag-group-title-bar-icon{cursor:pointer;flex:none}:where(.ag-ltr) .ag-group-title-bar-icon{margin-right:var(--ag-spacing)}:where(.ag-rtl) .ag-group-title-bar-icon{margin-left:var(--ag-spacing)}:where(.ag-group-item-alignment-stretch) .ag-group-item{align-items:stretch}:where(.ag-group-item-alignment-start) .ag-group-item{align-items:flex-start}:where(.ag-group-item-alignment-end) .ag-group-item{align-items:flex-end}:where(.ag-ltr) .ag-row:not(.ag-row-level-0) .ag-pivot-leaf-group{margin-left:var(--ag-row-group-indent-size)}:where(.ag-rtl) .ag-row:not(.ag-row-level-0) .ag-pivot-leaf-group{margin-right:var(--ag-row-group-indent-size)}:where(.ag-ltr) .ag-row-group-leaf-indent{margin-left:calc(var(--ag-cell-widget-spacing) + var(--ag-icon-size))}:where(.ag-rtl) .ag-row-group-leaf-indent{margin-right:calc(var(--ag-cell-widget-spacing) + var(--ag-icon-size))}.ag-value-change-delta{padding:0 2px}.ag-value-change-delta-up{color:var(--ag-value-change-delta-up-color)}.ag-value-change-delta-down{color:var(--ag-value-change-delta-down-color)}.ag-value-change-value{background-color:transparent;border-radius:1px;padding-left:1px;padding-right:1px;transition:background-color 1s}.ag-value-change-value-highlight{background-color:var(--ag-value-change-value-highlight-background-color);transition:background-color .1s}.ag-cell-data-changed{background-color:var(--ag-value-change-value-highlight-background-color)!important}.ag-cell-data-changed-animation{background-color:transparent}.ag-cell-highlight{background-color:var(--ag-range-selection-highlight-color)!important}.ag-row,.ag-spanned-row{color:var(--ag-cell-text-color);font-family:var(--ag-cell-font-family);font-size:var(--ag-data-font-size);white-space:nowrap;--ag-internal-content-line-height:calc(min(var(--ag-row-height), var(--ag-line-height, 1000px)) - var(--ag-internal-row-border-width, 1px) - 2px)}.ag-row{background-color:var(--ag-data-background-color);border-bottom:var(--ag-row-border);height:var(--ag-row-height);width:100%;&.ag-row-editing-invalid{background-color:var(--ag-full-row-edit-invalid-background-color)}}:where(.ag-body-vertical-content-no-gap>div>div>div,.ag-body-vertical-content-no-gap>div>div>div>div)>.ag-row-last{border-bottom-color:transparent}.ag-sticky-bottom{border-top:var(--ag-row-border);box-sizing:content-box!important}.ag-group-contracted,.ag-group-expanded{cursor:pointer}.ag-cell,.ag-full-width-row .ag-cell-wrapper.ag-row-group{border:1px solid transparent;line-height:var(--ag-internal-content-line-height);-webkit-font-smoothing:subpixel-antialiased}:where(.ag-ltr) .ag-cell{border-right:var(--ag-column-border)}:where(.ag-rtl) .ag-cell{border-left:var(--ag-column-border)}.ag-spanned-cell-wrapper{background-color:var(--ag-data-background-color);position:absolute}.ag-spanned-cell-wrapper>.ag-spanned-cell{display:block;position:relative}:where(.ag-ltr) :where(.ag-body-horizontal-content-no-gap) .ag-column-last{border-right-color:transparent}:where(.ag-rtl) :where(.ag-body-horizontal-content-no-gap) .ag-column-last{border-left-color:transparent}.ag-cell-wrapper{align-items:center;display:flex;>:where(:not(.ag-cell-value,.ag-group-value)){align-items:center;display:flex;height:var(--ag-internal-content-line-height)}&:where(.ag-row-group){align-items:flex-start}:where(.ag-full-width-row) &:where(.ag-row-group){align-items:center;height:100%}}:where(.ag-ltr) .ag-cell-wrapper{padding-left:calc(var(--ag-indentation-level)*var(--ag-row-group-indent-size))}:where(.ag-rtl) .ag-cell-wrapper{padding-right:calc(var(--ag-indentation-level)*var(--ag-row-group-indent-size))}:where(.ag-cell-wrap-text:not(.ag-cell-auto-height)) .ag-cell-wrapper{align-items:normal;height:100%;:where(.ag-cell-value){height:100%}}:where(.ag-ltr) .ag-row>.ag-cell-wrapper.ag-row-group{padding-left:calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size)*var(--ag-indentation-level))}:where(.ag-rtl) .ag-row>.ag-cell-wrapper.ag-row-group{padding-right:calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size)*var(--ag-indentation-level))}.ag-cell-focus:not(.ag-cell-range-selected):focus-within,.ag-cell-range-single-cell,.ag-cell-range-single-cell.ag-cell-range-handle,.ag-context-menu-open .ag-cell-focus:not(.ag-cell-range-selected),.ag-context-menu-open .ag-full-width-row.ag-row-focus .ag-cell-wrapper.ag-row-group,.ag-full-width-row.ag-row-focus:focus .ag-cell-wrapper.ag-row-group{border:1px solid;border-color:var(--ag-range-selection-border-color);border-style:var(--ag-range-selection-border-style);outline:initial}.ag-full-width-row.ag-row-focus:focus{box-shadow:none}:where(.ag-ltr) .ag-group-contracted,:where(.ag-ltr) .ag-group-expanded,:where(.ag-ltr) .ag-row-drag,:where(.ag-ltr) .ag-selection-checkbox{margin-right:var(--ag-cell-widget-spacing)}:where(.ag-rtl) .ag-group-contracted,:where(.ag-rtl) .ag-group-expanded,:where(.ag-rtl) .ag-row-drag,:where(.ag-rtl) .ag-selection-checkbox{margin-left:var(--ag-cell-widget-spacing)}:where(.ag-ltr) .ag-group-child-count{margin-left:3px}:where(.ag-rtl) .ag-group-child-count{margin-right:3px}.ag-row-highlight-above:after,.ag-row-highlight-below:after,.ag-row-highlight-inside:after{background-color:var(--ag-range-selection-border-color);content:"";height:1px;pointer-events:none;position:absolute;width:calc(100% - 1px)}:where(.ag-ltr) .ag-row-highlight-above:after,:where(.ag-ltr) .ag-row-highlight-below:after,:where(.ag-ltr) .ag-row-highlight-inside:after{left:1px}:where(.ag-rtl) .ag-row-highlight-above:after,:where(.ag-rtl) .ag-row-highlight-below:after,:where(.ag-rtl) .ag-row-highlight-inside:after{right:1px}.ag-row-highlight-above:after{top:0}.ag-row-highlight-below:after{bottom:0}.ag-row-highlight-indent:after{display:block;width:auto}:where(.ag-ltr) .ag-row-highlight-indent:after{left:calc((var(--ag-cell-widget-spacing) + var(--ag-icon-size))*2 + var(--ag-cell-horizontal-padding) + var(--ag-row-highlight-level)*var(--ag-row-group-indent-size));right:1px}:where(.ag-rtl) .ag-row-highlight-indent:after{left:1px;right:calc((var(--ag-cell-widget-spacing) + var(--ag-icon-size))*2 + var(--ag-cell-horizontal-padding) + var(--ag-row-highlight-level)*var(--ag-row-group-indent-size))}.ag-row-highlight-inside:after{background-color:var(--ag-selected-row-background-color);border:1px solid var(--ag-range-selection-border-color);display:block;height:auto;inset:0;width:auto}.ag-body,.ag-floating-bottom,.ag-floating-top{background-color:var(--ag-data-background-color)}.ag-row-odd{background-color:var(--ag-odd-row-background-color)}.ag-row-selected:before{background-color:var(--ag-selected-row-background-color);content:"";display:block;inset:0;pointer-events:none;position:absolute}.ag-row-hover.ag-full-width-row.ag-row-group:before,.ag-row-hover:not(.ag-full-width-row):before{background-color:var(--ag-row-hover-color);content:"";display:block;inset:0;pointer-events:none;position:absolute}.ag-row-hover.ag-row-selected:before{background-color:var(--ag-row-hover-color);background-image:linear-gradient(var(--ag-selected-row-background-color),var(--ag-selected-row-background-color))}.ag-row.ag-full-width-row.ag-row-group>*{position:relative}.ag-column-hover{background-color:var(--ag-column-hover-color)}.ag-header-range-highlight{background-color:var(--ag-range-header-highlight-color)}.ag-right-aligned-cell{font-variant-numeric:tabular-nums}:where(.ag-ltr) .ag-right-aligned-cell{text-align:right}:where(.ag-rtl) .ag-right-aligned-cell{text-align:left}.ag-right-aligned-cell .ag-cell-value,.ag-right-aligned-cell .ag-group-value{margin-left:auto}:where(.ag-ltr) .ag-cell:not(.ag-cell-inline-editing),:where(.ag-ltr) .ag-full-width-row .ag-cell-wrapper.ag-row-group{padding-left:calc(var(--ag-cell-horizontal-padding) - 1px + var(--ag-row-group-indent-size)*var(--ag-indentation-level));padding-right:calc(var(--ag-cell-horizontal-padding) - 1px)}:where(.ag-rtl) .ag-cell:not(.ag-cell-inline-editing),:where(.ag-rtl) .ag-full-width-row .ag-cell-wrapper.ag-row-group{padding-left:calc(var(--ag-cell-horizontal-padding) - 1px);padding-right:calc(var(--ag-cell-horizontal-padding) - 1px + var(--ag-row-group-indent-size)*var(--ag-indentation-level))}.ag-row>.ag-cell-wrapper{padding-left:calc(var(--ag-cell-horizontal-padding) - 1px);padding-right:calc(var(--ag-cell-horizontal-padding) - 1px)}.ag-row-dragging{cursor:move;opacity:.5}.ag-details-row{background-color:var(--ag-data-background-color);padding:calc(var(--ag-spacing)*3.75)}.ag-layout-auto-height,.ag-layout-print{.ag-center-cols-container,.ag-center-cols-viewport{min-height:150px}}.ag-overlay-loading-wrapper{background-color:var(--ag-modal-overlay-background-color)}.ag-skeleton-container{align-content:center;height:100%;width:100%}.ag-skeleton-effect{animation:ag-skeleton-loading 1.5s ease-in-out .5s infinite;background-color:var(--ag-row-loading-skeleton-effect-color);border-radius:.25rem;height:1em;width:100%}:where(.ag-ltr) .ag-right-aligned-cell .ag-skeleton-effect{margin-left:auto}:where(.ag-rtl) .ag-right-aligned-cell .ag-skeleton-effect{margin-right:auto}@keyframes ag-skeleton-loading{0%{background-color:var(--ag-row-loading-skeleton-effect-color)}50%{background-color:color-mix(in srgb,transparent,var(--ag-row-loading-skeleton-effect-color) 40%)}to{background-color:var(--ag-row-loading-skeleton-effect-color)}}.ag-loading{align-items:center;display:flex;height:100%}:where(.ag-ltr) .ag-loading{padding-left:var(--ag-cell-horizontal-padding)}:where(.ag-rtl) .ag-loading{padding-right:var(--ag-cell-horizontal-padding)}:where(.ag-ltr) .ag-loading-icon{padding-right:var(--ag-cell-widget-spacing)}:where(.ag-rtl) .ag-loading-icon{padding-left:var(--ag-cell-widget-spacing)}.ag-icon-loading{animation-duration:1s;animation-iteration-count:infinite;animation-name:spin;animation-timing-function:linear}@keyframes spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.ag-header{background-color:var(--ag-header-background-color);border-bottom:var(--ag-header-row-border);color:var(--ag-header-text-color);display:flex;font-family:var(--ag-header-font-family);font-size:var(--ag-header-font-size);font-weight:var(--ag-header-font-weight);overflow:hidden;white-space:nowrap;width:100%}.ag-header-row{height:var(--ag-header-height);position:absolute}.ag-floating-filter-button-button,.ag-header-cell-filter-button,.ag-header-cell-menu-button,.ag-header-expand-icon,.ag-panel-title-bar-button,:where(.ag-header-cell-sortable) .ag-header-cell-label{cursor:pointer}:where(.ag-ltr) .ag-header-expand-icon{margin-left:4px}:where(.ag-rtl) .ag-header-expand-icon{margin-right:4px}.ag-header-row:where(:not(:first-child)){:where(.ag-header-cell:not(.ag-header-span-height.ag-header-span-total,.ag-header-parent-hidden),.ag-header-group-cell.ag-header-group-cell-with-group){border-top:var(--ag-header-row-border)}}.ag-header-row:where(:not(.ag-header-row-column-group)){overflow:hidden}:where(.ag-header.ag-header-allow-overflow) .ag-header-row{overflow:visible}.ag-header-cell{display:inline-flex;overflow:hidden}.ag-header-group-cell{contain:paint;display:flex}.ag-header-cell,.ag-header-group-cell{align-items:center;gap:var(--ag-cell-widget-spacing);height:100%;padding:0 var(--ag-cell-horizontal-padding);position:absolute}@property --ag-internal-moving-color{syntax:"<color>";inherits:false;initial-value:transparent}@property --ag-internal-hover-color{syntax:"<color>";inherits:false;initial-value:transparent}.ag-header-cell:where(:not(.ag-floating-filter)),.ag-header-group-cell{&:before{background-image:linear-gradient(var(--ag-internal-hover-color),var(--ag-internal-hover-color)),linear-gradient(var(--ag-internal-moving-color),var(--ag-internal-moving-color));content:"";inset:0;position:absolute;--ag-internal-moving-color:transparent;--ag-internal-hover-color:transparent;transition:--ag-internal-moving-color var(--ag-header-cell-background-transition-duration),--ag-internal-hover-color var(--ag-header-cell-background-transition-duration)}&:where(:hover):before{--ag-internal-hover-color:var(--ag-header-cell-hover-background-color)}&:where(.ag-header-cell-moving):before{--ag-internal-moving-color:var(--ag-header-cell-moving-background-color);--ag-internal-hover-color:var(--ag-header-cell-hover-background-color)}}:where(.ag-header-cell:not(.ag-floating-filter) *,.ag-header-group-cell *){position:relative;z-index:1}.ag-header-cell-menu-button:where(:not(.ag-header-menu-always-show)){opacity:0;transition:opacity .2s}.ag-header-cell-filter-button,:where(.ag-header-cell.ag-header-active) .ag-header-cell-menu-button{opacity:1}.ag-header-cell-label,.ag-header-group-cell-label{align-items:center;align-self:stretch;display:flex;flex:1 1 auto;overflow:hidden;padding:5px 0}:where(.ag-ltr) .ag-sort-indicator-icon{padding-left:var(--ag-spacing)}:where(.ag-rtl) .ag-sort-indicator-icon{padding-right:var(--ag-spacing)}.ag-header-cell-label{text-overflow:ellipsis}.ag-header-group-cell-label.ag-sticky-label{flex:none;max-width:100%;overflow:visible;position:sticky}:where(.ag-ltr) .ag-header-group-cell-label.ag-sticky-label{left:var(--ag-cell-horizontal-padding)}:where(.ag-rtl) .ag-header-group-cell-label.ag-sticky-label{right:var(--ag-cell-horizontal-padding)}.ag-header-cell-text,.ag-header-group-text{overflow:hidden;text-overflow:ellipsis}.ag-header-cell-text{word-break:break-word}.ag-header-cell-comp-wrapper{width:100%}:where(.ag-header-group-cell) .ag-header-cell-comp-wrapper{display:flex}:where(.ag-header-cell:not(.ag-header-cell-auto-height)) .ag-header-cell-comp-wrapper{align-items:center;display:flex;height:100%}.ag-header-cell-wrap-text .ag-header-cell-comp-wrapper{white-space:normal}.ag-header-cell-comp-wrapper-limited-height>*{overflow:hidden}:where(.ag-right-aligned-header) .ag-header-cell-label{flex-direction:row-reverse}:where(.ag-ltr) :where(.ag-header-cell:not(.ag-right-aligned-header)){.ag-header-label-icon,.ag-header-menu-icon{margin-left:var(--ag-spacing)}}:where(.ag-rtl) :where(.ag-header-cell:not(.ag-right-aligned-header)){.ag-header-label-icon,.ag-header-menu-icon{margin-right:var(--ag-spacing)}}:where(.ag-ltr) :where(.ag-header-cell.ag-right-aligned-header){.ag-header-label-icon,.ag-header-menu-icon{margin-right:var(--ag-spacing)}}:where(.ag-rtl) :where(.ag-header-cell.ag-right-aligned-header){.ag-header-label-icon,.ag-header-menu-icon{margin-left:var(--ag-spacing)}}.ag-header-cell:after,.ag-header-group-cell:where(:not(.ag-header-span-height.ag-header-group-cell-no-group)):after{content:"";height:var(--ag-header-column-border-height);position:absolute;top:calc(50% - var(--ag-header-column-border-height)*.5);z-index:1}:where(.ag-ltr) .ag-header-cell:after,:where(.ag-ltr) .ag-header-group-cell:where(:not(.ag-header-span-height.ag-header-group-cell-no-group)):after{border-right:var(--ag-header-column-border);right:0}:where(.ag-rtl) .ag-header-cell:after,:where(.ag-rtl) .ag-header-group-cell:where(:not(.ag-header-span-height.ag-header-group-cell-no-group)):after{border-left:var(--ag-header-column-border);left:0}.ag-header-highlight-after:after,.ag-header-highlight-before:after{background-color:var(--ag-accent-color);content:"";height:100%;position:absolute;width:1px}:where(.ag-ltr) .ag-header-highlight-before:after{left:0}:where(.ag-rtl) .ag-header-highlight-before:after{right:0}:where(.ag-ltr) .ag-header-highlight-after:after{right:0;:where(.ag-pinned-left-header) &{right:1px}}:where(.ag-rtl) .ag-header-highlight-after:after{left:0;:where(.ag-pinned-left-header) &{left:1px}}.ag-header-cell-resize{align-items:center;cursor:ew-resize;display:flex;height:100%;position:absolute;top:0;width:8px;z-index:2;&:after{background-color:var(--ag-header-column-resize-handle-color);content:"";height:var(--ag-header-column-resize-handle-height);position:absolute;top:calc(50% - var(--ag-header-column-resize-handle-height)*.5);width:var(--ag-header-column-resize-handle-width);z-index:1}}:where(.ag-ltr) .ag-header-cell-resize{right:-3px;&:after{left:calc(50% - var(--ag-header-column-resize-handle-width))}}:where(.ag-rtl) .ag-header-cell-resize{left:-3px;&:after{right:calc(50% - var(--ag-header-column-resize-handle-width))}}:where(.ag-header-cell.ag-header-span-height) .ag-header-cell-resize:after{height:calc(100% - var(--ag-spacing)*4);top:calc(var(--ag-spacing)*2)}.ag-header-group-cell-no-group:where(.ag-header-span-height){display:none}.ag-sort-indicator-container{display:flex;gap:var(--ag-spacing)}.ag-layout-print{&.ag-body{display:block;height:unset}&.ag-root-wrapper{display:inline-block}.ag-body-horizontal-scroll,.ag-body-vertical-scroll{display:none}&.ag-force-vertical-scroll{overflow-y:visible!important}}@media print{.ag-root-wrapper.ag-layout-print{display:table;.ag-body-horizontal-scroll-viewport,.ag-body-viewport,.ag-center-cols-container,.ag-center-cols-viewport,.ag-root,.ag-root-wrapper-body,.ag-virtual-list-viewport{display:block!important;height:auto!important;overflow:hidden!important}.ag-cell,.ag-row{-moz-column-break-inside:avoid;break-inside:avoid}}}ag-grid,ag-grid-angular{display:block}.ag-root-wrapper{border:var(--ag-wrapper-border);border-radius:var(--ag-wrapper-border-radius);display:flex;flex-direction:column;overflow:hidden;position:relative;&.ag-layout-normal{height:100%}}.ag-root-wrapper-body{display:flex;flex-direction:row;&.ag-layout-normal{flex:1 1 auto;height:0;min-height:0}}.ag-root{display:flex;flex-direction:column;position:relative;&.ag-layout-auto-height,&.ag-layout-normal{flex:1 1 auto;overflow:hidden;width:0}&.ag-layout-normal{height:100%}}.ag-virtual-list-item{height:var(--ag-list-item-height);position:absolute;width:100%}.ag-list-item-hovered:after{background-color:var(--ag-accent-color);content:"";height:1px;left:0;position:absolute;right:0}.ag-item-highlight-top:after{top:0}.ag-item-highlight-bottom:after{bottom:0}.ag-drag-handle{color:var(--ag-drag-handle-color);cursor:grab;:where(.ag-icon){color:var(--ag-drag-handle-color)}}.ag-chart-menu-icon,.ag-chart-settings-next,.ag-chart-settings-prev,.ag-column-group-icons,.ag-column-select-header-icon,.ag-filter-toolpanel-expand,.ag-floating-filter-button-button,.ag-group-title-bar-icon,.ag-header-cell-filter-button,.ag-header-cell-menu-button,.ag-header-expand-icon,.ag-panel-title-bar-button,.ag-panel-title-bar-button-icon,.ag-set-filter-group-icons,:where(.ag-group-contracted) .ag-icon,:where(.ag-group-expanded) .ag-icon{background-color:var(--ag-icon-button-background-color);border-radius:var(--ag-icon-button-border-radius);box-shadow:0 0 0 var(--ag-icon-button-background-spread) var(--ag-icon-button-background-color);color:var(--ag-icon-button-color);&:hover{background-color:var(--ag-icon-button-hover-background-color);box-shadow:0 0 0 var(--ag-icon-button-background-spread) var(--ag-icon-button-hover-background-color);color:var(--ag-icon-button-hover-color)}}.ag-filter-active{background-image:linear-gradient(var(--ag-icon-button-active-background-color),var(--ag-icon-button-active-background-color));border-radius:1px;outline:solid var(--ag-icon-button-background-spread) var(--ag-icon-button-active-background-color);position:relative;&:after{background-color:var(--ag-icon-button-active-indicator-color);border-radius:50%;content:"";height:6px;position:absolute;top:-1px;width:6px}:where(.ag-icon-filter){clip-path:path("M8,0C8,4.415 11.585,8 16,8L16,16L0,16L0,0L8,0Z");color:var(--ag-icon-button-active-color)}}:where(.ag-ltr) .ag-filter-active{&:after{right:-1px}}:where(.ag-rtl) .ag-filter-active{&:after{left:-1px}}.ag-menu{background-color:var(--ag-menu-background-color);border:var(--ag-menu-border);border-radius:var(--ag-border-radius);box-shadow:var(--ag-menu-shadow);color:var(--ag-menu-text-color);max-height:100%;overflow-y:auto;position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none}`
    );
    var coreDefaults = {
      wrapperBorder: true,
      rowBorder: true,
      headerRowBorder: true,
      footerRowBorder: {
        ref: "rowBorder"
      },
      columnBorder: {
        style: "solid",
        width: 1,
        color: "transparent"
      },
      headerColumnBorder: false,
      headerColumnBorderHeight: "100%",
      pinnedColumnBorder: true,
      pinnedRowBorder: true,
      sidePanelBorder: true,
      sideBarPanelWidth: 250,
      sideBarBackgroundColor: {
        ref: "chromeBackgroundColor"
      },
      sideButtonBarBackgroundColor: {
        ref: "sideBarBackgroundColor"
      },
      sideButtonBarTopPadding: 0,
      sideButtonSelectedUnderlineWidth: 2,
      sideButtonSelectedUnderlineColor: "transparent",
      sideButtonSelectedUnderlineTransitionDuration: 0,
      sideButtonBackgroundColor: "transparent",
      sideButtonTextColor: { ref: "textColor" },
      sideButtonHoverBackgroundColor: { ref: "sideButtonBackgroundColor" },
      sideButtonHoverTextColor: { ref: "sideButtonTextColor" },
      sideButtonSelectedBackgroundColor: backgroundColor,
      sideButtonSelectedTextColor: { ref: "sideButtonTextColor" },
      sideButtonBorder: "solid 1px transparent",
      sideButtonSelectedBorder: true,
      sideButtonLeftPadding: { ref: "spacing" },
      sideButtonRightPadding: { ref: "spacing" },
      sideButtonVerticalPadding: { calc: "spacing * 3" },
      headerBackgroundColor: {
        ref: "chromeBackgroundColor"
      },
      headerFontFamily: {
        ref: "fontFamily"
      },
      cellFontFamily: {
        ref: "fontFamily"
      },
      headerFontWeight: 500,
      headerFontSize: {
        ref: "fontSize"
      },
      dataFontSize: {
        ref: "fontSize"
      },
      headerTextColor: {
        ref: "textColor"
      },
      headerCellHoverBackgroundColor: "transparent",
      headerCellMovingBackgroundColor: { ref: "headerCellHoverBackgroundColor" },
      headerCellBackgroundTransitionDuration: "0.2s",
      cellTextColor: {
        ref: "textColor"
      },
      rangeSelectionBorderStyle: "solid",
      rangeSelectionBorderColor: accentColor,
      rangeSelectionBackgroundColor: accentMix(0.2),
      rangeSelectionChartBackgroundColor: "#0058FF1A",
      rangeSelectionChartCategoryBackgroundColor: "#00FF841A",
      rangeSelectionHighlightColor: accentMix(0.5),
      rangeHeaderHighlightColor: foregroundHeaderBackgroundMix(0.08),
      rowNumbersSelectedColor: accentMix(0.5),
      rowHoverColor: accentMix(0.08),
      columnHoverColor: accentMix(0.05),
      selectedRowBackgroundColor: accentMix(0.12),
      modalOverlayBackgroundColor: {
        ref: "backgroundColor",
        mix: 0.66
      },
      dataBackgroundColor: backgroundColor,
      oddRowBackgroundColor: { ref: "dataBackgroundColor" },
      wrapperBorderRadius: 8,
      cellHorizontalPadding: {
        calc: "spacing * 2 * cellHorizontalPaddingScale"
      },
      cellWidgetSpacing: {
        calc: "spacing * 1.5"
      },
      cellHorizontalPaddingScale: 1,
      rowGroupIndentSize: {
        calc: "cellWidgetSpacing + iconSize"
      },
      valueChangeDeltaUpColor: "#43a047",
      valueChangeDeltaDownColor: "#e53935",
      valueChangeValueHighlightBackgroundColor: "#16a08580",
      rowHeight: {
        calc: "max(iconSize, dataFontSize) + spacing * 3.25 * rowVerticalPaddingScale"
      },
      rowVerticalPaddingScale: 1,
      headerHeight: {
        calc: "max(iconSize, dataFontSize) + spacing * 4 * headerVerticalPaddingScale"
      },
      headerVerticalPaddingScale: 1,
      paginationPanelHeight: {
        ref: "rowHeight",
        calc: "max(rowHeight, 22px)"
      },
      dragHandleColor: foregroundMix(0.7),
      headerColumnResizeHandleHeight: "30%",
      headerColumnResizeHandleWidth: 2,
      headerColumnResizeHandleColor: {
        ref: "borderColor"
      },
      widgetContainerHorizontalPadding: {
        calc: "spacing * 1.5"
      },
      widgetContainerVerticalPadding: {
        calc: "spacing * 1.5"
      },
      widgetHorizontalSpacing: {
        calc: "spacing * 1.5"
      },
      widgetVerticalSpacing: {
        ref: "spacing"
      },
      iconButtonColor: { ref: "iconColor" },
      iconButtonBackgroundColor: "transparent",
      iconButtonBackgroundSpread: 4,
      iconButtonBorderRadius: 1,
      iconButtonHoverColor: { ref: "iconButtonColor" },
      iconButtonHoverBackgroundColor: foregroundMix(0.1),
      iconButtonActiveColor: accentColor,
      iconButtonActiveBackgroundColor: accentMix(0.28),
      iconButtonActiveIndicatorColor: accentColor,
      menuBorder: {
        color: foregroundMix(0.2)
      },
      menuBackgroundColor: foregroundBackgroundMix(0.03),
      menuTextColor: foregroundBackgroundMix(0.95),
      menuShadow: {
        ref: "popupShadow"
      },
      menuSeparatorColor: {
        ref: "borderColor"
      },
      setFilterIndentSize: {
        ref: "iconSize"
      },
      chartMenuPanelWidth: 260,
      chartMenuLabelColor: foregroundMix(0.8),
      dialogShadow: {
        ref: "popupShadow"
      },
      cellEditingBorder: {
        color: accentColor
      },
      cellEditingShadow: { ref: "cardShadow" },
      fullRowEditInvalidBackgroundColor: {
        ref: "invalidColor",
        onto: "backgroundColor",
        mix: 0.25
      },
      dialogBorder: {
        color: foregroundMix(0.2)
      },
      panelBackgroundColor: backgroundColor,
      panelTitleBarHeight: { ref: "headerHeight" },
      panelTitleBarBackgroundColor: {
        ref: "headerBackgroundColor"
      },
      panelTitleBarIconColor: {
        ref: "headerTextColor"
      },
      panelTitleBarTextColor: {
        ref: "headerTextColor"
      },
      panelTitleBarFontWeight: {
        ref: "headerFontWeight"
      },
      panelTitleBarBorder: true,
      columnSelectIndentSize: {
        ref: "iconSize"
      },
      toolPanelSeparatorBorder: true,
      columnDropCellBackgroundColor: foregroundMix(0.07),
      columnDropCellTextColor: {
        ref: "textColor"
      },
      columnDropCellDragHandleColor: {
        ref: "textColor"
      },
      columnDropCellBorder: {
        color: foregroundMix(0.13)
      },
      selectCellBackgroundColor: foregroundMix(0.07),
      selectCellBorder: {
        color: foregroundMix(0.13)
      },
      advancedFilterBuilderButtonBarBorder: true,
      advancedFilterBuilderIndentSize: {
        calc: "spacing * 2 + iconSize"
      },
      advancedFilterBuilderJoinPillColor: "#f08e8d",
      advancedFilterBuilderColumnPillColor: "#a6e194",
      advancedFilterBuilderOptionPillColor: "#f3c08b",
      advancedFilterBuilderValuePillColor: "#85c0e4",
      filterPanelApplyButtonColor: backgroundColor,
      filterPanelApplyButtonBackgroundColor: accentColor,
      filterPanelCardSubtleColor: {
        ref: "textColor",
        mix: 0.7
      },
      filterPanelCardSubtleHoverColor: { ref: "textColor" },
      findMatchColor: foregroundColor,
      findMatchBackgroundColor: "#ffff00",
      findActiveMatchColor: foregroundColor,
      findActiveMatchBackgroundColor: "#ffa500",
      filterToolPanelGroupIndent: {
        ref: "spacing"
      },
      rowLoadingSkeletonEffectColor: foregroundMix(0.15),
      statusBarLabelColor: foregroundColor,
      statusBarLabelFontWeight: 500,
      statusBarValueColor: foregroundColor,
      statusBarValueFontWeight: 500,
      pinnedSourceRowTextColor: {
        ref: "textColor"
      },
      pinnedSourceRowBackgroundColor: {
        ref: "dataBackgroundColor"
      },
      pinnedSourceRowFontWeight: 600,
      pinnedRowFontWeight: 600,
      pinnedRowBackgroundColor: {
        ref: "dataBackgroundColor"
      },
      pinnedRowTextColor: {
        ref: "textColor"
      }
    };
    var batchEditStyleDefaultCSS = (
      /*css*/
      `.ag-cell-batch-edit{background-color:var(--ag-cell-batch-edit-background-color);color:var(--ag-cell-batch-edit-text-color);display:inherit}.ag-row-batch-edit{background-color:var(--ag-row-batch-edit-background-color);color:var(--ag-row-batch-edit-text-color)}`
    );
    var baseParams = {
      cellBatchEditBackgroundColor: "rgba(220 181 139 / 16%)",
      cellBatchEditTextColor: "#422f00",
      rowBatchEditBackgroundColor: {
        ref: "cellBatchEditBackgroundColor"
      },
      rowBatchEditTextColor: {
        ref: "cellBatchEditTextColor"
      }
    };
    var baseDarkBatchEditParams = {
      ...baseParams,
      cellBatchEditTextColor: "#f3d0b3"
    };
    var makeBatchEditStyleBaseTreeShakeable = () => createPart({
      feature: "batchEditStyle",
      params: baseParams,
      css: batchEditStyleDefaultCSS
    });
    var batchEditStyleBase = /* @__PURE__ */ makeBatchEditStyleBaseTreeShakeable();
    var buttonStyleBaseCSS = (
      /*css*/
      `:where(.ag-button){background:none;border:none;color:inherit;cursor:pointer;font-family:inherit;font-size:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0;text-indent:inherit;text-shadow:inherit;text-transform:inherit;word-spacing:inherit;&:disabled{cursor:default}&:focus-visible{box-shadow:var(--ag-focus-shadow);outline:none}}.ag-standard-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:var(--ag-button-background-color);border:var(--ag-button-border);border-radius:var(--ag-button-border-radius);color:var(--ag-button-text-color);cursor:pointer;font-weight:var(--ag-button-font-weight);padding:var(--ag-button-vertical-padding) var(--ag-button-horizontal-padding);&:hover{background-color:var(--ag-button-hover-background-color);border:var(--ag-button-hover-border);color:var(--ag-button-hover-text-color)}&:active{background-color:var(--ag-button-active-background-color);border:var(--ag-button-active-border);color:var(--ag-button-active-text-color)}&:disabled{background-color:var(--ag-button-disabled-background-color);border:var(--ag-button-disabled-border);color:var(--ag-button-disabled-text-color)}}`
    );
    var baseParams2 = {
      buttonTextColor: "inherit",
      buttonFontWeight: "normal",
      buttonBackgroundColor: "transparent",
      buttonBorder: false,
      buttonBorderRadius: { ref: "borderRadius" },
      buttonHorizontalPadding: { calc: "spacing * 2" },
      buttonVerticalPadding: { ref: "spacing" },
      buttonHoverTextColor: { ref: "buttonTextColor" },
      buttonHoverBackgroundColor: { ref: "buttonBackgroundColor" },
      buttonHoverBorder: { ref: "buttonBorder" },
      buttonActiveTextColor: { ref: "buttonHoverTextColor" },
      buttonActiveBackgroundColor: { ref: "buttonHoverBackgroundColor" },
      buttonActiveBorder: { ref: "buttonHoverBorder" },
      buttonDisabledTextColor: { ref: "inputDisabledTextColor" },
      buttonDisabledBackgroundColor: { ref: "inputDisabledBackgroundColor" },
      buttonDisabledBorder: { ref: "inputDisabledBorder" }
    };
    var makeButtonStyleQuartzTreeShakeable = () => createPart({
      feature: "buttonStyle",
      params: {
        ...baseParams2,
        buttonBackgroundColor: backgroundColor,
        buttonBorder: true,
        buttonHoverBackgroundColor: { ref: "rowHoverColor" },
        buttonActiveBorder: { color: accentColor }
      },
      css: buttonStyleBaseCSS
    });
    var buttonStyleQuartz = /* @__PURE__ */ makeButtonStyleQuartzTreeShakeable();
    var makeButtonStyleBalhamTreeShakeable = () => createPart({
      feature: "buttonStyle",
      params: {
        ...baseParams2,
        buttonBorder: { color: foregroundColor, width: 2, style: "outset" },
        buttonActiveBorder: { color: foregroundColor, width: 2, style: "inset" },
        buttonBackgroundColor: foregroundBackgroundMix(0.07),
        buttonHoverBackgroundColor: backgroundColor,
        buttonVerticalPadding: { calc: "spacing * 0.5" }
      },
      css: buttonStyleBaseCSS
    });
    var buttonStyleBalham = /* @__PURE__ */ makeButtonStyleBalhamTreeShakeable();
    var columnDropStyleBorderedCSS = (
      /*css*/
      `.ag-column-drop-vertical-empty-message{align-items:center;border:dashed var(--ag-border-width);border-color:var(--ag-border-color);display:flex;inset:0;justify-content:center;margin:calc(var(--ag-spacing)*1.5) calc(var(--ag-spacing)*2);overflow:hidden;padding:calc(var(--ag-spacing)*2);position:absolute}`
    );
    var columnDropStylePlainCSS = (
      /*css*/
      `.ag-column-drop-vertical-empty-message{color:var(--ag-subtle-text-color);font-size:calc(var(--ag-font-size) - 1px);font-weight:600;padding-top:var(--ag-spacing)}:where(.ag-ltr) .ag-column-drop-vertical-empty-message{padding-left:calc(var(--ag-icon-size) + var(--ag-spacing) + var(--ag-widget-horizontal-spacing));padding-right:var(--ag-spacing)}:where(.ag-rtl) .ag-column-drop-vertical-empty-message{padding-left:var(--ag-spacing);padding-right:calc(var(--ag-icon-size) + var(--ag-spacing) + var(--ag-widget-horizontal-spacing))}`
    );
    var makeColumnDropStyleBorderedTreeShakeable = () => {
      return createPart({
        feature: "columnDropStyle",
        css: columnDropStyleBorderedCSS
      });
    };
    var columnDropStyleBordered = /* @__PURE__ */ makeColumnDropStyleBorderedTreeShakeable();
    var makeColumnDropStylePlainTreeShakeable = () => {
      return createPart({
        feature: "columnDropStyle",
        css: columnDropStylePlainCSS
      });
    };
    var columnDropStylePlain = /* @__PURE__ */ makeColumnDropStylePlainTreeShakeable();
    var gridThemeLogger = {
      warn: (...args2) => {
        _warn(args2[0], args2[1]);
      },
      error: (...args2) => {
        _error(args2[0], args2[1]);
      },
      preInitErr: (...args2) => {
        _logPreInitErr(args2[0], args2[2], args2[1]);
      }
    };
    var createTheme = () => createSharedTheme(gridThemeLogger).withParams(coreDefaults).withPart(buttonStyleQuartz).withPart(columnDropStyleBordered).withPart(batchEditStyleBase);
    var checkboxStyleDefaultCSS = (
      /*css*/
      `.ag-checkbox-input-wrapper,.ag-radio-button-input-wrapper{background-color:var(--ag-checkbox-unchecked-background-color);border:solid var(--ag-checkbox-border-width) var(--ag-checkbox-unchecked-border-color);flex:none;height:var(--ag-icon-size);position:relative;width:var(--ag-icon-size);:where(input){-webkit-appearance:none;-moz-appearance:none;appearance:none;cursor:pointer;display:block;height:var(--ag-icon-size);margin:0;opacity:0;width:var(--ag-icon-size)}&:after{content:"";display:block;inset:0;-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;pointer-events:none;position:absolute}&:where(.ag-checked){background-color:var(--ag-checkbox-checked-background-color);border-color:var(--ag-checkbox-checked-border-color);&:after{background-color:var(--ag-checkbox-checked-shape-color)}}&:where(:focus-within,:active){box-shadow:var(--ag-focus-shadow)}&:where(.ag-disabled){filter:grayscale();opacity:.5}}.ag-checkbox-input-wrapper{border-radius:var(--ag-checkbox-border-radius);&:where(.ag-checked):after{-webkit-mask-image:var(--ag-checkbox-checked-shape-image);mask-image:var(--ag-checkbox-checked-shape-image)}&:where(.ag-indeterminate){background-color:var(--ag-checkbox-indeterminate-background-color);border-color:var(--ag-checkbox-indeterminate-border-color);&:after{background-color:var(--ag-checkbox-indeterminate-shape-color);-webkit-mask-image:var(--ag-checkbox-indeterminate-shape-image);mask-image:var(--ag-checkbox-indeterminate-shape-image)}}}.ag-cell-editing-error .ag-checkbox-input-wrapper:focus-within{box-shadow:var(--ag-focus-error-shadow)}.ag-radio-button-input-wrapper{border-radius:100%;&:where(.ag-checked):after{-webkit-mask-image:var(--ag-radio-checked-shape-image);mask-image:var(--ag-radio-checked-shape-image)}}`
    );
    var makeCheckboxStyleDefaultTreeShakeable = () => createPart({
      feature: "checkboxStyle",
      params: {
        checkboxBorderWidth: 1,
        checkboxBorderRadius: {
          ref: "borderRadius"
        },
        checkboxUncheckedBackgroundColor: backgroundColor,
        checkboxUncheckedBorderColor: foregroundBackgroundMix(0.3),
        checkboxCheckedBackgroundColor: accentColor,
        checkboxCheckedBorderColor: { ref: "checkboxCheckedBackgroundColor" },
        checkboxCheckedShapeImage: {
          svg: '<svg xmlns="http://www.w3.org/2000/svg" width="10" height="7" fill="none"><path stroke="#000" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.75" d="M1 3.5 3.5 6l5-5"/></svg>'
        },
        checkboxCheckedShapeColor: backgroundColor,
        checkboxIndeterminateBackgroundColor: foregroundBackgroundMix(0.3),
        checkboxIndeterminateBorderColor: { ref: "checkboxIndeterminateBackgroundColor" },
        checkboxIndeterminateShapeImage: {
          svg: '<svg xmlns="http://www.w3.org/2000/svg" width="10" height="2" fill="none"><rect width="10" height="2" fill="#000" rx="1"/></svg>'
        },
        checkboxIndeterminateShapeColor: backgroundColor,
        radioCheckedShapeImage: {
          svg: '<svg xmlns="http://www.w3.org/2000/svg" width="6" height="6" fill="none"><circle cx="3" cy="3" r="3" fill="#000"/></svg>'
        }
      },
      css: checkboxStyleDefaultCSS
    });
    var checkboxStyleDefault = /* @__PURE__ */ makeCheckboxStyleDefaultTreeShakeable();
    var darkParams = () => ({
      ...defaultLightColorSchemeParams,
      ...baseDarkBatchEditParams,
      backgroundColor: "hsl(217, 0%, 17%)",
      foregroundColor: "#FFF",
      chromeBackgroundColor: foregroundBackgroundMix(0.05),
      rowHoverColor: accentMix(0.15),
      selectedRowBackgroundColor: accentMix(0.2),
      menuBackgroundColor: foregroundBackgroundMix(0.1),
      browserColorScheme: "dark",
      popupShadow: "0 0px 20px #000A",
      cardShadow: "0 1px 4px 1px #000A",
      advancedFilterBuilderJoinPillColor: "#7a3a37",
      advancedFilterBuilderColumnPillColor: "#355f2d",
      advancedFilterBuilderOptionPillColor: "#5a3168",
      advancedFilterBuilderValuePillColor: "#374c86",
      filterPanelApplyButtonColor: foregroundColor,
      findMatchColor: backgroundColor,
      findActiveMatchColor: backgroundColor,
      checkboxUncheckedBorderColor: foregroundBackgroundMix(0.4),
      toggleButtonOffBackgroundColor: foregroundBackgroundMix(0.4),
      rowBatchEditBackgroundColor: foregroundBackgroundMix(0.1)
    });
    var darkBlueParams = () => ({
      ...darkParams(),
      backgroundColor: "#1f2836"
    });
    var makeColorSchemeVariableTreeShakeable = () => createPart({
      feature: "colorScheme",
      params: defaultLightColorSchemeParams,
      modeParams: {
        light: defaultLightColorSchemeParams,
        dark: darkParams(),
        "dark-blue": darkBlueParams()
      }
    });
    var colorSchemeVariable = /* @__PURE__ */ makeColorSchemeVariableTreeShakeable();
    var iconSetBalhamCSS = (
      /*css*/
      `.ag-icon-aggregation:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Eaggregation%3C/title%3E%3Cpath d='M25.128 2.002c2.56.096 4.772 2.292 4.87 4.87a712 712 0 0 1 0 18.256c-.096 2.56-2.292 4.772-4.87 4.87a712 712 0 0 1-18.256 0c-2.558-.096-4.772-2.29-4.87-4.87a712 712 0 0 1 0-18.256c.096-2.56 2.292-4.772 4.87-4.87a712 712 0 0 1 18.256 0M7.006 4c-1.57.02-2.946 1.348-3.004 2.922-.078 6.078-.23 12.16.002 18.234.094 1.484 1.354 2.746 2.84 2.84 6.1.232 12.212.232 18.312 0 1.48-.094 2.746-1.35 2.84-2.84.232-6.1.232-12.212 0-18.312-.094-1.48-1.35-2.746-2.84-2.84C19.11 3.774 13.056 4 7.006 4M22 12h-2v-2h-8v.092c.056 1.352 3.426 2.598 4.472 4.404.682 1.174.438 2.754-.572 3.72C14.29 19.618 12 20.924 12 22h8v-2h2v4H10c0-1.586-.098-3.304 1.016-4.314 1.904-1.632 4.89-3.108 3.54-4.42-1.918-1.68-4.464-2.936-4.554-5.12L10 8h12z'/%3E%3C/svg%3E")}.ag-icon-arrows:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Earrows%3C/title%3E%3Cpath d='m6.414 17 2.294 2.292-1.416 1.416L2.586 16l4.706-4.708 1.416 1.416L6.414 15H15V6.414l-2.292 2.294-1.416-1.416L16 2.586l4.708 4.706-1.416 1.416L17 6.414V15h8.586l-2.294-2.292 1.416-1.416L29.414 16l-4.706 4.708-1.416-1.416L25.586 17H17v8.586l2.292-2.294 1.416 1.416L16 29.414l-4.708-4.706 1.416-1.416L15 25.586V17z'/%3E%3C/svg%3E")}.ag-icon-asc:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Easc%3C/title%3E%3Cpath d='m15 10.621-4.292 4.294-1.416-1.416L16 6.793l6.708 6.706-1.416 1.416L17 10.621v14.586h-2z'/%3E%3C/svg%3E")}.ag-icon-cancel:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Ecancel%3C/title%3E%3Cpath d='M16 4C9.378 4 4 9.378 4 16s5.378 12 12 12 12-5.378 12-12S22.622 4 16 4m0 2c5.52 0 10 4.48 10 10s-4.48 10-10 10S6 21.52 6 16 10.48 6 16 6m0 8.586 5.292-5.294 1.416 1.416L17.414 16l5.294 5.292-1.416 1.416L16 17.414l-5.292 5.294-1.416-1.416L14.586 16l-5.294-5.292 1.416-1.416z'/%3E%3C/svg%3E")}.ag-icon-chart:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Echart%3C/title%3E%3Cpath d='M6.667 12.267h4v13.067h-4zm7.466-5.6h3.733v18.667h-3.733zM21.6 17.333h3.733v8H21.6z'/%3E%3C/svg%3E")}.ag-icon-color-picker:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Ecolor-picker%3C/title%3E%3Cpath d='M23.907 17.587 10.574 4.254l-1.88 1.88 3.173 3.173-8.28 8.28 10.16 10.16zm-16.547 0 6.387-6.387 6.387 6.387H7.361zm18.387 2s-2.667 2.893-2.667 4.667c0 1.467 1.2 2.667 2.667 2.667s2.667-1.2 2.667-2.667c0-1.773-2.667-4.667-2.667-4.667'/%3E%3C/svg%3E")}.ag-icon-columns:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Ecolumns%3C/title%3E%3Cpath d='M14 25h-2V7h2zm6 0h-2V7h2zm6 0h-2V7h2zM8 25H6V7h2z'/%3E%3C/svg%3E")}.ag-icon-contracted:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Econtracted%3C/title%3E%3Cpath d='m21.061 16-8.706 8.708-1.416-1.416L18.233 16l-7.294-7.292 1.416-1.416z'/%3E%3C/svg%3E")}.ag-icon-copy:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Ecopy%3C/title%3E%3Cpath d='M21.929 27.999h-7.828a5.09 5.09 0 0 1-5.086-5.086v-9.812a5.087 5.087 0 0 1 5.086-5.086h7.828a5.09 5.09 0 0 1 5.086 5.086v9.812a5.087 5.087 0 0 1-5.086 5.086m.16-17.984h-8.088a2.94 2.94 0 0 0-2.938 2.938v10.132a2.94 2.94 0 0 0 2.938 2.938h8.088a2.94 2.94 0 0 0 2.936-2.938V12.953a2.94 2.94 0 0 0-2.936-2.938M7.041 26.013h-2.05a4 4 0 0 1-.006-.228V9.065a5.07 5.07 0 0 1 5.064-5.064h12.812q.069 0 .134.002v2.012H9.915a2.876 2.876 0 0 0-2.874 2.874z'/%3E%3C/svg%3E")}.ag-icon-cross:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='4 4 24 24'%3E%3Ctitle%3Ecross%3C/title%3E%3Cpath d='m16 14.586 5.292-5.294 1.416 1.416L17.414 16l5.294 5.292-1.416 1.416L16 17.414l-5.292 5.294-1.416-1.416L14.586 16l-5.294-5.292 1.416-1.416z'/%3E%3C/svg%3E")}.ag-icon-csv:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M384 131.9c-7.753-8.433-110.425-128.473-114.9-133L48-.1C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48zm-35.9 2.1H257V27.9zM30 479V27h200l1 105c0 13.3-1.3 29 12 29h111l1 318z' style='fill-rule:nonzero' transform='translate(3.934 -.054)scale(.06285)'/%3E%3Cpath d='M.688-.226a.2.2 0 0 1-.017.074.28.28 0 0 1-.145.14.412.412 0 0 1-.234.013.28.28 0 0 1-.202-.168.468.468 0 0 1-.04-.19q0-.086.025-.155a.319.319 0 0 1 .182-.191.4.4 0 0 1 .134-.025q.087 0 .155.035a.3.3 0 0 1 .104.085.17.17 0 0 1 .036.097.06.06 0 0 1-.018.044.06.06 0 0 1-.042.019.06.06 0 0 1-.042-.013.2.2 0 0 1-.031-.046.2.2 0 0 0-.066-.079.16.16 0 0 0-.095-.027.17.17 0 0 0-.142.068.3.3 0 0 0-.053.193.4.4 0 0 0 .023.139.2.2 0 0 0 .067.083.2.2 0 0 0 .1.027q.063 0 .106-.031a.2.2 0 0 0 .065-.091.2.2 0 0 1 .023-.046q.014-.018.044-.018a.06.06 0 0 1 .044.018.06.06 0 0 1 .019.045' style='fill-rule:nonzero' transform='matrix(8.39799 0 0 12.455 7.122 25.977)'/%3E%3Cpath d='M.622-.215a.2.2 0 0 1-.033.117.23.23 0 0 1-.098.081.4.4 0 0 1-.153.029.34.34 0 0 1-.175-.04.23.23 0 0 1-.079-.077.17.17 0 0 1-.031-.093q0-.027.019-.045a.06.06 0 0 1 .046-.019.06.06 0 0 1 .039.014.1.1 0 0 1 .027.044.3.3 0 0 0 .03.057q.015.023.044.038.03.015.076.015.065 0 .105-.03a.09.09 0 0 0 .04-.075.08.08 0 0 0-.022-.058.14.14 0 0 0-.056-.034 1 1 0 0 0-.092-.025.7.7 0 0 1-.129-.042.2.2 0 0 1-.083-.066.17.17 0 0 1-.03-.104q0-.058.032-.105a.2.2 0 0 1 .093-.07.4.4 0 0 1 .144-.025q.066 0 .114.016a.3.3 0 0 1 .08.044.2.2 0 0 1 .046.057q.015.03.015.058a.07.07 0 0 1-.018.046.06.06 0 0 1-.046.021q-.025 0-.038-.012a.2.2 0 0 1-.028-.041.2.2 0 0 0-.047-.063Q.387-.625.326-.625a.15.15 0 0 0-.09.025q-.035.024-.035.059 0 .021.012.037a.1.1 0 0 0 .032.027.4.4 0 0 0 .111.036q.06.015.11.031.048.018.083.042a.2.2 0 0 1 .054.062.2.2 0 0 1 .019.091' style='fill-rule:nonzero' transform='matrix(8.39799 0 0 12.455 13.339 25.977)'/%3E%3Cpath d='m.184-.633.162.48.163-.483q.013-.038.019-.053a.062.062 0 0 1 .061-.039q.018 0 .034.009a.1.1 0 0 1 .025.025q.009.015.009.031L.654-.64l-.007.025-.009.024-.173.468-.019.051a.2.2 0 0 1-.021.042.1.1 0 0 1-.033.03.1.1 0 0 1-.049.012.1.1 0 0 1-.05-.011A.1.1 0 0 1 .26-.03a.2.2 0 0 1-.021-.042L.22-.123.05-.587.041-.612.033-.638.03-.662q0-.025.02-.046a.07.07 0 0 1 .05-.02q.037 0 .053.023.015.023.031.072' style='fill-rule:nonzero' transform='matrix(8.39799 0 0 12.455 18.94 25.977)'/%3E%3C/svg%3E")}.ag-icon-cut:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M14.703 15.096 6.215 4.719a1 1 0 1 1 1.548-1.267l13.058 15.965A5.001 5.001 0 0 1 28 23.916a5 5 0 0 1-4.999 4.999 5 5 0 0 1-4.999-4.999 4.98 4.98 0 0 1 1.23-3.283l-3.238-3.958-3.272 4.001a4.98 4.98 0 0 1 1.265 3.323 5 5 0 0 1-4.999 4.999 5 5 0 0 1-4.999-4.999 5 5 0 0 1 7.13-4.522zM8.991 20.8a3.1 3.1 0 0 0-3.1 3.1c0 1.711 1.389 3.1 3.1 3.1s3.1-1.389 3.1-3.1-1.389-3.1-3.1-3.1M23 20.8a3.1 3.1 0 0 0-3.1 3.1c0 1.711 1.389 3.1 3.1 3.1s3.1-1.389 3.1-3.1-1.389-3.1-3.1-3.1m-5.723-8.852 1.292 1.579 7.205-8.808a1 1 0 0 0-1.548-1.267z' style='fill-rule:nonzero'/%3E%3C/svg%3E")}.ag-icon-desc:before,.ag-icon-down:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Edesc%3C/title%3E%3Cpath d='m17 21.379 4.292-4.294 1.416 1.416L16 25.207l-6.708-6.706 1.416-1.416L15 21.379V6.793h2z'/%3E%3C/svg%3E")}.ag-icon-excel:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M384 131.9c-7.753-8.433-110.425-128.473-114.9-133L48-.1C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48zm-35.9 2.1H257V27.9zM30 479V27h200l1 105c0 13.3-1.3 29 12 29h111l1 318z' style='fill-rule:nonzero' transform='translate(3.934 -.054)scale(.06285)'/%3E%3Cpath d='m.052-.139.16-.234-.135-.208a.4.4 0 0 1-.028-.052.1.1 0 0 1-.01-.042.05.05 0 0 1 .018-.037.07.07 0 0 1 .045-.016q.03 0 .047.018a1 1 0 0 1 .047.066l.107.174.115-.174.024-.038.019-.026.021-.015a.1.1 0 0 1 .027-.005.06.06 0 0 1 .044.016.05.05 0 0 1 .018.039q0 .033-.038.089l-.141.211.152.234a.3.3 0 0 1 .03.051.1.1 0 0 1 .009.038.1.1 0 0 1-.008.031.1.1 0 0 1-.024.023.1.1 0 0 1-.034.008.1.1 0 0 1-.035-.008.1.1 0 0 1-.023-.022L.427-.067.301-.265l-.134.204-.022.034-.016.019a.1.1 0 0 1-.022.015.1.1 0 0 1-.03.005.06.06 0 0 1-.044-.016.06.06 0 0 1-.017-.047q0-.036.036-.088' style='fill-rule:nonzero' transform='matrix(17.82892 0 0 16.50777 10.371 25.928)'/%3E%3C/svg%3E")}.ag-icon-expanded:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Eexpanded%3C/title%3E%3Cpath d='M21.061 8.708 13.767 16l7.294 7.292-1.416 1.416L10.939 16l8.706-8.708z'/%3E%3C/svg%3E")}.ag-icon-eye-slash:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Eeye-slash%3C/title%3E%3Cpath d='M9.304 7.89a15.2 15.2 0 0 1 6.404-1.638c.294-.002.292-.002.584 0 5.956.174 11.328 4.088 13.62 9.748 0 0-1.318 3.178-3.224 5.174a13.6 13.6 0 0 1-2.226 1.874L26.414 25 25 26.414l-2.336-2.336C17.866 26.396 11.776 26.15 7.36 22.96a14.9 14.9 0 0 1-4.168-4.612c-.41-.71-.694-1.336-1.104-2.348 0 0 .898-2.218 2.002-3.718a14.6 14.6 0 0 1 3.442-3.334L5.586 7 7 5.586zm-.3 2.528c-2.038 1.344-3.708 3.246-4.724 5.508L4.248 16c2.46 5.762 9.622 9.064 15.63 7.15q.688-.219 1.342-.516l-.912-.912a6.96 6.96 0 0 1-4.19 1.394c-3.862 0-7-3.136-7-7 0-1.57.52-3.022 1.394-4.19zm14.032 11.204a13.25 13.25 0 0 0 4.684-5.548l.032-.074c-1.984-4.646-6.834-7.798-12.006-7.748-1.712.05-3.386.458-4.922 1.158l1.102 1.102a6.97 6.97 0 0 1 4.192-1.396 7.003 7.003 0 0 1 5.606 11.192zm-11.09-8.262a5.003 5.003 0 0 0 6.928 6.928zm8.342 5.514a5.002 5.002 0 0 0-6.928-6.928z'/%3E%3C/svg%3E")}.ag-icon-eye:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Eeye%3C/title%3E%3Cpath d='M16.292 6.32c5.956.174 11.328 4.086 13.62 9.746 0 0-1.318 3.18-3.224 5.176-4.862 5.088-13.534 5.97-19.328 1.784a14.9 14.9 0 0 1-4.168-4.612c-.41-.71-.694-1.336-1.104-2.348 0 0 .898-2.216 2.002-3.716 2.678-3.64 7.03-5.896 11.618-6.03.294-.004.292-.004.584 0m-.546 2c-4.896.142-9.458 3.202-11.466 7.672l-.032.074c2.46 5.762 9.622 9.066 15.63 7.152 3.458-1.102 6.342-3.738 7.842-7.076l.032-.076C25.768 11.42 20.918 8.27 15.746 8.32m.254.946c3.754 0 6.8 3.048 6.8 6.8 0 3.754-3.046 6.8-6.8 6.8s-6.8-3.046-6.8-6.8c0-3.752 3.046-6.8 6.8-6.8m5 6.768V16c0-2.76-2.24-5-5-5s-5 2.24-5 5v.066c0 2.76 2.24 5 5 5s5-2.24 5-5z'/%3E%3C/svg%3E")}.ag-icon-filter:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Efilter%3C/title%3E%3Cpath d='M26 8.184c-.066 2.658-4.058 5.154-6.742 7.974a1.05 1.05 0 0 0-.258.682v3.66L13 25c0-2.74.066-5.482-.002-8.222a1.05 1.05 0 0 0-.256-.62C10.026 13.304 6.06 10.61 6 8.184V6h20zM8 8c0 .304.06.612.258.842 2.716 2.854 6.682 5.548 6.742 7.974V21l2-1.5v-2.684c.066-2.658 4.058-5.154 6.742-7.974.198-.23.258-.538.258-.842z'/%3E%3C/svg%3E")}.ag-icon-first:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Efirst%3C/title%3E%3Cpath d='M24.354 8.708 17.06 16l7.294 7.292-1.416 1.416L14.232 16l8.706-8.708zM9.646 8v16h-2V8z'/%3E%3C/svg%3E")}.ag-icon-group:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Egroup%3C/title%3E%3Cpath d='M25.128 2.002c2.56.096 4.772 2.292 4.87 4.87a712 712 0 0 1 0 18.256c-.096 2.56-2.292 4.772-4.87 4.87a712 712 0 0 1-18.256 0c-2.558-.096-4.772-2.29-4.87-4.87a712 712 0 0 1 0-18.256c.096-2.56 2.292-4.772 4.87-4.87a712 712 0 0 1 18.256 0M7.006 4c-1.57.02-2.946 1.348-3.004 2.922-.078 6.078-.23 12.16.002 18.234.094 1.484 1.354 2.746 2.84 2.84 6.1.232 12.212.232 18.312 0 1.48-.094 2.746-1.35 2.84-2.84.232-6.1.232-12.212 0-18.312-.094-1.48-1.35-2.746-2.84-2.84C19.11 3.774 13.056 4 7.006 4M14 21h-4v-2h4zm12 0H16v-2h10zm-12-4h-4v-2h4zm12 0H16v-2h10zm-16-4H6v-2h4zm16 0H12v-2h14z'/%3E%3C/svg%3E")}.ag-icon-last:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Elast%3C/title%3E%3Cpath d='m17.768 16-8.706 8.708-1.416-1.416L14.94 16 7.646 8.708l1.416-1.416zm6.586 8h-2V8h2z'/%3E%3C/svg%3E")}.ag-icon-left:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Eleft%3C/title%3E%3Cpath d='m17.621 11-2 2h12.586v6H15.621l2 2-4.414 4.414L3.793 16l9.414-9.414zm-11 5 6.586 6.586L14.793 21l-4-4h15.414v-2H10.793l4-4-1.586-1.586z'/%3E%3C/svg%3E")}.ag-icon-linked:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Elinked%3C/title%3E%3Cpath d='M17.138 13.418a1.03 1.03 0 0 0-.298.658s.125.096.226.178c1.372 1.114 2.033 3.039 1.582 4.796a4.7 4.7 0 0 1-1.205 2.123c-1.145 1.151-2.296 2.294-3.445 3.441-1.241 1.232-3.185 1.691-4.864 1.105-1.546-.54-2.756-1.938-3.048-3.572-.267-1.496.246-3.108 1.319-4.186l.578-.578-.03-.092a10.5 10.5 0 0 1-.452-2.3v-.005c-.776.775-1.621 1.489-2.275 2.396-1.817 2.522-1.643 6.323.706 8.669 1.813 1.811 4.708 2.462 7.171 1.517a6.75 6.75 0 0 0 2.336-1.518l3.427-3.424c1.939-1.954 2.533-5.126 1.294-7.674a6.8 6.8 0 0 0-2.071-2.481l-.003-.002zM21.265 4a6.8 6.8 0 0 0-4.734 1.964l-3.427 3.424c-1.961 1.977-2.52 5.092-1.32 7.619a6.8 6.8 0 0 0 2.098 2.537l.003.002c.32-.32.643-.637.96-.96.167-.172.27-.401.286-.64l-.204-.167c-1.603-1.287-2.215-3.68-1.316-5.616a4.7 4.7 0 0 1 .918-1.32c1.145-1.151 2.296-2.294 3.445-3.441 1.239-1.23 3.178-1.694 4.864-1.105 1.83.639 3.16 2.498 3.12 4.493a4.8 4.8 0 0 1-1.391 3.265l-.578.578.03.092c.235.743.387 1.519.452 2.3v.005c.732-.731 1.521-1.406 2.162-2.244 1.192-1.559 1.643-3.651 1.204-5.575a6.8 6.8 0 0 0-3.98-4.703 6.8 6.8 0 0 0-2.529-.506h-.061z'/%3E%3C/svg%3E")}.ag-icon-loading:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Eloading%3C/title%3E%3Cpath d='M17 29h-2v-8h2zm-3.586-9L7 26.414 5.586 25 12 18.586zm13 5L25 26.414 18.586 20 20 18.586zM29 17h-8v-2h8zm-18 0H3v-2h8zm2.414-5L12 13.414 5.586 7 7 5.586zm13-5L20 13.414 18.586 12 25 5.586zM17 11h-2V3h2z'/%3E%3C/svg%3E")}.ag-icon-maximize:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='3 3 26 26'%3E%3Ctitle%3Emaximize%3C/title%3E%3Cpath d='m7.54 17.4.1 6.98 6.96.1-2.24-2.24L16 18.6 13.4 16l-3.64 3.64zm16.92-2.8-.1-6.98-6.96-.1 2.24 2.24L16 13.4l2.6 2.6 3.64-3.64z'/%3E%3C/svg%3E")}.ag-icon-menu:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Emenu%3C/title%3E%3Cpath d='M26 23H6v-2h20zm0-6H6v-2h20zm0-6H6V9h20z'/%3E%3C/svg%3E")}.ag-icon-menu-alt:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' fill='none'%3E%3Cpath fill='%23000' d='M16 18a2 2 0 1 0 0-4 2 2 0 0 0 0 4m0-7a2 2 0 1 0 0-4 2 2 0 0 0 0 4m0 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4'/%3E%3C/svg%3E")}.ag-icon-minimize:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='3 3 26 26'%3E%3Ctitle%3Eminimize%3C/title%3E%3Cpath d='m14.8 24.26-.1-6.96-6.96-.1 2.24 2.24-3.64 3.64 2.6 2.6 3.64-3.64zm2.4-16.52.1 6.96 6.96.1-2.24-2.24 3.64-3.64-2.6-2.6-3.64 3.64z'/%3E%3C/svg%3E")}.ag-icon-minus:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M7.515 7.515c-4.683 4.682-4.683 12.288 0 16.97 4.682 4.683 12.288 4.683 16.97 0 4.683-4.682 4.683-12.288 0-16.97-4.682-4.683-12.288-4.683-16.97 0m1.414 1.414c3.903-3.903 10.239-3.903 14.142 0s3.903 10.239 0 14.142-10.239 3.903-14.142 0-3.903-10.239 0-14.142m-1.414 6.07h16.97v2.002H7.515z' style='fill-rule:nonzero'/%3E%3C/svg%3E")}.ag-icon-next:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Enext%3C/title%3E%3Cpath d='m21.061 16-8.706 8.708-1.416-1.416L18.233 16l-7.294-7.292 1.416-1.416z'/%3E%3C/svg%3E")}.ag-icon-none:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Enone%3C/title%3E%3Cpath d='m10.044 21.258 4.478-4.198L16 18.444 9 25l-7-6.556 1.478-1.384 4.478 4.198V7h2.088zm14 3.742h-2.088V10.742l-4.478 4.198L16 13.556 23 7q3.5 3.28 7 6.556l-1.478 1.384-4.478-4.198z'/%3E%3C/svg%3E")}.ag-icon-not-allowed:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Enot-allowed%3C/title%3E%3Cpath d='M16.186 3.646c8.188.154 14.898 9.796 11.17 17.78-3.298 7.066-13.932 9.374-19.848 3.87-3.9-3.632-5.076-9.896-2.684-14.708 2.082-4.19 6.588-6.974 11.362-6.942m-.298 1.998c-6.922.132-12.578 8.308-9.33 15.052 3.342 6.934 15.246 7.646 18.932 0 3.076-6.386-1.988-15.1-9.602-15.052m7.596 6.422c2.864 5.33-1.744 13.186-8.306 12.536a8.6 8.6 0 0 1-3.232-.998l-1.266-.706L22.778 10.8q.351.633.706 1.266m-9.422 10.276c3.296 1.028 7.246-1.006 8.216-4.418a6.6 6.6 0 0 0-.056-3.742zm2.104-14.696a8.8 8.8 0 0 1 3.936 1.038l1.266.706L9.27 21.488c-3.018-5.41-.99-13.37 6.318-13.834q.289-.01.578-.008m-.31 2c-4.06.154-7.23 4.614-6.03 8.46l8.16-8.16a6.8 6.8 0 0 0-2.13-.3'/%3E%3C/svg%3E")}.ag-icon-paste:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Epaste%3C/title%3E%3Cpath d='M20 6.5c0-1-1-3-4-3s-4 2-4 3H8c-2.21 0-4 1.79-4 4v14c0 2.21 1.79 4 4 4h16c2.21 0 4-1.79 4-4v-14c0-2.21-1.79-4-4-4zm-4 .546c.734 0 1.334.572 1.334 1.272S16.734 9.59 16 9.59s-1.334-.572-1.334-1.272.6-1.272 1.334-1.272M24 26.5H8a2 2 0 0 1-2-2v-14a2 2 0 0 1 2-2h2v4h12v-4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2'/%3E%3C/svg%3E")}.ag-icon-pin:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Epin%3C/title%3E%3Cpath d='m10.78 19.777-4.668-4.666s.032-1 .67-1.87c1.366-1.86 4.052-1.96 6.056-1.572l3.158-3.108c-.7-2.342 3.352-5.046 3.352-5.046l9.166 9.168q-.334.447-.67.894c-1.074 1.426-2.538 2.63-4.272 2.338l-3.32 3.218c.046.344.042.03.118 1.152.144 2.13-.64 4.324-2.632 5.34l-.746.364-4.798-4.798-7.292 7.294-1.416-1.416zm8.24-13.672c-.688.568-1.416 1.45-1.024 2.072l.49.722-4.986 4.988c-1.988-.506-4.346-.636-5.156.614l9.02 9.032q.14-.099.272-.21c1.226-1.08.764-3.04.498-4.9l4.79-4.79s1.47.938 2.936-.776l-6.79-6.79q-.026.019-.05.038'/%3E%3C/svg%3E")}.ag-icon-pivot:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Epivot%3C/title%3E%3Cpath d='M25.128 2.002c2.56.096 4.772 2.292 4.87 4.87a712 712 0 0 1 0 18.256c-.096 2.56-2.292 4.772-4.87 4.87a712 712 0 0 1-18.256 0c-2.558-.096-4.772-2.29-4.87-4.87a712 712 0 0 1 0-18.256c.096-2.56 2.292-4.772 4.87-4.87a712 712 0 0 1 18.256 0m2.966 7.954H9.892v18.136c5.086.13 10.18.098 15.264-.096 1.48-.094 2.746-1.35 2.84-2.84.192-5.064.226-10.134.098-15.2M3.968 24.1q.015.528.036 1.056c.094 1.484 1.354 2.746 2.84 2.84l1.012.036V24.1zM22 15.414l-.292.294-1.416-1.416L23 11.586l2.708 2.706-1.416 1.416-.292-.294v3.592c-.032 2.604-2.246 4.892-4.872 4.992L15.414 24l.294.292-1.416 1.416L11.586 23l2.706-2.708 1.416 1.416-.322.32c3.372.03 6.578-.164 6.614-3.034zM3.88 18.038c.002 1.346.012 2.694.038 4.04h3.938v-4.04zm.05-6.062a681 681 0 0 0-.044 4.042h3.97v-4.042zm5.962-7.99Q8.449 3.999 7.006 4c-1.57.02-2.946 1.348-3.004 2.922q-.02 1.517-.042 3.034h3.896v-2.02h2.036zm14.244-.016v3.966h3.898q-.017-.546-.038-1.092c-.094-1.48-1.35-2.746-2.84-2.84q-.51-.019-1.02-.034m-8.14-.054q-2.035.022-4.07.048v3.972h4.07zm6.106.008c-1.358-.022-2.714-.026-4.07-.022v4.034h4.07z'/%3E%3C/svg%3E")}.ag-icon-plus:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M7.515 7.515c-4.683 4.682-4.683 12.288 0 16.97 4.682 4.683 12.288 4.683 16.97 0 4.683-4.682 4.683-12.288 0-16.97-4.682-4.683-12.288-4.683-16.97 0m1.414 1.414c3.903-3.903 10.239-3.903 14.142 0s3.903 10.239 0 14.142-10.239 3.903-14.142 0-3.903-10.239 0-14.142M15 15l-.001-7.485h2.002L17 15l7.485-.001v2.002L17 17l.001 7.485h-2.002L15 17l-7.485.001v-2.002z' style='fill-rule:nonzero'/%3E%3C/svg%3E")}.ag-icon-previous:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Eprevious%3C/title%3E%3Cpath d='M21.061 8.708 13.767 16l7.294 7.292-1.416 1.416L10.939 16l8.706-8.708z'/%3E%3C/svg%3E")}.ag-icon-right:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Eright%3C/title%3E%3Cpath d='m28.207 16-9.414 9.414L14.379 21l2-2H3.793v-6h12.586l-2-2 4.414-4.414zm-11-5 4 4H5.793v2h15.414l-4 4 1.586 1.586L25.379 16l-6.586-6.586z'/%3E%3C/svg%3E")}.ag-icon-save:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Esave%3C/title%3E%3Cpath d='M25.333 16v9.333H6.666V16H3.999v9.333C3.999 26.8 5.199 28 6.666 28h18.667C26.8 28 28 26.8 28 25.333V16zm-8 .893 3.453-3.44 1.88 1.88L15.999 22l-6.667-6.667 1.88-1.88 3.453 3.44V4h2.667v12.893z'/%3E%3C/svg%3E")}.ag-icon-small-down:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Esmall-down%3C/title%3E%3Cpath d='M24.708 12.355 16 21.061l-8.708-8.706 1.416-1.416L16 18.233l7.292-7.294z'/%3E%3C/svg%3E")}.ag-icon-small-left:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Esmall-left%3C/title%3E%3Cpath d='M21.061 8.708 13.767 16l7.294 7.292-1.416 1.416L10.939 16l8.706-8.708z'/%3E%3C/svg%3E")}.ag-icon-small-right:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Esmall-right%3C/title%3E%3Cpath d='m21.061 16-8.706 8.708-1.416-1.416L18.233 16l-7.294-7.292 1.416-1.416z'/%3E%3C/svg%3E")}.ag-icon-small-up:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Esmall-up%3C/title%3E%3Cpath d='m24.708 19.645-1.416 1.416L16 13.767l-7.292 7.294-1.416-1.416L16 10.939z'/%3E%3C/svg%3E")}.ag-icon-tick:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Etick%3C/title%3E%3Cpath d='M24.708 10.855 13 22.561l-5.708-5.706 1.416-1.416L13 19.733 23.292 9.439z'/%3E%3C/svg%3E")}.ag-icon-tree-closed:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Etree-closed%3C/title%3E%3Cpath d='m21.061 16-8.706 8.708-1.416-1.416L18.233 16l-7.294-7.292 1.416-1.416z'/%3E%3C/svg%3E")}.ag-icon-tree-indeterminate:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Etree-indeterminate%3C/title%3E%3Cpath d='M6 15h20v2H6z'/%3E%3C/svg%3E")}.ag-icon-tree-open:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Etree-open%3C/title%3E%3Cpath d='M24.708 12.355 16 21.061l-8.708-8.706 1.416-1.416L16 18.233l7.292-7.294z'/%3E%3C/svg%3E")}.ag-icon-unlinked:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Eunlinked%3C/title%3E%3Cpath d='M5.35 3.999a.2.2 0 0 0-.14.058c-.388.38-.768.768-1.152 1.152a.21.21 0 0 0-.002.288c7.459 7.506 14.965 14.965 22.447 22.447a.21.21 0 0 0 .288.002q.576-.574 1.151-1.151a.21.21 0 0 0 .002-.288C20.484 19.002 12.979 11.542 5.497 4.06a.2.2 0 0 0-.146-.061zm.611 12.548c-1.933 1.939-2.538 5.119-1.289 7.688a6.79 6.79 0 0 0 4.891 3.672 6.82 6.82 0 0 0 5.893-1.866l1.984-1.984-1.438-1.438-1.986 1.986c-1.486 1.476-3.993 1.81-5.834.629a4.73 4.73 0 0 1-2.024-2.853 4.76 4.76 0 0 1 1.241-4.393l1.986-1.986-1.438-1.438-1.984 1.984zM21.273 3.999a6.78 6.78 0 0 0-4.727 1.963l-1.984 1.984L16 9.384l1.985-1.985a4.74 4.74 0 0 1 2.776-1.338c1.974-.224 4.045.926 4.845 2.834.712 1.699.329 3.778-1.004 5.12L22.616 16l1.439 1.438q1-1 2-2c2.012-2.031 2.557-5.368 1.112-7.982-1.144-2.07-3.432-3.441-5.834-3.459h-.061z'/%3E%3C/svg%3E")}.ag-icon-up:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Easc%3C/title%3E%3Cpath d='m15 10.621-4.292 4.294-1.416-1.416L16 6.793l6.708 6.706-1.416 1.416L17 10.621v14.586h-2z'/%3E%3C/svg%3E")}.ag-icon-grip:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Egrip%3C/title%3E%3Cpath d='M8 24H6v-4h2zm6 0h-2v-4h2zm6 0h-2v-4h2zm6 0h-2v-4h2zM8 18H6v-4h2zm6 0h-2v-4h2zm6 0h-2v-4h2zm6 0h-2v-4h2zM8 12H6V8h2zm6 0h-2V8h2zm6 0h-2V8h2zm6 0h-2V8h2z'/%3E%3C/svg%3E")}.ag-icon-settings:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' fill='none' viewBox='0 0 32 32'%3E%3Cpath fill='%23000' d='M30 8h-4.1c-.5-2.3-2.5-4-4.9-4s-4.4 1.7-4.9 4H2v2h14.1c.5 2.3 2.5 4 4.9 4s4.4-1.7 4.9-4H30zm-9 4c-1.7 0-3-1.3-3-3s1.3-3 3-3 3 1.3 3 3-1.3 3-3 3M2 24h4.1c.5 2.3 2.5 4 4.9 4s4.4-1.7 4.9-4H30v-2H15.9c-.5-2.3-2.5-4-4.9-4s-4.4 1.7-4.9 4H2zm9-4c1.7 0 3 1.3 3 3s-1.3 3-3 3-3-1.3-3-3 1.3-3 3-3'/%3E%3C/svg%3E")}.ag-icon-column-arrow:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 32 32'%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M11 4a1 1 0 0 1 1 1v22a1 1 0 1 1-2 0V5a1 1 0 0 1 1-1' clip-rule='evenodd'/%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M2 13a1 1 0 0 1 1-1h23.5a1 1 0 1 1 0 2H3a1 1 0 0 1-1-1' clip-rule='evenodd'/%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M2 4h18v24H2zm2 2v20h14V6zM26.793 13 23 9.207l1.414-1.414L29.621 13l-5.207 5.207L23 16.793z' clip-rule='evenodd'/%3E%3C/svg%3E")}.ag-icon-un-pin:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' fill='none' viewBox='0 0 32 32'%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='m6.112 15.111 3.272 3.271 1.436-1.402-2.476-2.479c.81-1.25 3.168-1.12 5.156-.614l4.986-4.988-.49-.722c-.392-.622.336-1.504 1.024-2.072l.008-.007.01-.006.032-.025 1.447 1.447 1.432-1.397-2.601-2.602s-4.052 2.704-3.352 5.046l-3.158 3.108c-2.004-.388-4.69-.288-6.056 1.572-.638.87-.67 1.87-.67 1.87m.581 11.582.014.014 5.502-5.501 4.783 4.783.746-.364c1.992-1.016 2.776-3.21 2.632-5.34-.055-.805-.068-.87-.088-.97-.008-.04-.017-.085-.03-.182l3.32-3.218c1.734.292 3.198-.912 4.272-2.338q.337-.447.67-.894l-.001-.001-.007-.007-.007-.007-.007-.007-3.87-3.87 1.585-1.584-1.414-1.414-14.381 14.38-1.237 1.209-5.69 5.687 1.417 1.416zM23.21 10.206l2.65 2.651c-1.465 1.714-2.935.776-2.935.776l-4.79 4.79q.041.291.087.583c.257 1.676.513 3.35-.585 4.317a4 4 0 0 1-.272.21l-3.739-3.744z' clip-rule='evenodd'/%3E%3C/svg%3E")}.ag-icon-pinned-top:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' fill='none' viewBox='0 0 32 32'%3E%3Cpath fill='currentColor' d='m16.708 10.878 8.708 8.706L24 21l-6.292-6.294V27h-2V14.706L9.416 21 8 19.584q4.348-4.344 8.691-8.69zM25 6H8v2h17z'/%3E%3C/svg%3E")}.ag-icon-pinned-bottom:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' fill='none' viewBox='0 0 32 32'%3E%3Cpath fill='currentColor' d='M16.708 22.122 8 13.416 9.416 12l6.292 6.294V6h2v12.294L24 12l1.416 1.416-8.691 8.69zM7.416 28h17v-2h-17z'/%3E%3C/svg%3E")}.ag-icon-chevron-up:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 16 16'%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M3.479 10.521a.75.75 0 0 1 0-1.06l4-4a.75.75 0 0 1 1.06 0l4 4a.75.75 0 0 1-1.06 1.06l-3.47-3.47-3.47 3.47a.75.75 0 0 1-1.06 0' clip-rule='evenodd'/%3E%3C/svg%3E")}.ag-icon-chevron-down:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 16 16'%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M12.521 5.461a.75.75 0 0 1 0 1.06l-4 4a.75.75 0 0 1-1.06 0l-4-4a.75.75 0 0 1 1.06-1.06l3.47 3.47 3.47-3.47a.75.75 0 0 1 1.06 0' clip-rule='evenodd'/%3E%3C/svg%3E")}.ag-icon-chevron-left:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 16 16'%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M10.53 12.512a.75.75 0 0 1-1.06 0l-4-4a.75.75 0 0 1 0-1.06l4-4a.75.75 0 0 1 1.06 1.06l-3.47 3.47 3.47 3.47a.75.75 0 0 1 0 1.06' clip-rule='evenodd'/%3E%3C/svg%3E")}.ag-icon-chevron-right:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 16 16'%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M5.47 3.47a.75.75 0 0 1 1.06 0l4 4a.75.75 0 0 1 0 1.06l-4 4a.75.75 0 0 1-1.06-1.06L8.94 8 5.47 4.53a.75.75 0 0 1 0-1.06' clip-rule='evenodd'/%3E%3C/svg%3E")}.ag-icon-filter-add:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' fill='none' viewBox='0 0 32 32'%3E%3Cpath fill='currentColor' d='M19.834 8H8c0 .304.06.612.258.842 2.716 2.854 6.682 5.548 6.742 7.974V21l2-1.5v-2.684c.056-2.267 2.968-4.417 5.49-6.75v3.087c-1.081.974-2.245 1.968-3.232 3.005a1.05 1.05 0 0 0-.258.682v3.66L13 25c0-2.74.066-5.482-.002-8.222a1.05 1.05 0 0 0-.256-.62C10.026 13.304 6.06 10.61 6 8.184V6h13.834z'/%3E%3Cpath fill='currentColor' d='M26 6h2.946v2.002H26v3.313h-2.002V8.002h-2.946V6h2.946V3.04H26z'/%3E%3C/svg%3E")}.ag-icon-edit:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' fill='none' viewBox='0 0 32 32'%3E%3Cpath fill='currentColor' d='M23.182 5a3.82 3.82 0 0 1 2.83 6.383l-.131.137-2.09 2.088a1 1 0 0 1-.084.099 1 1 0 0 1-.098.084L12.533 24.869a3 3 0 0 1-1.245.746l-4.353 1.32-.003.002a1.5 1.5 0 0 1-1.87-1.867l.003-.004 1.32-4.352v-.003l.06-.174c.13-.344.321-.661.565-.936l.126-.135L18.209 8.39a1 1 0 0 1 .18-.181l2.092-2.09.137-.132A3.82 3.82 0 0 1 23.182 5M8.548 20.883a1 1 0 0 0-.25.415l-1.049 3.451 3.457-1.048.114-.042q.17-.076.301-.206l10.458-10.46-2.572-2.572zM23.182 7c-.482 0-.946.19-1.287.531v.001l-1.474 1.475 2.572 2.572 1.474-1.474.121-.133A1.82 1.82 0 0 0 23.182 7'/%3E%3C/svg%3E")}`
    );
    var iconSetBalham = /* @__PURE__ */ createPart({
      feature: "iconSet",
      css: iconSetBalhamCSS
    });
    var iconNameToSvgFragment = {
      aggregation: '<path d="M18 7V4H6l6 8-6 8h12v-3"/>',
      arrows: '<polyline points="5 9 2 12 5 15"/><polyline points="9 5 12 2 15 5"/><polyline points="15 19 12 22 9 19"/><polyline points="19 9 22 12 19 15"/><line x1="2" x2="22" y1="12" y2="12"/><line x1="12" x2="12" y1="2" y2="22"/>',
      asc: '<path d="m5 12 7-7 7 7"/><path d="M12 19V5"/>',
      cancel: '<path d="m18 6-12 12"/><path d="m6 6 12 12"/>',
      chart: '<line x1="18" x2="18" y1="20" y2="10"/><line x1="12" x2="12" y1="20" y2="4"/><line x1="6" x2="6" y1="20" y2="14"/>',
      "color-picker": '<path d="m19 11-8-8-8.6 8.6a2 2 0 0 0 0 2.8l5.2 5.2c.8.8 2 .8 2.8 0L19 11Z"/><path d="m5 2 5 5"/><path d="M2 13h15"/><path d="M22 20a2 2 0 1 1-4 0c0-1.6 1.7-2.4 2-4 .3 1.6 2 2.4 2 4Z"/>',
      columns: '<path d="M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18"/>',
      contracted: '<path d="m9 18 6-6-6-6"/>',
      copy: '<rect width="14" height="14" x="8" y="8" rx="2" ry="2"/><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"/>',
      cross: '<path d="M18 6 6 18"/><path d="m6 6 12 12"/>',
      csv: '<path d="M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z"/><polyline points="14 2 14 8 20 8"/><path d="M8 13h2"/><path d="M8 17h2"/><path d="M14 13h2"/><path d="M14 17h2"/>',
      cut: '<circle cx="6" cy="6" r="3"/><path d="M8.12 8.12 12 12"/><path d="M20 4 8.12 15.88"/><circle cx="6" cy="18" r="3"/><path d="M14.8 14.8 20 20"/>',
      desc: '<path d="M12 5v14"/><path d="m19 12-7 7-7-7"/>',
      down: '<path d="M12 5v14"/><path d="m19 12-7 7-7-7"/>',
      excel: '<path d="M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z"/><polyline points="14 2 14 8 20 8"/><path d="M8 13h2"/><path d="M8 17h2"/><path d="M14 13h2"/><path d="M14 17h2"/>',
      expanded: '<path d="m15 18-6-6 6-6"/>',
      "eye-slash": '<path d="M9.88 9.88a3 3 0 1 0 4.24 4.24"/><path d="M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68"/><path d="M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61"/><line x1="2" x2="22" y1="2" y2="22"/>',
      eye: '<path d="M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z"/><circle cx="12" cy="12" r="3"/>',
      filter: '<path d="M3 6h18"/><path d="M7 12h10"/><path d="M10 18h4"/>',
      first: '<path d="m17 18-6-6 6-6"/><path d="M7 6v12"/>',
      group: '<path d="M16 12H3"/><path d="M16 18H3"/><path d="M10 6H3"/><path d="M21 18V8a2 2 0 0 0-2-2h-5"/><path d="m16 8-2-2 2-2"/>',
      last: '<path d="m7 18 6-6-6-6"/><path d="M17 6v12"/>',
      left: '<path d="m12 19-7-7 7-7"/><path d="M19 12H5"/>',
      linked: '<path d="M9 17H7A5 5 0 0 1 7 7h2"/><path d="M15 7h2a5 5 0 1 1 0 10h-2"/><line x1="8" x2="16" y1="12" y2="12"/>',
      loading: '<line x1="12" x2="12" y1="2" y2="6"/><line x1="12" x2="12" y1="18" y2="22"/><line x1="4.93" x2="7.76" y1="4.93" y2="7.76"/><line x1="16.24" x2="19.07" y1="16.24" y2="19.07"/><line x1="2" x2="6" y1="12" y2="12"/><line x1="18" x2="22" y1="12" y2="12"/><line x1="4.93" x2="7.76" y1="19.07" y2="16.24"/><line x1="16.24" x2="19.07" y1="7.76" y2="4.93"/>',
      maximize: '<polyline points="15 3 21 3 21 9"/><polyline points="9 21 3 21 3 15"/><line x1="21" x2="14" y1="3" y2="10"/><line x1="3" x2="10" y1="21" y2="14"/>',
      menu: '<line x1="4" x2="20" y1="12" y2="12"/><line x1="4" x2="20" y1="6" y2="6"/><line x1="4" x2="20" y1="18" y2="18"/>',
      "menu-alt": '<circle cx="12" cy="5" r="0.75" fill="#D9D9D9"/><circle cx="12" cy="12" r="0.75" fill="#D9D9D9"/><circle cx="12" cy="19" r="0.75" fill="#D9D9D9"/>',
      minimize: '<polyline points="4 14 10 14 10 20"/><polyline points="20 10 14 10 14 4"/><line x1="14" x2="21" y1="10" y2="3"/><line x1="3" x2="10" y1="21" y2="14"/>',
      minus: '<circle cx="12" cy="12" r="10"/><path d="M8 12h8"/>',
      next: '<path d="m9 18 6-6-6-6"/>',
      none: '<path d="m7 15 5 5 5-5"/><path d="m7 9 5-5 5 5"/>',
      "not-allowed": '<circle cx="12" cy="12" r="10"/><path d="m4.9 4.9 14.2 14.2"/>',
      paste: '<path d="M15 2H9a1 1 0 0 0-1 1v2c0 .6.4 1 1 1h6c.6 0 1-.4 1-1V3c0-.6-.4-1-1-1Z"/><path d="M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2M16 4h2a2 2 0 0 1 2 2v2M11 14h10"/><path d="m17 10 4 4-4 4"/>',
      pin: '<line x1="12" x2="12" y1="17" y2="22"/><path d="M5 17h14v-1.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V6h1a2 2 0 0 0 0-4H8a2 2 0 0 0 0 4h1v4.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24Z"/>',
      pivot: '<path d="M15 3v18"/><rect width="18" height="18" x="3" y="3" rx="2"/><path d="M21 9H3"/><path d="M21 15H3"/>',
      plus: '<circle cx="12" cy="12" r="10"/><path d="M8 12h8"/><path d="M12 8v8"/>',
      previous: '<path d="m15 18-6-6 6-6"/>',
      right: '<path d="M5 12h14"/><path d="m12 5 7 7-7 7"/>',
      save: '<path d="M12 17V3"/><path d="m6 11 6 6 6-6"/><path d="M19 21H5"/>',
      "small-left": '<path d="m15 18-6-6 6-6"/>',
      "small-right": '<path d="m9 18 6-6-6-6"/>',
      tick: '<path d="M20 6 9 17l-5-5"/>',
      "tree-closed": '<path d="m9 18 6-6-6-6"/>',
      "tree-indeterminate": '<path d="M5 12h14"/>',
      "tree-open": '<path d="m6 9 6 6 6-6"/>',
      unlinked: '<path d="M9 17H7A5 5 0 0 1 7 7"/><path d="M15 7h2a5 5 0 0 1 4 8"/><line x1="8" x2="12" y1="12" y2="12"/><line x1="2" x2="22" y1="2" y2="22"/>',
      up: '<path d="m5 12 7-7 7 7"/><path d="M12 19V5"/>',
      grip: '<circle cx="5" cy="8" r="0.5"/><circle cx="12" cy="8" r="0.5"/><circle cx="19" cy="8" r="0.5"/><circle cx="5" cy="16" r="0.5"/><circle cx="12" cy="16" r="0.5"/><circle cx="19" cy="16" r="0.5"/><g stroke="none" fill="currentColor"><circle cx="5" cy="8" r="1"/><circle cx="12" cy="8" r="1"/><circle cx="19" cy="8" r="1"/><circle cx="5" cy="16" r="1"/><circle cx="12" cy="16" r="1"/><circle cx="19" cy="16" r="1"/></g>',
      settings: '<path d="M20 7h-9"/><path d="M14 17H5"/><circle cx="17" cy="17" r="3"/><circle cx="7" cy="7" r="3"/>'
    };
    var iconNameToFullSvg = {
      "column-arrow": '<svg xmlns="http://www.w3.org/2000/svg" class="ag-icon" fill="none" viewBox="0 0 32 32"><path fill-rule="evenodd" clip-rule="evenodd" d="M0 26C0 28.2092 1.79086 30 4 30H14C16.2091 30 18 28.2092 18 26V15H25.8786L24.4394 16.4393C23.8536 17.0251 23.8536 17.9749 24.4394 18.5607C25.0252 19.1464 25.9748 19.1464 26.5606 18.5607L30.5606 14.5607C31.1464 13.9749 31.1464 13.0251 30.5606 12.4393L26.5606 8.43934C25.9748 7.85356 25.0252 7.85356 24.4394 8.43934C23.8536 9.02512 23.8536 9.97488 24.4394 10.5607L25.8786 12H18V6C18 3.79086 16.2091 2 14 2H4C1.79086 2 0 3.79086 0 6V26ZM14 5H10.5V12H15V6C15 5.44772 14.5523 5 14 5ZM4 5H7.5V12H3V6C3 5.44772 3.44772 5 4 5ZM10.5 15H15V26C15 26.5522 14.5523 27 14 27H10.5V15ZM4 27H7.5V15H3V26C3 26.5522 3.44772 27 4 27Z" fill="currentColor"/></svg>',
      "small-down": '<svg xmlns="http://www.w3.org/2000/svg" class="ag-icon" fill="black" stroke="none" viewBox="0 0 32 32"><path d="M7.334 10.667 16 21.334l8.667-10.667H7.334Z"/></svg>',
      "small-up": '<svg xmlns="http://www.w3.org/2000/svg" class="ag-icon" fill="black" stroke="none" viewBox="0 0 32 32"><path d="M7.334 21.333 16 10.666l8.667 10.667H7.334Z"/></svg>',
      "pinned-top": '<svg xmlns="http://www.w3.org/2000/svg" class="ag-icon" fill="none" viewBox="0 0 16 16"><path fill="currentColor" d="M12.53 3.72A.75.75 0 0 1 12 5H4a.75.75 0 0 1 0-1.5h8a.75.75 0 0 1 .53.22ZM3.269 10.744a.75.75 0 0 1 .2-.524l4-4a.75.75 0 0 1 1.06 0l4 4a.75.75 0 1 1-1.06 1.06L8.75 8.56V14a.75.75 0 0 1-1.5 0V8.56l-2.72 2.72a.75.75 0 0 1-1.26-.536Z"/></svg>',
      "pinned-bottom": '<svg xmlns="http://www.w3.org/2000/svg" fill="none" class="ag-icon" viewBox="0 0 16 16"><path fill="currentColor" d="M3.47 12.28A.75.75 0 0 1 4 11h8a.75.75 0 0 1 0 1.5H4a.75.75 0 0 1-.53-.22ZM12.731 5.256a.75.75 0 0 1-.2.524l-4 4a.75.75 0 0 1-1.06 0l-4-4a.75.75 0 1 1 1.06-1.06l2.72 2.72V2a.75.75 0 0 1 1.5 0v5.44l2.72-2.72a.75.75 0 0 1 1.26.536Z"/></svg>',
      "un-pin": '<svg xmlns="http://www.w3.org/2000/svg" fill="none" class="ag-icon" viewBox="0 0 16 16"><path fill="currentColor" d="M8 11a.75.75 0 0 0-.75.75v3.333a.75.75 0 1 0 1.5 0V11.75A.75.75 0 0 0 8 11Z"/><path fill="currentColor" d="M13.11 1.436a.75.75 0 0 0-1.22-.872l-10 14a.75.75 0 1 0 1.22.872L5.207 12.5h7.376a.75.75 0 0 0 .75-.75v-1.174a2.08 2.08 0 0 0-1.153-1.863l-1.185-.599-.005-.002a.58.58 0 0 1-.323-.522V5.165a2.083 2.083 0 0 0 1.854-2.904l.589-.825Zm-3.943 5.52v.634a2.08 2.08 0 0 0 1.153 1.863l1.185.6.005.002a.58.58 0 0 1 .323.522V11H6.28l2.887-4.044ZM9.277 1H5.25a2.084 2.084 0 0 0-.083 4.165v1.676l1.5-2.132v-.292a.75.75 0 0 0-.75-.75H5.25a.584.584 0 0 1 0-1.167h2.972L9.277 1Z"/></svg>',
      "chevron-down": '<svg width="16" height="16" viewBox="0 0 16 16" class="ag-icon" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M12 6L8 10L4 6" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>',
      "chevron-up": '<svg width="16" height="16" viewBox="0 0 16 16" class="ag-icon" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M4 10L8 6L12 10" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>',
      "chevron-left": '<svg width="16" height="16" viewBox="0 0 16 16" class="ag-icon" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M10 12L6 8L10 4" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>',
      "chevron-right": '<svg width="16" height="16" viewBox="0 0 16 16" class="ag-icon" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M6 12L10 8L6 4" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>',
      "filter-add": '<svg width="16" height="16" viewBox="0 0 16 16" class="ag-icon" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M5.12126 7.75L10.8517 7.75" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/><path d="M6.65934 11.748L9.32778 11.748" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/><path d="M12.2943 1.04872V6.19184M14.9886 3.74341H9.68478" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/><path d="M8.25488 3C8.04799 3.18323 7.91706 3.45099 7.91699 3.74902C7.91713 4.04868 8.04988 4.31681 8.25879 4.5H2C1.58579 4.5 1.25 4.16421 1.25 3.75C1.25 3.33579 1.58579 3 2 3H8.25488Z" fill="currentColor"/></svg>',
      edit: '<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M3.5 10.6262V12.5012H5.375L10.905 6.97122L9.03 5.09622L3.5 10.6262ZM12.355 5.52122C12.4014 5.47497 12.4381 5.42002 12.4632 5.35953C12.4883 5.29905 12.5012 5.23421 12.5012 5.16872C12.5012 5.10324 12.4883 5.0384 12.4632 4.97791C12.4381 4.91742 12.4014 4.86248 12.355 4.81622L11.185 3.64622C11.1387 3.59987 11.0838 3.5631 11.0233 3.53801C10.9628 3.51291 10.898 3.5 10.8325 3.5C10.767 3.5 10.7022 3.51291 10.6417 3.53801C10.5812 3.5631 10.5263 3.59987 10.48 3.64622L9.565 4.56122L11.44 6.43622L12.355 5.52122Z" fill="currentColor"/></svg>'
    };
    var getQuartzIconsCss = (args2 = {}) => {
      let result2 = "";
      for (const iconName of [...Object.keys(iconNameToSvgFragment), ...Object.keys(iconNameToFullSvg)]) {
        const iconSvg = quartzIconSvg(iconName, args2.strokeWidth);
        result2 += `.ag-icon-${iconName}::before { mask-image: url('data:image/svg+xml,${encodeURIComponent(iconSvg)}'); }
`;
      }
      return result2;
    };
    var quartzIconSvg = (name2, strokeWidth = 1.5) => {
      const fullSVG = iconNameToFullSvg[name2];
      if (fullSVG) {
        return fullSVG;
      }
      const svgFragment = iconNameToSvgFragment[name2];
      if (!svgFragment) {
        throw new Error(`Missing icon data for ${name2}`);
      }
      return `<svg xmlns="http://www.w3.org/2000/svg" class="ag-icon" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke="black" stroke-width="${strokeWidth}" viewBox="0 0 24 24"><style>* { vector-effect: non-scaling-stroke; }</style>` + svgFragment + "</svg>";
    };
    var iconSetQuartz = (args2 = {}) => {
      return createPart({
        feature: "iconSet",
        css: () => getQuartzIconsCss(args2)
      });
    };
    var iconSetQuartzRegular = /* @__PURE__ */ iconSetQuartz();
    var inputStyleBaseCSS = (
      /*css*/
      `:where(.ag-input-field-input[type=number]:not(.ag-number-field-input-stepper)){-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield;&::-webkit-inner-spin-button,&::-webkit-outer-spin-button{-webkit-appearance:none;appearance:none;margin:0}}.ag-input-field-input:where(input:not([type]),input[type=text],input[type=number],input[type=tel],input[type=date],input[type=datetime-local],textarea){background-color:var(--ag-input-background-color);border:var(--ag-input-border);border-radius:var(--ag-input-border-radius);color:var(--ag-input-text-color);font-family:inherit;font-size:inherit;line-height:inherit;margin:0;min-height:var(--ag-input-height);padding:0;&:where(:disabled){background-color:var(--ag-input-disabled-background-color);border:var(--ag-input-disabled-border);color:var(--ag-input-disabled-text-color)}&:where(:focus){background-color:var(--ag-input-focus-background-color);border:var(--ag-input-focus-border);box-shadow:var(--ag-input-focus-shadow);color:var(--ag-input-focus-text-color);outline:none}&:where(:invalid){background-color:var(--ag-input-invalid-background-color);border:var(--ag-input-invalid-border);color:var(--ag-input-invalid-text-color)}&:where(.invalid){background-color:var(--ag-input-invalid-background-color);border:var(--ag-input-invalid-border);color:var(--ag-input-invalid-text-color)}&::-moz-placeholder{color:var(--ag-input-placeholder-text-color)}&::placeholder{color:var(--ag-input-placeholder-text-color)}}:where(.ag-ltr) .ag-input-field-input:where(input:not([type]),input[type=text],input[type=number],input[type=tel],input[type=date],input[type=datetime-local],textarea){padding-left:var(--ag-input-padding-start)}:where(.ag-rtl) .ag-input-field-input:where(input:not([type]),input[type=text],input[type=number],input[type=tel],input[type=date],input[type=datetime-local],textarea){padding-right:var(--ag-input-padding-start)}:where(.ag-column-select-header-filter-wrapper,.ag-filter-toolpanel-search,.ag-mini-filter,.ag-filter-filter,.ag-filter-add-select){.ag-input-wrapper:before{background-color:currentcolor;color:var(--ag-input-icon-color);content:"";display:block;height:12px;-webkit-mask-image:url("data:image/svg+xml;charset=utf-8;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMiIgaGVpZ2h0PSIxMiIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjMDAwIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIHN0cm9rZS13aWR0aD0iMS41Ij48cGF0aCBkPSJNNS4zIDlhMy43IDMuNyAwIDEgMCAwLTcuNSAzLjcgMy43IDAgMCAwIDAgNy41Wk0xMC41IDEwLjUgOC4zIDguMiIvPjwvc3ZnPg==");mask-image:url("data:image/svg+xml;charset=utf-8;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMiIgaGVpZ2h0PSIxMiIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjMDAwIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIHN0cm9rZS13aWR0aD0iMS41Ij48cGF0aCBkPSJNNS4zIDlhMy43IDMuNyAwIDEgMCAwLTcuNSAzLjcgMy43IDAgMCAwIDAgNy41Wk0xMC41IDEwLjUgOC4zIDguMiIvPjwvc3ZnPg==");-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;opacity:.5;position:absolute;width:12px}}:where(.ag-ltr) :where(.ag-column-select-header-filter-wrapper,.ag-filter-toolpanel-search,.ag-mini-filter,.ag-filter-filter,.ag-filter-add-select){.ag-input-wrapper:before{margin-left:var(--ag-spacing)}.ag-number-field-input,.ag-text-field-input{padding-left:calc(var(--ag-spacing)*1.5 + 12px)}}:where(.ag-rtl) :where(.ag-column-select-header-filter-wrapper,.ag-filter-toolpanel-search,.ag-mini-filter,.ag-filter-filter,.ag-filter-add-select){.ag-input-wrapper:before{margin-right:var(--ag-spacing)}.ag-number-field-input,.ag-text-field-input{padding-right:calc(var(--ag-spacing)*1.5 + 12px)}}`
    );
    var inputStyleBorderedCSS = (
      /*css*/
      `.ag-input-field-input:where(input:not([type]),input[type=text],input[type=number],input[type=tel],input[type=date],input[type=datetime-local],textarea){&:focus{box-shadow:var(--ag-focus-shadow);&:where(.invalid),&:where(:invalid){box-shadow:var(--ag-focus-error-shadow)}}}`
    );
    var baseParams3 = {
      inputBackgroundColor: "transparent",
      inputBorder: false,
      inputBorderRadius: 0,
      inputTextColor: {
        ref: "textColor"
      },
      inputPlaceholderTextColor: {
        ref: "inputTextColor",
        mix: 0.5
      },
      inputPaddingStart: 0,
      inputHeight: {
        calc: "max(iconSize, fontSize) + spacing * 2"
      },
      inputFocusBackgroundColor: {
        ref: "inputBackgroundColor"
      },
      inputFocusBorder: {
        ref: "inputBorder"
      },
      inputFocusShadow: "none",
      inputFocusTextColor: {
        ref: "inputTextColor"
      },
      inputDisabledBackgroundColor: {
        ref: "inputBackgroundColor"
      },
      inputDisabledBorder: {
        ref: "inputBorder"
      },
      inputDisabledTextColor: {
        ref: "inputTextColor"
      },
      inputInvalidBackgroundColor: {
        ref: "inputBackgroundColor"
      },
      inputInvalidBorder: {
        ref: "inputBorder"
      },
      inputInvalidTextColor: {
        ref: "inputTextColor"
      },
      inputIconColor: {
        ref: "inputTextColor"
      },
      pickerButtonBorder: false,
      pickerButtonFocusBorder: { ref: "inputFocusBorder" },
      pickerButtonBackgroundColor: { ref: "backgroundColor" },
      pickerButtonFocusBackgroundColor: { ref: "backgroundColor" },
      pickerListBorder: false,
      pickerListBackgroundColor: { ref: "backgroundColor" },
      colorPickerThumbSize: 18,
      colorPickerTrackSize: 12,
      colorPickerThumbBorderWidth: 3,
      colorPickerTrackBorderRadius: 12,
      colorPickerColorBorderRadius: 4
    };
    var makeInputStyleBorderedTreeShakeable = () => createPart({
      feature: "inputStyle",
      params: {
        ...baseParams3,
        inputBackgroundColor: backgroundColor,
        inputBorder: true,
        inputBorderRadius: {
          ref: "borderRadius"
        },
        inputPaddingStart: {
          ref: "spacing"
        },
        inputFocusBorder: {
          color: accentColor
        },
        inputFocusShadow: {
          ref: "focusShadow"
        },
        inputDisabledBackgroundColor: foregroundBackgroundMix(0.06),
        inputDisabledTextColor: {
          ref: "textColor",
          mix: 0.5
        },
        inputInvalidBorder: {
          color: { ref: "invalidColor" }
        },
        pickerButtonBorder: true,
        pickerListBorder: true
      },
      css: () => inputStyleBaseCSS + inputStyleBorderedCSS
    });
    var inputStyleBordered = /* @__PURE__ */ makeInputStyleBorderedTreeShakeable();
    var tabStyleBaseCSS = (
      /*css*/
      `.ag-tabs-header{background-color:var(--ag-tab-bar-background-color);border-bottom:var(--ag-tab-bar-border);display:flex;flex:1;gap:var(--ag-tab-spacing);padding:var(--ag-tab-bar-top-padding) var(--ag-tab-bar-horizontal-padding) 0}.ag-tabs-header-wrapper{display:flex}.ag-tabs-close-button-wrapper{align-items:center;border:0;display:flex;padding:var(--ag-spacing)}:where(.ag-ltr) .ag-tabs-close-button-wrapper{border-right:solid var(--ag-border-width) var(--ag-border-color)}:where(.ag-rtl) .ag-tabs-close-button-wrapper{border-left:solid var(--ag-border-width) var(--ag-border-color)}.ag-tabs-close-button{background-color:unset;border:0;cursor:pointer;padding:0}.ag-tab{align-items:center;background-color:var(--ag-tab-background-color);border-left:var(--ag-tab-selected-border-width) solid transparent;border-right:var(--ag-tab-selected-border-width) solid transparent;color:var(--ag-tab-text-color);cursor:pointer;display:flex;flex:1;justify-content:center;padding:var(--ag-tab-top-padding) var(--ag-tab-horizontal-padding) var(--ag-tab-bottom-padding);position:relative;&:hover{background-color:var(--ag-tab-hover-background-color);color:var(--ag-tab-hover-text-color)}&.ag-tab-selected{background-color:var(--ag-tab-selected-background-color);color:var(--ag-tab-selected-text-color)}&:after{background-color:var(--ag-tab-selected-underline-color);bottom:0;content:"";display:block;height:var(--ag-tab-selected-underline-width);left:0;opacity:0;position:absolute;right:0;transition:opacity var(--ag-tab-selected-underline-transition-duration)}&.ag-tab-selected:after{opacity:1}}:where(.ag-ltr) .ag-tab{&.ag-tab-selected{&:where(:not(:first-of-type)){border-left-color:var(--ag-tab-selected-border-color)}&:where(:not(:last-of-type)){border-right-color:var(--ag-tab-selected-border-color)}}}:where(.ag-rtl) .ag-tab{&.ag-tab-selected{&:where(:not(:first-of-type)){border-right-color:var(--ag-tab-selected-border-color)}&:where(:not(:last-of-type)){border-left-color:var(--ag-tab-selected-border-color)}}}`
    );
    var tabStyleRolodexCSS = (
      /*css*/
      `.ag-tab{border-left:var(--ag-tab-selected-border-width) solid transparent;border-right:var(--ag-tab-selected-border-width) solid transparent;border-top:var(--ag-tab-selected-border-width) solid transparent;flex:none;&.ag-tab-selected{border-left-color:var(--ag-tab-selected-border-color);border-right-color:var(--ag-tab-selected-border-color);border-top-color:var(--ag-tab-selected-border-color);margin-bottom:-1px;padding-bottom:calc(var(--ag-tab-bottom-padding) + 1px)}}`
    );
    var baseParams4 = {
      tabBarBackgroundColor: "transparent",
      tabBarHorizontalPadding: 0,
      tabBarTopPadding: 0,
      tabBackgroundColor: "transparent",
      tabTextColor: {
        ref: "textColor"
      },
      tabHorizontalPadding: {
        ref: "spacing"
      },
      tabTopPadding: {
        ref: "spacing"
      },
      tabBottomPadding: {
        ref: "spacing"
      },
      tabSpacing: "0",
      tabHoverBackgroundColor: {
        ref: "tabBackgroundColor"
      },
      tabHoverTextColor: {
        ref: "tabTextColor"
      },
      tabSelectedBackgroundColor: {
        ref: "tabBackgroundColor"
      },
      tabSelectedTextColor: {
        ref: "tabTextColor"
      },
      tabSelectedBorderWidth: { ref: "borderWidth" },
      tabSelectedBorderColor: "transparent",
      tabSelectedUnderlineColor: "transparent",
      tabSelectedUnderlineWidth: 0,
      tabSelectedUnderlineTransitionDuration: 0,
      tabBarBorder: false
    };
    var makeTabStyleQuartzTreeShakeable = () => createPart({
      feature: "tabStyle",
      params: {
        ...baseParams4,
        tabBarBorder: true,
        tabBarBackgroundColor: foregroundMix(0.05),
        tabTextColor: {
          ref: "textColor",
          mix: 0.7
        },
        tabSelectedTextColor: {
          ref: "textColor"
        },
        tabHoverTextColor: {
          ref: "textColor"
        },
        tabSelectedBorderColor: {
          ref: "borderColor"
        },
        tabSelectedBackgroundColor: backgroundColor
      },
      css: tabStyleBaseCSS
    });
    var tabStyleQuartz = /* @__PURE__ */ makeTabStyleQuartzTreeShakeable();
    var makeTabStyleRolodexTreeShakeable = () => createPart({
      feature: "tabStyle",
      params: {
        ...baseParams4,
        tabBarBackgroundColor: {
          ref: "chromeBackgroundColor"
        },
        tabBarHorizontalPadding: {
          ref: "spacing"
        },
        tabBarTopPadding: {
          ref: "spacing"
        },
        tabBarBorder: true,
        tabHorizontalPadding: { calc: "spacing * 2" },
        tabTopPadding: {
          ref: "spacing"
        },
        tabBottomPadding: {
          ref: "spacing"
        },
        tabSpacing: {
          ref: "spacing"
        },
        tabSelectedBorderColor: {
          ref: "borderColor"
        },
        tabSelectedBackgroundColor: backgroundColor
      },
      css: () => tabStyleBaseCSS + tabStyleRolodexCSS
    });
    var tabStyleRolodex = /* @__PURE__ */ makeTabStyleRolodexTreeShakeable();
    var makeThemeQuartzTreeShakeable = () => createTheme().withPart(checkboxStyleDefault).withPart(colorSchemeVariable).withPart(iconSetQuartzRegular).withPart(tabStyleQuartz).withPart(inputStyleBordered).withPart(columnDropStyleBordered).withParams({
      fontFamily: [
        { googleFont: "IBM Plex Sans" },
        "-apple-system",
        "BlinkMacSystemFont",
        "Segoe UI",
        "Roboto",
        "Oxygen-Sans",
        "Ubuntu"
      ]
    });
    var themeQuartz = /* @__PURE__ */ makeThemeQuartzTreeShakeable();
    var makeThemeBalhamTreeShakeable = () => createTheme().withPart(buttonStyleBalham).withPart(checkboxStyleDefault).withPart(colorSchemeVariable).withPart(iconSetBalham).withPart(tabStyleRolodex).withPart(inputStyleBordered).withPart(columnDropStylePlain).withParams({
      accentColor: "#0091ea",
      borderColor: foregroundMix(0.2),
      spacing: 4,
      widgetVerticalSpacing: { calc: "max(8px, spacing)" },
      borderRadius: 2,
      wrapperBorderRadius: 2,
      headerColumnResizeHandleColor: "transparent",
      headerColumnBorder: true,
      headerColumnBorderHeight: "50%",
      oddRowBackgroundColor: {
        ref: "chromeBackgroundColor",
        mix: 0.5
      },
      checkboxBorderRadius: 2,
      checkboxBorderWidth: 1,
      checkboxUncheckedBackgroundColor: backgroundColor,
      checkboxUncheckedBorderColor: foregroundBackgroundMix(0.5),
      checkboxCheckedBackgroundColor: backgroundColor,
      checkboxCheckedBorderColor: accentColor,
      checkboxCheckedShapeColor: accentColor,
      checkboxIndeterminateBackgroundColor: backgroundColor,
      checkboxIndeterminateBorderColor: foregroundBackgroundMix(0.5),
      checkboxIndeterminateShapeColor: foregroundBackgroundMix(0.5),
      focusShadow: { radius: 2, spread: 1, color: accentColor },
      headerTextColor: foregroundMix(0.6),
      iconButtonHoverBackgroundColor: "transparent",
      iconButtonActiveBackgroundColor: "transparent",
      fontSize: 12,
      tabSelectedBackgroundColor: backgroundColor,
      headerFontWeight: "bold",
      toggleButtonWidth: 32,
      toggleButtonHeight: 16,
      toggleButtonSwitchInset: 1,
      toggleButtonOffBackgroundColor: foregroundBackgroundMix(0.5),
      sideButtonBorder: true,
      sideButtonBarTopPadding: { calc: "spacing * 4" },
      popupShadow: "5px 5px 10px rgba(0, 0, 0, 0.3)",
      statusBarLabelColor: foregroundMix(0.54),
      statusBarLabelFontWeight: 600,
      statusBarValueFontWeight: 600,
      panelTitleBarIconColor: foregroundColor,
      colorPickerThumbSize: 13,
      colorPickerTrackSize: 11,
      colorPickerThumbBorderWidth: 2,
      colorPickerTrackBorderRadius: 2,
      colorPickerColorBorderRadius: 2
    });
    var themeBalham = /* @__PURE__ */ makeThemeBalhamTreeShakeable();
    var CELL_HORIZONTAL_PADDING = {
      cssName: "--ag-cell-horizontal-padding",
      changeKey: "cellHorizontalPaddingChanged",
      defaultValue: 16
    };
    var INDENTATION_LEVEL = {
      cssName: "--ag-indentation-level",
      changeKey: "indentationLevelChanged",
      defaultValue: 0,
      noWarn: true,
      cacheDefault: true
    };
    var ROW_GROUP_INDENT_SIZE = {
      cssName: "--ag-row-group-indent-size",
      changeKey: "rowGroupIndentSizeChanged",
      defaultValue: 0
    };
    var ROW_HEIGHT = {
      cssName: "--ag-row-height",
      changeKey: "rowHeightChanged",
      defaultValue: 42
    };
    var HEADER_HEIGHT = {
      cssName: "--ag-header-height",
      changeKey: "headerHeightChanged",
      defaultValue: 48
    };
    var LIST_ITEM_HEIGHT = {
      cssName: "--ag-list-item-height",
      changeKey: "listItemHeightChanged",
      defaultValue: 24
    };
    var ROW_BORDER_WIDTH = {
      cssName: "--ag-row-border",
      changeKey: "rowBorderWidthChanged",
      defaultValue: 1,
      border: true
    };
    var PINNED_BORDER_WIDTH = {
      cssName: "--ag-pinned-row-border",
      changeKey: "pinnedRowBorderWidthChanged",
      defaultValue: 1,
      border: true
    };
    function _addAdditionalCss(cssMap, modules) {
      for (const module2 of modules.sort((a, b) => a.moduleName.localeCompare(b.moduleName))) {
        const moduleCss = module2.css;
        if (moduleCss) {
          cssMap.set(`module-${module2.moduleName}`, moduleCss);
        }
      }
    }
    var Environment = class extends BaseEnvironment {
      constructor() {
        super(...arguments);
        this.sizeEls = /* @__PURE__ */ new Map();
        this.lastKnownValues = /* @__PURE__ */ new Map();
        this.sizesMeasured = false;
      }
      initVariables() {
        this.addManagedPropertyListener("rowHeight", () => this.refreshRowHeightVariable());
        this.getSizeEl(ROW_HEIGHT);
        this.getSizeEl(HEADER_HEIGHT);
        this.getSizeEl(LIST_ITEM_HEIGHT);
        this.getSizeEl(ROW_BORDER_WIDTH);
        this.getSizeEl(PINNED_BORDER_WIDTH);
        this.refreshRowBorderWidthVariable();
      }
      getPinnedRowBorderWidth() {
        return this.getCSSVariablePixelValue(PINNED_BORDER_WIDTH);
      }
      getRowBorderWidth() {
        return this.getCSSVariablePixelValue(ROW_BORDER_WIDTH);
      }
      getDefaultRowHeight() {
        return this.getCSSVariablePixelValue(ROW_HEIGHT);
      }
      getDefaultHeaderHeight() {
        return this.getCSSVariablePixelValue(HEADER_HEIGHT);
      }
      getDefaultCellHorizontalPadding() {
        return this.getCSSVariablePixelValue(CELL_HORIZONTAL_PADDING);
      }
      getCellPaddingLeft() {
        const cellHorizontalPadding = this.getDefaultCellHorizontalPadding();
        const indentationLevel = this.getCSSVariablePixelValue(INDENTATION_LEVEL);
        const rowGroupIndentSize = this.getCSSVariablePixelValue(ROW_GROUP_INDENT_SIZE);
        return cellHorizontalPadding - 1 + rowGroupIndentSize * indentationLevel;
      }
      getCellPadding() {
        const cellPaddingRight = this.getDefaultCellHorizontalPadding() - 1;
        return this.getCellPaddingLeft() + cellPaddingRight;
      }
      getDefaultColumnMinWidth() {
        return Math.min(36, this.getDefaultRowHeight());
      }
      getDefaultListItemHeight() {
        return this.getCSSVariablePixelValue(LIST_ITEM_HEIGHT);
      }
      refreshRowHeightVariable() {
        const { eRootDiv } = this;
        const oldRowHeight = eRootDiv.style.getPropertyValue("--ag-line-height").trim();
        const height = this.gos.get("rowHeight");
        if (height == null || isNaN(height) || !isFinite(height)) {
          if (oldRowHeight !== null) {
            eRootDiv.style.setProperty("--ag-line-height", null);
          }
          return -1;
        }
        const newRowHeight = `${height}px`;
        if (oldRowHeight != newRowHeight) {
          eRootDiv.style.setProperty("--ag-line-height", newRowHeight);
          return height;
        }
        return oldRowHeight != "" ? Number.parseFloat(oldRowHeight) : -1;
      }
      getCSSVariablePixelValue(variable) {
        const cached = this.lastKnownValues.get(variable);
        if (cached != null) {
          return cached;
        }
        const measurement = this.measureSizeEl(variable);
        if (measurement === "detached" || measurement === "no-styles") {
          if (variable.cacheDefault) {
            this.lastKnownValues.set(variable, variable.defaultValue);
          }
          return variable.defaultValue;
        }
        this.lastKnownValues.set(variable, measurement);
        return measurement;
      }
      measureSizeEl(variable) {
        const sizeEl = this.getSizeEl(variable);
        if (sizeEl.offsetParent == null) {
          return "detached";
        }
        const newSize = sizeEl.offsetWidth;
        if (newSize === NO_VALUE_SENTINEL) {
          return "no-styles";
        }
        this.sizesMeasured = true;
        return newSize;
      }
      getMeasurementContainer() {
        let container2 = this.eMeasurementContainer;
        if (!container2) {
          container2 = this.eMeasurementContainer = _createElement({ tag: "div", cls: "ag-measurement-container" });
          this.eRootDiv.appendChild(container2);
        }
        return container2;
      }
      getSizeEl(variable) {
        let sizeEl = this.sizeEls.get(variable);
        if (sizeEl) {
          return sizeEl;
        }
        const container2 = this.getMeasurementContainer();
        sizeEl = _createElement({ tag: "div" });
        const { border, noWarn } = variable;
        if (border) {
          sizeEl.className = "ag-measurement-element-border";
          sizeEl.style.setProperty(
            "--ag-internal-measurement-border",
            `var(${variable.cssName}, solid ${NO_VALUE_SENTINEL}px)`
          );
        } else {
          sizeEl.style.width = `var(${variable.cssName}, ${NO_VALUE_SENTINEL}px)`;
        }
        container2.appendChild(sizeEl);
        this.sizeEls.set(variable, sizeEl);
        let lastMeasurement = this.measureSizeEl(variable);
        if (lastMeasurement === "no-styles" && !noWarn) {
          _warn(9, { variable });
        }
        const unsubscribe = _observeResize(this.beans, sizeEl, () => {
          const newMeasurement = this.measureSizeEl(variable);
          if (newMeasurement === "detached" || newMeasurement === "no-styles") {
            return;
          }
          this.lastKnownValues.set(variable, newMeasurement);
          if (newMeasurement !== lastMeasurement) {
            lastMeasurement = newMeasurement;
            this.fireStylesChangedEvent(variable.changeKey);
          }
        });
        this.addDestroyFunc(() => unsubscribe());
        return sizeEl;
      }
      fireStylesChangedEvent(change) {
        if (change === "rowBorderWidthChanged") {
          this.refreshRowBorderWidthVariable();
        }
        this.eventSvc.dispatchEvent({
          type: "gridStylesChanged",
          [change]: true
        });
      }
      refreshRowBorderWidthVariable() {
        const width = this.getCSSVariablePixelValue(ROW_BORDER_WIDTH);
        this.eRootDiv.style.setProperty("--ag-internal-row-border-width", `${width}px`);
      }
      postProcessThemeChange(newGridTheme, themeGridOption) {
        if (newGridTheme && getComputedStyle(this.getMeasurementContainer()).getPropertyValue("--ag-legacy-styles-loaded")) {
          if (themeGridOption) {
            _error(106);
          } else {
            _error(239);
          }
        }
      }
      getAdditionalCss() {
        const additionalCss = /* @__PURE__ */ new Map();
        additionalCss.set("core", [coreCSS]);
        _addAdditionalCss(additionalCss, Array.from(_getAllRegisteredModules()));
        return additionalCss;
      }
      getDefaultTheme() {
        return themeQuartz;
      }
      themeError(theme2) {
        _error(240, { theme: theme2 });
      }
    };
    var NO_VALUE_SENTINEL = 15538;
    var EventService = class extends BaseEventService {
      postConstruct() {
        const { globalListener, globalSyncListener } = this.beans;
        if (globalListener) {
          this.addGlobalListener(globalListener, true);
        }
        if (globalSyncListener) {
          this.addGlobalListener(globalSyncListener, false);
        }
      }
    };
    function getHeaderIndexToFocus(beans, column2, level) {
      const columnRowIndex = beans.visibleCols.headerGroupRowCount;
      if (level >= columnRowIndex) {
        return {
          column: column2,
          headerRowIndex: level
        };
      }
      let parent = column2.getParent();
      while (parent && parent.getProvidedColumnGroup().getLevel() > level) {
        parent = parent.getParent();
      }
      const isColSpanning = column2.isSpanHeaderHeight();
      if (!parent || isColSpanning && parent.isPadding()) {
        return {
          column: column2,
          headerRowIndex: columnRowIndex
        };
      }
      return {
        column: parent,
        headerRowIndex: parent.getProvidedColumnGroup().getLevel()
      };
    }
    var HeaderNavigationService = class extends BeanStub {
      constructor() {
        super(...arguments);
        this.beanName = "headerNavigation";
        this.currentHeaderRowWithoutSpan = -1;
      }
      postConstruct() {
        const beans = this.beans;
        beans.ctrlsSvc.whenReady(this, (p) => {
          this.gridBodyCon = p.gridBodyCtrl;
        });
        const eDocument = _getDocument(beans);
        this.addManagedElementListeners(eDocument, {
          mousedown: () => {
            this.currentHeaderRowWithoutSpan = -1;
          }
        });
      }
      getHeaderPositionForColumn(colKey, floatingFilter) {
        let column2;
        const { colModel, colGroupSvc, ctrlsSvc } = this.beans;
        if (typeof colKey === "string") {
          column2 = colModel.getCol(colKey);
          if (!column2) {
            column2 = colGroupSvc?.getColumnGroup(colKey) ?? null;
          }
        } else {
          column2 = colKey;
        }
        if (!column2) {
          return null;
        }
        const centerHeaderContainer = ctrlsSvc.getHeaderRowContainerCtrl();
        const allCtrls = centerHeaderContainer?.getAllCtrls();
        const isFloatingFilterVisible = _last(allCtrls || []).type === "filter";
        const headerRowCount = getFocusHeaderRowCount(this.beans) - 1;
        let row2 = -1;
        let col = column2;
        while (col) {
          row2++;
          col = col.getParent();
        }
        let headerRowIndex = row2;
        if (floatingFilter && isFloatingFilterVisible && headerRowIndex === headerRowCount - 1) {
          headerRowIndex++;
        }
        return headerRowIndex === -1 ? null : {
          headerRowIndex,
          column: column2
        };
      }
      /*
       * This method navigates grid header vertically
       * @return {boolean} true to preventDefault on the event that caused this navigation.
       */
      navigateVertically(direction, event) {
        const { focusSvc, visibleCols } = this.beans;
        const { focusedHeader } = focusSvc;
        if (!focusedHeader) {
          return false;
        }
        const { headerRowIndex } = focusedHeader;
        const column2 = focusedHeader.column;
        const rowLen = getFocusHeaderRowCount(this.beans);
        const currentRowType = this.getHeaderRowType(headerRowIndex);
        const columnHeaderRowIndex = visibleCols.headerGroupRowCount;
        let {
          headerRowIndex: nextRow,
          column: nextFocusColumn,
          headerRowIndexWithoutSpan
        } = direction === "UP" ? getColumnVisibleParent(currentRowType, column2, headerRowIndex) : getColumnVisibleChild(column2, headerRowIndex, columnHeaderRowIndex);
        let skipColumn = false;
        if (nextRow < 0) {
          nextRow = 0;
          nextFocusColumn = column2;
          skipColumn = true;
        }
        if (nextRow >= rowLen) {
          nextRow = -1;
          this.currentHeaderRowWithoutSpan = -1;
        } else if (headerRowIndexWithoutSpan !== void 0) {
          this.currentHeaderRowWithoutSpan = headerRowIndexWithoutSpan;
        }
        if (!skipColumn && !nextFocusColumn) {
          return false;
        }
        return focusSvc.focusHeaderPosition({
          headerPosition: { headerRowIndex: nextRow, column: nextFocusColumn },
          allowUserOverride: true,
          event
        });
      }
      /*
       * This method navigates grid header horizontally
       * @returns {boolean} true to preventDefault on the event that caused this navigation.
       */
      navigateHorizontally(direction, fromTab = false, event) {
        const { focusSvc, gos } = this.beans;
        const focusedHeader = { ...focusSvc.focusedHeader };
        let nextHeader;
        let normalisedDirection;
        if (this.currentHeaderRowWithoutSpan !== -1) {
          focusedHeader.headerRowIndex = this.currentHeaderRowWithoutSpan;
        } else {
          this.currentHeaderRowWithoutSpan = focusedHeader.headerRowIndex;
        }
        if (direction === "LEFT" !== gos.get("enableRtl")) {
          normalisedDirection = "Before";
          nextHeader = this.findHeader(focusedHeader, normalisedDirection);
        } else {
          normalisedDirection = "After";
          nextHeader = this.findHeader(focusedHeader, normalisedDirection);
        }
        const userFunc = gos.getCallback("tabToNextHeader");
        if (fromTab && userFunc) {
          const wasFocusedFromUserFunc = focusSvc.focusHeaderPositionFromUserFunc({
            userFunc,
            headerPosition: nextHeader,
            direction: normalisedDirection
          });
          if (wasFocusedFromUserFunc) {
            const { headerRowIndex } = focusSvc.focusedHeader || {};
            if (headerRowIndex != null && headerRowIndex != focusedHeader.headerRowIndex) {
              this.currentHeaderRowWithoutSpan = headerRowIndex;
            }
          }
          return wasFocusedFromUserFunc;
        }
        if (nextHeader || !fromTab) {
          return focusSvc.focusHeaderPosition({
            headerPosition: nextHeader,
            direction: normalisedDirection,
            fromTab,
            allowUserOverride: true,
            event
          });
        }
        return this.focusNextHeaderRow(focusedHeader, normalisedDirection, event);
      }
      focusNextHeaderRow(focusedHeader, direction, event) {
        const beans = this.beans;
        const currentIndex = focusedHeader.headerRowIndex;
        let nextFocusedCol = null;
        let nextRowIndex;
        const headerRowCount = getFocusHeaderRowCount(beans);
        const allVisibleCols = this.beans.visibleCols.allCols;
        if (direction === "Before") {
          if (currentIndex <= 0) {
            return false;
          }
          nextFocusedCol = _last(allVisibleCols);
          nextRowIndex = currentIndex - 1;
          this.currentHeaderRowWithoutSpan -= 1;
        } else {
          nextFocusedCol = allVisibleCols[0];
          nextRowIndex = currentIndex + 1;
          if (this.currentHeaderRowWithoutSpan < headerRowCount) {
            this.currentHeaderRowWithoutSpan += 1;
          } else {
            this.currentHeaderRowWithoutSpan = -1;
          }
        }
        let { column: column2, headerRowIndex } = getHeaderIndexToFocus(this.beans, nextFocusedCol, nextRowIndex);
        if (headerRowIndex >= headerRowCount) {
          headerRowIndex = -1;
        }
        return beans.focusSvc.focusHeaderPosition({
          headerPosition: { column: column2, headerRowIndex },
          direction,
          fromTab: true,
          allowUserOverride: true,
          event
        });
      }
      scrollToColumn(column2, direction = "After") {
        if (column2.getPinned()) {
          return;
        }
        let columnToScrollTo;
        if (isColumnGroup(column2)) {
          const columns = column2.getDisplayedLeafColumns();
          columnToScrollTo = direction === "Before" ? _last(columns) : columns[0];
        } else {
          columnToScrollTo = column2;
        }
        this.gridBodyCon.scrollFeature.ensureColumnVisible(columnToScrollTo);
      }
      findHeader(focusedHeader, direction) {
        const { colGroupSvc, visibleCols } = this.beans;
        let currentFocusedColumn = focusedHeader.column;
        if (currentFocusedColumn instanceof AgColumnGroup) {
          const leafChildren = currentFocusedColumn.getDisplayedLeafColumns();
          currentFocusedColumn = direction === "Before" ? leafChildren[0] : leafChildren[leafChildren.length - 1];
        }
        const nextFocusedCol = direction === "Before" ? visibleCols.getColBefore(currentFocusedColumn) : visibleCols.getColAfter(currentFocusedColumn);
        if (!nextFocusedCol) {
          return void 0;
        }
        const headerGroupRowIndex = visibleCols.headerGroupRowCount;
        if (focusedHeader.headerRowIndex >= headerGroupRowIndex) {
          return {
            headerRowIndex: focusedHeader.headerRowIndex,
            column: nextFocusedCol
          };
        }
        const groupAtLevel = colGroupSvc?.getColGroupAtLevel(nextFocusedCol, focusedHeader.headerRowIndex);
        if (!groupAtLevel) {
          const isSpanningCol = nextFocusedCol instanceof AgColumn && nextFocusedCol.isSpanHeaderHeight();
          return {
            headerRowIndex: isSpanningCol ? visibleCols.headerGroupRowCount : focusedHeader.headerRowIndex,
            column: nextFocusedCol
          };
        }
        if (groupAtLevel.isPadding() && nextFocusedCol.isSpanHeaderHeight()) {
          return {
            headerRowIndex: visibleCols.headerGroupRowCount,
            column: nextFocusedCol
          };
        }
        return {
          headerRowIndex: focusedHeader.headerRowIndex,
          column: groupAtLevel ?? nextFocusedCol
        };
      }
      getHeaderRowType(rowIndex) {
        const centerHeaderContainer = this.beans.ctrlsSvc.getHeaderRowContainerCtrl();
        if (centerHeaderContainer) {
          return centerHeaderContainer.getRowType(rowIndex);
        }
      }
    };
    function getColumnVisibleParent(currentRowType, currentColumn, currentIndex) {
      const optimisticNextIndex = currentIndex - 1;
      if (currentRowType !== "filter") {
        const isSpanningCol = currentColumn instanceof AgColumn && currentColumn.isSpanHeaderHeight();
        let nextVisibleParent = currentColumn.getParent();
        while (nextVisibleParent && // skip if row isn't visible or col is padding and spanned
        (nextVisibleParent.getProvidedColumnGroup().getLevel() > optimisticNextIndex || isSpanningCol && nextVisibleParent.isPadding())) {
          nextVisibleParent = nextVisibleParent.getParent();
        }
        if (nextVisibleParent) {
          if (isSpanningCol) {
            return {
              column: nextVisibleParent,
              headerRowIndex: nextVisibleParent.getProvidedColumnGroup().getLevel(),
              headerRowIndexWithoutSpan: optimisticNextIndex
            };
          } else {
            return {
              column: nextVisibleParent,
              headerRowIndex: optimisticNextIndex,
              headerRowIndexWithoutSpan: optimisticNextIndex
            };
          }
        }
      }
      return {
        column: currentColumn,
        headerRowIndex: optimisticNextIndex,
        headerRowIndexWithoutSpan: optimisticNextIndex
      };
    }
    function getColumnVisibleChild(column2, currentIndex, columnHeaderRowIndex) {
      const optimisticNextIndex = currentIndex + 1;
      const result2 = {
        column: column2,
        headerRowIndex: optimisticNextIndex,
        headerRowIndexWithoutSpan: optimisticNextIndex
      };
      if (column2 instanceof AgColumnGroup) {
        if (optimisticNextIndex >= columnHeaderRowIndex) {
          return {
            column: column2.getDisplayedLeafColumns()[0],
            headerRowIndex: columnHeaderRowIndex,
            headerRowIndexWithoutSpan: optimisticNextIndex
          };
        }
        const children2 = column2.getDisplayedChildren();
        let firstChild = children2[0];
        if (firstChild instanceof AgColumnGroup && firstChild.isPadding()) {
          const firstCol = firstChild.getDisplayedLeafColumns()[0];
          if (firstCol.isSpanHeaderHeight()) {
            firstChild = firstCol;
          }
        }
        result2.column = firstChild;
        const isSpanningCol = firstChild instanceof AgColumn && firstChild.isSpanHeaderHeight();
        if (isSpanningCol) {
          result2.headerRowIndex = columnHeaderRowIndex;
          result2.headerRowIndexWithoutSpan = optimisticNextIndex;
        }
      }
      return result2;
    }
    var FocusService = class extends BeanStub {
      constructor() {
        super(...arguments);
        this.beanName = "focusSvc";
        this.focusFallbackTimeout = null;
        this.needsFocusRestored = false;
      }
      wireBeans(beans) {
        this.colModel = beans.colModel;
        this.visibleCols = beans.visibleCols;
        this.rowRenderer = beans.rowRenderer;
        this.navigation = beans.navigation;
        this.filterManager = beans.filterManager;
        this.overlays = beans.overlays;
      }
      postConstruct() {
        const clearFocusedCellListener = this.clearFocusedCell.bind(this);
        this.addManagedEventListeners({
          columnPivotModeChanged: clearFocusedCellListener,
          newColumnsLoaded: this.onColumnEverythingChanged.bind(this),
          columnGroupOpened: clearFocusedCellListener,
          columnRowGroupChanged: clearFocusedCellListener
        });
        this.addDestroyFunc(_registerKeyboardFocusEvents(this.beans));
      }
      attemptToRecoverFocus() {
        this.needsFocusRestored = true;
        if (this.focusFallbackTimeout != null) {
          clearTimeout(this.focusFallbackTimeout);
        }
        this.focusFallbackTimeout = window.setTimeout(this.setFocusRecovered.bind(this), 100);
      }
      setFocusRecovered() {
        this.needsFocusRestored = false;
        if (this.focusFallbackTimeout != null) {
          clearTimeout(this.focusFallbackTimeout);
          this.focusFallbackTimeout = null;
        }
      }
      /**
       * Specifies whether to take focus, as grid either already has focus, or lost it due
       * to a destroyed cell
       * @returns true if the grid should re-take focus, otherwise false
       */
      shouldTakeFocus() {
        if (this.gos.get("suppressFocusAfterRefresh")) {
          this.setFocusRecovered();
          return false;
        }
        if (this.needsFocusRestored) {
          this.setFocusRecovered();
          return true;
        }
        return this.doesRowOrCellHaveBrowserFocus();
      }
      onColumnEverythingChanged() {
        if (!this.focusedCell) {
          return;
        }
        const col = this.focusedCell.column;
        const colFromColumnModel = this.colModel.getCol(col.getId());
        if (col !== colFromColumnModel) {
          this.clearFocusedCell();
        }
      }
      // we check if the browser is focusing something, and if it is, and
      // it's the cell we think is focused, then return the cell. so this
      // methods returns the cell if a) we think it has focus and b) the
      // browser thinks it has focus. this then returns nothing if we
      // first focus a cell, then second click outside the grid, as then the
      // grid cell will still be focused as far as the grid is concerned,
      // however the browser focus will have moved somewhere else.
      getFocusCellToUseAfterRefresh() {
        const { gos, focusedCell } = this;
        if (gos.get("suppressFocusAfterRefresh") || gos.get("suppressCellFocus") || !focusedCell) {
          return null;
        }
        if (!this.doesRowOrCellHaveBrowserFocus()) {
          return null;
        }
        return focusedCell;
      }
      getFocusHeaderToUseAfterRefresh() {
        if (this.gos.get("suppressFocusAfterRefresh") || !this.focusedHeader) {
          return null;
        }
        if (!this.isDomDataPresentInHierarchy(_getActiveDomElement(this.beans), DOM_DATA_KEY_HEADER_CTRL)) {
          return null;
        }
        return this.focusedHeader;
      }
      /**
       * Check for both cells and rows, as a row might be destroyed and the dom data removed before the cell if the
       * row is animating out.
       */
      doesRowOrCellHaveBrowserFocus() {
        const activeElement = _getActiveDomElement(this.beans);
        if (this.isDomDataPresentInHierarchy(activeElement, DOM_DATA_KEY_CELL_CTRL)) {
          return true;
        }
        return this.isDomDataPresentInHierarchy(activeElement, DOM_DATA_KEY_ROW_CTRL);
      }
      isDomDataPresentInHierarchy(eBrowserCell, key2) {
        let ePointer = eBrowserCell;
        while (ePointer) {
          const data = _getDomData(this.gos, ePointer, key2);
          if (data) {
            return true;
          }
          ePointer = ePointer.parentNode;
        }
        return false;
      }
      getFocusedCell() {
        return this.focusedCell;
      }
      getFocusEventParams(focusedCellPosition) {
        const { rowIndex, rowPinned, column: column2 } = focusedCellPosition;
        const params = {
          rowIndex,
          rowPinned,
          column: column2,
          isFullWidthCell: false
        };
        const rowCtrl = this.rowRenderer.getRowByPosition({ rowIndex, rowPinned });
        if (rowCtrl) {
          params.isFullWidthCell = rowCtrl.isFullWidth();
        }
        return params;
      }
      clearFocusedCell() {
        if (this.focusedCell == null) {
          return;
        }
        const focusEventParams = this.getFocusEventParams(this.focusedCell);
        this.focusedCell = null;
        this.eventSvc.dispatchEvent({
          type: "cellFocusCleared",
          ...focusEventParams
        });
      }
      setFocusedCell(params) {
        this.setFocusRecovered();
        const {
          column: column2,
          rowIndex,
          rowPinned,
          forceBrowserFocus = false,
          preventScrollOnBrowserFocus = false,
          sourceEvent
        } = params;
        const gridColumn = this.colModel.getCol(column2);
        if (!gridColumn) {
          this.focusedCell = null;
          return;
        }
        this.focusedCell = {
          rowIndex,
          rowPinned: _makeNull(rowPinned),
          column: gridColumn
        };
        const focusEventParams = this.getFocusEventParams(this.focusedCell);
        this.eventSvc.dispatchEvent({
          type: "cellFocused",
          ...focusEventParams,
          ...this.previousCellFocusParams && { previousParams: this.previousCellFocusParams },
          forceBrowserFocus,
          preventScrollOnBrowserFocus,
          sourceEvent
        });
        this.previousCellFocusParams = focusEventParams;
      }
      isCellFocused(cellPosition) {
        if (this.focusedCell == null) {
          return false;
        }
        return _areCellsEqual(cellPosition, this.focusedCell);
      }
      isHeaderWrapperFocused(headerCtrl) {
        if (this.focusedHeader == null) {
          return false;
        }
        const {
          column: column2,
          rowCtrl: { rowIndex: headerRowIndex, pinned }
        } = headerCtrl;
        const { column: focusedColumn, headerRowIndex: focusedHeaderRowIndex } = this.focusedHeader;
        return column2 === focusedColumn && headerRowIndex === focusedHeaderRowIndex && pinned == focusedColumn.getPinned();
      }
      focusHeaderPosition(params) {
        this.setFocusRecovered();
        if (_isHeaderFocusSuppressed(this.beans)) {
          return false;
        }
        const { direction, fromTab, allowUserOverride, event, fromCell, rowWithoutSpanValue, scroll = true } = params;
        let { headerPosition } = params;
        if (fromCell && this.filterManager?.isAdvFilterHeaderActive()) {
          return this.focusAdvancedFilter(headerPosition);
        }
        if (allowUserOverride) {
          const currentPosition = this.focusedHeader;
          const headerRowCount = getFocusHeaderRowCount(this.beans);
          if (fromTab) {
            const userFunc = this.gos.getCallback("tabToNextHeader");
            if (userFunc) {
              headerPosition = this.getHeaderPositionFromUserFunc({
                userFunc,
                direction,
                currentPosition,
                headerPosition,
                headerRowCount
              });
            }
          } else {
            const userFunc = this.gos.getCallback("navigateToNextHeader");
            if (userFunc && event) {
              const params2 = {
                key: event.key,
                previousHeaderPosition: currentPosition,
                nextHeaderPosition: headerPosition,
                headerRowCount,
                event
              };
              headerPosition = userFunc(params2);
            }
          }
        }
        if (!headerPosition) {
          return false;
        }
        return this.focusProvidedHeaderPosition({
          headerPosition,
          direction,
          event,
          fromCell,
          rowWithoutSpanValue,
          scroll
        });
      }
      focusHeaderPositionFromUserFunc(params) {
        if (_isHeaderFocusSuppressed(this.beans)) {
          return false;
        }
        const { userFunc, headerPosition, direction, event } = params;
        const currentPosition = this.focusedHeader;
        const headerRowCount = getFocusHeaderRowCount(this.beans);
        const newHeaderPosition = this.getHeaderPositionFromUserFunc({
          userFunc,
          direction,
          currentPosition,
          headerPosition,
          headerRowCount
        });
        return !!newHeaderPosition && this.focusProvidedHeaderPosition({
          headerPosition: newHeaderPosition,
          direction,
          event
        });
      }
      getHeaderPositionFromUserFunc(params) {
        const { userFunc, direction, currentPosition, headerPosition, headerRowCount } = params;
        const userFuncParams = {
          backwards: direction === "Before",
          previousHeaderPosition: currentPosition,
          nextHeaderPosition: headerPosition,
          headerRowCount
        };
        const userResult = userFunc(userFuncParams);
        if (userResult === true) {
          return currentPosition;
        }
        if (userResult === false) {
          return null;
        }
        return userResult;
      }
      focusProvidedHeaderPosition(params) {
        const { headerPosition, direction, fromCell, rowWithoutSpanValue, event, scroll = true } = params;
        const { column: column2, headerRowIndex } = headerPosition;
        const { filterManager, ctrlsSvc, headerNavigation } = this.beans;
        if (this.focusedHeader && isHeaderPositionEqual(params.headerPosition, this.focusedHeader)) {
          return false;
        }
        if (headerRowIndex === -1) {
          if (filterManager?.isAdvFilterHeaderActive()) {
            return this.focusAdvancedFilter(headerPosition);
          }
          return this.focusGridView({ column: column2, event });
        }
        if (scroll) {
          headerNavigation?.scrollToColumn(column2, direction);
        }
        const headerRowContainerCtrl = ctrlsSvc.getHeaderRowContainerCtrl(column2.getPinned());
        const focusSuccess = headerRowContainerCtrl?.focusHeader(headerPosition.headerRowIndex, column2, event) || false;
        if (headerNavigation && focusSuccess && (rowWithoutSpanValue != null || fromCell)) {
          headerNavigation.currentHeaderRowWithoutSpan = rowWithoutSpanValue ?? -1;
        }
        return focusSuccess;
      }
      focusFirstHeader() {
        if (this.overlays?.isExclusive() && this.focusOverlay()) {
          return true;
        }
        const firstColumn = this.visibleCols.allCols[0];
        if (!firstColumn) {
          return false;
        }
        const headerPosition = getHeaderIndexToFocus(this.beans, firstColumn, 0);
        return this.focusHeaderPosition({
          headerPosition,
          rowWithoutSpanValue: 0
        });
      }
      focusLastHeader(event) {
        if (this.overlays?.isExclusive() && this.focusOverlay(true)) {
          return true;
        }
        const headerRowIndex = getFocusHeaderRowCount(this.beans) - 1;
        const column2 = _last(this.visibleCols.allCols);
        return this.focusHeaderPosition({
          headerPosition: { headerRowIndex, column: column2 },
          rowWithoutSpanValue: -1,
          event
        });
      }
      focusPreviousFromFirstCell(event) {
        if (this.filterManager?.isAdvFilterHeaderActive()) {
          return this.focusAdvancedFilter(null);
        }
        return this.focusLastHeader(event);
      }
      isAnyCellFocused() {
        return !!this.focusedCell;
      }
      isRowFocused(rowIndex, rowPinnedType) {
        if (this.focusedCell == null) {
          return false;
        }
        return this.focusedCell.rowIndex === rowIndex && this.focusedCell.rowPinned === _makeNull(rowPinnedType);
      }
      focusOverlay(backwards) {
        const overlayGui = this.overlays?.isVisible() && this.overlays.eWrapper?.getGui();
        return !!overlayGui && _focusInto(overlayGui, backwards);
      }
      focusGridView(params) {
        const { backwards = false, canFocusOverlay = true, event } = params;
        if (this.overlays?.isExclusive()) {
          return canFocusOverlay && this.focusOverlay(backwards);
        }
        if (_isCellFocusSuppressed(this.beans)) {
          if (backwards) {
            if (!_isHeaderFocusSuppressed(this.beans)) {
              return this.focusLastHeader();
            }
          }
          if (canFocusOverlay && this.focusOverlay(backwards)) {
            return true;
          }
          if (backwards) {
            return false;
          }
          return _focusNextGridCoreContainer(this.beans, backwards);
        }
        const nextRow = backwards ? _getLastRow(this.beans) : _getFirstRow(this.beans);
        if (nextRow) {
          const column2 = params.column ?? this.focusedHeader?.column;
          const { rowIndex, rowPinned } = nextRow;
          const rowNode = _getRowNode(this.beans, nextRow);
          if (!column2 || !rowNode || rowIndex == null) {
            return false;
          }
          if (column2.isSuppressNavigable(rowNode)) {
            const isRtl = this.gos.get("enableRtl");
            let key2;
            if (!event || event.key === KeyCode.TAB) {
              key2 = isRtl ? KeyCode.LEFT : KeyCode.RIGHT;
            } else {
              key2 = event.key;
            }
            this.beans.navigation?.navigateToNextCell(
              null,
              key2,
              { rowIndex, column: column2, rowPinned: rowPinned || null },
              true
            );
            return true;
          }
          this.navigation?.ensureCellVisible({ rowIndex, column: column2, rowPinned });
          if (backwards) {
            const rowCtrl = this.rowRenderer.getRowByPosition(nextRow);
            if (rowCtrl?.isFullWidth() && this.navigation?.tryToFocusFullWidthRow(nextRow, backwards)) {
              return true;
            }
          }
          this.setFocusedCell({
            rowIndex,
            column: column2,
            rowPinned: _makeNull(rowPinned),
            forceBrowserFocus: true
          });
          this.beans.rangeSvc?.setRangeToCell({ rowIndex, rowPinned, column: column2 });
          return true;
        }
        if (canFocusOverlay && this.focusOverlay(backwards)) {
          return true;
        }
        if (backwards && this.focusLastHeader()) {
          return true;
        }
        return false;
      }
      focusAdvancedFilter(position) {
        this.advFilterFocusColumn = position?.column;
        return this.beans.advancedFilter?.getCtrl().focusHeaderComp() ?? false;
      }
      focusNextFromAdvancedFilter(backwards, forceFirstColumn) {
        const column2 = (forceFirstColumn ? void 0 : this.advFilterFocusColumn) ?? this.visibleCols.allCols?.[0];
        if (backwards) {
          return this.focusHeaderPosition({
            headerPosition: {
              column: column2,
              headerRowIndex: getFocusHeaderRowCount(this.beans) - 1
            }
          });
        } else {
          return this.focusGridView({ column: column2 });
        }
      }
      clearAdvancedFilterColumn() {
        this.advFilterFocusColumn = void 0;
      }
    };
    var ScrollVisibleService = class extends BeanStub {
      constructor() {
        super(...arguments);
        this.beanName = "scrollVisibleSvc";
      }
      wireBeans(beans) {
        this.ctrlsSvc = beans.ctrlsSvc;
        this.colAnimation = beans.colAnimation;
      }
      postConstruct() {
        this.horizontalScrollShowing = this.gos.get("alwaysShowHorizontalScroll") === true;
        this.verticalScrollShowing = this.gos.get("alwaysShowVerticalScroll") === true;
        this.getScrollbarWidth();
        this.addManagedEventListeners({
          displayedColumnsChanged: this.updateScrollVisible.bind(this),
          displayedColumnsWidthChanged: this.updateScrollVisible.bind(this)
        });
      }
      updateScrollVisible() {
        const { colAnimation } = this;
        if (colAnimation?.isActive()) {
          colAnimation.executeLaterVMTurn(() => {
            colAnimation.executeLaterVMTurn(() => this.updateScrollVisibleImpl());
          });
        } else {
          this.updateScrollVisibleImpl();
        }
      }
      updateScrollVisibleImpl() {
        const centerRowCtrl = this.ctrlsSvc.get("center");
        if (!centerRowCtrl || this.colAnimation?.isActive()) {
          return;
        }
        const params = {
          horizontalScrollShowing: centerRowCtrl.isHorizontalScrollShowing(),
          verticalScrollShowing: this.verticalScrollShowing
        };
        this.setScrollsVisible(params);
        this.updateScrollGap();
      }
      updateScrollGap() {
        const centerRowCtrl = this.ctrlsSvc.get("center");
        const horizontalGap = centerRowCtrl.hasHorizontalScrollGap();
        const verticalGap = centerRowCtrl.hasVerticalScrollGap();
        const atLeastOneDifferent = this.horizontalScrollGap !== horizontalGap || this.verticalScrollGap !== verticalGap;
        if (atLeastOneDifferent) {
          this.horizontalScrollGap = horizontalGap;
          this.verticalScrollGap = verticalGap;
          this.eventSvc.dispatchEvent({
            type: "scrollGapChanged"
          });
        }
      }
      setScrollsVisible(params) {
        const atLeastOneDifferent = this.horizontalScrollShowing !== params.horizontalScrollShowing || this.verticalScrollShowing !== params.verticalScrollShowing;
        if (atLeastOneDifferent) {
          this.horizontalScrollShowing = params.horizontalScrollShowing;
          this.verticalScrollShowing = params.verticalScrollShowing;
          this.eventSvc.dispatchEvent({
            type: "scrollVisibilityChanged"
          });
        }
      }
      // the user might be using some non-standard scrollbar, eg a scrollbar that has zero
      // width and overlays (like the Safari scrollbar, but presented in Chrome). so we
      // allow the user to provide the scroll width before we work it out.
      getScrollbarWidth() {
        if (this.scrollbarWidth == null) {
          const gridOptionsScrollbarWidth = this.gos.get("scrollbarWidth");
          const useGridOptions = typeof gridOptionsScrollbarWidth === "number" && gridOptionsScrollbarWidth >= 0;
          const scrollbarWidth = useGridOptions ? gridOptionsScrollbarWidth : _getScrollbarWidth();
          if (scrollbarWidth != null) {
            this.scrollbarWidth = scrollbarWidth;
            this.eventSvc.dispatchEvent({
              type: "scrollbarWidthChanged"
            });
          }
        }
        return this.scrollbarWidth;
      }
    };
    var GridDestroyService = class extends BeanStub {
      constructor() {
        super(...arguments);
        this.beanName = "gridDestroySvc";
        this.destroyCalled = false;
      }
      destroy() {
        if (this.destroyCalled) {
          return;
        }
        const { stateSvc, ctrlsSvc, context } = this.beans;
        this.eventSvc.dispatchEvent({
          type: "gridPreDestroyed",
          state: stateSvc?.getState() ?? {}
        });
        this.destroyCalled = true;
        ctrlsSvc.get("gridCtrl")?.destroyGridUi();
        context.destroy();
        super.destroy();
      }
    };
    var ALWAYS_SYNC_GLOBAL_EVENTS = /* @__PURE__ */ new Set(["gridPreDestroyed", "fillStart", "pasteStart"]);
    var _PUBLIC_EVENTS = [
      "columnEverythingChanged",
      "newColumnsLoaded",
      "columnPivotModeChanged",
      "pivotMaxColumnsExceeded",
      "columnRowGroupChanged",
      "expandOrCollapseAll",
      "columnPivotChanged",
      "gridColumnsChanged",
      "columnValueChanged",
      "columnMoved",
      "columnVisible",
      "columnPinned",
      "columnGroupOpened",
      "columnResized",
      "displayedColumnsChanged",
      "virtualColumnsChanged",
      "columnHeaderMouseOver",
      "columnHeaderMouseLeave",
      "columnHeaderClicked",
      "columnHeaderContextMenu",
      "asyncTransactionsFlushed",
      "rowGroupOpened",
      "rowDataUpdated",
      "pinnedRowDataChanged",
      "pinnedRowsChanged",
      "rangeSelectionChanged",
      "cellSelectionChanged",
      "chartCreated",
      "chartRangeSelectionChanged",
      "chartOptionsChanged",
      "chartDestroyed",
      "toolPanelVisibleChanged",
      "toolPanelSizeChanged",
      "modelUpdated",
      "cutStart",
      "cutEnd",
      "pasteStart",
      "pasteEnd",
      "fillStart",
      "fillEnd",
      "cellSelectionDeleteStart",
      "cellSelectionDeleteEnd",
      "rangeDeleteStart",
      "rangeDeleteEnd",
      "undoStarted",
      "undoEnded",
      "redoStarted",
      "redoEnded",
      "cellClicked",
      "cellDoubleClicked",
      "cellMouseDown",
      "cellContextMenu",
      "cellValueChanged",
      "cellEditRequest",
      "rowValueChanged",
      "headerFocused",
      "cellFocused",
      "rowSelected",
      "selectionChanged",
      "tooltipShow",
      "tooltipHide",
      "cellKeyDown",
      "cellMouseOver",
      "cellMouseOut",
      "filterChanged",
      "filterModified",
      "filterUiChanged",
      "filterOpened",
      "floatingFilterUiChanged",
      "advancedFilterBuilderVisibleChanged",
      "sortChanged",
      "virtualRowRemoved",
      "rowClicked",
      "rowDoubleClicked",
      "gridReady",
      "gridPreDestroyed",
      "gridSizeChanged",
      "viewportChanged",
      "firstDataRendered",
      "dragStarted",
      "dragStopped",
      "dragCancelled",
      "rowEditingStarted",
      "rowEditingStopped",
      "cellEditingStarted",
      "cellEditingStopped",
      "bodyScroll",
      "bodyScrollEnd",
      "paginationChanged",
      "componentStateChanged",
      "storeRefreshed",
      "stateUpdated",
      "columnMenuVisibleChanged",
      "contextMenuVisibleChanged",
      "rowDragEnter",
      "rowDragMove",
      "rowDragLeave",
      "rowDragEnd",
      "rowDragCancel",
      "findChanged",
      "rowResizeStarted",
      "rowResizeEnded",
      "columnsReset",
      "bulkEditingStarted",
      "bulkEditingStopped",
      "batchEditingStarted",
      "batchEditingStopped"
    ];
    var _PUBLIC_EVENT_HANDLERS_MAP = _PUBLIC_EVENTS.reduce(
      (mem, ev) => {
        mem[ev] = _getCallbackForEvent(ev);
        return mem;
      },
      {}
    );
    var makeIconParams = (dataRefSuffix, classSuffix) => ({
      tag: "span",
      ref: `eSort${dataRefSuffix}`,
      cls: `ag-sort-indicator-icon ag-sort-${classSuffix} ag-hidden`,
      attrs: { "aria-hidden": "true" }
    });
    var SortIndicatorElement = {
      tag: "span",
      cls: "ag-sort-indicator-container",
      children: [
        makeIconParams("Order", "order"),
        makeIconParams("Asc", "ascending-icon"),
        makeIconParams("Desc", "descending-icon"),
        makeIconParams("Mixed", "mixed-icon"),
        makeIconParams("None", "none-icon")
      ]
    };
    var SortIndicatorComp = class extends Component {
      constructor(skipTemplate) {
        super();
        this.eSortOrder = RefPlaceholder;
        this.eSortAsc = RefPlaceholder;
        this.eSortDesc = RefPlaceholder;
        this.eSortMixed = RefPlaceholder;
        this.eSortNone = RefPlaceholder;
        if (!skipTemplate) {
          this.setTemplate(SortIndicatorElement);
        }
      }
      attachCustomElements(eSortOrder, eSortAsc, eSortDesc, eSortMixed, eSortNone) {
        this.eSortOrder = eSortOrder;
        this.eSortAsc = eSortAsc;
        this.eSortDesc = eSortDesc;
        this.eSortMixed = eSortMixed;
        this.eSortNone = eSortNone;
      }
      setupSort(column2, suppressOrder = false) {
        this.column = column2;
        this.suppressOrder = suppressOrder;
        this.setupMultiSortIndicator();
        if (!column2.isSortable() && !column2.getColDef().showRowGroup) {
          return;
        }
        this.addInIcon("sortAscending", this.eSortAsc, column2);
        this.addInIcon("sortDescending", this.eSortDesc, column2);
        this.addInIcon("sortUnSort", this.eSortNone, column2);
        const updateIcons = this.updateIcons.bind(this);
        const sortUpdated = this.onSortChanged.bind(this);
        this.addManagedPropertyListener("unSortIcon", updateIcons);
        this.addManagedEventListeners({
          newColumnsLoaded: updateIcons,
          // Watch global events, as row group columns can effect their display column.
          sortChanged: sortUpdated,
          // when grouping changes so can sort indexes and icons
          columnRowGroupChanged: sortUpdated
        });
        this.onSortChanged();
      }
      addInIcon(iconName, eParent, column2) {
        if (eParent == null) {
          return;
        }
        const eIcon = _createIconNoSpan(iconName, this.beans, column2);
        if (eIcon) {
          eParent.appendChild(eIcon);
        }
      }
      onSortChanged() {
        this.updateIcons();
        if (!this.suppressOrder) {
          this.updateSortOrder();
        }
      }
      updateIcons() {
        const { eSortAsc, eSortDesc, eSortNone, column: column2, gos, beans } = this;
        const sortDirection = beans.sortSvc.getDisplaySortForColumn(column2);
        if (eSortAsc) {
          const isAscending = sortDirection === "asc";
          _setDisplayed(eSortAsc, isAscending, { skipAriaHidden: true });
        }
        if (eSortDesc) {
          const isDescending = sortDirection === "desc";
          _setDisplayed(eSortDesc, isDescending, { skipAriaHidden: true });
        }
        if (eSortNone) {
          const alwaysHideNoSort = !column2.getColDef().unSortIcon && !gos.get("unSortIcon");
          const isNone = sortDirection === null || sortDirection === void 0;
          _setDisplayed(eSortNone, !alwaysHideNoSort && isNone, { skipAriaHidden: true });
        }
      }
      setupMultiSortIndicator() {
        const { eSortMixed, column: column2, gos } = this;
        this.addInIcon("sortUnSort", eSortMixed, column2);
        const isColumnShowingRowGroup = column2.getColDef().showRowGroup;
        const areGroupsCoupled = _isColumnsSortingCoupledToGroup(gos);
        if (areGroupsCoupled && isColumnShowingRowGroup) {
          this.addManagedEventListeners({
            // Watch global events, as row group columns can effect their display column.
            sortChanged: this.updateMultiSortIndicator.bind(this),
            // when grouping changes so can sort indexes and icons
            columnRowGroupChanged: this.updateMultiSortIndicator.bind(this)
          });
          this.updateMultiSortIndicator();
        }
      }
      updateMultiSortIndicator() {
        const { eSortMixed, beans, column: column2 } = this;
        if (eSortMixed) {
          const isMixedSort = beans.sortSvc.getDisplaySortForColumn(column2) === "mixed";
          _setDisplayed(eSortMixed, isMixedSort, { skipAriaHidden: true });
        }
      }
      // we listen here for global sort events, NOT column sort events, as we want to do this
      // when sorting has been set on all column (if we listened just for our col (where we
      // set the asc / desc icons) then it's possible other cols are yet to get their sorting state.
      updateSortOrder() {
        const {
          eSortOrder,
          column: column2,
          beans: { sortSvc }
        } = this;
        if (!eSortOrder) {
          return;
        }
        const allColumnsWithSorting = sortSvc.getColumnsWithSortingOrdered();
        const indexThisCol = sortSvc.getDisplaySortIndexForColumn(column2) ?? -1;
        const moreThanOneColSorting = allColumnsWithSorting.some(
          (col) => sortSvc.getDisplaySortIndexForColumn(col) ?? -1 >= 1
        );
        const showIndex = indexThisCol >= 0 && moreThanOneColSorting;
        _setDisplayed(eSortOrder, showIndex, { skipAriaHidden: true });
        if (indexThisCol >= 0) {
          eSortOrder.textContent = (indexThisCol + 1).toString();
        } else {
          _clearElement(eSortOrder);
        }
      }
    };
    var SortIndicatorSelector = {
      selector: "AG-SORT-INDICATOR",
      component: SortIndicatorComp
    };
    var DEFAULT_SORTING_ORDER = ["asc", "desc", null];
    var SortService = class extends BeanStub {
      constructor() {
        super(...arguments);
        this.beanName = "sortSvc";
      }
      progressSort(column2, multiSort, source2) {
        const nextDirection = this.getNextSortDirection(column2);
        this.setSortForColumn(column2, nextDirection, multiSort, source2);
      }
      progressSortFromEvent(column2, event) {
        const sortUsingCtrl = this.gos.get("multiSortKey") === "ctrl";
        const multiSort = sortUsingCtrl ? event.ctrlKey || event.metaKey : event.shiftKey;
        this.progressSort(column2, multiSort, "uiColumnSorted");
      }
      setSortForColumn(column2, sort2, multiSort, source2) {
        if (sort2 !== "asc" && sort2 !== "desc") {
          sort2 = null;
        }
        const { gos, showRowGroupCols } = this.beans;
        const isColumnsSortingCoupledToGroup = _isColumnsSortingCoupledToGroup(gos);
        let columnsToUpdate = [column2];
        if (isColumnsSortingCoupledToGroup) {
          if (column2.getColDef().showRowGroup) {
            const rowGroupColumns = showRowGroupCols?.getSourceColumnsForGroupColumn?.(column2);
            const sortableRowGroupColumns = rowGroupColumns?.filter((col) => col.isSortable());
            if (sortableRowGroupColumns) {
              columnsToUpdate = [column2, ...sortableRowGroupColumns];
            }
          }
        }
        for (const col of columnsToUpdate) {
          this.setColSort(col, sort2, source2);
        }
        const doingMultiSort = (multiSort || gos.get("alwaysMultiSort")) && !gos.get("suppressMultiSort");
        const updatedColumns = [];
        if (!doingMultiSort) {
          const clearedColumns = this.clearSortBarTheseColumns(columnsToUpdate, source2);
          updatedColumns.push(...clearedColumns);
        }
        this.updateSortIndex(column2);
        updatedColumns.push(...columnsToUpdate);
        this.dispatchSortChangedEvents(source2, updatedColumns);
      }
      updateSortIndex(lastColToChange) {
        const { gos, colModel, showRowGroupCols } = this.beans;
        const isCoupled = _isColumnsSortingCoupledToGroup(gos);
        const groupParent = showRowGroupCols?.getShowRowGroupCol(lastColToChange.getId());
        const lastSortIndexCol = isCoupled ? groupParent || lastColToChange : lastColToChange;
        const allSortedCols = this.getColumnsWithSortingOrdered();
        colModel.forAllCols((col) => this.setColSortIndex(col, null));
        const allSortedColsWithoutChangesOrGroups = allSortedCols.filter((col) => {
          if (isCoupled && col.getColDef().showRowGroup) {
            return false;
          }
          return col !== lastSortIndexCol;
        });
        const sortedColsWithIndices = lastSortIndexCol.getSort() ? [...allSortedColsWithoutChangesOrGroups, lastSortIndexCol] : allSortedColsWithoutChangesOrGroups;
        sortedColsWithIndices.forEach((col, idx) => this.setColSortIndex(col, idx));
      }
      // gets called by API, so if data changes, use can call this, which will end up
      // working out the sort order again of the rows.
      onSortChanged(source2, columns) {
        this.dispatchSortChangedEvents(source2, columns);
      }
      isSortActive() {
        let isSorting = false;
        this.beans.colModel.forAllCols((col) => {
          if (col.getSort()) {
            isSorting = true;
          }
        });
        return isSorting;
      }
      dispatchSortChangedEvents(source2, columns) {
        const event = {
          type: "sortChanged",
          source: source2
        };
        if (columns) {
          event.columns = columns;
        }
        this.eventSvc.dispatchEvent(event);
      }
      clearSortBarTheseColumns(columnsToSkip, source2) {
        const clearedColumns = [];
        this.beans.colModel.forAllCols((columnToClear) => {
          if (!columnsToSkip.includes(columnToClear)) {
            if (columnToClear.getSort()) {
              clearedColumns.push(columnToClear);
            }
            this.setColSort(columnToClear, void 0, source2);
          }
        });
        return clearedColumns;
      }
      getNextSortDirection(column2) {
        const sortingOrder = column2.getColDef().sortingOrder ?? this.gos.get("sortingOrder") ?? DEFAULT_SORTING_ORDER;
        const currentIndex = sortingOrder.indexOf(column2.getSort());
        const notInArray = currentIndex < 0;
        const lastItemInArray = currentIndex == sortingOrder.length - 1;
        return notInArray || lastItemInArray ? sortingOrder[0] : sortingOrder[currentIndex + 1];
      }
      /**
       * @returns a map of sort indexes for every sorted column, if groups sort primaries then they will have equivalent indices
       */
      getIndexedSortMap() {
        const { gos, colModel, showRowGroupCols, rowGroupColsSvc } = this.beans;
        let allSortedCols = [];
        colModel.forAllCols((col) => {
          if (col.getSort()) {
            allSortedCols.push(col);
          }
        });
        if (colModel.isPivotMode()) {
          const isSortingLinked = _isColumnsSortingCoupledToGroup(gos);
          allSortedCols = allSortedCols.filter((col) => {
            const isAggregated = !!col.getAggFunc();
            const isSecondary = !col.isPrimary();
            const isGroup = isSortingLinked ? showRowGroupCols?.getShowRowGroupCol(col.getId()) : col.getColDef().showRowGroup;
            return isAggregated || isSecondary || isGroup;
          });
        }
        const sortedRowGroupCols = rowGroupColsSvc?.columns.filter((col) => !!col.getSort()) ?? [];
        const allColsIndexes = {};
        allSortedCols.forEach((col, index) => allColsIndexes[col.getId()] = index);
        allSortedCols.sort((a, b) => {
          const iA = a.getSortIndex();
          const iB = b.getSortIndex();
          if (iA != null && iB != null) {
            return iA - iB;
          } else if (iA == null && iB == null) {
            const posA = allColsIndexes[a.getId()];
            const posB = allColsIndexes[b.getId()];
            return posA > posB ? 1 : -1;
          } else if (iB == null) {
            return -1;
          } else {
            return 1;
          }
        });
        const isSortLinked = _isColumnsSortingCoupledToGroup(gos) && !!sortedRowGroupCols.length;
        if (isSortLinked) {
          allSortedCols = [
            ...new Set(
              // if linked sorting, replace all columns with the display group column for index purposes, and ensure uniqueness
              allSortedCols.map((col) => showRowGroupCols?.getShowRowGroupCol(col.getId()) ?? col)
            )
          ];
        }
        const indexMap = /* @__PURE__ */ new Map();
        allSortedCols.forEach((col, idx) => indexMap.set(col, idx));
        if (isSortLinked) {
          for (const col of sortedRowGroupCols) {
            const groupDisplayCol = showRowGroupCols.getShowRowGroupCol(col.getId());
            indexMap.set(col, indexMap.get(groupDisplayCol));
          }
        }
        return indexMap;
      }
      getColumnsWithSortingOrdered() {
        return [...this.getIndexedSortMap().entries()].sort(([, idx1], [, idx2]) => idx1 - idx2).map(([col]) => col);
      }
      // used by server side row models, to sent sort to server
      getSortModel() {
        return this.getColumnsWithSortingOrdered().filter((column2) => column2.getSort()).map((column2) => ({
          sort: column2.getSort(),
          colId: column2.getId()
        }));
      }
      getSortOptions() {
        return this.getColumnsWithSortingOrdered().filter((column2) => column2.getSort()).map((column2) => ({
          sort: column2.getSort(),
          column: column2
        }));
      }
      canColumnDisplayMixedSort(column2) {
        const isColumnSortCouplingActive = _isColumnsSortingCoupledToGroup(this.gos);
        const isGroupDisplayColumn = !!column2.getColDef().showRowGroup;
        return isColumnSortCouplingActive && isGroupDisplayColumn;
      }
      getDisplaySortForColumn(column2) {
        const linkedColumns = this.beans.showRowGroupCols?.getSourceColumnsForGroupColumn(column2);
        if (!this.canColumnDisplayMixedSort(column2) || !linkedColumns?.length) {
          return column2.getSort();
        }
        const columnHasUniqueData = column2.getColDef().field != null || !!column2.getColDef().valueGetter;
        const sortableColumns = columnHasUniqueData ? [column2, ...linkedColumns] : linkedColumns;
        const firstSort = sortableColumns[0].getSort();
        const allMatch = sortableColumns.every((col) => col.getSort() == firstSort);
        if (!allMatch) {
          return "mixed";
        }
        return firstSort;
      }
      getDisplaySortIndexForColumn(column2) {
        return this.getIndexedSortMap().get(column2);
      }
      setupHeader(comp2, column2, clickElement) {
        let lastMovingChanged = 0;
        comp2.addManagedListeners(column2, {
          movingChanged: () => {
            lastMovingChanged = Date.now();
          }
        });
        if (clickElement) {
          comp2.addManagedElementListeners(clickElement, {
            click: (event) => {
              const moving = column2.isMoving();
              const nowTime = Date.now();
              const movedRecently = nowTime - lastMovingChanged < 50;
              const columnMoving = moving || movedRecently;
              if (!columnMoving) {
                this.progressSortFromEvent(column2, event);
              }
            }
          });
        }
        const onSortingChanged = () => {
          const sort2 = column2.getSort();
          comp2.toggleCss("ag-header-cell-sorted-asc", sort2 === "asc");
          comp2.toggleCss("ag-header-cell-sorted-desc", sort2 === "desc");
          comp2.toggleCss("ag-header-cell-sorted-none", !sort2);
          if (column2.getColDef().showRowGroup) {
            const sourceColumns = this.beans.showRowGroupCols?.getSourceColumnsForGroupColumn(column2);
            const sortDirectionsMatch = sourceColumns?.every(
              (sourceCol) => column2.getSort() == sourceCol.getSort()
            );
            const isMultiSorting = !sortDirectionsMatch;
            comp2.toggleCss("ag-header-cell-sorted-mixed", isMultiSorting);
          }
        };
        comp2.addManagedEventListeners({
          sortChanged: onSortingChanged,
          columnRowGroupChanged: onSortingChanged
        });
      }
      initCol(column2) {
        const { sort: sort2, initialSort, sortIndex, initialSortIndex } = column2.colDef;
        if (sort2 !== void 0) {
          if (sort2 === "asc" || sort2 === "desc") {
            column2.sort = sort2;
          }
        } else if (initialSort === "asc" || initialSort === "desc") {
          column2.sort = initialSort;
        }
        if (sortIndex !== void 0) {
          if (sortIndex !== null) {
            column2.sortIndex = sortIndex;
          }
        } else if (initialSortIndex !== null) {
          column2.sortIndex = initialSortIndex;
        }
      }
      updateColSort(column2, sort2, source2) {
        if (sort2 !== void 0) {
          if (sort2 === "desc" || sort2 === "asc") {
            this.setColSort(column2, sort2, source2);
          } else {
            this.setColSort(column2, void 0, source2);
          }
        }
      }
      setColSort(column2, sort2, source2) {
        if (column2.sort !== sort2) {
          column2.sort = sort2;
          column2.dispatchColEvent("sortChanged", source2);
        }
        column2.dispatchStateUpdatedEvent("sort");
      }
      setColSortIndex(column2, sortOrder) {
        column2.sortIndex = sortOrder;
        column2.dispatchStateUpdatedEvent("sortIndex");
      }
      createSortIndicator(skipTemplate) {
        return new SortIndicatorComp(skipTemplate);
      }
      getSortIndicatorSelector() {
        return SortIndicatorSelector;
      }
    };
    var USER_COMP_MODULES = {
      agSetColumnFilter: "SetFilter",
      agSetColumnFloatingFilter: "SetFilter",
      agMultiColumnFilter: "MultiFilter",
      agMultiColumnFloatingFilter: "MultiFilter",
      agGroupColumnFilter: "GroupFilter",
      agGroupColumnFloatingFilter: "GroupFilter",
      agGroupCellRenderer: "GroupCellRenderer",
      agGroupRowRenderer: "GroupCellRenderer",
      agRichSelect: "RichSelect",
      agRichSelectCellEditor: "RichSelect",
      agDetailCellRenderer: "SharedMasterDetail",
      agSparklineCellRenderer: "Sparklines",
      agDragAndDropImage: "SharedDragAndDrop",
      agColumnHeader: "ColumnHeaderComp",
      agColumnGroupHeader: "ColumnGroupHeaderComp",
      agSortIndicator: "Sort",
      agAnimateShowChangeCellRenderer: "HighlightChanges",
      agAnimateSlideCellRenderer: "HighlightChanges",
      agLoadingCellRenderer: "LoadingCellRenderer",
      agSkeletonCellRenderer: "SkeletonCellRenderer",
      agCheckboxCellRenderer: "CheckboxCellRenderer",
      agLoadingOverlay: "Overlay",
      agNoRowsOverlay: "Overlay",
      agTooltipComponent: "Tooltip",
      agReadOnlyFloatingFilter: "CustomFilter",
      agTextColumnFilter: "TextFilter",
      agNumberColumnFilter: "NumberFilter",
      agDateColumnFilter: "DateFilter",
      agDateInput: "DateFilter",
      agTextColumnFloatingFilter: "TextFilter",
      agNumberColumnFloatingFilter: "NumberFilter",
      agDateColumnFloatingFilter: "DateFilter",
      agCellEditor: "TextEditor",
      agSelectCellEditor: "SelectEditor",
      agTextCellEditor: "TextEditor",
      agNumberCellEditor: "NumberEditor",
      agDateCellEditor: "DateEditor",
      agDateStringCellEditor: "DateEditor",
      agCheckboxCellEditor: "CheckboxEditor",
      agLargeTextCellEditor: "LargeTextEditor",
      agMenuItem: "MenuItem",
      agColumnsToolPanel: "ColumnsToolPanel",
      agFiltersToolPanel: "FiltersToolPanel",
      agNewFiltersToolPanel: "NewFiltersToolPanel",
      agAggregationComponent: "StatusBar",
      agSelectedRowCountComponent: "StatusBar",
      agTotalRowCountComponent: "StatusBar",
      agFilteredRowCountComponent: "StatusBar",
      agTotalAndFilteredRowCountComponent: "StatusBar",
      agFindCellRenderer: "Find"
    };
    function quote(s) {
      return `"${s}"`;
    }
    var COLUMN_DEFINITION_DEPRECATIONS = () => ({
      checkboxSelection: { version: "32.2", message: "Use `rowSelection.checkboxes` in `GridOptions` instead." },
      headerCheckboxSelection: {
        version: "32.2",
        message: "Use `rowSelection.headerCheckbox = true` in `GridOptions` instead."
      },
      headerCheckboxSelectionFilteredOnly: {
        version: "32.2",
        message: 'Use `rowSelection.selectAll = "filtered"` in `GridOptions` instead.'
      },
      headerCheckboxSelectionCurrentPageOnly: {
        version: "32.2",
        message: 'Use `rowSelection.selectAll = "currentPage"` in `GridOptions` instead.'
      },
      showDisabledCheckboxes: {
        version: "32.2",
        message: "Use `rowSelection.hideDisabledCheckboxes = true` in `GridOptions` instead."
      },
      rowGroupingHierarchy: {
        version: "34.3",
        message: "Use `colDef.groupHierarchy` instead."
      }
    });
    var COLUMN_DEFINITION_MOD_VALIDATIONS = {
      aggFunc: "SharedAggregation",
      autoHeight: "RowAutoHeight",
      cellClass: "CellStyle",
      cellClassRules: "CellStyle",
      cellEditor: ({ cellEditor, editable: editable2 }) => {
        if (!editable2) {
          return null;
        }
        if (typeof cellEditor === "string") {
          return USER_COMP_MODULES[cellEditor] ?? "CustomEditor";
        }
        return "CustomEditor";
      },
      cellRenderer: ({ cellRenderer }) => {
        if (typeof cellRenderer !== "string") {
          return null;
        }
        return USER_COMP_MODULES[cellRenderer];
      },
      cellStyle: "CellStyle",
      columnChooserParams: "ColumnMenu",
      contextMenuItems: "ContextMenu",
      dndSource: "DragAndDrop",
      dndSourceOnRowDrag: "DragAndDrop",
      editable: ({ editable: editable2, cellEditor }) => {
        if (editable2 && !cellEditor) {
          return "TextEditor";
        }
        return null;
      },
      enableCellChangeFlash: "HighlightChanges",
      enablePivot: "SharedPivot",
      enableRowGroup: "SharedRowGrouping",
      enableValue: "SharedAggregation",
      filter: ({ filter }) => {
        if (filter && typeof filter !== "string" && typeof filter !== "boolean") {
          return "CustomFilter";
        }
        if (typeof filter === "string") {
          return USER_COMP_MODULES[filter] ?? "ColumnFilter";
        }
        return "ColumnFilter";
      },
      floatingFilter: "ColumnFilter",
      getQuickFilterText: "QuickFilter",
      headerTooltip: "Tooltip",
      headerTooltipValueGetter: "Tooltip",
      mainMenuItems: "ColumnMenu",
      menuTabs: (options2) => {
        const enterpriseMenuTabs = ["columnsMenuTab", "generalMenuTab"];
        if (options2.menuTabs?.some((tab2) => enterpriseMenuTabs.includes(tab2))) {
          return "ColumnMenu";
        }
        return null;
      },
      pivot: "SharedPivot",
      pivotIndex: "SharedPivot",
      rowDrag: "RowDrag",
      rowGroup: "SharedRowGrouping",
      rowGroupIndex: "SharedRowGrouping",
      tooltipField: "Tooltip",
      tooltipValueGetter: "Tooltip",
      tooltipComponentSelector: "Tooltip",
      spanRows: "CellSpan",
      groupHierarchy: "SharedRowGrouping"
    };
    var COLUMN_DEFINITION_VALIDATIONS = () => {
      const validations = {
        autoHeight: {
          supportedRowModels: ["clientSide", "serverSide"],
          validate: (_colDef, { paginationAutoPageSize }) => {
            if (paginationAutoPageSize) {
              return "colDef.autoHeight is not supported with paginationAutoPageSize.";
            }
            return null;
          }
        },
        cellRendererParams: {
          validate: (colDef) => {
            const groupColumn = colDef.rowGroup != null || colDef.rowGroupIndex != null || colDef.cellRenderer === "agGroupCellRenderer";
            if (groupColumn && "checkbox" in colDef.cellRendererParams) {
              return 'Since v33.0, `cellRendererParams.checkbox` has been deprecated. Use `rowSelection.checkboxLocation = "autoGroupColumn"` instead.';
            }
            return null;
          }
        },
        flex: {
          validate: (_options, gridOptions) => {
            if (gridOptions.autoSizeStrategy) {
              return "colDef.flex is not supported with gridOptions.autoSizeStrategy";
            }
            return null;
          }
        },
        headerCheckboxSelection: {
          supportedRowModels: ["clientSide", "serverSide"],
          validate: (_options, { rowSelection }) => rowSelection === "multiple" ? null : "headerCheckboxSelection is only supported with rowSelection=multiple"
        },
        headerCheckboxSelectionCurrentPageOnly: {
          supportedRowModels: ["clientSide"],
          validate: (_options, { rowSelection }) => rowSelection === "multiple" ? null : "headerCheckboxSelectionCurrentPageOnly is only supported with rowSelection=multiple"
        },
        headerCheckboxSelectionFilteredOnly: {
          supportedRowModels: ["clientSide"],
          validate: (_options, { rowSelection }) => rowSelection === "multiple" ? null : "headerCheckboxSelectionFilteredOnly is only supported with rowSelection=multiple"
        },
        headerValueGetter: {
          validate: (_options) => {
            const headerValueGetter = _options.headerValueGetter;
            if (typeof headerValueGetter === "function" || typeof headerValueGetter === "string") {
              return null;
            }
            return "headerValueGetter must be a function or a valid string expression";
          }
        },
        icons: {
          validate: ({ icons }) => {
            if (icons) {
              if (icons["smallDown"]) {
                return _errMsg(262);
              }
              if (icons["smallLeft"]) {
                return _errMsg(263);
              }
              if (icons["smallRight"]) {
                return _errMsg(264);
              }
            }
            return null;
          }
        },
        sortingOrder: {
          validate: (_options) => {
            const sortingOrder = _options.sortingOrder;
            if (Array.isArray(sortingOrder) && sortingOrder.length > 0) {
              const invalidItems = sortingOrder.filter((a) => !DEFAULT_SORTING_ORDER.includes(a));
              if (invalidItems.length > 0) {
                return `sortingOrder must be an array with elements from [${DEFAULT_SORTING_ORDER.map(toStringWithNullUndefined).join()}], currently it includes [${invalidItems.map(toStringWithNullUndefined).join()}]`;
              }
            } else if (!Array.isArray(sortingOrder) || sortingOrder.length <= 0) {
              return `sortingOrder must be an array with at least one element, currently it's ${sortingOrder}`;
            }
            return null;
          }
        },
        type: {
          validate: (_options) => {
            const type = _options.type;
            if (type instanceof Array) {
              const invalidArray = type.some((a) => typeof a !== "string");
              if (invalidArray) {
                return "if colDef.type is supplied an array it should be of type 'string[]'";
              }
              return null;
            }
            if (typeof type === "string") {
              return null;
            }
            return "colDef.type should be of type 'string' | 'string[]'";
          }
        },
        rowSpan: {
          validate: (_options, { suppressRowTransform }) => {
            if (!suppressRowTransform) {
              return "colDef.rowSpan requires suppressRowTransform to be enabled.";
            }
            return null;
          }
        },
        spanRows: {
          dependencies: {
            editable: { required: [false, void 0] },
            rowDrag: { required: [false, void 0] },
            colSpan: { required: [void 0] },
            rowSpan: { required: [void 0] }
          },
          validate: (_options, {
            rowSelection,
            cellSelection,
            suppressRowTransform,
            enableCellSpan,
            rowDragEntireRow,
            enableCellTextSelection
          }) => {
            if (typeof rowSelection === "object") {
              if (rowSelection?.mode === "singleRow" && rowSelection?.enableClickSelection) {
                return "colDef.spanRows is not supported with rowSelection.clickSelection";
              }
            }
            if (cellSelection) {
              return "colDef.spanRows is not supported with cellSelection.";
            }
            if (suppressRowTransform) {
              return "colDef.spanRows is not supported with suppressRowTransform.";
            }
            if (!enableCellSpan) {
              return "colDef.spanRows requires enableCellSpan to be enabled.";
            }
            if (rowDragEntireRow) {
              return "colDef.spanRows is not supported with rowDragEntireRow.";
            }
            if (enableCellTextSelection) {
              return "colDef.spanRows is not supported with enableCellTextSelection.";
            }
            return null;
          }
        },
        groupHierarchy: {
          validate(options2, { groupHierarchyConfig = {} }, beans) {
            const GROUP_HIERARCHY_PARTS = /* @__PURE__ */ new Set([
              "year",
              "quarter",
              "month",
              "formattedMonth",
              "day",
              "hour",
              "minute",
              "second"
            ]);
            const unrecognisedParts = [];
            for (const part2 of options2.groupHierarchy ?? []) {
              if (typeof part2 === "object") {
                beans.validation?.validateColDef(part2);
                continue;
              }
              if (!GROUP_HIERARCHY_PARTS.has(part2) && !(part2 in groupHierarchyConfig)) {
                unrecognisedParts.push(quote(part2));
              }
            }
            if (unrecognisedParts.length > 0) {
              const warning2 = `The following parts of colDef.groupHierarchy are not recognised: ${unrecognisedParts.join(", ")}.`;
              const suggestions = `Choose one of ${[...GROUP_HIERARCHY_PARTS].map(quote).join(", ")}, or define your own parts in gridOptions.groupHierarchyConfig.`;
              return `${warning2}
${suggestions}`;
            }
            return null;
          }
        }
      };
      return validations;
    };
    var colDefPropertyMap = {
      headerName: void 0,
      columnGroupShow: void 0,
      headerStyle: void 0,
      headerClass: void 0,
      toolPanelClass: void 0,
      headerValueGetter: void 0,
      pivotKeys: void 0,
      groupId: void 0,
      colId: void 0,
      sort: void 0,
      initialSort: void 0,
      field: void 0,
      type: void 0,
      cellDataType: void 0,
      tooltipComponent: void 0,
      tooltipField: void 0,
      headerTooltip: void 0,
      headerTooltipValueGetter: void 0,
      cellClass: void 0,
      showRowGroup: void 0,
      filter: void 0,
      initialAggFunc: void 0,
      defaultAggFunc: void 0,
      aggFunc: void 0,
      pinned: void 0,
      initialPinned: void 0,
      chartDataType: void 0,
      cellAriaRole: void 0,
      cellEditorPopupPosition: void 0,
      headerGroupComponent: void 0,
      headerGroupComponentParams: void 0,
      cellStyle: void 0,
      cellRenderer: void 0,
      cellRendererParams: void 0,
      cellEditor: void 0,
      cellEditorParams: void 0,
      filterParams: void 0,
      pivotValueColumn: void 0,
      headerComponent: void 0,
      headerComponentParams: void 0,
      floatingFilterComponent: void 0,
      floatingFilterComponentParams: void 0,
      tooltipComponentParams: void 0,
      refData: void 0,
      columnChooserParams: void 0,
      children: void 0,
      sortingOrder: void 0,
      allowedAggFuncs: void 0,
      menuTabs: void 0,
      pivotTotalColumnIds: void 0,
      cellClassRules: void 0,
      icons: void 0,
      sortIndex: void 0,
      initialSortIndex: void 0,
      flex: void 0,
      initialFlex: void 0,
      width: void 0,
      initialWidth: void 0,
      minWidth: void 0,
      maxWidth: void 0,
      rowGroupIndex: void 0,
      initialRowGroupIndex: void 0,
      pivotIndex: void 0,
      initialPivotIndex: void 0,
      suppressColumnsToolPanel: void 0,
      suppressFiltersToolPanel: void 0,
      openByDefault: void 0,
      marryChildren: void 0,
      suppressStickyLabel: void 0,
      hide: void 0,
      initialHide: void 0,
      rowGroup: void 0,
      initialRowGroup: void 0,
      pivot: void 0,
      initialPivot: void 0,
      checkboxSelection: void 0,
      showDisabledCheckboxes: void 0,
      headerCheckboxSelection: void 0,
      headerCheckboxSelectionFilteredOnly: void 0,
      headerCheckboxSelectionCurrentPageOnly: void 0,
      suppressHeaderMenuButton: void 0,
      suppressMovable: void 0,
      lockPosition: void 0,
      lockVisible: void 0,
      lockPinned: void 0,
      unSortIcon: void 0,
      suppressSizeToFit: void 0,
      suppressAutoSize: void 0,
      enableRowGroup: void 0,
      enablePivot: void 0,
      enableValue: void 0,
      editable: void 0,
      suppressPaste: void 0,
      suppressNavigable: void 0,
      enableCellChangeFlash: void 0,
      rowDrag: void 0,
      dndSource: void 0,
      autoHeight: void 0,
      wrapText: void 0,
      sortable: void 0,
      resizable: void 0,
      singleClickEdit: void 0,
      floatingFilter: void 0,
      cellEditorPopup: void 0,
      suppressFillHandle: void 0,
      wrapHeaderText: void 0,
      autoHeaderHeight: void 0,
      dndSourceOnRowDrag: void 0,
      valueGetter: void 0,
      valueSetter: void 0,
      filterValueGetter: void 0,
      keyCreator: void 0,
      valueFormatter: void 0,
      valueParser: void 0,
      comparator: void 0,
      equals: void 0,
      pivotComparator: void 0,
      suppressKeyboardEvent: void 0,
      suppressHeaderKeyboardEvent: void 0,
      colSpan: void 0,
      rowSpan: void 0,
      spanRows: void 0,
      getQuickFilterText: void 0,
      onCellValueChanged: void 0,
      onCellClicked: void 0,
      onCellDoubleClicked: void 0,
      onCellContextMenu: void 0,
      rowDragText: void 0,
      tooltipValueGetter: void 0,
      tooltipComponentSelector: void 0,
      cellRendererSelector: void 0,
      cellEditorSelector: void 0,
      suppressSpanHeaderHeight: void 0,
      useValueFormatterForExport: void 0,
      useValueParserForImport: void 0,
      mainMenuItems: void 0,
      contextMenuItems: void 0,
      suppressFloatingFilterButton: void 0,
      suppressHeaderFilterButton: void 0,
      suppressHeaderContextMenu: void 0,
      loadingCellRenderer: void 0,
      loadingCellRendererParams: void 0,
      loadingCellRendererSelector: void 0,
      context: void 0,
      dateComponent: void 0,
      dateComponentParams: void 0,
      getFindText: void 0,
      rowGroupingHierarchy: void 0,
      groupHierarchy: void 0
    };
    var ALL_PROPERTIES = () => Object.keys(colDefPropertyMap);
    var COL_DEF_VALIDATORS = () => ({
      objectName: "colDef",
      allProperties: ALL_PROPERTIES(),
      docsUrl: "column-properties/",
      deprecations: COLUMN_DEFINITION_DEPRECATIONS(),
      validations: COLUMN_DEFINITION_VALIDATIONS()
    });
    var STRING_GRID_OPTIONS = [
      "overlayLoadingTemplate",
      "overlayNoRowsTemplate",
      "gridId",
      "quickFilterText",
      "rowModelType",
      "editType",
      "domLayout",
      "clipboardDelimiter",
      "rowGroupPanelShow",
      "multiSortKey",
      "pivotColumnGroupTotals",
      "pivotRowTotals",
      "pivotPanelShow",
      "fillHandleDirection",
      "groupDisplayType",
      "treeDataDisplayType",
      "treeDataChildrenField",
      "treeDataParentIdField",
      "colResizeDefault",
      "tooltipTrigger",
      "serverSidePivotResultFieldSeparator",
      "columnMenu",
      "tooltipShowMode",
      "invalidEditValueMode",
      "grandTotalRow",
      "themeCssLayer",
      "findSearchValue",
      "styleNonce",
      "renderingMode"
    ];
    var OBJECT_GRID_OPTIONS = [
      "components",
      "rowStyle",
      "context",
      "autoGroupColumnDef",
      "localeText",
      "icons",
      "datasource",
      "dragAndDropImageComponentParams",
      "serverSideDatasource",
      "viewportDatasource",
      "groupRowRendererParams",
      "aggFuncs",
      "fullWidthCellRendererParams",
      "defaultColGroupDef",
      "defaultColDef",
      "defaultCsvExportParams",
      "defaultExcelExportParams",
      "columnTypes",
      "rowClassRules",
      "detailCellRendererParams",
      "loadingCellRendererParams",
      "loadingOverlayComponentParams",
      "noRowsOverlayComponentParams",
      "popupParent",
      "themeStyleContainer",
      "statusBar",
      "chartThemeOverrides",
      "customChartThemes",
      "chartToolPanelsDef",
      "dataTypeDefinitions",
      "advancedFilterParent",
      "advancedFilterBuilderParams",
      "advancedFilterParams",
      "initialState",
      "autoSizeStrategy",
      "selectionColumnDef",
      "findOptions",
      "filterHandlers",
      "groupHierarchyConfig"
    ];
    var ARRAY_GRID_OPTIONS = [
      "sortingOrder",
      "alignedGrids",
      "rowData",
      "columnDefs",
      "excelStyles",
      "pinnedTopRowData",
      "pinnedBottomRowData",
      "chartThemes",
      "rowClass",
      "paginationPageSizeSelector"
    ];
    var _NUMBER_GRID_OPTIONS = [
      "rowHeight",
      "detailRowHeight",
      "rowBuffer",
      "headerHeight",
      "groupHeaderHeight",
      "groupLockGroupColumns",
      "floatingFiltersHeight",
      "pivotHeaderHeight",
      "pivotGroupHeaderHeight",
      "groupDefaultExpanded",
      "pivotDefaultExpanded",
      "viewportRowModelPageSize",
      "viewportRowModelBufferSize",
      "autoSizePadding",
      "maxBlocksInCache",
      "maxConcurrentDatasourceRequests",
      "tooltipShowDelay",
      "tooltipHideDelay",
      "cacheOverflowSize",
      "paginationPageSize",
      "cacheBlockSize",
      "infiniteInitialRowCount",
      "serverSideInitialRowCount",
      "scrollbarWidth",
      "asyncTransactionWaitMillis",
      "blockLoadDebounceMillis",
      "keepDetailRowsCount",
      "undoRedoCellEditingLimit",
      "cellFlashDuration",
      "cellFadeDuration",
      "tabIndex",
      "pivotMaxGeneratedColumns",
      "rowDragInsertDelay"
    ];
    var OTHER_GRID_OPTIONS = ["theme", "rowSelection"];
    var _BOOLEAN_MIXED_GRID_OPTIONS = [
      "cellSelection",
      "sideBar",
      "rowNumbers",
      "suppressGroupChangesColumnVisibility",
      "groupAggFiltering",
      "suppressStickyTotalRow",
      "groupHideParentOfSingleChild",
      "enableRowPinning"
    ];
    var _BOOLEAN_GRID_OPTIONS = [
      "loadThemeGoogleFonts",
      "suppressMakeColumnVisibleAfterUnGroup",
      "suppressRowClickSelection",
      "suppressCellFocus",
      "suppressHeaderFocus",
      "suppressHorizontalScroll",
      "groupSelectsChildren",
      "alwaysShowHorizontalScroll",
      "alwaysShowVerticalScroll",
      "debug",
      "enableBrowserTooltips",
      "enableCellExpressions",
      "groupSuppressBlankHeader",
      "suppressMenuHide",
      "suppressRowDeselection",
      "unSortIcon",
      "suppressMultiSort",
      "alwaysMultiSort",
      "singleClickEdit",
      "suppressLoadingOverlay",
      "suppressNoRowsOverlay",
      "suppressAutoSize",
      "skipHeaderOnAutoSize",
      "suppressColumnMoveAnimation",
      "suppressMoveWhenColumnDragging",
      "suppressMovableColumns",
      "suppressFieldDotNotation",
      "enableRangeSelection",
      "enableRangeHandle",
      "enableFillHandle",
      "suppressClearOnFillReduction",
      "deltaSort",
      "suppressTouch",
      "allowContextMenuWithControlKey",
      "suppressContextMenu",
      "suppressDragLeaveHidesColumns",
      "suppressRowGroupHidesColumns",
      "suppressMiddleClickScrolls",
      "suppressPreventDefaultOnMouseWheel",
      "suppressCopyRowsToClipboard",
      "copyHeadersToClipboard",
      "copyGroupHeadersToClipboard",
      "pivotMode",
      "suppressAggFuncInHeader",
      "suppressColumnVirtualisation",
      "alwaysAggregateAtRootLevel",
      "suppressFocusAfterRefresh",
      "functionsReadOnly",
      "animateRows",
      "groupSelectsFiltered",
      "groupRemoveSingleChildren",
      "groupRemoveLowestSingleChildren",
      "enableRtl",
      "enableCellSpan",
      "suppressClickEdit",
      "rowDragEntireRow",
      "rowDragManaged",
      "suppressRowDrag",
      "suppressMoveWhenRowDragging",
      "rowDragMultiRow",
      "enableGroupEdit",
      "embedFullWidthRows",
      "suppressPaginationPanel",
      "groupHideOpenParents",
      "groupAllowUnbalanced",
      "pagination",
      "paginationAutoPageSize",
      "suppressScrollOnNewData",
      "suppressScrollWhenPopupsAreOpen",
      "purgeClosedRowNodes",
      "cacheQuickFilter",
      "includeHiddenColumnsInQuickFilter",
      "ensureDomOrder",
      "accentedSort",
      "suppressChangeDetection",
      "valueCache",
      "valueCacheNeverExpires",
      "aggregateOnlyChangedColumns",
      "suppressAnimationFrame",
      "suppressExcelExport",
      "suppressCsvExport",
      "includeHiddenColumnsInAdvancedFilter",
      "suppressMultiRangeSelection",
      "enterNavigatesVerticallyAfterEdit",
      "enterNavigatesVertically",
      "suppressPropertyNamesCheck",
      "rowMultiSelectWithClick",
      "suppressRowHoverHighlight",
      "suppressRowTransform",
      "suppressClipboardPaste",
      "suppressLastEmptyLineOnPaste",
      "enableCharts",
      "suppressMaintainUnsortedOrder",
      "enableCellTextSelection",
      "suppressBrowserResizeObserver",
      "suppressMaxRenderedRowRestriction",
      "excludeChildrenWhenTreeDataFiltering",
      "tooltipMouseTrack",
      "tooltipInteraction",
      "keepDetailRows",
      "paginateChildRows",
      "preventDefaultOnContextMenu",
      "undoRedoCellEditing",
      "allowDragFromColumnsToolPanel",
      "pivotSuppressAutoColumn",
      "suppressExpandablePivotGroups",
      "debounceVerticalScrollbar",
      "detailRowAutoHeight",
      "serverSideSortAllLevels",
      "serverSideEnableClientSideSort",
      "serverSideOnlyRefreshFilteredGroups",
      "suppressAggFilteredOnly",
      "showOpenedGroup",
      "suppressClipboardApi",
      "suppressModelUpdateAfterUpdateTransaction",
      "stopEditingWhenCellsLoseFocus",
      "groupMaintainOrder",
      "columnHoverHighlight",
      "readOnlyEdit",
      "suppressRowVirtualisation",
      "enableCellEditingOnBackspace",
      "resetRowDataOnUpdate",
      "removePivotHeaderRowWhenSingleValueColumn",
      "suppressCopySingleCellRanges",
      "suppressGroupRowsSticky",
      "suppressCutToClipboard",
      "rowGroupPanelSuppressSort",
      "allowShowChangeAfterFilter",
      "enableAdvancedFilter",
      "masterDetail",
      "treeData",
      "reactiveCustomComponents",
      "applyQuickFilterBeforePivotOrAgg",
      "suppressServerSideFullWidthLoadingRow",
      "suppressAdvancedFilterEval",
      "loading",
      "maintainColumnOrder",
      "enableStrictPivotColumnOrder",
      "suppressSetFilterByDefault",
      "enableFilterHandlers",
      "suppressStartEditOnTab",
      "hidePaddedHeaderRows",
      "ssrmExpandAllAffectsAllRows"
    ];
    var _FUNCTION_GRID_OPTIONS = [
      "doesExternalFilterPass",
      "processPivotResultColDef",
      "processPivotResultColGroupDef",
      "getBusinessKeyForNode",
      "isRowSelectable",
      "rowDragText",
      "groupRowRenderer",
      "dragAndDropImageComponent",
      "fullWidthCellRenderer",
      "loadingCellRenderer",
      "loadingOverlayComponent",
      "noRowsOverlayComponent",
      "detailCellRenderer",
      "quickFilterParser",
      "quickFilterMatcher",
      "getLocaleText",
      "isExternalFilterPresent",
      "getRowHeight",
      "getRowClass",
      "getRowStyle",
      "getFullRowEditValidationErrors",
      "getContextMenuItems",
      "getMainMenuItems",
      "processRowPostCreate",
      "processCellForClipboard",
      "getGroupRowAgg",
      "isFullWidthRow",
      "sendToClipboard",
      "focusGridInnerElement",
      "navigateToNextHeader",
      "tabToNextHeader",
      "navigateToNextCell",
      "tabToNextCell",
      "processCellFromClipboard",
      "getDocument",
      "postProcessPopup",
      "getChildCount",
      "getDataPath",
      "isRowMaster",
      "postSortRows",
      "processHeaderForClipboard",
      "processUnpinnedColumns",
      "processGroupHeaderForClipboard",
      "paginationNumberFormatter",
      "processDataFromClipboard",
      "getServerSideGroupKey",
      "isServerSideGroup",
      "createChartContainer",
      "getChartToolbarItems",
      "fillOperation",
      "isApplyServerSideTransaction",
      "getServerSideGroupLevelParams",
      "isServerSideGroupOpenByDefault",
      "isGroupOpenByDefault",
      "initialGroupOrderComparator",
      "loadingCellRendererSelector",
      "getRowId",
      "chartMenuItems",
      "groupTotalRow",
      "alwaysPassFilter",
      "isRowPinnable",
      "isRowPinned",
      "isRowValidDropPosition"
    ];
    var _GET_ALL_GRID_OPTIONS = () => [
      ...ARRAY_GRID_OPTIONS,
      ...OBJECT_GRID_OPTIONS,
      ...STRING_GRID_OPTIONS,
      ..._NUMBER_GRID_OPTIONS,
      ..._FUNCTION_GRID_OPTIONS,
      ..._BOOLEAN_GRID_OPTIONS,
      ..._BOOLEAN_MIXED_GRID_OPTIONS,
      ...OTHER_GRID_OPTIONS
    ];
    var GRID_OPTION_DEPRECATIONS = () => ({
      suppressLoadingOverlay: { version: "32", message: "Use `loading`=false instead." },
      enableFillHandle: { version: "32.2", message: "Use `cellSelection.handle` instead." },
      enableRangeHandle: { version: "32.2", message: "Use `cellSelection.handle` instead." },
      enableRangeSelection: { version: "32.2", message: "Use `cellSelection = true` instead." },
      suppressMultiRangeSelection: {
        version: "32.2",
        message: "Use `cellSelection.suppressMultiRanges` instead."
      },
      suppressClearOnFillReduction: {
        version: "32.2",
        message: "Use `cellSelection.handle.suppressClearOnFillReduction` instead."
      },
      fillHandleDirection: { version: "32.2", message: "Use `cellSelection.handle.direction` instead." },
      fillOperation: { version: "32.2", message: "Use `cellSelection.handle.setFillValue` instead." },
      suppressRowClickSelection: {
        version: "32.2",
        message: "Use `rowSelection.enableClickSelection` instead."
      },
      suppressRowDeselection: { version: "32.2", message: "Use `rowSelection.enableClickSelection` instead." },
      rowMultiSelectWithClick: {
        version: "32.2",
        message: "Use `rowSelection.enableSelectionWithoutKeys` instead."
      },
      groupSelectsChildren: {
        version: "32.2",
        message: 'Use `rowSelection.groupSelects = "descendants"` instead.'
      },
      groupSelectsFiltered: {
        version: "32.2",
        message: 'Use `rowSelection.groupSelects = "filteredDescendants"` instead.'
      },
      isRowSelectable: { version: "32.2", message: "Use `selectionOptions.isRowSelectable` instead." },
      suppressCopySingleCellRanges: { version: "32.2", message: "Use `rowSelection.copySelectedRows` instead." },
      suppressCopyRowsToClipboard: { version: "32.2", message: "Use `rowSelection.copySelectedRows` instead." },
      onRangeSelectionChanged: { version: "32.2", message: "Use `onCellSelectionChanged` instead." },
      onRangeDeleteStart: { version: "32.2", message: "Use `onCellSelectionDeleteStart` instead." },
      onRangeDeleteEnd: { version: "32.2", message: "Use `onCellSelectionDeleteEnd` instead." },
      suppressBrowserResizeObserver: {
        version: "32.2",
        message: "The grid always uses the browser's ResizeObserver, this grid option has no effect."
      },
      onColumnEverythingChanged: {
        version: "32.2",
        message: "Either use `onDisplayedColumnsChanged` which is fired at the same time, or use one of the more specific column events."
      },
      groupRemoveSingleChildren: {
        version: "33",
        message: "Use `groupHideParentOfSingleChild` instead."
      },
      groupRemoveLowestSingleChildren: {
        version: "33",
        message: 'Use `groupHideParentOfSingleChild: "leafGroupsOnly"` instead.'
      },
      suppressRowGroupHidesColumns: {
        version: "33",
        message: 'Use `suppressGroupChangesColumnVisibility: "suppressHideOnGroup"` instead.'
      },
      suppressMakeColumnVisibleAfterUnGroup: {
        version: "33",
        message: 'Use `suppressGroupChangesColumnVisibility: "suppressShowOnUngroup"` instead.'
      },
      unSortIcon: { version: "33", message: "Use `defaultColDef.unSortIcon` instead." },
      sortingOrder: { version: "33", message: "Use `defaultColDef.sortingOrder` instead." },
      suppressPropertyNamesCheck: {
        version: "33",
        message: "`gridOptions` and `columnDefs` both have a `context` property that should be used for arbitrary user data. This means that column definitions and gridOptions should only contain valid properties making this property redundant."
      },
      suppressAdvancedFilterEval: {
        version: "34",
        message: "Advanced filter no longer uses function evaluation, so this option has no effect."
      }
    });
    function toConstrainedNum(key2, value2, min2) {
      if (typeof value2 === "number" || value2 == null) {
        if (value2 == null) {
          return null;
        }
        return value2 >= min2 ? null : `${key2}: value should be greater than or equal to ${min2}`;
      }
      return `${key2}: value should be a number`;
    }
    var GRID_OPTIONS_MODULES = {
      alignedGrids: "AlignedGrids",
      allowContextMenuWithControlKey: "ContextMenu",
      autoSizeStrategy: "ColumnAutoSize",
      cellSelection: "CellSelection",
      columnHoverHighlight: "ColumnHover",
      datasource: "InfiniteRowModel",
      doesExternalFilterPass: "ExternalFilter",
      editType: "EditCore",
      invalidEditValueMode: "EditCore",
      enableAdvancedFilter: "AdvancedFilter",
      enableCellSpan: "CellSpan",
      enableCharts: "IntegratedCharts",
      enableRangeSelection: "CellSelection",
      enableRowPinning: "PinnedRow",
      findSearchValue: "Find",
      getFullRowEditValidationErrors: "EditCore",
      getContextMenuItems: "ContextMenu",
      getLocaleText: "Locale",
      getMainMenuItems: "ColumnMenu",
      getRowClass: "RowStyle",
      getRowStyle: "RowStyle",
      groupTotalRow: "SharedRowGrouping",
      grandTotalRow: "ClientSideRowModelHierarchy",
      initialState: "GridState",
      isExternalFilterPresent: "ExternalFilter",
      isRowPinnable: "PinnedRow",
      isRowPinned: "PinnedRow",
      localeText: "Locale",
      masterDetail: "SharedMasterDetail",
      pagination: "Pagination",
      pinnedBottomRowData: "PinnedRow",
      pinnedTopRowData: "PinnedRow",
      pivotMode: "SharedPivot",
      pivotPanelShow: "RowGroupingPanel",
      quickFilterText: "QuickFilter",
      rowClass: "RowStyle",
      rowClassRules: "RowStyle",
      rowData: "ClientSideRowModel",
      rowDragManaged: "RowDrag",
      rowGroupPanelShow: "RowGroupingPanel",
      rowNumbers: "RowNumbers",
      rowSelection: "SharedRowSelection",
      rowStyle: "RowStyle",
      serverSideDatasource: "ServerSideRowModel",
      sideBar: "SideBar",
      statusBar: "StatusBar",
      treeData: "SharedTreeData",
      undoRedoCellEditing: "UndoRedoEdit",
      valueCache: "ValueCache",
      viewportDatasource: "ViewportRowModel"
    };
    var GRID_OPTION_VALIDATIONS = () => {
      const definedValidations = {
        autoSizePadding: {
          validate({ autoSizePadding }) {
            return toConstrainedNum("autoSizePadding", autoSizePadding, 0);
          }
        },
        cacheBlockSize: {
          supportedRowModels: ["serverSide", "infinite"],
          validate({ cacheBlockSize }) {
            return toConstrainedNum("cacheBlockSize", cacheBlockSize, 1);
          }
        },
        cacheOverflowSize: {
          validate({ cacheOverflowSize }) {
            return toConstrainedNum("cacheOverflowSize", cacheOverflowSize, 1);
          }
        },
        datasource: {
          supportedRowModels: ["infinite"]
        },
        domLayout: {
          validate: (options2) => {
            const domLayout = options2.domLayout;
            const validLayouts = ["autoHeight", "normal", "print"];
            if (domLayout && !validLayouts.includes(domLayout)) {
              return `domLayout must be one of [${validLayouts.join()}], currently it's ${domLayout}`;
            }
            return null;
          }
        },
        enableFillHandle: {
          dependencies: {
            enableRangeSelection: { required: [true] }
          }
        },
        enableRangeHandle: {
          dependencies: {
            enableRangeSelection: { required: [true] }
          }
        },
        enableRangeSelection: {
          dependencies: {
            rowDragEntireRow: { required: [false, void 0] }
          }
        },
        enableRowPinning: {
          supportedRowModels: ["clientSide"],
          validate({ enableRowPinning, pinnedTopRowData, pinnedBottomRowData }) {
            if (enableRowPinning && (pinnedTopRowData || pinnedBottomRowData)) {
              return "Manual row pinning cannot be used together with pinned row data. Either set `enableRowPinning` to `false`, or remove `pinnedTopRowData` and `pinnedBottomRowData`.";
            }
            return null;
          }
        },
        isRowPinnable: {
          supportedRowModels: ["clientSide"],
          validate({ enableRowPinning, isRowPinnable, pinnedTopRowData, pinnedBottomRowData }) {
            if (isRowPinnable && (pinnedTopRowData || pinnedBottomRowData)) {
              return "Manual row pinning cannot be used together with pinned row data. Either remove `isRowPinnable`, or remove `pinnedTopRowData` and `pinnedBottomRowData`.";
            }
            if (!enableRowPinning && isRowPinnable) {
              return "`isRowPinnable` requires `enableRowPinning` to be set.";
            }
            return null;
          }
        },
        isRowPinned: {
          supportedRowModels: ["clientSide"],
          validate({ enableRowPinning, isRowPinned, pinnedTopRowData, pinnedBottomRowData }) {
            if (isRowPinned && (pinnedTopRowData || pinnedBottomRowData)) {
              return "Manual row pinning cannot be used together with pinned row data. Either remove `isRowPinned`, or remove `pinnedTopRowData` and `pinnedBottomRowData`.";
            }
            if (!enableRowPinning && isRowPinned) {
              return "`isRowPinned` requires `enableRowPinning` to be set.";
            }
            return null;
          }
        },
        groupDefaultExpanded: {
          supportedRowModels: ["clientSide"]
        },
        groupHideOpenParents: {
          supportedRowModels: ["clientSide", "serverSide"],
          dependencies: {
            groupTotalRow: { required: [void 0, "bottom"] },
            treeData: {
              required: [void 0, false],
              reason: "Tree Data has values at the group level so it doesn't make sense to hide them."
            }
          }
        },
        groupHideParentOfSingleChild: {
          dependencies: {
            groupHideOpenParents: { required: [void 0, false] }
          }
        },
        groupRemoveLowestSingleChildren: {
          dependencies: {
            groupHideOpenParents: { required: [void 0, false] },
            groupRemoveSingleChildren: { required: [void 0, false] }
          }
        },
        groupRemoveSingleChildren: {
          dependencies: {
            groupHideOpenParents: { required: [void 0, false] },
            groupRemoveLowestSingleChildren: { required: [void 0, false] }
          }
        },
        groupSelectsChildren: {
          dependencies: {
            rowSelection: { required: ["multiple"] }
          }
        },
        groupHierarchyConfig: {
          validate({ groupHierarchyConfig = {} }, gridOptions, beans) {
            for (const k2 of Object.keys(groupHierarchyConfig)) {
              beans.validation?.validateColDef(groupHierarchyConfig[k2]);
            }
            return null;
          }
        },
        icons: {
          validate: ({ icons }) => {
            if (icons) {
              if (icons["smallDown"]) {
                return _errMsg(262);
              }
              if (icons["smallLeft"]) {
                return _errMsg(263);
              }
              if (icons["smallRight"]) {
                return _errMsg(264);
              }
            }
            return null;
          }
        },
        infiniteInitialRowCount: {
          validate({ infiniteInitialRowCount }) {
            return toConstrainedNum("infiniteInitialRowCount", infiniteInitialRowCount, 1);
          }
        },
        initialGroupOrderComparator: {
          supportedRowModels: ["clientSide"]
        },
        ssrmExpandAllAffectsAllRows: {
          validate: (options2) => {
            if (typeof options2.ssrmExpandAllAffectsAllRows === "boolean") {
              if (options2.rowModelType !== "serverSide") {
                return "'ssrmExpandAllAffectsAllRows' is only supported with the Server Side Row Model.";
              }
              if (options2.ssrmExpandAllAffectsAllRows && typeof options2.getRowId !== "function") {
                return `'getRowId' callback must be provided for Server Side Row Model grouping to work correctly.`;
              }
            }
            return null;
          }
        },
        keepDetailRowsCount: {
          validate({ keepDetailRowsCount }) {
            return toConstrainedNum("keepDetailRowsCount", keepDetailRowsCount, 1);
          }
        },
        paginationPageSize: {
          validate({ paginationPageSize }) {
            return toConstrainedNum("paginationPageSize", paginationPageSize, 1);
          }
        },
        paginationPageSizeSelector: {
          validate: (options2) => {
            const values = options2.paginationPageSizeSelector;
            if (typeof values === "boolean" || values == null) {
              return null;
            }
            if (!values.length) {
              return `'paginationPageSizeSelector' cannot be an empty array.
                    If you want to hide the page size selector, set paginationPageSizeSelector to false.`;
            }
            return null;
          }
        },
        pivotMode: {
          dependencies: {
            treeData: {
              required: [false, void 0],
              reason: "Pivot Mode is not supported with Tree Data."
            }
          }
        },
        quickFilterText: {
          supportedRowModels: ["clientSide"]
        },
        rowBuffer: {
          validate({ rowBuffer }) {
            return toConstrainedNum("rowBuffer", rowBuffer, 0);
          }
        },
        rowClass: {
          validate: (options2) => {
            const rowClass = options2.rowClass;
            if (typeof rowClass === "function") {
              return "rowClass should not be a function, please use getRowClass instead";
            }
            return null;
          }
        },
        rowData: {
          supportedRowModels: ["clientSide"]
        },
        rowDragManaged: {
          supportedRowModels: ["clientSide"],
          dependencies: {
            pagination: {
              required: [false, void 0]
            }
          }
        },
        rowSelection: {
          validate({ rowSelection }) {
            if (rowSelection && typeof rowSelection === "string") {
              return 'As of version 32.2.1, using `rowSelection` with the values "single" or "multiple" has been deprecated. Use the object value instead.';
            }
            if (rowSelection && typeof rowSelection !== "object") {
              return "Expected `RowSelectionOptions` object for the `rowSelection` property.";
            }
            if (rowSelection && rowSelection.mode !== "multiRow" && rowSelection.mode !== "singleRow") {
              return `Selection mode "${rowSelection.mode}" is invalid. Use one of 'singleRow' or 'multiRow'.`;
            }
            return null;
          }
        },
        rowStyle: {
          validate: (options2) => {
            const rowStyle = options2.rowStyle;
            if (rowStyle && typeof rowStyle === "function") {
              return "rowStyle should be an object of key/value styles, not be a function, use getRowStyle() instead";
            }
            return null;
          }
        },
        serverSideDatasource: {
          supportedRowModels: ["serverSide"]
        },
        serverSideInitialRowCount: {
          supportedRowModels: ["serverSide"],
          validate({ serverSideInitialRowCount }) {
            return toConstrainedNum("serverSideInitialRowCount", serverSideInitialRowCount, 1);
          }
        },
        serverSideOnlyRefreshFilteredGroups: {
          supportedRowModels: ["serverSide"]
        },
        serverSideSortAllLevels: {
          supportedRowModels: ["serverSide"]
        },
        sortingOrder: {
          validate: (_options) => {
            const sortingOrder = _options.sortingOrder;
            if (Array.isArray(sortingOrder) && sortingOrder.length > 0) {
              const invalidItems = sortingOrder.filter((a) => !DEFAULT_SORTING_ORDER.includes(a));
              if (invalidItems.length > 0) {
                return `sortingOrder must be an array with elements from [${DEFAULT_SORTING_ORDER.map(toStringWithNullUndefined).join()}], currently it includes [${invalidItems.map(toStringWithNullUndefined).join()}]`;
              }
            } else if (!Array.isArray(sortingOrder) || sortingOrder.length <= 0) {
              return `sortingOrder must be an array with at least one element, currently it's ${sortingOrder}`;
            }
            return null;
          }
        },
        tooltipHideDelay: {
          validate: (options2) => {
            if (options2.tooltipHideDelay && options2.tooltipHideDelay < 0) {
              return "tooltipHideDelay should not be lower than 0";
            }
            return null;
          }
        },
        tooltipShowDelay: {
          validate: (options2) => {
            if (options2.tooltipShowDelay && options2.tooltipShowDelay < 0) {
              return "tooltipShowDelay should not be lower than 0";
            }
            return null;
          }
        },
        treeData: {
          supportedRowModels: ["clientSide", "serverSide"],
          validate: (options2) => {
            const rowModel = options2.rowModelType ?? "clientSide";
            switch (rowModel) {
              case "clientSide": {
                const { treeDataChildrenField, treeDataParentIdField, getDataPath, getRowId } = options2;
                if (!treeDataChildrenField && !treeDataParentIdField && !getDataPath) {
                  return "treeData requires either 'treeDataChildrenField' or 'treeDataParentIdField' or 'getDataPath' in the clientSide row model.";
                }
                if (treeDataChildrenField) {
                  if (getDataPath) {
                    return "Cannot use both 'treeDataChildrenField' and 'getDataPath' at the same time.";
                  }
                  if (treeDataParentIdField) {
                    return "Cannot use both 'treeDataChildrenField' and 'treeDataParentIdField' at the same time.";
                  }
                }
                if (treeDataParentIdField) {
                  if (!getRowId) {
                    return "getRowId callback not provided, tree data with parent id cannot be built.";
                  }
                  if (getDataPath) {
                    return "Cannot use both 'treeDataParentIdField' and 'getDataPath' at the same time.";
                  }
                }
                return null;
              }
              case "serverSide": {
                const ssrmWarning = `treeData requires 'isServerSideGroup' and 'getServerSideGroupKey' in the ${rowModel} row model.`;
                return options2.isServerSideGroup && options2.getServerSideGroupKey ? null : ssrmWarning;
              }
            }
            return null;
          }
        },
        viewportDatasource: {
          supportedRowModels: ["viewport"]
        },
        viewportRowModelBufferSize: {
          validate({ viewportRowModelBufferSize }) {
            return toConstrainedNum("viewportRowModelBufferSize", viewportRowModelBufferSize, 0);
          }
        },
        viewportRowModelPageSize: {
          validate({ viewportRowModelPageSize }) {
            return toConstrainedNum("viewportRowModelPageSize", viewportRowModelPageSize, 1);
          }
        },
        rowDragEntireRow: {
          dependencies: {
            cellSelection: { required: [void 0] }
          }
        },
        autoGroupColumnDef: {
          validate({ autoGroupColumnDef, showOpenedGroup }) {
            if (autoGroupColumnDef?.field && showOpenedGroup) {
              return "autoGroupColumnDef.field and showOpenedGroup are not supported when used together.";
            }
            if (autoGroupColumnDef?.valueGetter && showOpenedGroup) {
              return "autoGroupColumnDef.valueGetter and showOpenedGroup are not supported when used together.";
            }
            return null;
          }
        },
        renderingMode: {
          validate: (options2) => {
            const renderingMode = options2.renderingMode;
            const validModes = ["default", "legacy"];
            if (renderingMode && !validModes.includes(renderingMode)) {
              return `renderingMode must be one of [${validModes.join()}], currently it's ${renderingMode}`;
            }
            return null;
          }
        },
        autoSizeStrategy: {
          validate: ({ autoSizeStrategy }) => {
            if (!autoSizeStrategy) {
              return null;
            }
            const validModes = [
              "fitCellContents",
              "fitGridWidth",
              "fitProvidedWidth"
            ];
            const type = autoSizeStrategy.type;
            if (type !== "fitCellContents" && type !== "fitGridWidth" && type !== "fitProvidedWidth") {
              return `Invalid Auto-size strategy. \`autoSizeStrategy\` must be one of ${validModes.map((m) => '"' + m + '"').join(", ")}, currently it's ${type}`;
            }
            if (type === "fitProvidedWidth" && typeof autoSizeStrategy.width != "number") {
              return `When using the 'fitProvidedWidth' auto-size strategy, must provide a numeric \`width\`. You provided ${autoSizeStrategy.width}`;
            }
            return null;
          }
        }
      };
      const validations = {};
      for (const key2 of _BOOLEAN_GRID_OPTIONS) {
        validations[key2] = { expectedType: "boolean" };
      }
      for (const key2 of _NUMBER_GRID_OPTIONS) {
        validations[key2] = { expectedType: "number" };
      }
      _mergeDeep(validations, definedValidations);
      return validations;
    };
    var GRID_OPTIONS_VALIDATORS = () => ({
      objectName: "gridOptions",
      allProperties: [..._GET_ALL_GRID_OPTIONS(), ...Object.values(_PUBLIC_EVENT_HANDLERS_MAP)],
      propertyExceptions: ["api"],
      docsUrl: "grid-options/",
      deprecations: GRID_OPTION_DEPRECATIONS(),
      validations: GRID_OPTION_VALIDATIONS()
    });
    var changeSetId = 0;
    var gridInstanceSequence = 0;
    var GRID_DOM_KEY = "__ag_grid_instance";
    var GridOptionsService = class extends BeanStub {
      constructor() {
        super(...arguments);
        this.beanName = "gos";
        this.domDataKey = "__AG_" + Math.random().toString();
        this.instanceId = gridInstanceSequence++;
        this.gridReadyFired = false;
        this.queueEvents = [];
        this.propEventSvc = new LocalEventService();
        this.globalEventHandlerFactory = (restrictToSyncOnly) => {
          return (eventName, event) => {
            if (!this.isAlive()) {
              return;
            }
            const alwaysSync = ALWAYS_SYNC_GLOBAL_EVENTS.has(eventName);
            if (alwaysSync && !restrictToSyncOnly || !alwaysSync && restrictToSyncOnly) {
              return;
            }
            if (!isPublicEventHandler(eventName)) {
              return;
            }
            const fireEvent = (name2, e) => {
              const eventHandlerName = _PUBLIC_EVENT_HANDLERS_MAP[name2];
              const eventHandler2 = this.gridOptions[eventHandlerName];
              if (typeof eventHandler2 === "function") {
                this.beans.frameworkOverrides.wrapOutgoing(() => eventHandler2(e));
              }
            };
            if (this.gridReadyFired) {
              fireEvent(eventName, event);
            } else if (eventName === "gridReady") {
              fireEvent(eventName, event);
              this.gridReadyFired = true;
              for (const q of this.queueEvents) {
                fireEvent(q.eventName, q.event);
              }
              this.queueEvents = [];
            } else {
              this.queueEvents.push({ eventName, event });
            }
          };
        };
      }
      wireBeans(beans) {
        this.gridOptions = beans.gridOptions;
        this.validation = beans.validation;
        this.api = beans.gridApi;
        this.gridId = beans.context.getId();
      }
      // This is quicker then having code call gridOptionsService.get('context')
      get gridOptionsContext() {
        return this.gridOptions["context"];
      }
      postConstruct() {
        this.validateGridOptions(this.gridOptions);
        this.eventSvc.addGlobalListener(this.globalEventHandlerFactory().bind(this), true);
        this.eventSvc.addGlobalListener(this.globalEventHandlerFactory(true).bind(this), false);
        this.propEventSvc.setFrameworkOverrides(this.beans.frameworkOverrides);
        this.addManagedEventListeners({
          gridOptionsChanged: ({ options: options2 }) => {
            this.updateGridOptions({ options: options2, force: true, source: "optionsUpdated" });
          }
        });
      }
      destroy() {
        super.destroy();
        this.queueEvents = [];
      }
      /**
       * Get the raw value of the GridOptions property provided.
       * @param property
       */
      get(property2) {
        return this.gridOptions[property2] ?? GRID_OPTION_DEFAULTS[property2];
      }
      /**
       * Get the GridOption callback but wrapped so that the common params of api and context are automatically applied to the params.
       * @param property GridOption callback properties based on the fact that this property has a callback with params extending AgGridCommon
       */
      getCallback(property2) {
        return this.mergeGridCommonParams(this.gridOptions[property2]);
      }
      /**
       * Returns `true` if a value has been specified for this GridOption.
       * @param property GridOption property
       */
      exists(property2) {
        return _exists(this.gridOptions[property2]);
      }
      /**
       * Wrap the user callback and attach the api and context to the params object on the way through.
       * @param callback User provided callback
       * @returns Wrapped callback where the params object not require api and context
       */
      mergeGridCommonParams(callback) {
        if (callback) {
          const wrapped = (callbackParams) => {
            return callback(this.addCommon(callbackParams));
          };
          return wrapped;
        }
        return callback;
      }
      updateGridOptions({
        options: options2,
        force,
        source: source2 = "api"
      }) {
        const changeSet = { id: changeSetId++, properties: [] };
        const events = [];
        const { gridOptions, validation } = this;
        for (const key2 of Object.keys(options2)) {
          const value2 = GlobalGridOptions.applyGlobalGridOption(key2, options2[key2]);
          validation?.warnOnInitialPropertyUpdate(source2, key2);
          const shouldForce = force || typeof value2 === "object" && source2 === "api";
          const previousValue = gridOptions[key2];
          if (shouldForce || previousValue !== value2) {
            gridOptions[key2] = value2;
            const event = {
              type: key2,
              currentValue: value2,
              previousValue,
              changeSet,
              source: source2
            };
            events.push(event);
          }
        }
        this.validateGridOptions(this.gridOptions);
        changeSet.properties = events.map((event) => event.type);
        for (const event of events) {
          _logIfDebug(this, `Updated property ${event.type} from`, event.previousValue, ` to `, event.currentValue);
          this.propEventSvc.dispatchEvent(event);
        }
      }
      addPropertyEventListener(key2, listener) {
        this.propEventSvc.addEventListener(key2, listener);
      }
      removePropertyEventListener(key2, listener) {
        this.propEventSvc.removeEventListener(key2, listener);
      }
      getDomDataKey() {
        return this.domDataKey;
      }
      /** Prefer _addGridCommonParams from gridOptionsUtils for bundle size savings */
      addCommon(params) {
        params.api = this.api;
        params.context = this.gridOptionsContext;
        return params;
      }
      validateOptions(options2, modValidations) {
        for (const key2 of Object.keys(options2)) {
          const value2 = options2[key2];
          if (value2 == null || value2 === false) {
            continue;
          }
          let moduleToCheck = modValidations[key2];
          if (typeof moduleToCheck === "function") {
            moduleToCheck = moduleToCheck(options2, this.gridOptions, this.beans);
          }
          if (moduleToCheck) {
            this.assertModuleRegistered(moduleToCheck, key2);
          }
        }
      }
      validateGridOptions(gridOptions) {
        this.validateOptions(gridOptions, GRID_OPTIONS_MODULES);
        this.validation?.processGridOptions(gridOptions);
      }
      validateColDef(colDef, colId, skipInferenceCheck) {
        if (skipInferenceCheck || !this.beans.dataTypeSvc?.isColPendingInference(colId)) {
          this.validateOptions(colDef, COLUMN_DEFINITION_MOD_VALIDATIONS);
          this.validation?.validateColDef(colDef);
        }
      }
      assertModuleRegistered(moduleName, reasonOrId) {
        const registered = Array.isArray(moduleName) ? moduleName.some((modName) => this.isModuleRegistered(modName)) : this.isModuleRegistered(moduleName);
        if (!registered) {
          _error(200, {
            ...this.getModuleErrorParams(),
            moduleName,
            reasonOrId
          });
        }
        return registered;
      }
      getModuleErrorParams() {
        return {
          gridId: this.gridId,
          gridScoped: _areModulesGridScoped(),
          rowModelType: this.get("rowModelType"),
          isUmd: _isUmd()
        };
      }
      isModuleRegistered(moduleName) {
        return _isModuleRegistered(moduleName, this.gridId, this.get("rowModelType"));
      }
      setInstanceDomData(element) {
        element[GRID_DOM_KEY] = this.instanceId;
      }
      isElementInThisInstance(element) {
        let pointer = element;
        while (pointer) {
          const instanceId = pointer[GRID_DOM_KEY];
          if (_exists(instanceId)) {
            const eventFromThisGrid = instanceId === this.instanceId;
            return eventFromThisGrid;
          }
          pointer = pointer.parentElement;
        }
        return false;
      }
    };
    function isPublicEventHandler(eventName) {
      return !!_PUBLIC_EVENT_HANDLERS_MAP[eventName];
    }
    function getHeaderCompElementParams(includeSortIndicator) {
      const hiddenAttrs = { "aria-hidden": "true" };
      return {
        tag: "div",
        cls: "ag-cell-label-container",
        role: "presentation",
        children: [
          {
            tag: "span",
            ref: "eMenu",
            cls: "ag-header-icon ag-header-cell-menu-button",
            attrs: hiddenAttrs
          },
          {
            tag: "span",
            ref: "eFilterButton",
            cls: "ag-header-icon ag-header-cell-filter-button",
            attrs: hiddenAttrs
          },
          {
            tag: "div",
            ref: "eLabel",
            cls: "ag-header-cell-label",
            role: "presentation",
            children: [
              { tag: "span", ref: "eText", cls: "ag-header-cell-text" },
              {
                tag: "span",
                ref: "eFilter",
                cls: "ag-header-icon ag-header-label-icon ag-filter-icon",
                attrs: hiddenAttrs
              },
              includeSortIndicator ? { tag: "ag-sort-indicator", ref: "eSortIndicator" } : null
            ]
          }
        ]
      };
    }
    var HeaderCompElement = getHeaderCompElementParams(true);
    var HeaderCompElementNoSort = getHeaderCompElementParams(false);
    var HeaderComp = class extends Component {
      constructor() {
        super(...arguments);
        this.eFilter = RefPlaceholder;
        this.eFilterButton = RefPlaceholder;
        this.eSortIndicator = RefPlaceholder;
        this.eMenu = RefPlaceholder;
        this.eLabel = RefPlaceholder;
        this.eText = RefPlaceholder;
        this.eSortOrder = RefPlaceholder;
        this.eSortAsc = RefPlaceholder;
        this.eSortDesc = RefPlaceholder;
        this.eSortMixed = RefPlaceholder;
        this.eSortNone = RefPlaceholder;
        this.isLoadingInnerComponent = false;
      }
      refresh(params) {
        const oldParams = this.params;
        this.params = params;
        if (this.workOutTemplate(params, !!this.beans?.sortSvc) != this.currentTemplate || this.workOutShowMenu() != this.currentShowMenu || params.enableSorting != this.currentSort || this.currentSuppressMenuHide != null && this.shouldSuppressMenuHide() != this.currentSuppressMenuHide || oldParams.enableFilterButton != params.enableFilterButton || oldParams.enableFilterIcon != params.enableFilterIcon) {
          return false;
        }
        if (this.innerHeaderComponent) {
          const mergedParams = { ...params };
          _mergeDeep(mergedParams, params.innerHeaderComponentParams);
          this.innerHeaderComponent.refresh?.(mergedParams);
        } else {
          this.setDisplayName(params);
        }
        return true;
      }
      workOutTemplate(params, isSorting) {
        const paramsTemplate = params.template;
        if (paramsTemplate) {
          return paramsTemplate?.trim ? paramsTemplate.trim() : paramsTemplate;
        } else {
          return isSorting ? HeaderCompElement : HeaderCompElementNoSort;
        }
      }
      init(params) {
        this.params = params;
        const { sortSvc, touchSvc, rowNumbersSvc, userCompFactory } = this.beans;
        const sortComp = sortSvc?.getSortIndicatorSelector();
        this.currentTemplate = this.workOutTemplate(params, !!sortComp);
        this.setTemplate(this.currentTemplate, sortComp ? [sortComp] : void 0);
        touchSvc?.setupForHeader(this);
        this.setMenu();
        this.setupSort();
        rowNumbersSvc?.setupForHeader(this);
        this.setupFilterIcon();
        this.setupFilterButton();
        this.workOutInnerHeaderComponent(userCompFactory, params);
        this.setDisplayName(params);
      }
      workOutInnerHeaderComponent(userCompFactory, params) {
        const userCompDetails = _getInnerHeaderCompDetails(userCompFactory, params, params);
        if (!userCompDetails) {
          return;
        }
        this.isLoadingInnerComponent = true;
        userCompDetails.newAgStackInstance().then((comp2) => {
          this.isLoadingInnerComponent = false;
          if (!comp2) {
            return;
          }
          if (this.isAlive()) {
            this.innerHeaderComponent = comp2;
            if (this.eText) {
              this.eText.appendChild(comp2.getGui());
            }
          } else {
            this.destroyBean(comp2);
          }
        });
      }
      setDisplayName(params) {
        const { displayName } = params;
        const oldDisplayName = this.currentDisplayName;
        this.currentDisplayName = displayName;
        if (!this.eText || oldDisplayName === displayName || this.innerHeaderComponent || this.isLoadingInnerComponent) {
          return;
        }
        this.eText.textContent = _toString(displayName);
      }
      addInIcon(iconName, eParent, column2) {
        const eIcon = _createIconNoSpan(iconName, this.beans, column2);
        if (eIcon) {
          eParent.appendChild(eIcon);
        }
      }
      workOutShowMenu() {
        return this.params.enableMenu && !!this.beans.menuSvc?.isHeaderMenuButtonEnabled();
      }
      shouldSuppressMenuHide() {
        return !!this.beans.menuSvc?.isHeaderMenuButtonAlwaysShowEnabled();
      }
      setMenu() {
        if (!this.eMenu) {
          return;
        }
        this.currentShowMenu = this.workOutShowMenu();
        if (!this.currentShowMenu) {
          _removeFromParent(this.eMenu);
          this.eMenu = void 0;
          return;
        }
        const { gos, eMenu, params } = this;
        const isLegacyMenu = _isLegacyMenuEnabled(gos);
        this.addInIcon(isLegacyMenu ? "menu" : "menuAlt", eMenu, params.column);
        eMenu.classList.toggle("ag-header-menu-icon", !isLegacyMenu);
        const currentSuppressMenuHide = this.shouldSuppressMenuHide();
        this.currentSuppressMenuHide = currentSuppressMenuHide;
        this.addManagedElementListeners(eMenu, { click: () => this.showColumnMenu(this.eMenu) });
        this.toggleMenuAlwaysShow(currentSuppressMenuHide);
      }
      toggleMenuAlwaysShow(alwaysShow) {
        this.eMenu?.classList.toggle("ag-header-menu-always-show", alwaysShow);
      }
      showColumnMenu(element) {
        const { currentSuppressMenuHide, params } = this;
        if (!currentSuppressMenuHide) {
          this.toggleMenuAlwaysShow(true);
        }
        params.showColumnMenu(element, () => {
          if (!currentSuppressMenuHide) {
            this.toggleMenuAlwaysShow(false);
          }
        });
      }
      onMenuKeyboardShortcut(isFilterShortcut) {
        const { params, gos, beans, eMenu, eFilterButton } = this;
        const column2 = params.column;
        const isLegacyMenuEnabled = _isLegacyMenuEnabled(gos);
        if (isFilterShortcut && !isLegacyMenuEnabled) {
          if (beans.menuSvc?.isFilterMenuInHeaderEnabled(column2)) {
            params.showFilter(eFilterButton ?? eMenu ?? this.getGui());
            return true;
          }
        } else if (params.enableMenu) {
          this.showColumnMenu(eMenu ?? eFilterButton ?? this.getGui());
          return true;
        }
        return false;
      }
      setupSort() {
        const { sortSvc } = this.beans;
        if (!sortSvc) {
          return;
        }
        const { enableSorting, column: column2 } = this.params;
        this.currentSort = enableSorting;
        if (!this.eSortIndicator) {
          this.eSortIndicator = this.createBean(sortSvc.createSortIndicator(true));
          const { eSortIndicator, eSortOrder, eSortAsc, eSortDesc, eSortMixed, eSortNone } = this;
          eSortIndicator.attachCustomElements(eSortOrder, eSortAsc, eSortDesc, eSortMixed, eSortNone);
        }
        this.eSortIndicator.setupSort(column2);
        if (!this.currentSort) {
          return;
        }
        sortSvc.setupHeader(this, column2, this.eLabel);
      }
      setupFilterIcon() {
        const { eFilter, params } = this;
        if (!eFilter) {
          return;
        }
        const onFilterChangedIcon = () => {
          const filterPresent = params.column.isFilterActive();
          _setDisplayed(eFilter, filterPresent, { skipAriaHidden: true });
        };
        this.configureFilter(params.enableFilterIcon, eFilter, onFilterChangedIcon, "filterActive");
      }
      setupFilterButton() {
        const { eFilterButton, params } = this;
        if (!eFilterButton) {
          return;
        }
        const configured = this.configureFilter(
          params.enableFilterButton,
          eFilterButton,
          this.onFilterChangedButton.bind(this),
          "filter"
        );
        if (configured) {
          this.addManagedElementListeners(eFilterButton, {
            click: () => params.showFilter(eFilterButton)
          });
        } else {
          this.eFilterButton = void 0;
        }
      }
      configureFilter(enabled, element, filterChangedCallback, icon2) {
        if (!enabled) {
          _removeFromParent(element);
          return false;
        }
        const column2 = this.params.column;
        this.addInIcon(icon2, element, column2);
        this.addManagedListeners(column2, { filterChanged: filterChangedCallback });
        filterChangedCallback();
        return true;
      }
      onFilterChangedButton() {
        const filterPresent = this.params.column.isFilterActive();
        this.eFilterButton.classList.toggle("ag-filter-active", filterPresent);
      }
      getAnchorElementForMenu(isFilter) {
        const { eFilterButton, eMenu } = this;
        if (isFilter) {
          return eFilterButton ?? eMenu ?? this.getGui();
        }
        return eMenu ?? eFilterButton ?? this.getGui();
      }
      destroy() {
        super.destroy();
        if (this.innerHeaderComponent) {
          this.destroyBean(this.innerHeaderComponent);
          this.innerHeaderComponent = void 0;
        }
      }
    };
    var HeaderGroupCompElement = {
      tag: "div",
      cls: "ag-header-group-cell-label",
      role: "presentation",
      children: [
        { tag: "span", ref: "agLabel", cls: "ag-header-group-text", role: "presentation" },
        { tag: "span", ref: "agOpened", cls: `ag-header-icon ag-header-expand-icon ag-header-expand-icon-expanded` },
        { tag: "span", ref: "agClosed", cls: `ag-header-icon ag-header-expand-icon ag-header-expand-icon-collapsed` }
      ]
    };
    var HeaderGroupComp = class extends Component {
      constructor() {
        super(HeaderGroupCompElement);
        this.agOpened = RefPlaceholder;
        this.agClosed = RefPlaceholder;
        this.agLabel = RefPlaceholder;
        this.isLoadingInnerComponent = false;
      }
      init(params) {
        const { userCompFactory, touchSvc } = this.beans;
        this.params = params;
        this.checkWarnings();
        this.workOutInnerHeaderGroupComponent(userCompFactory, params);
        this.setupLabel(params);
        this.addGroupExpandIcon(params);
        this.setupExpandIcons();
        touchSvc?.setupForHeaderGroup(this);
      }
      checkWarnings() {
        const paramsAny = this.params;
        if (paramsAny.template) {
          _warn(89);
        }
      }
      workOutInnerHeaderGroupComponent(userCompFactory, params) {
        const userCompDetails = _getInnerHeaderGroupCompDetails(userCompFactory, params, params);
        if (!userCompDetails) {
          return;
        }
        this.isLoadingInnerComponent = true;
        userCompDetails.newAgStackInstance().then((comp2) => {
          this.isLoadingInnerComponent = false;
          if (!comp2) {
            return;
          }
          if (this.isAlive()) {
            this.innerHeaderGroupComponent = comp2;
            this.agLabel.appendChild(comp2.getGui());
          } else {
            this.destroyBean(comp2);
          }
        });
      }
      setupExpandIcons() {
        const {
          agOpened,
          agClosed,
          params: { columnGroup },
          beans
        } = this;
        this.addInIcon("columnGroupOpened", agOpened);
        this.addInIcon("columnGroupClosed", agClosed);
        const expandAction = (event) => {
          if (_isStopPropagationForAgGrid(event)) {
            return;
          }
          const newExpandedValue = !columnGroup.isExpanded();
          beans.colGroupSvc.setColumnGroupOpened(
            columnGroup.getProvidedColumnGroup(),
            newExpandedValue,
            "uiColumnExpanded"
          );
        };
        this.addTouchAndClickListeners(beans, agClosed, expandAction);
        this.addTouchAndClickListeners(beans, agOpened, expandAction);
        const stopPropagationAction = (event) => {
          _stopPropagationForAgGrid(event);
        };
        this.addManagedElementListeners(agClosed, { dblclick: stopPropagationAction });
        this.addManagedElementListeners(agOpened, { dblclick: stopPropagationAction });
        this.addManagedElementListeners(this.getGui(), { dblclick: expandAction });
        this.updateIconVisibility();
        const providedColumnGroup = columnGroup.getProvidedColumnGroup();
        const updateIcon = this.updateIconVisibility.bind(this);
        this.addManagedListeners(providedColumnGroup, {
          expandedChanged: updateIcon,
          expandableChanged: updateIcon
        });
      }
      addTouchAndClickListeners(beans, eElement, action) {
        beans.touchSvc?.setupForHeaderGroupElement(this, eElement, action);
        this.addManagedElementListeners(eElement, { click: action });
      }
      updateIconVisibility() {
        const {
          agOpened,
          agClosed,
          params: { columnGroup }
        } = this;
        if (columnGroup.isExpandable()) {
          const expanded = columnGroup.isExpanded();
          _setDisplayed(agOpened, expanded);
          _setDisplayed(agClosed, !expanded);
        } else {
          _setDisplayed(agOpened, false);
          _setDisplayed(agClosed, false);
        }
      }
      addInIcon(iconName, element) {
        const eIcon = _createIconNoSpan(iconName, this.beans, null);
        if (eIcon) {
          element.appendChild(eIcon);
        }
      }
      addGroupExpandIcon(params) {
        if (!params.columnGroup.isExpandable()) {
          const { agOpened, agClosed } = this;
          _setDisplayed(agOpened, false);
          _setDisplayed(agClosed, false);
        }
      }
      setupLabel(params) {
        const { displayName, columnGroup } = params;
        const hasInnerComponent = this.innerHeaderGroupComponent || this.isLoadingInnerComponent;
        if (_exists(displayName) && !hasInnerComponent) {
          this.agLabel.textContent = _toString(displayName);
        }
        this.toggleCss("ag-sticky-label", !columnGroup.getColGroupDef()?.suppressStickyLabel);
      }
      destroy() {
        super.destroy();
        if (this.innerHeaderGroupComponent) {
          this.destroyBean(this.innerHeaderGroupComponent);
          this.innerHeaderGroupComponent = void 0;
        }
      }
    };
    var ColumnHeaderCompModule = {
      moduleName: "ColumnHeaderComp",
      version: VERSION,
      userComponents: {
        agColumnHeader: HeaderComp
      },
      icons: {
        // button to launch legacy column menu
        menu: "menu",
        // button to launch new enterprise column menu
        menuAlt: "menu-alt"
      }
    };
    var ColumnGroupHeaderCompModule = {
      moduleName: "ColumnGroupHeaderComp",
      version: VERSION,
      userComponents: {
        agColumnGroupHeader: HeaderGroupComp
      },
      icons: {
        // header column group shown when expanded (click to contract)
        columnGroupOpened: "expanded",
        // header column group shown when contracted (click to expand)
        columnGroupClosed: "contracted"
      }
    };
    var AnimationFrameService = class extends BeanStub {
      constructor() {
        super(...arguments);
        this.beanName = "animationFrameSvc";
        this.p1 = { list: [], sorted: false };
        this.p2 = { list: [], sorted: false };
        this.f1 = { list: [], sorted: false };
        this.destroyTasks = [];
        this.ticking = false;
        this.scrollGoingDown = true;
        this.lastScrollTop = 0;
        this.taskCount = 0;
      }
      setScrollTop(scrollTop) {
        this.scrollGoingDown = scrollTop >= this.lastScrollTop;
        if (scrollTop === 0) {
          this.scrollGoingDown = true;
        }
        this.lastScrollTop = scrollTop;
      }
      postConstruct() {
        this.active = !this.gos.get("suppressAnimationFrame");
        this.batchFrameworkComps = this.beans.frameworkOverrides.batchFrameworkComps;
      }
      // this method is for our AG Grid sanity only - if animation frames are turned off,
      // then no place in the code should be looking to add any work to be done in animation
      // frames. this stops bugs - where some code is asking for a frame to be executed
      // when it should not.
      verify() {
        if (this.active === false) {
          _warn(92);
        }
      }
      createTask(task, index, list2, isFramework, isDeferred = false) {
        this.verify();
        let taskList = list2;
        if (isFramework && this.batchFrameworkComps) {
          taskList = "f1";
        }
        const taskItem = { task, index, createOrder: ++this.taskCount, deferred: isDeferred };
        this.addTaskToList(this[taskList], taskItem);
        this.schedule();
      }
      addTaskToList(taskList, task) {
        taskList.list.push(task);
        taskList.sorted = false;
      }
      sortTaskList(taskList) {
        if (taskList.sorted) {
          return;
        }
        const sortDirection = this.scrollGoingDown ? 1 : -1;
        taskList.list.sort((a, b) => {
          if (a.deferred !== b.deferred) {
            return a.deferred ? -1 : 1;
          }
          if (a.index !== b.index) {
            return sortDirection * (b.index - a.index);
          }
          return b.createOrder - a.createOrder;
        });
        taskList.sorted = true;
      }
      addDestroyTask(task) {
        this.verify();
        this.destroyTasks.push(task);
        this.schedule();
      }
      executeFrame(millis) {
        const { p1, p2, f1, destroyTasks, beans } = this;
        const { ctrlsSvc, frameworkOverrides } = beans;
        const p1Tasks = p1.list;
        const p2Tasks = p2.list;
        const f1Tasks = f1.list;
        const frameStart = Date.now();
        let duration = 0;
        const noMaxMillis = millis <= 0;
        const scrollFeature = ctrlsSvc.getScrollFeature();
        while (noMaxMillis || duration < millis) {
          const gridBodyDidSomething = scrollFeature.scrollGridIfNeeded();
          if (!gridBodyDidSomething) {
            let task;
            if (p1Tasks.length) {
              this.sortTaskList(p1);
              task = p1Tasks.pop().task;
            } else if (p2Tasks.length) {
              this.sortTaskList(p2);
              task = p2Tasks.pop().task;
            } else if (f1Tasks.length) {
              frameworkOverrides.wrapOutgoing(() => {
                while (noMaxMillis || duration < millis) {
                  const gridBodyDidSomething2 = scrollFeature.scrollGridIfNeeded();
                  if (!gridBodyDidSomething2) {
                    if (f1Tasks.length) {
                      this.sortTaskList(f1);
                      task = f1Tasks.pop().task;
                      task();
                    } else {
                      break;
                    }
                  } else {
                    break;
                  }
                  duration = Date.now() - frameStart;
                }
              });
              task = () => {
              };
            } else if (destroyTasks.length) {
              task = destroyTasks.pop();
            } else {
              break;
            }
            task();
          }
          duration = Date.now() - frameStart;
        }
        if (p1Tasks.length || p2Tasks.length || f1Tasks.length || destroyTasks.length) {
          this.requestFrame();
        } else {
          this.ticking = false;
        }
      }
      flushAllFrames() {
        if (!this.active) {
          return;
        }
        this.executeFrame(-1);
      }
      schedule() {
        if (!this.active) {
          return;
        }
        if (!this.ticking) {
          this.ticking = true;
          this.requestFrame();
        }
      }
      requestFrame() {
        const callback = this.executeFrame.bind(this, 60);
        _requestAnimationFrame(this.beans, callback);
      }
      isQueueEmpty() {
        return !this.ticking;
      }
    };
    var AnimationFrameModule = {
      moduleName: "AnimationFrame",
      version: VERSION,
      beans: [AnimationFrameService]
    };
    var IconService = class extends BeanStub {
      constructor() {
        super(...arguments);
        this.beanName = "iconSvc";
      }
      createIconNoSpan(iconName, params) {
        return _createIconNoSpan(iconName, this.beans, params?.column);
      }
    };
    var TouchService = class extends BeanStub {
      constructor() {
        super(...arguments);
        this.beanName = "touchSvc";
      }
      mockBodyContextMenu(ctrl, listener) {
        this.mockContextMenu(ctrl, ctrl.eBodyViewport, listener);
      }
      mockHeaderContextMenu(ctrl, listener) {
        this.mockContextMenu(ctrl, ctrl.eGui, listener);
      }
      mockRowContextMenu(ctrl) {
        if (!_isIOSUserAgent()) {
          return;
        }
        const listener = (mouseListener, touch, touchEvent) => {
          const { rowCtrl, cellCtrl } = ctrl.getControlsForEventTarget(touchEvent?.target ?? null);
          if (cellCtrl?.column) {
            cellCtrl.dispatchCellContextMenuEvent(touchEvent ?? null);
          }
          this.beans.contextMenuSvc?.handleContextMenuMouseEvent(void 0, touchEvent, rowCtrl, cellCtrl);
        };
        this.mockContextMenu(ctrl, ctrl.element, listener);
      }
      handleCellDoubleClick(ctrl, mouseEvent) {
        const isDoubleClickOnIPad = () => {
          if (!_isIOSUserAgent() || _isEventSupported("dblclick")) {
            return false;
          }
          const nowMillis = Date.now();
          const res = nowMillis - ctrl.lastIPadMouseClickEvent < 200;
          ctrl.lastIPadMouseClickEvent = nowMillis;
          return res;
        };
        if (isDoubleClickOnIPad()) {
          ctrl.onCellDoubleClicked(mouseEvent);
          mouseEvent.preventDefault();
          return true;
        }
        return false;
      }
      setupForHeader(comp2) {
        const { gos, sortSvc, menuSvc } = this.beans;
        if (gos.get("suppressTouch")) {
          return;
        }
        const { params, eMenu, eFilterButton } = comp2;
        const touchListener = new TouchListener(comp2.getGui(), true);
        comp2.addDestroyFunc(() => touchListener.destroy());
        const suppressMenuHide = comp2.shouldSuppressMenuHide();
        const tapMenuButton = suppressMenuHide && _exists(eMenu) && params.enableMenu;
        let menuTouchListener = touchListener;
        if (tapMenuButton) {
          menuTouchListener = new TouchListener(eMenu, true);
          comp2.addDestroyFunc(() => menuTouchListener.destroy());
        }
        if (params.enableMenu || menuSvc?.isHeaderContextMenuEnabled(params.column)) {
          const eventType = tapMenuButton ? "tap" : "longTap";
          const showMenuFn = (event) => params.showColumnMenuAfterMouseClick(event.touchStart);
          comp2.addManagedListeners(menuTouchListener, { [eventType]: showMenuFn });
          comp2.addManagedListeners(touchListener, { longTap: showMenuFn });
        }
        if (params.enableSorting) {
          const tapListener = (event) => {
            const target2 = event.touchStart.target;
            if (suppressMenuHide && (eMenu?.contains(target2) || eFilterButton?.contains(target2))) {
              return;
            }
            sortSvc?.progressSort(params.column, false, "uiColumnSorted");
          };
          comp2.addManagedListeners(touchListener, { tap: tapListener });
        }
        if (params.enableFilterButton && eFilterButton) {
          const filterButtonTouchListener = new TouchListener(eFilterButton, true);
          comp2.addManagedListeners(filterButtonTouchListener, {
            tap: () => params.showFilter(eFilterButton)
          });
          comp2.addDestroyFunc(() => filterButtonTouchListener.destroy());
        }
      }
      setupForHeaderGroup(comp2) {
        const params = comp2.params;
        if (this.beans.menuSvc?.isHeaderContextMenuEnabled(
          params.columnGroup.getProvidedColumnGroup()
        )) {
          const touchListener = new TouchListener(params.eGridHeader, true);
          const showMenuFn = (event) => params.showColumnMenuAfterMouseClick(event.touchStart);
          comp2.addManagedListeners(touchListener, { longTap: showMenuFn });
          comp2.addDestroyFunc(() => touchListener.destroy());
        }
      }
      setupForHeaderGroupElement(comp2, eElement, action) {
        const touchListener = new TouchListener(eElement, true);
        comp2.addManagedListeners(touchListener, { tap: action });
        comp2.addDestroyFunc(() => touchListener.destroy());
      }
      mockContextMenu(ctrl, element, listener) {
        if (!_isIOSUserAgent()) {
          return;
        }
        const touchListener = new TouchListener(element);
        const longTapListener = (event) => {
          if (!_isEventFromThisInstance(this.beans, event.touchEvent)) {
            return;
          }
          listener(void 0, event.touchStart, event.touchEvent);
        };
        ctrl.addManagedListeners(touchListener, { longTap: longTapListener });
        ctrl.addDestroyFunc(() => touchListener.destroy());
      }
    };
    var TouchModule = {
      moduleName: "Touch",
      version: VERSION,
      beans: [TouchService]
    };
    var CellNavigationService = class extends BeanStub {
      constructor() {
        super(...arguments);
        this.beanName = "cellNavigation";
      }
      wireBeans(beans) {
        this.rowSpanSvc = beans.rowSpanSvc;
      }
      // returns null if no cell to focus on, ie at the end of the grid
      getNextCellToFocus(key2, focusedCell, ctrlPressed = false) {
        if (ctrlPressed) {
          return this.getNextCellToFocusWithCtrlPressed(key2, focusedCell);
        }
        return this.getNextCellToFocusWithoutCtrlPressed(key2, focusedCell);
      }
      getNextCellToFocusWithCtrlPressed(key2, focusedCell) {
        const upKey = key2 === KeyCode.UP;
        const downKey = key2 === KeyCode.DOWN;
        const leftKey = key2 === KeyCode.LEFT;
        let column2;
        let rowIndex;
        const { pageBounds, gos, visibleCols, pinnedRowModel } = this.beans;
        const { rowPinned } = focusedCell;
        if (upKey || downKey) {
          if (rowPinned && pinnedRowModel) {
            if (upKey) {
              rowIndex = 0;
            } else {
              rowIndex = rowPinned === "top" ? pinnedRowModel.getPinnedTopRowCount() - 1 : pinnedRowModel.getPinnedBottomRowCount() - 1;
            }
          } else {
            rowIndex = upKey ? pageBounds.getFirstRow() : pageBounds.getLastRow();
          }
          column2 = focusedCell.column;
        } else {
          const isRtl = gos.get("enableRtl");
          rowIndex = focusedCell.rowIndex;
          const allColumns = leftKey !== isRtl ? visibleCols.allCols : [...visibleCols.allCols].reverse();
          column2 = allColumns.find(
            (col) => this.isCellGoodToFocusOn({
              rowIndex,
              rowPinned: null,
              column: col
            })
          );
        }
        return column2 ? {
          rowIndex,
          rowPinned,
          column: column2
        } : null;
      }
      getNextCellToFocusWithoutCtrlPressed(key2, focusedCell) {
        let pointer = focusedCell;
        let finished = false;
        while (!finished) {
          switch (key2) {
            case KeyCode.UP:
              pointer = this.getCellAbove(pointer);
              break;
            case KeyCode.DOWN:
              pointer = this.getCellBelow(pointer);
              break;
            case KeyCode.RIGHT:
              pointer = this.gos.get("enableRtl") ? this.getCellToLeft(pointer) : this.getCellToRight(pointer);
              break;
            case KeyCode.LEFT:
              pointer = this.gos.get("enableRtl") ? this.getCellToRight(pointer) : this.getCellToLeft(pointer);
              break;
            default:
              pointer = null;
              _warn(8, { key: key2 });
              break;
          }
          if (pointer) {
            finished = this.isCellGoodToFocusOn(pointer);
          } else {
            finished = true;
          }
        }
        return pointer;
      }
      isCellGoodToFocusOn(gridCell) {
        const column2 = gridCell.column;
        let rowNode;
        const { pinnedRowModel, rowModel } = this.beans;
        switch (gridCell.rowPinned) {
          case "top":
            rowNode = pinnedRowModel?.getPinnedTopRow(gridCell.rowIndex);
            break;
          case "bottom":
            rowNode = pinnedRowModel?.getPinnedBottomRow(gridCell.rowIndex);
            break;
          default:
            rowNode = rowModel.getRow(gridCell.rowIndex);
            break;
        }
        if (!rowNode) {
          return false;
        }
        const suppressNavigable = this.isSuppressNavigable(column2, rowNode);
        return !suppressNavigable;
      }
      getCellToLeft(lastCell) {
        if (!lastCell) {
          return null;
        }
        const colToLeft = this.beans.visibleCols.getColBefore(lastCell.column);
        if (!colToLeft) {
          return null;
        }
        return {
          rowIndex: lastCell.rowIndex,
          column: colToLeft,
          rowPinned: lastCell.rowPinned
        };
      }
      getCellToRight(lastCell) {
        if (!lastCell) {
          return null;
        }
        const colToRight = this.beans.visibleCols.getColAfter(lastCell.column);
        if (!colToRight) {
          return null;
        }
        return {
          rowIndex: lastCell.rowIndex,
          column: colToRight,
          rowPinned: lastCell.rowPinned
        };
      }
      getCellBelow(lastCell) {
        if (!lastCell) {
          return null;
        }
        const adjustedLastCell = this.rowSpanSvc?.getCellEnd(lastCell) ?? lastCell;
        const rowBelow = _getRowBelow(this.beans, adjustedLastCell, true);
        if (rowBelow) {
          return {
            rowIndex: rowBelow.rowIndex,
            column: lastCell.column,
            rowPinned: rowBelow.rowPinned
          };
        }
        return null;
      }
      getCellAbove(lastCell) {
        if (!lastCell) {
          return null;
        }
        const adjustedLastCell = this.rowSpanSvc?.getCellStart(lastCell) ?? lastCell;
        const rowAbove = _getRowAbove(
          this.beans,
          {
            rowIndex: adjustedLastCell.rowIndex,
            rowPinned: adjustedLastCell.rowPinned
          },
          true
        );
        if (rowAbove) {
          return {
            rowIndex: rowAbove.rowIndex,
            column: lastCell.column,
            rowPinned: rowAbove.rowPinned
          };
        }
        return null;
      }
      getNextTabbedCell(gridCell, backwards) {
        if (backwards) {
          return this.getNextTabbedCellBackwards(gridCell);
        }
        return this.getNextTabbedCellForwards(gridCell);
      }
      getNextTabbedCellForwards(gridCell) {
        const { visibleCols, pagination } = this.beans;
        const displayedColumns = visibleCols.allCols;
        let newRowIndex = gridCell.rowIndex;
        let newFloating = gridCell.rowPinned;
        let newColumn = visibleCols.getColAfter(gridCell.column);
        if (!newColumn) {
          newColumn = displayedColumns[0];
          const rowBelow = _getRowBelow(this.beans, gridCell, true);
          if (_missing(rowBelow)) {
            return null;
          }
          if (!rowBelow.rowPinned && !(pagination?.isRowInPage(rowBelow.rowIndex) ?? true)) {
            return null;
          }
          newRowIndex = rowBelow ? rowBelow.rowIndex : null;
          newFloating = rowBelow ? rowBelow.rowPinned : null;
        }
        return { rowIndex: newRowIndex, column: newColumn, rowPinned: newFloating };
      }
      getNextTabbedCellBackwards(gridCell) {
        const { beans } = this;
        const { visibleCols, pagination } = beans;
        const displayedColumns = visibleCols.allCols;
        let newRowIndex = gridCell.rowIndex;
        let newFloating = gridCell.rowPinned;
        let newColumn = visibleCols.getColBefore(gridCell.column);
        if (!newColumn) {
          newColumn = _last(displayedColumns);
          const rowAbove = _getRowAbove(beans, { rowIndex: gridCell.rowIndex, rowPinned: gridCell.rowPinned }, true);
          if (_missing(rowAbove)) {
            return null;
          }
          if (!rowAbove.rowPinned && !(pagination?.isRowInPage(rowAbove.rowIndex) ?? true)) {
            return null;
          }
          newRowIndex = rowAbove ? rowAbove.rowIndex : null;
          newFloating = rowAbove ? rowAbove.rowPinned : null;
        }
        return { rowIndex: newRowIndex, column: newColumn, rowPinned: newFloating };
      }
      isSuppressNavigable(column2, rowNode) {
        const { suppressNavigable } = column2.colDef;
        if (typeof suppressNavigable === "boolean") {
          return suppressNavigable;
        }
        if (typeof suppressNavigable === "function") {
          const params = column2.createColumnFunctionCallbackParams(rowNode);
          const userFunc = suppressNavigable;
          return userFunc(params);
        }
        return false;
      }
    };
    function getFocusedCell(beans) {
      return beans.focusSvc.getFocusedCell();
    }
    function clearFocusedCell(beans) {
      return beans.focusSvc.clearFocusedCell();
    }
    function setFocusedCell(beans, rowIndex, colKey, rowPinned) {
      beans.focusSvc.setFocusedCell({ rowIndex, column: colKey, rowPinned, forceBrowserFocus: true });
    }
    function tabToNextCell(beans, event) {
      return beans.navigation?.tabToNextCell(false, event) ?? false;
    }
    function tabToPreviousCell(beans, event) {
      return beans.navigation?.tabToNextCell(true, event) ?? false;
    }
    function setFocusedHeader(beans, colKey, floatingFilter = false) {
      const headerPosition = beans.headerNavigation?.getHeaderPositionForColumn(colKey, floatingFilter);
      if (!headerPosition) {
        return;
      }
      beans.focusSvc.focusHeaderPosition({ headerPosition });
    }
    var EditModelService = class extends BeanStub {
      constructor() {
        super(...arguments);
        this.beanName = "editModelSvc";
        this.edits = /* @__PURE__ */ new Map();
        this.cellValidations = new EditCellValidationModel();
        this.rowValidations = new EditRowValidationModel();
        this.suspendEdits = false;
      }
      suspend(suspend) {
        this.suspendEdits = suspend;
      }
      removeEdits({ rowNode, column: column2 }) {
        if (!this.hasEdits({ rowNode }) || !rowNode) {
          return;
        }
        const editRow = this.getEditRow(rowNode);
        if (column2) {
          editRow.delete(column2);
        } else {
          editRow.clear();
        }
        if (editRow.size === 0) {
          this.edits.delete(rowNode);
        }
      }
      getEditRow(rowNode, params = {}) {
        if (this.suspendEdits) {
          return void 0;
        }
        if (this.edits.size === 0) {
          return void 0;
        }
        const edits = rowNode && this.edits.get(rowNode);
        if (edits) {
          return edits;
        }
        if (params.checkSiblings) {
          const pinnedSibling = rowNode.pinnedSibling;
          if (pinnedSibling) {
            return this.getEditRow(pinnedSibling);
          }
        }
        return void 0;
      }
      getEditRowDataValue(rowNode, { checkSiblings } = {}) {
        if (!rowNode || this.edits.size === 0) {
          return void 0;
        }
        const editRow = this.getEditRow(rowNode);
        const pinnedSibling = rowNode.pinnedSibling;
        const siblingRow = checkSiblings && pinnedSibling && this.getEditRow(pinnedSibling);
        if (!editRow && !siblingRow) {
          return void 0;
        }
        const data = Object.assign({}, rowNode.data);
        const applyEdits = (edits, data2) => edits.forEach(({ pendingValue }, column2) => {
          if (pendingValue !== UNEDITED) {
            data2[column2.getColId()] = pendingValue;
          }
        });
        if (editRow) {
          applyEdits(editRow, data);
        }
        if (siblingRow) {
          applyEdits(siblingRow, data);
        }
        return data;
      }
      getEdit(position, copy2) {
        const edit = this._getEdit(position);
        return copy2 && edit ? { ...edit } : edit;
      }
      _getEdit(position) {
        if (this.suspendEdits) {
          return void 0;
        }
        if (this.edits.size === 0) {
          return void 0;
        }
        return position.rowNode && position.column && this.getEditRow(position.rowNode)?.get(position.column);
      }
      getEditMap(copy2 = true) {
        if (this.suspendEdits || this.edits.size === 0) {
          return /* @__PURE__ */ new Map();
        }
        if (!copy2) {
          return this.edits;
        }
        const map2 = /* @__PURE__ */ new Map();
        this.edits.forEach((editRow, rowNode) => {
          const newEditRow = /* @__PURE__ */ new Map();
          editRow.forEach(
            ({ editorState: _, ...cellData }, column2) => (
              // Ensure we copy the cell data to avoid reference issues
              newEditRow.set(column2, { ...cellData })
            )
          );
          map2.set(rowNode, newEditRow);
        });
        return map2;
      }
      setEditMap(newEdits) {
        this.edits.clear();
        newEdits.forEach((editRow, rowNode) => {
          const newRow = /* @__PURE__ */ new Map();
          editRow.forEach(
            (cellData, column2) => (
              // Ensure we copy the cell data to avoid reference issues
              newRow.set(column2, { ...cellData })
            )
          );
          this.edits.set(rowNode, newRow);
        });
      }
      setEdit(position, edit) {
        (this.edits.size === 0 || !this.edits.has(position.rowNode)) && this.edits.set(position.rowNode, /* @__PURE__ */ new Map());
        const currentEdit = this._getEdit(position);
        const updatedEdit = Object.assign({
          editorState: {
            isCancelAfterEnd: void 0,
            isCancelBeforeStart: void 0
          },
          ...currentEdit,
          ...edit
        });
        this.getEditRow(position.rowNode).set(position.column, updatedEdit);
        return updatedEdit;
      }
      clearEditValue(position) {
        const { rowNode, column: column2 } = position;
        if (rowNode) {
          if (column2) {
            const edit = this._getEdit(position);
            if (edit) {
              edit.editorValue = void 0;
              edit.pendingValue = edit.sourceValue;
              edit.state = "changed";
            }
          } else {
            this.getEditRow(rowNode)?.forEach((cellData) => {
              cellData.editorValue = void 0;
              cellData.pendingValue = cellData.sourceValue;
              cellData.state = "changed";
            });
          }
        }
      }
      getState(position) {
        if (this.suspendEdits) {
          return void 0;
        }
        return this.getEdit(position)?.state;
      }
      getEditPositions(editMap) {
        if (this.suspendEdits || (editMap ?? this.edits).size === 0) {
          return [];
        }
        const positions = [];
        (editMap ?? this.edits).forEach((editRow, rowNode) => {
          for (const column2 of editRow.keys()) {
            const { editorState: _, ...rest } = editRow.get(column2);
            positions.push({
              rowNode,
              column: column2,
              ...rest
            });
          }
        });
        return positions;
      }
      hasRowEdits(rowNode, params) {
        if (this.suspendEdits) {
          return false;
        }
        if (this.edits.size === 0) {
          return false;
        }
        const rowEdits = this.getEditRow(rowNode, params);
        return !!rowEdits;
      }
      hasEdits(position = {}, params = {}) {
        if (this.suspendEdits) {
          return false;
        }
        if (this.edits.size === 0) {
          return false;
        }
        const { rowNode, column: column2 } = position;
        const { withOpenEditor } = params;
        if (rowNode) {
          const rowEdits = this.getEditRow(rowNode, params);
          if (!rowEdits) {
            return false;
          }
          if (column2) {
            if (withOpenEditor) {
              return this.getEdit(position)?.state === "editing";
            }
            return rowEdits.has(column2) ?? false;
          }
          if (rowEdits.size !== 0) {
            if (withOpenEditor) {
              return Array.from(rowEdits.values()).some(({ state }) => state === "editing");
            }
            return true;
          }
          return false;
        }
        if (withOpenEditor) {
          return this.getEditPositions().some(({ state }) => state === "editing");
        }
        return this.edits.size > 0;
      }
      start(position) {
        const map2 = this.getEditRow(position.rowNode) ?? /* @__PURE__ */ new Map();
        const { rowNode, column: column2 } = position;
        if (column2 && !map2.has(column2)) {
          map2.set(column2, {
            editorValue: void 0,
            pendingValue: UNEDITED,
            sourceValue: this.beans.valueSvc.getValue(column2, rowNode, false, "api"),
            state: "editing",
            editorState: {
              isCancelAfterEnd: void 0,
              isCancelBeforeStart: void 0
            }
          });
        }
        this.edits.set(rowNode, map2);
      }
      stop(position) {
        if (!this.hasEdits(position)) {
          return;
        }
        if (position) {
          this.removeEdits(position);
        } else {
          this.clear();
        }
      }
      clear() {
        for (const pendingRowEdits of this.edits.values()) {
          pendingRowEdits.clear();
        }
        this.edits.clear();
      }
      getCellValidationModel() {
        return this.cellValidations;
      }
      getRowValidationModel() {
        return this.rowValidations;
      }
      setCellValidationModel(model2) {
        this.cellValidations = model2;
      }
      setRowValidationModel(model2) {
        this.rowValidations = model2;
      }
      destroy() {
        super.destroy();
        this.clear();
      }
    };
    var EditCellValidationModel = class {
      constructor() {
        this.cellValidations = /* @__PURE__ */ new Map();
      }
      getCellValidation(position) {
        const { rowNode, column: column2 } = position || {};
        return this.cellValidations?.get(rowNode)?.get(column2);
      }
      hasCellValidation(position) {
        if (!position?.rowNode || !position.column) {
          return this.cellValidations.size > 0;
        }
        return !!this.getCellValidation(position);
      }
      setCellValidation(position, validation) {
        const { rowNode, column: column2 } = position;
        if (!this.cellValidations.has(rowNode)) {
          this.cellValidations.set(rowNode, /* @__PURE__ */ new Map());
        }
        this.cellValidations.get(rowNode).set(column2, validation);
      }
      clearCellValidation(position) {
        const { rowNode, column: column2 } = position;
        this.cellValidations.get(rowNode)?.delete(column2);
      }
      setCellValidationMap(validationMap) {
        this.cellValidations = validationMap;
      }
      getCellValidationMap() {
        return this.cellValidations;
      }
      clearCellValidationMap() {
        this.cellValidations.clear();
      }
    };
    var EditRowValidationModel = class {
      constructor() {
        this.rowValidations = /* @__PURE__ */ new Map();
      }
      getRowValidation(position) {
        const { rowNode } = position || {};
        return this.rowValidations.get(rowNode);
      }
      hasRowValidation(position) {
        if (!position?.rowNode) {
          return this.rowValidations.size > 0;
        }
        return !!this.getRowValidation(position);
      }
      setRowValidation({ rowNode }, rowValidation) {
        this.rowValidations.set(rowNode, rowValidation);
      }
      clearRowValidation({ rowNode }) {
        this.rowValidations.delete(rowNode);
      }
      setRowValidationMap(validationMap) {
        this.rowValidations = validationMap;
      }
      getRowValidationMap() {
        return this.rowValidations;
      }
      clearRowValidationMap() {
        this.rowValidations.clear();
      }
    };
    function _getRowCtrl(beans, inputs = {}) {
      const { rowIndex, rowId, rowCtrl, rowPinned } = inputs;
      if (rowCtrl) {
        return rowCtrl;
      }
      const { rowModel, rowRenderer } = beans;
      let { rowNode } = inputs;
      if (!rowNode) {
        if (rowId) {
          rowNode = _getRowById(beans, rowId, rowPinned);
        } else if (rowIndex != null) {
          rowNode = rowModel.getRow(rowIndex);
        }
      }
      return rowRenderer.getRowCtrls(rowNode ? [rowNode] : [])?.[0];
    }
    function _getCellCtrl(beans, inputs = {}) {
      const { cellCtrl, colId, columnId, column: column2 } = inputs;
      if (cellCtrl) {
        return cellCtrl;
      }
      const actualColumn = beans.colModel.getCol(colId ?? columnId ?? _getColId(column2));
      const rowCtrl = inputs.rowCtrl ?? _getRowCtrl(beans, inputs);
      const result2 = rowCtrl?.getCellCtrl(actualColumn) ?? void 0;
      if (result2) {
        return result2;
      }
      const rowNode = inputs.rowNode ?? rowCtrl?.rowNode;
      if (rowNode) {
        return beans.rowRenderer.getCellCtrls([rowNode], [actualColumn])?.[0];
      }
      return void 0;
    }
    function _stopEditing(beans) {
      const { editSvc } = beans;
      if (editSvc?.isBatchEditing()) {
        _destroyEditors(beans);
      } else {
        editSvc?.stopEditing(void 0, { source: "api" });
      }
    }
    function _addStopEditingWhenGridLosesFocus(bean, beans, viewports) {
      const { gos, popupSvc } = beans;
      if (!gos.get("stopEditingWhenCellsLoseFocus")) {
        return;
      }
      const focusOutListener = (event) => {
        const elementWithFocus = event.relatedTarget;
        if (_getTabIndex(elementWithFocus) === null) {
          _stopEditing(beans);
          return;
        }
        let clickInsideGrid = (
          // see if click came from inside the viewports
          viewports.some((viewport2) => viewport2.contains(elementWithFocus)) && // and also that it's not from a detail grid
          gos.isElementInThisInstance(elementWithFocus)
        );
        if (!clickInsideGrid) {
          clickInsideGrid = !!popupSvc && (popupSvc.getActivePopups().some((popup) => popup.contains(elementWithFocus)) || popupSvc.isElementWithinCustomPopup(elementWithFocus));
        }
        if (!clickInsideGrid) {
          _stopEditing(beans);
        }
      };
      for (const viewport2 of viewports) {
        bean.addManagedElementListeners(viewport2, { focusout: focusOutListener });
      }
    }
    function _getColId(column2) {
      if (!column2) {
        return void 0;
      }
      if (typeof column2 === "string") {
        return column2;
      }
      return column2.getColId();
    }
    var UNEDITED = Symbol("unedited");
    function getCellEditorInstanceMap(beans, params = {}) {
      const res = [];
      const ctrls = beans.rowRenderer.getCellCtrls(params.rowNodes, params.columns);
      for (const ctrl of ctrls) {
        const cellEditor = ctrl.comp?.getCellEditor();
        if (cellEditor) {
          res.push({
            ctrl,
            editor: _unwrapUserComp(cellEditor)
          });
        }
      }
      return res;
    }
    var getCellEditorInstances = (beans, params = {}) => getCellEditorInstanceMap(beans, params).map((res) => res.editor);
    function _setupEditors(beans, editingCells, position, key2, event, cellStartedEdit) {
      if (editingCells.length === 0 && position?.rowNode && position?.column) {
        _setupEditor(beans, position, { key: key2, event, cellStartedEdit });
      }
      const { valueSvc, editSvc, editModelSvc } = beans;
      const { rowNode, column: column2 } = position ?? {};
      for (const cellPosition of editingCells) {
        const { rowNode: cellRowNode, column: cellColumn } = cellPosition;
        const curCellCtrl = _getCellCtrl(beans, cellPosition);
        if (!curCellCtrl) {
          if (cellRowNode && cellColumn) {
            const oldValue = valueSvc.getValue(cellColumn, cellRowNode, void 0, "api");
            const isNewValueCell = position?.rowNode === cellRowNode && position?.column === cellColumn;
            const cellStartValue = isNewValueCell && key2 || void 0;
            const newValue = cellStartValue ?? editSvc?.getCellDataValue(cellPosition, false) ?? valueSvc.getValueForDisplay(cellColumn, cellRowNode)?.value ?? oldValue ?? UNEDITED;
            editModelSvc?.setEdit(cellPosition, {
              pendingValue: newValue,
              sourceValue: oldValue,
              state: "editing"
            });
          }
          continue;
        }
        const shouldStartEditing2 = cellStartedEdit && rowNode === curCellCtrl.rowNode && curCellCtrl.column === column2;
        _setupEditor(
          beans,
          { rowNode, column: curCellCtrl.column },
          {
            key: shouldStartEditing2 ? key2 : null,
            event: shouldStartEditing2 ? event : null,
            cellStartedEdit: shouldStartEditing2 && cellStartedEdit
          }
        );
      }
    }
    function _sourceAndPendingDiffer({
      pendingValue,
      sourceValue
    }) {
      if (pendingValue === UNEDITED) {
        pendingValue = sourceValue;
      }
      return pendingValue !== sourceValue;
    }
    function _setupEditor(beans, position, params) {
      const enableGroupEditing = beans.gos.get("enableGroupEdit");
      const { key: key2, event, cellStartedEdit, silent } = params ?? {};
      const cellCtrl = _getCellCtrl(beans, position);
      const editorComp = cellCtrl?.comp?.getCellEditor();
      const editorParams = _createEditorParams(beans, position, key2, cellStartedEdit && !silent);
      const previousEdit = beans.editModelSvc?.getEdit(position);
      let newValue = editorParams.value;
      if (newValue === void 0) {
        newValue = previousEdit?.sourceValue;
      }
      beans.editModelSvc?.setEdit(position, {
        editorValue: newValue,
        state: "editing"
      });
      if (editorComp) {
        editorComp.refresh?.(editorParams);
        return;
      }
      const colDef = position.column.getColDef();
      const compDetails = _getCellEditorDetails(beans.userCompFactory, colDef, editorParams);
      const popup = compDetails?.popupFromSelector != null ? compDetails.popupFromSelector : !!colDef.cellEditorPopup;
      const popupLocation = compDetails?.popupPositionFromSelector != null ? compDetails.popupPositionFromSelector : colDef.cellEditorPopupPosition;
      checkAndPreventDefault(compDetails.params, event);
      if (cellCtrl) {
        cellCtrl.editCompDetails = compDetails;
        cellCtrl.onEditorAttachedFuncs.push(() => cellCtrl.rangeFeature?.unsetComp());
        cellCtrl.comp?.setEditDetails(compDetails, popup, popupLocation, beans.gos.get("reactiveCustomComponents"));
        cellCtrl?.rowCtrl?.refreshRow({ suppressFlash: true });
        const edit = beans.editModelSvc?.getEdit(position, true);
        if (!silent && !edit?.editorState?.cellStartedEditing) {
          beans.editSvc?.dispatchCellEvent(
            position,
            event,
            "cellEditingStarted",
            enableGroupEditing ? { value: newValue } : {}
          );
          beans.editModelSvc?.setEdit(position, { editorState: { cellStartedEditing: true } });
        }
      }
    }
    function _valueFromEditor(beans, cellEditor, params) {
      const noValueResult = { editorValueExists: false };
      if (_hasValidationRules(beans)) {
        const validationErrors = cellEditor.getValidationErrors?.();
        if ((validationErrors?.length ?? 0) > 0) {
          return noValueResult;
        }
      }
      if (params?.isCancelling) {
        return noValueResult;
      }
      if (params?.isStopping) {
        const isCancelAfterEnd = cellEditor?.isCancelAfterEnd?.();
        if (isCancelAfterEnd) {
          return { ...noValueResult, isCancelAfterEnd };
        }
      }
      const editorValue = cellEditor.getValue();
      return {
        editorValue,
        editorValueExists: true
      };
    }
    function _createEditorParams(beans, position, key2, cellStartedEdit) {
      const { valueSvc, gos, editSvc } = beans;
      const enableGroupEditing = beans.gos.get("enableGroupEdit");
      const cellCtrl = _getCellCtrl(beans, position);
      const rowIndex = position.rowNode?.rowIndex ?? void 0;
      const batchEdit = editSvc?.isBatchEditing();
      const agColumn = beans.colModel.getCol(position.column.getId());
      const { rowNode, column: column2 } = position;
      const editor = cellCtrl.comp?.getCellEditor();
      const cellDataValue = editSvc?.getCellDataValue(position, false);
      const initialNewValue = cellDataValue === void 0 ? editor ? _valueFromEditor(beans, editor)?.editorValue : void 0 : cellDataValue;
      const value2 = initialNewValue === UNEDITED ? valueSvc.getValueForDisplay(agColumn, rowNode)?.value : initialNewValue;
      return _addGridCommonParams(gos, {
        value: enableGroupEditing ? initialNewValue : value2,
        eventKey: key2 ?? null,
        column: column2,
        colDef: column2.getColDef(),
        rowIndex,
        node: rowNode,
        data: rowNode.data,
        cellStartedEdit: cellStartedEdit ?? false,
        onKeyDown: cellCtrl?.onKeyDown.bind(cellCtrl),
        stopEditing: (suppressNavigateAfterEdit) => {
          editSvc.stopEditing(position, { source: batchEdit ? "ui" : "api", suppressNavigateAfterEdit });
          _destroyEditor(beans, position);
        },
        eGridCell: cellCtrl?.eGui,
        parseValue: (newValue) => valueSvc.parseValue(agColumn, rowNode, newValue, cellCtrl?.value),
        formatValue: cellCtrl?.formatValue.bind(cellCtrl),
        validate: () => {
          editSvc?.validateEdit();
        }
      });
    }
    function _purgeUnchangedEdits(beans, includeEditing) {
      const { editModelSvc } = beans;
      editModelSvc?.getEditMap().forEach((editRow, rowNode) => {
        editRow.forEach((edit, column2) => {
          if (!includeEditing && (edit.state === "editing" || edit.pendingValue === UNEDITED)) {
            return;
          }
          if (!_sourceAndPendingDiffer(edit) && (edit.state !== "editing" || includeEditing)) {
            editModelSvc?.removeEdits({ rowNode, column: column2 });
          }
        });
      });
    }
    function _refreshEditorOnColDefChanged(beans, cellCtrl) {
      const editor = cellCtrl.comp?.getCellEditor();
      if (!editor?.refresh) {
        return;
      }
      const { eventKey, cellStartedEdit } = cellCtrl.editCompDetails.params;
      const { column: column2 } = cellCtrl;
      const editorParams = _createEditorParams(beans, cellCtrl, eventKey, cellStartedEdit);
      const colDef = column2.getColDef();
      const compDetails = _getCellEditorDetails(beans.userCompFactory, colDef, editorParams);
      editor.refresh(checkAndPreventDefault(compDetails.params, eventKey));
    }
    function checkAndPreventDefault(params, event) {
      if (event instanceof KeyboardEvent && params.column.getColDef().cellEditor === "agNumberCellEditor") {
        params.suppressPreventDefault = ["-", "+", ".", "e"].includes(event?.key ?? "") || params.suppressPreventDefault;
      } else {
        event?.preventDefault?.();
      }
      return params;
    }
    function _syncFromEditors(beans, params) {
      for (const cellId of beans.editModelSvc?.getEditPositions() ?? []) {
        const cellCtrl = _getCellCtrl(beans, cellId);
        if (!cellCtrl) {
          continue;
        }
        const editor = cellCtrl.comp?.getCellEditor();
        if (!editor) {
          continue;
        }
        const { editorValue, editorValueExists, isCancelAfterEnd } = _valueFromEditor(beans, editor, params);
        if (isCancelAfterEnd) {
          beans.editModelSvc?.setEdit(cellId, { editorState: { isCancelAfterEnd } });
        }
        _syncFromEditor(beans, cellId, editorValue, void 0, !editorValueExists, params);
      }
    }
    function _syncFromEditor(beans, position, editorValue, _source, valueSameAsSource, params) {
      const { editModelSvc, valueSvc } = beans;
      if (!editModelSvc) {
        return;
      }
      const { rowNode, column: column2 } = position;
      if (!(rowNode && column2)) {
        return;
      }
      let edit = editModelSvc.getEdit(position, true);
      if (!edit?.sourceValue) {
        edit = editModelSvc.setEdit(position, {
          sourceValue: valueSvc.getValue(column2, rowNode, void 0, "api"),
          pendingValue: edit ? edit.editorValue : UNEDITED
        });
      }
      editModelSvc.setEdit(position, {
        editorValue: valueSameAsSource ? edit.sourceValue : editorValue
      });
      if (params?.persist) {
        _persistEditorValue(beans, position);
      }
    }
    function _persistEditorValue(beans, position) {
      const { editModelSvc } = beans;
      const edit = editModelSvc?.getEdit(position, true);
      editModelSvc?.setEdit(position, {
        pendingValue: edit?.editorValue
      });
    }
    function _destroyEditors(beans, edits, params) {
      if (!edits) {
        edits = beans.editModelSvc?.getEditPositions();
      }
      for (const cellPosition of edits ?? []) {
        _destroyEditor(beans, cellPosition, params);
      }
    }
    function _destroyEditor(beans, position, params) {
      const enableGroupEditing = beans.gos.get("enableGroupEdit");
      const { editModelSvc } = beans;
      const cellCtrl = _getCellCtrl(beans, position);
      const edit = editModelSvc?.getEdit(position, true);
      if (!cellCtrl) {
        if (edit) {
          editModelSvc?.setEdit(position, { state: "changed" });
        }
        return;
      }
      const { comp: comp2 } = cellCtrl;
      if (comp2 && !comp2.getCellEditor()) {
        cellCtrl?.refreshCell();
        if (edit) {
          editModelSvc?.setEdit(position, { state: "changed" });
          const args2 = enableGroupEditing ? groupEditOverrides(params, edit) : {
            valueChanged: false,
            newValue: void 0,
            oldValue: edit.sourceValue
          };
          dispatchEditingStopped(beans, position, args2, params);
        }
        return;
      }
      if (_hasValidationRules(beans)) {
        const errorMessages = comp2?.getCellEditor()?.getValidationErrors?.();
        const cellValidationModel = editModelSvc?.getCellValidationModel();
        if (errorMessages?.length) {
          cellValidationModel?.setCellValidation(position, { errorMessages });
        } else {
          cellValidationModel?.clearCellValidation(position);
        }
      }
      editModelSvc?.setEdit(position, { state: "changed" });
      comp2?.setEditDetails();
      comp2?.refreshEditStyles(false, false);
      cellCtrl?.refreshCell({ force: true, suppressFlash: true });
      const latest2 = editModelSvc?.getEdit(position);
      if (latest2 && latest2.state === "changed") {
        const args2 = enableGroupEditing ? groupEditOverrides(params, latest2) : {
          valueChanged: _sourceAndPendingDiffer(latest2) && !params?.cancel,
          newValue: params?.cancel || latest2.editorState.isCancelAfterEnd ? void 0 : latest2?.editorValue ?? edit?.pendingValue,
          oldValue: latest2?.sourceValue
        };
        dispatchEditingStopped(beans, position, args2, params);
      }
    }
    function groupEditOverrides(params, latest2) {
      return params?.cancel ? {
        valueChanged: false,
        oldValue: latest2.sourceValue,
        newValue: void 0,
        value: latest2.sourceValue
      } : {
        valueChanged: false,
        oldValue: latest2.sourceValue,
        newValue: latest2.pendingValue,
        value: latest2.sourceValue
      };
    }
    function dispatchEditingStopped(beans, position, args2, { silent, event } = {}) {
      const { editSvc, editModelSvc } = beans;
      const latest2 = editModelSvc?.getEdit(position);
      const { editorState } = latest2 || {};
      const { isCancelBeforeStart } = editorState || {};
      if (!silent && !isCancelBeforeStart) {
        editSvc?.dispatchCellEvent(position, event, "cellEditingStopped", args2);
        editModelSvc?.setEdit(position, { editorState: { cellStoppedEditing: true } });
      }
    }
    function _hasValidationRules(beans) {
      const { gos, colModel } = beans;
      const getFullRowEditValidationErrors = !!gos.get("getFullRowEditValidationErrors");
      const columnsHaveRules = colModel.getColumnDefs()?.filter((c2) => c2.editable).some(({ cellEditorParams }) => {
        const { minLength, maxLength, getValidationErrors, min: min2, max: max2 } = cellEditorParams || {};
        return minLength !== void 0 || maxLength !== void 0 || getValidationErrors !== void 0 || min2 !== void 0 || max2 !== void 0;
      });
      const editorsHaveRules = beans.gridApi.getCellEditorInstances().some((editor) => editor.getValidationElement || editor.getValidationErrors);
      return columnsHaveRules || getFullRowEditValidationErrors || editorsHaveRules;
    }
    function _populateModelValidationErrors(beans, force) {
      if (!(force || _hasValidationRules(beans))) {
        return;
      }
      const mappedEditors = getCellEditorInstanceMap(beans);
      const cellValidationModel = new EditCellValidationModel();
      const { ariaAnnounce, localeSvc, editModelSvc, gos } = beans;
      const includeRows = gos.get("editType") === "fullRow";
      const translate = _getLocaleTextFunc(localeSvc);
      const ariaValidationErrorPrefix = translate("ariaValidationErrorPrefix", "Cell Editor Validation");
      for (const mappedEditor of mappedEditors) {
        const { ctrl, editor } = mappedEditor;
        const { rowNode, column: column2 } = ctrl;
        const errorMessages = editor.getValidationErrors?.() ?? [];
        const el2 = editor.getValidationElement?.(false) || !editor.isPopup?.() && ctrl.eGui;
        if (el2) {
          const isInvalid = errorMessages != null && errorMessages.length > 0;
          const invalidMessage = isInvalid ? errorMessages.join(". ") : "";
          _setAriaInvalid(el2, isInvalid);
          if (isInvalid) {
            ariaAnnounce.announceValue(`${ariaValidationErrorPrefix} ${errorMessages}`, "editorValidation");
          }
          if (el2 instanceof HTMLInputElement) {
            el2.setCustomValidity(invalidMessage);
          } else {
            el2.classList.toggle("invalid", isInvalid);
          }
        }
        if (errorMessages?.length > 0) {
          cellValidationModel.setCellValidation(
            {
              rowNode,
              column: column2
            },
            {
              errorMessages
            }
          );
        }
      }
      _syncFromEditors(beans, { persist: false });
      editModelSvc?.setCellValidationModel(cellValidationModel);
      const rowCtrlSet = /* @__PURE__ */ new Set();
      for (const { ctrl } of mappedEditors) {
        rowCtrlSet.add(ctrl.rowCtrl);
      }
      if (includeRows) {
        const rowValidations = _generateRowValidationErrors(beans);
        editModelSvc?.setRowValidationModel(rowValidations);
      }
      for (const rowCtrl of rowCtrlSet.values()) {
        rowCtrl.rowEditStyleFeature?.applyRowStyles();
        for (const cellCtrl of rowCtrl.getAllCellCtrls()) {
          cellCtrl.tooltipFeature?.refreshTooltip(true);
          cellCtrl.editorTooltipFeature?.refreshTooltip(true);
          cellCtrl.editStyleFeature?.applyCellStyles?.();
        }
      }
    }
    var _generateRowValidationErrors = (beans) => {
      const rowValidationModel = new EditRowValidationModel();
      const getFullRowEditValidationErrors = beans.gos.get("getFullRowEditValidationErrors");
      const editMap = beans.editModelSvc?.getEditMap();
      if (!editMap) {
        return rowValidationModel;
      }
      for (const rowNode of editMap.keys()) {
        const rowEditMap = editMap.get(rowNode);
        if (!rowEditMap) {
          continue;
        }
        const editorsState = [];
        const { rowIndex, rowPinned } = rowNode;
        for (const column2 of rowEditMap.keys()) {
          const editValue = rowEditMap.get(column2);
          if (!editValue) {
            continue;
          }
          const { editorValue, pendingValue, sourceValue } = editValue;
          const newValue = editorValue ?? (pendingValue === UNEDITED ? void 0 : pendingValue) ?? sourceValue;
          editorsState.push({
            column: column2,
            colId: column2.getColId(),
            rowIndex,
            rowPinned,
            oldValue: sourceValue,
            newValue
          });
        }
        const errorMessages = getFullRowEditValidationErrors?.({ editorsState }) ?? [];
        if (errorMessages.length > 0) {
          rowValidationModel.setRowValidation(
            {
              rowNode
            },
            { errorMessages }
          );
        }
      }
      return rowValidationModel;
    };
    function _validateEdit(beans) {
      _populateModelValidationErrors(beans, true);
      const map2 = beans.editModelSvc?.getCellValidationModel().getCellValidationMap();
      if (!map2) {
        return null;
      }
      const validations = [];
      map2.forEach((rowValidations, rowNode) => {
        rowValidations.forEach(({ errorMessages }, column2) => {
          validations.push({
            column: column2,
            rowIndex: rowNode.rowIndex,
            rowPinned: rowNode.rowPinned,
            messages: errorMessages ?? null
          });
        });
      });
      return validations;
    }
    function _createCellEvent(beans, domEvent, eventType, { rowNode, column: column2 }, value2) {
      const event = _addGridCommonParams(beans.gos, {
        type: eventType,
        node: rowNode,
        data: rowNode.data,
        value: value2,
        column: column2,
        colDef: column2.getColDef(),
        rowPinned: rowNode.rowPinned,
        event: domEvent,
        rowIndex: rowNode.rowIndex
      });
      return event;
    }
    function _isDeleteKey(key2, alwaysReturnFalseOnBackspace = false) {
      if (key2 === KeyCode.DELETE) {
        return true;
      }
      if (!alwaysReturnFalseOnBackspace && key2 === KeyCode.BACKSPACE) {
        return _isMacOsUserAgent();
      }
      return false;
    }
    var CellKeyboardListenerFeature = class extends BeanStub {
      constructor(cellCtrl, beans, rowNode, rowCtrl) {
        super();
        this.cellCtrl = cellCtrl;
        this.rowNode = rowNode;
        this.rowCtrl = rowCtrl;
        this.beans = beans;
      }
      init() {
        this.eGui = this.cellCtrl.eGui;
      }
      onKeyDown(event) {
        const key2 = event.key;
        switch (key2) {
          case KeyCode.ENTER:
            this.onEnterKeyDown(event);
            break;
          case KeyCode.F2:
            this.onF2KeyDown(event);
            break;
          case KeyCode.ESCAPE:
            this.onEscapeKeyDown(event);
            break;
          case KeyCode.TAB:
            this.onTabKeyDown(event);
            break;
          case KeyCode.BACKSPACE:
          case KeyCode.DELETE:
            this.onBackspaceOrDeleteKeyDown(key2, event);
            break;
          case KeyCode.DOWN:
          case KeyCode.UP:
          case KeyCode.RIGHT:
          case KeyCode.LEFT:
            this.onNavigationKeyDown(event, key2);
            break;
        }
      }
      onNavigationKeyDown(event, key2) {
        const { cellCtrl, beans } = this;
        if (beans.editSvc?.isEditing(cellCtrl, { withOpenEditor: true })) {
          return;
        }
        if (event.shiftKey && cellCtrl.isRangeSelectionEnabled()) {
          this.onShiftRangeSelect(event);
        } else {
          const currentCellPosition = cellCtrl.getFocusedCellPosition();
          beans.navigation?.navigateToNextCell(event, key2, currentCellPosition, true);
        }
        event.preventDefault();
      }
      onShiftRangeSelect(event) {
        const { rangeSvc, navigation: navigation2 } = this.beans;
        if (!rangeSvc) {
          return;
        }
        const endCell = rangeSvc.extendLatestRangeInDirection(event);
        if (!endCell) {
          return;
        }
        if (event.key === KeyCode.LEFT || event.key === KeyCode.RIGHT) {
          navigation2?.ensureColumnVisible(endCell.column);
        } else {
          navigation2?.ensureRowVisible(endCell.rowIndex);
        }
      }
      onTabKeyDown(event) {
        this.beans.navigation?.onTabKeyDown(this.cellCtrl, event);
      }
      onBackspaceOrDeleteKeyDown(key2, event) {
        const { cellCtrl, beans, rowNode } = this;
        const { gos, rangeSvc, eventSvc, editSvc } = beans;
        eventSvc.dispatchEvent({ type: "keyShortcutChangedCellStart" });
        if (_isDeleteKey(key2, gos.get("enableCellEditingOnBackspace")) && !editSvc?.isEditing(cellCtrl, { withOpenEditor: true })) {
          if (rangeSvc && _isCellSelectionEnabled(gos)) {
            rangeSvc.clearCellRangeCellValues({ dispatchWrapperEvents: true, wrapperEventSource: "deleteKey" });
          } else if (cellCtrl.isCellEditable()) {
            const { column: column2 } = cellCtrl;
            const emptyValue = this.beans.valueSvc.getDeleteValue(column2, rowNode);
            rowNode.setDataValue(column2, emptyValue, "cellClear");
          }
        } else if (!editSvc?.isEditing(cellCtrl, { withOpenEditor: true })) {
          beans.editSvc?.startEditing(cellCtrl, { startedEdit: true, event });
        }
        eventSvc.dispatchEvent({ type: "keyShortcutChangedCellEnd" });
      }
      onEnterKeyDown(event) {
        const { cellCtrl, beans } = this;
        const { editSvc, navigation: navigation2 } = beans;
        const cellEditing = editSvc?.isEditing(cellCtrl, { withOpenEditor: true });
        const rowNode = cellCtrl.rowNode;
        const rowEditing = editSvc?.isRowEditing(rowNode, { withOpenEditor: true });
        const startEditingAction = (cellCtrl2) => {
          const started2 = editSvc?.startEditing(cellCtrl2, {
            startedEdit: true,
            event,
            source: "edit"
          });
          if (started2) {
            event.preventDefault();
          }
        };
        if (cellEditing || rowEditing) {
          if (this.isCtrlEnter(event)) {
            editSvc?.applyBulkEdit(cellCtrl, beans?.rangeSvc?.getCellRanges() || []);
            return;
          }
          _populateModelValidationErrors(beans);
          if (editSvc?.checkNavWithValidation(void 0, event) === "block-stop") {
            return;
          }
          if (editSvc?.isEditing(cellCtrl, { withOpenEditor: true })) {
            editSvc?.stopEditing(cellCtrl, {
              event,
              source: "edit"
            });
          } else if (rowEditing && !cellCtrl.isCellEditable()) {
            editSvc?.stopEditing({ rowNode }, { event, source: "edit" });
          } else {
            startEditingAction(cellCtrl);
          }
        } else if (beans.gos.get("enterNavigatesVertically")) {
          const key2 = event.shiftKey ? KeyCode.UP : KeyCode.DOWN;
          navigation2?.navigateToNextCell(null, key2, cellCtrl.cellPosition, false);
        } else {
          if (editSvc?.hasValidationErrors()) {
            return;
          }
          if (editSvc?.hasValidationErrors(cellCtrl)) {
            editSvc.revertSingleCellEdit(cellCtrl, true);
          }
          startEditingAction(cellCtrl);
        }
      }
      isCtrlEnter(e) {
        return (e.ctrlKey || e.metaKey) && e.key === KeyCode.ENTER;
      }
      onF2KeyDown(event) {
        const {
          cellCtrl,
          beans: { editSvc }
        } = this;
        const editing = editSvc?.isEditing();
        if (editing) {
          _populateModelValidationErrors(this.beans);
          if (editSvc?.checkNavWithValidation(void 0, event) === "block-stop") {
            return;
          }
        }
        editSvc?.startEditing(cellCtrl, { startedEdit: true, event });
      }
      onEscapeKeyDown(event) {
        const {
          cellCtrl,
          beans: { editSvc }
        } = this;
        if (editSvc?.checkNavWithValidation(cellCtrl, event) === "block-stop") {
          editSvc.revertSingleCellEdit(cellCtrl);
        }
        editSvc?.stopEditing(cellCtrl, {
          event,
          cancel: true
        });
      }
      processCharacter(event) {
        const eventTarget = event.target;
        const eventOnChildComponent = eventTarget !== this.eGui;
        const {
          beans: { editSvc },
          cellCtrl
        } = this;
        if (eventOnChildComponent) {
          return;
        }
        if (editSvc?.isEditing(cellCtrl, { withOpenEditor: true })) {
          return;
        }
        const key2 = event.key;
        if (key2 === KeyCode.SPACE) {
          this.onSpaceKeyDown(event);
        } else if (editSvc?.isCellEditable(cellCtrl, "ui")) {
          if (editSvc?.hasValidationErrors() && !editSvc?.hasValidationErrors(cellCtrl)) {
            return;
          }
          editSvc?.startEditing(cellCtrl, { startedEdit: true, event, source: "api" });
          const compDetails = cellCtrl.editCompDetails;
          const shouldPreventDefault = !compDetails?.params?.suppressPreventDefault;
          if (shouldPreventDefault) {
            event.preventDefault();
          }
        }
      }
      onSpaceKeyDown(event) {
        const { gos, editSvc } = this.beans;
        const { rowNode } = this.cellCtrl;
        if (!editSvc?.isEditing(this.cellCtrl, { withOpenEditor: true }) && _isRowSelection(gos)) {
          this.beans.selectionSvc?.handleSelectionEvent(event, rowNode, "spaceKey");
        }
        event.preventDefault();
      }
    };
    var CellMouseListenerFeature = class extends BeanStub {
      constructor(cellCtrl, beans, column2) {
        super();
        this.cellCtrl = cellCtrl;
        this.column = column2;
        this.beans = beans;
      }
      onMouseEvent(eventName, mouseEvent) {
        if (_isStopPropagationForAgGrid(mouseEvent)) {
          return;
        }
        switch (eventName) {
          case "click":
            this.onCellClicked(mouseEvent);
            break;
          case "mousedown":
          case "touchstart":
            this.onMouseDown(mouseEvent);
            break;
          case "dblclick":
            this.onCellDoubleClicked(mouseEvent);
            break;
          case "mouseout":
            this.onMouseOut(mouseEvent);
            break;
          case "mouseover":
            this.onMouseOver(mouseEvent);
            break;
        }
      }
      onCellClicked(event) {
        if (this.beans.touchSvc?.handleCellDoubleClick(this, event)) {
          return;
        }
        const { eventSvc, rangeSvc, editSvc, editModelSvc, frameworkOverrides, gos } = this.beans;
        const isMultiKey = event.ctrlKey || event.metaKey;
        const { cellCtrl } = this;
        const { column: column2, cellPosition, rowNode } = cellCtrl;
        const suppressMouseEvent2 = _suppressCellMouseEvent(gos, column2, rowNode, event);
        if (rangeSvc && isMultiKey && !suppressMouseEvent2) {
          if (rangeSvc.getCellRangeCount(cellPosition) > 1) {
            rangeSvc.intersectLastRange(true);
          }
        }
        const cellClickedEvent = cellCtrl.createEvent(event, "cellClicked");
        cellClickedEvent.isEventHandlingSuppressed = suppressMouseEvent2;
        eventSvc.dispatchEvent(cellClickedEvent);
        const colDef = column2.getColDef();
        if (colDef.onCellClicked) {
          window.setTimeout(() => {
            frameworkOverrides.wrapOutgoing(() => {
              colDef.onCellClicked(cellClickedEvent);
            });
          }, 0);
        }
        if (suppressMouseEvent2) {
          return;
        }
        if (editModelSvc?.getState(cellCtrl) !== "editing") {
          const editing = editSvc?.isEditing();
          const cellValidations = editModelSvc?.getCellValidationModel().getCellValidationMap().size ?? 0;
          const rowValidations = editModelSvc?.getRowValidationModel().getRowValidationMap().size ?? 0;
          if (editing && (cellValidations > 0 || rowValidations > 0)) {
            return;
          }
          if (editSvc?.shouldStartEditing(cellCtrl, event)) {
            editSvc?.startEditing(cellCtrl, { event });
          } else if (editSvc?.shouldStopEditing(cellCtrl, event)) {
            if (this.beans.gos.get("editType") === "fullRow") {
              editSvc?.stopEditing(cellCtrl, {
                event,
                source: "edit"
              });
            } else {
              editSvc?.stopEditing(void 0, {
                event,
                source: "edit"
              });
            }
          }
        }
      }
      onCellDoubleClicked(event) {
        const { column: column2, beans, cellCtrl } = this;
        const { eventSvc, frameworkOverrides, editSvc, editModelSvc, gos } = beans;
        const suppressMouseEvent2 = _suppressCellMouseEvent(gos, cellCtrl.column, cellCtrl.rowNode, event);
        const colDef = column2.getColDef();
        const cellDoubleClickedEvent = cellCtrl.createEvent(
          event,
          "cellDoubleClicked"
        );
        cellDoubleClickedEvent.isEventHandlingSuppressed = suppressMouseEvent2;
        eventSvc.dispatchEvent(cellDoubleClickedEvent);
        if (typeof colDef.onCellDoubleClicked === "function") {
          window.setTimeout(() => {
            frameworkOverrides.wrapOutgoing(() => {
              colDef.onCellDoubleClicked(cellDoubleClickedEvent);
            });
          }, 0);
        }
        if (suppressMouseEvent2) {
          return;
        }
        if (editSvc?.shouldStartEditing(cellCtrl, event) && editModelSvc?.getState(cellCtrl) !== "editing") {
          const editing = editSvc?.isEditing();
          const cellValidations = editModelSvc?.getCellValidationModel().getCellValidationMap().size ?? 0;
          const rowValidations = editModelSvc?.getRowValidationModel().getRowValidationMap().size ?? 0;
          if (editing && (cellValidations > 0 || rowValidations > 0)) {
            return;
          }
          editSvc?.startEditing(cellCtrl, { event });
        }
      }
      onMouseDown(mouseEvent) {
        const { ctrlKey, metaKey, shiftKey } = mouseEvent;
        const target2 = mouseEvent.target;
        const { cellCtrl, beans } = this;
        const { eventSvc, rangeSvc, rowNumbersSvc, focusSvc, gos, editSvc } = beans;
        const { column: column2, rowNode, cellPosition } = cellCtrl;
        const suppressMouseEvent2 = _suppressCellMouseEvent(gos, column2, rowNode, mouseEvent);
        const fireMouseDownEvent = () => {
          const cellMouseDownEvent = cellCtrl.createEvent(mouseEvent, "cellMouseDown");
          cellMouseDownEvent.isEventHandlingSuppressed = suppressMouseEvent2;
          eventSvc.dispatchEvent(cellMouseDownEvent);
        };
        if (suppressMouseEvent2) {
          fireMouseDownEvent();
          return;
        }
        if (this.isRightClickInExistingRange(mouseEvent)) {
          return;
        }
        const hasRanges = rangeSvc && !rangeSvc.isEmpty();
        const containsWidget = this.containsWidget(target2);
        const isRowNumberColumn = isRowNumberCol(column2);
        if (rowNumbersSvc && isRowNumberColumn && !rowNumbersSvc.handleMouseDownOnCell(cellPosition, mouseEvent)) {
          if (rangeSvc) {
            mouseEvent.preventDefault();
          }
          mouseEvent.stopImmediatePropagation();
          return;
        }
        if (!shiftKey || !hasRanges) {
          const editing = editSvc?.isEditing(cellCtrl);
          const isEnableCellTextSelection = gos.get("enableCellTextSelection");
          const shouldFocus = isEnableCellTextSelection && mouseEvent.defaultPrevented;
          const forceBrowserFocus = (_isBrowserSafari() || shouldFocus) && !editing && !_isFocusableFormField(target2) && !containsWidget;
          cellCtrl.focusCell(forceBrowserFocus, mouseEvent);
        }
        if (shiftKey && hasRanges && !focusSvc.isCellFocused(cellPosition)) {
          mouseEvent.preventDefault();
          const focusedCell = focusSvc.getFocusedCell();
          if (focusedCell) {
            const { column: column22, rowIndex, rowPinned } = focusedCell;
            if (editSvc?.isEditing(focusedCell)) {
              editSvc?.stopEditing(focusedCell);
            }
            focusSvc.setFocusedCell({
              column: column22,
              rowIndex,
              rowPinned,
              forceBrowserFocus: true,
              preventScrollOnBrowserFocus: true,
              sourceEvent: mouseEvent
            });
          }
        }
        if (containsWidget) {
          return;
        }
        if (rangeSvc) {
          if (isRowNumberColumn) {
            mouseEvent.preventDefault();
          }
          const hasRightClickedOnRowNumber = _interpretAsRightClick(beans, mouseEvent) && isRowNumberColumn;
          if (shiftKey) {
            rangeSvc.extendLatestRangeToCell(cellPosition);
          } else if (!hasRightClickedOnRowNumber) {
            const isMultiKey = ctrlKey || metaKey;
            rangeSvc.setRangeToCell(cellPosition, isMultiKey);
          }
        }
        fireMouseDownEvent();
      }
      isRightClickInExistingRange(mouseEvent) {
        const { rangeSvc } = this.beans;
        if (rangeSvc) {
          const cellInRange = rangeSvc.isCellInAnyRange(this.cellCtrl.cellPosition);
          const isRightClick = _interpretAsRightClick(this.beans, mouseEvent);
          if (cellInRange && isRightClick) {
            return true;
          }
        }
        return false;
      }
      containsWidget(target2) {
        return _isElementChildOfClass(target2, "ag-selection-checkbox", 3) || _isElementChildOfClass(target2, "ag-drag-handle", 3);
      }
      onMouseOut(mouseEvent) {
        if (this.mouseStayingInsideCell(mouseEvent)) {
          return;
        }
        const { eventSvc, colHover } = this.beans;
        eventSvc.dispatchEvent(this.cellCtrl.createEvent(mouseEvent, "cellMouseOut"));
        colHover?.clearMouseOver();
      }
      onMouseOver(mouseEvent) {
        if (this.mouseStayingInsideCell(mouseEvent)) {
          return;
        }
        const { eventSvc, colHover } = this.beans;
        eventSvc.dispatchEvent(this.cellCtrl.createEvent(mouseEvent, "cellMouseOver"));
        colHover?.setMouseOver([this.column]);
      }
      mouseStayingInsideCell(e) {
        if (!e.target || !e.relatedTarget) {
          return false;
        }
        const eCell = this.cellCtrl.eGui;
        const cellContainsTarget = eCell.contains(e.target);
        const cellContainsRelatedTarget = eCell.contains(e.relatedTarget);
        return cellContainsTarget && cellContainsRelatedTarget;
      }
    };
    var CellPositionFeature = class extends BeanStub {
      constructor(cellCtrl, beans) {
        super();
        this.cellCtrl = cellCtrl;
        this.beans = beans;
        this.column = cellCtrl.column;
        this.rowNode = cellCtrl.rowNode;
      }
      setupRowSpan() {
        this.rowSpan = this.column.getRowSpan(this.rowNode);
        this.addManagedListeners(this.beans.eventSvc, { newColumnsLoaded: () => this.onNewColumnsLoaded() });
      }
      init() {
        this.eSetLeft = this.cellCtrl.getRootElement();
        this.eContent = this.cellCtrl.eGui;
        const cellSpan = this.cellCtrl.getCellSpan();
        if (!cellSpan) {
          this.setupColSpan();
          this.setupRowSpan();
        }
        this.onLeftChanged();
        this.onWidthChanged();
        if (!cellSpan) {
          this._legacyApplyRowSpan();
        }
        if (cellSpan) {
          const refreshSpanHeight = this.refreshSpanHeight.bind(this, cellSpan);
          refreshSpanHeight();
          this.addManagedListeners(this.beans.eventSvc, {
            paginationChanged: refreshSpanHeight,
            recalculateRowBounds: refreshSpanHeight,
            pinnedHeightChanged: refreshSpanHeight
          });
        }
      }
      refreshSpanHeight(cellSpan) {
        const spanHeight = cellSpan.getCellHeight();
        if (spanHeight != null) {
          this.eContent.style.height = `${spanHeight}px`;
        }
      }
      onNewColumnsLoaded() {
        const rowSpan = this.column.getRowSpan(this.rowNode);
        if (this.rowSpan === rowSpan) {
          return;
        }
        this.rowSpan = rowSpan;
        this._legacyApplyRowSpan(true);
      }
      onDisplayColumnsChanged() {
        const colsSpanning = this.getColSpanningList();
        if (!_areEqual(this.colsSpanning, colsSpanning)) {
          this.colsSpanning = colsSpanning;
          this.onWidthChanged();
          this.onLeftChanged();
        }
      }
      setupColSpan() {
        if (this.column.getColDef().colSpan == null) {
          return;
        }
        this.colsSpanning = this.getColSpanningList();
        this.addManagedListeners(this.beans.eventSvc, {
          // because we are col spanning, a reorder of the cols can change what cols we are spanning over
          displayedColumnsChanged: this.onDisplayColumnsChanged.bind(this),
          // because we are spanning over multiple cols, we check for width any time any cols width changes.
          // this is expensive - really we should be explicitly checking only the cols we are spanning over
          // instead of every col, however it would be tricky code to track the cols we are spanning over, so
          // because hardly anyone will be using colSpan, am favouring this easier way for more maintainable code.
          displayedColumnsWidthChanged: this.onWidthChanged.bind(this)
        });
      }
      onWidthChanged() {
        if (!this.eContent) {
          return;
        }
        const width = this.getCellWidth();
        this.eContent.style.width = `${width}px`;
      }
      getCellWidth() {
        if (!this.colsSpanning) {
          return this.column.getActualWidth();
        }
        return this.colsSpanning.reduce((width, col) => width + col.getActualWidth(), 0);
      }
      getColSpanningList() {
        const { column: column2, rowNode } = this;
        const colSpan = column2.getColSpan(rowNode);
        const colsSpanning = [];
        if (colSpan === 1) {
          colsSpanning.push(column2);
        } else {
          let pointer = column2;
          const pinned = column2.getPinned();
          for (let i2 = 0; pointer && i2 < colSpan; i2++) {
            colsSpanning.push(pointer);
            pointer = this.beans.visibleCols.getColAfter(pointer);
            if (!pointer || _missing(pointer)) {
              break;
            }
            if (pinned !== pointer.getPinned()) {
              break;
            }
          }
        }
        return colsSpanning;
      }
      onLeftChanged() {
        if (!this.eSetLeft) {
          return;
        }
        const left2 = this.modifyLeftForPrintLayout(this.getCellLeft());
        this.eSetLeft.style.left = left2 + "px";
      }
      getCellLeft() {
        let mostLeftCol;
        if (this.beans.gos.get("enableRtl") && this.colsSpanning) {
          mostLeftCol = _last(this.colsSpanning);
        } else {
          mostLeftCol = this.column;
        }
        return mostLeftCol.getLeft();
      }
      modifyLeftForPrintLayout(leftPosition) {
        if (!this.cellCtrl.printLayout || this.column.getPinned() === "left") {
          return leftPosition;
        }
        const { visibleCols } = this.beans;
        const leftWidth = visibleCols.getColsLeftWidth();
        if (this.column.getPinned() === "right") {
          const bodyWidth = visibleCols.bodyWidth;
          return leftWidth + bodyWidth + (leftPosition || 0);
        }
        return leftWidth + (leftPosition || 0);
      }
      _legacyApplyRowSpan(force) {
        if (this.rowSpan === 1 && !force) {
          return;
        }
        const singleRowHeight = _getRowHeightAsNumber(this.beans);
        const totalRowHeight = singleRowHeight * this.rowSpan;
        this.eContent.style.height = `${totalRowHeight}px`;
        this.eContent.style.zIndex = "1";
      }
      // overriding to make public, as we don't dispose this bean via context
      destroy() {
        super.destroy();
      }
    };
    var CSS_CELL = "ag-cell";
    var CSS_AUTO_HEIGHT = "ag-cell-auto-height";
    var CSS_NORMAL_HEIGHT = "ag-cell-normal-height";
    var CSS_CELL_FOCUS = "ag-cell-focus";
    var CSS_CELL_FIRST_RIGHT_PINNED = "ag-cell-first-right-pinned";
    var CSS_CELL_LAST_LEFT_PINNED = "ag-cell-last-left-pinned";
    var CSS_CELL_NOT_INLINE_EDITING = "ag-cell-not-inline-editing";
    var CSS_CELL_WRAP_TEXT = "ag-cell-wrap-text";
    var instanceIdSequence4 = 0;
    var CellCtrl = class extends BeanStub {
      constructor(column2, rowNode, beans, rowCtrl) {
        super();
        this.column = column2;
        this.rowNode = rowNode;
        this.rowCtrl = rowCtrl;
        this.rangeFeature = void 0;
        this.rowResizeFeature = void 0;
        this.positionFeature = void 0;
        this.customStyleFeature = void 0;
        this.editStyleFeature = void 0;
        this.mouseListener = void 0;
        this.keyboardListener = void 0;
        this.suppressRefreshCell = false;
        this.onCompAttachedFuncs = [];
        this.onEditorAttachedFuncs = [];
        this.focusEventWhileNotReady = null;
        this.hasBeenFocused = false;
        this.hasEdit = false;
        this.tooltipFeature = void 0;
        this.editorTooltipFeature = void 0;
        this.beans = beans;
        this.gos = beans.gos;
        this.editSvc = beans.editSvc;
        this.hasEdit = !!beans.editSvc;
        const { colId } = column2;
        this.instanceId = colId + "-" + instanceIdSequence4++;
        this.createCellPosition();
        this.updateAndFormatValue(false);
      }
      addFeatures() {
        const { beans } = this;
        this.positionFeature = new CellPositionFeature(this, beans);
        this.customStyleFeature = beans.cellStyles?.createCellCustomStyleFeature(this, beans);
        this.editStyleFeature = beans.editSvc?.createCellStyleFeature(this, beans);
        this.mouseListener = new CellMouseListenerFeature(this, beans, this.column);
        this.keyboardListener = new CellKeyboardListenerFeature(this, beans, this.rowNode, this.rowCtrl);
        this.enableTooltipFeature();
        const { rangeSvc } = beans;
        const cellSelectionEnabled = rangeSvc && _isCellSelectionEnabled(beans.gos);
        if (cellSelectionEnabled) {
          this.rangeFeature = rangeSvc.createCellRangeFeature(beans, this);
        }
        if (isRowNumberCol(this.column)) {
          this.rowResizeFeature = this.beans.rowNumbersSvc.createRowNumbersRowResizerFeature(beans, this);
        }
      }
      isCellSpanning() {
        return false;
      }
      getCellSpan() {
        return void 0;
      }
      removeFeatures() {
        const context = this.beans.context;
        this.positionFeature = context.destroyBean(this.positionFeature);
        this.editorTooltipFeature = context.destroyBean(this.editorTooltipFeature);
        this.customStyleFeature = context.destroyBean(this.customStyleFeature);
        this.editStyleFeature = context.destroyBean(this.editStyleFeature);
        this.mouseListener = context.destroyBean(this.mouseListener);
        this.keyboardListener = context.destroyBean(this.keyboardListener);
        this.rangeFeature = context.destroyBean(this.rangeFeature);
        this.rowResizeFeature = context.destroyBean(this.rowResizeFeature);
        this.disableTooltipFeature();
      }
      enableTooltipFeature(value2, shouldDisplayTooltip) {
        this.tooltipFeature = this.beans.tooltipSvc?.enableCellTooltipFeature(this, value2, shouldDisplayTooltip);
      }
      disableTooltipFeature() {
        this.tooltipFeature = this.beans.context.destroyBean(this.tooltipFeature);
      }
      enableEditorTooltipFeature(editor) {
        if (this.editorTooltipFeature) {
          this.disableEditorTooltipFeature();
        }
        this.editorTooltipFeature = this.beans.tooltipSvc?.setupCellEditorTooltip(this, editor);
        _populateModelValidationErrors(this.beans);
      }
      disableEditorTooltipFeature() {
        this.editorTooltipFeature = this.beans.context.destroyBean(this.editorTooltipFeature);
      }
      setComp(comp2, eCell, _eWrapper, eCellWrapper, printLayout, startEditing, compBean) {
        this.comp = comp2;
        this.eGui = eCell;
        this.printLayout = printLayout;
        compBean ?? (compBean = this);
        this.addDomData(compBean);
        this.addFeatures();
        compBean.addDestroyFunc(() => this.removeFeatures());
        this.onSuppressCellFocusChanged(this.beans.gos.get("suppressCellFocus"));
        this.setupFocus();
        this.applyStaticCssClasses();
        this.setWrapText();
        this.onFirstRightPinnedChanged();
        this.onLastLeftPinnedChanged();
        this.onColumnHover();
        this.setupControlComps();
        this.setupAutoHeight(eCellWrapper, compBean);
        this.refreshFirstAndLastStyles();
        this.refreshAriaColIndex();
        this.positionFeature?.init();
        this.customStyleFeature?.setComp(comp2);
        this.editStyleFeature?.setComp(comp2);
        this.tooltipFeature?.refreshTooltip();
        this.keyboardListener?.init();
        this.rangeFeature?.setComp(comp2);
        this.rowResizeFeature?.refreshRowResizer();
        if (startEditing && this.isCellEditable() || this.hasEdit && this.editSvc?.isEditing(this, { withOpenEditor: true })) {
          this.editSvc?.startEditing(this, {
            startedEdit: false,
            source: "api",
            silent: true,
            continueEditing: true
          });
        } else {
          this.showValue(false, true);
        }
        if (this.onCompAttachedFuncs.length) {
          for (const func of this.onCompAttachedFuncs) {
            func();
          }
          this.onCompAttachedFuncs = [];
        }
      }
      setupAutoHeight(eCellWrapper, compBean) {
        this.isAutoHeight = this.beans.rowAutoHeight?.setupCellAutoHeight(this, eCellWrapper, compBean) ?? false;
      }
      getCellAriaRole() {
        return this.column.getColDef().cellAriaRole ?? "gridcell";
      }
      isCellRenderer() {
        const colDef = this.column.getColDef();
        return colDef.cellRenderer != null || colDef.cellRendererSelector != null;
      }
      getValueToDisplay() {
        return this.valueFormatted ?? this.value;
      }
      getDeferLoadingCellRenderer() {
        const { beans, column: column2 } = this;
        const { userCompFactory, ctrlsSvc, eventSvc } = beans;
        const colDef = column2.getColDef();
        const params = this.createCellRendererParams();
        params.deferRender = true;
        const loadingDetails = _getLoadingCellRendererDetails(userCompFactory, colDef, params);
        if (ctrlsSvc.getGridBodyCtrl()?.scrollFeature?.isScrolling()) {
          let resolver;
          const onReady = new AgPromise((resolve) => {
            resolver = resolve;
          });
          const [removeBodyScrollEnd] = this.addManagedListeners(eventSvc, {
            bodyScrollEnd: () => {
              resolver();
              removeBodyScrollEnd();
            }
          });
          return { loadingComp: loadingDetails, onReady };
        }
        return { loadingComp: loadingDetails, onReady: AgPromise.resolve() };
      }
      showValue(forceNewCellRendererInstance, skipRangeHandleRefresh) {
        const { beans, column: column2, rowNode, rangeFeature } = this;
        const { userCompFactory } = beans;
        let valueToDisplay = this.getValueToDisplay();
        let compDetails;
        const isSsrmLoading = rowNode.stub && rowNode.groupData?.[column2.getId()] == null;
        const colDef = column2.getColDef();
        if (isSsrmLoading || this.isCellRenderer()) {
          const params = this.createCellRendererParams();
          if (!isSsrmLoading || isRowNumberCol(column2)) {
            compDetails = _getCellRendererDetails(userCompFactory, colDef, params);
          } else {
            compDetails = _getLoadingCellRendererDetails(userCompFactory, colDef, params);
          }
        }
        if (!compDetails && !isSsrmLoading && beans.findSvc?.isMatch(rowNode, column2)) {
          const params = this.createCellRendererParams();
          compDetails = _getCellRendererDetails(
            userCompFactory,
            { ...column2.getColDef(), cellRenderer: "agFindCellRenderer" },
            params
          );
        }
        if (this.hasEdit && this.editSvc.isBatchEditing() && this.editSvc.isRowEditing(rowNode, { checkSiblings: true })) {
          const result2 = this.editSvc.prepDetailsDuringBatch(this, { compDetails, valueToDisplay });
          if (result2) {
            if (result2.compDetails) {
              compDetails = result2.compDetails;
            } else if (result2.valueToDisplay) {
              valueToDisplay = result2.valueToDisplay;
            }
          }
        }
        this.comp.setRenderDetails(compDetails, valueToDisplay, forceNewCellRendererInstance);
        this.customRowDragComp?.refreshVisibility();
        if (!skipRangeHandleRefresh && rangeFeature) {
          _requestAnimationFrame(beans, () => rangeFeature?.refreshHandle());
        }
        this.rowResizeFeature?.refreshRowResizer();
      }
      setupControlComps() {
        const colDef = this.column.getColDef();
        this.includeSelection = this.isIncludeControl(this.isCheckboxSelection(colDef), true);
        this.includeRowDrag = this.isIncludeControl(colDef.rowDrag);
        this.includeDndSource = this.isIncludeControl(colDef.dndSource);
        this.comp.setIncludeSelection(this.includeSelection);
        this.comp.setIncludeDndSource(this.includeDndSource);
        this.comp.setIncludeRowDrag(this.includeRowDrag);
      }
      isForceWrapper() {
        return this.beans.gos.get("enableCellTextSelection") || this.column.isAutoHeight();
      }
      getCellValueClass() {
        const prefix = "ag-cell-value";
        const isCheckboxRenderer = this.column.getColDef().cellRenderer === "agCheckboxCellRenderer";
        let suffix = "";
        if (isCheckboxRenderer) {
          suffix = " ag-allow-overflow";
        }
        return `${prefix}${suffix}`;
      }
      /**
       * Wrapper providing general conditions under which control elements (e.g. checkboxes and drag handles)
       * are rendered for a particular cell.
       * @param value Whether to render the control in the specific context of the caller
       * @param allowManuallyPinned Whether manually pinned rows are permitted this form of control element
       */
      // eslint-disable-next-line @typescript-eslint/ban-types
      isIncludeControl(value2, allowManuallyPinned = false) {
        const rowUnpinned = this.rowNode.rowPinned == null;
        return (rowUnpinned || allowManuallyPinned && _isManualPinnedRow(this.rowNode)) && !!value2;
      }
      isCheckboxSelection(colDef) {
        const { rowSelection, groupDisplayType } = this.beans.gridOptions;
        const checkboxLocation = _getCheckboxLocation(rowSelection);
        const isSelectionColumn = isColumnSelectionCol(this.column);
        if (groupDisplayType === "custom" && checkboxLocation !== "selectionColumn" && isSelectionColumn) {
          return false;
        }
        return colDef.checkboxSelection || isSelectionColumn && typeof rowSelection === "object" && _getCheckboxes(rowSelection);
      }
      refreshShouldDestroy() {
        const colDef = this.column.getColDef();
        const selectionChanged = this.includeSelection != this.isIncludeControl(this.isCheckboxSelection(colDef), true);
        const rowDragChanged = this.includeRowDrag != this.isIncludeControl(colDef.rowDrag);
        const dndSourceChanged = this.includeDndSource != this.isIncludeControl(colDef.dndSource);
        const autoHeightChanged = this.isAutoHeight != this.column.isAutoHeight();
        return selectionChanged || rowDragChanged || dndSourceChanged || autoHeightChanged;
      }
      onPopupEditorClosed() {
        const { editSvc } = this.beans;
        if (!editSvc?.isEditing(this, { withOpenEditor: true })) {
          return;
        }
        editSvc?.stopEditing(this, { source: editSvc?.isBatchEditing() ? "ui" : "api" });
      }
      /**
       * Ends the Cell Editing
       * @param cancel `True` if the edit process is being canceled.
       * @returns `True` if the value of the `GridCell` has been updated, otherwise `False`.
       */
      stopEditing(cancel = false) {
        const { editSvc } = this.beans;
        return editSvc?.stopEditing(this, { cancel, source: editSvc?.isBatchEditing() ? "ui" : "api" }) ?? false;
      }
      createCellRendererParams() {
        const {
          value: value2,
          valueFormatted,
          column: column2,
          rowNode,
          comp: comp2,
          eGui,
          beans: { valueSvc, gos, editSvc }
        } = this;
        const res = _addGridCommonParams(gos, {
          value: value2,
          valueFormatted,
          getValue: () => valueSvc.getValueForDisplay(column2, rowNode).value,
          setValue: (value22) => editSvc?.setDataValue({ rowNode, column: column2 }, value22) || rowNode.setDataValue(column2, value22),
          formatValue: this.formatValue.bind(this),
          data: rowNode.data,
          node: rowNode,
          pinned: column2.getPinned(),
          colDef: column2.getColDef(),
          column: column2,
          refreshCell: this.refreshCell.bind(this),
          eGridCell: eGui,
          eParentOfValue: comp2.getParentOfValue(),
          registerRowDragger: (rowDraggerElement, dragStartPixels, value22, suppressVisibilityChange) => this.registerRowDragger(rowDraggerElement, dragStartPixels, suppressVisibilityChange),
          setTooltip: (value22, shouldDisplayTooltip) => {
            gos.assertModuleRegistered("Tooltip", 3);
            if (this.tooltipFeature) {
              this.disableTooltipFeature();
            }
            this.enableTooltipFeature(value22, shouldDisplayTooltip);
            this.tooltipFeature?.refreshTooltip();
          }
        });
        return res;
      }
      onCellChanged(event) {
        const eventImpactsThisCell = event.column === this.column;
        if (eventImpactsThisCell) {
          this.refreshCell({});
        }
      }
      refreshOrDestroyCell(params) {
        if (this.refreshShouldDestroy()) {
          this.rowCtrl?.recreateCell(this);
        } else {
          this.refreshCell(params);
        }
        if (this.hasEdit && this.editCompDetails) {
          const { editSvc, comp: comp2 } = this;
          if (!comp2?.getCellEditor() && editSvc.isEditing(this, { withOpenEditor: true })) {
            editSvc.startEditing(this, { startedEdit: false, source: "api", silent: true });
          }
        }
      }
      // + stop editing {force: true, suppressFlash: true}
      // + event cellChanged {}
      // + cellRenderer.params.refresh() {} -> method passes 'as is' to the cellRenderer, so params could be anything
      // + rowCtrl: event dataChanged {suppressFlash: !update, newData: !update}
      // + rowCtrl: api refreshCells() {animate: true/false}
      // + rowRenderer: api softRefreshView() {}
      refreshCell({ force, suppressFlash, newData } = {}) {
        const {
          editStyleFeature,
          customStyleFeature,
          rowCtrl: { rowEditStyleFeature },
          beans: { cellFlashSvc, filterManager },
          column: column2,
          comp: comp2,
          suppressRefreshCell,
          tooltipFeature
        } = this;
        if (suppressRefreshCell) {
          return;
        }
        const { field, valueGetter, showRowGroup, enableCellChangeFlash } = column2.getColDef();
        const noValueProvided = field == null && valueGetter == null && showRowGroup == null;
        const forceRefresh = force || noValueProvided || newData;
        const isCellCompReady = !!comp2;
        const valuesDifferent = this.updateAndFormatValue(isCellCompReady);
        const dataNeedsUpdating = forceRefresh || valuesDifferent;
        if (!isCellCompReady) {
          return;
        }
        if (dataNeedsUpdating) {
          this.showValue(!!newData, false);
          const processingFilterChange = filterManager?.isSuppressFlashingCellsBecauseFiltering();
          const flashCell = !suppressFlash && !processingFilterChange && enableCellChangeFlash;
          if (flashCell) {
            cellFlashSvc?.flashCell(this);
          }
          editStyleFeature?.applyCellStyles?.();
          customStyleFeature?.applyUserStyles();
          customStyleFeature?.applyClassesFromColDef();
          rowEditStyleFeature?.applyRowStyles();
        }
        tooltipFeature?.refreshTooltip();
        customStyleFeature?.applyCellClassRules();
      }
      isCellEditable() {
        return this.column.isCellEditable(this.rowNode);
      }
      formatValue(value2) {
        return this.callValueFormatter(value2) ?? value2;
      }
      callValueFormatter(value2) {
        return this.beans.valueSvc.formatValue(this.column, this.rowNode, value2);
      }
      updateAndFormatValue(compareValues) {
        const oldValue = this.value;
        const oldValueFormatted = this.valueFormatted;
        const { value: value2, valueFormatted } = this.beans.valueSvc.getValueForDisplay(this.column, this.rowNode, true);
        this.value = value2;
        this.valueFormatted = valueFormatted;
        if (compareValues) {
          return !this.valuesAreEqual(oldValue, this.value) || this.valueFormatted != oldValueFormatted;
        }
        return true;
      }
      valuesAreEqual(val1, val2) {
        const colDef = this.column.getColDef();
        return colDef.equals ? colDef.equals(val1, val2) : val1 === val2;
      }
      addDomData(compBean) {
        const element = this.eGui;
        _setDomData(this.beans.gos, element, DOM_DATA_KEY_CELL_CTRL, this);
        compBean.addDestroyFunc(() => _setDomData(this.beans.gos, element, DOM_DATA_KEY_CELL_CTRL, null));
      }
      createEvent(domEvent, eventType) {
        const { rowNode, column: column2, value: value2, beans } = this;
        return _createCellEvent(beans, domEvent, eventType, { rowNode, column: column2 }, value2);
      }
      processCharacter(event) {
        this.keyboardListener?.processCharacter(event);
      }
      onKeyDown(event) {
        this.keyboardListener?.onKeyDown(event);
      }
      onMouseEvent(eventName, mouseEvent) {
        this.mouseListener?.onMouseEvent(eventName, mouseEvent);
      }
      getColSpanningList() {
        return this.positionFeature?.getColSpanningList() ?? [];
      }
      onLeftChanged() {
        if (!this.comp) {
          return;
        }
        this.positionFeature?.onLeftChanged();
      }
      onDisplayedColumnsChanged() {
        if (!this.eGui) {
          return;
        }
        this.refreshAriaColIndex();
        this.refreshFirstAndLastStyles();
      }
      refreshFirstAndLastStyles() {
        const { comp: comp2, column: column2, beans } = this;
        refreshFirstAndLastStyles(comp2, column2, beans.visibleCols);
      }
      refreshAriaColIndex() {
        const colIdx = this.beans.visibleCols.getAriaColIndex(this.column);
        _setAriaColIndex(this.eGui, colIdx);
      }
      onWidthChanged() {
        return this.positionFeature?.onWidthChanged();
      }
      getRowPosition() {
        const { rowIndex, rowPinned } = this.cellPosition;
        return {
          rowIndex,
          rowPinned
        };
      }
      updateRangeBordersIfRangeCount() {
        if (!this.comp) {
          return;
        }
        this.rangeFeature?.updateRangeBordersIfRangeCount();
      }
      onCellSelectionChanged() {
        if (!this.comp) {
          return;
        }
        this.rangeFeature?.onCellSelectionChanged();
      }
      isRangeSelectionEnabled() {
        return this.rangeFeature != null;
      }
      focusCell(forceBrowserFocus = false, sourceEvent) {
        const allowedTarget = this.editSvc?.allowedFocusTargetOnValidation(this);
        if (allowedTarget && allowedTarget !== this) {
          return;
        }
        this.beans.focusSvc.setFocusedCell({
          ...this.getFocusedCellPosition(),
          forceBrowserFocus,
          sourceEvent
        });
      }
      /**
       * Restores focus to the cell, if it should have it
       * @param waitForRender if the cell has just setComp, it may not be rendered yet, so we wait for the next render
       */
      restoreFocus(waitForRender = false) {
        const {
          beans: { editSvc, focusSvc },
          comp: comp2
        } = this;
        if (!comp2 || editSvc?.isEditing(this) || !this.isCellFocused() || !focusSvc.shouldTakeFocus()) {
          return;
        }
        const focus = () => {
          if (!this.isAlive()) {
            return;
          }
          const focusableElement = comp2.getFocusableElement();
          if (this.isCellFocused()) {
            focusableElement.focus({ preventScroll: true });
          }
        };
        if (waitForRender) {
          setTimeout(focus, 0);
          return;
        }
        focus();
      }
      onRowIndexChanged() {
        this.createCellPosition();
        this.onCellFocused();
        this.restoreFocus();
        this.rangeFeature?.onCellSelectionChanged();
        this.rowResizeFeature?.refreshRowResizer();
      }
      onSuppressCellFocusChanged(suppressCellFocus) {
        const element = this.eGui;
        if (!element) {
          return;
        }
        if (isRowNumberCol(this.column)) {
          suppressCellFocus = true;
        }
        _addOrRemoveAttribute(element, "tabindex", suppressCellFocus ? void 0 : -1);
      }
      onFirstRightPinnedChanged() {
        if (!this.comp) {
          return;
        }
        const firstRightPinned = this.column.isFirstRightPinned();
        this.comp.toggleCss(CSS_CELL_FIRST_RIGHT_PINNED, firstRightPinned);
      }
      onLastLeftPinnedChanged() {
        if (!this.comp) {
          return;
        }
        const lastLeftPinned = this.column.isLastLeftPinned();
        this.comp.toggleCss(CSS_CELL_LAST_LEFT_PINNED, lastLeftPinned);
      }
      /**
       * Returns whether cell is focused by the focusSvc, overridden by spannedCellCtrl
       */
      checkCellFocused() {
        return this.beans.focusSvc.isCellFocused(this.cellPosition);
      }
      isCellFocused() {
        const isFocused = this.checkCellFocused();
        this.hasBeenFocused || (this.hasBeenFocused = isFocused);
        return isFocused;
      }
      setupFocus() {
        this.restoreFocus(true);
        this.onCellFocused(this.focusEventWhileNotReady ?? void 0);
      }
      onCellFocused(event) {
        const { beans } = this;
        if (_isCellFocusSuppressed(beans)) {
          return;
        }
        if (!this.comp) {
          if (event) {
            this.focusEventWhileNotReady = event;
          }
          return;
        }
        const cellFocused = this.isCellFocused();
        const editing = beans.editSvc?.isEditing(this) ?? false;
        this.comp.toggleCss(CSS_CELL_FOCUS, cellFocused);
        if (cellFocused && event?.forceBrowserFocus) {
          let focusEl = this.comp.getFocusableElement();
          if (editing) {
            const focusableEls = _findFocusableElements(focusEl, null, true);
            if (focusableEls.length) {
              focusEl = focusableEls[0];
            }
          }
          focusEl.focus({ preventScroll: !!event.preventScrollOnBrowserFocus });
        }
        if (cellFocused && event) {
          this.rowCtrl.announceDescription();
        }
      }
      createCellPosition() {
        const { rowIndex, rowPinned } = this.rowNode;
        this.cellPosition = {
          rowIndex,
          rowPinned: _makeNull(rowPinned),
          column: this.column
        };
      }
      // CSS Classes that only get applied once, they never change
      applyStaticCssClasses() {
        const { comp: comp2 } = this;
        comp2.toggleCss(CSS_CELL, true);
        comp2.toggleCss(CSS_CELL_NOT_INLINE_EDITING, true);
        const autoHeight = this.column.isAutoHeight() == true;
        comp2.toggleCss(CSS_AUTO_HEIGHT, autoHeight);
        comp2.toggleCss(CSS_NORMAL_HEIGHT, !autoHeight);
      }
      onColumnHover() {
        this.beans.colHover?.onCellColumnHover(this.column, this.comp);
      }
      onColDefChanged() {
        if (!this.comp) {
          return;
        }
        if (this.column.isTooltipEnabled()) {
          this.disableTooltipFeature();
          this.enableTooltipFeature();
        } else {
          this.disableTooltipFeature();
        }
        this.setWrapText();
        if (this.editSvc?.isEditing(this)) {
          this.editSvc?.handleColDefChanged(this);
        } else {
          this.refreshOrDestroyCell({ force: true, suppressFlash: true });
        }
      }
      setWrapText() {
        const value2 = this.column.getColDef().wrapText == true;
        this.comp.toggleCss(CSS_CELL_WRAP_TEXT, value2);
      }
      dispatchCellContextMenuEvent(event) {
        const colDef = this.column.getColDef();
        const cellContextMenuEvent = this.createEvent(event, "cellContextMenu");
        const { beans } = this;
        beans.eventSvc.dispatchEvent(cellContextMenuEvent);
        if (colDef.onCellContextMenu) {
          window.setTimeout(() => {
            beans.frameworkOverrides.wrapOutgoing(() => {
              colDef.onCellContextMenu(cellContextMenuEvent);
            });
          }, 0);
        }
      }
      getCellRenderer() {
        return this.comp?.getCellRenderer() ?? null;
      }
      destroy() {
        this.onCompAttachedFuncs = [];
        this.onEditorAttachedFuncs = [];
        if (this.isCellFocused() && this.hasBrowserFocus()) {
          this.beans.focusSvc.attemptToRecoverFocus();
        }
        super.destroy();
      }
      hasBrowserFocus() {
        return this.eGui?.contains(_getActiveDomElement(this.beans)) ?? false;
      }
      createSelectionCheckbox() {
        const cbSelectionComponent = this.beans.selectionSvc?.createCheckboxSelectionComponent();
        if (!cbSelectionComponent) {
          return void 0;
        }
        this.beans.context.createBean(cbSelectionComponent);
        cbSelectionComponent.init({ rowNode: this.rowNode, column: this.column });
        return cbSelectionComponent;
      }
      createDndSource() {
        const dndSourceComp = this.beans.registry.createDynamicBean(
          "dndSourceComp",
          false,
          this.rowNode,
          this.column,
          this.eGui
        );
        if (dndSourceComp) {
          this.beans.context.createBean(dndSourceComp);
        }
        return dndSourceComp;
      }
      registerRowDragger(customElement, dragStartPixels, alwaysVisible) {
        if (this.customRowDragComp) {
          this.customRowDragComp.setDragElement(customElement, dragStartPixels);
          return;
        }
        const newComp = this.createRowDragComp(customElement, dragStartPixels, alwaysVisible);
        if (newComp) {
          this.customRowDragComp = newComp;
          this.addDestroyFunc(() => {
            this.beans.context.destroyBean(newComp);
            this.customRowDragComp = null;
          });
          newComp.refreshVisibility();
        }
      }
      createRowDragComp(customElement, dragStartPixels, alwaysVisible) {
        const rowDragComp = this.beans.rowDragSvc?.createRowDragCompForCell(
          this.rowNode,
          this.column,
          () => this.value,
          customElement,
          dragStartPixels,
          alwaysVisible
        );
        if (!rowDragComp) {
          return void 0;
        }
        this.beans.context.createBean(rowDragComp);
        return rowDragComp;
      }
      cellEditorAttached() {
        for (const func of this.onEditorAttachedFuncs) {
          func();
        }
        this.onEditorAttachedFuncs = [];
      }
      setFocusedCellPosition(_cellPosition) {
      }
      getFocusedCellPosition() {
        return this.cellPosition;
      }
      // used by spannedCellCtrl
      refreshAriaRowIndex() {
      }
      /**
       * Returns the root element of the cell, could be a span container rather than the cell element.
       * @returns The root element of the cell.
       */
      getRootElement() {
        return this.eGui;
      }
    };
    function processClassRules(expressionSvc, previousClassRules, classRules, params, onApplicableClass, onNotApplicableClass) {
      if (classRules == null && previousClassRules == null) {
        return;
      }
      const classesToApply = {};
      const classesToRemove = {};
      const forEachSingleClass = (className2, callback) => {
        for (const singleClass of className2.split(" ")) {
          if (singleClass.trim() == "") {
            continue;
          }
          callback(singleClass);
        }
      };
      if (classRules) {
        const classNames = Object.keys(classRules);
        for (let i2 = 0; i2 < classNames.length; i2++) {
          const className2 = classNames[i2];
          const rule = classRules[className2];
          let resultOfRule;
          if (typeof rule === "string") {
            resultOfRule = expressionSvc ? expressionSvc.evaluate(rule, params) : true;
          } else if (typeof rule === "function") {
            resultOfRule = rule(params);
          }
          forEachSingleClass(className2, (singleClass) => {
            resultOfRule ? classesToApply[singleClass] = true : classesToRemove[singleClass] = true;
          });
        }
      }
      if (previousClassRules && onNotApplicableClass) {
        for (const className2 of Object.keys(previousClassRules)) {
          forEachSingleClass(className2, (singleClass) => {
            if (!classesToApply[singleClass]) {
              classesToRemove[singleClass] = true;
            }
          });
        }
      }
      if (onNotApplicableClass) {
        Object.keys(classesToRemove).forEach(onNotApplicableClass);
      }
      Object.keys(classesToApply).forEach(onApplicableClass);
    }
    function calculateRowLevel(rowNode) {
      if (rowNode.group) {
        return rowNode.level;
      }
      const parent = rowNode.parent;
      return parent ? parent.level + 1 : 0;
    }
    var RowStyleService = class extends BeanStub {
      constructor() {
        super(...arguments);
        this.beanName = "rowStyleSvc";
      }
      processClassesFromGridOptions(classes, rowNode) {
        const gos = this.gos;
        const process2 = (rowCls) => {
          if (typeof rowCls === "string") {
            classes.push(rowCls);
          } else if (Array.isArray(rowCls)) {
            for (const e of rowCls) {
              classes.push(e);
            }
          }
        };
        const rowClass = gos.get("rowClass");
        if (rowClass) {
          process2(rowClass);
        }
        const rowClassFunc = gos.getCallback("getRowClass");
        if (rowClassFunc) {
          const params = {
            data: rowNode.data,
            node: rowNode,
            rowIndex: rowNode.rowIndex
          };
          const rowClassFuncResult = rowClassFunc(params);
          process2(rowClassFuncResult);
        }
      }
      preProcessRowClassRules(classes, rowNode) {
        this.processRowClassRules(
          rowNode,
          (className2) => {
            classes.push(className2);
          },
          () => {
          }
        );
      }
      processRowClassRules(rowNode, onApplicableClass, onNotApplicableClass) {
        const { gos, expressionSvc } = this.beans;
        const rowClassParams = _addGridCommonParams(gos, {
          data: rowNode.data,
          node: rowNode,
          rowIndex: rowNode.rowIndex
        });
        processClassRules(
          expressionSvc,
          void 0,
          gos.get("rowClassRules"),
          rowClassParams,
          onApplicableClass,
          onNotApplicableClass
        );
      }
      processStylesFromGridOptions(rowNode) {
        const gos = this.gos;
        const rowStyle = gos.get("rowStyle");
        const rowStyleFunc = gos.getCallback("getRowStyle");
        let rowStyleFuncResult;
        if (rowStyleFunc) {
          const params = {
            data: rowNode.data,
            node: rowNode,
            rowIndex: rowNode.rowIndex
          };
          rowStyleFuncResult = rowStyleFunc(params);
        }
        if (rowStyleFuncResult || rowStyle) {
          return Object.assign({}, rowStyle, rowStyleFuncResult);
        }
        return void 0;
      }
    };
    var instanceIdSequence5 = 0;
    var RowCtrl = class extends BeanStub {
      constructor(rowNode, beans, animateIn, useAnimationFrameForCreate, printLayout) {
        super();
        this.rowNode = rowNode;
        this.useAnimationFrameForCreate = useAnimationFrameForCreate;
        this.printLayout = printLayout;
        this.allRowGuis = [];
        this.active = true;
        this.centerCellCtrls = { list: [], map: {} };
        this.leftCellCtrls = { list: [], map: {} };
        this.rightCellCtrls = { list: [], map: {} };
        this.slideInAnimation = {
          left: false,
          center: false,
          right: false,
          fullWidth: false
        };
        this.fadeInAnimation = {
          left: false,
          center: false,
          right: false,
          fullWidth: false
        };
        this.rowDragComps = [];
        this.lastMouseDownOnDragger = false;
        this.emptyStyle = {};
        this.updateColumnListsPending = false;
        this.rowId = null;
        this.businessKey = null;
        this.beans = beans;
        this.gos = beans.gos;
        this.paginationPage = beans.pagination?.getCurrentPage() ?? 0;
        this.suppressRowTransform = this.gos.get("suppressRowTransform");
        this.instanceId = rowNode.id + "-" + instanceIdSequence5++;
        this.rowId = _escapeString(rowNode.id);
        this.initRowBusinessKey();
        this.rowFocused = beans.focusSvc.isRowFocused(this.rowNode.rowIndex, this.rowNode.rowPinned);
        this.rowLevel = calculateRowLevel(this.rowNode);
        this.setRowType();
        this.setAnimateFlags(animateIn);
        this.rowStyles = this.processStylesFromGridOptions();
        this.rowEditStyleFeature = beans.editSvc?.createRowStyleFeature(this, beans);
        this.addListeners();
      }
      initRowBusinessKey() {
        this.businessKeyForNodeFunc = this.gos.get("getBusinessKeyForNode");
        this.updateRowBusinessKey();
      }
      updateRowBusinessKey() {
        if (typeof this.businessKeyForNodeFunc !== "function") {
          return;
        }
        const businessKey = this.businessKeyForNodeFunc(this.rowNode);
        this.businessKey = _escapeString(businessKey);
      }
      updateGui(containerType, gui) {
        if (containerType === "left") {
          this.leftGui = gui;
        } else if (containerType === "right") {
          this.rightGui = gui;
        } else if (containerType === "fullWidth") {
          this.fullWidthGui = gui;
        } else {
          this.centerGui = gui;
        }
      }
      setComp(rowComp, element, containerType, compBean) {
        const { context, focusSvc } = this.beans;
        compBean = setupCompBean(this, context, compBean);
        const gui = { rowComp, element, containerType, compBean };
        this.allRowGuis.push(gui);
        this.updateGui(containerType, gui);
        this.initialiseRowComp(gui);
        const rowNode = this.rowNode;
        const isSsrmLoadingRow = this.rowType === "FullWidthLoading" || rowNode.stub;
        const isIrmLoadingRow = !rowNode.data && this.beans.rowModel.getType() === "infinite";
        if (!isSsrmLoadingRow && !isIrmLoadingRow && !rowNode.rowPinned) {
          this.beans.rowRenderer.dispatchFirstDataRenderedEvent();
        }
        const focusableElement = this.fullWidthGui?.element;
        if (focusableElement) {
          const editing = this.beans.editSvc?.isEditing(this);
          if (!editing && focusSvc.isRowFocused(rowNode.rowIndex, rowNode.rowPinned) && focusSvc.shouldTakeFocus()) {
            setTimeout(() => focusableElement.focus({ preventScroll: true }), 0);
          }
        }
      }
      unsetComp(containerType) {
        this.allRowGuis = this.allRowGuis.filter((rowGui) => rowGui.containerType !== containerType);
        this.updateGui(containerType, void 0);
      }
      isCacheable() {
        return this.rowType === "FullWidthDetail" && this.gos.get("keepDetailRows");
      }
      setCached(cached) {
        const displayValue = cached ? "none" : "";
        for (const rg of this.allRowGuis) {
          rg.element.style.display = displayValue;
        }
      }
      initialiseRowComp(gui) {
        const gos = this.gos;
        this.onSuppressCellFocusChanged(this.beans.gos.get("suppressCellFocus"));
        this.listenOnDomOrder(gui);
        this.onRowHeightChanged(gui);
        this.updateRowIndexes(gui);
        this.setFocusedClasses(gui);
        this.setStylesFromGridOptions(false, gui);
        if (_isRowSelection(gos) && this.rowNode.selectable) {
          this.onRowSelected(gui);
        }
        this.updateColumnLists(!this.useAnimationFrameForCreate);
        const comp2 = gui.rowComp;
        const initialRowClasses = this.getInitialRowClasses(gui.containerType);
        for (const name2 of initialRowClasses) {
          comp2.toggleCss(name2, true);
        }
        this.executeSlideAndFadeAnimations(gui);
        if (this.rowNode.group) {
          _setAriaExpanded(gui.element, this.rowNode.expanded == true);
        }
        this.setRowCompRowId(comp2);
        this.setRowCompRowBusinessKey(comp2);
        _setDomData(gos, gui.element, DOM_DATA_KEY_ROW_CTRL, this);
        gui.compBean.addDestroyFunc(() => _setDomData(gos, gui.element, DOM_DATA_KEY_ROW_CTRL, null));
        if (this.useAnimationFrameForCreate) {
          this.beans.animationFrameSvc.createTask(
            this.addHoverFunctionality.bind(this, gui),
            this.rowNode.rowIndex,
            "p2",
            false
          );
        } else {
          this.addHoverFunctionality(gui);
        }
        if (this.isFullWidth()) {
          this.setupFullWidth(gui);
        }
        if (gos.get("rowDragEntireRow")) {
          this.addRowDraggerToRow(gui);
        }
        if (this.useAnimationFrameForCreate) {
          this.beans.animationFrameSvc.addDestroyTask(() => {
            if (!this.isAlive()) {
              return;
            }
            gui.rowComp.toggleCss("ag-after-created", true);
          });
        }
        this.executeProcessRowPostCreateFunc();
      }
      setRowCompRowBusinessKey(comp2) {
        if (this.businessKey == null) {
          return;
        }
        comp2.setRowBusinessKey(this.businessKey);
      }
      setRowCompRowId(comp2) {
        const rowId = _escapeString(this.rowNode.id);
        this.rowId = rowId;
        if (rowId == null) {
          return;
        }
        comp2.setRowId(rowId);
      }
      executeSlideAndFadeAnimations(gui) {
        const { containerType } = gui;
        const shouldSlide = this.slideInAnimation[containerType];
        if (shouldSlide) {
          _batchCall(() => {
            this.onTopChanged();
          });
          this.slideInAnimation[containerType] = false;
        }
        const shouldFade = this.fadeInAnimation[containerType];
        if (shouldFade) {
          _batchCall(() => {
            gui.rowComp.toggleCss("ag-opacity-zero", false);
          });
          this.fadeInAnimation[containerType] = false;
        }
      }
      addRowDraggerToRow(gui) {
        const rowDragComp = this.beans.rowDragSvc?.createRowDragCompForRow(this.rowNode, gui.element);
        if (!rowDragComp) {
          return;
        }
        const rowDragBean = this.createBean(rowDragComp, this.beans.context);
        this.rowDragComps.push(rowDragBean);
        gui.compBean.addDestroyFunc(() => {
          this.rowDragComps = this.rowDragComps.filter((r2) => r2 !== rowDragBean);
          this.rowEditStyleFeature = this.destroyBean(this.rowEditStyleFeature, this.beans.context);
          this.destroyBean(rowDragBean, this.beans.context);
        });
      }
      setupFullWidth(gui) {
        const pinned = this.getPinnedForContainer(gui.containerType);
        const compDetails = this.createFullWidthCompDetails(gui.element, pinned);
        gui.rowComp.showFullWidth(compDetails);
      }
      getFullWidthCellRenderers() {
        if (this.gos.get("embedFullWidthRows")) {
          return this.allRowGuis.map((gui) => gui?.rowComp?.getFullWidthCellRenderer());
        }
        return [this.fullWidthGui?.rowComp?.getFullWidthCellRenderer()];
      }
      executeProcessRowPostCreateFunc() {
        const func = this.gos.getCallback("processRowPostCreate");
        if (!func || !this.areAllContainersReady()) {
          return;
        }
        const params = {
          // areAllContainersReady asserts that centerGui is not null
          eRow: this.centerGui.element,
          ePinnedLeftRow: this.leftGui ? this.leftGui.element : void 0,
          ePinnedRightRow: this.rightGui ? this.rightGui.element : void 0,
          node: this.rowNode,
          rowIndex: this.rowNode.rowIndex,
          addRenderedRowListener: this.addEventListener.bind(this)
        };
        func(params);
      }
      areAllContainersReady() {
        const {
          leftGui,
          centerGui,
          rightGui,
          beans: { visibleCols }
        } = this;
        const isLeftReady = !!leftGui || !visibleCols.isPinningLeft();
        const isCenterReady = !!centerGui;
        const isRightReady = !!rightGui || !visibleCols.isPinningRight();
        return isLeftReady && isCenterReady && isRightReady;
      }
      isNodeFullWidthCell() {
        if (this.rowNode.detail) {
          return true;
        }
        const isFullWidthCellFunc = this.beans.gos.getCallback("isFullWidthRow");
        return isFullWidthCellFunc ? isFullWidthCellFunc({ rowNode: this.rowNode }) : false;
      }
      setRowType() {
        const isStub = this.rowNode.stub && !this.gos.get("suppressServerSideFullWidthLoadingRow") && !this.gos.get("groupHideOpenParents");
        const isFullWidthCell = this.isNodeFullWidthCell();
        const isDetailCell = this.gos.get("masterDetail") && this.rowNode.detail;
        const pivotMode = this.beans.colModel.isPivotMode();
        const isFullWidthGroup = _isFullWidthGroupRow(this.gos, this.rowNode, pivotMode);
        if (isStub) {
          this.rowType = "FullWidthLoading";
        } else if (isDetailCell) {
          this.rowType = "FullWidthDetail";
        } else if (isFullWidthCell) {
          this.rowType = "FullWidth";
        } else if (isFullWidthGroup) {
          this.rowType = "FullWidthGroup";
        } else {
          this.rowType = "Normal";
        }
      }
      updateColumnLists(suppressAnimationFrame = false, useFlushSync = false) {
        if (this.isFullWidth()) {
          return;
        }
        const { animationFrameSvc } = this.beans;
        const noAnimation = !animationFrameSvc?.active || suppressAnimationFrame || this.printLayout;
        if (noAnimation) {
          this.updateColumnListsImpl(useFlushSync);
          return;
        }
        if (this.updateColumnListsPending) {
          return;
        }
        animationFrameSvc.createTask(
          () => {
            if (!this.active) {
              return;
            }
            this.updateColumnListsImpl(true);
          },
          this.rowNode.rowIndex,
          "p1",
          false
        );
        this.updateColumnListsPending = true;
      }
      /**
       * Overridden by SpannedRowCtrl
       */
      getNewCellCtrl(col) {
        const isCellSpan = this.beans.rowSpanSvc?.isCellSpanning(col, this.rowNode);
        if (isCellSpan) {
          return void 0;
        }
        return new CellCtrl(col, this.rowNode, this.beans, this);
      }
      /**
       * Overridden by SpannedRowCtrl, if span context changes cell needs rebuilt
       */
      isCorrectCtrlForSpan(cell2) {
        return !this.beans.rowSpanSvc?.isCellSpanning(cell2.column, this.rowNode);
      }
      createCellCtrls(prev, cols, pinned = null) {
        const res = {
          list: [],
          map: {}
        };
        const addCell = (colInstanceId, cellCtrl, index) => {
          if (index != null) {
            res.list.splice(index, 0, cellCtrl);
          } else {
            res.list.push(cellCtrl);
          }
          res.map[colInstanceId] = cellCtrl;
        };
        const colsFromPrev = [];
        for (const col of cols) {
          const colInstanceId = col.getInstanceId();
          let cellCtrl = prev.map[colInstanceId];
          if (cellCtrl && !this.isCorrectCtrlForSpan(cellCtrl)) {
            cellCtrl.destroy();
            cellCtrl = void 0;
          }
          if (!cellCtrl) {
            cellCtrl = this.getNewCellCtrl(col);
          }
          if (!cellCtrl) {
            continue;
          }
          addCell(colInstanceId, cellCtrl);
        }
        for (const prevCellCtrl of prev.list) {
          const colInstanceId = prevCellCtrl.column.getInstanceId();
          const cellInResult = res.map[colInstanceId] != null;
          if (cellInResult) {
            continue;
          }
          const keepCell = !this.isCellEligibleToBeRemoved(prevCellCtrl, pinned);
          if (keepCell) {
            colsFromPrev.push([colInstanceId, prevCellCtrl]);
          } else {
            prevCellCtrl.destroy();
          }
        }
        if (colsFromPrev.length) {
          for (const [colInstanceId, cellCtrl] of colsFromPrev) {
            const index = res.list.findIndex((ctrl) => ctrl.column.getLeft() > cellCtrl.column.getLeft());
            const normalisedIndex = index === -1 ? void 0 : Math.max(index - 1, 0);
            addCell(colInstanceId, cellCtrl, normalisedIndex);
          }
        }
        const { focusSvc, visibleCols } = this.beans;
        const focusedCell = focusSvc.getFocusedCell();
        if (focusedCell && focusedCell.column.getPinned() == pinned) {
          const focusedColInstanceId = focusedCell.column.getInstanceId();
          const focusedCellCtrl = res.map[focusedColInstanceId];
          if (!focusedCellCtrl && visibleCols.allCols.includes(focusedCell.column)) {
            const cellCtrl = this.createFocusedCellCtrl();
            if (cellCtrl) {
              const index = res.list.findIndex((ctrl) => ctrl.column.getLeft() > cellCtrl.column.getLeft());
              const normalisedIndex = index === -1 ? void 0 : Math.max(index - 1, 0);
              addCell(focusedColInstanceId, cellCtrl, normalisedIndex);
            }
          }
        }
        return res;
      }
      /**
       * Creates a new cell ctrl for the focused cell, if this is the correct row ctrl.
       * @returns a CellCtrl for the focused cell, if required.
       */
      createFocusedCellCtrl() {
        const { focusSvc, rowSpanSvc } = this.beans;
        const focusedCell = focusSvc.getFocusedCell();
        if (!focusedCell) {
          return void 0;
        }
        const focusedSpan = rowSpanSvc?.getCellSpan(focusedCell.column, this.rowNode);
        if (focusedSpan) {
          if (focusedSpan.firstNode !== this.rowNode || !focusedSpan.doesSpanContain(focusedCell)) {
            return void 0;
          }
        } else if (!focusSvc.isRowFocused(this.rowNode.rowIndex, this.rowNode.rowPinned)) {
          return void 0;
        }
        return this.getNewCellCtrl(focusedCell.column);
      }
      updateColumnListsImpl(useFlushSync) {
        this.updateColumnListsPending = false;
        this.createAllCellCtrls();
        this.setCellCtrls(useFlushSync);
      }
      setCellCtrls(useFlushSync) {
        for (const item2 of this.allRowGuis) {
          const cellControls = this.getCellCtrlsForContainer(item2.containerType);
          item2.rowComp.setCellCtrls(cellControls, useFlushSync);
        }
      }
      getCellCtrlsForContainer(containerType) {
        switch (containerType) {
          case "left":
            return this.leftCellCtrls.list;
          case "right":
            return this.rightCellCtrls.list;
          case "fullWidth":
            return [];
          case "center":
            return this.centerCellCtrls.list;
        }
      }
      createAllCellCtrls() {
        const colViewport = this.beans.colViewport;
        const presentedColsService = this.beans.visibleCols;
        if (this.printLayout) {
          this.centerCellCtrls = this.createCellCtrls(this.centerCellCtrls, presentedColsService.allCols);
          this.leftCellCtrls = { list: [], map: {} };
          this.rightCellCtrls = { list: [], map: {} };
        } else {
          const centerCols = colViewport.getColsWithinViewport(this.rowNode);
          this.centerCellCtrls = this.createCellCtrls(this.centerCellCtrls, centerCols);
          const leftCols = presentedColsService.getLeftColsForRow(this.rowNode);
          this.leftCellCtrls = this.createCellCtrls(this.leftCellCtrls, leftCols, "left");
          const rightCols = presentedColsService.getRightColsForRow(this.rowNode);
          this.rightCellCtrls = this.createCellCtrls(this.rightCellCtrls, rightCols, "right");
        }
      }
      isCellEligibleToBeRemoved(cellCtrl, nextContainerPinned) {
        const REMOVE_CELL = true;
        const KEEP_CELL = false;
        const { column: column2 } = cellCtrl;
        if (column2.getPinned() != nextContainerPinned) {
          return REMOVE_CELL;
        }
        if (!this.isCorrectCtrlForSpan(cellCtrl)) {
          return REMOVE_CELL;
        }
        const { visibleCols, editSvc } = this.beans;
        const editing = editSvc?.isEditing(cellCtrl);
        const focused = cellCtrl.isCellFocused();
        const mightWantToKeepCell = editing || focused;
        if (mightWantToKeepCell) {
          const displayedColumns = visibleCols.allCols;
          const cellStillDisplayed = displayedColumns.indexOf(column2) >= 0;
          return cellStillDisplayed ? KEEP_CELL : REMOVE_CELL;
        }
        return REMOVE_CELL;
      }
      getDomOrder() {
        const isEnsureDomOrder = this.gos.get("ensureDomOrder");
        return isEnsureDomOrder || _isDomLayout(this.gos, "print");
      }
      listenOnDomOrder(gui) {
        const listener = () => {
          gui.rowComp.setDomOrder(this.getDomOrder());
        };
        gui.compBean.addManagedPropertyListeners(["domLayout", "ensureDomOrder"], listener);
      }
      setAnimateFlags(animateIn) {
        if (this.rowNode.sticky || !animateIn) {
          return;
        }
        const oldRowTopExists = _exists(this.rowNode.oldRowTop);
        const { visibleCols } = this.beans;
        const pinningLeft = visibleCols.isPinningLeft();
        const pinningRight = visibleCols.isPinningRight();
        if (oldRowTopExists) {
          const { slideInAnimation } = this;
          if (this.isFullWidth() && !this.gos.get("embedFullWidthRows")) {
            slideInAnimation.fullWidth = true;
            return;
          }
          slideInAnimation.center = true;
          slideInAnimation.left = pinningLeft;
          slideInAnimation.right = pinningRight;
        } else {
          const { fadeInAnimation } = this;
          if (this.isFullWidth() && !this.gos.get("embedFullWidthRows")) {
            fadeInAnimation.fullWidth = true;
            return;
          }
          fadeInAnimation.center = true;
          fadeInAnimation.left = pinningLeft;
          fadeInAnimation.right = pinningRight;
        }
      }
      isFullWidth() {
        return this.rowType !== "Normal";
      }
      refreshFullWidth() {
        const tryRefresh = (gui, pinned) => {
          if (!gui) {
            return true;
          }
          return gui.rowComp.refreshFullWidth(() => {
            const compDetails = this.createFullWidthCompDetails(gui.element, pinned);
            return compDetails.params;
          });
        };
        const fullWidthSuccess = tryRefresh(this.fullWidthGui, null);
        const centerSuccess = tryRefresh(this.centerGui, null);
        const leftSuccess = tryRefresh(this.leftGui, "left");
        const rightSuccess = tryRefresh(this.rightGui, "right");
        const allFullWidthRowsRefreshed = fullWidthSuccess && centerSuccess && leftSuccess && rightSuccess;
        return allFullWidthRowsRefreshed;
      }
      addListeners() {
        const { beans, gos, rowNode } = this;
        const { expansionSvc, eventSvc, context, rowSpanSvc } = beans;
        this.addManagedListeners(this.rowNode, {
          heightChanged: () => this.onRowHeightChanged(),
          rowSelected: () => this.onRowSelected(),
          rowIndexChanged: this.onRowIndexChanged.bind(this),
          topChanged: this.onTopChanged.bind(this),
          ...expansionSvc?.getRowExpandedListeners(this) ?? {}
        });
        if (rowNode.detail) {
          this.addManagedListeners(rowNode.parent, { dataChanged: this.onRowNodeDataChanged.bind(this) });
        }
        this.addManagedListeners(rowNode, {
          dataChanged: this.onRowNodeDataChanged.bind(this),
          cellChanged: this.postProcessCss.bind(this),
          rowHighlightChanged: this.onRowNodeHighlightChanged.bind(this),
          draggingChanged: this.postProcessRowDragging.bind(this),
          uiLevelChanged: this.onUiLevelChanged.bind(this),
          rowPinned: this.onRowPinned.bind(this)
        });
        this.addManagedListeners(eventSvc, {
          paginationPixelOffsetChanged: this.onPaginationPixelOffsetChanged.bind(this),
          heightScaleChanged: this.onTopChanged.bind(this),
          displayedColumnsChanged: this.onDisplayedColumnsChanged.bind(this),
          virtualColumnsChanged: this.onVirtualColumnsChanged.bind(this),
          cellFocused: this.onCellFocusChanged.bind(this),
          cellFocusCleared: this.onCellFocusChanged.bind(this),
          paginationChanged: this.onPaginationChanged.bind(this),
          modelUpdated: this.refreshFirstAndLastRowStyles.bind(this),
          columnMoved: () => this.updateColumnLists()
        });
        if (rowSpanSvc) {
          this.addManagedListeners(rowSpanSvc, {
            spannedCellsUpdated: ({ pinned }) => {
              if (pinned && !rowNode.rowPinned) {
                return;
              }
              this.updateColumnLists();
            }
          });
        }
        this.addDestroyFunc(() => {
          this.rowDragComps = this.destroyBeans(this.rowDragComps, context);
          this.tooltipFeature = this.destroyBean(this.tooltipFeature, context);
          this.rowEditStyleFeature = this.destroyBean(this.rowEditStyleFeature, context);
        });
        this.addManagedPropertyListeners(
          ["rowStyle", "getRowStyle", "rowClass", "getRowClass", "rowClassRules"],
          this.postProcessCss.bind(this)
        );
        this.addManagedPropertyListener("rowDragEntireRow", () => {
          const useRowDragEntireRow = gos.get("rowDragEntireRow");
          if (useRowDragEntireRow) {
            for (const gui of this.allRowGuis) {
              this.addRowDraggerToRow(gui);
            }
            return;
          }
          this.rowDragComps = this.destroyBeans(this.rowDragComps, context);
        });
        this.addListenersForCellComps();
      }
      addListenersForCellComps() {
        this.addManagedListeners(this.rowNode, {
          rowIndexChanged: () => {
            for (const cellCtrl of this.getAllCellCtrls()) {
              cellCtrl.onRowIndexChanged();
            }
          },
          cellChanged: (event) => {
            for (const cellCtrl of this.getAllCellCtrls()) {
              cellCtrl.onCellChanged(event);
            }
          }
        });
      }
      /** Should only ever be triggered on source rows (i.e. not on pinned siblings) */
      onRowPinned() {
        for (const gui of this.allRowGuis) {
          gui.rowComp.toggleCss("ag-row-pinned-source", !!this.rowNode.pinnedSibling);
        }
      }
      onRowNodeDataChanged(event) {
        this.refreshRow({
          suppressFlash: !event.update,
          newData: !event.update
        });
      }
      refreshRow(params) {
        const fullWidthChanged = this.isFullWidth() !== !!this.isNodeFullWidthCell();
        if (fullWidthChanged) {
          this.beans.rowRenderer.redrawRow(this.rowNode);
          return;
        }
        if (this.isFullWidth()) {
          const refresh = this.refreshFullWidth();
          if (!refresh) {
            this.beans.rowRenderer.redrawRow(this.rowNode);
          }
          return;
        }
        for (const cellCtrl of this.getAllCellCtrls()) {
          cellCtrl.refreshCell(params);
        }
        for (const gui of this.allRowGuis) {
          this.setRowCompRowId(gui.rowComp);
          this.updateRowBusinessKey();
          this.setRowCompRowBusinessKey(gui.rowComp);
        }
        this.onRowSelected();
        this.postProcessCss();
      }
      postProcessCss() {
        this.setStylesFromGridOptions(true);
        this.postProcessClassesFromGridOptions();
        this.postProcessRowClassRules();
        this.rowEditStyleFeature?.applyRowStyles();
        this.postProcessRowDragging();
      }
      onRowNodeHighlightChanged() {
        const rowDropHighlightSvc = this.beans.rowDropHighlightSvc;
        const highlighted = rowDropHighlightSvc?.row === this.rowNode ? rowDropHighlightSvc.position : "none";
        const aboveOn = highlighted === "above";
        const insideOn = highlighted === "inside";
        const belowOn = highlighted === "below";
        const treeData = this.gos.get("treeData");
        const indented2 = treeData && (belowOn || aboveOn);
        const uiLevel = this.rowNode.uiLevel.toString();
        for (const gui of this.allRowGuis) {
          const rowComp = gui.rowComp;
          rowComp.toggleCss("ag-row-highlight-above", aboveOn);
          rowComp.toggleCss("ag-row-highlight-inside", insideOn);
          rowComp.toggleCss("ag-row-highlight-below", belowOn);
          rowComp.toggleCss("ag-row-highlight-indent", indented2);
          if (indented2) {
            gui.element.style.setProperty("--ag-row-highlight-level", uiLevel);
          } else {
            gui.element.style.removeProperty("--ag-row-highlight-level");
          }
        }
      }
      postProcessRowDragging() {
        const dragging = this.rowNode.dragging;
        for (const gui of this.allRowGuis) {
          gui.rowComp.toggleCss("ag-row-dragging", dragging);
        }
      }
      onDisplayedColumnsChanged() {
        this.updateColumnLists(true);
        this.beans.rowAutoHeight?.requestCheckAutoHeight();
      }
      onVirtualColumnsChanged() {
        this.updateColumnLists(false, true);
      }
      getRowPosition() {
        return {
          rowPinned: _makeNull(this.rowNode.rowPinned),
          rowIndex: this.rowNode.rowIndex
        };
      }
      onKeyboardNavigate(keyboardEvent) {
        const groupInfo = this.findFullWidthInfoForEvent(keyboardEvent);
        if (!groupInfo) {
          return;
        }
        const { rowGui, column: column2 } = groupInfo;
        const currentFullWidthContainer = rowGui.element;
        const isFullWidthContainerFocused = currentFullWidthContainer === keyboardEvent.target;
        if (!isFullWidthContainerFocused) {
          return;
        }
        const node2 = this.rowNode;
        const { focusSvc, navigation: navigation2 } = this.beans;
        const lastFocusedCell = focusSvc.getFocusedCell();
        const cellPosition = {
          rowIndex: node2.rowIndex,
          rowPinned: node2.rowPinned,
          column: lastFocusedCell?.column ?? column2
        };
        navigation2?.navigateToNextCell(keyboardEvent, keyboardEvent.key, cellPosition, true);
        keyboardEvent.preventDefault();
      }
      onTabKeyDown(keyboardEvent) {
        if (keyboardEvent.defaultPrevented || _isStopPropagationForAgGrid(keyboardEvent)) {
          return;
        }
        const currentFullWidthComp = this.allRowGuis.find(
          (c2) => c2.element.contains(keyboardEvent.target)
        );
        const currentFullWidthContainer = currentFullWidthComp ? currentFullWidthComp.element : null;
        const isFullWidthContainerFocused = currentFullWidthContainer === keyboardEvent.target;
        const activeEl = _getActiveDomElement(this.beans);
        let isDetailGridCellFocused = false;
        if (currentFullWidthContainer && activeEl) {
          isDetailGridCellFocused = currentFullWidthContainer.contains(activeEl) && activeEl.classList.contains("ag-cell");
        }
        let nextEl = null;
        if (!isFullWidthContainerFocused && !isDetailGridCellFocused) {
          nextEl = _findNextFocusableElement(this.beans, currentFullWidthContainer, false, keyboardEvent.shiftKey);
        }
        if (this.isFullWidth() && isFullWidthContainerFocused || !nextEl) {
          this.beans.navigation?.onTabKeyDown(this, keyboardEvent);
        }
      }
      getFullWidthElement() {
        if (this.fullWidthGui) {
          return this.fullWidthGui.element;
        }
        return null;
      }
      getRowYPosition() {
        const displayedEl = this.allRowGuis.find((el2) => _isVisible(el2.element))?.element;
        if (displayedEl) {
          return displayedEl.getBoundingClientRect().top;
        }
        return 0;
      }
      onSuppressCellFocusChanged(suppressCellFocus) {
        const tabIndex = this.isFullWidth() && suppressCellFocus ? void 0 : this.gos.get("tabIndex");
        for (const gui of this.allRowGuis) {
          _addOrRemoveAttribute(gui.element, "tabindex", tabIndex);
        }
      }
      onFullWidthRowFocused(event) {
        const node2 = this.rowNode;
        const isFocused = !event ? false : this.isFullWidth() && event.rowIndex === node2.rowIndex && event.rowPinned == node2.rowPinned;
        let element;
        if (this.fullWidthGui) {
          element = this.fullWidthGui.element;
        } else {
          const column2 = this.beans.colModel.getCol(event?.column);
          const pinned = column2?.pinned;
          if (pinned) {
            element = pinned === "right" ? this.rightGui?.element : this.leftGui?.element;
          } else {
            element = this.centerGui?.element;
          }
        }
        if (!element) {
          return;
        }
        element.classList.toggle("ag-full-width-focus", isFocused);
        if (isFocused && event?.forceBrowserFocus) {
          element.focus({ preventScroll: true });
        }
      }
      recreateCell(cellCtrl) {
        this.centerCellCtrls = this.removeCellCtrl(this.centerCellCtrls, cellCtrl);
        this.leftCellCtrls = this.removeCellCtrl(this.leftCellCtrls, cellCtrl);
        this.rightCellCtrls = this.removeCellCtrl(this.rightCellCtrls, cellCtrl);
        cellCtrl.destroy();
        this.updateColumnLists();
      }
      removeCellCtrl(prev, cellCtrlToRemove) {
        const res = {
          list: [],
          map: {}
        };
        for (const cellCtrl of prev.list) {
          if (cellCtrl === cellCtrlToRemove) {
            continue;
          }
          res.list.push(cellCtrl);
          res.map[cellCtrl.column.getInstanceId()] = cellCtrl;
        }
        return res;
      }
      onMouseEvent(eventName, mouseEvent) {
        switch (eventName) {
          case "dblclick":
            this.onRowDblClick(mouseEvent);
            break;
          case "click":
            this.onRowClick(mouseEvent);
            break;
          case "touchstart":
          case "mousedown":
            this.onRowMouseDown(mouseEvent);
            break;
        }
      }
      createRowEvent(type, domEvent) {
        const { rowNode } = this;
        return _addGridCommonParams(this.gos, {
          type,
          node: rowNode,
          data: rowNode.data,
          rowIndex: rowNode.rowIndex,
          rowPinned: rowNode.rowPinned,
          event: domEvent
        });
      }
      createRowEventWithSource(type, domEvent) {
        const event = this.createRowEvent(type, domEvent);
        event.source = this;
        return event;
      }
      onRowDblClick(mouseEvent) {
        if (_isStopPropagationForAgGrid(mouseEvent)) {
          return;
        }
        const rowEvent = this.createRowEventWithSource("rowDoubleClicked", mouseEvent);
        rowEvent.isEventHandlingSuppressed = this.isSuppressMouseEvent(mouseEvent);
        this.beans.eventSvc.dispatchEvent(rowEvent);
      }
      findFullWidthInfoForEvent(event) {
        if (!event) {
          return;
        }
        const rowGui = this.findFullWidthRowGui(event.target);
        const column2 = this.getColumnForFullWidth(rowGui);
        if (!rowGui || !column2) {
          return;
        }
        return { rowGui, column: column2 };
      }
      findFullWidthRowGui(target2) {
        return this.allRowGuis.find((c2) => c2.element.contains(target2));
      }
      getColumnForFullWidth(fullWidthRowGui) {
        const { visibleCols } = this.beans;
        switch (fullWidthRowGui?.containerType) {
          case "center":
            return visibleCols.centerCols[0];
          case "left":
            return visibleCols.leftCols[0];
          case "right":
            return visibleCols.rightCols[0];
          default:
            return visibleCols.allCols[0];
        }
      }
      onRowMouseDown(mouseEvent) {
        this.lastMouseDownOnDragger = _isElementChildOfClass(mouseEvent.target, "ag-row-drag", 3);
        if (!this.isFullWidth() || this.isSuppressMouseEvent(mouseEvent)) {
          return;
        }
        const { rangeSvc, focusSvc } = this.beans;
        rangeSvc?.removeAllCellRanges();
        const groupInfo = this.findFullWidthInfoForEvent(mouseEvent);
        if (!groupInfo) {
          return;
        }
        const { rowGui, column: column2 } = groupInfo;
        const element = rowGui.element;
        const target2 = mouseEvent.target;
        const node2 = this.rowNode;
        let forceBrowserFocus = mouseEvent.defaultPrevented || _isBrowserSafari();
        if (element && element.contains(target2) && _isFocusableFormField(target2)) {
          forceBrowserFocus = false;
        }
        focusSvc.setFocusedCell({
          rowIndex: node2.rowIndex,
          column: column2,
          rowPinned: node2.rowPinned,
          forceBrowserFocus
        });
      }
      isSuppressMouseEvent(mouseEvent) {
        const { gos, rowNode } = this;
        if (this.isFullWidth()) {
          const fullWidthRowGui = this.findFullWidthRowGui(mouseEvent.target);
          return _suppressFullWidthMouseEvent(
            gos,
            fullWidthRowGui?.rowComp.getFullWidthCellRendererParams(),
            rowNode,
            mouseEvent
          );
        }
        const cellCtrl = _getCellCtrlForEventTarget(gos, mouseEvent.target);
        return cellCtrl != null && _suppressCellMouseEvent(gos, cellCtrl.column, rowNode, mouseEvent);
      }
      onRowClick(mouseEvent) {
        const stop = _isStopPropagationForAgGrid(mouseEvent) || this.lastMouseDownOnDragger;
        if (stop) {
          return;
        }
        const isSuppressMouseEvent = this.isSuppressMouseEvent(mouseEvent);
        const { eventSvc, selectionSvc } = this.beans;
        const rowEvent = this.createRowEventWithSource("rowClicked", mouseEvent);
        rowEvent.isEventHandlingSuppressed = isSuppressMouseEvent;
        eventSvc.dispatchEvent(rowEvent);
        if (isSuppressMouseEvent) {
          return;
        }
        selectionSvc?.handleSelectionEvent(mouseEvent, this.rowNode, "rowClicked");
      }
      setupDetailRowAutoHeight(eDetailGui) {
        if (this.rowType !== "FullWidthDetail") {
          return;
        }
        this.beans.masterDetailSvc?.setupDetailRowAutoHeight(this, eDetailGui);
      }
      createFullWidthCompDetails(eRow, pinned) {
        const { gos, rowNode } = this;
        const params = _addGridCommonParams(gos, {
          fullWidth: true,
          data: rowNode.data,
          node: rowNode,
          value: rowNode.key,
          valueFormatted: rowNode.key,
          // these need to be taken out, as part of 'afterAttached' now
          eGridCell: eRow,
          eParentOfValue: eRow,
          pinned,
          addRenderedRowListener: this.addEventListener.bind(this),
          // This is not on the type of ICellRendererParams
          registerRowDragger: (rowDraggerElement, dragStartPixels, value2, rowDragEntireRow) => this.addFullWidthRowDragging(rowDraggerElement, dragStartPixels, value2, rowDragEntireRow),
          setTooltip: (value2, shouldDisplayTooltip) => {
            gos.assertModuleRegistered("Tooltip", 3);
            this.setupFullWidthRowTooltip(value2, shouldDisplayTooltip);
          }
        });
        const compFactory = this.beans.userCompFactory;
        switch (this.rowType) {
          case "FullWidthDetail":
            return _getFullWidthDetailCellRendererDetails(compFactory, params);
          case "FullWidthGroup": {
            const { value: value2, valueFormatted } = this.beans.valueSvc.getValueForDisplay(void 0, this.rowNode, true);
            params.value = value2;
            params.valueFormatted = valueFormatted;
            return _getFullWidthGroupCellRendererDetails(compFactory, params);
          }
          case "FullWidthLoading":
            return _getFullWidthLoadingCellRendererDetails(compFactory, params);
          default:
            return _getFullWidthCellRendererDetails(compFactory, params);
        }
      }
      setupFullWidthRowTooltip(value2, shouldDisplayTooltip) {
        if (!this.fullWidthGui) {
          return;
        }
        this.tooltipFeature = this.beans.tooltipSvc?.setupFullWidthRowTooltip(
          this.tooltipFeature,
          this,
          value2,
          shouldDisplayTooltip
        );
      }
      addFullWidthRowDragging(rowDraggerElement, dragStartPixels, value2 = "", alwaysVisible) {
        const { rowDragSvc, context } = this.beans;
        if (!rowDragSvc || !this.isFullWidth()) {
          return;
        }
        const rowDragComp = rowDragSvc.createRowDragComp(
          () => value2,
          this.rowNode,
          void 0,
          rowDraggerElement,
          dragStartPixels,
          alwaysVisible
        );
        this.createBean(rowDragComp, context);
        this.addDestroyFunc(() => {
          this.destroyBean(rowDragComp, context);
        });
      }
      onUiLevelChanged() {
        const newLevel = calculateRowLevel(this.rowNode);
        if (this.rowLevel != newLevel) {
          const classToAdd = "ag-row-level-" + newLevel;
          const classToRemove = "ag-row-level-" + this.rowLevel;
          for (const gui of this.allRowGuis) {
            gui.rowComp.toggleCss(classToAdd, true);
            gui.rowComp.toggleCss(classToRemove, false);
          }
        }
        this.rowLevel = newLevel;
      }
      isFirstRowOnPage() {
        return this.rowNode.rowIndex === this.beans.pageBounds.getFirstRow();
      }
      isLastRowOnPage() {
        return this.rowNode.rowIndex === this.beans.pageBounds.getLastRow();
      }
      refreshFirstAndLastRowStyles() {
        const newFirst = this.isFirstRowOnPage();
        const newLast = this.isLastRowOnPage();
        if (this.firstRowOnPage !== newFirst) {
          this.firstRowOnPage = newFirst;
          for (const gui of this.allRowGuis) {
            gui.rowComp.toggleCss("ag-row-first", newFirst);
          }
        }
        if (this.lastRowOnPage !== newLast) {
          this.lastRowOnPage = newLast;
          for (const gui of this.allRowGuis) {
            gui.rowComp.toggleCss("ag-row-last", newLast);
          }
        }
      }
      getAllCellCtrls() {
        if (this.leftCellCtrls.list.length === 0 && this.rightCellCtrls.list.length === 0) {
          return this.centerCellCtrls.list;
        }
        const res = [...this.centerCellCtrls.list, ...this.leftCellCtrls.list, ...this.rightCellCtrls.list];
        return res;
      }
      postProcessClassesFromGridOptions() {
        const cssClasses = [];
        this.beans.rowStyleSvc?.processClassesFromGridOptions(cssClasses, this.rowNode);
        if (!cssClasses.length) {
          return;
        }
        for (const classStr of cssClasses) {
          for (const c2 of this.allRowGuis) {
            c2.rowComp.toggleCss(classStr, true);
          }
        }
      }
      postProcessRowClassRules() {
        this.beans.rowStyleSvc?.processRowClassRules(
          this.rowNode,
          (className2) => {
            for (const gui of this.allRowGuis) {
              gui.rowComp.toggleCss(className2, true);
            }
          },
          (className2) => {
            for (const gui of this.allRowGuis) {
              gui.rowComp.toggleCss(className2, false);
            }
          }
        );
      }
      setStylesFromGridOptions(updateStyles, gui) {
        if (updateStyles) {
          this.rowStyles = this.processStylesFromGridOptions();
        }
        this.forEachGui(gui, (gui2) => gui2.rowComp.setUserStyles(this.rowStyles));
      }
      getPinnedForContainer(rowContainerType) {
        if (rowContainerType === "left" || rowContainerType === "right") {
          return rowContainerType;
        }
        return null;
      }
      getInitialRowClasses(rowContainerType) {
        const pinned = this.getPinnedForContainer(rowContainerType);
        const fullWidthRow = this.isFullWidth();
        const { rowNode, beans } = this;
        const classes = [];
        classes.push("ag-row");
        classes.push(this.rowFocused ? "ag-row-focus" : "ag-row-no-focus");
        if (this.fadeInAnimation[rowContainerType]) {
          classes.push("ag-opacity-zero");
        }
        classes.push(rowNode.rowIndex % 2 === 0 ? "ag-row-even" : "ag-row-odd");
        if (rowNode.isRowPinned()) {
          classes.push("ag-row-pinned");
          if (beans.pinnedRowModel?.isManual()) {
            classes.push("ag-row-pinned-manual");
          }
        }
        if (!rowNode.isRowPinned() && rowNode.pinnedSibling) {
          classes.push("ag-row-pinned-source");
        }
        if (rowNode.isSelected()) {
          classes.push("ag-row-selected");
        }
        if (rowNode.footer) {
          classes.push("ag-row-footer");
        }
        classes.push("ag-row-level-" + this.rowLevel);
        if (rowNode.stub) {
          classes.push("ag-row-loading");
        }
        if (fullWidthRow) {
          classes.push("ag-full-width-row");
        }
        beans.expansionSvc?.addExpandedCss(classes, rowNode);
        if (rowNode.dragging) {
          classes.push("ag-row-dragging");
        }
        const { rowStyleSvc } = beans;
        if (rowStyleSvc) {
          rowStyleSvc.processClassesFromGridOptions(classes, rowNode);
          rowStyleSvc.preProcessRowClassRules(classes, rowNode);
        }
        classes.push(this.printLayout ? "ag-row-position-relative" : "ag-row-position-absolute");
        if (this.isFirstRowOnPage()) {
          classes.push("ag-row-first");
        }
        if (this.isLastRowOnPage()) {
          classes.push("ag-row-last");
        }
        if (fullWidthRow) {
          if (pinned === "left") {
            classes.push("ag-cell-last-left-pinned");
          }
          if (pinned === "right") {
            classes.push("ag-cell-first-right-pinned");
          }
        }
        return classes;
      }
      processStylesFromGridOptions() {
        return this.beans.rowStyleSvc?.processStylesFromGridOptions(this.rowNode) ?? this.emptyStyle;
      }
      onRowSelected(gui) {
        this.beans.selectionSvc?.onRowCtrlSelected(
          this,
          (gui2) => {
            if (gui2 === this.centerGui || gui2 === this.fullWidthGui) {
              this.announceDescription();
            }
          },
          gui
        );
      }
      announceDescription() {
        this.beans.selectionSvc?.announceAriaRowSelection(this.rowNode);
      }
      addHoverFunctionality(eGui) {
        if (!this.active) {
          return;
        }
        const { element, compBean } = eGui;
        const { rowNode, beans, gos } = this;
        compBean.addManagedListeners(element, {
          // We use pointer events here instead of mouse events, as pointer events
          // are more reliable for hover detection, especially with touch devices
          // or hybrid touch + mouse devices.
          pointerenter: (e) => {
            if (e.pointerType === "mouse") {
              rowNode.dispatchRowEvent("mouseEnter");
            }
          },
          pointerleave: (e) => {
            if (e.pointerType === "mouse") {
              rowNode.dispatchRowEvent("mouseLeave");
            }
          }
        });
        compBean.addManagedListeners(rowNode, {
          mouseEnter: () => {
            if (!beans.dragSvc?.dragging && !gos.get("suppressRowHoverHighlight")) {
              element.classList.add("ag-row-hover");
              rowNode.setHovered(true);
            }
          },
          mouseLeave: () => {
            this.resetHoveredStatus(element);
          }
        });
      }
      resetHoveredStatus(el2) {
        const elements = el2 ? [el2] : this.allRowGuis.map((gui) => gui.element);
        for (const element of elements) {
          element.classList.remove("ag-row-hover");
        }
        this.rowNode.setHovered(false);
      }
      // for animation, we don't want to animate entry or exit to a very far away pixel,
      // otherwise the row would move so fast, it would appear to disappear. so this method
      // moves the row closer to the viewport if it is far away, so the row slide in / out
      // at a speed the user can see.
      roundRowTopToBounds(rowTop) {
        const range2 = this.beans.ctrlsSvc.getScrollFeature().getApproximateVScollPosition();
        const minPixel = this.applyPaginationOffset(range2.top, true) - 100;
        const maxPixel = this.applyPaginationOffset(range2.bottom, true) + 100;
        return Math.min(Math.max(minPixel, rowTop), maxPixel);
      }
      forEachGui(gui, callback) {
        if (gui) {
          callback(gui);
        } else {
          for (const gui2 of this.allRowGuis) {
            callback(gui2);
          }
        }
      }
      isRowRendered() {
        return this.allRowGuis.length > 0;
      }
      onRowHeightChanged(gui) {
        if (this.rowNode.rowHeight == null) {
          return;
        }
        const rowHeight = this.rowNode.rowHeight;
        const defaultRowHeight = this.beans.environment.getDefaultRowHeight();
        const isHeightFromFunc = _isGetRowHeightFunction(this.gos);
        const heightFromFunc = isHeightFromFunc ? _getRowHeightForNode(this.beans, this.rowNode).height : void 0;
        const lineHeight = heightFromFunc ? `${Math.min(defaultRowHeight, heightFromFunc) - 2}px` : void 0;
        this.forEachGui(gui, (gui2) => {
          gui2.element.style.height = `${rowHeight}px`;
          if (lineHeight) {
            gui2.element.style.setProperty("--ag-line-height", lineHeight);
          }
        });
      }
      // note - this is NOT called by context, as we don't wire / unwire the CellComp for performance reasons.
      destroyFirstPass(suppressAnimation = false) {
        this.active = false;
        const { rowNode } = this;
        if (!suppressAnimation && _isAnimateRows(this.gos) && !rowNode.sticky) {
          const rowStillVisibleJustNotInViewport = rowNode.rowTop != null;
          if (rowStillVisibleJustNotInViewport) {
            const rowTop = this.roundRowTopToBounds(rowNode.rowTop);
            this.setRowTop(rowTop);
          } else {
            for (const gui of this.allRowGuis) {
              gui.rowComp.toggleCss("ag-opacity-zero", true);
            }
          }
        }
        if (this.fullWidthGui?.element.contains(_getActiveDomElement(this.beans))) {
          this.beans.focusSvc.attemptToRecoverFocus();
        }
        rowNode.setHovered(false);
        const event = this.createRowEvent("virtualRowRemoved");
        this.dispatchLocalEvent(event);
        this.beans.eventSvc.dispatchEvent(event);
        super.destroy();
      }
      destroySecondPass() {
        this.allRowGuis.length = 0;
        const destroyCellCtrls = (ctrls) => {
          for (const c2 of ctrls.list) {
            c2.destroy();
          }
          return { list: [], map: {} };
        };
        this.centerCellCtrls = destroyCellCtrls(this.centerCellCtrls);
        this.leftCellCtrls = destroyCellCtrls(this.leftCellCtrls);
        this.rightCellCtrls = destroyCellCtrls(this.rightCellCtrls);
      }
      setFocusedClasses(gui) {
        this.forEachGui(gui, (gui2) => {
          gui2.rowComp.toggleCss("ag-row-focus", this.rowFocused);
          gui2.rowComp.toggleCss("ag-row-no-focus", !this.rowFocused);
        });
      }
      onCellFocusChanged() {
        const { focusSvc } = this.beans;
        const rowFocused = focusSvc.isRowFocused(this.rowNode.rowIndex, this.rowNode.rowPinned);
        if (rowFocused !== this.rowFocused) {
          this.rowFocused = rowFocused;
          this.setFocusedClasses();
        }
      }
      onPaginationChanged() {
        const currentPage = this.beans.pagination?.getCurrentPage() ?? 0;
        if (this.paginationPage !== currentPage) {
          this.paginationPage = currentPage;
          this.onTopChanged();
        }
        this.refreshFirstAndLastRowStyles();
      }
      onTopChanged() {
        this.setRowTop(this.rowNode.rowTop);
      }
      onPaginationPixelOffsetChanged() {
        this.onTopChanged();
      }
      // applies pagination offset, eg if on second page, and page height is 500px, then removes
      // 500px from the top position, so a row with rowTop 600px is displayed at location 100px.
      // reverse will take the offset away rather than add.
      applyPaginationOffset(topPx, reverse = false) {
        if (this.rowNode.isRowPinned() || this.rowNode.sticky) {
          return topPx;
        }
        const pixelOffset = this.beans.pageBounds.getPixelOffset();
        const multiplier = reverse ? 1 : -1;
        return topPx + pixelOffset * multiplier;
      }
      setRowTop(pixels) {
        if (this.printLayout) {
          return;
        }
        if (_exists(pixels)) {
          const afterPaginationPixels = this.applyPaginationOffset(pixels);
          const skipScaling = this.rowNode.isRowPinned() || this.rowNode.sticky;
          const afterScalingPixels = skipScaling ? afterPaginationPixels : this.beans.rowContainerHeight.getRealPixelPosition(afterPaginationPixels);
          const topPx = `${afterScalingPixels}px`;
          this.setRowTopStyle(topPx);
        }
      }
      // the top needs to be set into the DOM element when the element is created, not updated afterwards.
      // otherwise the transition would not work, as it would be transitioning from zero (the unset value).
      // for example, suppose a row that is outside the viewport, then user does a filter to remove other rows
      // and this row now appears in the viewport, and the row moves up (ie it was under the viewport and not rendered,
      // but now is in the viewport) then a new RowComp is created, however it should have it's position initialised
      // to below the viewport, so the row will appear to animate up. if we didn't set the initial position at creation
      // time, the row would animate down (ie from position zero).
      getInitialRowTop(rowContainerType) {
        return this.suppressRowTransform ? this.getInitialRowTopShared(rowContainerType) : void 0;
      }
      getInitialTransform(rowContainerType) {
        return this.suppressRowTransform ? void 0 : `translateY(${this.getInitialRowTopShared(rowContainerType)})`;
      }
      getInitialRowTopShared(rowContainerType) {
        if (this.printLayout) {
          return "";
        }
        const rowNode = this.rowNode;
        let rowTop;
        if (rowNode.sticky) {
          rowTop = rowNode.stickyRowTop;
        } else {
          const pixels = this.slideInAnimation[rowContainerType] ? this.roundRowTopToBounds(rowNode.oldRowTop) : rowNode.rowTop;
          const afterPaginationPixels = this.applyPaginationOffset(pixels);
          rowTop = rowNode.isRowPinned() ? afterPaginationPixels : this.beans.rowContainerHeight.getRealPixelPosition(afterPaginationPixels);
        }
        return rowTop + "px";
      }
      setRowTopStyle(topPx) {
        for (const gui of this.allRowGuis) {
          this.suppressRowTransform ? gui.rowComp.setTop(topPx) : gui.rowComp.setTransform(`translateY(${topPx})`);
        }
      }
      getCellCtrl(column2, skipColSpanSearch = false) {
        let res = null;
        for (const cellCtrl of this.getAllCellCtrls()) {
          if (cellCtrl.column == column2) {
            res = cellCtrl;
          }
        }
        if (res != null || skipColSpanSearch) {
          return res;
        }
        for (const cellCtrl of this.getAllCellCtrls()) {
          if (cellCtrl?.getColSpanningList().indexOf(column2) >= 0) {
            res = cellCtrl;
          }
        }
        return res;
      }
      onRowIndexChanged() {
        if (this.rowNode.rowIndex != null) {
          this.onCellFocusChanged();
          this.updateRowIndexes();
          this.postProcessCss();
        }
      }
      updateRowIndexes(gui) {
        const rowIndexStr = this.rowNode.getRowIndexString();
        if (rowIndexStr === null) {
          return;
        }
        const headerRowCount = (this.beans.ctrlsSvc.getHeaderRowContainerCtrl()?.getRowCount() ?? 0) + (this.beans.filterManager?.getHeaderRowCount() ?? 0);
        const rowIsEven = this.rowNode.rowIndex % 2 === 0;
        const ariaRowIndex = headerRowCount + this.rowNode.rowIndex + 1;
        this.forEachGui(gui, (c2) => {
          c2.rowComp.setRowIndex(rowIndexStr);
          c2.rowComp.toggleCss("ag-row-even", rowIsEven);
          c2.rowComp.toggleCss("ag-row-odd", !rowIsEven);
          _setAriaRowIndex(c2.element, ariaRowIndex);
        });
      }
    };
    var NavigationService = class extends BeanStub {
      constructor() {
        super();
        this.beanName = "navigation";
        this.onPageDown = _throttle(this.onPageDown, 100);
        this.onPageUp = _throttle(this.onPageUp, 100);
      }
      postConstruct() {
        this.beans.ctrlsSvc.whenReady(this, (p) => {
          this.gridBodyCon = p.gridBodyCtrl;
        });
      }
      handlePageScrollingKey(event, fromFullWidth = false) {
        const key2 = event.key;
        const alt = event.altKey;
        const ctrl = event.ctrlKey || event.metaKey;
        const rangeServiceShouldHandleShift = !!this.beans.rangeSvc && event.shiftKey;
        const currentCell = _getCellPositionForEvent(this.gos, event);
        let processed = false;
        switch (key2) {
          case KeyCode.PAGE_HOME:
          case KeyCode.PAGE_END:
            if (!ctrl && !alt) {
              this.onHomeOrEndKey(key2);
              processed = true;
            }
            break;
          case KeyCode.LEFT:
          case KeyCode.RIGHT:
          case KeyCode.UP:
          case KeyCode.DOWN:
            if (!currentCell) {
              return false;
            }
            if (ctrl && !alt && !rangeServiceShouldHandleShift) {
              this.onCtrlUpDownLeftRight(key2, currentCell);
              processed = true;
            }
            break;
          case KeyCode.PAGE_DOWN:
          case KeyCode.PAGE_UP:
            if (!ctrl && !alt) {
              processed = this.handlePageUpDown(key2, currentCell, fromFullWidth);
            }
            break;
        }
        if (processed) {
          event.preventDefault();
        }
        return processed;
      }
      handlePageUpDown(key2, currentCell, fromFullWidth) {
        if (fromFullWidth) {
          currentCell = this.beans.focusSvc.getFocusedCell();
        }
        if (!currentCell) {
          return false;
        }
        if (key2 === KeyCode.PAGE_UP) {
          this.onPageUp(currentCell);
        } else {
          this.onPageDown(currentCell);
        }
        return true;
      }
      navigateTo({
        scrollIndex,
        scrollType,
        scrollColumn,
        focusIndex,
        focusColumn,
        isAsync,
        rowPinned
      }) {
        const { scrollFeature } = this.gridBodyCon;
        if (_exists(scrollColumn) && !scrollColumn.isPinned()) {
          scrollFeature.ensureColumnVisible(scrollColumn);
        }
        if (_exists(scrollIndex)) {
          scrollFeature.ensureIndexVisible(scrollIndex, scrollType);
        }
        if (!isAsync) {
          scrollFeature.ensureIndexVisible(focusIndex);
        }
        const { focusSvc, rangeSvc } = this.beans;
        focusSvc.setFocusedCell({
          rowIndex: focusIndex,
          column: focusColumn,
          rowPinned,
          forceBrowserFocus: true
        });
        rangeSvc?.setRangeToCell({ rowIndex: focusIndex, rowPinned, column: focusColumn });
      }
      // this method is throttled, see the `constructor`
      onPageDown(gridCell) {
        const beans = this.beans;
        const scrollPosition = getVScroll(beans);
        const pixelsInOnePage = this.getViewportHeight();
        const { pageBounds, rowModel, rowAutoHeight } = beans;
        const pagingPixelOffset = pageBounds.getPixelOffset();
        const currentPageBottomPixel = scrollPosition.top + pixelsInOnePage;
        const currentPageBottomRow = rowModel.getRowIndexAtPixel(currentPageBottomPixel + pagingPixelOffset);
        if (rowAutoHeight?.active) {
          this.navigateToNextPageWithAutoHeight(gridCell, currentPageBottomRow);
        } else {
          this.navigateToNextPage(gridCell, currentPageBottomRow);
        }
      }
      // this method is throttled, see the `constructor`
      onPageUp(gridCell) {
        const beans = this.beans;
        const scrollPosition = getVScroll(beans);
        const { pageBounds, rowModel, rowAutoHeight } = beans;
        const pagingPixelOffset = pageBounds.getPixelOffset();
        const currentPageTopPixel = scrollPosition.top;
        const currentPageTopRow = rowModel.getRowIndexAtPixel(currentPageTopPixel + pagingPixelOffset);
        if (rowAutoHeight?.active) {
          this.navigateToNextPageWithAutoHeight(gridCell, currentPageTopRow, true);
        } else {
          this.navigateToNextPage(gridCell, currentPageTopRow, true);
        }
      }
      navigateToNextPage(gridCell, scrollIndex, up = false) {
        const { pageBounds, rowModel } = this.beans;
        const pixelsInOnePage = this.getViewportHeight();
        const firstRow = pageBounds.getFirstRow();
        const lastRow = pageBounds.getLastRow();
        const pagingPixelOffset = pageBounds.getPixelOffset();
        const currentRowNode = rowModel.getRow(gridCell.rowIndex);
        const rowPixelDiff = up ? (
          // eslint-disable-next-line @typescript-eslint/no-non-null-asserted-optional-chain
          currentRowNode?.rowHeight - pixelsInOnePage - pagingPixelOffset
        ) : pixelsInOnePage - pagingPixelOffset;
        const nextCellPixel = currentRowNode?.rowTop + rowPixelDiff;
        let focusIndex = rowModel.getRowIndexAtPixel(nextCellPixel + pagingPixelOffset);
        if (focusIndex === gridCell.rowIndex) {
          const diff2 = up ? -1 : 1;
          scrollIndex = focusIndex = gridCell.rowIndex + diff2;
        }
        let scrollType;
        if (up) {
          scrollType = "bottom";
          if (focusIndex < firstRow) {
            focusIndex = firstRow;
          }
          if (scrollIndex < firstRow) {
            scrollIndex = firstRow;
          }
        } else {
          scrollType = "top";
          if (focusIndex > lastRow) {
            focusIndex = lastRow;
          }
          if (scrollIndex > lastRow) {
            scrollIndex = lastRow;
          }
        }
        if (this.isRowTallerThanView(rowModel.getRow(focusIndex))) {
          scrollIndex = focusIndex;
          scrollType = "top";
        }
        this.navigateTo({
          scrollIndex,
          scrollType,
          scrollColumn: null,
          focusIndex,
          focusColumn: gridCell.column
        });
      }
      navigateToNextPageWithAutoHeight(gridCell, scrollIndex, up = false) {
        this.navigateTo({
          scrollIndex,
          scrollType: up ? "bottom" : "top",
          scrollColumn: null,
          focusIndex: scrollIndex,
          focusColumn: gridCell.column
        });
        setTimeout(() => {
          const focusIndex = this.getNextFocusIndexForAutoHeight(gridCell, up);
          this.navigateTo({
            scrollIndex,
            scrollType: up ? "bottom" : "top",
            scrollColumn: null,
            focusIndex,
            focusColumn: gridCell.column,
            isAsync: true
          });
        }, 50);
      }
      getNextFocusIndexForAutoHeight(gridCell, up = false) {
        const step = up ? -1 : 1;
        const pixelsInOnePage = this.getViewportHeight();
        const { pageBounds, rowModel } = this.beans;
        const lastRowIndex = pageBounds.getLastRow();
        let pixelSum = 0;
        let currentIndex = gridCell.rowIndex;
        while (currentIndex >= 0 && currentIndex <= lastRowIndex) {
          const currentCell = rowModel.getRow(currentIndex);
          if (currentCell) {
            const currentCellHeight = currentCell.rowHeight ?? 0;
            if (pixelSum + currentCellHeight > pixelsInOnePage) {
              break;
            }
            pixelSum += currentCellHeight;
          }
          currentIndex += step;
        }
        return Math.max(0, Math.min(currentIndex, lastRowIndex));
      }
      getViewportHeight() {
        const beans = this.beans;
        const scrollPosition = getVScroll(beans);
        const scrollbarWidth = this.beans.scrollVisibleSvc.getScrollbarWidth();
        let pixelsInOnePage = scrollPosition.bottom - scrollPosition.top;
        if (beans.ctrlsSvc.get("center").isHorizontalScrollShowing()) {
          pixelsInOnePage -= scrollbarWidth;
        }
        return pixelsInOnePage;
      }
      isRowTallerThanView(rowNode) {
        if (!rowNode) {
          return false;
        }
        const rowHeight = rowNode.rowHeight;
        if (typeof rowHeight !== "number") {
          return false;
        }
        return rowHeight > this.getViewportHeight();
      }
      onCtrlUpDownLeftRight(key2, gridCell) {
        const cellToFocus = this.beans.cellNavigation.getNextCellToFocus(key2, gridCell, true);
        const normalisedPosition = this.getNormalisedPosition(cellToFocus);
        const { rowIndex, rowPinned, column: column2 } = normalisedPosition ?? cellToFocus;
        const col = column2;
        this.navigateTo({
          scrollIndex: rowIndex,
          scrollType: null,
          scrollColumn: col,
          focusIndex: rowIndex,
          focusColumn: col,
          rowPinned
        });
      }
      // home brings focus to top left cell, end brings focus to bottom right, grid scrolled to bring
      // same cell into view (which means either scroll all the way up, or all the way down).
      onHomeOrEndKey(key2) {
        const homeKey = key2 === KeyCode.PAGE_HOME;
        const { visibleCols, pageBounds, rowModel } = this.beans;
        const allColumns = visibleCols.allCols;
        const scrollIndex = homeKey ? pageBounds.getFirstRow() : pageBounds.getLastRow();
        const rowNode = rowModel.getRow(scrollIndex);
        if (!rowNode) {
          return;
        }
        const columnToSelect = (homeKey ? allColumns : [...allColumns].reverse()).find(
          (col) => !col.isSuppressNavigable(rowNode)
        );
        if (!columnToSelect) {
          return;
        }
        this.navigateTo({
          scrollIndex,
          scrollType: null,
          scrollColumn: columnToSelect,
          focusIndex: scrollIndex,
          focusColumn: columnToSelect
        });
      }
      // result of keyboard event
      onTabKeyDown(previous, keyboardEvent) {
        const backwards = keyboardEvent.shiftKey;
        const movedToNextCell = this.tabToNextCellCommon(previous, backwards, keyboardEvent);
        const beans = this.beans;
        const { ctrlsSvc, pageBounds, focusSvc, gos } = beans;
        if (movedToNextCell !== false) {
          if (movedToNextCell) {
            keyboardEvent.preventDefault();
          } else if (movedToNextCell === null) {
            ctrlsSvc.get("gridCtrl").allowFocusForNextCoreContainer(backwards);
          }
          return;
        }
        if (backwards) {
          const { rowIndex, rowPinned } = previous.getRowPosition();
          const firstRow = rowPinned ? rowIndex === 0 : rowIndex === pageBounds.getFirstRow();
          if (firstRow) {
            if (gos.get("headerHeight") === 0 || _isHeaderFocusSuppressed(beans)) {
              _focusNextGridCoreContainer(beans, true, true);
            } else {
              keyboardEvent.preventDefault();
              focusSvc.focusPreviousFromFirstCell(keyboardEvent);
            }
          }
        } else {
          if (previous instanceof CellCtrl) {
            previous.focusCell(true);
          }
          if (focusSvc.focusOverlay(false) || _focusNextGridCoreContainer(beans, backwards)) {
            keyboardEvent.preventDefault();
          }
        }
      }
      // comes from API
      tabToNextCell(backwards, event) {
        const beans = this.beans;
        const { focusSvc, rowRenderer } = beans;
        const focusedCell = focusSvc.getFocusedCell();
        if (!focusedCell) {
          return false;
        }
        let cellOrRow = _getCellByPosition(beans, focusedCell);
        if (!cellOrRow) {
          cellOrRow = rowRenderer.getRowByPosition(focusedCell);
          if (!cellOrRow?.isFullWidth()) {
            return false;
          }
        }
        return !!this.tabToNextCellCommon(cellOrRow, backwards, event, "api");
      }
      tabToNextCellCommon(previous, backwards, event, source2 = "ui") {
        const { editSvc, focusSvc } = this.beans;
        let res = void 0;
        const cellCtrl = previous instanceof CellCtrl ? previous : previous.getAllCellCtrls()?.[0];
        if (editSvc?.isEditing()) {
          res = editSvc?.moveToNextCell(cellCtrl, backwards, event, source2);
        } else {
          res = this.moveToNextCellNotEditing(previous, backwards, event);
        }
        if (res === null) {
          return res;
        }
        return res || !!focusSvc.focusedHeader;
      }
      // returns null if no navigation should be performed
      moveToNextCellNotEditing(previousCell, backwards, event) {
        const displayedColumns = this.beans.visibleCols.allCols;
        let cellPos;
        if (previousCell instanceof RowCtrl) {
          cellPos = {
            ...previousCell.getRowPosition(),
            column: backwards ? displayedColumns[0] : _last(displayedColumns)
          };
          if (this.gos.get("embedFullWidthRows") && event) {
            const focusedContainer = previousCell.findFullWidthInfoForEvent(event);
            if (focusedContainer) {
              cellPos.column = focusedContainer.column;
            }
          }
        } else {
          cellPos = previousCell.getFocusedCellPosition();
        }
        const nextCell = this.findNextCellToFocusOn(cellPos, { backwards, startEditing: false });
        if (nextCell === false) {
          return null;
        }
        if (nextCell instanceof CellCtrl) {
          nextCell.focusCell(true);
        } else if (nextCell) {
          return this.tryToFocusFullWidthRow(nextCell, backwards);
        }
        return _exists(nextCell);
      }
      /**
       * called by the cell, when tab is pressed while editing.
       * @returns RenderedCell when navigation successful, false if navigation should not be performed, otherwise null
       */
      findNextCellToFocusOn(previousPosition, { backwards, startEditing, skipToNextEditableCell }) {
        let nextPosition = previousPosition;
        const beans = this.beans;
        const { cellNavigation, gos, focusSvc, rowRenderer, rangeSvc } = beans;
        while (true) {
          if (previousPosition !== nextPosition) {
            previousPosition = nextPosition;
          }
          if (!backwards) {
            nextPosition = this.getLastCellOfColSpan(nextPosition);
          }
          nextPosition = cellNavigation.getNextTabbedCell(nextPosition, backwards);
          const userFunc = gos.getCallback("tabToNextCell");
          if (_exists(userFunc)) {
            const params = {
              backwards,
              editing: startEditing,
              previousCellPosition: previousPosition,
              nextCellPosition: nextPosition ? nextPosition : null
            };
            const userResult = userFunc(params);
            if (userResult === true) {
              nextPosition = previousPosition;
            } else if (userResult === false) {
              return false;
            } else {
              nextPosition = {
                rowIndex: userResult.rowIndex,
                column: userResult.column,
                rowPinned: userResult.rowPinned
              };
            }
          }
          if (!nextPosition) {
            return null;
          }
          if (nextPosition.rowIndex < 0) {
            const headerLen = getFocusHeaderRowCount(beans);
            focusSvc.focusHeaderPosition({
              headerPosition: {
                headerRowIndex: headerLen + nextPosition.rowIndex,
                column: nextPosition.column
              },
              fromCell: true
            });
            return null;
          }
          const fullRowEdit = gos.get("editType") === "fullRow";
          if (startEditing && (!fullRowEdit || skipToNextEditableCell)) {
            const cellIsEditable = this.isCellEditable(nextPosition);
            if (!cellIsEditable) {
              continue;
            }
          }
          this.ensureCellVisible(nextPosition);
          const nextCell = _getCellByPosition(beans, nextPosition);
          if (!nextCell) {
            const row2 = rowRenderer.getRowByPosition(nextPosition);
            if (!row2 || !row2.isFullWidth() || startEditing) {
              continue;
            }
            return { ...row2.getRowPosition(), column: nextPosition?.column };
          }
          if (cellNavigation.isSuppressNavigable(nextCell.column, nextCell.rowNode)) {
            continue;
          }
          nextCell.setFocusedCellPosition(nextPosition);
          rangeSvc?.setRangeToCell(nextPosition);
          return nextCell;
        }
      }
      isCellEditable(cell2) {
        const rowNode = this.lookupRowNodeForCell(cell2);
        if (rowNode) {
          return cell2.column.isCellEditable(rowNode);
        }
        return false;
      }
      lookupRowNodeForCell({ rowIndex, rowPinned }) {
        const { pinnedRowModel, rowModel } = this.beans;
        if (rowPinned === "top") {
          return pinnedRowModel?.getPinnedTopRow(rowIndex);
        }
        if (rowPinned === "bottom") {
          return pinnedRowModel?.getPinnedBottomRow(rowIndex);
        }
        return rowModel.getRow(rowIndex);
      }
      // we use index for rows, but column object for columns, as the next column (by index) might not
      // be visible (header grouping) so it's not reliable, so using the column object instead.
      navigateToNextCell(event, key2, currentCell, allowUserOverride) {
        let nextCell = currentCell;
        let hitEdgeOfGrid = false;
        const beans = this.beans;
        const { cellNavigation, focusSvc, gos } = beans;
        while (nextCell && (nextCell === currentCell || !this.isValidNavigateCell(nextCell))) {
          if (gos.get("enableRtl")) {
            if (key2 === KeyCode.LEFT) {
              nextCell = this.getLastCellOfColSpan(nextCell);
            }
          } else if (key2 === KeyCode.RIGHT) {
            nextCell = this.getLastCellOfColSpan(nextCell);
          }
          nextCell = cellNavigation.getNextCellToFocus(key2, nextCell);
          hitEdgeOfGrid = _missing(nextCell);
        }
        if (hitEdgeOfGrid && event && event.key === KeyCode.UP) {
          nextCell = {
            rowIndex: -1,
            rowPinned: null,
            column: currentCell.column
          };
        }
        if (allowUserOverride) {
          const userFunc = gos.getCallback("navigateToNextCell");
          if (_exists(userFunc)) {
            const params = {
              key: key2,
              previousCellPosition: currentCell,
              nextCellPosition: nextCell ? nextCell : null,
              event
            };
            const userCell = userFunc(params);
            if (_exists(userCell)) {
              nextCell = {
                rowPinned: userCell.rowPinned,
                rowIndex: userCell.rowIndex,
                column: userCell.column
              };
            } else {
              nextCell = null;
            }
          }
        }
        if (!nextCell) {
          return;
        }
        if (nextCell.rowIndex < 0) {
          const headerLen = getFocusHeaderRowCount(beans);
          focusSvc.focusHeaderPosition({
            headerPosition: { headerRowIndex: headerLen + nextCell.rowIndex, column: currentCell.column },
            event: event || void 0,
            fromCell: true
          });
          return;
        }
        const normalisedPosition = this.getNormalisedPosition(nextCell);
        if (normalisedPosition) {
          this.focusPosition(normalisedPosition);
        } else {
          this.tryToFocusFullWidthRow(nextCell);
        }
      }
      getNormalisedPosition(cellPosition) {
        const isSpannedCell = !!this.beans.spannedRowRenderer?.getCellByPosition(cellPosition);
        if (isSpannedCell) {
          return cellPosition;
        }
        this.ensureCellVisible(cellPosition);
        const cellCtrl = _getCellByPosition(this.beans, cellPosition);
        if (!cellCtrl) {
          return null;
        }
        cellPosition = cellCtrl.getFocusedCellPosition();
        this.ensureCellVisible(cellPosition);
        return cellPosition;
      }
      tryToFocusFullWidthRow(position, backwards) {
        const { visibleCols, rowRenderer, focusSvc, eventSvc } = this.beans;
        const displayedColumns = visibleCols.allCols;
        const rowComp = rowRenderer.getRowByPosition(position);
        if (!rowComp?.isFullWidth()) {
          return false;
        }
        const currentCellFocused = focusSvc.getFocusedCell();
        const cellPosition = {
          rowIndex: position.rowIndex,
          rowPinned: position.rowPinned,
          column: position.column || (backwards ? _last(displayedColumns) : displayedColumns[0])
        };
        this.focusPosition(cellPosition);
        const fromBelow = backwards == null ? currentCellFocused != null && _isRowBefore(cellPosition, currentCellFocused) : backwards;
        eventSvc.dispatchEvent({
          type: "fullWidthRowFocused",
          rowIndex: cellPosition.rowIndex,
          rowPinned: cellPosition.rowPinned,
          column: cellPosition.column,
          isFullWidthCell: true,
          fromBelow
        });
        return true;
      }
      focusPosition(cellPosition) {
        const { focusSvc, rangeSvc } = this.beans;
        focusSvc.setFocusedCell({
          rowIndex: cellPosition.rowIndex,
          column: cellPosition.column,
          rowPinned: cellPosition.rowPinned,
          forceBrowserFocus: true
        });
        rangeSvc?.setRangeToCell(cellPosition);
      }
      isValidNavigateCell(cell2) {
        const rowNode = _getRowNode(this.beans, cell2);
        return !!rowNode;
      }
      getLastCellOfColSpan(cell2) {
        const cellCtrl = _getCellByPosition(this.beans, cell2);
        if (!cellCtrl) {
          return cell2;
        }
        const colSpanningList = cellCtrl.getColSpanningList();
        if (colSpanningList.length === 1) {
          return cell2;
        }
        return {
          rowIndex: cell2.rowIndex,
          column: _last(colSpanningList),
          rowPinned: cell2.rowPinned
        };
      }
      ensureCellVisible(gridCell) {
        const isGroupStickyEnabled = _isGroupRowsSticky(this.gos);
        const rowNode = this.beans.rowModel.getRow(gridCell.rowIndex);
        const skipScrollToRow = isGroupStickyEnabled && rowNode?.sticky;
        const { scrollFeature } = this.gridBodyCon;
        if (!skipScrollToRow && _missing(gridCell.rowPinned)) {
          scrollFeature.ensureIndexVisible(gridCell.rowIndex);
        }
        if (!gridCell.column.isPinned()) {
          scrollFeature.ensureColumnVisible(gridCell.column);
        }
      }
      ensureColumnVisible(column2) {
        const scrollFeature = this.gridBodyCon.scrollFeature;
        if (!column2.isPinned()) {
          scrollFeature.ensureColumnVisible(column2);
        }
      }
      ensureRowVisible(rowIndex) {
        const scrollFeature = this.gridBodyCon.scrollFeature;
        scrollFeature.ensureIndexVisible(rowIndex);
      }
    };
    function getVScroll(beans) {
      return beans.ctrlsSvc.getScrollFeature().getVScrollPosition();
    }
    var KeyboardNavigationModule = {
      moduleName: "KeyboardNavigation",
      version: VERSION,
      beans: [NavigationService, CellNavigationService, HeaderNavigationService],
      apiFunctions: {
        getFocusedCell,
        clearFocusedCell,
        setFocusedCell,
        setFocusedHeader,
        tabToNextCell,
        tabToPreviousCell
      }
    };
    var PageBoundsListener = class extends BeanStub {
      constructor() {
        super(...arguments);
        this.beanName = "pageBoundsListener";
      }
      postConstruct() {
        this.addManagedEventListeners({
          modelUpdated: this.onModelUpdated.bind(this),
          recalculateRowBounds: this.calculatePages.bind(this)
        });
        this.onModelUpdated();
      }
      onModelUpdated(modelUpdatedEvent) {
        this.calculatePages();
        this.eventSvc.dispatchEvent({
          type: "paginationChanged",
          animate: modelUpdatedEvent?.animate ?? false,
          newData: modelUpdatedEvent?.newData ?? false,
          newPage: modelUpdatedEvent?.newPage ?? false,
          newPageSize: modelUpdatedEvent?.newPageSize ?? false,
          keepRenderedRows: modelUpdatedEvent?.keepRenderedRows ?? false
        });
      }
      calculatePages() {
        const { pageBounds, pagination, rowModel } = this.beans;
        if (pagination) {
          pagination.calculatePages();
        } else {
          pageBounds.calculateBounds(0, rowModel.getRowCount() - 1);
        }
      }
    };
    var PageBoundsService = class extends BeanStub {
      constructor() {
        super(...arguments);
        this.beanName = "pageBounds";
        this.pixelOffset = 0;
      }
      getFirstRow() {
        return this.topRowBounds?.rowIndex ?? -1;
      }
      getLastRow() {
        return this.bottomRowBounds?.rowIndex ?? -1;
      }
      getCurrentPageHeight() {
        const { topRowBounds, bottomRowBounds } = this;
        if (!topRowBounds || !bottomRowBounds) {
          return 0;
        }
        return Math.max(bottomRowBounds.rowTop + bottomRowBounds.rowHeight - topRowBounds.rowTop, 0);
      }
      getCurrentPagePixelRange() {
        const { topRowBounds, bottomRowBounds } = this;
        const pageFirstPixel = topRowBounds?.rowTop ?? 0;
        const pageLastPixel = bottomRowBounds ? bottomRowBounds.rowTop + bottomRowBounds.rowHeight : 0;
        return { pageFirstPixel, pageLastPixel };
      }
      calculateBounds(topDisplayedRowIndex, bottomDisplayedRowIndex) {
        const { rowModel } = this.beans;
        const topRowBounds = rowModel.getRowBounds(topDisplayedRowIndex);
        if (topRowBounds) {
          topRowBounds.rowIndex = topDisplayedRowIndex;
        }
        this.topRowBounds = topRowBounds;
        const bottomRowBounds = rowModel.getRowBounds(bottomDisplayedRowIndex);
        if (bottomRowBounds) {
          bottomRowBounds.rowIndex = bottomDisplayedRowIndex;
        }
        this.bottomRowBounds = bottomRowBounds;
        this.calculatePixelOffset();
      }
      getPixelOffset() {
        return this.pixelOffset;
      }
      calculatePixelOffset() {
        const value2 = this.topRowBounds?.rowTop ?? 0;
        if (this.pixelOffset === value2) {
          return;
        }
        this.pixelOffset = value2;
        this.eventSvc.dispatchEvent({ type: "paginationPixelOffsetChanged" });
      }
    };
    var pinnedColumnModuleCSS = (
      /*css*/
      `.ag-pinned-left-floating-bottom,.ag-pinned-left-floating-top,.ag-pinned-right-floating-bottom,.ag-pinned-right-floating-top{min-width:0;overflow:hidden;position:relative}.ag-pinned-left-sticky-top,.ag-pinned-right-sticky-top{height:100%;overflow:hidden;position:relative}.ag-sticky-bottom-full-width-container,.ag-sticky-top-full-width-container{height:100%;overflow:hidden;width:100%}.ag-pinned-left-header,.ag-pinned-right-header{display:inline-block;height:100%;overflow:hidden;position:relative}.ag-body-horizontal-scroll:not(.ag-scrollbar-invisible){.ag-horizontal-left-spacer:not(.ag-scroller-corner){border-right:var(--ag-pinned-column-border)}.ag-horizontal-right-spacer:not(.ag-scroller-corner){border-left:var(--ag-pinned-column-border)}}.ag-pinned-right-header{border-left:var(--ag-pinned-column-border)}.ag-pinned-left-header{border-right:var(--ag-pinned-column-border)}.ag-cell.ag-cell-first-right-pinned:not(.ag-cell-range-left,.ag-cell-range-single-cell,.ag-cell-focus:not(.ag-cell-range-selected):focus-within){border-left:var(--ag-pinned-column-border)}.ag-cell.ag-cell-last-left-pinned:not(.ag-cell-range-right,.ag-cell-range-single-cell,.ag-cell-focus:not(.ag-cell-range-selected):focus-within){border-right:var(--ag-pinned-column-border)}.ag-pinned-left-header .ag-header-cell-resize:after{left:calc(50% - var(--ag-header-column-resize-handle-width))}.ag-pinned-right-header .ag-header-cell-resize:after{left:50%}.ag-pinned-left-header .ag-header-cell-resize{right:-3px}.ag-pinned-right-header .ag-header-cell-resize{left:-3px}`
    );
    var SetPinnedWidthFeature = class extends BeanStub {
      constructor(isLeft, elements) {
        super();
        this.isLeft = isLeft;
        this.elements = elements;
        this.getWidth = isLeft ? () => this.beans.pinnedCols.leftWidth : () => this.beans.pinnedCols.rightWidth;
      }
      postConstruct() {
        this.addManagedEventListeners({
          [`${this.isLeft ? "left" : "right"}PinnedWidthChanged`]: this.onPinnedWidthChanged.bind(this)
        });
      }
      onPinnedWidthChanged() {
        const width = this.getWidth();
        const displayed = width > 0;
        for (const element of this.elements) {
          if (element) {
            _setDisplayed(element, displayed);
            _setFixedWidth(element, width);
          }
        }
      }
    };
    var PinnedColumnService = class extends BeanStub {
      constructor() {
        super(...arguments);
        this.beanName = "pinnedCols";
      }
      postConstruct() {
        this.beans.ctrlsSvc.whenReady(this, (p) => {
          this.gridBodyCtrl = p.gridBodyCtrl;
        });
        const listener = this.checkContainerWidths.bind(this);
        this.addManagedEventListeners({
          displayedColumnsChanged: listener,
          displayedColumnsWidthChanged: listener
        });
        this.addManagedPropertyListener("domLayout", listener);
      }
      checkContainerWidths() {
        const { gos, visibleCols, eventSvc } = this.beans;
        const printLayout = _isDomLayout(gos, "print");
        const newLeftWidth = printLayout ? 0 : visibleCols.getColsLeftWidth();
        const newRightWidth = printLayout ? 0 : visibleCols.getDisplayedColumnsRightWidth();
        if (newLeftWidth != this.leftWidth) {
          this.leftWidth = newLeftWidth;
          eventSvc.dispatchEvent({ type: "leftPinnedWidthChanged" });
        }
        if (newRightWidth != this.rightWidth) {
          this.rightWidth = newRightWidth;
          eventSvc.dispatchEvent({ type: "rightPinnedWidthChanged" });
        }
      }
      keepPinnedColumnsNarrowerThanViewport() {
        const eBodyViewport = this.gridBodyCtrl.eBodyViewport;
        const bodyWidth = _getInnerWidth(eBodyViewport);
        if (bodyWidth <= 50) {
          return;
        }
        const processedColumnsToRemove = this.getPinnedColumnsOverflowingViewport(bodyWidth - 50);
        const processUnpinnedColumns = this.gos.getCallback("processUnpinnedColumns");
        const { columns, hasLockedPinned } = processedColumnsToRemove;
        let columnsToRemove = columns;
        if (!columnsToRemove.length && !hasLockedPinned) {
          return;
        }
        if (processUnpinnedColumns) {
          const params = {
            columns: columnsToRemove,
            viewportWidth: bodyWidth
          };
          columnsToRemove = processUnpinnedColumns(params);
        }
        if (!columnsToRemove?.length) {
          return;
        }
        columnsToRemove = columnsToRemove.filter((col) => !isRowNumberCol(col));
        this.setColsPinned(columnsToRemove, null, "viewportSizeFeature");
      }
      createPinnedWidthFeature(isLeft, ...elements) {
        return new SetPinnedWidthFeature(isLeft, elements);
      }
      setColsPinned(keys, pinned, source2) {
        const { colModel, colAnimation, visibleCols, gos } = this.beans;
        if (!colModel.cols) {
          return;
        }
        if (!keys?.length) {
          return;
        }
        if (_isDomLayout(gos, "print")) {
          _warn(37);
          return;
        }
        colAnimation?.start();
        let actualPinned;
        if (pinned === true || pinned === "left") {
          actualPinned = "left";
        } else if (pinned === "right") {
          actualPinned = "right";
        } else {
          actualPinned = null;
        }
        const updatedCols = [];
        for (const key2 of keys) {
          if (!key2) {
            continue;
          }
          const column2 = colModel.getCol(key2);
          if (!column2) {
            continue;
          }
          if (column2.getPinned() !== actualPinned) {
            this.setColPinned(column2, actualPinned);
            updatedCols.push(column2);
          }
        }
        if (updatedCols.length) {
          visibleCols.refresh(source2);
          dispatchColumnPinnedEvent(this.eventSvc, updatedCols, source2);
        }
        colAnimation?.finish();
      }
      initCol(column2) {
        const { pinned, initialPinned } = column2.colDef;
        if (pinned !== void 0) {
          this.setColPinned(column2, pinned);
        } else {
          this.setColPinned(column2, initialPinned);
        }
      }
      setColPinned(column2, pinned) {
        if (pinned === true || pinned === "left") {
          column2.pinned = "left";
        } else if (pinned === "right") {
          column2.pinned = "right";
        } else {
          column2.pinned = null;
        }
        column2.dispatchStateUpdatedEvent("pinned");
      }
      setupHeaderPinnedWidth(ctrl) {
        const { scrollVisibleSvc } = this.beans;
        if (ctrl.pinned == null) {
          return;
        }
        const pinningLeft = ctrl.pinned === "left";
        const pinningRight = ctrl.pinned === "right";
        ctrl.hidden = true;
        const listener = () => {
          const width = pinningLeft ? this.leftWidth : this.rightWidth;
          if (width == null) {
            return;
          }
          const hidden2 = width == 0;
          const hiddenChanged = ctrl.hidden !== hidden2;
          const isRtl = this.gos.get("enableRtl");
          const scrollbarWidth = scrollVisibleSvc.getScrollbarWidth();
          const addPaddingForScrollbar = scrollVisibleSvc.verticalScrollShowing && (isRtl && pinningLeft || !isRtl && pinningRight);
          const widthWithPadding = addPaddingForScrollbar ? width + scrollbarWidth : width;
          ctrl.comp.setPinnedContainerWidth(`${widthWithPadding}px`);
          ctrl.comp.setDisplayed(!hidden2);
          if (hiddenChanged) {
            ctrl.hidden = hidden2;
            ctrl.refresh();
          }
        };
        ctrl.addManagedEventListeners({
          leftPinnedWidthChanged: listener,
          rightPinnedWidthChanged: listener,
          scrollVisibilityChanged: listener,
          scrollbarWidthChanged: listener
        });
      }
      getHeaderResizeDiff(diff2, column2) {
        const pinned = column2.getPinned();
        if (pinned) {
          const { leftWidth, rightWidth } = this;
          const bodyWidth = _getInnerWidth(this.beans.ctrlsSvc.getGridBodyCtrl().eBodyViewport) - 50;
          if (leftWidth + rightWidth + diff2 > bodyWidth) {
            if (bodyWidth > leftWidth + rightWidth) {
              diff2 = bodyWidth - leftWidth - rightWidth;
            } else {
              return 0;
            }
          }
        }
        return diff2;
      }
      getPinnedColumnsOverflowingViewport(viewportWidth) {
        const pinnedRightWidth = this.rightWidth ?? 0;
        const pinnedLeftWidth = this.leftWidth ?? 0;
        const totalPinnedWidth = pinnedRightWidth + pinnedLeftWidth;
        let hasLockedPinned = false;
        if (totalPinnedWidth < viewportWidth) {
          return { columns: [], hasLockedPinned };
        }
        const { visibleCols } = this.beans;
        const pinnedLeftColumns = [...visibleCols.leftCols];
        const pinnedRightColumns = [...visibleCols.rightCols];
        let indexRight = 0;
        let indexLeft = 0;
        const totalWidthRemoved = 0;
        const columnsToRemove = [];
        let spaceNecessary = totalPinnedWidth - totalWidthRemoved - viewportWidth;
        while ((indexLeft < pinnedLeftColumns.length || indexRight < pinnedRightColumns.length) && spaceNecessary > 0) {
          if (indexRight < pinnedRightColumns.length) {
            const currentColumn = pinnedRightColumns[indexRight++];
            if (currentColumn.colDef.lockPinned) {
              hasLockedPinned = true;
              continue;
            }
            spaceNecessary -= currentColumn.getActualWidth();
            columnsToRemove.push(currentColumn);
          }
          if (indexLeft < pinnedLeftColumns.length && spaceNecessary > 0) {
            const currentColumn = pinnedLeftColumns[indexLeft++];
            if (currentColumn.colDef.lockPinned) {
              hasLockedPinned = true;
              continue;
            }
            spaceNecessary -= currentColumn.getActualWidth();
            columnsToRemove.push(currentColumn);
          }
        }
        return { columns: columnsToRemove, hasLockedPinned };
      }
    };
    var PinnedColumnModule = {
      moduleName: "PinnedColumn",
      version: VERSION,
      beans: [PinnedColumnService],
      css: [pinnedColumnModuleCSS]
    };
    var AriaAnnouncementService = class extends BeanStub {
      constructor() {
        super();
        this.beanName = "ariaAnnounce";
        this.descriptionContainer = null;
        this.pendingAnnouncements = /* @__PURE__ */ new Map();
        this.lastAnnouncement = "";
        this.updateAnnouncement = _debounce(this, this.updateAnnouncement.bind(this), 200);
      }
      postConstruct() {
        const beans = this.beans;
        const eDocument = _getDocument(beans);
        const div2 = this.descriptionContainer = eDocument.createElement("div");
        div2.classList.add("ag-aria-description-container");
        _setAriaLive(div2, "polite");
        _setAriaRelevant(div2, "additions text");
        _setAriaAtomic(div2, true);
        beans.eGridDiv.appendChild(div2);
      }
      /**
       * @param key used for debouncing calls
       */
      announceValue(value2, key2) {
        this.pendingAnnouncements.set(key2, value2);
        this.updateAnnouncement();
      }
      updateAnnouncement() {
        if (!this.descriptionContainer) {
          return;
        }
        const value2 = Array.from(this.pendingAnnouncements.values()).join(". ");
        this.pendingAnnouncements.clear();
        this.descriptionContainer.textContent = "";
        setTimeout(() => {
          this.handleAnnouncementUpdate(value2);
        }, 50);
      }
      handleAnnouncementUpdate(value2) {
        if (!this.isAlive() || !this.descriptionContainer) {
          return;
        }
        let valueToAnnounce = value2;
        if (valueToAnnounce == null || valueToAnnounce.replace(/[ .]/g, "") == "") {
          this.lastAnnouncement = "";
          return;
        }
        if (this.lastAnnouncement === valueToAnnounce) {
          valueToAnnounce = `${valueToAnnounce}​`;
        }
        this.lastAnnouncement = valueToAnnounce;
        this.descriptionContainer.textContent = valueToAnnounce;
      }
      destroy() {
        super.destroy();
        const { descriptionContainer } = this;
        if (descriptionContainer) {
          _clearElement(descriptionContainer);
          descriptionContainer.remove();
        }
        this.descriptionContainer = null;
        this.pendingAnnouncements.clear();
      }
    };
    var AriaModule = {
      moduleName: "Aria",
      version: VERSION,
      beans: [AriaAnnouncementService]
    };
    var columnDelayRenderCSS = (
      /*css*/
      `:where(.ag-delay-render){.ag-cell,.ag-header-cell,.ag-header-group-cell,.ag-row,.ag-spanned-cell-wrapper{visibility:hidden}}`
    );
    var HideClass = "ag-delay-render";
    var ColumnDelayRenderService = class extends BeanStub {
      constructor() {
        super(...arguments);
        this.beanName = "colDelayRenderSvc";
        this.hideRequested = false;
        this.alreadyRevealed = false;
        this.timesRetried = 0;
        this.requesters = /* @__PURE__ */ new Set();
      }
      hideColumns(key2) {
        if (this.alreadyRevealed || this.requesters.has(key2)) {
          return;
        }
        this.requesters.add(key2);
        if (!this.hideRequested) {
          this.beans.ctrlsSvc.whenReady(this, (p) => {
            p.gridBodyCtrl.eGridBody.classList.add(HideClass);
          });
          this.hideRequested = true;
        }
      }
      revealColumns(key2) {
        if (this.alreadyRevealed || !this.isAlive()) {
          return;
        }
        this.requesters.delete(key2);
        if (this.requesters.size > 0) {
          return;
        }
        const { renderStatus, ctrlsSvc } = this.beans;
        if (renderStatus) {
          if (!renderStatus.areHeaderCellsRendered() && this.timesRetried < 5) {
            this.timesRetried++;
            setTimeout(() => this.revealColumns(key2));
            return;
          }
          this.timesRetried = 0;
        }
        ctrlsSvc.getGridBodyCtrl().eGridBody.classList.remove(HideClass);
        this.alreadyRevealed = true;
      }
    };
    var ColumnDelayRenderModule = {
      moduleName: "ColumnDelayRender",
      version: VERSION,
      beans: [ColumnDelayRenderService],
      css: [columnDelayRenderCSS]
    };
    function showLoadingOverlay(beans) {
      beans.overlays?.showLoadingOverlay();
    }
    function showNoRowsOverlay(beans) {
      beans.overlays?.showNoRowsOverlay();
    }
    function hideOverlay(beans) {
      beans.overlays?.hideOverlay();
    }
    var overlayWrapperComponentCSS = (
      /*css*/
      `.ag-overlay{inset:0;pointer-events:none;position:absolute;z-index:2}.ag-overlay-panel,.ag-overlay-wrapper{display:flex;height:100%;width:100%}.ag-overlay-wrapper{align-items:center;flex:none;justify-content:center;text-align:center}.ag-overlay-loading-wrapper{pointer-events:all}.ag-overlay-loading-center{background:var(--ag-background-color);border:solid var(--ag-border-width) var(--ag-border-color);border-radius:var(--ag-border-radius);box-shadow:var(--ag-popup-shadow);padding:var(--ag-spacing)}`
    );
    var OverlayWrapperElement = {
      tag: "div",
      cls: "ag-overlay",
      role: "presentation",
      children: [
        {
          tag: "div",
          cls: "ag-overlay-panel",
          role: "presentation",
          children: [{ tag: "div", ref: "eOverlayWrapper", cls: "ag-overlay-wrapper", role: "presentation" }]
        }
      ]
    };
    var OverlayWrapperComponent = class extends Component {
      constructor() {
        super(OverlayWrapperElement);
        this.eOverlayWrapper = RefPlaceholder;
        this.activePromise = null;
        this.activeOverlay = null;
        this.updateListenerDestroyFunc = null;
        this.activeCssClass = null;
        this.elToFocusAfter = null;
        this.registerCSS(overlayWrapperComponentCSS);
      }
      handleKeyDown(e) {
        if (e.key !== KeyCode.TAB || e.defaultPrevented || _isStopPropagationForAgGrid(e)) {
          return;
        }
        const beans = this.beans;
        const nextEl = _findNextFocusableElement(beans, this.eOverlayWrapper, false, e.shiftKey);
        if (nextEl) {
          return;
        }
        let isFocused = false;
        if (e.shiftKey) {
          isFocused = beans.focusSvc.focusGridView({
            column: _last(beans.visibleCols.allCols),
            backwards: true,
            canFocusOverlay: false
          });
        } else {
          isFocused = _focusNextGridCoreContainer(beans, false);
        }
        if (isFocused) {
          e.preventDefault();
        }
      }
      updateLayoutClasses(cssClass, params) {
        const overlayWrapperClassList = this.eOverlayWrapper.classList;
        const { AUTO_HEIGHT, NORMAL, PRINT } = LayoutCssClasses;
        overlayWrapperClassList.toggle(AUTO_HEIGHT, params.autoHeight);
        overlayWrapperClassList.toggle(NORMAL, params.normal);
        overlayWrapperClassList.toggle(PRINT, params.print);
      }
      postConstruct() {
        this.createManagedBean(new LayoutFeature(this));
        this.setDisplayed(false, { skipAriaHidden: true });
        this.beans.overlays.setOverlayWrapperComp(this);
        this.addManagedElementListeners(this.getFocusableElement(), { keydown: this.handleKeyDown.bind(this) });
      }
      setWrapperTypeClass(overlayWrapperCssClass) {
        const overlayWrapperClassList = this.eOverlayWrapper.classList;
        if (this.activeCssClass) {
          overlayWrapperClassList.toggle(this.activeCssClass, false);
        }
        this.activeCssClass = overlayWrapperCssClass;
        overlayWrapperClassList.toggle(overlayWrapperCssClass, true);
      }
      showOverlay(overlayComponentPromise, overlayWrapperCssClass, exclusive, gridOption) {
        this.setWrapperTypeClass(overlayWrapperCssClass);
        this.destroyActiveOverlay();
        this.elToFocusAfter = null;
        this.activePromise = overlayComponentPromise;
        if (!overlayComponentPromise) {
          return;
        }
        this.setDisplayed(true, { skipAriaHidden: true });
        if (exclusive && this.isGridFocused()) {
          const activeElement = _getActiveDomElement(this.beans);
          if (activeElement && !_isNothingFocused(this.beans)) {
            this.elToFocusAfter = activeElement;
          }
        }
        overlayComponentPromise.then((comp2) => {
          if (this.activePromise !== overlayComponentPromise) {
            if (this.activeOverlay !== comp2) {
              this.destroyBean(comp2);
              comp2 = null;
            }
            return;
          }
          this.activePromise = null;
          if (!comp2) {
            return;
          }
          if (this.activeOverlay !== comp2) {
            this.eOverlayWrapper.appendChild(comp2.getGui());
            this.activeOverlay = comp2;
            if (gridOption) {
              const component = comp2;
              this.updateListenerDestroyFunc = this.addManagedPropertyListener(gridOption, ({ currentValue }) => {
                component.refresh?.(_addGridCommonParams(this.gos, { ...currentValue ?? {} }));
              });
            }
          }
          if (exclusive && this.isGridFocused()) {
            _focusInto(this.eOverlayWrapper);
          }
        });
      }
      updateOverlayWrapperPaddingTop(padding) {
        this.eOverlayWrapper.style.setProperty("padding-top", `${padding}px`);
      }
      destroyActiveOverlay() {
        this.activePromise = null;
        const activeOverlay = this.activeOverlay;
        if (!activeOverlay) {
          return;
        }
        let elementToFocus = this.elToFocusAfter;
        this.activeOverlay = null;
        this.elToFocusAfter = null;
        if (elementToFocus && !this.isGridFocused()) {
          elementToFocus = null;
        }
        const updateListenerDestroyFunc = this.updateListenerDestroyFunc;
        if (updateListenerDestroyFunc) {
          updateListenerDestroyFunc();
          this.updateListenerDestroyFunc = null;
        }
        this.destroyBean(activeOverlay);
        _clearElement(this.eOverlayWrapper);
        elementToFocus?.focus?.({ preventScroll: true });
      }
      hideOverlay() {
        this.destroyActiveOverlay();
        this.setDisplayed(false, { skipAriaHidden: true });
      }
      isGridFocused() {
        const activeEl = _getActiveDomElement(this.beans);
        return !!activeEl && this.beans.eGridDiv.contains(activeEl);
      }
      destroy() {
        this.elToFocusAfter = null;
        this.destroyActiveOverlay();
        this.beans.overlays.setOverlayWrapperComp(void 0);
        super.destroy();
      }
    };
    var OverlayWrapperSelector = {
      selector: "AG-OVERLAY-WRAPPER",
      component: OverlayWrapperComponent
    };
    var OverlayService = class extends BeanStub {
      constructor() {
        super(...arguments);
        this.beanName = "overlays";
        this.state = 0;
        this.showInitialOverlay = true;
        this.wrapperPadding = 0;
      }
      postConstruct() {
        this.isClientSide = _isClientSideRowModel(this.gos);
        this.isServerSide = !this.isClientSide && _isServerSideRowModel(this.gos);
        const updateOverlayVisibility = () => this.updateOverlayVisibility();
        this.addManagedEventListeners({
          newColumnsLoaded: updateOverlayVisibility,
          rowDataUpdated: updateOverlayVisibility,
          gridSizeChanged: this.refreshWrapperPadding.bind(this),
          rowCountReady: () => {
            this.showInitialOverlay = false;
            this.updateOverlayVisibility();
          }
        });
        this.addManagedPropertyListener("loading", updateOverlayVisibility);
      }
      setOverlayWrapperComp(overlayWrapperComp) {
        this.eWrapper = overlayWrapperComp;
        this.updateOverlayVisibility();
      }
      /** Returns true if the overlay is visible. */
      isVisible() {
        return this.state !== 0 && !!this.eWrapper;
      }
      /** Returns true if the overlay is visible and is exclusive (popup over the grid) */
      isExclusive() {
        return this.state === 1 && !!this.eWrapper;
      }
      showLoadingOverlay() {
        this.showInitialOverlay = false;
        const gos = this.gos;
        const loading = gos.get("loading");
        if (!loading && (loading !== void 0 || gos.get("suppressLoadingOverlay"))) {
          return;
        }
        this.doShowLoadingOverlay();
      }
      showNoRowsOverlay() {
        this.showInitialOverlay = false;
        const gos = this.gos;
        if (gos.get("loading") || gos.get("suppressNoRowsOverlay")) {
          return;
        }
        this.doShowNoRowsOverlay();
      }
      hideOverlay() {
        this.showInitialOverlay = false;
        if (this.gos.get("loading")) {
          _warn(99);
          return;
        }
        this.doHideOverlay();
      }
      getOverlayWrapperSelector() {
        return OverlayWrapperSelector;
      }
      getOverlayWrapperCompClass() {
        return OverlayWrapperComponent;
      }
      updateOverlayVisibility() {
        if (!this.eWrapper) {
          this.state = 0;
          return;
        }
        const {
          state,
          isClientSide,
          isServerSide,
          beans: { gos, colModel, rowModel }
        } = this;
        let loading = this.gos.get("loading");
        if (loading !== void 0) {
          this.showInitialOverlay = false;
        }
        if (this.showInitialOverlay && loading === void 0 && !gos.get("suppressLoadingOverlay")) {
          loading = !gos.get("columnDefs") || !colModel.ready || !gos.get("rowData") && isClientSide;
        }
        if (loading) {
          if (state !== 1) {
            this.doShowLoadingOverlay();
          }
        } else {
          this.showInitialOverlay = false;
          if (isClientSide && rowModel.isEmpty() && !gos.get("suppressNoRowsOverlay")) {
            if (state !== 2) {
              this.doShowNoRowsOverlay();
            }
          } else if (state === 1 || !isServerSide && state !== 0) {
            this.doHideOverlay();
          }
        }
      }
      doShowLoadingOverlay() {
        if (!this.eWrapper) {
          return;
        }
        this.state = 1;
        this.showOverlay(
          _getLoadingOverlayCompDetails(this.beans.userCompFactory, _addGridCommonParams(this.gos, {})),
          "ag-overlay-loading-wrapper",
          "loadingOverlayComponentParams"
        );
        this.updateExclusive();
      }
      doShowNoRowsOverlay() {
        if (!this.eWrapper) {
          return;
        }
        this.state = 2;
        this.showOverlay(
          _getNoRowsOverlayCompDetails(this.beans.userCompFactory, _addGridCommonParams(this.gos, {})),
          "ag-overlay-no-rows-wrapper",
          "noRowsOverlayComponentParams"
        );
        this.updateExclusive();
      }
      doHideOverlay() {
        if (!this.eWrapper) {
          return;
        }
        this.state = 0;
        this.eWrapper.hideOverlay();
        this.updateExclusive();
      }
      showOverlay(compDetails, wrapperCssClass, gridOption) {
        const promise = compDetails?.newAgStackInstance() ?? null;
        this.eWrapper?.showOverlay(promise, wrapperCssClass, this.isExclusive(), gridOption);
        this.refreshWrapperPadding();
      }
      updateExclusive() {
        const wasExclusive = this.exclusive;
        this.exclusive = this.isExclusive();
        if (this.exclusive !== wasExclusive) {
          this.eventSvc.dispatchEvent({
            type: "overlayExclusiveChanged"
          });
        }
      }
      refreshWrapperPadding() {
        const eWrapper = this.eWrapper;
        if (!eWrapper) {
          return;
        }
        let newPadding = 0;
        if (this.state === 2) {
          const headerCtrl = this.beans.ctrlsSvc.get("gridHeaderCtrl");
          const headerHeight = headerCtrl?.headerHeight || 0;
          newPadding = headerHeight;
        }
        if (this.wrapperPadding === newPadding) {
          return;
        }
        this.wrapperPadding = newPadding;
        eWrapper.updateOverlayWrapperPaddingTop(newPadding);
      }
    };
    var OverlayModule = {
      moduleName: "Overlay",
      version: VERSION,
      userComponents: {
        agLoadingOverlay: LoadingOverlayComponent2,
        agNoRowsOverlay: NoRowsOverlayComponent2
      },
      apiFunctions: {
        showLoadingOverlay,
        showNoRowsOverlay,
        hideOverlay
      },
      beans: [OverlayService]
    };
    var RowContainerHeightService = class extends BeanStub {
      constructor() {
        super(...arguments);
        this.beanName = "rowContainerHeight";
        this.scrollY = 0;
        this.uiBodyHeight = 0;
      }
      postConstruct() {
        this.addManagedEventListeners({ bodyHeightChanged: this.updateOffset.bind(this) });
        this.maxDivHeight = _getMaxDivHeight();
        _logIfDebug(this.gos, "RowContainerHeightService - maxDivHeight = " + this.maxDivHeight);
      }
      updateOffset() {
        if (!this.stretching) {
          return;
        }
        const newScrollY = this.beans.ctrlsSvc.getScrollFeature().getVScrollPosition().top;
        const newBodyHeight = this.getUiBodyHeight();
        const atLeastOneChanged = newScrollY !== this.scrollY || newBodyHeight !== this.uiBodyHeight;
        if (atLeastOneChanged) {
          this.scrollY = newScrollY;
          this.uiBodyHeight = newBodyHeight;
          this.calculateOffset();
        }
      }
      calculateOffset() {
        this.setUiContainerHeight(this.maxDivHeight);
        this.pixelsToShave = this.modelHeight - this.uiContainerHeight;
        this.maxScrollY = this.uiContainerHeight - this.uiBodyHeight;
        const scrollPercent = this.scrollY / this.maxScrollY;
        const divStretchOffset = scrollPercent * this.pixelsToShave;
        _logIfDebug(
          this.gos,
          `RowContainerHeightService - Div Stretch Offset = ${divStretchOffset} (${this.pixelsToShave} * ${scrollPercent})`
        );
        this.setDivStretchOffset(divStretchOffset);
      }
      setUiContainerHeight(height) {
        if (height !== this.uiContainerHeight) {
          this.uiContainerHeight = height;
          this.eventSvc.dispatchEvent({ type: "rowContainerHeightChanged" });
        }
      }
      clearOffset() {
        this.setUiContainerHeight(this.modelHeight);
        this.pixelsToShave = 0;
        this.setDivStretchOffset(0);
      }
      setDivStretchOffset(newOffset) {
        const newOffsetFloor = typeof newOffset === "number" ? Math.floor(newOffset) : null;
        if (this.divStretchOffset === newOffsetFloor) {
          return;
        }
        this.divStretchOffset = newOffsetFloor;
        this.eventSvc.dispatchEvent({ type: "heightScaleChanged" });
      }
      setModelHeight(modelHeight) {
        this.modelHeight = modelHeight;
        this.stretching = modelHeight != null && // null happens when in print layout
        this.maxDivHeight > 0 && modelHeight > this.maxDivHeight;
        if (this.stretching) {
          this.calculateOffset();
        } else {
          this.clearOffset();
        }
      }
      getRealPixelPosition(modelPixel) {
        return modelPixel - this.divStretchOffset;
      }
      getUiBodyHeight() {
        const pos2 = this.beans.ctrlsSvc.getScrollFeature().getVScrollPosition();
        return pos2.bottom - pos2.top;
      }
      getScrollPositionForPixel(rowTop) {
        if (this.pixelsToShave <= 0) {
          return rowTop;
        }
        const modelMaxScroll = this.modelHeight - this.getUiBodyHeight();
        const scrollPercent = rowTop / modelMaxScroll;
        const scrollPixel = this.maxScrollY * scrollPercent;
        return scrollPixel;
      }
    };
    var ROW_ANIMATION_TIMEOUT = 400;
    var RowRenderer = class extends BeanStub {
      constructor() {
        super(...arguments);
        this.beanName = "rowRenderer";
        this.destroyFuncsForColumnListeners = [];
        this.rowCtrlsByRowIndex = {};
        this.zombieRowCtrls = {};
        this.allRowCtrls = [];
        this.topRowCtrls = [];
        this.bottomRowCtrls = [];
        this.refreshInProgress = false;
        this.dataFirstRenderedFired = false;
        this.setupRangeSelectionListeners = () => {
          const onCellSelectionChanged = () => {
            for (const cellCtrl of this.getAllCellCtrls()) {
              cellCtrl.onCellSelectionChanged();
            }
          };
          const onColumnMovedPinnedVisible = () => {
            for (const cellCtrl of this.getAllCellCtrls()) {
              cellCtrl.updateRangeBordersIfRangeCount();
            }
          };
          const addCellSelectionListeners = () => {
            this.eventSvc.addListener("cellSelectionChanged", onCellSelectionChanged);
            this.eventSvc.addListener("columnMoved", onColumnMovedPinnedVisible);
            this.eventSvc.addListener("columnPinned", onColumnMovedPinnedVisible);
            this.eventSvc.addListener("columnVisible", onColumnMovedPinnedVisible);
          };
          const removeCellSelectionListeners = () => {
            this.eventSvc.removeListener("cellSelectionChanged", onCellSelectionChanged);
            this.eventSvc.removeListener("columnMoved", onColumnMovedPinnedVisible);
            this.eventSvc.removeListener("columnPinned", onColumnMovedPinnedVisible);
            this.eventSvc.removeListener("columnVisible", onColumnMovedPinnedVisible);
          };
          this.addDestroyFunc(() => removeCellSelectionListeners());
          this.addManagedPropertyListeners(["enableRangeSelection", "cellSelection"], () => {
            const isEnabled = _isCellSelectionEnabled(this.gos);
            if (isEnabled) {
              addCellSelectionListeners();
            } else {
              removeCellSelectionListeners();
            }
          });
          const cellSelectionEnabled = _isCellSelectionEnabled(this.gos);
          if (cellSelectionEnabled) {
            addCellSelectionListeners();
          }
        };
      }
      wireBeans(beans) {
        this.pageBounds = beans.pageBounds;
        this.colModel = beans.colModel;
        this.pinnedRowModel = beans.pinnedRowModel;
        this.rowModel = beans.rowModel;
        this.focusSvc = beans.focusSvc;
        this.rowContainerHeight = beans.rowContainerHeight;
        this.ctrlsSvc = beans.ctrlsSvc;
        this.editSvc = beans.editSvc;
      }
      postConstruct() {
        this.ctrlsSvc.whenReady(this, (p) => {
          this.gridBodyCtrl = p.gridBodyCtrl;
          this.initialise();
        });
      }
      initialise() {
        this.addManagedEventListeners({
          paginationChanged: this.onPageLoaded.bind(this),
          pinnedRowDataChanged: this.onPinnedRowDataChanged.bind(this),
          pinnedRowsChanged: this.onPinnedRowsChanged.bind(this),
          displayedColumnsChanged: this.onDisplayedColumnsChanged.bind(this),
          bodyScroll: this.onBodyScroll.bind(this),
          bodyHeightChanged: this.redraw.bind(this, {})
        });
        this.addManagedPropertyListeners(["domLayout", "embedFullWidthRows"], () => this.onDomLayoutChanged());
        this.addManagedPropertyListeners(["suppressMaxRenderedRowRestriction", "rowBuffer"], () => this.redraw());
        this.addManagedPropertyListener("suppressCellFocus", (e) => this.onSuppressCellFocusChanged(e.currentValue));
        this.addManagedPropertyListeners(
          [
            "groupSuppressBlankHeader",
            "getBusinessKeyForNode",
            "fullWidthCellRenderer",
            "fullWidthCellRendererParams",
            "suppressStickyTotalRow",
            "groupRowRenderer",
            "groupRowRendererParams",
            // maybe only needs to refresh FW rows...
            "loadingCellRenderer",
            "loadingCellRendererParams",
            "detailCellRenderer",
            "detailCellRendererParams",
            "enableRangeSelection",
            "enableCellTextSelection"
          ],
          () => this.redrawRows()
        );
        this.addManagedPropertyListener("cellSelection", ({ currentValue, previousValue }) => {
          if (!previousValue && currentValue || previousValue && !currentValue) {
            this.redrawRows();
          }
        });
        const { stickyRowSvc, gos, showRowGroupCols } = this.beans;
        if (showRowGroupCols) {
          this.addManagedPropertyListener("showOpenedGroup", () => {
            const columns = showRowGroupCols.getShowRowGroupCols();
            if (columns.length) {
              this.refreshCells({ columns, force: true });
            }
          });
        }
        if (stickyRowSvc) {
          this.stickyRowFeature = stickyRowSvc.createStickyRowFeature(
            this,
            this.createRowCon.bind(this),
            this.destroyRowCtrls.bind(this)
          );
        } else {
          const gridBodyCtrl = this.gridBodyCtrl;
          gridBodyCtrl.setStickyTopHeight(0);
          gridBodyCtrl.setStickyBottomHeight(0);
        }
        this.registerCellEventListeners();
        this.initialiseCache();
        this.printLayout = _isDomLayout(gos, "print");
        this.embedFullWidthRows = this.printLayout || gos.get("embedFullWidthRows");
        this.redrawAfterModelUpdate();
      }
      initialiseCache() {
        if (this.gos.get("keepDetailRows")) {
          const countProp = this.getKeepDetailRowsCount();
          const count = countProp != null ? countProp : 3;
          this.cachedRowCtrls = new RowCtrlCache(count);
        }
      }
      getKeepDetailRowsCount() {
        return this.gos.get("keepDetailRowsCount");
      }
      getStickyTopRowCtrls() {
        return this.stickyRowFeature?.stickyTopRowCtrls ?? [];
      }
      getStickyBottomRowCtrls() {
        return this.stickyRowFeature?.stickyBottomRowCtrls ?? [];
      }
      updateAllRowCtrls() {
        const liveList = Object.values(this.rowCtrlsByRowIndex);
        const zombieList = Object.values(this.zombieRowCtrls);
        const cachedList = this.cachedRowCtrls?.getEntries() ?? [];
        if (zombieList.length > 0 || cachedList.length > 0) {
          this.allRowCtrls = [...liveList, ...zombieList, ...cachedList];
        } else {
          this.allRowCtrls = liveList;
        }
      }
      /**
       * Checks if the cell is rendered or not. Also returns true if row ctrl is present but has not rendered
       * cells yet.
       * @returns true if cellCtrl is present, or if the row is present but has not rendered rows yet
       */
      isCellBeingRendered(rowIndex, column2) {
        const rowCtrl = this.rowCtrlsByRowIndex[rowIndex];
        if (!column2 || !rowCtrl) {
          return !!rowCtrl;
        }
        if (rowCtrl.isFullWidth()) {
          return true;
        }
        const spannedCell = this.beans.spannedRowRenderer?.getCellByPosition({ rowIndex, column: column2, rowPinned: null });
        return !!spannedCell || !!rowCtrl.getCellCtrl(column2) || !rowCtrl.isRowRendered();
      }
      /**
       * Notifies all row and cell controls of any change in focused cell.
       * @param event cell focused event
       */
      updateCellFocus(event) {
        for (const cellCtrl of this.getAllCellCtrls()) {
          cellCtrl.onCellFocused(event);
        }
        for (const rowCtrl of this.getFullWidthRowCtrls()) {
          rowCtrl.onFullWidthRowFocused(event);
        }
      }
      /**
       * Called when a new cell is focused in the grid
       * - if the focused cell isn't rendered; re-draw rows to dry to render it
       * - subsequently updates all cell and row controls with the new focused cell
       * @param event cell focused event
       */
      onCellFocusChanged(event) {
        if (event?.rowIndex != null && !event.rowPinned) {
          const col = this.beans.colModel.getCol(event.column) ?? void 0;
          if (!this.isCellBeingRendered(event.rowIndex, col)) {
            this.redraw();
          }
        }
        this.updateCellFocus(event);
      }
      onSuppressCellFocusChanged(suppressCellFocus) {
        for (const cellCtrl of this.getAllCellCtrls()) {
          cellCtrl.onSuppressCellFocusChanged(suppressCellFocus);
        }
        for (const rowCtrl of this.getFullWidthRowCtrls()) {
          rowCtrl.onSuppressCellFocusChanged(suppressCellFocus);
        }
      }
      // in a clean design, each cell would register for each of these events. however when scrolling, all the cells
      // registering and de-registering for events is a performance bottleneck. so we register here once and inform
      // all active cells.
      registerCellEventListeners() {
        this.addManagedEventListeners({
          cellFocused: (event) => this.onCellFocusChanged(event),
          cellFocusCleared: () => this.updateCellFocus(),
          flashCells: (event) => {
            const { cellFlashSvc } = this.beans;
            if (cellFlashSvc) {
              for (const cellCtrl of this.getAllCellCtrls()) {
                cellFlashSvc.onFlashCells(cellCtrl, event);
              }
            }
          },
          columnHoverChanged: () => {
            for (const cellCtrl of this.getAllCellCtrls()) {
              cellCtrl.onColumnHover();
            }
          },
          displayedColumnsChanged: () => {
            for (const cellCtrl of this.getAllCellCtrls()) {
              cellCtrl.onDisplayedColumnsChanged();
            }
          },
          displayedColumnsWidthChanged: () => {
            if (this.printLayout) {
              for (const cellCtrl of this.getAllCellCtrls()) {
                cellCtrl.onLeftChanged();
              }
            }
          }
        });
        this.setupRangeSelectionListeners();
        this.refreshListenersToColumnsForCellComps();
        this.addManagedEventListeners({
          gridColumnsChanged: this.refreshListenersToColumnsForCellComps.bind(this)
        });
        this.addDestroyFunc(this.removeGridColumnListeners.bind(this));
      }
      // executes all functions in destroyFuncsForColumnListeners and then clears the list
      removeGridColumnListeners() {
        for (const func of this.destroyFuncsForColumnListeners) {
          func();
        }
        this.destroyFuncsForColumnListeners.length = 0;
      }
      // this function adds listeners onto all the grid columns, which are the column that we could have cellComps for.
      // when the grid columns change, we add listeners again. in an ideal design, each CellComp would just register to
      // the column it belongs to on creation, however this was a bottleneck with the number of cells, so do it here
      // once instead.
      refreshListenersToColumnsForCellComps() {
        this.removeGridColumnListeners();
        const cols = this.colModel.getCols();
        for (const col of cols) {
          const forEachCellWithThisCol = (callback) => {
            for (const cellCtrl of this.getAllCellCtrls()) {
              if (cellCtrl.column === col) {
                callback(cellCtrl);
              }
            }
          };
          const leftChangedListener = () => {
            forEachCellWithThisCol((cellCtrl) => cellCtrl.onLeftChanged());
          };
          const widthChangedListener = () => {
            forEachCellWithThisCol((cellCtrl) => cellCtrl.onWidthChanged());
          };
          const firstRightPinnedChangedListener = () => {
            forEachCellWithThisCol((cellCtrl) => cellCtrl.onFirstRightPinnedChanged());
          };
          const lastLeftPinnedChangedListener = () => {
            forEachCellWithThisCol((cellCtrl) => cellCtrl.onLastLeftPinnedChanged());
          };
          const colDefChangedListener = () => {
            forEachCellWithThisCol((cellCtrl) => cellCtrl.onColDefChanged());
          };
          col.__addEventListener("leftChanged", leftChangedListener);
          col.__addEventListener("widthChanged", widthChangedListener);
          col.__addEventListener("firstRightPinnedChanged", firstRightPinnedChangedListener);
          col.__addEventListener("lastLeftPinnedChanged", lastLeftPinnedChangedListener);
          col.__addEventListener("colDefChanged", colDefChangedListener);
          this.destroyFuncsForColumnListeners.push(() => {
            col.__removeEventListener("leftChanged", leftChangedListener);
            col.__removeEventListener("widthChanged", widthChangedListener);
            col.__removeEventListener("firstRightPinnedChanged", firstRightPinnedChangedListener);
            col.__removeEventListener("lastLeftPinnedChanged", lastLeftPinnedChangedListener);
            col.__removeEventListener("colDefChanged", colDefChangedListener);
          });
        }
      }
      onDomLayoutChanged() {
        const printLayout = _isDomLayout(this.gos, "print");
        const embedFullWidthRows = printLayout || this.gos.get("embedFullWidthRows");
        const destroyRows = embedFullWidthRows !== this.embedFullWidthRows || this.printLayout !== printLayout;
        this.printLayout = printLayout;
        this.embedFullWidthRows = embedFullWidthRows;
        if (destroyRows) {
          this.redrawAfterModelUpdate({ domLayoutChanged: true });
        }
      }
      // for row models that have datasources, when we update the datasource, we need to force the rowRenderer
      // to redraw all rows. otherwise the old rows from the old datasource will stay displayed.
      datasourceChanged() {
        this.firstRenderedRow = 0;
        this.lastRenderedRow = -1;
        const rowIndexesToRemove = Object.keys(this.rowCtrlsByRowIndex);
        this.removeRowCtrls(rowIndexesToRemove);
      }
      onPageLoaded(event) {
        const params = {
          recycleRows: event.keepRenderedRows,
          animate: event.animate,
          newData: event.newData,
          newPage: event.newPage,
          // because this is a model updated event (not pinned rows), we
          // can skip updating the pinned rows. this is needed so that if user
          // is doing transaction updates, the pinned rows are not getting constantly
          // trashed - or editing cells in pinned rows are not refreshed and put into read mode
          onlyBody: true
        };
        this.redrawAfterModelUpdate(params);
      }
      /**
       * @param column AgColumn
       * @returns An array with HTMLElement for every cell of the column passed as param.
       * If the cell is spanning across multiple columns, it only returns the html element
       * if the column passed is the first column of the span (used for auto width calculation).
       */
      getAllCellsNotSpanningForColumn(column2) {
        const res = [];
        for (const rowCtrl of this.getAllRowCtrls()) {
          const eCell = rowCtrl.getCellCtrl(column2, true)?.eGui;
          if (eCell) {
            res.push(eCell);
          }
        }
        return res;
      }
      refreshFloatingRowComps(recycleRows = true) {
        this.refreshFloatingRows(this.topRowCtrls, "top", recycleRows);
        this.refreshFloatingRows(this.bottomRowCtrls, "bottom", recycleRows);
      }
      /**
       * Determines which row controllers need to be destroyed and re-created vs which ones can
       * be re-used.
       *
       * This is operation is to pinned/floating rows as `this.recycleRows` is to normal/body rows.
       *
       * All `RowCtrl` instances in `rowCtrls` that don't correspond to `RowNode` instances in `rowNodes` are destroyed.
       * All `RowNode` instances in `rowNodes` that don't correspond to `RowCtrl` instances in `rowCtrls` are created.
       * All instances in `rowCtrls` must be in the same order as their corresponding nodes in `rowNodes`.
       *
       * @param rowCtrls The list of existing row controllers
       * @param rowNodes The canonical list of row nodes that should have associated controllers
       */
      refreshFloatingRows(rowCtrls, floating, recycleRows) {
        const { pinnedRowModel, beans, printLayout } = this;
        const rowCtrlMap = Object.fromEntries(rowCtrls.map((ctrl) => [ctrl.rowNode.id, ctrl]));
        pinnedRowModel?.forEachPinnedRow(floating, (node2, i2) => {
          const rowCtrl = rowCtrls[i2];
          const rowCtrlDoesNotExist = rowCtrl && pinnedRowModel.getPinnedRowById(rowCtrl.rowNode.id, floating) === void 0;
          if (rowCtrlDoesNotExist) {
            rowCtrl.destroyFirstPass();
            rowCtrl.destroySecondPass();
          }
          if (node2.id in rowCtrlMap && recycleRows) {
            rowCtrls[i2] = rowCtrlMap[node2.id];
            delete rowCtrlMap[node2.id];
          } else {
            rowCtrls[i2] = new RowCtrl(node2, beans, false, false, printLayout);
          }
        });
        const rowNodeCount = (floating === "top" ? pinnedRowModel?.getPinnedTopRowCount() : pinnedRowModel?.getPinnedBottomRowCount()) ?? 0;
        rowCtrls.length = rowNodeCount;
      }
      onPinnedRowDataChanged() {
        const params = {
          recycleRows: true
        };
        this.redrawAfterModelUpdate(params);
      }
      onPinnedRowsChanged() {
        this.redrawAfterModelUpdate({ recycleRows: true });
      }
      redrawRow(rowNode, suppressEvent = false) {
        if (rowNode.sticky) {
          this.stickyRowFeature?.refreshStickyNode(rowNode);
        } else if (this.cachedRowCtrls?.has(rowNode)) {
          this.cachedRowCtrls.removeRow(rowNode);
          return;
        } else {
          const destroyAndRecreateCtrl = (dataStruct) => {
            const ctrl = dataStruct[rowNode.rowIndex];
            if (!ctrl) {
              return;
            }
            if (ctrl.rowNode !== rowNode) {
              return;
            }
            ctrl.destroyFirstPass();
            ctrl.destroySecondPass();
            dataStruct[rowNode.rowIndex] = this.createRowCon(rowNode, false, false);
          };
          switch (rowNode.rowPinned) {
            case "top":
              destroyAndRecreateCtrl(this.topRowCtrls);
              break;
            case "bottom":
              destroyAndRecreateCtrl(this.bottomRowCtrls);
              break;
            default:
              destroyAndRecreateCtrl(this.rowCtrlsByRowIndex);
              this.updateAllRowCtrls();
          }
        }
        if (!suppressEvent) {
          this.dispatchDisplayedRowsChanged(false);
        }
      }
      redrawRows(rowNodes) {
        const { editSvc } = this.beans;
        if (editSvc?.isEditing()) {
          if (editSvc.isBatchEditing()) {
            editSvc.cleanupEditors();
          } else {
            editSvc.stopEditing(void 0, { source: "api" });
          }
        }
        const partialRefresh = rowNodes != null;
        if (partialRefresh) {
          for (const node2 of rowNodes ?? []) {
            this.redrawRow(node2, true);
          }
          this.dispatchDisplayedRowsChanged(false);
          return;
        }
        this.redrawAfterModelUpdate();
      }
      // gets called from:
      // +) initialisation (in registerGridComp) params = null
      // +) onDomLayoutChanged, params = null
      // +) onPageLoaded, recycleRows, animate, newData, newPage from event, onlyBody=true
      // +) onPinnedRowDataChanged, recycleRows = true
      // +) redrawRows (from Grid API), recycleRows = true/false
      redrawAfterModelUpdate(params = {}) {
        this.getLockOnRefresh();
        const focusedCell = this.beans.focusSvc?.getFocusCellToUseAfterRefresh();
        this.updateContainerHeights();
        this.scrollToTopIfNewData(params);
        const recycleRows = !params.domLayoutChanged && !!params.recycleRows;
        const animate2 = params.animate && _isAnimateRows(this.gos);
        const rowsToRecycle = recycleRows ? this.getRowsToRecycle() : null;
        if (!recycleRows) {
          this.removeAllRowComps();
        }
        this.workOutFirstAndLastRowsToRender();
        const { stickyRowFeature, gos } = this;
        if (stickyRowFeature) {
          stickyRowFeature.checkStickyRows();
          const extraHeight = stickyRowFeature.extraTopHeight + stickyRowFeature.extraBottomHeight;
          if (extraHeight) {
            this.updateContainerHeights(extraHeight);
          }
        }
        this.recycleRows(rowsToRecycle, animate2);
        this.gridBodyCtrl.updateRowCount();
        if (!params.onlyBody) {
          this.refreshFloatingRowComps(gos.get("enableRowPinning") ? recycleRows : void 0);
        }
        this.dispatchDisplayedRowsChanged();
        if (focusedCell != null) {
          this.restoreFocusedCell(focusedCell);
        }
        this.releaseLockOnRefresh();
      }
      scrollToTopIfNewData(params) {
        const scrollToTop = params.newData || params.newPage;
        const suppressScrollToTop = this.gos.get("suppressScrollOnNewData");
        if (scrollToTop && !suppressScrollToTop) {
          this.gridBodyCtrl.scrollFeature.scrollToTop();
          this.stickyRowFeature?.resetOffsets();
        }
      }
      updateContainerHeights(additionalHeight = 0) {
        const { rowContainerHeight } = this;
        if (this.printLayout) {
          rowContainerHeight.setModelHeight(null);
          return;
        }
        let containerHeight = this.pageBounds.getCurrentPageHeight();
        if (containerHeight === 0) {
          containerHeight = 1;
        }
        rowContainerHeight.setModelHeight(containerHeight + additionalHeight);
      }
      getLockOnRefresh() {
        if (this.refreshInProgress) {
          throw new Error(_errMsg(252));
        }
        this.refreshInProgress = true;
        this.beans.frameworkOverrides.getLockOnRefresh?.();
      }
      releaseLockOnRefresh() {
        this.refreshInProgress = false;
        this.beans.frameworkOverrides.releaseLockOnRefresh?.();
      }
      isRefreshInProgress() {
        return this.refreshInProgress;
      }
      // sets the focus to the provided cell, if the cell is provided. this way, the user can call refresh without
      // worry about the focus been lost. this is important when the user is using keyboard navigation to do edits
      // and the cellEditor is calling 'refresh' to get other cells to update (as other cells might depend on the
      // edited cell).
      restoreFocusedCell(cellPosition) {
        if (!cellPosition) {
          return;
        }
        const focusSvc = this.beans.focusSvc;
        const cellToFocus = this.findPositionToFocus(cellPosition);
        if (!cellToFocus) {
          focusSvc.focusHeaderPosition({
            headerPosition: {
              headerRowIndex: getFocusHeaderRowCount(this.beans) - 1,
              column: cellPosition.column
            }
          });
          return;
        }
        if (cellPosition.rowIndex !== cellToFocus.rowIndex || cellPosition.rowPinned != cellToFocus.rowPinned) {
          focusSvc.setFocusedCell({
            ...cellToFocus,
            preventScrollOnBrowserFocus: true,
            forceBrowserFocus: true
          });
          return;
        }
        if (!focusSvc.doesRowOrCellHaveBrowserFocus()) {
          this.updateCellFocus(
            _addGridCommonParams(this.gos, {
              ...cellToFocus,
              forceBrowserFocus: true,
              preventScrollOnBrowserFocus: true,
              type: "cellFocused"
            })
          );
        }
      }
      findPositionToFocus(cellPosition) {
        const { pagination, pageBounds } = this.beans;
        let rowPosition = cellPosition;
        if (rowPosition.rowPinned == null && pagination && pageBounds && !pagination.isRowInPage(rowPosition.rowIndex)) {
          rowPosition = { rowPinned: null, rowIndex: pageBounds.getFirstRow() };
        }
        while (rowPosition) {
          if (rowPosition.rowPinned == null && pageBounds) {
            if (rowPosition.rowIndex < pageBounds.getFirstRow()) {
              rowPosition = _getRowAbove(this.beans, { rowPinned: null, rowIndex: 0 });
              if (!rowPosition) {
                return null;
              }
            } else if (rowPosition.rowIndex > pageBounds.getLastRow()) {
              rowPosition = { rowPinned: null, rowIndex: pageBounds.getLastRow() };
            }
          }
          const row2 = this.getRowByPosition(rowPosition);
          if (row2?.isAlive()) {
            return { ...row2.getRowPosition(), column: cellPosition.column };
          }
          rowPosition = _getRowAbove(this.beans, rowPosition);
        }
        return null;
      }
      getAllCellCtrls() {
        const res = [];
        const rowCtrls = this.getAllRowCtrls();
        const rowCtrlsLength = rowCtrls.length;
        for (let i2 = 0; i2 < rowCtrlsLength; i2++) {
          const cellCtrls = rowCtrls[i2].getAllCellCtrls();
          const cellCtrlsLength = cellCtrls.length;
          for (let j = 0; j < cellCtrlsLength; j++) {
            res.push(cellCtrls[j]);
          }
        }
        return res;
      }
      getAllRowCtrls() {
        const { spannedRowRenderer } = this.beans;
        const stickyTopRowCtrls = this.getStickyTopRowCtrls();
        const stickyBottomRowCtrls = this.getStickyBottomRowCtrls();
        const res = [
          ...this.topRowCtrls,
          ...this.bottomRowCtrls,
          ...stickyTopRowCtrls,
          ...stickyBottomRowCtrls,
          ...spannedRowRenderer?.getCtrls("top") ?? [],
          ...spannedRowRenderer?.getCtrls("bottom") ?? [],
          ...spannedRowRenderer?.getCtrls("center") ?? [],
          ...Object.values(this.rowCtrlsByRowIndex)
        ];
        return res;
      }
      addRenderedRowListener(eventName, rowIndex, callback) {
        const rowComp = this.rowCtrlsByRowIndex[rowIndex];
        if (rowComp) {
          rowComp.addEventListener(eventName, callback);
        }
      }
      refreshCells({ rowNodes, columns, force, suppressFlash } = {}) {
        const refreshCellParams = {
          force,
          newData: false,
          suppressFlash
        };
        for (const cellCtrl of this.getCellCtrls(rowNodes, columns)) {
          cellCtrl.refreshOrDestroyCell(refreshCellParams);
        }
        this.refreshFullWidth(rowNodes);
      }
      refreshRows(params = {}) {
        for (const rowCtrl of this.getRowCtrls(params.rowNodes)) {
          rowCtrl.refreshRow(params);
        }
        this.refreshFullWidth(params.rowNodes);
      }
      refreshFullWidth(rowNodes) {
        if (!rowNodes) {
          return;
        }
        let rowRedrawn = false;
        for (const rowCtrl of this.getRowCtrls(rowNodes)) {
          if (!rowCtrl.isFullWidth()) {
            continue;
          }
          const refreshed = rowCtrl.refreshFullWidth();
          if (!refreshed) {
            rowRedrawn = true;
            this.redrawRow(rowCtrl.rowNode, true);
          }
        }
        if (rowRedrawn) {
          this.dispatchDisplayedRowsChanged(false);
        }
      }
      /**
       * @param rowNodes if provided, returns the RowCtrls for the provided rowNodes. otherwise returns all RowCtrls.
       */
      getRowCtrls(rowNodes) {
        const rowIdsMap = mapRowNodes(rowNodes);
        const allRowCtrls = this.getAllRowCtrls();
        if (!rowNodes || !rowIdsMap) {
          return allRowCtrls;
        }
        return allRowCtrls.filter((rowCtrl) => {
          const rowNode = rowCtrl.rowNode;
          return isRowInMap(rowNode, rowIdsMap);
        });
      }
      // returns CellCtrl's that match the provided rowNodes and columns. eg if one row node
      // and two columns provided, that identifies 4 cells, so 4 CellCtrl's returned.
      getCellCtrls(rowNodes, columns) {
        let colIdsMap;
        if (_exists(columns)) {
          colIdsMap = {};
          columns.forEach((colKey) => {
            const column2 = this.colModel.getCol(colKey);
            if (_exists(column2)) {
              colIdsMap[column2.getId()] = true;
            }
          });
        }
        const res = [];
        for (const rowCtrl of this.getRowCtrls(rowNodes)) {
          for (const cellCtrl of rowCtrl.getAllCellCtrls()) {
            const colId = cellCtrl.column.getId();
            const excludeColFromRefresh = colIdsMap && !colIdsMap[colId];
            if (excludeColFromRefresh) {
              continue;
            }
            res.push(cellCtrl);
          }
        }
        return res;
      }
      destroy() {
        this.removeAllRowComps(true);
        super.destroy();
      }
      removeAllRowComps(suppressAnimation = false) {
        const rowIndexesToRemove = Object.keys(this.rowCtrlsByRowIndex);
        this.removeRowCtrls(rowIndexesToRemove, suppressAnimation);
        this.stickyRowFeature?.destroyStickyCtrls();
      }
      getRowsToRecycle() {
        const stubNodeIndexes = [];
        for (const index of Object.keys(this.rowCtrlsByRowIndex)) {
          const rowCtrl = this.rowCtrlsByRowIndex[index];
          const stubNode = rowCtrl.rowNode.id == null;
          if (stubNode) {
            stubNodeIndexes.push(index);
          }
        }
        this.removeRowCtrls(stubNodeIndexes);
        const ctrlsByIdMap = {};
        for (const rowCtrl of Object.values(this.rowCtrlsByRowIndex)) {
          const rowNode = rowCtrl.rowNode;
          ctrlsByIdMap[rowNode.id] = rowCtrl;
        }
        this.rowCtrlsByRowIndex = {};
        return ctrlsByIdMap;
      }
      // takes array of row indexes
      removeRowCtrls(rowsToRemove, suppressAnimation = false) {
        for (const indexToRemove of rowsToRemove) {
          const rowCtrl = this.rowCtrlsByRowIndex[indexToRemove];
          if (rowCtrl) {
            rowCtrl.destroyFirstPass(suppressAnimation);
            rowCtrl.destroySecondPass();
          }
          delete this.rowCtrlsByRowIndex[indexToRemove];
        }
      }
      onBodyScroll(e) {
        if (e.direction !== "vertical") {
          return;
        }
        this.redraw({ afterScroll: true });
      }
      // gets called when rows don't change, but viewport does, so after:
      // 1) height of grid body changes, ie number of displayed rows has changed
      // 2) grid scrolled to new position
      // 3) ensure index visible (which is a scroll)
      redraw(params = {}) {
        const { focusSvc, animationFrameSvc } = this.beans;
        const { afterScroll } = params;
        let cellFocused;
        const stickyRowFeature = this.stickyRowFeature;
        if (stickyRowFeature) {
          cellFocused = focusSvc?.getFocusCellToUseAfterRefresh() || void 0;
        }
        const oldFirstRow = this.firstRenderedRow;
        const oldLastRow = this.lastRenderedRow;
        this.workOutFirstAndLastRowsToRender();
        let hasStickyRowChanges = false;
        if (stickyRowFeature) {
          hasStickyRowChanges = stickyRowFeature.checkStickyRows();
          const extraHeight = stickyRowFeature.extraTopHeight + stickyRowFeature.extraBottomHeight;
          if (extraHeight) {
            this.updateContainerHeights(extraHeight);
          }
        }
        const rangeChanged = this.firstRenderedRow !== oldFirstRow || this.lastRenderedRow !== oldLastRow;
        if (afterScroll && !hasStickyRowChanges && !rangeChanged) {
          return;
        }
        this.getLockOnRefresh();
        this.recycleRows(null, false, afterScroll);
        this.releaseLockOnRefresh();
        this.dispatchDisplayedRowsChanged(afterScroll && !hasStickyRowChanges);
        if (cellFocused != null) {
          const newFocusedCell = focusSvc?.getFocusCellToUseAfterRefresh();
          if (cellFocused != null && newFocusedCell == null) {
            animationFrameSvc?.flushAllFrames();
            this.restoreFocusedCell(cellFocused);
          }
        }
      }
      removeRowCompsNotToDraw(indexesToDraw, suppressAnimation) {
        const indexesToDrawMap = {};
        for (const index of indexesToDraw) {
          indexesToDrawMap[index] = true;
        }
        const existingIndexes = Object.keys(this.rowCtrlsByRowIndex);
        const indexesNotToDraw = existingIndexes.filter((index) => !indexesToDrawMap[index]);
        this.removeRowCtrls(indexesNotToDraw, suppressAnimation);
      }
      calculateIndexesToDraw(rowsToRecycle) {
        const indexesToDraw = [];
        for (let i2 = this.firstRenderedRow; i2 <= this.lastRenderedRow; i2++) {
          indexesToDraw.push(i2);
        }
        const pagination = this.beans.pagination;
        const focusedRowIndex = this.beans.focusSvc?.getFocusedCell()?.rowIndex;
        if (focusedRowIndex != null && (focusedRowIndex < this.firstRenderedRow || focusedRowIndex > this.lastRenderedRow) && (!pagination || pagination.isRowInPage(focusedRowIndex)) && focusedRowIndex < this.rowModel.getRowCount()) {
          indexesToDraw.push(focusedRowIndex);
        }
        const checkRowToDraw = (rowComp) => {
          const index = rowComp.rowNode.rowIndex;
          if (index == null || index === focusedRowIndex) {
            return;
          }
          if (index < this.firstRenderedRow || index > this.lastRenderedRow) {
            if (this.doNotUnVirtualiseRow(rowComp)) {
              indexesToDraw.push(index);
            }
          }
        };
        for (const rowCtrl of Object.values(this.rowCtrlsByRowIndex)) {
          checkRowToDraw(rowCtrl);
        }
        if (rowsToRecycle) {
          for (const rowCtrl of Object.values(rowsToRecycle)) {
            checkRowToDraw(rowCtrl);
          }
        }
        indexesToDraw.sort((a, b) => a - b);
        const ret = [];
        for (let i2 = 0; i2 < indexesToDraw.length; i2++) {
          const currRow = indexesToDraw[i2];
          const rowNode = this.rowModel.getRow(currRow);
          if (rowNode && !rowNode.sticky) {
            ret.push(currRow);
          }
        }
        return ret;
      }
      recycleRows(rowsToRecycle, animate2 = false, afterScroll = false) {
        const indexesToDraw = this.calculateIndexesToDraw(rowsToRecycle);
        if (this.printLayout || afterScroll) {
          animate2 = false;
        }
        this.removeRowCompsNotToDraw(indexesToDraw, !animate2);
        for (const rowIndex of indexesToDraw) {
          this.createOrUpdateRowCtrl(rowIndex, rowsToRecycle, animate2, afterScroll);
        }
        if (rowsToRecycle) {
          const { animationFrameSvc } = this.beans;
          const useAnimationFrame = animationFrameSvc?.active && afterScroll && !this.printLayout;
          if (useAnimationFrame) {
            animationFrameSvc.addDestroyTask(() => {
              this.destroyRowCtrls(rowsToRecycle, animate2);
              this.updateAllRowCtrls();
              this.dispatchDisplayedRowsChanged();
            });
          } else {
            this.destroyRowCtrls(rowsToRecycle, animate2);
          }
        }
        this.updateAllRowCtrls();
      }
      dispatchDisplayedRowsChanged(afterScroll = false) {
        this.eventSvc.dispatchEvent({
          type: "displayedRowsChanged",
          afterScroll
        });
      }
      onDisplayedColumnsChanged() {
        const { visibleCols } = this.beans;
        const pinningLeft = visibleCols.isPinningLeft();
        const pinningRight = visibleCols.isPinningRight();
        const atLeastOneChanged = this.pinningLeft !== pinningLeft || pinningRight !== this.pinningRight;
        if (atLeastOneChanged) {
          this.pinningLeft = pinningLeft;
          this.pinningRight = pinningRight;
          if (this.embedFullWidthRows) {
            this.redrawFullWidthEmbeddedRows();
          }
        }
      }
      // when embedding, what gets showed in each section depends on what is pinned. eg if embedding group expand / collapse,
      // then it should go into the pinned left area if pinning left, or the center area if not pinning.
      redrawFullWidthEmbeddedRows() {
        const rowsToRemove = [];
        for (const fullWidthCtrl of this.getFullWidthRowCtrls()) {
          const rowIndex = fullWidthCtrl.rowNode.rowIndex;
          rowsToRemove.push(rowIndex.toString());
        }
        this.refreshFloatingRowComps();
        this.removeRowCtrls(rowsToRemove);
        this.redraw({ afterScroll: true });
      }
      getFullWidthRowCtrls(rowNodes) {
        const rowNodesMap = mapRowNodes(rowNodes);
        return this.getAllRowCtrls().filter((rowCtrl) => {
          if (!rowCtrl.isFullWidth()) {
            return false;
          }
          const rowNode = rowCtrl.rowNode;
          if (rowNodesMap != null && !isRowInMap(rowNode, rowNodesMap)) {
            return false;
          }
          return true;
        });
      }
      createOrUpdateRowCtrl(rowIndex, rowsToRecycle, animate2, afterScroll) {
        let rowNode;
        let rowCtrl = this.rowCtrlsByRowIndex[rowIndex];
        if (!rowCtrl) {
          rowNode = this.rowModel.getRow(rowIndex);
          if (_exists(rowNode) && _exists(rowsToRecycle) && rowsToRecycle[rowNode.id] && rowNode.alreadyRendered) {
            rowCtrl = rowsToRecycle[rowNode.id];
            rowsToRecycle[rowNode.id] = null;
          }
        }
        const creatingNewRowCtrl = !rowCtrl;
        if (creatingNewRowCtrl) {
          if (!rowNode) {
            rowNode = this.rowModel.getRow(rowIndex);
          }
          if (_exists(rowNode)) {
            rowCtrl = this.createRowCon(rowNode, animate2, afterScroll);
          } else {
            return;
          }
        }
        if (rowNode) {
          rowNode.alreadyRendered = true;
        }
        this.rowCtrlsByRowIndex[rowIndex] = rowCtrl;
      }
      destroyRowCtrls(rowCtrlsMap, animate2) {
        const executeInAWhileFuncs = [];
        if (rowCtrlsMap) {
          for (const rowCtrl of Object.values(rowCtrlsMap)) {
            if (!rowCtrl) {
              continue;
            }
            if (this.cachedRowCtrls && rowCtrl.isCacheable()) {
              this.cachedRowCtrls.addRow(rowCtrl);
              continue;
            }
            rowCtrl.destroyFirstPass(!animate2);
            if (animate2) {
              const instanceId = rowCtrl.instanceId;
              this.zombieRowCtrls[instanceId] = rowCtrl;
              executeInAWhileFuncs.push(() => {
                rowCtrl.destroySecondPass();
                delete this.zombieRowCtrls[instanceId];
              });
            } else {
              rowCtrl.destroySecondPass();
            }
          }
        }
        if (animate2) {
          executeInAWhileFuncs.push(() => {
            if (this.isAlive()) {
              this.updateAllRowCtrls();
              this.dispatchDisplayedRowsChanged();
            }
          });
          window.setTimeout(() => {
            for (const func of executeInAWhileFuncs) {
              func();
            }
          }, ROW_ANIMATION_TIMEOUT);
        }
      }
      getRowBuffer() {
        return this.gos.get("rowBuffer");
      }
      getRowBufferInPixels() {
        const rowsToBuffer = this.getRowBuffer();
        const defaultRowHeight = _getRowHeightAsNumber(this.beans);
        return rowsToBuffer * defaultRowHeight;
      }
      workOutFirstAndLastRowsToRender() {
        const { rowContainerHeight, pageBounds, rowModel } = this;
        rowContainerHeight.updateOffset();
        let newFirst;
        let newLast;
        if (!rowModel.isRowsToRender()) {
          newFirst = 0;
          newLast = -1;
        } else if (this.printLayout) {
          this.beans.environment.refreshRowHeightVariable();
          newFirst = pageBounds.getFirstRow();
          newLast = pageBounds.getLastRow();
        } else {
          const bufferPixels = this.getRowBufferInPixels();
          const scrollFeature = this.ctrlsSvc.getScrollFeature();
          const suppressRowVirtualisation = this.gos.get("suppressRowVirtualisation");
          let rowHeightsChanged = false;
          let firstPixel;
          let lastPixel;
          do {
            const paginationOffset = pageBounds.getPixelOffset();
            const { pageFirstPixel, pageLastPixel } = pageBounds.getCurrentPagePixelRange();
            const divStretchOffset = rowContainerHeight.divStretchOffset;
            const bodyVRange = scrollFeature.getVScrollPosition();
            const bodyTopPixel = bodyVRange.top;
            const bodyBottomPixel = bodyVRange.bottom;
            if (suppressRowVirtualisation) {
              firstPixel = pageFirstPixel + divStretchOffset;
              lastPixel = pageLastPixel + divStretchOffset;
            } else {
              firstPixel = Math.max(bodyTopPixel + paginationOffset - bufferPixels, pageFirstPixel) + divStretchOffset;
              lastPixel = Math.min(bodyBottomPixel + paginationOffset + bufferPixels, pageLastPixel) + divStretchOffset;
            }
            this.firstVisibleVPixel = Math.max(bodyTopPixel + paginationOffset, pageFirstPixel) + divStretchOffset;
            this.lastVisibleVPixel = Math.min(bodyBottomPixel + paginationOffset, pageLastPixel) + divStretchOffset;
            rowHeightsChanged = this.ensureAllRowsInRangeHaveHeightsCalculated(firstPixel, lastPixel);
          } while (rowHeightsChanged);
          let firstRowIndex = rowModel.getRowIndexAtPixel(firstPixel);
          let lastRowIndex = rowModel.getRowIndexAtPixel(lastPixel);
          const pageFirstRow = pageBounds.getFirstRow();
          const pageLastRow = pageBounds.getLastRow();
          if (firstRowIndex < pageFirstRow) {
            firstRowIndex = pageFirstRow;
          }
          if (lastRowIndex > pageLastRow) {
            lastRowIndex = pageLastRow;
          }
          newFirst = firstRowIndex;
          newLast = lastRowIndex;
        }
        const rowLayoutNormal = _isDomLayout(this.gos, "normal");
        const suppressRowCountRestriction = this.gos.get("suppressMaxRenderedRowRestriction");
        const rowBufferMaxSize = Math.max(this.getRowBuffer(), 500);
        if (rowLayoutNormal && !suppressRowCountRestriction) {
          if (newLast - newFirst > rowBufferMaxSize) {
            newLast = newFirst + rowBufferMaxSize;
          }
        }
        const firstDiffers = newFirst !== this.firstRenderedRow;
        const lastDiffers = newLast !== this.lastRenderedRow;
        if (firstDiffers || lastDiffers) {
          this.firstRenderedRow = newFirst;
          this.lastRenderedRow = newLast;
          this.eventSvc.dispatchEvent({
            type: "viewportChanged",
            firstRow: newFirst,
            lastRow: newLast
          });
        }
      }
      /**
       * This event will only be fired once, and is queued until after the browser next renders.
       * This allows us to fire an event during the start of the render cycle, when we first see data being rendered
       * but not execute the event until all of the data has finished being rendered to the dom.
       */
      dispatchFirstDataRenderedEvent() {
        if (this.dataFirstRenderedFired) {
          return;
        }
        this.dataFirstRenderedFired = true;
        _requestAnimationFrame(this.beans, () => {
          this.beans.eventSvc.dispatchEvent({
            type: "firstDataRendered",
            firstRow: this.firstRenderedRow,
            lastRow: this.lastRenderedRow
          });
        });
      }
      ensureAllRowsInRangeHaveHeightsCalculated(topPixel, bottomPixel) {
        const pinnedRowHeightsChanged = this.pinnedRowModel?.ensureRowHeightsValid();
        const stickyHeightsChanged = this.stickyRowFeature?.ensureRowHeightsValid();
        const { pageBounds, rowModel } = this;
        const rowModelHeightsChanged = rowModel.ensureRowHeightsValid(
          topPixel,
          bottomPixel,
          pageBounds.getFirstRow(),
          pageBounds.getLastRow()
        );
        if (rowModelHeightsChanged || stickyHeightsChanged) {
          this.eventSvc.dispatchEvent({
            type: "recalculateRowBounds"
          });
        }
        if (stickyHeightsChanged || rowModelHeightsChanged || pinnedRowHeightsChanged) {
          this.updateContainerHeights();
          return true;
        }
        return false;
      }
      // check that none of the rows to remove are editing or focused as:
      // a) if editing, we want to keep them, otherwise the user will loose the context of the edit,
      //    eg user starts editing, enters some text, then scrolls down and then up, next time row rendered
      //    the edit is reset - so we want to keep it rendered.
      // b) if focused, we want ot keep keyboard focus, so if user ctrl+c, it goes to clipboard,
      //    otherwise the user can range select and drag (with focus cell going out of the viewport)
      //    and then ctrl+c, nothing will happen if cell is removed from dom.
      // c) if detail record of master detail, as users complained that the context of detail rows
      //    was getting lost when detail row out of view. eg user expands to show detail row,
      //    then manipulates the detail panel (eg sorts the detail grid), then context is lost
      //    after detail panel is scrolled out of / into view.
      doNotUnVirtualiseRow(rowCtrl) {
        const REMOVE_ROW = false;
        const KEEP_ROW = true;
        const rowNode = rowCtrl.rowNode;
        const rowHasFocus = this.focusSvc.isRowFocused(rowNode.rowIndex, rowNode.rowPinned);
        const rowIsEditing = this.editSvc?.isEditing(rowCtrl);
        const rowIsDetail = rowNode.detail;
        const mightWantToKeepRow = rowHasFocus || rowIsEditing || rowIsDetail;
        if (!mightWantToKeepRow) {
          return REMOVE_ROW;
        }
        const rowNodePresent = this.isRowPresent(rowNode);
        return rowNodePresent ? KEEP_ROW : REMOVE_ROW;
      }
      isRowPresent(rowNode) {
        if (!this.rowModel.isRowPresent(rowNode)) {
          return false;
        }
        return this.beans.pagination?.isRowInPage(rowNode.rowIndex) ?? true;
      }
      createRowCon(rowNode, animate2, afterScroll) {
        const rowCtrlFromCache = this.cachedRowCtrls?.getRow(rowNode) ?? null;
        if (rowCtrlFromCache) {
          return rowCtrlFromCache;
        }
        const useAnimationFrameForCreate = afterScroll && !this.printLayout && !!this.beans.animationFrameSvc?.active;
        const res = new RowCtrl(rowNode, this.beans, animate2, useAnimationFrameForCreate, this.printLayout);
        return res;
      }
      getRenderedNodes() {
        const viewportRows = Object.values(this.rowCtrlsByRowIndex).map((rowCtrl) => rowCtrl.rowNode);
        const stickyTopRows = this.getStickyTopRowCtrls().map((rowCtrl) => rowCtrl.rowNode);
        const stickyBottomRows = this.getStickyBottomRowCtrls().map((rowCtrl) => rowCtrl.rowNode);
        return [...stickyTopRows, ...viewportRows, ...stickyBottomRows];
      }
      getRowByPosition(rowPosition) {
        let rowCtrl;
        const { rowIndex } = rowPosition;
        switch (rowPosition.rowPinned) {
          case "top":
            rowCtrl = this.topRowCtrls[rowIndex];
            break;
          case "bottom":
            rowCtrl = this.bottomRowCtrls[rowIndex];
            break;
          default:
            rowCtrl = this.rowCtrlsByRowIndex[rowIndex];
            if (!rowCtrl) {
              rowCtrl = this.getStickyTopRowCtrls().find((ctrl) => ctrl.rowNode.rowIndex === rowIndex) || null;
              if (!rowCtrl) {
                rowCtrl = this.getStickyBottomRowCtrls().find((ctrl) => ctrl.rowNode.rowIndex === rowIndex) || null;
              }
            }
            break;
        }
        return rowCtrl;
      }
      // returns true if any row between startIndex and endIndex is rendered. used by
      // SSRM or IRM, as they don't want to purge visible blocks from cache.
      isRangeInRenderedViewport(startIndex, endIndex) {
        const parentClosed = startIndex == null || endIndex == null;
        if (parentClosed) {
          return false;
        }
        const blockAfterViewport = startIndex > this.lastRenderedRow;
        const blockBeforeViewport = endIndex < this.firstRenderedRow;
        const blockInsideViewport = !blockBeforeViewport && !blockAfterViewport;
        return blockInsideViewport;
      }
    };
    var RowCtrlCache = class {
      constructor(maxCount) {
        this.entriesMap = {};
        this.entriesList = [];
        this.maxCount = maxCount;
      }
      addRow(rowCtrl) {
        this.entriesMap[rowCtrl.rowNode.id] = rowCtrl;
        this.entriesList.push(rowCtrl);
        rowCtrl.setCached(true);
        if (this.entriesList.length > this.maxCount) {
          const rowCtrlToDestroy = this.entriesList[0];
          rowCtrlToDestroy.destroyFirstPass();
          rowCtrlToDestroy.destroySecondPass();
          this.removeFromCache(rowCtrlToDestroy);
        }
      }
      getRow(rowNode) {
        if (rowNode?.id == null) {
          return null;
        }
        const res = this.entriesMap[rowNode.id];
        if (!res) {
          return null;
        }
        this.removeFromCache(res);
        res.setCached(false);
        const rowNodeMismatch = res.rowNode != rowNode;
        return rowNodeMismatch ? null : res;
      }
      has(rowNode) {
        return this.entriesMap[rowNode.id] != null;
      }
      removeRow(rowNode) {
        const rowNodeId = rowNode.id;
        const ctrl = this.entriesMap[rowNodeId];
        delete this.entriesMap[rowNodeId];
        _removeFromArray(this.entriesList, ctrl);
      }
      removeFromCache(rowCtrl) {
        const rowNodeId = rowCtrl.rowNode.id;
        delete this.entriesMap[rowNodeId];
        _removeFromArray(this.entriesList, rowCtrl);
      }
      getEntries() {
        return this.entriesList;
      }
    };
    function mapRowNodes(rowNodes) {
      if (!rowNodes) {
        return;
      }
      const res = {
        top: {},
        bottom: {},
        normal: {}
      };
      for (const rowNode of rowNodes) {
        const id = rowNode.id;
        switch (rowNode.rowPinned) {
          case "top":
            res.top[id] = rowNode;
            break;
          case "bottom":
            res.bottom[id] = rowNode;
            break;
          default:
            res.normal[id] = rowNode;
            break;
        }
      }
      return res;
    }
    function isRowInMap(rowNode, rowIdsMap) {
      const id = rowNode.id;
      const floating = rowNode.rowPinned;
      switch (floating) {
        case "top":
          return rowIdsMap.top[id] != null;
        case "bottom":
          return rowIdsMap.bottom[id] != null;
        default:
          return rowIdsMap.normal[id] != null;
      }
    }
    var RowNodeSorter = class extends BeanStub {
      constructor() {
        super(...arguments);
        this.beanName = "rowNodeSorter";
      }
      postConstruct() {
        const { gos } = this;
        this.isAccentedSort = gos.get("accentedSort");
        this.primaryColumnsSortGroups = _isColumnsSortingCoupledToGroup(gos);
        this.addManagedPropertyListener(
          "accentedSort",
          (propChange) => this.isAccentedSort = propChange.currentValue
        );
        this.addManagedPropertyListener(
          "autoGroupColumnDef",
          () => this.primaryColumnsSortGroups = _isColumnsSortingCoupledToGroup(gos)
        );
      }
      doFullSort(rowNodes, sortOptions2) {
        const sortedRowNodes = rowNodes.map((rowNode, currentPos) => ({
          currentPos,
          rowNode
        }));
        sortedRowNodes.sort(this.compareRowNodes.bind(this, sortOptions2));
        return sortedRowNodes.map((item2) => item2.rowNode);
      }
      compareRowNodes(sortOptions2, sortedNodeA, sortedNodeB) {
        const nodeA = sortedNodeA.rowNode;
        const nodeB = sortedNodeB.rowNode;
        for (let i2 = 0, len = sortOptions2.length; i2 < len; i2++) {
          const sortOption = sortOptions2[i2];
          const isDescending = sortOption.sort === "desc";
          const valueA = this.getValue(nodeA, sortOption.column);
          const valueB = this.getValue(nodeB, sortOption.column);
          let comparatorResult;
          const providedComparator = this.getComparator(sortOption, nodeA);
          if (providedComparator) {
            comparatorResult = providedComparator(valueA, valueB, nodeA, nodeB, isDescending);
          } else {
            comparatorResult = _defaultComparator(valueA, valueB, this.isAccentedSort);
          }
          const validResult = !isNaN(comparatorResult);
          if (validResult && comparatorResult !== 0) {
            return sortOption.sort === "asc" ? comparatorResult : comparatorResult * -1;
          }
        }
        return sortedNodeA.currentPos - sortedNodeB.currentPos;
      }
      getComparator(sortOption, rowNode) {
        const column2 = sortOption.column;
        const comparatorOnCol = column2.getColDef().comparator;
        if (comparatorOnCol != null) {
          return comparatorOnCol;
        }
        if (!column2.getColDef().showRowGroup) {
          return;
        }
        const groupLeafField = !rowNode.group && column2.getColDef().field;
        if (!groupLeafField) {
          return;
        }
        const primaryColumn = this.beans.colModel.getColDefCol(groupLeafField);
        if (!primaryColumn) {
          return;
        }
        return primaryColumn.getColDef().comparator;
      }
      getValue(node2, column2) {
        const { valueSvc, colModel, showRowGroupCols, gos } = this.beans;
        if (!this.primaryColumnsSortGroups) {
          return valueSvc.getValue(column2, node2, false);
        }
        const isNodeGroupedAtLevel = node2.rowGroupColumn === column2;
        if (isNodeGroupedAtLevel) {
          const isGroupRows = _isGroupUseEntireRow(gos, colModel.isPivotActive());
          if (isGroupRows) {
            const leafChild = node2.data ? node2 : _firstLeaf(node2.childrenAfterGroup);
            return leafChild && valueSvc.getValue(column2, leafChild, false);
          }
          const displayCol = showRowGroupCols?.getShowRowGroupCol(column2.getId());
          if (!displayCol) {
            return void 0;
          }
          return node2.groupData?.[displayCol.getId()];
        }
        if (node2.group && column2.getColDef().showRowGroup) {
          return void 0;
        }
        return valueSvc.getValue(column2, node2, false);
      }
    };
    function onSortChanged(beans) {
      beans.sortSvc?.onSortChanged("api");
    }
    var SortModule = {
      moduleName: "Sort",
      version: VERSION,
      beans: [SortService, RowNodeSorter],
      apiFunctions: {
        onSortChanged
      },
      userComponents: {
        agSortIndicator: SortIndicatorComp
      },
      icons: {
        // show on column header when column is sorted ascending
        sortAscending: "asc",
        // show on column header when column is sorted descending
        sortDescending: "desc",
        // show on column header when column has no sort, only when enabled with gridOptions.unSortIcon=true
        sortUnSort: "none"
      }
    };
    var SyncService = class extends BeanStub {
      constructor() {
        super(...arguments);
        this.beanName = "syncSvc";
        this.waitingForColumns = false;
      }
      postConstruct() {
        this.addManagedPropertyListener("columnDefs", (event) => this.setColumnDefs(event));
      }
      start() {
        this.beans.ctrlsSvc.whenReady(this, () => {
          const columnDefs = this.gos.get("columnDefs");
          if (columnDefs) {
            this.setColumnsAndData(columnDefs);
          } else {
            this.waitingForColumns = true;
          }
          this.gridReady();
        });
      }
      setColumnsAndData(columnDefs) {
        const { colModel, rowModel } = this.beans;
        colModel.setColumnDefs(columnDefs ?? [], "gridInitializing");
        rowModel.start();
      }
      gridReady() {
        const { eventSvc, gos } = this;
        eventSvc.dispatchEvent({
          type: "gridReady"
        });
        _logIfDebug(gos, `initialised successfully, enterprise = ${gos.isModuleRegistered("EnterpriseCore")}`);
      }
      setColumnDefs(event) {
        const columnDefs = this.gos.get("columnDefs");
        if (!columnDefs) {
          return;
        }
        if (this.waitingForColumns) {
          this.waitingForColumns = false;
          this.setColumnsAndData(columnDefs);
          return;
        }
        this.beans.colModel.setColumnDefs(columnDefs, _convertColumnEventSourceType(event.source));
      }
    };
    function expireValueCache(beans) {
      beans.valueCache?.expire();
    }
    function getCellValue(beans, params) {
      const { colKey, rowNode, useFormatter } = params;
      const column2 = beans.colModel.getColDefCol(colKey) ?? beans.colModel.getCol(colKey);
      if (_missing(column2)) {
        return null;
      }
      const result2 = beans.valueSvc.getValueForDisplay(column2, rowNode, useFormatter);
      if (useFormatter) {
        return result2.valueFormatted ?? _toString(result2.value);
      }
      return result2.value;
    }
    var SOURCE_PASTE = "paste";
    var ChangeDetectionService = class extends BeanStub {
      constructor() {
        super(...arguments);
        this.beanName = "changeDetectionSvc";
        this.clientSideRowModel = null;
      }
      postConstruct() {
        const { gos, rowModel } = this.beans;
        if (_isClientSideRowModel(gos)) {
          this.clientSideRowModel = rowModel;
        }
        this.addManagedEventListeners({ cellValueChanged: this.onCellValueChanged.bind(this) });
      }
      onCellValueChanged(event) {
        const { gos, rowRenderer } = this.beans;
        if (event.source === SOURCE_PASTE || gos.get("suppressChangeDetection")) {
          return;
        }
        const rowNode = event.node;
        const nodesToRefresh = [rowNode];
        const clientSideRowModel = this.clientSideRowModel;
        const rootNode = clientSideRowModel?.rootNode;
        if (rootNode && !rowNode.isRowPinned()) {
          const onlyChangedColumns = gos.get("aggregateOnlyChangedColumns");
          const changedPath = new ChangedPath(onlyChangedColumns, rootNode);
          changedPath.addParentNode(rowNode.parent, [event.column]);
          clientSideRowModel.doAggregate(changedPath);
          changedPath.forEachChangedNodeDepthFirst((rowNode2) => {
            nodesToRefresh.push(rowNode2);
            if (rowNode2.sibling) {
              nodesToRefresh.push(rowNode2.sibling);
            }
          });
        }
        rowRenderer.refreshCells({ rowNodes: nodesToRefresh });
      }
    };
    var ExpressionService = class extends BeanStub {
      constructor() {
        super(...arguments);
        this.beanName = "expressionSvc";
        this.cache = {};
      }
      evaluate(expression, params) {
        if (typeof expression === "string") {
          return this.evaluateExpression(expression, params);
        } else {
          _error(15, { expression });
        }
      }
      evaluateExpression(expression, params) {
        try {
          const javaScriptFunction = this.createExpressionFunction(expression);
          const result2 = javaScriptFunction(
            params.value,
            params.context,
            params.oldValue,
            params.newValue,
            params.value,
            params.node,
            params.data,
            params.colDef,
            params.rowIndex,
            params.api,
            params.getValue,
            params.column,
            params.columnGroup
          );
          return result2;
        } catch (e) {
          _error(16, { expression, params, e });
          return null;
        }
      }
      createExpressionFunction(expression) {
        const expressionToFunctionCache = this.cache;
        if (expressionToFunctionCache[expression]) {
          return expressionToFunctionCache[expression];
        }
        const functionBody = this.createFunctionBody(expression);
        const theFunction = new Function(
          "x, ctx, oldValue, newValue, value, node, data, colDef, rowIndex, api, getValue, column, columnGroup",
          functionBody
        );
        expressionToFunctionCache[expression] = theFunction;
        return theFunction;
      }
      createFunctionBody(expression) {
        if (expression.includes("return")) {
          return expression;
        } else {
          return "return " + expression + ";";
        }
      }
    };
    var ValueCache = class extends BeanStub {
      constructor() {
        super(...arguments);
        this.beanName = "valueCache";
        this.cacheVersion = 0;
      }
      postConstruct() {
        const gos = this.gos;
        this.active = gos.get("valueCache");
        this.neverExpires = gos.get("valueCacheNeverExpires");
      }
      onDataChanged() {
        if (this.neverExpires) {
          return;
        }
        this.expire();
      }
      expire() {
        this.cacheVersion++;
      }
      setValue(rowNode, colId, value2) {
        if (this.active) {
          const cacheVersion = this.cacheVersion;
          if (rowNode.__cacheVersion !== cacheVersion) {
            rowNode.__cacheVersion = cacheVersion;
            rowNode.__cacheData = {};
          }
          rowNode.__cacheData[colId] = value2;
        }
      }
      getValue(rowNode, colId) {
        if (!this.active || rowNode.__cacheVersion !== this.cacheVersion) {
          return void 0;
        }
        return rowNode.__cacheData[colId];
      }
    };
    var ValueCacheModule = {
      moduleName: "ValueCache",
      version: VERSION,
      beans: [ValueCache],
      apiFunctions: {
        expireValueCache
      }
    };
    var ExpressionModule = {
      moduleName: "Expression",
      version: VERSION,
      beans: [ExpressionService]
    };
    var ChangeDetectionModule = {
      moduleName: "ChangeDetection",
      version: VERSION,
      beans: [ChangeDetectionService]
    };
    var CellApiModule = {
      moduleName: "CellApi",
      version: VERSION,
      apiFunctions: {
        getCellValue
      }
    };
    var ValueService = class extends BeanStub {
      constructor() {
        super(...arguments);
        this.beanName = "valueSvc";
        this.hasEditSvc = false;
        this.initialised = false;
        this.isSsrm = false;
      }
      wireBeans(beans) {
        this.expressionSvc = beans.expressionSvc;
        this.colModel = beans.colModel;
        this.valueCache = beans.valueCache;
        this.dataTypeSvc = beans.dataTypeSvc;
        this.editSvc = beans.editSvc;
        this.hasEditSvc = !!beans.editSvc;
      }
      postConstruct() {
        if (!this.initialised) {
          this.init();
        }
      }
      init() {
        this.executeValueGetter = this.valueCache ? this.executeValueGetterWithValueCache.bind(this) : this.executeValueGetterWithoutValueCache.bind(this);
        this.isSsrm = _isServerSideRowModel(this.gos);
        this.cellExpressions = this.gos.get("enableCellExpressions");
        this.isTreeData = this.gos.get("treeData");
        this.initialised = true;
        const listener = (event) => this.callColumnCellValueChangedHandler(event);
        this.eventSvc.addListener("cellValueChanged", listener, true);
        this.addDestroyFunc(() => this.eventSvc.removeListener("cellValueChanged", listener, true));
        this.addManagedPropertyListener("treeData", (propChange) => this.isTreeData = propChange.currentValue);
      }
      /**
       * Use this function to get a displayable cell value.
       * The values from this function are not used for sorting, filtering, or aggregation purposes.
       * Handles: groupHideOpenParents, showOpenedGroup and groupSuppressBlankHeader behaviours
       */
      getValueForDisplay(column2, node2, includeValueFormatted = false, exporting = false, source2 = "ui") {
        const { showRowGroupColValueSvc } = this.beans;
        const isFullWidthGroup = !column2 && node2.group;
        const isGroupCol = column2?.colDef.showRowGroup;
        const processTreeDataAsGroup = !this.isTreeData || node2.footer;
        if (showRowGroupColValueSvc && processTreeDataAsGroup && (isFullWidthGroup || isGroupCol)) {
          const groupValue = showRowGroupColValueSvc.getGroupValue(node2, column2);
          if (groupValue == null) {
            return {
              value: null,
              valueFormatted: null
            };
          }
          if (!includeValueFormatted) {
            return {
              value: groupValue.value,
              valueFormatted: null
            };
          }
          const valueFormatted = showRowGroupColValueSvc.formatAndPrefixGroupColValue(groupValue, column2, exporting);
          return {
            value: groupValue.value,
            valueFormatted
          };
        }
        if (!column2) {
          return {
            value: node2.key,
            valueFormatted: null
          };
        }
        const isPivotLeaf = node2.leafGroup && this.colModel.isPivotMode();
        const isOpenedGroup = node2.group && node2.expanded && !node2.footer && !isPivotLeaf;
        const groupShowsAggData = this.gos.get("groupSuppressBlankHeader") || !node2.sibling;
        const ignoreAggData = isOpenedGroup && !groupShowsAggData;
        const value2 = this.getValue(column2, node2, ignoreAggData, source2);
        const format2 = includeValueFormatted && !(exporting && column2.colDef.useValueFormatterForExport === false);
        return {
          value: value2,
          valueFormatted: format2 ? this.formatValue(column2, node2, value2) : null
        };
      }
      getValue(column2, rowNode, ignoreAggData = false, source2 = "ui") {
        if (!this.initialised) {
          this.init();
        }
        if (!rowNode) {
          return;
        }
        const colDef = column2.getColDef();
        const field = colDef.field;
        const colId = column2.getColId();
        const data = rowNode.data;
        if (this.hasEditSvc && source2 === "ui") {
          const editSvc = this.editSvc;
          if (editSvc.isEditing()) {
            const newValue = editSvc.getCellDataValue({ rowNode, column: column2 }, true);
            if (newValue !== void 0) {
              return newValue;
            }
          }
        }
        let result2;
        const rowGroupColId = colDef.showRowGroup;
        if (typeof rowGroupColId === "string") {
          const colRowGroupIndex = this.beans.rowGroupColsSvc?.getColumnIndex(rowGroupColId) ?? -1;
          if (colRowGroupIndex > rowNode.level) {
            return null;
          }
        }
        const allowUserValuesForCell = typeof rowGroupColId !== "string" || !rowNode.group;
        const groupDataExists = rowNode.groupData && colId in rowNode.groupData;
        const aggDataExists = !ignoreAggData && rowNode.aggData && rowNode.aggData[colId] !== void 0;
        const ignoreSsrmAggData = this.isSsrm && ignoreAggData && !!colDef.aggFunc;
        const ssrmFooterGroupCol = this.isSsrm && rowNode.footer && rowNode.field && (colDef.showRowGroup === true || colDef.showRowGroup === rowNode.field);
        if (this.isTreeData && aggDataExists) {
          result2 = rowNode.aggData[colId];
        } else if (this.isTreeData && colDef.valueGetter) {
          result2 = this.executeValueGetter(colDef.valueGetter, data, column2, rowNode);
        } else if (this.isTreeData && field && data) {
          result2 = _getValueUsingField(data, field, column2.isFieldContainsDots());
        } else if (groupDataExists) {
          result2 = rowNode.groupData[colId];
        } else if (aggDataExists) {
          result2 = rowNode.aggData[colId];
        } else if (colDef.valueGetter && !ignoreSsrmAggData) {
          if (!allowUserValuesForCell) {
            return result2;
          }
          result2 = this.executeValueGetter(colDef.valueGetter, data, column2, rowNode);
        } else if (ssrmFooterGroupCol) {
          result2 = _getValueUsingField(data, rowNode.field, column2.isFieldContainsDots());
        } else if (field && data && !ignoreSsrmAggData) {
          if (!allowUserValuesForCell) {
            return result2;
          }
          result2 = _getValueUsingField(data, field, column2.isFieldContainsDots());
        }
        if (this.cellExpressions && typeof result2 === "string" && result2.indexOf("=") === 0) {
          const cellValueGetter = result2.substring(1);
          result2 = this.executeValueGetter(cellValueGetter, data, column2, rowNode);
        }
        return result2;
      }
      parseValue(column2, rowNode, newValue, oldValue) {
        const colDef = column2.getColDef();
        const valueParser = colDef.valueParser;
        if (_exists(valueParser)) {
          const params = _addGridCommonParams(this.gos, {
            node: rowNode,
            data: rowNode?.data,
            oldValue,
            newValue,
            colDef,
            column: column2
          });
          if (typeof valueParser === "function") {
            return valueParser(params);
          }
          return this.expressionSvc?.evaluate(valueParser, params);
        }
        return newValue;
      }
      getDeleteValue(column2, rowNode) {
        if (_exists(column2.getColDef().valueParser)) {
          return this.parseValue(column2, rowNode, "", this.getValueForDisplay(column2, rowNode).value) ?? null;
        }
        return null;
      }
      formatValue(column2, node2, value2, suppliedFormatter, useFormatterFromColumn = true) {
        const { expressionSvc } = this.beans;
        let result2 = null;
        let formatter;
        const colDef = column2.getColDef();
        if (suppliedFormatter) {
          formatter = suppliedFormatter;
        } else if (useFormatterFromColumn) {
          formatter = colDef.valueFormatter;
        }
        if (formatter) {
          const data = node2 ? node2.data : null;
          const params = _addGridCommonParams(this.gos, {
            value: value2,
            node: node2,
            data,
            colDef,
            column: column2
          });
          if (typeof formatter === "function") {
            result2 = formatter(params);
          } else {
            result2 = expressionSvc ? expressionSvc.evaluate(formatter, params) : null;
          }
        } else if (colDef.refData) {
          return colDef.refData[value2] || "";
        }
        if (result2 == null && Array.isArray(value2)) {
          result2 = value2.join(", ");
        }
        return result2;
      }
      /**
       * Sets the value of a GridCell
       * @param rowNode The `RowNode` to be updated
       * @param colKey The `Column` to be updated
       * @param newValue The new value to be set
       * @param eventSource The event source
       * @returns `True` if the value has been updated, otherwise`False`.
       */
      setValue(rowNode, colKey, newValue, eventSource) {
        const column2 = this.colModel.getColDefCol(colKey);
        if (!rowNode || !column2) {
          return false;
        }
        if (_missing(rowNode.data)) {
          rowNode.data = {};
        }
        const { field, valueSetter } = column2.getColDef();
        if (_missing(field) && _missing(valueSetter)) {
          _warn(17);
          return false;
        }
        if (this.dataTypeSvc && !this.dataTypeSvc.checkType(column2, newValue)) {
          _warn(135);
          return false;
        }
        const params = _addGridCommonParams(this.gos, {
          node: rowNode,
          data: rowNode.data,
          oldValue: this.getValue(column2, rowNode, void 0, eventSource),
          newValue,
          colDef: column2.getColDef(),
          column: column2
        });
        params.newValue = newValue;
        let valueWasDifferent;
        if (_exists(valueSetter)) {
          if (typeof valueSetter === "function") {
            valueWasDifferent = valueSetter(params);
          } else {
            valueWasDifferent = this.expressionSvc?.evaluate(valueSetter, params);
          }
        } else {
          valueWasDifferent = this.setValueUsingField(rowNode.data, field, newValue, column2.isFieldContainsDots());
        }
        if (valueWasDifferent === void 0) {
          valueWasDifferent = true;
        }
        if (!valueWasDifferent) {
          return false;
        }
        rowNode.resetQuickFilterAggregateText();
        this.valueCache?.onDataChanged();
        const savedValue = this.getValue(column2, rowNode);
        this.dispatchCellValueChangedEvent(rowNode, params, savedValue, eventSource);
        if (rowNode.pinnedSibling) {
          this.dispatchCellValueChangedEvent(rowNode.pinnedSibling, params, savedValue, eventSource);
        }
        return true;
      }
      dispatchCellValueChangedEvent(rowNode, params, value2, source2) {
        this.eventSvc.dispatchEvent({
          type: "cellValueChanged",
          event: null,
          rowIndex: rowNode.rowIndex,
          rowPinned: rowNode.rowPinned,
          column: params.column,
          colDef: params.colDef,
          data: rowNode.data,
          node: rowNode,
          oldValue: params.oldValue,
          newValue: value2,
          value: value2,
          source: source2
        });
      }
      callColumnCellValueChangedHandler(event) {
        const onCellValueChanged = event.colDef.onCellValueChanged;
        if (typeof onCellValueChanged === "function") {
          this.beans.frameworkOverrides.wrapOutgoing(() => {
            onCellValueChanged({
              node: event.node,
              data: event.data,
              oldValue: event.oldValue,
              newValue: event.newValue,
              colDef: event.colDef,
              column: event.column,
              api: event.api,
              context: event.context
            });
          });
        }
      }
      setValueUsingField(data, field, newValue, isFieldContainsDots) {
        if (!field) {
          return false;
        }
        let valuesAreSame = false;
        if (!isFieldContainsDots) {
          valuesAreSame = data[field] === newValue;
          if (!valuesAreSame) {
            data[field] = newValue;
          }
        } else {
          const fieldPieces = field.split(".");
          let currentObject = data;
          while (fieldPieces.length > 0 && currentObject) {
            const fieldPiece = fieldPieces.shift();
            if (fieldPieces.length === 0) {
              valuesAreSame = currentObject[fieldPiece] === newValue;
              if (!valuesAreSame) {
                currentObject[fieldPiece] = newValue;
              }
            } else {
              currentObject = currentObject[fieldPiece];
            }
          }
        }
        return !valuesAreSame;
      }
      executeValueGetterWithValueCache(valueGetter, data, column2, rowNode) {
        const colId = column2.getColId();
        const valueFromCache = this.valueCache.getValue(rowNode, colId);
        if (valueFromCache !== void 0) {
          return valueFromCache;
        }
        const result2 = this.executeValueGetterWithoutValueCache(valueGetter, data, column2, rowNode);
        this.valueCache.setValue(rowNode, colId, result2);
        return result2;
      }
      executeValueGetterWithoutValueCache(valueGetter, data, column2, rowNode) {
        const params = _addGridCommonParams(this.gos, {
          data,
          node: rowNode,
          column: column2,
          colDef: column2.getColDef(),
          getValue: this.getValueCallback.bind(this, rowNode)
        });
        let result2;
        if (typeof valueGetter === "function") {
          result2 = valueGetter(params);
        } else {
          result2 = this.expressionSvc?.evaluate(valueGetter, params);
        }
        return result2;
      }
      getValueCallback(node2, field) {
        const otherColumn = this.colModel.getColDefCol(field);
        if (otherColumn) {
          return this.getValue(otherColumn, node2);
        }
        return null;
      }
      // used by row grouping and pivot, to get key for a row. col can be a pivot col or a row grouping col
      getKeyForNode(col, rowNode) {
        const value2 = this.getValue(col, rowNode);
        const keyCreator = col.getColDef().keyCreator;
        let result2 = value2;
        if (keyCreator) {
          const keyParams = _addGridCommonParams(this.gos, {
            value: value2,
            colDef: col.getColDef(),
            column: col,
            node: rowNode,
            data: rowNode.data
          });
          result2 = keyCreator(keyParams);
        }
        if (typeof result2 === "string" || result2 == null) {
          return result2;
        }
        result2 = String(result2);
        if (result2 === "[object Object]") {
          _warn(121);
        }
        return result2;
      }
    };
    var CommunityCoreModule = {
      moduleName: "CommunityCore",
      version: VERSION,
      beans: [
        GridDestroyService,
        ApiFunctionService,
        Registry,
        UserComponentFactory,
        RowContainerHeightService,
        VisibleColsService,
        EventService,
        GridOptionsService,
        ColumnModel,
        PageBoundsService,
        PageBoundsListener,
        RowRenderer,
        ValueService,
        FocusService,
        Environment,
        ScrollVisibleService,
        CtrlsService,
        SyncService,
        ColumnNameService,
        ColumnViewportService,
        IconService
      ],
      icons: {
        // icon on select dropdowns (select cell editor, charts tool panels)
        selectOpen: "small-down",
        /** @deprecated v33 */
        smallDown: "small-down",
        /** @deprecated v33 */
        colorPicker: "color-picker",
        /** @deprecated v33 */
        smallUp: "small-up",
        /** @deprecated v33 */
        checkboxChecked: "small-up",
        /** @deprecated v33 */
        checkboxIndeterminate: "checkbox-indeterminate",
        /** @deprecated v33 */
        checkboxUnchecked: "checkbox-unchecked",
        /** @deprecated v33 */
        radioButtonOn: "radio-button-on",
        /** @deprecated v33 */
        radioButtonOff: "radio-button-off",
        /** @deprecated v33 */
        smallLeft: "small-left",
        /** @deprecated v33 */
        smallRight: "small-right"
      },
      apiFunctions: {
        getGridId,
        destroy,
        isDestroyed,
        getGridOption,
        setGridOption,
        updateGridOptions,
        isModuleRegistered
      },
      dependsOn: [
        DataTypeModule,
        ColumnMoveModule,
        ColumnResizeModule,
        SortModule,
        ColumnHeaderCompModule,
        ColumnGroupModule,
        ColumnGroupHeaderCompModule,
        OverlayModule,
        ChangeDetectionModule,
        AnimationFrameModule,
        KeyboardNavigationModule,
        PinnedColumnModule,
        AriaModule,
        TouchModule,
        CellRendererFunctionModule,
        ColumnFlexModule,
        ExpressionModule,
        SkeletonCellRendererModule,
        ColumnDelayRenderModule
      ]
    };
    var ENTERPRISE_MODULE_NAMES = {
      AdvancedFilter: 1,
      AiToolkit: 1,
      AllEnterprise: 1,
      BatchEdit: 1,
      CellSelection: 1,
      Clipboard: 1,
      ColumnMenu: 1,
      ColumnsToolPanel: 1,
      ContextMenu: 1,
      ExcelExport: 1,
      FiltersToolPanel: 1,
      Find: 1,
      GridCharts: 1,
      IntegratedCharts: 1,
      GroupFilter: 1,
      MasterDetail: 1,
      Menu: 1,
      MultiFilter: 1,
      NewFiltersToolPanel: 1,
      Pivot: 1,
      RangeSelection: 1,
      RichSelect: 1,
      RowNumbers: 1,
      RowGrouping: 1,
      RowGroupingPanel: 1,
      ServerSideRowModelApi: 1,
      ServerSideRowModel: 1,
      SetFilter: 1,
      SideBar: 1,
      Sparklines: 1,
      StatusBar: 1,
      TreeData: 1,
      ViewportRowModel: 1
    };
    var ALL_COLUMN_FILTERS = [
      "TextFilter",
      "NumberFilter",
      "DateFilter",
      "SetFilter",
      "MultiFilter",
      "GroupFilter",
      "CustomFilter"
    ];
    var RESOLVABLE_MODULE_NAMES = {
      EditCore: [
        "TextEditor",
        "NumberEditor",
        "DateEditor",
        "CheckboxEditor",
        "LargeTextEditor",
        "SelectEditor",
        "RichSelect",
        "CustomEditor"
      ],
      CheckboxCellRenderer: ["AllCommunity"],
      ClientSideRowModelHierarchy: ["RowGrouping", "Pivot", "TreeData"],
      ColumnFilter: ALL_COLUMN_FILTERS,
      ColumnGroupHeaderComp: ["AllCommunity"],
      ColumnGroup: ["AllCommunity"],
      ColumnHeaderComp: ["AllCommunity"],
      ColumnMove: ["AllCommunity"],
      ColumnResize: ["AllCommunity"],
      CommunityCore: ["AllCommunity"],
      CsrmSsrmSharedApi: ["ClientSideRowModelApi", "ServerSideRowModelApi"],
      RowModelSharedApi: ["ClientSideRowModelApi", "ServerSideRowModelApi"],
      EnterpriseCore: ["AllEnterprise"],
      FilterCore: [...ALL_COLUMN_FILTERS, "QuickFilter", "ExternalFilter", "AdvancedFilter"],
      GroupCellRenderer: ["RowGrouping", "Pivot", "TreeData", "MasterDetail", "ServerSideRowModel"],
      KeyboardNavigation: ["AllCommunity"],
      LoadingCellRenderer: ["ServerSideRowModel"],
      MenuCore: ["ColumnMenu", "ContextMenu"],
      MenuItem: ["ColumnMenu", "ContextMenu", "MultiFilter", "IntegratedCharts", "ColumnsToolPanel"],
      Overlay: ["AllCommunity"],
      PinnedColumn: ["AllCommunity"],
      SharedAggregation: ["RowGrouping", "Pivot", "TreeData", "ServerSideRowModel"],
      SharedDragAndDrop: ["AllCommunity"],
      SharedMasterDetail: ["MasterDetail", "ServerSideRowModel"],
      SharedMenu: [...ALL_COLUMN_FILTERS, "ColumnMenu", "ContextMenu"],
      SharedPivot: ["Pivot", "ServerSideRowModel"],
      SharedRowGrouping: ["RowGrouping", "ServerSideRowModel"],
      SharedRowSelection: ["RowSelection", "ServerSideRowModel"],
      SkeletonCellRenderer: ["ServerSideRowModel"],
      Sort: ["AllCommunity"],
      SsrmInfiniteSharedApi: ["InfiniteRowModel", "ServerSideRowModelApi"],
      SharedTreeData: ["TreeData", "ServerSideRowModel"]
    };
    var MODULES_FOR_ROW_MODELS = {
      InfiniteRowModel: "infinite",
      ClientSideRowModelApi: "clientSide",
      ClientSideRowModel: "clientSide",
      ServerSideRowModelApi: "serverSide",
      ServerSideRowModel: "serverSide",
      ViewportRowModel: "viewport"
    };
    function resolveModuleNames(moduleName, rowModelType) {
      const resolvedModuleNames = [];
      for (const modName of Array.isArray(moduleName) ? moduleName : [moduleName]) {
        const resolved = RESOLVABLE_MODULE_NAMES[modName];
        if (resolved) {
          for (const resolvedModName of resolved) {
            const rowModelForModule = MODULES_FOR_ROW_MODELS[resolvedModName];
            if (!rowModelForModule || rowModelForModule === rowModelType) {
              resolvedModuleNames.push(resolvedModName);
            }
          }
        } else {
          resolvedModuleNames.push(modName);
        }
      }
      return resolvedModuleNames;
    }
    var NoModulesRegisteredError = () => `No AG Grid modules are registered! It is recommended to start with all Community features via the AllCommunityModule:
                    
    import { ModuleRegistry, AllCommunityModule } from 'ag-grid-community';
    
    ModuleRegistry.registerModules([ AllCommunityModule ]);
    `;
    var moduleImportMsg = (moduleNames) => {
      const imports = moduleNames.map(
        (moduleName) => `import { ${convertToUserModuleName(moduleName)} } from '${ENTERPRISE_MODULE_NAMES[moduleName] ? "ag-grid-enterprise" : "ag-grid-community"}';`
      );
      const includeCharts = moduleNames.some((m) => m === "IntegratedCharts" || m === "Sparklines");
      if (includeCharts) {
        const chartImport = `import { AgChartsEnterpriseModule } from 'ag-charts-enterprise';`;
        imports.push(chartImport);
      }
      return `import { ModuleRegistry } from 'ag-grid-community'; 
${imports.join(" \n")} 

ModuleRegistry.registerModules([ ${moduleNames.map((m) => convertToUserModuleName(m, true)).join(", ")} ]); 

For more info see: ${baseDocLink}/modules/`;
    };
    function convertToUserModuleName(moduleName, inModuleRegistration = false) {
      if (inModuleRegistration && (moduleName === "IntegratedCharts" || moduleName === "Sparklines")) {
        return `${moduleName}Module.with(AgChartsEnterpriseModule)`;
      }
      return `${moduleName}Module`;
    }
    function umdMissingModule(reasonOrId, moduleNames) {
      const chartModules = moduleNames.filter((m) => m === "IntegratedCharts" || m === "Sparklines");
      let message2 = "";
      const agChartsDynamic = globalThis?.agCharts;
      if (!agChartsDynamic && chartModules.length > 0) {
        message2 = `Unable to use ${reasonOrId} as either the ag-charts-community or ag-charts-enterprise script needs to be included alongside ag-grid-enterprise.
`;
      } else if (moduleNames.some((m) => ENTERPRISE_MODULE_NAMES[m])) {
        message2 = message2 + `Unable to use ${reasonOrId} as that requires the ag-grid-enterprise script to be included.
`;
      }
      return message2;
    }
    function missingRowModelTypeError({
      moduleName,
      rowModelType
    }) {
      return `To use the ${moduleName}Module you must set the gridOption "rowModelType='${rowModelType}'"`;
    }
    var missingModule = ({
      reasonOrId,
      moduleName,
      gridScoped,
      gridId,
      rowModelType,
      additionalText,
      isUmd: isUmd2
    }) => {
      const resolvedModuleNames = resolveModuleNames(moduleName, rowModelType);
      const reason = typeof reasonOrId === "string" ? reasonOrId : MISSING_MODULE_REASONS[reasonOrId];
      if (isUmd2) {
        return umdMissingModule(reason, resolvedModuleNames);
      }
      const chartModules = resolvedModuleNames.filter((m) => m === "IntegratedCharts" || m === "Sparklines");
      const chartImportRequired = chartModules.length > 0 ? `${chartModules.map((m) => convertToUserModuleName(m)).join()} must be initialised with an AG Charts module. One of 'AgChartsCommunityModule' / 'AgChartsEnterpriseModule'.` : "";
      const explanation2 = `Unable to use ${reason} as ${resolvedModuleNames.length > 1 ? "one of " + resolvedModuleNames.map((m) => convertToUserModuleName(m)).join(", ") : convertToUserModuleName(resolvedModuleNames[0])} is not registered${gridScoped ? " for gridId: " + gridId : ""}. ${chartImportRequired} Check if you have registered the module:
`;
      return `${explanation2}
${moduleImportMsg(resolvedModuleNames)}` + (additionalText ? ` 

${additionalText}` : "");
    };
    var missingChartsWithModule = (gridModule) => {
      return `${gridModule} must be initialised with an AG Charts module. One of 'AgChartsCommunityModule' / 'AgChartsEnterpriseModule'.

import { AgChartsEnterpriseModule } from 'ag-charts-enterprise';
import { ModuleRegistry } from 'ag-grid-community';
import { ${gridModule} } from 'ag-grid-enterprise';
    
ModuleRegistry.registerModules([${gridModule}.with(AgChartsEnterpriseModule)]);
    `;
    };
    var clipboardApiError = (method) => `AG Grid: Unable to use the Clipboard API (navigator.clipboard.${method}()). The reason why it could not be used has been logged in the previous line. For this reason the grid has defaulted to using a workaround which doesn't perform as well. Either fix why Clipboard API is blocked, OR stop this message from appearing by setting grid property suppressClipboardApi=true (which will default the grid to using the workaround rather than the API.`;
    var AG_GRID_ERRORS = {
      1: () => "`rowData` must be an array",
      2: ({ nodeId }) => `Duplicate node id '${nodeId}' detected from getRowId callback, this could cause issues in your grid.`,
      3: () => "Calling gridApi.resetRowHeights() makes no sense when using Auto Row Height.",
      4: ({ id }) => `Could not find row id=${id}, data item was not found for this id`,
      5: ({ data }) => [
        `Could not find data item as object was not found.`,
        data,
        " Consider using getRowId to help the Grid find matching row data"
      ],
      6: () => `'groupHideOpenParents' only works when specifying specific columns for 'colDef.showRowGroup'`,
      7: () => "Pivoting is not supported with aligned grids as it may produce different columns in each grid.",
      8: ({ key: key2 }) => `Unknown key for navigation ${key2}`,
      9: ({ variable }) => `No value for ${variable?.cssName}. This usually means that the grid has been initialised before styles have been loaded. The default value of ${variable?.defaultValue} will be used and updated when styles load.`,
      10: ({ eventType }) => `As of v33, the '${eventType}' event is deprecated. Use the global 'modelUpdated' event to determine when row children have changed.`,
      11: () => "No gridOptions provided to createGrid",
      12: ({ colKey }) => ["column ", colKey, " not found"],
      13: () => "Could not find rowIndex, this means tasks are being executed on a rowNode that has been removed from the grid.",
      14: ({ groupPrefix }) => `Row IDs cannot start with ${groupPrefix}, this is a reserved prefix for AG Grid's row grouping feature.`,
      15: ({ expression }) => ["value should be either a string or a function", expression],
      16: ({ expression, params, e }) => [
        "Processing of the expression failed",
        "Expression = ",
        expression,
        "Params = ",
        params,
        "Exception = ",
        e
      ],
      17: () => "you need either field or valueSetter set on colDef for editing to work",
      18: () => `alignedGrids contains an undefined option.`,
      19: () => `alignedGrids - No api found on the linked grid.`,
      20: () => `You may want to configure via a callback to avoid setup race conditions:
                     "alignedGrids: () => [linkedGrid]"`,
      21: () => "pivoting is not supported with aligned grids. You can only use one of these features at a time in a grid.",
      22: ({ key: key2 }) => `${key2} is an initial property and cannot be updated.`,
      23: () => "The return of `getRowHeight` cannot be zero. If the intention is to hide rows, use a filter instead.",
      24: () => "row height must be a number if not using standard row model",
      25: ({ id }) => [`The getRowId callback must return a string. The ID `, id, ` is being cast to a string.`],
      26: ({ fnName, preDestroyLink }) => {
        return `Grid API function ${fnName}() cannot be called as the grid has been destroyed.
 Either clear local references to the grid api, when it is destroyed, or check gridApi.isDestroyed() to avoid calling methods against a destroyed grid.
 To run logic when the grid is about to be destroyed use the gridPreDestroy event. See: ${preDestroyLink}`;
      },
      27: ({ fnName, module: module2 }) => `API function '${fnName}' not registered to module '${module2}'`,
      28: () => "setRowCount cannot be used while using row grouping.",
      29: () => "tried to call sizeColumnsToFit() but the grid is coming back with zero width, maybe the grid is not visible yet on the screen?",
      30: ({ toIndex }) => [
        "tried to insert columns in invalid location, toIndex = ",
        toIndex,
        "remember that you should not count the moving columns when calculating the new index"
      ],
      31: () => "infinite loop in resizeColumnSets",
      32: () => "applyColumnState() - the state attribute should be an array, however an array was not found. Please provide an array of items (one for each col you want to change) for state.",
      33: () => "stateItem.aggFunc must be a string. if using your own aggregation functions, register the functions first before using them in get/set state. This is because it is intended for the column state to be stored and retrieved as simple JSON.",
      34: ({ key: key2 }) => `the column type '${key2}' is a default column type and cannot be overridden.`,
      35: () => `Column type definitions 'columnTypes' with a 'type' attribute are not supported because a column type cannot refer to another column type. Only column definitions 'columnDefs' can use the 'type' attribute to refer to a column type.`,
      36: ({ t: t2 }) => "colDef.type '" + t2 + "' does not correspond to defined gridOptions.columnTypes",
      37: () => `Changing the column pinning status is not allowed with domLayout='print'`,
      38: ({ iconName }) => `provided icon '${iconName}' needs to be a string or a function`,
      39: () => "Applying column order broke a group where columns should be married together. Applying new order has been discarded.",
      40: ({ e, method }) => `${e}
${clipboardApiError(method)}`,
      41: () => "Browser did not allow document.execCommand('copy'). Ensure 'api.copySelectedRowsToClipboard() is invoked via a user event, i.e. button click, otherwise the browser will prevent it for security reasons.",
      42: () => "Browser does not support document.execCommand('copy') for clipboard operations",
      43: ({ iconName }) => `As of v33, icon '${iconName}' is deprecated. Use the icon CSS name instead.`,
      44: () => 'Data type definition hierarchies (via the "extendsDataType" property) cannot contain circular references.',
      45: ({ parentCellDataType }) => `The data type definition ${parentCellDataType} does not exist.`,
      46: () => 'The "baseDataType" property of a data type definition must match that of its parent.',
      47: ({ cellDataType }) => `Missing data type definition - "${cellDataType}"`,
      48: ({ property: property2 }) => `Cell data type is "object" but no Value ${property2} has been provided. Please either provide an object data type definition with a Value ${property2}, or set "colDef.value${property2}"`,
      49: ({ methodName }) => `Framework component is missing the method ${methodName}()`,
      50: ({ compName }) => `Could not find component ${compName}, did you forget to configure this component?`,
      51: () => `Export cancelled. Export is not allowed as per your configuration.`,
      52: () => "There is no `window` associated with the current `document`",
      53: () => `unknown value type during csv conversion`,
      54: () => "Could not find document body, it is needed for drag and drop and context menu.",
      55: () => "addRowDropZone - A container target needs to be provided",
      56: () => "addRowDropZone - target already exists in the list of DropZones. Use `removeRowDropZone` before adding it again.",
      57: () => "unable to show popup filter, filter instantiation failed",
      58: () => "no values found for select cellEditor",
      59: () => "cannot select pinned rows",
      60: () => "cannot select node until it has finished loading",
      61: () => "since version v32.2.0, rowNode.isFullWidthCell() has been deprecated. Instead check `rowNode.detail` followed by the user provided `isFullWidthRow` grid option.",
      62: ({ colId }) => `setFilterModel() - no column found for colId: ${colId}`,
      63: ({ colId }) => `setFilterModel() - unable to fully apply model, filtering disabled for colId: ${colId}`,
      64: ({ colId }) => `setFilterModel() - unable to fully apply model, unable to create filter for colId: ${colId}`,
      65: () => "filter missing setModel method, which is needed for setFilterModel",
      66: () => "filter API missing getModel method, which is needed for getFilterModel",
      67: () => "Filter is missing isFilterActive() method",
      68: () => "Column Filter API methods have been disabled as Advanced Filters are enabled.",
      69: ({ guiFromFilter }) => `getGui method from filter returned ${guiFromFilter}; it should be a DOM element.`,
      70: ({ newFilter }) => `Grid option quickFilterText only supports string inputs, received: ${typeof newFilter}`,
      71: () => "debounceMs is ignored when apply button is present",
      72: ({ keys }) => [`ignoring FilterOptionDef as it doesn't contain one of `, keys],
      73: () => `invalid FilterOptionDef supplied as it doesn't contain a 'displayKey'`,
      74: () => "no filter options for filter",
      75: () => "Unknown button type specified",
      76: ({ filterModelType }) => [
        'Unexpected type of filter "',
        filterModelType,
        '", it looks like the filter was configured with incorrect Filter Options'
      ],
      77: () => `Filter model is missing 'conditions'`,
      78: () => 'Filter Model contains more conditions than "filterParams.maxNumConditions". Additional conditions have been ignored.',
      79: () => '"filterParams.maxNumConditions" must be greater than or equal to zero.',
      80: () => '"filterParams.numAlwaysVisibleConditions" must be greater than or equal to zero.',
      81: () => '"filterParams.numAlwaysVisibleConditions" cannot be greater than "filterParams.maxNumConditions".',
      82: ({ param }) => `DateFilter ${param} is not a number`,
      83: () => `DateFilter minValidYear should be <= maxValidYear`,
      84: () => `DateFilter minValidDate should be <= maxValidDate`,
      85: () => "DateFilter should not have both minValidDate and minValidYear parameters set at the same time! minValidYear will be ignored.",
      86: () => "DateFilter should not have both maxValidDate and maxValidYear parameters set at the same time! maxValidYear will be ignored.",
      87: () => "DateFilter parameter minValidDate should always be lower than or equal to parameter maxValidDate.",
      88: ({ index }) => `Invalid row index for ensureIndexVisible: ${index}`,
      89: () => `A template was provided for Header Group Comp - templates are only supported for Header Comps (not groups)`,
      90: () => `datasource is missing getRows method`,
      91: () => "Filter is missing method doesFilterPass",
      92: () => `AnimationFrameService called but animation frames are off`,
      93: () => "cannot add multiple ranges when `cellSelection.suppressMultiRanges = true`",
      94: ({
        paginationPageSizeOption,
        pageSizeSet,
        pageSizesSet,
        pageSizeOptions
      }) => `'paginationPageSize=${paginationPageSizeOption}'${pageSizeSet ? "" : " (default value)"}, but ${paginationPageSizeOption} is not included in${pageSizesSet ? "" : " the default"} paginationPageSizeSelector=[${pageSizeOptions?.join(", ")}].`,
      95: ({
        paginationPageSizeOption,
        paginationPageSizeSelector: paginationPageSizeSelector2
      }) => `Either set '${paginationPageSizeSelector2}' to an array that includes ${paginationPageSizeOption} or to 'false' to disable the page size selector.`,
      96: ({ id, data }) => [
        "Duplicate ID",
        id,
        "found for pinned row with data",
        data,
        "When `getRowId` is defined, it must return unique IDs for all pinned rows. Use the `rowPinned` parameter."
      ],
      97: ({ colId }) => `cellEditor for column ${colId} is missing getGui() method`,
      98: () => "popup cellEditor does not work with fullRowEdit - you cannot use them both - either turn off fullRowEdit, or stop using popup editors.",
      99: () => "Since v32, `api.hideOverlay()` does not hide the loading overlay when `loading=true`. Set `loading=false` instead.",
      // 100: ({ rowModelType }: { rowModelType: RowModelType }) =>
      //     `selectAll only available when rowModelType='clientSide', ie not ${rowModelType}` as const,
      101: ({
        propertyName: propertyName2,
        componentName,
        agGridDefaults,
        jsComps
      }) => {
        const textOutput2 = [];
        const validComponents = [
          // Don't include the old names / internals in potential suggestions
          ...Object.keys(agGridDefaults ?? []).filter(
            (k2) => !["agCellEditor", "agGroupRowRenderer", "agSortIndicator"].includes(k2)
          ),
          ...Object.keys(jsComps ?? []).filter((k2) => !!jsComps[k2])
        ];
        const suggestions = _fuzzySuggestions({
          inputValue: componentName,
          allSuggestions: validComponents,
          hideIrrelevant: true,
          filterByPercentageOfBestMatch: 0.8
        }).values;
        textOutput2.push(
          `Could not find '${componentName}' component. It was configured as "${propertyName2}: '${componentName}'" but it wasn't found in the list of registered components.
`
        );
        if (suggestions.length > 0) {
          textOutput2.push(`         Did you mean: [${suggestions.slice(0, 3)}]?
`);
        }
        textOutput2.push(`If using a custom component check it has been registered correctly.`);
        return textOutput2;
      },
      102: () => "selectAll: 'filtered' only works when gridOptions.rowModelType='clientSide'",
      103: () => "Invalid selection state. When using client-side row model, the state must conform to `string[]`.",
      104: ({ value: value2, param }) => `Numeric value ${value2} passed to ${param} param will be interpreted as ${value2} seconds. If this is intentional use "${value2}s" to silence this warning.`,
      105: ({ e }) => [`chart rendering failed`, e],
      106: () => `Theming API and Legacy Themes are both used in the same page. A Theming API theme has been provided to the 'theme' grid option, but the file (ag-grid.css) is also included and will cause styling issues. Remove ag-grid.css from the page. See the migration guide: ${baseDocLink}/theming-migration/`,
      107: ({ key: key2, value: value2 }) => `Invalid value for theme param ${key2} - ${value2}`,
      108: ({ e }) => ["chart update failed", e],
      109: ({ inputValue, allSuggestions }) => {
        const suggestions = _fuzzySuggestions({
          inputValue,
          allSuggestions,
          hideIrrelevant: true,
          filterByPercentageOfBestMatch: 0.8
        }).values;
        return [
          `Could not find '${inputValue}' aggregate function. It was configured as "aggFunc: '${inputValue}'" but it wasn't found in the list of registered aggregations.`,
          suggestions.length > 0 ? `         Did you mean: [${suggestions.slice(0, 3)}]?` : "",
          `If using a custom aggregation function check it has been registered correctly.`
        ].join("\n");
      },
      110: () => "groupHideOpenParents only works when specifying specific columns for colDef.showRowGroup",
      111: () => "Invalid selection state. When `groupSelects` is enabled, the state must conform to `IServerSideGroupSelectionState`.",
      113: () => "Set Filter cannot initialise because you are using a row model that does not contain all rows in the browser. Either use a different filter type, or configure Set Filter such that you provide it with values",
      114: ({ component }) => `Could not find component with name of ${component}. Is it in Vue.components?`,
      // 115: () => 'The provided selection state should be an object.' as const,
      116: () => "Invalid selection state. The state must conform to `IServerSideSelectionState`.",
      117: () => "selectAll must be of boolean type.",
      118: () => "Infinite scrolling must be enabled in order to set the row count.",
      119: () => "Unable to instantiate filter",
      120: () => "MultiFloatingFilterComp expects MultiFilter as its parent",
      121: () => "a column you are grouping or pivoting by has objects as values. If you want to group by complex objects then either a) use a colDef.keyCreator (see AG Grid docs) or b) to toString() on the object to return a key",
      122: () => "could not find the document, document is empty",
      123: () => "Advanced Filter is only supported with the Client-Side Row Model or Server-Side Row Model.",
      124: () => "No active charts to update.",
      125: ({ chartId }) => `Unable to update chart. No active chart found with ID: ${chartId}.`,
      126: () => "unable to restore chart as no chart model is provided",
      127: ({ allRange }) => `unable to create chart as ${allRange ? "there are no columns in the grid" : "no range is selected"}.`,
      128: ({ feature }) => `${feature} is only available if using 'multiRow' selection mode.`,
      129: ({ feature, rowModel }) => `${feature} is only available if using 'clientSide' or 'serverSide' rowModelType, you are using ${rowModel}.`,
      130: () => 'cannot multi select unless selection mode is "multiRow"',
      // 131: () => 'cannot range select while selecting multiple rows' as const,
      132: () => "Row selection features are not available unless `rowSelection` is enabled.",
      133: ({ iconName }) => `icon '${iconName}' function should return back a string or a dom object`,
      134: ({ iconName }) => `Did not find icon '${iconName}'`,
      135: () => `Data type of the new value does not match the cell data type of the column`,
      136: () => `Unable to update chart as the 'type' is missing. It must be either 'rangeChartUpdate', 'pivotChartUpdate', or 'crossFilterChartUpdate'.`,
      137: ({ type, currentChartType }) => `Unable to update chart as a '${type}' update type is not permitted on a ${currentChartType}.`,
      138: ({ chartType }) => `invalid chart type supplied: ${chartType}`,
      139: ({ customThemeName }) => `a custom chart theme with the name ${customThemeName} has been supplied but not added to the 'chartThemes' list`,
      140: ({ name: name2 }) => `no stock theme exists with the name '${name2}' and no custom chart theme with that name was supplied to 'customChartThemes'`,
      141: () => "cross filtering with row grouping is not supported.",
      142: () => "cross filtering is only supported in the client side row model.",
      143: ({ panel: panel2 }) => `'${panel2}' is not a valid Chart Tool Panel name`,
      144: ({ type }) => `Invalid charts data panel group name supplied: '${type}'`,
      145: ({ group }) => `As of v32, only one charts customize panel group can be expanded at a time. '${group}' will not be expanded.`,
      146: ({ comp: comp2 }) => `Unable to instantiate component '${comp2}' as its module hasn't been loaded. Add 'ValidationModule' to see which module is required.`,
      147: ({ group }) => `Invalid charts customize panel group name supplied: '${group}'`,
      148: ({ group }) => `invalid chartGroupsDef config '${group}'`,
      149: ({ group, chartType }) => `invalid chartGroupsDef config '${group}.${chartType}'`,
      150: () => `'seriesChartTypes' are required when the 'customCombo' chart type is specified.`,
      151: ({ chartType }) => `invalid chartType '${chartType}' supplied in 'seriesChartTypes', converting to 'line' instead.`,
      152: ({ colId }) => `no 'seriesChartType' found for colId = '${colId}', defaulting to 'line'.`,
      153: ({ chartDataType }) => `unexpected chartDataType value '${chartDataType}' supplied, instead use 'category', 'series' or 'excluded'`,
      154: ({ colId }) => `cross filtering requires a 'agSetColumnFilter' or 'agMultiColumnFilter' to be defined on the column with id: ${colId}`,
      155: ({ option }) => `'${option}' is not a valid Chart Toolbar Option`,
      156: ({ panel: panel2 }) => `Invalid panel in chartToolPanelsDef.panels: '${panel2}'`,
      157: ({ unrecognisedGroupIds }) => ["unable to find group(s) for supplied groupIds:", unrecognisedGroupIds],
      158: () => "can not expand a column item that does not represent a column group header",
      159: () => "Invalid params supplied to createExcelFileForExcel() - `ExcelExportParams.data` is empty.",
      160: () => `Export cancelled. Export is not allowed as per your configuration.`,
      161: () => "The Excel Exporter is currently on Multi Sheet mode. End that operation by calling 'api.getMultipleSheetAsExcel()' or 'api.exportMultipleSheetsAsExcel()'",
      162: ({ id, dataType }) => `Unrecognized data type for excel export [${id}.dataType=${dataType}]`,
      163: ({ featureName }) => `Excel table export does not work with ${featureName}. The exported Excel file will not contain any Excel tables.
 Please turn off ${featureName} to enable Excel table exports.`,
      164: () => "Unable to add data table to Excel sheet: A table already exists.",
      165: () => "Unable to add data table to Excel sheet: Missing required parameters.",
      166: ({ unrecognisedGroupIds }) => ["unable to find groups for these supplied groupIds:", unrecognisedGroupIds],
      167: ({ unrecognisedColIds }) => ["unable to find columns for these supplied colIds:", unrecognisedColIds],
      168: () => "detailCellRendererParams.template should be function or string",
      169: () => 'Reference to eDetailGrid was missing from the details template. Please add data-ref="eDetailGrid" to the template.',
      170: ({ providedStrategy }) => `invalid cellRendererParams.refreshStrategy = ${providedStrategy} supplied, defaulting to refreshStrategy = 'rows'.`,
      171: () => "could not find detail grid options for master detail, please set gridOptions.detailCellRendererParams.detailGridOptions",
      172: () => "could not find getDetailRowData for master / detail, please set gridOptions.detailCellRendererParams.getDetailRowData",
      173: ({ group }) => `invalid chartGroupsDef config '${group}'`,
      174: ({ group, chartType }) => `invalid chartGroupsDef config '${group}.${chartType}'`,
      175: ({ menuTabName, itemsToConsider }) => [
        `Trying to render an invalid menu item '${menuTabName}'. Check that your 'menuTabs' contains one of `,
        itemsToConsider
      ],
      176: ({ key: key2 }) => `unknown menu item type ${key2}`,
      177: () => `valid values for cellSelection.handle.direction are 'x', 'y' and 'xy'. Default to 'xy'.`,
      178: ({ colId }) => `column ${colId} is not visible`,
      179: () => "totalValueGetter should be either a function or a string (expression)",
      180: () => "agRichSelectCellEditor requires cellEditorParams.values to be set",
      181: () => "agRichSelectCellEditor cannot have `multiSelect` and `allowTyping` set to `true`. AllowTyping has been turned off.",
      182: () => 'you cannot mix groupDisplayType = "multipleColumns" with treeData, only one column can be used to display groups when doing tree data',
      183: () => "Group Column Filter only works on group columns. Please use a different filter.",
      184: ({ parentGroupData, childNodeData }) => [`duplicate group keys for row data, keys should be unique`, [parentGroupData, childNodeData]],
      185: ({ data }) => [`getDataPath() should not return an empty path`, [data]],
      186: ({
        rowId,
        rowData,
        duplicateRowsData
      }) => [
        `duplicate group keys for row data, keys should be unique`,
        rowId,
        rowData,
        ...duplicateRowsData ?? []
      ],
      187: ({ rowId, firstData, secondData }) => [
        `Duplicate node id ${rowId}. Row IDs are provided via the getRowId() callback. Please modify the getRowId() callback code to provide unique row id values.`,
        "first instance",
        firstData,
        "second instance",
        secondData
      ],
      188: (props) => `getRowId callback must be provided for Server Side Row Model ${props?.feature || "selection"} to work correctly.`,
      189: ({ startRow }) => `invalid value ${startRow} for startRow, the value should be >= 0`,
      190: ({ rowGroupId, data }) => [
        `null and undefined values are not allowed for server side row model keys`,
        rowGroupId ? `column = ${rowGroupId}` : ``,
        `data is `,
        data
      ],
      // 191: () => `cannot multi select unless selection mode is 'multiRow'` as const,
      // 192: () => `cannot use range selection when multi selecting rows` as const,
      // 193: () => "cannot multi select unless selection mode is 'multiRow'" as const,
      194: ({ method }) => `calling gridApi.${method}() is only possible when using rowModelType=\`clientSide\`.`,
      195: ({ justCurrentPage }) => `selecting just ${justCurrentPage ? "current page" : "filtered"} only works when gridOptions.rowModelType='clientSide'`,
      196: ({ key: key2 }) => `Provided ids must be of string type. Invalid id provided: ${key2}`,
      197: () => "`toggledNodes` must be an array of string ids.",
      // 198: () => `cannot multi select unless selection mode is 'multiRow'` as const,
      199: () => `getSelectedNodes and getSelectedRows functions cannot be used with select all functionality with the server-side row model. Use \`api.getServerSideSelectionState()\` instead.`,
      200: missingModule,
      201: ({ rowModelType }) => `Could not find row model for rowModelType = ${rowModelType}`,
      202: () => `\`getSelectedNodes\` and \`getSelectedRows\` functions cannot be used with \`groupSelectsChildren\` and the server-side row model. Use \`api.getServerSideSelectionState()\` instead.`,
      203: () => "Server Side Row Model does not support Dynamic Row Height and Cache Purging. Either a) remove getRowHeight() callback or b) remove maxBlocksInCache property. Purging has been disabled.",
      204: () => "Server Side Row Model does not support Auto Row Height and Cache Purging. Either a) remove colDef.autoHeight or b) remove maxBlocksInCache property. Purging has been disabled.",
      205: ({ duplicateIdText }) => `Unable to display rows as duplicate row ids (${duplicateIdText}) were returned by the getRowId callback. Please modify the getRowId callback to provide unique ids.`,
      206: () => "getRowId callback must be implemented for transactions to work. Transaction was ignored.",
      207: () => 'The Set Filter Parameter "defaultToNothingSelected" value was ignored because it does not work when "excelMode" is used.',
      208: () => `Set Filter Value Formatter must return string values. Please ensure the Set Filter Value Formatter returns string values for complex objects.`,
      209: () => `Set Filter Key Creator is returning null for provided values and provided values are primitives. Please provide complex objects. See ${baseDocLink}/filter-set-filter-list/#filter-value-types`,
      210: () => "Set Filter has a Key Creator, but provided values are primitives. Did you mean to provide complex objects?",
      211: () => "property treeList=true for Set Filter params, but you did not provide a treeListPathGetter or values of type Date.",
      212: () => `please review all your toolPanel components, it seems like at least one of them doesn't have an id`,
      213: () => "Advanced Filter does not work with Filters Tool Panel. Filters Tool Panel has been disabled.",
      214: ({ key: key2 }) => `unable to lookup Tool Panel as invalid key supplied: ${key2}`,
      215: ({ key: key2, defaultByKey }) => `the key ${key2} is not a valid key for specifying a tool panel, valid keys are: ${Object.keys(defaultByKey ?? {}).join(",")}`,
      216: ({ name: name2 }) => `Missing component for '${name2}'`,
      217: ({ invalidColIds }) => ["unable to find grid columns for the supplied colDef(s):", invalidColIds],
      218: ({ property: property2, defaultOffset }) => `${property2} must be a number, the value you provided is not a valid number. Using the default of ${defaultOffset}px.`,
      219: ({ property: property2 }) => `Property ${property2} does not exist on the target object.`,
      220: ({ lineDash }) => `'${lineDash}' is not a valid 'lineDash' option.`,
      221: () => `agAggregationComponent should only be used with the client and server side row model.`,
      222: () => `agFilteredRowCountComponent should only be used with the client side row model.`,
      223: () => `agSelectedRowCountComponent should only be used with the client and server side row model.`,
      224: () => `agTotalAndFilteredRowCountComponent should only be used with the client side row model.`,
      225: () => "agTotalRowCountComponent should only be used with the client side row model.",
      226: () => "viewport is missing init method.",
      227: () => "menu item icon must be DOM node or string",
      228: ({ menuItemOrString }) => `unrecognised menu item ${menuItemOrString}`,
      229: ({ index }) => ["invalid row index for ensureIndexVisible: ", index],
      230: () => "detailCellRendererParams.template is not supported by AG Grid React. To change the template, provide a Custom Detail Cell Renderer. See https://www.ag-grid.com/react-data-grid/master-detail-custom-detail/",
      // @deprecated v32 mark for removal as part of v32 deprecated features
      231: () => "As of v32, using custom components with `reactiveCustomComponents = false` is deprecated.",
      232: () => "Using both rowData and v-model. rowData will be ignored.",
      233: ({ methodName }) => `Framework component is missing the method ${methodName}()`,
      234: () => 'Group Column Filter does not work with the colDef property "field". This property will be ignored.',
      235: () => 'Group Column Filter does not work with the colDef property "filterValueGetter". This property will be ignored.',
      236: () => 'Group Column Filter does not work with the colDef property "filterParams". This property will be ignored.',
      237: () => "Group Column Filter does not work with Tree Data enabled. Please disable Tree Data, or use a different filter.",
      238: () => "setRowCount can only accept a positive row count.",
      239: () => 'Theming API and CSS File Themes are both used in the same page. In v33 we released the Theming API as the new default method of styling the grid. See the migration docs https://www.ag-grid.com/react-data-grid/theming-migration/. Because no value was provided to the `theme` grid option it defaulted to themeQuartz. But the file (ag-grid.css) is also included and will cause styling issues. Either pass the string "legacy" to the theme grid option to use v32 style themes, or remove ag-grid.css from the page to use Theming API.',
      240: ({ theme: theme2 }) => `theme grid option must be a Theming API theme object or the string "legacy", received: ${theme2}`,
      // 241: () => `cannot select multiple rows when rowSelection.mode is set to 'singleRow'` as const,
      // 242: () => 'cannot select multiple rows when using rangeSelect' as const,
      243: () => "Failed to deserialize state - each provided state object must be an object.",
      244: () => "Failed to deserialize state - `selectAllChildren` must be a boolean value or undefined.",
      245: () => "Failed to deserialize state - `toggledNodes` must be an array.",
      246: () => "Failed to deserialize state - Every `toggledNode` requires an associated string id.",
      247: () => `Row selection state could not be parsed due to invalid data. Ensure all child state has toggledNodes or does not conform with the parent rule. 
Please rebuild the selection state and reapply it.`,
      248: () => "SetFloatingFilter expects SetFilter as its parent",
      249: () => "Must supply a Value Formatter in Set Filter params when using a Key Creator",
      250: () => "Must supply a Key Creator in Set Filter params when `treeList = true` on a group column, and Tree Data or Row Grouping is enabled.",
      251: ({ chartType }) => `AG Grid: Unable to create chart as an invalid chartType = '${chartType}' was supplied.`,
      252: () => "cannot get grid to draw rows when it is in the middle of drawing rows. \nYour code probably called a grid API method while the grid was in the render stage. \nTo overcome this, put the API call into a timeout, e.g. instead of api.redrawRows(), call setTimeout(function() { api.redrawRows(); }, 0). \nTo see what part of your code that caused the refresh check this stacktrace.",
      253: ({ version: version2 }) => ["Illegal version string: ", version2],
      254: () => "Cannot create chart: no chart themes available.",
      255: ({ point }) => `Lone surrogate U+${point?.toString(16).toUpperCase()} is not a scalar value`,
      256: () => "Unable to initialise. See validation error, or load ValidationModule if missing.",
      257: () => missingChartsWithModule("IntegratedChartsModule"),
      258: () => missingChartsWithModule("SparklinesModule"),
      259: ({ part: part2 }) => `the argument to theme.withPart must be a Theming API part object, received: ${part2}`,
      260: ({
        propName,
        compName,
        gridScoped,
        gridId,
        rowModelType
      }) => missingModule({
        reasonOrId: `AG Grid '${propName}' component: ${compName}`,
        moduleName: USER_COMP_MODULES[compName],
        gridId,
        gridScoped,
        rowModelType
      }),
      261: () => "As of v33, `column.isHovered()` is deprecated. Use `api.isColumnHovered(column)` instead.",
      262: () => 'As of v33, icon key "smallDown" is deprecated. Use "advancedFilterBuilderSelect" for Advanced Filter Builder dropdown, "selectOpen" for Select cell editor and dropdowns (e.g. Integrated Charts menu), "richSelectOpen" for Rich Select cell editor.',
      263: () => 'As of v33, icon key "smallLeft" is deprecated. Use "panelDelimiterRtl" for Row Group Panel / Pivot Panel, "subMenuOpenRtl" for sub-menus.',
      264: () => 'As of v33, icon key "smallRight" is deprecated. Use "panelDelimiter" for Row Group Panel / Pivot Panel, "subMenuOpen" for sub-menus.',
      265: ({ colId }) => `Unable to infer chart data type for column '${colId}' if first data entry is null. Please specify "chartDataType", or a "cellDataType" in the column definition. For more information, see ${baseDocLink}/integrated-charts-range-chart#coldefchartdatatype .`,
      266: () => 'As of v33.1, using "keyCreator" with the Rich Select Editor has been deprecated. It now requires the "formatValue" callback to convert complex data to strings.',
      267: () => "Detail grids can not use a different theme to the master grid, the `theme` detail grid option will be ignored.",
      268: () => "Transactions aren't supported with tree data when using treeDataChildrenField",
      269: () => "When `masterSelects: 'detail'`, detail grids must be configured with multi-row selection",
      270: ({ id, parentId }) => `Cycle detected for row with id='${id}' and parent id='${parentId}'. Resetting the parent for row with id='${id}' and showing it as a root-level node.`,
      271: ({ id, parentId }) => `Parent row not found for row with id='${id}' and parent id='${parentId}'. Showing row with id='${id}' as a root-level node.`,
      272: () => NoModulesRegisteredError(),
      273: ({ providedId, usedId }) => `Provided column id '${providedId}' was already in use, ensure all column and group ids are unique. Using '${usedId}' instead.`,
      274: ({ prop: prop2 }) => {
        let msg = `Since v33, ${prop2} has been deprecated.`;
        switch (prop2) {
          case "maxComponentCreationTimeMs":
            msg += " This property is no longer required and so will be removed in a future version.";
            break;
          case "setGridApi":
            msg += ` This method is not called by AG Grid. To access the GridApi see: https://ag-grid.com/react-data-grid/grid-interface/#grid-api `;
            break;
          case "children":
            msg += ` For multiple versions AgGridReact does not support children.`;
            break;
        }
        return msg;
      },
      275: missingRowModelTypeError,
      276: () => "Row Numbers Row Resizer cannot be used when Grid Columns have `autoHeight` enabled.",
      277: ({ colId }) => `'enableFilterHandlers' is set to true, but column '${colId}' does not have 'filter.doesFilterPass' or 'filter.handler' set.`,
      278: ({ colId }) => `Unable to create filter handler for column '${colId}'`,
      279: (_) => {
      },
      // `Unable to create dynamic bean '${name}' during module init lifecycle, dynamic beans must be initialised on first use.` as const,
      280: ({ colId }) => `'name' must be provided for custom filter components for column '${colId}`,
      281: ({ colId }) => `Filter for column '${colId}' does not have 'filterParams.buttons', but the new Filters Tool Panel has buttons configured. Either configure buttons for the filter, or disable buttons on the Filters Tool Panel.`,
      282: () => "New filter tool panel requires `enableFilterHandlers: true`.",
      283: () => "As of v34, use the same method on the filter handler (`api.getColumnFilterHandler(colKey)`) instead.",
      284: () => "As of v34, filters are active when they have a model. Use `api.getColumnFilterModel()` instead.",
      285: () => "As of v34, use (`api.getColumnFilterModel()`) instead.",
      286: () => "As of v34, use (`api.setColumnFilterModel()`) instead.",
      287: () => "`api.doFilterAction()` requires `enableFilterHandlers = true",
      288: () => "`api.getColumnFilterModel(key, true)` requires `enableFilterHandlers = true",
      289: ({ rowModelType }) => `Row Model '${rowModelType}' is not supported with Batch Editing`,
      290: ({ rowIndex, rowPinned }) => `Row with index '${rowIndex}' and pinned state '${rowPinned}' not found`,
      291: () => "License Key being set multiple times with different values. This can result in an incorrect license key being used,",
      292: ({ colId }) => `The Multi Filter for column '${colId}' has buttons configured against the child filters. When 'enableFilterHandlers=true', buttons must instead be provided against the parent Multi Filter params. The child filter buttons will be ignored.`
    };
    function getError(errorId, args2) {
      const msgOrFunc = AG_GRID_ERRORS[errorId];
      if (!msgOrFunc) {
        return [`Missing error text for error id ${errorId}!`];
      }
      const errorBody = msgOrFunc(args2);
      const errorLink = getErrorLink(errorId, args2);
      const errorSuffix = `
See ${errorLink}`;
      return Array.isArray(errorBody) ? errorBody.concat(errorSuffix) : [errorBody, errorSuffix];
    }
    var MISSING_MODULE_REASONS = {
      1: "Charting Aggregation",
      2: "pivotResultFields",
      3: "setTooltip"
    };
    var _gridApiCache = /* @__PURE__ */ new WeakMap();
    var _gridElementCache = /* @__PURE__ */ new WeakMap();
    var nextGridId = 1;
    var GridCoreCreator = class {
      create(eGridDiv, providedOptions, createUi, acceptChanges, params, _destroyCallback) {
        const gridOptions = GlobalGridOptions.applyGlobalGridOptions(providedOptions);
        const gridId = gridOptions.gridId ?? String(nextGridId++);
        const registeredModules = this.getRegisteredModules(params, gridId, gridOptions.rowModelType);
        const beanClasses = this.createBeansList(gridOptions.rowModelType, registeredModules, gridId);
        const providedBeanInstances = this.createProvidedBeans(eGridDiv, gridOptions, params);
        if (!beanClasses) {
          return void 0;
        }
        const destroyCallback = () => {
          _gridElementCache.delete(api2);
          _gridApiCache.delete(eGridDiv);
          _unRegisterGridModules(gridId);
          _destroyCallback?.();
        };
        const contextParams = {
          providedBeanInstances,
          beanClasses,
          id: gridId,
          beanInitComparator: gridBeanInitComparator,
          beanDestroyComparator: gridBeanDestroyComparator,
          derivedBeans: [createGridApi],
          destroyCallback
        };
        const context = new AgContext(contextParams);
        this.registerModuleFeatures(context, registeredModules);
        createUi(context);
        context.getBean("syncSvc").start();
        acceptChanges?.(context);
        const api2 = context.getBean("gridApi");
        _gridApiCache.set(eGridDiv, api2);
        _gridElementCache.set(api2, eGridDiv);
        return api2;
      }
      getRegisteredModules(params, gridId, rowModelType) {
        _registerModule(CommunityCoreModule, void 0, true);
        params?.modules?.forEach((m) => _registerModule(m, gridId));
        return _getRegisteredModules(gridId, getDefaultRowModelType(rowModelType));
      }
      registerModuleFeatures(context, registeredModules) {
        const registry = context.getBean("registry");
        const apiFunctionSvc = context.getBean("apiFunctionSvc");
        for (const module2 of registeredModules) {
          registry.registerModule(module2);
          const apiFunctions = module2.apiFunctions;
          if (apiFunctions) {
            const names = Object.keys(apiFunctions);
            for (const name2 of names) {
              apiFunctionSvc?.addFunction(name2, apiFunctions[name2]);
            }
          }
        }
      }
      createProvidedBeans(eGridDiv, gridOptions, params) {
        let frameworkOverrides = params ? params.frameworkOverrides : null;
        if (_missing(frameworkOverrides)) {
          frameworkOverrides = new VanillaFrameworkOverrides();
        }
        const seed = {
          gridOptions,
          eGridDiv,
          eRootDiv: eGridDiv,
          globalListener: params ? params.globalListener : null,
          globalSyncListener: params ? params.globalSyncListener : null,
          frameworkOverrides
        };
        if (params?.providedBeanInstances) {
          Object.assign(seed, params.providedBeanInstances);
        }
        return seed;
      }
      createBeansList(userProvidedRowModelType, registeredModules, gridId) {
        const rowModelModuleNames = {
          clientSide: "ClientSideRowModel",
          infinite: "InfiniteRowModel",
          serverSide: "ServerSideRowModel",
          viewport: "ViewportRowModel"
        };
        const rowModelType = getDefaultRowModelType(userProvidedRowModelType);
        const rowModuleModelName = rowModelModuleNames[rowModelType];
        if (!rowModuleModelName) {
          _logPreInitErr(201, { rowModelType }, `Unknown rowModelType ${rowModelType}.`);
          return;
        }
        if (!_hasUserRegistered()) {
          _logPreInitErr(272, void 0, NoModulesRegisteredError());
          return;
        }
        if (!userProvidedRowModelType) {
          const registeredRowModelModules = Object.entries(rowModelModuleNames).filter(
            ([rowModelType2, module2]) => _isModuleRegistered(module2, gridId, rowModelType2)
          );
          if (registeredRowModelModules.length == 1) {
            const [userRowModelType, moduleName] = registeredRowModelModules[0];
            if (userRowModelType !== rowModelType) {
              const params = {
                moduleName,
                rowModelType: userRowModelType
              };
              _logPreInitErr(275, params, missingRowModelTypeError(params));
              return;
            }
          }
        }
        if (!_isModuleRegistered(rowModuleModelName, gridId, rowModelType)) {
          _logPreInitErr(
            200,
            {
              reasonOrId: `rowModelType = '${rowModelType}'`,
              moduleName: rowModuleModelName,
              gridScoped: _areModulesGridScoped(),
              gridId,
              rowModelType
            },
            `Missing module ${rowModuleModelName}Module for rowModelType ${rowModelType}.`
          );
          return;
        }
        const beans = /* @__PURE__ */ new Set();
        for (const module2 of registeredModules) {
          for (const bean of module2.beans ?? []) {
            beans.add(bean);
          }
        }
        return Array.from(beans);
      }
    };
    function getDefaultRowModelType(passedRowModelType) {
      return passedRowModelType ?? "clientSide";
    }
    function _getClientSideRowModel(beans) {
      const rowModel = beans.rowModel;
      return rowModel.getType() === "clientSide" ? rowModel : void 0;
    }
    function _getInfiniteRowModel(beans) {
      const rowModel = beans.rowModel;
      return rowModel.getType() === "infinite" ? rowModel : void 0;
    }
    function _getServerSideRowModel(beans) {
      const rowModel = beans.rowModel;
      return rowModel.getType() === "serverSide" ? rowModel : void 0;
    }
    var LocaleService = class extends BeanStub {
      constructor() {
        super(...arguments);
        this.beanName = "localeSvc";
      }
      getLocaleTextFunc() {
        const gos = this.gos;
        const getLocaleText = gos.getCallback("getLocaleText");
        if (getLocaleText) {
          return _getLocaleTextFromFunc(getLocaleText);
        }
        return _getLocaleTextFromMap(gos.get("localeText"));
      }
    };
    function convertColumnState(columnState, enablePivotMode = false) {
      const sortColumns = [];
      const groupColIds = [];
      const aggregationColumns = [];
      const pivotColIds = [];
      const leftColIds = [];
      const rightColIds = [];
      const hiddenColIds = [];
      const columnSizes = [];
      const columns = [];
      let defaultSortIndex = 0;
      for (let i2 = 0; i2 < columnState.length; i2++) {
        const {
          colId,
          sort: sort2,
          sortIndex,
          rowGroup,
          rowGroupIndex,
          aggFunc,
          pivot,
          pivotIndex,
          pinned,
          hide: hide2,
          width,
          flex: flex2
        } = columnState[i2];
        columns.push(colId);
        if (sort2) {
          sortColumns[sortIndex ?? defaultSortIndex++] = { colId, sort: sort2 };
        }
        if (rowGroup) {
          groupColIds[rowGroupIndex ?? 0] = colId;
        }
        if (typeof aggFunc === "string") {
          aggregationColumns.push({ colId, aggFunc });
        }
        if (pivot) {
          pivotColIds[pivotIndex ?? 0] = colId;
        }
        if (pinned) {
          (pinned === "right" ? rightColIds : leftColIds).push(colId);
        }
        if (hide2) {
          hiddenColIds.push(colId);
        }
        if (flex2 != null || width) {
          columnSizes.push({ colId, flex: flex2 ?? void 0, width });
        }
      }
      return {
        sort: sortColumns.length ? { sortModel: _removeEmptyValues(sortColumns) } : void 0,
        rowGroup: groupColIds.length ? { groupColIds: _removeEmptyValues(groupColIds) } : void 0,
        aggregation: aggregationColumns.length ? { aggregationModel: aggregationColumns } : void 0,
        pivot: pivotColIds.length || enablePivotMode ? { pivotMode: enablePivotMode, pivotColIds: _removeEmptyValues(pivotColIds) } : void 0,
        columnPinning: leftColIds.length || rightColIds.length ? { leftColIds, rightColIds } : void 0,
        columnVisibility: hiddenColIds.length ? { hiddenColIds } : void 0,
        columnSizing: columnSizes.length ? { columnSizingModel: columnSizes } : void 0,
        columnOrder: columns.length ? { orderedColIds: columns } : void 0
      };
    }
    function _removeEmptyValues(array) {
      return array.filter((a) => a != void 0);
    }
    function _convertColumnGroupState(columnGroupState) {
      const openColumnGroups = [];
      for (const { groupId, open } of columnGroupState) {
        if (open) {
          openColumnGroups.push(groupId);
        }
      }
      return openColumnGroups.length ? { openColumnGroupIds: openColumnGroups } : void 0;
    }
    var BaseComponentWrapper = class {
      wrap(OriginalConstructor, mandatoryMethods, optionalMethods, componentType) {
        const wrapper2 = this.createWrapper(OriginalConstructor, componentType);
        for (const methodName of mandatoryMethods ?? []) {
          this.createMethod(wrapper2, methodName, true);
        }
        for (const methodName of optionalMethods ?? []) {
          this.createMethod(wrapper2, methodName, false);
        }
        return wrapper2;
      }
      createMethod(wrapper2, methodName, mandatory) {
        wrapper2.addMethod(methodName, this.createMethodProxy(wrapper2, methodName, mandatory));
      }
      createMethodProxy(wrapper2, methodName, mandatory) {
        return function() {
          if (wrapper2.hasMethod(methodName)) {
            return wrapper2.callMethod(methodName, arguments);
          }
          if (mandatory) {
            _warn(49, { methodName });
          }
          return null;
        };
      }
    };
    function _isShowTooltipWhenTruncated(gos) {
      return gos.get("tooltipShowMode") === "whenTruncated";
    }
    function _formatNumberCommas(value2, getLocaleTextFunc) {
      if (typeof value2 !== "number") {
        return "";
      }
      const localeTextFunc = getLocaleTextFunc();
      const thousandSeparator = localeTextFunc("thousandSeparator", ",");
      const decimalSeparator = localeTextFunc("decimalSeparator", ".");
      return value2.toString().replace(".", decimalSeparator).replace(/(\d)(?=(\d{3})+(?!\d))/g, `$1${thousandSeparator}`);
    }
    var BaseCreator = class extends BeanStub {
      getFileName(fileName) {
        const extension = this.getDefaultFileExtension();
        if (!fileName?.length) {
          fileName = this.getDefaultFileName();
        }
        return fileName.includes(".") ? fileName : `${fileName}.${extension}`;
      }
      getData(params) {
        const serializingSession = this.createSerializingSession(params);
        return this.beans.gridSerializer.serialize(serializingSession, params);
      }
      getDefaultFileName() {
        return `export.${this.getDefaultFileExtension()}`;
      }
    };
    var BaseGridSerializingSession = class {
      constructor(config2) {
        const {
          colModel,
          rowGroupColsSvc,
          colNames,
          valueSvc,
          gos,
          processCellCallback,
          processHeaderCallback,
          processGroupHeaderCallback,
          processRowGroupCallback
        } = config2;
        this.colModel = colModel;
        this.rowGroupColsSvc = rowGroupColsSvc;
        this.colNames = colNames;
        this.valueSvc = valueSvc;
        this.gos = gos;
        this.processCellCallback = processCellCallback;
        this.processHeaderCallback = processHeaderCallback;
        this.processGroupHeaderCallback = processGroupHeaderCallback;
        this.processRowGroupCallback = processRowGroupCallback;
      }
      prepare(_columnsToExport) {
      }
      extractHeaderValue(column2) {
        const value2 = this.getHeaderName(this.processHeaderCallback, column2);
        return value2 ?? "";
      }
      extractRowCellValue(column2, currentColumnIndex, accumulatedRowIndex, type, node2) {
        const isFullWidthGroup = currentColumnIndex === 0 && _isFullWidthGroupRow(this.gos, node2, this.colModel.isPivotMode());
        if (this.processRowGroupCallback && (this.gos.get("treeData") || node2.group) && (column2.isRowGroupDisplayed(node2.rowGroupColumn?.getColId() ?? "") || isFullWidthGroup)) {
          return { value: this.processRowGroupCallback(_addGridCommonParams(this.gos, { column: column2, node: node2 })) ?? "" };
        }
        if (this.processCellCallback) {
          return {
            value: this.processCellCallback(
              _addGridCommonParams(this.gos, {
                accumulatedRowIndex,
                column: column2,
                node: node2,
                value: this.valueSvc.getValueForDisplay(column2, node2, void 0, void 0).value,
                type,
                parseValue: (valueToParse) => this.valueSvc.parseValue(
                  column2,
                  node2,
                  valueToParse,
                  this.valueSvc.getValue(column2, node2, void 0)
                ),
                formatValue: (valueToFormat) => this.valueSvc.formatValue(column2, node2, valueToFormat) ?? valueToFormat
              })
            ) ?? ""
          };
        }
        const isTreeData = this.gos.get("treeData");
        const valueService = this.valueSvc;
        const isGrandTotalRow = node2.level === -1 && node2.footer;
        const isMultiAutoCol = column2.colDef.showRowGroup === true && (node2.group || isTreeData);
        if (!isGrandTotalRow && (isFullWidthGroup || isMultiAutoCol)) {
          let concatenatedGroupValue = "";
          let pointer = node2;
          while (pointer && pointer.level !== -1) {
            const { value: value22, valueFormatted: valueFormatted2 } = valueService.getValueForDisplay(
              isFullWidthGroup ? void 0 : column2,
              // full width group doesn't have a column
              pointer,
              true,
              true
            );
            concatenatedGroupValue = ` -> ${valueFormatted2 ?? value22 ?? ""}${concatenatedGroupValue}`;
            pointer = pointer.parent;
          }
          return {
            value: concatenatedGroupValue,
            // don't return the unformatted value; as if the grid detects number it'll not use the concatenated string
            valueFormatted: concatenatedGroupValue
          };
        }
        const { value: value2, valueFormatted } = valueService.getValueForDisplay(column2, node2, true, true);
        return {
          value: value2 ?? "",
          valueFormatted
        };
      }
      getHeaderName(callback, column2) {
        if (callback) {
          return callback(_addGridCommonParams(this.gos, { column: column2 }));
        }
        return this.colNames.getDisplayNameForColumn(column2, "csv", true);
      }
    };
    function _downloadFile(fileName, content2) {
      const win = document.defaultView || window;
      if (!win) {
        _warn(52);
        return;
      }
      const element = document.createElement("a");
      const url = win.URL.createObjectURL(content2);
      element.setAttribute("href", url);
      element.setAttribute("download", fileName);
      element.style.display = "none";
      document.body.appendChild(element);
      element.dispatchEvent(
        new MouseEvent("click", {
          bubbles: false,
          cancelable: true,
          view: win
        })
      );
      element.remove();
      win.setTimeout(() => {
        win.URL.revokeObjectURL(url);
      }, 0);
    }
    var INITIAL_GRID_OPTION_KEYS = {
      enableBrowserTooltips: true,
      tooltipTrigger: true,
      tooltipMouseTrack: true,
      tooltipShowMode: true,
      tooltipInteraction: true,
      defaultColGroupDef: true,
      suppressAutoSize: true,
      skipHeaderOnAutoSize: true,
      autoSizeStrategy: true,
      components: true,
      stopEditingWhenCellsLoseFocus: true,
      undoRedoCellEditing: true,
      undoRedoCellEditingLimit: true,
      excelStyles: true,
      cacheQuickFilter: true,
      customChartThemes: true,
      chartThemeOverrides: true,
      chartToolPanelsDef: true,
      loadingCellRendererSelector: true,
      localeText: true,
      keepDetailRows: true,
      keepDetailRowsCount: true,
      detailRowHeight: true,
      detailRowAutoHeight: true,
      tabIndex: true,
      valueCache: true,
      valueCacheNeverExpires: true,
      enableCellExpressions: true,
      suppressTouch: true,
      suppressBrowserResizeObserver: true,
      suppressPropertyNamesCheck: true,
      debug: true,
      dragAndDropImageComponent: true,
      loadingOverlayComponent: true,
      suppressLoadingOverlay: true,
      noRowsOverlayComponent: true,
      paginationPageSizeSelector: true,
      paginateChildRows: true,
      pivotPanelShow: true,
      pivotSuppressAutoColumn: true,
      suppressExpandablePivotGroups: true,
      aggFuncs: true,
      allowShowChangeAfterFilter: true,
      ensureDomOrder: true,
      enableRtl: true,
      suppressColumnVirtualisation: true,
      suppressMaxRenderedRowRestriction: true,
      suppressRowVirtualisation: true,
      rowDragText: true,
      groupLockGroupColumns: true,
      suppressGroupRowsSticky: true,
      rowModelType: true,
      cacheOverflowSize: true,
      infiniteInitialRowCount: true,
      serverSideInitialRowCount: true,
      maxBlocksInCache: true,
      maxConcurrentDatasourceRequests: true,
      blockLoadDebounceMillis: true,
      serverSideOnlyRefreshFilteredGroups: true,
      serverSidePivotResultFieldSeparator: true,
      viewportRowModelPageSize: true,
      viewportRowModelBufferSize: true,
      debounceVerticalScrollbar: true,
      suppressAnimationFrame: true,
      suppressPreventDefaultOnMouseWheel: true,
      scrollbarWidth: true,
      icons: true,
      suppressRowTransform: true,
      gridId: true,
      enableGroupEdit: true,
      initialState: true,
      processUnpinnedColumns: true,
      createChartContainer: true,
      getLocaleText: true,
      getRowId: true,
      reactiveCustomComponents: true,
      renderingMode: true,
      columnMenu: true,
      suppressSetFilterByDefault: true,
      getDataPath: true,
      enableCellSpan: true,
      enableFilterHandlers: true,
      filterHandlers: true
    };
    var clientSide = "clientSide";
    var serverSide = "serverSide";
    var infinite = "infinite";
    var functionRowModels = {
      onGroupExpandedOrCollapsed: [clientSide],
      refreshClientSideRowModel: [clientSide],
      isRowDataEmpty: [clientSide],
      forEachLeafNode: [clientSide],
      forEachNodeAfterFilter: [clientSide],
      forEachNodeAfterFilterAndSort: [clientSide],
      resetRowHeights: [clientSide, serverSide],
      applyTransaction: [clientSide],
      applyTransactionAsync: [clientSide],
      flushAsyncTransactions: [clientSide],
      getBestCostNodeSelection: [clientSide],
      getServerSideSelectionState: [serverSide],
      setServerSideSelectionState: [serverSide],
      applyServerSideTransaction: [serverSide],
      applyServerSideTransactionAsync: [serverSide],
      applyServerSideRowData: [serverSide],
      retryServerSideLoads: [serverSide],
      flushServerSideAsyncTransactions: [serverSide],
      refreshServerSide: [serverSide],
      getServerSideGroupLevelState: [serverSide],
      refreshInfiniteCache: [infinite],
      purgeInfiniteCache: [infinite],
      getInfiniteRowCount: [infinite],
      isLastRowIndexKnown: [infinite, serverSide],
      expandAll: [clientSide, serverSide],
      collapseAll: [clientSide, serverSide],
      onRowHeightChanged: [clientSide, serverSide],
      setRowCount: [infinite, serverSide],
      getCacheBlockState: [infinite, serverSide]
    };
    var deprecatedFunctions = {
      showLoadingOverlay: {
        version: "v32",
        message: '`showLoadingOverlay` is deprecated. Use the grid option "loading"=true instead or setGridOption("loading", true).'
      },
      clearRangeSelection: {
        version: "v32.2",
        message: "Use `clearCellSelection` instead."
      },
      getInfiniteRowCount: {
        version: "v32.2",
        old: "getInfiniteRowCount()",
        new: "getDisplayedRowCount()"
      },
      selectAllFiltered: {
        version: "v33",
        old: "selectAllFiltered()",
        new: 'selectAll("filtered")'
      },
      deselectAllFiltered: {
        version: "v33",
        old: "deselectAllFiltered()",
        new: 'deselectAll("filtered")'
      },
      selectAllOnCurrentPage: {
        version: "v33",
        old: "selectAllOnCurrentPage()",
        new: 'selectAll("currentPage")'
      },
      deselectAllOnCurrentPage: {
        version: "v33",
        old: "deselectAllOnCurrentPage()",
        new: 'deselectAll("currentPage")'
      }
    };
    function validateApiFunction(functionName, apiFunction, beans) {
      const deprecation = deprecatedFunctions[functionName];
      if (deprecation) {
        const { version: version2, new: replacement, old, message: message2 } = deprecation;
        const apiMethod = old ?? functionName;
        return (...args2) => {
          const replacementMessage = replacement ? `Please use ${replacement} instead. ` : "";
          _warnOnce(`Since ${version2} api.${apiMethod} is deprecated. ${replacementMessage}${message2 ?? ""}`);
          return apiFunction.apply(apiFunction, args2);
        };
      }
      const rowModels = functionRowModels[functionName];
      if (rowModels) {
        return (...args2) => {
          const rowModel = beans.rowModel.getType();
          if (!rowModels.includes(rowModel)) {
            _errorOnce(
              `api.${functionName} can only be called when gridOptions.rowModelType is ${rowModels.join(" or ")}`
            );
            return void 0;
          }
          return apiFunction.apply(apiFunction, args2);
        };
      }
      return apiFunction;
    }
    var DYNAMIC_BEAN_MODULES = {
      detailCellRendererCtrl: "SharedMasterDetail",
      dndSourceComp: "DragAndDrop",
      fillHandle: "CellSelection",
      groupCellRendererCtrl: "GroupCellRenderer",
      headerFilterCellCtrl: "ColumnFilter",
      headerGroupCellCtrl: "ColumnGroup",
      rangeHandle: "CellSelection",
      tooltipFeature: "Tooltip",
      highlightTooltipFeature: "Tooltip",
      tooltipStateManager: "Tooltip",
      groupStrategy: "RowGrouping",
      treeGroupStrategy: "TreeData",
      rowNumberRowResizer: "RowNumbers",
      singleCell: "EditCore",
      fullRow: "EditCore",
      agSetColumnFilterHandler: "SetFilter",
      agMultiColumnFilterHandler: "MultiFilter",
      agGroupColumnFilterHandler: "GroupFilter",
      agNumberColumnFilterHandler: "NumberFilter",
      agDateColumnFilterHandler: "DateFilter",
      agTextColumnFilterHandler: "TextFilter"
    };
    var ICON_VALUES = {
      expanded: 1,
      contracted: 1,
      "tree-closed": 1,
      "tree-open": 1,
      "tree-indeterminate": 1,
      pin: 1,
      "eye-slash": 1,
      arrows: 1,
      left: 1,
      right: 1,
      group: 1,
      aggregation: 1,
      pivot: 1,
      "not-allowed": 1,
      chart: 1,
      cross: 1,
      cancel: 1,
      tick: 1,
      first: 1,
      previous: 1,
      next: 1,
      last: 1,
      linked: 1,
      unlinked: 1,
      "color-picker": 1,
      loading: 1,
      menu: 1,
      "menu-alt": 1,
      filter: 1,
      "filter-add": 1,
      columns: 1,
      maximize: 1,
      minimize: 1,
      copy: 1,
      cut: 1,
      paste: 1,
      grip: 1,
      save: 1,
      csv: 1,
      excel: 1,
      "small-down": 1,
      "small-left": 1,
      "small-right": 1,
      "small-up": 1,
      asc: 1,
      desc: 1,
      none: 1,
      up: 1,
      down: 1,
      plus: 1,
      minus: 1,
      settings: 1,
      "checkbox-checked": 1,
      "checkbox-indeterminate": 1,
      "checkbox-unchecked": 1,
      "radio-button-on": 1,
      "radio-button-off": 1,
      eye: 1,
      "column-arrow": 1,
      "un-pin": 1,
      "pinned-top": 1,
      "pinned-bottom": 1,
      "chevron-up": 1,
      "chevron-down": 1,
      "chevron-left": 1,
      "chevron-right": 1,
      edit: 1
    };
    var ICON_MODULES = {
      chart: "MenuCore",
      cancel: "EnterpriseCore",
      first: "Pagination",
      previous: "Pagination",
      next: "Pagination",
      last: "Pagination",
      linked: "IntegratedCharts",
      loadingMenuItems: "MenuCore",
      unlinked: "IntegratedCharts",
      menu: "ColumnHeaderComp",
      legacyMenu: "ColumnMenu",
      filter: "ColumnFilter",
      filterActive: "ColumnFilter",
      filterAdd: "NewFiltersToolPanel",
      filterCardCollapse: "NewFiltersToolPanel",
      filterCardExpand: "NewFiltersToolPanel",
      filterCardEditing: "NewFiltersToolPanel",
      filterTab: "ColumnMenu",
      filtersToolPanel: "FiltersToolPanel",
      columns: ["MenuCore"],
      columnsToolPanel: ["ColumnsToolPanel"],
      maximize: "EnterpriseCore",
      minimize: "EnterpriseCore",
      save: "MenuCore",
      columnGroupOpened: "ColumnGroupHeaderComp",
      columnGroupClosed: "ColumnGroupHeaderComp",
      accordionOpen: "EnterpriseCore",
      accordionClosed: "EnterpriseCore",
      accordionIndeterminate: "EnterpriseCore",
      columnSelectClosed: ["ColumnsToolPanel", "ColumnMenu"],
      columnSelectOpen: ["ColumnsToolPanel", "ColumnMenu"],
      columnSelectIndeterminate: ["ColumnsToolPanel", "ColumnMenu"],
      columnMovePin: "SharedDragAndDrop",
      columnMoveHide: "SharedDragAndDrop",
      columnMoveMove: "SharedDragAndDrop",
      columnMoveLeft: "SharedDragAndDrop",
      columnMoveRight: "SharedDragAndDrop",
      columnMoveGroup: "SharedDragAndDrop",
      columnMoveValue: "SharedDragAndDrop",
      columnMovePivot: "SharedDragAndDrop",
      dropNotAllowed: "SharedDragAndDrop",
      ensureColumnVisible: ["ColumnsToolPanel", "ColumnMenu"],
      groupContracted: "GroupCellRenderer",
      groupExpanded: "GroupCellRenderer",
      setFilterGroupClosed: "SetFilter",
      setFilterGroupOpen: "SetFilter",
      setFilterGroupIndeterminate: "SetFilter",
      setFilterLoading: "SetFilter",
      close: "EnterpriseCore",
      check: "MenuItem",
      colorPicker: "CommunityCore",
      groupLoading: "LoadingCellRenderer",
      menuAlt: "ColumnHeaderComp",
      menuPin: "MenuCore",
      menuValue: "MenuCore",
      menuAddRowGroup: ["MenuCore", "ColumnsToolPanel"],
      menuRemoveRowGroup: ["MenuCore", "ColumnsToolPanel"],
      clipboardCopy: "MenuCore",
      clipboardCut: "MenuCore",
      clipboardPaste: "MenuCore",
      pivotPanel: ["ColumnsToolPanel", "RowGroupingPanel"],
      rowGroupPanel: ["ColumnsToolPanel", "RowGroupingPanel"],
      valuePanel: "ColumnsToolPanel",
      columnDrag: "EnterpriseCore",
      rowDrag: ["RowDrag", "DragAndDrop"],
      csvExport: "MenuCore",
      excelExport: "MenuCore",
      smallDown: "CommunityCore",
      selectOpen: "CommunityCore",
      richSelectOpen: "RichSelect",
      richSelectRemove: "RichSelect",
      smallLeft: "CommunityCore",
      smallRight: "CommunityCore",
      subMenuOpen: "MenuItem",
      subMenuOpenRtl: "MenuItem",
      panelDelimiter: "RowGroupingPanel",
      panelDelimiterRtl: "RowGroupingPanel",
      smallUp: "CommunityCore",
      sortAscending: ["MenuCore", "Sort"],
      sortDescending: ["MenuCore", "Sort"],
      sortUnSort: ["MenuCore", "Sort"],
      advancedFilterBuilder: "AdvancedFilter",
      advancedFilterBuilderDrag: "AdvancedFilter",
      advancedFilterBuilderInvalid: "AdvancedFilter",
      advancedFilterBuilderMoveUp: "AdvancedFilter",
      advancedFilterBuilderMoveDown: "AdvancedFilter",
      advancedFilterBuilderAdd: "AdvancedFilter",
      advancedFilterBuilderRemove: "AdvancedFilter",
      advancedFilterBuilderSelectOpen: "AdvancedFilter",
      chartsMenu: "IntegratedCharts",
      chartsMenuEdit: "IntegratedCharts",
      chartsMenuAdvancedSettings: "IntegratedCharts",
      chartsMenuAdd: "IntegratedCharts",
      chartsColorPicker: "IntegratedCharts",
      chartsThemePrevious: "IntegratedCharts",
      chartsThemeNext: "IntegratedCharts",
      chartsDownload: "IntegratedCharts",
      checkboxChecked: "CommunityCore",
      checkboxIndeterminate: "CommunityCore",
      checkboxUnchecked: "CommunityCore",
      radioButtonOn: "CommunityCore",
      radioButtonOff: "CommunityCore",
      rowPin: "PinnedRow",
      rowUnpin: "PinnedRow",
      rowPinBottom: "PinnedRow",
      rowPinTop: "PinnedRow"
    };
    var DEPRECATED_ICONS_V33 = /* @__PURE__ */ new Set([
      "colorPicker",
      "smallUp",
      "checkboxChecked",
      "checkboxIndeterminate",
      "checkboxUnchecked",
      "radioButtonOn",
      "radioButtonOff",
      "smallDown",
      "smallLeft",
      "smallRight"
    ]);
    var ValidationService = class extends BeanStub {
      constructor() {
        super(...arguments);
        this.beanName = "validation";
      }
      wireBeans(beans) {
        this.gridOptions = beans.gridOptions;
        provideValidationServiceLogger(getError);
      }
      warnOnInitialPropertyUpdate(source2, key2) {
        if (source2 === "api" && INITIAL_GRID_OPTION_KEYS[key2]) {
          _warn(22, { key: key2 });
        }
      }
      processGridOptions(options2) {
        this.processOptions(options2, GRID_OPTIONS_VALIDATORS());
      }
      validateApiFunction(functionName, apiFunction) {
        return validateApiFunction(functionName, apiFunction, this.beans);
      }
      missingUserComponent(propertyName2, componentName, agGridDefaults, jsComps) {
        const moduleForComponent = USER_COMP_MODULES[componentName];
        if (moduleForComponent) {
          this.gos.assertModuleRegistered(
            moduleForComponent,
            `AG Grid '${propertyName2}' component: ${componentName}`
          );
        } else {
          _warn(101, {
            propertyName: propertyName2,
            componentName,
            agGridDefaults,
            jsComps
          });
        }
      }
      missingDynamicBean(beanName) {
        const moduleName = DYNAMIC_BEAN_MODULES[beanName];
        return moduleName ? _errMsg(200, {
          ...this.gos.getModuleErrorParams(),
          moduleName,
          reasonOrId: beanName
        }) : void 0;
      }
      checkRowEvents(eventType) {
        if (DEPRECATED_ROW_NODE_EVENTS.has(eventType)) {
          _warn(10, { eventType });
        }
      }
      validateIcon(iconName) {
        if (DEPRECATED_ICONS_V33.has(iconName)) {
          _warn(43, { iconName });
        }
        if (ICON_VALUES[iconName]) {
          return;
        }
        const moduleName = ICON_MODULES[iconName];
        if (moduleName) {
          _error(200, {
            reasonOrId: `icon '${iconName}'`,
            moduleName,
            gridScoped: _areModulesGridScoped(),
            gridId: this.beans.context.getId(),
            rowModelType: this.gos.get("rowModelType"),
            additionalText: "Alternatively, use the CSS icon name directly."
          });
          return;
        }
        _warn(134, { iconName });
      }
      isProvidedUserComp(compName) {
        return !!USER_COMP_MODULES[compName];
      }
      /** Should only be called via the GridOptionsService */
      validateColDef(colDef) {
        this.processOptions(colDef, COL_DEF_VALIDATORS());
      }
      processOptions(options2, validator) {
        const { validations, deprecations, allProperties, propertyExceptions, objectName, docsUrl } = validator;
        if (allProperties && this.gridOptions.suppressPropertyNamesCheck !== true) {
          this.checkProperties(
            options2,
            [...propertyExceptions ?? [], ...Object.keys(deprecations)],
            allProperties,
            objectName,
            docsUrl
          );
        }
        const warnings = /* @__PURE__ */ new Set();
        const optionKeys = Object.keys(options2);
        optionKeys.forEach((key2) => {
          const deprecation = deprecations[key2];
          if (deprecation) {
            const { message: message2, version: version2 } = deprecation;
            warnings.add(`As of v${version2}, ${String(key2)} is deprecated. ${message2 ?? ""}`);
          }
          const value2 = options2[key2];
          if (value2 == null || value2 === false) {
            return;
          }
          const rules = validations[key2];
          if (!rules) {
            return;
          }
          const { dependencies, validate, supportedRowModels, expectedType } = rules;
          if (expectedType) {
            const actualType = typeof value2;
            if (actualType !== expectedType) {
              warnings.add(
                `${String(key2)} should be of type '${expectedType}' but received '${actualType}' (${value2}).`
              );
              return;
            }
          }
          if (supportedRowModels) {
            const rowModel = this.gridOptions.rowModelType ?? "clientSide";
            if (!supportedRowModels.includes(rowModel)) {
              warnings.add(
                `${String(key2)} is not supported with the '${rowModel}' row model. It is only valid with: ${supportedRowModels.join(", ")}.`
              );
              return;
            }
          }
          if (dependencies) {
            const warning2 = this.checkForRequiredDependencies(key2, dependencies, options2);
            if (warning2) {
              warnings.add(warning2);
              return;
            }
          }
          if (validate) {
            const warning2 = validate(options2, this.gridOptions, this.beans);
            if (warning2) {
              warnings.add(warning2);
              return;
            }
          }
        });
        if (warnings.size > 0) {
          for (const warning2 of warnings) {
            _warnOnce(warning2);
          }
        }
      }
      checkForRequiredDependencies(key2, validator, options2) {
        const optionEntries = Object.entries(validator);
        const failedOptions = optionEntries.filter(([key22, value2]) => {
          const gridOptionValue = options2[key22];
          return !value2.required.includes(gridOptionValue);
        });
        if (failedOptions.length === 0) {
          return null;
        }
        return failedOptions.map(
          ([failedKey, possibleOptions]) => `'${String(key2)}' requires '${failedKey}' to be one of [${possibleOptions.required.map((o) => {
            if (o === null) {
              return "null";
            } else if (o === void 0) {
              return "undefined";
            }
            return o;
          }).join(", ")}]. ${possibleOptions.reason ?? ""}`
        ).join("\n           ");
      }
      checkProperties(object, exceptions, validProperties, containerName, docsUrl) {
        const VUE_FRAMEWORK_PROPS = ["__ob__", "__v_skip", "__metadata__"];
        const invalidProperties = _fuzzyCheckStrings(
          Object.getOwnPropertyNames(object),
          [...VUE_FRAMEWORK_PROPS, ...exceptions, ...validProperties],
          validProperties
        );
        const invalidPropertiesKeys = Object.keys(invalidProperties);
        for (const key2 of invalidPropertiesKeys) {
          const value2 = invalidProperties[key2];
          let message2 = `invalid ${containerName} property '${key2}' did you mean any of these: ${value2.slice(0, 8).join(", ")}.`;
          if (validProperties.includes("context")) {
            message2 += `
If you are trying to annotate ${containerName} with application data, use the '${containerName}.context' property instead.`;
          }
          _warnOnce(message2);
        }
        if (invalidPropertiesKeys.length > 0 && docsUrl) {
          const url = this.beans.frameworkOverrides.getDocLink(docsUrl);
          _warnOnce(`to see all the valid ${containerName} properties please check: ${url}`);
        }
      }
    };
    function _fuzzyCheckStrings(inputValues, validValues, allSuggestions) {
      const fuzzyMatches = {};
      const invalidInputs = inputValues.filter(
        (inputValue) => !validValues.some((validValue) => validValue === inputValue)
      );
      if (invalidInputs.length > 0) {
        for (const invalidInput of invalidInputs) {
          fuzzyMatches[invalidInput] = _fuzzySuggestions({ inputValue: invalidInput, allSuggestions }).values;
        }
      }
      return fuzzyMatches;
    }
    var DEPRECATED_ROW_NODE_EVENTS = /* @__PURE__ */ new Set([
      "firstChildChanged",
      "lastChildChanged",
      "childIndexChanged"
    ]);
    var ValidationModule = {
      moduleName: "Validation",
      version: VERSION,
      beans: [ValidationService]
    };
    function updateRowNodeAfterFilter(rowNode) {
      const sibling = rowNode.sibling;
      if (sibling) {
        sibling.childrenAfterFilter = rowNode.childrenAfterFilter;
      }
    }
    var FilterStage = class extends BeanStub {
      constructor() {
        super(...arguments);
        this.beanName = "filterStage";
        this.step = "filter";
        this.refreshProps = ["excludeChildrenWhenTreeDataFiltering"];
      }
      wireBeans(beans) {
        this.filterManager = beans.filterManager;
      }
      execute(params) {
        const { changedPath } = params;
        this.filter(changedPath);
      }
      filter(changedPath) {
        const filterActive = !!this.filterManager?.isChildFilterPresent();
        this.filterNodes(filterActive, changedPath);
      }
      filterNodes(filterActive, changedPath) {
        const filterCallback = (rowNode, includeChildNodes) => {
          if (rowNode.hasChildren()) {
            if (filterActive && !includeChildNodes) {
              rowNode.childrenAfterFilter = rowNode.childrenAfterGroup.filter((childNode) => {
                const passBecauseChildren = childNode.childrenAfterFilter && childNode.childrenAfterFilter.length > 0;
                const passBecauseDataPasses = childNode.data && this.filterManager.doesRowPassFilter({ rowNode: childNode });
                return passBecauseChildren || passBecauseDataPasses;
              });
            } else {
              rowNode.childrenAfterFilter = rowNode.childrenAfterGroup;
            }
          } else {
            rowNode.childrenAfterFilter = rowNode.childrenAfterGroup;
          }
          updateRowNodeAfterFilter(rowNode);
        };
        if (this.doingTreeDataFiltering()) {
          const treeDataDepthFirstFilter = (rowNode, alreadyFoundInParent) => {
            if (rowNode.childrenAfterGroup) {
              for (let i2 = 0; i2 < rowNode.childrenAfterGroup.length; i2++) {
                const childNode = rowNode.childrenAfterGroup[i2];
                const foundInParent = alreadyFoundInParent || this.filterManager.doesRowPassFilter({ rowNode: childNode });
                if (childNode.childrenAfterGroup) {
                  treeDataDepthFirstFilter(rowNode.childrenAfterGroup[i2], foundInParent);
                } else {
                  filterCallback(childNode, foundInParent);
                }
              }
            }
            filterCallback(rowNode, alreadyFoundInParent);
          };
          const treeDataFilterCallback = (rowNode) => treeDataDepthFirstFilter(rowNode, false);
          changedPath.executeFromRootNode(treeDataFilterCallback);
        } else {
          const defaultFilterCallback = (rowNode) => filterCallback(rowNode, false);
          changedPath.forEachChangedNodeDepthFirst(defaultFilterCallback, true);
        }
      }
      doingTreeDataFiltering() {
        return this.gos.get("treeData") && !this.gos.get("excludeChildrenWhenTreeDataFiltering");
      }
    };
    var HeaderFilterCellCtrl = class extends AbstractHeaderCellCtrl {
      constructor() {
        super(...arguments);
        this.iconCreated = false;
      }
      wireComp(comp2, eGui, eButtonShowMainFilter, eFloatingFilterBody, compBeanInput) {
        this.comp = comp2;
        const compBean = setupCompBean(this, this.beans.context, compBeanInput);
        this.eButtonShowMainFilter = eButtonShowMainFilter;
        this.eFloatingFilterBody = eFloatingFilterBody;
        this.setGui(eGui, compBean);
        this.setupActive();
        this.refreshHeaderStyles();
        this.setupWidth(compBean);
        this.setupLeft(compBean);
        this.setupHover(compBean);
        this.setupFocus(compBean);
        this.setupAria();
        this.setupFilterButton();
        this.setupUserComp();
        this.setupSyncWithFilter(compBean);
        this.setupUi();
        compBean.addManagedElementListeners(this.eButtonShowMainFilter, { click: this.showParentFilter.bind(this) });
        this.setupFilterChangedListener(compBean);
        const colDefChanged = () => this.onColDefChanged(compBean);
        compBean.addManagedListeners(this.column, { colDefChanged });
        compBean.addManagedEventListeners({
          filterSwitched: ({ column: column2 }) => {
            if (column2 === this.column) {
              colDefChanged();
            }
          }
        });
        compBean.addDestroyFunc(() => {
          this.eButtonShowMainFilter = null;
          this.eFloatingFilterBody = null;
          this.userCompDetails = null;
          this.clearComponent();
        });
      }
      // empty abstract method
      resizeHeader() {
      }
      moveHeader() {
      }
      getHeaderClassParams() {
        const { column: column2, beans } = this;
        const colDef = column2.colDef;
        return _addGridCommonParams(beans.gos, {
          colDef,
          column: column2,
          floatingFilter: true
        });
      }
      setupActive() {
        const colDef = this.column.getColDef();
        const filterExists = !!colDef.filter;
        const floatingFilterExists = !!colDef.floatingFilter;
        this.active = filterExists && floatingFilterExists;
      }
      setupUi() {
        this.comp.setButtonWrapperDisplayed(!this.suppressFilterButton && this.active);
        this.comp.addOrRemoveBodyCssClass("ag-floating-filter-full-body", this.suppressFilterButton);
        this.comp.addOrRemoveBodyCssClass("ag-floating-filter-body", !this.suppressFilterButton);
        if (!this.active || this.iconCreated) {
          return;
        }
        const eMenuIcon = _createIconNoSpan("filter", this.beans, this.column);
        if (eMenuIcon) {
          this.iconCreated = true;
          this.eButtonShowMainFilter.appendChild(eMenuIcon);
        }
      }
      setupFocus(compBean) {
        compBean.createManagedBean(
          new ManagedFocusFeature(this.eGui, {
            shouldStopEventPropagation: this.shouldStopEventPropagation.bind(this),
            onTabKeyDown: this.onTabKeyDown.bind(this),
            handleKeyDown: this.handleKeyDown.bind(this),
            onFocusIn: this.onFocusIn.bind(this)
          })
        );
      }
      setupAria() {
        const localeTextFunc = this.getLocaleTextFunc();
        _setAriaLabel(this.eButtonShowMainFilter, localeTextFunc("ariaFilterMenuOpen", "Open Filter Menu"));
      }
      onTabKeyDown(e) {
        const { beans } = this;
        const activeEl = _getActiveDomElement(beans);
        const wrapperHasFocus = activeEl === this.eGui;
        if (wrapperHasFocus) {
          return;
        }
        const nextFocusableEl = _findNextFocusableElement(beans, this.eGui, null, e.shiftKey);
        if (nextFocusableEl) {
          beans.headerNavigation?.scrollToColumn(this.column);
          e.preventDefault();
          nextFocusableEl.focus();
          return;
        }
        const nextFocusableColumn = this.findNextColumnWithFloatingFilter(e.shiftKey);
        if (!nextFocusableColumn) {
          return;
        }
        if (beans.focusSvc.focusHeaderPosition({
          headerPosition: {
            headerRowIndex: this.rowCtrl.rowIndex,
            column: nextFocusableColumn
          },
          event: e
        })) {
          e.preventDefault();
        }
      }
      findNextColumnWithFloatingFilter(backwards) {
        const presentedColsService = this.beans.visibleCols;
        let nextCol = this.column;
        do {
          nextCol = backwards ? presentedColsService.getColBefore(nextCol) : presentedColsService.getColAfter(nextCol);
          if (!nextCol) {
            break;
          }
        } while (!nextCol.getColDef().filter || !nextCol.getColDef().floatingFilter);
        return nextCol;
      }
      handleKeyDown(e) {
        super.handleKeyDown(e);
        const wrapperHasFocus = this.getWrapperHasFocus();
        switch (e.key) {
          case KeyCode.UP:
          case KeyCode.DOWN:
          case KeyCode.LEFT:
          case KeyCode.RIGHT:
            if (wrapperHasFocus) {
              return;
            }
            _stopPropagationForAgGrid(e);
          case KeyCode.ENTER:
            if (wrapperHasFocus) {
              if (_focusInto(this.eGui)) {
                e.preventDefault();
              }
            }
            break;
          case KeyCode.ESCAPE:
            if (!wrapperHasFocus) {
              this.eGui.focus();
            }
        }
      }
      onFocusIn(e) {
        const isRelatedWithin = this.eGui.contains(e.relatedTarget);
        if (isRelatedWithin) {
          return;
        }
        const notFromHeaderWrapper = !!e.relatedTarget && !e.relatedTarget.classList.contains("ag-floating-filter");
        const fromWithinHeader = !!e.relatedTarget && _isElementChildOfClass(e.relatedTarget, "ag-floating-filter");
        if (notFromHeaderWrapper && fromWithinHeader && e.target === this.eGui) {
          const lastFocusEvent = this.lastFocusEvent;
          const fromTab = !!(lastFocusEvent && lastFocusEvent.key === KeyCode.TAB);
          if (lastFocusEvent && fromTab) {
            const shouldFocusLast = lastFocusEvent.shiftKey;
            _focusInto(this.eGui, shouldFocusLast);
          }
        }
        this.focusThis();
      }
      setupHover(compBean) {
        this.beans.colHover?.addHeaderFilterColumnHoverListener(compBean, this.comp, this.column, this.eGui);
      }
      setupLeft(compBean) {
        const setLeftFeature = new SetLeftFeature(this.column, this.eGui, this.beans);
        compBean.createManagedBean(setLeftFeature);
      }
      setupFilterButton() {
        this.suppressFilterButton = !this.beans.menuSvc?.isFloatingFilterButtonEnabled(this.column);
        this.highlightFilterButtonWhenActive = !_isLegacyMenuEnabled(this.gos);
      }
      setupUserComp() {
        if (!this.active) {
          return;
        }
        const compDetails = this.beans.colFilter?.getFloatingFilterCompDetails(
          this.column,
          () => this.showParentFilter()
        );
        if (compDetails) {
          this.setCompDetails(compDetails);
        }
      }
      setCompDetails(compDetails) {
        this.userCompDetails = compDetails;
        this.comp.setCompDetails(compDetails);
      }
      showParentFilter() {
        const eventSource = this.suppressFilterButton ? this.eFloatingFilterBody : this.eButtonShowMainFilter;
        this.beans.menuSvc?.showFilterMenu({
          column: this.column,
          buttonElement: eventSource,
          containerType: "floatingFilter",
          positionBy: "button"
        });
      }
      setupSyncWithFilter(compBean) {
        if (!this.active) {
          return;
        }
        const {
          beans: { colFilter },
          column: column2,
          gos
        } = this;
        const syncWithFilter = (event) => {
          if (event?.source === "filterDestroyed" && (!this.isAlive() || !colFilter?.isAlive())) {
            return;
          }
          const compPromise = this.comp.getFloatingFilterComp();
          if (!compPromise) {
            return;
          }
          compPromise.then((comp2) => {
            if (comp2) {
              if (gos.get("enableFilterHandlers")) {
                const eventWithParams = event;
                let source2 = "filter";
                if (eventWithParams?.afterFloatingFilter) {
                  source2 = "ui";
                } else if (eventWithParams?.afterDataChange) {
                  source2 = "dataChanged";
                } else if (event?.source === "api") {
                  source2 = "api";
                }
                this.updateFloatingFilterParams(this.userCompDetails, source2);
                return;
              }
              const parentModel = colFilter?.getCurrentFloatingFilterParentModel(column2);
              const filterChangedEvent = event ? {
                // event can have additional params like `afterDataChange` which need to be passed through
                ...event,
                columns: event.columns ?? [],
                source: event.source === "api" ? "api" : "columnFilter"
              } : null;
              comp2.onParentModelChanged(parentModel, filterChangedEvent);
            }
          });
        };
        [this.destroySyncListener] = compBean.addManagedListeners(column2, { filterChanged: syncWithFilter });
        if (colFilter?.isFilterActive(column2)) {
          syncWithFilter(null);
        }
      }
      setupWidth(compBean) {
        const listener = () => {
          const width = `${this.column.getActualWidth()}px`;
          this.comp.setWidth(width);
        };
        compBean.addManagedListeners(this.column, { widthChanged: listener });
        listener();
      }
      setupFilterChangedListener(compBean) {
        if (this.active) {
          [this.destroyFilterChangedListener] = compBean.addManagedListeners(this.column, {
            filterChanged: this.updateFilterButton.bind(this)
          });
          this.updateFilterButton();
        }
      }
      updateFilterButton() {
        if (!this.suppressFilterButton && this.comp) {
          const isFilterAllowed = !!this.beans.filterManager?.isFilterAllowed(this.column);
          this.comp.setButtonWrapperDisplayed(isFilterAllowed);
          if (this.highlightFilterButtonWhenActive && isFilterAllowed) {
            this.eButtonShowMainFilter.classList.toggle("ag-filter-active", this.column.isFilterActive());
          }
        }
      }
      onColDefChanged(compBean) {
        const wasActive = this.active;
        this.setupActive();
        const becomeActive = !wasActive && this.active;
        if (wasActive && !this.active) {
          this.destroySyncListener();
          this.destroyFilterChangedListener();
        }
        const colFilter = this.beans.colFilter;
        const newCompDetails = this.active ? colFilter?.getFloatingFilterCompDetails(this.column, () => this.showParentFilter()) : null;
        const compPromise = this.comp.getFloatingFilterComp();
        if (!compPromise || !newCompDetails) {
          this.updateCompDetails(compBean, newCompDetails, becomeActive);
        } else {
          compPromise.then((compInstance) => {
            if (!compInstance || colFilter?.areFilterCompsDifferent(this.userCompDetails ?? null, newCompDetails)) {
              this.updateCompDetails(compBean, newCompDetails, becomeActive);
            } else {
              this.updateFloatingFilterParams(newCompDetails, "colDef");
            }
          });
        }
      }
      updateCompDetails(compBean, compDetails, becomeActive) {
        if (!this.isAlive()) {
          return;
        }
        this.setCompDetails(compDetails);
        this.setupFilterButton();
        this.setupUi();
        if (becomeActive) {
          this.setupSyncWithFilter(compBean);
          this.setupFilterChangedListener(compBean);
        }
      }
      updateFloatingFilterParams(userCompDetails, source2) {
        if (!userCompDetails) {
          return;
        }
        let params = userCompDetails.params;
        this.comp.getFloatingFilterComp()?.then((floatingFilter) => {
          if (typeof floatingFilter?.refresh === "function") {
            if (this.gos.get("enableFilterHandlers")) {
              params = {
                ...params,
                model: _getFilterModel(this.beans.colFilter?.model ?? {}, this.column.getColId()),
                source: source2
              };
            }
            floatingFilter.refresh(params);
          }
        });
      }
      addResizeAndMoveKeyboardListeners() {
      }
      destroy() {
        super.destroy();
        this.destroySyncListener = null;
        this.destroyFilterChangedListener = null;
      }
    };
    function showColumnMenu(beans, colKey) {
      const column2 = beans.colModel.getCol(colKey);
      if (!column2) {
        _error(12, { colKey });
        return;
      }
      beans.menuSvc?.showColumnMenu({
        column: column2,
        positionBy: "auto"
      });
    }
    function hidePopupMenu(beans) {
      beans.menuSvc?.hidePopupMenu();
    }
    var SharedMenuModule = {
      moduleName: "SharedMenu",
      version: VERSION,
      beans: [MenuService],
      apiFunctions: {
        showColumnMenu,
        hidePopupMenu
      }
    };
    var PopupService = class extends BasePopupService {
      postConstruct() {
        this.beans.ctrlsSvc.whenReady(this, (p) => {
          this.gridCtrl = p.gridCtrl;
        });
        this.addManagedEventListeners({ gridStylesChanged: this.handleThemeChange.bind(this) });
      }
      getDefaultPopupParent() {
        return this.gridCtrl.getGui();
      }
      positionPopupForMenu(params) {
        const { eventSource, ePopup, event } = params;
        const sourceRect = eventSource.getBoundingClientRect();
        const parentRect = this.getParentRect();
        this.setAlignedTo(eventSource, ePopup);
        let minWidthSet = false;
        const updatePosition = () => {
          const y = this.keepXYWithinBounds(
            ePopup,
            sourceRect.top - parentRect.top,
            0
            /* Vertical */
          );
          const minWidth = ePopup.clientWidth > 0 ? ePopup.clientWidth : 200;
          if (!minWidthSet) {
            ePopup.style.minWidth = `${minWidth}px`;
            minWidthSet = true;
          }
          const widthOfParent = parentRect.right - parentRect.left;
          const maxX = widthOfParent - minWidth;
          let x2;
          if (this.gos.get("enableRtl")) {
            x2 = xLeftPosition();
            if (x2 < 0) {
              x2 = xRightPosition();
              this.setAlignedStyles(ePopup, "left");
            }
            if (x2 > maxX) {
              x2 = 0;
              this.setAlignedStyles(ePopup, "right");
            }
          } else {
            x2 = xRightPosition();
            if (x2 > maxX) {
              x2 = xLeftPosition();
              this.setAlignedStyles(ePopup, "right");
            }
            if (x2 < 0) {
              x2 = 0;
              this.setAlignedStyles(ePopup, "left");
            }
          }
          return { x: x2, y };
          function xRightPosition() {
            return sourceRect.right - parentRect.left - 2;
          }
          function xLeftPosition() {
            return sourceRect.left - parentRect.left - minWidth;
          }
        };
        this.positionPopup({
          ePopup,
          keepWithinBounds: true,
          updatePosition,
          postProcessCallback: () => this.callPostProcessPopup(
            params,
            "subMenu",
            ePopup,
            eventSource,
            event instanceof MouseEvent ? event : void 0
          )
        });
      }
      callPostProcessPopup(params, type, ePopup, eventSource, mouseEvent) {
        const callback = this.gos.getCallback("postProcessPopup");
        if (callback) {
          const { column: column2, rowNode } = params;
          const postProcessParams = {
            column: column2,
            rowNode,
            ePopup,
            type,
            eventSource,
            mouseEvent
          };
          callback(postProcessParams);
        }
      }
      getActivePopups() {
        return this.popupList.map((popup) => popup.element);
      }
      handleThemeChange(e) {
        if (e.themeChanged) {
          const environment = this.beans.environment;
          for (const popup of this.popupList) {
            environment.applyThemeClasses(popup.wrapper);
          }
        }
      }
      hasAnchoredPopup() {
        return this.popupList.some((popup) => popup.isAnchored);
      }
      isStopPropagation(event) {
        return _isStopPropagationForAgGrid(event);
      }
    };
    var PopupModule = {
      moduleName: "Popup",
      version: VERSION,
      beans: [PopupService]
    };
    var columnFiltersCSS = (
      /*css*/
      `.ag-set-filter{--ag-indentation-level:0}.ag-set-filter-item{align-items:center;display:flex;height:100%}:where(.ag-ltr) .ag-set-filter-item{padding-left:calc(var(--ag-widget-container-horizontal-padding) + var(--ag-indentation-level)*var(--ag-set-filter-indent-size))}:where(.ag-rtl) .ag-set-filter-item{padding-right:calc(var(--ag-widget-container-horizontal-padding) + var(--ag-indentation-level)*var(--ag-set-filter-indent-size))}.ag-set-filter-item-checkbox{display:flex;height:100%;width:100%}.ag-set-filter-group-icons{display:block;>*{cursor:pointer}}:where(.ag-ltr) .ag-set-filter-group-icons{margin-right:var(--ag-widget-container-horizontal-padding)}:where(.ag-rtl) .ag-set-filter-group-icons{margin-left:var(--ag-widget-container-horizontal-padding)}.ag-filter-body-wrapper{display:flex;flex-direction:column}:where(.ag-menu:not(.ag-tabs) .ag-filter) .ag-filter-body-wrapper,:where(.ag-menu:not(.ag-tabs) .ag-filter)>:not(.ag-filter-wrapper){min-width:180px}.ag-filter-filter{flex:1 1 0px}.ag-filter-condition{display:flex;justify-content:center}.ag-floating-filter-body{display:flex;flex:1 1 auto;height:100%;position:relative}.ag-floating-filter-full-body{align-items:center;display:flex;flex:1 1 auto;height:100%;overflow:hidden;width:100%}:where(.ag-floating-filter-full-body)>div{flex:1 1 auto}.ag-floating-filter-input{align-items:center;display:flex;width:100%;>*{flex:1 1 auto}:where(.ag-input-field-input[type=date]),:where(.ag-input-field-input[type=datetime-local]){width:1px}}.ag-floating-filter-button{display:flex;flex:none}.ag-date-floating-filter-wrapper{display:flex}.ag-set-floating-filter-input :where(input)[disabled]{pointer-events:none}.ag-floating-filter-button-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;height:var(--ag-icon-size);width:var(--ag-icon-size)}.ag-filter-loading{align-items:unset;background-color:var(--ag-chrome-background-color);height:100%;padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding);position:absolute;width:100%;z-index:1;:where(.ag-menu) &{background-color:var(--ag-menu-background-color)}}.ag-filter-separator{border-top:solid var(--ag-border-width) var(--menu-separator-color)}:where(.ag-filter-select) .ag-picker-field-wrapper{width:0}.ag-filter-condition-operator{height:17px}:where(.ag-ltr) .ag-filter-condition-operator-or{margin-left:calc(var(--ag-spacing)*2)}:where(.ag-rtl) .ag-filter-condition-operator-or{margin-right:calc(var(--ag-spacing)*2)}.ag-set-filter-select-all{padding-top:var(--ag-widget-container-vertical-padding)}.ag-filter-no-matches,.ag-set-filter-list{height:calc(var(--ag-list-item-height)*6)}.ag-filter-no-matches{padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding)}.ag-set-filter-tree-list{height:calc(var(--ag-list-item-height)*10)}.ag-set-filter-filter{margin-left:var(--ag-widget-container-horizontal-padding);margin-right:var(--ag-widget-container-horizontal-padding);margin-top:var(--ag-widget-container-vertical-padding)}.ag-filter-to{margin-top:var(--ag-widget-vertical-spacing)}.ag-mini-filter{margin:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding)}:where(.ag-ltr) .ag-set-filter-add-group-indent{margin-left:calc(var(--ag-icon-size) + var(--ag-widget-container-horizontal-padding))}:where(.ag-rtl) .ag-set-filter-add-group-indent{margin-right:calc(var(--ag-icon-size) + var(--ag-widget-container-horizontal-padding))}:where(.ag-filter-menu) .ag-set-filter-list{min-width:200px}.ag-filter-virtual-list-item:focus-visible{box-shadow:inset var(--ag-focus-shadow)}.ag-filter-apply-panel{display:flex;justify-content:flex-end;overflow:hidden;padding:var(--ag-widget-vertical-spacing) var(--ag-widget-container-horizontal-padding) var(--ag-widget-container-vertical-padding)}.ag-filter-apply-panel-button{line-height:1.5}:where(.ag-ltr) .ag-filter-apply-panel-button{margin-left:calc(var(--ag-spacing)*2)}:where(.ag-rtl) .ag-filter-apply-panel-button{margin-right:calc(var(--ag-spacing)*2)}.ag-simple-filter-body-wrapper{display:flex;flex-direction:column;min-height:calc(var(--ag-list-item-height) + var(--ag-widget-container-vertical-padding) + var(--ag-widget-vertical-spacing));overflow-y:auto;padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding);padding-bottom:calc(var(--ag-widget-container-vertical-padding) - var(--ag-widget-vertical-spacing));&>*{margin-bottom:var(--ag-widget-vertical-spacing)}:where(.ag-resizer-wrapper){margin:0}}.ag-multi-filter-menu-item{margin:var(--ag-spacing) 0}.ag-multi-filter-group-title-bar{background-color:transparent;color:var(--ag-header-text-color);font-weight:500;padding:calc(var(--ag-spacing)*1.5) var(--ag-spacing)}.ag-group-filter-field-select-wrapper{display:flex;flex-direction:column;gap:var(--ag-widget-vertical-spacing);padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding)}`
    );
    function isColumnFilterPresent(beans) {
      const filterManager = beans.filterManager;
      return !!filterManager?.isColumnFilterPresent() || !!filterManager?.isAggregateFilterPresent();
    }
    function getColumnFilterInstance(beans, key2) {
      return beans.filterManager?.getColumnFilterInstance(key2) ?? Promise.resolve(void 0);
    }
    function destroyFilter(beans, key2) {
      const column2 = beans.colModel.getColDefCol(key2);
      if (column2) {
        return beans.colFilter?.destroyFilter(column2, "api");
      }
    }
    function setFilterModel(beans, model2) {
      beans.frameworkOverrides.wrapIncoming(() => beans.filterManager?.setFilterModel(model2));
    }
    function getFilterModel(beans) {
      return beans.filterManager?.getFilterModel() ?? {};
    }
    function getColumnFilterModel(beans, key2, useUnapplied) {
      const { gos, colModel, colFilter } = beans;
      if (useUnapplied && !gos.get("enableFilterHandlers")) {
        _warn(288);
        useUnapplied = false;
      }
      const column2 = colModel.getColDefCol(key2);
      return column2 ? colFilter?.getModelForColumn(column2, useUnapplied) ?? null : null;
    }
    function setColumnFilterModel(beans, column2, model2) {
      return beans.filterManager?.setColumnFilterModel(column2, model2) ?? Promise.resolve();
    }
    function showColumnFilter(beans, colKey) {
      const column2 = beans.colModel.getCol(colKey);
      if (!column2) {
        _error(12, { colKey });
        return;
      }
      beans.menuSvc?.showFilterMenu({
        column: column2,
        containerType: "columnFilter",
        positionBy: "auto"
      });
    }
    function hideColumnFilter(beans) {
      beans.menuSvc?.hideFilterMenu();
    }
    function getColumnFilterHandler(beans, colKey) {
      const column2 = beans.colModel.getCol(colKey);
      if (!column2) {
        _error(12, { colKey });
        return void 0;
      }
      return beans.colFilter?.getHandler(column2, true);
    }
    function doFilterAction(beans, params) {
      const { colModel, colFilter, gos } = beans;
      if (!gos.get("enableFilterHandlers")) {
        _warn(287);
        return;
      }
      const { colId, action } = params;
      if (colId) {
        const column2 = colModel.getColById(colId);
        if (column2) {
          colFilter?.updateModel(column2, action);
        }
      } else {
        colFilter?.updateAllModels(action);
      }
    }
    var DUMMY_HANDLER = {
      filterHandler: () => ({
        doesFilterPass: () => true
      })
    };
    var ColumnFilterService = class extends BeanStub {
      constructor() {
        super(...arguments);
        this.beanName = "colFilter";
        this.allColumnFilters = /* @__PURE__ */ new Map();
        this.allColumnListeners = /* @__PURE__ */ new Map();
        this.activeAggregateFilters = [];
        this.activeColumnFilters = [];
        this.processingFilterChange = false;
        this.modelUpdates = [];
        this.columnModelUpdates = [];
        this.state = /* @__PURE__ */ new Map();
        this.handlerMap = {
          ...FILTER_HANDLER_MAP
        };
        this.isGlobalButtons = false;
        this.activeFilterComps = /* @__PURE__ */ new Set();
      }
      postConstruct() {
        this.addManagedEventListeners({
          gridColumnsChanged: this.onColumnsChanged.bind(this),
          dataTypesInferred: this.processFilterModelUpdateQueue.bind(this)
        });
        const gos = this.gos;
        const initialFilterModel = {
          ...gos.get("initialState")?.filter?.filterModel ?? {}
        };
        this.initialModel = initialFilterModel;
        this.model = {
          ...initialFilterModel
        };
        if (!gos.get("enableFilterHandlers")) {
          delete this.handlerMap["agMultiColumnFilter"];
        }
      }
      refreshModel() {
        this.onNewRowsLoaded("rowDataUpdated");
      }
      setModel(model2, source2 = "api", forceUpdateActive) {
        const { colModel, dataTypeSvc, filterManager } = this.beans;
        if (dataTypeSvc?.isPendingInference) {
          this.modelUpdates.push({ model: model2, source: source2 });
          return;
        }
        const allPromises = [];
        const previousModel = this.getModel(true);
        if (model2) {
          const modelKeys = new Set(Object.keys(model2));
          this.allColumnFilters.forEach((filterWrapper, colId) => {
            const newModel = model2[colId];
            allPromises.push(this.setModelOnFilterWrapper(filterWrapper, newModel));
            modelKeys.delete(colId);
          });
          modelKeys.forEach((colId) => {
            const column2 = colModel.getColDefCol(colId) || colModel.getCol(colId);
            if (!column2) {
              _warn(62, { colId });
              return;
            }
            if (!column2.isFilterAllowed()) {
              _warn(63, { colId });
              return;
            }
            const filterWrapper = this.getOrCreateFilterWrapper(column2, true);
            if (!filterWrapper) {
              _warn(64, { colId });
              return;
            }
            allPromises.push(this.setModelOnFilterWrapper(filterWrapper, model2[colId], true));
          });
        } else {
          this.model = {};
          this.allColumnFilters.forEach((filterWrapper) => {
            allPromises.push(this.setModelOnFilterWrapper(filterWrapper, null));
          });
        }
        AgPromise.all(allPromises).then(() => {
          const currentModel = this.getModel(true);
          const columns = [];
          this.allColumnFilters.forEach((filterWrapper, colId) => {
            const before = previousModel ? previousModel[colId] : null;
            const after = currentModel ? currentModel[colId] : null;
            if (!_jsonEquals(before, after)) {
              columns.push(filterWrapper.column);
            }
          });
          if (columns.length > 0) {
            filterManager?.onFilterChanged({ columns, source: source2 });
          } else if (forceUpdateActive) {
            this.updateActive("filterChanged");
          }
        });
      }
      getModel(excludeInitialState) {
        const result2 = {};
        const {
          allColumnFilters,
          initialModel,
          beans: { colModel }
        } = this;
        allColumnFilters.forEach((filterWrapper, key2) => {
          const model2 = this.getModelFromFilterWrapper(filterWrapper);
          if (_exists(model2)) {
            result2[key2] = model2;
          }
        });
        if (!excludeInitialState) {
          for (const colId of Object.keys(initialModel)) {
            const model2 = initialModel[colId];
            if (_exists(model2) && !allColumnFilters.has(colId) && colModel.getCol(colId)?.isFilterAllowed()) {
              result2[colId] = model2;
            }
          }
        }
        return result2;
      }
      setState(model2, state, source2 = "api") {
        this.state.clear();
        if (state) {
          for (const colId of Object.keys(state)) {
            const newState = state[colId];
            this.state.set(colId, {
              model: _getFilterModel(this.model, colId),
              state: newState
            });
          }
        }
        this.setModel(model2, source2, true);
      }
      getState() {
        const state = this.state;
        if (!state.size) {
          return void 0;
        }
        const newState = {};
        let hasNewState = false;
        state.forEach((colState, colId) => {
          const actualState = colState.state;
          if (actualState != null) {
            hasNewState = true;
            newState[colId] = actualState;
          }
        });
        return hasNewState ? newState : void 0;
      }
      getModelFromFilterWrapper(filterWrapper) {
        const column2 = filterWrapper.column;
        const colId = column2.getColId();
        if (filterWrapper.isHandler) {
          return _getFilterModel(this.model, colId);
        }
        const filter = filterWrapper.filter;
        if (filter) {
          if (typeof filter.getModel !== "function") {
            _warn(66);
            return null;
          }
          return filter.getModel();
        }
        return _getFilterModel(this.initialModel, colId);
      }
      isFilterPresent() {
        return this.activeColumnFilters.length > 0;
      }
      isAggFilterPresent() {
        return !!this.activeAggregateFilters.length;
      }
      disableFilters() {
        this.initialModel = {};
        const { allColumnFilters } = this;
        if (allColumnFilters.size) {
          allColumnFilters.forEach(
            (filterWrapper) => this.disposeFilterWrapper(filterWrapper, "advancedFilterEnabled")
          );
          return true;
        }
        return false;
      }
      updateActiveFilters() {
        const isFilterActive = (filter) => {
          if (!filter) {
            return false;
          }
          if (!filter.isFilterActive) {
            _warn(67);
            return false;
          }
          return filter.isFilterActive();
        };
        const { colModel, gos } = this.beans;
        const groupFilterEnabled = !!_getGroupAggFiltering(gos);
        const isAggFilter = (column2) => {
          const isSecondary = !column2.isPrimary();
          if (isSecondary) {
            return true;
          }
          const isShowingPrimaryColumns = !colModel.isPivotActive();
          const isValueActive = column2.isValueActive();
          if (!isValueActive || !isShowingPrimaryColumns) {
            return false;
          }
          if (colModel.isPivotMode()) {
            return true;
          }
          return groupFilterEnabled;
        };
        const activeAggregateFilters = [];
        const activeColumnFilters = [];
        const addFilter = (column2, filterActive, doesFilterPassWrapper) => {
          if (filterActive) {
            if (isAggFilter(column2)) {
              activeAggregateFilters.push(doesFilterPassWrapper);
            } else {
              activeColumnFilters.push(doesFilterPassWrapper);
            }
          }
        };
        const promises = [];
        this.allColumnFilters.forEach((filterWrapper) => {
          const column2 = filterWrapper.column;
          const colId = column2.getColId();
          if (filterWrapper.isHandler) {
            promises.push(
              AgPromise.resolve().then(() => {
                addFilter(column2, this.isHandlerActive(column2), {
                  colId,
                  isHandler: true,
                  handler: filterWrapper.handler,
                  handlerParams: filterWrapper.handlerParams
                });
              })
            );
          } else {
            const promise = getFilterUiFromWrapper(filterWrapper);
            if (promise) {
              promises.push(
                promise.then((filter) => {
                  addFilter(column2, isFilterActive(filter), {
                    colId,
                    isHandler: false,
                    comp: filter
                  });
                })
              );
            }
          }
        });
        return AgPromise.all(promises).then(() => {
          this.activeAggregateFilters = activeAggregateFilters;
          this.activeColumnFilters = activeColumnFilters;
        });
      }
      updateFilterFlagInColumns(source2, additionalEventAttributes) {
        const promises = [];
        this.allColumnFilters.forEach((filterWrapper) => {
          const column2 = filterWrapper.column;
          if (filterWrapper.isHandler) {
            promises.push(
              AgPromise.resolve().then(() => {
                this.setColFilterActive(
                  column2,
                  this.isHandlerActive(column2),
                  source2,
                  additionalEventAttributes
                );
              })
            );
          } else {
            const promise = getFilterUiFromWrapper(filterWrapper);
            if (promise) {
              promises.push(
                promise.then((filter) => {
                  this.setColFilterActive(
                    column2,
                    filter.isFilterActive(),
                    source2,
                    additionalEventAttributes
                  );
                })
              );
            }
          }
        });
        this.beans.groupFilter?.updateFilterFlags(source2, additionalEventAttributes);
        return AgPromise.all(promises);
      }
      doFiltersPass(node2, colIdToSkip, targetAggregates) {
        const { data, aggData } = node2;
        const targetedFilters = targetAggregates ? this.activeAggregateFilters : this.activeColumnFilters;
        const targetedData = targetAggregates ? aggData : data;
        const model2 = this.model;
        for (let i2 = 0; i2 < targetedFilters.length; i2++) {
          const filter = targetedFilters[i2];
          const { colId, isHandler } = filter;
          if (colId === colIdToSkip) {
            continue;
          }
          if (isHandler) {
            const { handler, handlerParams } = filter;
            if (!handler.doesFilterPass({
              node: node2,
              data: targetedData,
              model: _getFilterModel(model2, colId),
              handlerParams
            })) {
              return false;
            }
          } else {
            const comp2 = filter.comp;
            if (typeof comp2.doesFilterPass !== "function") {
              _error(91);
              continue;
            }
            if (!comp2.doesFilterPass({ node: node2, data: targetedData })) {
              return false;
            }
          }
        }
        return true;
      }
      getHandlerParams(column2) {
        const wrapper2 = this.allColumnFilters.get(column2.getColId());
        return wrapper2?.isHandler ? wrapper2.handlerParams : void 0;
      }
      // sometimes (especially in React) the filter can call onFilterChanged when we are in the middle
      // of a render cycle. this would be bad, so we wait for render cycle to complete when this happens.
      // this happens in react when we change React State in the grid (eg setting RowCtrl's in RowContainer)
      // which results in React State getting applied in the main application, triggering a useEffect() to
      // be kicked off adn then the application calling the grid's API. in AG-6554, the custom filter was
      // getting it's useEffect() triggered in this way.
      callOnFilterChangedOutsideRenderCycle(params) {
        const { rowRenderer, filterManager } = this.beans;
        const action = () => {
          if (this.isAlive()) {
            filterManager?.onFilterChanged(params);
          }
        };
        if (rowRenderer.isRefreshInProgress()) {
          setTimeout(action, 0);
        } else {
          action();
        }
      }
      updateBeforeFilterChanged(params = {}) {
        const { column: column2, additionalEventAttributes } = params;
        const colId = column2?.getColId();
        return this.updateActiveFilters().then(
          () => this.updateFilterFlagInColumns("filterChanged", additionalEventAttributes).then(() => {
            this.allColumnFilters.forEach((filterWrapper) => {
              const { column: filterColumn, isHandler } = filterWrapper;
              if (colId === filterColumn.getColId()) {
                return;
              }
              if (isHandler) {
                filterWrapper.handler.onAnyFilterChanged?.();
              }
              getFilterUiFromWrapper(filterWrapper, isHandler)?.then((filter) => {
                if (typeof filter?.onAnyFilterChanged === "function") {
                  filter.onAnyFilterChanged();
                }
              });
            });
            this.processingFilterChange = true;
          })
        );
      }
      updateAfterFilterChanged() {
        this.processingFilterChange = false;
      }
      isSuppressFlashingCellsBecauseFiltering() {
        const allowShowChangeAfterFilter = this.gos.get("allowShowChangeAfterFilter") ?? false;
        return !allowShowChangeAfterFilter && this.processingFilterChange;
      }
      onNewRowsLoaded(source2) {
        const promises = [];
        this.allColumnFilters.forEach((filterWrapper) => {
          const isHandler = filterWrapper.isHandler;
          if (isHandler) {
            filterWrapper.handler.onNewRowsLoaded?.();
          }
          const promise = getFilterUiFromWrapper(filterWrapper, isHandler);
          if (promise) {
            promises.push(
              promise.then((filter) => {
                filter.onNewRowsLoaded?.();
              })
            );
          }
        });
        AgPromise.all(promises).then(() => this.updateActive(source2, { afterDataChange: true }));
      }
      updateActive(source2, additionalEventAttributes) {
        this.updateFilterFlagInColumns(source2, additionalEventAttributes).then(() => this.updateActiveFilters());
      }
      createGetValue(filterColumn, filterValueGetterOverride) {
        const { filterValueSvc, colModel } = this.beans;
        return (rowNode, column2) => {
          const columnToUse = column2 ? colModel.getCol(column2) : filterColumn;
          return columnToUse ? filterValueSvc.getValue(columnToUse, rowNode, filterValueGetterOverride) : void 0;
        };
      }
      isFilterActive(column2) {
        const filterWrapper = this.cachedFilter(column2);
        if (filterWrapper?.isHandler) {
          return this.isHandlerActive(column2);
        }
        const filter = filterWrapper?.filter;
        if (filter) {
          return filter.isFilterActive();
        }
        return _getFilterModel(this.initialModel, column2.getColId()) != null;
      }
      isHandlerActive(column2) {
        const active = _exists(_getFilterModel(this.model, column2.getColId()));
        if (active) {
          return active;
        }
        const groupFilter = this.beans.groupFilter;
        return groupFilter?.isGroupFilter(column2) ? groupFilter.isFilterActive(column2) : false;
      }
      getOrCreateFilterUi(column2) {
        const filterWrapper = this.getOrCreateFilterWrapper(column2, true);
        return filterWrapper ? getFilterUiFromWrapper(filterWrapper) : null;
      }
      getFilterUiForDisplay(column2) {
        const filterWrapper = this.getOrCreateFilterWrapper(column2, true);
        if (!filterWrapper) {
          return null;
        }
        const compPromise = getFilterUiFromWrapper(filterWrapper);
        if (!compPromise) {
          return null;
        }
        return compPromise.then((comp2) => ({
          comp: comp2,
          params: filterWrapper.filterUi.filterParams,
          isHandler: filterWrapper.isHandler
        }));
      }
      getHandler(column2, createIfMissing) {
        const filterWrapper = this.getOrCreateFilterWrapper(column2, createIfMissing);
        return filterWrapper?.isHandler ? filterWrapper.handler : void 0;
      }
      getOrCreateFilterWrapper(column2, createIfMissing) {
        if (!column2.isFilterAllowed()) {
          return void 0;
        }
        let filterWrapper = this.cachedFilter(column2);
        if (!filterWrapper && createIfMissing) {
          filterWrapper = this.createFilterWrapper(column2);
          this.setColumnFilterWrapper(column2, filterWrapper);
        }
        return filterWrapper;
      }
      cachedFilter(column2) {
        return this.allColumnFilters.get(column2.getColId());
      }
      getDefaultFilter(column2, isFloating = false) {
        return this.getDefaultFilterFromDataType(() => this.beans.dataTypeSvc?.getBaseDataType(column2), isFloating);
      }
      getDefaultFilterFromDataType(getCellDataType, isFloating = false) {
        if (_isSetFilterByDefault(this.gos)) {
          return isFloating ? "agSetColumnFloatingFilter" : "agSetColumnFilter";
        }
        return _getDefaultSimpleFilter(getCellDataType(), isFloating);
      }
      getDefaultFloatingFilter(column2) {
        return this.getDefaultFilter(column2, true);
      }
      createFilterComp(column2, filterDef, defaultFilter, getFilterParams, isHandler, source2) {
        const createFilterCompDetails = () => {
          const params = this.createFilterCompParams(column2, isHandler, source2);
          const updatedParams = getFilterParams(params, isHandler);
          return _getFilterDetails(this.beans.userCompFactory, filterDef, updatedParams, defaultFilter);
        };
        const compDetails = createFilterCompDetails();
        if (!compDetails) {
          return null;
        }
        const createFilterUi = (update) => {
          return (update ? createFilterCompDetails() : compDetails).newAgStackInstance();
        };
        return {
          compDetails,
          createFilterUi
        };
      }
      createFilterInstance(column2, filterDef, defaultFilter, getFilterParams) {
        const selectableFilter = this.beans.selectableFilter;
        if (selectableFilter?.isSelectable(filterDef)) {
          filterDef = selectableFilter.getFilterDef(column2, filterDef);
        }
        const { handler, handlerParams, handlerGenerator } = this.createHandler(column2, filterDef, defaultFilter) ?? {};
        const filterCompDetails = this.createFilterComp(
          column2,
          filterDef,
          defaultFilter,
          getFilterParams,
          !!handler,
          "init"
        );
        if (!filterCompDetails) {
          return {
            compDetails: null,
            createFilterUi: null,
            handler,
            handlerGenerator,
            handlerParams
          };
        }
        const { compDetails, createFilterUi } = filterCompDetails;
        if (this.isGlobalButtons) {
          const hasLocalButtons = !!compDetails.params?.buttons?.length;
          if (!hasLocalButtons) {
            _warn(281, { colId: column2.getColId() });
          }
        }
        return {
          compDetails,
          handler,
          handlerGenerator,
          handlerParams,
          createFilterUi
        };
      }
      createBaseFilterParams(column2, forFloatingFilter) {
        const { filterManager, rowModel } = this.beans;
        return _addGridCommonParams(this.gos, {
          column: column2,
          colDef: column2.getColDef(),
          getValue: this.createGetValue(column2),
          doesRowPassOtherFilter: forFloatingFilter ? () => true : (node2) => filterManager?.doesRowPassOtherFilters(column2.getColId(), node2) ?? true,
          // to avoid breaking changes to `filterParams` defined as functions
          // we need to provide the below options even though they are not valid for handlers
          rowModel
        });
      }
      createFilterCompParams(column2, useHandler, source2, forFloatingFilter) {
        const filterChangedCallback = this.filterChangedCallbackFactory(column2);
        const params = this.createBaseFilterParams(column2, forFloatingFilter);
        params.filterChangedCallback = filterChangedCallback;
        params.filterModifiedCallback = forFloatingFilter ? () => {
        } : (additionalEventAttributes) => this.filterModified(column2, additionalEventAttributes);
        if (useHandler) {
          const displayParams = params;
          const colId = column2.getColId();
          const model2 = _getFilterModel(this.model, colId);
          displayParams.model = model2;
          displayParams.state = this.state.get(colId) ?? {
            model: model2
          };
          displayParams.onModelChange = (model22, additionalEventAttributes) => {
            this.updateStoredModel(colId, model22);
            this.refreshHandlerAndUi(column2, model22, "ui", false, additionalEventAttributes).then(() => {
              filterChangedCallback({ ...additionalEventAttributes, source: "columnFilter" });
            });
          };
          displayParams.onStateChange = (state) => {
            this.updateState(column2, state);
            this.updateOrRefreshFilterUi(column2);
          };
          displayParams.onAction = (action, additionalEventAttributes, event) => {
            this.updateModel(column2, action, additionalEventAttributes);
            this.dispatchLocalEvent({
              type: "filterAction",
              column: column2,
              action,
              event
            });
          };
          displayParams.getHandler = () => this.getHandler(column2, true);
          displayParams.onUiChange = (additionalEventAttributes) => this.filterUiChanged(column2, additionalEventAttributes);
          displayParams.source = source2;
        }
        return params;
      }
      createFilterUiForHandler(compDetails, createFilterUi) {
        return createFilterUi ? {
          created: false,
          create: createFilterUi,
          filterParams: compDetails.params,
          compDetails
        } : null;
      }
      createFilterUiLegacy(compDetails, createFilterUi, updateInstanceCallback) {
        const promise = createFilterUi();
        const filterUi = {
          created: true,
          create: createFilterUi,
          filterParams: compDetails.params,
          compDetails,
          promise
        };
        promise.then(updateInstanceCallback);
        return filterUi;
      }
      createFilterWrapper(column2) {
        const { compDetails, handler, handlerGenerator, handlerParams, createFilterUi } = this.createFilterInstance(
          column2,
          column2.getColDef(),
          this.getDefaultFilter(column2),
          (params) => params
        );
        const colId = column2.getColId();
        if (handler) {
          delete this.initialModel[colId];
          handler.init?.({
            ...handlerParams,
            source: "init",
            model: _getFilterModel(this.model, colId)
          });
          return {
            column: column2,
            isHandler: true,
            handler,
            handlerGenerator,
            handlerParams,
            filterUi: this.createFilterUiForHandler(compDetails, createFilterUi)
          };
        }
        if (createFilterUi) {
          const filterWrapper = {
            column: column2,
            filterUi: null,
            isHandler: false
          };
          filterWrapper.filterUi = this.createFilterUiLegacy(compDetails, createFilterUi, (filterComp) => {
            filterWrapper.filter = filterComp ?? void 0;
          });
          return filterWrapper;
        }
        return {
          column: column2,
          filterUi: null,
          isHandler: false
        };
      }
      createHandlerFunc(column2, filterDef, defaultFilter) {
        const { gos, frameworkOverrides, registry } = this.beans;
        let doesFilterPass;
        const getFilterHandlerFromDef = (filterDef2) => {
          const filter = filterDef2.filter;
          if (isColumnFilterComp(filter)) {
            const handler = filter.handler;
            if (handler) {
              return handler;
            }
            doesFilterPass = filter.doesFilterPass;
            if (doesFilterPass) {
              return () => ({
                doesFilterPass
              });
            }
            return void 0;
          }
          return typeof filter === "string" ? filter : void 0;
        };
        const enableFilterHandlers = gos.get("enableFilterHandlers");
        const providedFilterHandler = enableFilterHandlers ? getFilterHandlerFromDef(filterDef) : void 0;
        const resolveProvidedFilterHandler = (handlerName2) => () => this.createBean(registry.createDynamicBean(handlerName2, true));
        let filterHandler;
        let handlerName;
        if (typeof providedFilterHandler === "string") {
          const userFilterHandler = gos.get("filterHandlers")?.[providedFilterHandler];
          if (userFilterHandler != null) {
            filterHandler = userFilterHandler;
          } else if (FILTER_HANDLERS.has(providedFilterHandler)) {
            filterHandler = resolveProvidedFilterHandler(providedFilterHandler);
            handlerName = providedFilterHandler;
          }
        } else {
          filterHandler = providedFilterHandler;
        }
        if (!filterHandler) {
          let filterName;
          const { compName, jsComp, fwComp } = _getFilterCompKeys(frameworkOverrides, filterDef);
          if (compName) {
            filterName = compName;
          } else {
            const usingDefaultFilter = jsComp == null && fwComp == null && filterDef.filter === true;
            if (usingDefaultFilter) {
              filterName = defaultFilter;
            }
          }
          handlerName = this.handlerMap[filterName];
          if (handlerName) {
            filterHandler = resolveProvidedFilterHandler(handlerName);
          }
        }
        if (!filterHandler) {
          if (!enableFilterHandlers) {
            return void 0;
          }
          if (_isClientSideRowModel(gos)) {
            _warn(277, { colId: column2.getColId() });
          }
          return DUMMY_HANDLER;
        }
        return { filterHandler, handlerNameOrCallback: doesFilterPass ?? handlerName };
      }
      createHandler(column2, filterDef, defaultFilter) {
        const handlerFunc = this.createHandlerFunc(column2, filterDef, defaultFilter);
        if (!handlerFunc) {
          return void 0;
        }
        const filterParams = _mergeFilterParamsWithApplicationProvidedParams(
          this.beans.userCompFactory,
          filterDef,
          this.createFilterCompParams(column2, true, "init")
        );
        const { handlerNameOrCallback, filterHandler } = handlerFunc;
        const { handler, handlerParams } = this.createHandlerFromFunc(column2, filterHandler, filterParams);
        return {
          handler,
          handlerParams,
          handlerGenerator: handlerNameOrCallback ?? filterHandler
        };
      }
      createHandlerFromFunc(column2, filterHandler, filterParams) {
        const colDef = column2.getColDef();
        const handler = filterHandler(_addGridCommonParams(this.gos, { column: column2, colDef }));
        const handlerParams = this.createHandlerParams(column2, filterParams);
        return { handler, handlerParams };
      }
      createHandlerParams(column2, filterParams) {
        const colDef = column2.getColDef();
        const colId = column2.getColId();
        const filterChangedCallback = this.filterChangedCallbackFactory(column2);
        return _addGridCommonParams(this.gos, {
          colDef,
          column: column2,
          getValue: this.createGetValue(column2),
          doesRowPassOtherFilter: (node2) => this.beans.filterManager?.doesRowPassOtherFilters(colId, node2) ?? true,
          onModelChange: (newModel, additionalEventAttributes) => {
            this.updateStoredModel(colId, newModel);
            this.refreshHandlerAndUi(column2, newModel, "handler", false, additionalEventAttributes).then(() => {
              filterChangedCallback({ ...additionalEventAttributes, source: "columnFilter" });
            });
          },
          filterParams
        });
      }
      onColumnsChanged() {
        const columns = [];
        const { colModel, filterManager, groupFilter } = this.beans;
        this.allColumnFilters.forEach((wrapper2, colId) => {
          let currentColumn;
          if (wrapper2.column.isPrimary()) {
            currentColumn = colModel.getColDefCol(colId);
          } else {
            currentColumn = colModel.getCol(colId);
          }
          if (currentColumn && currentColumn === wrapper2.column) {
            return;
          }
          columns.push(wrapper2.column);
          this.disposeFilterWrapper(wrapper2, "columnChanged");
          this.disposeColumnListener(colId);
        });
        const allFiltersAreGroupFilters = groupFilter && columns.every((col) => groupFilter.isGroupFilter(col));
        if (columns.length > 0 && !allFiltersAreGroupFilters) {
          filterManager?.onFilterChanged({ columns, source: "api" });
        }
      }
      isFilterAllowed(column2) {
        const isFilterAllowed = column2.isFilterAllowed();
        if (!isFilterAllowed) {
          return false;
        }
        const groupFilter = this.beans.groupFilter;
        if (groupFilter?.isGroupFilter(column2)) {
          return groupFilter.isFilterAllowed(column2);
        }
        return true;
      }
      getFloatingFilterCompDetails(column2, showParentFilter) {
        const { userCompFactory, frameworkOverrides, selectableFilter } = this.beans;
        const parentFilterInstance = (callback) => {
          const filterComponent = this.getOrCreateFilterUi(column2);
          if (filterComponent == null) {
            return;
          }
          filterComponent.then((instance) => {
            callback(_unwrapUserComp(instance));
          });
        };
        const colDef = column2.getColDef();
        const filterDef = selectableFilter?.isSelectable(colDef) ? selectableFilter.getFilterDef(column2, colDef) : colDef;
        const defaultFloatingFilterType = _getDefaultFloatingFilterType(frameworkOverrides, filterDef, () => this.getDefaultFloatingFilter(column2)) ?? "agReadOnlyFloatingFilter";
        const isReactive = this.gos.get("enableFilterHandlers");
        const filterParams = _mergeFilterParamsWithApplicationProvidedParams(
          userCompFactory,
          filterDef,
          this.createFilterCompParams(column2, isReactive, "init", true)
        );
        const params = _addGridCommonParams(this.gos, {
          column: column2,
          filterParams,
          currentParentModel: () => this.getCurrentFloatingFilterParentModel(column2),
          parentFilterInstance,
          showParentFilter
        });
        if (isReactive) {
          const displayParams = params;
          const colId = column2.getColId();
          const filterChangedCallback = this.filterChangedCallbackFactory(column2);
          displayParams.onUiChange = (additionalEventAttributes) => this.floatingFilterUiChanged(column2, additionalEventAttributes);
          displayParams.model = _getFilterModel(this.model, colId);
          displayParams.onModelChange = (model2, additionalEventAttributes) => {
            this.updateStoredModel(colId, model2);
            this.refreshHandlerAndUi(column2, model2, "floating", true, additionalEventAttributes).then(() => {
              filterChangedCallback({ ...additionalEventAttributes, source: "columnFilter" });
            });
          };
          displayParams.getHandler = () => this.getHandler(column2, true);
          displayParams.source = "init";
        }
        return _getFloatingFilterCompDetails(userCompFactory, colDef, params, defaultFloatingFilterType);
      }
      getCurrentFloatingFilterParentModel(column2) {
        return this.getModelFromFilterWrapper(this.cachedFilter(column2) ?? { column: column2 });
      }
      destroyFilterUi(filterWrapper, column2, compDetails, createFilterUi) {
        const source2 = "paramsUpdated";
        if (filterWrapper.isHandler) {
          const colId = column2.getColId();
          delete this.initialModel[colId];
          this.state.delete(colId);
          const filterUi = filterWrapper.filterUi;
          const newFilterUi = this.createFilterUiForHandler(compDetails, createFilterUi);
          filterWrapper.filterUi = newFilterUi;
          const eventSvc = this.eventSvc;
          if (filterUi?.created) {
            filterUi.promise.then((filter) => {
              this.destroyBean(filter);
              eventSvc.dispatchEvent({
                type: "filterDestroyed",
                source: source2,
                column: column2
              });
            });
          } else {
            eventSvc.dispatchEvent({
              type: "filterHandlerDestroyed",
              source: source2,
              column: column2
            });
          }
        } else {
          this.destroyFilter(column2, source2);
        }
      }
      // destroys the filter, so it no longer takes part
      destroyFilter(column2, source2 = "api") {
        const colId = column2.getColId();
        const filterWrapper = this.allColumnFilters.get(colId);
        this.disposeColumnListener(colId);
        delete this.initialModel[colId];
        if (filterWrapper) {
          this.disposeFilterWrapper(filterWrapper, source2).then((wasActive) => {
            if (wasActive && this.isAlive()) {
              this.beans.filterManager?.onFilterChanged({
                columns: [column2],
                source: "api"
              });
            }
          });
        }
      }
      disposeColumnListener(colId) {
        const columnListener = this.allColumnListeners.get(colId);
        if (columnListener) {
          this.allColumnListeners.delete(colId);
          columnListener();
        }
      }
      disposeFilterWrapper(filterWrapper, source2) {
        let isActive = false;
        const { column: column2, isHandler, filterUi } = filterWrapper;
        const colId = column2.getColId();
        if (isHandler) {
          isActive = this.isHandlerActive(column2);
          this.destroyBean(filterWrapper.handler);
          delete this.model[colId];
          this.state.delete(colId);
        }
        const removeFilter = () => {
          this.setColFilterActive(column2, false, "filterDestroyed");
          this.allColumnFilters.delete(colId);
          this.eventSvc.dispatchEvent({
            type: "filterDestroyed",
            source: source2,
            column: column2
          });
        };
        if (filterUi) {
          if (filterUi.created) {
            return filterUi.promise.then((filter) => {
              isActive = isHandler ? isActive : !!filter?.isFilterActive();
              this.destroyBean(filter);
              removeFilter();
              return isActive;
            });
          } else {
            removeFilter();
          }
        }
        return AgPromise.resolve(isActive);
      }
      filterChangedCallbackFactory(column2) {
        return (additionalEventAttributes) => {
          this.callOnFilterChangedOutsideRenderCycle({
            additionalEventAttributes,
            columns: [column2],
            column: column2,
            source: additionalEventAttributes?.source ?? "columnFilter"
          });
        };
      }
      filterParamsChanged(colId, source2 = "api") {
        const filterWrapper = this.allColumnFilters.get(colId);
        if (!filterWrapper) {
          return;
        }
        const beans = this.beans;
        const column2 = filterWrapper.column;
        const colDef = column2.getColDef();
        const isFilterAllowed = column2.isFilterAllowed();
        const defaultFilter = this.getDefaultFilter(column2);
        const selectableFilter = beans.selectableFilter;
        const filterDef = selectableFilter?.isSelectable(colDef) ? selectableFilter.getFilterDef(column2, colDef) : colDef;
        const handlerFunc = isFilterAllowed ? this.createHandlerFunc(column2, filterDef, this.getDefaultFilter(column2)) : void 0;
        const isHandler = !!handlerFunc;
        const wasHandler = filterWrapper.isHandler;
        if (wasHandler != isHandler) {
          this.destroyFilter(column2, "paramsUpdated");
          return;
        }
        const { compDetails, createFilterUi } = (isFilterAllowed ? this.createFilterComp(column2, filterDef, defaultFilter, (params) => params, isHandler, "colDef") : null) ?? { compDetails: null, createFilterUi: null };
        const newFilterParams = compDetails?.params ?? _mergeFilterParamsWithApplicationProvidedParams(
          beans.userCompFactory,
          filterDef,
          this.createFilterCompParams(column2, isHandler, "colDef")
        );
        if (wasHandler) {
          const handlerGenerator = handlerFunc?.handlerNameOrCallback ?? handlerFunc?.filterHandler;
          const existingModel = _getFilterModel(this.model, colId);
          if (filterWrapper.handlerGenerator != handlerGenerator) {
            const oldHandler = filterWrapper.handler;
            const { handler, handlerParams } = this.createHandlerFromFunc(
              column2,
              handlerFunc.filterHandler,
              newFilterParams
            );
            filterWrapper.handler = handler;
            filterWrapper.handlerParams = handlerParams;
            filterWrapper.handlerGenerator = handlerGenerator;
            delete this.model[colId];
            handler.init?.({ ...handlerParams, source: "init", model: null });
            this.destroyBean(oldHandler);
            if (existingModel != null) {
              this.beans.filterManager?.onFilterChanged({
                columns: [column2],
                source: source2
              });
            }
          } else {
            const handlerParams = this.createHandlerParams(column2, compDetails?.params);
            filterWrapper.handlerParams = handlerParams;
            filterWrapper.handler.refresh?.({
              ...handlerParams,
              source: "colDef",
              model: existingModel
            });
          }
        }
        if (this.areFilterCompsDifferent(filterWrapper.filterUi?.compDetails ?? null, compDetails) || !filterWrapper.filterUi || !compDetails) {
          this.destroyFilterUi(filterWrapper, column2, compDetails, createFilterUi);
          return;
        }
        filterWrapper.filterUi.filterParams = newFilterParams;
        getFilterUiFromWrapper(filterWrapper, wasHandler)?.then((filter) => {
          const shouldRefreshFilter = filter?.refresh ? filter.refresh(newFilterParams) : true;
          if (shouldRefreshFilter === false) {
            this.destroyFilterUi(filterWrapper, column2, compDetails, createFilterUi);
          } else {
            this.dispatchLocalEvent({
              type: "filterParamsChanged",
              column: column2,
              params: newFilterParams
            });
          }
        });
      }
      refreshHandlerAndUi(column2, model2, source2, createIfMissing, additionalEventAttributes) {
        const filterWrapper = this.cachedFilter(column2);
        if (!filterWrapper) {
          if (createIfMissing) {
            this.getOrCreateFilterWrapper(column2, true);
          }
          return AgPromise.resolve();
        }
        if (!filterWrapper.isHandler) {
          return AgPromise.resolve();
        }
        const { filterUi, handler, handlerParams } = filterWrapper;
        return _refreshHandlerAndUi(
          () => {
            if (filterUi) {
              const { created, filterParams } = filterUi;
              if (created) {
                return filterUi.promise.then((filter) => {
                  return filter ? { filter, filterParams } : void 0;
                });
              } else {
                filterUi.refreshed = true;
              }
            }
            return AgPromise.resolve(void 0);
          },
          handler,
          handlerParams,
          model2,
          this.state.get(column2.getColId()) ?? { model: model2 },
          source2,
          additionalEventAttributes
        );
      }
      setColumnFilterWrapper(column2, filterWrapper) {
        const colId = column2.getColId();
        this.allColumnFilters.set(colId, filterWrapper);
        this.allColumnListeners.set(
          colId,
          this.addManagedListeners(column2, { colDefChanged: () => this.filterParamsChanged(colId) })[0]
        );
      }
      areFilterCompsDifferent(oldCompDetails, newCompDetails) {
        if (!newCompDetails || !oldCompDetails) {
          return true;
        }
        const { componentClass: oldComponentClass } = oldCompDetails;
        const { componentClass: newComponentClass } = newCompDetails;
        const isSameComponentClass = oldComponentClass === newComponentClass || // react hooks returns new wrappers, so check nested render method
        oldComponentClass?.render && newComponentClass?.render && oldComponentClass.render === newComponentClass.render;
        return !isSameComponentClass;
      }
      hasFloatingFilters() {
        const gridColumns2 = this.beans.colModel.getCols();
        return gridColumns2.some((col) => col.getColDef().floatingFilter);
      }
      getFilterInstance(key2) {
        const column2 = this.beans.colModel.getColDefCol(key2);
        if (!column2) {
          return Promise.resolve(void 0);
        }
        const filterPromise = this.getOrCreateFilterUi(column2);
        if (!filterPromise) {
          return Promise.resolve(null);
        }
        return new Promise((resolve) => {
          filterPromise.then((filter) => {
            resolve(_unwrapUserComp(filter));
          });
        });
      }
      processFilterModelUpdateQueue() {
        this.modelUpdates.forEach(({ model: model2, source: source2 }) => this.setModel(model2, source2));
        this.modelUpdates = [];
        this.columnModelUpdates.forEach(({ key: key2, model: model2, resolve }) => {
          this.setModelForColumn(key2, model2).then(() => resolve());
        });
        this.columnModelUpdates = [];
      }
      getModelForColumn(column2, useUnapplied) {
        if (useUnapplied) {
          const { state, model: model2 } = this;
          const colId = column2.getColId();
          const colState = state.get(colId);
          if (colState) {
            return colState.model ?? null;
          }
          return _getFilterModel(model2, colId);
        }
        const filterWrapper = this.cachedFilter(column2);
        return filterWrapper ? this.getModelFromFilterWrapper(filterWrapper) : null;
      }
      setModelForColumn(key2, model2) {
        if (this.beans.dataTypeSvc?.isPendingInference) {
          let resolve = () => {
          };
          const promise = new Promise((res) => {
            resolve = res;
          });
          this.columnModelUpdates.push({ key: key2, model: model2, resolve });
          return promise;
        }
        return new Promise((resolve) => {
          this.setModelForColumnLegacy(key2, model2).then((result2) => resolve(result2));
        });
      }
      getStateForColumn(colId) {
        return this.state.get(colId) ?? {
          model: _getFilterModel(this.model, colId)
        };
      }
      setModelForColumnLegacy(key2, model2) {
        const column2 = this.beans.colModel.getColDefCol(key2);
        const filterWrapper = column2 ? this.getOrCreateFilterWrapper(column2, true) : null;
        return filterWrapper ? this.setModelOnFilterWrapper(filterWrapper, model2) : AgPromise.resolve();
      }
      setColDefPropsForDataType(colDef, dataTypeDefinition, formatValue) {
        const providedFilter = colDef.filter;
        const filter = providedFilter === true ? this.getDefaultFilterFromDataType(() => dataTypeDefinition.baseDataType) : providedFilter;
        if (typeof filter !== "string") {
          return;
        }
        let filterParams;
        let filterValueGetter;
        const beans = this.beans;
        const { filterParams: colDefFilterParams, filterValueGetter: colDefFilterValueGetter } = colDef;
        if (filter === "agMultiColumnFilter") {
          ({ filterParams, filterValueGetter } = beans.multiFilter?.getParamsForDataType(
            colDefFilterParams,
            colDefFilterValueGetter,
            dataTypeDefinition,
            formatValue
          ) ?? {});
        } else {
          ({ filterParams, filterValueGetter } = _getFilterParamsForDataType(
            filter,
            colDefFilterParams,
            colDefFilterValueGetter,
            dataTypeDefinition,
            formatValue,
            beans,
            this.getLocaleTextFunc()
          ));
        }
        colDef.filterParams = filterParams;
        if (filterValueGetter) {
          colDef.filterValueGetter = filterValueGetter;
        }
      }
      // additionalEventAttributes is used by provided simple floating filter, so it can add 'floatingFilter=true' to the event
      setColFilterActive(column2, active, source2, additionalEventAttributes) {
        if (column2.filterActive !== active) {
          column2.filterActive = active;
          column2.dispatchColEvent("filterActiveChanged", source2);
        }
        column2.dispatchColEvent("filterChanged", source2, additionalEventAttributes);
      }
      setModelOnFilterWrapper(filterWrapper, newModel, justCreated) {
        return new AgPromise((resolve) => {
          if (filterWrapper.isHandler) {
            const column2 = filterWrapper.column;
            const colId = column2.getColId();
            const existingModel = this.model[colId];
            this.updateStoredModel(colId, newModel);
            if (justCreated && newModel === existingModel) {
              resolve();
              return;
            }
            this.refreshHandlerAndUi(column2, newModel, "api").then(() => resolve());
            return;
          }
          const uiPromise = getFilterUiFromWrapper(filterWrapper);
          if (uiPromise) {
            uiPromise.then((filter) => {
              if (typeof filter?.setModel !== "function") {
                _warn(65);
                resolve();
                return;
              }
              (filter.setModel(newModel) || AgPromise.resolve()).then(() => resolve());
            });
            return;
          }
          resolve();
        });
      }
      /** for handlers only */
      updateStoredModel(colId, model2) {
        if (_exists(model2)) {
          this.model[colId] = model2;
        } else {
          delete this.model[colId];
        }
        const oldState = this.state.get(colId);
        const newState = {
          model: model2,
          state: oldState?.state
        };
        this.state.set(colId, newState);
      }
      filterModified(column2, additionalEventAttributes) {
        this.getOrCreateFilterUi(column2)?.then((filterInstance) => {
          this.eventSvc.dispatchEvent({
            type: "filterModified",
            column: column2,
            filterInstance,
            ...additionalEventAttributes
          });
        });
      }
      filterUiChanged(column2, additionalEventAttributes) {
        if (this.gos.get("enableFilterHandlers")) {
          this.eventSvc.dispatchEvent({
            type: "filterUiChanged",
            column: column2,
            ...additionalEventAttributes
          });
        }
      }
      floatingFilterUiChanged(column2, additionalEventAttributes) {
        if (this.gos.get("enableFilterHandlers")) {
          this.eventSvc.dispatchEvent({
            type: "floatingFilterUiChanged",
            column: column2,
            ...additionalEventAttributes
          });
        }
      }
      updateModel(column2, action, additionalEventAttributes) {
        const colId = column2.getColId();
        const filterWrapper = this.cachedFilter(column2);
        const getFilterUi = () => filterWrapper?.filterUi;
        _updateFilterModel(
          action,
          getFilterUi,
          () => _getFilterModel(this.model, colId),
          () => this.state.get(colId),
          (state) => this.updateState(column2, state),
          (model2) => getFilterUi()?.filterParams?.onModelChange(model2, additionalEventAttributes),
          filterWrapper?.isHandler ? filterWrapper.handler.processModelToApply?.bind(filterWrapper.handler) : void 0
        );
      }
      updateAllModels(action, additionalEventAttributes) {
        const promises = [];
        this.allColumnFilters.forEach((filter, colId) => {
          const column2 = this.beans.colModel.getColDefCol(colId);
          if (column2) {
            _updateFilterModel(
              action,
              () => filter.filterUi,
              () => _getFilterModel(this.model, colId),
              () => this.state.get(colId),
              (state) => this.updateState(column2, state),
              (model2) => {
                this.updateStoredModel(colId, model2);
                this.dispatchLocalEvent({
                  type: "filterAction",
                  column: column2,
                  action
                });
                promises.push(this.refreshHandlerAndUi(column2, model2, "ui"));
              },
              filter?.isHandler ? filter.handler.processModelToApply?.bind(filter.handler) : void 0
            );
          }
        });
        if (promises.length) {
          AgPromise.all(promises).then(() => {
            this.callOnFilterChangedOutsideRenderCycle({
              source: "columnFilter",
              additionalEventAttributes,
              columns: []
            });
          });
        }
      }
      updateOrRefreshFilterUi(column2) {
        const colId = column2.getColId();
        getAndRefreshFilterUi(
          () => this.cachedFilter(column2)?.filterUi,
          () => _getFilterModel(this.model, colId),
          () => this.state.get(colId)
        );
      }
      updateState(column2, state) {
        this.state.set(column2.getColId(), state);
        this.dispatchLocalEvent({
          type: "filterStateChanged",
          column: column2,
          state
        });
      }
      // for tool panel only
      canApplyAll() {
        const { state, model: model2, activeFilterComps } = this;
        for (const comp2 of activeFilterComps) {
          if (comp2.source === "COLUMN_MENU") {
            return false;
          }
        }
        let hasChanges = false;
        for (const colId of state.keys()) {
          const colState = state.get(colId);
          if (colState.valid === false) {
            return false;
          }
          if ((colState.model ?? null) !== _getFilterModel(model2, colId)) {
            hasChanges = true;
          }
        }
        return hasChanges;
      }
      hasUnappliedModel(colId) {
        const { model: model2, state } = this;
        return (state.get(colId)?.model ?? null) !== _getFilterModel(model2, colId);
      }
      setGlobalButtons(isGlobal) {
        this.isGlobalButtons = isGlobal;
        this.dispatchLocalEvent({
          type: "filterGlobalButtons",
          isGlobal
        });
      }
      shouldKeepStateOnDetach(column2, lastContainerType) {
        if (lastContainerType === "newFiltersToolPanel") {
          return true;
        }
        const filterPanelSvc = this.beans.filterPanelSvc;
        if (filterPanelSvc?.isActive) {
          return !!filterPanelSvc.getState(column2.getColId());
        }
        return false;
      }
      destroy() {
        super.destroy();
        this.allColumnFilters.forEach((filterWrapper) => this.disposeFilterWrapper(filterWrapper, "gridDestroyed"));
        this.allColumnListeners.clear();
        this.state.clear();
        this.activeFilterComps.clear();
      }
    };
    function isAnyFilterPresent(beans) {
      return !!beans.filterManager?.isAnyFilterPresent();
    }
    function onFilterChanged(beans, source2 = "api") {
      beans.filterManager?.onFilterChanged({ source: source2 });
    }
    var FilterManager = class extends BeanStub {
      constructor() {
        super(...arguments);
        this.beanName = "filterManager";
        this.advFilterModelUpdateQueue = [];
      }
      wireBeans(beans) {
        this.quickFilter = beans.quickFilter;
        this.advancedFilter = beans.advancedFilter;
        this.colFilter = beans.colFilter;
      }
      postConstruct() {
        const refreshFiltersForAggregations = this.refreshFiltersForAggregations.bind(this);
        const updateAdvFilterColumns = this.updateAdvFilterColumns.bind(this);
        this.addManagedEventListeners({
          columnValueChanged: refreshFiltersForAggregations,
          columnPivotChanged: refreshFiltersForAggregations,
          columnPivotModeChanged: refreshFiltersForAggregations,
          newColumnsLoaded: updateAdvFilterColumns,
          columnVisible: updateAdvFilterColumns,
          advancedFilterEnabledChanged: ({ enabled }) => this.onAdvFilterEnabledChanged(enabled),
          dataTypesInferred: this.processFilterModelUpdateQueue.bind(this)
        });
        this.externalFilterPresent = this.isExternalFilterPresentCallback();
        this.addManagedPropertyListeners(["isExternalFilterPresent", "doesExternalFilterPass"], () => {
          this.onFilterChanged({ source: "api" });
        });
        this.updateAggFiltering();
        this.addManagedPropertyListener("groupAggFiltering", () => {
          this.updateAggFiltering();
          this.onFilterChanged();
        });
        if (this.quickFilter) {
          this.addManagedListeners(this.quickFilter, {
            quickFilterChanged: () => this.onFilterChanged({ source: "quickFilter" })
          });
        }
        const { gos } = this;
        this.alwaysPassFilter = gos.get("alwaysPassFilter");
        this.addManagedPropertyListener("alwaysPassFilter", () => {
          this.alwaysPassFilter = gos.get("alwaysPassFilter");
          this.onFilterChanged({ source: "api" });
        });
      }
      isExternalFilterPresentCallback() {
        const isFilterPresent = this.gos.getCallback("isExternalFilterPresent");
        return typeof isFilterPresent === "function" && isFilterPresent({});
      }
      doesExternalFilterPass(node2) {
        const doesFilterPass = this.gos.get("doesExternalFilterPass");
        return typeof doesFilterPass === "function" && doesFilterPass(node2);
      }
      setFilterState(model2, state, source2 = "api") {
        if (this.isAdvFilterEnabled()) {
          return;
        }
        this.colFilter?.setState(model2, state, source2);
      }
      setFilterModel(model2, source2 = "api", skipWarning) {
        if (this.isAdvFilterEnabled()) {
          if (!skipWarning) {
            this.warnAdvFilters();
          }
          return;
        }
        this.colFilter?.setModel(model2, source2);
      }
      getFilterModel() {
        return this.colFilter?.getModel() ?? {};
      }
      getFilterState() {
        return this.colFilter?.getState();
      }
      isColumnFilterPresent() {
        return !!this.colFilter?.isFilterPresent();
      }
      isAggregateFilterPresent() {
        return !!this.colFilter?.isAggFilterPresent();
      }
      isChildFilterPresent() {
        return this.isColumnFilterPresent() || this.isQuickFilterPresent() || this.externalFilterPresent || this.isAdvFilterPresent();
      }
      isAnyFilterPresent() {
        return this.isChildFilterPresent() || this.isAggregateFilterPresent();
      }
      isAdvFilterPresent() {
        return this.isAdvFilterEnabled() && this.advancedFilter.isFilterPresent();
      }
      onAdvFilterEnabledChanged(enabled) {
        if (enabled) {
          if (this.colFilter?.disableFilters()) {
            this.onFilterChanged({ source: "advancedFilter" });
          }
        } else if (this.advancedFilter?.isFilterPresent()) {
          this.advancedFilter.setModel(null);
          this.onFilterChanged({ source: "advancedFilter" });
        }
      }
      isAdvFilterEnabled() {
        return !!this.advancedFilter?.isEnabled();
      }
      isAdvFilterHeaderActive() {
        return this.isAdvFilterEnabled() && this.advancedFilter.isHeaderActive();
      }
      refreshFiltersForAggregations() {
        if (_getGroupAggFiltering(this.gos) && this.isAnyFilterPresent()) {
          this.onFilterChanged();
        }
      }
      onFilterChanged(params = {}) {
        const { source: source2, additionalEventAttributes, columns = [] } = params;
        this.externalFilterPresent = this.isExternalFilterPresentCallback();
        (this.colFilter ? this.colFilter.updateBeforeFilterChanged(params) : AgPromise.resolve()).then(() => {
          const filterChangedEvent = {
            source: source2,
            type: "filterChanged",
            columns
          };
          if (additionalEventAttributes) {
            _mergeDeep(filterChangedEvent, additionalEventAttributes);
          }
          this.eventSvc.dispatchEvent(filterChangedEvent);
          this.colFilter?.updateAfterFilterChanged();
        });
      }
      isSuppressFlashingCellsBecauseFiltering() {
        return !!this.colFilter?.isSuppressFlashingCellsBecauseFiltering();
      }
      isQuickFilterPresent() {
        return !!this.quickFilter?.isFilterPresent();
      }
      updateAggFiltering() {
        this.aggFiltering = !!_getGroupAggFiltering(this.gos);
      }
      isAggregateQuickFilterPresent() {
        return this.isQuickFilterPresent() && this.shouldApplyQuickFilterAfterAgg();
      }
      isNonAggregateQuickFilterPresent() {
        return this.isQuickFilterPresent() && !this.shouldApplyQuickFilterAfterAgg();
      }
      shouldApplyQuickFilterAfterAgg() {
        return (this.aggFiltering || this.beans.colModel.isPivotMode()) && !this.gos.get("applyQuickFilterBeforePivotOrAgg");
      }
      doesRowPassOtherFilters(colIdToSkip, rowNode) {
        return this.doesRowPassFilter({ rowNode, colIdToSkip });
      }
      doesRowPassAggregateFilters(params) {
        const { rowNode } = params;
        if (this.alwaysPassFilter?.(rowNode)) {
          return true;
        }
        if (this.isAggregateQuickFilterPresent() && !this.quickFilter.doesRowPass(rowNode)) {
          return false;
        }
        if (this.isAggregateFilterPresent() && !this.colFilter.doFiltersPass(rowNode, params.colIdToSkip, true)) {
          return false;
        }
        return true;
      }
      doesRowPassFilter(params) {
        const { rowNode } = params;
        if (this.alwaysPassFilter?.(rowNode)) {
          return true;
        }
        if (this.isNonAggregateQuickFilterPresent() && !this.quickFilter.doesRowPass(rowNode)) {
          return false;
        }
        if (this.externalFilterPresent && !this.doesExternalFilterPass(rowNode)) {
          return false;
        }
        if (this.isColumnFilterPresent() && !this.colFilter.doFiltersPass(rowNode, params.colIdToSkip)) {
          return false;
        }
        if (this.isAdvFilterPresent() && !this.advancedFilter.doesFilterPass(rowNode)) {
          return false;
        }
        return true;
      }
      // for group filters, can change dynamically whether they are allowed or not
      isFilterAllowed(column2) {
        if (this.isAdvFilterEnabled()) {
          return false;
        }
        return !!this.colFilter?.isFilterAllowed(column2);
      }
      getAdvFilterModel() {
        return this.isAdvFilterEnabled() ? this.advancedFilter.getModel() : null;
      }
      setAdvFilterModel(expression, source2 = "api") {
        if (!this.isAdvFilterEnabled()) {
          return;
        }
        if (this.beans.dataTypeSvc?.isPendingInference) {
          this.advFilterModelUpdateQueue.push(expression);
          return;
        }
        this.advancedFilter.setModel(expression ?? null);
        this.onFilterChanged({ source: source2 });
      }
      toggleAdvFilterBuilder(show, source2) {
        if (!this.isAdvFilterEnabled()) {
          return;
        }
        this.advancedFilter.getCtrl().toggleFilterBuilder({ source: source2, force: show });
      }
      updateAdvFilterColumns() {
        if (!this.isAdvFilterEnabled()) {
          return;
        }
        if (this.advancedFilter.updateValidity()) {
          this.onFilterChanged({ source: "advancedFilter" });
        }
      }
      hasFloatingFilters() {
        if (this.isAdvFilterEnabled()) {
          return false;
        }
        return !!this.colFilter?.hasFloatingFilters();
      }
      getColumnFilterInstance(key2) {
        if (this.isAdvFilterEnabled()) {
          this.warnAdvFilters();
          return Promise.resolve(void 0);
        }
        return this.colFilter?.getFilterInstance(key2) ?? Promise.resolve(void 0);
      }
      warnAdvFilters() {
        _warn(68);
      }
      setupAdvFilterHeaderComp(eCompToInsertBefore) {
        this.advancedFilter?.getCtrl().setupHeaderComp(eCompToInsertBefore);
      }
      getHeaderRowCount() {
        return this.isAdvFilterHeaderActive() ? 1 : 0;
      }
      getHeaderHeight() {
        return this.isAdvFilterHeaderActive() ? this.advancedFilter.getCtrl().getHeaderHeight() : 0;
      }
      processFilterModelUpdateQueue() {
        for (const model2 of this.advFilterModelUpdateQueue) {
          this.setAdvFilterModel(model2);
        }
        this.advFilterModelUpdateQueue = [];
      }
      setColumnFilterModel(key2, model2) {
        if (this.isAdvFilterEnabled()) {
          this.warnAdvFilters();
          return Promise.resolve();
        }
        return this.colFilter?.setModelForColumn(key2, model2) ?? Promise.resolve();
      }
    };
    var FilterMenuFactory = class extends BeanStub {
      constructor() {
        super(...arguments);
        this.beanName = "filterMenuFactory";
      }
      wireBeans(beans) {
        this.popupSvc = beans.popupSvc;
      }
      hideActiveMenu() {
        this.hidePopup?.();
      }
      showMenuAfterMouseEvent(column2, mouseEvent, containerType, onClosedCallback) {
        if (column2 && !column2.isColumn) {
          return;
        }
        this.showPopup(
          column2,
          (eMenu) => {
            this.popupSvc?.positionPopupUnderMouseEvent({
              column: column2,
              type: containerType,
              mouseEvent,
              ePopup: eMenu
            });
          },
          containerType,
          mouseEvent.target,
          _isLegacyMenuEnabled(this.gos),
          onClosedCallback
        );
      }
      showMenuAfterButtonClick(column2, eventSource, containerType, onClosedCallback) {
        if (column2 && !column2.isColumn) {
          return;
        }
        let multiplier = -1;
        let alignSide = "left";
        const isLegacyMenuEnabled = _isLegacyMenuEnabled(this.gos);
        if (!isLegacyMenuEnabled && this.gos.get("enableRtl")) {
          multiplier = 1;
          alignSide = "right";
        }
        const nudgeX = isLegacyMenuEnabled ? void 0 : 4 * multiplier;
        const nudgeY = isLegacyMenuEnabled ? void 0 : 4;
        this.showPopup(
          column2,
          (eMenu) => {
            this.popupSvc?.positionPopupByComponent({
              type: containerType,
              eventSource,
              ePopup: eMenu,
              nudgeX,
              nudgeY,
              alignSide,
              keepWithinBounds: true,
              position: "under",
              column: column2
            });
          },
          containerType,
          eventSource,
          isLegacyMenuEnabled,
          onClosedCallback
        );
      }
      showPopup(column2, positionCallback, containerType, eventSource, isLegacyMenuEnabled, onClosedCallback) {
        const comp2 = column2 ? this.createBean(new FilterComp(column2, "COLUMN_MENU")) : void 0;
        this.activeMenu = comp2;
        if (!comp2?.hasFilter() || !column2) {
          _error(57);
          return;
        }
        const eMenu = _createElement({
          tag: "div",
          cls: `ag-menu${!isLegacyMenuEnabled ? " ag-filter-menu" : ""}`,
          role: "presentation"
        });
        [this.tabListener] = this.addManagedElementListeners(eMenu, {
          keydown: (e) => this.trapFocusWithin(e, eMenu)
        });
        eMenu.appendChild(comp2?.getGui());
        let hidePopup;
        const afterGuiDetached = () => comp2?.afterGuiDetached();
        const anchorToElement = _isColumnMenuAnchoringEnabled(this.gos) ? eventSource ?? this.beans.ctrlsSvc.getGridBodyCtrl().eGridBody : void 0;
        const closedCallback = (e) => {
          _setColMenuVisible(column2, false, "contextMenu");
          const isKeyboardEvent = e instanceof KeyboardEvent;
          if (this.tabListener) {
            this.tabListener = this.tabListener();
          }
          if (isKeyboardEvent && eventSource && _isVisible(eventSource)) {
            const focusableEl = _findTabbableParent(eventSource);
            focusableEl?.focus({ preventScroll: true });
          }
          afterGuiDetached();
          this.destroyBean(this.activeMenu);
          this.dispatchVisibleChangedEvent(false, containerType, column2);
          onClosedCallback?.();
        };
        const translate = this.getLocaleTextFunc();
        const ariaLabel = isLegacyMenuEnabled && containerType !== "columnFilter" ? translate("ariaLabelColumnMenu", "Column Menu") : translate("ariaLabelColumnFilter", "Column Filter");
        const addPopupRes = this.popupSvc?.addPopup({
          modal: true,
          eChild: eMenu,
          closeOnEsc: true,
          closedCallback,
          positionCallback: () => positionCallback(eMenu),
          anchorToElement,
          ariaLabel
        });
        if (addPopupRes) {
          this.hidePopup = hidePopup = addPopupRes.hideFunc;
        }
        comp2.afterInit().then(() => {
          positionCallback(eMenu);
          comp2.afterGuiAttached({ container: containerType, hidePopup });
        });
        _setColMenuVisible(column2, true, "contextMenu");
        this.dispatchVisibleChangedEvent(true, containerType, column2);
      }
      trapFocusWithin(e, menu) {
        if (e.key !== KeyCode.TAB || e.defaultPrevented || _findNextFocusableElement(this.beans, menu, false, e.shiftKey)) {
          return;
        }
        e.preventDefault();
        _focusInto(menu, e.shiftKey);
      }
      dispatchVisibleChangedEvent(visible2, containerType, column2) {
        this.eventSvc.dispatchEvent({
          type: "columnMenuVisibleChanged",
          visible: visible2,
          switchingTab: false,
          key: containerType,
          column: column2 ?? null,
          columnGroup: null
        });
      }
      isMenuEnabled(column2) {
        return column2.isFilterAllowed() && (column2.getColDef().menuTabs ?? ["filterMenuTab"]).includes("filterMenuTab");
      }
      showMenuAfterContextMenuEvent() {
      }
      destroy() {
        this.destroyBean(this.activeMenu);
        super.destroy();
      }
    };
    var FilterValueService = class extends BeanStub {
      constructor() {
        super(...arguments);
        this.beanName = "filterValueSvc";
      }
      getValue(column2, rowNode, filterValueGetterOverride) {
        if (!rowNode) {
          return;
        }
        const colDef = column2.getColDef();
        const { selectableFilter, valueSvc } = this.beans;
        const filterValueGetter = filterValueGetterOverride ?? selectableFilter?.getFilterValueGetter(column2.getColId()) ?? colDef.filterValueGetter;
        if (filterValueGetter) {
          return this.executeFilterValueGetter(filterValueGetter, rowNode.data, column2, rowNode, colDef);
        }
        return valueSvc.getValue(column2, rowNode);
      }
      executeFilterValueGetter(valueGetter, data, column2, node2, colDef) {
        const { expressionSvc, valueSvc } = this.beans;
        const params = _addGridCommonParams(this.gos, {
          data,
          node: node2,
          column: column2,
          colDef,
          getValue: valueSvc.getValueCallback.bind(valueSvc, node2)
        });
        if (typeof valueGetter === "function") {
          return valueGetter(params);
        }
        return expressionSvc?.evaluate(valueGetter, params);
      }
    };
    var ReadOnlyFloatingFilterElement = {
      tag: "div",
      cls: "ag-floating-filter-input",
      role: "presentation",
      children: [
        {
          tag: "ag-input-text-field",
          ref: "eFloatingFilterText"
        }
      ]
    };
    var ReadOnlyFloatingFilter = class extends Component {
      constructor() {
        super(ReadOnlyFloatingFilterElement, [AgInputTextFieldSelector]);
        this.eFloatingFilterText = RefPlaceholder;
      }
      init(params) {
        this.params = params;
        const displayName = this.beans.colNames.getDisplayNameForColumn(params.column, "header", true);
        this.eFloatingFilterText.setDisabled(true).setInputAriaLabel(`${displayName} ${this.getLocaleTextFunc()("ariaFilterInput", "Filter Input")}`);
        if (this.gos.get("enableFilterHandlers")) {
          const reactiveParams = params;
          const handler = reactiveParams.getHandler();
          if (handler.getModelAsString) {
            const modelAsString = handler.getModelAsString(reactiveParams.model);
            this.eFloatingFilterText.setValue(modelAsString);
          }
        }
      }
      onParentModelChanged(parentModel) {
        if (parentModel == null) {
          this.eFloatingFilterText.setValue("");
          return;
        }
        this.params.parentFilterInstance((filterInstance) => {
          if (filterInstance.getModelAsString) {
            const modelAsString = filterInstance.getModelAsString(parentModel);
            this.eFloatingFilterText.setValue(modelAsString);
          }
        });
      }
      refresh(params) {
        this.init(params);
      }
    };
    var OptionsFactory = class {
      constructor() {
        this.customFilterOptions = {};
      }
      init(params, defaultOptions2) {
        this.filterOptions = params.filterOptions ?? defaultOptions2;
        this.mapCustomOptions();
        this.defaultOption = this.getDefaultItem(params.defaultOption);
      }
      refresh(params, defaultOptions2) {
        const filterOptions = params.filterOptions ?? defaultOptions2;
        if (this.filterOptions !== filterOptions) {
          this.filterOptions = filterOptions;
          this.customFilterOptions = {};
          this.mapCustomOptions();
        }
        this.defaultOption = this.getDefaultItem(params.defaultOption);
      }
      mapCustomOptions() {
        const { filterOptions } = this;
        if (!filterOptions) {
          return;
        }
        for (const filterOption of filterOptions) {
          if (typeof filterOption === "string") {
            continue;
          }
          const requiredProperties = [["displayKey"], ["displayName"], ["predicate", "test"]];
          const propertyCheck = (keys) => {
            if (!keys.some((key2) => filterOption[key2] != null)) {
              _warn(72, { keys });
              return false;
            }
            return true;
          };
          if (!requiredProperties.every(propertyCheck)) {
            this.filterOptions = filterOptions.filter((v) => v === filterOption) || [];
            continue;
          }
          this.customFilterOptions[filterOption.displayKey] = filterOption;
        }
      }
      getDefaultItem(defaultOption) {
        const { filterOptions } = this;
        if (defaultOption) {
          return defaultOption;
        } else if (filterOptions.length >= 1) {
          const firstFilterOption = filterOptions[0];
          if (typeof firstFilterOption === "string") {
            return firstFilterOption;
          } else if (firstFilterOption.displayKey) {
            return firstFilterOption.displayKey;
          } else {
            _warn(73);
          }
        } else {
          _warn(74);
        }
        return void 0;
      }
      getCustomOption(name2) {
        return this.customFilterOptions[name2];
      }
    };
    function removeItems(items, startPosition, deleteCount) {
      return deleteCount == null ? items.splice(startPosition) : items.splice(startPosition, deleteCount);
    }
    function isBlank(cellValue) {
      return cellValue == null || typeof cellValue === "string" && cellValue.trim().length === 0;
    }
    function getDefaultJoinOperator(defaultJoinOperator) {
      return defaultJoinOperator === "AND" || defaultJoinOperator === "OR" ? defaultJoinOperator : "AND";
    }
    function evaluateCustomFilter(customFilterOption, values, cellValue) {
      if (customFilterOption == null) {
        return;
      }
      const { predicate } = customFilterOption;
      if (predicate != null && !values.some((v) => v == null)) {
        return predicate(values, cellValue);
      }
    }
    function validateAndUpdateConditions(conditions, maxNumConditions) {
      let numConditions = conditions.length;
      if (numConditions > maxNumConditions) {
        conditions.splice(maxNumConditions);
        _warn(78);
        numConditions = maxNumConditions;
      }
      return numConditions;
    }
    function getNumberOfInputs(type, optionsFactory) {
      const customOpts = optionsFactory.getCustomOption(type);
      if (customOpts) {
        const { numberOfInputs } = customOpts;
        return numberOfInputs != null ? numberOfInputs : 1;
      }
      const zeroInputTypes = ["empty", "notBlank", "blank"];
      if (type && zeroInputTypes.indexOf(type) >= 0) {
        return 0;
      } else if (type === "inRange") {
        return 2;
      }
      return 1;
    }
    var SimpleFilter = class extends ProvidedFilter {
      constructor(filterNameKey, mapValuesFromModel, defaultOptions2) {
        super(filterNameKey, "simple-filter");
        this.mapValuesFromModel = mapValuesFromModel;
        this.defaultOptions = defaultOptions2;
        this.eTypes = [];
        this.eJoinPanels = [];
        this.eJoinAnds = [];
        this.eJoinOrs = [];
        this.eConditionBodies = [];
        this.listener = () => this.onUiChanged();
        this.lastUiCompletePosition = null;
        this.joinOperatorId = 0;
      }
      setParams(params) {
        super.setParams(params);
        const optionsFactory = new OptionsFactory();
        this.optionsFactory = optionsFactory;
        optionsFactory.init(params, this.defaultOptions);
        this.commonUpdateSimpleParams(params);
        this.createOption();
        this.createMissingConditionsAndOperators();
      }
      updateParams(newParams, oldParams) {
        this.optionsFactory.refresh(newParams, this.defaultOptions);
        super.updateParams(newParams, oldParams);
        this.commonUpdateSimpleParams(newParams);
      }
      commonUpdateSimpleParams(params) {
        this.setNumConditions(params);
        this.defaultJoinOperator = getDefaultJoinOperator(params.defaultJoinOperator);
        this.filterPlaceholder = params.filterPlaceholder;
        this.createFilterListOptions();
        const eGui = this.getGui();
        if (this.isReadOnly()) {
          eGui.setAttribute("tabindex", "-1");
        } else {
          eGui.removeAttribute("tabindex");
        }
      }
      // floating filter calls this when user applies filter from floating filter
      onFloatingFilterChanged(type, value2) {
        this.setTypeFromFloatingFilter(type);
        this.setValueFromFloatingFilter(value2);
        this.onUiChanged("immediately", true);
      }
      setTypeFromFloatingFilter(type) {
        this.eTypes.forEach((eType, position) => {
          const value2 = position === 0 ? type : this.optionsFactory.defaultOption;
          eType.setValue(value2, true);
        });
      }
      getModelFromUi() {
        const conditions = this.getUiCompleteConditions();
        if (conditions.length === 0) {
          return null;
        }
        if (this.maxNumConditions > 1 && conditions.length > 1) {
          return {
            filterType: this.filterType,
            operator: this.getJoinOperator(),
            conditions
          };
        }
        return conditions[0];
      }
      getConditionTypes() {
        return this.eTypes.map((eType) => eType.getValue());
      }
      getConditionType(position) {
        return this.eTypes[position].getValue();
      }
      getJoinOperator() {
        const { eJoinOrs: eJoinOperatorsOr, defaultJoinOperator } = this;
        return eJoinOperatorsOr.length === 0 ? defaultJoinOperator : eJoinOperatorsOr[0].getValue() === true ? "OR" : "AND";
      }
      areNonNullModelsEqual(a, b) {
        const aIsSimple = !a.operator;
        const bIsSimple = !b.operator;
        const oneSimpleOneCombined = !aIsSimple && bIsSimple || aIsSimple && !bIsSimple;
        if (oneSimpleOneCombined) {
          return false;
        }
        let res;
        if (aIsSimple) {
          const aSimple = a;
          const bSimple = b;
          res = this.areSimpleModelsEqual(aSimple, bSimple);
        } else {
          const aCombined = a;
          const bCombined = b;
          res = aCombined.operator === bCombined.operator && _areEqual(
            aCombined.conditions,
            bCombined.conditions,
            (aModel, bModel) => this.areSimpleModelsEqual(aModel, bModel)
          );
        }
        return res;
      }
      setModelIntoUi(model2, isInitialLoad) {
        if (model2 == null) {
          this.resetUiToDefaults(isInitialLoad);
          return AgPromise.resolve();
        }
        const isCombined = model2.operator;
        if (isCombined) {
          const combinedModel = model2;
          let conditions = combinedModel.conditions;
          if (conditions == null) {
            conditions = [];
            _warn(77);
          }
          const numConditions = validateAndUpdateConditions(conditions, this.maxNumConditions);
          const numPrevConditions = this.getNumConditions();
          if (numConditions < numPrevConditions) {
            this.removeConditionsAndOperators(numConditions);
          } else if (numConditions > numPrevConditions) {
            for (let i2 = numPrevConditions; i2 < numConditions; i2++) {
              this.createJoinOperatorPanel();
              this.createOption();
            }
          }
          const orChecked = combinedModel.operator === "OR";
          this.eJoinAnds.forEach((eJoinOperatorAnd) => eJoinOperatorAnd.setValue(!orChecked, true));
          this.eJoinOrs.forEach((eJoinOperatorOr) => eJoinOperatorOr.setValue(orChecked, true));
          conditions.forEach((condition, position) => {
            this.eTypes[position].setValue(condition.type, true);
            this.setConditionIntoUi(condition, position);
          });
        } else {
          const simpleModel = model2;
          if (this.getNumConditions() > 1) {
            this.removeConditionsAndOperators(1);
          }
          this.eTypes[0].setValue(simpleModel.type, true);
          this.setConditionIntoUi(simpleModel, 0);
        }
        this.lastUiCompletePosition = this.getNumConditions() - 1;
        this.createMissingConditionsAndOperators();
        this.updateUiVisibility();
        if (!isInitialLoad) {
          this.params.onUiChange(this.getUiChangeEventParams());
        }
        return AgPromise.resolve();
      }
      setNumConditions(params) {
        let maxNumConditions = params.maxNumConditions ?? 2;
        if (maxNumConditions < 1) {
          _warn(79);
          maxNumConditions = 1;
        }
        this.maxNumConditions = maxNumConditions;
        let numAlwaysVisibleConditions = params.numAlwaysVisibleConditions ?? 1;
        if (numAlwaysVisibleConditions < 1) {
          _warn(80);
          numAlwaysVisibleConditions = 1;
        }
        if (numAlwaysVisibleConditions > maxNumConditions) {
          _warn(81);
          numAlwaysVisibleConditions = maxNumConditions;
        }
        this.numAlwaysVisibleConditions = numAlwaysVisibleConditions;
      }
      createOption() {
        const eGui = this.getGui();
        const eType = this.createManagedBean(new AgSelect());
        this.eTypes.push(eType);
        eType.addCss("ag-filter-select");
        eGui.appendChild(eType.getGui());
        const eConditionBody = this.createEValue();
        this.eConditionBodies.push(eConditionBody);
        eGui.appendChild(eConditionBody);
        this.putOptionsIntoDropdown(eType);
        this.resetType(eType);
        const position = this.getNumConditions() - 1;
        this.forEachPositionInput(position, (element) => this.resetInput(element));
        this.addChangedListeners(eType, position);
      }
      createJoinOperatorPanel() {
        const eJoinOperatorPanel = _createElement({ tag: "div", cls: "ag-filter-condition" });
        this.eJoinPanels.push(eJoinOperatorPanel);
        const eJoinOperatorAnd = this.createJoinOperator(this.eJoinAnds, eJoinOperatorPanel, "and");
        const eJoinOperatorOr = this.createJoinOperator(this.eJoinOrs, eJoinOperatorPanel, "or");
        this.getGui().appendChild(eJoinOperatorPanel);
        const index = this.eJoinPanels.length - 1;
        const uniqueGroupId = this.joinOperatorId++;
        this.resetJoinOperatorAnd(eJoinOperatorAnd, index, uniqueGroupId);
        this.resetJoinOperatorOr(eJoinOperatorOr, index, uniqueGroupId);
        if (!this.isReadOnly()) {
          eJoinOperatorAnd.onValueChange(this.listener);
          eJoinOperatorOr.onValueChange(this.listener);
        }
      }
      createJoinOperator(eJoinOperators, eJoinOperatorPanel, andOr) {
        const eJoinOperator = this.createManagedBean(new AgRadioButton());
        eJoinOperators.push(eJoinOperator);
        const baseClass = "ag-filter-condition-operator";
        eJoinOperator.addCss(baseClass);
        eJoinOperator.addCss(`${baseClass}-${andOr}`);
        eJoinOperatorPanel.appendChild(eJoinOperator.getGui());
        return eJoinOperator;
      }
      createFilterListOptions() {
        this.filterListOptions = this.optionsFactory.filterOptions.map(
          (option) => typeof option === "string" ? this.createBoilerplateListOption(option) : this.createCustomListOption(option)
        );
      }
      putOptionsIntoDropdown(eType) {
        const { filterListOptions } = this;
        for (const listOption of filterListOptions) {
          eType.addOption(listOption);
        }
        eType.setDisabled(filterListOptions.length <= 1);
      }
      createBoilerplateListOption(option) {
        return { value: option, text: this.translate(option) };
      }
      createCustomListOption(option) {
        const { displayKey } = option;
        const customOption = this.optionsFactory.getCustomOption(option.displayKey);
        return {
          value: displayKey,
          text: customOption ? this.getLocaleTextFunc()(customOption.displayKey, customOption.displayName) : this.translate(displayKey)
        };
      }
      createBodyTemplate() {
        return null;
      }
      getAgComponents() {
        return [];
      }
      updateUiVisibility() {
        const joinOperator = this.getJoinOperator();
        this.updateNumConditions();
        this.updateConditionStatusesAndValues(this.lastUiCompletePosition, joinOperator);
      }
      updateNumConditions() {
        let lastUiCompletePosition = -1;
        let areAllConditionsUiComplete = true;
        for (let position = 0; position < this.getNumConditions(); position++) {
          if (this.isConditionUiComplete(position)) {
            lastUiCompletePosition = position;
          } else {
            areAllConditionsUiComplete = false;
          }
        }
        if (this.shouldAddNewConditionAtEnd(areAllConditionsUiComplete)) {
          this.createJoinOperatorPanel();
          this.createOption();
        } else {
          const activePosition = this.lastUiCompletePosition ?? this.getNumConditions() - 2;
          if (lastUiCompletePosition < activePosition) {
            this.removeConditionsAndOperators(activePosition + 1);
            const removeStartPosition = lastUiCompletePosition + 1;
            const numConditionsToRemove = activePosition - removeStartPosition;
            if (numConditionsToRemove > 0) {
              this.removeConditionsAndOperators(removeStartPosition, numConditionsToRemove);
            }
            this.createMissingConditionsAndOperators();
          }
        }
        this.lastUiCompletePosition = lastUiCompletePosition;
      }
      updateConditionStatusesAndValues(lastUiCompletePosition, joinOperator) {
        this.eTypes.forEach((eType, position) => {
          const disabled2 = this.isConditionDisabled(position, lastUiCompletePosition);
          eType.setDisabled(disabled2 || this.filterListOptions.length <= 1);
          if (position === 1) {
            _setDisabled(this.eJoinPanels[0], disabled2);
            this.eJoinAnds[0].setDisabled(disabled2);
            this.eJoinOrs[0].setDisabled(disabled2);
          }
        });
        this.eConditionBodies.forEach((element, index) => {
          _setDisplayed(element, this.isConditionBodyVisible(index));
        });
        const orChecked = (joinOperator ?? this.getJoinOperator()) === "OR";
        for (const eJoinOperatorAnd of this.eJoinAnds) {
          eJoinOperatorAnd.setValue(!orChecked, true);
        }
        for (const eJoinOperatorOr of this.eJoinOrs) {
          eJoinOperatorOr.setValue(orChecked, true);
        }
        this.forEachInput((element, index, position, numberOfInputs) => {
          this.setElementDisplayed(element, index < numberOfInputs);
          this.setElementDisabled(element, this.isConditionDisabled(position, lastUiCompletePosition));
        });
        this.resetPlaceholder();
      }
      shouldAddNewConditionAtEnd(areAllConditionsUiComplete) {
        return areAllConditionsUiComplete && this.getNumConditions() < this.maxNumConditions && !this.isReadOnly();
      }
      removeConditionsAndOperators(startPosition, deleteCount) {
        if (startPosition >= this.getNumConditions()) {
          return;
        }
        const {
          eTypes,
          eConditionBodies,
          eJoinPanels: eJoinOperatorPanels,
          eJoinAnds: eJoinOperatorsAnd,
          eJoinOrs: eJoinOperatorsOr
        } = this;
        this.removeComponents(eTypes, startPosition, deleteCount);
        this.removeElements(eConditionBodies, startPosition, deleteCount);
        this.removeEValues(startPosition, deleteCount);
        const joinOperatorIndex = Math.max(startPosition - 1, 0);
        this.removeElements(eJoinOperatorPanels, joinOperatorIndex, deleteCount);
        this.removeComponents(eJoinOperatorsAnd, joinOperatorIndex, deleteCount);
        this.removeComponents(eJoinOperatorsOr, joinOperatorIndex, deleteCount);
      }
      removeElements(elements, startPosition, deleteCount) {
        const removedElements = removeItems(elements, startPosition, deleteCount);
        for (const element of removedElements) {
          _removeFromParent(element);
        }
      }
      removeComponents(components, startPosition, deleteCount) {
        const removedComponents = removeItems(components, startPosition, deleteCount);
        for (const comp2 of removedComponents) {
          _removeFromParent(comp2.getGui());
          this.destroyBean(comp2);
        }
      }
      afterGuiAttached(params) {
        super.afterGuiAttached(params);
        this.resetPlaceholder();
        if (!params?.suppressFocus) {
          let elementToFocus;
          if (!this.isReadOnly()) {
            const firstInput = this.getInputs(0)[0];
            if (firstInput instanceof AgAbstractInputField && this.isConditionBodyVisible(0)) {
              elementToFocus = firstInput.getInputElement();
            } else {
              elementToFocus = this.eTypes[0]?.getFocusableElement();
            }
          }
          (elementToFocus ?? this.getGui()).focus({ preventScroll: true });
        }
      }
      afterGuiDetached() {
        super.afterGuiDetached();
        const params = this.params;
        if (this.beans.colFilter?.shouldKeepStateOnDetach(params.column)) {
          return;
        }
        params.onStateChange({
          model: params.model
        });
        let lastUiCompletePosition = -1;
        let updatedLastUiCompletePosition = -1;
        let conditionsRemoved = false;
        const joinOperator = this.getJoinOperator();
        for (let position = this.getNumConditions() - 1; position >= 0; position--) {
          if (this.isConditionUiComplete(position)) {
            if (lastUiCompletePosition === -1) {
              lastUiCompletePosition = position;
              updatedLastUiCompletePosition = position;
            }
          } else {
            const shouldRemovePositionAtEnd = position >= this.numAlwaysVisibleConditions && !this.isConditionUiComplete(position - 1);
            const positionBeforeLastUiCompletePosition = position < lastUiCompletePosition;
            if (shouldRemovePositionAtEnd || positionBeforeLastUiCompletePosition) {
              this.removeConditionsAndOperators(position, 1);
              conditionsRemoved = true;
              if (positionBeforeLastUiCompletePosition) {
                updatedLastUiCompletePosition--;
              }
            }
          }
        }
        let shouldUpdateConditionStatusesAndValues = false;
        if (this.getNumConditions() < this.numAlwaysVisibleConditions) {
          this.createMissingConditionsAndOperators();
          shouldUpdateConditionStatusesAndValues = true;
        }
        if (this.shouldAddNewConditionAtEnd(updatedLastUiCompletePosition === this.getNumConditions() - 1)) {
          this.createJoinOperatorPanel();
          this.createOption();
          shouldUpdateConditionStatusesAndValues = true;
        }
        if (shouldUpdateConditionStatusesAndValues) {
          this.updateConditionStatusesAndValues(updatedLastUiCompletePosition, joinOperator);
        }
        if (conditionsRemoved) {
          this.updateJoinOperatorsDisabled();
        }
        this.lastUiCompletePosition = updatedLastUiCompletePosition;
      }
      getModelAsString(model2) {
        return this.params.getHandler()?.getModelAsString?.(model2) ?? "";
      }
      getPlaceholderText(defaultPlaceholder, position) {
        let placeholder = this.translate(defaultPlaceholder);
        if (typeof this.filterPlaceholder === "function") {
          const filterOptionKey = this.eTypes[position].getValue();
          const filterOption = this.translate(filterOptionKey);
          placeholder = this.filterPlaceholder({
            filterOptionKey,
            filterOption,
            placeholder
          });
        } else if (typeof this.filterPlaceholder === "string") {
          placeholder = this.filterPlaceholder;
        }
        return placeholder;
      }
      // allow sub-classes to reset HTML placeholders after UI update.
      resetPlaceholder() {
        const globalTranslate = this.getLocaleTextFunc();
        this.forEachInput((element, index, position, numberOfInputs) => {
          if (!(element instanceof AgAbstractInputField)) {
            return;
          }
          const placeholder = index === 0 && numberOfInputs > 1 ? "inRangeStart" : index === 0 ? "filterOoo" : "inRangeEnd";
          const ariaLabel = index === 0 && numberOfInputs > 1 ? globalTranslate("ariaFilterFromValue", "Filter from value") : index === 0 ? globalTranslate("ariaFilterValue", "Filter Value") : globalTranslate("ariaFilterToValue", "Filter to Value");
          element.setInputPlaceholder(this.getPlaceholderText(placeholder, position));
          element.setInputAriaLabel(ariaLabel);
        });
      }
      // eslint-disable-next-line @typescript-eslint/no-unused-vars
      setElementValue(element, value2, fromFloatingFilter) {
        if (element instanceof AgAbstractInputField) {
          element.setValue(value2 != null ? String(value2) : null, true);
        }
      }
      setElementDisplayed(element, displayed) {
        if (_isComponent(element)) {
          _setDisplayed(element.getGui(), displayed);
        }
      }
      setElementDisabled(element, disabled2) {
        if (_isComponent(element)) {
          _setDisabled(element.getGui(), disabled2);
        }
      }
      attachElementOnChange(element, listener) {
        if (element instanceof AgAbstractInputField) {
          element.onValueChange(listener);
        }
      }
      forEachInput(cb) {
        this.getConditionTypes().forEach((type, position) => {
          this.forEachPositionTypeInput(position, type, cb);
        });
      }
      forEachPositionInput(position, cb) {
        const type = this.getConditionType(position);
        this.forEachPositionTypeInput(position, type, cb);
      }
      forEachPositionTypeInput(position, type, cb) {
        const numberOfInputs = getNumberOfInputs(type, this.optionsFactory);
        const inputs = this.getInputs(position);
        for (let index = 0; index < inputs.length; index++) {
          const input2 = inputs[index];
          if (input2 != null) {
            cb(input2, index, position, numberOfInputs);
          }
        }
      }
      isConditionDisabled(position, lastUiCompletePosition) {
        if (this.isReadOnly()) {
          return true;
        }
        if (position === 0) {
          return false;
        }
        return position > lastUiCompletePosition + 1;
      }
      isConditionBodyVisible(position) {
        const type = this.getConditionType(position);
        const numberOfInputs = getNumberOfInputs(type, this.optionsFactory);
        return numberOfInputs > 0;
      }
      // returns true if the UI represents a working filter, eg all parts are filled out.
      // eg if text filter and textfield blank then returns false.
      isConditionUiComplete(position) {
        if (position >= this.getNumConditions()) {
          return false;
        }
        const type = this.getConditionType(position);
        if (type === "empty") {
          return false;
        }
        if (this.getValues(position).some((v) => v == null)) {
          return false;
        }
        return true;
      }
      getNumConditions() {
        return this.eTypes.length;
      }
      getUiCompleteConditions() {
        const conditions = [];
        for (let position = 0; position < this.getNumConditions(); position++) {
          if (this.isConditionUiComplete(position)) {
            conditions.push(this.createCondition(position));
          }
        }
        return conditions;
      }
      createMissingConditionsAndOperators() {
        if (this.isReadOnly()) {
          return;
        }
        for (let i2 = this.getNumConditions(); i2 < this.numAlwaysVisibleConditions; i2++) {
          this.createJoinOperatorPanel();
          this.createOption();
        }
      }
      resetUiToDefaults(silent) {
        this.removeConditionsAndOperators(this.isReadOnly() ? 1 : this.numAlwaysVisibleConditions);
        this.eTypes.forEach((eType) => this.resetType(eType));
        this.eJoinAnds.forEach(
          (eJoinOperatorAnd, index) => this.resetJoinOperatorAnd(eJoinOperatorAnd, index, this.joinOperatorId + index)
        );
        this.eJoinOrs.forEach(
          (eJoinOperatorOr, index) => this.resetJoinOperatorOr(eJoinOperatorOr, index, this.joinOperatorId + index)
        );
        this.joinOperatorId++;
        this.forEachInput((element) => this.resetInput(element));
        this.resetPlaceholder();
        this.createMissingConditionsAndOperators();
        this.lastUiCompletePosition = null;
        this.updateUiVisibility();
        if (!silent) {
          this.params.onUiChange(this.getUiChangeEventParams());
        }
      }
      resetType(eType) {
        const translate = this.getLocaleTextFunc();
        const filteringLabel = translate("ariaFilteringOperator", "Filtering operator");
        eType.setValue(this.optionsFactory.defaultOption, true).setAriaLabel(filteringLabel).setDisabled(this.isReadOnly() || this.filterListOptions.length <= 1);
      }
      resetJoinOperatorAnd(eJoinOperatorAnd, index, uniqueGroupId) {
        this.resetJoinOperator(
          eJoinOperatorAnd,
          index,
          this.defaultJoinOperator === "AND",
          this.translate("andCondition"),
          uniqueGroupId
        );
      }
      resetJoinOperatorOr(eJoinOperatorOr, index, uniqueGroupId) {
        this.resetJoinOperator(
          eJoinOperatorOr,
          index,
          this.defaultJoinOperator === "OR",
          this.translate("orCondition"),
          uniqueGroupId
        );
      }
      resetJoinOperator(eJoinOperator, index, value2, label2, uniqueGroupId) {
        this.updateJoinOperatorDisabled(
          eJoinOperator.setValue(value2, true).setName(`ag-simple-filter-and-or-${this.getCompId()}-${uniqueGroupId}`).setLabel(label2),
          index
        );
      }
      updateJoinOperatorsDisabled() {
        const updater = (eJoinOperator, index) => this.updateJoinOperatorDisabled(eJoinOperator, index);
        this.eJoinAnds.forEach(updater);
        this.eJoinOrs.forEach(updater);
      }
      updateJoinOperatorDisabled(eJoinOperator, index) {
        eJoinOperator.setDisabled(this.isReadOnly() || index > 0);
      }
      resetInput(element) {
        this.setElementValue(element, null);
        this.setElementDisabled(element, this.isReadOnly());
      }
      // puts model values into the UI
      setConditionIntoUi(model2, position) {
        const values = this.mapValuesFromModel(model2, this.optionsFactory);
        this.forEachInput((element, index, elPosition) => {
          if (elPosition !== position) {
            return;
          }
          this.setElementValue(element, values[index] != null ? values[index] : null);
        });
      }
      // after floating filter changes, this sets the 'value' section. this is implemented by the base class
      // (as that's where value is controlled), the 'type' part from the floating filter is dealt with in this class.
      setValueFromFloatingFilter(value2) {
        this.forEachInput((element, index, position) => {
          this.setElementValue(element, index === 0 && position === 0 ? value2 : null, true);
        });
      }
      addChangedListeners(eType, position) {
        if (this.isReadOnly()) {
          return;
        }
        eType.onValueChange(this.listener);
        this.forEachPositionInput(position, (element) => {
          this.attachElementOnChange(element, this.listener);
        });
      }
      hasInvalidInputs() {
        return false;
      }
      isReadOnly() {
        return !!this.params.readOnly;
      }
    };
    var DateCompWrapper = class {
      constructor(context, userCompFactory, colDef, dateComponentParams, eParent, onReady) {
        this.alive = true;
        this.context = context;
        this.eParent = eParent;
        const compDetails = _getDateCompDetails(userCompFactory, colDef, dateComponentParams);
        if (!compDetails) {
          return;
        }
        compDetails.newAgStackInstance().then((dateComp) => {
          if (!this.alive) {
            context.destroyBean(dateComp);
            return;
          }
          this.dateComp = dateComp;
          if (!dateComp) {
            return;
          }
          eParent.appendChild(dateComp.getGui());
          dateComp?.afterGuiAttached?.();
          const { tempValue, disabled: disabled2 } = this;
          if (tempValue) {
            dateComp.setDate(tempValue);
          }
          if (disabled2 != null) {
            dateComp.setDisabled?.(disabled2);
          }
          onReady?.(this);
        });
      }
      destroy() {
        this.alive = false;
        this.dateComp = this.context.destroyBean(this.dateComp);
      }
      getDate() {
        return this.dateComp ? this.dateComp.getDate() : this.tempValue;
      }
      setDate(value2) {
        const dateComp = this.dateComp;
        if (dateComp) {
          dateComp.setDate(value2);
        } else {
          this.tempValue = value2;
        }
      }
      setDisabled(disabled2) {
        const dateComp = this.dateComp;
        if (dateComp) {
          dateComp.setDisabled?.(disabled2);
        } else {
          this.disabled = disabled2;
        }
      }
      setDisplayed(displayed) {
        _setDisplayed(this.eParent, displayed);
      }
      setInputPlaceholder(placeholder) {
        this.dateComp?.setInputPlaceholder?.(placeholder);
      }
      setInputAriaLabel(label2) {
        this.dateComp?.setInputAriaLabel?.(label2);
      }
      afterGuiAttached(params) {
        this.dateComp?.afterGuiAttached?.(params);
      }
      updateParams(params) {
        this.dateComp?.refresh?.(params);
      }
    };
    var DEFAULT_DATE_FILTER_OPTIONS = [
      "equals",
      "notEqual",
      "lessThan",
      "greaterThan",
      "inRange",
      "blank",
      "notBlank"
    ];
    function mapValuesFromDateFilterModel(filterModel, optionsFactory) {
      const { dateFrom, dateTo, type } = filterModel || {};
      return [
        dateFrom && _parseDateTimeFromString(dateFrom, void 0, true) || null,
        dateTo && _parseDateTimeFromString(dateTo, void 0, true) || null
      ].slice(0, getNumberOfInputs(type, optionsFactory));
    }
    var DEFAULT_MIN_YEAR = 1e3;
    var DEFAULT_MAX_YEAR = Infinity;
    var DateFilter = class extends SimpleFilter {
      constructor() {
        super("dateFilter", mapValuesFromDateFilterModel, DEFAULT_DATE_FILTER_OPTIONS);
        this.eConditionPanelsFrom = [];
        this.eConditionPanelsTo = [];
        this.dateConditionFromComps = [];
        this.dateConditionToComps = [];
        this.minValidYear = DEFAULT_MIN_YEAR;
        this.maxValidYear = DEFAULT_MAX_YEAR;
        this.minValidDate = null;
        this.maxValidDate = null;
        this.filterType = "date";
      }
      afterGuiAttached(params) {
        super.afterGuiAttached(params);
        this.dateConditionFromComps[0].afterGuiAttached(params);
      }
      commonUpdateSimpleParams(params) {
        super.commonUpdateSimpleParams(params);
        const yearParser = (param, fallback) => {
          const value2 = params[param];
          if (value2 != null) {
            if (!isNaN(value2)) {
              return value2 == null ? fallback : Number(value2);
            } else {
              _warn(82, { param });
            }
          }
          return fallback;
        };
        const minValidYear = yearParser("minValidYear", DEFAULT_MIN_YEAR);
        const maxValidYear = yearParser("maxValidYear", DEFAULT_MAX_YEAR);
        this.minValidYear = minValidYear;
        this.maxValidYear = maxValidYear;
        if (minValidYear > maxValidYear) {
          _warn(83);
        }
        const { minValidDate, maxValidDate } = params;
        const parsedMinValidDate = minValidDate instanceof Date ? minValidDate : _parseDateTimeFromString(minValidDate);
        this.minValidDate = parsedMinValidDate;
        const parsedMaxValidDate = maxValidDate instanceof Date ? maxValidDate : _parseDateTimeFromString(maxValidDate);
        this.maxValidDate = parsedMaxValidDate;
        if (parsedMinValidDate && parsedMaxValidDate && parsedMinValidDate > parsedMaxValidDate) {
          _warn(84);
        }
      }
      createDateCompWrapper(element) {
        const {
          beans: { userCompFactory, context, gos },
          params
        } = this;
        const dateCompWrapper = new DateCompWrapper(
          context,
          userCompFactory,
          params.colDef,
          _addGridCommonParams(gos, {
            onDateChanged: () => this.onUiChanged(),
            filterParams: params,
            location: "filter"
          }),
          element
        );
        this.addDestroyFunc(() => dateCompWrapper.destroy());
        return dateCompWrapper;
      }
      setElementValue(element, value2) {
        element.setDate(value2);
      }
      setElementDisplayed(element, displayed) {
        element.setDisplayed(displayed);
      }
      setElementDisabled(element, disabled2) {
        element.setDisabled(disabled2);
      }
      createEValue() {
        const eCondition = _createElement({ tag: "div", cls: "ag-filter-body" });
        this.createFromToElement(eCondition, this.eConditionPanelsFrom, this.dateConditionFromComps, "from");
        this.createFromToElement(eCondition, this.eConditionPanelsTo, this.dateConditionToComps, "to");
        return eCondition;
      }
      createFromToElement(eCondition, eConditionPanels, dateConditionComps, fromTo) {
        const eConditionPanel = _createElement({ tag: "div", cls: `ag-filter-${fromTo} ag-filter-date-${fromTo}` });
        eConditionPanels.push(eConditionPanel);
        eCondition.appendChild(eConditionPanel);
        dateConditionComps.push(this.createDateCompWrapper(eConditionPanel));
      }
      removeEValues(startPosition, deleteCount) {
        this.removeDateComps(this.dateConditionFromComps, startPosition, deleteCount);
        this.removeDateComps(this.dateConditionToComps, startPosition, deleteCount);
        removeItems(this.eConditionPanelsFrom, startPosition, deleteCount);
        removeItems(this.eConditionPanelsTo, startPosition, deleteCount);
      }
      removeDateComps(components, startPosition, deleteCount) {
        const removedComponents = removeItems(components, startPosition, deleteCount);
        for (const comp2 of removedComponents) {
          comp2.destroy();
        }
      }
      isValidDateValue(value2) {
        if (value2 === null) {
          return false;
        }
        const { minValidDate, maxValidDate, minValidYear, maxValidYear } = this;
        if (minValidDate) {
          if (value2 < minValidDate) {
            return false;
          }
        } else if (value2.getUTCFullYear() < minValidYear) {
          return false;
        }
        if (maxValidDate) {
          if (value2 > maxValidDate) {
            return false;
          }
        } else if (value2.getUTCFullYear() > maxValidYear) {
          return false;
        }
        return true;
      }
      isConditionUiComplete(position) {
        if (!super.isConditionUiComplete(position)) {
          return false;
        }
        let valid = true;
        this.forEachInput((element, index, elPosition, numberOfInputs) => {
          if (elPosition !== position || !valid || index >= numberOfInputs) {
            return;
          }
          valid = valid && this.isValidDateValue(element.getDate());
        });
        return valid;
      }
      areSimpleModelsEqual(aSimple, bSimple) {
        return aSimple.dateFrom === bSimple.dateFrom && aSimple.dateTo === bSimple.dateTo && aSimple.type === bSimple.type;
      }
      createCondition(position) {
        const type = this.getConditionType(position);
        const model2 = {};
        const values = this.getValues(position);
        const separator2 = this.params.useIsoSeparator ? "T" : " ";
        if (values.length > 0) {
          model2.dateFrom = _serialiseDate(values[0], true, separator2);
        }
        if (values.length > 1) {
          model2.dateTo = _serialiseDate(values[1], true, separator2);
        }
        return {
          dateFrom: null,
          dateTo: null,
          filterType: this.filterType,
          type,
          ...model2
        };
      }
      resetPlaceholder() {
        const globalTranslate = this.getLocaleTextFunc();
        const placeholder = this.translate("dateFormatOoo");
        const ariaLabel = globalTranslate("ariaFilterValue", "Filter Value");
        this.forEachInput((element) => {
          element.setInputPlaceholder(placeholder);
          element.setInputAriaLabel(ariaLabel);
        });
      }
      getInputs(position) {
        const { dateConditionFromComps, dateConditionToComps } = this;
        if (position >= dateConditionFromComps.length) {
          return [null, null];
        }
        return [dateConditionFromComps[position], dateConditionToComps[position]];
      }
      getValues(position) {
        const result2 = [];
        this.forEachPositionInput(position, (element, index, _elPosition, numberOfInputs) => {
          if (index < numberOfInputs) {
            result2.push(element.getDate());
          }
        });
        return result2;
      }
      translate(key2) {
        if (key2 === "lessThan") {
          return super.translate("before");
        }
        if (key2 === "greaterThan") {
          return super.translate("after");
        }
        return super.translate(key2);
      }
    };
    var SimpleFilterHandler = class extends BeanStub {
      constructor(mapValuesFromModel, defaultOptions2) {
        super();
        this.mapValuesFromModel = mapValuesFromModel;
        this.defaultOptions = defaultOptions2;
      }
      init(params) {
        const filterParams = params.filterParams;
        const optionsFactory = new OptionsFactory();
        this.optionsFactory = optionsFactory;
        optionsFactory.init(filterParams, this.defaultOptions);
        this.filterModelFormatter = this.createManagedBean(
          new this.FilterModelFormatterClass(optionsFactory, filterParams)
        );
        this.updateParams(params);
        this.validateModel(params);
      }
      refresh(params) {
        if (params.source === "colDef") {
          const filterParams = params.filterParams;
          const optionsFactory = this.optionsFactory;
          optionsFactory.refresh(filterParams, this.defaultOptions);
          this.filterModelFormatter.updateParams({ optionsFactory, filterParams });
          this.updateParams(params);
        }
        this.validateModel(params);
      }
      updateParams(params) {
        this.params = params;
      }
      doesFilterPass(params) {
        const model2 = params.model;
        if (model2 == null) {
          return true;
        }
        const { operator: operator2 } = model2;
        const models2 = [];
        if (operator2) {
          const combinedModel = model2;
          models2.push(...combinedModel.conditions ?? []);
        } else {
          models2.push(model2);
        }
        const combineFunction = operator2 && operator2 === "OR" ? "some" : "every";
        const cellValue = this.params.getValue(params.node);
        return models2[combineFunction]((m) => this.individualConditionPasses(params, m, cellValue));
      }
      getModelAsString(model2, source2) {
        return this.filterModelFormatter.getModelAsString(model2, source2) ?? "";
      }
      validateModel(params) {
        const {
          model: model2,
          filterParams: { filterOptions, maxNumConditions }
        } = params;
        if (model2 == null) {
          return;
        }
        const isCombined = isCombinedFilterModel(model2);
        let conditions = isCombined ? model2.conditions : [model2];
        const newOptionsList = filterOptions?.map((option) => typeof option === "string" ? option : option.displayKey) ?? this.defaultOptions;
        const allConditionsExistInNewOptionsList = !conditions || conditions.every((condition) => newOptionsList.find((option) => option === condition.type) !== void 0);
        if (!allConditionsExistInNewOptionsList) {
          this.params = {
            ...params,
            model: null
          };
          params.onModelChange(null);
          return;
        }
        let needsUpdate = false;
        const filterType = this.filterType;
        if (conditions && !conditions.every((condition) => condition.filterType === filterType) || model2.filterType !== filterType) {
          conditions = conditions.map((condition) => ({ ...condition, filterType }));
          needsUpdate = true;
        }
        if (typeof maxNumConditions === "number" && conditions && conditions.length > maxNumConditions) {
          conditions = conditions.slice(0, maxNumConditions);
          needsUpdate = true;
        }
        if (needsUpdate) {
          const updatedModel = conditions.length > 1 ? {
            ...model2,
            filterType,
            conditions
          } : {
            ...conditions[0],
            filterType
          };
          this.params = {
            ...params,
            model: updatedModel
          };
          params.onModelChange(updatedModel);
        }
      }
      /** returns true if the row passes the said condition */
      individualConditionPasses(params, filterModel, cellValue) {
        const optionsFactory = this.optionsFactory;
        const values = this.mapValuesFromModel(filterModel, optionsFactory);
        const customFilterOption = optionsFactory.getCustomOption(filterModel.type);
        const customFilterResult = evaluateCustomFilter(customFilterOption, values, cellValue);
        if (customFilterResult != null) {
          return customFilterResult;
        }
        if (cellValue == null) {
          return this.evaluateNullValue(filterModel.type);
        }
        return this.evaluateNonNullValue(values, cellValue, filterModel, params);
      }
    };
    var ScalarFilterHandler = class extends SimpleFilterHandler {
      evaluateNullValue(filterType) {
        const {
          includeBlanksInEquals,
          includeBlanksInNotEqual,
          includeBlanksInGreaterThan,
          includeBlanksInLessThan,
          includeBlanksInRange
        } = this.params.filterParams;
        switch (filterType) {
          case "equals":
            if (includeBlanksInEquals) {
              return true;
            }
            break;
          case "notEqual":
            if (includeBlanksInNotEqual) {
              return true;
            }
            break;
          case "greaterThan":
          case "greaterThanOrEqual":
            if (includeBlanksInGreaterThan) {
              return true;
            }
            break;
          case "lessThan":
          case "lessThanOrEqual":
            if (includeBlanksInLessThan) {
              return true;
            }
            break;
          case "inRange":
            if (includeBlanksInRange) {
              return true;
            }
            break;
          case "blank":
            return true;
          case "notBlank":
            return false;
        }
        return false;
      }
      evaluateNonNullValue(values, cellValue, filterModel) {
        const type = filterModel.type;
        if (!this.isValid(cellValue)) {
          return type === "notEqual" || type === "notBlank";
        }
        const comparator = this.comparator();
        const compareResult = values[0] != null ? comparator(values[0], cellValue) : 0;
        switch (type) {
          case "equals":
            return compareResult === 0;
          case "notEqual":
            return compareResult !== 0;
          case "greaterThan":
            return compareResult > 0;
          case "greaterThanOrEqual":
            return compareResult >= 0;
          case "lessThan":
            return compareResult < 0;
          case "lessThanOrEqual":
            return compareResult <= 0;
          case "inRange": {
            const compareToResult = comparator(values[1], cellValue);
            return this.params.filterParams.inRangeInclusive ? compareResult >= 0 && compareToResult <= 0 : compareResult > 0 && compareToResult < 0;
          }
          case "blank":
            return isBlank(cellValue);
          case "notBlank":
            return !isBlank(cellValue);
          default:
            _warn(76, { filterModelType: type });
            return true;
        }
      }
    };
    var SCALAR_FILTER_TYPE_KEYS = {
      equals: "Equals",
      notEqual: "NotEqual",
      greaterThan: "GreaterThan",
      greaterThanOrEqual: "GreaterThanOrEqual",
      lessThan: "LessThan",
      lessThanOrEqual: "LessThanOrEqual",
      inRange: "InRange"
    };
    var TEXT_FILTER_TYPE_KEYS = {
      contains: "Contains",
      notContains: "NotContains",
      equals: "TextEquals",
      notEqual: "TextNotEqual",
      startsWith: "StartsWith",
      endsWith: "EndsWith",
      inRange: "InRange"
    };
    var SimpleFilterModelFormatter = class extends BeanStub {
      constructor(optionsFactory, filterParams, valueFormatter) {
        super();
        this.optionsFactory = optionsFactory;
        this.filterParams = filterParams;
        this.valueFormatter = valueFormatter;
      }
      // used by:
      // 1) NumberFloatingFilter & TextFloatingFilter: Always, for both when editable and read only.
      // 2) DateFloatingFilter: Only when read only (as we show text rather than a date picker when read only)
      getModelAsString(model2, source2) {
        const translate = this.getLocaleTextFunc();
        const forToolPanel = source2 === "filterToolPanel";
        if (!model2) {
          return forToolPanel ? translateForFilter(this, "filterSummaryInactive") : null;
        }
        const isCombined = model2.operator != null;
        if (isCombined) {
          const combinedModel = model2;
          const conditions = combinedModel.conditions ?? [];
          const customOptions = conditions.map((condition) => this.getModelAsString(condition, source2));
          const joinOperatorTranslateKey = combinedModel.operator === "AND" ? "andCondition" : "orCondition";
          return customOptions.join(` ${translateForFilter(this, joinOperatorTranslateKey)} `);
        } else if (model2.type === "blank" || model2.type === "notBlank") {
          return forToolPanel ? translateForFilter(this, model2.type === "blank" ? "filterSummaryBlank" : "filterSummaryNotBlank") : translate(model2.type, model2.type);
        } else {
          const condition = model2;
          const customOption = this.optionsFactory.getCustomOption(condition.type);
          const { displayKey, displayName, numberOfInputs } = customOption || {};
          if (displayKey && displayName && numberOfInputs === 0) {
            return translate(displayKey, displayName);
          }
          return this.conditionToString(
            condition,
            forToolPanel,
            condition.type === "inRange" || numberOfInputs === 2,
            displayKey,
            displayName
          );
        }
      }
      updateParams(params) {
        const { optionsFactory, filterParams } = params;
        this.optionsFactory = optionsFactory;
        this.filterParams = filterParams;
      }
      conditionForToolPanel(type, isRange, getFilter, getFilterTo, customDisplayKey, customDisplayName) {
        let typeValue;
        const typeKey = this.getTypeKey(type);
        if (typeKey) {
          typeValue = translateForFilter(this, typeKey);
        }
        if (customDisplayKey && customDisplayName) {
          typeValue = this.getLocaleTextFunc()(customDisplayKey, customDisplayName);
        }
        if (typeValue != null) {
          if (isRange) {
            return `${typeValue} ${translateForFilter(this, "filterSummaryInRangeValues", [getFilter(), getFilterTo()])}`;
          } else {
            return `${typeValue} ${getFilter()}`;
          }
        }
        return null;
      }
      getTypeKey(type) {
        const suffix = this.filterTypeKeys[type];
        return suffix ? `filterSummary${suffix}` : null;
      }
      formatValue(value2) {
        const valueFormatter = this.valueFormatter;
        return valueFormatter ? valueFormatter(value2 ?? null) ?? "" : String(value2);
      }
    };
    var DateFilterModelFormatter = class extends SimpleFilterModelFormatter {
      constructor(optionsFactory, filterParams) {
        super(optionsFactory, filterParams, (value2) => {
          const { dataTypeSvc, valueSvc } = this.beans;
          const column2 = filterParams.column;
          const dateFormatFn = dataTypeSvc?.getDateFormatterFunction(column2);
          const valueToFormat = dateFormatFn ? dateFormatFn(value2 ?? void 0) : value2;
          return valueSvc.formatValue(column2, null, valueToFormat);
        });
        this.filterTypeKeys = SCALAR_FILTER_TYPE_KEYS;
      }
      conditionToString(condition, forToolPanel, isRange, customDisplayKey, customDisplayName) {
        const { type } = condition;
        const dateFrom = _parseDateTimeFromString(condition.dateFrom);
        const dateTo = _parseDateTimeFromString(condition.dateTo);
        const format2 = this.filterParams.inRangeFloatingFilterDateFormat;
        const formatDate = forToolPanel ? this.formatValue.bind(this) : (value2) => _dateToFormattedString(value2, format2);
        const formattedFrom = () => dateFrom !== null ? formatDate(dateFrom) : "null";
        const formattedTo = () => dateTo !== null ? formatDate(dateTo) : "null";
        if (forToolPanel) {
          const valueForToolPanel = this.conditionForToolPanel(
            type,
            isRange,
            formattedFrom,
            formattedTo,
            customDisplayKey,
            customDisplayName
          );
          if (valueForToolPanel != null) {
            return valueForToolPanel;
          }
        }
        if (isRange) {
          return `${formattedFrom()}-${formattedTo()}`;
        }
        if (dateFrom != null) {
          return formatDate(dateFrom);
        }
        return `${type}`;
      }
    };
    function defaultDateComparator(filterDate, cellValue) {
      const cellAsDate = cellValue;
      if (cellAsDate < filterDate) {
        return -1;
      }
      if (cellAsDate > filterDate) {
        return 1;
      }
      return 0;
    }
    var DateFilterHandler = class extends ScalarFilterHandler {
      constructor() {
        super(mapValuesFromDateFilterModel, DEFAULT_DATE_FILTER_OPTIONS);
        this.filterType = "date";
        this.FilterModelFormatterClass = DateFilterModelFormatter;
      }
      comparator() {
        return this.params.filterParams.comparator ?? defaultDateComparator;
      }
      isValid(value2) {
        const isValidDate2 = this.params.filterParams.isValidDate;
        return !isValidDate2 || isValidDate2(value2);
      }
    };
    var SimpleFloatingFilter = class extends Component {
      constructor() {
        super(...arguments);
        this.defaultDebounceMs = 0;
      }
      setLastTypeFromModel(model2) {
        if (!model2) {
          this.lastType = this.optionsFactory.defaultOption;
          return;
        }
        const isCombined = model2.operator;
        let condition;
        if (isCombined) {
          const combinedModel = model2;
          condition = combinedModel.conditions[0];
        } else {
          condition = model2;
        }
        this.lastType = condition.type;
      }
      canWeEditAfterModelFromParentFilter(model2) {
        if (!model2) {
          return this.isTypeEditable(this.lastType);
        }
        const isCombined = model2.operator;
        if (isCombined) {
          return false;
        }
        const simpleModel = model2;
        return this.isTypeEditable(simpleModel.type);
      }
      init(params) {
        this.params = params;
        const reactive = this.gos.get("enableFilterHandlers");
        this.reactive = reactive;
        this.setParams(params);
        if (reactive) {
          const reactiveParams = params;
          this.onModelUpdated(reactiveParams.model);
        }
      }
      setParams(params) {
        const optionsFactory = new OptionsFactory();
        this.optionsFactory = optionsFactory;
        optionsFactory.init(params.filterParams, this.defaultOptions);
        this.filterModelFormatter = this.createManagedBean(
          new this.FilterModelFormatterClass(optionsFactory, params.filterParams)
        );
        this.setSimpleParams(params, false);
      }
      setSimpleParams(params, update = true) {
        const defaultOption = this.optionsFactory.defaultOption;
        if (!update) {
          this.lastType = defaultOption;
        }
        this.readOnly = !!params.filterParams.readOnly;
        const editable2 = this.isTypeEditable(defaultOption);
        this.setEditable(editable2);
      }
      refresh(params) {
        this.params = params;
        const reactiveParams = params;
        const reactive = this.reactive;
        if (!reactive || reactiveParams.source === "colDef") {
          this.updateParams(params);
        }
        if (reactive) {
          const { source: source2, model: model2 } = reactiveParams;
          if (source2 === "dataChanged" || source2 === "ui") {
            return;
          }
          this.onModelUpdated(model2);
        }
      }
      updateParams(params) {
        const optionsFactory = this.optionsFactory;
        optionsFactory.refresh(params.filterParams, this.defaultOptions);
        this.setSimpleParams(params);
        this.filterModelFormatter.updateParams({
          optionsFactory,
          filterParams: params.filterParams
        });
      }
      onParentModelChanged(model2, event) {
        if (event?.afterFloatingFilter || event?.afterDataChange) {
          return;
        }
        this.onModelUpdated(model2);
      }
      hasSingleInput(filterType) {
        const numberOfInputs = this.optionsFactory.getCustomOption(filterType)?.numberOfInputs;
        return numberOfInputs == null || numberOfInputs == 1;
      }
      isTypeEditable(type) {
        const uneditableTypes = ["inRange", "empty", "blank", "notBlank"];
        return !!type && !this.readOnly && this.hasSingleInput(type) && uneditableTypes.indexOf(type) < 0;
      }
      getAriaLabel(params) {
        const displayName = this.beans.colNames.getDisplayNameForColumn(params.column, "header", true);
        return `${displayName} ${this.getLocaleTextFunc()("ariaFilterInput", "Filter Input")}`;
      }
    };
    var DateFloatingFilterElement = {
      tag: "div",
      cls: "ag-floating-filter-input",
      role: "presentation",
      children: [
        {
          tag: "ag-input-text-field",
          ref: "eReadOnlyText"
        },
        { tag: "div", ref: "eDateWrapper", cls: "ag-date-floating-filter-wrapper" }
      ]
    };
    var DateFloatingFilter = class extends SimpleFloatingFilter {
      constructor() {
        super(DateFloatingFilterElement, [AgInputTextFieldSelector]);
        this.eReadOnlyText = RefPlaceholder;
        this.eDateWrapper = RefPlaceholder;
        this.FilterModelFormatterClass = DateFilterModelFormatter;
        this.filterType = "date";
        this.defaultOptions = DEFAULT_DATE_FILTER_OPTIONS;
      }
      setParams(params) {
        super.setParams(params);
        this.createDateComponent();
        const translate = this.getLocaleTextFunc();
        this.eReadOnlyText.setDisabled(true).setInputAriaLabel(translate("ariaDateFilterInput", "Date Filter Input"));
      }
      updateParams(params) {
        super.updateParams(params);
        this.dateComp.updateParams(this.getDateComponentParams());
        this.updateCompOnModelChange(params.currentParentModel());
      }
      updateCompOnModelChange(model2) {
        const allowEditing = !this.readOnly && this.canWeEditAfterModelFromParentFilter(model2);
        this.setEditable(allowEditing);
        if (allowEditing) {
          const dateModel = model2 ? _parseDateTimeFromString(model2.dateFrom) : null;
          this.dateComp.setDate(dateModel);
          this.eReadOnlyText.setValue("");
        } else {
          this.eReadOnlyText.setValue(this.filterModelFormatter.getModelAsString(model2));
          this.dateComp.setDate(null);
        }
      }
      setEditable(editable2) {
        _setDisplayed(this.eDateWrapper, editable2);
        _setDisplayed(this.eReadOnlyText.getGui(), !editable2);
      }
      onModelUpdated(model2) {
        super.setLastTypeFromModel(model2);
        this.updateCompOnModelChange(model2);
      }
      onDateChanged() {
        const filterValueDate = this.dateComp.getDate();
        if (this.reactive) {
          const reactiveParams = this.params;
          reactiveParams.onUiChange();
          const model2 = reactiveParams.model;
          const filterValueText = _serialiseDate(filterValueDate);
          const newModel = filterValueText == null ? null : {
            ...model2 ?? {
              filterType: this.filterType,
              type: this.lastType ?? this.optionsFactory.defaultOption
            },
            dateFrom: filterValueText
          };
          reactiveParams.onModelChange(newModel, { afterFloatingFilter: true });
        } else {
          this.params.parentFilterInstance((filterInstance) => {
            filterInstance?.onFloatingFilterChanged(this.lastType || null, filterValueDate);
          });
        }
      }
      getDateComponentParams() {
        const { filterParams } = this.params;
        const debounceMs = getDebounceMs(filterParams, this.defaultDebounceMs);
        return _addGridCommonParams(this.gos, {
          onDateChanged: _debounce(this, this.onDateChanged.bind(this), debounceMs),
          filterParams,
          location: "floatingFilter"
        });
      }
      createDateComponent() {
        const {
          beans: { context, userCompFactory },
          eDateWrapper,
          params
        } = this;
        this.dateComp = new DateCompWrapper(
          context,
          userCompFactory,
          params.column.getColDef(),
          this.getDateComponentParams(),
          eDateWrapper,
          (dateComp) => {
            dateComp.setInputAriaLabel(this.getAriaLabel(params));
          }
        );
        this.addDestroyFunc(() => this.dateComp.destroy());
      }
    };
    var DefaultDateElement = {
      tag: "div",
      cls: "ag-filter-filter",
      children: [
        {
          tag: "ag-input-text-field",
          ref: "eDateInput",
          cls: "ag-date-filter"
        }
      ]
    };
    var DefaultDateComponent = class extends Component {
      constructor() {
        super(DefaultDateElement, [AgInputTextFieldSelector]);
        this.eDateInput = RefPlaceholder;
        this.isApply = false;
        this.applyOnFocusOut = false;
      }
      init(params) {
        this.params = params;
        this.setParams(params);
        const inputElement = this.eDateInput.getInputElement();
        this.addManagedListeners(inputElement, {
          // ensures that the input element is focussed when a clear button is clicked,
          // unless using safari as there is no clear button and focus does not work properly
          mouseDown: () => {
            if (this.eDateInput.isDisabled() || this.usingSafariDatePicker) {
              return;
            }
            inputElement.focus({ preventScroll: true });
          },
          input: this.handleInput.bind(this, false),
          change: this.handleInput.bind(this, true),
          focusout: this.handleFocusOut.bind(this)
        });
      }
      handleInput(isChange) {
        if (this.eDateInput.isDisabled()) {
          return;
        }
        if (this.isApply) {
          this.applyOnFocusOut = !isChange;
          if (isChange) {
            this.params.onDateChanged();
          }
          return;
        }
        if (!isChange) {
          this.params.onDateChanged();
        }
      }
      handleFocusOut() {
        if (this.applyOnFocusOut) {
          this.applyOnFocusOut = false;
          this.params.onDateChanged();
        }
      }
      setParams(params) {
        const inputElement = this.eDateInput.getInputElement();
        const shouldUseBrowserDatePicker = this.shouldUseBrowserDatePicker(params);
        this.usingSafariDatePicker = shouldUseBrowserDatePicker && _isBrowserSafari();
        const { minValidYear, maxValidYear, minValidDate, maxValidDate, buttons, includeTime, colDef } = params.filterParams || {};
        const dataTypeSvc = this.beans.dataTypeSvc;
        const shouldUseDateTimeLocal = includeTime ?? dataTypeSvc?.getDateIncludesTimeFlag?.(colDef.cellDataType) ?? false;
        if (shouldUseBrowserDatePicker) {
          if (shouldUseDateTimeLocal) {
            inputElement.type = "datetime-local";
            inputElement.step = "1";
          } else {
            inputElement.type = "date";
          }
        } else {
          inputElement.type = "text";
        }
        if (minValidDate && minValidYear) {
          _warn(85);
        }
        if (maxValidDate && maxValidYear) {
          _warn(86);
        }
        if (minValidDate && maxValidDate) {
          const [parsedMinValidDate, parsedMaxValidDate] = [minValidDate, maxValidDate].map(
            (v) => v instanceof Date ? v : _parseDateTimeFromString(v)
          );
          if (parsedMinValidDate && parsedMaxValidDate && parsedMinValidDate.getTime() > parsedMaxValidDate.getTime()) {
            _warn(87);
          }
        }
        if (minValidDate) {
          if (minValidDate instanceof Date) {
            inputElement.min = _dateToFormattedString(minValidDate);
          } else {
            inputElement.min = minValidDate;
          }
        } else if (minValidYear) {
          inputElement.min = `${minValidYear}-01-01`;
        }
        if (maxValidDate) {
          if (maxValidDate instanceof Date) {
            inputElement.max = _dateToFormattedString(maxValidDate);
          } else {
            inputElement.max = maxValidDate;
          }
        } else if (maxValidYear) {
          inputElement.max = `${maxValidYear}-12-31`;
        }
        this.isApply = params.location === "floatingFilter" && !!buttons?.includes("apply");
      }
      refresh(params) {
        this.params = params;
        this.setParams(params);
      }
      getDate() {
        return _parseDateTimeFromString(this.eDateInput.getValue());
      }
      setDate(date) {
        const colType = this.params.filterParams.colDef.cellDataType;
        const includeTime = this.beans.dataTypeSvc?.getDateIncludesTimeFlag(colType) ?? false;
        this.eDateInput.setValue(_serialiseDate(date, includeTime));
      }
      setInputPlaceholder(placeholder) {
        this.eDateInput.setInputPlaceholder(placeholder);
      }
      setInputAriaLabel(ariaLabel) {
        this.eDateInput.setAriaLabel(ariaLabel);
      }
      setDisabled(disabled2) {
        this.eDateInput.setDisabled(disabled2);
      }
      afterGuiAttached(params) {
        if (!params?.suppressFocus) {
          this.eDateInput.getInputElement().focus({ preventScroll: true });
        }
      }
      shouldUseBrowserDatePicker(params) {
        return params?.filterParams?.browserDatePicker ?? true;
      }
    };
    var DEFAULT_NUMBER_FILTER_OPTIONS = [
      "equals",
      "notEqual",
      "greaterThan",
      "greaterThanOrEqual",
      "lessThan",
      "lessThanOrEqual",
      "inRange",
      "blank",
      "notBlank"
    ];
    function getAllowedCharPattern(filterParams) {
      const { allowedCharPattern } = filterParams ?? {};
      return allowedCharPattern ?? null;
    }
    function processNumberFilterValue(value2) {
      if (value2 == null) {
        return null;
      }
      return isNaN(value2) ? null : value2;
    }
    function mapValuesFromNumberFilterModel(filterModel, optionsFactory) {
      const { filter, filterTo, type } = filterModel || {};
      return [processNumberFilterValue(filter), processNumberFilterValue(filterTo)].slice(
        0,
        getNumberOfInputs(type, optionsFactory)
      );
    }
    var NumberFilter = class extends SimpleFilter {
      constructor() {
        super("numberFilter", mapValuesFromNumberFilterModel, DEFAULT_NUMBER_FILTER_OPTIONS);
        this.eValuesFrom = [];
        this.eValuesTo = [];
        this.filterType = "number";
        this.defaultDebounceMs = 500;
      }
      setElementValue(element, value2, fromFloatingFilter) {
        const { numberFormatter } = this.params;
        const valueToSet = !fromFloatingFilter && numberFormatter ? numberFormatter(value2 ?? null) : value2;
        super.setElementValue(element, valueToSet);
      }
      createEValue() {
        const allowedCharPattern = getAllowedCharPattern(this.params);
        const eCondition = _createElement({ tag: "div", cls: "ag-filter-body", role: "presentation" });
        this.createFromToElement(eCondition, this.eValuesFrom, "from", allowedCharPattern);
        this.createFromToElement(eCondition, this.eValuesTo, "to", allowedCharPattern);
        return eCondition;
      }
      createFromToElement(eCondition, eValues, fromTo, allowedCharPattern) {
        const eValue = this.createManagedBean(
          allowedCharPattern ? new AgInputTextField({ allowedCharPattern }) : new AgInputNumberField()
        );
        eValue.addCss(`ag-filter-${fromTo}`);
        eValue.addCss("ag-filter-filter");
        eValues.push(eValue);
        eCondition.appendChild(eValue.getGui());
      }
      removeEValues(startPosition, deleteCount) {
        const removeComps = (eGui) => this.removeComponents(eGui, startPosition, deleteCount);
        removeComps(this.eValuesFrom);
        removeComps(this.eValuesTo);
      }
      getValues(position) {
        const result2 = [];
        this.forEachPositionInput(position, (element, index, _elPosition, numberOfInputs) => {
          if (index < numberOfInputs) {
            result2.push(processNumberFilterValue(this.stringToFloat(element.getValue())));
          }
        });
        return result2;
      }
      areSimpleModelsEqual(aSimple, bSimple) {
        return aSimple.filter === bSimple.filter && aSimple.filterTo === bSimple.filterTo && aSimple.type === bSimple.type;
      }
      stringToFloat(value2) {
        if (typeof value2 === "number") {
          return value2;
        }
        let filterText = _makeNull(value2);
        if (filterText != null && filterText.trim() === "") {
          filterText = null;
        }
        const numberParser = this.params.numberParser;
        if (numberParser) {
          return numberParser(filterText);
        }
        return filterText == null || filterText.trim() === "-" ? null : Number.parseFloat(filterText);
      }
      createCondition(position) {
        const type = this.getConditionType(position);
        const model2 = {
          filterType: this.filterType,
          type
        };
        const values = this.getValues(position);
        if (values.length > 0) {
          model2.filter = values[0];
        }
        if (values.length > 1) {
          model2.filterTo = values[1];
        }
        return model2;
      }
      getInputs(position) {
        const { eValuesFrom, eValuesTo } = this;
        if (position >= eValuesFrom.length) {
          return [null, null];
        }
        return [eValuesFrom[position], eValuesTo[position]];
      }
      hasInvalidInputs() {
        let invalidInputs = false;
        this.forEachInput((element) => {
          if (!element.getInputElement().validity.valid) {
            invalidInputs = true;
          }
        });
        return invalidInputs;
      }
    };
    var NumberFilterModelFormatter = class extends SimpleFilterModelFormatter {
      constructor(optionsFactory, filterParams) {
        super(optionsFactory, filterParams, filterParams.numberFormatter);
        this.filterTypeKeys = SCALAR_FILTER_TYPE_KEYS;
      }
      conditionToString(condition, forToolPanel, isRange, customDisplayKey, customDisplayName) {
        const { filter, filterTo, type } = condition;
        const formatValue = this.formatValue.bind(this);
        if (forToolPanel) {
          const valueForToolPanel = this.conditionForToolPanel(
            type,
            isRange,
            () => formatValue(filter),
            () => formatValue(filterTo),
            customDisplayKey,
            customDisplayName
          );
          if (valueForToolPanel != null) {
            return valueForToolPanel;
          }
        }
        if (isRange) {
          return `${formatValue(filter)}-${formatValue(filterTo)}`;
        }
        if (filter != null) {
          return formatValue(filter);
        }
        return `${type}`;
      }
    };
    var NumberFilterHandler = class extends ScalarFilterHandler {
      constructor() {
        super(mapValuesFromNumberFilterModel, DEFAULT_NUMBER_FILTER_OPTIONS);
        this.filterType = "number";
        this.FilterModelFormatterClass = NumberFilterModelFormatter;
      }
      comparator() {
        return (left2, right2) => {
          if (left2 === right2) {
            return 0;
          }
          return left2 < right2 ? 1 : -1;
        };
      }
      isValid(value2) {
        return !isNaN(value2);
      }
    };
    var FloatingFilterTextInputService = class extends BeanStub {
      constructor(params) {
        super();
        this.params = params;
        this.eInput = RefPlaceholder;
        this.onValueChanged = () => {
        };
      }
      setupGui(parentElement) {
        this.eInput = this.createManagedBean(new AgInputTextField(this.params?.config));
        const eInput = this.eInput.getGui();
        parentElement.appendChild(eInput);
        const listener = (e) => this.onValueChanged(e);
        this.addManagedListeners(eInput, {
          input: listener,
          keydown: listener
        });
      }
      setEditable(editable2) {
        this.eInput.setDisabled(!editable2);
      }
      getValue() {
        return this.eInput.getValue();
      }
      setValue(value2, silent) {
        this.eInput.setValue(value2, silent);
      }
      setValueChangedListener(listener) {
        this.onValueChanged = listener;
      }
      setParams({ ariaLabel, autoComplete }) {
        const { eInput } = this;
        eInput.setInputAriaLabel(ariaLabel);
        if (autoComplete !== void 0) {
          eInput.setAutoComplete(autoComplete);
        }
      }
    };
    function trimInputForFilter(value2) {
      const trimmedInput = value2?.trim();
      return trimmedInput === "" ? value2 : trimmedInput;
    }
    function mapValuesFromTextFilterModel(filterModel, optionsFactory) {
      const { filter, filterTo, type } = filterModel || {};
      return [filter || null, filterTo || null].slice(0, getNumberOfInputs(type, optionsFactory));
    }
    var TextInputFloatingFilterElement = {
      tag: "div",
      ref: "eFloatingFilterInputContainer",
      cls: "ag-floating-filter-input",
      role: "presentation"
    };
    var TextInputFloatingFilter = class extends SimpleFloatingFilter {
      constructor() {
        super(...arguments);
        this.eFloatingFilterInputContainer = RefPlaceholder;
        this.defaultDebounceMs = 500;
      }
      postConstruct() {
        this.setTemplate(TextInputFloatingFilterElement);
      }
      onModelUpdated(model2) {
        this.setLastTypeFromModel(model2);
        this.setEditable(this.canWeEditAfterModelFromParentFilter(model2));
        this.inputSvc.setValue(this.filterModelFormatter.getModelAsString(model2));
      }
      setParams(params) {
        this.setupFloatingFilterInputService(params);
        super.setParams(params);
        this.setTextInputParams(params);
      }
      setupFloatingFilterInputService(params) {
        this.inputSvc = this.createFloatingFilterInputService(params);
        this.inputSvc.setupGui(this.eFloatingFilterInputContainer);
      }
      setTextInputParams(params) {
        const autoComplete = params.browserAutoComplete ?? false;
        const { inputSvc, defaultDebounceMs, readOnly: readOnly2 } = this;
        inputSvc.setParams({
          ariaLabel: this.getAriaLabel(params),
          autoComplete
        });
        this.applyActive = _isUseApplyButton(params.filterParams);
        if (!readOnly2) {
          const debounceMs = getDebounceMs(params.filterParams, defaultDebounceMs);
          const toDebounce = _debounce(
            this,
            this.syncUpWithParentFilter.bind(this),
            debounceMs
          );
          inputSvc.setValueChangedListener(toDebounce);
        }
      }
      updateParams(params) {
        super.updateParams(params);
        this.setTextInputParams(params);
      }
      recreateFloatingFilterInputService(params) {
        const { inputSvc } = this;
        const value2 = inputSvc.getValue();
        _clearElement(this.eFloatingFilterInputContainer);
        this.destroyBean(inputSvc);
        this.setupFloatingFilterInputService(params);
        inputSvc.setValue(value2, true);
      }
      syncUpWithParentFilter(e) {
        const isEnterKey = e.key === KeyCode.ENTER;
        const reactive = this.reactive;
        if (reactive) {
          const reactiveParams = this.params;
          reactiveParams.onUiChange();
        }
        if (this.applyActive && !isEnterKey) {
          return;
        }
        const { inputSvc, params, lastType } = this;
        let value2 = inputSvc.getValue();
        if (params.filterParams.trimInput) {
          value2 = trimInputForFilter(value2);
          inputSvc.setValue(value2, true);
        }
        if (reactive) {
          const reactiveParams = params;
          const model2 = reactiveParams.model;
          const parsedValue = this.convertValue(value2);
          const newModel = parsedValue == null ? null : {
            ...model2 ?? {
              filterType: this.filterType,
              type: lastType ?? this.optionsFactory.defaultOption
            },
            filter: parsedValue
          };
          reactiveParams.onModelChange(newModel, { afterFloatingFilter: true });
        } else {
          params.parentFilterInstance((filterInstance) => {
            filterInstance?.onFloatingFilterChanged(lastType || null, value2 || null);
          });
        }
      }
      convertValue(value2) {
        return value2 || null;
      }
      setEditable(editable2) {
        this.inputSvc.setEditable(editable2);
      }
    };
    var FloatingFilterNumberInputService = class extends BeanStub {
      constructor() {
        super(...arguments);
        this.onValueChanged = () => {
        };
        this.numberInputActive = true;
      }
      setupGui(parentElement) {
        this.eNumberInput = this.createManagedBean(new AgInputNumberField());
        this.eTextInput = this.createManagedBean(new AgInputTextField());
        this.eTextInput.setDisabled(true);
        const eNumberInput = this.eNumberInput.getGui();
        const eTextInput = this.eTextInput.getGui();
        parentElement.appendChild(eNumberInput);
        parentElement.appendChild(eTextInput);
        this.setupListeners(eNumberInput, (e) => this.onValueChanged(e));
        this.setupListeners(eTextInput, (e) => this.onValueChanged(e));
      }
      setEditable(editable2) {
        this.numberInputActive = editable2;
        this.eNumberInput.setDisplayed(this.numberInputActive);
        this.eTextInput.setDisplayed(!this.numberInputActive);
      }
      setAutoComplete(autoComplete) {
        this.eNumberInput.setAutoComplete(autoComplete);
        this.eTextInput.setAutoComplete(autoComplete);
      }
      getValue() {
        return this.getActiveInputElement().getValue();
      }
      setValue(value2, silent) {
        this.getActiveInputElement().setValue(value2, silent);
      }
      getActiveInputElement() {
        return this.numberInputActive ? this.eNumberInput : this.eTextInput;
      }
      setValueChangedListener(listener) {
        this.onValueChanged = listener;
      }
      setupListeners(element, listener) {
        this.addManagedListeners(element, {
          input: listener,
          keydown: listener
        });
      }
      setParams(params) {
        this.setAriaLabel(params.ariaLabel);
        if (params.autoComplete !== void 0) {
          this.setAutoComplete(params.autoComplete);
        }
      }
      setAriaLabel(ariaLabel) {
        this.eNumberInput.setInputAriaLabel(ariaLabel);
        this.eTextInput.setInputAriaLabel(ariaLabel);
      }
    };
    var NumberFloatingFilter = class extends TextInputFloatingFilter {
      constructor() {
        super(...arguments);
        this.FilterModelFormatterClass = NumberFilterModelFormatter;
        this.filterType = "number";
        this.defaultOptions = DEFAULT_NUMBER_FILTER_OPTIONS;
      }
      updateParams(params) {
        const allowedCharPattern = getAllowedCharPattern(params.filterParams);
        if (allowedCharPattern !== this.allowedCharPattern) {
          this.recreateFloatingFilterInputService(params);
        }
        super.updateParams(params);
      }
      createFloatingFilterInputService(params) {
        this.allowedCharPattern = getAllowedCharPattern(params.filterParams);
        if (this.allowedCharPattern) {
          return this.createManagedBean(
            new FloatingFilterTextInputService({
              config: { allowedCharPattern: this.allowedCharPattern }
            })
          );
        }
        return this.createManagedBean(new FloatingFilterNumberInputService());
      }
      convertValue(value2) {
        return value2 ? Number(value2) : null;
      }
    };
    var DEFAULT_TEXT_FILTER_OPTIONS = [
      "contains",
      "notContains",
      "equals",
      "notEqual",
      "startsWith",
      "endsWith",
      "blank",
      "notBlank"
    ];
    var TextFilter = class extends SimpleFilter {
      constructor() {
        super("textFilter", mapValuesFromTextFilterModel, DEFAULT_TEXT_FILTER_OPTIONS);
        this.filterType = "text";
        this.eValuesFrom = [];
        this.eValuesTo = [];
        this.defaultDebounceMs = 500;
      }
      createCondition(position) {
        const type = this.getConditionType(position);
        const model2 = {
          filterType: this.filterType,
          type
        };
        const values = this.getValues(position);
        if (values.length > 0) {
          model2.filter = values[0];
        }
        if (values.length > 1) {
          model2.filterTo = values[1];
        }
        return model2;
      }
      areSimpleModelsEqual(aSimple, bSimple) {
        return aSimple.filter === bSimple.filter && aSimple.filterTo === bSimple.filterTo && aSimple.type === bSimple.type;
      }
      getInputs(position) {
        const { eValuesFrom, eValuesTo } = this;
        if (position >= eValuesFrom.length) {
          return [null, null];
        }
        return [eValuesFrom[position], eValuesTo[position]];
      }
      getValues(position) {
        const result2 = [];
        this.forEachPositionInput(position, (element, index, _elPosition, numberOfInputs) => {
          if (index < numberOfInputs) {
            result2.push(_makeNull(element.getValue()));
          }
        });
        return result2;
      }
      createEValue() {
        const eCondition = _createElement({ tag: "div", cls: "ag-filter-body", role: "presentation" });
        const { eValuesFrom, eValuesTo } = this;
        this.createFromToElement(eCondition, eValuesFrom, "from");
        this.createFromToElement(eCondition, eValuesTo, "to");
        return eCondition;
      }
      createFromToElement(eCondition, eValues, fromTo) {
        const eValue = this.createManagedBean(new AgInputTextField());
        eValue.addCss(`ag-filter-${fromTo}`);
        eValue.addCss("ag-filter-filter");
        eValues.push(eValue);
        eCondition.appendChild(eValue.getGui());
      }
      removeEValues(startPosition, deleteCount) {
        const removeComps = (eGui) => this.removeComponents(eGui, startPosition, deleteCount);
        const { eValuesFrom, eValuesTo } = this;
        removeComps(eValuesFrom);
        removeComps(eValuesTo);
      }
    };
    var TextFilterModelFormatter = class extends SimpleFilterModelFormatter {
      constructor() {
        super(...arguments);
        this.filterTypeKeys = TEXT_FILTER_TYPE_KEYS;
      }
      conditionToString(condition, forToolPanel, isRange, customDisplayKey, customDisplayName) {
        const { filter, filterTo, type } = condition;
        if (forToolPanel) {
          const getValueFunc = (value2) => () => translateForFilter(this, "filterSummaryTextQuote", [value2]);
          const valueForToolPanel = this.conditionForToolPanel(
            type,
            isRange,
            getValueFunc(filter),
            getValueFunc(filterTo),
            customDisplayKey,
            customDisplayName
          );
          if (valueForToolPanel != null) {
            return valueForToolPanel;
          }
        }
        if (isRange) {
          return `${filter}-${filterTo}`;
        }
        if (filter != null) {
          return `${filter}`;
        }
        return `${type}`;
      }
    };
    var defaultMatcher = ({ filterOption, value: value2, filterText }) => {
      if (filterText == null) {
        return false;
      }
      switch (filterOption) {
        case "contains":
          return value2.includes(filterText);
        case "notContains":
          return !value2.includes(filterText);
        case "equals":
          return value2 === filterText;
        case "notEqual":
          return value2 != filterText;
        case "startsWith":
          return value2.indexOf(filterText) === 0;
        case "endsWith": {
          const index = value2.lastIndexOf(filterText);
          return index >= 0 && index === value2.length - filterText.length;
        }
        default:
          return false;
      }
    };
    var defaultFormatter = (from) => from;
    var defaultLowercaseFormatter = (from) => from == null ? null : from.toString().toLowerCase();
    var TextFilterHandler = class extends SimpleFilterHandler {
      constructor() {
        super(mapValuesFromTextFilterModel, DEFAULT_TEXT_FILTER_OPTIONS);
        this.filterType = "text";
        this.FilterModelFormatterClass = TextFilterModelFormatter;
      }
      updateParams(params) {
        super.updateParams(params);
        const filterParams = params.filterParams;
        this.matcher = filterParams.textMatcher ?? defaultMatcher;
        this.formatter = filterParams.textFormatter ?? (filterParams.caseSensitive ? defaultFormatter : defaultLowercaseFormatter);
      }
      evaluateNullValue(filterType) {
        const filterTypesAllowNulls = ["notEqual", "notContains", "blank"];
        return filterType ? filterTypesAllowNulls.indexOf(filterType) >= 0 : false;
      }
      evaluateNonNullValue(values, cellValue, filterModel, params) {
        const formattedValues = values.map((v) => this.formatter(v)) || [];
        const cellValueFormatted = this.formatter(cellValue);
        const {
          api: api2,
          colDef,
          column: column2,
          context,
          filterParams: { textFormatter }
        } = this.params;
        if (filterModel.type === "blank") {
          return isBlank(cellValue);
        } else if (filterModel.type === "notBlank") {
          return !isBlank(cellValue);
        }
        const matcherParams = {
          api: api2,
          colDef,
          column: column2,
          context,
          node: params.node,
          data: params.data,
          filterOption: filterModel.type,
          value: cellValueFormatted,
          textFormatter
        };
        return formattedValues.some((v) => this.matcher({ ...matcherParams, filterText: v }));
      }
      processModelToApply(model2) {
        if (model2 && this.params.filterParams.trimInput) {
          const processCondition = (condition) => {
            const newCondition = {
              ...condition
            };
            const { filter, filterTo } = condition;
            if (filter) {
              newCondition.filter = trimInputForFilter(filter) ?? null;
            }
            if (filterTo) {
              newCondition.filterTo = trimInputForFilter(filterTo) ?? null;
            }
            return newCondition;
          };
          if (isCombinedFilterModel(model2)) {
            return {
              ...model2,
              conditions: model2.conditions.map(processCondition)
            };
          }
          return processCondition(model2);
        }
        return model2;
      }
    };
    var TextFloatingFilter = class extends TextInputFloatingFilter {
      constructor() {
        super(...arguments);
        this.FilterModelFormatterClass = TextFilterModelFormatter;
        this.filterType = "text";
        this.defaultOptions = DEFAULT_TEXT_FILTER_OPTIONS;
      }
      createFloatingFilterInputService() {
        return this.createManagedBean(new FloatingFilterTextInputService());
      }
    };
    function isQuickFilterPresent(beans) {
      return !!beans.quickFilter?.isFilterPresent();
    }
    function getQuickFilter(beans) {
      return beans.quickFilter?.getText();
    }
    function resetQuickFilter(beans) {
      beans.quickFilter?.resetCache();
    }
    var QuickFilterService = class extends BeanStub {
      constructor() {
        super(...arguments);
        this.beanName = "quickFilter";
        this.quickFilter = null;
        this.quickFilterParts = null;
      }
      postConstruct() {
        const resetListener = this.resetCache.bind(this);
        const gos = this.gos;
        this.addManagedEventListeners({
          columnPivotModeChanged: resetListener,
          newColumnsLoaded: resetListener,
          columnRowGroupChanged: resetListener,
          columnVisible: () => {
            if (!gos.get("includeHiddenColumnsInQuickFilter")) {
              this.resetCache();
            }
          }
        });
        this.addManagedPropertyListener("quickFilterText", (e) => this.setFilter(e.currentValue));
        this.addManagedPropertyListeners(
          ["includeHiddenColumnsInQuickFilter", "applyQuickFilterBeforePivotOrAgg"],
          () => this.onColumnConfigChanged()
        );
        this.quickFilter = this.parseFilter(gos.get("quickFilterText"));
        this.parser = gos.get("quickFilterParser");
        this.matcher = gos.get("quickFilterMatcher");
        this.setFilterParts();
        this.addManagedPropertyListeners(["quickFilterMatcher", "quickFilterParser"], () => this.setParserAndMatcher());
      }
      // if we are using autoGroupCols, then they should be included for quick filter. this covers the
      // following scenarios:
      // a) user provides 'field' into autoGroupCol of normal grid, so now because a valid col to filter leafs on
      // b) using tree data and user depends on autoGroupCol for first col, and we also want to filter on this
      //    (tree data is a bit different, as parent rows can be filtered on, unlike row grouping)
      refreshCols() {
        const { autoColSvc, colModel, gos, pivotResultCols } = this.beans;
        const pivotMode = colModel.isPivotMode();
        const groupAutoCols = autoColSvc?.getColumns();
        const providedCols = colModel.getColDefCols();
        let columnsForQuickFilter = (pivotMode && !gos.get("applyQuickFilterBeforePivotOrAgg") ? pivotResultCols?.getPivotResultCols()?.list : providedCols) ?? [];
        if (groupAutoCols) {
          columnsForQuickFilter = columnsForQuickFilter.concat(groupAutoCols);
        }
        this.colsToUse = gos.get("includeHiddenColumnsInQuickFilter") ? columnsForQuickFilter : columnsForQuickFilter.filter((col) => col.isVisible() || col.isRowGroupActive());
      }
      isFilterPresent() {
        return this.quickFilter !== null;
      }
      doesRowPass(node2) {
        const usingCache = this.gos.get("cacheQuickFilter");
        if (this.matcher) {
          return this.doesRowPassMatcher(usingCache, node2);
        }
        return this.quickFilterParts.every(
          (part2) => usingCache ? this.doesRowPassCache(node2, part2) : this.doesRowPassNoCache(node2, part2)
        );
      }
      resetCache() {
        this.beans.rowModel.forEachNode((node2) => node2.quickFilterAggregateText = null);
      }
      getText() {
        return this.gos.get("quickFilterText");
      }
      setFilterParts() {
        const { quickFilter, parser: parser2 } = this;
        if (quickFilter) {
          this.quickFilterParts = parser2 ? parser2(quickFilter) : quickFilter.split(" ");
        } else {
          this.quickFilterParts = null;
        }
      }
      parseFilter(newFilter) {
        if (!_exists(newFilter)) {
          return null;
        }
        return newFilter.toUpperCase();
      }
      setFilter(newFilter) {
        if (newFilter != null && typeof newFilter !== "string") {
          _warn(70, { newFilter });
          return;
        }
        const parsedFilter = this.parseFilter(newFilter);
        if (this.quickFilter !== parsedFilter) {
          this.quickFilter = parsedFilter;
          this.setFilterParts();
          this.dispatchLocalEvent({ type: "quickFilterChanged" });
        }
      }
      setParserAndMatcher() {
        const parser2 = this.gos.get("quickFilterParser");
        const matcher = this.gos.get("quickFilterMatcher");
        const hasChanged = parser2 !== this.parser || matcher !== this.matcher;
        this.parser = parser2;
        this.matcher = matcher;
        if (hasChanged) {
          this.setFilterParts();
          this.dispatchLocalEvent({ type: "quickFilterChanged" });
        }
      }
      onColumnConfigChanged() {
        this.refreshCols();
        this.resetCache();
        if (this.isFilterPresent()) {
          this.dispatchLocalEvent({ type: "quickFilterChanged" });
        }
      }
      doesRowPassNoCache(node2, filterPart) {
        return this.colsToUse.some((column2) => {
          const part2 = this.getTextForColumn(column2, node2);
          return _exists(part2) && part2.includes(filterPart);
        });
      }
      doesRowPassCache(node2, filterPart) {
        this.checkGenerateAggText(node2);
        return node2.quickFilterAggregateText.includes(filterPart);
      }
      doesRowPassMatcher(usingCache, node2) {
        let quickFilterAggregateText;
        if (usingCache) {
          this.checkGenerateAggText(node2);
          quickFilterAggregateText = node2.quickFilterAggregateText;
        } else {
          quickFilterAggregateText = this.getAggText(node2);
        }
        const { quickFilterParts, matcher } = this;
        return matcher(quickFilterParts, quickFilterAggregateText);
      }
      checkGenerateAggText(node2) {
        if (!node2.quickFilterAggregateText) {
          node2.quickFilterAggregateText = this.getAggText(node2);
        }
      }
      getTextForColumn(column2, node2) {
        let value2 = this.beans.filterValueSvc.getValue(column2, node2);
        const colDef = column2.getColDef();
        if (colDef.getQuickFilterText) {
          const params = _addGridCommonParams(this.gos, {
            value: value2,
            node: node2,
            data: node2.data,
            column: column2,
            colDef
          });
          value2 = colDef.getQuickFilterText(params);
        }
        return _exists(value2) ? value2.toString().toUpperCase() : null;
      }
      getAggText(node2) {
        const stringParts = [];
        for (const column2 of this.colsToUse) {
          const part2 = this.getTextForColumn(column2, node2);
          if (_exists(part2)) {
            stringParts.push(part2);
          }
        }
        return stringParts.join("\n");
      }
    };
    var ClientSideRowModelFilterModule = {
      moduleName: "ClientSideRowModelFilter",
      version: VERSION,
      rowModels: ["clientSide"],
      beans: [FilterStage]
    };
    var FilterCoreModule = {
      moduleName: "FilterCore",
      version: VERSION,
      beans: [FilterManager],
      apiFunctions: {
        isAnyFilterPresent,
        onFilterChanged
      },
      css: [columnFiltersCSS],
      dependsOn: [ClientSideRowModelFilterModule]
    };
    var FilterValueModule = {
      moduleName: "FilterValue",
      version: VERSION,
      beans: [FilterValueService]
    };
    var ColumnFilterModule = {
      moduleName: "ColumnFilter",
      version: VERSION,
      beans: [ColumnFilterService, FilterMenuFactory],
      dynamicBeans: { headerFilterCellCtrl: HeaderFilterCellCtrl },
      icons: {
        // open filter button - header, floating filter, menu
        filter: "filter",
        // filter is applied - header (legacy column menu), filter tool panel
        filterActive: "filter"
      },
      apiFunctions: {
        isColumnFilterPresent,
        getColumnFilterInstance,
        destroyFilter,
        setFilterModel,
        getFilterModel,
        getColumnFilterModel,
        setColumnFilterModel,
        showColumnFilter,
        hideColumnFilter,
        getColumnFilterHandler,
        doFilterAction
      },
      dependsOn: [FilterCoreModule, PopupModule, FilterValueModule, SharedMenuModule]
    };
    var CustomFilterModule = {
      moduleName: "CustomFilter",
      version: VERSION,
      userComponents: { agReadOnlyFloatingFilter: ReadOnlyFloatingFilter },
      dependsOn: [ColumnFilterModule]
    };
    var TextFilterModule = {
      moduleName: "TextFilter",
      version: VERSION,
      dependsOn: [ColumnFilterModule],
      userComponents: {
        agTextColumnFilter: {
          classImp: TextFilter,
          params: {
            useForm: true
          }
        },
        agTextColumnFloatingFilter: TextFloatingFilter
      },
      dynamicBeans: {
        agTextColumnFilterHandler: TextFilterHandler
      }
    };
    var NumberFilterModule = {
      moduleName: "NumberFilter",
      version: VERSION,
      dependsOn: [ColumnFilterModule],
      userComponents: {
        agNumberColumnFilter: {
          classImp: NumberFilter,
          params: {
            useForm: true
          }
        },
        agNumberColumnFloatingFilter: NumberFloatingFilter
      },
      dynamicBeans: {
        agNumberColumnFilterHandler: NumberFilterHandler
      }
    };
    var DateFilterModule = {
      moduleName: "DateFilter",
      version: VERSION,
      dependsOn: [ColumnFilterModule],
      userComponents: {
        agDateColumnFilter: {
          classImp: DateFilter,
          params: {
            useForm: true
          }
        },
        agDateInput: DefaultDateComponent,
        agDateColumnFloatingFilter: DateFloatingFilter
      },
      dynamicBeans: {
        agDateColumnFilterHandler: DateFilterHandler
      }
    };
    var QuickFilterCoreModule = {
      moduleName: "QuickFilterCore",
      version: VERSION,
      rowModels: ["clientSide"],
      beans: [QuickFilterService],
      dependsOn: [FilterCoreModule, FilterValueModule]
    };
    var QuickFilterModule = {
      moduleName: "QuickFilter",
      version: VERSION,
      apiFunctions: {
        isQuickFilterPresent,
        getQuickFilter,
        resetQuickFilter
      },
      dependsOn: [QuickFilterCoreModule]
    };
    var ExternalFilterModule = {
      moduleName: "ExternalFilter",
      version: VERSION,
      dependsOn: [FilterCoreModule]
    };
    var tooltipCSS = (
      /*css*/
      `.ag-tooltip{background-color:var(--ag-tooltip-background-color);border:var(--ag-tooltip-border);border-radius:var(--ag-border-radius);color:var(--ag-tooltip-text-color);padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding);position:absolute;white-space:normal;z-index:99999;&:where(.ag-cell-editor-tooltip){background-color:var(--ag-tooltip-error-background-color);border:var(--ag-tooltip-error-border);color:var(--ag-tooltip-error-text-color);font-weight:500}}.ag-tooltip-custom{position:absolute;z-index:99999}.ag-tooltip-custom:where(:not(.ag-tooltip-interactive)),.ag-tooltip:where(:not(.ag-tooltip-interactive)){pointer-events:none}.ag-tooltip-animate{transition:opacity 1s;&:where(.ag-tooltip-hiding){opacity:0}}`
    );
    var getEditErrorsForPosition = (beans, cellCtrl, translate) => {
      const { editModelSvc } = beans;
      const cellValidationErrors = editModelSvc?.getCellValidationModel()?.getCellValidation(cellCtrl)?.errorMessages;
      const rowValidationErrors = editModelSvc?.getRowValidationModel().getRowValidation(cellCtrl)?.errorMessages;
      const errors2 = cellValidationErrors || rowValidationErrors;
      return errors2?.length ? errors2.join(translate("tooltipValidationErrorSeparator", ". ")) : void 0;
    };
    var TooltipService = class extends BeanStub {
      constructor() {
        super(...arguments);
        this.beanName = "tooltipSvc";
      }
      setupHeaderTooltip(existingTooltipFeature, ctrl, passedValue, shouldDisplayTooltip) {
        if (existingTooltipFeature) {
          ctrl.destroyBean(existingTooltipFeature);
        }
        const gos = this.gos;
        const isTooltipWhenTruncated = _isShowTooltipWhenTruncated(gos);
        const { column: column2, eGui } = ctrl;
        const colDef = column2.getColDef();
        if (!shouldDisplayTooltip && isTooltipWhenTruncated && !colDef.headerComponent) {
          shouldDisplayTooltip = _isElementOverflowingCallback(
            () => eGui.querySelector(".ag-header-cell-text")
          );
        }
        const location2 = "header";
        const headerLocation = "header";
        const valueFormatted = this.beans.colNames.getDisplayNameForColumn(column2, headerLocation, true);
        const value2 = passedValue ?? valueFormatted;
        const tooltipCtrl = {
          getGui: () => eGui,
          getLocation: () => location2,
          getTooltipValue: () => passedValue ?? colDef?.headerTooltipValueGetter?.(
            _addGridCommonParams(gos, { location: location2, colDef, column: column2, value: value2, valueFormatted })
          ) ?? colDef?.headerTooltip,
          shouldDisplayTooltip,
          getAdditionalParams: () => ({
            column: column2,
            colDef: column2.getColDef()
          })
        };
        let tooltipFeature = this.createTooltipFeature(tooltipCtrl);
        if (tooltipFeature) {
          tooltipFeature = ctrl.createBean(tooltipFeature);
          ctrl.setRefreshFunction("tooltip", () => tooltipFeature.refreshTooltip());
        }
        return tooltipFeature;
      }
      setupHeaderGroupTooltip(existingTooltipFeature, ctrl, passedValue, shouldDisplayTooltip) {
        if (existingTooltipFeature) {
          ctrl.destroyBean(existingTooltipFeature);
        }
        const gos = this.gos;
        const isTooltipWhenTruncated = _isShowTooltipWhenTruncated(gos);
        const { column: column2, eGui } = ctrl;
        const colDef = column2.getColGroupDef();
        if (!shouldDisplayTooltip && isTooltipWhenTruncated && !colDef?.headerGroupComponent) {
          shouldDisplayTooltip = _isElementOverflowingCallback(
            () => eGui.querySelector(".ag-header-group-text")
          );
        }
        const location2 = "headerGroup";
        const headerLocation = "header";
        const valueFormatted = this.beans.colNames.getDisplayNameForColumnGroup(column2, headerLocation);
        const value2 = passedValue ?? valueFormatted;
        const tooltipCtrl = {
          getGui: () => eGui,
          getLocation: () => location2,
          getTooltipValue: () => passedValue ?? colDef?.headerTooltipValueGetter?.(
            _addGridCommonParams(gos, { location: location2, colDef, column: column2, value: value2, valueFormatted })
          ) ?? colDef?.headerTooltip,
          shouldDisplayTooltip,
          getAdditionalParams: () => {
            const additionalParams = {
              column: column2
            };
            if (colDef) {
              additionalParams.colDef = colDef;
            }
            return additionalParams;
          }
        };
        const tooltipFeature = this.createTooltipFeature(tooltipCtrl);
        return tooltipFeature ? ctrl.createBean(tooltipFeature) : tooltipFeature;
      }
      enableCellTooltipFeature(ctrl, value2, shouldDisplayTooltip) {
        const { beans } = this;
        const { gos, editSvc } = beans;
        const { column: column2, rowNode } = ctrl;
        let location2 = "cell";
        const getTooltipValue = () => {
          const isEditing2 = !!editSvc?.isEditing(ctrl);
          const errorMessages = !isEditing2 && getEditErrorsForPosition(beans, ctrl, this.getLocaleTextFunc());
          if (errorMessages) {
            location2 = "cellEditor";
            return errorMessages;
          }
          location2 = "cell";
          const colDef = column2.getColDef();
          const data = rowNode.data;
          if (colDef.tooltipField && _exists(data)) {
            return _getValueUsingField(data, colDef.tooltipField, column2.isTooltipFieldContainsDots());
          }
          const valueGetter = colDef.tooltipValueGetter;
          if (valueGetter) {
            return valueGetter(
              _addGridCommonParams(gos, {
                location: "cell",
                colDef: column2.getColDef(),
                column: column2,
                rowIndex: ctrl.cellPosition.rowIndex,
                node: rowNode,
                data: rowNode.data,
                value: ctrl.value,
                valueFormatted: ctrl.valueFormatted
              })
            );
          }
          return null;
        };
        const isTooltipWhenTruncated = _isShowTooltipWhenTruncated(gos);
        if (!shouldDisplayTooltip) {
          if (isTooltipWhenTruncated && !ctrl.isCellRenderer()) {
            shouldDisplayTooltip = () => {
              const isEditing2 = !!editSvc?.isEditing(ctrl);
              const errorMessages = !isEditing2 && getEditErrorsForPosition(beans, ctrl, this.getLocaleTextFunc());
              if (errorMessages) {
                return true;
              }
              const isTooltipEnabled = column2.isTooltipEnabled();
              if (!isTooltipEnabled) {
                return false;
              }
              const isElementOverflowing = _isElementOverflowingCallback(() => {
                const eCell = ctrl.eGui;
                return eCell.children.length === 0 ? eCell : eCell.querySelector(".ag-cell-value");
              });
              return !isEditing2 && isElementOverflowing();
            };
          } else {
            shouldDisplayTooltip = () => !editSvc?.isEditing(ctrl);
          }
        }
        const tooltipCtrl = {
          getGui: () => ctrl.eGui,
          getLocation: () => location2,
          getTooltipValue: value2 != null ? () => value2 : getTooltipValue,
          shouldDisplayTooltip,
          getAdditionalParams: () => ({
            column: column2,
            colDef: column2.getColDef(),
            rowIndex: ctrl.cellPosition.rowIndex,
            node: rowNode,
            data: rowNode.data,
            valueFormatted: ctrl.valueFormatted
          })
        };
        return this.createTooltipFeature(tooltipCtrl, beans);
      }
      setupFullWidthRowTooltip(existingTooltipFeature, ctrl, value2, shouldDisplayTooltip) {
        const tooltipParams = {
          getGui: () => ctrl.getFullWidthElement(),
          getTooltipValue: () => value2,
          getLocation: () => "fullWidthRow",
          shouldDisplayTooltip
        };
        const beans = this.beans;
        const context = beans.context;
        if (existingTooltipFeature) {
          ctrl.destroyBean(existingTooltipFeature, context);
        }
        const tooltipFeature = this.createTooltipFeature(tooltipParams, beans);
        if (!tooltipFeature) {
          return;
        }
        return ctrl.createBean(tooltipFeature, context);
      }
      setupCellEditorTooltip(cellCtrl, editor) {
        const { beans } = this;
        const { context } = beans;
        const el2 = editor.getValidationElement?.(true) || !editor.isPopup?.() && cellCtrl.eGui;
        if (!el2) {
          return;
        }
        const tooltipParams = {
          getGui: () => el2,
          getTooltipValue: () => getEditErrorsForPosition(beans, cellCtrl, this.getLocaleTextFunc()),
          getLocation: () => "cellEditor",
          shouldDisplayTooltip: () => {
            const { editModelSvc } = beans;
            const rowValidationMap = editModelSvc?.getRowValidationModel()?.getRowValidationMap();
            const cellValidationMap = editModelSvc?.getCellValidationModel()?.getCellValidationMap();
            const hasRowValidationErrors = !!rowValidationMap && rowValidationMap.size > 0;
            const hasCellValidationErrors = !!cellValidationMap && cellValidationMap.size > 0;
            return hasRowValidationErrors || hasCellValidationErrors;
          }
        };
        const tooltipFeature = this.createTooltipFeature(tooltipParams, beans);
        if (!tooltipFeature) {
          return;
        }
        return cellCtrl.createBean(tooltipFeature, context);
      }
      initCol(column2) {
        const { colDef } = column2;
        column2.tooltipEnabled = _exists(colDef.tooltipField) || _exists(colDef.tooltipValueGetter) || _exists(colDef.tooltipComponent);
      }
      createTooltipFeature(tooltipCtrl, beans) {
        return this.beans.registry.createDynamicBean("tooltipFeature", false, tooltipCtrl, beans);
      }
    };
    var TooltipStateManager = class extends BaseTooltipStateManager {
      createTooltipComp(params, callback) {
        const userDetails = _getTooltipCompDetails(this.beans.userCompFactory, params);
        userDetails?.newAgStackInstance().then(callback);
      }
      setEventHandlers(listener) {
        [this.onColumnMovedEventCallback] = this.addManagedEventListeners({
          columnMoved: listener
        });
      }
      clearEventHandlers() {
        this.onColumnMovedEventCallback?.();
        this.onColumnMovedEventCallback = void 0;
      }
    };
    var TooltipModule = {
      moduleName: "Tooltip",
      version: VERSION,
      beans: [TooltipService],
      dynamicBeans: {
        tooltipFeature: AgTooltipFeature,
        highlightTooltipFeature: AgHighlightTooltipFeature,
        tooltipStateManager: TooltipStateManager
      },
      userComponents: {
        agTooltipComponent: AgTooltipComponent
      },
      dependsOn: [PopupModule],
      css: [tooltipCSS]
    };
    var UndoRedoAction = class {
      constructor(cellValueChanges) {
        this.cellValueChanges = cellValueChanges;
      }
    };
    var RangeUndoRedoAction = class extends UndoRedoAction {
      constructor(cellValueChanges, initialRange, finalRange, ranges) {
        super(cellValueChanges);
        this.initialRange = initialRange;
        this.finalRange = finalRange;
        this.ranges = ranges;
      }
    };
    var DEFAULT_STACK_SIZE = 10;
    var UndoRedoStack = class {
      constructor(maxStackSize) {
        this.actionStack = [];
        this.maxStackSize = maxStackSize ? maxStackSize : DEFAULT_STACK_SIZE;
        this.actionStack = new Array(this.maxStackSize);
      }
      pop() {
        return this.actionStack.pop();
      }
      push(item2) {
        const shouldAddActions = item2.cellValueChanges && item2.cellValueChanges.length > 0;
        if (!shouldAddActions) {
          return;
        }
        if (this.actionStack.length === this.maxStackSize) {
          this.actionStack.shift();
        }
        this.actionStack.push(item2);
      }
      clear() {
        this.actionStack = [];
      }
      getCurrentStackSize() {
        return this.actionStack.length;
      }
    };
    var UndoRedoService = class extends BeanStub {
      constructor() {
        super(...arguments);
        this.beanName = "undoRedo";
        this.cellValueChanges = [];
        this.activeCellEdit = null;
        this.activeRowEdit = null;
        this.isPasting = false;
        this.isRangeInAction = false;
        this.batchEditing = false;
        this.bulkEditing = false;
        this.onCellValueChanged = (event) => {
          const eventCell = { column: event.column, rowIndex: event.rowIndex, rowPinned: event.rowPinned };
          const isCellEditing = this.activeCellEdit !== null && _areCellsEqual(this.activeCellEdit, eventCell);
          const isRowEditing = this.activeRowEdit !== null && _isSameRow(this.activeRowEdit, eventCell);
          const shouldCaptureAction = isCellEditing || isRowEditing || this.isPasting || this.isRangeInAction;
          if (!shouldCaptureAction) {
            return;
          }
          const { rowPinned, rowIndex, column: column2, oldValue, value: value2 } = event;
          const cellValueChange = {
            rowPinned,
            rowIndex,
            columnId: column2.getColId(),
            newValue: value2,
            oldValue
          };
          this.cellValueChanges.push(cellValueChange);
        };
        this.clearStacks = () => {
          this.undoStack.clear();
          this.redoStack.clear();
        };
      }
      postConstruct() {
        const { gos, ctrlsSvc } = this.beans;
        if (!gos.get("undoRedoCellEditing")) {
          return;
        }
        const undoRedoLimit = gos.get("undoRedoCellEditingLimit");
        if (undoRedoLimit <= 0) {
          return;
        }
        this.undoStack = new UndoRedoStack(undoRedoLimit);
        this.redoStack = new UndoRedoStack(undoRedoLimit);
        this.addListeners();
        const listener = this.clearStacks.bind(this);
        this.addManagedEventListeners({
          cellValueChanged: this.onCellValueChanged.bind(this),
          // undo / redo is restricted to actual editing so we clear the stacks when other operations are
          // performed that change the order of the row / cols.
          modelUpdated: (e) => {
            if (!e.keepUndoRedoStack) {
              this.clearStacks();
            }
          },
          columnPivotModeChanged: listener,
          newColumnsLoaded: listener,
          columnGroupOpened: listener,
          columnRowGroupChanged: listener,
          columnMoved: listener,
          columnPinned: listener,
          columnVisible: listener,
          rowDragEnd: listener
        });
        ctrlsSvc.whenReady(this, (p) => {
          this.gridBodyCtrl = p.gridBodyCtrl;
        });
      }
      getCurrentUndoStackSize() {
        return this.undoStack?.getCurrentStackSize() ?? 0;
      }
      getCurrentRedoStackSize() {
        return this.redoStack?.getCurrentStackSize() ?? 0;
      }
      undo(source2) {
        const { eventSvc, undoStack, redoStack } = this;
        eventSvc.dispatchEvent({
          type: "undoStarted",
          source: source2
        });
        const operationPerformed = this.undoRedo(undoStack, redoStack, "initialRange", "oldValue", "undo");
        eventSvc.dispatchEvent({
          type: "undoEnded",
          source: source2,
          operationPerformed
        });
      }
      redo(source2) {
        const { eventSvc, undoStack, redoStack } = this;
        eventSvc.dispatchEvent({
          type: "redoStarted",
          source: source2
        });
        const operationPerformed = this.undoRedo(redoStack, undoStack, "finalRange", "newValue", "redo");
        eventSvc.dispatchEvent({
          type: "redoEnded",
          source: source2,
          operationPerformed
        });
      }
      undoRedo(undoRedoStack, opposingUndoRedoStack, rangeProperty, cellValueChangeProperty, source2) {
        if (!undoRedoStack) {
          return false;
        }
        const undoRedoAction = undoRedoStack.pop();
        if (!undoRedoAction?.cellValueChanges) {
          return false;
        }
        this.processAction(
          undoRedoAction,
          (cellValueChange) => cellValueChange[cellValueChangeProperty],
          source2
        );
        if (undoRedoAction instanceof RangeUndoRedoAction) {
          this.processRange(undoRedoAction.ranges || [undoRedoAction[rangeProperty]]);
        } else {
          this.processCell(undoRedoAction.cellValueChanges);
        }
        opposingUndoRedoStack.push(undoRedoAction);
        return true;
      }
      processAction(action, valueExtractor, source2) {
        for (const cellValueChange of action.cellValueChanges) {
          const { rowIndex, rowPinned, columnId } = cellValueChange;
          const rowPosition = { rowIndex, rowPinned };
          const currentRow = _getRowNode(this.beans, rowPosition);
          if (!currentRow.displayed) {
            continue;
          }
          currentRow.setDataValue(columnId, valueExtractor(cellValueChange), source2);
        }
      }
      processRange(ranges) {
        let lastFocusedCell;
        const rangeSvc = this.beans.rangeSvc;
        rangeSvc.removeAllCellRanges(true);
        ranges.forEach((range2, idx) => {
          if (!range2) {
            return;
          }
          const startRow = range2.startRow;
          const endRow = range2.endRow;
          if (idx === ranges.length - 1) {
            lastFocusedCell = {
              rowPinned: startRow.rowPinned,
              rowIndex: startRow.rowIndex,
              columnId: range2.startColumn.getColId()
            };
            this.setLastFocusedCell(lastFocusedCell);
          }
          const cellRangeParams = {
            rowStartIndex: startRow.rowIndex,
            rowStartPinned: startRow.rowPinned,
            rowEndIndex: endRow.rowIndex,
            rowEndPinned: endRow.rowPinned,
            columnStart: range2.startColumn,
            columns: range2.columns
          };
          rangeSvc.addCellRange(cellRangeParams);
        });
      }
      processCell(cellValueChanges) {
        const cellValueChange = cellValueChanges[0];
        const { rowIndex, rowPinned } = cellValueChange;
        const rowPosition = { rowIndex, rowPinned };
        const row2 = _getRowNode(this.beans, rowPosition);
        const lastFocusedCell = {
          rowPinned: cellValueChange.rowPinned,
          rowIndex: row2.rowIndex,
          columnId: cellValueChange.columnId
        };
        this.setLastFocusedCell(lastFocusedCell);
      }
      setLastFocusedCell(lastFocusedCell) {
        const { rowIndex, columnId, rowPinned } = lastFocusedCell;
        const { colModel, focusSvc, rangeSvc } = this.beans;
        const column2 = colModel.getCol(columnId);
        if (!column2) {
          return;
        }
        const { scrollFeature } = this.gridBodyCtrl;
        scrollFeature.ensureIndexVisible(rowIndex);
        scrollFeature.ensureColumnVisible(column2);
        const cellPosition = { rowIndex, column: column2, rowPinned };
        focusSvc.setFocusedCell({ ...cellPosition, forceBrowserFocus: true });
        rangeSvc?.setRangeToCell(cellPosition);
      }
      addListeners() {
        this.addManagedEventListeners({
          rowEditingStarted: (e) => {
            this.activeRowEdit = { rowIndex: e.rowIndex, rowPinned: e.rowPinned };
          },
          rowEditingStopped: () => {
            const action = new UndoRedoAction(this.cellValueChanges);
            this.pushActionsToUndoStack(action);
            this.activeRowEdit = null;
          },
          cellEditingStarted: (e) => {
            this.activeCellEdit = { column: e.column, rowIndex: e.rowIndex, rowPinned: e.rowPinned };
          },
          cellEditingStopped: (e) => {
            this.activeCellEdit = null;
            const shouldPushAction = e.valueChanged && !this.activeRowEdit && !this.isPasting && !this.isRangeInAction;
            if (shouldPushAction) {
              const action = new UndoRedoAction(this.cellValueChanges);
              this.pushActionsToUndoStack(action);
            }
          },
          pasteStart: () => {
            this.isPasting = true;
          },
          pasteEnd: () => {
            const action = new UndoRedoAction(this.cellValueChanges);
            this.pushActionsToUndoStack(action);
            this.isPasting = false;
          },
          fillStart: () => {
            this.isRangeInAction = true;
          },
          fillEnd: (event) => {
            const action = new RangeUndoRedoAction(this.cellValueChanges, event.initialRange, event.finalRange);
            this.pushActionsToUndoStack(action);
            this.isRangeInAction = false;
          },
          keyShortcutChangedCellStart: () => {
            this.isRangeInAction = true;
          },
          keyShortcutChangedCellEnd: () => {
            let action;
            const { rangeSvc, gos } = this.beans;
            if (rangeSvc && _isCellSelectionEnabled(gos)) {
              action = new RangeUndoRedoAction(this.cellValueChanges, void 0, void 0, [
                ...rangeSvc.getCellRanges()
              ]);
            } else {
              action = new UndoRedoAction(this.cellValueChanges);
            }
            this.pushActionsToUndoStack(action);
            this.isRangeInAction = false;
          },
          batchEditingStarted: () => this.startBigChange("batchEditing"),
          batchEditingStopped: ({ changes }) => this.stopBigChange("batchEditing", changes),
          bulkEditingStarted: () => this.startBigChange("bulkEditing"),
          bulkEditingStopped: ({ changes }) => this.stopBigChange("bulkEditing", changes)
        });
      }
      startBigChange(key2) {
        this.updateBigChange(key2, true);
      }
      updateBigChange(key2, value2) {
        if (key2 === "bulkEditing") {
          this.bulkEditing = value2;
        } else {
          this.batchEditing = value2;
        }
      }
      stopBigChange(key2, changes) {
        if (key2 === "bulkEditing" && !this.bulkEditing || key2 === "batchEditing" && !this.batchEditing) {
          return;
        }
        this.updateBigChange(key2, false);
        if (changes?.length === 0) {
          return;
        }
        const action = new UndoRedoAction(changes ?? []);
        this.pushActionsToUndoStack(action);
        this.cellValueChanges = [];
      }
      pushActionsToUndoStack(action) {
        this.undoStack.push(action);
        this.cellValueChanges = [];
        this.redoStack.clear();
      }
    };
    var cellEditingCSS = (
      /*css*/
      `.ag-cell-inline-editing{border:var(--ag-cell-editing-border)!important;border-radius:var(--ag-border-radius);box-shadow:var(--ag-cell-editing-shadow);padding:0;z-index:1;.ag-cell-edit-wrapper,.ag-cell-editor,.ag-cell-wrapper,:where(.ag-cell-editor) .ag-input-field-input,:where(.ag-cell-editor) .ag-wrapper{height:100%;line-height:normal;min-height:100%;width:100%}&.ag-cell-editing-error{border-color:var(--ag-invalid-color)!important}}:where(.ag-popup-editor) .ag-large-text{background-color:var(--ag-background-color);border-radius:var(--ag-border-radius);box-shadow:var(--ag-dropdown-shadow);padding:0}.ag-large-text-input{display:block;height:auto;padding:var(--ag-cell-horizontal-padding)}:where(.ag-rtl .ag-large-text-input) textarea{resize:none}:where(.ag-ltr) .ag-checkbox-edit{padding-left:var(--ag-cell-horizontal-padding)}:where(.ag-rtl) .ag-checkbox-edit{padding-right:var(--ag-cell-horizontal-padding)}:where(.ag-row.ag-row-editing-invalid .ag-cell-inline-editing){opacity:.8}.ag-popup-editor{position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none}`
    );
    var CheckboxCellEditorElement = {
      tag: "div",
      cls: "ag-cell-wrapper ag-cell-edit-wrapper ag-checkbox-edit",
      children: [
        {
          tag: "ag-checkbox",
          ref: "eEditor",
          role: "presentation"
        }
      ]
    };
    var CheckboxCellEditor = class extends AgAbstractCellEditor {
      constructor() {
        super(CheckboxCellEditorElement, [AgCheckboxSelector]);
        this.eEditor = RefPlaceholder;
      }
      initialiseEditor(params) {
        const isSelected = params.value ?? void 0;
        const eEditor = this.eEditor;
        eEditor.setValue(isSelected);
        const inputEl = eEditor.getInputElement();
        inputEl.setAttribute("tabindex", "-1");
        this.setAriaLabel(isSelected);
        this.addManagedListeners(eEditor, {
          fieldValueChanged: (event) => this.setAriaLabel(event.selected)
        });
      }
      getValue() {
        return this.eEditor.getValue();
      }
      focusIn() {
        this.eEditor.getFocusableElement().focus();
      }
      afterGuiAttached() {
        if (this.params.cellStartedEdit) {
          this.focusIn();
        }
      }
      isPopup() {
        return false;
      }
      setAriaLabel(isSelected) {
        const translate = this.getLocaleTextFunc();
        const stateName = _getAriaCheckboxStateName(translate, isSelected);
        const ariaLabel = translate("ariaToggleCellValue", "Press SPACE to toggle cell value");
        this.eEditor.setInputAriaLabel(`${ariaLabel} (${stateName})`);
      }
      getValidationElement(tooltip) {
        return tooltip ? this.params.eGridCell : this.eEditor.getInputElement();
      }
      getValidationErrors() {
        const { params } = this;
        const { getValidationErrors } = params;
        const value2 = this.getValue();
        if (!getValidationErrors) {
          return null;
        }
        return getValidationErrors({
          value: value2,
          internalErrors: null,
          cellEditorParams: params
        });
      }
    };
    var SimpleCellEditor = class extends AgAbstractCellEditor {
      constructor(cellEditorInput) {
        super();
        this.cellEditorInput = cellEditorInput;
        this.eEditor = RefPlaceholder;
      }
      initialiseEditor(params) {
        const { cellEditorInput } = this;
        this.setTemplate(
          { tag: "div", cls: "ag-cell-edit-wrapper", children: [cellEditorInput.getTemplate()] },
          cellEditorInput.getAgComponents()
        );
        const { eEditor } = this;
        const { cellStartedEdit, eventKey, suppressPreventDefault } = params;
        eEditor.getInputElement().setAttribute("title", "");
        cellEditorInput.init(eEditor, params);
        let startValue;
        let shouldSetStartValue = true;
        if (cellStartedEdit) {
          this.focusAfterAttached = true;
          if (eventKey === KeyCode.BACKSPACE || eventKey === KeyCode.DELETE) {
            startValue = "";
          } else if (eventKey && eventKey.length === 1) {
            if (suppressPreventDefault) {
              shouldSetStartValue = false;
            } else {
              startValue = eventKey;
            }
          } else {
            startValue = cellEditorInput.getStartValue();
            if (eventKey !== KeyCode.F2) {
              this.highlightAllOnFocus = true;
            }
          }
        } else {
          this.focusAfterAttached = false;
          startValue = cellEditorInput.getStartValue();
        }
        if (shouldSetStartValue && startValue != null) {
          eEditor.setStartValue(startValue);
        }
        this.addGuiEventListener("keydown", (event) => {
          const { key: key2 } = event;
          if (key2 === KeyCode.PAGE_UP || key2 === KeyCode.PAGE_DOWN) {
            event.preventDefault();
          }
        });
      }
      afterGuiAttached() {
        const translate = this.getLocaleTextFunc();
        const eInput = this.eEditor;
        eInput.setInputAriaLabel(translate("ariaInputEditor", "Input Editor"));
        if (!this.focusAfterAttached) {
          return;
        }
        if (!_isBrowserSafari()) {
          eInput.getFocusableElement().focus();
        }
        const inputEl = eInput.getInputElement();
        if (this.highlightAllOnFocus) {
          inputEl.select();
        } else {
          this.cellEditorInput.setCaret?.();
        }
      }
      // gets called when tabbing through cells and in full row edit mode
      focusIn() {
        const { eEditor } = this;
        const focusEl = eEditor.getFocusableElement();
        const inputEl = eEditor.getInputElement();
        focusEl.focus();
        inputEl.select();
      }
      getValue() {
        return this.cellEditorInput.getValue();
      }
      isPopup() {
        return false;
      }
      getValidationElement() {
        return this.eEditor.getInputElement();
      }
      getValidationErrors() {
        return this.cellEditorInput.getValidationErrors();
      }
    };
    var DateCellElement = {
      tag: "ag-input-date-field",
      ref: "eEditor",
      cls: "ag-cell-editor"
    };
    var DateCellEditorInput = class {
      constructor(getDataTypeService, getLocaleTextFunc) {
        this.getDataTypeService = getDataTypeService;
        this.getLocaleTextFunc = getLocaleTextFunc;
      }
      getTemplate() {
        return DateCellElement;
      }
      getAgComponents() {
        return [AgInputDateFieldSelector];
      }
      init(eEditor, params) {
        this.eEditor = eEditor;
        this.params = params;
        const { min: min2, max: max2, step, colDef } = params;
        if (min2 != null) {
          eEditor.setMin(min2);
        }
        if (max2 != null) {
          eEditor.setMax(max2);
        }
        if (step != null) {
          eEditor.setStep(step);
        }
        this.includeTime = params.includeTime ?? this.getDataTypeService()?.getDateIncludesTimeFlag?.(colDef.cellDataType);
        if (this.includeTime != null) {
          eEditor.setIncludeTime(this.includeTime);
        }
      }
      getValidationErrors() {
        const eInput = this.eEditor.getInputElement();
        const value2 = eInput.valueAsDate;
        const { params } = this;
        const { min: min2, max: max2, getValidationErrors } = params;
        let internalErrors = [];
        const translate = this.getLocaleTextFunc();
        if (value2 instanceof Date && !isNaN(value2.getTime())) {
          if (min2) {
            const minValue = min2 instanceof Date ? min2 : new Date(min2);
            if (value2 < minValue) {
              const minDateString = minValue.toLocaleDateString();
              internalErrors.push(
                translate("minDateValidation", `Date must be after ${minDateString}`, [minDateString])
              );
            }
          }
          if (max2) {
            const maxValue = max2 instanceof Date ? max2 : new Date(max2);
            if (value2 > maxValue) {
              const maxDateString = maxValue.toLocaleDateString();
              internalErrors.push(
                translate("maxDateValidation", `Date must be before ${maxDateString}`, [maxDateString])
              );
            }
          }
        }
        if (!internalErrors.length) {
          internalErrors = null;
        }
        if (getValidationErrors) {
          return getValidationErrors({ value: value2, cellEditorParams: params, internalErrors });
        }
        return internalErrors;
      }
      getValue() {
        const { eEditor, params } = this;
        const value2 = eEditor.getDate();
        if (!_exists(value2) && !_exists(params.value)) {
          return params.value;
        }
        return value2 ?? null;
      }
      getStartValue() {
        const { value: value2 } = this.params;
        if (!(value2 instanceof Date)) {
          return void 0;
        }
        return _serialiseDate(value2, this.includeTime ?? false);
      }
    };
    var DateCellEditor = class extends SimpleCellEditor {
      constructor() {
        super(
          new DateCellEditorInput(
            () => this.beans.dataTypeSvc,
            () => this.getLocaleTextFunc()
          )
        );
      }
    };
    var DateStringCellElement = {
      tag: "ag-input-date-field",
      ref: "eEditor",
      cls: "ag-cell-editor"
    };
    var DateStringCellEditorInput = class {
      constructor(getDataTypeService, getLocaleTextFunc) {
        this.getDataTypeService = getDataTypeService;
        this.getLocaleTextFunc = getLocaleTextFunc;
      }
      getTemplate() {
        return DateStringCellElement;
      }
      getAgComponents() {
        return [AgInputDateFieldSelector];
      }
      init(eEditor, params) {
        this.eEditor = eEditor;
        this.params = params;
        const { min: min2, max: max2, step, colDef } = params;
        if (min2 != null) {
          eEditor.setMin(min2);
        }
        if (max2 != null) {
          eEditor.setMax(max2);
        }
        if (step != null) {
          eEditor.setStep(step);
        }
        this.includeTime = params.includeTime ?? this.getDataTypeService()?.getDateIncludesTimeFlag?.(colDef.cellDataType);
        if (this.includeTime != null) {
          eEditor.setIncludeTime(this.includeTime);
        }
      }
      getValidationErrors() {
        const { eEditor, params } = this;
        const raw = eEditor.getInputElement().value;
        const value2 = this.formatDate(this.parseDate(raw ?? void 0));
        const { min: min2, max: max2, getValidationErrors } = params;
        let internalErrors = [];
        if (value2) {
          const date = new Date(value2);
          const translate = this.getLocaleTextFunc();
          if (min2) {
            const minDate = new Date(min2);
            if (date < minDate) {
              const minDateString = minDate.toLocaleDateString();
              internalErrors.push(
                translate("minDateValidation", `Date must be after ${minDateString}`, [minDateString])
              );
            }
          }
          if (max2) {
            const maxDate = new Date(max2);
            if (date > maxDate) {
              const maxDateString = maxDate.toLocaleDateString();
              internalErrors.push(
                translate("maxDateValidation", `Date must be before ${maxDateString}`, [maxDateString])
              );
            }
          }
        }
        if (!internalErrors.length) {
          internalErrors = null;
        }
        if (getValidationErrors) {
          return getValidationErrors({
            value: this.getValue(),
            cellEditorParams: params,
            internalErrors
          });
        }
        return internalErrors;
      }
      getValue() {
        const { params, eEditor } = this;
        const value2 = this.formatDate(eEditor.getDate());
        if (!_exists(value2) && !_exists(params.value)) {
          return params.value;
        }
        return params.parseValue(value2 ?? "");
      }
      getStartValue() {
        return _serialiseDate(this.parseDate(this.params.value ?? void 0) ?? null, this.includeTime ?? false);
      }
      parseDate(value2) {
        const dataTypeSvc = this.getDataTypeService();
        return dataTypeSvc ? dataTypeSvc.getDateParserFunction(this.params.column)(value2) : _parseDateTimeFromString(value2) ?? void 0;
      }
      formatDate(value2) {
        const dataTypeSvc = this.getDataTypeService();
        return dataTypeSvc ? dataTypeSvc.getDateFormatterFunction(this.params.column)(value2) : _serialiseDate(value2 ?? null, this.includeTime ?? false) ?? void 0;
      }
    };
    var DateStringCellEditor = class extends SimpleCellEditor {
      constructor() {
        super(
          new DateStringCellEditorInput(
            () => this.beans.dataTypeSvc,
            () => this.getLocaleTextFunc()
          )
        );
      }
    };
    var LargeTextCellElement = {
      tag: "div",
      cls: "ag-large-text",
      children: [
        {
          tag: "ag-input-text-area",
          ref: "eEditor",
          cls: "ag-large-text-input"
        }
      ]
    };
    var LargeTextCellEditor = class extends AgAbstractCellEditor {
      constructor() {
        super(LargeTextCellElement, [AgInputTextAreaSelector]);
        this.eEditor = RefPlaceholder;
      }
      initialiseEditor(params) {
        const { eEditor } = this;
        const { cellStartedEdit, eventKey, maxLength, cols, rows } = params;
        this.focusAfterAttached = cellStartedEdit;
        eEditor.getInputElement().setAttribute("title", "");
        eEditor.setMaxLength(maxLength || 200).setCols(cols || 60).setRows(rows || 10);
        let startValue;
        if (cellStartedEdit) {
          this.focusAfterAttached = true;
          if (eventKey === KeyCode.BACKSPACE || eventKey === KeyCode.DELETE) {
            startValue = "";
          } else if (eventKey && eventKey.length === 1) {
            startValue = eventKey;
          } else {
            startValue = this.getStartValue(params);
            if (eventKey !== KeyCode.F2) {
              this.highlightAllOnFocus = true;
            }
          }
        } else {
          this.focusAfterAttached = false;
          startValue = this.getStartValue(params);
        }
        if (startValue != null) {
          eEditor.setValue(startValue, true);
        }
        this.addGuiEventListener("keydown", this.onKeyDown.bind(this));
        this.activateTabIndex();
      }
      getStartValue(params) {
        const { value: value2 } = params;
        return value2?.toString() ?? value2;
      }
      onKeyDown(event) {
        const key2 = event.key;
        if (key2 === KeyCode.LEFT || key2 === KeyCode.UP || key2 === KeyCode.RIGHT || key2 === KeyCode.DOWN || event.shiftKey && key2 === KeyCode.ENTER) {
          event.stopPropagation();
        }
      }
      afterGuiAttached() {
        const { eEditor, focusAfterAttached, highlightAllOnFocus } = this;
        const translate = this.getLocaleTextFunc();
        eEditor.setInputAriaLabel(translate("ariaInputEditor", "Input Editor"));
        if (focusAfterAttached) {
          eEditor.getFocusableElement().focus();
          if (highlightAllOnFocus) {
            eEditor.getInputElement().select();
          }
        }
      }
      getValue() {
        const { eEditor, params } = this;
        const { value: value2 } = params;
        const editorValue = eEditor.getValue();
        if (!_exists(editorValue) && !_exists(value2)) {
          return value2;
        }
        return params.parseValue(editorValue);
      }
      getValidationElement() {
        return this.eEditor.getInputElement();
      }
      getValidationErrors() {
        const { params } = this;
        const { maxLength, getValidationErrors } = params;
        const translate = this.getLocaleTextFunc();
        const value2 = this.getValue();
        let internalErrors = [];
        if (typeof value2 === "string" && maxLength != null && value2.length > maxLength) {
          internalErrors.push(
            translate("maxLengthValidation", `Must be ${maxLength} characters or fewer.`, [String(maxLength)])
          );
        }
        if (!internalErrors.length) {
          internalErrors = null;
        }
        if (getValidationErrors) {
          return getValidationErrors({
            value: value2,
            internalErrors,
            cellEditorParams: params
          });
        }
        return internalErrors;
      }
    };
    var NumberCellElement = {
      tag: "ag-input-number-field",
      ref: "eEditor",
      cls: "ag-cell-editor"
    };
    var NumberCellEditorInput = class {
      constructor(getLocaleTextFunc) {
        this.getLocaleTextFunc = getLocaleTextFunc;
      }
      getTemplate() {
        return NumberCellElement;
      }
      getAgComponents() {
        return [AgInputNumberFieldSelector];
      }
      init(eEditor, params) {
        this.eEditor = eEditor;
        this.params = params;
        const { max: max2, min: min2, precision, step } = params;
        if (max2 != null) {
          eEditor.setMax(max2);
        }
        if (min2 != null) {
          eEditor.setMin(min2);
        }
        if (precision != null) {
          eEditor.setPrecision(precision);
        }
        if (step != null) {
          eEditor.setStep(step);
        }
        const editorEl = eEditor.getInputElement();
        if (params.preventStepping) {
          eEditor.addManagedElementListeners(editorEl, { keydown: this.preventStepping });
        } else if (params.showStepperButtons) {
          editorEl.classList.add("ag-number-field-input-stepper");
        }
      }
      getValidationErrors() {
        const { params } = this;
        const { min: min2, max: max2, getValidationErrors } = params;
        const eInput = this.eEditor.getInputElement();
        const value2 = eInput.valueAsNumber;
        const translate = this.getLocaleTextFunc();
        let internalErrors = [];
        if (typeof value2 === "number") {
          if (min2 != null && value2 < min2) {
            internalErrors.push(
              translate("minValueValidation", `Must be greater than or equal to ${min2}.`, [String(min2)])
            );
          }
          if (max2 != null && value2 > max2) {
            internalErrors.push(
              translate("maxValueValidation", `Must be less than or equal to ${max2}.`, [String(max2)])
            );
          }
        }
        if (!internalErrors.length) {
          internalErrors = null;
        }
        if (getValidationErrors) {
          return getValidationErrors({
            value: value2,
            cellEditorParams: params,
            internalErrors
          });
        }
        return internalErrors;
      }
      preventStepping(e) {
        if (e.key === KeyCode.UP || e.key === KeyCode.DOWN) {
          e.preventDefault();
        }
      }
      getValue() {
        const { eEditor, params } = this;
        const value2 = eEditor.getValue();
        if (!_exists(value2) && !_exists(params.value)) {
          return params.value;
        }
        let parsedValue = params.parseValue(value2);
        if (parsedValue == null) {
          return parsedValue;
        }
        if (typeof parsedValue === "string") {
          if (parsedValue === "") {
            return null;
          }
          parsedValue = Number(parsedValue);
        }
        return isNaN(parsedValue) ? null : parsedValue;
      }
      getStartValue() {
        return this.params.value;
      }
      setCaret() {
        if (_isBrowserSafari()) {
          this.eEditor.getInputElement().focus({ preventScroll: true });
        }
      }
    };
    var NumberCellEditor = class extends SimpleCellEditor {
      constructor() {
        super(new NumberCellEditorInput(() => this.getLocaleTextFunc()));
      }
    };
    var SelectCellElement = {
      tag: "div",
      cls: "ag-cell-edit-wrapper",
      children: [
        {
          tag: "ag-select",
          ref: "eEditor",
          cls: "ag-cell-editor"
        }
      ]
    };
    var SelectCellEditor = class extends AgAbstractCellEditor {
      constructor() {
        super(SelectCellElement, [AgSelectSelector]);
        this.eEditor = RefPlaceholder;
        this.startedByEnter = false;
      }
      wireBeans(beans) {
        this.valueSvc = beans.valueSvc;
      }
      initialiseEditor(params) {
        this.focusAfterAttached = params.cellStartedEdit;
        const { eEditor, valueSvc, gos } = this;
        const { values, value: value2, eventKey } = params;
        if (_missing(values)) {
          _warn(58);
          return;
        }
        this.startedByEnter = eventKey != null ? eventKey === KeyCode.ENTER : false;
        let hasValue = false;
        values.forEach((currentValue) => {
          const option = { value: currentValue };
          const valueFormatted = valueSvc.formatValue(params.column, null, currentValue);
          const valueFormattedExits = valueFormatted !== null && valueFormatted !== void 0;
          option.text = valueFormattedExits ? valueFormatted : currentValue;
          eEditor.addOption(option);
          hasValue = hasValue || value2 === currentValue;
        });
        if (hasValue) {
          eEditor.setValue(params.value, true);
        } else if (params.values.length) {
          eEditor.setValue(params.values[0], true);
        }
        const { valueListGap, valueListMaxWidth, valueListMaxHeight } = params;
        if (valueListGap != null) {
          eEditor.setPickerGap(valueListGap);
        }
        if (valueListMaxHeight != null) {
          eEditor.setPickerMaxHeight(valueListMaxHeight);
        }
        if (valueListMaxWidth != null) {
          eEditor.setPickerMaxWidth(valueListMaxWidth);
        }
        if (gos.get("editType") !== "fullRow") {
          this.addManagedListeners(this.eEditor, { selectedItem: () => params.stopEditing() });
        }
      }
      afterGuiAttached() {
        if (this.focusAfterAttached) {
          this.eEditor.getFocusableElement().focus();
        }
        if (this.startedByEnter) {
          setTimeout(() => {
            if (this.isAlive()) {
              this.eEditor.showPicker();
            }
          });
        }
      }
      focusIn() {
        this.eEditor.getFocusableElement().focus();
      }
      getValue() {
        return this.eEditor.getValue();
      }
      isPopup() {
        return false;
      }
      getValidationElement() {
        return this.eEditor.getAriaElement();
      }
      getValidationErrors() {
        const { params } = this;
        const { values, getValidationErrors } = params;
        const value2 = this.getValue();
        let internalErrors = [];
        if (values && !values.includes(value2)) {
          const translate = this.getLocaleTextFunc();
          internalErrors.push(translate("invalidSelectionValidation", "Invalid selection."));
        } else {
          internalErrors = null;
        }
        if (getValidationErrors) {
          return getValidationErrors({
            value: value2,
            internalErrors,
            cellEditorParams: params
          });
        }
        return internalErrors;
      }
    };
    var TextCellEditorElement = {
      tag: "ag-input-text-field",
      ref: "eEditor",
      cls: "ag-cell-editor"
    };
    var TextCellEditorInput = class {
      constructor(getLocaleTextFunc) {
        this.getLocaleTextFunc = getLocaleTextFunc;
      }
      getTemplate() {
        return TextCellEditorElement;
      }
      getAgComponents() {
        return [AgInputTextFieldSelector];
      }
      init(eEditor, params) {
        this.eEditor = eEditor;
        this.params = params;
        const maxLength = params.maxLength;
        if (maxLength != null) {
          eEditor.setMaxLength(maxLength);
        }
      }
      getValidationErrors() {
        const { params } = this;
        const { maxLength, getValidationErrors } = params;
        const value2 = this.getValue();
        const translate = this.getLocaleTextFunc();
        let internalErrors = [];
        if (maxLength != null && typeof value2 === "string" && value2.length > maxLength) {
          internalErrors.push(
            translate("maxLengthValidation", `Must be ${maxLength} characters or fewer.`, [String(maxLength)])
          );
        }
        if (!internalErrors.length) {
          internalErrors = null;
        }
        if (getValidationErrors) {
          return getValidationErrors({ value: value2, cellEditorParams: params, internalErrors });
        }
        return internalErrors;
      }
      getValue() {
        const { eEditor, params } = this;
        const value2 = eEditor.getValue();
        if (!_exists(value2) && !_exists(params.value)) {
          return params.value;
        }
        return params.parseValue(value2);
      }
      getStartValue() {
        const params = this.params;
        const formatValue = params.useFormatter || params.column.getColDef().refData;
        return formatValue ? params.formatValue(params.value) : params.value;
      }
      setCaret() {
        if (_isBrowserSafari()) {
          this.eEditor.getInputElement().focus({ preventScroll: true });
        }
        const eInput = this.eEditor;
        const value2 = eInput.getValue();
        const len = _exists(value2) && value2.length || 0;
        if (len) {
          eInput.getInputElement().setSelectionRange(len, len);
        }
      }
    };
    var TextCellEditor = class extends SimpleCellEditor {
      constructor() {
        super(new TextCellEditorInput(() => this.getLocaleTextFunc()));
      }
    };
    function getVerticalPixelRange(beans) {
      return beans.ctrlsSvc.getScrollFeature().getVScrollPosition();
    }
    function getHorizontalPixelRange(beans) {
      return beans.ctrlsSvc.getScrollFeature().getHScrollPosition();
    }
    function ensureColumnVisible(beans, key2, position = "auto") {
      beans.frameworkOverrides.wrapIncoming(
        () => beans.ctrlsSvc.getScrollFeature().ensureColumnVisible(key2, position),
        "ensureVisible"
      );
    }
    function ensureIndexVisible(beans, index, position) {
      beans.frameworkOverrides.wrapIncoming(
        () => beans.ctrlsSvc.getScrollFeature().ensureIndexVisible(index, position),
        "ensureVisible"
      );
    }
    function ensureNodeVisible(beans, nodeSelector, position = null) {
      beans.frameworkOverrides.wrapIncoming(
        () => beans.ctrlsSvc.getScrollFeature().ensureNodeVisible(nodeSelector, position),
        "ensureVisible"
      );
    }
    function undoCellEditing(beans) {
      beans.undoRedo?.undo("api");
    }
    function redoCellEditing(beans) {
      beans.undoRedo?.redo("api");
    }
    function getEditRowValues(beans, rowNode) {
      return beans.editModelSvc?.getEditRowDataValue(rowNode, { checkSiblings: true });
    }
    function getEditingCells(beans) {
      const edits = beans.editModelSvc?.getEditMap();
      const positions = [];
      edits?.forEach((editRow, rowNode) => {
        const { rowIndex, rowPinned } = rowNode;
        editRow.forEach((editValue, column2) => {
          const { editorValue, pendingValue, sourceValue: oldValue, state } = editValue;
          const diff2 = _sourceAndPendingDiffer(editValue);
          let newValue = editorValue ?? pendingValue;
          if (newValue === UNEDITED) {
            newValue = void 0;
          }
          const edit = {
            newValue,
            oldValue,
            state,
            column: column2,
            colId: column2.getColId(),
            colKey: column2.getColId(),
            rowIndex,
            rowPinned
          };
          const changed = state === "changed" && diff2;
          const editing = state === "editing";
          if (editing || changed) {
            positions.push(edit);
          }
        });
      });
      return positions;
    }
    function stopEditing(beans, cancel = false) {
      const { editSvc } = beans;
      if (editSvc?.isBatchEditing()) {
        if (cancel) {
          for (const cellPosition of beans.editModelSvc?.getEditPositions() ?? []) {
            if (cellPosition.state === "editing") {
              editSvc.revertSingleCellEdit(cellPosition);
            }
          }
        } else {
          _syncFromEditors(beans, { persist: true });
        }
        _destroyEditors(beans, void 0, { cancel });
      } else {
        editSvc?.stopEditing(void 0, { cancel, source: "edit", forceStop: !cancel, forceCancel: cancel });
      }
    }
    function isEditing(beans, cellPosition) {
      const cellCtrl = _getCellCtrl(beans, cellPosition);
      return beans.editSvc?.isEditing(cellCtrl) ?? false;
    }
    function startEditingCell(beans, params) {
      const { key: key2, colKey, rowIndex, rowPinned } = params;
      const { editSvc, colModel } = beans;
      const column2 = colModel.getCol(colKey);
      if (!column2) {
        _warn(12, { colKey });
        return;
      }
      const cellPosition = {
        rowIndex,
        rowPinned: rowPinned || null
      };
      const rowNode = _getRowNode(beans, cellPosition);
      if (!rowNode) {
        _warn(290, { rowIndex, rowPinned });
        return;
      }
      if (!column2.isCellEditable(rowNode)) {
        return;
      }
      const notPinned = rowPinned == null;
      if (notPinned) {
        ensureIndexVisible(beans, rowIndex);
      }
      ensureColumnVisible(beans, colKey);
      editSvc?.startEditing(
        {
          rowNode,
          column: column2
        },
        {
          event: key2 ? new KeyboardEvent("keydown", { key: key2 }) : void 0,
          source: "api"
        }
      );
    }
    function validateEdit(beans) {
      return beans.editSvc?.validateEdit() || null;
    }
    function getCurrentUndoSize(beans) {
      return beans.undoRedo?.getCurrentUndoStackSize() ?? 0;
    }
    function getCurrentRedoSize(beans) {
      return beans.undoRedo?.getCurrentRedoStackSize() ?? 0;
    }
    var PopupEditorElement = { tag: "div", cls: "ag-popup-editor", attrs: { tabindex: "-1" } };
    var PopupEditorWrapper = class extends AgPopupComponent {
      constructor(params) {
        super(PopupEditorElement);
        this.params = params;
      }
      postConstruct() {
        _setDomData(this.gos, this.getGui(), "popupEditorWrapper", true);
        this.addKeyDownListener();
      }
      addKeyDownListener() {
        const eGui = this.getGui();
        const params = this.params;
        const listener = (event) => {
          if (!_isUserSuppressingKeyboardEvent(this.gos, event, params.node, params.column, true)) {
            params.onKeyDown(event);
          }
        };
        this.addManagedElementListeners(eGui, { keydown: listener });
      }
    };
    function shouldStartEditing(beans, { column: column2 }, event, cellStartedEdit, source2 = "ui") {
      if (event instanceof KeyboardEvent && (event.key === KeyCode.TAB || event.key === KeyCode.ENTER || event.key === KeyCode.F2 || event.key === KeyCode.BACKSPACE && cellStartedEdit)) {
        return true;
      }
      const extendingRange = event?.shiftKey && beans.rangeSvc?.getCellRanges().length != 0;
      if (extendingRange) {
        return false;
      }
      const colDef = column2?.getColDef();
      const clickCount = deriveClickCount(beans.gos, colDef);
      const type = event?.type;
      if (type === "click" && event?.detail === 1 && clickCount === 1) {
        return true;
      }
      if (type === "dblclick" && event?.detail === 2 && clickCount === 2) {
        return true;
      }
      if (source2 === "api") {
        return cellStartedEdit ?? false;
      }
      return false;
    }
    function deriveClickCount(gos, colDef) {
      if (gos.get("suppressClickEdit") === true) {
        return 0;
      }
      if (gos.get("singleClickEdit") === true) {
        return 1;
      }
      if (colDef?.singleClickEdit) {
        return 1;
      }
      return 2;
    }
    function isCellEditable(beans, { rowNode, column: column2 }, _source = "ui") {
      const editable2 = column2.getColDef().editable;
      const editModelSvc = beans.editModelSvc;
      return column2.isColumnFunc(rowNode, editable2) || !!editModelSvc && editModelSvc.hasEdits({ rowNode, column: column2 }, { withOpenEditor: true });
    }
    function isFullRowCellEditable(beans, position, source2 = "ui") {
      const editable2 = isCellEditable(beans, position, source2);
      if (editable2 === true || source2 === "ui") {
        return editable2;
      }
      const columns = beans.colModel.getCols();
      return columns.some((col) => isCellEditable(beans, { rowNode: position.rowNode, column: col }, source2));
    }
    var editHighlightFn = (edit, includeEditing = false) => {
      if (edit !== void 0) {
        return _sourceAndPendingDiffer(edit) || includeEditing && edit.state === "editing";
      }
    };
    function _hasEdits(beans, position, includeEditing = false) {
      return editHighlightFn(beans.editModelSvc?.getEdit(position), includeEditing);
    }
    var nodeHasLeafEdit = (children2, editModelSvc, column2) => {
      if (!children2) {
        return;
      }
      for (let i2 = 0, len = children2.length; i2 < len; ++i2) {
        const child = children2[i2];
        if (child.data) {
          const highlight = editHighlightFn(editModelSvc?.getEdit({ rowNode: child, column: column2 })) || editHighlightFn(editModelSvc?.getEdit({ rowNode: child.pinnedSibling, column: column2 }));
          if (highlight) {
            return true;
          }
        }
        if (nodeHasLeafEdit(child.childrenAfterGroup, editModelSvc, column2)) {
          return true;
        }
      }
    };
    function _hasLeafEdits(beans, position) {
      const { column: column2, rowNode } = position;
      if (beans.gos.get("groupTotalRow") && !rowNode?.footer) {
        return false;
      }
      return nodeHasLeafEdit(rowNode?.childrenAfterGroup, beans.editModelSvc, column2);
    }
    function _hasPinnedEdits(beans, { rowNode, column: column2 }) {
      rowNode = rowNode.pinnedSibling;
      if (!rowNode) {
        return;
      }
      return editHighlightFn(
        beans.editModelSvc?.getEdit({
          rowNode,
          column: column2
        })
      );
    }
    var CellEditStyleFeature = class extends BeanStub {
      constructor(cellCtrl, beans) {
        super();
        this.cellCtrl = cellCtrl;
        this.beans = beans;
        this.editSvc = beans.editSvc;
        this.editModelSvc = beans.editModelSvc;
      }
      setComp(comp2) {
        this.cellComp = comp2;
        this.applyCellStyles();
      }
      applyCellStyles() {
        const { cellCtrl, editSvc, beans } = this;
        if (editSvc?.isBatchEditing() && editSvc.isEditing()) {
          const state = _hasEdits(beans, cellCtrl) || _hasLeafEdits(beans, cellCtrl) || _hasPinnedEdits(beans, cellCtrl);
          this.applyBatchingStyle(state);
        } else {
          this.applyBatchingStyle(false);
        }
        const hasErrors = !!this.editModelSvc?.getCellValidationModel().hasCellValidation(this.cellCtrl);
        this.cellComp.toggleCss("ag-cell-editing-error", hasErrors);
      }
      applyBatchingStyle(newState) {
        this.cellComp.toggleCss("ag-cell-editing", newState ?? false);
        this.cellComp.toggleCss("ag-cell-batch-edit", (newState && this.editSvc?.isBatchEditing()) ?? false);
      }
    };
    var RowEditStyleFeature = class extends BeanStub {
      constructor(rowCtrl, beans) {
        super();
        this.rowCtrl = rowCtrl;
        this.beans = beans;
        this.gos = beans.gos;
        this.editSvc = beans.editSvc;
        this.editModelSvc = beans.editModelSvc;
      }
      applyRowStyles() {
        const { rowCtrl, editModelSvc, beans } = this;
        let rowNode = rowCtrl.rowNode;
        let edits = editModelSvc?.getEditRow(rowNode);
        const hasErrors = this.editModelSvc?.getRowValidationModel().hasRowValidation({ rowNode });
        if (!edits && rowNode.pinnedSibling) {
          rowNode = rowNode.pinnedSibling;
          edits = editModelSvc?.getEditRow(rowNode);
        }
        if (edits) {
          const editing = Array.from(edits.keys()).some((column2) => {
            const position = { rowNode, column: column2 };
            return _hasEdits(beans, position, true) || _hasLeafEdits(beans, position) || _hasPinnedEdits(beans, position);
          });
          this.applyStyle(hasErrors, editing);
          return;
        }
        this.applyStyle(hasErrors);
      }
      applyStyle(hasErrors = false, editing = false) {
        const batchEdit = this.editSvc?.isBatchEditing() ?? false;
        const fullRow = this.gos.get("editType") === "fullRow";
        this.rowCtrl?.forEachGui(void 0, ({ rowComp }) => {
          rowComp.toggleCss("ag-row-editing", fullRow && editing);
          rowComp.toggleCss("ag-row-batch-edit", fullRow && editing && batchEdit);
          rowComp.toggleCss("ag-row-inline-editing", editing);
          rowComp.toggleCss("ag-row-not-inline-editing", !editing);
          rowComp.toggleCss("ag-row-editing-invalid", fullRow && editing && hasErrors);
        });
      }
    };
    var purgeRows = ({ rowModel, pinnedRowModel, editModelSvc }, rowNodes) => {
      const found = /* @__PURE__ */ new Set();
      rowModel.forEachNode((node2) => rowNodes.has(node2) && found.add(node2));
      pinnedRowModel?.forEachPinnedRow("top", (node2) => rowNodes.has(node2) && found.add(node2));
      pinnedRowModel?.forEachPinnedRow("bottom", (node2) => rowNodes.has(node2) && found.add(node2));
      for (const rowNode of rowNodes) {
        if (!found.has(rowNode)) {
          editModelSvc.removeEdits({ rowNode });
        }
      }
      return found;
    };
    var purgeCells = ({ editModelSvc }, rowNodes, columns) => {
      for (const rowNode of rowNodes) {
        editModelSvc?.getEditRow(rowNode)?.forEach((_, column2) => !columns.has(column2) && editModelSvc.removeEdits({ rowNode, column: column2 }));
      }
    };
    var _refreshEditCells = (beans) => () => {
      const columns = new Set(beans.colModel.getCols());
      const updates = beans.editModelSvc.getEditMap(true);
      const rowNodes = new Set(updates.keys());
      purgeCells(beans, purgeRows(beans, rowNodes), columns);
    };
    var KEEP_EDITOR_SOURCES = /* @__PURE__ */ new Set(["undo", "redo", "paste", "bulk", "rangeSvc"]);
    var INTERNAL_EDITOR_SOURCES = /* @__PURE__ */ new Set(["ui", "api"]);
    var STOP_EDIT_SOURCE_TRANSFORM = {
      paste: "api",
      rangeSvc: "api",
      fillHandle: "api",
      cellClear: "api",
      bulk: "api"
    };
    var STOP_EDIT_SOURCE_TRANSFORM_KEYS = new Set(Object.keys(STOP_EDIT_SOURCE_TRANSFORM));
    var SET_DATA_SOURCE_AS_API = /* @__PURE__ */ new Set([
      "paste",
      "rangeSvc",
      "renderer",
      "cellClear",
      "redo",
      "undo"
    ]);
    var CANCEL_PARAMS = { cancel: true, source: "api" };
    var COMMIT_PARAMS = { cancel: false, source: "api" };
    var CHECK_SIBLING = { checkSiblings: true };
    var FORCE_REFRESH = { force: true, suppressFlash: true };
    var EditService = class extends BeanStub {
      constructor() {
        super(...arguments);
        this.beanName = "editSvc";
        this.batch = false;
        this.stopping = false;
        this.committing = false;
      }
      postConstruct() {
        const { beans } = this;
        this.model = beans.editModelSvc;
        this.valueSvc = beans.valueSvc;
        this.rangeSvc = beans.rangeSvc;
        this.addManagedPropertyListener("editType", ({ currentValue }) => {
          this.stopEditing(void 0, CANCEL_PARAMS);
          this.createStrategy(currentValue);
        });
        const handler = _refreshEditCells(beans);
        const stopInvalidEdits = () => {
          const hasCellValidation = this.model.getCellValidationModel().getCellValidationMap().size > 0;
          const hasRowValidation = this.model.getRowValidationModel().getRowValidationMap().size > 0;
          if (hasCellValidation || hasRowValidation) {
            this.stopEditing(void 0, CANCEL_PARAMS);
          } else if (this.isEditing()) {
            if (this.isBatchEditing()) {
              _destroyEditors(beans, this.model.getEditPositions());
            } else {
              this.stopEditing(void 0, COMMIT_PARAMS);
            }
          }
          return false;
        };
        this.addManagedEventListeners({
          columnPinned: handler,
          columnVisible: handler,
          columnRowGroupChanged: handler,
          rowExpansionStateChanged: handler,
          pinnedRowsChanged: handler,
          displayedRowsChanged: handler,
          sortChanged: stopInvalidEdits,
          filterChanged: stopInvalidEdits,
          cellFocused: this.onCellFocused.bind(this)
        });
      }
      isBatchEditing() {
        return this.batch;
      }
      setBatchEditing(enabled) {
        if (enabled) {
          this.batch = true;
          this.stopEditing(void 0, CANCEL_PARAMS);
        } else {
          this.stopEditing(void 0, CANCEL_PARAMS);
          this.batch = false;
        }
      }
      createStrategy(editType) {
        const { beans, gos, strategy } = this;
        const name2 = getEditType(gos, editType);
        if (strategy) {
          if (strategy.beanName === name2) {
            return strategy;
          }
          this.destroyStrategy();
        }
        return this.strategy = this.createOptionalManagedBean(
          beans.registry.createDynamicBean(name2, true)
        );
      }
      destroyStrategy() {
        if (!this.strategy) {
          return;
        }
        this.strategy.destroy();
        this.strategy = this.destroyBean(this.strategy);
      }
      shouldStartEditing(position, event, cellStartedEdit, source2 = "ui") {
        const shouldStart = shouldStartEditing(this.beans, position, event, cellStartedEdit, source2);
        if (shouldStart) {
          this.strategy ?? (this.strategy = this.createStrategy());
        }
        return shouldStart;
      }
      shouldStopEditing(position, event, source2 = "ui") {
        return this.strategy?.shouldStop(position, event, source2) ?? null;
      }
      shouldCancelEditing(position, event, source2 = "ui") {
        return this.strategy?.shouldCancel(position, event, source2) ?? null;
      }
      validateEdit() {
        return _validateEdit(this.beans);
      }
      isEditing(position, params) {
        return this.model.hasEdits(position, params ?? CHECK_SIBLING);
      }
      isRowEditing(rowNode, params) {
        return (rowNode && this.model.hasRowEdits(rowNode, params)) ?? false;
      }
      /** @returns whether to prevent default on event */
      startEditing(position, params) {
        const { startedEdit = true, event = null, source: source2 = "ui", ignoreEventKey = false, silent } = params;
        this.strategy ?? (this.strategy = this.createStrategy());
        if (!this.isCellEditable(position, "api")) {
          return;
        }
        const cellCtrl = _getCellCtrl(this.beans, position);
        if (cellCtrl && !cellCtrl.comp) {
          cellCtrl.onCompAttachedFuncs.push(() => this.startEditing(position, params));
          return;
        }
        const res = this.shouldStartEditing(position, event, startedEdit, source2);
        if (res === false && source2 !== "api") {
          this.isEditing(position) && this.stopEditing();
          return;
        }
        if (!this.batch && this.shouldStopEditing(position, void 0, source2) && !params.continueEditing) {
          this.stopEditing(void 0, { source: source2 });
        }
        if (res && this.isBatchEditing()) {
          this.dispatchBatchEvent("batchEditingStarted", /* @__PURE__ */ new Map());
        }
        this.strategy.start({
          position,
          event,
          source: source2,
          ignoreEventKey,
          startedEdit,
          silent
        });
      }
      stopEditing(position, params) {
        const { event, cancel, source: source2 = "ui", forceCancel, forceStop } = params || {};
        const { beans, model: model2 } = this;
        if (STOP_EDIT_SOURCE_TRANSFORM_KEYS.has(source2)) {
          if (this.isBatchEditing()) {
            this.bulkRefresh(position);
            return false;
          }
        }
        const treatAsSource = this.committing ? STOP_EDIT_SOURCE_TRANSFORM[source2] : source2;
        const isEditingOrBatchWithEdits = this.committing || this.isEditing(position) || this.isBatchEditing() && model2.hasEdits(position, CHECK_SIBLING);
        if (!isEditingOrBatchWithEdits || !this.strategy || this.stopping) {
          return false;
        }
        this.stopping = true;
        const cellCtrl = _getCellCtrl(beans, position);
        if (cellCtrl) {
          cellCtrl.onEditorAttachedFuncs = [];
        }
        let edits = model2.getEditMap(true);
        let res = false;
        const willStop = !cancel && (!!this.shouldStopEditing(position, event, treatAsSource) || this.committing && !this.batch) || (forceStop ?? false);
        const willCancel = cancel && !!this.shouldCancelEditing(position, event, treatAsSource) || (forceCancel ?? false);
        if (willStop || willCancel) {
          _syncFromEditors(beans, { persist: true, isCancelling: willCancel || cancel, isStopping: willStop });
          const freshEdits = model2.getEditMap();
          const editsToDelete = this.processEdits(freshEdits, cancel, source2);
          this.strategy?.stop(cancel, event);
          for (const position2 of editsToDelete) {
            model2.clearEditValue(position2);
          }
          this.bulkRefresh(void 0, edits);
          for (const pos2 of model2.getEditPositions(freshEdits)) {
            const cellCtrl2 = _getCellCtrl(beans, pos2);
            const valueChanged = _sourceAndPendingDiffer(pos2);
            cellCtrl2?.refreshCell({ force: true, suppressFlash: !valueChanged });
          }
          edits = freshEdits;
          res || (res = willStop);
        } else if (event instanceof KeyboardEvent && this.batch && this.strategy?.midBatchInputsAllowed(position) && this.isEditing(position, { withOpenEditor: true })) {
          const { key: key2 } = event;
          const isEnter = key2 === KeyCode.ENTER;
          const isEscape = key2 === KeyCode.ESCAPE;
          const isTab = key2 === KeyCode.TAB;
          if (isEnter || isTab || isEscape) {
            if (isEnter || isTab) {
              _syncFromEditors(beans, { persist: true });
            } else if (isEscape) {
              this.revertSingleCellEdit(cellCtrl);
            }
            if (this.isBatchEditing()) {
              this.strategy?.cleanupEditors();
            } else {
              _destroyEditors(beans, model2.getEditPositions(), { event, cancel: isEscape });
            }
            event.preventDefault();
            this.bulkRefresh(position, edits, { suppressFlash: true });
            edits = model2.getEditMap();
          }
        } else {
          _syncFromEditors(beans, { persist: true });
          edits = model2.getEditMap();
        }
        if (res && position) {
          this.model.removeEdits(position);
        }
        this.navigateAfterEdit(params, cellCtrl?.cellPosition);
        _purgeUnchangedEdits(beans);
        if (!this.model.hasEdits()) {
          this.model.getCellValidationModel().clearCellValidationMap();
          this.model.getRowValidationModel().clearRowValidationMap();
        }
        this.bulkRefresh();
        if (willCancel) {
          this.beans.rowRenderer.refreshRows({ rowNodes: Array.from(edits.keys()) });
        }
        if (this.isBatchEditing()) {
          this.beans.rowRenderer.refreshRows({ suppressFlash: true, force: true });
          if (res && willStop) {
            this.dispatchBatchEvent("batchEditingStopped", edits);
          }
        }
        this.stopping = false;
        return res;
      }
      navigateAfterEdit(params, cellPosition) {
        if (!params || !cellPosition) {
          return;
        }
        const { event, suppressNavigateAfterEdit } = params;
        const isKeyBoardEvent = event instanceof KeyboardEvent;
        if (!isKeyBoardEvent || suppressNavigateAfterEdit) {
          return;
        }
        const { key: key2, shiftKey } = event;
        const navAfterEdit = this.gos.get("enterNavigatesVerticallyAfterEdit");
        if (key2 !== KeyCode.ENTER || !navAfterEdit) {
          return;
        }
        const direction = shiftKey ? KeyCode.UP : KeyCode.DOWN;
        this.beans.navigation?.navigateToNextCell(null, direction, cellPosition, false);
      }
      processEdits(edits, cancel = false, source2) {
        const rowNodes = Array.from(edits.keys());
        const hasValidationErrors = this.model.getCellValidationModel().getCellValidationMap().size > 0 || this.model.getRowValidationModel().getRowValidationMap().size > 0;
        const editsToDelete = [];
        for (const rowNode of rowNodes) {
          const editRow = edits.get(rowNode);
          for (const column2 of editRow.keys()) {
            const editValue = editRow.get(column2);
            const position = { rowNode, column: column2 };
            const valueChanged = _sourceAndPendingDiffer(editValue);
            if (!cancel && valueChanged && !hasValidationErrors) {
              const success2 = this.setNodeDataValue(rowNode, column2, editValue.pendingValue, void 0, source2);
              if (!success2) {
                editsToDelete.push(position);
              }
            }
          }
        }
        return editsToDelete;
      }
      setNodeDataValue(rowNode, column2, newValue, refreshCell, originalSource = "edit") {
        const { beans } = this;
        const cellCtrl = _getCellCtrl(beans, { rowNode, column: column2 });
        const translatedSource = INTERNAL_EDITOR_SOURCES.has(originalSource) ? "edit" : originalSource;
        if (cellCtrl) {
          cellCtrl.suppressRefreshCell = true;
        }
        this.commitNextEdit();
        const success2 = rowNode.setDataValue(column2, newValue, translatedSource);
        if (cellCtrl) {
          cellCtrl.suppressRefreshCell = false;
        }
        if (refreshCell) {
          cellCtrl?.refreshCell(FORCE_REFRESH);
        }
        return success2;
      }
      setEditMap(edits, params) {
        this.strategy ?? (this.strategy = this.createStrategy());
        this.strategy?.setEditMap(edits, params);
        this.bulkRefresh();
        let refreshParams = FORCE_REFRESH;
        if (params?.forceRefreshOfEditCellsOnly) {
          refreshParams = {
            ...getRowColumnsFromMap(edits),
            ...FORCE_REFRESH
          };
        }
        this.beans.rowRenderer.refreshCells(refreshParams);
      }
      dispatchEditValuesChanged({ rowNode, column: column2 }, edit = {}) {
        if (!rowNode || !column2 || !edit) {
          return;
        }
        const { pendingValue, sourceValue } = edit;
        const { rowIndex, rowPinned, data } = rowNode;
        this.beans.eventSvc.dispatchEvent({
          type: "cellEditValuesChanged",
          node: rowNode,
          rowIndex,
          rowPinned,
          column: column2,
          source: "api",
          data,
          newValue: pendingValue,
          oldValue: sourceValue,
          value: pendingValue,
          colDef: column2.getColDef()
        });
      }
      bulkRefresh(position = {}, editMap, params = {}) {
        const { beans, gos } = this;
        const { editModelSvc, rowModel } = beans;
        if (_isClientSideRowModel(gos)) {
          if (position.rowNode && position.column) {
            this.refCell(position, this.model.getEdit(position), params);
          } else if (editMap) {
            editModelSvc?.getEditMap(false)?.forEach((editRow, rowNode) => {
              for (const column2 of editRow.keys()) {
                this.refCell({ rowNode, column: column2 }, editRow.get(column2), params);
              }
            });
          }
        }
      }
      refCell({ rowNode, column: column2 }, edit, params = {}) {
        const { beans, gos } = this;
        const updatedNodes = /* @__PURE__ */ new Set([rowNode]);
        const refreshNodes = /* @__PURE__ */ new Set();
        const pinnedSibling = rowNode.pinnedSibling;
        if (pinnedSibling) {
          updatedNodes.add(pinnedSibling);
        }
        const sibling = rowNode.sibling;
        if (sibling) {
          refreshNodes.add(sibling);
        }
        let parent = rowNode.parent;
        while (parent) {
          if (parent.sibling?.footer && gos.get("groupTotalRow")) {
            refreshNodes.add(parent.sibling);
          } else if (!parent.parent && parent.sibling && gos.get("grandTotalRow")) {
            refreshNodes.add(parent.sibling);
          } else {
            refreshNodes.add(parent);
          }
          parent = parent.parent;
        }
        for (const node2 of updatedNodes) {
          this.dispatchEditValuesChanged({ rowNode: node2, column: column2 }, edit);
        }
        for (const node2 of updatedNodes) {
          _getCellCtrl(beans, { rowNode: node2, column: column2 })?.refreshCell(params);
        }
        for (const node2 of refreshNodes) {
          _getCellCtrl(beans, { rowNode: node2, column: column2 })?.refreshCell(params);
        }
      }
      stopAllEditing(cancel = false, source2 = "ui") {
        if (this.isEditing()) {
          this.stopEditing(void 0, { cancel, source: source2 });
        }
      }
      isCellEditable(position, source2 = "ui") {
        const { rowNode } = position;
        const { gos, beans } = this;
        if (rowNode.group) {
          if (gos.get("treeData")) {
            if (!rowNode.data && !gos.get("enableGroupEdit")) {
              return false;
            }
          } else if (!gos.get("enableGroupEdit")) {
            return false;
          }
        }
        const isEditable = getEditType(gos) === "fullRow" ? isFullRowCellEditable(beans, position, source2) : isCellEditable(beans, position, source2);
        if (isEditable) {
          this.strategy ?? (this.strategy = this.createStrategy());
        }
        return isEditable;
      }
      cellEditingInvalidCommitBlocks() {
        return this.gos.get("invalidEditValueMode") === "block";
      }
      checkNavWithValidation(position, event, focus = true) {
        if (this.hasValidationErrors(position)) {
          const cellCtrl = _getCellCtrl(this.beans, position);
          if (this.cellEditingInvalidCommitBlocks()) {
            event?.preventDefault?.();
            if (focus) {
              !cellCtrl?.hasBrowserFocus() && cellCtrl?.focusCell();
              cellCtrl?.comp?.getCellEditor()?.focusIn?.();
            }
            return "block-stop";
          }
          cellCtrl && this.revertSingleCellEdit(cellCtrl);
          return "revert-continue";
        }
        return "continue";
      }
      revertSingleCellEdit(cellPosition, focus = false) {
        const cellCtrl = _getCellCtrl(this.beans, cellPosition);
        if (!cellCtrl?.comp?.getCellEditor()) {
          return;
        }
        _destroyEditors(this.beans, [cellPosition], { silent: true });
        this.model.clearEditValue(cellPosition);
        _setupEditor(this.beans, cellPosition, { silent: true });
        _populateModelValidationErrors(this.beans);
        cellCtrl?.refreshCell(FORCE_REFRESH);
        if (!focus) {
          return;
        }
        cellCtrl?.focusCell();
        cellCtrl?.comp?.getCellEditor()?.focusIn?.();
      }
      hasValidationErrors(position) {
        _populateModelValidationErrors(this.beans);
        const cellCtrl = _getCellCtrl(this.beans, position);
        if (cellCtrl) {
          cellCtrl.refreshCell(FORCE_REFRESH);
          cellCtrl.rowCtrl.rowEditStyleFeature?.applyRowStyles();
        }
        let invalid = false;
        if (position?.rowNode) {
          invalid || (invalid = this.model.getRowValidationModel().hasRowValidation({ rowNode: position.rowNode }));
          if (position.column) {
            invalid || (invalid = this.model.getCellValidationModel().hasCellValidation({ rowNode: position.rowNode, column: position.column }));
          }
        } else {
          invalid || (invalid = this.model.getCellValidationModel().getCellValidationMap().size > 0);
          invalid || (invalid = this.model.getRowValidationModel().getRowValidationMap().size > 0);
        }
        return invalid;
      }
      moveToNextCell(prev, backwards, event, source2 = "ui") {
        let res;
        const editing = this.isEditing();
        const preventNavigation = editing && this.checkNavWithValidation(void 0, event) === "block-stop";
        if (prev instanceof CellCtrl && editing) {
          res = this.strategy?.moveToNextEditingCell(prev, backwards, event, source2, preventNavigation);
        }
        if (res === null) {
          return res;
        }
        res = res || !!this.beans.focusSvc.focusedHeader;
        if (res === false && !preventNavigation) {
          this.stopEditing();
        }
        return res;
      }
      getCellDataValue({ rowNode, column: column2 }, preferEditor = true) {
        if (!rowNode || !column2) {
          return void 0;
        }
        let edit = this.model.getEdit({ rowNode, column: column2 });
        const pinnedSibling = rowNode.pinnedSibling;
        if (pinnedSibling) {
          const siblingEdit = this.model.getEdit({ rowNode: pinnedSibling, column: column2 });
          if (siblingEdit) {
            edit = siblingEdit;
          }
        }
        const newValue = preferEditor ? edit?.editorValue ?? edit?.pendingValue : edit?.pendingValue;
        return newValue === UNEDITED || !edit ? edit?.sourceValue ?? this.valueSvc.getValue(column2, rowNode, false, "api") : newValue;
      }
      addStopEditingWhenGridLosesFocus(viewports) {
        _addStopEditingWhenGridLosesFocus(this, this.beans, viewports);
      }
      createPopupEditorWrapper(params) {
        return new PopupEditorWrapper(params);
      }
      commitNextEdit() {
        this.committing = true;
      }
      setDataValue(position, newValue, eventSource) {
        try {
          if ((!this.isEditing() || this.committing) && !SET_DATA_SOURCE_AS_API.has(eventSource)) {
            return;
          }
          const { beans } = this;
          this.strategy ?? (this.strategy = this.createStrategy());
          const source2 = this.isBatchEditing() ? "ui" : this.committing ? eventSource ?? "api" : "api";
          if (!eventSource || KEEP_EDITOR_SOURCES.has(eventSource)) {
            _syncFromEditor(beans, position, newValue, eventSource, void 0, { persist: true });
            return this.setNodeDataValue(position.rowNode, position.column, newValue, true, eventSource);
          }
          const existing = this.model.getEdit(position);
          if (existing) {
            if (existing.pendingValue === newValue) {
              return false;
            }
            if (existing.sourceValue !== newValue) {
              _syncFromEditor(beans, position, newValue, eventSource, void 0, { persist: true });
              this.stopEditing(position, { source: source2, suppressNavigateAfterEdit: true });
              return true;
            }
            if (existing.sourceValue === newValue) {
              beans.editModelSvc?.removeEdits(position);
              this.dispatchEditValuesChanged(position, {
                ...existing,
                pendingValue: newValue
              });
              return true;
            }
          }
          _syncFromEditor(beans, position, newValue, eventSource, void 0, { persist: true });
          this.stopEditing(position, { source: source2, suppressNavigateAfterEdit: true });
          return true;
        } finally {
          this.committing = false;
        }
      }
      handleColDefChanged(cellCtrl) {
        _refreshEditorOnColDefChanged(this.beans, cellCtrl);
      }
      destroy() {
        this.model.clear();
        this.destroyStrategy();
        super.destroy();
      }
      prepDetailsDuringBatch(position, params) {
        if (!this.batch) {
          return;
        }
        const hasEdits = this.model.hasRowEdits(position.rowNode, CHECK_SIBLING);
        if (!hasEdits) {
          return;
        }
        const { rowNode, column: column2 } = position;
        const { compDetails, valueToDisplay } = params;
        if (compDetails) {
          const { params: params2 } = compDetails;
          params2.data = this.model.getEditRowDataValue(rowNode, CHECK_SIBLING);
          return { compDetails };
        }
        const editRow = this.model.getEditRow(position.rowNode, CHECK_SIBLING);
        if (valueToDisplay !== void 0 && editRow?.has(column2)) {
          return { valueToDisplay: this.valueSvc.getValue(column2, rowNode) };
        }
      }
      cleanupEditors() {
        this.strategy?.cleanupEditors();
      }
      dispatchCellEvent(position, event, type, payload) {
        this.strategy?.dispatchCellEvent(position, event, type, payload);
      }
      dispatchBatchEvent(type, edits) {
        this.eventSvc.dispatchEvent(this.createBatchEditEvent(type, edits));
      }
      createBatchEditEvent(type, edits) {
        return _addGridCommonParams(this.gos, {
          type,
          ...type === "batchEditingStopped" ? {
            changes: this.toEventChangeList(edits)
          } : {}
        });
      }
      toEventChangeList(edits) {
        return this.model.getEditPositions(edits).map((edit) => ({
          rowIndex: edit.rowNode.rowIndex,
          rowPinned: edit.rowNode.rowPinned,
          columnId: edit.column.getColId(),
          newValue: edit.pendingValue,
          oldValue: edit.sourceValue
        }));
      }
      applyBulkEdit({ rowNode, column: column2 }, ranges) {
        if (!ranges || ranges.length === 0) {
          return;
        }
        const { beans, rangeSvc, valueSvc } = this;
        _syncFromEditors(beans, { persist: true });
        const edits = this.model.getEditMap(true);
        const editValue = edits.get(rowNode)?.get(column2)?.pendingValue;
        if (!this.batch) {
          this.eventSvc.dispatchEvent({ type: "bulkEditingStarted" });
        }
        ranges.forEach((range2) => {
          rangeSvc?.forEachRowInRange(range2, (position) => {
            const rowNode2 = _getRowNode(beans, position);
            if (rowNode2 === void 0) {
              return;
            }
            const editRow = edits.get(rowNode2) ?? /* @__PURE__ */ new Map();
            for (const column22 of range2.columns) {
              if (!column22) {
                continue;
              }
              if (this.isCellEditable({ rowNode: rowNode2, column: column22 }, "api")) {
                const sourceValue = valueSvc.getValue(column22, rowNode2, true, "api");
                let pendingValue = valueSvc.parseValue(
                  column22,
                  rowNode2 ?? null,
                  editValue,
                  sourceValue
                );
                if (Number.isNaN(pendingValue)) {
                  pendingValue = null;
                }
                editRow.set(column22, {
                  editorValue: void 0,
                  pendingValue,
                  sourceValue,
                  state: "changed",
                  editorState: {
                    isCancelAfterEnd: void 0,
                    isCancelBeforeStart: void 0
                  }
                });
              }
            }
            if (editRow.size > 0) {
              edits.set(rowNode2, editRow);
            }
          });
          this.setEditMap(edits);
          if (this.batch) {
            this.cleanupEditors();
            _purgeUnchangedEdits(beans);
            this.bulkRefresh();
            return;
          }
          this.commitNextEdit();
          this.stopEditing(void 0, { source: "bulk" });
          this.eventSvc.dispatchEvent({ type: "bulkEditingStopped", changes: this.toEventChangeList(edits) });
        });
        this.bulkRefresh();
        const cellCtrl = _getCellCtrl(beans, { rowNode, column: column2 });
        if (cellCtrl) {
          cellCtrl.focusCell(true);
        }
      }
      createCellStyleFeature(cellCtrl, beans) {
        return new CellEditStyleFeature(cellCtrl, beans);
      }
      createRowStyleFeature(rowCtrl, beans) {
        return new RowEditStyleFeature(rowCtrl, beans);
      }
      setEditingCells(cells, params) {
        const { beans } = this;
        const { colModel, valueSvc } = beans;
        const edits = /* @__PURE__ */ new Map();
        for (let { colId, column: column2, colKey, rowIndex, rowPinned, newValue: pendingValue, state } of cells) {
          const col = colId ? colModel.getCol(colId) : colKey ? colModel.getCol(colKey) : column2;
          if (!col) {
            continue;
          }
          const rowNode = _getRowNode(beans, { rowIndex, rowPinned });
          if (!rowNode) {
            continue;
          }
          const sourceValue = valueSvc.getValue(col, rowNode, true, "api");
          if (!params?.forceRefreshOfEditCellsOnly && !_sourceAndPendingDiffer({ pendingValue, sourceValue }) && state !== "editing") {
            continue;
          }
          let editRow = edits.get(rowNode);
          if (!editRow) {
            editRow = /* @__PURE__ */ new Map();
            edits.set(rowNode, editRow);
          }
          if (pendingValue === void 0) {
            pendingValue = UNEDITED;
          }
          editRow.set(col, {
            editorValue: void 0,
            pendingValue,
            sourceValue,
            state: state ?? "changed",
            editorState: {
              isCancelAfterEnd: void 0,
              isCancelBeforeStart: void 0
            }
          });
        }
        this.setEditMap(edits, params);
      }
      onCellFocused(event) {
        const cellCtrl = _getCellCtrl(this.beans, event);
        if (!cellCtrl || !this.isEditing(cellCtrl, CHECK_SIBLING)) {
          return;
        }
        const edit = this.model.getEdit(cellCtrl);
        if (!edit || !_sourceAndPendingDiffer(edit)) {
          return;
        }
        const translate = this.getLocaleTextFunc();
        const label2 = translate("ariaPendingChange", "Pending Change");
        this.beans.ariaAnnounce?.announceValue(label2, "pendingChange");
      }
      allowedFocusTargetOnValidation(cellPosition) {
        return _getCellCtrl(this.beans, cellPosition);
      }
    };
    function getRowColumnsFromMap(edits) {
      return {
        rowNodes: edits ? Array.from(edits.keys()) : void 0,
        columns: edits ? [...new Set(Array.from(edits.values()).flatMap((er2) => Array.from(er2.keys())))] : void 0
      };
    }
    function getEditType(gos, editType) {
      return editType ?? gos.get("editType") ?? "singleCell";
    }
    var BaseEditStrategy = class extends BeanStub {
      postConstruct() {
        this.model = this.beans.editModelSvc;
        this.editSvc = this.beans.editSvc;
        this.addManagedEventListeners({
          cellFocused: this.onCellFocusChanged?.bind(this),
          cellFocusCleared: this.onCellFocusChanged?.bind(this)
        });
      }
      clearEdits(position) {
        this.model.clearEditValue(position);
      }
      onCellFocusChanged(event) {
        let cellCtrl;
        const previous = event["previousParams"];
        const { editSvc, beans } = this;
        const sourceEvent = event.type === "cellFocused" ? event.sourceEvent : null;
        if (previous) {
          cellCtrl = _getCellCtrl(beans, previous);
        }
        const { gos, editModelSvc } = beans;
        const isFocusCleared = event.type === "cellFocusCleared";
        if (editSvc.isEditing(void 0, { withOpenEditor: true })) {
          const { column: column2, rowIndex, rowPinned } = event;
          const cellPositionFromEvent = {
            column: column2,
            rowNode: _getRowNode(beans, { rowIndex, rowPinned })
          };
          const isBlock = gos.get("invalidEditValueMode") === "block";
          if (isBlock) {
            return;
          }
          const shouldRevert = !isBlock;
          const hasError = !!editModelSvc?.getCellValidationModel().hasCellValidation(cellPositionFromEvent);
          const shouldCancel = shouldRevert && hasError;
          const result2 = previous || isFocusCleared ? editSvc.stopEditing(void 0, {
            cancel: shouldCancel,
            source: isFocusCleared && shouldRevert ? "api" : void 0,
            event: sourceEvent
          }) : true;
          if (!result2) {
            if (editSvc.isBatchEditing()) {
              editSvc.cleanupEditors();
            } else {
              editSvc.stopEditing(void 0, { source: "api" });
            }
          }
        }
        cellCtrl?.refreshCell({ suppressFlash: true, force: true });
      }
      stop(cancel, event) {
        const editingCells = this.model.getEditPositions();
        const results = { all: [], pass: [], fail: [] };
        for (const cell2 of editingCells) {
          results.all.push(cell2);
          const validation = this.model.getCellValidationModel().getCellValidation(cell2);
          if ((validation?.errorMessages?.length ?? 0) > 0) {
            results.fail.push(cell2);
            continue;
          }
          results.pass.push(cell2);
        }
        if (cancel) {
          for (const cell2 of editingCells) {
            _destroyEditor(this.beans, cell2, { cancel });
            this.model.stop(cell2);
          }
        } else {
          const actions = this.processValidationResults(results);
          if (actions.destroy.length > 0) {
            for (const cell2 of actions.destroy) {
              _destroyEditor(this.beans, cell2, { event, cancel });
              this.model.stop(cell2);
            }
          }
          if (actions.keep.length > 0) {
            for (const cell2 of actions.keep) {
              const cellCtrl = _getCellCtrl(this.beans, cell2);
              if (!this.editSvc?.cellEditingInvalidCommitBlocks()) {
                cellCtrl && this.editSvc.revertSingleCellEdit(cellCtrl);
              }
            }
          }
        }
        return true;
      }
      cleanupEditors({ rowNode } = {}, includeEditing) {
        _syncFromEditors(this.beans, { persist: false });
        const positions = this.model.getEditPositions();
        const discard = [];
        if (rowNode) {
          for (const pos2 of positions) {
            if (pos2.rowNode !== rowNode) {
              discard.push(pos2);
            }
          }
        } else {
          for (const pos2 of positions) {
            discard.push(pos2);
          }
        }
        _destroyEditors(this.beans, discard);
        _purgeUnchangedEdits(this.beans, includeEditing);
      }
      setFocusOutOnEditor(cellCtrl) {
        cellCtrl.comp?.getCellEditor()?.focusOut?.();
      }
      setFocusInOnEditor(cellCtrl) {
        const comp2 = cellCtrl.comp;
        const editor = comp2?.getCellEditor();
        if (editor?.focusIn) {
          editor.focusIn();
        } else {
          const isFullRow = this.beans.gos.get("editType") === "fullRow";
          cellCtrl.focusCell(isFullRow);
          cellCtrl.onEditorAttachedFuncs.push(() => comp2?.getCellEditor()?.focusIn?.());
        }
      }
      setupEditors(params) {
        const { event, ignoreEventKey = false, startedEdit, position, cells = this.model.getEditPositions() } = params;
        const key2 = event instanceof KeyboardEvent && !ignoreEventKey && event.key || void 0;
        _setupEditors(this.beans, cells, position, key2, event, startedEdit);
      }
      dispatchCellEvent(position, event, type, payload) {
        const cellCtrl = _getCellCtrl(this.beans, position);
        if (cellCtrl) {
          this.eventSvc.dispatchEvent({ ...cellCtrl.createEvent(event ?? null, type), ...payload });
        }
      }
      dispatchRowEvent(position, type, silent) {
        if (silent) {
          return;
        }
        const rowCtrl = _getRowCtrl(this.beans, position);
        if (rowCtrl) {
          this.eventSvc.dispatchEvent(rowCtrl.createRowEvent(type));
        }
      }
      shouldStop(_position, event, source2 = "ui") {
        const batch2 = this.editSvc.isBatchEditing();
        if (batch2 && source2 === "api") {
          return true;
        }
        if (batch2 && (source2 === "ui" || source2 === "edit")) {
          return false;
        }
        if (source2 === "api") {
          return true;
        }
        if (event instanceof KeyboardEvent && !batch2) {
          return event.key === KeyCode.ENTER;
        }
        return null;
      }
      shouldCancel(_position, event, source2 = "ui") {
        const batch2 = this.editSvc.isBatchEditing();
        if (event instanceof KeyboardEvent && !batch2) {
          const result2 = event.key === KeyCode.ESCAPE;
          if (result2) {
            return true;
          }
        }
        if (batch2 && source2 === "api") {
          return true;
        }
        if (source2 === "api") {
          return true;
        }
        return false;
      }
      setEditMap(edits, params) {
        if (!params?.update) {
          this.editSvc.stopEditing(void 0, { cancel: true, source: "api" });
        }
        const cells = [];
        edits.forEach((editRow, rowNode) => {
          editRow.forEach((cellData, column2) => {
            if (cellData.state === "editing") {
              cells.push({ ...cellData, rowNode, column: column2 });
            }
          });
        });
        if (params?.update) {
          edits = new Map([...this.model.getEditMap(), ...edits]);
        }
        this.model?.setEditMap(edits);
        if (cells.length > 0) {
          const position = cells.at(-1);
          const key2 = position.pendingValue === UNEDITED ? void 0 : position.pendingValue;
          this.start({ position, event: new KeyboardEvent("keydown", { key: key2 }), source: "api" });
          const cellCtrl = _getCellCtrl(this.beans, position);
          if (cellCtrl) {
            this.setFocusInOnEditor(cellCtrl);
          }
        }
      }
      destroy() {
        this.cleanupEditors();
        super.destroy();
      }
    };
    var FullRowEditStrategy = class extends BaseEditStrategy {
      constructor() {
        super(...arguments);
        this.beanName = "fullRow";
        this.startedRows = [];
      }
      shouldStop(position, event, _source = "ui") {
        const { rowNode } = position || {};
        const oldRowCtrl = _getRowCtrl(this.beans, {
          rowNode: this.rowNode
        });
        if (!oldRowCtrl) {
          return true;
        }
        const res = super.shouldStop({ rowNode: this.rowNode }, event, _source);
        if (res !== null) {
          return res;
        }
        if (!this.rowNode) {
          return false;
        }
        return rowNode !== this.rowNode;
      }
      midBatchInputsAllowed({ rowNode }) {
        if (!rowNode) {
          return false;
        }
        return this.model.hasEdits({ rowNode });
      }
      clearEdits(position) {
        this.model.clearEditValue(position);
      }
      start(params) {
        const { position, silent, startedEdit, event, ignoreEventKey } = params;
        const { rowNode } = position;
        if (this.rowNode !== rowNode) {
          super.cleanupEditors(position);
        }
        const columns = this.beans.visibleCols.allCols;
        const cells = [];
        const editableColumns = [];
        for (const column2 of columns) {
          if (column2.isCellEditable(rowNode)) {
            editableColumns.push(column2);
          }
        }
        if (editableColumns.length == 0) {
          return;
        }
        this.dispatchRowEvent({ rowNode }, "rowEditingStarted", silent);
        this.startedRows.push(rowNode);
        for (const column2 of editableColumns) {
          const position2 = {
            rowNode,
            column: column2
          };
          cells.push(position2);
          if (!this.model.hasEdits(position2)) {
            this.model.start(position2);
          }
        }
        this.rowNode = rowNode;
        this.setupEditors({ cells, position, startedEdit, event, ignoreEventKey });
      }
      processValidationResults(results) {
        const anyFailed = results.fail.length > 0;
        if (anyFailed && this.editSvc.cellEditingInvalidCommitBlocks()) {
          return {
            destroy: [],
            keep: results.all
          };
        }
        return {
          destroy: results.all,
          keep: []
        };
      }
      stop(cancel, event) {
        const { rowNode } = this;
        if (rowNode && !this.model.hasRowEdits(rowNode)) {
          return false;
        }
        const changedRows = [];
        if (!cancel) {
          this.model.getEditMap().forEach((rowEdits, rowNode2) => {
            if (!rowEdits || rowEdits.size === 0) {
              return;
            }
            for (const edit of rowEdits.values()) {
              if (_sourceAndPendingDiffer(edit)) {
                changedRows.push(rowNode2);
                break;
              }
            }
          });
        }
        _populateModelValidationErrors(this.beans);
        if (!cancel && this.editSvc?.checkNavWithValidation({ rowNode }) === "block-stop") {
          return false;
        }
        super.stop(cancel, event);
        for (const rowNode2 of changedRows) {
          this.dispatchRowEvent({ rowNode: rowNode2 }, "rowValueChanged");
        }
        this.cleanupEditors({ rowNode }, true);
        this.rowNode = void 0;
        return true;
      }
      onCellFocusChanged(event) {
        const { rowIndex } = event;
        const prev = event["previousParams"];
        if (prev?.rowIndex === rowIndex || event.sourceEvent instanceof KeyboardEvent) {
          return;
        }
        const prevCell = _getCellCtrl(this.beans, prev);
        const isBlock = this.gos.get("invalidEditValueMode") === "block";
        if (isBlock && prevCell && (this.model.getCellValidationModel().getCellValidation(prevCell) || this.model.getRowValidationModel().getRowValidation(prevCell))) {
          return;
        }
        super.onCellFocusChanged(event);
      }
      cleanupEditors(position = {}, includeEditing) {
        super.cleanupEditors(position, includeEditing);
        for (const rowNode of this.startedRows) {
          this.dispatchRowEvent({ rowNode }, "rowEditingStopped");
        }
        this.startedRows.length = 0;
      }
      // returns null if no navigation should be performed
      moveToNextEditingCell(prevCell, backwards, event, source2 = "ui", preventNavigation = false) {
        const prevPos = prevCell.cellPosition;
        let nextCell;
        this.model.suspend(true);
        try {
          nextCell = this.beans.navigation?.findNextCellToFocusOn(prevPos, {
            backwards,
            startEditing: true,
            // Default behaviour for fullRow is skip to the next cell,
            // editable or not. FullRow editing might have some editable
            // and some not editable cells in the row.
            // More complex logic needed to skip to the
            // next FullRow editable cell,
            skipToNextEditableCell: false
          });
        } finally {
          this.model.suspend(false);
        }
        if (nextCell === false) {
          return null;
        }
        if (nextCell == null) {
          return false;
        }
        const nextPos = nextCell.cellPosition;
        const prevEditable = prevCell.isCellEditable();
        const nextEditable = nextCell.isCellEditable();
        const rowsMatch = nextPos && prevPos.rowIndex === nextPos.rowIndex && prevPos.rowPinned === nextPos.rowPinned;
        if (prevEditable) {
          this.setFocusOutOnEditor(prevCell);
        }
        this.restoreEditors();
        const suppressStartEditOnTab = this.gos.get("suppressStartEditOnTab");
        if (nextEditable && !preventNavigation) {
          if (suppressStartEditOnTab) {
            nextCell.focusCell(true, event);
          } else {
            if (!nextCell.comp?.getCellEditor()) {
              _setupEditor(this.beans, nextCell, { event, cellStartedEdit: true });
            }
            this.setFocusInOnEditor(nextCell);
            nextCell.focusCell(false, event);
          }
        } else {
          if (nextEditable && preventNavigation) {
            this.setFocusInOnEditor(nextCell);
          }
          nextCell.focusCell(true, event);
        }
        if (!rowsMatch && !preventNavigation) {
          this.editSvc?.stopEditing({ rowNode: prevCell.rowNode }, { event });
          this.cleanupEditors(nextCell, true);
          if (suppressStartEditOnTab) {
            nextCell.focusCell(true, event);
          } else {
            this.editSvc.startEditing(nextCell, { startedEdit: true, event, source: source2, ignoreEventKey: true });
          }
        }
        prevCell.rowCtrl?.refreshRow({ suppressFlash: true, force: true });
        return true;
      }
      restoreEditors() {
        this.model.getEditMap().forEach(
          (rowEdits, rowNode) => rowEdits.forEach(({ state }, column2) => {
            if (state !== "editing") {
              return;
            }
            const cellCtrl = _getCellCtrl(this.beans, {
              rowNode,
              column: column2
            });
            if (cellCtrl && !cellCtrl.comp?.getCellEditor()) {
              _setupEditor(this.beans, cellCtrl, { silent: true });
            }
          })
        );
      }
      destroy() {
        super.destroy();
        this.rowNode = void 0;
        this.startedRows.length = 0;
      }
    };
    var SingleCellEditStrategy = class extends BaseEditStrategy {
      constructor() {
        super(...arguments);
        this.beanName = "singleCell";
      }
      shouldStop(position, event, source2 = "ui") {
        const res = super.shouldStop(position, event, source2);
        if (res !== null) {
          return res;
        }
        const { rowNode, column: column2 } = position || {};
        if ((!this.rowNode || !this.column) && rowNode && column2) {
          return null;
        }
        return this.rowNode !== rowNode || this.column !== column2;
      }
      midBatchInputsAllowed(position) {
        return this.model.hasEdits(position);
      }
      start(params) {
        const { position, startedEdit, event, ignoreEventKey } = params;
        if (this.rowNode !== position.rowNode || this.column !== position.column) {
          super.cleanupEditors();
        }
        this.rowNode = position.rowNode;
        this.column = position.column;
        this.model.start(position);
        this.setupEditors({ cells: [position], position, startedEdit, event, ignoreEventKey });
      }
      dispatchRowEvent(_position, _type, _silent) {
      }
      processValidationResults(results) {
        const anyFailed = results.fail.length > 0;
        if (anyFailed && this.editSvc.cellEditingInvalidCommitBlocks()) {
          return {
            destroy: [],
            keep: results.all
          };
        }
        return {
          destroy: results.all,
          keep: []
        };
      }
      stop(cancel, event) {
        super.stop(cancel, event);
        this.rowNode = void 0;
        this.column = void 0;
        return true;
      }
      onCellFocusChanged(event) {
        const { colModel, editSvc } = this.beans;
        const { rowIndex, column: column2, rowPinned } = event;
        const rowNode = _getRowNode(this.beans, { rowIndex, rowPinned });
        const curColId = _getColId(column2);
        const curCol = colModel.getCol(curColId);
        const previous = event["previousParams"];
        if (previous) {
          const prevColId = _getColId(previous.column);
          if (previous?.rowIndex === rowIndex && prevColId === curColId && previous?.rowPinned === rowPinned) {
            return;
          }
        }
        if (editSvc?.isEditing({ rowNode, column: curCol }, { withOpenEditor: true }) && event.type === "cellFocused") {
          return;
        }
        super.onCellFocusChanged(event);
      }
      // returns null if no navigation should be performed
      moveToNextEditingCell(prevCell, backwards, event, source2 = "ui", preventNavigation = false) {
        const focusedCell = this.beans.focusSvc.getFocusedCell();
        if (focusedCell) {
          prevCell = _getCellByPosition(this.beans, focusedCell) ?? prevCell;
        }
        const prevPos = prevCell.cellPosition;
        let nextCell;
        const shouldSuspend = this.beans.gos.get("editType") === "fullRow";
        if (shouldSuspend) {
          this.model.suspend(true);
        }
        if (!preventNavigation) {
          prevCell.eGui.focus();
          this.editSvc?.stopEditing(prevCell, { source: this.editSvc?.isBatchEditing() ? "ui" : "api", event });
        }
        try {
          nextCell = this.beans.navigation?.findNextCellToFocusOn(prevPos, {
            backwards,
            startEditing: true
            // Default behaviour for fullRow is skip to the next cell,
            // editable or not. FullRow editing might have some editable
            // and some not editable cells in the row.
            // More complex logic needed to skip to the
            // next FullRow editable cell,
            // skipToNextEditableCell: false,
          });
        } finally {
          if (shouldSuspend) {
            this.model.suspend(false);
          }
        }
        if (nextCell === false) {
          return null;
        }
        if (nextCell == null) {
          return false;
        }
        const nextPos = nextCell.cellPosition;
        const prevEditable = prevCell.isCellEditable();
        const nextEditable = nextCell.isCellEditable();
        const rowsMatch = nextPos && prevPos.rowIndex === nextPos.rowIndex && prevPos.rowPinned === nextPos.rowPinned;
        if (prevEditable && !preventNavigation) {
          this.setFocusOutOnEditor(prevCell);
        }
        const suppressStartEditOnTab = this.gos.get("suppressStartEditOnTab");
        if (!rowsMatch && !preventNavigation) {
          super.cleanupEditors(nextCell, true);
          if (suppressStartEditOnTab) {
            nextCell.focusCell(true, event);
          } else {
            this.editSvc.startEditing(nextCell, { startedEdit: true, event, source: source2, ignoreEventKey: true });
          }
        }
        if (nextEditable && !preventNavigation) {
          nextCell.focusCell(false, event);
          if (suppressStartEditOnTab) {
            nextCell.focusCell(true, event);
          } else if (!nextCell.comp?.getCellEditor()) {
            const alreadyEditing = this.editSvc?.isEditing(nextCell, { withOpenEditor: true });
            _setupEditor(this.beans, nextCell, { event, cellStartedEdit: true, silent: alreadyEditing });
            this.setFocusInOnEditor(nextCell);
            this.cleanupEditors(nextCell);
          }
        } else {
          if (nextEditable && preventNavigation) {
            this.setFocusInOnEditor(nextCell);
          }
          nextCell.focusCell(true, event);
        }
        prevCell.rowCtrl?.refreshRow({ suppressFlash: true, force: true });
        return true;
      }
      destroy() {
        super.destroy();
        this.rowNode = void 0;
        this.column = void 0;
      }
    };
    var EditCoreModule = {
      moduleName: "EditCore",
      version: VERSION,
      beans: [EditModelService, EditService],
      apiFunctions: {
        getEditingCells,
        getEditRowValues,
        getCellEditorInstances,
        startEditingCell,
        stopEditing,
        isEditing,
        validateEdit
      },
      dynamicBeans: {
        singleCell: SingleCellEditStrategy,
        fullRow: FullRowEditStrategy
      },
      dependsOn: [PopupModule, TooltipModule],
      css: [cellEditingCSS]
    };
    var UndoRedoEditModule = {
      moduleName: "UndoRedoEdit",
      version: VERSION,
      beans: [UndoRedoService],
      apiFunctions: {
        undoCellEditing,
        redoCellEditing,
        getCurrentUndoSize,
        getCurrentRedoSize
      },
      dependsOn: [EditCoreModule]
    };
    var TextEditorModule = {
      moduleName: "TextEditor",
      version: VERSION,
      userComponents: { agCellEditor: TextCellEditor, agTextCellEditor: TextCellEditor },
      dependsOn: [EditCoreModule]
    };
    var NumberEditorModule = {
      moduleName: "NumberEditor",
      version: VERSION,
      userComponents: {
        agNumberCellEditor: {
          classImp: NumberCellEditor
        }
      },
      dependsOn: [EditCoreModule]
    };
    var DateEditorModule = {
      moduleName: "DateEditor",
      version: VERSION,
      userComponents: {
        agDateCellEditor: DateCellEditor,
        agDateStringCellEditor: DateStringCellEditor
      },
      dependsOn: [EditCoreModule]
    };
    var CheckboxEditorModule = {
      moduleName: "CheckboxEditor",
      version: VERSION,
      userComponents: {
        agCheckboxCellEditor: CheckboxCellEditor
      },
      dependsOn: [EditCoreModule]
    };
    var SelectEditorModule = {
      moduleName: "SelectEditor",
      version: VERSION,
      userComponents: { agSelectCellEditor: SelectCellEditor },
      dependsOn: [EditCoreModule]
    };
    var LargeTextEditorModule = {
      moduleName: "LargeTextEditor",
      version: VERSION,
      userComponents: { agLargeTextCellEditor: LargeTextCellEditor },
      dependsOn: [EditCoreModule]
    };
    var CustomEditorModule = {
      moduleName: "CustomEditor",
      version: VERSION,
      dependsOn: [EditCoreModule]
    };
    var SelectionColService = class extends BeanStub {
      constructor() {
        super(...arguments);
        this.beanName = "selectionColSvc";
      }
      postConstruct() {
        this.addManagedPropertyListener("rowSelection", (event) => {
          this.onSelectionOptionsChanged(
            event.currentValue,
            event.previousValue,
            _convertColumnEventSourceType(event.source)
          );
        });
        this.addManagedPropertyListener("selectionColumnDef", this.updateColumns.bind(this));
      }
      addColumns(cols) {
        const selectionCols = this.columns;
        if (selectionCols == null) {
          return;
        }
        cols.list = selectionCols.list.concat(cols.list);
        cols.tree = selectionCols.tree.concat(cols.tree);
        _updateColsMap(cols);
      }
      createColumns(cols, updateOrders) {
        const destroyCollection = () => {
          _destroyColumnTree(this.beans, this.columns?.tree);
          this.columns = null;
        };
        const newTreeDepth = cols.treeDepth;
        const oldTreeDepth = this.columns?.treeDepth ?? -1;
        const treeDepthSame = oldTreeDepth == newTreeDepth;
        const list2 = this.generateSelectionCols();
        const areSame = _areColIdsEqual(list2, this.columns?.list ?? []);
        if (areSame && treeDepthSame) {
          return;
        }
        destroyCollection();
        const { colGroupSvc } = this.beans;
        const treeDepth = colGroupSvc?.findDepth(cols.tree) ?? 0;
        const tree = colGroupSvc?.balanceTreeForAutoCols(list2, treeDepth) ?? [];
        this.columns = {
          list: list2,
          tree,
          treeDepth,
          map: {}
        };
        const putSelectionColsFirstInList = (cols2) => {
          if (!cols2) {
            return null;
          }
          const colsFiltered = cols2.filter((col) => !isColumnSelectionCol(col));
          return [...list2, ...colsFiltered];
        };
        updateOrders(putSelectionColsFirstInList);
      }
      updateColumns(event) {
        const source2 = _convertColumnEventSourceType(event.source);
        for (const col of this.columns?.list ?? []) {
          const newColDef = this.createSelectionColDef(event.currentValue);
          col.setColDef(newColDef, null, source2);
          _applyColumnState(this.beans, { state: [{ ...newColDef, colId: col.getColId() }] }, source2);
        }
      }
      getColumn(key2) {
        return this.columns?.list.find((col) => _columnsMatch(col, key2)) ?? null;
      }
      getColumns() {
        return this.columns?.list ?? null;
      }
      isSelectionColumnEnabled() {
        const { gos, beans } = this;
        const rowSelection = gos.get("rowSelection");
        if (typeof rowSelection !== "object" || !_isRowSelection(gos)) {
          return false;
        }
        const hasAutoCols = (beans.autoColSvc?.getColumns()?.length ?? 0) > 0;
        if (rowSelection.checkboxLocation === "autoGroupColumn" && hasAutoCols) {
          return false;
        }
        const checkboxes = !!_getCheckboxes(rowSelection);
        const headerCheckbox = _getHeaderCheckbox(rowSelection);
        return checkboxes || headerCheckbox;
      }
      createSelectionColDef(def) {
        const { gos } = this;
        const selectionColumnDef = def ?? gos.get("selectionColumnDef");
        const enableRTL = gos.get("enableRtl");
        const { rowSpan: _, spanRows: __, ...filteredSelColDef } = selectionColumnDef ?? {};
        return {
          // overridable properties
          width: 50,
          resizable: false,
          suppressHeaderMenuButton: true,
          sortable: false,
          suppressMovable: true,
          lockPosition: enableRTL ? "right" : "left",
          comparator(valueA, valueB, nodeA, nodeB) {
            const aSelected = nodeA.isSelected();
            const bSelected = nodeB.isSelected();
            return aSelected === bSelected ? 0 : aSelected ? 1 : -1;
          },
          editable: false,
          suppressFillHandle: true,
          pinned: null,
          // overrides
          ...filteredSelColDef,
          // non-overridable properties
          colId: SELECTION_COLUMN_ID,
          chartDataType: "excluded"
        };
      }
      generateSelectionCols() {
        if (!this.isSelectionColumnEnabled()) {
          return [];
        }
        const colDef = this.createSelectionColDef();
        const colId = colDef.colId;
        this.gos.validateColDef(colDef, colId, true);
        const col = new AgColumn(colDef, null, colId, false);
        this.createBean(col);
        return [col];
      }
      onSelectionOptionsChanged(current2, prev, source2) {
        const prevCheckbox = prev && typeof prev !== "string" ? _getCheckboxes(prev) : void 0;
        const currCheckbox = current2 && typeof current2 !== "string" ? _getCheckboxes(current2) : void 0;
        const checkboxHasChanged = prevCheckbox !== currCheckbox;
        const prevHeaderCheckbox = prev && typeof prev !== "string" ? _getHeaderCheckbox(prev) : void 0;
        const currHeaderCheckbox = current2 && typeof current2 !== "string" ? _getHeaderCheckbox(current2) : void 0;
        const headerCheckboxHasChanged = prevHeaderCheckbox !== currHeaderCheckbox;
        const currLocation = _getCheckboxLocation(current2);
        const prevLocation = _getCheckboxLocation(prev);
        const locationChanged = currLocation !== prevLocation;
        if (checkboxHasChanged || headerCheckboxHasChanged || locationChanged) {
          this.beans.colModel.refreshAll(source2);
        }
      }
      destroy() {
        _destroyColumnTree(this.beans, this.columns?.tree);
        super.destroy();
      }
      /**
       * Refreshes visibility of the selection column based on which columns are currently visible.
       * Called by the VisibleColsService with the columns that are currently visible in left/center/right
       * containers. This method *MUTATES* those arrays directly.
       *
       * The selection column should be visible if all of the following are true
       * - The selection column is not disabled
       * - The number of visible columns excluding the selection column and row numbers column is greater than 0
       * @param leftCols Visible columns in the left-pinned container
       * @param centerCols Visible columns in the center viewport
       * @param rightCols Visible columns in the right-pinned container
       */
      refreshVisibility(leftCols, centerCols, rightCols) {
        if (!this.columns?.list.length) {
          return;
        }
        const numVisibleCols = leftCols.length + centerCols.length + rightCols.length;
        if (numVisibleCols === 0) {
          return;
        }
        const column2 = this.columns.list[0];
        if (!column2.isVisible()) {
          return;
        }
        const hideSelectionCol = () => {
          let cols;
          switch (column2.pinned) {
            case "left":
            case true:
              cols = leftCols;
              break;
            case "right":
              cols = rightCols;
              break;
            default:
              cols = centerCols;
          }
          cols && _removeFromArray(cols, column2);
        };
        const rowNumbersCol = this.beans.rowNumbersSvc?.getColumn(ROW_NUMBERS_COLUMN_ID);
        const expectedNumCols = rowNumbersCol ? 2 : 1;
        if (expectedNumCols === numVisibleCols) {
          hideSelectionCol();
        }
      }
    };
    function setNodesSelected(beans, params) {
      const allNodesValid = params.nodes.every((node2) => {
        if (node2.rowPinned && !_isManualPinnedRow(node2)) {
          _warn(59);
          return false;
        }
        if (node2.id === void 0) {
          _warn(60);
          return false;
        }
        return true;
      });
      if (!allNodesValid) {
        return;
      }
      const { nodes, source: source2, newValue } = params;
      beans.selectionSvc?.setNodesSelected({ nodes, source: source2 ?? "api", newValue });
    }
    function selectAll$1(beans, selectAll2, source2 = "apiSelectAll") {
      beans.selectionSvc?.selectAllRowNodes({ source: source2, selectAll: selectAll2 });
    }
    function deselectAll(beans, selectAll2, source2 = "apiSelectAll") {
      beans.selectionSvc?.deselectAllRowNodes({ source: source2, selectAll: selectAll2 });
    }
    function selectAllFiltered(beans, source2 = "apiSelectAllFiltered") {
      beans.selectionSvc?.selectAllRowNodes({ source: source2, selectAll: "filtered" });
    }
    function deselectAllFiltered(beans, source2 = "apiSelectAllFiltered") {
      beans.selectionSvc?.deselectAllRowNodes({ source: source2, selectAll: "filtered" });
    }
    function selectAllOnCurrentPage(beans, source2 = "apiSelectAllCurrentPage") {
      beans.selectionSvc?.selectAllRowNodes({ source: source2, selectAll: "currentPage" });
    }
    function deselectAllOnCurrentPage(beans, source2 = "apiSelectAllCurrentPage") {
      beans.selectionSvc?.deselectAllRowNodes({ source: source2, selectAll: "currentPage" });
    }
    function getSelectedNodes(beans) {
      return beans.selectionSvc?.getSelectedNodes() ?? [];
    }
    function getSelectedRows(beans) {
      return beans.selectionSvc?.getSelectedRows() ?? [];
    }
    var SelectionService = class extends BaseSelectionService {
      constructor() {
        super(...arguments);
        this.beanName = "selectionSvc";
        this.selectedNodes = /* @__PURE__ */ new Map();
        this.detailSelection = /* @__PURE__ */ new Map();
        this.masterSelectsDetail = false;
      }
      postConstruct() {
        super.postConstruct();
        const { gos } = this;
        this.mode = _getRowSelectionMode(gos);
        this.groupSelectsDescendants = _getGroupSelectsDescendants(gos);
        this.groupSelectsFiltered = _getGroupSelection(gos) === "filteredDescendants";
        this.masterSelectsDetail = _getMasterSelects(gos) === "detail";
        this.addManagedPropertyListeners(["groupSelectsChildren", "groupSelectsFiltered", "rowSelection"], () => {
          const groupSelectsDescendants = _getGroupSelectsDescendants(gos);
          const selectionMode = _getRowSelectionMode(gos);
          const groupSelectsFiltered = _getGroupSelection(gos) === "filteredDescendants";
          this.masterSelectsDetail = _getMasterSelects(gos) === "detail";
          if (groupSelectsDescendants !== this.groupSelectsDescendants || groupSelectsFiltered !== this.groupSelectsFiltered || selectionMode !== this.mode) {
            this.deselectAllRowNodes({ source: "api" });
            this.groupSelectsDescendants = groupSelectsDescendants;
            this.groupSelectsFiltered = groupSelectsFiltered;
            this.mode = selectionMode;
          }
        });
        this.addManagedEventListeners({ rowSelected: this.onRowSelected.bind(this) });
      }
      destroy() {
        super.destroy();
        this.resetNodes();
      }
      handleSelectionEvent(event, rowNode, source2) {
        if (this.isRowSelectionBlocked(rowNode)) {
          return 0;
        }
        const selection = this.inferNodeSelections(rowNode, event.shiftKey, event.metaKey || event.ctrlKey, source2);
        if (selection == null) {
          return 0;
        }
        this.selectionCtx.selectAll = false;
        if ("select" in selection) {
          if (selection.reset) {
            this.resetNodes();
          } else {
            this.selectRange(selection.deselect, false, source2);
          }
          return this.selectRange(selection.select, true, source2);
        } else {
          const newValue = selection.checkFilteredNodes ? recursiveCanNodesBeSelected(selection.node) : selection.newValue;
          return this.setNodesSelected({
            nodes: [selection.node],
            newValue,
            clearSelection: selection.clearSelection,
            keepDescendants: selection.keepDescendants,
            event,
            source: source2
          });
        }
      }
      setNodesSelected({
        newValue,
        clearSelection,
        suppressFinishActions,
        nodes,
        event,
        source: source2,
        keepDescendants = false
      }) {
        if (nodes.length === 0) {
          return 0;
        }
        const { gos } = this;
        if (!_isRowSelection(gos) && newValue) {
          _warn(132);
          return 0;
        }
        if (nodes.length > 1 && !this.isMultiSelect()) {
          _warn(130);
          return 0;
        }
        let updatedCount = 0;
        for (let i2 = 0; i2 < nodes.length; i2++) {
          const rowNode = nodes[i2];
          const node2 = _normaliseSiblingRef(rowNode);
          if (node2.rowPinned && !_isManualPinnedRow(node2)) {
            _warn(59);
            continue;
          }
          if (node2.id === void 0) {
            _warn(60);
            continue;
          }
          const skipThisNode2 = this.groupSelectsFiltered && node2.group && !gos.get("treeData");
          if (!skipThisNode2) {
            const thisNodeWasSelected = this.selectRowNode(node2, newValue, event, source2);
            if (thisNodeWasSelected) {
              this.detailSelection.delete(node2.id);
              updatedCount++;
            }
          }
          if (this.groupSelectsDescendants && node2.childrenAfterGroup?.length) {
            updatedCount += this.selectChildren(node2, newValue, source2);
          }
        }
        if (!suppressFinishActions) {
          if (nodes.length === 1 && source2 === "api") {
            this.selectionCtx.setRoot(_normaliseSiblingRef(nodes[0]));
          }
          const clearOtherNodes = newValue && (clearSelection || !this.isMultiSelect());
          if (clearOtherNodes) {
            updatedCount += this.clearOtherNodes(_normaliseSiblingRef(nodes[0]), keepDescendants, source2);
          }
          if (updatedCount > 0) {
            this.updateGroupsFromChildrenSelections(source2);
            this.dispatchSelectionChanged(source2);
          }
        }
        return updatedCount;
      }
      // not to be mixed up with 'cell range selection' where you drag the mouse, this is row range selection, by
      // holding down 'shift'.
      selectRange(nodesToSelect, value2, source2) {
        let updatedCount = 0;
        nodesToSelect.forEach((node2) => {
          const rowNode = _normaliseSiblingRef(node2);
          if (rowNode.group && this.groupSelectsDescendants) {
            return;
          }
          const nodeWasSelected = this.selectRowNode(rowNode, value2, void 0, source2);
          if (nodeWasSelected) {
            updatedCount++;
          }
        });
        if (updatedCount > 0) {
          this.updateGroupsFromChildrenSelections(source2);
          this.dispatchSelectionChanged(source2);
        }
        return updatedCount;
      }
      selectChildren(node2, newValue, source2) {
        const children2 = this.groupSelectsFiltered ? node2.childrenAfterAggFilter : node2.childrenAfterGroup;
        if (!children2) {
          return 0;
        }
        return this.setNodesSelected({
          newValue,
          clearSelection: false,
          suppressFinishActions: true,
          source: source2,
          nodes: children2
        });
      }
      getSelectedNodes() {
        return Array.from(this.selectedNodes.values());
      }
      getSelectedRows() {
        const selectedRows = [];
        this.selectedNodes.forEach((rowNode) => rowNode.data && selectedRows.push(rowNode.data));
        return selectedRows;
      }
      getSelectionCount() {
        return this.selectedNodes.size;
      }
      /**
       * This method is used by the CSRM to remove groups which are being disposed of,
       * events do not need fired in this case
       */
      filterFromSelection(predicate) {
        const newSelectedNodes = /* @__PURE__ */ new Map();
        this.selectedNodes.forEach((rowNode, key2) => {
          if (predicate(rowNode)) {
            newSelectedNodes.set(key2, rowNode);
          }
        });
        this.selectedNodes = newSelectedNodes;
      }
      updateGroupsFromChildrenSelections(source2, changedPath) {
        if (!this.groupSelectsDescendants) {
          return false;
        }
        const { gos, rowModel } = this.beans;
        if (!_isClientSideRowModel(gos)) {
          return false;
        }
        const rootNode = rowModel.rootNode;
        if (!rootNode) {
          return false;
        }
        if (!changedPath) {
          changedPath = new ChangedPath(true, rootNode);
          changedPath.active = false;
        }
        let selectionChanged = false;
        changedPath.forEachChangedNodeDepthFirst((rowNode) => {
          if (rowNode !== rootNode) {
            const selected2 = this.calculateSelectedFromChildren(rowNode);
            selectionChanged = this.selectRowNode(rowNode, selected2 === null ? false : selected2, void 0, source2) || selectionChanged;
          }
        });
        return selectionChanged;
      }
      clearOtherNodes(rowNodeToKeepSelected, keepDescendants, source2) {
        const groupsToRefresh = /* @__PURE__ */ new Map();
        let updatedCount = 0;
        this.selectedNodes.forEach((otherRowNode) => {
          const isNodeToKeep = otherRowNode.id == rowNodeToKeepSelected.id;
          const shouldClearDescendant = keepDescendants ? !isDescendantOf(rowNodeToKeepSelected, otherRowNode) : true;
          if (shouldClearDescendant && !isNodeToKeep) {
            const rowNode = this.selectedNodes.get(otherRowNode.id);
            updatedCount += this.setNodesSelected({
              nodes: [rowNode],
              newValue: false,
              clearSelection: false,
              suppressFinishActions: true,
              source: source2
            });
            if (this.groupSelectsDescendants && otherRowNode.parent) {
              groupsToRefresh.set(otherRowNode.parent.id, otherRowNode.parent);
            }
          }
        });
        groupsToRefresh.forEach((group) => {
          const selected2 = this.calculateSelectedFromChildren(group);
          this.selectRowNode(group, selected2 === null ? false : selected2, void 0, source2);
        });
        return updatedCount;
      }
      onRowSelected(event) {
        const rowNode = event.node;
        if (this.groupSelectsDescendants && rowNode.group) {
          return;
        }
        if (rowNode.isSelected()) {
          this.selectedNodes.set(rowNode.id, rowNode);
        } else {
          this.selectedNodes.delete(rowNode.id);
        }
      }
      syncInRowNode(rowNode, oldNode) {
        this.syncInOldRowNode(rowNode, oldNode);
        this.syncInNewRowNode(rowNode);
      }
      createDaemonNode(rowNode) {
        if (!rowNode.id) {
          return void 0;
        }
        const oldNode = new RowNode(this.beans);
        oldNode.id = rowNode.id;
        oldNode.data = rowNode.data;
        oldNode.__selected = rowNode.__selected;
        oldNode.level = rowNode.level;
        return oldNode;
      }
      // if the id has changed for the node, then this means the rowNode
      // is getting used for a different data item, which breaks
      // our selectedNodes, as the node now is mapped by the old id
      // which is inconsistent. so to keep the old node as selected,
      // we swap in the clone (with the old id and old data). this means
      // the oldNode is effectively a daemon we keep a reference to,
      // so if client calls api.getSelectedNodes(), it gets the daemon
      // in the result. when the client un-selects, the reference to the
      // daemon is removed. the daemon, because it's an oldNode, is not
      // used by the grid for rendering, it's a copy of what the node used
      // to be like before the id was changed.
      syncInOldRowNode(rowNode, oldNode) {
        if (oldNode && rowNode.id !== oldNode.id) {
          const oldNodeSelected = this.selectedNodes.get(oldNode.id) == rowNode;
          if (oldNodeSelected) {
            this.selectedNodes.set(oldNode.id, oldNode);
          }
        }
      }
      syncInNewRowNode(rowNode) {
        if (this.selectedNodes.has(rowNode.id)) {
          rowNode.__selected = true;
          this.selectedNodes.set(rowNode.id, rowNode);
        } else {
          rowNode.__selected = false;
        }
      }
      reset(source2) {
        const selectionCount = this.getSelectionCount();
        this.resetNodes();
        if (selectionCount) {
          this.dispatchSelectionChanged(source2);
        }
      }
      resetNodes() {
        this.selectedNodes.forEach((node2) => {
          this.selectRowNode(node2, false);
        });
        this.selectedNodes.clear();
      }
      // returns a list of all nodes at 'best cost' - a feature to be used
      // with groups / trees. if a group has all it's children selected,
      // then the group appears in the result, but not the children.
      // Designed for use with 'children' as the group selection type,
      // where groups don't actually appear in the selection normally.
      getBestCostNodeSelection() {
        const { gos, rowModel } = this.beans;
        if (!_isClientSideRowModel(gos)) {
          return;
        }
        const topLevelNodes = rowModel.getTopLevelNodes();
        if (topLevelNodes === null) {
          return;
        }
        const result2 = [];
        function traverse(nodes) {
          for (let i2 = 0, l = nodes.length; i2 < l; i2++) {
            const node2 = nodes[i2];
            if (node2.isSelected()) {
              result2.push(node2);
            } else if (node2.group && node2.childrenAfterGroup) {
              traverse(node2.childrenAfterGroup);
            }
          }
        }
        traverse(topLevelNodes);
        return result2;
      }
      isEmpty() {
        return this.getSelectionCount() === 0;
      }
      deselectAllRowNodes({ source: source2, selectAll: selectAll2 }) {
        const rowModelClientSide = _isClientSideRowModel(this.gos);
        let updatedNodes = false;
        const callback = (rowNode) => {
          const updated = this.selectRowNode(_normaliseSiblingRef(rowNode), false, void 0, source2);
          updatedNodes || (updatedNodes = updated);
        };
        if (selectAll2 === "currentPage" || selectAll2 === "filtered") {
          if (!rowModelClientSide) {
            _error(102);
            return;
          }
          this.getNodesToSelect(selectAll2).forEach(callback);
        } else {
          this.selectedNodes.forEach(callback);
          this.reset(source2);
        }
        this.selectionCtx.selectAll = false;
        if (rowModelClientSide && this.groupSelectsDescendants) {
          const updated = this.updateGroupsFromChildrenSelections(source2);
          updatedNodes || (updatedNodes = updated);
        }
        if (updatedNodes) {
          this.dispatchSelectionChanged(source2);
        }
      }
      getSelectedCounts(selectAll2) {
        let selectedCount = 0;
        let notSelectedCount = 0;
        this.getNodesToSelect(selectAll2).forEach((node2) => {
          if (this.groupSelectsDescendants && node2.group) {
            return;
          }
          if (node2.isSelected()) {
            selectedCount++;
          } else if (node2.selectable) {
            notSelectedCount++;
          }
        });
        return { selectedCount, notSelectedCount };
      }
      getSelectAllState(selectAll2) {
        const { selectedCount, notSelectedCount } = this.getSelectedCounts(selectAll2);
        return _calculateSelectAllState(selectedCount, notSelectedCount) ?? null;
      }
      hasNodesToSelect(selectAll2) {
        return this.getNodesToSelect(selectAll2).filter((node2) => node2.selectable).length > 0;
      }
      /**
       * @param selectAll See `MultiRowSelectionOptions.selectAll`
       * @returns all nodes including unselectable nodes which are the target of this selection attempt
       */
      getNodesToSelect(selectAll2) {
        if (!this.canSelectAll()) {
          return [];
        }
        const nodes = [];
        const addToResult = (node2) => nodes.push(node2);
        if (selectAll2 === "currentPage") {
          this.forEachNodeOnPage((node2) => {
            if (!node2.group) {
              addToResult(node2);
              return;
            }
            if (!node2.expanded && !node2.footer) {
              const recursivelyAddChildren = (child) => {
                addToResult(child);
                child.childrenAfterFilter?.forEach(recursivelyAddChildren);
              };
              recursivelyAddChildren(node2);
              return;
            }
            if (!this.groupSelectsDescendants) {
              addToResult(node2);
            }
          });
          return nodes;
        }
        const clientSideRowModel = this.beans.rowModel;
        if (selectAll2 === "filtered") {
          clientSideRowModel.forEachNodeAfterFilter(addToResult);
          return nodes;
        }
        clientSideRowModel.forEachNode(addToResult);
        return nodes;
      }
      forEachNodeOnPage(callback) {
        const { pageBounds, rowModel } = this.beans;
        const firstRow = pageBounds.getFirstRow();
        const lastRow = pageBounds.getLastRow();
        for (let i2 = firstRow; i2 <= lastRow; i2++) {
          const node2 = rowModel.getRow(i2);
          if (node2) {
            callback(node2);
          }
        }
      }
      selectAllRowNodes(params) {
        const { gos, selectionCtx } = this;
        if (!_isRowSelection(gos)) {
          _warn(132);
          return;
        }
        if (_isUsingNewRowSelectionAPI(gos) && !_isMultiRowSelection(gos)) {
          _warn(130);
          return;
        }
        if (!this.canSelectAll()) {
          return;
        }
        const { source: source2, selectAll: selectAll2 } = params;
        let updatedNodes = false;
        this.getNodesToSelect(selectAll2).forEach((rowNode) => {
          const updated = this.selectRowNode(_normaliseSiblingRef(rowNode), true, void 0, source2);
          updatedNodes || (updatedNodes = updated);
        });
        selectionCtx.selectAll = true;
        if (_isClientSideRowModel(gos) && this.groupSelectsDescendants) {
          const updated = this.updateGroupsFromChildrenSelections(source2);
          updatedNodes || (updatedNodes = updated);
        }
        if (updatedNodes) {
          this.dispatchSelectionChanged(source2);
        }
      }
      getSelectionState() {
        return this.isEmpty() ? null : Array.from(this.selectedNodes.keys());
      }
      setSelectionState(state, source2, clearSelection) {
        if (!state) {
          state = [];
        }
        if (!Array.isArray(state)) {
          _error(103);
          return;
        }
        const rowIds = new Set(state);
        const nodes = [];
        this.beans.rowModel.forEachNode((node2) => {
          if (rowIds.has(node2.id)) {
            nodes.push(node2);
          }
        });
        if (clearSelection) {
          this.resetNodes();
        }
        this.setNodesSelected({
          newValue: true,
          nodes,
          source: source2
        });
      }
      canSelectAll() {
        return _isClientSideRowModel(this.beans.gos);
      }
      /**
       * Updates the selectable state for a node by invoking isRowSelectable callback.
       * If the node is not selectable, it will be deselected.
       *
       * Callers:
       *  - property isRowSelectable changed
       *  - after grouping / treeData via `updateSelectableAfterGrouping`
       */
      updateSelectable(changedPath) {
        const { gos, rowModel } = this.beans;
        if (!_isRowSelection(gos)) {
          return;
        }
        const source2 = "selectableChanged";
        const skipLeafNodes = changedPath !== void 0;
        const isCSRMGroupSelectsDescendants = _isClientSideRowModel(gos) && this.groupSelectsDescendants;
        const nodesToDeselect = [];
        const nodeCallback = (node2) => {
          if (skipLeafNodes && !node2.group) {
            return;
          }
          if (isCSRMGroupSelectsDescendants && node2.group) {
            const hasSelectableChild = node2.childrenAfterGroup?.some((rowNode) => rowNode.selectable) ?? false;
            this.setRowSelectable(node2, hasSelectableChild, true);
            return;
          }
          const rowSelectable = this.updateRowSelectable(node2, true);
          if (!rowSelectable && node2.isSelected()) {
            nodesToDeselect.push(node2);
          }
        };
        if (isCSRMGroupSelectsDescendants) {
          if (changedPath === void 0) {
            const rootNode = rowModel.rootNode;
            changedPath = rootNode ? new ChangedPath(false, rootNode) : void 0;
          }
          changedPath?.forEachChangedNodeDepthFirst(nodeCallback, !skipLeafNodes, !skipLeafNodes);
        } else {
          rowModel.forEachNode(nodeCallback);
        }
        if (nodesToDeselect.length) {
          this.setNodesSelected({
            nodes: nodesToDeselect,
            newValue: false,
            source: source2
          });
        }
        if (!skipLeafNodes && isCSRMGroupSelectsDescendants) {
          this.updateGroupsFromChildrenSelections?.(source2);
        }
      }
      // only called by CSRM
      updateSelectableAfterGrouping(changedPath) {
        this.updateSelectable(changedPath);
        if (this.groupSelectsDescendants) {
          const selectionChanged = this.updateGroupsFromChildrenSelections?.("rowGroupChanged", changedPath);
          if (selectionChanged) {
            this.dispatchSelectionChanged("rowGroupChanged");
          }
        }
      }
      refreshMasterNodeState(node2, e) {
        if (!this.masterSelectsDetail) {
          return;
        }
        const detailApi = node2.detailNode?.detailGridInfo?.api;
        if (!detailApi) {
          return;
        }
        const isSelectAll = _isAllSelected(detailApi);
        const current2 = node2.isSelected();
        if (current2 !== isSelectAll) {
          const selectionChanged = this.selectRowNode(node2, isSelectAll, e, "masterDetail");
          if (selectionChanged) {
            this.dispatchSelectionChanged("masterDetail");
          }
        }
        if (!isSelectAll) {
          const detailSelected = this.detailSelection.get(node2.id) ?? /* @__PURE__ */ new Set();
          for (const n of detailApi.getSelectedNodes()) {
            detailSelected.add(n.id);
          }
          this.detailSelection.set(node2.id, detailSelected);
        }
      }
      setDetailSelectionState(masterNode, detailGridOptions, detailApi) {
        if (!this.masterSelectsDetail) {
          return;
        }
        if (!_isMultiRowSelection(detailGridOptions)) {
          _warn(269);
          return;
        }
        switch (masterNode.isSelected()) {
          case true: {
            detailApi.selectAll();
            break;
          }
          case false: {
            detailApi.deselectAll();
            break;
          }
          case void 0: {
            const selectedIds = this.detailSelection.get(masterNode.id);
            if (selectedIds) {
              const nodes = [];
              for (const id of selectedIds) {
                const n = detailApi.getRowNode(id);
                if (n) {
                  nodes.push(n);
                }
              }
              detailApi.setNodesSelected({ nodes, newValue: true, source: "masterDetail" });
            }
            break;
          }
        }
      }
      dispatchSelectionChanged(source2) {
        this.eventSvc.dispatchEvent({
          type: "selectionChanged",
          source: source2,
          selectedNodes: this.getSelectedNodes(),
          serverSideState: null
        });
      }
    };
    function _normaliseSiblingRef(node2) {
      return _isManualPinnedRow(node2) ? node2.pinnedSibling : node2.footer ? node2.sibling : node2;
    }
    function _isAllSelected(api2) {
      let selectedCount = 0;
      let notSelectedCount = 0;
      api2.forEachNode((node2) => {
        if (node2.isSelected()) {
          selectedCount++;
        } else if (node2.selectable) {
          notSelectedCount++;
        }
      });
      return _calculateSelectAllState(selectedCount, notSelectedCount);
    }
    function _calculateSelectAllState(selected2, notSelected) {
      if (selected2 === 0 && notSelected === 0) {
        return false;
      }
      if (selected2 > 0 && notSelected > 0) {
        return;
      }
      return selected2 > 0;
    }
    function isDescendantOf(root2, child) {
      let parent = child.parent;
      while (parent) {
        if (parent === root2) {
          return true;
        }
        parent = parent.parent;
      }
      return false;
    }
    function recursiveCanNodesBeSelected(root2) {
      const rootCanBeSelected = root2.isSelected() === false;
      const childrenCanBeSelected = root2.childrenAfterFilter?.some(recursiveCanNodesBeSelected) ?? false;
      return rootCanBeSelected || childrenCanBeSelected;
    }
    var SharedRowSelectionModule = {
      moduleName: "SharedRowSelection",
      version: VERSION,
      beans: [SelectionColService],
      apiFunctions: {
        setNodesSelected,
        selectAll: selectAll$1,
        deselectAll,
        selectAllFiltered,
        deselectAllFiltered,
        selectAllOnCurrentPage,
        deselectAllOnCurrentPage,
        getSelectedNodes,
        getSelectedRows
      }
    };
    var RowSelectionModule = {
      moduleName: "RowSelection",
      version: VERSION,
      rowModels: ["clientSide", "infinite", "viewport"],
      beans: [SelectionService],
      dependsOn: [SharedRowSelectionModule]
    };
    function expandAll(beans) {
      beans.expansionSvc?.expandAll(true);
    }
    function collapseAll(beans) {
      beans.expansionSvc?.expandAll(false);
    }
    function onRowHeightChanged(beans) {
      beans.rowModel?.onRowHeightChanged();
    }
    function resetRowHeights(beans) {
      if (beans.rowAutoHeight?.active) {
        _warn(3);
        return;
      }
      beans.rowModel?.resetRowHeights();
    }
    function setRowCount(beans, rowCount, maxRowFound) {
      const serverSideRowModel = _getServerSideRowModel(beans);
      if (serverSideRowModel) {
        if (beans.rowGroupColsSvc?.columns.length === 0) {
          if (rowCount < 0) {
            _error(238);
            return;
          }
          serverSideRowModel.setRowCount(rowCount, maxRowFound);
          return;
        }
        _error(28);
        return;
      }
      _getInfiniteRowModel(beans)?.setRowCount(rowCount, maxRowFound);
    }
    function getCacheBlockState(beans) {
      if (_isServerSideRowModel(beans.gos)) {
        const ssrm = beans.rowModel;
        return ssrm.getBlockStates();
      }
      return beans.rowNodeBlockLoader?.getBlockState() ?? {};
    }
    function isLastRowIndexKnown(beans) {
      return beans.rowModel.isLastRowIndexKnown();
    }
    var CsrmSsrmSharedApiModule = {
      moduleName: "CsrmSsrmSharedApi",
      version: VERSION,
      apiFunctions: { expandAll, collapseAll }
    };
    var RowModelSharedApiModule = {
      moduleName: "RowModelSharedApi",
      version: VERSION,
      apiFunctions: { onRowHeightChanged, resetRowHeights }
    };
    var SsrmInfiniteSharedApiModule = {
      moduleName: "SsrmInfiniteSharedApi",
      version: VERSION,
      apiFunctions: {
        setRowCount,
        getCacheBlockState,
        isLastRowIndexKnown
      }
    };
    var AlignedGridsService = class extends BeanStub {
      constructor() {
        super(...arguments);
        this.beanName = "alignedGridsSvc";
        this.consuming = false;
      }
      getAlignedGridApis() {
        let alignedGrids = this.gos.get("alignedGrids") ?? [];
        const isCallbackConfig = typeof alignedGrids === "function";
        if (typeof alignedGrids === "function") {
          alignedGrids = alignedGrids();
        }
        const apis = alignedGrids.map((alignedGrid) => {
          if (!alignedGrid) {
            _error(18);
            if (!isCallbackConfig) {
              _error(20);
            }
            return;
          }
          if (this.isGridApi(alignedGrid)) {
            return alignedGrid;
          }
          const refOrComp = alignedGrid;
          if ("current" in refOrComp) {
            return refOrComp.current?.api;
          }
          if (!refOrComp.api) {
            _error(19);
          }
          return refOrComp.api;
        }).filter((api2) => !!api2 && !api2.isDestroyed());
        return apis;
      }
      isGridApi(ref) {
        return !!ref && !!ref.dispatchEvent;
      }
      postConstruct() {
        const fireColumnEvent = this.fireColumnEvent.bind(this);
        this.addManagedEventListeners({
          columnMoved: fireColumnEvent,
          columnVisible: fireColumnEvent,
          columnPinned: fireColumnEvent,
          columnGroupOpened: fireColumnEvent,
          columnResized: fireColumnEvent,
          bodyScroll: this.fireScrollEvent.bind(this),
          alignedGridColumn: ({ event }) => this.onColumnEvent(event),
          alignedGridScroll: ({ event }) => this.onScrollEvent(event)
        });
      }
      // common logic across all the fire methods
      fireEvent(event) {
        if (this.consuming) {
          return;
        }
        for (const api2 of this.getAlignedGridApis()) {
          if (api2.isDestroyed()) {
            continue;
          }
          api2.dispatchEvent(event);
        }
      }
      // common logic across all consume methods. very little common logic, however extracting
      // guarantees consistency across the methods.
      onEvent(callback) {
        this.consuming = true;
        callback();
        this.consuming = false;
      }
      fireColumnEvent(columnEvent) {
        this.fireEvent({
          type: "alignedGridColumn",
          event: columnEvent
        });
      }
      fireScrollEvent(scrollEvent) {
        if (scrollEvent.direction !== "horizontal") {
          return;
        }
        this.fireEvent({
          type: "alignedGridScroll",
          event: scrollEvent
        });
      }
      onScrollEvent(event) {
        this.onEvent(() => {
          this.beans.ctrlsSvc.getScrollFeature().setHorizontalScrollPosition(event.left, true);
        });
      }
      extractDataFromEvent(event, func) {
        const result2 = [];
        if (event.columns) {
          event.columns.forEach((column2) => {
            result2.push(func(column2));
          });
        } else if (event.column) {
          result2.push(func(event.column));
        }
        return result2;
      }
      getMasterColumns(event) {
        return this.extractDataFromEvent(event, (col) => col);
      }
      getColumnIds(event) {
        return this.extractDataFromEvent(event, (col) => col.getColId());
      }
      onColumnEvent(event) {
        this.onEvent(() => {
          switch (event.type) {
            case "columnMoved":
            case "columnVisible":
            case "columnPinned":
            case "columnResized": {
              this.processColumnEvent(event);
              break;
            }
            case "columnGroupOpened": {
              this.processGroupOpenedEvent(event);
              break;
            }
            case "columnPivotChanged":
              _warn(21);
              break;
          }
        });
      }
      processGroupOpenedEvent(groupOpenedEvent) {
        const { colGroupSvc } = this.beans;
        if (!colGroupSvc) {
          return;
        }
        for (const masterGroup of groupOpenedEvent.columnGroups) {
          let otherColumnGroup = null;
          if (masterGroup) {
            otherColumnGroup = colGroupSvc.getProvidedColGroup(masterGroup.getGroupId());
          }
          if (masterGroup && !otherColumnGroup) {
            continue;
          }
          colGroupSvc.setColumnGroupOpened(otherColumnGroup, masterGroup.isExpanded(), "alignedGridChanged");
        }
      }
      processColumnEvent(colEvent) {
        const masterColumn = colEvent.column;
        let otherColumn = null;
        const beans = this.beans;
        const { colResize, ctrlsSvc, colModel } = beans;
        if (masterColumn) {
          otherColumn = colModel.getColDefCol(masterColumn.getColId());
        }
        if (masterColumn && !otherColumn) {
          return;
        }
        const masterColumns = this.getMasterColumns(colEvent);
        switch (colEvent.type) {
          case "columnMoved":
            {
              const srcColState = colEvent.api.getColumnState();
              const destColState = srcColState.map((s) => ({ colId: s.colId }));
              _applyColumnState(beans, { state: destColState, applyOrder: true }, "alignedGridChanged");
            }
            break;
          case "columnVisible":
            {
              const srcColState = colEvent.api.getColumnState();
              const destColState = srcColState.map((s) => ({ colId: s.colId, hide: s.hide }));
              _applyColumnState(beans, { state: destColState }, "alignedGridChanged");
            }
            break;
          case "columnPinned":
            {
              const srcColState = colEvent.api.getColumnState();
              const destColState = srcColState.map((s) => ({ colId: s.colId, pinned: s.pinned }));
              _applyColumnState(beans, { state: destColState }, "alignedGridChanged");
            }
            break;
          case "columnResized": {
            const resizedEvent = colEvent;
            const columnWidths = {};
            for (const column2 of masterColumns) {
              columnWidths[column2.getId()] = { key: column2.getColId(), newWidth: column2.getActualWidth() };
            }
            for (const col of resizedEvent.flexColumns ?? []) {
              if (columnWidths[col.getId()]) {
                delete columnWidths[col.getId()];
              }
            }
            colResize?.setColumnWidths(
              Object.values(columnWidths),
              false,
              resizedEvent.finished,
              "alignedGridChanged"
            );
            break;
          }
        }
        const gridBodyCon = ctrlsSvc.getGridBodyCtrl();
        const isVerticalScrollShowing = gridBodyCon.isVerticalScrollShowing();
        for (const api2 of this.getAlignedGridApis()) {
          api2.setGridOption("alwaysShowVerticalScroll", isVerticalScrollShowing);
        }
      }
    };
    var AlignedGridsModule = {
      moduleName: "AlignedGrids",
      version: VERSION,
      beans: [AlignedGridsService],
      dependsOn: [ColumnApiModule]
    };
    var ClientSideNodeManager = class extends BeanStub {
      constructor(rootNode) {
        super();
        this.rootNode = rootNode;
        this.nextId = 0;
        this.allNodesMap = {};
        initRootNode(rootNode);
      }
      getRowNode(id) {
        return this.allNodesMap[id];
      }
      setNewRowData(rowData) {
        const { selectionSvc, pinnedRowModel, groupStage } = this.beans;
        selectionSvc?.reset("rowDataChanged");
        if (pinnedRowModel?.isManual()) {
          pinnedRowModel.reset();
        }
        this.dispatchRowDataUpdateStarted(rowData);
        this.allNodesMap = /* @__PURE__ */ Object.create(null);
        this.nextId = 0;
        const rootNode = initRootNode(this.rootNode);
        const allLeafs = new Array(rowData.length);
        rootNode._leafs = allLeafs;
        let writeIdx = 0;
        const nestedDataGetter = groupStage?.getNestedDataGetter();
        const processedNested = nestedDataGetter ? /* @__PURE__ */ new Set() : null;
        const processChildren = (parent, childrenData) => {
          const level = parent.level + 1;
          for (let i2 = 0, len = childrenData.length; i2 < len; ++i2) {
            const data = childrenData[i2];
            if (!data) {
              continue;
            }
            const node2 = this.createRowNode(data, level);
            node2.sourceRowIndex = writeIdx;
            allLeafs[writeIdx++] = node2;
            if (processedNested && !processedNested.has(data)) {
              processedNested.add(data);
              node2.treeParent = parent;
              const children2 = nestedDataGetter(data);
              if (children2) {
                processChildren(node2, children2);
              }
            }
          }
        };
        processChildren(rootNode, rowData);
        allLeafs.length = writeIdx;
      }
      setImmutableRowData(params, rowData) {
        const { rootNode, gos } = this;
        this.dispatchRowDataUpdateStarted(rowData);
        const getRowIdFunc = _getRowIdCallback(gos);
        const changedRowNodes = params.changedRowNodes;
        const { adds, updates } = changedRowNodes;
        const processedNodes = /* @__PURE__ */ new Set();
        const nodesToUnselect = [];
        const nestedDataGetter = this.beans.groupStage?.getNestedDataGetter();
        let reorder = gos.get("suppressMaintainUnsortedOrder") ? void 0 : false;
        let prevIndex = -1;
        let treeUpdated = false;
        const updateNode = (node2, data) => {
          if (!reorder && reorder !== void 0) {
            const oldIndex = node2.sourceRowIndex;
            reorder = oldIndex <= prevIndex;
            prevIndex = oldIndex;
          }
          if (node2.data !== data) {
            node2.updateData(data);
            if (!adds.has(node2)) {
              updates.add(node2);
            }
            if (!node2.selectable && node2.isSelected()) {
              nodesToUnselect.push(node2);
            }
          }
        };
        const processChildren = (parent, childrenData, level) => {
          for (let i2 = 0, len = childrenData.length; i2 < len; ++i2) {
            const data = childrenData[i2];
            if (!data) {
              continue;
            }
            let node2 = this.getRowNode(getRowIdFunc({ data, level }));
            if (node2) {
              updateNode(node2, data);
              treeUpdated || (treeUpdated = !!nestedDataGetter && node2.treeParent !== parent);
            } else {
              node2 = this.createRowNode(data, level);
              adds.add(node2);
            }
            if (!nestedDataGetter || processedNodes.has(node2)) {
              processedNodes.add(node2);
              continue;
            }
            processedNodes.add(node2);
            node2.treeParent = parent;
            const children2 = nestedDataGetter(data);
            if (children2) {
              processChildren(node2, children2, level + 1);
            }
          }
        };
        processChildren(rootNode, rowData, 0);
        const changed = this.deleteUnusedNodes(processedNodes, changedRowNodes, nodesToUnselect) || reorder || adds.size > 0;
        if (changed) {
          const allLeafs = rootNode._leafs ?? (rootNode._leafs = []);
          if (reorder === void 0) {
            updateRootLeafsKeepOrder(allLeafs, processedNodes, changedRowNodes);
          } else if (updateRootLeafsOrdered(allLeafs, processedNodes)) {
            changedRowNodes.reordered = true;
          }
        }
        if (changed || treeUpdated || updates.size) {
          params.rowDataUpdated = true;
          this.deselect(nodesToUnselect);
        }
      }
      deleteUnusedNodes(processedNodes, { removals }, nodesToUnselect) {
        const allLeafs = this.rootNode._leafs;
        for (let i2 = 0, len = allLeafs.length; i2 < len; i2++) {
          const node2 = allLeafs[i2];
          if (!processedNodes.has(node2)) {
            removals.add(node2);
            if (node2.isSelected()) {
              nodesToUnselect.push(node2);
            }
            this.deleteNode(node2);
          }
        }
        return removals.size > 0;
      }
      updateRowData(rowDataTran, changedRowNodes) {
        this.dispatchRowDataUpdateStarted(rowDataTran.add);
        if (this.beans.groupStage?.getNestedDataGetter()) {
          _warn(268);
          return { remove: [], update: [], add: [] };
        }
        const nodesToUnselect = [];
        const getRowIdFunc = _getRowIdCallback(this.gos);
        const remove2 = this.executeRemove(getRowIdFunc, rowDataTran, changedRowNodes, nodesToUnselect);
        const update = this.executeUpdate(getRowIdFunc, rowDataTran, changedRowNodes, nodesToUnselect);
        const add2 = this.executeAdd(rowDataTran, changedRowNodes);
        this.deselect(nodesToUnselect);
        return { remove: remove2, update, add: add2 };
      }
      executeRemove(getRowIdFunc, { remove: remove2 }, { adds, updates, removals }, nodesToUnselect) {
        const allLeafs = this.rootNode._leafs;
        const allLeafsLen = allLeafs?.length;
        const removeLen = remove2?.length;
        if (!removeLen || !allLeafsLen) {
          return [];
        }
        let removeCount = 0;
        let filterIdx = allLeafsLen;
        let filterEndIdx = 0;
        let nodesNeverAdded;
        const removedResult = new Array(removeLen);
        for (let i2 = 0; i2 < removeLen; ++i2) {
          const rowNode = this.lookupNode(getRowIdFunc, remove2[i2]);
          if (!rowNode) {
            continue;
          }
          const sourceRowIndex = rowNode.sourceRowIndex;
          if (sourceRowIndex < filterIdx) {
            filterIdx = sourceRowIndex;
          }
          if (sourceRowIndex > filterEndIdx) {
            filterEndIdx = sourceRowIndex;
          }
          if (rowNode.isSelected()) {
            nodesToUnselect.push(rowNode);
          }
          this.deleteNode(rowNode);
          if (adds.delete(rowNode)) {
            nodesNeverAdded ?? (nodesNeverAdded = /* @__PURE__ */ new Set());
            nodesNeverAdded.add(rowNode);
          } else {
            updates.delete(rowNode);
            removals.add(rowNode);
          }
          removedResult[removeCount++] = rowNode;
        }
        removedResult.length = removeCount;
        if (removeCount) {
          filterRemovedRowNodes(allLeafs, filterIdx, filterEndIdx, removals, nodesNeverAdded);
        }
        return removedResult;
      }
      executeUpdate(getRowIdFunc, { update }, { adds, updates }, nodesToUnselect) {
        const updateLen = update?.length;
        if (!updateLen) {
          return [];
        }
        const updateResult = new Array(updateLen);
        let writeIdx = 0;
        for (let i2 = 0; i2 < updateLen; i2++) {
          const item2 = update[i2];
          const rowNode = this.lookupNode(getRowIdFunc, item2);
          if (rowNode) {
            rowNode.updateData(item2);
            if (!rowNode.selectable && rowNode.isSelected()) {
              nodesToUnselect.push(rowNode);
            }
            updateResult[writeIdx++] = rowNode;
            if (!adds.has(rowNode)) {
              updates.add(rowNode);
            }
          }
        }
        updateResult.length = writeIdx;
        return updateResult;
      }
      executeAdd(rowDataTran, changedRowNodes) {
        var _a2;
        const allLeafs = (_a2 = this.rootNode)._leafs ?? (_a2._leafs = []);
        const allLeafsLen = allLeafs.length;
        const add2 = rowDataTran.add;
        const addLength = add2?.length;
        if (!addLength) {
          return [];
        }
        const newLen = allLeafsLen + addLength;
        let addIndex = this.sanitizeAddIndex(allLeafs, rowDataTran.addIndex);
        if (addIndex < allLeafsLen) {
          for (let readIdx = allLeafsLen - 1, writeIdx = newLen - 1; readIdx >= addIndex; --readIdx) {
            const node2 = allLeafs[readIdx];
            node2.sourceRowIndex = writeIdx;
            allLeafs[writeIdx--] = node2;
          }
          changedRowNodes.reordered = true;
        }
        allLeafs.length = newLen;
        const addedNodes = new Array(addLength);
        const adds = changedRowNodes.adds;
        for (let i2 = 0; i2 < addLength; i2++) {
          const node2 = this.createRowNode(add2[i2], 0);
          adds.add(node2);
          node2.sourceRowIndex = addIndex;
          allLeafs[addIndex] = node2;
          addedNodes[i2] = node2;
          addIndex++;
        }
        return addedNodes;
      }
      dispatchRowDataUpdateStarted(data) {
        this.eventSvc.dispatchEvent({ type: "rowDataUpdateStarted", firstRowData: data?.length ? data[0] : null });
      }
      deselect(nodes) {
        const source2 = "rowDataChanged";
        const selectionSvc = this.beans.selectionSvc;
        if (nodes.length) {
          selectionSvc?.setNodesSelected({ newValue: false, nodes, suppressFinishActions: true, source: source2 });
        }
        selectionSvc?.updateGroupsFromChildrenSelections?.(source2);
        if (nodes.length) {
          this.eventSvc.dispatchEvent({
            type: "selectionChanged",
            source: source2,
            selectedNodes: selectionSvc?.getSelectedNodes() ?? null,
            serverSideState: null
          });
        }
      }
      createRowNode(data, level) {
        const node2 = new RowNode(this.beans);
        node2.parent = this.rootNode;
        node2.level = level;
        node2.group = false;
        node2.expanded = false;
        node2.setDataAndId(data, String(this.nextId++));
        const id = node2.id;
        const allNodesMap = this.allNodesMap;
        if (allNodesMap[id]) {
          _warn(2, { nodeId: id });
        }
        allNodesMap[id] = node2;
        return node2;
      }
      /** Called when a node needs to be deleted */
      deleteNode(node2) {
        node2.clearRowTopAndRowIndex();
        const id = node2.id;
        const allNodesMap = this.allNodesMap;
        if (allNodesMap[id] === node2) {
          delete allNodesMap[id];
        }
        const pinnedSibling = node2.pinnedSibling;
        if (pinnedSibling) {
          this.beans.pinnedRowModel?.pinRow(pinnedSibling, null);
        }
      }
      lookupNode(getRowIdFunc, data) {
        if (!getRowIdFunc) {
          return lookupNodeByData(this.rootNode._leafs, data);
        }
        const id = getRowIdFunc({ data, level: 0 });
        const rowNode = this.allNodesMap[id];
        if (!rowNode) {
          _error(4, { id });
          return null;
        }
        return rowNode;
      }
      sanitizeAddIndex(allLeafs, addIndex) {
        const allLeafsLen = allLeafs.length;
        if (typeof addIndex !== "number") {
          return allLeafsLen;
        }
        if (addIndex < 0 || addIndex >= allLeafsLen || Number.isNaN(addIndex)) {
          return allLeafsLen;
        }
        addIndex = Math.ceil(addIndex);
        const gos = this.gos;
        if (addIndex > 0 && gos.get("treeData") && gos.get("getDataPath")) {
          addIndex = adjustAddIndexForDataPath(allLeafs, addIndex);
        }
        return addIndex;
      }
    };
    var adjustAddIndexForDataPath = (allLeafs, addIndex) => {
      for (let i2 = 0, len = allLeafs.length; i2 < len; i2++) {
        const node2 = allLeafs[i2];
        if (node2?.rowIndex == addIndex - 1) {
          return i2 + 1;
        }
      }
      return addIndex;
    };
    var initRootNode = (rootNode) => {
      rootNode.group = true;
      rootNode.level = -1;
      rootNode.id = "ROOT_NODE_ID";
      if (rootNode._leafs?.length !== 0) {
        rootNode._leafs = [];
      }
      const childrenAfterGroup = [];
      const childrenAfterSort = [];
      const childrenAfterAggFilter = [];
      const childrenAfterFilter = [];
      rootNode.childrenAfterGroup = childrenAfterGroup;
      rootNode.childrenAfterSort = childrenAfterSort;
      rootNode.childrenAfterAggFilter = childrenAfterAggFilter;
      rootNode.childrenAfterFilter = childrenAfterFilter;
      const sibling = rootNode.sibling;
      if (sibling) {
        sibling.childrenAfterGroup = childrenAfterGroup;
        sibling.childrenAfterSort = childrenAfterSort;
        sibling.childrenAfterAggFilter = childrenAfterAggFilter;
        sibling.childrenAfterFilter = childrenAfterFilter;
        sibling.childrenMapped = rootNode.childrenMapped;
      }
      rootNode.updateHasChildren();
      return rootNode;
    };
    var lookupNodeByData = (nodes, data) => {
      if (nodes) {
        for (let i2 = 0, len = nodes.length; i2 < len; i2++) {
          const node2 = nodes[i2];
          if (node2.data === data) {
            return node2;
          }
        }
      }
      _error(5, { data });
      return null;
    };
    var filterRemovedRowNodes = (allLeafs, filterIdx, filterEndIdx, removals, nodesNeverAdded) => {
      filterIdx = Math.max(0, filterIdx);
      for (let readIdx = filterIdx, len = allLeafs.length; readIdx < len; ++readIdx) {
        const node2 = allLeafs[readIdx];
        if (readIdx <= filterEndIdx && (removals.has(node2) || nodesNeverAdded?.has(node2))) {
          continue;
        }
        node2.sourceRowIndex = filterIdx;
        allLeafs[filterIdx++] = node2;
      }
      allLeafs.length = filterIdx;
    };
    var updateRootLeafsOrdered = (allLeafs, processedNodes) => {
      const newSize = processedNodes.size;
      allLeafs.length = newSize;
      let writeIdx = 0;
      let added = false;
      let reordered = false;
      for (const node2 of processedNodes) {
        const sourceRowIndex = node2.sourceRowIndex;
        if (sourceRowIndex === writeIdx) {
          reordered || (reordered = added);
        } else {
          if (sourceRowIndex >= 0) {
            reordered = true;
          } else {
            added = true;
          }
          node2.sourceRowIndex = writeIdx;
          allLeafs[writeIdx] = node2;
        }
        ++writeIdx;
      }
      return reordered;
    };
    var updateRootLeafsKeepOrder = (allLeafs, processedNodes, { removals, adds }) => {
      const allLeafsLen = allLeafs.length;
      allLeafs.length = processedNodes.size;
      let writeIdx = 0;
      for (let readIdx = 0; readIdx < allLeafsLen; ++readIdx) {
        const node2 = allLeafs[readIdx];
        if (!removals.has(node2)) {
          if (writeIdx !== readIdx) {
            node2.sourceRowIndex = writeIdx;
            allLeafs[writeIdx] = node2;
          }
          ++writeIdx;
        }
      }
      for (const node2 of adds) {
        if (node2.sourceRowIndex < 0) {
          node2.sourceRowIndex = writeIdx;
          allLeafs[writeIdx++] = node2;
        }
      }
      allLeafs.length = writeIdx;
    };
    var updateRowNodeAfterSort = (rowNode) => {
      const childrenAfterSort = rowNode.childrenAfterSort;
      const sibling = rowNode.sibling;
      if (sibling) {
        sibling.childrenAfterSort = childrenAfterSort;
      }
      if (!childrenAfterSort) {
        return;
      }
      for (let i2 = 0, lastIdx = childrenAfterSort.length - 1; i2 <= lastIdx; i2++) {
        const child = childrenAfterSort[i2];
        const first = i2 === 0;
        const last = i2 === lastIdx;
        if (child.firstChild !== first) {
          child.firstChild = first;
          child.dispatchRowEvent("firstChildChanged");
        }
        if (child.lastChild !== last) {
          child.lastChild = last;
          child.dispatchRowEvent("lastChildChanged");
        }
        if (child.childIndex !== i2) {
          child.childIndex = i2;
          child.dispatchRowEvent("childIndexChanged");
        }
      }
    };
    var SortStage = class extends BeanStub {
      constructor() {
        super(...arguments);
        this.beanName = "sortStage";
        this.step = "sort";
        this.refreshProps = ["postSortRows", "groupDisplayType", "accentedSort"];
      }
      execute(params) {
        const sortOptions2 = this.beans.sortSvc.getSortOptions();
        const deltaSort = sortOptions2.length > 0 && !!params.changedRowNodes && // in time we can remove this check, so that delta sort is always
        // on if transactions are present. it's off for now so that we can
        // selectively turn it on and test it with some select users before
        // rolling out to everyone.
        this.gos.get("deltaSort");
        this.sort(sortOptions2, deltaSort, params.changedRowNodes, params.changedPath);
      }
      sort(sortOptions2, useDeltaSort, changedRowNodes, changedPath) {
        const { gos, colModel, rowGroupColsSvc, rowNodeSorter, rowRenderer, showRowGroupCols } = this.beans;
        const groupMaintainOrder = gos.get("groupMaintainOrder");
        const groupColumnsPresent = colModel.getCols().some((c2) => c2.isRowGroupActive());
        const groupCols = rowGroupColsSvc?.columns;
        const isPivotMode = colModel.isPivotMode();
        const postSortFunc = gos.getCallback("postSortRows");
        let hasAnyFirstChildChanged = false;
        let sortContainsGroupColumns;
        const callback = (rowNode) => {
          const skipSortingPivotLeafs = isPivotMode && rowNode.leafGroup;
          let skipSortingGroups = groupMaintainOrder && groupColumnsPresent && !rowNode.leafGroup;
          if (skipSortingGroups) {
            sortContainsGroupColumns ?? (sortContainsGroupColumns = this.shouldSortContainsGroupCols(sortOptions2));
            skipSortingGroups && (skipSortingGroups = !sortContainsGroupColumns);
          }
          let newChildrenAfterSort = null;
          if (skipSortingGroups) {
            let wasSortExplicitlyRemoved = false;
            if (groupCols) {
              const nextGroupIndex = rowNode.level + 1;
              if (nextGroupIndex < groupCols.length) {
                wasSortExplicitlyRemoved = groupCols[nextGroupIndex].getSort() === null;
              }
            }
            if (!wasSortExplicitlyRemoved) {
              newChildrenAfterSort = preserveGroupOrder(rowNode);
            }
          } else if (!sortOptions2.length || skipSortingPivotLeafs) ;
          else if (useDeltaSort && changedRowNodes) {
            newChildrenAfterSort = doDeltaSort(rowNodeSorter, rowNode, changedRowNodes, changedPath, sortOptions2);
          } else {
            newChildrenAfterSort = rowNodeSorter.doFullSort(rowNode.childrenAfterAggFilter, sortOptions2);
          }
          newChildrenAfterSort || (newChildrenAfterSort = rowNode.childrenAfterAggFilter?.slice(0) ?? []);
          hasAnyFirstChildChanged || (hasAnyFirstChildChanged = rowNode.childrenAfterSort?.[0] !== newChildrenAfterSort[0]);
          rowNode.childrenAfterSort = newChildrenAfterSort;
          updateRowNodeAfterSort(rowNode);
          if (postSortFunc) {
            const params = { nodes: rowNode.childrenAfterSort };
            postSortFunc(params);
          }
        };
        changedPath?.forEachChangedNodeDepthFirst(callback);
        if (hasAnyFirstChildChanged && gos.get("groupHideOpenParents")) {
          const columns = showRowGroupCols?.getShowRowGroupCols();
          if (columns?.length) {
            rowRenderer.refreshCells({ columns, force: true });
          }
        }
      }
      shouldSortContainsGroupCols(sortOptions2) {
        const sortOptionsLen = sortOptions2.length;
        if (!sortOptionsLen) {
          return false;
        }
        if (_isColumnsSortingCoupledToGroup(this.gos)) {
          for (let i2 = 0; i2 < sortOptionsLen; ++i2) {
            const column2 = sortOptions2[i2].column;
            if (column2.isPrimary() && column2.isRowGroupActive()) {
              return true;
            }
          }
          return false;
        }
        for (let i2 = 0; i2 < sortOptionsLen; ++i2) {
          if (sortOptions2[i2].column.getColDef().showRowGroup) {
            return true;
          }
        }
        return false;
      }
    };
    var doDeltaSort = (rowNodeSorter, rowNode, changedRowNodes, changedPath, sortOptions2) => {
      const unsortedRows = rowNode.childrenAfterAggFilter;
      const oldSortedRows = rowNode.childrenAfterSort;
      if (!oldSortedRows) {
        return rowNodeSorter.doFullSort(unsortedRows, sortOptions2);
      }
      const untouchedRows = /* @__PURE__ */ new Set();
      const touchedRows = [];
      const { updates, adds } = changedRowNodes;
      for (let i2 = 0, len = unsortedRows.length; i2 < len; ++i2) {
        const row2 = unsortedRows[i2];
        if (updates.has(row2) || adds.has(row2) || changedPath && !changedPath.canSkip(row2)) {
          touchedRows.push({
            currentPos: touchedRows.length,
            rowNode: row2
          });
        } else {
          untouchedRows.add(row2);
        }
      }
      const sortedUntouchedRows = oldSortedRows.filter((child) => untouchedRows.has(child)).map((rowNode2, currentPos) => ({ currentPos, rowNode: rowNode2 }));
      touchedRows.sort((a, b) => rowNodeSorter.compareRowNodes(sortOptions2, a, b));
      return mergeSortedArrays(rowNodeSorter, sortOptions2, touchedRows, sortedUntouchedRows);
    };
    var mergeSortedArrays = (rowNodeSorter, sortOptions2, arr1, arr2) => {
      let i2 = 0;
      let j = 0;
      const arr1Length = arr1.length;
      const arr2Length = arr2.length;
      const res = new Array(arr1Length + arr2Length);
      let k2 = 0;
      while (i2 < arr1Length && j < arr2Length) {
        const a = arr1[i2];
        const b = arr2[j];
        if (rowNodeSorter.compareRowNodes(sortOptions2, a, b) < 0) {
          res[k2++] = a.rowNode;
          ++i2;
        } else {
          res[k2++] = b.rowNode;
          ++j;
        }
      }
      while (i2 < arr1Length) {
        res[k2++] = arr1[i2++].rowNode;
      }
      while (j < arr2Length) {
        res[k2++] = arr2[j++].rowNode;
      }
      return res;
    };
    var preserveGroupOrder = (node2) => {
      const childrenAfterSort = node2.childrenAfterSort;
      const childrenAfterAggFilter = node2.childrenAfterAggFilter;
      const childrenAfterSortLen = childrenAfterSort?.length;
      const childrenAfterAggFilterLen = childrenAfterAggFilter?.length;
      if (!childrenAfterSortLen || !childrenAfterAggFilterLen) {
        return null;
      }
      const result2 = new Array(childrenAfterAggFilterLen);
      const processed = /* @__PURE__ */ new Set();
      for (let i2 = 0; i2 < childrenAfterAggFilterLen; ++i2) {
        processed.add(childrenAfterAggFilter[i2]);
      }
      let writeIdx = 0;
      for (let i2 = 0; i2 < childrenAfterSortLen; ++i2) {
        const node22 = childrenAfterSort[i2];
        if (processed.delete(node22)) {
          result2[writeIdx++] = node22;
        }
      }
      if (processed.size === 0 && writeIdx === childrenAfterSortLen) {
        return childrenAfterSort;
      }
      for (const newNode of processed) {
        result2[writeIdx++] = newNode;
      }
      result2.length = writeIdx;
      return result2;
    };
    var ClientSideRowModel = class extends BeanStub {
      constructor() {
        super(...arguments);
        this.beanName = "rowModel";
        this.rootNode = null;
        this.rowCountReady = false;
        this.nodeManager = void 0;
        this.rowsToDisplay = [];
        this.rowDataUpdatedPending = false;
        this.asyncTransactions = null;
        this.asyncTransactionsTimer = 0;
        this.started = false;
        this.refreshingModel = false;
        this.rowNodesCountReady = false;
        this.stages = [];
        this.stagesRefreshProps = /* @__PURE__ */ new Map();
        this.onRowHeightChanged_debounced = _debounce(this, this.onRowHeightChanged.bind(this), 100);
      }
      postConstruct() {
        const beans = this.beans;
        const rootNode = new RowNode(beans);
        this.rootNode = rootNode;
        this.nodeManager = this.createBean(new ClientSideNodeManager(rootNode));
        const refreshEverythingFunc = this.refreshModel.bind(this, { step: "group" });
        const refreshEverythingAfterColsChangedFunc = this.refreshModel.bind(this, {
          step: "group",
          // after cols change, row grouping (the first stage) could of changed
          afterColumnsChanged: true,
          keepRenderedRows: true,
          // we want animations cos sorting or filtering could be applied
          animate: !this.gos.get("suppressAnimationFrame")
        });
        this.addManagedEventListeners({
          newColumnsLoaded: refreshEverythingAfterColsChangedFunc,
          columnRowGroupChanged: refreshEverythingFunc,
          columnValueChanged: this.onValueChanged.bind(this),
          columnPivotChanged: this.refreshModel.bind(this, { step: "pivot" }),
          filterChanged: this.onFilterChanged.bind(this),
          sortChanged: this.onSortChanged.bind(this),
          columnPivotModeChanged: refreshEverythingFunc,
          gridStylesChanged: this.onGridStylesChanges.bind(this),
          gridReady: this.onGridReady.bind(this),
          rowExpansionStateChanged: this.onRowGroupOpened.bind(this)
        });
        this.addPropertyListeners();
      }
      addPropertyListeners() {
        const { beans, stagesRefreshProps } = this;
        const orderedStages = [
          beans.groupStage,
          beans.filterStage,
          beans.pivotStage,
          beans.aggStage,
          beans.sortStage,
          beans.filterAggStage,
          beans.flattenStage
        ].filter((stage) => !!stage);
        this.stages = orderedStages;
        for (let i2 = orderedStages.length - 1; i2 >= 0; --i2) {
          for (const prop2 of orderedStages[i2].refreshProps) {
            stagesRefreshProps.set(prop2, i2);
          }
        }
        this.addManagedPropertyListeners([...stagesRefreshProps.keys()], (params) => {
          const properties = params.changeSet?.properties;
          if (properties) {
            this.onPropChange(properties);
          }
        });
        this.addManagedPropertyListener("rowData", () => this.onPropChange(["rowData"]));
        this.addManagedPropertyListener("rowHeight", () => this.resetRowHeights());
      }
      start() {
        this.started = true;
        if (this.rowNodesCountReady) {
          this.refreshModel({ step: "group", rowDataUpdated: true, newData: true });
        } else {
          this.setInitialData();
        }
      }
      setInitialData() {
        const rowData = this.gos.get("rowData");
        if (rowData) {
          this.onPropChange(["rowData"]);
        }
      }
      ensureRowHeightsValid(startPixel, endPixel, startLimitIndex, endLimitIndex) {
        let atLeastOneChange;
        let res = false;
        do {
          atLeastOneChange = false;
          const rowAtStartPixel = this.getRowIndexAtPixel(startPixel);
          const rowAtEndPixel = this.getRowIndexAtPixel(endPixel);
          const firstRow = Math.max(rowAtStartPixel, startLimitIndex);
          const lastRow = Math.min(rowAtEndPixel, endLimitIndex);
          for (let rowIndex = firstRow; rowIndex <= lastRow; rowIndex++) {
            const rowNode = this.getRow(rowIndex);
            if (rowNode.rowHeightEstimated) {
              const rowHeight = _getRowHeightForNode(this.beans, rowNode);
              rowNode.setRowHeight(rowHeight.height);
              atLeastOneChange = true;
              res = true;
            }
          }
          if (atLeastOneChange) {
            this.setRowTopAndRowIndex();
          }
        } while (atLeastOneChange);
        return res;
      }
      onPropChange(properties) {
        const { nodeManager, gos, beans } = this;
        const groupStage = beans.groupStage;
        if (!nodeManager) {
          return;
        }
        const changedProps = new Set(properties);
        const extractData = groupStage?.onPropChange(changedProps);
        let newRowData;
        if (changedProps.has("rowData")) {
          newRowData = gos.get("rowData");
        } else if (extractData) {
          newRowData = groupStage?.extractData();
        }
        if (newRowData && !Array.isArray(newRowData)) {
          newRowData = null;
          _warn(1);
        }
        const params = { step: "nothing", changedProps };
        if (newRowData) {
          const immutable = !extractData && !this.isEmpty() && newRowData.length > 0 && gos.exists("getRowId") && // backward compatibility - for who want old behaviour of Row IDs but NOT Immutable Data.
          !gos.get("resetRowDataOnUpdate");
          if (immutable) {
            params.keepRenderedRows = true;
            params.animate = !gos.get("suppressAnimationFrame");
            params.changedRowNodes = new ChangedRowNodes();
            nodeManager.setImmutableRowData(params, newRowData);
          } else {
            params.rowDataUpdated = true;
            params.newData = true;
            nodeManager.setNewRowData(newRowData);
            this.rowNodesCountReady = true;
          }
        }
        const step = params.rowDataUpdated ? "group" : this.getRefreshedStage(properties);
        if (step) {
          params.step = step;
          this.refreshModel(params);
        }
      }
      getRefreshedStage(properties) {
        const { stages, stagesRefreshProps } = this;
        const stagesLen = stages.length;
        let minIndex = stagesLen;
        for (let i2 = 0, len = properties.length; i2 < len && minIndex; ++i2) {
          minIndex = Math.min(minIndex, stagesRefreshProps.get(properties[i2]) ?? minIndex);
        }
        return minIndex < stagesLen ? stages[minIndex].step : null;
      }
      setRowTopAndRowIndex(outputDisplayedRowsMapped) {
        const { beans, rowsToDisplay } = this;
        const defaultRowHeight = beans.environment.getDefaultRowHeight();
        let nextRowTop = 0;
        const allowEstimate = _isDomLayout(this.gos, "normal");
        for (let i2 = 0, len = rowsToDisplay.length; i2 < len; ++i2) {
          const rowNode = rowsToDisplay[i2];
          const id = rowNode.id;
          if (id != null) {
            outputDisplayedRowsMapped?.add(id);
          }
          if (rowNode.rowHeight == null) {
            const rowHeight = _getRowHeightForNode(beans, rowNode, allowEstimate, defaultRowHeight);
            rowNode.setRowHeight(rowHeight.height, rowHeight.estimated);
          }
          rowNode.setRowTop(nextRowTop);
          rowNode.setRowIndex(i2);
          nextRowTop += rowNode.rowHeight;
        }
      }
      clearRowTopAndRowIndex(changedPath, displayedRowsMapped) {
        const changedPathActive = changedPath.active;
        const clearIfNotDisplayed = (rowNode) => {
          if (rowNode?.id != null && !displayedRowsMapped.has(rowNode.id)) {
            rowNode.clearRowTopAndRowIndex();
          }
        };
        const recurse = (rowNode) => {
          clearIfNotDisplayed(rowNode);
          clearIfNotDisplayed(rowNode.detailNode);
          clearIfNotDisplayed(rowNode.sibling);
          const childrenAfterGroup = rowNode.childrenAfterGroup;
          if (!rowNode.hasChildren() || !childrenAfterGroup) {
            return;
          }
          const isRootNode = rowNode.level == -1;
          const skipChildren = changedPathActive && !isRootNode && !rowNode.expanded;
          if (skipChildren) {
            return;
          }
          for (let i2 = 0, len = childrenAfterGroup.length; i2 < len; ++i2) {
            recurse(childrenAfterGroup[i2]);
          }
        };
        const rootNode = this.rootNode;
        if (rootNode) {
          recurse(rootNode);
        }
      }
      isLastRowIndexKnown() {
        return true;
      }
      getRowCount() {
        return this.rowsToDisplay.length;
      }
      /**
       * Returns the number of rows with level === 1
       */
      getTopLevelRowCount() {
        const { rootNode, rowsToDisplay } = this;
        if (!rootNode || !rowsToDisplay.length) {
          return 0;
        }
        const showingRootNode = rowsToDisplay[0] === rootNode;
        if (showingRootNode) {
          return 1;
        }
        const totalFooterInc = rootNode.sibling?.displayed ? 1 : 0;
        return (rootNode.childrenAfterSort?.length ?? 0) + totalFooterInc;
      }
      /**
       * Get the row display index by the top level index
       * top level index is the index of rows with level === 1
       */
      getTopLevelRowDisplayedIndex(topLevelIndex) {
        const { beans, rootNode, rowsToDisplay } = this;
        const showingRootNode = !rootNode || !rowsToDisplay.length || rowsToDisplay[0] === rootNode;
        if (showingRootNode) {
          return topLevelIndex;
        }
        const childrenAfterSort = rootNode.childrenAfterSort;
        const getDefaultIndex = (adjustedIndex) => {
          let rowNode = childrenAfterSort[adjustedIndex];
          if (this.gos.get("groupHideOpenParents")) {
            while (rowNode.expanded && rowNode.childrenAfterSort && rowNode.childrenAfterSort.length > 0) {
              rowNode = rowNode.childrenAfterSort[0];
            }
          }
          return rowNode.rowIndex;
        };
        const footerSvc = beans.footerSvc;
        if (footerSvc) {
          return footerSvc?.getTopDisplayIndex(rowsToDisplay, topLevelIndex, childrenAfterSort, getDefaultIndex);
        }
        return getDefaultIndex(topLevelIndex);
      }
      /**
       * The opposite of `getTopLevelRowDisplayedIndex`
       */
      getTopLevelIndexFromDisplayedIndex(displayedIndex) {
        const { rootNode, rowsToDisplay } = this;
        const showingRootNode = !rootNode || !rowsToDisplay.length || rowsToDisplay[0] === rootNode;
        if (showingRootNode) {
          return displayedIndex;
        }
        let node2 = this.getRow(displayedIndex);
        if (node2.footer) {
          node2 = node2.sibling;
        }
        let parent = node2.parent;
        while (parent && parent !== rootNode) {
          node2 = parent;
          parent = node2.parent;
        }
        const topLevelIndex = rootNode.childrenAfterSort?.indexOf(node2) ?? -1;
        return topLevelIndex >= 0 ? topLevelIndex : displayedIndex;
      }
      getRowBounds(index) {
        const rowNode = this.rowsToDisplay[index];
        return rowNode ? { rowTop: rowNode.rowTop, rowHeight: rowNode.rowHeight } : null;
      }
      onRowGroupOpened() {
        this.refreshModel({ step: "map", keepRenderedRows: true, animate: _isAnimateRows(this.gos) });
      }
      onFilterChanged({ afterDataChange, columns }) {
        if (!afterDataChange) {
          const primaryOrQuickFilterChanged = columns.length === 0 || columns.some((col) => col.isPrimary());
          const step = primaryOrQuickFilterChanged ? "filter" : "filter_aggregates";
          this.refreshModel({ step, keepRenderedRows: true, animate: _isAnimateRows(this.gos) });
        }
      }
      onSortChanged() {
        this.refreshModel({
          step: "sort",
          keepRenderedRows: true,
          animate: _isAnimateRows(this.gos)
        });
      }
      getType() {
        return "clientSide";
      }
      onValueChanged() {
        this.refreshModel({ step: this.beans.colModel.isPivotActive() ? "pivot" : "aggregate" });
      }
      createChangePath(enabled) {
        const changedPath = new ChangedPath(false, this.rootNode);
        changedPath.active = enabled;
        return changedPath;
      }
      isSuppressModelUpdateAfterUpdateTransaction(params) {
        if (!this.gos.get("suppressModelUpdateAfterUpdateTransaction")) {
          return false;
        }
        const { changedRowNodes, newData, rowDataUpdated } = params;
        if (!changedRowNodes || newData || !rowDataUpdated) {
          return false;
        }
        if (changedRowNodes.removals.size || changedRowNodes.adds.size) {
          return false;
        }
        return true;
      }
      refreshModel(params) {
        const { nodeManager, beans, eventSvc, started: started2, refreshingModel } = this;
        if (!nodeManager) {
          return;
        }
        const rowDataUpdated = !!params.rowDataUpdated;
        const changedPath = params.changedPath ?? (params.changedPath = this.createChangePath(!params.newData && rowDataUpdated));
        if (started2 && rowDataUpdated) {
          eventSvc.dispatchEvent({ type: "rowDataUpdated" });
        }
        if (!started2 || refreshingModel || beans.colModel.changeEventsDispatching || this.isSuppressModelUpdateAfterUpdateTransaction(params)) {
          this.rowDataUpdatedPending || (this.rowDataUpdatedPending = rowDataUpdated);
          return;
        }
        if (this.rowDataUpdatedPending) {
          this.rowDataUpdatedPending = false;
          params.step = "group";
        }
        this.refreshingModel = true;
        beans.masterDetailSvc?.refreshModel(params);
        if (rowDataUpdated && params.step !== "group") {
          beans.colFilter?.refreshModel();
        }
        switch (params.step) {
          case "group":
            this.doGrouping(params);
          case "filter":
            this.doFilter(changedPath);
          case "pivot":
            this.doPivot(changedPath);
          case "aggregate":
            this.doAggregate(changedPath);
          case "filter_aggregates":
            this.doFilterAggregates(changedPath);
          case "sort":
            this.doSort(params.changedRowNodes, changedPath);
          case "map":
            this.doRowsToDisplay();
        }
        const displayedNodesMapped = /* @__PURE__ */ new Set();
        this.setRowTopAndRowIndex(displayedNodesMapped);
        this.clearRowTopAndRowIndex(changedPath, displayedNodesMapped);
        this.refreshingModel = false;
        eventSvc.dispatchEvent({
          type: "modelUpdated",
          animate: params.animate,
          keepRenderedRows: params.keepRenderedRows,
          newData: params.newData,
          newPage: false,
          keepUndoRedoStack: params.keepUndoRedoStack
        });
      }
      isEmpty() {
        return !this.rootNode?._leafs?.length || !this.beans.colModel?.ready;
      }
      isRowsToRender() {
        return this.rowsToDisplay.length > 0;
      }
      getNodesInRangeForSelection(firstInRange, lastInRange) {
        let started2 = false;
        let finished = false;
        const result2 = [];
        const groupsSelectChildren = _getGroupSelectsDescendants(this.gos);
        this.forEachNodeAfterFilterAndSort((rowNode) => {
          if (finished) {
            return;
          }
          if (started2) {
            if (rowNode === lastInRange || rowNode === firstInRange) {
              finished = true;
              if (groupsSelectChildren && rowNode.group) {
                addAllLeafs(result2, rowNode);
                return;
              }
            }
          }
          if (!started2) {
            if (rowNode !== lastInRange && rowNode !== firstInRange) {
              return;
            }
            started2 = true;
            if (lastInRange === firstInRange) {
              finished = true;
            }
          }
          const includeThisNode = !rowNode.group || !groupsSelectChildren;
          if (includeThisNode) {
            result2.push(rowNode);
          }
        });
        return result2;
      }
      getTopLevelNodes() {
        return this.rootNode?.childrenAfterGroup ?? null;
      }
      getRow(index) {
        return this.rowsToDisplay[index];
      }
      isRowPresent(rowNode) {
        return this.rowsToDisplay.indexOf(rowNode) >= 0;
      }
      getRowIndexAtPixel(pixelToMatch) {
        const rowsToDisplay = this.rowsToDisplay;
        const rowsToDisplayLen = rowsToDisplay.length;
        if (this.isEmpty() || rowsToDisplayLen === 0) {
          return -1;
        }
        let bottomPointer = 0;
        let topPointer = rowsToDisplayLen - 1;
        if (pixelToMatch <= 0) {
          return 0;
        }
        const lastNode = rowsToDisplay[topPointer];
        if (lastNode.rowTop <= pixelToMatch) {
          return topPointer;
        }
        let oldBottomPointer = -1;
        let oldTopPointer = -1;
        while (true) {
          const midPointer = Math.floor((bottomPointer + topPointer) / 2);
          const currentRowNode = rowsToDisplay[midPointer];
          if (this.isRowInPixel(currentRowNode, pixelToMatch)) {
            return midPointer;
          }
          if (currentRowNode.rowTop < pixelToMatch) {
            bottomPointer = midPointer + 1;
          } else if (currentRowNode.rowTop > pixelToMatch) {
            topPointer = midPointer - 1;
          }
          const caughtInInfiniteLoop = oldBottomPointer === bottomPointer && oldTopPointer === topPointer;
          if (caughtInInfiniteLoop) {
            return midPointer;
          }
          oldBottomPointer = bottomPointer;
          oldTopPointer = topPointer;
        }
      }
      isRowInPixel(rowNode, pixelToMatch) {
        const topPixel = rowNode.rowTop;
        const bottomPixel = topPixel + rowNode.rowHeight;
        return topPixel <= pixelToMatch && bottomPixel > pixelToMatch;
      }
      forEachLeafNode(callback) {
        const allLeafs = this.rootNode?._leafs;
        if (allLeafs) {
          for (let i2 = 0, len = allLeafs.length; i2 < len; ++i2) {
            callback(allLeafs[i2], i2);
          }
        }
      }
      forEachNode(callback, includeFooterNodes = false) {
        this.depthFirstSearchRowNodes(callback, includeFooterNodes);
      }
      forEachDisplayedNode(callback) {
        const rowsToDisplay = this.rowsToDisplay;
        for (let i2 = 0, len = rowsToDisplay.length; i2 < len; ++i2) {
          callback(rowsToDisplay[i2], i2);
        }
      }
      forEachNodeAfterFilter(callback, includeFooterNodes = false) {
        this.depthFirstSearchRowNodes(callback, includeFooterNodes, (node2) => node2.childrenAfterAggFilter);
      }
      forEachNodeAfterFilterAndSort(callback, includeFooterNodes = false) {
        this.depthFirstSearchRowNodes(callback, includeFooterNodes, (node2) => node2.childrenAfterSort);
      }
      forEachPivotNode(callback, includeFooterNodes, afterSort) {
        const { colModel, rowGroupColsSvc } = this.beans;
        if (!colModel.isPivotMode()) {
          return;
        }
        if (!rowGroupColsSvc?.columns.length) {
          callback(this.rootNode, 0);
          return;
        }
        const childrenField = afterSort ? "childrenAfterSort" : "childrenAfterGroup";
        this.depthFirstSearchRowNodes(
          callback,
          includeFooterNodes,
          (node2) => !node2.leafGroup ? node2[childrenField] : null
        );
      }
      /**
       * Iterate through each node and all of its children
       * @param callback the function to execute for each node
       * @param includeFooterNodes whether to also iterate over footer nodes
       * @param nodes the nodes to start iterating over
       * @param getChildren a function to determine the recursion strategy
       * @param startIndex the index to start from
       * @returns the index ended at
       */
      depthFirstSearchRowNodes(callback, includeFooterNodes = false, getChildren2 = (node22) => node22.childrenAfterGroup, node2 = this.rootNode, startIndex = 0) {
        let index = startIndex;
        if (!node2) {
          return index;
        }
        const isRootNode = node2 === this.rootNode;
        if (!isRootNode) {
          callback(node2, index++);
        }
        if (node2.hasChildren() && !node2.footer) {
          const children2 = getChildren2(node2);
          if (children2) {
            const footerSvc = this.beans.footerSvc;
            index = footerSvc?.addTotalRows(index, node2, callback, includeFooterNodes, isRootNode, "top") ?? index;
            for (const node22 of children2) {
              index = this.depthFirstSearchRowNodes(callback, includeFooterNodes, getChildren2, node22, index);
            }
            return footerSvc?.addTotalRows(index, node2, callback, includeFooterNodes, isRootNode, "bottom") ?? index;
          }
        }
        return index;
      }
      // it's possible to recompute the aggregate without doing the other parts + api.refreshClientSideRowModel('aggregate')
      doAggregate(changedPath) {
        const rootNode = this.rootNode;
        if (rootNode) {
          this.beans.aggStage?.execute({ rowNode: rootNode, changedPath });
        }
      }
      doFilterAggregates(changedPath) {
        const rootNode = this.rootNode;
        const filterAggStage = this.beans.filterAggStage;
        if (filterAggStage) {
          filterAggStage.execute({ rowNode: rootNode, changedPath });
          return;
        }
        rootNode.childrenAfterAggFilter = rootNode.childrenAfterFilter;
      }
      doSort(changedRowNodes, changedPath) {
        const sortStage = this.beans.sortStage;
        if (sortStage) {
          sortStage.execute({
            rowNode: this.rootNode,
            changedRowNodes,
            changedPath
          });
          return;
        }
        changedPath.forEachChangedNodeDepthFirst((rowNode) => {
          rowNode.childrenAfterSort = rowNode.childrenAfterAggFilter.slice(0);
          updateRowNodeAfterSort(rowNode);
        });
      }
      doGrouping(params) {
        const rootNode = this.rootNode;
        const groupStage = this.beans.groupStage;
        const groupingChanged = groupStage?.execute({
          rowNode: rootNode,
          changedRowNodes: params.changedRowNodes,
          changedPath: params.changedPath,
          afterColumnsChanged: !!params.afterColumnsChanged
        });
        if (groupingChanged === void 0) {
          const allLeafs = rootNode._leafs;
          rootNode.childrenAfterGroup = allLeafs;
          rootNode.updateHasChildren();
          const sibling = rootNode.sibling;
          if (sibling) {
            sibling.childrenAfterGroup = allLeafs;
          }
        }
        if (groupingChanged || params.rowDataUpdated) {
          this.beans.colFilter?.refreshModel();
        }
        if (!this.rowCountReady && this.rowNodesCountReady) {
          this.rowCountReady = true;
          this.eventSvc.dispatchEventOnce({ type: "rowCountReady" });
        }
      }
      doFilter(changedPath) {
        const filterStage = this.beans.filterStage;
        if (filterStage) {
          filterStage.execute({ rowNode: this.rootNode, changedPath });
          return;
        }
        changedPath.forEachChangedNodeDepthFirst((rowNode) => {
          rowNode.childrenAfterFilter = rowNode.childrenAfterGroup;
          updateRowNodeAfterFilter(rowNode);
        }, true);
      }
      doPivot(changedPath) {
        this.beans.pivotStage?.execute({ rowNode: this.rootNode, changedPath });
      }
      getRowNode(id) {
        const found = this.nodeManager?.getRowNode(id);
        if (typeof found === "object") {
          return found;
        }
        const idIsGroup = typeof id == "string" && id.indexOf(ROW_ID_PREFIX_ROW_GROUP) === 0;
        return idIsGroup ? this.beans.groupStage?.getNode(id) : void 0;
      }
      batchUpdateRowData(rowDataTransaction, callback) {
        if (!this.asyncTransactionsTimer) {
          this.asyncTransactions = [];
          const waitMilliseconds = this.gos.get("asyncTransactionWaitMillis");
          this.asyncTransactionsTimer = setTimeout(() => this.executeBatchUpdateRowData(), waitMilliseconds);
        }
        this.asyncTransactions.push({ rowDataTransaction, callback });
      }
      flushAsyncTransactions() {
        const asyncTransactionsTimer = this.asyncTransactionsTimer;
        if (asyncTransactionsTimer) {
          clearTimeout(asyncTransactionsTimer);
          this.executeBatchUpdateRowData();
        }
      }
      executeBatchUpdateRowData() {
        const { nodeManager, beans, eventSvc, asyncTransactions } = this;
        if (!nodeManager) {
          return;
        }
        beans.valueCache?.onDataChanged();
        const rowNodeTrans = [];
        const callbackFuncsBound = [];
        const changedRowNodes = new ChangedRowNodes();
        for (const { rowDataTransaction, callback } of asyncTransactions ?? []) {
          this.rowNodesCountReady = true;
          const rowNodeTransaction = nodeManager.updateRowData(rowDataTransaction, changedRowNodes);
          rowNodeTrans.push(rowNodeTransaction);
          if (callback) {
            callbackFuncsBound.push(callback.bind(null, rowNodeTransaction));
          }
        }
        this.commitTransactions(changedRowNodes);
        if (callbackFuncsBound.length > 0) {
          setTimeout(() => {
            for (let i2 = 0, len = callbackFuncsBound.length; i2 < len; i2++) {
              callbackFuncsBound[i2]();
            }
          }, 0);
        }
        if (rowNodeTrans.length > 0) {
          eventSvc.dispatchEvent({ type: "asyncTransactionsFlushed", results: rowNodeTrans });
        }
        this.asyncTransactionsTimer = 0;
        this.asyncTransactions = null;
      }
      /**
       * Used to apply transaction changes.
       * Called by gridApi & rowDragFeature
       */
      updateRowData(rowDataTran) {
        const nodeManager = this.nodeManager;
        if (!nodeManager) {
          return null;
        }
        this.beans.valueCache?.onDataChanged();
        this.rowNodesCountReady = true;
        const changedRowNodes = new ChangedRowNodes();
        const rowNodeTransaction = nodeManager.updateRowData(rowDataTran, changedRowNodes);
        this.commitTransactions(changedRowNodes);
        return rowNodeTransaction;
      }
      /**
       * Common to:
       * - executeBatchUpdateRowData (batch transactions)
       * - updateRowData (single transaction)
       * - setImmutableRowData (generated transaction)
       *
       * @param rowNodeTrans - the transactions to apply
       * @param orderChanged - whether the order of the rows has changed, either via generated transaction or user provided addIndex
       */
      commitTransactions(changedRowNodes) {
        this.refreshModel({
          step: "group",
          rowDataUpdated: true,
          keepRenderedRows: true,
          animate: !this.gos.get("suppressAnimationFrame"),
          changedRowNodes,
          changedPath: this.createChangePath(true)
        });
      }
      doRowsToDisplay() {
        const { beans, rootNode } = this;
        const flattenStage = beans.flattenStage;
        if (flattenStage) {
          this.rowsToDisplay = flattenStage.execute({ rowNode: rootNode });
          return;
        }
        const rowsToDisplay = this.rootNode.childrenAfterSort ?? [];
        for (const row2 of rowsToDisplay) {
          row2.setUiLevel(0);
        }
        this.rowsToDisplay = rowsToDisplay;
      }
      onRowHeightChanged() {
        this.refreshModel({ step: "map", keepRenderedRows: true, keepUndoRedoStack: true });
      }
      resetRowHeights() {
        const rootNode = this.rootNode;
        if (!rootNode) {
          return;
        }
        const atLeastOne = this.resetRowHeightsForAllRowNodes();
        rootNode.setRowHeight(rootNode.rowHeight, true);
        const sibling = rootNode.sibling;
        sibling?.setRowHeight(sibling.rowHeight, true);
        if (atLeastOne) {
          this.onRowHeightChanged();
        }
      }
      resetRowHeightsForAllRowNodes() {
        let atLeastOne = false;
        this.forEachNode((rowNode) => {
          rowNode.setRowHeight(rowNode.rowHeight, true);
          const detailNode = rowNode.detailNode;
          detailNode?.setRowHeight(detailNode.rowHeight, true);
          const sibling = rowNode.sibling;
          sibling?.setRowHeight(sibling.rowHeight, true);
          atLeastOne = true;
        });
        return atLeastOne;
      }
      onGridStylesChanges(e) {
        if (e.rowHeightChanged && !this.beans.rowAutoHeight?.active) {
          this.resetRowHeights();
        }
      }
      onGridReady() {
        if (!this.started) {
          this.setInitialData();
        }
      }
      destroy() {
        super.destroy();
        this.nodeManager = this.destroyBean(this.nodeManager);
        this.started = false;
        this.rootNode = null;
        this.rowsToDisplay = [];
        this.asyncTransactions = null;
        clearTimeout(this.asyncTransactionsTimer);
      }
      /**
       * @deprecated v33.1
       */
      onRowHeightChangedDebounced() {
        this.onRowHeightChanged_debounced();
      }
    };
    var addAllLeafs = (result2, node2) => {
      const childrenAfterGroup = node2.childrenAfterGroup;
      if (childrenAfterGroup) {
        for (let i2 = 0, len = childrenAfterGroup.length; i2 < len; ++i2) {
          const child = childrenAfterGroup[i2];
          if (child.data) {
            result2.push(child);
          }
          if (child.group) {
            addAllLeafs(result2, child);
          }
        }
      }
    };
    function onGroupExpandedOrCollapsed(beans) {
      beans.expansionSvc?.onGroupExpandedOrCollapsed();
    }
    function refreshClientSideRowModel(beans, step) {
      const clientSideRowModel = _getClientSideRowModel(beans);
      if (clientSideRowModel) {
        if (!step || step === "everything") {
          step = "group";
        }
        clientSideRowModel.refreshModel({
          step,
          keepRenderedRows: true,
          animate: !beans.gos.get("suppressAnimationFrame")
        });
      }
    }
    function isRowDataEmpty(beans) {
      return _getClientSideRowModel(beans)?.isEmpty() ?? true;
    }
    function forEachLeafNode(beans, callback) {
      _getClientSideRowModel(beans)?.forEachLeafNode(callback);
    }
    function forEachNodeAfterFilter(beans, callback) {
      _getClientSideRowModel(beans)?.forEachNodeAfterFilter(callback);
    }
    function forEachNodeAfterFilterAndSort(beans, callback) {
      _getClientSideRowModel(beans)?.forEachNodeAfterFilterAndSort(callback);
    }
    function applyTransaction(beans, rowDataTransaction) {
      return beans.frameworkOverrides.wrapIncoming(
        () => _getClientSideRowModel(beans)?.updateRowData(rowDataTransaction)
      );
    }
    function applyTransactionAsync(beans, rowDataTransaction, callback) {
      beans.frameworkOverrides.wrapIncoming(
        () => _getClientSideRowModel(beans)?.batchUpdateRowData(rowDataTransaction, callback)
      );
    }
    function flushAsyncTransactions(beans) {
      beans.frameworkOverrides.wrapIncoming(() => _getClientSideRowModel(beans)?.flushAsyncTransactions());
    }
    function getBestCostNodeSelection(beans) {
      return beans.selectionSvc?.getBestCostNodeSelection();
    }
    var ClientSideRowModelModule = {
      moduleName: "ClientSideRowModel",
      version: VERSION,
      rowModels: ["clientSide"],
      beans: [ClientSideRowModel, SortStage],
      dependsOn: [SortModule]
    };
    var ClientSideRowModelApiModule = {
      moduleName: "ClientSideRowModelApi",
      version: VERSION,
      apiFunctions: {
        onGroupExpandedOrCollapsed,
        refreshClientSideRowModel,
        isRowDataEmpty,
        forEachLeafNode,
        forEachNodeAfterFilter,
        forEachNodeAfterFilterAndSort,
        applyTransaction,
        applyTransactionAsync,
        flushAsyncTransactions,
        getBestCostNodeSelection,
        resetRowHeights,
        onRowHeightChanged
      },
      dependsOn: [CsrmSsrmSharedApiModule, RowModelSharedApiModule]
    };
    var GridSerializer = class extends BeanStub {
      constructor() {
        super(...arguments);
        this.beanName = "gridSerializer";
      }
      wireBeans(beans) {
        this.visibleCols = beans.visibleCols;
        this.colModel = beans.colModel;
        this.rowModel = beans.rowModel;
        this.pinnedRowModel = beans.pinnedRowModel;
      }
      serialize(gridSerializingSession, params = {}) {
        const { allColumns, columnKeys, skipRowGroups, exportRowNumbers } = params;
        const columnsToExport = this.getColumnsToExport({
          allColumns,
          skipRowGroups,
          columnKeys,
          exportRowNumbers
        });
        return [
          // first pass, put in the header names of the cols
          this.prepareSession(columnsToExport),
          this.prependContent(params),
          this.exportColumnGroups(params, columnsToExport),
          this.exportHeaders(params, columnsToExport),
          this.processPinnedTopRows(params, columnsToExport),
          this.processRows(params, columnsToExport),
          this.processPinnedBottomRows(params, columnsToExport),
          this.appendContent(params)
        ].reduce((composed, f) => f(composed), gridSerializingSession).parse();
      }
      processRow(gridSerializingSession, params, columnsToExport, node2) {
        const rowSkipper = params.shouldRowBeSkipped || (() => false);
        const isClipboardExport = params.rowPositions != null;
        const isExplicitExportSelection = isClipboardExport || !!params.onlySelected;
        const hideOpenParents = this.gos.get("groupHideOpenParents") && !isExplicitExportSelection;
        const isLeafNode = this.colModel.isPivotMode() ? node2.leafGroup : !node2.group;
        const isFooter = !!node2.footer;
        const shouldSkipCurrentGroup = node2.allChildrenCount === 1 && node2.childrenAfterGroup?.length === 1 && _canSkipShowingRowGroup(this.gos, node2);
        if (!isLeafNode && !isFooter && (params.skipRowGroups || shouldSkipCurrentGroup || hideOpenParents) || params.onlySelected && !node2.isSelected() || params.skipPinnedTop && node2.rowPinned === "top" || params.skipPinnedBottom && node2.rowPinned === "bottom" || node2.stub) {
          return;
        }
        const nodeIsRootNode = node2.level === -1;
        if (nodeIsRootNode && !isLeafNode && !isFooter) {
          return;
        }
        const shouldRowBeSkipped = rowSkipper(_addGridCommonParams(this.gos, { node: node2 }));
        if (shouldRowBeSkipped) {
          return;
        }
        const rowAccumulator = gridSerializingSession.onNewBodyRow(node2);
        columnsToExport.forEach((column2, index) => {
          rowAccumulator.onColumn(column2, index, node2);
        });
        if (params.getCustomContentBelowRow) {
          const content2 = params.getCustomContentBelowRow(_addGridCommonParams(this.gos, { node: node2 }));
          if (content2) {
            gridSerializingSession.addCustomContent(content2);
          }
        }
      }
      appendContent(params) {
        return (gridSerializingSession) => {
          const appendContent = params.appendContent;
          if (appendContent) {
            gridSerializingSession.addCustomContent(appendContent);
          }
          return gridSerializingSession;
        };
      }
      prependContent(params) {
        return (gridSerializingSession) => {
          const prependContent = params.prependContent;
          if (prependContent) {
            gridSerializingSession.addCustomContent(prependContent);
          }
          return gridSerializingSession;
        };
      }
      prepareSession(columnsToExport) {
        return (gridSerializingSession) => {
          gridSerializingSession.prepare(columnsToExport);
          return gridSerializingSession;
        };
      }
      exportColumnGroups(params, columnsToExport) {
        return (gridSerializingSession) => {
          if (!params.skipColumnGroupHeaders) {
            const idCreator = new GroupInstanceIdCreator();
            const { colGroupSvc } = this.beans;
            const displayedGroups = colGroupSvc ? colGroupSvc.createColumnGroups({
              columns: columnsToExport,
              idCreator,
              pinned: null,
              isStandaloneStructure: true
            }) : columnsToExport;
            this.recursivelyAddHeaderGroups(
              displayedGroups,
              gridSerializingSession,
              params.processGroupHeaderCallback
            );
          }
          return gridSerializingSession;
        };
      }
      exportHeaders(params, columnsToExport) {
        return (gridSerializingSession) => {
          if (!params.skipColumnHeaders) {
            const gridRowIterator = gridSerializingSession.onNewHeaderRow();
            columnsToExport.forEach((column2, index) => {
              gridRowIterator.onColumn(column2, index, void 0);
            });
          }
          return gridSerializingSession;
        };
      }
      processPinnedTopRows(params, columnsToExport) {
        return (gridSerializingSession) => {
          const processRow = this.processRow.bind(this, gridSerializingSession, params, columnsToExport);
          if (params.rowPositions) {
            params.rowPositions.filter((position) => position.rowPinned === "top").sort((a, b) => a.rowIndex - b.rowIndex).map((position) => this.pinnedRowModel?.getPinnedTopRow(position.rowIndex)).forEach(processRow);
          } else if (!this.pinnedRowModel?.isManual()) {
            this.pinnedRowModel?.forEachPinnedRow("top", processRow);
          }
          return gridSerializingSession;
        };
      }
      processRows(params, columnsToExport) {
        return (gridSerializingSession) => {
          const rowModel = this.rowModel;
          const usingCsrm = _isClientSideRowModel(this.gos);
          const usingSsrm = _isServerSideRowModel(this.gos);
          const onlySelectedNonStandardModel = !usingCsrm && params.onlySelected;
          const processRow = this.processRow.bind(this, gridSerializingSession, params, columnsToExport);
          const { exportedRows = "filteredAndSorted" } = params;
          if (params.rowPositions) {
            params.rowPositions.filter((position) => position.rowPinned == null).sort((a, b) => a.rowIndex - b.rowIndex).map((position) => rowModel.getRow(position.rowIndex)).forEach(processRow);
          } else if (this.colModel.isPivotMode()) {
            if (usingCsrm) {
              rowModel.forEachPivotNode(processRow, true, exportedRows === "filteredAndSorted");
            } else if (usingSsrm) {
              rowModel.forEachNodeAfterFilterAndSort(processRow, true);
            } else {
              rowModel.forEachNode(processRow);
            }
          } else if (params.onlySelectedAllPages || onlySelectedNonStandardModel) {
            const selectedNodes = this.beans.selectionSvc?.getSelectedNodes() ?? [];
            this.replicateSortedOrder(selectedNodes);
            selectedNodes.forEach(processRow);
          } else if (exportedRows === "all") {
            rowModel.forEachNode(processRow);
          } else if (usingCsrm || usingSsrm) {
            rowModel.forEachNodeAfterFilterAndSort(processRow, true);
          } else {
            rowModel.forEachNode(processRow);
          }
          return gridSerializingSession;
        };
      }
      replicateSortedOrder(rows) {
        const { sortSvc, rowNodeSorter } = this.beans;
        if (!sortSvc || !rowNodeSorter) {
          return;
        }
        const sortOptions2 = sortSvc.getSortOptions();
        const compareNodes = (rowA, rowB) => {
          if (rowA.rowIndex != null && rowB.rowIndex != null) {
            return rowA.rowIndex - rowB.rowIndex;
          }
          if (rowA.level === rowB.level) {
            if (rowA.parent?.id === rowB.parent?.id) {
              return rowNodeSorter.compareRowNodes(
                sortOptions2,
                {
                  rowNode: rowA,
                  currentPos: rowA.rowIndex ?? -1
                },
                {
                  rowNode: rowB,
                  currentPos: rowB.rowIndex ?? -1
                }
              );
            }
            return compareNodes(rowA.parent, rowB.parent);
          }
          if (rowA.level > rowB.level) {
            return compareNodes(rowA.parent, rowB);
          }
          return compareNodes(rowA, rowB.parent);
        };
        rows.sort(compareNodes);
      }
      processPinnedBottomRows(params, columnsToExport) {
        return (gridSerializingSession) => {
          const processRow = this.processRow.bind(this, gridSerializingSession, params, columnsToExport);
          if (params.rowPositions) {
            params.rowPositions.filter((position) => position.rowPinned === "bottom").sort((a, b) => a.rowIndex - b.rowIndex).map((position) => this.pinnedRowModel?.getPinnedBottomRow(position.rowIndex)).forEach(processRow);
          } else if (!this.pinnedRowModel?.isManual()) {
            this.pinnedRowModel?.forEachPinnedRow("bottom", processRow);
          }
          return gridSerializingSession;
        };
      }
      getColumnsToExport(params) {
        const { allColumns = false, skipRowGroups = false, exportRowNumbers = false, columnKeys } = params;
        const { colModel, gos, visibleCols } = this;
        const isPivotMode = colModel.isPivotMode();
        const filterSpecialColumns = (col) => {
          if (isColumnSelectionCol(col)) {
            return false;
          }
          return !isRowNumberCol(col) || exportRowNumbers;
        };
        if (columnKeys?.length) {
          return colModel.getColsForKeys(columnKeys).filter(filterSpecialColumns);
        }
        const isTreeData = gos.get("treeData");
        let columnsToExport = [];
        if (allColumns && !isPivotMode) {
          columnsToExport = colModel.getCols();
        } else {
          columnsToExport = visibleCols.allCols;
        }
        columnsToExport = columnsToExport.filter(
          (column2) => filterSpecialColumns(column2) && (skipRowGroups && !isTreeData ? !isColumnGroupAutoCol(column2) : true)
        );
        return columnsToExport;
      }
      recursivelyAddHeaderGroups(displayedGroups, gridSerializingSession, processGroupHeaderCallback) {
        const directChildrenHeaderGroups = [];
        for (const columnGroupChild of displayedGroups) {
          const columnGroup = columnGroupChild;
          if (!columnGroup.getChildren) {
            continue;
          }
          for (const it2 of columnGroup.getChildren() ?? []) {
            directChildrenHeaderGroups.push(it2);
          }
        }
        if (displayedGroups.length > 0 && isColumnGroup(displayedGroups[0])) {
          this.doAddHeaderHeader(gridSerializingSession, displayedGroups, processGroupHeaderCallback);
        }
        if (directChildrenHeaderGroups && directChildrenHeaderGroups.length > 0) {
          this.recursivelyAddHeaderGroups(
            directChildrenHeaderGroups,
            gridSerializingSession,
            processGroupHeaderCallback
          );
        }
      }
      doAddHeaderHeader(gridSerializingSession, displayedGroups, processGroupHeaderCallback) {
        const gridRowIterator = gridSerializingSession.onNewHeaderGroupingRow();
        let columnIndex = 0;
        for (const columnGroupChild of displayedGroups) {
          const columnGroup = columnGroupChild;
          let name2;
          if (processGroupHeaderCallback) {
            name2 = processGroupHeaderCallback(
              _addGridCommonParams(this.gos, {
                columnGroup
              })
            );
          } else {
            name2 = this.beans.colNames.getDisplayNameForColumnGroup(columnGroup, "header");
          }
          const columnsToCalculateRange = columnGroup.isExpandable() ? columnGroup.getLeafColumns() : [];
          const collapsibleGroupRanges = columnsToCalculateRange.reduce(
            (collapsibleGroups, currentColumn, currentIdx, arr2) => {
              let lastGroup = _last(collapsibleGroups);
              const groupShow = currentColumn.getColumnGroupShow() === "open";
              if (!groupShow) {
                if (lastGroup && lastGroup[1] == null) {
                  lastGroup[1] = currentIdx - 1;
                }
              } else if (!lastGroup || lastGroup[1] != null) {
                lastGroup = [currentIdx];
                collapsibleGroups.push(lastGroup);
              }
              if (currentIdx === arr2.length - 1 && lastGroup && lastGroup[1] == null) {
                lastGroup[1] = currentIdx;
              }
              return collapsibleGroups;
            },
            []
          );
          gridRowIterator.onColumn(
            columnGroup,
            name2 || "",
            columnIndex++,
            columnGroup.getLeafColumns().length - 1,
            collapsibleGroupRanges
          );
        }
      }
    };
    var SharedExportModule = {
      moduleName: "SharedExport",
      version: VERSION,
      beans: [GridSerializer]
    };
    var LINE_SEPARATOR = "\r\n";
    var CsvSerializingSession = class extends BaseGridSerializingSession {
      constructor(config2) {
        super(config2);
        this.config = config2;
        this.isFirstLine = true;
        this.result = "";
        const { suppressQuotes, columnSeparator } = config2;
        this.suppressQuotes = suppressQuotes;
        this.columnSeparator = columnSeparator;
      }
      addCustomContent(content2) {
        if (!content2) {
          return;
        }
        if (typeof content2 === "string") {
          if (!/^\s*\n/.test(content2)) {
            this.beginNewLine();
          }
          content2 = content2.replace(/\r?\n/g, LINE_SEPARATOR);
          this.result += content2;
        } else {
          content2.forEach((row2) => {
            this.beginNewLine();
            row2.forEach((cell2, index) => {
              if (index !== 0) {
                this.result += this.columnSeparator;
              }
              this.result += this.putInQuotes(cell2.data.value || "");
              if (cell2.mergeAcross) {
                this.appendEmptyCells(cell2.mergeAcross);
              }
            });
          });
        }
      }
      onNewHeaderGroupingRow() {
        this.beginNewLine();
        return {
          onColumn: this.onNewHeaderGroupingRowColumn.bind(this)
        };
      }
      onNewHeaderGroupingRowColumn(columnGroup, header2, index, span) {
        if (index != 0) {
          this.result += this.columnSeparator;
        }
        this.result += this.putInQuotes(header2);
        this.appendEmptyCells(span);
      }
      appendEmptyCells(count) {
        for (let i2 = 1; i2 <= count; i2++) {
          this.result += this.columnSeparator + this.putInQuotes("");
        }
      }
      onNewHeaderRow() {
        this.beginNewLine();
        return {
          onColumn: this.onNewHeaderRowColumn.bind(this)
        };
      }
      onNewHeaderRowColumn(column2, index) {
        if (index != 0) {
          this.result += this.columnSeparator;
        }
        this.result += this.putInQuotes(this.extractHeaderValue(column2));
      }
      onNewBodyRow() {
        this.beginNewLine();
        return {
          onColumn: this.onNewBodyRowColumn.bind(this)
        };
      }
      onNewBodyRowColumn(column2, index, node2) {
        if (index != 0) {
          this.result += this.columnSeparator;
        }
        const rowCellValue = this.extractRowCellValue(column2, index, index, "csv", node2);
        this.result += this.putInQuotes(rowCellValue.valueFormatted ?? rowCellValue.value);
      }
      putInQuotes(value2) {
        if (this.suppressQuotes) {
          return value2;
        }
        if (value2 === null || value2 === void 0) {
          return '""';
        }
        let stringValue;
        if (typeof value2 === "string") {
          stringValue = value2;
        } else if (typeof value2.toString === "function") {
          stringValue = value2.toString();
        } else {
          _warn(53);
          stringValue = "";
        }
        const valueEscaped = stringValue.replace(/"/g, '""');
        return '"' + valueEscaped + '"';
      }
      parse() {
        return this.result;
      }
      beginNewLine() {
        if (!this.isFirstLine) {
          this.result += LINE_SEPARATOR;
        }
        this.isFirstLine = false;
      }
    };
    var CsvCreator = class extends BaseCreator {
      constructor() {
        super(...arguments);
        this.beanName = "csvCreator";
      }
      wireBeans(beans) {
        this.colModel = beans.colModel;
        this.colNames = beans.colNames;
        this.rowGroupColsSvc = beans.rowGroupColsSvc;
        this.valueSvc = beans.valueSvc;
      }
      getMergedParams(params) {
        const baseParams5 = this.gos.get("defaultCsvExportParams");
        return Object.assign({}, baseParams5, params);
      }
      export(userParams) {
        if (this.isExportSuppressed()) {
          _warn(51);
          return;
        }
        const mergedParams = this.getMergedParams(userParams);
        const data = this.getData(mergedParams);
        const packagedFile = new Blob(["\uFEFF", data], { type: "text/plain" });
        const fileName = typeof mergedParams.fileName === "function" ? mergedParams.fileName(_addGridCommonParams(this.gos, {})) : mergedParams.fileName;
        _downloadFile(this.getFileName(fileName), packagedFile);
      }
      exportDataAsCsv(params) {
        this.export(params);
      }
      getDataAsCsv(params, skipDefaultParams = false) {
        const mergedParams = skipDefaultParams ? Object.assign({}, params) : this.getMergedParams(params);
        return this.getData(mergedParams);
      }
      getDefaultFileExtension() {
        return "csv";
      }
      createSerializingSession(params) {
        const { colModel, colNames, rowGroupColsSvc, valueSvc, gos } = this;
        const {
          processCellCallback,
          processHeaderCallback,
          processGroupHeaderCallback,
          processRowGroupCallback,
          suppressQuotes,
          columnSeparator
        } = params;
        return new CsvSerializingSession({
          colModel,
          colNames,
          valueSvc,
          gos,
          processCellCallback: processCellCallback || void 0,
          processHeaderCallback: processHeaderCallback || void 0,
          processGroupHeaderCallback: processGroupHeaderCallback || void 0,
          processRowGroupCallback: processRowGroupCallback || void 0,
          suppressQuotes: suppressQuotes || false,
          columnSeparator: columnSeparator || ",",
          rowGroupColsSvc
        });
      }
      isExportSuppressed() {
        return this.gos.get("suppressCsvExport");
      }
    };
    function getDataAsCsv(beans, params) {
      return beans.csvCreator?.getDataAsCsv(params);
    }
    function exportDataAsCsv(beans, params) {
      beans.csvCreator?.exportDataAsCsv(params);
    }
    var CsvExportModule = {
      moduleName: "CsvExport",
      version: VERSION,
      beans: [CsvCreator],
      apiFunctions: {
        getDataAsCsv,
        exportDataAsCsv
      },
      dependsOn: [SharedExportModule]
    };
    var InfiniteBlock = class extends BeanStub {
      constructor(id, parentCache, params) {
        super();
        this.id = id;
        this.parentCache = parentCache;
        this.params = params;
        this.state = "needsLoading";
        this.version = 0;
        this.startRow = id * params.blockSize;
        this.endRow = this.startRow + params.blockSize;
      }
      load() {
        this.state = "loading";
        this.loadFromDatasource();
      }
      setStateWaitingToLoad() {
        this.version++;
        this.state = "needsLoading";
      }
      pageLoadFailed(version2) {
        const requestMostRecentAndLive = this.isRequestMostRecentAndLive(version2);
        if (requestMostRecentAndLive) {
          this.state = "failed";
        }
        this.dispatchLocalEvent({ type: "loadComplete" });
      }
      pageLoaded(version2, rows, lastRow) {
        this.successCommon(version2, { rowData: rows, rowCount: lastRow });
      }
      isRequestMostRecentAndLive(version2) {
        const thisIsMostRecentRequest = version2 === this.version;
        const weAreNotDestroyed = this.isAlive();
        return thisIsMostRecentRequest && weAreNotDestroyed;
      }
      successCommon(version2, params) {
        this.dispatchLocalEvent({ type: "loadComplete" });
        const requestMostRecentAndLive = this.isRequestMostRecentAndLive(version2);
        if (requestMostRecentAndLive) {
          this.state = "loaded";
          this.processServerResult(params);
        }
      }
      postConstruct() {
        this.rowNodes = [];
        const {
          params: { blockSize, rowHeight },
          startRow,
          beans,
          rowNodes
        } = this;
        for (let i2 = 0; i2 < blockSize; i2++) {
          const rowIndex = startRow + i2;
          const rowNode = new RowNode(beans);
          rowNode.setRowHeight(rowHeight);
          rowNode.uiLevel = 0;
          rowNode.setRowIndex(rowIndex);
          rowNode.setRowTop(rowHeight * rowIndex);
          rowNodes.push(rowNode);
        }
      }
      getBlockStateJson() {
        const { id, startRow, endRow, state: pageStatus } = this;
        return {
          id: "" + id,
          state: {
            blockNumber: id,
            startRow,
            endRow,
            pageStatus
          }
        };
      }
      setDataAndId(rowNode, data, index) {
        if (_exists(data)) {
          rowNode.setDataAndId(data, index.toString());
        } else {
          rowNode.setDataAndId(void 0, void 0);
        }
      }
      loadFromDatasource() {
        const params = this.createLoadParams();
        if (_missing(this.params.datasource.getRows)) {
          _warn(90);
          return;
        }
        window.setTimeout(() => {
          this.params.datasource.getRows(params);
        }, 0);
      }
      createLoadParams() {
        const {
          startRow,
          endRow,
          version: version2,
          params: { sortModel, filterModel },
          gos
        } = this;
        const params = {
          startRow,
          endRow,
          successCallback: this.pageLoaded.bind(this, version2),
          failCallback: this.pageLoadFailed.bind(this, version2),
          sortModel,
          filterModel,
          context: _addGridCommonParams(gos, {}).context
        };
        return params;
      }
      forEachNode(callback, sequence, rowCount) {
        this.rowNodes.forEach((rowNode, index) => {
          const rowIndex = this.startRow + index;
          if (rowIndex < rowCount) {
            callback(rowNode, sequence.value++);
          }
        });
      }
      getRow(rowIndex, dontTouchLastAccessed = false) {
        if (!dontTouchLastAccessed) {
          this.lastAccessed = this.params.lastAccessedSequence.value++;
        }
        const localIndex = rowIndex - this.startRow;
        return this.rowNodes[localIndex];
      }
      processServerResult(params) {
        const { rowNodes, beans } = this;
        rowNodes.forEach((rowNode, index) => {
          const data = params.rowData ? params.rowData[index] : void 0;
          if (!rowNode.id && rowNode.alreadyRendered && data) {
            rowNodes[index] = new RowNode(beans);
            rowNodes[index].setRowIndex(rowNode.rowIndex);
            rowNodes[index].setRowTop(rowNode.rowTop);
            rowNodes[index].setRowHeight(rowNode.rowHeight);
            rowNode.clearRowTopAndRowIndex();
          }
          this.setDataAndId(rowNodes[index], data, this.startRow + index);
        });
        const finalRowCount = params.rowCount != null && params.rowCount >= 0 ? params.rowCount : void 0;
        this.parentCache.pageLoaded(this, finalRowCount);
      }
      destroy() {
        for (const rowNode of this.rowNodes) {
          rowNode.clearRowTopAndRowIndex();
        }
        super.destroy();
      }
    };
    var MAX_EMPTY_BLOCKS_TO_KEEP = 2;
    var InfiniteCache = class extends BeanStub {
      constructor(params) {
        super();
        this.params = params;
        this.lastRowIndexKnown = false;
        this.blocks = {};
        this.blockCount = 0;
        this.rowCount = params.initialRowCount;
      }
      // the rowRenderer will not pass dontCreatePage, meaning when rendering the grid,
      // it will want new pages in the cache as it asks for rows. only when we are inserting /
      // removing rows via the api is dontCreatePage set, where we move rows between the pages.
      getRow(rowIndex, dontCreatePage = false) {
        const blockId = Math.floor(rowIndex / this.params.blockSize);
        let block2 = this.blocks[blockId];
        if (!block2) {
          if (dontCreatePage) {
            return void 0;
          }
          block2 = this.createBlock(blockId);
        }
        return block2.getRow(rowIndex);
      }
      createBlock(blockNumber) {
        const params = this.params;
        const newBlock = this.createBean(new InfiniteBlock(blockNumber, this, params));
        this.blocks[newBlock.id] = newBlock;
        this.blockCount++;
        this.purgeBlocksIfNeeded(newBlock);
        params.rowNodeBlockLoader.addBlock(newBlock);
        return newBlock;
      }
      // we have this on infinite row model only, not server side row model,
      // because for server side, it would leave the children in inconsistent
      // state - eg if a node had children, but after the refresh it had data
      // for a different row, then the children would be with the wrong row node.
      refreshCache() {
        const nothingToRefresh = this.blockCount == 0;
        if (nothingToRefresh) {
          this.purgeCache();
          return;
        }
        for (const block2 of this.getBlocksInOrder()) {
          block2.setStateWaitingToLoad();
        }
        this.params.rowNodeBlockLoader.checkBlockToLoad();
      }
      destroy() {
        for (const block2 of this.getBlocksInOrder()) {
          this.destroyBlock(block2);
        }
        super.destroy();
      }
      getRowCount() {
        return this.rowCount;
      }
      isLastRowIndexKnown() {
        return this.lastRowIndexKnown;
      }
      // block calls this, when page loaded
      pageLoaded(block2, lastRow) {
        if (!this.isAlive()) {
          return;
        }
        _logIfDebug(this.gos, `InfiniteCache - onPageLoaded: page = ${block2.id}, lastRow = ${lastRow}`);
        this.checkRowCount(block2, lastRow);
        this.onCacheUpdated();
      }
      purgeBlocksIfNeeded(blockToExclude) {
        const blocksForPurging = this.getBlocksInOrder().filter((b) => b != blockToExclude);
        const lastAccessedComparator = (a, b) => b.lastAccessed - a.lastAccessed;
        blocksForPurging.sort(lastAccessedComparator);
        const maxBlocksProvided = this.params.maxBlocksInCache > 0;
        const blocksToKeep = maxBlocksProvided ? this.params.maxBlocksInCache - 1 : null;
        const emptyBlocksToKeep = MAX_EMPTY_BLOCKS_TO_KEEP - 1;
        blocksForPurging.forEach((block2, index) => {
          const purgeBecauseBlockEmpty = block2.state === "needsLoading" && index >= emptyBlocksToKeep;
          const purgeBecauseCacheFull = maxBlocksProvided ? index >= blocksToKeep : false;
          if (purgeBecauseBlockEmpty || purgeBecauseCacheFull) {
            if (this.isBlockCurrentlyDisplayed(block2)) {
              return;
            }
            if (this.isBlockFocused(block2)) {
              return;
            }
            this.removeBlockFromCache(block2);
          }
        });
      }
      isBlockFocused(block2) {
        const focusedCell = this.beans.focusSvc.getFocusCellToUseAfterRefresh();
        if (!focusedCell) {
          return false;
        }
        if (focusedCell.rowPinned != null) {
          return false;
        }
        const { startRow, endRow } = block2;
        const hasFocus = focusedCell.rowIndex >= startRow && focusedCell.rowIndex < endRow;
        return hasFocus;
      }
      isBlockCurrentlyDisplayed(block2) {
        const { startRow, endRow } = block2;
        return this.beans.rowRenderer.isRangeInRenderedViewport(startRow, endRow - 1);
      }
      removeBlockFromCache(blockToRemove) {
        if (!blockToRemove) {
          return;
        }
        this.destroyBlock(blockToRemove);
      }
      checkRowCount(block2, lastRow) {
        if (typeof lastRow === "number" && lastRow >= 0) {
          this.rowCount = lastRow;
          this.lastRowIndexKnown = true;
        } else if (!this.lastRowIndexKnown) {
          const { blockSize, overflowSize } = this.params;
          const lastRowIndex = (block2.id + 1) * blockSize;
          const lastRowIndexPlusOverflow = lastRowIndex + overflowSize;
          if (this.rowCount < lastRowIndexPlusOverflow) {
            this.rowCount = lastRowIndexPlusOverflow;
          }
        }
      }
      setRowCount(rowCount, lastRowIndexKnown) {
        this.rowCount = rowCount;
        if (_exists(lastRowIndexKnown)) {
          this.lastRowIndexKnown = lastRowIndexKnown;
        }
        if (!this.lastRowIndexKnown) {
          if (this.rowCount % this.params.blockSize === 0) {
            this.rowCount++;
          }
        }
        this.onCacheUpdated();
      }
      forEachNodeDeep(callback) {
        const sequence = { value: 0 };
        for (const block2 of this.getBlocksInOrder()) {
          block2.forEachNode(callback, sequence, this.rowCount);
        }
      }
      getBlocksInOrder() {
        const blockComparator = (a, b) => a.id - b.id;
        const blocks = Object.values(this.blocks).sort(blockComparator);
        return blocks;
      }
      destroyBlock(block2) {
        delete this.blocks[block2.id];
        this.destroyBean(block2);
        this.blockCount--;
        this.params.rowNodeBlockLoader.removeBlock(block2);
      }
      // gets called 1) row count changed 2) cache purged 3) items inserted
      onCacheUpdated() {
        if (this.isAlive()) {
          this.destroyAllBlocksPastVirtualRowCount();
          this.eventSvc.dispatchEvent({
            type: "storeUpdated"
          });
        }
      }
      destroyAllBlocksPastVirtualRowCount() {
        const blocksToDestroy = [];
        for (const block2 of this.getBlocksInOrder()) {
          const startRow = block2.id * this.params.blockSize;
          if (startRow >= this.rowCount) {
            blocksToDestroy.push(block2);
          }
        }
        if (blocksToDestroy.length > 0) {
          for (const block2 of blocksToDestroy) {
            this.destroyBlock(block2);
          }
        }
      }
      purgeCache() {
        for (const block2 of this.getBlocksInOrder()) {
          this.removeBlockFromCache(block2);
        }
        this.lastRowIndexKnown = false;
        if (this.rowCount === 0) {
          this.rowCount = this.params.initialRowCount;
        }
        this.onCacheUpdated();
      }
      getRowNodesInRange(firstInRange, lastInRange) {
        const result2 = [];
        let lastBlockId = -1;
        let inActiveRange = false;
        const numberSequence = { value: 0 };
        let foundGapInSelection = false;
        for (const block2 of this.getBlocksInOrder()) {
          if (foundGapInSelection) {
            continue;
          }
          if (inActiveRange && lastBlockId + 1 !== block2.id) {
            foundGapInSelection = true;
            continue;
          }
          lastBlockId = block2.id;
          block2.forEachNode(
            (rowNode) => {
              const hitFirstOrLast = rowNode === firstInRange || rowNode === lastInRange;
              if (inActiveRange || hitFirstOrLast) {
                result2.push(rowNode);
              }
              if (hitFirstOrLast) {
                inActiveRange = !inActiveRange;
              }
            },
            numberSequence,
            this.rowCount
          );
        }
        const invalidRange = foundGapInSelection || inActiveRange;
        return invalidRange ? [] : result2;
      }
    };
    var InfiniteRowModel = class extends BeanStub {
      constructor() {
        super(...arguments);
        this.beanName = "rowModel";
        this.rootNode = null;
      }
      getRowBounds(index) {
        return {
          rowHeight: this.rowHeight,
          rowTop: this.rowHeight * index
        };
      }
      // we don't implement as lazy row heights is not supported in this row model
      ensureRowHeightsValid() {
        return false;
      }
      postConstruct() {
        if (this.gos.get("rowModelType") !== "infinite") {
          return;
        }
        const beans = this.beans;
        const rootNode = new RowNode(beans);
        this.rootNode = rootNode;
        rootNode.level = -1;
        this.rowHeight = _getRowHeightAsNumber(beans);
        this.addEventListeners();
        this.addDestroyFunc(() => this.destroyCache());
      }
      start() {
        this.setDatasource(this.gos.get("datasource"));
      }
      destroy() {
        this.destroyDatasource();
        super.destroy();
        this.rootNode = null;
      }
      destroyDatasource() {
        if (this.datasource) {
          this.destroyBean(this.datasource);
          this.beans.rowRenderer.datasourceChanged();
          this.datasource = null;
        }
      }
      addEventListeners() {
        this.addManagedEventListeners({
          filterChanged: this.reset.bind(this),
          sortChanged: this.reset.bind(this),
          newColumnsLoaded: this.onColumnEverything.bind(this),
          storeUpdated: this.dispatchModelUpdatedEvent.bind(this)
        });
        this.addManagedPropertyListener("datasource", () => this.setDatasource(this.gos.get("datasource")));
        this.addManagedPropertyListener("cacheBlockSize", () => this.resetCache());
        this.addManagedPropertyListener("rowHeight", () => {
          this.rowHeight = _getRowHeightAsNumber(this.beans);
          this.cacheParams.rowHeight = this.rowHeight;
          this.updateRowHeights();
        });
      }
      onColumnEverything() {
        let resetRequired;
        if (this.cacheParams) {
          resetRequired = !_jsonEquals(this.cacheParams.sortModel, this.beans.sortSvc?.getSortModel() ?? []);
        } else {
          resetRequired = true;
        }
        if (resetRequired) {
          this.reset();
        }
      }
      getType() {
        return "infinite";
      }
      setDatasource(datasource) {
        this.destroyDatasource();
        this.datasource = datasource;
        if (datasource) {
          this.reset();
        }
      }
      isEmpty() {
        return !this.infiniteCache;
      }
      isRowsToRender() {
        return !!this.infiniteCache;
      }
      getNodesInRangeForSelection(firstInRange, lastInRange) {
        return this.infiniteCache?.getRowNodesInRange(firstInRange, lastInRange) ?? [];
      }
      reset() {
        if (!this.datasource) {
          return;
        }
        const getRowIdFunc = _getRowIdCallback(this.gos);
        const userGeneratingIds = getRowIdFunc != null;
        if (!userGeneratingIds) {
          this.beans.selectionSvc?.reset("rowDataChanged");
        }
        this.resetCache();
      }
      dispatchModelUpdatedEvent() {
        this.eventSvc.dispatchEvent({
          type: "modelUpdated",
          // not sure if these should all be false - noticed if after implementing,
          // maybe they should be true?
          newPage: false,
          newPageSize: false,
          newData: false,
          keepRenderedRows: true,
          animate: false
        });
      }
      resetCache() {
        this.destroyCache();
        const beans = this.beans;
        const { filterManager, sortSvc, rowNodeBlockLoader, eventSvc, gos } = beans;
        this.cacheParams = {
          // the user provided datasource
          datasource: this.datasource,
          // sort and filter model
          filterModel: filterManager?.getFilterModel() ?? {},
          sortModel: sortSvc?.getSortModel() ?? [],
          rowNodeBlockLoader,
          // properties - this way we take a snapshot of them, so if user changes any, they will be
          // used next time we create a new cache, which is generally after a filter or sort change,
          // or a new datasource is set
          initialRowCount: gos.get("infiniteInitialRowCount"),
          maxBlocksInCache: gos.get("maxBlocksInCache"),
          rowHeight: _getRowHeightAsNumber(beans),
          // if user doesn't provide overflow, we use default overflow of 1, so user can scroll past
          // the current page and request first row of next page
          overflowSize: gos.get("cacheOverflowSize"),
          // page size needs to be 1 or greater. having it at 1 would be silly, as you would be hitting the
          // server for one page at a time. so the default if not specified is 100.
          blockSize: gos.get("cacheBlockSize"),
          // the cache could create this, however it is also used by the pages, so handy to create it
          // here as the settings are also passed to the pages
          lastAccessedSequence: { value: 0 }
        };
        this.infiniteCache = this.createBean(new InfiniteCache(this.cacheParams));
        eventSvc.dispatchEventOnce({
          type: "rowCountReady"
        });
        this.dispatchModelUpdatedEvent();
      }
      updateRowHeights() {
        this.forEachNode((node2) => {
          node2.setRowHeight(this.rowHeight);
          node2.setRowTop(this.rowHeight * node2.rowIndex);
        });
        this.dispatchModelUpdatedEvent();
      }
      destroyCache() {
        this.infiniteCache = this.destroyBean(this.infiniteCache);
      }
      getRow(rowIndex) {
        const infiniteCache = this.infiniteCache;
        if (!infiniteCache) {
          return void 0;
        }
        if (rowIndex >= infiniteCache.getRowCount()) {
          return void 0;
        }
        return infiniteCache.getRow(rowIndex);
      }
      getRowNode(id) {
        let result2;
        this.forEachNode((rowNode) => {
          if (rowNode.id === id) {
            result2 = rowNode;
          }
        });
        return result2;
      }
      forEachNode(callback) {
        this.infiniteCache?.forEachNodeDeep(callback);
      }
      getTopLevelRowCount() {
        return this.getRowCount();
      }
      getTopLevelRowDisplayedIndex(topLevelIndex) {
        return topLevelIndex;
      }
      getRowIndexAtPixel(pixel) {
        if (this.rowHeight !== 0) {
          const rowIndexForPixel = Math.floor(pixel / this.rowHeight);
          const lastRowIndex = this.getRowCount() - 1;
          if (rowIndexForPixel > lastRowIndex) {
            return lastRowIndex;
          }
          return rowIndexForPixel;
        }
        return 0;
      }
      getRowCount() {
        return this.infiniteCache ? this.infiniteCache.getRowCount() : 0;
      }
      isRowPresent(rowNode) {
        return !!this.getRowNode(rowNode.id);
      }
      refreshCache() {
        this.infiniteCache?.refreshCache();
      }
      purgeCache() {
        this.infiniteCache?.purgeCache();
      }
      // for iRowModel
      isLastRowIndexKnown() {
        return this.infiniteCache?.isLastRowIndexKnown() ?? false;
      }
      setRowCount(rowCount, lastRowIndexKnown) {
        this.infiniteCache?.setRowCount(rowCount, lastRowIndexKnown);
      }
      resetRowHeights() {
      }
      onRowHeightChanged() {
      }
    };
    function refreshInfiniteCache(beans) {
      _getInfiniteRowModel(beans)?.refreshCache();
    }
    function purgeInfiniteCache(beans) {
      _getInfiniteRowModel(beans)?.purgeCache();
    }
    function getInfiniteRowCount(beans) {
      return _getInfiniteRowModel(beans)?.getRowCount();
    }
    var RowNodeBlockLoader = class extends BeanStub {
      constructor() {
        super(...arguments);
        this.beanName = "rowNodeBlockLoader";
        this.activeBlockLoadsCount = 0;
        this.blocks = [];
        this.active = true;
      }
      postConstruct() {
        this.maxConcurrentRequests = _getMaxConcurrentDatasourceRequests(this.gos);
        const blockLoadDebounceMillis = this.gos.get("blockLoadDebounceMillis");
        if (blockLoadDebounceMillis && blockLoadDebounceMillis > 0) {
          this.checkBlockToLoadDebounce = _debounce(
            this,
            this.performCheckBlocksToLoad.bind(this),
            blockLoadDebounceMillis
          );
        }
      }
      addBlock(block2) {
        this.blocks.push(block2);
        block2.addEventListener("loadComplete", this.loadComplete.bind(this));
        this.checkBlockToLoad();
      }
      removeBlock(block2) {
        _removeFromArray(this.blocks, block2);
      }
      destroy() {
        super.destroy();
        this.active = false;
      }
      loadComplete() {
        this.activeBlockLoadsCount--;
        this.checkBlockToLoad();
      }
      checkBlockToLoad() {
        if (this.checkBlockToLoadDebounce) {
          this.checkBlockToLoadDebounce();
        } else {
          this.performCheckBlocksToLoad();
        }
      }
      performCheckBlocksToLoad() {
        if (!this.active) {
          return;
        }
        this.printCacheStatus();
        if (this.maxConcurrentRequests != null && this.activeBlockLoadsCount >= this.maxConcurrentRequests) {
          _logIfDebug(this.gos, `RowNodeBlockLoader - checkBlockToLoad: max loads exceeded`);
          return;
        }
        const loadAvailability = this.maxConcurrentRequests != null ? this.maxConcurrentRequests - this.activeBlockLoadsCount : 1;
        const blocksToLoad = this.blocks.filter((block2) => block2.state === "needsLoading").slice(0, loadAvailability);
        this.activeBlockLoadsCount += blocksToLoad.length;
        for (const block2 of blocksToLoad) {
          block2.load();
        }
        this.printCacheStatus();
      }
      getBlockState() {
        const result2 = {};
        this.blocks.forEach((block2) => {
          const { id, state } = block2.getBlockStateJson();
          result2[id] = state;
        });
        return result2;
      }
      printCacheStatus() {
        _logIfDebug(
          this.gos,
          `RowNodeBlockLoader - printCacheStatus: activePageLoadsCount = ${this.activeBlockLoadsCount}, blocks = ${JSON.stringify(this.getBlockState())}`
        );
      }
    };
    var InfiniteRowModelCoreModule = {
      moduleName: "InfiniteRowModelCore",
      version: VERSION,
      rowModels: ["infinite"],
      beans: [InfiniteRowModel, RowNodeBlockLoader]
    };
    var InfiniteRowModelModule = {
      moduleName: "InfiniteRowModel",
      version: VERSION,
      apiFunctions: {
        refreshInfiniteCache,
        purgeInfiniteCache,
        getInfiniteRowCount
      },
      dependsOn: [InfiniteRowModelCoreModule, SsrmInfiniteSharedApiModule]
    };
    var ARROW_UP = "↑";
    var ARROW_DOWN = "↓";
    var AnimateShowChangeCellRendererElement = {
      tag: "span",
      children: [
        { tag: "span", ref: "eDelta", cls: "ag-value-change-delta" },
        { tag: "span", ref: "eValue", cls: "ag-value-change-value" }
      ]
    };
    var AnimateShowChangeCellRenderer = class extends Component {
      constructor() {
        super(AnimateShowChangeCellRendererElement);
        this.eValue = RefPlaceholder;
        this.eDelta = RefPlaceholder;
        this.refreshCount = 0;
      }
      init(params) {
        this.refresh(params, true);
      }
      showDelta(params, delta2) {
        const absDelta = Math.abs(delta2);
        const valueFormatted = params.formatValue(absDelta);
        const valueToUse = _exists(valueFormatted) ? valueFormatted : absDelta;
        const deltaUp = delta2 >= 0;
        const eDelta = this.eDelta;
        if (deltaUp) {
          eDelta.textContent = ARROW_UP + valueToUse;
        } else {
          eDelta.textContent = ARROW_DOWN + valueToUse;
        }
        eDelta.classList.toggle("ag-value-change-delta-up", deltaUp);
        eDelta.classList.toggle("ag-value-change-delta-down", !deltaUp);
      }
      setTimerToRemoveDelta() {
        this.refreshCount++;
        const refreshCountCopy = this.refreshCount;
        this.beans.frameworkOverrides.wrapIncoming(() => {
          window.setTimeout(() => {
            if (refreshCountCopy === this.refreshCount) {
              this.hideDeltaValue();
            }
          }, 2e3);
        });
      }
      hideDeltaValue() {
        this.eValue.classList.remove("ag-value-change-value-highlight");
        _clearElement(this.eDelta);
      }
      refresh(params, isInitialRender = false) {
        const { value: value2, valueFormatted } = params;
        const { eValue, lastValue, beans } = this;
        if (value2 === lastValue) {
          return false;
        }
        if (_exists(valueFormatted)) {
          eValue.textContent = valueFormatted;
        } else if (_exists(value2)) {
          eValue.textContent = value2;
        } else {
          _clearElement(eValue);
        }
        if (beans.filterManager?.isSuppressFlashingCellsBecauseFiltering()) {
          return false;
        }
        const numericValue = value2 && typeof value2 === "object" && "toNumber" in value2 ? value2.toNumber() : value2;
        const numericLastValue = lastValue && typeof lastValue === "object" && "toNumber" in lastValue ? lastValue.toNumber() : lastValue;
        if (numericValue === numericLastValue) {
          return false;
        }
        if (typeof numericValue === "number" && typeof numericLastValue === "number") {
          const delta2 = numericValue - numericLastValue;
          this.showDelta(params, delta2);
        }
        if (lastValue) {
          eValue.classList.add("ag-value-change-value-highlight");
        }
        if (!isInitialRender) {
          this.setTimerToRemoveDelta();
        }
        this.lastValue = value2;
        return true;
      }
    };
    var animateSlideCellRendererCSS = (
      /*css*/
      `.ag-value-slide-out{opacity:1}:where(.ag-ltr) .ag-value-slide-out{margin-right:5px;transition:opacity 3s,margin-right 3s}:where(.ag-rtl) .ag-value-slide-out{margin-left:5px;transition:opacity 3s,margin-left 3s}:where(.ag-ltr,.ag-rtl) .ag-value-slide-out{transition-timing-function:linear}.ag-value-slide-out-end{opacity:0}:where(.ag-ltr) .ag-value-slide-out-end{margin-right:10px}:where(.ag-rtl) .ag-value-slide-out-end{margin-left:10px}`
    );
    var AnimateSlideCellRendererElement = {
      tag: "span",
      children: [{ tag: "span", ref: "eCurrent", cls: "ag-value-slide-current" }]
    };
    var AnimateSlideCellRenderer = class extends Component {
      constructor() {
        super(AnimateSlideCellRendererElement);
        this.eCurrent = RefPlaceholder;
        this.refreshCount = 0;
        this.registerCSS(animateSlideCellRendererCSS);
      }
      init(params) {
        this.refresh(params, true);
      }
      addSlideAnimation() {
        this.refreshCount++;
        const refreshCountCopy = this.refreshCount;
        this.ePrevious?.remove();
        const { beans, eCurrent } = this;
        const prevElement = _createElement({ tag: "span", cls: "ag-value-slide-previous ag-value-slide-out" });
        this.ePrevious = prevElement;
        prevElement.textContent = eCurrent.textContent;
        this.getGui().insertBefore(prevElement, eCurrent);
        beans.frameworkOverrides.wrapIncoming(() => {
          window.setTimeout(() => {
            if (refreshCountCopy !== this.refreshCount) {
              return;
            }
            this.ePrevious.classList.add("ag-value-slide-out-end");
          }, 50);
          window.setTimeout(() => {
            if (refreshCountCopy !== this.refreshCount) {
              return;
            }
            this.ePrevious?.remove();
            this.ePrevious = null;
          }, 3e3);
        });
      }
      refresh(params, isInitialRender = false) {
        let value2 = params.value;
        if (_missing(value2)) {
          value2 = "";
        }
        if (value2 === this.lastValue) {
          return false;
        }
        if (this.beans.filterManager?.isSuppressFlashingCellsBecauseFiltering()) {
          return false;
        }
        if (!isInitialRender) {
          this.addSlideAnimation();
        }
        this.lastValue = value2;
        const eCurrent = this.eCurrent;
        if (_exists(params.valueFormatted)) {
          eCurrent.textContent = params.valueFormatted;
        } else if (_exists(params.value)) {
          eCurrent.textContent = value2;
        } else {
          _clearElement(eCurrent);
        }
        return true;
      }
    };
    var CellFlashService = class extends BeanStub {
      constructor() {
        super(...arguments);
        this.beanName = "cellFlashSvc";
        this.nextAnimationTime = null;
        this.nextAnimationCycle = null;
        this.animations = {
          highlight: /* @__PURE__ */ new Map(),
          "data-changed": /* @__PURE__ */ new Map()
        };
      }
      animateCell(cellCtrl, cssName, flashDuration = this.beans.gos.get("cellFlashDuration"), fadeDuration = this.beans.gos.get("cellFadeDuration")) {
        const animations = this.animations[cssName];
        animations.delete(cellCtrl);
        const time = Date.now();
        const flashEndTime = time + flashDuration;
        const fadeEndTime = time + flashDuration + fadeDuration;
        const animState = {
          phase: "flash",
          flashEndTime,
          fadeEndTime
        };
        animations.set(cellCtrl, animState);
        const cssBase = `ag-cell-${cssName}`;
        const cssAnimation = `${cssBase}-animation`;
        const {
          comp: comp2,
          eGui: { style: style2 }
        } = cellCtrl;
        comp2.toggleCss(cssBase, true);
        comp2.toggleCss(cssAnimation, false);
        style2.removeProperty("transition");
        style2.removeProperty("transition-delay");
        if (this.nextAnimationTime && flashEndTime + 15 < this.nextAnimationTime) {
          clearTimeout(this.nextAnimationCycle);
          this.nextAnimationCycle = null;
          this.nextAnimationTime = null;
        }
        if (!this.nextAnimationCycle) {
          this.beans.frameworkOverrides.wrapIncoming(() => {
            this.nextAnimationCycle = setTimeout(this.advanceAnimations.bind(this), flashDuration);
          });
          this.nextAnimationTime = flashEndTime;
        }
      }
      advanceAnimations() {
        const time = Date.now();
        let nextAnimationTime = null;
        for (const cssName of Object.keys(this.animations)) {
          const animations = this.animations[cssName];
          const cssBase = `ag-cell-${cssName}`;
          const cssAnimation = `${cssBase}-animation`;
          for (const [cell2, animState] of animations) {
            if (!cell2.isAlive() || !cell2.comp) {
              animations.delete(cell2);
              continue;
            }
            const { phase, flashEndTime, fadeEndTime } = animState;
            const nextActionableTime = phase === "flash" ? flashEndTime : fadeEndTime;
            const requiresAction = time + 15 >= nextActionableTime;
            if (!requiresAction) {
              nextAnimationTime = Math.min(nextActionableTime, nextAnimationTime ?? Infinity);
              continue;
            }
            const {
              comp: comp2,
              eGui: { style: style2 }
            } = cell2;
            switch (phase) {
              case "flash":
                comp2.toggleCss(cssBase, false);
                comp2.toggleCss(cssAnimation, true);
                style2.transition = `background-color ${fadeEndTime - flashEndTime}ms`;
                style2.transitionDelay = `${flashEndTime - time}ms`;
                nextAnimationTime = Math.min(fadeEndTime, nextAnimationTime ?? Infinity);
                animState.phase = "fade";
                break;
              case "fade":
                comp2.toggleCss(cssBase, false);
                comp2.toggleCss(cssAnimation, false);
                style2.removeProperty("transition");
                style2.removeProperty("transition-delay");
                animations.delete(cell2);
                break;
            }
          }
        }
        if (nextAnimationTime == null) {
          this.nextAnimationTime = null;
          this.nextAnimationCycle = null;
        } else if (nextAnimationTime) {
          this.nextAnimationCycle = setTimeout(this.advanceAnimations.bind(this), nextAnimationTime - time);
          this.nextAnimationTime = nextAnimationTime;
        }
      }
      onFlashCells(cellCtrl, event) {
        if (!cellCtrl.comp) {
          return;
        }
        const cellId = _createCellId(cellCtrl.cellPosition);
        const shouldFlash = event.cells[cellId];
        if (shouldFlash) {
          this.animateCell(cellCtrl, "highlight");
        }
      }
      flashCell(cellCtrl, delays) {
        this.animateCell(cellCtrl, "data-changed", delays?.flashDuration, delays?.fadeDuration);
      }
      destroy() {
        for (const cssName of Object.keys(this.animations)) {
          const animations = this.animations[cssName];
          animations.clear();
        }
      }
    };
    function flashCells(beans, params = {}) {
      const { cellFlashSvc } = beans;
      if (!cellFlashSvc) {
        return;
      }
      beans.frameworkOverrides.wrapIncoming(() => {
        for (const cellCtrl of beans.rowRenderer.getCellCtrls(params.rowNodes, params.columns)) {
          cellFlashSvc.flashCell(cellCtrl, params);
        }
      });
    }
    var HighlightChangesModule = {
      moduleName: "HighlightChanges",
      version: VERSION,
      beans: [CellFlashService],
      userComponents: {
        agAnimateShowChangeCellRenderer: AnimateShowChangeCellRenderer,
        agAnimateSlideCellRenderer: AnimateSlideCellRenderer
      },
      apiFunctions: {
        flashCells
      }
    };
    function getState(beans) {
      return beans.stateSvc?.getState() ?? {};
    }
    function setState(beans, state, propertiesToIgnore) {
      return beans.stateSvc?.setState(state, propertiesToIgnore);
    }
    function migrateGridStateModel(state) {
      state = { ...state };
      if (!state.version) {
        state.version = "32.1.0";
      }
      if (state.version === "32.1.0") {
        state = migrateV32_1(state);
      }
      state.version = VERSION;
      return state;
    }
    function migrateV32_1(state) {
      state.cellSelection = jsonGet(state, "rangeSelection");
      return state;
    }
    function jsonGet(json, key2) {
      if (json && typeof json === "object") {
        return json[key2];
      }
    }
    var StateService = class extends BeanStub {
      constructor() {
        super(...arguments);
        this.beanName = "stateSvc";
        this.updateRowGroupExpansionStateTimer = 0;
        this.suppressEvents = true;
        this.queuedUpdateSources = /* @__PURE__ */ new Set();
        this.dispatchStateUpdateEventDebounced = _debounce(
          this,
          () => this.dispatchQueuedStateUpdateEvents(),
          0
        );
        this.onRowGroupOpenedDebounced = _debounce(
          this,
          () => {
            if (this.beans.gos.get("ssrmExpandAllAffectsAllRows")) {
              this.updateCachedState("ssrmRowGroupExpansion", this.getRowGroupExpansionState());
              this.updateCachedState("rowGroupExpansion", void 0);
            } else {
              this.updateCachedState("rowGroupExpansion", this.getRowGroupExpansionState());
              this.updateCachedState("ssrmRowGroupExpansion", void 0);
            }
          },
          0
        );
        this.onRowSelectedDebounced = _debounce(
          this,
          () => {
            this.staleStateKeys.delete("rowSelection");
            this.updateCachedState("rowSelection", this.getRowSelectionState());
          },
          0
        );
        this.staleStateKeys = /* @__PURE__ */ new Set();
      }
      postConstruct() {
        const { gos, ctrlsSvc, colDelayRenderSvc } = this.beans;
        this.isClientSideRowModel = _isClientSideRowModel(gos);
        const initialState2 = migrateGridStateModel(gos.get("initialState") ?? {});
        const partialColumnState = initialState2.partialColumnState;
        delete initialState2.partialColumnState;
        this.cachedState = initialState2;
        const suppressEventsAndDispatchInitEvent = this.suppressEventsAndDispatchInitEvent.bind(this);
        ctrlsSvc.whenReady(
          this,
          () => suppressEventsAndDispatchInitEvent(() => this.setupStateOnGridReady(initialState2))
        );
        if (initialState2.columnOrder || initialState2.columnVisibility || initialState2.columnSizing || initialState2.columnPinning || initialState2.columnGroup) {
          colDelayRenderSvc?.hideColumns("columnState");
        }
        const [newColumnsLoadedDestroyFunc, rowCountReadyDestroyFunc, firstDataRenderedDestroyFunc] = this.addManagedEventListeners({
          newColumnsLoaded: ({ source: source2 }) => {
            if (source2 === "gridInitializing") {
              newColumnsLoadedDestroyFunc();
              suppressEventsAndDispatchInitEvent(() => {
                this.setupStateOnColumnsInitialised(initialState2, !!partialColumnState);
                colDelayRenderSvc?.revealColumns("columnState");
              });
            }
          },
          rowCountReady: () => {
            rowCountReadyDestroyFunc?.();
            suppressEventsAndDispatchInitEvent(() => this.setupStateOnRowCountReady(initialState2));
          },
          firstDataRendered: () => {
            firstDataRenderedDestroyFunc?.();
            suppressEventsAndDispatchInitEvent(() => this.setupStateOnFirstDataRendered(initialState2));
          }
        });
      }
      destroy() {
        super.destroy();
        clearTimeout(this.updateRowGroupExpansionStateTimer);
        this.queuedUpdateSources.clear();
      }
      getState() {
        if (this.staleStateKeys.size) {
          this.refreshStaleState();
        }
        return this.cachedState;
      }
      setState(providedState, propertiesToIgnore) {
        const state = migrateGridStateModel(providedState);
        delete state.partialColumnState;
        this.cachedState = state;
        this.startSuppressEvents();
        const source2 = "api";
        const ignoreSet = propertiesToIgnore ? new Set(propertiesToIgnore) : void 0;
        this.setGridReadyState(state, source2, ignoreSet);
        this.setColumnsInitialisedState(state, source2, !!ignoreSet, ignoreSet);
        this.setRowCountState(state, source2, ignoreSet);
        setTimeout(() => {
          if (this.isAlive()) {
            this.setFirstDataRenderedState(state, source2, ignoreSet);
          }
          this.stopSuppressEvents(source2);
        });
      }
      setGridReadyState(state, source2, ignoreSet) {
        if (source2 === "api" && !ignoreSet?.has("sideBar")) {
          this.beans.sideBar?.comp?.setState(state.sideBar);
        }
        this.updateCachedState("sideBar", this.getSideBarState());
      }
      setupStateOnGridReady(initialState2) {
        this.setGridReadyState(initialState2, "gridInitializing");
        const stateUpdater = () => this.updateCachedState("sideBar", this.getSideBarState());
        this.addManagedEventListeners({
          toolPanelVisibleChanged: stateUpdater,
          sideBarUpdated: stateUpdater
        });
      }
      updateColumnAndGroupState() {
        this.updateColumnState([
          "aggregation",
          "columnOrder",
          "columnPinning",
          "columnSizing",
          "columnVisibility",
          "pivot",
          "rowGroup",
          "sort"
        ]);
        this.updateCachedState("columnGroup", this.getColumnGroupState());
      }
      setColumnsInitialisedState(state, source2, partialColumnState, ignoreSet) {
        this.setColumnState(state, source2, partialColumnState, ignoreSet);
        this.setColumnGroupState(state, source2, ignoreSet);
        this.updateColumnAndGroupState();
      }
      setupStateOnColumnsInitialised(initialState2, partialColumnState) {
        this.setColumnsInitialisedState(initialState2, "gridInitializing", partialColumnState);
        const onUpdate = (state) => () => this.updateColumnState([state]);
        this.addManagedEventListeners({
          columnValueChanged: onUpdate("aggregation"),
          columnMoved: onUpdate("columnOrder"),
          columnPinned: onUpdate("columnPinning"),
          columnResized: onUpdate("columnSizing"),
          columnVisible: onUpdate("columnVisibility"),
          columnPivotChanged: onUpdate("pivot"),
          columnPivotModeChanged: onUpdate("pivot"),
          columnRowGroupChanged: onUpdate("rowGroup"),
          sortChanged: onUpdate("sort"),
          newColumnsLoaded: this.updateColumnAndGroupState.bind(this),
          columnGroupOpened: () => this.updateCachedState("columnGroup", this.getColumnGroupState())
        });
      }
      setRowCountState(state, source2, ignoreSet) {
        const {
          filter: filterState2,
          rowGroupExpansion: rowGroupExpansionState,
          ssrmRowGroupExpansion,
          rowSelection: rowSelectionState,
          pagination: paginationState
        } = state;
        const shouldSetState = (prop2, propState) => !ignoreSet?.has(prop2) && (propState || source2 === "api");
        if (shouldSetState("filter", filterState2)) {
          this.setFilterState(filterState2);
        }
        if (shouldSetState("rowGroupExpansion", rowGroupExpansionState)) {
          this.setRowGroupExpansionState(ssrmRowGroupExpansion, rowGroupExpansionState, source2);
        }
        if (shouldSetState("rowSelection", rowSelectionState)) {
          this.setRowSelectionState(rowSelectionState, source2);
        }
        if (shouldSetState("pagination", paginationState)) {
          this.setPaginationState(paginationState, source2);
        }
        const updateCachedState = this.updateCachedState.bind(this);
        updateCachedState("filter", this.getFilterState());
        if (this.beans.gos.get("ssrmExpandAllAffectsAllRows")) {
          updateCachedState("ssrmRowGroupExpansion", this.getRowGroupExpansionState());
          updateCachedState("rowGroupExpansion", void 0);
        } else {
          updateCachedState("rowGroupExpansion", this.getRowGroupExpansionState());
          updateCachedState("ssrmRowGroupExpansion", void 0);
        }
        updateCachedState("rowSelection", this.getRowSelectionState());
        updateCachedState("pagination", this.getPaginationState());
      }
      setupStateOnRowCountReady(initialState2) {
        this.setRowCountState(initialState2, "gridInitializing");
        const updateCachedState = this.updateCachedState.bind(this);
        const updateRowGroupExpansionState = () => {
          this.updateRowGroupExpansionStateTimer = 0;
          if (this.beans.gos.get("ssrmExpandAllAffectsAllRows")) {
            updateCachedState("ssrmRowGroupExpansion", this.getRowGroupExpansionState());
            updateCachedState("rowGroupExpansion", void 0);
          } else {
            updateCachedState("rowGroupExpansion", this.getRowGroupExpansionState());
            updateCachedState("ssrmRowGroupExpansion", void 0);
          }
        };
        const updateFilterState = () => updateCachedState("filter", this.getFilterState());
        const { gos, colFilter } = this.beans;
        this.addManagedEventListeners({
          filterChanged: updateFilterState,
          rowExpansionStateChanged: this.onRowGroupOpenedDebounced,
          expandOrCollapseAll: updateRowGroupExpansionState,
          // `groupDefaultExpanded`/`isGroupOpenByDefault` updates expansion state without an expansion event
          columnRowGroupChanged: updateRowGroupExpansionState,
          rowDataUpdated: () => {
            if (gos.get("groupDefaultExpanded") !== 0 || gos.get("isGroupOpenByDefault")) {
              this.updateRowGroupExpansionStateTimer || (this.updateRowGroupExpansionStateTimer = setTimeout(updateRowGroupExpansionState));
            }
          },
          selectionChanged: () => {
            this.staleStateKeys.add("rowSelection");
            this.onRowSelectedDebounced();
          },
          paginationChanged: (event) => {
            if (event.newPage || event.newPageSize) {
              updateCachedState("pagination", this.getPaginationState());
            }
          }
        });
        if (colFilter) {
          this.addManagedListeners(colFilter, {
            filterStateChanged: updateFilterState
          });
        }
      }
      setFirstDataRenderedState(state, source2, ignoreSet) {
        const {
          scroll: scrollState,
          cellSelection: cellSelectionState,
          focusedCell: focusedCellState,
          columnOrder: columnOrderState,
          rowPinning
        } = state;
        const shouldSetState = (prop2, propState) => !ignoreSet?.has(prop2) && (propState || source2 === "api");
        if (shouldSetState("focusedCell", focusedCellState)) {
          this.setFocusedCellState(focusedCellState);
        }
        if (shouldSetState("cellSelection", cellSelectionState)) {
          this.setCellSelectionState(cellSelectionState);
        }
        if (shouldSetState("scroll", scrollState)) {
          this.setScrollState(scrollState);
        }
        if (shouldSetState("rowPinning", rowPinning)) {
          this.setRowPinningState(rowPinning);
        }
        this.setColumnPivotState(!!columnOrderState?.orderedColIds, source2);
        const updateCachedState = this.updateCachedState.bind(this);
        updateCachedState("sideBar", this.getSideBarState());
        updateCachedState("focusedCell", this.getFocusedCellState());
        const cellSelection = this.getRangeSelectionState();
        updateCachedState("rangeSelection", cellSelection);
        updateCachedState("cellSelection", cellSelection);
        updateCachedState("scroll", this.getScrollState());
      }
      setupStateOnFirstDataRendered(initialState2) {
        this.setFirstDataRenderedState(initialState2, "gridInitializing");
        const updateCachedState = this.updateCachedState.bind(this);
        const updateFocusState = () => updateCachedState("focusedCell", this.getFocusedCellState());
        this.addManagedEventListeners({
          cellFocused: updateFocusState,
          cellFocusCleared: updateFocusState,
          cellSelectionChanged: (event) => {
            if (event.finished) {
              const cellSelection = this.getRangeSelectionState();
              updateCachedState("rangeSelection", cellSelection);
              updateCachedState("cellSelection", cellSelection);
            }
          },
          bodyScrollEnd: () => updateCachedState("scroll", this.getScrollState()),
          pinnedRowsChanged: () => updateCachedState("rowPinning", this.getRowPinningState())
        });
      }
      getColumnState() {
        const beans = this.beans;
        return convertColumnState(_getColumnState(beans), beans.colModel.isPivotMode());
      }
      setColumnState(state, source2, partialColumnState, ignoreSet) {
        const {
          sort: sortState,
          rowGroup: groupState,
          aggregation: aggregationState,
          pivot: pivotState,
          columnPinning: columnPinningState,
          columnVisibility: columnVisibilityState,
          columnSizing: columnSizingState,
          columnOrder: columnOrderState
        } = state;
        let forceSetState = false;
        const shouldSetState = (prop2, propState) => {
          const shouldSet = !ignoreSet?.has(prop2) && !!(propState || source2 === "api");
          forceSetState || (forceSetState = shouldSet);
          return shouldSet;
        };
        const columnStateMap = {};
        const getColumnState2 = (colId) => {
          let columnState = columnStateMap[colId];
          if (columnState) {
            return columnState;
          }
          columnState = { colId };
          columnStateMap[colId] = columnState;
          return columnState;
        };
        const defaultState = {};
        const shouldSetSortState = shouldSetState("sort", sortState);
        if (shouldSetSortState) {
          sortState?.sortModel.forEach(({ colId, sort: sort2 }, sortIndex) => {
            const columnState = getColumnState2(colId);
            columnState.sort = sort2;
            columnState.sortIndex = sortIndex;
          });
        }
        if (shouldSetSortState || !partialColumnState) {
          defaultState.sort = null;
          defaultState.sortIndex = null;
        }
        const shouldSetGroupState = shouldSetState("rowGroup", groupState);
        if (shouldSetGroupState) {
          groupState?.groupColIds.forEach((colId, rowGroupIndex) => {
            const columnState = getColumnState2(colId);
            columnState.rowGroup = true;
            columnState.rowGroupIndex = rowGroupIndex;
          });
        }
        if (shouldSetGroupState || !partialColumnState) {
          defaultState.rowGroup = null;
          defaultState.rowGroupIndex = null;
        }
        const shouldSetAggregationState = shouldSetState("aggregation", aggregationState);
        if (shouldSetAggregationState) {
          aggregationState?.aggregationModel.forEach(({ colId, aggFunc }) => {
            getColumnState2(colId).aggFunc = aggFunc;
          });
        }
        if (shouldSetAggregationState || !partialColumnState) {
          defaultState.aggFunc = null;
        }
        const shouldSetPivotState = shouldSetState("pivot", pivotState);
        if (shouldSetPivotState) {
          pivotState?.pivotColIds.forEach((colId, pivotIndex) => {
            const columnState = getColumnState2(colId);
            columnState.pivot = true;
            columnState.pivotIndex = pivotIndex;
          });
          this.gos.updateGridOptions({
            options: { pivotMode: !!pivotState?.pivotMode },
            source: source2
          });
        }
        if (shouldSetPivotState || !partialColumnState) {
          defaultState.pivot = null;
          defaultState.pivotIndex = null;
        }
        const shouldSetColumnPinningState = shouldSetState("columnPinning", columnPinningState);
        if (shouldSetColumnPinningState) {
          for (const colId of columnPinningState?.leftColIds ?? []) {
            getColumnState2(colId).pinned = "left";
          }
          for (const colId of columnPinningState?.rightColIds ?? []) {
            getColumnState2(colId).pinned = "right";
          }
        }
        if (shouldSetColumnPinningState || !partialColumnState) {
          defaultState.pinned = null;
        }
        const shouldSetColumnVisibilityState = shouldSetState("columnVisibility", columnVisibilityState);
        if (shouldSetColumnVisibilityState) {
          for (const colId of columnVisibilityState?.hiddenColIds ?? []) {
            getColumnState2(colId).hide = true;
          }
        }
        if (shouldSetColumnVisibilityState || !partialColumnState) {
          defaultState.hide = null;
        }
        const shouldSetColumnSizingState = shouldSetState("columnSizing", columnSizingState);
        if (shouldSetColumnSizingState) {
          for (const { colId, flex: flex2, width } of columnSizingState?.columnSizingModel ?? []) {
            const columnState = getColumnState2(colId);
            columnState.flex = flex2 ?? null;
            columnState.width = width;
          }
        }
        if (shouldSetColumnSizingState || !partialColumnState) {
          defaultState.flex = null;
        }
        const columns = columnOrderState?.orderedColIds;
        const applyOrder = !!columns?.length && !ignoreSet?.has("columnOrder");
        const columnStates = applyOrder ? columns.map((colId) => getColumnState2(colId)) : Object.values(columnStateMap);
        if (columnStates.length || forceSetState) {
          this.columnStates = columnStates;
          _applyColumnState(
            this.beans,
            {
              state: columnStates,
              applyOrder,
              defaultState
            },
            source2
          );
        }
      }
      setColumnPivotState(applyOrder, source2) {
        const columnStates = this.columnStates;
        this.columnStates = void 0;
        const columnGroupStates = this.columnGroupStates;
        this.columnGroupStates = void 0;
        const beans = this.beans;
        const { pivotResultCols, colGroupSvc } = beans;
        if (!pivotResultCols?.isPivotResultColsPresent()) {
          return;
        }
        if (columnStates) {
          const secondaryColumnStates = [];
          for (const columnState of columnStates) {
            if (pivotResultCols.getPivotResultCol(columnState.colId)) {
              secondaryColumnStates.push(columnState);
            }
          }
          _applyColumnState(
            beans,
            {
              state: secondaryColumnStates,
              applyOrder
            },
            source2
          );
        }
        if (columnGroupStates) {
          colGroupSvc?.setColumnGroupState(columnGroupStates, source2);
        }
      }
      getColumnGroupState() {
        const colGroupSvc = this.beans.colGroupSvc;
        if (!colGroupSvc) {
          return void 0;
        }
        const columnGroupState = colGroupSvc.getColumnGroupState();
        return _convertColumnGroupState(columnGroupState);
      }
      setColumnGroupState(state, source2, ignoreSet) {
        const colGroupSvc = this.beans.colGroupSvc;
        if (!colGroupSvc || ignoreSet?.has("columnGroup") || source2 !== "api" && !Object.prototype.hasOwnProperty.call(state, "columnGroup")) {
          return;
        }
        const openColumnGroups = new Set(state.columnGroup?.openColumnGroupIds);
        const existingColumnGroupState = colGroupSvc.getColumnGroupState();
        const stateItems = existingColumnGroupState.map(({ groupId }) => {
          const open = openColumnGroups.has(groupId);
          if (open) {
            openColumnGroups.delete(groupId);
          }
          return {
            groupId,
            open
          };
        });
        for (const groupId of openColumnGroups) {
          stateItems.push({
            groupId,
            open: true
          });
        }
        if (stateItems.length) {
          this.columnGroupStates = stateItems;
        }
        colGroupSvc.setColumnGroupState(stateItems, source2);
      }
      getFilterState() {
        const filterManager = this.beans.filterManager;
        let filterModel = filterManager?.getFilterModel();
        if (filterModel && Object.keys(filterModel).length === 0) {
          filterModel = void 0;
        }
        const columnFilterState = filterManager?.getFilterState();
        const advancedFilterModel = filterManager?.getAdvFilterModel() ?? void 0;
        return filterModel || advancedFilterModel || columnFilterState ? { filterModel, columnFilterState, advancedFilterModel } : void 0;
      }
      setFilterState(filterState2) {
        const filterManager = this.beans.filterManager;
        const { filterModel, columnFilterState, advancedFilterModel } = filterState2 ?? {
          filterModel: null,
          columnFilterState: null,
          advancedFilterModel: null
        };
        if (filterModel !== void 0 || columnFilterState !== void 0) {
          filterManager?.setFilterState(filterModel ?? null, columnFilterState ?? null, "columnFilter");
        }
        if (advancedFilterModel !== void 0) {
          filterManager?.setAdvFilterModel(advancedFilterModel ?? null, "advancedFilter");
        }
      }
      getRangeSelectionState() {
        const cellRanges = this.beans.rangeSvc?.getCellRanges().map((cellRange) => {
          const { id, type, startRow, endRow, columns, startColumn } = cellRange;
          return {
            id,
            type,
            startRow,
            endRow,
            colIds: columns.map((column2) => column2.getColId()),
            startColId: startColumn.getColId()
          };
        });
        return cellRanges?.length ? { cellRanges } : void 0;
      }
      setCellSelectionState(cellSelectionState) {
        const { gos, rangeSvc, colModel, visibleCols } = this.beans;
        if (!_isCellSelectionEnabled(gos) || !rangeSvc) {
          return;
        }
        const cellRanges = [];
        for (const cellRange of cellSelectionState?.cellRanges ?? []) {
          const columns = [];
          for (const colId of cellRange.colIds) {
            const column2 = colModel.getCol(colId);
            if (column2) {
              columns.push(column2);
            }
          }
          if (!columns.length) {
            continue;
          }
          let startColumn = colModel.getCol(cellRange.startColId);
          if (!startColumn) {
            const allColumns = visibleCols.allCols;
            const columnSet = new Set(columns);
            startColumn = allColumns.find((column2) => columnSet.has(column2));
          }
          cellRanges.push({
            ...cellRange,
            columns,
            startColumn
          });
        }
        rangeSvc.setCellRanges(cellRanges);
      }
      getScrollState() {
        if (!this.isClientSideRowModel) {
          return void 0;
        }
        const scrollFeature = this.beans.ctrlsSvc.getScrollFeature();
        const { left: left2 } = scrollFeature?.getHScrollPosition() ?? { left: 0 };
        const { top: top2 } = scrollFeature?.getVScrollPosition() ?? { top: 0 };
        return top2 || left2 ? {
          top: top2,
          left: left2
        } : void 0;
      }
      setScrollState(scrollState) {
        if (!this.isClientSideRowModel) {
          return;
        }
        const { top: top2, left: left2 } = scrollState ?? { top: 0, left: 0 };
        const { frameworkOverrides, rowRenderer, animationFrameSvc, ctrlsSvc } = this.beans;
        frameworkOverrides.wrapIncoming(() => {
          ctrlsSvc.get("center").setCenterViewportScrollLeft(left2);
          ctrlsSvc.getScrollFeature()?.setVerticalScrollPosition(top2);
          rowRenderer.redraw({ afterScroll: true });
          animationFrameSvc?.flushAllFrames();
        });
      }
      getSideBarState() {
        return this.beans.sideBar?.comp?.getState();
      }
      getFocusedCellState() {
        if (!this.isClientSideRowModel) {
          return void 0;
        }
        const focusedCell = this.beans.focusSvc.getFocusedCell();
        if (focusedCell) {
          const { column: column2, rowIndex, rowPinned } = focusedCell;
          return {
            colId: column2.getColId(),
            rowIndex,
            rowPinned
          };
        }
        return void 0;
      }
      setFocusedCellState(focusedCellState) {
        if (!this.isClientSideRowModel) {
          return;
        }
        const { focusSvc, colModel } = this.beans;
        if (!focusedCellState) {
          focusSvc.clearFocusedCell();
          return;
        }
        const { colId, rowIndex, rowPinned } = focusedCellState;
        focusSvc.setFocusedCell({
          column: colModel.getCol(colId),
          rowIndex,
          rowPinned,
          forceBrowserFocus: true,
          preventScrollOnBrowserFocus: true
        });
      }
      getPaginationState() {
        const { pagination, gos } = this.beans;
        if (!pagination) {
          return void 0;
        }
        const page = pagination.getCurrentPage();
        const pageSize = !gos.get("paginationAutoPageSize") ? pagination.getPageSize() : void 0;
        if (!page && !pageSize) {
          return;
        }
        return { page, pageSize };
      }
      setPaginationState(paginationState, source2) {
        const { pagination, gos } = this.beans;
        if (!pagination) {
          return;
        }
        const { pageSize, page } = paginationState ?? { page: 0, pageSize: gos.get("paginationPageSize") };
        const isInit = source2 === "gridInitializing";
        if (pageSize && !gos.get("paginationAutoPageSize")) {
          pagination.setPageSize(pageSize, isInit ? "initialState" : "pageSizeSelector");
        }
        if (typeof page === "number") {
          if (isInit) {
            pagination.setPage(page);
          } else {
            pagination.goToPage(page);
          }
        }
      }
      getRowSelectionState() {
        const selectionSvc = this.beans.selectionSvc;
        if (!selectionSvc) {
          return void 0;
        }
        const selectionState = selectionSvc.getSelectionState();
        const noSelections = !selectionState || !Array.isArray(selectionState) && (selectionState.selectAll === false || selectionState.selectAllChildren === false) && !selectionState?.toggledNodes?.length;
        return noSelections ? void 0 : selectionState;
      }
      setRowSelectionState(rowSelectionState, source2) {
        this.beans.selectionSvc?.setSelectionState(rowSelectionState, source2, source2 === "api");
      }
      getRowGroupExpansionState() {
        const { expansionSvc } = this.beans;
        if (!expansionSvc) {
          return void 0;
        }
        return expansionSvc.getExpansionState();
      }
      getRowPinningState() {
        return this.beans.pinnedRowModel?.getPinnedState();
      }
      setRowPinningState(state) {
        const pinnedRowModel = this.beans.pinnedRowModel;
        if (state) {
          pinnedRowModel?.setPinnedState(state);
        } else {
          pinnedRowModel?.reset();
        }
      }
      setRowGroupExpansionState(ssrmRowGroupExpansionState, rowGroupExpansionState, source2) {
        const expansionSvc = this.beans.expansionSvc;
        if (!expansionSvc) {
          return;
        }
        const newExpansionState = rowGroupExpansionState ?? { expandedRowGroupIds: [], collapsedRowGroupIds: [] };
        expansionSvc.setExpansionState(newExpansionState, source2);
      }
      updateColumnState(features) {
        const newColumnState = this.getColumnState();
        let hasChanged = false;
        const cachedState = this.cachedState;
        for (const key2 of Object.keys(newColumnState)) {
          const value2 = newColumnState[key2];
          if (!_jsonEquals(value2, cachedState[key2])) {
            hasChanged = true;
          }
        }
        this.cachedState = {
          ...cachedState,
          ...newColumnState
        };
        if (hasChanged) {
          this.dispatchStateUpdateEvent(features);
        }
      }
      updateCachedState(key2, value2) {
        const existingValue = this.cachedState[key2];
        this.setCachedStateValue(key2, value2);
        if (!_jsonEquals(value2, existingValue)) {
          this.dispatchStateUpdateEvent([key2]);
        }
      }
      setCachedStateValue(key2, value2) {
        this.cachedState = {
          ...this.cachedState,
          [key2]: value2
        };
      }
      refreshStaleState() {
        const staleStateKeys = this.staleStateKeys;
        for (const key2 of staleStateKeys) {
          if (key2 === "rowSelection") {
            this.setCachedStateValue(key2, this.getRowSelectionState());
          }
        }
        staleStateKeys.clear();
      }
      dispatchStateUpdateEvent(sources) {
        if (this.suppressEvents) {
          return;
        }
        for (const source2 of sources) {
          this.queuedUpdateSources.add(source2);
        }
        this.dispatchStateUpdateEventDebounced();
      }
      dispatchQueuedStateUpdateEvents() {
        const queuedUpdateSources = this.queuedUpdateSources;
        const sources = Array.from(queuedUpdateSources);
        queuedUpdateSources.clear();
        this.eventSvc.dispatchEvent({
          type: "stateUpdated",
          sources,
          state: this.cachedState
        });
      }
      startSuppressEvents() {
        this.suppressEvents = true;
        this.beans.colAnimation?.setSuppressAnimation(true);
      }
      stopSuppressEvents(source2) {
        setTimeout(() => {
          this.suppressEvents = false;
          this.queuedUpdateSources.clear();
          if (!this.isAlive()) {
            return;
          }
          this.beans.colAnimation?.setSuppressAnimation(false);
          this.dispatchStateUpdateEvent([source2]);
        });
      }
      suppressEventsAndDispatchInitEvent(updateFunc) {
        this.startSuppressEvents();
        updateFunc();
        this.stopSuppressEvents("gridInitializing");
      }
    };
    var GridStateModule = {
      moduleName: "GridState",
      version: VERSION,
      beans: [StateService],
      apiFunctions: {
        getState,
        setState
      }
    };
    function paginationIsLastPageFound(beans) {
      return beans.rowModel.isLastRowIndexKnown();
    }
    function paginationGetPageSize(beans) {
      return beans.pagination?.getPageSize() ?? 100;
    }
    function paginationGetCurrentPage(beans) {
      return beans.pagination?.getCurrentPage() ?? 0;
    }
    function paginationGetTotalPages(beans) {
      return beans.pagination?.getTotalPages() ?? 1;
    }
    function paginationGetRowCount(beans) {
      return beans.pagination ? beans.pagination.getMasterRowCount() : beans.rowModel.getRowCount();
    }
    function paginationGoToNextPage(beans) {
      beans.pagination?.goToNextPage();
    }
    function paginationGoToPreviousPage(beans) {
      beans.pagination?.goToPreviousPage();
    }
    function paginationGoToFirstPage(beans) {
      beans.pagination?.goToFirstPage();
    }
    function paginationGoToLastPage(beans) {
      beans.pagination?.goToLastPage();
    }
    function paginationGoToPage(beans, page) {
      beans.pagination?.goToPage(page);
    }
    var PaginationAutoPageSizeService = class extends BeanStub {
      constructor() {
        super(...arguments);
        this.beanName = "paginationAutoPageSizeSvc";
      }
      postConstruct() {
        this.beans.ctrlsSvc.whenReady(this, (p) => {
          this.centerRowsCtrl = p.center;
          const listener = this.checkPageSize.bind(this);
          this.addManagedEventListeners({
            bodyHeightChanged: listener,
            scrollVisibilityChanged: listener
          });
          this.addManagedPropertyListener("paginationAutoPageSize", this.onPaginationAutoSizeChanged.bind(this));
          this.checkPageSize();
        });
      }
      notActive() {
        return !this.gos.get("paginationAutoPageSize") || this.centerRowsCtrl == null;
      }
      onPaginationAutoSizeChanged() {
        if (this.notActive()) {
          this.beans.pagination.unsetAutoCalculatedPageSize();
        } else {
          this.checkPageSize();
        }
      }
      checkPageSize() {
        if (this.notActive()) {
          return;
        }
        const bodyHeight = this.centerRowsCtrl.viewportSizeFeature.getBodyHeight();
        if (bodyHeight > 0) {
          const beans = this.beans;
          const update = () => {
            const rowHeight = Math.max(_getRowHeightAsNumber(beans), 1);
            const newPageSize = Math.floor(bodyHeight / rowHeight);
            beans.pagination.setPageSize(newPageSize, "autoCalculated");
          };
          if (!this.isBodyRendered) {
            update();
            this.isBodyRendered = true;
          } else {
            _debounce(this, update, 50)();
          }
        } else {
          this.isBodyRendered = false;
        }
      }
    };
    var paginationPageSizeSelector = "paginationPageSizeSelector";
    var PageSizeSelectorCompElement = { tag: "span", cls: "ag-paging-page-size" };
    var PageSizeSelectorComp = class extends Component {
      constructor() {
        super(PageSizeSelectorCompElement);
        this.hasEmptyOption = false;
        this.handlePageSizeItemSelected = () => {
          if (!this.selectPageSizeComp) {
            return;
          }
          const newValue = this.selectPageSizeComp.getValue();
          if (!newValue) {
            return;
          }
          const paginationPageSize = Number(newValue);
          if (isNaN(paginationPageSize) || paginationPageSize < 1 || paginationPageSize === this.pagination.getPageSize()) {
            return;
          }
          this.pagination.setPageSize(paginationPageSize, "pageSizeSelector");
          if (this.hasEmptyOption) {
            this.toggleSelectDisplay(true);
          }
          this.selectPageSizeComp.getFocusableElement().focus();
        };
      }
      wireBeans(beans) {
        this.pagination = beans.pagination;
      }
      postConstruct() {
        this.addManagedPropertyListener(paginationPageSizeSelector, () => {
          this.onPageSizeSelectorValuesChange();
        });
        this.addManagedEventListeners({ paginationChanged: (event) => this.handlePaginationChanged(event) });
      }
      handlePaginationChanged(paginationChangedEvent) {
        if (!this.selectPageSizeComp || !paginationChangedEvent?.newPageSize) {
          return;
        }
        const paginationPageSize = this.pagination.getPageSize();
        if (this.getPageSizeSelectorValues().includes(paginationPageSize)) {
          this.selectPageSizeComp.setValue(paginationPageSize.toString());
        } else if (this.hasEmptyOption) {
          this.selectPageSizeComp.setValue("");
        } else {
          this.toggleSelectDisplay(true);
        }
      }
      toggleSelectDisplay(show) {
        if (this.selectPageSizeComp && !show) {
          this.reset();
        }
        if (!show) {
          return;
        }
        this.reloadPageSizesSelector();
        if (!this.selectPageSizeComp) {
          return;
        }
      }
      reset() {
        _clearElement(this.getGui());
        if (!this.selectPageSizeComp) {
          return;
        }
        this.selectPageSizeComp = this.destroyBean(this.selectPageSizeComp);
      }
      onPageSizeSelectorValuesChange() {
        if (!this.selectPageSizeComp) {
          return;
        }
        if (this.shouldShowPageSizeSelector()) {
          this.reloadPageSizesSelector();
        }
      }
      shouldShowPageSizeSelector() {
        return this.gos.get("pagination") && !this.gos.get("suppressPaginationPanel") && !this.gos.get("paginationAutoPageSize") && this.gos.get(paginationPageSizeSelector) !== false;
      }
      reloadPageSizesSelector() {
        const pageSizeOptions = this.getPageSizeSelectorValues();
        const paginationPageSizeOption = this.pagination.getPageSize();
        const shouldAddAndSelectEmptyOption = !paginationPageSizeOption || !pageSizeOptions.includes(paginationPageSizeOption);
        if (shouldAddAndSelectEmptyOption) {
          const pageSizeSet = this.gos.exists("paginationPageSize");
          const pageSizesSet = this.gos.get(paginationPageSizeSelector) !== true;
          _warn(94, { pageSizeSet, pageSizesSet, pageSizeOptions, paginationPageSizeOption });
          if (!pageSizesSet) {
            _warn(95, { paginationPageSizeOption, paginationPageSizeSelector });
          }
          pageSizeOptions.unshift("");
        }
        const value2 = String(shouldAddAndSelectEmptyOption ? "" : paginationPageSizeOption);
        if (this.selectPageSizeComp) {
          if (!_areEqual(this.pageSizeOptions, pageSizeOptions)) {
            this.selectPageSizeComp.clearOptions().addOptions(this.createPageSizeSelectOptions(pageSizeOptions));
            this.pageSizeOptions = pageSizeOptions;
          }
          this.selectPageSizeComp.setValue(value2, true);
        } else {
          this.createPageSizeSelectorComp(pageSizeOptions, value2);
        }
        this.hasEmptyOption = shouldAddAndSelectEmptyOption;
      }
      createPageSizeSelectOptions(pageSizeOptions) {
        return pageSizeOptions.map((value2) => ({
          value: String(value2)
        }));
      }
      createPageSizeSelectorComp(pageSizeOptions, value2) {
        const localeTextFunc = this.getLocaleTextFunc();
        const localisedLabel = localeTextFunc("pageSizeSelectorLabel", "Page Size:");
        const localisedAriaLabel = localeTextFunc("ariaPageSizeSelectorLabel", "Page Size");
        this.selectPageSizeComp = this.createManagedBean(new AgSelect()).addOptions(this.createPageSizeSelectOptions(pageSizeOptions)).setValue(value2).setAriaLabel(localisedAriaLabel).setLabel(localisedLabel).onValueChange(() => this.handlePageSizeItemSelected());
        this.appendChild(this.selectPageSizeComp);
      }
      getPageSizeSelectorValues() {
        const defaultValues = [20, 50, 100];
        const paginationPageSizeSelectorValues = this.gos.get(paginationPageSizeSelector);
        if (!Array.isArray(paginationPageSizeSelectorValues) || !paginationPageSizeSelectorValues?.length) {
          return defaultValues;
        }
        return [...paginationPageSizeSelectorValues].sort((a, b) => a - b);
      }
      destroy() {
        this.toggleSelectDisplay(false);
        super.destroy();
      }
    };
    var PageSizeSelectorSelector = {
      selector: "AG-PAGE-SIZE-SELECTOR",
      component: PageSizeSelectorComp
    };
    var paginationCompCSS = (
      /*css*/
      `.ag-paging-panel{align-items:center;border-top:var(--ag-footer-row-border);display:flex;gap:calc(var(--ag-spacing)*4);height:var(--ag-pagination-panel-height);justify-content:flex-end;padding:0 var(--ag-cell-horizontal-padding)}:where(.ag-paging-page-size) .ag-wrapper{min-width:50px}.ag-paging-page-summary-panel{align-items:center;display:flex;gap:var(--ag-cell-widget-spacing);.ag-disabled &{pointer-events:none}}.ag-paging-button{cursor:pointer;position:relative;&.ag-disabled{cursor:default;opacity:.5}}.ag-paging-number,.ag-paging-row-summary-panel-number{font-weight:500}`
    );
    var PaginationComp = class extends TabGuardComp$1 {
      constructor() {
        super();
        this.btFirst = RefPlaceholder;
        this.btPrevious = RefPlaceholder;
        this.btNext = RefPlaceholder;
        this.btLast = RefPlaceholder;
        this.lbRecordCount = RefPlaceholder;
        this.lbFirstRowOnPage = RefPlaceholder;
        this.lbLastRowOnPage = RefPlaceholder;
        this.lbCurrent = RefPlaceholder;
        this.lbTotal = RefPlaceholder;
        this.pageSizeComp = RefPlaceholder;
        this.previousAndFirstButtonsDisabled = false;
        this.nextButtonDisabled = false;
        this.lastButtonDisabled = false;
        this.areListenersSetup = false;
        this.allowFocusInnerElement = false;
        this.registerCSS(paginationCompCSS);
      }
      wireBeans(beans) {
        this.rowModel = beans.rowModel;
        this.pagination = beans.pagination;
        this.ariaAnnounce = beans.ariaAnnounce;
      }
      postConstruct() {
        const isRtl = this.gos.get("enableRtl");
        this.setTemplate(this.getTemplate(), [PageSizeSelectorSelector]);
        const { btFirst, btPrevious, btNext, btLast } = this;
        this.activateTabIndex([btFirst, btPrevious, btNext, btLast]);
        btFirst.insertAdjacentElement("afterbegin", _createIconNoSpan(isRtl ? "last" : "first", this.beans));
        btPrevious.insertAdjacentElement("afterbegin", _createIconNoSpan(isRtl ? "next" : "previous", this.beans));
        btNext.insertAdjacentElement("afterbegin", _createIconNoSpan(isRtl ? "previous" : "next", this.beans));
        btLast.insertAdjacentElement("afterbegin", _createIconNoSpan(isRtl ? "first" : "last", this.beans));
        this.addManagedPropertyListener("pagination", this.onPaginationChanged.bind(this));
        this.addManagedPropertyListener("suppressPaginationPanel", this.onPaginationChanged.bind(this));
        this.addManagedPropertyListeners(
          ["paginationPageSizeSelector", "paginationAutoPageSize", "suppressPaginationPanel"],
          () => this.onPageSizeRelatedOptionsChange()
        );
        this.pageSizeComp.toggleSelectDisplay(this.pageSizeComp.shouldShowPageSizeSelector());
        this.initialiseTabGuard({
          // prevent tab guard default logic
          onTabKeyDown: () => {
          },
          focusInnerElement: (fromBottom) => {
            if (this.allowFocusInnerElement) {
              return this.tabGuardFeature.getTabGuardCtrl().focusInnerElement(fromBottom);
            } else {
              return _focusGridInnerElement(this.beans, fromBottom);
            }
          },
          forceFocusOutWhenTabGuardsAreEmpty: true
        });
        this.onPaginationChanged();
      }
      setAllowFocus(allowFocus) {
        this.allowFocusInnerElement = allowFocus;
      }
      onPaginationChanged() {
        const isPaging = this.gos.get("pagination");
        const paginationPanelEnabled = isPaging && !this.gos.get("suppressPaginationPanel");
        this.setDisplayed(paginationPanelEnabled);
        if (!paginationPanelEnabled) {
          return;
        }
        this.setupListeners();
        this.enableOrDisableButtons();
        this.updateLabels();
        this.onPageSizeRelatedOptionsChange();
      }
      onPageSizeRelatedOptionsChange() {
        this.pageSizeComp.toggleSelectDisplay(this.pageSizeComp.shouldShowPageSizeSelector());
      }
      setupListeners() {
        if (!this.areListenersSetup) {
          this.addManagedEventListeners({ paginationChanged: this.onPaginationChanged.bind(this) });
          for (const item2 of [
            { el: this.btFirst, fn: this.onBtFirst.bind(this) },
            { el: this.btPrevious, fn: this.onBtPrevious.bind(this) },
            { el: this.btNext, fn: this.onBtNext.bind(this) },
            { el: this.btLast, fn: this.onBtLast.bind(this) }
          ]) {
            const { el: el2, fn: fn2 } = item2;
            this.addManagedListeners(el2, {
              click: fn2,
              keydown: (e) => {
                if (e.key === KeyCode.ENTER || e.key === KeyCode.SPACE) {
                  e.preventDefault();
                  fn2();
                }
              }
            });
          }
          _addFocusableContainerListener(this.beans, this, this.getGui());
          this.areListenersSetup = true;
        }
      }
      onBtFirst() {
        if (!this.previousAndFirstButtonsDisabled) {
          this.pagination.goToFirstPage();
        }
      }
      formatNumber(value2) {
        const userFunc = this.gos.getCallback("paginationNumberFormatter");
        if (userFunc) {
          const params = { value: value2 };
          return userFunc(params);
        }
        return _formatNumberCommas(value2, this.getLocaleTextFunc.bind(this));
      }
      getTemplate() {
        const localeTextFunc = this.getLocaleTextFunc();
        const idPrefix = `ag-${this.getCompId()}`;
        return {
          tag: "div",
          cls: "ag-paging-panel ag-unselectable",
          attrs: { id: `${idPrefix}` },
          children: [
            {
              tag: "ag-page-size-selector",
              ref: "pageSizeComp"
            },
            {
              tag: "span",
              cls: "ag-paging-row-summary-panel",
              children: [
                {
                  tag: "span",
                  ref: "lbFirstRowOnPage",
                  cls: "ag-paging-row-summary-panel-number",
                  attrs: { id: `${idPrefix}-first-row` }
                },
                { tag: "span", attrs: { id: `${idPrefix}-to` }, children: localeTextFunc("to", "to") },
                {
                  tag: "span",
                  ref: "lbLastRowOnPage",
                  cls: "ag-paging-row-summary-panel-number",
                  attrs: { id: `${idPrefix}-last-row` }
                },
                { tag: "span", attrs: { id: `${idPrefix}-of` }, children: localeTextFunc("of", "of") },
                {
                  tag: "span",
                  ref: "lbRecordCount",
                  cls: "ag-paging-row-summary-panel-number",
                  attrs: { id: `${idPrefix}-row-count` }
                }
              ]
            },
            {
              tag: "span",
              cls: "ag-paging-page-summary-panel",
              role: "presentation",
              children: [
                {
                  tag: "div",
                  ref: "btFirst",
                  cls: "ag-button ag-paging-button",
                  role: "button",
                  attrs: { "aria-label": localeTextFunc("firstPage", "First Page") }
                },
                {
                  tag: "div",
                  ref: "btPrevious",
                  cls: "ag-button ag-paging-button",
                  role: "button",
                  attrs: { "aria-label": localeTextFunc("previousPage", "Previous Page") }
                },
                {
                  tag: "span",
                  cls: "ag-paging-description",
                  children: [
                    {
                      tag: "span",
                      attrs: {
                        id: `${idPrefix}-start-page`
                      },
                      children: localeTextFunc("page", "Page")
                    },
                    {
                      tag: "span",
                      ref: "lbCurrent",
                      cls: "ag-paging-number",
                      attrs: { id: `${idPrefix}-start-page-number` }
                    },
                    {
                      tag: "span",
                      attrs: {
                        id: `${idPrefix}-of-page`
                      },
                      children: localeTextFunc("of", "of")
                    },
                    {
                      tag: "span",
                      ref: "lbTotal",
                      cls: "ag-paging-number",
                      attrs: { id: `${idPrefix}-of-page-number` }
                    }
                  ]
                },
                {
                  tag: "div",
                  ref: "btNext",
                  cls: "ag-button ag-paging-button",
                  role: "button",
                  attrs: { "aria-label": localeTextFunc("nextPage", "Next Page") }
                },
                {
                  tag: "div",
                  ref: "btLast",
                  cls: "ag-button ag-paging-button",
                  role: "button",
                  attrs: { "aria-label": localeTextFunc("lastPage", "Last Page") }
                }
              ]
            }
          ]
        };
      }
      onBtNext() {
        if (!this.nextButtonDisabled) {
          this.pagination.goToNextPage();
        }
      }
      onBtPrevious() {
        if (!this.previousAndFirstButtonsDisabled) {
          this.pagination.goToPreviousPage();
        }
      }
      onBtLast() {
        if (!this.lastButtonDisabled) {
          this.pagination.goToLastPage();
        }
      }
      enableOrDisableButtons() {
        const currentPage = this.pagination.getCurrentPage();
        const maxRowFound = this.rowModel.isLastRowIndexKnown();
        const totalPages = this.pagination.getTotalPages();
        this.previousAndFirstButtonsDisabled = currentPage === 0;
        this.toggleButtonDisabled(this.btFirst, this.previousAndFirstButtonsDisabled);
        this.toggleButtonDisabled(this.btPrevious, this.previousAndFirstButtonsDisabled);
        const zeroPagesToDisplay = this.isZeroPagesToDisplay();
        const onLastPage = currentPage === totalPages - 1;
        this.nextButtonDisabled = onLastPage || zeroPagesToDisplay;
        this.lastButtonDisabled = !maxRowFound || zeroPagesToDisplay || currentPage === totalPages - 1;
        this.toggleButtonDisabled(this.btNext, this.nextButtonDisabled);
        this.toggleButtonDisabled(this.btLast, this.lastButtonDisabled);
      }
      toggleButtonDisabled(button2, disabled2) {
        _setAriaDisabled(button2, disabled2);
        button2.classList.toggle("ag-disabled", disabled2);
      }
      isZeroPagesToDisplay() {
        const maxRowFound = this.rowModel.isLastRowIndexKnown();
        const totalPages = this.pagination.getTotalPages();
        return maxRowFound && totalPages === 0;
      }
      updateLabels() {
        const lastPageFound = this.rowModel.isLastRowIndexKnown();
        const totalPages = this.pagination.getTotalPages();
        const masterRowCount = this.pagination.getMasterRowCount();
        const rowCount = lastPageFound ? masterRowCount : null;
        const currentPage = this.pagination.getCurrentPage();
        const pageSize = this.pagination.getPageSize();
        let startRow;
        let endRow;
        if (this.isZeroPagesToDisplay()) {
          startRow = endRow = 0;
        } else {
          startRow = pageSize * currentPage + 1;
          endRow = startRow + pageSize - 1;
          if (lastPageFound && endRow > rowCount) {
            endRow = rowCount;
          }
        }
        const theoreticalEndRow = startRow + pageSize - 1;
        const isLoadingPageSize = !lastPageFound && masterRowCount < theoreticalEndRow;
        const lbFirstRowOnPage = this.formatNumber(startRow);
        this.lbFirstRowOnPage.textContent = lbFirstRowOnPage;
        let lbLastRowOnPage;
        const localeTextFunc = this.getLocaleTextFunc();
        if (isLoadingPageSize) {
          lbLastRowOnPage = localeTextFunc("pageLastRowUnknown", "?");
        } else {
          lbLastRowOnPage = this.formatNumber(endRow);
        }
        this.lbLastRowOnPage.textContent = lbLastRowOnPage;
        const pagesExist = totalPages > 0;
        const toDisplay = pagesExist ? currentPage + 1 : 0;
        const lbCurrent = this.formatNumber(toDisplay);
        this.lbCurrent.textContent = lbCurrent;
        let lbTotal;
        let lbRecordCount;
        if (lastPageFound) {
          lbTotal = this.formatNumber(totalPages);
          lbRecordCount = this.formatNumber(rowCount);
        } else {
          const moreText = localeTextFunc("more", "more");
          lbTotal = moreText;
          lbRecordCount = moreText;
        }
        this.lbTotal.textContent = lbTotal;
        this.lbRecordCount.textContent = lbRecordCount;
        this.announceAriaStatus(lbFirstRowOnPage, lbLastRowOnPage, lbRecordCount, lbCurrent, lbTotal);
      }
      announceAriaStatus(lbFirstRowOnPage, lbLastRowOnPage, lbRecordCount, lbCurrent, lbTotal) {
        const localeTextFunc = this.getLocaleTextFunc();
        const strPage = localeTextFunc("page", "Page");
        const strTo = localeTextFunc("to", "to");
        const strOf = localeTextFunc("of", "of");
        const ariaRowStatus = `${lbFirstRowOnPage} ${strTo} ${lbLastRowOnPage} ${strOf} ${lbRecordCount}`;
        const ariaPageStatus = `${strPage} ${lbCurrent} ${strOf} ${lbTotal}`;
        if (ariaRowStatus !== this.ariaRowStatus) {
          this.ariaRowStatus = ariaRowStatus;
          this.ariaAnnounce?.announceValue(ariaRowStatus, "paginationRow");
        }
        if (ariaPageStatus !== this.ariaPageStatus) {
          this.ariaPageStatus = ariaPageStatus;
          this.ariaAnnounce?.announceValue(ariaPageStatus, "paginationPage");
        }
      }
    };
    var PaginationSelector = {
      selector: "AG-PAGINATION",
      component: PaginationComp
    };
    var PaginationService = class extends BeanStub {
      constructor() {
        super(...arguments);
        this.beanName = "pagination";
        this.currentPage = 0;
        this.topDisplayedRowIndex = 0;
        this.bottomDisplayedRowIndex = 0;
        this.masterRowCount = 0;
      }
      postConstruct() {
        const gos = this.gos;
        this.active = gos.get("pagination");
        this.pageSizeFromGridOptions = gos.get("paginationPageSize");
        this.paginateChildRows = this.isPaginateChildRows();
        this.addManagedPropertyListener("pagination", this.onPaginationGridOptionChanged.bind(this));
        this.addManagedPropertyListener("paginationPageSize", this.onPageSizeGridOptionChanged.bind(this));
      }
      getPaginationSelector() {
        return PaginationSelector;
      }
      isPaginateChildRows() {
        const gos = this.gos;
        const shouldPaginate = gos.get("groupHideParentOfSingleChild") || // following two properties deprecated v32.3.0
        gos.get("groupRemoveSingleChildren") || gos.get("groupRemoveLowestSingleChildren");
        if (shouldPaginate) {
          return true;
        }
        return gos.get("paginateChildRows");
      }
      onPaginationGridOptionChanged() {
        this.active = this.gos.get("pagination");
        this.calculatePages();
        this.dispatchPaginationChangedEvent({ keepRenderedRows: true });
      }
      onPageSizeGridOptionChanged() {
        this.setPageSize(this.gos.get("paginationPageSize"), "gridOptions");
      }
      goToPage(page) {
        const currentPage = this.currentPage;
        if (!this.active || currentPage === page || typeof currentPage !== "number") {
          return;
        }
        const { editSvc } = this.beans;
        if (editSvc?.isEditing()) {
          if (editSvc.isBatchEditing()) {
            editSvc.cleanupEditors();
          } else {
            editSvc.stopEditing(void 0, { source: "api" });
          }
        }
        this.currentPage = page;
        this.calculatePages();
        this.dispatchPaginationChangedEvent({ newPage: true });
      }
      goToPageWithIndex(index) {
        if (!this.active) {
          return;
        }
        let adjustedIndex = index;
        if (!this.paginateChildRows) {
          adjustedIndex = this.beans.rowModel.getTopLevelIndexFromDisplayedIndex?.(index) ?? index;
        }
        this.goToPage(Math.floor(adjustedIndex / this.pageSize));
      }
      isRowInPage(rowIndex) {
        if (!this.active) {
          return true;
        }
        return rowIndex >= this.topDisplayedRowIndex && rowIndex <= this.bottomDisplayedRowIndex;
      }
      getCurrentPage() {
        return this.currentPage;
      }
      goToNextPage() {
        this.goToPage(this.currentPage + 1);
      }
      goToPreviousPage() {
        this.goToPage(this.currentPage - 1);
      }
      goToFirstPage() {
        this.goToPage(0);
      }
      goToLastPage() {
        const rowCount = this.beans.rowModel.getRowCount();
        const lastPage = Math.floor(rowCount / this.pageSize);
        this.goToPage(lastPage);
      }
      getPageSize() {
        return this.pageSize;
      }
      getTotalPages() {
        return this.totalPages;
      }
      /** This is only for state setting before data has been loaded */
      setPage(page) {
        this.currentPage = page;
      }
      get pageSize() {
        if (_exists(this.pageSizeAutoCalculated) && this.gos.get("paginationAutoPageSize")) {
          return this.pageSizeAutoCalculated;
        }
        if (_exists(this.pageSizeFromPageSizeSelector)) {
          return this.pageSizeFromPageSizeSelector;
        }
        if (_exists(this.pageSizeFromInitialState)) {
          return this.pageSizeFromInitialState;
        }
        if (_exists(this.pageSizeFromGridOptions)) {
          return this.pageSizeFromGridOptions;
        }
        return this.defaultPageSize;
      }
      calculatePages() {
        if (this.active) {
          if (this.paginateChildRows) {
            this.calculatePagesAllRows();
          } else {
            this.calculatePagesMasterRowsOnly();
          }
        } else {
          this.calculatedPagesNotActive();
        }
        this.beans.pageBounds.calculateBounds(this.topDisplayedRowIndex, this.bottomDisplayedRowIndex);
      }
      unsetAutoCalculatedPageSize() {
        if (this.pageSizeAutoCalculated === void 0) {
          return;
        }
        const oldPageSize = this.pageSizeAutoCalculated;
        this.pageSizeAutoCalculated = void 0;
        if (this.pageSize === oldPageSize) {
          return;
        }
        this.calculatePages();
        this.dispatchPaginationChangedEvent({ newPageSize: true });
      }
      setPageSize(size, source2) {
        const currentSize = this.pageSize;
        switch (source2) {
          case "autoCalculated":
            this.pageSizeAutoCalculated = size;
            break;
          case "pageSizeSelector":
            this.pageSizeFromPageSizeSelector = size;
            if (this.currentPage !== 0) {
              this.goToFirstPage();
            }
            break;
          case "initialState":
            this.pageSizeFromInitialState = size;
            break;
          case "gridOptions":
            this.pageSizeFromGridOptions = size;
            this.pageSizeFromInitialState = void 0;
            this.pageSizeFromPageSizeSelector = void 0;
            if (this.currentPage !== 0) {
              this.goToFirstPage();
            }
            break;
        }
        if (currentSize !== this.pageSize) {
          this.calculatePages();
          this.dispatchPaginationChangedEvent({ newPageSize: true, keepRenderedRows: true });
        }
      }
      setZeroRows() {
        this.masterRowCount = 0;
        this.topDisplayedRowIndex = 0;
        this.bottomDisplayedRowIndex = -1;
        this.currentPage = 0;
        this.totalPages = 0;
      }
      adjustCurrentPageIfInvalid() {
        const totalPages = this.totalPages;
        if (this.currentPage >= totalPages) {
          this.currentPage = totalPages - 1;
        }
        const currentPage = this.currentPage;
        if (!isFinite(currentPage) || isNaN(currentPage) || currentPage < 0) {
          this.currentPage = 0;
        }
      }
      calculatePagesMasterRowsOnly() {
        const rowModel = this.beans.rowModel;
        const masterRowCount = rowModel.getTopLevelRowCount();
        this.masterRowCount = masterRowCount;
        if (masterRowCount <= 0) {
          this.setZeroRows();
          return;
        }
        const pageSize = this.pageSize;
        const masterLastRowIndex = masterRowCount - 1;
        this.totalPages = Math.floor(masterLastRowIndex / pageSize) + 1;
        this.adjustCurrentPageIfInvalid();
        const currentPage = this.currentPage;
        const masterPageStartIndex = pageSize * currentPage;
        let masterPageEndIndex = pageSize * (currentPage + 1) - 1;
        if (masterPageEndIndex > masterLastRowIndex) {
          masterPageEndIndex = masterLastRowIndex;
        }
        this.topDisplayedRowIndex = rowModel.getTopLevelRowDisplayedIndex(masterPageStartIndex);
        if (masterPageEndIndex === masterLastRowIndex) {
          this.bottomDisplayedRowIndex = rowModel.getRowCount() - 1;
        } else {
          const firstIndexNotToShow = rowModel.getTopLevelRowDisplayedIndex(masterPageEndIndex + 1);
          this.bottomDisplayedRowIndex = firstIndexNotToShow - 1;
        }
      }
      getMasterRowCount() {
        return this.masterRowCount;
      }
      calculatePagesAllRows() {
        const masterRowCount = this.beans.rowModel.getRowCount();
        this.masterRowCount = masterRowCount;
        if (masterRowCount === 0) {
          this.setZeroRows();
          return;
        }
        const { pageSize, currentPage } = this;
        const maxRowIndex = masterRowCount - 1;
        this.totalPages = Math.floor(maxRowIndex / pageSize) + 1;
        this.adjustCurrentPageIfInvalid();
        this.topDisplayedRowIndex = pageSize * currentPage;
        this.bottomDisplayedRowIndex = pageSize * (currentPage + 1) - 1;
        if (this.bottomDisplayedRowIndex > maxRowIndex) {
          this.bottomDisplayedRowIndex = maxRowIndex;
        }
      }
      calculatedPagesNotActive() {
        this.setPageSize(void 0, "autoCalculated");
        this.totalPages = 1;
        this.currentPage = 0;
        this.topDisplayedRowIndex = 0;
        this.bottomDisplayedRowIndex = this.beans.rowModel.getRowCount() - 1;
      }
      dispatchPaginationChangedEvent(params) {
        const { keepRenderedRows = false, newPage = false, newPageSize = false } = params;
        this.eventSvc.dispatchEvent({
          type: "paginationChanged",
          animate: false,
          newData: false,
          newPage,
          newPageSize,
          keepRenderedRows
        });
      }
    };
    var PaginationModule = {
      moduleName: "Pagination",
      version: VERSION,
      beans: [PaginationService, PaginationAutoPageSizeService],
      icons: {
        // "go to first" button in pagination controls
        first: "first",
        // "go to previous" button in pagination controls
        previous: "previous",
        // "go to next" button in pagination controls
        next: "next",
        // "go to last" button in pagination controls
        last: "last"
      },
      apiFunctions: {
        paginationIsLastPageFound,
        paginationGetPageSize,
        paginationGetCurrentPage,
        paginationGetTotalPages,
        paginationGetRowCount,
        paginationGoToNextPage,
        paginationGoToPreviousPage,
        paginationGoToFirstPage,
        paginationGoToLastPage,
        paginationGoToPage
      },
      dependsOn: [PopupModule]
    };
    function redrawRows(beans, params = {}) {
      const rowNodes = params ? params.rowNodes : void 0;
      beans.frameworkOverrides.wrapIncoming(() => beans.rowRenderer.redrawRows(rowNodes));
    }
    function setRowNodeExpanded(beans, rowNode, expanded, expandParents, forceSync) {
      if (rowNode) {
        if (expandParents && rowNode.parent && rowNode.parent.level !== -1) {
          setRowNodeExpanded(beans, rowNode.parent, expanded, expandParents, forceSync);
        }
        rowNode.setExpanded(expanded, void 0, forceSync);
      }
    }
    function getRowNode(beans, id) {
      return beans.rowModel.getRowNode(id);
    }
    function addRenderedRowListener(beans, eventName, rowIndex, callback) {
      beans.rowRenderer.addRenderedRowListener(eventName, rowIndex, callback);
    }
    function getRenderedNodes(beans) {
      return beans.rowRenderer.getRenderedNodes();
    }
    function forEachNode(beans, callback, includeFooterNodes) {
      beans.rowModel.forEachNode(callback, includeFooterNodes);
    }
    function getFirstDisplayedRowIndex(beans) {
      return beans.rowRenderer.firstRenderedRow;
    }
    function getLastDisplayedRowIndex(beans) {
      return beans.rowRenderer.lastRenderedRow;
    }
    function getDisplayedRowAtIndex(beans, index) {
      return beans.rowModel.getRow(index);
    }
    function getDisplayedRowCount(beans) {
      return beans.rowModel.getRowCount();
    }
    var RowApiModule = {
      moduleName: "RowApi",
      version: VERSION,
      apiFunctions: {
        redrawRows,
        setRowNodeExpanded,
        getRowNode,
        addRenderedRowListener,
        getRenderedNodes,
        forEachNode,
        getFirstDisplayedRowIndex,
        getLastDisplayedRowIndex,
        getDisplayedRowAtIndex,
        getDisplayedRowCount
      }
    };
    var ScrollApiModule = {
      moduleName: "ScrollApi",
      version: VERSION,
      apiFunctions: {
        getVerticalPixelRange,
        getHorizontalPixelRange,
        ensureColumnVisible,
        ensureIndexVisible,
        ensureNodeVisible
      }
    };
    function setGridAriaProperty(beans, property2, value2) {
      if (!property2) {
        return;
      }
      const eGrid = beans.ctrlsSvc.getGridBodyCtrl().eGridBody;
      const ariaProperty = `aria-${property2}`;
      if (value2 === null) {
        eGrid.removeAttribute(ariaProperty);
      } else {
        eGrid.setAttribute(ariaProperty, value2);
      }
    }
    function refreshCells(beans, params = {}) {
      beans.frameworkOverrides.wrapIncoming(() => beans.rowRenderer.refreshCells(params));
    }
    function refreshHeader(beans) {
      beans.frameworkOverrides.wrapIncoming(() => {
        for (const c2 of beans.ctrlsSvc.getHeaderRowContainerCtrls()) {
          c2.refresh();
        }
      });
    }
    function isAnimationFrameQueueEmpty(beans) {
      return beans.animationFrameSvc?.isQueueEmpty() ?? true;
    }
    function flushAllAnimationFrames(beans) {
      beans.animationFrameSvc?.flushAllFrames();
    }
    function getSizesForCurrentTheme(beans) {
      return {
        rowHeight: _getRowHeightAsNumber(beans),
        headerHeight: getHeaderHeight(beans)
      };
    }
    function getCellRendererInstances(beans, params = {}) {
      const cellRenderers = [];
      for (const cellCtrl of beans.rowRenderer.getCellCtrls(params.rowNodes, params.columns)) {
        const cellRenderer = cellCtrl.getCellRenderer();
        if (cellRenderer != null) {
          cellRenderers.push(_unwrapUserComp(cellRenderer));
        }
      }
      if (params.columns?.length) {
        return cellRenderers;
      }
      const fullWidthRenderers = [];
      const rowIdMap = mapRowNodes(params.rowNodes);
      for (const rowCtrl of beans.rowRenderer.getAllRowCtrls()) {
        if (rowIdMap && !isRowInMap(rowCtrl.rowNode, rowIdMap)) {
          continue;
        }
        if (!rowCtrl.isFullWidth()) {
          continue;
        }
        const renderers = rowCtrl.getFullWidthCellRenderers();
        for (let i2 = 0; i2 < renderers.length; i2++) {
          const renderer = renderers[i2];
          if (renderer != null) {
            fullWidthRenderers.push(_unwrapUserComp(renderer));
          }
        }
      }
      return [...fullWidthRenderers, ...cellRenderers];
    }
    var RenderApiModule = {
      moduleName: "RenderApi",
      version: VERSION,
      apiFunctions: {
        setGridAriaProperty,
        refreshCells,
        refreshHeader,
        isAnimationFrameQueueEmpty,
        flushAllAnimationFrames,
        getSizesForCurrentTheme,
        getCellRendererInstances
      }
    };
    function sizeColumnsToFit(beans, paramsOrGridWidth) {
      if (typeof paramsOrGridWidth === "number") {
        beans.colAutosize?.sizeColumnsToFit(paramsOrGridWidth, "api");
      } else {
        beans.colAutosize?.sizeColumnsToFitGridBody(paramsOrGridWidth);
      }
    }
    function autoSizeColumns({ colAutosize, visibleCols }, keysOrParams, skipHeader) {
      if (Array.isArray(keysOrParams)) {
        colAutosize?.autoSizeCols({ colKeys: keysOrParams, skipHeader, source: "api" });
      } else {
        colAutosize?.autoSizeCols({
          ...keysOrParams,
          colKeys: keysOrParams.colIds ?? visibleCols.allCols,
          source: "api"
        });
      }
    }
    function autoSizeAllColumns(beans, paramsOrSkipHeader) {
      if (paramsOrSkipHeader && typeof paramsOrSkipHeader === "object") {
        autoSizeColumns(beans, paramsOrSkipHeader);
      } else {
        beans.colAutosize?.autoSizeAllColumns({ source: "api", skipHeader: paramsOrSkipHeader });
      }
    }
    var ColumnAutosizeService = class extends BeanStub {
      constructor() {
        super(...arguments);
        this.beanName = "colAutosize";
        this.timesDelayed = 0;
        this.shouldQueueResizeOperations = false;
        this.resizeOperationQueue = [];
      }
      postConstruct() {
        const { gos } = this;
        const autoSizeStrategy = gos.get("autoSizeStrategy");
        if (autoSizeStrategy) {
          let shouldHideColumns = false;
          const type = autoSizeStrategy.type;
          if (type === "fitGridWidth" || type === "fitProvidedWidth") {
            shouldHideColumns = true;
          } else if (type === "fitCellContents") {
            this.addManagedEventListeners({ firstDataRendered: () => this.onFirstDataRendered(autoSizeStrategy) });
            const rowData = gos.get("rowData");
            shouldHideColumns = rowData != null && rowData.length > 0 && _isClientSideRowModel(gos);
          }
          if (shouldHideColumns) {
            this.beans.colDelayRenderSvc?.hideColumns(type);
          }
        }
      }
      autoSizeCols(params) {
        const { eventSvc, visibleCols } = this.beans;
        this.innerAutoSizeCols(params).then((columnsAutoSized) => {
          const dispatch = (cols) => dispatchColumnResizedEvent(eventSvc, Array.from(cols), true, "autosizeColumns");
          if (!params.scaleUpToFitGridWidth) {
            return dispatch(columnsAutoSized);
          }
          const availableGridWidth = getAvailableWidth(this.beans);
          const isLeftCol = (col) => visibleCols.leftCols.some((leftCol) => _columnsMatch(leftCol, col));
          const isRightCol = (col) => visibleCols.rightCols.some((rightCol) => _columnsMatch(rightCol, col));
          const colKeys = params.colKeys.filter(
            (col) => !isColumnSelectionCol(col) && !isRowNumberCol(col) && !isLeftCol(col) && !isRightCol(col)
          );
          this.sizeColumnsToFit(availableGridWidth, params.source, true, {
            defaultMaxWidth: params.defaultMaxWidth,
            defaultMinWidth: params.defaultMinWidth,
            columnLimits: params.columnLimits?.map((limit) => ({ ...limit, key: limit.colId })),
            colKeys,
            onlyScaleUp: true
          });
          dispatch(columnsAutoSized);
        });
      }
      innerAutoSizeCols(params) {
        return new Promise((resolve, reject) => {
          if (this.shouldQueueResizeOperations) {
            return this.pushResizeOperation(() => this.innerAutoSizeCols(params).then(resolve, reject));
          }
          const {
            colKeys,
            skipHeader,
            skipHeaderGroups,
            stopAtGroup,
            defaultMaxWidth,
            defaultMinWidth,
            columnLimits = [],
            source: source2 = "api"
          } = params;
          const { animationFrameSvc, renderStatus, colModel, autoWidthCalc, visibleCols } = this.beans;
          animationFrameSvc?.flushAllFrames();
          if (this.timesDelayed < 5 && renderStatus && (!renderStatus.areHeaderCellsRendered() || !renderStatus.areCellsRendered())) {
            this.timesDelayed++;
            setTimeout(() => {
              if (this.isAlive()) {
                this.innerAutoSizeCols(params).then(resolve, reject);
              }
            });
            return;
          }
          this.timesDelayed = 0;
          const columnsAutoSized = /* @__PURE__ */ new Set();
          let changesThisTimeAround = -1;
          const columnLimitsIndex = Object.fromEntries(
            columnLimits.map(({ colId, ...dimensions }) => [colId, dimensions])
          );
          const shouldSkipHeader = skipHeader ?? this.gos.get("skipHeaderOnAutoSize");
          const shouldSkipHeaderGroups = skipHeaderGroups ?? shouldSkipHeader;
          while (changesThisTimeAround !== 0) {
            changesThisTimeAround = 0;
            const updatedColumns = [];
            for (const key2 of colKeys) {
              if (!key2 || isSpecialCol(key2)) {
                continue;
              }
              const column2 = colModel.getCol(key2);
              if (!column2 || columnsAutoSized.has(column2)) {
                continue;
              }
              const preferredWidth = autoWidthCalc.getPreferredWidthForColumn(column2, shouldSkipHeader);
              if (preferredWidth > 0) {
                const columnLimit = columnLimitsIndex[column2.colId] ?? {};
                columnLimit.minWidth ?? (columnLimit.minWidth = defaultMinWidth);
                columnLimit.maxWidth ?? (columnLimit.maxWidth = defaultMaxWidth);
                const newWidth = normaliseColumnWidth(column2, preferredWidth, columnLimit);
                column2.setActualWidth(newWidth, source2);
                columnsAutoSized.add(column2);
                changesThisTimeAround++;
              }
              updatedColumns.push(column2);
            }
            if (updatedColumns.length) {
              visibleCols.refresh(source2);
            }
          }
          if (!shouldSkipHeaderGroups) {
            this.autoSizeColumnGroupsByColumns(colKeys, source2, stopAtGroup);
          }
          resolve(columnsAutoSized);
        });
      }
      autoSizeColumn(key2, source2, skipHeader) {
        this.autoSizeCols({ colKeys: [key2], skipHeader, skipHeaderGroups: true, source: source2 });
      }
      autoSizeColumnGroupsByColumns(keys, source2, stopAtGroup) {
        const { colModel, ctrlsSvc } = this.beans;
        const columnGroups = /* @__PURE__ */ new Set();
        const columns = colModel.getColsForKeys(keys);
        for (const col of columns) {
          let parent = col.getParent();
          while (parent && parent != stopAtGroup) {
            if (!parent.isPadding()) {
              columnGroups.add(parent);
            }
            parent = parent.getParent();
          }
        }
        let headerGroupCtrl;
        for (const columnGroup of columnGroups) {
          for (const headerContainerCtrl of ctrlsSvc.getHeaderRowContainerCtrls()) {
            headerGroupCtrl = headerContainerCtrl.getHeaderCtrlForColumn(columnGroup);
            if (headerGroupCtrl) {
              break;
            }
          }
          headerGroupCtrl?.resizeLeafColumnsToFit(source2);
        }
      }
      autoSizeAllColumns(params) {
        if (this.shouldQueueResizeOperations) {
          this.pushResizeOperation(() => this.autoSizeAllColumns(params));
          return;
        }
        this.autoSizeCols({ colKeys: this.beans.visibleCols.allCols, ...params });
      }
      addColumnAutosizeListeners(element, column2) {
        const skipHeaderOnAutoSize = this.gos.get("skipHeaderOnAutoSize");
        const autoSizeColListener = () => {
          this.autoSizeColumn(column2, "uiColumnResized", skipHeaderOnAutoSize);
        };
        element.addEventListener("dblclick", autoSizeColListener);
        const touchListener = new TouchListener(element);
        touchListener.addEventListener("doubleTap", autoSizeColListener);
        return () => {
          element.removeEventListener("dblclick", autoSizeColListener);
          touchListener.destroy();
        };
      }
      addColumnGroupResize(element, columnGroup, callback) {
        const skipHeaderOnAutoSize = this.gos.get("skipHeaderOnAutoSize");
        const listener = () => {
          const keys = [];
          const leafCols = columnGroup.getDisplayedLeafColumns();
          for (const column2 of leafCols) {
            if (!column2.getColDef().suppressAutoSize) {
              keys.push(column2.getColId());
            }
          }
          if (keys.length > 0) {
            this.autoSizeCols({
              colKeys: keys,
              skipHeader: skipHeaderOnAutoSize,
              stopAtGroup: columnGroup,
              source: "uiColumnResized"
            });
          }
          callback();
        };
        element.addEventListener("dblclick", listener);
        return () => element.removeEventListener("dblclick", listener);
      }
      // method will call itself if no available width. this covers if the grid
      // isn't visible, but is just about to be visible.
      sizeColumnsToFitGridBody(params, nextTimeout) {
        if (!this.isAlive()) {
          return;
        }
        const availableWidth = getAvailableWidth(this.beans);
        if (availableWidth > 0) {
          this.sizeColumnsToFit(availableWidth, "sizeColumnsToFit", false, params);
          return;
        }
        if (nextTimeout === void 0) {
          window.setTimeout(() => {
            this.sizeColumnsToFitGridBody(params, 100);
          }, 0);
        } else if (nextTimeout === 100) {
          window.setTimeout(() => {
            this.sizeColumnsToFitGridBody(params, 500);
          }, 100);
        } else if (nextTimeout === 500) {
          window.setTimeout(() => {
            this.sizeColumnsToFitGridBody(params, -1);
          }, 500);
        } else {
          _warn(29);
        }
      }
      // called from api
      sizeColumnsToFit(gridWidth, source2 = "sizeColumnsToFit", silent, params) {
        if (this.shouldQueueResizeOperations) {
          this.pushResizeOperation(() => this.sizeColumnsToFit(gridWidth, source2, silent, params));
          return;
        }
        const limitsMap = {};
        for (const { key: key2, ...dimensions } of params?.columnLimits ?? []) {
          limitsMap[typeof key2 === "string" ? key2 : key2.getColId()] = dimensions;
        }
        const allDisplayedColumns = this.beans.visibleCols.allCols;
        if (gridWidth <= 0 || !allDisplayedColumns.length) {
          return;
        }
        const currentTotalColumnWidth = getWidthOfColsInList(allDisplayedColumns);
        if (params?.onlyScaleUp && currentTotalColumnWidth > gridWidth) {
          return;
        }
        const doColumnsAlreadyFit = gridWidth === currentTotalColumnWidth;
        if (doColumnsAlreadyFit) {
          const doAllColumnsSatisfyConstraints = allDisplayedColumns.every((column2) => {
            if (column2.colDef.suppressSizeToFit) {
              return true;
            }
            const widthOverride = limitsMap?.[column2.getId()];
            const minWidth = widthOverride?.minWidth ?? params?.defaultMinWidth;
            const maxWidth = widthOverride?.maxWidth ?? params?.defaultMaxWidth;
            const colWidth = column2.getActualWidth();
            return (minWidth == null || colWidth >= minWidth) && (maxWidth == null || colWidth <= maxWidth);
          });
          if (doAllColumnsSatisfyConstraints) {
            return;
          }
        }
        const colsToSpread = [];
        const colsToNotSpread = [];
        for (const column2 of allDisplayedColumns) {
          const isIncluded = params?.colKeys?.some((key2) => _columnsMatch(column2, key2)) ?? true;
          if (column2.getColDef().suppressSizeToFit || !isIncluded) {
            colsToNotSpread.push(column2);
          } else {
            colsToSpread.push(column2);
          }
        }
        const colsToDispatchEventFor = colsToSpread.slice(0);
        let finishedResizing = false;
        const moveToNotSpread = (column2) => {
          _removeFromArray(colsToSpread, column2);
          colsToNotSpread.push(column2);
        };
        for (const column2 of colsToSpread) {
          column2.resetActualWidth(source2);
          const widthOverride = limitsMap?.[column2.getId()];
          const minOverride = widthOverride?.minWidth ?? params?.defaultMinWidth;
          const maxOverride = widthOverride?.maxWidth ?? params?.defaultMaxWidth;
          const colWidth = column2.getActualWidth();
          if (typeof minOverride === "number" && colWidth < minOverride) {
            column2.setActualWidth(minOverride, source2, true);
          } else if (typeof maxOverride === "number" && colWidth > maxOverride) {
            column2.setActualWidth(maxOverride, source2, true);
          }
        }
        while (!finishedResizing) {
          finishedResizing = true;
          const availablePixels = gridWidth - getWidthOfColsInList(colsToNotSpread);
          if (availablePixels <= 0) {
            for (const column2 of colsToSpread) {
              const newWidth = limitsMap?.[column2.getId()]?.minWidth ?? params?.defaultMinWidth ?? column2.minWidth;
              column2.setActualWidth(newWidth, source2, true);
            }
          } else {
            const scale = availablePixels / getWidthOfColsInList(colsToSpread);
            let pixelsForLastCol = availablePixels;
            for (let i2 = colsToSpread.length - 1; i2 >= 0; i2--) {
              const column2 = colsToSpread[i2];
              const widthOverride = limitsMap?.[column2.getId()];
              const minOverride = widthOverride?.minWidth ?? params?.defaultMinWidth;
              const maxOverride = widthOverride?.maxWidth ?? params?.defaultMaxWidth;
              const colMinWidth = column2.getMinWidth();
              const colMaxWidth = column2.getMaxWidth();
              const minWidth = typeof minOverride === "number" && minOverride > colMinWidth ? minOverride : colMinWidth;
              const maxWidth = typeof maxOverride === "number" && maxOverride < colMaxWidth ? maxOverride : colMaxWidth;
              let newWidth = Math.round(column2.getActualWidth() * scale);
              if (newWidth < minWidth) {
                newWidth = minWidth;
                moveToNotSpread(column2);
                finishedResizing = false;
              } else if (newWidth > maxWidth) {
                newWidth = maxWidth;
                moveToNotSpread(column2);
                finishedResizing = false;
              } else if (i2 === 0) {
                newWidth = pixelsForLastCol;
              }
              column2.setActualWidth(newWidth, source2, true);
              pixelsForLastCol -= newWidth;
            }
          }
        }
        for (const col of colsToDispatchEventFor) {
          col.fireColumnWidthChangedEvent(source2);
        }
        const visibleCols = this.beans.visibleCols;
        visibleCols.setLeftValues(source2);
        visibleCols.updateBodyWidths();
        if (silent) {
          return;
        }
        dispatchColumnResizedEvent(this.eventSvc, colsToDispatchEventFor, true, source2);
      }
      applyAutosizeStrategy() {
        const { gos, colDelayRenderSvc } = this.beans;
        const autoSizeStrategy = gos.get("autoSizeStrategy");
        if (autoSizeStrategy?.type !== "fitGridWidth" && autoSizeStrategy?.type !== "fitProvidedWidth") {
          return;
        }
        setTimeout(() => {
          if (!this.isAlive()) {
            return;
          }
          const type = autoSizeStrategy.type;
          if (type === "fitGridWidth") {
            const { columnLimits: propColumnLimits, defaultMinWidth, defaultMaxWidth } = autoSizeStrategy;
            const columnLimits = propColumnLimits?.map(({ colId: key2, minWidth, maxWidth }) => ({
              key: key2,
              minWidth,
              maxWidth
            }));
            this.sizeColumnsToFitGridBody({
              defaultMinWidth,
              defaultMaxWidth,
              columnLimits
            });
          } else if (type === "fitProvidedWidth") {
            this.sizeColumnsToFit(autoSizeStrategy.width, "sizeColumnsToFit");
          }
          colDelayRenderSvc?.revealColumns(type);
        });
      }
      onFirstDataRendered({ colIds: colKeys, ...params }) {
        setTimeout(() => {
          if (!this.isAlive()) {
            return;
          }
          const source2 = "autosizeColumns";
          if (colKeys) {
            this.autoSizeCols({ ...params, source: source2, colKeys });
          } else {
            this.autoSizeAllColumns({ ...params, source: source2 });
          }
          this.beans.colDelayRenderSvc?.revealColumns(params.type);
        });
      }
      processResizeOperations() {
        this.shouldQueueResizeOperations = false;
        for (const resizeOperation of this.resizeOperationQueue) {
          resizeOperation();
        }
        this.resizeOperationQueue = [];
      }
      pushResizeOperation(func) {
        this.resizeOperationQueue.push(func);
      }
      destroy() {
        this.resizeOperationQueue.length = 0;
        super.destroy();
      }
    };
    function normaliseColumnWidth(column2, newWidth, limits = {}) {
      const minWidth = limits.minWidth ?? column2.getMinWidth();
      if (newWidth < minWidth) {
        newWidth = minWidth;
      }
      const maxWidth = limits.maxWidth ?? column2.getMaxWidth();
      if (newWidth > maxWidth) {
        newWidth = maxWidth;
      }
      return newWidth;
    }
    function getAvailableWidth({ ctrlsSvc, scrollVisibleSvc }) {
      const gridBodyCtrl = ctrlsSvc.getGridBodyCtrl();
      const removeScrollWidth = gridBodyCtrl.isVerticalScrollShowing();
      const scrollWidthToRemove = removeScrollWidth ? scrollVisibleSvc.getScrollbarWidth() : 0;
      const bodyViewportWidth = _getInnerWidth(gridBodyCtrl.eGridBody);
      return bodyViewportWidth - scrollWidthToRemove;
    }
    var ColumnAutoSizeModule = {
      moduleName: "ColumnAutoSize",
      version: VERSION,
      beans: [ColumnAutosizeService],
      apiFunctions: {
        sizeColumnsToFit,
        autoSizeColumns,
        autoSizeAllColumns
      },
      dependsOn: [AutoWidthModule]
    };
    var manualPinnedRowCSS = (
      /*css*/
      `.ag-row-pinned-source{background-color:var(--ag-pinned-source-row-background-color);color:var(--ag-pinned-source-row-text-color);font-weight:var(--ag-pinned-source-row-font-weight)}.ag-row-pinned-manual{background-color:var(--ag-pinned-row-background-color);color:var(--ag-pinned-row-text-color);font-weight:var(--ag-pinned-row-font-weight)}`
    );
    function getPinnedTopRowCount(beans) {
      return beans.pinnedRowModel?.getPinnedTopRowCount() ?? 0;
    }
    function getPinnedBottomRowCount(beans) {
      return beans.pinnedRowModel?.getPinnedBottomRowCount() ?? 0;
    }
    function getPinnedTopRow(beans, index) {
      return beans.pinnedRowModel?.getPinnedTopRow(index);
    }
    function getPinnedBottomRow(beans, index) {
      return beans.pinnedRowModel?.getPinnedBottomRow(index);
    }
    function forEachPinnedRow(beans, floating, callback) {
      return beans.pinnedRowModel?.forEachPinnedRow(floating, callback);
    }
    var PinnedRowModule = {
      moduleName: "PinnedRow",
      version: VERSION,
      beans: [PinnedRowModel],
      css: [manualPinnedRowCSS],
      apiFunctions: {
        getPinnedTopRowCount,
        getPinnedBottomRowCount,
        getPinnedTopRow,
        getPinnedBottomRow,
        forEachPinnedRow
      },
      icons: {
        rowPin: "pin",
        rowPinTop: "pinned-top",
        rowPinBottom: "pinned-bottom",
        rowUnpin: "un-pin"
      }
    };
    var CellSpan = class {
      constructor(col, firstNode) {
        this.col = col;
        this.firstNode = firstNode;
        this.cellSpan = true;
        this.spannedNodes = /* @__PURE__ */ new Set();
        this.addSpannedNode(firstNode);
      }
      /**
       * Reset the span leaving only the head.
       * Head is used as a comparison as this is the row used to render this cell
       * Even if the row data changes, the cell will properly reflect the correct value.
       */
      reset() {
        this.spannedNodes.clear();
        this.addSpannedNode(this.firstNode);
      }
      addSpannedNode(node2) {
        this.spannedNodes.add(node2);
        this.lastNode = node2;
      }
      getLastNode() {
        return this.lastNode;
      }
      getCellHeight() {
        return this.lastNode.rowTop + this.lastNode.rowHeight - this.firstNode.rowTop - 1;
      }
      doesSpanContain(cellPosition) {
        if (cellPosition.column !== this.col) {
          return false;
        }
        if (cellPosition.rowPinned != this.firstNode.rowPinned) {
          return false;
        }
        return this.firstNode.rowIndex <= cellPosition.rowIndex && cellPosition.rowIndex <= this.lastNode.rowIndex;
      }
      /**
       * Gets the auto height value for last node in the spanned cell.
       * The first node is used to store the auto height for the cell, but the additional height for this cell
       * needs applied to the last row in the span.
       */
      getLastNodeAutoHeight() {
        const autoHeight = this.firstNode.__autoHeights?.[this.col.getColId()];
        if (autoHeight == null) {
          return void 0;
        }
        let allButLastHeights = 0;
        for (const node2 of this.spannedNodes) {
          if (node2 === this.lastNode) {
            continue;
          }
          allButLastHeights += node2.rowHeight;
        }
        return autoHeight - allButLastHeights;
      }
    };
    var RowSpanCache = class extends BeanStub {
      constructor(column2) {
        super();
        this.column = column2;
      }
      buildCache(pinned) {
        const {
          column: column2,
          beans: { gos, pinnedRowModel, rowModel, valueSvc, pagination }
        } = this;
        const { colDef } = column2;
        const oldMap = this.getNodeMap(pinned);
        const newMap = /* @__PURE__ */ new Map();
        const isFullWidthCellFunc = gos.getCallback("isFullWidthRow");
        const equalsFnc = colDef.equals;
        const customCompare = colDef.spanRows;
        const isCustomCompare = typeof customCompare === "function";
        let lastNode = null;
        let spanData = null;
        let lastValue;
        const setNewHead = (node2, value2) => {
          lastNode = node2;
          spanData = null;
          lastValue = value2;
        };
        const checkNodeForCache = (node2) => {
          const doesNodeSupportSpanning = !node2.isExpandable() && !node2.group && !node2.detail && (isFullWidthCellFunc ? !isFullWidthCellFunc({ rowNode: node2 }) : true);
          if (node2.rowIndex == null || !doesNodeSupportSpanning) {
            setNewHead(null, null);
            return;
          }
          if (lastNode == null || node2.level !== lastNode.level || // no span across groups
          node2.footer || spanData && node2.rowIndex - 1 !== spanData?.getLastNode().rowIndex) {
            setNewHead(node2, valueSvc.getValue(column2, node2));
            return;
          }
          const value2 = valueSvc.getValue(column2, node2);
          if (isCustomCompare) {
            const params = _addGridCommonParams(gos, {
              valueA: lastValue,
              nodeA: lastNode,
              valueB: value2,
              nodeB: node2,
              column: column2,
              colDef
            });
            if (!customCompare(params)) {
              setNewHead(node2, value2);
              return;
            }
          } else if (equalsFnc ? !equalsFnc(lastValue, value2) : lastValue !== value2) {
            setNewHead(node2, value2);
            return;
          }
          if (!spanData) {
            const oldSpan = oldMap?.get(lastNode);
            if (oldSpan?.firstNode === lastNode) {
              oldSpan.reset();
              spanData = oldSpan;
            } else {
              spanData = new CellSpan(column2, lastNode);
            }
            newMap.set(lastNode, spanData);
          }
          spanData.addSpannedNode(node2);
          newMap.set(node2, spanData);
        };
        switch (pinned) {
          case "center":
            rowModel.forEachDisplayedNode?.((node2) => {
              const isNodeInPage = !pagination || pagination.isRowInPage(node2.rowIndex);
              if (!isNodeInPage) {
                return;
              }
              checkNodeForCache(node2);
            });
            this.centerValueNodeMap = newMap;
            break;
          case "top":
            pinnedRowModel?.forEachPinnedRow("top", checkNodeForCache);
            this.topValueNodeMap = newMap;
            break;
          case "bottom":
            pinnedRowModel?.forEachPinnedRow("bottom", checkNodeForCache);
            this.bottomValueNodeMap = newMap;
            break;
        }
      }
      isCellSpanning(node2) {
        return !!this.getCellSpan(node2);
      }
      getCellSpan(node2) {
        return this.getNodeMap(node2.rowPinned).get(node2);
      }
      getNodeMap(container2) {
        switch (container2) {
          case "top":
            return this.topValueNodeMap;
          case "bottom":
            return this.bottomValueNodeMap;
          default:
            return this.centerValueNodeMap;
        }
      }
    };
    var RowSpanService = class extends BeanStub {
      constructor() {
        super(...arguments);
        this.beanName = "rowSpanSvc";
        this.spanningColumns = /* @__PURE__ */ new Map();
        this.debouncePinnedEvent = _debounce(this, this.dispatchCellsUpdatedEvent.bind(this, true), 0);
        this.debounceModelEvent = _debounce(this, this.dispatchCellsUpdatedEvent.bind(this, false), 0);
        this.pinnedTimeout = null;
        this.modelTimeout = null;
      }
      postConstruct() {
        const onRowDataUpdated = this.onRowDataUpdated.bind(this);
        const buildPinnedCaches = this.buildPinnedCaches.bind(this);
        this.addManagedEventListeners({
          paginationChanged: this.buildModelCaches.bind(this),
          pinnedRowDataChanged: buildPinnedCaches,
          pinnedRowsChanged: buildPinnedCaches,
          rowNodeDataChanged: onRowDataUpdated,
          cellValueChanged: onRowDataUpdated
        });
      }
      /**
       * When a new column is created with spanning (or spanning changes for a column)
       * @param column column that is now spanning
       */
      register(column2) {
        const { gos } = this.beans;
        if (!gos.get("enableCellSpan")) {
          return;
        }
        if (this.spanningColumns.has(column2)) {
          return;
        }
        const cache = this.createManagedBean(new RowSpanCache(column2));
        this.spanningColumns.set(column2, cache);
        cache.buildCache("top");
        cache.buildCache("bottom");
        cache.buildCache("center");
        this.debouncePinnedEvent();
        this.debounceModelEvent();
      }
      dispatchCellsUpdatedEvent(pinned) {
        this.dispatchLocalEvent({ type: "spannedCellsUpdated", pinned });
      }
      /**
       * When a new column is destroyed with spanning (or spanning changes for a column)
       * @param column column that is now spanning
       */
      deregister(column2) {
        this.spanningColumns.delete(column2);
      }
      // called when data changes, as this could be a hot path it's debounced
      // it uses timeouts instead of debounce so that it can be cancelled by `modelUpdated`
      // which is expected to run immediately (to exec before the rowRenderer)
      onRowDataUpdated({ node: node2 }) {
        const { spannedRowRenderer } = this.beans;
        if (node2.rowPinned) {
          if (this.pinnedTimeout != null) {
            return;
          }
          this.pinnedTimeout = window.setTimeout(() => {
            this.pinnedTimeout = null;
            this.buildPinnedCaches();
            spannedRowRenderer?.createCtrls("top");
            spannedRowRenderer?.createCtrls("bottom");
          }, 0);
          return;
        }
        if (this.modelTimeout != null) {
          return;
        }
        this.modelTimeout = window.setTimeout(() => {
          this.modelTimeout = null;
          this.buildModelCaches();
          spannedRowRenderer?.createCtrls("center");
        }, 0);
      }
      buildModelCaches() {
        if (this.modelTimeout != null) {
          clearTimeout(this.modelTimeout);
        }
        this.spanningColumns.forEach((cache) => cache.buildCache("center"));
        this.debounceModelEvent();
      }
      buildPinnedCaches() {
        if (this.pinnedTimeout != null) {
          clearTimeout(this.pinnedTimeout);
        }
        this.spanningColumns.forEach((cache) => {
          cache.buildCache("top");
          cache.buildCache("bottom");
        });
        this.debouncePinnedEvent();
      }
      isCellSpanning(col, rowNode) {
        const cache = this.spanningColumns.get(col);
        if (!cache) {
          return false;
        }
        return cache.isCellSpanning(rowNode);
      }
      getCellSpanByPosition(position) {
        const { pinnedRowModel, rowModel } = this.beans;
        const col = position.column;
        const index = position.rowIndex;
        const cache = this.spanningColumns.get(col);
        if (!cache) {
          return void 0;
        }
        let node2;
        switch (position.rowPinned) {
          case "top":
            node2 = pinnedRowModel?.getPinnedTopRow(index);
            break;
          case "bottom":
            node2 = pinnedRowModel?.getPinnedBottomRow(index);
            break;
          default:
            node2 = rowModel.getRow(index);
        }
        if (!node2) {
          return void 0;
        }
        return cache.getCellSpan(node2);
      }
      getCellStart(position) {
        const span = this.getCellSpanByPosition(position);
        if (!span) {
          return position;
        }
        return { ...position, rowIndex: span.firstNode.rowIndex };
      }
      getCellEnd(position) {
        const span = this.getCellSpanByPosition(position);
        if (!span) {
          return position;
        }
        return { ...position, rowIndex: span.getLastNode().rowIndex };
      }
      /**
       * Look-up a spanned cell given a col and node as position indicators
       *
       * @param col a column to lookup a span at this position
       * @param rowNode a node that may be spanned at this position
       * @returns the CellSpan object if one exists
       */
      getCellSpan(col, rowNode) {
        const cache = this.spanningColumns.get(col);
        if (!cache) {
          return void 0;
        }
        return cache.getCellSpan(rowNode);
      }
      forEachSpannedColumn(rowNode, callback) {
        for (const [col, cache] of this.spanningColumns) {
          if (cache.isCellSpanning(rowNode)) {
            const spanningNode = cache.getCellSpan(rowNode);
            callback(col, spanningNode);
          }
        }
      }
      destroy() {
        super.destroy();
        this.spanningColumns.clear();
      }
    };
    var SpannedCellCtrl = class extends CellCtrl {
      constructor(cellSpan, rowCtrl, beans) {
        super(cellSpan.col, cellSpan.firstNode, beans, rowCtrl);
        this.cellSpan = cellSpan;
        this.SPANNED_CELL_CSS_CLASS = "ag-spanned-cell";
      }
      setComp(comp2, eCell, eWrapper, eCellWrapper, printLayout, startEditing, compBean) {
        this.eWrapper = eWrapper;
        super.setComp(comp2, eCell, eWrapper, eCellWrapper, printLayout, startEditing, compBean);
        this.setAriaRowSpan();
        this.refreshAriaRowIndex();
      }
      isCellSpanning() {
        return true;
      }
      getCellSpan() {
        return this.cellSpan;
      }
      /**
       * When cell is spanning, ensure row index is also available on the cell
       */
      refreshAriaRowIndex() {
        const { eGui, rowNode } = this;
        if (!eGui || rowNode.rowIndex == null) {
          return;
        }
        _setAriaRowIndex(eGui, rowNode.rowIndex);
      }
      /**
       * When cell is spanning, ensure row index is also available on the cell
       */
      setAriaRowSpan() {
        _setAriaRowSpan(this.eGui, this.cellSpan.spannedNodes.size);
      }
      // not ideal, for tabbing need to force the focused position
      setFocusedCellPosition(cellPos) {
        this.focusedCellPosition = cellPos;
      }
      getFocusedCellPosition() {
        return this.focusedCellPosition ?? this.cellPosition;
      }
      checkCellFocused() {
        const focusedCell = this.beans.focusSvc.getFocusedCell();
        return !!focusedCell && this.cellSpan.doesSpanContain(focusedCell);
      }
      applyStaticCssClasses() {
        super.applyStaticCssClasses();
        this.comp.toggleCss(this.SPANNED_CELL_CSS_CLASS, true);
      }
      onCellFocused(event) {
        const { beans } = this;
        if (_isCellFocusSuppressed(beans)) {
          this.focusedCellPosition = void 0;
          return;
        }
        const cellFocused = this.isCellFocused();
        if (!cellFocused) {
          this.focusedCellPosition = void 0;
        }
        if (event && cellFocused) {
          this.focusedCellPosition = {
            rowIndex: event.rowIndex,
            rowPinned: event.rowPinned,
            column: event.column
            // fix
          };
        }
        super.onCellFocused(event);
      }
      getRootElement() {
        return this.eWrapper;
      }
    };
    var SpannedRowCtrl = class extends RowCtrl {
      onRowIndexChanged() {
        super.onRowIndexChanged();
        for (const c2 of this.getAllCellCtrls()) {
          c2.refreshAriaRowIndex();
        }
      }
      getInitialRowClasses(_rowContainerType) {
        return ["ag-spanned-row"];
      }
      getNewCellCtrl(col) {
        const cellSpan = this.beans.rowSpanSvc?.getCellSpan(col, this.rowNode);
        if (!cellSpan) {
          return;
        }
        const firstRowOfSpan = cellSpan.firstNode !== this.rowNode;
        if (firstRowOfSpan) {
          return;
        }
        return new SpannedCellCtrl(cellSpan, this, this.beans);
      }
      isCorrectCtrlForSpan(cell2) {
        const cellSpan = this.beans.rowSpanSvc?.getCellSpan(cell2.column, this.rowNode);
        if (!cellSpan) {
          return false;
        }
        const firstRowOfSpan = cellSpan.firstNode !== this.rowNode;
        if (firstRowOfSpan) {
          return false;
        }
        return cell2.getCellSpan() === cellSpan;
      }
      /**
       * Below overrides are explicitly disabling styling and other unwanted behaviours for spannedRowCtrl
       */
      // row height should be 0 in spanned row - they're only included for purpose of aria
      onRowHeightChanged() {
      }
      // no styling spanned rows
      refreshFirstAndLastRowStyles() {
      }
      // no hover functionality for spanned rows
      addHoverFunctionality() {
      }
      resetHoveredStatus() {
      }
    };
    var SpannedRowRenderer = class extends BeanStub {
      constructor() {
        super(...arguments);
        this.beanName = "spannedRowRenderer";
        this.topCtrls = /* @__PURE__ */ new Map();
        this.bottomCtrls = /* @__PURE__ */ new Map();
        this.centerCtrls = /* @__PURE__ */ new Map();
      }
      postConstruct() {
        this.addManagedEventListeners({
          displayedRowsChanged: this.createAllCtrls.bind(this)
        });
      }
      createAllCtrls() {
        this.createCtrls("top");
        this.createCtrls("bottom");
        this.createCtrls("center");
      }
      /**
       * When displayed rows or cols change, the spanned cell ctrls need to update
       */
      createCtrls(ctrlsKey) {
        const { rowSpanSvc } = this.beans;
        const previousCtrls = this.getCtrlsMap(ctrlsKey);
        const previousCtrlsSize = previousCtrls.size;
        const rowCtrls = this.getAllRelevantRowControls(ctrlsKey);
        const newRowCtrls = /* @__PURE__ */ new Map();
        let hasNewSpans = false;
        for (const ctrl of rowCtrls) {
          if (!ctrl.isAlive()) {
            continue;
          }
          rowSpanSvc?.forEachSpannedColumn(ctrl.rowNode, (col, cellSpan) => {
            if (newRowCtrls.has(cellSpan.firstNode)) {
              return;
            }
            const existingCtrl = previousCtrls.get(cellSpan.firstNode);
            if (existingCtrl) {
              newRowCtrls.set(cellSpan.firstNode, existingCtrl);
              previousCtrls.delete(cellSpan.firstNode);
              return;
            }
            hasNewSpans = true;
            const newCtrl = new SpannedRowCtrl(cellSpan.firstNode, this.beans, false, false, false);
            newRowCtrls.set(cellSpan.firstNode, newCtrl);
          });
        }
        this.setCtrlsMap(ctrlsKey, newRowCtrls);
        const sameCount = newRowCtrls.size === previousCtrlsSize;
        if (!hasNewSpans && sameCount) {
          return;
        }
        for (const oldCtrl of previousCtrls.values()) {
          oldCtrl.destroyFirstPass(true);
          oldCtrl.destroySecondPass();
        }
        this.dispatchLocalEvent({
          type: `spannedRowsUpdated`,
          ctrlsKey
        });
      }
      // cannot use getAllRowCtrls as it returns this services row ctrls.
      getAllRelevantRowControls(ctrlsKey) {
        const { rowRenderer } = this.beans;
        switch (ctrlsKey) {
          case "top":
            return rowRenderer.topRowCtrls;
          case "bottom":
            return rowRenderer.bottomRowCtrls;
          case "center":
            return rowRenderer.allRowCtrls;
        }
      }
      getCellByPosition(cellPosition) {
        const { rowSpanSvc } = this.beans;
        const cellSpan = rowSpanSvc?.getCellSpanByPosition(cellPosition);
        if (!cellSpan) {
          return void 0;
        }
        const ctrl = this.getCtrlsMap(cellPosition.rowPinned).get(cellSpan.firstNode);
        if (!ctrl) {
          return void 0;
        }
        return ctrl.getAllCellCtrls().find((cellCtrl) => cellCtrl.column === cellPosition.column);
      }
      getCtrls(container2) {
        return [...this.getCtrlsMap(container2).values()];
      }
      destroyRowCtrls(container2) {
        for (const ctrl of this.getCtrlsMap(container2).values()) {
          ctrl.destroyFirstPass(true);
          ctrl.destroySecondPass();
        }
        this.setCtrlsMap(container2, /* @__PURE__ */ new Map());
      }
      getCtrlsMap(container2) {
        switch (container2) {
          case "top":
            return this.topCtrls;
          case "bottom":
            return this.bottomCtrls;
          default:
            return this.centerCtrls;
        }
      }
      setCtrlsMap(container2, map2) {
        switch (container2) {
          case "top":
            this.topCtrls = map2;
            break;
          case "bottom":
            this.bottomCtrls = map2;
            break;
          default:
            this.centerCtrls = map2;
            break;
        }
      }
      destroy() {
        super.destroy();
        this.destroyRowCtrls("top");
        this.destroyRowCtrls("bottom");
        this.destroyRowCtrls("center");
      }
    };
    var CellSpanModule = {
      moduleName: "CellSpan",
      version: VERSION,
      beans: [RowSpanService, SpannedRowRenderer]
    };
    var CellCustomStyleFeature = class extends BeanStub {
      constructor(cellCtrl, beans) {
        super();
        this.cellCtrl = cellCtrl;
        this.staticClasses = [];
        this.beans = beans;
        this.column = cellCtrl.column;
      }
      setComp(comp2) {
        this.cellComp = comp2;
        this.applyUserStyles();
        this.applyCellClassRules();
        this.applyClassesFromColDef();
      }
      applyCellClassRules() {
        const { column: column2, cellComp } = this;
        const colDef = column2.colDef;
        const cellClassRules = colDef.cellClassRules;
        const cellClassParams = this.getCellClassParams(column2, colDef);
        processClassRules(
          this.beans.expressionSvc,
          // if current was previous, skip
          cellClassRules === this.cellClassRules ? void 0 : this.cellClassRules,
          cellClassRules,
          cellClassParams,
          (className2) => cellComp.toggleCss(className2, true),
          (className2) => cellComp.toggleCss(className2, false)
        );
        this.cellClassRules = cellClassRules;
      }
      applyUserStyles() {
        const column2 = this.column;
        const colDef = column2.colDef;
        const cellStyle = colDef.cellStyle;
        if (!cellStyle) {
          return;
        }
        let styles2;
        if (typeof cellStyle === "function") {
          const cellStyleParams = this.getCellClassParams(column2, colDef);
          styles2 = cellStyle(cellStyleParams);
        } else {
          styles2 = cellStyle;
        }
        if (styles2) {
          this.cellComp.setUserStyles(styles2);
        }
      }
      applyClassesFromColDef() {
        const { column: column2, cellComp } = this;
        const colDef = column2.colDef;
        const cellClassParams = this.getCellClassParams(column2, colDef);
        for (const className2 of this.staticClasses) {
          cellComp.toggleCss(className2, false);
        }
        const newStaticClasses = this.beans.cellStyles.getStaticCellClasses(colDef, cellClassParams);
        this.staticClasses = newStaticClasses;
        for (const className2 of newStaticClasses) {
          cellComp.toggleCss(className2, true);
        }
      }
      getCellClassParams(column2, colDef) {
        const { value: value2, rowNode } = this.cellCtrl;
        return _addGridCommonParams(this.beans.gos, {
          value: value2,
          data: rowNode.data,
          node: rowNode,
          colDef,
          column: column2,
          rowIndex: rowNode.rowIndex
        });
      }
    };
    var CellStyleService = class extends BeanStub {
      constructor() {
        super(...arguments);
        this.beanName = "cellStyles";
      }
      processAllCellClasses(colDef, params, onApplicableClass, onNotApplicableClass) {
        processClassRules(
          this.beans.expressionSvc,
          void 0,
          colDef.cellClassRules,
          params,
          onApplicableClass,
          onNotApplicableClass
        );
        this.processStaticCellClasses(colDef, params, onApplicableClass);
      }
      getStaticCellClasses(colDef, params) {
        const { cellClass } = colDef;
        if (!cellClass) {
          return [];
        }
        let classOrClasses;
        if (typeof cellClass === "function") {
          const cellClassFunc = cellClass;
          classOrClasses = cellClassFunc(params);
        } else {
          classOrClasses = cellClass;
        }
        if (typeof classOrClasses === "string") {
          classOrClasses = [classOrClasses];
        }
        return classOrClasses || [];
      }
      createCellCustomStyleFeature(ctrl, beans) {
        return new CellCustomStyleFeature(ctrl, beans);
      }
      processStaticCellClasses(colDef, params, onApplicableClass) {
        const classOrClasses = this.getStaticCellClasses(colDef, params);
        classOrClasses.forEach((cssClassItem) => {
          onApplicableClass(cssClassItem);
        });
      }
    };
    var CellStyleModule = {
      moduleName: "CellStyle",
      version: VERSION,
      beans: [CellStyleService]
    };
    var RowStyleModule = {
      moduleName: "RowStyle",
      version: VERSION,
      beans: [RowStyleService]
    };
    function isColumnHovered(beans, column2) {
      return !!beans.colHover?.isHovered(column2);
    }
    var HoverFeature = class extends BeanStub {
      constructor(columns, element) {
        super();
        this.columns = columns;
        this.element = element;
        this.destroyManagedListeners = [];
        this.enableFeature = (enabled) => {
          const { beans, gos, element: element2, columns: columns2 } = this;
          const colHover = beans.colHover;
          const active = enabled ?? !!gos.get("columnHoverHighlight");
          if (active) {
            this.destroyManagedListeners = this.addManagedElementListeners(element2, {
              mouseover: colHover.setMouseOver.bind(colHover, columns2),
              mouseout: colHover.clearMouseOver.bind(colHover)
            });
          } else {
            for (const fn2 of this.destroyManagedListeners) {
              fn2();
            }
            this.destroyManagedListeners = [];
          }
        };
      }
      postConstruct() {
        this.addManagedPropertyListener("columnHoverHighlight", ({ currentValue }) => {
          this.enableFeature(currentValue);
        });
        this.enableFeature();
      }
      destroy() {
        super.destroy();
        this.destroyManagedListeners = null;
      }
    };
    var CSS_COLUMN_HOVER = "ag-column-hover";
    var ColumnHoverService = class extends BeanStub {
      constructor() {
        super(...arguments);
        this.beanName = "colHover";
      }
      postConstruct() {
        this.addManagedPropertyListener("columnHoverHighlight", ({ currentValue }) => {
          if (!currentValue) {
            this.clearMouseOver();
          }
        });
      }
      setMouseOver(columns) {
        this.updateState(columns);
      }
      clearMouseOver() {
        this.updateState(null);
      }
      isHovered(column2) {
        if (!this.gos.get("columnHoverHighlight")) {
          return false;
        }
        const selectedColumns = this.selectedColumns;
        return !!selectedColumns && selectedColumns.indexOf(column2) >= 0;
      }
      addHeaderColumnHoverListener(compBean, comp2, column2) {
        const listener = () => {
          const isHovered = this.isHovered(column2);
          comp2.toggleCss("ag-column-hover", isHovered);
        };
        compBean.addManagedEventListeners({ columnHoverChanged: listener });
        listener();
      }
      onCellColumnHover(column2, cellComp) {
        if (!cellComp) {
          return;
        }
        const isHovered = this.isHovered(column2);
        cellComp.toggleCss(CSS_COLUMN_HOVER, isHovered);
      }
      addHeaderFilterColumnHoverListener(compBean, comp2, column2, eGui) {
        this.createHoverFeature(compBean, [column2], eGui);
        const listener = () => {
          const hovered = this.isHovered(column2);
          comp2.toggleCss("ag-column-hover", hovered);
        };
        compBean.addManagedEventListeners({ columnHoverChanged: listener });
        listener();
      }
      createHoverFeature(compBean, columns, eGui) {
        compBean.createManagedBean(new HoverFeature(columns, eGui));
      }
      updateState(columns) {
        this.selectedColumns = columns;
        this.eventSvc.dispatchEvent({
          type: "columnHoverChanged"
        });
      }
    };
    var ColumnHoverModule = {
      moduleName: "ColumnHover",
      version: VERSION,
      beans: [ColumnHoverService],
      apiFunctions: {
        isColumnHovered
      }
    };
    var ApiEventService = class extends BeanStub {
      constructor() {
        super(...arguments);
        this.beanName = "apiEventSvc";
        this.syncListeners = /* @__PURE__ */ new Map();
        this.asyncListeners = /* @__PURE__ */ new Map();
        this.syncGlobalListeners = /* @__PURE__ */ new Set();
        this.globalListenerPairs = /* @__PURE__ */ new Map();
      }
      postConstruct() {
        this.wrapSvc = this.beans.frameworkOverrides.createGlobalEventListenerWrapper?.();
      }
      addListener(eventType, userListener) {
        const listener = this.wrapSvc?.wrap(eventType, userListener) ?? userListener;
        const async = !ALWAYS_SYNC_GLOBAL_EVENTS.has(eventType);
        const listeners = async ? this.asyncListeners : this.syncListeners;
        if (!listeners.has(eventType)) {
          listeners.set(eventType, /* @__PURE__ */ new Set());
        }
        listeners.get(eventType).add(listener);
        this.eventSvc.addListener(eventType, listener, async);
      }
      removeListener(eventType, userListener) {
        const listener = this.wrapSvc?.unwrap(eventType, userListener) ?? userListener;
        const asyncListeners = this.asyncListeners.get(eventType);
        const hasAsync = !!asyncListeners?.delete(listener);
        if (!hasAsync) {
          this.syncListeners.get(eventType)?.delete(listener);
        }
        this.eventSvc.removeListener(eventType, listener, hasAsync);
      }
      addGlobalListener(userListener) {
        const listener = this.wrapSvc?.wrapGlobal(userListener) ?? userListener;
        const syncListener = (eventType, event) => {
          if (ALWAYS_SYNC_GLOBAL_EVENTS.has(eventType)) {
            listener(eventType, event);
          }
        };
        const asyncListener = (eventType, event) => {
          if (!ALWAYS_SYNC_GLOBAL_EVENTS.has(eventType)) {
            listener(eventType, event);
          }
        };
        this.globalListenerPairs.set(userListener, { syncListener, asyncListener });
        const eventSvc = this.eventSvc;
        eventSvc.addGlobalListener(syncListener, false);
        eventSvc.addGlobalListener(asyncListener, true);
      }
      removeGlobalListener(userListener) {
        const { eventSvc, wrapSvc, globalListenerPairs } = this;
        const listener = wrapSvc?.unwrapGlobal(userListener) ?? userListener;
        const hasAsync = globalListenerPairs.has(listener);
        if (hasAsync) {
          const { syncListener, asyncListener } = globalListenerPairs.get(listener);
          eventSvc.removeGlobalListener(syncListener, false);
          eventSvc.removeGlobalListener(asyncListener, true);
          globalListenerPairs.delete(userListener);
        } else {
          this.syncGlobalListeners.delete(listener);
          eventSvc.removeGlobalListener(listener, false);
        }
      }
      destroyEventListeners(map2, async) {
        map2.forEach((listeners, eventType) => {
          listeners.forEach((listener) => this.eventSvc.removeListener(eventType, listener, async));
          listeners.clear();
        });
        map2.clear();
      }
      destroyGlobalListeners(set2, async) {
        for (const listener of set2) {
          this.eventSvc.removeGlobalListener(listener, async);
        }
        set2.clear();
      }
      destroy() {
        super.destroy();
        this.destroyEventListeners(this.syncListeners, false);
        this.destroyEventListeners(this.asyncListeners, true);
        this.destroyGlobalListeners(this.syncGlobalListeners, false);
        const { globalListenerPairs, eventSvc } = this;
        globalListenerPairs.forEach(({ syncListener, asyncListener }) => {
          eventSvc.removeGlobalListener(syncListener, false);
          eventSvc.removeGlobalListener(asyncListener, true);
        });
        globalListenerPairs.clear();
      }
    };
    function addEventListener$2(beans, eventType, listener) {
      beans.apiEventSvc?.addListener(eventType, listener);
    }
    function removeEventListener(beans, eventType, listener) {
      beans.apiEventSvc?.removeListener(eventType, listener);
    }
    function addGlobalListener(beans, listener) {
      beans.apiEventSvc?.addGlobalListener(listener);
    }
    function removeGlobalListener(beans, listener) {
      beans.apiEventSvc?.removeGlobalListener(listener);
    }
    var EventApiModule = {
      moduleName: "EventApi",
      version: VERSION,
      apiFunctions: {
        addEventListener: addEventListener$2,
        addGlobalListener,
        removeEventListener,
        removeGlobalListener
      },
      beans: [ApiEventService]
    };
    var LocaleModule = {
      moduleName: "Locale",
      version: VERSION,
      beans: [LocaleService]
    };
    var RowAutoHeightService = class extends BeanStub {
      constructor() {
        super(...arguments);
        this.beanName = "rowAutoHeight";
        this.wasEverActive = false;
        this._debouncedCalculateRowHeights = _debounce(this, this.calculateRowHeights.bind(this), 1);
      }
      /**
       * If row height has been active, request a refresh of the row heights.
       */
      requestCheckAutoHeight() {
        if (!this.wasEverActive) {
          return;
        }
        this._debouncedCalculateRowHeights();
      }
      calculateRowHeights() {
        const { visibleCols, rowModel, rowSpanSvc, pinnedRowModel } = this.beans;
        const displayedAutoHeightCols = visibleCols.autoHeightCols;
        let anyNodeChanged = false;
        const updateDisplayedRowHeights = (row2) => {
          const autoHeights = row2.__autoHeights;
          let newRowHeight = _getRowHeightForNode(this.beans, row2).height;
          for (const col of displayedAutoHeightCols) {
            let cellHeight = autoHeights?.[col.getColId()];
            const spannedCell = rowSpanSvc?.getCellSpan(col, row2);
            if (spannedCell) {
              if (spannedCell.getLastNode() !== row2) {
                continue;
              }
              cellHeight = rowSpanSvc?.getCellSpan(col, row2)?.getLastNodeAutoHeight();
              if (!cellHeight) {
                return;
              }
            }
            if (cellHeight == null) {
              if (this.colSpanSkipCell(col, row2)) {
                continue;
              }
              return;
            }
            newRowHeight = Math.max(cellHeight, newRowHeight);
          }
          if (newRowHeight !== row2.rowHeight) {
            row2.setRowHeight(newRowHeight);
            anyNodeChanged = true;
          }
        };
        pinnedRowModel?.forEachPinnedRow?.("top", updateDisplayedRowHeights);
        pinnedRowModel?.forEachPinnedRow?.("bottom", updateDisplayedRowHeights);
        rowModel.forEachDisplayedNode?.(updateDisplayedRowHeights);
        if (anyNodeChanged) {
          rowModel.onRowHeightChanged?.();
        }
      }
      /**
       * Set the cell height into the row node, and request a refresh of the row heights if there's been a change.
       * @param rowNode the node to set the auto height on
       * @param cellHeight the height to set, undefined if the cell has just been destroyed
       * @param column the column of the cell
       */
      setRowAutoHeight(rowNode, cellHeight, column2) {
        rowNode.__autoHeights ?? (rowNode.__autoHeights = {});
        if (cellHeight == void 0) {
          delete rowNode.__autoHeights[column2.getId()];
          return;
        }
        const previousCellHeight = rowNode.__autoHeights[column2.getId()];
        rowNode.__autoHeights[column2.getId()] = cellHeight;
        if (previousCellHeight !== cellHeight) {
          this.requestCheckAutoHeight();
        }
      }
      /**
       * If using col span, then cells which have been spanned over do not need an auto height value
       * @param col the column of the cell
       * @param node the node of the cell
       * @returns whether the row needs auto height value for that column
       */
      colSpanSkipCell(col, node2) {
        const { colModel, colViewport, visibleCols } = this.beans;
        if (!colModel.colSpanActive) {
          return false;
        }
        let activeColsForRow = [];
        switch (col.getPinned()) {
          case "left":
            activeColsForRow = visibleCols.getLeftColsForRow(node2);
            break;
          case "right":
            activeColsForRow = visibleCols.getRightColsForRow(node2);
            break;
          case null:
            activeColsForRow = colViewport.getColsWithinViewport(node2);
            break;
        }
        return !activeColsForRow.includes(col);
      }
      /**
       * If required, sets up observers to continuously measure changes in the cell height.
       * @param cellCtrl the cellCtrl of the cell
       * @param eCellWrapper the HTMLElement to track the height of
       * @param compBean the component bean to add the destroy/cleanup function to
       * @returns whether or not auto height has been set up on this cell
       */
      setupCellAutoHeight(cellCtrl, eCellWrapper, compBean) {
        if (!cellCtrl.column.isAutoHeight() || !eCellWrapper) {
          return false;
        }
        this.wasEverActive = true;
        const eParentCell = eCellWrapper.parentElement;
        const { rowNode, column: column2 } = cellCtrl;
        const beans = this.beans;
        const measureHeight = (timesCalled) => {
          if (this.beans.editSvc?.isEditing(cellCtrl)) {
            return;
          }
          if (!cellCtrl.isAlive() || !compBean.isAlive()) {
            return;
          }
          const { paddingTop, paddingBottom, borderBottomWidth, borderTopWidth } = _getElementSize(eParentCell);
          const extraHeight = paddingTop + paddingBottom + borderBottomWidth + borderTopWidth;
          const wrapperHeight = eCellWrapper.offsetHeight;
          const autoHeight = wrapperHeight + extraHeight;
          if (timesCalled < 5) {
            const doc2 = _getDocument(beans);
            const notYetInDom = !doc2?.contains(eCellWrapper);
            const possiblyNoContentYet = autoHeight == 0;
            if (notYetInDom || possiblyNoContentYet) {
              window.setTimeout(() => measureHeight(timesCalled + 1), 0);
              return;
            }
          }
          this.setRowAutoHeight(rowNode, autoHeight, column2);
        };
        const listener = () => measureHeight(0);
        listener();
        const destroyResizeObserver = _observeResize(beans, eCellWrapper, listener);
        compBean.addDestroyFunc(() => {
          destroyResizeObserver();
          this.setRowAutoHeight(rowNode, void 0, column2);
        });
        return true;
      }
      setAutoHeightActive(cols) {
        this.active = cols.list.some((col) => col.isVisible() && col.isAutoHeight());
      }
      /**
       * Determines if the row auto height service has cells to grow.
       * @returns true if all of the rendered rows are at least as tall as their rendered cells.
       */
      areRowsMeasured() {
        if (!this.active) {
          return true;
        }
        const rowCtrls = this.beans.rowRenderer.getAllRowCtrls();
        let renderedAutoHeightCols = null;
        for (const { rowNode } of rowCtrls) {
          if (!renderedAutoHeightCols || this.beans.colModel.colSpanActive) {
            const renderedCols = this.beans.colViewport.getColsWithinViewport(rowNode);
            renderedAutoHeightCols = renderedCols.filter((col) => col.isAutoHeight());
          }
          if (renderedAutoHeightCols.length === 0) {
            continue;
          }
          if (!rowNode.__autoHeights) {
            return false;
          }
          for (const col of renderedAutoHeightCols) {
            const cellHeight = rowNode.__autoHeights[col.getColId()];
            if (!cellHeight || rowNode.rowHeight < cellHeight) {
              return false;
            }
          }
        }
        return true;
      }
    };
    var RowAutoHeightModule = {
      moduleName: "RowAutoHeight",
      version: VERSION,
      beans: [RowAutoHeightService]
    };
    var AllCommunityModule = {
      moduleName: "AllCommunity",
      version: VERSION,
      dependsOn: [
        ClientSideRowModelModule,
        CsvExportModule,
        InfiniteRowModelModule,
        ValidationModule,
        TextEditorModule,
        NumberEditorModule,
        DateEditorModule,
        CheckboxEditorModule,
        SelectEditorModule,
        LargeTextEditorModule,
        CustomEditorModule,
        UndoRedoEditModule,
        TextFilterModule,
        NumberFilterModule,
        DateFilterModule,
        CustomFilterModule,
        QuickFilterModule,
        ExternalFilterModule,
        GridStateModule,
        AlignedGridsModule,
        PaginationModule,
        ColumnApiModule,
        RowApiModule,
        ScrollApiModule,
        RenderApiModule,
        ColumnAutoSizeModule,
        RowDragModule,
        PinnedRowModule,
        RowSelectionModule,
        ValueCacheModule,
        CellStyleModule,
        ColumnHoverModule,
        RowStyleModule,
        EventApiModule,
        CellApiModule,
        HighlightChangesModule,
        TooltipModule,
        LocaleModule,
        RowAutoHeightModule,
        DragAndDropModule,
        ClientSideRowModelApiModule,
        CellSpanModule
      ]
    };
    var BeansContext = React20.createContext({});
    var RenderModeContext = React20.createContext("default");
    var showJsComp = (compDetails, context, eParent, ref) => {
      const doNothing = !compDetails || compDetails.componentFromFramework || context.isDestroyed();
      if (doNothing) {
        return;
      }
      const promise = compDetails.newAgStackInstance();
      let comp2;
      let compGui;
      let destroyed = false;
      promise.then((c2) => {
        if (destroyed) {
          context.destroyBean(c2);
          return;
        }
        comp2 = c2;
        compGui = comp2.getGui();
        eParent.appendChild(compGui);
        setRef(ref, comp2);
      });
      return () => {
        destroyed = true;
        if (!comp2) {
          return;
        }
        compGui?.remove();
        context.destroyBean(comp2);
        if (ref) {
          setRef(ref, void 0);
        }
      };
    };
    var setRef = (ref, value2) => {
      if (!ref) {
        return;
      }
      if (ref instanceof Function) {
        const refCallback = ref;
        refCallback(value2);
      } else {
        const refObj = ref;
        refObj.current = value2;
      }
    };
    var classesList = (...list2) => {
      const filtered = list2.filter((s) => s != null && s !== "");
      return filtered.join(" ");
    };
    var CssClasses = class _CssClasses {
      constructor(...initialClasses) {
        this.classesMap = {};
        for (const className2 of initialClasses) {
          this.classesMap[className2] = true;
        }
      }
      setClass(className2, on) {
        const nothingHasChanged = !!this.classesMap[className2] == on;
        if (nothingHasChanged) {
          return this;
        }
        const res = new _CssClasses();
        res.classesMap = { ...this.classesMap };
        res.classesMap[className2] = on;
        return res;
      }
      toString() {
        const res = Object.keys(this.classesMap).filter((key2) => this.classesMap[key2]).join(" ");
        return res;
      }
    };
    var isComponentStateless = (Component2) => {
      const hasSymbol = () => typeof Symbol === "function" && Symbol.for;
      const getMemoType = () => hasSymbol() ? Symbol.for("react.memo") : 60115;
      return typeof Component2 === "function" && !(Component2.prototype && Component2.prototype.isReactComponent) || typeof Component2 === "object" && Component2.$$typeof === getMemoType();
    };
    var reactVersion = React20.version?.split(".")[0];
    var isReactVersion17Minus = reactVersion === "16" || reactVersion === "17";
    function isReact19() {
      return reactVersion === "19";
    }
    var disableFlushSync = false;
    function runWithoutFlushSync(func) {
      if (!disableFlushSync) {
        setTimeout(() => disableFlushSync = false, 0);
      }
      disableFlushSync = true;
      return func();
    }
    var agFlushSync = (useFlushSync, fn2) => {
      if (!isReactVersion17Minus && useFlushSync && !disableFlushSync) {
        ReactDOM.flushSync(fn2);
      } else {
        fn2();
      }
    };
    var agStartTransition = (fn2) => {
      if (!isReactVersion17Minus) {
        React20.startTransition(fn2);
      } else {
        fn2();
      }
    };
    function agUseSyncExternalStore(subscribe, getSnapshot, defaultSnapshot) {
      if (React20.useSyncExternalStore) {
        return React20.useSyncExternalStore(subscribe, getSnapshot);
      } else {
        return defaultSnapshot;
      }
    }
    function getNextValueIfDifferent(prev, next, maintainOrder) {
      if (next == null || prev == null) {
        return next;
      }
      if (prev === next || next.length === 0 && prev.length === 0) {
        return prev;
      }
      if (maintainOrder || prev.length === 0 && next.length > 0 || prev.length > 0 && next.length === 0) {
        return next;
      }
      const oldValues = [];
      const newValues = [];
      const prevMap = /* @__PURE__ */ new Map();
      const nextMap = /* @__PURE__ */ new Map();
      for (let i2 = 0; i2 < next.length; i2++) {
        const c2 = next[i2];
        nextMap.set(c2.instanceId, c2);
      }
      for (let i2 = 0; i2 < prev.length; i2++) {
        const c2 = prev[i2];
        prevMap.set(c2.instanceId, c2);
        if (nextMap.has(c2.instanceId)) {
          oldValues.push(c2);
        }
      }
      for (let i2 = 0; i2 < next.length; i2++) {
        const c2 = next[i2];
        const instanceId = c2.instanceId;
        if (!prevMap.has(instanceId)) {
          newValues.push(c2);
        }
      }
      if (oldValues.length === prev.length && newValues.length === 0) {
        return prev;
      }
      if (oldValues.length === 0 && newValues.length === next.length) {
        return next;
      }
      if (oldValues.length === 0) {
        return newValues;
      }
      if (newValues.length === 0) {
        return oldValues;
      }
      return [...oldValues, ...newValues];
    }
    var GroupCellRenderer = reactExports.forwardRef((props, ref) => {
      const { registry, context } = reactExports.useContext(BeansContext);
      const eGui = reactExports.useRef(null);
      const eValueRef = reactExports.useRef(null);
      const eCheckboxRef = reactExports.useRef(null);
      const eExpandedRef = reactExports.useRef(null);
      const eContractedRef = reactExports.useRef(null);
      const ctrlRef = reactExports.useRef();
      const [innerCompDetails, setInnerCompDetails] = reactExports.useState();
      const [childCount, setChildCount] = reactExports.useState();
      const [value2, setValue] = reactExports.useState();
      const [cssClasses, setCssClasses] = reactExports.useState(() => new CssClasses());
      const [expandedCssClasses, setExpandedCssClasses] = reactExports.useState(() => new CssClasses("ag-hidden"));
      const [contractedCssClasses, setContractedCssClasses] = reactExports.useState(() => new CssClasses("ag-hidden"));
      const [checkboxCssClasses, setCheckboxCssClasses] = reactExports.useState(() => new CssClasses("ag-invisible"));
      reactExports.useImperativeHandle(ref, () => {
        return {
          // force new instance when grid tries to refresh
          refresh() {
            return false;
          }
        };
      });
      reactExports.useLayoutEffect(() => {
        return showJsComp(innerCompDetails, context, eValueRef.current);
      }, [innerCompDetails]);
      const setRef2 = reactExports.useCallback((eRef) => {
        eGui.current = eRef;
        if (!eRef || context.isDestroyed()) {
          ctrlRef.current = context.destroyBean(ctrlRef.current);
          return;
        }
        const compProxy = {
          setInnerRenderer: (details, valueToDisplay) => {
            setInnerCompDetails(details);
            setValue(valueToDisplay);
          },
          setChildCount: (count) => setChildCount(count),
          toggleCss: (name2, on) => setCssClasses((prev) => prev.setClass(name2, on)),
          setContractedDisplayed: (displayed) => setContractedCssClasses((prev) => prev.setClass("ag-hidden", !displayed)),
          setExpandedDisplayed: (displayed) => setExpandedCssClasses((prev) => prev.setClass("ag-hidden", !displayed)),
          setCheckboxVisible: (visible2) => setCheckboxCssClasses((prev) => prev.setClass("ag-invisible", !visible2)),
          setCheckboxSpacing: (add2) => setCheckboxCssClasses((prev) => prev.setClass("ag-group-checkbox-spacing", add2))
        };
        const groupCellRendererCtrl = registry.createDynamicBean("groupCellRendererCtrl", true);
        if (groupCellRendererCtrl) {
          ctrlRef.current = context.createBean(groupCellRendererCtrl);
          ctrlRef.current.init(
            compProxy,
            eRef,
            eCheckboxRef.current,
            eExpandedRef.current,
            eContractedRef.current,
            GroupCellRenderer,
            props
          );
        }
      }, []);
      const className2 = reactExports.useMemo(() => `ag-cell-wrapper ${cssClasses.toString()}`, [cssClasses]);
      const expandedClassName = reactExports.useMemo(() => `ag-group-expanded ${expandedCssClasses.toString()}`, [expandedCssClasses]);
      const contractedClassName = reactExports.useMemo(
        () => `ag-group-contracted ${contractedCssClasses.toString()}`,
        [contractedCssClasses]
      );
      const checkboxClassName = reactExports.useMemo(() => `ag-group-checkbox ${checkboxCssClasses.toString()}`, [checkboxCssClasses]);
      const useFwRenderer = innerCompDetails?.componentFromFramework;
      const FwRenderer = useFwRenderer ? innerCompDetails.componentClass : void 0;
      const useValue = innerCompDetails == null && value2 != null;
      const escapedValue = _toString(value2);
      return /* @__PURE__ */ React20.createElement(
        "span",
        {
          className: className2,
          ref: setRef2,
          ...!props.colDef ? { role: ctrlRef.current?.getCellAriaRole() } : {}
        },
        /* @__PURE__ */ React20.createElement("span", { className: expandedClassName, ref: eExpandedRef }),
        /* @__PURE__ */ React20.createElement("span", { className: contractedClassName, ref: eContractedRef }),
        /* @__PURE__ */ React20.createElement("span", { className: checkboxClassName, ref: eCheckboxRef }),
        /* @__PURE__ */ React20.createElement("span", { className: "ag-group-value", ref: eValueRef }, useValue ? escapedValue : useFwRenderer ? /* @__PURE__ */ React20.createElement(FwRenderer, { ...innerCompDetails.params }) : null),
        /* @__PURE__ */ React20.createElement("span", { className: "ag-group-child-count" }, childCount)
      );
    });
    var groupCellRenderer_default = GroupCellRenderer;
    var CustomContext = reactExports.createContext({
      setMethods: () => {
      }
    });
    var CustomWrapperComp = (params) => {
      const { initialProps, addUpdateCallback, CustomComponentClass, setMethods } = params;
      const [{ key: key2, ...props }, setProps] = reactExports.useState(initialProps);
      reactExports.useEffect(() => {
        addUpdateCallback((newProps) => setProps(newProps));
      }, []);
      return /* @__PURE__ */ React20.createElement(CustomContext.Provider, { value: { setMethods } }, /* @__PURE__ */ React20.createElement(CustomComponentClass, { key: key2, ...props }));
    };
    var customWrapperComp_default = reactExports.memo(CustomWrapperComp);
    var counter = 0;
    function generateNewKey() {
      return `agPortalKey_${++counter}`;
    }
    var ReactComponent = class {
      constructor(reactComponent, portalManager, componentType, suppressFallbackMethods) {
        this.portal = null;
        this.oldPortal = null;
        this.reactComponent = reactComponent;
        this.portalManager = portalManager;
        this.componentType = componentType;
        this.suppressFallbackMethods = !!suppressFallbackMethods;
        this.statelessComponent = this.isStateless(this.reactComponent);
        this.key = generateNewKey();
        this.portalKey = generateNewKey();
        this.instanceCreated = this.isStatelessComponent() ? AgPromise.resolve(false) : new AgPromise((resolve) => {
          this.resolveInstanceCreated = resolve;
        });
      }
      getGui() {
        return this.eParentElement;
      }
      /** `getGui()` returns the parent element. This returns the actual root element. */
      getRootElement() {
        const firstChild = this.eParentElement.firstChild;
        return firstChild;
      }
      destroy() {
        if (this.componentInstance && typeof this.componentInstance.destroy == "function") {
          this.componentInstance.destroy();
        }
        const portal = this.portal;
        if (portal) {
          this.portalManager.destroyPortal(portal);
        }
      }
      createParentElement(params) {
        const componentWrappingElement = this.portalManager.getComponentWrappingElement();
        const eParentElement = document.createElement(componentWrappingElement || "div");
        eParentElement.classList.add("ag-react-container");
        params.reactContainer = eParentElement;
        return eParentElement;
      }
      statelessComponentRendered() {
        return this.eParentElement.childElementCount > 0 || this.eParentElement.childNodes.length > 0;
      }
      getFrameworkComponentInstance() {
        return this.componentInstance;
      }
      isStatelessComponent() {
        return this.statelessComponent;
      }
      getReactComponentName() {
        return this.reactComponent.name;
      }
      getMemoType() {
        return this.hasSymbol() ? Symbol.for("react.memo") : 60115;
      }
      hasSymbol() {
        return typeof Symbol === "function" && Symbol.for;
      }
      isStateless(Component2) {
        return typeof Component2 === "function" && !(Component2.prototype && Component2.prototype.isReactComponent) || typeof Component2 === "object" && Component2.$$typeof === this.getMemoType();
      }
      hasMethod(name2) {
        const frameworkComponentInstance = this.getFrameworkComponentInstance();
        return !!frameworkComponentInstance && frameworkComponentInstance[name2] != null || this.fallbackMethodAvailable(name2);
      }
      callMethod(name2, args2) {
        const frameworkComponentInstance = this.getFrameworkComponentInstance();
        if (this.isStatelessComponent()) {
          return this.fallbackMethod(name2, !!args2 && args2[0] ? args2[0] : {});
        } else if (!frameworkComponentInstance) {
          setTimeout(() => this.callMethod(name2, args2));
          return;
        }
        const method = frameworkComponentInstance[name2];
        if (method) {
          return method.apply(frameworkComponentInstance, args2);
        }
        if (this.fallbackMethodAvailable(name2)) {
          return this.fallbackMethod(name2, !!args2 && args2[0] ? args2[0] : {});
        }
      }
      addMethod(name2, callback) {
        this[name2] = callback;
      }
      init(params) {
        this.eParentElement = this.createParentElement(params);
        this.createOrUpdatePortal(params);
        return new AgPromise((resolve) => this.createReactComponent(resolve));
      }
      createOrUpdatePortal(params) {
        if (!this.isStatelessComponent()) {
          this.ref = (element) => {
            this.componentInstance = element;
            this.resolveInstanceCreated?.(true);
            this.resolveInstanceCreated = void 0;
          };
          params.ref = this.ref;
        }
        this.reactElement = this.createElement(this.reactComponent, { ...params, key: this.key });
        this.portal = reactDomExports.createPortal(
          this.reactElement,
          this.eParentElement,
          this.portalKey
          // fixed deltaRowModeRefreshCompRenderer
        );
      }
      createElement(reactComponent, props) {
        return reactExports.createElement(reactComponent, props);
      }
      createReactComponent(resolve) {
        this.portalManager.mountReactPortal(this.portal, this, resolve);
      }
      rendered() {
        return this.isStatelessComponent() && this.statelessComponentRendered() || !!(!this.isStatelessComponent() && this.getFrameworkComponentInstance());
      }
      /*
       * fallback methods - these will be invoked if a corresponding instance method is not present
       * for example if refresh is called and is not available on the component instance, then refreshComponent on this
       * class will be invoked instead
       *
       * Currently only refresh is supported
       */
      refreshComponent(args2) {
        this.oldPortal = this.portal;
        this.createOrUpdatePortal(args2);
        this.portalManager.updateReactPortal(this.oldPortal, this.portal);
      }
      fallbackMethod(name2, params) {
        const method = this[`${name2}Component`];
        if (!this.suppressFallbackMethods && !!method) {
          return method.bind(this)(params);
        }
      }
      fallbackMethodAvailable(name2) {
        if (this.suppressFallbackMethods) {
          return false;
        }
        const method = this[`${name2}Component`];
        return !!method;
      }
    };
    function addOptionalMethods(optionalMethodNames, providedMethods, component) {
      for (const methodName of optionalMethodNames) {
        const providedMethod = providedMethods[methodName];
        if (providedMethod) {
          component[methodName] = providedMethod;
        }
      }
    }
    var CustomComponentWrapper = class extends ReactComponent {
      constructor() {
        super(...arguments);
        this.awaitUpdateCallback = new AgPromise((resolve) => {
          this.resolveUpdateCallback = resolve;
        });
        this.wrapperComponent = customWrapperComp_default;
      }
      init(params) {
        this.sourceParams = params;
        return super.init(this.getProps());
      }
      addMethod() {
      }
      getInstance() {
        return this.instanceCreated.then(() => this.componentInstance);
      }
      getFrameworkComponentInstance() {
        return this;
      }
      createElement(reactComponent, props) {
        return super.createElement(this.wrapperComponent, {
          initialProps: props,
          CustomComponentClass: reactComponent,
          setMethods: (methods) => this.setMethods(methods),
          addUpdateCallback: (callback) => {
            this.updateCallback = () => {
              callback(this.getProps());
              return new AgPromise((resolve) => {
                setTimeout(() => {
                  resolve();
                });
              });
            };
            this.resolveUpdateCallback();
          }
        });
      }
      setMethods(methods) {
        this.providedMethods = methods;
        addOptionalMethods(this.getOptionalMethods(), this.providedMethods, this);
      }
      getOptionalMethods() {
        return [];
      }
      getProps() {
        return {
          ...this.sourceParams,
          key: this.key,
          ref: this.ref
        };
      }
      refreshProps() {
        if (this.updateCallback) {
          return this.updateCallback();
        }
        return new AgPromise(
          (resolve) => this.awaitUpdateCallback.then(() => {
            this.updateCallback().then(() => resolve());
          })
        );
      }
    };
    var CellRendererComponentWrapper = class extends CustomComponentWrapper {
      refresh(params) {
        this.sourceParams = params;
        this.refreshProps();
        return true;
      }
    };
    var DateComponentWrapper = class extends CustomComponentWrapper {
      constructor() {
        super(...arguments);
        this.date = null;
        this.onDateChange = (date) => this.updateDate(date);
      }
      getDate() {
        return this.date;
      }
      setDate(date) {
        this.date = date;
        this.refreshProps();
      }
      refresh(params) {
        this.sourceParams = params;
        this.refreshProps();
      }
      getOptionalMethods() {
        return ["afterGuiAttached", "setInputPlaceholder", "setInputAriaLabel", "setDisabled"];
      }
      updateDate(date) {
        this.setDate(date);
        this.sourceParams.onDateChanged();
      }
      getProps() {
        const props = super.getProps();
        props.date = this.date;
        props.onDateChange = this.onDateChange;
        delete props.onDateChanged;
        return props;
      }
    };
    var DragAndDropImageComponentWrapper = class extends CustomComponentWrapper {
      constructor() {
        super(...arguments);
        this.label = "";
        this.icon = null;
        this.shake = false;
      }
      setIcon(iconName, shake) {
        this.icon = iconName;
        this.shake = shake;
        this.refreshProps();
      }
      setLabel(label2) {
        this.label = label2;
        this.refreshProps();
      }
      getProps() {
        const props = super.getProps();
        const { label: label2, icon: icon2, shake } = this;
        props.label = label2;
        props.icon = icon2;
        props.shake = shake;
        return props;
      }
    };
    var FilterComponentWrapper = class extends CustomComponentWrapper {
      constructor() {
        super(...arguments);
        this.model = null;
        this.onModelChange = (model2) => this.updateModel(model2);
        this.onUiChange = () => this.sourceParams.filterModifiedCallback();
        this.expectingNewMethods = true;
        this.hasBeenActive = false;
        this.awaitSetMethodsCallback = new AgPromise((resolve) => {
          this.resolveSetMethodsCallback = resolve;
        });
      }
      isFilterActive() {
        return this.model != null;
      }
      doesFilterPass(params) {
        return this.providedMethods.doesFilterPass(params);
      }
      getModel() {
        return this.model;
      }
      setModel(model2) {
        this.expectingNewMethods = true;
        this.model = model2;
        this.hasBeenActive || (this.hasBeenActive = this.isFilterActive());
        return this.refreshProps();
      }
      refresh(newParams) {
        this.sourceParams = newParams;
        this.refreshProps();
        return true;
      }
      afterGuiAttached(params) {
        const providedMethods = this.providedMethods;
        if (!providedMethods) {
          this.awaitSetMethodsCallback.then(() => this.providedMethods?.afterGuiAttached?.(params));
        } else {
          providedMethods.afterGuiAttached?.(params);
        }
      }
      getOptionalMethods() {
        return ["afterGuiDetached", "onNewRowsLoaded", "getModelAsString", "onAnyFilterChanged"];
      }
      setMethods(methods) {
        if (this.expectingNewMethods === false && this.hasBeenActive && this.providedMethods?.doesFilterPass !== methods?.doesFilterPass) {
          setTimeout(() => {
            this.sourceParams.filterChangedCallback();
          });
        }
        this.expectingNewMethods = false;
        super.setMethods(methods);
        this.resolveSetMethodsCallback();
        this.resolveFilterPassCallback?.();
        this.resolveFilterPassCallback = void 0;
      }
      updateModel(model2) {
        this.resolveFilterPassCallback?.();
        const awaitFilterPassCallback = new AgPromise((resolve) => {
          this.resolveFilterPassCallback = resolve;
        });
        this.setModel(model2).then(() => {
          awaitFilterPassCallback.then(() => {
            this.sourceParams.filterChangedCallback();
          });
        });
      }
      getProps() {
        const props = super.getProps();
        props.model = this.model;
        props.onModelChange = this.onModelChange;
        props.onUiChange = this.onUiChange;
        delete props.filterChangedCallback;
        return props;
      }
    };
    var FilterDisplayComponentWrapper = class extends CustomComponentWrapper {
      constructor() {
        super(...arguments);
        this.awaitSetMethodsCallback = new AgPromise((resolve) => {
          this.resolveSetMethodsCallback = resolve;
        });
      }
      refresh(newParams) {
        this.sourceParams = newParams;
        this.refreshProps();
        return true;
      }
      afterGuiAttached(params) {
        const providedMethods = this.providedMethods;
        if (!providedMethods) {
          this.awaitSetMethodsCallback.then(() => this.providedMethods?.afterGuiAttached?.(params));
        } else {
          providedMethods.afterGuiAttached?.(params);
        }
      }
      getOptionalMethods() {
        return ["afterGuiDetached", "onNewRowsLoaded", "onAnyFilterChanged"];
      }
      setMethods(methods) {
        super.setMethods(methods);
        this.resolveSetMethodsCallback();
      }
    };
    function updateFloatingFilterParent(params, model2) {
      params.parentFilterInstance((instance) => {
        (instance.setModel(model2) || AgPromise.resolve()).then(() => {
          params.filterParams.filterChangedCallback();
        });
      });
    }
    var FloatingFilterComponentProxy = class {
      constructor(floatingFilterParams, refreshProps) {
        this.floatingFilterParams = floatingFilterParams;
        this.refreshProps = refreshProps;
        this.model = null;
        this.onModelChange = (model2) => this.updateModel(model2);
      }
      getProps() {
        return {
          ...this.floatingFilterParams,
          model: this.model,
          onModelChange: this.onModelChange
        };
      }
      onParentModelChanged(parentModel) {
        this.model = parentModel;
        this.refreshProps();
      }
      refresh(params) {
        this.floatingFilterParams = params;
        this.refreshProps();
      }
      setMethods(methods) {
        addOptionalMethods(this.getOptionalMethods(), methods, this);
      }
      getOptionalMethods() {
        return ["afterGuiAttached"];
      }
      updateModel(model2) {
        this.model = model2;
        this.refreshProps();
        updateFloatingFilterParent(this.floatingFilterParams, model2);
      }
    };
    var FloatingFilterComponentWrapper = class extends CustomComponentWrapper {
      constructor() {
        super(...arguments);
        this.model = null;
        this.onModelChange = (model2) => this.updateModel(model2);
      }
      onParentModelChanged(parentModel) {
        this.model = parentModel;
        this.refreshProps();
      }
      refresh(newParams) {
        this.sourceParams = newParams;
        this.refreshProps();
      }
      getOptionalMethods() {
        return ["afterGuiAttached"];
      }
      updateModel(model2) {
        this.model = model2;
        this.refreshProps();
        updateFloatingFilterParent(this.sourceParams, model2);
      }
      getProps() {
        const props = super.getProps();
        props.model = this.model;
        props.onModelChange = this.onModelChange;
        return props;
      }
    };
    var FloatingFilterDisplayComponentWrapper = class extends CustomComponentWrapper {
      refresh(newParams) {
        this.sourceParams = newParams;
        this.refreshProps();
      }
      getOptionalMethods() {
        return ["afterGuiAttached"];
      }
    };
    var InnerHeaderComponentWrapper = class extends CustomComponentWrapper {
      refresh(params) {
        this.sourceParams = params;
        this.refreshProps();
        return true;
      }
    };
    var LoadingOverlayComponentWrapper = class extends CustomComponentWrapper {
      refresh(params) {
        this.sourceParams = params;
        this.refreshProps();
      }
    };
    var MenuItemComponentWrapper = class extends CustomComponentWrapper {
      constructor() {
        super(...arguments);
        this.active = false;
        this.expanded = false;
        this.onActiveChange = (active) => this.updateActive(active);
      }
      setActive(active) {
        this.awaitSetActive(active);
      }
      setExpanded(expanded) {
        this.expanded = expanded;
        this.refreshProps();
      }
      getOptionalMethods() {
        return ["select", "configureDefaults"];
      }
      awaitSetActive(active) {
        this.active = active;
        return this.refreshProps();
      }
      updateActive(active) {
        const result2 = this.awaitSetActive(active);
        if (active) {
          result2.then(() => this.sourceParams.onItemActivated());
        }
      }
      getProps() {
        const props = super.getProps();
        props.active = this.active;
        props.expanded = this.expanded;
        props.onActiveChange = this.onActiveChange;
        delete props.onItemActivated;
        return props;
      }
    };
    var NoRowsOverlayComponentWrapper = class extends CustomComponentWrapper {
      refresh(params) {
        this.sourceParams = params;
        this.refreshProps();
      }
    };
    var StatusPanelComponentWrapper = class extends CustomComponentWrapper {
      refresh(params) {
        this.sourceParams = params;
        this.refreshProps();
        return true;
      }
    };
    var ToolPanelComponentWrapper = class extends CustomComponentWrapper {
      constructor() {
        super(...arguments);
        this.onStateChange = (state) => this.updateState(state);
      }
      refresh(params) {
        this.sourceParams = params;
        this.refreshProps();
        return true;
      }
      getState() {
        return this.state;
      }
      updateState(state) {
        this.state = state;
        this.refreshProps();
        this.sourceParams.onStateUpdated();
      }
      getProps() {
        const props = super.getProps();
        props.state = this.state;
        props.onStateChange = this.onStateChange;
        return props;
      }
    };
    function warnReactiveCustomComponents() {
      _warn(231);
    }
    var MAX_COMPONENT_CREATION_TIME_IN_MS = 1e3;
    var PortalManager = class {
      constructor(refresher, wrappingElement, maxComponentCreationTimeMs) {
        this.destroyed = false;
        this.portals = [];
        this.hasPendingPortalUpdate = false;
        this.wrappingElement = wrappingElement ? wrappingElement : "div";
        this.refresher = refresher;
        this.maxComponentCreationTimeMs = maxComponentCreationTimeMs ? maxComponentCreationTimeMs : MAX_COMPONENT_CREATION_TIME_IN_MS;
      }
      getPortals() {
        return this.portals;
      }
      destroy() {
        this.destroyed = true;
      }
      destroyPortal(portal) {
        this.portals = this.portals.filter((curPortal) => curPortal !== portal);
        this.batchUpdate();
      }
      getComponentWrappingElement() {
        return this.wrappingElement;
      }
      mountReactPortal(portal, reactComponent, resolve) {
        this.portals = [...this.portals, portal];
        this.waitForInstance(reactComponent, resolve);
        this.batchUpdate();
      }
      updateReactPortal(oldPortal, newPortal) {
        this.portals[this.portals.indexOf(oldPortal)] = newPortal;
        this.batchUpdate();
      }
      batchUpdate() {
        if (this.hasPendingPortalUpdate) {
          return;
        }
        setTimeout(() => {
          if (!this.destroyed) {
            this.refresher();
            this.hasPendingPortalUpdate = false;
          }
        });
        this.hasPendingPortalUpdate = true;
      }
      waitForInstance(reactComponent, resolve, startTime = Date.now()) {
        if (this.destroyed) {
          resolve(null);
          return;
        }
        if (reactComponent.rendered()) {
          resolve(reactComponent);
        } else {
          if (Date.now() - startTime >= this.maxComponentCreationTimeMs && !this.hasPendingPortalUpdate) {
            agFlushSync(true, () => this.refresher());
            if (reactComponent.rendered()) {
              resolve(reactComponent);
            }
            return;
          }
          window.setTimeout(() => {
            this.waitForInstance(reactComponent, resolve, startTime);
          });
        }
      }
    };
    var HeaderCellComp = ({ ctrl }) => {
      const isAlive = ctrl.isAlive();
      const { context } = reactExports.useContext(BeansContext);
      const [userCompDetails, setUserCompDetails] = reactExports.useState();
      const [userStyles, setUserStyles] = reactExports.useState();
      const compBean = reactExports.useRef();
      const eGui = reactExports.useRef(null);
      const eResize = reactExports.useRef(null);
      const eHeaderCompWrapper = reactExports.useRef(null);
      const userCompRef = reactExports.useRef();
      const cssManager = reactExports.useRef();
      if (isAlive && !cssManager.current) {
        cssManager.current = new CssClassManager(() => eGui.current);
      }
      const setRef2 = reactExports.useCallback((eRef) => {
        eGui.current = eRef;
        if (!eRef || !ctrl.isAlive() || context.isDestroyed()) {
          compBean.current = context.destroyBean(compBean.current);
          return;
        }
        compBean.current = context.createBean(new EmptyBean());
        const refreshSelectAllGui = () => {
          const selectAllGui = ctrl.getSelectAllGui();
          if (selectAllGui) {
            eResize.current?.insertAdjacentElement("afterend", selectAllGui);
            compBean.current.addDestroyFunc(() => selectAllGui.remove());
          }
        };
        const compProxy = {
          setWidth: (width) => {
            if (eGui.current) {
              eGui.current.style.width = width;
            }
          },
          toggleCss: (name2, on) => cssManager.current.toggleCss(name2, on),
          setUserStyles: (styles2) => setUserStyles(styles2),
          setAriaSort: (sort2) => {
            if (eGui.current) {
              sort2 ? _setAriaSort(eGui.current, sort2) : _removeAriaSort(eGui.current);
            }
          },
          setUserCompDetails: (compDetails) => setUserCompDetails(compDetails),
          getUserCompInstance: () => userCompRef.current || void 0,
          refreshSelectAllGui,
          removeSelectAllGui: () => ctrl.getSelectAllGui()?.remove()
        };
        ctrl.setComp(compProxy, eRef, eResize.current, eHeaderCompWrapper.current, compBean.current);
        refreshSelectAllGui();
      }, []);
      reactExports.useLayoutEffect(
        () => showJsComp(userCompDetails, context, eHeaderCompWrapper.current, userCompRef),
        [userCompDetails]
      );
      reactExports.useEffect(() => {
        ctrl.setDragSource(eGui.current);
      }, [userCompDetails]);
      const userCompStateless = reactExports.useMemo(() => {
        const res = userCompDetails?.componentFromFramework && isComponentStateless(userCompDetails.componentClass);
        return !!res;
      }, [userCompDetails]);
      const reactUserComp = userCompDetails?.componentFromFramework;
      const UserCompClass = userCompDetails?.componentClass;
      return /* @__PURE__ */ React20.createElement("div", { ref: setRef2, style: userStyles, className: "ag-header-cell", role: "columnheader" }, /* @__PURE__ */ React20.createElement("div", { ref: eResize, className: "ag-header-cell-resize", role: "presentation" }), /* @__PURE__ */ React20.createElement("div", { ref: eHeaderCompWrapper, className: "ag-header-cell-comp-wrapper", role: "presentation" }, reactUserComp ? userCompStateless ? /* @__PURE__ */ React20.createElement(UserCompClass, { ...userCompDetails.params }) : /* @__PURE__ */ React20.createElement(UserCompClass, { ...userCompDetails.params, ref: userCompRef }) : null));
    };
    var headerCellComp_default = reactExports.memo(HeaderCellComp);
    var FloatingFilterDisplayComponentProxy = class {
      constructor(floatingFilterParams, refreshProps) {
        this.floatingFilterParams = floatingFilterParams;
        this.refreshProps = refreshProps;
      }
      getProps() {
        return this.floatingFilterParams;
      }
      refresh(params) {
        this.floatingFilterParams = params;
        this.refreshProps();
      }
      setMethods(methods) {
        addOptionalMethods(this.getOptionalMethods(), methods, this);
      }
      getOptionalMethods() {
        return ["afterGuiAttached"];
      }
    };
    var HeaderFilterCellComp = ({ ctrl }) => {
      const { context, gos } = reactExports.useContext(BeansContext);
      const [userStyles, setUserStyles] = reactExports.useState();
      const [cssClasses, setCssClasses] = reactExports.useState(
        () => new CssClasses("ag-header-cell", "ag-floating-filter")
      );
      const [cssBodyClasses, setBodyCssClasses] = reactExports.useState(() => new CssClasses());
      const [cssButtonWrapperClasses, setButtonWrapperCssClasses] = reactExports.useState(
        () => new CssClasses("ag-floating-filter-button", "ag-hidden")
      );
      const [buttonWrapperAriaHidden, setButtonWrapperAriaHidden] = reactExports.useState("false");
      const [userCompDetails, setUserCompDetails] = reactExports.useState();
      const [, setRenderKey] = reactExports.useState(1);
      const compBean = reactExports.useRef();
      const eGui = reactExports.useRef(null);
      const eFloatingFilterBody = reactExports.useRef(null);
      const eButtonWrapper = reactExports.useRef(null);
      const eButtonShowMainFilter = reactExports.useRef(null);
      const userCompResolve = reactExports.useRef();
      const userCompPromise = reactExports.useRef();
      const userCompRef = (value2) => {
        if (value2 == null) {
          return;
        }
        userCompResolve.current && userCompResolve.current(value2);
      };
      const setRef2 = reactExports.useCallback((eRef) => {
        eGui.current = eRef;
        if (!eRef || !ctrl.isAlive() || context.isDestroyed()) {
          compBean.current = context.destroyBean(compBean.current);
          return;
        }
        compBean.current = context.createBean(new EmptyBean());
        userCompPromise.current = new AgPromise((resolve) => {
          userCompResolve.current = resolve;
        });
        const compProxy = {
          toggleCss: (name2, on) => setCssClasses((prev) => prev.setClass(name2, on)),
          setUserStyles: (styles2) => setUserStyles(styles2),
          addOrRemoveBodyCssClass: (name2, on) => setBodyCssClasses((prev) => prev.setClass(name2, on)),
          setButtonWrapperDisplayed: (displayed) => {
            setButtonWrapperCssClasses((prev) => prev.setClass("ag-hidden", !displayed));
            setButtonWrapperAriaHidden(!displayed ? "true" : "false");
          },
          setWidth: (width) => {
            if (eGui.current) {
              eGui.current.style.width = width;
            }
          },
          setCompDetails: (compDetails) => setUserCompDetails(compDetails),
          getFloatingFilterComp: () => userCompPromise.current ? userCompPromise.current : null,
          setMenuIcon: (eIcon) => eButtonShowMainFilter.current?.appendChild(eIcon)
        };
        ctrl.setComp(compProxy, eRef, eButtonShowMainFilter.current, eFloatingFilterBody.current, compBean.current);
      }, []);
      reactExports.useLayoutEffect(
        () => showJsComp(userCompDetails, context, eFloatingFilterBody.current, userCompRef),
        [userCompDetails]
      );
      const className2 = reactExports.useMemo(() => cssClasses.toString(), [cssClasses]);
      const bodyClassName = reactExports.useMemo(() => cssBodyClasses.toString(), [cssBodyClasses]);
      const buttonWrapperClassName = reactExports.useMemo(() => cssButtonWrapperClasses.toString(), [cssButtonWrapperClasses]);
      const userCompStateless = reactExports.useMemo(() => {
        const res = userCompDetails && userCompDetails.componentFromFramework && isComponentStateless(userCompDetails.componentClass);
        return !!res;
      }, [userCompDetails]);
      const reactiveCustomComponents = reactExports.useMemo(() => gos.get("reactiveCustomComponents"), []);
      const enableFilterHandlers = reactExports.useMemo(() => gos.get("enableFilterHandlers"), []);
      const [floatingFilterCompProxy, setFloatingFilterCompProxy] = reactExports.useState();
      reactExports.useEffect(() => {
        if (userCompDetails?.componentFromFramework) {
          if (reactiveCustomComponents) {
            const ProxyClass = enableFilterHandlers ? FloatingFilterDisplayComponentProxy : FloatingFilterComponentProxy;
            const compProxy = new ProxyClass(userCompDetails.params, () => setRenderKey((prev) => prev + 1));
            userCompRef(compProxy);
            setFloatingFilterCompProxy(compProxy);
          } else {
            warnReactiveCustomComponents();
          }
        }
      }, [userCompDetails]);
      const floatingFilterProps = floatingFilterCompProxy?.getProps();
      const reactUserComp = userCompDetails?.componentFromFramework;
      const UserCompClass = userCompDetails?.componentClass;
      return /* @__PURE__ */ React20.createElement("div", { ref: setRef2, style: userStyles, className: className2, role: "gridcell" }, /* @__PURE__ */ React20.createElement("div", { ref: eFloatingFilterBody, className: bodyClassName, role: "presentation" }, reactUserComp ? reactiveCustomComponents ? floatingFilterProps && /* @__PURE__ */ React20.createElement(
        CustomContext.Provider,
        {
          value: {
            setMethods: (methods) => floatingFilterCompProxy.setMethods(methods)
          }
        },
        /* @__PURE__ */ React20.createElement(UserCompClass, { ...floatingFilterProps })
      ) : /* @__PURE__ */ React20.createElement(UserCompClass, { ...userCompDetails.params, ref: userCompStateless ? () => {
      } : userCompRef }) : null), /* @__PURE__ */ React20.createElement(
        "div",
        {
          ref: eButtonWrapper,
          "aria-hidden": buttonWrapperAriaHidden,
          className: buttonWrapperClassName,
          role: "presentation"
        },
        /* @__PURE__ */ React20.createElement(
          "button",
          {
            ref: eButtonShowMainFilter,
            type: "button",
            className: "ag-button ag-floating-filter-button-button",
            tabIndex: -1
          }
        )
      ));
    };
    var headerFilterCellComp_default = reactExports.memo(HeaderFilterCellComp);
    var HeaderGroupCellComp = ({ ctrl }) => {
      const { context } = reactExports.useContext(BeansContext);
      const [userStyles, setUserStyles] = reactExports.useState();
      const [cssClasses, setCssClasses] = reactExports.useState(() => new CssClasses());
      const [cssResizableClasses, setResizableCssClasses] = reactExports.useState(() => new CssClasses());
      const [resizableAriaHidden, setResizableAriaHidden] = reactExports.useState("false");
      const [ariaExpanded, setAriaExpanded] = reactExports.useState();
      const [userCompDetails, setUserCompDetails] = reactExports.useState();
      const compBean = reactExports.useRef();
      const eGui = reactExports.useRef(null);
      const eResize = reactExports.useRef(null);
      const eHeaderCompWrapper = reactExports.useRef(null);
      const userCompRef = reactExports.useRef();
      const setRef2 = reactExports.useCallback((eRef) => {
        eGui.current = eRef;
        if (!eRef || !ctrl.isAlive() || context.isDestroyed()) {
          compBean.current = context.destroyBean(compBean.current);
          return;
        }
        compBean.current = context.createBean(new EmptyBean());
        const compProxy = {
          setWidth: (width) => {
            if (eGui.current) {
              eGui.current.style.width = width;
            }
          },
          toggleCss: (name2, on) => setCssClasses((prev) => prev.setClass(name2, on)),
          setUserStyles: (styles2) => setUserStyles(styles2),
          setHeaderWrapperHidden: (hidden2) => {
            const headerCompWrapper = eHeaderCompWrapper.current;
            if (!headerCompWrapper) {
              return;
            }
            if (hidden2) {
              headerCompWrapper.style.setProperty("display", "none");
            } else {
              headerCompWrapper.style.removeProperty("display");
            }
          },
          setHeaderWrapperMaxHeight: (value2) => {
            const headerCompWrapper = eHeaderCompWrapper.current;
            if (!headerCompWrapper) {
              return;
            }
            if (value2 != null) {
              headerCompWrapper.style.setProperty("max-height", `${value2}px`);
            } else {
              headerCompWrapper.style.removeProperty("max-height");
            }
            headerCompWrapper.classList.toggle("ag-header-cell-comp-wrapper-limited-height", value2 != null);
          },
          setUserCompDetails: (compDetails) => setUserCompDetails(compDetails),
          setResizableDisplayed: (displayed) => {
            setResizableCssClasses((prev) => prev.setClass("ag-hidden", !displayed));
            setResizableAriaHidden(!displayed ? "true" : "false");
          },
          setAriaExpanded: (expanded) => setAriaExpanded(expanded),
          getUserCompInstance: () => userCompRef.current || void 0
        };
        ctrl.setComp(compProxy, eRef, eResize.current, eHeaderCompWrapper.current, compBean.current);
      }, []);
      reactExports.useLayoutEffect(() => showJsComp(userCompDetails, context, eHeaderCompWrapper.current), [userCompDetails]);
      reactExports.useEffect(() => {
        if (eGui.current) {
          ctrl.setDragSource(eGui.current);
        }
      }, [userCompDetails]);
      const userCompStateless = reactExports.useMemo(() => {
        const res = userCompDetails?.componentFromFramework && isComponentStateless(userCompDetails.componentClass);
        return !!res;
      }, [userCompDetails]);
      const className2 = reactExports.useMemo(() => "ag-header-group-cell " + cssClasses.toString(), [cssClasses]);
      const resizableClassName = reactExports.useMemo(
        () => "ag-header-cell-resize " + cssResizableClasses.toString(),
        [cssResizableClasses]
      );
      const reactUserComp = userCompDetails?.componentFromFramework;
      const UserCompClass = userCompDetails?.componentClass;
      return /* @__PURE__ */ React20.createElement("div", { ref: setRef2, style: userStyles, className: className2, role: "columnheader", "aria-expanded": ariaExpanded }, /* @__PURE__ */ React20.createElement("div", { ref: eHeaderCompWrapper, className: "ag-header-cell-comp-wrapper", role: "presentation" }, reactUserComp ? userCompStateless ? /* @__PURE__ */ React20.createElement(UserCompClass, { ...userCompDetails.params }) : /* @__PURE__ */ React20.createElement(UserCompClass, { ...userCompDetails.params, ref: userCompRef }) : null), /* @__PURE__ */ React20.createElement("div", { ref: eResize, "aria-hidden": resizableAriaHidden, className: resizableClassName }));
    };
    var headerGroupCellComp_default = reactExports.memo(HeaderGroupCellComp);
    var HeaderRowComp = ({ ctrl }) => {
      const { gos, context } = reactExports.useContext(BeansContext);
      const { topOffset, rowHeight } = reactExports.useMemo(() => ctrl.getTopAndHeight(), []);
      const tabIndex = reactExports.useMemo(() => gos.get("tabIndex"), []);
      const [ariaRowIndex, setAriaRowIndex] = reactExports.useState(() => ctrl.getAriaRowIndex());
      const className2 = ctrl.headerRowClass;
      const [height, setHeight] = reactExports.useState(() => rowHeight + "px");
      const [top2, setTop] = reactExports.useState(() => topOffset + "px");
      const cellCtrlsRef = reactExports.useRef(null);
      const [cellCtrls, setCellCtrls] = reactExports.useState(() => ctrl.getUpdatedHeaderCtrls());
      const compBean = reactExports.useRef();
      const eGui = reactExports.useRef(null);
      const setRef2 = reactExports.useCallback((eRef) => {
        eGui.current = eRef;
        if (!eRef || !ctrl.isAlive() || context.isDestroyed()) {
          compBean.current = context.destroyBean(compBean.current);
          return;
        }
        compBean.current = context.createBean(new EmptyBean());
        const compProxy = {
          setHeight: (height2) => setHeight(height2),
          setTop: (top22) => setTop(top22),
          setHeaderCtrls: (ctrls, forceOrder, afterScroll) => {
            const prevCellCtrls = cellCtrlsRef.current;
            const nextCells = getNextValueIfDifferent(prevCellCtrls, ctrls, forceOrder);
            if (nextCells !== prevCellCtrls) {
              cellCtrlsRef.current = nextCells;
              agFlushSync(afterScroll, () => setCellCtrls(nextCells));
            }
          },
          setWidth: (width) => {
            if (eGui.current) {
              eGui.current.style.width = width;
            }
          },
          setRowIndex: (rowIndex) => {
            setAriaRowIndex(rowIndex);
          }
        };
        ctrl.setComp(compProxy, compBean.current, false);
      }, []);
      const style2 = reactExports.useMemo(
        () => ({
          height,
          top: top2
        }),
        [height, top2]
      );
      const createCellJsx = reactExports.useCallback((cellCtrl) => {
        switch (ctrl.type) {
          case "group":
            return /* @__PURE__ */ React20.createElement(headerGroupCellComp_default, { ctrl: cellCtrl, key: cellCtrl.instanceId });
          case "filter":
            return /* @__PURE__ */ React20.createElement(headerFilterCellComp_default, { ctrl: cellCtrl, key: cellCtrl.instanceId });
          default:
            return /* @__PURE__ */ React20.createElement(headerCellComp_default, { ctrl: cellCtrl, key: cellCtrl.instanceId });
        }
      }, []);
      return /* @__PURE__ */ React20.createElement(
        "div",
        {
          ref: setRef2,
          className: className2,
          role: "row",
          style: style2,
          tabIndex,
          "aria-rowindex": ariaRowIndex
        },
        cellCtrls.map(createCellJsx)
      );
    };
    var headerRowComp_default = reactExports.memo(HeaderRowComp);
    var HeaderRowContainerComp = ({ pinned }) => {
      const [displayed, setDisplayed] = reactExports.useState(true);
      const [headerRowCtrls, setHeaderRowCtrls] = reactExports.useState([]);
      const { context } = reactExports.useContext(BeansContext);
      const eGui = reactExports.useRef(null);
      const eCenterContainer = reactExports.useRef(null);
      const headerRowCtrlRef = reactExports.useRef();
      const pinnedLeft = pinned === "left";
      const pinnedRight = pinned === "right";
      const centre = !pinnedLeft && !pinnedRight;
      const setRef2 = reactExports.useCallback((eRef) => {
        eGui.current = eRef;
        if (!eRef || context.isDestroyed()) {
          headerRowCtrlRef.current = context.destroyBean(headerRowCtrlRef.current);
          return;
        }
        headerRowCtrlRef.current = context.createBean(new HeaderRowContainerCtrl(pinned));
        const compProxy = {
          setDisplayed,
          setCtrls: (ctrls) => setHeaderRowCtrls(ctrls),
          // centre only
          setCenterWidth: (width) => {
            if (eCenterContainer.current) {
              eCenterContainer.current.style.width = width;
            }
          },
          setViewportScrollLeft: (left2) => {
            if (eGui.current) {
              eGui.current.scrollLeft = left2;
            }
          },
          // pinned only
          setPinnedContainerWidth: (width) => {
            if (eGui.current) {
              eGui.current.style.width = width;
              eGui.current.style.minWidth = width;
              eGui.current.style.maxWidth = width;
            }
          }
        };
        headerRowCtrlRef.current.setComp(compProxy, eGui.current);
      }, []);
      const className2 = !displayed ? "ag-hidden" : "";
      const insertRowsJsx = () => headerRowCtrls.map((ctrl) => /* @__PURE__ */ React20.createElement(headerRowComp_default, { ctrl, key: ctrl.instanceId }));
      return pinnedLeft ? /* @__PURE__ */ React20.createElement("div", { ref: setRef2, className: "ag-pinned-left-header " + className2, "aria-hidden": !displayed, role: "rowgroup" }, insertRowsJsx()) : pinnedRight ? /* @__PURE__ */ React20.createElement("div", { ref: setRef2, className: "ag-pinned-right-header " + className2, "aria-hidden": !displayed, role: "rowgroup" }, insertRowsJsx()) : centre ? /* @__PURE__ */ React20.createElement("div", { ref: setRef2, className: "ag-header-viewport " + className2, role: "rowgroup", tabIndex: -1 }, /* @__PURE__ */ React20.createElement("div", { ref: eCenterContainer, className: "ag-header-container", role: "presentation" }, insertRowsJsx())) : null;
    };
    var headerRowContainerComp_default = reactExports.memo(HeaderRowContainerComp);
    var GridHeaderComp = () => {
      const [cssClasses, setCssClasses] = reactExports.useState(() => new CssClasses());
      const [height, setHeight] = reactExports.useState();
      const { context } = reactExports.useContext(BeansContext);
      const eGui = reactExports.useRef(null);
      const gridCtrlRef = reactExports.useRef();
      const setRef2 = reactExports.useCallback((eRef) => {
        eGui.current = eRef;
        if (!eRef || context.isDestroyed()) {
          gridCtrlRef.current = context.destroyBean(gridCtrlRef.current);
          return;
        }
        gridCtrlRef.current = context.createBean(new GridHeaderCtrl());
        const compProxy = {
          toggleCss: (name2, on) => setCssClasses((prev) => prev.setClass(name2, on)),
          setHeightAndMinHeight: (height2) => setHeight(height2)
        };
        gridCtrlRef.current.setComp(compProxy, eRef, eRef);
      }, []);
      const className2 = reactExports.useMemo(() => {
        const res = cssClasses.toString();
        return "ag-header " + res;
      }, [cssClasses]);
      const style2 = reactExports.useMemo(
        () => ({
          height,
          minHeight: height
        }),
        [height]
      );
      return /* @__PURE__ */ React20.createElement("div", { ref: setRef2, className: className2, style: style2, role: "presentation" }, /* @__PURE__ */ React20.createElement(headerRowContainerComp_default, { pinned: "left" }), /* @__PURE__ */ React20.createElement(headerRowContainerComp_default, { pinned: null }), /* @__PURE__ */ React20.createElement(headerRowContainerComp_default, { pinned: "right" }));
    };
    var gridHeaderComp_default = reactExports.memo(GridHeaderComp);
    var useReactCommentEffect = (comment2, eForCommentRef) => {
      reactExports.useEffect(() => {
        const eForComment = eForCommentRef.current;
        if (eForComment) {
          const eParent = eForComment.parentElement;
          if (eParent) {
            const eComment = document.createComment(comment2);
            eParent.insertBefore(eComment, eForComment);
            return () => {
              eComment.remove();
            };
          }
        }
      }, [comment2]);
    };
    var reactComment_default = useReactCommentEffect;
    var CellEditorComponentProxy = class {
      constructor(cellEditorParams, refreshProps) {
        this.cellEditorParams = cellEditorParams;
        this.refreshProps = refreshProps;
        this.instanceCreated = new AgPromise((resolve) => {
          this.resolveInstanceCreated = resolve;
        });
        this.onValueChange = (value2) => this.updateValue(value2);
        this.value = cellEditorParams.value;
      }
      getProps() {
        return {
          ...this.cellEditorParams,
          initialValue: this.cellEditorParams.value,
          value: this.value,
          onValueChange: this.onValueChange
        };
      }
      getValue() {
        return this.value;
      }
      refresh(params) {
        this.cellEditorParams = params;
        this.refreshProps();
      }
      setMethods(methods) {
        addOptionalMethods(this.getOptionalMethods(), methods, this);
      }
      getInstance() {
        return this.instanceCreated.then(() => this.componentInstance);
      }
      setRef(componentInstance) {
        this.componentInstance = componentInstance;
        this.resolveInstanceCreated?.();
        this.resolveInstanceCreated = void 0;
      }
      getOptionalMethods() {
        return [
          "isCancelBeforeStart",
          "isCancelAfterEnd",
          "focusIn",
          "focusOut",
          "afterGuiAttached",
          "getValidationErrors",
          "getValidationElement"
        ];
      }
      updateValue(value2) {
        this.value = value2;
        this.refreshProps();
      }
    };
    var useEffectOnce = (effect2) => {
      const effectFn = reactExports.useRef(effect2);
      const destroyFn = reactExports.useRef();
      const effectCalled = reactExports.useRef(false);
      const rendered = reactExports.useRef(false);
      const [, setVal] = reactExports.useState(0);
      if (effectCalled.current) {
        rendered.current = true;
      }
      reactExports.useEffect(() => {
        if (!effectCalled.current) {
          destroyFn.current = effectFn.current();
          effectCalled.current = true;
        }
        setVal((val) => val + 1);
        return () => {
          if (!rendered.current) {
            return;
          }
          destroyFn.current?.();
        };
      }, []);
    };
    var PopupEditorComp = (props) => {
      const [popupEditorWrapper, setPopupEditorWrapper] = reactExports.useState();
      const beans = reactExports.useContext(BeansContext);
      const { context, popupSvc, gos, editSvc } = beans;
      const { editDetails, cellCtrl, eParentCell } = props;
      useEffectOnce(() => {
        const { compDetails } = editDetails;
        const useModelPopup = gos.get("stopEditingWhenCellsLoseFocus");
        let hideEditorPopup = void 0;
        let wrapper2;
        if (!context.isDestroyed()) {
          wrapper2 = context.createBean(editSvc.createPopupEditorWrapper(compDetails.params));
          const ePopupGui = wrapper2.getGui();
          if (props.jsChildComp) {
            const eChildGui = props.jsChildComp.getGui();
            if (eChildGui) {
              ePopupGui.appendChild(eChildGui);
            }
          }
          const { column: column2, rowNode } = cellCtrl;
          const positionParams = {
            column: column2,
            rowNode,
            type: "popupCellEditor",
            eventSource: eParentCell,
            ePopup: ePopupGui,
            position: editDetails.popupPosition,
            keepWithinBounds: true
          };
          const positionCallback = popupSvc?.positionPopupByComponent.bind(popupSvc, positionParams);
          const addPopupRes = popupSvc?.addPopup({
            modal: useModelPopup,
            eChild: ePopupGui,
            closeOnEsc: true,
            closedCallback: () => {
              cellCtrl.onPopupEditorClosed();
            },
            anchorToElement: eParentCell,
            positionCallback,
            ariaOwns: eParentCell
          });
          hideEditorPopup = addPopupRes ? addPopupRes.hideFunc : void 0;
          setPopupEditorWrapper(wrapper2);
          props.jsChildComp?.afterGuiAttached?.();
        }
        return () => {
          hideEditorPopup?.();
          context.destroyBean(wrapper2);
        };
      });
      reactExports.useLayoutEffect(() => {
        return () => {
          if (cellCtrl.isCellFocused() && popupEditorWrapper?.getGui().contains(_getActiveDomElement(beans))) {
            eParentCell.focus({ preventScroll: true });
          }
        };
      }, [popupEditorWrapper]);
      return popupEditorWrapper && props.wrappedContent ? reactDomExports.createPortal(props.wrappedContent, popupEditorWrapper.getGui()) : null;
    };
    var popupEditorComp_default = reactExports.memo(PopupEditorComp);
    var jsxEditorProxy = (editDetails, CellEditorClass, setRef2) => {
      const { compProxy } = editDetails;
      setRef2(compProxy);
      const props = compProxy.getProps();
      const isStateless = isComponentStateless(CellEditorClass);
      return /* @__PURE__ */ React20.createElement(
        CustomContext.Provider,
        {
          value: {
            setMethods: (methods) => compProxy.setMethods(methods)
          }
        },
        isStateless ? /* @__PURE__ */ React20.createElement(CellEditorClass, { ...props }) : /* @__PURE__ */ React20.createElement(CellEditorClass, { ...props, ref: (ref) => compProxy.setRef(ref) })
      );
    };
    var jsxEditor = (editDetails, CellEditorClass, setRef2) => {
      const newFormat = editDetails.compProxy;
      return newFormat ? jsxEditorProxy(editDetails, CellEditorClass, setRef2) : /* @__PURE__ */ React20.createElement(CellEditorClass, { ...editDetails.compDetails.params, ref: setRef2 });
    };
    var jsxEditValue = (editDetails, setCellEditorRef, eGui, cellCtrl, jsEditorComp) => {
      const compDetails = editDetails.compDetails;
      const CellEditorClass = compDetails.componentClass;
      const reactInlineEditor = compDetails.componentFromFramework && !editDetails.popup;
      const reactPopupEditor = compDetails.componentFromFramework && editDetails.popup;
      const jsPopupEditor = !compDetails.componentFromFramework && editDetails.popup;
      return reactInlineEditor ? jsxEditor(editDetails, CellEditorClass, setCellEditorRef) : reactPopupEditor ? /* @__PURE__ */ React20.createElement(
        popupEditorComp_default,
        {
          editDetails,
          cellCtrl,
          eParentCell: eGui,
          wrappedContent: jsxEditor(editDetails, CellEditorClass, setCellEditorRef)
        }
      ) : jsPopupEditor && jsEditorComp ? /* @__PURE__ */ React20.createElement(popupEditorComp_default, { editDetails, cellCtrl, eParentCell: eGui, jsChildComp: jsEditorComp }) : null;
    };
    var useJsCellRenderer = (showDetails, showTools, eCellValue, cellValueVersion, jsCellRendererRef, eGui) => {
      const { context } = reactExports.useContext(BeansContext);
      const destroyCellRenderer = reactExports.useCallback(() => {
        const comp2 = jsCellRendererRef.current;
        if (!comp2) {
          return;
        }
        const compGui = comp2.getGui();
        if (compGui && compGui.parentElement) {
          compGui.remove();
        }
        context.destroyBean(comp2);
        jsCellRendererRef.current = void 0;
      }, []);
      reactExports.useEffect(() => {
        const showValue = showDetails != null;
        const jsCompDetails = showDetails?.compDetails && !showDetails.compDetails.componentFromFramework;
        const waitingForToolsSetup = showTools && eCellValue == null;
        const showComp = showValue && jsCompDetails && !waitingForToolsSetup;
        if (!showComp) {
          destroyCellRenderer();
          return;
        }
        const compDetails = showDetails.compDetails;
        if (jsCellRendererRef.current) {
          const comp2 = jsCellRendererRef.current;
          const attemptRefresh = comp2.refresh != null && showDetails.force == false;
          const refreshResult = attemptRefresh ? comp2.refresh(compDetails.params) : false;
          const refreshWorked = refreshResult === true || refreshResult === void 0;
          if (refreshWorked) {
            return;
          }
          destroyCellRenderer();
        }
        const promise = compDetails.newAgStackInstance();
        promise.then((comp2) => {
          if (!comp2) {
            return;
          }
          const compGui = comp2.getGui();
          if (!compGui) {
            return;
          }
          const parent = showTools ? eCellValue : eGui.current;
          parent.appendChild(compGui);
          jsCellRendererRef.current = comp2;
        });
      }, [showDetails, showTools, cellValueVersion]);
      reactExports.useEffect(() => {
        return destroyCellRenderer;
      }, []);
    };
    var showJsRenderer_default = useJsCellRenderer;
    var SkeletonCellRenderer = ({
      cellCtrl,
      parent
    }) => {
      const jsCellRendererRef = reactExports.useRef();
      const renderDetails = reactExports.useMemo(() => {
        const { loadingComp } = cellCtrl.getDeferLoadingCellRenderer();
        return loadingComp ? {
          value: void 0,
          compDetails: loadingComp,
          force: false
        } : void 0;
      }, [cellCtrl]);
      showJsRenderer_default(renderDetails, false, void 0, 1, jsCellRendererRef, parent);
      if (renderDetails?.compDetails?.componentFromFramework) {
        const CellRendererClass = renderDetails.compDetails.componentClass;
        return /* @__PURE__ */ React20.createElement(CellRendererClass, { ...renderDetails.compDetails.params });
      }
      return /* @__PURE__ */ React20.createElement(React20.Fragment, null);
    };
    var CellComp = ({
      cellCtrl,
      printLayout,
      editingCell
    }) => {
      const beans = reactExports.useContext(BeansContext);
      const { context } = beans;
      const {
        column: { colIdSanitised },
        instanceId
      } = cellCtrl;
      const compBean = reactExports.useRef();
      const [renderDetails, setRenderDetails] = reactExports.useState(
        () => cellCtrl.isCellRenderer() ? void 0 : { compDetails: void 0, value: cellCtrl.getValueToDisplay(), force: false }
      );
      const [editDetails, setEditDetails] = reactExports.useState();
      const [renderKey, setRenderKey] = reactExports.useState(1);
      const [userStyles, setUserStyles] = reactExports.useState();
      const [includeSelection, setIncludeSelection] = reactExports.useState(false);
      const [includeRowDrag, setIncludeRowDrag] = reactExports.useState(false);
      const [includeDndSource, setIncludeDndSource] = reactExports.useState(false);
      const [jsEditorComp, setJsEditorComp] = reactExports.useState();
      const forceWrapper = reactExports.useMemo(() => cellCtrl.isForceWrapper(), [cellCtrl]);
      const cellAriaRole = reactExports.useMemo(() => cellCtrl.getCellAriaRole(), [cellCtrl]);
      const eGui = reactExports.useRef(null);
      const eWrapper = reactExports.useRef(null);
      const cellRendererRef = reactExports.useRef(null);
      const jsCellRendererRef = reactExports.useRef();
      const cellEditorRef = reactExports.useRef();
      const eCellWrapper = reactExports.useRef();
      const cellWrapperDestroyFuncs = reactExports.useRef([]);
      const rowDragCompRef = reactExports.useRef();
      const eCellValue = reactExports.useRef();
      const [cellValueVersion, setCellValueVersion] = reactExports.useState(0);
      const setCellValueRef = reactExports.useCallback((ref) => {
        eCellValue.current = ref;
        setCellValueVersion((v) => v + 1);
      }, []);
      const showTools = renderDetails != null && (includeSelection || includeDndSource || includeRowDrag) && (editDetails == null || !!editDetails.popup);
      const showCellWrapper = forceWrapper || showTools;
      const cellValueClass = reactExports.useMemo(() => {
        return cellCtrl.getCellValueClass();
      }, [cellCtrl]);
      const setCellEditorRef = reactExports.useCallback(
        (cellEditor) => {
          cellEditorRef.current = cellEditor;
          if (cellEditor) {
            const editingCancelledByUserComp = cellEditor.isCancelBeforeStart && cellEditor.isCancelBeforeStart();
            setTimeout(() => {
              if (editingCancelledByUserComp) {
                cellCtrl.stopEditing(true);
                cellCtrl.focusCell(true);
              } else {
                cellCtrl.cellEditorAttached();
                cellCtrl.enableEditorTooltipFeature(cellEditor);
              }
            });
          }
        },
        [cellCtrl]
      );
      const cssManager = reactExports.useRef();
      if (!cssManager.current) {
        cssManager.current = new CssClassManager(() => eGui.current);
      }
      showJsRenderer_default(renderDetails, showCellWrapper, eCellValue.current, cellValueVersion, jsCellRendererRef, eGui);
      const lastRenderDetails = reactExports.useRef();
      reactExports.useLayoutEffect(() => {
        const oldDetails = lastRenderDetails.current;
        const newDetails = renderDetails;
        lastRenderDetails.current = renderDetails;
        if (oldDetails == null || oldDetails.compDetails == null || newDetails == null || newDetails.compDetails == null) {
          return;
        }
        rowDragCompRef.current?.refreshVisibility();
        const oldCompDetails = oldDetails.compDetails;
        const newCompDetails = newDetails.compDetails;
        if (oldCompDetails.componentClass != newCompDetails.componentClass) {
          return;
        }
        if (cellRendererRef.current?.refresh == null) {
          return;
        }
        const result2 = cellRendererRef.current.refresh(newCompDetails.params);
        if (result2 != true) {
          setRenderKey((prev) => prev + 1);
        }
      }, [renderDetails]);
      reactExports.useLayoutEffect(() => {
        const doingJsEditor = editDetails && !editDetails.compDetails.componentFromFramework;
        if (!doingJsEditor || context.isDestroyed()) {
          return;
        }
        const compDetails = editDetails.compDetails;
        const isPopup = editDetails.popup === true;
        const cellEditorPromise = compDetails.newAgStackInstance();
        cellEditorPromise.then((cellEditor) => {
          if (!cellEditor) {
            return;
          }
          const compGui = cellEditor.getGui();
          setCellEditorRef(cellEditor);
          if (!isPopup) {
            const parentEl = (forceWrapper ? eCellWrapper : eGui).current;
            parentEl?.appendChild(compGui);
            cellEditor.afterGuiAttached?.();
          }
          setJsEditorComp(cellEditor);
        });
        return () => {
          cellEditorPromise.then((cellEditor) => {
            const compGui = cellEditor.getGui();
            cellCtrl.disableEditorTooltipFeature();
            context.destroyBean(cellEditor);
            setCellEditorRef(void 0);
            setJsEditorComp(void 0);
            compGui?.remove();
          });
        };
      }, [editDetails]);
      const setCellWrapperRef = reactExports.useCallback(
        (eRef) => {
          eCellWrapper.current = eRef;
          if (!eRef || context.isDestroyed() || !cellCtrl.isAlive()) {
            const callbacks = cellWrapperDestroyFuncs.current;
            cellWrapperDestroyFuncs.current = [];
            for (const cb of callbacks) {
              cb();
            }
            return;
          }
          let rowDragComp;
          const addComp = (comp2) => {
            if (comp2) {
              eRef.insertAdjacentElement("afterbegin", comp2.getGui());
              cellWrapperDestroyFuncs.current.push(() => {
                _removeFromParent(comp2.getGui());
                context.destroyBean(comp2);
                if (rowDragCompRef.current === rowDragComp) {
                  rowDragCompRef.current = void 0;
                }
              });
            }
          };
          if (includeSelection) {
            addComp(cellCtrl.createSelectionCheckbox());
          }
          if (includeDndSource) {
            addComp(cellCtrl.createDndSource());
          }
          if (includeRowDrag) {
            rowDragComp = cellCtrl.createRowDragComp();
            rowDragCompRef.current = rowDragComp;
            if (rowDragComp) {
              addComp(rowDragComp);
              rowDragComp.refreshVisibility();
            }
          }
        },
        [cellCtrl, context, includeDndSource, includeRowDrag, includeSelection]
      );
      const init2 = reactExports.useCallback(() => {
        const spanReady = !cellCtrl.isCellSpanning() || eWrapper.current;
        const eRef = eGui.current;
        if (!eRef || !spanReady || !cellCtrl || !cellCtrl.isAlive() || context.isDestroyed()) {
          compBean.current = context.destroyBean(compBean.current);
          return;
        }
        compBean.current = context.createBean(new EmptyBean());
        const compProxy = {
          toggleCss: (name2, on) => cssManager.current.toggleCss(name2, on),
          setUserStyles: (styles2) => setUserStyles(styles2),
          getFocusableElement: () => eGui.current,
          setIncludeSelection: (include) => setIncludeSelection(include),
          setIncludeRowDrag: (include) => setIncludeRowDrag(include),
          setIncludeDndSource: (include) => setIncludeDndSource(include),
          getCellEditor: () => cellEditorRef.current ?? null,
          getCellRenderer: () => cellRendererRef.current ?? jsCellRendererRef.current,
          getParentOfValue: () => eCellValue.current ?? eCellWrapper.current ?? eGui.current,
          setRenderDetails: (compDetails, value2, force) => {
            const setDetails = () => {
              setRenderDetails((prev) => {
                if (prev?.compDetails !== compDetails || prev?.value !== value2 || prev?.force !== force) {
                  return {
                    value: value2,
                    compDetails,
                    force
                  };
                } else {
                  return prev;
                }
              });
            };
            if (compDetails?.params?.deferRender && !cellCtrl.rowNode.group) {
              const { loadingComp, onReady } = cellCtrl.getDeferLoadingCellRenderer();
              if (loadingComp) {
                setRenderDetails({
                  value: void 0,
                  compDetails: loadingComp,
                  force: false
                });
                onReady.then(() => agStartTransition(setDetails));
                return;
              }
            }
            setDetails();
          },
          setEditDetails: (compDetails, popup, popupPosition, reactiveCustomComponents) => {
            if (compDetails) {
              let compProxy2 = void 0;
              if (compDetails.componentFromFramework) {
                if (reactiveCustomComponents) {
                  compProxy2 = new CellEditorComponentProxy(
                    compDetails.params,
                    () => setRenderKey((prev) => prev + 1)
                  );
                } else {
                  warnReactiveCustomComponents();
                }
              }
              setEditDetails({
                compDetails,
                popup,
                popupPosition,
                compProxy: compProxy2
              });
              if (!popup) {
                setRenderDetails(void 0);
              }
            } else {
              const recoverFocus = cellCtrl.hasBrowserFocus();
              if (recoverFocus) {
                compProxy.getFocusableElement().focus({ preventScroll: true });
              }
              cellEditorRef.current = void 0;
              setEditDetails(void 0);
            }
          },
          refreshEditStyles: (editing, isPopup) => {
            if (!eGui.current) {
              return;
            }
            const { current: current2 } = cssManager;
            current2.toggleCss("ag-cell-value", !showCellWrapper);
            current2.toggleCss("ag-cell-inline-editing", !!editing && !isPopup);
            current2.toggleCss("ag-cell-popup-editing", !!editing && !!isPopup);
            current2.toggleCss("ag-cell-not-inline-editing", !editing || !!isPopup);
          }
        };
        const cellWrapperOrUndefined = eCellWrapper.current || void 0;
        cellCtrl.setComp(
          compProxy,
          eRef,
          eWrapper.current ?? void 0,
          cellWrapperOrUndefined,
          printLayout,
          editingCell,
          compBean.current
        );
      }, []);
      const setGuiRef = reactExports.useCallback((ref) => {
        eGui.current = ref;
        init2();
      }, []);
      const setWrapperRef = reactExports.useCallback((ref) => {
        eWrapper.current = ref;
        init2();
      }, []);
      const reactCellRendererStateless = reactExports.useMemo(() => {
        const res = renderDetails?.compDetails?.componentFromFramework && isComponentStateless(renderDetails.compDetails.componentClass);
        return !!res;
      }, [renderDetails]);
      reactExports.useLayoutEffect(() => {
        if (!eGui.current) {
          return;
        }
        const { current: current2 } = cssManager;
        current2.toggleCss("ag-cell-value", !showCellWrapper);
        current2.toggleCss("ag-cell-inline-editing", !!editDetails && !editDetails.popup);
        current2.toggleCss("ag-cell-popup-editing", !!editDetails && !!editDetails.popup);
        current2.toggleCss("ag-cell-not-inline-editing", !editDetails || !!editDetails.popup);
      });
      const valueOrCellComp = () => {
        const { compDetails, value: value2 } = renderDetails;
        if (!compDetails) {
          return value2?.toString?.() ?? value2;
        }
        if (compDetails.componentFromFramework) {
          const CellRendererClass = compDetails.componentClass;
          return /* @__PURE__ */ React20.createElement(reactExports.Suspense, { fallback: /* @__PURE__ */ React20.createElement(SkeletonCellRenderer, { cellCtrl, parent: eGui }) }, reactCellRendererStateless ? /* @__PURE__ */ React20.createElement(CellRendererClass, { ...compDetails.params, key: renderKey }) : /* @__PURE__ */ React20.createElement(CellRendererClass, { ...compDetails.params, key: renderKey, ref: cellRendererRef }));
        }
      };
      const showCellOrEditor = () => {
        const showCellValue = () => {
          if (renderDetails == null) {
            return null;
          }
          return showCellWrapper ? /* @__PURE__ */ React20.createElement("span", { role: "presentation", id: `cell-${instanceId}`, className: cellValueClass, ref: setCellValueRef }, valueOrCellComp()) : valueOrCellComp();
        };
        const showEditValue = (details) => jsxEditValue(details, setCellEditorRef, eGui.current, cellCtrl, jsEditorComp);
        if (editDetails != null) {
          if (editDetails.popup) {
            return /* @__PURE__ */ React20.createElement(React20.Fragment, null, showCellValue(), showEditValue(editDetails));
          }
          return showEditValue(editDetails);
        }
        return showCellValue();
      };
      const renderCell = () => /* @__PURE__ */ React20.createElement("div", { ref: setGuiRef, style: userStyles, role: cellAriaRole, "col-id": colIdSanitised }, showCellWrapper ? /* @__PURE__ */ React20.createElement("div", { className: "ag-cell-wrapper", role: "presentation", ref: setCellWrapperRef }, showCellOrEditor()) : showCellOrEditor());
      if (cellCtrl.isCellSpanning()) {
        return /* @__PURE__ */ React20.createElement("div", { ref: setWrapperRef, className: "ag-spanned-cell-wrapper", role: "presentation" }, renderCell());
      }
      return renderCell();
    };
    var cellComp_default = reactExports.memo(CellComp);
    var RowComp = ({ rowCtrl, containerType }) => {
      const { context, gos, editSvc } = reactExports.useContext(BeansContext);
      const enableUses = reactExports.useContext(RenderModeContext) === "default";
      const compBean = reactExports.useRef();
      const domOrderRef = reactExports.useRef(rowCtrl.getDomOrder());
      const isFullWidth = rowCtrl.isFullWidth();
      const isDisplayed = rowCtrl.rowNode.displayed;
      const [rowIndex, setRowIndex] = reactExports.useState(
        () => isDisplayed ? rowCtrl.rowNode.getRowIndexString() : null
      );
      const [rowId, setRowId] = reactExports.useState(() => rowCtrl.rowId);
      const [rowBusinessKey, setRowBusinessKey] = reactExports.useState(() => rowCtrl.businessKey);
      const [userStyles, setUserStyles] = reactExports.useState(() => rowCtrl.rowStyles);
      const cellCtrlsRef = reactExports.useRef(null);
      const [cellCtrlsFlushSync, setCellCtrlsFlushSync] = reactExports.useState(() => null);
      const [fullWidthCompDetails, setFullWidthCompDetails] = reactExports.useState();
      const [top2, setTop] = reactExports.useState(
        () => isDisplayed ? rowCtrl.getInitialRowTop(containerType) : void 0
      );
      const [transform, setTransform] = reactExports.useState(
        () => isDisplayed ? rowCtrl.getInitialTransform(containerType) : void 0
      );
      const eGui = reactExports.useRef(null);
      const fullWidthCompRef = reactExports.useRef();
      const fullWidthParamsRef = reactExports.useRef();
      const autoHeightSetup = reactExports.useRef(false);
      const [autoHeightSetupAttempt, setAutoHeightSetupAttempt] = reactExports.useState(0);
      reactExports.useEffect(() => {
        if (autoHeightSetup.current || !fullWidthCompDetails || autoHeightSetupAttempt > 10) {
          return;
        }
        const eChild = eGui.current?.firstChild;
        if (eChild) {
          rowCtrl.setupDetailRowAutoHeight(eChild);
          autoHeightSetup.current = true;
        } else {
          setAutoHeightSetupAttempt((prev) => prev + 1);
        }
      }, [fullWidthCompDetails, autoHeightSetupAttempt]);
      const cssManager = reactExports.useRef();
      if (!cssManager.current) {
        cssManager.current = new CssClassManager(() => eGui.current);
      }
      const cellsChanged = reactExports.useRef(() => {
      });
      const sub2 = reactExports.useCallback((onStoreChange) => {
        cellsChanged.current = onStoreChange;
        return () => {
          cellsChanged.current = () => {
          };
        };
      }, []);
      const cellCtrlsUses = agUseSyncExternalStore(
        sub2,
        () => {
          return cellCtrlsRef.current;
        },
        []
      );
      const cellCtrlsMerged = enableUses ? cellCtrlsUses : cellCtrlsFlushSync;
      const setRef2 = reactExports.useCallback((eRef) => {
        eGui.current = eRef;
        compBean.current = eRef ? context.createBean(new EmptyBean()) : context.destroyBean(compBean.current);
        if (!eRef) {
          rowCtrl.unsetComp(containerType);
          return;
        }
        if (!rowCtrl.isAlive() || context.isDestroyed()) {
          return;
        }
        const compProxy = {
          // the rowTop is managed by state, instead of direct style manipulation by rowCtrl (like all the other styles)
          // as we need to have an initial value when it's placed into he DOM for the first time, for animation to work.
          setTop,
          setTransform,
          // i found using React for managing classes at the row level was to slow, as modifying classes caused a lot of
          // React code to execute, so avoiding React for managing CSS Classes made the grid go much faster.
          toggleCss: (name2, on) => cssManager.current.toggleCss(name2, on),
          setDomOrder: (domOrder) => domOrderRef.current = domOrder,
          setRowIndex,
          setRowId,
          setRowBusinessKey,
          setUserStyles,
          // if we don't maintain the order, then cols will be ripped out and into the dom
          // when cols reordered, which would stop the CSS transitions from working
          setCellCtrls: (next, useFlushSync) => {
            const prevCellCtrls = cellCtrlsRef.current;
            const nextCells = getNextValueIfDifferent(prevCellCtrls, next, domOrderRef.current);
            if (nextCells !== prevCellCtrls) {
              cellCtrlsRef.current = nextCells;
              if (enableUses) {
                cellsChanged.current();
              } else {
                agFlushSync(useFlushSync, () => setCellCtrlsFlushSync(nextCells));
              }
            }
          },
          showFullWidth: (compDetails) => {
            fullWidthParamsRef.current = compDetails.params;
            setFullWidthCompDetails(compDetails);
          },
          getFullWidthCellRenderer: () => fullWidthCompRef.current,
          getFullWidthCellRendererParams: () => fullWidthParamsRef.current,
          refreshFullWidth: (getUpdatedParams) => {
            const fullWidthParams = getUpdatedParams();
            fullWidthParamsRef.current = fullWidthParams;
            if (canRefreshFullWidthRef.current) {
              setFullWidthCompDetails((prevFullWidthCompDetails) => ({
                ...prevFullWidthCompDetails,
                params: fullWidthParams
              }));
              return true;
            } else {
              if (!fullWidthCompRef.current || !fullWidthCompRef.current.refresh) {
                return false;
              }
              return fullWidthCompRef.current.refresh(fullWidthParams);
            }
          }
        };
        rowCtrl.setComp(compProxy, eRef, containerType, compBean.current);
      }, []);
      reactExports.useLayoutEffect(
        () => showJsComp(fullWidthCompDetails, context, eGui.current, fullWidthCompRef),
        [fullWidthCompDetails]
      );
      const rowStyles = reactExports.useMemo(() => {
        const res = { top: top2, transform };
        Object.assign(res, userStyles);
        return res;
      }, [top2, transform, userStyles]);
      const showFullWidthFramework = isFullWidth && fullWidthCompDetails?.componentFromFramework;
      const showCells = !isFullWidth && cellCtrlsMerged != null;
      const reactFullWidthCellRendererStateless = reactExports.useMemo(() => {
        const res = fullWidthCompDetails?.componentFromFramework && isComponentStateless(fullWidthCompDetails.componentClass);
        return !!res;
      }, [fullWidthCompDetails]);
      const canRefreshFullWidthRef = reactExports.useRef(false);
      reactExports.useEffect(() => {
        canRefreshFullWidthRef.current = reactFullWidthCellRendererStateless && !!fullWidthCompDetails && !!gos.get("reactiveCustomComponents");
      }, [reactFullWidthCellRendererStateless, fullWidthCompDetails]);
      const showCellsJsx = () => cellCtrlsMerged?.map((cellCtrl) => /* @__PURE__ */ React20.createElement(
        cellComp_default,
        {
          cellCtrl,
          editingCell: editSvc?.isEditing(cellCtrl, { withOpenEditor: true }) ?? false,
          printLayout: rowCtrl.printLayout,
          key: cellCtrl.instanceId
        }
      ));
      const showFullWidthFrameworkJsx = () => {
        const FullWidthComp = fullWidthCompDetails.componentClass;
        return reactFullWidthCellRendererStateless ? /* @__PURE__ */ React20.createElement(FullWidthComp, { ...fullWidthCompDetails.params }) : /* @__PURE__ */ React20.createElement(FullWidthComp, { ...fullWidthCompDetails.params, ref: fullWidthCompRef });
      };
      return /* @__PURE__ */ React20.createElement(
        "div",
        {
          ref: setRef2,
          role: "row",
          style: rowStyles,
          "row-index": rowIndex,
          "row-id": rowId,
          "row-business-key": rowBusinessKey
        },
        showCells ? showCellsJsx() : showFullWidthFramework ? showFullWidthFrameworkJsx() : null
      );
    };
    var rowComp_default = reactExports.memo(RowComp);
    var RowContainerComp = ({ name: name2 }) => {
      const { context, gos } = reactExports.useContext(BeansContext);
      const containerOptions = reactExports.useMemo(() => _getRowContainerOptions(name2), [name2]);
      const eViewport = reactExports.useRef(null);
      const eContainer = reactExports.useRef(null);
      const eSpanContainer = reactExports.useRef(null);
      const rowCtrlsRef = reactExports.useRef([]);
      const prevRowCtrlsRef = reactExports.useRef([]);
      const [rowCtrlsOrdered, setRowCtrlsOrdered] = reactExports.useState(() => []);
      const isSpanning = !!gos.get("enableCellSpan") && !!containerOptions.getSpannedRowCtrls;
      const spannedRowCtrlsRef = reactExports.useRef([]);
      const prevSpannedRowCtrlsRef = reactExports.useRef([]);
      const [spannedRowCtrlsOrdered, setSpannedRowCtrlsOrdered] = reactExports.useState(() => []);
      const domOrderRef = reactExports.useRef(false);
      const rowContainerCtrlRef = reactExports.useRef();
      const viewportClasses = reactExports.useMemo(() => classesList("ag-viewport", _getRowViewportClass(name2)), [name2]);
      const containerClasses = reactExports.useMemo(() => classesList(_getRowContainerClass(name2)), [name2]);
      const spanClasses = reactExports.useMemo(() => classesList("ag-spanning-container", _getRowSpanContainerClass(name2)), [name2]);
      const shouldRenderViewport = containerOptions.type === "center" || isSpanning;
      const topLevelRef = shouldRenderViewport ? eViewport : eContainer;
      reactComment_default(" AG Row Container " + name2 + " ", topLevelRef);
      const areElementsReady = reactExports.useCallback(() => {
        const viewportReady = !shouldRenderViewport || eViewport.current != null;
        const containerReady = eContainer.current != null;
        const spanContainerReady = !isSpanning || eSpanContainer.current != null;
        return viewportReady && containerReady && spanContainerReady;
      }, []);
      const areElementsRemoved = reactExports.useCallback(() => {
        return eViewport.current == null && eContainer.current == null && eSpanContainer.current == null;
      }, []);
      const setRef2 = reactExports.useCallback(() => {
        if (areElementsRemoved()) {
          rowContainerCtrlRef.current = context.destroyBean(rowContainerCtrlRef.current);
        }
        if (context.isDestroyed()) {
          return;
        }
        if (areElementsReady()) {
          const updateRowCtrlsOrdered = (useFlushSync) => {
            const next = getNextValueIfDifferent(
              prevRowCtrlsRef.current,
              rowCtrlsRef.current,
              domOrderRef.current
            );
            if (next !== prevRowCtrlsRef.current) {
              prevRowCtrlsRef.current = next;
              agFlushSync(useFlushSync, () => setRowCtrlsOrdered(next));
            }
          };
          const updateSpannedRowCtrlsOrdered = (useFlushSync) => {
            const next = getNextValueIfDifferent(
              prevSpannedRowCtrlsRef.current,
              spannedRowCtrlsRef.current,
              domOrderRef.current
            );
            if (next !== prevSpannedRowCtrlsRef.current) {
              prevSpannedRowCtrlsRef.current = next;
              agFlushSync(useFlushSync, () => setSpannedRowCtrlsOrdered(next));
            }
          };
          const compProxy = {
            setHorizontalScroll: (offset2) => {
              if (eViewport.current) {
                eViewport.current.scrollLeft = offset2;
              }
            },
            setViewportHeight: (height) => {
              if (eViewport.current) {
                eViewport.current.style.height = height;
              }
            },
            setRowCtrls: ({ rowCtrls, useFlushSync }) => {
              const useFlush = !!useFlushSync && rowCtrlsRef.current.length > 0 && rowCtrls.length > 0;
              rowCtrlsRef.current = rowCtrls;
              updateRowCtrlsOrdered(useFlush);
            },
            setSpannedRowCtrls: (rowCtrls, useFlushSync) => {
              const useFlush = !!useFlushSync && spannedRowCtrlsRef.current.length > 0 && rowCtrls.length > 0;
              spannedRowCtrlsRef.current = rowCtrls;
              updateSpannedRowCtrlsOrdered(useFlush);
            },
            setDomOrder: (domOrder) => {
              if (domOrderRef.current != domOrder) {
                domOrderRef.current = domOrder;
                updateRowCtrlsOrdered(false);
              }
            },
            setContainerWidth: (width) => {
              if (eContainer.current) {
                eContainer.current.style.width = width;
              }
            },
            setOffsetTop: (offset2) => {
              if (eContainer.current) {
                eContainer.current.style.transform = `translateY(${offset2})`;
              }
            }
          };
          rowContainerCtrlRef.current = context.createBean(new RowContainerCtrl(name2));
          rowContainerCtrlRef.current.setComp(
            compProxy,
            eContainer.current,
            eSpanContainer.current ?? void 0,
            eViewport.current
          );
        }
      }, [areElementsReady, areElementsRemoved]);
      const setContainerRef = reactExports.useCallback(
        (e) => {
          eContainer.current = e;
          setRef2();
        },
        [setRef2]
      );
      const setSpanContainerRef = reactExports.useCallback(
        (e) => {
          eSpanContainer.current = e;
          setRef2();
        },
        [setRef2]
      );
      const setViewportRef = reactExports.useCallback(
        (e) => {
          eViewport.current = e;
          setRef2();
        },
        [setRef2]
      );
      const buildContainer = () => /* @__PURE__ */ React20.createElement(
        "div",
        {
          className: containerClasses,
          ref: setContainerRef,
          role: shouldRenderViewport ? "presentation" : "rowgroup"
        },
        rowCtrlsOrdered.map((rowCtrl) => /* @__PURE__ */ React20.createElement(rowComp_default, { rowCtrl, containerType: containerOptions.type, key: rowCtrl.instanceId }))
      );
      if (!shouldRenderViewport) {
        return buildContainer();
      }
      const buildSpanContainer = () => /* @__PURE__ */ React20.createElement("div", { className: spanClasses, ref: setSpanContainerRef, role: "presentation" }, spannedRowCtrlsOrdered.map((rowCtrl) => /* @__PURE__ */ React20.createElement(rowComp_default, { rowCtrl, containerType: containerOptions.type, key: rowCtrl.instanceId })));
      return /* @__PURE__ */ React20.createElement("div", { className: viewportClasses, ref: setViewportRef, role: "rowgroup" }, buildContainer(), isSpanning ? buildSpanContainer() : null);
    };
    var rowContainerComp_default = reactExports.memo(RowContainerComp);
    var GridBodyComp = () => {
      const beans = reactExports.useContext(BeansContext);
      const { context, overlays } = beans;
      const [rowAnimationClass, setRowAnimationClass] = reactExports.useState("");
      const [topHeight, setTopHeight] = reactExports.useState(0);
      const [bottomHeight, setBottomHeight] = reactExports.useState(0);
      const [stickyTopHeight, setStickyTopHeight] = reactExports.useState("0px");
      const [stickyTopTop, setStickyTopTop] = reactExports.useState("0px");
      const [stickyTopWidth, setStickyTopWidth] = reactExports.useState("100%");
      const [stickyBottomHeight, setStickyBottomHeight] = reactExports.useState("0px");
      const [stickyBottomBottom, setStickyBottomBottom] = reactExports.useState("0px");
      const [stickyBottomWidth, setStickyBottomWidth] = reactExports.useState("100%");
      const [topInvisible, setTopInvisible] = reactExports.useState(true);
      const [bottomInvisible, setBottomInvisible] = reactExports.useState(true);
      const [forceVerticalScrollClass, setForceVerticalScrollClass] = reactExports.useState(null);
      const [topAndBottomOverflowY, setTopAndBottomOverflowY] = reactExports.useState("");
      const [cellSelectableCss, setCellSelectableCss] = reactExports.useState(null);
      const [layoutClass, setLayoutClass] = reactExports.useState("ag-layout-normal");
      const cssManager = reactExports.useRef();
      if (!cssManager.current) {
        cssManager.current = new CssClassManager(() => eRoot.current);
      }
      const eRoot = reactExports.useRef(null);
      const eTop = reactExports.useRef(null);
      const eStickyTop = reactExports.useRef(null);
      const eStickyBottom = reactExports.useRef(null);
      const eBody = reactExports.useRef(null);
      const eBodyViewport = reactExports.useRef(null);
      const eBottom = reactExports.useRef(null);
      const beansToDestroy = reactExports.useRef([]);
      const destroyFuncs = reactExports.useRef([]);
      reactComment_default(" AG Grid Body ", eRoot);
      reactComment_default(" AG Pinned Top ", eTop);
      reactComment_default(" AG Sticky Top ", eStickyTop);
      reactComment_default(" AG Middle ", eBodyViewport);
      reactComment_default(" AG Pinned Bottom ", eBottom);
      const setRef2 = reactExports.useCallback((eRef) => {
        eRoot.current = eRef;
        if (!eRef || context.isDestroyed()) {
          beansToDestroy.current = context.destroyBeans(beansToDestroy.current);
          for (const f of destroyFuncs.current) {
            f();
          }
          destroyFuncs.current = [];
          return;
        }
        const attachToDom = (eParent, eChild) => {
          eParent.appendChild(eChild);
          destroyFuncs.current.push(() => eChild.remove());
        };
        const newComp = (compClass) => {
          const comp2 = context.createBean(new compClass());
          beansToDestroy.current.push(comp2);
          return comp2;
        };
        const addComp = (eParent, compClass, comment2) => {
          attachToDom(eParent, document.createComment(comment2));
          attachToDom(eParent, newComp(compClass).getGui());
        };
        addComp(eRef, FakeHScrollComp, " AG Fake Horizontal Scroll ");
        const overlayComp = overlays?.getOverlayWrapperCompClass();
        if (overlayComp) {
          addComp(eRef, overlayComp, " AG Overlay Wrapper ");
        }
        if (eBody.current) {
          addComp(eBody.current, FakeVScrollComp, " AG Fake Vertical Scroll ");
        }
        const compProxy = {
          setRowAnimationCssOnBodyViewport: setRowAnimationClass,
          setColumnCount: (count) => {
            if (eRoot.current) {
              _setAriaColCount(eRoot.current, count);
            }
          },
          setRowCount: (count) => {
            if (eRoot.current) {
              _setAriaRowCount(eRoot.current, count);
            }
          },
          setTopHeight,
          setBottomHeight,
          setStickyTopHeight,
          setStickyTopTop,
          setStickyTopWidth,
          setTopInvisible,
          setBottomInvisible,
          setColumnMovingCss: (cssClass, flag) => cssManager.current.toggleCss(cssClass, flag),
          updateLayoutClasses: setLayoutClass,
          setAlwaysVerticalScrollClass: setForceVerticalScrollClass,
          setPinnedTopBottomOverflowY: setTopAndBottomOverflowY,
          setCellSelectableCss: (cssClass, flag) => setCellSelectableCss(flag ? cssClass : null),
          setBodyViewportWidth: (width) => {
            if (eBodyViewport.current) {
              eBodyViewport.current.style.width = width;
            }
          },
          registerBodyViewportResizeListener: (listener) => {
            if (eBodyViewport.current) {
              const unsubscribeFromResize = _observeResize(beans, eBodyViewport.current, listener);
              destroyFuncs.current.push(() => unsubscribeFromResize());
            }
          },
          setStickyBottomHeight,
          setStickyBottomBottom,
          setStickyBottomWidth,
          setGridRootRole: (role2) => eRef.setAttribute("role", role2)
        };
        const ctrl = context.createBean(new GridBodyCtrl());
        beansToDestroy.current.push(ctrl);
        ctrl.setComp(
          compProxy,
          eRef,
          eBodyViewport.current,
          eTop.current,
          eBottom.current,
          eStickyTop.current,
          eStickyBottom.current
        );
      }, []);
      const rootClasses = reactExports.useMemo(() => classesList("ag-root", "ag-unselectable", layoutClass), [layoutClass]);
      const bodyViewportClasses = reactExports.useMemo(
        () => classesList(
          "ag-body-viewport",
          rowAnimationClass,
          layoutClass,
          forceVerticalScrollClass,
          cellSelectableCss
        ),
        [rowAnimationClass, layoutClass, forceVerticalScrollClass, cellSelectableCss]
      );
      const bodyClasses = reactExports.useMemo(() => classesList("ag-body", layoutClass), [layoutClass]);
      const topClasses = reactExports.useMemo(
        () => classesList("ag-floating-top", topInvisible ? "ag-invisible" : null, cellSelectableCss),
        [cellSelectableCss, topInvisible]
      );
      const stickyTopClasses = reactExports.useMemo(() => classesList("ag-sticky-top", cellSelectableCss), [cellSelectableCss]);
      const stickyBottomClasses = reactExports.useMemo(
        () => classesList("ag-sticky-bottom", stickyBottomHeight === "0px" ? "ag-invisible" : null, cellSelectableCss),
        [cellSelectableCss, stickyBottomHeight]
      );
      const bottomClasses = reactExports.useMemo(
        () => classesList("ag-floating-bottom", bottomInvisible ? "ag-invisible" : null, cellSelectableCss),
        [cellSelectableCss, bottomInvisible]
      );
      const topStyle = reactExports.useMemo(
        () => ({
          height: topHeight,
          minHeight: topHeight,
          overflowY: topAndBottomOverflowY
        }),
        [topHeight, topAndBottomOverflowY]
      );
      const stickyTopStyle = reactExports.useMemo(
        () => ({
          height: stickyTopHeight,
          top: stickyTopTop,
          width: stickyTopWidth
        }),
        [stickyTopHeight, stickyTopTop, stickyTopWidth]
      );
      const stickyBottomStyle = reactExports.useMemo(
        () => ({
          height: stickyBottomHeight,
          bottom: stickyBottomBottom,
          width: stickyBottomWidth
        }),
        [stickyBottomHeight, stickyBottomBottom, stickyBottomWidth]
      );
      const bottomStyle = reactExports.useMemo(
        () => ({
          height: bottomHeight,
          minHeight: bottomHeight,
          overflowY: topAndBottomOverflowY
        }),
        [bottomHeight, topAndBottomOverflowY]
      );
      const createRowContainer = (container2) => /* @__PURE__ */ React20.createElement(rowContainerComp_default, { name: container2, key: `${container2}-container` });
      const createSection = ({
        section: section2,
        children: children2,
        className: className2,
        style: style2
      }) => /* @__PURE__ */ React20.createElement("div", { ref: section2, className: className2, role: "presentation", style: style2 }, children2.map(createRowContainer));
      return /* @__PURE__ */ React20.createElement("div", { ref: setRef2, className: rootClasses }, /* @__PURE__ */ React20.createElement(gridHeaderComp_default, null), createSection({
        section: eTop,
        className: topClasses,
        style: topStyle,
        children: ["topLeft", "topCenter", "topRight", "topFullWidth"]
      }), /* @__PURE__ */ React20.createElement("div", { className: bodyClasses, ref: eBody, role: "presentation" }, createSection({
        section: eBodyViewport,
        className: bodyViewportClasses,
        children: ["left", "center", "right", "fullWidth"]
      })), createSection({
        section: eStickyTop,
        className: stickyTopClasses,
        style: stickyTopStyle,
        children: ["stickyTopLeft", "stickyTopCenter", "stickyTopRight", "stickyTopFullWidth"]
      }), createSection({
        section: eStickyBottom,
        className: stickyBottomClasses,
        style: stickyBottomStyle,
        children: ["stickyBottomLeft", "stickyBottomCenter", "stickyBottomRight", "stickyBottomFullWidth"]
      }), createSection({
        section: eBottom,
        className: bottomClasses,
        style: bottomStyle,
        children: ["bottomLeft", "bottomCenter", "bottomRight", "bottomFullWidth"]
      }));
    };
    var gridBodyComp_default = reactExports.memo(GridBodyComp);
    var TabGuardCompRef = (props, forwardRef4) => {
      const { children: children2, eFocusableElement, onTabKeyDown, gridCtrl, forceFocusOutWhenTabGuardsAreEmpty, isEmpty } = props;
      const { context } = reactExports.useContext(BeansContext);
      const topTabGuardRef = reactExports.useRef(null);
      const bottomTabGuardRef = reactExports.useRef(null);
      const tabGuardCtrlRef = reactExports.useRef();
      const setTabIndex = (value2) => {
        const processedValue = value2 == null ? void 0 : parseInt(value2, 10).toString();
        for (const tabGuard of [topTabGuardRef, bottomTabGuardRef]) {
          if (processedValue === void 0) {
            tabGuard.current?.removeAttribute("tabindex");
          } else {
            tabGuard.current?.setAttribute("tabindex", processedValue);
          }
        }
      };
      reactExports.useImperativeHandle(forwardRef4, () => ({
        forceFocusOutOfContainer(up) {
          tabGuardCtrlRef.current?.forceFocusOutOfContainer(up);
        }
      }));
      const setupCtrl = reactExports.useCallback(() => {
        const topTabGuard = topTabGuardRef.current;
        const bottomTabGuard = bottomTabGuardRef.current;
        if (!topTabGuard && !bottomTabGuard || context.isDestroyed()) {
          tabGuardCtrlRef.current = context.destroyBean(tabGuardCtrlRef.current);
          return;
        }
        if (topTabGuard && bottomTabGuard) {
          const compProxy = {
            setTabIndex
          };
          tabGuardCtrlRef.current = context.createBean(
            new TabGuardCtrl({
              comp: compProxy,
              eTopGuard: topTabGuard,
              eBottomGuard: bottomTabGuard,
              eFocusableElement,
              onTabKeyDown,
              forceFocusOutWhenTabGuardsAreEmpty,
              focusInnerElement: (fromBottom) => gridCtrl.focusInnerElement(fromBottom),
              isEmpty
            })
          );
        }
      }, []);
      const setTopRef = reactExports.useCallback(
        (e) => {
          topTabGuardRef.current = e;
          setupCtrl();
        },
        [setupCtrl]
      );
      const setBottomRef = reactExports.useCallback(
        (e) => {
          bottomTabGuardRef.current = e;
          setupCtrl();
        },
        [setupCtrl]
      );
      const createTabGuard = (side) => {
        const className2 = side === "top" ? TabGuardClassNames.TAB_GUARD_TOP : TabGuardClassNames.TAB_GUARD_BOTTOM;
        return /* @__PURE__ */ React20.createElement(
          "div",
          {
            className: `${TabGuardClassNames.TAB_GUARD} ${className2}`,
            role: "presentation",
            ref: side === "top" ? setTopRef : setBottomRef
          }
        );
      };
      return /* @__PURE__ */ React20.createElement(React20.Fragment, null, createTabGuard("top"), children2, createTabGuard("bottom"));
    };
    var TabGuardComp = reactExports.forwardRef(TabGuardCompRef);
    var tabGuardComp_default = reactExports.memo(TabGuardComp);
    var GridComp = ({ context }) => {
      const [rtlClass, setRtlClass] = reactExports.useState("");
      const [layoutClass, setLayoutClass] = reactExports.useState("");
      const [cursor, setCursor] = reactExports.useState(null);
      const [userSelect, setUserSelect] = reactExports.useState(null);
      const [initialised, setInitialised] = reactExports.useState(false);
      const [tabGuardReady, setTabGuardReady] = reactExports.useState();
      const gridCtrlRef = reactExports.useRef();
      const eRootWrapperRef = reactExports.useRef(null);
      const tabGuardRef = reactExports.useRef();
      const [eGridBodyParent, setGridBodyParent] = reactExports.useState(null);
      const focusInnerElementRef = reactExports.useRef(() => void 0);
      const paginationCompRef = reactExports.useRef();
      const focusableContainersRef = reactExports.useRef([]);
      const onTabKeyDown = reactExports.useCallback(() => void 0, []);
      reactComment_default(" AG Grid ", eRootWrapperRef);
      const setRef2 = reactExports.useCallback((eRef) => {
        eRootWrapperRef.current = eRef;
        gridCtrlRef.current = eRef ? context.createBean(new GridCtrl()) : context.destroyBean(gridCtrlRef.current);
        if (!eRef || context.isDestroyed()) {
          return;
        }
        const gridCtrl = gridCtrlRef.current;
        focusInnerElementRef.current = gridCtrl.focusInnerElement.bind(gridCtrl);
        const compProxy = {
          destroyGridUi: () => {
          },
          // do nothing, as framework users destroy grid by removing the comp
          setRtlClass,
          forceFocusOutOfContainer: (up) => {
            if (!up && paginationCompRef.current?.isDisplayed()) {
              paginationCompRef.current.forceFocusOutOfContainer(up);
              return;
            }
            tabGuardRef.current?.forceFocusOutOfContainer(up);
          },
          updateLayoutClasses: setLayoutClass,
          getFocusableContainers: () => {
            const comps = [];
            const gridBodyCompEl = eRootWrapperRef.current?.querySelector(".ag-root");
            if (gridBodyCompEl) {
              comps.push({ getGui: () => gridBodyCompEl });
            }
            for (const comp2 of focusableContainersRef.current) {
              if (comp2.isDisplayed()) {
                comps.push(comp2);
              }
            }
            return comps;
          },
          setCursor,
          setUserSelect
        };
        gridCtrl.setComp(compProxy, eRef, eRef);
        setInitialised(true);
      }, []);
      reactExports.useEffect(() => {
        const gridCtrl = gridCtrlRef.current;
        const eRootWrapper = eRootWrapperRef.current;
        if (!tabGuardReady || !gridCtrl || !eGridBodyParent || !eRootWrapper || context.isDestroyed()) {
          return;
        }
        const beansToDestroy = [];
        const {
          watermarkSelector,
          paginationSelector,
          sideBarSelector,
          statusBarSelector,
          gridHeaderDropZonesSelector
        } = gridCtrl.getOptionalSelectors();
        const additionalEls = [];
        if (gridHeaderDropZonesSelector) {
          const headerDropZonesComp = context.createBean(new gridHeaderDropZonesSelector.component());
          const eGui = headerDropZonesComp.getGui();
          eRootWrapper.insertAdjacentElement("afterbegin", eGui);
          additionalEls.push(eGui);
          beansToDestroy.push(headerDropZonesComp);
        }
        if (sideBarSelector) {
          const sideBarComp = context.createBean(new sideBarSelector.component());
          const eGui = sideBarComp.getGui();
          const bottomTabGuard = eGridBodyParent.querySelector(".ag-tab-guard-bottom");
          if (bottomTabGuard) {
            bottomTabGuard.insertAdjacentElement("beforebegin", eGui);
            additionalEls.push(eGui);
          }
          beansToDestroy.push(sideBarComp);
          focusableContainersRef.current.push(sideBarComp);
        }
        const addComponentToDom = (component) => {
          const comp2 = context.createBean(new component());
          const eGui = comp2.getGui();
          eRootWrapper.insertAdjacentElement("beforeend", eGui);
          additionalEls.push(eGui);
          beansToDestroy.push(comp2);
          return comp2;
        };
        if (statusBarSelector) {
          addComponentToDom(statusBarSelector.component);
        }
        if (paginationSelector) {
          const paginationComp = addComponentToDom(paginationSelector.component);
          paginationCompRef.current = paginationComp;
          focusableContainersRef.current.push(paginationComp);
        }
        if (watermarkSelector) {
          addComponentToDom(watermarkSelector.component);
        }
        return () => {
          context.destroyBeans(beansToDestroy);
          for (const el2 of additionalEls) {
            el2.remove();
          }
        };
      }, [tabGuardReady, eGridBodyParent, context]);
      const rootWrapperClasses = reactExports.useMemo(
        () => classesList("ag-root-wrapper", rtlClass, layoutClass),
        [rtlClass, layoutClass]
      );
      const rootWrapperBodyClasses = reactExports.useMemo(
        () => classesList("ag-root-wrapper-body", "ag-focus-managed", layoutClass),
        [layoutClass]
      );
      const topStyle = reactExports.useMemo(
        () => ({
          userSelect: userSelect != null ? userSelect : "",
          WebkitUserSelect: userSelect != null ? userSelect : "",
          cursor: cursor != null ? cursor : ""
        }),
        [userSelect, cursor]
      );
      const setTabGuardCompRef = reactExports.useCallback((ref) => {
        tabGuardRef.current = ref;
        setTabGuardReady(ref !== null);
      }, []);
      const isFocusable = reactExports.useCallback(() => !gridCtrlRef.current?.isFocusable(), []);
      return /* @__PURE__ */ React20.createElement("div", { ref: setRef2, className: rootWrapperClasses, style: topStyle, role: "presentation" }, /* @__PURE__ */ React20.createElement("div", { className: rootWrapperBodyClasses, ref: setGridBodyParent, role: "presentation" }, initialised && eGridBodyParent && !context.isDestroyed() && /* @__PURE__ */ React20.createElement(BeansContext.Provider, { value: context.getBeans() }, /* @__PURE__ */ React20.createElement(
        tabGuardComp_default,
        {
          ref: setTabGuardCompRef,
          eFocusableElement: eGridBodyParent,
          onTabKeyDown,
          gridCtrl: gridCtrlRef.current,
          forceFocusOutWhenTabGuardsAreEmpty: true,
          isEmpty: isFocusable
        },
        // we wait for initialised before rending the children, so GridComp has created and registered with it's
        // GridCtrl before we create the child GridBodyComp. Otherwise the GridBodyComp would initialise first,
        // before we have set the the Layout CSS classes, causing the GridBodyComp to render rows to a grid that
        // doesn't have it's height specified, which would result if all the rows getting rendered (and if many rows,
        // hangs the UI)
        /* @__PURE__ */ React20.createElement(gridBodyComp_default, null)
      ))));
    };
    var gridComp_default = reactExports.memo(GridComp);
    var RenderStatusService = class extends BeanStub {
      postConstruct() {
        if (this.beans.colAutosize) {
          const queueResizeOperationsForTick = this.queueResizeOperationsForTick.bind(this);
          this.addManagedEventListeners({
            rowExpansionStateChanged: queueResizeOperationsForTick,
            expandOrCollapseAll: queueResizeOperationsForTick,
            // Enable devs to resize after they updated via the API
            cellValueChanged: queueResizeOperationsForTick,
            rowNodeDataChanged: queueResizeOperationsForTick,
            rowDataUpdated: queueResizeOperationsForTick
          });
        }
      }
      queueResizeOperationsForTick() {
        const colAutosize = this.beans.colAutosize;
        colAutosize.shouldQueueResizeOperations = true;
        setTimeout(() => {
          colAutosize.processResizeOperations();
        }, 0);
      }
      areHeaderCellsRendered() {
        return this.beans.ctrlsSvc.getHeaderRowContainerCtrls().every((container2) => container2.getAllCtrls().every((ctrl) => ctrl.areCellsRendered()));
      }
      areCellsRendered() {
        return this.beans.rowRenderer.getAllRowCtrls().every((row2) => row2.isRowRendered() && row2.getAllCellCtrls().every((cellCtrl) => !!cellCtrl.eGui));
      }
    };
    var deprecatedProps = {
      setGridApi: void 0,
      maxComponentCreationTimeMs: void 0,
      children: void 0
    };
    var reactPropsNotGridOptions = {
      gridOptions: void 0,
      modules: void 0,
      containerStyle: void 0,
      className: void 0,
      passGridApi: void 0,
      componentWrappingElement: void 0,
      ...deprecatedProps
    };
    var excludeReactCompProps = new Set(Object.keys(reactPropsNotGridOptions));
    var deprecatedReactCompProps = new Set(Object.keys(deprecatedProps));
    var AgGridReactUi = (props) => {
      const apiRef = reactExports.useRef();
      const eGui = reactExports.useRef(null);
      const portalManager = reactExports.useRef(null);
      const destroyFuncs = reactExports.useRef([]);
      const whenReadyFuncs = reactExports.useRef([]);
      const prevProps = reactExports.useRef(props);
      const frameworkOverridesRef = reactExports.useRef();
      const gridIdRef = reactExports.useRef();
      const ready = reactExports.useRef(false);
      const [context, setContext] = reactExports.useState(void 0);
      const [, setPortalRefresher] = reactExports.useState(0);
      const setRef2 = reactExports.useCallback((eRef) => {
        eGui.current = eRef;
        if (!eRef) {
          for (const f of destroyFuncs.current) {
            f();
          }
          destroyFuncs.current.length = 0;
          return;
        }
        const modules = props.modules || [];
        if (!portalManager.current) {
          portalManager.current = new PortalManager(
            () => setPortalRefresher((prev) => prev + 1),
            props.componentWrappingElement,
            props.maxComponentCreationTimeMs
          );
          destroyFuncs.current.push(() => {
            portalManager.current?.destroy();
            portalManager.current = null;
          });
        }
        const mergedGridOps = _combineAttributesAndGridOptions(
          props.gridOptions,
          props,
          Object.keys(props).filter((key2) => !excludeReactCompProps.has(key2))
        );
        const processQueuedUpdates = () => {
          if (ready.current) {
            const getFn = () => frameworkOverridesRef.current?.shouldQueueUpdates() ? void 0 : whenReadyFuncs.current.shift();
            let fn2 = getFn();
            while (fn2) {
              fn2();
              fn2 = getFn();
            }
          }
        };
        const frameworkOverrides = new ReactFrameworkOverrides(processQueuedUpdates);
        frameworkOverridesRef.current = frameworkOverrides;
        const renderStatus = new RenderStatusService();
        const gridParams = {
          providedBeanInstances: {
            frameworkCompWrapper: new ReactFrameworkComponentWrapper(portalManager.current, mergedGridOps),
            renderStatus
          },
          modules,
          frameworkOverrides,
          setThemeOnGridDiv: true
        };
        const createUiCallback = (ctx) => {
          setContext(ctx);
          ctx.createBean(renderStatus);
          destroyFuncs.current.push(() => {
            ctx.destroy();
          });
          ctx.getBean("ctrlsSvc").whenReady(
            {
              addDestroyFunc: (func) => {
                destroyFuncs.current.push(func);
              }
            },
            () => {
              if (ctx.isDestroyed()) {
                return;
              }
              const api2 = apiRef.current;
              if (api2) {
                props.passGridApi?.(api2);
              }
            }
          );
        };
        const acceptChangesCallback = (context2) => {
          context2.getBean("ctrlsSvc").whenReady(
            {
              addDestroyFunc: (func) => {
                destroyFuncs.current.push(func);
              }
            },
            () => {
              for (const f of whenReadyFuncs.current) {
                f();
              }
              whenReadyFuncs.current.length = 0;
              ready.current = true;
            }
          );
        };
        const gridCoreCreator = new GridCoreCreator();
        mergedGridOps.gridId ?? (mergedGridOps.gridId = gridIdRef.current);
        apiRef.current = gridCoreCreator.create(
          eRef,
          mergedGridOps,
          createUiCallback,
          acceptChangesCallback,
          gridParams
        );
        destroyFuncs.current.push(() => {
          apiRef.current = void 0;
        });
        if (apiRef.current) {
          gridIdRef.current = apiRef.current.getGridId();
        }
      }, []);
      const style2 = reactExports.useMemo(() => {
        return {
          height: "100%",
          ...props.containerStyle || {}
        };
      }, [props.containerStyle]);
      const processWhenReady = reactExports.useCallback((func) => {
        if (ready.current && !frameworkOverridesRef.current?.shouldQueueUpdates()) {
          func();
        } else {
          whenReadyFuncs.current.push(func);
        }
      }, []);
      reactExports.useEffect(() => {
        const changes = extractGridPropertyChanges(prevProps.current, props);
        prevProps.current = props;
        processWhenReady(() => {
          if (apiRef.current) {
            _processOnChange(changes, apiRef.current);
          }
        });
      }, [props]);
      const renderMode = !React20.useSyncExternalStore || _getGridOption(props, "renderingMode") === "legacy" ? "legacy" : "default";
      return /* @__PURE__ */ React20.createElement("div", { style: style2, className: props.className, ref: setRef2 }, /* @__PURE__ */ React20.createElement(RenderModeContext.Provider, { value: renderMode }, context && !context.isDestroyed() ? /* @__PURE__ */ React20.createElement(gridComp_default, { key: context.instanceId, context }) : null, portalManager.current?.getPortals() ?? null));
    };
    function extractGridPropertyChanges(prevProps, nextProps) {
      const changes = {};
      for (const propKey of Object.keys(nextProps)) {
        if (excludeReactCompProps.has(propKey)) {
          if (deprecatedReactCompProps.has(propKey)) {
            _warn(274, { prop: propKey });
          }
          continue;
        }
        const propValue = nextProps[propKey];
        if (prevProps[propKey] !== propValue) {
          changes[propKey] = propValue;
        }
      }
      return changes;
    }
    var ReactFrameworkComponentWrapper = class extends BaseComponentWrapper {
      constructor(parent, gridOptions) {
        super();
        this.parent = parent;
        this.gridOptions = gridOptions;
      }
      createWrapper(UserReactComponent, componentType) {
        const gridOptions = this.gridOptions;
        const reactiveCustomComponents = _getGridOption(gridOptions, "reactiveCustomComponents");
        if (reactiveCustomComponents) {
          const getComponentClass = (propertyName2) => {
            switch (propertyName2) {
              case "filter":
                return _getGridOption(gridOptions, "enableFilterHandlers") ? FilterDisplayComponentWrapper : FilterComponentWrapper;
              case "floatingFilterComponent":
                return _getGridOption(gridOptions, "enableFilterHandlers") ? FloatingFilterDisplayComponentWrapper : FloatingFilterComponentWrapper;
              case "dateComponent":
                return DateComponentWrapper;
              case "dragAndDropImageComponent":
                return DragAndDropImageComponentWrapper;
              case "loadingOverlayComponent":
                return LoadingOverlayComponentWrapper;
              case "noRowsOverlayComponent":
                return NoRowsOverlayComponentWrapper;
              case "statusPanel":
                return StatusPanelComponentWrapper;
              case "toolPanel":
                return ToolPanelComponentWrapper;
              case "menuItem":
                return MenuItemComponentWrapper;
              case "cellRenderer":
                return CellRendererComponentWrapper;
              case "innerHeaderComponent":
                return InnerHeaderComponentWrapper;
            }
          };
          const ComponentClass = getComponentClass(componentType.name);
          if (ComponentClass) {
            return new ComponentClass(UserReactComponent, this.parent, componentType);
          }
        } else {
          switch (componentType.name) {
            case "filter":
            case "floatingFilterComponent":
            case "dateComponent":
            case "dragAndDropImageComponent":
            case "loadingOverlayComponent":
            case "noRowsOverlayComponent":
            case "statusPanel":
            case "toolPanel":
            case "menuItem":
            case "cellRenderer":
              warnReactiveCustomComponents();
              break;
          }
        }
        const suppressFallbackMethods = !componentType.cellRenderer && componentType.name !== "toolPanel";
        return new ReactComponent(UserReactComponent, this.parent, componentType, suppressFallbackMethods);
      }
    };
    var DetailCellRenderer = reactExports.forwardRef((props, ref) => {
      const beans = reactExports.useContext(BeansContext);
      const { registry, context, gos, rowModel } = beans;
      const [cssClasses, setCssClasses] = reactExports.useState(() => new CssClasses());
      const [gridCssClasses, setGridCssClasses] = reactExports.useState(() => new CssClasses());
      const [detailGridOptions, setDetailGridOptions] = reactExports.useState();
      const [detailRowData, setDetailRowData] = reactExports.useState();
      const ctrlRef = reactExports.useRef();
      const eGuiRef = reactExports.useRef(null);
      const resizeObserverDestroyFunc = reactExports.useRef();
      const parentModules = reactExports.useMemo(
        () => _getGridRegisteredModules(props.api.getGridId(), detailGridOptions?.rowModelType ?? "clientSide"),
        [props]
      );
      const topClassName = reactExports.useMemo(() => cssClasses.toString() + " ag-details-row", [cssClasses]);
      const gridClassName = reactExports.useMemo(() => gridCssClasses.toString() + " ag-details-grid", [gridCssClasses]);
      if (ref) {
        reactExports.useImperativeHandle(ref, () => ({
          refresh() {
            return ctrlRef.current?.refresh() ?? false;
          }
        }));
      }
      if (props.template) {
        _warn(230);
      }
      const setRef2 = reactExports.useCallback((eRef) => {
        eGuiRef.current = eRef;
        if (!eRef || context.isDestroyed()) {
          ctrlRef.current = context.destroyBean(ctrlRef.current);
          resizeObserverDestroyFunc.current?.();
          return;
        }
        const compProxy = {
          toggleCss: (name2, on) => setCssClasses((prev) => prev.setClass(name2, on)),
          toggleDetailGridCss: (name2, on) => setGridCssClasses((prev) => prev.setClass(name2, on)),
          setDetailGrid: (gridOptions) => setDetailGridOptions(gridOptions),
          setRowData: (rowData) => setDetailRowData(rowData),
          getGui: () => eGuiRef.current
        };
        const ctrl = registry.createDynamicBean("detailCellRendererCtrl", true);
        if (!ctrl) {
          return;
        }
        context.createBean(ctrl);
        ctrl.init(compProxy, props);
        ctrlRef.current = ctrl;
        if (gos.get("detailRowAutoHeight")) {
          const checkRowSizeFunc = () => {
            if (eGuiRef.current == null) {
              return;
            }
            const clientHeight = eGuiRef.current.clientHeight;
            if (clientHeight != null && clientHeight > 0) {
              const updateRowHeightFunc = () => {
                props.node.setRowHeight(clientHeight);
                if (_isClientSideRowModel(gos) || _isServerSideRowModel(gos)) {
                  rowModel.onRowHeightChanged();
                }
              };
              setTimeout(updateRowHeightFunc, 0);
            }
          };
          resizeObserverDestroyFunc.current = _observeResize(beans, eRef, checkRowSizeFunc);
          checkRowSizeFunc();
        }
      }, []);
      const registerGridApi = reactExports.useCallback((api2) => {
        ctrlRef.current?.registerDetailWithMaster(api2);
      }, []);
      return /* @__PURE__ */ React20.createElement("div", { className: topClassName, ref: setRef2 }, detailGridOptions && /* @__PURE__ */ React20.createElement(
        AgGridReactUi,
        {
          className: gridClassName,
          ...detailGridOptions,
          modules: parentModules,
          rowData: detailRowData,
          passGridApi: registerGridApi
        }
      ));
    });
    var ReactFrameworkOverrides = class extends VanillaFrameworkOverrides {
      constructor(processQueuedUpdates) {
        super("react");
        this.processQueuedUpdates = processQueuedUpdates;
        this.queueUpdates = false;
        this.renderingEngine = "react";
        this.frameworkComponents = {
          agGroupCellRenderer: groupCellRenderer_default,
          agGroupRowRenderer: groupCellRenderer_default,
          agDetailCellRenderer: DetailCellRenderer
        };
        this.wrapIncoming = (callback, source2) => {
          if (source2 === "ensureVisible") {
            return runWithoutFlushSync(callback);
          }
          return callback();
        };
      }
      frameworkComponent(name2) {
        return this.frameworkComponents[name2];
      }
      isFrameworkComponent(comp2) {
        if (!comp2) {
          return false;
        }
        const prototype = comp2.prototype;
        const isJsComp = prototype && "getGui" in prototype;
        return !isJsComp;
      }
      getLockOnRefresh() {
        this.queueUpdates = true;
      }
      releaseLockOnRefresh() {
        this.queueUpdates = false;
        this.processQueuedUpdates();
      }
      shouldQueueUpdates() {
        return this.queueUpdates;
      }
      runWhenReadyAsync() {
        return isReact19();
      }
    };
    var AgGridReact = class extends reactExports.Component {
      constructor() {
        super(...arguments);
        this.apiListeners = [];
        this.setGridApi = (api2) => {
          this.api = api2;
          for (const listener of this.apiListeners) {
            listener(api2);
          }
        };
      }
      registerApiListener(listener) {
        this.apiListeners.push(listener);
      }
      componentWillUnmount() {
        this.apiListeners.length = 0;
      }
      render() {
        return /* @__PURE__ */ React20.createElement(AgGridReactUi, { ...this.props, passGridApi: this.setGridApi });
      }
    };
    ModuleRegistry.registerModules([AllCommunityModule]);
    const createGridKeyboardHandler = ({
      gridRef,
      onOpenRow,
      pageJump = 10
    }) => {
      return (e) => {
        const api2 = gridRef.current?.api;
        if (!api2) {
          return;
        }
        const activeElement = document.activeElement;
        if (activeElement && (activeElement.tagName === "INPUT" || activeElement.tagName === "TEXTAREA" || activeElement.tagName === "SELECT")) {
          return;
        }
        const selectedRows = api2.getSelectedNodes();
        const totalRows = api2.getDisplayedRowCount();
        let currentRowIndex = -1;
        if (selectedRows.length > 0 && selectedRows[0].rowIndex !== null) {
          currentRowIndex = selectedRows[0].rowIndex;
        }
        let targetRowIndex = null;
        switch (e.key) {
          case "ArrowUp":
            e.preventDefault();
            if (e.metaKey || e.ctrlKey) {
              targetRowIndex = 0;
            } else {
              targetRowIndex = currentRowIndex === -1 ? 0 : currentRowIndex - 1;
              targetRowIndex = Math.max(0, targetRowIndex);
            }
            break;
          case "ArrowDown":
            e.preventDefault();
            if (e.metaKey || e.ctrlKey) {
              targetRowIndex = totalRows - 1;
            } else {
              targetRowIndex = currentRowIndex === -1 ? 0 : currentRowIndex + 1;
              targetRowIndex = Math.min(totalRows - 1, targetRowIndex);
            }
            break;
          case "Home":
            e.preventDefault();
            targetRowIndex = 0;
            break;
          case "End":
            e.preventDefault();
            targetRowIndex = totalRows - 1;
            break;
          case "PageUp":
            e.preventDefault();
            targetRowIndex = currentRowIndex === -1 ? 0 : Math.max(0, currentRowIndex - pageJump);
            break;
          case "PageDown":
            e.preventDefault();
            targetRowIndex = currentRowIndex === -1 ? 0 : Math.min(totalRows - 1, currentRowIndex + pageJump);
            break;
          case "Enter":
          case " ":
            e.preventDefault();
            if (currentRowIndex !== -1) {
              const rowNode = api2.getDisplayedRowAtIndex(currentRowIndex);
              if (rowNode?.data) {
                onOpenRow(rowNode, e);
              }
            }
            return;
          default:
            return;
        }
        if (targetRowIndex !== null && targetRowIndex !== currentRowIndex) {
          const targetNode = api2.getDisplayedRowAtIndex(targetRowIndex);
          if (targetNode) {
            targetNode.setSelected(true, true);
            api2.ensureIndexVisible(targetRowIndex, "middle");
          }
        }
      };
    };
    const LogListGrid = ({
      items,
      currentPath,
      gridRef: externalGridRef
    }) => {
      const {
        gridState,
        setGridState,
        setFilteredCount,
        previousLogPath,
        setPreviousLogPath
      } = useLogsListing();
      const { loadLogOverviews, loadAllLogOverviews } = useLogs();
      const loading = useStore((state) => state.app.status.loading);
      const syncing = useStore((state) => state.app.status.syncing);
      const setWatchedLogs = useStore((state) => state.logsActions.setWatchedLogs);
      const logPreviews = useStore((state) => state.logs.logPreviews);
      const logDetails = useStore((state) => state.logs.logDetails);
      const navigate = useNavigate();
      const internalGridRef = reactExports.useRef(null);
      const gridRef = externalGridRef ?? internalGridRef;
      const gridContainerRef = reactExports.useRef(null);
      const logFiles = reactExports.useMemo(() => {
        return items.filter((item2) => item2.type === "file").map((item2) => item2.log).filter((file) => file !== void 0);
      }, [items]);
      const { columns } = useLogListColumns();
      const initialGridState = reactExports.useMemo(() => {
        if (previousLogPath !== void 0 && previousLogPath !== currentPath) {
          const result2 = { ...gridState };
          delete result2.filter;
          return result2;
        }
        return gridState;
      }, [currentPath, gridState, previousLogPath]);
      reactExports.useEffect(() => {
        if (currentPath !== previousLogPath) {
          setPreviousLogPath(currentPath);
        }
      }, [currentPath, previousLogPath, setPreviousLogPath]);
      reactExports.useEffect(() => {
        gridContainerRef.current?.focus();
      }, []);
      const data = reactExports.useMemo(() => {
        return items.map((item2) => {
          const preview = item2.type === "file" ? item2.logPreview : void 0;
          const details = item2.type === "file" && item2.log ? logDetails[item2.log.name] : void 0;
          const row2 = {
            id: item2.id,
            name: item2.name,
            displayIndex: item2.type === "file" || item2.type === "pending-task" ? item2.displayIndex : void 0,
            type: item2.type,
            url: item2.url,
            task: item2.type === "file" ? preview?.task : item2.name,
            model: item2.type === "file" ? preview?.model : item2.type === "pending-task" ? item2.model : void 0,
            score: preview?.primary_metric?.value,
            status: preview?.status,
            completedAt: preview?.completed_at,
            itemCount: item2.type === "folder" ? item2.itemCount : void 0,
            log: item2.type === "file" ? item2.log : void 0
          };
          if (details?.results?.scores) {
            for (const evalScore of details.results.scores) {
              if (evalScore.metrics) {
                for (const [metricName, metric] of Object.entries(
                  evalScore.metrics
                )) {
                  row2[`score_${metricName}`] = metric.value;
                }
              }
            }
          }
          return row2;
        });
      }, [items, logDetails]);
      const handleRowClick = reactExports.useCallback(
        (e) => {
          if (e.data && e.node && gridRef.current?.api) {
            gridRef.current.api.deselectAll();
            e.node.setSelected(true);
            const mouseEvent = e.event;
            const openInNewWindow = mouseEvent?.metaKey || mouseEvent?.ctrlKey || mouseEvent?.shiftKey || mouseEvent?.button === 1;
            const url = e.data.url;
            if (url) {
              setTimeout(() => {
                if (openInNewWindow) {
                  window.open(`#${url}`, "_blank");
                } else {
                  navigate(url);
                }
              }, 10);
            }
          }
        },
        [navigate, gridRef]
      );
      const handleOpenRow = reactExports.useCallback(
        (rowNode, e) => {
          if (!rowNode.data?.url) {
            return;
          }
          const openInNewWindow = e.metaKey || e.ctrlKey || e.shiftKey;
          if (openInNewWindow) {
            window.open(`#${rowNode.data.url}`, "_blank");
          } else {
            navigate(rowNode.data.url);
          }
        },
        [navigate]
      );
      const handleKeyDown = reactExports.useMemo(
        () => createGridKeyboardHandler({
          gridRef,
          onOpenRow: handleOpenRow
        }),
        [gridRef, handleOpenRow]
      );
      reactExports.useEffect(() => {
        const gridElement = gridContainerRef.current;
        if (!gridElement) return;
        gridElement.addEventListener("keydown", handleKeyDown);
        return () => {
          gridElement.removeEventListener("keydown", handleKeyDown);
        };
      }, [handleKeyDown]);
      reactExports.useEffect(() => {
        const loadHeaders = async () => {
          const filesToLoad = logFiles.filter((file) => !logPreviews[file.name]);
          if (filesToLoad.length > 0) {
            await loadLogOverviews(filesToLoad);
          }
          setWatchedLogs(logFiles);
        };
        loadHeaders();
      }, [logFiles, loadLogOverviews, setWatchedLogs, logPreviews]);
      const handleSortChanged = reactExports.useCallback(async () => {
        await loadAllLogOverviews();
        setWatchedLogs(logFiles);
      }, [loadAllLogOverviews, setWatchedLogs, logFiles]);
      const handleFilterChanged = reactExports.useCallback(async () => {
        await loadAllLogOverviews();
        setWatchedLogs(logFiles);
        if (gridRef.current?.api) {
          const displayedRowCount = gridRef.current.api.getDisplayedRowCount();
          setFilteredCount(displayedRowCount);
        }
      }, [
        loadAllLogOverviews,
        setWatchedLogs,
        logFiles,
        setFilteredCount,
        gridRef
      ]);
      const maxColCount = reactExports.useRef(0);
      const resizeGridColumns = reactExports.useRef(createGridColumnResizer(gridRef)).current;
      reactExports.useEffect(() => {
        resizeGridColumns();
      }, [columns, resizeGridColumns]);
      return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$1d.gridWrapper), children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: gridContainerRef, className: styles$1d.gridContainer, tabIndex: 0, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
        AgGridReact,
        {
          ref: gridRef,
          rowData: data,
          animateRows: false,
          columnDefs: columns,
          defaultColDef: {
            sortable: true,
            filter: true,
            resizable: true
          },
          autoSizeStrategy: { type: "fitGridWidth" },
          headerHeight: 25,
          rowSelection: { mode: "singleRow", checkboxes: false },
          getRowId: (params) => params.data.id,
          onGridColumnsChanged: (e) => {
            const cols = e.api.getColumnDefs();
            if (cols && cols?.length > maxColCount.current) {
              maxColCount.current = cols.length;
              resizeGridColumns();
            }
          },
          onGridSizeChanged: resizeGridColumns,
          theme: themeBalham,
          enableCellTextSelection: true,
          initialState: initialGridState,
          suppressCellFocus: true,
          onStateUpdated: (e) => {
            setGridState(e.state);
            if (gridRef.current?.api) {
              const displayedRowCount = gridRef.current.api.getDisplayedRowCount();
              setFilteredCount(displayedRowCount);
            }
          },
          onRowClicked: handleRowClick,
          onSortChanged: handleSortChanged,
          onFilterChanged: handleFilterChanged,
          loading: data.length === 0 && (loading > 0 || syncing)
        }
      ) }) });
    };
    const footer$1 = "_footer_14uod_1";
    const spinnerContainer$1 = "_spinnerContainer_14uod_11";
    const spinner$2 = "_spinner_14uod_11";
    const label$8 = "_label_14uod_25";
    const right = "_right_14uod_30";
    const left = "_left_14uod_39";
    const center$1 = "_center_14uod_48";
    const styles$1b = {
      footer: footer$1,
      spinnerContainer: spinnerContainer$1,
      spinner: spinner$2,
      label: label$8,
      right,
      left,
      center: center$1
    };
    const LogListFooter = ({
      itemCount,
      itemCountLabel,
      filteredCount,
      progressText,
      progressBar
    }) => {
      const effectiveItemCount = filteredCount ?? itemCount;
      return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx("text-size-smaller", styles$1b.footer), children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$1b.left), children: progressText ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$1b.spinnerContainer), children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "div",
            {
              className: clsx("spinner-border", styles$1b.spinner),
              role: "status",
              children: /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: clsx("visually-hidden"), children: [
                progressText,
                "..."
              ] })
            }
          ),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx("text-style-secondary", styles$1b.label), children: [
            progressText,
            "..."
          ] })
        ] }) : null }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$1b.center) }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$1b.right), children: progressBar ? progressBar : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: effectiveItemCount === 0 ? "" : filteredCount !== void 0 && filteredCount !== itemCount ? `${effectiveItemCount} / ${itemCount} ${itemCountLabel || "items"}` : `${effectiveItemCount} ${itemCountLabel || "items"}` }) })
      ] });
    };
    const panel$6 = "_panel_16dj8_1";
    const list$1 = "_list_16dj8_8";
    const styles$1a = {
      panel: panel$6,
      list: list$1
    };
    const rootName = (relativePath) => {
      const parts = relativePath.split("/");
      if (parts.length === 0) {
        return "";
      }
      return parts[0];
    };
    const LogsPanel = ({ maybeShowSingleLog }) => {
      const { loadLogs } = useLogs();
      const gridRef = reactExports.useRef(null);
      const [showColumnSelector, setShowColumnSelector] = reactExports.useState(false);
      const columnButtonRef = reactExports.useRef(null);
      const showRetriedLogs = useStore((state) => state.logs.showRetriedLogs);
      const setShowRetriedLogs = useStore(
        (state) => state.logsActions.setShowRetriedLogs
      );
      const logDir2 = useStore((state) => state.logs.logDir);
      const logFiles = useLogsWithretried();
      const evalSet = useStore((state) => state.logs.evalSet);
      const logPreviews = useStore((state) => state.logs.logPreviews);
      const { filteredCount } = useLogsListing();
      const syncing = useStore((state) => state.app.status.syncing);
      const watchedLogs = useStore((state) => state.logs.listing.watchedLogs);
      const navigate = useNavigate();
      const { logPath } = useLogRouteParams();
      const currentDir = join(logPath || "", logDir2);
      useFlowServerData(logPath || "");
      const flowData = useStore((state) => state.logs.flow);
      const { startPolling, stopPolling } = useClientEvents();
      const { setDocumentTitle } = useDocumentTitle();
      reactExports.useEffect(() => {
        setDocumentTitle({
          logDir: logDir2
        });
      }, [setDocumentTitle, logDir2]);
      const previousWatchedLogs = reactExports.useRef(void 0);
      reactExports.useEffect(() => {
        const current2 = watchedLogs?.map((log2) => log2.name).sort().join(",") || "";
        const previous = previousWatchedLogs.current === void 0 ? void 0 : previousWatchedLogs.current?.map((log2) => log2.name).sort().join(",") || "";
        if (current2 !== previous) {
          stopPolling();
          if (watchedLogs !== void 0) {
            startPolling(watchedLogs);
          }
          previousWatchedLogs.current = watchedLogs;
        }
      }, [watchedLogs, startPolling, stopPolling]);
      const [logItems, hasRetriedLogs] = reactExports.useMemo(() => {
        const folderItems = [];
        const fileItems = [];
        const processedFolders = /* @__PURE__ */ new Set();
        const existingLogTaskIds = /* @__PURE__ */ new Set();
        let _hasRetriedLogs = false;
        for (const logFile of logFiles) {
          if (logFile.task_id) {
            existingLogTaskIds.add(logFile.task_id);
          }
          const name2 = logFile.name;
          const cleanDir = currentDir.endsWith("/") ? currentDir.slice(0, -1) : currentDir;
          const dirWithSlash = !currentDir.endsWith("/") ? currentDir + "/" : currentDir;
          if (isInDirectory(name2, cleanDir)) {
            const dirName = directoryRelativeUrl(currentDir, logDir2);
            const relativePath = directoryRelativeUrl(name2, currentDir);
            const fileOrFolderName = decodeURIComponent(rootName(relativePath));
            const path = join(
              decodeURIComponent(relativePath),
              decodeURIComponent(dirName)
            );
            if (logFile.retried) {
              _hasRetriedLogs = true;
            }
            if (showRetriedLogs || !logFile.retried) {
              fileItems.push({
                id: fileOrFolderName,
                name: fileOrFolderName,
                type: "file",
                url: logsUrl(path, logDir2),
                log: logFile,
                logPreview: logPreviews[logFile.name]
              });
            }
          } else if (name2.startsWith(dirWithSlash)) {
            const relativePath = directoryRelativeUrl(name2, currentDir);
            const dirName = decodeURIComponent(rootName(relativePath));
            const currentDirRelative = directoryRelativeUrl(currentDir, logDir2);
            const url = join(dirName, decodeURIComponent(currentDirRelative));
            if (!processedFolders.has(dirName)) {
              folderItems.push({
                id: dirName,
                name: dirName,
                type: "folder",
                url: logsUrl(url, logDir2),
                itemCount: logFiles.filter(
                  (file) => file.name.startsWith(dirname(name2))
                ).length
              });
              processedFolders.add(dirName);
            }
          }
        }
        const orderedItems = [...folderItems, ...fileItems];
        const _logFiles = appendPendingItems(
          evalSet,
          existingLogTaskIds,
          orderedItems
        );
        return [_logFiles, _hasRetriedLogs];
      }, [evalSet, logFiles, currentDir, logDir2, logPreviews, showRetriedLogs]);
      const { columns, setColumnVisibility } = useLogListColumns();
      const handleColumnVisibilityChange = reactExports.useCallback(
        (newVisibility) => {
          if (gridRef.current?.api) {
            const currentFilterModel = gridRef.current.api.getFilterModel() || {};
            let filtersRemoved = false;
            const newFilterModel = {};
            for (const [field, filter] of Object.entries(currentFilterModel)) {
              if (newVisibility[field] === false) {
                filtersRemoved = true;
              } else {
                newFilterModel[field] = filter;
              }
            }
            if (filtersRemoved) {
              gridRef.current.api.setFilterModel(newFilterModel);
            }
          }
          setColumnVisibility(newVisibility);
        },
        [setColumnVisibility]
      );
      const progress2 = reactExports.useMemo(() => {
        let pending = 0;
        let total = 0;
        for (const item2 of logItems) {
          if (item2.type === "file" || item2.type === "pending-task") {
            total += 1;
            if (item2.type === "pending-task" || item2.logPreview?.status === "started") {
              pending += 1;
            }
          }
        }
        return {
          complete: total - pending,
          total
        };
      }, [logItems]);
      reactExports.useEffect(() => {
        loadLogs(logPath);
      }, [loadLogs, logPath]);
      const handleResetFilters = () => {
        if (gridRef.current?.api) {
          gridRef.current.api.setFilterModel(null);
        }
      };
      const filterModel = gridRef.current?.api?.getFilterModel() || {};
      const filteredFields = Object.keys(filterModel);
      const hasFilter = filteredFields.length > 0;
      reactExports.useEffect(() => {
        if (maybeShowSingleLog && logItems.length === 1) {
          const onlyItem = logItems[0];
          if (onlyItem.url) {
            navigate(onlyItem.url);
          }
        }
      }, [logItems, maybeShowSingleLog, navigate]);
      return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$1a.panel), children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs(
          ApplicationNavbar,
          {
            fnNavigationUrl: logsUrl,
            currentPath: logPath,
            showActivity: "log",
            children: [
              hasFilter && /* @__PURE__ */ jsxRuntimeExports.jsx(
                NavbarButton,
                {
                  label: "Reset Filters",
                  icon: ApplicationIcons.filter,
                  onClick: handleResetFilters
                },
                "reset-filters"
              ),
              hasRetriedLogs && /* @__PURE__ */ jsxRuntimeExports.jsx(
                NavbarButton,
                {
                  label: "Show Retried Logs",
                  icon: showRetriedLogs ? ApplicationIcons.toggle.on : ApplicationIcons.toggle.off,
                  latched: showRetriedLogs,
                  onClick: () => setShowRetriedLogs(!showRetriedLogs)
                },
                "show-retried"
              ),
              /* @__PURE__ */ jsxRuntimeExports.jsx(
                NavbarButton,
                {
                  ref: columnButtonRef,
                  label: "Choose Columns",
                  icon: ApplicationIcons.checkbox.checked,
                  onClick: (e) => {
                    e.stopPropagation();
                    setShowColumnSelector((prev) => !prev);
                  }
                },
                "choose-columns"
              ),
              /* @__PURE__ */ jsxRuntimeExports.jsx(ViewSegmentedControl, { selectedSegment: "logs" }),
              flowData && /* @__PURE__ */ jsxRuntimeExports.jsx(FlowButton, {})
            ]
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          ColumnSelectorPopover,
          {
            showing: showColumnSelector,
            setShowing: setShowColumnSelector,
            columns,
            onVisibilityChange: handleColumnVisibilityChange,
            positionEl: columnButtonRef.current,
            filteredFields
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$1a.list, "text-size-smaller"), children: /* @__PURE__ */ jsxRuntimeExports.jsx(
            LogListGrid,
            {
              items: logItems,
              currentPath: currentDir,
              gridRef
            }
          ) }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            LogListFooter,
            {
              itemCount: logItems.length,
              filteredCount,
              progressText: syncing ? "Syncing data" : void 0,
              progressBar: progress2.total !== progress2.complete ? /* @__PURE__ */ jsxRuntimeExports.jsx(
                ProgressBar,
                {
                  min: 0,
                  max: progress2.total,
                  value: progress2.complete,
                  width: "100px"
                }
              ) : void 0
            }
          )
        ] })
      ] });
    };
    const appendPendingItems = (evalSet, tasksWithLogFiles, collapsedLogItems) => {
      const pendingTasks = new Array();
      for (const task of evalSet?.tasks || []) {
        if (!tasksWithLogFiles.has(task.task_id)) {
          pendingTasks.push({
            id: task.task_id,
            name: task.name || "<unknown>",
            model: task.model,
            type: "pending-task"
          });
        }
      }
      pendingTasks.sort((a, b) => a.name.localeCompare(b.name));
      collapsedLogItems.push(...pendingTasks);
      return collapsedLogItems;
    };
    const useUnloadLog = () => {
      const clearSelectedLogDetails = useStore(
        (state) => state.logActions.clearSelectedLogDetails
      );
      const clearSelectedLogFile = useStore(
        (state) => state.logsActions.clearSelectedLogFile
      );
      const clearLog = useStore((state) => state.logActions.clearLog);
      const unloadLog = reactExports.useCallback(() => {
        clearSelectedLogDetails();
        clearSelectedLogFile();
        clearLog();
      }, [clearLog, clearSelectedLogDetails, clearSelectedLogFile]);
      return { unloadLog };
    };
    const ExtendedFindContext = reactExports.createContext(null);
    const ExtendedFindProvider = ({
      children: children2
    }) => {
      const virtualLists = reactExports.useRef(/* @__PURE__ */ new Map());
      const extendedFindTerm = reactExports.useCallback(
        async (term, direction) => {
          for (const [, searchFn] of virtualLists.current) {
            const found = await new Promise((resolve) => {
              let callbackFired = false;
              const onContentReady = () => {
                if (!callbackFired) {
                  callbackFired = true;
                  resolve(true);
                }
              };
              searchFn(term, direction, onContentReady).then((found2) => {
                if (!found2 && !callbackFired) {
                  callbackFired = true;
                  resolve(false);
                }
              }).catch(() => {
                if (!callbackFired) {
                  callbackFired = true;
                  resolve(false);
                }
              });
            });
            if (found) {
              return true;
            }
          }
          return false;
        },
        []
      );
      const registerVirtualList = reactExports.useCallback(
        (id, searchFn) => {
          virtualLists.current.set(id, searchFn);
          return () => {
            virtualLists.current.delete(id);
          };
        },
        []
      );
      const contextValue = {
        extendedFindTerm,
        registerVirtualList
      };
      return /* @__PURE__ */ jsxRuntimeExports.jsx(ExtendedFindContext.Provider, { value: contextValue, children: children2 });
    };
    const useExtendedFind = () => {
      const context = reactExports.useContext(ExtendedFindContext);
      if (!context) {
        throw new Error("useSearch must be used within a SearchProvider");
      }
      return context;
    };
    const findConfig = {
      caseSensitive: false,
      wrapAround: false,
      wholeWord: false,
      searchInFrames: false,
      showDialog: false
    };
    const FindBand = () => {
      const searchBoxRef = reactExports.useRef(null);
      const storeHideFind = useStore((state) => state.appActions.hideFind);
      const { extendedFindTerm } = useExtendedFind();
      const lastFoundItem = reactExports.useRef(null);
      const currentSearchTerm = reactExports.useRef("");
      const debounceTimerRef = reactExports.useRef(null);
      const needsCursorRestoreRef = reactExports.useRef(false);
      const lastNoResultTerm = reactExports.useRef("");
      const getParentExpandablePanel = reactExports.useCallback(
        (selection) => {
          let node2 = selection.anchorNode;
          while (node2) {
            if (node2 instanceof HTMLElement && node2.hasAttribute("data-expandable-panel")) {
              return node2;
            }
            node2 = node2.parentElement;
          }
          return void 0;
        },
        []
      );
      const handleSearch = reactExports.useCallback(
        async (back = false) => {
          const searchTerm = searchBoxRef.current?.value ?? "";
          if (!searchTerm) {
            return;
          }
          if (currentSearchTerm.current !== searchTerm) {
            lastFoundItem.current = null;
            currentSearchTerm.current = searchTerm;
          }
          if (lastNoResultTerm.current && !searchTerm.startsWith(lastNoResultTerm.current)) {
            lastNoResultTerm.current = "";
          }
          const noResultEl = document.getElementById("inspect-find-no-results");
          if (lastNoResultTerm.current && searchTerm.startsWith(lastNoResultTerm.current)) {
            if (noResultEl) {
              noResultEl.style.opacity = "1";
            }
            return;
          }
          const focusedElement = document.activeElement;
          let result2 = await findExtendedInDOM(
            searchTerm,
            back,
            lastFoundItem.current,
            extendedFindTerm
          );
          if (!noResultEl) {
            return;
          }
          noResultEl.style.opacity = result2 ? "0" : "1";
          lastNoResultTerm.current = result2 ? "" : searchTerm;
          if (result2) {
            const selection = window.getSelection();
            if (selection && selection.rangeCount > 0) {
              const range2 = selection.getRangeAt(0);
              const parentElement = range2.startContainer.parentElement || range2.commonAncestorContainer;
              lastFoundItem.current = {
                text: range2.toString(),
                offset: range2.startOffset,
                parentElement
              };
              const parentPanel = getParentExpandablePanel(selection);
              if (parentPanel) {
                parentPanel.style.display = "block";
                parentPanel.style.maxHeight = "none";
                parentPanel.style.webkitLineClamp = "";
                parentPanel.style.webkitBoxOrient = "";
              }
              const element = range2.startContainer.parentElement;
              if (element) {
                setTimeout(() => {
                  element.scrollIntoView({
                    behavior: "auto",
                    block: "center"
                  });
                }, 100);
              }
            }
          }
          focusedElement?.focus();
        },
        [getParentExpandablePanel, extendedFindTerm]
      );
      reactExports.useEffect(() => {
        setTimeout(() => {
          searchBoxRef.current?.focus();
          searchBoxRef.current?.select();
        }, 10);
        const handleGlobalKeydown = (e) => {
          if ((e.ctrlKey || e.metaKey) && e.key === "f") {
            e.preventDefault();
            e.stopPropagation();
            searchBoxRef.current?.focus();
            searchBoxRef.current?.select();
          } else if ((e.ctrlKey || e.metaKey) && e.key === "g") {
            e.preventDefault();
            e.stopPropagation();
            const back = e.shiftKey;
            handleSearch(back);
          }
        };
        document.addEventListener("keydown", handleGlobalKeydown, true);
        return () => {
          document.removeEventListener("keydown", handleGlobalKeydown, true);
        };
      }, [handleSearch]);
      const handleKeyDown = reactExports.useCallback(
        (e) => {
          if (e.key === "Escape") {
            storeHideFind();
          } else if (e.key === "Enter") {
            handleSearch(e.shiftKey);
          } else if ((e.ctrlKey || e.metaKey) && e.key.toLowerCase() === "g") {
            e.preventDefault();
            handleSearch(!e.shiftKey);
          } else if ((e.ctrlKey || e.metaKey) && e.key.toLowerCase() === "f") {
            searchBoxRef.current?.focus();
            searchBoxRef.current?.select();
          }
        },
        [storeHideFind, handleSearch]
      );
      const findPrevious = reactExports.useCallback(() => {
        handleSearch(true);
      }, [handleSearch]);
      const findNext = reactExports.useCallback(() => {
        handleSearch(false);
      }, [handleSearch]);
      const restoreCursor = reactExports.useCallback(() => {
        if (!needsCursorRestoreRef.current) return;
        needsCursorRestoreRef.current = false;
        const input2 = searchBoxRef.current;
        if (input2) {
          const len = input2.value.length;
          input2.setSelectionRange(len, len);
        }
      }, []);
      const handleInputChange = reactExports.useCallback(() => {
        if (debounceTimerRef.current !== null) {
          window.clearTimeout(debounceTimerRef.current);
        }
        debounceTimerRef.current = window.setTimeout(async () => {
          debounceTimerRef.current = null;
          if (!searchBoxRef.current) return;
          await handleSearch(false);
          needsCursorRestoreRef.current = true;
        }, 300);
      }, [handleSearch]);
      const handleBeforeInput = reactExports.useCallback(() => {
        restoreCursor();
      }, [restoreCursor]);
      reactExports.useEffect(() => {
        const handleGlobalKeyDown = (e) => {
          if (e.key === "F3") {
            e.preventDefault();
            handleSearch(e.shiftKey);
            return;
          }
          if (e.ctrlKey || e.metaKey || e.altKey) return;
          if (e.key.length !== 1 && e.key !== "Backspace" && e.key !== "Delete")
            return;
          const input2 = searchBoxRef.current;
          if (!input2) return;
          restoreCursor();
          if (document.activeElement !== input2) {
            input2.focus();
          }
        };
        document.addEventListener("keydown", handleGlobalKeyDown);
        return () => {
          document.removeEventListener("keydown", handleGlobalKeyDown);
          if (debounceTimerRef.current !== null) {
            window.clearTimeout(debounceTimerRef.current);
          }
        };
      }, [handleSearch, restoreCursor]);
      return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { "data-unsearchable": "true", className: clsx("findBand"), children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          "input",
          {
            type: "text",
            ref: searchBoxRef,
            placeholder: "Find",
            onKeyDown: handleKeyDown,
            onBeforeInput: handleBeforeInput,
            onChange: handleInputChange
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsx("span", { id: "inspect-find-no-results", children: "No results" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          "button",
          {
            type: "button",
            title: "Previous match",
            className: "btn next",
            onClick: findPrevious,
            children: /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: ApplicationIcons.arrows.up })
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          "button",
          {
            type: "button",
            title: "Next match",
            className: "btn prev",
            onClick: findNext,
            children: /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: ApplicationIcons.arrows.down })
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          "button",
          {
            type: "button",
            title: "Close",
            className: "btn close",
            onClick: storeHideFind,
            children: /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: ApplicationIcons.close })
          }
        )
      ] });
    };
    async function findExtendedInDOM(searchTerm, back, lastFoundItem, extendedFindTerm) {
      let result2 = false;
      let attempts = 0;
      let hasTriedExtendedSearch = false;
      const maxAttempts = 25;
      do {
        result2 = window.find(
          searchTerm,
          findConfig.caseSensitive,
          back,
          findConfig.wrapAround,
          findConfig.wholeWord,
          findConfig.searchInFrames,
          findConfig.showDialog
        );
        if (result2) {
          const selection = window.getSelection();
          if (selection && selection.rangeCount > 0) {
            const range2 = selection.getRangeAt(0);
            let isUnsearchable = inUnsearchableElement(range2);
            const isSameAsLast = isLastFoundItem(range2, lastFoundItem);
            if (!isUnsearchable && !isSameAsLast) {
              break;
            }
          }
        } else if (!hasTriedExtendedSearch) {
          hasTriedExtendedSearch = true;
          const foundInVirtual = await extendedFindTerm(
            searchTerm,
            back ? "backward" : "forward"
          );
          if (foundInVirtual) ;
          else {
            break;
          }
        } else {
          break;
        }
        attempts++;
      } while (attempts < maxAttempts);
      return result2;
    }
    function isLastFoundItem(range2, lastFoundItem) {
      if (!lastFoundItem) return false;
      const currentText = range2.toString();
      const currentOffset = range2.startOffset;
      const currentParentElement = range2.startContainer.parentElement || range2.commonAncestorContainer;
      return currentText === lastFoundItem.text && currentOffset === lastFoundItem.offset && currentParentElement === lastFoundItem.parentElement;
    }
    function inUnsearchableElement(range2) {
      let element = selectionParentElement(range2);
      let isUnsearchable = false;
      while (element) {
        if (element.hasAttribute("data-unsearchable") || getComputedStyle(element).userSelect === "none") {
          isUnsearchable = true;
          break;
        }
        element = element.parentElement;
      }
      return isUnsearchable;
    }
    function selectionParentElement(range2) {
      let element = null;
      if (range2.startContainer.nodeType === Node.ELEMENT_NODE) {
        element = range2.startContainer;
      } else {
        element = range2.startContainer.parentElement;
      }
      if (!element && range2.commonAncestorContainer.nodeType === Node.ELEMENT_NODE) {
        element = range2.commonAncestorContainer;
      } else if (!element && range2.commonAncestorContainer.parentElement) {
        element = range2.commonAncestorContainer.parentElement;
      }
      return element;
    }
    const EmptyPanel = ({ children: children2 }) => {
      return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "empty-panel", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "container", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: children2 }) }) });
    };
    const tabs$1 = "_tabs_jdywf_1";
    const tabContents = "_tabContents_jdywf_5";
    const scrollable = "_scrollable_jdywf_10";
    const tab$1 = "_tab_jdywf_1";
    const tabItem = "_tabItem_jdywf_24";
    const tabIcon = "_tabIcon_jdywf_28";
    const tabTools = "_tabTools_jdywf_32";
    const tabStyle = "_tabStyle_jdywf_42";
    const moduleStyles = {
      tabs: tabs$1,
      tabContents,
      scrollable,
      tab: tab$1,
      tabItem,
      tabIcon,
      tabTools,
      tabStyle
    };
    const TabSet = ({
      id,
      type = "tabs",
      className: className2,
      tabPanelsClassName,
      tabControlsClassName,
      tools: tools2,
      tabsRef,
      children: children2
    }) => {
      const validTabs = flattenChildren(children2);
      if (validTabs.length === 0) return null;
      return /* @__PURE__ */ jsxRuntimeExports.jsxs(reactExports.Fragment, { children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs(
          "ul",
          {
            ref: tabsRef,
            id,
            className: clsx(
              "nav",
              `nav-${type}`,
              type === "tabs" ? moduleStyles.tabStyle : void 0,
              className2,
              moduleStyles.tabs
            ),
            role: "tablist",
            "aria-orientation": "horizontal",
            children: [
              validTabs.map((tab2, index) => /* @__PURE__ */ jsxRuntimeExports.jsx(
                Tab,
                {
                  index,
                  type,
                  tab: tab2,
                  className: clsx(tabControlsClassName)
                },
                tab2.props.id
              )),
              tools2 && /* @__PURE__ */ jsxRuntimeExports.jsx(TabTools, { tools: tools2 })
            ]
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsx(TabPanels, { id, tabs: validTabs, className: tabPanelsClassName })
      ] });
    };
    const Tab = ({ type = "tabs", tab: tab2, index, className: className2 }) => {
      const tabId = tab2.props.id || computeTabId("tabset", index);
      const tabContentsId = computeTabContentsId(tab2.props.id);
      const isActive = tab2.props.selected;
      return /* @__PURE__ */ jsxRuntimeExports.jsx("li", { role: "presentation", className: clsx("nav-item", moduleStyles.tabItem), children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
        "button",
        {
          id: tabId,
          className: clsx(
            "nav-link",
            className2,
            isActive && "active",
            type === "pills" ? moduleStyles.pill : moduleStyles.tab,
            "text-size-small",
            "text-style-label"
          ),
          type: "button",
          role: "tab",
          "aria-controls": tabContentsId,
          "aria-selected": isActive,
          onClick: tab2.props.onSelected,
          children: [
            tab2.props.icon && /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: clsx(tab2.props.icon, moduleStyles.tabIcon) }),
            tab2.props.title
          ]
        }
      ) });
    };
    const TabPanels = ({ id, tabs: tabs2, className: className2 }) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx("tab-content", className2), id: `${id}-content`, children: tabs2.map((tab2, index) => /* @__PURE__ */ jsxRuntimeExports.jsx(TabPanel, { ...tab2.props, index }, tab2.props.id)) });
    const TabPanel = ({
      id,
      selected: selected2,
      style: style2,
      scrollable: scrollable2 = true,
      scrollRef,
      className: className2,
      children: children2
    }) => {
      const tabContentsId = computeTabContentsId(id);
      const panelRef = reactExports.useRef(null);
      const tabContentsRef = scrollRef || panelRef;
      useStatefulScrollPosition(tabContentsRef, tabContentsId, 1e3, scrollable2);
      return /* @__PURE__ */ jsxRuntimeExports.jsx(
        "div",
        {
          id: tabContentsId,
          ref: tabContentsRef,
          className: clsx(
            "tab-pane",
            selected2 && "show active",
            className2,
            moduleStyles.tabContents,
            scrollable2 && moduleStyles.scrollable
          ),
          style: style2,
          children: selected2 ? children2 : null
        }
      );
    };
    const TabTools = ({ tools: tools2 }) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx("tab-tools", moduleStyles.tabTools), children: tools2 });
    const computeTabId = (id, index) => `${id}-${index}`;
    const computeTabContentsId = (id) => `${id}-contents`;
    const flattenChildren = (children2) => {
      return reactExports.Children.toArray(children2).flatMap((child) => {
        if (reactExports.isValidElement(child)) {
          const element = child;
          if (element.type === reactExports.Fragment) {
            return flattenChildren(element.props.children);
          }
          return element;
        }
        return [];
      });
    };
    const useLogNavigation = () => {
      const navigate = useNavigate();
      const { logPath } = useParams();
      const logDir2 = useStore((state) => state.logs.logDir);
      const loadedLog = useStore((state) => state.log.loadedLog);
      const selectTab = reactExports.useCallback(
        (tabId) => {
          if (loadedLog && logPath) {
            const url = logsUrlRaw(logPath, tabId);
            navigate(url);
          } else if (loadedLog) {
            const url = logsUrl(loadedLog, logDir2, tabId);
            navigate(url);
          }
        },
        [loadedLog, logPath, logDir2, navigate]
      );
      return {
        selectTab
      };
    };
    const workspace = "_workspace_1r3mu_1";
    const tabContainer = "_tabContainer_1r3mu_6";
    const tabSet = "_tabSet_1r3mu_14";
    const tabs = "_tabs_1r3mu_21";
    const tabPanels = "_tabPanels_1r3mu_29";
    const styles$19 = {
      workspace,
      tabContainer,
      tabSet,
      tabs,
      tabPanels
    };
    const CardHeader = ({
      id,
      icon: icon2,
      label: label2,
      className: className2,
      children: children2
    }) => {
      return /* @__PURE__ */ jsxRuntimeExports.jsxs(
        "div",
        {
          className: clsx("card-header-container", "text-style-label", className2),
          id: id || "",
          children: [
            icon2 ? /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: clsx("card-header-icon", icon2) }) : /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "card-header-icon" }),
            label2 ? label2 : "",
            " ",
            children2
          ]
        }
      );
    };
    const CardBody = ({
      id,
      children: children2,
      className: className2,
      padded: padded2 = true
    }) => {
      return /* @__PURE__ */ jsxRuntimeExports.jsx(
        "div",
        {
          className: clsx(
            "card-body",
            className2,
            !padded2 ? "card-no-padding" : void 0
          ),
          id: id || "",
          children: children2
        }
      );
    };
    const Card = ({ id, children: children2, className: className2 }) => {
      return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx("card", className2), id, children: children2 });
    };
    const message$1 = "_message_1gb2h_5";
    const styles$18 = {
      "task-error-display": "_task-error-display_1gb2h_1",
      message: message$1
    };
    const TaskErrorCard = ({ error: error2 }) => {
      return /* @__PURE__ */ jsxRuntimeExports.jsxs(Card, { children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          CardHeader,
          {
            icon: ApplicationIcons.error,
            label: `Task Failed`
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsxs(CardBody, { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            ExpandablePanel,
            {
              id: "task-error-collapse",
              collapse: true,
              className: clsx("text-size-smaller", styles$18.message),
              children: /* @__PURE__ */ jsxRuntimeExports.jsx(
                RenderedContent,
                {
                  id: "task-error-message",
                  entry: { name: "error", value: error2.message }
                }
              )
            }
          ),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            ANSIDisplay,
            {
              output: error2.traceback_ansi,
              className: styles$18["task-error-display"]
            }
          )
        ] })
      ] });
    };
    const useErrorTabConfig = (evalError) => {
      const scrollRef = reactExports.useRef(null);
      return reactExports.useMemo(() => {
        return {
          id: kLogViewErrorTabId,
          label: "Error",
          scrollable: true,
          component: ErrorTab,
          componentProps: {
            evalError,
            scrollRef
          },
          scrollRef
        };
      }, [evalError]);
    };
    const ErrorTab = ({ evalError }) => {
      return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { width: "100%" }, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: { padding: "0.5em 1em 0 1em", width: "100%" }, children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          TaskErrorCard,
          {
            error: evalError || {
              message: "Unknown error",
              traceback: "",
              traceback_ansi: ""
            }
          }
        ),
        " "
      ] }) });
    };
    const MessageBand = ({
      id,
      message: message2,
      type,
      scope = "eval"
    }) => {
      const className2 = [type];
      const [visible2, setVisible] = useMessageVisibility(id, scope);
      const handleClick = reactExports.useCallback(() => {
        setVisible(false);
      }, [setVisible]);
      if (!visible2) {
        className2.push("hidden");
      }
      return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx("message-band", className2), children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: ApplicationIcons.logging[type] }),
        message2,
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          "button",
          {
            className: clsx("btn", "message-band-btn", type),
            title: "Close",
            onClick: handleClick,
            children: /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: ApplicationIcons.close })
          }
        )
      ] });
    };
    const item$1 = "_item_1uzhd_1";
    const styles$17 = {
      item: item$1
    };
    const DatasetDetailView = ({
      dataset,
      style: style2
    }) => {
      const filtered = Object.fromEntries(
        Object.entries(dataset).filter(([key2]) => key2 !== "sample_ids")
      );
      if (!dataset || Object.keys(filtered).length === 0) {
        return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: clsx("text-size-base", styles$17.item), style: style2, children: "No dataset information available" });
      }
      return /* @__PURE__ */ jsxRuntimeExports.jsx(
        MetaDataGrid,
        {
          className: clsx("text-size-base", styles$17.item),
          entries: filtered,
          style: style2,
          plain: true
        }
      );
    };
    const icon$2 = "_icon_59zaz_1";
    const container$j = "_container_59zaz_5";
    const metadata$1 = "_metadata_59zaz_11";
    const styles$16 = {
      icon: icon$2,
      container: container$j,
      metadata: metadata$1
    };
    const DetailStep = ({
      icon: icon2,
      name: name2,
      params,
      className: className2
    }) => {
      const iconHtml = icon2 ? /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: clsx(icon2, styles$16.icon) }) : "";
      return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(className2), children: [
        iconHtml,
        " ",
        name2,
        params && Object.keys(params).length > 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$16.container, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
          MetaDataGrid,
          {
            entries: params,
            className: clsx("text-size-small", styles$16.metadata)
          }
        ) }) : ""
      ] });
    };
    const item = "_item_leq25_1";
    const styles$15 = {
      item
    };
    const ScorerDetailView = ({
      name: name2,
      scores: scores2,
      params
    }) => {
      if (scores2.length > 1) {
        params = { ...params, ["scores"]: scores2 };
      }
      return /* @__PURE__ */ jsxRuntimeExports.jsx(
        DetailStep,
        {
          icon: ApplicationIcons.scorer,
          name: name2,
          params,
          className: clsx(styles$15.item, "text-size-base")
        }
      );
    };
    const container$i = "_container_12j2k_1";
    const separator$5 = "_separator_12j2k_11";
    const styles$14 = {
      container: container$i,
      separator: separator$5
    };
    const SolversDetailView = ({ steps }) => {
      const separator2 = /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$14.items, "text-size-small", styles$14.separator), children: /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: ApplicationIcons.arrows.right }) });
      const details = steps?.map((step, index) => {
        return /* @__PURE__ */ jsxRuntimeExports.jsxs(reactExports.Fragment, { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            DetailStep,
            {
              name: step.solver,
              className: clsx(styles$14.items, "text-size-small")
            }
          ),
          index < steps.length - 1 ? separator2 : ""
        ] }, `solver-step-${index}`);
      });
      return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$14.container, children: details });
    };
    const floatingCol = "_floatingCol_1n79r_1";
    const wideCol = "_wideCol_1n79r_9";
    const planCol = "_planCol_1n79r_24";
    const container$h = "_container_1n79r_29";
    const grid$7 = "_grid_1n79r_35";
    const styles$13 = {
      floatingCol,
      wideCol,
      planCol,
      container: container$h,
      grid: grid$7
    };
    const PlanDetailView = ({
      evaluation,
      plan,
      scores: scores2
    }) => {
      if (!evaluation) {
        return null;
      }
      const steps = plan?.steps;
      const taskColumns = [];
      taskColumns.push({
        title: "Dataset",
        className: styles$13.floatingCol,
        contents: /* @__PURE__ */ jsxRuntimeExports.jsx(DatasetDetailView, { dataset: evaluation.dataset })
      });
      if (steps) {
        taskColumns.push({
          title: "Solvers",
          className: styles$13.wideCol,
          contents: /* @__PURE__ */ jsxRuntimeExports.jsx(SolversDetailView, { steps })
        });
      }
      if (scores2) {
        const scorers = scores2.reduce(
          (accum, score2) => {
            if (!accum[score2.scorer]) {
              accum[score2.scorer] = {
                scores: [score2.name],
                params: score2.params
              };
            } else {
              accum[score2.scorer].scores.push(score2.name);
            }
            return accum;
          },
          {}
        );
        if (Object.keys(scorers).length > 0) {
          const label2 = Object.keys(scorers).length === 1 ? "Scorer" : "Scorers";
          const scorerPanels = Object.keys(scorers).map((key2) => {
            return /* @__PURE__ */ jsxRuntimeExports.jsx(
              ScorerDetailView,
              {
                name: key2,
                scores: scorers[key2].scores,
                params: scorers[key2].params
              },
              key2
            );
          });
          taskColumns.push({
            title: label2,
            className: styles$13.floatingCol,
            contents: scorerPanels
          });
        }
      }
      return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$13.container, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
        "div",
        {
          className: styles$13.grid,
          style: {
            gridTemplateColumns: `repeat(${taskColumns.length}, fit-content(50%))`
          },
          children: taskColumns.map((col) => {
            return /* @__PURE__ */ jsxRuntimeExports.jsx(
              PlanColumn,
              {
                title: col.title,
                className: col.className,
                children: col.contents
              },
              `plan-col-${col.title}`
            );
          })
        }
      ) });
    };
    const PlanColumn = ({ title: title2, className: className2, children: children2 }) => {
      return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(className2), children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          "div",
          {
            className: clsx(
              "card-subheading",
              "text-size-small",
              "text-style-label",
              "text-style-secondary",
              styles$13.planCol
            ),
            children: title2
          }
        ),
        children2
      ] });
    };
    const PlanCard = ({
      evalSpec,
      evalPlan,
      scores: scores2,
      scrollRef
    }) => {
      const metadata2 = evalSpec?.metadata || {};
      return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs(Card, { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(CardHeader, { label: "Summary" }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(CardBody, { id: "task-plan-card-body", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
            PlanDetailView,
            {
              evaluation: evalSpec,
              plan: evalPlan,
              scores: scores2
            }
          ) })
        ] }),
        Object.keys(metadata2).length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs(Card, { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(CardHeader, { label: "Metadata" }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(CardBody, { id: "task-metadata`", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
            RecordTree,
            {
              id: "plan-md-metadata",
              record: metadata2,
              scrollRef
            }
          ) })
        ] })
      ] });
    };
    const useInfoTabConfig = (evalSpec, evalPlan, evalError, evalResults, evalStatus) => {
      const scrollRef = reactExports.useRef(null);
      const totalSampleCount = useTotalSampleCount();
      return reactExports.useMemo(() => {
        return {
          id: kLogViewInfoTabId,
          label: "Info",
          scrollable: true,
          component: InfoTab,
          componentProps: {
            evalSpec,
            evalPlan,
            evalError,
            evalResults,
            evalStatus,
            sampleCount: totalSampleCount,
            scrollRef
          },
          scrollRef
        };
      }, [
        evalSpec,
        evalPlan,
        evalError,
        evalResults,
        evalStatus,
        totalSampleCount
      ]);
    };
    const InfoTab = ({
      evalSpec,
      evalPlan,
      evalResults,
      evalStatus,
      sampleCount,
      scrollRef
    }) => {
      const showWarning = sampleCount === 0 && evalStatus === "success" && evalSpec?.dataset.samples && evalSpec.dataset.samples > 0;
      return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: { width: "100%" }, children: [
        showWarning ? /* @__PURE__ */ jsxRuntimeExports.jsx(
          MessageBand,
          {
            id: "sample-too-large",
            message: "Unable to display samples (this evaluation log may be too large).",
            type: "warning"
          }
        ) : "",
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { padding: "0.5em 1em 0 1em", width: "100%" }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
          PlanCard,
          {
            evalSpec,
            evalPlan,
            scores: evalResults?.scores,
            scrollRef
          }
        ) })
      ] });
    };
    const DownloadButton = ({
      label: label2,
      fileName,
      fileContents
    }) => {
      return /* @__PURE__ */ jsxRuntimeExports.jsx(
        "button",
        {
          className: "btn btn-outline-primary download-button",
          onClick: async () => {
            await api.download_file(fileName, fileContents);
          },
          children: label2
        }
      );
    };
    const DownloadPanel = ({
      message: message2,
      buttonLabel,
      fileName,
      fileContents
    }) => {
      return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "download-panel", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "download-panel-message", children: message2 }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          DownloadButton,
          {
            label: buttonLabel,
            fileName,
            fileContents
          }
        )
      ] }) });
    };
    const jsonTab = "_jsonTab_6pq03_1";
    const styles$12 = {
      jsonTab
    };
    const kJsonMaxSize = 1e7;
    const useJsonTabConfig = (evalVersion, evalStatus, evalSpec, evalPlan, evalError, evalResults, evalStats) => {
      const selectedLogFile = useStore((state) => state.logs.selectedLogFile);
      const selectedTab = useStore((state) => state.app.tabs.workspace);
      return reactExports.useMemo(() => {
        const evalHeader = {
          version: evalVersion,
          status: evalStatus,
          eval: evalSpec,
          plan: evalPlan,
          error: evalError,
          results: evalResults,
          stats: evalStats
        };
        return {
          id: kLogViewJsonTabId,
          label: "JSON",
          scrollable: true,
          component: JsonTab,
          componentProps: {
            logFile: selectedLogFile,
            json: JSON.stringify(evalHeader, null, 2),
            selected: selectedTab === kLogViewJsonTabId
          },
          tools: () => [
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              ToolButton,
              {
                label: "Copy JSON",
                icon: ApplicationIcons.copy,
                className: clsx("task-btn-json-copy", "clipboard-button"),
                "data-clipboard-target": "#task-json-contents",
                onClick: copyFeedback
              },
              "copy-json"
            )
          ]
        };
      }, [
        selectedLogFile,
        evalVersion,
        evalStatus,
        evalSpec,
        evalPlan,
        evalError,
        evalResults,
        evalStats,
        selectedTab
      ]);
    };
    const copyFeedback = (e) => {
      const textEl = e.currentTarget.querySelector(".task-btn-copy-content");
      const iconEl = e.currentTarget.querySelector("i.bi");
      if (textEl) {
        const htmlEl = textEl;
        const htmlIconEl = iconEl;
        const oldText = htmlEl.innerText;
        const oldIconClz = htmlIconEl.className;
        htmlEl.innerText = "Copied!";
        htmlIconEl.className = `${ApplicationIcons.confirm}`;
        setTimeout(() => {
          window.getSelection()?.removeAllRanges();
        }, 50);
        setTimeout(() => {
          htmlEl.innerText = oldText;
          htmlIconEl.className = oldIconClz;
        }, 1250);
      }
    };
    const JsonTab = ({ logFile, json }) => {
      const downloadFiles = useStore((state) => state.capabilities.downloadFiles);
      if (logFile && json.length > kJsonMaxSize && downloadFiles) {
        const file = `${filename(logFile)}.json`;
        return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$12.jsonTab, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
          DownloadPanel,
          {
            message: "The JSON for this log file is too large to render.",
            buttonLabel: "Download JSON File",
            fileName: file,
            fileContents: json
          }
        ) });
      } else {
        return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$12.jsonTab, children: /* @__PURE__ */ jsxRuntimeExports.jsx(JSONPanel, { id: "task-json-contents", json, simple: true }) });
      }
    };
    const container$g = "_container_4wzpj_1";
    const modelInfo = "_modelInfo_4wzpj_8";
    const role = "_role_4wzpj_15";
    const sep = "_sep_4wzpj_19";
    const styles$11 = {
      container: container$g,
      modelInfo,
      role,
      sep
    };
    const ModelCard = ({ evalSpec }) => {
      if (!evalSpec) {
        return void 0;
      }
      const modelsInfo = {
        eval: {
          model: evalSpec.model,
          base_url: evalSpec.model_base_url,
          config: evalSpec.model_generate_config,
          args: evalSpec.model_args
        },
        ...evalSpec.model_roles
      };
      const noneEl = /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-style-secondary", children: "None" });
      return /* @__PURE__ */ jsxRuntimeExports.jsxs(Card, { children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(CardHeader, { label: "Models" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(CardBody, { id: "task-model-card-body", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$11.container, children: Object.keys(modelsInfo || {}).map((modelKey) => {
          const modelInfo2 = modelsInfo[modelKey];
          return /* @__PURE__ */ jsxRuntimeExports.jsxs(
            "div",
            {
              className: clsx(styles$11.modelInfo, "text-size-small"),
              children: [
                /* @__PURE__ */ jsxRuntimeExports.jsx(
                  "div",
                  {
                    className: clsx(
                      styles$11.role,
                      "text-style-label",
                      "text-style-secondary"
                    ),
                    children: modelKey
                  }
                ),
                /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$11.sep) }),
                /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx("text-style-label"), children: "Model" }),
                /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: modelInfo2.model }),
                /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$11.sep) }),
                /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx("text-style-label"), children: "Base Url" }),
                /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-size-small", children: modelInfo2.base_url || noneEl }),
                /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$11.sep) }),
                /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx("text-style-label"), children: "Configuration" }),
                /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-size-small", children: modelInfo2.config && Object.keys(modelInfo2.config).length > 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx(
                  MetaDataGrid,
                  {
                    entries: modelInfo2.config
                  }
                ) : noneEl }),
                /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$11.sep) }),
                /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx("text-style-label"), children: "Args" }),
                /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-size-small", children: Object.keys(modelInfo2.args).length > 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx(
                  MetaDataGrid,
                  {
                    entries: modelInfo2.args
                  }
                ) : noneEl }),
                /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$11.sep) })
              ]
            },
            modelKey
          );
        }) }) })
      ] });
    };
    const wrapper$3 = "_wrapper_sq96g_1";
    const col2$2 = "_col2_sq96g_8";
    const col1_3$1 = "_col1_3_sq96g_12";
    const col3$1 = "_col3_sq96g_16";
    const separator$4 = "_separator_sq96g_20";
    const padded$1 = "_padded_sq96g_26";
    const styles$10 = {
      wrapper: wrapper$3,
      col2: col2$2,
      col1_3: col1_3$1,
      col3: col3$1,
      separator: separator$4,
      padded: padded$1
    };
    const ModelUsagePanel = ({ usage, className: className2 }) => {
      if (!usage) {
        return null;
      }
      const rows = [];
      if (usage.reasoning_tokens) {
        rows.push({
          label: "Reasoning",
          value: usage.reasoning_tokens,
          secondary: false,
          bordered: true
        });
        rows.push({
          label: "---",
          value: void 0,
          secondary: false,
          padded: true
        });
      }
      rows.push({
        label: "input",
        value: usage.input_tokens,
        secondary: false
      });
      if (usage.input_tokens_cache_read) {
        rows.push({
          label: "cache_read",
          value: usage.input_tokens_cache_read,
          secondary: true
        });
      }
      if (usage.input_tokens_cache_write) {
        rows.push({
          label: "cache_write",
          value: usage.input_tokens_cache_write,
          secondary: true
        });
      }
      rows.push({
        label: "Output",
        value: usage.output_tokens,
        secondary: false,
        bordered: true
      });
      rows.push({
        label: "---",
        value: void 0,
        secondary: false
      });
      rows.push({
        label: "Total",
        value: usage.total_tokens,
        secondary: false
      });
      return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx("text-size-small", styles$10.wrapper, className2), children: rows.map((row2, idx) => {
        if (row2.label === "---") {
          return /* @__PURE__ */ jsxRuntimeExports.jsx(
            "div",
            {
              className: clsx(
                styles$10.separator,
                row2.padded ? styles$10.padded : void 0
              )
            },
            `$usage-sep-${idx}`
          );
        } else {
          return /* @__PURE__ */ jsxRuntimeExports.jsxs(reactExports.Fragment, { children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              "div",
              {
                className: clsx(
                  "text-style-label",
                  "text-style-secondary",
                  row2.secondary ? styles$10.col2 : styles$10.col1_3
                ),
                children: row2.label
              }
            ),
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$10.col3, children: row2.value ? formatNumber(row2.value) : "" })
          ] }, `$usage-row-${idx}`);
        }
      }) });
    };
    const table$1 = "_table_z217i_1";
    const tableTokens = "_tableTokens_z217i_5";
    const tableH = "_tableH_z217i_9";
    const model = "_model_z217i_14";
    const cellContents = "_cellContents_z217i_18";
    const styles$$ = {
      table: table$1,
      tableTokens,
      tableH,
      model,
      cellContents
    };
    const TokenTable$1 = ({ className: className2, children: children2 }) => {
      return /* @__PURE__ */ jsxRuntimeExports.jsx(
        "table",
        {
          className: clsx(
            "table",
            "table-sm",
            "text-size-smaller",
            styles$$.table,
            className2
          ),
          children: children2
        }
      );
    };
    const TokenHeader = () => {
      return /* @__PURE__ */ jsxRuntimeExports.jsxs("thead", { children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("tr", { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("td", {}),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "td",
            {
              colSpan: 3,
              className: clsx(
                "card-subheading",
                styles$$.tableTokens,
                "text-size-small",
                "text-style-label",
                "text-style-secondary"
              ),
              align: "center",
              children: "Tokens"
            }
          )
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("tr", { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "th",
            {
              className: clsx(
                styles$$.tableH,
                "text-sixe-small",
                "text-style-label",
                "text-style-secondary"
              ),
              children: "Model"
            }
          ),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "th",
            {
              className: clsx(
                styles$$.tableH,
                "text-sixe-small",
                "text-style-label",
                "text-style-secondary"
              ),
              children: "Usage"
            }
          )
        ] })
      ] });
    };
    const TokenRow = ({ model: model2, usage }) => {
      return /* @__PURE__ */ jsxRuntimeExports.jsxs("tr", { children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("td", { children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$$.model, styles$$.cellContents), children: model2 }) }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("td", { children: /* @__PURE__ */ jsxRuntimeExports.jsx(ModelUsagePanel, { usage, className: clsx(styles$$.cellContents) }) })
      ] });
    };
    const ModelTokenTable = ({
      model_usage,
      className: className2
    }) => {
      return /* @__PURE__ */ jsxRuntimeExports.jsxs(TokenTable$1, { className: className2, children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(TokenHeader, {}),
        /* @__PURE__ */ jsxRuntimeExports.jsx("tbody", { children: Object.keys(model_usage).map((key2) => {
          return /* @__PURE__ */ jsxRuntimeExports.jsx(TokenRow, { model: key2, usage: model_usage[key2] }, key2);
        }) })
      ] });
    };
    const wrapper$2 = "_wrapper_14r3b_1";
    const col2$1 = "_col2_14r3b_16";
    const styles$_ = {
      wrapper: wrapper$2,
      col2: col2$1
    };
    const kUsageCardBodyId = "usage-card-body";
    const UsageCard = ({ stats }) => {
      if (!stats) {
        return null;
      }
      return /* @__PURE__ */ jsxRuntimeExports.jsxs(Card, { children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(CardHeader, { label: "Usage" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(CardBody, { id: kUsageCardBodyId, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$_.wrapper, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$_.col2, children: /* @__PURE__ */ jsxRuntimeExports.jsx(ModelTokenTable, { model_usage: stats.model_usage }) }) }) })
      ] });
    };
    const useModelsTab = (evalSpec, evalStats, evalStatus) => {
      return reactExports.useMemo(() => {
        return {
          id: kLogViewModelsTabId,
          label: "Models",
          scrollable: true,
          component: ModelTab,
          componentProps: {
            evalSpec,
            evalStats,
            evalStatus
          }
        };
      }, [evalSpec, evalStats, evalStatus]);
    };
    const ModelTab = ({
      evalSpec,
      evalStats,
      evalStatus
    }) => {
      return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { width: "100%" }, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: { padding: "0.5em 1em 0 1em", width: "100%" }, children: [
        evalSpec ? /* @__PURE__ */ jsxRuntimeExports.jsx(ModelCard, { evalSpec }) : void 0,
        evalStatus !== "started" && evalStats?.model_usage && Object.keys(evalStats.model_usage).length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(UsageCard, { stats: evalStats })
      ] }) });
    };
    const dropdownContainer = "_dropdownContainer_h3ljc_1";
    const toolButton = "_toolButton_h3ljc_6";
    const chevron = "_chevron_h3ljc_10";
    const backdrop$1 = "_backdrop_h3ljc_24";
    const dropdownMenu = "_dropdownMenu_h3ljc_33";
    const dropdownItem = "_dropdownItem_h3ljc_47";
    const styles$Z = {
      dropdownContainer,
      toolButton,
      chevron,
      backdrop: backdrop$1,
      dropdownMenu,
      dropdownItem
    };
    const ToolDropdownButton = reactExports.forwardRef(({ label: label2, icon: icon2, className: className2, items, ...rest }, ref) => {
      const [isOpen, setIsOpen] = reactExports.useState(false);
      const handleItemClick = (fn2) => {
        fn2();
        setIsOpen(false);
      };
      return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$Z.dropdownContainer, children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs(
          "button",
          {
            ref,
            type: "button",
            className: clsx("btn", "btn-tools", styles$Z.toolButton, className2),
            onClick: () => setIsOpen(!isOpen),
            ...rest,
            children: [
              icon2 && /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: `${icon2}` }),
              label2,
              /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: clsx("bi-chevron-down", styles$Z.chevron) })
            ]
          }
        ),
        isOpen && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$Z.backdrop, onClick: () => setIsOpen(false) }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$Z.dropdownMenu, children: Object.entries(items).map(([itemLabel, fn2]) => /* @__PURE__ */ jsxRuntimeExports.jsx(
            "button",
            {
              type: "button",
              className: styles$Z.dropdownItem,
              onClick: () => handleItemClick(fn2),
              children: itemLabel
            },
            itemLabel
          )) })
        ] })
      ] });
    });
    ToolDropdownButton.displayName = "ToolDropdownButton";
    const panel$5 = "_panel_twp3v_1";
    const container$f = "_container_twp3v_7";
    const styles$Y = {
      panel: panel$5,
      container: container$f
    };
    const NoContentsPanel = ({ text: text2 }) => {
      return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$Y.panel), children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$Y.container, "text-size-smaller"), children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: ApplicationIcons.noSamples }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: text2 })
      ] }) });
    };
    const printHtml = (html2, css2) => {
      const printWindow = window.open("", "", "height=600,width=800");
      if (printWindow !== null) {
        printWindow.document.write("<html><head><title>Print</title>");
        printWindow.document.write(`
          <link rel="stylesheet" crossorigin="" href="./assets/index.css">
          <style>
            @media print {
              ${css2}
            }
          </style>
        `);
        printWindow.document.write("</head><body>");
        printWindow.document.write(html2);
        printWindow.document.write("</body></html>");
        printWindow.document.close();
        printWindow.onload = function() {
          printWindow.focus();
          printWindow.print();
          printWindow.close();
        };
      } else {
        console.error("Print window failed to open.");
      }
    };
    const printHeadingHtml = () => {
      const taskEl = document.getElementById("task-title");
      const modelEl = document.getElementById("task-model");
      const timeEl = document.getElementById("task-created");
      if (!taskEl || !modelEl || !timeEl) {
        throw new Error(
          "Failed to compute heading HTML. The task, model, or time element can't be found."
        );
      }
      const task = taskEl.innerText;
      const model2 = modelEl.innerText;
      const time = timeEl.innerText;
      const headingHtml = `
<div style="display: grid; grid-template-columns: repeat(3, 1fr); column-gap: 0.5em; margin-bottom: 2em; justify-content: space-between; border-bottom: solid 1px silver;">
<div style="font-weight: 600">${task}</div>
<div style="text-align: center;">${model2}</div>
<div style="text-align: right;">${time}</div>
</div>`;
      return headingHtml;
    };
    const useSampleNavigation = () => {
      const navigate = useNavigate();
      const logDirectory = useStore((state) => state.logs.logDir);
      const { logPath, tabId, sampleTabId } = useLogRouteParams();
      const selectedLogFile = useStore((state) => state.logs.selectedLogFile);
      const resolveLogPath = reactExports.useCallback(() => {
        if (logPath) {
          return logPath;
        }
        if (selectedLogFile) {
          return directoryRelativeUrl(selectedLogFile, logDirectory);
        }
        return void 0;
      }, [logPath, selectedLogFile, logDirectory]);
      const sampleSummaries = useFilteredSamples();
      const selectedSampleHandle = useStore(
        (state) => state.log.selectedSampleHandle
      );
      const selectedSampleIndex = reactExports.useMemo(() => {
        return sampleSummaries.findIndex((summary2) => {
          return sampleIdsEqual(summary2.id, selectedSampleHandle?.id) && summary2.epoch === selectedSampleHandle?.epoch;
        });
      }, [selectedSampleHandle, sampleSummaries]);
      const selectSample = useStore((state) => state.logActions.selectSample);
      const setShowingSampleDialog = useStore(
        (state) => state.appActions.setShowingSampleDialog
      );
      const showingSampleDialog = useStore((state) => state.app.dialogs.sample);
      const showSample = reactExports.useCallback(
        (id, epoch, specifiedSampleTabId) => {
          const resolvedPath = resolveLogPath();
          if (resolvedPath) {
            selectSample(id, epoch);
            setShowingSampleDialog(true);
            const currentSampleTabId = specifiedSampleTabId || sampleTabId;
            const url = logSamplesUrl(resolvedPath, id, epoch, currentSampleTabId);
            navigate(url);
          }
        },
        [
          resolveLogPath,
          selectSample,
          setShowingSampleDialog,
          navigate,
          sampleTabId
        ]
      );
      const navigateSampleIndex = reactExports.useCallback(
        (index) => {
          if (index > -1 && index < sampleSummaries.length) {
            if (showingSampleDialog) {
              const resolvedPath = resolveLogPath();
              if (resolvedPath) {
                const summary2 = sampleSummaries[index];
                const url = logSamplesUrl(
                  resolvedPath,
                  summary2.id,
                  summary2.epoch,
                  sampleTabId
                );
                navigate(url);
              }
            } else {
              const summary2 = sampleSummaries[index];
              selectSample(summary2.id, summary2.epoch);
            }
          }
        },
        [
          sampleSummaries,
          showingSampleDialog,
          resolveLogPath,
          sampleTabId,
          navigate,
          selectSample
        ]
      );
      const nextSample = reactExports.useCallback(() => {
        const itemsCount = sampleSummaries.length;
        const next = Math.min(selectedSampleIndex + 1, itemsCount - 1);
        navigateSampleIndex(next);
      }, [selectedSampleIndex, navigateSampleIndex, sampleSummaries]);
      const previousSample = reactExports.useCallback(() => {
        const prev = selectedSampleIndex - 1;
        navigateSampleIndex(prev);
      }, [selectedSampleIndex, navigateSampleIndex]);
      const firstSample = reactExports.useCallback(() => {
        navigateSampleIndex(0);
      }, [navigateSampleIndex]);
      const lastSample = reactExports.useCallback(() => {
        navigateSampleIndex(sampleSummaries.length - 1);
      }, [navigateSampleIndex, sampleSummaries]);
      const getSampleUrl = reactExports.useCallback(
        (sampleId, epoch, specificSampleTabId) => {
          const resolvedPath = resolveLogPath();
          if (resolvedPath) {
            const currentSampleTabId = specificSampleTabId || sampleTabId;
            const url = logSamplesUrl(
              resolvedPath,
              sampleId,
              epoch,
              currentSampleTabId
            );
            return `#${url}`;
          }
          return void 0;
        },
        [resolveLogPath, sampleTabId]
      );
      const clearSampleUrl = reactExports.useCallback(() => {
        const resolvedPath = resolveLogPath();
        if (resolvedPath) {
          const url = logsUrlRaw(resolvedPath, tabId);
          navigate(url);
        }
      }, [resolveLogPath, navigate, tabId]);
      return {
        showSample,
        nextEnabled: selectedSampleIndex < sampleSummaries.length - 1,
        nextSample,
        previousEnabled: selectedSampleIndex > 0,
        previousSample,
        firstSample,
        lastSample,
        getSampleUrl,
        clearSampleUrl
      };
    };
    const useSampleDetailNavigation = () => {
      const [searchParams, _setSearchParams] = useSearchParams();
      const message2 = searchParams.get("message");
      const event = searchParams.get("event");
      return {
        message: message2,
        event
      };
    };
    const useSamplesGridNavigation = () => {
      const navigate = useNavigate();
      const logDirectory = useStore((state) => state.logs.logDir);
      const navigateToSampleDetail = reactExports.useCallback(
        (logFile, sampleId, epoch, openInNewWindow = false) => {
          const relativePath = directoryRelativeUrl(logFile, logDirectory);
          const url = samplesSampleUrl(relativePath, sampleId, epoch);
          if (openInNewWindow) {
            window.open(`#${url}`, "_blank");
          } else {
            navigate(url);
          }
        },
        [navigate, logDirectory]
      );
      return {
        navigateToSampleDetail
      };
    };
    const messagesToStr = (messages2, options2) => {
      const opts = {};
      return messages2.map((msg) => messageToStr(msg, opts)).filter((str2) => str2 !== null).join("\n");
    };
    const messageToStr = (message2, options2) => {
      if (options2.excludeSystem && message2.role === "system") {
        return null;
      }
      const content2 = betterContentText(
        message2.content,
        options2.excludeToolUsage || false,
        options2.excludeReasoning || false
      );
      if (!options2.excludeToolUsage && message2.role === "assistant" && message2.tool_calls) {
        const assistantMsg = message2;
        let entry = `${message2.role.toUpperCase()}:
${content2}
`;
        if (assistantMsg.tool_calls) {
          for (const tool2 of assistantMsg.tool_calls) {
            const funcName = tool2.function;
            const args2 = tool2.arguments;
            if (typeof args2 === "object" && args2 !== null) {
              const argsText = Object.entries(args2).map(([k2, v]) => `${k2}: ${v}`).join("\n");
              entry += `
Tool Call: ${funcName}
Arguments:
${argsText}
`;
            } else {
              entry += `
Tool Call: ${funcName}
Arguments: ${args2}
`;
            }
          }
        }
        return entry;
      }
      if (message2.role === "tool") {
        if (options2.excludeToolUsage) {
          return null;
        }
        const toolMsg = message2;
        const funcName = toolMsg.function || "unknown";
        const errorPart = toolMsg.error ? `

Error in tool call '${funcName}':
${toolMsg.error.message}
` : "";
        return `${message2.role.toUpperCase()}:
${content2}${errorPart}
`;
      }
      return `${message2.role.toUpperCase()}:
${content2}
`;
    };
    const textFromContent = (content2, excludeToolUsage, excludeReasoning) => {
      switch (content2.type) {
        case "text":
          return content2.text;
        case "reasoning": {
          const reasoningContent = content2;
          if (excludeReasoning) {
            return null;
          }
          const reasoning2 = reasoningContent.redacted ? reasoningContent.summary : reasoningContent.reasoning;
          if (!reasoning2) {
            return null;
          }
          return `
<think>${reasoning2}</think>`;
        }
        case "tool_use": {
          if (excludeToolUsage) {
            return null;
          }
          const toolUse = content2;
          const errorStr = toolUse.error ? ` ${toolUse.error}` : "";
          return `
Tool Use: ${toolUse.name}(${toolUse.arguments}) -> ${toolUse.result}${errorStr}`;
        }
        case "image":
        case "audio":
        case "video":
        case "data":
        case "document":
          return `<${content2.type} />`;
        default:
          return null;
      }
    };
    const betterContentText = (content2, excludeToolUsage, excludeReasoning) => {
      if (typeof content2 === "string") {
        return content2;
      }
      const allText = content2.map((c2) => textFromContent(c2, excludeToolUsage, excludeReasoning)).filter((text2) => text2 !== null);
      return allText.join("\n");
    };
    const container$e = "_container_4p85e_2";
    const dotsContainer = "_dotsContainer_4p85e_8";
    const small = "_small_4p85e_15";
    const medium = "_medium_4p85e_19";
    const large = "_large_4p85e_24";
    const dot = "_dot_4p85e_8";
    const subtle = "_subtle_4p85e_36";
    const primary = "_primary_4p85e_40";
    const visuallyHidden = "_visuallyHidden_4p85e_59";
    const styles$X = {
      container: container$e,
      dotsContainer,
      small,
      medium,
      large,
      dot,
      subtle,
      primary,
      visuallyHidden
    };
    const PulsingDots = ({
      text: text2 = "Loading...",
      dotsCount = 3,
      subtle: subtle2 = true,
      size = "small",
      className: className2
    }) => {
      return /* @__PURE__ */ jsxRuntimeExports.jsxs(
        "div",
        {
          className: clsx(
            styles$X.container,
            size === "small" ? styles$X.small : size === "medium" ? styles$X.medium : styles$X.large,
            className2
          ),
          role: "status",
          children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$X.dotsContainer, children: [...Array(dotsCount)].map((_, index) => /* @__PURE__ */ jsxRuntimeExports.jsx(
              "div",
              {
                className: clsx(
                  styles$X.dot,
                  subtle2 ? styles$X.subtle : styles$X.primary
                ),
                style: { animationDelay: `${index * 0.2}s` }
              },
              index
            )) }),
            /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: styles$X.visuallyHidden, children: text2 })
          ]
        }
      );
    };
    const progressContainer = "_progressContainer_1cjjr_1";
    const styles$W = {
      progressContainer
    };
    const LiveVirtualList = ({
      id,
      listHandle,
      className: className2,
      data,
      renderRow,
      scrollRef,
      live,
      showProgress,
      initialTopMostItemIndex,
      offsetTop,
      components,
      searchInItem
    }) => {
      const { getRestoreState, isScrolling, visibleRange, setVisibleRange } = useVirtuosoState(listHandle, `live-virtual-list-${id}`);
      const { registerVirtualList } = useExtendedFind();
      const pendingSearchCallback = reactExports.useRef(null);
      const [isCurrentlyScrolling, setIsCurrentlyScrolling] = reactExports.useState(false);
      const [followOutput, setFollowOutput] = useProperty(
        id,
        "follow",
        {
          defaultValue: null
        }
      );
      const isAutoScrollingRef = reactExports.useRef(false);
      reactExports.useEffect(() => {
        if (followOutput === null) {
          setFollowOutput(!!live);
        }
      }, [followOutput, live, setFollowOutput]);
      const prevLive = usePrevious(live);
      reactExports.useEffect(() => {
        if (!live && prevLive && followOutput && scrollRef?.current) {
          setFollowOutput(false);
          setTimeout(() => {
            if (scrollRef.current) {
              scrollRef.current.scrollTo({ top: 0, behavior: "instant" });
            }
          }, 100);
        }
      }, [live, followOutput, prevLive, scrollRef, setFollowOutput]);
      const handleScroll = useRafThrottle(() => {
        if (isAutoScrollingRef.current) return;
        if (!live) return;
        if (scrollRef?.current && listHandle.current) {
          const parent = scrollRef.current;
          const isAtBottom = parent.scrollHeight - parent.scrollTop <= parent.clientHeight + 30;
          if (isAtBottom && !followOutput) {
            setFollowOutput(true);
          } else if (!isAtBottom && followOutput) {
            setFollowOutput(false);
          }
        }
      }, [setFollowOutput, followOutput, live]);
      const heightChanged = reactExports.useCallback(
        (height) => {
          requestAnimationFrame(() => {
            if (followOutput && live && scrollRef?.current) {
              isAutoScrollingRef.current = true;
              listHandle.current?.scrollTo({ top: height });
              requestAnimationFrame(() => {
                isAutoScrollingRef.current = false;
              });
            }
          });
        },
        [followOutput, live, scrollRef, listHandle]
      );
      const forceUpdate = reactExports.useCallback(() => forceRender({}), []);
      reactExports.useEffect(() => {
        const timer = setTimeout(() => {
          forceUpdate();
        }, 0);
        return () => clearTimeout(timer);
      }, [forceUpdate]);
      const [, forceRender] = reactExports.useState({});
      const defaultSearchInItem = reactExports.useCallback(
        (item2, searchTerm) => {
          const searchLower = searchTerm.toLowerCase();
          try {
            const itemString = JSON.stringify(item2).toLowerCase();
            return itemString.includes(searchLower);
          } catch {
            return false;
          }
        },
        []
      );
      const searchInData = reactExports.useCallback(
        async (term, direction, onContentReady) => {
          if (!data.length || !term) return false;
          const searchFn = searchInItem || defaultSearchInItem;
          const currentIndex = direction === "forward" ? visibleRange.endIndex : visibleRange.startIndex;
          const searchStart = direction === "forward" ? Math.max(0, currentIndex + 1) : Math.min(data.length - 1, currentIndex - 1);
          const step = direction === "forward" ? 1 : -1;
          for (let i2 = searchStart; i2 >= 0 && i2 < data.length; i2 += step) {
            if (searchFn(data[i2], term)) {
              pendingSearchCallback.current = onContentReady;
              listHandle.current?.scrollToIndex({
                index: i2,
                behavior: "auto",
                align: "center"
              });
              setTimeout(() => {
                if (pendingSearchCallback.current === onContentReady) {
                  pendingSearchCallback.current = null;
                  onContentReady();
                }
              }, 200);
              return true;
            }
          }
          return false;
        },
        [
          data,
          searchInItem,
          defaultSearchInItem,
          visibleRange.endIndex,
          visibleRange.startIndex,
          listHandle
        ]
      );
      reactExports.useEffect(() => {
        const unregister = registerVirtualList(id, searchInData);
        return unregister;
      }, [id, registerVirtualList, searchInData]);
      const Footer = () => {
        return showProgress ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$W.progressContainer), children: /* @__PURE__ */ jsxRuntimeExports.jsx(PulsingDots, { subtle: false, size: "medium" }) }) : void 0;
      };
      reactExports.useEffect(() => {
        const parent = scrollRef?.current;
        if (parent) {
          parent.addEventListener("scroll", handleScroll);
          return () => parent.removeEventListener("scroll", handleScroll);
        }
      }, [scrollRef, handleScroll]);
      const hasScrolled = reactExports.useRef(false);
      reactExports.useEffect(() => {
        if (initialTopMostItemIndex !== void 0 && listHandle.current) {
          const timer = setTimeout(() => {
            listHandle.current?.scrollToIndex({
              index: initialTopMostItemIndex,
              align: "start",
              behavior: !hasScrolled.current ? "auto" : "smooth",
              offset: offsetTop ? -offsetTop : void 0
            });
            hasScrolled.current = true;
          }, 50);
          return () => clearTimeout(timer);
        }
      }, [initialTopMostItemIndex, listHandle, offsetTop]);
      reactExports.useEffect(() => {
        if (!isCurrentlyScrolling && pendingSearchCallback.current) {
          setTimeout(() => {
            const callback = pendingSearchCallback.current;
            pendingSearchCallback.current = null;
            callback?.();
          }, 100);
        }
      }, [isCurrentlyScrolling]);
      const handleScrollingChange = reactExports.useCallback(
        (scrolling) => {
          setIsCurrentlyScrolling(scrolling);
          isScrolling(scrolling);
        },
        [isScrolling]
      );
      return /* @__PURE__ */ jsxRuntimeExports.jsx(
        Yr,
        {
          ref: listHandle,
          customScrollParent: scrollRef?.current ? scrollRef.current : void 0,
          style: { height: "100%", width: "100%" },
          data,
          defaultItemHeight: 500,
          itemContent: renderRow,
          increaseViewportBy: { top: 1e3, bottom: 1e3 },
          overscan: { main: 5, reverse: 5 },
          className: clsx("transcript", className2),
          isScrolling: handleScrollingChange,
          rangeChanged: (range2) => {
            setVisibleRange(range2);
          },
          restoreStateFrom: getRestoreState(),
          totalListHeightChanged: heightChanged,
          components: {
            Footer,
            ...components
          }
        }
      );
    };
    const styles$V = {};
    const ChatViewVirtualList = reactExports.memo(
      ({
        id,
        messages: messages2,
        initialMessageId,
        topOffset,
        className: className2,
        toolCallStyle,
        indented: indented2,
        numbered = true,
        scrollRef,
        running,
        allowLinking = true
      }) => {
        const useVirtuoso = running || messages2.length > 200;
        const listHandle = reactExports.useRef(null);
        const setNativeFind = useStore((state) => state.appActions.setNativeFind);
        reactExports.useEffect(() => {
          setNativeFind(!useVirtuoso);
        }, [setNativeFind, useVirtuoso]);
        reactExports.useEffect(() => {
          const handleKeyDown = (event) => {
            if (event.metaKey || event.ctrlKey) {
              if (event.key === "ArrowUp") {
                if (useVirtuoso) {
                  listHandle.current?.scrollToIndex({ index: 0, align: "center" });
                } else {
                  scrollRef?.current?.scrollTo({ top: 0, behavior: "instant" });
                }
                event.preventDefault();
              } else if (event.key === "ArrowDown") {
                if (useVirtuoso) {
                  listHandle.current?.scrollToIndex({
                    index: Math.min(messages2.length - 5, 0),
                    align: "center"
                  });
                  setTimeout(() => {
                    listHandle.current?.scrollToIndex({
                      index: messages2.length - 1,
                      align: "end"
                    });
                  }, 250);
                } else {
                  scrollRef?.current?.scrollTo({
                    top: scrollRef.current.scrollHeight,
                    behavior: "instant"
                  });
                }
                event.preventDefault();
              }
            }
          };
          const scrollElement = scrollRef?.current;
          if (scrollElement) {
            scrollElement.addEventListener("keydown", handleKeyDown);
            if (!scrollElement.hasAttribute("tabIndex")) {
              scrollElement.setAttribute("tabIndex", "0");
            }
            return () => {
              scrollElement.removeEventListener("keydown", handleKeyDown);
            };
          }
        }, [scrollRef, messages2, useVirtuoso]);
        if (!useVirtuoso) {
          return /* @__PURE__ */ jsxRuntimeExports.jsx(
            ChatView,
            {
              id,
              messages: messages2,
              allowLinking,
              indented: indented2,
              numbered,
              toolCallStyle,
              className: className2
            }
          );
        } else {
          return /* @__PURE__ */ jsxRuntimeExports.jsx(
            ChatViewVirtualListComponent,
            {
              id,
              listHandle,
              className: className2,
              scrollRef,
              messages: messages2,
              initialMessageId,
              topOffset,
              toolCallStyle,
              indented: indented2,
              numbered,
              running,
              allowLinking
            }
          );
        }
      }
    );
    const ChatViewVirtualListComponent = reactExports.memo(
      ({
        id,
        listHandle,
        messages: messages2,
        initialMessageId,
        topOffset,
        className: className2,
        toolCallStyle,
        indented: indented2,
        numbered = true,
        scrollRef,
        running,
        allowLinking = true
      }) => {
        const collapsedMessages = reactExports.useMemo(() => {
          return resolveMessages(messages2);
        }, [messages2]);
        const initialMessageIndex = reactExports.useMemo(() => {
          if (initialMessageId === null || initialMessageId === void 0) {
            return void 0;
          }
          const index = collapsedMessages.findIndex((message2) => {
            const messageId = message2.message.id === initialMessageId;
            if (messageId) {
              return true;
            }
            if (message2.toolMessages.find((tm) => tm.id === initialMessageId)) {
              return true;
            }
          });
          return index !== -1 ? index : void 0;
        }, [initialMessageId, collapsedMessages]);
        const renderRow = reactExports.useCallback(
          (index, item2) => {
            const number2 = collapsedMessages.length > 1 && numbered ? index + 1 : void 0;
            return /* @__PURE__ */ jsxRuntimeExports.jsx(
              ChatMessageRow,
              {
                parentName: id || "chat-virtual-list",
                number: number2,
                resolvedMessage: item2,
                indented: indented2,
                toolCallStyle,
                highlightUserMessage: true,
                allowLinking
              }
            );
          },
          [
            collapsedMessages.length,
            numbered,
            id,
            indented2,
            toolCallStyle,
            allowLinking
          ]
        );
        const Item = ({
          children: children2,
          ...props
        }) => {
          return /* @__PURE__ */ jsxRuntimeExports.jsx(
            "div",
            {
              className: clsx(styles$V.item),
              "data-index": props["data-index"],
              "data-item-group-index": props["data-item-group-index"],
              "data-item-index": props["data-item-index"],
              "data-known-size": props["data-known-size"],
              style: props.style,
              children: children2
            }
          );
        };
        return /* @__PURE__ */ jsxRuntimeExports.jsx(
          LiveVirtualList,
          {
            id: "chat-virtual-list",
            listHandle,
            className: className2,
            scrollRef,
            data: collapsedMessages,
            renderRow,
            initialTopMostItemIndex: initialMessageIndex,
            offsetTop: topOffset,
            live: running,
            showProgress: running,
            components: { Item }
          }
        );
      }
    );
    const tabPanel = "_tabPanel_6o9gh_1";
    const tabControls = "_tabControls_6o9gh_5";
    const fullWidth$1 = "_fullWidth_6o9gh_12";
    const padded = "_padded_6o9gh_25";
    const error = "_error_6o9gh_30";
    const ansi = "_ansi_6o9gh_34";
    const noTop = "_noTop_6o9gh_38";
    const chat = "_chat_6o9gh_50";
    const transcriptContainer = "_transcriptContainer_6o9gh_58";
    const styles$U = {
      tabPanel,
      tabControls,
      fullWidth: fullWidth$1,
      padded,
      error,
      ansi,
      noTop,
      chat,
      transcriptContainer
    };
    const flatBody = "_flatBody_1uw6w_1";
    const iconSmall$1 = "_iconSmall_1uw6w_9";
    const lineBase = "_lineBase_1uw6w_15";
    const styles$T = {
      flatBody,
      iconSmall: iconSmall$1,
      lineBase
    };
    const FlatSampleError = ({ message: message2 }) => {
      return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$T.flatBody), children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: clsx(ApplicationIcons.error, styles$T.iconSmall) }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$T.lineBase, "text-truncate"), children: errorType(message2) })
      ] });
    };
    const target = "_target_tv989_1";
    const answer = "_answer_tv989_5";
    const grid$6 = "_grid_tv989_9";
    const centerLabel = "_centerLabel_tv989_16";
    const centerValue = "_centerValue_tv989_21";
    const wrap = "_wrap_tv989_26";
    const titled = "_titled_tv989_30";
    const value$1 = "_value_tv989_34";
    const styles$S = {
      target,
      answer,
      grid: grid$6,
      centerLabel,
      centerValue,
      wrap,
      titled,
      value: value$1
    };
    const kMaxRowTextSize$1 = 1024 * 5;
    function isEvalSample(sample2) {
      return "store" in sample2;
    }
    const resolveSample = (sample2, sampleDescriptor) => {
      const input2 = inputString(sample2.input);
      if (isEvalSample(sample2) && sample2.choices && sample2.choices.length > 0) {
        input2.push("");
        input2.push(
          ...sample2.choices.map((choice, index) => {
            return `${String.fromCharCode(65 + index)}) ${choice}`;
          })
        );
      }
      const target2 = sample2.target;
      const answer2 = sample2 && sampleDescriptor ? sampleDescriptor.selectedScorerDescriptor(sample2)?.answer() : void 0;
      const limit = isEvalSample(sample2) ? sample2.limit?.type : void 0;
      const working_time = isEvalSample(sample2) ? sample2.working_time : void 0;
      const total_time = isEvalSample(sample2) ? sample2.total_time : void 0;
      const error2 = isEvalSample(sample2) ? sample2.error?.message : void 0;
      const retries = isEvalSample(sample2) ? sample2.error_retries?.length : sample2.retries;
      return {
        id: sample2.id,
        input: input2,
        target: target2,
        answer: answer2,
        limit,
        retries,
        working_time,
        total_time,
        error: error2
      };
    };
    const SampleSummaryView = ({
      parent_id,
      sample: sample2
    }) => {
      const sampleDescriptor = useSampleDescriptor();
      const selectedScores = useSelectedScores();
      if (!sampleDescriptor) {
        return void 0;
      }
      const fields = resolveSample(sample2, sampleDescriptor);
      const limitSize = sampleDescriptor?.messageShape.normalized.limit > 0 ? Math.max(0.15, sampleDescriptor.messageShape.normalized.limit) : 0;
      const retrySize = sampleDescriptor?.messageShape.normalized.retries > 0 ? 6 : 0;
      const idSize = Math.max(
        2,
        Math.min(10, sampleDescriptor?.messageShape.raw.id)
      );
      const columns = [];
      columns.push({
        label: "Id",
        value: fields.id,
        size: `${idSize}em`
      });
      columns.push({
        label: "Input",
        value: /* @__PURE__ */ jsxRuntimeExports.jsx(
          RenderedText,
          {
            markdown: fields.input.join(" ").slice(0, kMaxRowTextSize$1)
          }
        ),
        size: `minmax(auto, 5fr)`,
        clamp: true
      });
      if (fields.target) {
        columns.push({
          label: "Target",
          value: /* @__PURE__ */ jsxRuntimeExports.jsx(
            RenderedText,
            {
              markdown: arrayToString(fields?.target || "none").slice(
                0,
                kMaxRowTextSize$1
              ),
              className: clsx("no-last-para-padding", styles$S.target)
            }
          ),
          size: `minmax(auto, 3fr)`,
          clamp: true
        });
      }
      if (fields.answer) {
        columns.push({
          label: "Answer",
          value: sample2 ? /* @__PURE__ */ jsxRuntimeExports.jsx(
            RenderedText,
            {
              markdown: (fields.answer || "").slice(0, kMaxRowTextSize$1),
              className: clsx("no-last-para-padding", styles$S.answer)
            }
          ) : "",
          size: `minmax(auto, 5fr)`,
          clamp: true
        });
      }
      const toolTip = (working_time) => {
        if (working_time === void 0 || working_time === null) {
          return void 0;
        }
        return `Working time: ${formatTime$1(working_time)}`;
      };
      if (fields.total_time) {
        columns.push({
          label: "Time",
          value: formatTime$1(fields.total_time),
          size: `fit-content(10rem)`,
          center: true,
          title: toolTip(fields.working_time)
        });
      }
      if (fields?.limit && limitSize > 0) {
        columns.push({
          label: "Limit",
          value: fields.limit,
          size: `fit-content(10rem)`,
          center: true
        });
      }
      if (fields?.retries && retrySize > 0) {
        columns.push({
          label: "Retries",
          value: fields.retries,
          size: `fit-content(${retrySize}rem)`,
          center: true
        });
      }
      if (selectedScores && selectedScores.length > 0) {
        selectedScores.forEach((scoreLabel) => {
          columns.push({
            label: selectedScores.length === 1 ? "Score" : scoreLabel.name,
            value: fields.error ? /* @__PURE__ */ jsxRuntimeExports.jsx(FlatSampleError, { message: fields.error }) : sampleDescriptor?.evalDescriptor.score(sample2, scoreLabel)?.render() || "",
            size: "fit-content(15em)",
            center: true
          });
        });
      } else {
        columns.push({
          label: "Score",
          value: fields.error ? /* @__PURE__ */ jsxRuntimeExports.jsx(FlatSampleError, { message: fields.error }) : "",
          size: "fit-content(15em)",
          center: true
        });
      }
      return /* @__PURE__ */ jsxRuntimeExports.jsxs(
        "div",
        {
          id: `sample-heading-${parent_id}`,
          className: clsx(styles$S.grid, "text-size-base"),
          style: {
            gridTemplateColumns: `${columns.map((col) => {
              return col.size;
            }).join(" ")}`
          },
          children: [
            columns.map((col, idx) => {
              return /* @__PURE__ */ jsxRuntimeExports.jsx(
                "div",
                {
                  className: clsx(
                    "text-style-label",
                    "text-style-secondary",
                    "text-size-smallest",
                    col.title ? styles$S.titled : void 0,
                    col.center ? styles$S.centerLabel : void 0
                  ),
                  title: col.title,
                  "data-unsearchable": true,
                  children: col.label
                },
                `sample-summ-lbl-${idx}`
              );
            }),
            columns.map((col, idx) => {
              return /* @__PURE__ */ jsxRuntimeExports.jsx(
                "div",
                {
                  className: clsx(
                    styles$S.value,
                    styles$S.wrap,
                    col.clamp ? "three-line-clamp" : void 0,
                    col.center ? styles$S.centerValue : void 0
                  ),
                  "data-unsearchable": true,
                  children: col.value
                },
                `sample-summ-val-${idx}`
              );
            })
          ]
        }
      );
    };
    const SampleScores = ({ sample: sample2, scorer: scorer2 }) => {
      const scoreData = sample2.scores?.[scorer2];
      if (!scoreData) {
        return void 0;
      }
      const scorerDescriptor = getScoreDescriptorForValues(
        [scoreData.value],
        [typeof scoreData.value]
      );
      return scorerDescriptor?.render(scoreData.value);
    };
    const container$d = "_container_kwhbh_1";
    const cell$1 = "_cell_kwhbh_9";
    const fullWidth = "_fullWidth_kwhbh_13";
    const separator$3 = "_separator_kwhbh_25";
    const separatorPadded = "_separatorPadded_kwhbh_30";
    const headerSep = "_headerSep_kwhbh_35";
    const styles$R = {
      container: container$d,
      cell: cell$1,
      fullWidth,
      separator: separator$3,
      separatorPadded,
      headerSep
    };
    const SampleScoresGrid = ({
      evalSample,
      className: className2,
      scrollRef
    }) => {
      const evalDescriptor = useEvalDescriptor();
      if (!evalDescriptor) {
        return /* @__PURE__ */ jsxRuntimeExports.jsx(EmptyPanel, { children: "No Sample Selected" });
      }
      return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(className2, styles$R.container), children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          "div",
          {
            className: clsx(
              "text-size-smaller",
              "text-style-label",
              "text-style-secondary"
            ),
            children: "Scorer"
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          "div",
          {
            className: clsx(
              "text-size-smaller",
              "text-style-label",
              "text-style-secondary"
            ),
            children: "Answer"
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          "div",
          {
            className: clsx(
              "text-size-smaller",
              "text-style-label",
              "text-style-secondary"
            ),
            children: "Score"
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          "div",
          {
            className: clsx(
              "text-size-smaller",
              "text-style-label",
              "text-style-secondary"
            ),
            children: "Explanation"
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          "div",
          {
            className: clsx(styles$R.separator, styles$R.fullWidth, styles$R.headerSep)
          }
        ),
        Object.keys(evalSample.scores || {}).map((scorer2) => {
          if (!evalSample.scores) {
            return void 0;
          }
          const scoreData = evalSample.scores[scorer2];
          const explanation2 = scoreData.explanation || "(No Explanation)";
          const answer2 = scoreData.answer;
          let metadata2 = scoreData.metadata || {};
          return /* @__PURE__ */ jsxRuntimeExports.jsxs(reactExports.Fragment, { children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx("text-size-base", styles$R.cell), children: scorer2 }),
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$R.cell, "text-size-base"), children: answer2 }),
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$R.cell, "text-size-base"), children: /* @__PURE__ */ jsxRuntimeExports.jsx(
              SampleScores,
              {
                sample: evalSample,
                scorer: scorer2
              }
            ) }),
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx("text-size-base", styles$R.cell), children: /* @__PURE__ */ jsxRuntimeExports.jsx(
              RenderedContent,
              {
                id: `${scorer2}-explanation`,
                entry: {
                  name: "Explanation",
                  value: explanation2
                }
              }
            ) }),
            Object.keys(metadata2).length > 0 ? /* @__PURE__ */ jsxRuntimeExports.jsxs(reactExports.Fragment, { children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx(
                "div",
                {
                  className: clsx(
                    "text-size-smaller",
                    "text-style-label",
                    "text-style-secondary",
                    styles$R.fullWidth
                  ),
                  children: "Metadata"
                }
              ),
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$R.fullWidth), children: /* @__PURE__ */ jsxRuntimeExports.jsx(
                RecordTree,
                {
                  id: `${scorer2}-metadataa`,
                  scrollRef,
                  record: metadata2,
                  defaultExpandLevel: 0
                }
              ) }),
              /* @__PURE__ */ jsxRuntimeExports.jsx(
                "div",
                {
                  className: clsx(
                    styles$R.separator,
                    styles$R.separatorPadded,
                    styles$R.fullWidth
                  )
                }
              )
            ] }, `${scorer2}-metadata`) : void 0
          ] }, `${scorer2}-row`);
        })
      ] });
    };
    const wordBreak = "_wordBreak_las07_9";
    const scoreCard = "_scoreCard_las07_50";
    const scores = "_scores_las07_54";
    const styles$Q = {
      wordBreak,
      scoreCard,
      scores
    };
    const SampleScoresView = ({
      sample: sample2,
      className: className2,
      scrollRef
    }) => {
      const evalDescriptor = useEvalDescriptor();
      if (!evalDescriptor) {
        return void 0;
      }
      if (!sample2) {
        return void 0;
      }
      const scoreInput = inputString(sample2.input);
      if (sample2.choices && sample2.choices.length > 0) {
        scoreInput.push("");
        scoreInput.push(
          ...sample2.choices.map((choice, index) => {
            return `${String.fromCharCode(65 + index)}) ${choice}`;
          })
        );
      }
      return /* @__PURE__ */ jsxRuntimeExports.jsx(
        "div",
        {
          className: clsx(
            "container-fluid",
            className2,
            "font-size-base",
            styles$Q.container
          ),
          children: /* @__PURE__ */ jsxRuntimeExports.jsx(Card, { className: clsx(styles$Q.scoreCard), children: /* @__PURE__ */ jsxRuntimeExports.jsxs(CardBody, { children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              "div",
              {
                className: clsx(
                  "text-size-small",
                  "text-style-label",
                  "text-style-secondary"
                ),
                children: "Input"
              }
            ),
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              ExpandablePanel,
              {
                lines: 10,
                id: `sample-score-${sample2.id}-${sample2.epoch}`,
                collapse: true,
                children: /* @__PURE__ */ jsxRuntimeExports.jsx(
                  RenderedText,
                  {
                    markdown: scoreInput.join("\n"),
                    className: clsx(styles$Q.wordBreak, "text-size-base")
                  }
                )
              }
            ),
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              SampleScoresGrid,
              {
                evalSample: sample2,
                className: clsx(styles$Q.scores),
                scrollRef
              }
            )
          ] }) })
        }
      );
    };
    const eventTypes = {
      sample_init: "Sample Init",
      sample_limit: "Sample Limit",
      sandbox: "Sandbox",
      state: "State",
      store: "Store",
      model: "Model",
      tool: "Tool",
      approval: "Approval",
      input: "Input",
      score: "Score",
      score_edit: "Score Edit",
      error: "Error",
      logger: "Logger",
      info: "Info",
      subtask: "Subtask"
    };
    const useTranscriptFilter = () => {
      const filtered = useStore((state) => state.sample.eventFilter.filteredTypes);
      const setFilteredEventTypes = useStore(
        (state) => state.sampleActions.setFilteredEventTypes
      );
      const filterEventType = reactExports.useCallback(
        (type, isFiltered) => {
          const newFiltered = new Set(filtered);
          if (isFiltered) {
            newFiltered.delete(type);
          } else {
            newFiltered.add(type);
          }
          setFilteredEventTypes(Array.from(newFiltered));
        },
        [filtered, setFilteredEventTypes]
      );
      const setDebugFilter = reactExports.useCallback(() => {
        setFilteredEventTypes([]);
      }, [setFilteredEventTypes]);
      const setDefaultFilter = reactExports.useCallback(() => {
        setFilteredEventTypes([...kDefaultExcludeEvents]);
      }, [setFilteredEventTypes]);
      const isDefaultFilter = reactExports.useMemo(() => {
        return filtered.length === kDefaultExcludeEvents.length && [...filtered].every((type) => kDefaultExcludeEvents.includes(type));
      }, [filtered]);
      const isDebugFilter = reactExports.useMemo(() => {
        return filtered.length === 0;
      }, [filtered]);
      const arrangedEventTypes = reactExports.useCallback((columns = 1) => {
        const keys = Object.keys(eventTypes);
        const sortedKeys = keys.sort((a, b) => {
          const aIsDefault = kDefaultExcludeEvents.includes(a);
          const bIsDefault = kDefaultExcludeEvents.includes(b);
          if (aIsDefault && !bIsDefault) return 1;
          if (!aIsDefault && bIsDefault) return -1;
          return eventTypes[a].localeCompare(eventTypes[b]);
        });
        if (columns === 1) {
          return sortedKeys;
        }
        const itemsPerColumn = Math.ceil(sortedKeys.length / columns);
        const columnArrays = [];
        for (let col = 0; col < columns; col++) {
          const start2 = col * itemsPerColumn;
          const end2 = Math.min(start2 + itemsPerColumn, sortedKeys.length);
          columnArrays.push(sortedKeys.slice(start2, end2));
        }
        const arrangedKeys = [];
        const maxItemsInColumn = Math.max(...columnArrays.map((col) => col.length));
        for (let row2 = 0; row2 < maxItemsInColumn; row2++) {
          for (let col = 0; col < columns; col++) {
            if (row2 < columnArrays[col].length) {
              arrangedKeys.push(columnArrays[col][row2]);
            }
          }
        }
        return arrangedKeys;
      }, []);
      return {
        filtered,
        isDefaultFilter,
        isDebugFilter,
        setDefaultFilter,
        setDebugFilter,
        filterEventType,
        eventTypes,
        arrangedEventTypes
      };
    };
    const grid$5 = "_grid_1ml4j_1";
    const row$2 = "_row_1ml4j_8";
    const links$1 = "_links_1ml4j_22";
    const selected$3 = "_selected_1ml4j_40";
    const styles$P = {
      grid: grid$5,
      row: row$2,
      links: links$1,
      selected: selected$3
    };
    const TranscriptFilterPopover = ({
      showing,
      positionEl,
      setShowing
    }) => {
      const {
        isDefaultFilter,
        isDebugFilter,
        setDefaultFilter,
        setDebugFilter,
        filterEventType,
        eventTypes: eventTypes2,
        filtered,
        arrangedEventTypes
      } = useTranscriptFilter();
      return /* @__PURE__ */ jsxRuntimeExports.jsxs(
        PopOver,
        {
          id: `transcript-filter-popover`,
          positionEl,
          isOpen: showing,
          setIsOpen: setShowing,
          placement: "bottom-end",
          hoverDelay: -1,
          children: [
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$P.links, "text-size-smaller"), children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx(
                "a",
                {
                  className: clsx(
                    styles$P.link,
                    isDefaultFilter ? styles$P.selected : void 0
                  ),
                  onClick: () => setDefaultFilter(),
                  children: "Default"
                }
              ),
              "|",
              /* @__PURE__ */ jsxRuntimeExports.jsx(
                "a",
                {
                  className: clsx(
                    styles$P.link,
                    isDebugFilter ? styles$P.selected : void 0
                  ),
                  onClick: () => setDebugFilter(),
                  children: "Debug"
                }
              )
            ] }),
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$P.grid, "text-size-smaller"), children: arrangedEventTypes(2).map((eventType) => {
              return /* @__PURE__ */ jsxRuntimeExports.jsxs(
                "div",
                {
                  className: clsx(styles$P.row),
                  onClick: () => {
                    filterEventType(eventType, filtered.includes(eventType));
                  },
                  children: [
                    /* @__PURE__ */ jsxRuntimeExports.jsx(
                      "input",
                      {
                        type: "checkbox",
                        checked: !filtered.includes(eventType),
                        onChange: (e) => {
                          filterEventType(eventType, e.target.checked);
                        }
                      }
                    ),
                    eventTypes2[eventType]
                  ]
                },
                eventType
              );
            }) })
          ]
        }
      );
    };
    const StickyScroll = ({
      children: children2,
      scrollRef,
      offsetTop = 0,
      zIndex = 100,
      className: className2 = "",
      stickyClassName = "is-sticky",
      onStickyChange
    }) => {
      const wrapperRef = reactExports.useRef(null);
      const contentRef = reactExports.useRef(null);
      const [isSticky, setIsSticky] = reactExports.useState(false);
      const [dimensions, setDimensions] = reactExports.useState({
        width: 0,
        height: 0,
        left: 0,
        stickyTop: 0
        // Store the position where the element should stick
      });
      reactExports.useEffect(() => {
        const wrapper2 = wrapperRef.current;
        const content2 = contentRef.current;
        const scrollContainer = scrollRef.current;
        if (!wrapper2 || !content2 || !scrollContainer) {
          return;
        }
        const sentinel = document.createElement("div");
        sentinel.style.position = "absolute";
        sentinel.style.top = "0px";
        sentinel.style.left = "0";
        sentinel.style.width = "1px";
        sentinel.style.height = "1px";
        sentinel.style.pointerEvents = "none";
        wrapper2.prepend(sentinel);
        const widthTracker = document.createElement("div");
        widthTracker.style.position = "absolute";
        widthTracker.style.top = "0";
        widthTracker.style.left = "0";
        widthTracker.style.width = "100%";
        widthTracker.style.height = "0";
        widthTracker.style.pointerEvents = "none";
        widthTracker.style.visibility = "hidden";
        wrapper2.prepend(widthTracker);
        const updateDimensions = () => {
          if (wrapper2 && scrollContainer) {
            const contentRect = content2.getBoundingClientRect();
            const containerRect = scrollContainer.getBoundingClientRect();
            const trackerRect = widthTracker.getBoundingClientRect();
            const stickyTop = containerRect.top + offsetTop;
            setDimensions({
              // Use the width tracker to get the right width that respects
              // the parent container's current width, rather than the content's width
              width: trackerRect.width,
              height: contentRect.height,
              left: trackerRect.left,
              stickyTop
            });
          }
        };
        updateDimensions();
        const resizeObserver = new ResizeObserver(() => {
          requestAnimationFrame(() => {
            updateDimensions();
            if (isSticky) {
              handleScroll();
            }
          });
        });
        resizeObserver.observe(wrapper2);
        resizeObserver.observe(scrollContainer);
        resizeObserver.observe(content2);
        const handleScroll = () => {
          const sentinelRect = sentinel.getBoundingClientRect();
          const containerRect = scrollContainer.getBoundingClientRect();
          const shouldBeSticky = sentinelRect.top < containerRect.top + offsetTop;
          if (shouldBeSticky !== isSticky) {
            updateDimensions();
            setIsSticky(shouldBeSticky);
            if (onStickyChange) {
              onStickyChange(shouldBeSticky);
            }
          }
        };
        scrollContainer.addEventListener("scroll", handleScroll);
        handleScroll();
        return () => {
          resizeObserver.disconnect();
          scrollContainer.removeEventListener("scroll", handleScroll);
          if (sentinel.parentNode) {
            sentinel.parentNode.removeChild(sentinel);
          }
          if (widthTracker.parentNode) {
            widthTracker.parentNode.removeChild(widthTracker);
          }
        };
      }, [scrollRef, offsetTop, onStickyChange, isSticky]);
      const wrapperStyle = {
        position: "relative",
        height: isSticky ? `${dimensions.height}px` : "auto"
        // Don't constrain width - let it flow naturally with the content
      };
      const contentStyle = isSticky ? {
        position: "fixed",
        top: `${dimensions.stickyTop}px`,
        left: `${dimensions.left}px`,
        width: `${dimensions.width}px`,
        // Keep explicit width to prevent expanding to 100%
        maxHeight: `calc(100vh - ${dimensions.stickyTop}px)`,
        zIndex
      } : {};
      const contentClassName = isSticky && stickyClassName ? `${className2} ${stickyClassName}`.trim() : className2;
      return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: wrapperRef, style: wrapperStyle, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: contentRef, className: contentClassName, style: contentStyle, children: children2 }) });
    };
    const STEP = "step";
    const ACTION_BEGIN = "begin";
    const SPAN_BEGIN = "span_begin";
    const SPAN_END = "span_end";
    const TOOL = "tool";
    const STORE = "store";
    const STATE = "state";
    const TYPE_TOOL = "tool";
    const TYPE_SUBTASK = "subtask";
    const TYPE_SOLVER = "solver";
    const TYPE_SOLVERS = "solvers";
    const TYPE_AGENT = "agent";
    const TYPE_HANDOFF = "handoff";
    const TYPE_SCORERS = "scorers";
    const TYPE_SCORER = "scorer";
    const hasSpans = (events) => {
      return events.some((event) => event.event === SPAN_BEGIN);
    };
    const kTranscriptCollapseScope = "transcript-collapse";
    const kTranscriptOutlineCollapseScope = "transcript-outline";
    const kCollapsibleEventTypes = [
      STEP,
      SPAN_BEGIN,
      TYPE_TOOL,
      TYPE_SUBTASK
    ];
    class EventNode {
      id;
      event;
      children = [];
      depth;
      constructor(id, event, depth) {
        this.id = id;
        this.event = event;
        this.depth = depth;
      }
    }
    const kSandboxSignalName = "53787D8A-D3FC-426D-B383-9F880B70E4AA";
    const fixupEventStream = (events, filterPending = true) => {
      const collapsed2 = processPendingEvents(events, filterPending);
      const fixedUp = collapseSampleInit(collapsed2);
      return groupSandboxEvents(fixedUp);
    };
    const processPendingEvents = (events, filter) => {
      return filter ? events.filter((e) => !e.pending) : events.reduce((acc, event) => {
        if (!event.pending) {
          acc.push(event);
        } else {
          const lastIndex = acc.length - 1;
          if (lastIndex >= 0 && acc[lastIndex].pending && acc[lastIndex].event === event.event) {
            acc[lastIndex] = event;
          } else {
            acc.push(event);
          }
        }
        return acc;
      }, []);
    };
    const collapseSampleInit = (events) => {
      const hasSpans2 = events.some((e) => {
        return e.event === "span_begin" || e.event === "span_end";
      });
      if (hasSpans2) {
        return events;
      }
      const hasInitStep = events.findIndex((e) => {
        return e.event === "step" && e.name === "init";
      }) !== -1;
      if (hasInitStep) {
        return events;
      }
      const initEventIndex = events.findIndex((e) => {
        return e.event === "sample_init";
      });
      const initEvent = events[initEventIndex];
      if (!initEvent) {
        return events;
      }
      const fixedUp = [...events];
      fixedUp.splice(initEventIndex, 0, {
        timestamp: initEvent.timestamp,
        event: "step",
        action: "begin",
        type: null,
        name: "sample_init",
        pending: false,
        working_start: 0,
        span_id: initEvent.span_id,
        uuid: null,
        metadata: null
      });
      fixedUp.splice(initEventIndex + 2, 0, {
        timestamp: initEvent.timestamp,
        event: "step",
        action: "end",
        type: null,
        name: "sample_init",
        pending: false,
        working_start: 0,
        span_id: initEvent.span_id,
        uuid: null,
        metadata: null
      });
      return fixedUp;
    };
    const groupSandboxEvents = (events) => {
      const result2 = [];
      const pendingSandboxEvents = [];
      const useSpans = hasSpans(events);
      const pushPendingSandboxEvents = () => {
        const timestamp = pendingSandboxEvents[pendingSandboxEvents.length - 1].timestamp;
        if (useSpans) {
          result2.push(createSpanBegin(kSandboxSignalName, timestamp, null));
        } else {
          result2.push(createStepEvent(kSandboxSignalName, timestamp, "begin"));
        }
        result2.push(...pendingSandboxEvents);
        if (useSpans) {
          result2.push(createSpanEnd(kSandboxSignalName, timestamp));
        } else {
          result2.push(createStepEvent(kSandboxSignalName, timestamp, "end"));
        }
        pendingSandboxEvents.length = 0;
      };
      for (const event of events) {
        if (event.event === "sandbox") {
          pendingSandboxEvents.push(event);
          continue;
        }
        if (pendingSandboxEvents.length > 0) {
          pushPendingSandboxEvents();
        }
        result2.push(event);
      }
      if (pendingSandboxEvents.length > 0) {
        pushPendingSandboxEvents();
      }
      return result2;
    };
    const createStepEvent = (name2, timestamp, action) => ({
      timestamp,
      event: "step",
      action,
      type: null,
      name: name2,
      pending: false,
      working_start: 0,
      span_id: null,
      uuid: null,
      metadata: null
    });
    const createSpanBegin = (name2, timestamp, parent_id) => {
      return {
        name: name2,
        id: `${name2}-begin`,
        span_id: name2,
        parent_id,
        timestamp,
        event: "span_begin",
        type: null,
        pending: false,
        working_start: 0,
        uuid: null,
        metadata: null
      };
    };
    const createSpanEnd = (name2, timestamp) => {
      return {
        id: `${name2}-end`,
        timestamp,
        event: "span_end",
        pending: false,
        working_start: 0,
        span_id: name2,
        uuid: null,
        metadata: null
      };
    };
    const flatTree = (eventNodes, collapsed2, visitors, parentNode) => {
      const result2 = [];
      for (const node2 of eventNodes) {
        if (visitors && visitors.length > 0) {
          let pendingNodes = [{ ...node2 }];
          for (const visitor of visitors) {
            const allResults = [];
            for (const pendingNode of pendingNodes) {
              const visitorResult = visitor.visit(pendingNode);
              if (parentNode) {
                parentNode.children = visitorResult;
              }
              allResults.push(...visitorResult);
            }
            pendingNodes = allResults;
          }
          for (const pendingNode of pendingNodes) {
            const children2 = flatTree(
              pendingNode.children,
              collapsed2,
              visitors,
              pendingNode
            );
            pendingNode.children = children2;
            result2.push(pendingNode);
            if (collapsed2 === null || collapsed2[pendingNode.id] !== true) {
              result2.push(...children2);
            }
          }
          for (const visitor of visitors) {
            if (visitor.flush) {
              const finalNodes = visitor.flush();
              result2.push(...finalNodes);
            }
          }
        } else {
          result2.push(node2);
          const children2 = flatTree(node2.children, collapsed2, visitors, node2);
          if (collapsed2 === null || collapsed2[node2.id] !== true) {
            result2.push(...children2);
          }
        }
      }
      return result2;
    };
    const parsePackageName = (name2) => {
      if (name2.includes("/")) {
        const [packageName, moduleName] = name2.split("/", 2);
        return { package: packageName, module: moduleName };
      }
      return { package: "", module: name2 };
    };
    const eventRow = "_eventRow_1j0jk_1";
    const selected$2 = "_selected_1j0jk_8";
    const toggle = "_toggle_1j0jk_12";
    const eventLink = "_eventLink_1j0jk_17";
    const label$7 = "_label_1j0jk_28";
    const icon$1 = "_icon_1j0jk_34";
    const progress$2 = "_progress_1j0jk_38";
    const popover = "_popover_1j0jk_42";
    const styles$O = {
      eventRow,
      selected: selected$2,
      toggle,
      eventLink,
      label: label$7,
      icon: icon$1,
      progress: progress$2,
      popover
    };
    const OutlineRow = ({
      node: node2,
      collapseScope,
      running,
      selected: selected2
    }) => {
      const [collapsed2, setCollapsed] = useCollapseSampleEvent(
        collapseScope,
        node2.id
      );
      const icon2 = iconForNode(node2);
      const toggle2 = toggleIcon(node2, collapsed2);
      const popoverId = `${node2.id}-popover`;
      const { isShowing, setShowing } = useSamplePopover(popoverId);
      const ref = reactExports.useRef(null);
      const sampleEventUrl2 = useSampleEventUrl(node2.id);
      return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs(
          "div",
          {
            className: clsx(
              styles$O.eventRow,
              "text-size-smaller",
              selected2 ? styles$O.selected : ""
            ),
            style: { paddingLeft: `${node2.depth * 0.4}em` },
            "data-unsearchable": true,
            children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx(
                "div",
                {
                  className: clsx(styles$O.toggle),
                  onClick: () => {
                    setCollapsed(!collapsed2);
                  },
                  children: toggle2 ? /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: clsx(toggle2) }) : void 0
                }
              ),
              /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$O.label), "data-depth": node2.depth, children: [
                icon2 ? /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: clsx(icon2, styles$O.icon) }) : void 0,
                sampleEventUrl2 ? /* @__PURE__ */ jsxRuntimeExports.jsx(
                  Link,
                  {
                    to: sampleEventUrl2,
                    className: clsx(styles$O.eventLink),
                    ref,
                    children: parsePackageName(labelForNode(node2)).module
                  }
                ) : /* @__PURE__ */ jsxRuntimeExports.jsx("span", { ref, children: parsePackageName(labelForNode(node2)).module }),
                running ? /* @__PURE__ */ jsxRuntimeExports.jsx(
                  PulsingDots,
                  {
                    size: "small",
                    className: clsx(styles$O.progress),
                    subtle: false
                  }
                ) : void 0
              ] })
            ]
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          PopOver,
          {
            id: `${node2.id}-popover`,
            positionEl: ref.current,
            isOpen: isShowing,
            setIsOpen: setShowing,
            className: clsx(styles$O.popper),
            placement: "auto-end",
            children: summarizeNode(node2)
          }
        )
      ] });
    };
    const toggleIcon = (node2, collapsed2) => {
      if (node2.children.length > 0) {
        return collapsed2 ? ApplicationIcons.chevron.right : ApplicationIcons.chevron.down;
      }
    };
    const iconForNode = (node2) => {
      switch (node2.event.event) {
        case "sample_limit":
          return ApplicationIcons.limits.custom;
        case "score":
          return ApplicationIcons.scorer;
        case "error":
          return ApplicationIcons.error;
      }
    };
    const labelForNode = (node2) => {
      if (node2.event.event === "span_begin") {
        switch (node2.event.type) {
          case "solver":
            return node2.event.name;
          case "tool":
            return node2.event.name;
          default: {
            if (node2.event.name === kSandboxSignalName) {
              return "sandbox events";
            }
            return node2.event.name;
          }
        }
      } else {
        switch (node2.event.event) {
          case "subtask":
            return node2.event.name;
          case "approval":
            switch (node2.event.decision) {
              case "approve":
                return "approved";
              case "reject":
                return "rejected";
              case "escalate":
                return "escalated";
              case "modify":
                return "modified";
              case "terminate":
                return "terminated";
              default:
                return node2.event.decision;
            }
          case "model":
            return `model${node2.event.role ? ` (${node2.event.role})` : ""}`;
          case "score":
            return "scoring";
          case "step":
            if (node2.event.name === kSandboxSignalName) {
              return "sandbox events";
            }
            return node2.event.name;
          default:
            return node2.event.event;
        }
      }
    };
    const summarizeNode = (node2) => {
      let entries = {};
      switch (node2.event.event) {
        case "sample_init":
          entries = {
            sample_id: node2.event.sample.id,
            sandbox: node2.event.sample.sandbox?.type,
            started: formatDateTime(new Date(node2.event.timestamp)),
            working_start: formatTime$1(node2.event.working_start)
          };
          break;
        case "sample_limit":
          entries = {
            type: node2.event.type,
            message: node2.event.message,
            limit: node2.event.limit,
            started: formatDateTime(new Date(node2.event.timestamp)),
            working_start: formatTime$1(node2.event.working_start)
          };
          break;
        case "score":
          entries = {
            answer: node2.event.score.answer,
            score: node2.event.score.value,
            started: formatDateTime(new Date(node2.event.timestamp)),
            working_start: formatTime$1(node2.event.working_start)
          };
          break;
        case "span_begin":
          entries = {
            name: node2.event.name,
            started: formatDateTime(new Date(node2.event.timestamp)),
            working_start: formatTime$1(node2.event.working_start)
          };
          break;
        default:
          entries = {
            started: formatDateTime(new Date(node2.event.timestamp)),
            working_start: formatTime$1(node2.event.working_start)
          };
      }
      return /* @__PURE__ */ jsxRuntimeExports.jsx(
        MetaDataGrid,
        {
          entries,
          size: "mini",
          className: clsx(styles$O.popover, "text-size-smallest")
        }
      );
    };
    const styles$N = {};
    const kTurnType = "turn";
    const kTurnsType = "turns";
    const kCollapsedScoring = "scorings";
    const removeNodeVisitor = (event) => {
      return {
        visit: (node2) => {
          if (node2.event.event === event) {
            return [];
          }
          return [node2];
        }
      };
    };
    const removeStepSpanNameVisitor = (name2) => {
      return {
        visit: (node2) => {
          if ((node2.event.event === "step" || node2.event.event === "span_begin") && node2.event.name === name2) {
            return [];
          }
          return [node2];
        }
      };
    };
    const noScorerChildren = () => {
      let inScorers = false;
      let inScorer = false;
      let currentDepth = -1;
      return {
        visit: (node2) => {
          if (node2.event.event === "span_begin" && node2.event.type === TYPE_SCORERS) {
            inScorers = true;
            return [node2];
          }
          if ((node2.event.event === "step" || node2.event.event === "span_begin") && node2.event.type === TYPE_SCORER) {
            inScorer = true;
            currentDepth = node2.depth;
            return [node2];
          }
          if (inScorers && inScorer && node2.depth === currentDepth + 1) {
            return [];
          }
          return [node2];
        }
      };
    };
    const makeTurns = (eventNodes) => {
      const results = [];
      let modelNode = null;
      const toolNodes = [];
      let turnCount = 1;
      const makeTurn = (force) => {
        if (modelNode !== null && (force || toolNodes.length > 0)) {
          const turnNode = new EventNode(
            modelNode.id,
            {
              id: modelNode.id,
              event: "span_begin",
              type: kTurnType,
              name: `turn ${turnCount++}`,
              pending: false,
              working_start: modelNode.event.working_start,
              timestamp: modelNode.event.timestamp,
              parent_id: null,
              span_id: modelNode.event.span_id,
              uuid: null,
              metadata: null
            },
            modelNode.depth
          );
          turnNode.children = [modelNode, ...toolNodes];
          results.push(turnNode);
        }
        modelNode = null;
        toolNodes.length = 0;
      };
      for (const node2 of eventNodes) {
        if (node2.event.event === "model") {
          if (modelNode !== null && toolNodes.length === 0) {
            makeTurn(true);
          } else {
            makeTurn();
            modelNode = node2;
          }
        } else if (node2.event.event === "tool") {
          toolNodes.push(node2);
        } else {
          makeTurn();
          results.push(node2);
        }
      }
      makeTurn();
      return results;
    };
    const collapseTurns = (eventNodes) => {
      const results = [];
      const collecting = [];
      const collect = () => {
        if (collecting.length > 0) {
          const numberOfTurns = collecting.length;
          const firstTurn = collecting[0];
          const turnNode = new EventNode(
            firstTurn.id,
            {
              ...firstTurn.event,
              name: `${numberOfTurns} ${numberOfTurns === 1 ? "turn" : "turns"}`,
              type: kTurnsType
            },
            firstTurn.depth
          );
          results.push(turnNode);
          collecting.length = 0;
        }
      };
      for (const node2 of eventNodes) {
        if (node2.event.event === "span_begin" && node2.event.type === kTurnType) {
          if (collecting.length > 0 && collecting[0].depth !== node2.depth) {
            collect();
          }
          collecting.push(node2);
        } else {
          collect();
          results.push(node2);
        }
      }
      collect();
      return results;
    };
    const collapseScoring = (eventNodes) => {
      const results = [];
      const collecting = [];
      const collect = () => {
        if (collecting.length > 0) {
          const firstScore = collecting[0];
          const turnNode = new EventNode(
            firstScore.id,
            {
              ...firstScore.event,
              name: "scoring",
              type: kCollapsedScoring
            },
            firstScore.depth
          );
          results.push(turnNode);
          collecting.length = 0;
        }
      };
      for (const node2 of eventNodes) {
        if (node2.event.event === "score") {
          collecting.push(node2);
        } else {
          collect();
          results.push(node2);
        }
      }
      collect();
      return results;
    };
    const kFramesToStabilize = 10;
    const EventPaddingNode = {
      id: "padding",
      event: {
        event: "info",
        source: "",
        data: "",
        timestamp: "",
        pending: false,
        working_start: 0,
        span_id: null,
        uuid: null,
        metadata: null
      },
      depth: 0,
      children: []
    };
    const TranscriptOutline = ({
      eventNodes,
      defaultCollapsedIds,
      running,
      className: className2,
      scrollRef,
      style: style2
    }) => {
      const id = "transcript-tree";
      const listHandle = reactExports.useRef(null);
      const { getRestoreState } = useVirtuosoState(listHandle, id);
      const collapsedEvents = useStore((state) => state.sample.collapsedEvents);
      const setCollapsedEvents = useStore(
        (state) => state.sampleActions.setCollapsedEvents
      );
      const selectedOutlineId = useStore((state) => state.sample.selectedOutlineId);
      const setSelectedOutlineId = useStore(
        (state) => state.sampleActions.setSelectedOutlineId
      );
      const sampleDetailNavigation = useSampleDetailNavigation();
      const isProgrammaticScrolling = reactExports.useRef(false);
      const lastScrollPosition = reactExports.useRef(null);
      const stableFrameCount = reactExports.useRef(0);
      reactExports.useEffect(() => {
        if (sampleDetailNavigation.event) {
          isProgrammaticScrolling.current = true;
          lastScrollPosition.current = null;
          stableFrameCount.current = 0;
          setSelectedOutlineId(sampleDetailNavigation.event);
          const checkScrollStabilized = () => {
            if (!isProgrammaticScrolling.current) return;
            const currentPosition = scrollRef?.current?.scrollTop ?? null;
            if (currentPosition === lastScrollPosition.current) {
              stableFrameCount.current++;
              if (stableFrameCount.current >= kFramesToStabilize) {
                isProgrammaticScrolling.current = false;
                return;
              }
            } else {
              stableFrameCount.current = 0;
              lastScrollPosition.current = currentPosition;
            }
            requestAnimationFrame(checkScrollStabilized);
          };
          requestAnimationFrame(checkScrollStabilized);
        }
      }, [sampleDetailNavigation.event, setSelectedOutlineId, scrollRef]);
      const outlineNodeList = reactExports.useMemo(() => {
        const nodeList = flatTree(
          eventNodes,
          (collapsedEvents ? collapsedEvents[kTranscriptOutlineCollapseScope] : void 0) || defaultCollapsedIds,
          [
            // Strip specific nodes
            removeNodeVisitor("logger"),
            removeNodeVisitor("info"),
            removeNodeVisitor("state"),
            removeNodeVisitor("store"),
            removeNodeVisitor("approval"),
            removeNodeVisitor("input"),
            removeNodeVisitor("sandbox"),
            // Strip the sandbox wrapper (and children)
            removeStepSpanNameVisitor(kSandboxSignalName),
            // Remove child events for scorers
            noScorerChildren()
          ]
        );
        return collapseScoring(collapseTurns(makeTurns(nodeList)));
      }, [eventNodes, collapsedEvents, defaultCollapsedIds]);
      const allNodesList = reactExports.useMemo(() => {
        return flatTree(eventNodes, null);
      }, [eventNodes]);
      const elementIds = allNodesList.map((node2) => node2.id);
      const findNearestOutlineAbove = reactExports.useCallback(
        (targetId) => {
          const targetIndex = allNodesList.findIndex(
            (node2) => node2.id === targetId
          );
          if (targetIndex === -1) return null;
          const outlineIds = new Set(outlineNodeList.map((node2) => node2.id));
          for (let i2 = targetIndex; i2 >= 0; i2--) {
            if (outlineIds.has(allNodesList[i2].id)) {
              return allNodesList[i2];
            }
          }
          return null;
        },
        [allNodesList, outlineNodeList]
      );
      useScrollTrack(
        elementIds,
        (id2) => {
          if (!isProgrammaticScrolling.current) {
            const parentNode = findNearestOutlineAbove(id2);
            if (parentNode) {
              setSelectedOutlineId(parentNode.id);
            }
          }
        },
        scrollRef
      );
      reactExports.useEffect(() => {
        if (!collapsedEvents && Object.keys(defaultCollapsedIds).length > 0) {
          setCollapsedEvents(kTranscriptOutlineCollapseScope, defaultCollapsedIds);
        }
      }, [defaultCollapsedIds, collapsedEvents, setCollapsedEvents]);
      const renderRow = reactExports.useCallback(
        (index, node2) => {
          if (node2 === EventPaddingNode) {
            return /* @__PURE__ */ jsxRuntimeExports.jsx(
              "div",
              {
                className: clsx(styles$N.eventPadding),
                style: { height: "2em" }
              },
              node2.id
            );
          } else {
            return /* @__PURE__ */ jsxRuntimeExports.jsx(
              OutlineRow,
              {
                collapseScope: kTranscriptOutlineCollapseScope,
                node: node2,
                running: running && index === outlineNodeList.length - 1,
                selected: selectedOutlineId ? selectedOutlineId === node2.id : index === 0
              },
              node2.id
            );
          }
        },
        [outlineNodeList, running, selectedOutlineId]
      );
      return /* @__PURE__ */ jsxRuntimeExports.jsx(
        Yr,
        {
          ref: listHandle,
          customScrollParent: scrollRef?.current ? scrollRef.current : void 0,
          id,
          style: { ...style2 },
          data: [...outlineNodeList, EventPaddingNode],
          defaultItemHeight: 50,
          itemContent: renderRow,
          atBottomThreshold: 30,
          increaseViewportBy: { top: 300, bottom: 300 },
          overscan: {
            main: 10,
            reverse: 10
          },
          className: clsx(className2, "transcript-outline"),
          skipAnimationFrameInResizeObserver: true,
          restoreStateFrom: getRestoreState(),
          tabIndex: 0
        }
      );
    };
    const container$c = "_container_17sux_1";
    const collapsed = "_collapsed_17sux_9";
    const treeContainer = "_treeContainer_17sux_13";
    const listContainer = "_listContainer_17sux_25";
    const outline = "_outline_17sux_29";
    const outlineToggle = "_outlineToggle_17sux_33";
    const styles$M = {
      container: container$c,
      collapsed,
      treeContainer,
      listContainer,
      outline,
      outlineToggle
    };
    const title$2 = "_title_19l1b_1";
    const contents = "_contents_19l1b_8";
    const styles$L = {
      title: title$2,
      contents
    };
    const EventRow = ({
      title: title2,
      icon: icon2,
      className: className2,
      children: children2
    }) => {
      const contentEl = title2 ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx("text-size-small", styles$L.title, className2), children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: icon2 || ApplicationIcons.metadata }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx("text-style-label"), children: title2 }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: children2 })
      ] }) : "";
      const card2 = /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx("card", styles$L.contents), children: contentEl });
      return card2;
    };
    const ApprovalEventView = ({
      eventNode,
      className: className2
    }) => {
      const event = eventNode.event;
      return /* @__PURE__ */ jsxRuntimeExports.jsx(
        EventRow,
        {
          title: decisionLabel(event.decision),
          icon: decisionIcon(event.decision),
          className: className2,
          children: event.explanation || ""
        }
      );
    };
    const decisionLabel = (decision) => {
      switch (decision) {
        case "approve":
          return "Approved";
        case "reject":
          return "Rejected";
        case "terminate":
          return "Terminated";
        case "escalate":
          return "Escalated";
        case "modify":
          return "Modified";
        default:
          return decision;
      }
    };
    const decisionIcon = (decision) => {
      switch (decision) {
        case "approve":
          return ApplicationIcons.approvals.approve;
        case "reject":
          return ApplicationIcons.approvals.reject;
        case "terminate":
          return ApplicationIcons.approvals.terminate;
        case "escalate":
          return ApplicationIcons.approvals.escalate;
        case "modify":
          return ApplicationIcons.approvals.modify;
        default:
          return ApplicationIcons.approve;
      }
    };
    const tab = "_tab_1je38_1";
    const styles$K = {
      tab
    };
    const EventNav = ({
      target: target2,
      title: title2,
      selectedNav,
      setSelectedNav
    }) => {
      const active = target2 === selectedNav;
      const handleClick = reactExports.useCallback(() => {
        setSelectedNav(target2);
      }, [setSelectedNav, target2]);
      return /* @__PURE__ */ jsxRuntimeExports.jsx("li", { className: "nav-item", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
        "button",
        {
          type: "button",
          role: "tab",
          "aria-controls": target2,
          "aria-selected": active,
          className: clsx(
            "nav-link",
            active ? "active " : "",
            "text-style-label",
            "text-size-small",
            styles$K.tab
          ),
          onClick: handleClick,
          children: title2
        }
      ) });
    };
    const navs$1 = "_navs_1vm6p_1";
    const styles$J = {
      navs: navs$1
    };
    const EventNavs = ({
      navs: navs2,
      selectedNav,
      setSelectedNav
    }) => {
      return /* @__PURE__ */ jsxRuntimeExports.jsx(
        "ul",
        {
          className: clsx("nav", "nav-pills", styles$J.navs),
          role: "tablist",
          "aria-orientation": "horizontal",
          children: navs2.map((nav2) => {
            return /* @__PURE__ */ jsxRuntimeExports.jsx(
              EventNav,
              {
                target: nav2.target,
                title: nav2.title,
                selectedNav,
                setSelectedNav
              },
              nav2.title
            );
          })
        }
      );
    };
    const label$6 = "_label_1nn7f_1";
    const navs = "_navs_1nn7f_6";
    const card = "_card_1nn7f_12";
    const cardContent = "_cardContent_1nn7f_20";
    const hidden$1 = "_hidden_1nn7f_25";
    const copyLink = "_copyLink_1nn7f_33";
    const hover = "_hover_1nn7f_41";
    const root$1 = "_root_1nn7f_45";
    const bottomDongle = "_bottomDongle_1nn7f_50";
    const dongleIcon = "_dongleIcon_1nn7f_67";
    const styles$I = {
      label: label$6,
      navs,
      card,
      cardContent,
      hidden: hidden$1,
      copyLink,
      hover,
      root: root$1,
      bottomDongle,
      dongleIcon
    };
    const EventPanel = ({
      eventNodeId,
      depth,
      className: className2,
      title: title2,
      subTitle,
      text: text2,
      icon: icon2,
      children: children2,
      childIds,
      collapsibleContent,
      collapseControl = "top"
    }) => {
      const [collapsed2, setCollapsed] = useCollapseSampleEvent(
        kTranscriptCollapseScope,
        eventNodeId
      );
      const isCollapsible = (childIds || []).length > 0 || collapsibleContent;
      const useBottomDongle = isCollapsible && collapseControl === "bottom";
      const sampleEventUrl2 = useSampleEventUrl(eventNodeId);
      const url = supportsLinking() && sampleEventUrl2 ? toFullUrl(sampleEventUrl2) : void 0;
      const pillId = (index) => {
        return `${eventNodeId}-nav-pill-${index}`;
      };
      const filteredArrChildren = (Array.isArray(children2) ? children2 : [children2]).filter((child) => !!child);
      const defaultPill = filteredArrChildren.findIndex((node2) => {
        return hasDataDefault(node2) && node2.props["data-default"];
      });
      const defaultPillId = defaultPill !== -1 ? pillId(defaultPill) : pillId(0);
      const [selectedNav, setSelectedNav] = useProperty(
        eventNodeId,
        "selectedNav",
        {
          defaultValue: defaultPillId
        }
      );
      const gridColumns2 = [];
      if (isCollapsible && !useBottomDongle) {
        gridColumns2.push("minmax(0, max-content)");
      }
      if (icon2) {
        gridColumns2.push("max-content");
      }
      gridColumns2.push("minmax(0, max-content)");
      if (url) {
        gridColumns2.push("minmax(0, max-content)");
      }
      gridColumns2.push("auto");
      gridColumns2.push("minmax(0, max-content)");
      gridColumns2.push("minmax(0, max-content)");
      const toggleCollapse = reactExports.useCallback(() => {
        setCollapsed(!collapsed2);
      }, [setCollapsed, collapsed2]);
      const [mouseOver, setMouseOver] = reactExports.useState(false);
      const titleEl = title2 || icon2 || filteredArrChildren.length > 1 ? /* @__PURE__ */ jsxRuntimeExports.jsxs(
        "div",
        {
          title: subTitle,
          className: clsx("text-size-small", mouseOver ? styles$I.hover : ""),
          style: {
            display: "grid",
            gridTemplateColumns: gridColumns2.join(" "),
            columnGap: "0.3em",
            cursor: isCollapsible && !useBottomDongle ? "pointer" : void 0
          },
          onMouseEnter: () => setMouseOver(true),
          onMouseLeave: () => setMouseOver(false),
          children: [
            isCollapsible && !useBottomDongle ? /* @__PURE__ */ jsxRuntimeExports.jsx(
              "i",
              {
                onClick: toggleCollapse,
                className: collapsed2 ? ApplicationIcons.chevron.right : ApplicationIcons.chevron.down
              }
            ) : "",
            icon2 ? /* @__PURE__ */ jsxRuntimeExports.jsx(
              "i",
              {
                className: clsx(
                  icon2 || ApplicationIcons.metadata,
                  "text-style-secondary"
                ),
                onClick: toggleCollapse
              }
            ) : "",
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              "div",
              {
                className: clsx("text-style-secondary", "text-style-label"),
                onClick: toggleCollapse,
                children: title2
              }
            ),
            url ? /* @__PURE__ */ jsxRuntimeExports.jsx(
              CopyButton,
              {
                value: url,
                icon: ApplicationIcons.link,
                className: clsx(styles$I.copyLink)
              }
            ) : "",
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { onClick: toggleCollapse }),
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              "div",
              {
                className: clsx("text-style-secondary", styles$I.label),
                onClick: toggleCollapse,
                children: collapsed2 ? text2 : ""
              }
            ),
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$I.navs, children: isCollapsible && collapsibleContent && collapsed2 ? "" : filteredArrChildren && filteredArrChildren.length > 1 ? /* @__PURE__ */ jsxRuntimeExports.jsx(
              EventNavs,
              {
                navs: filteredArrChildren.map((child, index) => {
                  const defaultTitle = `Tab ${index}`;
                  const title22 = child && reactExports.isValidElement(child) ? child.props["data-name"] || defaultTitle : defaultTitle;
                  return {
                    id: `eventpanel-${eventNodeId}-${index}`,
                    title: title22,
                    target: pillId(index)
                  };
                }),
                selectedNav,
                setSelectedNav
              }
            ) : "" })
          ]
        }
      ) : "";
      const card2 = /* @__PURE__ */ jsxRuntimeExports.jsxs(
        "div",
        {
          id: `event-panel-${eventNodeId}`,
          className: clsx(
            className2,
            styles$I.card,
            depth === 0 ? styles$I.root : void 0
          ),
          children: [
            titleEl,
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              "div",
              {
                className: clsx(
                  "tab-content",
                  styles$I.cardContent,
                  isCollapsible && collapsed2 && collapsibleContent ? styles$I.hidden : void 0
                ),
                children: filteredArrChildren?.map((child, index) => {
                  const id = pillId(index);
                  const isSelected = id === selectedNav;
                  if (!isSelected) {
                    return null;
                  }
                  return /* @__PURE__ */ jsxRuntimeExports.jsx(
                    "div",
                    {
                      id,
                      className: clsx("tab-pane", "show", isSelected ? "active" : ""),
                      children: child
                    },
                    `children-${id}-${index}`
                  );
                })
              }
            ),
            isCollapsible && useBottomDongle ? /* @__PURE__ */ jsxRuntimeExports.jsxs(
              "div",
              {
                className: clsx(styles$I.bottomDongle, "text-size-smallest"),
                onClick: toggleCollapse,
                children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsx(
                    "i",
                    {
                      className: clsx(
                        collapsed2 ? ApplicationIcons.chevron.right : ApplicationIcons.chevron.down,
                        styles$I.dongleIcon
                      )
                    }
                  ),
                  "transcript (",
                  childIds?.length,
                  " ",
                  childIds?.length === 1 ? "event" : "events",
                  ")"
                ]
              }
            ) : void 0
          ]
        }
      );
      return card2;
    };
    function hasDataDefault(node2) {
      return reactExports.isValidElement(node2) && node2.props !== null && typeof node2.props === "object" && "data-default" in node2.props;
    }
    const ErrorEventView = ({
      eventNode,
      className: className2
    }) => {
      const event = eventNode.event;
      return /* @__PURE__ */ jsxRuntimeExports.jsx(
        EventPanel,
        {
          eventNodeId: eventNode.id,
          depth: eventNode.depth,
          title: "Error",
          className: className2,
          subTitle: formatDateTime(new Date(event.timestamp)),
          icon: ApplicationIcons.error,
          children: /* @__PURE__ */ jsxRuntimeExports.jsx(
            ANSIDisplay,
            {
              output: event.error.traceback_ansi,
              style: {
                fontSize: "clamp(0.3rem, 1.1vw, 0.8rem)",
                margin: "0.5em 0"
              }
            }
          )
        }
      );
    };
    const panel$4 = "_panel_vz394_1";
    const styles$H = {
      panel: panel$4
    };
    const InfoEventView = ({
      eventNode,
      className: className2
    }) => {
      const event = eventNode.event;
      const panels = [];
      if (typeof event.data === "string") {
        panels.push(
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            RenderedText,
            {
              markdown: event.data,
              className: clsx(styles$H.panel, "text-size-base")
            }
          )
        );
      } else {
        panels.push(/* @__PURE__ */ jsxRuntimeExports.jsx(JSONPanel, { data: event.data, className: styles$H.panel }));
      }
      return /* @__PURE__ */ jsxRuntimeExports.jsx(
        EventPanel,
        {
          eventNodeId: eventNode.id,
          depth: eventNode.depth,
          title: "Info" + (event.source ? ": " + event.source : ""),
          className: className2,
          subTitle: formatDateTime(new Date(event.timestamp)),
          icon: ApplicationIcons.info,
          children: panels
        }
      );
    };
    const InputEventView = ({
      eventNode,
      className: className2
    }) => {
      const event = eventNode.event;
      return /* @__PURE__ */ jsxRuntimeExports.jsx(
        EventPanel,
        {
          eventNodeId: eventNode.id,
          depth: eventNode.depth,
          title: "Input",
          className: className2,
          subTitle: formatDateTime(new Date(event.timestamp)),
          icon: ApplicationIcons.input,
          children: /* @__PURE__ */ jsxRuntimeExports.jsx(
            ANSIDisplay,
            {
              output: event.input_ansi,
              style: { fontSize: "clamp(0.4rem, 1.15vw, 0.9rem)" }
            }
          )
        }
      );
    };
    const grid$4 = "_grid_1eq5o_1";
    const styles$G = {
      grid: grid$4
    };
    const LoggerEventView = ({
      eventNode,
      className: className2
    }) => {
      const event = eventNode.event;
      const obj = parsedJson(event.message.message);
      return /* @__PURE__ */ jsxRuntimeExports.jsx(
        EventRow,
        {
          className: className2,
          title: event.message.level,
          icon: ApplicationIcons.logging[event.message.level.toLowerCase()],
          children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx("text-size-base", styles$G.grid), children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx("text-size-smaller"), children: obj !== void 0 && obj !== null ? /* @__PURE__ */ jsxRuntimeExports.jsx(MetaDataGrid, { entries: obj }) : event.message.message }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx("text-size-smaller", "text-style-secondary"), children: [
              event.message.filename,
              ":",
              event.message.lineno
            ] })
          ] })
        }
      );
    };
    const container$b = "_container_1ww70_1";
    const titleRow = "_titleRow_1ww70_5";
    const title$1 = "_title_1ww70_5";
    const styles$F = {
      container: container$b,
      titleRow,
      title: title$1
    };
    const EventSection = ({
      title: title2,
      children: children2,
      copyContent,
      className: className2
    }) => {
      return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$F.container, className2), children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$F.titleRow), children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
          "div",
          {
            className: clsx("text-size-small", "text-style-label", styles$F.title),
            children: [
              title2,
              copyContent ? /* @__PURE__ */ jsxRuntimeExports.jsx(CopyButton, { value: copyContent, ariaLabel: "Copy to clipboard" }) : null
            ]
          }
        ) }),
        children2
      ] });
    };
    const container$a = "_container_e0l2n_1";
    const all = "_all_e0l2n_6";
    const tableSelection = "_tableSelection_e0l2n_12";
    const codePre = "_codePre_e0l2n_22";
    const code$3 = "_code_e0l2n_22";
    const progress$1 = "_progress_e0l2n_34";
    const toolConfig = "_toolConfig_e0l2n_38";
    const toolChoice = "_toolChoice_e0l2n_46";
    const styles$E = {
      container: container$a,
      all,
      tableSelection,
      codePre,
      code: code$3,
      progress: progress$1,
      toolConfig,
      toolChoice
    };
    const wrapper$1 = "_wrapper_45f60_1";
    const col2 = "_col2_45f60_8";
    const col1_3 = "_col1_3_45f60_12";
    const col3 = "_col3_45f60_16";
    const separator$2 = "_separator_45f60_20";
    const topMargin = "_topMargin_45f60_26";
    const styles$D = {
      wrapper: wrapper$1,
      col2,
      col1_3,
      col3,
      separator: separator$2,
      topMargin
    };
    const EventTimingPanel = ({
      timestamp,
      completed,
      working_start,
      working_time
    }) => {
      const rows = [
        {
          label: "Clock Time",
          value: void 0,
          secondary: false
        },
        {
          label: "---",
          value: void 0,
          secondary: false
        }
      ];
      if (!completed) {
        rows.push({
          label: "Timestamp",
          value: formatDateTime(new Date(timestamp))
        });
      } else {
        rows.push({ label: "Start", value: formatDateTime(new Date(timestamp)) });
        rows.push({ label: "End", value: formatDateTime(new Date(completed)) });
      }
      if (working_start || working_time) {
        rows.push({
          label: "Working Time",
          value: void 0,
          secondary: false,
          topMargin: true
        });
        rows.push({
          label: "---",
          value: void 0,
          secondary: false
        });
        if (working_start) {
          rows.push({
            label: "Start",
            value: formatTime$1(working_start)
          });
        }
        if (working_time) {
          rows.push({
            label: "Duration",
            value: formatTime$1(working_time)
          });
        }
        if (working_start && working_time) {
          rows.push({
            label: "End",
            value: formatTime$1(
              Math.round(working_start * 10) / 10 + Math.round(working_time * 10) / 10
            )
          });
        }
      }
      return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx("text-size-small", styles$D.wrapper), children: rows.map((row2, idx) => {
        if (row2.label === "---") {
          return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$D.separator }, `$usage-sep-${idx}`);
        } else {
          return /* @__PURE__ */ jsxRuntimeExports.jsxs(reactExports.Fragment, { children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              "div",
              {
                className: clsx(
                  "text-style-label",
                  "text-style-secondary",
                  row2.secondary ? styles$D.col2 : styles$D.col1_3,
                  row2.topMargin ? styles$D.topMargin : void 0
                ),
                children: row2.label
              }
            ),
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$D.col3, children: row2.value ? row2.value : "" })
          ] }, `$usage-row-${idx}`);
        }
      }) });
    };
    const formatTiming = (timestamp, working_start) => {
      if (working_start) {
        return `${formatDateTime(new Date(timestamp))}
@ working time: ${formatTime$1(working_start)}`;
      } else {
        return formatDateTime(new Date(timestamp));
      }
    };
    const formatTitle = (title2, total_tokens, working_start) => {
      const subItems = [];
      if (total_tokens) {
        subItems.push(`${formatNumber(total_tokens)} tokens`);
      }
      if (working_start) {
        subItems.push(`${formatTime$1(working_start)}`);
      }
      const subtitle = subItems.length > 0 ? ` (${subItems.join(", ")})` : "";
      return `${title2}${subtitle}`;
    };
    const ModelEventView = ({
      eventNode,
      showToolCalls,
      className: className2,
      context
    }) => {
      const event = eventNode.event;
      const totalUsage = event.output.usage?.total_tokens;
      const callTime = event.output.time;
      const outputMessages = event.output.choices?.map((choice) => {
        return choice.message;
      });
      const entries = { ...event.config };
      delete entries["max_connections"];
      const userMessages = [];
      for (const msg of event.input.slice().reverse()) {
        if (msg.role === "user" && !msg.tool_call_id || msg.role === "system" || // If the client doesn't support tool events, then tools messages are allowed to be displayed
        // in this view, since no tool events will be shown. This pretty much happens for bridged agents
        // where tool events aren't captured.
        context?.hasToolEvents === false && msg.role === "tool") {
          userMessages.unshift(msg);
        } else {
          break;
        }
      }
      const panelTitle = event.role ? `Model Call (${event.role}): ${event.model}` : `Model Call: ${event.model}`;
      return /* @__PURE__ */ jsxRuntimeExports.jsxs(
        EventPanel,
        {
          eventNodeId: eventNode.id,
          depth: eventNode.depth,
          className: className2,
          title: formatTitle(panelTitle, totalUsage, callTime),
          subTitle: formatTiming(event.timestamp, event.working_start),
          icon: ApplicationIcons.model,
          children: [
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { "data-name": "Summary", className: styles$E.container, children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx(
                ChatView,
                {
                  id: `${eventNode.id}-model-output`,
                  messages: [...userMessages, ...outputMessages || []],
                  numbered: false,
                  toolCallStyle: showToolCalls ? "complete" : "omit",
                  resolveToolCallsIntoPreviousMessage: context?.hasToolEvents !== false,
                  allowLinking: false
                }
              ),
              event.pending ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$E.progress), children: /* @__PURE__ */ jsxRuntimeExports.jsx(PulsingDots, { subtle: false, size: "medium" }) }) : void 0
            ] }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { "data-name": "All", className: styles$E.container, children: [
              /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$E.all, children: [
                Object.keys(entries).length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(
                  EventSection,
                  {
                    title: "Configuration",
                    className: styles$E.tableSelection,
                    children: /* @__PURE__ */ jsxRuntimeExports.jsx(MetaDataGrid, { entries, plain: true })
                  }
                ),
                /* @__PURE__ */ jsxRuntimeExports.jsx(EventSection, { title: "Usage", className: styles$E.tableSelection, children: event.output.usage !== null ? /* @__PURE__ */ jsxRuntimeExports.jsx(ModelUsagePanel, { usage: event.output.usage }) : void 0 }),
                /* @__PURE__ */ jsxRuntimeExports.jsx(EventSection, { title: "Timing", className: styles$E.tableSelection, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
                  EventTimingPanel,
                  {
                    timestamp: event.timestamp,
                    completed: event.completed,
                    working_start: event.working_start,
                    working_time: event.working_time
                  }
                ) })
              ] }),
              /* @__PURE__ */ jsxRuntimeExports.jsx(EventSection, { title: "Messages", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
                ChatView,
                {
                  id: `${eventNode.id}-model-input-full`,
                  messages: [...event.input, ...outputMessages || []],
                  resolveToolCallsIntoPreviousMessage: context?.hasToolEvents !== false,
                  allowLinking: false
                }
              ) })
            ] }),
            event.tools.length > 1 && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { "data-name": "Tools", className: styles$E.container, children: /* @__PURE__ */ jsxRuntimeExports.jsx(ToolsConfig, { tools: event.tools, toolChoice: event.tool_choice }) }),
            event.call ? /* @__PURE__ */ jsxRuntimeExports.jsx(
              APIView,
              {
                "data-name": "API",
                call: event.call,
                className: styles$E.container
              }
            ) : ""
          ]
        }
      );
    };
    const APIView = ({ call, className: className2 }) => {
      const requestCode = reactExports.useMemo(() => {
        return JSON.stringify(call.request, void 0, 2);
      }, [call.request]);
      const responseCode = reactExports.useMemo(() => {
        return JSON.stringify(call.response, void 0, 2);
      }, [call.response]);
      if (!call) {
        return null;
      }
      return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(className2), children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(EventSection, { title: "Request", copyContent: requestCode, children: /* @__PURE__ */ jsxRuntimeExports.jsx(APICodeCell, { sourceCode: requestCode }) }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(EventSection, { title: "Response", copyContent: responseCode, children: /* @__PURE__ */ jsxRuntimeExports.jsx(APICodeCell, { sourceCode: responseCode }) })
      ] });
    };
    const APICodeCell = ({ id, sourceCode }) => {
      const sourceCodeRef = reactExports.useRef(null);
      usePrismHighlight(sourceCodeRef, sourceCode.length);
      if (!sourceCode) {
        return null;
      }
      return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: sourceCodeRef, className: clsx("model-call"), children: /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: clsx(styles$E.codePre), children: /* @__PURE__ */ jsxRuntimeExports.jsx(
        "code",
        {
          id,
          className: clsx("language-json", styles$E.code, "text-size-small"),
          children: sourceCode
        }
      ) }) });
    };
    const ToolsConfig = ({ tools: tools2, toolChoice: toolChoice2 }) => {
      const toolEls = tools2.map((tool2, idx) => {
        return /* @__PURE__ */ jsxRuntimeExports.jsxs(reactExports.Fragment, { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx("text-style-label", "text-style-secondary"), children: tool2.name }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: tool2.description })
        ] }, `${tool2.name}-${idx}`);
      });
      return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$E.toolConfig, "text-size-small"), children: toolEls }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$E.toolChoice, "text-size-small"), children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx("text-style-label", "text-style-secondary"), children: "Tool Choice" }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: /* @__PURE__ */ jsxRuntimeExports.jsx(ToolChoiceView, { toolChoice: toolChoice2 }) })
        ] })
      ] });
    };
    const ToolChoiceView = ({ toolChoice: toolChoice2 }) => {
      if (typeof toolChoice2 === "string") {
        return toolChoice2;
      } else {
        return /* @__PURE__ */ jsxRuntimeExports.jsxs("code", { children: [
          "`$",
          toolChoice2.name,
          "()`"
        ] });
      }
    };
    const noMargin = "_noMargin_1a3fk_1";
    const code$2 = "_code_1a3fk_5";
    const sample = "_sample_1a3fk_10";
    const section$1 = "_section_1a3fk_14";
    const metadata = "_metadata_1a3fk_21";
    const styles$C = {
      noMargin,
      code: code$2,
      sample,
      section: section$1,
      metadata
    };
    const SampleInitEventView = ({
      eventNode,
      className: className2
    }) => {
      const event = eventNode.event;
      const stateObj = event.state;
      const sections = [];
      if (event.sample.files && Object.keys(event.sample.files).length > 0) {
        sections.push(
          /* @__PURE__ */ jsxRuntimeExports.jsx(EventSection, { title: "Files", children: Object.keys(event.sample.files).map((file) => {
            return /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: styles$C.noMargin, children: file }, `sample-init-file-${file}`);
          }) }, `event-${eventNode.id}`)
        );
      }
      if (event.sample.setup) {
        sections.push(
          /* @__PURE__ */ jsxRuntimeExports.jsx(EventSection, { title: "Setup", children: /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: styles$C.code, children: /* @__PURE__ */ jsxRuntimeExports.jsx("code", { className: "sourceCode", children: event.sample.setup }) }) }, `${eventNode.id}-section-setup`)
        );
      }
      return /* @__PURE__ */ jsxRuntimeExports.jsxs(
        EventPanel,
        {
          eventNodeId: eventNode.id,
          depth: eventNode.depth,
          className: className2,
          title: "Sample",
          icon: ApplicationIcons.sample,
          subTitle: formatDateTime(new Date(event.timestamp)),
          children: [
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { "data-name": "Sample", className: styles$C.sample, children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx(
                ChatView,
                {
                  messages: stateObj["messages"],
                  allowLinking: false
                }
              ),
              /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
                event.sample.choices ? event.sample.choices.map((choice, index) => {
                  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
                    String.fromCharCode(65 + index),
                    ") ",
                    choice
                  ] }, `$choice-{choice}`);
                }) : "",
                sections.length > 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$C.section, children: sections }) : "",
                event.sample.target ? /* @__PURE__ */ jsxRuntimeExports.jsx(EventSection, { title: "Target", children: toArray(event.sample.target).map((target2) => {
                  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx("text-size-base"), children: target2 }, target2);
                }) }) : void 0
              ] })
            ] }),
            event.sample.metadata && Object.keys(event.sample.metadata).length > 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx(
              MetaDataGrid,
              {
                "data-name": "Metadata",
                className: styles$C.metadata,
                entries: event.sample.metadata
              }
            ) : ""
          ]
        }
      );
    };
    const SampleLimitEventView = ({
      eventNode,
      className: className2
    }) => {
      const resolve_title = (type) => {
        switch (type) {
          case "custom":
            return "Custom Limit Exceeded";
          case "time":
            return "Time Limit Exceeded";
          case "message":
            return "Message Limit Exceeded";
          case "token":
            return "Token Limit Exceeded";
          case "operator":
            return "Operator Canceled";
          case "working":
            return "Execution Time Limit Exceeded";
        }
      };
      const resolve_icon = (type) => {
        switch (type) {
          case "custom":
            return ApplicationIcons.limits.custom;
          case "time":
            return ApplicationIcons.limits.time;
          case "message":
            return ApplicationIcons.limits.messages;
          case "token":
            return ApplicationIcons.limits.tokens;
          case "operator":
            return ApplicationIcons.limits.operator;
          case "working":
            return ApplicationIcons.limits.execution;
        }
      };
      const title2 = resolve_title(eventNode.event.type);
      const icon2 = resolve_icon(eventNode.event.type);
      return /* @__PURE__ */ jsxRuntimeExports.jsx(
        EventPanel,
        {
          eventNodeId: eventNode.id,
          depth: eventNode.depth,
          title: title2,
          subTitle: formatDateTime(new Date(eventNode.event.timestamp)),
          icon: icon2,
          className: className2,
          children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx("text-size-smaller"), children: eventNode.event.message })
        }
      );
    };
    const twoColumn = "_twoColumn_1irga_9";
    const exec = "_exec_1irga_15";
    const result = "_result_1irga_19";
    const fileLabel = "_fileLabel_1irga_23";
    const wrapPre = "_wrapPre_1irga_28";
    const styles$B = {
      twoColumn,
      exec,
      result,
      fileLabel,
      wrapPre
    };
    const SandboxEventView = ({
      eventNode,
      className: className2
    }) => {
      const event = eventNode.event;
      return /* @__PURE__ */ jsxRuntimeExports.jsx(
        EventPanel,
        {
          eventNodeId: eventNode.id,
          depth: eventNode.depth,
          className: className2,
          title: `Sandbox: ${event.action}`,
          icon: ApplicationIcons.sandbox,
          subTitle: formatTiming(event.timestamp, event.working_start),
          children: event.action === "exec" ? /* @__PURE__ */ jsxRuntimeExports.jsx(ExecView, { id: `${eventNode.id}-exec`, event }) : event.action === "read_file" ? /* @__PURE__ */ jsxRuntimeExports.jsx(ReadFileView, { id: `${eventNode.id}-read-file`, event }) : /* @__PURE__ */ jsxRuntimeExports.jsx(WriteFileView, { id: `${eventNode.id}-write-file`, event })
        }
      );
    };
    const ExecView = ({ id, event }) => {
      if (event.cmd === null) {
        return void 0;
      }
      const cmd2 = event.cmd;
      const options2 = event.options;
      const input2 = event.input;
      const result2 = event.result;
      const output2 = event.output ? event.output.trim() : void 0;
      return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$B.exec), children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(EventSection, { title: `Command`, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$B.twoColumn), children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: clsx(styles$B.wrapPre), children: cmd2 }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: clsx(styles$B.wrapPre), children: input2 !== null ? input2?.trim() : void 0 }),
          options2 !== null && Object.keys(options2).length > 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx(EventSection, { title: `Options`, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
            MetaDataGrid,
            {
              entries: options2,
              plain: true
            }
          ) }) : void 0
        ] }) }),
        output2 || result2 !== null && result2 !== 0 ? /* @__PURE__ */ jsxRuntimeExports.jsxs(EventSection, { title: `Result`, children: [
          output2 ? /* @__PURE__ */ jsxRuntimeExports.jsx(ExpandablePanel, { id: `${id}-output`, collapse: false, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
            RenderedContent,
            {
              id: `${id}-output-content`,
              entry: { name: "sandbox_output", value: output2 }
            }
          ) }) : void 0,
          result2 !== 0 ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$B.result, "text-size-base"), children: [
            "(exited with code ",
            result2,
            ")"
          ] }) : void 0
        ] }) : void 0
      ] });
    };
    const ReadFileView = ({ id, event }) => {
      if (event.file === null) {
        return void 0;
      }
      const file = event.file;
      const output2 = event.output;
      return /* @__PURE__ */ jsxRuntimeExports.jsx(FileView, { id, file, contents: output2?.trim() });
    };
    const WriteFileView = ({ id, event }) => {
      if (event.file === null) {
        return void 0;
      }
      const file = event.file;
      const input2 = event.input;
      return /* @__PURE__ */ jsxRuntimeExports.jsx(FileView, { id, file, contents: input2?.trim() });
    };
    const FileView = ({ id, file, contents: contents2 }) => {
      return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(EventSection, { title: "File", children: /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: clsx(styles$B.fileLabel), children: file }) }),
        contents2 ? /* @__PURE__ */ jsxRuntimeExports.jsx(EventSection, { title: "Contents", children: /* @__PURE__ */ jsxRuntimeExports.jsx(ExpandablePanel, { id: `${id}-file`, collapse: false, children: /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { children: contents2 }) }) }) : void 0
      ] });
    };
    const explanation = "_explanation_1k2k0_1";
    const wrappingContent$1 = "_wrappingContent_1k2k0_8";
    const separator$1 = "_separator_1k2k0_13";
    const styles$A = {
      explanation,
      wrappingContent: wrappingContent$1,
      separator: separator$1
    };
    const ScoreEventView = ({
      eventNode,
      className: className2
    }) => {
      const event = eventNode.event;
      const resolvedTarget = event.target ? Array.isArray(event.target) ? event.target.join("\n") : event.target : void 0;
      return /* @__PURE__ */ jsxRuntimeExports.jsxs(
        EventPanel,
        {
          eventNodeId: eventNode.id,
          depth: eventNode.depth,
          title: (event.intermediate ? "Intermediate " : "") + "Score",
          className: clsx(className2, "text-size-small"),
          subTitle: formatDateTime(new Date(event.timestamp)),
          icon: ApplicationIcons.scorer,
          collapsibleContent: true,
          children: [
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { "data-name": "Explanation", className: clsx(styles$A.explanation), children: [
              event.target ? /* @__PURE__ */ jsxRuntimeExports.jsxs(reactExports.Fragment, { children: [
                /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$A.separator) }),
                /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-style-label", children: "Target" }),
                /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: /* @__PURE__ */ jsxRuntimeExports.jsx(RenderedText, { markdown: resolvedTarget || "" }) })
              ] }) : "",
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$A.separator) }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-style-label", children: "Answer" }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$A.wrappingContent), children: /* @__PURE__ */ jsxRuntimeExports.jsx(RenderedText, { markdown: event.score.answer || "" }) }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$A.separator) }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-style-label", children: "Explanation" }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$A.wrappingContent), children: /* @__PURE__ */ jsxRuntimeExports.jsx(RenderedText, { markdown: event.score.explanation || "" }) }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$A.separator) }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-style-label", children: "Score" }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: renderScore(event.score.value) }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$A.separator) })
            ] }),
            event.score.metadata ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { "data-name": "Metadata", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
              RecordTree,
              {
                id: `${eventNode.id}-score-metadata`,
                record: event.score.metadata,
                className: styles$A.metadataTree,
                defaultExpandLevel: 0
              }
            ) }) : void 0
          ]
        }
      );
    };
    const renderScore = (value2) => {
      if (Array.isArray(value2)) {
        return value2.join(" ");
      } else if (typeof value2 === "object") {
        return /* @__PURE__ */ jsxRuntimeExports.jsx(MetaDataGrid, { entries: value2 });
      } else {
        return value2;
      }
    };
    function cloneRegExp(re2) {
      var _a2;
      const regexMatch = /^\/(.*)\/([gimyu]*)$/.exec(re2.toString());
      if (!regexMatch) {
        throw new Error("Invalid RegExp");
      }
      return new RegExp((_a2 = regexMatch[1]) !== null && _a2 !== void 0 ? _a2 : "", regexMatch[2]);
    }
    function clone(arg) {
      if (typeof arg !== "object") {
        return arg;
      }
      if (arg === null) {
        return null;
      }
      if (Array.isArray(arg)) {
        return arg.map(clone);
      }
      if (arg instanceof Date) {
        return new Date(arg.getTime());
      }
      if (arg instanceof RegExp) {
        return cloneRegExp(arg);
      }
      const cloned = {};
      for (const name2 in arg) {
        if (Object.prototype.hasOwnProperty.call(arg, name2)) {
          cloned[name2] = clone(arg[name2]);
        }
      }
      return cloned;
    }
    function assertNonEmptyArray(arr2, message2) {
      if (arr2.length === 0) {
        throw new Error("Expected a non-empty array");
      }
    }
    function assertArrayHasAtLeast2(arr2, message2) {
      if (arr2.length < 2) {
        throw new Error("Expected an array with at least 2 items");
      }
    }
    const lastNonEmpty = (arr2) => arr2[arr2.length - 1];
    class Context {
      setResult(result2) {
        this.result = result2;
        this.hasResult = true;
        return this;
      }
      exit() {
        this.exiting = true;
        return this;
      }
      push(child, name2) {
        child.parent = this;
        if (typeof name2 !== "undefined") {
          child.childName = name2;
        }
        child.root = this.root || this;
        child.options = child.options || this.options;
        if (!this.children) {
          this.children = [child];
          this.nextAfterChildren = this.next || null;
          this.next = child;
        } else {
          assertNonEmptyArray(this.children);
          lastNonEmpty(this.children).next = child;
          this.children.push(child);
        }
        child.next = this;
        return this;
      }
    }
    class DiffContext extends Context {
      constructor(left2, right2) {
        super();
        this.left = left2;
        this.right = right2;
        this.pipe = "diff";
      }
      prepareDeltaResult(result2) {
        var _a2, _b2, _c, _d;
        if (typeof result2 === "object") {
          if (((_a2 = this.options) === null || _a2 === void 0 ? void 0 : _a2.omitRemovedValues) && Array.isArray(result2) && result2.length > 1 && (result2.length === 2 || // modified
          result2[2] === 0 || // deleted
          result2[2] === 3)) {
            result2[0] = 0;
          }
          if ((_b2 = this.options) === null || _b2 === void 0 ? void 0 : _b2.cloneDiffValues) {
            const clone$1 = typeof ((_c = this.options) === null || _c === void 0 ? void 0 : _c.cloneDiffValues) === "function" ? (_d = this.options) === null || _d === void 0 ? void 0 : _d.cloneDiffValues : clone;
            if (typeof result2[0] === "object") {
              result2[0] = clone$1(result2[0]);
            }
            if (typeof result2[1] === "object") {
              result2[1] = clone$1(result2[1]);
            }
          }
        }
        return result2;
      }
      setResult(result2) {
        this.prepareDeltaResult(result2);
        return super.setResult(result2);
      }
    }
    class PatchContext extends Context {
      constructor(left2, delta2) {
        super();
        this.left = left2;
        this.delta = delta2;
        this.pipe = "patch";
      }
    }
    class ReverseContext extends Context {
      constructor(delta2) {
        super();
        this.delta = delta2;
        this.pipe = "reverse";
      }
    }
    class Pipe {
      constructor(name2) {
        this.name = name2;
        this.filters = [];
      }
      process(input2) {
        if (!this.processor) {
          throw new Error("add this pipe to a processor before using it");
        }
        const debug2 = this.debug;
        const length = this.filters.length;
        const context = input2;
        for (let index = 0; index < length; index++) {
          const filter = this.filters[index];
          if (!filter)
            continue;
          if (debug2) {
            this.log(`filter: ${filter.filterName}`);
          }
          filter(context);
          if (typeof context === "object" && context.exiting) {
            context.exiting = false;
            break;
          }
        }
        if (!context.next && this.resultCheck) {
          this.resultCheck(context);
        }
      }
      log(msg) {
        console.log(`[jsondiffpatch] ${this.name} pipe, ${msg}`);
      }
      append(...args2) {
        this.filters.push(...args2);
        return this;
      }
      prepend(...args2) {
        this.filters.unshift(...args2);
        return this;
      }
      indexOf(filterName) {
        if (!filterName) {
          throw new Error("a filter name is required");
        }
        for (let index = 0; index < this.filters.length; index++) {
          const filter = this.filters[index];
          if ((filter === null || filter === void 0 ? void 0 : filter.filterName) === filterName) {
            return index;
          }
        }
        throw new Error(`filter not found: ${filterName}`);
      }
      list() {
        return this.filters.map((f) => f.filterName);
      }
      after(filterName, ...params) {
        const index = this.indexOf(filterName);
        this.filters.splice(index + 1, 0, ...params);
        return this;
      }
      before(filterName, ...params) {
        const index = this.indexOf(filterName);
        this.filters.splice(index, 0, ...params);
        return this;
      }
      replace(filterName, ...params) {
        const index = this.indexOf(filterName);
        this.filters.splice(index, 1, ...params);
        return this;
      }
      remove(filterName) {
        const index = this.indexOf(filterName);
        this.filters.splice(index, 1);
        return this;
      }
      clear() {
        this.filters.length = 0;
        return this;
      }
      shouldHaveResult(should) {
        if (should === false) {
          this.resultCheck = null;
          return this;
        }
        if (this.resultCheck) {
          return this;
        }
        this.resultCheck = (context) => {
          if (!context.hasResult) {
            console.log(context);
            const error2 = new Error(`${this.name} failed`);
            error2.noResult = true;
            throw error2;
          }
        };
        return this;
      }
    }
    class Processor {
      constructor(options2) {
        this.selfOptions = options2 || {};
        this.pipes = {};
      }
      options(options2) {
        if (options2) {
          this.selfOptions = options2;
        }
        return this.selfOptions;
      }
      pipe(name2, pipeArg) {
        let pipe = pipeArg;
        if (typeof name2 === "string") {
          if (typeof pipe === "undefined") {
            return this.pipes[name2];
          }
          this.pipes[name2] = pipe;
        }
        if (name2 && name2.name) {
          pipe = name2;
          if (pipe.processor === this) {
            return pipe;
          }
          this.pipes[pipe.name] = pipe;
        }
        if (!pipe) {
          throw new Error(`pipe is not defined: ${name2}`);
        }
        pipe.processor = this;
        return pipe;
      }
      // eslint-disable-next-line @typescript-eslint/no-explicit-any
      process(input2, pipe) {
        let context = input2;
        context.options = this.options();
        let nextPipe = pipe || input2.pipe || "default";
        let lastPipe = void 0;
        while (nextPipe) {
          if (typeof context.nextAfterChildren !== "undefined") {
            context.next = context.nextAfterChildren;
            context.nextAfterChildren = null;
          }
          if (typeof nextPipe === "string") {
            nextPipe = this.pipe(nextPipe);
          }
          nextPipe.process(context);
          lastPipe = nextPipe;
          nextPipe = null;
          if (context) {
            if (context.next) {
              context = context.next;
              nextPipe = context.pipe || lastPipe;
            }
          }
        }
        return context.hasResult ? context.result : void 0;
      }
    }
    const defaultMatch = (array1, array2, index1, index2) => array1[index1] === array2[index2];
    const lengthMatrix = (array1, array2, match, context) => {
      var _a2, _b2, _c;
      const len1 = array1.length;
      const len2 = array2.length;
      let x2;
      let y;
      const matrix = new Array(len1 + 1);
      for (x2 = 0; x2 < len1 + 1; x2++) {
        const matrixNewRow = new Array(len2 + 1);
        for (y = 0; y < len2 + 1; y++) {
          matrixNewRow[y] = 0;
        }
        matrix[x2] = matrixNewRow;
      }
      matrix.match = match;
      for (x2 = 1; x2 < len1 + 1; x2++) {
        const matrixRowX = matrix[x2];
        if (matrixRowX === void 0) {
          throw new Error("LCS matrix row is undefined");
        }
        const matrixRowBeforeX = matrix[x2 - 1];
        if (matrixRowBeforeX === void 0) {
          throw new Error("LCS matrix row is undefined");
        }
        for (y = 1; y < len2 + 1; y++) {
          if (match(array1, array2, x2 - 1, y - 1, context)) {
            matrixRowX[y] = ((_a2 = matrixRowBeforeX[y - 1]) !== null && _a2 !== void 0 ? _a2 : 0) + 1;
          } else {
            matrixRowX[y] = Math.max((_b2 = matrixRowBeforeX[y]) !== null && _b2 !== void 0 ? _b2 : 0, (_c = matrixRowX[y - 1]) !== null && _c !== void 0 ? _c : 0);
          }
        }
      }
      return matrix;
    };
    const backtrack = (matrix, array1, array2, context) => {
      let index1 = array1.length;
      let index2 = array2.length;
      const subsequence = {
        sequence: [],
        indices1: [],
        indices2: []
      };
      while (index1 !== 0 && index2 !== 0) {
        if (matrix.match === void 0) {
          throw new Error("LCS matrix match function is undefined");
        }
        const sameLetter = matrix.match(array1, array2, index1 - 1, index2 - 1, context);
        if (sameLetter) {
          subsequence.sequence.unshift(array1[index1 - 1]);
          subsequence.indices1.unshift(index1 - 1);
          subsequence.indices2.unshift(index2 - 1);
          --index1;
          --index2;
        } else {
          const matrixRowIndex1 = matrix[index1];
          if (matrixRowIndex1 === void 0) {
            throw new Error("LCS matrix row is undefined");
          }
          const valueAtMatrixAbove = matrixRowIndex1[index2 - 1];
          if (valueAtMatrixAbove === void 0) {
            throw new Error("LCS matrix value is undefined");
          }
          const matrixRowBeforeIndex1 = matrix[index1 - 1];
          if (matrixRowBeforeIndex1 === void 0) {
            throw new Error("LCS matrix row is undefined");
          }
          const valueAtMatrixLeft = matrixRowBeforeIndex1[index2];
          if (valueAtMatrixLeft === void 0) {
            throw new Error("LCS matrix value is undefined");
          }
          if (valueAtMatrixAbove > valueAtMatrixLeft) {
            --index2;
          } else {
            --index1;
          }
        }
      }
      return subsequence;
    };
    const get = (array1, array2, match, context) => {
      const innerContext = context || {};
      const matrix = lengthMatrix(array1, array2, match || defaultMatch, innerContext);
      return backtrack(matrix, array1, array2, innerContext);
    };
    const lcs = {
      get
    };
    const ARRAY_MOVE = 3;
    function arraysHaveMatchByRef(array1, array2, len1, len2) {
      for (let index1 = 0; index1 < len1; index1++) {
        const val1 = array1[index1];
        for (let index2 = 0; index2 < len2; index2++) {
          const val2 = array2[index2];
          if (index1 !== index2 && val1 === val2) {
            return true;
          }
        }
      }
      return false;
    }
    function matchItems(array1, array2, index1, index2, context) {
      const value1 = array1[index1];
      const value2 = array2[index2];
      if (value1 === value2) {
        return true;
      }
      if (typeof value1 !== "object" || typeof value2 !== "object") {
        return false;
      }
      const objectHash = context.objectHash;
      if (!objectHash) {
        return context.matchByPosition && index1 === index2;
      }
      context.hashCache1 = context.hashCache1 || [];
      let hash1 = context.hashCache1[index1];
      if (typeof hash1 === "undefined") {
        context.hashCache1[index1] = hash1 = objectHash(value1, index1);
      }
      if (typeof hash1 === "undefined") {
        return false;
      }
      context.hashCache2 = context.hashCache2 || [];
      let hash2 = context.hashCache2[index2];
      if (typeof hash2 === "undefined") {
        context.hashCache2[index2] = hash2 = objectHash(value2, index2);
      }
      if (typeof hash2 === "undefined") {
        return false;
      }
      return hash1 === hash2;
    }
    const diffFilter$3 = function arraysDiffFilter(context) {
      var _a2, _b2, _c, _d, _e2;
      if (!context.leftIsArray) {
        return;
      }
      const matchContext = {
        objectHash: (_a2 = context.options) === null || _a2 === void 0 ? void 0 : _a2.objectHash,
        matchByPosition: (_b2 = context.options) === null || _b2 === void 0 ? void 0 : _b2.matchByPosition
      };
      let commonHead = 0;
      let commonTail = 0;
      let index;
      let index1;
      let index2;
      const array1 = context.left;
      const array2 = context.right;
      const len1 = array1.length;
      const len2 = array2.length;
      let child;
      if (len1 > 0 && len2 > 0 && !matchContext.objectHash && typeof matchContext.matchByPosition !== "boolean") {
        matchContext.matchByPosition = !arraysHaveMatchByRef(array1, array2, len1, len2);
      }
      while (commonHead < len1 && commonHead < len2 && matchItems(array1, array2, commonHead, commonHead, matchContext)) {
        index = commonHead;
        child = new DiffContext(array1[index], array2[index]);
        context.push(child, index);
        commonHead++;
      }
      while (commonTail + commonHead < len1 && commonTail + commonHead < len2 && matchItems(array1, array2, len1 - 1 - commonTail, len2 - 1 - commonTail, matchContext)) {
        index1 = len1 - 1 - commonTail;
        index2 = len2 - 1 - commonTail;
        child = new DiffContext(array1[index1], array2[index2]);
        context.push(child, index2);
        commonTail++;
      }
      let result2;
      if (commonHead + commonTail === len1) {
        if (len1 === len2) {
          context.setResult(void 0).exit();
          return;
        }
        result2 = result2 || {
          _t: "a"
        };
        for (index = commonHead; index < len2 - commonTail; index++) {
          result2[index] = [array2[index]];
          context.prepareDeltaResult(result2[index]);
        }
        context.setResult(result2).exit();
        return;
      }
      if (commonHead + commonTail === len2) {
        result2 = result2 || {
          _t: "a"
        };
        for (index = commonHead; index < len1 - commonTail; index++) {
          const key2 = `_${index}`;
          result2[key2] = [array1[index], 0, 0];
          context.prepareDeltaResult(result2[key2]);
        }
        context.setResult(result2).exit();
        return;
      }
      matchContext.hashCache1 = void 0;
      matchContext.hashCache2 = void 0;
      const trimmed1 = array1.slice(commonHead, len1 - commonTail);
      const trimmed2 = array2.slice(commonHead, len2 - commonTail);
      const seq = lcs.get(trimmed1, trimmed2, matchItems, matchContext);
      const removedItems = [];
      result2 = result2 || {
        _t: "a"
      };
      for (index = commonHead; index < len1 - commonTail; index++) {
        if (seq.indices1.indexOf(index - commonHead) < 0) {
          const key2 = `_${index}`;
          result2[key2] = [array1[index], 0, 0];
          context.prepareDeltaResult(result2[key2]);
          removedItems.push(index);
        }
      }
      let detectMove = true;
      if (((_c = context.options) === null || _c === void 0 ? void 0 : _c.arrays) && context.options.arrays.detectMove === false) {
        detectMove = false;
      }
      let includeValueOnMove = false;
      if ((_e2 = (_d = context.options) === null || _d === void 0 ? void 0 : _d.arrays) === null || _e2 === void 0 ? void 0 : _e2.includeValueOnMove) {
        includeValueOnMove = true;
      }
      const removedItemsLength = removedItems.length;
      for (index = commonHead; index < len2 - commonTail; index++) {
        const indexOnArray2 = seq.indices2.indexOf(index - commonHead);
        if (indexOnArray2 < 0) {
          let isMove = false;
          if (detectMove && removedItemsLength > 0) {
            for (let removeItemIndex1 = 0; removeItemIndex1 < removedItemsLength; removeItemIndex1++) {
              index1 = removedItems[removeItemIndex1];
              const resultItem = index1 === void 0 ? void 0 : result2[`_${index1}`];
              if (index1 !== void 0 && resultItem && matchItems(trimmed1, trimmed2, index1 - commonHead, index - commonHead, matchContext)) {
                resultItem.splice(1, 2, index, ARRAY_MOVE);
                resultItem.splice(1, 2, index, ARRAY_MOVE);
                if (!includeValueOnMove) {
                  resultItem[0] = "";
                }
                index2 = index;
                child = new DiffContext(array1[index1], array2[index2]);
                context.push(child, index2);
                removedItems.splice(removeItemIndex1, 1);
                isMove = true;
                break;
              }
            }
          }
          if (!isMove) {
            result2[index] = [array2[index]];
            context.prepareDeltaResult(result2[index]);
          }
        } else {
          if (seq.indices1[indexOnArray2] === void 0) {
            throw new Error(`Invalid indexOnArray2: ${indexOnArray2}, seq.indices1: ${seq.indices1}`);
          }
          index1 = seq.indices1[indexOnArray2] + commonHead;
          if (seq.indices2[indexOnArray2] === void 0) {
            throw new Error(`Invalid indexOnArray2: ${indexOnArray2}, seq.indices2: ${seq.indices2}`);
          }
          index2 = seq.indices2[indexOnArray2] + commonHead;
          child = new DiffContext(array1[index1], array2[index2]);
          context.push(child, index2);
        }
      }
      context.setResult(result2).exit();
    };
    diffFilter$3.filterName = "arrays";
    const compare$1 = {
      numerically(a, b) {
        return a - b;
      },
      numericallyBy(name2) {
        return (a, b) => a[name2] - b[name2];
      }
    };
    const patchFilter$3 = function nestedPatchFilter(context) {
      var _a2;
      if (!context.nested) {
        return;
      }
      const nestedDelta = context.delta;
      if (nestedDelta._t !== "a") {
        return;
      }
      let index;
      let index1;
      const delta2 = nestedDelta;
      const array = context.left;
      let toRemove = [];
      let toInsert = [];
      const toModify = [];
      for (index in delta2) {
        if (index !== "_t") {
          if (index[0] === "_") {
            const removedOrMovedIndex = index;
            if (delta2[removedOrMovedIndex] !== void 0 && (delta2[removedOrMovedIndex][2] === 0 || delta2[removedOrMovedIndex][2] === ARRAY_MOVE)) {
              toRemove.push(Number.parseInt(index.slice(1), 10));
            } else {
              throw new Error(`only removal or move can be applied at original array indices, invalid diff type: ${(_a2 = delta2[removedOrMovedIndex]) === null || _a2 === void 0 ? void 0 : _a2[2]}`);
            }
          } else {
            const numberIndex = index;
            if (delta2[numberIndex].length === 1) {
              toInsert.push({
                index: Number.parseInt(numberIndex, 10),
                value: delta2[numberIndex][0]
              });
            } else {
              toModify.push({
                index: Number.parseInt(numberIndex, 10),
                delta: delta2[numberIndex]
              });
            }
          }
        }
      }
      toRemove = toRemove.sort(compare$1.numerically);
      for (index = toRemove.length - 1; index >= 0; index--) {
        index1 = toRemove[index];
        if (index1 === void 0)
          continue;
        const indexDiff = delta2[`_${index1}`];
        const removedValue = array.splice(index1, 1)[0];
        if ((indexDiff === null || indexDiff === void 0 ? void 0 : indexDiff[2]) === ARRAY_MOVE) {
          toInsert.push({
            index: indexDiff[1],
            value: removedValue
          });
        }
      }
      toInsert = toInsert.sort(compare$1.numericallyBy("index"));
      const toInsertLength = toInsert.length;
      for (index = 0; index < toInsertLength; index++) {
        const insertion = toInsert[index];
        if (insertion === void 0)
          continue;
        array.splice(insertion.index, 0, insertion.value);
      }
      const toModifyLength = toModify.length;
      if (toModifyLength > 0) {
        for (index = 0; index < toModifyLength; index++) {
          const modification = toModify[index];
          if (modification === void 0)
            continue;
          const child = new PatchContext(array[modification.index], modification.delta);
          context.push(child, modification.index);
        }
      }
      if (!context.children) {
        context.setResult(array).exit();
        return;
      }
      context.exit();
    };
    patchFilter$3.filterName = "arrays";
    const collectChildrenPatchFilter$1 = function collectChildrenPatchFilter2(context) {
      if (!context || !context.children) {
        return;
      }
      const deltaWithChildren = context.delta;
      if (deltaWithChildren._t !== "a") {
        return;
      }
      const array = context.left;
      const length = context.children.length;
      for (let index = 0; index < length; index++) {
        const child = context.children[index];
        if (child === void 0)
          continue;
        const arrayIndex = child.childName;
        array[arrayIndex] = child.result;
      }
      context.setResult(array).exit();
    };
    collectChildrenPatchFilter$1.filterName = "arraysCollectChildren";
    const reverseFilter$3 = function arraysReverseFilter(context) {
      if (!context.nested) {
        const nonNestedDelta = context.delta;
        if (nonNestedDelta[2] === ARRAY_MOVE) {
          const arrayMoveDelta = nonNestedDelta;
          context.newName = `_${arrayMoveDelta[1]}`;
          context.setResult([
            arrayMoveDelta[0],
            Number.parseInt(context.childName.substring(1), 10),
            ARRAY_MOVE
          ]).exit();
        }
        return;
      }
      const nestedDelta = context.delta;
      if (nestedDelta._t !== "a") {
        return;
      }
      const arrayDelta = nestedDelta;
      for (const name2 in arrayDelta) {
        if (name2 === "_t") {
          continue;
        }
        const child = new ReverseContext(arrayDelta[name2]);
        context.push(child, name2);
      }
      context.exit();
    };
    reverseFilter$3.filterName = "arrays";
    const reverseArrayDeltaIndex = (delta2, index, itemDelta) => {
      if (typeof index === "string" && index[0] === "_") {
        return Number.parseInt(index.substring(1), 10);
      }
      if (Array.isArray(itemDelta) && itemDelta[2] === 0) {
        return `_${index}`;
      }
      let reverseIndex = +index;
      for (const deltaIndex in delta2) {
        const deltaItem = delta2[deltaIndex];
        if (Array.isArray(deltaItem)) {
          if (deltaItem[2] === ARRAY_MOVE) {
            const moveFromIndex = Number.parseInt(deltaIndex.substring(1), 10);
            const moveToIndex = deltaItem[1];
            if (moveToIndex === +index) {
              return moveFromIndex;
            }
            if (moveFromIndex <= reverseIndex && moveToIndex > reverseIndex) {
              reverseIndex++;
            } else if (moveFromIndex >= reverseIndex && moveToIndex < reverseIndex) {
              reverseIndex--;
            }
          } else if (deltaItem[2] === 0) {
            const deleteIndex = Number.parseInt(deltaIndex.substring(1), 10);
            if (deleteIndex <= reverseIndex) {
              reverseIndex++;
            }
          } else if (deltaItem.length === 1 && Number.parseInt(deltaIndex, 10) <= reverseIndex) {
            reverseIndex--;
          }
        }
      }
      return reverseIndex;
    };
    const collectChildrenReverseFilter$1 = (context) => {
      if (!context || !context.children) {
        return;
      }
      const deltaWithChildren = context.delta;
      if (deltaWithChildren._t !== "a") {
        return;
      }
      const arrayDelta = deltaWithChildren;
      const length = context.children.length;
      const delta2 = {
        _t: "a"
      };
      for (let index = 0; index < length; index++) {
        const child = context.children[index];
        if (child === void 0)
          continue;
        let name2 = child.newName;
        if (typeof name2 === "undefined") {
          if (child.childName === void 0) {
            throw new Error("child.childName is undefined");
          }
          name2 = reverseArrayDeltaIndex(arrayDelta, child.childName, child.result);
        }
        if (delta2[name2] !== child.result) {
          delta2[name2] = child.result;
        }
      }
      context.setResult(delta2).exit();
    };
    collectChildrenReverseFilter$1.filterName = "arraysCollectChildren";
    const diffFilter$2 = function datesDiffFilter(context) {
      if (context.left instanceof Date) {
        if (context.right instanceof Date) {
          if (context.left.getTime() !== context.right.getTime()) {
            context.setResult([context.left, context.right]);
          } else {
            context.setResult(void 0);
          }
        } else {
          context.setResult([context.left, context.right]);
        }
        context.exit();
      } else if (context.right instanceof Date) {
        context.setResult([context.left, context.right]).exit();
      }
    };
    diffFilter$2.filterName = "dates";
    const collectChildrenDiffFilter = (context) => {
      if (!context || !context.children) {
        return;
      }
      const length = context.children.length;
      let result2 = context.result;
      for (let index = 0; index < length; index++) {
        const child = context.children[index];
        if (child === void 0)
          continue;
        if (typeof child.result === "undefined") {
          continue;
        }
        result2 = result2 || {};
        if (child.childName === void 0) {
          throw new Error("diff child.childName is undefined");
        }
        result2[child.childName] = child.result;
      }
      if (result2 && context.leftIsArray) {
        result2._t = "a";
      }
      context.setResult(result2).exit();
    };
    collectChildrenDiffFilter.filterName = "collectChildren";
    const objectsDiffFilter = (context) => {
      var _a2;
      if (context.leftIsArray || context.leftType !== "object") {
        return;
      }
      const left2 = context.left;
      const right2 = context.right;
      const propertyFilter = (_a2 = context.options) === null || _a2 === void 0 ? void 0 : _a2.propertyFilter;
      for (const name2 in left2) {
        if (!Object.prototype.hasOwnProperty.call(left2, name2)) {
          continue;
        }
        if (propertyFilter && !propertyFilter(name2, context)) {
          continue;
        }
        const child = new DiffContext(left2[name2], right2[name2]);
        context.push(child, name2);
      }
      for (const name2 in right2) {
        if (!Object.prototype.hasOwnProperty.call(right2, name2)) {
          continue;
        }
        if (propertyFilter && !propertyFilter(name2, context)) {
          continue;
        }
        if (typeof left2[name2] === "undefined") {
          const child = new DiffContext(void 0, right2[name2]);
          context.push(child, name2);
        }
      }
      if (!context.children || context.children.length === 0) {
        context.setResult(void 0).exit();
        return;
      }
      context.exit();
    };
    objectsDiffFilter.filterName = "objects";
    const patchFilter$2 = function nestedPatchFilter(context) {
      if (!context.nested) {
        return;
      }
      const nestedDelta = context.delta;
      if (nestedDelta._t) {
        return;
      }
      const objectDelta = nestedDelta;
      for (const name2 in objectDelta) {
        const child = new PatchContext(context.left[name2], objectDelta[name2]);
        context.push(child, name2);
      }
      context.exit();
    };
    patchFilter$2.filterName = "objects";
    const collectChildrenPatchFilter = function collectChildrenPatchFilter2(context) {
      if (!context || !context.children) {
        return;
      }
      const deltaWithChildren = context.delta;
      if (deltaWithChildren._t) {
        return;
      }
      const object = context.left;
      const length = context.children.length;
      for (let index = 0; index < length; index++) {
        const child = context.children[index];
        if (child === void 0)
          continue;
        const property2 = child.childName;
        if (Object.prototype.hasOwnProperty.call(context.left, property2) && child.result === void 0) {
          delete object[property2];
        } else if (object[property2] !== child.result) {
          object[property2] = child.result;
        }
      }
      context.setResult(object).exit();
    };
    collectChildrenPatchFilter.filterName = "collectChildren";
    const reverseFilter$2 = function nestedReverseFilter(context) {
      if (!context.nested) {
        return;
      }
      const nestedDelta = context.delta;
      if (nestedDelta._t) {
        return;
      }
      const objectDelta = context.delta;
      for (const name2 in objectDelta) {
        const child = new ReverseContext(objectDelta[name2]);
        context.push(child, name2);
      }
      context.exit();
    };
    reverseFilter$2.filterName = "objects";
    const collectChildrenReverseFilter = (context) => {
      if (!context || !context.children) {
        return;
      }
      const deltaWithChildren = context.delta;
      if (deltaWithChildren._t) {
        return;
      }
      const length = context.children.length;
      const delta2 = {};
      for (let index = 0; index < length; index++) {
        const child = context.children[index];
        if (child === void 0)
          continue;
        const property2 = child.childName;
        if (delta2[property2] !== child.result) {
          delta2[property2] = child.result;
        }
      }
      context.setResult(delta2).exit();
    };
    collectChildrenReverseFilter.filterName = "collectChildren";
    const TEXT_DIFF = 2;
    const DEFAULT_MIN_LENGTH = 60;
    let cachedDiffPatch = null;
    function getDiffMatchPatch(options2, required) {
      var _a2;
      if (!cachedDiffPatch) {
        let instance;
        if ((_a2 = options2 === null || options2 === void 0 ? void 0 : options2.textDiff) === null || _a2 === void 0 ? void 0 : _a2.diffMatchPatch) {
          instance = new options2.textDiff.diffMatchPatch();
        } else {
          if (!required) {
            return null;
          }
          const error2 = new Error("The diff-match-patch library was not provided. Pass the library in through the options or use the `jsondiffpatch/with-text-diffs` entry-point.");
          error2.diff_match_patch_not_found = true;
          throw error2;
        }
        cachedDiffPatch = {
          diff: (txt1, txt2) => instance.patch_toText(instance.patch_make(txt1, txt2)),
          patch: (txt1, patch) => {
            const results = instance.patch_apply(instance.patch_fromText(patch), txt1);
            for (const resultOk of results[1]) {
              if (!resultOk) {
                const error2 = new Error("text patch failed");
                error2.textPatchFailed = true;
                throw error2;
              }
            }
            return results[0];
          }
        };
      }
      return cachedDiffPatch;
    }
    const diffFilter$1 = function textsDiffFilter(context) {
      var _a2, _b2;
      if (context.leftType !== "string") {
        return;
      }
      const left2 = context.left;
      const right2 = context.right;
      const minLength = ((_b2 = (_a2 = context.options) === null || _a2 === void 0 ? void 0 : _a2.textDiff) === null || _b2 === void 0 ? void 0 : _b2.minLength) || DEFAULT_MIN_LENGTH;
      if (left2.length < minLength || right2.length < minLength) {
        context.setResult([left2, right2]).exit();
        return;
      }
      const diffMatchPatch = getDiffMatchPatch(context.options);
      if (!diffMatchPatch) {
        context.setResult([left2, right2]).exit();
        return;
      }
      const diff2 = diffMatchPatch.diff;
      context.setResult([diff2(left2, right2), 0, TEXT_DIFF]).exit();
    };
    diffFilter$1.filterName = "texts";
    const patchFilter$1 = function textsPatchFilter(context) {
      if (context.nested) {
        return;
      }
      const nonNestedDelta = context.delta;
      if (nonNestedDelta[2] !== TEXT_DIFF) {
        return;
      }
      const textDiffDelta = nonNestedDelta;
      const patch = getDiffMatchPatch(context.options, true).patch;
      context.setResult(patch(context.left, textDiffDelta[0])).exit();
    };
    patchFilter$1.filterName = "texts";
    const textDeltaReverse = (delta2) => {
      var _a2, _b2, _c;
      const headerRegex = /^@@ +-(\d+),(\d+) +\+(\d+),(\d+) +@@$/;
      const lines = delta2.split("\n");
      for (let i2 = 0; i2 < lines.length; i2++) {
        const line2 = lines[i2];
        if (line2 === void 0)
          continue;
        const lineStart = line2.slice(0, 1);
        if (lineStart === "@") {
          const header2 = headerRegex.exec(line2);
          if (header2 !== null) {
            const lineHeader = i2;
            lines[lineHeader] = `@@ -${header2[3]},${header2[4]} +${header2[1]},${header2[2]} @@`;
          }
        } else if (lineStart === "+") {
          lines[i2] = `-${(_a2 = lines[i2]) === null || _a2 === void 0 ? void 0 : _a2.slice(1)}`;
          if (((_b2 = lines[i2 - 1]) === null || _b2 === void 0 ? void 0 : _b2.slice(0, 1)) === "+") {
            const lineTmp = lines[i2];
            lines[i2] = lines[i2 - 1];
            lines[i2 - 1] = lineTmp;
          }
        } else if (lineStart === "-") {
          lines[i2] = `+${(_c = lines[i2]) === null || _c === void 0 ? void 0 : _c.slice(1)}`;
        }
      }
      return lines.join("\n");
    };
    const reverseFilter$1 = function textsReverseFilter(context) {
      if (context.nested) {
        return;
      }
      const nonNestedDelta = context.delta;
      if (nonNestedDelta[2] !== TEXT_DIFF) {
        return;
      }
      const textDiffDelta = nonNestedDelta;
      context.setResult([textDeltaReverse(textDiffDelta[0]), 0, TEXT_DIFF]).exit();
    };
    reverseFilter$1.filterName = "texts";
    const diffFilter = function trivialMatchesDiffFilter(context) {
      if (context.left === context.right) {
        context.setResult(void 0).exit();
        return;
      }
      if (typeof context.left === "undefined") {
        if (typeof context.right === "function") {
          throw new Error("functions are not supported");
        }
        context.setResult([context.right]).exit();
        return;
      }
      if (typeof context.right === "undefined") {
        context.setResult([context.left, 0, 0]).exit();
        return;
      }
      if (typeof context.left === "function" || typeof context.right === "function") {
        throw new Error("functions are not supported");
      }
      context.leftType = context.left === null ? "null" : typeof context.left;
      context.rightType = context.right === null ? "null" : typeof context.right;
      if (context.leftType !== context.rightType) {
        context.setResult([context.left, context.right]).exit();
        return;
      }
      if (context.leftType === "boolean" || context.leftType === "number") {
        context.setResult([context.left, context.right]).exit();
        return;
      }
      if (context.leftType === "object") {
        context.leftIsArray = Array.isArray(context.left);
      }
      if (context.rightType === "object") {
        context.rightIsArray = Array.isArray(context.right);
      }
      if (context.leftIsArray !== context.rightIsArray) {
        context.setResult([context.left, context.right]).exit();
        return;
      }
      if (context.left instanceof RegExp) {
        if (context.right instanceof RegExp) {
          context.setResult([context.left.toString(), context.right.toString()]).exit();
        } else {
          context.setResult([context.left, context.right]).exit();
        }
      }
    };
    diffFilter.filterName = "trivial";
    const patchFilter = function trivialMatchesPatchFilter(context) {
      if (typeof context.delta === "undefined") {
        context.setResult(context.left).exit();
        return;
      }
      context.nested = !Array.isArray(context.delta);
      if (context.nested) {
        return;
      }
      const nonNestedDelta = context.delta;
      if (nonNestedDelta.length === 1) {
        context.setResult(nonNestedDelta[0]).exit();
        return;
      }
      if (nonNestedDelta.length === 2) {
        if (context.left instanceof RegExp) {
          const regexArgs = /^\/(.*)\/([gimyu]+)$/.exec(nonNestedDelta[1]);
          if (regexArgs === null || regexArgs === void 0 ? void 0 : regexArgs[1]) {
            context.setResult(new RegExp(regexArgs[1], regexArgs[2])).exit();
            return;
          }
        }
        context.setResult(nonNestedDelta[1]).exit();
        return;
      }
      if (nonNestedDelta.length === 3 && nonNestedDelta[2] === 0) {
        context.setResult(void 0).exit();
      }
    };
    patchFilter.filterName = "trivial";
    const reverseFilter = function trivialReferseFilter(context) {
      if (typeof context.delta === "undefined") {
        context.setResult(context.delta).exit();
        return;
      }
      context.nested = !Array.isArray(context.delta);
      if (context.nested) {
        return;
      }
      const nonNestedDelta = context.delta;
      if (nonNestedDelta.length === 1) {
        context.setResult([nonNestedDelta[0], 0, 0]).exit();
        return;
      }
      if (nonNestedDelta.length === 2) {
        context.setResult([nonNestedDelta[1], nonNestedDelta[0]]).exit();
        return;
      }
      if (nonNestedDelta.length === 3 && nonNestedDelta[2] === 0) {
        context.setResult([nonNestedDelta[0]]).exit();
      }
    };
    reverseFilter.filterName = "trivial";
    class DiffPatcher {
      constructor(options2) {
        this.processor = new Processor(options2);
        this.processor.pipe(new Pipe("diff").append(collectChildrenDiffFilter, diffFilter, diffFilter$2, diffFilter$1, objectsDiffFilter, diffFilter$3).shouldHaveResult());
        this.processor.pipe(new Pipe("patch").append(collectChildrenPatchFilter, collectChildrenPatchFilter$1, patchFilter, patchFilter$1, patchFilter$2, patchFilter$3).shouldHaveResult());
        this.processor.pipe(new Pipe("reverse").append(collectChildrenReverseFilter, collectChildrenReverseFilter$1, reverseFilter, reverseFilter$1, reverseFilter$2, reverseFilter$3).shouldHaveResult());
      }
      options(options2) {
        return this.processor.options(options2);
      }
      diff(left2, right2) {
        return this.processor.process(new DiffContext(left2, right2));
      }
      patch(left2, delta2) {
        return this.processor.process(new PatchContext(left2, delta2));
      }
      reverse(delta2) {
        return this.processor.process(new ReverseContext(delta2));
      }
      unpatch(right2, delta2) {
        return this.patch(right2, this.reverse(delta2));
      }
      clone(value2) {
        return clone(value2);
      }
    }
    let defaultInstance$1;
    function diff$1(left2, right2) {
      if (!defaultInstance$1) {
        defaultInstance$1 = new DiffPatcher();
      }
      return defaultInstance$1.diff(left2, right2);
    }
    class BaseFormatter {
      format(delta2, left2) {
        const context = {};
        this.prepareContext(context);
        const preparedContext = context;
        this.recurse(preparedContext, delta2, left2);
        return this.finalize(preparedContext);
      }
      prepareContext(context) {
        context.buffer = [];
        context.out = function(...args2) {
          if (!this.buffer) {
            throw new Error("context buffer is not initialized");
          }
          this.buffer.push(...args2);
        };
      }
      typeFormattterNotFound(_context, deltaType) {
        throw new Error(`cannot format delta type: ${deltaType}`);
      }
      /* eslint-disable @typescript-eslint/no-unused-vars */
      typeFormattterErrorFormatter(_context, _err, _delta, _leftValue, _key, _leftKey, _movedFrom) {
      }
      /* eslint-enable @typescript-eslint/no-unused-vars */
      finalize({ buffer: buffer2 }) {
        if (Array.isArray(buffer2)) {
          return buffer2.join("");
        }
        return "";
      }
      recurse(context, delta2, left2, key2, leftKey, movedFrom, isLast) {
        const useMoveOriginHere = delta2 && movedFrom;
        const leftValue = useMoveOriginHere ? movedFrom.value : left2;
        if (typeof delta2 === "undefined" && typeof key2 === "undefined") {
          return void 0;
        }
        const type = this.getDeltaType(delta2, movedFrom);
        const nodeType = type === "node" ? delta2._t === "a" ? "array" : "object" : "";
        if (typeof key2 !== "undefined") {
          this.nodeBegin(context, key2, leftKey, type, nodeType, isLast !== null && isLast !== void 0 ? isLast : false);
        } else {
          this.rootBegin(context, type, nodeType);
        }
        let typeFormattter;
        try {
          typeFormattter = type !== "unknown" ? this[`format_${type}`] : this.typeFormattterNotFound(context, type);
          typeFormattter.call(this, context, delta2, leftValue, key2, leftKey, movedFrom);
        } catch (err2) {
          this.typeFormattterErrorFormatter(context, err2, delta2, leftValue, key2, leftKey, movedFrom);
          if (typeof console !== "undefined" && console.error) {
            console.error(err2.stack);
          }
        }
        if (typeof key2 !== "undefined") {
          this.nodeEnd(context, key2, leftKey, type, nodeType, isLast !== null && isLast !== void 0 ? isLast : false);
        } else {
          this.rootEnd(context, type, nodeType);
        }
      }
      formatDeltaChildren(context, delta2, left2) {
        this.forEachDeltaKey(delta2, left2, (key2, leftKey, movedFrom, isLast) => {
          this.recurse(context, delta2[key2], left2 ? left2[leftKey] : void 0, key2, leftKey, movedFrom, isLast);
        });
      }
      forEachDeltaKey(delta2, left2, fn2) {
        const keys = [];
        const arrayKeys = delta2._t === "a";
        if (!arrayKeys) {
          const deltaKeys = Object.keys(delta2);
          if (typeof left2 === "object" && left2 !== null) {
            keys.push(...Object.keys(left2));
          }
          for (const key2 of deltaKeys) {
            if (keys.indexOf(key2) >= 0)
              continue;
            keys.push(key2);
          }
          for (let index = 0; index < keys.length; index++) {
            const key2 = keys[index];
            if (key2 === void 0)
              continue;
            const isLast = index === keys.length - 1;
            fn2(
              // for object diff, the delta key and left key are the same
              key2,
              key2,
              // there's no "move" in object diff
              void 0,
              isLast
            );
          }
          return;
        }
        const movedFrom = {};
        for (const key2 in delta2) {
          if (Object.prototype.hasOwnProperty.call(delta2, key2)) {
            const value2 = delta2[key2];
            if (Array.isArray(value2) && value2[2] === 3) {
              const movedDelta = value2;
              movedFrom[movedDelta[1]] = Number.parseInt(key2.substring(1));
            }
          }
        }
        const arrayDelta = delta2;
        let leftIndex = 0;
        let rightIndex = 0;
        const leftArray = Array.isArray(left2) ? left2 : void 0;
        const leftLength = leftArray ? leftArray.length : (
          // if we don't have the original array,
          // use a length that ensures we'll go thru all delta keys
          Object.keys(arrayDelta).reduce((max2, key2) => {
            if (key2 === "_t")
              return max2;
            const isLeftKey = key2.substring(0, 1) === "_";
            if (isLeftKey) {
              const itemDelta = arrayDelta[key2];
              const leftIndex3 = Number.parseInt(key2.substring(1));
              const rightIndex3 = Array.isArray(itemDelta) && itemDelta.length >= 3 && itemDelta[2] === 3 ? itemDelta[1] : void 0;
              const maxIndex2 = Math.max(leftIndex3, rightIndex3 !== null && rightIndex3 !== void 0 ? rightIndex3 : 0);
              return maxIndex2 > max2 ? maxIndex2 : max2;
            }
            const rightIndex2 = Number.parseInt(key2);
            const leftIndex2 = movedFrom[rightIndex2];
            const maxIndex = Math.max(leftIndex2 !== null && leftIndex2 !== void 0 ? leftIndex2 : 0, rightIndex2 !== null && rightIndex2 !== void 0 ? rightIndex2 : 0);
            return maxIndex > max2 ? maxIndex : max2;
          }, 0) + 1
        );
        let rightLength = leftLength;
        let previousFnArgs;
        const addKey = (...args2) => {
          if (previousFnArgs) {
            fn2(...previousFnArgs);
          }
          previousFnArgs = args2;
        };
        const flushLastKey = () => {
          if (!previousFnArgs) {
            return;
          }
          fn2(previousFnArgs[0], previousFnArgs[1], previousFnArgs[2], true);
        };
        while (leftIndex < leftLength || rightIndex < rightLength || `${rightIndex}` in arrayDelta) {
          let hasDelta = false;
          const leftIndexKey = `_${leftIndex}`;
          const rightIndexKey = `${rightIndex}`;
          const movedFromIndex = rightIndex in movedFrom ? movedFrom[rightIndex] : void 0;
          if (leftIndexKey in arrayDelta) {
            hasDelta = true;
            const itemDelta = arrayDelta[leftIndexKey];
            addKey(leftIndexKey, movedFromIndex !== null && movedFromIndex !== void 0 ? movedFromIndex : leftIndex, movedFromIndex ? {
              key: `_${movedFromIndex}`,
              value: leftArray ? leftArray[movedFromIndex] : void 0
            } : void 0, false);
            if (Array.isArray(itemDelta)) {
              if (itemDelta[2] === 0) {
                rightLength--;
                leftIndex++;
              } else if (itemDelta[2] === 3) {
                leftIndex++;
              } else {
                leftIndex++;
              }
            } else {
              leftIndex++;
            }
          }
          if (rightIndexKey in arrayDelta) {
            hasDelta = true;
            const itemDelta = arrayDelta[rightIndexKey];
            const isItemAdded = Array.isArray(itemDelta) && itemDelta.length === 1;
            addKey(rightIndexKey, movedFromIndex !== null && movedFromIndex !== void 0 ? movedFromIndex : leftIndex, movedFromIndex ? {
              key: `_${movedFromIndex}`,
              value: leftArray ? leftArray[movedFromIndex] : void 0
            } : void 0, false);
            if (isItemAdded) {
              rightLength++;
              rightIndex++;
            } else if (movedFromIndex === void 0) {
              leftIndex++;
              rightIndex++;
            } else {
              rightIndex++;
            }
          }
          if (!hasDelta) {
            if (leftArray && movedFromIndex === void 0 || this.includeMoveDestinations !== false) {
              addKey(rightIndexKey, movedFromIndex !== null && movedFromIndex !== void 0 ? movedFromIndex : leftIndex, movedFromIndex ? {
                key: `_${movedFromIndex}`,
                value: leftArray ? leftArray[movedFromIndex] : void 0
              } : void 0, false);
            }
            if (movedFromIndex !== void 0) {
              rightIndex++;
            } else {
              leftIndex++;
              rightIndex++;
            }
          }
        }
        flushLastKey();
      }
      getDeltaType(delta2, movedFrom) {
        if (typeof delta2 === "undefined") {
          if (typeof movedFrom !== "undefined") {
            return "movedestination";
          }
          return "unchanged";
        }
        if (Array.isArray(delta2)) {
          if (delta2.length === 1) {
            return "added";
          }
          if (delta2.length === 2) {
            return "modified";
          }
          if (delta2.length === 3 && delta2[2] === 0) {
            return "deleted";
          }
          if (delta2.length === 3 && delta2[2] === 2) {
            return "textdiff";
          }
          if (delta2.length === 3 && delta2[2] === 3) {
            return "moved";
          }
        } else if (typeof delta2 === "object") {
          return "node";
        }
        return "unknown";
      }
      parseTextDiff(value2) {
        var _a2;
        const output2 = [];
        const lines = value2.split("\n@@ ");
        for (const line2 of lines) {
          const lineOutput = {
            pieces: []
          };
          const location2 = (_a2 = /^(?:@@ )?[-+]?(\d+),(\d+)/.exec(line2)) === null || _a2 === void 0 ? void 0 : _a2.slice(1);
          if (!location2) {
            throw new Error("invalid text diff format");
          }
          assertArrayHasAtLeast2(location2);
          lineOutput.location = {
            line: location2[0],
            chr: location2[1]
          };
          const pieces = line2.split("\n").slice(1);
          for (let pieceIndex = 0, piecesLength = pieces.length; pieceIndex < piecesLength; pieceIndex++) {
            const piece = pieces[pieceIndex];
            if (piece === void 0 || !piece.length) {
              continue;
            }
            const pieceOutput = {
              type: "context"
            };
            if (piece.substring(0, 1) === "+") {
              pieceOutput.type = "added";
            } else if (piece.substring(0, 1) === "-") {
              pieceOutput.type = "deleted";
            }
            pieceOutput.text = piece.slice(1);
            lineOutput.pieces.push(pieceOutput);
          }
          output2.push(lineOutput);
        }
        return output2;
      }
    }
    class HtmlFormatter extends BaseFormatter {
      typeFormattterErrorFormatter(context, err2) {
        const message2 = typeof err2 === "object" && err2 !== null && "message" in err2 && typeof err2.message === "string" ? err2.message : String(err2);
        context.out(`<pre class="jsondiffpatch-error">${htmlEscape(message2)}</pre>`);
      }
      formatValue(context, value2) {
        const valueAsHtml = typeof value2 === "undefined" ? "undefined" : htmlEscape(JSON.stringify(value2, null, 2));
        context.out(`<pre>${valueAsHtml}</pre>`);
      }
      formatTextDiffString(context, value2) {
        const lines = this.parseTextDiff(value2);
        context.out('<ul class="jsondiffpatch-textdiff">');
        for (let i2 = 0, l = lines.length; i2 < l; i2++) {
          const line2 = lines[i2];
          if (line2 === void 0)
            return;
          context.out(`<li><div class="jsondiffpatch-textdiff-location"><span class="jsondiffpatch-textdiff-line-number">${line2.location.line}</span><span class="jsondiffpatch-textdiff-char">${line2.location.chr}</span></div><div class="jsondiffpatch-textdiff-line">`);
          const pieces = line2.pieces;
          for (let pieceIndex = 0, piecesLength = pieces.length; pieceIndex < piecesLength; pieceIndex++) {
            const piece = pieces[pieceIndex];
            if (piece === void 0)
              return;
            context.out(`<span class="jsondiffpatch-textdiff-${piece.type}">${htmlEscape(decodeURI(piece.text))}</span>`);
          }
          context.out("</div></li>");
        }
        context.out("</ul>");
      }
      rootBegin(context, type, nodeType) {
        const nodeClass = `jsondiffpatch-${type}${nodeType ? ` jsondiffpatch-child-node-type-${nodeType}` : ""}`;
        context.out(`<div class="jsondiffpatch-delta ${nodeClass}">`);
      }
      rootEnd(context) {
        context.out(`</div>${context.hasArrows ? `<script type="text/javascript">setTimeout(${adjustArrows.toString()},10);<\/script>` : ""}`);
      }
      nodeBegin(context, key2, leftKey, type, nodeType) {
        const nodeClass = `jsondiffpatch-${type}${nodeType ? ` jsondiffpatch-child-node-type-${nodeType}` : ""}`;
        const label2 = typeof leftKey === "number" && key2.substring(0, 1) === "_" ? key2.substring(1) : key2;
        context.out(`<li class="${nodeClass}" data-key="${htmlEscape(key2)}"><div class="jsondiffpatch-property-name">${htmlEscape(label2)}</div>`);
      }
      nodeEnd(context) {
        context.out("</li>");
      }
      format_unchanged(context, _delta, left2) {
        if (typeof left2 === "undefined") {
          return;
        }
        context.out('<div class="jsondiffpatch-value">');
        this.formatValue(context, left2);
        context.out("</div>");
      }
      format_movedestination(context, _delta, left2) {
        if (typeof left2 === "undefined") {
          return;
        }
        context.out('<div class="jsondiffpatch-value">');
        this.formatValue(context, left2);
        context.out("</div>");
      }
      format_node(context, delta2, left2) {
        const nodeType = delta2._t === "a" ? "array" : "object";
        context.out(`<ul class="jsondiffpatch-node jsondiffpatch-node-type-${nodeType}">`);
        this.formatDeltaChildren(context, delta2, left2);
        context.out("</ul>");
      }
      format_added(context, delta2) {
        context.out('<div class="jsondiffpatch-value">');
        this.formatValue(context, delta2[0]);
        context.out("</div>");
      }
      format_modified(context, delta2) {
        context.out('<div class="jsondiffpatch-value jsondiffpatch-left-value">');
        this.formatValue(context, delta2[0]);
        context.out('</div><div class="jsondiffpatch-value jsondiffpatch-right-value">');
        this.formatValue(context, delta2[1]);
        context.out("</div>");
      }
      format_deleted(context, delta2) {
        context.out('<div class="jsondiffpatch-value">');
        this.formatValue(context, delta2[0]);
        context.out("</div>");
      }
      format_moved(context, delta2) {
        context.out('<div class="jsondiffpatch-value">');
        this.formatValue(context, delta2[0]);
        context.out(`</div><div class="jsondiffpatch-moved-destination">${delta2[1]}</div>`);
        context.out(
          /* jshint multistr: true */
          `<div class="jsondiffpatch-arrow" style="position: relative; left: -34px;">
          <svg width="30" height="60" style="position: absolute; display: none;">
          <defs>
              <marker id="markerArrow" markerWidth="8" markerHeight="8"
                 refx="2" refy="4" stroke="#88f"
                     orient="auto" markerUnits="userSpaceOnUse">
                  <path d="M1,1 L1,7 L7,4 L1,1" style="fill: #339;" />
              </marker>
          </defs>
          <path d="M30,0 Q-10,25 26,50"
            style="stroke: #88f; stroke-width: 2px; fill: none; stroke-opacity: 0.5; marker-end: url(#markerArrow);"
          ></path>
          </svg>
      </div>`
        );
        context.hasArrows = true;
      }
      format_textdiff(context, delta2) {
        context.out('<div class="jsondiffpatch-value">');
        this.formatTextDiffString(context, delta2[0]);
        context.out("</div>");
      }
    }
    function htmlEscape(value2) {
      if (typeof value2 === "number")
        return value2;
      let html2 = String(value2);
      const replacements = [
        [/&/g, "&amp;"],
        [/</g, "&lt;"],
        [/>/g, "&gt;"],
        [/'/g, "&apos;"],
        [/"/g, "&quot;"]
      ];
      for (const replacement of replacements) {
        html2 = html2.replace(replacement[0], replacement[1]);
      }
      return html2;
    }
    const adjustArrows = function jsondiffpatchHtmlFormatterAdjustArrows(nodeArg) {
      const node2 = nodeArg || document;
      const getElementText = ({ textContent, innerText }) => textContent || innerText;
      const eachByQuery = (el2, query2, fn2) => {
        const elems = el2.querySelectorAll(query2);
        for (let i2 = 0, l = elems.length; i2 < l; i2++) {
          fn2(elems[i2]);
        }
      };
      const eachChildren = ({ children: children2 }, fn2) => {
        for (let i2 = 0, l = children2.length; i2 < l; i2++) {
          const element = children2[i2];
          if (!element)
            continue;
          fn2(element, i2);
        }
      };
      eachByQuery(node2, ".jsondiffpatch-arrow", ({ parentNode, children: children2, style: style2 }) => {
        const arrowParent = parentNode;
        const svg2 = children2[0];
        const path = svg2.children[1];
        svg2.style.display = "none";
        const moveDestinationElem = arrowParent.querySelector(".jsondiffpatch-moved-destination");
        if (!(moveDestinationElem instanceof HTMLElement))
          return;
        const destination = getElementText(moveDestinationElem);
        const container2 = arrowParent.parentNode;
        if (!container2)
          return;
        let destinationElem;
        eachChildren(container2, (child) => {
          if (child.getAttribute("data-key") === destination) {
            destinationElem = child;
          }
        });
        if (!destinationElem) {
          return;
        }
        try {
          const distance = destinationElem.offsetTop - arrowParent.offsetTop;
          svg2.setAttribute("height", `${Math.abs(distance) + 6}`);
          style2.top = `${-8 + (distance > 0 ? 0 : distance)}px`;
          const curve = distance > 0 ? `M30,0 Q-10,${Math.round(distance / 2)} 26,${distance - 4}` : `M30,${-distance} Q-10,${Math.round(-distance / 2)} 26,4`;
          path.setAttribute("d", curve);
          svg2.style.display = "";
        } catch (err2) {
          console.debug(`[jsondiffpatch] error adjusting arrows: ${err2}`);
        }
      });
    };
    let defaultInstance;
    function format(delta2, left2) {
      if (!defaultInstance) {
        defaultInstance = new HtmlFormatter();
      }
      return defaultInstance.format(delta2, left2);
    }
    const StateDiffView = ({
      before,
      after,
      className: className2
    }) => {
      const state_diff = diff$1(sanitizeKeys(before), sanitizeKeys(after));
      const html_result = format(state_diff) || "Unable to render differences";
      return /* @__PURE__ */ jsxRuntimeExports.jsx(
        "div",
        {
          dangerouslySetInnerHTML: { __html: unescapeNewlines(html_result) },
          className: clsx(className2)
        }
      );
    };
    function unescapeNewlines(obj) {
      if (typeof obj === "string") {
        return obj.replace(/\\n/g, "\n");
      }
      if (obj === null || typeof obj !== "object") {
        return obj;
      }
      if (Array.isArray(obj)) {
        return obj.map((item2) => unescapeNewlines(item2));
      }
      return Object.fromEntries(
        Object.entries(obj).map(([key2, value2]) => [
          key2,
          unescapeNewlines(value2)
        ])
      );
    }
    function sanitizeKeys(obj) {
      if (typeof obj !== "object" || obj === null) {
        return obj;
      }
      if (Array.isArray(obj)) {
        return obj.map((item2) => sanitizeKeys(item2));
      }
      return Object.fromEntries(
        Object.entries(obj).map(([key2, value2]) => [
          key2.replace(/</g, "&lt;").replace(/>/g, "&gt;"),
          sanitizeKeys(value2)
        ])
      );
    }
    function parseNpt(time) {
      if (typeof time === "number") {
        return time;
      } else if (typeof time === "string") {
        return time.split(":").reverse().map(parseFloat).reduce((sum2, n, i2) => sum2 + n * Math.pow(60, i2));
      } else {
        return void 0;
      }
    }
    function debounce(f, delay) {
      let timeout;
      return function() {
        for (var _len = arguments.length, args2 = new Array(_len), _key = 0; _key < _len; _key++) {
          args2[_key] = arguments[_key];
        }
        clearTimeout(timeout);
        timeout = setTimeout(() => f.apply(this, args2), delay);
      };
    }
    function throttle(f, interval) {
      let enableCall = true;
      return function() {
        if (!enableCall) return;
        enableCall = false;
        for (var _len2 = arguments.length, args2 = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
          args2[_key2] = arguments[_key2];
        }
        f.apply(this, args2);
        setTimeout(() => enableCall = true, interval);
      };
    }
    class DummyLogger {
      log() {
      }
      debug() {
      }
      info() {
      }
      warn() {
      }
      error() {
      }
    }
    class PrefixedLogger {
      constructor(logger, prefix) {
        this.logger = logger;
        this.prefix = prefix;
      }
      log(message2) {
        for (var _len = arguments.length, args2 = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
          args2[_key - 1] = arguments[_key];
        }
        this.logger.log(`${this.prefix}${message2}`, ...args2);
      }
      debug(message2) {
        for (var _len2 = arguments.length, args2 = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
          args2[_key2 - 1] = arguments[_key2];
        }
        this.logger.debug(`${this.prefix}${message2}`, ...args2);
      }
      info(message2) {
        for (var _len3 = arguments.length, args2 = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
          args2[_key3 - 1] = arguments[_key3];
        }
        this.logger.info(`${this.prefix}${message2}`, ...args2);
      }
      warn(message2) {
        for (var _len4 = arguments.length, args2 = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {
          args2[_key4 - 1] = arguments[_key4];
        }
        this.logger.warn(`${this.prefix}${message2}`, ...args2);
      }
      error(message2) {
        for (var _len5 = arguments.length, args2 = new Array(_len5 > 1 ? _len5 - 1 : 0), _key5 = 1; _key5 < _len5; _key5++) {
          args2[_key5 - 1] = arguments[_key5];
        }
        this.logger.error(`${this.prefix}${message2}`, ...args2);
      }
    }
    let wasm;
    function addHeapObject(obj) {
      if (heap_next === heap.length) heap.push(heap.length + 1);
      const idx = heap_next;
      heap_next = heap[idx];
      heap[idx] = obj;
      return idx;
    }
    function debugString(val) {
      const type = typeof val;
      if (type == "number" || type == "boolean" || val == null) {
        return `${val}`;
      }
      if (type == "string") {
        return `"${val}"`;
      }
      if (type == "symbol") {
        const description2 = val.description;
        if (description2 == null) {
          return "Symbol";
        } else {
          return `Symbol(${description2})`;
        }
      }
      if (type == "function") {
        const name2 = val.name;
        if (typeof name2 == "string" && name2.length > 0) {
          return `Function(${name2})`;
        } else {
          return "Function";
        }
      }
      if (Array.isArray(val)) {
        const length = val.length;
        let debug2 = "[";
        if (length > 0) {
          debug2 += debugString(val[0]);
        }
        for (let i2 = 1; i2 < length; i2++) {
          debug2 += ", " + debugString(val[i2]);
        }
        debug2 += "]";
        return debug2;
      }
      const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
      let className2;
      if (builtInMatches && builtInMatches.length > 1) {
        className2 = builtInMatches[1];
      } else {
        return toString.call(val);
      }
      if (className2 == "Object") {
        try {
          return "Object(" + JSON.stringify(val) + ")";
        } catch (_) {
          return "Object";
        }
      }
      if (val instanceof Error) {
        return `${val.name}: ${val.message}
${val.stack}`;
      }
      return className2;
    }
    function dropObject(idx) {
      if (idx < 132) return;
      heap[idx] = heap_next;
      heap_next = idx;
    }
    function getArrayU32FromWasm0(ptr, len) {
      ptr = ptr >>> 0;
      return getUint32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len);
    }
    let cachedDataViewMemory0 = null;
    function getDataViewMemory0() {
      if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || cachedDataViewMemory0.buffer.detached === void 0 && cachedDataViewMemory0.buffer !== wasm.memory.buffer) {
        cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
      }
      return cachedDataViewMemory0;
    }
    function getStringFromWasm0(ptr, len) {
      ptr = ptr >>> 0;
      return decodeText(ptr, len);
    }
    let cachedUint32ArrayMemory0 = null;
    function getUint32ArrayMemory0() {
      if (cachedUint32ArrayMemory0 === null || cachedUint32ArrayMemory0.byteLength === 0) {
        cachedUint32ArrayMemory0 = new Uint32Array(wasm.memory.buffer);
      }
      return cachedUint32ArrayMemory0;
    }
    let cachedUint8ArrayMemory0 = null;
    function getUint8ArrayMemory0() {
      if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
        cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
      }
      return cachedUint8ArrayMemory0;
    }
    function getObject(idx) {
      return heap[idx];
    }
    let heap = new Array(128).fill(void 0);
    heap.push(void 0, null, true, false);
    let heap_next = heap.length;
    function passStringToWasm0(arg, malloc, realloc) {
      if (realloc === void 0) {
        const buf = cachedTextEncoder.encode(arg);
        const ptr2 = malloc(buf.length, 1) >>> 0;
        getUint8ArrayMemory0().subarray(ptr2, ptr2 + buf.length).set(buf);
        WASM_VECTOR_LEN = buf.length;
        return ptr2;
      }
      let len = arg.length;
      let ptr = malloc(len, 1) >>> 0;
      const mem = getUint8ArrayMemory0();
      let offset2 = 0;
      for (; offset2 < len; offset2++) {
        const code2 = arg.charCodeAt(offset2);
        if (code2 > 127) break;
        mem[ptr + offset2] = code2;
      }
      if (offset2 !== len) {
        if (offset2 !== 0) {
          arg = arg.slice(offset2);
        }
        ptr = realloc(ptr, len, len = offset2 + arg.length * 3, 1) >>> 0;
        const view = getUint8ArrayMemory0().subarray(ptr + offset2, ptr + len);
        const ret = cachedTextEncoder.encodeInto(arg, view);
        offset2 += ret.written;
        ptr = realloc(ptr, len, offset2, 1) >>> 0;
      }
      WASM_VECTOR_LEN = offset2;
      return ptr;
    }
    function takeObject(idx) {
      const ret = getObject(idx);
      dropObject(idx);
      return ret;
    }
    let cachedTextDecoder = new TextDecoder("utf-8", {
      ignoreBOM: true,
      fatal: true
    });
    cachedTextDecoder.decode();
    const MAX_SAFARI_DECODE_BYTES = 2146435072;
    let numBytesDecoded = 0;
    function decodeText(ptr, len) {
      numBytesDecoded += len;
      if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
        cachedTextDecoder = new TextDecoder("utf-8", {
          ignoreBOM: true,
          fatal: true
        });
        cachedTextDecoder.decode();
        numBytesDecoded = len;
      }
      return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
    }
    const cachedTextEncoder = new TextEncoder();
    if (!("encodeInto" in cachedTextEncoder)) {
      cachedTextEncoder.encodeInto = function(arg, view) {
        const buf = cachedTextEncoder.encode(arg);
        view.set(buf);
        return {
          read: arg.length,
          written: buf.length
        };
      };
    }
    let WASM_VECTOR_LEN = 0;
    const VtFinalization = typeof FinalizationRegistry === "undefined" ? {
      register: () => {
      },
      unregister: () => {
      }
    } : new FinalizationRegistry((ptr) => wasm.__wbg_vt_free(ptr >>> 0, 1));
    class Vt {
      static __wrap(ptr) {
        ptr = ptr >>> 0;
        const obj = Object.create(Vt.prototype);
        obj.__wbg_ptr = ptr;
        VtFinalization.register(obj, obj.__wbg_ptr, obj);
        return obj;
      }
      __destroy_into_raw() {
        const ptr = this.__wbg_ptr;
        this.__wbg_ptr = 0;
        VtFinalization.unregister(this);
        return ptr;
      }
      free() {
        const ptr = this.__destroy_into_raw();
        wasm.__wbg_vt_free(ptr, 0);
      }
      /**
       * @param {string} s
       * @returns {any}
       */
      feed(s) {
        const ptr0 = passStringToWasm0(s, wasm.__wbindgen_export, wasm.__wbindgen_export2);
        const len0 = WASM_VECTOR_LEN;
        const ret = wasm.vt_feed(this.__wbg_ptr, ptr0, len0);
        return takeObject(ret);
      }
      /**
       * @param {number} cols
       * @param {number} rows
       * @returns {any}
       */
      resize(cols, rows) {
        const ret = wasm.vt_resize(this.__wbg_ptr, cols, rows);
        return takeObject(ret);
      }
      /**
       * @returns {Uint32Array}
       */
      getSize() {
        try {
          const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
          wasm.vt_getSize(retptr, this.__wbg_ptr);
          var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
          var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
          var v1 = getArrayU32FromWasm0(r0, r1).slice();
          wasm.__wbindgen_export3(r0, r1 * 4, 4);
          return v1;
        } finally {
          wasm.__wbindgen_add_to_stack_pointer(16);
        }
      }
      /**
       * @param {number} row
       * @param {boolean} cursor_on
       * @returns {any}
       */
      getLine(row2, cursor_on) {
        const ret = wasm.vt_getLine(this.__wbg_ptr, row2, cursor_on);
        return takeObject(ret);
      }
      /**
       * @returns {any}
       */
      getCursor() {
        const ret = wasm.vt_getCursor(this.__wbg_ptr);
        return takeObject(ret);
      }
    }
    if (Symbol.dispose) Vt.prototype[Symbol.dispose] = Vt.prototype.free;
    function create$1(cols, rows, scrollback_limit, bold_is_bright) {
      const ret = wasm.create(cols, rows, scrollback_limit, bold_is_bright);
      return Vt.__wrap(ret);
    }
    const EXPECTED_RESPONSE_TYPES = /* @__PURE__ */ new Set(["basic", "cors", "default"]);
    async function __wbg_load(module2, imports) {
      if (typeof Response === "function" && module2 instanceof Response) {
        if (typeof WebAssembly.instantiateStreaming === "function") {
          try {
            return await WebAssembly.instantiateStreaming(module2, imports);
          } catch (e) {
            const validResponse = module2.ok && EXPECTED_RESPONSE_TYPES.has(module2.type);
            if (validResponse && module2.headers.get("Content-Type") !== "application/wasm") {
              console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
            } else {
              throw e;
            }
          }
        }
        const bytes = await module2.arrayBuffer();
        return await WebAssembly.instantiate(bytes, imports);
      } else {
        const instance = await WebAssembly.instantiate(module2, imports);
        if (instance instanceof WebAssembly.Instance) {
          return {
            instance,
            module: module2
          };
        } else {
          return instance;
        }
      }
    }
    function __wbg_get_imports() {
      const imports = {};
      imports.wbg = {};
      imports.wbg.__wbg___wbindgen_debug_string_adfb662ae34724b6 = function(arg0, arg1) {
        const ret = debugString(getObject(arg1));
        const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
        const len1 = WASM_VECTOR_LEN;
        getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
        getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
      };
      imports.wbg.__wbg___wbindgen_throw_dd24417ed36fc46e = function(arg0, arg1) {
        throw new Error(getStringFromWasm0(arg0, arg1));
      };
      imports.wbg.__wbg_new_13317ed16189158e = function() {
        const ret = new Array();
        return addHeapObject(ret);
      };
      imports.wbg.__wbg_new_4ceb6a766bf78b04 = function() {
        const ret = new Object();
        return addHeapObject(ret);
      };
      imports.wbg.__wbg_set_3f1d0b984ed272ed = function(arg0, arg1, arg2) {
        getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
      };
      imports.wbg.__wbg_set_8b6a9a61e98a8881 = function(arg0, arg1, arg2) {
        getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
      };
      imports.wbg.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
        const ret = getStringFromWasm0(arg0, arg1);
        return addHeapObject(ret);
      };
      imports.wbg.__wbindgen_cast_4625c577ab2ec9ee = function(arg0) {
        const ret = BigInt.asUintN(64, arg0);
        return addHeapObject(ret);
      };
      imports.wbg.__wbindgen_cast_d6cd19b81560fd6e = function(arg0) {
        const ret = arg0;
        return addHeapObject(ret);
      };
      imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
        const ret = getObject(arg0);
        return addHeapObject(ret);
      };
      imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
        takeObject(arg0);
      };
      return imports;
    }
    function __wbg_finalize_init(instance, module2) {
      wasm = instance.exports;
      __wbg_init.__wbindgen_wasm_module = module2;
      cachedDataViewMemory0 = null;
      cachedUint32ArrayMemory0 = null;
      cachedUint8ArrayMemory0 = null;
      return wasm;
    }
    function initSync(module2) {
      if (wasm !== void 0) return wasm;
      if (typeof module2 !== "undefined") {
        if (Object.getPrototypeOf(module2) === Object.prototype) {
          ({
            module: module2
          } = module2);
        } else {
          console.warn("using deprecated parameters for `initSync()`; pass a single object instead");
        }
      }
      const imports = __wbg_get_imports();
      if (!(module2 instanceof WebAssembly.Module)) {
        module2 = new WebAssembly.Module(module2);
      }
      const instance = new WebAssembly.Instance(module2, imports);
      return __wbg_finalize_init(instance, module2);
    }
    async function __wbg_init(module_or_path) {
      if (wasm !== void 0) return wasm;
      if (typeof module_or_path !== "undefined") {
        if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
          ({
            module_or_path
          } = module_or_path);
        } else {
          console.warn("using deprecated parameters for the initialization function; pass a single object instead");
        }
      }
      const imports = __wbg_get_imports();
      if (typeof module_or_path === "string" || typeof Request === "function" && module_or_path instanceof Request || typeof URL === "function" && module_or_path instanceof URL) {
        module_or_path = fetch(module_or_path);
      }
      const {
        instance,
        module: module2
      } = await __wbg_load(await module_or_path, imports);
      return __wbg_finalize_init(instance, module2);
    }
    var exports = /* @__PURE__ */ Object.freeze({
      __proto__: null,
      Vt,
      create: create$1,
      default: __wbg_init,
      initSync
    });
    const base64codes = [62, 0, 0, 0, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 0, 0, 0, 0, 0, 0, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51];
    function getBase64Code(charCode) {
      return base64codes[charCode - 43];
    }
    function base64Decode(str2) {
      let missingOctets = str2.endsWith("==") ? 2 : str2.endsWith("=") ? 1 : 0;
      let n = str2.length;
      let result2 = new Uint8Array(3 * (n / 4));
      let buffer2;
      for (let i2 = 0, j = 0; i2 < n; i2 += 4, j += 3) {
        buffer2 = getBase64Code(str2.charCodeAt(i2)) << 18 | getBase64Code(str2.charCodeAt(i2 + 1)) << 12 | getBase64Code(str2.charCodeAt(i2 + 2)) << 6 | getBase64Code(str2.charCodeAt(i2 + 3));
        result2[j] = buffer2 >> 16;
        result2[j + 1] = buffer2 >> 8 & 255;
        result2[j + 2] = buffer2 & 255;
      }
      return result2.subarray(0, result2.length - missingOctets);
    }
    var vtWasmModule = base64Decode(" ");
    async function init(options2) {
      await __wbg_init({
        module_or_path: await options2.module,
        memory: options2.memory
      });
      return exports;
    }
    class Clock {
      constructor() {
        let speed = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 1;
        this.speed = speed;
        this.startTime = performance.now();
      }
      getTime() {
        return this.speed * (performance.now() - this.startTime) / 1e3;
      }
      setTime(time) {
        this.startTime = performance.now() - time / this.speed * 1e3;
      }
    }
    class NullClock {
      constructor() {
      }
      getTime(_speed) {
      }
      setTime(_time) {
      }
    }
    class Stream {
      constructor(input2, xfs) {
        this.input = typeof input2.next === "function" ? input2 : input2[Symbol.iterator]();
        this.xfs = xfs ?? [];
      }
      map(f) {
        return this.transform(Map$1(f));
      }
      flatMap(f) {
        return this.transform(FlatMap(f));
      }
      filter(f) {
        return this.transform(Filter(f));
      }
      take(n) {
        return this.transform(Take(n));
      }
      drop(n) {
        return this.transform(Drop(n));
      }
      transform(f) {
        return new Stream(this.input, this.xfs.concat([f]));
      }
      multiplex(other, comparator) {
        return new Stream(new Multiplexer(this[Symbol.iterator](), other[Symbol.iterator](), comparator));
      }
      toArray() {
        return Array.from(this);
      }
      [Symbol.iterator]() {
        let v = 0;
        let values = [];
        let flushed = false;
        const xf = compose(this.xfs, (val) => values.push(val));
        return {
          next: () => {
            if (v === values.length) {
              values = [];
              v = 0;
            }
            while (values.length === 0) {
              const next = this.input.next();
              if (next.done) {
                break;
              } else {
                xf.step(next.value);
              }
            }
            if (values.length === 0 && !flushed) {
              xf.flush();
              flushed = true;
            }
            if (values.length > 0) {
              return {
                done: false,
                value: values[v++]
              };
            } else {
              return {
                done: true
              };
            }
          }
        };
      }
    }
    function Map$1(f) {
      return (emit) => {
        return (input2) => {
          emit(f(input2));
        };
      };
    }
    function FlatMap(f) {
      return (emit) => {
        return (input2) => {
          f(input2).forEach(emit);
        };
      };
    }
    function Filter(f) {
      return (emit) => {
        return (input2) => {
          if (f(input2)) {
            emit(input2);
          }
        };
      };
    }
    function Take(n) {
      let c2 = 0;
      return (emit) => {
        return (input2) => {
          if (c2 < n) {
            emit(input2);
          }
          c2 += 1;
        };
      };
    }
    function Drop(n) {
      let c2 = 0;
      return (emit) => {
        return (input2) => {
          c2 += 1;
          if (c2 > n) {
            emit(input2);
          }
        };
      };
    }
    function compose(xfs, push2) {
      return xfs.reverse().reduce((next, curr) => {
        const xf = toXf(curr(next.step));
        return {
          step: xf.step,
          flush: () => {
            xf.flush();
            next.flush();
          }
        };
      }, toXf(push2));
    }
    function toXf(xf) {
      if (typeof xf === "function") {
        return {
          step: xf,
          flush: () => {
          }
        };
      } else {
        return xf;
      }
    }
    class Multiplexer {
      constructor(left2, right2, comparator) {
        this.left = left2;
        this.right = right2;
        this.comparator = comparator;
      }
      [Symbol.iterator]() {
        let leftItem;
        let rightItem;
        return {
          next: () => {
            if (leftItem === void 0 && this.left !== void 0) {
              const result2 = this.left.next();
              if (result2.done) {
                this.left = void 0;
              } else {
                leftItem = result2.value;
              }
            }
            if (rightItem === void 0 && this.right !== void 0) {
              const result2 = this.right.next();
              if (result2.done) {
                this.right = void 0;
              } else {
                rightItem = result2.value;
              }
            }
            if (leftItem === void 0 && rightItem === void 0) {
              return {
                done: true
              };
            } else if (leftItem === void 0) {
              const value2 = rightItem;
              rightItem = void 0;
              return {
                done: false,
                value: value2
              };
            } else if (rightItem === void 0) {
              const value2 = leftItem;
              leftItem = void 0;
              return {
                done: false,
                value: value2
              };
            } else if (this.comparator(leftItem, rightItem)) {
              const value2 = leftItem;
              leftItem = void 0;
              return {
                done: false,
                value: value2
              };
            } else {
              const value2 = rightItem;
              rightItem = void 0;
              return {
                done: false,
                value: value2
              };
            }
          }
        };
      }
    }
    async function parse$2(data) {
      if (data instanceof Response) {
        const text2 = await data.text();
        const result2 = parseJsonl(text2);
        if (result2 !== void 0) {
          const {
            header: header2,
            events
          } = result2;
          if (header2.version === 2) {
            return parseAsciicastV2(header2, events);
          } else if (header2.version === 3) {
            return parseAsciicastV3(header2, events);
          } else {
            throw new Error(`asciicast v${header2.version} format not supported`);
          }
        } else {
          const header2 = JSON.parse(text2);
          if (header2.version === 1) {
            return parseAsciicastV1(header2);
          }
        }
      } else if (typeof data === "object" && data.version === 1) {
        return parseAsciicastV1(data);
      } else if (Array.isArray(data)) {
        const header2 = data[0];
        if (header2.version === 2) {
          const events = data.slice(1, data.length);
          return parseAsciicastV2(header2, events);
        } else if (header2.version === 3) {
          const events = data.slice(1, data.length);
          return parseAsciicastV3(header2, events);
        } else {
          throw new Error(`asciicast v${header2.version} format not supported`);
        }
      }
      throw new Error("invalid data");
    }
    function parseJsonl(jsonl) {
      const lines = jsonl.split("\n");
      let header2;
      try {
        header2 = JSON.parse(lines[0]);
      } catch (_error2) {
        return;
      }
      const events = new Stream(lines).drop(1).filter((l) => l[0] === "[").map(JSON.parse);
      return {
        header: header2,
        events
      };
    }
    function parseAsciicastV1(data) {
      let time = 0;
      const events = new Stream(data.stdout).map((e) => {
        time += e[0];
        return [time, "o", e[1]];
      });
      return {
        cols: data.width,
        rows: data.height,
        events
      };
    }
    function parseAsciicastV2(header2, events) {
      return {
        cols: header2.width,
        rows: header2.height,
        theme: parseTheme$1(header2.theme),
        events,
        idleTimeLimit: header2.idle_time_limit
      };
    }
    function parseAsciicastV3(header2, events) {
      if (!(events instanceof Stream)) {
        events = new Stream(events);
      }
      let time = 0;
      events = events.map((e) => {
        time += e[0];
        return [time, e[1], e[2]];
      });
      return {
        cols: header2.term.cols,
        rows: header2.term.rows,
        theme: parseTheme$1(header2.term?.theme),
        events,
        idleTimeLimit: header2.idle_time_limit
      };
    }
    function parseTheme$1(theme2) {
      if (theme2 === void 0) return;
      const colorRegex = /^#[0-9A-Fa-f]{6}$/;
      const paletteRegex = /^(#[0-9A-Fa-f]{6}:){7,}#[0-9A-Fa-f]{6}$/;
      const fg = theme2?.fg;
      const bg = theme2?.bg;
      const palette = theme2?.palette;
      if (colorRegex.test(fg) && colorRegex.test(bg) && paletteRegex.test(palette)) {
        return {
          foreground: fg,
          background: bg,
          palette: palette.split(":")
        };
      }
    }
    function unparseAsciicastV2(recording2) {
      const header2 = JSON.stringify({
        version: 2,
        width: recording2.cols,
        height: recording2.rows
      });
      const events = recording2.events.map(JSON.stringify).join("\n");
      return `${header2}
${events}
`;
    }
    function recording(src, _ref, _ref2) {
      let {
        feed,
        resize,
        onInput,
        onMarker,
        setState: setState2,
        logger
      } = _ref;
      let {
        speed,
        idleTimeLimit,
        startAt,
        loop,
        posterTime,
        markers: markers_,
        pauseOnMarkers,
        cols: initialCols,
        rows: initialRows,
        audioUrl
      } = _ref2;
      let cols;
      let rows;
      let events;
      let markers;
      let duration;
      let effectiveStartAt;
      let eventTimeoutId;
      let nextEventIndex = 0;
      let lastEventTime = 0;
      let startTime;
      let pauseElapsedTime;
      let playCount = 0;
      let waitingForAudio = false;
      let waitingTimeout;
      let shouldResumeOnAudioPlaying = false;
      let now = () => performance.now() * speed;
      let audioCtx;
      let audioElement;
      let audioSeekable = false;
      async function init2() {
        const timeout = setTimeout(() => {
          setState2("loading");
        }, 3e3);
        try {
          let metadata2 = loadRecording(src, logger, {
            idleTimeLimit,
            startAt,
            markers_
          });
          const hasAudio = await loadAudio(audioUrl);
          metadata2 = await metadata2;
          return {
            ...metadata2,
            hasAudio
          };
        } finally {
          clearTimeout(timeout);
        }
      }
      async function loadRecording(src2, logger2, opts) {
        const {
          parser: parser2,
          minFrameTime,
          inputOffset,
          dumpFilename,
          encoding = "utf-8"
        } = src2;
        const data = await doFetch(src2);
        const recording2 = prepare(await parser2(data, {
          encoding
        }), logger2, {
          ...opts,
          minFrameTime,
          inputOffset
        });
        ({
          cols,
          rows,
          events,
          duration,
          effectiveStartAt
        } = recording2);
        initialCols = initialCols ?? cols;
        initialRows = initialRows ?? rows;
        if (events.length === 0) {
          throw new Error("recording is missing events");
        }
        if (dumpFilename !== void 0) {
          dump(recording2, dumpFilename);
        }
        const poster = posterTime !== void 0 ? getPoster(posterTime) : void 0;
        markers = events.filter((e) => e[1] === "m").map((e) => [e[0], e[2].label]);
        return {
          cols,
          rows,
          duration,
          theme: recording2.theme,
          poster,
          markers
        };
      }
      async function loadAudio(audioUrl2) {
        if (!audioUrl2) return false;
        audioElement = await createAudioElement(audioUrl2);
        audioSeekable = !Number.isNaN(audioElement.duration) && audioElement.duration !== Infinity && audioElement.seekable.length > 0 && audioElement.seekable.end(audioElement.seekable.length - 1) === audioElement.duration;
        if (audioSeekable) {
          audioElement.addEventListener("playing", onAudioPlaying);
          audioElement.addEventListener("waiting", onAudioWaiting);
        } else {
          logger.warn(`audio is not seekable - you must enable range request support on the server providing ${audioElement.src} for audio seeking to work`);
        }
        return true;
      }
      async function doFetch(_ref3) {
        let {
          url,
          data,
          fetchOpts = {}
        } = _ref3;
        if (typeof url === "string") {
          return await doFetchOne(url, fetchOpts);
        } else if (Array.isArray(url)) {
          return await Promise.all(url.map((url2) => doFetchOne(url2, fetchOpts)));
        } else if (data !== void 0) {
          if (typeof data === "function") {
            data = data();
          }
          if (!(data instanceof Promise)) {
            data = Promise.resolve(data);
          }
          const value2 = await data;
          if (typeof value2 === "string" || value2 instanceof ArrayBuffer) {
            return new Response(value2);
          } else {
            return value2;
          }
        } else {
          throw new Error("failed fetching recording file: url/data missing in src");
        }
      }
      async function doFetchOne(url, fetchOpts) {
        const response = await fetch(url, fetchOpts);
        if (!response.ok) {
          throw new Error(`failed fetching recording from ${url}: ${response.status} ${response.statusText}`);
        }
        return response;
      }
      function scheduleNextEvent() {
        const nextEvent = events[nextEventIndex];
        if (nextEvent) {
          eventTimeoutId = scheduleAt(runNextEvent, nextEvent[0]);
        } else {
          onEnd();
        }
      }
      function scheduleAt(f, targetTime) {
        let timeout = (targetTime * 1e3 - (now() - startTime)) / speed;
        if (timeout < 0) {
          timeout = 0;
        }
        return setTimeout(f, timeout);
      }
      function runNextEvent() {
        let event = events[nextEventIndex];
        let elapsedWallTime;
        do {
          lastEventTime = event[0];
          nextEventIndex++;
          const stop = executeEvent2(event);
          if (stop) {
            return;
          }
          event = events[nextEventIndex];
          elapsedWallTime = now() - startTime;
        } while (event && elapsedWallTime > event[0] * 1e3);
        scheduleNextEvent();
      }
      function cancelNextEvent() {
        clearTimeout(eventTimeoutId);
        eventTimeoutId = null;
      }
      function executeEvent2(event) {
        const [time, type, data] = event;
        if (type === "o") {
          feed(data);
        } else if (type === "i") {
          onInput(data);
        } else if (type === "r") {
          const [cols2, rows2] = data.split("x");
          resize(cols2, rows2);
        } else if (type === "m") {
          onMarker(data);
          if (pauseOnMarkers) {
            pause();
            pauseElapsedTime = time * 1e3;
            setState2("idle", {
              reason: "paused"
            });
            return true;
          }
        }
        return false;
      }
      function onEnd() {
        cancelNextEvent();
        playCount++;
        if (loop === true || typeof loop === "number" && playCount < loop) {
          nextEventIndex = 0;
          startTime = now();
          feed("\x1Bc");
          resizeTerminalToInitialSize();
          scheduleNextEvent();
          if (audioElement) {
            audioElement.currentTime = 0;
          }
        } else {
          pauseElapsedTime = duration * 1e3;
          setState2("ended");
          if (audioElement) {
            audioElement.pause();
          }
        }
      }
      async function play() {
        if (eventTimeoutId) throw new Error("already playing");
        if (events[nextEventIndex] === void 0) throw new Error("already ended");
        if (effectiveStartAt !== null) {
          seek(effectiveStartAt);
        }
        await resume();
        return true;
      }
      function pause() {
        shouldResumeOnAudioPlaying = false;
        if (audioElement) {
          audioElement.pause();
        }
        if (!eventTimeoutId) return true;
        cancelNextEvent();
        pauseElapsedTime = now() - startTime;
        return true;
      }
      async function resume() {
        if (audioElement && !audioCtx) setupAudioCtx();
        startTime = now() - pauseElapsedTime;
        pauseElapsedTime = null;
        scheduleNextEvent();
        if (audioElement) {
          await audioElement.play();
        }
      }
      async function seek(where) {
        if (waitingForAudio) {
          return false;
        }
        const isPlaying = !!eventTimeoutId;
        pause();
        if (audioElement) {
          audioElement.pause();
        }
        const currentTime = (pauseElapsedTime ?? 0) / 1e3;
        if (typeof where === "string") {
          if (where === "<<") {
            where = currentTime - 5;
          } else if (where === ">>") {
            where = currentTime + 5;
          } else if (where === "<<<") {
            where = currentTime - 0.1 * duration;
          } else if (where === ">>>") {
            where = currentTime + 0.1 * duration;
          } else if (where[where.length - 1] === "%") {
            where = parseFloat(where.substring(0, where.length - 1)) / 100 * duration;
          }
        } else if (typeof where === "object") {
          if (where.marker === "prev") {
            where = findMarkerTimeBefore(currentTime) ?? 0;
            if (isPlaying && currentTime - where < 1) {
              where = findMarkerTimeBefore(where) ?? 0;
            }
          } else if (where.marker === "next") {
            where = findMarkerTimeAfter(currentTime) ?? duration;
          } else if (typeof where.marker === "number") {
            const marker2 = markers[where.marker];
            if (marker2 === void 0) {
              throw new Error(`invalid marker index: ${where.marker}`);
            } else {
              where = marker2[0];
            }
          }
        }
        const targetTime = Math.min(Math.max(where, 0), duration);
        if (targetTime * 1e3 === pauseElapsedTime) return false;
        if (targetTime < lastEventTime) {
          feed("\x1Bc");
          resizeTerminalToInitialSize();
          nextEventIndex = 0;
          lastEventTime = 0;
        }
        let event = events[nextEventIndex];
        while (event && event[0] <= targetTime) {
          if (event[1] === "o" || event[1] === "r") {
            executeEvent2(event);
          }
          lastEventTime = event[0];
          event = events[++nextEventIndex];
        }
        pauseElapsedTime = targetTime * 1e3;
        effectiveStartAt = null;
        if (audioElement && audioSeekable) {
          audioElement.currentTime = targetTime / speed;
        }
        if (isPlaying) {
          await resume();
        } else if (events[nextEventIndex] === void 0) {
          onEnd();
        }
        return true;
      }
      function findMarkerTimeBefore(time) {
        if (markers.length == 0) return;
        let i2 = 0;
        let marker2 = markers[i2];
        let lastMarkerTimeBefore;
        while (marker2 && marker2[0] < time) {
          lastMarkerTimeBefore = marker2[0];
          marker2 = markers[++i2];
        }
        return lastMarkerTimeBefore;
      }
      function findMarkerTimeAfter(time) {
        if (markers.length == 0) return;
        let i2 = markers.length - 1;
        let marker2 = markers[i2];
        let firstMarkerTimeAfter;
        while (marker2 && marker2[0] > time) {
          firstMarkerTimeAfter = marker2[0];
          marker2 = markers[--i2];
        }
        return firstMarkerTimeAfter;
      }
      function step(n) {
        if (n === void 0) {
          n = 1;
        }
        let nextEvent;
        let targetIndex;
        if (n > 0) {
          let index = nextEventIndex;
          nextEvent = events[index];
          for (let i2 = 0; i2 < n; i2++) {
            while (nextEvent !== void 0 && nextEvent[1] !== "o") {
              nextEvent = events[++index];
            }
            if (nextEvent !== void 0 && nextEvent[1] === "o") {
              targetIndex = index;
            }
          }
        } else {
          let index = Math.max(nextEventIndex - 2, 0);
          nextEvent = events[index];
          for (let i2 = n; i2 < 0; i2++) {
            while (nextEvent !== void 0 && nextEvent[1] !== "o") {
              nextEvent = events[--index];
            }
            if (nextEvent !== void 0 && nextEvent[1] === "o") {
              targetIndex = index;
            }
          }
          if (targetIndex !== void 0) {
            feed("\x1Bc");
            resizeTerminalToInitialSize();
            nextEventIndex = 0;
          }
        }
        if (targetIndex === void 0) return;
        while (nextEventIndex <= targetIndex) {
          nextEvent = events[nextEventIndex++];
          if (nextEvent[1] === "o" || nextEvent[1] === "r") {
            executeEvent2(nextEvent);
          }
        }
        lastEventTime = nextEvent[0];
        pauseElapsedTime = lastEventTime * 1e3;
        effectiveStartAt = null;
        if (audioElement && audioSeekable) {
          audioElement.currentTime = lastEventTime / speed;
        }
        if (events[targetIndex + 1] === void 0) {
          onEnd();
        }
      }
      async function restart() {
        if (eventTimeoutId) throw new Error("still playing");
        if (events[nextEventIndex] !== void 0) throw new Error("not ended");
        seek(0);
        await resume();
        return true;
      }
      function getPoster(time) {
        return events.filter((e) => e[0] < time && e[1] === "o").map((e) => e[2]);
      }
      function getCurrentTime() {
        if (eventTimeoutId) {
          return (now() - startTime) / 1e3;
        } else {
          return (pauseElapsedTime ?? 0) / 1e3;
        }
      }
      function resizeTerminalToInitialSize() {
        resize(initialCols, initialRows);
      }
      function setupAudioCtx() {
        audioCtx = new AudioContext({
          latencyHint: "interactive"
        });
        const src2 = audioCtx.createMediaElementSource(audioElement);
        src2.connect(audioCtx.destination);
        now = audioNow;
      }
      function audioNow() {
        if (!audioCtx) throw new Error("audio context not started - can't tell time!");
        const {
          contextTime,
          performanceTime
        } = audioCtx.getOutputTimestamp();
        return performanceTime === 0 ? contextTime * 1e3 : contextTime * 1e3 + (performance.now() - performanceTime);
      }
      function onAudioWaiting() {
        logger.debug("audio buffering");
        waitingForAudio = true;
        shouldResumeOnAudioPlaying = !!eventTimeoutId;
        waitingTimeout = setTimeout(() => setState2("loading"), 1e3);
        if (!eventTimeoutId) return true;
        logger.debug("pausing session playback");
        cancelNextEvent();
        pauseElapsedTime = now() - startTime;
      }
      function onAudioPlaying() {
        logger.debug("audio resumed");
        clearTimeout(waitingTimeout);
        setState2("playing");
        if (!waitingForAudio) return;
        waitingForAudio = false;
        if (shouldResumeOnAudioPlaying) {
          logger.debug("resuming session playback");
          startTime = now() - pauseElapsedTime;
          pauseElapsedTime = null;
          scheduleNextEvent();
        }
      }
      function mute() {
        if (audioElement) {
          audioElement.muted = true;
          return true;
        }
      }
      function unmute() {
        if (audioElement) {
          audioElement.muted = false;
          return true;
        }
      }
      return {
        init: init2,
        play,
        pause,
        seek,
        step,
        restart,
        stop: pause,
        mute,
        unmute,
        getCurrentTime
      };
    }
    function batcher(logger) {
      let minFrameTime = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 1 / 60;
      let prevEvent;
      return (emit) => {
        let ic2 = 0;
        let oc = 0;
        return {
          step: (event) => {
            ic2++;
            if (prevEvent === void 0) {
              prevEvent = event;
              return;
            }
            if (event[1] === "o" && prevEvent[1] === "o" && event[0] - prevEvent[0] < minFrameTime) {
              prevEvent[2] += event[2];
            } else {
              emit(prevEvent);
              prevEvent = event;
              oc++;
            }
          },
          flush: () => {
            if (prevEvent !== void 0) {
              emit(prevEvent);
              oc++;
            }
            logger.debug(`batched ${ic2} frames to ${oc} frames`);
          }
        };
      };
    }
    function prepare(recording2, logger, _ref4) {
      let {
        startAt = 0,
        idleTimeLimit,
        minFrameTime,
        inputOffset,
        markers_
      } = _ref4;
      let {
        events
      } = recording2;
      if (!(events instanceof Stream)) {
        events = new Stream(events);
      }
      idleTimeLimit = idleTimeLimit ?? recording2.idleTimeLimit ?? Infinity;
      const limiterOutput = {
        offset: 0
      };
      events = events.transform(batcher(logger, minFrameTime)).map(timeLimiter(idleTimeLimit, startAt, limiterOutput)).map(markerWrapper());
      if (markers_ !== void 0) {
        markers_ = new Stream(markers_).map(normalizeMarker);
        events = events.filter((e) => e[1] !== "m").multiplex(markers_, (a, b) => a[0] < b[0]).map(markerWrapper());
      }
      events = events.toArray();
      if (inputOffset !== void 0) {
        events = events.map((e) => e[1] === "i" ? [e[0] + inputOffset, e[1], e[2]] : e);
        events.sort((a, b) => a[0] - b[0]);
      }
      const duration = events[events.length - 1][0];
      const effectiveStartAt = startAt - limiterOutput.offset;
      return {
        ...recording2,
        events,
        duration,
        effectiveStartAt
      };
    }
    function normalizeMarker(m) {
      return typeof m === "number" ? [m, "m", ""] : [m[0], "m", m[1]];
    }
    function timeLimiter(idleTimeLimit, startAt, output2) {
      let prevT = 0;
      let shift2 = 0;
      return function(e) {
        const delay = e[0] - prevT;
        const delta2 = delay - idleTimeLimit;
        prevT = e[0];
        if (delta2 > 0) {
          shift2 += delta2;
          if (e[0] < startAt) {
            output2.offset += delta2;
          }
        }
        return [e[0] - shift2, e[1], e[2]];
      };
    }
    function markerWrapper() {
      let i2 = 0;
      return function(e) {
        if (e[1] === "m") {
          return [e[0], e[1], {
            index: i2++,
            time: e[0],
            label: e[2]
          }];
        } else {
          return e;
        }
      };
    }
    function dump(recording2, filename2) {
      const link2 = document.createElement("a");
      const events = recording2.events.map((e) => e[1] === "m" ? [e[0], e[1], e[2].label] : e);
      const asciicast = unparseAsciicastV2({
        ...recording2,
        events
      });
      link2.href = URL.createObjectURL(new Blob([asciicast], {
        type: "text/plain"
      }));
      link2.download = filename2;
      link2.click();
    }
    async function createAudioElement(src) {
      const audio = new Audio();
      audio.preload = "metadata";
      audio.loop = false;
      audio.crossOrigin = "anonymous";
      let resolve;
      const canPlay = new Promise((resolve_) => {
        resolve = resolve_;
      });
      function onCanPlay() {
        resolve();
        audio.removeEventListener("canplay", onCanPlay);
      }
      audio.addEventListener("canplay", onCanPlay);
      audio.src = src;
      audio.load();
      await canPlay;
      return audio;
    }
    function clock(_ref, _ref2, _ref3) {
      let {
        hourColor = 3,
        minuteColor = 4,
        separatorColor = 9
      } = _ref;
      let {
        feed
      } = _ref2;
      let {
        cols = 5,
        rows = 1
      } = _ref3;
      const middleRow = Math.floor(rows / 2);
      const leftPad = Math.floor(cols / 2) - 2;
      const setupCursor = `\x1B[?25l\x1B[1m\x1B[${middleRow}B`;
      let intervalId;
      const getCurrentTime = () => {
        const d = /* @__PURE__ */ new Date();
        const h = d.getHours();
        const m = d.getMinutes();
        const seqs = [];
        seqs.push("\r");
        for (let i2 = 0; i2 < leftPad; i2++) {
          seqs.push(" ");
        }
        seqs.push(`\x1B[3${hourColor}m`);
        if (h < 10) {
          seqs.push("0");
        }
        seqs.push(`${h}`);
        seqs.push(`\x1B[3${separatorColor};5m:\x1B[25m`);
        seqs.push(`\x1B[3${minuteColor}m`);
        if (m < 10) {
          seqs.push("0");
        }
        seqs.push(`${m}`);
        return seqs;
      };
      const updateTime = () => {
        getCurrentTime().forEach(feed);
      };
      return {
        init: () => {
          const duration = 24 * 60;
          const poster = [setupCursor].concat(getCurrentTime());
          return {
            cols,
            rows,
            duration,
            poster
          };
        },
        play: () => {
          feed(setupCursor);
          updateTime();
          intervalId = setInterval(updateTime, 1e3);
          return true;
        },
        stop: () => {
          clearInterval(intervalId);
        },
        getCurrentTime: () => {
          const d = /* @__PURE__ */ new Date();
          return d.getHours() * 60 + d.getMinutes();
        }
      };
    }
    function random(src, _ref, _ref2) {
      let {
        feed
      } = _ref;
      let {
        speed
      } = _ref2;
      const base2 = " ".charCodeAt(0);
      const range2 = "~".charCodeAt(0) - base2;
      let timeoutId;
      const schedule = () => {
        const t2 = Math.pow(5, Math.random() * 4);
        timeoutId = setTimeout(print, t2 / speed);
      };
      const print = () => {
        schedule();
        const char = String.fromCharCode(base2 + Math.floor(Math.random() * range2));
        feed(char);
      };
      return () => {
        schedule();
        return () => clearInterval(timeoutId);
      };
    }
    function benchmark(_ref, _ref2) {
      let {
        url,
        iterations = 10
      } = _ref;
      let {
        feed,
        setState: setState2
      } = _ref2;
      let data;
      let byteCount = 0;
      return {
        async init() {
          const recording2 = await parse$2(await fetch(url));
          const {
            cols,
            rows,
            events
          } = recording2;
          data = Array.from(events).filter((_ref3) => {
            let [_time, type, _text] = _ref3;
            return type === "o";
          }).map((_ref4) => {
            let [time, _type, text2] = _ref4;
            return [time, text2];
          });
          const duration = data[data.length - 1][0];
          for (const [_, text2] of data) {
            byteCount += new Blob([text2]).size;
          }
          return {
            cols,
            rows,
            duration
          };
        },
        play() {
          const startTime = performance.now();
          for (let i2 = 0; i2 < iterations; i2++) {
            for (const [_, text2] of data) {
              feed(text2);
            }
            feed("\x1Bc");
          }
          const endTime = performance.now();
          const duration = (endTime - startTime) / 1e3;
          const throughput = byteCount * iterations / duration;
          const throughputMbs = byteCount / (1024 * 1024) * iterations / duration;
          console.info("benchmark: result", {
            byteCount,
            iterations,
            duration,
            throughput,
            throughputMbs
          });
          setTimeout(() => {
            setState2("stopped", {
              reason: "ended"
            });
          }, 0);
          return true;
        }
      };
    }
    class Queue {
      constructor() {
        this.items = [];
        this.onPush = void 0;
      }
      push(item2) {
        this.items.push(item2);
        if (this.onPush !== void 0) {
          this.onPush(this.popAll());
          this.onPush = void 0;
        }
      }
      popAll() {
        if (this.items.length > 0) {
          const items = this.items;
          this.items = [];
          return items;
        } else {
          const thiz = this;
          return new Promise((resolve) => {
            thiz.onPush = resolve;
          });
        }
      }
    }
    function getBuffer(bufferTime, feed, resize, onInput, onMarker, setTime, baseStreamTime, minFrameTime, logger) {
      const execute = executeEvent(feed, resize, onInput, onMarker);
      if (bufferTime === 0) {
        logger.debug("using no buffer");
        return nullBuffer(execute);
      } else {
        bufferTime = bufferTime ?? {};
        let getBufferTime;
        if (typeof bufferTime === "number") {
          logger.debug(`using fixed time buffer (${bufferTime} ms)`);
          getBufferTime = (_latency) => bufferTime;
        } else if (typeof bufferTime === "function") {
          logger.debug("using custom dynamic buffer");
          getBufferTime = bufferTime({
            logger
          });
        } else {
          logger.debug("using adaptive buffer", bufferTime);
          getBufferTime = adaptiveBufferTimeProvider({
            logger
          }, bufferTime);
        }
        return buffer(getBufferTime, execute, setTime, logger, baseStreamTime ?? 0, minFrameTime);
      }
    }
    function nullBuffer(execute) {
      return {
        pushEvent(event) {
          execute(event[1], event[2]);
        },
        pushText(text2) {
          execute("o", text2);
        },
        stop() {
        }
      };
    }
    function executeEvent(feed, resize, onInput, onMarker) {
      return function(code2, data) {
        if (code2 === "o") {
          feed(data);
        } else if (code2 === "i") {
          onInput(data);
        } else if (code2 === "r") {
          resize(data.cols, data.rows);
        } else if (code2 === "m") {
          onMarker(data);
        }
      };
    }
    function buffer(getBufferTime, execute, setTime, logger, baseStreamTime) {
      let minFrameTime = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : 1 / 60;
      let epoch = performance.now() - baseStreamTime * 1e3;
      let bufferTime = getBufferTime(0);
      const queue = new Queue();
      minFrameTime *= 1e3;
      let prevElapsedStreamTime = -minFrameTime;
      let stop = false;
      function elapsedWallTime() {
        return performance.now() - epoch;
      }
      setTimeout(async () => {
        while (!stop) {
          const events = await queue.popAll();
          if (stop) return;
          for (const event of events) {
            const elapsedStreamTime = event[0] * 1e3 + bufferTime;
            if (elapsedStreamTime - prevElapsedStreamTime < minFrameTime) {
              execute(event[1], event[2]);
              continue;
            }
            const delay = elapsedStreamTime - elapsedWallTime();
            if (delay > 0) {
              await sleep(delay);
              if (stop) return;
            }
            setTime(event[0]);
            execute(event[1], event[2]);
            prevElapsedStreamTime = elapsedStreamTime;
          }
        }
      }, 0);
      return {
        pushEvent(event) {
          let latency = elapsedWallTime() - event[0] * 1e3;
          if (latency < 0) {
            logger.debug(`correcting epoch by ${latency} ms`);
            epoch += latency;
            latency = 0;
          }
          bufferTime = getBufferTime(latency);
          queue.push(event);
        },
        pushText(text2) {
          queue.push([elapsedWallTime() / 1e3, "o", text2]);
        },
        stop() {
          stop = true;
          queue.push(void 0);
        }
      };
    }
    function sleep(t2) {
      return new Promise((resolve) => {
        setTimeout(resolve, t2);
      });
    }
    function adaptiveBufferTimeProvider() {
      let {
        logger
      } = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
      let {
        minBufferTime = 50,
        bufferLevelStep = 100,
        maxBufferLevel = 50,
        transitionDuration = 500,
        peakHalfLifeUp = 100,
        peakHalfLifeDown = 1e4,
        floorHalfLifeUp = 5e3,
        floorHalfLifeDown = 100,
        idealHalfLifeUp = 1e3,
        idealHalfLifeDown = 5e3,
        safetyMultiplier = 1.2,
        minImprovementDuration = 3e3
      } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
      function levelToMs(level) {
        return level === 0 ? minBufferTime : bufferLevelStep * level;
      }
      let bufferLevel = 1;
      let bufferTime = levelToMs(bufferLevel);
      let lastUpdateTime = performance.now();
      let smoothedPeakLatency = null;
      let smoothedFloorLatency = null;
      let smoothedIdealBufferTime = null;
      let stableSince = null;
      let targetBufferTime = null;
      let transitionRate = null;
      return function(latency) {
        const now = performance.now();
        const dt2 = Math.max(0, now - lastUpdateTime);
        lastUpdateTime = now;
        if (smoothedPeakLatency === null) {
          smoothedPeakLatency = latency;
        } else if (latency > smoothedPeakLatency) {
          const alphaUp = 1 - Math.pow(2, -dt2 / peakHalfLifeUp);
          smoothedPeakLatency += alphaUp * (latency - smoothedPeakLatency);
        } else {
          const alphaDown = 1 - Math.pow(2, -dt2 / peakHalfLifeDown);
          smoothedPeakLatency += alphaDown * (latency - smoothedPeakLatency);
        }
        smoothedPeakLatency = Math.max(smoothedPeakLatency, 0);
        if (smoothedFloorLatency === null) {
          smoothedFloorLatency = latency;
        } else if (latency > smoothedFloorLatency) {
          const alphaUp = 1 - Math.pow(2, -dt2 / floorHalfLifeUp);
          smoothedFloorLatency += alphaUp * (latency - smoothedFloorLatency);
        } else {
          const alphaDown = 1 - Math.pow(2, -dt2 / floorHalfLifeDown);
          smoothedFloorLatency += alphaDown * (latency - smoothedFloorLatency);
        }
        smoothedFloorLatency = Math.max(smoothedFloorLatency, 0);
        const jitter = smoothedPeakLatency - smoothedFloorLatency;
        const idealBufferTime = safetyMultiplier * (smoothedPeakLatency + jitter);
        if (smoothedIdealBufferTime === null) {
          smoothedIdealBufferTime = idealBufferTime;
        } else if (idealBufferTime > smoothedIdealBufferTime) {
          const alphaUp = 1 - Math.pow(2, -dt2 / idealHalfLifeUp);
          smoothedIdealBufferTime += +alphaUp * (idealBufferTime - smoothedIdealBufferTime);
        } else {
          const alphaDown = 1 - Math.pow(2, -dt2 / idealHalfLifeDown);
          smoothedIdealBufferTime += +alphaDown * (idealBufferTime - smoothedIdealBufferTime);
        }
        let newBufferLevel;
        if (smoothedIdealBufferTime <= minBufferTime) {
          newBufferLevel = 0;
        } else {
          newBufferLevel = clamp(Math.ceil(smoothedIdealBufferTime / bufferLevelStep), 1, maxBufferLevel);
        }
        if (latency > bufferTime) {
          logger.debug("buffer underrun", {
            latency,
            bufferTime
          });
        }
        if (newBufferLevel > bufferLevel) {
          if (latency > bufferTime) {
            bufferLevel = Math.min(newBufferLevel, bufferLevel + 3);
          } else {
            bufferLevel += 1;
          }
          targetBufferTime = levelToMs(bufferLevel);
          transitionRate = (targetBufferTime - bufferTime) / transitionDuration;
          stableSince = null;
          logger.debug("raising buffer", {
            latency,
            bufferTime,
            targetBufferTime
          });
        } else if (newBufferLevel < bufferLevel) {
          if (stableSince == null) stableSince = now;
          if (now - stableSince >= minImprovementDuration) {
            bufferLevel -= 1;
            targetBufferTime = levelToMs(bufferLevel);
            transitionRate = (targetBufferTime - bufferTime) / transitionDuration;
            stableSince = now;
            logger.debug("lowering buffer", {
              latency,
              bufferTime,
              targetBufferTime
            });
          }
        } else {
          stableSince = null;
        }
        if (targetBufferTime !== null) {
          bufferTime += transitionRate * dt2;
          if (transitionRate >= 0 && bufferTime > targetBufferTime || transitionRate < 0 && bufferTime < targetBufferTime) {
            bufferTime = targetBufferTime;
            targetBufferTime = null;
          }
        }
        return bufferTime;
      };
    }
    function clamp(x2, lo2, hi) {
      return Math.min(hi, Math.max(lo2, x2));
    }
    const ONE_SEC_IN_USEC = 1e6;
    function alisHandler(logger) {
      const outputDecoder = new TextDecoder();
      const inputDecoder = new TextDecoder();
      let handler = parseMagicString;
      let lastEventTime;
      let markerIndex = 0;
      function parseMagicString(buffer2) {
        const text2 = new TextDecoder().decode(buffer2);
        if (text2 === "ALiS") {
          handler = parseFirstFrame;
        } else {
          throw new Error("not an ALiS v1 live stream");
        }
      }
      function parseFirstFrame(buffer2) {
        const view = new BinaryReader(new DataView(buffer2));
        const type = view.getUint8();
        if (type !== 1) throw new Error(`expected reset (0x01) frame, got ${type}`);
        return parseResetFrame(view, buffer2);
      }
      function parseResetFrame(view, buffer2) {
        view.decodeVarUint();
        let time = view.decodeVarUint();
        lastEventTime = time;
        time = time / ONE_SEC_IN_USEC;
        markerIndex = 0;
        const cols = view.decodeVarUint();
        const rows = view.decodeVarUint();
        const themeFormat = view.getUint8();
        let theme2;
        if (themeFormat === 8) {
          const len = (2 + 8) * 3;
          theme2 = parseTheme(new Uint8Array(buffer2, view.offset, len));
          view.forward(len);
        } else if (themeFormat === 16) {
          const len = (2 + 16) * 3;
          theme2 = parseTheme(new Uint8Array(buffer2, view.offset, len));
          view.forward(len);
        } else if (themeFormat !== 0) {
          throw new Error(`alis: invalid theme format (${themeFormat})`);
        }
        const initLen = view.decodeVarUint();
        let init2;
        if (initLen > 0) {
          init2 = outputDecoder.decode(new Uint8Array(buffer2, view.offset, initLen));
        }
        handler = parseFrame2;
        return {
          time,
          term: {
            size: {
              cols,
              rows
            },
            theme: theme2,
            init: init2
          }
        };
      }
      function parseFrame2(buffer2) {
        const view = new BinaryReader(new DataView(buffer2));
        const type = view.getUint8();
        if (type === 1) {
          return parseResetFrame(view, buffer2);
        } else if (type === 111) {
          return parseOutputFrame(view, buffer2);
        } else if (type === 105) {
          return parseInputFrame(view, buffer2);
        } else if (type === 114) {
          return parseResizeFrame(view);
        } else if (type === 109) {
          return parseMarkerFrame(view, buffer2);
        } else if (type === 4) {
          handler = parseFirstFrame;
          return false;
        } else {
          logger.debug(`alis: unknown frame type: ${type}`);
        }
      }
      function parseOutputFrame(view, buffer2) {
        view.decodeVarUint();
        const relTime = view.decodeVarUint();
        lastEventTime += relTime;
        const len = view.decodeVarUint();
        const text2 = outputDecoder.decode(new Uint8Array(buffer2, view.offset, len));
        return [lastEventTime / ONE_SEC_IN_USEC, "o", text2];
      }
      function parseInputFrame(view, buffer2) {
        view.decodeVarUint();
        const relTime = view.decodeVarUint();
        lastEventTime += relTime;
        const len = view.decodeVarUint();
        const text2 = inputDecoder.decode(new Uint8Array(buffer2, view.offset, len));
        return [lastEventTime / ONE_SEC_IN_USEC, "i", text2];
      }
      function parseResizeFrame(view) {
        view.decodeVarUint();
        const relTime = view.decodeVarUint();
        lastEventTime += relTime;
        const cols = view.decodeVarUint();
        const rows = view.decodeVarUint();
        return [lastEventTime / ONE_SEC_IN_USEC, "r", {
          cols,
          rows
        }];
      }
      function parseMarkerFrame(view, buffer2) {
        view.decodeVarUint();
        const relTime = view.decodeVarUint();
        lastEventTime += relTime;
        const len = view.decodeVarUint();
        const decoder = new TextDecoder();
        const index = markerIndex++;
        const time = lastEventTime / ONE_SEC_IN_USEC;
        const label2 = decoder.decode(new Uint8Array(buffer2, view.offset, len));
        return [time, "m", {
          index,
          time,
          label: label2
        }];
      }
      return function(buffer2) {
        return handler(buffer2);
      };
    }
    function parseTheme(arr2) {
      const colorCount = arr2.length / 3;
      const foreground = hexColor(arr2[0], arr2[1], arr2[2]);
      const background = hexColor(arr2[3], arr2[4], arr2[5]);
      const palette = [];
      for (let i2 = 2; i2 < colorCount; i2++) {
        palette.push(hexColor(arr2[i2 * 3], arr2[i2 * 3 + 1], arr2[i2 * 3 + 2]));
      }
      return {
        foreground,
        background,
        palette
      };
    }
    function hexColor(r2, g, b) {
      return `#${byteToHex(r2)}${byteToHex(g)}${byteToHex(b)}`;
    }
    function byteToHex(value2) {
      return value2.toString(16).padStart(2, "0");
    }
    class BinaryReader {
      constructor(inner2) {
        let offset2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
        this.inner = inner2;
        this.offset = offset2;
      }
      forward(delta2) {
        this.offset += delta2;
      }
      getUint8() {
        const value2 = this.inner.getUint8(this.offset);
        this.offset += 1;
        return value2;
      }
      decodeVarUint() {
        let number2 = BigInt(0);
        let shift2 = BigInt(0);
        let byte = this.getUint8();
        while (byte > 127) {
          byte &= 127;
          number2 += BigInt(byte) << shift2;
          shift2 += BigInt(7);
          byte = this.getUint8();
        }
        number2 = number2 + (BigInt(byte) << shift2);
        return Number(number2);
      }
    }
    function ascicastV2Handler() {
      let parse2 = parseHeader;
      function parseHeader(buffer2) {
        const header2 = JSON.parse(buffer2);
        if (header2.version !== 2) {
          throw new Error("not an asciicast v2 stream");
        }
        parse2 = parseEvent;
        return {
          time: 0,
          term: {
            size: {
              cols: header2.width,
              rows: header2.height
            }
          }
        };
      }
      function parseEvent(buffer2) {
        const event = JSON.parse(buffer2);
        if (event[1] === "r") {
          const [cols, rows] = event[2].split("x");
          return [event[0], "r", {
            cols: parseInt(cols, 10),
            rows: parseInt(rows, 10)
          }];
        } else {
          return event;
        }
      }
      return function(buffer2) {
        return parse2(buffer2);
      };
    }
    function ascicastV3Handler() {
      let parse2 = parseHeader;
      let currentTime = 0;
      function parseHeader(buffer2) {
        const header2 = JSON.parse(buffer2);
        if (header2.version !== 3) {
          throw new Error("not an asciicast v3 stream");
        }
        parse2 = parseEvent;
        const term = {
          size: {
            cols: header2.term.cols,
            rows: header2.term.rows
          }
        };
        if (header2.term.theme) {
          term.theme = {
            foreground: header2.term.theme.fg,
            background: header2.term.theme.bg,
            palette: header2.term.theme.palette.split(":")
          };
        }
        return {
          time: 0,
          term
        };
      }
      function parseEvent(buffer2) {
        const event = JSON.parse(buffer2);
        const [interval, eventType, data] = event;
        currentTime += interval;
        if (eventType === "r") {
          const [cols, rows] = data.split("x");
          return [currentTime, "r", {
            cols: parseInt(cols, 10),
            rows: parseInt(rows, 10)
          }];
        } else {
          return [currentTime, eventType, data];
        }
      }
      return function(buffer2) {
        return parse2(buffer2);
      };
    }
    function rawHandler() {
      const outputDecoder = new TextDecoder();
      let parse2 = parseSize;
      function parseSize(buffer2) {
        const text2 = outputDecoder.decode(buffer2, {
          stream: true
        });
        const [cols, rows] = sizeFromResizeSeq(text2) ?? sizeFromScriptStartMessage(text2) ?? [80, 24];
        parse2 = parseOutput;
        return {
          time: 0,
          term: {
            size: {
              cols,
              rows
            },
            init: text2
          }
        };
      }
      function parseOutput(buffer2) {
        return outputDecoder.decode(buffer2, {
          stream: true
        });
      }
      return function(buffer2) {
        return parse2(buffer2);
      };
    }
    function sizeFromResizeSeq(text2) {
      const match = text2.match(/\x1b\[8;(\d+);(\d+)t/);
      if (match !== null) {
        return [parseInt(match[2], 10), parseInt(match[1], 10)];
      }
    }
    function sizeFromScriptStartMessage(text2) {
      const match = text2.match(/\[.*COLUMNS="(\d{1,3})" LINES="(\d{1,3})".*\]/);
      if (match !== null) {
        return [parseInt(match[1], 10), parseInt(match[2], 10)];
      }
    }
    const RECONNECT_DELAY_BASE = 500;
    const RECONNECT_DELAY_CAP = 1e4;
    function exponentialDelay(attempt) {
      const base2 = Math.min(RECONNECT_DELAY_BASE * Math.pow(2, attempt), RECONNECT_DELAY_CAP);
      return Math.random() * base2;
    }
    function websocket(_ref, _ref2, _ref3) {
      let {
        url,
        bufferTime,
        reconnectDelay = exponentialDelay,
        minFrameTime
      } = _ref;
      let {
        feed,
        reset,
        resize,
        onInput,
        onMarker,
        setState: setState2,
        logger
      } = _ref2;
      let {
        audioUrl
      } = _ref3;
      logger = new PrefixedLogger(logger, "websocket: ");
      let socket;
      let buf;
      let clock2 = new NullClock();
      let reconnectAttempt = 0;
      let successfulConnectionTimeout;
      let stop = false;
      let wasOnline = false;
      let initTimeout;
      let audioElement;
      function connect() {
        socket = new WebSocket(url, ["v1.alis", "v2.asciicast", "v3.asciicast", "raw"]);
        socket.binaryType = "arraybuffer";
        socket.onopen = () => {
          const proto = socket.protocol || "raw";
          logger.info("opened");
          logger.info(`activating ${proto} protocol handler`);
          if (proto === "v1.alis") {
            socket.onmessage = onMessage(alisHandler(logger));
          } else if (proto === "v2.asciicast") {
            socket.onmessage = onMessage(ascicastV2Handler());
          } else if (proto === "v3.asciicast") {
            socket.onmessage = onMessage(ascicastV3Handler());
          } else if (proto === "raw") {
            socket.onmessage = onMessage(rawHandler());
          }
          successfulConnectionTimeout = setTimeout(() => {
            reconnectAttempt = 0;
          }, 1e3);
        };
        socket.onclose = (event) => {
          clearTimeout(initTimeout);
          stopBuffer();
          if (stop || event.code === 1e3 || event.code === 1005) {
            logger.info("closed");
            setState2("ended", {
              message: "Stream ended"
            });
          } else if (event.code === 1002) {
            logger.debug(`close reason: ${event.reason}`);
            setState2("ended", {
              message: "Err: Player not compatible with the server"
            });
          } else {
            clearTimeout(successfulConnectionTimeout);
            const delay = reconnectDelay(reconnectAttempt++);
            logger.info(`unclean close, reconnecting in ${delay}...`);
            setState2("loading");
            setTimeout(connect, delay);
          }
        };
        wasOnline = false;
      }
      function onMessage(handler) {
        initTimeout = setTimeout(onStreamEnd, 5e3);
        return function(event) {
          try {
            const result2 = handler(event.data);
            if (buf) {
              if (Array.isArray(result2)) {
                buf.pushEvent(result2);
              } else if (typeof result2 === "string") {
                buf.pushText(result2);
              } else if (typeof result2 === "object" && !Array.isArray(result2)) {
                onStreamReset(result2);
              } else if (result2 === false) {
                onStreamEnd();
              } else if (result2 !== void 0) {
                throw new Error(`unexpected value from protocol handler: ${result2}`);
              }
            } else {
              if (typeof result2 === "object" && !Array.isArray(result2)) {
                onStreamReset(result2);
                clearTimeout(initTimeout);
              } else if (result2 === void 0) {
                clearTimeout(initTimeout);
                initTimeout = setTimeout(onStreamEnd, 1e3);
              } else {
                clearTimeout(initTimeout);
                throw new Error(`unexpected value from protocol handler: ${result2}`);
              }
            }
          } catch (e) {
            socket.close();
            throw e;
          }
        };
      }
      function onStreamReset(_ref4) {
        let {
          time,
          term
        } = _ref4;
        const {
          size,
          init: init2,
          theme: theme2
        } = term;
        const {
          cols,
          rows
        } = size;
        logger.info(`stream reset (${cols}x${rows} @${time})`);
        setState2("playing");
        stopBuffer();
        buf = getBuffer(bufferTime, feed, resize, onInput, onMarker, (t2) => clock2.setTime(t2), time, minFrameTime, logger);
        reset(cols, rows, init2, theme2);
        clock2 = new Clock();
        wasOnline = true;
        if (typeof time === "number") {
          clock2.setTime(time);
        }
      }
      function onStreamEnd() {
        stopBuffer();
        if (wasOnline) {
          logger.info("stream ended");
          setState2("offline", {
            message: "Stream ended"
          });
        } else {
          logger.info("stream offline");
          setState2("offline", {
            message: "Stream offline"
          });
        }
        clock2 = new NullClock();
      }
      function stopBuffer() {
        if (buf) buf.stop();
        buf = null;
      }
      function startAudio() {
        if (!audioUrl) return;
        audioElement = new Audio();
        audioElement.preload = "auto";
        audioElement.crossOrigin = "anonymous";
        audioElement.src = audioUrl;
        audioElement.play();
      }
      function stopAudio() {
        if (!audioElement) return;
        audioElement.pause();
      }
      function mute() {
        if (audioElement) {
          audioElement.muted = true;
          return true;
        }
      }
      function unmute() {
        if (audioElement) {
          audioElement.muted = false;
          return true;
        }
      }
      return {
        init: () => {
          return {
            hasAudio: !!audioUrl
          };
        },
        play: () => {
          connect();
          startAudio();
        },
        stop: () => {
          stop = true;
          stopBuffer();
          if (socket !== void 0) socket.close();
          stopAudio();
        },
        mute,
        unmute,
        getCurrentTime: () => clock2.getTime()
      };
    }
    function eventsource(_ref, _ref2) {
      let {
        url,
        bufferTime,
        minFrameTime
      } = _ref;
      let {
        feed,
        reset,
        resize,
        onInput,
        onMarker,
        setState: setState2,
        logger
      } = _ref2;
      logger = new PrefixedLogger(logger, "eventsource: ");
      let es2;
      let buf;
      let clock2 = new NullClock();
      function initBuffer(baseStreamTime) {
        if (buf !== void 0) buf.stop();
        buf = getBuffer(bufferTime, feed, resize, onInput, onMarker, (t2) => clock2.setTime(t2), baseStreamTime, minFrameTime, logger);
      }
      return {
        play: () => {
          es2 = new EventSource(url);
          es2.addEventListener("open", () => {
            logger.info("opened");
            initBuffer();
          });
          es2.addEventListener("error", (e) => {
            logger.info("errored");
            logger.debug({
              e
            });
            setState2("loading");
          });
          es2.addEventListener("message", (event) => {
            const e = JSON.parse(event.data);
            if (Array.isArray(e)) {
              buf.pushEvent(e);
            } else if (e.cols !== void 0 || e.width !== void 0) {
              const cols = e.cols ?? e.width;
              const rows = e.rows ?? e.height;
              logger.debug(`vt reset (${cols}x${rows})`);
              setState2("playing");
              initBuffer(e.time);
              reset(cols, rows, e.init ?? void 0);
              clock2 = new Clock();
              if (typeof e.time === "number") {
                clock2.setTime(e.time);
              }
            } else if (e.state === "offline") {
              logger.info("stream offline");
              setState2("offline", {
                message: "Stream offline"
              });
              clock2 = new NullClock();
            }
          });
          es2.addEventListener("done", () => {
            logger.info("closed");
            es2.close();
            setState2("ended", {
              message: "Stream ended"
            });
          });
        },
        stop: () => {
          if (buf !== void 0) buf.stop();
          if (es2 !== void 0) es2.close();
        },
        getCurrentTime: () => clock2.getTime()
      };
    }
    async function parse$1(responses, _ref) {
      let {
        encoding
      } = _ref;
      const textDecoder = new TextDecoder(encoding);
      let cols;
      let rows;
      let timing = (await responses[0].text()).split("\n").filter((line2) => line2.length > 0).map((line2) => line2.split(" "));
      if (timing[0].length < 3) {
        timing = timing.map((entry) => ["O", entry[0], entry[1]]);
      }
      const buffer2 = await responses[1].arrayBuffer();
      const array = new Uint8Array(buffer2);
      const dataOffset = array.findIndex((byte) => byte == 10) + 1;
      const header2 = textDecoder.decode(array.subarray(0, dataOffset));
      const sizeMatch = header2.match(/COLUMNS="(\d+)" LINES="(\d+)"/);
      if (sizeMatch !== null) {
        cols = parseInt(sizeMatch[1], 10);
        rows = parseInt(sizeMatch[2], 10);
      }
      const stdout = {
        array,
        cursor: dataOffset
      };
      let stdin = stdout;
      if (responses[2] !== void 0) {
        const buffer3 = await responses[2].arrayBuffer();
        const array2 = new Uint8Array(buffer3);
        stdin = {
          array: array2,
          cursor: dataOffset
        };
      }
      const events = [];
      let time = 0;
      for (const entry of timing) {
        time += parseFloat(entry[1]);
        if (entry[0] === "O") {
          const count = parseInt(entry[2], 10);
          const bytes = stdout.array.subarray(stdout.cursor, stdout.cursor + count);
          const text2 = textDecoder.decode(bytes);
          events.push([time, "o", text2]);
          stdout.cursor += count;
        } else if (entry[0] === "I") {
          const count = parseInt(entry[2], 10);
          const bytes = stdin.array.subarray(stdin.cursor, stdin.cursor + count);
          const text2 = textDecoder.decode(bytes);
          events.push([time, "i", text2]);
          stdin.cursor += count;
        } else if (entry[0] === "S" && entry[2] === "SIGWINCH") {
          const cols2 = parseInt(entry[4].slice(5), 10);
          const rows2 = parseInt(entry[3].slice(5), 10);
          events.push([time, "r", `${cols2}x${rows2}`]);
        } else if (entry[0] === "H" && entry[2] === "COLUMNS") {
          cols = parseInt(entry[3], 10);
        } else if (entry[0] === "H" && entry[2] === "LINES") {
          rows = parseInt(entry[3], 10);
        }
      }
      cols = cols ?? 80;
      rows = rows ?? 24;
      return {
        cols,
        rows,
        events
      };
    }
    async function parse(response, _ref) {
      let {
        encoding
      } = _ref;
      const textDecoder = new TextDecoder(encoding);
      const buffer2 = await response.arrayBuffer();
      const array = new Uint8Array(buffer2);
      const firstFrame = parseFrame(array);
      const baseTime = firstFrame.time;
      const firstFrameText = textDecoder.decode(firstFrame.data);
      const sizeMatch = firstFrameText.match(/\x1b\[8;(\d+);(\d+)t/);
      const events = [];
      let cols = 80;
      let rows = 24;
      if (sizeMatch !== null) {
        cols = parseInt(sizeMatch[2], 10);
        rows = parseInt(sizeMatch[1], 10);
      }
      let cursor = 0;
      let frame = parseFrame(array);
      while (frame !== void 0) {
        const time = frame.time - baseTime;
        const text2 = textDecoder.decode(frame.data);
        events.push([time, "o", text2]);
        cursor += frame.len;
        frame = parseFrame(array.subarray(cursor));
      }
      return {
        cols,
        rows,
        events
      };
    }
    function parseFrame(array) {
      if (array.length < 13) return;
      const time = parseTimestamp(array.subarray(0, 8));
      const len = parseNumber(array.subarray(8, 12));
      const data = array.subarray(12, 12 + len);
      return {
        time,
        data,
        len: len + 12
      };
    }
    function parseNumber(array) {
      return array[0] + array[1] * 256 + array[2] * 256 * 256 + array[3] * 256 * 256 * 256;
    }
    function parseTimestamp(array) {
      const sec = parseNumber(array.subarray(0, 4));
      const usec = parseNumber(array.subarray(4, 8));
      return sec + usec / 1e6;
    }
    const DEFAULT_COLS = 80;
    const DEFAULT_ROWS = 24;
    const vt = init({
      module: vtWasmModule
    });
    class State {
      constructor(core) {
        this.core = core;
        this.driver = core.driver;
      }
      onEnter(data) {
      }
      init() {
      }
      play() {
      }
      pause() {
      }
      togglePlay() {
      }
      mute() {
        if (this.driver && this.driver.mute()) {
          this.core._dispatchEvent("muted", true);
        }
      }
      unmute() {
        if (this.driver && this.driver.unmute()) {
          this.core._dispatchEvent("muted", false);
        }
      }
      seek(where) {
        return false;
      }
      step(n) {
      }
      stop() {
        this.driver.stop();
      }
    }
    class UninitializedState extends State {
      async init() {
        try {
          await this.core._initializeDriver();
          return this.core._setState("idle");
        } catch (e) {
          this.core._setState("errored");
          throw e;
        }
      }
      async play() {
        this.core._dispatchEvent("play");
        const idleState = await this.init();
        await idleState.doPlay();
      }
      async togglePlay() {
        await this.play();
      }
      async seek(where) {
        const idleState = await this.init();
        return await idleState.seek(where);
      }
      async step(n) {
        const idleState = await this.init();
        await idleState.step(n);
      }
      stop() {
      }
    }
    class Idle extends State {
      onEnter(_ref) {
        let {
          reason,
          message: message2
        } = _ref;
        this.core._dispatchEvent("idle", {
          message: message2
        });
        if (reason === "paused") {
          this.core._dispatchEvent("pause");
        }
      }
      async play() {
        this.core._dispatchEvent("play");
        await this.doPlay();
      }
      async doPlay() {
        const stop = await this.driver.play();
        if (stop === true) {
          this.core._setState("playing");
        } else if (typeof stop === "function") {
          this.core._setState("playing");
          this.driver.stop = stop;
        }
      }
      async togglePlay() {
        await this.play();
      }
      seek(where) {
        return this.driver.seek(where);
      }
      step(n) {
        this.driver.step(n);
      }
    }
    class PlayingState extends State {
      onEnter() {
        this.core._dispatchEvent("playing");
      }
      pause() {
        if (this.driver.pause() === true) {
          this.core._setState("idle", {
            reason: "paused"
          });
        }
      }
      togglePlay() {
        this.pause();
      }
      seek(where) {
        return this.driver.seek(where);
      }
    }
    class LoadingState extends State {
      onEnter() {
        this.core._dispatchEvent("loading");
      }
    }
    class OfflineState extends State {
      onEnter(_ref2) {
        let {
          message: message2
        } = _ref2;
        this.core._dispatchEvent("offline", {
          message: message2
        });
      }
    }
    class EndedState extends State {
      onEnter(_ref3) {
        let {
          message: message2
        } = _ref3;
        this.core._dispatchEvent("ended", {
          message: message2
        });
      }
      async play() {
        this.core._dispatchEvent("play");
        if (await this.driver.restart()) {
          this.core._setState("playing");
        }
      }
      async togglePlay() {
        await this.play();
      }
      async seek(where) {
        if (await this.driver.seek(where) === true) {
          this.core._setState("idle");
          return true;
        }
        return false;
      }
    }
    class ErroredState extends State {
      onEnter() {
        this.core._dispatchEvent("errored");
      }
    }
    class Core {
      constructor(src, opts) {
        this.logger = opts.logger;
        this.state = new UninitializedState(this);
        this.stateName = "uninitialized";
        this.driver = getDriver(src);
        this.changedLines = /* @__PURE__ */ new Set();
        this.duration = void 0;
        this.cols = opts.cols;
        this.rows = opts.rows;
        this.speed = opts.speed;
        this.loop = opts.loop;
        this.autoPlay = opts.autoPlay;
        this.idleTimeLimit = opts.idleTimeLimit;
        this.preload = opts.preload;
        this.startAt = parseNpt(opts.startAt);
        this.poster = this._parsePoster(opts.poster);
        this.markers = this._normalizeMarkers(opts.markers);
        this.pauseOnMarkers = opts.pauseOnMarkers;
        this.audioUrl = opts.audioUrl;
        this.boldIsBright = opts.boldIsBright ?? false;
        this.commandQueue = Promise.resolve();
        this.needsClear = false;
        this.eventHandlers = /* @__PURE__ */ new Map([["ended", []], ["errored", []], ["idle", []], ["input", []], ["loading", []], ["marker", []], ["metadata", []], ["muted", []], ["offline", []], ["pause", []], ["play", []], ["playing", []], ["ready", []], ["seeked", []], ["vtUpdate", []]]);
      }
      async init() {
        this.wasm = await vt;
        const {
          memory
        } = await this.wasm.default();
        this.memory = memory;
        this._initializeVt(this.cols ?? DEFAULT_COLS, this.rows ?? DEFAULT_ROWS);
        const feed = this._feed.bind(this);
        const onInput = (data) => {
          this._dispatchEvent("input", {
            data
          });
        };
        const onMarker = (_ref4) => {
          let {
            index,
            time,
            label: label2
          } = _ref4;
          this._dispatchEvent("marker", {
            index,
            time,
            label: label2
          });
        };
        const reset = this._resetVt.bind(this);
        const resize = this._resizeVt.bind(this);
        const setState2 = this._setState.bind(this);
        const posterTime = this.poster.type === "npt" && !this.autoPlay ? this.poster.value : void 0;
        this.driver = this.driver({
          feed,
          onInput,
          onMarker,
          reset,
          resize,
          setState: setState2,
          logger: this.logger
        }, {
          cols: this.cols,
          rows: this.rows,
          speed: this.speed,
          idleTimeLimit: this.idleTimeLimit,
          startAt: this.startAt,
          loop: this.loop,
          posterTime,
          markers: this.markers,
          pauseOnMarkers: this.pauseOnMarkers,
          audioUrl: this.audioUrl
        });
        if (typeof this.driver === "function") {
          this.driver = {
            play: this.driver
          };
        }
        if (this.preload || posterTime !== void 0) {
          this._withState((state) => state.init());
        }
        const config2 = {
          isPausable: !!this.driver.pause,
          isSeekable: !!this.driver.seek
        };
        if (this.driver.init === void 0) {
          this.driver.init = () => {
            return {};
          };
        }
        if (this.driver.pause === void 0) {
          this.driver.pause = () => {
          };
        }
        if (this.driver.seek === void 0) {
          this.driver.seek = (where) => false;
        }
        if (this.driver.step === void 0) {
          this.driver.step = (n) => {
          };
        }
        if (this.driver.stop === void 0) {
          this.driver.stop = () => {
          };
        }
        if (this.driver.restart === void 0) {
          this.driver.restart = () => {
          };
        }
        if (this.driver.mute === void 0) {
          this.driver.mute = () => {
          };
        }
        if (this.driver.unmute === void 0) {
          this.driver.unmute = () => {
          };
        }
        if (this.driver.getCurrentTime === void 0) {
          const play = this.driver.play;
          let clock2 = new NullClock();
          this.driver.play = () => {
            clock2 = new Clock(this.speed);
            return play();
          };
          this.driver.getCurrentTime = () => clock2.getTime();
        }
        this._dispatchEvent("ready", config2);
        if (this.autoPlay) {
          this.play();
        } else if (this.poster.type === "text") {
          this._feed(this.poster.value);
          this.needsClear = true;
        }
      }
      play() {
        this._clearIfNeeded();
        return this._withState((state) => state.play());
      }
      pause() {
        return this._withState((state) => state.pause());
      }
      togglePlay() {
        this._clearIfNeeded();
        return this._withState((state) => state.togglePlay());
      }
      seek(where) {
        this._clearIfNeeded();
        return this._withState(async (state) => {
          if (await state.seek(where)) {
            this._dispatchEvent("seeked");
          }
        });
      }
      step(n) {
        this._clearIfNeeded();
        return this._withState((state) => state.step(n));
      }
      stop() {
        return this._withState((state) => state.stop());
      }
      mute() {
        return this._withState((state) => state.mute());
      }
      unmute() {
        return this._withState((state) => state.unmute());
      }
      getLine(n, cursorOn) {
        return this.vt.getLine(n, cursorOn);
      }
      getDataView(_ref5, size) {
        let [ptr, len] = _ref5;
        return new DataView(this.memory.buffer, ptr, len * size);
      }
      getUint32Array(_ref6) {
        let [ptr, len] = _ref6;
        return new Uint32Array(this.memory.buffer, ptr, len);
      }
      getCursor() {
        const cursor = this.vt.getCursor();
        if (cursor) {
          return {
            col: cursor[0],
            row: cursor[1],
            visible: true
          };
        }
        return {
          col: 0,
          row: 0,
          visible: false
        };
      }
      getCurrentTime() {
        return this.driver.getCurrentTime();
      }
      getRemainingTime() {
        if (typeof this.duration === "number") {
          return this.duration - Math.min(this.getCurrentTime(), this.duration);
        }
      }
      getProgress() {
        if (typeof this.duration === "number") {
          return Math.min(this.getCurrentTime(), this.duration) / this.duration;
        }
      }
      getDuration() {
        return this.duration;
      }
      addEventListener(eventName, handler) {
        this.eventHandlers.get(eventName).push(handler);
      }
      removeEventListener(eventName, handler) {
        const handlers2 = this.eventHandlers.get(eventName);
        if (!handlers2) return;
        const idx = handlers2.indexOf(handler);
        if (idx !== -1) handlers2.splice(idx, 1);
      }
      _dispatchEvent(eventName) {
        let data = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
        for (const h of this.eventHandlers.get(eventName)) {
          h(data);
        }
      }
      _withState(f) {
        return this._enqueueCommand(() => f(this.state));
      }
      _enqueueCommand(f) {
        this.commandQueue = this.commandQueue.then(f);
        return this.commandQueue;
      }
      _setState(newState) {
        let data = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
        if (this.stateName === newState) return this.state;
        this.stateName = newState;
        if (newState === "playing") {
          this.state = new PlayingState(this);
        } else if (newState === "idle") {
          this.state = new Idle(this);
        } else if (newState === "loading") {
          this.state = new LoadingState(this);
        } else if (newState === "ended") {
          this.state = new EndedState(this);
        } else if (newState === "offline") {
          this.state = new OfflineState(this);
        } else if (newState === "errored") {
          this.state = new ErroredState(this);
        } else {
          throw new Error(`invalid state: ${newState}`);
        }
        this.state.onEnter(data);
        return this.state;
      }
      _feed(data) {
        const changedRows = this.vt.feed(data);
        this._dispatchEvent("vtUpdate", {
          changedRows
        });
      }
      async _initializeDriver() {
        const meta2 = await this.driver.init();
        this.cols = this.cols ?? meta2.cols ?? DEFAULT_COLS;
        this.rows = this.rows ?? meta2.rows ?? DEFAULT_ROWS;
        this.duration = this.duration ?? meta2.duration;
        this.markers = this._normalizeMarkers(meta2.markers) ?? this.markers ?? [];
        if (this.cols === 0) {
          this.cols = DEFAULT_COLS;
        }
        if (this.rows === 0) {
          this.rows = DEFAULT_ROWS;
        }
        this._initializeVt(this.cols, this.rows);
        if (meta2.poster !== void 0) {
          meta2.poster.forEach((text2) => this.vt.feed(text2));
          this.needsClear = true;
        } else if (this.poster.type === "text") {
          this.vt.feed(this.poster.value);
          this.needsClear = true;
        }
        this._dispatchEvent("metadata", {
          size: {
            cols: this.cols,
            rows: this.rows
          },
          theme: meta2.theme ?? null,
          duration: this.duration,
          markers: this.markers,
          hasAudio: meta2.hasAudio
        });
        this._dispatchEvent("vtUpdate", {
          size: {
            cols: this.cols,
            rows: this.rows
          },
          theme: meta2.theme ?? null,
          changedRows: Array.from({
            length: this.rows
          }, (_, i2) => i2)
        });
      }
      _clearIfNeeded() {
        if (this.needsClear) {
          this._feed("\x1Bc");
          this.needsClear = false;
        }
      }
      _resetVt(cols, rows) {
        let init2 = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : void 0;
        let theme2 = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : void 0;
        this.logger.debug(`core: vt reset (${cols}x${rows})`);
        this.cols = cols;
        this.rows = rows;
        this._initializeVt(cols, rows);
        if (init2 !== void 0 && init2 !== "") {
          this.vt.feed(init2);
        }
        this._dispatchEvent("metadata", {
          size: {
            cols,
            rows
          },
          theme: theme2 ?? null
        });
        this._dispatchEvent("vtUpdate", {
          size: {
            cols,
            rows
          },
          theme: theme2 ?? null,
          changedRows: Array.from({
            length: rows
          }, (_, i2) => i2)
        });
      }
      _resizeVt(cols, rows) {
        if (cols === this.vt.cols && rows === this.vt.rows) return;
        const changedRows = this.vt.resize(cols, rows);
        this.vt.cols = cols;
        this.vt.rows = rows;
        this.logger.debug(`core: vt resize (${cols}x${rows})`);
        this._dispatchEvent("metadata", {
          size: {
            cols,
            rows
          }
        });
        this._dispatchEvent("vtUpdate", {
          size: {
            cols,
            rows
          },
          changedRows
        });
      }
      _initializeVt(cols, rows) {
        this.logger.debug("vt init", {
          cols,
          rows
        });
        this.vt = this.wasm.create(cols, rows, 100, this.boldIsBright);
        this.vt.cols = cols;
        this.vt.rows = rows;
      }
      _parsePoster(poster) {
        if (typeof poster !== "string") return {};
        if (poster.substring(0, 16) == "data:text/plain,") {
          return {
            type: "text",
            value: poster.substring(16)
          };
        } else if (poster.substring(0, 4) == "npt:") {
          return {
            type: "npt",
            value: parseNpt(poster.substring(4))
          };
        }
        return {};
      }
      _normalizeMarkers(markers) {
        if (Array.isArray(markers)) {
          return markers.map((m) => typeof m === "number" ? [m, ""] : m);
        }
      }
    }
    const DRIVERS = /* @__PURE__ */ new Map([["benchmark", benchmark], ["clock", clock], ["eventsource", eventsource], ["random", random], ["recording", recording], ["websocket", websocket]]);
    const PARSERS = /* @__PURE__ */ new Map([["asciicast", parse$2], ["typescript", parse$1], ["ttyrec", parse]]);
    function getDriver(src) {
      if (typeof src === "function") return src;
      if (typeof src === "string") {
        if (src.substring(0, 5) == "ws://" || src.substring(0, 6) == "wss://") {
          src = {
            driver: "websocket",
            url: src
          };
        } else if (src.substring(0, 6) == "clock:") {
          src = {
            driver: "clock"
          };
        } else if (src.substring(0, 7) == "random:") {
          src = {
            driver: "random"
          };
        } else if (src.substring(0, 10) == "benchmark:") {
          src = {
            driver: "benchmark",
            url: src.substring(10)
          };
        } else {
          src = {
            driver: "recording",
            url: src
          };
        }
      }
      if (src.driver === void 0) {
        src.driver = "recording";
      }
      if (src.driver == "recording") {
        if (src.parser === void 0) {
          src.parser = "asciicast";
        }
        if (typeof src.parser === "string") {
          if (PARSERS.has(src.parser)) {
            src.parser = PARSERS.get(src.parser);
          } else {
            throw new Error(`unknown parser: ${src.parser}`);
          }
        }
      }
      if (DRIVERS.has(src.driver)) {
        const driver = DRIVERS.get(src.driver);
        return (callbacks, opts) => driver(src, callbacks, opts);
      } else {
        throw new Error(`unsupported driver: ${JSON.stringify(src)}`);
      }
    }
    const IS_DEV = false;
    const equalFn = (a, b) => a === b;
    const $PROXY = Symbol("solid-proxy");
    const $TRACK = Symbol("solid-track");
    const signalOptions = {
      equals: equalFn
    };
    let runEffects = runQueue;
    const STALE = 1;
    const PENDING = 2;
    const UNOWNED = {
      owned: null,
      cleanups: null,
      context: null,
      owner: null
    };
    var Owner = null;
    let Transition$1 = null;
    let ExternalSourceConfig = null;
    let Listener = null;
    let Updates = null;
    let Effects = null;
    let ExecCount = 0;
    function createRoot(fn2, detachedOwner) {
      const listener = Listener, owner = Owner, unowned = fn2.length === 0, current2 = detachedOwner === void 0 ? owner : detachedOwner, root2 = unowned ? UNOWNED : {
        owned: null,
        cleanups: null,
        context: current2 ? current2.context : null,
        owner: current2
      }, updateFn = unowned ? fn2 : () => fn2(() => untrack(() => cleanNode(root2)));
      Owner = root2;
      Listener = null;
      try {
        return runUpdates(updateFn, true);
      } finally {
        Listener = listener;
        Owner = owner;
      }
    }
    function createSignal(value2, options2) {
      options2 = options2 ? Object.assign({}, signalOptions, options2) : signalOptions;
      const s = {
        value: value2,
        observers: null,
        observerSlots: null,
        comparator: options2.equals || void 0
      };
      const setter = (value3) => {
        if (typeof value3 === "function") {
          value3 = value3(s.value);
        }
        return writeSignal(s, value3);
      };
      return [readSignal.bind(s), setter];
    }
    function createComputed(fn2, value2, options2) {
      const c2 = createComputation(fn2, value2, true, STALE);
      updateComputation(c2);
    }
    function createRenderEffect(fn2, value2, options2) {
      const c2 = createComputation(fn2, value2, false, STALE);
      updateComputation(c2);
    }
    function createEffect(fn2, value2, options2) {
      runEffects = runUserEffects;
      const c2 = createComputation(fn2, value2, false, STALE);
      c2.user = true;
      Effects ? Effects.push(c2) : updateComputation(c2);
    }
    function createMemo(fn2, value2, options2) {
      options2 = options2 ? Object.assign({}, signalOptions, options2) : signalOptions;
      const c2 = createComputation(fn2, value2, true, 0);
      c2.observers = null;
      c2.observerSlots = null;
      c2.comparator = options2.equals || void 0;
      updateComputation(c2);
      return readSignal.bind(c2);
    }
    function batch(fn2) {
      return runUpdates(fn2, false);
    }
    function untrack(fn2) {
      if (Listener === null) return fn2();
      const listener = Listener;
      Listener = null;
      try {
        if (ExternalSourceConfig) ;
        return fn2();
      } finally {
        Listener = listener;
      }
    }
    function onMount(fn2) {
      createEffect(() => untrack(fn2));
    }
    function onCleanup(fn2) {
      if (Owner === null) ;
      else if (Owner.cleanups === null) Owner.cleanups = [fn2];
      else Owner.cleanups.push(fn2);
      return fn2;
    }
    function getListener() {
      return Listener;
    }
    function startTransition(fn2) {
      const l = Listener;
      const o = Owner;
      return Promise.resolve().then(() => {
        Listener = l;
        Owner = o;
        let t2;
        runUpdates(fn2, false);
        Listener = Owner = null;
        return t2 ? t2.done : void 0;
      });
    }
    const [transPending, setTransPending] = /* @__PURE__ */ createSignal(false);
    function useTransition() {
      return [transPending, startTransition];
    }
    function children(fn2) {
      const children2 = createMemo(fn2);
      const memo = createMemo(() => resolveChildren(children2()));
      memo.toArray = () => {
        const c2 = memo();
        return Array.isArray(c2) ? c2 : c2 != null ? [c2] : [];
      };
      return memo;
    }
    function readSignal() {
      if (this.sources && this.state) {
        if (this.state === STALE) updateComputation(this);
        else {
          const updates = Updates;
          Updates = null;
          runUpdates(() => lookUpstream(this), false);
          Updates = updates;
        }
      }
      if (Listener) {
        const sSlot = this.observers ? this.observers.length : 0;
        if (!Listener.sources) {
          Listener.sources = [this];
          Listener.sourceSlots = [sSlot];
        } else {
          Listener.sources.push(this);
          Listener.sourceSlots.push(sSlot);
        }
        if (!this.observers) {
          this.observers = [Listener];
          this.observerSlots = [Listener.sources.length - 1];
        } else {
          this.observers.push(Listener);
          this.observerSlots.push(Listener.sources.length - 1);
        }
      }
      return this.value;
    }
    function writeSignal(node2, value2, isComp) {
      let current2 = node2.value;
      if (!node2.comparator || !node2.comparator(current2, value2)) {
        node2.value = value2;
        if (node2.observers && node2.observers.length) {
          runUpdates(() => {
            for (let i2 = 0; i2 < node2.observers.length; i2 += 1) {
              const o = node2.observers[i2];
              const TransitionRunning = Transition$1 && Transition$1.running;
              if (TransitionRunning && Transition$1.disposed.has(o)) ;
              if (TransitionRunning ? !o.tState : !o.state) {
                if (o.pure) Updates.push(o);
                else Effects.push(o);
                if (o.observers) markDownstream(o);
              }
              if (!TransitionRunning) o.state = STALE;
            }
            if (Updates.length > 1e6) {
              Updates = [];
              if (IS_DEV) ;
              throw new Error();
            }
          }, false);
        }
      }
      return value2;
    }
    function updateComputation(node2) {
      if (!node2.fn) return;
      cleanNode(node2);
      const time = ExecCount;
      runComputation(
        node2,
        node2.value,
        time
      );
    }
    function runComputation(node2, value2, time) {
      let nextValue;
      const owner = Owner, listener = Listener;
      Listener = Owner = node2;
      try {
        nextValue = node2.fn(value2);
      } catch (err2) {
        if (node2.pure) {
          {
            node2.state = STALE;
            node2.owned && node2.owned.forEach(cleanNode);
            node2.owned = null;
          }
        }
        node2.updatedAt = time + 1;
        return handleError(err2);
      } finally {
        Listener = listener;
        Owner = owner;
      }
      if (!node2.updatedAt || node2.updatedAt <= time) {
        if (node2.updatedAt != null && "observers" in node2) {
          writeSignal(node2, nextValue);
        } else node2.value = nextValue;
        node2.updatedAt = time;
      }
    }
    function createComputation(fn2, init2, pure, state = STALE, options2) {
      const c2 = {
        fn: fn2,
        state,
        updatedAt: null,
        owned: null,
        sources: null,
        sourceSlots: null,
        cleanups: null,
        value: init2,
        owner: Owner,
        context: Owner ? Owner.context : null,
        pure
      };
      if (Owner === null) ;
      else if (Owner !== UNOWNED) {
        {
          if (!Owner.owned) Owner.owned = [c2];
          else Owner.owned.push(c2);
        }
      }
      return c2;
    }
    function runTop(node2) {
      if (node2.state === 0) return;
      if (node2.state === PENDING) return lookUpstream(node2);
      if (node2.suspense && untrack(node2.suspense.inFallback)) return node2.suspense.effects.push(node2);
      const ancestors = [node2];
      while ((node2 = node2.owner) && (!node2.updatedAt || node2.updatedAt < ExecCount)) {
        if (node2.state) ancestors.push(node2);
      }
      for (let i2 = ancestors.length - 1; i2 >= 0; i2--) {
        node2 = ancestors[i2];
        if (node2.state === STALE) {
          updateComputation(node2);
        } else if (node2.state === PENDING) {
          const updates = Updates;
          Updates = null;
          runUpdates(() => lookUpstream(node2, ancestors[0]), false);
          Updates = updates;
        }
      }
    }
    function runUpdates(fn2, init2) {
      if (Updates) return fn2();
      let wait = false;
      if (!init2) Updates = [];
      if (Effects) wait = true;
      else Effects = [];
      ExecCount++;
      try {
        const res = fn2();
        completeUpdates(wait);
        return res;
      } catch (err2) {
        if (!wait) Effects = null;
        Updates = null;
        handleError(err2);
      }
    }
    function completeUpdates(wait) {
      if (Updates) {
        runQueue(Updates);
        Updates = null;
      }
      if (wait) return;
      const e = Effects;
      Effects = null;
      if (e.length) runUpdates(() => runEffects(e), false);
    }
    function runQueue(queue) {
      for (let i2 = 0; i2 < queue.length; i2++) runTop(queue[i2]);
    }
    function runUserEffects(queue) {
      let i2, userLength = 0;
      for (i2 = 0; i2 < queue.length; i2++) {
        const e = queue[i2];
        if (!e.user) runTop(e);
        else queue[userLength++] = e;
      }
      for (i2 = 0; i2 < userLength; i2++) runTop(queue[i2]);
    }
    function lookUpstream(node2, ignore) {
      node2.state = 0;
      for (let i2 = 0; i2 < node2.sources.length; i2 += 1) {
        const source2 = node2.sources[i2];
        if (source2.sources) {
          const state = source2.state;
          if (state === STALE) {
            if (source2 !== ignore && (!source2.updatedAt || source2.updatedAt < ExecCount))
              runTop(source2);
          } else if (state === PENDING) lookUpstream(source2, ignore);
        }
      }
    }
    function markDownstream(node2) {
      for (let i2 = 0; i2 < node2.observers.length; i2 += 1) {
        const o = node2.observers[i2];
        if (!o.state) {
          o.state = PENDING;
          if (o.pure) Updates.push(o);
          else Effects.push(o);
          o.observers && markDownstream(o);
        }
      }
    }
    function cleanNode(node2) {
      let i2;
      if (node2.sources) {
        while (node2.sources.length) {
          const source2 = node2.sources.pop(), index = node2.sourceSlots.pop(), obs = source2.observers;
          if (obs && obs.length) {
            const n = obs.pop(), s = source2.observerSlots.pop();
            if (index < obs.length) {
              n.sourceSlots[s] = index;
              obs[index] = n;
              source2.observerSlots[index] = s;
            }
          }
        }
      }
      if (node2.tOwned) {
        for (i2 = node2.tOwned.length - 1; i2 >= 0; i2--) cleanNode(node2.tOwned[i2]);
        delete node2.tOwned;
      }
      if (node2.owned) {
        for (i2 = node2.owned.length - 1; i2 >= 0; i2--) cleanNode(node2.owned[i2]);
        node2.owned = null;
      }
      if (node2.cleanups) {
        for (i2 = node2.cleanups.length - 1; i2 >= 0; i2--) node2.cleanups[i2]();
        node2.cleanups = null;
      }
      node2.state = 0;
    }
    function castError(err2) {
      if (err2 instanceof Error) return err2;
      return new Error(typeof err2 === "string" ? err2 : "Unknown error", {
        cause: err2
      });
    }
    function handleError(err2, owner = Owner) {
      const error2 = castError(err2);
      throw error2;
    }
    function resolveChildren(children2) {
      if (typeof children2 === "function" && !children2.length) return resolveChildren(children2());
      if (Array.isArray(children2)) {
        const results = [];
        for (let i2 = 0; i2 < children2.length; i2++) {
          const result2 = resolveChildren(children2[i2]);
          Array.isArray(result2) ? results.push.apply(results, result2) : results.push(result2);
        }
        return results;
      }
      return children2;
    }
    const FALLBACK = Symbol("fallback");
    function dispose(d) {
      for (let i2 = 0; i2 < d.length; i2++) d[i2]();
    }
    function mapArray(list2, mapFn, options2 = {}) {
      let items = [], mapped = [], disposers = [], len = 0, indexes = mapFn.length > 1 ? [] : null;
      onCleanup(() => dispose(disposers));
      return () => {
        let newItems = list2() || [], newLen = newItems.length, i2, j;
        newItems[$TRACK];
        return untrack(() => {
          let newIndices, newIndicesNext, temp, tempdisposers, tempIndexes, start2, end2, newEnd, item2;
          if (newLen === 0) {
            if (len !== 0) {
              dispose(disposers);
              disposers = [];
              items = [];
              mapped = [];
              len = 0;
              indexes && (indexes = []);
            }
            if (options2.fallback) {
              items = [FALLBACK];
              mapped[0] = createRoot((disposer) => {
                disposers[0] = disposer;
                return options2.fallback();
              });
              len = 1;
            }
          } else if (len === 0) {
            mapped = new Array(newLen);
            for (j = 0; j < newLen; j++) {
              items[j] = newItems[j];
              mapped[j] = createRoot(mapper);
            }
            len = newLen;
          } else {
            temp = new Array(newLen);
            tempdisposers = new Array(newLen);
            indexes && (tempIndexes = new Array(newLen));
            for (start2 = 0, end2 = Math.min(len, newLen); start2 < end2 && items[start2] === newItems[start2]; start2++) ;
            for (end2 = len - 1, newEnd = newLen - 1; end2 >= start2 && newEnd >= start2 && items[end2] === newItems[newEnd]; end2--, newEnd--) {
              temp[newEnd] = mapped[end2];
              tempdisposers[newEnd] = disposers[end2];
              indexes && (tempIndexes[newEnd] = indexes[end2]);
            }
            newIndices = /* @__PURE__ */ new Map();
            newIndicesNext = new Array(newEnd + 1);
            for (j = newEnd; j >= start2; j--) {
              item2 = newItems[j];
              i2 = newIndices.get(item2);
              newIndicesNext[j] = i2 === void 0 ? -1 : i2;
              newIndices.set(item2, j);
            }
            for (i2 = start2; i2 <= end2; i2++) {
              item2 = items[i2];
              j = newIndices.get(item2);
              if (j !== void 0 && j !== -1) {
                temp[j] = mapped[i2];
                tempdisposers[j] = disposers[i2];
                indexes && (tempIndexes[j] = indexes[i2]);
                j = newIndicesNext[j];
                newIndices.set(item2, j);
              } else disposers[i2]();
            }
            for (j = start2; j < newLen; j++) {
              if (j in temp) {
                mapped[j] = temp[j];
                disposers[j] = tempdisposers[j];
                if (indexes) {
                  indexes[j] = tempIndexes[j];
                  indexes[j](j);
                }
              } else mapped[j] = createRoot(mapper);
            }
            mapped = mapped.slice(0, len = newLen);
            items = newItems.slice(0);
          }
          return mapped;
        });
        function mapper(disposer) {
          disposers[j] = disposer;
          if (indexes) {
            const [s, set2] = createSignal(j);
            indexes[j] = set2;
            return mapFn(newItems[j], s);
          }
          return mapFn(newItems[j]);
        }
      };
    }
    function createComponent(Comp, props) {
      return untrack(() => Comp(props || {}));
    }
    const narrowedError = (name2) => `Stale read from <${name2}>.`;
    function For(props) {
      const fallback = "fallback" in props && {
        fallback: () => props.fallback
      };
      return createMemo(mapArray(() => props.each, props.children, fallback || void 0));
    }
    function Show(props) {
      const keyed = props.keyed;
      const conditionValue = createMemo(() => props.when, void 0, void 0);
      const condition = keyed ? conditionValue : createMemo(conditionValue, void 0, {
        equals: (a, b) => !a === !b
      });
      return createMemo(
        () => {
          const c2 = condition();
          if (c2) {
            const child = props.children;
            const fn2 = typeof child === "function" && child.length > 0;
            return fn2 ? untrack(
              () => child(
                keyed ? c2 : () => {
                  if (!untrack(condition)) throw narrowedError("Show");
                  return conditionValue();
                }
              )
            ) : child;
          }
          return props.fallback;
        },
        void 0,
        void 0
      );
    }
    function Switch(props) {
      const chs = children(() => props.children);
      const switchFunc = createMemo(() => {
        const ch3 = chs();
        const mps = Array.isArray(ch3) ? ch3 : [ch3];
        let func = () => void 0;
        for (let i2 = 0; i2 < mps.length; i2++) {
          const index = i2;
          const mp2 = mps[i2];
          const prevFunc = func;
          const conditionValue = createMemo(
            () => prevFunc() ? void 0 : mp2.when,
            void 0,
            void 0
          );
          const condition = mp2.keyed ? conditionValue : createMemo(conditionValue, void 0, {
            equals: (a, b) => !a === !b
          });
          func = () => prevFunc() || (condition() ? [index, conditionValue, mp2] : void 0);
        }
        return func;
      });
      return createMemo(
        () => {
          const sel = switchFunc()();
          if (!sel) return props.fallback;
          const [index, conditionValue, mp2] = sel;
          const child = mp2.children;
          const fn2 = typeof child === "function" && child.length > 0;
          return fn2 ? untrack(
            () => child(
              mp2.keyed ? conditionValue() : () => {
                if (untrack(switchFunc)()?.[0] !== index) throw narrowedError("Match");
                return conditionValue();
              }
            )
          ) : child;
        },
        void 0,
        void 0
      );
    }
    function Match(props) {
      return props;
    }
    function reconcileArrays(parentNode, a, b) {
      let bLength = b.length, aEnd = a.length, bEnd = bLength, aStart = 0, bStart = 0, after = a[aEnd - 1].nextSibling, map2 = null;
      while (aStart < aEnd || bStart < bEnd) {
        if (a[aStart] === b[bStart]) {
          aStart++;
          bStart++;
          continue;
        }
        while (a[aEnd - 1] === b[bEnd - 1]) {
          aEnd--;
          bEnd--;
        }
        if (aEnd === aStart) {
          const node2 = bEnd < bLength ? bStart ? b[bStart - 1].nextSibling : b[bEnd - bStart] : after;
          while (bStart < bEnd) parentNode.insertBefore(b[bStart++], node2);
        } else if (bEnd === bStart) {
          while (aStart < aEnd) {
            if (!map2 || !map2.has(a[aStart])) a[aStart].remove();
            aStart++;
          }
        } else if (a[aStart] === b[bEnd - 1] && b[bStart] === a[aEnd - 1]) {
          const node2 = a[--aEnd].nextSibling;
          parentNode.insertBefore(b[bStart++], a[aStart++].nextSibling);
          parentNode.insertBefore(b[--bEnd], node2);
          a[aEnd] = b[bEnd];
        } else {
          if (!map2) {
            map2 = /* @__PURE__ */ new Map();
            let i2 = bStart;
            while (i2 < bEnd) map2.set(b[i2], i2++);
          }
          const index = map2.get(a[aStart]);
          if (index != null) {
            if (bStart < index && index < bEnd) {
              let i2 = aStart, sequence = 1, t2;
              while (++i2 < aEnd && i2 < bEnd) {
                if ((t2 = map2.get(a[i2])) == null || t2 !== index + sequence) break;
                sequence++;
              }
              if (sequence > index - bStart) {
                const node2 = a[aStart];
                while (bStart < index) parentNode.insertBefore(b[bStart++], node2);
              } else parentNode.replaceChild(b[bStart++], a[aStart++]);
            } else aStart++;
          } else a[aStart++].remove();
        }
      }
    }
    const $$EVENTS = "_$DX_DELEGATE";
    function render(code2, element, init2, options2 = {}) {
      let disposer;
      createRoot((dispose2) => {
        disposer = dispose2;
        element === document ? code2() : insert$1(element, code2(), element.firstChild ? null : void 0, init2);
      }, options2.owner);
      return () => {
        disposer();
        element.textContent = "";
      };
    }
    function template(html2, isImportNode, isSVG, isMathML) {
      let node2;
      const create2 = () => {
        const t2 = document.createElement("template");
        t2.innerHTML = html2;
        return t2.content.firstChild;
      };
      const fn2 = isImportNode ? () => untrack(() => document.importNode(node2 || (node2 = create2()), true)) : () => (node2 || (node2 = create2())).cloneNode(true);
      fn2.cloneNode = fn2;
      return fn2;
    }
    function delegateEvents(eventNames, document2 = window.document) {
      const e = document2[$$EVENTS] || (document2[$$EVENTS] = /* @__PURE__ */ new Set());
      for (let i2 = 0, l = eventNames.length; i2 < l; i2++) {
        const name2 = eventNames[i2];
        if (!e.has(name2)) {
          e.add(name2);
          document2.addEventListener(name2, eventHandler);
        }
      }
    }
    function setAttribute(node2, name2, value2) {
      if (value2 == null) node2.removeAttribute(name2);
      else node2.setAttribute(name2, value2);
    }
    function className(node2, value2) {
      if (value2 == null) node2.removeAttribute("class");
      else node2.className = value2;
    }
    function addEventListener$1(node2, name2, handler, delegate) {
      {
        if (Array.isArray(handler)) {
          node2[`$$${name2}`] = handler[0];
          node2[`$$${name2}Data`] = handler[1];
        } else node2[`$$${name2}`] = handler;
      }
    }
    function style(node2, value2, prev) {
      if (!value2) return prev ? setAttribute(node2, "style") : value2;
      const nodeStyle = node2.style;
      if (typeof value2 === "string") return nodeStyle.cssText = value2;
      typeof prev === "string" && (nodeStyle.cssText = prev = void 0);
      prev || (prev = {});
      value2 || (value2 = {});
      let v, s;
      for (s in prev) {
        value2[s] == null && nodeStyle.removeProperty(s);
        delete prev[s];
      }
      for (s in value2) {
        v = value2[s];
        if (v !== prev[s]) {
          nodeStyle.setProperty(s, v);
          prev[s] = v;
        }
      }
      return prev;
    }
    function use(fn2, element, arg) {
      return untrack(() => fn2(element, arg));
    }
    function insert$1(parent, accessor, marker2, initial) {
      if (marker2 !== void 0 && !initial) initial = [];
      if (typeof accessor !== "function") return insertExpression(parent, accessor, initial, marker2);
      createRenderEffect((current2) => insertExpression(parent, accessor(), current2, marker2), initial);
    }
    function eventHandler(e) {
      let node2 = e.target;
      const key2 = `$$${e.type}`;
      const oriTarget = e.target;
      const oriCurrentTarget = e.currentTarget;
      const retarget = (value2) => Object.defineProperty(e, "target", {
        configurable: true,
        value: value2
      });
      const handleNode = () => {
        const handler = node2[key2];
        if (handler && !node2.disabled) {
          const data = node2[`${key2}Data`];
          data !== void 0 ? handler.call(node2, data, e) : handler.call(node2, e);
          if (e.cancelBubble) return;
        }
        node2.host && typeof node2.host !== "string" && !node2.host._$host && node2.contains(e.target) && retarget(node2.host);
        return true;
      };
      const walkUpTree = () => {
        while (handleNode() && (node2 = node2._$host || node2.parentNode || node2.host)) ;
      };
      Object.defineProperty(e, "currentTarget", {
        configurable: true,
        get() {
          return node2 || document;
        }
      });
      if (e.composedPath) {
        const path = e.composedPath();
        retarget(path[0]);
        for (let i2 = 0; i2 < path.length - 2; i2++) {
          node2 = path[i2];
          if (!handleNode()) break;
          if (node2._$host) {
            node2 = node2._$host;
            walkUpTree();
            break;
          }
          if (node2.parentNode === oriCurrentTarget) {
            break;
          }
        }
      } else walkUpTree();
      retarget(oriTarget);
    }
    function insertExpression(parent, value2, current2, marker2, unwrapArray) {
      while (typeof current2 === "function") current2 = current2();
      if (value2 === current2) return current2;
      const t2 = typeof value2, multi = marker2 !== void 0;
      parent = multi && current2[0] && current2[0].parentNode || parent;
      if (t2 === "string" || t2 === "number") {
        if (t2 === "number") {
          value2 = value2.toString();
          if (value2 === current2) return current2;
        }
        if (multi) {
          let node2 = current2[0];
          if (node2 && node2.nodeType === 3) {
            node2.data !== value2 && (node2.data = value2);
          } else node2 = document.createTextNode(value2);
          current2 = cleanChildren(parent, current2, marker2, node2);
        } else {
          if (current2 !== "" && typeof current2 === "string") {
            current2 = parent.firstChild.data = value2;
          } else current2 = parent.textContent = value2;
        }
      } else if (value2 == null || t2 === "boolean") {
        current2 = cleanChildren(parent, current2, marker2);
      } else if (t2 === "function") {
        createRenderEffect(() => {
          let v = value2();
          while (typeof v === "function") v = v();
          current2 = insertExpression(parent, v, current2, marker2);
        });
        return () => current2;
      } else if (Array.isArray(value2)) {
        const array = [];
        const currentArray = current2 && Array.isArray(current2);
        if (normalizeIncomingArray(array, value2, current2, unwrapArray)) {
          createRenderEffect(() => current2 = insertExpression(parent, array, current2, marker2, true));
          return () => current2;
        }
        if (array.length === 0) {
          current2 = cleanChildren(parent, current2, marker2);
          if (multi) return current2;
        } else if (currentArray) {
          if (current2.length === 0) {
            appendNodes(parent, array, marker2);
          } else reconcileArrays(parent, current2, array);
        } else {
          current2 && cleanChildren(parent);
          appendNodes(parent, array);
        }
        current2 = array;
      } else if (value2.nodeType) {
        if (Array.isArray(current2)) {
          if (multi) return current2 = cleanChildren(parent, current2, marker2, value2);
          cleanChildren(parent, current2, null, value2);
        } else if (current2 == null || current2 === "" || !parent.firstChild) {
          parent.appendChild(value2);
        } else parent.replaceChild(value2, parent.firstChild);
        current2 = value2;
      } else ;
      return current2;
    }
    function normalizeIncomingArray(normalized, array, current2, unwrap2) {
      let dynamic = false;
      for (let i2 = 0, len = array.length; i2 < len; i2++) {
        let item2 = array[i2], prev = current2 && current2[normalized.length], t2;
        if (item2 == null || item2 === true || item2 === false) ;
        else if ((t2 = typeof item2) === "object" && item2.nodeType) {
          normalized.push(item2);
        } else if (Array.isArray(item2)) {
          dynamic = normalizeIncomingArray(normalized, item2, prev) || dynamic;
        } else if (t2 === "function") {
          if (unwrap2) {
            while (typeof item2 === "function") item2 = item2();
            dynamic = normalizeIncomingArray(
              normalized,
              Array.isArray(item2) ? item2 : [item2],
              Array.isArray(prev) ? prev : [prev]
            ) || dynamic;
          } else {
            normalized.push(item2);
            dynamic = true;
          }
        } else {
          const value2 = String(item2);
          if (prev && prev.nodeType === 3 && prev.data === value2) normalized.push(prev);
          else normalized.push(document.createTextNode(value2));
        }
      }
      return dynamic;
    }
    function appendNodes(parent, array, marker2 = null) {
      for (let i2 = 0, len = array.length; i2 < len; i2++) parent.insertBefore(array[i2], marker2);
    }
    function cleanChildren(parent, current2, marker2, replacement) {
      if (marker2 === void 0) return parent.textContent = "";
      const node2 = replacement || document.createTextNode("");
      if (current2.length) {
        let inserted = false;
        for (let i2 = current2.length - 1; i2 >= 0; i2--) {
          const el2 = current2[i2];
          if (node2 !== el2) {
            const isParent2 = el2.parentNode === parent;
            if (!inserted && !i2)
              isParent2 ? parent.replaceChild(node2, el2) : parent.insertBefore(node2, marker2);
            else isParent2 && el2.remove();
          } else inserted = true;
        }
      } else parent.insertBefore(node2, marker2);
      return [node2];
    }
    const $RAW = Symbol("store-raw"), $NODE = Symbol("store-node"), $HAS = Symbol("store-has"), $SELF = Symbol("store-self");
    function wrap$1(value2) {
      let p = value2[$PROXY];
      if (!p) {
        Object.defineProperty(value2, $PROXY, {
          value: p = new Proxy(value2, proxyTraps$1)
        });
        if (!Array.isArray(value2)) {
          const keys = Object.keys(value2), desc = Object.getOwnPropertyDescriptors(value2);
          for (let i2 = 0, l = keys.length; i2 < l; i2++) {
            const prop2 = keys[i2];
            if (desc[prop2].get) {
              Object.defineProperty(value2, prop2, {
                enumerable: desc[prop2].enumerable,
                get: desc[prop2].get.bind(p)
              });
            }
          }
        }
      }
      return p;
    }
    function isWrappable(obj) {
      let proto;
      return obj != null && typeof obj === "object" && (obj[$PROXY] || !(proto = Object.getPrototypeOf(obj)) || proto === Object.prototype || Array.isArray(obj));
    }
    function unwrap(item2, set2 = /* @__PURE__ */ new Set()) {
      let result2, unwrapped, v, prop2;
      if (result2 = item2 != null && item2[$RAW]) return result2;
      if (!isWrappable(item2) || set2.has(item2)) return item2;
      if (Array.isArray(item2)) {
        if (Object.isFrozen(item2)) item2 = item2.slice(0);
        else set2.add(item2);
        for (let i2 = 0, l = item2.length; i2 < l; i2++) {
          v = item2[i2];
          if ((unwrapped = unwrap(v, set2)) !== v) item2[i2] = unwrapped;
        }
      } else {
        if (Object.isFrozen(item2)) item2 = Object.assign({}, item2);
        else set2.add(item2);
        const keys = Object.keys(item2), desc = Object.getOwnPropertyDescriptors(item2);
        for (let i2 = 0, l = keys.length; i2 < l; i2++) {
          prop2 = keys[i2];
          if (desc[prop2].get) continue;
          v = item2[prop2];
          if ((unwrapped = unwrap(v, set2)) !== v) item2[prop2] = unwrapped;
        }
      }
      return item2;
    }
    function getNodes(target2, symbol) {
      let nodes = target2[symbol];
      if (!nodes)
        Object.defineProperty(target2, symbol, {
          value: nodes = /* @__PURE__ */ Object.create(null)
        });
      return nodes;
    }
    function getNode(nodes, property2, value2) {
      if (nodes[property2]) return nodes[property2];
      const [s, set2] = createSignal(value2, {
        equals: false,
        internal: true
      });
      s.$ = set2;
      return nodes[property2] = s;
    }
    function proxyDescriptor$1(target2, property2) {
      const desc = Reflect.getOwnPropertyDescriptor(target2, property2);
      if (!desc || desc.get || !desc.configurable || property2 === $PROXY || property2 === $NODE)
        return desc;
      delete desc.value;
      delete desc.writable;
      desc.get = () => target2[$PROXY][property2];
      return desc;
    }
    function trackSelf(target2) {
      getListener() && getNode(getNodes(target2, $NODE), $SELF)();
    }
    function ownKeys(target2) {
      trackSelf(target2);
      return Reflect.ownKeys(target2);
    }
    const proxyTraps$1 = {
      get(target2, property2, receiver) {
        if (property2 === $RAW) return target2;
        if (property2 === $PROXY) return receiver;
        if (property2 === $TRACK) {
          trackSelf(target2);
          return receiver;
        }
        const nodes = getNodes(target2, $NODE);
        const tracked = nodes[property2];
        let value2 = tracked ? tracked() : target2[property2];
        if (property2 === $NODE || property2 === $HAS || property2 === "__proto__") return value2;
        if (!tracked) {
          const desc = Object.getOwnPropertyDescriptor(target2, property2);
          if (getListener() && (typeof value2 !== "function" || target2.hasOwnProperty(property2)) && !(desc && desc.get))
            value2 = getNode(nodes, property2, value2)();
        }
        return isWrappable(value2) ? wrap$1(value2) : value2;
      },
      has(target2, property2) {
        if (property2 === $RAW || property2 === $PROXY || property2 === $TRACK || property2 === $NODE || property2 === $HAS || property2 === "__proto__")
          return true;
        getListener() && getNode(getNodes(target2, $HAS), property2)();
        return property2 in target2;
      },
      set() {
        return true;
      },
      deleteProperty() {
        return true;
      },
      ownKeys,
      getOwnPropertyDescriptor: proxyDescriptor$1
    };
    function setProperty(state, property2, value2, deleting = false) {
      if (!deleting && state[property2] === value2) return;
      const prev = state[property2], len = state.length;
      if (value2 === void 0) {
        delete state[property2];
        if (state[$HAS] && state[$HAS][property2] && prev !== void 0) state[$HAS][property2].$();
      } else {
        state[property2] = value2;
        if (state[$HAS] && state[$HAS][property2] && prev === void 0) state[$HAS][property2].$();
      }
      let nodes = getNodes(state, $NODE), node2;
      if (node2 = getNode(nodes, property2, prev)) node2.$(() => value2);
      if (Array.isArray(state) && state.length !== len) {
        for (let i2 = state.length; i2 < len; i2++) (node2 = nodes[i2]) && node2.$();
        (node2 = getNode(nodes, "length", len)) && node2.$(state.length);
      }
      (node2 = nodes[$SELF]) && node2.$();
    }
    function mergeStoreNode(state, value2) {
      const keys = Object.keys(value2);
      for (let i2 = 0; i2 < keys.length; i2 += 1) {
        const key2 = keys[i2];
        setProperty(state, key2, value2[key2]);
      }
    }
    function updateArray(current2, next) {
      if (typeof next === "function") next = next(current2);
      next = unwrap(next);
      if (Array.isArray(next)) {
        if (current2 === next) return;
        let i2 = 0, len = next.length;
        for (; i2 < len; i2++) {
          const value2 = next[i2];
          if (current2[i2] !== value2) setProperty(current2, i2, value2);
        }
        setProperty(current2, "length", len);
      } else mergeStoreNode(current2, next);
    }
    function updatePath(current2, path, traversed = []) {
      let part2, prev = current2;
      if (path.length > 1) {
        part2 = path.shift();
        const partType = typeof part2, isArray = Array.isArray(current2);
        if (Array.isArray(part2)) {
          for (let i2 = 0; i2 < part2.length; i2++) {
            updatePath(current2, [part2[i2]].concat(path), traversed);
          }
          return;
        } else if (isArray && partType === "function") {
          for (let i2 = 0; i2 < current2.length; i2++) {
            if (part2(current2[i2], i2)) updatePath(current2, [i2].concat(path), traversed);
          }
          return;
        } else if (isArray && partType === "object") {
          const { from = 0, to: to2 = current2.length - 1, by = 1 } = part2;
          for (let i2 = from; i2 <= to2; i2 += by) {
            updatePath(current2, [i2].concat(path), traversed);
          }
          return;
        } else if (path.length > 1) {
          updatePath(current2[part2], path, [part2].concat(traversed));
          return;
        }
        prev = current2[part2];
        traversed = [part2].concat(traversed);
      }
      let value2 = path[0];
      if (typeof value2 === "function") {
        value2 = value2(prev, traversed);
        if (value2 === prev) return;
      }
      if (part2 === void 0 && value2 == void 0) return;
      value2 = unwrap(value2);
      if (part2 === void 0 || isWrappable(prev) && isWrappable(value2) && !Array.isArray(value2)) {
        mergeStoreNode(prev, value2);
      } else setProperty(current2, part2, value2);
    }
    function createStore(...[store, options2]) {
      const unwrappedStore = unwrap(store || {});
      const isArray = Array.isArray(unwrappedStore);
      const wrappedStore = wrap$1(unwrappedStore);
      function setStore(...args2) {
        batch(() => {
          isArray && args2.length === 1 ? updateArray(unwrappedStore, args2[0]) : updatePath(unwrappedStore, args2);
        });
      }
      return [wrappedStore, setStore];
    }
    const noop = () => {
    };
    const noopTransition = (el2, done) => done();
    function createSwitchTransition(source2, options2) {
      const initSource = untrack(source2);
      const initReturned = initSource ? [initSource] : [];
      const { onEnter = noopTransition, onExit = noopTransition } = options2;
      const [returned, setReturned] = createSignal(options2.appear ? [] : initReturned);
      const [isTransitionPending] = useTransition();
      let next;
      let isExiting = false;
      function exitTransition2(el2, after) {
        if (!el2)
          return after && after();
        isExiting = true;
        onExit(el2, () => {
          batch(() => {
            isExiting = false;
            setReturned((p) => p.filter((e) => e !== el2));
            after && after();
          });
        });
      }
      function enterTransition2(after) {
        const el2 = next;
        if (!el2)
          return after && after();
        next = void 0;
        setReturned((p) => [el2, ...p]);
        onEnter(el2, after ?? noop);
      }
      const triggerTransitions = options2.mode === "out-in" ? (
        // exit -> enter
        // exit -> enter
        (prev) => isExiting || exitTransition2(prev, enterTransition2)
      ) : options2.mode === "in-out" ? (
        // enter -> exit
        // enter -> exit
        (prev) => enterTransition2(() => exitTransition2(prev))
      ) : (
        // exit & enter
        // exit & enter
        (prev) => {
          exitTransition2(prev);
          enterTransition2();
        }
      );
      createComputed((prev) => {
        const el2 = source2();
        if (untrack(isTransitionPending)) {
          isTransitionPending();
          return prev;
        }
        if (el2 !== prev) {
          next = el2;
          batch(() => untrack(() => triggerTransitions(prev)));
        }
        return el2;
      }, options2.appear ? void 0 : initSource);
      return returned;
    }
    const defaultElementPredicate = (item2) => item2 instanceof Element;
    function getFirstChild(value2, predicate) {
      if (predicate(value2))
        return value2;
      if (typeof value2 === "function" && !value2.length)
        return getFirstChild(value2(), predicate);
      if (Array.isArray(value2)) {
        for (const item2 of value2) {
          const result2 = getFirstChild(item2, predicate);
          if (result2)
            return result2;
        }
      }
      return null;
    }
    function resolveFirst(fn2, predicate = defaultElementPredicate, serverPredicate = defaultElementPredicate) {
      const children2 = createMemo(fn2);
      return createMemo(() => getFirstChild(children2(), predicate));
    }
    function createClassnames(props) {
      return createMemo(() => {
        const name2 = props.name || "s";
        return {
          enterActive: (props.enterActiveClass || name2 + "-enter-active").split(" "),
          enter: (props.enterClass || name2 + "-enter").split(" "),
          enterTo: (props.enterToClass || name2 + "-enter-to").split(" "),
          exitActive: (props.exitActiveClass || name2 + "-exit-active").split(" "),
          exit: (props.exitClass || name2 + "-exit").split(" "),
          exitTo: (props.exitToClass || name2 + "-exit-to").split(" "),
          move: (props.moveClass || name2 + "-move").split(" ")
        };
      });
    }
    function nextFrame(fn2) {
      requestAnimationFrame(() => requestAnimationFrame(fn2));
    }
    function enterTransition(classes, events, el2, done) {
      const { onBeforeEnter, onEnter, onAfterEnter } = events;
      onBeforeEnter?.(el2);
      el2.classList.add(...classes.enter);
      el2.classList.add(...classes.enterActive);
      queueMicrotask(() => {
        if (!el2.parentNode)
          return done?.();
        onEnter?.(el2, () => endTransition());
      });
      nextFrame(() => {
        el2.classList.remove(...classes.enter);
        el2.classList.add(...classes.enterTo);
        if (!onEnter || onEnter.length < 2) {
          el2.addEventListener("transitionend", endTransition);
          el2.addEventListener("animationend", endTransition);
        }
      });
      function endTransition(e) {
        if (!e || e.target === el2) {
          done?.();
          el2.removeEventListener("transitionend", endTransition);
          el2.removeEventListener("animationend", endTransition);
          el2.classList.remove(...classes.enterActive);
          el2.classList.remove(...classes.enterTo);
          onAfterEnter?.(el2);
        }
      }
    }
    function exitTransition(classes, events, el2, done) {
      const { onBeforeExit, onExit, onAfterExit } = events;
      if (!el2.parentNode)
        return done?.();
      onBeforeExit?.(el2);
      el2.classList.add(...classes.exit);
      el2.classList.add(...classes.exitActive);
      onExit?.(el2, () => endTransition());
      nextFrame(() => {
        el2.classList.remove(...classes.exit);
        el2.classList.add(...classes.exitTo);
        if (!onExit || onExit.length < 2) {
          el2.addEventListener("transitionend", endTransition);
          el2.addEventListener("animationend", endTransition);
        }
      });
      function endTransition(e) {
        if (!e || e.target === el2) {
          done?.();
          el2.removeEventListener("transitionend", endTransition);
          el2.removeEventListener("animationend", endTransition);
          el2.classList.remove(...classes.exitActive);
          el2.classList.remove(...classes.exitTo);
          onAfterExit?.(el2);
        }
      }
    }
    var TRANSITION_MODE_MAP = {
      inout: "in-out",
      outin: "out-in"
    };
    var Transition = (props) => {
      const classnames = createClassnames(props);
      return createSwitchTransition(
        resolveFirst(() => props.children),
        {
          mode: TRANSITION_MODE_MAP[props.mode],
          appear: props.appear,
          onEnter(el2, done) {
            enterTransition(classnames(), props, el2, done);
          },
          onExit(el2, done) {
            exitTransition(classnames(), props, el2, done);
          }
        }
      );
    };
    const _tmpl$$e = /* @__PURE__ */ template(`<div class="ap-term"><canvas></canvas><svg class="ap-term-symbols" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="none" width="100%" height="100%" aria-hidden="true"><defs></defs><g></g></svg><pre class="ap-term-text" aria-live="off" tabindex="0"></pre></div>`, 12);
    const SVG_NS = "http://www.w3.org/2000/svg";
    const BLOCK_H_RES = 8;
    const BLOCK_V_RES = 24;
    const BOLD_MASK = 1;
    const FAINT_MASK = 1 << 1;
    const ITALIC_MASK = 1 << 2;
    const UNDERLINE_MASK = 1 << 3;
    const STRIKETHROUGH_MASK = 1 << 4;
    const BLINK_MASK = 1 << 5;
    var Terminal = ((props) => {
      const core = props.core;
      const textRowPool = [];
      const vectorSymbolRowPool = [];
      const vectorSymbolUsePool = [];
      const vectorSymbolDefCache = /* @__PURE__ */ new Set();
      const colorsCache = /* @__PURE__ */ new Map();
      const attrClassCache = /* @__PURE__ */ new Map();
      const [size, setSize] = createSignal({
        cols: props.cols,
        rows: props.rows
      }, {
        equals: (newVal, oldVal) => newVal.cols === oldVal.cols && newVal.rows === oldVal.rows
      });
      const [theme2, setTheme] = createSignal(buildTheme$1(FALLBACK_THEME));
      const lineHeight = () => props.lineHeight ?? 1.3333333333;
      const [blinkOn, setBlinkOn] = createSignal(true);
      const cursorOn = createMemo(() => blinkOn() || cursorHold);
      const style$1 = createMemo(() => {
        return {
          width: `${size().cols}ch`,
          height: `${lineHeight() * size().rows}em`,
          "font-size": `${(props.scale || 1) * 100}%`,
          "--term-line-height": `${lineHeight()}em`,
          "--term-cols": size().cols,
          "--term-rows": size().rows
        };
      });
      let cursor = {
        col: 0,
        row: 0,
        visible: false
      };
      let pendingChanges = {
        size: void 0,
        theme: void 0,
        rows: /* @__PURE__ */ new Set()
      };
      let el2;
      let canvasEl;
      let canvasCtx;
      let textEl;
      let vectorSymbolsEl;
      let vectorSymbolDefsEl;
      let vectorSymbolRowsEl;
      let frameRequestId;
      let blinkIntervalId;
      let cssTheme;
      let cursorHold = false;
      onMount(() => {
        setupCanvas();
        setInitialTheme();
        adjustTextRowNodeCount(size().rows);
        adjustSymbolRowNodeCount(size().rows);
        core.addEventListener("vtUpdate", onVtUpdate);
      });
      onCleanup(() => {
        core.removeEventListener("vtUpdate", onVtUpdate);
        clearInterval(blinkIntervalId);
        cancelAnimationFrame(frameRequestId);
      });
      createEffect(() => {
        if (props.blinking && blinkIntervalId === void 0) {
          blinkIntervalId = setInterval(toggleBlink, 600);
        } else {
          clearInterval(blinkIntervalId);
          blinkIntervalId = void 0;
          setBlinkOn(true);
        }
      });
      createEffect(() => {
        cursorOn();
        if (cursor.visible) {
          pendingChanges.rows.add(cursor.row);
          scheduleRender();
        }
      });
      function setupCanvas() {
        canvasCtx = canvasEl.getContext("2d");
        if (!canvasCtx) throw new Error("2D ctx not available");
        const {
          cols,
          rows
        } = size();
        canvasEl.width = cols * BLOCK_H_RES;
        canvasEl.height = rows * BLOCK_V_RES;
        canvasEl.style.imageRendering = "pixelated";
        canvasCtx.imageSmoothingEnabled = false;
      }
      function resizeCanvas(_ref) {
        let {
          cols,
          rows
        } = _ref;
        canvasEl.width = cols * BLOCK_H_RES;
        canvasEl.height = rows * BLOCK_V_RES;
        canvasCtx.imageSmoothingEnabled = false;
      }
      function setInitialTheme() {
        cssTheme = getCssTheme(el2);
        pendingChanges.theme = cssTheme;
      }
      function onVtUpdate(_ref2) {
        let {
          size: newSize,
          theme: theme3,
          changedRows
        } = _ref2;
        let activity = false;
        if (changedRows !== void 0) {
          for (const row2 of changedRows) {
            pendingChanges.rows.add(row2);
            cursorHold = true;
            activity = true;
          }
        }
        if (theme3 !== void 0 && props.preferEmbeddedTheme) {
          pendingChanges.theme = theme3;
          for (let row2 = 0; row2 < size().rows; row2++) {
            pendingChanges.rows.add(row2);
          }
        }
        const newCursor = core.getCursor();
        if (newCursor.visible != cursor.visible || newCursor.col != cursor.col || newCursor.row != cursor.row) {
          if (cursor.visible) {
            pendingChanges.rows.add(cursor.row);
          }
          if (newCursor.visible) {
            pendingChanges.rows.add(newCursor.row);
          }
          cursor = newCursor;
          cursorHold = true;
          activity = true;
        }
        if (newSize !== void 0) {
          pendingChanges.size = newSize;
          for (const row2 of pendingChanges.rows) {
            if (row2 >= newSize.rows) {
              pendingChanges.rows.delete(row2);
            }
          }
        }
        if (activity && cursor.visible) {
          pendingChanges.rows.add(cursor.row);
        }
        scheduleRender();
      }
      function toggleBlink() {
        setBlinkOn((blink) => {
          if (!blink) cursorHold = false;
          return !blink;
        });
      }
      function scheduleRender() {
        if (frameRequestId === void 0) {
          frameRequestId = requestAnimationFrame(render2);
        }
      }
      function render2() {
        frameRequestId = void 0;
        const {
          size: newSize,
          theme: newTheme,
          rows
        } = pendingChanges;
        batch(function() {
          if (newSize !== void 0) {
            resizeCanvas(newSize);
            adjustTextRowNodeCount(newSize.rows);
            adjustSymbolRowNodeCount(newSize.rows);
            setSize(newSize);
          }
          if (newTheme !== void 0) {
            if (newTheme === null) {
              setTheme(buildTheme$1(cssTheme));
            } else {
              setTheme(buildTheme$1(newTheme));
            }
            colorsCache.clear();
          }
          const theme_ = theme2();
          const cursorOn_ = blinkOn() || cursorHold;
          for (const r2 of rows) {
            renderRow(r2, theme_, cursorOn_);
          }
        });
        pendingChanges.size = void 0;
        pendingChanges.theme = void 0;
        pendingChanges.rows.clear();
        props.stats.renders += 1;
      }
      function renderRow(rowIndex, theme3, cursorOn2) {
        const line2 = core.getLine(rowIndex, cursorOn2);
        clearCanvasRow(rowIndex);
        renderRowBg(rowIndex, line2.bg, theme3);
        renderRowRasterSymbols(rowIndex, line2.raster_symbols, theme3);
        renderRowVectorSymbols(rowIndex, line2.vector_symbols, theme3);
        renderRowText(rowIndex, line2.text, line2.codepoints, theme3);
      }
      function clearCanvasRow(rowIndex) {
        canvasCtx.clearRect(0, rowIndex * BLOCK_V_RES, size().cols * BLOCK_H_RES, BLOCK_V_RES);
      }
      function renderRowBg(rowIndex, spans, theme3) {
        const view = core.getDataView(spans, 8);
        const y = rowIndex * BLOCK_V_RES;
        let i2 = 0;
        while (i2 < view.byteLength) {
          const column2 = view.getUint16(i2 + 0, true);
          const width = view.getUint16(i2 + 2, true);
          const color = getColor(view, i2 + 4, theme3);
          i2 += 8;
          canvasCtx.fillStyle = color;
          canvasCtx.fillRect(column2 * BLOCK_H_RES, y, width * BLOCK_H_RES, BLOCK_V_RES);
        }
      }
      function renderRowRasterSymbols(rowIndex, symbols, theme3) {
        const view = core.getDataView(symbols, 12);
        const y = rowIndex * BLOCK_V_RES;
        let i2 = 0;
        while (i2 < view.byteLength) {
          const column2 = view.getUint16(i2 + 0, true);
          const codepoint = view.getUint32(i2 + 4, true);
          const color = getColor(view, i2 + 8, theme3) || theme3.fg;
          i2 += 12;
          canvasCtx.fillStyle = color;
          drawBlockGlyph(canvasCtx, codepoint, column2 * BLOCK_H_RES, y);
        }
      }
      function renderRowVectorSymbols(rowIndex, symbols, theme3) {
        const view = core.getDataView(symbols, 16);
        const frag = document.createDocumentFragment();
        const symbolRow = vectorSymbolRowsEl.children[rowIndex];
        let i2 = 0;
        while (i2 < view.byteLength) {
          const column2 = view.getUint16(i2 + 0, true);
          const codepoint = view.getUint32(i2 + 4, true);
          const color = getColor(view, i2 + 8, theme3);
          const attrs = view.getUint8(i2 + 12);
          i2 += 16;
          const blink = (attrs & BLINK_MASK) !== 0;
          const el3 = createVectorSymbolNode(codepoint, column2, color, blink);
          if (el3) {
            frag.appendChild(el3);
          }
        }
        recycleVectorSymbolUses(symbolRow);
        symbolRow.replaceChildren(frag);
      }
      function renderRowText(rowIndex, spans, codepoints, theme3) {
        const spansView = core.getDataView(spans, 12);
        const codepointsView = core.getUint32Array(codepoints);
        const frag = document.createDocumentFragment();
        let i2 = 0;
        while (i2 < spansView.byteLength) {
          const column2 = spansView.getUint16(i2 + 0, true);
          const codepointsStart = spansView.getUint16(i2 + 2, true);
          const len = spansView.getUint16(i2 + 4, true);
          const color = getColor(spansView, i2 + 6, theme3);
          const attrs = spansView.getUint8(i2 + 10);
          const text2 = String.fromCodePoint(...codepointsView.subarray(codepointsStart, codepointsStart + len));
          i2 += 12;
          const el3 = document.createElement("span");
          const style2 = el3.style;
          style2.setProperty("--offset", column2);
          el3.textContent = text2;
          if (color) {
            style2.color = color;
          }
          const cls = getAttrClass(attrs);
          if (cls !== null) {
            el3.className = cls;
          }
          frag.appendChild(el3);
        }
        textEl.children[rowIndex].replaceChildren(frag);
      }
      function getAttrClass(attrs) {
        let c2 = attrClassCache.get(attrs);
        if (c2 === void 0) {
          c2 = buildAttrClass(attrs);
          attrClassCache.set(attrs, c2);
        }
        return c2;
      }
      function buildAttrClass(attrs) {
        let cls = "";
        if ((attrs & BOLD_MASK) !== 0) {
          cls += "ap-bold ";
        } else if ((attrs & FAINT_MASK) !== 0) {
          cls += "ap-faint ";
        }
        if ((attrs & ITALIC_MASK) !== 0) {
          cls += "ap-italic ";
        }
        if ((attrs & UNDERLINE_MASK) !== 0) {
          cls += "ap-underline ";
        }
        if ((attrs & STRIKETHROUGH_MASK) !== 0) {
          cls += "ap-strike ";
        }
        if ((attrs & BLINK_MASK) !== 0) {
          cls += "ap-blink ";
        }
        return cls === "" ? null : cls;
      }
      function getColor(view, offset2, theme3) {
        const tag = view.getUint8(offset2);
        if (tag === 0) {
          return null;
        } else if (tag === 1) {
          return theme3.fg;
        } else if (tag === 2) {
          return theme3.bg;
        } else if (tag === 3) {
          return theme3.palette[view.getUint8(offset2 + 1)];
        } else if (tag === 4) {
          const key2 = view.getUint32(offset2, true);
          let c2 = colorsCache.get(key2);
          if (c2 === void 0) {
            const r2 = view.getUint8(offset2 + 1);
            const g = view.getUint8(offset2 + 2);
            const b = view.getUint8(offset2 + 3);
            c2 = "rgb(" + r2 + "," + g + "," + b + ")";
            colorsCache.set(key2, c2);
          }
          return c2;
        } else {
          throw new Error(`invalid color tag: ${tag}`);
        }
      }
      function adjustTextRowNodeCount(rows) {
        let r2 = textEl.children.length;
        if (r2 < rows) {
          const frag = document.createDocumentFragment();
          while (r2 < rows) {
            const row2 = getNewRow();
            row2.style.setProperty("--row", r2);
            frag.appendChild(row2);
            r2 += 1;
          }
          textEl.appendChild(frag);
        }
        while (textEl.children.length > rows) {
          const row2 = textEl.lastElementChild;
          textEl.removeChild(row2);
          textRowPool.push(row2);
        }
      }
      function adjustSymbolRowNodeCount(rows) {
        let r2 = vectorSymbolRowsEl.children.length;
        if (r2 < rows) {
          const frag = document.createDocumentFragment();
          while (r2 < rows) {
            const row2 = getNewSymbolRow();
            row2.setAttribute("transform", `translate(0 ${r2})`);
            frag.appendChild(row2);
            r2 += 1;
          }
          vectorSymbolRowsEl.appendChild(frag);
        }
        while (vectorSymbolRowsEl.children.length > rows) {
          const row2 = vectorSymbolRowsEl.lastElementChild;
          vectorSymbolRowsEl.removeChild(row2);
          vectorSymbolRowPool.push(row2);
        }
      }
      function getNewRow() {
        let row2 = textRowPool.pop();
        if (row2 === void 0) {
          row2 = document.createElement("span");
          row2.className = "ap-line";
        }
        return row2;
      }
      function getNewSymbolRow() {
        let row2 = vectorSymbolRowPool.pop();
        if (row2 === void 0) {
          row2 = document.createElementNS(SVG_NS, "g");
          row2.setAttribute("class", "ap-symbol-line");
        }
        return row2;
      }
      function createVectorSymbolNode(codepoint, column2, fg, blink) {
        if (!ensureVectorSymbolDef(codepoint)) {
          return null;
        }
        const isPowerline = POWERLINE_SYMBOLS.has(codepoint);
        const symbolX = isPowerline ? column2 - POWERLINE_SYMBOL_NUDGE : column2;
        const symbolWidth = isPowerline ? 1 + POWERLINE_SYMBOL_NUDGE * 2 : 1;
        const node2 = getVectorSymbolUse();
        node2.setAttribute("href", `#sym-${codepoint}`);
        node2.setAttribute("x", symbolX);
        node2.setAttribute("y", 0);
        node2.setAttribute("width", symbolWidth);
        node2.setAttribute("height", "1");
        if (fg) {
          node2.style.setProperty("color", fg);
        } else {
          node2.style.removeProperty("color");
        }
        if (blink) {
          node2.classList.add("ap-blink");
        } else {
          node2.classList.remove("ap-blink");
        }
        return node2;
      }
      function recycleVectorSymbolUses(row2) {
        while (row2.firstChild) {
          const child = row2.firstChild;
          row2.removeChild(child);
          vectorSymbolUsePool.push(child);
        }
      }
      function getVectorSymbolUse() {
        let node2 = vectorSymbolUsePool.pop();
        if (node2 === void 0) {
          node2 = document.createElementNS(SVG_NS, "use");
        }
        return node2;
      }
      function ensureVectorSymbolDef(codepoint) {
        const content2 = getVectorSymbolDef(codepoint);
        if (!content2) {
          return false;
        }
        if (vectorSymbolDefCache.has(codepoint)) {
          return true;
        }
        const id = `sym-${codepoint}`;
        const symbol = document.createElementNS(SVG_NS, "symbol");
        symbol.setAttribute("id", id);
        symbol.setAttribute("viewBox", "0 0 1 1");
        symbol.setAttribute("preserveAspectRatio", "none");
        symbol.setAttribute("overflow", "visible");
        symbol.innerHTML = content2;
        vectorSymbolDefsEl.appendChild(symbol);
        vectorSymbolDefCache.add(codepoint);
        return true;
      }
      return (() => {
        const _el$ = _tmpl$$e.cloneNode(true), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling, _el$4 = _el$3.firstChild, _el$5 = _el$4.nextSibling, _el$6 = _el$3.nextSibling;
        const _ref$ = el2;
        typeof _ref$ === "function" ? use(_ref$, _el$) : el2 = _el$;
        const _ref$2 = canvasEl;
        typeof _ref$2 === "function" ? use(_ref$2, _el$2) : canvasEl = _el$2;
        const _ref$3 = vectorSymbolsEl;
        typeof _ref$3 === "function" ? use(_ref$3, _el$3) : vectorSymbolsEl = _el$3;
        const _ref$4 = vectorSymbolDefsEl;
        typeof _ref$4 === "function" ? use(_ref$4, _el$4) : vectorSymbolDefsEl = _el$4;
        const _ref$5 = vectorSymbolRowsEl;
        typeof _ref$5 === "function" ? use(_ref$5, _el$5) : vectorSymbolRowsEl = _el$5;
        const _ref$6 = textEl;
        typeof _ref$6 === "function" ? use(_ref$6, _el$6) : textEl = _el$6;
        createRenderEffect((_p$) => {
          const _v$ = style$1(), _v$2 = `0 0 ${size().cols} ${size().rows}`, _v$3 = !!blinkOn(), _v$4 = !!blinkOn();
          _p$._v$ = style(_el$, _v$, _p$._v$);
          _v$2 !== _p$._v$2 && setAttribute(_el$3, "viewBox", _p$._v$2 = _v$2);
          _v$3 !== _p$._v$3 && _el$3.classList.toggle("ap-blink", _p$._v$3 = _v$3);
          _v$4 !== _p$._v$4 && _el$6.classList.toggle("ap-blink", _p$._v$4 = _v$4);
          return _p$;
        }, {
          _v$: void 0,
          _v$2: void 0,
          _v$3: void 0,
          _v$4: void 0
        });
        return _el$;
      })();
    });
    function buildTheme$1(theme2) {
      return {
        fg: theme2.foreground,
        bg: theme2.background,
        palette: [...theme2.palette, ...FULL_PALETTE]
      };
    }
    function getCssTheme(el2) {
      const style2 = getComputedStyle(el2);
      const foreground = style2.getPropertyValue("--term-color-foreground");
      const background = style2.getPropertyValue("--term-color-background");
      const palette = [];
      for (let i2 = 0; i2 < 16; i2++) {
        const c2 = style2.getPropertyValue(`--term-color-${i2}`);
        if (c2 === void 0) throw new Error(`--term-color-${i2} has not been defined`);
        palette[i2] = c2;
      }
      return {
        foreground,
        background,
        palette
      };
    }
    function drawBlockGlyph(ctx, codepoint, x2, y) {
      const unitX = BLOCK_H_RES / 8;
      const unitY = BLOCK_V_RES / 8;
      const halfX = BLOCK_H_RES / 2;
      const halfY = BLOCK_V_RES / 2;
      const sextantX = BLOCK_H_RES / 2;
      const sextantY = BLOCK_V_RES / 3;
      switch (codepoint) {
        case 9600:
          ctx.fillRect(x2, y, BLOCK_H_RES, halfY);
          break;
        case 9601:
          ctx.fillRect(x2, y + unitY * 7, BLOCK_H_RES, unitY);
          break;
        case 9602:
          ctx.fillRect(x2, y + unitY * 6, BLOCK_H_RES, unitY * 2);
          break;
        case 9603:
          ctx.fillRect(x2, y + unitY * 5, BLOCK_H_RES, unitY * 3);
          break;
        case 9604:
          ctx.fillRect(x2, y + halfY, BLOCK_H_RES, halfY);
          break;
        case 9605:
          ctx.fillRect(x2, y + unitY * 3, BLOCK_H_RES, unitY * 5);
          break;
        case 9606:
          ctx.fillRect(x2, y + unitY * 2, BLOCK_H_RES, unitY * 6);
          break;
        case 9607:
          ctx.fillRect(x2, y + unitY, BLOCK_H_RES, unitY * 7);
          break;
        case 9608:
          ctx.fillRect(x2, y, BLOCK_H_RES, BLOCK_V_RES);
          break;
        case 9632:
          ctx.fillRect(x2, y + unitY * 2, BLOCK_H_RES, unitY * 4);
          break;
        case 9609:
          ctx.fillRect(x2, y, unitX * 7, BLOCK_V_RES);
          break;
        case 9610:
          ctx.fillRect(x2, y, unitX * 6, BLOCK_V_RES);
          break;
        case 9611:
          ctx.fillRect(x2, y, unitX * 5, BLOCK_V_RES);
          break;
        case 9612:
          ctx.fillRect(x2, y, halfX, BLOCK_V_RES);
          break;
        case 9613:
          ctx.fillRect(x2, y, unitX * 3, BLOCK_V_RES);
          break;
        case 9614:
          ctx.fillRect(x2, y, unitX * 2, BLOCK_V_RES);
          break;
        case 9615:
          ctx.fillRect(x2, y, unitX, BLOCK_V_RES);
          break;
        case 9616:
          ctx.fillRect(x2 + halfX, y, halfX, BLOCK_V_RES);
          break;
        case 9617:
          ctx.save();
          ctx.globalAlpha = 0.25;
          ctx.fillRect(x2, y, BLOCK_H_RES, BLOCK_V_RES);
          ctx.restore();
          break;
        case 9618:
          ctx.save();
          ctx.globalAlpha = 0.5;
          ctx.fillRect(x2, y, BLOCK_H_RES, BLOCK_V_RES);
          ctx.restore();
          break;
        case 9619:
          ctx.save();
          ctx.globalAlpha = 0.75;
          ctx.fillRect(x2, y, BLOCK_H_RES, BLOCK_V_RES);
          ctx.restore();
          break;
        case 9620:
          ctx.fillRect(x2, y, BLOCK_H_RES, unitY);
          break;
        case 9621:
          ctx.fillRect(x2 + unitX * 7, y, unitX, BLOCK_V_RES);
          break;
        case 9622:
          ctx.fillRect(x2, y + halfY, halfX, halfY);
          break;
        case 9623:
          ctx.fillRect(x2 + halfX, y + halfY, halfX, halfY);
          break;
        case 9624:
          ctx.fillRect(x2, y, halfX, halfY);
          break;
        case 9625:
          ctx.fillRect(x2, y, halfX, BLOCK_V_RES);
          ctx.fillRect(x2 + halfX, y + halfY, halfX, halfY);
          break;
        case 9626:
          ctx.fillRect(x2, y, halfX, halfY);
          ctx.fillRect(x2 + halfX, y + halfY, halfX, halfY);
          break;
        case 9627:
          ctx.fillRect(x2, y, BLOCK_H_RES, halfY);
          ctx.fillRect(x2, y + halfY, halfX, halfY);
          break;
        case 9628:
          ctx.fillRect(x2, y, BLOCK_H_RES, halfY);
          ctx.fillRect(x2 + halfX, y + halfY, halfX, halfY);
          break;
        case 9629:
          ctx.fillRect(x2 + halfX, y, halfX, halfY);
          break;
        case 9630:
          ctx.fillRect(x2 + halfX, y, halfX, halfY);
          ctx.fillRect(x2, y + halfY, halfX, halfY);
          break;
        case 9631:
          ctx.fillRect(x2 + halfX, y, halfX, BLOCK_V_RES);
          ctx.fillRect(x2, y + halfY, halfX, halfY);
          break;
        case 129792:
          ctx.fillRect(x2, y, sextantX, sextantY);
          break;
        case 129793:
          ctx.fillRect(x2 + sextantX, y, sextantX, sextantY);
          break;
        case 129794:
          ctx.fillRect(x2, y, sextantX * 2, sextantY);
          break;
        case 129795:
          ctx.fillRect(x2, y + sextantY, sextantX, sextantY);
          break;
        case 129796:
          ctx.fillRect(x2, y, sextantX, sextantY);
          ctx.fillRect(x2, y + sextantY, sextantX, sextantY);
          break;
        case 129797:
          ctx.fillRect(x2 + sextantX, y, sextantX, sextantY);
          ctx.fillRect(x2, y + sextantY, sextantX, sextantY);
          break;
        case 129798:
          ctx.fillRect(x2, y, sextantX * 2, sextantY);
          ctx.fillRect(x2, y + sextantY, sextantX, sextantY);
          break;
        case 129799:
          ctx.fillRect(x2 + sextantX, y + sextantY, sextantX, sextantY);
          break;
        case 129800:
          ctx.fillRect(x2, y, sextantX, sextantY);
          ctx.fillRect(x2 + sextantX, y + sextantY, sextantX, sextantY);
          break;
        case 129801:
          ctx.fillRect(x2 + sextantX, y, sextantX, sextantY);
          ctx.fillRect(x2 + sextantX, y + sextantY, sextantX, sextantY);
          break;
        case 129802:
          ctx.fillRect(x2, y, sextantX * 2, sextantY);
          ctx.fillRect(x2 + sextantX, y + sextantY, sextantX, sextantY);
          break;
        case 129803:
          ctx.fillRect(x2, y + sextantY, sextantX * 2, sextantY);
          break;
        case 129804:
          ctx.fillRect(x2, y, sextantX, sextantY);
          ctx.fillRect(x2, y + sextantY, sextantX * 2, sextantY);
          break;
        case 129805:
          ctx.fillRect(x2 + sextantX, y, sextantX, sextantY);
          ctx.fillRect(x2, y + sextantY, sextantX * 2, sextantY);
          break;
        case 129806:
          ctx.fillRect(x2, y, sextantX * 2, sextantY);
          ctx.fillRect(x2, y + sextantY, sextantX * 2, sextantY);
          break;
        case 129807:
          ctx.fillRect(x2, y + sextantY * 2, sextantX, sextantY);
          break;
        case 129808:
          ctx.fillRect(x2, y, sextantX, sextantY);
          ctx.fillRect(x2, y + sextantY * 2, sextantX, sextantY);
          break;
        case 129809:
          ctx.fillRect(x2 + sextantX, y, sextantX, sextantY);
          ctx.fillRect(x2, y + sextantY * 2, sextantX, sextantY);
          break;
        case 129810:
          ctx.fillRect(x2, y, sextantX * 2, sextantY);
          ctx.fillRect(x2, y + sextantY * 2, sextantX, sextantY);
          break;
        case 129811:
          ctx.fillRect(x2, y + sextantY, sextantX, sextantY * 2);
          break;
        case 129812:
          ctx.fillRect(x2 + sextantX, y, sextantX, sextantY);
          ctx.fillRect(x2, y + sextantY, sextantX, sextantY * 2);
          break;
        case 129813:
          ctx.fillRect(x2, y, sextantX * 2, sextantY);
          ctx.fillRect(x2, y + sextantY, sextantX, sextantY * 2);
          break;
        case 129814:
          ctx.fillRect(x2 + sextantX, y + sextantY, sextantX, sextantY);
          ctx.fillRect(x2, y + sextantY * 2, sextantX, sextantY);
          break;
        case 129815:
          ctx.fillRect(x2, y, sextantX, sextantY);
          ctx.fillRect(x2 + sextantX, y + sextantY, sextantX, sextantY);
          ctx.fillRect(x2, y + sextantY * 2, sextantX, sextantY);
          break;
        case 129816:
          ctx.fillRect(x2 + sextantX, y, sextantX, sextantY * 2);
          ctx.fillRect(x2, y + sextantY * 2, sextantX, sextantY);
          break;
        case 129817:
          ctx.fillRect(x2, y, sextantX * 2, sextantY);
          ctx.fillRect(x2 + sextantX, y + sextantY, sextantX, sextantY);
          ctx.fillRect(x2, y + sextantY * 2, sextantX, sextantY);
          break;
        case 129818:
          ctx.fillRect(x2, y + sextantY, sextantX * 2, sextantY);
          ctx.fillRect(x2, y + sextantY * 2, sextantX, sextantY);
          break;
        case 129819:
          ctx.fillRect(x2, y, sextantX, sextantY * 3);
          ctx.fillRect(x2 + sextantX, y + sextantY, sextantX, sextantY);
          break;
        case 129820:
          ctx.fillRect(x2 + sextantX, y, sextantX, sextantY);
          ctx.fillRect(x2, y + sextantY, sextantX * 2, sextantY);
          ctx.fillRect(x2, y + sextantY * 2, sextantX, sextantY);
          break;
        case 129821:
          ctx.fillRect(x2, y, sextantX * 2, sextantY * 2);
          ctx.fillRect(x2, y + sextantY * 2, sextantX, sextantY);
          break;
        case 129822:
          ctx.fillRect(x2 + sextantX, y + sextantY * 2, sextantX, sextantY);
          break;
        case 129823:
          ctx.fillRect(x2, y, sextantX, sextantY);
          ctx.fillRect(x2 + sextantX, y + sextantY * 2, sextantX, sextantY);
          break;
        case 129824:
          ctx.fillRect(x2 + sextantX, y, sextantX, sextantY);
          ctx.fillRect(x2 + sextantX, y + sextantY * 2, sextantX, sextantY);
          break;
        case 129825:
          ctx.fillRect(x2, y, sextantX * 2, sextantY);
          ctx.fillRect(x2 + sextantX, y + sextantY * 2, sextantX, sextantY);
          break;
        case 129826:
          ctx.fillRect(x2, y + sextantY, sextantX, sextantY);
          ctx.fillRect(x2 + sextantX, y + sextantY * 2, sextantX, sextantY);
          break;
        case 129827:
          ctx.fillRect(x2, y, sextantX, sextantY * 2);
          ctx.fillRect(x2 + sextantX, y + sextantY * 2, sextantX, sextantY);
          break;
        case 129828:
          ctx.fillRect(x2 + sextantX, y, sextantX, sextantY);
          ctx.fillRect(x2, y + sextantY, sextantX, sextantY);
          ctx.fillRect(x2 + sextantX, y + sextantY * 2, sextantX, sextantY);
          break;
        case 129829:
          ctx.fillRect(x2, y, sextantX * 2, sextantY);
          ctx.fillRect(x2, y + sextantY, sextantX, sextantY);
          ctx.fillRect(x2 + sextantX, y + sextantY * 2, sextantX, sextantY);
          break;
        case 129830:
          ctx.fillRect(x2 + sextantX, y + sextantY, sextantX, sextantY * 2);
          break;
        case 129831:
          ctx.fillRect(x2, y, sextantX, sextantY);
          ctx.fillRect(x2 + sextantX, y + sextantY, sextantX, sextantY * 2);
          break;
        case 129832:
          ctx.fillRect(x2, y, sextantX * 2, sextantY);
          ctx.fillRect(x2 + sextantX, y + sextantY, sextantX, sextantY * 2);
          break;
        case 129833:
          ctx.fillRect(x2, y + sextantY, sextantX * 2, sextantY);
          ctx.fillRect(x2 + sextantX, y + sextantY * 2, sextantX, sextantY);
          break;
        case 129834:
          ctx.fillRect(x2, y, sextantX, sextantY * 2);
          ctx.fillRect(x2 + sextantX, y + sextantY, sextantX, sextantY * 2);
          break;
        case 129835:
          ctx.fillRect(x2 + sextantX, y, sextantX, sextantY);
          ctx.fillRect(x2, y + sextantY, sextantX * 2, sextantY);
          ctx.fillRect(x2 + sextantX, y + sextantY * 2, sextantX, sextantY);
          break;
        case 129836:
          ctx.fillRect(x2, y, sextantX * 2, sextantY * 2);
          ctx.fillRect(x2 + sextantX, y + sextantY * 2, sextantX, sextantY);
          break;
        case 129837:
          ctx.fillRect(x2, y + sextantY * 2, sextantX * 2, sextantY);
          break;
        case 129838:
          ctx.fillRect(x2, y, sextantX, sextantY);
          ctx.fillRect(x2, y + sextantY * 2, sextantX * 2, sextantY);
          break;
        case 129839:
          ctx.fillRect(x2 + sextantX, y, sextantX, sextantY);
          ctx.fillRect(x2, y + sextantY * 2, sextantX * 2, sextantY);
          break;
        case 129840:
          ctx.fillRect(x2, y, sextantX * 2, sextantY);
          ctx.fillRect(x2, y + sextantY * 2, sextantX * 2, sextantY);
          break;
        case 129841:
          ctx.fillRect(x2, y + sextantY, sextantX, sextantY);
          ctx.fillRect(x2, y + sextantY * 2, sextantX * 2, sextantY);
          break;
        case 129842:
          ctx.fillRect(x2, y, sextantX, sextantY * 2);
          ctx.fillRect(x2, y + sextantY * 2, sextantX * 2, sextantY);
          break;
        case 129843:
          ctx.fillRect(x2 + sextantX, y, sextantX, sextantY);
          ctx.fillRect(x2, y + sextantY, sextantX, sextantY);
          ctx.fillRect(x2, y + sextantY * 2, sextantX * 2, sextantY);
          break;
        case 129844:
          ctx.fillRect(x2, y, sextantX * 2, sextantY);
          ctx.fillRect(x2, y + sextantY, sextantX, sextantY);
          ctx.fillRect(x2, y + sextantY * 2, sextantX * 2, sextantY);
          break;
        case 129845:
          ctx.fillRect(x2 + sextantX, y + sextantY, sextantX, sextantY);
          ctx.fillRect(x2, y + sextantY * 2, sextantX * 2, sextantY);
          break;
        case 129846:
          ctx.fillRect(x2, y, sextantX, sextantY);
          ctx.fillRect(x2 + sextantX, y + sextantY, sextantX, sextantY);
          ctx.fillRect(x2, y + sextantY * 2, sextantX * 2, sextantY);
          break;
        case 129847:
          ctx.fillRect(x2 + sextantX, y, sextantX, sextantY * 2);
          ctx.fillRect(x2, y + sextantY * 2, sextantX * 2, sextantY);
          break;
        case 129848:
          ctx.fillRect(x2, y, sextantX * 2, sextantY);
          ctx.fillRect(x2 + sextantX, y + sextantY, sextantX, sextantY);
          ctx.fillRect(x2, y + sextantY * 2, sextantX * 2, sextantY);
          break;
        case 129849:
          ctx.fillRect(x2, y + sextantY, sextantX * 2, sextantY * 2);
          break;
        case 129850:
          ctx.fillRect(x2, y, sextantX, sextantY * 3);
          ctx.fillRect(x2 + sextantX, y + sextantY, sextantX, sextantY);
          ctx.fillRect(x2 + sextantX, y + sextantY * 2, sextantX, sextantY);
          break;
        case 129851:
          ctx.fillRect(x2 + sextantX, y, sextantX, sextantY);
          ctx.fillRect(x2, y + sextantY, sextantX * 2, sextantY * 2);
          break;
      }
    }
    const SYMBOL_STROKE = 0.05;
    const CELL_RATIO = 9.0375 / 20;
    function getVectorSymbolDef(codepoint) {
      const stroke = `stroke="currentColor" stroke-width="${SYMBOL_STROKE}" stroke-linejoin="miter" stroke-linecap="square"`;
      const strokeButt = `stroke="currentColor" stroke-width="${SYMBOL_STROKE}" stroke-linejoin="miter" stroke-linecap="butt"`;
      const stroked = (d) => `<path d="${d}" fill="none" ${stroke}/>`;
      const third = 1 / 3;
      const twoThirds = 2 / 3;
      switch (codepoint) {
        // ◢ - black lower right triangle (https://symbl.cc/en/25E2/)
        case 9698:
          return '<path d="M1,1 L1,0 L0,1 Z" fill="currentColor"/>' + stroked("M1,1 L1,0 L0,1 Z");
        // ◣ - black lower left triangle (https://symbl.cc/en/25E3/)
        case 9699:
          return '<path d="M0,1 L0,0 L1,1 Z" fill="currentColor"/>' + stroked("M0,1 L0,0 L1,1 Z");
        // ◤ - black upper left triangle (https://symbl.cc/en/25E4/)
        case 9700:
          return '<path d="M0,0 L1,0 L0,1 Z" fill="currentColor"/>' + stroked("M0,0 L1,0 L0,1 Z");
        // ◥ - black upper right triangle (https://symbl.cc/en/25E5/)
        case 9701:
          return '<path d="M1,0 L1,1 L0,0 Z" fill="currentColor"/>' + stroked("M1,0 L1,1 L0,0 Z");
        case 9871: {
          const horizontalGap = 0.15;
          const verticalGap = 0.2;
          const lineHeight = 0.17;
          const halfHorizontalGap = horizontalGap / 2;
          const halfVerticalGap = verticalGap / 2;
          const toViewBoxY = (offset2) => 0.5 + offset2 * CELL_RATIO;
          const leftX1 = 0.5 - halfHorizontalGap;
          const rightX0 = 0.5 + halfHorizontalGap;
          const rightX1 = 1 + 0.02;
          const topY0 = toViewBoxY(-halfVerticalGap - lineHeight);
          const topY1 = toViewBoxY(-halfVerticalGap);
          const bottomY0 = toViewBoxY(halfVerticalGap);
          const bottomY1 = toViewBoxY(halfVerticalGap + lineHeight);
          const rect2 = (x0, x1, y0, y1) => `M${x0},${y0} L${x1},${y0} L${x1},${y1} L${x0},${y1} Z`;
          return `<path d="${rect2(0, leftX1, topY0, topY1)} ${rect2(rightX0, rightX1, topY0, topY1)} ${rect2(0, leftX1, bottomY0, bottomY1)} ${rect2(rightX0, rightX1, bottomY0, bottomY1)}" fill="currentColor"/>`;
        }
        // 🬼 - lower left block diagonal lower middle left to lower centre (https://symbl.cc/en/1FB3C/)
        case 129852:
          return `<path d="M0,${twoThirds} L0,1 L0.5,1 Z" fill="currentColor"/>` + stroked(`M0,${twoThirds} L0,1 L0.5,1 Z`);
        // 🬽 - lower left block diagonal lower middle left to lower right (https://symbl.cc/en/1FB3D/)
        case 129853:
          return `<path d="M0,${twoThirds} L0,1 L1,1 Z" fill="currentColor"/>` + stroked(`M0,${twoThirds} L0,1 L1,1 Z`);
        // 🬾 - lower left block diagonal upper middle left to lower centre (https://symbl.cc/en/1FB3E/)
        case 129854:
          return `<path d="M0,${third} L0.5,1 L0,1 Z" fill="currentColor"/>` + stroked(`M0,${third} L0.5,1 L0,1 Z`);
        // 🬿 - lower left block diagonal upper middle left to lower right (https://symbl.cc/en/1FB3F/)
        case 129855:
          return `<path d="M0,${third} L1,1 L0,1 Z" fill="currentColor"/>` + stroked(`M0,${third} L1,1 L0,1 Z`);
        // 🭀 - lower left block diagonal upper left to lower centre (https://symbl.cc/en/1FB40/)
        case 129856:
          return '<path d="M0,0 L0.5,1 L0,1 Z" fill="currentColor"/>' + stroked("M0,0 L0.5,1 L0,1 Z");
        // 🭁 - lower right block diagonal upper middle left to upper centre (https://symbl.cc/en/1FB41/)
        case 129857:
          return `<path d="M0,${third} L0,1 L1,1 L1,0 L0.5,0 Z" fill="currentColor"/>` + stroked(`M0,${third} L0,1 L1,1 L1,0 L0.5,0 Z`);
        // 🭂 - lower right block diagonal upper middle left to upper right (https://symbl.cc/en/1FB42/)
        case 129858:
          return `<path d="M0,${third} L0,1 L1,1 L1,0 Z" fill="currentColor"/>` + stroked(`M0,${third} L0,1 L1,1 L1,0 Z`);
        // 🭃 - lower right block diagonal lower middle left to upper centre (https://symbl.cc/en/1FB43/)
        case 129859:
          return `<path d="M0,${twoThirds} L0,1 L1,1 L1,0 L0.5,0 Z" fill="currentColor"/>` + stroked(`M0,${twoThirds} L0,1 L1,1 L1,0 L0.5,0 Z`);
        // 🭄 - lower right block diagonal lower middle left to upper right (https://symbl.cc/en/1FB44/)
        case 129860:
          return `<path d="M0,${twoThirds} L0,1 L1,1 L1,0 Z" fill="currentColor"/>` + stroked(`M0,${twoThirds} L0,1 L1,1 L1,0 Z`);
        // 🭅 - lower right block diagonal lower left to upper centre (https://symbl.cc/en/1FB45/)
        case 129861:
          return '<path d="M0.5,0 L1,0 L1,1 L0,1 Z" fill="currentColor"/>' + stroked("M0.5,0 L1,0 L1,1 L0,1 Z");
        // 🭆 - lower right block diagonal lower middle left to upper middle right (https://symbl.cc/en/1FB46/)
        case 129862:
          return `<path d="M0,${twoThirds} L0,1 L1,1 L1,${third} Z" fill="currentColor"/>` + stroked(`M0,${twoThirds} L0,1 L1,1 L1,${third} Z`);
        // 🭇 - lower right block diagonal lower centre to lower middle right (https://symbl.cc/en/1FB47/)
        case 129863:
          return `<path d="M0.5,1 L1,1 L1,${twoThirds} Z" fill="currentColor"/>` + stroked(`M0.5,1 L1,1 L1,${twoThirds} Z`);
        // 🭈 - lower right block diagonal lower left to lower middle right (https://symbl.cc/en/1FB48/)
        case 129864:
          return `<path d="M0,1 L1,1 L1,${twoThirds} Z" fill="currentColor"/>` + stroked(`M0,1 L1,1 L1,${twoThirds} Z`);
        // 🭉 - lower right block diagonal lower centre to upper middle right (https://symbl.cc/en/1FB49/)
        case 129865:
          return `<path d="M0.5,1 L1,1 L1,${third} Z" fill="currentColor"/>` + stroked(`M0.5,1 L1,1 L1,${third} Z`);
        // 🭊 - lower right block diagonal lower left to upper middle right (https://symbl.cc/en/1FB4A/)
        case 129866:
          return `<path d="M0,1 L1,1 L1,${third} Z" fill="currentColor"/>` + stroked(`M0,1 L1,1 L1,${third} Z`);
        // 🭋 - lower right block diagonal lower centre to upper right (https://symbl.cc/en/1FB4B/)
        case 129867:
          return '<path d="M0.5,1 L1,0 L1,1 Z" fill="currentColor"/>' + stroked("M0.5,1 L1,0 L1,1 Z");
        // 🭌 - lower left block diagonal upper centre to upper middle right (https://symbl.cc/en/1FB4C/)
        case 129868:
          return `<path d="M0,0 L0.5,0 L1,${third} L1,1 L0,1 Z" fill="currentColor"/>` + stroked(`M0,0 L0.5,0 L1,${third} L1,1 L0,1 Z`);
        // 🭍 - lower left block diagonal upper left to upper middle right (https://symbl.cc/en/1FB4D/)
        case 129869:
          return `<path d="M0,0 L0,1 L1,1 L1,${third} Z" fill="currentColor"/>` + stroked(`M0,0 L0,1 L1,1 L1,${third} Z`);
        // 🭎 - lower left block diagonal upper centre to lower middle right (https://symbl.cc/en/1FB4E/)
        case 129870:
          return `<path d="M0,0 L0.5,0 L1,${twoThirds} L1,1 L0,1 Z" fill="currentColor"/>` + stroked(`M0,0 L0.5,0 L1,${twoThirds} L1,1 L0,1 Z`);
        // 🭏 - lower left block diagonal upper left to lower middle right (https://symbl.cc/en/1FB4F/)
        case 129871:
          return `<path d="M0,0 L1,${twoThirds} L1,1 L0,1 Z" fill="currentColor"/>` + stroked(`M0,0 L1,${twoThirds} L1,1 L0,1 Z`);
        // 🭐 - lower left block diagonal upper centre to lower right (https://symbl.cc/en/1FB50/)
        case 129872:
          return '<path d="M0,0 L0.5,0 L1,1 L0,1 Z" fill="currentColor"/>' + stroked("M0,0 L0.5,0 L1,1 L0,1 Z");
        // 🭑 - lower left block diagonal upper middle left to lower middle right (https://symbl.cc/en/1FB51/)
        case 129873:
          return `<path d="M0,${third} L1,${twoThirds} L1,1 L0,1 Z" fill="currentColor"/>` + stroked(`M0,${third} L1,${twoThirds} L1,1 L0,1 Z`);
        // 🭒 - upper right block diagonal lower middle left to lower centre (https://symbl.cc/en/1FB52/)
        case 129874:
          return `<path d="M0,${twoThirds} L0,0 L1,0 L1,1 L0.5,1 Z" fill="currentColor"/>` + stroked(`M0,${twoThirds} L0,0 L1,0 L1,1 L0.5,1 Z`);
        // 🭓 - upper right block diagonal lower middle left to lower right (https://symbl.cc/en/1FB53/)
        case 129875:
          return `<path d="M0,${twoThirds} L0,0 L1,0 L1,1 Z" fill="currentColor"/>` + stroked(`M0,${twoThirds} L0,0 L1,0 L1,1 Z`);
        // 🭔 - upper right block diagonal upper middle left to lower centre (https://symbl.cc/en/1FB54/)
        case 129876:
          return `<path d="M0,${third} L0,0 L1,0 L1,1 L0.5,1 Z" fill="currentColor"/>` + stroked(`M0,${third} L0,0 L1,0 L1,1 L0.5,1 Z`);
        // 🭕 - upper right block diagonal upper middle left to lower right (https://symbl.cc/en/1FB55/)
        case 129877:
          return `<path d="M0,${third} L0,0 L1,0 L1,1 Z" fill="currentColor"/>` + stroked(`M0,${third} L0,0 L1,0 L1,1 Z`);
        // 🭖 - upper right block diagonal upper left to lower centre (https://symbl.cc/en/1FB56/)
        case 129878:
          return '<path d="M0,0 L1,0 L1,1 L0.5,1 Z" fill="currentColor"/>' + stroked("M0,0 L1,0 L1,1 L0.5,1 Z");
        // 🭗 - upper left block diagonal upper middle left to upper centre (https://symbl.cc/en/1FB57/)
        case 129879:
          return `<path d="M0,${third} L0.5,0 L0,0 Z" fill="currentColor"/>` + stroked(`M0,${third} L0.5,0 L0,0 Z`);
        // 🭘 - upper left block diagonal upper middle left to upper right (https://symbl.cc/en/1FB58/)
        case 129880:
          return `<path d="M0,0 L1,0 L0,${third} Z" fill="currentColor"/>` + stroked(`M0,0 L1,0 L0,${third} Z`);
        // 🭙 - upper left block diagonal lower middle left to upper centre (https://symbl.cc/en/1FB59/)
        case 129881:
          return `<path d="M0,0 L0.5,0 L0,${twoThirds} Z" fill="currentColor"/>` + stroked(`M0,0 L0.5,0 L0,${twoThirds} Z`);
        // 🭚 - upper left block diagonal lower middle left to upper right (https://symbl.cc/en/1FB5A/)
        case 129882:
          return `<path d="M0,0 L1,0 L0,${twoThirds} Z" fill="currentColor"/>` + stroked(`M0,0 L1,0 L0,${twoThirds} Z`);
        // 🭛 - upper left block diagonal lower left to upper centre (https://symbl.cc/en/1FB5B/)
        case 129883:
          return '<path d="M0,0 L0.5,0 L0,1 Z" fill="currentColor"/>' + stroked("M0,0 L0.5,0 L0,1 Z");
        // 🭜 - upper left block diagonal lower middle left to upper middle right (https://symbl.cc/en/1FB5C/)
        case 129884:
          return `<path d="M0,0 L1,0 L1,${third} L0,${twoThirds} Z" fill="currentColor"/>` + stroked(`M0,0 L1,0 L1,${third} L0,${twoThirds} Z`);
        // 🭝 - upper left block diagonal lower centre to lower middle right (https://symbl.cc/en/1FB5D/)
        case 129885:
          return `<path d="M0,0 L1,0 L1,${twoThirds} L0.5,1 L0,1 Z" fill="currentColor"/>` + stroked(`M0,0 L1,0 L1,${twoThirds} L0.5,1 L0,1 Z`);
        // 🭞 - upper left block diagonal lower left to lower middle right (https://symbl.cc/en/1FB5E/)
        case 129886:
          return `<path d="M0,0 L1,0 L1,${twoThirds} L0,1 Z" fill="currentColor"/>` + stroked(`M0,0 L1,0 L1,${twoThirds} L0,1 Z`);
        // 🭟 - upper left block diagonal lower centre to upper middle right (https://symbl.cc/en/1FB5F/)
        case 129887:
          return `<path d="M0,0 L1,0 L1,${third} L0.5,1 L0,1 Z" fill="currentColor"/>` + stroked(`M0,0 L1,0 L1,${third} L0.5,1 L0,1 Z`);
        // 🭠 - upper left block diagonal lower left to upper middle right (https://symbl.cc/en/1FB60/)
        case 129888:
          return `<path d="M0,0 L1,0 L1,${third} L0,1 Z" fill="currentColor"/>` + stroked(`M0,0 L1,0 L1,${third} L0,1 Z`);
        // 🭡 - upper left block diagonal lower centre to upper right (https://symbl.cc/en/1FB61/)
        case 129889:
          return '<path d="M0,0 L1,0 L0.5,1 L0,1 Z" fill="currentColor"/>' + stroked("M0,0 L1,0 L0.5,1 L0,1 Z");
        // 🭢 - upper right block diagonal upper centre to upper middle right (https://symbl.cc/en/1FB62/)
        case 129890:
          return `<path d="M0.5,0 L1,0 L1,${third} Z" fill="currentColor"/>` + stroked(`M0.5,0 L1,0 L1,${third} Z`);
        // 🭣 - upper right block diagonal upper left to upper middle right (https://symbl.cc/en/1FB63/)
        case 129891:
          return `<path d="M0,0 L1,0 L1,${third} Z" fill="currentColor"/>` + stroked(`M0,0 L1,0 L1,${third} Z`);
        // 🭤 - upper right block diagonal upper centre to lower middle right (https://symbl.cc/en/1FB64/)
        case 129892:
          return `<path d="M0.5,0 L1,0 L1,${twoThirds} Z" fill="currentColor"/>` + stroked(`M0.5,0 L1,0 L1,${twoThirds} Z`);
        // 🭥 - upper right block diagonal upper left to lower middle right (https://symbl.cc/en/1FB65/)
        case 129893:
          return `<path d="M0,0 L1,0 L1,${twoThirds} Z" fill="currentColor"/>` + stroked(`M0,0 L1,0 L1,${twoThirds} Z`);
        // 🭦 - upper right block diagonal upper centre to lower right (https://symbl.cc/en/1FB66/)
        case 129894:
          return '<path d="M0.5,0 L1,0 L1,1 Z" fill="currentColor"/>' + stroked("M0.5,0 L1,0 L1,1 Z");
        // 🭧 - upper right block diagonal upper middle left to lower middle right (https://symbl.cc/en/1FB67/)
        case 129895:
          return `<path d="M0,${third} L0,0 L1,0 L1,${twoThirds} Z" fill="currentColor"/>` + stroked(`M0,${third} L0,0 L1,0 L1,${twoThirds} Z`);
        // 🭨 - upper and right and lower triangular three quarters block (https://symbl.cc/en/1FB68/)
        case 129896:
          return `<path fill-rule="evenodd" d="M0,0 L1,0 L1,1 L0,1 Z M0,0 L0,1 L0.5,0.5 Z" fill="currentColor"/><path d="M0,0 L1,0 M0,1 L1,1 M1,0 L1,1" fill="none" ${stroke}/><path d="M0,0 L0.5,0.5 M0,1 L0.5,0.5" fill="none" ${strokeButt}/>`;
        // 🭩 - left and lower and right triangular three quarters block (https://symbl.cc/en/1FB69/)
        case 129897:
          return `<path fill-rule="evenodd" d="M0,0 L1,0 L1,1 L0,1 Z M0,0 L1,0 L0.5,0.5 Z" fill="currentColor"/><path d="M0,0 L0,1 M1,0 L1,1 M0,1 L1,1" fill="none" ${stroke}/><path d="M0,0 L0.5,0.5 M1,0 L0.5,0.5" fill="none" ${strokeButt}/>`;
        // 🭪 - upper and left and lower triangular three quarters block (https://symbl.cc/en/1FB6A/)
        case 129898:
          return `<path fill-rule="evenodd" d="M0,0 L1,0 L1,1 L0,1 Z M1,0 L1,1 L0.5,0.5 Z" fill="currentColor"/><path d="M0,0 L1,0 M0,1 L1,1 M0,0 L0,1" fill="none" ${stroke}/><path d="M1,0 L0.5,0.5 M1,1 L0.5,0.5" fill="none" ${strokeButt}/>`;
        // 🭫 - left and upper and right triangular three quarters block (https://symbl.cc/en/1FB6B/)
        case 129899:
          return `<path fill-rule="evenodd" d="M0,0 L1,0 L1,1 L0,1 Z M0,1 L1,1 L0.5,0.5 Z" fill="currentColor"/><path d="M0,0 L1,0 M0,0 L0,1 M1,0 L1,1" fill="none" ${stroke}/><path d="M0,1 L0.5,0.5 M1,1 L0.5,0.5" fill="none" ${strokeButt}/>`;
        // 🭬 - left triangular one quarter block (https://symbl.cc/en/1FB6C/)
        case 129900:
          return '<path d="M0,0 L0,1 L0.5,0.5 Z" fill="currentColor"/>' + stroked("M0,0 L0,1 L0.5,0.5 Z");
        // powerline right full triangle (https://www.nerdfonts.com/cheat-sheet)
        case 57520:
          return '<path d="M0,0 L1,0.5 L0,1 Z" fill="currentColor"/>';
        // powerline right bracket (https://www.nerdfonts.com/cheat-sheet)
        case 57521:
          return '<path d="M0,0 L1,0.5 L0,1" fill="none" stroke="currentColor" stroke-width="0.07" stroke-linejoin="miter"/>';
        // powerline left full triangle (https://www.nerdfonts.com/cheat-sheet)
        case 57522:
          return '<path d="M1,0 L0,0.5 L1,1 Z" fill="currentColor"/>';
        // powerline left bracket (https://www.nerdfonts.com/cheat-sheet)
        case 57523:
          return '<path d="M1,0 L0,0.5 L1,1" fill="none" stroke="currentColor" stroke-width="0.07" stroke-linejoin="miter"/>';
        default:
          return null;
      }
    }
    const POWERLINE_SYMBOLS = /* @__PURE__ */ new Set([57520, 57521, 57522, 57523]);
    const POWERLINE_SYMBOL_NUDGE = 0.02;
    const FALLBACK_THEME = {
      foreground: "black",
      background: "black",
      palette: ["black", "black", "black", "black", "black", "black", "black", "black", "black", "black", "black", "black", "black", "black", "black", "black"]
    };
    const FULL_PALETTE = ["#000000", "#00005f", "#000087", "#0000af", "#0000d7", "#0000ff", "#005f00", "#005f5f", "#005f87", "#005faf", "#005fd7", "#005fff", "#008700", "#00875f", "#008787", "#0087af", "#0087d7", "#0087ff", "#00af00", "#00af5f", "#00af87", "#00afaf", "#00afd7", "#00afff", "#00d700", "#00d75f", "#00d787", "#00d7af", "#00d7d7", "#00d7ff", "#00ff00", "#00ff5f", "#00ff87", "#00ffaf", "#00ffd7", "#00ffff", "#5f0000", "#5f005f", "#5f0087", "#5f00af", "#5f00d7", "#5f00ff", "#5f5f00", "#5f5f5f", "#5f5f87", "#5f5faf", "#5f5fd7", "#5f5fff", "#5f8700", "#5f875f", "#5f8787", "#5f87af", "#5f87d7", "#5f87ff", "#5faf00", "#5faf5f", "#5faf87", "#5fafaf", "#5fafd7", "#5fafff", "#5fd700", "#5fd75f", "#5fd787", "#5fd7af", "#5fd7d7", "#5fd7ff", "#5fff00", "#5fff5f", "#5fff87", "#5fffaf", "#5fffd7", "#5fffff", "#870000", "#87005f", "#870087", "#8700af", "#8700d7", "#8700ff", "#875f00", "#875f5f", "#875f87", "#875faf", "#875fd7", "#875fff", "#878700", "#87875f", "#878787", "#8787af", "#8787d7", "#8787ff", "#87af00", "#87af5f", "#87af87", "#87afaf", "#87afd7", "#87afff", "#87d700", "#87d75f", "#87d787", "#87d7af", "#87d7d7", "#87d7ff", "#87ff00", "#87ff5f", "#87ff87", "#87ffaf", "#87ffd7", "#87ffff", "#af0000", "#af005f", "#af0087", "#af00af", "#af00d7", "#af00ff", "#af5f00", "#af5f5f", "#af5f87", "#af5faf", "#af5fd7", "#af5fff", "#af8700", "#af875f", "#af8787", "#af87af", "#af87d7", "#af87ff", "#afaf00", "#afaf5f", "#afaf87", "#afafaf", "#afafd7", "#afafff", "#afd700", "#afd75f", "#afd787", "#afd7af", "#afd7d7", "#afd7ff", "#afff00", "#afff5f", "#afff87", "#afffaf", "#afffd7", "#afffff", "#d70000", "#d7005f", "#d70087", "#d700af", "#d700d7", "#d700ff", "#d75f00", "#d75f5f", "#d75f87", "#d75faf", "#d75fd7", "#d75fff", "#d78700", "#d7875f", "#d78787", "#d787af", "#d787d7", "#d787ff", "#d7af00", "#d7af5f", "#d7af87", "#d7afaf", "#d7afd7", "#d7afff", "#d7d700", "#d7d75f", "#d7d787", "#d7d7af", "#d7d7d7", "#d7d7ff", "#d7ff00", "#d7ff5f", "#d7ff87", "#d7ffaf", "#d7ffd7", "#d7ffff", "#ff0000", "#ff005f", "#ff0087", "#ff00af", "#ff00d7", "#ff00ff", "#ff5f00", "#ff5f5f", "#ff5f87", "#ff5faf", "#ff5fd7", "#ff5fff", "#ff8700", "#ff875f", "#ff8787", "#ff87af", "#ff87d7", "#ff87ff", "#ffaf00", "#ffaf5f", "#ffaf87", "#ffafaf", "#ffafd7", "#ffafff", "#ffd700", "#ffd75f", "#ffd787", "#ffd7af", "#ffd7d7", "#ffd7ff", "#ffff00", "#ffff5f", "#ffff87", "#ffffaf", "#ffffd7", "#ffffff", "#080808", "#121212", "#1c1c1c", "#262626", "#303030", "#3a3a3a", "#444444", "#4e4e4e", "#585858", "#626262", "#6c6c6c", "#767676", "#808080", "#8a8a8a", "#949494", "#9e9e9e", "#a8a8a8", "#b2b2b2", "#bcbcbc", "#c6c6c6", "#d0d0d0", "#dadada", "#e4e4e4", "#eeeeee"];
    const _tmpl$$d = /* @__PURE__ */ template(`<svg version="1.1" viewBox="0 0 12 12" class="ap-icon ap-icon-fullscreen-off"><path d="M7,5 L7,0 L9,2 L11,0 L12,1 L10,3 L12,5 Z"></path><path d="M5,7 L0,7 L2,9 L0,11 L1,12 L3,10 L5,12 Z"></path></svg>`, 6);
    var ExpandIcon = ((props) => {
      return _tmpl$$d.cloneNode(true);
    });
    const _tmpl$$c = /* @__PURE__ */ template(`<svg version="1.1" viewBox="6 8 14 16" class="ap-icon"><path d="M0.938 8.313h22.125c0.5 0 0.938 0.438 0.938 0.938v13.5c0 0.5-0.438 0.938-0.938 0.938h-22.125c-0.5 0-0.938-0.438-0.938-0.938v-13.5c0-0.5 0.438-0.938 0.938-0.938zM1.594 22.063h20.813v-12.156h-20.813v12.156zM3.844 11.188h1.906v1.938h-1.906v-1.938zM7.469 11.188h1.906v1.938h-1.906v-1.938zM11.031 11.188h1.938v1.938h-1.938v-1.938zM14.656 11.188h1.875v1.938h-1.875v-1.938zM18.25 11.188h1.906v1.938h-1.906v-1.938zM5.656 15.031h1.938v1.938h-1.938v-1.938zM9.281 16.969v-1.938h1.906v1.938h-1.906zM12.875 16.969v-1.938h1.906v1.938h-1.906zM18.406 16.969h-1.938v-1.938h1.938v1.938zM16.531 20.781h-9.063v-1.906h9.063v1.906z"></path></svg>`, 4);
    var KeyboardIcon = ((props) => {
      return _tmpl$$c.cloneNode(true);
    });
    const _tmpl$$b = /* @__PURE__ */ template(`<svg version="1.1" viewBox="0 0 12 12" class="ap-icon" aria-label="Pause" role="button"><path d="M1,0 L4,0 L4,12 L1,12 Z"></path><path d="M8,0 L11,0 L11,12 L8,12 Z"></path></svg>`, 6);
    var PauseIcon = ((props) => {
      return _tmpl$$b.cloneNode(true);
    });
    const _tmpl$$a = /* @__PURE__ */ template(`<svg version="1.1" viewBox="0 0 12 12" class="ap-icon" aria-label="Play" role="button"><path d="M1,0 L11,6 L1,12 Z"></path></svg>`, 4);
    var PlayIcon = ((props) => {
      return _tmpl$$a.cloneNode(true);
    });
    const _tmpl$$9 = /* @__PURE__ */ template(`<svg version="1.1" viewBox="0 0 12 12" class="ap-icon ap-icon-fullscreen-on"><path d="M12,0 L7,0 L9,2 L7,4 L8,5 L10,3 L12,5 Z"></path><path d="M0,12 L0,7 L2,9 L4,7 L5,8 L3,10 L5,12 Z"></path></svg>`, 6);
    var ShrinkIcon = ((props) => {
      return _tmpl$$9.cloneNode(true);
    });
    const _tmpl$$8 = /* @__PURE__ */ template(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor"><path d="M10.5 3.75a.75.75 0 0 0-1.264-.546L5.203 7H2.667a.75.75 0 0 0-.7.48A6.985 6.985 0 0 0 1.5 10c0 .887.165 1.737.468 2.52.111.29.39.48.7.48h2.535l4.033 3.796a.75.75 0 0 0 1.264-.546V3.75ZM16.45 5.05a.75.75 0 0 0-1.06 1.061 5.5 5.5 0 0 1 0 7.778.75.75 0 0 0 1.06 1.06 7 7 0 0 0 0-9.899Z"></path><path d="M14.329 7.172a.75.75 0 0 0-1.061 1.06 2.5 2.5 0 0 1 0 3.536.75.75 0 0 0 1.06 1.06 4 4 0 0 0 0-5.656Z"></path></svg>`, 6);
    var SpeakerOnIcon = ((props) => {
      return _tmpl$$8.cloneNode(true);
    });
    const _tmpl$$7 = /* @__PURE__ */ template(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="size-5"><path d="M10.047 3.062a.75.75 0 0 1 .453.688v12.5a.75.75 0 0 1-1.264.546L5.203 13H2.667a.75.75 0 0 1-.7-.48A6.985 6.985 0 0 1 1.5 10c0-.887.165-1.737.468-2.52a.75.75 0 0 1 .7-.48h2.535l4.033-3.796a.75.75 0 0 1 .811-.142ZM13.78 7.22a.75.75 0 1 0-1.06 1.06L14.44 10l-1.72 1.72a.75.75 0 0 0 1.06 1.06l1.72-1.72 1.72 1.72a.75.75 0 1 0 1.06-1.06L16.56 10l1.72-1.72a.75.75 0 0 0-1.06-1.06L15.5 8.94l-1.72-1.72Z"></path></svg>`, 4);
    var SpeakerOffIcon = ((props) => {
      return _tmpl$$7.cloneNode(true);
    });
    const _tmpl$$6 = /* @__PURE__ */ template(`<span class="ap-button ap-playback-button" tabindex="0"></span>`, 2), _tmpl$2$1 = /* @__PURE__ */ template(`<span class="ap-bar"><span class="ap-gutter ap-gutter-empty"></span><span class="ap-gutter ap-gutter-full"></span></span>`, 6), _tmpl$3$1 = /* @__PURE__ */ template(`<span class="ap-tooltip">Unmute (m)</span>`, 2), _tmpl$4$1 = /* @__PURE__ */ template(`<span class="ap-tooltip">Mute (m)</span>`, 2), _tmpl$5$1 = /* @__PURE__ */ template(`<span class="ap-button ap-speaker-button ap-tooltip-container" aria-label="Mute / unmute" role="button" tabindex="0"></span>`, 2), _tmpl$6$1 = /* @__PURE__ */ template(`<div class="ap-control-bar"><span class="ap-timer" aria-readonly="true" role="textbox" tabindex="0"><span class="ap-time-elapsed"></span><span class="ap-time-remaining"></span></span><span class="ap-progressbar"></span><span class="ap-button ap-kbd-button ap-tooltip-container" aria-label="Show keyboard shortcuts" role="button" tabindex="0"><span class="ap-tooltip">Keyboard shortcuts (?)</span></span><span class="ap-button ap-fullscreen-button ap-tooltip-container" aria-label="Toggle fullscreen mode" role="button" tabindex="0"><span class="ap-tooltip">Fullscreen (f)</span></span></div>`, 18), _tmpl$7$1 = /* @__PURE__ */ template(`<span class="ap-marker-container ap-tooltip-container"><span class="ap-marker"></span><span class="ap-tooltip"></span></span>`, 6);
    function formatTime(seconds) {
      let s = Math.floor(seconds);
      const d = Math.floor(s / 86400);
      s %= 86400;
      const h = Math.floor(s / 3600);
      s %= 3600;
      const m = Math.floor(s / 60);
      s %= 60;
      if (d > 0) {
        return `${zeroPad(d)}:${zeroPad(h)}:${zeroPad(m)}:${zeroPad(s)}`;
      } else if (h > 0) {
        return `${zeroPad(h)}:${zeroPad(m)}:${zeroPad(s)}`;
      } else {
        return `${zeroPad(m)}:${zeroPad(s)}`;
      }
    }
    function zeroPad(n) {
      return n < 10 ? `0${n}` : n.toString();
    }
    var ControlBar = ((props) => {
      const e = (f) => {
        return (e2) => {
          e2.preventDefault();
          f(e2);
        };
      };
      const currentTime = () => typeof props.currentTime === "number" ? formatTime(props.currentTime) : "--:--";
      const remainingTime = () => typeof props.remainingTime === "number" ? "-" + formatTime(props.remainingTime) : currentTime();
      const markers = createMemo(() => typeof props.duration === "number" ? props.markers.filter((m) => m[0] < props.duration) : []);
      const markerPosition = (m) => `${m[0] / props.duration * 100}%`;
      const markerText = (m) => {
        if (m[1] === "") {
          return formatTime(m[0]);
        } else {
          return `${formatTime(m[0])} - ${m[1]}`;
        }
      };
      const isPastMarker = (m) => typeof props.currentTime === "number" ? m[0] <= props.currentTime : false;
      const gutterBarStyle = () => {
        return {
          transform: `scaleX(${props.progress || 0}`
        };
      };
      const calcPosition = (e2) => {
        const barWidth = e2.currentTarget.offsetWidth;
        const rect2 = e2.currentTarget.getBoundingClientRect();
        const mouseX = e2.clientX - rect2.left;
        const pos2 = Math.max(0, mouseX / barWidth);
        return `${pos2 * 100}%`;
      };
      const [mouseDown, setMouseDown] = createSignal(false);
      const throttledSeek = throttle(props.onSeekClick, 50);
      const onMouseDown = (e2) => {
        if (e2._marker) return;
        if (e2.altKey || e2.shiftKey || e2.metaKey || e2.ctrlKey || e2.button !== 0) return;
        setMouseDown(true);
        props.onSeekClick(calcPosition(e2));
      };
      const seekToMarker = (index) => {
        return e(() => {
          props.onSeekClick({
            marker: index
          });
        });
      };
      const onMove = (e2) => {
        if (e2.altKey || e2.shiftKey || e2.metaKey || e2.ctrlKey) return;
        if (mouseDown()) {
          throttledSeek(calcPosition(e2));
        }
      };
      const onDocumentMouseUp = () => {
        setMouseDown(false);
      };
      document.addEventListener("mouseup", onDocumentMouseUp);
      onCleanup(() => {
        document.removeEventListener("mouseup", onDocumentMouseUp);
      });
      return (() => {
        const _el$ = _tmpl$6$1.cloneNode(true), _el$3 = _el$.firstChild, _el$4 = _el$3.firstChild, _el$5 = _el$4.nextSibling, _el$6 = _el$3.nextSibling, _el$13 = _el$6.nextSibling, _el$14 = _el$13.firstChild, _el$15 = _el$13.nextSibling, _el$16 = _el$15.firstChild;
        const _ref$ = props.ref;
        typeof _ref$ === "function" ? use(_ref$, _el$) : props.ref = _el$;
        insert$1(_el$, createComponent(Show, {
          get when() {
            return props.isPausable;
          },
          get children() {
            const _el$2 = _tmpl$$6.cloneNode(true);
            addEventListener$1(_el$2, "click", e(props.onPlayClick));
            insert$1(_el$2, createComponent(Switch, {
              get children() {
                return [createComponent(Match, {
                  get when() {
                    return props.isPlaying;
                  },
                  get children() {
                    return createComponent(PauseIcon, {});
                  }
                }), createComponent(Match, {
                  when: true,
                  get children() {
                    return createComponent(PlayIcon, {});
                  }
                })];
              }
            }));
            return _el$2;
          }
        }), _el$3);
        insert$1(_el$4, currentTime);
        insert$1(_el$5, remainingTime);
        insert$1(_el$6, createComponent(Show, {
          get when() {
            return typeof props.progress === "number" || props.isSeekable;
          },
          get children() {
            const _el$7 = _tmpl$2$1.cloneNode(true), _el$8 = _el$7.firstChild, _el$9 = _el$8.nextSibling;
            _el$7.$$mousemove = onMove;
            _el$7.$$mousedown = onMouseDown;
            insert$1(_el$7, createComponent(For, {
              get each() {
                return markers();
              },
              children: (m, i2) => (() => {
                const _el$17 = _tmpl$7$1.cloneNode(true), _el$18 = _el$17.firstChild, _el$19 = _el$18.nextSibling;
                _el$17.$$mousedown = (e2) => {
                  e2._marker = true;
                };
                addEventListener$1(_el$17, "click", seekToMarker(i2()));
                insert$1(_el$19, () => markerText(m));
                createRenderEffect((_p$) => {
                  const _v$ = markerPosition(m), _v$2 = !!isPastMarker(m);
                  _v$ !== _p$._v$ && _el$17.style.setProperty("left", _p$._v$ = _v$);
                  _v$2 !== _p$._v$2 && _el$18.classList.toggle("ap-marker-past", _p$._v$2 = _v$2);
                  return _p$;
                }, {
                  _v$: void 0,
                  _v$2: void 0
                });
                return _el$17;
              })()
            }), null);
            createRenderEffect((_$p) => style(_el$9, gutterBarStyle(), _$p));
            return _el$7;
          }
        }));
        insert$1(_el$, createComponent(Show, {
          get when() {
            return props.isMuted !== void 0;
          },
          get children() {
            const _el$10 = _tmpl$5$1.cloneNode(true);
            addEventListener$1(_el$10, "click", e(props.onMuteClick));
            insert$1(_el$10, createComponent(Switch, {
              get children() {
                return [createComponent(Match, {
                  get when() {
                    return props.isMuted === true;
                  },
                  get children() {
                    return [createComponent(SpeakerOffIcon, {}), _tmpl$3$1.cloneNode(true)];
                  }
                }), createComponent(Match, {
                  get when() {
                    return props.isMuted === false;
                  },
                  get children() {
                    return [createComponent(SpeakerOnIcon, {}), _tmpl$4$1.cloneNode(true)];
                  }
                })];
              }
            }));
            return _el$10;
          }
        }), _el$13);
        addEventListener$1(_el$13, "click", e(props.onHelpClick));
        insert$1(_el$13, createComponent(KeyboardIcon, {}), _el$14);
        addEventListener$1(_el$15, "click", e(props.onFullscreenClick));
        insert$1(_el$15, createComponent(ShrinkIcon, {}), _el$16);
        insert$1(_el$15, createComponent(ExpandIcon, {}), _el$16);
        createRenderEffect(() => _el$.classList.toggle("ap-seekable", !!props.isSeekable));
        return _el$;
      })();
    });
    delegateEvents(["click", "mousedown", "mousemove"]);
    const _tmpl$$5 = /* @__PURE__ */ template(`<div class="ap-overlay ap-overlay-error"><span>💥</span></div>`, 4);
    var ErrorOverlay = ((props) => {
      return _tmpl$$5.cloneNode(true);
    });
    const _tmpl$$4 = /* @__PURE__ */ template(`<div class="ap-overlay ap-overlay-loading"><span class="ap-loader"></span></div>`, 4);
    var LoaderOverlay = ((props) => {
      return _tmpl$$4.cloneNode(true);
    });
    const _tmpl$$3 = /* @__PURE__ */ template(`<div class="ap-overlay ap-overlay-info"><span></span></div>`, 4);
    var InfoOverlay = ((props) => {
      return (() => {
        const _el$ = _tmpl$$3.cloneNode(true), _el$2 = _el$.firstChild;
        insert$1(_el$2, () => props.message);
        createRenderEffect(() => _el$.classList.toggle("ap-was-playing", !!props.wasPlaying));
        return _el$;
      })();
    });
    const _tmpl$$2 = /* @__PURE__ */ template(`<div class="ap-overlay ap-overlay-start"><div class="ap-play-button"><div><span><svg version="1.1" viewBox="0 0 1000.0 1000.0" class="ap-icon"><defs><mask id="small-triangle-mask"><rect width="100%" height="100%" fill="white"></rect><polygon points="700.0 500.0, 400.00000000000006 326.7949192431122, 399.9999999999999 673.2050807568877" fill="black"></polygon></mask></defs><polygon points="1000.0 500.0, 250.0000000000001 66.98729810778059, 249.99999999999977 933.0127018922192" mask="url(#small-triangle-mask)" fill="white" class="ap-play-btn-fill"></polygon><polyline points="673.2050807568878 400.0, 326.7949192431123 600.0" stroke="white" stroke-width="90" class="ap-play-btn-stroke"></polyline></svg></span></div></div></div>`, 22);
    var StartOverlay = ((props) => {
      const e = (f) => {
        return (e2) => {
          e2.preventDefault();
          f(e2);
        };
      };
      return (() => {
        const _el$ = _tmpl$$2.cloneNode(true);
        addEventListener$1(_el$, "click", e(props.onClick));
        return _el$;
      })();
    });
    delegateEvents(["click"]);
    const _tmpl$$1 = /* @__PURE__ */ template(`<li><kbd>space</kbd> - pause / resume</li>`, 4), _tmpl$2 = /* @__PURE__ */ template(`<li><kbd>←</kbd> / <kbd>→</kbd> - rewind / fast-forward by 5 seconds</li>`, 6), _tmpl$3 = /* @__PURE__ */ template(`<li><kbd>Shift</kbd> + <kbd>←</kbd> / <kbd>→</kbd> - rewind / fast-forward by 10%</li>`, 8), _tmpl$4 = /* @__PURE__ */ template(`<li><kbd>[</kbd> / <kbd>]</kbd> - jump to the previous / next marker</li>`, 6), _tmpl$5 = /* @__PURE__ */ template(`<li><kbd>0</kbd>, <kbd>1</kbd>, <kbd>2</kbd> ... <kbd>9</kbd> - jump to 0%, 10%, 20% ... 90%</li>`, 10), _tmpl$6 = /* @__PURE__ */ template(`<li><kbd>,</kbd> / <kbd>.</kbd> - step back / forward, a frame at a time (when paused)</li>`, 6), _tmpl$7 = /* @__PURE__ */ template(`<li><kbd>m</kbd> - mute / unmute audio</li>`, 4), _tmpl$8 = /* @__PURE__ */ template(`<div class="ap-overlay ap-overlay-help"><div><div><p>Keyboard shortcuts</p><ul><li><kbd>f</kbd> - toggle fullscreen mode</li><li><kbd>?</kbd> - show this help popup</li></ul></div></div></div>`, 18);
    var HelpOverlay = ((props) => {
      const e = (f) => {
        return (e2) => {
          e2.preventDefault();
          f(e2);
        };
      };
      return (() => {
        const _el$ = _tmpl$8.cloneNode(true), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.firstChild, _el$5 = _el$4.nextSibling, _el$12 = _el$5.firstChild, _el$14 = _el$12.nextSibling;
        addEventListener$1(_el$, "click", e(props.onClose));
        _el$2.$$click = (e2) => {
          e2.stopPropagation();
        };
        insert$1(_el$5, createComponent(Show, {
          get when() {
            return props.isPausable;
          },
          get children() {
            return _tmpl$$1.cloneNode(true);
          }
        }), _el$12);
        insert$1(_el$5, createComponent(Show, {
          get when() {
            return props.isSeekable;
          },
          get children() {
            return [_tmpl$2.cloneNode(true), _tmpl$3.cloneNode(true), _tmpl$4.cloneNode(true), _tmpl$5.cloneNode(true), _tmpl$6.cloneNode(true)];
          }
        }), _el$12);
        insert$1(_el$5, createComponent(Show, {
          get when() {
            return props.hasAudio;
          },
          get children() {
            return _tmpl$7.cloneNode(true);
          }
        }), _el$14);
        return _el$;
      })();
    });
    delegateEvents(["click"]);
    const _tmpl$ = /* @__PURE__ */ template(`<div class="ap-wrapper" tabindex="-1"><div></div></div>`, 4);
    const CONTROL_BAR_HEIGHT = 32;
    var Player = ((props) => {
      const logger = props.logger;
      const core = props.core;
      const autoPlay = props.autoPlay;
      const charW = props.charW;
      const charH = props.charH;
      const bordersW = props.bordersW;
      const bordersH = props.bordersH;
      const themeOption = props.theme ?? "auto/asciinema";
      const preferEmbeddedTheme = themeOption.slice(0, 5) === "auto/";
      const themeName = preferEmbeddedTheme ? themeOption.slice(5) : themeOption;
      const [state, setState2] = createStore({
        containerW: 0,
        containerH: 0,
        isPausable: true,
        isSeekable: true,
        isFullscreen: false,
        currentTime: null,
        remainingTime: null,
        progress: null
      });
      const [isPlaying, setIsPlaying] = createSignal(false);
      const [isMuted, setIsMuted] = createSignal(void 0);
      const [wasPlaying, setWasPlaying] = createSignal(false);
      const [overlay, setOverlay] = createSignal(!autoPlay ? "start" : null);
      const [infoMessage, setInfoMessage] = createSignal(null);
      const [blinking, setBlinking] = createSignal(false);
      const [terminalSize, setTerminalSize] = createSignal({
        cols: props.cols,
        rows: props.rows
      }, {
        equals: (newVal, oldVal) => newVal.cols === oldVal.cols && newVal.rows === oldVal.rows
      });
      const [duration, setDuration] = createSignal(null);
      const [markers, setMarkers] = createStore([]);
      const [userActive, setUserActive] = createSignal(false);
      const [isHelpVisible, setIsHelpVisible] = createSignal(false);
      const [originalTheme, setOriginalTheme] = createSignal(null);
      const terminalCols = createMemo(() => terminalSize().cols || 80);
      const terminalRows = createMemo(() => terminalSize().rows || 24);
      const controlBarHeight = () => props.controls === false ? 0 : CONTROL_BAR_HEIGHT;
      const controlsVisible = () => props.controls === true || props.controls === "auto" && userActive();
      let userActivityTimeoutId;
      let timeUpdateIntervalId;
      let wrapperRef;
      let playerRef;
      let controlBarRef;
      let resizeObserver;
      function onPlaying() {
        setBlinking(true);
        startTimeUpdates();
      }
      function onStopped() {
        setBlinking(false);
        stopTimeUpdates();
        updateTime();
      }
      let resolveCoreReady;
      const coreReady = new Promise((resolve) => {
        resolveCoreReady = resolve;
      });
      const onCoreReady = (_ref) => {
        let {
          isPausable,
          isSeekable
        } = _ref;
        setState2({
          isPausable,
          isSeekable
        });
        resolveCoreReady();
      };
      const onCoreMetadata = (meta2) => {
        batch(() => {
          if (meta2.duration !== void 0) {
            setDuration(meta2.duration);
          }
          if (meta2.markers !== void 0) {
            setMarkers(meta2.markers);
          }
          if (meta2.hasAudio !== void 0) {
            setIsMuted(meta2.hasAudio ? false : void 0);
          }
          if (meta2.size !== void 0) {
            setTerminalSize(meta2.size);
          }
          if (meta2.theme !== void 0) {
            setOriginalTheme(meta2.theme);
          }
        });
      };
      const onCorePlay = () => {
        setOverlay(null);
      };
      const onCorePlaying = () => {
        batch(() => {
          setIsPlaying(true);
          setWasPlaying(true);
          setOverlay(null);
          onPlaying();
        });
      };
      const onCoreIdle = () => {
        batch(() => {
          setIsPlaying(false);
          onStopped();
        });
      };
      const onCoreLoading = () => {
        batch(() => {
          setIsPlaying(false);
          onStopped();
          setOverlay("loader");
        });
      };
      const onCoreOffline = (_ref2) => {
        let {
          message: message2
        } = _ref2;
        batch(() => {
          setIsPlaying(false);
          onStopped();
          if (message2 !== void 0) {
            setInfoMessage(message2);
            setOverlay("info");
          }
        });
      };
      const onCoreMuted = (muted) => {
        setIsMuted(muted);
      };
      const stats = {
        terminal: {
          renders: 0
        }
      };
      const onCoreEnded = (_ref3) => {
        let {
          message: message2
        } = _ref3;
        batch(() => {
          setIsPlaying(false);
          onStopped();
          if (message2 !== void 0) {
            setInfoMessage(message2);
            setOverlay("info");
          }
        });
        logger.debug("stats", stats.terminal);
      };
      const onCoreErrored = () => {
        setOverlay("error");
      };
      const onCoreSeeked = () => {
        updateTime();
      };
      core.addEventListener("ready", onCoreReady);
      core.addEventListener("metadata", onCoreMetadata);
      core.addEventListener("play", onCorePlay);
      core.addEventListener("playing", onCorePlaying);
      core.addEventListener("idle", onCoreIdle);
      core.addEventListener("loading", onCoreLoading);
      core.addEventListener("offline", onCoreOffline);
      core.addEventListener("muted", onCoreMuted);
      core.addEventListener("ended", onCoreEnded);
      core.addEventListener("errored", onCoreErrored);
      core.addEventListener("seeked", onCoreSeeked);
      const setupResizeObserver = () => {
        resizeObserver = new ResizeObserver(debounce((_entries) => {
          setState2({
            containerW: wrapperRef.offsetWidth,
            containerH: wrapperRef.offsetHeight
          });
          wrapperRef.dispatchEvent(new CustomEvent("resize", {
            detail: {
              el: playerRef
            }
          }));
        }, 10));
        resizeObserver.observe(wrapperRef);
      };
      onMount(async () => {
        logger.info("view: mounted");
        logger.debug("view: font measurements", {
          charW,
          charH
        });
        setupResizeObserver();
        setState2({
          containerW: wrapperRef.offsetWidth,
          containerH: wrapperRef.offsetHeight
        });
      });
      onCleanup(() => {
        core.removeEventListener("ready", onCoreReady);
        core.removeEventListener("metadata", onCoreMetadata);
        core.removeEventListener("play", onCorePlay);
        core.removeEventListener("playing", onCorePlaying);
        core.removeEventListener("idle", onCoreIdle);
        core.removeEventListener("loading", onCoreLoading);
        core.removeEventListener("offline", onCoreOffline);
        core.removeEventListener("muted", onCoreMuted);
        core.removeEventListener("ended", onCoreEnded);
        core.removeEventListener("errored", onCoreErrored);
        core.removeEventListener("seeked", onCoreSeeked);
        core.stop();
        stopTimeUpdates();
        resizeObserver.disconnect();
      });
      const terminalElementSize = createMemo(() => {
        const terminalW = charW * terminalCols() + bordersW;
        const terminalH = charH * terminalRows() + bordersH;
        let fit = props.fit ?? "width";
        if (fit === "both" || state.isFullscreen) {
          const containerRatio = state.containerW / (state.containerH - controlBarHeight());
          const terminalRatio = terminalW / terminalH;
          if (containerRatio > terminalRatio) {
            fit = "height";
          } else {
            fit = "width";
          }
        }
        if (fit === false || fit === "none") {
          return {};
        } else if (fit === "width") {
          const scale = state.containerW / terminalW;
          return {
            scale,
            width: state.containerW,
            height: terminalH * scale + controlBarHeight()
          };
        } else if (fit === "height") {
          const scale = (state.containerH - controlBarHeight()) / terminalH;
          return {
            scale,
            width: terminalW * scale,
            height: state.containerH
          };
        } else {
          throw new Error(`unsupported fit mode: ${fit}`);
        }
      });
      const onFullscreenChange = () => {
        setState2("isFullscreen", document.fullscreenElement ?? document.webkitFullscreenElement);
      };
      const toggleFullscreen = () => {
        if (state.isFullscreen) {
          (document.exitFullscreen ?? document.webkitExitFullscreen ?? (() => {
          })).apply(document);
        } else {
          (wrapperRef.requestFullscreen ?? wrapperRef.webkitRequestFullscreen ?? (() => {
          })).apply(wrapperRef);
        }
      };
      const toggleHelp = () => {
        if (isHelpVisible()) {
          setIsHelpVisible(false);
        } else {
          core.pause();
          setIsHelpVisible(true);
        }
      };
      const onKeyDown = (e) => {
        if (e.altKey || e.metaKey || e.ctrlKey) {
          return;
        }
        if (e.key == " ") {
          core.togglePlay();
        } else if (e.key == ",") {
          core.step(-1).then(updateTime);
        } else if (e.key == ".") {
          core.step().then(updateTime);
        } else if (e.key == "f") {
          toggleFullscreen();
        } else if (e.key == "m") {
          toggleMuted();
        } else if (e.key == "[") {
          core.seek({
            marker: "prev"
          });
        } else if (e.key == "]") {
          core.seek({
            marker: "next"
          });
        } else if (e.key.charCodeAt(0) >= 48 && e.key.charCodeAt(0) <= 57) {
          const pos2 = (e.key.charCodeAt(0) - 48) / 10;
          core.seek(`${pos2 * 100}%`);
        } else if (e.key == "?") {
          toggleHelp();
        } else if (e.key == "ArrowLeft") {
          if (e.shiftKey) {
            core.seek("<<<");
          } else {
            core.seek("<<");
          }
        } else if (e.key == "ArrowRight") {
          if (e.shiftKey) {
            core.seek(">>>");
          } else {
            core.seek(">>");
          }
        } else if (e.key == "Escape") {
          setIsHelpVisible(false);
        } else {
          return;
        }
        e.stopPropagation();
        e.preventDefault();
      };
      const wrapperOnMouseMove = () => {
        if (state.isFullscreen) {
          onUserActive(true);
        }
      };
      const playerOnMouseLeave = () => {
        if (!state.isFullscreen) {
          onUserActive(false);
        }
      };
      const startTimeUpdates = () => {
        timeUpdateIntervalId = setInterval(updateTime, 100);
      };
      const stopTimeUpdates = () => {
        clearInterval(timeUpdateIntervalId);
      };
      const updateTime = async () => {
        const currentTime = await core.getCurrentTime();
        const remainingTime = await core.getRemainingTime();
        const progress2 = await core.getProgress();
        setState2({
          currentTime,
          remainingTime,
          progress: progress2
        });
      };
      const onUserActive = (show) => {
        clearTimeout(userActivityTimeoutId);
        if (show) {
          userActivityTimeoutId = setTimeout(() => onUserActive(false), 2e3);
        }
        setUserActive(show);
      };
      const embeddedTheme = createMemo(() => preferEmbeddedTheme ? originalTheme() : null);
      const playerStyle = () => {
        const style2 = {};
        if ((props.fit === false || props.fit === "none") && props.terminalFontSize !== void 0) {
          if (props.terminalFontSize === "small") {
            style2["font-size"] = "12px";
          } else if (props.terminalFontSize === "medium") {
            style2["font-size"] = "18px";
          } else if (props.terminalFontSize === "big") {
            style2["font-size"] = "24px";
          } else {
            style2["font-size"] = props.terminalFontSize;
          }
        }
        const size = terminalElementSize();
        if (size.width !== void 0) {
          style2["width"] = `${size.width}px`;
          style2["height"] = `${size.height}px`;
        }
        if (props.terminalFontFamily !== void 0) {
          style2["--term-font-family"] = props.terminalFontFamily;
        }
        const themeColors = embeddedTheme();
        if (themeColors) {
          style2["--term-color-foreground"] = themeColors.foreground;
          style2["--term-color-background"] = themeColors.background;
        }
        return style2;
      };
      const play = () => {
        coreReady.then(() => core.play());
      };
      const togglePlay = () => {
        coreReady.then(() => core.togglePlay());
      };
      const toggleMuted = () => {
        coreReady.then(() => {
          if (isMuted() === true) {
            core.unmute();
          } else {
            core.mute();
          }
        });
      };
      const seek = (pos2) => {
        coreReady.then(() => core.seek(pos2));
      };
      const playerClass = () => `ap-player ap-default-term-ff asciinema-player-theme-${themeName}`;
      const terminalScale = () => terminalElementSize()?.scale;
      const el2 = (() => {
        const _el$ = _tmpl$.cloneNode(true), _el$2 = _el$.firstChild;
        const _ref$ = wrapperRef;
        typeof _ref$ === "function" ? use(_ref$, _el$) : wrapperRef = _el$;
        _el$.addEventListener("webkitfullscreenchange", onFullscreenChange);
        _el$.addEventListener("fullscreenchange", onFullscreenChange);
        _el$.$$mousemove = wrapperOnMouseMove;
        _el$.$$keydown = onKeyDown;
        const _ref$2 = playerRef;
        typeof _ref$2 === "function" ? use(_ref$2, _el$2) : playerRef = _el$2;
        _el$2.$$mousemove = () => onUserActive(true);
        _el$2.addEventListener("mouseleave", playerOnMouseLeave);
        insert$1(_el$2, createComponent(Terminal, {
          get cols() {
            return terminalCols();
          },
          get rows() {
            return terminalRows();
          },
          get scale() {
            return terminalScale();
          },
          get blinking() {
            return blinking();
          },
          get lineHeight() {
            return props.terminalLineHeight;
          },
          preferEmbeddedTheme,
          core,
          get stats() {
            return stats.terminal;
          }
        }), null);
        insert$1(_el$2, createComponent(Show, {
          get when() {
            return props.controls !== false;
          },
          get children() {
            return createComponent(ControlBar, {
              get duration() {
                return duration();
              },
              get currentTime() {
                return state.currentTime;
              },
              get remainingTime() {
                return state.remainingTime;
              },
              get progress() {
                return state.progress;
              },
              markers,
              get isPlaying() {
                return isPlaying() || overlay() == "loader";
              },
              get isPausable() {
                return state.isPausable;
              },
              get isSeekable() {
                return state.isSeekable;
              },
              get isMuted() {
                return isMuted();
              },
              onPlayClick: togglePlay,
              onFullscreenClick: toggleFullscreen,
              onHelpClick: toggleHelp,
              onSeekClick: seek,
              onMuteClick: toggleMuted,
              ref(r$) {
                const _ref$3 = controlBarRef;
                typeof _ref$3 === "function" ? _ref$3(r$) : controlBarRef = r$;
              }
            });
          }
        }), null);
        insert$1(_el$2, createComponent(Switch, {
          get children() {
            return [createComponent(Match, {
              get when() {
                return overlay() == "start";
              },
              get children() {
                return createComponent(StartOverlay, {
                  onClick: play
                });
              }
            }), createComponent(Match, {
              get when() {
                return overlay() == "loader";
              },
              get children() {
                return createComponent(LoaderOverlay, {});
              }
            }), createComponent(Match, {
              get when() {
                return overlay() == "error";
              },
              get children() {
                return createComponent(ErrorOverlay, {});
              }
            })];
          }
        }), null);
        insert$1(_el$2, createComponent(Transition, {
          name: "slide",
          get children() {
            return createComponent(Show, {
              get when() {
                return overlay() == "info";
              },
              get children() {
                return createComponent(InfoOverlay, {
                  get message() {
                    return infoMessage();
                  },
                  get wasPlaying() {
                    return wasPlaying();
                  }
                });
              }
            });
          }
        }), null);
        insert$1(_el$2, createComponent(Show, {
          get when() {
            return isHelpVisible();
          },
          get children() {
            return createComponent(HelpOverlay, {
              onClose: () => setIsHelpVisible(false),
              get isPausable() {
                return state.isPausable;
              },
              get isSeekable() {
                return state.isSeekable;
              },
              get hasAudio() {
                return isMuted() !== void 0;
              }
            });
          }
        }), null);
        createRenderEffect((_p$) => {
          const _v$ = !!controlsVisible(), _v$2 = playerClass(), _v$3 = playerStyle();
          _v$ !== _p$._v$ && _el$.classList.toggle("ap-hud", _p$._v$ = _v$);
          _v$2 !== _p$._v$2 && className(_el$2, _p$._v$2 = _v$2);
          _p$._v$3 = style(_el$2, _v$3, _p$._v$3);
          return _p$;
        }, {
          _v$: void 0,
          _v$2: void 0,
          _v$3: void 0
        });
        return _el$;
      })();
      return el2;
    });
    delegateEvents(["keydown", "mousemove"]);
    function mount(core, elem) {
      let opts = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
      const metrics = measureTerminal(opts.terminalFontFamily, opts.terminalLineHeight);
      const props = {
        core,
        logger: opts.logger,
        cols: opts.cols,
        rows: opts.rows,
        fit: opts.fit,
        controls: opts.controls,
        autoPlay: opts.autoPlay,
        terminalFontSize: opts.terminalFontSize,
        terminalFontFamily: opts.terminalFontFamily,
        terminalLineHeight: opts.terminalLineHeight,
        theme: opts.theme,
        ...metrics
      };
      let el2;
      const dispose2 = render(() => {
        el2 = createComponent(Player, props);
        return el2;
      }, elem);
      return {
        el: el2,
        dispose: dispose2
      };
    }
    function measureTerminal(fontFamily, lineHeight) {
      const cols = 80;
      const rows = 24;
      const playerDiv = document.createElement("div");
      playerDiv.className = "ap-default-term-ff";
      playerDiv.style.height = "0px";
      playerDiv.style.overflow = "hidden";
      playerDiv.style.fontSize = "15px";
      if (fontFamily !== void 0) {
        playerDiv.style.setProperty("--term-font-family", fontFamily);
      }
      const termDiv = document.createElement("div");
      termDiv.className = "ap-term";
      termDiv.style.width = `${cols}ch`;
      termDiv.style.height = `${rows * (lineHeight ?? 1.3333333333)}em`;
      termDiv.style.fontSize = "100%";
      playerDiv.appendChild(termDiv);
      document.body.appendChild(playerDiv);
      const metrics = {
        charW: termDiv.clientWidth / cols,
        charH: termDiv.clientHeight / rows,
        bordersW: termDiv.offsetWidth - termDiv.clientWidth,
        bordersH: termDiv.offsetHeight - termDiv.clientHeight
      };
      document.body.removeChild(playerDiv);
      return metrics;
    }
    const CORE_OPTS = ["audioUrl", "autoPlay", "autoplay", "boldIsBright", "cols", "idleTimeLimit", "loop", "markers", "pauseOnMarkers", "poster", "preload", "rows", "speed", "startAt"];
    const UI_OPTS = ["autoPlay", "autoplay", "cols", "controls", "fit", "rows", "terminalFontFamily", "terminalFontSize", "terminalLineHeight", "theme"];
    function coreOpts(inputOpts) {
      let overrides = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
      const opts = Object.fromEntries(Object.entries(inputOpts).filter((_ref) => {
        let [key2] = _ref;
        return CORE_OPTS.includes(key2);
      }));
      opts.autoPlay ??= opts.autoplay;
      opts.speed ??= 1;
      return {
        ...opts,
        ...overrides
      };
    }
    function uiOpts(inputOpts) {
      let overrides = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
      const opts = Object.fromEntries(Object.entries(inputOpts).filter((_ref2) => {
        let [key2] = _ref2;
        return UI_OPTS.includes(key2);
      }));
      opts.autoPlay ??= opts.autoplay;
      opts.controls ??= "auto";
      return {
        ...opts,
        ...overrides
      };
    }
    function create(src, elem) {
      let opts = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
      const logger = opts.logger ?? new DummyLogger();
      const core = new Core(src, coreOpts(opts, {
        logger
      }));
      const {
        el: el2,
        dispose: dispose2
      } = mount(core, elem, uiOpts(opts, {
        logger
      }));
      const ready = core.init();
      const player = {
        el: el2,
        dispose: dispose2,
        getCurrentTime: () => ready.then(core.getCurrentTime.bind(core)),
        getDuration: () => ready.then(core.getDuration.bind(core)),
        play: () => ready.then(core.play.bind(core)),
        pause: () => ready.then(core.pause.bind(core)),
        seek: (pos2) => ready.then(() => core.seek(pos2))
      };
      player.addEventListener = (name2, callback) => {
        return core.addEventListener(name2, callback.bind(player));
      };
      return player;
    }
    const AsciinemaPlayer = ({
      id,
      rows,
      cols,
      inputUrl,
      outputUrl,
      timingUrl,
      fit,
      speed,
      autoPlay,
      loop,
      theme: theme2,
      idleTimeLimit = 2,
      style: style2
    }) => {
      const playerContainerRef = reactExports.useRef(null);
      reactExports.useEffect(() => {
        if (!playerContainerRef.current) return;
        const player = create(
          {
            url: [timingUrl, outputUrl, inputUrl],
            parser: "typescript"
          },
          playerContainerRef.current,
          {
            rows,
            cols,
            autoPlay,
            loop,
            theme: theme2,
            speed,
            idleTimeLimit,
            fit
          }
        );
        player.play();
        return () => {
          player.dispose();
        };
      }, [
        timingUrl,
        outputUrl,
        inputUrl,
        rows,
        cols,
        autoPlay,
        loop,
        theme2,
        speed,
        idleTimeLimit,
        fit
      ]);
      return /* @__PURE__ */ jsxRuntimeExports.jsx(
        "div",
        {
          id: `asciinema-player-${id || "default"}`,
          ref: playerContainerRef,
          style: { ...style2 }
        }
      );
    };
    function useRevokableUrls() {
      const urlsRef = reactExports.useRef([]);
      const createRevokableUrl = reactExports.useCallback(
        (data, type = "text/plain") => {
          const blob = new Blob([data], { type });
          const url = URL.createObjectURL(blob);
          urlsRef.current.push(url);
          return url;
        },
        []
      );
      reactExports.useEffect(() => {
        return () => {
          urlsRef.current.forEach((url) => URL.revokeObjectURL(url));
          urlsRef.current = [];
        };
      }, []);
      return createRevokableUrl;
    }
    const carouselThumbs = "_carouselThumbs_1mvg8_1";
    const carouselThumb = "_carouselThumb_1mvg8_1";
    const carouselPlayIcon = "_carouselPlayIcon_1mvg8_16";
    const lightboxOverlay = "_lightboxOverlay_1mvg8_20";
    const lightboxContent = "_lightboxContent_1mvg8_33";
    const lightboxButtonCloseWrapper = "_lightboxButtonCloseWrapper_1mvg8_45";
    const lightboxButtonClose = "_lightboxButtonClose_1mvg8_45";
    const lightboxPreviewButton = "_lightboxPreviewButton_1mvg8_63";
    const styles$z = {
      carouselThumbs,
      carouselThumb,
      carouselPlayIcon,
      lightboxOverlay,
      lightboxContent,
      lightboxButtonCloseWrapper,
      lightboxButtonClose,
      lightboxPreviewButton
    };
    const LightboxCarousel = ({ id, slides }) => {
      const [isOpen, setIsOpen] = useProperty(id, "isOpen", {
        defaultValue: false
      });
      const [currentIndex, setCurrentIndex] = useProperty(id, "currentIndex", {
        defaultValue: 0
      });
      const [showOverlay, setShowOverlay] = useProperty(id, "showOverlay", {
        defaultValue: false
      });
      const openLightbox = reactExports.useCallback(
        (index) => {
          setCurrentIndex(index);
          setShowOverlay(true);
          setTimeout(() => setIsOpen(true), 10);
        },
        [setCurrentIndex, setIsOpen, setShowOverlay]
      );
      const closeLightbox = reactExports.useCallback(() => {
        setIsOpen(false);
      }, [setIsOpen]);
      reactExports.useEffect(() => {
        if (!isOpen && showOverlay) {
          const timer = setTimeout(() => {
            setShowOverlay(false);
          }, 300);
          return () => clearTimeout(timer);
        }
      }, [isOpen, showOverlay, setShowOverlay]);
      const showNext = reactExports.useCallback(() => {
        setCurrentIndex(currentIndex + 1);
      }, [setCurrentIndex, currentIndex]);
      const showPrev = reactExports.useCallback(() => {
        setCurrentIndex((currentIndex - 1 + slides.length) % slides.length);
      }, [setCurrentIndex, currentIndex, slides.length]);
      reactExports.useEffect(() => {
        if (!isOpen) return;
        const handleKeyUp = (e) => {
          if (e.key === "Escape") {
            closeLightbox();
          } else if (e.key === "ArrowRight") {
            showNext();
          } else if (e.key === "ArrowLeft") {
            showPrev();
          }
          e.preventDefault();
          e.stopPropagation();
        };
        window.addEventListener("keyup", handleKeyUp, true);
        return () => window.removeEventListener("keyup", handleKeyUp);
      }, [closeLightbox, isOpen, showNext, showPrev]);
      const handleThumbClick = reactExports.useCallback(
        (e) => {
          const index = Number(e.currentTarget.dataset.index);
          openLightbox(index);
        },
        [openLightbox]
      );
      return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx("lightbox-carousel-container"), children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$z.carouselThumbs), children: slides.map((slide, index) => {
          return /* @__PURE__ */ jsxRuntimeExports.jsxs(
            "div",
            {
              "data-index": index,
              className: clsx(styles$z.carouselThumb),
              onClick: handleThumbClick,
              children: [
                /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: slide.label }),
                /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
                  "i",
                  {
                    className: clsx(
                      ApplicationIcons.play,
                      styles$z.carouselPlayIcon
                    )
                  }
                ) })
              ]
            },
            index
          );
        }) }),
        showOverlay && /* @__PURE__ */ jsxRuntimeExports.jsxs(
          "div",
          {
            className: clsx(styles$z.lightboxOverlay, isOpen ? "open" : "closed"),
            children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$z.lightboxButtonCloseWrapper), children: /* @__PURE__ */ jsxRuntimeExports.jsx(
                "button",
                {
                  className: styles$z.lightboxButtonClose,
                  onClick: closeLightbox,
                  children: /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: ApplicationIcons.close })
                }
              ) }),
              slides.length > 1 ? /* @__PURE__ */ jsxRuntimeExports.jsx(
                "button",
                {
                  className: clsx(styles$z.lightboxPreviewButton, "prev"),
                  onClick: showPrev,
                  children: /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: ApplicationIcons.previous })
                }
              ) : "",
              slides.length > 1 ? /* @__PURE__ */ jsxRuntimeExports.jsx(
                "button",
                {
                  className: clsx(styles$z.lightboxPreviewButton, "next"),
                  onClick: showNext,
                  children: /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: ApplicationIcons.next })
                }
              ) : "",
              /* @__PURE__ */ jsxRuntimeExports.jsx(
                "div",
                {
                  className: clsx(styles$z.lightboxContent, isOpen ? "open" : "closed"),
                  children: slides[currentIndex].render()
                },
                `carousel-slide-${currentIndex}`
              )
            ]
          }
        )
      ] });
    };
    const HumanBaselineView = ({
      started: started2,
      runtime,
      answer: answer2,
      completed,
      running,
      sessionLogs
    }) => {
      const createRevokableUrl = useRevokableUrls();
      const player_fns = [];
      let count = 1;
      for (const sessionLog of sessionLogs) {
        const rows = extractSize(sessionLog.output, "LINES", 24);
        const cols = extractSize(sessionLog.output, "COLUMNS", 80);
        const currentCount = count;
        const title2 = sessionLogs.length === 1 ? "Terminal Session" : `Terminal Session ${currentCount}`;
        player_fns.push({
          label: title2,
          render: () => /* @__PURE__ */ jsxRuntimeExports.jsx(
            AsciinemaPlayer,
            {
              id: `player-${currentCount}`,
              inputUrl: createRevokableUrl(sessionLog.input),
              outputUrl: createRevokableUrl(sessionLog.output),
              timingUrl: createRevokableUrl(sessionLog.timing),
              rows,
              cols,
              className: "asciinema-player",
              style: {
                height: `${rows * 2}em`,
                width: `${cols * 2}em`
              },
              fit: "both"
            }
          )
        });
        count += 1;
      }
      const StatusMessage = ({
        completed: completed2,
        running: running2,
        answer: answer22
      }) => {
        if (running2) {
          return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-style-label", children: "Running" });
        } else if (completed2) {
          return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              "span",
              {
                className: "text-style-label text-style-secondary asciinema-player-status",
                children: "Answer"
              }
            ),
            /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: answer22 })
          ] });
        } else {
          return "Unknown status";
        }
      };
      return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "asciinema-wrapper", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "asciinema-container", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "asciinema-header-left text-style-label", children: [
          started2 ? formatDateTime(started2) : "",
          runtime ? ` (${formatTime$1(Math.floor(runtime))})` : ""
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "asciinema-header-center text-style-label" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "asciinema-header-right", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
          StatusMessage,
          {
            completed,
            running,
            answer: answer2
          }
        ) }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "asciinema-body", children: /* @__PURE__ */ jsxRuntimeExports.jsx(LightboxCarousel, { id: "ascii-cinema", slides: player_fns }) })
      ] }) });
    };
    const extractSize = (value2, label2, defaultValue) => {
      const regex2 = new RegExp(`${label2}="(\\d+)"`);
      const match = value2.match(regex2);
      const size = match ? match[1] : void 0;
      if (size) {
        return parseInt(size);
      } else {
        return defaultValue;
      }
    };
    const toolsGrid = "_toolsGrid_1qqm2_1";
    const tools = "_tools_1qqm2_1";
    const tool = "_tool_1qqm2_1";
    const styles$y = {
      toolsGrid,
      tools,
      tool
    };
    const system_msg_added_sig = {
      type: "system_message",
      signature: {
        remove: ["/messages/0/source"],
        replace: ["/messages/0/role", "/messages/0/content"],
        add: ["/messages/1"]
      },
      render: (_changes, resolvedState) => {
        const messages2 = resolvedState["messages"];
        const message2 = messages2[0];
        if (typeof message2 !== "object" || !message2) {
          return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {});
        }
        return /* @__PURE__ */ jsxRuntimeExports.jsx(
          ChatView,
          {
            id: "system_msg_event_preview",
            messages: [message2],
            allowLinking: false
          },
          "system_msg_event_preview"
        );
      }
    };
    const kToolPattern = "/tools/(\\d+)";
    const use_tools = {
      type: "use_tools",
      signature: {
        add: ["/tools/0"],
        replace: ["/tool_choice"],
        remove: []
      },
      render: (changes, resolvedState) => {
        return renderTools(changes, resolvedState);
      }
    };
    const add_tools = {
      type: "add_tools",
      signature: {
        add: [kToolPattern],
        replace: [],
        remove: []
      },
      render: (changes, resolvedState) => {
        return renderTools(changes, resolvedState);
      }
    };
    const messages = {
      type: "messages",
      match: (changes) => {
        const allMessages = changes.every((change) => {
          if (change.op === "add" && change.path.match(/\/messages\/\d+/)) {
            return typeof change.value["role"] === "string" && ["user", "assistant", "system", "tool"].includes(change.value["role"]);
          }
          return false;
        });
        return allMessages;
      },
      render: (changes) => {
        const messages2 = changes.map((c2) => c2.value);
        return /* @__PURE__ */ jsxRuntimeExports.jsx(
          ChatView,
          {
            id: "system_msg_event_preview",
            messages: messages2,
            allowLinking: false
          },
          "system_msg_event_preview"
        );
      }
    };
    const humanAgentKey = (key2) => {
      return `HumanAgentState:${key2}`;
    };
    const human_baseline_session = {
      type: "human_baseline_session",
      signature: {
        add: ["HumanAgentState:logs"],
        replace: [],
        remove: []
      },
      render: (_changes, state) => {
        const started2 = state[humanAgentKey("started_running")];
        const runtime = state[humanAgentKey("accumulated_time")];
        const answer2 = state[humanAgentKey("answer")];
        const completed = !!answer2;
        const running = state[humanAgentKey("running_state")];
        const rawSessions = state[humanAgentKey("logs")];
        const startedDate = started2 ? new Date(started2 * 1e3) : void 0;
        const sessions = {};
        if (rawSessions) {
          for (const key2 of Object.keys(rawSessions)) {
            const value2 = rawSessions[key2];
            const match = key2.match(/(.*)_(\d+_\d+)\.(.*)/);
            if (match) {
              const user2 = match[1];
              const timestamp = match[2];
              const type = match[3];
              sessions[timestamp] = sessions[timestamp] || {};
              switch (type) {
                case "input":
                  sessions[timestamp].input = value2;
                  break;
                case "output":
                  sessions[timestamp].output = value2;
                  break;
                case "timing":
                  sessions[timestamp].timing = value2;
                  break;
                case "name":
                  sessions[timestamp].name = value2;
                  break;
              }
              sessions[timestamp].user = user2;
            }
          }
        }
        return /* @__PURE__ */ jsxRuntimeExports.jsx(
          HumanBaselineView,
          {
            started: startedDate,
            running,
            completed,
            answer: answer2,
            runtime,
            sessionLogs: Object.values(sessions)
          },
          "human_baseline_view"
        );
      }
    };
    const renderTools = (changes, resolvedState) => {
      const toolIndexes = [];
      for (const change of changes) {
        const match = change.path.match(kToolPattern);
        if (match) {
          toolIndexes.push(match[1]);
        }
      }
      const toolName = (toolChoice2) => {
        if (typeof toolChoice2 === "object" && toolChoice2 && !Array.isArray(toolChoice2)) {
          return toolChoice2["name"];
        } else {
          return String(toolChoice2);
        }
      };
      const toolsInfo = {};
      const hasToolChoice = changes.find((change) => {
        return change.path.startsWith("/tool_choice");
      });
      if (resolvedState.tool_choice && hasToolChoice) {
        toolsInfo["Tool Choice"] = /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: clsx("text-size-smaller"), children: toolName(resolvedState.tool_choice) });
      }
      const tools2 = resolvedState.tools;
      if (tools2.length > 0) {
        if (toolIndexes.length === 0) {
          toolsInfo["Tools"] = /* @__PURE__ */ jsxRuntimeExports.jsx(Tools, { toolDefinitions: resolvedState.tools });
        } else {
          const filtered = tools2.filter((_, index) => {
            return toolIndexes.includes(index.toString());
          });
          toolsInfo["Tools"] = /* @__PURE__ */ jsxRuntimeExports.jsx(Tools, { toolDefinitions: filtered });
        }
      }
      return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$y.tools), children: Object.keys(toolsInfo).map((key2) => {
        return /* @__PURE__ */ jsxRuntimeExports.jsxs(reactExports.Fragment, { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "div",
            {
              className: clsx(
                "text-size-smaller",
                "text-style-label",
                "text-style-secondary"
              ),
              children: key2
            }
          ),
          toolsInfo[key2]
        ] }, key2);
      }) }, "state-diff-tools");
    };
    const createMessageRenderer = (name2, role2) => {
      return {
        type: name2,
        match: (changes) => {
          if (changes.length === 1) {
            const change = changes[0];
            if (change.op === "add" && change.path.match(/\/messages\/\d+/)) {
              return change.value["role"] === role2;
            }
          }
          return false;
        },
        render: (changes) => {
          const message2 = changes[0].value;
          return /* @__PURE__ */ jsxRuntimeExports.jsx(
            ChatView,
            {
              id: "system_msg_event_preview",
              messages: [message2],
              allowLinking: false
            },
            "system_msg_event_preview"
          );
        }
      };
    };
    const RenderableChangeTypes = [
      system_msg_added_sig,
      createMessageRenderer("assistant_msg", "assistant"),
      createMessageRenderer("user_msg", "user"),
      use_tools,
      add_tools,
      messages
    ];
    const StoreSpecificRenderableTypes = [
      human_baseline_session
    ];
    const Tools = ({ toolDefinitions }) => {
      return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$y.toolsGrid, children: toolDefinitions.map((toolDefinition, idx) => {
        const toolName = toolDefinition.name;
        const toolArgs = toolDefinition.parameters?.properties ? Object.keys(toolDefinition.parameters.properties) : [];
        return /* @__PURE__ */ jsxRuntimeExports.jsx(
          Tool,
          {
            toolName,
            toolArgs
          },
          `${toolName}-${idx}`
        );
      }) });
    };
    const Tool = ({ toolName, toolArgs }) => {
      const functionCall = toolArgs && toolArgs.length > 0 ? `${toolName}(${toolArgs.join(", ")})` : toolName;
      return /* @__PURE__ */ jsxRuntimeExports.jsx("code", { className: clsx("text-size-smallest", styles$y.tool), children: functionCall });
    };
    const diff = "_diff_eobja_1";
    const summary$2 = "_summary_eobja_6";
    const styles$x = {
      diff,
      summary: summary$2
    };
    const StateEventView = ({
      eventNode,
      className: className2
    }) => {
      const event = eventNode.event;
      const summary2 = reactExports.useMemo(() => {
        return summarizeChanges(event.changes);
      }, [event.changes]);
      const [before, after] = reactExports.useMemo(() => {
        try {
          return synthesizeComparable(event.changes);
        } catch (e) {
          console.error(
            "Unable to synthesize comparable object to display state diffs.",
            e
          );
          return [{}, {}];
        }
      }, [event.changes]);
      const changePreview = reactExports.useMemo(() => {
        const isStore = eventNode.event.event === "store";
        return generatePreview(event.changes, structuredClone(after), isStore);
      }, [eventNode.event.event, event.changes, after]);
      const title2 = event.event === "state" ? "State Updated" : "Store Updated";
      const collapseEvent = useStore((state) => state.sampleActions.collapseEvent);
      reactExports.useEffect(() => {
        if (changePreview === void 0) {
          collapseEvent(kTranscriptCollapseScope, eventNode.id, true);
        }
      }, [changePreview, collapseEvent, eventNode.id]);
      return /* @__PURE__ */ jsxRuntimeExports.jsxs(
        EventPanel,
        {
          eventNodeId: eventNode.id,
          depth: eventNode.depth,
          title: title2,
          className: className2,
          subTitle: formatDateTime(new Date(event.timestamp)),
          text: !changePreview ? summary2 : void 0,
          collapsibleContent: true,
          children: [
            changePreview ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { "data-name": "Summary", className: clsx(styles$x.summary), children: changePreview }) : void 0,
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              StateDiffView,
              {
                before,
                after,
                "data-name": "Diff",
                className: clsx(styles$x.diff)
              }
            )
          ]
        }
      );
    };
    const generatePreview = (changes, resolvedState, isStore) => {
      const results = [];
      for (const changeType of [
        ...RenderableChangeTypes,
        ...isStore ? StoreSpecificRenderableTypes : []
      ]) {
        if (changeType.signature) {
          const requiredMatchCount = changeType.signature.remove.length + changeType.signature.replace.length + changeType.signature.add.length;
          let matchingOps = 0;
          for (const change of changes) {
            const op = change.op;
            switch (op) {
              case "add":
                if (changeType.signature.add && changeType.signature.add.length > 0) {
                  changeType.signature.add.forEach((signature) => {
                    if (change.path.match(signature)) {
                      matchingOps++;
                    }
                  });
                }
                break;
              case "remove":
                if (changeType.signature.remove && changeType.signature.remove.length > 0) {
                  changeType.signature.remove.forEach((signature) => {
                    if (change.path.match(signature)) {
                      matchingOps++;
                    }
                  });
                }
                break;
              case "replace":
                if (changeType.signature.replace && changeType.signature.replace.length > 0) {
                  changeType.signature.replace.forEach((signature) => {
                    if (change.path.match(signature)) {
                      matchingOps++;
                    }
                  });
                }
                break;
            }
          }
          if (matchingOps === requiredMatchCount) {
            const el2 = changeType.render(changes, resolvedState);
            results.push(el2);
            break;
          }
        } else if (changeType.match) {
          const matches = changeType.match(changes);
          if (matches) {
            const el2 = changeType.render(changes, resolvedState);
            results.push(el2);
            break;
          }
        }
      }
      return results.length > 0 ? results : void 0;
    };
    const summarizeChanges = (changes) => {
      const changeMap = {
        add: [],
        copy: [],
        move: [],
        replace: [],
        remove: [],
        test: []
      };
      for (const change of changes) {
        switch (change.op) {
          case "add":
            changeMap.add.push(change.path);
            break;
          case "copy":
            changeMap.copy.push(change.path);
            break;
          case "move":
            changeMap.move.push(change.path);
            break;
          case "replace":
            changeMap.replace.push(change.path);
            break;
          case "remove":
            changeMap.remove.push(change.path);
            break;
          case "test":
            changeMap.test.push(change.path);
            break;
        }
      }
      const changeList = [];
      const totalOpCount = Object.keys(changeMap).reduce((prev, current2) => {
        return prev + changeMap[current2].length;
      }, 0);
      if (totalOpCount > 2) {
        Object.keys(changeMap).forEach((key2) => {
          const opChanges = changeMap[key2];
          if (opChanges.length > 0) {
            changeList.push(`${key2} ${opChanges.length}`);
          }
        });
      } else {
        Object.keys(changeMap).forEach((key2) => {
          const opChanges = changeMap[key2];
          if (opChanges.length > 0) {
            changeList.push(`${key2} ${opChanges.join(", ")}`);
          }
        });
      }
      return changeList.join(", ");
    };
    const synthesizeComparable = (changes) => {
      const before = {};
      const after = {};
      for (const change of changes) {
        switch (change.op) {
          case "add":
            initializeArrays(before, change.path);
            initializeArrays(after, change.path);
            setPath(after, change.path, change.value);
            break;
          case "copy":
            setPath(before, change.path, change.value);
            setPath(after, change.path, change.value);
            break;
          case "move":
            setPath(before, change.from || "", change.value);
            setPath(after, change.path, change.value);
            break;
          case "remove":
            setPath(before, change.path, change.value);
            break;
          case "replace":
            initializeArrays(before, change.path);
            initializeArrays(after, change.path);
            setPath(before, change.path, change.replaced);
            setPath(after, change.path, change.value);
            break;
        }
      }
      return [before, after];
    };
    function setPath(target2, path, value2) {
      const keys = parsePath(path);
      let current2 = target2;
      for (let i2 = 0; i2 < keys.length - 1; i2++) {
        const key2 = keys[i2];
        if (!(key2 in current2)) {
          current2[key2] = isArrayIndex(keys[i2 + 1]) ? [] : {};
        }
        current2 = current2[key2];
      }
      const lastKey = keys[keys.length - 1];
      current2[lastKey] = value2;
    }
    function initializeArrays(target2, path) {
      const keys = parsePath(path);
      let current2 = target2;
      for (let i2 = 0; i2 < keys.length - 1; i2++) {
        const key2 = keys[i2];
        const nextKey = keys[i2 + 1];
        if (isArrayIndex(nextKey)) {
          current2[key2] = initializeArray(
            current2[key2],
            nextKey
          );
        } else {
          current2[key2] = initializeObject(current2[key2]);
        }
        current2 = current2[key2];
      }
      const lastKey = keys[keys.length - 1];
      if (isArrayIndex(lastKey)) {
        const lastValue = current2[lastKey];
        initializeArray(lastValue, lastKey);
      }
    }
    function parsePath(path) {
      return path.split("/").filter(Boolean);
    }
    function isArrayIndex(key2) {
      return /^\d+$/.test(key2);
    }
    function initializeArray(current2, nextKey) {
      if (!Array.isArray(current2)) {
        current2 = [];
      }
      const nextKeyIndex = parseInt(nextKey, 10);
      while (current2.length < nextKeyIndex) {
        current2.push("");
      }
      return current2;
    }
    function initializeObject(current2) {
      return current2 ?? {};
    }
    const StepEventView = ({
      eventNode,
      children: children2,
      className: className2
    }) => {
      const event = eventNode.event;
      const descriptor = stepDescriptor(event);
      const title2 = descriptor.name || `${event.type ? event.type + ": " : "Step: "}${event.name}`;
      const text2 = summarize$1(children2);
      return /* @__PURE__ */ jsxRuntimeExports.jsx(
        EventPanel,
        {
          eventNodeId: eventNode.id,
          depth: eventNode.depth,
          childIds: children2.map((child) => child.id),
          className: clsx("transcript-step", className2),
          title: title2,
          subTitle: formatDateTime(new Date(event.timestamp)),
          icon: descriptor.icon,
          text: text2
        }
      );
    };
    const summarize$1 = (children2) => {
      if (children2.length === 0) {
        return "(no events)";
      }
      const formatEvent = (event, count) => {
        if (count === 1) {
          return `${count} ${event} event`;
        } else {
          return `${count} ${event} events`;
        }
      };
      const typeCount = {};
      children2.forEach((child) => {
        const currentCount = typeCount[child.event.event] || 0;
        typeCount[child.event.event] = currentCount + 1;
      });
      const numberOfTypes = Object.keys(typeCount).length;
      if (numberOfTypes < 3) {
        return Object.keys(typeCount).map((key2) => {
          return formatEvent(key2, typeCount[key2]);
        }).join(", ");
      }
      if (children2.length === 1) {
        return "1 event";
      } else {
        return `${children2.length} events`;
      }
    };
    const stepDescriptor = (event) => {
      const rootStepDescriptor = {
        endSpace: true
      };
      if (event.type === "solver") {
        switch (event.name) {
          case "chain_of_thought":
            return {
              ...rootStepDescriptor
            };
          case "generate":
            return {
              ...rootStepDescriptor
            };
          case "self_critique":
            return {
              ...rootStepDescriptor
            };
          case "system_message":
            return {
              ...rootStepDescriptor
            };
          case "use_tools":
            return {
              ...rootStepDescriptor
            };
          case "multiple_choice":
            return {
              ...rootStepDescriptor
            };
          default:
            return {
              ...rootStepDescriptor
            };
        }
      } else if (event.type === "scorer") {
        return {
          ...rootStepDescriptor
        };
      } else if (event.event === "step") {
        if (event.name === kSandboxSignalName) {
          return {
            ...rootStepDescriptor,
            name: "Sandbox Events"
          };
        } else if (event.name === "init") {
          return {
            ...rootStepDescriptor,
            name: "Init"
          };
        } else {
          return {
            ...rootStepDescriptor
          };
        }
      } else {
        switch (event.name) {
          case "sample_init":
            return {
              ...rootStepDescriptor,
              name: "Sample Init"
            };
          default:
            return {
              endSpace: false
            };
        }
      }
    };
    const summary$1 = "_summary_ac4z2_1";
    const summaryRendered = "_summaryRendered_ac4z2_6";
    const subtaskSummary = "_subtaskSummary_ac4z2_10";
    const subtaskLabel = "_subtaskLabel_ac4z2_17";
    const styles$w = {
      summary: summary$1,
      summaryRendered,
      subtaskSummary,
      subtaskLabel
    };
    const SubtaskEventView = ({
      eventNode,
      children: children2,
      className: className2
    }) => {
      const event = eventNode.event;
      const body2 = [];
      if (event.type === "fork") {
        body2.push(
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { title: "Summary", className: clsx(styles$w.summary), children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx("text-style-label"), children: "Inputs" }),
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$w.summaryRendered), children: /* @__PURE__ */ jsxRuntimeExports.jsx(Rendered, { values: event.input }) })
          ] })
        );
      } else {
        body2.push(
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            SubtaskSummary,
            {
              "data-name": "Summary",
              input: event.input,
              result: event.result
            }
          )
        );
      }
      const type = event.type === "fork" ? "Fork" : "Subtask";
      return /* @__PURE__ */ jsxRuntimeExports.jsx(
        EventPanel,
        {
          eventNodeId: eventNode.id,
          depth: eventNode.depth,
          className: className2,
          title: formatTitle(
            `${type}: ${event.name}`,
            void 0,
            event.working_time
          ),
          subTitle: formatTiming(event.timestamp, event.working_start),
          childIds: children2.map((child) => child.id),
          collapseControl: "bottom",
          children: body2
        }
      );
    };
    const SubtaskSummary = ({ input: input2, result: result2 }) => {
      const output2 = typeof result2 === "object" ? result2 : { result: result2 };
      return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$w.subtaskSummary), children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx("text-style-label", "text-size-small"), children: "Input" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx("text-size-large", styles$w.subtaskLabel) }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx("text-style-label", "text-size-small"), children: "Output" }),
        input2 ? /* @__PURE__ */ jsxRuntimeExports.jsx(Rendered, { values: input2 }) : void 0,
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx("text-size-title-secondary", styles$w.subtaskLabel), children: /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: ApplicationIcons.arrows.right }) }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Rendered, { values: output2 }) })
      ] });
    };
    const Rendered = ({ values }) => {
      if (Array.isArray(values)) {
        return values.map((val) => {
          return /* @__PURE__ */ jsxRuntimeExports.jsx(Rendered, { values: val });
        });
      } else if (values && typeof values === "object") {
        if (Object.keys(values).length === 0) {
          return /* @__PURE__ */ jsxRuntimeExports.jsx(None, {});
        } else {
          return /* @__PURE__ */ jsxRuntimeExports.jsx(MetaDataGrid, { entries: values });
        }
      } else {
        return values;
      }
    };
    const None = () => {
      return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: clsx("text-size-small", "text-style-secondary"), children: "[None]" });
    };
    const summary = "_summary_1qsnv_1";
    const approval = "_approval_1qsnv_6";
    const progress = "_progress_1qsnv_12";
    const styles$v = {
      summary,
      approval,
      progress
    };
    const ToolEventView = ({
      eventNode,
      children: children2,
      className: className2
    }) => {
      const event = eventNode.event;
      const { input: input2, description: description2, functionCall, contentType } = reactExports.useMemo(
        () => resolveToolInput(event.function, event.arguments),
        [event.function, event.arguments]
      );
      const { approvalNode, lastModelNode } = reactExports.useMemo(() => {
        const approvalNode2 = children2.find((e) => {
          return e.event.event === "approval";
        });
        const lastModelNode2 = children2.findLast((e) => {
          return e.event.event === "model";
        });
        return {
          approvalNode: approvalNode2,
          lastModelNode: lastModelNode2
        };
      }, [children2]);
      const title2 = `Tool: ${event.view?.title || event.function}`;
      return /* @__PURE__ */ jsxRuntimeExports.jsx(
        EventPanel,
        {
          eventNodeId: eventNode.id,
          depth: eventNode.depth,
          title: formatTitle(title2, void 0, event.working_time),
          className: className2,
          subTitle: formatTiming(event.timestamp, event.working_start),
          icon: ApplicationIcons.solvers.use_tools,
          childIds: children2.map((child) => child.id),
          collapseControl: "bottom",
          children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { "data-name": "Summary", className: styles$v.summary, children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              ToolCallView,
              {
                id: `${eventNode.id}-tool-call`,
                functionCall,
                input: input2,
                description: description2,
                contentType,
                output: event.error?.message || event.result,
                mode: "compact",
                view: event.view ? event.view : void 0
              }
            ),
            lastModelNode ? /* @__PURE__ */ jsxRuntimeExports.jsx(
              ChatView,
              {
                id: `${eventNode.id}-toolcall-chatmessage`,
                messages: lastModelNode.event.output.choices.map((m) => m.message),
                numbered: false,
                toolCallStyle: "compact",
                allowLinking: false
              }
            ) : void 0,
            approvalNode ? /* @__PURE__ */ jsxRuntimeExports.jsx(
              ApprovalEventView,
              {
                eventNode: approvalNode,
                className: styles$v.approval
              }
            ) : "",
            event.pending ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$v.progress), children: /* @__PURE__ */ jsxRuntimeExports.jsx(PulsingDots, { subtle: false, size: "medium" }) }) : void 0
          ] })
        }
      );
    };
    const container$9 = "_container_io1r0_1";
    const wrappingContent = "_wrappingContent_io1r0_8";
    const separator = "_separator_io1r0_13";
    const unchanged = "_unchanged_io1r0_22";
    const section = "_section_io1r0_27";
    const spacer = "_spacer_io1r0_31";
    const styles$u = {
      container: container$9,
      wrappingContent,
      separator,
      unchanged,
      section,
      spacer
    };
    const kUnchangedSentinel = "UNCHANGED";
    const ScoreEditEventView = ({
      eventNode,
      className: className2
    }) => {
      const event = eventNode.event;
      const subtitle = event.edit.provenance ? `[${formatDateTime(new Date(event.edit.provenance.timestamp))}] ${event.edit.provenance.author}: ${event.edit.provenance.reason || ""}` : void 0;
      return /* @__PURE__ */ jsxRuntimeExports.jsx(
        EventPanel,
        {
          eventNodeId: eventNode.id,
          depth: eventNode.depth,
          title: "Edit Score",
          className: clsx(className2, "text-size-small"),
          subTitle: subtitle,
          collapsibleContent: true,
          icon: ApplicationIcons.edit,
          children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { "data-name": "Summary", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              "div",
              {
                className: clsx(
                  "text-style-label",
                  "text-style-secondary",
                  styles$u.section
                ),
                children: "Updated Values"
              }
            ),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$u.container), children: [
              event.edit.value ? /* @__PURE__ */ jsxRuntimeExports.jsxs(reactExports.Fragment, { children: [
                /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$u.separator) }),
                /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-style-label", children: "Value" }),
                /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: renderScore(event.edit.value) })
              ] }) : "",
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$u.separator) }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-style-label", children: "Answer" }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$u.wrappingContent), children: event.edit.answer === kUnchangedSentinel ? /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: clsx(styles$u.unchanged), children: "[unchanged]" }) : /* @__PURE__ */ jsxRuntimeExports.jsx(RenderedText, { markdown: event.edit.answer || "" }) }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$u.separator) }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-style-label", children: "Explanation" }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$u.wrappingContent), children: /* @__PURE__ */ jsxRuntimeExports.jsx(RenderedText, { markdown: event.edit.explanation || "" }) })
            ] }),
            event.edit.provenance ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$u.container), children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx(
                "div",
                {
                  className: clsx(
                    "text-style-label",
                    "text-style-secondary",
                    styles$u.section
                  ),
                  children: "Provenance"
                }
              ),
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$u.spacer) }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$u.separator) }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-style-label", children: "Author" }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$u.wrappingContent), children: /* @__PURE__ */ jsxRuntimeExports.jsx(RenderedText, { markdown: event.edit.provenance.author }) }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$u.separator) }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-style-label", children: "Reason" }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$u.wrappingContent), children: /* @__PURE__ */ jsxRuntimeExports.jsx(RenderedText, { markdown: event.edit.provenance.reason || "" }) }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$u.separator) }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-style-label", children: "Time" }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$u.wrappingContent), children: /* @__PURE__ */ jsxRuntimeExports.jsx(
                RenderedText,
                {
                  markdown: formatDateTime(new Date(event.edit.provenance.timestamp)) || ""
                }
              ) })
            ] }) : "",
            event.edit.metadata && event.edit.metadata !== kUnchangedSentinel ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { "data-name": "Metadata", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
              RecordTree,
              {
                id: `${eventNode.id}-score-metadata`,
                record: event.edit.metadata || {},
                className: styles$u.metadataTree,
                defaultExpandLevel: 0
              }
            ) }) : void 0
          ] })
        }
      );
    };
    const SpanEventView = ({
      eventNode,
      children: children2,
      className: className2
    }) => {
      const event = eventNode.event;
      const descriptor = spanDescriptor(event);
      const title2 = descriptor.name || `${event.type ? event.type + ": " : "Step: "}${event.name}`;
      const text2 = reactExports.useMemo(() => summarize(children2), [children2]);
      const childIds = reactExports.useMemo(() => children2.map((child) => child.id), [children2]);
      return /* @__PURE__ */ jsxRuntimeExports.jsx(
        EventPanel,
        {
          eventNodeId: eventNode.id,
          depth: eventNode.depth,
          childIds,
          className: clsx("transcript-span", className2),
          title: title2,
          subTitle: formatDateTime(new Date(event.timestamp)),
          text: text2,
          icon: descriptor.icon
        }
      );
    };
    const summarize = (children2) => {
      if (children2.length === 0) {
        return "(no events)";
      }
      const formatEvent = (event, count) => {
        if (count === 1) {
          return `${count} ${event} event`;
        } else {
          return `${count} ${event} events`;
        }
      };
      const typeCount = {};
      children2.forEach((child) => {
        const currentCount = typeCount[child.event.event] || 0;
        typeCount[child.event.event] = currentCount + 1;
      });
      const numberOfTypes = Object.keys(typeCount).length;
      if (numberOfTypes < 3) {
        return Object.keys(typeCount).map((key2) => {
          return formatEvent(key2, typeCount[key2]);
        }).join(", ");
      }
      if (children2.length === 1) {
        return "1 event";
      } else {
        return `${children2.length} events`;
      }
    };
    const spanDescriptor = (event) => {
      const rootStepDescriptor = {
        endSpace: true
      };
      if (event.type === "solver") {
        switch (event.name) {
          case "chain_of_thought":
            return {
              ...rootStepDescriptor
            };
          case "generate":
            return {
              ...rootStepDescriptor
            };
          case "self_critique":
            return {
              ...rootStepDescriptor
            };
          case "system_message":
            return {
              ...rootStepDescriptor
            };
          case "use_tools":
            return {
              ...rootStepDescriptor
            };
          case "multiple_choice":
            return {
              ...rootStepDescriptor
            };
          default:
            return {
              ...rootStepDescriptor
            };
        }
      } else if (event.type === "scorer") {
        return {
          ...rootStepDescriptor
        };
      } else if (event.event === "span_begin") {
        if (event.span_id === kSandboxSignalName) {
          return {
            ...rootStepDescriptor,
            name: "Sandbox Events"
          };
        } else if (event.name === "init") {
          return {
            ...rootStepDescriptor,
            name: "Init"
          };
        } else {
          return {
            ...rootStepDescriptor
          };
        }
      } else {
        switch (event.name) {
          case "sample_init":
            return {
              ...rootStepDescriptor,
              name: "Sample Init"
            };
          default:
            return {
              endSpace: false
            };
        }
      }
    };
    const node = "_node_1r858_1";
    const attached = "_attached_1r858_5";
    const attachedParent = "_attachedParent_1r858_9";
    const attachedChild = "_attachedChild_1r858_16";
    const styles$t = {
      node,
      attached,
      attachedParent,
      attachedChild
    };
    const TranscriptVirtualListComponent = ({
      id,
      listHandle,
      eventNodes,
      scrollRef,
      running,
      initialEventId,
      offsetTop,
      className: className2
    }) => {
      const useVirtualization = running || eventNodes.length > 100;
      const setNativeFind = useStore((state) => state.appActions.setNativeFind);
      reactExports.useEffect(() => {
        setNativeFind(!useVirtualization);
      }, [setNativeFind, useVirtualization]);
      const initialEventIndex = reactExports.useMemo(() => {
        if (initialEventId === null || initialEventId === void 0) {
          return void 0;
        }
        const result2 = eventNodes.findIndex((event) => {
          return event.id === initialEventId;
        });
        return result2 === -1 ? void 0 : result2;
      }, [initialEventId, eventNodes]);
      const hasToolEventsAtCurrentDepth = reactExports.useCallback(
        (startIndex) => {
          for (let i2 = startIndex; i2 >= 0; i2--) {
            const node2 = eventNodes[i2];
            if (node2.event.event === "tool") {
              return true;
            }
            if (node2.depth < eventNodes[startIndex].depth) {
              return false;
            }
          }
          return false;
        },
        [eventNodes]
      );
      const contextWithToolEvents = reactExports.useMemo(() => ({ hasToolEvents: true }), []);
      const contextWithoutToolEvents = reactExports.useMemo(
        () => ({ hasToolEvents: false }),
        []
      );
      const nonVirtualGridRef = reactExports.useRef(null);
      reactExports.useEffect(() => {
        if (!useVirtualization && initialEventId) {
          const row2 = nonVirtualGridRef.current?.querySelector(
            `[id="${initialEventId}"]`
          );
          row2?.scrollIntoView({ block: "start" });
        }
      }, [initialEventId, useVirtualization]);
      const renderRow = reactExports.useCallback(
        (index, item2, style2) => {
          const paddingClass = index === 0 ? styles$t.first : void 0;
          const previousIndex = index - 1;
          const nextIndex = index + 1;
          const previous = previousIndex > 0 && previousIndex <= eventNodes.length ? eventNodes[previousIndex] : void 0;
          const next = nextIndex < eventNodes.length ? eventNodes[nextIndex] : void 0;
          const attached2 = item2.event.event === "tool" && (previous?.event.event === "tool" || previous?.event.event === "model");
          const attachedParent2 = item2.event.event === "model" && next?.event.event === "tool";
          const attachedClass = attached2 ? styles$t.attached : void 0;
          const attachedChildClass = attached2 ? styles$t.attachedChild : void 0;
          const attachedParentClass = attachedParent2 ? styles$t.attachedParent : void 0;
          const hasToolEvents = hasToolEventsAtCurrentDepth(index);
          const context = hasToolEvents ? contextWithToolEvents : contextWithoutToolEvents;
          return /* @__PURE__ */ jsxRuntimeExports.jsx(
            "div",
            {
              id: item2.id,
              className: clsx(styles$t.node, paddingClass, attachedClass),
              style: {
                ...style2,
                paddingLeft: `${item2.depth <= 1 ? item2.depth * 0.7 : (0.7 + item2.depth - 1) * 1}em`,
                paddingRight: `${item2.depth === 0 ? void 0 : ".7em"} `
              },
              children: /* @__PURE__ */ jsxRuntimeExports.jsx(
                RenderedEventNode,
                {
                  node: item2,
                  next,
                  className: clsx(attachedParentClass, attachedChildClass),
                  context
                }
              )
            },
            item2.id
          );
        },
        [
          eventNodes,
          hasToolEventsAtCurrentDepth,
          contextWithToolEvents,
          contextWithoutToolEvents
        ]
      );
      if (useVirtualization) {
        return /* @__PURE__ */ jsxRuntimeExports.jsx(
          LiveVirtualList,
          {
            listHandle,
            className: className2,
            id,
            scrollRef,
            data: eventNodes,
            initialTopMostItemIndex: initialEventIndex,
            offsetTop,
            renderRow,
            live: running
          }
        );
      } else {
        return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: nonVirtualGridRef, children: eventNodes.map((node2, index) => {
          const row2 = renderRow(index, node2, {
            scrollMarginTop: offsetTop
          });
          return row2;
        }) });
      }
    };
    const TranscriptVirtualList = reactExports.memo(
      (props) => {
        let {
          id,
          scrollRef,
          eventNodes,
          listHandle,
          running,
          initialEventId,
          offsetTop,
          className: className2
        } = props;
        return /* @__PURE__ */ jsxRuntimeExports.jsx(
          TranscriptVirtualListComponent,
          {
            id,
            listHandle,
            eventNodes,
            initialEventId,
            offsetTop,
            scrollRef,
            running,
            className: className2
          }
        );
      }
    );
    const RenderedEventNode = reactExports.memo(
      ({ node: node2, next, className: className2, context }) => {
        switch (node2.event.event) {
          case "sample_init":
            return /* @__PURE__ */ jsxRuntimeExports.jsx(
              SampleInitEventView,
              {
                eventNode: node2,
                className: className2
              }
            );
          case "sample_limit":
            return /* @__PURE__ */ jsxRuntimeExports.jsx(
              SampleLimitEventView,
              {
                eventNode: node2,
                className: className2
              }
            );
          case "info":
            return /* @__PURE__ */ jsxRuntimeExports.jsx(
              InfoEventView,
              {
                eventNode: node2,
                className: className2
              }
            );
          case "logger":
            return /* @__PURE__ */ jsxRuntimeExports.jsx(
              LoggerEventView,
              {
                eventNode: node2,
                className: className2
              }
            );
          case "model":
            return /* @__PURE__ */ jsxRuntimeExports.jsx(
              ModelEventView,
              {
                eventNode: node2,
                showToolCalls: next?.event.event !== "tool",
                className: className2,
                context
              }
            );
          case "score":
            return /* @__PURE__ */ jsxRuntimeExports.jsx(
              ScoreEventView,
              {
                eventNode: node2,
                className: className2
              }
            );
          case "score_edit":
            return /* @__PURE__ */ jsxRuntimeExports.jsx(
              ScoreEditEventView,
              {
                eventNode: node2,
                className: className2
              }
            );
          case "state":
            return /* @__PURE__ */ jsxRuntimeExports.jsx(
              StateEventView,
              {
                eventNode: node2,
                className: className2
              }
            );
          case "span_begin":
            return /* @__PURE__ */ jsxRuntimeExports.jsx(
              SpanEventView,
              {
                eventNode: node2,
                children: node2.children,
                className: className2
              }
            );
          case "step":
            return /* @__PURE__ */ jsxRuntimeExports.jsx(
              StepEventView,
              {
                eventNode: node2,
                children: node2.children,
                className: className2
              }
            );
          case "store":
            return /* @__PURE__ */ jsxRuntimeExports.jsx(
              StateEventView,
              {
                eventNode: node2,
                className: className2
              }
            );
          case "subtask":
            return /* @__PURE__ */ jsxRuntimeExports.jsx(
              SubtaskEventView,
              {
                eventNode: node2,
                className: className2,
                children: node2.children
              }
            );
          case "tool":
            return /* @__PURE__ */ jsxRuntimeExports.jsx(
              ToolEventView,
              {
                eventNode: node2,
                className: className2,
                children: node2.children
              }
            );
          case "input":
            return /* @__PURE__ */ jsxRuntimeExports.jsx(
              InputEventView,
              {
                eventNode: node2,
                className: className2
              }
            );
          case "error":
            return /* @__PURE__ */ jsxRuntimeExports.jsx(
              ErrorEventView,
              {
                eventNode: node2,
                className: className2
              }
            );
          case "approval":
            return /* @__PURE__ */ jsxRuntimeExports.jsx(
              ApprovalEventView,
              {
                eventNode: node2,
                className: className2
              }
            );
          case "sandbox":
            return /* @__PURE__ */ jsxRuntimeExports.jsx(
              SandboxEventView,
              {
                eventNode: node2,
                className: className2
              }
            );
          default:
            return null;
        }
      }
    );
    const transformTree = (roots) => {
      const treeNodeTransformers = transformers();
      const visitNode = (node2) => {
        let currentNodes = [node2];
        currentNodes = currentNodes.map((n) => {
          n.children = n.children.flatMap(visitNode);
          return n;
        });
        for (const transformer of treeNodeTransformers) {
          const nextNodes = [];
          for (const currentNode of currentNodes) {
            if (transformer.matches(currentNode)) {
              const result2 = transformer.process(currentNode);
              if (Array.isArray(result2)) {
                nextNodes.push(...result2);
              } else {
                nextNodes.push(result2);
              }
            } else {
              nextNodes.push(currentNode);
            }
          }
          currentNodes = nextNodes;
        }
        return currentNodes.length === 1 ? currentNodes[0] : currentNodes;
      };
      const processedRoots = roots.flatMap(visitNode);
      const flushedNodes = [];
      for (const transformer of treeNodeTransformers) {
        if (transformer.flush) {
          const flushResults = transformer.flush();
          if (flushResults && flushResults.length > 0) {
            flushedNodes.push(...flushResults);
          }
        }
      }
      return [...processedRoots, ...flushedNodes];
    };
    const transformers = () => {
      const treeNodeTransformers = [
        {
          name: "unwrap_tools",
          matches: (node2) => node2.event.event === SPAN_BEGIN && node2.event.type === TYPE_TOOL,
          process: (node2) => elevateChildNode(node2, TYPE_TOOL) || node2
        },
        {
          name: "unwrap_subtasks",
          matches: (node2) => node2.event.event === SPAN_BEGIN && node2.event.type === TYPE_SUBTASK,
          process: (node2) => elevateChildNode(node2, TYPE_SUBTASK) || node2
        },
        {
          name: "unwrap_agent_solver",
          matches: (node2) => node2.event.event === SPAN_BEGIN && node2.event["type"] === TYPE_SOLVER && node2.children.length === 2 && node2.children[0].event.event === SPAN_BEGIN && node2.children[0].event.type === TYPE_AGENT && node2.children[1].event.event === STATE,
          process: (node2) => skipFirstChildNode(node2)
        },
        {
          name: "unwrap_agent_solver w/store",
          matches: (node2) => node2.event.event === SPAN_BEGIN && node2.event["type"] === TYPE_SOLVER && node2.children.length === 3 && node2.children[0].event.event === SPAN_BEGIN && node2.children[0].event.type === TYPE_AGENT && node2.children[1].event.event === STATE && node2.children[2].event.event === STORE,
          process: (node2) => skipFirstChildNode(node2)
        },
        {
          name: "unwrap_handoff",
          matches: (node2) => {
            const isHandoffNode = node2.event.event === SPAN_BEGIN && node2.event["type"] === TYPE_HANDOFF;
            if (!isHandoffNode) {
              return false;
            }
            if (node2.children.length === 1) {
              return node2.children[0].event.event === TOOL && !!node2.children[0].event.agent;
            } else {
              return node2.children.length === 2 && node2.children[0].event.event === TOOL && node2.children[1].event.event === STORE && node2.children[0].children.length === 2 && node2.children[0].children[0].event.event === SPAN_BEGIN && node2.children[0].children[0].event.type === TYPE_AGENT;
            }
          },
          process: (node2) => skipThisNode(node2)
        },
        {
          name: "discard_solvers_span",
          matches: (Node2) => Node2.event.event === SPAN_BEGIN && Node2.event.type === TYPE_SOLVERS,
          process: (node2) => {
            const nodes = discardNode(node2);
            return nodes;
          }
        }
      ];
      return treeNodeTransformers;
    };
    const elevateChildNode = (node2, childEventType) => {
      const targetIndex = node2.children.findIndex(
        (child) => child.event.event === childEventType
      );
      if (targetIndex === -1) {
        return null;
      }
      const targetNode = { ...node2.children[targetIndex] };
      const remainingChildren = node2.children.filter((_, i2) => i2 !== targetIndex);
      targetNode.depth = node2.depth;
      targetNode.children = setDepth(remainingChildren, node2.depth + 1);
      return targetNode;
    };
    const skipFirstChildNode = (node2) => {
      const agentSpan = node2.children.splice(0, 1)[0];
      node2.children.unshift(...reduceDepth(agentSpan.children));
      return node2;
    };
    const skipThisNode = (node2) => {
      const newNode = { ...node2.children[0] };
      newNode.depth = node2.depth;
      newNode.children = reduceDepth(newNode.children, 2);
      return newNode;
    };
    const discardNode = (node2) => {
      const nodes = reduceDepth(node2.children, 1);
      return nodes;
    };
    const reduceDepth = (nodes, depth = 1) => {
      return nodes.map((node2) => {
        if (node2.children.length > 0) {
          node2.children = reduceDepth(node2.children, 1);
        }
        node2.depth = node2.depth - depth;
        return node2;
      });
    };
    const setDepth = (nodes, depth) => {
      return nodes.map((node2) => {
        if (node2.children.length > 0) {
          node2.children = setDepth(node2.children, depth + 1);
        }
        node2.depth = depth;
        return node2;
      });
    };
    function treeifyEvents(events, depth) {
      const useSpans = hasSpans(events);
      events = injectScorersSpan(events);
      const nodes = useSpans ? treeifyWithSpans(events, depth) : treeifyWithSteps(events, depth);
      return useSpans ? transformTree(nodes) : nodes;
    }
    const treeifyWithSpans = (events, depth) => {
      const { rootNodes, createNode } = createNodeFactory(depth);
      const spanNodes = /* @__PURE__ */ new Map();
      const processEvent = (event, parentOverride) => {
        if (event.event === SPAN_END) {
          return;
        }
        if (event.event === STEP && event.action !== ACTION_BEGIN) {
          return;
        }
        const resolvedParent = resolveParentForEvent(event, spanNodes);
        const parentNode = resolvedParent ?? null;
        const node2 = createNode(event, parentNode);
        if (event.event === SPAN_BEGIN) {
          const spanId = getEventSpanId(event);
          if (spanId !== null) {
            spanNodes.set(spanId, node2);
          }
        }
      };
      events.forEach((event) => processEvent(event));
      return rootNodes;
    };
    const treeifyWithSteps = (events, depth) => {
      const { rootNodes, createNode } = createNodeFactory(depth);
      const stack2 = [];
      const pushStack = (node2) => {
        stack2.push(node2);
      };
      const popStack = () => {
        if (stack2.length > 0) {
          stack2.pop();
        }
      };
      const processEvent = (event) => {
        const parent = stack2.length > 0 ? stack2[stack2.length - 1] : null;
        switch (event.event) {
          case STEP:
            if (event.action === ACTION_BEGIN) {
              const node2 = createNode(event, parent);
              pushStack(node2);
            } else {
              popStack();
            }
            break;
          case SPAN_BEGIN: {
            const node2 = createNode(event, parent);
            pushStack(node2);
            break;
          }
          case SPAN_END:
            popStack();
            break;
          default:
            createNode(event, parent);
            break;
        }
      };
      events.forEach(processEvent);
      return rootNodes;
    };
    const createNodeFactory = (depth) => {
      const rootNodes = [];
      const childCounts = /* @__PURE__ */ new Map();
      const pathByNode = /* @__PURE__ */ new Map();
      const createNode = (event, parent) => {
        const parentKey = parent ?? null;
        const nextIndex = childCounts.get(parentKey) ?? 0;
        childCounts.set(parentKey, nextIndex + 1);
        const parentPath = parent ? pathByNode.get(parent) : void 0;
        const path = parentPath !== void 0 ? `${parentPath}.${nextIndex}` : `${nextIndex}`;
        const eventId = event.uuid || `event_node_${path}`;
        const nodeDepth = parent ? parent.depth + 1 : depth;
        const node2 = new EventNode(eventId, event, nodeDepth);
        pathByNode.set(node2, path);
        if (parent) {
          parent.children.push(node2);
        } else {
          rootNodes.push(node2);
        }
        return node2;
      };
      return { rootNodes, createNode };
    };
    const resolveParentForEvent = (event, spanNodes) => {
      if (event.event === SPAN_BEGIN) {
        const parentId = event.parent_id;
        if (parentId) {
          return spanNodes.get(parentId) ?? null;
        }
        return null;
      }
      const spanId = getEventSpanId(event);
      if (spanId !== null) {
        return spanNodes.get(spanId) ?? null;
      }
      return null;
    };
    const getEventSpanId = (event) => {
      const spanId = event.span_id;
      return spanId ?? null;
    };
    const kBeginScorerId = "E617087FA405";
    const kEndScorerId = "C39922B09481";
    const kScorersSpanId = "C5A831026F2C";
    const injectScorersSpan = (events) => {
      const results = [];
      const collectedScorerEvents = [];
      let hasCollectedScorers = false;
      let collecting = null;
      const flushCollected = () => {
        if (collectedScorerEvents.length > 0) {
          const beginSpan = {
            name: "scorers",
            id: kBeginScorerId,
            span_id: kScorersSpanId,
            event: SPAN_BEGIN,
            type: TYPE_SCORERS,
            timestamp: collectedScorerEvents[0].timestamp,
            working_start: collectedScorerEvents[0].working_start,
            pending: false,
            parent_id: null,
            uuid: null,
            metadata: null
          };
          const scoreEvents = collectedScorerEvents.map((event) => {
            return {
              ...event,
              parent_id: event.event === "span_begin" ? event.parent_id || kScorersSpanId : null
            };
          });
          const endSpan = {
            id: kEndScorerId,
            span_id: kScorersSpanId,
            event: SPAN_END,
            pending: false,
            working_start: collectedScorerEvents[collectedScorerEvents.length - 1].working_start,
            timestamp: collectedScorerEvents[collectedScorerEvents.length - 1].timestamp,
            uuid: null,
            metadata: null
          };
          collectedScorerEvents.length = 0;
          hasCollectedScorers = true;
          return [beginSpan, ...scoreEvents, endSpan];
        }
        return [];
      };
      for (const event of events) {
        if (event.event === SPAN_BEGIN && event.type === TYPE_SCORERS) {
          return events;
        }
        if (event.event === SPAN_BEGIN && event.type === TYPE_SCORER && !hasCollectedScorers) {
          collecting = event.span_id;
        }
        if (collecting) {
          if (event.event === SPAN_END && event.span_id === collecting) {
            collecting = null;
            results.push(...flushCollected());
            results.push(event);
          } else {
            collectedScorerEvents.push(event);
          }
        } else {
          results.push(event);
        }
      }
      return results;
    };
    const useEventNodes = (events, running) => {
      const { eventTree, defaultCollapsedIds } = reactExports.useMemo(() => {
        const resolvedEvents = fixupEventStream(events, !running);
        const rawEventTree = treeifyEvents(resolvedEvents, 0);
        const filterEmpty = (eventNodes) => {
          return eventNodes.filter((node2) => {
            if (node2.children && node2.children.length > 0) {
              node2.children = filterEmpty(node2.children);
            }
            return node2.event.event !== "span_begin" && node2.event.event !== "step" || node2.children && node2.children.length > 0;
          });
        };
        const eventTree2 = filterEmpty(rawEventTree);
        const defaultCollapsedIds2 = {};
        const findCollapsibleEvents = (nodes) => {
          for (const node2 of nodes) {
            if (kCollapsibleEventTypes.includes(node2.event.event) && collapseFilters.some(
              (filter) => filter(
                node2.event
              )
            )) {
              defaultCollapsedIds2[node2.id] = true;
            }
            findCollapsibleEvents(node2.children);
          }
        };
        findCollapsibleEvents(eventTree2);
        return { eventTree: eventTree2, defaultCollapsedIds: defaultCollapsedIds2 };
      }, [events, running]);
      return { eventNodes: eventTree, defaultCollapsedIds };
    };
    const collapseFilters = [
      (event) => event.type === "solver" && event.name === "system_message",
      (event) => {
        if (event.event === "step" || event.event === "span_begin") {
          return event.name === kSandboxSignalName || event.name === "init" || event.name === "sample_init";
        }
        return false;
      },
      (event) => event.event === "tool" && !event.agent && !event.failed,
      (event) => event.event === "subtask"
    ];
    const TranscriptPanel = reactExports.memo((props) => {
      let { id, scrollRef, events, running, initialEventId, topOffset } = props;
      const filteredEventTypes = useStore(
        (state) => state.sample.eventFilter.filteredTypes
      );
      const sampleStatus = useStore((state) => state.sample.sampleStatus);
      const filteredEvents = reactExports.useMemo(() => {
        if (filteredEventTypes.length === 0) {
          return events;
        }
        return events.filter((event) => {
          return !filteredEventTypes.includes(event.event);
        });
      }, [events, filteredEventTypes]);
      const { eventNodes, defaultCollapsedIds } = useEventNodes(
        filteredEvents,
        running === true
      );
      const collapsedEvents = useStore((state) => state.sample.collapsedEvents);
      const setCollapsedEvents = useStore(
        (state) => state.sampleActions.setCollapsedEvents
      );
      const flattenedNodes = reactExports.useMemo(() => {
        return flatTree(
          eventNodes,
          (collapsedEvents ? collapsedEvents[kTranscriptCollapseScope] : void 0) || defaultCollapsedIds
        );
      }, [eventNodes, collapsedEvents, defaultCollapsedIds]);
      const collapsedMode = useStore((state) => state.sample.collapsedMode);
      reactExports.useEffect(() => {
        if (events.length <= 0 || collapsedMode !== null) {
          return;
        }
        if (!collapsedEvents && Object.keys(defaultCollapsedIds).length > 0) {
          setCollapsedEvents(kTranscriptCollapseScope, defaultCollapsedIds);
        }
      }, [
        defaultCollapsedIds,
        collapsedEvents,
        setCollapsedEvents,
        events.length,
        collapsedMode
      ]);
      const allNodesList = reactExports.useMemo(() => {
        return flatTree(eventNodes, null);
      }, [eventNodes]);
      reactExports.useEffect(() => {
        if (events.length <= 0 || collapsedMode === null) {
          return;
        }
        const collapseIds = {};
        const collapsed22 = collapsedMode === "collapsed";
        allNodesList.forEach((node2) => {
          if (node2.event.uuid && (collapsed22 && !hasSpans(node2.children.map((child) => child.event)) || !collapsed22)) {
            collapseIds[node2.event.uuid] = collapsedMode === "collapsed";
          }
        });
        setCollapsedEvents(kTranscriptCollapseScope, collapseIds);
      }, [collapsedMode, events, allNodesList, setCollapsedEvents]);
      const { logPath } = useLogRouteParams();
      const [collapsed2, setCollapsed] = useCollapsedState(
        `transcript-panel-${logPath || "na"}`,
        false
      );
      const listHandle = reactExports.useRef(null);
      reactExports.useEffect(() => {
        const handleKeyDown = (event) => {
          if (event.metaKey || event.ctrlKey) {
            if (event.key === "ArrowUp") {
              listHandle.current?.scrollToIndex({ index: 0, align: "center" });
              event.preventDefault();
            } else if (event.key === "ArrowDown") {
              listHandle.current?.scrollToIndex({
                index: Math.max(flattenedNodes.length - 5, 0),
                align: "center",
                behavior: "auto"
              });
              setTimeout(() => {
                listHandle.current?.scrollToIndex({
                  index: Math.max(flattenedNodes.length - 1, 0),
                  align: "end",
                  behavior: "auto"
                });
              }, 250);
            }
          }
        };
        const scrollElement = scrollRef.current;
        if (scrollElement) {
          scrollElement.addEventListener("keydown", handleKeyDown);
          if (!scrollElement.hasAttribute("tabIndex")) {
            scrollElement.setAttribute("tabIndex", "0");
          }
          return () => {
            scrollElement.removeEventListener("keydown", handleKeyDown);
          };
        }
      }, [scrollRef, flattenedNodes]);
      if (sampleStatus === "loading" && flattenedNodes.length === 0) {
        return void 0;
      }
      if (flattenedNodes.length === 0) {
        const isCompletedFiltered = flattenedNodes.length === 0 && events.length > 0;
        const message2 = isCompletedFiltered ? "The currently applied filter hides all events." : "No events to display.";
        return /* @__PURE__ */ jsxRuntimeExports.jsx(NoContentsPanel, { text: message2 });
      } else {
        return /* @__PURE__ */ jsxRuntimeExports.jsxs(
          "div",
          {
            className: clsx(
              styles$M.container,
              collapsed2 ? styles$M.collapsed : void 0
            ),
            children: [
              /* @__PURE__ */ jsxRuntimeExports.jsxs(
                StickyScroll,
                {
                  scrollRef,
                  className: styles$M.treeContainer,
                  offsetTop: topOffset,
                  children: [
                    /* @__PURE__ */ jsxRuntimeExports.jsx(
                      TranscriptOutline,
                      {
                        className: clsx(styles$M.outline),
                        eventNodes,
                        running,
                        defaultCollapsedIds,
                        scrollRef
                      }
                    ),
                    /* @__PURE__ */ jsxRuntimeExports.jsx(
                      "div",
                      {
                        className: styles$M.outlineToggle,
                        onClick: () => setCollapsed(!collapsed2),
                        children: /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: ApplicationIcons.sidebar })
                      }
                    )
                  ]
                }
              ),
              /* @__PURE__ */ jsxRuntimeExports.jsx(
                TranscriptVirtualList,
                {
                  id,
                  listHandle,
                  eventNodes: flattenedNodes,
                  scrollRef,
                  running,
                  initialEventId: initialEventId === void 0 ? null : initialEventId,
                  offsetTop: topOffset,
                  className: styles$M.listContainer
                }
              )
            ]
          }
        );
      }
    });
    const SampleDisplay = ({
      id,
      scrollRef,
      focusOnLoad
    }) => {
      const baseId = `sample-dialog`;
      const sampleData = useSampleData();
      const sample2 = reactExports.useMemo(() => {
        return sampleData.getSelectedSample();
      }, [sampleData]);
      const runningSampleData = sampleData.running;
      const evalSpec = useStore((state) => state.log.selectedLogDetails?.eval);
      const { setDocumentTitle } = useDocumentTitle();
      reactExports.useEffect(() => {
        setDocumentTitle({ evalSpec, sample: sample2 });
      }, [setDocumentTitle, sample2, evalSpec]);
      const selectedTab = useStore((state) => state.app.tabs.sample);
      const setSelectedTab = useStore((state) => state.appActions.setSampleTab);
      const { sampleTabId } = useParams();
      const effectiveSelectedTab = sampleTabId || selectedTab;
      const navigate = useNavigate();
      const tabsRef = reactExports.useRef(null);
      const [tabsHeight, setTabsHeight] = reactExports.useState(-1);
      reactExports.useEffect(() => {
        const updateHeight = () => {
          if (tabsRef.current) {
            const height = tabsRef.current.getBoundingClientRect().height;
            setTabsHeight(height);
          }
        };
        updateHeight();
        window.addEventListener("resize", updateHeight);
        return () => window.removeEventListener("resize", updateHeight);
      }, []);
      const selectedSampleSummary = useSelectedSampleSummary();
      const sampleEvents = sample2?.events || runningSampleData;
      const sampleMessages = reactExports.useMemo(() => {
        if (sample2?.messages) {
          return sample2.messages;
        } else if (runningSampleData) {
          return messagesFromEvents(runningSampleData);
        } else {
          return [];
        }
      }, [sample2?.messages, runningSampleData]);
      const {
        logPath: urlLogPath,
        id: urlSampleId,
        epoch: urlEpoch
      } = useLogOrSampleRouteParams();
      reactExports.useEffect(() => {
        setTimeout(() => {
          if (focusOnLoad) {
            scrollRef.current?.focus();
          }
        }, 10);
      }, [focusOnLoad, scrollRef]);
      const sampleUrlBuilder = useSampleUrlBuilder();
      const onSelectedTab = reactExports.useCallback(
        (e) => {
          const el2 = e.currentTarget;
          const id2 = el2.id;
          setSelectedTab(id2);
          if (id2 !== sampleTabId && urlLogPath) {
            const url = sampleUrlBuilder(urlLogPath, urlSampleId, urlEpoch, id2);
            navigate(url);
          }
        },
        [
          setSelectedTab,
          sampleTabId,
          urlLogPath,
          sampleUrlBuilder,
          urlSampleId,
          urlEpoch,
          navigate
        ]
      );
      const sampleMetadatas = metadataViewsForSample(
        `${baseId}-${id}`,
        scrollRef,
        sample2
      );
      const tabsetId = `task-sample-details-tab-${id}`;
      const targetId = `${tabsetId}-content`;
      const isShowing = useStore((state) => state.app.dialogs.transcriptFilter);
      const setShowing = useStore(
        (state) => state.appActions.setShowingTranscriptFilterDialog
      );
      const displayMode = useStore((state) => state.app.displayMode);
      const setDisplayMode = useStore((state) => state.appActions.setDisplayMode);
      const filterRef = reactExports.useRef(null);
      const optionsRef = reactExports.useRef(null);
      const handlePrintClick = reactExports.useCallback(() => {
        printSample(id, targetId);
      }, [id, targetId]);
      const toggleFilter = reactExports.useCallback(() => {
        setShowing(!isShowing);
      }, [setShowing, isShowing]);
      const toggleDisplayMode = reactExports.useCallback(() => {
        setDisplayMode(displayMode === "rendered" ? "raw" : "rendered");
      }, [displayMode, setDisplayMode]);
      const collapsedMode = useStore((state) => state.sample.collapsedMode);
      const setCollapsedMode = useStore(
        (state) => state.sampleActions.setCollapsedMode
      );
      const isCollapsed = (mode) => {
        return mode === "collapsed";
      };
      const toggleCollapsedMode = reactExports.useCallback(() => {
        setCollapsedMode(isCollapsed(collapsedMode) ? "expanded" : "collapsed");
      }, [collapsedMode, setCollapsedMode]);
      const { isDebugFilter, isDefaultFilter } = useTranscriptFilter();
      const tools2 = [];
      const [icon2, setIcon] = reactExports.useState(ApplicationIcons.copy);
      tools2.push(
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          ToolDropdownButton,
          {
            label: "Copy",
            icon: icon2,
            items: {
              UUID: () => {
                if (sample2?.uuid) {
                  navigator.clipboard.writeText(sample2.uuid);
                  setIcon(ApplicationIcons.confirm);
                  setTimeout(() => {
                    setIcon(ApplicationIcons.copy);
                  }, 1250);
                }
              },
              Transcript: () => {
                if (sample2?.messages) {
                  navigator.clipboard.writeText(messagesToStr(sample2.messages));
                  setIcon(ApplicationIcons.confirm);
                  setTimeout(() => {
                    setIcon(ApplicationIcons.copy);
                  }, 1250);
                }
              }
            }
          },
          "sample-copy"
        )
      );
      if (selectedTab === kSampleTranscriptTabId) {
        const label2 = isDebugFilter ? "Debug" : isDefaultFilter ? "Default" : "Custom";
        tools2.push(
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            ToolButton,
            {
              label: `Events: ${label2}`,
              icon: ApplicationIcons.filter,
              onClick: toggleFilter,
              ref: filterRef
            },
            "sample-filter-transcript"
          )
        );
        tools2.push(
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            ToolButton,
            {
              label: isCollapsed(collapsedMode) ? "Expand" : "Collapse",
              icon: isCollapsed(collapsedMode) ? ApplicationIcons.expand.all : ApplicationIcons.collapse.all,
              onClick: toggleCollapsedMode
            },
            "sample-collapse-transcript"
          )
        );
      }
      tools2.push(
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          ToolButton,
          {
            label: "Raw",
            icon: ApplicationIcons.display,
            onClick: toggleDisplayMode,
            ref: optionsRef,
            latched: displayMode === "raw"
          },
          "options-button"
        )
      );
      if (!isVscode()) {
        tools2.push(
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            ToolButton,
            {
              label: "Print",
              icon: ApplicationIcons.copy,
              onClick: handlePrintClick
            },
            "sample-print-tool"
          )
        );
      }
      const running = reactExports.useMemo(() => {
        return isRunning(selectedSampleSummary, runningSampleData);
      }, [selectedSampleSummary, runningSampleData]);
      const sampleDetailNavigation = useSampleDetailNavigation();
      const displaySample = sample2 || selectedSampleSummary;
      return /* @__PURE__ */ jsxRuntimeExports.jsxs(reactExports.Fragment, { children: [
        displaySample ? /* @__PURE__ */ jsxRuntimeExports.jsx(SampleSummaryView, { parent_id: id, sample: displaySample }) : void 0,
        /* @__PURE__ */ jsxRuntimeExports.jsxs(
          TabSet,
          {
            id: tabsetId,
            tabsRef,
            className: clsx(styles$U.tabControls),
            tabControlsClassName: clsx("text-size-base"),
            tabPanelsClassName: clsx(styles$U.tabPanel),
            tools: tools2,
            children: [
              /* @__PURE__ */ jsxRuntimeExports.jsxs(
                TabPanel,
                {
                  id: kSampleTranscriptTabId,
                  className: clsx("sample-tab", styles$U.transcriptContainer),
                  title: "Transcript",
                  onSelected: onSelectedTab,
                  selected: effectiveSelectedTab === kSampleTranscriptTabId || effectiveSelectedTab === void 0,
                  scrollable: false,
                  children: [
                    /* @__PURE__ */ jsxRuntimeExports.jsx(
                      TranscriptFilterPopover,
                      {
                        showing: isShowing,
                        setShowing,
                        positionEl: filterRef.current
                      }
                    ),
                    /* @__PURE__ */ jsxRuntimeExports.jsx(
                      TranscriptPanel,
                      {
                        id: `${baseId}-transcript-display-${id}`,
                        events: sampleEvents || [],
                        initialEventId: sampleDetailNavigation.event,
                        topOffset: tabsHeight,
                        running,
                        scrollRef
                      },
                      `${baseId}-transcript-display-${id}`
                    )
                  ]
                },
                kSampleTranscriptTabId
              ),
              /* @__PURE__ */ jsxRuntimeExports.jsx(
                TabPanel,
                {
                  id: kSampleMessagesTabId,
                  className: clsx("sample-tab", styles$U.fullWidth, styles$U.chat),
                  title: "Messages",
                  onSelected: onSelectedTab,
                  selected: effectiveSelectedTab === kSampleMessagesTabId,
                  scrollable: false,
                  children: /* @__PURE__ */ jsxRuntimeExports.jsx(
                    ChatViewVirtualList,
                    {
                      id: `${baseId}-chat-${id}`,
                      messages: sampleMessages,
                      initialMessageId: sampleDetailNavigation.message,
                      topOffset: tabsHeight,
                      indented: true,
                      scrollRef,
                      toolCallStyle: "complete",
                      running
                    },
                    `${baseId}-chat-${id}`
                  )
                },
                kSampleMessagesTabId
              ),
              /* @__PURE__ */ jsxRuntimeExports.jsx(
                TabPanel,
                {
                  id: kSampleScoringTabId,
                  className: "sample-tab",
                  title: "Scoring",
                  onSelected: onSelectedTab,
                  selected: effectiveSelectedTab === kSampleScoringTabId,
                  children: /* @__PURE__ */ jsxRuntimeExports.jsx(
                    SampleScoresView,
                    {
                      sample: sample2,
                      className: styles$U.padded,
                      scrollRef
                    }
                  )
                },
                kSampleScoringTabId
              ),
              /* @__PURE__ */ jsxRuntimeExports.jsx(
                TabPanel,
                {
                  id: kSampleMetdataTabId,
                  className: clsx("sample-tab"),
                  title: "Metadata",
                  onSelected: onSelectedTab,
                  selected: effectiveSelectedTab === kSampleMetdataTabId,
                  children: !sample2 || sampleMetadatas.length > 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$U.padded, styles$U.fullWidth), children: sampleMetadatas }) : /* @__PURE__ */ jsxRuntimeExports.jsx(NoContentsPanel, { text: "No metadata" })
                }
              ),
              sample2?.error || sample2?.error_retries && sample2?.error_retries.length > 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx(
                TabPanel,
                {
                  id: kSampleErrorTabId,
                  className: "sample-tab",
                  title: "Errors",
                  onSelected: onSelectedTab,
                  selected: effectiveSelectedTab === kSampleErrorTabId,
                  children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$U.error), children: [
                    sample2?.error ? /* @__PURE__ */ jsxRuntimeExports.jsxs(Card, { children: [
                      /* @__PURE__ */ jsxRuntimeExports.jsx(CardHeader, { label: `Sample Error` }),
                      /* @__PURE__ */ jsxRuntimeExports.jsx(CardBody, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
                        ANSIDisplay,
                        {
                          output: sample2.error.traceback_ansi,
                          className: clsx("text-size-small", styles$U.ansi),
                          style: {
                            fontSize: "clamp(0.3rem, 1.1vw, 0.8rem)",
                            margin: "0.5em 0"
                          }
                        }
                      ) })
                    ] }, `sample-error}`) : void 0,
                    sample2.error_retries?.map((retry, index) => {
                      return /* @__PURE__ */ jsxRuntimeExports.jsxs(Card, { children: [
                        /* @__PURE__ */ jsxRuntimeExports.jsx(CardHeader, { label: `Attempt ${index + 1}` }),
                        /* @__PURE__ */ jsxRuntimeExports.jsx(CardBody, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
                          ANSIDisplay,
                          {
                            output: retry.traceback_ansi,
                            className: clsx("text-size-small", styles$U.ansi),
                            style: {
                              fontSize: "clamp(0.3rem, 1.1vw, 0.8rem)",
                              margin: "0.5em 0"
                            }
                          }
                        ) })
                      ] }, `sample-retry-error-${index}`);
                    })
                  ] })
                }
              ) : null,
              /* @__PURE__ */ jsxRuntimeExports.jsx(
                TabPanel,
                {
                  id: kSampleJsonTabId,
                  className: "sample-tab",
                  title: "JSON",
                  onSelected: onSelectedTab,
                  selected: effectiveSelectedTab === kSampleJsonTabId,
                  children: !sample2 ? /* @__PURE__ */ jsxRuntimeExports.jsx(NoContentsPanel, { text: "JSON not available" }) : estimateSize(sample2.events) > 25 * 1024 * 1024 ? /* @__PURE__ */ jsxRuntimeExports.jsx(NoContentsPanel, { text: "JSON too large to display" }) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$U.padded, styles$U.fullWidth), children: /* @__PURE__ */ jsxRuntimeExports.jsx(
                    JSONPanel,
                    {
                      data: sample2,
                      simple: true,
                      className: clsx("text-size-small")
                    }
                  ) })
                }
              )
            ]
          }
        )
      ] });
    };
    const metadataViewsForSample = (id, scrollRef, sample2) => {
      if (!sample2) {
        return [];
      }
      const sampleMetadatas = [];
      if (sample2.model_usage && Object.keys(sample2.model_usage).length > 0) {
        sampleMetadatas.push(
          /* @__PURE__ */ jsxRuntimeExports.jsxs(Card, { children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx(CardHeader, { label: "Usage" }),
            /* @__PURE__ */ jsxRuntimeExports.jsx(CardBody, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
              ModelTokenTable,
              {
                model_usage: sample2.model_usage,
                className: clsx(styles$U.noTop)
              }
            ) })
          ] }, `sample-usage-${id}`)
        );
      }
      if (sample2.total_time !== void 0 && sample2.total_time !== null && sample2.working_time !== void 0 && sample2.working_time !== null) {
        sampleMetadatas.push(
          /* @__PURE__ */ jsxRuntimeExports.jsxs(Card, { children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx(CardHeader, { label: "Time" }),
            /* @__PURE__ */ jsxRuntimeExports.jsx(CardBody, { padded: false, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
              RecordTree,
              {
                id: `task-sample-time-${id}`,
                record: {
                  Working: formatTime$1(sample2.working_time),
                  Total: formatTime$1(sample2.total_time)
                },
                className: clsx("tab-pane", styles$U.noTop),
                scrollRef
              }
            ) })
          ] }, `sample-time-${id}`)
        );
      }
      if (Object.keys(sample2?.metadata).length > 0) {
        sampleMetadatas.push(
          /* @__PURE__ */ jsxRuntimeExports.jsxs(Card, { children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx(CardHeader, { label: "Metadata" }),
            /* @__PURE__ */ jsxRuntimeExports.jsx(CardBody, { padded: false, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
              RecordTree,
              {
                id: `task-sample-metadata-${id}`,
                record: sample2?.metadata,
                className: clsx("tab-pane", styles$U.noTop),
                scrollRef
              }
            ) })
          ] }, `sample-metadata-${id}`)
        );
      }
      if (Object.keys(sample2?.store).length > 0) {
        sampleMetadatas.push(
          /* @__PURE__ */ jsxRuntimeExports.jsxs(Card, { children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx(CardHeader, { label: "Store" }),
            /* @__PURE__ */ jsxRuntimeExports.jsx(CardBody, { padded: false, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
              RecordTree,
              {
                id: `task-sample-store-${id}`,
                record: sample2?.store,
                className: clsx("tab-pane", styles$U.noTop),
                scrollRef,
                processStore: true
              }
            ) })
          ] }, `sample-store-${id}`)
        );
      }
      return sampleMetadatas;
    };
    const printSample = (id, targetId) => {
      const targetTabEl = document.querySelector(
        `#${escapeSelector(targetId)} .sample-tab.tab-pane.show.active`
      );
      if (targetTabEl) {
        const targetEl = targetTabEl.firstElementChild;
        if (targetEl) {
          const headingId = `sample-heading-${id}`;
          const headingEl = document.getElementById(headingId);
          const headingHtml = printHeadingHtml();
          const css2 = `
      html { font-size: 9pt }
      /* Allow content to break anywhere without any forced page breaks */
      * {
        break-inside: auto;  /* Let elements break anywhere */
        page-break-inside: auto;  /* Legacy support */
        break-before: auto;
        page-break-before: auto;
        break-after: auto;
        page-break-after: auto;
      }
      /* Specifically disable all page breaks for divs */
      div {
        break-inside: auto;
        page-break-inside: auto;
      }
      body > .transcript-step {
        break-inside: avoid;
      }
      body{
        -webkit-print-color-adjust:exact !important;
        print-color-adjust:exact !important;
      }
      /* Allow preformatted text and code blocks to break across pages */
      pre, code {
          white-space: pre-wrap; /* Wrap long lines instead of keeping them on one line */
          overflow-wrap: break-word; /* Ensure long words are broken to fit within the page */
          break-inside: auto; /* Allow page breaks inside the element */
          page-break-inside: auto; /* Older equivalent */
      }

      /* Additional control for long lines within code/preformatted blocks */
      pre {
          word-wrap: break-word; /* Break long words if needed */
      }    
          
      `;
          printHtml(
            [headingHtml, headingEl?.outerHTML, targetEl.innerHTML].join("\n"),
            css2
          );
        }
      }
    };
    const isRunning = (sampleSummary, runningSampleData) => {
      if (sampleSummary && sampleSummary.completed === false) {
        return true;
      }
      if (!sampleSummary && (!runningSampleData || runningSampleData.length === 0)) {
        return true;
      }
      if (runningSampleData && runningSampleData.length > 0) {
        return true;
      }
      return false;
    };
    function useSampleLoader() {
      const sampleData = useSampleData();
      const loadSample = useStore((state) => state.sampleActions.loadSample);
      const logSelection = useLogSelection();
      const sampleId = logSelection.sample?.id;
      const sampleEpoch = logSelection.sample?.epoch;
      const sampleCompleted = logSelection.sample?.completed;
      const currentSampleCompleted = sampleCompleted !== void 0 ? sampleCompleted : true;
      const prevCompleted = usePrevious(currentSampleCompleted);
      const prevLogFile = usePrevious(logSelection.logFile);
      const prevSampleNeedsReload = usePrevious(
        sampleData.sampleNeedsReload
      );
      reactExports.useEffect(() => {
        if (logSelection.logFile && sampleId !== void 0 && sampleEpoch !== void 0) {
          const isCurrentSampleLoaded = sampleData.selectedSampleIdentifier?.id === sampleId && sampleData.selectedSampleIdentifier?.epoch === sampleEpoch;
          const isLoading = sampleData.status === "loading" || sampleData.status === "streaming";
          const logFileChanged = prevLogFile !== void 0 && prevLogFile !== logSelection.logFile;
          const completedChanged = prevCompleted !== void 0 && currentSampleCompleted !== prevCompleted;
          const needsReloadChanged = prevSampleNeedsReload !== void 0 && prevSampleNeedsReload !== sampleData.sampleNeedsReload;
          const shouldLoad = !isCurrentSampleLoaded && !isLoading || logFileChanged || completedChanged || needsReloadChanged;
          if (shouldLoad) {
            loadSample(
              logSelection.logFile,
              sampleId,
              sampleEpoch,
              sampleCompleted
            );
          }
        }
      }, [
        logSelection.logFile,
        sampleId,
        sampleEpoch,
        sampleCompleted,
        currentSampleCompleted,
        sampleData.selectedSampleIdentifier,
        sampleData.status,
        sampleData.sampleNeedsReload,
        prevLogFile,
        prevCompleted,
        prevSampleNeedsReload,
        loadSample
      ]);
    }
    function useSamplePolling() {
      const sampleData = useSampleData();
      const pollSample = useStore((state) => state.sampleActions.pollSample);
      const logSelection = useLogSelection();
      const sampleId = logSelection.sample?.id;
      const sampleEpoch = logSelection.sample?.epoch;
      reactExports.useEffect(() => {
        if (sampleData.running && logSelection.logFile && sampleId !== void 0 && sampleEpoch !== void 0) {
          pollSample(logSelection.logFile, sampleId, sampleEpoch);
        }
      }, [
        logSelection.logFile,
        sampleId,
        sampleEpoch,
        pollSample,
        sampleData.running
      ]);
    }
    const container$8 = "_container_ly812_1";
    const scroller = "_scroller_ly812_7";
    const styles$s = {
      container: container$8,
      scroller
    };
    const InlineSampleDisplay = ({
      showActivity,
      className: className2
    }) => {
      const sampleData = useSampleData();
      useSampleLoader();
      useSamplePolling();
      const scrollRef = reactExports.useRef(null);
      return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(className2, styles$s.container), children: [
        showActivity && /* @__PURE__ */ jsxRuntimeExports.jsx(
          ActivityBar,
          {
            animating: sampleData.status === "loading" || sampleData.status === "streaming"
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$s.scroller), ref: scrollRef, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$s.body, children: sampleData.error ? /* @__PURE__ */ jsxRuntimeExports.jsx(
          ErrorPanel,
          {
            title: "Unable to load sample",
            error: sampleData.error
          }
        ) : /* @__PURE__ */ jsxRuntimeExports.jsx(SampleDisplay, { id: "inline-sample-display", scrollRef }) }) })
      ] });
    };
    const title = "_title_1hch3_1";
    const detail$1 = "_detail_1hch3_5";
    const detailText = "_detailText_1hch3_13";
    const close = "_close_1hch3_18";
    const modal$1 = "_modal_1hch3_26";
    const hidden = "_hidden_1hch3_31";
    const modalBody$1 = "_modalBody_1hch3_35";
    const content$5 = "_content_1hch3_41";
    const header$2 = "_header_1hch3_45";
    const titleTool = "_titleTool_1hch3_51";
    const styles$r = {
      title,
      detail: detail$1,
      detailText,
      close,
      modal: modal$1,
      hidden,
      modalBody: modalBody$1,
      content: content$5,
      header: header$2,
      titleTool
    };
    const LargeModal = ({
      id,
      title: title2,
      detail: detail2,
      detailTools,
      children: children2,
      footer: footer2,
      onkeyup,
      visible: visible2,
      onHide,
      showProgress,
      scrollRef,
      classNames
    }) => {
      const modalFooter = footer2 ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "modal-footer", children: footer2 }) : "";
      const modalRef = reactExports.useRef(null);
      scrollRef = scrollRef || modalRef;
      const dialogRef = reactExports.useRef(null);
      reactExports.useEffect(() => {
        if (visible2 && dialogRef.current) {
          dialogRef.current.focus();
        }
      }, [visible2]);
      return /* @__PURE__ */ jsxRuntimeExports.jsx(
        "div",
        {
          id,
          className: clsx(
            "modal",
            styles$r.modal,
            !visible2 ? styles$r.hidden : void 0
          ),
          role: "dialog",
          onKeyUp: onkeyup,
          tabIndex: visible2 ? 0 : void 0,
          ref: dialogRef,
          children: /* @__PURE__ */ jsxRuntimeExports.jsx(
            "div",
            {
              className: clsx(
                "modal-dialog",
                "modal-dialog-scrollable",
                styles$r.modalBody
              ),
              role: "document",
              children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx("modal-content", styles$r.content), children: [
                /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx("modal-header", styles$r.header), children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsx(
                    "div",
                    {
                      className: clsx("modal-title", "text-size-smaller", styles$r.title),
                      children: title2 || ""
                    }
                  ),
                  detail2 ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$r.detail, children: [
                    detailTools?.left ? detailTools.left.map((tool2, idx) => {
                      return /* @__PURE__ */ jsxRuntimeExports.jsx(TitleTool, { ...tool2 }, `tool-left-${idx}`);
                    }) : "",
                    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx("text-size-smaller", styles$r.detailText), children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: detail2 }) }),
                    detailTools?.right ? detailTools.right.map((tool2, idx) => {
                      return /* @__PURE__ */ jsxRuntimeExports.jsx(TitleTool, { ...tool2 }, `tool-right-${idx}`);
                    }) : ""
                  ] }) : void 0,
                  /* @__PURE__ */ jsxRuntimeExports.jsx(
                    "button",
                    {
                      type: "button",
                      className: clsx(
                        "btn",
                        "btn-close-large-dialog",
                        "text-size-larger",
                        styles$r.close
                      ),
                      onClick: onHide,
                      "aria-label": "Close",
                      children: /* @__PURE__ */ jsxRuntimeExports.jsx(HtmlEntity, { html: "&times;" })
                    }
                  )
                ] }),
                /* @__PURE__ */ jsxRuntimeExports.jsx(ActivityBar, { animating: showProgress }),
                /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx("modal-body", classNames?.body), ref: scrollRef, children: children2 }),
                modalFooter
              ] })
            }
          )
        }
      );
    };
    const HtmlEntity = ({ html: html2 }) => /* @__PURE__ */ jsxRuntimeExports.jsx("span", { dangerouslySetInnerHTML: { __html: html2 } });
    const TitleTool = ({ label: label2, icon: icon2, enabled, onClick }) => {
      return /* @__PURE__ */ jsxRuntimeExports.jsx(
        "button",
        {
          type: "button",
          className: clsx(
            "btn",
            "btn-outline",
            "text-size-small",
            styles$r.titleTool
          ),
          "aria-label": label2,
          onClick,
          disabled: !enabled,
          children: /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: icon2 })
        }
      );
    };
    const modalBody = "_modalBody_ozq2k_1";
    const styles$q = {
      modalBody
    };
    const SampleDialog = ({
      id,
      title: title2,
      showingSampleDialog
    }) => {
      const scrollRef = reactExports.useRef(null);
      useStatefulScrollPosition(scrollRef, "sample-dialog");
      const sampleData = useSampleData();
      useSampleLoader();
      useSamplePolling();
      const sampleNavigation = useSampleNavigation();
      const tools2 = reactExports.useMemo(() => {
        const nextTool = {
          label: "Next Sample",
          icon: ApplicationIcons.next,
          onClick: sampleNavigation.nextSample,
          enabled: sampleNavigation.nextEnabled
        };
        const prevTool = {
          label: "Previous Sample",
          icon: ApplicationIcons.previous,
          onClick: sampleNavigation.previousSample,
          enabled: sampleNavigation.previousEnabled
        };
        return {
          left: [prevTool],
          right: [nextTool]
        };
      }, [
        sampleNavigation.nextSample,
        sampleNavigation.previousSample,
        sampleNavigation.nextEnabled,
        sampleNavigation.previousEnabled
      ]);
      const handleKeyUp = reactExports.useCallback(
        (e) => {
          switch (e.key) {
            case "ArrowRight":
              sampleNavigation.nextSample();
              break;
            case "ArrowLeft":
              sampleNavigation.previousSample();
              break;
            case "Escape":
              sampleNavigation.clearSampleUrl();
              break;
          }
        },
        [sampleNavigation]
      );
      const onHide = reactExports.useCallback(() => {
        sampleNavigation.clearSampleUrl();
      }, [sampleNavigation]);
      return /* @__PURE__ */ jsxRuntimeExports.jsx(
        LargeModal,
        {
          id,
          detail: title2,
          detailTools: tools2,
          onkeyup: handleKeyUp,
          visible: showingSampleDialog,
          onHide,
          classNames: {
            body: styles$q.modalBody
          },
          showProgress: sampleData.status === "loading" || sampleData.status === "streaming",
          scrollRef,
          children: sampleData.error ? /* @__PURE__ */ jsxRuntimeExports.jsx(ErrorPanel, { title: "Sample Error", error: sampleData.error }) : /* @__PURE__ */ jsxRuntimeExports.jsx(SampleDisplay, { id, scrollRef, focusOnLoad: true })
        }
      );
    };
    const container$7 = "_container_15b4r_1";
    const label$5 = "_label_15b4r_5";
    const styles$p = {
      container: container$7,
      label: label$5
    };
    const EpochFilter = ({
      epochs,
      epoch,
      setEpoch
    }) => {
      const options2 = ["all"];
      for (let i2 = 1; i2 <= epochs; i2++) {
        options2.push(i2 + "");
      }
      const handleEpochChange = (e) => {
        const sel = e.target;
        setEpoch(sel.value);
      };
      return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$p.container, children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          "span",
          {
            className: clsx(
              "epoch-filter-label",
              "text-size-smaller",
              "text-style-label",
              "text-style-secondary",
              styles$p.label
            ),
            children: "Epochs:"
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          "select",
          {
            className: clsx("form-select", "form-select-sm", "text-size-smaller"),
            "aria-label": ".epoch-filter-label",
            value: epoch,
            onChange: handleEpochChange,
            children: options2.map((option) => {
              return /* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: option, children: option });
            })
          }
        )
      ] });
    };
    let rangeFrom = [], rangeTo = [];
    (() => {
      let numbers2 = "lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map((s) => s ? parseInt(s, 36) : 1);
      for (let i2 = 0, n = 0; i2 < numbers2.length; i2++)
        (i2 % 2 ? rangeTo : rangeFrom).push(n = n + numbers2[i2]);
    })();
    function isExtendingChar(code2) {
      if (code2 < 768) return false;
      for (let from = 0, to2 = rangeFrom.length; ; ) {
        let mid2 = from + to2 >> 1;
        if (code2 < rangeFrom[mid2]) to2 = mid2;
        else if (code2 >= rangeTo[mid2]) from = mid2 + 1;
        else return true;
        if (from == to2) return false;
      }
    }
    function isRegionalIndicator(code2) {
      return code2 >= 127462 && code2 <= 127487;
    }
    const ZWJ = 8205;
    function findClusterBreak$1(str2, pos2, forward = true, includeExtending = true) {
      return (forward ? nextClusterBreak : prevClusterBreak)(str2, pos2, includeExtending);
    }
    function nextClusterBreak(str2, pos2, includeExtending) {
      if (pos2 == str2.length) return pos2;
      if (pos2 && surrogateLow$1(str2.charCodeAt(pos2)) && surrogateHigh$1(str2.charCodeAt(pos2 - 1))) pos2--;
      let prev = codePointAt$1(str2, pos2);
      pos2 += codePointSize$1(prev);
      while (pos2 < str2.length) {
        let next = codePointAt$1(str2, pos2);
        if (prev == ZWJ || next == ZWJ || includeExtending && isExtendingChar(next)) {
          pos2 += codePointSize$1(next);
          prev = next;
        } else if (isRegionalIndicator(next)) {
          let countBefore = 0, i2 = pos2 - 2;
          while (i2 >= 0 && isRegionalIndicator(codePointAt$1(str2, i2))) {
            countBefore++;
            i2 -= 2;
          }
          if (countBefore % 2 == 0) break;
          else pos2 += 2;
        } else {
          break;
        }
      }
      return pos2;
    }
    function prevClusterBreak(str2, pos2, includeExtending) {
      while (pos2 > 0) {
        let found = nextClusterBreak(str2, pos2 - 2, includeExtending);
        if (found < pos2) return found;
        pos2--;
      }
      return 0;
    }
    function codePointAt$1(str2, pos2) {
      let code0 = str2.charCodeAt(pos2);
      if (!surrogateHigh$1(code0) || pos2 + 1 == str2.length) return code0;
      let code1 = str2.charCodeAt(pos2 + 1);
      if (!surrogateLow$1(code1)) return code0;
      return (code0 - 55296 << 10) + (code1 - 56320) + 65536;
    }
    function surrogateLow$1(ch3) {
      return ch3 >= 56320 && ch3 < 57344;
    }
    function surrogateHigh$1(ch3) {
      return ch3 >= 55296 && ch3 < 56320;
    }
    function codePointSize$1(code2) {
      return code2 < 65536 ? 1 : 2;
    }
    class Text {
      /**
      Get the line description around the given position.
      */
      lineAt(pos2) {
        if (pos2 < 0 || pos2 > this.length)
          throw new RangeError(`Invalid position ${pos2} in document of length ${this.length}`);
        return this.lineInner(pos2, false, 1, 0);
      }
      /**
      Get the description for the given (1-based) line number.
      */
      line(n) {
        if (n < 1 || n > this.lines)
          throw new RangeError(`Invalid line number ${n} in ${this.lines}-line document`);
        return this.lineInner(n, true, 1, 0);
      }
      /**
      Replace a range of the text with the given content.
      */
      replace(from, to2, text2) {
        [from, to2] = clip(this, from, to2);
        let parts = [];
        this.decompose(
          0,
          from,
          parts,
          2
          /* Open.To */
        );
        if (text2.length)
          text2.decompose(
            0,
            text2.length,
            parts,
            1 | 2
            /* Open.To */
          );
        this.decompose(
          to2,
          this.length,
          parts,
          1
          /* Open.From */
        );
        return TextNode.from(parts, this.length - (to2 - from) + text2.length);
      }
      /**
      Append another document to this one.
      */
      append(other) {
        return this.replace(this.length, this.length, other);
      }
      /**
      Retrieve the text between the given points.
      */
      slice(from, to2 = this.length) {
        [from, to2] = clip(this, from, to2);
        let parts = [];
        this.decompose(from, to2, parts, 0);
        return TextNode.from(parts, to2 - from);
      }
      /**
      Test whether this text is equal to another instance.
      */
      eq(other) {
        if (other == this)
          return true;
        if (other.length != this.length || other.lines != this.lines)
          return false;
        let start2 = this.scanIdentical(other, 1), end2 = this.length - this.scanIdentical(other, -1);
        let a = new RawTextCursor(this), b = new RawTextCursor(other);
        for (let skip = start2, pos2 = start2; ; ) {
          a.next(skip);
          b.next(skip);
          skip = 0;
          if (a.lineBreak != b.lineBreak || a.done != b.done || a.value != b.value)
            return false;
          pos2 += a.value.length;
          if (a.done || pos2 >= end2)
            return true;
        }
      }
      /**
      Iterate over the text. When `dir` is `-1`, iteration happens
      from end to start. This will return lines and the breaks between
      them as separate strings.
      */
      iter(dir = 1) {
        return new RawTextCursor(this, dir);
      }
      /**
      Iterate over a range of the text. When `from` > `to`, the
      iterator will run in reverse.
      */
      iterRange(from, to2 = this.length) {
        return new PartialTextCursor(this, from, to2);
      }
      /**
      Return a cursor that iterates over the given range of lines,
      _without_ returning the line breaks between, and yielding empty
      strings for empty lines.
      
      When `from` and `to` are given, they should be 1-based line numbers.
      */
      iterLines(from, to2) {
        let inner2;
        if (from == null) {
          inner2 = this.iter();
        } else {
          if (to2 == null)
            to2 = this.lines + 1;
          let start2 = this.line(from).from;
          inner2 = this.iterRange(start2, Math.max(start2, to2 == this.lines + 1 ? this.length : to2 <= 1 ? 0 : this.line(to2 - 1).to));
        }
        return new LineCursor(inner2);
      }
      /**
      Return the document as a string, using newline characters to
      separate lines.
      */
      toString() {
        return this.sliceString(0);
      }
      /**
      Convert the document to an array of lines (which can be
      deserialized again via [`Text.of`](https://codemirror.net/6/docs/ref/#state.Text^of)).
      */
      toJSON() {
        let lines = [];
        this.flatten(lines);
        return lines;
      }
      /**
      @internal
      */
      constructor() {
      }
      /**
      Create a `Text` instance for the given array of lines.
      */
      static of(text2) {
        if (text2.length == 0)
          throw new RangeError("A document must have at least one line");
        if (text2.length == 1 && !text2[0])
          return Text.empty;
        return text2.length <= 32 ? new TextLeaf(text2) : TextNode.from(TextLeaf.split(text2, []));
      }
    }
    class TextLeaf extends Text {
      constructor(text2, length = textLength(text2)) {
        super();
        this.text = text2;
        this.length = length;
      }
      get lines() {
        return this.text.length;
      }
      get children() {
        return null;
      }
      lineInner(target2, isLine, line2, offset2) {
        for (let i2 = 0; ; i2++) {
          let string2 = this.text[i2], end2 = offset2 + string2.length;
          if ((isLine ? line2 : end2) >= target2)
            return new Line(offset2, end2, line2, string2);
          offset2 = end2 + 1;
          line2++;
        }
      }
      decompose(from, to2, target2, open) {
        let text2 = from <= 0 && to2 >= this.length ? this : new TextLeaf(sliceText(this.text, from, to2), Math.min(to2, this.length) - Math.max(0, from));
        if (open & 1) {
          let prev = target2.pop();
          let joined = appendText(text2.text, prev.text.slice(), 0, text2.length);
          if (joined.length <= 32) {
            target2.push(new TextLeaf(joined, prev.length + text2.length));
          } else {
            let mid2 = joined.length >> 1;
            target2.push(new TextLeaf(joined.slice(0, mid2)), new TextLeaf(joined.slice(mid2)));
          }
        } else {
          target2.push(text2);
        }
      }
      replace(from, to2, text2) {
        if (!(text2 instanceof TextLeaf))
          return super.replace(from, to2, text2);
        [from, to2] = clip(this, from, to2);
        let lines = appendText(this.text, appendText(text2.text, sliceText(this.text, 0, from)), to2);
        let newLen = this.length + text2.length - (to2 - from);
        if (lines.length <= 32)
          return new TextLeaf(lines, newLen);
        return TextNode.from(TextLeaf.split(lines, []), newLen);
      }
      sliceString(from, to2 = this.length, lineSep = "\n") {
        [from, to2] = clip(this, from, to2);
        let result2 = "";
        for (let pos2 = 0, i2 = 0; pos2 <= to2 && i2 < this.text.length; i2++) {
          let line2 = this.text[i2], end2 = pos2 + line2.length;
          if (pos2 > from && i2)
            result2 += lineSep;
          if (from < end2 && to2 > pos2)
            result2 += line2.slice(Math.max(0, from - pos2), to2 - pos2);
          pos2 = end2 + 1;
        }
        return result2;
      }
      flatten(target2) {
        for (let line2 of this.text)
          target2.push(line2);
      }
      scanIdentical() {
        return 0;
      }
      static split(text2, target2) {
        let part2 = [], len = -1;
        for (let line2 of text2) {
          part2.push(line2);
          len += line2.length + 1;
          if (part2.length == 32) {
            target2.push(new TextLeaf(part2, len));
            part2 = [];
            len = -1;
          }
        }
        if (len > -1)
          target2.push(new TextLeaf(part2, len));
        return target2;
      }
    }
    class TextNode extends Text {
      constructor(children2, length) {
        super();
        this.children = children2;
        this.length = length;
        this.lines = 0;
        for (let child of children2)
          this.lines += child.lines;
      }
      lineInner(target2, isLine, line2, offset2) {
        for (let i2 = 0; ; i2++) {
          let child = this.children[i2], end2 = offset2 + child.length, endLine = line2 + child.lines - 1;
          if ((isLine ? endLine : end2) >= target2)
            return child.lineInner(target2, isLine, line2, offset2);
          offset2 = end2 + 1;
          line2 = endLine + 1;
        }
      }
      decompose(from, to2, target2, open) {
        for (let i2 = 0, pos2 = 0; pos2 <= to2 && i2 < this.children.length; i2++) {
          let child = this.children[i2], end2 = pos2 + child.length;
          if (from <= end2 && to2 >= pos2) {
            let childOpen = open & ((pos2 <= from ? 1 : 0) | (end2 >= to2 ? 2 : 0));
            if (pos2 >= from && end2 <= to2 && !childOpen)
              target2.push(child);
            else
              child.decompose(from - pos2, to2 - pos2, target2, childOpen);
          }
          pos2 = end2 + 1;
        }
      }
      replace(from, to2, text2) {
        [from, to2] = clip(this, from, to2);
        if (text2.lines < this.lines)
          for (let i2 = 0, pos2 = 0; i2 < this.children.length; i2++) {
            let child = this.children[i2], end2 = pos2 + child.length;
            if (from >= pos2 && to2 <= end2) {
              let updated = child.replace(from - pos2, to2 - pos2, text2);
              let totalLines = this.lines - child.lines + updated.lines;
              if (updated.lines < totalLines >> 5 - 1 && updated.lines > totalLines >> 5 + 1) {
                let copy2 = this.children.slice();
                copy2[i2] = updated;
                return new TextNode(copy2, this.length - (to2 - from) + text2.length);
              }
              return super.replace(pos2, end2, updated);
            }
            pos2 = end2 + 1;
          }
        return super.replace(from, to2, text2);
      }
      sliceString(from, to2 = this.length, lineSep = "\n") {
        [from, to2] = clip(this, from, to2);
        let result2 = "";
        for (let i2 = 0, pos2 = 0; i2 < this.children.length && pos2 <= to2; i2++) {
          let child = this.children[i2], end2 = pos2 + child.length;
          if (pos2 > from && i2)
            result2 += lineSep;
          if (from < end2 && to2 > pos2)
            result2 += child.sliceString(from - pos2, to2 - pos2, lineSep);
          pos2 = end2 + 1;
        }
        return result2;
      }
      flatten(target2) {
        for (let child of this.children)
          child.flatten(target2);
      }
      scanIdentical(other, dir) {
        if (!(other instanceof TextNode))
          return 0;
        let length = 0;
        let [iA, iB, eA, eB] = dir > 0 ? [0, 0, this.children.length, other.children.length] : [this.children.length - 1, other.children.length - 1, -1, -1];
        for (; ; iA += dir, iB += dir) {
          if (iA == eA || iB == eB)
            return length;
          let chA = this.children[iA], chB = other.children[iB];
          if (chA != chB)
            return length + chA.scanIdentical(chB, dir);
          length += chA.length + 1;
        }
      }
      static from(children2, length = children2.reduce((l, ch3) => l + ch3.length + 1, -1)) {
        let lines = 0;
        for (let ch3 of children2)
          lines += ch3.lines;
        if (lines < 32) {
          let flat2 = [];
          for (let ch3 of children2)
            ch3.flatten(flat2);
          return new TextLeaf(flat2, length);
        }
        let chunk = Math.max(
          32,
          lines >> 5
          /* Tree.BranchShift */
        ), maxChunk = chunk << 1, minChunk = chunk >> 1;
        let chunked = [], currentLines = 0, currentLen = -1, currentChunk = [];
        function add2(child) {
          let last;
          if (child.lines > maxChunk && child instanceof TextNode) {
            for (let node2 of child.children)
              add2(node2);
          } else if (child.lines > minChunk && (currentLines > minChunk || !currentLines)) {
            flush();
            chunked.push(child);
          } else if (child instanceof TextLeaf && currentLines && (last = currentChunk[currentChunk.length - 1]) instanceof TextLeaf && child.lines + last.lines <= 32) {
            currentLines += child.lines;
            currentLen += child.length + 1;
            currentChunk[currentChunk.length - 1] = new TextLeaf(last.text.concat(child.text), last.length + 1 + child.length);
          } else {
            if (currentLines + child.lines > chunk)
              flush();
            currentLines += child.lines;
            currentLen += child.length + 1;
            currentChunk.push(child);
          }
        }
        function flush() {
          if (currentLines == 0)
            return;
          chunked.push(currentChunk.length == 1 ? currentChunk[0] : TextNode.from(currentChunk, currentLen));
          currentLen = -1;
          currentLines = currentChunk.length = 0;
        }
        for (let child of children2)
          add2(child);
        flush();
        return chunked.length == 1 ? chunked[0] : new TextNode(chunked, length);
      }
    }
    Text.empty = /* @__PURE__ */ new TextLeaf([""], 0);
    function textLength(text2) {
      let length = -1;
      for (let line2 of text2)
        length += line2.length + 1;
      return length;
    }
    function appendText(text2, target2, from = 0, to2 = 1e9) {
      for (let pos2 = 0, i2 = 0, first = true; i2 < text2.length && pos2 <= to2; i2++) {
        let line2 = text2[i2], end2 = pos2 + line2.length;
        if (end2 >= from) {
          if (end2 > to2)
            line2 = line2.slice(0, to2 - pos2);
          if (pos2 < from)
            line2 = line2.slice(from - pos2);
          if (first) {
            target2[target2.length - 1] += line2;
            first = false;
          } else
            target2.push(line2);
        }
        pos2 = end2 + 1;
      }
      return target2;
    }
    function sliceText(text2, from, to2) {
      return appendText(text2, [""], from, to2);
    }
    class RawTextCursor {
      constructor(text2, dir = 1) {
        this.dir = dir;
        this.done = false;
        this.lineBreak = false;
        this.value = "";
        this.nodes = [text2];
        this.offsets = [dir > 0 ? 1 : (text2 instanceof TextLeaf ? text2.text.length : text2.children.length) << 1];
      }
      nextInner(skip, dir) {
        this.done = this.lineBreak = false;
        for (; ; ) {
          let last = this.nodes.length - 1;
          let top2 = this.nodes[last], offsetValue = this.offsets[last], offset2 = offsetValue >> 1;
          let size = top2 instanceof TextLeaf ? top2.text.length : top2.children.length;
          if (offset2 == (dir > 0 ? size : 0)) {
            if (last == 0) {
              this.done = true;
              this.value = "";
              return this;
            }
            if (dir > 0)
              this.offsets[last - 1]++;
            this.nodes.pop();
            this.offsets.pop();
          } else if ((offsetValue & 1) == (dir > 0 ? 0 : 1)) {
            this.offsets[last] += dir;
            if (skip == 0) {
              this.lineBreak = true;
              this.value = "\n";
              return this;
            }
            skip--;
          } else if (top2 instanceof TextLeaf) {
            let next = top2.text[offset2 + (dir < 0 ? -1 : 0)];
            this.offsets[last] += dir;
            if (next.length > Math.max(0, skip)) {
              this.value = skip == 0 ? next : dir > 0 ? next.slice(skip) : next.slice(0, next.length - skip);
              return this;
            }
            skip -= next.length;
          } else {
            let next = top2.children[offset2 + (dir < 0 ? -1 : 0)];
            if (skip > next.length) {
              skip -= next.length;
              this.offsets[last] += dir;
            } else {
              if (dir < 0)
                this.offsets[last]--;
              this.nodes.push(next);
              this.offsets.push(dir > 0 ? 1 : (next instanceof TextLeaf ? next.text.length : next.children.length) << 1);
            }
          }
        }
      }
      next(skip = 0) {
        if (skip < 0) {
          this.nextInner(-skip, -this.dir);
          skip = this.value.length;
        }
        return this.nextInner(skip, this.dir);
      }
    }
    class PartialTextCursor {
      constructor(text2, start2, end2) {
        this.value = "";
        this.done = false;
        this.cursor = new RawTextCursor(text2, start2 > end2 ? -1 : 1);
        this.pos = start2 > end2 ? text2.length : 0;
        this.from = Math.min(start2, end2);
        this.to = Math.max(start2, end2);
      }
      nextInner(skip, dir) {
        if (dir < 0 ? this.pos <= this.from : this.pos >= this.to) {
          this.value = "";
          this.done = true;
          return this;
        }
        skip += Math.max(0, dir < 0 ? this.pos - this.to : this.from - this.pos);
        let limit = dir < 0 ? this.pos - this.from : this.to - this.pos;
        if (skip > limit)
          skip = limit;
        limit -= skip;
        let { value: value2 } = this.cursor.next(skip);
        this.pos += (value2.length + skip) * dir;
        this.value = value2.length <= limit ? value2 : dir < 0 ? value2.slice(value2.length - limit) : value2.slice(0, limit);
        this.done = !this.value;
        return this;
      }
      next(skip = 0) {
        if (skip < 0)
          skip = Math.max(skip, this.from - this.pos);
        else if (skip > 0)
          skip = Math.min(skip, this.to - this.pos);
        return this.nextInner(skip, this.cursor.dir);
      }
      get lineBreak() {
        return this.cursor.lineBreak && this.value != "";
      }
    }
    class LineCursor {
      constructor(inner2) {
        this.inner = inner2;
        this.afterBreak = true;
        this.value = "";
        this.done = false;
      }
      next(skip = 0) {
        let { done, lineBreak, value: value2 } = this.inner.next(skip);
        if (done && this.afterBreak) {
          this.value = "";
          this.afterBreak = false;
        } else if (done) {
          this.done = true;
          this.value = "";
        } else if (lineBreak) {
          if (this.afterBreak) {
            this.value = "";
          } else {
            this.afterBreak = true;
            this.next();
          }
        } else {
          this.value = value2;
          this.afterBreak = false;
        }
        return this;
      }
      get lineBreak() {
        return false;
      }
    }
    if (typeof Symbol != "undefined") {
      Text.prototype[Symbol.iterator] = function() {
        return this.iter();
      };
      RawTextCursor.prototype[Symbol.iterator] = PartialTextCursor.prototype[Symbol.iterator] = LineCursor.prototype[Symbol.iterator] = function() {
        return this;
      };
    }
    class Line {
      /**
      @internal
      */
      constructor(from, to2, number2, text2) {
        this.from = from;
        this.to = to2;
        this.number = number2;
        this.text = text2;
      }
      /**
      The length of the line (not including any line break after it).
      */
      get length() {
        return this.to - this.from;
      }
    }
    function clip(text2, from, to2) {
      from = Math.max(0, Math.min(text2.length, from));
      return [from, Math.max(from, Math.min(text2.length, to2))];
    }
    function findClusterBreak(str2, pos2, forward = true, includeExtending = true) {
      return findClusterBreak$1(str2, pos2, forward, includeExtending);
    }
    function surrogateLow(ch3) {
      return ch3 >= 56320 && ch3 < 57344;
    }
    function surrogateHigh(ch3) {
      return ch3 >= 55296 && ch3 < 56320;
    }
    function codePointAt(str2, pos2) {
      let code0 = str2.charCodeAt(pos2);
      if (!surrogateHigh(code0) || pos2 + 1 == str2.length)
        return code0;
      let code1 = str2.charCodeAt(pos2 + 1);
      if (!surrogateLow(code1))
        return code0;
      return (code0 - 55296 << 10) + (code1 - 56320) + 65536;
    }
    function fromCodePoint(code2) {
      if (code2 <= 65535)
        return String.fromCharCode(code2);
      code2 -= 65536;
      return String.fromCharCode((code2 >> 10) + 55296, (code2 & 1023) + 56320);
    }
    function codePointSize(code2) {
      return code2 < 65536 ? 1 : 2;
    }
    const DefaultSplit = /\r\n?|\n/;
    var MapMode = /* @__PURE__ */ (function(MapMode2) {
      MapMode2[MapMode2["Simple"] = 0] = "Simple";
      MapMode2[MapMode2["TrackDel"] = 1] = "TrackDel";
      MapMode2[MapMode2["TrackBefore"] = 2] = "TrackBefore";
      MapMode2[MapMode2["TrackAfter"] = 3] = "TrackAfter";
      return MapMode2;
    })(MapMode || (MapMode = {}));
    class ChangeDesc {
      // Sections are encoded as pairs of integers. The first is the
      // length in the current document, and the second is -1 for
      // unaffected sections, and the length of the replacement content
      // otherwise. So an insertion would be (0, n>0), a deletion (n>0,
      // 0), and a replacement two positive numbers.
      /**
      @internal
      */
      constructor(sections) {
        this.sections = sections;
      }
      /**
      The length of the document before the change.
      */
      get length() {
        let result2 = 0;
        for (let i2 = 0; i2 < this.sections.length; i2 += 2)
          result2 += this.sections[i2];
        return result2;
      }
      /**
      The length of the document after the change.
      */
      get newLength() {
        let result2 = 0;
        for (let i2 = 0; i2 < this.sections.length; i2 += 2) {
          let ins = this.sections[i2 + 1];
          result2 += ins < 0 ? this.sections[i2] : ins;
        }
        return result2;
      }
      /**
      False when there are actual changes in this set.
      */
      get empty() {
        return this.sections.length == 0 || this.sections.length == 2 && this.sections[1] < 0;
      }
      /**
      Iterate over the unchanged parts left by these changes. `posA`
      provides the position of the range in the old document, `posB`
      the new position in the changed document.
      */
      iterGaps(f) {
        for (let i2 = 0, posA = 0, posB = 0; i2 < this.sections.length; ) {
          let len = this.sections[i2++], ins = this.sections[i2++];
          if (ins < 0) {
            f(posA, posB, len);
            posB += len;
          } else {
            posB += ins;
          }
          posA += len;
        }
      }
      /**
      Iterate over the ranges changed by these changes. (See
      [`ChangeSet.iterChanges`](https://codemirror.net/6/docs/ref/#state.ChangeSet.iterChanges) for a
      variant that also provides you with the inserted text.)
      `fromA`/`toA` provides the extent of the change in the starting
      document, `fromB`/`toB` the extent of the replacement in the
      changed document.
      
      When `individual` is true, adjacent changes (which are kept
      separate for [position mapping](https://codemirror.net/6/docs/ref/#state.ChangeDesc.mapPos)) are
      reported separately.
      */
      iterChangedRanges(f, individual = false) {
        iterChanges(this, f, individual);
      }
      /**
      Get a description of the inverted form of these changes.
      */
      get invertedDesc() {
        let sections = [];
        for (let i2 = 0; i2 < this.sections.length; ) {
          let len = this.sections[i2++], ins = this.sections[i2++];
          if (ins < 0)
            sections.push(len, ins);
          else
            sections.push(ins, len);
        }
        return new ChangeDesc(sections);
      }
      /**
      Compute the combined effect of applying another set of changes
      after this one. The length of the document after this set should
      match the length before `other`.
      */
      composeDesc(other) {
        return this.empty ? other : other.empty ? this : composeSets(this, other);
      }
      /**
      Map this description, which should start with the same document
      as `other`, over another set of changes, so that it can be
      applied after it. When `before` is true, map as if the changes
      in `this` happened before the ones in `other`.
      */
      mapDesc(other, before = false) {
        return other.empty ? this : mapSet(this, other, before);
      }
      mapPos(pos2, assoc = -1, mode = MapMode.Simple) {
        let posA = 0, posB = 0;
        for (let i2 = 0; i2 < this.sections.length; ) {
          let len = this.sections[i2++], ins = this.sections[i2++], endA = posA + len;
          if (ins < 0) {
            if (endA > pos2)
              return posB + (pos2 - posA);
            posB += len;
          } else {
            if (mode != MapMode.Simple && endA >= pos2 && (mode == MapMode.TrackDel && posA < pos2 && endA > pos2 || mode == MapMode.TrackBefore && posA < pos2 || mode == MapMode.TrackAfter && endA > pos2))
              return null;
            if (endA > pos2 || endA == pos2 && assoc < 0 && !len)
              return pos2 == posA || assoc < 0 ? posB : posB + ins;
            posB += ins;
          }
          posA = endA;
        }
        if (pos2 > posA)
          throw new RangeError(`Position ${pos2} is out of range for changeset of length ${posA}`);
        return posB;
      }
      /**
      Check whether these changes touch a given range. When one of the
      changes entirely covers the range, the string `"cover"` is
      returned.
      */
      touchesRange(from, to2 = from) {
        for (let i2 = 0, pos2 = 0; i2 < this.sections.length && pos2 <= to2; ) {
          let len = this.sections[i2++], ins = this.sections[i2++], end2 = pos2 + len;
          if (ins >= 0 && pos2 <= to2 && end2 >= from)
            return pos2 < from && end2 > to2 ? "cover" : true;
          pos2 = end2;
        }
        return false;
      }
      /**
      @internal
      */
      toString() {
        let result2 = "";
        for (let i2 = 0; i2 < this.sections.length; ) {
          let len = this.sections[i2++], ins = this.sections[i2++];
          result2 += (result2 ? " " : "") + len + (ins >= 0 ? ":" + ins : "");
        }
        return result2;
      }
      /**
      Serialize this change desc to a JSON-representable value.
      */
      toJSON() {
        return this.sections;
      }
      /**
      Create a change desc from its JSON representation (as produced
      by [`toJSON`](https://codemirror.net/6/docs/ref/#state.ChangeDesc.toJSON).
      */
      static fromJSON(json) {
        if (!Array.isArray(json) || json.length % 2 || json.some((a) => typeof a != "number"))
          throw new RangeError("Invalid JSON representation of ChangeDesc");
        return new ChangeDesc(json);
      }
      /**
      @internal
      */
      static create(sections) {
        return new ChangeDesc(sections);
      }
    }
    class ChangeSet extends ChangeDesc {
      constructor(sections, inserted) {
        super(sections);
        this.inserted = inserted;
      }
      /**
      Apply the changes to a document, returning the modified
      document.
      */
      apply(doc2) {
        if (this.length != doc2.length)
          throw new RangeError("Applying change set to a document with the wrong length");
        iterChanges(this, (fromA, toA, fromB, _toB, text2) => doc2 = doc2.replace(fromB, fromB + (toA - fromA), text2), false);
        return doc2;
      }
      mapDesc(other, before = false) {
        return mapSet(this, other, before, true);
      }
      /**
      Given the document as it existed _before_ the changes, return a
      change set that represents the inverse of this set, which could
      be used to go from the document created by the changes back to
      the document as it existed before the changes.
      */
      invert(doc2) {
        let sections = this.sections.slice(), inserted = [];
        for (let i2 = 0, pos2 = 0; i2 < sections.length; i2 += 2) {
          let len = sections[i2], ins = sections[i2 + 1];
          if (ins >= 0) {
            sections[i2] = ins;
            sections[i2 + 1] = len;
            let index = i2 >> 1;
            while (inserted.length < index)
              inserted.push(Text.empty);
            inserted.push(len ? doc2.slice(pos2, pos2 + len) : Text.empty);
          }
          pos2 += len;
        }
        return new ChangeSet(sections, inserted);
      }
      /**
      Combine two subsequent change sets into a single set. `other`
      must start in the document produced by `this`. If `this` goes
      `docA` → `docB` and `other` represents `docB` → `docC`, the
      returned value will represent the change `docA` → `docC`.
      */
      compose(other) {
        return this.empty ? other : other.empty ? this : composeSets(this, other, true);
      }
      /**
      Given another change set starting in the same document, maps this
      change set over the other, producing a new change set that can be
      applied to the document produced by applying `other`. When
      `before` is `true`, order changes as if `this` comes before
      `other`, otherwise (the default) treat `other` as coming first.
      
      Given two changes `A` and `B`, `A.compose(B.map(A))` and
      `B.compose(A.map(B, true))` will produce the same document. This
      provides a basic form of [operational
      transformation](https://en.wikipedia.org/wiki/Operational_transformation),
      and can be used for collaborative editing.
      */
      map(other, before = false) {
        return other.empty ? this : mapSet(this, other, before, true);
      }
      /**
      Iterate over the changed ranges in the document, calling `f` for
      each, with the range in the original document (`fromA`-`toA`)
      and the range that replaces it in the new document
      (`fromB`-`toB`).
      
      When `individual` is true, adjacent changes are reported
      separately.
      */
      iterChanges(f, individual = false) {
        iterChanges(this, f, individual);
      }
      /**
      Get a [change description](https://codemirror.net/6/docs/ref/#state.ChangeDesc) for this change
      set.
      */
      get desc() {
        return ChangeDesc.create(this.sections);
      }
      /**
      @internal
      */
      filter(ranges) {
        let resultSections = [], resultInserted = [], filteredSections = [];
        let iter = new SectionIter(this);
        done: for (let i2 = 0, pos2 = 0; ; ) {
          let next = i2 == ranges.length ? 1e9 : ranges[i2++];
          while (pos2 < next || pos2 == next && iter.len == 0) {
            if (iter.done)
              break done;
            let len = Math.min(iter.len, next - pos2);
            addSection(filteredSections, len, -1);
            let ins = iter.ins == -1 ? -1 : iter.off == 0 ? iter.ins : 0;
            addSection(resultSections, len, ins);
            if (ins > 0)
              addInsert(resultInserted, resultSections, iter.text);
            iter.forward(len);
            pos2 += len;
          }
          let end2 = ranges[i2++];
          while (pos2 < end2) {
            if (iter.done)
              break done;
            let len = Math.min(iter.len, end2 - pos2);
            addSection(resultSections, len, -1);
            addSection(filteredSections, len, iter.ins == -1 ? -1 : iter.off == 0 ? iter.ins : 0);
            iter.forward(len);
            pos2 += len;
          }
        }
        return {
          changes: new ChangeSet(resultSections, resultInserted),
          filtered: ChangeDesc.create(filteredSections)
        };
      }
      /**
      Serialize this change set to a JSON-representable value.
      */
      toJSON() {
        let parts = [];
        for (let i2 = 0; i2 < this.sections.length; i2 += 2) {
          let len = this.sections[i2], ins = this.sections[i2 + 1];
          if (ins < 0)
            parts.push(len);
          else if (ins == 0)
            parts.push([len]);
          else
            parts.push([len].concat(this.inserted[i2 >> 1].toJSON()));
        }
        return parts;
      }
      /**
      Create a change set for the given changes, for a document of the
      given length, using `lineSep` as line separator.
      */
      static of(changes, length, lineSep) {
        let sections = [], inserted = [], pos2 = 0;
        let total = null;
        function flush(force = false) {
          if (!force && !sections.length)
            return;
          if (pos2 < length)
            addSection(sections, length - pos2, -1);
          let set2 = new ChangeSet(sections, inserted);
          total = total ? total.compose(set2.map(total)) : set2;
          sections = [];
          inserted = [];
          pos2 = 0;
        }
        function process2(spec) {
          if (Array.isArray(spec)) {
            for (let sub2 of spec)
              process2(sub2);
          } else if (spec instanceof ChangeSet) {
            if (spec.length != length)
              throw new RangeError(`Mismatched change set length (got ${spec.length}, expected ${length})`);
            flush();
            total = total ? total.compose(spec.map(total)) : spec;
          } else {
            let { from, to: to2 = from, insert: insert2 } = spec;
            if (from > to2 || from < 0 || to2 > length)
              throw new RangeError(`Invalid change range ${from} to ${to2} (in doc of length ${length})`);
            let insText = !insert2 ? Text.empty : typeof insert2 == "string" ? Text.of(insert2.split(lineSep || DefaultSplit)) : insert2;
            let insLen = insText.length;
            if (from == to2 && insLen == 0)
              return;
            if (from < pos2)
              flush();
            if (from > pos2)
              addSection(sections, from - pos2, -1);
            addSection(sections, to2 - from, insLen);
            addInsert(inserted, sections, insText);
            pos2 = to2;
          }
        }
        process2(changes);
        flush(!total);
        return total;
      }
      /**
      Create an empty changeset of the given length.
      */
      static empty(length) {
        return new ChangeSet(length ? [length, -1] : [], []);
      }
      /**
      Create a changeset from its JSON representation (as produced by
      [`toJSON`](https://codemirror.net/6/docs/ref/#state.ChangeSet.toJSON).
      */
      static fromJSON(json) {
        if (!Array.isArray(json))
          throw new RangeError("Invalid JSON representation of ChangeSet");
        let sections = [], inserted = [];
        for (let i2 = 0; i2 < json.length; i2++) {
          let part2 = json[i2];
          if (typeof part2 == "number") {
            sections.push(part2, -1);
          } else if (!Array.isArray(part2) || typeof part2[0] != "number" || part2.some((e, i3) => i3 && typeof e != "string")) {
            throw new RangeError("Invalid JSON representation of ChangeSet");
          } else if (part2.length == 1) {
            sections.push(part2[0], 0);
          } else {
            while (inserted.length < i2)
              inserted.push(Text.empty);
            inserted[i2] = Text.of(part2.slice(1));
            sections.push(part2[0], inserted[i2].length);
          }
        }
        return new ChangeSet(sections, inserted);
      }
      /**
      @internal
      */
      static createSet(sections, inserted) {
        return new ChangeSet(sections, inserted);
      }
    }
    function addSection(sections, len, ins, forceJoin = false) {
      if (len == 0 && ins <= 0)
        return;
      let last = sections.length - 2;
      if (last >= 0 && ins <= 0 && ins == sections[last + 1])
        sections[last] += len;
      else if (last >= 0 && len == 0 && sections[last] == 0)
        sections[last + 1] += ins;
      else if (forceJoin) {
        sections[last] += len;
        sections[last + 1] += ins;
      } else
        sections.push(len, ins);
    }
    function addInsert(values, sections, value2) {
      if (value2.length == 0)
        return;
      let index = sections.length - 2 >> 1;
      if (index < values.length) {
        values[values.length - 1] = values[values.length - 1].append(value2);
      } else {
        while (values.length < index)
          values.push(Text.empty);
        values.push(value2);
      }
    }
    function iterChanges(desc, f, individual) {
      let inserted = desc.inserted;
      for (let posA = 0, posB = 0, i2 = 0; i2 < desc.sections.length; ) {
        let len = desc.sections[i2++], ins = desc.sections[i2++];
        if (ins < 0) {
          posA += len;
          posB += len;
        } else {
          let endA = posA, endB = posB, text2 = Text.empty;
          for (; ; ) {
            endA += len;
            endB += ins;
            if (ins && inserted)
              text2 = text2.append(inserted[i2 - 2 >> 1]);
            if (individual || i2 == desc.sections.length || desc.sections[i2 + 1] < 0)
              break;
            len = desc.sections[i2++];
            ins = desc.sections[i2++];
          }
          f(posA, endA, posB, endB, text2);
          posA = endA;
          posB = endB;
        }
      }
    }
    function mapSet(setA, setB, before, mkSet = false) {
      let sections = [], insert2 = mkSet ? [] : null;
      let a = new SectionIter(setA), b = new SectionIter(setB);
      for (let inserted = -1; ; ) {
        if (a.done && b.len || b.done && a.len) {
          throw new Error("Mismatched change set lengths");
        } else if (a.ins == -1 && b.ins == -1) {
          let len = Math.min(a.len, b.len);
          addSection(sections, len, -1);
          a.forward(len);
          b.forward(len);
        } else if (b.ins >= 0 && (a.ins < 0 || inserted == a.i || a.off == 0 && (b.len < a.len || b.len == a.len && !before))) {
          let len = b.len;
          addSection(sections, b.ins, -1);
          while (len) {
            let piece = Math.min(a.len, len);
            if (a.ins >= 0 && inserted < a.i && a.len <= piece) {
              addSection(sections, 0, a.ins);
              if (insert2)
                addInsert(insert2, sections, a.text);
              inserted = a.i;
            }
            a.forward(piece);
            len -= piece;
          }
          b.next();
        } else if (a.ins >= 0) {
          let len = 0, left2 = a.len;
          while (left2) {
            if (b.ins == -1) {
              let piece = Math.min(left2, b.len);
              len += piece;
              left2 -= piece;
              b.forward(piece);
            } else if (b.ins == 0 && b.len < left2) {
              left2 -= b.len;
              b.next();
            } else {
              break;
            }
          }
          addSection(sections, len, inserted < a.i ? a.ins : 0);
          if (insert2 && inserted < a.i)
            addInsert(insert2, sections, a.text);
          inserted = a.i;
          a.forward(a.len - left2);
        } else if (a.done && b.done) {
          return insert2 ? ChangeSet.createSet(sections, insert2) : ChangeDesc.create(sections);
        } else {
          throw new Error("Mismatched change set lengths");
        }
      }
    }
    function composeSets(setA, setB, mkSet = false) {
      let sections = [];
      let insert2 = mkSet ? [] : null;
      let a = new SectionIter(setA), b = new SectionIter(setB);
      for (let open = false; ; ) {
        if (a.done && b.done) {
          return insert2 ? ChangeSet.createSet(sections, insert2) : ChangeDesc.create(sections);
        } else if (a.ins == 0) {
          addSection(sections, a.len, 0, open);
          a.next();
        } else if (b.len == 0 && !b.done) {
          addSection(sections, 0, b.ins, open);
          if (insert2)
            addInsert(insert2, sections, b.text);
          b.next();
        } else if (a.done || b.done) {
          throw new Error("Mismatched change set lengths");
        } else {
          let len = Math.min(a.len2, b.len), sectionLen = sections.length;
          if (a.ins == -1) {
            let insB = b.ins == -1 ? -1 : b.off ? 0 : b.ins;
            addSection(sections, len, insB, open);
            if (insert2 && insB)
              addInsert(insert2, sections, b.text);
          } else if (b.ins == -1) {
            addSection(sections, a.off ? 0 : a.len, len, open);
            if (insert2)
              addInsert(insert2, sections, a.textBit(len));
          } else {
            addSection(sections, a.off ? 0 : a.len, b.off ? 0 : b.ins, open);
            if (insert2 && !b.off)
              addInsert(insert2, sections, b.text);
          }
          open = (a.ins > len || b.ins >= 0 && b.len > len) && (open || sections.length > sectionLen);
          a.forward2(len);
          b.forward(len);
        }
      }
    }
    class SectionIter {
      constructor(set2) {
        this.set = set2;
        this.i = 0;
        this.next();
      }
      next() {
        let { sections } = this.set;
        if (this.i < sections.length) {
          this.len = sections[this.i++];
          this.ins = sections[this.i++];
        } else {
          this.len = 0;
          this.ins = -2;
        }
        this.off = 0;
      }
      get done() {
        return this.ins == -2;
      }
      get len2() {
        return this.ins < 0 ? this.len : this.ins;
      }
      get text() {
        let { inserted } = this.set, index = this.i - 2 >> 1;
        return index >= inserted.length ? Text.empty : inserted[index];
      }
      textBit(len) {
        let { inserted } = this.set, index = this.i - 2 >> 1;
        return index >= inserted.length && !len ? Text.empty : inserted[index].slice(this.off, len == null ? void 0 : this.off + len);
      }
      forward(len) {
        if (len == this.len)
          this.next();
        else {
          this.len -= len;
          this.off += len;
        }
      }
      forward2(len) {
        if (this.ins == -1)
          this.forward(len);
        else if (len == this.ins)
          this.next();
        else {
          this.ins -= len;
          this.off += len;
        }
      }
    }
    class SelectionRange {
      constructor(from, to2, flags) {
        this.from = from;
        this.to = to2;
        this.flags = flags;
      }
      /**
      The anchor of the range—the side that doesn't move when you
      extend it.
      */
      get anchor() {
        return this.flags & 32 ? this.to : this.from;
      }
      /**
      The head of the range, which is moved when the range is
      [extended](https://codemirror.net/6/docs/ref/#state.SelectionRange.extend).
      */
      get head() {
        return this.flags & 32 ? this.from : this.to;
      }
      /**
      True when `anchor` and `head` are at the same position.
      */
      get empty() {
        return this.from == this.to;
      }
      /**
      If this is a cursor that is explicitly associated with the
      character on one of its sides, this returns the side. -1 means
      the character before its position, 1 the character after, and 0
      means no association.
      */
      get assoc() {
        return this.flags & 8 ? -1 : this.flags & 16 ? 1 : 0;
      }
      /**
      The bidirectional text level associated with this cursor, if
      any.
      */
      get bidiLevel() {
        let level = this.flags & 7;
        return level == 7 ? null : level;
      }
      /**
      The goal column (stored vertical offset) associated with a
      cursor. This is used to preserve the vertical position when
      [moving](https://codemirror.net/6/docs/ref/#view.EditorView.moveVertically) across
      lines of different length.
      */
      get goalColumn() {
        let value2 = this.flags >> 6;
        return value2 == 16777215 ? void 0 : value2;
      }
      /**
      Map this range through a change, producing a valid range in the
      updated document.
      */
      map(change, assoc = -1) {
        let from, to2;
        if (this.empty) {
          from = to2 = change.mapPos(this.from, assoc);
        } else {
          from = change.mapPos(this.from, 1);
          to2 = change.mapPos(this.to, -1);
        }
        return from == this.from && to2 == this.to ? this : new SelectionRange(from, to2, this.flags);
      }
      /**
      Extend this range to cover at least `from` to `to`.
      */
      extend(from, to2 = from) {
        if (from <= this.anchor && to2 >= this.anchor)
          return EditorSelection.range(from, to2);
        let head = Math.abs(from - this.anchor) > Math.abs(to2 - this.anchor) ? from : to2;
        return EditorSelection.range(this.anchor, head);
      }
      /**
      Compare this range to another range.
      */
      eq(other, includeAssoc = false) {
        return this.anchor == other.anchor && this.head == other.head && (!includeAssoc || !this.empty || this.assoc == other.assoc);
      }
      /**
      Return a JSON-serializable object representing the range.
      */
      toJSON() {
        return { anchor: this.anchor, head: this.head };
      }
      /**
      Convert a JSON representation of a range to a `SelectionRange`
      instance.
      */
      static fromJSON(json) {
        if (!json || typeof json.anchor != "number" || typeof json.head != "number")
          throw new RangeError("Invalid JSON representation for SelectionRange");
        return EditorSelection.range(json.anchor, json.head);
      }
      /**
      @internal
      */
      static create(from, to2, flags) {
        return new SelectionRange(from, to2, flags);
      }
    }
    class EditorSelection {
      constructor(ranges, mainIndex) {
        this.ranges = ranges;
        this.mainIndex = mainIndex;
      }
      /**
      Map a selection through a change. Used to adjust the selection
      position for changes.
      */
      map(change, assoc = -1) {
        if (change.empty)
          return this;
        return EditorSelection.create(this.ranges.map((r2) => r2.map(change, assoc)), this.mainIndex);
      }
      /**
      Compare this selection to another selection. By default, ranges
      are compared only by position. When `includeAssoc` is true,
      cursor ranges must also have the same
      [`assoc`](https://codemirror.net/6/docs/ref/#state.SelectionRange.assoc) value.
      */
      eq(other, includeAssoc = false) {
        if (this.ranges.length != other.ranges.length || this.mainIndex != other.mainIndex)
          return false;
        for (let i2 = 0; i2 < this.ranges.length; i2++)
          if (!this.ranges[i2].eq(other.ranges[i2], includeAssoc))
            return false;
        return true;
      }
      /**
      Get the primary selection range. Usually, you should make sure
      your code applies to _all_ ranges, by using methods like
      [`changeByRange`](https://codemirror.net/6/docs/ref/#state.EditorState.changeByRange).
      */
      get main() {
        return this.ranges[this.mainIndex];
      }
      /**
      Make sure the selection only has one range. Returns a selection
      holding only the main range from this selection.
      */
      asSingle() {
        return this.ranges.length == 1 ? this : new EditorSelection([this.main], 0);
      }
      /**
      Extend this selection with an extra range.
      */
      addRange(range2, main2 = true) {
        return EditorSelection.create([range2].concat(this.ranges), main2 ? 0 : this.mainIndex + 1);
      }
      /**
      Replace a given range with another range, and then normalize the
      selection to merge and sort ranges if necessary.
      */
      replaceRange(range2, which = this.mainIndex) {
        let ranges = this.ranges.slice();
        ranges[which] = range2;
        return EditorSelection.create(ranges, this.mainIndex);
      }
      /**
      Convert this selection to an object that can be serialized to
      JSON.
      */
      toJSON() {
        return { ranges: this.ranges.map((r2) => r2.toJSON()), main: this.mainIndex };
      }
      /**
      Create a selection from a JSON representation.
      */
      static fromJSON(json) {
        if (!json || !Array.isArray(json.ranges) || typeof json.main != "number" || json.main >= json.ranges.length)
          throw new RangeError("Invalid JSON representation for EditorSelection");
        return new EditorSelection(json.ranges.map((r2) => SelectionRange.fromJSON(r2)), json.main);
      }
      /**
      Create a selection holding a single range.
      */
      static single(anchor, head = anchor) {
        return new EditorSelection([EditorSelection.range(anchor, head)], 0);
      }
      /**
      Sort and merge the given set of ranges, creating a valid
      selection.
      */
      static create(ranges, mainIndex = 0) {
        if (ranges.length == 0)
          throw new RangeError("A selection needs at least one range");
        for (let pos2 = 0, i2 = 0; i2 < ranges.length; i2++) {
          let range2 = ranges[i2];
          if (range2.empty ? range2.from <= pos2 : range2.from < pos2)
            return EditorSelection.normalized(ranges.slice(), mainIndex);
          pos2 = range2.to;
        }
        return new EditorSelection(ranges, mainIndex);
      }
      /**
      Create a cursor selection range at the given position. You can
      safely ignore the optional arguments in most situations.
      */
      static cursor(pos2, assoc = 0, bidiLevel, goalColumn) {
        return SelectionRange.create(pos2, pos2, (assoc == 0 ? 0 : assoc < 0 ? 8 : 16) | (bidiLevel == null ? 7 : Math.min(6, bidiLevel)) | (goalColumn !== null && goalColumn !== void 0 ? goalColumn : 16777215) << 6);
      }
      /**
      Create a selection range.
      */
      static range(anchor, head, goalColumn, bidiLevel) {
        let flags = (goalColumn !== null && goalColumn !== void 0 ? goalColumn : 16777215) << 6 | (bidiLevel == null ? 7 : Math.min(6, bidiLevel));
        return head < anchor ? SelectionRange.create(head, anchor, 32 | 16 | flags) : SelectionRange.create(anchor, head, (head > anchor ? 8 : 0) | flags);
      }
      /**
      @internal
      */
      static normalized(ranges, mainIndex = 0) {
        let main2 = ranges[mainIndex];
        ranges.sort((a, b) => a.from - b.from);
        mainIndex = ranges.indexOf(main2);
        for (let i2 = 1; i2 < ranges.length; i2++) {
          let range2 = ranges[i2], prev = ranges[i2 - 1];
          if (range2.empty ? range2.from <= prev.to : range2.from < prev.to) {
            let from = prev.from, to2 = Math.max(range2.to, prev.to);
            if (i2 <= mainIndex)
              mainIndex--;
            ranges.splice(--i2, 2, range2.anchor > range2.head ? EditorSelection.range(to2, from) : EditorSelection.range(from, to2));
          }
        }
        return new EditorSelection(ranges, mainIndex);
      }
    }
    function checkSelection(selection, docLength) {
      for (let range2 of selection.ranges)
        if (range2.to > docLength)
          throw new RangeError("Selection points outside of document");
    }
    let nextID = 0;
    class Facet {
      constructor(combine, compareInput, compare2, isStatic, enables) {
        this.combine = combine;
        this.compareInput = compareInput;
        this.compare = compare2;
        this.isStatic = isStatic;
        this.id = nextID++;
        this.default = combine([]);
        this.extensions = typeof enables == "function" ? enables(this) : enables;
      }
      /**
      Returns a facet reader for this facet, which can be used to
      [read](https://codemirror.net/6/docs/ref/#state.EditorState.facet) it but not to define values for it.
      */
      get reader() {
        return this;
      }
      /**
      Define a new facet.
      */
      static define(config2 = {}) {
        return new Facet(config2.combine || ((a) => a), config2.compareInput || ((a, b) => a === b), config2.compare || (!config2.combine ? sameArray$5 : (a, b) => a === b), !!config2.static, config2.enables);
      }
      /**
      Returns an extension that adds the given value to this facet.
      */
      of(value2) {
        return new FacetProvider([], this, 0, value2);
      }
      /**
      Create an extension that computes a value for the facet from a
      state. You must take care to declare the parts of the state that
      this value depends on, since your function is only called again
      for a new state when one of those parts changed.
      
      In cases where your value depends only on a single field, you'll
      want to use the [`from`](https://codemirror.net/6/docs/ref/#state.Facet.from) method instead.
      */
      compute(deps, get2) {
        if (this.isStatic)
          throw new Error("Can't compute a static facet");
        return new FacetProvider(deps, this, 1, get2);
      }
      /**
      Create an extension that computes zero or more values for this
      facet from a state.
      */
      computeN(deps, get2) {
        if (this.isStatic)
          throw new Error("Can't compute a static facet");
        return new FacetProvider(deps, this, 2, get2);
      }
      from(field, get2) {
        if (!get2)
          get2 = (x2) => x2;
        return this.compute([field], (state) => get2(state.field(field)));
      }
    }
    function sameArray$5(a, b) {
      return a == b || a.length == b.length && a.every((e, i2) => e === b[i2]);
    }
    class FacetProvider {
      constructor(dependencies, facet, type, value2) {
        this.dependencies = dependencies;
        this.facet = facet;
        this.type = type;
        this.value = value2;
        this.id = nextID++;
      }
      dynamicSlot(addresses) {
        var _a2;
        let getter = this.value;
        let compare2 = this.facet.compareInput;
        let id = this.id, idx = addresses[id] >> 1, multi = this.type == 2;
        let depDoc = false, depSel = false, depAddrs = [];
        for (let dep of this.dependencies) {
          if (dep == "doc")
            depDoc = true;
          else if (dep == "selection")
            depSel = true;
          else if ((((_a2 = addresses[dep.id]) !== null && _a2 !== void 0 ? _a2 : 1) & 1) == 0)
            depAddrs.push(addresses[dep.id]);
        }
        return {
          create(state) {
            state.values[idx] = getter(state);
            return 1;
          },
          update(state, tr2) {
            if (depDoc && tr2.docChanged || depSel && (tr2.docChanged || tr2.selection) || ensureAll(state, depAddrs)) {
              let newVal = getter(state);
              if (multi ? !compareArray(newVal, state.values[idx], compare2) : !compare2(newVal, state.values[idx])) {
                state.values[idx] = newVal;
                return 1;
              }
            }
            return 0;
          },
          reconfigure: (state, oldState) => {
            let newVal, oldAddr = oldState.config.address[id];
            if (oldAddr != null) {
              let oldVal = getAddr(oldState, oldAddr);
              if (this.dependencies.every((dep) => {
                return dep instanceof Facet ? oldState.facet(dep) === state.facet(dep) : dep instanceof StateField ? oldState.field(dep, false) == state.field(dep, false) : true;
              }) || (multi ? compareArray(newVal = getter(state), oldVal, compare2) : compare2(newVal = getter(state), oldVal))) {
                state.values[idx] = oldVal;
                return 0;
              }
            } else {
              newVal = getter(state);
            }
            state.values[idx] = newVal;
            return 1;
          }
        };
      }
    }
    function compareArray(a, b, compare2) {
      if (a.length != b.length)
        return false;
      for (let i2 = 0; i2 < a.length; i2++)
        if (!compare2(a[i2], b[i2]))
          return false;
      return true;
    }
    function ensureAll(state, addrs) {
      let changed = false;
      for (let addr of addrs)
        if (ensureAddr(state, addr) & 1)
          changed = true;
      return changed;
    }
    function dynamicFacetSlot(addresses, facet, providers) {
      let providerAddrs = providers.map((p) => addresses[p.id]);
      let providerTypes = providers.map((p) => p.type);
      let dynamic = providerAddrs.filter((p) => !(p & 1));
      let idx = addresses[facet.id] >> 1;
      function get2(state) {
        let values = [];
        for (let i2 = 0; i2 < providerAddrs.length; i2++) {
          let value2 = getAddr(state, providerAddrs[i2]);
          if (providerTypes[i2] == 2)
            for (let val of value2)
              values.push(val);
          else
            values.push(value2);
        }
        return facet.combine(values);
      }
      return {
        create(state) {
          for (let addr of providerAddrs)
            ensureAddr(state, addr);
          state.values[idx] = get2(state);
          return 1;
        },
        update(state, tr2) {
          if (!ensureAll(state, dynamic))
            return 0;
          let value2 = get2(state);
          if (facet.compare(value2, state.values[idx]))
            return 0;
          state.values[idx] = value2;
          return 1;
        },
        reconfigure(state, oldState) {
          let depChanged = ensureAll(state, providerAddrs);
          let oldProviders = oldState.config.facets[facet.id], oldValue = oldState.facet(facet);
          if (oldProviders && !depChanged && sameArray$5(providers, oldProviders)) {
            state.values[idx] = oldValue;
            return 0;
          }
          let value2 = get2(state);
          if (facet.compare(value2, oldValue)) {
            state.values[idx] = oldValue;
            return 0;
          }
          state.values[idx] = value2;
          return 1;
        }
      };
    }
    const initField = /* @__PURE__ */ Facet.define({ static: true });
    class StateField {
      constructor(id, createF, updateF, compareF, spec) {
        this.id = id;
        this.createF = createF;
        this.updateF = updateF;
        this.compareF = compareF;
        this.spec = spec;
        this.provides = void 0;
      }
      /**
      Define a state field.
      */
      static define(config2) {
        let field = new StateField(nextID++, config2.create, config2.update, config2.compare || ((a, b) => a === b), config2);
        if (config2.provide)
          field.provides = config2.provide(field);
        return field;
      }
      create(state) {
        let init2 = state.facet(initField).find((i2) => i2.field == this);
        return ((init2 === null || init2 === void 0 ? void 0 : init2.create) || this.createF)(state);
      }
      /**
      @internal
      */
      slot(addresses) {
        let idx = addresses[this.id] >> 1;
        return {
          create: (state) => {
            state.values[idx] = this.create(state);
            return 1;
          },
          update: (state, tr2) => {
            let oldVal = state.values[idx];
            let value2 = this.updateF(oldVal, tr2);
            if (this.compareF(oldVal, value2))
              return 0;
            state.values[idx] = value2;
            return 1;
          },
          reconfigure: (state, oldState) => {
            let init2 = state.facet(initField), oldInit = oldState.facet(initField), reInit;
            if ((reInit = init2.find((i2) => i2.field == this)) && reInit != oldInit.find((i2) => i2.field == this)) {
              state.values[idx] = reInit.create(state);
              return 1;
            }
            if (oldState.config.address[this.id] != null) {
              state.values[idx] = oldState.field(this);
              return 0;
            }
            state.values[idx] = this.create(state);
            return 1;
          }
        };
      }
      /**
      Returns an extension that enables this field and overrides the
      way it is initialized. Can be useful when you need to provide a
      non-default starting value for the field.
      */
      init(create2) {
        return [this, initField.of({ field: this, create: create2 })];
      }
      /**
      State field instances can be used as
      [`Extension`](https://codemirror.net/6/docs/ref/#state.Extension) values to enable the field in a
      given state.
      */
      get extension() {
        return this;
      }
    }
    const Prec_ = { lowest: 4, low: 3, default: 2, high: 1, highest: 0 };
    function prec(value2) {
      return (ext) => new PrecExtension(ext, value2);
    }
    const Prec = {
      /**
      The highest precedence level, for extensions that should end up
      near the start of the precedence ordering.
      */
      highest: /* @__PURE__ */ prec(Prec_.highest),
      /**
      A higher-than-default precedence, for extensions that should
      come before those with default precedence.
      */
      high: /* @__PURE__ */ prec(Prec_.high),
      /**
      The default precedence, which is also used for extensions
      without an explicit precedence.
      */
      default: /* @__PURE__ */ prec(Prec_.default),
      /**
      A lower-than-default precedence.
      */
      low: /* @__PURE__ */ prec(Prec_.low),
      /**
      The lowest precedence level. Meant for things that should end up
      near the end of the extension order.
      */
      lowest: /* @__PURE__ */ prec(Prec_.lowest)
    };
    class PrecExtension {
      constructor(inner2, prec2) {
        this.inner = inner2;
        this.prec = prec2;
      }
    }
    class Compartment {
      /**
      Create an instance of this compartment to add to your [state
      configuration](https://codemirror.net/6/docs/ref/#state.EditorStateConfig.extensions).
      */
      of(ext) {
        return new CompartmentInstance(this, ext);
      }
      /**
      Create an [effect](https://codemirror.net/6/docs/ref/#state.TransactionSpec.effects) that
      reconfigures this compartment.
      */
      reconfigure(content2) {
        return Compartment.reconfigure.of({ compartment: this, extension: content2 });
      }
      /**
      Get the current content of the compartment in the state, or
      `undefined` if it isn't present.
      */
      get(state) {
        return state.config.compartments.get(this);
      }
    }
    class CompartmentInstance {
      constructor(compartment, inner2) {
        this.compartment = compartment;
        this.inner = inner2;
      }
    }
    class Configuration {
      constructor(base2, compartments, dynamicSlots, address, staticValues, facets) {
        this.base = base2;
        this.compartments = compartments;
        this.dynamicSlots = dynamicSlots;
        this.address = address;
        this.staticValues = staticValues;
        this.facets = facets;
        this.statusTemplate = [];
        while (this.statusTemplate.length < dynamicSlots.length)
          this.statusTemplate.push(
            0
            /* SlotStatus.Unresolved */
          );
      }
      staticFacet(facet) {
        let addr = this.address[facet.id];
        return addr == null ? facet.default : this.staticValues[addr >> 1];
      }
      static resolve(base2, compartments, oldState) {
        let fields = [];
        let facets = /* @__PURE__ */ Object.create(null);
        let newCompartments = /* @__PURE__ */ new Map();
        for (let ext of flatten(base2, compartments, newCompartments)) {
          if (ext instanceof StateField)
            fields.push(ext);
          else
            (facets[ext.facet.id] || (facets[ext.facet.id] = [])).push(ext);
        }
        let address = /* @__PURE__ */ Object.create(null);
        let staticValues = [];
        let dynamicSlots = [];
        for (let field of fields) {
          address[field.id] = dynamicSlots.length << 1;
          dynamicSlots.push((a) => field.slot(a));
        }
        let oldFacets = oldState === null || oldState === void 0 ? void 0 : oldState.config.facets;
        for (let id in facets) {
          let providers = facets[id], facet = providers[0].facet;
          let oldProviders = oldFacets && oldFacets[id] || [];
          if (providers.every(
            (p) => p.type == 0
            /* Provider.Static */
          )) {
            address[facet.id] = staticValues.length << 1 | 1;
            if (sameArray$5(oldProviders, providers)) {
              staticValues.push(oldState.facet(facet));
            } else {
              let value2 = facet.combine(providers.map((p) => p.value));
              staticValues.push(oldState && facet.compare(value2, oldState.facet(facet)) ? oldState.facet(facet) : value2);
            }
          } else {
            for (let p of providers) {
              if (p.type == 0) {
                address[p.id] = staticValues.length << 1 | 1;
                staticValues.push(p.value);
              } else {
                address[p.id] = dynamicSlots.length << 1;
                dynamicSlots.push((a) => p.dynamicSlot(a));
              }
            }
            address[facet.id] = dynamicSlots.length << 1;
            dynamicSlots.push((a) => dynamicFacetSlot(a, facet, providers));
          }
        }
        let dynamic = dynamicSlots.map((f) => f(address));
        return new Configuration(base2, newCompartments, dynamic, address, staticValues, facets);
      }
    }
    function flatten(extension, compartments, newCompartments) {
      let result2 = [[], [], [], [], []];
      let seen = /* @__PURE__ */ new Map();
      function inner2(ext, prec2) {
        let known = seen.get(ext);
        if (known != null) {
          if (known <= prec2)
            return;
          let found = result2[known].indexOf(ext);
          if (found > -1)
            result2[known].splice(found, 1);
          if (ext instanceof CompartmentInstance)
            newCompartments.delete(ext.compartment);
        }
        seen.set(ext, prec2);
        if (Array.isArray(ext)) {
          for (let e of ext)
            inner2(e, prec2);
        } else if (ext instanceof CompartmentInstance) {
          if (newCompartments.has(ext.compartment))
            throw new RangeError(`Duplicate use of compartment in extensions`);
          let content2 = compartments.get(ext.compartment) || ext.inner;
          newCompartments.set(ext.compartment, content2);
          inner2(content2, prec2);
        } else if (ext instanceof PrecExtension) {
          inner2(ext.inner, ext.prec);
        } else if (ext instanceof StateField) {
          result2[prec2].push(ext);
          if (ext.provides)
            inner2(ext.provides, prec2);
        } else if (ext instanceof FacetProvider) {
          result2[prec2].push(ext);
          if (ext.facet.extensions)
            inner2(ext.facet.extensions, Prec_.default);
        } else {
          let content2 = ext.extension;
          if (!content2)
            throw new Error(`Unrecognized extension value in extension set (${ext}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);
          inner2(content2, prec2);
        }
      }
      inner2(extension, Prec_.default);
      return result2.reduce((a, b) => a.concat(b));
    }
    function ensureAddr(state, addr) {
      if (addr & 1)
        return 2;
      let idx = addr >> 1;
      let status2 = state.status[idx];
      if (status2 == 4)
        throw new Error("Cyclic dependency between fields and/or facets");
      if (status2 & 2)
        return status2;
      state.status[idx] = 4;
      let changed = state.computeSlot(state, state.config.dynamicSlots[idx]);
      return state.status[idx] = 2 | changed;
    }
    function getAddr(state, addr) {
      return addr & 1 ? state.config.staticValues[addr >> 1] : state.values[addr >> 1];
    }
    const languageData = /* @__PURE__ */ Facet.define();
    const allowMultipleSelections = /* @__PURE__ */ Facet.define({
      combine: (values) => values.some((v) => v),
      static: true
    });
    const lineSeparator = /* @__PURE__ */ Facet.define({
      combine: (values) => values.length ? values[0] : void 0,
      static: true
    });
    const changeFilter = /* @__PURE__ */ Facet.define();
    const transactionFilter = /* @__PURE__ */ Facet.define();
    const transactionExtender = /* @__PURE__ */ Facet.define();
    const readOnly = /* @__PURE__ */ Facet.define({
      combine: (values) => values.length ? values[0] : false
    });
    class Annotation {
      /**
      @internal
      */
      constructor(type, value2) {
        this.type = type;
        this.value = value2;
      }
      /**
      Define a new type of annotation.
      */
      static define() {
        return new AnnotationType();
      }
    }
    class AnnotationType {
      /**
      Create an instance of this annotation.
      */
      of(value2) {
        return new Annotation(this, value2);
      }
    }
    class StateEffectType {
      /**
      @internal
      */
      constructor(map2) {
        this.map = map2;
      }
      /**
      Create a [state effect](https://codemirror.net/6/docs/ref/#state.StateEffect) instance of this
      type.
      */
      of(value2) {
        return new StateEffect(this, value2);
      }
    }
    class StateEffect {
      /**
      @internal
      */
      constructor(type, value2) {
        this.type = type;
        this.value = value2;
      }
      /**
      Map this effect through a position mapping. Will return
      `undefined` when that ends up deleting the effect.
      */
      map(mapping) {
        let mapped = this.type.map(this.value, mapping);
        return mapped === void 0 ? void 0 : mapped == this.value ? this : new StateEffect(this.type, mapped);
      }
      /**
      Tells you whether this effect object is of a given
      [type](https://codemirror.net/6/docs/ref/#state.StateEffectType).
      */
      is(type) {
        return this.type == type;
      }
      /**
      Define a new effect type. The type parameter indicates the type
      of values that his effect holds. It should be a type that
      doesn't include `undefined`, since that is used in
      [mapping](https://codemirror.net/6/docs/ref/#state.StateEffect.map) to indicate that an effect is
      removed.
      */
      static define(spec = {}) {
        return new StateEffectType(spec.map || ((v) => v));
      }
      /**
      Map an array of effects through a change set.
      */
      static mapEffects(effects, mapping) {
        if (!effects.length)
          return effects;
        let result2 = [];
        for (let effect2 of effects) {
          let mapped = effect2.map(mapping);
          if (mapped)
            result2.push(mapped);
        }
        return result2;
      }
    }
    StateEffect.reconfigure = /* @__PURE__ */ StateEffect.define();
    StateEffect.appendConfig = /* @__PURE__ */ StateEffect.define();
    class Transaction {
      constructor(startState, changes, selection, effects, annotations, scrollIntoView2) {
        this.startState = startState;
        this.changes = changes;
        this.selection = selection;
        this.effects = effects;
        this.annotations = annotations;
        this.scrollIntoView = scrollIntoView2;
        this._doc = null;
        this._state = null;
        if (selection)
          checkSelection(selection, changes.newLength);
        if (!annotations.some((a) => a.type == Transaction.time))
          this.annotations = annotations.concat(Transaction.time.of(Date.now()));
      }
      /**
      @internal
      */
      static create(startState, changes, selection, effects, annotations, scrollIntoView2) {
        return new Transaction(startState, changes, selection, effects, annotations, scrollIntoView2);
      }
      /**
      The new document produced by the transaction. Contrary to
      [`.state`](https://codemirror.net/6/docs/ref/#state.Transaction.state)`.doc`, accessing this won't
      force the entire new state to be computed right away, so it is
      recommended that [transaction
      filters](https://codemirror.net/6/docs/ref/#state.EditorState^transactionFilter) use this getter
      when they need to look at the new document.
      */
      get newDoc() {
        return this._doc || (this._doc = this.changes.apply(this.startState.doc));
      }
      /**
      The new selection produced by the transaction. If
      [`this.selection`](https://codemirror.net/6/docs/ref/#state.Transaction.selection) is undefined,
      this will [map](https://codemirror.net/6/docs/ref/#state.EditorSelection.map) the start state's
      current selection through the changes made by the transaction.
      */
      get newSelection() {
        return this.selection || this.startState.selection.map(this.changes);
      }
      /**
      The new state created by the transaction. Computed on demand
      (but retained for subsequent access), so it is recommended not to
      access it in [transaction
      filters](https://codemirror.net/6/docs/ref/#state.EditorState^transactionFilter) when possible.
      */
      get state() {
        if (!this._state)
          this.startState.applyTransaction(this);
        return this._state;
      }
      /**
      Get the value of the given annotation type, if any.
      */
      annotation(type) {
        for (let ann of this.annotations)
          if (ann.type == type)
            return ann.value;
        return void 0;
      }
      /**
      Indicates whether the transaction changed the document.
      */
      get docChanged() {
        return !this.changes.empty;
      }
      /**
      Indicates whether this transaction reconfigures the state
      (through a [configuration compartment](https://codemirror.net/6/docs/ref/#state.Compartment) or
      with a top-level configuration
      [effect](https://codemirror.net/6/docs/ref/#state.StateEffect^reconfigure).
      */
      get reconfigured() {
        return this.startState.config != this.state.config;
      }
      /**
      Returns true if the transaction has a [user
      event](https://codemirror.net/6/docs/ref/#state.Transaction^userEvent) annotation that is equal to
      or more specific than `event`. For example, if the transaction
      has `"select.pointer"` as user event, `"select"` and
      `"select.pointer"` will match it.
      */
      isUserEvent(event) {
        let e = this.annotation(Transaction.userEvent);
        return !!(e && (e == event || e.length > event.length && e.slice(0, event.length) == event && e[event.length] == "."));
      }
    }
    Transaction.time = /* @__PURE__ */ Annotation.define();
    Transaction.userEvent = /* @__PURE__ */ Annotation.define();
    Transaction.addToHistory = /* @__PURE__ */ Annotation.define();
    Transaction.remote = /* @__PURE__ */ Annotation.define();
    function joinRanges(a, b) {
      let result2 = [];
      for (let iA = 0, iB = 0; ; ) {
        let from, to2;
        if (iA < a.length && (iB == b.length || b[iB] >= a[iA])) {
          from = a[iA++];
          to2 = a[iA++];
        } else if (iB < b.length) {
          from = b[iB++];
          to2 = b[iB++];
        } else
          return result2;
        if (!result2.length || result2[result2.length - 1] < from)
          result2.push(from, to2);
        else if (result2[result2.length - 1] < to2)
          result2[result2.length - 1] = to2;
      }
    }
    function mergeTransaction(a, b, sequential) {
      var _a2;
      let mapForA, mapForB, changes;
      if (sequential) {
        mapForA = b.changes;
        mapForB = ChangeSet.empty(b.changes.length);
        changes = a.changes.compose(b.changes);
      } else {
        mapForA = b.changes.map(a.changes);
        mapForB = a.changes.mapDesc(b.changes, true);
        changes = a.changes.compose(mapForA);
      }
      return {
        changes,
        selection: b.selection ? b.selection.map(mapForB) : (_a2 = a.selection) === null || _a2 === void 0 ? void 0 : _a2.map(mapForA),
        effects: StateEffect.mapEffects(a.effects, mapForA).concat(StateEffect.mapEffects(b.effects, mapForB)),
        annotations: a.annotations.length ? a.annotations.concat(b.annotations) : b.annotations,
        scrollIntoView: a.scrollIntoView || b.scrollIntoView
      };
    }
    function resolveTransactionInner(state, spec, docSize) {
      let sel = spec.selection, annotations = asArray(spec.annotations);
      if (spec.userEvent)
        annotations = annotations.concat(Transaction.userEvent.of(spec.userEvent));
      return {
        changes: spec.changes instanceof ChangeSet ? spec.changes : ChangeSet.of(spec.changes || [], docSize, state.facet(lineSeparator)),
        selection: sel && (sel instanceof EditorSelection ? sel : EditorSelection.single(sel.anchor, sel.head)),
        effects: asArray(spec.effects),
        annotations,
        scrollIntoView: !!spec.scrollIntoView
      };
    }
    function resolveTransaction(state, specs, filter) {
      let s = resolveTransactionInner(state, specs.length ? specs[0] : {}, state.doc.length);
      if (specs.length && specs[0].filter === false)
        filter = false;
      for (let i2 = 1; i2 < specs.length; i2++) {
        if (specs[i2].filter === false)
          filter = false;
        let seq = !!specs[i2].sequential;
        s = mergeTransaction(s, resolveTransactionInner(state, specs[i2], seq ? s.changes.newLength : state.doc.length), seq);
      }
      let tr2 = Transaction.create(state, s.changes, s.selection, s.effects, s.annotations, s.scrollIntoView);
      return extendTransaction(filter ? filterTransaction(tr2) : tr2);
    }
    function filterTransaction(tr2) {
      let state = tr2.startState;
      let result2 = true;
      for (let filter of state.facet(changeFilter)) {
        let value2 = filter(tr2);
        if (value2 === false) {
          result2 = false;
          break;
        }
        if (Array.isArray(value2))
          result2 = result2 === true ? value2 : joinRanges(result2, value2);
      }
      if (result2 !== true) {
        let changes, back;
        if (result2 === false) {
          back = tr2.changes.invertedDesc;
          changes = ChangeSet.empty(state.doc.length);
        } else {
          let filtered = tr2.changes.filter(result2);
          changes = filtered.changes;
          back = filtered.filtered.mapDesc(filtered.changes).invertedDesc;
        }
        tr2 = Transaction.create(state, changes, tr2.selection && tr2.selection.map(back), StateEffect.mapEffects(tr2.effects, back), tr2.annotations, tr2.scrollIntoView);
      }
      let filters2 = state.facet(transactionFilter);
      for (let i2 = filters2.length - 1; i2 >= 0; i2--) {
        let filtered = filters2[i2](tr2);
        if (filtered instanceof Transaction)
          tr2 = filtered;
        else if (Array.isArray(filtered) && filtered.length == 1 && filtered[0] instanceof Transaction)
          tr2 = filtered[0];
        else
          tr2 = resolveTransaction(state, asArray(filtered), false);
      }
      return tr2;
    }
    function extendTransaction(tr2) {
      let state = tr2.startState, extenders = state.facet(transactionExtender), spec = tr2;
      for (let i2 = extenders.length - 1; i2 >= 0; i2--) {
        let extension = extenders[i2](tr2);
        if (extension && Object.keys(extension).length)
          spec = mergeTransaction(spec, resolveTransactionInner(state, extension, tr2.changes.newLength), true);
      }
      return spec == tr2 ? tr2 : Transaction.create(state, tr2.changes, tr2.selection, spec.effects, spec.annotations, spec.scrollIntoView);
    }
    const none$2 = [];
    function asArray(value2) {
      return value2 == null ? none$2 : Array.isArray(value2) ? value2 : [value2];
    }
    var CharCategory = /* @__PURE__ */ (function(CharCategory2) {
      CharCategory2[CharCategory2["Word"] = 0] = "Word";
      CharCategory2[CharCategory2["Space"] = 1] = "Space";
      CharCategory2[CharCategory2["Other"] = 2] = "Other";
      return CharCategory2;
    })(CharCategory || (CharCategory = {}));
    const nonASCIISingleCaseWordChar = /[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;
    let wordChar;
    try {
      wordChar = /* @__PURE__ */ new RegExp("[\\p{Alphabetic}\\p{Number}_]", "u");
    } catch (_) {
    }
    function hasWordChar(str2) {
      if (wordChar)
        return wordChar.test(str2);
      for (let i2 = 0; i2 < str2.length; i2++) {
        let ch3 = str2[i2];
        if (/\w/.test(ch3) || ch3 > "" && (ch3.toUpperCase() != ch3.toLowerCase() || nonASCIISingleCaseWordChar.test(ch3)))
          return true;
      }
      return false;
    }
    function makeCategorizer(wordChars) {
      return (char) => {
        if (!/\S/.test(char))
          return CharCategory.Space;
        if (hasWordChar(char))
          return CharCategory.Word;
        for (let i2 = 0; i2 < wordChars.length; i2++)
          if (char.indexOf(wordChars[i2]) > -1)
            return CharCategory.Word;
        return CharCategory.Other;
      };
    }
    class EditorState {
      constructor(config2, doc2, selection, values, computeSlot, tr2) {
        this.config = config2;
        this.doc = doc2;
        this.selection = selection;
        this.values = values;
        this.status = config2.statusTemplate.slice();
        this.computeSlot = computeSlot;
        if (tr2)
          tr2._state = this;
        for (let i2 = 0; i2 < this.config.dynamicSlots.length; i2++)
          ensureAddr(this, i2 << 1);
        this.computeSlot = null;
      }
      field(field, require2 = true) {
        let addr = this.config.address[field.id];
        if (addr == null) {
          if (require2)
            throw new RangeError("Field is not present in this state");
          return void 0;
        }
        ensureAddr(this, addr);
        return getAddr(this, addr);
      }
      /**
      Create a [transaction](https://codemirror.net/6/docs/ref/#state.Transaction) that updates this
      state. Any number of [transaction specs](https://codemirror.net/6/docs/ref/#state.TransactionSpec)
      can be passed. Unless
      [`sequential`](https://codemirror.net/6/docs/ref/#state.TransactionSpec.sequential) is set, the
      [changes](https://codemirror.net/6/docs/ref/#state.TransactionSpec.changes) (if any) of each spec
      are assumed to start in the _current_ document (not the document
      produced by previous specs), and its
      [selection](https://codemirror.net/6/docs/ref/#state.TransactionSpec.selection) and
      [effects](https://codemirror.net/6/docs/ref/#state.TransactionSpec.effects) are assumed to refer
      to the document created by its _own_ changes. The resulting
      transaction contains the combined effect of all the different
      specs. For [selection](https://codemirror.net/6/docs/ref/#state.TransactionSpec.selection), later
      specs take precedence over earlier ones.
      */
      update(...specs) {
        return resolveTransaction(this, specs, true);
      }
      /**
      @internal
      */
      applyTransaction(tr2) {
        let conf = this.config, { base: base2, compartments } = conf;
        for (let effect2 of tr2.effects) {
          if (effect2.is(Compartment.reconfigure)) {
            if (conf) {
              compartments = /* @__PURE__ */ new Map();
              conf.compartments.forEach((val, key2) => compartments.set(key2, val));
              conf = null;
            }
            compartments.set(effect2.value.compartment, effect2.value.extension);
          } else if (effect2.is(StateEffect.reconfigure)) {
            conf = null;
            base2 = effect2.value;
          } else if (effect2.is(StateEffect.appendConfig)) {
            conf = null;
            base2 = asArray(base2).concat(effect2.value);
          }
        }
        let startValues;
        if (!conf) {
          conf = Configuration.resolve(base2, compartments, this);
          let intermediateState = new EditorState(conf, this.doc, this.selection, conf.dynamicSlots.map(() => null), (state, slot) => slot.reconfigure(state, this), null);
          startValues = intermediateState.values;
        } else {
          startValues = tr2.startState.values.slice();
        }
        let selection = tr2.startState.facet(allowMultipleSelections) ? tr2.newSelection : tr2.newSelection.asSingle();
        new EditorState(conf, tr2.newDoc, selection, startValues, (state, slot) => slot.update(state, tr2), tr2);
      }
      /**
      Create a [transaction spec](https://codemirror.net/6/docs/ref/#state.TransactionSpec) that
      replaces every selection range with the given content.
      */
      replaceSelection(text2) {
        if (typeof text2 == "string")
          text2 = this.toText(text2);
        return this.changeByRange((range2) => ({
          changes: { from: range2.from, to: range2.to, insert: text2 },
          range: EditorSelection.cursor(range2.from + text2.length)
        }));
      }
      /**
      Create a set of changes and a new selection by running the given
      function for each range in the active selection. The function
      can return an optional set of changes (in the coordinate space
      of the start document), plus an updated range (in the coordinate
      space of the document produced by the call's own changes). This
      method will merge all the changes and ranges into a single
      changeset and selection, and return it as a [transaction
      spec](https://codemirror.net/6/docs/ref/#state.TransactionSpec), which can be passed to
      [`update`](https://codemirror.net/6/docs/ref/#state.EditorState.update).
      */
      changeByRange(f) {
        let sel = this.selection;
        let result1 = f(sel.ranges[0]);
        let changes = this.changes(result1.changes), ranges = [result1.range];
        let effects = asArray(result1.effects);
        for (let i2 = 1; i2 < sel.ranges.length; i2++) {
          let result2 = f(sel.ranges[i2]);
          let newChanges = this.changes(result2.changes), newMapped = newChanges.map(changes);
          for (let j = 0; j < i2; j++)
            ranges[j] = ranges[j].map(newMapped);
          let mapBy = changes.mapDesc(newChanges, true);
          ranges.push(result2.range.map(mapBy));
          changes = changes.compose(newMapped);
          effects = StateEffect.mapEffects(effects, newMapped).concat(StateEffect.mapEffects(asArray(result2.effects), mapBy));
        }
        return {
          changes,
          selection: EditorSelection.create(ranges, sel.mainIndex),
          effects
        };
      }
      /**
      Create a [change set](https://codemirror.net/6/docs/ref/#state.ChangeSet) from the given change
      description, taking the state's document length and line
      separator into account.
      */
      changes(spec = []) {
        if (spec instanceof ChangeSet)
          return spec;
        return ChangeSet.of(spec, this.doc.length, this.facet(EditorState.lineSeparator));
      }
      /**
      Using the state's [line
      separator](https://codemirror.net/6/docs/ref/#state.EditorState^lineSeparator), create a
      [`Text`](https://codemirror.net/6/docs/ref/#state.Text) instance from the given string.
      */
      toText(string2) {
        return Text.of(string2.split(this.facet(EditorState.lineSeparator) || DefaultSplit));
      }
      /**
      Return the given range of the document as a string.
      */
      sliceDoc(from = 0, to2 = this.doc.length) {
        return this.doc.sliceString(from, to2, this.lineBreak);
      }
      /**
      Get the value of a state [facet](https://codemirror.net/6/docs/ref/#state.Facet).
      */
      facet(facet) {
        let addr = this.config.address[facet.id];
        if (addr == null)
          return facet.default;
        ensureAddr(this, addr);
        return getAddr(this, addr);
      }
      /**
      Convert this state to a JSON-serializable object. When custom
      fields should be serialized, you can pass them in as an object
      mapping property names (in the resulting object, which should
      not use `doc` or `selection`) to fields.
      */
      toJSON(fields) {
        let result2 = {
          doc: this.sliceDoc(),
          selection: this.selection.toJSON()
        };
        if (fields)
          for (let prop2 in fields) {
            let value2 = fields[prop2];
            if (value2 instanceof StateField && this.config.address[value2.id] != null)
              result2[prop2] = value2.spec.toJSON(this.field(fields[prop2]), this);
          }
        return result2;
      }
      /**
      Deserialize a state from its JSON representation. When custom
      fields should be deserialized, pass the same object you passed
      to [`toJSON`](https://codemirror.net/6/docs/ref/#state.EditorState.toJSON) when serializing as
      third argument.
      */
      static fromJSON(json, config2 = {}, fields) {
        if (!json || typeof json.doc != "string")
          throw new RangeError("Invalid JSON representation for EditorState");
        let fieldInit = [];
        if (fields)
          for (let prop2 in fields) {
            if (Object.prototype.hasOwnProperty.call(json, prop2)) {
              let field = fields[prop2], value2 = json[prop2];
              fieldInit.push(field.init((state) => field.spec.fromJSON(value2, state)));
            }
          }
        return EditorState.create({
          doc: json.doc,
          selection: EditorSelection.fromJSON(json.selection),
          extensions: config2.extensions ? fieldInit.concat([config2.extensions]) : fieldInit
        });
      }
      /**
      Create a new state. You'll usually only need this when
      initializing an editor—updated states are created by applying
      transactions.
      */
      static create(config2 = {}) {
        let configuration = Configuration.resolve(config2.extensions || [], /* @__PURE__ */ new Map());
        let doc2 = config2.doc instanceof Text ? config2.doc : Text.of((config2.doc || "").split(configuration.staticFacet(EditorState.lineSeparator) || DefaultSplit));
        let selection = !config2.selection ? EditorSelection.single(0) : config2.selection instanceof EditorSelection ? config2.selection : EditorSelection.single(config2.selection.anchor, config2.selection.head);
        checkSelection(selection, doc2.length);
        if (!configuration.staticFacet(allowMultipleSelections))
          selection = selection.asSingle();
        return new EditorState(configuration, doc2, selection, configuration.dynamicSlots.map(() => null), (state, slot) => slot.create(state), null);
      }
      /**
      The size (in columns) of a tab in the document, determined by
      the [`tabSize`](https://codemirror.net/6/docs/ref/#state.EditorState^tabSize) facet.
      */
      get tabSize() {
        return this.facet(EditorState.tabSize);
      }
      /**
      Get the proper [line-break](https://codemirror.net/6/docs/ref/#state.EditorState^lineSeparator)
      string for this state.
      */
      get lineBreak() {
        return this.facet(EditorState.lineSeparator) || "\n";
      }
      /**
      Returns true when the editor is
      [configured](https://codemirror.net/6/docs/ref/#state.EditorState^readOnly) to be read-only.
      */
      get readOnly() {
        return this.facet(readOnly);
      }
      /**
      Look up a translation for the given phrase (via the
      [`phrases`](https://codemirror.net/6/docs/ref/#state.EditorState^phrases) facet), or return the
      original string if no translation is found.
      
      If additional arguments are passed, they will be inserted in
      place of markers like `$1` (for the first value) and `$2`, etc.
      A single `$` is equivalent to `$1`, and `$$` will produce a
      literal dollar sign.
      */
      phrase(phrase, ...insert2) {
        for (let map2 of this.facet(EditorState.phrases))
          if (Object.prototype.hasOwnProperty.call(map2, phrase)) {
            phrase = map2[phrase];
            break;
          }
        if (insert2.length)
          phrase = phrase.replace(/\$(\$|\d*)/g, (m, i2) => {
            if (i2 == "$")
              return "$";
            let n = +(i2 || 1);
            return !n || n > insert2.length ? m : insert2[n - 1];
          });
        return phrase;
      }
      /**
      Find the values for a given language data field, provided by the
      the [`languageData`](https://codemirror.net/6/docs/ref/#state.EditorState^languageData) facet.
      
      Examples of language data fields are...
      
      - [`"commentTokens"`](https://codemirror.net/6/docs/ref/#commands.CommentTokens) for specifying
        comment syntax.
      - [`"autocomplete"`](https://codemirror.net/6/docs/ref/#autocomplete.autocompletion^config.override)
        for providing language-specific completion sources.
      - [`"wordChars"`](https://codemirror.net/6/docs/ref/#state.EditorState.charCategorizer) for adding
        characters that should be considered part of words in this
        language.
      - [`"closeBrackets"`](https://codemirror.net/6/docs/ref/#autocomplete.CloseBracketConfig) controls
        bracket closing behavior.
      */
      languageDataAt(name2, pos2, side = -1) {
        let values = [];
        for (let provider of this.facet(languageData)) {
          for (let result2 of provider(this, pos2, side)) {
            if (Object.prototype.hasOwnProperty.call(result2, name2))
              values.push(result2[name2]);
          }
        }
        return values;
      }
      /**
      Return a function that can categorize strings (expected to
      represent a single [grapheme cluster](https://codemirror.net/6/docs/ref/#state.findClusterBreak))
      into one of:
      
       - Word (contains an alphanumeric character or a character
         explicitly listed in the local language's `"wordChars"`
         language data, which should be a string)
       - Space (contains only whitespace)
       - Other (anything else)
      */
      charCategorizer(at) {
        return makeCategorizer(this.languageDataAt("wordChars", at).join(""));
      }
      /**
      Find the word at the given position, meaning the range
      containing all [word](https://codemirror.net/6/docs/ref/#state.CharCategory.Word) characters
      around it. If no word characters are adjacent to the position,
      this returns null.
      */
      wordAt(pos2) {
        let { text: text2, from, length } = this.doc.lineAt(pos2);
        let cat = this.charCategorizer(pos2);
        let start2 = pos2 - from, end2 = pos2 - from;
        while (start2 > 0) {
          let prev = findClusterBreak(text2, start2, false);
          if (cat(text2.slice(prev, start2)) != CharCategory.Word)
            break;
          start2 = prev;
        }
        while (end2 < length) {
          let next = findClusterBreak(text2, end2);
          if (cat(text2.slice(end2, next)) != CharCategory.Word)
            break;
          end2 = next;
        }
        return start2 == end2 ? null : EditorSelection.range(start2 + from, end2 + from);
      }
    }
    EditorState.allowMultipleSelections = allowMultipleSelections;
    EditorState.tabSize = /* @__PURE__ */ Facet.define({
      combine: (values) => values.length ? values[0] : 4
    });
    EditorState.lineSeparator = lineSeparator;
    EditorState.readOnly = readOnly;
    EditorState.phrases = /* @__PURE__ */ Facet.define({
      compare(a, b) {
        let kA = Object.keys(a), kB = Object.keys(b);
        return kA.length == kB.length && kA.every((k2) => a[k2] == b[k2]);
      }
    });
    EditorState.languageData = languageData;
    EditorState.changeFilter = changeFilter;
    EditorState.transactionFilter = transactionFilter;
    EditorState.transactionExtender = transactionExtender;
    Compartment.reconfigure = /* @__PURE__ */ StateEffect.define();
    function combineConfig(configs, defaults, combine = {}) {
      let result2 = {};
      for (let config2 of configs)
        for (let key2 of Object.keys(config2)) {
          let value2 = config2[key2], current2 = result2[key2];
          if (current2 === void 0)
            result2[key2] = value2;
          else if (current2 === value2 || value2 === void 0) ;
          else if (Object.hasOwnProperty.call(combine, key2))
            result2[key2] = combine[key2](current2, value2);
          else
            throw new Error("Config merge conflict for field " + key2);
        }
      for (let key2 in defaults)
        if (result2[key2] === void 0)
          result2[key2] = defaults[key2];
      return result2;
    }
    class RangeValue {
      /**
      Compare this value with another value. Used when comparing
      rangesets. The default implementation compares by identity.
      Unless you are only creating a fixed number of unique instances
      of your value type, it is a good idea to implement this
      properly.
      */
      eq(other) {
        return this == other;
      }
      /**
      Create a [range](https://codemirror.net/6/docs/ref/#state.Range) with this value.
      */
      range(from, to2 = from) {
        return Range$1.create(from, to2, this);
      }
    }
    RangeValue.prototype.startSide = RangeValue.prototype.endSide = 0;
    RangeValue.prototype.point = false;
    RangeValue.prototype.mapMode = MapMode.TrackDel;
    let Range$1 = class Range2 {
      constructor(from, to2, value2) {
        this.from = from;
        this.to = to2;
        this.value = value2;
      }
      /**
      @internal
      */
      static create(from, to2, value2) {
        return new Range2(from, to2, value2);
      }
    };
    function cmpRange(a, b) {
      return a.from - b.from || a.value.startSide - b.value.startSide;
    }
    class Chunk {
      constructor(from, to2, value2, maxPoint) {
        this.from = from;
        this.to = to2;
        this.value = value2;
        this.maxPoint = maxPoint;
      }
      get length() {
        return this.to[this.to.length - 1];
      }
      // Find the index of the given position and side. Use the ranges'
      // `from` pos when `end == false`, `to` when `end == true`.
      findIndex(pos2, side, end2, startAt = 0) {
        let arr2 = end2 ? this.to : this.from;
        for (let lo2 = startAt, hi = arr2.length; ; ) {
          if (lo2 == hi)
            return lo2;
          let mid2 = lo2 + hi >> 1;
          let diff2 = arr2[mid2] - pos2 || (end2 ? this.value[mid2].endSide : this.value[mid2].startSide) - side;
          if (mid2 == lo2)
            return diff2 >= 0 ? lo2 : hi;
          if (diff2 >= 0)
            hi = mid2;
          else
            lo2 = mid2 + 1;
        }
      }
      between(offset2, from, to2, f) {
        for (let i2 = this.findIndex(from, -1e9, true), e = this.findIndex(to2, 1e9, false, i2); i2 < e; i2++)
          if (f(this.from[i2] + offset2, this.to[i2] + offset2, this.value[i2]) === false)
            return false;
      }
      map(offset2, changes) {
        let value2 = [], from = [], to2 = [], newPos = -1, maxPoint = -1;
        for (let i2 = 0; i2 < this.value.length; i2++) {
          let val = this.value[i2], curFrom = this.from[i2] + offset2, curTo = this.to[i2] + offset2, newFrom, newTo;
          if (curFrom == curTo) {
            let mapped = changes.mapPos(curFrom, val.startSide, val.mapMode);
            if (mapped == null)
              continue;
            newFrom = newTo = mapped;
            if (val.startSide != val.endSide) {
              newTo = changes.mapPos(curFrom, val.endSide);
              if (newTo < newFrom)
                continue;
            }
          } else {
            newFrom = changes.mapPos(curFrom, val.startSide);
            newTo = changes.mapPos(curTo, val.endSide);
            if (newFrom > newTo || newFrom == newTo && val.startSide > 0 && val.endSide <= 0)
              continue;
          }
          if ((newTo - newFrom || val.endSide - val.startSide) < 0)
            continue;
          if (newPos < 0)
            newPos = newFrom;
          if (val.point)
            maxPoint = Math.max(maxPoint, newTo - newFrom);
          value2.push(val);
          from.push(newFrom - newPos);
          to2.push(newTo - newPos);
        }
        return { mapped: value2.length ? new Chunk(from, to2, value2, maxPoint) : null, pos: newPos };
      }
    }
    class RangeSet {
      constructor(chunkPos, chunk, nextLayer, maxPoint) {
        this.chunkPos = chunkPos;
        this.chunk = chunk;
        this.nextLayer = nextLayer;
        this.maxPoint = maxPoint;
      }
      /**
      @internal
      */
      static create(chunkPos, chunk, nextLayer, maxPoint) {
        return new RangeSet(chunkPos, chunk, nextLayer, maxPoint);
      }
      /**
      @internal
      */
      get length() {
        let last = this.chunk.length - 1;
        return last < 0 ? 0 : Math.max(this.chunkEnd(last), this.nextLayer.length);
      }
      /**
      The number of ranges in the set.
      */
      get size() {
        if (this.isEmpty)
          return 0;
        let size = this.nextLayer.size;
        for (let chunk of this.chunk)
          size += chunk.value.length;
        return size;
      }
      /**
      @internal
      */
      chunkEnd(index) {
        return this.chunkPos[index] + this.chunk[index].length;
      }
      /**
      Update the range set, optionally adding new ranges or filtering
      out existing ones.
      
      (Note: The type parameter is just there as a kludge to work
      around TypeScript variance issues that prevented `RangeSet<X>`
      from being a subtype of `RangeSet<Y>` when `X` is a subtype of
      `Y`.)
      */
      update(updateSpec) {
        let { add: add2 = [], sort: sort2 = false, filterFrom = 0, filterTo = this.length } = updateSpec;
        let filter = updateSpec.filter;
        if (add2.length == 0 && !filter)
          return this;
        if (sort2)
          add2 = add2.slice().sort(cmpRange);
        if (this.isEmpty)
          return add2.length ? RangeSet.of(add2) : this;
        let cur2 = new LayerCursor(this, null, -1).goto(0), i2 = 0, spill = [];
        let builder = new RangeSetBuilder();
        while (cur2.value || i2 < add2.length) {
          if (i2 < add2.length && (cur2.from - add2[i2].from || cur2.startSide - add2[i2].value.startSide) >= 0) {
            let range2 = add2[i2++];
            if (!builder.addInner(range2.from, range2.to, range2.value))
              spill.push(range2);
          } else if (cur2.rangeIndex == 1 && cur2.chunkIndex < this.chunk.length && (i2 == add2.length || this.chunkEnd(cur2.chunkIndex) < add2[i2].from) && (!filter || filterFrom > this.chunkEnd(cur2.chunkIndex) || filterTo < this.chunkPos[cur2.chunkIndex]) && builder.addChunk(this.chunkPos[cur2.chunkIndex], this.chunk[cur2.chunkIndex])) {
            cur2.nextChunk();
          } else {
            if (!filter || filterFrom > cur2.to || filterTo < cur2.from || filter(cur2.from, cur2.to, cur2.value)) {
              if (!builder.addInner(cur2.from, cur2.to, cur2.value))
                spill.push(Range$1.create(cur2.from, cur2.to, cur2.value));
            }
            cur2.next();
          }
        }
        return builder.finishInner(this.nextLayer.isEmpty && !spill.length ? RangeSet.empty : this.nextLayer.update({ add: spill, filter, filterFrom, filterTo }));
      }
      /**
      Map this range set through a set of changes, return the new set.
      */
      map(changes) {
        if (changes.empty || this.isEmpty)
          return this;
        let chunks = [], chunkPos = [], maxPoint = -1;
        for (let i2 = 0; i2 < this.chunk.length; i2++) {
          let start2 = this.chunkPos[i2], chunk = this.chunk[i2];
          let touch = changes.touchesRange(start2, start2 + chunk.length);
          if (touch === false) {
            maxPoint = Math.max(maxPoint, chunk.maxPoint);
            chunks.push(chunk);
            chunkPos.push(changes.mapPos(start2));
          } else if (touch === true) {
            let { mapped, pos: pos2 } = chunk.map(start2, changes);
            if (mapped) {
              maxPoint = Math.max(maxPoint, mapped.maxPoint);
              chunks.push(mapped);
              chunkPos.push(pos2);
            }
          }
        }
        let next = this.nextLayer.map(changes);
        return chunks.length == 0 ? next : new RangeSet(chunkPos, chunks, next || RangeSet.empty, maxPoint);
      }
      /**
      Iterate over the ranges that touch the region `from` to `to`,
      calling `f` for each. There is no guarantee that the ranges will
      be reported in any specific order. When the callback returns
      `false`, iteration stops.
      */
      between(from, to2, f) {
        if (this.isEmpty)
          return;
        for (let i2 = 0; i2 < this.chunk.length; i2++) {
          let start2 = this.chunkPos[i2], chunk = this.chunk[i2];
          if (to2 >= start2 && from <= start2 + chunk.length && chunk.between(start2, from - start2, to2 - start2, f) === false)
            return;
        }
        this.nextLayer.between(from, to2, f);
      }
      /**
      Iterate over the ranges in this set, in order, including all
      ranges that end at or after `from`.
      */
      iter(from = 0) {
        return HeapCursor.from([this]).goto(from);
      }
      /**
      @internal
      */
      get isEmpty() {
        return this.nextLayer == this;
      }
      /**
      Iterate over the ranges in a collection of sets, in order,
      starting from `from`.
      */
      static iter(sets, from = 0) {
        return HeapCursor.from(sets).goto(from);
      }
      /**
      Iterate over two groups of sets, calling methods on `comparator`
      to notify it of possible differences.
      */
      static compare(oldSets, newSets, textDiff, comparator, minPointSize = -1) {
        let a = oldSets.filter((set2) => set2.maxPoint > 0 || !set2.isEmpty && set2.maxPoint >= minPointSize);
        let b = newSets.filter((set2) => set2.maxPoint > 0 || !set2.isEmpty && set2.maxPoint >= minPointSize);
        let sharedChunks = findSharedChunks(a, b, textDiff);
        let sideA = new SpanCursor(a, sharedChunks, minPointSize);
        let sideB = new SpanCursor(b, sharedChunks, minPointSize);
        textDiff.iterGaps((fromA, fromB, length) => compare(sideA, fromA, sideB, fromB, length, comparator));
        if (textDiff.empty && textDiff.length == 0)
          compare(sideA, 0, sideB, 0, 0, comparator);
      }
      /**
      Compare the contents of two groups of range sets, returning true
      if they are equivalent in the given range.
      */
      static eq(oldSets, newSets, from = 0, to2) {
        if (to2 == null)
          to2 = 1e9 - 1;
        let a = oldSets.filter((set2) => !set2.isEmpty && newSets.indexOf(set2) < 0);
        let b = newSets.filter((set2) => !set2.isEmpty && oldSets.indexOf(set2) < 0);
        if (a.length != b.length)
          return false;
        if (!a.length)
          return true;
        let sharedChunks = findSharedChunks(a, b);
        let sideA = new SpanCursor(a, sharedChunks, 0).goto(from), sideB = new SpanCursor(b, sharedChunks, 0).goto(from);
        for (; ; ) {
          if (sideA.to != sideB.to || !sameValues(sideA.active, sideB.active) || sideA.point && (!sideB.point || !sideA.point.eq(sideB.point)))
            return false;
          if (sideA.to > to2)
            return true;
          sideA.next();
          sideB.next();
        }
      }
      /**
      Iterate over a group of range sets at the same time, notifying
      the iterator about the ranges covering every given piece of
      content. Returns the open count (see
      [`SpanIterator.span`](https://codemirror.net/6/docs/ref/#state.SpanIterator.span)) at the end
      of the iteration.
      */
      static spans(sets, from, to2, iterator, minPointSize = -1) {
        let cursor = new SpanCursor(sets, null, minPointSize).goto(from), pos2 = from;
        let openRanges = cursor.openStart;
        for (; ; ) {
          let curTo = Math.min(cursor.to, to2);
          if (cursor.point) {
            let active = cursor.activeForPoint(cursor.to);
            let openCount = cursor.pointFrom < from ? active.length + 1 : cursor.point.startSide < 0 ? active.length : Math.min(active.length, openRanges);
            iterator.point(pos2, curTo, cursor.point, active, openCount, cursor.pointRank);
            openRanges = Math.min(cursor.openEnd(curTo), active.length);
          } else if (curTo > pos2) {
            iterator.span(pos2, curTo, cursor.active, openRanges);
            openRanges = cursor.openEnd(curTo);
          }
          if (cursor.to > to2)
            return openRanges + (cursor.point && cursor.to > to2 ? 1 : 0);
          pos2 = cursor.to;
          cursor.next();
        }
      }
      /**
      Create a range set for the given range or array of ranges. By
      default, this expects the ranges to be _sorted_ (by start
      position and, if two start at the same position,
      `value.startSide`). You can pass `true` as second argument to
      cause the method to sort them.
      */
      static of(ranges, sort2 = false) {
        let build = new RangeSetBuilder();
        for (let range2 of ranges instanceof Range$1 ? [ranges] : sort2 ? lazySort(ranges) : ranges)
          build.add(range2.from, range2.to, range2.value);
        return build.finish();
      }
      /**
      Join an array of range sets into a single set.
      */
      static join(sets) {
        if (!sets.length)
          return RangeSet.empty;
        let result2 = sets[sets.length - 1];
        for (let i2 = sets.length - 2; i2 >= 0; i2--) {
          for (let layer2 = sets[i2]; layer2 != RangeSet.empty; layer2 = layer2.nextLayer)
            result2 = new RangeSet(layer2.chunkPos, layer2.chunk, result2, Math.max(layer2.maxPoint, result2.maxPoint));
        }
        return result2;
      }
    }
    RangeSet.empty = /* @__PURE__ */ new RangeSet([], [], null, -1);
    function lazySort(ranges) {
      if (ranges.length > 1)
        for (let prev = ranges[0], i2 = 1; i2 < ranges.length; i2++) {
          let cur2 = ranges[i2];
          if (cmpRange(prev, cur2) > 0)
            return ranges.slice().sort(cmpRange);
          prev = cur2;
        }
      return ranges;
    }
    RangeSet.empty.nextLayer = RangeSet.empty;
    class RangeSetBuilder {
      finishChunk(newArrays) {
        this.chunks.push(new Chunk(this.from, this.to, this.value, this.maxPoint));
        this.chunkPos.push(this.chunkStart);
        this.chunkStart = -1;
        this.setMaxPoint = Math.max(this.setMaxPoint, this.maxPoint);
        this.maxPoint = -1;
        if (newArrays) {
          this.from = [];
          this.to = [];
          this.value = [];
        }
      }
      /**
      Create an empty builder.
      */
      constructor() {
        this.chunks = [];
        this.chunkPos = [];
        this.chunkStart = -1;
        this.last = null;
        this.lastFrom = -1e9;
        this.lastTo = -1e9;
        this.from = [];
        this.to = [];
        this.value = [];
        this.maxPoint = -1;
        this.setMaxPoint = -1;
        this.nextLayer = null;
      }
      /**
      Add a range. Ranges should be added in sorted (by `from` and
      `value.startSide`) order.
      */
      add(from, to2, value2) {
        if (!this.addInner(from, to2, value2))
          (this.nextLayer || (this.nextLayer = new RangeSetBuilder())).add(from, to2, value2);
      }
      /**
      @internal
      */
      addInner(from, to2, value2) {
        let diff2 = from - this.lastTo || value2.startSide - this.last.endSide;
        if (diff2 <= 0 && (from - this.lastFrom || value2.startSide - this.last.startSide) < 0)
          throw new Error("Ranges must be added sorted by `from` position and `startSide`");
        if (diff2 < 0)
          return false;
        if (this.from.length == 250)
          this.finishChunk(true);
        if (this.chunkStart < 0)
          this.chunkStart = from;
        this.from.push(from - this.chunkStart);
        this.to.push(to2 - this.chunkStart);
        this.last = value2;
        this.lastFrom = from;
        this.lastTo = to2;
        this.value.push(value2);
        if (value2.point)
          this.maxPoint = Math.max(this.maxPoint, to2 - from);
        return true;
      }
      /**
      @internal
      */
      addChunk(from, chunk) {
        if ((from - this.lastTo || chunk.value[0].startSide - this.last.endSide) < 0)
          return false;
        if (this.from.length)
          this.finishChunk(true);
        this.setMaxPoint = Math.max(this.setMaxPoint, chunk.maxPoint);
        this.chunks.push(chunk);
        this.chunkPos.push(from);
        let last = chunk.value.length - 1;
        this.last = chunk.value[last];
        this.lastFrom = chunk.from[last] + from;
        this.lastTo = chunk.to[last] + from;
        return true;
      }
      /**
      Finish the range set. Returns the new set. The builder can't be
      used anymore after this has been called.
      */
      finish() {
        return this.finishInner(RangeSet.empty);
      }
      /**
      @internal
      */
      finishInner(next) {
        if (this.from.length)
          this.finishChunk(false);
        if (this.chunks.length == 0)
          return next;
        let result2 = RangeSet.create(this.chunkPos, this.chunks, this.nextLayer ? this.nextLayer.finishInner(next) : next, this.setMaxPoint);
        this.from = null;
        return result2;
      }
    }
    function findSharedChunks(a, b, textDiff) {
      let inA = /* @__PURE__ */ new Map();
      for (let set2 of a)
        for (let i2 = 0; i2 < set2.chunk.length; i2++)
          if (set2.chunk[i2].maxPoint <= 0)
            inA.set(set2.chunk[i2], set2.chunkPos[i2]);
      let shared = /* @__PURE__ */ new Set();
      for (let set2 of b)
        for (let i2 = 0; i2 < set2.chunk.length; i2++) {
          let known = inA.get(set2.chunk[i2]);
          if (known != null && (textDiff ? textDiff.mapPos(known) : known) == set2.chunkPos[i2] && !(textDiff === null || textDiff === void 0 ? void 0 : textDiff.touchesRange(known, known + set2.chunk[i2].length)))
            shared.add(set2.chunk[i2]);
        }
      return shared;
    }
    class LayerCursor {
      constructor(layer2, skip, minPoint, rank = 0) {
        this.layer = layer2;
        this.skip = skip;
        this.minPoint = minPoint;
        this.rank = rank;
      }
      get startSide() {
        return this.value ? this.value.startSide : 0;
      }
      get endSide() {
        return this.value ? this.value.endSide : 0;
      }
      goto(pos2, side = -1e9) {
        this.chunkIndex = this.rangeIndex = 0;
        this.gotoInner(pos2, side, false);
        return this;
      }
      gotoInner(pos2, side, forward) {
        while (this.chunkIndex < this.layer.chunk.length) {
          let next = this.layer.chunk[this.chunkIndex];
          if (!(this.skip && this.skip.has(next) || this.layer.chunkEnd(this.chunkIndex) < pos2 || next.maxPoint < this.minPoint))
            break;
          this.chunkIndex++;
          forward = false;
        }
        if (this.chunkIndex < this.layer.chunk.length) {
          let rangeIndex = this.layer.chunk[this.chunkIndex].findIndex(pos2 - this.layer.chunkPos[this.chunkIndex], side, true);
          if (!forward || this.rangeIndex < rangeIndex)
            this.setRangeIndex(rangeIndex);
        }
        this.next();
      }
      forward(pos2, side) {
        if ((this.to - pos2 || this.endSide - side) < 0)
          this.gotoInner(pos2, side, true);
      }
      next() {
        for (; ; ) {
          if (this.chunkIndex == this.layer.chunk.length) {
            this.from = this.to = 1e9;
            this.value = null;
            break;
          } else {
            let chunkPos = this.layer.chunkPos[this.chunkIndex], chunk = this.layer.chunk[this.chunkIndex];
            let from = chunkPos + chunk.from[this.rangeIndex];
            this.from = from;
            this.to = chunkPos + chunk.to[this.rangeIndex];
            this.value = chunk.value[this.rangeIndex];
            this.setRangeIndex(this.rangeIndex + 1);
            if (this.minPoint < 0 || this.value.point && this.to - this.from >= this.minPoint)
              break;
          }
        }
      }
      setRangeIndex(index) {
        if (index == this.layer.chunk[this.chunkIndex].value.length) {
          this.chunkIndex++;
          if (this.skip) {
            while (this.chunkIndex < this.layer.chunk.length && this.skip.has(this.layer.chunk[this.chunkIndex]))
              this.chunkIndex++;
          }
          this.rangeIndex = 0;
        } else {
          this.rangeIndex = index;
        }
      }
      nextChunk() {
        this.chunkIndex++;
        this.rangeIndex = 0;
        this.next();
      }
      compare(other) {
        return this.from - other.from || this.startSide - other.startSide || this.rank - other.rank || this.to - other.to || this.endSide - other.endSide;
      }
    }
    class HeapCursor {
      constructor(heap2) {
        this.heap = heap2;
      }
      static from(sets, skip = null, minPoint = -1) {
        let heap2 = [];
        for (let i2 = 0; i2 < sets.length; i2++) {
          for (let cur2 = sets[i2]; !cur2.isEmpty; cur2 = cur2.nextLayer) {
            if (cur2.maxPoint >= minPoint)
              heap2.push(new LayerCursor(cur2, skip, minPoint, i2));
          }
        }
        return heap2.length == 1 ? heap2[0] : new HeapCursor(heap2);
      }
      get startSide() {
        return this.value ? this.value.startSide : 0;
      }
      goto(pos2, side = -1e9) {
        for (let cur2 of this.heap)
          cur2.goto(pos2, side);
        for (let i2 = this.heap.length >> 1; i2 >= 0; i2--)
          heapBubble(this.heap, i2);
        this.next();
        return this;
      }
      forward(pos2, side) {
        for (let cur2 of this.heap)
          cur2.forward(pos2, side);
        for (let i2 = this.heap.length >> 1; i2 >= 0; i2--)
          heapBubble(this.heap, i2);
        if ((this.to - pos2 || this.value.endSide - side) < 0)
          this.next();
      }
      next() {
        if (this.heap.length == 0) {
          this.from = this.to = 1e9;
          this.value = null;
          this.rank = -1;
        } else {
          let top2 = this.heap[0];
          this.from = top2.from;
          this.to = top2.to;
          this.value = top2.value;
          this.rank = top2.rank;
          if (top2.value)
            top2.next();
          heapBubble(this.heap, 0);
        }
      }
    }
    function heapBubble(heap2, index) {
      for (let cur2 = heap2[index]; ; ) {
        let childIndex = (index << 1) + 1;
        if (childIndex >= heap2.length)
          break;
        let child = heap2[childIndex];
        if (childIndex + 1 < heap2.length && child.compare(heap2[childIndex + 1]) >= 0) {
          child = heap2[childIndex + 1];
          childIndex++;
        }
        if (cur2.compare(child) < 0)
          break;
        heap2[childIndex] = cur2;
        heap2[index] = child;
        index = childIndex;
      }
    }
    class SpanCursor {
      constructor(sets, skip, minPoint) {
        this.minPoint = minPoint;
        this.active = [];
        this.activeTo = [];
        this.activeRank = [];
        this.minActive = -1;
        this.point = null;
        this.pointFrom = 0;
        this.pointRank = 0;
        this.to = -1e9;
        this.endSide = 0;
        this.openStart = -1;
        this.cursor = HeapCursor.from(sets, skip, minPoint);
      }
      goto(pos2, side = -1e9) {
        this.cursor.goto(pos2, side);
        this.active.length = this.activeTo.length = this.activeRank.length = 0;
        this.minActive = -1;
        this.to = pos2;
        this.endSide = side;
        this.openStart = -1;
        this.next();
        return this;
      }
      forward(pos2, side) {
        while (this.minActive > -1 && (this.activeTo[this.minActive] - pos2 || this.active[this.minActive].endSide - side) < 0)
          this.removeActive(this.minActive);
        this.cursor.forward(pos2, side);
      }
      removeActive(index) {
        remove(this.active, index);
        remove(this.activeTo, index);
        remove(this.activeRank, index);
        this.minActive = findMinIndex(this.active, this.activeTo);
      }
      addActive(trackOpen) {
        let i2 = 0, { value: value2, to: to2, rank } = this.cursor;
        while (i2 < this.activeRank.length && (rank - this.activeRank[i2] || to2 - this.activeTo[i2]) > 0)
          i2++;
        insert(this.active, i2, value2);
        insert(this.activeTo, i2, to2);
        insert(this.activeRank, i2, rank);
        if (trackOpen)
          insert(trackOpen, i2, this.cursor.from);
        this.minActive = findMinIndex(this.active, this.activeTo);
      }
      // After calling this, if `this.point` != null, the next range is a
      // point. Otherwise, it's a regular range, covered by `this.active`.
      next() {
        let from = this.to, wasPoint = this.point;
        this.point = null;
        let trackOpen = this.openStart < 0 ? [] : null;
        for (; ; ) {
          let a = this.minActive;
          if (a > -1 && (this.activeTo[a] - this.cursor.from || this.active[a].endSide - this.cursor.startSide) < 0) {
            if (this.activeTo[a] > from) {
              this.to = this.activeTo[a];
              this.endSide = this.active[a].endSide;
              break;
            }
            this.removeActive(a);
            if (trackOpen)
              remove(trackOpen, a);
          } else if (!this.cursor.value) {
            this.to = this.endSide = 1e9;
            break;
          } else if (this.cursor.from > from) {
            this.to = this.cursor.from;
            this.endSide = this.cursor.startSide;
            break;
          } else {
            let nextVal = this.cursor.value;
            if (!nextVal.point) {
              this.addActive(trackOpen);
              this.cursor.next();
            } else if (wasPoint && this.cursor.to == this.to && this.cursor.from < this.cursor.to) {
              this.cursor.next();
            } else {
              this.point = nextVal;
              this.pointFrom = this.cursor.from;
              this.pointRank = this.cursor.rank;
              this.to = this.cursor.to;
              this.endSide = nextVal.endSide;
              this.cursor.next();
              this.forward(this.to, this.endSide);
              break;
            }
          }
        }
        if (trackOpen) {
          this.openStart = 0;
          for (let i2 = trackOpen.length - 1; i2 >= 0 && trackOpen[i2] < from; i2--)
            this.openStart++;
        }
      }
      activeForPoint(to2) {
        if (!this.active.length)
          return this.active;
        let active = [];
        for (let i2 = this.active.length - 1; i2 >= 0; i2--) {
          if (this.activeRank[i2] < this.pointRank)
            break;
          if (this.activeTo[i2] > to2 || this.activeTo[i2] == to2 && this.active[i2].endSide >= this.point.endSide)
            active.push(this.active[i2]);
        }
        return active.reverse();
      }
      openEnd(to2) {
        let open = 0;
        for (let i2 = this.activeTo.length - 1; i2 >= 0 && this.activeTo[i2] > to2; i2--)
          open++;
        return open;
      }
    }
    function compare(a, startA, b, startB, length, comparator) {
      a.goto(startA);
      b.goto(startB);
      let endB = startB + length;
      let pos2 = startB, dPos = startB - startA;
      for (; ; ) {
        let dEnd = a.to + dPos - b.to, diff2 = dEnd || a.endSide - b.endSide;
        let end2 = diff2 < 0 ? a.to + dPos : b.to, clipEnd = Math.min(end2, endB);
        if (a.point || b.point) {
          if (!(a.point && b.point && (a.point == b.point || a.point.eq(b.point)) && sameValues(a.activeForPoint(a.to), b.activeForPoint(b.to))))
            comparator.comparePoint(pos2, clipEnd, a.point, b.point);
        } else {
          if (clipEnd > pos2 && !sameValues(a.active, b.active))
            comparator.compareRange(pos2, clipEnd, a.active, b.active);
        }
        if (end2 > endB)
          break;
        if ((dEnd || a.openEnd != b.openEnd) && comparator.boundChange)
          comparator.boundChange(end2);
        pos2 = end2;
        if (diff2 <= 0)
          a.next();
        if (diff2 >= 0)
          b.next();
      }
    }
    function sameValues(a, b) {
      if (a.length != b.length)
        return false;
      for (let i2 = 0; i2 < a.length; i2++)
        if (a[i2] != b[i2] && !a[i2].eq(b[i2]))
          return false;
      return true;
    }
    function remove(array, index) {
      for (let i2 = index, e = array.length - 1; i2 < e; i2++)
        array[i2] = array[i2 + 1];
      array.pop();
    }
    function insert(array, index, value2) {
      for (let i2 = array.length - 1; i2 >= index; i2--)
        array[i2 + 1] = array[i2];
      array[index] = value2;
    }
    function findMinIndex(value2, array) {
      let found = -1, foundPos = 1e9;
      for (let i2 = 0; i2 < array.length; i2++)
        if ((array[i2] - foundPos || value2[i2].endSide - value2[found].endSide) < 0) {
          found = i2;
          foundPos = array[i2];
        }
      return found;
    }
    function countColumn(string2, tabSize, to2 = string2.length) {
      let n = 0;
      for (let i2 = 0; i2 < to2 && i2 < string2.length; ) {
        if (string2.charCodeAt(i2) == 9) {
          n += tabSize - n % tabSize;
          i2++;
        } else {
          n++;
          i2 = findClusterBreak(string2, i2);
        }
      }
      return n;
    }
    function findColumn(string2, col, tabSize, strict) {
      for (let i2 = 0, n = 0; ; ) {
        if (n >= col)
          return i2;
        if (i2 == string2.length)
          break;
        n += string2.charCodeAt(i2) == 9 ? tabSize - n % tabSize : 1;
        i2 = findClusterBreak(string2, i2);
      }
      return string2.length;
    }
    const C = "ͼ";
    const COUNT = typeof Symbol == "undefined" ? "__" + C : Symbol.for(C);
    const SET = typeof Symbol == "undefined" ? "__styleSet" + Math.floor(Math.random() * 1e8) : Symbol("styleSet");
    const top = typeof globalThis != "undefined" ? globalThis : typeof window != "undefined" ? window : {};
    class StyleModule {
      // :: (Object<Style>, ?{finish: ?(string) → string})
      // Create a style module from the given spec.
      //
      // When `finish` is given, it is called on regular (non-`@`)
      // selectors (after `&` expansion) to compute the final selector.
      constructor(spec, options2) {
        this.rules = [];
        let { finish } = options2 || {};
        function splitSelector(selector2) {
          return /^@/.test(selector2) ? [selector2] : selector2.split(/,\s*/);
        }
        function render2(selectors, spec2, target2, isKeyframes) {
          let local = [], isAt = /^@(\w+)\b/.exec(selectors[0]), keyframes = isAt && isAt[1] == "keyframes";
          if (isAt && spec2 == null) return target2.push(selectors[0] + ";");
          for (let prop2 in spec2) {
            let value2 = spec2[prop2];
            if (/&/.test(prop2)) {
              render2(
                prop2.split(/,\s*/).map((part2) => selectors.map((sel) => part2.replace(/&/, sel))).reduce((a, b) => a.concat(b)),
                value2,
                target2
              );
            } else if (value2 && typeof value2 == "object") {
              if (!isAt) throw new RangeError("The value of a property (" + prop2 + ") should be a primitive value.");
              render2(splitSelector(prop2), value2, local, keyframes);
            } else if (value2 != null) {
              local.push(prop2.replace(/_.*/, "").replace(/[A-Z]/g, (l) => "-" + l.toLowerCase()) + ": " + value2 + ";");
            }
          }
          if (local.length || keyframes) {
            target2.push((finish && !isAt && !isKeyframes ? selectors.map(finish) : selectors).join(", ") + " {" + local.join(" ") + "}");
          }
        }
        for (let prop2 in spec) render2(splitSelector(prop2), spec[prop2], this.rules);
      }
      // :: () → string
      // Returns a string containing the module's CSS rules.
      getRules() {
        return this.rules.join("\n");
      }
      // :: () → string
      // Generate a new unique CSS class name.
      static newName() {
        let id = top[COUNT] || 1;
        top[COUNT] = id + 1;
        return C + id.toString(36);
      }
      // :: (union<Document, ShadowRoot>, union<[StyleModule], StyleModule>, ?{nonce: ?string})
      //
      // Mount the given set of modules in the given DOM root, which ensures
      // that the CSS rules defined by the module are available in that
      // context.
      //
      // Rules are only added to the document once per root.
      //
      // Rule order will follow the order of the modules, so that rules from
      // modules later in the array take precedence of those from earlier
      // modules. If you call this function multiple times for the same root
      // in a way that changes the order of already mounted modules, the old
      // order will be changed.
      //
      // If a Content Security Policy nonce is provided, it is added to
      // the `<style>` tag generated by the library.
      static mount(root2, modules, options2) {
        let set2 = root2[SET], nonce = options2 && options2.nonce;
        if (!set2) set2 = new StyleSet(root2, nonce);
        else if (nonce) set2.setNonce(nonce);
        set2.mount(Array.isArray(modules) ? modules : [modules], root2);
      }
    }
    let adoptedSet = /* @__PURE__ */ new Map();
    class StyleSet {
      constructor(root2, nonce) {
        let doc2 = root2.ownerDocument || root2, win = doc2.defaultView;
        if (!root2.head && root2.adoptedStyleSheets && win.CSSStyleSheet) {
          let adopted = adoptedSet.get(doc2);
          if (adopted) return root2[SET] = adopted;
          this.sheet = new win.CSSStyleSheet();
          adoptedSet.set(doc2, this);
        } else {
          this.styleTag = doc2.createElement("style");
          if (nonce) this.styleTag.setAttribute("nonce", nonce);
        }
        this.modules = [];
        root2[SET] = this;
      }
      mount(modules, root2) {
        let sheet = this.sheet;
        let pos2 = 0, j = 0;
        for (let i2 = 0; i2 < modules.length; i2++) {
          let mod2 = modules[i2], index = this.modules.indexOf(mod2);
          if (index < j && index > -1) {
            this.modules.splice(index, 1);
            j--;
            index = -1;
          }
          if (index == -1) {
            this.modules.splice(j++, 0, mod2);
            if (sheet) for (let k2 = 0; k2 < mod2.rules.length; k2++)
              sheet.insertRule(mod2.rules[k2], pos2++);
          } else {
            while (j < index) pos2 += this.modules[j++].rules.length;
            pos2 += mod2.rules.length;
            j++;
          }
        }
        if (sheet) {
          if (root2.adoptedStyleSheets.indexOf(this.sheet) < 0)
            root2.adoptedStyleSheets = [this.sheet, ...root2.adoptedStyleSheets];
        } else {
          let text2 = "";
          for (let i2 = 0; i2 < this.modules.length; i2++)
            text2 += this.modules[i2].getRules() + "\n";
          this.styleTag.textContent = text2;
          let target2 = root2.head || root2;
          if (this.styleTag.parentNode != target2)
            target2.insertBefore(this.styleTag, target2.firstChild);
        }
      }
      setNonce(nonce) {
        if (this.styleTag && this.styleTag.getAttribute("nonce") != nonce)
          this.styleTag.setAttribute("nonce", nonce);
      }
    }
    var base = {
      8: "Backspace",
      9: "Tab",
      10: "Enter",
      12: "NumLock",
      13: "Enter",
      16: "Shift",
      17: "Control",
      18: "Alt",
      20: "CapsLock",
      27: "Escape",
      32: " ",
      33: "PageUp",
      34: "PageDown",
      35: "End",
      36: "Home",
      37: "ArrowLeft",
      38: "ArrowUp",
      39: "ArrowRight",
      40: "ArrowDown",
      44: "PrintScreen",
      45: "Insert",
      46: "Delete",
      59: ";",
      61: "=",
      91: "Meta",
      92: "Meta",
      106: "*",
      107: "+",
      108: ",",
      109: "-",
      110: ".",
      111: "/",
      144: "NumLock",
      145: "ScrollLock",
      160: "Shift",
      161: "Shift",
      162: "Control",
      163: "Control",
      164: "Alt",
      165: "Alt",
      173: "-",
      186: ";",
      187: "=",
      188: ",",
      189: "-",
      190: ".",
      191: "/",
      192: "`",
      219: "[",
      220: "\\",
      221: "]",
      222: "'"
    };
    var shift = {
      48: ")",
      49: "!",
      50: "@",
      51: "#",
      52: "$",
      53: "%",
      54: "^",
      55: "&",
      56: "*",
      57: "(",
      59: ":",
      61: "+",
      173: "_",
      186: ":",
      187: "+",
      188: "<",
      189: "_",
      190: ">",
      191: "?",
      192: "~",
      219: "{",
      220: "|",
      221: "}",
      222: '"'
    };
    var mac = typeof navigator != "undefined" && /Mac/.test(navigator.platform);
    var ie$1 = typeof navigator != "undefined" && /MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);
    for (var i = 0; i < 10; i++) base[48 + i] = base[96 + i] = String(i);
    for (var i = 1; i <= 24; i++) base[i + 111] = "F" + i;
    for (var i = 65; i <= 90; i++) {
      base[i] = String.fromCharCode(i + 32);
      shift[i] = String.fromCharCode(i);
    }
    for (var code$1 in base) if (!shift.hasOwnProperty(code$1)) shift[code$1] = base[code$1];
    function keyName(event) {
      var ignoreKey = mac && event.metaKey && event.shiftKey && !event.ctrlKey && !event.altKey || ie$1 && event.shiftKey && event.key && event.key.length == 1 || event.key == "Unidentified";
      var name2 = !ignoreKey && event.key || (event.shiftKey ? shift : base)[event.keyCode] || event.key || "Unidentified";
      if (name2 == "Esc") name2 = "Escape";
      if (name2 == "Del") name2 = "Delete";
      if (name2 == "Left") name2 = "ArrowLeft";
      if (name2 == "Up") name2 = "ArrowUp";
      if (name2 == "Right") name2 = "ArrowRight";
      if (name2 == "Down") name2 = "ArrowDown";
      return name2;
    }
    function getSelection(root2) {
      let target2;
      if (root2.nodeType == 11) {
        target2 = root2.getSelection ? root2 : root2.ownerDocument;
      } else {
        target2 = root2;
      }
      return target2.getSelection();
    }
    function contains(dom, node2) {
      return node2 ? dom == node2 || dom.contains(node2.nodeType != 1 ? node2.parentNode : node2) : false;
    }
    function hasSelection(dom, selection) {
      if (!selection.anchorNode)
        return false;
      try {
        return contains(dom, selection.anchorNode);
      } catch (_) {
        return false;
      }
    }
    function clientRectsFor(dom) {
      if (dom.nodeType == 3)
        return textRange(dom, 0, dom.nodeValue.length).getClientRects();
      else if (dom.nodeType == 1)
        return dom.getClientRects();
      else
        return [];
    }
    function isEquivalentPosition(node2, off, targetNode, targetOff) {
      return targetNode ? scanFor(node2, off, targetNode, targetOff, -1) || scanFor(node2, off, targetNode, targetOff, 1) : false;
    }
    function domIndex(node2) {
      for (var index = 0; ; index++) {
        node2 = node2.previousSibling;
        if (!node2)
          return index;
      }
    }
    function isBlockElement(node2) {
      return node2.nodeType == 1 && /^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(node2.nodeName);
    }
    function scanFor(node2, off, targetNode, targetOff, dir) {
      for (; ; ) {
        if (node2 == targetNode && off == targetOff)
          return true;
        if (off == (dir < 0 ? 0 : maxOffset(node2))) {
          if (node2.nodeName == "DIV")
            return false;
          let parent = node2.parentNode;
          if (!parent || parent.nodeType != 1)
            return false;
          off = domIndex(node2) + (dir < 0 ? 0 : 1);
          node2 = parent;
        } else if (node2.nodeType == 1) {
          node2 = node2.childNodes[off + (dir < 0 ? -1 : 0)];
          if (node2.nodeType == 1 && node2.contentEditable == "false")
            return false;
          off = dir < 0 ? maxOffset(node2) : 0;
        } else {
          return false;
        }
      }
    }
    function maxOffset(node2) {
      return node2.nodeType == 3 ? node2.nodeValue.length : node2.childNodes.length;
    }
    function flattenRect(rect2, left2) {
      let x2 = left2 ? rect2.left : rect2.right;
      return { left: x2, right: x2, top: rect2.top, bottom: rect2.bottom };
    }
    function windowRect(win) {
      let vp = win.visualViewport;
      if (vp)
        return {
          left: 0,
          right: vp.width,
          top: 0,
          bottom: vp.height
        };
      return {
        left: 0,
        right: win.innerWidth,
        top: 0,
        bottom: win.innerHeight
      };
    }
    function getScale(elt, rect2) {
      let scaleX = rect2.width / elt.offsetWidth;
      let scaleY = rect2.height / elt.offsetHeight;
      if (scaleX > 0.995 && scaleX < 1.005 || !isFinite(scaleX) || Math.abs(rect2.width - elt.offsetWidth) < 1)
        scaleX = 1;
      if (scaleY > 0.995 && scaleY < 1.005 || !isFinite(scaleY) || Math.abs(rect2.height - elt.offsetHeight) < 1)
        scaleY = 1;
      return { scaleX, scaleY };
    }
    function scrollRectIntoView(dom, rect2, side, x2, y, xMargin, yMargin, ltr) {
      let doc2 = dom.ownerDocument, win = doc2.defaultView || window;
      for (let cur2 = dom, stop = false; cur2 && !stop; ) {
        if (cur2.nodeType == 1) {
          let bounding, top2 = cur2 == doc2.body;
          let scaleX = 1, scaleY = 1;
          if (top2) {
            bounding = windowRect(win);
          } else {
            if (/^(fixed|sticky)$/.test(getComputedStyle(cur2).position))
              stop = true;
            if (cur2.scrollHeight <= cur2.clientHeight && cur2.scrollWidth <= cur2.clientWidth) {
              cur2 = cur2.assignedSlot || cur2.parentNode;
              continue;
            }
            let rect3 = cur2.getBoundingClientRect();
            ({ scaleX, scaleY } = getScale(cur2, rect3));
            bounding = {
              left: rect3.left,
              right: rect3.left + cur2.clientWidth * scaleX,
              top: rect3.top,
              bottom: rect3.top + cur2.clientHeight * scaleY
            };
          }
          let moveX = 0, moveY = 0;
          if (y == "nearest") {
            if (rect2.top < bounding.top) {
              moveY = rect2.top - (bounding.top + yMargin);
              if (side > 0 && rect2.bottom > bounding.bottom + moveY)
                moveY = rect2.bottom - bounding.bottom + yMargin;
            } else if (rect2.bottom > bounding.bottom) {
              moveY = rect2.bottom - bounding.bottom + yMargin;
              if (side < 0 && rect2.top - moveY < bounding.top)
                moveY = rect2.top - (bounding.top + yMargin);
            }
          } else {
            let rectHeight = rect2.bottom - rect2.top, boundingHeight = bounding.bottom - bounding.top;
            let targetTop = y == "center" && rectHeight <= boundingHeight ? rect2.top + rectHeight / 2 - boundingHeight / 2 : y == "start" || y == "center" && side < 0 ? rect2.top - yMargin : rect2.bottom - boundingHeight + yMargin;
            moveY = targetTop - bounding.top;
          }
          if (x2 == "nearest") {
            if (rect2.left < bounding.left) {
              moveX = rect2.left - (bounding.left + xMargin);
              if (side > 0 && rect2.right > bounding.right + moveX)
                moveX = rect2.right - bounding.right + xMargin;
            } else if (rect2.right > bounding.right) {
              moveX = rect2.right - bounding.right + xMargin;
              if (side < 0 && rect2.left < bounding.left + moveX)
                moveX = rect2.left - (bounding.left + xMargin);
            }
          } else {
            let targetLeft = x2 == "center" ? rect2.left + (rect2.right - rect2.left) / 2 - (bounding.right - bounding.left) / 2 : x2 == "start" == ltr ? rect2.left - xMargin : rect2.right - (bounding.right - bounding.left) + xMargin;
            moveX = targetLeft - bounding.left;
          }
          if (moveX || moveY) {
            if (top2) {
              win.scrollBy(moveX, moveY);
            } else {
              let movedX = 0, movedY = 0;
              if (moveY) {
                let start2 = cur2.scrollTop;
                cur2.scrollTop += moveY / scaleY;
                movedY = (cur2.scrollTop - start2) * scaleY;
              }
              if (moveX) {
                let start2 = cur2.scrollLeft;
                cur2.scrollLeft += moveX / scaleX;
                movedX = (cur2.scrollLeft - start2) * scaleX;
              }
              rect2 = {
                left: rect2.left - movedX,
                top: rect2.top - movedY,
                right: rect2.right - movedX,
                bottom: rect2.bottom - movedY
              };
              if (movedX && Math.abs(movedX - moveX) < 1)
                x2 = "nearest";
              if (movedY && Math.abs(movedY - moveY) < 1)
                y = "nearest";
            }
          }
          if (top2)
            break;
          if (rect2.top < bounding.top || rect2.bottom > bounding.bottom || rect2.left < bounding.left || rect2.right > bounding.right)
            rect2 = {
              left: Math.max(rect2.left, bounding.left),
              right: Math.min(rect2.right, bounding.right),
              top: Math.max(rect2.top, bounding.top),
              bottom: Math.min(rect2.bottom, bounding.bottom)
            };
          cur2 = cur2.assignedSlot || cur2.parentNode;
        } else if (cur2.nodeType == 11) {
          cur2 = cur2.host;
        } else {
          break;
        }
      }
    }
    function scrollableParents(dom) {
      let doc2 = dom.ownerDocument, x2, y;
      for (let cur2 = dom.parentNode; cur2; ) {
        if (cur2 == doc2.body || x2 && y) {
          break;
        } else if (cur2.nodeType == 1) {
          if (!y && cur2.scrollHeight > cur2.clientHeight)
            y = cur2;
          if (!x2 && cur2.scrollWidth > cur2.clientWidth)
            x2 = cur2;
          cur2 = cur2.assignedSlot || cur2.parentNode;
        } else if (cur2.nodeType == 11) {
          cur2 = cur2.host;
        } else {
          break;
        }
      }
      return { x: x2, y };
    }
    class DOMSelectionState {
      constructor() {
        this.anchorNode = null;
        this.anchorOffset = 0;
        this.focusNode = null;
        this.focusOffset = 0;
      }
      eq(domSel) {
        return this.anchorNode == domSel.anchorNode && this.anchorOffset == domSel.anchorOffset && this.focusNode == domSel.focusNode && this.focusOffset == domSel.focusOffset;
      }
      setRange(range2) {
        let { anchorNode, focusNode } = range2;
        this.set(anchorNode, Math.min(range2.anchorOffset, anchorNode ? maxOffset(anchorNode) : 0), focusNode, Math.min(range2.focusOffset, focusNode ? maxOffset(focusNode) : 0));
      }
      set(anchorNode, anchorOffset, focusNode, focusOffset) {
        this.anchorNode = anchorNode;
        this.anchorOffset = anchorOffset;
        this.focusNode = focusNode;
        this.focusOffset = focusOffset;
      }
    }
    let preventScrollSupported = null;
    function focusPreventScroll(dom) {
      if (dom.setActive)
        return dom.setActive();
      if (preventScrollSupported)
        return dom.focus(preventScrollSupported);
      let stack2 = [];
      for (let cur2 = dom; cur2; cur2 = cur2.parentNode) {
        stack2.push(cur2, cur2.scrollTop, cur2.scrollLeft);
        if (cur2 == cur2.ownerDocument)
          break;
      }
      dom.focus(preventScrollSupported == null ? {
        get preventScroll() {
          preventScrollSupported = { preventScroll: true };
          return true;
        }
      } : void 0);
      if (!preventScrollSupported) {
        preventScrollSupported = false;
        for (let i2 = 0; i2 < stack2.length; ) {
          let elt = stack2[i2++], top2 = stack2[i2++], left2 = stack2[i2++];
          if (elt.scrollTop != top2)
            elt.scrollTop = top2;
          if (elt.scrollLeft != left2)
            elt.scrollLeft = left2;
        }
      }
    }
    let scratchRange;
    function textRange(node2, from, to2 = from) {
      let range2 = scratchRange || (scratchRange = document.createRange());
      range2.setEnd(node2, to2);
      range2.setStart(node2, from);
      return range2;
    }
    function dispatchKey(elt, name2, code2, mods) {
      let options2 = { key: name2, code: name2, keyCode: code2, which: code2, cancelable: true };
      if (mods)
        ({ altKey: options2.altKey, ctrlKey: options2.ctrlKey, shiftKey: options2.shiftKey, metaKey: options2.metaKey } = mods);
      let down = new KeyboardEvent("keydown", options2);
      down.synthetic = true;
      elt.dispatchEvent(down);
      let up = new KeyboardEvent("keyup", options2);
      up.synthetic = true;
      elt.dispatchEvent(up);
      return down.defaultPrevented || up.defaultPrevented;
    }
    function getRoot(node2) {
      while (node2) {
        if (node2 && (node2.nodeType == 9 || node2.nodeType == 11 && node2.host))
          return node2;
        node2 = node2.assignedSlot || node2.parentNode;
      }
      return null;
    }
    function clearAttributes(node2) {
      while (node2.attributes.length)
        node2.removeAttributeNode(node2.attributes[0]);
    }
    function atElementStart(doc2, selection) {
      let node2 = selection.focusNode, offset2 = selection.focusOffset;
      if (!node2 || selection.anchorNode != node2 || selection.anchorOffset != offset2)
        return false;
      offset2 = Math.min(offset2, maxOffset(node2));
      for (; ; ) {
        if (offset2) {
          if (node2.nodeType != 1)
            return false;
          let prev = node2.childNodes[offset2 - 1];
          if (prev.contentEditable == "false")
            offset2--;
          else {
            node2 = prev;
            offset2 = maxOffset(node2);
          }
        } else if (node2 == doc2) {
          return true;
        } else {
          offset2 = domIndex(node2);
          node2 = node2.parentNode;
        }
      }
    }
    function isScrolledToBottom(elt) {
      return elt.scrollTop > Math.max(1, elt.scrollHeight - elt.clientHeight - 4);
    }
    function textNodeBefore(startNode, startOffset) {
      for (let node2 = startNode, offset2 = startOffset; ; ) {
        if (node2.nodeType == 3 && offset2 > 0) {
          return { node: node2, offset: offset2 };
        } else if (node2.nodeType == 1 && offset2 > 0) {
          if (node2.contentEditable == "false")
            return null;
          node2 = node2.childNodes[offset2 - 1];
          offset2 = maxOffset(node2);
        } else if (node2.parentNode && !isBlockElement(node2)) {
          offset2 = domIndex(node2);
          node2 = node2.parentNode;
        } else {
          return null;
        }
      }
    }
    function textNodeAfter(startNode, startOffset) {
      for (let node2 = startNode, offset2 = startOffset; ; ) {
        if (node2.nodeType == 3 && offset2 < node2.nodeValue.length) {
          return { node: node2, offset: offset2 };
        } else if (node2.nodeType == 1 && offset2 < node2.childNodes.length) {
          if (node2.contentEditable == "false")
            return null;
          node2 = node2.childNodes[offset2];
          offset2 = 0;
        } else if (node2.parentNode && !isBlockElement(node2)) {
          offset2 = domIndex(node2) + 1;
          node2 = node2.parentNode;
        } else {
          return null;
        }
      }
    }
    class DOMPos {
      constructor(node2, offset2, precise = true) {
        this.node = node2;
        this.offset = offset2;
        this.precise = precise;
      }
      static before(dom, precise) {
        return new DOMPos(dom.parentNode, domIndex(dom), precise);
      }
      static after(dom, precise) {
        return new DOMPos(dom.parentNode, domIndex(dom) + 1, precise);
      }
    }
    const noChildren = [];
    class ContentView {
      constructor() {
        this.parent = null;
        this.dom = null;
        this.flags = 2;
      }
      get overrideDOMText() {
        return null;
      }
      get posAtStart() {
        return this.parent ? this.parent.posBefore(this) : 0;
      }
      get posAtEnd() {
        return this.posAtStart + this.length;
      }
      posBefore(view) {
        let pos2 = this.posAtStart;
        for (let child of this.children) {
          if (child == view)
            return pos2;
          pos2 += child.length + child.breakAfter;
        }
        throw new RangeError("Invalid child in posBefore");
      }
      posAfter(view) {
        return this.posBefore(view) + view.length;
      }
      sync(view, track) {
        if (this.flags & 2) {
          let parent = this.dom;
          let prev = null, next;
          for (let child of this.children) {
            if (child.flags & 7) {
              if (!child.dom && (next = prev ? prev.nextSibling : parent.firstChild)) {
                let contentView = ContentView.get(next);
                if (!contentView || !contentView.parent && contentView.canReuseDOM(child))
                  child.reuseDOM(next);
              }
              child.sync(view, track);
              child.flags &= -8;
            }
            next = prev ? prev.nextSibling : parent.firstChild;
            if (track && !track.written && track.node == parent && next != child.dom)
              track.written = true;
            if (child.dom.parentNode == parent) {
              while (next && next != child.dom)
                next = rm$1(next);
            } else {
              parent.insertBefore(child.dom, next);
            }
            prev = child.dom;
          }
          next = prev ? prev.nextSibling : parent.firstChild;
          if (next && track && track.node == parent)
            track.written = true;
          while (next)
            next = rm$1(next);
        } else if (this.flags & 1) {
          for (let child of this.children)
            if (child.flags & 7) {
              child.sync(view, track);
              child.flags &= -8;
            }
        }
      }
      reuseDOM(_dom) {
      }
      localPosFromDOM(node2, offset2) {
        let after;
        if (node2 == this.dom) {
          after = this.dom.childNodes[offset2];
        } else {
          let bias = maxOffset(node2) == 0 ? 0 : offset2 == 0 ? -1 : 1;
          for (; ; ) {
            let parent = node2.parentNode;
            if (parent == this.dom)
              break;
            if (bias == 0 && parent.firstChild != parent.lastChild) {
              if (node2 == parent.firstChild)
                bias = -1;
              else
                bias = 1;
            }
            node2 = parent;
          }
          if (bias < 0)
            after = node2;
          else
            after = node2.nextSibling;
        }
        if (after == this.dom.firstChild)
          return 0;
        while (after && !ContentView.get(after))
          after = after.nextSibling;
        if (!after)
          return this.length;
        for (let i2 = 0, pos2 = 0; ; i2++) {
          let child = this.children[i2];
          if (child.dom == after)
            return pos2;
          pos2 += child.length + child.breakAfter;
        }
      }
      domBoundsAround(from, to2, offset2 = 0) {
        let fromI = -1, fromStart = -1, toI = -1, toEnd = -1;
        for (let i2 = 0, pos2 = offset2, prevEnd = offset2; i2 < this.children.length; i2++) {
          let child = this.children[i2], end2 = pos2 + child.length;
          if (pos2 < from && end2 > to2)
            return child.domBoundsAround(from, to2, pos2);
          if (end2 >= from && fromI == -1) {
            fromI = i2;
            fromStart = pos2;
          }
          if (pos2 > to2 && child.dom.parentNode == this.dom) {
            toI = i2;
            toEnd = prevEnd;
            break;
          }
          prevEnd = end2;
          pos2 = end2 + child.breakAfter;
        }
        return {
          from: fromStart,
          to: toEnd < 0 ? offset2 + this.length : toEnd,
          startDOM: (fromI ? this.children[fromI - 1].dom.nextSibling : null) || this.dom.firstChild,
          endDOM: toI < this.children.length && toI >= 0 ? this.children[toI].dom : null
        };
      }
      markDirty(andParent = false) {
        this.flags |= 2;
        this.markParentsDirty(andParent);
      }
      markParentsDirty(childList) {
        for (let parent = this.parent; parent; parent = parent.parent) {
          if (childList)
            parent.flags |= 2;
          if (parent.flags & 1)
            return;
          parent.flags |= 1;
          childList = false;
        }
      }
      setParent(parent) {
        if (this.parent != parent) {
          this.parent = parent;
          if (this.flags & 7)
            this.markParentsDirty(true);
        }
      }
      setDOM(dom) {
        if (this.dom == dom)
          return;
        if (this.dom)
          this.dom.cmView = null;
        this.dom = dom;
        dom.cmView = this;
      }
      get rootView() {
        for (let v = this; ; ) {
          let parent = v.parent;
          if (!parent)
            return v;
          v = parent;
        }
      }
      replaceChildren(from, to2, children2 = noChildren) {
        this.markDirty();
        for (let i2 = from; i2 < to2; i2++) {
          let child = this.children[i2];
          if (child.parent == this && children2.indexOf(child) < 0)
            child.destroy();
        }
        if (children2.length < 250)
          this.children.splice(from, to2 - from, ...children2);
        else
          this.children = [].concat(this.children.slice(0, from), children2, this.children.slice(to2));
        for (let i2 = 0; i2 < children2.length; i2++)
          children2[i2].setParent(this);
      }
      ignoreMutation(_rec) {
        return false;
      }
      ignoreEvent(_event) {
        return false;
      }
      childCursor(pos2 = this.length) {
        return new ChildCursor(this.children, pos2, this.children.length);
      }
      childPos(pos2, bias = 1) {
        return this.childCursor().findPos(pos2, bias);
      }
      toString() {
        let name2 = this.constructor.name.replace("View", "");
        return name2 + (this.children.length ? "(" + this.children.join() + ")" : this.length ? "[" + (name2 == "Text" ? this.text : this.length) + "]" : "") + (this.breakAfter ? "#" : "");
      }
      static get(node2) {
        return node2.cmView;
      }
      get isEditable() {
        return true;
      }
      get isWidget() {
        return false;
      }
      get isHidden() {
        return false;
      }
      merge(from, to2, source2, hasStart, openStart, openEnd) {
        return false;
      }
      become(other) {
        return false;
      }
      canReuseDOM(other) {
        return other.constructor == this.constructor && !((this.flags | other.flags) & 8);
      }
      // When this is a zero-length view with a side, this should return a
      // number <= 0 to indicate it is before its position, or a
      // number > 0 when after its position.
      getSide() {
        return 0;
      }
      destroy() {
        for (let child of this.children)
          if (child.parent == this)
            child.destroy();
        this.parent = null;
      }
    }
    ContentView.prototype.breakAfter = 0;
    function rm$1(dom) {
      let next = dom.nextSibling;
      dom.parentNode.removeChild(dom);
      return next;
    }
    class ChildCursor {
      constructor(children2, pos2, i2) {
        this.children = children2;
        this.pos = pos2;
        this.i = i2;
        this.off = 0;
      }
      findPos(pos2, bias = 1) {
        for (; ; ) {
          if (pos2 > this.pos || pos2 == this.pos && (bias > 0 || this.i == 0 || this.children[this.i - 1].breakAfter)) {
            this.off = pos2 - this.pos;
            return this;
          }
          let next = this.children[--this.i];
          this.pos -= next.length + next.breakAfter;
        }
      }
    }
    function replaceRange(parent, fromI, fromOff, toI, toOff, insert2, breakAtStart, openStart, openEnd) {
      let { children: children2 } = parent;
      let before = children2.length ? children2[fromI] : null;
      let last = insert2.length ? insert2[insert2.length - 1] : null;
      let breakAtEnd = last ? last.breakAfter : breakAtStart;
      if (fromI == toI && before && !breakAtStart && !breakAtEnd && insert2.length < 2 && before.merge(fromOff, toOff, insert2.length ? last : null, fromOff == 0, openStart, openEnd))
        return;
      if (toI < children2.length) {
        let after = children2[toI];
        if (after && (toOff < after.length || after.breakAfter && (last === null || last === void 0 ? void 0 : last.breakAfter))) {
          if (fromI == toI) {
            after = after.split(toOff);
            toOff = 0;
          }
          if (!breakAtEnd && last && after.merge(0, toOff, last, true, 0, openEnd)) {
            insert2[insert2.length - 1] = after;
          } else {
            if (toOff || after.children.length && !after.children[0].length)
              after.merge(0, toOff, null, false, 0, openEnd);
            insert2.push(after);
          }
        } else if (after === null || after === void 0 ? void 0 : after.breakAfter) {
          if (last)
            last.breakAfter = 1;
          else
            breakAtStart = 1;
        }
        toI++;
      }
      if (before) {
        before.breakAfter = breakAtStart;
        if (fromOff > 0) {
          if (!breakAtStart && insert2.length && before.merge(fromOff, before.length, insert2[0], false, openStart, 0)) {
            before.breakAfter = insert2.shift().breakAfter;
          } else if (fromOff < before.length || before.children.length && before.children[before.children.length - 1].length == 0) {
            before.merge(fromOff, before.length, null, false, openStart, 0);
          }
          fromI++;
        }
      }
      while (fromI < toI && insert2.length) {
        if (children2[toI - 1].become(insert2[insert2.length - 1])) {
          toI--;
          insert2.pop();
          openEnd = insert2.length ? 0 : openStart;
        } else if (children2[fromI].become(insert2[0])) {
          fromI++;
          insert2.shift();
          openStart = insert2.length ? 0 : openEnd;
        } else {
          break;
        }
      }
      if (!insert2.length && fromI && toI < children2.length && !children2[fromI - 1].breakAfter && children2[toI].merge(0, 0, children2[fromI - 1], false, openStart, openEnd))
        fromI--;
      if (fromI < toI || insert2.length)
        parent.replaceChildren(fromI, toI, insert2);
    }
    function mergeChildrenInto(parent, from, to2, insert2, openStart, openEnd) {
      let cur2 = parent.childCursor();
      let { i: toI, off: toOff } = cur2.findPos(to2, 1);
      let { i: fromI, off: fromOff } = cur2.findPos(from, -1);
      let dLen = from - to2;
      for (let view of insert2)
        dLen += view.length;
      parent.length += dLen;
      replaceRange(parent, fromI, fromOff, toI, toOff, insert2, 0, openStart, openEnd);
    }
    let nav$1 = typeof navigator != "undefined" ? navigator : { userAgent: "", vendor: "", platform: "" };
    let doc = typeof document != "undefined" ? document : { documentElement: { style: {} } };
    const ie_edge = /* @__PURE__ */ /Edge\/(\d+)/.exec(nav$1.userAgent);
    const ie_upto10 = /* @__PURE__ */ /MSIE \d/.test(nav$1.userAgent);
    const ie_11up = /* @__PURE__ */ /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(nav$1.userAgent);
    const ie = !!(ie_upto10 || ie_11up || ie_edge);
    const gecko = !ie && /* @__PURE__ */ /gecko\/(\d+)/i.test(nav$1.userAgent);
    const chrome = !ie && /* @__PURE__ */ /Chrome\/(\d+)/.exec(nav$1.userAgent);
    const webkit = "webkitFontSmoothing" in doc.documentElement.style;
    const safari = !ie && /* @__PURE__ */ /Apple Computer/.test(nav$1.vendor);
    const ios = safari && (/* @__PURE__ */ /Mobile\/\w+/.test(nav$1.userAgent) || nav$1.maxTouchPoints > 2);
    var browser = {
      mac: ios || /* @__PURE__ */ /Mac/.test(nav$1.platform),
      windows: /* @__PURE__ */ /Win/.test(nav$1.platform),
      linux: /* @__PURE__ */ /Linux|X11/.test(nav$1.platform),
      ie,
      ie_version: ie_upto10 ? doc.documentMode || 6 : ie_11up ? +ie_11up[1] : ie_edge ? +ie_edge[1] : 0,
      gecko,
      gecko_version: gecko ? +(/* @__PURE__ */ /Firefox\/(\d+)/.exec(nav$1.userAgent) || [0, 0])[1] : 0,
      chrome: !!chrome,
      chrome_version: chrome ? +chrome[1] : 0,
      ios,
      android: /* @__PURE__ */ /Android\b/.test(nav$1.userAgent),
      safari,
      webkit_version: webkit ? +(/* @__PURE__ */ /\bAppleWebKit\/(\d+)/.exec(nav$1.userAgent) || [0, 0])[1] : 0,
      tabSize: doc.documentElement.style.tabSize != null ? "tab-size" : "-moz-tab-size"
    };
    const MaxJoinLen = 256;
    class TextView extends ContentView {
      constructor(text2) {
        super();
        this.text = text2;
      }
      get length() {
        return this.text.length;
      }
      createDOM(textDOM) {
        this.setDOM(textDOM || document.createTextNode(this.text));
      }
      sync(view, track) {
        if (!this.dom)
          this.createDOM();
        if (this.dom.nodeValue != this.text) {
          if (track && track.node == this.dom)
            track.written = true;
          this.dom.nodeValue = this.text;
        }
      }
      reuseDOM(dom) {
        if (dom.nodeType == 3)
          this.createDOM(dom);
      }
      merge(from, to2, source2) {
        if (this.flags & 8 || source2 && (!(source2 instanceof TextView) || this.length - (to2 - from) + source2.length > MaxJoinLen || source2.flags & 8))
          return false;
        this.text = this.text.slice(0, from) + (source2 ? source2.text : "") + this.text.slice(to2);
        this.markDirty();
        return true;
      }
      split(from) {
        let result2 = new TextView(this.text.slice(from));
        this.text = this.text.slice(0, from);
        this.markDirty();
        result2.flags |= this.flags & 8;
        return result2;
      }
      localPosFromDOM(node2, offset2) {
        return node2 == this.dom ? offset2 : offset2 ? this.text.length : 0;
      }
      domAtPos(pos2) {
        return new DOMPos(this.dom, pos2);
      }
      domBoundsAround(_from, _to, offset2) {
        return { from: offset2, to: offset2 + this.length, startDOM: this.dom, endDOM: this.dom.nextSibling };
      }
      coordsAt(pos2, side) {
        return textCoords(this.dom, pos2, side);
      }
    }
    class MarkView extends ContentView {
      constructor(mark, children2 = [], length = 0) {
        super();
        this.mark = mark;
        this.children = children2;
        this.length = length;
        for (let ch3 of children2)
          ch3.setParent(this);
      }
      setAttrs(dom) {
        clearAttributes(dom);
        if (this.mark.class)
          dom.className = this.mark.class;
        if (this.mark.attrs)
          for (let name2 in this.mark.attrs)
            dom.setAttribute(name2, this.mark.attrs[name2]);
        return dom;
      }
      canReuseDOM(other) {
        return super.canReuseDOM(other) && !((this.flags | other.flags) & 8);
      }
      reuseDOM(node2) {
        if (node2.nodeName == this.mark.tagName.toUpperCase()) {
          this.setDOM(node2);
          this.flags |= 4 | 2;
        }
      }
      sync(view, track) {
        if (!this.dom)
          this.setDOM(this.setAttrs(document.createElement(this.mark.tagName)));
        else if (this.flags & 4)
          this.setAttrs(this.dom);
        super.sync(view, track);
      }
      merge(from, to2, source2, _hasStart, openStart, openEnd) {
        if (source2 && (!(source2 instanceof MarkView && source2.mark.eq(this.mark)) || from && openStart <= 0 || to2 < this.length && openEnd <= 0))
          return false;
        mergeChildrenInto(this, from, to2, source2 ? source2.children.slice() : [], openStart - 1, openEnd - 1);
        this.markDirty();
        return true;
      }
      split(from) {
        let result2 = [], off = 0, detachFrom = -1, i2 = 0;
        for (let elt of this.children) {
          let end2 = off + elt.length;
          if (end2 > from)
            result2.push(off < from ? elt.split(from - off) : elt);
          if (detachFrom < 0 && off >= from)
            detachFrom = i2;
          off = end2;
          i2++;
        }
        let length = this.length - from;
        this.length = from;
        if (detachFrom > -1) {
          this.children.length = detachFrom;
          this.markDirty();
        }
        return new MarkView(this.mark, result2, length);
      }
      domAtPos(pos2) {
        return inlineDOMAtPos(this, pos2);
      }
      coordsAt(pos2, side) {
        return coordsInChildren(this, pos2, side);
      }
    }
    function textCoords(text2, pos2, side) {
      let length = text2.nodeValue.length;
      if (pos2 > length)
        pos2 = length;
      let from = pos2, to2 = pos2, flatten2 = 0;
      if (pos2 == 0 && side < 0 || pos2 == length && side >= 0) {
        if (!(browser.chrome || browser.gecko)) {
          if (pos2) {
            from--;
            flatten2 = 1;
          } else if (to2 < length) {
            to2++;
            flatten2 = -1;
          }
        }
      } else {
        if (side < 0)
          from--;
        else if (to2 < length)
          to2++;
      }
      let rects = textRange(text2, from, to2).getClientRects();
      if (!rects.length)
        return null;
      let rect2 = rects[(flatten2 ? flatten2 < 0 : side >= 0) ? 0 : rects.length - 1];
      if (browser.safari && !flatten2 && rect2.width == 0)
        rect2 = Array.prototype.find.call(rects, (r2) => r2.width) || rect2;
      return flatten2 ? flattenRect(rect2, flatten2 < 0) : rect2 || null;
    }
    class WidgetView extends ContentView {
      static create(widget, length, side) {
        return new WidgetView(widget, length, side);
      }
      constructor(widget, length, side) {
        super();
        this.widget = widget;
        this.length = length;
        this.side = side;
        this.prevWidget = null;
      }
      split(from) {
        let result2 = WidgetView.create(this.widget, this.length - from, this.side);
        this.length -= from;
        return result2;
      }
      sync(view) {
        if (!this.dom || !this.widget.updateDOM(this.dom, view)) {
          if (this.dom && this.prevWidget)
            this.prevWidget.destroy(this.dom);
          this.prevWidget = null;
          this.setDOM(this.widget.toDOM(view));
          if (!this.widget.editable)
            this.dom.contentEditable = "false";
        }
      }
      getSide() {
        return this.side;
      }
      merge(from, to2, source2, hasStart, openStart, openEnd) {
        if (source2 && (!(source2 instanceof WidgetView) || !this.widget.compare(source2.widget) || from > 0 && openStart <= 0 || to2 < this.length && openEnd <= 0))
          return false;
        this.length = from + (source2 ? source2.length : 0) + (this.length - to2);
        return true;
      }
      become(other) {
        if (other instanceof WidgetView && other.side == this.side && this.widget.constructor == other.widget.constructor) {
          if (!this.widget.compare(other.widget))
            this.markDirty(true);
          if (this.dom && !this.prevWidget)
            this.prevWidget = this.widget;
          this.widget = other.widget;
          this.length = other.length;
          return true;
        }
        return false;
      }
      ignoreMutation() {
        return true;
      }
      ignoreEvent(event) {
        return this.widget.ignoreEvent(event);
      }
      get overrideDOMText() {
        if (this.length == 0)
          return Text.empty;
        let top2 = this;
        while (top2.parent)
          top2 = top2.parent;
        let { view } = top2, text2 = view && view.state.doc, start2 = this.posAtStart;
        return text2 ? text2.slice(start2, start2 + this.length) : Text.empty;
      }
      domAtPos(pos2) {
        return (this.length ? pos2 == 0 : this.side > 0) ? DOMPos.before(this.dom) : DOMPos.after(this.dom, pos2 == this.length);
      }
      domBoundsAround() {
        return null;
      }
      coordsAt(pos2, side) {
        let custom = this.widget.coordsAt(this.dom, pos2, side);
        if (custom)
          return custom;
        let rects = this.dom.getClientRects(), rect2 = null;
        if (!rects.length)
          return null;
        let fromBack = this.side ? this.side < 0 : pos2 > 0;
        for (let i2 = fromBack ? rects.length - 1 : 0; ; i2 += fromBack ? -1 : 1) {
          rect2 = rects[i2];
          if (pos2 > 0 ? i2 == 0 : i2 == rects.length - 1 || rect2.top < rect2.bottom)
            break;
        }
        return flattenRect(rect2, !fromBack);
      }
      get isEditable() {
        return false;
      }
      get isWidget() {
        return true;
      }
      get isHidden() {
        return this.widget.isHidden;
      }
      destroy() {
        super.destroy();
        if (this.dom)
          this.widget.destroy(this.dom);
      }
    }
    class WidgetBufferView extends ContentView {
      constructor(side) {
        super();
        this.side = side;
      }
      get length() {
        return 0;
      }
      merge() {
        return false;
      }
      become(other) {
        return other instanceof WidgetBufferView && other.side == this.side;
      }
      split() {
        return new WidgetBufferView(this.side);
      }
      sync() {
        if (!this.dom) {
          let dom = document.createElement("img");
          dom.className = "cm-widgetBuffer";
          dom.setAttribute("aria-hidden", "true");
          this.setDOM(dom);
        }
      }
      getSide() {
        return this.side;
      }
      domAtPos(pos2) {
        return this.side > 0 ? DOMPos.before(this.dom) : DOMPos.after(this.dom);
      }
      localPosFromDOM() {
        return 0;
      }
      domBoundsAround() {
        return null;
      }
      coordsAt(pos2) {
        return this.dom.getBoundingClientRect();
      }
      get overrideDOMText() {
        return Text.empty;
      }
      get isHidden() {
        return true;
      }
    }
    TextView.prototype.children = WidgetView.prototype.children = WidgetBufferView.prototype.children = noChildren;
    function inlineDOMAtPos(parent, pos2) {
      let dom = parent.dom, { children: children2 } = parent, i2 = 0;
      for (let off = 0; i2 < children2.length; i2++) {
        let child = children2[i2], end2 = off + child.length;
        if (end2 == off && child.getSide() <= 0)
          continue;
        if (pos2 > off && pos2 < end2 && child.dom.parentNode == dom)
          return child.domAtPos(pos2 - off);
        if (pos2 <= off)
          break;
        off = end2;
      }
      for (let j = i2; j > 0; j--) {
        let prev = children2[j - 1];
        if (prev.dom.parentNode == dom)
          return prev.domAtPos(prev.length);
      }
      for (let j = i2; j < children2.length; j++) {
        let next = children2[j];
        if (next.dom.parentNode == dom)
          return next.domAtPos(0);
      }
      return new DOMPos(dom, 0);
    }
    function joinInlineInto(parent, view, open) {
      let last, { children: children2 } = parent;
      if (open > 0 && view instanceof MarkView && children2.length && (last = children2[children2.length - 1]) instanceof MarkView && last.mark.eq(view.mark)) {
        joinInlineInto(last, view.children[0], open - 1);
      } else {
        children2.push(view);
        view.setParent(parent);
      }
      parent.length += view.length;
    }
    function coordsInChildren(view, pos2, side) {
      let before = null, beforePos = -1, after = null, afterPos = -1;
      function scan(view2, pos3) {
        for (let i2 = 0, off = 0; i2 < view2.children.length && off <= pos3; i2++) {
          let child = view2.children[i2], end2 = off + child.length;
          if (end2 >= pos3) {
            if (child.children.length) {
              scan(child, pos3 - off);
            } else if ((!after || after.isHidden && (side > 0 || onSameLine(after, child))) && (end2 > pos3 || off == end2 && child.getSide() > 0)) {
              after = child;
              afterPos = pos3 - off;
            } else if (off < pos3 || off == end2 && child.getSide() < 0 && !child.isHidden) {
              before = child;
              beforePos = pos3 - off;
            }
          }
          off = end2;
        }
      }
      scan(view, pos2);
      let target2 = (side < 0 ? before : after) || before || after;
      if (target2)
        return target2.coordsAt(Math.max(0, target2 == before ? beforePos : afterPos), side);
      return fallbackRect(view);
    }
    function fallbackRect(view) {
      let last = view.dom.lastChild;
      if (!last)
        return view.dom.getBoundingClientRect();
      let rects = clientRectsFor(last);
      return rects[rects.length - 1] || null;
    }
    function onSameLine(a, b) {
      let posA = a.coordsAt(0, 1), posB = b.coordsAt(0, 1);
      return posA && posB && posB.top < posA.bottom;
    }
    function combineAttrs(source2, target2) {
      for (let name2 in source2) {
        if (name2 == "class" && target2.class)
          target2.class += " " + source2.class;
        else if (name2 == "style" && target2.style)
          target2.style += ";" + source2.style;
        else
          target2[name2] = source2[name2];
      }
      return target2;
    }
    const noAttrs$1 = /* @__PURE__ */ Object.create(null);
    function attrsEq(a, b, ignore) {
      if (a == b)
        return true;
      if (!a)
        a = noAttrs$1;
      if (!b)
        b = noAttrs$1;
      let keysA = Object.keys(a), keysB = Object.keys(b);
      if (keysA.length - (ignore && keysA.indexOf(ignore) > -1 ? 1 : 0) != keysB.length - (ignore && keysB.indexOf(ignore) > -1 ? 1 : 0))
        return false;
      for (let key2 of keysA) {
        if (key2 != ignore && (keysB.indexOf(key2) == -1 || a[key2] !== b[key2]))
          return false;
      }
      return true;
    }
    function updateAttrs(dom, prev, attrs) {
      let changed = false;
      if (prev) {
        for (let name2 in prev)
          if (!(attrs && name2 in attrs)) {
            changed = true;
            if (name2 == "style")
              dom.style.cssText = "";
            else
              dom.removeAttribute(name2);
          }
      }
      if (attrs) {
        for (let name2 in attrs)
          if (!(prev && prev[name2] == attrs[name2])) {
            changed = true;
            if (name2 == "style")
              dom.style.cssText = attrs[name2];
            else
              dom.setAttribute(name2, attrs[name2]);
          }
      }
      return changed;
    }
    function getAttrs(dom) {
      let attrs = /* @__PURE__ */ Object.create(null);
      for (let i2 = 0; i2 < dom.attributes.length; i2++) {
        let attr = dom.attributes[i2];
        attrs[attr.name] = attr.value;
      }
      return attrs;
    }
    class WidgetType {
      /**
      Compare this instance to another instance of the same type.
      (TypeScript can't express this, but only instances of the same
      specific class will be passed to this method.) This is used to
      avoid redrawing widgets when they are replaced by a new
      decoration of the same type. The default implementation just
      returns `false`, which will cause new instances of the widget to
      always be redrawn.
      */
      eq(widget) {
        return false;
      }
      /**
      Update a DOM element created by a widget of the same type (but
      different, non-`eq` content) to reflect this widget. May return
      true to indicate that it could update, false to indicate it
      couldn't (in which case the widget will be redrawn). The default
      implementation just returns false.
      */
      updateDOM(dom, view) {
        return false;
      }
      /**
      @internal
      */
      compare(other) {
        return this == other || this.constructor == other.constructor && this.eq(other);
      }
      /**
      The estimated height this widget will have, to be used when
      estimating the height of content that hasn't been drawn. May
      return -1 to indicate you don't know. The default implementation
      returns -1.
      */
      get estimatedHeight() {
        return -1;
      }
      /**
      For inline widgets that are displayed inline (as opposed to
      `inline-block`) and introduce line breaks (through `<br>` tags
      or textual newlines), this must indicate the amount of line
      breaks they introduce. Defaults to 0.
      */
      get lineBreaks() {
        return 0;
      }
      /**
      Can be used to configure which kinds of events inside the widget
      should be ignored by the editor. The default is to ignore all
      events.
      */
      ignoreEvent(event) {
        return true;
      }
      /**
      Override the way screen coordinates for positions at/in the
      widget are found. `pos` will be the offset into the widget, and
      `side` the side of the position that is being queried—less than
      zero for before, greater than zero for after, and zero for
      directly at that position.
      */
      coordsAt(dom, pos2, side) {
        return null;
      }
      /**
      @internal
      */
      get isHidden() {
        return false;
      }
      /**
      @internal
      */
      get editable() {
        return false;
      }
      /**
      This is called when the an instance of the widget is removed
      from the editor view.
      */
      destroy(dom) {
      }
    }
    var BlockType = /* @__PURE__ */ (function(BlockType2) {
      BlockType2[BlockType2["Text"] = 0] = "Text";
      BlockType2[BlockType2["WidgetBefore"] = 1] = "WidgetBefore";
      BlockType2[BlockType2["WidgetAfter"] = 2] = "WidgetAfter";
      BlockType2[BlockType2["WidgetRange"] = 3] = "WidgetRange";
      return BlockType2;
    })(BlockType || (BlockType = {}));
    class Decoration extends RangeValue {
      constructor(startSide, endSide, widget, spec) {
        super();
        this.startSide = startSide;
        this.endSide = endSide;
        this.widget = widget;
        this.spec = spec;
      }
      /**
      @internal
      */
      get heightRelevant() {
        return false;
      }
      /**
      Create a mark decoration, which influences the styling of the
      content in its range. Nested mark decorations will cause nested
      DOM elements to be created. Nesting order is determined by
      precedence of the [facet](https://codemirror.net/6/docs/ref/#view.EditorView^decorations), with
      the higher-precedence decorations creating the inner DOM nodes.
      Such elements are split on line boundaries and on the boundaries
      of lower-precedence decorations.
      */
      static mark(spec) {
        return new MarkDecoration(spec);
      }
      /**
      Create a widget decoration, which displays a DOM element at the
      given position.
      */
      static widget(spec) {
        let side = Math.max(-1e4, Math.min(1e4, spec.side || 0)), block2 = !!spec.block;
        side += block2 && !spec.inlineOrder ? side > 0 ? 3e8 : -4e8 : side > 0 ? 1e8 : -1e8;
        return new PointDecoration(spec, side, side, block2, spec.widget || null, false);
      }
      /**
      Create a replace decoration which replaces the given range with
      a widget, or simply hides it.
      */
      static replace(spec) {
        let block2 = !!spec.block, startSide, endSide;
        if (spec.isBlockGap) {
          startSide = -5e8;
          endSide = 4e8;
        } else {
          let { start: start2, end: end2 } = getInclusive(spec, block2);
          startSide = (start2 ? block2 ? -3e8 : -1 : 5e8) - 1;
          endSide = (end2 ? block2 ? 2e8 : 1 : -6e8) + 1;
        }
        return new PointDecoration(spec, startSide, endSide, block2, spec.widget || null, true);
      }
      /**
      Create a line decoration, which can add DOM attributes to the
      line starting at the given position.
      */
      static line(spec) {
        return new LineDecoration(spec);
      }
      /**
      Build a [`DecorationSet`](https://codemirror.net/6/docs/ref/#view.DecorationSet) from the given
      decorated range or ranges. If the ranges aren't already sorted,
      pass `true` for `sort` to make the library sort them for you.
      */
      static set(of, sort2 = false) {
        return RangeSet.of(of, sort2);
      }
      /**
      @internal
      */
      hasHeight() {
        return this.widget ? this.widget.estimatedHeight > -1 : false;
      }
    }
    Decoration.none = RangeSet.empty;
    class MarkDecoration extends Decoration {
      constructor(spec) {
        let { start: start2, end: end2 } = getInclusive(spec);
        super(start2 ? -1 : 5e8, end2 ? 1 : -6e8, null, spec);
        this.tagName = spec.tagName || "span";
        this.class = spec.class || "";
        this.attrs = spec.attributes || null;
      }
      eq(other) {
        var _a2, _b2;
        return this == other || other instanceof MarkDecoration && this.tagName == other.tagName && (this.class || ((_a2 = this.attrs) === null || _a2 === void 0 ? void 0 : _a2.class)) == (other.class || ((_b2 = other.attrs) === null || _b2 === void 0 ? void 0 : _b2.class)) && attrsEq(this.attrs, other.attrs, "class");
      }
      range(from, to2 = from) {
        if (from >= to2)
          throw new RangeError("Mark decorations may not be empty");
        return super.range(from, to2);
      }
    }
    MarkDecoration.prototype.point = false;
    class LineDecoration extends Decoration {
      constructor(spec) {
        super(-2e8, -2e8, null, spec);
      }
      eq(other) {
        return other instanceof LineDecoration && this.spec.class == other.spec.class && attrsEq(this.spec.attributes, other.spec.attributes);
      }
      range(from, to2 = from) {
        if (to2 != from)
          throw new RangeError("Line decoration ranges must be zero-length");
        return super.range(from, to2);
      }
    }
    LineDecoration.prototype.mapMode = MapMode.TrackBefore;
    LineDecoration.prototype.point = true;
    class PointDecoration extends Decoration {
      constructor(spec, startSide, endSide, block2, widget, isReplace) {
        super(startSide, endSide, widget, spec);
        this.block = block2;
        this.isReplace = isReplace;
        this.mapMode = !block2 ? MapMode.TrackDel : startSide <= 0 ? MapMode.TrackBefore : MapMode.TrackAfter;
      }
      // Only relevant when this.block == true
      get type() {
        return this.startSide != this.endSide ? BlockType.WidgetRange : this.startSide <= 0 ? BlockType.WidgetBefore : BlockType.WidgetAfter;
      }
      get heightRelevant() {
        return this.block || !!this.widget && (this.widget.estimatedHeight >= 5 || this.widget.lineBreaks > 0);
      }
      eq(other) {
        return other instanceof PointDecoration && widgetsEq(this.widget, other.widget) && this.block == other.block && this.startSide == other.startSide && this.endSide == other.endSide;
      }
      range(from, to2 = from) {
        if (this.isReplace && (from > to2 || from == to2 && this.startSide > 0 && this.endSide <= 0))
          throw new RangeError("Invalid range for replacement decoration");
        if (!this.isReplace && to2 != from)
          throw new RangeError("Widget decorations can only have zero-length ranges");
        return super.range(from, to2);
      }
    }
    PointDecoration.prototype.point = true;
    function getInclusive(spec, block2 = false) {
      let { inclusiveStart: start2, inclusiveEnd: end2 } = spec;
      if (start2 == null)
        start2 = spec.inclusive;
      if (end2 == null)
        end2 = spec.inclusive;
      return { start: start2 !== null && start2 !== void 0 ? start2 : block2, end: end2 !== null && end2 !== void 0 ? end2 : block2 };
    }
    function widgetsEq(a, b) {
      return a == b || !!(a && b && a.compare(b));
    }
    function addRange(from, to2, ranges, margin = 0) {
      let last = ranges.length - 1;
      if (last >= 0 && ranges[last] + margin >= from)
        ranges[last] = Math.max(ranges[last], to2);
      else
        ranges.push(from, to2);
    }
    class LineView extends ContentView {
      constructor() {
        super(...arguments);
        this.children = [];
        this.length = 0;
        this.prevAttrs = void 0;
        this.attrs = null;
        this.breakAfter = 0;
      }
      // Consumes source
      merge(from, to2, source2, hasStart, openStart, openEnd) {
        if (source2) {
          if (!(source2 instanceof LineView))
            return false;
          if (!this.dom)
            source2.transferDOM(this);
        }
        if (hasStart)
          this.setDeco(source2 ? source2.attrs : null);
        mergeChildrenInto(this, from, to2, source2 ? source2.children.slice() : [], openStart, openEnd);
        return true;
      }
      split(at) {
        let end2 = new LineView();
        end2.breakAfter = this.breakAfter;
        if (this.length == 0)
          return end2;
        let { i: i2, off } = this.childPos(at);
        if (off) {
          end2.append(this.children[i2].split(off), 0);
          this.children[i2].merge(off, this.children[i2].length, null, false, 0, 0);
          i2++;
        }
        for (let j = i2; j < this.children.length; j++)
          end2.append(this.children[j], 0);
        while (i2 > 0 && this.children[i2 - 1].length == 0)
          this.children[--i2].destroy();
        this.children.length = i2;
        this.markDirty();
        this.length = at;
        return end2;
      }
      transferDOM(other) {
        if (!this.dom)
          return;
        this.markDirty();
        other.setDOM(this.dom);
        other.prevAttrs = this.prevAttrs === void 0 ? this.attrs : this.prevAttrs;
        this.prevAttrs = void 0;
        this.dom = null;
      }
      setDeco(attrs) {
        if (!attrsEq(this.attrs, attrs)) {
          if (this.dom) {
            this.prevAttrs = this.attrs;
            this.markDirty();
          }
          this.attrs = attrs;
        }
      }
      append(child, openStart) {
        joinInlineInto(this, child, openStart);
      }
      // Only called when building a line view in ContentBuilder
      addLineDeco(deco) {
        let attrs = deco.spec.attributes, cls = deco.spec.class;
        if (attrs)
          this.attrs = combineAttrs(attrs, this.attrs || {});
        if (cls)
          this.attrs = combineAttrs({ class: cls }, this.attrs || {});
      }
      domAtPos(pos2) {
        return inlineDOMAtPos(this, pos2);
      }
      reuseDOM(node2) {
        if (node2.nodeName == "DIV") {
          this.setDOM(node2);
          this.flags |= 4 | 2;
        }
      }
      sync(view, track) {
        var _a2;
        if (!this.dom) {
          this.setDOM(document.createElement("div"));
          this.dom.className = "cm-line";
          this.prevAttrs = this.attrs ? null : void 0;
        } else if (this.flags & 4) {
          clearAttributes(this.dom);
          this.dom.className = "cm-line";
          this.prevAttrs = this.attrs ? null : void 0;
        }
        if (this.prevAttrs !== void 0) {
          updateAttrs(this.dom, this.prevAttrs, this.attrs);
          this.dom.classList.add("cm-line");
          this.prevAttrs = void 0;
        }
        super.sync(view, track);
        let last = this.dom.lastChild;
        while (last && ContentView.get(last) instanceof MarkView)
          last = last.lastChild;
        if (!last || !this.length || last.nodeName != "BR" && ((_a2 = ContentView.get(last)) === null || _a2 === void 0 ? void 0 : _a2.isEditable) == false && (!browser.ios || !this.children.some((ch3) => ch3 instanceof TextView))) {
          let hack = document.createElement("BR");
          hack.cmIgnore = true;
          this.dom.appendChild(hack);
        }
      }
      measureTextSize() {
        if (this.children.length == 0 || this.length > 20)
          return null;
        let totalWidth = 0, textHeight;
        for (let child of this.children) {
          if (!(child instanceof TextView) || /[^ -~]/.test(child.text))
            return null;
          let rects = clientRectsFor(child.dom);
          if (rects.length != 1)
            return null;
          totalWidth += rects[0].width;
          textHeight = rects[0].height;
        }
        return !totalWidth ? null : {
          lineHeight: this.dom.getBoundingClientRect().height,
          charWidth: totalWidth / this.length,
          textHeight
        };
      }
      coordsAt(pos2, side) {
        let rect2 = coordsInChildren(this, pos2, side);
        if (!this.children.length && rect2 && this.parent) {
          let { heightOracle } = this.parent.view.viewState, height = rect2.bottom - rect2.top;
          if (Math.abs(height - heightOracle.lineHeight) < 2 && heightOracle.textHeight < height) {
            let dist2 = (height - heightOracle.textHeight) / 2;
            return { top: rect2.top + dist2, bottom: rect2.bottom - dist2, left: rect2.left, right: rect2.left };
          }
        }
        return rect2;
      }
      become(other) {
        return other instanceof LineView && this.children.length == 0 && other.children.length == 0 && attrsEq(this.attrs, other.attrs) && this.breakAfter == other.breakAfter;
      }
      covers() {
        return true;
      }
      static find(docView, pos2) {
        for (let i2 = 0, off = 0; i2 < docView.children.length; i2++) {
          let block2 = docView.children[i2], end2 = off + block2.length;
          if (end2 >= pos2) {
            if (block2 instanceof LineView)
              return block2;
            if (end2 > pos2)
              break;
          }
          off = end2 + block2.breakAfter;
        }
        return null;
      }
    }
    class BlockWidgetView extends ContentView {
      constructor(widget, length, deco) {
        super();
        this.widget = widget;
        this.length = length;
        this.deco = deco;
        this.breakAfter = 0;
        this.prevWidget = null;
      }
      merge(from, to2, source2, _takeDeco, openStart, openEnd) {
        if (source2 && (!(source2 instanceof BlockWidgetView) || !this.widget.compare(source2.widget) || from > 0 && openStart <= 0 || to2 < this.length && openEnd <= 0))
          return false;
        this.length = from + (source2 ? source2.length : 0) + (this.length - to2);
        return true;
      }
      domAtPos(pos2) {
        return pos2 == 0 ? DOMPos.before(this.dom) : DOMPos.after(this.dom, pos2 == this.length);
      }
      split(at) {
        let len = this.length - at;
        this.length = at;
        let end2 = new BlockWidgetView(this.widget, len, this.deco);
        end2.breakAfter = this.breakAfter;
        return end2;
      }
      get children() {
        return noChildren;
      }
      sync(view) {
        if (!this.dom || !this.widget.updateDOM(this.dom, view)) {
          if (this.dom && this.prevWidget)
            this.prevWidget.destroy(this.dom);
          this.prevWidget = null;
          this.setDOM(this.widget.toDOM(view));
          if (!this.widget.editable)
            this.dom.contentEditable = "false";
        }
      }
      get overrideDOMText() {
        return this.parent ? this.parent.view.state.doc.slice(this.posAtStart, this.posAtEnd) : Text.empty;
      }
      domBoundsAround() {
        return null;
      }
      become(other) {
        if (other instanceof BlockWidgetView && other.widget.constructor == this.widget.constructor) {
          if (!other.widget.compare(this.widget))
            this.markDirty(true);
          if (this.dom && !this.prevWidget)
            this.prevWidget = this.widget;
          this.widget = other.widget;
          this.length = other.length;
          this.deco = other.deco;
          this.breakAfter = other.breakAfter;
          return true;
        }
        return false;
      }
      ignoreMutation() {
        return true;
      }
      ignoreEvent(event) {
        return this.widget.ignoreEvent(event);
      }
      get isEditable() {
        return false;
      }
      get isWidget() {
        return true;
      }
      coordsAt(pos2, side) {
        let custom = this.widget.coordsAt(this.dom, pos2, side);
        if (custom)
          return custom;
        if (this.widget instanceof BlockGapWidget)
          return null;
        return flattenRect(this.dom.getBoundingClientRect(), this.length ? pos2 == 0 : side <= 0);
      }
      destroy() {
        super.destroy();
        if (this.dom)
          this.widget.destroy(this.dom);
      }
      covers(side) {
        let { startSide, endSide } = this.deco;
        return startSide == endSide ? false : side < 0 ? startSide < 0 : endSide > 0;
      }
    }
    class BlockGapWidget extends WidgetType {
      constructor(height) {
        super();
        this.height = height;
      }
      toDOM() {
        let elt = document.createElement("div");
        elt.className = "cm-gap";
        this.updateDOM(elt);
        return elt;
      }
      eq(other) {
        return other.height == this.height;
      }
      updateDOM(elt) {
        elt.style.height = this.height + "px";
        return true;
      }
      get editable() {
        return true;
      }
      get estimatedHeight() {
        return this.height;
      }
      ignoreEvent() {
        return false;
      }
    }
    class ContentBuilder {
      constructor(doc2, pos2, end2, disallowBlockEffectsFor) {
        this.doc = doc2;
        this.pos = pos2;
        this.end = end2;
        this.disallowBlockEffectsFor = disallowBlockEffectsFor;
        this.content = [];
        this.curLine = null;
        this.breakAtStart = 0;
        this.pendingBuffer = 0;
        this.bufferMarks = [];
        this.atCursorPos = true;
        this.openStart = -1;
        this.openEnd = -1;
        this.text = "";
        this.textOff = 0;
        this.cursor = doc2.iter();
        this.skip = pos2;
      }
      posCovered() {
        if (this.content.length == 0)
          return !this.breakAtStart && this.doc.lineAt(this.pos).from != this.pos;
        let last = this.content[this.content.length - 1];
        return !(last.breakAfter || last instanceof BlockWidgetView && last.deco.endSide < 0);
      }
      getLine() {
        if (!this.curLine) {
          this.content.push(this.curLine = new LineView());
          this.atCursorPos = true;
        }
        return this.curLine;
      }
      flushBuffer(active = this.bufferMarks) {
        if (this.pendingBuffer) {
          this.curLine.append(wrapMarks(new WidgetBufferView(-1), active), active.length);
          this.pendingBuffer = 0;
        }
      }
      addBlockWidget(view) {
        this.flushBuffer();
        this.curLine = null;
        this.content.push(view);
      }
      finish(openEnd) {
        if (this.pendingBuffer && openEnd <= this.bufferMarks.length)
          this.flushBuffer();
        else
          this.pendingBuffer = 0;
        if (!this.posCovered() && !(openEnd && this.content.length && this.content[this.content.length - 1] instanceof BlockWidgetView))
          this.getLine();
      }
      buildText(length, active, openStart) {
        while (length > 0) {
          if (this.textOff == this.text.length) {
            let { value: value2, lineBreak, done } = this.cursor.next(this.skip);
            this.skip = 0;
            if (done)
              throw new Error("Ran out of text content when drawing inline views");
            if (lineBreak) {
              if (!this.posCovered())
                this.getLine();
              if (this.content.length)
                this.content[this.content.length - 1].breakAfter = 1;
              else
                this.breakAtStart = 1;
              this.flushBuffer();
              this.curLine = null;
              this.atCursorPos = true;
              length--;
              continue;
            } else {
              this.text = value2;
              this.textOff = 0;
            }
          }
          let take = Math.min(
            this.text.length - this.textOff,
            length,
            512
            /* T.Chunk */
          );
          this.flushBuffer(active.slice(active.length - openStart));
          this.getLine().append(wrapMarks(new TextView(this.text.slice(this.textOff, this.textOff + take)), active), openStart);
          this.atCursorPos = true;
          this.textOff += take;
          length -= take;
          openStart = 0;
        }
      }
      span(from, to2, active, openStart) {
        this.buildText(to2 - from, active, openStart);
        this.pos = to2;
        if (this.openStart < 0)
          this.openStart = openStart;
      }
      point(from, to2, deco, active, openStart, index) {
        if (this.disallowBlockEffectsFor[index] && deco instanceof PointDecoration) {
          if (deco.block)
            throw new RangeError("Block decorations may not be specified via plugins");
          if (to2 > this.doc.lineAt(this.pos).to)
            throw new RangeError("Decorations that replace line breaks may not be specified via plugins");
        }
        let len = to2 - from;
        if (deco instanceof PointDecoration) {
          if (deco.block) {
            if (deco.startSide > 0 && !this.posCovered())
              this.getLine();
            this.addBlockWidget(new BlockWidgetView(deco.widget || NullWidget.block, len, deco));
          } else {
            let view = WidgetView.create(deco.widget || NullWidget.inline, len, len ? 0 : deco.startSide);
            let cursorBefore = this.atCursorPos && !view.isEditable && openStart <= active.length && (from < to2 || deco.startSide > 0);
            let cursorAfter = !view.isEditable && (from < to2 || openStart > active.length || deco.startSide <= 0);
            let line2 = this.getLine();
            if (this.pendingBuffer == 2 && !cursorBefore && !view.isEditable)
              this.pendingBuffer = 0;
            this.flushBuffer(active);
            if (cursorBefore) {
              line2.append(wrapMarks(new WidgetBufferView(1), active), openStart);
              openStart = active.length + Math.max(0, openStart - active.length);
            }
            line2.append(wrapMarks(view, active), openStart);
            this.atCursorPos = cursorAfter;
            this.pendingBuffer = !cursorAfter ? 0 : from < to2 || openStart > active.length ? 1 : 2;
            if (this.pendingBuffer)
              this.bufferMarks = active.slice();
          }
        } else if (this.doc.lineAt(this.pos).from == this.pos) {
          this.getLine().addLineDeco(deco);
        }
        if (len) {
          if (this.textOff + len <= this.text.length) {
            this.textOff += len;
          } else {
            this.skip += len - (this.text.length - this.textOff);
            this.text = "";
            this.textOff = 0;
          }
          this.pos = to2;
        }
        if (this.openStart < 0)
          this.openStart = openStart;
      }
      static build(text2, from, to2, decorations2, dynamicDecorationMap) {
        let builder = new ContentBuilder(text2, from, to2, dynamicDecorationMap);
        builder.openEnd = RangeSet.spans(decorations2, from, to2, builder);
        if (builder.openStart < 0)
          builder.openStart = builder.openEnd;
        builder.finish(builder.openEnd);
        return builder;
      }
    }
    function wrapMarks(view, active) {
      for (let mark of active)
        view = new MarkView(mark, [view], view.length);
      return view;
    }
    class NullWidget extends WidgetType {
      constructor(tag) {
        super();
        this.tag = tag;
      }
      eq(other) {
        return other.tag == this.tag;
      }
      toDOM() {
        return document.createElement(this.tag);
      }
      updateDOM(elt) {
        return elt.nodeName.toLowerCase() == this.tag;
      }
      get isHidden() {
        return true;
      }
    }
    NullWidget.inline = /* @__PURE__ */ new NullWidget("span");
    NullWidget.block = /* @__PURE__ */ new NullWidget("div");
    var Direction = /* @__PURE__ */ (function(Direction2) {
      Direction2[Direction2["LTR"] = 0] = "LTR";
      Direction2[Direction2["RTL"] = 1] = "RTL";
      return Direction2;
    })(Direction || (Direction = {}));
    const LTR = Direction.LTR, RTL = Direction.RTL;
    function dec(str2) {
      let result2 = [];
      for (let i2 = 0; i2 < str2.length; i2++)
        result2.push(1 << +str2[i2]);
      return result2;
    }
    const LowTypes = /* @__PURE__ */ dec("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008");
    const ArabicTypes = /* @__PURE__ */ dec("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333");
    const Brackets = /* @__PURE__ */ Object.create(null), BracketStack = [];
    for (let p of ["()", "[]", "{}"]) {
      let l = /* @__PURE__ */ p.charCodeAt(0), r2 = /* @__PURE__ */ p.charCodeAt(1);
      Brackets[l] = r2;
      Brackets[r2] = -l;
    }
    function charType(ch3) {
      return ch3 <= 247 ? LowTypes[ch3] : 1424 <= ch3 && ch3 <= 1524 ? 2 : 1536 <= ch3 && ch3 <= 1785 ? ArabicTypes[ch3 - 1536] : 1774 <= ch3 && ch3 <= 2220 ? 4 : 8192 <= ch3 && ch3 <= 8204 ? 256 : 64336 <= ch3 && ch3 <= 65023 ? 4 : 1;
    }
    const BidiRE = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;
    class BidiSpan {
      /**
      The direction of this span.
      */
      get dir() {
        return this.level % 2 ? RTL : LTR;
      }
      /**
      @internal
      */
      constructor(from, to2, level) {
        this.from = from;
        this.to = to2;
        this.level = level;
      }
      /**
      @internal
      */
      side(end2, dir) {
        return this.dir == dir == end2 ? this.to : this.from;
      }
      /**
      @internal
      */
      forward(forward, dir) {
        return forward == (this.dir == dir);
      }
      /**
      @internal
      */
      static find(order2, index, level, assoc) {
        let maybe = -1;
        for (let i2 = 0; i2 < order2.length; i2++) {
          let span = order2[i2];
          if (span.from <= index && span.to >= index) {
            if (span.level == level)
              return i2;
            if (maybe < 0 || (assoc != 0 ? assoc < 0 ? span.from < index : span.to > index : order2[maybe].level > span.level))
              maybe = i2;
          }
        }
        if (maybe < 0)
          throw new RangeError("Index out of range");
        return maybe;
      }
    }
    function isolatesEq(a, b) {
      if (a.length != b.length)
        return false;
      for (let i2 = 0; i2 < a.length; i2++) {
        let iA = a[i2], iB = b[i2];
        if (iA.from != iB.from || iA.to != iB.to || iA.direction != iB.direction || !isolatesEq(iA.inner, iB.inner))
          return false;
      }
      return true;
    }
    const types = [];
    function computeCharTypes(line2, rFrom, rTo, isolates, outerType) {
      for (let iI = 0; iI <= isolates.length; iI++) {
        let from = iI ? isolates[iI - 1].to : rFrom, to2 = iI < isolates.length ? isolates[iI].from : rTo;
        let prevType = iI ? 256 : outerType;
        for (let i2 = from, prev = prevType, prevStrong = prevType; i2 < to2; i2++) {
          let type = charType(line2.charCodeAt(i2));
          if (type == 512)
            type = prev;
          else if (type == 8 && prevStrong == 4)
            type = 16;
          types[i2] = type == 4 ? 2 : type;
          if (type & 7)
            prevStrong = type;
          prev = type;
        }
        for (let i2 = from, prev = prevType, prevStrong = prevType; i2 < to2; i2++) {
          let type = types[i2];
          if (type == 128) {
            if (i2 < to2 - 1 && prev == types[i2 + 1] && prev & 24)
              type = types[i2] = prev;
            else
              types[i2] = 256;
          } else if (type == 64) {
            let end2 = i2 + 1;
            while (end2 < to2 && types[end2] == 64)
              end2++;
            let replace2 = i2 && prev == 8 || end2 < rTo && types[end2] == 8 ? prevStrong == 1 ? 1 : 8 : 256;
            for (let j = i2; j < end2; j++)
              types[j] = replace2;
            i2 = end2 - 1;
          } else if (type == 8 && prevStrong == 1) {
            types[i2] = 1;
          }
          prev = type;
          if (type & 7)
            prevStrong = type;
        }
      }
    }
    function processBracketPairs(line2, rFrom, rTo, isolates, outerType) {
      let oppositeType = outerType == 1 ? 2 : 1;
      for (let iI = 0, sI = 0, context = 0; iI <= isolates.length; iI++) {
        let from = iI ? isolates[iI - 1].to : rFrom, to2 = iI < isolates.length ? isolates[iI].from : rTo;
        for (let i2 = from, ch3, br, type; i2 < to2; i2++) {
          if (br = Brackets[ch3 = line2.charCodeAt(i2)]) {
            if (br < 0) {
              for (let sJ = sI - 3; sJ >= 0; sJ -= 3) {
                if (BracketStack[sJ + 1] == -br) {
                  let flags = BracketStack[sJ + 2];
                  let type2 = flags & 2 ? outerType : !(flags & 4) ? 0 : flags & 1 ? oppositeType : outerType;
                  if (type2)
                    types[i2] = types[BracketStack[sJ]] = type2;
                  sI = sJ;
                  break;
                }
              }
            } else if (BracketStack.length == 189) {
              break;
            } else {
              BracketStack[sI++] = i2;
              BracketStack[sI++] = ch3;
              BracketStack[sI++] = context;
            }
          } else if ((type = types[i2]) == 2 || type == 1) {
            let embed = type == outerType;
            context = embed ? 0 : 1;
            for (let sJ = sI - 3; sJ >= 0; sJ -= 3) {
              let cur2 = BracketStack[sJ + 2];
              if (cur2 & 2)
                break;
              if (embed) {
                BracketStack[sJ + 2] |= 2;
              } else {
                if (cur2 & 4)
                  break;
                BracketStack[sJ + 2] |= 4;
              }
            }
          }
        }
      }
    }
    function processNeutrals(rFrom, rTo, isolates, outerType) {
      for (let iI = 0, prev = outerType; iI <= isolates.length; iI++) {
        let from = iI ? isolates[iI - 1].to : rFrom, to2 = iI < isolates.length ? isolates[iI].from : rTo;
        for (let i2 = from; i2 < to2; ) {
          let type = types[i2];
          if (type == 256) {
            let end2 = i2 + 1;
            for (; ; ) {
              if (end2 == to2) {
                if (iI == isolates.length)
                  break;
                end2 = isolates[iI++].to;
                to2 = iI < isolates.length ? isolates[iI].from : rTo;
              } else if (types[end2] == 256) {
                end2++;
              } else {
                break;
              }
            }
            let beforeL = prev == 1;
            let afterL = (end2 < rTo ? types[end2] : outerType) == 1;
            let replace2 = beforeL == afterL ? beforeL ? 1 : 2 : outerType;
            for (let j = end2, jI = iI, fromJ = jI ? isolates[jI - 1].to : rFrom; j > i2; ) {
              if (j == fromJ) {
                j = isolates[--jI].from;
                fromJ = jI ? isolates[jI - 1].to : rFrom;
              }
              types[--j] = replace2;
            }
            i2 = end2;
          } else {
            prev = type;
            i2++;
          }
        }
      }
    }
    function emitSpans(line2, from, to2, level, baseLevel, isolates, order2) {
      let ourType = level % 2 ? 2 : 1;
      if (level % 2 == baseLevel % 2) {
        for (let iCh = from, iI = 0; iCh < to2; ) {
          let sameDir = true, isNum = false;
          if (iI == isolates.length || iCh < isolates[iI].from) {
            let next = types[iCh];
            if (next != ourType) {
              sameDir = false;
              isNum = next == 16;
            }
          }
          let recurse = !sameDir && ourType == 1 ? [] : null;
          let localLevel = sameDir ? level : level + 1;
          let iScan = iCh;
          run: for (; ; ) {
            if (iI < isolates.length && iScan == isolates[iI].from) {
              if (isNum)
                break run;
              let iso = isolates[iI];
              if (!sameDir)
                for (let upto = iso.to, jI = iI + 1; ; ) {
                  if (upto == to2)
                    break run;
                  if (jI < isolates.length && isolates[jI].from == upto)
                    upto = isolates[jI++].to;
                  else if (types[upto] == ourType)
                    break run;
                  else
                    break;
                }
              iI++;
              if (recurse) {
                recurse.push(iso);
              } else {
                if (iso.from > iCh)
                  order2.push(new BidiSpan(iCh, iso.from, localLevel));
                let dirSwap = iso.direction == LTR != !(localLevel % 2);
                computeSectionOrder(line2, dirSwap ? level + 1 : level, baseLevel, iso.inner, iso.from, iso.to, order2);
                iCh = iso.to;
              }
              iScan = iso.to;
            } else if (iScan == to2 || (sameDir ? types[iScan] != ourType : types[iScan] == ourType)) {
              break;
            } else {
              iScan++;
            }
          }
          if (recurse)
            emitSpans(line2, iCh, iScan, level + 1, baseLevel, recurse, order2);
          else if (iCh < iScan)
            order2.push(new BidiSpan(iCh, iScan, localLevel));
          iCh = iScan;
        }
      } else {
        for (let iCh = to2, iI = isolates.length; iCh > from; ) {
          let sameDir = true, isNum = false;
          if (!iI || iCh > isolates[iI - 1].to) {
            let next = types[iCh - 1];
            if (next != ourType) {
              sameDir = false;
              isNum = next == 16;
            }
          }
          let recurse = !sameDir && ourType == 1 ? [] : null;
          let localLevel = sameDir ? level : level + 1;
          let iScan = iCh;
          run: for (; ; ) {
            if (iI && iScan == isolates[iI - 1].to) {
              if (isNum)
                break run;
              let iso = isolates[--iI];
              if (!sameDir)
                for (let upto = iso.from, jI = iI; ; ) {
                  if (upto == from)
                    break run;
                  if (jI && isolates[jI - 1].to == upto)
                    upto = isolates[--jI].from;
                  else if (types[upto - 1] == ourType)
                    break run;
                  else
                    break;
                }
              if (recurse) {
                recurse.push(iso);
              } else {
                if (iso.to < iCh)
                  order2.push(new BidiSpan(iso.to, iCh, localLevel));
                let dirSwap = iso.direction == LTR != !(localLevel % 2);
                computeSectionOrder(line2, dirSwap ? level + 1 : level, baseLevel, iso.inner, iso.from, iso.to, order2);
                iCh = iso.from;
              }
              iScan = iso.from;
            } else if (iScan == from || (sameDir ? types[iScan - 1] != ourType : types[iScan - 1] == ourType)) {
              break;
            } else {
              iScan--;
            }
          }
          if (recurse)
            emitSpans(line2, iScan, iCh, level + 1, baseLevel, recurse, order2);
          else if (iScan < iCh)
            order2.push(new BidiSpan(iScan, iCh, localLevel));
          iCh = iScan;
        }
      }
    }
    function computeSectionOrder(line2, level, baseLevel, isolates, from, to2, order2) {
      let outerType = level % 2 ? 2 : 1;
      computeCharTypes(line2, from, to2, isolates, outerType);
      processBracketPairs(line2, from, to2, isolates, outerType);
      processNeutrals(from, to2, isolates, outerType);
      emitSpans(line2, from, to2, level, baseLevel, isolates, order2);
    }
    function computeOrder(line2, direction, isolates) {
      if (!line2)
        return [new BidiSpan(0, 0, direction == RTL ? 1 : 0)];
      if (direction == LTR && !isolates.length && !BidiRE.test(line2))
        return trivialOrder(line2.length);
      if (isolates.length)
        while (line2.length > types.length)
          types[types.length] = 256;
      let order2 = [], level = direction == LTR ? 0 : 1;
      computeSectionOrder(line2, level, level, isolates, 0, line2.length, order2);
      return order2;
    }
    function trivialOrder(length) {
      return [new BidiSpan(0, length, 0)];
    }
    let movedOver = "";
    function moveVisually(line2, order2, dir, start2, forward) {
      var _a2;
      let startIndex = start2.head - line2.from;
      let spanI = BidiSpan.find(order2, startIndex, (_a2 = start2.bidiLevel) !== null && _a2 !== void 0 ? _a2 : -1, start2.assoc);
      let span = order2[spanI], spanEnd = span.side(forward, dir);
      if (startIndex == spanEnd) {
        let nextI = spanI += forward ? 1 : -1;
        if (nextI < 0 || nextI >= order2.length)
          return null;
        span = order2[spanI = nextI];
        startIndex = span.side(!forward, dir);
        spanEnd = span.side(forward, dir);
      }
      let nextIndex = findClusterBreak(line2.text, startIndex, span.forward(forward, dir));
      if (nextIndex < span.from || nextIndex > span.to)
        nextIndex = spanEnd;
      movedOver = line2.text.slice(Math.min(startIndex, nextIndex), Math.max(startIndex, nextIndex));
      let nextSpan = spanI == (forward ? order2.length - 1 : 0) ? null : order2[spanI + (forward ? 1 : -1)];
      if (nextSpan && nextIndex == spanEnd && nextSpan.level + (forward ? 0 : 1) < span.level)
        return EditorSelection.cursor(nextSpan.side(!forward, dir) + line2.from, nextSpan.forward(forward, dir) ? 1 : -1, nextSpan.level);
      return EditorSelection.cursor(nextIndex + line2.from, span.forward(forward, dir) ? -1 : 1, span.level);
    }
    function autoDirection(text2, from, to2) {
      for (let i2 = from; i2 < to2; i2++) {
        let type = charType(text2.charCodeAt(i2));
        if (type == 1)
          return LTR;
        if (type == 2 || type == 4)
          return RTL;
      }
      return LTR;
    }
    const clickAddsSelectionRange = /* @__PURE__ */ Facet.define();
    const dragMovesSelection$1 = /* @__PURE__ */ Facet.define();
    const mouseSelectionStyle = /* @__PURE__ */ Facet.define();
    const exceptionSink = /* @__PURE__ */ Facet.define();
    const updateListener = /* @__PURE__ */ Facet.define();
    const inputHandler = /* @__PURE__ */ Facet.define();
    const focusChangeEffect = /* @__PURE__ */ Facet.define();
    const clipboardInputFilter = /* @__PURE__ */ Facet.define();
    const clipboardOutputFilter = /* @__PURE__ */ Facet.define();
    const perLineTextDirection = /* @__PURE__ */ Facet.define({
      combine: (values) => values.some((x2) => x2)
    });
    const nativeSelectionHidden = /* @__PURE__ */ Facet.define({
      combine: (values) => values.some((x2) => x2)
    });
    const scrollHandler = /* @__PURE__ */ Facet.define();
    class ScrollTarget {
      constructor(range2, y = "nearest", x2 = "nearest", yMargin = 5, xMargin = 5, isSnapshot = false) {
        this.range = range2;
        this.y = y;
        this.x = x2;
        this.yMargin = yMargin;
        this.xMargin = xMargin;
        this.isSnapshot = isSnapshot;
      }
      map(changes) {
        return changes.empty ? this : new ScrollTarget(this.range.map(changes), this.y, this.x, this.yMargin, this.xMargin, this.isSnapshot);
      }
      clip(state) {
        return this.range.to <= state.doc.length ? this : new ScrollTarget(EditorSelection.cursor(state.doc.length), this.y, this.x, this.yMargin, this.xMargin, this.isSnapshot);
      }
    }
    const scrollIntoView$1 = /* @__PURE__ */ StateEffect.define({ map: (t2, ch3) => t2.map(ch3) });
    const setEditContextFormatting = /* @__PURE__ */ StateEffect.define();
    function logException(state, exception, context) {
      let handler = state.facet(exceptionSink);
      if (handler.length)
        handler[0](exception);
      else if (window.onerror)
        window.onerror(String(exception), context, void 0, void 0, exception);
      else if (context)
        console.error(context + ":", exception);
      else
        console.error(exception);
    }
    const editable = /* @__PURE__ */ Facet.define({ combine: (values) => values.length ? values[0] : true });
    let nextPluginID = 0;
    const viewPlugin = /* @__PURE__ */ Facet.define();
    class ViewPlugin {
      constructor(id, create2, domEventHandlers, domEventObservers, buildExtensions) {
        this.id = id;
        this.create = create2;
        this.domEventHandlers = domEventHandlers;
        this.domEventObservers = domEventObservers;
        this.extension = buildExtensions(this);
      }
      /**
      Define a plugin from a constructor function that creates the
      plugin's value, given an editor view.
      */
      static define(create2, spec) {
        const { eventHandlers, eventObservers, provide, decorations: deco } = spec || {};
        return new ViewPlugin(nextPluginID++, create2, eventHandlers, eventObservers, (plugin) => {
          let ext = [viewPlugin.of(plugin)];
          if (deco)
            ext.push(decorations.of((view) => {
              let pluginInst = view.plugin(plugin);
              return pluginInst ? deco(pluginInst) : Decoration.none;
            }));
          if (provide)
            ext.push(provide(plugin));
          return ext;
        });
      }
      /**
      Create a plugin for a class whose constructor takes a single
      editor view as argument.
      */
      static fromClass(cls, spec) {
        return ViewPlugin.define((view) => new cls(view), spec);
      }
    }
    class PluginInstance {
      constructor(spec) {
        this.spec = spec;
        this.mustUpdate = null;
        this.value = null;
      }
      update(view) {
        if (!this.value) {
          if (this.spec) {
            try {
              this.value = this.spec.create(view);
            } catch (e) {
              logException(view.state, e, "CodeMirror plugin crashed");
              this.deactivate();
            }
          }
        } else if (this.mustUpdate) {
          let update = this.mustUpdate;
          this.mustUpdate = null;
          if (this.value.update) {
            try {
              this.value.update(update);
            } catch (e) {
              logException(update.state, e, "CodeMirror plugin crashed");
              if (this.value.destroy)
                try {
                  this.value.destroy();
                } catch (_) {
                }
              this.deactivate();
            }
          }
        }
        return this;
      }
      destroy(view) {
        var _a2;
        if ((_a2 = this.value) === null || _a2 === void 0 ? void 0 : _a2.destroy) {
          try {
            this.value.destroy();
          } catch (e) {
            logException(view.state, e, "CodeMirror plugin crashed");
          }
        }
      }
      deactivate() {
        this.spec = this.value = null;
      }
    }
    const editorAttributes = /* @__PURE__ */ Facet.define();
    const contentAttributes = /* @__PURE__ */ Facet.define();
    const decorations = /* @__PURE__ */ Facet.define();
    const outerDecorations = /* @__PURE__ */ Facet.define();
    const atomicRanges = /* @__PURE__ */ Facet.define();
    const bidiIsolatedRanges = /* @__PURE__ */ Facet.define();
    function getIsolatedRanges(view, line2) {
      let isolates = view.state.facet(bidiIsolatedRanges);
      if (!isolates.length)
        return isolates;
      let sets = isolates.map((i2) => i2 instanceof Function ? i2(view) : i2);
      let result2 = [];
      RangeSet.spans(sets, line2.from, line2.to, {
        point() {
        },
        span(fromDoc, toDoc, active, open) {
          let from = fromDoc - line2.from, to2 = toDoc - line2.from;
          let level = result2;
          for (let i2 = active.length - 1; i2 >= 0; i2--, open--) {
            let direction = active[i2].spec.bidiIsolate, update;
            if (direction == null)
              direction = autoDirection(line2.text, from, to2);
            if (open > 0 && level.length && (update = level[level.length - 1]).to == from && update.direction == direction) {
              update.to = to2;
              level = update.inner;
            } else {
              let add2 = { from, to: to2, direction, inner: [] };
              level.push(add2);
              level = add2.inner;
            }
          }
        }
      });
      return result2;
    }
    const scrollMargins = /* @__PURE__ */ Facet.define();
    function getScrollMargins(view) {
      let left2 = 0, right2 = 0, top2 = 0, bottom2 = 0;
      for (let source2 of view.state.facet(scrollMargins)) {
        let m = source2(view);
        if (m) {
          if (m.left != null)
            left2 = Math.max(left2, m.left);
          if (m.right != null)
            right2 = Math.max(right2, m.right);
          if (m.top != null)
            top2 = Math.max(top2, m.top);
          if (m.bottom != null)
            bottom2 = Math.max(bottom2, m.bottom);
        }
      }
      return { left: left2, right: right2, top: top2, bottom: bottom2 };
    }
    const styleModule = /* @__PURE__ */ Facet.define();
    class ChangedRange {
      constructor(fromA, toA, fromB, toB) {
        this.fromA = fromA;
        this.toA = toA;
        this.fromB = fromB;
        this.toB = toB;
      }
      join(other) {
        return new ChangedRange(Math.min(this.fromA, other.fromA), Math.max(this.toA, other.toA), Math.min(this.fromB, other.fromB), Math.max(this.toB, other.toB));
      }
      addToSet(set2) {
        let i2 = set2.length, me2 = this;
        for (; i2 > 0; i2--) {
          let range2 = set2[i2 - 1];
          if (range2.fromA > me2.toA)
            continue;
          if (range2.toA < me2.fromA)
            break;
          me2 = me2.join(range2);
          set2.splice(i2 - 1, 1);
        }
        set2.splice(i2, 0, me2);
        return set2;
      }
      static extendWithRanges(diff2, ranges) {
        if (ranges.length == 0)
          return diff2;
        let result2 = [];
        for (let dI = 0, rI = 0, posA = 0, posB = 0; ; dI++) {
          let next = dI == diff2.length ? null : diff2[dI], off = posA - posB;
          let end2 = next ? next.fromB : 1e9;
          while (rI < ranges.length && ranges[rI] < end2) {
            let from = ranges[rI], to2 = ranges[rI + 1];
            let fromB = Math.max(posB, from), toB = Math.min(end2, to2);
            if (fromB <= toB)
              new ChangedRange(fromB + off, toB + off, fromB, toB).addToSet(result2);
            if (to2 > end2)
              break;
            else
              rI += 2;
          }
          if (!next)
            return result2;
          new ChangedRange(next.fromA, next.toA, next.fromB, next.toB).addToSet(result2);
          posA = next.toA;
          posB = next.toB;
        }
      }
    }
    class ViewUpdate {
      constructor(view, state, transactions) {
        this.view = view;
        this.state = state;
        this.transactions = transactions;
        this.flags = 0;
        this.startState = view.state;
        this.changes = ChangeSet.empty(this.startState.doc.length);
        for (let tr2 of transactions)
          this.changes = this.changes.compose(tr2.changes);
        let changedRanges = [];
        this.changes.iterChangedRanges((fromA, toA, fromB, toB) => changedRanges.push(new ChangedRange(fromA, toA, fromB, toB)));
        this.changedRanges = changedRanges;
      }
      /**
      @internal
      */
      static create(view, state, transactions) {
        return new ViewUpdate(view, state, transactions);
      }
      /**
      Tells you whether the [viewport](https://codemirror.net/6/docs/ref/#view.EditorView.viewport) or
      [visible ranges](https://codemirror.net/6/docs/ref/#view.EditorView.visibleRanges) changed in this
      update.
      */
      get viewportChanged() {
        return (this.flags & 4) > 0;
      }
      /**
      Returns true when
      [`viewportChanged`](https://codemirror.net/6/docs/ref/#view.ViewUpdate.viewportChanged) is true
      and the viewport change is not just the result of mapping it in
      response to document changes.
      */
      get viewportMoved() {
        return (this.flags & 8) > 0;
      }
      /**
      Indicates whether the height of a block element in the editor
      changed in this update.
      */
      get heightChanged() {
        return (this.flags & 2) > 0;
      }
      /**
      Returns true when the document was modified or the size of the
      editor, or elements within the editor, changed.
      */
      get geometryChanged() {
        return this.docChanged || (this.flags & (16 | 2)) > 0;
      }
      /**
      True when this update indicates a focus change.
      */
      get focusChanged() {
        return (this.flags & 1) > 0;
      }
      /**
      Whether the document changed in this update.
      */
      get docChanged() {
        return !this.changes.empty;
      }
      /**
      Whether the selection was explicitly set in this update.
      */
      get selectionSet() {
        return this.transactions.some((tr2) => tr2.selection);
      }
      /**
      @internal
      */
      get empty() {
        return this.flags == 0 && this.transactions.length == 0;
      }
    }
    class DocView extends ContentView {
      get length() {
        return this.view.state.doc.length;
      }
      constructor(view) {
        super();
        this.view = view;
        this.decorations = [];
        this.dynamicDecorationMap = [false];
        this.domChanged = null;
        this.hasComposition = null;
        this.markedForComposition = /* @__PURE__ */ new Set();
        this.editContextFormatting = Decoration.none;
        this.lastCompositionAfterCursor = false;
        this.minWidth = 0;
        this.minWidthFrom = 0;
        this.minWidthTo = 0;
        this.impreciseAnchor = null;
        this.impreciseHead = null;
        this.forceSelection = false;
        this.lastUpdate = Date.now();
        this.setDOM(view.contentDOM);
        this.children = [new LineView()];
        this.children[0].setParent(this);
        this.updateDeco();
        this.updateInner([new ChangedRange(0, 0, 0, view.state.doc.length)], 0, null);
      }
      // Update the document view to a given state.
      update(update) {
        var _a2;
        let changedRanges = update.changedRanges;
        if (this.minWidth > 0 && changedRanges.length) {
          if (!changedRanges.every(({ fromA, toA }) => toA < this.minWidthFrom || fromA > this.minWidthTo)) {
            this.minWidth = this.minWidthFrom = this.minWidthTo = 0;
          } else {
            this.minWidthFrom = update.changes.mapPos(this.minWidthFrom, 1);
            this.minWidthTo = update.changes.mapPos(this.minWidthTo, 1);
          }
        }
        this.updateEditContextFormatting(update);
        let readCompositionAt = -1;
        if (this.view.inputState.composing >= 0 && !this.view.observer.editContext) {
          if ((_a2 = this.domChanged) === null || _a2 === void 0 ? void 0 : _a2.newSel)
            readCompositionAt = this.domChanged.newSel.head;
          else if (!touchesComposition(update.changes, this.hasComposition) && !update.selectionSet)
            readCompositionAt = update.state.selection.main.head;
        }
        let composition = readCompositionAt > -1 ? findCompositionRange(this.view, update.changes, readCompositionAt) : null;
        this.domChanged = null;
        if (this.hasComposition) {
          this.markedForComposition.clear();
          let { from, to: to2 } = this.hasComposition;
          changedRanges = new ChangedRange(from, to2, update.changes.mapPos(from, -1), update.changes.mapPos(to2, 1)).addToSet(changedRanges.slice());
        }
        this.hasComposition = composition ? { from: composition.range.fromB, to: composition.range.toB } : null;
        if ((browser.ie || browser.chrome) && !composition && update && update.state.doc.lines != update.startState.doc.lines)
          this.forceSelection = true;
        let prevDeco = this.decorations, deco = this.updateDeco();
        let decoDiff = findChangedDeco(prevDeco, deco, update.changes);
        changedRanges = ChangedRange.extendWithRanges(changedRanges, decoDiff);
        if (!(this.flags & 7) && changedRanges.length == 0) {
          return false;
        } else {
          this.updateInner(changedRanges, update.startState.doc.length, composition);
          if (update.transactions.length)
            this.lastUpdate = Date.now();
          return true;
        }
      }
      // Used by update and the constructor do perform the actual DOM
      // update
      updateInner(changes, oldLength, composition) {
        this.view.viewState.mustMeasureContent = true;
        this.updateChildren(changes, oldLength, composition);
        let { observer } = this.view;
        observer.ignore(() => {
          this.dom.style.height = this.view.viewState.contentHeight / this.view.scaleY + "px";
          this.dom.style.flexBasis = this.minWidth ? this.minWidth + "px" : "";
          let track = browser.chrome || browser.ios ? { node: observer.selectionRange.focusNode, written: false } : void 0;
          this.sync(this.view, track);
          this.flags &= -8;
          if (track && (track.written || observer.selectionRange.focusNode != track.node))
            this.forceSelection = true;
          this.dom.style.height = "";
        });
        this.markedForComposition.forEach(
          (cView) => cView.flags &= -9
          /* ViewFlag.Composition */
        );
        let gaps = [];
        if (this.view.viewport.from || this.view.viewport.to < this.view.state.doc.length) {
          for (let child of this.children)
            if (child instanceof BlockWidgetView && child.widget instanceof BlockGapWidget)
              gaps.push(child.dom);
        }
        observer.updateGaps(gaps);
      }
      updateChildren(changes, oldLength, composition) {
        let ranges = composition ? composition.range.addToSet(changes.slice()) : changes;
        let cursor = this.childCursor(oldLength);
        for (let i2 = ranges.length - 1; ; i2--) {
          let next = i2 >= 0 ? ranges[i2] : null;
          if (!next)
            break;
          let { fromA, toA, fromB, toB } = next, content2, breakAtStart, openStart, openEnd;
          if (composition && composition.range.fromB < toB && composition.range.toB > fromB) {
            let before = ContentBuilder.build(this.view.state.doc, fromB, composition.range.fromB, this.decorations, this.dynamicDecorationMap);
            let after = ContentBuilder.build(this.view.state.doc, composition.range.toB, toB, this.decorations, this.dynamicDecorationMap);
            breakAtStart = before.breakAtStart;
            openStart = before.openStart;
            openEnd = after.openEnd;
            let compLine = this.compositionView(composition);
            if (after.breakAtStart) {
              compLine.breakAfter = 1;
            } else if (after.content.length && compLine.merge(compLine.length, compLine.length, after.content[0], false, after.openStart, 0)) {
              compLine.breakAfter = after.content[0].breakAfter;
              after.content.shift();
            }
            if (before.content.length && compLine.merge(0, 0, before.content[before.content.length - 1], true, 0, before.openEnd)) {
              before.content.pop();
            }
            content2 = before.content.concat(compLine).concat(after.content);
          } else {
            ({ content: content2, breakAtStart, openStart, openEnd } = ContentBuilder.build(this.view.state.doc, fromB, toB, this.decorations, this.dynamicDecorationMap));
          }
          let { i: toI, off: toOff } = cursor.findPos(toA, 1);
          let { i: fromI, off: fromOff } = cursor.findPos(fromA, -1);
          replaceRange(this, fromI, fromOff, toI, toOff, content2, breakAtStart, openStart, openEnd);
        }
        if (composition)
          this.fixCompositionDOM(composition);
      }
      updateEditContextFormatting(update) {
        this.editContextFormatting = this.editContextFormatting.map(update.changes);
        for (let tr2 of update.transactions)
          for (let effect2 of tr2.effects)
            if (effect2.is(setEditContextFormatting)) {
              this.editContextFormatting = effect2.value;
            }
      }
      compositionView(composition) {
        let cur2 = new TextView(composition.text.nodeValue);
        cur2.flags |= 8;
        for (let { deco } of composition.marks)
          cur2 = new MarkView(deco, [cur2], cur2.length);
        let line2 = new LineView();
        line2.append(cur2, 0);
        return line2;
      }
      fixCompositionDOM(composition) {
        let fix = (dom, cView2) => {
          cView2.flags |= 8 | (cView2.children.some(
            (c2) => c2.flags & 7
            /* ViewFlag.Dirty */
          ) ? 1 : 0);
          this.markedForComposition.add(cView2);
          let prev = ContentView.get(dom);
          if (prev && prev != cView2)
            prev.dom = null;
          cView2.setDOM(dom);
        };
        let pos2 = this.childPos(composition.range.fromB, 1);
        let cView = this.children[pos2.i];
        fix(composition.line, cView);
        for (let i2 = composition.marks.length - 1; i2 >= -1; i2--) {
          pos2 = cView.childPos(pos2.off, 1);
          cView = cView.children[pos2.i];
          fix(i2 >= 0 ? composition.marks[i2].node : composition.text, cView);
        }
      }
      // Sync the DOM selection to this.state.selection
      updateSelection(mustRead = false, fromPointer = false) {
        if (mustRead || !this.view.observer.selectionRange.focusNode)
          this.view.observer.readSelectionRange();
        let activeElt = this.view.root.activeElement, focused = activeElt == this.dom;
        let selectionNotFocus = !focused && !(this.view.state.facet(editable) || this.dom.tabIndex > -1) && hasSelection(this.dom, this.view.observer.selectionRange) && !(activeElt && this.dom.contains(activeElt));
        if (!(focused || fromPointer || selectionNotFocus))
          return;
        let force = this.forceSelection;
        this.forceSelection = false;
        let main2 = this.view.state.selection.main;
        let anchor = this.moveToLine(this.domAtPos(main2.anchor));
        let head = main2.empty ? anchor : this.moveToLine(this.domAtPos(main2.head));
        if (browser.gecko && main2.empty && !this.hasComposition && betweenUneditable(anchor)) {
          let dummy = document.createTextNode("");
          this.view.observer.ignore(() => anchor.node.insertBefore(dummy, anchor.node.childNodes[anchor.offset] || null));
          anchor = head = new DOMPos(dummy, 0);
          force = true;
        }
        let domSel = this.view.observer.selectionRange;
        if (force || !domSel.focusNode || (!isEquivalentPosition(anchor.node, anchor.offset, domSel.anchorNode, domSel.anchorOffset) || !isEquivalentPosition(head.node, head.offset, domSel.focusNode, domSel.focusOffset)) && !this.suppressWidgetCursorChange(domSel, main2)) {
          this.view.observer.ignore(() => {
            if (browser.android && browser.chrome && this.dom.contains(domSel.focusNode) && inUneditable(domSel.focusNode, this.dom)) {
              this.dom.blur();
              this.dom.focus({ preventScroll: true });
            }
            let rawSel = getSelection(this.view.root);
            if (!rawSel) ;
            else if (main2.empty) {
              if (browser.gecko) {
                let nextTo = nextToUneditable(anchor.node, anchor.offset);
                if (nextTo && nextTo != (1 | 2)) {
                  let text2 = (nextTo == 1 ? textNodeBefore : textNodeAfter)(anchor.node, anchor.offset);
                  if (text2)
                    anchor = new DOMPos(text2.node, text2.offset);
                }
              }
              rawSel.collapse(anchor.node, anchor.offset);
              if (main2.bidiLevel != null && rawSel.caretBidiLevel !== void 0)
                rawSel.caretBidiLevel = main2.bidiLevel;
            } else if (rawSel.extend) {
              rawSel.collapse(anchor.node, anchor.offset);
              try {
                rawSel.extend(head.node, head.offset);
              } catch (_) {
              }
            } else {
              let range2 = document.createRange();
              if (main2.anchor > main2.head)
                [anchor, head] = [head, anchor];
              range2.setEnd(head.node, head.offset);
              range2.setStart(anchor.node, anchor.offset);
              rawSel.removeAllRanges();
              rawSel.addRange(range2);
            }
            if (selectionNotFocus && this.view.root.activeElement == this.dom) {
              this.dom.blur();
              if (activeElt)
                activeElt.focus();
            }
          });
          this.view.observer.setSelectionRange(anchor, head);
        }
        this.impreciseAnchor = anchor.precise ? null : new DOMPos(domSel.anchorNode, domSel.anchorOffset);
        this.impreciseHead = head.precise ? null : new DOMPos(domSel.focusNode, domSel.focusOffset);
      }
      // If a zero-length widget is inserted next to the cursor during
      // composition, avoid moving it across it and disrupting the
      // composition.
      suppressWidgetCursorChange(sel, cursor) {
        return this.hasComposition && cursor.empty && isEquivalentPosition(sel.focusNode, sel.focusOffset, sel.anchorNode, sel.anchorOffset) && this.posFromDOM(sel.focusNode, sel.focusOffset) == cursor.head;
      }
      enforceCursorAssoc() {
        if (this.hasComposition)
          return;
        let { view } = this, cursor = view.state.selection.main;
        let sel = getSelection(view.root);
        let { anchorNode, anchorOffset } = view.observer.selectionRange;
        if (!sel || !cursor.empty || !cursor.assoc || !sel.modify)
          return;
        let line2 = LineView.find(this, cursor.head);
        if (!line2)
          return;
        let lineStart = line2.posAtStart;
        if (cursor.head == lineStart || cursor.head == lineStart + line2.length)
          return;
        let before = this.coordsAt(cursor.head, -1), after = this.coordsAt(cursor.head, 1);
        if (!before || !after || before.bottom > after.top)
          return;
        let dom = this.domAtPos(cursor.head + cursor.assoc);
        sel.collapse(dom.node, dom.offset);
        sel.modify("move", cursor.assoc < 0 ? "forward" : "backward", "lineboundary");
        view.observer.readSelectionRange();
        let newRange = view.observer.selectionRange;
        if (view.docView.posFromDOM(newRange.anchorNode, newRange.anchorOffset) != cursor.from)
          sel.collapse(anchorNode, anchorOffset);
      }
      // If a position is in/near a block widget, move it to a nearby text
      // line, since we don't want the cursor inside a block widget.
      moveToLine(pos2) {
        let dom = this.dom, newPos;
        if (pos2.node != dom)
          return pos2;
        for (let i2 = pos2.offset; !newPos && i2 < dom.childNodes.length; i2++) {
          let view = ContentView.get(dom.childNodes[i2]);
          if (view instanceof LineView)
            newPos = view.domAtPos(0);
        }
        for (let i2 = pos2.offset - 1; !newPos && i2 >= 0; i2--) {
          let view = ContentView.get(dom.childNodes[i2]);
          if (view instanceof LineView)
            newPos = view.domAtPos(view.length);
        }
        return newPos ? new DOMPos(newPos.node, newPos.offset, true) : pos2;
      }
      nearest(dom) {
        for (let cur2 = dom; cur2; ) {
          let domView = ContentView.get(cur2);
          if (domView && domView.rootView == this)
            return domView;
          cur2 = cur2.parentNode;
        }
        return null;
      }
      posFromDOM(node2, offset2) {
        let view = this.nearest(node2);
        if (!view)
          throw new RangeError("Trying to find position for a DOM position outside of the document");
        return view.localPosFromDOM(node2, offset2) + view.posAtStart;
      }
      domAtPos(pos2) {
        let { i: i2, off } = this.childCursor().findPos(pos2, -1);
        for (; i2 < this.children.length - 1; ) {
          let child = this.children[i2];
          if (off < child.length || child instanceof LineView)
            break;
          i2++;
          off = 0;
        }
        return this.children[i2].domAtPos(off);
      }
      coordsAt(pos2, side) {
        let best = null, bestPos = 0;
        for (let off = this.length, i2 = this.children.length - 1; i2 >= 0; i2--) {
          let child = this.children[i2], end2 = off - child.breakAfter, start2 = end2 - child.length;
          if (end2 < pos2)
            break;
          if (start2 <= pos2 && (start2 < pos2 || child.covers(-1)) && (end2 > pos2 || child.covers(1)) && (!best || child instanceof LineView && !(best instanceof LineView && side >= 0))) {
            best = child;
            bestPos = start2;
          } else if (best && start2 == pos2 && end2 == pos2 && child instanceof BlockWidgetView && Math.abs(side) < 2) {
            if (child.deco.startSide < 0)
              break;
            else if (i2)
              best = null;
          }
          off = start2;
        }
        return best ? best.coordsAt(pos2 - bestPos, side) : null;
      }
      coordsForChar(pos2) {
        let { i: i2, off } = this.childPos(pos2, 1), child = this.children[i2];
        if (!(child instanceof LineView))
          return null;
        while (child.children.length) {
          let { i: i3, off: childOff } = child.childPos(off, 1);
          for (; ; i3++) {
            if (i3 == child.children.length)
              return null;
            if ((child = child.children[i3]).length)
              break;
          }
          off = childOff;
        }
        if (!(child instanceof TextView))
          return null;
        let end2 = findClusterBreak(child.text, off);
        if (end2 == off)
          return null;
        let rects = textRange(child.dom, off, end2).getClientRects();
        for (let i3 = 0; i3 < rects.length; i3++) {
          let rect2 = rects[i3];
          if (i3 == rects.length - 1 || rect2.top < rect2.bottom && rect2.left < rect2.right)
            return rect2;
        }
        return null;
      }
      measureVisibleLineHeights(viewport2) {
        let result2 = [], { from, to: to2 } = viewport2;
        let contentWidth = this.view.contentDOM.clientWidth;
        let isWider = contentWidth > Math.max(this.view.scrollDOM.clientWidth, this.minWidth) + 1;
        let widest = -1, ltr = this.view.textDirection == Direction.LTR;
        for (let pos2 = 0, i2 = 0; i2 < this.children.length; i2++) {
          let child = this.children[i2], end2 = pos2 + child.length;
          if (end2 > to2)
            break;
          if (pos2 >= from) {
            let childRect = child.dom.getBoundingClientRect();
            result2.push(childRect.height);
            if (isWider) {
              let last = child.dom.lastChild;
              let rects = last ? clientRectsFor(last) : [];
              if (rects.length) {
                let rect2 = rects[rects.length - 1];
                let width = ltr ? rect2.right - childRect.left : childRect.right - rect2.left;
                if (width > widest) {
                  widest = width;
                  this.minWidth = contentWidth;
                  this.minWidthFrom = pos2;
                  this.minWidthTo = end2;
                }
              }
            }
          }
          pos2 = end2 + child.breakAfter;
        }
        return result2;
      }
      textDirectionAt(pos2) {
        let { i: i2 } = this.childPos(pos2, 1);
        return getComputedStyle(this.children[i2].dom).direction == "rtl" ? Direction.RTL : Direction.LTR;
      }
      measureTextSize() {
        for (let child of this.children) {
          if (child instanceof LineView) {
            let measure = child.measureTextSize();
            if (measure)
              return measure;
          }
        }
        let dummy = document.createElement("div"), lineHeight, charWidth, textHeight;
        dummy.className = "cm-line";
        dummy.style.width = "99999px";
        dummy.style.position = "absolute";
        dummy.textContent = "abc def ghi jkl mno pqr stu";
        this.view.observer.ignore(() => {
          this.dom.appendChild(dummy);
          let rect2 = clientRectsFor(dummy.firstChild)[0];
          lineHeight = dummy.getBoundingClientRect().height;
          charWidth = rect2 ? rect2.width / 27 : 7;
          textHeight = rect2 ? rect2.height : lineHeight;
          dummy.remove();
        });
        return { lineHeight, charWidth, textHeight };
      }
      childCursor(pos2 = this.length) {
        let i2 = this.children.length;
        if (i2)
          pos2 -= this.children[--i2].length;
        return new ChildCursor(this.children, pos2, i2);
      }
      computeBlockGapDeco() {
        let deco = [], vs = this.view.viewState;
        for (let pos2 = 0, i2 = 0; ; i2++) {
          let next = i2 == vs.viewports.length ? null : vs.viewports[i2];
          let end2 = next ? next.from - 1 : this.length;
          if (end2 > pos2) {
            let height = (vs.lineBlockAt(end2).bottom - vs.lineBlockAt(pos2).top) / this.view.scaleY;
            deco.push(Decoration.replace({
              widget: new BlockGapWidget(height),
              block: true,
              inclusive: true,
              isBlockGap: true
            }).range(pos2, end2));
          }
          if (!next)
            break;
          pos2 = next.to + 1;
        }
        return Decoration.set(deco);
      }
      updateDeco() {
        let i2 = 1;
        let allDeco = this.view.state.facet(decorations).map((d) => {
          let dynamic = this.dynamicDecorationMap[i2++] = typeof d == "function";
          return dynamic ? d(this.view) : d;
        });
        let dynamicOuter = false, outerDeco = this.view.state.facet(outerDecorations).map((d, i3) => {
          let dynamic = typeof d == "function";
          if (dynamic)
            dynamicOuter = true;
          return dynamic ? d(this.view) : d;
        });
        if (outerDeco.length) {
          this.dynamicDecorationMap[i2++] = dynamicOuter;
          allDeco.push(RangeSet.join(outerDeco));
        }
        this.decorations = [
          this.editContextFormatting,
          ...allDeco,
          this.computeBlockGapDeco(),
          this.view.viewState.lineGapDeco
        ];
        while (i2 < this.decorations.length)
          this.dynamicDecorationMap[i2++] = false;
        return this.decorations;
      }
      scrollIntoView(target2) {
        if (target2.isSnapshot) {
          let ref = this.view.viewState.lineBlockAt(target2.range.head);
          this.view.scrollDOM.scrollTop = ref.top - target2.yMargin;
          this.view.scrollDOM.scrollLeft = target2.xMargin;
          return;
        }
        for (let handler of this.view.state.facet(scrollHandler)) {
          try {
            if (handler(this.view, target2.range, target2))
              return true;
          } catch (e) {
            logException(this.view.state, e, "scroll handler");
          }
        }
        let { range: range2 } = target2;
        let rect2 = this.coordsAt(range2.head, range2.empty ? range2.assoc : range2.head > range2.anchor ? -1 : 1), other;
        if (!rect2)
          return;
        if (!range2.empty && (other = this.coordsAt(range2.anchor, range2.anchor > range2.head ? -1 : 1)))
          rect2 = {
            left: Math.min(rect2.left, other.left),
            top: Math.min(rect2.top, other.top),
            right: Math.max(rect2.right, other.right),
            bottom: Math.max(rect2.bottom, other.bottom)
          };
        let margins = getScrollMargins(this.view);
        let targetRect = {
          left: rect2.left - margins.left,
          top: rect2.top - margins.top,
          right: rect2.right + margins.right,
          bottom: rect2.bottom + margins.bottom
        };
        let { offsetWidth, offsetHeight } = this.view.scrollDOM;
        scrollRectIntoView(this.view.scrollDOM, targetRect, range2.head < range2.anchor ? -1 : 1, target2.x, target2.y, Math.max(Math.min(target2.xMargin, offsetWidth), -offsetWidth), Math.max(Math.min(target2.yMargin, offsetHeight), -offsetHeight), this.view.textDirection == Direction.LTR);
      }
    }
    function betweenUneditable(pos2) {
      return pos2.node.nodeType == 1 && pos2.node.firstChild && (pos2.offset == 0 || pos2.node.childNodes[pos2.offset - 1].contentEditable == "false") && (pos2.offset == pos2.node.childNodes.length || pos2.node.childNodes[pos2.offset].contentEditable == "false");
    }
    function findCompositionNode(view, headPos) {
      let sel = view.observer.selectionRange;
      if (!sel.focusNode)
        return null;
      let textBefore = textNodeBefore(sel.focusNode, sel.focusOffset);
      let textAfter = textNodeAfter(sel.focusNode, sel.focusOffset);
      let textNode = textBefore || textAfter;
      if (textAfter && textBefore && textAfter.node != textBefore.node) {
        let descAfter = ContentView.get(textAfter.node);
        if (!descAfter || descAfter instanceof TextView && descAfter.text != textAfter.node.nodeValue) {
          textNode = textAfter;
        } else if (view.docView.lastCompositionAfterCursor) {
          let descBefore = ContentView.get(textBefore.node);
          if (!(!descBefore || descBefore instanceof TextView && descBefore.text != textBefore.node.nodeValue))
            textNode = textAfter;
        }
      }
      view.docView.lastCompositionAfterCursor = textNode != textBefore;
      if (!textNode)
        return null;
      let from = headPos - textNode.offset;
      return { from, to: from + textNode.node.nodeValue.length, node: textNode.node };
    }
    function findCompositionRange(view, changes, headPos) {
      let found = findCompositionNode(view, headPos);
      if (!found)
        return null;
      let { node: textNode, from, to: to2 } = found, text2 = textNode.nodeValue;
      if (/[\n\r]/.test(text2))
        return null;
      if (view.state.doc.sliceString(found.from, found.to) != text2)
        return null;
      let inv = changes.invertedDesc;
      let range2 = new ChangedRange(inv.mapPos(from), inv.mapPos(to2), from, to2);
      let marks = [];
      for (let parent = textNode.parentNode; ; parent = parent.parentNode) {
        let parentView = ContentView.get(parent);
        if (parentView instanceof MarkView)
          marks.push({ node: parent, deco: parentView.mark });
        else if (parentView instanceof LineView || parent.nodeName == "DIV" && parent.parentNode == view.contentDOM)
          return { range: range2, text: textNode, marks, line: parent };
        else if (parent != view.contentDOM)
          marks.push({ node: parent, deco: new MarkDecoration({
            inclusive: true,
            attributes: getAttrs(parent),
            tagName: parent.tagName.toLowerCase()
          }) });
        else
          return null;
      }
    }
    function nextToUneditable(node2, offset2) {
      if (node2.nodeType != 1)
        return 0;
      return (offset2 && node2.childNodes[offset2 - 1].contentEditable == "false" ? 1 : 0) | (offset2 < node2.childNodes.length && node2.childNodes[offset2].contentEditable == "false" ? 2 : 0);
    }
    let DecorationComparator$1 = class DecorationComparator {
      constructor() {
        this.changes = [];
      }
      compareRange(from, to2) {
        addRange(from, to2, this.changes);
      }
      comparePoint(from, to2) {
        addRange(from, to2, this.changes);
      }
      boundChange(pos2) {
        addRange(pos2, pos2, this.changes);
      }
    };
    function findChangedDeco(a, b, diff2) {
      let comp2 = new DecorationComparator$1();
      RangeSet.compare(a, b, diff2, comp2);
      return comp2.changes;
    }
    function inUneditable(node2, inside2) {
      for (let cur2 = node2; cur2 && cur2 != inside2; cur2 = cur2.assignedSlot || cur2.parentNode) {
        if (cur2.nodeType == 1 && cur2.contentEditable == "false") {
          return true;
        }
      }
      return false;
    }
    function touchesComposition(changes, composition) {
      let touched = false;
      if (composition)
        changes.iterChangedRanges((from, to2) => {
          if (from < composition.to && to2 > composition.from)
            touched = true;
        });
      return touched;
    }
    function groupAt(state, pos2, bias = 1) {
      let categorize = state.charCategorizer(pos2);
      let line2 = state.doc.lineAt(pos2), linePos = pos2 - line2.from;
      if (line2.length == 0)
        return EditorSelection.cursor(pos2);
      if (linePos == 0)
        bias = 1;
      else if (linePos == line2.length)
        bias = -1;
      let from = linePos, to2 = linePos;
      if (bias < 0)
        from = findClusterBreak(line2.text, linePos, false);
      else
        to2 = findClusterBreak(line2.text, linePos);
      let cat = categorize(line2.text.slice(from, to2));
      while (from > 0) {
        let prev = findClusterBreak(line2.text, from, false);
        if (categorize(line2.text.slice(prev, from)) != cat)
          break;
        from = prev;
      }
      while (to2 < line2.length) {
        let next = findClusterBreak(line2.text, to2);
        if (categorize(line2.text.slice(to2, next)) != cat)
          break;
        to2 = next;
      }
      return EditorSelection.range(from + line2.from, to2 + line2.from);
    }
    function getdx(x2, rect2) {
      return rect2.left > x2 ? rect2.left - x2 : Math.max(0, x2 - rect2.right);
    }
    function getdy(y, rect2) {
      return rect2.top > y ? rect2.top - y : Math.max(0, y - rect2.bottom);
    }
    function yOverlap(a, b) {
      return a.top < b.bottom - 1 && a.bottom > b.top + 1;
    }
    function upTop(rect2, top2) {
      return top2 < rect2.top ? { top: top2, left: rect2.left, right: rect2.right, bottom: rect2.bottom } : rect2;
    }
    function upBot(rect2, bottom2) {
      return bottom2 > rect2.bottom ? { top: rect2.top, left: rect2.left, right: rect2.right, bottom: bottom2 } : rect2;
    }
    function domPosAtCoords(parent, x2, y) {
      let closest, closestRect, closestX, closestY, closestOverlap = false;
      let above, below, aboveRect, belowRect;
      for (let child = parent.firstChild; child; child = child.nextSibling) {
        let rects = clientRectsFor(child);
        for (let i2 = 0; i2 < rects.length; i2++) {
          let rect2 = rects[i2];
          if (closestRect && yOverlap(closestRect, rect2))
            rect2 = upTop(upBot(rect2, closestRect.bottom), closestRect.top);
          let dx = getdx(x2, rect2), dy = getdy(y, rect2);
          if (dx == 0 && dy == 0)
            return child.nodeType == 3 ? domPosInText(child, x2, y) : domPosAtCoords(child, x2, y);
          if (!closest || closestY > dy || closestY == dy && closestX > dx) {
            closest = child;
            closestRect = rect2;
            closestX = dx;
            closestY = dy;
            let side = dy ? y < rect2.top ? -1 : 1 : dx ? x2 < rect2.left ? -1 : 1 : 0;
            closestOverlap = !side || (side > 0 ? i2 < rects.length - 1 : i2 > 0);
          }
          if (dx == 0) {
            if (y > rect2.bottom && (!aboveRect || aboveRect.bottom < rect2.bottom)) {
              above = child;
              aboveRect = rect2;
            } else if (y < rect2.top && (!belowRect || belowRect.top > rect2.top)) {
              below = child;
              belowRect = rect2;
            }
          } else if (aboveRect && yOverlap(aboveRect, rect2)) {
            aboveRect = upBot(aboveRect, rect2.bottom);
          } else if (belowRect && yOverlap(belowRect, rect2)) {
            belowRect = upTop(belowRect, rect2.top);
          }
        }
      }
      if (aboveRect && aboveRect.bottom >= y) {
        closest = above;
        closestRect = aboveRect;
      } else if (belowRect && belowRect.top <= y) {
        closest = below;
        closestRect = belowRect;
      }
      if (!closest)
        return { node: parent, offset: 0 };
      let clipX = Math.max(closestRect.left, Math.min(closestRect.right, x2));
      if (closest.nodeType == 3)
        return domPosInText(closest, clipX, y);
      if (closestOverlap && closest.contentEditable != "false")
        return domPosAtCoords(closest, clipX, y);
      let offset2 = Array.prototype.indexOf.call(parent.childNodes, closest) + (x2 >= (closestRect.left + closestRect.right) / 2 ? 1 : 0);
      return { node: parent, offset: offset2 };
    }
    function domPosInText(node2, x2, y) {
      let len = node2.nodeValue.length;
      let closestOffset = -1, closestDY = 1e9, generalSide = 0;
      for (let i2 = 0; i2 < len; i2++) {
        let rects = textRange(node2, i2, i2 + 1).getClientRects();
        for (let j = 0; j < rects.length; j++) {
          let rect2 = rects[j];
          if (rect2.top == rect2.bottom)
            continue;
          if (!generalSide)
            generalSide = x2 - rect2.left;
          let dy = (rect2.top > y ? rect2.top - y : y - rect2.bottom) - 1;
          if (rect2.left - 1 <= x2 && rect2.right + 1 >= x2 && dy < closestDY) {
            let right2 = x2 >= (rect2.left + rect2.right) / 2, after = right2;
            if (browser.chrome || browser.gecko) {
              let rectBefore = textRange(node2, i2).getBoundingClientRect();
              if (rectBefore.left == rect2.right)
                after = !right2;
            }
            if (dy <= 0)
              return { node: node2, offset: i2 + (after ? 1 : 0) };
            closestOffset = i2 + (after ? 1 : 0);
            closestDY = dy;
          }
        }
      }
      return { node: node2, offset: closestOffset > -1 ? closestOffset : generalSide > 0 ? node2.nodeValue.length : 0 };
    }
    function posAtCoords(view, coords, precise, bias = -1) {
      var _a2, _b2;
      let content2 = view.contentDOM.getBoundingClientRect(), docTop = content2.top + view.viewState.paddingTop;
      let block2, { docHeight } = view.viewState;
      let { x: x2, y } = coords, yOffset = y - docTop;
      if (yOffset < 0)
        return 0;
      if (yOffset > docHeight)
        return view.state.doc.length;
      for (let halfLine = view.viewState.heightOracle.textHeight / 2, bounced = false; ; ) {
        block2 = view.elementAtHeight(yOffset);
        if (block2.type == BlockType.Text)
          break;
        for (; ; ) {
          yOffset = bias > 0 ? block2.bottom + halfLine : block2.top - halfLine;
          if (yOffset >= 0 && yOffset <= docHeight)
            break;
          if (bounced)
            return precise ? null : 0;
          bounced = true;
          bias = -bias;
        }
      }
      y = docTop + yOffset;
      let lineStart = block2.from;
      if (lineStart < view.viewport.from)
        return view.viewport.from == 0 ? 0 : precise ? null : posAtCoordsImprecise(view, content2, block2, x2, y);
      if (lineStart > view.viewport.to)
        return view.viewport.to == view.state.doc.length ? view.state.doc.length : precise ? null : posAtCoordsImprecise(view, content2, block2, x2, y);
      let doc2 = view.dom.ownerDocument;
      let root2 = view.root.elementFromPoint ? view.root : doc2;
      let element = root2.elementFromPoint(x2, y);
      if (element && !view.contentDOM.contains(element))
        element = null;
      if (!element) {
        x2 = Math.max(content2.left + 1, Math.min(content2.right - 1, x2));
        element = root2.elementFromPoint(x2, y);
        if (element && !view.contentDOM.contains(element))
          element = null;
      }
      let node2, offset2 = -1;
      if (element && ((_a2 = view.docView.nearest(element)) === null || _a2 === void 0 ? void 0 : _a2.isEditable) != false) {
        if (doc2.caretPositionFromPoint) {
          let pos2 = doc2.caretPositionFromPoint(x2, y);
          if (pos2)
            ({ offsetNode: node2, offset: offset2 } = pos2);
        } else if (doc2.caretRangeFromPoint) {
          let range2 = doc2.caretRangeFromPoint(x2, y);
          if (range2) {
            ({ startContainer: node2, startOffset: offset2 } = range2);
            if (!view.contentDOM.contains(node2) || browser.safari && isSuspiciousSafariCaretResult(node2, offset2, x2) || browser.chrome && isSuspiciousChromeCaretResult(node2, offset2, x2))
              node2 = void 0;
          }
        }
        if (node2)
          offset2 = Math.min(maxOffset(node2), offset2);
      }
      if (!node2 || !view.docView.dom.contains(node2)) {
        let line2 = LineView.find(view.docView, lineStart);
        if (!line2)
          return yOffset > block2.top + block2.height / 2 ? block2.to : block2.from;
        ({ node: node2, offset: offset2 } = domPosAtCoords(line2.dom, x2, y));
      }
      let nearest = view.docView.nearest(node2);
      if (!nearest)
        return null;
      if (nearest.isWidget && ((_b2 = nearest.dom) === null || _b2 === void 0 ? void 0 : _b2.nodeType) == 1) {
        let rect2 = nearest.dom.getBoundingClientRect();
        return coords.y < rect2.top || coords.y <= rect2.bottom && coords.x <= (rect2.left + rect2.right) / 2 ? nearest.posAtStart : nearest.posAtEnd;
      } else {
        return nearest.localPosFromDOM(node2, offset2) + nearest.posAtStart;
      }
    }
    function posAtCoordsImprecise(view, contentRect, block2, x2, y) {
      let into = Math.round((x2 - contentRect.left) * view.defaultCharacterWidth);
      if (view.lineWrapping && block2.height > view.defaultLineHeight * 1.5) {
        let textHeight = view.viewState.heightOracle.textHeight;
        let line2 = Math.floor((y - block2.top - (view.defaultLineHeight - textHeight) * 0.5) / textHeight);
        into += line2 * view.viewState.heightOracle.lineLength;
      }
      let content2 = view.state.sliceDoc(block2.from, block2.to);
      return block2.from + findColumn(content2, into, view.state.tabSize);
    }
    function isSuspiciousSafariCaretResult(node2, offset2, x2) {
      let len;
      if (node2.nodeType != 3 || offset2 != (len = node2.nodeValue.length))
        return false;
      for (let next = node2.nextSibling; next; next = next.nextSibling)
        if (next.nodeType != 1 || next.nodeName != "BR")
          return false;
      return textRange(node2, len - 1, len).getBoundingClientRect().left > x2;
    }
    function isSuspiciousChromeCaretResult(node2, offset2, x2) {
      if (offset2 != 0)
        return false;
      for (let cur2 = node2; ; ) {
        let parent = cur2.parentNode;
        if (!parent || parent.nodeType != 1 || parent.firstChild != cur2)
          return false;
        if (parent.classList.contains("cm-line"))
          break;
        cur2 = parent;
      }
      let rect2 = node2.nodeType == 1 ? node2.getBoundingClientRect() : textRange(node2, 0, Math.max(node2.nodeValue.length, 1)).getBoundingClientRect();
      return x2 - rect2.left > 5;
    }
    function blockAt(view, pos2) {
      let line2 = view.lineBlockAt(pos2);
      if (Array.isArray(line2.type))
        for (let l of line2.type) {
          if (l.to > pos2 || l.to == pos2 && (l.to == line2.to || l.type == BlockType.Text))
            return l;
        }
      return line2;
    }
    function moveToLineBoundary(view, start2, forward, includeWrap) {
      let line2 = blockAt(view, start2.head);
      let coords = !includeWrap || line2.type != BlockType.Text || !(view.lineWrapping || line2.widgetLineBreaks) ? null : view.coordsAtPos(start2.assoc < 0 && start2.head > line2.from ? start2.head - 1 : start2.head);
      if (coords) {
        let editorRect = view.dom.getBoundingClientRect();
        let direction = view.textDirectionAt(line2.from);
        let pos2 = view.posAtCoords({
          x: forward == (direction == Direction.LTR) ? editorRect.right - 1 : editorRect.left + 1,
          y: (coords.top + coords.bottom) / 2
        });
        if (pos2 != null)
          return EditorSelection.cursor(pos2, forward ? -1 : 1);
      }
      return EditorSelection.cursor(forward ? line2.to : line2.from, forward ? -1 : 1);
    }
    function moveByChar(view, start2, forward, by) {
      let line2 = view.state.doc.lineAt(start2.head), spans = view.bidiSpans(line2);
      let direction = view.textDirectionAt(line2.from);
      for (let cur2 = start2, check2 = null; ; ) {
        let next = moveVisually(line2, spans, direction, cur2, forward), char = movedOver;
        if (!next) {
          if (line2.number == (forward ? view.state.doc.lines : 1))
            return cur2;
          char = "\n";
          line2 = view.state.doc.line(line2.number + (forward ? 1 : -1));
          spans = view.bidiSpans(line2);
          next = view.visualLineSide(line2, !forward);
        }
        if (!check2) {
          if (!by)
            return next;
          check2 = by(char);
        } else if (!check2(char)) {
          return cur2;
        }
        cur2 = next;
      }
    }
    function byGroup(view, pos2, start2) {
      let categorize = view.state.charCategorizer(pos2);
      let cat = categorize(start2);
      return (next) => {
        let nextCat = categorize(next);
        if (cat == CharCategory.Space)
          cat = nextCat;
        return cat == nextCat;
      };
    }
    function moveVertically(view, start2, forward, distance) {
      let startPos = start2.head, dir = forward ? 1 : -1;
      if (startPos == (forward ? view.state.doc.length : 0))
        return EditorSelection.cursor(startPos, start2.assoc);
      let goal = start2.goalColumn, startY;
      let rect2 = view.contentDOM.getBoundingClientRect();
      let startCoords = view.coordsAtPos(startPos, start2.assoc || -1), docTop = view.documentTop;
      if (startCoords) {
        if (goal == null)
          goal = startCoords.left - rect2.left;
        startY = dir < 0 ? startCoords.top : startCoords.bottom;
      } else {
        let line2 = view.viewState.lineBlockAt(startPos);
        if (goal == null)
          goal = Math.min(rect2.right - rect2.left, view.defaultCharacterWidth * (startPos - line2.from));
        startY = (dir < 0 ? line2.top : line2.bottom) + docTop;
      }
      let resolvedGoal = rect2.left + goal;
      let dist2 = distance !== null && distance !== void 0 ? distance : view.viewState.heightOracle.textHeight >> 1;
      for (let extra = 0; ; extra += 10) {
        let curY = startY + (dist2 + extra) * dir;
        let pos2 = posAtCoords(view, { x: resolvedGoal, y: curY }, false, dir);
        if (curY < rect2.top || curY > rect2.bottom || (dir < 0 ? pos2 < startPos : pos2 > startPos)) {
          let charRect = view.docView.coordsForChar(pos2);
          let assoc = !charRect || curY < charRect.top ? -1 : 1;
          return EditorSelection.cursor(pos2, assoc, void 0, goal);
        }
      }
    }
    function skipAtomicRanges(atoms, pos2, bias) {
      for (; ; ) {
        let moved = 0;
        for (let set2 of atoms) {
          set2.between(pos2 - 1, pos2 + 1, (from, to2, value2) => {
            if (pos2 > from && pos2 < to2) {
              let side = moved || bias || (pos2 - from < to2 - pos2 ? -1 : 1);
              pos2 = side < 0 ? from : to2;
              moved = side;
            }
          });
        }
        if (!moved)
          return pos2;
      }
    }
    function skipAtoms(view, oldPos, pos2) {
      let newPos = skipAtomicRanges(view.state.facet(atomicRanges).map((f) => f(view)), pos2.from, oldPos.head > pos2.from ? -1 : 1);
      return newPos == pos2.from ? pos2 : EditorSelection.cursor(newPos, newPos < pos2.from ? 1 : -1);
    }
    const LineBreakPlaceholder = "";
    class DOMReader {
      constructor(points, state) {
        this.points = points;
        this.text = "";
        this.lineSeparator = state.facet(EditorState.lineSeparator);
      }
      append(text2) {
        this.text += text2;
      }
      lineBreak() {
        this.text += LineBreakPlaceholder;
      }
      readRange(start2, end2) {
        if (!start2)
          return this;
        let parent = start2.parentNode;
        for (let cur2 = start2; ; ) {
          this.findPointBefore(parent, cur2);
          let oldLen = this.text.length;
          this.readNode(cur2);
          let next = cur2.nextSibling;
          if (next == end2)
            break;
          let view = ContentView.get(cur2), nextView = ContentView.get(next);
          if (view && nextView ? view.breakAfter : (view ? view.breakAfter : isBlockElement(cur2)) || isBlockElement(next) && (cur2.nodeName != "BR" || cur2.cmIgnore) && this.text.length > oldLen)
            this.lineBreak();
          cur2 = next;
        }
        this.findPointBefore(parent, end2);
        return this;
      }
      readTextNode(node2) {
        let text2 = node2.nodeValue;
        for (let point of this.points)
          if (point.node == node2)
            point.pos = this.text.length + Math.min(point.offset, text2.length);
        for (let off = 0, re2 = this.lineSeparator ? null : /\r\n?|\n/g; ; ) {
          let nextBreak = -1, breakSize = 1, m;
          if (this.lineSeparator) {
            nextBreak = text2.indexOf(this.lineSeparator, off);
            breakSize = this.lineSeparator.length;
          } else if (m = re2.exec(text2)) {
            nextBreak = m.index;
            breakSize = m[0].length;
          }
          this.append(text2.slice(off, nextBreak < 0 ? text2.length : nextBreak));
          if (nextBreak < 0)
            break;
          this.lineBreak();
          if (breakSize > 1) {
            for (let point of this.points)
              if (point.node == node2 && point.pos > this.text.length)
                point.pos -= breakSize - 1;
          }
          off = nextBreak + breakSize;
        }
      }
      readNode(node2) {
        if (node2.cmIgnore)
          return;
        let view = ContentView.get(node2);
        let fromView = view && view.overrideDOMText;
        if (fromView != null) {
          this.findPointInside(node2, fromView.length);
          for (let i2 = fromView.iter(); !i2.next().done; ) {
            if (i2.lineBreak)
              this.lineBreak();
            else
              this.append(i2.value);
          }
        } else if (node2.nodeType == 3) {
          this.readTextNode(node2);
        } else if (node2.nodeName == "BR") {
          if (node2.nextSibling)
            this.lineBreak();
        } else if (node2.nodeType == 1) {
          this.readRange(node2.firstChild, null);
        }
      }
      findPointBefore(node2, next) {
        for (let point of this.points)
          if (point.node == node2 && node2.childNodes[point.offset] == next)
            point.pos = this.text.length;
      }
      findPointInside(node2, length) {
        for (let point of this.points)
          if (node2.nodeType == 3 ? point.node == node2 : node2.contains(point.node))
            point.pos = this.text.length + (isAtEnd(node2, point.node, point.offset) ? length : 0);
      }
    }
    function isAtEnd(parent, node2, offset2) {
      for (; ; ) {
        if (!node2 || offset2 < maxOffset(node2))
          return false;
        if (node2 == parent)
          return true;
        offset2 = domIndex(node2) + 1;
        node2 = node2.parentNode;
      }
    }
    class DOMPoint {
      constructor(node2, offset2) {
        this.node = node2;
        this.offset = offset2;
        this.pos = -1;
      }
    }
    class DOMChange {
      constructor(view, start2, end2, typeOver) {
        this.typeOver = typeOver;
        this.bounds = null;
        this.text = "";
        this.domChanged = start2 > -1;
        let { impreciseHead: iHead, impreciseAnchor: iAnchor } = view.docView;
        if (view.state.readOnly && start2 > -1) {
          this.newSel = null;
        } else if (start2 > -1 && (this.bounds = view.docView.domBoundsAround(start2, end2, 0))) {
          let selPoints = iHead || iAnchor ? [] : selectionPoints(view);
          let reader = new DOMReader(selPoints, view.state);
          reader.readRange(this.bounds.startDOM, this.bounds.endDOM);
          this.text = reader.text;
          this.newSel = selectionFromPoints(selPoints, this.bounds.from);
        } else {
          let domSel = view.observer.selectionRange;
          let head = iHead && iHead.node == domSel.focusNode && iHead.offset == domSel.focusOffset || !contains(view.contentDOM, domSel.focusNode) ? view.state.selection.main.head : view.docView.posFromDOM(domSel.focusNode, domSel.focusOffset);
          let anchor = iAnchor && iAnchor.node == domSel.anchorNode && iAnchor.offset == domSel.anchorOffset || !contains(view.contentDOM, domSel.anchorNode) ? view.state.selection.main.anchor : view.docView.posFromDOM(domSel.anchorNode, domSel.anchorOffset);
          let vp = view.viewport;
          if ((browser.ios || browser.chrome) && view.state.selection.main.empty && head != anchor && (vp.from > 0 || vp.to < view.state.doc.length)) {
            let from = Math.min(head, anchor), to2 = Math.max(head, anchor);
            let offFrom = vp.from - from, offTo = vp.to - to2;
            if ((offFrom == 0 || offFrom == 1 || from == 0) && (offTo == 0 || offTo == -1 || to2 == view.state.doc.length)) {
              head = 0;
              anchor = view.state.doc.length;
            }
          }
          this.newSel = EditorSelection.single(anchor, head);
        }
      }
    }
    function applyDOMChange(view, domChange) {
      let change;
      let { newSel } = domChange, sel = view.state.selection.main;
      let lastKey = view.inputState.lastKeyTime > Date.now() - 100 ? view.inputState.lastKeyCode : -1;
      if (domChange.bounds) {
        let { from, to: to2 } = domChange.bounds;
        let preferredPos = sel.from, preferredSide = null;
        if (lastKey === 8 || browser.android && domChange.text.length < to2 - from) {
          preferredPos = sel.to;
          preferredSide = "end";
        }
        let diff2 = findDiff(view.state.doc.sliceString(from, to2, LineBreakPlaceholder), domChange.text, preferredPos - from, preferredSide);
        if (diff2) {
          if (browser.chrome && lastKey == 13 && diff2.toB == diff2.from + 2 && domChange.text.slice(diff2.from, diff2.toB) == LineBreakPlaceholder + LineBreakPlaceholder)
            diff2.toB--;
          change = {
            from: from + diff2.from,
            to: from + diff2.toA,
            insert: Text.of(domChange.text.slice(diff2.from, diff2.toB).split(LineBreakPlaceholder))
          };
        }
      } else if (newSel && (!view.hasFocus && view.state.facet(editable) || newSel.main.eq(sel))) {
        newSel = null;
      }
      if (!change && !newSel)
        return false;
      if (!change && domChange.typeOver && !sel.empty && newSel && newSel.main.empty) {
        change = { from: sel.from, to: sel.to, insert: view.state.doc.slice(sel.from, sel.to) };
      } else if ((browser.mac || browser.android) && change && change.from == change.to && change.from == sel.head - 1 && /^\. ?$/.test(change.insert.toString()) && view.contentDOM.getAttribute("autocorrect") == "off") {
        if (newSel && change.insert.length == 2)
          newSel = EditorSelection.single(newSel.main.anchor - 1, newSel.main.head - 1);
        change = { from: change.from, to: change.to, insert: Text.of([change.insert.toString().replace(".", " ")]) };
      } else if (change && change.from >= sel.from && change.to <= sel.to && (change.from != sel.from || change.to != sel.to) && sel.to - sel.from - (change.to - change.from) <= 4) {
        change = {
          from: sel.from,
          to: sel.to,
          insert: view.state.doc.slice(sel.from, change.from).append(change.insert).append(view.state.doc.slice(change.to, sel.to))
        };
      } else if (browser.chrome && change && change.from == change.to && change.from == sel.head && change.insert.toString() == "\n " && view.lineWrapping) {
        if (newSel)
          newSel = EditorSelection.single(newSel.main.anchor - 1, newSel.main.head - 1);
        change = { from: sel.from, to: sel.to, insert: Text.of([" "]) };
      }
      if (change) {
        return applyDOMChangeInner(view, change, newSel, lastKey);
      } else if (newSel && !newSel.main.eq(sel)) {
        let scrollIntoView2 = false, userEvent = "select";
        if (view.inputState.lastSelectionTime > Date.now() - 50) {
          if (view.inputState.lastSelectionOrigin == "select")
            scrollIntoView2 = true;
          userEvent = view.inputState.lastSelectionOrigin;
        }
        view.dispatch({ selection: newSel, scrollIntoView: scrollIntoView2, userEvent });
        return true;
      } else {
        return false;
      }
    }
    function applyDOMChangeInner(view, change, newSel, lastKey = -1) {
      if (browser.ios && view.inputState.flushIOSKey(change))
        return true;
      let sel = view.state.selection.main;
      if (browser.android && (change.to == sel.to && // GBoard will sometimes remove a space it just inserted
      // after a completion when you press enter
      (change.from == sel.from || change.from == sel.from - 1 && view.state.sliceDoc(change.from, sel.from) == " ") && change.insert.length == 1 && change.insert.lines == 2 && dispatchKey(view.contentDOM, "Enter", 13) || (change.from == sel.from - 1 && change.to == sel.to && change.insert.length == 0 || lastKey == 8 && change.insert.length < change.to - change.from && change.to > sel.head) && dispatchKey(view.contentDOM, "Backspace", 8) || change.from == sel.from && change.to == sel.to + 1 && change.insert.length == 0 && dispatchKey(view.contentDOM, "Delete", 46)))
        return true;
      let text2 = change.insert.toString();
      if (view.inputState.composing >= 0)
        view.inputState.composing++;
      let defaultTr;
      let defaultInsert = () => defaultTr || (defaultTr = applyDefaultInsert(view, change, newSel));
      if (!view.state.facet(inputHandler).some((h) => h(view, change.from, change.to, text2, defaultInsert)))
        view.dispatch(defaultInsert());
      return true;
    }
    function applyDefaultInsert(view, change, newSel) {
      let tr2, startState = view.state, sel = startState.selection.main;
      if (change.from >= sel.from && change.to <= sel.to && change.to - change.from >= (sel.to - sel.from) / 3 && (!newSel || newSel.main.empty && newSel.main.from == change.from + change.insert.length) && view.inputState.composing < 0) {
        let before = sel.from < change.from ? startState.sliceDoc(sel.from, change.from) : "";
        let after = sel.to > change.to ? startState.sliceDoc(change.to, sel.to) : "";
        tr2 = startState.replaceSelection(view.state.toText(before + change.insert.sliceString(0, void 0, view.state.lineBreak) + after));
      } else {
        let changes = startState.changes(change);
        let mainSel = newSel && newSel.main.to <= changes.newLength ? newSel.main : void 0;
        if (startState.selection.ranges.length > 1 && view.inputState.composing >= 0 && change.to <= sel.to && change.to >= sel.to - 10) {
          let replaced = view.state.sliceDoc(change.from, change.to);
          let compositionRange, composition = newSel && findCompositionNode(view, newSel.main.head);
          if (composition) {
            let dLen = change.insert.length - (change.to - change.from);
            compositionRange = { from: composition.from, to: composition.to - dLen };
          } else {
            compositionRange = view.state.doc.lineAt(sel.head);
          }
          let offset2 = sel.to - change.to, size = sel.to - sel.from;
          tr2 = startState.changeByRange((range2) => {
            if (range2.from == sel.from && range2.to == sel.to)
              return { changes, range: mainSel || range2.map(changes) };
            let to2 = range2.to - offset2, from = to2 - replaced.length;
            if (range2.to - range2.from != size || view.state.sliceDoc(from, to2) != replaced || // Unfortunately, there's no way to make multiple
            // changes in the same node work without aborting
            // composition, so cursors in the composition range are
            // ignored.
            range2.to >= compositionRange.from && range2.from <= compositionRange.to)
              return { range: range2 };
            let rangeChanges = startState.changes({ from, to: to2, insert: change.insert }), selOff = range2.to - sel.to;
            return {
              changes: rangeChanges,
              range: !mainSel ? range2.map(rangeChanges) : EditorSelection.range(Math.max(0, mainSel.anchor + selOff), Math.max(0, mainSel.head + selOff))
            };
          });
        } else {
          tr2 = {
            changes,
            selection: mainSel && startState.selection.replaceRange(mainSel)
          };
        }
      }
      let userEvent = "input.type";
      if (view.composing || view.inputState.compositionPendingChange && view.inputState.compositionEndedAt > Date.now() - 50) {
        view.inputState.compositionPendingChange = false;
        userEvent += ".compose";
        if (view.inputState.compositionFirstChange) {
          userEvent += ".start";
          view.inputState.compositionFirstChange = false;
        }
      }
      return startState.update(tr2, { userEvent, scrollIntoView: true });
    }
    function findDiff(a, b, preferredPos, preferredSide) {
      let minLen = Math.min(a.length, b.length);
      let from = 0;
      while (from < minLen && a.charCodeAt(from) == b.charCodeAt(from))
        from++;
      if (from == minLen && a.length == b.length)
        return null;
      let toA = a.length, toB = b.length;
      while (toA > 0 && toB > 0 && a.charCodeAt(toA - 1) == b.charCodeAt(toB - 1)) {
        toA--;
        toB--;
      }
      if (preferredSide == "end") {
        let adjust = Math.max(0, from - Math.min(toA, toB));
        preferredPos -= toA + adjust - from;
      }
      if (toA < from && a.length < b.length) {
        let move = preferredPos <= from && preferredPos >= toA ? from - preferredPos : 0;
        from -= move;
        toB = from + (toB - toA);
        toA = from;
      } else if (toB < from) {
        let move = preferredPos <= from && preferredPos >= toB ? from - preferredPos : 0;
        from -= move;
        toA = from + (toA - toB);
        toB = from;
      }
      return { from, toA, toB };
    }
    function selectionPoints(view) {
      let result2 = [];
      if (view.root.activeElement != view.contentDOM)
        return result2;
      let { anchorNode, anchorOffset, focusNode, focusOffset } = view.observer.selectionRange;
      if (anchorNode) {
        result2.push(new DOMPoint(anchorNode, anchorOffset));
        if (focusNode != anchorNode || focusOffset != anchorOffset)
          result2.push(new DOMPoint(focusNode, focusOffset));
      }
      return result2;
    }
    function selectionFromPoints(points, base2) {
      if (points.length == 0)
        return null;
      let anchor = points[0].pos, head = points.length == 2 ? points[1].pos : anchor;
      return anchor > -1 && head > -1 ? EditorSelection.single(anchor + base2, head + base2) : null;
    }
    class InputState {
      setSelectionOrigin(origin) {
        this.lastSelectionOrigin = origin;
        this.lastSelectionTime = Date.now();
      }
      constructor(view) {
        this.view = view;
        this.lastKeyCode = 0;
        this.lastKeyTime = 0;
        this.lastTouchTime = 0;
        this.lastFocusTime = 0;
        this.lastScrollTop = 0;
        this.lastScrollLeft = 0;
        this.pendingIOSKey = void 0;
        this.tabFocusMode = -1;
        this.lastSelectionOrigin = null;
        this.lastSelectionTime = 0;
        this.lastContextMenu = 0;
        this.scrollHandlers = [];
        this.handlers = /* @__PURE__ */ Object.create(null);
        this.composing = -1;
        this.compositionFirstChange = null;
        this.compositionEndedAt = 0;
        this.compositionPendingKey = false;
        this.compositionPendingChange = false;
        this.mouseSelection = null;
        this.draggedContent = null;
        this.handleEvent = this.handleEvent.bind(this);
        this.notifiedFocused = view.hasFocus;
        if (browser.safari)
          view.contentDOM.addEventListener("input", () => null);
        if (browser.gecko)
          firefoxCopyCutHack(view.contentDOM.ownerDocument);
      }
      handleEvent(event) {
        if (!eventBelongsToEditor(this.view, event) || this.ignoreDuringComposition(event))
          return;
        if (event.type == "keydown" && this.keydown(event))
          return;
        if (this.view.updateState != 0)
          Promise.resolve().then(() => this.runHandlers(event.type, event));
        else
          this.runHandlers(event.type, event);
      }
      runHandlers(type, event) {
        let handlers2 = this.handlers[type];
        if (handlers2) {
          for (let observer of handlers2.observers)
            observer(this.view, event);
          for (let handler of handlers2.handlers) {
            if (event.defaultPrevented)
              break;
            if (handler(this.view, event)) {
              event.preventDefault();
              break;
            }
          }
        }
      }
      ensureHandlers(plugins2) {
        let handlers2 = computeHandlers(plugins2), prev = this.handlers, dom = this.view.contentDOM;
        for (let type in handlers2)
          if (type != "scroll") {
            let passive2 = !handlers2[type].handlers.length;
            let exists = prev[type];
            if (exists && passive2 != !exists.handlers.length) {
              dom.removeEventListener(type, this.handleEvent);
              exists = null;
            }
            if (!exists)
              dom.addEventListener(type, this.handleEvent, { passive: passive2 });
          }
        for (let type in prev)
          if (type != "scroll" && !handlers2[type])
            dom.removeEventListener(type, this.handleEvent);
        this.handlers = handlers2;
      }
      keydown(event) {
        this.lastKeyCode = event.keyCode;
        this.lastKeyTime = Date.now();
        if (event.keyCode == 9 && this.tabFocusMode > -1 && (!this.tabFocusMode || Date.now() <= this.tabFocusMode))
          return true;
        if (this.tabFocusMode > 0 && event.keyCode != 27 && modifierCodes.indexOf(event.keyCode) < 0)
          this.tabFocusMode = -1;
        if (browser.android && browser.chrome && !event.synthetic && (event.keyCode == 13 || event.keyCode == 8)) {
          this.view.observer.delayAndroidKey(event.key, event.keyCode);
          return true;
        }
        let pending;
        if (browser.ios && !event.synthetic && !event.altKey && !event.metaKey && ((pending = PendingKeys.find((key2) => key2.keyCode == event.keyCode)) && !event.ctrlKey || EmacsyPendingKeys.indexOf(event.key) > -1 && event.ctrlKey && !event.shiftKey)) {
          this.pendingIOSKey = pending || event;
          setTimeout(() => this.flushIOSKey(), 250);
          return true;
        }
        if (event.keyCode != 229)
          this.view.observer.forceFlush();
        return false;
      }
      flushIOSKey(change) {
        let key2 = this.pendingIOSKey;
        if (!key2)
          return false;
        if (key2.key == "Enter" && change && change.from < change.to && /^\S+$/.test(change.insert.toString()))
          return false;
        this.pendingIOSKey = void 0;
        return dispatchKey(this.view.contentDOM, key2.key, key2.keyCode, key2 instanceof KeyboardEvent ? key2 : void 0);
      }
      ignoreDuringComposition(event) {
        if (!/^key/.test(event.type))
          return false;
        if (this.composing > 0)
          return true;
        if (browser.safari && !browser.ios && this.compositionPendingKey && Date.now() - this.compositionEndedAt < 100) {
          this.compositionPendingKey = false;
          return true;
        }
        return false;
      }
      startMouseSelection(mouseSelection) {
        if (this.mouseSelection)
          this.mouseSelection.destroy();
        this.mouseSelection = mouseSelection;
      }
      update(update) {
        this.view.observer.update(update);
        if (this.mouseSelection)
          this.mouseSelection.update(update);
        if (this.draggedContent && update.docChanged)
          this.draggedContent = this.draggedContent.map(update.changes);
        if (update.transactions.length)
          this.lastKeyCode = this.lastSelectionTime = 0;
      }
      destroy() {
        if (this.mouseSelection)
          this.mouseSelection.destroy();
      }
    }
    function bindHandler(plugin, handler) {
      return (view, event) => {
        try {
          return handler.call(plugin, event, view);
        } catch (e) {
          logException(view.state, e);
        }
      };
    }
    function computeHandlers(plugins2) {
      let result2 = /* @__PURE__ */ Object.create(null);
      function record(type) {
        return result2[type] || (result2[type] = { observers: [], handlers: [] });
      }
      for (let plugin of plugins2) {
        let spec = plugin.spec;
        if (spec && spec.domEventHandlers)
          for (let type in spec.domEventHandlers) {
            let f = spec.domEventHandlers[type];
            if (f)
              record(type).handlers.push(bindHandler(plugin.value, f));
          }
        if (spec && spec.domEventObservers)
          for (let type in spec.domEventObservers) {
            let f = spec.domEventObservers[type];
            if (f)
              record(type).observers.push(bindHandler(plugin.value, f));
          }
      }
      for (let type in handlers)
        record(type).handlers.push(handlers[type]);
      for (let type in observers)
        record(type).observers.push(observers[type]);
      return result2;
    }
    const PendingKeys = [
      { key: "Backspace", keyCode: 8, inputType: "deleteContentBackward" },
      { key: "Enter", keyCode: 13, inputType: "insertParagraph" },
      { key: "Enter", keyCode: 13, inputType: "insertLineBreak" },
      { key: "Delete", keyCode: 46, inputType: "deleteContentForward" }
    ];
    const EmacsyPendingKeys = "dthko";
    const modifierCodes = [16, 17, 18, 20, 91, 92, 224, 225];
    const dragScrollMargin = 6;
    function dragScrollSpeed(dist2) {
      return Math.max(0, dist2) * 0.7 + 8;
    }
    function dist(a, b) {
      return Math.max(Math.abs(a.clientX - b.clientX), Math.abs(a.clientY - b.clientY));
    }
    class MouseSelection {
      constructor(view, startEvent, style2, mustSelect) {
        this.view = view;
        this.startEvent = startEvent;
        this.style = style2;
        this.mustSelect = mustSelect;
        this.scrollSpeed = { x: 0, y: 0 };
        this.scrolling = -1;
        this.lastEvent = startEvent;
        this.scrollParents = scrollableParents(view.contentDOM);
        this.atoms = view.state.facet(atomicRanges).map((f) => f(view));
        let doc2 = view.contentDOM.ownerDocument;
        doc2.addEventListener("mousemove", this.move = this.move.bind(this));
        doc2.addEventListener("mouseup", this.up = this.up.bind(this));
        this.extend = startEvent.shiftKey;
        this.multiple = view.state.facet(EditorState.allowMultipleSelections) && addsSelectionRange(view, startEvent);
        this.dragging = isInPrimarySelection(view, startEvent) && getClickType(startEvent) == 1 ? null : false;
      }
      start(event) {
        if (this.dragging === false)
          this.select(event);
      }
      move(event) {
        if (event.buttons == 0)
          return this.destroy();
        if (this.dragging || this.dragging == null && dist(this.startEvent, event) < 10)
          return;
        this.select(this.lastEvent = event);
        let sx = 0, sy = 0;
        let left2 = 0, top2 = 0, right2 = this.view.win.innerWidth, bottom2 = this.view.win.innerHeight;
        if (this.scrollParents.x)
          ({ left: left2, right: right2 } = this.scrollParents.x.getBoundingClientRect());
        if (this.scrollParents.y)
          ({ top: top2, bottom: bottom2 } = this.scrollParents.y.getBoundingClientRect());
        let margins = getScrollMargins(this.view);
        if (event.clientX - margins.left <= left2 + dragScrollMargin)
          sx = -dragScrollSpeed(left2 - event.clientX);
        else if (event.clientX + margins.right >= right2 - dragScrollMargin)
          sx = dragScrollSpeed(event.clientX - right2);
        if (event.clientY - margins.top <= top2 + dragScrollMargin)
          sy = -dragScrollSpeed(top2 - event.clientY);
        else if (event.clientY + margins.bottom >= bottom2 - dragScrollMargin)
          sy = dragScrollSpeed(event.clientY - bottom2);
        this.setScrollSpeed(sx, sy);
      }
      up(event) {
        if (this.dragging == null)
          this.select(this.lastEvent);
        if (!this.dragging)
          event.preventDefault();
        this.destroy();
      }
      destroy() {
        this.setScrollSpeed(0, 0);
        let doc2 = this.view.contentDOM.ownerDocument;
        doc2.removeEventListener("mousemove", this.move);
        doc2.removeEventListener("mouseup", this.up);
        this.view.inputState.mouseSelection = this.view.inputState.draggedContent = null;
      }
      setScrollSpeed(sx, sy) {
        this.scrollSpeed = { x: sx, y: sy };
        if (sx || sy) {
          if (this.scrolling < 0)
            this.scrolling = setInterval(() => this.scroll(), 50);
        } else if (this.scrolling > -1) {
          clearInterval(this.scrolling);
          this.scrolling = -1;
        }
      }
      scroll() {
        let { x: x2, y } = this.scrollSpeed;
        if (x2 && this.scrollParents.x) {
          this.scrollParents.x.scrollLeft += x2;
          x2 = 0;
        }
        if (y && this.scrollParents.y) {
          this.scrollParents.y.scrollTop += y;
          y = 0;
        }
        if (x2 || y)
          this.view.win.scrollBy(x2, y);
        if (this.dragging === false)
          this.select(this.lastEvent);
      }
      skipAtoms(sel) {
        let ranges = null;
        for (let i2 = 0; i2 < sel.ranges.length; i2++) {
          let range2 = sel.ranges[i2], updated = null;
          if (range2.empty) {
            let pos2 = skipAtomicRanges(this.atoms, range2.from, 0);
            if (pos2 != range2.from)
              updated = EditorSelection.cursor(pos2, -1);
          } else {
            let from = skipAtomicRanges(this.atoms, range2.from, -1);
            let to2 = skipAtomicRanges(this.atoms, range2.to, 1);
            if (from != range2.from || to2 != range2.to)
              updated = EditorSelection.range(range2.from == range2.anchor ? from : to2, range2.from == range2.head ? from : to2);
          }
          if (updated) {
            if (!ranges)
              ranges = sel.ranges.slice();
            ranges[i2] = updated;
          }
        }
        return ranges ? EditorSelection.create(ranges, sel.mainIndex) : sel;
      }
      select(event) {
        let { view } = this, selection = this.skipAtoms(this.style.get(event, this.extend, this.multiple));
        if (this.mustSelect || !selection.eq(view.state.selection, this.dragging === false))
          this.view.dispatch({
            selection,
            userEvent: "select.pointer"
          });
        this.mustSelect = false;
      }
      update(update) {
        if (update.transactions.some((tr2) => tr2.isUserEvent("input.type")))
          this.destroy();
        else if (this.style.update(update))
          setTimeout(() => this.select(this.lastEvent), 20);
      }
    }
    function addsSelectionRange(view, event) {
      let facet = view.state.facet(clickAddsSelectionRange);
      return facet.length ? facet[0](event) : browser.mac ? event.metaKey : event.ctrlKey;
    }
    function dragMovesSelection(view, event) {
      let facet = view.state.facet(dragMovesSelection$1);
      return facet.length ? facet[0](event) : browser.mac ? !event.altKey : !event.ctrlKey;
    }
    function isInPrimarySelection(view, event) {
      let { main: main2 } = view.state.selection;
      if (main2.empty)
        return false;
      let sel = getSelection(view.root);
      if (!sel || sel.rangeCount == 0)
        return true;
      let rects = sel.getRangeAt(0).getClientRects();
      for (let i2 = 0; i2 < rects.length; i2++) {
        let rect2 = rects[i2];
        if (rect2.left <= event.clientX && rect2.right >= event.clientX && rect2.top <= event.clientY && rect2.bottom >= event.clientY)
          return true;
      }
      return false;
    }
    function eventBelongsToEditor(view, event) {
      if (!event.bubbles)
        return true;
      if (event.defaultPrevented)
        return false;
      for (let node2 = event.target, cView; node2 != view.contentDOM; node2 = node2.parentNode)
        if (!node2 || node2.nodeType == 11 || (cView = ContentView.get(node2)) && cView.ignoreEvent(event))
          return false;
      return true;
    }
    const handlers = /* @__PURE__ */ Object.create(null);
    const observers = /* @__PURE__ */ Object.create(null);
    const brokenClipboardAPI = browser.ie && browser.ie_version < 15 || browser.ios && browser.webkit_version < 604;
    function capturePaste(view) {
      let parent = view.dom.parentNode;
      if (!parent)
        return;
      let target2 = parent.appendChild(document.createElement("textarea"));
      target2.style.cssText = "position: fixed; left: -10000px; top: 10px";
      target2.focus();
      setTimeout(() => {
        view.focus();
        target2.remove();
        doPaste(view, target2.value);
      }, 50);
    }
    function textFilter(state, facet, text2) {
      for (let filter of state.facet(facet))
        text2 = filter(text2, state);
      return text2;
    }
    function doPaste(view, input2) {
      input2 = textFilter(view.state, clipboardInputFilter, input2);
      let { state } = view, changes, i2 = 1, text2 = state.toText(input2);
      let byLine = text2.lines == state.selection.ranges.length;
      let linewise = lastLinewiseCopy != null && state.selection.ranges.every((r2) => r2.empty) && lastLinewiseCopy == text2.toString();
      if (linewise) {
        let lastLine = -1;
        changes = state.changeByRange((range2) => {
          let line2 = state.doc.lineAt(range2.from);
          if (line2.from == lastLine)
            return { range: range2 };
          lastLine = line2.from;
          let insert2 = state.toText((byLine ? text2.line(i2++).text : input2) + state.lineBreak);
          return {
            changes: { from: line2.from, insert: insert2 },
            range: EditorSelection.cursor(range2.from + insert2.length)
          };
        });
      } else if (byLine) {
        changes = state.changeByRange((range2) => {
          let line2 = text2.line(i2++);
          return {
            changes: { from: range2.from, to: range2.to, insert: line2.text },
            range: EditorSelection.cursor(range2.from + line2.length)
          };
        });
      } else {
        changes = state.replaceSelection(text2);
      }
      view.dispatch(changes, {
        userEvent: "input.paste",
        scrollIntoView: true
      });
    }
    observers.scroll = (view) => {
      view.inputState.lastScrollTop = view.scrollDOM.scrollTop;
      view.inputState.lastScrollLeft = view.scrollDOM.scrollLeft;
    };
    handlers.keydown = (view, event) => {
      view.inputState.setSelectionOrigin("select");
      if (event.keyCode == 27 && view.inputState.tabFocusMode != 0)
        view.inputState.tabFocusMode = Date.now() + 2e3;
      return false;
    };
    observers.touchstart = (view, e) => {
      view.inputState.lastTouchTime = Date.now();
      view.inputState.setSelectionOrigin("select.pointer");
    };
    observers.touchmove = (view) => {
      view.inputState.setSelectionOrigin("select.pointer");
    };
    handlers.mousedown = (view, event) => {
      view.observer.flush();
      if (view.inputState.lastTouchTime > Date.now() - 2e3)
        return false;
      let style2 = null;
      for (let makeStyle of view.state.facet(mouseSelectionStyle)) {
        style2 = makeStyle(view, event);
        if (style2)
          break;
      }
      if (!style2 && event.button == 0)
        style2 = basicMouseSelection(view, event);
      if (style2) {
        let mustFocus = !view.hasFocus;
        view.inputState.startMouseSelection(new MouseSelection(view, event, style2, mustFocus));
        if (mustFocus)
          view.observer.ignore(() => {
            focusPreventScroll(view.contentDOM);
            let active = view.root.activeElement;
            if (active && !active.contains(view.contentDOM))
              active.blur();
          });
        let mouseSel = view.inputState.mouseSelection;
        if (mouseSel) {
          mouseSel.start(event);
          return mouseSel.dragging === false;
        }
      }
      return false;
    };
    function rangeForClick(view, pos2, bias, type) {
      if (type == 1) {
        return EditorSelection.cursor(pos2, bias);
      } else if (type == 2) {
        return groupAt(view.state, pos2, bias);
      } else {
        let visual = LineView.find(view.docView, pos2), line2 = view.state.doc.lineAt(visual ? visual.posAtEnd : pos2);
        let from = visual ? visual.posAtStart : line2.from, to2 = visual ? visual.posAtEnd : line2.to;
        if (to2 < view.state.doc.length && to2 == line2.to)
          to2++;
        return EditorSelection.range(from, to2);
      }
    }
    let inside = (x2, y, rect2) => y >= rect2.top && y <= rect2.bottom && x2 >= rect2.left && x2 <= rect2.right;
    function findPositionSide(view, pos2, x2, y) {
      let line2 = LineView.find(view.docView, pos2);
      if (!line2)
        return 1;
      let off = pos2 - line2.posAtStart;
      if (off == 0)
        return 1;
      if (off == line2.length)
        return -1;
      let before = line2.coordsAt(off, -1);
      if (before && inside(x2, y, before))
        return -1;
      let after = line2.coordsAt(off, 1);
      if (after && inside(x2, y, after))
        return 1;
      return before && before.bottom >= y ? -1 : 1;
    }
    function queryPos(view, event) {
      let pos2 = view.posAtCoords({ x: event.clientX, y: event.clientY }, false);
      return { pos: pos2, bias: findPositionSide(view, pos2, event.clientX, event.clientY) };
    }
    const BadMouseDetail = browser.ie && browser.ie_version <= 11;
    let lastMouseDown = null, lastMouseDownCount = 0, lastMouseDownTime = 0;
    function getClickType(event) {
      if (!BadMouseDetail)
        return event.detail;
      let last = lastMouseDown, lastTime = lastMouseDownTime;
      lastMouseDown = event;
      lastMouseDownTime = Date.now();
      return lastMouseDownCount = !last || lastTime > Date.now() - 400 && Math.abs(last.clientX - event.clientX) < 2 && Math.abs(last.clientY - event.clientY) < 2 ? (lastMouseDownCount + 1) % 3 : 1;
    }
    function basicMouseSelection(view, event) {
      let start2 = queryPos(view, event), type = getClickType(event);
      let startSel = view.state.selection;
      return {
        update(update) {
          if (update.docChanged) {
            start2.pos = update.changes.mapPos(start2.pos);
            startSel = startSel.map(update.changes);
          }
        },
        get(event2, extend, multiple) {
          let cur2 = queryPos(view, event2), removed;
          let range2 = rangeForClick(view, cur2.pos, cur2.bias, type);
          if (start2.pos != cur2.pos && !extend) {
            let startRange = rangeForClick(view, start2.pos, start2.bias, type);
            let from = Math.min(startRange.from, range2.from), to2 = Math.max(startRange.to, range2.to);
            range2 = from < range2.from ? EditorSelection.range(from, to2) : EditorSelection.range(to2, from);
          }
          if (extend)
            return startSel.replaceRange(startSel.main.extend(range2.from, range2.to));
          else if (multiple && type == 1 && startSel.ranges.length > 1 && (removed = removeRangeAround(startSel, cur2.pos)))
            return removed;
          else if (multiple)
            return startSel.addRange(range2);
          else
            return EditorSelection.create([range2]);
        }
      };
    }
    function removeRangeAround(sel, pos2) {
      for (let i2 = 0; i2 < sel.ranges.length; i2++) {
        let { from, to: to2 } = sel.ranges[i2];
        if (from <= pos2 && to2 >= pos2)
          return EditorSelection.create(sel.ranges.slice(0, i2).concat(sel.ranges.slice(i2 + 1)), sel.mainIndex == i2 ? 0 : sel.mainIndex - (sel.mainIndex > i2 ? 1 : 0));
      }
      return null;
    }
    handlers.dragstart = (view, event) => {
      let { selection: { main: range2 } } = view.state;
      if (event.target.draggable) {
        let cView = view.docView.nearest(event.target);
        if (cView && cView.isWidget) {
          let from = cView.posAtStart, to2 = from + cView.length;
          if (from >= range2.to || to2 <= range2.from)
            range2 = EditorSelection.range(from, to2);
        }
      }
      let { inputState } = view;
      if (inputState.mouseSelection)
        inputState.mouseSelection.dragging = true;
      inputState.draggedContent = range2;
      if (event.dataTransfer) {
        event.dataTransfer.setData("Text", textFilter(view.state, clipboardOutputFilter, view.state.sliceDoc(range2.from, range2.to)));
        event.dataTransfer.effectAllowed = "copyMove";
      }
      return false;
    };
    handlers.dragend = (view) => {
      view.inputState.draggedContent = null;
      return false;
    };
    function dropText(view, event, text2, direct) {
      text2 = textFilter(view.state, clipboardInputFilter, text2);
      if (!text2)
        return;
      let dropPos = view.posAtCoords({ x: event.clientX, y: event.clientY }, false);
      let { draggedContent } = view.inputState;
      let del = direct && draggedContent && dragMovesSelection(view, event) ? { from: draggedContent.from, to: draggedContent.to } : null;
      let ins = { from: dropPos, insert: text2 };
      let changes = view.state.changes(del ? [del, ins] : ins);
      view.focus();
      view.dispatch({
        changes,
        selection: { anchor: changes.mapPos(dropPos, -1), head: changes.mapPos(dropPos, 1) },
        userEvent: del ? "move.drop" : "input.drop"
      });
      view.inputState.draggedContent = null;
    }
    handlers.drop = (view, event) => {
      if (!event.dataTransfer)
        return false;
      if (view.state.readOnly)
        return true;
      let files = event.dataTransfer.files;
      if (files && files.length) {
        let text2 = Array(files.length), read2 = 0;
        let finishFile = () => {
          if (++read2 == files.length)
            dropText(view, event, text2.filter((s) => s != null).join(view.state.lineBreak), false);
        };
        for (let i2 = 0; i2 < files.length; i2++) {
          let reader = new FileReader();
          reader.onerror = finishFile;
          reader.onload = () => {
            if (!/[\x00-\x08\x0e-\x1f]{2}/.test(reader.result))
              text2[i2] = reader.result;
            finishFile();
          };
          reader.readAsText(files[i2]);
        }
        return true;
      } else {
        let text2 = event.dataTransfer.getData("Text");
        if (text2) {
          dropText(view, event, text2, true);
          return true;
        }
      }
      return false;
    };
    handlers.paste = (view, event) => {
      if (view.state.readOnly)
        return true;
      view.observer.flush();
      let data = brokenClipboardAPI ? null : event.clipboardData;
      if (data) {
        doPaste(view, data.getData("text/plain") || data.getData("text/uri-list"));
        return true;
      } else {
        capturePaste(view);
        return false;
      }
    };
    function captureCopy(view, text2) {
      let parent = view.dom.parentNode;
      if (!parent)
        return;
      let target2 = parent.appendChild(document.createElement("textarea"));
      target2.style.cssText = "position: fixed; left: -10000px; top: 10px";
      target2.value = text2;
      target2.focus();
      target2.selectionEnd = text2.length;
      target2.selectionStart = 0;
      setTimeout(() => {
        target2.remove();
        view.focus();
      }, 50);
    }
    function copiedRange(state) {
      let content2 = [], ranges = [], linewise = false;
      for (let range2 of state.selection.ranges)
        if (!range2.empty) {
          content2.push(state.sliceDoc(range2.from, range2.to));
          ranges.push(range2);
        }
      if (!content2.length) {
        let upto = -1;
        for (let { from } of state.selection.ranges) {
          let line2 = state.doc.lineAt(from);
          if (line2.number > upto) {
            content2.push(line2.text);
            ranges.push({ from: line2.from, to: Math.min(state.doc.length, line2.to + 1) });
          }
          upto = line2.number;
        }
        linewise = true;
      }
      return { text: textFilter(state, clipboardOutputFilter, content2.join(state.lineBreak)), ranges, linewise };
    }
    let lastLinewiseCopy = null;
    handlers.copy = handlers.cut = (view, event) => {
      let { text: text2, ranges, linewise } = copiedRange(view.state);
      if (!text2 && !linewise)
        return false;
      lastLinewiseCopy = linewise ? text2 : null;
      if (event.type == "cut" && !view.state.readOnly)
        view.dispatch({
          changes: ranges,
          scrollIntoView: true,
          userEvent: "delete.cut"
        });
      let data = brokenClipboardAPI ? null : event.clipboardData;
      if (data) {
        data.clearData();
        data.setData("text/plain", text2);
        return true;
      } else {
        captureCopy(view, text2);
        return false;
      }
    };
    const isFocusChange = /* @__PURE__ */ Annotation.define();
    function focusChangeTransaction(state, focus) {
      let effects = [];
      for (let getEffect of state.facet(focusChangeEffect)) {
        let effect2 = getEffect(state, focus);
        if (effect2)
          effects.push(effect2);
      }
      return effects ? state.update({ effects, annotations: isFocusChange.of(true) }) : null;
    }
    function updateForFocusChange(view) {
      setTimeout(() => {
        let focus = view.hasFocus;
        if (focus != view.inputState.notifiedFocused) {
          let tr2 = focusChangeTransaction(view.state, focus);
          if (tr2)
            view.dispatch(tr2);
          else
            view.update([]);
        }
      }, 10);
    }
    observers.focus = (view) => {
      view.inputState.lastFocusTime = Date.now();
      if (!view.scrollDOM.scrollTop && (view.inputState.lastScrollTop || view.inputState.lastScrollLeft)) {
        view.scrollDOM.scrollTop = view.inputState.lastScrollTop;
        view.scrollDOM.scrollLeft = view.inputState.lastScrollLeft;
      }
      updateForFocusChange(view);
    };
    observers.blur = (view) => {
      view.observer.clearSelectionRange();
      updateForFocusChange(view);
    };
    observers.compositionstart = observers.compositionupdate = (view) => {
      if (view.observer.editContext)
        return;
      if (view.inputState.compositionFirstChange == null)
        view.inputState.compositionFirstChange = true;
      if (view.inputState.composing < 0) {
        view.inputState.composing = 0;
      }
    };
    observers.compositionend = (view) => {
      if (view.observer.editContext)
        return;
      view.inputState.composing = -1;
      view.inputState.compositionEndedAt = Date.now();
      view.inputState.compositionPendingKey = true;
      view.inputState.compositionPendingChange = view.observer.pendingRecords().length > 0;
      view.inputState.compositionFirstChange = null;
      if (browser.chrome && browser.android) {
        view.observer.flushSoon();
      } else if (view.inputState.compositionPendingChange) {
        Promise.resolve().then(() => view.observer.flush());
      } else {
        setTimeout(() => {
          if (view.inputState.composing < 0 && view.docView.hasComposition)
            view.update([]);
        }, 50);
      }
    };
    observers.contextmenu = (view) => {
      view.inputState.lastContextMenu = Date.now();
    };
    handlers.beforeinput = (view, event) => {
      var _a2, _b2;
      if (event.inputType == "insertReplacementText" && view.observer.editContext) {
        let text2 = (_a2 = event.dataTransfer) === null || _a2 === void 0 ? void 0 : _a2.getData("text/plain"), ranges = event.getTargetRanges();
        if (text2 && ranges.length) {
          let r2 = ranges[0];
          let from = view.posAtDOM(r2.startContainer, r2.startOffset), to2 = view.posAtDOM(r2.endContainer, r2.endOffset);
          applyDOMChangeInner(view, { from, to: to2, insert: view.state.toText(text2) }, null);
          return true;
        }
      }
      let pending;
      if (browser.chrome && browser.android && (pending = PendingKeys.find((key2) => key2.inputType == event.inputType))) {
        view.observer.delayAndroidKey(pending.key, pending.keyCode);
        if (pending.key == "Backspace" || pending.key == "Delete") {
          let startViewHeight = ((_b2 = window.visualViewport) === null || _b2 === void 0 ? void 0 : _b2.height) || 0;
          setTimeout(() => {
            var _a3;
            if ((((_a3 = window.visualViewport) === null || _a3 === void 0 ? void 0 : _a3.height) || 0) > startViewHeight + 10 && view.hasFocus) {
              view.contentDOM.blur();
              view.focus();
            }
          }, 100);
        }
      }
      if (browser.ios && event.inputType == "deleteContentForward") {
        view.observer.flushSoon();
      }
      if (browser.safari && event.inputType == "insertText" && view.inputState.composing >= 0) {
        setTimeout(() => observers.compositionend(view, event), 20);
      }
      return false;
    };
    const appliedFirefoxHack = /* @__PURE__ */ new Set();
    function firefoxCopyCutHack(doc2) {
      if (!appliedFirefoxHack.has(doc2)) {
        appliedFirefoxHack.add(doc2);
        doc2.addEventListener("copy", () => {
        });
        doc2.addEventListener("cut", () => {
        });
      }
    }
    const wrappingWhiteSpace = ["pre-wrap", "normal", "pre-line", "break-spaces"];
    let heightChangeFlag = false;
    function clearHeightChangeFlag() {
      heightChangeFlag = false;
    }
    class HeightOracle {
      constructor(lineWrapping) {
        this.lineWrapping = lineWrapping;
        this.doc = Text.empty;
        this.heightSamples = {};
        this.lineHeight = 14;
        this.charWidth = 7;
        this.textHeight = 14;
        this.lineLength = 30;
      }
      heightForGap(from, to2) {
        let lines = this.doc.lineAt(to2).number - this.doc.lineAt(from).number + 1;
        if (this.lineWrapping)
          lines += Math.max(0, Math.ceil((to2 - from - lines * this.lineLength * 0.5) / this.lineLength));
        return this.lineHeight * lines;
      }
      heightForLine(length) {
        if (!this.lineWrapping)
          return this.lineHeight;
        let lines = 1 + Math.max(0, Math.ceil((length - this.lineLength) / (this.lineLength - 5)));
        return lines * this.lineHeight;
      }
      setDoc(doc2) {
        this.doc = doc2;
        return this;
      }
      mustRefreshForWrapping(whiteSpace) {
        return wrappingWhiteSpace.indexOf(whiteSpace) > -1 != this.lineWrapping;
      }
      mustRefreshForHeights(lineHeights) {
        let newHeight = false;
        for (let i2 = 0; i2 < lineHeights.length; i2++) {
          let h = lineHeights[i2];
          if (h < 0) {
            i2++;
          } else if (!this.heightSamples[Math.floor(h * 10)]) {
            newHeight = true;
            this.heightSamples[Math.floor(h * 10)] = true;
          }
        }
        return newHeight;
      }
      refresh(whiteSpace, lineHeight, charWidth, textHeight, lineLength, knownHeights) {
        let lineWrapping = wrappingWhiteSpace.indexOf(whiteSpace) > -1;
        let changed = Math.round(lineHeight) != Math.round(this.lineHeight) || this.lineWrapping != lineWrapping;
        this.lineWrapping = lineWrapping;
        this.lineHeight = lineHeight;
        this.charWidth = charWidth;
        this.textHeight = textHeight;
        this.lineLength = lineLength;
        if (changed) {
          this.heightSamples = {};
          for (let i2 = 0; i2 < knownHeights.length; i2++) {
            let h = knownHeights[i2];
            if (h < 0)
              i2++;
            else
              this.heightSamples[Math.floor(h * 10)] = true;
          }
        }
        return changed;
      }
    }
    class MeasuredHeights {
      constructor(from, heights) {
        this.from = from;
        this.heights = heights;
        this.index = 0;
      }
      get more() {
        return this.index < this.heights.length;
      }
    }
    class BlockInfo {
      /**
      @internal
      */
      constructor(from, length, top2, height, _content) {
        this.from = from;
        this.length = length;
        this.top = top2;
        this.height = height;
        this._content = _content;
      }
      /**
      The type of element this is. When querying lines, this may be
      an array of all the blocks that make up the line.
      */
      get type() {
        return typeof this._content == "number" ? BlockType.Text : Array.isArray(this._content) ? this._content : this._content.type;
      }
      /**
      The end of the element as a document position.
      */
      get to() {
        return this.from + this.length;
      }
      /**
      The bottom position of the element.
      */
      get bottom() {
        return this.top + this.height;
      }
      /**
      If this is a widget block, this will return the widget
      associated with it.
      */
      get widget() {
        return this._content instanceof PointDecoration ? this._content.widget : null;
      }
      /**
      If this is a textblock, this holds the number of line breaks
      that appear in widgets inside the block.
      */
      get widgetLineBreaks() {
        return typeof this._content == "number" ? this._content : 0;
      }
      /**
      @internal
      */
      join(other) {
        let content2 = (Array.isArray(this._content) ? this._content : [this]).concat(Array.isArray(other._content) ? other._content : [other]);
        return new BlockInfo(this.from, this.length + other.length, this.top, this.height + other.height, content2);
      }
    }
    var QueryType = /* @__PURE__ */ (function(QueryType2) {
      QueryType2[QueryType2["ByPos"] = 0] = "ByPos";
      QueryType2[QueryType2["ByHeight"] = 1] = "ByHeight";
      QueryType2[QueryType2["ByPosNoHeight"] = 2] = "ByPosNoHeight";
      return QueryType2;
    })(QueryType || (QueryType = {}));
    const Epsilon = 1e-3;
    class HeightMap {
      constructor(length, height, flags = 2) {
        this.length = length;
        this.height = height;
        this.flags = flags;
      }
      get outdated() {
        return (this.flags & 2) > 0;
      }
      set outdated(value2) {
        this.flags = (value2 ? 2 : 0) | this.flags & -3;
      }
      setHeight(height) {
        if (this.height != height) {
          if (Math.abs(this.height - height) > Epsilon)
            heightChangeFlag = true;
          this.height = height;
        }
      }
      // Base case is to replace a leaf node, which simply builds a tree
      // from the new nodes and returns that (HeightMapBranch and
      // HeightMapGap override this to actually use from/to)
      replace(_from, _to, nodes) {
        return HeightMap.of(nodes);
      }
      // Again, these are base cases, and are overridden for branch and gap nodes.
      decomposeLeft(_to, result2) {
        result2.push(this);
      }
      decomposeRight(_from, result2) {
        result2.push(this);
      }
      applyChanges(decorations2, oldDoc, oracle, changes) {
        let me2 = this, doc2 = oracle.doc;
        for (let i2 = changes.length - 1; i2 >= 0; i2--) {
          let { fromA, toA, fromB, toB } = changes[i2];
          let start2 = me2.lineAt(fromA, QueryType.ByPosNoHeight, oracle.setDoc(oldDoc), 0, 0);
          let end2 = start2.to >= toA ? start2 : me2.lineAt(toA, QueryType.ByPosNoHeight, oracle, 0, 0);
          toB += end2.to - toA;
          toA = end2.to;
          while (i2 > 0 && start2.from <= changes[i2 - 1].toA) {
            fromA = changes[i2 - 1].fromA;
            fromB = changes[i2 - 1].fromB;
            i2--;
            if (fromA < start2.from)
              start2 = me2.lineAt(fromA, QueryType.ByPosNoHeight, oracle, 0, 0);
          }
          fromB += start2.from - fromA;
          fromA = start2.from;
          let nodes = NodeBuilder.build(oracle.setDoc(doc2), decorations2, fromB, toB);
          me2 = replace(me2, me2.replace(fromA, toA, nodes));
        }
        return me2.updateHeight(oracle, 0);
      }
      static empty() {
        return new HeightMapText(0, 0);
      }
      // nodes uses null values to indicate the position of line breaks.
      // There are never line breaks at the start or end of the array, or
      // two line breaks next to each other, and the array isn't allowed
      // to be empty (same restrictions as return value from the builder).
      static of(nodes) {
        if (nodes.length == 1)
          return nodes[0];
        let i2 = 0, j = nodes.length, before = 0, after = 0;
        for (; ; ) {
          if (i2 == j) {
            if (before > after * 2) {
              let split = nodes[i2 - 1];
              if (split.break)
                nodes.splice(--i2, 1, split.left, null, split.right);
              else
                nodes.splice(--i2, 1, split.left, split.right);
              j += 1 + split.break;
              before -= split.size;
            } else if (after > before * 2) {
              let split = nodes[j];
              if (split.break)
                nodes.splice(j, 1, split.left, null, split.right);
              else
                nodes.splice(j, 1, split.left, split.right);
              j += 2 + split.break;
              after -= split.size;
            } else {
              break;
            }
          } else if (before < after) {
            let next = nodes[i2++];
            if (next)
              before += next.size;
          } else {
            let next = nodes[--j];
            if (next)
              after += next.size;
          }
        }
        let brk = 0;
        if (nodes[i2 - 1] == null) {
          brk = 1;
          i2--;
        } else if (nodes[i2] == null) {
          brk = 1;
          j++;
        }
        return new HeightMapBranch(HeightMap.of(nodes.slice(0, i2)), brk, HeightMap.of(nodes.slice(j)));
      }
    }
    function replace(old, val) {
      if (old == val)
        return old;
      if (old.constructor != val.constructor)
        heightChangeFlag = true;
      return val;
    }
    HeightMap.prototype.size = 1;
    class HeightMapBlock extends HeightMap {
      constructor(length, height, deco) {
        super(length, height);
        this.deco = deco;
      }
      blockAt(_height, _oracle, top2, offset2) {
        return new BlockInfo(offset2, this.length, top2, this.height, this.deco || 0);
      }
      lineAt(_value, _type, oracle, top2, offset2) {
        return this.blockAt(0, oracle, top2, offset2);
      }
      forEachLine(from, to2, oracle, top2, offset2, f) {
        if (from <= offset2 + this.length && to2 >= offset2)
          f(this.blockAt(0, oracle, top2, offset2));
      }
      updateHeight(oracle, offset2 = 0, _force = false, measured) {
        if (measured && measured.from <= offset2 && measured.more)
          this.setHeight(measured.heights[measured.index++]);
        this.outdated = false;
        return this;
      }
      toString() {
        return `block(${this.length})`;
      }
    }
    class HeightMapText extends HeightMapBlock {
      constructor(length, height) {
        super(length, height, null);
        this.collapsed = 0;
        this.widgetHeight = 0;
        this.breaks = 0;
      }
      blockAt(_height, _oracle, top2, offset2) {
        return new BlockInfo(offset2, this.length, top2, this.height, this.breaks);
      }
      replace(_from, _to, nodes) {
        let node2 = nodes[0];
        if (nodes.length == 1 && (node2 instanceof HeightMapText || node2 instanceof HeightMapGap && node2.flags & 4) && Math.abs(this.length - node2.length) < 10) {
          if (node2 instanceof HeightMapGap)
            node2 = new HeightMapText(node2.length, this.height);
          else
            node2.height = this.height;
          if (!this.outdated)
            node2.outdated = false;
          return node2;
        } else {
          return HeightMap.of(nodes);
        }
      }
      updateHeight(oracle, offset2 = 0, force = false, measured) {
        if (measured && measured.from <= offset2 && measured.more)
          this.setHeight(measured.heights[measured.index++]);
        else if (force || this.outdated)
          this.setHeight(Math.max(this.widgetHeight, oracle.heightForLine(this.length - this.collapsed)) + this.breaks * oracle.lineHeight);
        this.outdated = false;
        return this;
      }
      toString() {
        return `line(${this.length}${this.collapsed ? -this.collapsed : ""}${this.widgetHeight ? ":" + this.widgetHeight : ""})`;
      }
    }
    class HeightMapGap extends HeightMap {
      constructor(length) {
        super(length, 0);
      }
      heightMetrics(oracle, offset2) {
        let firstLine = oracle.doc.lineAt(offset2).number, lastLine = oracle.doc.lineAt(offset2 + this.length).number;
        let lines = lastLine - firstLine + 1;
        let perLine, perChar = 0;
        if (oracle.lineWrapping) {
          let totalPerLine = Math.min(this.height, oracle.lineHeight * lines);
          perLine = totalPerLine / lines;
          if (this.length > lines + 1)
            perChar = (this.height - totalPerLine) / (this.length - lines - 1);
        } else {
          perLine = this.height / lines;
        }
        return { firstLine, lastLine, perLine, perChar };
      }
      blockAt(height, oracle, top2, offset2) {
        let { firstLine, lastLine, perLine, perChar } = this.heightMetrics(oracle, offset2);
        if (oracle.lineWrapping) {
          let guess = offset2 + (height < oracle.lineHeight ? 0 : Math.round(Math.max(0, Math.min(1, (height - top2) / this.height)) * this.length));
          let line2 = oracle.doc.lineAt(guess), lineHeight = perLine + line2.length * perChar;
          let lineTop = Math.max(top2, height - lineHeight / 2);
          return new BlockInfo(line2.from, line2.length, lineTop, lineHeight, 0);
        } else {
          let line2 = Math.max(0, Math.min(lastLine - firstLine, Math.floor((height - top2) / perLine)));
          let { from, length } = oracle.doc.line(firstLine + line2);
          return new BlockInfo(from, length, top2 + perLine * line2, perLine, 0);
        }
      }
      lineAt(value2, type, oracle, top2, offset2) {
        if (type == QueryType.ByHeight)
          return this.blockAt(value2, oracle, top2, offset2);
        if (type == QueryType.ByPosNoHeight) {
          let { from, to: to2 } = oracle.doc.lineAt(value2);
          return new BlockInfo(from, to2 - from, 0, 0, 0);
        }
        let { firstLine, perLine, perChar } = this.heightMetrics(oracle, offset2);
        let line2 = oracle.doc.lineAt(value2), lineHeight = perLine + line2.length * perChar;
        let linesAbove = line2.number - firstLine;
        let lineTop = top2 + perLine * linesAbove + perChar * (line2.from - offset2 - linesAbove);
        return new BlockInfo(line2.from, line2.length, Math.max(top2, Math.min(lineTop, top2 + this.height - lineHeight)), lineHeight, 0);
      }
      forEachLine(from, to2, oracle, top2, offset2, f) {
        from = Math.max(from, offset2);
        to2 = Math.min(to2, offset2 + this.length);
        let { firstLine, perLine, perChar } = this.heightMetrics(oracle, offset2);
        for (let pos2 = from, lineTop = top2; pos2 <= to2; ) {
          let line2 = oracle.doc.lineAt(pos2);
          if (pos2 == from) {
            let linesAbove = line2.number - firstLine;
            lineTop += perLine * linesAbove + perChar * (from - offset2 - linesAbove);
          }
          let lineHeight = perLine + perChar * line2.length;
          f(new BlockInfo(line2.from, line2.length, lineTop, lineHeight, 0));
          lineTop += lineHeight;
          pos2 = line2.to + 1;
        }
      }
      replace(from, to2, nodes) {
        let after = this.length - to2;
        if (after > 0) {
          let last = nodes[nodes.length - 1];
          if (last instanceof HeightMapGap)
            nodes[nodes.length - 1] = new HeightMapGap(last.length + after);
          else
            nodes.push(null, new HeightMapGap(after - 1));
        }
        if (from > 0) {
          let first = nodes[0];
          if (first instanceof HeightMapGap)
            nodes[0] = new HeightMapGap(from + first.length);
          else
            nodes.unshift(new HeightMapGap(from - 1), null);
        }
        return HeightMap.of(nodes);
      }
      decomposeLeft(to2, result2) {
        result2.push(new HeightMapGap(to2 - 1), null);
      }
      decomposeRight(from, result2) {
        result2.push(null, new HeightMapGap(this.length - from - 1));
      }
      updateHeight(oracle, offset2 = 0, force = false, measured) {
        let end2 = offset2 + this.length;
        if (measured && measured.from <= offset2 + this.length && measured.more) {
          let nodes = [], pos2 = Math.max(offset2, measured.from), singleHeight = -1;
          if (measured.from > offset2)
            nodes.push(new HeightMapGap(measured.from - offset2 - 1).updateHeight(oracle, offset2));
          while (pos2 <= end2 && measured.more) {
            let len = oracle.doc.lineAt(pos2).length;
            if (nodes.length)
              nodes.push(null);
            let height = measured.heights[measured.index++];
            if (singleHeight == -1)
              singleHeight = height;
            else if (Math.abs(height - singleHeight) >= Epsilon)
              singleHeight = -2;
            let line2 = new HeightMapText(len, height);
            line2.outdated = false;
            nodes.push(line2);
            pos2 += len + 1;
          }
          if (pos2 <= end2)
            nodes.push(null, new HeightMapGap(end2 - pos2).updateHeight(oracle, pos2));
          let result2 = HeightMap.of(nodes);
          if (singleHeight < 0 || Math.abs(result2.height - this.height) >= Epsilon || Math.abs(singleHeight - this.heightMetrics(oracle, offset2).perLine) >= Epsilon)
            heightChangeFlag = true;
          return replace(this, result2);
        } else if (force || this.outdated) {
          this.setHeight(oracle.heightForGap(offset2, offset2 + this.length));
          this.outdated = false;
        }
        return this;
      }
      toString() {
        return `gap(${this.length})`;
      }
    }
    class HeightMapBranch extends HeightMap {
      constructor(left2, brk, right2) {
        super(left2.length + brk + right2.length, left2.height + right2.height, brk | (left2.outdated || right2.outdated ? 2 : 0));
        this.left = left2;
        this.right = right2;
        this.size = left2.size + right2.size;
      }
      get break() {
        return this.flags & 1;
      }
      blockAt(height, oracle, top2, offset2) {
        let mid2 = top2 + this.left.height;
        return height < mid2 ? this.left.blockAt(height, oracle, top2, offset2) : this.right.blockAt(height, oracle, mid2, offset2 + this.left.length + this.break);
      }
      lineAt(value2, type, oracle, top2, offset2) {
        let rightTop = top2 + this.left.height, rightOffset = offset2 + this.left.length + this.break;
        let left2 = type == QueryType.ByHeight ? value2 < rightTop : value2 < rightOffset;
        let base2 = left2 ? this.left.lineAt(value2, type, oracle, top2, offset2) : this.right.lineAt(value2, type, oracle, rightTop, rightOffset);
        if (this.break || (left2 ? base2.to < rightOffset : base2.from > rightOffset))
          return base2;
        let subQuery = type == QueryType.ByPosNoHeight ? QueryType.ByPosNoHeight : QueryType.ByPos;
        if (left2)
          return base2.join(this.right.lineAt(rightOffset, subQuery, oracle, rightTop, rightOffset));
        else
          return this.left.lineAt(rightOffset, subQuery, oracle, top2, offset2).join(base2);
      }
      forEachLine(from, to2, oracle, top2, offset2, f) {
        let rightTop = top2 + this.left.height, rightOffset = offset2 + this.left.length + this.break;
        if (this.break) {
          if (from < rightOffset)
            this.left.forEachLine(from, to2, oracle, top2, offset2, f);
          if (to2 >= rightOffset)
            this.right.forEachLine(from, to2, oracle, rightTop, rightOffset, f);
        } else {
          let mid2 = this.lineAt(rightOffset, QueryType.ByPos, oracle, top2, offset2);
          if (from < mid2.from)
            this.left.forEachLine(from, mid2.from - 1, oracle, top2, offset2, f);
          if (mid2.to >= from && mid2.from <= to2)
            f(mid2);
          if (to2 > mid2.to)
            this.right.forEachLine(mid2.to + 1, to2, oracle, rightTop, rightOffset, f);
        }
      }
      replace(from, to2, nodes) {
        let rightStart = this.left.length + this.break;
        if (to2 < rightStart)
          return this.balanced(this.left.replace(from, to2, nodes), this.right);
        if (from > this.left.length)
          return this.balanced(this.left, this.right.replace(from - rightStart, to2 - rightStart, nodes));
        let result2 = [];
        if (from > 0)
          this.decomposeLeft(from, result2);
        let left2 = result2.length;
        for (let node2 of nodes)
          result2.push(node2);
        if (from > 0)
          mergeGaps(result2, left2 - 1);
        if (to2 < this.length) {
          let right2 = result2.length;
          this.decomposeRight(to2, result2);
          mergeGaps(result2, right2);
        }
        return HeightMap.of(result2);
      }
      decomposeLeft(to2, result2) {
        let left2 = this.left.length;
        if (to2 <= left2)
          return this.left.decomposeLeft(to2, result2);
        result2.push(this.left);
        if (this.break) {
          left2++;
          if (to2 >= left2)
            result2.push(null);
        }
        if (to2 > left2)
          this.right.decomposeLeft(to2 - left2, result2);
      }
      decomposeRight(from, result2) {
        let left2 = this.left.length, right2 = left2 + this.break;
        if (from >= right2)
          return this.right.decomposeRight(from - right2, result2);
        if (from < left2)
          this.left.decomposeRight(from, result2);
        if (this.break && from < right2)
          result2.push(null);
        result2.push(this.right);
      }
      balanced(left2, right2) {
        if (left2.size > 2 * right2.size || right2.size > 2 * left2.size)
          return HeightMap.of(this.break ? [left2, null, right2] : [left2, right2]);
        this.left = replace(this.left, left2);
        this.right = replace(this.right, right2);
        this.setHeight(left2.height + right2.height);
        this.outdated = left2.outdated || right2.outdated;
        this.size = left2.size + right2.size;
        this.length = left2.length + this.break + right2.length;
        return this;
      }
      updateHeight(oracle, offset2 = 0, force = false, measured) {
        let { left: left2, right: right2 } = this, rightStart = offset2 + left2.length + this.break, rebalance = null;
        if (measured && measured.from <= offset2 + left2.length && measured.more)
          rebalance = left2 = left2.updateHeight(oracle, offset2, force, measured);
        else
          left2.updateHeight(oracle, offset2, force);
        if (measured && measured.from <= rightStart + right2.length && measured.more)
          rebalance = right2 = right2.updateHeight(oracle, rightStart, force, measured);
        else
          right2.updateHeight(oracle, rightStart, force);
        if (rebalance)
          return this.balanced(left2, right2);
        this.height = this.left.height + this.right.height;
        this.outdated = false;
        return this;
      }
      toString() {
        return this.left + (this.break ? " " : "-") + this.right;
      }
    }
    function mergeGaps(nodes, around) {
      let before, after;
      if (nodes[around] == null && (before = nodes[around - 1]) instanceof HeightMapGap && (after = nodes[around + 1]) instanceof HeightMapGap)
        nodes.splice(around - 1, 3, new HeightMapGap(before.length + 1 + after.length));
    }
    const relevantWidgetHeight = 5;
    class NodeBuilder {
      constructor(pos2, oracle) {
        this.pos = pos2;
        this.oracle = oracle;
        this.nodes = [];
        this.lineStart = -1;
        this.lineEnd = -1;
        this.covering = null;
        this.writtenTo = pos2;
      }
      get isCovered() {
        return this.covering && this.nodes[this.nodes.length - 1] == this.covering;
      }
      span(_from, to2) {
        if (this.lineStart > -1) {
          let end2 = Math.min(to2, this.lineEnd), last = this.nodes[this.nodes.length - 1];
          if (last instanceof HeightMapText)
            last.length += end2 - this.pos;
          else if (end2 > this.pos || !this.isCovered)
            this.nodes.push(new HeightMapText(end2 - this.pos, -1));
          this.writtenTo = end2;
          if (to2 > end2) {
            this.nodes.push(null);
            this.writtenTo++;
            this.lineStart = -1;
          }
        }
        this.pos = to2;
      }
      point(from, to2, deco) {
        if (from < to2 || deco.heightRelevant) {
          let height = deco.widget ? deco.widget.estimatedHeight : 0;
          let breaks = deco.widget ? deco.widget.lineBreaks : 0;
          if (height < 0)
            height = this.oracle.lineHeight;
          let len = to2 - from;
          if (deco.block) {
            this.addBlock(new HeightMapBlock(len, height, deco));
          } else if (len || breaks || height >= relevantWidgetHeight) {
            this.addLineDeco(height, breaks, len);
          }
        } else if (to2 > from) {
          this.span(from, to2);
        }
        if (this.lineEnd > -1 && this.lineEnd < this.pos)
          this.lineEnd = this.oracle.doc.lineAt(this.pos).to;
      }
      enterLine() {
        if (this.lineStart > -1)
          return;
        let { from, to: to2 } = this.oracle.doc.lineAt(this.pos);
        this.lineStart = from;
        this.lineEnd = to2;
        if (this.writtenTo < from) {
          if (this.writtenTo < from - 1 || this.nodes[this.nodes.length - 1] == null)
            this.nodes.push(this.blankContent(this.writtenTo, from - 1));
          this.nodes.push(null);
        }
        if (this.pos > from)
          this.nodes.push(new HeightMapText(this.pos - from, -1));
        this.writtenTo = this.pos;
      }
      blankContent(from, to2) {
        let gap2 = new HeightMapGap(to2 - from);
        if (this.oracle.doc.lineAt(from).to == to2)
          gap2.flags |= 4;
        return gap2;
      }
      ensureLine() {
        this.enterLine();
        let last = this.nodes.length ? this.nodes[this.nodes.length - 1] : null;
        if (last instanceof HeightMapText)
          return last;
        let line2 = new HeightMapText(0, -1);
        this.nodes.push(line2);
        return line2;
      }
      addBlock(block2) {
        this.enterLine();
        let deco = block2.deco;
        if (deco && deco.startSide > 0 && !this.isCovered)
          this.ensureLine();
        this.nodes.push(block2);
        this.writtenTo = this.pos = this.pos + block2.length;
        if (deco && deco.endSide > 0)
          this.covering = block2;
      }
      addLineDeco(height, breaks, length) {
        let line2 = this.ensureLine();
        line2.length += length;
        line2.collapsed += length;
        line2.widgetHeight = Math.max(line2.widgetHeight, height);
        line2.breaks += breaks;
        this.writtenTo = this.pos = this.pos + length;
      }
      finish(from) {
        let last = this.nodes.length == 0 ? null : this.nodes[this.nodes.length - 1];
        if (this.lineStart > -1 && !(last instanceof HeightMapText) && !this.isCovered)
          this.nodes.push(new HeightMapText(0, -1));
        else if (this.writtenTo < this.pos || last == null)
          this.nodes.push(this.blankContent(this.writtenTo, this.pos));
        let pos2 = from;
        for (let node2 of this.nodes) {
          if (node2 instanceof HeightMapText)
            node2.updateHeight(this.oracle, pos2);
          pos2 += node2 ? node2.length : 1;
        }
        return this.nodes;
      }
      // Always called with a region that on both sides either stretches
      // to a line break or the end of the document.
      // The returned array uses null to indicate line breaks, but never
      // starts or ends in a line break, or has multiple line breaks next
      // to each other.
      static build(oracle, decorations2, from, to2) {
        let builder = new NodeBuilder(from, oracle);
        RangeSet.spans(decorations2, from, to2, builder, 0);
        return builder.finish(from);
      }
    }
    function heightRelevantDecoChanges(a, b, diff2) {
      let comp2 = new DecorationComparator();
      RangeSet.compare(a, b, diff2, comp2, 0);
      return comp2.changes;
    }
    class DecorationComparator {
      constructor() {
        this.changes = [];
      }
      compareRange() {
      }
      comparePoint(from, to2, a, b) {
        if (from < to2 || a && a.heightRelevant || b && b.heightRelevant)
          addRange(from, to2, this.changes, 5);
      }
    }
    function visiblePixelRange(dom, paddingTop) {
      let rect2 = dom.getBoundingClientRect();
      let doc2 = dom.ownerDocument, win = doc2.defaultView || window;
      let left2 = Math.max(0, rect2.left), right2 = Math.min(win.innerWidth, rect2.right);
      let top2 = Math.max(0, rect2.top), bottom2 = Math.min(win.innerHeight, rect2.bottom);
      for (let parent = dom.parentNode; parent && parent != doc2.body; ) {
        if (parent.nodeType == 1) {
          let elt = parent;
          let style2 = window.getComputedStyle(elt);
          if ((elt.scrollHeight > elt.clientHeight || elt.scrollWidth > elt.clientWidth) && style2.overflow != "visible") {
            let parentRect = elt.getBoundingClientRect();
            left2 = Math.max(left2, parentRect.left);
            right2 = Math.min(right2, parentRect.right);
            top2 = Math.max(top2, parentRect.top);
            bottom2 = Math.min(parent == dom.parentNode ? win.innerHeight : bottom2, parentRect.bottom);
          }
          parent = style2.position == "absolute" || style2.position == "fixed" ? elt.offsetParent : elt.parentNode;
        } else if (parent.nodeType == 11) {
          parent = parent.host;
        } else {
          break;
        }
      }
      return {
        left: left2 - rect2.left,
        right: Math.max(left2, right2) - rect2.left,
        top: top2 - (rect2.top + paddingTop),
        bottom: Math.max(top2, bottom2) - (rect2.top + paddingTop)
      };
    }
    function inWindow(elt) {
      let rect2 = elt.getBoundingClientRect(), win = elt.ownerDocument.defaultView || window;
      return rect2.left < win.innerWidth && rect2.right > 0 && rect2.top < win.innerHeight && rect2.bottom > 0;
    }
    function fullPixelRange(dom, paddingTop) {
      let rect2 = dom.getBoundingClientRect();
      return {
        left: 0,
        right: rect2.right - rect2.left,
        top: paddingTop,
        bottom: rect2.bottom - (rect2.top + paddingTop)
      };
    }
    class LineGap {
      constructor(from, to2, size, displaySize) {
        this.from = from;
        this.to = to2;
        this.size = size;
        this.displaySize = displaySize;
      }
      static same(a, b) {
        if (a.length != b.length)
          return false;
        for (let i2 = 0; i2 < a.length; i2++) {
          let gA = a[i2], gB = b[i2];
          if (gA.from != gB.from || gA.to != gB.to || gA.size != gB.size)
            return false;
        }
        return true;
      }
      draw(viewState, wrapping) {
        return Decoration.replace({
          widget: new LineGapWidget(this.displaySize * (wrapping ? viewState.scaleY : viewState.scaleX), wrapping)
        }).range(this.from, this.to);
      }
    }
    class LineGapWidget extends WidgetType {
      constructor(size, vertical) {
        super();
        this.size = size;
        this.vertical = vertical;
      }
      eq(other) {
        return other.size == this.size && other.vertical == this.vertical;
      }
      toDOM() {
        let elt = document.createElement("div");
        if (this.vertical) {
          elt.style.height = this.size + "px";
        } else {
          elt.style.width = this.size + "px";
          elt.style.height = "2px";
          elt.style.display = "inline-block";
        }
        return elt;
      }
      get estimatedHeight() {
        return this.vertical ? this.size : -1;
      }
    }
    class ViewState {
      constructor(state) {
        this.state = state;
        this.pixelViewport = { left: 0, right: window.innerWidth, top: 0, bottom: 0 };
        this.inView = true;
        this.paddingTop = 0;
        this.paddingBottom = 0;
        this.contentDOMWidth = 0;
        this.contentDOMHeight = 0;
        this.editorHeight = 0;
        this.editorWidth = 0;
        this.scrollTop = 0;
        this.scrolledToBottom = false;
        this.scaleX = 1;
        this.scaleY = 1;
        this.scrollAnchorPos = 0;
        this.scrollAnchorHeight = -1;
        this.scaler = IdScaler;
        this.scrollTarget = null;
        this.printing = false;
        this.mustMeasureContent = true;
        this.defaultTextDirection = Direction.LTR;
        this.visibleRanges = [];
        this.mustEnforceCursorAssoc = false;
        let guessWrapping = state.facet(contentAttributes).some((v) => typeof v != "function" && v.class == "cm-lineWrapping");
        this.heightOracle = new HeightOracle(guessWrapping);
        this.stateDeco = state.facet(decorations).filter((d) => typeof d != "function");
        this.heightMap = HeightMap.empty().applyChanges(this.stateDeco, Text.empty, this.heightOracle.setDoc(state.doc), [new ChangedRange(0, 0, 0, state.doc.length)]);
        for (let i2 = 0; i2 < 2; i2++) {
          this.viewport = this.getViewport(0, null);
          if (!this.updateForViewport())
            break;
        }
        this.updateViewportLines();
        this.lineGaps = this.ensureLineGaps([]);
        this.lineGapDeco = Decoration.set(this.lineGaps.map((gap2) => gap2.draw(this, false)));
        this.computeVisibleRanges();
      }
      updateForViewport() {
        let viewports = [this.viewport], { main: main2 } = this.state.selection;
        for (let i2 = 0; i2 <= 1; i2++) {
          let pos2 = i2 ? main2.head : main2.anchor;
          if (!viewports.some(({ from, to: to2 }) => pos2 >= from && pos2 <= to2)) {
            let { from, to: to2 } = this.lineBlockAt(pos2);
            viewports.push(new Viewport(from, to2));
          }
        }
        this.viewports = viewports.sort((a, b) => a.from - b.from);
        return this.updateScaler();
      }
      updateScaler() {
        let scaler = this.scaler;
        this.scaler = this.heightMap.height <= 7e6 ? IdScaler : new BigScaler(this.heightOracle, this.heightMap, this.viewports);
        return scaler.eq(this.scaler) ? 0 : 2;
      }
      updateViewportLines() {
        this.viewportLines = [];
        this.heightMap.forEachLine(this.viewport.from, this.viewport.to, this.heightOracle.setDoc(this.state.doc), 0, 0, (block2) => {
          this.viewportLines.push(scaleBlock(block2, this.scaler));
        });
      }
      update(update, scrollTarget = null) {
        this.state = update.state;
        let prevDeco = this.stateDeco;
        this.stateDeco = this.state.facet(decorations).filter((d) => typeof d != "function");
        let contentChanges = update.changedRanges;
        let heightChanges = ChangedRange.extendWithRanges(contentChanges, heightRelevantDecoChanges(prevDeco, this.stateDeco, update ? update.changes : ChangeSet.empty(this.state.doc.length)));
        let prevHeight = this.heightMap.height;
        let scrollAnchor = this.scrolledToBottom ? null : this.scrollAnchorAt(this.scrollTop);
        clearHeightChangeFlag();
        this.heightMap = this.heightMap.applyChanges(this.stateDeco, update.startState.doc, this.heightOracle.setDoc(this.state.doc), heightChanges);
        if (this.heightMap.height != prevHeight || heightChangeFlag)
          update.flags |= 2;
        if (scrollAnchor) {
          this.scrollAnchorPos = update.changes.mapPos(scrollAnchor.from, -1);
          this.scrollAnchorHeight = scrollAnchor.top;
        } else {
          this.scrollAnchorPos = -1;
          this.scrollAnchorHeight = this.heightMap.height;
        }
        let viewport2 = heightChanges.length ? this.mapViewport(this.viewport, update.changes) : this.viewport;
        if (scrollTarget && (scrollTarget.range.head < viewport2.from || scrollTarget.range.head > viewport2.to) || !this.viewportIsAppropriate(viewport2))
          viewport2 = this.getViewport(0, scrollTarget);
        let viewportChange = viewport2.from != this.viewport.from || viewport2.to != this.viewport.to;
        this.viewport = viewport2;
        update.flags |= this.updateForViewport();
        if (viewportChange || !update.changes.empty || update.flags & 2)
          this.updateViewportLines();
        if (this.lineGaps.length || this.viewport.to - this.viewport.from > 2e3 << 1)
          this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps, update.changes)));
        update.flags |= this.computeVisibleRanges(update.changes);
        if (scrollTarget)
          this.scrollTarget = scrollTarget;
        if (!this.mustEnforceCursorAssoc && update.selectionSet && update.view.lineWrapping && update.state.selection.main.empty && update.state.selection.main.assoc && !update.state.facet(nativeSelectionHidden))
          this.mustEnforceCursorAssoc = true;
      }
      measure(view) {
        let dom = view.contentDOM, style2 = window.getComputedStyle(dom);
        let oracle = this.heightOracle;
        let whiteSpace = style2.whiteSpace;
        this.defaultTextDirection = style2.direction == "rtl" ? Direction.RTL : Direction.LTR;
        let refresh = this.heightOracle.mustRefreshForWrapping(whiteSpace);
        let domRect = dom.getBoundingClientRect();
        let measureContent = refresh || this.mustMeasureContent || this.contentDOMHeight != domRect.height;
        this.contentDOMHeight = domRect.height;
        this.mustMeasureContent = false;
        let result2 = 0, bias = 0;
        if (domRect.width && domRect.height) {
          let { scaleX, scaleY } = getScale(dom, domRect);
          if (scaleX > 5e-3 && Math.abs(this.scaleX - scaleX) > 5e-3 || scaleY > 5e-3 && Math.abs(this.scaleY - scaleY) > 5e-3) {
            this.scaleX = scaleX;
            this.scaleY = scaleY;
            result2 |= 16;
            refresh = measureContent = true;
          }
        }
        let paddingTop = (parseInt(style2.paddingTop) || 0) * this.scaleY;
        let paddingBottom = (parseInt(style2.paddingBottom) || 0) * this.scaleY;
        if (this.paddingTop != paddingTop || this.paddingBottom != paddingBottom) {
          this.paddingTop = paddingTop;
          this.paddingBottom = paddingBottom;
          result2 |= 16 | 2;
        }
        if (this.editorWidth != view.scrollDOM.clientWidth) {
          if (oracle.lineWrapping)
            measureContent = true;
          this.editorWidth = view.scrollDOM.clientWidth;
          result2 |= 16;
        }
        let scrollTop = view.scrollDOM.scrollTop * this.scaleY;
        if (this.scrollTop != scrollTop) {
          this.scrollAnchorHeight = -1;
          this.scrollTop = scrollTop;
        }
        this.scrolledToBottom = isScrolledToBottom(view.scrollDOM);
        let pixelViewport = (this.printing ? fullPixelRange : visiblePixelRange)(dom, this.paddingTop);
        let dTop = pixelViewport.top - this.pixelViewport.top, dBottom = pixelViewport.bottom - this.pixelViewport.bottom;
        this.pixelViewport = pixelViewport;
        let inView = this.pixelViewport.bottom > this.pixelViewport.top && this.pixelViewport.right > this.pixelViewport.left;
        if (inView != this.inView) {
          this.inView = inView;
          if (inView)
            measureContent = true;
        }
        if (!this.inView && !this.scrollTarget && !inWindow(view.dom))
          return 0;
        let contentWidth = domRect.width;
        if (this.contentDOMWidth != contentWidth || this.editorHeight != view.scrollDOM.clientHeight) {
          this.contentDOMWidth = domRect.width;
          this.editorHeight = view.scrollDOM.clientHeight;
          result2 |= 16;
        }
        if (measureContent) {
          let lineHeights = view.docView.measureVisibleLineHeights(this.viewport);
          if (oracle.mustRefreshForHeights(lineHeights))
            refresh = true;
          if (refresh || oracle.lineWrapping && Math.abs(contentWidth - this.contentDOMWidth) > oracle.charWidth) {
            let { lineHeight, charWidth, textHeight } = view.docView.measureTextSize();
            refresh = lineHeight > 0 && oracle.refresh(whiteSpace, lineHeight, charWidth, textHeight, contentWidth / charWidth, lineHeights);
            if (refresh) {
              view.docView.minWidth = 0;
              result2 |= 16;
            }
          }
          if (dTop > 0 && dBottom > 0)
            bias = Math.max(dTop, dBottom);
          else if (dTop < 0 && dBottom < 0)
            bias = Math.min(dTop, dBottom);
          clearHeightChangeFlag();
          for (let vp of this.viewports) {
            let heights = vp.from == this.viewport.from ? lineHeights : view.docView.measureVisibleLineHeights(vp);
            this.heightMap = (refresh ? HeightMap.empty().applyChanges(this.stateDeco, Text.empty, this.heightOracle, [new ChangedRange(0, 0, 0, view.state.doc.length)]) : this.heightMap).updateHeight(oracle, 0, refresh, new MeasuredHeights(vp.from, heights));
          }
          if (heightChangeFlag)
            result2 |= 2;
        }
        let viewportChange = !this.viewportIsAppropriate(this.viewport, bias) || this.scrollTarget && (this.scrollTarget.range.head < this.viewport.from || this.scrollTarget.range.head > this.viewport.to);
        if (viewportChange) {
          if (result2 & 2)
            result2 |= this.updateScaler();
          this.viewport = this.getViewport(bias, this.scrollTarget);
          result2 |= this.updateForViewport();
        }
        if (result2 & 2 || viewportChange)
          this.updateViewportLines();
        if (this.lineGaps.length || this.viewport.to - this.viewport.from > 2e3 << 1)
          this.updateLineGaps(this.ensureLineGaps(refresh ? [] : this.lineGaps, view));
        result2 |= this.computeVisibleRanges();
        if (this.mustEnforceCursorAssoc) {
          this.mustEnforceCursorAssoc = false;
          view.docView.enforceCursorAssoc();
        }
        return result2;
      }
      get visibleTop() {
        return this.scaler.fromDOM(this.pixelViewport.top);
      }
      get visibleBottom() {
        return this.scaler.fromDOM(this.pixelViewport.bottom);
      }
      getViewport(bias, scrollTarget) {
        let marginTop = 0.5 - Math.max(-0.5, Math.min(0.5, bias / 1e3 / 2));
        let map2 = this.heightMap, oracle = this.heightOracle;
        let { visibleTop, visibleBottom } = this;
        let viewport2 = new Viewport(map2.lineAt(visibleTop - marginTop * 1e3, QueryType.ByHeight, oracle, 0, 0).from, map2.lineAt(visibleBottom + (1 - marginTop) * 1e3, QueryType.ByHeight, oracle, 0, 0).to);
        if (scrollTarget) {
          let { head } = scrollTarget.range;
          if (head < viewport2.from || head > viewport2.to) {
            let viewHeight = Math.min(this.editorHeight, this.pixelViewport.bottom - this.pixelViewport.top);
            let block2 = map2.lineAt(head, QueryType.ByPos, oracle, 0, 0), topPos;
            if (scrollTarget.y == "center")
              topPos = (block2.top + block2.bottom) / 2 - viewHeight / 2;
            else if (scrollTarget.y == "start" || scrollTarget.y == "nearest" && head < viewport2.from)
              topPos = block2.top;
            else
              topPos = block2.bottom - viewHeight;
            viewport2 = new Viewport(map2.lineAt(topPos - 1e3 / 2, QueryType.ByHeight, oracle, 0, 0).from, map2.lineAt(topPos + viewHeight + 1e3 / 2, QueryType.ByHeight, oracle, 0, 0).to);
          }
        }
        return viewport2;
      }
      mapViewport(viewport2, changes) {
        let from = changes.mapPos(viewport2.from, -1), to2 = changes.mapPos(viewport2.to, 1);
        return new Viewport(this.heightMap.lineAt(from, QueryType.ByPos, this.heightOracle, 0, 0).from, this.heightMap.lineAt(to2, QueryType.ByPos, this.heightOracle, 0, 0).to);
      }
      // Checks if a given viewport covers the visible part of the
      // document and not too much beyond that.
      viewportIsAppropriate({ from, to: to2 }, bias = 0) {
        if (!this.inView)
          return true;
        let { top: top2 } = this.heightMap.lineAt(from, QueryType.ByPos, this.heightOracle, 0, 0);
        let { bottom: bottom2 } = this.heightMap.lineAt(to2, QueryType.ByPos, this.heightOracle, 0, 0);
        let { visibleTop, visibleBottom } = this;
        return (from == 0 || top2 <= visibleTop - Math.max(10, Math.min(
          -bias,
          250
          /* VP.MaxCoverMargin */
        ))) && (to2 == this.state.doc.length || bottom2 >= visibleBottom + Math.max(10, Math.min(
          bias,
          250
          /* VP.MaxCoverMargin */
        ))) && (top2 > visibleTop - 2 * 1e3 && bottom2 < visibleBottom + 2 * 1e3);
      }
      mapLineGaps(gaps, changes) {
        if (!gaps.length || changes.empty)
          return gaps;
        let mapped = [];
        for (let gap2 of gaps)
          if (!changes.touchesRange(gap2.from, gap2.to))
            mapped.push(new LineGap(changes.mapPos(gap2.from), changes.mapPos(gap2.to), gap2.size, gap2.displaySize));
        return mapped;
      }
      // Computes positions in the viewport where the start or end of a
      // line should be hidden, trying to reuse existing line gaps when
      // appropriate to avoid unneccesary redraws.
      // Uses crude character-counting for the positioning and sizing,
      // since actual DOM coordinates aren't always available and
      // predictable. Relies on generous margins (see LG.Margin) to hide
      // the artifacts this might produce from the user.
      ensureLineGaps(current2, mayMeasure) {
        let wrapping = this.heightOracle.lineWrapping;
        let margin = wrapping ? 1e4 : 2e3, halfMargin = margin >> 1, doubleMargin = margin << 1;
        if (this.defaultTextDirection != Direction.LTR && !wrapping)
          return [];
        let gaps = [];
        let addGap = (from, to2, line2, structure) => {
          if (to2 - from < halfMargin)
            return;
          let sel = this.state.selection.main, avoid = [sel.from];
          if (!sel.empty)
            avoid.push(sel.to);
          for (let pos2 of avoid) {
            if (pos2 > from && pos2 < to2) {
              addGap(from, pos2 - 10, line2, structure);
              addGap(pos2 + 10, to2, line2, structure);
              return;
            }
          }
          let gap2 = find(current2, (gap3) => gap3.from >= line2.from && gap3.to <= line2.to && Math.abs(gap3.from - from) < halfMargin && Math.abs(gap3.to - to2) < halfMargin && !avoid.some((pos2) => gap3.from < pos2 && gap3.to > pos2));
          if (!gap2) {
            if (to2 < line2.to && mayMeasure && wrapping && mayMeasure.visibleRanges.some((r2) => r2.from <= to2 && r2.to >= to2)) {
              let lineStart = mayMeasure.moveToLineBoundary(EditorSelection.cursor(to2), false, true).head;
              if (lineStart > from)
                to2 = lineStart;
            }
            let size = this.gapSize(line2, from, to2, structure);
            let displaySize = wrapping || size < 2e6 ? size : 2e6;
            gap2 = new LineGap(from, to2, size, displaySize);
          }
          gaps.push(gap2);
        };
        let checkLine = (line2) => {
          if (line2.length < doubleMargin || line2.type != BlockType.Text)
            return;
          let structure = lineStructure(line2.from, line2.to, this.stateDeco);
          if (structure.total < doubleMargin)
            return;
          let target2 = this.scrollTarget ? this.scrollTarget.range.head : null;
          let viewFrom, viewTo;
          if (wrapping) {
            let marginHeight = margin / this.heightOracle.lineLength * this.heightOracle.lineHeight;
            let top2, bot2;
            if (target2 != null) {
              let targetFrac = findFraction(structure, target2);
              let spaceFrac = ((this.visibleBottom - this.visibleTop) / 2 + marginHeight) / line2.height;
              top2 = targetFrac - spaceFrac;
              bot2 = targetFrac + spaceFrac;
            } else {
              top2 = (this.visibleTop - line2.top - marginHeight) / line2.height;
              bot2 = (this.visibleBottom - line2.top + marginHeight) / line2.height;
            }
            viewFrom = findPosition(structure, top2);
            viewTo = findPosition(structure, bot2);
          } else {
            let totalWidth = structure.total * this.heightOracle.charWidth;
            let marginWidth = margin * this.heightOracle.charWidth;
            let horizOffset = 0;
            if (totalWidth > 2e6)
              for (let old of current2) {
                if (old.from >= line2.from && old.from < line2.to && old.size != old.displaySize && old.from * this.heightOracle.charWidth + horizOffset < this.pixelViewport.left)
                  horizOffset = old.size - old.displaySize;
              }
            let pxLeft = this.pixelViewport.left + horizOffset, pxRight = this.pixelViewport.right + horizOffset;
            let left2, right2;
            if (target2 != null) {
              let targetFrac = findFraction(structure, target2);
              let spaceFrac = ((pxRight - pxLeft) / 2 + marginWidth) / totalWidth;
              left2 = targetFrac - spaceFrac;
              right2 = targetFrac + spaceFrac;
            } else {
              left2 = (pxLeft - marginWidth) / totalWidth;
              right2 = (pxRight + marginWidth) / totalWidth;
            }
            viewFrom = findPosition(structure, left2);
            viewTo = findPosition(structure, right2);
          }
          if (viewFrom > line2.from)
            addGap(line2.from, viewFrom, line2, structure);
          if (viewTo < line2.to)
            addGap(viewTo, line2.to, line2, structure);
        };
        for (let line2 of this.viewportLines) {
          if (Array.isArray(line2.type))
            line2.type.forEach(checkLine);
          else
            checkLine(line2);
        }
        return gaps;
      }
      gapSize(line2, from, to2, structure) {
        let fraction = findFraction(structure, to2) - findFraction(structure, from);
        if (this.heightOracle.lineWrapping) {
          return line2.height * fraction;
        } else {
          return structure.total * this.heightOracle.charWidth * fraction;
        }
      }
      updateLineGaps(gaps) {
        if (!LineGap.same(gaps, this.lineGaps)) {
          this.lineGaps = gaps;
          this.lineGapDeco = Decoration.set(gaps.map((gap2) => gap2.draw(this, this.heightOracle.lineWrapping)));
        }
      }
      computeVisibleRanges(changes) {
        let deco = this.stateDeco;
        if (this.lineGaps.length)
          deco = deco.concat(this.lineGapDeco);
        let ranges = [];
        RangeSet.spans(deco, this.viewport.from, this.viewport.to, {
          span(from, to2) {
            ranges.push({ from, to: to2 });
          },
          point() {
          }
        }, 20);
        let changed = 0;
        if (ranges.length != this.visibleRanges.length) {
          changed = 8 | 4;
        } else {
          for (let i2 = 0; i2 < ranges.length && !(changed & 8); i2++) {
            let old = this.visibleRanges[i2], nw = ranges[i2];
            if (old.from != nw.from || old.to != nw.to) {
              changed |= 4;
              if (!(changes && changes.mapPos(old.from, -1) == nw.from && changes.mapPos(old.to, 1) == nw.to))
                changed |= 8;
            }
          }
        }
        this.visibleRanges = ranges;
        return changed;
      }
      lineBlockAt(pos2) {
        return pos2 >= this.viewport.from && pos2 <= this.viewport.to && this.viewportLines.find((b) => b.from <= pos2 && b.to >= pos2) || scaleBlock(this.heightMap.lineAt(pos2, QueryType.ByPos, this.heightOracle, 0, 0), this.scaler);
      }
      lineBlockAtHeight(height) {
        return height >= this.viewportLines[0].top && height <= this.viewportLines[this.viewportLines.length - 1].bottom && this.viewportLines.find((l) => l.top <= height && l.bottom >= height) || scaleBlock(this.heightMap.lineAt(this.scaler.fromDOM(height), QueryType.ByHeight, this.heightOracle, 0, 0), this.scaler);
      }
      scrollAnchorAt(scrollTop) {
        let block2 = this.lineBlockAtHeight(scrollTop + 8);
        return block2.from >= this.viewport.from || this.viewportLines[0].top - scrollTop > 200 ? block2 : this.viewportLines[0];
      }
      elementAtHeight(height) {
        return scaleBlock(this.heightMap.blockAt(this.scaler.fromDOM(height), this.heightOracle, 0, 0), this.scaler);
      }
      get docHeight() {
        return this.scaler.toDOM(this.heightMap.height);
      }
      get contentHeight() {
        return this.docHeight + this.paddingTop + this.paddingBottom;
      }
    }
    class Viewport {
      constructor(from, to2) {
        this.from = from;
        this.to = to2;
      }
    }
    function lineStructure(from, to2, stateDeco) {
      let ranges = [], pos2 = from, total = 0;
      RangeSet.spans(stateDeco, from, to2, {
        span() {
        },
        point(from2, to3) {
          if (from2 > pos2) {
            ranges.push({ from: pos2, to: from2 });
            total += from2 - pos2;
          }
          pos2 = to3;
        }
      }, 20);
      if (pos2 < to2) {
        ranges.push({ from: pos2, to: to2 });
        total += to2 - pos2;
      }
      return { total, ranges };
    }
    function findPosition({ total, ranges }, ratio2) {
      if (ratio2 <= 0)
        return ranges[0].from;
      if (ratio2 >= 1)
        return ranges[ranges.length - 1].to;
      let dist2 = Math.floor(total * ratio2);
      for (let i2 = 0; ; i2++) {
        let { from, to: to2 } = ranges[i2], size = to2 - from;
        if (dist2 <= size)
          return from + dist2;
        dist2 -= size;
      }
    }
    function findFraction(structure, pos2) {
      let counted = 0;
      for (let { from, to: to2 } of structure.ranges) {
        if (pos2 <= to2) {
          counted += pos2 - from;
          break;
        }
        counted += to2 - from;
      }
      return counted / structure.total;
    }
    function find(array, f) {
      for (let val of array)
        if (f(val))
          return val;
      return void 0;
    }
    const IdScaler = {
      toDOM(n) {
        return n;
      },
      fromDOM(n) {
        return n;
      },
      scale: 1,
      eq(other) {
        return other == this;
      }
    };
    class BigScaler {
      constructor(oracle, heightMap, viewports) {
        let vpHeight = 0, base2 = 0, domBase = 0;
        this.viewports = viewports.map(({ from, to: to2 }) => {
          let top2 = heightMap.lineAt(from, QueryType.ByPos, oracle, 0, 0).top;
          let bottom2 = heightMap.lineAt(to2, QueryType.ByPos, oracle, 0, 0).bottom;
          vpHeight += bottom2 - top2;
          return { from, to: to2, top: top2, bottom: bottom2, domTop: 0, domBottom: 0 };
        });
        this.scale = (7e6 - vpHeight) / (heightMap.height - vpHeight);
        for (let obj of this.viewports) {
          obj.domTop = domBase + (obj.top - base2) * this.scale;
          domBase = obj.domBottom = obj.domTop + (obj.bottom - obj.top);
          base2 = obj.bottom;
        }
      }
      toDOM(n) {
        for (let i2 = 0, base2 = 0, domBase = 0; ; i2++) {
          let vp = i2 < this.viewports.length ? this.viewports[i2] : null;
          if (!vp || n < vp.top)
            return domBase + (n - base2) * this.scale;
          if (n <= vp.bottom)
            return vp.domTop + (n - vp.top);
          base2 = vp.bottom;
          domBase = vp.domBottom;
        }
      }
      fromDOM(n) {
        for (let i2 = 0, base2 = 0, domBase = 0; ; i2++) {
          let vp = i2 < this.viewports.length ? this.viewports[i2] : null;
          if (!vp || n < vp.domTop)
            return base2 + (n - domBase) / this.scale;
          if (n <= vp.domBottom)
            return vp.top + (n - vp.domTop);
          base2 = vp.bottom;
          domBase = vp.domBottom;
        }
      }
      eq(other) {
        if (!(other instanceof BigScaler))
          return false;
        return this.scale == other.scale && this.viewports.length == other.viewports.length && this.viewports.every((vp, i2) => vp.from == other.viewports[i2].from && vp.to == other.viewports[i2].to);
      }
    }
    function scaleBlock(block2, scaler) {
      if (scaler.scale == 1)
        return block2;
      let bTop = scaler.toDOM(block2.top), bBottom = scaler.toDOM(block2.bottom);
      return new BlockInfo(block2.from, block2.length, bTop, bBottom - bTop, Array.isArray(block2._content) ? block2._content.map((b) => scaleBlock(b, scaler)) : block2._content);
    }
    const theme = /* @__PURE__ */ Facet.define({ combine: (strs) => strs.join(" ") });
    const darkTheme = /* @__PURE__ */ Facet.define({ combine: (values) => values.indexOf(true) > -1 });
    const baseThemeID = /* @__PURE__ */ StyleModule.newName(), baseLightID = /* @__PURE__ */ StyleModule.newName(), baseDarkID = /* @__PURE__ */ StyleModule.newName();
    const lightDarkIDs = { "&light": "." + baseLightID, "&dark": "." + baseDarkID };
    function buildTheme(main2, spec, scopes) {
      return new StyleModule(spec, {
        finish(sel) {
          return /&/.test(sel) ? sel.replace(/&\w*/, (m) => {
            if (m == "&")
              return main2;
            if (!scopes || !scopes[m])
              throw new RangeError(`Unsupported selector: ${m}`);
            return scopes[m];
          }) : main2 + " " + sel;
        }
      });
    }
    const baseTheme$1$1 = /* @__PURE__ */ buildTheme("." + baseThemeID, {
      "&": {
        position: "relative !important",
        boxSizing: "border-box",
        "&.cm-focused": {
          // Provide a simple default outline to make sure a focused
          // editor is visually distinct. Can't leave the default behavior
          // because that will apply to the content element, which is
          // inside the scrollable container and doesn't include the
          // gutters. We also can't use an 'auto' outline, since those
          // are, for some reason, drawn behind the element content, which
          // will cause things like the active line background to cover
          // the outline (#297).
          outline: "1px dotted #212121"
        },
        display: "flex !important",
        flexDirection: "column"
      },
      ".cm-scroller": {
        display: "flex !important",
        alignItems: "flex-start !important",
        fontFamily: "monospace",
        lineHeight: 1.4,
        height: "100%",
        overflowX: "auto",
        position: "relative",
        zIndex: 0,
        overflowAnchor: "none"
      },
      ".cm-content": {
        margin: 0,
        flexGrow: 2,
        flexShrink: 0,
        display: "block",
        whiteSpace: "pre",
        wordWrap: "normal",
        // https://github.com/codemirror/dev/issues/456
        boxSizing: "border-box",
        minHeight: "100%",
        padding: "4px 0",
        outline: "none",
        "&[contenteditable=true]": {
          WebkitUserModify: "read-write-plaintext-only"
        }
      },
      ".cm-lineWrapping": {
        whiteSpace_fallback: "pre-wrap",
        // For IE
        whiteSpace: "break-spaces",
        wordBreak: "break-word",
        // For Safari, which doesn't support overflow-wrap: anywhere
        overflowWrap: "anywhere",
        flexShrink: 1
      },
      "&light .cm-content": { caretColor: "black" },
      "&dark .cm-content": { caretColor: "white" },
      ".cm-line": {
        display: "block",
        padding: "0 2px 0 6px"
      },
      ".cm-layer": {
        position: "absolute",
        left: 0,
        top: 0,
        contain: "size style",
        "& > *": {
          position: "absolute"
        }
      },
      "&light .cm-selectionBackground": {
        background: "#d9d9d9"
      },
      "&dark .cm-selectionBackground": {
        background: "#222"
      },
      "&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground": {
        background: "#d7d4f0"
      },
      "&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground": {
        background: "#233"
      },
      ".cm-cursorLayer": {
        pointerEvents: "none"
      },
      "&.cm-focused > .cm-scroller > .cm-cursorLayer": {
        animation: "steps(1) cm-blink 1.2s infinite"
      },
      // Two animations defined so that we can switch between them to
      // restart the animation without forcing another style
      // recomputation.
      "@keyframes cm-blink": { "0%": {}, "50%": { opacity: 0 }, "100%": {} },
      "@keyframes cm-blink2": { "0%": {}, "50%": { opacity: 0 }, "100%": {} },
      ".cm-cursor, .cm-dropCursor": {
        borderLeft: "1.2px solid black",
        marginLeft: "-0.6px",
        pointerEvents: "none"
      },
      ".cm-cursor": {
        display: "none"
      },
      "&dark .cm-cursor": {
        borderLeftColor: "#ddd"
      },
      ".cm-dropCursor": {
        position: "absolute"
      },
      "&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor": {
        display: "block"
      },
      ".cm-iso": {
        unicodeBidi: "isolate"
      },
      ".cm-announced": {
        position: "fixed",
        top: "-10000px"
      },
      "@media print": {
        ".cm-announced": { display: "none" }
      },
      "&light .cm-activeLine": { backgroundColor: "#cceeff44" },
      "&dark .cm-activeLine": { backgroundColor: "#99eeff33" },
      "&light .cm-specialChar": { color: "red" },
      "&dark .cm-specialChar": { color: "#f78" },
      ".cm-gutters": {
        flexShrink: 0,
        display: "flex",
        height: "100%",
        boxSizing: "border-box",
        insetInlineStart: 0,
        zIndex: 200
      },
      "&light .cm-gutters": {
        backgroundColor: "#f5f5f5",
        color: "#6c6c6c",
        borderRight: "1px solid #ddd"
      },
      "&dark .cm-gutters": {
        backgroundColor: "#333338",
        color: "#ccc"
      },
      ".cm-gutter": {
        display: "flex !important",
        // Necessary -- prevents margin collapsing
        flexDirection: "column",
        flexShrink: 0,
        boxSizing: "border-box",
        minHeight: "100%",
        overflow: "hidden"
      },
      ".cm-gutterElement": {
        boxSizing: "border-box"
      },
      ".cm-lineNumbers .cm-gutterElement": {
        padding: "0 3px 0 5px",
        minWidth: "20px",
        textAlign: "right",
        whiteSpace: "nowrap"
      },
      "&light .cm-activeLineGutter": {
        backgroundColor: "#e2f2ff"
      },
      "&dark .cm-activeLineGutter": {
        backgroundColor: "#222227"
      },
      ".cm-panels": {
        boxSizing: "border-box",
        position: "sticky",
        left: 0,
        right: 0,
        zIndex: 300
      },
      "&light .cm-panels": {
        backgroundColor: "#f5f5f5",
        color: "black"
      },
      "&light .cm-panels-top": {
        borderBottom: "1px solid #ddd"
      },
      "&light .cm-panels-bottom": {
        borderTop: "1px solid #ddd"
      },
      "&dark .cm-panels": {
        backgroundColor: "#333338",
        color: "white"
      },
      ".cm-tab": {
        display: "inline-block",
        overflow: "hidden",
        verticalAlign: "bottom"
      },
      ".cm-widgetBuffer": {
        verticalAlign: "text-top",
        height: "1em",
        width: 0,
        display: "inline"
      },
      ".cm-placeholder": {
        color: "#888",
        display: "inline-block",
        verticalAlign: "top",
        userSelect: "none"
      },
      ".cm-highlightSpace": {
        backgroundImage: "radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",
        backgroundPosition: "center"
      },
      ".cm-highlightTab": {
        backgroundImage: `url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>')`,
        backgroundSize: "auto 100%",
        backgroundPosition: "right 90%",
        backgroundRepeat: "no-repeat"
      },
      ".cm-trailingSpace": {
        backgroundColor: "#ff332255"
      },
      ".cm-button": {
        verticalAlign: "middle",
        color: "inherit",
        fontSize: "70%",
        padding: ".2em 1em",
        borderRadius: "1px"
      },
      "&light .cm-button": {
        backgroundImage: "linear-gradient(#eff1f5, #d9d9df)",
        border: "1px solid #888",
        "&:active": {
          backgroundImage: "linear-gradient(#b4b4b4, #d0d3d6)"
        }
      },
      "&dark .cm-button": {
        backgroundImage: "linear-gradient(#393939, #111)",
        border: "1px solid #888",
        "&:active": {
          backgroundImage: "linear-gradient(#111, #333)"
        }
      },
      ".cm-textfield": {
        verticalAlign: "middle",
        color: "inherit",
        fontSize: "70%",
        border: "1px solid silver",
        padding: ".2em .5em"
      },
      "&light .cm-textfield": {
        backgroundColor: "white"
      },
      "&dark .cm-textfield": {
        border: "1px solid #555",
        backgroundColor: "inherit"
      }
    }, lightDarkIDs);
    const observeOptions = {
      childList: true,
      characterData: true,
      subtree: true,
      attributes: true,
      characterDataOldValue: true
    };
    const useCharData = browser.ie && browser.ie_version <= 11;
    class DOMObserver {
      constructor(view) {
        this.view = view;
        this.active = false;
        this.editContext = null;
        this.selectionRange = new DOMSelectionState();
        this.selectionChanged = false;
        this.delayedFlush = -1;
        this.resizeTimeout = -1;
        this.queue = [];
        this.delayedAndroidKey = null;
        this.flushingAndroidKey = -1;
        this.lastChange = 0;
        this.scrollTargets = [];
        this.intersection = null;
        this.resizeScroll = null;
        this.intersecting = false;
        this.gapIntersection = null;
        this.gaps = [];
        this.printQuery = null;
        this.parentCheck = -1;
        this.dom = view.contentDOM;
        this.observer = new MutationObserver((mutations) => {
          for (let mut of mutations)
            this.queue.push(mut);
          if ((browser.ie && browser.ie_version <= 11 || browser.ios && view.composing) && mutations.some((m) => m.type == "childList" && m.removedNodes.length || m.type == "characterData" && m.oldValue.length > m.target.nodeValue.length))
            this.flushSoon();
          else
            this.flush();
        });
        if (window.EditContext && view.constructor.EDIT_CONTEXT !== false && // Chrome <126 doesn't support inverted selections in edit context (#1392)
        !(browser.chrome && browser.chrome_version < 126)) {
          this.editContext = new EditContextManager(view);
          if (view.state.facet(editable))
            view.contentDOM.editContext = this.editContext.editContext;
        }
        if (useCharData)
          this.onCharData = (event) => {
            this.queue.push({
              target: event.target,
              type: "characterData",
              oldValue: event.prevValue
            });
            this.flushSoon();
          };
        this.onSelectionChange = this.onSelectionChange.bind(this);
        this.onResize = this.onResize.bind(this);
        this.onPrint = this.onPrint.bind(this);
        this.onScroll = this.onScroll.bind(this);
        if (window.matchMedia)
          this.printQuery = window.matchMedia("print");
        if (typeof ResizeObserver == "function") {
          this.resizeScroll = new ResizeObserver(() => {
            var _a2;
            if (((_a2 = this.view.docView) === null || _a2 === void 0 ? void 0 : _a2.lastUpdate) < Date.now() - 75)
              this.onResize();
          });
          this.resizeScroll.observe(view.scrollDOM);
        }
        this.addWindowListeners(this.win = view.win);
        this.start();
        if (typeof IntersectionObserver == "function") {
          this.intersection = new IntersectionObserver((entries) => {
            if (this.parentCheck < 0)
              this.parentCheck = setTimeout(this.listenForScroll.bind(this), 1e3);
            if (entries.length > 0 && entries[entries.length - 1].intersectionRatio > 0 != this.intersecting) {
              this.intersecting = !this.intersecting;
              if (this.intersecting != this.view.inView)
                this.onScrollChanged(document.createEvent("Event"));
            }
          }, { threshold: [0, 1e-3] });
          this.intersection.observe(this.dom);
          this.gapIntersection = new IntersectionObserver((entries) => {
            if (entries.length > 0 && entries[entries.length - 1].intersectionRatio > 0)
              this.onScrollChanged(document.createEvent("Event"));
          }, {});
        }
        this.listenForScroll();
        this.readSelectionRange();
      }
      onScrollChanged(e) {
        this.view.inputState.runHandlers("scroll", e);
        if (this.intersecting)
          this.view.measure();
      }
      onScroll(e) {
        if (this.intersecting)
          this.flush(false);
        if (this.editContext)
          this.view.requestMeasure(this.editContext.measureReq);
        this.onScrollChanged(e);
      }
      onResize() {
        if (this.resizeTimeout < 0)
          this.resizeTimeout = setTimeout(() => {
            this.resizeTimeout = -1;
            this.view.requestMeasure();
          }, 50);
      }
      onPrint(event) {
        if ((event.type == "change" || !event.type) && !event.matches)
          return;
        this.view.viewState.printing = true;
        this.view.measure();
        setTimeout(() => {
          this.view.viewState.printing = false;
          this.view.requestMeasure();
        }, 500);
      }
      updateGaps(gaps) {
        if (this.gapIntersection && (gaps.length != this.gaps.length || this.gaps.some((g, i2) => g != gaps[i2]))) {
          this.gapIntersection.disconnect();
          for (let gap2 of gaps)
            this.gapIntersection.observe(gap2);
          this.gaps = gaps;
        }
      }
      onSelectionChange(event) {
        let wasChanged = this.selectionChanged;
        if (!this.readSelectionRange() || this.delayedAndroidKey)
          return;
        let { view } = this, sel = this.selectionRange;
        if (view.state.facet(editable) ? view.root.activeElement != this.dom : !hasSelection(this.dom, sel))
          return;
        let context = sel.anchorNode && view.docView.nearest(sel.anchorNode);
        if (context && context.ignoreEvent(event)) {
          if (!wasChanged)
            this.selectionChanged = false;
          return;
        }
        if ((browser.ie && browser.ie_version <= 11 || browser.android && browser.chrome) && !view.state.selection.main.empty && // (Selection.isCollapsed isn't reliable on IE)
        sel.focusNode && isEquivalentPosition(sel.focusNode, sel.focusOffset, sel.anchorNode, sel.anchorOffset))
          this.flushSoon();
        else
          this.flush(false);
      }
      readSelectionRange() {
        let { view } = this;
        let selection = getSelection(view.root);
        if (!selection)
          return false;
        let range2 = browser.safari && view.root.nodeType == 11 && view.root.activeElement == this.dom && safariSelectionRangeHack(this.view, selection) || selection;
        if (!range2 || this.selectionRange.eq(range2))
          return false;
        let local = hasSelection(this.dom, range2);
        if (local && !this.selectionChanged && view.inputState.lastFocusTime > Date.now() - 200 && view.inputState.lastTouchTime < Date.now() - 300 && atElementStart(this.dom, range2)) {
          this.view.inputState.lastFocusTime = 0;
          view.docView.updateSelection();
          return false;
        }
        this.selectionRange.setRange(range2);
        if (local)
          this.selectionChanged = true;
        return true;
      }
      setSelectionRange(anchor, head) {
        this.selectionRange.set(anchor.node, anchor.offset, head.node, head.offset);
        this.selectionChanged = false;
      }
      clearSelectionRange() {
        this.selectionRange.set(null, 0, null, 0);
      }
      listenForScroll() {
        this.parentCheck = -1;
        let i2 = 0, changed = null;
        for (let dom = this.dom; dom; ) {
          if (dom.nodeType == 1) {
            if (!changed && i2 < this.scrollTargets.length && this.scrollTargets[i2] == dom)
              i2++;
            else if (!changed)
              changed = this.scrollTargets.slice(0, i2);
            if (changed)
              changed.push(dom);
            dom = dom.assignedSlot || dom.parentNode;
          } else if (dom.nodeType == 11) {
            dom = dom.host;
          } else {
            break;
          }
        }
        if (i2 < this.scrollTargets.length && !changed)
          changed = this.scrollTargets.slice(0, i2);
        if (changed) {
          for (let dom of this.scrollTargets)
            dom.removeEventListener("scroll", this.onScroll);
          for (let dom of this.scrollTargets = changed)
            dom.addEventListener("scroll", this.onScroll);
        }
      }
      ignore(f) {
        if (!this.active)
          return f();
        try {
          this.stop();
          return f();
        } finally {
          this.start();
          this.clear();
        }
      }
      start() {
        if (this.active)
          return;
        this.observer.observe(this.dom, observeOptions);
        if (useCharData)
          this.dom.addEventListener("DOMCharacterDataModified", this.onCharData);
        this.active = true;
      }
      stop() {
        if (!this.active)
          return;
        this.active = false;
        this.observer.disconnect();
        if (useCharData)
          this.dom.removeEventListener("DOMCharacterDataModified", this.onCharData);
      }
      // Throw away any pending changes
      clear() {
        this.processRecords();
        this.queue.length = 0;
        this.selectionChanged = false;
      }
      // Chrome Android, especially in combination with GBoard, not only
      // doesn't reliably fire regular key events, but also often
      // surrounds the effect of enter or backspace with a bunch of
      // composition events that, when interrupted, cause text duplication
      // or other kinds of corruption. This hack makes the editor back off
      // from handling DOM changes for a moment when such a key is
      // detected (via beforeinput or keydown), and then tries to flush
      // them or, if that has no effect, dispatches the given key.
      delayAndroidKey(key2, keyCode) {
        var _a2;
        if (!this.delayedAndroidKey) {
          let flush = () => {
            let key3 = this.delayedAndroidKey;
            if (key3) {
              this.clearDelayedAndroidKey();
              this.view.inputState.lastKeyCode = key3.keyCode;
              this.view.inputState.lastKeyTime = Date.now();
              let flushed = this.flush();
              if (!flushed && key3.force)
                dispatchKey(this.dom, key3.key, key3.keyCode);
            }
          };
          this.flushingAndroidKey = this.view.win.requestAnimationFrame(flush);
        }
        if (!this.delayedAndroidKey || key2 == "Enter")
          this.delayedAndroidKey = {
            key: key2,
            keyCode,
            // Only run the key handler when no changes are detected if
            // this isn't coming right after another change, in which case
            // it is probably part of a weird chain of updates, and should
            // be ignored if it returns the DOM to its previous state.
            force: this.lastChange < Date.now() - 50 || !!((_a2 = this.delayedAndroidKey) === null || _a2 === void 0 ? void 0 : _a2.force)
          };
      }
      clearDelayedAndroidKey() {
        this.win.cancelAnimationFrame(this.flushingAndroidKey);
        this.delayedAndroidKey = null;
        this.flushingAndroidKey = -1;
      }
      flushSoon() {
        if (this.delayedFlush < 0)
          this.delayedFlush = this.view.win.requestAnimationFrame(() => {
            this.delayedFlush = -1;
            this.flush();
          });
      }
      forceFlush() {
        if (this.delayedFlush >= 0) {
          this.view.win.cancelAnimationFrame(this.delayedFlush);
          this.delayedFlush = -1;
        }
        this.flush();
      }
      pendingRecords() {
        for (let mut of this.observer.takeRecords())
          this.queue.push(mut);
        return this.queue;
      }
      processRecords() {
        let records = this.pendingRecords();
        if (records.length)
          this.queue = [];
        let from = -1, to2 = -1, typeOver = false;
        for (let record of records) {
          let range2 = this.readMutation(record);
          if (!range2)
            continue;
          if (range2.typeOver)
            typeOver = true;
          if (from == -1) {
            ({ from, to: to2 } = range2);
          } else {
            from = Math.min(range2.from, from);
            to2 = Math.max(range2.to, to2);
          }
        }
        return { from, to: to2, typeOver };
      }
      readChange() {
        let { from, to: to2, typeOver } = this.processRecords();
        let newSel = this.selectionChanged && hasSelection(this.dom, this.selectionRange);
        if (from < 0 && !newSel)
          return null;
        if (from > -1)
          this.lastChange = Date.now();
        this.view.inputState.lastFocusTime = 0;
        this.selectionChanged = false;
        let change = new DOMChange(this.view, from, to2, typeOver);
        this.view.docView.domChanged = { newSel: change.newSel ? change.newSel.main : null };
        return change;
      }
      // Apply pending changes, if any
      flush(readSelection = true) {
        if (this.delayedFlush >= 0 || this.delayedAndroidKey)
          return false;
        if (readSelection)
          this.readSelectionRange();
        let domChange = this.readChange();
        if (!domChange) {
          this.view.requestMeasure();
          return false;
        }
        let startState = this.view.state;
        let handled = applyDOMChange(this.view, domChange);
        if (this.view.state == startState && (domChange.domChanged || domChange.newSel && !domChange.newSel.main.eq(this.view.state.selection.main)))
          this.view.update([]);
        return handled;
      }
      readMutation(rec) {
        let cView = this.view.docView.nearest(rec.target);
        if (!cView || cView.ignoreMutation(rec))
          return null;
        cView.markDirty(rec.type == "attributes");
        if (rec.type == "attributes")
          cView.flags |= 4;
        if (rec.type == "childList") {
          let childBefore = findChild(cView, rec.previousSibling || rec.target.previousSibling, -1);
          let childAfter = findChild(cView, rec.nextSibling || rec.target.nextSibling, 1);
          return {
            from: childBefore ? cView.posAfter(childBefore) : cView.posAtStart,
            to: childAfter ? cView.posBefore(childAfter) : cView.posAtEnd,
            typeOver: false
          };
        } else if (rec.type == "characterData") {
          return { from: cView.posAtStart, to: cView.posAtEnd, typeOver: rec.target.nodeValue == rec.oldValue };
        } else {
          return null;
        }
      }
      setWindow(win) {
        if (win != this.win) {
          this.removeWindowListeners(this.win);
          this.win = win;
          this.addWindowListeners(this.win);
        }
      }
      addWindowListeners(win) {
        win.addEventListener("resize", this.onResize);
        if (this.printQuery) {
          if (this.printQuery.addEventListener)
            this.printQuery.addEventListener("change", this.onPrint);
          else
            this.printQuery.addListener(this.onPrint);
        } else
          win.addEventListener("beforeprint", this.onPrint);
        win.addEventListener("scroll", this.onScroll);
        win.document.addEventListener("selectionchange", this.onSelectionChange);
      }
      removeWindowListeners(win) {
        win.removeEventListener("scroll", this.onScroll);
        win.removeEventListener("resize", this.onResize);
        if (this.printQuery) {
          if (this.printQuery.removeEventListener)
            this.printQuery.removeEventListener("change", this.onPrint);
          else
            this.printQuery.removeListener(this.onPrint);
        } else
          win.removeEventListener("beforeprint", this.onPrint);
        win.document.removeEventListener("selectionchange", this.onSelectionChange);
      }
      update(update) {
        if (this.editContext) {
          this.editContext.update(update);
          if (update.startState.facet(editable) != update.state.facet(editable))
            update.view.contentDOM.editContext = update.state.facet(editable) ? this.editContext.editContext : null;
        }
      }
      destroy() {
        var _a2, _b2, _c;
        this.stop();
        (_a2 = this.intersection) === null || _a2 === void 0 ? void 0 : _a2.disconnect();
        (_b2 = this.gapIntersection) === null || _b2 === void 0 ? void 0 : _b2.disconnect();
        (_c = this.resizeScroll) === null || _c === void 0 ? void 0 : _c.disconnect();
        for (let dom of this.scrollTargets)
          dom.removeEventListener("scroll", this.onScroll);
        this.removeWindowListeners(this.win);
        clearTimeout(this.parentCheck);
        clearTimeout(this.resizeTimeout);
        this.win.cancelAnimationFrame(this.delayedFlush);
        this.win.cancelAnimationFrame(this.flushingAndroidKey);
        if (this.editContext) {
          this.view.contentDOM.editContext = null;
          this.editContext.destroy();
        }
      }
    }
    function findChild(cView, dom, dir) {
      while (dom) {
        let curView = ContentView.get(dom);
        if (curView && curView.parent == cView)
          return curView;
        let parent = dom.parentNode;
        dom = parent != cView.dom ? parent : dir > 0 ? dom.nextSibling : dom.previousSibling;
      }
      return null;
    }
    function buildSelectionRangeFromRange(view, range2) {
      let anchorNode = range2.startContainer, anchorOffset = range2.startOffset;
      let focusNode = range2.endContainer, focusOffset = range2.endOffset;
      let curAnchor = view.docView.domAtPos(view.state.selection.main.anchor);
      if (isEquivalentPosition(curAnchor.node, curAnchor.offset, focusNode, focusOffset))
        [anchorNode, anchorOffset, focusNode, focusOffset] = [focusNode, focusOffset, anchorNode, anchorOffset];
      return { anchorNode, anchorOffset, focusNode, focusOffset };
    }
    function safariSelectionRangeHack(view, selection) {
      if (selection.getComposedRanges) {
        let range2 = selection.getComposedRanges(view.root)[0];
        if (range2)
          return buildSelectionRangeFromRange(view, range2);
      }
      let found = null;
      function read2(event) {
        event.preventDefault();
        event.stopImmediatePropagation();
        found = event.getTargetRanges()[0];
      }
      view.contentDOM.addEventListener("beforeinput", read2, true);
      view.dom.ownerDocument.execCommand("indent");
      view.contentDOM.removeEventListener("beforeinput", read2, true);
      return found ? buildSelectionRangeFromRange(view, found) : null;
    }
    class EditContextManager {
      constructor(view) {
        this.from = 0;
        this.to = 0;
        this.pendingContextChange = null;
        this.handlers = /* @__PURE__ */ Object.create(null);
        this.composing = null;
        this.resetRange(view.state);
        let context = this.editContext = new window.EditContext({
          text: view.state.doc.sliceString(this.from, this.to),
          selectionStart: this.toContextPos(Math.max(this.from, Math.min(this.to, view.state.selection.main.anchor))),
          selectionEnd: this.toContextPos(view.state.selection.main.head)
        });
        this.handlers.textupdate = (e) => {
          let main2 = view.state.selection.main, { anchor, head } = main2;
          let from = this.toEditorPos(e.updateRangeStart), to2 = this.toEditorPos(e.updateRangeEnd);
          if (view.inputState.composing >= 0 && !this.composing)
            this.composing = { contextBase: e.updateRangeStart, editorBase: from, drifted: false };
          let change = { from, to: to2, insert: Text.of(e.text.split("\n")) };
          if (change.from == this.from && anchor < this.from)
            change.from = anchor;
          else if (change.to == this.to && anchor > this.to)
            change.to = anchor;
          if (change.from == change.to && !change.insert.length) {
            let newSel = EditorSelection.single(this.toEditorPos(e.selectionStart), this.toEditorPos(e.selectionEnd));
            if (!newSel.main.eq(main2))
              view.dispatch({ selection: newSel, userEvent: "select" });
            return;
          }
          if ((browser.mac || browser.android) && change.from == head - 1 && /^\. ?$/.test(e.text) && view.contentDOM.getAttribute("autocorrect") == "off")
            change = { from, to: to2, insert: Text.of([e.text.replace(".", " ")]) };
          this.pendingContextChange = change;
          if (!view.state.readOnly) {
            let newLen = this.to - this.from + (change.to - change.from + change.insert.length);
            applyDOMChangeInner(view, change, EditorSelection.single(this.toEditorPos(e.selectionStart, newLen), this.toEditorPos(e.selectionEnd, newLen)));
          }
          if (this.pendingContextChange) {
            this.revertPending(view.state);
            this.setSelection(view.state);
          }
        };
        this.handlers.characterboundsupdate = (e) => {
          let rects = [], prev = null;
          for (let i2 = this.toEditorPos(e.rangeStart), end2 = this.toEditorPos(e.rangeEnd); i2 < end2; i2++) {
            let rect2 = view.coordsForChar(i2);
            prev = rect2 && new DOMRect(rect2.left, rect2.top, rect2.right - rect2.left, rect2.bottom - rect2.top) || prev || new DOMRect();
            rects.push(prev);
          }
          context.updateCharacterBounds(e.rangeStart, rects);
        };
        this.handlers.textformatupdate = (e) => {
          let deco = [];
          for (let format2 of e.getTextFormats()) {
            let lineStyle = format2.underlineStyle, thickness = format2.underlineThickness;
            if (lineStyle != "None" && thickness != "None") {
              let from = this.toEditorPos(format2.rangeStart), to2 = this.toEditorPos(format2.rangeEnd);
              if (from < to2) {
                let style2 = `text-decoration: underline ${lineStyle == "Dashed" ? "dashed " : lineStyle == "Squiggle" ? "wavy " : ""}${thickness == "Thin" ? 1 : 2}px`;
                deco.push(Decoration.mark({ attributes: { style: style2 } }).range(from, to2));
              }
            }
          }
          view.dispatch({ effects: setEditContextFormatting.of(Decoration.set(deco)) });
        };
        this.handlers.compositionstart = () => {
          if (view.inputState.composing < 0) {
            view.inputState.composing = 0;
            view.inputState.compositionFirstChange = true;
          }
        };
        this.handlers.compositionend = () => {
          view.inputState.composing = -1;
          view.inputState.compositionFirstChange = null;
          if (this.composing) {
            let { drifted } = this.composing;
            this.composing = null;
            if (drifted)
              this.reset(view.state);
          }
        };
        for (let event in this.handlers)
          context.addEventListener(event, this.handlers[event]);
        this.measureReq = { read: (view2) => {
          this.editContext.updateControlBounds(view2.contentDOM.getBoundingClientRect());
          let sel = getSelection(view2.root);
          if (sel && sel.rangeCount)
            this.editContext.updateSelectionBounds(sel.getRangeAt(0).getBoundingClientRect());
        } };
      }
      applyEdits(update) {
        let off = 0, abort = false, pending = this.pendingContextChange;
        update.changes.iterChanges((fromA, toA, _fromB, _toB, insert2) => {
          if (abort)
            return;
          let dLen = insert2.length - (toA - fromA);
          if (pending && toA >= pending.to) {
            if (pending.from == fromA && pending.to == toA && pending.insert.eq(insert2)) {
              pending = this.pendingContextChange = null;
              off += dLen;
              this.to += dLen;
              return;
            } else {
              pending = null;
              this.revertPending(update.state);
            }
          }
          fromA += off;
          toA += off;
          if (toA <= this.from) {
            this.from += dLen;
            this.to += dLen;
          } else if (fromA < this.to) {
            if (fromA < this.from || toA > this.to || this.to - this.from + insert2.length > 3e4) {
              abort = true;
              return;
            }
            this.editContext.updateText(this.toContextPos(fromA), this.toContextPos(toA), insert2.toString());
            this.to += dLen;
          }
          off += dLen;
        });
        if (pending && !abort)
          this.revertPending(update.state);
        return !abort;
      }
      update(update) {
        let reverted = this.pendingContextChange, startSel = update.startState.selection.main;
        if (this.composing && (this.composing.drifted || !update.changes.touchesRange(startSel.from, startSel.to) && update.transactions.some((tr2) => !tr2.isUserEvent("input.type") && tr2.changes.touchesRange(this.from, this.to)))) {
          this.composing.drifted = true;
          this.composing.editorBase = update.changes.mapPos(this.composing.editorBase);
        } else if (!this.applyEdits(update) || !this.rangeIsValid(update.state)) {
          this.pendingContextChange = null;
          this.reset(update.state);
        } else if (update.docChanged || update.selectionSet || reverted) {
          this.setSelection(update.state);
        }
        if (update.geometryChanged || update.docChanged || update.selectionSet)
          update.view.requestMeasure(this.measureReq);
      }
      resetRange(state) {
        let { head } = state.selection.main;
        this.from = Math.max(
          0,
          head - 1e4
          /* CxVp.Margin */
        );
        this.to = Math.min(
          state.doc.length,
          head + 1e4
          /* CxVp.Margin */
        );
      }
      reset(state) {
        this.resetRange(state);
        this.editContext.updateText(0, this.editContext.text.length, state.doc.sliceString(this.from, this.to));
        this.setSelection(state);
      }
      revertPending(state) {
        let pending = this.pendingContextChange;
        this.pendingContextChange = null;
        this.editContext.updateText(this.toContextPos(pending.from), this.toContextPos(pending.from + pending.insert.length), state.doc.sliceString(pending.from, pending.to));
      }
      setSelection(state) {
        let { main: main2 } = state.selection;
        let start2 = this.toContextPos(Math.max(this.from, Math.min(this.to, main2.anchor)));
        let end2 = this.toContextPos(main2.head);
        if (this.editContext.selectionStart != start2 || this.editContext.selectionEnd != end2)
          this.editContext.updateSelection(start2, end2);
      }
      rangeIsValid(state) {
        let { head } = state.selection.main;
        return !(this.from > 0 && head - this.from < 500 || this.to < state.doc.length && this.to - head < 500 || this.to - this.from > 1e4 * 3);
      }
      toEditorPos(contextPos, clipLen = this.to - this.from) {
        contextPos = Math.min(contextPos, clipLen);
        let c2 = this.composing;
        return c2 && c2.drifted ? c2.editorBase + (contextPos - c2.contextBase) : contextPos + this.from;
      }
      toContextPos(editorPos) {
        let c2 = this.composing;
        return c2 && c2.drifted ? c2.contextBase + (editorPos - c2.editorBase) : editorPos - this.from;
      }
      destroy() {
        for (let event in this.handlers)
          this.editContext.removeEventListener(event, this.handlers[event]);
      }
    }
    class EditorView {
      /**
      The current editor state.
      */
      get state() {
        return this.viewState.state;
      }
      /**
      To be able to display large documents without consuming too much
      memory or overloading the browser, CodeMirror only draws the
      code that is visible (plus a margin around it) to the DOM. This
      property tells you the extent of the current drawn viewport, in
      document positions.
      */
      get viewport() {
        return this.viewState.viewport;
      }
      /**
      When there are, for example, large collapsed ranges in the
      viewport, its size can be a lot bigger than the actual visible
      content. Thus, if you are doing something like styling the
      content in the viewport, it is preferable to only do so for
      these ranges, which are the subset of the viewport that is
      actually drawn.
      */
      get visibleRanges() {
        return this.viewState.visibleRanges;
      }
      /**
      Returns false when the editor is entirely scrolled out of view
      or otherwise hidden.
      */
      get inView() {
        return this.viewState.inView;
      }
      /**
      Indicates whether the user is currently composing text via
      [IME](https://en.wikipedia.org/wiki/Input_method), and at least
      one change has been made in the current composition.
      */
      get composing() {
        return this.inputState.composing > 0;
      }
      /**
      Indicates whether the user is currently in composing state. Note
      that on some platforms, like Android, this will be the case a
      lot, since just putting the cursor on a word starts a
      composition there.
      */
      get compositionStarted() {
        return this.inputState.composing >= 0;
      }
      /**
      The document or shadow root that the view lives in.
      */
      get root() {
        return this._root;
      }
      /**
      @internal
      */
      get win() {
        return this.dom.ownerDocument.defaultView || window;
      }
      /**
      Construct a new view. You'll want to either provide a `parent`
      option, or put `view.dom` into your document after creating a
      view, so that the user can see the editor.
      */
      constructor(config2 = {}) {
        var _a2;
        this.plugins = [];
        this.pluginMap = /* @__PURE__ */ new Map();
        this.editorAttrs = {};
        this.contentAttrs = {};
        this.bidiCache = [];
        this.destroyed = false;
        this.updateState = 2;
        this.measureScheduled = -1;
        this.measureRequests = [];
        this.contentDOM = document.createElement("div");
        this.scrollDOM = document.createElement("div");
        this.scrollDOM.tabIndex = -1;
        this.scrollDOM.className = "cm-scroller";
        this.scrollDOM.appendChild(this.contentDOM);
        this.announceDOM = document.createElement("div");
        this.announceDOM.className = "cm-announced";
        this.announceDOM.setAttribute("aria-live", "polite");
        this.dom = document.createElement("div");
        this.dom.appendChild(this.announceDOM);
        this.dom.appendChild(this.scrollDOM);
        if (config2.parent)
          config2.parent.appendChild(this.dom);
        let { dispatch } = config2;
        this.dispatchTransactions = config2.dispatchTransactions || dispatch && ((trs) => trs.forEach((tr2) => dispatch(tr2, this))) || ((trs) => this.update(trs));
        this.dispatch = this.dispatch.bind(this);
        this._root = config2.root || getRoot(config2.parent) || document;
        this.viewState = new ViewState(config2.state || EditorState.create(config2));
        if (config2.scrollTo && config2.scrollTo.is(scrollIntoView$1))
          this.viewState.scrollTarget = config2.scrollTo.value.clip(this.viewState.state);
        this.plugins = this.state.facet(viewPlugin).map((spec) => new PluginInstance(spec));
        for (let plugin of this.plugins)
          plugin.update(this);
        this.observer = new DOMObserver(this);
        this.inputState = new InputState(this);
        this.inputState.ensureHandlers(this.plugins);
        this.docView = new DocView(this);
        this.mountStyles();
        this.updateAttrs();
        this.updateState = 0;
        this.requestMeasure();
        if ((_a2 = document.fonts) === null || _a2 === void 0 ? void 0 : _a2.ready)
          document.fonts.ready.then(() => this.requestMeasure());
      }
      dispatch(...input2) {
        let trs = input2.length == 1 && input2[0] instanceof Transaction ? input2 : input2.length == 1 && Array.isArray(input2[0]) ? input2[0] : [this.state.update(...input2)];
        this.dispatchTransactions(trs, this);
      }
      /**
      Update the view for the given array of transactions. This will
      update the visible document and selection to match the state
      produced by the transactions, and notify view plugins of the
      change. You should usually call
      [`dispatch`](https://codemirror.net/6/docs/ref/#view.EditorView.dispatch) instead, which uses this
      as a primitive.
      */
      update(transactions) {
        if (this.updateState != 0)
          throw new Error("Calls to EditorView.update are not allowed while an update is in progress");
        let redrawn = false, attrsChanged = false, update;
        let state = this.state;
        for (let tr2 of transactions) {
          if (tr2.startState != state)
            throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");
          state = tr2.state;
        }
        if (this.destroyed) {
          this.viewState.state = state;
          return;
        }
        let focus = this.hasFocus, focusFlag = 0, dispatchFocus = null;
        if (transactions.some((tr2) => tr2.annotation(isFocusChange))) {
          this.inputState.notifiedFocused = focus;
          focusFlag = 1;
        } else if (focus != this.inputState.notifiedFocused) {
          this.inputState.notifiedFocused = focus;
          dispatchFocus = focusChangeTransaction(state, focus);
          if (!dispatchFocus)
            focusFlag = 1;
        }
        let pendingKey = this.observer.delayedAndroidKey, domChange = null;
        if (pendingKey) {
          this.observer.clearDelayedAndroidKey();
          domChange = this.observer.readChange();
          if (domChange && !this.state.doc.eq(state.doc) || !this.state.selection.eq(state.selection))
            domChange = null;
        } else {
          this.observer.clear();
        }
        if (state.facet(EditorState.phrases) != this.state.facet(EditorState.phrases))
          return this.setState(state);
        update = ViewUpdate.create(this, state, transactions);
        update.flags |= focusFlag;
        let scrollTarget = this.viewState.scrollTarget;
        try {
          this.updateState = 2;
          for (let tr2 of transactions) {
            if (scrollTarget)
              scrollTarget = scrollTarget.map(tr2.changes);
            if (tr2.scrollIntoView) {
              let { main: main2 } = tr2.state.selection;
              scrollTarget = new ScrollTarget(main2.empty ? main2 : EditorSelection.cursor(main2.head, main2.head > main2.anchor ? -1 : 1));
            }
            for (let e of tr2.effects)
              if (e.is(scrollIntoView$1))
                scrollTarget = e.value.clip(this.state);
          }
          this.viewState.update(update, scrollTarget);
          this.bidiCache = CachedOrder.update(this.bidiCache, update.changes);
          if (!update.empty) {
            this.updatePlugins(update);
            this.inputState.update(update);
          }
          redrawn = this.docView.update(update);
          if (this.state.facet(styleModule) != this.styleModules)
            this.mountStyles();
          attrsChanged = this.updateAttrs();
          this.showAnnouncements(transactions);
          this.docView.updateSelection(redrawn, transactions.some((tr2) => tr2.isUserEvent("select.pointer")));
        } finally {
          this.updateState = 0;
        }
        if (update.startState.facet(theme) != update.state.facet(theme))
          this.viewState.mustMeasureContent = true;
        if (redrawn || attrsChanged || scrollTarget || this.viewState.mustEnforceCursorAssoc || this.viewState.mustMeasureContent)
          this.requestMeasure();
        if (redrawn)
          this.docViewUpdate();
        if (!update.empty)
          for (let listener of this.state.facet(updateListener)) {
            try {
              listener(update);
            } catch (e) {
              logException(this.state, e, "update listener");
            }
          }
        if (dispatchFocus || domChange)
          Promise.resolve().then(() => {
            if (dispatchFocus && this.state == dispatchFocus.startState)
              this.dispatch(dispatchFocus);
            if (domChange) {
              if (!applyDOMChange(this, domChange) && pendingKey.force)
                dispatchKey(this.contentDOM, pendingKey.key, pendingKey.keyCode);
            }
          });
      }
      /**
      Reset the view to the given state. (This will cause the entire
      document to be redrawn and all view plugins to be reinitialized,
      so you should probably only use it when the new state isn't
      derived from the old state. Otherwise, use
      [`dispatch`](https://codemirror.net/6/docs/ref/#view.EditorView.dispatch) instead.)
      */
      setState(newState) {
        if (this.updateState != 0)
          throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");
        if (this.destroyed) {
          this.viewState.state = newState;
          return;
        }
        this.updateState = 2;
        let hadFocus = this.hasFocus;
        try {
          for (let plugin of this.plugins)
            plugin.destroy(this);
          this.viewState = new ViewState(newState);
          this.plugins = newState.facet(viewPlugin).map((spec) => new PluginInstance(spec));
          this.pluginMap.clear();
          for (let plugin of this.plugins)
            plugin.update(this);
          this.docView.destroy();
          this.docView = new DocView(this);
          this.inputState.ensureHandlers(this.plugins);
          this.mountStyles();
          this.updateAttrs();
          this.bidiCache = [];
        } finally {
          this.updateState = 0;
        }
        if (hadFocus)
          this.focus();
        this.requestMeasure();
      }
      updatePlugins(update) {
        let prevSpecs = update.startState.facet(viewPlugin), specs = update.state.facet(viewPlugin);
        if (prevSpecs != specs) {
          let newPlugins = [];
          for (let spec of specs) {
            let found = prevSpecs.indexOf(spec);
            if (found < 0) {
              newPlugins.push(new PluginInstance(spec));
            } else {
              let plugin = this.plugins[found];
              plugin.mustUpdate = update;
              newPlugins.push(plugin);
            }
          }
          for (let plugin of this.plugins)
            if (plugin.mustUpdate != update)
              plugin.destroy(this);
          this.plugins = newPlugins;
          this.pluginMap.clear();
        } else {
          for (let p of this.plugins)
            p.mustUpdate = update;
        }
        for (let i2 = 0; i2 < this.plugins.length; i2++)
          this.plugins[i2].update(this);
        if (prevSpecs != specs)
          this.inputState.ensureHandlers(this.plugins);
      }
      docViewUpdate() {
        for (let plugin of this.plugins) {
          let val = plugin.value;
          if (val && val.docViewUpdate) {
            try {
              val.docViewUpdate(this);
            } catch (e) {
              logException(this.state, e, "doc view update listener");
            }
          }
        }
      }
      /**
      @internal
      */
      measure(flush = true) {
        if (this.destroyed)
          return;
        if (this.measureScheduled > -1)
          this.win.cancelAnimationFrame(this.measureScheduled);
        if (this.observer.delayedAndroidKey) {
          this.measureScheduled = -1;
          this.requestMeasure();
          return;
        }
        this.measureScheduled = 0;
        if (flush)
          this.observer.forceFlush();
        let updated = null;
        let sDOM = this.scrollDOM, scrollTop = sDOM.scrollTop * this.scaleY;
        let { scrollAnchorPos, scrollAnchorHeight } = this.viewState;
        if (Math.abs(scrollTop - this.viewState.scrollTop) > 1)
          scrollAnchorHeight = -1;
        this.viewState.scrollAnchorHeight = -1;
        try {
          for (let i2 = 0; ; i2++) {
            if (scrollAnchorHeight < 0) {
              if (isScrolledToBottom(sDOM)) {
                scrollAnchorPos = -1;
                scrollAnchorHeight = this.viewState.heightMap.height;
              } else {
                let block2 = this.viewState.scrollAnchorAt(scrollTop);
                scrollAnchorPos = block2.from;
                scrollAnchorHeight = block2.top;
              }
            }
            this.updateState = 1;
            let changed = this.viewState.measure(this);
            if (!changed && !this.measureRequests.length && this.viewState.scrollTarget == null)
              break;
            if (i2 > 5) {
              console.warn(this.measureRequests.length ? "Measure loop restarted more than 5 times" : "Viewport failed to stabilize");
              break;
            }
            let measuring = [];
            if (!(changed & 4))
              [this.measureRequests, measuring] = [measuring, this.measureRequests];
            let measured = measuring.map((m) => {
              try {
                return m.read(this);
              } catch (e) {
                logException(this.state, e);
                return BadMeasure;
              }
            });
            let update = ViewUpdate.create(this, this.state, []), redrawn = false;
            update.flags |= changed;
            if (!updated)
              updated = update;
            else
              updated.flags |= changed;
            this.updateState = 2;
            if (!update.empty) {
              this.updatePlugins(update);
              this.inputState.update(update);
              this.updateAttrs();
              redrawn = this.docView.update(update);
              if (redrawn)
                this.docViewUpdate();
            }
            for (let i3 = 0; i3 < measuring.length; i3++)
              if (measured[i3] != BadMeasure) {
                try {
                  let m = measuring[i3];
                  if (m.write)
                    m.write(measured[i3], this);
                } catch (e) {
                  logException(this.state, e);
                }
              }
            if (redrawn)
              this.docView.updateSelection(true);
            if (!update.viewportChanged && this.measureRequests.length == 0) {
              if (this.viewState.editorHeight) {
                if (this.viewState.scrollTarget) {
                  this.docView.scrollIntoView(this.viewState.scrollTarget);
                  this.viewState.scrollTarget = null;
                  scrollAnchorHeight = -1;
                  continue;
                } else {
                  let newAnchorHeight = scrollAnchorPos < 0 ? this.viewState.heightMap.height : this.viewState.lineBlockAt(scrollAnchorPos).top;
                  let diff2 = newAnchorHeight - scrollAnchorHeight;
                  if (diff2 > 1 || diff2 < -1) {
                    scrollTop = scrollTop + diff2;
                    sDOM.scrollTop = scrollTop / this.scaleY;
                    scrollAnchorHeight = -1;
                    continue;
                  }
                }
              }
              break;
            }
          }
        } finally {
          this.updateState = 0;
          this.measureScheduled = -1;
        }
        if (updated && !updated.empty)
          for (let listener of this.state.facet(updateListener))
            listener(updated);
      }
      /**
      Get the CSS classes for the currently active editor themes.
      */
      get themeClasses() {
        return baseThemeID + " " + (this.state.facet(darkTheme) ? baseDarkID : baseLightID) + " " + this.state.facet(theme);
      }
      updateAttrs() {
        let editorAttrs = attrsFromFacet(this, editorAttributes, {
          class: "cm-editor" + (this.hasFocus ? " cm-focused " : " ") + this.themeClasses
        });
        let contentAttrs = {
          spellcheck: "false",
          autocorrect: "off",
          autocapitalize: "off",
          writingsuggestions: "false",
          translate: "no",
          contenteditable: !this.state.facet(editable) ? "false" : "true",
          class: "cm-content",
          style: `${browser.tabSize}: ${this.state.tabSize}`,
          role: "textbox",
          "aria-multiline": "true"
        };
        if (this.state.readOnly)
          contentAttrs["aria-readonly"] = "true";
        attrsFromFacet(this, contentAttributes, contentAttrs);
        let changed = this.observer.ignore(() => {
          let changedContent = updateAttrs(this.contentDOM, this.contentAttrs, contentAttrs);
          let changedEditor = updateAttrs(this.dom, this.editorAttrs, editorAttrs);
          return changedContent || changedEditor;
        });
        this.editorAttrs = editorAttrs;
        this.contentAttrs = contentAttrs;
        return changed;
      }
      showAnnouncements(trs) {
        let first = true;
        for (let tr2 of trs)
          for (let effect2 of tr2.effects)
            if (effect2.is(EditorView.announce)) {
              if (first)
                this.announceDOM.textContent = "";
              first = false;
              let div2 = this.announceDOM.appendChild(document.createElement("div"));
              div2.textContent = effect2.value;
            }
      }
      mountStyles() {
        this.styleModules = this.state.facet(styleModule);
        let nonce = this.state.facet(EditorView.cspNonce);
        StyleModule.mount(this.root, this.styleModules.concat(baseTheme$1$1).reverse(), nonce ? { nonce } : void 0);
      }
      readMeasured() {
        if (this.updateState == 2)
          throw new Error("Reading the editor layout isn't allowed during an update");
        if (this.updateState == 0 && this.measureScheduled > -1)
          this.measure(false);
      }
      /**
      Schedule a layout measurement, optionally providing callbacks to
      do custom DOM measuring followed by a DOM write phase. Using
      this is preferable reading DOM layout directly from, for
      example, an event handler, because it'll make sure measuring and
      drawing done by other components is synchronized, avoiding
      unnecessary DOM layout computations.
      */
      requestMeasure(request) {
        if (this.measureScheduled < 0)
          this.measureScheduled = this.win.requestAnimationFrame(() => this.measure());
        if (request) {
          if (this.measureRequests.indexOf(request) > -1)
            return;
          if (request.key != null)
            for (let i2 = 0; i2 < this.measureRequests.length; i2++) {
              if (this.measureRequests[i2].key === request.key) {
                this.measureRequests[i2] = request;
                return;
              }
            }
          this.measureRequests.push(request);
        }
      }
      /**
      Get the value of a specific plugin, if present. Note that
      plugins that crash can be dropped from a view, so even when you
      know you registered a given plugin, it is recommended to check
      the return value of this method.
      */
      plugin(plugin) {
        let known = this.pluginMap.get(plugin);
        if (known === void 0 || known && known.spec != plugin)
          this.pluginMap.set(plugin, known = this.plugins.find((p) => p.spec == plugin) || null);
        return known && known.update(this).value;
      }
      /**
      The top position of the document, in screen coordinates. This
      may be negative when the editor is scrolled down. Points
      directly to the top of the first line, not above the padding.
      */
      get documentTop() {
        return this.contentDOM.getBoundingClientRect().top + this.viewState.paddingTop;
      }
      /**
      Reports the padding above and below the document.
      */
      get documentPadding() {
        return { top: this.viewState.paddingTop, bottom: this.viewState.paddingBottom };
      }
      /**
      If the editor is transformed with CSS, this provides the scale
      along the X axis. Otherwise, it will just be 1. Note that
      transforms other than translation and scaling are not supported.
      */
      get scaleX() {
        return this.viewState.scaleX;
      }
      /**
      Provide the CSS transformed scale along the Y axis.
      */
      get scaleY() {
        return this.viewState.scaleY;
      }
      /**
      Find the text line or block widget at the given vertical
      position (which is interpreted as relative to the [top of the
      document](https://codemirror.net/6/docs/ref/#view.EditorView.documentTop)).
      */
      elementAtHeight(height) {
        this.readMeasured();
        return this.viewState.elementAtHeight(height);
      }
      /**
      Find the line block (see
      [`lineBlockAt`](https://codemirror.net/6/docs/ref/#view.EditorView.lineBlockAt) at the given
      height, again interpreted relative to the [top of the
      document](https://codemirror.net/6/docs/ref/#view.EditorView.documentTop).
      */
      lineBlockAtHeight(height) {
        this.readMeasured();
        return this.viewState.lineBlockAtHeight(height);
      }
      /**
      Get the extent and vertical position of all [line
      blocks](https://codemirror.net/6/docs/ref/#view.EditorView.lineBlockAt) in the viewport. Positions
      are relative to the [top of the
      document](https://codemirror.net/6/docs/ref/#view.EditorView.documentTop);
      */
      get viewportLineBlocks() {
        return this.viewState.viewportLines;
      }
      /**
      Find the line block around the given document position. A line
      block is a range delimited on both sides by either a
      non-[hidden](https://codemirror.net/6/docs/ref/#view.Decoration^replace) line break, or the
      start/end of the document. It will usually just hold a line of
      text, but may be broken into multiple textblocks by block
      widgets.
      */
      lineBlockAt(pos2) {
        return this.viewState.lineBlockAt(pos2);
      }
      /**
      The editor's total content height.
      */
      get contentHeight() {
        return this.viewState.contentHeight;
      }
      /**
      Move a cursor position by [grapheme
      cluster](https://codemirror.net/6/docs/ref/#state.findClusterBreak). `forward` determines whether
      the motion is away from the line start, or towards it. In
      bidirectional text, the line is traversed in visual order, using
      the editor's [text direction](https://codemirror.net/6/docs/ref/#view.EditorView.textDirection).
      When the start position was the last one on the line, the
      returned position will be across the line break. If there is no
      further line, the original position is returned.
      
      By default, this method moves over a single cluster. The
      optional `by` argument can be used to move across more. It will
      be called with the first cluster as argument, and should return
      a predicate that determines, for each subsequent cluster,
      whether it should also be moved over.
      */
      moveByChar(start2, forward, by) {
        return skipAtoms(this, start2, moveByChar(this, start2, forward, by));
      }
      /**
      Move a cursor position across the next group of either
      [letters](https://codemirror.net/6/docs/ref/#state.EditorState.charCategorizer) or non-letter
      non-whitespace characters.
      */
      moveByGroup(start2, forward) {
        return skipAtoms(this, start2, moveByChar(this, start2, forward, (initial) => byGroup(this, start2.head, initial)));
      }
      /**
      Get the cursor position visually at the start or end of a line.
      Note that this may differ from the _logical_ position at its
      start or end (which is simply at `line.from`/`line.to`) if text
      at the start or end goes against the line's base text direction.
      */
      visualLineSide(line2, end2) {
        let order2 = this.bidiSpans(line2), dir = this.textDirectionAt(line2.from);
        let span = order2[end2 ? order2.length - 1 : 0];
        return EditorSelection.cursor(span.side(end2, dir) + line2.from, span.forward(!end2, dir) ? 1 : -1);
      }
      /**
      Move to the next line boundary in the given direction. If
      `includeWrap` is true, line wrapping is on, and there is a
      further wrap point on the current line, the wrap point will be
      returned. Otherwise this function will return the start or end
      of the line.
      */
      moveToLineBoundary(start2, forward, includeWrap = true) {
        return moveToLineBoundary(this, start2, forward, includeWrap);
      }
      /**
      Move a cursor position vertically. When `distance` isn't given,
      it defaults to moving to the next line (including wrapped
      lines). Otherwise, `distance` should provide a positive distance
      in pixels.
      
      When `start` has a
      [`goalColumn`](https://codemirror.net/6/docs/ref/#state.SelectionRange.goalColumn), the vertical
      motion will use that as a target horizontal position. Otherwise,
      the cursor's own horizontal position is used. The returned
      cursor will have its goal column set to whichever column was
      used.
      */
      moveVertically(start2, forward, distance) {
        return skipAtoms(this, start2, moveVertically(this, start2, forward, distance));
      }
      /**
      Find the DOM parent node and offset (child offset if `node` is
      an element, character offset when it is a text node) at the
      given document position.
      
      Note that for positions that aren't currently in
      `visibleRanges`, the resulting DOM position isn't necessarily
      meaningful (it may just point before or after a placeholder
      element).
      */
      domAtPos(pos2) {
        return this.docView.domAtPos(pos2);
      }
      /**
      Find the document position at the given DOM node. Can be useful
      for associating positions with DOM events. Will raise an error
      when `node` isn't part of the editor content.
      */
      posAtDOM(node2, offset2 = 0) {
        return this.docView.posFromDOM(node2, offset2);
      }
      posAtCoords(coords, precise = true) {
        this.readMeasured();
        return posAtCoords(this, coords, precise);
      }
      /**
      Get the screen coordinates at the given document position.
      `side` determines whether the coordinates are based on the
      element before (-1) or after (1) the position (if no element is
      available on the given side, the method will transparently use
      another strategy to get reasonable coordinates).
      */
      coordsAtPos(pos2, side = 1) {
        this.readMeasured();
        let rect2 = this.docView.coordsAt(pos2, side);
        if (!rect2 || rect2.left == rect2.right)
          return rect2;
        let line2 = this.state.doc.lineAt(pos2), order2 = this.bidiSpans(line2);
        let span = order2[BidiSpan.find(order2, pos2 - line2.from, -1, side)];
        return flattenRect(rect2, span.dir == Direction.LTR == side > 0);
      }
      /**
      Return the rectangle around a given character. If `pos` does not
      point in front of a character that is in the viewport and
      rendered (i.e. not replaced, not a line break), this will return
      null. For space characters that are a line wrap point, this will
      return the position before the line break.
      */
      coordsForChar(pos2) {
        this.readMeasured();
        return this.docView.coordsForChar(pos2);
      }
      /**
      The default width of a character in the editor. May not
      accurately reflect the width of all characters (given variable
      width fonts or styling of invididual ranges).
      */
      get defaultCharacterWidth() {
        return this.viewState.heightOracle.charWidth;
      }
      /**
      The default height of a line in the editor. May not be accurate
      for all lines.
      */
      get defaultLineHeight() {
        return this.viewState.heightOracle.lineHeight;
      }
      /**
      The text direction
      ([`direction`](https://developer.mozilla.org/en-US/docs/Web/CSS/direction)
      CSS property) of the editor's content element.
      */
      get textDirection() {
        return this.viewState.defaultTextDirection;
      }
      /**
      Find the text direction of the block at the given position, as
      assigned by CSS. If
      [`perLineTextDirection`](https://codemirror.net/6/docs/ref/#view.EditorView^perLineTextDirection)
      isn't enabled, or the given position is outside of the viewport,
      this will always return the same as
      [`textDirection`](https://codemirror.net/6/docs/ref/#view.EditorView.textDirection). Note that
      this may trigger a DOM layout.
      */
      textDirectionAt(pos2) {
        let perLine = this.state.facet(perLineTextDirection);
        if (!perLine || pos2 < this.viewport.from || pos2 > this.viewport.to)
          return this.textDirection;
        this.readMeasured();
        return this.docView.textDirectionAt(pos2);
      }
      /**
      Whether this editor [wraps lines](https://codemirror.net/6/docs/ref/#view.EditorView.lineWrapping)
      (as determined by the
      [`white-space`](https://developer.mozilla.org/en-US/docs/Web/CSS/white-space)
      CSS property of its content element).
      */
      get lineWrapping() {
        return this.viewState.heightOracle.lineWrapping;
      }
      /**
      Returns the bidirectional text structure of the given line
      (which should be in the current document) as an array of span
      objects. The order of these spans matches the [text
      direction](https://codemirror.net/6/docs/ref/#view.EditorView.textDirection)—if that is
      left-to-right, the leftmost spans come first, otherwise the
      rightmost spans come first.
      */
      bidiSpans(line2) {
        if (line2.length > MaxBidiLine)
          return trivialOrder(line2.length);
        let dir = this.textDirectionAt(line2.from), isolates;
        for (let entry of this.bidiCache) {
          if (entry.from == line2.from && entry.dir == dir && (entry.fresh || isolatesEq(entry.isolates, isolates = getIsolatedRanges(this, line2))))
            return entry.order;
        }
        if (!isolates)
          isolates = getIsolatedRanges(this, line2);
        let order2 = computeOrder(line2.text, dir, isolates);
        this.bidiCache.push(new CachedOrder(line2.from, line2.to, dir, isolates, true, order2));
        return order2;
      }
      /**
      Check whether the editor has focus.
      */
      get hasFocus() {
        var _a2;
        return (this.dom.ownerDocument.hasFocus() || browser.safari && ((_a2 = this.inputState) === null || _a2 === void 0 ? void 0 : _a2.lastContextMenu) > Date.now() - 3e4) && this.root.activeElement == this.contentDOM;
      }
      /**
      Put focus on the editor.
      */
      focus() {
        this.observer.ignore(() => {
          focusPreventScroll(this.contentDOM);
          this.docView.updateSelection();
        });
      }
      /**
      Update the [root](https://codemirror.net/6/docs/ref/##view.EditorViewConfig.root) in which the editor lives. This is only
      necessary when moving the editor's existing DOM to a new window or shadow root.
      */
      setRoot(root2) {
        if (this._root != root2) {
          this._root = root2;
          this.observer.setWindow((root2.nodeType == 9 ? root2 : root2.ownerDocument).defaultView || window);
          this.mountStyles();
        }
      }
      /**
      Clean up this editor view, removing its element from the
      document, unregistering event handlers, and notifying
      plugins. The view instance can no longer be used after
      calling this.
      */
      destroy() {
        if (this.root.activeElement == this.contentDOM)
          this.contentDOM.blur();
        for (let plugin of this.plugins)
          plugin.destroy(this);
        this.plugins = [];
        this.inputState.destroy();
        this.docView.destroy();
        this.dom.remove();
        this.observer.destroy();
        if (this.measureScheduled > -1)
          this.win.cancelAnimationFrame(this.measureScheduled);
        this.destroyed = true;
      }
      /**
      Returns an effect that can be
      [added](https://codemirror.net/6/docs/ref/#state.TransactionSpec.effects) to a transaction to
      cause it to scroll the given position or range into view.
      */
      static scrollIntoView(pos2, options2 = {}) {
        return scrollIntoView$1.of(new ScrollTarget(typeof pos2 == "number" ? EditorSelection.cursor(pos2) : pos2, options2.y, options2.x, options2.yMargin, options2.xMargin));
      }
      /**
      Return an effect that resets the editor to its current (at the
      time this method was called) scroll position. Note that this
      only affects the editor's own scrollable element, not parents.
      See also
      [`EditorViewConfig.scrollTo`](https://codemirror.net/6/docs/ref/#view.EditorViewConfig.scrollTo).
      
      The effect should be used with a document identical to the one
      it was created for. Failing to do so is not an error, but may
      not scroll to the expected position. You can
      [map](https://codemirror.net/6/docs/ref/#state.StateEffect.map) the effect to account for changes.
      */
      scrollSnapshot() {
        let { scrollTop, scrollLeft } = this.scrollDOM;
        let ref = this.viewState.scrollAnchorAt(scrollTop);
        return scrollIntoView$1.of(new ScrollTarget(EditorSelection.cursor(ref.from), "start", "start", ref.top - scrollTop, scrollLeft, true));
      }
      /**
      Enable or disable tab-focus mode, which disables key bindings
      for Tab and Shift-Tab, letting the browser's default
      focus-changing behavior go through instead. This is useful to
      prevent trapping keyboard users in your editor.
      
      Without argument, this toggles the mode. With a boolean, it
      enables (true) or disables it (false). Given a number, it
      temporarily enables the mode until that number of milliseconds
      have passed or another non-Tab key is pressed.
      */
      setTabFocusMode(to2) {
        if (to2 == null)
          this.inputState.tabFocusMode = this.inputState.tabFocusMode < 0 ? 0 : -1;
        else if (typeof to2 == "boolean")
          this.inputState.tabFocusMode = to2 ? 0 : -1;
        else if (this.inputState.tabFocusMode != 0)
          this.inputState.tabFocusMode = Date.now() + to2;
      }
      /**
      Returns an extension that can be used to add DOM event handlers.
      The value should be an object mapping event names to handler
      functions. For any given event, such functions are ordered by
      extension precedence, and the first handler to return true will
      be assumed to have handled that event, and no other handlers or
      built-in behavior will be activated for it. These are registered
      on the [content element](https://codemirror.net/6/docs/ref/#view.EditorView.contentDOM), except
      for `scroll` handlers, which will be called any time the
      editor's [scroll element](https://codemirror.net/6/docs/ref/#view.EditorView.scrollDOM) or one of
      its parent nodes is scrolled.
      */
      static domEventHandlers(handlers2) {
        return ViewPlugin.define(() => ({}), { eventHandlers: handlers2 });
      }
      /**
      Create an extension that registers DOM event observers. Contrary
      to event [handlers](https://codemirror.net/6/docs/ref/#view.EditorView^domEventHandlers),
      observers can't be prevented from running by a higher-precedence
      handler returning true. They also don't prevent other handlers
      and observers from running when they return true, and should not
      call `preventDefault`.
      */
      static domEventObservers(observers2) {
        return ViewPlugin.define(() => ({}), { eventObservers: observers2 });
      }
      /**
      Create a theme extension. The first argument can be a
      [`style-mod`](https://github.com/marijnh/style-mod#documentation)
      style spec providing the styles for the theme. These will be
      prefixed with a generated class for the style.
      
      Because the selectors will be prefixed with a scope class, rule
      that directly match the editor's [wrapper
      element](https://codemirror.net/6/docs/ref/#view.EditorView.dom)—to which the scope class will be
      added—need to be explicitly differentiated by adding an `&` to
      the selector for that element—for example
      `&.cm-focused`.
      
      When `dark` is set to true, the theme will be marked as dark,
      which will cause the `&dark` rules from [base
      themes](https://codemirror.net/6/docs/ref/#view.EditorView^baseTheme) to be used (as opposed to
      `&light` when a light theme is active).
      */
      static theme(spec, options2) {
        let prefix = StyleModule.newName();
        let result2 = [theme.of(prefix), styleModule.of(buildTheme(`.${prefix}`, spec))];
        if (options2 && options2.dark)
          result2.push(darkTheme.of(true));
        return result2;
      }
      /**
      Create an extension that adds styles to the base theme. Like
      with [`theme`](https://codemirror.net/6/docs/ref/#view.EditorView^theme), use `&` to indicate the
      place of the editor wrapper element when directly targeting
      that. You can also use `&dark` or `&light` instead to only
      target editors with a dark or light theme.
      */
      static baseTheme(spec) {
        return Prec.lowest(styleModule.of(buildTheme("." + baseThemeID, spec, lightDarkIDs)));
      }
      /**
      Retrieve an editor view instance from the view's DOM
      representation.
      */
      static findFromDOM(dom) {
        var _a2;
        let content2 = dom.querySelector(".cm-content");
        let cView = content2 && ContentView.get(content2) || ContentView.get(dom);
        return ((_a2 = cView === null || cView === void 0 ? void 0 : cView.rootView) === null || _a2 === void 0 ? void 0 : _a2.view) || null;
      }
    }
    EditorView.styleModule = styleModule;
    EditorView.inputHandler = inputHandler;
    EditorView.clipboardInputFilter = clipboardInputFilter;
    EditorView.clipboardOutputFilter = clipboardOutputFilter;
    EditorView.scrollHandler = scrollHandler;
    EditorView.focusChangeEffect = focusChangeEffect;
    EditorView.perLineTextDirection = perLineTextDirection;
    EditorView.exceptionSink = exceptionSink;
    EditorView.updateListener = updateListener;
    EditorView.editable = editable;
    EditorView.mouseSelectionStyle = mouseSelectionStyle;
    EditorView.dragMovesSelection = dragMovesSelection$1;
    EditorView.clickAddsSelectionRange = clickAddsSelectionRange;
    EditorView.decorations = decorations;
    EditorView.outerDecorations = outerDecorations;
    EditorView.atomicRanges = atomicRanges;
    EditorView.bidiIsolatedRanges = bidiIsolatedRanges;
    EditorView.scrollMargins = scrollMargins;
    EditorView.darkTheme = darkTheme;
    EditorView.cspNonce = /* @__PURE__ */ Facet.define({ combine: (values) => values.length ? values[0] : "" });
    EditorView.contentAttributes = contentAttributes;
    EditorView.editorAttributes = editorAttributes;
    EditorView.lineWrapping = /* @__PURE__ */ EditorView.contentAttributes.of({ "class": "cm-lineWrapping" });
    EditorView.announce = /* @__PURE__ */ StateEffect.define();
    const MaxBidiLine = 4096;
    const BadMeasure = {};
    class CachedOrder {
      constructor(from, to2, dir, isolates, fresh, order2) {
        this.from = from;
        this.to = to2;
        this.dir = dir;
        this.isolates = isolates;
        this.fresh = fresh;
        this.order = order2;
      }
      static update(cache, changes) {
        if (changes.empty && !cache.some((c2) => c2.fresh))
          return cache;
        let result2 = [], lastDir = cache.length ? cache[cache.length - 1].dir : Direction.LTR;
        for (let i2 = Math.max(0, cache.length - 10); i2 < cache.length; i2++) {
          let entry = cache[i2];
          if (entry.dir == lastDir && !changes.touchesRange(entry.from, entry.to))
            result2.push(new CachedOrder(changes.mapPos(entry.from, 1), changes.mapPos(entry.to, -1), entry.dir, entry.isolates, false, entry.order));
        }
        return result2;
      }
    }
    function attrsFromFacet(view, facet, base2) {
      for (let sources = view.state.facet(facet), i2 = sources.length - 1; i2 >= 0; i2--) {
        let source2 = sources[i2], value2 = typeof source2 == "function" ? source2(view) : source2;
        if (value2)
          combineAttrs(value2, base2);
      }
      return base2;
    }
    const currentPlatform = browser.mac ? "mac" : browser.windows ? "win" : browser.linux ? "linux" : "key";
    function normalizeKeyName(name2, platform) {
      const parts = name2.split(/-(?!$)/);
      let result2 = parts[parts.length - 1];
      if (result2 == "Space")
        result2 = " ";
      let alt, ctrl, shift2, meta2;
      for (let i2 = 0; i2 < parts.length - 1; ++i2) {
        const mod2 = parts[i2];
        if (/^(cmd|meta|m)$/i.test(mod2))
          meta2 = true;
        else if (/^a(lt)?$/i.test(mod2))
          alt = true;
        else if (/^(c|ctrl|control)$/i.test(mod2))
          ctrl = true;
        else if (/^s(hift)?$/i.test(mod2))
          shift2 = true;
        else if (/^mod$/i.test(mod2)) {
          if (platform == "mac")
            meta2 = true;
          else
            ctrl = true;
        } else
          throw new Error("Unrecognized modifier name: " + mod2);
      }
      if (alt)
        result2 = "Alt-" + result2;
      if (ctrl)
        result2 = "Ctrl-" + result2;
      if (meta2)
        result2 = "Meta-" + result2;
      if (shift2)
        result2 = "Shift-" + result2;
      return result2;
    }
    function modifiers(name2, event, shift2) {
      if (event.altKey)
        name2 = "Alt-" + name2;
      if (event.ctrlKey)
        name2 = "Ctrl-" + name2;
      if (event.metaKey)
        name2 = "Meta-" + name2;
      if (shift2 !== false && event.shiftKey)
        name2 = "Shift-" + name2;
      return name2;
    }
    const handleKeyEvents = /* @__PURE__ */ Prec.default(/* @__PURE__ */ EditorView.domEventHandlers({
      keydown(event, view) {
        return runHandlers(getKeymap(view.state), event, view, "editor");
      }
    }));
    const keymap = /* @__PURE__ */ Facet.define({ enables: handleKeyEvents });
    const Keymaps = /* @__PURE__ */ new WeakMap();
    function getKeymap(state) {
      let bindings = state.facet(keymap);
      let map2 = Keymaps.get(bindings);
      if (!map2)
        Keymaps.set(bindings, map2 = buildKeymap(bindings.reduce((a, b) => a.concat(b), [])));
      return map2;
    }
    let storedPrefix = null;
    const PrefixTimeout = 4e3;
    function buildKeymap(bindings, platform = currentPlatform) {
      let bound = /* @__PURE__ */ Object.create(null);
      let isPrefix = /* @__PURE__ */ Object.create(null);
      let checkPrefix = (name2, is2) => {
        let current2 = isPrefix[name2];
        if (current2 == null)
          isPrefix[name2] = is2;
        else if (current2 != is2)
          throw new Error("Key binding " + name2 + " is used both as a regular binding and as a multi-stroke prefix");
      };
      let add2 = (scope, key2, command2, preventDefault, stopPropagation) => {
        var _a2, _b2;
        let scopeObj = bound[scope] || (bound[scope] = /* @__PURE__ */ Object.create(null));
        let parts = key2.split(/ (?!$)/).map((k2) => normalizeKeyName(k2, platform));
        for (let i2 = 1; i2 < parts.length; i2++) {
          let prefix = parts.slice(0, i2).join(" ");
          checkPrefix(prefix, true);
          if (!scopeObj[prefix])
            scopeObj[prefix] = {
              preventDefault: true,
              stopPropagation: false,
              run: [(view) => {
                let ourObj = storedPrefix = { view, prefix, scope };
                setTimeout(() => {
                  if (storedPrefix == ourObj)
                    storedPrefix = null;
                }, PrefixTimeout);
                return true;
              }]
            };
        }
        let full = parts.join(" ");
        checkPrefix(full, false);
        let binding = scopeObj[full] || (scopeObj[full] = {
          preventDefault: false,
          stopPropagation: false,
          run: ((_b2 = (_a2 = scopeObj._any) === null || _a2 === void 0 ? void 0 : _a2.run) === null || _b2 === void 0 ? void 0 : _b2.slice()) || []
        });
        if (command2)
          binding.run.push(command2);
        if (preventDefault)
          binding.preventDefault = true;
        if (stopPropagation)
          binding.stopPropagation = true;
      };
      for (let b of bindings) {
        let scopes = b.scope ? b.scope.split(" ") : ["editor"];
        if (b.any)
          for (let scope of scopes) {
            let scopeObj = bound[scope] || (bound[scope] = /* @__PURE__ */ Object.create(null));
            if (!scopeObj._any)
              scopeObj._any = { preventDefault: false, stopPropagation: false, run: [] };
            let { any } = b;
            for (let key2 in scopeObj)
              scopeObj[key2].run.push((view) => any(view, currentKeyEvent));
          }
        let name2 = b[platform] || b.key;
        if (!name2)
          continue;
        for (let scope of scopes) {
          add2(scope, name2, b.run, b.preventDefault, b.stopPropagation);
          if (b.shift)
            add2(scope, "Shift-" + name2, b.shift, b.preventDefault, b.stopPropagation);
        }
      }
      return bound;
    }
    let currentKeyEvent = null;
    function runHandlers(map2, event, view, scope) {
      currentKeyEvent = event;
      let name2 = keyName(event);
      let charCode = codePointAt(name2, 0), isChar = codePointSize(charCode) == name2.length && name2 != " ";
      let prefix = "", handled = false, prevented = false, stopPropagation = false;
      if (storedPrefix && storedPrefix.view == view && storedPrefix.scope == scope) {
        prefix = storedPrefix.prefix + " ";
        if (modifierCodes.indexOf(event.keyCode) < 0) {
          prevented = true;
          storedPrefix = null;
        }
      }
      let ran = /* @__PURE__ */ new Set();
      let runFor = (binding) => {
        if (binding) {
          for (let cmd2 of binding.run)
            if (!ran.has(cmd2)) {
              ran.add(cmd2);
              if (cmd2(view)) {
                if (binding.stopPropagation)
                  stopPropagation = true;
                return true;
              }
            }
          if (binding.preventDefault) {
            if (binding.stopPropagation)
              stopPropagation = true;
            prevented = true;
          }
        }
        return false;
      };
      let scopeObj = map2[scope], baseName, shiftName;
      if (scopeObj) {
        if (runFor(scopeObj[prefix + modifiers(name2, event, !isChar)])) {
          handled = true;
        } else if (isChar && (event.altKey || event.metaKey || event.ctrlKey) && // Ctrl-Alt may be used for AltGr on Windows
        !(browser.windows && event.ctrlKey && event.altKey) && (baseName = base[event.keyCode]) && baseName != name2) {
          if (runFor(scopeObj[prefix + modifiers(baseName, event, true)])) {
            handled = true;
          } else if (event.shiftKey && (shiftName = shift[event.keyCode]) != name2 && shiftName != baseName && runFor(scopeObj[prefix + modifiers(shiftName, event, false)])) {
            handled = true;
          }
        } else if (isChar && event.shiftKey && runFor(scopeObj[prefix + modifiers(name2, event, true)])) {
          handled = true;
        }
        if (!handled && runFor(scopeObj._any))
          handled = true;
      }
      if (prevented)
        handled = true;
      if (handled && stopPropagation)
        event.stopPropagation();
      currentKeyEvent = null;
      return handled;
    }
    class RectangleMarker {
      /**
      Create a marker with the given class and dimensions. If `width`
      is null, the DOM element will get no width style.
      */
      constructor(className2, left2, top2, width, height) {
        this.className = className2;
        this.left = left2;
        this.top = top2;
        this.width = width;
        this.height = height;
      }
      draw() {
        let elt = document.createElement("div");
        elt.className = this.className;
        this.adjust(elt);
        return elt;
      }
      update(elt, prev) {
        if (prev.className != this.className)
          return false;
        this.adjust(elt);
        return true;
      }
      adjust(elt) {
        elt.style.left = this.left + "px";
        elt.style.top = this.top + "px";
        if (this.width != null)
          elt.style.width = this.width + "px";
        elt.style.height = this.height + "px";
      }
      eq(p) {
        return this.left == p.left && this.top == p.top && this.width == p.width && this.height == p.height && this.className == p.className;
      }
      /**
      Create a set of rectangles for the given selection range,
      assigning them theclass`className`. Will create a single
      rectangle for empty ranges, and a set of selection-style
      rectangles covering the range's content (in a bidi-aware
      way) for non-empty ones.
      */
      static forRange(view, className2, range2) {
        if (range2.empty) {
          let pos2 = view.coordsAtPos(range2.head, range2.assoc || 1);
          if (!pos2)
            return [];
          let base2 = getBase(view);
          return [new RectangleMarker(className2, pos2.left - base2.left, pos2.top - base2.top, null, pos2.bottom - pos2.top)];
        } else {
          return rectanglesForRange(view, className2, range2);
        }
      }
    }
    function getBase(view) {
      let rect2 = view.scrollDOM.getBoundingClientRect();
      let left2 = view.textDirection == Direction.LTR ? rect2.left : rect2.right - view.scrollDOM.clientWidth * view.scaleX;
      return { left: left2 - view.scrollDOM.scrollLeft * view.scaleX, top: rect2.top - view.scrollDOM.scrollTop * view.scaleY };
    }
    function wrappedLine(view, pos2, side, inside2) {
      let coords = view.coordsAtPos(pos2, side * 2);
      if (!coords)
        return inside2;
      let editorRect = view.dom.getBoundingClientRect();
      let y = (coords.top + coords.bottom) / 2;
      let left2 = view.posAtCoords({ x: editorRect.left + 1, y });
      let right2 = view.posAtCoords({ x: editorRect.right - 1, y });
      if (left2 == null || right2 == null)
        return inside2;
      return { from: Math.max(inside2.from, Math.min(left2, right2)), to: Math.min(inside2.to, Math.max(left2, right2)) };
    }
    function rectanglesForRange(view, className2, range2) {
      if (range2.to <= view.viewport.from || range2.from >= view.viewport.to)
        return [];
      let from = Math.max(range2.from, view.viewport.from), to2 = Math.min(range2.to, view.viewport.to);
      let ltr = view.textDirection == Direction.LTR;
      let content2 = view.contentDOM, contentRect = content2.getBoundingClientRect(), base2 = getBase(view);
      let lineElt = content2.querySelector(".cm-line"), lineStyle = lineElt && window.getComputedStyle(lineElt);
      let leftSide = contentRect.left + (lineStyle ? parseInt(lineStyle.paddingLeft) + Math.min(0, parseInt(lineStyle.textIndent)) : 0);
      let rightSide = contentRect.right - (lineStyle ? parseInt(lineStyle.paddingRight) : 0);
      let startBlock = blockAt(view, from), endBlock = blockAt(view, to2);
      let visualStart = startBlock.type == BlockType.Text ? startBlock : null;
      let visualEnd = endBlock.type == BlockType.Text ? endBlock : null;
      if (visualStart && (view.lineWrapping || startBlock.widgetLineBreaks))
        visualStart = wrappedLine(view, from, 1, visualStart);
      if (visualEnd && (view.lineWrapping || endBlock.widgetLineBreaks))
        visualEnd = wrappedLine(view, to2, -1, visualEnd);
      if (visualStart && visualEnd && visualStart.from == visualEnd.from && visualStart.to == visualEnd.to) {
        return pieces(drawForLine(range2.from, range2.to, visualStart));
      } else {
        let top2 = visualStart ? drawForLine(range2.from, null, visualStart) : drawForWidget(startBlock, false);
        let bottom2 = visualEnd ? drawForLine(null, range2.to, visualEnd) : drawForWidget(endBlock, true);
        let between2 = [];
        if ((visualStart || startBlock).to < (visualEnd || endBlock).from - (visualStart && visualEnd ? 1 : 0) || startBlock.widgetLineBreaks > 1 && top2.bottom + view.defaultLineHeight / 2 < bottom2.top)
          between2.push(piece(leftSide, top2.bottom, rightSide, bottom2.top));
        else if (top2.bottom < bottom2.top && view.elementAtHeight((top2.bottom + bottom2.top) / 2).type == BlockType.Text)
          top2.bottom = bottom2.top = (top2.bottom + bottom2.top) / 2;
        return pieces(top2).concat(between2).concat(pieces(bottom2));
      }
      function piece(left2, top2, right2, bottom2) {
        return new RectangleMarker(className2, left2 - base2.left, top2 - base2.top, right2 - left2, bottom2 - top2);
      }
      function pieces({ top: top2, bottom: bottom2, horizontal }) {
        let pieces2 = [];
        for (let i2 = 0; i2 < horizontal.length; i2 += 2)
          pieces2.push(piece(horizontal[i2], top2, horizontal[i2 + 1], bottom2));
        return pieces2;
      }
      function drawForLine(from2, to3, line2) {
        let top2 = 1e9, bottom2 = -1e9, horizontal = [];
        function addSpan(from3, fromOpen, to4, toOpen, dir) {
          let fromCoords = view.coordsAtPos(from3, from3 == line2.to ? -2 : 2);
          let toCoords = view.coordsAtPos(to4, to4 == line2.from ? 2 : -2);
          if (!fromCoords || !toCoords)
            return;
          top2 = Math.min(fromCoords.top, toCoords.top, top2);
          bottom2 = Math.max(fromCoords.bottom, toCoords.bottom, bottom2);
          if (dir == Direction.LTR)
            horizontal.push(ltr && fromOpen ? leftSide : fromCoords.left, ltr && toOpen ? rightSide : toCoords.right);
          else
            horizontal.push(!ltr && toOpen ? leftSide : toCoords.left, !ltr && fromOpen ? rightSide : fromCoords.right);
        }
        let start2 = from2 !== null && from2 !== void 0 ? from2 : line2.from, end2 = to3 !== null && to3 !== void 0 ? to3 : line2.to;
        for (let r2 of view.visibleRanges)
          if (r2.to > start2 && r2.from < end2) {
            for (let pos2 = Math.max(r2.from, start2), endPos = Math.min(r2.to, end2); ; ) {
              let docLine = view.state.doc.lineAt(pos2);
              for (let span of view.bidiSpans(docLine)) {
                let spanFrom = span.from + docLine.from, spanTo = span.to + docLine.from;
                if (spanFrom >= endPos)
                  break;
                if (spanTo > pos2)
                  addSpan(Math.max(spanFrom, pos2), from2 == null && spanFrom <= start2, Math.min(spanTo, endPos), to3 == null && spanTo >= end2, span.dir);
              }
              pos2 = docLine.to + 1;
              if (pos2 >= endPos)
                break;
            }
          }
        if (horizontal.length == 0)
          addSpan(start2, from2 == null, end2, to3 == null, view.textDirection);
        return { top: top2, bottom: bottom2, horizontal };
      }
      function drawForWidget(block2, top2) {
        let y = contentRect.top + (top2 ? block2.top : block2.bottom);
        return { top: y, bottom: y, horizontal: [] };
      }
    }
    function sameMarker(a, b) {
      return a.constructor == b.constructor && a.eq(b);
    }
    class LayerView {
      constructor(view, layer2) {
        this.view = view;
        this.layer = layer2;
        this.drawn = [];
        this.scaleX = 1;
        this.scaleY = 1;
        this.measureReq = { read: this.measure.bind(this), write: this.draw.bind(this) };
        this.dom = view.scrollDOM.appendChild(document.createElement("div"));
        this.dom.classList.add("cm-layer");
        if (layer2.above)
          this.dom.classList.add("cm-layer-above");
        if (layer2.class)
          this.dom.classList.add(layer2.class);
        this.scale();
        this.dom.setAttribute("aria-hidden", "true");
        this.setOrder(view.state);
        view.requestMeasure(this.measureReq);
        if (layer2.mount)
          layer2.mount(this.dom, view);
      }
      update(update) {
        if (update.startState.facet(layerOrder) != update.state.facet(layerOrder))
          this.setOrder(update.state);
        if (this.layer.update(update, this.dom) || update.geometryChanged) {
          this.scale();
          update.view.requestMeasure(this.measureReq);
        }
      }
      docViewUpdate(view) {
        if (this.layer.updateOnDocViewUpdate !== false)
          view.requestMeasure(this.measureReq);
      }
      setOrder(state) {
        let pos2 = 0, order2 = state.facet(layerOrder);
        while (pos2 < order2.length && order2[pos2] != this.layer)
          pos2++;
        this.dom.style.zIndex = String((this.layer.above ? 150 : -1) - pos2);
      }
      measure() {
        return this.layer.markers(this.view);
      }
      scale() {
        let { scaleX, scaleY } = this.view;
        if (scaleX != this.scaleX || scaleY != this.scaleY) {
          this.scaleX = scaleX;
          this.scaleY = scaleY;
          this.dom.style.transform = `scale(${1 / scaleX}, ${1 / scaleY})`;
        }
      }
      draw(markers) {
        if (markers.length != this.drawn.length || markers.some((p, i2) => !sameMarker(p, this.drawn[i2]))) {
          let old = this.dom.firstChild, oldI = 0;
          for (let marker2 of markers) {
            if (marker2.update && old && marker2.constructor && this.drawn[oldI].constructor && marker2.update(old, this.drawn[oldI])) {
              old = old.nextSibling;
              oldI++;
            } else {
              this.dom.insertBefore(marker2.draw(), old);
            }
          }
          while (old) {
            let next = old.nextSibling;
            old.remove();
            old = next;
          }
          this.drawn = markers;
        }
      }
      destroy() {
        if (this.layer.destroy)
          this.layer.destroy(this.dom, this.view);
        this.dom.remove();
      }
    }
    const layerOrder = /* @__PURE__ */ Facet.define();
    function layer(config2) {
      return [
        ViewPlugin.define((v) => new LayerView(v, config2)),
        layerOrder.of(config2)
      ];
    }
    const selectionConfig = /* @__PURE__ */ Facet.define({
      combine(configs) {
        return combineConfig(configs, {
          cursorBlinkRate: 1200,
          drawRangeCursor: true
        }, {
          cursorBlinkRate: (a, b) => Math.min(a, b),
          drawRangeCursor: (a, b) => a || b
        });
      }
    });
    function drawSelection(config2 = {}) {
      return [
        selectionConfig.of(config2),
        cursorLayer,
        selectionLayer,
        hideNativeSelection,
        nativeSelectionHidden.of(true)
      ];
    }
    function configChanged(update) {
      return update.startState.facet(selectionConfig) != update.state.facet(selectionConfig);
    }
    const cursorLayer = /* @__PURE__ */ layer({
      above: true,
      markers(view) {
        let { state } = view, conf = state.facet(selectionConfig);
        let cursors = [];
        for (let r2 of state.selection.ranges) {
          let prim = r2 == state.selection.main;
          if (r2.empty || conf.drawRangeCursor) {
            let className2 = prim ? "cm-cursor cm-cursor-primary" : "cm-cursor cm-cursor-secondary";
            let cursor = r2.empty ? r2 : EditorSelection.cursor(r2.head, r2.head > r2.anchor ? -1 : 1);
            for (let piece of RectangleMarker.forRange(view, className2, cursor))
              cursors.push(piece);
          }
        }
        return cursors;
      },
      update(update, dom) {
        if (update.transactions.some((tr2) => tr2.selection))
          dom.style.animationName = dom.style.animationName == "cm-blink" ? "cm-blink2" : "cm-blink";
        let confChange = configChanged(update);
        if (confChange)
          setBlinkRate(update.state, dom);
        return update.docChanged || update.selectionSet || confChange;
      },
      mount(dom, view) {
        setBlinkRate(view.state, dom);
      },
      class: "cm-cursorLayer"
    });
    function setBlinkRate(state, dom) {
      dom.style.animationDuration = state.facet(selectionConfig).cursorBlinkRate + "ms";
    }
    const selectionLayer = /* @__PURE__ */ layer({
      above: false,
      markers(view) {
        return view.state.selection.ranges.map((r2) => r2.empty ? [] : RectangleMarker.forRange(view, "cm-selectionBackground", r2)).reduce((a, b) => a.concat(b));
      },
      update(update, dom) {
        return update.docChanged || update.selectionSet || update.viewportChanged || configChanged(update);
      },
      class: "cm-selectionLayer"
    });
    const hideNativeSelection = /* @__PURE__ */ Prec.highest(/* @__PURE__ */ EditorView.theme({
      ".cm-line": {
        "& ::selection, &::selection": { backgroundColor: "transparent !important" },
        caretColor: "transparent !important"
      },
      ".cm-content": {
        caretColor: "transparent !important",
        "& :focus": {
          caretColor: "initial !important",
          "&::selection, & ::selection": {
            backgroundColor: "Highlight !important"
          }
        }
      }
    }));
    function iterMatches(doc2, re2, from, to2, f) {
      re2.lastIndex = 0;
      for (let cursor = doc2.iterRange(from, to2), pos2 = from, m; !cursor.next().done; pos2 += cursor.value.length) {
        if (!cursor.lineBreak)
          while (m = re2.exec(cursor.value))
            f(pos2 + m.index, m);
      }
    }
    function matchRanges(view, maxLength) {
      let visible2 = view.visibleRanges;
      if (visible2.length == 1 && visible2[0].from == view.viewport.from && visible2[0].to == view.viewport.to)
        return visible2;
      let result2 = [];
      for (let { from, to: to2 } of visible2) {
        from = Math.max(view.state.doc.lineAt(from).from, from - maxLength);
        to2 = Math.min(view.state.doc.lineAt(to2).to, to2 + maxLength);
        if (result2.length && result2[result2.length - 1].to >= from)
          result2[result2.length - 1].to = to2;
        else
          result2.push({ from, to: to2 });
      }
      return result2;
    }
    class MatchDecorator {
      /**
      Create a decorator.
      */
      constructor(config2) {
        const { regexp, decoration, decorate, boundary, maxLength = 1e3 } = config2;
        if (!regexp.global)
          throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");
        this.regexp = regexp;
        if (decorate) {
          this.addMatch = (match, view, from, add2) => decorate(add2, from, from + match[0].length, match, view);
        } else if (typeof decoration == "function") {
          this.addMatch = (match, view, from, add2) => {
            let deco = decoration(match, view, from);
            if (deco)
              add2(from, from + match[0].length, deco);
          };
        } else if (decoration) {
          this.addMatch = (match, _view, from, add2) => add2(from, from + match[0].length, decoration);
        } else {
          throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");
        }
        this.boundary = boundary;
        this.maxLength = maxLength;
      }
      /**
      Compute the full set of decorations for matches in the given
      view's viewport. You'll want to call this when initializing your
      plugin.
      */
      createDeco(view) {
        let build = new RangeSetBuilder(), add2 = build.add.bind(build);
        for (let { from, to: to2 } of matchRanges(view, this.maxLength))
          iterMatches(view.state.doc, this.regexp, from, to2, (from2, m) => this.addMatch(m, view, from2, add2));
        return build.finish();
      }
      /**
      Update a set of decorations for a view update. `deco` _must_ be
      the set of decorations produced by _this_ `MatchDecorator` for
      the view state before the update.
      */
      updateDeco(update, deco) {
        let changeFrom = 1e9, changeTo = -1;
        if (update.docChanged)
          update.changes.iterChanges((_f, _t2, from, to2) => {
            if (to2 >= update.view.viewport.from && from <= update.view.viewport.to) {
              changeFrom = Math.min(from, changeFrom);
              changeTo = Math.max(to2, changeTo);
            }
          });
        if (update.viewportMoved || changeTo - changeFrom > 1e3)
          return this.createDeco(update.view);
        if (changeTo > -1)
          return this.updateRange(update.view, deco.map(update.changes), changeFrom, changeTo);
        return deco;
      }
      updateRange(view, deco, updateFrom, updateTo) {
        for (let r2 of view.visibleRanges) {
          let from = Math.max(r2.from, updateFrom), to2 = Math.min(r2.to, updateTo);
          if (to2 > from) {
            let fromLine = view.state.doc.lineAt(from), toLine = fromLine.to < to2 ? view.state.doc.lineAt(to2) : fromLine;
            let start2 = Math.max(r2.from, fromLine.from), end2 = Math.min(r2.to, toLine.to);
            if (this.boundary) {
              for (; from > fromLine.from; from--)
                if (this.boundary.test(fromLine.text[from - 1 - fromLine.from])) {
                  start2 = from;
                  break;
                }
              for (; to2 < toLine.to; to2++)
                if (this.boundary.test(toLine.text[to2 - toLine.from])) {
                  end2 = to2;
                  break;
                }
            }
            let ranges = [], m;
            let add2 = (from2, to3, deco2) => ranges.push(deco2.range(from2, to3));
            if (fromLine == toLine) {
              this.regexp.lastIndex = start2 - fromLine.from;
              while ((m = this.regexp.exec(fromLine.text)) && m.index < end2 - fromLine.from)
                this.addMatch(m, view, m.index + fromLine.from, add2);
            } else {
              iterMatches(view.state.doc, this.regexp, start2, end2, (from2, m2) => this.addMatch(m2, view, from2, add2));
            }
            deco = deco.update({ filterFrom: start2, filterTo: end2, filter: (from2, to3) => from2 < start2 || to3 > end2, add: ranges });
          }
        }
        return deco;
      }
    }
    const UnicodeRegexpSupport = /x/.unicode != null ? "gu" : "g";
    const Specials = /* @__PURE__ */ new RegExp("[\0-\b\n--­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF￹-￼]", UnicodeRegexpSupport);
    const Names = {
      0: "null",
      7: "bell",
      8: "backspace",
      10: "newline",
      11: "vertical tab",
      13: "carriage return",
      27: "escape",
      8203: "zero width space",
      8204: "zero width non-joiner",
      8205: "zero width joiner",
      8206: "left-to-right mark",
      8207: "right-to-left mark",
      8232: "line separator",
      8237: "left-to-right override",
      8238: "right-to-left override",
      8294: "left-to-right isolate",
      8295: "right-to-left isolate",
      8297: "pop directional isolate",
      8233: "paragraph separator",
      65279: "zero width no-break space",
      65532: "object replacement"
    };
    let _supportsTabSize = null;
    function supportsTabSize() {
      var _a2;
      if (_supportsTabSize == null && typeof document != "undefined" && document.body) {
        let styles2 = document.body.style;
        _supportsTabSize = ((_a2 = styles2.tabSize) !== null && _a2 !== void 0 ? _a2 : styles2.MozTabSize) != null;
      }
      return _supportsTabSize || false;
    }
    const specialCharConfig = /* @__PURE__ */ Facet.define({
      combine(configs) {
        let config2 = combineConfig(configs, {
          render: null,
          specialChars: Specials,
          addSpecialChars: null
        });
        if (config2.replaceTabs = !supportsTabSize())
          config2.specialChars = new RegExp("	|" + config2.specialChars.source, UnicodeRegexpSupport);
        if (config2.addSpecialChars)
          config2.specialChars = new RegExp(config2.specialChars.source + "|" + config2.addSpecialChars.source, UnicodeRegexpSupport);
        return config2;
      }
    });
    function highlightSpecialChars(config2 = {}) {
      return [specialCharConfig.of(config2), specialCharPlugin()];
    }
    let _plugin = null;
    function specialCharPlugin() {
      return _plugin || (_plugin = ViewPlugin.fromClass(class {
        constructor(view) {
          this.view = view;
          this.decorations = Decoration.none;
          this.decorationCache = /* @__PURE__ */ Object.create(null);
          this.decorator = this.makeDecorator(view.state.facet(specialCharConfig));
          this.decorations = this.decorator.createDeco(view);
        }
        makeDecorator(conf) {
          return new MatchDecorator({
            regexp: conf.specialChars,
            decoration: (m, view, pos2) => {
              let { doc: doc2 } = view.state;
              let code2 = codePointAt(m[0], 0);
              if (code2 == 9) {
                let line2 = doc2.lineAt(pos2);
                let size = view.state.tabSize, col = countColumn(line2.text, size, pos2 - line2.from);
                return Decoration.replace({
                  widget: new TabWidget((size - col % size) * this.view.defaultCharacterWidth / this.view.scaleX)
                });
              }
              return this.decorationCache[code2] || (this.decorationCache[code2] = Decoration.replace({ widget: new SpecialCharWidget(conf, code2) }));
            },
            boundary: conf.replaceTabs ? void 0 : /[^]/
          });
        }
        update(update) {
          let conf = update.state.facet(specialCharConfig);
          if (update.startState.facet(specialCharConfig) != conf) {
            this.decorator = this.makeDecorator(conf);
            this.decorations = this.decorator.createDeco(update.view);
          } else {
            this.decorations = this.decorator.updateDeco(update, this.decorations);
          }
        }
      }, {
        decorations: (v) => v.decorations
      }));
    }
    const DefaultPlaceholder = "•";
    function placeholder$1(code2) {
      if (code2 >= 32)
        return DefaultPlaceholder;
      if (code2 == 10)
        return "␤";
      return String.fromCharCode(9216 + code2);
    }
    class SpecialCharWidget extends WidgetType {
      constructor(options2, code2) {
        super();
        this.options = options2;
        this.code = code2;
      }
      eq(other) {
        return other.code == this.code;
      }
      toDOM(view) {
        let ph = placeholder$1(this.code);
        let desc = view.state.phrase("Control character") + " " + (Names[this.code] || "0x" + this.code.toString(16));
        let custom = this.options.render && this.options.render(this.code, desc, ph);
        if (custom)
          return custom;
        let span = document.createElement("span");
        span.textContent = ph;
        span.title = desc;
        span.setAttribute("aria-label", desc);
        span.className = "cm-specialChar";
        return span;
      }
      ignoreEvent() {
        return false;
      }
    }
    class TabWidget extends WidgetType {
      constructor(width) {
        super();
        this.width = width;
      }
      eq(other) {
        return other.width == this.width;
      }
      toDOM() {
        let span = document.createElement("span");
        span.textContent = "	";
        span.className = "cm-tab";
        span.style.width = this.width + "px";
        return span;
      }
      ignoreEvent() {
        return false;
      }
    }
    const Outside = "-10000px";
    class TooltipViewManager {
      constructor(view, facet, createTooltipView, removeTooltipView) {
        this.facet = facet;
        this.createTooltipView = createTooltipView;
        this.removeTooltipView = removeTooltipView;
        this.input = view.state.facet(facet);
        this.tooltips = this.input.filter((t2) => t2);
        let prev = null;
        this.tooltipViews = this.tooltips.map((t2) => prev = createTooltipView(t2, prev));
      }
      update(update, above) {
        var _a2;
        let input2 = update.state.facet(this.facet);
        let tooltips = input2.filter((x2) => x2);
        if (input2 === this.input) {
          for (let t2 of this.tooltipViews)
            if (t2.update)
              t2.update(update);
          return false;
        }
        let tooltipViews = [], newAbove = above ? [] : null;
        for (let i2 = 0; i2 < tooltips.length; i2++) {
          let tip = tooltips[i2], known = -1;
          if (!tip)
            continue;
          for (let i3 = 0; i3 < this.tooltips.length; i3++) {
            let other = this.tooltips[i3];
            if (other && other.create == tip.create)
              known = i3;
          }
          if (known < 0) {
            tooltipViews[i2] = this.createTooltipView(tip, i2 ? tooltipViews[i2 - 1] : null);
            if (newAbove)
              newAbove[i2] = !!tip.above;
          } else {
            let tooltipView = tooltipViews[i2] = this.tooltipViews[known];
            if (newAbove)
              newAbove[i2] = above[known];
            if (tooltipView.update)
              tooltipView.update(update);
          }
        }
        for (let t2 of this.tooltipViews)
          if (tooltipViews.indexOf(t2) < 0) {
            this.removeTooltipView(t2);
            (_a2 = t2.destroy) === null || _a2 === void 0 ? void 0 : _a2.call(t2);
          }
        if (above) {
          newAbove.forEach((val, i2) => above[i2] = val);
          above.length = newAbove.length;
        }
        this.input = input2;
        this.tooltips = tooltips;
        this.tooltipViews = tooltipViews;
        return true;
      }
    }
    function windowSpace(view) {
      let docElt = view.dom.ownerDocument.documentElement;
      return { top: 0, left: 0, bottom: docElt.clientHeight, right: docElt.clientWidth };
    }
    const tooltipConfig = /* @__PURE__ */ Facet.define({
      combine: (values) => {
        var _a2, _b2, _c;
        return {
          position: browser.ios ? "absolute" : ((_a2 = values.find((conf) => conf.position)) === null || _a2 === void 0 ? void 0 : _a2.position) || "fixed",
          parent: ((_b2 = values.find((conf) => conf.parent)) === null || _b2 === void 0 ? void 0 : _b2.parent) || null,
          tooltipSpace: ((_c = values.find((conf) => conf.tooltipSpace)) === null || _c === void 0 ? void 0 : _c.tooltipSpace) || windowSpace
        };
      }
    });
    const knownHeight = /* @__PURE__ */ new WeakMap();
    const tooltipPlugin = /* @__PURE__ */ ViewPlugin.fromClass(class {
      constructor(view) {
        this.view = view;
        this.above = [];
        this.inView = true;
        this.madeAbsolute = false;
        this.lastTransaction = 0;
        this.measureTimeout = -1;
        let config2 = view.state.facet(tooltipConfig);
        this.position = config2.position;
        this.parent = config2.parent;
        this.classes = view.themeClasses;
        this.createContainer();
        this.measureReq = { read: this.readMeasure.bind(this), write: this.writeMeasure.bind(this), key: this };
        this.resizeObserver = typeof ResizeObserver == "function" ? new ResizeObserver(() => this.measureSoon()) : null;
        this.manager = new TooltipViewManager(view, showTooltip, (t2, p) => this.createTooltip(t2, p), (t2) => {
          if (this.resizeObserver)
            this.resizeObserver.unobserve(t2.dom);
          t2.dom.remove();
        });
        this.above = this.manager.tooltips.map((t2) => !!t2.above);
        this.intersectionObserver = typeof IntersectionObserver == "function" ? new IntersectionObserver((entries) => {
          if (Date.now() > this.lastTransaction - 50 && entries.length > 0 && entries[entries.length - 1].intersectionRatio < 1)
            this.measureSoon();
        }, { threshold: [1] }) : null;
        this.observeIntersection();
        view.win.addEventListener("resize", this.measureSoon = this.measureSoon.bind(this));
        this.maybeMeasure();
      }
      createContainer() {
        if (this.parent) {
          this.container = document.createElement("div");
          this.container.style.position = "relative";
          this.container.className = this.view.themeClasses;
          this.parent.appendChild(this.container);
        } else {
          this.container = this.view.dom;
        }
      }
      observeIntersection() {
        if (this.intersectionObserver) {
          this.intersectionObserver.disconnect();
          for (let tooltip of this.manager.tooltipViews)
            this.intersectionObserver.observe(tooltip.dom);
        }
      }
      measureSoon() {
        if (this.measureTimeout < 0)
          this.measureTimeout = setTimeout(() => {
            this.measureTimeout = -1;
            this.maybeMeasure();
          }, 50);
      }
      update(update) {
        if (update.transactions.length)
          this.lastTransaction = Date.now();
        let updated = this.manager.update(update, this.above);
        if (updated)
          this.observeIntersection();
        let shouldMeasure = updated || update.geometryChanged;
        let newConfig = update.state.facet(tooltipConfig);
        if (newConfig.position != this.position && !this.madeAbsolute) {
          this.position = newConfig.position;
          for (let t2 of this.manager.tooltipViews)
            t2.dom.style.position = this.position;
          shouldMeasure = true;
        }
        if (newConfig.parent != this.parent) {
          if (this.parent)
            this.container.remove();
          this.parent = newConfig.parent;
          this.createContainer();
          for (let t2 of this.manager.tooltipViews)
            this.container.appendChild(t2.dom);
          shouldMeasure = true;
        } else if (this.parent && this.view.themeClasses != this.classes) {
          this.classes = this.container.className = this.view.themeClasses;
        }
        if (shouldMeasure)
          this.maybeMeasure();
      }
      createTooltip(tooltip, prev) {
        let tooltipView = tooltip.create(this.view);
        let before = prev ? prev.dom : null;
        tooltipView.dom.classList.add("cm-tooltip");
        if (tooltip.arrow && !tooltipView.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")) {
          let arrow2 = document.createElement("div");
          arrow2.className = "cm-tooltip-arrow";
          tooltipView.dom.appendChild(arrow2);
        }
        tooltipView.dom.style.position = this.position;
        tooltipView.dom.style.top = Outside;
        tooltipView.dom.style.left = "0px";
        this.container.insertBefore(tooltipView.dom, before);
        if (tooltipView.mount)
          tooltipView.mount(this.view);
        if (this.resizeObserver)
          this.resizeObserver.observe(tooltipView.dom);
        return tooltipView;
      }
      destroy() {
        var _a2, _b2, _c;
        this.view.win.removeEventListener("resize", this.measureSoon);
        for (let tooltipView of this.manager.tooltipViews) {
          tooltipView.dom.remove();
          (_a2 = tooltipView.destroy) === null || _a2 === void 0 ? void 0 : _a2.call(tooltipView);
        }
        if (this.parent)
          this.container.remove();
        (_b2 = this.resizeObserver) === null || _b2 === void 0 ? void 0 : _b2.disconnect();
        (_c = this.intersectionObserver) === null || _c === void 0 ? void 0 : _c.disconnect();
        clearTimeout(this.measureTimeout);
      }
      readMeasure() {
        let scaleX = 1, scaleY = 1, makeAbsolute = false;
        if (this.position == "fixed" && this.manager.tooltipViews.length) {
          let { dom } = this.manager.tooltipViews[0];
          if (browser.gecko) {
            makeAbsolute = dom.offsetParent != this.container.ownerDocument.body;
          } else if (dom.style.top == Outside && dom.style.left == "0px") {
            let rect2 = dom.getBoundingClientRect();
            makeAbsolute = Math.abs(rect2.top + 1e4) > 1 || Math.abs(rect2.left) > 1;
          }
        }
        if (makeAbsolute || this.position == "absolute") {
          if (this.parent) {
            let rect2 = this.parent.getBoundingClientRect();
            if (rect2.width && rect2.height) {
              scaleX = rect2.width / this.parent.offsetWidth;
              scaleY = rect2.height / this.parent.offsetHeight;
            }
          } else {
            ({ scaleX, scaleY } = this.view.viewState);
          }
        }
        let visible2 = this.view.scrollDOM.getBoundingClientRect(), margins = getScrollMargins(this.view);
        return {
          visible: {
            left: visible2.left + margins.left,
            top: visible2.top + margins.top,
            right: visible2.right - margins.right,
            bottom: visible2.bottom - margins.bottom
          },
          parent: this.parent ? this.container.getBoundingClientRect() : this.view.dom.getBoundingClientRect(),
          pos: this.manager.tooltips.map((t2, i2) => {
            let tv = this.manager.tooltipViews[i2];
            return tv.getCoords ? tv.getCoords(t2.pos) : this.view.coordsAtPos(t2.pos);
          }),
          size: this.manager.tooltipViews.map(({ dom }) => dom.getBoundingClientRect()),
          space: this.view.state.facet(tooltipConfig).tooltipSpace(this.view),
          scaleX,
          scaleY,
          makeAbsolute
        };
      }
      writeMeasure(measured) {
        var _a2;
        if (measured.makeAbsolute) {
          this.madeAbsolute = true;
          this.position = "absolute";
          for (let t2 of this.manager.tooltipViews)
            t2.dom.style.position = "absolute";
        }
        let { visible: visible2, space, scaleX, scaleY } = measured;
        let others = [];
        for (let i2 = 0; i2 < this.manager.tooltips.length; i2++) {
          let tooltip = this.manager.tooltips[i2], tView = this.manager.tooltipViews[i2], { dom } = tView;
          let pos2 = measured.pos[i2], size = measured.size[i2];
          if (!pos2 || tooltip.clip !== false && (pos2.bottom <= Math.max(visible2.top, space.top) || pos2.top >= Math.min(visible2.bottom, space.bottom) || pos2.right < Math.max(visible2.left, space.left) - 0.1 || pos2.left > Math.min(visible2.right, space.right) + 0.1)) {
            dom.style.top = Outside;
            continue;
          }
          let arrow2 = tooltip.arrow ? tView.dom.querySelector(".cm-tooltip-arrow") : null;
          let arrowHeight = arrow2 ? 7 : 0;
          let width = size.right - size.left, height = (_a2 = knownHeight.get(tView)) !== null && _a2 !== void 0 ? _a2 : size.bottom - size.top;
          let offset2 = tView.offset || noOffset, ltr = this.view.textDirection == Direction.LTR;
          let left2 = size.width > space.right - space.left ? ltr ? space.left : space.right - size.width : ltr ? Math.max(space.left, Math.min(pos2.left - (arrow2 ? 14 : 0) + offset2.x, space.right - width)) : Math.min(Math.max(space.left, pos2.left - width + (arrow2 ? 14 : 0) - offset2.x), space.right - width);
          let above = this.above[i2];
          if (!tooltip.strictSide && (above ? pos2.top - height - arrowHeight - offset2.y < space.top : pos2.bottom + height + arrowHeight + offset2.y > space.bottom) && above == space.bottom - pos2.bottom > pos2.top - space.top)
            above = this.above[i2] = !above;
          let spaceVert = (above ? pos2.top - space.top : space.bottom - pos2.bottom) - arrowHeight;
          if (spaceVert < height && tView.resize !== false) {
            if (spaceVert < this.view.defaultLineHeight) {
              dom.style.top = Outside;
              continue;
            }
            knownHeight.set(tView, height);
            dom.style.height = (height = spaceVert) / scaleY + "px";
          } else if (dom.style.height) {
            dom.style.height = "";
          }
          let top2 = above ? pos2.top - height - arrowHeight - offset2.y : pos2.bottom + arrowHeight + offset2.y;
          let right2 = left2 + width;
          if (tView.overlap !== true) {
            for (let r2 of others)
              if (r2.left < right2 && r2.right > left2 && r2.top < top2 + height && r2.bottom > top2)
                top2 = above ? r2.top - height - 2 - arrowHeight : r2.bottom + arrowHeight + 2;
          }
          if (this.position == "absolute") {
            dom.style.top = (top2 - measured.parent.top) / scaleY + "px";
            setLeftStyle(dom, (left2 - measured.parent.left) / scaleX);
          } else {
            dom.style.top = top2 / scaleY + "px";
            setLeftStyle(dom, left2 / scaleX);
          }
          if (arrow2) {
            let arrowLeft = pos2.left + (ltr ? offset2.x : -offset2.x) - (left2 + 14 - 7);
            arrow2.style.left = arrowLeft / scaleX + "px";
          }
          if (tView.overlap !== true)
            others.push({ left: left2, top: top2, right: right2, bottom: top2 + height });
          dom.classList.toggle("cm-tooltip-above", above);
          dom.classList.toggle("cm-tooltip-below", !above);
          if (tView.positioned)
            tView.positioned(measured.space);
        }
      }
      maybeMeasure() {
        if (this.manager.tooltips.length) {
          if (this.view.inView)
            this.view.requestMeasure(this.measureReq);
          if (this.inView != this.view.inView) {
            this.inView = this.view.inView;
            if (!this.inView)
              for (let tv of this.manager.tooltipViews)
                tv.dom.style.top = Outside;
          }
        }
      }
    }, {
      eventObservers: {
        scroll() {
          this.maybeMeasure();
        }
      }
    });
    function setLeftStyle(elt, value2) {
      let current2 = parseInt(elt.style.left, 10);
      if (isNaN(current2) || Math.abs(value2 - current2) > 1)
        elt.style.left = value2 + "px";
    }
    const baseTheme$3 = /* @__PURE__ */ EditorView.baseTheme({
      ".cm-tooltip": {
        zIndex: 500,
        boxSizing: "border-box"
      },
      "&light .cm-tooltip": {
        border: "1px solid #bbb",
        backgroundColor: "#f5f5f5"
      },
      "&light .cm-tooltip-section:not(:first-child)": {
        borderTop: "1px solid #bbb"
      },
      "&dark .cm-tooltip": {
        backgroundColor: "#333338",
        color: "white"
      },
      ".cm-tooltip-arrow": {
        height: `${7}px`,
        width: `${7 * 2}px`,
        position: "absolute",
        zIndex: -1,
        overflow: "hidden",
        "&:before, &:after": {
          content: "''",
          position: "absolute",
          width: 0,
          height: 0,
          borderLeft: `${7}px solid transparent`,
          borderRight: `${7}px solid transparent`
        },
        ".cm-tooltip-above &": {
          bottom: `-${7}px`,
          "&:before": {
            borderTop: `${7}px solid #bbb`
          },
          "&:after": {
            borderTop: `${7}px solid #f5f5f5`,
            bottom: "1px"
          }
        },
        ".cm-tooltip-below &": {
          top: `-${7}px`,
          "&:before": {
            borderBottom: `${7}px solid #bbb`
          },
          "&:after": {
            borderBottom: `${7}px solid #f5f5f5`,
            top: "1px"
          }
        }
      },
      "&dark .cm-tooltip .cm-tooltip-arrow": {
        "&:before": {
          borderTopColor: "#333338",
          borderBottomColor: "#333338"
        },
        "&:after": {
          borderTopColor: "transparent",
          borderBottomColor: "transparent"
        }
      }
    });
    const noOffset = { x: 0, y: 0 };
    const showTooltip = /* @__PURE__ */ Facet.define({
      enables: [tooltipPlugin, baseTheme$3]
    });
    const showHoverTooltip = /* @__PURE__ */ Facet.define({
      combine: (inputs) => inputs.reduce((a, i2) => a.concat(i2), [])
    });
    class HoverTooltipHost {
      // Needs to be static so that host tooltip instances always match
      static create(view) {
        return new HoverTooltipHost(view);
      }
      constructor(view) {
        this.view = view;
        this.mounted = false;
        this.dom = document.createElement("div");
        this.dom.classList.add("cm-tooltip-hover");
        this.manager = new TooltipViewManager(view, showHoverTooltip, (t2, p) => this.createHostedView(t2, p), (t2) => t2.dom.remove());
      }
      createHostedView(tooltip, prev) {
        let hostedView = tooltip.create(this.view);
        hostedView.dom.classList.add("cm-tooltip-section");
        this.dom.insertBefore(hostedView.dom, prev ? prev.dom.nextSibling : this.dom.firstChild);
        if (this.mounted && hostedView.mount)
          hostedView.mount(this.view);
        return hostedView;
      }
      mount(view) {
        for (let hostedView of this.manager.tooltipViews) {
          if (hostedView.mount)
            hostedView.mount(view);
        }
        this.mounted = true;
      }
      positioned(space) {
        for (let hostedView of this.manager.tooltipViews) {
          if (hostedView.positioned)
            hostedView.positioned(space);
        }
      }
      update(update) {
        this.manager.update(update);
      }
      destroy() {
        var _a2;
        for (let t2 of this.manager.tooltipViews)
          (_a2 = t2.destroy) === null || _a2 === void 0 ? void 0 : _a2.call(t2);
      }
      passProp(name2) {
        let value2 = void 0;
        for (let view of this.manager.tooltipViews) {
          let given = view[name2];
          if (given !== void 0) {
            if (value2 === void 0)
              value2 = given;
            else if (value2 !== given)
              return void 0;
          }
        }
        return value2;
      }
      get offset() {
        return this.passProp("offset");
      }
      get getCoords() {
        return this.passProp("getCoords");
      }
      get overlap() {
        return this.passProp("overlap");
      }
      get resize() {
        return this.passProp("resize");
      }
    }
    const showHoverTooltipHost = /* @__PURE__ */ showTooltip.compute([showHoverTooltip], (state) => {
      let tooltips = state.facet(showHoverTooltip);
      if (tooltips.length === 0)
        return null;
      return {
        pos: Math.min(...tooltips.map((t2) => t2.pos)),
        end: Math.max(...tooltips.map((t2) => {
          var _a2;
          return (_a2 = t2.end) !== null && _a2 !== void 0 ? _a2 : t2.pos;
        })),
        create: HoverTooltipHost.create,
        above: tooltips[0].above,
        arrow: tooltips.some((t2) => t2.arrow)
      };
    });
    class HoverPlugin {
      constructor(view, source2, field, setHover, hoverTime) {
        this.view = view;
        this.source = source2;
        this.field = field;
        this.setHover = setHover;
        this.hoverTime = hoverTime;
        this.hoverTimeout = -1;
        this.restartTimeout = -1;
        this.pending = null;
        this.lastMove = { x: 0, y: 0, target: view.dom, time: 0 };
        this.checkHover = this.checkHover.bind(this);
        view.dom.addEventListener("mouseleave", this.mouseleave = this.mouseleave.bind(this));
        view.dom.addEventListener("mousemove", this.mousemove = this.mousemove.bind(this));
      }
      update() {
        if (this.pending) {
          this.pending = null;
          clearTimeout(this.restartTimeout);
          this.restartTimeout = setTimeout(() => this.startHover(), 20);
        }
      }
      get active() {
        return this.view.state.field(this.field);
      }
      checkHover() {
        this.hoverTimeout = -1;
        if (this.active.length)
          return;
        let hovered = Date.now() - this.lastMove.time;
        if (hovered < this.hoverTime)
          this.hoverTimeout = setTimeout(this.checkHover, this.hoverTime - hovered);
        else
          this.startHover();
      }
      startHover() {
        clearTimeout(this.restartTimeout);
        let { view, lastMove } = this;
        let desc = view.docView.nearest(lastMove.target);
        if (!desc)
          return;
        let pos2, side = 1;
        if (desc instanceof WidgetView) {
          pos2 = desc.posAtStart;
        } else {
          pos2 = view.posAtCoords(lastMove);
          if (pos2 == null)
            return;
          let posCoords = view.coordsAtPos(pos2);
          if (!posCoords || lastMove.y < posCoords.top || lastMove.y > posCoords.bottom || lastMove.x < posCoords.left - view.defaultCharacterWidth || lastMove.x > posCoords.right + view.defaultCharacterWidth)
            return;
          let bidi = view.bidiSpans(view.state.doc.lineAt(pos2)).find((s) => s.from <= pos2 && s.to >= pos2);
          let rtl = bidi && bidi.dir == Direction.RTL ? -1 : 1;
          side = lastMove.x < posCoords.left ? -rtl : rtl;
        }
        let open = this.source(view, pos2, side);
        if (open === null || open === void 0 ? void 0 : open.then) {
          let pending = this.pending = { pos: pos2 };
          open.then((result2) => {
            if (this.pending == pending) {
              this.pending = null;
              if (result2 && !(Array.isArray(result2) && !result2.length))
                view.dispatch({ effects: this.setHover.of(Array.isArray(result2) ? result2 : [result2]) });
            }
          }, (e) => logException(view.state, e, "hover tooltip"));
        } else if (open && !(Array.isArray(open) && !open.length)) {
          view.dispatch({ effects: this.setHover.of(Array.isArray(open) ? open : [open]) });
        }
      }
      get tooltip() {
        let plugin = this.view.plugin(tooltipPlugin);
        let index = plugin ? plugin.manager.tooltips.findIndex((t2) => t2.create == HoverTooltipHost.create) : -1;
        return index > -1 ? plugin.manager.tooltipViews[index] : null;
      }
      mousemove(event) {
        var _a2, _b2;
        this.lastMove = { x: event.clientX, y: event.clientY, target: event.target, time: Date.now() };
        if (this.hoverTimeout < 0)
          this.hoverTimeout = setTimeout(this.checkHover, this.hoverTime);
        let { active, tooltip } = this;
        if (active.length && tooltip && !isInTooltip(tooltip.dom, event) || this.pending) {
          let { pos: pos2 } = active[0] || this.pending, end2 = (_b2 = (_a2 = active[0]) === null || _a2 === void 0 ? void 0 : _a2.end) !== null && _b2 !== void 0 ? _b2 : pos2;
          if (pos2 == end2 ? this.view.posAtCoords(this.lastMove) != pos2 : !isOverRange(this.view, pos2, end2, event.clientX, event.clientY)) {
            this.view.dispatch({ effects: this.setHover.of([]) });
            this.pending = null;
          }
        }
      }
      mouseleave(event) {
        clearTimeout(this.hoverTimeout);
        this.hoverTimeout = -1;
        let { active } = this;
        if (active.length) {
          let { tooltip } = this;
          let inTooltip = tooltip && tooltip.dom.contains(event.relatedTarget);
          if (!inTooltip)
            this.view.dispatch({ effects: this.setHover.of([]) });
          else
            this.watchTooltipLeave(tooltip.dom);
        }
      }
      watchTooltipLeave(tooltip) {
        let watch = (event) => {
          tooltip.removeEventListener("mouseleave", watch);
          if (this.active.length && !this.view.dom.contains(event.relatedTarget))
            this.view.dispatch({ effects: this.setHover.of([]) });
        };
        tooltip.addEventListener("mouseleave", watch);
      }
      destroy() {
        clearTimeout(this.hoverTimeout);
        this.view.dom.removeEventListener("mouseleave", this.mouseleave);
        this.view.dom.removeEventListener("mousemove", this.mousemove);
      }
    }
    const tooltipMargin = 4;
    function isInTooltip(tooltip, event) {
      let { left: left2, right: right2, top: top2, bottom: bottom2 } = tooltip.getBoundingClientRect(), arrow2;
      if (arrow2 = tooltip.querySelector(".cm-tooltip-arrow")) {
        let arrowRect = arrow2.getBoundingClientRect();
        top2 = Math.min(arrowRect.top, top2);
        bottom2 = Math.max(arrowRect.bottom, bottom2);
      }
      return event.clientX >= left2 - tooltipMargin && event.clientX <= right2 + tooltipMargin && event.clientY >= top2 - tooltipMargin && event.clientY <= bottom2 + tooltipMargin;
    }
    function isOverRange(view, from, to2, x2, y, margin) {
      let rect2 = view.scrollDOM.getBoundingClientRect();
      let docBottom = view.documentTop + view.documentPadding.top + view.contentHeight;
      if (rect2.left > x2 || rect2.right < x2 || rect2.top > y || Math.min(rect2.bottom, docBottom) < y)
        return false;
      let pos2 = view.posAtCoords({ x: x2, y }, false);
      return pos2 >= from && pos2 <= to2;
    }
    function hoverTooltip(source2, options2 = {}) {
      let setHover = StateEffect.define();
      let hoverState = StateField.define({
        create() {
          return [];
        },
        update(value2, tr2) {
          if (value2.length) {
            if (options2.hideOnChange && (tr2.docChanged || tr2.selection))
              value2 = [];
            else if (options2.hideOn)
              value2 = value2.filter((v) => !options2.hideOn(tr2, v));
            if (tr2.docChanged) {
              let mapped = [];
              for (let tooltip of value2) {
                let newPos = tr2.changes.mapPos(tooltip.pos, -1, MapMode.TrackDel);
                if (newPos != null) {
                  let copy2 = Object.assign(/* @__PURE__ */ Object.create(null), tooltip);
                  copy2.pos = newPos;
                  if (copy2.end != null)
                    copy2.end = tr2.changes.mapPos(copy2.end);
                  mapped.push(copy2);
                }
              }
              value2 = mapped;
            }
          }
          for (let effect2 of tr2.effects) {
            if (effect2.is(setHover))
              value2 = effect2.value;
            if (effect2.is(closeHoverTooltipEffect))
              value2 = [];
          }
          return value2;
        },
        provide: (f) => showHoverTooltip.from(f)
      });
      return {
        active: hoverState,
        extension: [
          hoverState,
          ViewPlugin.define((view) => new HoverPlugin(
            view,
            source2,
            hoverState,
            setHover,
            options2.hoverTime || 300
            /* Hover.Time */
          )),
          showHoverTooltipHost
        ]
      };
    }
    function getTooltip(view, tooltip) {
      let plugin = view.plugin(tooltipPlugin);
      if (!plugin)
        return null;
      let found = plugin.manager.tooltips.indexOf(tooltip);
      return found < 0 ? null : plugin.manager.tooltipViews[found];
    }
    const closeHoverTooltipEffect = /* @__PURE__ */ StateEffect.define();
    const panelConfig = /* @__PURE__ */ Facet.define({
      combine(configs) {
        let topContainer, bottomContainer;
        for (let c2 of configs) {
          topContainer = topContainer || c2.topContainer;
          bottomContainer = bottomContainer || c2.bottomContainer;
        }
        return { topContainer, bottomContainer };
      }
    });
    const panelPlugin = /* @__PURE__ */ ViewPlugin.fromClass(class {
      constructor(view) {
        this.input = view.state.facet(showPanel);
        this.specs = this.input.filter((s) => s);
        this.panels = this.specs.map((spec) => spec(view));
        let conf = view.state.facet(panelConfig);
        this.top = new PanelGroup(view, true, conf.topContainer);
        this.bottom = new PanelGroup(view, false, conf.bottomContainer);
        this.top.sync(this.panels.filter((p) => p.top));
        this.bottom.sync(this.panels.filter((p) => !p.top));
        for (let p of this.panels) {
          p.dom.classList.add("cm-panel");
          if (p.mount)
            p.mount();
        }
      }
      update(update) {
        let conf = update.state.facet(panelConfig);
        if (this.top.container != conf.topContainer) {
          this.top.sync([]);
          this.top = new PanelGroup(update.view, true, conf.topContainer);
        }
        if (this.bottom.container != conf.bottomContainer) {
          this.bottom.sync([]);
          this.bottom = new PanelGroup(update.view, false, conf.bottomContainer);
        }
        this.top.syncClasses();
        this.bottom.syncClasses();
        let input2 = update.state.facet(showPanel);
        if (input2 != this.input) {
          let specs = input2.filter((x2) => x2);
          let panels = [], top2 = [], bottom2 = [], mount2 = [];
          for (let spec of specs) {
            let known = this.specs.indexOf(spec), panel2;
            if (known < 0) {
              panel2 = spec(update.view);
              mount2.push(panel2);
            } else {
              panel2 = this.panels[known];
              if (panel2.update)
                panel2.update(update);
            }
            panels.push(panel2);
            (panel2.top ? top2 : bottom2).push(panel2);
          }
          this.specs = specs;
          this.panels = panels;
          this.top.sync(top2);
          this.bottom.sync(bottom2);
          for (let p of mount2) {
            p.dom.classList.add("cm-panel");
            if (p.mount)
              p.mount();
          }
        } else {
          for (let p of this.panels)
            if (p.update)
              p.update(update);
        }
      }
      destroy() {
        this.top.sync([]);
        this.bottom.sync([]);
      }
    }, {
      provide: (plugin) => EditorView.scrollMargins.of((view) => {
        let value2 = view.plugin(plugin);
        return value2 && { top: value2.top.scrollMargin(), bottom: value2.bottom.scrollMargin() };
      })
    });
    class PanelGroup {
      constructor(view, top2, container2) {
        this.view = view;
        this.top = top2;
        this.container = container2;
        this.dom = void 0;
        this.classes = "";
        this.panels = [];
        this.syncClasses();
      }
      sync(panels) {
        for (let p of this.panels)
          if (p.destroy && panels.indexOf(p) < 0)
            p.destroy();
        this.panels = panels;
        this.syncDOM();
      }
      syncDOM() {
        if (this.panels.length == 0) {
          if (this.dom) {
            this.dom.remove();
            this.dom = void 0;
          }
          return;
        }
        if (!this.dom) {
          this.dom = document.createElement("div");
          this.dom.className = this.top ? "cm-panels cm-panels-top" : "cm-panels cm-panels-bottom";
          this.dom.style[this.top ? "top" : "bottom"] = "0";
          let parent = this.container || this.view.dom;
          parent.insertBefore(this.dom, this.top ? parent.firstChild : null);
        }
        let curDOM = this.dom.firstChild;
        for (let panel2 of this.panels) {
          if (panel2.dom.parentNode == this.dom) {
            while (curDOM != panel2.dom)
              curDOM = rm(curDOM);
            curDOM = curDOM.nextSibling;
          } else {
            this.dom.insertBefore(panel2.dom, curDOM);
          }
        }
        while (curDOM)
          curDOM = rm(curDOM);
      }
      scrollMargin() {
        return !this.dom || this.container ? 0 : Math.max(0, this.top ? this.dom.getBoundingClientRect().bottom - Math.max(0, this.view.scrollDOM.getBoundingClientRect().top) : Math.min(innerHeight, this.view.scrollDOM.getBoundingClientRect().bottom) - this.dom.getBoundingClientRect().top);
      }
      syncClasses() {
        if (!this.container || this.classes == this.view.themeClasses)
          return;
        for (let cls of this.classes.split(" "))
          if (cls)
            this.container.classList.remove(cls);
        for (let cls of (this.classes = this.view.themeClasses).split(" "))
          if (cls)
            this.container.classList.add(cls);
      }
    }
    function rm(node2) {
      let next = node2.nextSibling;
      node2.remove();
      return next;
    }
    const showPanel = /* @__PURE__ */ Facet.define({
      enables: panelPlugin
    });
    class GutterMarker extends RangeValue {
      /**
      @internal
      */
      compare(other) {
        return this == other || this.constructor == other.constructor && this.eq(other);
      }
      /**
      Compare this marker to another marker of the same type.
      */
      eq(other) {
        return false;
      }
      /**
      Called if the marker has a `toDOM` method and its representation
      was removed from a gutter.
      */
      destroy(dom) {
      }
    }
    GutterMarker.prototype.elementClass = "";
    GutterMarker.prototype.toDOM = void 0;
    GutterMarker.prototype.mapMode = MapMode.TrackBefore;
    GutterMarker.prototype.startSide = GutterMarker.prototype.endSide = -1;
    GutterMarker.prototype.point = true;
    const DefaultBufferLength = 1024;
    let nextPropID$1 = 0;
    class Range {
      constructor(from, to2) {
        this.from = from;
        this.to = to2;
      }
    }
    let NodeProp$1 = class NodeProp {
      /**
      Create a new node prop type.
      */
      constructor(config2 = {}) {
        this.id = nextPropID$1++;
        this.perNode = !!config2.perNode;
        this.deserialize = config2.deserialize || (() => {
          throw new Error("This node type doesn't define a deserialize function");
        });
      }
      /**
      This is meant to be used with
      [`NodeSet.extend`](#common.NodeSet.extend) or
      [`LRParser.configure`](#lr.ParserConfig.props) to compute
      prop values for each node type in the set. Takes a [match
      object](#common.NodeType^match) or function that returns undefined
      if the node type doesn't get this prop, and the prop's value if
      it does.
      */
      add(match) {
        if (this.perNode)
          throw new RangeError("Can't add per-node props to node types");
        if (typeof match != "function")
          match = NodeType$1.match(match);
        return (type) => {
          let result2 = match(type);
          return result2 === void 0 ? null : [this, result2];
        };
      }
    };
    NodeProp$1.closedBy = new NodeProp$1({ deserialize: (str2) => str2.split(" ") });
    NodeProp$1.openedBy = new NodeProp$1({ deserialize: (str2) => str2.split(" ") });
    NodeProp$1.group = new NodeProp$1({ deserialize: (str2) => str2.split(" ") });
    NodeProp$1.isolate = new NodeProp$1({ deserialize: (value2) => {
      if (value2 && value2 != "rtl" && value2 != "ltr" && value2 != "auto")
        throw new RangeError("Invalid value for isolate: " + value2);
      return value2 || "auto";
    } });
    NodeProp$1.contextHash = new NodeProp$1({ perNode: true });
    NodeProp$1.lookAhead = new NodeProp$1({ perNode: true });
    NodeProp$1.mounted = new NodeProp$1({ perNode: true });
    class MountedTree {
      constructor(tree, overlay, parser2) {
        this.tree = tree;
        this.overlay = overlay;
        this.parser = parser2;
      }
      /**
      @internal
      */
      static get(tree) {
        return tree && tree.props && tree.props[NodeProp$1.mounted.id];
      }
    }
    const noProps$1 = /* @__PURE__ */ Object.create(null);
    let NodeType$1 = class NodeType2 {
      /**
      @internal
      */
      constructor(name2, props, id, flags = 0) {
        this.name = name2;
        this.props = props;
        this.id = id;
        this.flags = flags;
      }
      /**
      Define a node type.
      */
      static define(spec) {
        let props = spec.props && spec.props.length ? /* @__PURE__ */ Object.create(null) : noProps$1;
        let flags = (spec.top ? 1 : 0) | (spec.skipped ? 2 : 0) | (spec.error ? 4 : 0) | (spec.name == null ? 8 : 0);
        let type = new NodeType2(spec.name || "", props, spec.id, flags);
        if (spec.props)
          for (let src of spec.props) {
            if (!Array.isArray(src))
              src = src(type);
            if (src) {
              if (src[0].perNode)
                throw new RangeError("Can't store a per-node prop on a node type");
              props[src[0].id] = src[1];
            }
          }
        return type;
      }
      /**
      Retrieves a node prop for this type. Will return `undefined` if
      the prop isn't present on this node.
      */
      prop(prop2) {
        return this.props[prop2.id];
      }
      /**
      True when this is the top node of a grammar.
      */
      get isTop() {
        return (this.flags & 1) > 0;
      }
      /**
      True when this node is produced by a skip rule.
      */
      get isSkipped() {
        return (this.flags & 2) > 0;
      }
      /**
      Indicates whether this is an error node.
      */
      get isError() {
        return (this.flags & 4) > 0;
      }
      /**
      When true, this node type doesn't correspond to a user-declared
      named node, for example because it is used to cache repetition.
      */
      get isAnonymous() {
        return (this.flags & 8) > 0;
      }
      /**
      Returns true when this node's name or one of its
      [groups](#common.NodeProp^group) matches the given string.
      */
      is(name2) {
        if (typeof name2 == "string") {
          if (this.name == name2)
            return true;
          let group = this.prop(NodeProp$1.group);
          return group ? group.indexOf(name2) > -1 : false;
        }
        return this.id == name2;
      }
      /**
      Create a function from node types to arbitrary values by
      specifying an object whose property names are node or
      [group](#common.NodeProp^group) names. Often useful with
      [`NodeProp.add`](#common.NodeProp.add). You can put multiple
      names, separated by spaces, in a single property name to map
      multiple node names to a single value.
      */
      static match(map2) {
        let direct = /* @__PURE__ */ Object.create(null);
        for (let prop2 in map2)
          for (let name2 of prop2.split(" "))
            direct[name2] = map2[prop2];
        return (node2) => {
          for (let groups = node2.prop(NodeProp$1.group), i2 = -1; i2 < (groups ? groups.length : 0); i2++) {
            let found = direct[i2 < 0 ? node2.name : groups[i2]];
            if (found)
              return found;
          }
        };
      }
    };
    NodeType$1.none = new NodeType$1(
      "",
      /* @__PURE__ */ Object.create(null),
      0,
      8
      /* NodeFlag.Anonymous */
    );
    class NodeSet {
      /**
      Create a set with the given types. The `id` property of each
      type should correspond to its position within the array.
      */
      constructor(types2) {
        this.types = types2;
        for (let i2 = 0; i2 < types2.length; i2++)
          if (types2[i2].id != i2)
            throw new RangeError("Node type ids should correspond to array positions when creating a node set");
      }
      /**
      Create a copy of this set with some node properties added. The
      arguments to this method can be created with
      [`NodeProp.add`](#common.NodeProp.add).
      */
      extend(...props) {
        let newTypes = [];
        for (let type of this.types) {
          let newProps = null;
          for (let source2 of props) {
            let add2 = source2(type);
            if (add2) {
              if (!newProps)
                newProps = Object.assign({}, type.props);
              newProps[add2[0].id] = add2[1];
            }
          }
          newTypes.push(newProps ? new NodeType$1(type.name, newProps, type.id, type.flags) : type);
        }
        return new NodeSet(newTypes);
      }
    }
    const CachedNode = /* @__PURE__ */ new WeakMap(), CachedInnerNode = /* @__PURE__ */ new WeakMap();
    var IterMode$1;
    (function(IterMode2) {
      IterMode2[IterMode2["ExcludeBuffers"] = 1] = "ExcludeBuffers";
      IterMode2[IterMode2["IncludeAnonymous"] = 2] = "IncludeAnonymous";
      IterMode2[IterMode2["IgnoreMounts"] = 4] = "IgnoreMounts";
      IterMode2[IterMode2["IgnoreOverlays"] = 8] = "IgnoreOverlays";
    })(IterMode$1 || (IterMode$1 = {}));
    class Tree {
      /**
      Construct a new tree. See also [`Tree.build`](#common.Tree^build).
      */
      constructor(type, children2, positions, length, props) {
        this.type = type;
        this.children = children2;
        this.positions = positions;
        this.length = length;
        this.props = null;
        if (props && props.length) {
          this.props = /* @__PURE__ */ Object.create(null);
          for (let [prop2, value2] of props)
            this.props[typeof prop2 == "number" ? prop2 : prop2.id] = value2;
        }
      }
      /**
      @internal
      */
      toString() {
        let mounted = MountedTree.get(this);
        if (mounted && !mounted.overlay)
          return mounted.tree.toString();
        let children2 = "";
        for (let ch3 of this.children) {
          let str2 = ch3.toString();
          if (str2) {
            if (children2)
              children2 += ",";
            children2 += str2;
          }
        }
        return !this.type.name ? children2 : (/\W/.test(this.type.name) && !this.type.isError ? JSON.stringify(this.type.name) : this.type.name) + (children2.length ? "(" + children2 + ")" : "");
      }
      /**
      Get a [tree cursor](#common.TreeCursor) positioned at the top of
      the tree. Mode can be used to [control](#common.IterMode) which
      nodes the cursor visits.
      */
      cursor(mode = 0) {
        return new TreeCursor(this.topNode, mode);
      }
      /**
      Get a [tree cursor](#common.TreeCursor) pointing into this tree
      at the given position and side (see
      [`moveTo`](#common.TreeCursor.moveTo).
      */
      cursorAt(pos2, side = 0, mode = 0) {
        let scope = CachedNode.get(this) || this.topNode;
        let cursor = new TreeCursor(scope);
        cursor.moveTo(pos2, side);
        CachedNode.set(this, cursor._tree);
        return cursor;
      }
      /**
      Get a [syntax node](#common.SyntaxNode) object for the top of the
      tree.
      */
      get topNode() {
        return new TreeNode(this, 0, 0, null);
      }
      /**
      Get the [syntax node](#common.SyntaxNode) at the given position.
      If `side` is -1, this will move into nodes that end at the
      position. If 1, it'll move into nodes that start at the
      position. With 0, it'll only enter nodes that cover the position
      from both sides.
      
      Note that this will not enter
      [overlays](#common.MountedTree.overlay), and you often want
      [`resolveInner`](#common.Tree.resolveInner) instead.
      */
      resolve(pos2, side = 0) {
        let node2 = resolveNode(CachedNode.get(this) || this.topNode, pos2, side, false);
        CachedNode.set(this, node2);
        return node2;
      }
      /**
      Like [`resolve`](#common.Tree.resolve), but will enter
      [overlaid](#common.MountedTree.overlay) nodes, producing a syntax node
      pointing into the innermost overlaid tree at the given position
      (with parent links going through all parent structure, including
      the host trees).
      */
      resolveInner(pos2, side = 0) {
        let node2 = resolveNode(CachedInnerNode.get(this) || this.topNode, pos2, side, true);
        CachedInnerNode.set(this, node2);
        return node2;
      }
      /**
      In some situations, it can be useful to iterate through all
      nodes around a position, including those in overlays that don't
      directly cover the position. This method gives you an iterator
      that will produce all nodes, from small to big, around the given
      position.
      */
      resolveStack(pos2, side = 0) {
        return stackIterator(this, pos2, side);
      }
      /**
      Iterate over the tree and its children, calling `enter` for any
      node that touches the `from`/`to` region (if given) before
      running over such a node's children, and `leave` (if given) when
      leaving the node. When `enter` returns `false`, that node will
      not have its children iterated over (or `leave` called).
      */
      iterate(spec) {
        let { enter, leave, from = 0, to: to2 = this.length } = spec;
        let mode = spec.mode || 0, anon = (mode & IterMode$1.IncludeAnonymous) > 0;
        for (let c2 = this.cursor(mode | IterMode$1.IncludeAnonymous); ; ) {
          let entered = false;
          if (c2.from <= to2 && c2.to >= from && (!anon && c2.type.isAnonymous || enter(c2) !== false)) {
            if (c2.firstChild())
              continue;
            entered = true;
          }
          for (; ; ) {
            if (entered && leave && (anon || !c2.type.isAnonymous))
              leave(c2);
            if (c2.nextSibling())
              break;
            if (!c2.parent())
              return;
            entered = true;
          }
        }
      }
      /**
      Get the value of the given [node prop](#common.NodeProp) for this
      node. Works with both per-node and per-type props.
      */
      prop(prop2) {
        return !prop2.perNode ? this.type.prop(prop2) : this.props ? this.props[prop2.id] : void 0;
      }
      /**
      Returns the node's [per-node props](#common.NodeProp.perNode) in a
      format that can be passed to the [`Tree`](#common.Tree)
      constructor.
      */
      get propValues() {
        let result2 = [];
        if (this.props)
          for (let id in this.props)
            result2.push([+id, this.props[id]]);
        return result2;
      }
      /**
      Balance the direct children of this tree, producing a copy of
      which may have children grouped into subtrees with type
      [`NodeType.none`](#common.NodeType^none).
      */
      balance(config2 = {}) {
        return this.children.length <= 8 ? this : balanceRange(NodeType$1.none, this.children, this.positions, 0, this.children.length, 0, this.length, (children2, positions, length) => new Tree(this.type, children2, positions, length, this.propValues), config2.makeTree || ((children2, positions, length) => new Tree(NodeType$1.none, children2, positions, length)));
      }
      /**
      Build a tree from a postfix-ordered buffer of node information,
      or a cursor over such a buffer.
      */
      static build(data) {
        return buildTree(data);
      }
    }
    Tree.empty = new Tree(NodeType$1.none, [], [], 0);
    class FlatBufferCursor {
      constructor(buffer2, index) {
        this.buffer = buffer2;
        this.index = index;
      }
      get id() {
        return this.buffer[this.index - 4];
      }
      get start() {
        return this.buffer[this.index - 3];
      }
      get end() {
        return this.buffer[this.index - 2];
      }
      get size() {
        return this.buffer[this.index - 1];
      }
      get pos() {
        return this.index;
      }
      next() {
        this.index -= 4;
      }
      fork() {
        return new FlatBufferCursor(this.buffer, this.index);
      }
    }
    class TreeBuffer {
      /**
      Create a tree buffer.
      */
      constructor(buffer2, length, set2) {
        this.buffer = buffer2;
        this.length = length;
        this.set = set2;
      }
      /**
      @internal
      */
      get type() {
        return NodeType$1.none;
      }
      /**
      @internal
      */
      toString() {
        let result2 = [];
        for (let index = 0; index < this.buffer.length; ) {
          result2.push(this.childString(index));
          index = this.buffer[index + 3];
        }
        return result2.join(",");
      }
      /**
      @internal
      */
      childString(index) {
        let id = this.buffer[index], endIndex = this.buffer[index + 3];
        let type = this.set.types[id], result2 = type.name;
        if (/\W/.test(result2) && !type.isError)
          result2 = JSON.stringify(result2);
        index += 4;
        if (endIndex == index)
          return result2;
        let children2 = [];
        while (index < endIndex) {
          children2.push(this.childString(index));
          index = this.buffer[index + 3];
        }
        return result2 + "(" + children2.join(",") + ")";
      }
      /**
      @internal
      */
      findChild(startIndex, endIndex, dir, pos2, side) {
        let { buffer: buffer2 } = this, pick = -1;
        for (let i2 = startIndex; i2 != endIndex; i2 = buffer2[i2 + 3]) {
          if (checkSide(side, pos2, buffer2[i2 + 1], buffer2[i2 + 2])) {
            pick = i2;
            if (dir > 0)
              break;
          }
        }
        return pick;
      }
      /**
      @internal
      */
      slice(startI, endI, from) {
        let b = this.buffer;
        let copy2 = new Uint16Array(endI - startI), len = 0;
        for (let i2 = startI, j = 0; i2 < endI; ) {
          copy2[j++] = b[i2++];
          copy2[j++] = b[i2++] - from;
          let to2 = copy2[j++] = b[i2++] - from;
          copy2[j++] = b[i2++] - startI;
          len = Math.max(len, to2);
        }
        return new TreeBuffer(copy2, len, this.set);
      }
    }
    function checkSide(side, pos2, from, to2) {
      switch (side) {
        case -2:
          return from < pos2;
        case -1:
          return to2 >= pos2 && from < pos2;
        case 0:
          return from < pos2 && to2 > pos2;
        case 1:
          return from <= pos2 && to2 > pos2;
        case 2:
          return to2 > pos2;
        case 4:
          return true;
      }
    }
    function resolveNode(node2, pos2, side, overlays) {
      var _a2;
      while (node2.from == node2.to || (side < 1 ? node2.from >= pos2 : node2.from > pos2) || (side > -1 ? node2.to <= pos2 : node2.to < pos2)) {
        let parent = !overlays && node2 instanceof TreeNode && node2.index < 0 ? null : node2.parent;
        if (!parent)
          return node2;
        node2 = parent;
      }
      let mode = overlays ? 0 : IterMode$1.IgnoreOverlays;
      if (overlays)
        for (let scan = node2, parent = scan.parent; parent; scan = parent, parent = scan.parent) {
          if (scan instanceof TreeNode && scan.index < 0 && ((_a2 = parent.enter(pos2, side, mode)) === null || _a2 === void 0 ? void 0 : _a2.from) != scan.from)
            node2 = parent;
        }
      for (; ; ) {
        let inner2 = node2.enter(pos2, side, mode);
        if (!inner2)
          return node2;
        node2 = inner2;
      }
    }
    class BaseNode {
      cursor(mode = 0) {
        return new TreeCursor(this, mode);
      }
      getChild(type, before = null, after = null) {
        let r2 = getChildren(this, type, before, after);
        return r2.length ? r2[0] : null;
      }
      getChildren(type, before = null, after = null) {
        return getChildren(this, type, before, after);
      }
      resolve(pos2, side = 0) {
        return resolveNode(this, pos2, side, false);
      }
      resolveInner(pos2, side = 0) {
        return resolveNode(this, pos2, side, true);
      }
      matchContext(context) {
        return matchNodeContext(this.parent, context);
      }
      enterUnfinishedNodesBefore(pos2) {
        let scan = this.childBefore(pos2), node2 = this;
        while (scan) {
          let last = scan.lastChild;
          if (!last || last.to != scan.to)
            break;
          if (last.type.isError && last.from == last.to) {
            node2 = scan;
            scan = last.prevSibling;
          } else {
            scan = last;
          }
        }
        return node2;
      }
      get node() {
        return this;
      }
      get next() {
        return this.parent;
      }
    }
    class TreeNode extends BaseNode {
      constructor(_tree, from, index, _parent) {
        super();
        this._tree = _tree;
        this.from = from;
        this.index = index;
        this._parent = _parent;
      }
      get type() {
        return this._tree.type;
      }
      get name() {
        return this._tree.type.name;
      }
      get to() {
        return this.from + this._tree.length;
      }
      nextChild(i2, dir, pos2, side, mode = 0) {
        for (let parent = this; ; ) {
          for (let { children: children2, positions } = parent._tree, e = dir > 0 ? children2.length : -1; i2 != e; i2 += dir) {
            let next = children2[i2], start2 = positions[i2] + parent.from;
            if (!checkSide(side, pos2, start2, start2 + next.length))
              continue;
            if (next instanceof TreeBuffer) {
              if (mode & IterMode$1.ExcludeBuffers)
                continue;
              let index = next.findChild(0, next.buffer.length, dir, pos2 - start2, side);
              if (index > -1)
                return new BufferNode(new BufferContext(parent, next, i2, start2), null, index);
            } else if (mode & IterMode$1.IncludeAnonymous || (!next.type.isAnonymous || hasChild(next))) {
              let mounted;
              if (!(mode & IterMode$1.IgnoreMounts) && (mounted = MountedTree.get(next)) && !mounted.overlay)
                return new TreeNode(mounted.tree, start2, i2, parent);
              let inner2 = new TreeNode(next, start2, i2, parent);
              return mode & IterMode$1.IncludeAnonymous || !inner2.type.isAnonymous ? inner2 : inner2.nextChild(dir < 0 ? next.children.length - 1 : 0, dir, pos2, side);
            }
          }
          if (mode & IterMode$1.IncludeAnonymous || !parent.type.isAnonymous)
            return null;
          if (parent.index >= 0)
            i2 = parent.index + dir;
          else
            i2 = dir < 0 ? -1 : parent._parent._tree.children.length;
          parent = parent._parent;
          if (!parent)
            return null;
        }
      }
      get firstChild() {
        return this.nextChild(
          0,
          1,
          0,
          4
          /* Side.DontCare */
        );
      }
      get lastChild() {
        return this.nextChild(
          this._tree.children.length - 1,
          -1,
          0,
          4
          /* Side.DontCare */
        );
      }
      childAfter(pos2) {
        return this.nextChild(
          0,
          1,
          pos2,
          2
          /* Side.After */
        );
      }
      childBefore(pos2) {
        return this.nextChild(
          this._tree.children.length - 1,
          -1,
          pos2,
          -2
          /* Side.Before */
        );
      }
      enter(pos2, side, mode = 0) {
        let mounted;
        if (!(mode & IterMode$1.IgnoreOverlays) && (mounted = MountedTree.get(this._tree)) && mounted.overlay) {
          let rPos = pos2 - this.from;
          for (let { from, to: to2 } of mounted.overlay) {
            if ((side > 0 ? from <= rPos : from < rPos) && (side < 0 ? to2 >= rPos : to2 > rPos))
              return new TreeNode(mounted.tree, mounted.overlay[0].from + this.from, -1, this);
          }
        }
        return this.nextChild(0, 1, pos2, side, mode);
      }
      nextSignificantParent() {
        let val = this;
        while (val.type.isAnonymous && val._parent)
          val = val._parent;
        return val;
      }
      get parent() {
        return this._parent ? this._parent.nextSignificantParent() : null;
      }
      get nextSibling() {
        return this._parent && this.index >= 0 ? this._parent.nextChild(
          this.index + 1,
          1,
          0,
          4
          /* Side.DontCare */
        ) : null;
      }
      get prevSibling() {
        return this._parent && this.index >= 0 ? this._parent.nextChild(
          this.index - 1,
          -1,
          0,
          4
          /* Side.DontCare */
        ) : null;
      }
      get tree() {
        return this._tree;
      }
      toTree() {
        return this._tree;
      }
      /**
      @internal
      */
      toString() {
        return this._tree.toString();
      }
    }
    function getChildren(node2, type, before, after) {
      let cur2 = node2.cursor(), result2 = [];
      if (!cur2.firstChild())
        return result2;
      if (before != null)
        for (let found = false; !found; ) {
          found = cur2.type.is(before);
          if (!cur2.nextSibling())
            return result2;
        }
      for (; ; ) {
        if (after != null && cur2.type.is(after))
          return result2;
        if (cur2.type.is(type))
          result2.push(cur2.node);
        if (!cur2.nextSibling())
          return after == null ? result2 : [];
      }
    }
    function matchNodeContext(node2, context, i2 = context.length - 1) {
      for (let p = node2; i2 >= 0; p = p.parent) {
        if (!p)
          return false;
        if (!p.type.isAnonymous) {
          if (context[i2] && context[i2] != p.name)
            return false;
          i2--;
        }
      }
      return true;
    }
    class BufferContext {
      constructor(parent, buffer2, index, start2) {
        this.parent = parent;
        this.buffer = buffer2;
        this.index = index;
        this.start = start2;
      }
    }
    class BufferNode extends BaseNode {
      get name() {
        return this.type.name;
      }
      get from() {
        return this.context.start + this.context.buffer.buffer[this.index + 1];
      }
      get to() {
        return this.context.start + this.context.buffer.buffer[this.index + 2];
      }
      constructor(context, _parent, index) {
        super();
        this.context = context;
        this._parent = _parent;
        this.index = index;
        this.type = context.buffer.set.types[context.buffer.buffer[index]];
      }
      child(dir, pos2, side) {
        let { buffer: buffer2 } = this.context;
        let index = buffer2.findChild(this.index + 4, buffer2.buffer[this.index + 3], dir, pos2 - this.context.start, side);
        return index < 0 ? null : new BufferNode(this.context, this, index);
      }
      get firstChild() {
        return this.child(
          1,
          0,
          4
          /* Side.DontCare */
        );
      }
      get lastChild() {
        return this.child(
          -1,
          0,
          4
          /* Side.DontCare */
        );
      }
      childAfter(pos2) {
        return this.child(
          1,
          pos2,
          2
          /* Side.After */
        );
      }
      childBefore(pos2) {
        return this.child(
          -1,
          pos2,
          -2
          /* Side.Before */
        );
      }
      enter(pos2, side, mode = 0) {
        if (mode & IterMode$1.ExcludeBuffers)
          return null;
        let { buffer: buffer2 } = this.context;
        let index = buffer2.findChild(this.index + 4, buffer2.buffer[this.index + 3], side > 0 ? 1 : -1, pos2 - this.context.start, side);
        return index < 0 ? null : new BufferNode(this.context, this, index);
      }
      get parent() {
        return this._parent || this.context.parent.nextSignificantParent();
      }
      externalSibling(dir) {
        return this._parent ? null : this.context.parent.nextChild(
          this.context.index + dir,
          dir,
          0,
          4
          /* Side.DontCare */
        );
      }
      get nextSibling() {
        let { buffer: buffer2 } = this.context;
        let after = buffer2.buffer[this.index + 3];
        if (after < (this._parent ? buffer2.buffer[this._parent.index + 3] : buffer2.buffer.length))
          return new BufferNode(this.context, this._parent, after);
        return this.externalSibling(1);
      }
      get prevSibling() {
        let { buffer: buffer2 } = this.context;
        let parentStart = this._parent ? this._parent.index + 4 : 0;
        if (this.index == parentStart)
          return this.externalSibling(-1);
        return new BufferNode(this.context, this._parent, buffer2.findChild(
          parentStart,
          this.index,
          -1,
          0,
          4
          /* Side.DontCare */
        ));
      }
      get tree() {
        return null;
      }
      toTree() {
        let children2 = [], positions = [];
        let { buffer: buffer2 } = this.context;
        let startI = this.index + 4, endI = buffer2.buffer[this.index + 3];
        if (endI > startI) {
          let from = buffer2.buffer[this.index + 1];
          children2.push(buffer2.slice(startI, endI, from));
          positions.push(0);
        }
        return new Tree(this.type, children2, positions, this.to - this.from);
      }
      /**
      @internal
      */
      toString() {
        return this.context.buffer.childString(this.index);
      }
    }
    function iterStack(heads) {
      if (!heads.length)
        return null;
      let pick = 0, picked = heads[0];
      for (let i2 = 1; i2 < heads.length; i2++) {
        let node2 = heads[i2];
        if (node2.from > picked.from || node2.to < picked.to) {
          picked = node2;
          pick = i2;
        }
      }
      let next = picked instanceof TreeNode && picked.index < 0 ? null : picked.parent;
      let newHeads = heads.slice();
      if (next)
        newHeads[pick] = next;
      else
        newHeads.splice(pick, 1);
      return new StackIterator(newHeads, picked);
    }
    class StackIterator {
      constructor(heads, node2) {
        this.heads = heads;
        this.node = node2;
      }
      get next() {
        return iterStack(this.heads);
      }
    }
    function stackIterator(tree, pos2, side) {
      let inner2 = tree.resolveInner(pos2, side), layers = null;
      for (let scan = inner2 instanceof TreeNode ? inner2 : inner2.context.parent; scan; scan = scan.parent) {
        if (scan.index < 0) {
          let parent = scan.parent;
          (layers || (layers = [inner2])).push(parent.resolve(pos2, side));
          scan = parent;
        } else {
          let mount2 = MountedTree.get(scan.tree);
          if (mount2 && mount2.overlay && mount2.overlay[0].from <= pos2 && mount2.overlay[mount2.overlay.length - 1].to >= pos2) {
            let root2 = new TreeNode(mount2.tree, mount2.overlay[0].from + scan.from, -1, scan);
            (layers || (layers = [inner2])).push(resolveNode(root2, pos2, side, false));
          }
        }
      }
      return layers ? iterStack(layers) : inner2;
    }
    class TreeCursor {
      /**
      Shorthand for `.type.name`.
      */
      get name() {
        return this.type.name;
      }
      /**
      @internal
      */
      constructor(node2, mode = 0) {
        this.mode = mode;
        this.buffer = null;
        this.stack = [];
        this.index = 0;
        this.bufferNode = null;
        if (node2 instanceof TreeNode) {
          this.yieldNode(node2);
        } else {
          this._tree = node2.context.parent;
          this.buffer = node2.context;
          for (let n = node2._parent; n; n = n._parent)
            this.stack.unshift(n.index);
          this.bufferNode = node2;
          this.yieldBuf(node2.index);
        }
      }
      yieldNode(node2) {
        if (!node2)
          return false;
        this._tree = node2;
        this.type = node2.type;
        this.from = node2.from;
        this.to = node2.to;
        return true;
      }
      yieldBuf(index, type) {
        this.index = index;
        let { start: start2, buffer: buffer2 } = this.buffer;
        this.type = type || buffer2.set.types[buffer2.buffer[index]];
        this.from = start2 + buffer2.buffer[index + 1];
        this.to = start2 + buffer2.buffer[index + 2];
        return true;
      }
      /**
      @internal
      */
      yield(node2) {
        if (!node2)
          return false;
        if (node2 instanceof TreeNode) {
          this.buffer = null;
          return this.yieldNode(node2);
        }
        this.buffer = node2.context;
        return this.yieldBuf(node2.index, node2.type);
      }
      /**
      @internal
      */
      toString() {
        return this.buffer ? this.buffer.buffer.childString(this.index) : this._tree.toString();
      }
      /**
      @internal
      */
      enterChild(dir, pos2, side) {
        if (!this.buffer)
          return this.yield(this._tree.nextChild(dir < 0 ? this._tree._tree.children.length - 1 : 0, dir, pos2, side, this.mode));
        let { buffer: buffer2 } = this.buffer;
        let index = buffer2.findChild(this.index + 4, buffer2.buffer[this.index + 3], dir, pos2 - this.buffer.start, side);
        if (index < 0)
          return false;
        this.stack.push(this.index);
        return this.yieldBuf(index);
      }
      /**
      Move the cursor to this node's first child. When this returns
      false, the node has no child, and the cursor has not been moved.
      */
      firstChild() {
        return this.enterChild(
          1,
          0,
          4
          /* Side.DontCare */
        );
      }
      /**
      Move the cursor to this node's last child.
      */
      lastChild() {
        return this.enterChild(
          -1,
          0,
          4
          /* Side.DontCare */
        );
      }
      /**
      Move the cursor to the first child that ends after `pos`.
      */
      childAfter(pos2) {
        return this.enterChild(
          1,
          pos2,
          2
          /* Side.After */
        );
      }
      /**
      Move to the last child that starts before `pos`.
      */
      childBefore(pos2) {
        return this.enterChild(
          -1,
          pos2,
          -2
          /* Side.Before */
        );
      }
      /**
      Move the cursor to the child around `pos`. If side is -1 the
      child may end at that position, when 1 it may start there. This
      will also enter [overlaid](#common.MountedTree.overlay)
      [mounted](#common.NodeProp^mounted) trees unless `overlays` is
      set to false.
      */
      enter(pos2, side, mode = this.mode) {
        if (!this.buffer)
          return this.yield(this._tree.enter(pos2, side, mode));
        return mode & IterMode$1.ExcludeBuffers ? false : this.enterChild(1, pos2, side);
      }
      /**
      Move to the node's parent node, if this isn't the top node.
      */
      parent() {
        if (!this.buffer)
          return this.yieldNode(this.mode & IterMode$1.IncludeAnonymous ? this._tree._parent : this._tree.parent);
        if (this.stack.length)
          return this.yieldBuf(this.stack.pop());
        let parent = this.mode & IterMode$1.IncludeAnonymous ? this.buffer.parent : this.buffer.parent.nextSignificantParent();
        this.buffer = null;
        return this.yieldNode(parent);
      }
      /**
      @internal
      */
      sibling(dir) {
        if (!this.buffer)
          return !this._tree._parent ? false : this.yield(this._tree.index < 0 ? null : this._tree._parent.nextChild(this._tree.index + dir, dir, 0, 4, this.mode));
        let { buffer: buffer2 } = this.buffer, d = this.stack.length - 1;
        if (dir < 0) {
          let parentStart = d < 0 ? 0 : this.stack[d] + 4;
          if (this.index != parentStart)
            return this.yieldBuf(buffer2.findChild(
              parentStart,
              this.index,
              -1,
              0,
              4
              /* Side.DontCare */
            ));
        } else {
          let after = buffer2.buffer[this.index + 3];
          if (after < (d < 0 ? buffer2.buffer.length : buffer2.buffer[this.stack[d] + 3]))
            return this.yieldBuf(after);
        }
        return d < 0 ? this.yield(this.buffer.parent.nextChild(this.buffer.index + dir, dir, 0, 4, this.mode)) : false;
      }
      /**
      Move to this node's next sibling, if any.
      */
      nextSibling() {
        return this.sibling(1);
      }
      /**
      Move to this node's previous sibling, if any.
      */
      prevSibling() {
        return this.sibling(-1);
      }
      atLastNode(dir) {
        let index, parent, { buffer: buffer2 } = this;
        if (buffer2) {
          if (dir > 0) {
            if (this.index < buffer2.buffer.buffer.length)
              return false;
          } else {
            for (let i2 = 0; i2 < this.index; i2++)
              if (buffer2.buffer.buffer[i2 + 3] < this.index)
                return false;
          }
          ({ index, parent } = buffer2);
        } else {
          ({ index, _parent: parent } = this._tree);
        }
        for (; parent; { index, _parent: parent } = parent) {
          if (index > -1)
            for (let i2 = index + dir, e = dir < 0 ? -1 : parent._tree.children.length; i2 != e; i2 += dir) {
              let child = parent._tree.children[i2];
              if (this.mode & IterMode$1.IncludeAnonymous || child instanceof TreeBuffer || !child.type.isAnonymous || hasChild(child))
                return false;
            }
        }
        return true;
      }
      move(dir, enter) {
        if (enter && this.enterChild(
          dir,
          0,
          4
          /* Side.DontCare */
        ))
          return true;
        for (; ; ) {
          if (this.sibling(dir))
            return true;
          if (this.atLastNode(dir) || !this.parent())
            return false;
        }
      }
      /**
      Move to the next node in a
      [pre-order](https://en.wikipedia.org/wiki/Tree_traversal#Pre-order,_NLR)
      traversal, going from a node to its first child or, if the
      current node is empty or `enter` is false, its next sibling or
      the next sibling of the first parent node that has one.
      */
      next(enter = true) {
        return this.move(1, enter);
      }
      /**
      Move to the next node in a last-to-first pre-order traversal. A
      node is followed by its last child or, if it has none, its
      previous sibling or the previous sibling of the first parent
      node that has one.
      */
      prev(enter = true) {
        return this.move(-1, enter);
      }
      /**
      Move the cursor to the innermost node that covers `pos`. If
      `side` is -1, it will enter nodes that end at `pos`. If it is 1,
      it will enter nodes that start at `pos`.
      */
      moveTo(pos2, side = 0) {
        while (this.from == this.to || (side < 1 ? this.from >= pos2 : this.from > pos2) || (side > -1 ? this.to <= pos2 : this.to < pos2))
          if (!this.parent())
            break;
        while (this.enterChild(1, pos2, side)) {
        }
        return this;
      }
      /**
      Get a [syntax node](#common.SyntaxNode) at the cursor's current
      position.
      */
      get node() {
        if (!this.buffer)
          return this._tree;
        let cache = this.bufferNode, result2 = null, depth = 0;
        if (cache && cache.context == this.buffer) {
          scan: for (let index = this.index, d = this.stack.length; d >= 0; ) {
            for (let c2 = cache; c2; c2 = c2._parent)
              if (c2.index == index) {
                if (index == this.index)
                  return c2;
                result2 = c2;
                depth = d + 1;
                break scan;
              }
            index = this.stack[--d];
          }
        }
        for (let i2 = depth; i2 < this.stack.length; i2++)
          result2 = new BufferNode(this.buffer, result2, this.stack[i2]);
        return this.bufferNode = new BufferNode(this.buffer, result2, this.index);
      }
      /**
      Get the [tree](#common.Tree) that represents the current node, if
      any. Will return null when the node is in a [tree
      buffer](#common.TreeBuffer).
      */
      get tree() {
        return this.buffer ? null : this._tree._tree;
      }
      /**
      Iterate over the current node and all its descendants, calling
      `enter` when entering a node and `leave`, if given, when leaving
      one. When `enter` returns `false`, any children of that node are
      skipped, and `leave` isn't called for it.
      */
      iterate(enter, leave) {
        for (let depth = 0; ; ) {
          let mustLeave = false;
          if (this.type.isAnonymous || enter(this) !== false) {
            if (this.firstChild()) {
              depth++;
              continue;
            }
            if (!this.type.isAnonymous)
              mustLeave = true;
          }
          for (; ; ) {
            if (mustLeave && leave)
              leave(this);
            mustLeave = this.type.isAnonymous;
            if (!depth)
              return;
            if (this.nextSibling())
              break;
            this.parent();
            depth--;
            mustLeave = true;
          }
        }
      }
      /**
      Test whether the current node matches a given context—a sequence
      of direct parent node names. Empty strings in the context array
      are treated as wildcards.
      */
      matchContext(context) {
        if (!this.buffer)
          return matchNodeContext(this.node.parent, context);
        let { buffer: buffer2 } = this.buffer, { types: types2 } = buffer2.set;
        for (let i2 = context.length - 1, d = this.stack.length - 1; i2 >= 0; d--) {
          if (d < 0)
            return matchNodeContext(this._tree, context, i2);
          let type = types2[buffer2.buffer[this.stack[d]]];
          if (!type.isAnonymous) {
            if (context[i2] && context[i2] != type.name)
              return false;
            i2--;
          }
        }
        return true;
      }
    }
    function hasChild(tree) {
      return tree.children.some((ch3) => ch3 instanceof TreeBuffer || !ch3.type.isAnonymous || hasChild(ch3));
    }
    function buildTree(data) {
      var _a2;
      let { buffer: buffer2, nodeSet: nodeSet2, maxBufferLength = DefaultBufferLength, reused = [], minRepeatType = nodeSet2.types.length } = data;
      let cursor = Array.isArray(buffer2) ? new FlatBufferCursor(buffer2, buffer2.length) : buffer2;
      let types2 = nodeSet2.types;
      let contextHash = 0, lookAhead = 0;
      function takeNode(parentStart, minPos, children3, positions2, inRepeat, depth) {
        let { id, start: start2, end: end2, size } = cursor;
        let lookAheadAtStart = lookAhead, contextAtStart = contextHash;
        while (size < 0) {
          cursor.next();
          if (size == -1) {
            let node3 = reused[id];
            children3.push(node3);
            positions2.push(start2 - parentStart);
            return;
          } else if (size == -3) {
            contextHash = id;
            return;
          } else if (size == -4) {
            lookAhead = id;
            return;
          } else {
            throw new RangeError(`Unrecognized record size: ${size}`);
          }
        }
        let type = types2[id], node2, buffer3;
        let startPos = start2 - parentStart;
        if (end2 - start2 <= maxBufferLength && (buffer3 = findBufferSize(cursor.pos - minPos, inRepeat))) {
          let data2 = new Uint16Array(buffer3.size - buffer3.skip);
          let endPos = cursor.pos - buffer3.size, index = data2.length;
          while (cursor.pos > endPos)
            index = copyToBuffer(buffer3.start, data2, index);
          node2 = new TreeBuffer(data2, end2 - buffer3.start, nodeSet2);
          startPos = buffer3.start - parentStart;
        } else {
          let endPos = cursor.pos - size;
          cursor.next();
          let localChildren = [], localPositions = [];
          let localInRepeat = id >= minRepeatType ? id : -1;
          let lastGroup = 0, lastEnd = end2;
          while (cursor.pos > endPos) {
            if (localInRepeat >= 0 && cursor.id == localInRepeat && cursor.size >= 0) {
              if (cursor.end <= lastEnd - maxBufferLength) {
                makeRepeatLeaf(localChildren, localPositions, start2, lastGroup, cursor.end, lastEnd, localInRepeat, lookAheadAtStart, contextAtStart);
                lastGroup = localChildren.length;
                lastEnd = cursor.end;
              }
              cursor.next();
            } else if (depth > 2500) {
              takeFlatNode(start2, endPos, localChildren, localPositions);
            } else {
              takeNode(start2, endPos, localChildren, localPositions, localInRepeat, depth + 1);
            }
          }
          if (localInRepeat >= 0 && lastGroup > 0 && lastGroup < localChildren.length)
            makeRepeatLeaf(localChildren, localPositions, start2, lastGroup, start2, lastEnd, localInRepeat, lookAheadAtStart, contextAtStart);
          localChildren.reverse();
          localPositions.reverse();
          if (localInRepeat > -1 && lastGroup > 0) {
            let make = makeBalanced(type, contextAtStart);
            node2 = balanceRange(type, localChildren, localPositions, 0, localChildren.length, 0, end2 - start2, make, make);
          } else {
            node2 = makeTree(type, localChildren, localPositions, end2 - start2, lookAheadAtStart - end2, contextAtStart);
          }
        }
        children3.push(node2);
        positions2.push(startPos);
      }
      function takeFlatNode(parentStart, minPos, children3, positions2) {
        let nodes = [];
        let nodeCount = 0, stopAt = -1;
        while (cursor.pos > minPos) {
          let { id, start: start2, end: end2, size } = cursor;
          if (size > 4) {
            cursor.next();
          } else if (stopAt > -1 && start2 < stopAt) {
            break;
          } else {
            if (stopAt < 0)
              stopAt = end2 - maxBufferLength;
            nodes.push(id, start2, end2);
            nodeCount++;
            cursor.next();
          }
        }
        if (nodeCount) {
          let buffer3 = new Uint16Array(nodeCount * 4);
          let start2 = nodes[nodes.length - 2];
          for (let i2 = nodes.length - 3, j = 0; i2 >= 0; i2 -= 3) {
            buffer3[j++] = nodes[i2];
            buffer3[j++] = nodes[i2 + 1] - start2;
            buffer3[j++] = nodes[i2 + 2] - start2;
            buffer3[j++] = j;
          }
          children3.push(new TreeBuffer(buffer3, nodes[2] - start2, nodeSet2));
          positions2.push(start2 - parentStart);
        }
      }
      function makeBalanced(type, contextHash2) {
        return (children3, positions2, length2) => {
          let lookAhead2 = 0, lastI = children3.length - 1, last, lookAheadProp;
          if (lastI >= 0 && (last = children3[lastI]) instanceof Tree) {
            if (!lastI && last.type == type && last.length == length2)
              return last;
            if (lookAheadProp = last.prop(NodeProp$1.lookAhead))
              lookAhead2 = positions2[lastI] + last.length + lookAheadProp;
          }
          return makeTree(type, children3, positions2, length2, lookAhead2, contextHash2);
        };
      }
      function makeRepeatLeaf(children3, positions2, base2, i2, from, to2, type, lookAhead2, contextHash2) {
        let localChildren = [], localPositions = [];
        while (children3.length > i2) {
          localChildren.push(children3.pop());
          localPositions.push(positions2.pop() + base2 - from);
        }
        children3.push(makeTree(nodeSet2.types[type], localChildren, localPositions, to2 - from, lookAhead2 - to2, contextHash2));
        positions2.push(from - base2);
      }
      function makeTree(type, children3, positions2, length2, lookAhead2, contextHash2, props) {
        if (contextHash2) {
          let pair = [NodeProp$1.contextHash, contextHash2];
          props = props ? [pair].concat(props) : [pair];
        }
        if (lookAhead2 > 25) {
          let pair = [NodeProp$1.lookAhead, lookAhead2];
          props = props ? [pair].concat(props) : [pair];
        }
        return new Tree(type, children3, positions2, length2, props);
      }
      function findBufferSize(maxSize, inRepeat) {
        let fork2 = cursor.fork();
        let size = 0, start2 = 0, skip = 0, minStart = fork2.end - maxBufferLength;
        let result2 = { size: 0, start: 0, skip: 0 };
        scan: for (let minPos = fork2.pos - maxSize; fork2.pos > minPos; ) {
          let nodeSize2 = fork2.size;
          if (fork2.id == inRepeat && nodeSize2 >= 0) {
            result2.size = size;
            result2.start = start2;
            result2.skip = skip;
            skip += 4;
            size += 4;
            fork2.next();
            continue;
          }
          let startPos = fork2.pos - nodeSize2;
          if (nodeSize2 < 0 || startPos < minPos || fork2.start < minStart)
            break;
          let localSkipped = fork2.id >= minRepeatType ? 4 : 0;
          let nodeStart = fork2.start;
          fork2.next();
          while (fork2.pos > startPos) {
            if (fork2.size < 0) {
              if (fork2.size == -3)
                localSkipped += 4;
              else
                break scan;
            } else if (fork2.id >= minRepeatType) {
              localSkipped += 4;
            }
            fork2.next();
          }
          start2 = nodeStart;
          size += nodeSize2;
          skip += localSkipped;
        }
        if (inRepeat < 0 || size == maxSize) {
          result2.size = size;
          result2.start = start2;
          result2.skip = skip;
        }
        return result2.size > 4 ? result2 : void 0;
      }
      function copyToBuffer(bufferStart, buffer3, index) {
        let { id, start: start2, end: end2, size } = cursor;
        cursor.next();
        if (size >= 0 && id < minRepeatType) {
          let startIndex = index;
          if (size > 4) {
            let endPos = cursor.pos - (size - 4);
            while (cursor.pos > endPos)
              index = copyToBuffer(bufferStart, buffer3, index);
          }
          buffer3[--index] = startIndex;
          buffer3[--index] = end2 - bufferStart;
          buffer3[--index] = start2 - bufferStart;
          buffer3[--index] = id;
        } else if (size == -3) {
          contextHash = id;
        } else if (size == -4) {
          lookAhead = id;
        }
        return index;
      }
      let children2 = [], positions = [];
      while (cursor.pos > 0)
        takeNode(data.start || 0, data.bufferStart || 0, children2, positions, -1, 0);
      let length = (_a2 = data.length) !== null && _a2 !== void 0 ? _a2 : children2.length ? positions[0] + children2[0].length : 0;
      return new Tree(types2[data.topID], children2.reverse(), positions.reverse(), length);
    }
    const nodeSizeCache = /* @__PURE__ */ new WeakMap();
    function nodeSize(balanceType, node2) {
      if (!balanceType.isAnonymous || node2 instanceof TreeBuffer || node2.type != balanceType)
        return 1;
      let size = nodeSizeCache.get(node2);
      if (size == null) {
        size = 1;
        for (let child of node2.children) {
          if (child.type != balanceType || !(child instanceof Tree)) {
            size = 1;
            break;
          }
          size += nodeSize(balanceType, child);
        }
        nodeSizeCache.set(node2, size);
      }
      return size;
    }
    function balanceRange(balanceType, children2, positions, from, to2, start2, length, mkTop, mkTree) {
      let total = 0;
      for (let i2 = from; i2 < to2; i2++)
        total += nodeSize(balanceType, children2[i2]);
      let maxChild = Math.ceil(
        total * 1.5 / 8
        /* Balance.BranchFactor */
      );
      let localChildren = [], localPositions = [];
      function divide2(children3, positions2, from2, to3, offset2) {
        for (let i2 = from2; i2 < to3; ) {
          let groupFrom = i2, groupStart = positions2[i2], groupSize = nodeSize(balanceType, children3[i2]);
          i2++;
          for (; i2 < to3; i2++) {
            let nextSize = nodeSize(balanceType, children3[i2]);
            if (groupSize + nextSize >= maxChild)
              break;
            groupSize += nextSize;
          }
          if (i2 == groupFrom + 1) {
            if (groupSize > maxChild) {
              let only = children3[groupFrom];
              divide2(only.children, only.positions, 0, only.children.length, positions2[groupFrom] + offset2);
              continue;
            }
            localChildren.push(children3[groupFrom]);
          } else {
            let length2 = positions2[i2 - 1] + children3[i2 - 1].length - groupStart;
            localChildren.push(balanceRange(balanceType, children3, positions2, groupFrom, i2, groupStart, length2, null, mkTree));
          }
          localPositions.push(groupStart + offset2 - start2);
        }
      }
      divide2(children2, positions, from, to2, 0);
      return (mkTop || mkTree)(localChildren, localPositions, length);
    }
    class TreeFragment {
      /**
      Construct a tree fragment. You'll usually want to use
      [`addTree`](#common.TreeFragment^addTree) and
      [`applyChanges`](#common.TreeFragment^applyChanges) instead of
      calling this directly.
      */
      constructor(from, to2, tree, offset2, openStart = false, openEnd = false) {
        this.from = from;
        this.to = to2;
        this.tree = tree;
        this.offset = offset2;
        this.open = (openStart ? 1 : 0) | (openEnd ? 2 : 0);
      }
      /**
      Whether the start of the fragment represents the start of a
      parse, or the end of a change. (In the second case, it may not
      be safe to reuse some nodes at the start, depending on the
      parsing algorithm.)
      */
      get openStart() {
        return (this.open & 1) > 0;
      }
      /**
      Whether the end of the fragment represents the end of a
      full-document parse, or the start of a change.
      */
      get openEnd() {
        return (this.open & 2) > 0;
      }
      /**
      Create a set of fragments from a freshly parsed tree, or update
      an existing set of fragments by replacing the ones that overlap
      with a tree with content from the new tree. When `partial` is
      true, the parse is treated as incomplete, and the resulting
      fragment has [`openEnd`](#common.TreeFragment.openEnd) set to
      true.
      */
      static addTree(tree, fragments = [], partial = false) {
        let result2 = [new TreeFragment(0, tree.length, tree, 0, false, partial)];
        for (let f of fragments)
          if (f.to > tree.length)
            result2.push(f);
        return result2;
      }
      /**
      Apply a set of edits to an array of fragments, removing or
      splitting fragments as necessary to remove edited ranges, and
      adjusting offsets for fragments that moved.
      */
      static applyChanges(fragments, changes, minGap = 128) {
        if (!changes.length)
          return fragments;
        let result2 = [];
        let fI = 1, nextF = fragments.length ? fragments[0] : null;
        for (let cI = 0, pos2 = 0, off = 0; ; cI++) {
          let nextC = cI < changes.length ? changes[cI] : null;
          let nextPos = nextC ? nextC.fromA : 1e9;
          if (nextPos - pos2 >= minGap)
            while (nextF && nextF.from < nextPos) {
              let cut = nextF;
              if (pos2 >= cut.from || nextPos <= cut.to || off) {
                let fFrom = Math.max(cut.from, pos2) - off, fTo = Math.min(cut.to, nextPos) - off;
                cut = fFrom >= fTo ? null : new TreeFragment(fFrom, fTo, cut.tree, cut.offset + off, cI > 0, !!nextC);
              }
              if (cut)
                result2.push(cut);
              if (nextF.to > nextPos)
                break;
              nextF = fI < fragments.length ? fragments[fI++] : null;
            }
          if (!nextC)
            break;
          pos2 = nextC.toA;
          off = nextC.toA - nextC.toB;
        }
        return result2;
      }
    }
    class Parser {
      /**
      Start a parse, returning a [partial parse](#common.PartialParse)
      object. [`fragments`](#common.TreeFragment) can be passed in to
      make the parse incremental.
      
      By default, the entire input is parsed. You can pass `ranges`,
      which should be a sorted array of non-empty, non-overlapping
      ranges, to parse only those ranges. The tree returned in that
      case will start at `ranges[0].from`.
      */
      startParse(input2, fragments, ranges) {
        if (typeof input2 == "string")
          input2 = new StringInput(input2);
        ranges = !ranges ? [new Range(0, input2.length)] : ranges.length ? ranges.map((r2) => new Range(r2.from, r2.to)) : [new Range(0, 0)];
        return this.createParse(input2, fragments || [], ranges);
      }
      /**
      Run a full parse, returning the resulting tree.
      */
      parse(input2, fragments, ranges) {
        let parse2 = this.startParse(input2, fragments, ranges);
        for (; ; ) {
          let done = parse2.advance();
          if (done)
            return done;
        }
      }
    }
    class StringInput {
      constructor(string2) {
        this.string = string2;
      }
      get length() {
        return this.string.length;
      }
      chunk(from) {
        return this.string.slice(from);
      }
      get lineChunks() {
        return false;
      }
      read(from, to2) {
        return this.string.slice(from, to2);
      }
    }
    new NodeProp$1({ perNode: true });
    let nextTagID$4 = 0;
    let Tag$4 = class Tag2 {
      /**
      @internal
      */
      constructor(name2, set2, base2, modified) {
        this.name = name2;
        this.set = set2;
        this.base = base2;
        this.modified = modified;
        this.id = nextTagID$4++;
      }
      toString() {
        let { name: name2 } = this;
        for (let mod2 of this.modified)
          if (mod2.name)
            name2 = `${mod2.name}(${name2})`;
        return name2;
      }
      static define(nameOrParent, parent) {
        let name2 = typeof nameOrParent == "string" ? nameOrParent : "?";
        if (nameOrParent instanceof Tag2)
          parent = nameOrParent;
        if (parent === null || parent === void 0 ? void 0 : parent.base)
          throw new Error("Can not derive from a modified tag");
        let tag = new Tag2(name2, [], null, []);
        tag.set.push(tag);
        if (parent)
          for (let t2 of parent.set)
            tag.set.push(t2);
        return tag;
      }
      /**
      Define a tag _modifier_, which is a function that, given a tag,
      will return a tag that is a subtag of the original. Applying the
      same modifier to a twice tag will return the same value (`m1(t1)
      == m1(t1)`) and applying multiple modifiers will, regardless or
      order, produce the same tag (`m1(m2(t1)) == m2(m1(t1))`).
      
      When multiple modifiers are applied to a given base tag, each
      smaller set of modifiers is registered as a parent, so that for
      example `m1(m2(m3(t1)))` is a subtype of `m1(m2(t1))`,
      `m1(m3(t1)`, and so on.
      */
      static defineModifier(name2) {
        let mod2 = new Modifier$4(name2);
        return (tag) => {
          if (tag.modified.indexOf(mod2) > -1)
            return tag;
          return Modifier$4.get(tag.base || tag, tag.modified.concat(mod2).sort((a, b) => a.id - b.id));
        };
      }
    };
    let nextModifierID$4 = 0;
    let Modifier$4 = class Modifier2 {
      constructor(name2) {
        this.name = name2;
        this.instances = [];
        this.id = nextModifierID$4++;
      }
      static get(base2, mods) {
        if (!mods.length)
          return base2;
        let exists = mods[0].instances.find((t2) => t2.base == base2 && sameArray$4(mods, t2.modified));
        if (exists)
          return exists;
        let set2 = [], tag = new Tag$4(base2.name, set2, base2, mods);
        for (let m of mods)
          m.instances.push(tag);
        let configs = powerSet$4(mods);
        for (let parent of base2.set)
          if (!parent.modified.length)
            for (let config2 of configs)
              set2.push(Modifier2.get(parent, config2));
        return tag;
      }
    };
    function sameArray$4(a, b) {
      return a.length == b.length && a.every((x2, i2) => x2 == b[i2]);
    }
    function powerSet$4(array) {
      let sets = [[]];
      for (let i2 = 0; i2 < array.length; i2++) {
        for (let j = 0, e = sets.length; j < e; j++) {
          sets.push(sets[j].concat(array[i2]));
        }
      }
      return sets.sort((a, b) => b.length - a.length);
    }
    function styleTags$3(spec) {
      let byName = /* @__PURE__ */ Object.create(null);
      for (let prop2 in spec) {
        let tags2 = spec[prop2];
        if (!Array.isArray(tags2))
          tags2 = [tags2];
        for (let part2 of prop2.split(" "))
          if (part2) {
            let pieces = [], mode = 2, rest = part2;
            for (let pos2 = 0; ; ) {
              if (rest == "..." && pos2 > 0 && pos2 + 3 == part2.length) {
                mode = 1;
                break;
              }
              let m = /^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(rest);
              if (!m)
                throw new RangeError("Invalid path: " + part2);
              pieces.push(m[0] == "*" ? "" : m[0][0] == '"' ? JSON.parse(m[0]) : m[0]);
              pos2 += m[0].length;
              if (pos2 == part2.length)
                break;
              let next = part2[pos2++];
              if (pos2 == part2.length && next == "!") {
                mode = 0;
                break;
              }
              if (next != "/")
                throw new RangeError("Invalid path: " + part2);
              rest = part2.slice(pos2);
            }
            let last = pieces.length - 1, inner2 = pieces[last];
            if (!inner2)
              throw new RangeError("Invalid path: " + part2);
            let rule = new Rule$4(tags2, mode, last > 0 ? pieces.slice(0, last) : null);
            byName[inner2] = rule.sort(byName[inner2]);
          }
      }
      return ruleNodeProp$3.add(byName);
    }
    const ruleNodeProp$3 = new NodeProp$1();
    let Rule$4 = class Rule {
      constructor(tags2, mode, context, next) {
        this.tags = tags2;
        this.mode = mode;
        this.context = context;
        this.next = next;
      }
      get opaque() {
        return this.mode == 0;
      }
      get inherit() {
        return this.mode == 1;
      }
      sort(other) {
        if (!other || other.depth < this.depth) {
          this.next = other;
          return this;
        }
        other.next = this.sort(other.next);
        return other;
      }
      get depth() {
        return this.context ? this.context.length : 0;
      }
    };
    Rule$4.empty = new Rule$4([], 2, null);
    function tagHighlighter$4(tags2, options2) {
      let map2 = /* @__PURE__ */ Object.create(null);
      for (let style2 of tags2) {
        if (!Array.isArray(style2.tag))
          map2[style2.tag.id] = style2.class;
        else
          for (let tag of style2.tag)
            map2[tag.id] = style2.class;
      }
      let { scope, all: all2 = null } = {};
      return {
        style: (tags3) => {
          let cls = all2;
          for (let tag of tags3) {
            for (let sub2 of tag.set) {
              let tagClass = map2[sub2.id];
              if (tagClass) {
                cls = cls ? cls + " " + tagClass : tagClass;
                break;
              }
            }
          }
          return cls;
        },
        scope
      };
    }
    const t$4 = Tag$4.define;
    const comment$4 = t$4(), name$4 = t$4(), typeName$4 = t$4(name$4), propertyName$4 = t$4(name$4), literal$4 = t$4(), string$4 = t$4(literal$4), number$4 = t$4(literal$4), content$4 = t$4(), heading$4 = t$4(content$4), keyword$4 = t$4(), operator$4 = t$4(), punctuation$4 = t$4(), bracket$4 = t$4(punctuation$4), meta$4 = t$4();
    const tags$4 = {
      /**
      A comment.
      */
      comment: comment$4,
      /**
      A line [comment](#highlight.tags.comment).
      */
      lineComment: t$4(comment$4),
      /**
      A block [comment](#highlight.tags.comment).
      */
      blockComment: t$4(comment$4),
      /**
      A documentation [comment](#highlight.tags.comment).
      */
      docComment: t$4(comment$4),
      /**
      Any kind of identifier.
      */
      name: name$4,
      /**
      The [name](#highlight.tags.name) of a variable.
      */
      variableName: t$4(name$4),
      /**
      A type [name](#highlight.tags.name).
      */
      typeName: typeName$4,
      /**
      A tag name (subtag of [`typeName`](#highlight.tags.typeName)).
      */
      tagName: t$4(typeName$4),
      /**
      A property or field [name](#highlight.tags.name).
      */
      propertyName: propertyName$4,
      /**
      An attribute name (subtag of [`propertyName`](#highlight.tags.propertyName)).
      */
      attributeName: t$4(propertyName$4),
      /**
      The [name](#highlight.tags.name) of a class.
      */
      className: t$4(name$4),
      /**
      A label [name](#highlight.tags.name).
      */
      labelName: t$4(name$4),
      /**
      A namespace [name](#highlight.tags.name).
      */
      namespace: t$4(name$4),
      /**
      The [name](#highlight.tags.name) of a macro.
      */
      macroName: t$4(name$4),
      /**
      A literal value.
      */
      literal: literal$4,
      /**
      A string [literal](#highlight.tags.literal).
      */
      string: string$4,
      /**
      A documentation [string](#highlight.tags.string).
      */
      docString: t$4(string$4),
      /**
      A character literal (subtag of [string](#highlight.tags.string)).
      */
      character: t$4(string$4),
      /**
      An attribute value (subtag of [string](#highlight.tags.string)).
      */
      attributeValue: t$4(string$4),
      /**
      A number [literal](#highlight.tags.literal).
      */
      number: number$4,
      /**
      An integer [number](#highlight.tags.number) literal.
      */
      integer: t$4(number$4),
      /**
      A floating-point [number](#highlight.tags.number) literal.
      */
      float: t$4(number$4),
      /**
      A boolean [literal](#highlight.tags.literal).
      */
      bool: t$4(literal$4),
      /**
      Regular expression [literal](#highlight.tags.literal).
      */
      regexp: t$4(literal$4),
      /**
      An escape [literal](#highlight.tags.literal), for example a
      backslash escape in a string.
      */
      escape: t$4(literal$4),
      /**
      A color [literal](#highlight.tags.literal).
      */
      color: t$4(literal$4),
      /**
      A URL [literal](#highlight.tags.literal).
      */
      url: t$4(literal$4),
      /**
      A language keyword.
      */
      keyword: keyword$4,
      /**
      The [keyword](#highlight.tags.keyword) for the self or this
      object.
      */
      self: t$4(keyword$4),
      /**
      The [keyword](#highlight.tags.keyword) for null.
      */
      null: t$4(keyword$4),
      /**
      A [keyword](#highlight.tags.keyword) denoting some atomic value.
      */
      atom: t$4(keyword$4),
      /**
      A [keyword](#highlight.tags.keyword) that represents a unit.
      */
      unit: t$4(keyword$4),
      /**
      A modifier [keyword](#highlight.tags.keyword).
      */
      modifier: t$4(keyword$4),
      /**
      A [keyword](#highlight.tags.keyword) that acts as an operator.
      */
      operatorKeyword: t$4(keyword$4),
      /**
      A control-flow related [keyword](#highlight.tags.keyword).
      */
      controlKeyword: t$4(keyword$4),
      /**
      A [keyword](#highlight.tags.keyword) that defines something.
      */
      definitionKeyword: t$4(keyword$4),
      /**
      A [keyword](#highlight.tags.keyword) related to defining or
      interfacing with modules.
      */
      moduleKeyword: t$4(keyword$4),
      /**
      An operator.
      */
      operator: operator$4,
      /**
      An [operator](#highlight.tags.operator) that dereferences something.
      */
      derefOperator: t$4(operator$4),
      /**
      Arithmetic-related [operator](#highlight.tags.operator).
      */
      arithmeticOperator: t$4(operator$4),
      /**
      Logical [operator](#highlight.tags.operator).
      */
      logicOperator: t$4(operator$4),
      /**
      Bit [operator](#highlight.tags.operator).
      */
      bitwiseOperator: t$4(operator$4),
      /**
      Comparison [operator](#highlight.tags.operator).
      */
      compareOperator: t$4(operator$4),
      /**
      [Operator](#highlight.tags.operator) that updates its operand.
      */
      updateOperator: t$4(operator$4),
      /**
      [Operator](#highlight.tags.operator) that defines something.
      */
      definitionOperator: t$4(operator$4),
      /**
      Type-related [operator](#highlight.tags.operator).
      */
      typeOperator: t$4(operator$4),
      /**
      Control-flow [operator](#highlight.tags.operator).
      */
      controlOperator: t$4(operator$4),
      /**
      Program or markup punctuation.
      */
      punctuation: punctuation$4,
      /**
      [Punctuation](#highlight.tags.punctuation) that separates
      things.
      */
      separator: t$4(punctuation$4),
      /**
      Bracket-style [punctuation](#highlight.tags.punctuation).
      */
      bracket: bracket$4,
      /**
      Angle [brackets](#highlight.tags.bracket) (usually `<` and `>`
      tokens).
      */
      angleBracket: t$4(bracket$4),
      /**
      Square [brackets](#highlight.tags.bracket) (usually `[` and `]`
      tokens).
      */
      squareBracket: t$4(bracket$4),
      /**
      Parentheses (usually `(` and `)` tokens). Subtag of
      [bracket](#highlight.tags.bracket).
      */
      paren: t$4(bracket$4),
      /**
      Braces (usually `{` and `}` tokens). Subtag of
      [bracket](#highlight.tags.bracket).
      */
      brace: t$4(bracket$4),
      /**
      Content, for example plain text in XML or markup documents.
      */
      content: content$4,
      /**
      [Content](#highlight.tags.content) that represents a heading.
      */
      heading: heading$4,
      /**
      A level 1 [heading](#highlight.tags.heading).
      */
      heading1: t$4(heading$4),
      /**
      A level 2 [heading](#highlight.tags.heading).
      */
      heading2: t$4(heading$4),
      /**
      A level 3 [heading](#highlight.tags.heading).
      */
      heading3: t$4(heading$4),
      /**
      A level 4 [heading](#highlight.tags.heading).
      */
      heading4: t$4(heading$4),
      /**
      A level 5 [heading](#highlight.tags.heading).
      */
      heading5: t$4(heading$4),
      /**
      A level 6 [heading](#highlight.tags.heading).
      */
      heading6: t$4(heading$4),
      /**
      A prose [content](#highlight.tags.content) separator (such as a horizontal rule).
      */
      contentSeparator: t$4(content$4),
      /**
      [Content](#highlight.tags.content) that represents a list.
      */
      list: t$4(content$4),
      /**
      [Content](#highlight.tags.content) that represents a quote.
      */
      quote: t$4(content$4),
      /**
      [Content](#highlight.tags.content) that is emphasized.
      */
      emphasis: t$4(content$4),
      /**
      [Content](#highlight.tags.content) that is styled strong.
      */
      strong: t$4(content$4),
      /**
      [Content](#highlight.tags.content) that is part of a link.
      */
      link: t$4(content$4),
      /**
      [Content](#highlight.tags.content) that is styled as code or
      monospace.
      */
      monospace: t$4(content$4),
      /**
      [Content](#highlight.tags.content) that has a strike-through
      style.
      */
      strikethrough: t$4(content$4),
      /**
      Inserted text in a change-tracking format.
      */
      inserted: t$4(),
      /**
      Deleted text.
      */
      deleted: t$4(),
      /**
      Changed text.
      */
      changed: t$4(),
      /**
      An invalid or unsyntactic element.
      */
      invalid: t$4(),
      /**
      Metadata or meta-instruction.
      */
      meta: meta$4,
      /**
      [Metadata](#highlight.tags.meta) that applies to the entire
      document.
      */
      documentMeta: t$4(meta$4),
      /**
      [Metadata](#highlight.tags.meta) that annotates or adds
      attributes to a given syntactic element.
      */
      annotation: t$4(meta$4),
      /**
      Processing instruction or preprocessor directive. Subtag of
      [meta](#highlight.tags.meta).
      */
      processingInstruction: t$4(meta$4),
      /**
      [Modifier](#highlight.Tag^defineModifier) that indicates that a
      given element is being defined. Expected to be used with the
      various [name](#highlight.tags.name) tags.
      */
      definition: Tag$4.defineModifier("definition"),
      /**
      [Modifier](#highlight.Tag^defineModifier) that indicates that
      something is constant. Mostly expected to be used with
      [variable names](#highlight.tags.variableName).
      */
      constant: Tag$4.defineModifier("constant"),
      /**
      [Modifier](#highlight.Tag^defineModifier) used to indicate that
      a [variable](#highlight.tags.variableName) or [property
      name](#highlight.tags.propertyName) is being called or defined
      as a function.
      */
      function: Tag$4.defineModifier("function"),
      /**
      [Modifier](#highlight.Tag^defineModifier) that can be applied to
      [names](#highlight.tags.name) to indicate that they belong to
      the language's standard environment.
      */
      standard: Tag$4.defineModifier("standard"),
      /**
      [Modifier](#highlight.Tag^defineModifier) that indicates a given
      [names](#highlight.tags.name) is local to some scope.
      */
      local: Tag$4.defineModifier("local"),
      /**
      A generic variant [modifier](#highlight.Tag^defineModifier) that
      can be used to tag language-specific alternative variants of
      some common tag. It is recommended for themes to define special
      forms of at least the [string](#highlight.tags.string) and
      [variable name](#highlight.tags.variableName) tags, since those
      come up a lot.
      */
      special: Tag$4.defineModifier("special")
    };
    for (let name2 in tags$4) {
      let val = tags$4[name2];
      if (val instanceof Tag$4)
        val.name = name2;
    }
    tagHighlighter$4([
      { tag: tags$4.link, class: "tok-link" },
      { tag: tags$4.heading, class: "tok-heading" },
      { tag: tags$4.emphasis, class: "tok-emphasis" },
      { tag: tags$4.strong, class: "tok-strong" },
      { tag: tags$4.keyword, class: "tok-keyword" },
      { tag: tags$4.atom, class: "tok-atom" },
      { tag: tags$4.bool, class: "tok-bool" },
      { tag: tags$4.url, class: "tok-url" },
      { tag: tags$4.labelName, class: "tok-labelName" },
      { tag: tags$4.inserted, class: "tok-inserted" },
      { tag: tags$4.deleted, class: "tok-deleted" },
      { tag: tags$4.literal, class: "tok-literal" },
      { tag: tags$4.string, class: "tok-string" },
      { tag: tags$4.number, class: "tok-number" },
      { tag: [tags$4.regexp, tags$4.escape, tags$4.special(tags$4.string)], class: "tok-string2" },
      { tag: tags$4.variableName, class: "tok-variableName" },
      { tag: tags$4.local(tags$4.variableName), class: "tok-variableName tok-local" },
      { tag: tags$4.definition(tags$4.variableName), class: "tok-variableName tok-definition" },
      { tag: tags$4.special(tags$4.variableName), class: "tok-variableName2" },
      { tag: tags$4.definition(tags$4.propertyName), class: "tok-propertyName tok-definition" },
      { tag: tags$4.typeName, class: "tok-typeName" },
      { tag: tags$4.namespace, class: "tok-namespace" },
      { tag: tags$4.className, class: "tok-className" },
      { tag: tags$4.macroName, class: "tok-macroName" },
      { tag: tags$4.propertyName, class: "tok-propertyName" },
      { tag: tags$4.operator, class: "tok-operator" },
      { tag: tags$4.comment, class: "tok-comment" },
      { tag: tags$4.meta, class: "tok-meta" },
      { tag: tags$4.invalid, class: "tok-invalid" },
      { tag: tags$4.punctuation, class: "tok-punctuation" }
    ]);
    var _a$3;
    const languageDataProp$3 = /* @__PURE__ */ new NodeProp$1();
    const sublanguageProp$3 = /* @__PURE__ */ new NodeProp$1();
    let Language$3 = class Language {
      /**
      Construct a language object. If you need to invoke this
      directly, first define a data facet with
      [`defineLanguageFacet`](https://codemirror.net/6/docs/ref/#language.defineLanguageFacet), and then
      configure your parser to [attach](https://codemirror.net/6/docs/ref/#language.languageDataProp) it
      to the language's outer syntax node.
      */
      constructor(data, parser2, extraExtensions = [], name2 = "") {
        this.data = data;
        this.name = name2;
        if (!EditorState.prototype.hasOwnProperty("tree"))
          Object.defineProperty(EditorState.prototype, "tree", { get() {
            return syntaxTree$3(this);
          } });
        this.parser = parser2;
        this.extension = [
          language$4.of(this),
          EditorState.languageData.of((state, pos2, side) => {
            let top2 = topNodeAt$3(state, pos2, side), data2 = top2.type.prop(languageDataProp$3);
            if (!data2)
              return [];
            let base2 = state.facet(data2), sub2 = top2.type.prop(sublanguageProp$3);
            if (sub2) {
              let innerNode = top2.resolve(pos2 - top2.from, side);
              for (let sublang of sub2)
                if (sublang.test(innerNode, state)) {
                  let data3 = state.facet(sublang.facet);
                  return sublang.type == "replace" ? data3 : data3.concat(base2);
                }
            }
            return base2;
          })
        ].concat(extraExtensions);
      }
      /**
      Query whether this language is active at the given position.
      */
      isActiveAt(state, pos2, side = -1) {
        return topNodeAt$3(state, pos2, side).type.prop(languageDataProp$3) == this.data;
      }
      /**
      Find the document regions that were parsed using this language.
      The returned regions will _include_ any nested languages rooted
      in this language, when those exist.
      */
      findRegions(state) {
        let lang2 = state.facet(language$4);
        if ((lang2 === null || lang2 === void 0 ? void 0 : lang2.data) == this.data)
          return [{ from: 0, to: state.doc.length }];
        if (!lang2 || !lang2.allowsNesting)
          return [];
        let result2 = [];
        let explore = (tree, from) => {
          if (tree.prop(languageDataProp$3) == this.data) {
            result2.push({ from, to: from + tree.length });
            return;
          }
          let mount2 = tree.prop(NodeProp$1.mounted);
          if (mount2) {
            if (mount2.tree.prop(languageDataProp$3) == this.data) {
              if (mount2.overlay)
                for (let r2 of mount2.overlay)
                  result2.push({ from: r2.from + from, to: r2.to + from });
              else
                result2.push({ from, to: from + tree.length });
              return;
            } else if (mount2.overlay) {
              let size = result2.length;
              explore(mount2.tree, mount2.overlay[0].from + from);
              if (result2.length > size)
                return;
            }
          }
          for (let i2 = 0; i2 < tree.children.length; i2++) {
            let ch3 = tree.children[i2];
            if (ch3 instanceof Tree)
              explore(ch3, tree.positions[i2] + from);
          }
        };
        explore(syntaxTree$3(state), 0);
        return result2;
      }
      /**
      Indicates whether this language allows nested languages. The
      default implementation returns true.
      */
      get allowsNesting() {
        return true;
      }
    };
    Language$3.setState = /* @__PURE__ */ StateEffect.define();
    function topNodeAt$3(state, pos2, side) {
      let topLang = state.facet(language$4), tree = syntaxTree$3(state).topNode;
      if (!topLang || topLang.allowsNesting) {
        for (let node2 = tree; node2; node2 = node2.enter(pos2, side, IterMode$1.ExcludeBuffers))
          if (node2.type.isTop)
            tree = node2;
      }
      return tree;
    }
    function syntaxTree$3(state) {
      let field = state.field(Language$3.state, false);
      return field ? field.tree : Tree.empty;
    }
    let DocInput$3 = class DocInput {
      /**
      Create an input object for the given document.
      */
      constructor(doc2) {
        this.doc = doc2;
        this.cursorPos = 0;
        this.string = "";
        this.cursor = doc2.iter();
      }
      get length() {
        return this.doc.length;
      }
      syncTo(pos2) {
        this.string = this.cursor.next(pos2 - this.cursorPos).value;
        this.cursorPos = pos2 + this.string.length;
        return this.cursorPos - this.string.length;
      }
      chunk(pos2) {
        this.syncTo(pos2);
        return this.string;
      }
      get lineChunks() {
        return true;
      }
      read(from, to2) {
        let stringStart = this.cursorPos - this.string.length;
        if (from < stringStart || to2 >= this.cursorPos)
          return this.doc.sliceString(from, to2);
        else
          return this.string.slice(from - stringStart, to2 - stringStart);
      }
    };
    let currentContext$3 = null;
    let ParseContext$3 = class ParseContext2 {
      constructor(parser2, state, fragments = [], tree, treeLen, viewport2, skipped, scheduleOn) {
        this.parser = parser2;
        this.state = state;
        this.fragments = fragments;
        this.tree = tree;
        this.treeLen = treeLen;
        this.viewport = viewport2;
        this.skipped = skipped;
        this.scheduleOn = scheduleOn;
        this.parse = null;
        this.tempSkipped = [];
      }
      /**
      @internal
      */
      static create(parser2, state, viewport2) {
        return new ParseContext2(parser2, state, [], Tree.empty, 0, viewport2, [], null);
      }
      startParse() {
        return this.parser.startParse(new DocInput$3(this.state.doc), this.fragments);
      }
      /**
      @internal
      */
      work(until, upto) {
        if (upto != null && upto >= this.state.doc.length)
          upto = void 0;
        if (this.tree != Tree.empty && this.isDone(upto !== null && upto !== void 0 ? upto : this.state.doc.length)) {
          this.takeTree();
          return true;
        }
        return this.withContext(() => {
          var _a2;
          if (typeof until == "number") {
            let endTime = Date.now() + until;
            until = () => Date.now() > endTime;
          }
          if (!this.parse)
            this.parse = this.startParse();
          if (upto != null && (this.parse.stoppedAt == null || this.parse.stoppedAt > upto) && upto < this.state.doc.length)
            this.parse.stopAt(upto);
          for (; ; ) {
            let done = this.parse.advance();
            if (done) {
              this.fragments = this.withoutTempSkipped(TreeFragment.addTree(done, this.fragments, this.parse.stoppedAt != null));
              this.treeLen = (_a2 = this.parse.stoppedAt) !== null && _a2 !== void 0 ? _a2 : this.state.doc.length;
              this.tree = done;
              this.parse = null;
              if (this.treeLen < (upto !== null && upto !== void 0 ? upto : this.state.doc.length))
                this.parse = this.startParse();
              else
                return true;
            }
            if (until())
              return false;
          }
        });
      }
      /**
      @internal
      */
      takeTree() {
        let pos2, tree;
        if (this.parse && (pos2 = this.parse.parsedPos) >= this.treeLen) {
          if (this.parse.stoppedAt == null || this.parse.stoppedAt > pos2)
            this.parse.stopAt(pos2);
          this.withContext(() => {
            while (!(tree = this.parse.advance())) {
            }
          });
          this.treeLen = pos2;
          this.tree = tree;
          this.fragments = this.withoutTempSkipped(TreeFragment.addTree(this.tree, this.fragments, true));
          this.parse = null;
        }
      }
      withContext(f) {
        let prev = currentContext$3;
        currentContext$3 = this;
        try {
          return f();
        } finally {
          currentContext$3 = prev;
        }
      }
      withoutTempSkipped(fragments) {
        for (let r2; r2 = this.tempSkipped.pop(); )
          fragments = cutFragments$3(fragments, r2.from, r2.to);
        return fragments;
      }
      /**
      @internal
      */
      changes(changes, newState) {
        let { fragments, tree, treeLen, viewport: viewport2, skipped } = this;
        this.takeTree();
        if (!changes.empty) {
          let ranges = [];
          changes.iterChangedRanges((fromA, toA, fromB, toB) => ranges.push({ fromA, toA, fromB, toB }));
          fragments = TreeFragment.applyChanges(fragments, ranges);
          tree = Tree.empty;
          treeLen = 0;
          viewport2 = { from: changes.mapPos(viewport2.from, -1), to: changes.mapPos(viewport2.to, 1) };
          if (this.skipped.length) {
            skipped = [];
            for (let r2 of this.skipped) {
              let from = changes.mapPos(r2.from, 1), to2 = changes.mapPos(r2.to, -1);
              if (from < to2)
                skipped.push({ from, to: to2 });
            }
          }
        }
        return new ParseContext2(this.parser, newState, fragments, tree, treeLen, viewport2, skipped, this.scheduleOn);
      }
      /**
      @internal
      */
      updateViewport(viewport2) {
        if (this.viewport.from == viewport2.from && this.viewport.to == viewport2.to)
          return false;
        this.viewport = viewport2;
        let startLen = this.skipped.length;
        for (let i2 = 0; i2 < this.skipped.length; i2++) {
          let { from, to: to2 } = this.skipped[i2];
          if (from < viewport2.to && to2 > viewport2.from) {
            this.fragments = cutFragments$3(this.fragments, from, to2);
            this.skipped.splice(i2--, 1);
          }
        }
        if (this.skipped.length >= startLen)
          return false;
        this.reset();
        return true;
      }
      /**
      @internal
      */
      reset() {
        if (this.parse) {
          this.takeTree();
          this.parse = null;
        }
      }
      /**
      Notify the parse scheduler that the given region was skipped
      because it wasn't in view, and the parse should be restarted
      when it comes into view.
      */
      skipUntilInView(from, to2) {
        this.skipped.push({ from, to: to2 });
      }
      /**
      Returns a parser intended to be used as placeholder when
      asynchronously loading a nested parser. It'll skip its input and
      mark it as not-really-parsed, so that the next update will parse
      it again.
      
      When `until` is given, a reparse will be scheduled when that
      promise resolves.
      */
      static getSkippingParser(until) {
        return new class extends Parser {
          createParse(input2, fragments, ranges) {
            let from = ranges[0].from, to2 = ranges[ranges.length - 1].to;
            let parser2 = {
              parsedPos: from,
              advance() {
                let cx = currentContext$3;
                if (cx) {
                  for (let r2 of ranges)
                    cx.tempSkipped.push(r2);
                  if (until)
                    cx.scheduleOn = cx.scheduleOn ? Promise.all([cx.scheduleOn, until]) : until;
                }
                this.parsedPos = to2;
                return new Tree(NodeType$1.none, [], [], to2 - from);
              },
              stoppedAt: null,
              stopAt() {
              }
            };
            return parser2;
          }
        }();
      }
      /**
      @internal
      */
      isDone(upto) {
        upto = Math.min(upto, this.state.doc.length);
        let frags = this.fragments;
        return this.treeLen >= upto && frags.length && frags[0].from == 0 && frags[0].to >= upto;
      }
      /**
      Get the context for the current parse, or `null` if no editor
      parse is in progress.
      */
      static get() {
        return currentContext$3;
      }
    };
    function cutFragments$3(fragments, from, to2) {
      return TreeFragment.applyChanges(fragments, [{ fromA: from, toA: to2, fromB: from, toB: to2 }]);
    }
    let LanguageState$3 = class LanguageState2 {
      constructor(context) {
        this.context = context;
        this.tree = context.tree;
      }
      apply(tr2) {
        if (!tr2.docChanged && this.tree == this.context.tree)
          return this;
        let newCx = this.context.changes(tr2.changes, tr2.state);
        let upto = this.context.treeLen == tr2.startState.doc.length ? void 0 : Math.max(tr2.changes.mapPos(this.context.treeLen), newCx.viewport.to);
        if (!newCx.work(20, upto))
          newCx.takeTree();
        return new LanguageState2(newCx);
      }
      static init(state) {
        let vpTo = Math.min(3e3, state.doc.length);
        let parseState2 = ParseContext$3.create(state.facet(language$4).parser, state, { from: 0, to: vpTo });
        if (!parseState2.work(20, vpTo))
          parseState2.takeTree();
        return new LanguageState2(parseState2);
      }
    };
    Language$3.state = /* @__PURE__ */ StateField.define({
      create: LanguageState$3.init,
      update(value2, tr2) {
        for (let e of tr2.effects)
          if (e.is(Language$3.setState))
            return e.value;
        if (tr2.startState.facet(language$4) != tr2.state.facet(language$4))
          return LanguageState$3.init(tr2.state);
        return value2.apply(tr2);
      }
    });
    let requestIdle$3 = (callback) => {
      let timeout = setTimeout(
        () => callback(),
        500
        /* Work.MaxPause */
      );
      return () => clearTimeout(timeout);
    };
    if (typeof requestIdleCallback != "undefined")
      requestIdle$3 = (callback) => {
        let idle = -1, timeout = setTimeout(
          () => {
            idle = requestIdleCallback(callback, {
              timeout: 500 - 100
              /* Work.MinPause */
            });
          },
          100
          /* Work.MinPause */
        );
        return () => idle < 0 ? clearTimeout(timeout) : cancelIdleCallback(idle);
      };
    const isInputPending$3 = typeof navigator != "undefined" && ((_a$3 = navigator.scheduling) === null || _a$3 === void 0 ? void 0 : _a$3.isInputPending) ? () => navigator.scheduling.isInputPending() : null;
    const parseWorker$3 = /* @__PURE__ */ ViewPlugin.fromClass(class ParseWorker {
      constructor(view) {
        this.view = view;
        this.working = null;
        this.workScheduled = 0;
        this.chunkEnd = -1;
        this.chunkBudget = -1;
        this.work = this.work.bind(this);
        this.scheduleWork();
      }
      update(update) {
        let cx = this.view.state.field(Language$3.state).context;
        if (cx.updateViewport(update.view.viewport) || this.view.viewport.to > cx.treeLen)
          this.scheduleWork();
        if (update.docChanged || update.selectionSet) {
          if (this.view.hasFocus)
            this.chunkBudget += 50;
          this.scheduleWork();
        }
        this.checkAsyncSchedule(cx);
      }
      scheduleWork() {
        if (this.working)
          return;
        let { state } = this.view, field = state.field(Language$3.state);
        if (field.tree != field.context.tree || !field.context.isDone(state.doc.length))
          this.working = requestIdle$3(this.work);
      }
      work(deadline) {
        this.working = null;
        let now = Date.now();
        if (this.chunkEnd < now && (this.chunkEnd < 0 || this.view.hasFocus)) {
          this.chunkEnd = now + 3e4;
          this.chunkBudget = 3e3;
        }
        if (this.chunkBudget <= 0)
          return;
        let { state, viewport: { to: vpTo } } = this.view, field = state.field(Language$3.state);
        if (field.tree == field.context.tree && field.context.isDone(
          vpTo + 1e5
          /* Work.MaxParseAhead */
        ))
          return;
        let endTime = Date.now() + Math.min(this.chunkBudget, 100, deadline && !isInputPending$3 ? Math.max(25, deadline.timeRemaining() - 5) : 1e9);
        let viewportFirst = field.context.treeLen < vpTo && state.doc.length > vpTo + 1e3;
        let done = field.context.work(() => {
          return isInputPending$3 && isInputPending$3() || Date.now() > endTime;
        }, vpTo + (viewportFirst ? 0 : 1e5));
        this.chunkBudget -= Date.now() - now;
        if (done || this.chunkBudget <= 0) {
          field.context.takeTree();
          this.view.dispatch({ effects: Language$3.setState.of(new LanguageState$3(field.context)) });
        }
        if (this.chunkBudget > 0 && !(done && !viewportFirst))
          this.scheduleWork();
        this.checkAsyncSchedule(field.context);
      }
      checkAsyncSchedule(cx) {
        if (cx.scheduleOn) {
          this.workScheduled++;
          cx.scheduleOn.then(() => this.scheduleWork()).catch((err2) => logException(this.view.state, err2)).then(() => this.workScheduled--);
          cx.scheduleOn = null;
        }
      }
      destroy() {
        if (this.working)
          this.working();
      }
      isWorking() {
        return !!(this.working || this.workScheduled > 0);
      }
    }, {
      eventHandlers: { focus() {
        this.scheduleWork();
      } }
    });
    const language$4 = /* @__PURE__ */ Facet.define({
      combine(languages) {
        return languages.length ? languages[0] : null;
      },
      enables: (language2) => [
        Language$3.state,
        parseWorker$3,
        EditorView.contentAttributes.compute([language2], (state) => {
          let lang2 = state.facet(language2);
          return lang2 && lang2.name ? { "data-language": lang2.name } : {};
        })
      ]
    });
    const noTokens$3 = /* @__PURE__ */ Object.create(null);
    const typeArray$3 = [NodeType$1.none];
    const warned$3 = [];
    const byTag$3 = /* @__PURE__ */ Object.create(null);
    const defaultTable$3 = /* @__PURE__ */ Object.create(null);
    for (let [legacyName, name2] of [
      ["variable", "variableName"],
      ["variable-2", "variableName.special"],
      ["string-2", "string.special"],
      ["def", "variableName.definition"],
      ["tag", "tagName"],
      ["attribute", "attributeName"],
      ["type", "typeName"],
      ["builtin", "variableName.standard"],
      ["qualifier", "modifier"],
      ["error", "invalid"],
      ["header", "heading"],
      ["property", "propertyName"]
    ])
      defaultTable$3[legacyName] = /* @__PURE__ */ createTokenType$3(noTokens$3, name2);
    function warnForPart$3(part2, msg) {
      if (warned$3.indexOf(part2) > -1)
        return;
      warned$3.push(part2);
      console.warn(msg);
    }
    function createTokenType$3(extra, tagStr) {
      let tags$12 = [];
      for (let name3 of tagStr.split(" ")) {
        let found = [];
        for (let part2 of name3.split(".")) {
          let value2 = extra[part2] || tags$4[part2];
          if (!value2) {
            warnForPart$3(part2, `Unknown highlighting tag ${part2}`);
          } else if (typeof value2 == "function") {
            if (!found.length)
              warnForPart$3(part2, `Modifier ${part2} used at start of tag`);
            else
              found = found.map(value2);
          } else {
            if (found.length)
              warnForPart$3(part2, `Tag ${part2} used as modifier`);
            else
              found = Array.isArray(value2) ? value2 : [value2];
          }
        }
        for (let tag of found)
          tags$12.push(tag);
      }
      if (!tags$12.length)
        return 0;
      let name2 = tagStr.replace(/ /g, "_"), key2 = name2 + " " + tags$12.map((t2) => t2.id);
      let known = byTag$3[key2];
      if (known)
        return known.id;
      let type = byTag$3[key2] = NodeType$1.define({
        id: typeArray$3.length,
        name: name2,
        props: [styleTags$3({ [name2]: tags$12 })]
      });
      typeArray$3.push(type);
      return type.id;
    }
    ({
      rtl: /* @__PURE__ */ Decoration.mark({ class: "cm-iso", inclusive: true, attributes: { dir: "rtl" }, bidiIsolate: Direction.RTL }),
      ltr: /* @__PURE__ */ Decoration.mark({ class: "cm-iso", inclusive: true, attributes: { dir: "ltr" }, bidiIsolate: Direction.LTR })
    });
    class CompletionContext {
      /**
      Create a new completion context. (Mostly useful for testing
      completion sources—in the editor, the extension will create
      these for you.)
      */
      constructor(state, pos2, explicit, view) {
        this.state = state;
        this.pos = pos2;
        this.explicit = explicit;
        this.view = view;
        this.abortListeners = [];
        this.abortOnDocChange = false;
      }
      /**
      Get the extent, content, and (if there is a token) type of the
      token before `this.pos`.
      */
      tokenBefore(types2) {
        let token2 = syntaxTree$3(this.state).resolveInner(this.pos, -1);
        while (token2 && types2.indexOf(token2.name) < 0)
          token2 = token2.parent;
        return token2 ? {
          from: token2.from,
          to: this.pos,
          text: this.state.sliceDoc(token2.from, this.pos),
          type: token2.type
        } : null;
      }
      /**
      Get the match of the given expression directly before the
      cursor.
      */
      matchBefore(expr) {
        let line2 = this.state.doc.lineAt(this.pos);
        let start2 = Math.max(line2.from, this.pos - 250);
        let str2 = line2.text.slice(start2 - line2.from, this.pos - line2.from);
        let found = str2.search(ensureAnchor(expr, false));
        return found < 0 ? null : { from: start2 + found, to: this.pos, text: str2.slice(found) };
      }
      /**
      Yields true when the query has been aborted. Can be useful in
      asynchronous queries to avoid doing work that will be ignored.
      */
      get aborted() {
        return this.abortListeners == null;
      }
      /**
      Allows you to register abort handlers, which will be called when
      the query is
      [aborted](https://codemirror.net/6/docs/ref/#autocomplete.CompletionContext.aborted).
      
      By default, running queries will not be aborted for regular
      typing or backspacing, on the assumption that they are likely to
      return a result with a
      [`validFor`](https://codemirror.net/6/docs/ref/#autocomplete.CompletionResult.validFor) field that
      allows the result to be used after all. Passing `onDocChange:
      true` will cause this query to be aborted for any document
      change.
      */
      addEventListener(type, listener, options2) {
        if (type == "abort" && this.abortListeners) {
          this.abortListeners.push(listener);
          if (options2 && options2.onDocChange)
            this.abortOnDocChange = true;
        }
      }
    }
    function toSet(chars) {
      let flat2 = Object.keys(chars).join("");
      let words = /\w/.test(flat2);
      if (words)
        flat2 = flat2.replace(/\w/g, "");
      return `[${words ? "\\w" : ""}${flat2.replace(/[^\w\s]/g, "\\$&")}]`;
    }
    function prefixMatch(options2) {
      let first = /* @__PURE__ */ Object.create(null), rest = /* @__PURE__ */ Object.create(null);
      for (let { label: label2 } of options2) {
        first[label2[0]] = true;
        for (let i2 = 1; i2 < label2.length; i2++)
          rest[label2[i2]] = true;
      }
      let source2 = toSet(first) + toSet(rest) + "*$";
      return [new RegExp("^" + source2), new RegExp(source2)];
    }
    function completeFromList(list2) {
      let options2 = list2.map((o) => typeof o == "string" ? { label: o } : o);
      let [validFor, match] = options2.every((o) => /^\w+$/.test(o.label)) ? [/\w*$/, /\w+$/] : prefixMatch(options2);
      return (context) => {
        let token2 = context.matchBefore(match);
        return token2 || context.explicit ? { from: token2 ? token2.from : context.pos, options: options2, validFor } : null;
      };
    }
    class Option {
      constructor(completion, source2, match, score2) {
        this.completion = completion;
        this.source = source2;
        this.match = match;
        this.score = score2;
      }
    }
    function cur(state) {
      return state.selection.main.from;
    }
    function ensureAnchor(expr, start2) {
      var _a2;
      let { source: source2 } = expr;
      let addStart = start2 && source2[0] != "^", addEnd = source2[source2.length - 1] != "$";
      if (!addStart && !addEnd)
        return expr;
      return new RegExp(`${addStart ? "^" : ""}(?:${source2})${addEnd ? "$" : ""}`, (_a2 = expr.flags) !== null && _a2 !== void 0 ? _a2 : expr.ignoreCase ? "i" : "");
    }
    const pickedCompletion = /* @__PURE__ */ Annotation.define();
    function insertCompletionText(state, text2, from, to2) {
      let { main: main2 } = state.selection, fromOff = from - main2.from, toOff = to2 - main2.from;
      return {
        ...state.changeByRange((range2) => {
          if (range2 != main2 && from != to2 && state.sliceDoc(range2.from + fromOff, range2.from + toOff) != state.sliceDoc(from, to2))
            return { range: range2 };
          let lines = state.toText(text2);
          return {
            changes: { from: range2.from + fromOff, to: to2 == main2.from ? range2.to : range2.from + toOff, insert: lines },
            range: EditorSelection.cursor(range2.from + fromOff + lines.length)
          };
        }),
        scrollIntoView: true,
        userEvent: "input.complete"
      };
    }
    const SourceCache = /* @__PURE__ */ new WeakMap();
    function asSource(source2) {
      if (!Array.isArray(source2))
        return source2;
      let known = SourceCache.get(source2);
      if (!known)
        SourceCache.set(source2, known = completeFromList(source2));
      return known;
    }
    const startCompletionEffect = /* @__PURE__ */ StateEffect.define();
    const closeCompletionEffect = /* @__PURE__ */ StateEffect.define();
    class FuzzyMatcher {
      constructor(pattern) {
        this.pattern = pattern;
        this.chars = [];
        this.folded = [];
        this.any = [];
        this.precise = [];
        this.byWord = [];
        this.score = 0;
        this.matched = [];
        for (let p = 0; p < pattern.length; ) {
          let char = codePointAt(pattern, p), size = codePointSize(char);
          this.chars.push(char);
          let part2 = pattern.slice(p, p + size), upper = part2.toUpperCase();
          this.folded.push(codePointAt(upper == part2 ? part2.toLowerCase() : upper, 0));
          p += size;
        }
        this.astral = pattern.length != this.chars.length;
      }
      ret(score2, matched) {
        this.score = score2;
        this.matched = matched;
        return this;
      }
      // Matches a given word (completion) against the pattern (input).
      // Will return a boolean indicating whether there was a match and,
      // on success, set `this.score` to the score, `this.matched` to an
      // array of `from, to` pairs indicating the matched parts of `word`.
      //
      // The score is a number that is more negative the worse the match
      // is. See `Penalty` above.
      match(word) {
        if (this.pattern.length == 0)
          return this.ret(-100, []);
        if (word.length < this.pattern.length)
          return null;
        let { chars, folded, any, precise, byWord } = this;
        if (chars.length == 1) {
          let first = codePointAt(word, 0), firstSize = codePointSize(first);
          let score2 = firstSize == word.length ? 0 : -100;
          if (first == chars[0]) ;
          else if (first == folded[0])
            score2 += -200;
          else
            return null;
          return this.ret(score2, [0, firstSize]);
        }
        let direct = word.indexOf(this.pattern);
        if (direct == 0)
          return this.ret(word.length == this.pattern.length ? 0 : -100, [0, this.pattern.length]);
        let len = chars.length, anyTo = 0;
        if (direct < 0) {
          for (let i2 = 0, e = Math.min(word.length, 200); i2 < e && anyTo < len; ) {
            let next = codePointAt(word, i2);
            if (next == chars[anyTo] || next == folded[anyTo])
              any[anyTo++] = i2;
            i2 += codePointSize(next);
          }
          if (anyTo < len)
            return null;
        }
        let preciseTo = 0;
        let byWordTo = 0, byWordFolded = false;
        let adjacentTo = 0, adjacentStart = -1, adjacentEnd = -1;
        let hasLower = /[a-z]/.test(word), wordAdjacent = true;
        for (let i2 = 0, e = Math.min(word.length, 200), prevType = 0; i2 < e && byWordTo < len; ) {
          let next = codePointAt(word, i2);
          if (direct < 0) {
            if (preciseTo < len && next == chars[preciseTo])
              precise[preciseTo++] = i2;
            if (adjacentTo < len) {
              if (next == chars[adjacentTo] || next == folded[adjacentTo]) {
                if (adjacentTo == 0)
                  adjacentStart = i2;
                adjacentEnd = i2 + 1;
                adjacentTo++;
              } else {
                adjacentTo = 0;
              }
            }
          }
          let ch3, type = next < 255 ? next >= 48 && next <= 57 || next >= 97 && next <= 122 ? 2 : next >= 65 && next <= 90 ? 1 : 0 : (ch3 = fromCodePoint(next)) != ch3.toLowerCase() ? 1 : ch3 != ch3.toUpperCase() ? 2 : 0;
          if (!i2 || type == 1 && hasLower || prevType == 0 && type != 0) {
            if (chars[byWordTo] == next || folded[byWordTo] == next && (byWordFolded = true))
              byWord[byWordTo++] = i2;
            else if (byWord.length)
              wordAdjacent = false;
          }
          prevType = type;
          i2 += codePointSize(next);
        }
        if (byWordTo == len && byWord[0] == 0 && wordAdjacent)
          return this.result(-100 + (byWordFolded ? -200 : 0), byWord, word);
        if (adjacentTo == len && adjacentStart == 0)
          return this.ret(-200 - word.length + (adjacentEnd == word.length ? 0 : -100), [0, adjacentEnd]);
        if (direct > -1)
          return this.ret(-700 - word.length, [direct, direct + this.pattern.length]);
        if (adjacentTo == len)
          return this.ret(-200 + -700 - word.length, [adjacentStart, adjacentEnd]);
        if (byWordTo == len)
          return this.result(-100 + (byWordFolded ? -200 : 0) + -700 + (wordAdjacent ? 0 : -1100), byWord, word);
        return chars.length == 2 ? null : this.result((any[0] ? -700 : 0) + -200 + -1100, any, word);
      }
      result(score2, positions, word) {
        let result2 = [], i2 = 0;
        for (let pos2 of positions) {
          let to2 = pos2 + (this.astral ? codePointSize(codePointAt(word, pos2)) : 1);
          if (i2 && result2[i2 - 1] == pos2)
            result2[i2 - 1] = to2;
          else {
            result2[i2++] = pos2;
            result2[i2++] = to2;
          }
        }
        return this.ret(score2 - word.length, result2);
      }
    }
    class StrictMatcher {
      constructor(pattern) {
        this.pattern = pattern;
        this.matched = [];
        this.score = 0;
        this.folded = pattern.toLowerCase();
      }
      match(word) {
        if (word.length < this.pattern.length)
          return null;
        let start2 = word.slice(0, this.pattern.length);
        let match = start2 == this.pattern ? 0 : start2.toLowerCase() == this.folded ? -200 : null;
        if (match == null)
          return null;
        this.matched = [0, start2.length];
        this.score = match + (word.length == this.pattern.length ? 0 : -100);
        return this;
      }
    }
    const completionConfig = /* @__PURE__ */ Facet.define({
      combine(configs) {
        return combineConfig(configs, {
          activateOnTyping: true,
          activateOnCompletion: () => false,
          activateOnTypingDelay: 100,
          selectOnOpen: true,
          override: null,
          closeOnBlur: true,
          maxRenderedOptions: 100,
          defaultKeymap: true,
          tooltipClass: () => "",
          optionClass: () => "",
          aboveCursor: false,
          icons: true,
          addToOptions: [],
          positionInfo: defaultPositionInfo,
          filterStrict: false,
          compareCompletions: (a, b) => (a.sortText || a.label).localeCompare(b.sortText || b.label),
          interactionDelay: 75,
          updateSyncTime: 100
        }, {
          defaultKeymap: (a, b) => a && b,
          closeOnBlur: (a, b) => a && b,
          icons: (a, b) => a && b,
          tooltipClass: (a, b) => (c2) => joinClass(a(c2), b(c2)),
          optionClass: (a, b) => (c2) => joinClass(a(c2), b(c2)),
          addToOptions: (a, b) => a.concat(b),
          filterStrict: (a, b) => a || b
        });
      }
    });
    function joinClass(a, b) {
      return a ? b ? a + " " + b : a : b;
    }
    function defaultPositionInfo(view, list2, option, info, space, tooltip) {
      let rtl = view.textDirection == Direction.RTL, left2 = rtl, narrow = false;
      let side = "top", offset2, maxWidth;
      let spaceLeft = list2.left - space.left, spaceRight = space.right - list2.right;
      let infoWidth = info.right - info.left, infoHeight = info.bottom - info.top;
      if (left2 && spaceLeft < Math.min(infoWidth, spaceRight))
        left2 = false;
      else if (!left2 && spaceRight < Math.min(infoWidth, spaceLeft))
        left2 = true;
      if (infoWidth <= (left2 ? spaceLeft : spaceRight)) {
        offset2 = Math.max(space.top, Math.min(option.top, space.bottom - infoHeight)) - list2.top;
        maxWidth = Math.min(400, left2 ? spaceLeft : spaceRight);
      } else {
        narrow = true;
        maxWidth = Math.min(
          400,
          (rtl ? list2.right : space.right - list2.left) - 30
          /* Info.Margin */
        );
        let spaceBelow = space.bottom - list2.bottom;
        if (spaceBelow >= infoHeight || spaceBelow > list2.top) {
          offset2 = option.bottom - list2.top;
        } else {
          side = "bottom";
          offset2 = list2.bottom - option.top;
        }
      }
      let scaleY = (list2.bottom - list2.top) / tooltip.offsetHeight;
      let scaleX = (list2.right - list2.left) / tooltip.offsetWidth;
      return {
        style: `${side}: ${offset2 / scaleY}px; max-width: ${maxWidth / scaleX}px`,
        class: "cm-completionInfo-" + (narrow ? rtl ? "left-narrow" : "right-narrow" : left2 ? "left" : "right")
      };
    }
    function optionContent(config2) {
      let content2 = config2.addToOptions.slice();
      if (config2.icons)
        content2.push({
          render(completion) {
            let icon2 = document.createElement("div");
            icon2.classList.add("cm-completionIcon");
            if (completion.type)
              icon2.classList.add(...completion.type.split(/\s+/g).map((cls) => "cm-completionIcon-" + cls));
            icon2.setAttribute("aria-hidden", "true");
            return icon2;
          },
          position: 20
        });
      content2.push({
        render(completion, _s, _v, match) {
          let labelElt = document.createElement("span");
          labelElt.className = "cm-completionLabel";
          let label2 = completion.displayLabel || completion.label, off = 0;
          for (let j = 0; j < match.length; ) {
            let from = match[j++], to2 = match[j++];
            if (from > off)
              labelElt.appendChild(document.createTextNode(label2.slice(off, from)));
            let span = labelElt.appendChild(document.createElement("span"));
            span.appendChild(document.createTextNode(label2.slice(from, to2)));
            span.className = "cm-completionMatchedText";
            off = to2;
          }
          if (off < label2.length)
            labelElt.appendChild(document.createTextNode(label2.slice(off)));
          return labelElt;
        },
        position: 50
      }, {
        render(completion) {
          if (!completion.detail)
            return null;
          let detailElt = document.createElement("span");
          detailElt.className = "cm-completionDetail";
          detailElt.textContent = completion.detail;
          return detailElt;
        },
        position: 80
      });
      return content2.sort((a, b) => a.position - b.position).map((a) => a.render);
    }
    function rangeAroundSelected(total, selected2, max2) {
      if (total <= max2)
        return { from: 0, to: total };
      if (selected2 < 0)
        selected2 = 0;
      if (selected2 <= total >> 1) {
        let off2 = Math.floor(selected2 / max2);
        return { from: off2 * max2, to: (off2 + 1) * max2 };
      }
      let off = Math.floor((total - selected2) / max2);
      return { from: total - (off + 1) * max2, to: total - off * max2 };
    }
    class CompletionTooltip {
      constructor(view, stateField, applyCompletion2) {
        this.view = view;
        this.stateField = stateField;
        this.applyCompletion = applyCompletion2;
        this.info = null;
        this.infoDestroy = null;
        this.placeInfoReq = {
          read: () => this.measureInfo(),
          write: (pos2) => this.placeInfo(pos2),
          key: this
        };
        this.space = null;
        this.currentClass = "";
        let cState = view.state.field(stateField);
        let { options: options2, selected: selected2 } = cState.open;
        let config2 = view.state.facet(completionConfig);
        this.optionContent = optionContent(config2);
        this.optionClass = config2.optionClass;
        this.tooltipClass = config2.tooltipClass;
        this.range = rangeAroundSelected(options2.length, selected2, config2.maxRenderedOptions);
        this.dom = document.createElement("div");
        this.dom.className = "cm-tooltip-autocomplete";
        this.updateTooltipClass(view.state);
        this.dom.addEventListener("mousedown", (e) => {
          let { options: options3 } = view.state.field(stateField).open;
          for (let dom = e.target, match; dom && dom != this.dom; dom = dom.parentNode) {
            if (dom.nodeName == "LI" && (match = /-(\d+)$/.exec(dom.id)) && +match[1] < options3.length) {
              this.applyCompletion(view, options3[+match[1]]);
              e.preventDefault();
              return;
            }
          }
        });
        this.dom.addEventListener("focusout", (e) => {
          let state = view.state.field(this.stateField, false);
          if (state && state.tooltip && view.state.facet(completionConfig).closeOnBlur && e.relatedTarget != view.contentDOM)
            view.dispatch({ effects: closeCompletionEffect.of(null) });
        });
        this.showOptions(options2, cState.id);
      }
      mount() {
        this.updateSel();
      }
      showOptions(options2, id) {
        if (this.list)
          this.list.remove();
        this.list = this.dom.appendChild(this.createListBox(options2, id, this.range));
        this.list.addEventListener("scroll", () => {
          if (this.info)
            this.view.requestMeasure(this.placeInfoReq);
        });
      }
      update(update) {
        var _a2;
        let cState = update.state.field(this.stateField);
        let prevState = update.startState.field(this.stateField);
        this.updateTooltipClass(update.state);
        if (cState != prevState) {
          let { options: options2, selected: selected2, disabled: disabled2 } = cState.open;
          if (!prevState.open || prevState.open.options != options2) {
            this.range = rangeAroundSelected(options2.length, selected2, update.state.facet(completionConfig).maxRenderedOptions);
            this.showOptions(options2, cState.id);
          }
          this.updateSel();
          if (disabled2 != ((_a2 = prevState.open) === null || _a2 === void 0 ? void 0 : _a2.disabled))
            this.dom.classList.toggle("cm-tooltip-autocomplete-disabled", !!disabled2);
        }
      }
      updateTooltipClass(state) {
        let cls = this.tooltipClass(state);
        if (cls != this.currentClass) {
          for (let c2 of this.currentClass.split(" "))
            if (c2)
              this.dom.classList.remove(c2);
          for (let c2 of cls.split(" "))
            if (c2)
              this.dom.classList.add(c2);
          this.currentClass = cls;
        }
      }
      positioned(space) {
        this.space = space;
        if (this.info)
          this.view.requestMeasure(this.placeInfoReq);
      }
      updateSel() {
        let cState = this.view.state.field(this.stateField), open = cState.open;
        if (open.selected > -1 && open.selected < this.range.from || open.selected >= this.range.to) {
          this.range = rangeAroundSelected(open.options.length, open.selected, this.view.state.facet(completionConfig).maxRenderedOptions);
          this.showOptions(open.options, cState.id);
        }
        let newSel = this.updateSelectedOption(open.selected);
        if (newSel) {
          this.destroyInfo();
          let { completion } = open.options[open.selected];
          let { info } = completion;
          if (!info)
            return;
          let infoResult = typeof info === "string" ? document.createTextNode(info) : info(completion);
          if (!infoResult)
            return;
          if ("then" in infoResult) {
            infoResult.then((obj) => {
              if (obj && this.view.state.field(this.stateField, false) == cState)
                this.addInfoPane(obj, completion);
            }).catch((e) => logException(this.view.state, e, "completion info"));
          } else {
            this.addInfoPane(infoResult, completion);
            newSel.setAttribute("aria-describedby", this.info.id);
          }
        }
      }
      addInfoPane(content2, completion) {
        this.destroyInfo();
        let wrap2 = this.info = document.createElement("div");
        wrap2.className = "cm-tooltip cm-completionInfo";
        wrap2.id = "cm-completionInfo-" + Math.floor(Math.random() * 65535).toString(16);
        if (content2.nodeType != null) {
          wrap2.appendChild(content2);
          this.infoDestroy = null;
        } else {
          let { dom, destroy: destroy2 } = content2;
          wrap2.appendChild(dom);
          this.infoDestroy = destroy2 || null;
        }
        this.dom.appendChild(wrap2);
        this.view.requestMeasure(this.placeInfoReq);
      }
      updateSelectedOption(selected2) {
        let set2 = null;
        for (let opt = this.list.firstChild, i2 = this.range.from; opt; opt = opt.nextSibling, i2++) {
          if (opt.nodeName != "LI" || !opt.id) {
            i2--;
          } else if (i2 == selected2) {
            if (!opt.hasAttribute("aria-selected")) {
              opt.setAttribute("aria-selected", "true");
              set2 = opt;
            }
          } else {
            if (opt.hasAttribute("aria-selected")) {
              opt.removeAttribute("aria-selected");
              opt.removeAttribute("aria-describedby");
            }
          }
        }
        if (set2)
          scrollIntoView(this.list, set2);
        return set2;
      }
      measureInfo() {
        let sel = this.dom.querySelector("[aria-selected]");
        if (!sel || !this.info)
          return null;
        let listRect = this.dom.getBoundingClientRect();
        let infoRect = this.info.getBoundingClientRect();
        let selRect = sel.getBoundingClientRect();
        let space = this.space;
        if (!space) {
          let docElt = this.dom.ownerDocument.documentElement;
          space = { left: 0, top: 0, right: docElt.clientWidth, bottom: docElt.clientHeight };
        }
        if (selRect.top > Math.min(space.bottom, listRect.bottom) - 10 || selRect.bottom < Math.max(space.top, listRect.top) + 10)
          return null;
        return this.view.state.facet(completionConfig).positionInfo(this.view, listRect, selRect, infoRect, space, this.dom);
      }
      placeInfo(pos2) {
        if (this.info) {
          if (pos2) {
            if (pos2.style)
              this.info.style.cssText = pos2.style;
            this.info.className = "cm-tooltip cm-completionInfo " + (pos2.class || "");
          } else {
            this.info.style.cssText = "top: -1e6px";
          }
        }
      }
      createListBox(options2, id, range2) {
        const ul = document.createElement("ul");
        ul.id = id;
        ul.setAttribute("role", "listbox");
        ul.setAttribute("aria-expanded", "true");
        ul.setAttribute("aria-label", this.view.state.phrase("Completions"));
        ul.addEventListener("mousedown", (e) => {
          if (e.target == ul)
            e.preventDefault();
        });
        let curSection = null;
        for (let i2 = range2.from; i2 < range2.to; i2++) {
          let { completion, match } = options2[i2], { section: section2 } = completion;
          if (section2) {
            let name2 = typeof section2 == "string" ? section2 : section2.name;
            if (name2 != curSection && (i2 > range2.from || range2.from == 0)) {
              curSection = name2;
              if (typeof section2 != "string" && section2.header) {
                ul.appendChild(section2.header(section2));
              } else {
                let header2 = ul.appendChild(document.createElement("completion-section"));
                header2.textContent = name2;
              }
            }
          }
          const li = ul.appendChild(document.createElement("li"));
          li.id = id + "-" + i2;
          li.setAttribute("role", "option");
          let cls = this.optionClass(completion);
          if (cls)
            li.className = cls;
          for (let source2 of this.optionContent) {
            let node2 = source2(completion, this.view.state, this.view, match);
            if (node2)
              li.appendChild(node2);
          }
        }
        if (range2.from)
          ul.classList.add("cm-completionListIncompleteTop");
        if (range2.to < options2.length)
          ul.classList.add("cm-completionListIncompleteBottom");
        return ul;
      }
      destroyInfo() {
        if (this.info) {
          if (this.infoDestroy)
            this.infoDestroy();
          this.info.remove();
          this.info = null;
        }
      }
      destroy() {
        this.destroyInfo();
      }
    }
    function completionTooltip(stateField, applyCompletion2) {
      return (view) => new CompletionTooltip(view, stateField, applyCompletion2);
    }
    function scrollIntoView(container2, element) {
      let parent = container2.getBoundingClientRect();
      let self2 = element.getBoundingClientRect();
      let scaleY = parent.height / container2.offsetHeight;
      if (self2.top < parent.top)
        container2.scrollTop -= (parent.top - self2.top) / scaleY;
      else if (self2.bottom > parent.bottom)
        container2.scrollTop += (self2.bottom - parent.bottom) / scaleY;
    }
    function score$1(option) {
      return (option.boost || 0) * 100 + (option.apply ? 10 : 0) + (option.info ? 5 : 0) + (option.type ? 1 : 0);
    }
    function sortOptions(active, state) {
      let options2 = [];
      let sections = null, dynamicSectionScore = null;
      let addOption = (option) => {
        options2.push(option);
        let { section: section2 } = option.completion;
        if (section2) {
          if (!sections)
            sections = [];
          let name2 = typeof section2 == "string" ? section2 : section2.name;
          if (!sections.some((s) => s.name == name2))
            sections.push(typeof section2 == "string" ? { name: name2 } : section2);
        }
      };
      let conf = state.facet(completionConfig);
      for (let a of active)
        if (a.hasResult()) {
          let getMatch = a.result.getMatch;
          if (a.result.filter === false) {
            for (let option of a.result.options) {
              addOption(new Option(option, a.source, getMatch ? getMatch(option) : [], 1e9 - options2.length));
            }
          } else {
            let pattern = state.sliceDoc(a.from, a.to), match;
            let matcher = conf.filterStrict ? new StrictMatcher(pattern) : new FuzzyMatcher(pattern);
            for (let option of a.result.options)
              if (match = matcher.match(option.label)) {
                let matched = !option.displayLabel ? match.matched : getMatch ? getMatch(option, match.matched) : [];
                let score2 = match.score + (option.boost || 0);
                addOption(new Option(option, a.source, matched, score2));
                if (typeof option.section == "object" && option.section.rank === "dynamic") {
                  let { name: name2 } = option.section;
                  if (!dynamicSectionScore)
                    dynamicSectionScore = /* @__PURE__ */ Object.create(null);
                  dynamicSectionScore[name2] = Math.max(score2, dynamicSectionScore[name2] || -1e9);
                }
              }
          }
        }
      if (sections) {
        let sectionOrder = /* @__PURE__ */ Object.create(null), pos2 = 0;
        let cmp2 = (a, b) => {
          return (a.rank === "dynamic" && b.rank === "dynamic" ? dynamicSectionScore[b.name] - dynamicSectionScore[a.name] : 0) || (typeof a.rank == "number" ? a.rank : 1e9) - (typeof b.rank == "number" ? b.rank : 1e9) || (a.name < b.name ? -1 : 1);
        };
        for (let s of sections.sort(cmp2)) {
          pos2 -= 1e5;
          sectionOrder[s.name] = pos2;
        }
        for (let option of options2) {
          let { section: section2 } = option.completion;
          if (section2)
            option.score += sectionOrder[typeof section2 == "string" ? section2 : section2.name];
        }
      }
      let result2 = [], prev = null;
      let compare2 = conf.compareCompletions;
      for (let opt of options2.sort((a, b) => b.score - a.score || compare2(a.completion, b.completion))) {
        let cur2 = opt.completion;
        if (!prev || prev.label != cur2.label || prev.detail != cur2.detail || prev.type != null && cur2.type != null && prev.type != cur2.type || prev.apply != cur2.apply || prev.boost != cur2.boost)
          result2.push(opt);
        else if (score$1(opt.completion) > score$1(prev))
          result2[result2.length - 1] = opt;
        prev = opt.completion;
      }
      return result2;
    }
    class CompletionDialog {
      constructor(options2, attrs, tooltip, timestamp, selected2, disabled2) {
        this.options = options2;
        this.attrs = attrs;
        this.tooltip = tooltip;
        this.timestamp = timestamp;
        this.selected = selected2;
        this.disabled = disabled2;
      }
      setSelected(selected2, id) {
        return selected2 == this.selected || selected2 >= this.options.length ? this : new CompletionDialog(this.options, makeAttrs(id, selected2), this.tooltip, this.timestamp, selected2, this.disabled);
      }
      static build(active, state, id, prev, conf, didSetActive) {
        if (prev && !didSetActive && active.some((s) => s.isPending))
          return prev.setDisabled();
        let options2 = sortOptions(active, state);
        if (!options2.length)
          return prev && active.some((a) => a.isPending) ? prev.setDisabled() : null;
        let selected2 = state.facet(completionConfig).selectOnOpen ? 0 : -1;
        if (prev && prev.selected != selected2 && prev.selected != -1) {
          let selectedValue = prev.options[prev.selected].completion;
          for (let i2 = 0; i2 < options2.length; i2++)
            if (options2[i2].completion == selectedValue) {
              selected2 = i2;
              break;
            }
        }
        return new CompletionDialog(options2, makeAttrs(id, selected2), {
          pos: active.reduce((a, b) => b.hasResult() ? Math.min(a, b.from) : a, 1e8),
          create: createTooltip,
          above: conf.aboveCursor
        }, prev ? prev.timestamp : Date.now(), selected2, false);
      }
      map(changes) {
        return new CompletionDialog(this.options, this.attrs, { ...this.tooltip, pos: changes.mapPos(this.tooltip.pos) }, this.timestamp, this.selected, this.disabled);
      }
      setDisabled() {
        return new CompletionDialog(this.options, this.attrs, this.tooltip, this.timestamp, this.selected, true);
      }
    }
    class CompletionState {
      constructor(active, id, open) {
        this.active = active;
        this.id = id;
        this.open = open;
      }
      static start() {
        return new CompletionState(none$1, "cm-ac-" + Math.floor(Math.random() * 2e6).toString(36), null);
      }
      update(tr2) {
        let { state } = tr2, conf = state.facet(completionConfig);
        let sources = conf.override || state.languageDataAt("autocomplete", cur(state)).map(asSource);
        let active = sources.map((source2) => {
          let value2 = this.active.find((s) => s.source == source2) || new ActiveSource(
            source2,
            this.active.some(
              (a) => a.state != 0
              /* State.Inactive */
            ) ? 1 : 0
            /* State.Inactive */
          );
          return value2.update(tr2, conf);
        });
        if (active.length == this.active.length && active.every((a, i2) => a == this.active[i2]))
          active = this.active;
        let open = this.open, didSet = tr2.effects.some((e) => e.is(setActiveEffect));
        if (open && tr2.docChanged)
          open = open.map(tr2.changes);
        if (tr2.selection || active.some((a) => a.hasResult() && tr2.changes.touchesRange(a.from, a.to)) || !sameResults(active, this.active) || didSet)
          open = CompletionDialog.build(active, state, this.id, open, conf, didSet);
        else if (open && open.disabled && !active.some((a) => a.isPending))
          open = null;
        if (!open && active.every((a) => !a.isPending) && active.some((a) => a.hasResult()))
          active = active.map((a) => a.hasResult() ? new ActiveSource(
            a.source,
            0
            /* State.Inactive */
          ) : a);
        for (let effect2 of tr2.effects)
          if (effect2.is(setSelectedEffect))
            open = open && open.setSelected(effect2.value, this.id);
        return active == this.active && open == this.open ? this : new CompletionState(active, this.id, open);
      }
      get tooltip() {
        return this.open ? this.open.tooltip : null;
      }
      get attrs() {
        return this.open ? this.open.attrs : this.active.length ? baseAttrs : noAttrs;
      }
    }
    function sameResults(a, b) {
      if (a == b)
        return true;
      for (let iA = 0, iB = 0; ; ) {
        while (iA < a.length && !a[iA].hasResult())
          iA++;
        while (iB < b.length && !b[iB].hasResult())
          iB++;
        let endA = iA == a.length, endB = iB == b.length;
        if (endA || endB)
          return endA == endB;
        if (a[iA++].result != b[iB++].result)
          return false;
      }
    }
    const baseAttrs = {
      "aria-autocomplete": "list"
    };
    const noAttrs = {};
    function makeAttrs(id, selected2) {
      let result2 = {
        "aria-autocomplete": "list",
        "aria-haspopup": "listbox",
        "aria-controls": id
      };
      if (selected2 > -1)
        result2["aria-activedescendant"] = id + "-" + selected2;
      return result2;
    }
    const none$1 = [];
    function getUpdateType(tr2, conf) {
      if (tr2.isUserEvent("input.complete")) {
        let completion = tr2.annotation(pickedCompletion);
        if (completion && conf.activateOnCompletion(completion))
          return 4 | 8;
      }
      let typing = tr2.isUserEvent("input.type");
      return typing && conf.activateOnTyping ? 4 | 1 : typing ? 1 : tr2.isUserEvent("delete.backward") ? 2 : tr2.selection ? 8 : tr2.docChanged ? 16 : 0;
    }
    class ActiveSource {
      constructor(source2, state, explicit = false) {
        this.source = source2;
        this.state = state;
        this.explicit = explicit;
      }
      hasResult() {
        return false;
      }
      get isPending() {
        return this.state == 1;
      }
      update(tr2, conf) {
        let type = getUpdateType(tr2, conf), value2 = this;
        if (type & 8 || type & 16 && this.touches(tr2))
          value2 = new ActiveSource(
            value2.source,
            0
            /* State.Inactive */
          );
        if (type & 4 && value2.state == 0)
          value2 = new ActiveSource(
            this.source,
            1
            /* State.Pending */
          );
        value2 = value2.updateFor(tr2, type);
        for (let effect2 of tr2.effects) {
          if (effect2.is(startCompletionEffect))
            value2 = new ActiveSource(value2.source, 1, effect2.value);
          else if (effect2.is(closeCompletionEffect))
            value2 = new ActiveSource(
              value2.source,
              0
              /* State.Inactive */
            );
          else if (effect2.is(setActiveEffect)) {
            for (let active of effect2.value)
              if (active.source == value2.source)
                value2 = active;
          }
        }
        return value2;
      }
      updateFor(tr2, type) {
        return this.map(tr2.changes);
      }
      map(changes) {
        return this;
      }
      touches(tr2) {
        return tr2.changes.touchesRange(cur(tr2.state));
      }
    }
    class ActiveResult extends ActiveSource {
      constructor(source2, explicit, limit, result2, from, to2) {
        super(source2, 3, explicit);
        this.limit = limit;
        this.result = result2;
        this.from = from;
        this.to = to2;
      }
      hasResult() {
        return true;
      }
      updateFor(tr2, type) {
        var _a2;
        if (!(type & 3))
          return this.map(tr2.changes);
        let result2 = this.result;
        if (result2.map && !tr2.changes.empty)
          result2 = result2.map(result2, tr2.changes);
        let from = tr2.changes.mapPos(this.from), to2 = tr2.changes.mapPos(this.to, 1);
        let pos2 = cur(tr2.state);
        if (pos2 > to2 || !result2 || type & 2 && (cur(tr2.startState) == this.from || pos2 < this.limit))
          return new ActiveSource(
            this.source,
            type & 4 ? 1 : 0
            /* State.Inactive */
          );
        let limit = tr2.changes.mapPos(this.limit);
        if (checkValid(result2.validFor, tr2.state, from, to2))
          return new ActiveResult(this.source, this.explicit, limit, result2, from, to2);
        if (result2.update && (result2 = result2.update(result2, from, to2, new CompletionContext(tr2.state, pos2, false))))
          return new ActiveResult(this.source, this.explicit, limit, result2, result2.from, (_a2 = result2.to) !== null && _a2 !== void 0 ? _a2 : cur(tr2.state));
        return new ActiveSource(this.source, 1, this.explicit);
      }
      map(mapping) {
        if (mapping.empty)
          return this;
        let result2 = this.result.map ? this.result.map(this.result, mapping) : this.result;
        if (!result2)
          return new ActiveSource(
            this.source,
            0
            /* State.Inactive */
          );
        return new ActiveResult(this.source, this.explicit, mapping.mapPos(this.limit), this.result, mapping.mapPos(this.from), mapping.mapPos(this.to, 1));
      }
      touches(tr2) {
        return tr2.changes.touchesRange(this.from, this.to);
      }
    }
    function checkValid(validFor, state, from, to2) {
      if (!validFor)
        return false;
      let text2 = state.sliceDoc(from, to2);
      return typeof validFor == "function" ? validFor(text2, from, to2, state) : ensureAnchor(validFor, true).test(text2);
    }
    const setActiveEffect = /* @__PURE__ */ StateEffect.define({
      map(sources, mapping) {
        return sources.map((s) => s.map(mapping));
      }
    });
    const setSelectedEffect = /* @__PURE__ */ StateEffect.define();
    const completionState = /* @__PURE__ */ StateField.define({
      create() {
        return CompletionState.start();
      },
      update(value2, tr2) {
        return value2.update(tr2);
      },
      provide: (f) => [
        showTooltip.from(f, (val) => val.tooltip),
        EditorView.contentAttributes.from(f, (state) => state.attrs)
      ]
    });
    function applyCompletion(view, option) {
      const apply = option.completion.apply || option.completion.label;
      let result2 = view.state.field(completionState).active.find((a) => a.source == option.source);
      if (!(result2 instanceof ActiveResult))
        return false;
      if (typeof apply == "string")
        view.dispatch({
          ...insertCompletionText(view.state, apply, result2.from, result2.to),
          annotations: pickedCompletion.of(option.completion)
        });
      else
        apply(view, option.completion, result2.from, result2.to);
      return true;
    }
    const createTooltip = /* @__PURE__ */ completionTooltip(completionState, applyCompletion);
    function moveCompletionSelection(forward, by = "option") {
      return (view) => {
        let cState = view.state.field(completionState, false);
        if (!cState || !cState.open || cState.open.disabled || Date.now() - cState.open.timestamp < view.state.facet(completionConfig).interactionDelay)
          return false;
        let step = 1, tooltip;
        if (by == "page" && (tooltip = getTooltip(view, cState.open.tooltip)))
          step = Math.max(2, Math.floor(tooltip.dom.offsetHeight / tooltip.dom.querySelector("li").offsetHeight) - 1);
        let { length } = cState.open.options;
        let selected2 = cState.open.selected > -1 ? cState.open.selected + step * (forward ? 1 : -1) : forward ? 0 : length - 1;
        if (selected2 < 0)
          selected2 = by == "page" ? 0 : length - 1;
        else if (selected2 >= length)
          selected2 = by == "page" ? length - 1 : 0;
        view.dispatch({ effects: setSelectedEffect.of(selected2) });
        return true;
      };
    }
    const acceptCompletion = (view) => {
      let cState = view.state.field(completionState, false);
      if (view.state.readOnly || !cState || !cState.open || cState.open.selected < 0 || cState.open.disabled || Date.now() - cState.open.timestamp < view.state.facet(completionConfig).interactionDelay)
        return false;
      return applyCompletion(view, cState.open.options[cState.open.selected]);
    };
    const startCompletion = (view) => {
      let cState = view.state.field(completionState, false);
      if (!cState)
        return false;
      view.dispatch({ effects: startCompletionEffect.of(true) });
      return true;
    };
    const closeCompletion = (view) => {
      let cState = view.state.field(completionState, false);
      if (!cState || !cState.active.some(
        (a) => a.state != 0
        /* State.Inactive */
      ))
        return false;
      view.dispatch({ effects: closeCompletionEffect.of(null) });
      return true;
    };
    class RunningQuery {
      constructor(active, context) {
        this.active = active;
        this.context = context;
        this.time = Date.now();
        this.updates = [];
        this.done = void 0;
      }
    }
    const MaxUpdateCount = 50, MinAbortTime = 1e3;
    const completionPlugin = /* @__PURE__ */ ViewPlugin.fromClass(class {
      constructor(view) {
        this.view = view;
        this.debounceUpdate = -1;
        this.running = [];
        this.debounceAccept = -1;
        this.pendingStart = false;
        this.composing = 0;
        for (let active of view.state.field(completionState).active)
          if (active.isPending)
            this.startQuery(active);
      }
      update(update) {
        let cState = update.state.field(completionState);
        let conf = update.state.facet(completionConfig);
        if (!update.selectionSet && !update.docChanged && update.startState.field(completionState) == cState)
          return;
        let doesReset = update.transactions.some((tr2) => {
          let type = getUpdateType(tr2, conf);
          return type & 8 || (tr2.selection || tr2.docChanged) && !(type & 3);
        });
        for (let i2 = 0; i2 < this.running.length; i2++) {
          let query2 = this.running[i2];
          if (doesReset || query2.context.abortOnDocChange && update.docChanged || query2.updates.length + update.transactions.length > MaxUpdateCount && Date.now() - query2.time > MinAbortTime) {
            for (let handler of query2.context.abortListeners) {
              try {
                handler();
              } catch (e) {
                logException(this.view.state, e);
              }
            }
            query2.context.abortListeners = null;
            this.running.splice(i2--, 1);
          } else {
            query2.updates.push(...update.transactions);
          }
        }
        if (this.debounceUpdate > -1)
          clearTimeout(this.debounceUpdate);
        if (update.transactions.some((tr2) => tr2.effects.some((e) => e.is(startCompletionEffect))))
          this.pendingStart = true;
        let delay = this.pendingStart ? 50 : conf.activateOnTypingDelay;
        this.debounceUpdate = cState.active.some((a) => a.isPending && !this.running.some((q) => q.active.source == a.source)) ? setTimeout(() => this.startUpdate(), delay) : -1;
        if (this.composing != 0)
          for (let tr2 of update.transactions) {
            if (tr2.isUserEvent("input.type"))
              this.composing = 2;
            else if (this.composing == 2 && tr2.selection)
              this.composing = 3;
          }
      }
      startUpdate() {
        this.debounceUpdate = -1;
        this.pendingStart = false;
        let { state } = this.view, cState = state.field(completionState);
        for (let active of cState.active) {
          if (active.isPending && !this.running.some((r2) => r2.active.source == active.source))
            this.startQuery(active);
        }
        if (this.running.length && cState.open && cState.open.disabled)
          this.debounceAccept = setTimeout(() => this.accept(), this.view.state.facet(completionConfig).updateSyncTime);
      }
      startQuery(active) {
        let { state } = this.view, pos2 = cur(state);
        let context = new CompletionContext(state, pos2, active.explicit, this.view);
        let pending = new RunningQuery(active, context);
        this.running.push(pending);
        Promise.resolve(active.source(context)).then((result2) => {
          if (!pending.context.aborted) {
            pending.done = result2 || null;
            this.scheduleAccept();
          }
        }, (err2) => {
          this.view.dispatch({ effects: closeCompletionEffect.of(null) });
          logException(this.view.state, err2);
        });
      }
      scheduleAccept() {
        if (this.running.every((q) => q.done !== void 0))
          this.accept();
        else if (this.debounceAccept < 0)
          this.debounceAccept = setTimeout(() => this.accept(), this.view.state.facet(completionConfig).updateSyncTime);
      }
      // For each finished query in this.running, try to create a result
      // or, if appropriate, restart the query.
      accept() {
        var _a2;
        if (this.debounceAccept > -1)
          clearTimeout(this.debounceAccept);
        this.debounceAccept = -1;
        let updated = [];
        let conf = this.view.state.facet(completionConfig), cState = this.view.state.field(completionState);
        for (let i2 = 0; i2 < this.running.length; i2++) {
          let query2 = this.running[i2];
          if (query2.done === void 0)
            continue;
          this.running.splice(i2--, 1);
          if (query2.done) {
            let pos2 = cur(query2.updates.length ? query2.updates[0].startState : this.view.state);
            let limit = Math.min(pos2, query2.done.from + (query2.active.explicit ? 0 : 1));
            let active = new ActiveResult(query2.active.source, query2.active.explicit, limit, query2.done, query2.done.from, (_a2 = query2.done.to) !== null && _a2 !== void 0 ? _a2 : pos2);
            for (let tr2 of query2.updates)
              active = active.update(tr2, conf);
            if (active.hasResult()) {
              updated.push(active);
              continue;
            }
          }
          let current2 = cState.active.find((a) => a.source == query2.active.source);
          if (current2 && current2.isPending) {
            if (query2.done == null) {
              let active = new ActiveSource(
                query2.active.source,
                0
                /* State.Inactive */
              );
              for (let tr2 of query2.updates)
                active = active.update(tr2, conf);
              if (!active.isPending)
                updated.push(active);
            } else {
              this.startQuery(current2);
            }
          }
        }
        if (updated.length || cState.open && cState.open.disabled)
          this.view.dispatch({ effects: setActiveEffect.of(updated) });
      }
    }, {
      eventHandlers: {
        blur(event) {
          let state = this.view.state.field(completionState, false);
          if (state && state.tooltip && this.view.state.facet(completionConfig).closeOnBlur) {
            let dialog = state.open && getTooltip(this.view, state.open.tooltip);
            if (!dialog || !dialog.dom.contains(event.relatedTarget))
              setTimeout(() => this.view.dispatch({ effects: closeCompletionEffect.of(null) }), 10);
          }
        },
        compositionstart() {
          this.composing = 1;
        },
        compositionend() {
          if (this.composing == 3) {
            setTimeout(() => this.view.dispatch({ effects: startCompletionEffect.of(false) }), 20);
          }
          this.composing = 0;
        }
      }
    });
    const windows = typeof navigator == "object" && /* @__PURE__ */ /Win/.test(navigator.platform);
    const commitCharacters = /* @__PURE__ */ Prec.highest(/* @__PURE__ */ EditorView.domEventHandlers({
      keydown(event, view) {
        let field = view.state.field(completionState, false);
        if (!field || !field.open || field.open.disabled || field.open.selected < 0 || event.key.length > 1 || event.ctrlKey && !(windows && event.altKey) || event.metaKey)
          return false;
        let option = field.open.options[field.open.selected];
        let result2 = field.active.find((a) => a.source == option.source);
        let commitChars = option.completion.commitCharacters || result2.result.commitCharacters;
        if (commitChars && commitChars.indexOf(event.key) > -1)
          applyCompletion(view, option);
        return false;
      }
    }));
    const baseTheme$2 = /* @__PURE__ */ EditorView.baseTheme({
      ".cm-tooltip.cm-tooltip-autocomplete": {
        "& > ul": {
          fontFamily: "monospace",
          whiteSpace: "nowrap",
          overflow: "hidden auto",
          maxWidth_fallback: "700px",
          maxWidth: "min(700px, 95vw)",
          minWidth: "250px",
          maxHeight: "10em",
          height: "100%",
          listStyle: "none",
          margin: 0,
          padding: 0,
          "& > li, & > completion-section": {
            padding: "1px 3px",
            lineHeight: 1.2
          },
          "& > li": {
            overflowX: "hidden",
            textOverflow: "ellipsis",
            cursor: "pointer"
          },
          "& > completion-section": {
            display: "list-item",
            borderBottom: "1px solid silver",
            paddingLeft: "0.5em",
            opacity: 0.7
          }
        }
      },
      "&light .cm-tooltip-autocomplete ul li[aria-selected]": {
        background: "#17c",
        color: "white"
      },
      "&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]": {
        background: "#777"
      },
      "&dark .cm-tooltip-autocomplete ul li[aria-selected]": {
        background: "#347",
        color: "white"
      },
      "&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]": {
        background: "#444"
      },
      ".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after": {
        content: '"···"',
        opacity: 0.5,
        display: "block",
        textAlign: "center"
      },
      ".cm-tooltip.cm-completionInfo": {
        position: "absolute",
        padding: "3px 9px",
        width: "max-content",
        maxWidth: `${400}px`,
        boxSizing: "border-box",
        whiteSpace: "pre-line"
      },
      ".cm-completionInfo.cm-completionInfo-left": { right: "100%" },
      ".cm-completionInfo.cm-completionInfo-right": { left: "100%" },
      ".cm-completionInfo.cm-completionInfo-left-narrow": { right: `${30}px` },
      ".cm-completionInfo.cm-completionInfo-right-narrow": { left: `${30}px` },
      "&light .cm-snippetField": { backgroundColor: "#00000022" },
      "&dark .cm-snippetField": { backgroundColor: "#ffffff22" },
      ".cm-snippetFieldPosition": {
        verticalAlign: "text-top",
        width: 0,
        height: "1.15em",
        display: "inline-block",
        margin: "0 -0.7px -.7em",
        borderLeft: "1.4px dotted #888"
      },
      ".cm-completionMatchedText": {
        textDecoration: "underline"
      },
      ".cm-completionDetail": {
        marginLeft: "0.5em",
        fontStyle: "italic"
      },
      ".cm-completionIcon": {
        fontSize: "90%",
        width: ".8em",
        display: "inline-block",
        textAlign: "center",
        paddingRight: ".6em",
        opacity: "0.6",
        boxSizing: "content-box"
      },
      ".cm-completionIcon-function, .cm-completionIcon-method": {
        "&:after": { content: "'ƒ'" }
      },
      ".cm-completionIcon-class": {
        "&:after": { content: "'○'" }
      },
      ".cm-completionIcon-interface": {
        "&:after": { content: "'◌'" }
      },
      ".cm-completionIcon-variable": {
        "&:after": { content: "'𝑥'" }
      },
      ".cm-completionIcon-constant": {
        "&:after": { content: "'𝐶'" }
      },
      ".cm-completionIcon-type": {
        "&:after": { content: "'𝑡'" }
      },
      ".cm-completionIcon-enum": {
        "&:after": { content: "'∪'" }
      },
      ".cm-completionIcon-property": {
        "&:after": { content: "'□'" }
      },
      ".cm-completionIcon-keyword": {
        "&:after": { content: "'🔑︎'" }
        // Disable emoji rendering
      },
      ".cm-completionIcon-namespace": {
        "&:after": { content: "'▢'" }
      },
      ".cm-completionIcon-text": {
        "&:after": { content: "'abc'", fontSize: "50%", verticalAlign: "middle" }
      }
    });
    const closedBracket = /* @__PURE__ */ new class extends RangeValue {
    }();
    closedBracket.startSide = 1;
    closedBracket.endSide = -1;
    function autocompletion(config2 = {}) {
      return [
        commitCharacters,
        completionState,
        completionConfig.of(config2),
        completionPlugin,
        completionKeymapExt,
        baseTheme$2
      ];
    }
    const completionKeymap = [
      { key: "Ctrl-Space", run: startCompletion },
      { mac: "Alt-`", run: startCompletion },
      { mac: "Alt-i", run: startCompletion },
      { key: "Escape", run: closeCompletion },
      { key: "ArrowDown", run: /* @__PURE__ */ moveCompletionSelection(true) },
      { key: "ArrowUp", run: /* @__PURE__ */ moveCompletionSelection(false) },
      { key: "PageDown", run: /* @__PURE__ */ moveCompletionSelection(true, "page") },
      { key: "PageUp", run: /* @__PURE__ */ moveCompletionSelection(false, "page") },
      { key: "Enter", run: acceptCompletion }
    ];
    const completionKeymapExt = /* @__PURE__ */ Prec.highest(/* @__PURE__ */ keymap.computeN([completionConfig], (state) => state.facet(completionConfig).defaultKeymap ? [completionKeymap] : []));
    let nextTagID$3 = 0;
    let Tag$3 = class Tag2 {
      /**
      @internal
      */
      constructor(name2, set2, base2, modified) {
        this.name = name2;
        this.set = set2;
        this.base = base2;
        this.modified = modified;
        this.id = nextTagID$3++;
      }
      toString() {
        let { name: name2 } = this;
        for (let mod2 of this.modified)
          if (mod2.name)
            name2 = `${mod2.name}(${name2})`;
        return name2;
      }
      static define(nameOrParent, parent) {
        let name2 = typeof nameOrParent == "string" ? nameOrParent : "?";
        if (nameOrParent instanceof Tag2)
          parent = nameOrParent;
        if (parent === null || parent === void 0 ? void 0 : parent.base)
          throw new Error("Can not derive from a modified tag");
        let tag = new Tag2(name2, [], null, []);
        tag.set.push(tag);
        if (parent)
          for (let t2 of parent.set)
            tag.set.push(t2);
        return tag;
      }
      /**
      Define a tag _modifier_, which is a function that, given a tag,
      will return a tag that is a subtag of the original. Applying the
      same modifier to a twice tag will return the same value (`m1(t1)
      == m1(t1)`) and applying multiple modifiers will, regardless or
      order, produce the same tag (`m1(m2(t1)) == m2(m1(t1))`).
      
      When multiple modifiers are applied to a given base tag, each
      smaller set of modifiers is registered as a parent, so that for
      example `m1(m2(m3(t1)))` is a subtype of `m1(m2(t1))`,
      `m1(m3(t1)`, and so on.
      */
      static defineModifier(name2) {
        let mod2 = new Modifier$3(name2);
        return (tag) => {
          if (tag.modified.indexOf(mod2) > -1)
            return tag;
          return Modifier$3.get(tag.base || tag, tag.modified.concat(mod2).sort((a, b) => a.id - b.id));
        };
      }
    };
    let nextModifierID$3 = 0;
    let Modifier$3 = class Modifier2 {
      constructor(name2) {
        this.name = name2;
        this.instances = [];
        this.id = nextModifierID$3++;
      }
      static get(base2, mods) {
        if (!mods.length)
          return base2;
        let exists = mods[0].instances.find((t2) => t2.base == base2 && sameArray$3(mods, t2.modified));
        if (exists)
          return exists;
        let set2 = [], tag = new Tag$3(base2.name, set2, base2, mods);
        for (let m of mods)
          m.instances.push(tag);
        let configs = powerSet$3(mods);
        for (let parent of base2.set)
          if (!parent.modified.length)
            for (let config2 of configs)
              set2.push(Modifier2.get(parent, config2));
        return tag;
      }
    };
    function sameArray$3(a, b) {
      return a.length == b.length && a.every((x2, i2) => x2 == b[i2]);
    }
    function powerSet$3(array) {
      let sets = [[]];
      for (let i2 = 0; i2 < array.length; i2++) {
        for (let j = 0, e = sets.length; j < e; j++) {
          sets.push(sets[j].concat(array[i2]));
        }
      }
      return sets.sort((a, b) => b.length - a.length);
    }
    function styleTags$2(spec) {
      let byName = /* @__PURE__ */ Object.create(null);
      for (let prop2 in spec) {
        let tags2 = spec[prop2];
        if (!Array.isArray(tags2))
          tags2 = [tags2];
        for (let part2 of prop2.split(" "))
          if (part2) {
            let pieces = [], mode = 2, rest = part2;
            for (let pos2 = 0; ; ) {
              if (rest == "..." && pos2 > 0 && pos2 + 3 == part2.length) {
                mode = 1;
                break;
              }
              let m = /^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(rest);
              if (!m)
                throw new RangeError("Invalid path: " + part2);
              pieces.push(m[0] == "*" ? "" : m[0][0] == '"' ? JSON.parse(m[0]) : m[0]);
              pos2 += m[0].length;
              if (pos2 == part2.length)
                break;
              let next = part2[pos2++];
              if (pos2 == part2.length && next == "!") {
                mode = 0;
                break;
              }
              if (next != "/")
                throw new RangeError("Invalid path: " + part2);
              rest = part2.slice(pos2);
            }
            let last = pieces.length - 1, inner2 = pieces[last];
            if (!inner2)
              throw new RangeError("Invalid path: " + part2);
            let rule = new Rule$3(tags2, mode, last > 0 ? pieces.slice(0, last) : null);
            byName[inner2] = rule.sort(byName[inner2]);
          }
      }
      return ruleNodeProp$2.add(byName);
    }
    const ruleNodeProp$2 = new NodeProp$1();
    let Rule$3 = class Rule {
      constructor(tags2, mode, context, next) {
        this.tags = tags2;
        this.mode = mode;
        this.context = context;
        this.next = next;
      }
      get opaque() {
        return this.mode == 0;
      }
      get inherit() {
        return this.mode == 1;
      }
      sort(other) {
        if (!other || other.depth < this.depth) {
          this.next = other;
          return this;
        }
        other.next = this.sort(other.next);
        return other;
      }
      get depth() {
        return this.context ? this.context.length : 0;
      }
    };
    Rule$3.empty = new Rule$3([], 2, null);
    function tagHighlighter$3(tags2, options2) {
      let map2 = /* @__PURE__ */ Object.create(null);
      for (let style2 of tags2) {
        if (!Array.isArray(style2.tag))
          map2[style2.tag.id] = style2.class;
        else
          for (let tag of style2.tag)
            map2[tag.id] = style2.class;
      }
      let { scope, all: all2 = null } = options2 || {};
      return {
        style: (tags3) => {
          let cls = all2;
          for (let tag of tags3) {
            for (let sub2 of tag.set) {
              let tagClass = map2[sub2.id];
              if (tagClass) {
                cls = cls ? cls + " " + tagClass : tagClass;
                break;
              }
            }
          }
          return cls;
        },
        scope
      };
    }
    function highlightTags$1(highlighters, tags2) {
      let result2 = null;
      for (let highlighter of highlighters) {
        let value2 = highlighter.style(tags2);
        if (value2)
          result2 = result2 ? result2 + " " + value2 : value2;
      }
      return result2;
    }
    function highlightTree$1(tree, highlighter, putStyle, from = 0, to2 = tree.length) {
      let builder = new HighlightBuilder$1(from, Array.isArray(highlighter) ? highlighter : [highlighter], putStyle);
      builder.highlightRange(tree.cursor(), from, to2, "", builder.highlighters);
      builder.flush(to2);
    }
    let HighlightBuilder$1 = class HighlightBuilder {
      constructor(at, highlighters, span) {
        this.at = at;
        this.highlighters = highlighters;
        this.span = span;
        this.class = "";
      }
      startSpan(at, cls) {
        if (cls != this.class) {
          this.flush(at);
          if (at > this.at)
            this.at = at;
          this.class = cls;
        }
      }
      flush(to2) {
        if (to2 > this.at && this.class)
          this.span(this.at, to2, this.class);
      }
      highlightRange(cursor, from, to2, inheritedClass, highlighters) {
        let { type, from: start2, to: end2 } = cursor;
        if (start2 >= to2 || end2 <= from)
          return;
        if (type.isTop)
          highlighters = this.highlighters.filter((h) => !h.scope || h.scope(type));
        let cls = inheritedClass;
        let rule = getStyleTags$1(cursor) || Rule$3.empty;
        let tagCls = highlightTags$1(highlighters, rule.tags);
        if (tagCls) {
          if (cls)
            cls += " ";
          cls += tagCls;
          if (rule.mode == 1)
            inheritedClass += (inheritedClass ? " " : "") + tagCls;
        }
        this.startSpan(Math.max(from, start2), cls);
        if (rule.opaque)
          return;
        let mounted = cursor.tree && cursor.tree.prop(NodeProp$1.mounted);
        if (mounted && mounted.overlay) {
          let inner2 = cursor.node.enter(mounted.overlay[0].from + start2, 1);
          let innerHighlighters = this.highlighters.filter((h) => !h.scope || h.scope(mounted.tree.type));
          let hasChild2 = cursor.firstChild();
          for (let i2 = 0, pos2 = start2; ; i2++) {
            let next = i2 < mounted.overlay.length ? mounted.overlay[i2] : null;
            let nextPos = next ? next.from + start2 : end2;
            let rangeFrom2 = Math.max(from, pos2), rangeTo2 = Math.min(to2, nextPos);
            if (rangeFrom2 < rangeTo2 && hasChild2) {
              while (cursor.from < rangeTo2) {
                this.highlightRange(cursor, rangeFrom2, rangeTo2, inheritedClass, highlighters);
                this.startSpan(Math.min(rangeTo2, cursor.to), cls);
                if (cursor.to >= nextPos || !cursor.nextSibling())
                  break;
              }
            }
            if (!next || nextPos > to2)
              break;
            pos2 = next.to + start2;
            if (pos2 > from) {
              this.highlightRange(inner2.cursor(), Math.max(from, next.from + start2), Math.min(to2, pos2), "", innerHighlighters);
              this.startSpan(Math.min(to2, pos2), cls);
            }
          }
          if (hasChild2)
            cursor.parent();
        } else if (cursor.firstChild()) {
          if (mounted)
            inheritedClass = "";
          do {
            if (cursor.to <= from)
              continue;
            if (cursor.from >= to2)
              break;
            this.highlightRange(cursor, from, to2, inheritedClass, highlighters);
            this.startSpan(Math.min(to2, cursor.to), cls);
          } while (cursor.nextSibling());
          cursor.parent();
        }
      }
    };
    function getStyleTags$1(node2) {
      let rule = node2.type.prop(ruleNodeProp$2);
      while (rule && rule.context && !node2.matchContext(rule.context))
        rule = rule.next;
      return rule || null;
    }
    const t$3 = Tag$3.define;
    const comment$3 = t$3(), name$3 = t$3(), typeName$3 = t$3(name$3), propertyName$3 = t$3(name$3), literal$3 = t$3(), string$3 = t$3(literal$3), number$3 = t$3(literal$3), content$3 = t$3(), heading$3 = t$3(content$3), keyword$3 = t$3(), operator$3 = t$3(), punctuation$3 = t$3(), bracket$3 = t$3(punctuation$3), meta$3 = t$3();
    const tags$3 = {
      /**
      A comment.
      */
      comment: comment$3,
      /**
      A line [comment](#highlight.tags.comment).
      */
      lineComment: t$3(comment$3),
      /**
      A block [comment](#highlight.tags.comment).
      */
      blockComment: t$3(comment$3),
      /**
      A documentation [comment](#highlight.tags.comment).
      */
      docComment: t$3(comment$3),
      /**
      Any kind of identifier.
      */
      name: name$3,
      /**
      The [name](#highlight.tags.name) of a variable.
      */
      variableName: t$3(name$3),
      /**
      A type [name](#highlight.tags.name).
      */
      typeName: typeName$3,
      /**
      A tag name (subtag of [`typeName`](#highlight.tags.typeName)).
      */
      tagName: t$3(typeName$3),
      /**
      A property or field [name](#highlight.tags.name).
      */
      propertyName: propertyName$3,
      /**
      An attribute name (subtag of [`propertyName`](#highlight.tags.propertyName)).
      */
      attributeName: t$3(propertyName$3),
      /**
      The [name](#highlight.tags.name) of a class.
      */
      className: t$3(name$3),
      /**
      A label [name](#highlight.tags.name).
      */
      labelName: t$3(name$3),
      /**
      A namespace [name](#highlight.tags.name).
      */
      namespace: t$3(name$3),
      /**
      The [name](#highlight.tags.name) of a macro.
      */
      macroName: t$3(name$3),
      /**
      A literal value.
      */
      literal: literal$3,
      /**
      A string [literal](#highlight.tags.literal).
      */
      string: string$3,
      /**
      A documentation [string](#highlight.tags.string).
      */
      docString: t$3(string$3),
      /**
      A character literal (subtag of [string](#highlight.tags.string)).
      */
      character: t$3(string$3),
      /**
      An attribute value (subtag of [string](#highlight.tags.string)).
      */
      attributeValue: t$3(string$3),
      /**
      A number [literal](#highlight.tags.literal).
      */
      number: number$3,
      /**
      An integer [number](#highlight.tags.number) literal.
      */
      integer: t$3(number$3),
      /**
      A floating-point [number](#highlight.tags.number) literal.
      */
      float: t$3(number$3),
      /**
      A boolean [literal](#highlight.tags.literal).
      */
      bool: t$3(literal$3),
      /**
      Regular expression [literal](#highlight.tags.literal).
      */
      regexp: t$3(literal$3),
      /**
      An escape [literal](#highlight.tags.literal), for example a
      backslash escape in a string.
      */
      escape: t$3(literal$3),
      /**
      A color [literal](#highlight.tags.literal).
      */
      color: t$3(literal$3),
      /**
      A URL [literal](#highlight.tags.literal).
      */
      url: t$3(literal$3),
      /**
      A language keyword.
      */
      keyword: keyword$3,
      /**
      The [keyword](#highlight.tags.keyword) for the self or this
      object.
      */
      self: t$3(keyword$3),
      /**
      The [keyword](#highlight.tags.keyword) for null.
      */
      null: t$3(keyword$3),
      /**
      A [keyword](#highlight.tags.keyword) denoting some atomic value.
      */
      atom: t$3(keyword$3),
      /**
      A [keyword](#highlight.tags.keyword) that represents a unit.
      */
      unit: t$3(keyword$3),
      /**
      A modifier [keyword](#highlight.tags.keyword).
      */
      modifier: t$3(keyword$3),
      /**
      A [keyword](#highlight.tags.keyword) that acts as an operator.
      */
      operatorKeyword: t$3(keyword$3),
      /**
      A control-flow related [keyword](#highlight.tags.keyword).
      */
      controlKeyword: t$3(keyword$3),
      /**
      A [keyword](#highlight.tags.keyword) that defines something.
      */
      definitionKeyword: t$3(keyword$3),
      /**
      A [keyword](#highlight.tags.keyword) related to defining or
      interfacing with modules.
      */
      moduleKeyword: t$3(keyword$3),
      /**
      An operator.
      */
      operator: operator$3,
      /**
      An [operator](#highlight.tags.operator) that dereferences something.
      */
      derefOperator: t$3(operator$3),
      /**
      Arithmetic-related [operator](#highlight.tags.operator).
      */
      arithmeticOperator: t$3(operator$3),
      /**
      Logical [operator](#highlight.tags.operator).
      */
      logicOperator: t$3(operator$3),
      /**
      Bit [operator](#highlight.tags.operator).
      */
      bitwiseOperator: t$3(operator$3),
      /**
      Comparison [operator](#highlight.tags.operator).
      */
      compareOperator: t$3(operator$3),
      /**
      [Operator](#highlight.tags.operator) that updates its operand.
      */
      updateOperator: t$3(operator$3),
      /**
      [Operator](#highlight.tags.operator) that defines something.
      */
      definitionOperator: t$3(operator$3),
      /**
      Type-related [operator](#highlight.tags.operator).
      */
      typeOperator: t$3(operator$3),
      /**
      Control-flow [operator](#highlight.tags.operator).
      */
      controlOperator: t$3(operator$3),
      /**
      Program or markup punctuation.
      */
      punctuation: punctuation$3,
      /**
      [Punctuation](#highlight.tags.punctuation) that separates
      things.
      */
      separator: t$3(punctuation$3),
      /**
      Bracket-style [punctuation](#highlight.tags.punctuation).
      */
      bracket: bracket$3,
      /**
      Angle [brackets](#highlight.tags.bracket) (usually `<` and `>`
      tokens).
      */
      angleBracket: t$3(bracket$3),
      /**
      Square [brackets](#highlight.tags.bracket) (usually `[` and `]`
      tokens).
      */
      squareBracket: t$3(bracket$3),
      /**
      Parentheses (usually `(` and `)` tokens). Subtag of
      [bracket](#highlight.tags.bracket).
      */
      paren: t$3(bracket$3),
      /**
      Braces (usually `{` and `}` tokens). Subtag of
      [bracket](#highlight.tags.bracket).
      */
      brace: t$3(bracket$3),
      /**
      Content, for example plain text in XML or markup documents.
      */
      content: content$3,
      /**
      [Content](#highlight.tags.content) that represents a heading.
      */
      heading: heading$3,
      /**
      A level 1 [heading](#highlight.tags.heading).
      */
      heading1: t$3(heading$3),
      /**
      A level 2 [heading](#highlight.tags.heading).
      */
      heading2: t$3(heading$3),
      /**
      A level 3 [heading](#highlight.tags.heading).
      */
      heading3: t$3(heading$3),
      /**
      A level 4 [heading](#highlight.tags.heading).
      */
      heading4: t$3(heading$3),
      /**
      A level 5 [heading](#highlight.tags.heading).
      */
      heading5: t$3(heading$3),
      /**
      A level 6 [heading](#highlight.tags.heading).
      */
      heading6: t$3(heading$3),
      /**
      A prose [content](#highlight.tags.content) separator (such as a horizontal rule).
      */
      contentSeparator: t$3(content$3),
      /**
      [Content](#highlight.tags.content) that represents a list.
      */
      list: t$3(content$3),
      /**
      [Content](#highlight.tags.content) that represents a quote.
      */
      quote: t$3(content$3),
      /**
      [Content](#highlight.tags.content) that is emphasized.
      */
      emphasis: t$3(content$3),
      /**
      [Content](#highlight.tags.content) that is styled strong.
      */
      strong: t$3(content$3),
      /**
      [Content](#highlight.tags.content) that is part of a link.
      */
      link: t$3(content$3),
      /**
      [Content](#highlight.tags.content) that is styled as code or
      monospace.
      */
      monospace: t$3(content$3),
      /**
      [Content](#highlight.tags.content) that has a strike-through
      style.
      */
      strikethrough: t$3(content$3),
      /**
      Inserted text in a change-tracking format.
      */
      inserted: t$3(),
      /**
      Deleted text.
      */
      deleted: t$3(),
      /**
      Changed text.
      */
      changed: t$3(),
      /**
      An invalid or unsyntactic element.
      */
      invalid: t$3(),
      /**
      Metadata or meta-instruction.
      */
      meta: meta$3,
      /**
      [Metadata](#highlight.tags.meta) that applies to the entire
      document.
      */
      documentMeta: t$3(meta$3),
      /**
      [Metadata](#highlight.tags.meta) that annotates or adds
      attributes to a given syntactic element.
      */
      annotation: t$3(meta$3),
      /**
      Processing instruction or preprocessor directive. Subtag of
      [meta](#highlight.tags.meta).
      */
      processingInstruction: t$3(meta$3),
      /**
      [Modifier](#highlight.Tag^defineModifier) that indicates that a
      given element is being defined. Expected to be used with the
      various [name](#highlight.tags.name) tags.
      */
      definition: Tag$3.defineModifier("definition"),
      /**
      [Modifier](#highlight.Tag^defineModifier) that indicates that
      something is constant. Mostly expected to be used with
      [variable names](#highlight.tags.variableName).
      */
      constant: Tag$3.defineModifier("constant"),
      /**
      [Modifier](#highlight.Tag^defineModifier) used to indicate that
      a [variable](#highlight.tags.variableName) or [property
      name](#highlight.tags.propertyName) is being called or defined
      as a function.
      */
      function: Tag$3.defineModifier("function"),
      /**
      [Modifier](#highlight.Tag^defineModifier) that can be applied to
      [names](#highlight.tags.name) to indicate that they belong to
      the language's standard environment.
      */
      standard: Tag$3.defineModifier("standard"),
      /**
      [Modifier](#highlight.Tag^defineModifier) that indicates a given
      [names](#highlight.tags.name) is local to some scope.
      */
      local: Tag$3.defineModifier("local"),
      /**
      A generic variant [modifier](#highlight.Tag^defineModifier) that
      can be used to tag language-specific alternative variants of
      some common tag. It is recommended for themes to define special
      forms of at least the [string](#highlight.tags.string) and
      [variable name](#highlight.tags.variableName) tags, since those
      come up a lot.
      */
      special: Tag$3.defineModifier("special")
    };
    for (let name2 in tags$3) {
      let val = tags$3[name2];
      if (val instanceof Tag$3)
        val.name = name2;
    }
    tagHighlighter$3([
      { tag: tags$3.link, class: "tok-link" },
      { tag: tags$3.heading, class: "tok-heading" },
      { tag: tags$3.emphasis, class: "tok-emphasis" },
      { tag: tags$3.strong, class: "tok-strong" },
      { tag: tags$3.keyword, class: "tok-keyword" },
      { tag: tags$3.atom, class: "tok-atom" },
      { tag: tags$3.bool, class: "tok-bool" },
      { tag: tags$3.url, class: "tok-url" },
      { tag: tags$3.labelName, class: "tok-labelName" },
      { tag: tags$3.inserted, class: "tok-inserted" },
      { tag: tags$3.deleted, class: "tok-deleted" },
      { tag: tags$3.literal, class: "tok-literal" },
      { tag: tags$3.string, class: "tok-string" },
      { tag: tags$3.number, class: "tok-number" },
      { tag: [tags$3.regexp, tags$3.escape, tags$3.special(tags$3.string)], class: "tok-string2" },
      { tag: tags$3.variableName, class: "tok-variableName" },
      { tag: tags$3.local(tags$3.variableName), class: "tok-variableName tok-local" },
      { tag: tags$3.definition(tags$3.variableName), class: "tok-variableName tok-definition" },
      { tag: tags$3.special(tags$3.variableName), class: "tok-variableName2" },
      { tag: tags$3.definition(tags$3.propertyName), class: "tok-propertyName tok-definition" },
      { tag: tags$3.typeName, class: "tok-typeName" },
      { tag: tags$3.namespace, class: "tok-namespace" },
      { tag: tags$3.className, class: "tok-className" },
      { tag: tags$3.macroName, class: "tok-macroName" },
      { tag: tags$3.propertyName, class: "tok-propertyName" },
      { tag: tags$3.operator, class: "tok-operator" },
      { tag: tags$3.comment, class: "tok-comment" },
      { tag: tags$3.meta, class: "tok-meta" },
      { tag: tags$3.invalid, class: "tok-invalid" },
      { tag: tags$3.punctuation, class: "tok-punctuation" }
    ]);
    var _a$2;
    const languageDataProp$2 = /* @__PURE__ */ new NodeProp$1();
    function defineLanguageFacet(baseData) {
      return Facet.define({
        combine: baseData ? (values) => values.concat(baseData) : void 0
      });
    }
    const sublanguageProp$2 = /* @__PURE__ */ new NodeProp$1();
    let Language$2 = class Language {
      /**
      Construct a language object. If you need to invoke this
      directly, first define a data facet with
      [`defineLanguageFacet`](https://codemirror.net/6/docs/ref/#language.defineLanguageFacet), and then
      configure your parser to [attach](https://codemirror.net/6/docs/ref/#language.languageDataProp) it
      to the language's outer syntax node.
      */
      constructor(data, parser2, extraExtensions = [], name2 = "") {
        this.data = data;
        this.name = name2;
        if (!EditorState.prototype.hasOwnProperty("tree"))
          Object.defineProperty(EditorState.prototype, "tree", { get() {
            return syntaxTree$2(this);
          } });
        this.parser = parser2;
        this.extension = [
          language$3.of(this),
          EditorState.languageData.of((state, pos2, side) => {
            let top2 = topNodeAt$2(state, pos2, side), data2 = top2.type.prop(languageDataProp$2);
            if (!data2)
              return [];
            let base2 = state.facet(data2), sub2 = top2.type.prop(sublanguageProp$2);
            if (sub2) {
              let innerNode = top2.resolve(pos2 - top2.from, side);
              for (let sublang of sub2)
                if (sublang.test(innerNode, state)) {
                  let data3 = state.facet(sublang.facet);
                  return sublang.type == "replace" ? data3 : data3.concat(base2);
                }
            }
            return base2;
          })
        ].concat(extraExtensions);
      }
      /**
      Query whether this language is active at the given position.
      */
      isActiveAt(state, pos2, side = -1) {
        return topNodeAt$2(state, pos2, side).type.prop(languageDataProp$2) == this.data;
      }
      /**
      Find the document regions that were parsed using this language.
      The returned regions will _include_ any nested languages rooted
      in this language, when those exist.
      */
      findRegions(state) {
        let lang2 = state.facet(language$3);
        if ((lang2 === null || lang2 === void 0 ? void 0 : lang2.data) == this.data)
          return [{ from: 0, to: state.doc.length }];
        if (!lang2 || !lang2.allowsNesting)
          return [];
        let result2 = [];
        let explore = (tree, from) => {
          if (tree.prop(languageDataProp$2) == this.data) {
            result2.push({ from, to: from + tree.length });
            return;
          }
          let mount2 = tree.prop(NodeProp$1.mounted);
          if (mount2) {
            if (mount2.tree.prop(languageDataProp$2) == this.data) {
              if (mount2.overlay)
                for (let r2 of mount2.overlay)
                  result2.push({ from: r2.from + from, to: r2.to + from });
              else
                result2.push({ from, to: from + tree.length });
              return;
            } else if (mount2.overlay) {
              let size = result2.length;
              explore(mount2.tree, mount2.overlay[0].from + from);
              if (result2.length > size)
                return;
            }
          }
          for (let i2 = 0; i2 < tree.children.length; i2++) {
            let ch3 = tree.children[i2];
            if (ch3 instanceof Tree)
              explore(ch3, tree.positions[i2] + from);
          }
        };
        explore(syntaxTree$2(state), 0);
        return result2;
      }
      /**
      Indicates whether this language allows nested languages. The
      default implementation returns true.
      */
      get allowsNesting() {
        return true;
      }
    };
    Language$2.setState = /* @__PURE__ */ StateEffect.define();
    function topNodeAt$2(state, pos2, side) {
      let topLang = state.facet(language$3), tree = syntaxTree$2(state).topNode;
      if (!topLang || topLang.allowsNesting) {
        for (let node2 = tree; node2; node2 = node2.enter(pos2, side, IterMode$1.ExcludeBuffers))
          if (node2.type.isTop)
            tree = node2;
      }
      return tree;
    }
    function syntaxTree$2(state) {
      let field = state.field(Language$2.state, false);
      return field ? field.tree : Tree.empty;
    }
    let DocInput$2 = class DocInput {
      /**
      Create an input object for the given document.
      */
      constructor(doc2) {
        this.doc = doc2;
        this.cursorPos = 0;
        this.string = "";
        this.cursor = doc2.iter();
      }
      get length() {
        return this.doc.length;
      }
      syncTo(pos2) {
        this.string = this.cursor.next(pos2 - this.cursorPos).value;
        this.cursorPos = pos2 + this.string.length;
        return this.cursorPos - this.string.length;
      }
      chunk(pos2) {
        this.syncTo(pos2);
        return this.string;
      }
      get lineChunks() {
        return true;
      }
      read(from, to2) {
        let stringStart = this.cursorPos - this.string.length;
        if (from < stringStart || to2 >= this.cursorPos)
          return this.doc.sliceString(from, to2);
        else
          return this.string.slice(from - stringStart, to2 - stringStart);
      }
    };
    let currentContext$2 = null;
    let ParseContext$2 = class ParseContext2 {
      constructor(parser2, state, fragments = [], tree, treeLen, viewport2, skipped, scheduleOn) {
        this.parser = parser2;
        this.state = state;
        this.fragments = fragments;
        this.tree = tree;
        this.treeLen = treeLen;
        this.viewport = viewport2;
        this.skipped = skipped;
        this.scheduleOn = scheduleOn;
        this.parse = null;
        this.tempSkipped = [];
      }
      /**
      @internal
      */
      static create(parser2, state, viewport2) {
        return new ParseContext2(parser2, state, [], Tree.empty, 0, viewport2, [], null);
      }
      startParse() {
        return this.parser.startParse(new DocInput$2(this.state.doc), this.fragments);
      }
      /**
      @internal
      */
      work(until, upto) {
        if (upto != null && upto >= this.state.doc.length)
          upto = void 0;
        if (this.tree != Tree.empty && this.isDone(upto !== null && upto !== void 0 ? upto : this.state.doc.length)) {
          this.takeTree();
          return true;
        }
        return this.withContext(() => {
          var _a2;
          if (typeof until == "number") {
            let endTime = Date.now() + until;
            until = () => Date.now() > endTime;
          }
          if (!this.parse)
            this.parse = this.startParse();
          if (upto != null && (this.parse.stoppedAt == null || this.parse.stoppedAt > upto) && upto < this.state.doc.length)
            this.parse.stopAt(upto);
          for (; ; ) {
            let done = this.parse.advance();
            if (done) {
              this.fragments = this.withoutTempSkipped(TreeFragment.addTree(done, this.fragments, this.parse.stoppedAt != null));
              this.treeLen = (_a2 = this.parse.stoppedAt) !== null && _a2 !== void 0 ? _a2 : this.state.doc.length;
              this.tree = done;
              this.parse = null;
              if (this.treeLen < (upto !== null && upto !== void 0 ? upto : this.state.doc.length))
                this.parse = this.startParse();
              else
                return true;
            }
            if (until())
              return false;
          }
        });
      }
      /**
      @internal
      */
      takeTree() {
        let pos2, tree;
        if (this.parse && (pos2 = this.parse.parsedPos) >= this.treeLen) {
          if (this.parse.stoppedAt == null || this.parse.stoppedAt > pos2)
            this.parse.stopAt(pos2);
          this.withContext(() => {
            while (!(tree = this.parse.advance())) {
            }
          });
          this.treeLen = pos2;
          this.tree = tree;
          this.fragments = this.withoutTempSkipped(TreeFragment.addTree(this.tree, this.fragments, true));
          this.parse = null;
        }
      }
      withContext(f) {
        let prev = currentContext$2;
        currentContext$2 = this;
        try {
          return f();
        } finally {
          currentContext$2 = prev;
        }
      }
      withoutTempSkipped(fragments) {
        for (let r2; r2 = this.tempSkipped.pop(); )
          fragments = cutFragments$2(fragments, r2.from, r2.to);
        return fragments;
      }
      /**
      @internal
      */
      changes(changes, newState) {
        let { fragments, tree, treeLen, viewport: viewport2, skipped } = this;
        this.takeTree();
        if (!changes.empty) {
          let ranges = [];
          changes.iterChangedRanges((fromA, toA, fromB, toB) => ranges.push({ fromA, toA, fromB, toB }));
          fragments = TreeFragment.applyChanges(fragments, ranges);
          tree = Tree.empty;
          treeLen = 0;
          viewport2 = { from: changes.mapPos(viewport2.from, -1), to: changes.mapPos(viewport2.to, 1) };
          if (this.skipped.length) {
            skipped = [];
            for (let r2 of this.skipped) {
              let from = changes.mapPos(r2.from, 1), to2 = changes.mapPos(r2.to, -1);
              if (from < to2)
                skipped.push({ from, to: to2 });
            }
          }
        }
        return new ParseContext2(this.parser, newState, fragments, tree, treeLen, viewport2, skipped, this.scheduleOn);
      }
      /**
      @internal
      */
      updateViewport(viewport2) {
        if (this.viewport.from == viewport2.from && this.viewport.to == viewport2.to)
          return false;
        this.viewport = viewport2;
        let startLen = this.skipped.length;
        for (let i2 = 0; i2 < this.skipped.length; i2++) {
          let { from, to: to2 } = this.skipped[i2];
          if (from < viewport2.to && to2 > viewport2.from) {
            this.fragments = cutFragments$2(this.fragments, from, to2);
            this.skipped.splice(i2--, 1);
          }
        }
        if (this.skipped.length >= startLen)
          return false;
        this.reset();
        return true;
      }
      /**
      @internal
      */
      reset() {
        if (this.parse) {
          this.takeTree();
          this.parse = null;
        }
      }
      /**
      Notify the parse scheduler that the given region was skipped
      because it wasn't in view, and the parse should be restarted
      when it comes into view.
      */
      skipUntilInView(from, to2) {
        this.skipped.push({ from, to: to2 });
      }
      /**
      Returns a parser intended to be used as placeholder when
      asynchronously loading a nested parser. It'll skip its input and
      mark it as not-really-parsed, so that the next update will parse
      it again.
      
      When `until` is given, a reparse will be scheduled when that
      promise resolves.
      */
      static getSkippingParser(until) {
        return new class extends Parser {
          createParse(input2, fragments, ranges) {
            let from = ranges[0].from, to2 = ranges[ranges.length - 1].to;
            let parser2 = {
              parsedPos: from,
              advance() {
                let cx = currentContext$2;
                if (cx) {
                  for (let r2 of ranges)
                    cx.tempSkipped.push(r2);
                  if (until)
                    cx.scheduleOn = cx.scheduleOn ? Promise.all([cx.scheduleOn, until]) : until;
                }
                this.parsedPos = to2;
                return new Tree(NodeType$1.none, [], [], to2 - from);
              },
              stoppedAt: null,
              stopAt() {
              }
            };
            return parser2;
          }
        }();
      }
      /**
      @internal
      */
      isDone(upto) {
        upto = Math.min(upto, this.state.doc.length);
        let frags = this.fragments;
        return this.treeLen >= upto && frags.length && frags[0].from == 0 && frags[0].to >= upto;
      }
      /**
      Get the context for the current parse, or `null` if no editor
      parse is in progress.
      */
      static get() {
        return currentContext$2;
      }
    };
    function cutFragments$2(fragments, from, to2) {
      return TreeFragment.applyChanges(fragments, [{ fromA: from, toA: to2, fromB: from, toB: to2 }]);
    }
    let LanguageState$2 = class LanguageState2 {
      constructor(context) {
        this.context = context;
        this.tree = context.tree;
      }
      apply(tr2) {
        if (!tr2.docChanged && this.tree == this.context.tree)
          return this;
        let newCx = this.context.changes(tr2.changes, tr2.state);
        let upto = this.context.treeLen == tr2.startState.doc.length ? void 0 : Math.max(tr2.changes.mapPos(this.context.treeLen), newCx.viewport.to);
        if (!newCx.work(20, upto))
          newCx.takeTree();
        return new LanguageState2(newCx);
      }
      static init(state) {
        let vpTo = Math.min(3e3, state.doc.length);
        let parseState2 = ParseContext$2.create(state.facet(language$3).parser, state, { from: 0, to: vpTo });
        if (!parseState2.work(20, vpTo))
          parseState2.takeTree();
        return new LanguageState2(parseState2);
      }
    };
    Language$2.state = /* @__PURE__ */ StateField.define({
      create: LanguageState$2.init,
      update(value2, tr2) {
        for (let e of tr2.effects)
          if (e.is(Language$2.setState))
            return e.value;
        if (tr2.startState.facet(language$3) != tr2.state.facet(language$3))
          return LanguageState$2.init(tr2.state);
        return value2.apply(tr2);
      }
    });
    let requestIdle$2 = (callback) => {
      let timeout = setTimeout(
        () => callback(),
        500
        /* Work.MaxPause */
      );
      return () => clearTimeout(timeout);
    };
    if (typeof requestIdleCallback != "undefined")
      requestIdle$2 = (callback) => {
        let idle = -1, timeout = setTimeout(
          () => {
            idle = requestIdleCallback(callback, {
              timeout: 500 - 100
              /* Work.MinPause */
            });
          },
          100
          /* Work.MinPause */
        );
        return () => idle < 0 ? clearTimeout(timeout) : cancelIdleCallback(idle);
      };
    const isInputPending$2 = typeof navigator != "undefined" && ((_a$2 = navigator.scheduling) === null || _a$2 === void 0 ? void 0 : _a$2.isInputPending) ? () => navigator.scheduling.isInputPending() : null;
    const parseWorker$2 = /* @__PURE__ */ ViewPlugin.fromClass(class ParseWorker {
      constructor(view) {
        this.view = view;
        this.working = null;
        this.workScheduled = 0;
        this.chunkEnd = -1;
        this.chunkBudget = -1;
        this.work = this.work.bind(this);
        this.scheduleWork();
      }
      update(update) {
        let cx = this.view.state.field(Language$2.state).context;
        if (cx.updateViewport(update.view.viewport) || this.view.viewport.to > cx.treeLen)
          this.scheduleWork();
        if (update.docChanged || update.selectionSet) {
          if (this.view.hasFocus)
            this.chunkBudget += 50;
          this.scheduleWork();
        }
        this.checkAsyncSchedule(cx);
      }
      scheduleWork() {
        if (this.working)
          return;
        let { state } = this.view, field = state.field(Language$2.state);
        if (field.tree != field.context.tree || !field.context.isDone(state.doc.length))
          this.working = requestIdle$2(this.work);
      }
      work(deadline) {
        this.working = null;
        let now = Date.now();
        if (this.chunkEnd < now && (this.chunkEnd < 0 || this.view.hasFocus)) {
          this.chunkEnd = now + 3e4;
          this.chunkBudget = 3e3;
        }
        if (this.chunkBudget <= 0)
          return;
        let { state, viewport: { to: vpTo } } = this.view, field = state.field(Language$2.state);
        if (field.tree == field.context.tree && field.context.isDone(
          vpTo + 1e5
          /* Work.MaxParseAhead */
        ))
          return;
        let endTime = Date.now() + Math.min(this.chunkBudget, 100, deadline && !isInputPending$2 ? Math.max(25, deadline.timeRemaining() - 5) : 1e9);
        let viewportFirst = field.context.treeLen < vpTo && state.doc.length > vpTo + 1e3;
        let done = field.context.work(() => {
          return isInputPending$2 && isInputPending$2() || Date.now() > endTime;
        }, vpTo + (viewportFirst ? 0 : 1e5));
        this.chunkBudget -= Date.now() - now;
        if (done || this.chunkBudget <= 0) {
          field.context.takeTree();
          this.view.dispatch({ effects: Language$2.setState.of(new LanguageState$2(field.context)) });
        }
        if (this.chunkBudget > 0 && !(done && !viewportFirst))
          this.scheduleWork();
        this.checkAsyncSchedule(field.context);
      }
      checkAsyncSchedule(cx) {
        if (cx.scheduleOn) {
          this.workScheduled++;
          cx.scheduleOn.then(() => this.scheduleWork()).catch((err2) => logException(this.view.state, err2)).then(() => this.workScheduled--);
          cx.scheduleOn = null;
        }
      }
      destroy() {
        if (this.working)
          this.working();
      }
      isWorking() {
        return !!(this.working || this.workScheduled > 0);
      }
    }, {
      eventHandlers: { focus() {
        this.scheduleWork();
      } }
    });
    const language$3 = /* @__PURE__ */ Facet.define({
      combine(languages) {
        return languages.length ? languages[0] : null;
      },
      enables: (language2) => [
        Language$2.state,
        parseWorker$2,
        EditorView.contentAttributes.compute([language2], (state) => {
          let lang2 = state.facet(language2);
          return lang2 && lang2.name ? { "data-language": lang2.name } : {};
        })
      ]
    });
    const indentUnit$1 = /* @__PURE__ */ Facet.define({
      combine: (values) => {
        if (!values.length)
          return "  ";
        let unit = values[0];
        if (!unit || /\S/.test(unit) || Array.from(unit).some((e) => e != unit[0]))
          throw new Error("Invalid indent unit: " + JSON.stringify(values[0]));
        return unit;
      }
    });
    function getIndentUnit$1(state) {
      let unit = state.facet(indentUnit$1);
      return unit.charCodeAt(0) == 9 ? state.tabSize * unit.length : unit.length;
    }
    const indentNodeProp$1 = /* @__PURE__ */ new NodeProp$1();
    let HighlightStyle$1 = class HighlightStyle2 {
      constructor(specs, options2) {
        this.specs = specs;
        let modSpec;
        function def(spec) {
          let cls = StyleModule.newName();
          (modSpec || (modSpec = /* @__PURE__ */ Object.create(null)))["." + cls] = spec;
          return cls;
        }
        const all2 = typeof options2.all == "string" ? options2.all : options2.all ? def(options2.all) : void 0;
        const scopeOpt = options2.scope;
        this.scope = scopeOpt instanceof Language$2 ? (type) => type.prop(languageDataProp$2) == scopeOpt.data : scopeOpt ? (type) => type == scopeOpt : void 0;
        this.style = tagHighlighter$3(specs.map((style2) => ({
          tag: style2.tag,
          class: style2.class || def(Object.assign({}, style2, { tag: null }))
        })), {
          all: all2
        }).style;
        this.module = modSpec ? new StyleModule(modSpec) : null;
        this.themeType = options2.themeType;
      }
      /**
      Create a highlighter style that associates the given styles to
      the given tags. The specs must be objects that hold a style tag
      or array of tags in their `tag` property, and either a single
      `class` property providing a static CSS class (for highlighter
      that rely on external styling), or a
      [`style-mod`](https://github.com/marijnh/style-mod#documentation)-style
      set of CSS properties (which define the styling for those tags).
      
      The CSS rules created for a highlighter will be emitted in the
      order of the spec's properties. That means that for elements that
      have multiple tags associated with them, styles defined further
      down in the list will have a higher CSS precedence than styles
      defined earlier.
      */
      static define(specs, options2) {
        return new HighlightStyle2(specs, options2 || {});
      }
    };
    const highlighterFacet$1 = /* @__PURE__ */ Facet.define();
    const fallbackHighlighter$1 = /* @__PURE__ */ Facet.define({
      combine(values) {
        return values.length ? [values[0]] : null;
      }
    });
    function getHighlighters$1(state) {
      let main2 = state.facet(highlighterFacet$1);
      return main2.length ? main2 : state.facet(fallbackHighlighter$1);
    }
    function syntaxHighlighting$1(highlighter, options2) {
      let ext = [treeHighlighter$1], themeType;
      if (highlighter instanceof HighlightStyle$1) {
        if (highlighter.module)
          ext.push(EditorView.styleModule.of(highlighter.module));
        themeType = highlighter.themeType;
      }
      if (themeType)
        ext.push(highlighterFacet$1.computeN([EditorView.darkTheme], (state) => {
          return state.facet(EditorView.darkTheme) == (themeType == "dark") ? [highlighter] : [];
        }));
      else
        ext.push(highlighterFacet$1.of(highlighter));
      return ext;
    }
    let TreeHighlighter$1 = class TreeHighlighter {
      constructor(view) {
        this.markCache = /* @__PURE__ */ Object.create(null);
        this.tree = syntaxTree$2(view.state);
        this.decorations = this.buildDeco(view, getHighlighters$1(view.state));
        this.decoratedTo = view.viewport.to;
      }
      update(update) {
        let tree = syntaxTree$2(update.state), highlighters = getHighlighters$1(update.state);
        let styleChange = highlighters != getHighlighters$1(update.startState);
        let { viewport: viewport2 } = update.view, decoratedToMapped = update.changes.mapPos(this.decoratedTo, 1);
        if (tree.length < viewport2.to && !styleChange && tree.type == this.tree.type && decoratedToMapped >= viewport2.to) {
          this.decorations = this.decorations.map(update.changes);
          this.decoratedTo = decoratedToMapped;
        } else if (tree != this.tree || update.viewportChanged || styleChange) {
          this.tree = tree;
          this.decorations = this.buildDeco(update.view, highlighters);
          this.decoratedTo = viewport2.to;
        }
      }
      buildDeco(view, highlighters) {
        if (!highlighters || !this.tree.length)
          return Decoration.none;
        let builder = new RangeSetBuilder();
        for (let { from, to: to2 } of view.visibleRanges) {
          highlightTree$1(this.tree, highlighters, (from2, to3, style2) => {
            builder.add(from2, to3, this.markCache[style2] || (this.markCache[style2] = Decoration.mark({ class: style2 })));
          }, from, to2);
        }
        return builder.finish();
      }
    };
    const treeHighlighter$1 = /* @__PURE__ */ Prec.high(/* @__PURE__ */ ViewPlugin.fromClass(TreeHighlighter$1, {
      decorations: (v) => v.decorations
    }));
    const baseTheme$1 = /* @__PURE__ */ EditorView.baseTheme({
      "&.cm-focused .cm-matchingBracket": { backgroundColor: "#328c8252" },
      "&.cm-focused .cm-nonmatchingBracket": { backgroundColor: "#bb555544" }
    });
    const DefaultScanDist$1 = 1e4, DefaultBrackets$1 = "()[]{}";
    const bracketMatchingConfig = /* @__PURE__ */ Facet.define({
      combine(configs) {
        return combineConfig(configs, {
          afterCursor: true,
          brackets: DefaultBrackets$1,
          maxScanDistance: DefaultScanDist$1,
          renderMatch: defaultRenderMatch
        });
      }
    });
    const matchingMark = /* @__PURE__ */ Decoration.mark({ class: "cm-matchingBracket" }), nonmatchingMark = /* @__PURE__ */ Decoration.mark({ class: "cm-nonmatchingBracket" });
    function defaultRenderMatch(match) {
      let decorations2 = [];
      let mark = match.matched ? matchingMark : nonmatchingMark;
      decorations2.push(mark.range(match.start.from, match.start.to));
      if (match.end)
        decorations2.push(mark.range(match.end.from, match.end.to));
      return decorations2;
    }
    const bracketMatchingState = /* @__PURE__ */ StateField.define({
      create() {
        return Decoration.none;
      },
      update(deco, tr2) {
        if (!tr2.docChanged && !tr2.selection)
          return deco;
        let decorations2 = [];
        let config2 = tr2.state.facet(bracketMatchingConfig);
        for (let range2 of tr2.state.selection.ranges) {
          if (!range2.empty)
            continue;
          let match = matchBrackets$1(tr2.state, range2.head, -1, config2) || range2.head > 0 && matchBrackets$1(tr2.state, range2.head - 1, 1, config2) || config2.afterCursor && (matchBrackets$1(tr2.state, range2.head, 1, config2) || range2.head < tr2.state.doc.length && matchBrackets$1(tr2.state, range2.head + 1, -1, config2));
          if (match)
            decorations2 = decorations2.concat(config2.renderMatch(match, tr2.state));
        }
        return Decoration.set(decorations2, true);
      },
      provide: (f) => EditorView.decorations.from(f)
    });
    const bracketMatchingUnique = [
      bracketMatchingState,
      baseTheme$1
    ];
    function bracketMatching(config2 = {}) {
      return [bracketMatchingConfig.of(config2), bracketMatchingUnique];
    }
    const bracketMatchingHandle$1 = /* @__PURE__ */ new NodeProp$1();
    function matchingNodes$1(node2, dir, brackets) {
      let byProp = node2.prop(dir < 0 ? NodeProp$1.openedBy : NodeProp$1.closedBy);
      if (byProp)
        return byProp;
      if (node2.name.length == 1) {
        let index = brackets.indexOf(node2.name);
        if (index > -1 && index % 2 == (dir < 0 ? 1 : 0))
          return [brackets[index + dir]];
      }
      return null;
    }
    function findHandle$1(node2) {
      let hasHandle = node2.type.prop(bracketMatchingHandle$1);
      return hasHandle ? hasHandle(node2.node) : node2;
    }
    function matchBrackets$1(state, pos2, dir, config2 = {}) {
      let maxScanDistance = config2.maxScanDistance || DefaultScanDist$1, brackets = config2.brackets || DefaultBrackets$1;
      let tree = syntaxTree$2(state), node2 = tree.resolveInner(pos2, dir);
      for (let cur2 = node2; cur2; cur2 = cur2.parent) {
        let matches = matchingNodes$1(cur2.type, dir, brackets);
        if (matches && cur2.from < cur2.to) {
          let handle = findHandle$1(cur2);
          if (handle && (dir > 0 ? pos2 >= handle.from && pos2 < handle.to : pos2 > handle.from && pos2 <= handle.to))
            return matchMarkedBrackets$1(state, pos2, dir, cur2, handle, matches, brackets);
        }
      }
      return matchPlainBrackets$1(state, pos2, dir, tree, node2.type, maxScanDistance, brackets);
    }
    function matchMarkedBrackets$1(_state, _pos, dir, token2, handle, matching, brackets) {
      let parent = token2.parent, firstToken = { from: handle.from, to: handle.to };
      let depth = 0, cursor = parent === null || parent === void 0 ? void 0 : parent.cursor();
      if (cursor && (dir < 0 ? cursor.childBefore(token2.from) : cursor.childAfter(token2.to)))
        do {
          if (dir < 0 ? cursor.to <= token2.from : cursor.from >= token2.to) {
            if (depth == 0 && matching.indexOf(cursor.type.name) > -1 && cursor.from < cursor.to) {
              let endHandle = findHandle$1(cursor);
              return { start: firstToken, end: endHandle ? { from: endHandle.from, to: endHandle.to } : void 0, matched: true };
            } else if (matchingNodes$1(cursor.type, dir, brackets)) {
              depth++;
            } else if (matchingNodes$1(cursor.type, -dir, brackets)) {
              if (depth == 0) {
                let endHandle = findHandle$1(cursor);
                return {
                  start: firstToken,
                  end: endHandle && endHandle.from < endHandle.to ? { from: endHandle.from, to: endHandle.to } : void 0,
                  matched: false
                };
              }
              depth--;
            }
          }
        } while (dir < 0 ? cursor.prevSibling() : cursor.nextSibling());
      return { start: firstToken, matched: false };
    }
    function matchPlainBrackets$1(state, pos2, dir, tree, tokenType, maxScanDistance, brackets) {
      let startCh = dir < 0 ? state.sliceDoc(pos2 - 1, pos2) : state.sliceDoc(pos2, pos2 + 1);
      let bracket2 = brackets.indexOf(startCh);
      if (bracket2 < 0 || bracket2 % 2 == 0 != dir > 0)
        return null;
      let startToken = { from: dir < 0 ? pos2 - 1 : pos2, to: dir > 0 ? pos2 + 1 : pos2 };
      let iter = state.doc.iterRange(pos2, dir > 0 ? state.doc.length : 0), depth = 0;
      for (let distance = 0; !iter.next().done && distance <= maxScanDistance; ) {
        let text2 = iter.value;
        if (dir < 0)
          distance += text2.length;
        let basePos = pos2 + distance * dir;
        for (let pos3 = dir > 0 ? 0 : text2.length - 1, end2 = dir > 0 ? text2.length : -1; pos3 != end2; pos3 += dir) {
          let found = brackets.indexOf(text2[pos3]);
          if (found < 0 || tree.resolveInner(basePos + pos3, 1).type != tokenType)
            continue;
          if (found % 2 == 0 == dir > 0) {
            depth++;
          } else if (depth == 1) {
            return { start: startToken, end: { from: basePos + pos3, to: basePos + pos3 + 1 }, matched: found >> 1 == bracket2 >> 1 };
          } else {
            depth--;
          }
        }
        if (dir > 0)
          distance += text2.length;
      }
      return iter.done ? { start: startToken, matched: false } : null;
    }
    function countCol(string2, end2, tabSize, startIndex = 0, startValue = 0) {
      if (end2 == null) {
        end2 = string2.search(/[^\s\u00a0]/);
        if (end2 == -1)
          end2 = string2.length;
      }
      let n = startValue;
      for (let i2 = startIndex; i2 < end2; i2++) {
        if (string2.charCodeAt(i2) == 9)
          n += tabSize - n % tabSize;
        else
          n++;
      }
      return n;
    }
    class StringStream {
      /**
      Create a stream.
      */
      constructor(string2, tabSize, indentUnit2, overrideIndent) {
        this.string = string2;
        this.tabSize = tabSize;
        this.indentUnit = indentUnit2;
        this.overrideIndent = overrideIndent;
        this.pos = 0;
        this.start = 0;
        this.lastColumnPos = 0;
        this.lastColumnValue = 0;
      }
      /**
      True if we are at the end of the line.
      */
      eol() {
        return this.pos >= this.string.length;
      }
      /**
      True if we are at the start of the line.
      */
      sol() {
        return this.pos == 0;
      }
      /**
      Get the next code unit after the current position, or undefined
      if we're at the end of the line.
      */
      peek() {
        return this.string.charAt(this.pos) || void 0;
      }
      /**
      Read the next code unit and advance `this.pos`.
      */
      next() {
        if (this.pos < this.string.length)
          return this.string.charAt(this.pos++);
      }
      /**
      Match the next character against the given string, regular
      expression, or predicate. Consume and return it if it matches.
      */
      eat(match) {
        let ch3 = this.string.charAt(this.pos);
        let ok;
        if (typeof match == "string")
          ok = ch3 == match;
        else
          ok = ch3 && (match instanceof RegExp ? match.test(ch3) : match(ch3));
        if (ok) {
          ++this.pos;
          return ch3;
        }
      }
      /**
      Continue matching characters that match the given string,
      regular expression, or predicate function. Return true if any
      characters were consumed.
      */
      eatWhile(match) {
        let start2 = this.pos;
        while (this.eat(match)) {
        }
        return this.pos > start2;
      }
      /**
      Consume whitespace ahead of `this.pos`. Return true if any was
      found.
      */
      eatSpace() {
        let start2 = this.pos;
        while (/[\s\u00a0]/.test(this.string.charAt(this.pos)))
          ++this.pos;
        return this.pos > start2;
      }
      /**
      Move to the end of the line.
      */
      skipToEnd() {
        this.pos = this.string.length;
      }
      /**
      Move to directly before the given character, if found on the
      current line.
      */
      skipTo(ch3) {
        let found = this.string.indexOf(ch3, this.pos);
        if (found > -1) {
          this.pos = found;
          return true;
        }
      }
      /**
      Move back `n` characters.
      */
      backUp(n) {
        this.pos -= n;
      }
      /**
      Get the column position at `this.pos`.
      */
      column() {
        if (this.lastColumnPos < this.start) {
          this.lastColumnValue = countCol(this.string, this.start, this.tabSize, this.lastColumnPos, this.lastColumnValue);
          this.lastColumnPos = this.start;
        }
        return this.lastColumnValue;
      }
      /**
      Get the indentation column of the current line.
      */
      indentation() {
        var _a2;
        return (_a2 = this.overrideIndent) !== null && _a2 !== void 0 ? _a2 : countCol(this.string, null, this.tabSize);
      }
      /**
      Match the input against the given string or regular expression
      (which should start with a `^`). Return true or the regexp match
      if it matches.
      
      Unless `consume` is set to `false`, this will move `this.pos`
      past the matched text.
      
      When matching a string `caseInsensitive` can be set to true to
      make the match case-insensitive.
      */
      match(pattern, consume, caseInsensitive) {
        if (typeof pattern == "string") {
          let cased = (str2) => caseInsensitive ? str2.toLowerCase() : str2;
          let substr = this.string.substr(this.pos, pattern.length);
          if (cased(substr) == cased(pattern)) {
            if (consume !== false)
              this.pos += pattern.length;
            return true;
          } else
            return null;
        } else {
          let match = this.string.slice(this.pos).match(pattern);
          if (match && match.index > 0)
            return null;
          if (match && consume !== false)
            this.pos += match[0].length;
          return match;
        }
      }
      /**
      Get the current token.
      */
      current() {
        return this.string.slice(this.start, this.pos);
      }
    }
    function fullParser(spec) {
      return {
        name: spec.name || "",
        token: spec.token,
        blankLine: spec.blankLine || (() => {
        }),
        startState: spec.startState || (() => true),
        copyState: spec.copyState || defaultCopyState,
        indent: spec.indent || (() => null),
        languageData: spec.languageData || {},
        tokenTable: spec.tokenTable || noTokens$2,
        mergeTokens: spec.mergeTokens !== false
      };
    }
    function defaultCopyState(state) {
      if (typeof state != "object")
        return state;
      let newState = {};
      for (let prop2 in state) {
        let val = state[prop2];
        newState[prop2] = val instanceof Array ? val.slice() : val;
      }
      return newState;
    }
    const IndentedFrom = /* @__PURE__ */ new WeakMap();
    class StreamLanguage extends Language$2 {
      constructor(parser2) {
        let data = defineLanguageFacet(parser2.languageData);
        let p = fullParser(parser2), self2;
        let impl = new class extends Parser {
          createParse(input2, fragments, ranges) {
            return new Parse(self2, input2, fragments, ranges);
          }
        }();
        super(data, impl, [], parser2.name);
        this.topNode = docID(data, this);
        self2 = this;
        this.streamParser = p;
        this.stateAfter = new NodeProp$1({ perNode: true });
        this.tokenTable = parser2.tokenTable ? new TokenTable(p.tokenTable) : defaultTokenTable;
      }
      /**
      Define a stream language.
      */
      static define(spec) {
        return new StreamLanguage(spec);
      }
      /**
      @internal
      */
      getIndent(cx) {
        let from = void 0;
        let { overrideIndentation } = cx.options;
        if (overrideIndentation) {
          from = IndentedFrom.get(cx.state);
          if (from != null && from < cx.pos - 1e4)
            from = void 0;
        }
        let start2 = findState(this, cx.node.tree, cx.node.from, cx.node.from, from !== null && from !== void 0 ? from : cx.pos), statePos, state;
        if (start2) {
          state = start2.state;
          statePos = start2.pos + 1;
        } else {
          state = this.streamParser.startState(cx.unit);
          statePos = cx.node.from;
        }
        if (cx.pos - statePos > 1e4)
          return null;
        while (statePos < cx.pos) {
          let line3 = cx.state.doc.lineAt(statePos), end2 = Math.min(cx.pos, line3.to);
          if (line3.length) {
            let indentation = overrideIndentation ? overrideIndentation(line3.from) : -1;
            let stream = new StringStream(line3.text, cx.state.tabSize, cx.unit, indentation < 0 ? void 0 : indentation);
            while (stream.pos < end2 - line3.from)
              readToken(this.streamParser.token, stream, state);
          } else {
            this.streamParser.blankLine(state, cx.unit);
          }
          if (end2 == cx.pos)
            break;
          statePos = line3.to + 1;
        }
        let line2 = cx.lineAt(cx.pos);
        if (overrideIndentation && from == null)
          IndentedFrom.set(cx.state, line2.from);
        return this.streamParser.indent(state, /^\s*(.*)/.exec(line2.text)[1], cx);
      }
      get allowsNesting() {
        return false;
      }
    }
    function findState(lang2, tree, off, startPos, before) {
      let state = off >= startPos && off + tree.length <= before && tree.prop(lang2.stateAfter);
      if (state)
        return { state: lang2.streamParser.copyState(state), pos: off + tree.length };
      for (let i2 = tree.children.length - 1; i2 >= 0; i2--) {
        let child = tree.children[i2], pos2 = off + tree.positions[i2];
        let found = child instanceof Tree && pos2 < before && findState(lang2, child, pos2, startPos, before);
        if (found)
          return found;
      }
      return null;
    }
    function cutTree(lang2, tree, from, to2, inside2) {
      if (inside2 && from <= 0 && to2 >= tree.length)
        return tree;
      if (!inside2 && from == 0 && tree.type == lang2.topNode)
        inside2 = true;
      for (let i2 = tree.children.length - 1; i2 >= 0; i2--) {
        let pos2 = tree.positions[i2], child = tree.children[i2], inner2;
        if (pos2 < to2 && child instanceof Tree) {
          if (!(inner2 = cutTree(lang2, child, from - pos2, to2 - pos2, inside2)))
            break;
          return !inside2 ? inner2 : new Tree(tree.type, tree.children.slice(0, i2).concat(inner2), tree.positions.slice(0, i2 + 1), pos2 + inner2.length);
        }
      }
      return null;
    }
    function findStartInFragments(lang2, fragments, startPos, endPos, editorState) {
      for (let f of fragments) {
        let from = f.from + (f.openStart ? 25 : 0), to2 = f.to - (f.openEnd ? 25 : 0);
        let found = from <= startPos && to2 > startPos && findState(lang2, f.tree, 0 - f.offset, startPos, to2), tree;
        if (found && found.pos <= endPos && (tree = cutTree(lang2, f.tree, startPos + f.offset, found.pos + f.offset, false)))
          return { state: found.state, tree };
      }
      return { state: lang2.streamParser.startState(editorState ? getIndentUnit$1(editorState) : 4), tree: Tree.empty };
    }
    class Parse {
      constructor(lang2, input2, fragments, ranges) {
        this.lang = lang2;
        this.input = input2;
        this.fragments = fragments;
        this.ranges = ranges;
        this.stoppedAt = null;
        this.chunks = [];
        this.chunkPos = [];
        this.chunk = [];
        this.chunkReused = void 0;
        this.rangeIndex = 0;
        this.to = ranges[ranges.length - 1].to;
        let context = ParseContext$2.get(), from = ranges[0].from;
        let { state, tree } = findStartInFragments(lang2, fragments, from, this.to, context === null || context === void 0 ? void 0 : context.state);
        this.state = state;
        this.parsedPos = this.chunkStart = from + tree.length;
        for (let i2 = 0; i2 < tree.children.length; i2++) {
          this.chunks.push(tree.children[i2]);
          this.chunkPos.push(tree.positions[i2]);
        }
        if (context && this.parsedPos < context.viewport.from - 1e5 && ranges.some((r2) => r2.from <= context.viewport.from && r2.to >= context.viewport.from)) {
          this.state = this.lang.streamParser.startState(getIndentUnit$1(context.state));
          context.skipUntilInView(this.parsedPos, context.viewport.from);
          this.parsedPos = context.viewport.from;
        }
        this.moveRangeIndex();
      }
      advance() {
        let context = ParseContext$2.get();
        let parseEnd = this.stoppedAt == null ? this.to : Math.min(this.to, this.stoppedAt);
        let end2 = Math.min(
          parseEnd,
          this.chunkStart + 512
          /* C.ChunkSize */
        );
        if (context)
          end2 = Math.min(end2, context.viewport.to);
        while (this.parsedPos < end2)
          this.parseLine(context);
        if (this.chunkStart < this.parsedPos)
          this.finishChunk();
        if (this.parsedPos >= parseEnd)
          return this.finish();
        if (context && this.parsedPos >= context.viewport.to) {
          context.skipUntilInView(this.parsedPos, parseEnd);
          return this.finish();
        }
        return null;
      }
      stopAt(pos2) {
        this.stoppedAt = pos2;
      }
      lineAfter(pos2) {
        let chunk = this.input.chunk(pos2);
        if (!this.input.lineChunks) {
          let eol = chunk.indexOf("\n");
          if (eol > -1)
            chunk = chunk.slice(0, eol);
        } else if (chunk == "\n") {
          chunk = "";
        }
        return pos2 + chunk.length <= this.to ? chunk : chunk.slice(0, this.to - pos2);
      }
      nextLine() {
        let from = this.parsedPos, line2 = this.lineAfter(from), end2 = from + line2.length;
        for (let index = this.rangeIndex; ; ) {
          let rangeEnd2 = this.ranges[index].to;
          if (rangeEnd2 >= end2)
            break;
          line2 = line2.slice(0, rangeEnd2 - (end2 - line2.length));
          index++;
          if (index == this.ranges.length)
            break;
          let rangeStart = this.ranges[index].from;
          let after = this.lineAfter(rangeStart);
          line2 += after;
          end2 = rangeStart + after.length;
        }
        return { line: line2, end: end2 };
      }
      skipGapsTo(pos2, offset2, side) {
        for (; ; ) {
          let end2 = this.ranges[this.rangeIndex].to, offPos = pos2 + offset2;
          if (side > 0 ? end2 > offPos : end2 >= offPos)
            break;
          let start2 = this.ranges[++this.rangeIndex].from;
          offset2 += start2 - end2;
        }
        return offset2;
      }
      moveRangeIndex() {
        while (this.ranges[this.rangeIndex].to < this.parsedPos)
          this.rangeIndex++;
      }
      emitToken(id, from, to2, offset2) {
        let size = 4;
        if (this.ranges.length > 1) {
          offset2 = this.skipGapsTo(from, offset2, 1);
          from += offset2;
          let len0 = this.chunk.length;
          offset2 = this.skipGapsTo(to2, offset2, -1);
          to2 += offset2;
          size += this.chunk.length - len0;
        }
        let last = this.chunk.length - 4;
        if (this.lang.streamParser.mergeTokens && size == 4 && last >= 0 && this.chunk[last] == id && this.chunk[last + 2] == from)
          this.chunk[last + 2] = to2;
        else
          this.chunk.push(id, from, to2, size);
        return offset2;
      }
      parseLine(context) {
        let { line: line2, end: end2 } = this.nextLine(), offset2 = 0, { streamParser } = this.lang;
        let stream = new StringStream(line2, context ? context.state.tabSize : 4, context ? getIndentUnit$1(context.state) : 2);
        if (stream.eol()) {
          streamParser.blankLine(this.state, stream.indentUnit);
        } else {
          while (!stream.eol()) {
            let token2 = readToken(streamParser.token, stream, this.state);
            if (token2)
              offset2 = this.emitToken(this.lang.tokenTable.resolve(token2), this.parsedPos + stream.start, this.parsedPos + stream.pos, offset2);
            if (stream.start > 1e4)
              break;
          }
        }
        this.parsedPos = end2;
        this.moveRangeIndex();
        if (this.parsedPos < this.to)
          this.parsedPos++;
      }
      finishChunk() {
        let tree = Tree.build({
          buffer: this.chunk,
          start: this.chunkStart,
          length: this.parsedPos - this.chunkStart,
          nodeSet,
          topID: 0,
          maxBufferLength: 512,
          reused: this.chunkReused
        });
        tree = new Tree(tree.type, tree.children, tree.positions, tree.length, [[this.lang.stateAfter, this.lang.streamParser.copyState(this.state)]]);
        this.chunks.push(tree);
        this.chunkPos.push(this.chunkStart - this.ranges[0].from);
        this.chunk = [];
        this.chunkReused = void 0;
        this.chunkStart = this.parsedPos;
      }
      finish() {
        return new Tree(this.lang.topNode, this.chunks, this.chunkPos, this.parsedPos - this.ranges[0].from).balance();
      }
    }
    function readToken(token2, stream, state) {
      stream.start = stream.pos;
      for (let i2 = 0; i2 < 10; i2++) {
        let result2 = token2(stream, state);
        if (stream.pos > stream.start)
          return result2;
      }
      throw new Error("Stream parser failed to advance stream.");
    }
    const noTokens$2 = /* @__PURE__ */ Object.create(null);
    const typeArray$2 = [NodeType$1.none];
    const nodeSet = /* @__PURE__ */ new NodeSet(typeArray$2);
    const warned$2 = [];
    const byTag$2 = /* @__PURE__ */ Object.create(null);
    const defaultTable$2 = /* @__PURE__ */ Object.create(null);
    for (let [legacyName, name2] of [
      ["variable", "variableName"],
      ["variable-2", "variableName.special"],
      ["string-2", "string.special"],
      ["def", "variableName.definition"],
      ["tag", "tagName"],
      ["attribute", "attributeName"],
      ["type", "typeName"],
      ["builtin", "variableName.standard"],
      ["qualifier", "modifier"],
      ["error", "invalid"],
      ["header", "heading"],
      ["property", "propertyName"]
    ])
      defaultTable$2[legacyName] = /* @__PURE__ */ createTokenType$2(noTokens$2, name2);
    class TokenTable {
      constructor(extra) {
        this.extra = extra;
        this.table = Object.assign(/* @__PURE__ */ Object.create(null), defaultTable$2);
      }
      resolve(tag) {
        return !tag ? 0 : this.table[tag] || (this.table[tag] = createTokenType$2(this.extra, tag));
      }
    }
    const defaultTokenTable = /* @__PURE__ */ new TokenTable(noTokens$2);
    function warnForPart$2(part2, msg) {
      if (warned$2.indexOf(part2) > -1)
        return;
      warned$2.push(part2);
      console.warn(msg);
    }
    function createTokenType$2(extra, tagStr) {
      let tags$12 = [];
      for (let name3 of tagStr.split(" ")) {
        let found = [];
        for (let part2 of name3.split(".")) {
          let value2 = extra[part2] || tags$3[part2];
          if (!value2) {
            warnForPart$2(part2, `Unknown highlighting tag ${part2}`);
          } else if (typeof value2 == "function") {
            if (!found.length)
              warnForPart$2(part2, `Modifier ${part2} used at start of tag`);
            else
              found = found.map(value2);
          } else {
            if (found.length)
              warnForPart$2(part2, `Tag ${part2} used as modifier`);
            else
              found = Array.isArray(value2) ? value2 : [value2];
          }
        }
        for (let tag of found)
          tags$12.push(tag);
      }
      if (!tags$12.length)
        return 0;
      let name2 = tagStr.replace(/ /g, "_"), key2 = name2 + " " + tags$12.map((t2) => t2.id);
      let known = byTag$2[key2];
      if (known)
        return known.id;
      let type = byTag$2[key2] = NodeType$1.define({
        id: typeArray$2.length,
        name: name2,
        props: [styleTags$2({ [name2]: tags$12 })]
      });
      typeArray$2.push(type);
      return type.id;
    }
    function docID(data, lang2) {
      let type = NodeType$1.define({ id: typeArray$2.length, name: "Document", props: [
        languageDataProp$2.add(() => data),
        indentNodeProp$1.add(() => (cx) => lang2.getIndent(cx))
      ], top: true });
      typeArray$2.push(type);
      return type;
    }
    ({
      rtl: /* @__PURE__ */ Decoration.mark({ class: "cm-iso", inclusive: true, attributes: { dir: "rtl" }, bidiIsolate: Direction.RTL }),
      ltr: /* @__PURE__ */ Decoration.mark({ class: "cm-iso", inclusive: true, attributes: { dir: "ltr" }, bidiIsolate: Direction.LTR })
    });
    function crelt() {
      var elt = arguments[0];
      if (typeof elt == "string") elt = document.createElement(elt);
      var i2 = 1, next = arguments[1];
      if (next && typeof next == "object" && next.nodeType == null && !Array.isArray(next)) {
        for (var name2 in next) if (Object.prototype.hasOwnProperty.call(next, name2)) {
          var value2 = next[name2];
          if (typeof value2 == "string") elt.setAttribute(name2, value2);
          else if (value2 != null) elt[name2] = value2;
        }
        i2++;
      }
      for (; i2 < arguments.length; i2++) add(elt, arguments[i2]);
      return elt;
    }
    function add(elt, child) {
      if (typeof child == "string") {
        elt.appendChild(document.createTextNode(child));
      } else if (child == null) ;
      else if (child.nodeType != null) {
        elt.appendChild(child);
      } else if (Array.isArray(child)) {
        for (var i2 = 0; i2 < child.length; i2++) add(elt, child[i2]);
      } else {
        throw new RangeError("Unsupported child node: " + child);
      }
    }
    class SelectedDiagnostic {
      constructor(from, to2, diagnostic) {
        this.from = from;
        this.to = to2;
        this.diagnostic = diagnostic;
      }
    }
    class LintState {
      constructor(diagnostics, panel2, selected2) {
        this.diagnostics = diagnostics;
        this.panel = panel2;
        this.selected = selected2;
      }
      static init(diagnostics, panel2, state) {
        let diagnosticFilter = state.facet(lintConfig).markerFilter;
        if (diagnosticFilter)
          diagnostics = diagnosticFilter(diagnostics, state);
        let sorted = diagnostics.slice().sort((a, b) => a.from - b.from || a.to - b.to);
        let deco = new RangeSetBuilder(), active = [], pos2 = 0;
        let scan = state.doc.iter(), scanPos = 0, docLen = state.doc.length;
        for (let i2 = 0; ; ) {
          let next = i2 == sorted.length ? null : sorted[i2];
          if (!next && !active.length)
            break;
          let from, to2;
          if (active.length) {
            from = pos2;
            to2 = active.reduce((p, d) => Math.min(p, d.to), next && next.from > from ? next.from : 1e8);
          } else {
            from = next.from;
            if (from > docLen)
              break;
            to2 = next.to;
            active.push(next);
            i2++;
          }
          while (i2 < sorted.length) {
            let next2 = sorted[i2];
            if (next2.from == from && (next2.to > next2.from || next2.to == from)) {
              active.push(next2);
              i2++;
              to2 = Math.min(next2.to, to2);
            } else {
              to2 = Math.min(next2.from, to2);
              break;
            }
          }
          to2 = Math.min(to2, docLen);
          let widget = false;
          if (active.some((d) => d.from == from && (d.to == to2 || to2 == docLen))) {
            widget = from == to2;
            if (!widget && to2 - from < 10) {
              let behind = from - (scanPos + scan.value.length);
              if (behind > 0) {
                scan.next(behind);
                scanPos = from;
              }
              for (let check2 = from; ; ) {
                if (check2 >= to2) {
                  widget = true;
                  break;
                }
                if (!scan.lineBreak && scanPos + scan.value.length > check2)
                  break;
                check2 = scanPos + scan.value.length;
                scanPos += scan.value.length;
                scan.next();
              }
            }
          }
          let sev = maxSeverity(active);
          if (widget) {
            deco.add(from, from, Decoration.widget({
              widget: new DiagnosticWidget(sev),
              diagnostics: active.slice()
            }));
          } else {
            let markClass = active.reduce((c2, d) => d.markClass ? c2 + " " + d.markClass : c2, "");
            deco.add(from, to2, Decoration.mark({
              class: "cm-lintRange cm-lintRange-" + sev + markClass,
              diagnostics: active.slice(),
              inclusiveEnd: active.some((a) => a.to > to2)
            }));
          }
          pos2 = to2;
          if (pos2 == docLen)
            break;
          for (let i3 = 0; i3 < active.length; i3++)
            if (active[i3].to <= pos2)
              active.splice(i3--, 1);
        }
        let set2 = deco.finish();
        return new LintState(set2, panel2, findDiagnostic(set2));
      }
    }
    function findDiagnostic(diagnostics, diagnostic = null, after = 0) {
      let found = null;
      diagnostics.between(after, 1e9, (from, to2, { spec }) => {
        if (diagnostic && spec.diagnostics.indexOf(diagnostic) < 0)
          return;
        if (!found)
          found = new SelectedDiagnostic(from, to2, diagnostic || spec.diagnostics[0]);
        else if (spec.diagnostics.indexOf(found.diagnostic) < 0)
          return false;
        else
          found = new SelectedDiagnostic(found.from, to2, found.diagnostic);
      });
      return found;
    }
    function hideTooltip(tr2, tooltip) {
      let from = tooltip.pos, to2 = tooltip.end || from;
      let result2 = tr2.state.facet(lintConfig).hideOn(tr2, from, to2);
      if (result2 != null)
        return result2;
      let line2 = tr2.startState.doc.lineAt(tooltip.pos);
      return !!(tr2.effects.some((e) => e.is(setDiagnosticsEffect)) || tr2.changes.touchesRange(line2.from, Math.max(line2.to, to2)));
    }
    function maybeEnableLint(state, effects) {
      return state.field(lintState, false) ? effects : effects.concat(StateEffect.appendConfig.of(lintExtensions));
    }
    function setDiagnostics(state, diagnostics) {
      return {
        effects: maybeEnableLint(state, [setDiagnosticsEffect.of(diagnostics)])
      };
    }
    const setDiagnosticsEffect = /* @__PURE__ */ StateEffect.define();
    const togglePanel = /* @__PURE__ */ StateEffect.define();
    const movePanelSelection = /* @__PURE__ */ StateEffect.define();
    const lintState = /* @__PURE__ */ StateField.define({
      create() {
        return new LintState(Decoration.none, null, null);
      },
      update(value2, tr2) {
        if (tr2.docChanged && value2.diagnostics.size) {
          let mapped = value2.diagnostics.map(tr2.changes), selected2 = null, panel2 = value2.panel;
          if (value2.selected) {
            let selPos = tr2.changes.mapPos(value2.selected.from, 1);
            selected2 = findDiagnostic(mapped, value2.selected.diagnostic, selPos) || findDiagnostic(mapped, null, selPos);
          }
          if (!mapped.size && panel2 && tr2.state.facet(lintConfig).autoPanel)
            panel2 = null;
          value2 = new LintState(mapped, panel2, selected2);
        }
        for (let effect2 of tr2.effects) {
          if (effect2.is(setDiagnosticsEffect)) {
            let panel2 = !tr2.state.facet(lintConfig).autoPanel ? value2.panel : effect2.value.length ? LintPanel.open : null;
            value2 = LintState.init(effect2.value, panel2, tr2.state);
          } else if (effect2.is(togglePanel)) {
            value2 = new LintState(value2.diagnostics, effect2.value ? LintPanel.open : null, value2.selected);
          } else if (effect2.is(movePanelSelection)) {
            value2 = new LintState(value2.diagnostics, value2.panel, effect2.value);
          }
        }
        return value2;
      },
      provide: (f) => [
        showPanel.from(f, (val) => val.panel),
        EditorView.decorations.from(f, (s) => s.diagnostics)
      ]
    });
    const activeMark = /* @__PURE__ */ Decoration.mark({ class: "cm-lintRange cm-lintRange-active" });
    function lintTooltip(view, pos2, side) {
      let { diagnostics } = view.state.field(lintState);
      let found, start2 = -1, end2 = -1;
      diagnostics.between(pos2 - (side < 0 ? 1 : 0), pos2 + (side > 0 ? 1 : 0), (from, to2, { spec }) => {
        if (pos2 >= from && pos2 <= to2 && (from == to2 || (pos2 > from || side > 0) && (pos2 < to2 || side < 0))) {
          found = spec.diagnostics;
          start2 = from;
          end2 = to2;
          return false;
        }
      });
      let diagnosticFilter = view.state.facet(lintConfig).tooltipFilter;
      if (found && diagnosticFilter)
        found = diagnosticFilter(found, view.state);
      if (!found)
        return null;
      return {
        pos: start2,
        end: end2,
        above: view.state.doc.lineAt(start2).to < end2,
        create() {
          return { dom: diagnosticsTooltip(view, found) };
        }
      };
    }
    function diagnosticsTooltip(view, diagnostics) {
      return crelt("ul", { class: "cm-tooltip-lint" }, diagnostics.map((d) => renderDiagnostic(view, d, false)));
    }
    const closeLintPanel = (view) => {
      let field = view.state.field(lintState, false);
      if (!field || !field.panel)
        return false;
      view.dispatch({ effects: togglePanel.of(false) });
      return true;
    };
    const lintPlugin = /* @__PURE__ */ ViewPlugin.fromClass(class {
      constructor(view) {
        this.view = view;
        this.timeout = -1;
        this.set = true;
        let { delay } = view.state.facet(lintConfig);
        this.lintTime = Date.now() + delay;
        this.run = this.run.bind(this);
        this.timeout = setTimeout(this.run, delay);
      }
      run() {
        clearTimeout(this.timeout);
        let now = Date.now();
        if (now < this.lintTime - 10) {
          this.timeout = setTimeout(this.run, this.lintTime - now);
        } else {
          this.set = false;
          let { state } = this.view, { sources } = state.facet(lintConfig);
          if (sources.length)
            batchResults(sources.map((s) => Promise.resolve(s(this.view))), (annotations) => {
              if (this.view.state.doc == state.doc)
                this.view.dispatch(setDiagnostics(this.view.state, annotations.reduce((a, b) => a.concat(b))));
            }, (error2) => {
              logException(this.view.state, error2);
            });
        }
      }
      update(update) {
        let config2 = update.state.facet(lintConfig);
        if (update.docChanged || config2 != update.startState.facet(lintConfig) || config2.needsRefresh && config2.needsRefresh(update)) {
          this.lintTime = Date.now() + config2.delay;
          if (!this.set) {
            this.set = true;
            this.timeout = setTimeout(this.run, config2.delay);
          }
        }
      }
      force() {
        if (this.set) {
          this.lintTime = Date.now();
          this.run();
        }
      }
      destroy() {
        clearTimeout(this.timeout);
      }
    });
    function batchResults(promises, sink, error2) {
      let collected = [], timeout = -1;
      for (let p of promises)
        p.then((value2) => {
          collected.push(value2);
          clearTimeout(timeout);
          if (collected.length == promises.length)
            sink(collected);
          else
            timeout = setTimeout(() => sink(collected), 200);
        }, error2);
    }
    const lintConfig = /* @__PURE__ */ Facet.define({
      combine(input2) {
        return {
          sources: input2.map((i2) => i2.source).filter((x2) => x2 != null),
          ...combineConfig(input2.map((i2) => i2.config), {
            delay: 750,
            markerFilter: null,
            tooltipFilter: null,
            needsRefresh: null,
            hideOn: () => null
          }, {
            delay: Math.max,
            markerFilter: combineFilter,
            tooltipFilter: combineFilter,
            needsRefresh: (a, b) => !a ? b : !b ? a : (u) => a(u) || b(u),
            hideOn: (a, b) => !a ? b : !b ? a : (t2, x2, y) => a(t2, x2, y) || b(t2, x2, y),
            autoPanel: (a, b) => a || b
          })
        };
      }
    });
    function combineFilter(a, b) {
      return !a ? b : !b ? a : (d, s) => b(a(d, s), s);
    }
    function linter(source2, config2 = {}) {
      return [
        lintConfig.of({ source: source2, config: config2 }),
        lintPlugin,
        lintExtensions
      ];
    }
    function assignKeys(actions) {
      let assigned = [];
      if (actions)
        actions: for (let { name: name2 } of actions) {
          for (let i2 = 0; i2 < name2.length; i2++) {
            let ch3 = name2[i2];
            if (/[a-zA-Z]/.test(ch3) && !assigned.some((c2) => c2.toLowerCase() == ch3.toLowerCase())) {
              assigned.push(ch3);
              continue actions;
            }
          }
          assigned.push("");
        }
      return assigned;
    }
    function renderDiagnostic(view, diagnostic, inPanel) {
      var _a2;
      let keys = inPanel ? assignKeys(diagnostic.actions) : [];
      return crelt("li", { class: "cm-diagnostic cm-diagnostic-" + diagnostic.severity }, crelt("span", { class: "cm-diagnosticText" }, diagnostic.renderMessage ? diagnostic.renderMessage(view) : diagnostic.message), (_a2 = diagnostic.actions) === null || _a2 === void 0 ? void 0 : _a2.map((action, i2) => {
        let fired = false, click = (e) => {
          e.preventDefault();
          if (fired)
            return;
          fired = true;
          let found = findDiagnostic(view.state.field(lintState).diagnostics, diagnostic);
          if (found)
            action.apply(view, found.from, found.to);
        };
        let { name: name2 } = action, keyIndex = keys[i2] ? name2.indexOf(keys[i2]) : -1;
        let nameElt = keyIndex < 0 ? name2 : [
          name2.slice(0, keyIndex),
          crelt("u", name2.slice(keyIndex, keyIndex + 1)),
          name2.slice(keyIndex + 1)
        ];
        let markClass = action.markClass ? " " + action.markClass : "";
        return crelt("button", {
          type: "button",
          class: "cm-diagnosticAction" + markClass,
          onclick: click,
          onmousedown: click,
          "aria-label": ` Action: ${name2}${keyIndex < 0 ? "" : ` (access key "${keys[i2]})"`}.`
        }, nameElt);
      }), diagnostic.source && crelt("div", { class: "cm-diagnosticSource" }, diagnostic.source));
    }
    class DiagnosticWidget extends WidgetType {
      constructor(sev) {
        super();
        this.sev = sev;
      }
      eq(other) {
        return other.sev == this.sev;
      }
      toDOM() {
        return crelt("span", { class: "cm-lintPoint cm-lintPoint-" + this.sev });
      }
    }
    class PanelItem {
      constructor(view, diagnostic) {
        this.diagnostic = diagnostic;
        this.id = "item_" + Math.floor(Math.random() * 4294967295).toString(16);
        this.dom = renderDiagnostic(view, diagnostic, true);
        this.dom.id = this.id;
        this.dom.setAttribute("role", "option");
      }
    }
    class LintPanel {
      constructor(view) {
        this.view = view;
        this.items = [];
        let onkeydown = (event) => {
          if (event.keyCode == 27) {
            closeLintPanel(this.view);
            this.view.focus();
          } else if (event.keyCode == 38 || event.keyCode == 33) {
            this.moveSelection((this.selectedIndex - 1 + this.items.length) % this.items.length);
          } else if (event.keyCode == 40 || event.keyCode == 34) {
            this.moveSelection((this.selectedIndex + 1) % this.items.length);
          } else if (event.keyCode == 36) {
            this.moveSelection(0);
          } else if (event.keyCode == 35) {
            this.moveSelection(this.items.length - 1);
          } else if (event.keyCode == 13) {
            this.view.focus();
          } else if (event.keyCode >= 65 && event.keyCode <= 90 && this.selectedIndex >= 0) {
            let { diagnostic } = this.items[this.selectedIndex], keys = assignKeys(diagnostic.actions);
            for (let i2 = 0; i2 < keys.length; i2++)
              if (keys[i2].toUpperCase().charCodeAt(0) == event.keyCode) {
                let found = findDiagnostic(this.view.state.field(lintState).diagnostics, diagnostic);
                if (found)
                  diagnostic.actions[i2].apply(view, found.from, found.to);
              }
          } else {
            return;
          }
          event.preventDefault();
        };
        let onclick = (event) => {
          for (let i2 = 0; i2 < this.items.length; i2++) {
            if (this.items[i2].dom.contains(event.target))
              this.moveSelection(i2);
          }
        };
        this.list = crelt("ul", {
          tabIndex: 0,
          role: "listbox",
          "aria-label": this.view.state.phrase("Diagnostics"),
          onkeydown,
          onclick
        });
        this.dom = crelt("div", { class: "cm-panel-lint" }, this.list, crelt("button", {
          type: "button",
          name: "close",
          "aria-label": this.view.state.phrase("close"),
          onclick: () => closeLintPanel(this.view)
        }, "×"));
        this.update();
      }
      get selectedIndex() {
        let selected2 = this.view.state.field(lintState).selected;
        if (!selected2)
          return -1;
        for (let i2 = 0; i2 < this.items.length; i2++)
          if (this.items[i2].diagnostic == selected2.diagnostic)
            return i2;
        return -1;
      }
      update() {
        let { diagnostics, selected: selected2 } = this.view.state.field(lintState);
        let i2 = 0, needsSync = false, newSelectedItem = null;
        let seen = /* @__PURE__ */ new Set();
        diagnostics.between(0, this.view.state.doc.length, (_start, _end, { spec }) => {
          for (let diagnostic of spec.diagnostics) {
            if (seen.has(diagnostic))
              continue;
            seen.add(diagnostic);
            let found = -1, item2;
            for (let j = i2; j < this.items.length; j++)
              if (this.items[j].diagnostic == diagnostic) {
                found = j;
                break;
              }
            if (found < 0) {
              item2 = new PanelItem(this.view, diagnostic);
              this.items.splice(i2, 0, item2);
              needsSync = true;
            } else {
              item2 = this.items[found];
              if (found > i2) {
                this.items.splice(i2, found - i2);
                needsSync = true;
              }
            }
            if (selected2 && item2.diagnostic == selected2.diagnostic) {
              if (!item2.dom.hasAttribute("aria-selected")) {
                item2.dom.setAttribute("aria-selected", "true");
                newSelectedItem = item2;
              }
            } else if (item2.dom.hasAttribute("aria-selected")) {
              item2.dom.removeAttribute("aria-selected");
            }
            i2++;
          }
        });
        while (i2 < this.items.length && !(this.items.length == 1 && this.items[0].diagnostic.from < 0)) {
          needsSync = true;
          this.items.pop();
        }
        if (this.items.length == 0) {
          this.items.push(new PanelItem(this.view, {
            from: -1,
            to: -1,
            severity: "info",
            message: this.view.state.phrase("No diagnostics")
          }));
          needsSync = true;
        }
        if (newSelectedItem) {
          this.list.setAttribute("aria-activedescendant", newSelectedItem.id);
          this.view.requestMeasure({
            key: this,
            read: () => ({ sel: newSelectedItem.dom.getBoundingClientRect(), panel: this.list.getBoundingClientRect() }),
            write: ({ sel, panel: panel2 }) => {
              let scaleY = panel2.height / this.list.offsetHeight;
              if (sel.top < panel2.top)
                this.list.scrollTop -= (panel2.top - sel.top) / scaleY;
              else if (sel.bottom > panel2.bottom)
                this.list.scrollTop += (sel.bottom - panel2.bottom) / scaleY;
            }
          });
        } else if (this.selectedIndex < 0) {
          this.list.removeAttribute("aria-activedescendant");
        }
        if (needsSync)
          this.sync();
      }
      sync() {
        let domPos = this.list.firstChild;
        function rm2() {
          let prev = domPos;
          domPos = prev.nextSibling;
          prev.remove();
        }
        for (let item2 of this.items) {
          if (item2.dom.parentNode == this.list) {
            while (domPos != item2.dom)
              rm2();
            domPos = item2.dom.nextSibling;
          } else {
            this.list.insertBefore(item2.dom, domPos);
          }
        }
        while (domPos)
          rm2();
      }
      moveSelection(selectedIndex) {
        if (this.selectedIndex < 0)
          return;
        let field = this.view.state.field(lintState);
        let selection = findDiagnostic(field.diagnostics, this.items[selectedIndex].diagnostic);
        if (!selection)
          return;
        this.view.dispatch({
          selection: { anchor: selection.from, head: selection.to },
          scrollIntoView: true,
          effects: movePanelSelection.of(selection)
        });
      }
      static open(view) {
        return new LintPanel(view);
      }
    }
    function svg(content2, attrs = `viewBox="0 0 40 40"`) {
      return `url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${attrs}>${encodeURIComponent(content2)}</svg>')`;
    }
    function underline(color) {
      return svg(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${color}" fill="none" stroke-width=".7"/>`, `width="6" height="3"`);
    }
    const baseTheme = /* @__PURE__ */ EditorView.baseTheme({
      ".cm-diagnostic": {
        padding: "3px 6px 3px 8px",
        marginLeft: "-1px",
        display: "block",
        whiteSpace: "pre-wrap"
      },
      ".cm-diagnostic-error": { borderLeft: "5px solid #d11" },
      ".cm-diagnostic-warning": { borderLeft: "5px solid orange" },
      ".cm-diagnostic-info": { borderLeft: "5px solid #999" },
      ".cm-diagnostic-hint": { borderLeft: "5px solid #66d" },
      ".cm-diagnosticAction": {
        font: "inherit",
        border: "none",
        padding: "2px 4px",
        backgroundColor: "#444",
        color: "white",
        borderRadius: "3px",
        marginLeft: "8px",
        cursor: "pointer"
      },
      ".cm-diagnosticSource": {
        fontSize: "70%",
        opacity: 0.7
      },
      ".cm-lintRange": {
        backgroundPosition: "left bottom",
        backgroundRepeat: "repeat-x",
        paddingBottom: "0.7px"
      },
      ".cm-lintRange-error": { backgroundImage: /* @__PURE__ */ underline("#d11") },
      ".cm-lintRange-warning": { backgroundImage: /* @__PURE__ */ underline("orange") },
      ".cm-lintRange-info": { backgroundImage: /* @__PURE__ */ underline("#999") },
      ".cm-lintRange-hint": { backgroundImage: /* @__PURE__ */ underline("#66d") },
      ".cm-lintRange-active": { backgroundColor: "#ffdd9980" },
      ".cm-tooltip-lint": {
        padding: 0,
        margin: 0
      },
      ".cm-lintPoint": {
        position: "relative",
        "&:after": {
          content: '""',
          position: "absolute",
          bottom: 0,
          left: "-2px",
          borderLeft: "3px solid transparent",
          borderRight: "3px solid transparent",
          borderBottom: "4px solid #d11"
        }
      },
      ".cm-lintPoint-warning": {
        "&:after": { borderBottomColor: "orange" }
      },
      ".cm-lintPoint-info": {
        "&:after": { borderBottomColor: "#999" }
      },
      ".cm-lintPoint-hint": {
        "&:after": { borderBottomColor: "#66d" }
      },
      ".cm-panel.cm-panel-lint": {
        position: "relative",
        "& ul": {
          maxHeight: "100px",
          overflowY: "auto",
          "& [aria-selected]": {
            backgroundColor: "#ddd",
            "& u": { textDecoration: "underline" }
          },
          "&:focus [aria-selected]": {
            background_fallback: "#bdf",
            backgroundColor: "Highlight",
            color_fallback: "white",
            color: "HighlightText"
          },
          "& u": { textDecoration: "none" },
          padding: 0,
          margin: 0
        },
        "& [name=close]": {
          position: "absolute",
          top: "0",
          right: "2px",
          background: "inherit",
          border: "none",
          font: "inherit",
          padding: 0,
          margin: 0
        }
      }
    });
    function severityWeight(sev) {
      return sev == "error" ? 4 : sev == "warning" ? 3 : sev == "info" ? 2 : 1;
    }
    function maxSeverity(diagnostics) {
      let sev = "hint", weight = 1;
      for (let d of diagnostics) {
        let w = severityWeight(d.severity);
        if (w > weight) {
          weight = w;
          sev = d.severity;
        }
      }
      return sev;
    }
    const lintExtensions = [
      lintState,
      /* @__PURE__ */ EditorView.decorations.compute([lintState], (state) => {
        let { selected: selected2, panel: panel2 } = state.field(lintState);
        return !selected2 || !panel2 || selected2.from == selected2.to ? Decoration.none : Decoration.set([
          activeMark.range(selected2.from, selected2.to)
        ]);
      }),
      /* @__PURE__ */ hoverTooltip(lintTooltip, { hideOn: hideTooltip }),
      baseTheme
    ];
    let nextPropID = 0;
    class NodeProp {
      /**
      Create a new node prop type.
      */
      constructor(config2 = {}) {
        this.id = nextPropID++;
        this.perNode = !!config2.perNode;
        this.deserialize = config2.deserialize || (() => {
          throw new Error("This node type doesn't define a deserialize function");
        });
        this.combine = config2.combine || null;
      }
      /**
      This is meant to be used with
      [`NodeSet.extend`](#common.NodeSet.extend) or
      [`LRParser.configure`](#lr.ParserConfig.props) to compute
      prop values for each node type in the set. Takes a [match
      object](#common.NodeType^match) or function that returns undefined
      if the node type doesn't get this prop, and the prop's value if
      it does.
      */
      add(match) {
        if (this.perNode)
          throw new RangeError("Can't add per-node props to node types");
        if (typeof match != "function")
          match = NodeType.match(match);
        return (type) => {
          let result2 = match(type);
          return result2 === void 0 ? null : [this, result2];
        };
      }
    }
    NodeProp.closedBy = new NodeProp({ deserialize: (str2) => str2.split(" ") });
    NodeProp.openedBy = new NodeProp({ deserialize: (str2) => str2.split(" ") });
    NodeProp.group = new NodeProp({ deserialize: (str2) => str2.split(" ") });
    NodeProp.isolate = new NodeProp({ deserialize: (value2) => {
      if (value2 && value2 != "rtl" && value2 != "ltr" && value2 != "auto")
        throw new RangeError("Invalid value for isolate: " + value2);
      return value2 || "auto";
    } });
    NodeProp.contextHash = new NodeProp({ perNode: true });
    NodeProp.lookAhead = new NodeProp({ perNode: true });
    NodeProp.mounted = new NodeProp({ perNode: true });
    const noProps = /* @__PURE__ */ Object.create(null);
    class NodeType {
      /**
      @internal
      */
      constructor(name2, props, id, flags = 0) {
        this.name = name2;
        this.props = props;
        this.id = id;
        this.flags = flags;
      }
      /**
      Define a node type.
      */
      static define(spec) {
        let props = spec.props && spec.props.length ? /* @__PURE__ */ Object.create(null) : noProps;
        let flags = (spec.top ? 1 : 0) | (spec.skipped ? 2 : 0) | (spec.error ? 4 : 0) | (spec.name == null ? 8 : 0);
        let type = new NodeType(spec.name || "", props, spec.id, flags);
        if (spec.props)
          for (let src of spec.props) {
            if (!Array.isArray(src))
              src = src(type);
            if (src) {
              if (src[0].perNode)
                throw new RangeError("Can't store a per-node prop on a node type");
              props[src[0].id] = src[1];
            }
          }
        return type;
      }
      /**
      Retrieves a node prop for this type. Will return `undefined` if
      the prop isn't present on this node.
      */
      prop(prop2) {
        return this.props[prop2.id];
      }
      /**
      True when this is the top node of a grammar.
      */
      get isTop() {
        return (this.flags & 1) > 0;
      }
      /**
      True when this node is produced by a skip rule.
      */
      get isSkipped() {
        return (this.flags & 2) > 0;
      }
      /**
      Indicates whether this is an error node.
      */
      get isError() {
        return (this.flags & 4) > 0;
      }
      /**
      When true, this node type doesn't correspond to a user-declared
      named node, for example because it is used to cache repetition.
      */
      get isAnonymous() {
        return (this.flags & 8) > 0;
      }
      /**
      Returns true when this node's name or one of its
      [groups](#common.NodeProp^group) matches the given string.
      */
      is(name2) {
        if (typeof name2 == "string") {
          if (this.name == name2)
            return true;
          let group = this.prop(NodeProp.group);
          return group ? group.indexOf(name2) > -1 : false;
        }
        return this.id == name2;
      }
      /**
      Create a function from node types to arbitrary values by
      specifying an object whose property names are node or
      [group](#common.NodeProp^group) names. Often useful with
      [`NodeProp.add`](#common.NodeProp.add). You can put multiple
      names, separated by spaces, in a single property name to map
      multiple node names to a single value.
      */
      static match(map2) {
        let direct = /* @__PURE__ */ Object.create(null);
        for (let prop2 in map2)
          for (let name2 of prop2.split(" "))
            direct[name2] = map2[prop2];
        return (node2) => {
          for (let groups = node2.prop(NodeProp.group), i2 = -1; i2 < (groups ? groups.length : 0); i2++) {
            let found = direct[i2 < 0 ? node2.name : groups[i2]];
            if (found)
              return found;
          }
        };
      }
    }
    NodeType.none = new NodeType(
      "",
      /* @__PURE__ */ Object.create(null),
      0,
      8
      /* NodeFlag.Anonymous */
    );
    var IterMode;
    (function(IterMode2) {
      IterMode2[IterMode2["ExcludeBuffers"] = 1] = "ExcludeBuffers";
      IterMode2[IterMode2["IncludeAnonymous"] = 2] = "IncludeAnonymous";
      IterMode2[IterMode2["IgnoreMounts"] = 4] = "IgnoreMounts";
      IterMode2[IterMode2["IgnoreOverlays"] = 8] = "IgnoreOverlays";
    })(IterMode || (IterMode = {}));
    new NodeProp({ perNode: true });
    let nextTagID$2 = 0;
    let Tag$2 = class Tag2 {
      /**
      @internal
      */
      constructor(name2, set2, base2, modified) {
        this.name = name2;
        this.set = set2;
        this.base = base2;
        this.modified = modified;
        this.id = nextTagID$2++;
      }
      toString() {
        let { name: name2 } = this;
        for (let mod2 of this.modified)
          if (mod2.name)
            name2 = `${mod2.name}(${name2})`;
        return name2;
      }
      static define(nameOrParent, parent) {
        let name2 = typeof nameOrParent == "string" ? nameOrParent : "?";
        if (nameOrParent instanceof Tag2)
          parent = nameOrParent;
        if (parent === null || parent === void 0 ? void 0 : parent.base)
          throw new Error("Can not derive from a modified tag");
        let tag = new Tag2(name2, [], null, []);
        tag.set.push(tag);
        if (parent)
          for (let t2 of parent.set)
            tag.set.push(t2);
        return tag;
      }
      /**
      Define a tag _modifier_, which is a function that, given a tag,
      will return a tag that is a subtag of the original. Applying the
      same modifier to a twice tag will return the same value (`m1(t1)
      == m1(t1)`) and applying multiple modifiers will, regardless or
      order, produce the same tag (`m1(m2(t1)) == m2(m1(t1))`).
      
      When multiple modifiers are applied to a given base tag, each
      smaller set of modifiers is registered as a parent, so that for
      example `m1(m2(m3(t1)))` is a subtype of `m1(m2(t1))`,
      `m1(m3(t1)`, and so on.
      */
      static defineModifier(name2) {
        let mod2 = new Modifier$2(name2);
        return (tag) => {
          if (tag.modified.indexOf(mod2) > -1)
            return tag;
          return Modifier$2.get(tag.base || tag, tag.modified.concat(mod2).sort((a, b) => a.id - b.id));
        };
      }
    };
    let nextModifierID$2 = 0;
    let Modifier$2 = class Modifier2 {
      constructor(name2) {
        this.name = name2;
        this.instances = [];
        this.id = nextModifierID$2++;
      }
      static get(base2, mods) {
        if (!mods.length)
          return base2;
        let exists = mods[0].instances.find((t2) => t2.base == base2 && sameArray$2(mods, t2.modified));
        if (exists)
          return exists;
        let set2 = [], tag = new Tag$2(base2.name, set2, base2, mods);
        for (let m of mods)
          m.instances.push(tag);
        let configs = powerSet$2(mods);
        for (let parent of base2.set)
          if (!parent.modified.length)
            for (let config2 of configs)
              set2.push(Modifier2.get(parent, config2));
        return tag;
      }
    };
    function sameArray$2(a, b) {
      return a.length == b.length && a.every((x2, i2) => x2 == b[i2]);
    }
    function powerSet$2(array) {
      let sets = [[]];
      for (let i2 = 0; i2 < array.length; i2++) {
        for (let j = 0, e = sets.length; j < e; j++) {
          sets.push(sets[j].concat(array[i2]));
        }
      }
      return sets.sort((a, b) => b.length - a.length);
    }
    new NodeProp({
      combine(a, b) {
        let cur2, root2, take;
        while (a || b) {
          if (!a || b && a.depth >= b.depth) {
            take = b;
            b = b.next;
          } else {
            take = a;
            a = a.next;
          }
          if (cur2 && cur2.mode == take.mode && !take.context && !cur2.context)
            continue;
          let copy2 = new Rule$2(take.tags, take.mode, take.context);
          if (cur2)
            cur2.next = copy2;
          else
            root2 = copy2;
          cur2 = copy2;
        }
        return root2;
      }
    });
    let Rule$2 = class Rule {
      constructor(tags2, mode, context, next) {
        this.tags = tags2;
        this.mode = mode;
        this.context = context;
        this.next = next;
      }
      get opaque() {
        return this.mode == 0;
      }
      get inherit() {
        return this.mode == 1;
      }
      sort(other) {
        if (!other || other.depth < this.depth) {
          this.next = other;
          return this;
        }
        other.next = this.sort(other.next);
        return other;
      }
      get depth() {
        return this.context ? this.context.length : 0;
      }
    };
    Rule$2.empty = new Rule$2([], 2, null);
    function tagHighlighter$2(tags2, options2) {
      let map2 = /* @__PURE__ */ Object.create(null);
      for (let style2 of tags2) {
        if (!Array.isArray(style2.tag))
          map2[style2.tag.id] = style2.class;
        else
          for (let tag of style2.tag)
            map2[tag.id] = style2.class;
      }
      let { scope, all: all2 = null } = {};
      return {
        style: (tags3) => {
          let cls = all2;
          for (let tag of tags3) {
            for (let sub2 of tag.set) {
              let tagClass = map2[sub2.id];
              if (tagClass) {
                cls = cls ? cls + " " + tagClass : tagClass;
                break;
              }
            }
          }
          return cls;
        },
        scope
      };
    }
    const t$2 = Tag$2.define;
    const comment$2 = t$2(), name$2 = t$2(), typeName$2 = t$2(name$2), propertyName$2 = t$2(name$2), literal$2 = t$2(), string$2 = t$2(literal$2), number$2 = t$2(literal$2), content$2 = t$2(), heading$2 = t$2(content$2), keyword$2 = t$2(), operator$2 = t$2(), punctuation$2 = t$2(), bracket$2 = t$2(punctuation$2), meta$2 = t$2();
    const tags$2 = {
      /**
      A comment.
      */
      comment: comment$2,
      /**
      A line [comment](#highlight.tags.comment).
      */
      lineComment: t$2(comment$2),
      /**
      A block [comment](#highlight.tags.comment).
      */
      blockComment: t$2(comment$2),
      /**
      A documentation [comment](#highlight.tags.comment).
      */
      docComment: t$2(comment$2),
      /**
      Any kind of identifier.
      */
      name: name$2,
      /**
      The [name](#highlight.tags.name) of a variable.
      */
      variableName: t$2(name$2),
      /**
      A type [name](#highlight.tags.name).
      */
      typeName: typeName$2,
      /**
      A tag name (subtag of [`typeName`](#highlight.tags.typeName)).
      */
      tagName: t$2(typeName$2),
      /**
      A property or field [name](#highlight.tags.name).
      */
      propertyName: propertyName$2,
      /**
      An attribute name (subtag of [`propertyName`](#highlight.tags.propertyName)).
      */
      attributeName: t$2(propertyName$2),
      /**
      The [name](#highlight.tags.name) of a class.
      */
      className: t$2(name$2),
      /**
      A label [name](#highlight.tags.name).
      */
      labelName: t$2(name$2),
      /**
      A namespace [name](#highlight.tags.name).
      */
      namespace: t$2(name$2),
      /**
      The [name](#highlight.tags.name) of a macro.
      */
      macroName: t$2(name$2),
      /**
      A literal value.
      */
      literal: literal$2,
      /**
      A string [literal](#highlight.tags.literal).
      */
      string: string$2,
      /**
      A documentation [string](#highlight.tags.string).
      */
      docString: t$2(string$2),
      /**
      A character literal (subtag of [string](#highlight.tags.string)).
      */
      character: t$2(string$2),
      /**
      An attribute value (subtag of [string](#highlight.tags.string)).
      */
      attributeValue: t$2(string$2),
      /**
      A number [literal](#highlight.tags.literal).
      */
      number: number$2,
      /**
      An integer [number](#highlight.tags.number) literal.
      */
      integer: t$2(number$2),
      /**
      A floating-point [number](#highlight.tags.number) literal.
      */
      float: t$2(number$2),
      /**
      A boolean [literal](#highlight.tags.literal).
      */
      bool: t$2(literal$2),
      /**
      Regular expression [literal](#highlight.tags.literal).
      */
      regexp: t$2(literal$2),
      /**
      An escape [literal](#highlight.tags.literal), for example a
      backslash escape in a string.
      */
      escape: t$2(literal$2),
      /**
      A color [literal](#highlight.tags.literal).
      */
      color: t$2(literal$2),
      /**
      A URL [literal](#highlight.tags.literal).
      */
      url: t$2(literal$2),
      /**
      A language keyword.
      */
      keyword: keyword$2,
      /**
      The [keyword](#highlight.tags.keyword) for the self or this
      object.
      */
      self: t$2(keyword$2),
      /**
      The [keyword](#highlight.tags.keyword) for null.
      */
      null: t$2(keyword$2),
      /**
      A [keyword](#highlight.tags.keyword) denoting some atomic value.
      */
      atom: t$2(keyword$2),
      /**
      A [keyword](#highlight.tags.keyword) that represents a unit.
      */
      unit: t$2(keyword$2),
      /**
      A modifier [keyword](#highlight.tags.keyword).
      */
      modifier: t$2(keyword$2),
      /**
      A [keyword](#highlight.tags.keyword) that acts as an operator.
      */
      operatorKeyword: t$2(keyword$2),
      /**
      A control-flow related [keyword](#highlight.tags.keyword).
      */
      controlKeyword: t$2(keyword$2),
      /**
      A [keyword](#highlight.tags.keyword) that defines something.
      */
      definitionKeyword: t$2(keyword$2),
      /**
      A [keyword](#highlight.tags.keyword) related to defining or
      interfacing with modules.
      */
      moduleKeyword: t$2(keyword$2),
      /**
      An operator.
      */
      operator: operator$2,
      /**
      An [operator](#highlight.tags.operator) that dereferences something.
      */
      derefOperator: t$2(operator$2),
      /**
      Arithmetic-related [operator](#highlight.tags.operator).
      */
      arithmeticOperator: t$2(operator$2),
      /**
      Logical [operator](#highlight.tags.operator).
      */
      logicOperator: t$2(operator$2),
      /**
      Bit [operator](#highlight.tags.operator).
      */
      bitwiseOperator: t$2(operator$2),
      /**
      Comparison [operator](#highlight.tags.operator).
      */
      compareOperator: t$2(operator$2),
      /**
      [Operator](#highlight.tags.operator) that updates its operand.
      */
      updateOperator: t$2(operator$2),
      /**
      [Operator](#highlight.tags.operator) that defines something.
      */
      definitionOperator: t$2(operator$2),
      /**
      Type-related [operator](#highlight.tags.operator).
      */
      typeOperator: t$2(operator$2),
      /**
      Control-flow [operator](#highlight.tags.operator).
      */
      controlOperator: t$2(operator$2),
      /**
      Program or markup punctuation.
      */
      punctuation: punctuation$2,
      /**
      [Punctuation](#highlight.tags.punctuation) that separates
      things.
      */
      separator: t$2(punctuation$2),
      /**
      Bracket-style [punctuation](#highlight.tags.punctuation).
      */
      bracket: bracket$2,
      /**
      Angle [brackets](#highlight.tags.bracket) (usually `<` and `>`
      tokens).
      */
      angleBracket: t$2(bracket$2),
      /**
      Square [brackets](#highlight.tags.bracket) (usually `[` and `]`
      tokens).
      */
      squareBracket: t$2(bracket$2),
      /**
      Parentheses (usually `(` and `)` tokens). Subtag of
      [bracket](#highlight.tags.bracket).
      */
      paren: t$2(bracket$2),
      /**
      Braces (usually `{` and `}` tokens). Subtag of
      [bracket](#highlight.tags.bracket).
      */
      brace: t$2(bracket$2),
      /**
      Content, for example plain text in XML or markup documents.
      */
      content: content$2,
      /**
      [Content](#highlight.tags.content) that represents a heading.
      */
      heading: heading$2,
      /**
      A level 1 [heading](#highlight.tags.heading).
      */
      heading1: t$2(heading$2),
      /**
      A level 2 [heading](#highlight.tags.heading).
      */
      heading2: t$2(heading$2),
      /**
      A level 3 [heading](#highlight.tags.heading).
      */
      heading3: t$2(heading$2),
      /**
      A level 4 [heading](#highlight.tags.heading).
      */
      heading4: t$2(heading$2),
      /**
      A level 5 [heading](#highlight.tags.heading).
      */
      heading5: t$2(heading$2),
      /**
      A level 6 [heading](#highlight.tags.heading).
      */
      heading6: t$2(heading$2),
      /**
      A prose [content](#highlight.tags.content) separator (such as a horizontal rule).
      */
      contentSeparator: t$2(content$2),
      /**
      [Content](#highlight.tags.content) that represents a list.
      */
      list: t$2(content$2),
      /**
      [Content](#highlight.tags.content) that represents a quote.
      */
      quote: t$2(content$2),
      /**
      [Content](#highlight.tags.content) that is emphasized.
      */
      emphasis: t$2(content$2),
      /**
      [Content](#highlight.tags.content) that is styled strong.
      */
      strong: t$2(content$2),
      /**
      [Content](#highlight.tags.content) that is part of a link.
      */
      link: t$2(content$2),
      /**
      [Content](#highlight.tags.content) that is styled as code or
      monospace.
      */
      monospace: t$2(content$2),
      /**
      [Content](#highlight.tags.content) that has a strike-through
      style.
      */
      strikethrough: t$2(content$2),
      /**
      Inserted text in a change-tracking format.
      */
      inserted: t$2(),
      /**
      Deleted text.
      */
      deleted: t$2(),
      /**
      Changed text.
      */
      changed: t$2(),
      /**
      An invalid or unsyntactic element.
      */
      invalid: t$2(),
      /**
      Metadata or meta-instruction.
      */
      meta: meta$2,
      /**
      [Metadata](#highlight.tags.meta) that applies to the entire
      document.
      */
      documentMeta: t$2(meta$2),
      /**
      [Metadata](#highlight.tags.meta) that annotates or adds
      attributes to a given syntactic element.
      */
      annotation: t$2(meta$2),
      /**
      Processing instruction or preprocessor directive. Subtag of
      [meta](#highlight.tags.meta).
      */
      processingInstruction: t$2(meta$2),
      /**
      [Modifier](#highlight.Tag^defineModifier) that indicates that a
      given element is being defined. Expected to be used with the
      various [name](#highlight.tags.name) tags.
      */
      definition: Tag$2.defineModifier("definition"),
      /**
      [Modifier](#highlight.Tag^defineModifier) that indicates that
      something is constant. Mostly expected to be used with
      [variable names](#highlight.tags.variableName).
      */
      constant: Tag$2.defineModifier("constant"),
      /**
      [Modifier](#highlight.Tag^defineModifier) used to indicate that
      a [variable](#highlight.tags.variableName) or [property
      name](#highlight.tags.propertyName) is being called or defined
      as a function.
      */
      function: Tag$2.defineModifier("function"),
      /**
      [Modifier](#highlight.Tag^defineModifier) that can be applied to
      [names](#highlight.tags.name) to indicate that they belong to
      the language's standard environment.
      */
      standard: Tag$2.defineModifier("standard"),
      /**
      [Modifier](#highlight.Tag^defineModifier) that indicates a given
      [names](#highlight.tags.name) is local to some scope.
      */
      local: Tag$2.defineModifier("local"),
      /**
      A generic variant [modifier](#highlight.Tag^defineModifier) that
      can be used to tag language-specific alternative variants of
      some common tag. It is recommended for themes to define special
      forms of at least the [string](#highlight.tags.string) and
      [variable name](#highlight.tags.variableName) tags, since those
      come up a lot.
      */
      special: Tag$2.defineModifier("special")
    };
    for (let name2 in tags$2) {
      let val = tags$2[name2];
      if (val instanceof Tag$2)
        val.name = name2;
    }
    tagHighlighter$2([
      { tag: tags$2.link, class: "tok-link" },
      { tag: tags$2.heading, class: "tok-heading" },
      { tag: tags$2.emphasis, class: "tok-emphasis" },
      { tag: tags$2.strong, class: "tok-strong" },
      { tag: tags$2.keyword, class: "tok-keyword" },
      { tag: tags$2.atom, class: "tok-atom" },
      { tag: tags$2.bool, class: "tok-bool" },
      { tag: tags$2.url, class: "tok-url" },
      { tag: tags$2.labelName, class: "tok-labelName" },
      { tag: tags$2.inserted, class: "tok-inserted" },
      { tag: tags$2.deleted, class: "tok-deleted" },
      { tag: tags$2.literal, class: "tok-literal" },
      { tag: tags$2.string, class: "tok-string" },
      { tag: tags$2.number, class: "tok-number" },
      { tag: [tags$2.regexp, tags$2.escape, tags$2.special(tags$2.string)], class: "tok-string2" },
      { tag: tags$2.variableName, class: "tok-variableName" },
      { tag: tags$2.local(tags$2.variableName), class: "tok-variableName tok-local" },
      { tag: tags$2.definition(tags$2.variableName), class: "tok-variableName tok-definition" },
      { tag: tags$2.special(tags$2.variableName), class: "tok-variableName2" },
      { tag: tags$2.definition(tags$2.propertyName), class: "tok-propertyName tok-definition" },
      { tag: tags$2.typeName, class: "tok-typeName" },
      { tag: tags$2.namespace, class: "tok-namespace" },
      { tag: tags$2.className, class: "tok-className" },
      { tag: tags$2.macroName, class: "tok-macroName" },
      { tag: tags$2.propertyName, class: "tok-propertyName" },
      { tag: tags$2.operator, class: "tok-operator" },
      { tag: tags$2.comment, class: "tok-comment" },
      { tag: tags$2.meta, class: "tok-meta" },
      { tag: tags$2.invalid, class: "tok-invalid" },
      { tag: tags$2.punctuation, class: "tok-punctuation" }
    ]);
    let nextTagID$1 = 0;
    let Tag$1 = class Tag2 {
      /**
      @internal
      */
      constructor(name2, set2, base2, modified) {
        this.name = name2;
        this.set = set2;
        this.base = base2;
        this.modified = modified;
        this.id = nextTagID$1++;
      }
      toString() {
        let { name: name2 } = this;
        for (let mod2 of this.modified)
          if (mod2.name)
            name2 = `${mod2.name}(${name2})`;
        return name2;
      }
      static define(nameOrParent, parent) {
        let name2 = typeof nameOrParent == "string" ? nameOrParent : "?";
        if (nameOrParent instanceof Tag2)
          parent = nameOrParent;
        if (parent === null || parent === void 0 ? void 0 : parent.base)
          throw new Error("Can not derive from a modified tag");
        let tag = new Tag2(name2, [], null, []);
        tag.set.push(tag);
        if (parent)
          for (let t2 of parent.set)
            tag.set.push(t2);
        return tag;
      }
      /**
      Define a tag _modifier_, which is a function that, given a tag,
      will return a tag that is a subtag of the original. Applying the
      same modifier to a twice tag will return the same value (`m1(t1)
      == m1(t1)`) and applying multiple modifiers will, regardless or
      order, produce the same tag (`m1(m2(t1)) == m2(m1(t1))`).
      
      When multiple modifiers are applied to a given base tag, each
      smaller set of modifiers is registered as a parent, so that for
      example `m1(m2(m3(t1)))` is a subtype of `m1(m2(t1))`,
      `m1(m3(t1)`, and so on.
      */
      static defineModifier(name2) {
        let mod2 = new Modifier$1(name2);
        return (tag) => {
          if (tag.modified.indexOf(mod2) > -1)
            return tag;
          return Modifier$1.get(tag.base || tag, tag.modified.concat(mod2).sort((a, b) => a.id - b.id));
        };
      }
    };
    let nextModifierID$1 = 0;
    let Modifier$1 = class Modifier2 {
      constructor(name2) {
        this.name = name2;
        this.instances = [];
        this.id = nextModifierID$1++;
      }
      static get(base2, mods) {
        if (!mods.length)
          return base2;
        let exists = mods[0].instances.find((t2) => t2.base == base2 && sameArray$1(mods, t2.modified));
        if (exists)
          return exists;
        let set2 = [], tag = new Tag$1(base2.name, set2, base2, mods);
        for (let m of mods)
          m.instances.push(tag);
        let configs = powerSet$1(mods);
        for (let parent of base2.set)
          if (!parent.modified.length)
            for (let config2 of configs)
              set2.push(Modifier2.get(parent, config2));
        return tag;
      }
    };
    function sameArray$1(a, b) {
      return a.length == b.length && a.every((x2, i2) => x2 == b[i2]);
    }
    function powerSet$1(array) {
      let sets = [[]];
      for (let i2 = 0; i2 < array.length; i2++) {
        for (let j = 0, e = sets.length; j < e; j++) {
          sets.push(sets[j].concat(array[i2]));
        }
      }
      return sets.sort((a, b) => b.length - a.length);
    }
    function styleTags$1(spec) {
      let byName = /* @__PURE__ */ Object.create(null);
      for (let prop2 in spec) {
        let tags2 = spec[prop2];
        if (!Array.isArray(tags2))
          tags2 = [tags2];
        for (let part2 of prop2.split(" "))
          if (part2) {
            let pieces = [], mode = 2, rest = part2;
            for (let pos2 = 0; ; ) {
              if (rest == "..." && pos2 > 0 && pos2 + 3 == part2.length) {
                mode = 1;
                break;
              }
              let m = /^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(rest);
              if (!m)
                throw new RangeError("Invalid path: " + part2);
              pieces.push(m[0] == "*" ? "" : m[0][0] == '"' ? JSON.parse(m[0]) : m[0]);
              pos2 += m[0].length;
              if (pos2 == part2.length)
                break;
              let next = part2[pos2++];
              if (pos2 == part2.length && next == "!") {
                mode = 0;
                break;
              }
              if (next != "/")
                throw new RangeError("Invalid path: " + part2);
              rest = part2.slice(pos2);
            }
            let last = pieces.length - 1, inner2 = pieces[last];
            if (!inner2)
              throw new RangeError("Invalid path: " + part2);
            let rule = new Rule$1(tags2, mode, last > 0 ? pieces.slice(0, last) : null);
            byName[inner2] = rule.sort(byName[inner2]);
          }
      }
      return ruleNodeProp$1.add(byName);
    }
    const ruleNodeProp$1 = new NodeProp$1();
    let Rule$1 = class Rule {
      constructor(tags2, mode, context, next) {
        this.tags = tags2;
        this.mode = mode;
        this.context = context;
        this.next = next;
      }
      get opaque() {
        return this.mode == 0;
      }
      get inherit() {
        return this.mode == 1;
      }
      sort(other) {
        if (!other || other.depth < this.depth) {
          this.next = other;
          return this;
        }
        other.next = this.sort(other.next);
        return other;
      }
      get depth() {
        return this.context ? this.context.length : 0;
      }
    };
    Rule$1.empty = new Rule$1([], 2, null);
    function tagHighlighter$1(tags2, options2) {
      let map2 = /* @__PURE__ */ Object.create(null);
      for (let style2 of tags2) {
        if (!Array.isArray(style2.tag))
          map2[style2.tag.id] = style2.class;
        else
          for (let tag of style2.tag)
            map2[tag.id] = style2.class;
      }
      let { scope, all: all2 = null } = options2 || {};
      return {
        style: (tags3) => {
          let cls = all2;
          for (let tag of tags3) {
            for (let sub2 of tag.set) {
              let tagClass = map2[sub2.id];
              if (tagClass) {
                cls = cls ? cls + " " + tagClass : tagClass;
                break;
              }
            }
          }
          return cls;
        },
        scope
      };
    }
    function highlightTags(highlighters, tags2) {
      let result2 = null;
      for (let highlighter of highlighters) {
        let value2 = highlighter.style(tags2);
        if (value2)
          result2 = result2 ? result2 + " " + value2 : value2;
      }
      return result2;
    }
    function highlightTree(tree, highlighter, putStyle, from = 0, to2 = tree.length) {
      let builder = new HighlightBuilder(from, Array.isArray(highlighter) ? highlighter : [highlighter], putStyle);
      builder.highlightRange(tree.cursor(), from, to2, "", builder.highlighters);
      builder.flush(to2);
    }
    class HighlightBuilder {
      constructor(at, highlighters, span) {
        this.at = at;
        this.highlighters = highlighters;
        this.span = span;
        this.class = "";
      }
      startSpan(at, cls) {
        if (cls != this.class) {
          this.flush(at);
          if (at > this.at)
            this.at = at;
          this.class = cls;
        }
      }
      flush(to2) {
        if (to2 > this.at && this.class)
          this.span(this.at, to2, this.class);
      }
      highlightRange(cursor, from, to2, inheritedClass, highlighters) {
        let { type, from: start2, to: end2 } = cursor;
        if (start2 >= to2 || end2 <= from)
          return;
        if (type.isTop)
          highlighters = this.highlighters.filter((h) => !h.scope || h.scope(type));
        let cls = inheritedClass;
        let rule = getStyleTags(cursor) || Rule$1.empty;
        let tagCls = highlightTags(highlighters, rule.tags);
        if (tagCls) {
          if (cls)
            cls += " ";
          cls += tagCls;
          if (rule.mode == 1)
            inheritedClass += (inheritedClass ? " " : "") + tagCls;
        }
        this.startSpan(Math.max(from, start2), cls);
        if (rule.opaque)
          return;
        let mounted = cursor.tree && cursor.tree.prop(NodeProp$1.mounted);
        if (mounted && mounted.overlay) {
          let inner2 = cursor.node.enter(mounted.overlay[0].from + start2, 1);
          let innerHighlighters = this.highlighters.filter((h) => !h.scope || h.scope(mounted.tree.type));
          let hasChild2 = cursor.firstChild();
          for (let i2 = 0, pos2 = start2; ; i2++) {
            let next = i2 < mounted.overlay.length ? mounted.overlay[i2] : null;
            let nextPos = next ? next.from + start2 : end2;
            let rangeFrom2 = Math.max(from, pos2), rangeTo2 = Math.min(to2, nextPos);
            if (rangeFrom2 < rangeTo2 && hasChild2) {
              while (cursor.from < rangeTo2) {
                this.highlightRange(cursor, rangeFrom2, rangeTo2, inheritedClass, highlighters);
                this.startSpan(Math.min(rangeTo2, cursor.to), cls);
                if (cursor.to >= nextPos || !cursor.nextSibling())
                  break;
              }
            }
            if (!next || nextPos > to2)
              break;
            pos2 = next.to + start2;
            if (pos2 > from) {
              this.highlightRange(inner2.cursor(), Math.max(from, next.from + start2), Math.min(to2, pos2), "", innerHighlighters);
              this.startSpan(Math.min(to2, pos2), cls);
            }
          }
          if (hasChild2)
            cursor.parent();
        } else if (cursor.firstChild()) {
          if (mounted)
            inheritedClass = "";
          do {
            if (cursor.to <= from)
              continue;
            if (cursor.from >= to2)
              break;
            this.highlightRange(cursor, from, to2, inheritedClass, highlighters);
            this.startSpan(Math.min(to2, cursor.to), cls);
          } while (cursor.nextSibling());
          cursor.parent();
        }
      }
    }
    function getStyleTags(node2) {
      let rule = node2.type.prop(ruleNodeProp$1);
      while (rule && rule.context && !node2.matchContext(rule.context))
        rule = rule.next;
      return rule || null;
    }
    const t$1 = Tag$1.define;
    const comment$1 = t$1(), name$1 = t$1(), typeName$1 = t$1(name$1), propertyName$1 = t$1(name$1), literal$1 = t$1(), string$1 = t$1(literal$1), number$1 = t$1(literal$1), content$1 = t$1(), heading$1 = t$1(content$1), keyword$1 = t$1(), operator$1 = t$1(), punctuation$1 = t$1(), bracket$1 = t$1(punctuation$1), meta$1 = t$1();
    const tags$1 = {
      /**
      A comment.
      */
      comment: comment$1,
      /**
      A line [comment](#highlight.tags.comment).
      */
      lineComment: t$1(comment$1),
      /**
      A block [comment](#highlight.tags.comment).
      */
      blockComment: t$1(comment$1),
      /**
      A documentation [comment](#highlight.tags.comment).
      */
      docComment: t$1(comment$1),
      /**
      Any kind of identifier.
      */
      name: name$1,
      /**
      The [name](#highlight.tags.name) of a variable.
      */
      variableName: t$1(name$1),
      /**
      A type [name](#highlight.tags.name).
      */
      typeName: typeName$1,
      /**
      A tag name (subtag of [`typeName`](#highlight.tags.typeName)).
      */
      tagName: t$1(typeName$1),
      /**
      A property or field [name](#highlight.tags.name).
      */
      propertyName: propertyName$1,
      /**
      An attribute name (subtag of [`propertyName`](#highlight.tags.propertyName)).
      */
      attributeName: t$1(propertyName$1),
      /**
      The [name](#highlight.tags.name) of a class.
      */
      className: t$1(name$1),
      /**
      A label [name](#highlight.tags.name).
      */
      labelName: t$1(name$1),
      /**
      A namespace [name](#highlight.tags.name).
      */
      namespace: t$1(name$1),
      /**
      The [name](#highlight.tags.name) of a macro.
      */
      macroName: t$1(name$1),
      /**
      A literal value.
      */
      literal: literal$1,
      /**
      A string [literal](#highlight.tags.literal).
      */
      string: string$1,
      /**
      A documentation [string](#highlight.tags.string).
      */
      docString: t$1(string$1),
      /**
      A character literal (subtag of [string](#highlight.tags.string)).
      */
      character: t$1(string$1),
      /**
      An attribute value (subtag of [string](#highlight.tags.string)).
      */
      attributeValue: t$1(string$1),
      /**
      A number [literal](#highlight.tags.literal).
      */
      number: number$1,
      /**
      An integer [number](#highlight.tags.number) literal.
      */
      integer: t$1(number$1),
      /**
      A floating-point [number](#highlight.tags.number) literal.
      */
      float: t$1(number$1),
      /**
      A boolean [literal](#highlight.tags.literal).
      */
      bool: t$1(literal$1),
      /**
      Regular expression [literal](#highlight.tags.literal).
      */
      regexp: t$1(literal$1),
      /**
      An escape [literal](#highlight.tags.literal), for example a
      backslash escape in a string.
      */
      escape: t$1(literal$1),
      /**
      A color [literal](#highlight.tags.literal).
      */
      color: t$1(literal$1),
      /**
      A URL [literal](#highlight.tags.literal).
      */
      url: t$1(literal$1),
      /**
      A language keyword.
      */
      keyword: keyword$1,
      /**
      The [keyword](#highlight.tags.keyword) for the self or this
      object.
      */
      self: t$1(keyword$1),
      /**
      The [keyword](#highlight.tags.keyword) for null.
      */
      null: t$1(keyword$1),
      /**
      A [keyword](#highlight.tags.keyword) denoting some atomic value.
      */
      atom: t$1(keyword$1),
      /**
      A [keyword](#highlight.tags.keyword) that represents a unit.
      */
      unit: t$1(keyword$1),
      /**
      A modifier [keyword](#highlight.tags.keyword).
      */
      modifier: t$1(keyword$1),
      /**
      A [keyword](#highlight.tags.keyword) that acts as an operator.
      */
      operatorKeyword: t$1(keyword$1),
      /**
      A control-flow related [keyword](#highlight.tags.keyword).
      */
      controlKeyword: t$1(keyword$1),
      /**
      A [keyword](#highlight.tags.keyword) that defines something.
      */
      definitionKeyword: t$1(keyword$1),
      /**
      A [keyword](#highlight.tags.keyword) related to defining or
      interfacing with modules.
      */
      moduleKeyword: t$1(keyword$1),
      /**
      An operator.
      */
      operator: operator$1,
      /**
      An [operator](#highlight.tags.operator) that dereferences something.
      */
      derefOperator: t$1(operator$1),
      /**
      Arithmetic-related [operator](#highlight.tags.operator).
      */
      arithmeticOperator: t$1(operator$1),
      /**
      Logical [operator](#highlight.tags.operator).
      */
      logicOperator: t$1(operator$1),
      /**
      Bit [operator](#highlight.tags.operator).
      */
      bitwiseOperator: t$1(operator$1),
      /**
      Comparison [operator](#highlight.tags.operator).
      */
      compareOperator: t$1(operator$1),
      /**
      [Operator](#highlight.tags.operator) that updates its operand.
      */
      updateOperator: t$1(operator$1),
      /**
      [Operator](#highlight.tags.operator) that defines something.
      */
      definitionOperator: t$1(operator$1),
      /**
      Type-related [operator](#highlight.tags.operator).
      */
      typeOperator: t$1(operator$1),
      /**
      Control-flow [operator](#highlight.tags.operator).
      */
      controlOperator: t$1(operator$1),
      /**
      Program or markup punctuation.
      */
      punctuation: punctuation$1,
      /**
      [Punctuation](#highlight.tags.punctuation) that separates
      things.
      */
      separator: t$1(punctuation$1),
      /**
      Bracket-style [punctuation](#highlight.tags.punctuation).
      */
      bracket: bracket$1,
      /**
      Angle [brackets](#highlight.tags.bracket) (usually `<` and `>`
      tokens).
      */
      angleBracket: t$1(bracket$1),
      /**
      Square [brackets](#highlight.tags.bracket) (usually `[` and `]`
      tokens).
      */
      squareBracket: t$1(bracket$1),
      /**
      Parentheses (usually `(` and `)` tokens). Subtag of
      [bracket](#highlight.tags.bracket).
      */
      paren: t$1(bracket$1),
      /**
      Braces (usually `{` and `}` tokens). Subtag of
      [bracket](#highlight.tags.bracket).
      */
      brace: t$1(bracket$1),
      /**
      Content, for example plain text in XML or markup documents.
      */
      content: content$1,
      /**
      [Content](#highlight.tags.content) that represents a heading.
      */
      heading: heading$1,
      /**
      A level 1 [heading](#highlight.tags.heading).
      */
      heading1: t$1(heading$1),
      /**
      A level 2 [heading](#highlight.tags.heading).
      */
      heading2: t$1(heading$1),
      /**
      A level 3 [heading](#highlight.tags.heading).
      */
      heading3: t$1(heading$1),
      /**
      A level 4 [heading](#highlight.tags.heading).
      */
      heading4: t$1(heading$1),
      /**
      A level 5 [heading](#highlight.tags.heading).
      */
      heading5: t$1(heading$1),
      /**
      A level 6 [heading](#highlight.tags.heading).
      */
      heading6: t$1(heading$1),
      /**
      A prose [content](#highlight.tags.content) separator (such as a horizontal rule).
      */
      contentSeparator: t$1(content$1),
      /**
      [Content](#highlight.tags.content) that represents a list.
      */
      list: t$1(content$1),
      /**
      [Content](#highlight.tags.content) that represents a quote.
      */
      quote: t$1(content$1),
      /**
      [Content](#highlight.tags.content) that is emphasized.
      */
      emphasis: t$1(content$1),
      /**
      [Content](#highlight.tags.content) that is styled strong.
      */
      strong: t$1(content$1),
      /**
      [Content](#highlight.tags.content) that is part of a link.
      */
      link: t$1(content$1),
      /**
      [Content](#highlight.tags.content) that is styled as code or
      monospace.
      */
      monospace: t$1(content$1),
      /**
      [Content](#highlight.tags.content) that has a strike-through
      style.
      */
      strikethrough: t$1(content$1),
      /**
      Inserted text in a change-tracking format.
      */
      inserted: t$1(),
      /**
      Deleted text.
      */
      deleted: t$1(),
      /**
      Changed text.
      */
      changed: t$1(),
      /**
      An invalid or unsyntactic element.
      */
      invalid: t$1(),
      /**
      Metadata or meta-instruction.
      */
      meta: meta$1,
      /**
      [Metadata](#highlight.tags.meta) that applies to the entire
      document.
      */
      documentMeta: t$1(meta$1),
      /**
      [Metadata](#highlight.tags.meta) that annotates or adds
      attributes to a given syntactic element.
      */
      annotation: t$1(meta$1),
      /**
      Processing instruction or preprocessor directive. Subtag of
      [meta](#highlight.tags.meta).
      */
      processingInstruction: t$1(meta$1),
      /**
      [Modifier](#highlight.Tag^defineModifier) that indicates that a
      given element is being defined. Expected to be used with the
      various [name](#highlight.tags.name) tags.
      */
      definition: Tag$1.defineModifier("definition"),
      /**
      [Modifier](#highlight.Tag^defineModifier) that indicates that
      something is constant. Mostly expected to be used with
      [variable names](#highlight.tags.variableName).
      */
      constant: Tag$1.defineModifier("constant"),
      /**
      [Modifier](#highlight.Tag^defineModifier) used to indicate that
      a [variable](#highlight.tags.variableName) or [property
      name](#highlight.tags.propertyName) is being called or defined
      as a function.
      */
      function: Tag$1.defineModifier("function"),
      /**
      [Modifier](#highlight.Tag^defineModifier) that can be applied to
      [names](#highlight.tags.name) to indicate that they belong to
      the language's standard environment.
      */
      standard: Tag$1.defineModifier("standard"),
      /**
      [Modifier](#highlight.Tag^defineModifier) that indicates a given
      [names](#highlight.tags.name) is local to some scope.
      */
      local: Tag$1.defineModifier("local"),
      /**
      A generic variant [modifier](#highlight.Tag^defineModifier) that
      can be used to tag language-specific alternative variants of
      some common tag. It is recommended for themes to define special
      forms of at least the [string](#highlight.tags.string) and
      [variable name](#highlight.tags.variableName) tags, since those
      come up a lot.
      */
      special: Tag$1.defineModifier("special")
    };
    for (let name2 in tags$1) {
      let val = tags$1[name2];
      if (val instanceof Tag$1)
        val.name = name2;
    }
    tagHighlighter$1([
      { tag: tags$1.link, class: "tok-link" },
      { tag: tags$1.heading, class: "tok-heading" },
      { tag: tags$1.emphasis, class: "tok-emphasis" },
      { tag: tags$1.strong, class: "tok-strong" },
      { tag: tags$1.keyword, class: "tok-keyword" },
      { tag: tags$1.atom, class: "tok-atom" },
      { tag: tags$1.bool, class: "tok-bool" },
      { tag: tags$1.url, class: "tok-url" },
      { tag: tags$1.labelName, class: "tok-labelName" },
      { tag: tags$1.inserted, class: "tok-inserted" },
      { tag: tags$1.deleted, class: "tok-deleted" },
      { tag: tags$1.literal, class: "tok-literal" },
      { tag: tags$1.string, class: "tok-string" },
      { tag: tags$1.number, class: "tok-number" },
      { tag: [tags$1.regexp, tags$1.escape, tags$1.special(tags$1.string)], class: "tok-string2" },
      { tag: tags$1.variableName, class: "tok-variableName" },
      { tag: tags$1.local(tags$1.variableName), class: "tok-variableName tok-local" },
      { tag: tags$1.definition(tags$1.variableName), class: "tok-variableName tok-definition" },
      { tag: tags$1.special(tags$1.variableName), class: "tok-variableName2" },
      { tag: tags$1.definition(tags$1.propertyName), class: "tok-propertyName tok-definition" },
      { tag: tags$1.typeName, class: "tok-typeName" },
      { tag: tags$1.namespace, class: "tok-namespace" },
      { tag: tags$1.className, class: "tok-className" },
      { tag: tags$1.macroName, class: "tok-macroName" },
      { tag: tags$1.propertyName, class: "tok-propertyName" },
      { tag: tags$1.operator, class: "tok-operator" },
      { tag: tags$1.comment, class: "tok-comment" },
      { tag: tags$1.meta, class: "tok-meta" },
      { tag: tags$1.invalid, class: "tok-invalid" },
      { tag: tags$1.punctuation, class: "tok-punctuation" }
    ]);
    var _a$1;
    const languageDataProp$1 = /* @__PURE__ */ new NodeProp$1();
    const sublanguageProp$1 = /* @__PURE__ */ new NodeProp$1();
    let Language$1 = class Language {
      /**
      Construct a language object. If you need to invoke this
      directly, first define a data facet with
      [`defineLanguageFacet`](https://codemirror.net/6/docs/ref/#language.defineLanguageFacet), and then
      configure your parser to [attach](https://codemirror.net/6/docs/ref/#language.languageDataProp) it
      to the language's outer syntax node.
      */
      constructor(data, parser2, extraExtensions = [], name2 = "") {
        this.data = data;
        this.name = name2;
        if (!EditorState.prototype.hasOwnProperty("tree"))
          Object.defineProperty(EditorState.prototype, "tree", { get() {
            return syntaxTree$1(this);
          } });
        this.parser = parser2;
        this.extension = [
          language$2.of(this),
          EditorState.languageData.of((state, pos2, side) => {
            let top2 = topNodeAt$1(state, pos2, side), data2 = top2.type.prop(languageDataProp$1);
            if (!data2)
              return [];
            let base2 = state.facet(data2), sub2 = top2.type.prop(sublanguageProp$1);
            if (sub2) {
              let innerNode = top2.resolve(pos2 - top2.from, side);
              for (let sublang of sub2)
                if (sublang.test(innerNode, state)) {
                  let data3 = state.facet(sublang.facet);
                  return sublang.type == "replace" ? data3 : data3.concat(base2);
                }
            }
            return base2;
          })
        ].concat(extraExtensions);
      }
      /**
      Query whether this language is active at the given position.
      */
      isActiveAt(state, pos2, side = -1) {
        return topNodeAt$1(state, pos2, side).type.prop(languageDataProp$1) == this.data;
      }
      /**
      Find the document regions that were parsed using this language.
      The returned regions will _include_ any nested languages rooted
      in this language, when those exist.
      */
      findRegions(state) {
        let lang2 = state.facet(language$2);
        if ((lang2 === null || lang2 === void 0 ? void 0 : lang2.data) == this.data)
          return [{ from: 0, to: state.doc.length }];
        if (!lang2 || !lang2.allowsNesting)
          return [];
        let result2 = [];
        let explore = (tree, from) => {
          if (tree.prop(languageDataProp$1) == this.data) {
            result2.push({ from, to: from + tree.length });
            return;
          }
          let mount2 = tree.prop(NodeProp$1.mounted);
          if (mount2) {
            if (mount2.tree.prop(languageDataProp$1) == this.data) {
              if (mount2.overlay)
                for (let r2 of mount2.overlay)
                  result2.push({ from: r2.from + from, to: r2.to + from });
              else
                result2.push({ from, to: from + tree.length });
              return;
            } else if (mount2.overlay) {
              let size = result2.length;
              explore(mount2.tree, mount2.overlay[0].from + from);
              if (result2.length > size)
                return;
            }
          }
          for (let i2 = 0; i2 < tree.children.length; i2++) {
            let ch3 = tree.children[i2];
            if (ch3 instanceof Tree)
              explore(ch3, tree.positions[i2] + from);
          }
        };
        explore(syntaxTree$1(state), 0);
        return result2;
      }
      /**
      Indicates whether this language allows nested languages. The
      default implementation returns true.
      */
      get allowsNesting() {
        return true;
      }
    };
    Language$1.setState = /* @__PURE__ */ StateEffect.define();
    function topNodeAt$1(state, pos2, side) {
      let topLang = state.facet(language$2), tree = syntaxTree$1(state).topNode;
      if (!topLang || topLang.allowsNesting) {
        for (let node2 = tree; node2; node2 = node2.enter(pos2, side, IterMode$1.ExcludeBuffers))
          if (node2.type.isTop)
            tree = node2;
      }
      return tree;
    }
    function syntaxTree$1(state) {
      let field = state.field(Language$1.state, false);
      return field ? field.tree : Tree.empty;
    }
    let DocInput$1 = class DocInput {
      /**
      Create an input object for the given document.
      */
      constructor(doc2) {
        this.doc = doc2;
        this.cursorPos = 0;
        this.string = "";
        this.cursor = doc2.iter();
      }
      get length() {
        return this.doc.length;
      }
      syncTo(pos2) {
        this.string = this.cursor.next(pos2 - this.cursorPos).value;
        this.cursorPos = pos2 + this.string.length;
        return this.cursorPos - this.string.length;
      }
      chunk(pos2) {
        this.syncTo(pos2);
        return this.string;
      }
      get lineChunks() {
        return true;
      }
      read(from, to2) {
        let stringStart = this.cursorPos - this.string.length;
        if (from < stringStart || to2 >= this.cursorPos)
          return this.doc.sliceString(from, to2);
        else
          return this.string.slice(from - stringStart, to2 - stringStart);
      }
    };
    let currentContext$1 = null;
    let ParseContext$1 = class ParseContext2 {
      constructor(parser2, state, fragments = [], tree, treeLen, viewport2, skipped, scheduleOn) {
        this.parser = parser2;
        this.state = state;
        this.fragments = fragments;
        this.tree = tree;
        this.treeLen = treeLen;
        this.viewport = viewport2;
        this.skipped = skipped;
        this.scheduleOn = scheduleOn;
        this.parse = null;
        this.tempSkipped = [];
      }
      /**
      @internal
      */
      static create(parser2, state, viewport2) {
        return new ParseContext2(parser2, state, [], Tree.empty, 0, viewport2, [], null);
      }
      startParse() {
        return this.parser.startParse(new DocInput$1(this.state.doc), this.fragments);
      }
      /**
      @internal
      */
      work(until, upto) {
        if (upto != null && upto >= this.state.doc.length)
          upto = void 0;
        if (this.tree != Tree.empty && this.isDone(upto !== null && upto !== void 0 ? upto : this.state.doc.length)) {
          this.takeTree();
          return true;
        }
        return this.withContext(() => {
          var _a2;
          if (typeof until == "number") {
            let endTime = Date.now() + until;
            until = () => Date.now() > endTime;
          }
          if (!this.parse)
            this.parse = this.startParse();
          if (upto != null && (this.parse.stoppedAt == null || this.parse.stoppedAt > upto) && upto < this.state.doc.length)
            this.parse.stopAt(upto);
          for (; ; ) {
            let done = this.parse.advance();
            if (done) {
              this.fragments = this.withoutTempSkipped(TreeFragment.addTree(done, this.fragments, this.parse.stoppedAt != null));
              this.treeLen = (_a2 = this.parse.stoppedAt) !== null && _a2 !== void 0 ? _a2 : this.state.doc.length;
              this.tree = done;
              this.parse = null;
              if (this.treeLen < (upto !== null && upto !== void 0 ? upto : this.state.doc.length))
                this.parse = this.startParse();
              else
                return true;
            }
            if (until())
              return false;
          }
        });
      }
      /**
      @internal
      */
      takeTree() {
        let pos2, tree;
        if (this.parse && (pos2 = this.parse.parsedPos) >= this.treeLen) {
          if (this.parse.stoppedAt == null || this.parse.stoppedAt > pos2)
            this.parse.stopAt(pos2);
          this.withContext(() => {
            while (!(tree = this.parse.advance())) {
            }
          });
          this.treeLen = pos2;
          this.tree = tree;
          this.fragments = this.withoutTempSkipped(TreeFragment.addTree(this.tree, this.fragments, true));
          this.parse = null;
        }
      }
      withContext(f) {
        let prev = currentContext$1;
        currentContext$1 = this;
        try {
          return f();
        } finally {
          currentContext$1 = prev;
        }
      }
      withoutTempSkipped(fragments) {
        for (let r2; r2 = this.tempSkipped.pop(); )
          fragments = cutFragments$1(fragments, r2.from, r2.to);
        return fragments;
      }
      /**
      @internal
      */
      changes(changes, newState) {
        let { fragments, tree, treeLen, viewport: viewport2, skipped } = this;
        this.takeTree();
        if (!changes.empty) {
          let ranges = [];
          changes.iterChangedRanges((fromA, toA, fromB, toB) => ranges.push({ fromA, toA, fromB, toB }));
          fragments = TreeFragment.applyChanges(fragments, ranges);
          tree = Tree.empty;
          treeLen = 0;
          viewport2 = { from: changes.mapPos(viewport2.from, -1), to: changes.mapPos(viewport2.to, 1) };
          if (this.skipped.length) {
            skipped = [];
            for (let r2 of this.skipped) {
              let from = changes.mapPos(r2.from, 1), to2 = changes.mapPos(r2.to, -1);
              if (from < to2)
                skipped.push({ from, to: to2 });
            }
          }
        }
        return new ParseContext2(this.parser, newState, fragments, tree, treeLen, viewport2, skipped, this.scheduleOn);
      }
      /**
      @internal
      */
      updateViewport(viewport2) {
        if (this.viewport.from == viewport2.from && this.viewport.to == viewport2.to)
          return false;
        this.viewport = viewport2;
        let startLen = this.skipped.length;
        for (let i2 = 0; i2 < this.skipped.length; i2++) {
          let { from, to: to2 } = this.skipped[i2];
          if (from < viewport2.to && to2 > viewport2.from) {
            this.fragments = cutFragments$1(this.fragments, from, to2);
            this.skipped.splice(i2--, 1);
          }
        }
        if (this.skipped.length >= startLen)
          return false;
        this.reset();
        return true;
      }
      /**
      @internal
      */
      reset() {
        if (this.parse) {
          this.takeTree();
          this.parse = null;
        }
      }
      /**
      Notify the parse scheduler that the given region was skipped
      because it wasn't in view, and the parse should be restarted
      when it comes into view.
      */
      skipUntilInView(from, to2) {
        this.skipped.push({ from, to: to2 });
      }
      /**
      Returns a parser intended to be used as placeholder when
      asynchronously loading a nested parser. It'll skip its input and
      mark it as not-really-parsed, so that the next update will parse
      it again.
      
      When `until` is given, a reparse will be scheduled when that
      promise resolves.
      */
      static getSkippingParser(until) {
        return new class extends Parser {
          createParse(input2, fragments, ranges) {
            let from = ranges[0].from, to2 = ranges[ranges.length - 1].to;
            let parser2 = {
              parsedPos: from,
              advance() {
                let cx = currentContext$1;
                if (cx) {
                  for (let r2 of ranges)
                    cx.tempSkipped.push(r2);
                  if (until)
                    cx.scheduleOn = cx.scheduleOn ? Promise.all([cx.scheduleOn, until]) : until;
                }
                this.parsedPos = to2;
                return new Tree(NodeType$1.none, [], [], to2 - from);
              },
              stoppedAt: null,
              stopAt() {
              }
            };
            return parser2;
          }
        }();
      }
      /**
      @internal
      */
      isDone(upto) {
        upto = Math.min(upto, this.state.doc.length);
        let frags = this.fragments;
        return this.treeLen >= upto && frags.length && frags[0].from == 0 && frags[0].to >= upto;
      }
      /**
      Get the context for the current parse, or `null` if no editor
      parse is in progress.
      */
      static get() {
        return currentContext$1;
      }
    };
    function cutFragments$1(fragments, from, to2) {
      return TreeFragment.applyChanges(fragments, [{ fromA: from, toA: to2, fromB: from, toB: to2 }]);
    }
    let LanguageState$1 = class LanguageState2 {
      constructor(context) {
        this.context = context;
        this.tree = context.tree;
      }
      apply(tr2) {
        if (!tr2.docChanged && this.tree == this.context.tree)
          return this;
        let newCx = this.context.changes(tr2.changes, tr2.state);
        let upto = this.context.treeLen == tr2.startState.doc.length ? void 0 : Math.max(tr2.changes.mapPos(this.context.treeLen), newCx.viewport.to);
        if (!newCx.work(20, upto))
          newCx.takeTree();
        return new LanguageState2(newCx);
      }
      static init(state) {
        let vpTo = Math.min(3e3, state.doc.length);
        let parseState2 = ParseContext$1.create(state.facet(language$2).parser, state, { from: 0, to: vpTo });
        if (!parseState2.work(20, vpTo))
          parseState2.takeTree();
        return new LanguageState2(parseState2);
      }
    };
    Language$1.state = /* @__PURE__ */ StateField.define({
      create: LanguageState$1.init,
      update(value2, tr2) {
        for (let e of tr2.effects)
          if (e.is(Language$1.setState))
            return e.value;
        if (tr2.startState.facet(language$2) != tr2.state.facet(language$2))
          return LanguageState$1.init(tr2.state);
        return value2.apply(tr2);
      }
    });
    let requestIdle$1 = (callback) => {
      let timeout = setTimeout(
        () => callback(),
        500
        /* Work.MaxPause */
      );
      return () => clearTimeout(timeout);
    };
    if (typeof requestIdleCallback != "undefined")
      requestIdle$1 = (callback) => {
        let idle = -1, timeout = setTimeout(
          () => {
            idle = requestIdleCallback(callback, {
              timeout: 500 - 100
              /* Work.MinPause */
            });
          },
          100
          /* Work.MinPause */
        );
        return () => idle < 0 ? clearTimeout(timeout) : cancelIdleCallback(idle);
      };
    const isInputPending$1 = typeof navigator != "undefined" && ((_a$1 = navigator.scheduling) === null || _a$1 === void 0 ? void 0 : _a$1.isInputPending) ? () => navigator.scheduling.isInputPending() : null;
    const parseWorker$1 = /* @__PURE__ */ ViewPlugin.fromClass(class ParseWorker {
      constructor(view) {
        this.view = view;
        this.working = null;
        this.workScheduled = 0;
        this.chunkEnd = -1;
        this.chunkBudget = -1;
        this.work = this.work.bind(this);
        this.scheduleWork();
      }
      update(update) {
        let cx = this.view.state.field(Language$1.state).context;
        if (cx.updateViewport(update.view.viewport) || this.view.viewport.to > cx.treeLen)
          this.scheduleWork();
        if (update.docChanged || update.selectionSet) {
          if (this.view.hasFocus)
            this.chunkBudget += 50;
          this.scheduleWork();
        }
        this.checkAsyncSchedule(cx);
      }
      scheduleWork() {
        if (this.working)
          return;
        let { state } = this.view, field = state.field(Language$1.state);
        if (field.tree != field.context.tree || !field.context.isDone(state.doc.length))
          this.working = requestIdle$1(this.work);
      }
      work(deadline) {
        this.working = null;
        let now = Date.now();
        if (this.chunkEnd < now && (this.chunkEnd < 0 || this.view.hasFocus)) {
          this.chunkEnd = now + 3e4;
          this.chunkBudget = 3e3;
        }
        if (this.chunkBudget <= 0)
          return;
        let { state, viewport: { to: vpTo } } = this.view, field = state.field(Language$1.state);
        if (field.tree == field.context.tree && field.context.isDone(
          vpTo + 1e5
          /* Work.MaxParseAhead */
        ))
          return;
        let endTime = Date.now() + Math.min(this.chunkBudget, 100, deadline && !isInputPending$1 ? Math.max(25, deadline.timeRemaining() - 5) : 1e9);
        let viewportFirst = field.context.treeLen < vpTo && state.doc.length > vpTo + 1e3;
        let done = field.context.work(() => {
          return isInputPending$1 && isInputPending$1() || Date.now() > endTime;
        }, vpTo + (viewportFirst ? 0 : 1e5));
        this.chunkBudget -= Date.now() - now;
        if (done || this.chunkBudget <= 0) {
          field.context.takeTree();
          this.view.dispatch({ effects: Language$1.setState.of(new LanguageState$1(field.context)) });
        }
        if (this.chunkBudget > 0 && !(done && !viewportFirst))
          this.scheduleWork();
        this.checkAsyncSchedule(field.context);
      }
      checkAsyncSchedule(cx) {
        if (cx.scheduleOn) {
          this.workScheduled++;
          cx.scheduleOn.then(() => this.scheduleWork()).catch((err2) => logException(this.view.state, err2)).then(() => this.workScheduled--);
          cx.scheduleOn = null;
        }
      }
      destroy() {
        if (this.working)
          this.working();
      }
      isWorking() {
        return !!(this.working || this.workScheduled > 0);
      }
    }, {
      eventHandlers: { focus() {
        this.scheduleWork();
      } }
    });
    const language$2 = /* @__PURE__ */ Facet.define({
      combine(languages) {
        return languages.length ? languages[0] : null;
      },
      enables: (language2) => [
        Language$1.state,
        parseWorker$1,
        EditorView.contentAttributes.compute([language2], (state) => {
          let lang2 = state.facet(language2);
          return lang2 && lang2.name ? { "data-language": lang2.name } : {};
        })
      ]
    });
    class HighlightStyle {
      constructor(specs, options2) {
        this.specs = specs;
        let modSpec;
        function def(spec) {
          let cls = StyleModule.newName();
          (modSpec || (modSpec = /* @__PURE__ */ Object.create(null)))["." + cls] = spec;
          return cls;
        }
        const all2 = typeof options2.all == "string" ? options2.all : options2.all ? def(options2.all) : void 0;
        const scopeOpt = options2.scope;
        this.scope = scopeOpt instanceof Language$1 ? (type) => type.prop(languageDataProp$1) == scopeOpt.data : scopeOpt ? (type) => type == scopeOpt : void 0;
        this.style = tagHighlighter$1(specs.map((style2) => ({
          tag: style2.tag,
          class: style2.class || def(Object.assign({}, style2, { tag: null }))
        })), {
          all: all2
        }).style;
        this.module = modSpec ? new StyleModule(modSpec) : null;
        this.themeType = options2.themeType;
      }
      /**
      Create a highlighter style that associates the given styles to
      the given tags. The specs must be objects that hold a style tag
      or array of tags in their `tag` property, and either a single
      `class` property providing a static CSS class (for highlighter
      that rely on external styling), or a
      [`style-mod`](https://github.com/marijnh/style-mod#documentation)-style
      set of CSS properties (which define the styling for those tags).
      
      The CSS rules created for a highlighter will be emitted in the
      order of the spec's properties. That means that for elements that
      have multiple tags associated with them, styles defined further
      down in the list will have a higher CSS precedence than styles
      defined earlier.
      */
      static define(specs, options2) {
        return new HighlightStyle(specs, options2 || {});
      }
    }
    const highlighterFacet = /* @__PURE__ */ Facet.define();
    const fallbackHighlighter = /* @__PURE__ */ Facet.define({
      combine(values) {
        return values.length ? [values[0]] : null;
      }
    });
    function getHighlighters(state) {
      let main2 = state.facet(highlighterFacet);
      return main2.length ? main2 : state.facet(fallbackHighlighter);
    }
    function syntaxHighlighting(highlighter, options2) {
      let ext = [treeHighlighter], themeType;
      if (highlighter instanceof HighlightStyle) {
        if (highlighter.module)
          ext.push(EditorView.styleModule.of(highlighter.module));
        themeType = highlighter.themeType;
      }
      if (options2 === null || options2 === void 0 ? void 0 : options2.fallback)
        ext.push(fallbackHighlighter.of(highlighter));
      else if (themeType)
        ext.push(highlighterFacet.computeN([EditorView.darkTheme], (state) => {
          return state.facet(EditorView.darkTheme) == (themeType == "dark") ? [highlighter] : [];
        }));
      else
        ext.push(highlighterFacet.of(highlighter));
      return ext;
    }
    class TreeHighlighter {
      constructor(view) {
        this.markCache = /* @__PURE__ */ Object.create(null);
        this.tree = syntaxTree$1(view.state);
        this.decorations = this.buildDeco(view, getHighlighters(view.state));
        this.decoratedTo = view.viewport.to;
      }
      update(update) {
        let tree = syntaxTree$1(update.state), highlighters = getHighlighters(update.state);
        let styleChange = highlighters != getHighlighters(update.startState);
        let { viewport: viewport2 } = update.view, decoratedToMapped = update.changes.mapPos(this.decoratedTo, 1);
        if (tree.length < viewport2.to && !styleChange && tree.type == this.tree.type && decoratedToMapped >= viewport2.to) {
          this.decorations = this.decorations.map(update.changes);
          this.decoratedTo = decoratedToMapped;
        } else if (tree != this.tree || update.viewportChanged || styleChange) {
          this.tree = tree;
          this.decorations = this.buildDeco(update.view, highlighters);
          this.decoratedTo = viewport2.to;
        }
      }
      buildDeco(view, highlighters) {
        if (!highlighters || !this.tree.length)
          return Decoration.none;
        let builder = new RangeSetBuilder();
        for (let { from, to: to2 } of view.visibleRanges) {
          highlightTree(this.tree, highlighters, (from2, to3, style2) => {
            builder.add(from2, to3, this.markCache[style2] || (this.markCache[style2] = Decoration.mark({ class: style2 })));
          }, from, to2);
        }
        return builder.finish();
      }
    }
    const treeHighlighter = /* @__PURE__ */ Prec.high(/* @__PURE__ */ ViewPlugin.fromClass(TreeHighlighter, {
      decorations: (v) => v.decorations
    }));
    const defaultHighlightStyle = /* @__PURE__ */ HighlightStyle.define([
      {
        tag: tags$1.meta,
        color: "#404740"
      },
      {
        tag: tags$1.link,
        textDecoration: "underline"
      },
      {
        tag: tags$1.heading,
        textDecoration: "underline",
        fontWeight: "bold"
      },
      {
        tag: tags$1.emphasis,
        fontStyle: "italic"
      },
      {
        tag: tags$1.strong,
        fontWeight: "bold"
      },
      {
        tag: tags$1.strikethrough,
        textDecoration: "line-through"
      },
      {
        tag: tags$1.keyword,
        color: "#708"
      },
      {
        tag: [tags$1.atom, tags$1.bool, tags$1.url, tags$1.contentSeparator, tags$1.labelName],
        color: "#219"
      },
      {
        tag: [tags$1.literal, tags$1.inserted],
        color: "#164"
      },
      {
        tag: [tags$1.string, tags$1.deleted],
        color: "#a11"
      },
      {
        tag: [tags$1.regexp, tags$1.escape, /* @__PURE__ */ tags$1.special(tags$1.string)],
        color: "#e40"
      },
      {
        tag: /* @__PURE__ */ tags$1.definition(tags$1.variableName),
        color: "#00f"
      },
      {
        tag: /* @__PURE__ */ tags$1.local(tags$1.variableName),
        color: "#30a"
      },
      {
        tag: [tags$1.typeName, tags$1.namespace],
        color: "#085"
      },
      {
        tag: tags$1.className,
        color: "#167"
      },
      {
        tag: [/* @__PURE__ */ tags$1.special(tags$1.variableName), tags$1.macroName],
        color: "#256"
      },
      {
        tag: /* @__PURE__ */ tags$1.definition(tags$1.propertyName),
        color: "#00c"
      },
      {
        tag: tags$1.comment,
        color: "#940"
      },
      {
        tag: tags$1.invalid,
        color: "#f00"
      }
    ]);
    const noTokens$1 = /* @__PURE__ */ Object.create(null);
    const typeArray$1 = [NodeType$1.none];
    const warned$1 = [];
    const byTag$1 = /* @__PURE__ */ Object.create(null);
    const defaultTable$1 = /* @__PURE__ */ Object.create(null);
    for (let [legacyName, name2] of [
      ["variable", "variableName"],
      ["variable-2", "variableName.special"],
      ["string-2", "string.special"],
      ["def", "variableName.definition"],
      ["tag", "tagName"],
      ["attribute", "attributeName"],
      ["type", "typeName"],
      ["builtin", "variableName.standard"],
      ["qualifier", "modifier"],
      ["error", "invalid"],
      ["header", "heading"],
      ["property", "propertyName"]
    ])
      defaultTable$1[legacyName] = /* @__PURE__ */ createTokenType$1(noTokens$1, name2);
    function warnForPart$1(part2, msg) {
      if (warned$1.indexOf(part2) > -1)
        return;
      warned$1.push(part2);
      console.warn(msg);
    }
    function createTokenType$1(extra, tagStr) {
      let tags$1$1 = [];
      for (let name3 of tagStr.split(" ")) {
        let found = [];
        for (let part2 of name3.split(".")) {
          let value2 = extra[part2] || tags$1[part2];
          if (!value2) {
            warnForPart$1(part2, `Unknown highlighting tag ${part2}`);
          } else if (typeof value2 == "function") {
            if (!found.length)
              warnForPart$1(part2, `Modifier ${part2} used at start of tag`);
            else
              found = found.map(value2);
          } else {
            if (found.length)
              warnForPart$1(part2, `Tag ${part2} used as modifier`);
            else
              found = Array.isArray(value2) ? value2 : [value2];
          }
        }
        for (let tag of found)
          tags$1$1.push(tag);
      }
      if (!tags$1$1.length)
        return 0;
      let name2 = tagStr.replace(/ /g, "_"), key2 = name2 + " " + tags$1$1.map((t2) => t2.id);
      let known = byTag$1[key2];
      if (known)
        return known.id;
      let type = byTag$1[key2] = NodeType$1.define({
        id: typeArray$1.length,
        name: name2,
        props: [styleTags$1({ [name2]: tags$1$1 })]
      });
      typeArray$1.push(type);
      return type.id;
    }
    ({
      rtl: /* @__PURE__ */ Decoration.mark({ class: "cm-iso", inclusive: true, attributes: { dir: "rtl" }, bidiIsolate: Direction.RTL }),
      ltr: /* @__PURE__ */ Decoration.mark({ class: "cm-iso", inclusive: true, attributes: { dir: "ltr" }, bidiIsolate: Direction.LTR })
    });
    let nextTagID = 0;
    class Tag {
      /**
      @internal
      */
      constructor(name2, set2, base2, modified) {
        this.name = name2;
        this.set = set2;
        this.base = base2;
        this.modified = modified;
        this.id = nextTagID++;
      }
      toString() {
        let { name: name2 } = this;
        for (let mod2 of this.modified)
          if (mod2.name)
            name2 = `${mod2.name}(${name2})`;
        return name2;
      }
      static define(nameOrParent, parent) {
        let name2 = typeof nameOrParent == "string" ? nameOrParent : "?";
        if (nameOrParent instanceof Tag)
          parent = nameOrParent;
        if (parent === null || parent === void 0 ? void 0 : parent.base)
          throw new Error("Can not derive from a modified tag");
        let tag = new Tag(name2, [], null, []);
        tag.set.push(tag);
        if (parent)
          for (let t2 of parent.set)
            tag.set.push(t2);
        return tag;
      }
      /**
      Define a tag _modifier_, which is a function that, given a tag,
      will return a tag that is a subtag of the original. Applying the
      same modifier to a twice tag will return the same value (`m1(t1)
      == m1(t1)`) and applying multiple modifiers will, regardless or
      order, produce the same tag (`m1(m2(t1)) == m2(m1(t1))`).
      
      When multiple modifiers are applied to a given base tag, each
      smaller set of modifiers is registered as a parent, so that for
      example `m1(m2(m3(t1)))` is a subtype of `m1(m2(t1))`,
      `m1(m3(t1)`, and so on.
      */
      static defineModifier(name2) {
        let mod2 = new Modifier(name2);
        return (tag) => {
          if (tag.modified.indexOf(mod2) > -1)
            return tag;
          return Modifier.get(tag.base || tag, tag.modified.concat(mod2).sort((a, b) => a.id - b.id));
        };
      }
    }
    let nextModifierID = 0;
    class Modifier {
      constructor(name2) {
        this.name = name2;
        this.instances = [];
        this.id = nextModifierID++;
      }
      static get(base2, mods) {
        if (!mods.length)
          return base2;
        let exists = mods[0].instances.find((t2) => t2.base == base2 && sameArray(mods, t2.modified));
        if (exists)
          return exists;
        let set2 = [], tag = new Tag(base2.name, set2, base2, mods);
        for (let m of mods)
          m.instances.push(tag);
        let configs = powerSet(mods);
        for (let parent of base2.set)
          if (!parent.modified.length)
            for (let config2 of configs)
              set2.push(Modifier.get(parent, config2));
        return tag;
      }
    }
    function sameArray(a, b) {
      return a.length == b.length && a.every((x2, i2) => x2 == b[i2]);
    }
    function powerSet(array) {
      let sets = [[]];
      for (let i2 = 0; i2 < array.length; i2++) {
        for (let j = 0, e = sets.length; j < e; j++) {
          sets.push(sets[j].concat(array[i2]));
        }
      }
      return sets.sort((a, b) => b.length - a.length);
    }
    function styleTags(spec) {
      let byName = /* @__PURE__ */ Object.create(null);
      for (let prop2 in spec) {
        let tags2 = spec[prop2];
        if (!Array.isArray(tags2))
          tags2 = [tags2];
        for (let part2 of prop2.split(" "))
          if (part2) {
            let pieces = [], mode = 2, rest = part2;
            for (let pos2 = 0; ; ) {
              if (rest == "..." && pos2 > 0 && pos2 + 3 == part2.length) {
                mode = 1;
                break;
              }
              let m = /^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(rest);
              if (!m)
                throw new RangeError("Invalid path: " + part2);
              pieces.push(m[0] == "*" ? "" : m[0][0] == '"' ? JSON.parse(m[0]) : m[0]);
              pos2 += m[0].length;
              if (pos2 == part2.length)
                break;
              let next = part2[pos2++];
              if (pos2 == part2.length && next == "!") {
                mode = 0;
                break;
              }
              if (next != "/")
                throw new RangeError("Invalid path: " + part2);
              rest = part2.slice(pos2);
            }
            let last = pieces.length - 1, inner2 = pieces[last];
            if (!inner2)
              throw new RangeError("Invalid path: " + part2);
            let rule = new Rule(tags2, mode, last > 0 ? pieces.slice(0, last) : null);
            byName[inner2] = rule.sort(byName[inner2]);
          }
      }
      return ruleNodeProp.add(byName);
    }
    const ruleNodeProp = new NodeProp$1();
    class Rule {
      constructor(tags2, mode, context, next) {
        this.tags = tags2;
        this.mode = mode;
        this.context = context;
        this.next = next;
      }
      get opaque() {
        return this.mode == 0;
      }
      get inherit() {
        return this.mode == 1;
      }
      sort(other) {
        if (!other || other.depth < this.depth) {
          this.next = other;
          return this;
        }
        other.next = this.sort(other.next);
        return other;
      }
      get depth() {
        return this.context ? this.context.length : 0;
      }
    }
    Rule.empty = new Rule([], 2, null);
    function tagHighlighter(tags2, options2) {
      let map2 = /* @__PURE__ */ Object.create(null);
      for (let style2 of tags2) {
        if (!Array.isArray(style2.tag))
          map2[style2.tag.id] = style2.class;
        else
          for (let tag of style2.tag)
            map2[tag.id] = style2.class;
      }
      let { scope, all: all2 = null } = {};
      return {
        style: (tags3) => {
          let cls = all2;
          for (let tag of tags3) {
            for (let sub2 of tag.set) {
              let tagClass = map2[sub2.id];
              if (tagClass) {
                cls = cls ? cls + " " + tagClass : tagClass;
                break;
              }
            }
          }
          return cls;
        },
        scope
      };
    }
    const t = Tag.define;
    const comment = t(), name = t(), typeName = t(name), propertyName = t(name), literal = t(), string = t(literal), number = t(literal), content = t(), heading = t(content), keyword = t(), operator = t(), punctuation = t(), bracket = t(punctuation), meta = t();
    const tags = {
      /**
      A comment.
      */
      comment,
      /**
      A line [comment](#highlight.tags.comment).
      */
      lineComment: t(comment),
      /**
      A block [comment](#highlight.tags.comment).
      */
      blockComment: t(comment),
      /**
      A documentation [comment](#highlight.tags.comment).
      */
      docComment: t(comment),
      /**
      Any kind of identifier.
      */
      name,
      /**
      The [name](#highlight.tags.name) of a variable.
      */
      variableName: t(name),
      /**
      A type [name](#highlight.tags.name).
      */
      typeName,
      /**
      A tag name (subtag of [`typeName`](#highlight.tags.typeName)).
      */
      tagName: t(typeName),
      /**
      A property or field [name](#highlight.tags.name).
      */
      propertyName,
      /**
      An attribute name (subtag of [`propertyName`](#highlight.tags.propertyName)).
      */
      attributeName: t(propertyName),
      /**
      The [name](#highlight.tags.name) of a class.
      */
      className: t(name),
      /**
      A label [name](#highlight.tags.name).
      */
      labelName: t(name),
      /**
      A namespace [name](#highlight.tags.name).
      */
      namespace: t(name),
      /**
      The [name](#highlight.tags.name) of a macro.
      */
      macroName: t(name),
      /**
      A literal value.
      */
      literal,
      /**
      A string [literal](#highlight.tags.literal).
      */
      string,
      /**
      A documentation [string](#highlight.tags.string).
      */
      docString: t(string),
      /**
      A character literal (subtag of [string](#highlight.tags.string)).
      */
      character: t(string),
      /**
      An attribute value (subtag of [string](#highlight.tags.string)).
      */
      attributeValue: t(string),
      /**
      A number [literal](#highlight.tags.literal).
      */
      number,
      /**
      An integer [number](#highlight.tags.number) literal.
      */
      integer: t(number),
      /**
      A floating-point [number](#highlight.tags.number) literal.
      */
      float: t(number),
      /**
      A boolean [literal](#highlight.tags.literal).
      */
      bool: t(literal),
      /**
      Regular expression [literal](#highlight.tags.literal).
      */
      regexp: t(literal),
      /**
      An escape [literal](#highlight.tags.literal), for example a
      backslash escape in a string.
      */
      escape: t(literal),
      /**
      A color [literal](#highlight.tags.literal).
      */
      color: t(literal),
      /**
      A URL [literal](#highlight.tags.literal).
      */
      url: t(literal),
      /**
      A language keyword.
      */
      keyword,
      /**
      The [keyword](#highlight.tags.keyword) for the self or this
      object.
      */
      self: t(keyword),
      /**
      The [keyword](#highlight.tags.keyword) for null.
      */
      null: t(keyword),
      /**
      A [keyword](#highlight.tags.keyword) denoting some atomic value.
      */
      atom: t(keyword),
      /**
      A [keyword](#highlight.tags.keyword) that represents a unit.
      */
      unit: t(keyword),
      /**
      A modifier [keyword](#highlight.tags.keyword).
      */
      modifier: t(keyword),
      /**
      A [keyword](#highlight.tags.keyword) that acts as an operator.
      */
      operatorKeyword: t(keyword),
      /**
      A control-flow related [keyword](#highlight.tags.keyword).
      */
      controlKeyword: t(keyword),
      /**
      A [keyword](#highlight.tags.keyword) that defines something.
      */
      definitionKeyword: t(keyword),
      /**
      A [keyword](#highlight.tags.keyword) related to defining or
      interfacing with modules.
      */
      moduleKeyword: t(keyword),
      /**
      An operator.
      */
      operator,
      /**
      An [operator](#highlight.tags.operator) that dereferences something.
      */
      derefOperator: t(operator),
      /**
      Arithmetic-related [operator](#highlight.tags.operator).
      */
      arithmeticOperator: t(operator),
      /**
      Logical [operator](#highlight.tags.operator).
      */
      logicOperator: t(operator),
      /**
      Bit [operator](#highlight.tags.operator).
      */
      bitwiseOperator: t(operator),
      /**
      Comparison [operator](#highlight.tags.operator).
      */
      compareOperator: t(operator),
      /**
      [Operator](#highlight.tags.operator) that updates its operand.
      */
      updateOperator: t(operator),
      /**
      [Operator](#highlight.tags.operator) that defines something.
      */
      definitionOperator: t(operator),
      /**
      Type-related [operator](#highlight.tags.operator).
      */
      typeOperator: t(operator),
      /**
      Control-flow [operator](#highlight.tags.operator).
      */
      controlOperator: t(operator),
      /**
      Program or markup punctuation.
      */
      punctuation,
      /**
      [Punctuation](#highlight.tags.punctuation) that separates
      things.
      */
      separator: t(punctuation),
      /**
      Bracket-style [punctuation](#highlight.tags.punctuation).
      */
      bracket,
      /**
      Angle [brackets](#highlight.tags.bracket) (usually `<` and `>`
      tokens).
      */
      angleBracket: t(bracket),
      /**
      Square [brackets](#highlight.tags.bracket) (usually `[` and `]`
      tokens).
      */
      squareBracket: t(bracket),
      /**
      Parentheses (usually `(` and `)` tokens). Subtag of
      [bracket](#highlight.tags.bracket).
      */
      paren: t(bracket),
      /**
      Braces (usually `{` and `}` tokens). Subtag of
      [bracket](#highlight.tags.bracket).
      */
      brace: t(bracket),
      /**
      Content, for example plain text in XML or markup documents.
      */
      content,
      /**
      [Content](#highlight.tags.content) that represents a heading.
      */
      heading,
      /**
      A level 1 [heading](#highlight.tags.heading).
      */
      heading1: t(heading),
      /**
      A level 2 [heading](#highlight.tags.heading).
      */
      heading2: t(heading),
      /**
      A level 3 [heading](#highlight.tags.heading).
      */
      heading3: t(heading),
      /**
      A level 4 [heading](#highlight.tags.heading).
      */
      heading4: t(heading),
      /**
      A level 5 [heading](#highlight.tags.heading).
      */
      heading5: t(heading),
      /**
      A level 6 [heading](#highlight.tags.heading).
      */
      heading6: t(heading),
      /**
      A prose [content](#highlight.tags.content) separator (such as a horizontal rule).
      */
      contentSeparator: t(content),
      /**
      [Content](#highlight.tags.content) that represents a list.
      */
      list: t(content),
      /**
      [Content](#highlight.tags.content) that represents a quote.
      */
      quote: t(content),
      /**
      [Content](#highlight.tags.content) that is emphasized.
      */
      emphasis: t(content),
      /**
      [Content](#highlight.tags.content) that is styled strong.
      */
      strong: t(content),
      /**
      [Content](#highlight.tags.content) that is part of a link.
      */
      link: t(content),
      /**
      [Content](#highlight.tags.content) that is styled as code or
      monospace.
      */
      monospace: t(content),
      /**
      [Content](#highlight.tags.content) that has a strike-through
      style.
      */
      strikethrough: t(content),
      /**
      Inserted text in a change-tracking format.
      */
      inserted: t(),
      /**
      Deleted text.
      */
      deleted: t(),
      /**
      Changed text.
      */
      changed: t(),
      /**
      An invalid or unsyntactic element.
      */
      invalid: t(),
      /**
      Metadata or meta-instruction.
      */
      meta,
      /**
      [Metadata](#highlight.tags.meta) that applies to the entire
      document.
      */
      documentMeta: t(meta),
      /**
      [Metadata](#highlight.tags.meta) that annotates or adds
      attributes to a given syntactic element.
      */
      annotation: t(meta),
      /**
      Processing instruction or preprocessor directive. Subtag of
      [meta](#highlight.tags.meta).
      */
      processingInstruction: t(meta),
      /**
      [Modifier](#highlight.Tag^defineModifier) that indicates that a
      given element is being defined. Expected to be used with the
      various [name](#highlight.tags.name) tags.
      */
      definition: Tag.defineModifier("definition"),
      /**
      [Modifier](#highlight.Tag^defineModifier) that indicates that
      something is constant. Mostly expected to be used with
      [variable names](#highlight.tags.variableName).
      */
      constant: Tag.defineModifier("constant"),
      /**
      [Modifier](#highlight.Tag^defineModifier) used to indicate that
      a [variable](#highlight.tags.variableName) or [property
      name](#highlight.tags.propertyName) is being called or defined
      as a function.
      */
      function: Tag.defineModifier("function"),
      /**
      [Modifier](#highlight.Tag^defineModifier) that can be applied to
      [names](#highlight.tags.name) to indicate that they belong to
      the language's standard environment.
      */
      standard: Tag.defineModifier("standard"),
      /**
      [Modifier](#highlight.Tag^defineModifier) that indicates a given
      [names](#highlight.tags.name) is local to some scope.
      */
      local: Tag.defineModifier("local"),
      /**
      A generic variant [modifier](#highlight.Tag^defineModifier) that
      can be used to tag language-specific alternative variants of
      some common tag. It is recommended for themes to define special
      forms of at least the [string](#highlight.tags.string) and
      [variable name](#highlight.tags.variableName) tags, since those
      come up a lot.
      */
      special: Tag.defineModifier("special")
    };
    for (let name2 in tags) {
      let val = tags[name2];
      if (val instanceof Tag)
        val.name = name2;
    }
    tagHighlighter([
      { tag: tags.link, class: "tok-link" },
      { tag: tags.heading, class: "tok-heading" },
      { tag: tags.emphasis, class: "tok-emphasis" },
      { tag: tags.strong, class: "tok-strong" },
      { tag: tags.keyword, class: "tok-keyword" },
      { tag: tags.atom, class: "tok-atom" },
      { tag: tags.bool, class: "tok-bool" },
      { tag: tags.url, class: "tok-url" },
      { tag: tags.labelName, class: "tok-labelName" },
      { tag: tags.inserted, class: "tok-inserted" },
      { tag: tags.deleted, class: "tok-deleted" },
      { tag: tags.literal, class: "tok-literal" },
      { tag: tags.string, class: "tok-string" },
      { tag: tags.number, class: "tok-number" },
      { tag: [tags.regexp, tags.escape, tags.special(tags.string)], class: "tok-string2" },
      { tag: tags.variableName, class: "tok-variableName" },
      { tag: tags.local(tags.variableName), class: "tok-variableName tok-local" },
      { tag: tags.definition(tags.variableName), class: "tok-variableName tok-definition" },
      { tag: tags.special(tags.variableName), class: "tok-variableName2" },
      { tag: tags.definition(tags.propertyName), class: "tok-propertyName tok-definition" },
      { tag: tags.typeName, class: "tok-typeName" },
      { tag: tags.namespace, class: "tok-namespace" },
      { tag: tags.className, class: "tok-className" },
      { tag: tags.macroName, class: "tok-macroName" },
      { tag: tags.propertyName, class: "tok-propertyName" },
      { tag: tags.operator, class: "tok-operator" },
      { tag: tags.comment, class: "tok-comment" },
      { tag: tags.meta, class: "tok-meta" },
      { tag: tags.invalid, class: "tok-invalid" },
      { tag: tags.punctuation, class: "tok-punctuation" }
    ]);
    var _a;
    const languageDataProp = /* @__PURE__ */ new NodeProp$1();
    const sublanguageProp = /* @__PURE__ */ new NodeProp$1();
    class Language {
      /**
      Construct a language object. If you need to invoke this
      directly, first define a data facet with
      [`defineLanguageFacet`](https://codemirror.net/6/docs/ref/#language.defineLanguageFacet), and then
      configure your parser to [attach](https://codemirror.net/6/docs/ref/#language.languageDataProp) it
      to the language's outer syntax node.
      */
      constructor(data, parser2, extraExtensions = [], name2 = "") {
        this.data = data;
        this.name = name2;
        if (!EditorState.prototype.hasOwnProperty("tree"))
          Object.defineProperty(EditorState.prototype, "tree", { get() {
            return syntaxTree(this);
          } });
        this.parser = parser2;
        this.extension = [
          language$1.of(this),
          EditorState.languageData.of((state, pos2, side) => {
            let top2 = topNodeAt(state, pos2, side), data2 = top2.type.prop(languageDataProp);
            if (!data2)
              return [];
            let base2 = state.facet(data2), sub2 = top2.type.prop(sublanguageProp);
            if (sub2) {
              let innerNode = top2.resolve(pos2 - top2.from, side);
              for (let sublang of sub2)
                if (sublang.test(innerNode, state)) {
                  let data3 = state.facet(sublang.facet);
                  return sublang.type == "replace" ? data3 : data3.concat(base2);
                }
            }
            return base2;
          })
        ].concat(extraExtensions);
      }
      /**
      Query whether this language is active at the given position.
      */
      isActiveAt(state, pos2, side = -1) {
        return topNodeAt(state, pos2, side).type.prop(languageDataProp) == this.data;
      }
      /**
      Find the document regions that were parsed using this language.
      The returned regions will _include_ any nested languages rooted
      in this language, when those exist.
      */
      findRegions(state) {
        let lang2 = state.facet(language$1);
        if ((lang2 === null || lang2 === void 0 ? void 0 : lang2.data) == this.data)
          return [{ from: 0, to: state.doc.length }];
        if (!lang2 || !lang2.allowsNesting)
          return [];
        let result2 = [];
        let explore = (tree, from) => {
          if (tree.prop(languageDataProp) == this.data) {
            result2.push({ from, to: from + tree.length });
            return;
          }
          let mount2 = tree.prop(NodeProp$1.mounted);
          if (mount2) {
            if (mount2.tree.prop(languageDataProp) == this.data) {
              if (mount2.overlay)
                for (let r2 of mount2.overlay)
                  result2.push({ from: r2.from + from, to: r2.to + from });
              else
                result2.push({ from, to: from + tree.length });
              return;
            } else if (mount2.overlay) {
              let size = result2.length;
              explore(mount2.tree, mount2.overlay[0].from + from);
              if (result2.length > size)
                return;
            }
          }
          for (let i2 = 0; i2 < tree.children.length; i2++) {
            let ch3 = tree.children[i2];
            if (ch3 instanceof Tree)
              explore(ch3, tree.positions[i2] + from);
          }
        };
        explore(syntaxTree(state), 0);
        return result2;
      }
      /**
      Indicates whether this language allows nested languages. The
      default implementation returns true.
      */
      get allowsNesting() {
        return true;
      }
    }
    Language.setState = /* @__PURE__ */ StateEffect.define();
    function topNodeAt(state, pos2, side) {
      let topLang = state.facet(language$1), tree = syntaxTree(state).topNode;
      if (!topLang || topLang.allowsNesting) {
        for (let node2 = tree; node2; node2 = node2.enter(pos2, side, IterMode$1.ExcludeBuffers))
          if (node2.type.isTop)
            tree = node2;
      }
      return tree;
    }
    function syntaxTree(state) {
      let field = state.field(Language.state, false);
      return field ? field.tree : Tree.empty;
    }
    class DocInput {
      /**
      Create an input object for the given document.
      */
      constructor(doc2) {
        this.doc = doc2;
        this.cursorPos = 0;
        this.string = "";
        this.cursor = doc2.iter();
      }
      get length() {
        return this.doc.length;
      }
      syncTo(pos2) {
        this.string = this.cursor.next(pos2 - this.cursorPos).value;
        this.cursorPos = pos2 + this.string.length;
        return this.cursorPos - this.string.length;
      }
      chunk(pos2) {
        this.syncTo(pos2);
        return this.string;
      }
      get lineChunks() {
        return true;
      }
      read(from, to2) {
        let stringStart = this.cursorPos - this.string.length;
        if (from < stringStart || to2 >= this.cursorPos)
          return this.doc.sliceString(from, to2);
        else
          return this.string.slice(from - stringStart, to2 - stringStart);
      }
    }
    let currentContext = null;
    class ParseContext {
      constructor(parser2, state, fragments = [], tree, treeLen, viewport2, skipped, scheduleOn) {
        this.parser = parser2;
        this.state = state;
        this.fragments = fragments;
        this.tree = tree;
        this.treeLen = treeLen;
        this.viewport = viewport2;
        this.skipped = skipped;
        this.scheduleOn = scheduleOn;
        this.parse = null;
        this.tempSkipped = [];
      }
      /**
      @internal
      */
      static create(parser2, state, viewport2) {
        return new ParseContext(parser2, state, [], Tree.empty, 0, viewport2, [], null);
      }
      startParse() {
        return this.parser.startParse(new DocInput(this.state.doc), this.fragments);
      }
      /**
      @internal
      */
      work(until, upto) {
        if (upto != null && upto >= this.state.doc.length)
          upto = void 0;
        if (this.tree != Tree.empty && this.isDone(upto !== null && upto !== void 0 ? upto : this.state.doc.length)) {
          this.takeTree();
          return true;
        }
        return this.withContext(() => {
          var _a2;
          if (typeof until == "number") {
            let endTime = Date.now() + until;
            until = () => Date.now() > endTime;
          }
          if (!this.parse)
            this.parse = this.startParse();
          if (upto != null && (this.parse.stoppedAt == null || this.parse.stoppedAt > upto) && upto < this.state.doc.length)
            this.parse.stopAt(upto);
          for (; ; ) {
            let done = this.parse.advance();
            if (done) {
              this.fragments = this.withoutTempSkipped(TreeFragment.addTree(done, this.fragments, this.parse.stoppedAt != null));
              this.treeLen = (_a2 = this.parse.stoppedAt) !== null && _a2 !== void 0 ? _a2 : this.state.doc.length;
              this.tree = done;
              this.parse = null;
              if (this.treeLen < (upto !== null && upto !== void 0 ? upto : this.state.doc.length))
                this.parse = this.startParse();
              else
                return true;
            }
            if (until())
              return false;
          }
        });
      }
      /**
      @internal
      */
      takeTree() {
        let pos2, tree;
        if (this.parse && (pos2 = this.parse.parsedPos) >= this.treeLen) {
          if (this.parse.stoppedAt == null || this.parse.stoppedAt > pos2)
            this.parse.stopAt(pos2);
          this.withContext(() => {
            while (!(tree = this.parse.advance())) {
            }
          });
          this.treeLen = pos2;
          this.tree = tree;
          this.fragments = this.withoutTempSkipped(TreeFragment.addTree(this.tree, this.fragments, true));
          this.parse = null;
        }
      }
      withContext(f) {
        let prev = currentContext;
        currentContext = this;
        try {
          return f();
        } finally {
          currentContext = prev;
        }
      }
      withoutTempSkipped(fragments) {
        for (let r2; r2 = this.tempSkipped.pop(); )
          fragments = cutFragments(fragments, r2.from, r2.to);
        return fragments;
      }
      /**
      @internal
      */
      changes(changes, newState) {
        let { fragments, tree, treeLen, viewport: viewport2, skipped } = this;
        this.takeTree();
        if (!changes.empty) {
          let ranges = [];
          changes.iterChangedRanges((fromA, toA, fromB, toB) => ranges.push({ fromA, toA, fromB, toB }));
          fragments = TreeFragment.applyChanges(fragments, ranges);
          tree = Tree.empty;
          treeLen = 0;
          viewport2 = { from: changes.mapPos(viewport2.from, -1), to: changes.mapPos(viewport2.to, 1) };
          if (this.skipped.length) {
            skipped = [];
            for (let r2 of this.skipped) {
              let from = changes.mapPos(r2.from, 1), to2 = changes.mapPos(r2.to, -1);
              if (from < to2)
                skipped.push({ from, to: to2 });
            }
          }
        }
        return new ParseContext(this.parser, newState, fragments, tree, treeLen, viewport2, skipped, this.scheduleOn);
      }
      /**
      @internal
      */
      updateViewport(viewport2) {
        if (this.viewport.from == viewport2.from && this.viewport.to == viewport2.to)
          return false;
        this.viewport = viewport2;
        let startLen = this.skipped.length;
        for (let i2 = 0; i2 < this.skipped.length; i2++) {
          let { from, to: to2 } = this.skipped[i2];
          if (from < viewport2.to && to2 > viewport2.from) {
            this.fragments = cutFragments(this.fragments, from, to2);
            this.skipped.splice(i2--, 1);
          }
        }
        if (this.skipped.length >= startLen)
          return false;
        this.reset();
        return true;
      }
      /**
      @internal
      */
      reset() {
        if (this.parse) {
          this.takeTree();
          this.parse = null;
        }
      }
      /**
      Notify the parse scheduler that the given region was skipped
      because it wasn't in view, and the parse should be restarted
      when it comes into view.
      */
      skipUntilInView(from, to2) {
        this.skipped.push({ from, to: to2 });
      }
      /**
      Returns a parser intended to be used as placeholder when
      asynchronously loading a nested parser. It'll skip its input and
      mark it as not-really-parsed, so that the next update will parse
      it again.
      
      When `until` is given, a reparse will be scheduled when that
      promise resolves.
      */
      static getSkippingParser(until) {
        return new class extends Parser {
          createParse(input2, fragments, ranges) {
            let from = ranges[0].from, to2 = ranges[ranges.length - 1].to;
            let parser2 = {
              parsedPos: from,
              advance() {
                let cx = currentContext;
                if (cx) {
                  for (let r2 of ranges)
                    cx.tempSkipped.push(r2);
                  if (until)
                    cx.scheduleOn = cx.scheduleOn ? Promise.all([cx.scheduleOn, until]) : until;
                }
                this.parsedPos = to2;
                return new Tree(NodeType$1.none, [], [], to2 - from);
              },
              stoppedAt: null,
              stopAt() {
              }
            };
            return parser2;
          }
        }();
      }
      /**
      @internal
      */
      isDone(upto) {
        upto = Math.min(upto, this.state.doc.length);
        let frags = this.fragments;
        return this.treeLen >= upto && frags.length && frags[0].from == 0 && frags[0].to >= upto;
      }
      /**
      Get the context for the current parse, or `null` if no editor
      parse is in progress.
      */
      static get() {
        return currentContext;
      }
    }
    function cutFragments(fragments, from, to2) {
      return TreeFragment.applyChanges(fragments, [{ fromA: from, toA: to2, fromB: from, toB: to2 }]);
    }
    class LanguageState {
      constructor(context) {
        this.context = context;
        this.tree = context.tree;
      }
      apply(tr2) {
        if (!tr2.docChanged && this.tree == this.context.tree)
          return this;
        let newCx = this.context.changes(tr2.changes, tr2.state);
        let upto = this.context.treeLen == tr2.startState.doc.length ? void 0 : Math.max(tr2.changes.mapPos(this.context.treeLen), newCx.viewport.to);
        if (!newCx.work(20, upto))
          newCx.takeTree();
        return new LanguageState(newCx);
      }
      static init(state) {
        let vpTo = Math.min(3e3, state.doc.length);
        let parseState2 = ParseContext.create(state.facet(language$1).parser, state, { from: 0, to: vpTo });
        if (!parseState2.work(20, vpTo))
          parseState2.takeTree();
        return new LanguageState(parseState2);
      }
    }
    Language.state = /* @__PURE__ */ StateField.define({
      create: LanguageState.init,
      update(value2, tr2) {
        for (let e of tr2.effects)
          if (e.is(Language.setState))
            return e.value;
        if (tr2.startState.facet(language$1) != tr2.state.facet(language$1))
          return LanguageState.init(tr2.state);
        return value2.apply(tr2);
      }
    });
    let requestIdle = (callback) => {
      let timeout = setTimeout(
        () => callback(),
        500
        /* Work.MaxPause */
      );
      return () => clearTimeout(timeout);
    };
    if (typeof requestIdleCallback != "undefined")
      requestIdle = (callback) => {
        let idle = -1, timeout = setTimeout(
          () => {
            idle = requestIdleCallback(callback, {
              timeout: 500 - 100
              /* Work.MinPause */
            });
          },
          100
          /* Work.MinPause */
        );
        return () => idle < 0 ? clearTimeout(timeout) : cancelIdleCallback(idle);
      };
    const isInputPending = typeof navigator != "undefined" && ((_a = navigator.scheduling) === null || _a === void 0 ? void 0 : _a.isInputPending) ? () => navigator.scheduling.isInputPending() : null;
    const parseWorker = /* @__PURE__ */ ViewPlugin.fromClass(class ParseWorker {
      constructor(view) {
        this.view = view;
        this.working = null;
        this.workScheduled = 0;
        this.chunkEnd = -1;
        this.chunkBudget = -1;
        this.work = this.work.bind(this);
        this.scheduleWork();
      }
      update(update) {
        let cx = this.view.state.field(Language.state).context;
        if (cx.updateViewport(update.view.viewport) || this.view.viewport.to > cx.treeLen)
          this.scheduleWork();
        if (update.docChanged || update.selectionSet) {
          if (this.view.hasFocus)
            this.chunkBudget += 50;
          this.scheduleWork();
        }
        this.checkAsyncSchedule(cx);
      }
      scheduleWork() {
        if (this.working)
          return;
        let { state } = this.view, field = state.field(Language.state);
        if (field.tree != field.context.tree || !field.context.isDone(state.doc.length))
          this.working = requestIdle(this.work);
      }
      work(deadline) {
        this.working = null;
        let now = Date.now();
        if (this.chunkEnd < now && (this.chunkEnd < 0 || this.view.hasFocus)) {
          this.chunkEnd = now + 3e4;
          this.chunkBudget = 3e3;
        }
        if (this.chunkBudget <= 0)
          return;
        let { state, viewport: { to: vpTo } } = this.view, field = state.field(Language.state);
        if (field.tree == field.context.tree && field.context.isDone(
          vpTo + 1e5
          /* Work.MaxParseAhead */
        ))
          return;
        let endTime = Date.now() + Math.min(this.chunkBudget, 100, deadline && !isInputPending ? Math.max(25, deadline.timeRemaining() - 5) : 1e9);
        let viewportFirst = field.context.treeLen < vpTo && state.doc.length > vpTo + 1e3;
        let done = field.context.work(() => {
          return isInputPending && isInputPending() || Date.now() > endTime;
        }, vpTo + (viewportFirst ? 0 : 1e5));
        this.chunkBudget -= Date.now() - now;
        if (done || this.chunkBudget <= 0) {
          field.context.takeTree();
          this.view.dispatch({ effects: Language.setState.of(new LanguageState(field.context)) });
        }
        if (this.chunkBudget > 0 && !(done && !viewportFirst))
          this.scheduleWork();
        this.checkAsyncSchedule(field.context);
      }
      checkAsyncSchedule(cx) {
        if (cx.scheduleOn) {
          this.workScheduled++;
          cx.scheduleOn.then(() => this.scheduleWork()).catch((err2) => logException(this.view.state, err2)).then(() => this.workScheduled--);
          cx.scheduleOn = null;
        }
      }
      destroy() {
        if (this.working)
          this.working();
      }
      isWorking() {
        return !!(this.working || this.workScheduled > 0);
      }
    }, {
      eventHandlers: { focus() {
        this.scheduleWork();
      } }
    });
    const language$1 = /* @__PURE__ */ Facet.define({
      combine(languages) {
        return languages.length ? languages[0] : null;
      },
      enables: (language2) => [
        Language.state,
        parseWorker,
        EditorView.contentAttributes.compute([language2], (state) => {
          let lang2 = state.facet(language2);
          return lang2 && lang2.name ? { "data-language": lang2.name } : {};
        })
      ]
    });
    const indentService = /* @__PURE__ */ Facet.define();
    const indentUnit = /* @__PURE__ */ Facet.define({
      combine: (values) => {
        if (!values.length)
          return "  ";
        let unit = values[0];
        if (!unit || /\S/.test(unit) || Array.from(unit).some((e) => e != unit[0]))
          throw new Error("Invalid indent unit: " + JSON.stringify(values[0]));
        return unit;
      }
    });
    function getIndentUnit(state) {
      let unit = state.facet(indentUnit);
      return unit.charCodeAt(0) == 9 ? state.tabSize * unit.length : unit.length;
    }
    function indentString(state, cols) {
      let result2 = "", ts = state.tabSize, ch3 = state.facet(indentUnit)[0];
      if (ch3 == "	") {
        while (cols >= ts) {
          result2 += "	";
          cols -= ts;
        }
        ch3 = " ";
      }
      for (let i2 = 0; i2 < cols; i2++)
        result2 += ch3;
      return result2;
    }
    function getIndentation(context, pos2) {
      if (context instanceof EditorState)
        context = new IndentContext(context);
      for (let service of context.state.facet(indentService)) {
        let result2 = service(context, pos2);
        if (result2 !== void 0)
          return result2;
      }
      let tree = syntaxTree(context.state);
      return tree.length >= pos2 ? syntaxIndentation(context, tree, pos2) : null;
    }
    class IndentContext {
      /**
      Create an indent context.
      */
      constructor(state, options2 = {}) {
        this.state = state;
        this.options = options2;
        this.unit = getIndentUnit(state);
      }
      /**
      Get a description of the line at the given position, taking
      [simulated line
      breaks](https://codemirror.net/6/docs/ref/#language.IndentContext.constructor^options.simulateBreak)
      into account. If there is such a break at `pos`, the `bias`
      argument determines whether the part of the line line before or
      after the break is used.
      */
      lineAt(pos2, bias = 1) {
        let line2 = this.state.doc.lineAt(pos2);
        let { simulateBreak, simulateDoubleBreak } = this.options;
        if (simulateBreak != null && simulateBreak >= line2.from && simulateBreak <= line2.to) {
          if (simulateDoubleBreak && simulateBreak == pos2)
            return { text: "", from: pos2 };
          else if (bias < 0 ? simulateBreak < pos2 : simulateBreak <= pos2)
            return { text: line2.text.slice(simulateBreak - line2.from), from: simulateBreak };
          else
            return { text: line2.text.slice(0, simulateBreak - line2.from), from: line2.from };
        }
        return line2;
      }
      /**
      Get the text directly after `pos`, either the entire line
      or the next 100 characters, whichever is shorter.
      */
      textAfterPos(pos2, bias = 1) {
        if (this.options.simulateDoubleBreak && pos2 == this.options.simulateBreak)
          return "";
        let { text: text2, from } = this.lineAt(pos2, bias);
        return text2.slice(pos2 - from, Math.min(text2.length, pos2 + 100 - from));
      }
      /**
      Find the column for the given position.
      */
      column(pos2, bias = 1) {
        let { text: text2, from } = this.lineAt(pos2, bias);
        let result2 = this.countColumn(text2, pos2 - from);
        let override = this.options.overrideIndentation ? this.options.overrideIndentation(from) : -1;
        if (override > -1)
          result2 += override - this.countColumn(text2, text2.search(/\S|$/));
        return result2;
      }
      /**
      Find the column position (taking tabs into account) of the given
      position in the given string.
      */
      countColumn(line2, pos2 = line2.length) {
        return countColumn(line2, this.state.tabSize, pos2);
      }
      /**
      Find the indentation column of the line at the given point.
      */
      lineIndent(pos2, bias = 1) {
        let { text: text2, from } = this.lineAt(pos2, bias);
        let override = this.options.overrideIndentation;
        if (override) {
          let overriden = override(from);
          if (overriden > -1)
            return overriden;
        }
        return this.countColumn(text2, text2.search(/\S|$/));
      }
      /**
      Returns the [simulated line
      break](https://codemirror.net/6/docs/ref/#language.IndentContext.constructor^options.simulateBreak)
      for this context, if any.
      */
      get simulatedBreak() {
        return this.options.simulateBreak || null;
      }
    }
    const indentNodeProp = /* @__PURE__ */ new NodeProp$1();
    function syntaxIndentation(cx, ast2, pos2) {
      let stack2 = ast2.resolveStack(pos2);
      let inner2 = ast2.resolveInner(pos2, -1).resolve(pos2, 0).enterUnfinishedNodesBefore(pos2);
      if (inner2 != stack2.node) {
        let add2 = [];
        for (let cur2 = inner2; cur2 && !(cur2.from == stack2.node.from && cur2.type == stack2.node.type); cur2 = cur2.parent)
          add2.push(cur2);
        for (let i2 = add2.length - 1; i2 >= 0; i2--)
          stack2 = { node: add2[i2], next: stack2 };
      }
      return indentFor(stack2, cx, pos2);
    }
    function indentFor(stack2, cx, pos2) {
      for (let cur2 = stack2; cur2; cur2 = cur2.next) {
        let strategy = indentStrategy(cur2.node);
        if (strategy)
          return strategy(TreeIndentContext.create(cx, pos2, cur2));
      }
      return 0;
    }
    function ignoreClosed(cx) {
      return cx.pos == cx.options.simulateBreak && cx.options.simulateDoubleBreak;
    }
    function indentStrategy(tree) {
      let strategy = tree.type.prop(indentNodeProp);
      if (strategy)
        return strategy;
      let first = tree.firstChild, close2;
      if (first && (close2 = first.type.prop(NodeProp$1.closedBy))) {
        let last = tree.lastChild, closed = last && close2.indexOf(last.name) > -1;
        return (cx) => delimitedStrategy(cx, true, 1, void 0, closed && !ignoreClosed(cx) ? last.from : void 0);
      }
      return tree.parent == null ? topIndent : null;
    }
    function topIndent() {
      return 0;
    }
    class TreeIndentContext extends IndentContext {
      constructor(base2, pos2, context) {
        super(base2.state, base2.options);
        this.base = base2;
        this.pos = pos2;
        this.context = context;
      }
      /**
      The syntax tree node to which the indentation strategy
      applies.
      */
      get node() {
        return this.context.node;
      }
      /**
      @internal
      */
      static create(base2, pos2, context) {
        return new TreeIndentContext(base2, pos2, context);
      }
      /**
      Get the text directly after `this.pos`, either the entire line
      or the next 100 characters, whichever is shorter.
      */
      get textAfter() {
        return this.textAfterPos(this.pos);
      }
      /**
      Get the indentation at the reference line for `this.node`, which
      is the line on which it starts, unless there is a node that is
      _not_ a parent of this node covering the start of that line. If
      so, the line at the start of that node is tried, again skipping
      on if it is covered by another such node.
      */
      get baseIndent() {
        return this.baseIndentFor(this.node);
      }
      /**
      Get the indentation for the reference line of the given node
      (see [`baseIndent`](https://codemirror.net/6/docs/ref/#language.TreeIndentContext.baseIndent)).
      */
      baseIndentFor(node2) {
        let line2 = this.state.doc.lineAt(node2.from);
        for (; ; ) {
          let atBreak = node2.resolve(line2.from);
          while (atBreak.parent && atBreak.parent.from == atBreak.from)
            atBreak = atBreak.parent;
          if (isParent(atBreak, node2))
            break;
          line2 = this.state.doc.lineAt(atBreak.from);
        }
        return this.lineIndent(line2.from);
      }
      /**
      Continue looking for indentations in the node's parent nodes,
      and return the result of that.
      */
      continue() {
        return indentFor(this.context.next, this.base, this.pos);
      }
    }
    function isParent(parent, of) {
      for (let cur2 = of; cur2; cur2 = cur2.parent)
        if (parent == cur2)
          return true;
      return false;
    }
    function bracketedAligned(context) {
      let tree = context.node;
      let openToken = tree.childAfter(tree.from), last = tree.lastChild;
      if (!openToken)
        return null;
      let sim2 = context.options.simulateBreak;
      let openLine = context.state.doc.lineAt(openToken.from);
      let lineEnd = sim2 == null || sim2 <= openLine.from ? openLine.to : Math.min(openLine.to, sim2);
      for (let pos2 = openToken.to; ; ) {
        let next = tree.childAfter(pos2);
        if (!next || next == last)
          return null;
        if (!next.type.isSkipped) {
          if (next.from >= lineEnd)
            return null;
          let space = /^ */.exec(openLine.text.slice(openToken.to - openLine.from))[0].length;
          return { from: openToken.from, to: openToken.to + space };
        }
        pos2 = next.to;
      }
    }
    function delimitedStrategy(context, align, units, closing, closedAt) {
      let after = context.textAfter, space = after.match(/^\s*/)[0].length;
      let closed = closing && after.slice(space, space + closing.length) == closing || closedAt == context.pos + space;
      let aligned = bracketedAligned(context);
      if (aligned)
        return closed ? context.column(aligned.from) : context.column(aligned.to);
      return context.baseIndent + (closed ? 0 : context.unit * units);
    }
    const DefaultScanDist = 1e4, DefaultBrackets = "()[]{}";
    const bracketMatchingHandle = /* @__PURE__ */ new NodeProp$1();
    function matchingNodes(node2, dir, brackets) {
      let byProp = node2.prop(dir < 0 ? NodeProp$1.openedBy : NodeProp$1.closedBy);
      if (byProp)
        return byProp;
      if (node2.name.length == 1) {
        let index = brackets.indexOf(node2.name);
        if (index > -1 && index % 2 == (dir < 0 ? 1 : 0))
          return [brackets[index + dir]];
      }
      return null;
    }
    function findHandle(node2) {
      let hasHandle = node2.type.prop(bracketMatchingHandle);
      return hasHandle ? hasHandle(node2.node) : node2;
    }
    function matchBrackets(state, pos2, dir, config2 = {}) {
      let maxScanDistance = config2.maxScanDistance || DefaultScanDist, brackets = config2.brackets || DefaultBrackets;
      let tree = syntaxTree(state), node2 = tree.resolveInner(pos2, dir);
      for (let cur2 = node2; cur2; cur2 = cur2.parent) {
        let matches = matchingNodes(cur2.type, dir, brackets);
        if (matches && cur2.from < cur2.to) {
          let handle = findHandle(cur2);
          if (handle && (dir > 0 ? pos2 >= handle.from && pos2 < handle.to : pos2 > handle.from && pos2 <= handle.to))
            return matchMarkedBrackets(state, pos2, dir, cur2, handle, matches, brackets);
        }
      }
      return matchPlainBrackets(state, pos2, dir, tree, node2.type, maxScanDistance, brackets);
    }
    function matchMarkedBrackets(_state, _pos, dir, token2, handle, matching, brackets) {
      let parent = token2.parent, firstToken = { from: handle.from, to: handle.to };
      let depth = 0, cursor = parent === null || parent === void 0 ? void 0 : parent.cursor();
      if (cursor && (dir < 0 ? cursor.childBefore(token2.from) : cursor.childAfter(token2.to)))
        do {
          if (dir < 0 ? cursor.to <= token2.from : cursor.from >= token2.to) {
            if (depth == 0 && matching.indexOf(cursor.type.name) > -1 && cursor.from < cursor.to) {
              let endHandle = findHandle(cursor);
              return { start: firstToken, end: endHandle ? { from: endHandle.from, to: endHandle.to } : void 0, matched: true };
            } else if (matchingNodes(cursor.type, dir, brackets)) {
              depth++;
            } else if (matchingNodes(cursor.type, -dir, brackets)) {
              if (depth == 0) {
                let endHandle = findHandle(cursor);
                return {
                  start: firstToken,
                  end: endHandle && endHandle.from < endHandle.to ? { from: endHandle.from, to: endHandle.to } : void 0,
                  matched: false
                };
              }
              depth--;
            }
          }
        } while (dir < 0 ? cursor.prevSibling() : cursor.nextSibling());
      return { start: firstToken, matched: false };
    }
    function matchPlainBrackets(state, pos2, dir, tree, tokenType, maxScanDistance, brackets) {
      let startCh = dir < 0 ? state.sliceDoc(pos2 - 1, pos2) : state.sliceDoc(pos2, pos2 + 1);
      let bracket2 = brackets.indexOf(startCh);
      if (bracket2 < 0 || bracket2 % 2 == 0 != dir > 0)
        return null;
      let startToken = { from: dir < 0 ? pos2 - 1 : pos2, to: dir > 0 ? pos2 + 1 : pos2 };
      let iter = state.doc.iterRange(pos2, dir > 0 ? state.doc.length : 0), depth = 0;
      for (let distance = 0; !iter.next().done && distance <= maxScanDistance; ) {
        let text2 = iter.value;
        if (dir < 0)
          distance += text2.length;
        let basePos = pos2 + distance * dir;
        for (let pos3 = dir > 0 ? 0 : text2.length - 1, end2 = dir > 0 ? text2.length : -1; pos3 != end2; pos3 += dir) {
          let found = brackets.indexOf(text2[pos3]);
          if (found < 0 || tree.resolveInner(basePos + pos3, 1).type != tokenType)
            continue;
          if (found % 2 == 0 == dir > 0) {
            depth++;
          } else if (depth == 1) {
            return { start: startToken, end: { from: basePos + pos3, to: basePos + pos3 + 1 }, matched: found >> 1 == bracket2 >> 1 };
          } else {
            depth--;
          }
        }
        if (dir > 0)
          distance += text2.length;
      }
      return iter.done ? { start: startToken, matched: false } : null;
    }
    const noTokens = /* @__PURE__ */ Object.create(null);
    const typeArray = [NodeType$1.none];
    const warned = [];
    const byTag = /* @__PURE__ */ Object.create(null);
    const defaultTable = /* @__PURE__ */ Object.create(null);
    for (let [legacyName, name2] of [
      ["variable", "variableName"],
      ["variable-2", "variableName.special"],
      ["string-2", "string.special"],
      ["def", "variableName.definition"],
      ["tag", "tagName"],
      ["attribute", "attributeName"],
      ["type", "typeName"],
      ["builtin", "variableName.standard"],
      ["qualifier", "modifier"],
      ["error", "invalid"],
      ["header", "heading"],
      ["property", "propertyName"]
    ])
      defaultTable[legacyName] = /* @__PURE__ */ createTokenType(noTokens, name2);
    function warnForPart(part2, msg) {
      if (warned.indexOf(part2) > -1)
        return;
      warned.push(part2);
      console.warn(msg);
    }
    function createTokenType(extra, tagStr) {
      let tags$12 = [];
      for (let name3 of tagStr.split(" ")) {
        let found = [];
        for (let part2 of name3.split(".")) {
          let value2 = extra[part2] || tags[part2];
          if (!value2) {
            warnForPart(part2, `Unknown highlighting tag ${part2}`);
          } else if (typeof value2 == "function") {
            if (!found.length)
              warnForPart(part2, `Modifier ${part2} used at start of tag`);
            else
              found = found.map(value2);
          } else {
            if (found.length)
              warnForPart(part2, `Tag ${part2} used as modifier`);
            else
              found = Array.isArray(value2) ? value2 : [value2];
          }
        }
        for (let tag of found)
          tags$12.push(tag);
      }
      if (!tags$12.length)
        return 0;
      let name2 = tagStr.replace(/ /g, "_"), key2 = name2 + " " + tags$12.map((t2) => t2.id);
      let known = byTag[key2];
      if (known)
        return known.id;
      let type = byTag[key2] = NodeType$1.define({
        id: typeArray.length,
        name: name2,
        props: [styleTags({ [name2]: tags$12 })]
      });
      typeArray.push(type);
      return type.id;
    }
    ({
      rtl: /* @__PURE__ */ Decoration.mark({ class: "cm-iso", inclusive: true, attributes: { dir: "rtl" }, bidiIsolate: Direction.RTL }),
      ltr: /* @__PURE__ */ Decoration.mark({ class: "cm-iso", inclusive: true, attributes: { dir: "ltr" }, bidiIsolate: Direction.LTR })
    });
    const toggleComment = (target2) => {
      let { state } = target2, line2 = state.doc.lineAt(state.selection.main.from), config2 = getConfig(target2.state, line2.from);
      return config2.line ? toggleLineComment(target2) : config2.block ? toggleBlockCommentByLine(target2) : false;
    };
    function command(f, option) {
      return ({ state, dispatch }) => {
        if (state.readOnly)
          return false;
        let tr2 = f(option, state);
        if (!tr2)
          return false;
        dispatch(state.update(tr2));
        return true;
      };
    }
    const toggleLineComment = /* @__PURE__ */ command(
      changeLineComment,
      0
      /* CommentOption.Toggle */
    );
    const toggleBlockComment = /* @__PURE__ */ command(
      changeBlockComment,
      0
      /* CommentOption.Toggle */
    );
    const toggleBlockCommentByLine = /* @__PURE__ */ command(
      (o, s) => changeBlockComment(o, s, selectedLineRanges(s)),
      0
      /* CommentOption.Toggle */
    );
    function getConfig(state, pos2) {
      let data = state.languageDataAt("commentTokens", pos2, 1);
      return data.length ? data[0] : {};
    }
    const SearchMargin = 50;
    function findBlockComment(state, { open, close: close2 }, from, to2) {
      let textBefore = state.sliceDoc(from - SearchMargin, from);
      let textAfter = state.sliceDoc(to2, to2 + SearchMargin);
      let spaceBefore = /\s*$/.exec(textBefore)[0].length, spaceAfter = /^\s*/.exec(textAfter)[0].length;
      let beforeOff = textBefore.length - spaceBefore;
      if (textBefore.slice(beforeOff - open.length, beforeOff) == open && textAfter.slice(spaceAfter, spaceAfter + close2.length) == close2) {
        return {
          open: { pos: from - spaceBefore, margin: spaceBefore && 1 },
          close: { pos: to2 + spaceAfter, margin: spaceAfter && 1 }
        };
      }
      let startText, endText;
      if (to2 - from <= 2 * SearchMargin) {
        startText = endText = state.sliceDoc(from, to2);
      } else {
        startText = state.sliceDoc(from, from + SearchMargin);
        endText = state.sliceDoc(to2 - SearchMargin, to2);
      }
      let startSpace = /^\s*/.exec(startText)[0].length, endSpace = /\s*$/.exec(endText)[0].length;
      let endOff = endText.length - endSpace - close2.length;
      if (startText.slice(startSpace, startSpace + open.length) == open && endText.slice(endOff, endOff + close2.length) == close2) {
        return {
          open: {
            pos: from + startSpace + open.length,
            margin: /\s/.test(startText.charAt(startSpace + open.length)) ? 1 : 0
          },
          close: {
            pos: to2 - endSpace - close2.length,
            margin: /\s/.test(endText.charAt(endOff - 1)) ? 1 : 0
          }
        };
      }
      return null;
    }
    function selectedLineRanges(state) {
      let ranges = [];
      for (let r2 of state.selection.ranges) {
        let fromLine = state.doc.lineAt(r2.from);
        let toLine = r2.to <= fromLine.to ? fromLine : state.doc.lineAt(r2.to);
        if (toLine.from > fromLine.from && toLine.from == r2.to)
          toLine = r2.to == fromLine.to + 1 ? fromLine : state.doc.lineAt(r2.to - 1);
        let last = ranges.length - 1;
        if (last >= 0 && ranges[last].to > fromLine.from)
          ranges[last].to = toLine.to;
        else
          ranges.push({ from: fromLine.from + /^\s*/.exec(fromLine.text)[0].length, to: toLine.to });
      }
      return ranges;
    }
    function changeBlockComment(option, state, ranges = state.selection.ranges) {
      let tokens = ranges.map((r2) => getConfig(state, r2.from).block);
      if (!tokens.every((c2) => c2))
        return null;
      let comments = ranges.map((r2, i2) => findBlockComment(state, tokens[i2], r2.from, r2.to));
      if (option != 2 && !comments.every((c2) => c2)) {
        return { changes: state.changes(ranges.map((range2, i2) => {
          if (comments[i2])
            return [];
          return [{ from: range2.from, insert: tokens[i2].open + " " }, { from: range2.to, insert: " " + tokens[i2].close }];
        })) };
      } else if (option != 1 && comments.some((c2) => c2)) {
        let changes = [];
        for (let i2 = 0, comment2; i2 < comments.length; i2++)
          if (comment2 = comments[i2]) {
            let token2 = tokens[i2], { open, close: close2 } = comment2;
            changes.push({ from: open.pos - token2.open.length, to: open.pos + open.margin }, { from: close2.pos - close2.margin, to: close2.pos + token2.close.length });
          }
        return { changes };
      }
      return null;
    }
    function changeLineComment(option, state, ranges = state.selection.ranges) {
      let lines = [];
      let prevLine = -1;
      for (let { from, to: to2 } of ranges) {
        let startI = lines.length, minIndent = 1e9;
        let token2 = getConfig(state, from).line;
        if (!token2)
          continue;
        for (let pos2 = from; pos2 <= to2; ) {
          let line2 = state.doc.lineAt(pos2);
          if (line2.from > prevLine && (from == to2 || to2 > line2.from)) {
            prevLine = line2.from;
            let indent = /^\s*/.exec(line2.text)[0].length;
            let empty2 = indent == line2.length;
            let comment2 = line2.text.slice(indent, indent + token2.length) == token2 ? indent : -1;
            if (indent < line2.text.length && indent < minIndent)
              minIndent = indent;
            lines.push({ line: line2, comment: comment2, token: token2, indent, empty: empty2, single: false });
          }
          pos2 = line2.to + 1;
        }
        if (minIndent < 1e9) {
          for (let i2 = startI; i2 < lines.length; i2++)
            if (lines[i2].indent < lines[i2].line.text.length)
              lines[i2].indent = minIndent;
        }
        if (lines.length == startI + 1)
          lines[startI].single = true;
      }
      if (option != 2 && lines.some((l) => l.comment < 0 && (!l.empty || l.single))) {
        let changes = [];
        for (let { line: line2, token: token2, indent, empty: empty2, single } of lines)
          if (single || !empty2)
            changes.push({ from: line2.from + indent, insert: token2 + " " });
        let changeSet = state.changes(changes);
        return { changes: changeSet, selection: state.selection.map(changeSet, 1) };
      } else if (option != 1 && lines.some((l) => l.comment >= 0)) {
        let changes = [];
        for (let { line: line2, comment: comment2, token: token2 } of lines)
          if (comment2 >= 0) {
            let from = line2.from + comment2, to2 = from + token2.length;
            if (line2.text[to2 - line2.from] == " ")
              to2++;
            changes.push({ from, to: to2 });
          }
        return { changes };
      }
      return null;
    }
    const fromHistory = /* @__PURE__ */ Annotation.define();
    const isolateHistory = /* @__PURE__ */ Annotation.define();
    const invertedEffects = /* @__PURE__ */ Facet.define();
    const historyConfig = /* @__PURE__ */ Facet.define({
      combine(configs) {
        return combineConfig(configs, {
          minDepth: 100,
          newGroupDelay: 500,
          joinToEvent: (_t2, isAdjacent2) => isAdjacent2
        }, {
          minDepth: Math.max,
          newGroupDelay: Math.min,
          joinToEvent: (a, b) => (tr2, adj) => a(tr2, adj) || b(tr2, adj)
        });
      }
    });
    const historyField_ = /* @__PURE__ */ StateField.define({
      create() {
        return HistoryState.empty;
      },
      update(state, tr2) {
        let config2 = tr2.state.facet(historyConfig);
        let fromHist = tr2.annotation(fromHistory);
        if (fromHist) {
          let item2 = HistEvent.fromTransaction(tr2, fromHist.selection), from = fromHist.side;
          let other = from == 0 ? state.undone : state.done;
          if (item2)
            other = updateBranch(other, other.length, config2.minDepth, item2);
          else
            other = addSelection(other, tr2.startState.selection);
          return new HistoryState(from == 0 ? fromHist.rest : other, from == 0 ? other : fromHist.rest);
        }
        let isolate = tr2.annotation(isolateHistory);
        if (isolate == "full" || isolate == "before")
          state = state.isolate();
        if (tr2.annotation(Transaction.addToHistory) === false)
          return !tr2.changes.empty ? state.addMapping(tr2.changes.desc) : state;
        let event = HistEvent.fromTransaction(tr2);
        let time = tr2.annotation(Transaction.time), userEvent = tr2.annotation(Transaction.userEvent);
        if (event)
          state = state.addChanges(event, time, userEvent, config2, tr2);
        else if (tr2.selection)
          state = state.addSelection(tr2.startState.selection, time, userEvent, config2.newGroupDelay);
        if (isolate == "full" || isolate == "after")
          state = state.isolate();
        return state;
      },
      toJSON(value2) {
        return { done: value2.done.map((e) => e.toJSON()), undone: value2.undone.map((e) => e.toJSON()) };
      },
      fromJSON(json) {
        return new HistoryState(json.done.map(HistEvent.fromJSON), json.undone.map(HistEvent.fromJSON));
      }
    });
    function history(config2 = {}) {
      return [
        historyField_,
        historyConfig.of(config2),
        EditorView.domEventHandlers({
          beforeinput(e, view) {
            let command2 = e.inputType == "historyUndo" ? undo : e.inputType == "historyRedo" ? redo : null;
            if (!command2)
              return false;
            e.preventDefault();
            return command2(view);
          }
        })
      ];
    }
    function cmd(side, selection) {
      return function({ state, dispatch }) {
        if (!selection && state.readOnly)
          return false;
        let historyState = state.field(historyField_, false);
        if (!historyState)
          return false;
        let tr2 = historyState.pop(side, state, selection);
        if (!tr2)
          return false;
        dispatch(tr2);
        return true;
      };
    }
    const undo = /* @__PURE__ */ cmd(0, false);
    const redo = /* @__PURE__ */ cmd(1, false);
    const undoSelection = /* @__PURE__ */ cmd(0, true);
    const redoSelection = /* @__PURE__ */ cmd(1, true);
    class HistEvent {
      constructor(changes, effects, mapped, startSelection, selectionsAfter) {
        this.changes = changes;
        this.effects = effects;
        this.mapped = mapped;
        this.startSelection = startSelection;
        this.selectionsAfter = selectionsAfter;
      }
      setSelAfter(after) {
        return new HistEvent(this.changes, this.effects, this.mapped, this.startSelection, after);
      }
      toJSON() {
        var _a2, _b2, _c;
        return {
          changes: (_a2 = this.changes) === null || _a2 === void 0 ? void 0 : _a2.toJSON(),
          mapped: (_b2 = this.mapped) === null || _b2 === void 0 ? void 0 : _b2.toJSON(),
          startSelection: (_c = this.startSelection) === null || _c === void 0 ? void 0 : _c.toJSON(),
          selectionsAfter: this.selectionsAfter.map((s) => s.toJSON())
        };
      }
      static fromJSON(json) {
        return new HistEvent(json.changes && ChangeSet.fromJSON(json.changes), [], json.mapped && ChangeDesc.fromJSON(json.mapped), json.startSelection && EditorSelection.fromJSON(json.startSelection), json.selectionsAfter.map(EditorSelection.fromJSON));
      }
      // This does not check `addToHistory` and such, it assumes the
      // transaction needs to be converted to an item. Returns null when
      // there are no changes or effects in the transaction.
      static fromTransaction(tr2, selection) {
        let effects = none;
        for (let invert of tr2.startState.facet(invertedEffects)) {
          let result2 = invert(tr2);
          if (result2.length)
            effects = effects.concat(result2);
        }
        if (!effects.length && tr2.changes.empty)
          return null;
        return new HistEvent(tr2.changes.invert(tr2.startState.doc), effects, void 0, selection || tr2.startState.selection, none);
      }
      static selection(selections) {
        return new HistEvent(void 0, none, void 0, void 0, selections);
      }
    }
    function updateBranch(branch, to2, maxLen, newEvent) {
      let start2 = to2 + 1 > maxLen + 20 ? to2 - maxLen - 1 : 0;
      let newBranch = branch.slice(start2, to2);
      newBranch.push(newEvent);
      return newBranch;
    }
    function isAdjacent(a, b) {
      let ranges = [], isAdjacent2 = false;
      a.iterChangedRanges((f, t2) => ranges.push(f, t2));
      b.iterChangedRanges((_f, _t2, f, t2) => {
        for (let i2 = 0; i2 < ranges.length; ) {
          let from = ranges[i2++], to2 = ranges[i2++];
          if (t2 >= from && f <= to2)
            isAdjacent2 = true;
        }
      });
      return isAdjacent2;
    }
    function eqSelectionShape(a, b) {
      return a.ranges.length == b.ranges.length && a.ranges.filter((r2, i2) => r2.empty != b.ranges[i2].empty).length === 0;
    }
    function conc(a, b) {
      return !a.length ? b : !b.length ? a : a.concat(b);
    }
    const none = [];
    const MaxSelectionsPerEvent = 200;
    function addSelection(branch, selection) {
      if (!branch.length) {
        return [HistEvent.selection([selection])];
      } else {
        let lastEvent = branch[branch.length - 1];
        let sels = lastEvent.selectionsAfter.slice(Math.max(0, lastEvent.selectionsAfter.length - MaxSelectionsPerEvent));
        if (sels.length && sels[sels.length - 1].eq(selection))
          return branch;
        sels.push(selection);
        return updateBranch(branch, branch.length - 1, 1e9, lastEvent.setSelAfter(sels));
      }
    }
    function popSelection(branch) {
      let last = branch[branch.length - 1];
      let newBranch = branch.slice();
      newBranch[branch.length - 1] = last.setSelAfter(last.selectionsAfter.slice(0, last.selectionsAfter.length - 1));
      return newBranch;
    }
    function addMappingToBranch(branch, mapping) {
      if (!branch.length)
        return branch;
      let length = branch.length, selections = none;
      while (length) {
        let event = mapEvent(branch[length - 1], mapping, selections);
        if (event.changes && !event.changes.empty || event.effects.length) {
          let result2 = branch.slice(0, length);
          result2[length - 1] = event;
          return result2;
        } else {
          mapping = event.mapped;
          length--;
          selections = event.selectionsAfter;
        }
      }
      return selections.length ? [HistEvent.selection(selections)] : none;
    }
    function mapEvent(event, mapping, extraSelections) {
      let selections = conc(event.selectionsAfter.length ? event.selectionsAfter.map((s) => s.map(mapping)) : none, extraSelections);
      if (!event.changes)
        return HistEvent.selection(selections);
      let mappedChanges = event.changes.map(mapping), before = mapping.mapDesc(event.changes, true);
      let fullMapping = event.mapped ? event.mapped.composeDesc(before) : before;
      return new HistEvent(mappedChanges, StateEffect.mapEffects(event.effects, mapping), fullMapping, event.startSelection.map(before), selections);
    }
    const joinableUserEvent = /^(input\.type|delete)($|\.)/;
    class HistoryState {
      constructor(done, undone, prevTime = 0, prevUserEvent = void 0) {
        this.done = done;
        this.undone = undone;
        this.prevTime = prevTime;
        this.prevUserEvent = prevUserEvent;
      }
      isolate() {
        return this.prevTime ? new HistoryState(this.done, this.undone) : this;
      }
      addChanges(event, time, userEvent, config2, tr2) {
        let done = this.done, lastEvent = done[done.length - 1];
        if (lastEvent && lastEvent.changes && !lastEvent.changes.empty && event.changes && (!userEvent || joinableUserEvent.test(userEvent)) && (!lastEvent.selectionsAfter.length && time - this.prevTime < config2.newGroupDelay && config2.joinToEvent(tr2, isAdjacent(lastEvent.changes, event.changes)) || // For compose (but not compose.start) events, always join with previous event
        userEvent == "input.type.compose")) {
          done = updateBranch(done, done.length - 1, config2.minDepth, new HistEvent(event.changes.compose(lastEvent.changes), conc(StateEffect.mapEffects(event.effects, lastEvent.changes), lastEvent.effects), lastEvent.mapped, lastEvent.startSelection, none));
        } else {
          done = updateBranch(done, done.length, config2.minDepth, event);
        }
        return new HistoryState(done, none, time, userEvent);
      }
      addSelection(selection, time, userEvent, newGroupDelay) {
        let last = this.done.length ? this.done[this.done.length - 1].selectionsAfter : none;
        if (last.length > 0 && time - this.prevTime < newGroupDelay && userEvent == this.prevUserEvent && userEvent && /^select($|\.)/.test(userEvent) && eqSelectionShape(last[last.length - 1], selection))
          return this;
        return new HistoryState(addSelection(this.done, selection), this.undone, time, userEvent);
      }
      addMapping(mapping) {
        return new HistoryState(addMappingToBranch(this.done, mapping), addMappingToBranch(this.undone, mapping), this.prevTime, this.prevUserEvent);
      }
      pop(side, state, onlySelection) {
        let branch = side == 0 ? this.done : this.undone;
        if (branch.length == 0)
          return null;
        let event = branch[branch.length - 1], selection = event.selectionsAfter[0] || state.selection;
        if (onlySelection && event.selectionsAfter.length) {
          return state.update({
            selection: event.selectionsAfter[event.selectionsAfter.length - 1],
            annotations: fromHistory.of({ side, rest: popSelection(branch), selection }),
            userEvent: side == 0 ? "select.undo" : "select.redo",
            scrollIntoView: true
          });
        } else if (!event.changes) {
          return null;
        } else {
          let rest = branch.length == 1 ? none : branch.slice(0, branch.length - 1);
          if (event.mapped)
            rest = addMappingToBranch(rest, event.mapped);
          return state.update({
            changes: event.changes,
            selection: event.startSelection,
            effects: event.effects,
            annotations: fromHistory.of({ side, rest, selection }),
            filter: false,
            userEvent: side == 0 ? "undo" : "redo",
            scrollIntoView: true
          });
        }
      }
    }
    HistoryState.empty = /* @__PURE__ */ new HistoryState(none, none);
    const historyKeymap = [
      { key: "Mod-z", run: undo, preventDefault: true },
      { key: "Mod-y", mac: "Mod-Shift-z", run: redo, preventDefault: true },
      { linux: "Ctrl-Shift-z", run: redo, preventDefault: true },
      { key: "Mod-u", run: undoSelection, preventDefault: true },
      { key: "Alt-u", mac: "Mod-Shift-u", run: redoSelection, preventDefault: true }
    ];
    function updateSel(sel, by) {
      return EditorSelection.create(sel.ranges.map(by), sel.mainIndex);
    }
    function setSel(state, selection) {
      return state.update({ selection, scrollIntoView: true, userEvent: "select" });
    }
    function moveSel({ state, dispatch }, how) {
      let selection = updateSel(state.selection, how);
      if (selection.eq(state.selection, true))
        return false;
      dispatch(setSel(state, selection));
      return true;
    }
    function rangeEnd(range2, forward) {
      return EditorSelection.cursor(forward ? range2.to : range2.from);
    }
    function cursorByChar(view, forward) {
      return moveSel(view, (range2) => range2.empty ? view.moveByChar(range2, forward) : rangeEnd(range2, forward));
    }
    function ltrAtCursor(view) {
      return view.textDirectionAt(view.state.selection.main.head) == Direction.LTR;
    }
    const cursorCharLeft = (view) => cursorByChar(view, !ltrAtCursor(view));
    const cursorCharRight = (view) => cursorByChar(view, ltrAtCursor(view));
    function cursorByGroup(view, forward) {
      return moveSel(view, (range2) => range2.empty ? view.moveByGroup(range2, forward) : rangeEnd(range2, forward));
    }
    const cursorGroupLeft = (view) => cursorByGroup(view, !ltrAtCursor(view));
    const cursorGroupRight = (view) => cursorByGroup(view, ltrAtCursor(view));
    function interestingNode(state, node2, bracketProp) {
      if (node2.type.prop(bracketProp))
        return true;
      let len = node2.to - node2.from;
      return len && (len > 2 || /[^\s,.;:]/.test(state.sliceDoc(node2.from, node2.to))) || node2.firstChild;
    }
    function moveBySyntax(state, start2, forward) {
      let pos2 = syntaxTree(state).resolveInner(start2.head);
      let bracketProp = forward ? NodeProp$1.closedBy : NodeProp$1.openedBy;
      for (let at = start2.head; ; ) {
        let next = forward ? pos2.childAfter(at) : pos2.childBefore(at);
        if (!next)
          break;
        if (interestingNode(state, next, bracketProp))
          pos2 = next;
        else
          at = forward ? next.to : next.from;
      }
      let bracket2 = pos2.type.prop(bracketProp), match, newPos;
      if (bracket2 && (match = forward ? matchBrackets(state, pos2.from, 1) : matchBrackets(state, pos2.to, -1)) && match.matched)
        newPos = forward ? match.end.to : match.end.from;
      else
        newPos = forward ? pos2.to : pos2.from;
      return EditorSelection.cursor(newPos, forward ? -1 : 1);
    }
    const cursorSyntaxLeft = (view) => moveSel(view, (range2) => moveBySyntax(view.state, range2, !ltrAtCursor(view)));
    const cursorSyntaxRight = (view) => moveSel(view, (range2) => moveBySyntax(view.state, range2, ltrAtCursor(view)));
    function cursorByLine(view, forward) {
      return moveSel(view, (range2) => {
        if (!range2.empty)
          return rangeEnd(range2, forward);
        let moved = view.moveVertically(range2, forward);
        return moved.head != range2.head ? moved : view.moveToLineBoundary(range2, forward);
      });
    }
    const cursorLineUp = (view) => cursorByLine(view, false);
    const cursorLineDown = (view) => cursorByLine(view, true);
    function pageInfo(view) {
      let selfScroll = view.scrollDOM.clientHeight < view.scrollDOM.scrollHeight - 2;
      let marginTop = 0, marginBottom = 0, height;
      if (selfScroll) {
        for (let source2 of view.state.facet(EditorView.scrollMargins)) {
          let margins = source2(view);
          if (margins === null || margins === void 0 ? void 0 : margins.top)
            marginTop = Math.max(margins === null || margins === void 0 ? void 0 : margins.top, marginTop);
          if (margins === null || margins === void 0 ? void 0 : margins.bottom)
            marginBottom = Math.max(margins === null || margins === void 0 ? void 0 : margins.bottom, marginBottom);
        }
        height = view.scrollDOM.clientHeight - marginTop - marginBottom;
      } else {
        height = (view.dom.ownerDocument.defaultView || window).innerHeight;
      }
      return {
        marginTop,
        marginBottom,
        selfScroll,
        height: Math.max(view.defaultLineHeight, height - 5)
      };
    }
    function cursorByPage(view, forward) {
      let page = pageInfo(view);
      let { state } = view, selection = updateSel(state.selection, (range2) => {
        return range2.empty ? view.moveVertically(range2, forward, page.height) : rangeEnd(range2, forward);
      });
      if (selection.eq(state.selection))
        return false;
      let effect2;
      if (page.selfScroll) {
        let startPos = view.coordsAtPos(state.selection.main.head);
        let scrollRect = view.scrollDOM.getBoundingClientRect();
        let scrollTop = scrollRect.top + page.marginTop, scrollBottom = scrollRect.bottom - page.marginBottom;
        if (startPos && startPos.top > scrollTop && startPos.bottom < scrollBottom)
          effect2 = EditorView.scrollIntoView(selection.main.head, { y: "start", yMargin: startPos.top - scrollTop });
      }
      view.dispatch(setSel(state, selection), { effects: effect2 });
      return true;
    }
    const cursorPageUp = (view) => cursorByPage(view, false);
    const cursorPageDown = (view) => cursorByPage(view, true);
    function moveByLineBoundary(view, start2, forward) {
      let line2 = view.lineBlockAt(start2.head), moved = view.moveToLineBoundary(start2, forward);
      if (moved.head == start2.head && moved.head != (forward ? line2.to : line2.from))
        moved = view.moveToLineBoundary(start2, forward, false);
      if (!forward && moved.head == line2.from && line2.length) {
        let space = /^\s*/.exec(view.state.sliceDoc(line2.from, Math.min(line2.from + 100, line2.to)))[0].length;
        if (space && start2.head != line2.from + space)
          moved = EditorSelection.cursor(line2.from + space);
      }
      return moved;
    }
    const cursorLineBoundaryForward = (view) => moveSel(view, (range2) => moveByLineBoundary(view, range2, true));
    const cursorLineBoundaryBackward = (view) => moveSel(view, (range2) => moveByLineBoundary(view, range2, false));
    const cursorLineBoundaryLeft = (view) => moveSel(view, (range2) => moveByLineBoundary(view, range2, !ltrAtCursor(view)));
    const cursorLineBoundaryRight = (view) => moveSel(view, (range2) => moveByLineBoundary(view, range2, ltrAtCursor(view)));
    const cursorLineStart = (view) => moveSel(view, (range2) => EditorSelection.cursor(view.lineBlockAt(range2.head).from, 1));
    const cursorLineEnd = (view) => moveSel(view, (range2) => EditorSelection.cursor(view.lineBlockAt(range2.head).to, -1));
    function toMatchingBracket(state, dispatch, extend) {
      let found = false, selection = updateSel(state.selection, (range2) => {
        let matching = matchBrackets(state, range2.head, -1) || matchBrackets(state, range2.head, 1) || range2.head > 0 && matchBrackets(state, range2.head - 1, 1) || range2.head < state.doc.length && matchBrackets(state, range2.head + 1, -1);
        if (!matching || !matching.end)
          return range2;
        found = true;
        let head = matching.start.from == range2.head ? matching.end.to : matching.end.from;
        return EditorSelection.cursor(head);
      });
      if (!found)
        return false;
      dispatch(setSel(state, selection));
      return true;
    }
    const cursorMatchingBracket = ({ state, dispatch }) => toMatchingBracket(state, dispatch);
    function extendSel(target2, how) {
      let selection = updateSel(target2.state.selection, (range2) => {
        let head = how(range2);
        return EditorSelection.range(range2.anchor, head.head, head.goalColumn, head.bidiLevel || void 0);
      });
      if (selection.eq(target2.state.selection))
        return false;
      target2.dispatch(setSel(target2.state, selection));
      return true;
    }
    function selectByChar(view, forward) {
      return extendSel(view, (range2) => view.moveByChar(range2, forward));
    }
    const selectCharLeft = (view) => selectByChar(view, !ltrAtCursor(view));
    const selectCharRight = (view) => selectByChar(view, ltrAtCursor(view));
    function selectByGroup(view, forward) {
      return extendSel(view, (range2) => view.moveByGroup(range2, forward));
    }
    const selectGroupLeft = (view) => selectByGroup(view, !ltrAtCursor(view));
    const selectGroupRight = (view) => selectByGroup(view, ltrAtCursor(view));
    const selectSyntaxLeft = (view) => extendSel(view, (range2) => moveBySyntax(view.state, range2, !ltrAtCursor(view)));
    const selectSyntaxRight = (view) => extendSel(view, (range2) => moveBySyntax(view.state, range2, ltrAtCursor(view)));
    function selectByLine(view, forward) {
      return extendSel(view, (range2) => view.moveVertically(range2, forward));
    }
    const selectLineUp = (view) => selectByLine(view, false);
    const selectLineDown = (view) => selectByLine(view, true);
    function selectByPage(view, forward) {
      return extendSel(view, (range2) => view.moveVertically(range2, forward, pageInfo(view).height));
    }
    const selectPageUp = (view) => selectByPage(view, false);
    const selectPageDown = (view) => selectByPage(view, true);
    const selectLineBoundaryForward = (view) => extendSel(view, (range2) => moveByLineBoundary(view, range2, true));
    const selectLineBoundaryBackward = (view) => extendSel(view, (range2) => moveByLineBoundary(view, range2, false));
    const selectLineBoundaryLeft = (view) => extendSel(view, (range2) => moveByLineBoundary(view, range2, !ltrAtCursor(view)));
    const selectLineBoundaryRight = (view) => extendSel(view, (range2) => moveByLineBoundary(view, range2, ltrAtCursor(view)));
    const selectLineStart = (view) => extendSel(view, (range2) => EditorSelection.cursor(view.lineBlockAt(range2.head).from));
    const selectLineEnd = (view) => extendSel(view, (range2) => EditorSelection.cursor(view.lineBlockAt(range2.head).to));
    const cursorDocStart = ({ state, dispatch }) => {
      dispatch(setSel(state, { anchor: 0 }));
      return true;
    };
    const cursorDocEnd = ({ state, dispatch }) => {
      dispatch(setSel(state, { anchor: state.doc.length }));
      return true;
    };
    const selectDocStart = ({ state, dispatch }) => {
      dispatch(setSel(state, { anchor: state.selection.main.anchor, head: 0 }));
      return true;
    };
    const selectDocEnd = ({ state, dispatch }) => {
      dispatch(setSel(state, { anchor: state.selection.main.anchor, head: state.doc.length }));
      return true;
    };
    const selectAll = ({ state, dispatch }) => {
      dispatch(state.update({ selection: { anchor: 0, head: state.doc.length }, userEvent: "select" }));
      return true;
    };
    const selectLine = ({ state, dispatch }) => {
      let ranges = selectedLineBlocks(state).map(({ from, to: to2 }) => EditorSelection.range(from, Math.min(to2 + 1, state.doc.length)));
      dispatch(state.update({ selection: EditorSelection.create(ranges), userEvent: "select" }));
      return true;
    };
    const selectParentSyntax = ({ state, dispatch }) => {
      let selection = updateSel(state.selection, (range2) => {
        let tree = syntaxTree(state), stack2 = tree.resolveStack(range2.from, 1);
        if (range2.empty) {
          let stackBefore = tree.resolveStack(range2.from, -1);
          if (stackBefore.node.from >= stack2.node.from && stackBefore.node.to <= stack2.node.to)
            stack2 = stackBefore;
        }
        for (let cur2 = stack2; cur2; cur2 = cur2.next) {
          let { node: node2 } = cur2;
          if ((node2.from < range2.from && node2.to >= range2.to || node2.to > range2.to && node2.from <= range2.from) && cur2.next)
            return EditorSelection.range(node2.to, node2.from);
        }
        return range2;
      });
      if (selection.eq(state.selection))
        return false;
      dispatch(setSel(state, selection));
      return true;
    };
    const simplifySelection = ({ state, dispatch }) => {
      let cur2 = state.selection, selection = null;
      if (cur2.ranges.length > 1)
        selection = EditorSelection.create([cur2.main]);
      else if (!cur2.main.empty)
        selection = EditorSelection.create([EditorSelection.cursor(cur2.main.head)]);
      if (!selection)
        return false;
      dispatch(setSel(state, selection));
      return true;
    };
    function deleteBy(target2, by) {
      if (target2.state.readOnly)
        return false;
      let event = "delete.selection", { state } = target2;
      let changes = state.changeByRange((range2) => {
        let { from, to: to2 } = range2;
        if (from == to2) {
          let towards = by(range2);
          if (towards < from) {
            event = "delete.backward";
            towards = skipAtomic(target2, towards, false);
          } else if (towards > from) {
            event = "delete.forward";
            towards = skipAtomic(target2, towards, true);
          }
          from = Math.min(from, towards);
          to2 = Math.max(to2, towards);
        } else {
          from = skipAtomic(target2, from, false);
          to2 = skipAtomic(target2, to2, true);
        }
        return from == to2 ? { range: range2 } : { changes: { from, to: to2 }, range: EditorSelection.cursor(from, from < range2.head ? -1 : 1) };
      });
      if (changes.changes.empty)
        return false;
      target2.dispatch(state.update(changes, {
        scrollIntoView: true,
        userEvent: event,
        effects: event == "delete.selection" ? EditorView.announce.of(state.phrase("Selection deleted")) : void 0
      }));
      return true;
    }
    function skipAtomic(target2, pos2, forward) {
      if (target2 instanceof EditorView)
        for (let ranges of target2.state.facet(EditorView.atomicRanges).map((f) => f(target2)))
          ranges.between(pos2, pos2, (from, to2) => {
            if (from < pos2 && to2 > pos2)
              pos2 = forward ? to2 : from;
          });
      return pos2;
    }
    const deleteByChar = (target2, forward, byIndentUnit) => deleteBy(target2, (range2) => {
      let pos2 = range2.from, { state } = target2, line2 = state.doc.lineAt(pos2), before, targetPos;
      if (byIndentUnit && !forward && pos2 > line2.from && pos2 < line2.from + 200 && !/[^ \t]/.test(before = line2.text.slice(0, pos2 - line2.from))) {
        if (before[before.length - 1] == "	")
          return pos2 - 1;
        let col = countColumn(before, state.tabSize), drop = col % getIndentUnit(state) || getIndentUnit(state);
        for (let i2 = 0; i2 < drop && before[before.length - 1 - i2] == " "; i2++)
          pos2--;
        targetPos = pos2;
      } else {
        targetPos = findClusterBreak(line2.text, pos2 - line2.from, forward, forward) + line2.from;
        if (targetPos == pos2 && line2.number != (forward ? state.doc.lines : 1))
          targetPos += forward ? 1 : -1;
        else if (!forward && /[\ufe00-\ufe0f]/.test(line2.text.slice(targetPos - line2.from, pos2 - line2.from)))
          targetPos = findClusterBreak(line2.text, targetPos - line2.from, false, false) + line2.from;
      }
      return targetPos;
    });
    const deleteCharBackward = (view) => deleteByChar(view, false, true);
    const deleteCharForward = (view) => deleteByChar(view, true, false);
    const deleteByGroup = (target2, forward) => deleteBy(target2, (range2) => {
      let pos2 = range2.head, { state } = target2, line2 = state.doc.lineAt(pos2);
      let categorize = state.charCategorizer(pos2);
      for (let cat = null; ; ) {
        if (pos2 == (forward ? line2.to : line2.from)) {
          if (pos2 == range2.head && line2.number != (forward ? state.doc.lines : 1))
            pos2 += forward ? 1 : -1;
          break;
        }
        let next = findClusterBreak(line2.text, pos2 - line2.from, forward) + line2.from;
        let nextChar = line2.text.slice(Math.min(pos2, next) - line2.from, Math.max(pos2, next) - line2.from);
        let nextCat = categorize(nextChar);
        if (cat != null && nextCat != cat)
          break;
        if (nextChar != " " || pos2 != range2.head)
          cat = nextCat;
        pos2 = next;
      }
      return pos2;
    });
    const deleteGroupBackward = (target2) => deleteByGroup(target2, false);
    const deleteGroupForward = (target2) => deleteByGroup(target2, true);
    const deleteToLineEnd = (view) => deleteBy(view, (range2) => {
      let lineEnd = view.lineBlockAt(range2.head).to;
      return range2.head < lineEnd ? lineEnd : Math.min(view.state.doc.length, range2.head + 1);
    });
    const deleteLineBoundaryBackward = (view) => deleteBy(view, (range2) => {
      let lineStart = view.moveToLineBoundary(range2, false).head;
      return range2.head > lineStart ? lineStart : Math.max(0, range2.head - 1);
    });
    const deleteLineBoundaryForward = (view) => deleteBy(view, (range2) => {
      let lineStart = view.moveToLineBoundary(range2, true).head;
      return range2.head < lineStart ? lineStart : Math.min(view.state.doc.length, range2.head + 1);
    });
    const splitLine = ({ state, dispatch }) => {
      if (state.readOnly)
        return false;
      let changes = state.changeByRange((range2) => {
        return {
          changes: { from: range2.from, to: range2.to, insert: Text.of(["", ""]) },
          range: EditorSelection.cursor(range2.from)
        };
      });
      dispatch(state.update(changes, { scrollIntoView: true, userEvent: "input" }));
      return true;
    };
    const transposeChars = ({ state, dispatch }) => {
      if (state.readOnly)
        return false;
      let changes = state.changeByRange((range2) => {
        if (!range2.empty || range2.from == 0 || range2.from == state.doc.length)
          return { range: range2 };
        let pos2 = range2.from, line2 = state.doc.lineAt(pos2);
        let from = pos2 == line2.from ? pos2 - 1 : findClusterBreak(line2.text, pos2 - line2.from, false) + line2.from;
        let to2 = pos2 == line2.to ? pos2 + 1 : findClusterBreak(line2.text, pos2 - line2.from, true) + line2.from;
        return {
          changes: { from, to: to2, insert: state.doc.slice(pos2, to2).append(state.doc.slice(from, pos2)) },
          range: EditorSelection.cursor(to2)
        };
      });
      if (changes.changes.empty)
        return false;
      dispatch(state.update(changes, { scrollIntoView: true, userEvent: "move.character" }));
      return true;
    };
    function selectedLineBlocks(state) {
      let blocks = [], upto = -1;
      for (let range2 of state.selection.ranges) {
        let startLine = state.doc.lineAt(range2.from), endLine = state.doc.lineAt(range2.to);
        if (!range2.empty && range2.to == endLine.from)
          endLine = state.doc.lineAt(range2.to - 1);
        if (upto >= startLine.number) {
          let prev = blocks[blocks.length - 1];
          prev.to = endLine.to;
          prev.ranges.push(range2);
        } else {
          blocks.push({ from: startLine.from, to: endLine.to, ranges: [range2] });
        }
        upto = endLine.number + 1;
      }
      return blocks;
    }
    function moveLine(state, dispatch, forward) {
      if (state.readOnly)
        return false;
      let changes = [], ranges = [];
      for (let block2 of selectedLineBlocks(state)) {
        if (forward ? block2.to == state.doc.length : block2.from == 0)
          continue;
        let nextLine = state.doc.lineAt(forward ? block2.to + 1 : block2.from - 1);
        let size = nextLine.length + 1;
        if (forward) {
          changes.push({ from: block2.to, to: nextLine.to }, { from: block2.from, insert: nextLine.text + state.lineBreak });
          for (let r2 of block2.ranges)
            ranges.push(EditorSelection.range(Math.min(state.doc.length, r2.anchor + size), Math.min(state.doc.length, r2.head + size)));
        } else {
          changes.push({ from: nextLine.from, to: block2.from }, { from: block2.to, insert: state.lineBreak + nextLine.text });
          for (let r2 of block2.ranges)
            ranges.push(EditorSelection.range(r2.anchor - size, r2.head - size));
        }
      }
      if (!changes.length)
        return false;
      dispatch(state.update({
        changes,
        scrollIntoView: true,
        selection: EditorSelection.create(ranges, state.selection.mainIndex),
        userEvent: "move.line"
      }));
      return true;
    }
    const moveLineUp = ({ state, dispatch }) => moveLine(state, dispatch, false);
    const moveLineDown = ({ state, dispatch }) => moveLine(state, dispatch, true);
    function copyLine(state, dispatch, forward) {
      if (state.readOnly)
        return false;
      let changes = [];
      for (let block2 of selectedLineBlocks(state)) {
        if (forward)
          changes.push({ from: block2.from, insert: state.doc.slice(block2.from, block2.to) + state.lineBreak });
        else
          changes.push({ from: block2.to, insert: state.lineBreak + state.doc.slice(block2.from, block2.to) });
      }
      dispatch(state.update({ changes, scrollIntoView: true, userEvent: "input.copyline" }));
      return true;
    }
    const copyLineUp = ({ state, dispatch }) => copyLine(state, dispatch, false);
    const copyLineDown = ({ state, dispatch }) => copyLine(state, dispatch, true);
    const deleteLine = (view) => {
      if (view.state.readOnly)
        return false;
      let { state } = view, changes = state.changes(selectedLineBlocks(state).map(({ from, to: to2 }) => {
        if (from > 0)
          from--;
        else if (to2 < state.doc.length)
          to2++;
        return { from, to: to2 };
      }));
      let selection = updateSel(state.selection, (range2) => {
        let dist2 = void 0;
        if (view.lineWrapping) {
          let block2 = view.lineBlockAt(range2.head), pos2 = view.coordsAtPos(range2.head, range2.assoc || 1);
          if (pos2)
            dist2 = block2.bottom + view.documentTop - pos2.bottom + view.defaultLineHeight / 2;
        }
        return view.moveVertically(range2, true, dist2);
      }).map(changes);
      view.dispatch({ changes, selection, scrollIntoView: true, userEvent: "delete.line" });
      return true;
    };
    function isBetweenBrackets(state, pos2) {
      if (/\(\)|\[\]|\{\}/.test(state.sliceDoc(pos2 - 1, pos2 + 1)))
        return { from: pos2, to: pos2 };
      let context = syntaxTree(state).resolveInner(pos2);
      let before = context.childBefore(pos2), after = context.childAfter(pos2), closedBy;
      if (before && after && before.to <= pos2 && after.from >= pos2 && (closedBy = before.type.prop(NodeProp$1.closedBy)) && closedBy.indexOf(after.name) > -1 && state.doc.lineAt(before.to).from == state.doc.lineAt(after.from).from && !/\S/.test(state.sliceDoc(before.to, after.from)))
        return { from: before.to, to: after.from };
      return null;
    }
    const insertNewlineAndIndent = /* @__PURE__ */ newlineAndIndent(false);
    const insertBlankLine = /* @__PURE__ */ newlineAndIndent(true);
    function newlineAndIndent(atEof) {
      return ({ state, dispatch }) => {
        if (state.readOnly)
          return false;
        let changes = state.changeByRange((range2) => {
          let { from, to: to2 } = range2, line2 = state.doc.lineAt(from);
          let explode = !atEof && from == to2 && isBetweenBrackets(state, from);
          if (atEof)
            from = to2 = (to2 <= line2.to ? line2 : state.doc.lineAt(to2)).to;
          let cx = new IndentContext(state, { simulateBreak: from, simulateDoubleBreak: !!explode });
          let indent = getIndentation(cx, from);
          if (indent == null)
            indent = countColumn(/^\s*/.exec(state.doc.lineAt(from).text)[0], state.tabSize);
          while (to2 < line2.to && /\s/.test(line2.text[to2 - line2.from]))
            to2++;
          if (explode)
            ({ from, to: to2 } = explode);
          else if (from > line2.from && from < line2.from + 100 && !/\S/.test(line2.text.slice(0, from)))
            from = line2.from;
          let insert2 = ["", indentString(state, indent)];
          if (explode)
            insert2.push(indentString(state, cx.lineIndent(line2.from, -1)));
          return {
            changes: { from, to: to2, insert: Text.of(insert2) },
            range: EditorSelection.cursor(from + 1 + insert2[1].length)
          };
        });
        dispatch(state.update(changes, { scrollIntoView: true, userEvent: "input" }));
        return true;
      };
    }
    function changeBySelectedLine(state, f) {
      let atLine = -1;
      return state.changeByRange((range2) => {
        let changes = [];
        for (let pos2 = range2.from; pos2 <= range2.to; ) {
          let line2 = state.doc.lineAt(pos2);
          if (line2.number > atLine && (range2.empty || range2.to > line2.from)) {
            f(line2, changes, range2);
            atLine = line2.number;
          }
          pos2 = line2.to + 1;
        }
        let changeSet = state.changes(changes);
        return {
          changes,
          range: EditorSelection.range(changeSet.mapPos(range2.anchor, 1), changeSet.mapPos(range2.head, 1))
        };
      });
    }
    const indentSelection = ({ state, dispatch }) => {
      if (state.readOnly)
        return false;
      let updated = /* @__PURE__ */ Object.create(null);
      let context = new IndentContext(state, { overrideIndentation: (start2) => {
        let found = updated[start2];
        return found == null ? -1 : found;
      } });
      let changes = changeBySelectedLine(state, (line2, changes2, range2) => {
        let indent = getIndentation(context, line2.from);
        if (indent == null)
          return;
        if (!/\S/.test(line2.text))
          indent = 0;
        let cur2 = /^\s*/.exec(line2.text)[0];
        let norm = indentString(state, indent);
        if (cur2 != norm || range2.from < line2.from + cur2.length) {
          updated[line2.from] = indent;
          changes2.push({ from: line2.from, to: line2.from + cur2.length, insert: norm });
        }
      });
      if (!changes.changes.empty)
        dispatch(state.update(changes, { userEvent: "indent" }));
      return true;
    };
    const indentMore = ({ state, dispatch }) => {
      if (state.readOnly)
        return false;
      dispatch(state.update(changeBySelectedLine(state, (line2, changes) => {
        changes.push({ from: line2.from, insert: state.facet(indentUnit) });
      }), { userEvent: "input.indent" }));
      return true;
    };
    const indentLess = ({ state, dispatch }) => {
      if (state.readOnly)
        return false;
      dispatch(state.update(changeBySelectedLine(state, (line2, changes) => {
        let space = /^\s*/.exec(line2.text)[0];
        if (!space)
          return;
        let col = countColumn(space, state.tabSize), keep = 0;
        let insert2 = indentString(state, Math.max(0, col - getIndentUnit(state)));
        while (keep < space.length && keep < insert2.length && space.charCodeAt(keep) == insert2.charCodeAt(keep))
          keep++;
        changes.push({ from: line2.from + keep, to: line2.from + space.length, insert: insert2.slice(keep) });
      }), { userEvent: "delete.dedent" }));
      return true;
    };
    const toggleTabFocusMode = (view) => {
      view.setTabFocusMode();
      return true;
    };
    const emacsStyleKeymap = [
      { key: "Ctrl-b", run: cursorCharLeft, shift: selectCharLeft, preventDefault: true },
      { key: "Ctrl-f", run: cursorCharRight, shift: selectCharRight },
      { key: "Ctrl-p", run: cursorLineUp, shift: selectLineUp },
      { key: "Ctrl-n", run: cursorLineDown, shift: selectLineDown },
      { key: "Ctrl-a", run: cursorLineStart, shift: selectLineStart },
      { key: "Ctrl-e", run: cursorLineEnd, shift: selectLineEnd },
      { key: "Ctrl-d", run: deleteCharForward },
      { key: "Ctrl-h", run: deleteCharBackward },
      { key: "Ctrl-k", run: deleteToLineEnd },
      { key: "Ctrl-Alt-h", run: deleteGroupBackward },
      { key: "Ctrl-o", run: splitLine },
      { key: "Ctrl-t", run: transposeChars },
      { key: "Ctrl-v", run: cursorPageDown }
    ];
    const standardKeymap = /* @__PURE__ */ [
      { key: "ArrowLeft", run: cursorCharLeft, shift: selectCharLeft, preventDefault: true },
      { key: "Mod-ArrowLeft", mac: "Alt-ArrowLeft", run: cursorGroupLeft, shift: selectGroupLeft, preventDefault: true },
      { mac: "Cmd-ArrowLeft", run: cursorLineBoundaryLeft, shift: selectLineBoundaryLeft, preventDefault: true },
      { key: "ArrowRight", run: cursorCharRight, shift: selectCharRight, preventDefault: true },
      { key: "Mod-ArrowRight", mac: "Alt-ArrowRight", run: cursorGroupRight, shift: selectGroupRight, preventDefault: true },
      { mac: "Cmd-ArrowRight", run: cursorLineBoundaryRight, shift: selectLineBoundaryRight, preventDefault: true },
      { key: "ArrowUp", run: cursorLineUp, shift: selectLineUp, preventDefault: true },
      { mac: "Cmd-ArrowUp", run: cursorDocStart, shift: selectDocStart },
      { mac: "Ctrl-ArrowUp", run: cursorPageUp, shift: selectPageUp },
      { key: "ArrowDown", run: cursorLineDown, shift: selectLineDown, preventDefault: true },
      { mac: "Cmd-ArrowDown", run: cursorDocEnd, shift: selectDocEnd },
      { mac: "Ctrl-ArrowDown", run: cursorPageDown, shift: selectPageDown },
      { key: "PageUp", run: cursorPageUp, shift: selectPageUp },
      { key: "PageDown", run: cursorPageDown, shift: selectPageDown },
      { key: "Home", run: cursorLineBoundaryBackward, shift: selectLineBoundaryBackward, preventDefault: true },
      { key: "Mod-Home", run: cursorDocStart, shift: selectDocStart },
      { key: "End", run: cursorLineBoundaryForward, shift: selectLineBoundaryForward, preventDefault: true },
      { key: "Mod-End", run: cursorDocEnd, shift: selectDocEnd },
      { key: "Enter", run: insertNewlineAndIndent, shift: insertNewlineAndIndent },
      { key: "Mod-a", run: selectAll },
      { key: "Backspace", run: deleteCharBackward, shift: deleteCharBackward },
      { key: "Delete", run: deleteCharForward },
      { key: "Mod-Backspace", mac: "Alt-Backspace", run: deleteGroupBackward },
      { key: "Mod-Delete", mac: "Alt-Delete", run: deleteGroupForward },
      { mac: "Mod-Backspace", run: deleteLineBoundaryBackward },
      { mac: "Mod-Delete", run: deleteLineBoundaryForward }
    ].concat(/* @__PURE__ */ emacsStyleKeymap.map((b) => ({ mac: b.key, run: b.run, shift: b.shift })));
    const defaultKeymap = /* @__PURE__ */ [
      { key: "Alt-ArrowLeft", mac: "Ctrl-ArrowLeft", run: cursorSyntaxLeft, shift: selectSyntaxLeft },
      { key: "Alt-ArrowRight", mac: "Ctrl-ArrowRight", run: cursorSyntaxRight, shift: selectSyntaxRight },
      { key: "Alt-ArrowUp", run: moveLineUp },
      { key: "Shift-Alt-ArrowUp", run: copyLineUp },
      { key: "Alt-ArrowDown", run: moveLineDown },
      { key: "Shift-Alt-ArrowDown", run: copyLineDown },
      { key: "Escape", run: simplifySelection },
      { key: "Mod-Enter", run: insertBlankLine },
      { key: "Alt-l", mac: "Ctrl-l", run: selectLine },
      { key: "Mod-i", run: selectParentSyntax, preventDefault: true },
      { key: "Mod-[", run: indentLess },
      { key: "Mod-]", run: indentMore },
      { key: "Mod-Alt-\\", run: indentSelection },
      { key: "Shift-Mod-k", run: deleteLine },
      { key: "Shift-Mod-\\", run: cursorMatchingBracket },
      { key: "Mod-/", run: toggleComment },
      { key: "Alt-A", run: toggleBlockComment },
      { key: "Ctrl-m", mac: "Shift-Alt-m", run: toggleTabFocusMode }
    ].concat(standardKeymap);
    const minimalSetup = /* @__PURE__ */ (() => [
      highlightSpecialChars(),
      history(),
      drawSelection(),
      syntaxHighlighting(defaultHighlightStyle, { fallback: true }),
      keymap.of([
        ...defaultKeymap,
        ...historyKeymap
      ])
    ])();
    const TOKEN_PATTERNS = {
      STRING: /^"[^"]*"/,
      UNTERMINATED_STRING: /^"[^"]*/,
      NUMBER: /^(-|\+)?\d+(\.\d+)?/,
      RELATION: /^(==|!=|<=|>=|<|>|~=)/,
      MISC_OPERATOR: /^(=|!|~)/,
      OPERATOR: /^(\+|-|\*|\/|\^|\(|\)|,|\.)/,
      VARIABLE: /^[a-zA-Z_][a-zA-Z0-9_]*/
    };
    const createWordRegex = (words) => new RegExp(`^(${words.join("|")})\\b`);
    const countSpaces = (word) => word.split(" ").length - 1;
    const mathFunctionsRegex = createWordRegex(
      MATH_FUNCTIONS.map(([label2]) => label2)
    );
    const sampleFunctionsRegex = createWordRegex(
      SAMPLE_FUNCTIONS.map(([label2]) => label2)
    );
    const keywordsRegex = createWordRegex(
      // Ensure 'not in' matches first
      KEYWORDS.sort((a, b) => countSpaces(b) - countSpaces(a))
    );
    function nextToken(stream) {
      if (stream.match(TOKEN_PATTERNS.STRING)) return "string";
      if (stream.match(TOKEN_PATTERNS.UNTERMINATED_STRING))
        return "unterminatedString";
      if (stream.match(TOKEN_PATTERNS.NUMBER)) return "number";
      if (stream.match(keywordsRegex)) return "keyword";
      if (stream.match(mathFunctionsRegex)) return "mathFunction";
      if (stream.match(sampleFunctionsRegex)) return "sampleFunction";
      if (stream.match(TOKEN_PATTERNS.VARIABLE)) return "variable";
      if (stream.match(TOKEN_PATTERNS.RELATION)) return "relation";
      if (stream.match(TOKEN_PATTERNS.MISC_OPERATOR)) return "miscOperator";
      if (stream.match(TOKEN_PATTERNS.OPERATOR)) return "miscOperator";
      stream.next();
      return null;
    }
    function tokenize(input2) {
      const tokens = [];
      const stream = new StringStream(input2, 0, 0);
      while (stream.pos < input2.length) {
        const from = stream.pos;
        const type = nextToken(stream);
        if (type) {
          tokens.push({
            type,
            text: input2.slice(from, stream.pos),
            from,
            to: stream.pos
          });
        }
      }
      return tokens;
    }
    const language = StreamLanguage.define({
      token: nextToken,
      tokenTable: {
        string: tags$2.string,
        unterminatedString: tags$2.string,
        number: tags$2.number,
        keyword: tags$2.keyword,
        mathFunction: tags$2.function(tags$2.variableName),
        sampleFunction: tags$2.function(tags$2.variableName),
        variable: tags$2.variableName,
        relation: tags$2.operator,
        miscOperator: tags$2.operator
      }
    });
    const isLiteral = (token2) => ["string", "unterminatedString", "number"].includes(token2?.type);
    const isLogicalOp = (token2) => ["and", "or", "not"].includes(token2?.text);
    const autocompleteImmediatelyAfter = (token2) => ["(", "."].includes(token2?.text);
    const applyWithCall = (view, completion, from, to2) => {
      view.dispatch({
        changes: { from, to: to2, insert: `${completion.label}()` },
        selection: { anchor: from + completion.label.length + 1 }
      });
    };
    const applyWithDot = (view, completion, from, to2) => {
      view.dispatch({
        changes: { from, to: to2, insert: `${completion.label}.` },
        selection: { anchor: from + completion.label.length + 1 }
      });
      setTimeout(() => startCompletion(view), 0);
    };
    const applyWithSpace = (view, completion, from, to2) => {
      view.dispatch({
        changes: { from, to: to2, insert: `${completion.label} ` },
        selection: { anchor: from + completion.label.length + 1 }
      });
      setTimeout(() => startCompletion(view), 0);
    };
    const makeKeywordCompletion = (k2) => ({
      label: k2,
      type: "keyword",
      boost: -20
    });
    const makeMathFunctionCompletion = ([label2, info]) => ({
      label: label2,
      type: "function",
      info,
      apply: applyWithCall,
      boost: -10
    });
    const makeSampleFunctionCompletion = ([label2, info]) => ({
      label: label2,
      type: "function",
      info,
      apply: applyWithCall,
      boost: 0
    });
    const makeSampleVariableCompletion = ([label2, info]) => ({
      label: label2,
      type: "variable",
      info,
      apply: label2 === kSampleMetadataVariable ? applyWithDot : label2 === kSampleIdVariable ? applyWithSpace : void 0,
      boost: 10
    });
    const makeLiteralCompletion = (k2) => ({
      label: k2,
      type: "text",
      boost: 20
    });
    const makeCanonicalNameCompletion = (item2, { autoSpaceIf = () => false } = {}) => ({
      label: item2.canonicalName + (autoSpaceIf(item2) ? " " : ""),
      type: "variable",
      info: item2.tooltip,
      boost: 30
    });
    const makeMemberAccessCompletion = (item2) => ({
      label: item2.qualifiedName?.split(".")[1] || "",
      type: "variable",
      info: item2.tooltip,
      boost: 40
    });
    const getMemberScoreItems = (filterItems, scorer2) => filterItems.filter((item2) => item2?.qualifiedName?.startsWith(`${scorer2}.`));
    const getSampleIds = (samples) => {
      const ids = /* @__PURE__ */ new Set();
      for (const sample2 of samples) {
        ids.add(sample2.id);
      }
      return ids;
    };
    const getMetadataPropertyValues = (samples, propertyPath) => {
      const values = /* @__PURE__ */ new Set();
      for (const sample2 of samples) {
        if (sample2.metadata) {
          const value2 = getNestedProperty(sample2.metadata, propertyPath);
          if (value2 !== void 0 && value2 !== null) {
            values.add(value2);
          }
        }
      }
      return values;
    };
    const getNestedProperty = (obj, path) => {
      const keys = path.split(".");
      let current2 = obj;
      for (const key2 of keys) {
        if (current2 && typeof current2 === "object" && key2 in current2) {
          current2 = current2[key2];
        } else {
          return void 0;
        }
      }
      return current2;
    };
    const buildMetadataPath = (tokens, currentTokenIndex) => {
      const parts = [];
      let index = 2;
      while (index <= currentTokenIndex) {
        const token2 = tokens[currentTokenIndex - index];
        if (token2?.text === kSampleMetadataVariable) {
          return parts.reverse().join(".");
        } else if (token2?.type === "variable") {
          parts.push(token2.text);
          index++;
          if (tokens[currentTokenIndex - index]?.text === ".") {
            index++;
          } else {
            break;
          }
        } else {
          break;
        }
      }
      return null;
    };
    const getMetadataKeysForPath = (samples, parentPath) => {
      const keys = /* @__PURE__ */ new Set();
      for (const sample2 of samples) {
        if (sample2.metadata) {
          const parentObj = parentPath ? getNestedProperty(sample2.metadata, parentPath) : sample2.metadata;
          if (parentObj && typeof parentObj === "object" && !Array.isArray(parentObj)) {
            for (const key2 of Object.keys(parentObj)) {
              keys.add(key2);
            }
          }
        }
      }
      return keys;
    };
    const buildMetadataPropertyPath = (tokens, currentTokenIndex) => {
      const parts = [];
      let index = 2;
      while (index <= currentTokenIndex) {
        const token2 = tokens[currentTokenIndex - index];
        if (!token2) break;
        if (token2.type === "variable") {
          if (token2.text === kSampleMetadataVariable) {
            return parts.reverse().join(".");
          } else {
            parts.push(token2.text);
          }
        } else if (token2.text !== ".") {
          break;
        }
        index++;
      }
      return null;
    };
    const isMetadataProperty = (tokens, currentTokenIndex) => {
      let index = 2;
      while (index <= currentTokenIndex) {
        const token2 = tokens[currentTokenIndex - index];
        if (!token2) break;
        if (token2.text === kSampleMetadataVariable) {
          return true;
        } else if (token2.text === "." || token2.type === "variable") {
          index++;
        } else {
          break;
        }
      }
      return false;
    };
    const makeMetadataKeyCompletion = (key2) => ({
      label: key2,
      type: "property",
      info: `Metadata property: ${key2}`,
      boost: 25
    });
    const makeSampleIdCompletion = (id) => ({
      label: typeof id === "string" ? `"${id}"` : String(id),
      type: "text",
      info: `Sample ID: ${id}`,
      boost: 25
    });
    const makeMetadataValueCompletion = (value2) => {
      let label2;
      if (typeof value2 === "string") {
        label2 = `"${value2}"`;
      } else if (typeof value2 === "boolean") {
        label2 = value2 ? "True" : "False";
      } else if (value2 === null) {
        label2 = "None";
      } else {
        label2 = String(value2);
      }
      return {
        label: label2,
        type: "text",
        info: `Metadata value: ${value2}`,
        boost: 25
      };
    };
    function getCompletions(context, filterItems, samples) {
      const keywordCompletionItems = KEYWORDS.map(makeKeywordCompletion);
      const mathFunctionCompletionItems = MATH_FUNCTIONS.map(
        makeMathFunctionCompletion
      );
      const sampleFunctionCompletionItems = SAMPLE_FUNCTIONS.map(
        makeSampleFunctionCompletion
      );
      const availableSampleVariables = SAMPLE_VARIABLES.filter(([label2]) => {
        if (label2 === kSampleMetadataVariable) {
          return samples && samples.some(
            (sample2) => sample2.metadata && Object.keys(sample2.metadata).length > 0
          );
        }
        return true;
      });
      const sampleVariableCompletionItems = availableSampleVariables.map(
        makeSampleVariableCompletion
      );
      const variableCompletionItems = filterItems.map(
        (item2) => makeCanonicalNameCompletion(item2)
      );
      const defaultCompletionItems = [
        ...keywordCompletionItems,
        ...mathFunctionCompletionItems,
        ...sampleFunctionCompletionItems,
        ...sampleVariableCompletionItems,
        ...variableCompletionItems
      ];
      const doc2 = context.state.doc;
      const input2 = doc2.toString().slice(0, context.pos);
      const tokens = tokenize(input2);
      const lastToken = tokens[tokens.length - 1];
      const isCompletionInsideToken = lastToken && context.pos === lastToken.to && !autocompleteImmediatelyAfter(lastToken);
      const currentTokenIndex = isCompletionInsideToken ? tokens.length - 1 : tokens.length;
      const prevToken = (index) => tokens[currentTokenIndex - index];
      const currentToken = prevToken(0);
      const completionStart = currentToken ? currentToken.from : context.pos;
      const completingAtEnd = context.pos === doc2.length;
      const findFilterItem = (endIndex) => {
        if (prevToken(endIndex)?.type !== "variable") return void 0;
        let name2 = prevToken(endIndex).text;
        let i2 = endIndex;
        while (prevToken(i2 + 1)?.text === ".") {
          if (prevToken(i2 + 2)?.type === "variable") {
            name2 = `${prevToken(i2 + 2).text}.${name2}`;
            i2 += 2;
          } else {
            break;
          }
        }
        return filterItems.find((item2) => item2.canonicalName === name2);
      };
      const makeCompletions = (priorityCompletions, {
        autocompleteInTheMiddle = false,
        enforceOrder = false,
        autoSpaceAfter = false,
        includeDefault = true
      } = {}) => {
        if (!autocompleteInTheMiddle && !completingAtEnd && !context.explicit) {
          return null;
        }
        const priorityCompletionsOrdered = enforceOrder ? priorityCompletions.map((c2, idx) => ({ ...c2, boost: -idx })) : priorityCompletions;
        const priorityCompletionsAdjusted = autoSpaceAfter ? priorityCompletionsOrdered.map(
          (c2) => !c2.apply && !c2.label.endsWith(" ") ? { ...c2, label: `${c2.label} ` } : c2
        ) : priorityCompletionsOrdered;
        if (!includeDefault) {
          return {
            from: completionStart,
            options: priorityCompletionsAdjusted
          };
        }
        const miscSection = {
          name: "misc",
          header: () => {
            const element = document.createElement("hr");
            element.style.display = "list-item";
            element.style.margin = "2px 0";
            return element;
          }
        };
        const priorityLabels = new Set(
          priorityCompletions.map((c2) => c2.label.trim())
        );
        const defaultCompletionsAdjusted = defaultCompletionItems.filter((c2) => !priorityLabels.has(c2.label.trim())).map((c2) => ({ ...c2, section: miscSection }));
        return {
          from: completionStart,
          options: [...priorityCompletionsAdjusted, ...defaultCompletionsAdjusted]
        };
      };
      const defaultCompletions = () => makeCompletions([]);
      const noCompletions = () => context.explicit ? defaultCompletions() : null;
      const newExpressionCompletions = () => makeCompletions([
        ...filterItems.map(
          (item2) => makeCanonicalNameCompletion(item2, {
            autoSpaceIf: (item22) => completingAtEnd && item22.scoreType !== kScoreTypeBoolean
          })
        ),
        ...sampleVariableCompletionItems,
        ...sampleFunctionCompletionItems
      ]);
      const variableCompletions = () => makeCompletions(variableCompletionItems);
      const memberAccessCompletions = (items) => makeCompletions(items.map(makeMemberAccessCompletion), {
        autocompleteInTheMiddle: true,
        includeDefault: false
      });
      const logicalOpCompletions = () => makeCompletions(["and", "or"].map(makeKeywordCompletion), {
        enforceOrder: true,
        autoSpaceAfter: completingAtEnd
      });
      const discreteRelationCompletions = () => makeCompletions(["==", "!=", "in", "not in"].map(makeKeywordCompletion), {
        enforceOrder: true,
        autoSpaceAfter: completingAtEnd
      });
      const continuousRelationCompletions = () => makeCompletions(
        ["<", "<=", ">", ">=", "==", "!="].map(makeKeywordCompletion),
        { enforceOrder: true, autoSpaceAfter: completingAtEnd }
      );
      const customRelationCompletions = () => makeCompletions(
        ["<", "<=", ">", ">=", "==", "!=", "~="].map(makeKeywordCompletion),
        { enforceOrder: true, autoSpaceAfter: completingAtEnd }
      );
      const rhsCompletions = (options2) => makeCompletions(options2.map(makeLiteralCompletion));
      if (!prevToken(1)) return newExpressionCompletions();
      if (prevToken(1)?.text === ".") {
        const varName = prevToken(2)?.text;
        const metadataPath = buildMetadataPath(tokens, currentTokenIndex);
        if (metadataPath !== null && samples) {
          const metadataKeys = Array.from(
            getMetadataKeysForPath(samples, metadataPath)
          );
          const metadataCompletions = metadataKeys.map(makeMetadataKeyCompletion);
          return makeCompletions(metadataCompletions, {
            autocompleteInTheMiddle: true,
            includeDefault: false
          });
        } else if (varName) {
          return memberAccessCompletions(getMemberScoreItems(filterItems, varName));
        }
      }
      if (prevToken(1)?.text === "(") {
        if (prevToken(2)?.type === "mathFunction") return variableCompletions();
        if (prevToken(2)?.type === "sampleFunction") return noCompletions();
        return newExpressionCompletions();
      }
      if (prevToken(1)?.text === ")") return noCompletions();
      if (prevToken(1)?.type === "variable") {
        const varName = prevToken(1)?.text;
        if (isMetadataProperty(tokens, currentTokenIndex)) {
          return customRelationCompletions();
        }
        if (varName === kSampleIdVariable) {
          return discreteRelationCompletions();
        }
        if (varName === kSampleMetadataVariable) {
          return customRelationCompletions();
        }
        if (varName === "has_error" || varName === "has_retries") {
          return logicalOpCompletions();
        }
        const scoreType = findFilterItem(1)?.scoreType || "";
        switch (scoreType) {
          case kScoreTypePassFail:
          case kScoreTypeCategorical:
            return discreteRelationCompletions();
          case kScoreTypeNumeric:
            return continuousRelationCompletions();
          case kScoreTypeOther:
            return customRelationCompletions();
          case kScoreTypeBoolean:
            return logicalOpCompletions();
          default:
            return noCompletions();
        }
      }
      if (prevToken(1)?.type === "relation") {
        const varName = prevToken(2)?.text;
        const metadataPropertyPath = buildMetadataPropertyPath(
          tokens,
          currentTokenIndex
        );
        if (metadataPropertyPath !== null && samples) {
          const metadataValues = Array.from(
            getMetadataPropertyValues(samples, metadataPropertyPath)
          );
          const currentQuery = currentToken?.text || "";
          const filteredValues = currentQuery ? metadataValues.filter((value2) => {
            const label2 = typeof value2 === "string" ? `"${value2}"` : typeof value2 === "boolean" ? value2 ? "True" : "False" : value2 === null ? "None" : String(value2);
            return label2.toLowerCase().startsWith(currentQuery.toLowerCase());
          }) : metadataValues;
          const metadataValueCompletions = filteredValues.map(
            makeMetadataValueCompletion
          );
          return makeCompletions(metadataValueCompletions, {
            includeDefault: false
          });
        }
        if (varName === kSampleIdVariable && samples) {
          const sampleIds = Array.from(getSampleIds(samples));
          const currentQuery = currentToken?.text || "";
          const filteredIds = currentQuery ? sampleIds.filter((id) => {
            const label2 = typeof id === "string" ? `"${id}"` : String(id);
            return label2.toLowerCase().startsWith(currentQuery.toLowerCase());
          }) : sampleIds;
          const sampleIdCompletions = filteredIds.map(makeSampleIdCompletion);
          return makeCompletions(sampleIdCompletions, {
            includeDefault: false
          });
        }
        const item2 = findFilterItem(2);
        if (item2?.categories?.length) {
          return rhsCompletions(item2.categories);
        }
        return variableCompletions();
      }
      if (isLiteral(prevToken(1)) && prevToken(2)?.type === "relation") {
        return logicalOpCompletions();
      }
      if (isLogicalOp(prevToken(1))) return newExpressionCompletions();
      return noCompletions();
    }
    const label$4 = "_label_jbrqc_1";
    const input = "_input_jbrqc_7";
    const help = "_help_jbrqc_11";
    const styles$o = {
      label: label$4,
      input,
      help
    };
    const FILTER_TOOLTIP = `
Filter samples by:
  • Scores
  • Samples with errors: has_error
  • Input, target and error regex search: input_contains, target_contains, error_contains
  • Samples that have been retried: has_retries
  • Sample Id: e.g. "id == 'sample123'"
  • Sample metadata: e.g. "metadata.key == 'value'"

Supported expressions:
  • Arithmetic: +, -, *, /, mod, ^
  • Comparison: <, <=, >, >=, ==, !=, including chain comparisons, e.g. "10 <= x < 20"
  • Boolean: and, or, not
  • Regex matching: ~= (case-sensitive)
  • Set operations: in, not in; e.g. "x in (2, 3, 5)"
  • Functions: min, max, abs, round, floor, ceil, sqrt, log, log2, log10
`.trim();
    const highlightStyle = HighlightStyle$1.define([
      { tag: tags$2.string, class: "token string" },
      { tag: tags$2.number, class: "token number" },
      { tag: tags$2.keyword, class: "token keyword" }
    ]);
    const editorTheme = EditorView.theme({
      "&": {
        fontSize: "inherit",
        color: "var(--inspect-input-foreground)",
        backgroundColor: "var(--inspect-input-background)",
        border: "1px solid var(--inspect-input-border)",
        borderRadius: "var(--bs-border-radius)"
      },
      ".cm-cursor.cm-cursor-primary": {
        borderLeftColor: "var(--bs-body-color)"
      },
      ".cm-selectionBackground": {
        backgroundColor: "var(--inspect-inactive-selection-background)"
      },
      "&.cm-focused > .cm-scroller > .cm-selectionLayer > .cm-selectionBackground": {
        backgroundColor: "var(--inspect-active-selection-background)"
      },
      "&.cm-focused": {
        outline: "none",
        borderColor: "var(--inspect-focus-border-color)",
        boxShadow: "var(--inspect-focus-border-shadow)"
      },
      ".filter-pending > &.cm-focused": {
        borderColor: "var(--inspect-focus-border-gray-color)",
        boxShadow: "var(--inspect-focus-border-gray-shadow)"
      },
      ".cm-tooltip": {
        backgroundColor: "var(--bs-light)",
        border: "1px solid var(--bs-border-color)",
        color: "var(--bs-body-color)"
      },
      ".cm-tooltip.cm-tooltip-autocomplete > ul > li": {
        color: "var(--bs-body-color)"
      },
      ".cm-tooltip.cm-tooltip-autocomplete > ul > li[aria-selected]": {
        backgroundColor: "var(--inspect-active-selection-background)",
        color: "var(--bs-body-color)"
      },
      ".cm-scroller": {
        overflow: "hidden"
      },
      ".cm-line": {
        "font-size": "var(--inspect-font-size-smallest) !important"
      },
      ".token": {
        "font-size": "var(--inspect-font-size-smallest) !important"
      }
    });
    const ensureOneLine = (tr2) => {
      const newDoc = tr2.newDoc.toString();
      if (!newDoc.includes("\n")) return tr2;
      if (tr2.isUserEvent("input.paste")) {
        return {
          changes: {
            from: 0,
            to: tr2.startState.doc.length,
            insert: newDoc.replace(/\n/g, " ").trim()
          }
        };
      }
      return {};
    };
    const getLints = (view, filterError) => {
      if (!filterError) return [];
      return [
        {
          from: Math.min(filterError.from || 0, view.state.doc.length),
          to: Math.min(
            filterError.to || view.state.doc.length,
            view.state.doc.length
          ),
          severity: filterError.severity,
          message: filterError.message
        }
      ];
    };
    const SampleFilter = () => {
      const editorRef = reactExports.useRef(null);
      const editorViewRef = reactExports.useRef(null);
      const linterCompartment = reactExports.useRef(new Compartment());
      const autocompletionCompartment = reactExports.useRef(new Compartment());
      const updateListenerCompartment = reactExports.useRef(new Compartment());
      const evalDescriptor = useEvalDescriptor();
      const filterItems = reactExports.useMemo(
        () => evalDescriptor ? sampleFilterItems(evalDescriptor) : [],
        [evalDescriptor]
      );
      const filter = useStore((state) => state.log.filter);
      const filterError = useStore((state) => state.log.filterError);
      const samples = useStore(
        (state) => state.log.selectedLogDetails?.sampleSummaries
      );
      const setFilter = useStore((state) => state.logActions.setFilter);
      const handleFocus = reactExports.useCallback((event, view) => {
        if (event.isTrusted && view.state.doc.toString() === "") {
          setTimeout(() => startCompletion(view), 0);
        }
      }, []);
      const makeAutocompletion = reactExports.useCallback(
        () => autocompletion({
          override: [(context) => getCompletions(context, filterItems, samples)],
          activateOnCompletion: (c2) => c2.label.endsWith(" ")
        }),
        [filterItems, samples]
      );
      const makeLinter = reactExports.useCallback(
        () => linter((view) => getLints(view, filterError)),
        [filterError]
      );
      const debounceSetFilter = reactExports.useMemo(
        () => debounce$2((value2) => {
          setFilter(value2);
        }, 200),
        [setFilter]
      );
      const makeUpdateListener = reactExports.useCallback(
        () => EditorView.updateListener.of((update) => {
          if (update.docChanged && evalDescriptor) {
            const newValue = update.state.doc.toString();
            debounceSetFilter(newValue);
          }
        }),
        [debounceSetFilter, evalDescriptor]
      );
      reactExports.useEffect(() => {
        editorViewRef.current?.destroy();
        editorViewRef.current = new EditorView({
          parent: editorRef.current ?? void 0,
          state: EditorState.create({
            doc: filter || "",
            extensions: [
              minimalSetup,
              bracketMatching(),
              editorTheme,
              EditorState.transactionFilter.of(ensureOneLine),
              updateListenerCompartment.current.of(makeUpdateListener()),
              EditorView.domEventHandlers({ focus: handleFocus }),
              language,
              syntaxHighlighting$1(highlightStyle),
              autocompletionCompartment.current.of(makeAutocompletion()),
              linterCompartment.current.of(makeLinter())
            ]
          })
        });
        return () => editorViewRef.current?.destroy();
      }, []);
      reactExports.useEffect(() => {
        if (!editorViewRef.current) return;
        const currentValue = editorViewRef.current.state.doc.toString();
        if (filter === currentValue) return;
        editorViewRef.current.dispatch({
          changes: {
            from: 0,
            to: currentValue.length,
            insert: filter || ""
          }
        });
      }, [filter]);
      reactExports.useEffect(() => {
        editorViewRef.current?.dispatch({
          effects: updateListenerCompartment.current.reconfigure(makeUpdateListener())
        });
      }, [evalDescriptor, makeUpdateListener]);
      reactExports.useEffect(() => {
        editorViewRef.current?.dispatch({
          effects: autocompletionCompartment.current.reconfigure(makeAutocompletion())
        });
      }, [filterItems, makeAutocompletion, samples]);
      reactExports.useEffect(() => {
        editorViewRef.current?.dispatch({
          effects: linterCompartment.current.reconfigure(makeLinter())
        });
      }, [filterError, makeLinter]);
      return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: { display: "flex" }, children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          "span",
          {
            className: clsx(
              "sample-filter-label",
              "text-size-smaller",
              "text-style-label",
              "text-style-secondary",
              styles$o.label
            ),
            children: "Filter:"
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          "div",
          {
            ref: editorRef,
            className: clsx(filterError && "filter-pending", styles$o.input)
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          "span",
          {
            className: clsx("bi", "bi-question-circle", styles$o.help),
            "data-tooltip": FILTER_TOOLTIP,
            "data-tooltip-position": "bottom-left"
          }
        )
      ] });
    };
    const container$6 = "_container_uvlpz_1";
    const grid$3 = "_grid_uvlpz_5";
    const row$1 = "_row_uvlpz_12";
    const label$3 = "_label_uvlpz_26";
    const links = "_links_uvlpz_32";
    const selected$1 = "_selected_uvlpz_50";
    const bodyColorButton = "_bodyColorButton_uvlpz_54";
    const styles$n = {
      container: container$6,
      grid: grid$3,
      row: row$1,
      label: label$3,
      links,
      selected: selected$1,
      bodyColorButton
    };
    const SelectScorer = ({
      scores: scores2,
      selectedScores,
      setSelectedScores
    }) => {
      const [showing, setShowing] = reactExports.useState(false);
      const buttonRef = reactExports.useRef(null);
      const selectedKeys = reactExports.useMemo(() => {
        return new Set(selectedScores?.map((s) => `${s.scorer}.${s.name}`));
      }, [selectedScores]);
      const selectedCount = selectedKeys.size;
      const label2 = selectedCount === 0 ? "Score" : selectedCount === 1 ? selectedScores?.[0]?.name || "Score" : `${selectedCount} Scores`;
      const allScoresSelected = selectedCount === scores2.length;
      return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: { display: "flex" }, children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          "span",
          {
            className: clsx(
              "sample-filter-label",
              "text-size-smaller",
              "text-style-label",
              "text-style-secondary",
              styles$n.label
            ),
            children: "Scorers:"
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          ToolButton,
          {
            label: label2,
            icon: ApplicationIcons.metrics,
            onClick: () => setShowing(!showing),
            ref: buttonRef,
            className: clsx(styles$n.bodyColorButton)
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsxs(
          PopOver,
          {
            id: "score-selector-popover",
            positionEl: buttonRef.current,
            isOpen: showing,
            setIsOpen: setShowing,
            placement: "bottom-start",
            hoverDelay: -1,
            styles: {
              padding: "3px 5px"
            },
            children: [
              /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$n.links, "text-size-smaller"), children: [
                /* @__PURE__ */ jsxRuntimeExports.jsx(
                  "a",
                  {
                    className: clsx(
                      styles$n.link,
                      !allScoresSelected ? styles$n.selected : void 0
                    ),
                    onClick: () => {
                      if (scores2.length > 0) {
                        setSelectedScores([scores2[0]]);
                      }
                    },
                    children: "Default"
                  }
                ),
                "|",
                /* @__PURE__ */ jsxRuntimeExports.jsx(
                  "a",
                  {
                    className: clsx(
                      styles$n.link,
                      allScoresSelected ? styles$n.selected : void 0
                    ),
                    onClick: () => {
                      setSelectedScores(scores2);
                    },
                    children: "All"
                  }
                )
              ] }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$n.container, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
                ScoreCheckboxes,
                {
                  scores: scores2,
                  selectedKeys,
                  setSelectedScores
                }
              ) })
            ]
          }
        )
      ] });
    };
    const ScoreCheckboxes = ({
      scores: scores2,
      selectedKeys,
      setSelectedScores
    }) => {
      const handleToggle = reactExports.useCallback(
        (scoreToToggle, currentlyChecked) => {
          const key2 = `${scoreToToggle.scorer}.${scoreToToggle.name}`;
          const current2 = new Set(selectedKeys);
          if (currentlyChecked) {
            current2.delete(key2);
          } else {
            current2.add(key2);
          }
          const next = scores2.filter((s) => current2.has(`${s.scorer}.${s.name}`));
          setSelectedScores(next);
        },
        [setSelectedScores, scores2, selectedKeys]
      );
      return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$n.grid, "text-size-smaller"), children: scores2.map((sc2) => {
        const key2 = `${sc2.scorer}.${sc2.name}`;
        const isChecked = selectedKeys ? selectedKeys.has(key2) : false;
        return /* @__PURE__ */ jsxRuntimeExports.jsxs(
          "div",
          {
            className: clsx(styles$n.row),
            onClick: () => handleToggle(sc2, isChecked),
            children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx(
                "input",
                {
                  type: "checkbox",
                  checked: isChecked,
                  onChange: (e) => {
                    e.stopPropagation();
                    handleToggle(sc2, isChecked);
                  }
                }
              ),
              sc2.name
            ]
          },
          key2
        );
      }) });
    };
    const SampleTools = () => {
      const selectedLogDetails = useStore((state) => state.log.selectedLogDetails);
      const scores2 = useScores();
      const selectedScores = useSelectedScores();
      const setSelectedScores = useStore(
        (state) => state.logActions.setSelectedScores
      );
      const epoch = useStore((state) => state.log.epoch);
      const setEpoch = useStore((state) => state.logActions.setEpoch);
      const sort2 = useStore((state) => state.log.sort);
      const setSort = useStore((state) => state.logActions.setSort);
      const epochs = selectedLogDetails?.eval.config.epochs || 1;
      return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(SampleFilter, {}),
        scores2?.length > 1 ? /* @__PURE__ */ jsxRuntimeExports.jsx(
          SelectScorer,
          {
            scores: scores2,
            selectedScores,
            setSelectedScores
          }
        ) : void 0,
        epochs > 1 ? /* @__PURE__ */ jsxRuntimeExports.jsx(EpochFilter, { epoch, setEpoch, epochs }) : void 0,
        /* @__PURE__ */ jsxRuntimeExports.jsx(SortFilter, { sort: sort2, setSort, epochs })
      ] });
    };
    const ScoreFilterTools = () => {
      const scores2 = useScores();
      const selectedScores = useSelectedScores();
      const setSelectedScores = useStore(
        (state) => state.logActions.setSelectedScores
      );
      if (scores2.length <= 1) {
        return void 0;
      }
      return /* @__PURE__ */ jsxRuntimeExports.jsx(
        SelectScorer,
        {
          scores: scores2,
          selectedScores,
          setSelectedScores
        }
      );
    };
    const kBaseFontSize = 0.9;
    const ScaleBaseFont = (scale) => {
      return `${kBaseFontSize + scale}rem`;
    };
    const FontSize = {
      smaller: ScaleBaseFont(-0.1)
    };
    const TextStyle = {
      secondary: {
        color: "var(--bs-secondary)"
      }
    };
    const ApplicationStyles = {
      moreButton: {
        maxHeight: "1.8em",
        fontSize: FontSize.smaller,
        padding: "0 0.2em 0 0.2em",
        ...TextStyle.secondary
      },
      threeLineClamp: {
        display: "-webkit-box",
        WebkitLineClamp: "3",
        WebkitBoxOrient: "vertical",
        overflow: "hidden"
      },
      lineClamp: (len) => {
        return {
          display: "-webkit-box",
          WebkitLineClamp: `${len}`,
          WebkitBoxOrient: "vertical",
          overflow: "hidden"
        };
      },
      wrapText: () => {
        return {
          whiteSpace: "nowrap",
          textOverflow: "ellipsis",
          overflow: "hidden"
        };
      },
      scoreFills: {
        green: {
          backgroundColor: "var(--bs-success)",
          borderColor: "var(--bs-success)",
          color: "var(--bs-body-bg)"
        },
        red: {
          backgroundColor: "var(--bs-danger)",
          borderColor: "var(--bs-danger)",
          color: "var(--bs-body-bg)"
        },
        orange: {
          backgroundColor: "var(--bs-orange)",
          borderColor: "var(--bs-orange)",
          color: "var(--bs-body-bg)"
        }
      }
    };
    const body$1 = "_body_12gn4_1";
    const iconSmall = "_iconSmall_12gn4_9";
    const message = "_message_12gn4_15";
    const styles$m = {
      body: body$1,
      iconSmall,
      message
    };
    const SampleErrorView = ({
      message: message2,
      align
    }) => {
      align = align || "center";
      return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$m.body, children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: clsx(ApplicationIcons.error, styles$m.iconSmall) }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$m.message, style: ApplicationStyles.lineClamp(2), children: errorType(message2) })
      ] });
    };
    const grid$2 = "_grid_1213u_1";
    const selected = "_selected_1213u_11";
    const sampleLink = "_sampleLink_1213u_15";
    const disabledRow = "_disabledRow_1213u_34";
    const disabled$1 = "_disabled_1213u_34";
    const cell = "_cell_1213u_44";
    const wrapAnywhere = "_wrapAnywhere_1213u_49";
    const noLeft = "_noLeft_1213u_53";
    const score = "_score_1213u_57";
    const centered = "_centered_1213u_62";
    const styles$l = {
      grid: grid$2,
      selected,
      sampleLink,
      disabledRow,
      disabled: disabled$1,
      cell,
      wrapAnywhere,
      noLeft,
      score,
      centered
    };
    const kMaxRowTextSize = 1024 * 5;
    const SampleRow = ({
      id,
      sample: sample2,
      answer: answer2,
      completed,
      scoresRendered,
      gridColumnsTemplate,
      height,
      selected: selected2,
      showSample,
      sampleUrl
    }) => {
      const streamSampleData = useStore(
        (state) => state.capabilities.streamSampleData
      );
      const isViewable = completed || streamSampleData;
      const showingSampleDialog = useStore((state) => state.app.dialogs.sample);
      if (!completed && scoresRendered.length === 0 && Object.keys(sample2.scores || {}).length === 0) {
        scoresRendered = [null];
      }
      const scoreColumnContent = scoresRendered.map((scoreRendered, i2) => {
        if (!showingSampleDialog && sample2.error) {
          return /* @__PURE__ */ jsxRuntimeExports.jsx(SampleErrorView, { message: sample2.error });
        } else if (completed) {
          return scoreRendered;
        } else if (i2 === scoresRendered.length - 1) {
          return /* @__PURE__ */ jsxRuntimeExports.jsx(PulsingDots, { subtle: false });
        } else {
          return void 0;
        }
      });
      const rowContent = /* @__PURE__ */ jsxRuntimeExports.jsxs(
        "div",
        {
          id: `sample-${id}`,
          className: clsx(
            styles$l.grid,
            "text-size-base",
            selected2 ? styles$l.selected : void 0,
            !isViewable && !sampleUrl ? styles$l.disabled : void 0
          ),
          style: {
            height: `${height}px`,
            gridTemplateRows: `${height - 28}px`,
            gridTemplateColumns: gridColumnsTemplate
          },
          children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx("sample-id", "three-line-clamp", styles$l.cell), children: !showingSampleDialog ? sample2.id : void 0 }),
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              "div",
              {
                className: clsx(
                  "sample-input",
                  "three-line-clamp",
                  styles$l.cell,
                  styles$l.wrapAnywhere
                ),
                children: !showingSampleDialog ? /* @__PURE__ */ jsxRuntimeExports.jsx(
                  RenderedText,
                  {
                    markdown: inputString(sample2.input).join(" ").slice(0, kMaxRowTextSize),
                    forceRender: true,
                    omitMedia: true
                  }
                ) : void 0
              }
            ),
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx("sample-target", "three-line-clamp", styles$l.cell), children: sample2?.target && !showingSampleDialog ? /* @__PURE__ */ jsxRuntimeExports.jsx(
              RenderedText,
              {
                markdown: arrayToString(sample2.target).slice(0, kMaxRowTextSize),
                className: clsx("no-last-para-padding", styles$l.noLeft),
                forceRender: true,
                omitMedia: true
              }
            ) : void 0 }),
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx("sample-answer", "three-line-clamp", styles$l.cell), children: sample2 && !showingSampleDialog ? /* @__PURE__ */ jsxRuntimeExports.jsx(
              RenderedText,
              {
                markdown: (answer2 || "").slice(0, kMaxRowTextSize),
                className: clsx("no-last-para-padding", styles$l.noLeft),
                forceRender: true,
                omitMedia: true
              }
            ) : "" }),
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              "div",
              {
                className: clsx(
                  "sample-limit",
                  "text-size-small",
                  "three-line-clamp",
                  styles$l.cell
                ),
                children: !showingSampleDialog ? sample2.limit : void 0
              }
            ),
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              "div",
              {
                className: clsx(
                  "sample-retries",
                  "text-size-small",
                  "three-line-clamp",
                  styles$l.cell,
                  styles$l.centered
                ),
                children: !showingSampleDialog && sample2.retries && sample2.retries > 0 ? sample2.retries : void 0
              }
            ),
            scoreColumnContent.map((scoreColumnContent2, i2) => /* @__PURE__ */ jsxRuntimeExports.jsx(
              "div",
              {
                className: clsx("text-size-small", styles$l.cell, styles$l.score),
                children: scoreColumnContent2
              },
              `score-${i2}`
            ))
          ]
        }
      );
      if (!sampleUrl || !isViewable) {
        return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$l.disabledRow, children: rowContent });
      }
      if (isVscode()) {
        return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { onClick: showSample, className: styles$l.sampleLink, children: rowContent });
      }
      return /* @__PURE__ */ jsxRuntimeExports.jsx("a", { href: sampleUrl, className: styles$l.sampleLink, children: rowContent });
    };
    const row = "_row_utdq5_1";
    const styles$k = {
      row
    };
    const SampleSeparator = ({
      id,
      title: title2,
      height
    }) => {
      return /* @__PURE__ */ jsxRuntimeExports.jsx(
        "div",
        {
          id,
          className: clsx("text-style-secondary", "text-size-smaller", styles$k.row),
          style: { height: `${height}px` },
          children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: title2 })
        }
      );
    };
    const footer = "_footer_vkofn_1";
    const spinnerContainer = "_spinnerContainer_vkofn_11";
    const spinner$1 = "_spinner_vkofn_11";
    const label$2 = "_label_vkofn_25";
    const styles$j = {
      footer,
      spinnerContainer,
      spinner: spinner$1,
      label: label$2
    };
    const SampleFooter = ({
      sampleCount,
      totalSampleCount,
      running
    }) => {
      return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx("text-size-smaller", styles$j.footer), children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: running ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$j.spinnerContainer), children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "div",
            {
              className: clsx("spinner-border", styles$j.spinner),
              role: "status",
              children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: clsx("visually-hidden"), children: "Running..." })
            }
          ),
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx("text-style-secondary", styles$j.label), children: "running..." })
        ] }) : void 0 }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: sampleCount < totalSampleCount ? `${sampleCount} / ${totalSampleCount} Samples` : `${sampleCount} Samples` })
      ] });
    };
    const header$1 = "_header_1qnb6_1";
    const center = "_center_1qnb6_9";
    const shrinkable = "_shrinkable_1qnb6_13";
    const styles$i = {
      header: header$1,
      center,
      shrinkable
    };
    const SampleHeader = ({
      input: input2 = true,
      target: target2 = true,
      answer: answer2 = true,
      limit = true,
      retries = false,
      scoreLabels = ["Score"],
      gridColumnsTemplate
    }) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
      "div",
      {
        className: clsx(
          styles$i.header,
          "text-size-smallestest",
          "text-style-label",
          "text-style-secondary"
        ),
        style: { gridTemplateColumns: gridColumnsTemplate },
        children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Id" }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: input2 ? "Input" : "" }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: target2 ? "Target" : "" }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: answer2 ? "Answer" : "" }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: limit ? "Limit" : "" }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: retries ? "Retries" : "" }),
          scoreLabels.map((label2, i2) => /* @__PURE__ */ jsxRuntimeExports.jsx(
            "div",
            {
              className: clsx(styles$i.center, styles$i.shrinkable),
              children: label2
            },
            `score-header-${i2}`
          ))
        ]
      }
    );
    const mainLayout = "_mainLayout_q79zq_7";
    const styles$h = {
      mainLayout
    };
    const kSampleHeight = 88;
    const kSeparatorHeight = 24;
    const kSampleFollowProp = "sample-list";
    const SampleList = reactExports.memo((props) => {
      const {
        items,
        earlyStopping,
        totalItemCount,
        running,
        className: className2,
        listHandle
      } = props;
      const selectedLogFile = useStore((state) => state.logs.selectedLogFile);
      const { getRestoreState, isScrolling } = useVirtuosoState(
        listHandle,
        `sample-list-${selectedLogFile}`
      );
      reactExports.useEffect(() => {
        listHandle.current?.scrollTo({ top: 0, behavior: "instant" });
      }, [listHandle, selectedLogFile]);
      const sampleNavigation = useSampleNavigation();
      const selectedSampleHandle = useStore(
        (state) => state.log.selectedSampleHandle
      );
      const samplesDescriptor = useSampleDescriptor();
      const [followOutput, setFollowOutput] = useProperty(
        kSampleFollowProp,
        "follow",
        {
          defaultValue: !!running
        }
      );
      const evalSpec = useStore((state) => state.log.selectedLogDetails?.eval);
      const { setDocumentTitle } = useDocumentTitle();
      reactExports.useEffect(() => {
        setDocumentTitle({ evalSpec });
      }, [setDocumentTitle, evalSpec]);
      const prevRunningRef = reactExports.useRef(running);
      reactExports.useEffect(() => {
        if (!running && prevRunningRef.current && followOutput && listHandle.current) {
          setFollowOutput(false);
          setTimeout(() => {
            if (listHandle.current) {
              listHandle.current.scrollTo({ top: 0, behavior: "instant" });
            }
          }, 100);
        }
        prevRunningRef.current = running;
      }, [running, followOutput, listHandle, setFollowOutput]);
      const loaded = reactExports.useRef(false);
      const handleAtBottomStateChange = reactExports.useCallback(
        (atBottom) => {
          if (loaded.current && running) {
            setFollowOutput(atBottom);
          }
          loaded.current = true;
        },
        [running, setFollowOutput]
      );
      const onkeydown = reactExports.useCallback(
        (e) => {
          switch (e.key) {
            case "ArrowUp":
              if (e.metaKey || e.ctrlKey) {
                sampleNavigation.firstSample();
                listHandle.current?.scrollToIndex({
                  index: 0,
                  align: "start",
                  behavior: "auto"
                });
              } else {
                sampleNavigation.previousSample();
              }
              e.preventDefault();
              e.stopPropagation();
              break;
            case "ArrowDown":
              if (e.metaKey || e.ctrlKey) {
                sampleNavigation.lastSample();
                listHandle.current?.scrollToIndex({
                  index: items.length - 1,
                  align: "end",
                  behavior: "auto"
                });
              } else {
                sampleNavigation.nextSample();
              }
              e.preventDefault();
              e.stopPropagation();
              break;
            case "Enter": {
              const item2 = items.find((item22) => {
                if (item22.type === "sample") {
                  return sampleIdsEqual(item22.sampleId, selectedSampleHandle?.id) && item22.sampleEpoch === selectedSampleHandle?.epoch;
                }
              });
              if (item2 && item2.type === "sample") {
                sampleNavigation.showSample(item2.data.id, item2.data.epoch);
                e.preventDefault();
                e.stopPropagation();
              }
              break;
            }
          }
        },
        [
          sampleNavigation,
          listHandle,
          items,
          selectedSampleHandle?.id,
          selectedSampleHandle?.epoch
        ]
      );
      const selectedScores = useSelectedScores();
      const scores2 = useScores();
      const gridColumnsTemplate = reactExports.useMemo(() => {
        return gridColumnsValue(samplesDescriptor);
      }, [samplesDescriptor]);
      const renderRow = reactExports.useCallback(
        (_index, item2) => {
          if (item2.type === "sample") {
            return /* @__PURE__ */ jsxRuntimeExports.jsx(
              SampleRow,
              {
                id: `${item2.number}`,
                sample: item2.data,
                height: kSampleHeight,
                answer: item2.answer,
                completed: item2.completed,
                scoresRendered: item2.scoresRendered,
                gridColumnsTemplate,
                sampleUrl: sampleNavigation.getSampleUrl(
                  item2.data.id,
                  item2.data.epoch
                ),
                selected: sampleIdsEqual(selectedSampleHandle?.id, item2.sampleId) && selectedSampleHandle?.epoch === item2.sampleEpoch,
                showSample: () => {
                  sampleNavigation.showSample(item2.data.id, item2.data.epoch);
                }
              }
            );
          } else if (item2.type === "separator") {
            return /* @__PURE__ */ jsxRuntimeExports.jsx(
              SampleSeparator,
              {
                id: `sample-group${item2.number}`,
                title: item2.data,
                height: kSeparatorHeight
              }
            );
          } else {
            return null;
          }
        },
        [
          gridColumnsTemplate,
          sampleNavigation,
          selectedSampleHandle?.epoch,
          selectedSampleHandle?.id
        ]
      );
      const { input: input2, limit, answer: answer2, target: target2, retries } = gridColumns(samplesDescriptor);
      const sampleCount = items?.reduce((prev, current2) => {
        if (current2.type === "sample") {
          return prev + 1;
        } else {
          return prev;
        }
      }, 0);
      const errorCount = items?.reduce((previous, item2) => {
        if (typeof item2.data === "object" && item2.data.error) {
          return previous + 1;
        }
        return previous;
      }, 0);
      const limitCount = items?.reduce((previous, item2) => {
        if (typeof item2.data === "object" && item2.data.limit) {
          return previous + 1;
        } else {
          return previous;
        }
      }, 0);
      const percentError = errorCount / sampleCount * 100;
      const percentLimit = limitCount / sampleCount * 100;
      const warnings = [];
      if (errorCount > 0) {
        warnings.push({
          type: "info",
          msg: `INFO: ${errorCount} of ${sampleCount} samples (${formatNoDecimal(percentError)}%) had errors and were not scored.`
        });
      }
      if (limitCount > 0) {
        warnings.push({
          type: "info",
          msg: `INFO: ${limitCount} of ${sampleCount} samples (${formatNoDecimal(percentLimit)}%) completed due to exceeding a limit.`
        });
      }
      if (earlyStopping?.early_stops && earlyStopping?.early_stops?.length > 0) {
        warnings.push({
          type: "info",
          msg: `Skipped ${earlyStopping.early_stops.length} samples due to early stopping (${earlyStopping.manager}). `
        });
      }
      return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$h.mainLayout, children: [
        warnings.map((warning2, index) => /* @__PURE__ */ jsxRuntimeExports.jsx(
          MessageBand,
          {
            id: `sample-warning-message-${index}`,
            message: warning2.msg,
            type: warning2.type
          },
          `sample-warning-message-${index}`
        )),
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          SampleHeader,
          {
            input: input2 !== "0",
            target: target2 !== "0",
            answer: answer2 !== "0",
            limit: limit !== "0",
            retries: retries !== "0em",
            scoreLabels: scoreHeaders(selectedScores, scores2),
            gridColumnsTemplate
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          Yr,
          {
            ref: listHandle,
            style: { height: "100%" },
            data: items,
            defaultItemHeight: 50,
            itemContent: renderRow,
            followOutput: running ? (_atBottom) => {
              return followOutput;
            } : void 0,
            atBottomStateChange: handleAtBottomStateChange,
            atBottomThreshold: 30,
            increaseViewportBy: { top: 300, bottom: 300 },
            overscan: {
              main: 10,
              reverse: 10
            },
            className: clsx(className2, "samples-list"),
            onKeyDown: onkeydown,
            skipAnimationFrameInResizeObserver: true,
            isScrolling,
            restoreStateFrom: getRestoreState(),
            tabIndex: 0
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          SampleFooter,
          {
            sampleCount,
            totalSampleCount: totalItemCount,
            running
          }
        )
      ] });
    });
    const gridColumnsValue = (sampleDescriptor) => {
      const { input: input2, target: target2, answer: answer2, limit, retries, id, scores: scores2 } = gridColumns(sampleDescriptor);
      const result2 = `${id} ${input2} ${target2} ${answer2} ${limit} ${retries} ${scores2.join(" ")}`;
      return result2;
    };
    const gridColumns = (sampleDescriptor) => {
      const input2 = sampleDescriptor && sampleDescriptor.messageShape.normalized.input > 0 ? Math.max(0.15, sampleDescriptor.messageShape.normalized.input) : 0;
      const target2 = sampleDescriptor && sampleDescriptor.messageShape.normalized.target > 0 ? Math.max(0.15, sampleDescriptor.messageShape.normalized.target) : 0;
      const answer2 = sampleDescriptor && sampleDescriptor.messageShape.normalized.answer > 0 ? Math.max(0.15, sampleDescriptor.messageShape.normalized.answer) : 0;
      const limit = sampleDescriptor && sampleDescriptor.messageShape.normalized.limit > 0 ? Math.max(0.15, sampleDescriptor.messageShape.normalized.limit) : 0;
      const retries = sampleDescriptor && sampleDescriptor.messageShape.normalized.retries > 0 ? 4 : 0;
      const id = Math.max(
        2,
        Math.min(10, sampleDescriptor?.messageShape.raw.id || 0)
      );
      const scoresRaw = sampleDescriptor?.messageShape.raw.scores || [];
      const scoreSizes = scoresRaw.map((size) => Math.max(3, size));
      const scores2 = scoreSizes.length > 0 ? scoreSizes.map((size) => `${size / 2}rem`) : [];
      const frSize = (val) => {
        if (val === 0) {
          return "0";
        } else {
          return `${val}fr`;
        }
      };
      return {
        input: frSize(input2),
        target: frSize(target2),
        answer: frSize(answer2),
        limit: frSize(limit),
        retries: `${retries}em`,
        id: `${id}rem`,
        scores: scores2
      };
    };
    const scoreHeaders = (selectedScores, availableScores) => {
      if (!selectedScores || selectedScores.length === 0) {
        return [];
      }
      if (availableScores && availableScores.length === 1) {
        return ["Score"];
      }
      return selectedScores.map((s) => s.name);
    };
    const panel$3 = "_panel_1yknn_1";
    const container$5 = "_container_1yknn_7";
    const spinner = "_spinner_1yknn_14";
    const text = "_text_1yknn_20";
    const styles$g = {
      panel: panel$3,
      container: container$5,
      spinner,
      text
    };
    const RunningNoSamples = () => {
      return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$g.panel), children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$g.container, "text-size-smaller"), children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$g.spinner, "spinner-border"), role: "status", children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: clsx("visually-hidden"), children: "starting..." }) }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$g.text), children: "starting...." })
      ] }) });
    };
    const getSampleProcessor = (samples, epochs, groupBy, groupByOrder, sampleDescriptor, selectedScores) => {
      selectedScores = selectedScores || [];
      if (groupBy == "epoch") {
        return groupByEpoch(
          samples,
          epochs,
          sampleDescriptor,
          groupByOrder,
          selectedScores
        );
      } else if (groupBy === "sample") {
        return groupBySample(
          samples,
          epochs,
          sampleDescriptor,
          groupByOrder,
          selectedScores
        );
      } else {
        return noGrouping(samples, groupByOrder, sampleDescriptor, selectedScores);
      }
    };
    const noGrouping = (samples, order2, sampleDescriptor, selectedScores) => {
      const counter2 = getCounter(samples.length, 1, order2);
      return (sample2, index) => {
        counter2.incrementItem();
        const itemCount = counter2.item();
        return [
          {
            sampleId: sample2.id,
            sampleEpoch: sample2.epoch,
            label: `Sample ${sample2.id}`,
            number: itemCount,
            index,
            data: sample2,
            type: "sample",
            answer: sampleDescriptor.selectedScorerDescriptor(sample2)?.answer() || "",
            scoresRendered: selectedScores.map(
              (sc2) => sampleDescriptor.evalDescriptor.score(sample2, sc2)?.render()
            ),
            completed: sample2.completed !== void 0 ? sample2.completed : true
          }
        ];
      };
    };
    const groupBySample = (samples, epochs, sampleDescriptor, order2, selectedScores) => {
      samples = samples.sort((a, b) => {
        if (typeof a.id === "string") {
          if (order2 === "asc") {
            return String(a.id).localeCompare(String(b.id));
          } else {
            return String(b.id).localeCompare(String(a.id));
          }
        } else {
          if (order2 === "asc") {
            return Number(a.id) - Number(b.id);
          } else {
            return Number(b.id) - Number(b.id);
          }
        }
      });
      const groupCount = samples.length / epochs;
      const itemCount = samples.length / groupCount;
      const counter2 = getCounter(itemCount, groupCount, order2);
      return (sample2, index, previousSample) => {
        const results = [];
        const lastId = previousSample ? previousSample.id : void 0;
        if (sample2.id !== lastId) {
          counter2.incrementGroup();
          results.push({
            label: `Sample ${sample2.id}`,
            number: counter2.group(),
            index,
            data: `Sample ${sample2.id}`,
            type: "separator"
          });
          counter2.resetItem();
        }
        counter2.incrementItem();
        results.push({
          sampleId: sample2.id,
          sampleEpoch: sample2.epoch,
          label: `Sample ${counter2.group()} (Epoch ${counter2.item()})`,
          number: counter2.item(),
          index,
          data: sample2,
          type: "sample",
          answer: sampleDescriptor.selectedScorerDescriptor(sample2)?.answer() || "",
          scoresRendered: selectedScores.map(
            (sc2) => sampleDescriptor.evalDescriptor.score(sample2, sc2)?.render()
          ),
          completed: sample2.completed !== void 0 ? sample2.completed : true
        });
        return results;
      };
    };
    const groupByEpoch = (samples, epochs, sampleDescriptor, order2, selectedScores) => {
      const groupCount = epochs;
      const itemCount = samples.length / groupCount;
      const counter2 = getCounter(itemCount, groupCount, order2);
      return (sample2, index, previousSample) => {
        const results = [];
        const lastEpoch = previousSample ? previousSample.epoch : -1;
        if (lastEpoch !== sample2.epoch) {
          counter2.incrementGroup();
          results.push({
            label: `Epoch ${counter2.group()}`,
            number: counter2.group(),
            index,
            data: `Epoch ${counter2.group()}`,
            type: "separator"
          });
          counter2.resetItem();
        }
        counter2.incrementItem();
        results.push({
          sampleId: sample2.id,
          sampleEpoch: sample2.epoch,
          label: `Sample ${sample2.id} (Epoch ${sample2.epoch})`,
          number: counter2.item(),
          index,
          data: sample2,
          type: "sample",
          answer: sampleDescriptor.selectedScorerDescriptor(sample2)?.answer() || "",
          scoresRendered: selectedScores.map(
            (sc2) => sampleDescriptor.evalDescriptor.score(sample2, sc2)?.render()
          ),
          completed: sample2.completed !== void 0 ? sample2.completed : true
        });
        return results;
      };
    };
    const getCounter = (itemCount, groupCount, order2) => {
      let itemIndex = order2 !== "desc" ? 0 : itemCount + 1;
      let groupIndex = order2 !== "desc" ? 0 : groupCount + 1;
      return {
        resetItem: () => {
          itemIndex = order2 !== "desc" ? 0 : itemCount + 1;
        },
        incrementItem: () => {
          if (order2 !== "desc") {
            itemIndex++;
          } else {
            itemIndex--;
          }
        },
        incrementGroup: () => {
          if (order2 !== "desc") {
            groupIndex++;
          } else {
            groupIndex--;
          }
        },
        item: () => {
          return itemIndex;
        },
        group: () => {
          return groupIndex;
        }
      };
    };
    const useSamplesTabConfig = (evalStatus, refreshLog) => {
      const totalSampleCount = useTotalSampleCount();
      const samplesDescriptor = useSampleDescriptor();
      const streamSamples = useStore((state) => state.capabilities.streamSamples);
      return reactExports.useMemo(() => {
        return {
          id: kLogViewSamplesTabId,
          scrollable: false,
          label: totalSampleCount > 1 ? "Samples" : "Sample",
          component: SamplesTab,
          componentProps: {
            running: evalStatus === "started"
          },
          tools: () => !samplesDescriptor ? void 0 : totalSampleCount === 1 ? [/* @__PURE__ */ jsxRuntimeExports.jsx(ScoreFilterTools, {}, "sample-score-tool")] : [
            /* @__PURE__ */ jsxRuntimeExports.jsx(SampleTools, {}, "sample-tools"),
            evalStatus === "started" && !streamSamples && /* @__PURE__ */ jsxRuntimeExports.jsx(
              ToolButton,
              {
                label: "Refresh",
                icon: ApplicationIcons.refresh,
                onClick: refreshLog
              },
              "refresh"
            )
          ]
        };
      }, [
        evalStatus,
        refreshLog,
        samplesDescriptor,
        streamSamples,
        totalSampleCount
      ]);
    };
    const SamplesTab = ({ running }) => {
      const selectedSampleHandle = useStore(
        (state) => state.log.selectedSampleHandle
      );
      const sampleSummaries = useFilteredSamples();
      const selectedLogDetails = useStore((state) => state.log.selectedLogDetails);
      const evalSampleCount = reactExports.useMemo(() => {
        const limit = selectedLogDetails?.eval.config.limit;
        const limitCount = limit === null || limit === void 0 ? void 0 : typeof limit === "number" ? limit : limit[1] - limit[0];
        return (limitCount || selectedLogDetails?.eval.dataset.samples || 0) * (selectedLogDetails?.eval.config.epochs || 0);
      }, [
        selectedLogDetails?.eval.config.epochs,
        selectedLogDetails?.eval.config.limit,
        selectedLogDetails?.eval.dataset.samples
      ]);
      const totalSampleCount = useTotalSampleCount();
      const samplesDescriptor = useSampleDescriptor();
      const groupBy = useGroupBy();
      const groupByOrder = useGroupByOrder();
      const selectedScores = useSelectedScores();
      const selectSample = useStore((state) => state.logActions.selectSample);
      const sampleStatus = useStore((state) => state.sample.sampleStatus);
      const sampleListHandle = reactExports.useRef(null);
      const sampleProcessor = reactExports.useMemo(() => {
        if (!samplesDescriptor) return void 0;
        return getSampleProcessor(
          sampleSummaries || [],
          selectedLogDetails?.eval?.config?.epochs || 1,
          groupBy,
          groupByOrder,
          samplesDescriptor,
          selectedScores
        );
      }, [
        samplesDescriptor,
        sampleSummaries,
        selectedLogDetails?.eval?.config?.epochs,
        groupBy,
        groupByOrder,
        selectedScores
      ]);
      const items = reactExports.useMemo(() => {
        const resolvedSamples = sampleSummaries?.flatMap((sample2, index) => {
          const results = [];
          const previousSample = index !== 0 ? sampleSummaries[index - 1] : void 0;
          const items2 = sampleProcessor ? sampleProcessor(sample2, index, previousSample) : [];
          results.push(...items2);
          return results;
        });
        return resolvedSamples || [];
      }, [sampleSummaries, sampleProcessor]);
      const selectedItemIndex = reactExports.useMemo(() => {
        return items.findIndex((item2) => {
          if (item2.type !== "sample") {
            return false;
          }
          return sampleIdsEqual(item2.sampleId, selectedSampleHandle?.id) && item2.sampleEpoch === selectedSampleHandle?.epoch;
        });
      }, [selectedSampleHandle, items]);
      reactExports.useEffect(() => {
        setTimeout(() => {
          if (sampleListHandle.current && selectedItemIndex >= 0) {
            sampleListHandle.current.scrollIntoView({
              index: selectedItemIndex
            });
          }
        }, 0);
      }, [selectedItemIndex]);
      const showingSampleDialog = useStore((state) => state.app.dialogs.sample);
      const previousShowingDialogRef = reactExports.useRef(showingSampleDialog);
      reactExports.useEffect(() => {
        if (previousShowingDialogRef.current && !showingSampleDialog && sampleListHandle.current) {
          setTimeout(() => {
            const element = document.querySelector(".samples-list");
            if (element instanceof HTMLElement) {
              element.focus();
            }
          }, 10);
        }
        previousShowingDialogRef.current = showingSampleDialog;
      }, [showingSampleDialog]);
      reactExports.useEffect(() => {
        if (sampleSummaries.length === 1) {
          const sample2 = sampleSummaries[0];
          selectSample(sample2.id, sample2.epoch);
        }
      }, [sampleSummaries, selectSample]);
      const title2 = reactExports.useMemo(() => {
        if (selectedSampleHandle) {
          return `Sample ${selectedSampleHandle.id} (Epoch ${selectedSampleHandle.epoch})`;
        }
        return "";
      }, [selectedSampleHandle]);
      if (totalSampleCount === 0) {
        if (running) {
          return /* @__PURE__ */ jsxRuntimeExports.jsx(RunningNoSamples, {});
        } else {
          return /* @__PURE__ */ jsxRuntimeExports.jsx(NoContentsPanel, { text: "No samples" });
        }
      } else {
        return /* @__PURE__ */ jsxRuntimeExports.jsxs(reactExports.Fragment, { children: [
          samplesDescriptor && totalSampleCount === 1 ? /* @__PURE__ */ jsxRuntimeExports.jsx(InlineSampleDisplay, { showActivity: sampleStatus === "loading" }) : void 0,
          samplesDescriptor && totalSampleCount > 1 ? /* @__PURE__ */ jsxRuntimeExports.jsx(
            SampleList,
            {
              listHandle: sampleListHandle,
              items,
              earlyStopping: selectedLogDetails?.results?.early_stopping,
              totalItemCount: evalSampleCount,
              running
            }
          ) : void 0,
          showingSampleDialog && /* @__PURE__ */ jsxRuntimeExports.jsx(
            SampleDialog,
            {
              id: selectedSampleHandle ? `${selectedSampleHandle.id}_${selectedSampleHandle.epoch}` : "",
              title: title2,
              showingSampleDialog
            }
          )
        ] });
      }
    };
    const ghCommitUrl = (origin, commit) => {
      const baseUrl2 = origin.replace(/\.git$/, "").replace(/^git@github.com:/, "https://github.com/");
      return `${baseUrl2}/commit/${commit}`;
    };
    const grid$1 = "_grid_er9fb_1";
    const styles$f = {
      grid: grid$1
    };
    const useTaskTabConfig = (evalSpec, evalStats, earlyStopping) => {
      return reactExports.useMemo(() => {
        return {
          id: kLogViewTaskTabId,
          label: "Task",
          scrollable: true,
          component: TaskTab,
          componentProps: {
            evalSpec,
            evalStats,
            earlyStopping
          }
        };
      }, [evalSpec, evalStats, earlyStopping]);
    };
    const TaskTab = ({
      evalSpec,
      evalStats,
      earlyStopping
    }) => {
      Object.entries(evalSpec?.config || {}).forEach((entry) => {
        entry[0];
        entry[1];
      });
      const revision = evalSpec?.revision;
      const packages = evalSpec?.packages;
      const taskInformation = {
        ["Task ID"]: evalSpec?.task_id,
        ["Run ID"]: evalSpec?.run_id
      };
      if (revision) {
        taskInformation[`${revision.type ? `${toTitleCase(revision.type)} ` : ""}Revision`] = {
          _html: /* @__PURE__ */ jsxRuntimeExports.jsx("a", { href: ghCommitUrl(revision.origin, revision.commit), children: revision.commit })
        };
      }
      if (packages) {
        const names = Object.keys(packages).map((key2) => {
          return `${key2} ${packages[key2]}`;
        });
        if (names.length === 1) {
          taskInformation["Inspect"] = names[0];
        } else {
          taskInformation["Inspect"] = names;
        }
      }
      if (evalSpec?.tags) {
        taskInformation["tags"] = evalSpec?.tags.join(", ");
      }
      if (evalSpec?.sandbox) {
        if (Array.isArray(evalSpec?.sandbox)) {
          taskInformation["sandbox"] = evalSpec.sandbox[0];
          if (evalSpec.sandbox[1]) {
            taskInformation["sandbox_config"] = evalSpec.sandbox[1];
          }
        } else {
          taskInformation["sandbox"] = evalSpec?.sandbox.type;
          taskInformation["sandbox_config"] = evalSpec?.sandbox.config;
        }
      }
      const totalDuration = formatDuration(
        new Date(evalStats?.started_at || 0),
        new Date(evalStats?.completed_at || 0)
      );
      const task_args = evalSpec?.task_args || {};
      return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { width: "100%" }, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: { padding: "0.5em 1em 0 1em", width: "100%" }, children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs(Card, { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(CardHeader, { label: "Task Info" }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(CardBody, { id: "task-card-config", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$f.grid), children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              MetaDataGrid,
              {
                className: "text-size-small",
                entries: taskInformation
              },
              `plan-md-task`
            ),
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              MetaDataGrid,
              {
                entries: {
                  ["Start"]: new Date(
                    evalStats?.started_at || 0
                  ).toLocaleString(),
                  ["End"]: new Date(
                    evalStats?.completed_at || 0
                  ).toLocaleString(),
                  ["Duration"]: totalDuration
                }
              }
            )
          ] }) })
        ] }),
        earlyStopping && /* @__PURE__ */ jsxRuntimeExports.jsxs(Card, { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            CardHeader,
            {
              label: `Early Stopping (${earlyStopping.manager} — ${formatNumber(earlyStopping.early_stops.length)} skipped)`
            }
          ),
          /* @__PURE__ */ jsxRuntimeExports.jsx(CardBody, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
            RecordTree,
            {
              id: `early-stopping-metadata`,
              record: earlyStopping.metadata
            }
          ) })
        ] }),
        Object.keys(task_args).length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs(Card, { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(CardHeader, { label: "Task Args" }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(CardBody, { id: "task-card-config", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
            MetaDataGrid,
            {
              className: "text-size-small",
              entries: task_args
            },
            `plan-md-task-args`
          ) })
        ] })
      ] }) });
    };
    const downloadLogButton = "_downloadLogButton_fi3zx_1";
    const styles$e = {
      downloadLogButton
    };
    const DownloadLogButton = ({
      log_file,
      className: className2 = "",
      ariaLabel = "Download log as EVAL"
    }) => {
      const [downloadState, setDownloadState] = reactExports.useState("idle");
      const api2 = useStore((state) => state.api);
      const handleClick = async () => {
        if (!api2?.download_log) return;
        setDownloadState("downloading");
        try {
          await api2.download_log(log_file);
          setDownloadState("success");
        } catch (error2) {
          console.error("Failed to download log:", error2);
          setDownloadState("error");
        } finally {
          setTimeout(() => {
            setDownloadState("idle");
          }, 1250);
        }
      };
      const getIcon = () => {
        switch (downloadState) {
          case "downloading":
            return ApplicationIcons.loading;
          case "success":
            return ApplicationIcons.confirm;
          case "error":
            return ApplicationIcons.error;
          default:
            return ApplicationIcons.downloadLog;
        }
      };
      const getIconClass = () => {
        const icon2 = getIcon();
        if (downloadState === "success") {
          return `${icon2} primary`;
        }
        if (downloadState === "error") {
          return `${icon2} text-danger`;
        }
        return icon2;
      };
      return /* @__PURE__ */ jsxRuntimeExports.jsx(
        "button",
        {
          type: "button",
          className: clsx(
            "download-log-button",
            styles$e.downloadLogButton,
            className2
          ),
          onClick: handleClick,
          "aria-label": ariaLabel,
          disabled: downloadState !== "idle",
          children: /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: getIconClass(), "aria-hidden": "true" })
        }
      );
    };
    const metricDisplayName = (metric) => {
      let modifier = void 0;
      for (const metricModifier of metricModifiers) {
        modifier = metricModifier(metric);
        if (modifier) {
          break;
        }
      }
      const metricName = !modifier ? metric.name : `${metric.name}[${modifier}]`;
      return metricName;
    };
    const clusterMetricModifier = (metric) => {
      if (metric.name !== "stderr") {
        return void 0;
      }
      const clusterValue = (metric.params || {})["cluster"];
      if (clusterValue === void 0 || typeof clusterValue !== "string") {
        return void 0;
      }
      return clusterValue;
    };
    const groupMetricModifier = (metric) => {
      const groupKey = (metric.params || {})["group_key"];
      if (groupKey === void 0 || typeof groupKey !== "string") {
        return void 0;
      }
      const metricRaw = (metric.params || {})["metric"];
      if (metricRaw === void 0 || typeof metricRaw !== "object") {
        return void 0;
      }
      const metricObj = metricRaw;
      const name2 = metricObj["name"];
      return name2;
    };
    const metricModifiers = [
      clusterMetricModifier,
      groupMetricModifier
    ];
    const toDisplayScorers = (scores2) => {
      if (!scores2) {
        return [];
      }
      return scores2.map((score2) => {
        return {
          scorer: score2.name,
          reducer: score2.reducer === null ? void 0 : score2.reducer,
          metrics: Object.keys(score2.metrics).map((key2) => {
            const metric = score2.metrics[key2];
            return {
              name: metric.name,
              value: metric.value,
              params: metric.params
            };
          }),
          unscoredSamples: score2.unscored_samples !== null ? score2.unscored_samples : void 0,
          scoredSamples: score2.scored_samples !== null ? score2.scored_samples : void 0
        };
      });
    };
    const isGroupedMetric = (metric) => {
      if (!metric.params) {
        return false;
      }
      const params = metric.params;
      return params["group_key"] !== void 0 && params["metric"] !== void 0;
    };
    const getBaseMetricName = (metric) => {
      if (!metric.params) {
        return void 0;
      }
      const params = metric.params;
      const metricObj = params["metric"];
      if (!metricObj || typeof metricObj !== "object") {
        return void 0;
      }
      return metricObj["name"];
    };
    const normalizeMetricName = (name2) => {
      return name2.replace(/\d+$/, "");
    };
    const expandGroupedMetrics = (scorers) => {
      const result2 = [];
      for (const scorer2 of scorers) {
        if (scorer2.metrics.length === 0) {
          result2.push(scorer2);
          continue;
        }
        const hasGroupedMetrics = scorer2.metrics.some(isGroupedMetric);
        if (!hasGroupedMetrics) {
          result2.push(scorer2);
          continue;
        }
        const metricsByBase = /* @__PURE__ */ new Map();
        const nonGroupedMetrics = [];
        for (const metric of scorer2.metrics) {
          const baseMetricName = getBaseMetricName(metric);
          if (!baseMetricName) {
            nonGroupedMetrics.push(metric);
            continue;
          }
          if (!metricsByBase.has(baseMetricName)) {
            metricsByBase.set(baseMetricName, []);
          }
          metricsByBase.get(baseMetricName).push({
            ...metric,
            name: normalizeMetricName(metric.name)
          });
        }
        if (nonGroupedMetrics.length > 0) {
          result2.push({
            scorer: scorer2.scorer,
            reducer: scorer2.reducer,
            metrics: nonGroupedMetrics,
            unscoredSamples: scorer2.unscoredSamples,
            scoredSamples: scorer2.scoredSamples
          });
        }
        for (const [baseMetricName, metrics] of metricsByBase.entries()) {
          result2.push({
            scorer: scorer2.scorer,
            reducer: baseMetricName,
            metrics,
            unscoredSamples: scorer2.unscoredSamples,
            scoredSamples: scorer2.scoredSamples
          });
        }
      }
      return result2;
    };
    const container$4 = "_container_q17yq_1";
    const grid = "_grid_q17yq_10";
    const styles$d = {
      container: container$4,
      grid
    };
    const ModelRolesView = ({ roles }) => {
      roles = roles || {};
      const singleLine = Object.keys(roles).length !== 1;
      const modelEls = Object.keys(roles).map((key2) => {
        const role2 = key2;
        const roleData = roles[role2];
        const model2 = roleData.model;
        return /* @__PURE__ */ jsxRuntimeExports.jsxs(
          "div",
          {
            className: clsx(
              singleLine ? styles$d.grid : void 0,
              "text-style-secondary",
              "text-size-smallest"
            ),
            children: [
              /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: clsx("text-style-label"), children: [
                role2,
                ":"
              ] }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: model2 })
            ]
          },
          key2
        );
      });
      return modelEls.length > 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$d.container, children: modelEls }) : void 0;
    };
    const container$3 = "_container_17txe_1";
    const wrapper = "_wrapper_17txe_8";
    const body = "_body_17txe_21";
    const bodyContainer = "_bodyContainer_17txe_27";
    const taskTitle = "_taskTitle_17txe_33";
    const taskModel = "_taskModel_17txe_38";
    const taskStatus = "_taskStatus_17txe_42";
    const secondaryContainer = "_secondaryContainer_17txe_49";
    const buttonGroup = "_buttonGroup_17txe_58";
    const styles$c = {
      container: container$3,
      wrapper,
      body,
      bodyContainer,
      taskTitle,
      taskModel,
      taskStatus,
      secondaryContainer,
      buttonGroup
    };
    const button = "_button_12472_1";
    const label$1 = "_label_12472_14";
    const styles$b = {
      button,
      label: label$1
    };
    const LinkButton = ({
      id,
      text: text2,
      icon: icon2,
      className: className2,
      onClick
    }) => {
      return /* @__PURE__ */ jsxRuntimeExports.jsxs(
        "button",
        {
          id,
          onClick,
          className: clsx(className2, styles$b.button, "text-size-smaller"),
          children: [
            icon2 ? /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: clsx(icon2) }) : void 0,
            text2 ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$b.label), children: text2 }) : void 0
          ]
        }
      );
    };
    const modal = "_modal_o64lp_1";
    const header = "_header_o64lp_14";
    const modalTitle = "_modalTitle_o64lp_18";
    const btnClose = "_btnClose_o64lp_22";
    const backdrop = "_backdrop_o64lp_28";
    const overflowVisible = "_overflowVisible_o64lp_40";
    const overflowHidden = "_overflowHidden_o64lp_44";
    const overflowScroll = "_overflowScroll_o64lp_48";
    const overflowAuto = "_overflowAuto_o64lp_52";
    const styles$a = {
      modal,
      header,
      modalTitle,
      btnClose,
      backdrop,
      overflowVisible,
      overflowHidden,
      overflowScroll,
      overflowAuto
    };
    const Modal = ({
      id,
      title: title2,
      showing,
      setShowing,
      children: children2,
      className: className2,
      overflow = "visible"
    }) => {
      return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
        showing && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$a.backdrop, onClick: () => setShowing(false) }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          "div",
          {
            id,
            className: clsx("modal", "fade", showing ? "show" : "", className2),
            tabIndex: -1,
            style: { display: showing ? "block" : "none" },
            children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx("modal-dialog", styles$a.modal), children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "modal-content", children: [
              /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx("modal-header", styles$a.header), children: [
                /* @__PURE__ */ jsxRuntimeExports.jsx(
                  "div",
                  {
                    className: clsx(
                      "modal-title",
                      "text-size-base",
                      styles$a.modalTitle
                    ),
                    children: title2
                  }
                ),
                /* @__PURE__ */ jsxRuntimeExports.jsx(
                  "button",
                  {
                    type: "button",
                    className: clsx(
                      "btn-close",
                      "text-size-smaller",
                      styles$a.btnClose
                    ),
                    "data-bs-dismiss": "modal",
                    "aria-label": "Close",
                    onClick: () => {
                      setShowing(!showing);
                    }
                  }
                )
              ] }),
              /* @__PURE__ */ jsxRuntimeExports.jsx(
                "div",
                {
                  className: clsx(
                    "modal-body",
                    overflow === "auto" ? styles$a.overflowAuto : overflow === "hidden" ? styles$a.overflowHidden : overflow === "scroll" ? styles$a.overflowScroll : styles$a.overflowVisible
                  ),
                  children: children2
                }
              ),
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "modal-footer", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
                "button",
                {
                  type: "button",
                  className: "btn btn-secondary",
                  "data-bs-dismiss": "modal",
                  onClick: () => {
                    setShowing(!showing);
                  },
                  children: "Close"
                }
              ) })
            ] }) })
          }
        )
      ] });
    };
    const groupScorers = (scorers) => {
      const results = {};
      scorers.forEach((scorer2) => {
        if (scorer2.metrics.length > 0) {
          const key2 = metricsKey(scorer2.metrics);
          results[key2] = results[key2] || [];
          results[key2].push(scorer2);
        }
      });
      return Object.values(results);
    };
    const metricsKey = (metrics) => {
      const metricKey = metrics.map((m) => m.name).join("");
      return metricKey;
    };
    const simpleMetricsRows = "_simpleMetricsRows_1itqo_1";
    const verticalMetricReducer = "_verticalMetricReducer_1itqo_26";
    const verticalMetricName = "_verticalMetricName_1itqo_33";
    const verticalMetricValue = "_verticalMetricValue_1itqo_41";
    const moreButton = "_moreButton_1itqo_91";
    const metricsSummary = "_metricsSummary_1itqo_97";
    const modalScores = "_modalScores_1itqo_104";
    const styles$9 = {
      simpleMetricsRows,
      verticalMetricReducer,
      verticalMetricName,
      verticalMetricValue,
      moreButton,
      metricsSummary,
      modalScores
    };
    const table = "_table_12koy_1";
    const scorer = "_scorer_12koy_5";
    const value = "_value_12koy_6";
    const label = "_label_12koy_11";
    const groupSeparator = "_groupSeparator_12koy_28";
    const tableBody = "_tableBody_12koy_33";
    const tableSeparator = "_tableSeparator_12koy_45";
    const styles$8 = {
      table,
      scorer,
      value,
      label,
      groupSeparator,
      tableBody,
      tableSeparator
    };
    const unscoredSamples = "_unscoredSamples_1h85z_1";
    const styles$7 = {
      unscoredSamples
    };
    const UnscoredSamples = ({
      scoredSamples,
      unscoredSamples: unscoredSamples2
    }) => {
      if (unscoredSamples2 === 0) {
        return null;
      }
      const msg = unscoredSamples2 === 1 ? `${unscoredSamples2} sample was excluded from this metric because it returned a Nan value.` : `${unscoredSamples2} samples were excluded from this metric because they returned Nan values.`;
      return /* @__PURE__ */ jsxRuntimeExports.jsxs(
        "span",
        {
          className: clsx("text-style-secondary", styles$7.unscoredSamples),
          title: msg,
          children: [
            "(",
            scoredSamples,
            "/",
            unscoredSamples2 + scoredSamples,
            ")"
          ]
        }
      );
    };
    const ScoreGrid = ({
      scoreGroups,
      showReducer,
      className: className2,
      striped
    }) => {
      const columnCount = scoreGroups.reduce((prev, group) => {
        return Math.max(prev, group[0].metrics.length);
      }, 0);
      const subTables = [];
      let index = 0;
      for (const scoreGroup of scoreGroups) {
        const metrics = scoreGroup[0].metrics;
        const cells = [];
        for (let i2 = 0; i2 < columnCount; i2++) {
          if (metrics.length > i2) {
            cells.push(
              /* @__PURE__ */ jsxRuntimeExports.jsx(
                "th",
                {
                  className: clsx(
                    "text-style-label",
                    "text-style-secondary",
                    "text-size-small",
                    styles$8.label
                  ),
                  children: metrics[i2].name
                }
              )
            );
          } else {
            cells.push(/* @__PURE__ */ jsxRuntimeExports.jsx("td", {}));
          }
        }
        const headerRow2 = /* @__PURE__ */ jsxRuntimeExports.jsx("thead", { children: /* @__PURE__ */ jsxRuntimeExports.jsxs("tr", { className: clsx(styles$8.headerRow), children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("td", {}),
          cells
        ] }) });
        const rows = [];
        scoreGroup.forEach((g) => {
          const cells2 = [];
          for (let i2 = 0; i2 < columnCount; i2++) {
            if (metrics.length > i2) {
              cells2.push(
                /* @__PURE__ */ jsxRuntimeExports.jsx("td", { className: clsx(styles$8.value, "text-size-small"), children: formatPrettyDecimal(g.metrics[i2].value) })
              );
            } else {
              cells2.push(/* @__PURE__ */ jsxRuntimeExports.jsx("td", { className: clsx(styles$8.value) }));
            }
          }
          rows.push(
            /* @__PURE__ */ jsxRuntimeExports.jsxs("tr", { children: [
              /* @__PURE__ */ jsxRuntimeExports.jsxs("th", { className: clsx(styles$8.scorer, "text-size-small"), children: [
                g.scorer,
                " ",
                showReducer && g.reducer ? `(${g.reducer})` : void 0,
                /* @__PURE__ */ jsxRuntimeExports.jsx(
                  UnscoredSamples,
                  {
                    scoredSamples: g.scoredSamples || 0,
                    unscoredSamples: g.unscoredSamples || 0
                  }
                )
              ] }),
              cells2
            ] })
          );
        });
        subTables.push(
          /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
            index > 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx("tbody", { className: clsx(styles$8.tableSeparator), children: /* @__PURE__ */ jsxRuntimeExports.jsx("tr", { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
              "td",
              {
                colSpan: columnCount + 1,
                className: clsx(styles$8.groupSeparator)
              }
            ) }) }) : void 0,
            headerRow2,
            /* @__PURE__ */ jsxRuntimeExports.jsx("tbody", { className: clsx("table-group-divider", styles$8.tableBody), children: rows })
          ] })
        );
        index++;
      }
      return /* @__PURE__ */ jsxRuntimeExports.jsx(
        "table",
        {
          className: clsx(
            className2,
            "table",
            striped ? "table-striped" : void 0,
            styles$8.table,
            "table-bordered"
          ),
          children: subTables
        }
      );
    };
    const kMaxPrimaryScoreRows = 4;
    const displayScorersFromRunningMetrics = (metrics) => {
      if (!metrics) {
        return [];
      }
      const getKey = (metric) => {
        return metric.reducer ? `${metric.scorer}-${metric.reducer}` : metric.scorer;
      };
      const scorers = {};
      metrics.forEach((metric) => {
        if (metric.value !== void 0 && metric.value !== null) {
          const key2 = getKey(metric);
          if (scorers[key2]) {
            scorers[key2].metrics.push({
              name: metric.name,
              value: metric.value,
              params: metric.params
            });
          } else {
            scorers[key2] = {
              scorer: metric.scorer,
              reducer: metric.reducer,
              metrics: [
                {
                  name: metric.name,
                  value: metric.value,
                  params: metric.params
                }
              ]
            };
          }
        }
      });
      return expandGroupedMetrics(Object.values(scorers));
    };
    const ResultsPanel = ({ scorers }) => {
      const [showing, setShowing] = useProperty(
        "results-panel-metrics",
        "modal-showing",
        {
          defaultValue: false
        }
      );
      if (!scorers || scorers.length === 0) {
        return void 0;
      }
      const expandedScorers = expandGroupedMetrics(scorers);
      if (expandedScorers.length === 1) {
        const showReducer = !!expandedScorers[0].reducer;
        const metrics = expandedScorers[0].metrics;
        const unscoredSamples2 = expandedScorers[0].unscoredSamples || 0;
        const scoredSamples = expandedScorers[0].scoredSamples || 0;
        return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$9.simpleMetricsRows, children: metrics.map((metric, i2) => {
          return /* @__PURE__ */ jsxRuntimeExports.jsx(
            VerticalMetric,
            {
              reducer: expandedScorers[0].reducer,
              metric,
              isFirst: i2 === 0,
              showReducer,
              unscoredSamples: unscoredSamples2,
              scoredSamples
            },
            `simple-metric-${i2}`
          );
        }) });
      } else {
        const showReducer = expandedScorers.findIndex((score2) => !!score2.reducer) !== -1;
        const grouped = groupScorers(expandedScorers);
        if (grouped.length < 1) {
          return void 0;
        }
        let primaryResults = grouped[0];
        if (!primaryResults) {
          return void 0;
        }
        let showMore = grouped.length > 1;
        if (primaryResults.length > kMaxPrimaryScoreRows) {
          const shorterResults = grouped.find((g) => {
            return g.length <= kMaxPrimaryScoreRows;
          });
          if (shorterResults) {
            primaryResults = shorterResults;
          }
          if (primaryResults.length > kMaxPrimaryScoreRows) {
            primaryResults = primaryResults.slice(0, kMaxPrimaryScoreRows);
            showMore = true;
          }
        }
        return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$9.metricsSummary), children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(ScoreGrid, { scoreGroups: [primaryResults], showReducer }),
          showMore ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              Modal,
              {
                id: "results-metrics",
                showing,
                setShowing,
                title: "Scoring Detail",
                overflow: "scroll",
                children: /* @__PURE__ */ jsxRuntimeExports.jsx(
                  ScoreGrid,
                  {
                    scoreGroups: grouped,
                    showReducer,
                    className: styles$9.modalScores,
                    striped: false
                  }
                )
              }
            ),
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              LinkButton,
              {
                className: styles$9.moreButton,
                text: "All scoring...",
                onClick: () => {
                  setShowing(true);
                }
              }
            )
          ] }) : void 0
        ] });
      }
    };
    const VerticalMetric = ({
      metric,
      reducer,
      isFirst,
      showReducer,
      scoredSamples,
      unscoredSamples: unscoredSamples2
    }) => {
      return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: { paddingLeft: isFirst ? "0" : "1em" }, children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs(
          "div",
          {
            className: clsx(
              "vertical-metric-label",
              "text-style-label",
              "text-style-secondary",
              styles$9.verticalMetricName
            ),
            children: [
              metricDisplayName(metric),
              /* @__PURE__ */ jsxRuntimeExports.jsx(
                UnscoredSamples,
                {
                  scoredSamples,
                  unscoredSamples: unscoredSamples2
                }
              )
            ]
          }
        ),
        showReducer ? /* @__PURE__ */ jsxRuntimeExports.jsx(
          "div",
          {
            className: clsx(
              "text-style-label",
              "text-style-secondary",
              styles$9.verticalMetricReducer
            ),
            children: reducer || "default"
          }
        ) : void 0,
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          "div",
          {
            className: clsx(
              "vertical-metric-value",
              "text-size-largest",
              styles$9.verticalMetricValue
            ),
            children: metric.value !== void 0 && metric.value !== null ? formatPrettyDecimal(metric.value) : "n/a"
          }
        )
      ] });
    };
    const statusContainer = "_statusContainer_1sckj_1";
    const status = "_status_1sckj_1";
    const statusText = "_statusText_1sckj_11";
    const icon = "_icon_1sckj_24";
    const styles$6 = {
      statusContainer,
      status,
      statusText,
      icon
    };
    const RunningStatusPanel = ({ sampleCount }) => {
      return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$6.statusContainer), children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$6.status), children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: clsx(ApplicationIcons.running, styles$6.icon) }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs(
          "div",
          {
            className: clsx(
              styles$6.statusText,
              "text-style-label",
              "text-size-smaller"
            ),
            children: [
              "Running (",
              sampleCount,
              " samples)"
            ]
          }
        )
      ] }) }) });
    };
    const statusPanel = "_statusPanel_1o5l7_1";
    const statusIcon = "_statusIcon_1o5l7_11";
    const styles$5 = {
      statusPanel,
      statusIcon
    };
    const CancelledPanel = ({ sampleCount }) => {
      return /* @__PURE__ */ jsxRuntimeExports.jsx(
        StatusPanel,
        {
          icon: ApplicationIcons.logging["info"],
          status: "Cancelled",
          sampleCount
        }
      );
    };
    const ErroredPanel = ({ sampleCount }) => {
      return /* @__PURE__ */ jsxRuntimeExports.jsx(
        StatusPanel,
        {
          icon: ApplicationIcons.logging["error"],
          status: "Task Failed",
          sampleCount
        }
      );
    };
    const StatusPanel = ({
      icon: icon2,
      status: status2,
      sampleCount
    }) => {
      return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$5.statusPanel, children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: clsx(icon2, styles$5.statusIcon), style: {} }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: status2 }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
            "(",
            sampleCount,
            " ",
            sampleCount === 1 ? "sample" : "samples",
            ")"
          ] })
        ] })
      ] });
    };
    const PrimaryBar = ({
      status: status2,
      evalResults,
      runningMetrics,
      evalSpec,
      sampleCount
    }) => {
      const streamSamples = useStore((state) => state.capabilities.streamSamples);
      const downloadLogs = useStore((state) => state.capabilities.downloadLogs);
      const selectedLogFile = useStore((state) => state.logs.selectedLogFile);
      const logFileName = selectedLogFile ? filename(selectedLogFile) : "";
      const isEvalFile2 = selectedLogFile?.endsWith(".eval");
      const hasRunningMetrics = runningMetrics && runningMetrics.length > 0;
      return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$c.wrapper), children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          "div",
          {
            className: clsx(
              "navbar-brand",
              "navbar-text",
              "mb-0",
              styles$c.container
            ),
            children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$c.body, children: [
              /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$c.bodyContainer, children: [
                /* @__PURE__ */ jsxRuntimeExports.jsx(
                  "div",
                  {
                    id: "task-title",
                    className: clsx("task-title", "text-truncate", styles$c.taskTitle),
                    title: evalSpec?.task,
                    children: evalSpec?.task
                  }
                ),
                evalSpec?.model && evalSpec.model !== kModelNone ? /* @__PURE__ */ jsxRuntimeExports.jsx(
                  "div",
                  {
                    id: "task-model",
                    className: clsx(
                      "task-model",
                      "text-truncate",
                      styles$c.taskModel,
                      "text-size-base"
                    ),
                    title: evalSpec?.model,
                    children: evalSpec?.model
                  }
                ) : ""
              ] }),
              evalSpec?.model_roles ? /* @__PURE__ */ jsxRuntimeExports.jsx(ModelRolesView, { roles: evalSpec.model_roles }) : void 0,
              /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx("text-size-small", styles$c.secondaryContainer), children: [
                /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx("navbar-secondary-text", "text-truncate"), children: logFileName }),
                /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$c.buttonGroup, children: [
                  selectedLogFile ? /* @__PURE__ */ jsxRuntimeExports.jsx(CopyButton, { value: selectedLogFile }) : "",
                  downloadLogs && selectedLogFile && isEvalFile2 ? /* @__PURE__ */ jsxRuntimeExports.jsx(DownloadLogButton, { log_file: selectedLogFile }) : null
                ] })
              ] })
            ] })
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$c.taskStatus, "navbar-text"), children: [
          status2 === "success" || status2 === "started" && streamSamples && hasRunningMetrics || status2 === "error" && evalSpec?.config["continue_on_fail"] ? /* @__PURE__ */ jsxRuntimeExports.jsx(
            ResultsPanel,
            {
              scorers: runningMetrics ? displayScorersFromRunningMetrics(runningMetrics) : toDisplayScorers(evalResults?.scores)
            }
          ) : void 0,
          status2 === "cancelled" ? /* @__PURE__ */ jsxRuntimeExports.jsx(CancelledPanel, { sampleCount: sampleCount || 0 }) : void 0,
          status2 === "started" && (!streamSamples || !hasRunningMetrics) ? /* @__PURE__ */ jsxRuntimeExports.jsx(RunningStatusPanel, { sampleCount: sampleCount || 0 }) : void 0,
          status2 === "error" ? /* @__PURE__ */ jsxRuntimeExports.jsx(ErroredPanel, { sampleCount: sampleCount || 0 }) : void 0
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { id: "task-created", style: { display: "none" }, children: evalSpec?.created })
      ] });
    };
    const staticCol = "_staticCol_xzzhl_1";
    const justifyLeft = "_justifyLeft_xzzhl_5";
    const justifyCenter = "_justifyCenter_xzzhl_9";
    const justifyRight = "_justifyRight_xzzhl_13";
    const valueGrid = "_valueGrid_xzzhl_17";
    const container$2 = "_container_xzzhl_25";
    const styles$4 = {
      staticCol,
      justifyLeft,
      justifyCenter,
      justifyRight,
      valueGrid,
      container: container$2
    };
    const SecondaryBar = ({
      evalSpec,
      evalPlan,
      evalResults,
      evalStats,
      status: status2,
      sampleCount
    }) => {
      const evalDescriptor = useEvalDescriptor();
      if (!evalSpec || status2 !== "success") {
        return null;
      }
      const epochs = evalSpec.config.epochs || 1;
      const hyperparameters = {
        ...evalPlan?.config || {},
        ...evalSpec.task_args || {}
      };
      const hasConfig = Object.keys(hyperparameters).length > 0;
      const values = [];
      values.push({
        size: "minmax(12%, auto)",
        value: /* @__PURE__ */ jsxRuntimeExports.jsx(
          LabeledValue,
          {
            label: "Dataset",
            className: clsx(styles$4.staticCol, "text-size-small"),
            children: /* @__PURE__ */ jsxRuntimeExports.jsx(
              DatasetSummary,
              {
                dataset: evalSpec.dataset,
                sampleCount,
                epochs
              }
            )
          },
          "sb-dataset"
        )
      });
      const label2 = evalResults?.scores && evalResults.scores.length > 1 ? "Scorers" : "Scorer";
      values.push({
        size: "minmax(12%, auto)",
        value: /* @__PURE__ */ jsxRuntimeExports.jsx(
          LabeledValue,
          {
            label: label2,
            className: clsx(
              styles$4.staticCol,
              hasConfig ? styles$4.justifyLeft : styles$4.justifyCenter,
              "text-size-small"
            ),
            children: /* @__PURE__ */ jsxRuntimeExports.jsx(ScorerSummary, { evalDescriptor })
          },
          "sb-scorer"
        )
      });
      if (hasConfig) {
        values.push({
          size: "minmax(12%, auto)",
          value: /* @__PURE__ */ jsxRuntimeExports.jsx(
            LabeledValue,
            {
              label: "Config",
              className: clsx(styles$4.justifyRight, "text-size-small"),
              children: /* @__PURE__ */ jsxRuntimeExports.jsx(ParamSummary, { params: hyperparameters })
            },
            "sb-params"
          )
        });
      }
      if (evalStats) {
        const totalDuration = formatDuration(
          new Date(evalStats?.started_at),
          new Date(evalStats?.completed_at)
        );
        values.push({
          size: "minmax(12%, auto)",
          value: /* @__PURE__ */ jsxRuntimeExports.jsx(
            LabeledValue,
            {
              label: "Duration",
              className: clsx(styles$4.justifyRight, "text-size-small"),
              children: totalDuration
            },
            "sb-duration"
          )
        });
      }
      return /* @__PURE__ */ jsxRuntimeExports.jsx(
        ExpandablePanel,
        {
          id: "secondary-nav-bar",
          className: clsx(styles$4.container, "text-size-small"),
          collapse: true,
          lines: 5,
          children: /* @__PURE__ */ jsxRuntimeExports.jsx(
            "div",
            {
              className: styles$4.valueGrid,
              style: {
                gridTemplateColumns: `${values.map((val) => {
                  return val.size;
                }).join(" ")}`
              },
              children: values.map((val) => {
                return val.value;
              })
            }
          )
        }
      );
    };
    const DatasetSummary = ({
      sampleCount,
      dataset,
      epochs
    }) => {
      if (!dataset) {
        return null;
      }
      return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: sampleCount ? formatDataset(sampleCount, epochs, dataset.name) : "" });
    };
    const ScorerSummary = ({ evalDescriptor }) => {
      if (!evalDescriptor) {
        return null;
      }
      const items = sampleFilterItems(evalDescriptor);
      return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { style: { position: "relative" }, children: Array.from(items).map((item2, index, array) => /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("span", { title: item2.tooltip, children: item2.canonicalName }),
        index < array.length - 1 ? ", " : ""
      ] }, index)) });
    };
    const ParamSummary = ({ params }) => {
      if (!params) {
        return null;
      }
      const paraValues = Object.keys(params).map((key2) => {
        const val = params[key2];
        if (Array.isArray(val) || typeof val === "object") {
          return `${key2}: ${JSON.stringify(val)}`;
        } else {
          return `${key2}: ${val}`;
        }
      });
      if (paraValues.length > 0) {
        return /* @__PURE__ */ jsxRuntimeExports.jsx(
          "code",
          {
            style: {
              padding: 0,
              color: "var(--bs-body-color)",
              overflowWrap: "anywhere"
            },
            children: paraValues.join(", ")
          }
        );
      } else {
        return null;
      }
    };
    const navbarWrapper = "_navbarWrapper_838qu_48";
    const styles$3 = {
      navbarWrapper
    };
    const TitleView = ({
      evalSpec,
      evalPlan,
      evalResults,
      evalStats,
      status: status2,
      runningMetrics
    }) => {
      const totalSampleCount = useTotalSampleCount();
      const showingSampleDialog = useStore((state) => state.app.dialogs.sample);
      if (showingSampleDialog) {
        return null;
      }
      return /* @__PURE__ */ jsxRuntimeExports.jsxs("nav", { className: clsx("navbar", "sticky-top", styles$3.navbarWrapper), children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          PrimaryBar,
          {
            evalSpec,
            evalResults,
            status: status2,
            runningMetrics,
            sampleCount: totalSampleCount
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          SecondaryBar,
          {
            evalSpec,
            evalPlan,
            evalResults,
            evalStats,
            status: status2,
            sampleCount: totalSampleCount
          }
        )
      ] });
    };
    const LogView = () => {
      const divRef = reactExports.useRef(null);
      const refreshLog = useRefreshLog();
      const navigation2 = useLogNavigation();
      const selectedLogDetails = useStore((state) => state.log.selectedLogDetails);
      const evalSpec = useEvalSpec();
      const runningMetrics = useStore(
        (state) => state.log.pendingSampleSummaries?.metrics
      );
      const samplesTabConfig = useSamplesTabConfig(
        selectedLogDetails?.status,
        refreshLog
      );
      const intoTabConfig = useInfoTabConfig(
        evalSpec,
        selectedLogDetails?.plan,
        selectedLogDetails?.error,
        selectedLogDetails?.results,
        selectedLogDetails?.status
      );
      const errorTabConfig = useErrorTabConfig(selectedLogDetails?.error);
      const taskTabConfig = useTaskTabConfig(
        evalSpec,
        selectedLogDetails?.stats,
        selectedLogDetails?.results?.early_stopping
      );
      const modelsTabConfig = useModelsTab(
        evalSpec,
        selectedLogDetails?.stats,
        selectedLogDetails?.status
      );
      const jsonTabConfig = useJsonTabConfig(
        selectedLogDetails?.version,
        selectedLogDetails?.status,
        evalSpec,
        selectedLogDetails?.plan,
        selectedLogDetails?.error,
        selectedLogDetails?.results,
        selectedLogDetails?.stats
      );
      const tabs2 = {
        ...samplesTabConfig ? { samples: samplesTabConfig } : {},
        task: taskTabConfig,
        model: modelsTabConfig,
        config: intoTabConfig,
        ...selectedLogDetails?.error ? { error: errorTabConfig } : {},
        json: jsonTabConfig
      };
      const selectedTab = useStore((state) => state.app.tabs.workspace);
      const setSelectedTab = useStore((state) => state.appActions.setWorkspaceTab);
      const onSelected = reactExports.useCallback(
        (e) => {
          const id = e.currentTarget?.id;
          if (id) {
            setSelectedTab(id);
            navigation2.selectTab(id);
          }
        },
        [setSelectedTab, navigation2]
      );
      if (evalSpec === void 0) {
        return /* @__PURE__ */ jsxRuntimeExports.jsx(EmptyPanel, {});
      } else {
        const tabTools2 = Object.keys(tabs2).map((key2) => {
          const tab2 = tabs2[key2];
          return tab2;
        }).filter((tab2) => {
          return tab2.id === selectedTab;
        }).map((tab2) => {
          if (tab2.tools) {
            const tools2 = tab2.tools();
            return tools2;
          } else {
            return null;
          }
        });
        return /* @__PURE__ */ jsxRuntimeExports.jsxs(reactExports.Fragment, { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            TitleView,
            {
              evalSpec,
              evalPlan: selectedLogDetails?.plan,
              evalResults: selectedLogDetails?.results,
              runningMetrics,
              evalStats: selectedLogDetails?.stats,
              status: selectedLogDetails?.status
            }
          ),
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: divRef, className: clsx("workspace", styles$19.workspace), children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx("log-detail", styles$19.tabContainer), children: /* @__PURE__ */ jsxRuntimeExports.jsx(
            TabSet,
            {
              id: "log-details",
              tools: tabTools2,
              type: "pills",
              className: clsx(styles$19.tabSet, "text-size-smaller"),
              tabControlsClassName: clsx(styles$19.tabs, "text-size-smaller"),
              tabPanelsClassName: clsx(styles$19.tabPanels),
              children: Object.keys(tabs2).map((key2) => {
                const tab2 = tabs2[key2];
                return /* @__PURE__ */ jsxRuntimeExports.jsx(
                  TabPanel,
                  {
                    id: tab2.id,
                    title: tab2.label,
                    onSelected,
                    selected: selectedTab === tab2.id,
                    scrollable: !!tab2.scrollable,
                    scrollRef: tab2.scrollRef,
                    className: clsx(tab2.className),
                    style: { height: tab2.scrollable ? "100%" : void 0 },
                    children: reactExports.createElement(tab2.component, tab2.componentProps)
                  },
                  tab2.id
                );
              })
            }
          ) }) })
        ] });
      }
    };
    const LogViewLayout = () => {
      const appStatus = useStore((state) => state.app.status);
      const showFind = useStore((state) => state.app.showFind);
      const setShowFind = useStore((state) => state.appActions.setShowFind);
      const nativeFind = useStore((state) => state.app.nativeFind);
      const hideFind = useStore((state) => state.appActions.hideFind);
      const singleFileMode = useStore((state) => state.app.singleFileMode);
      const logDir2 = useStore((state) => state.logs.logDir);
      const logFiles = useStore((state) => state.logs.logs);
      const { logPath } = useLogRouteParams();
      const mainAppRef = reactExports.useRef(null);
      const fullScreen = logFiles.length === 1 && !logDir2;
      reactExports.useEffect(() => {
        if (nativeFind) {
          return;
        }
        const handleGlobalKeyDown = (e) => {
          if ((e.ctrlKey || e.metaKey) && e.key === "f") {
            e.preventDefault();
            e.stopPropagation();
            if (setShowFind) {
              setShowFind(true);
            }
          } else if (e.key === "Escape") {
            hideFind();
          }
        };
        document.addEventListener("keydown", handleGlobalKeyDown, true);
        return () => {
          document.removeEventListener("keydown", handleGlobalKeyDown, true);
        };
      }, [setShowFind, hideFind, nativeFind]);
      return /* @__PURE__ */ jsxRuntimeExports.jsx(ExtendedFindProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
        "div",
        {
          ref: mainAppRef,
          className: clsx(
            "app-main-grid",
            fullScreen ? "full-screen" : void 0,
            singleFileMode ? "single-file-mode" : void 0,
            "log-view"
          ),
          tabIndex: 0,
          children: [
            showFind ? /* @__PURE__ */ jsxRuntimeExports.jsx(FindBand, {}) : "",
            !singleFileMode ? /* @__PURE__ */ jsxRuntimeExports.jsx(
              ApplicationNavbar,
              {
                fnNavigationUrl: logsUrl,
                currentPath: logPath,
                showActivity: "log"
              }
            ) : /* @__PURE__ */ jsxRuntimeExports.jsx(ActivityBar, { animating: !!appStatus.loading }),
            appStatus.error ? /* @__PURE__ */ jsxRuntimeExports.jsx(
              ErrorPanel,
              {
                title: "An error occurred while loading this task.",
                error: appStatus.error
              }
            ) : /* @__PURE__ */ jsxRuntimeExports.jsx(LogView, {})
          ]
        }
      ) });
    };
    const LogViewContainer = () => {
      const { logPath, tabId, sampleUuid, sampleId, epoch, sampleTabId } = useLogRouteParams();
      const initialState2 = useStore((state) => state.app.initialState);
      const clearInitialState = useStore(
        (state) => state.appActions.clearInitialState
      );
      const evalSpec = useEvalSpec();
      const setSampleTab = useStore((state) => state.appActions.setSampleTab);
      const setShowingSampleDialog = useStore(
        (state) => state.appActions.setShowingSampleDialog
      );
      const setWorkspaceTab = useStore((state) => state.appActions.setWorkspaceTab);
      const selectSample = useStore((state) => state.logActions.selectSample);
      const setSelectedLogFile = useStore(
        (state) => state.logsActions.setSelectedLogFile
      );
      const clearSelectedLogSummary = useStore(
        (state) => state.logActions.clearSelectedLogDetails
      );
      const clearSelectedSample = useStore(
        (state) => state.sampleActions.clearSelectedSample
      );
      const filteredSamples = useFilteredSamples();
      const totalSampleCount = useTotalSampleCount();
      const navigate = useNavigate();
      const sampleSummaries = useSampleSummaries();
      const [searchParams] = useSearchParams();
      const { unloadLog } = useUnloadLog();
      reactExports.useEffect(() => {
        return () => {
          unloadLog();
        };
      }, [unloadLog]);
      reactExports.useEffect(() => {
        if (logPath && sampleUuid && sampleSummaries) {
          const sample2 = sampleSummaries.find((s) => s.uuid === sampleUuid);
          if (sample2) {
            const url = logSamplesUrl(
              logPath,
              sample2.id,
              sample2.epoch,
              sampleTabId
            );
            const finalUrl = searchParams.toString() ? `${url}?${searchParams.toString()}` : url;
            navigate(finalUrl);
            return;
          }
        }
      }, [
        sampleSummaries,
        logPath,
        sampleUuid,
        searchParams,
        sampleTabId,
        navigate
      ]);
      reactExports.useEffect(() => {
        if (initialState2 && !evalSpec) {
          const url = baseUrl(
            initialState2.log,
            initialState2.sample_id,
            initialState2.sample_epoch
          );
          clearInitialState();
          navigate(url);
        }
      }, [initialState2, evalSpec, clearInitialState, navigate]);
      const prevLogPath = usePrevious(logPath);
      const syncLogs = useStore((state) => state.logsActions.syncLogs);
      const initLogDir = useStore((state) => state.logsActions.initLogDir);
      reactExports.useEffect(() => {
        const loadLogFromPath = async () => {
          if (logPath) {
            await initLogDir();
            setSelectedLogFile(logPath);
            void syncLogs();
            if (tabId) {
              setWorkspaceTab(tabId);
            } else {
              setWorkspaceTab(kLogViewSamplesTabId);
            }
            if (prevLogPath && logPath !== prevLogPath) {
              clearSelectedSample();
              clearSelectedLogSummary();
            }
          }
        };
        loadLogFromPath();
      }, [
        logPath,
        tabId,
        setSelectedLogFile,
        setWorkspaceTab,
        initLogDir,
        syncLogs,
        prevLogPath,
        clearSelectedSample,
        clearSelectedLogSummary
      ]);
      reactExports.useEffect(() => {
        if (sampleId && filteredSamples) {
          const targetEpoch = epoch ? parseInt(epoch, 10) : 1;
          selectSample(sampleId, targetEpoch);
          if (sampleTabId) {
            setSampleTab(sampleTabId);
          }
          if (filteredSamples.length > 1) {
            setShowingSampleDialog(true);
          }
        } else {
          setShowingSampleDialog(false);
          if (totalSampleCount > 1) {
            clearSelectedSample();
          }
        }
      }, [
        sampleId,
        epoch,
        sampleTabId,
        filteredSamples,
        totalSampleCount,
        selectSample,
        setSampleTab,
        setShowingSampleDialog,
        clearSelectedSample
      ]);
      return /* @__PURE__ */ jsxRuntimeExports.jsx(LogViewLayout, {});
    };
    const container$1 = "_container_ovp9s_1";
    const panel$2 = "_panel_ovp9s_7";
    const code = "_code_ovp9s_12";
    const styles$2 = {
      container: container$1,
      panel: panel$2,
      code
    };
    const FlowPanel = () => {
      const location2 = useLocation();
      const isSamplesRoute = location2.pathname.startsWith("/samples/");
      const { logPath: currentPath } = useLogOrSampleRouteParams();
      const flowDir = dirname(currentPath || "");
      const { loadLogs } = useLogs();
      reactExports.useEffect(() => {
        loadLogs(flowDir);
      }, [loadLogs, flowDir]);
      useFlowServerData(flowDir || "");
      const flow = useStore((state) => state.logs.flow);
      const codeContainerRef = reactExports.useRef(null);
      usePrismHighlight(codeContainerRef, flow?.length || 0);
      const fnNavigationUrl = isSamplesRoute ? samplesUrl : logsUrl;
      return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$2.container), children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          ApplicationNavbar,
          {
            currentPath,
            fnNavigationUrl
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: codeContainerRef, className: clsx(styles$2.panel), children: /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: clsx(styles$2.code), children: /* @__PURE__ */ jsxRuntimeExports.jsx("code", { className: clsx("language-yml"), children: flow }) }) })
      ] });
    };
    const RouteDispatcher = () => {
      const { logPath } = useLogRouteParams();
      if (!logPath) {
        return /* @__PURE__ */ jsxRuntimeExports.jsx(LogsPanel, {});
      }
      const isFlowFile = logPath.endsWith(".yaml") || logPath.endsWith(".yml");
      if (isFlowFile) {
        return /* @__PURE__ */ jsxRuntimeExports.jsx(FlowPanel, {});
      }
      const isLogFile = logPath.endsWith(".eval") || logPath.endsWith(".json");
      if (isLogFile) {
        return /* @__PURE__ */ jsxRuntimeExports.jsx(LogViewContainer, {});
      } else {
        return /* @__PURE__ */ jsxRuntimeExports.jsx(LogsPanel, {});
      }
    };
    const useSampleColumns = (logDetails) => {
      const optionalColumnsHaveAnyData = reactExports.useMemo(() => {
        let error2 = false;
        let limit = false;
        let retries = false;
        outerLoop: for (const details of Object.values(logDetails)) {
          for (const sample2 of details.sampleSummaries) {
            if (sample2.error) error2 = true;
            if (sample2.limit) limit = true;
            if (sample2.retries) retries = true;
            if (error2 && limit && retries) break outerLoop;
          }
        }
        return { error: error2, limit, retries };
      }, [logDetails]);
      const columnVisibility = useStore(
        (state) => state.logs.samplesListState.columnVisibility
      );
      const setColumnVisibility = useStore(
        (state) => state.logsActions.setSamplesColumnVisibility
      );
      const scoreMap = reactExports.useMemo(() => {
        const scoreTypes = {};
        for (const details of Object.values(logDetails)) {
          for (const sample2 of details.sampleSummaries) {
            if (sample2.scores) {
              for (const [name2, score2] of Object.entries(sample2.scores)) {
                scoreTypes[name2] = typeof score2.value;
              }
            }
          }
        }
        return scoreTypes;
      }, [logDetails]);
      reactExports.useEffect(() => {
        const { error: error2, limit, retries } = optionalColumnsHaveAnyData;
        if ("error" in columnVisibility || "limit" in columnVisibility || "retries" in columnVisibility || !error2 && !limit && !retries) {
          return;
        }
        const newVisibility = { ...columnVisibility };
        if (error2 && !("error" in columnVisibility)) newVisibility.error = true;
        if (limit && !("limit" in columnVisibility)) newVisibility.limit = true;
        if (retries && !("retries" in columnVisibility))
          newVisibility.retries = true;
        setColumnVisibility(newVisibility);
      }, [optionalColumnsHaveAnyData, columnVisibility, setColumnVisibility]);
      const allColumns = reactExports.useMemo(() => {
        const baseColumns = [
          {
            headerName: "#",
            initialWidth: 80,
            minWidth: 50,
            maxWidth: 80,
            sortable: false,
            filter: false,
            resizable: false,
            pinned: "left",
            cellRenderer: (params) => {
              if (params.data?.displayIndex !== void 0) {
                return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$1d.numberCell, children: params.data.displayIndex });
              }
              return "";
            }
          },
          {
            field: "task",
            headerName: "Task",
            initialWidth: 150,
            minWidth: 100,
            sortable: true,
            filter: true,
            resizable: true
          },
          {
            field: "model",
            headerName: "Model",
            initialWidth: 150,
            minWidth: 100,
            sortable: true,
            filter: true,
            resizable: true
          },
          {
            field: "sampleId",
            headerName: "Sample ID",
            initialWidth: 120,
            minWidth: 100,
            sortable: true,
            filter: true,
            resizable: true,
            valueGetter: (params) => String(params.data?.sampleId ?? "")
          },
          {
            field: "epoch",
            headerName: "Epoch",
            initialWidth: 70,
            minWidth: 70,
            sortable: true,
            filter: true,
            resizable: true,
            cellStyle: { textAlign: "center" },
            comparator: comparators.number
          },
          {
            field: "input",
            headerName: "Input",
            initialWidth: 250,
            minWidth: 150,
            sortable: true,
            filter: true,
            resizable: true,
            cellStyle: { overflow: "hidden", textOverflow: "ellipsis" }
          },
          {
            field: "status",
            headerName: "Status",
            initialWidth: 100,
            minWidth: 80,
            sortable: true,
            resizable: true,
            filter: true
          },
          {
            field: "logFile",
            headerName: "Log File",
            initialWidth: 200,
            minWidth: 150,
            sortable: true,
            filter: true,
            resizable: true,
            valueFormatter: (params) => filename(params.value)
          },
          {
            field: "target",
            headerName: "Target",
            initialWidth: 150,
            minWidth: 100,
            sortable: true,
            filter: true,
            resizable: true,
            cellStyle: { overflow: "hidden", textOverflow: "ellipsis" }
          }
        ];
        const scoreColumns = Object.keys(scoreMap).map(
          (scoreName) => {
            const scoreType = scoreMap[scoreName];
            return {
              field: `score_${scoreName}`,
              headerName: scoreName,
              initialWidth: 100,
              minWidth: 100,
              sortable: true,
              filter: scoreType === "number" ? "agNumberColumnFilter" : "agTextColumnFilter",
              resizable: true,
              valueFormatter: (params) => {
                const value2 = params.value;
                if (value2 === "" || value2 === null || value2 === void 0) {
                  return "";
                }
                if (Array.isArray(value2)) {
                  return value2.join(", ");
                } else if (typeof value2 === "object") {
                  return JSON.stringify(value2);
                } else if (typeof value2 === "number") {
                  return value2.toFixed(3);
                }
                return String(value2);
              },
              comparator: (valA, valB) => {
                if (typeof valA === "number" && typeof valB === "number") {
                  return valA - valB;
                }
                return String(valA || "").localeCompare(String(valB || ""));
              }
            };
          }
        );
        const optionalColumns = [
          {
            field: "created",
            headerName: "Created",
            initialWidth: 200,
            minWidth: 150,
            sortable: true,
            filter: true,
            resizable: true,
            cellDataType: "date",
            valueParser: (params) => new Date(params.newValue),
            valueFormatter: (params) => filename(params.value)
          },
          {
            field: "error",
            headerName: "Error",
            initialWidth: 150,
            minWidth: 100,
            sortable: true,
            filter: true,
            resizable: true,
            cellStyle: { overflow: "hidden", textOverflow: "ellipsis" }
          },
          {
            field: "limit",
            headerName: "Limit",
            initialWidth: 100,
            minWidth: 80,
            sortable: true,
            filter: true,
            resizable: true
          },
          {
            field: "retries",
            headerName: "Retries",
            initialWidth: 80,
            minWidth: 60,
            sortable: true,
            filter: true,
            resizable: true,
            comparator: comparators.number
          }
        ];
        return [...baseColumns, ...scoreColumns, ...optionalColumns];
      }, [scoreMap]);
      const columns = reactExports.useMemo(() => {
        const columnsWithVisibility = allColumns.map((col) => {
          const field = getFieldKey(col);
          const isVisible = (columnVisibility[field] ?? optionalColumnsHaveAnyData[field]) !== false;
          return {
            ...col,
            hide: !isVisible
          };
        });
        return columnsWithVisibility;
      }, [allColumns, columnVisibility, optionalColumnsHaveAnyData]);
      return {
        columns,
        setColumnVisibility
      };
    };
    const SamplesGrid = ({
      items,
      samplesPath,
      gridRef: externalGridRef,
      columns
    }) => {
      const gridState = useStore((state) => state.logs.samplesListState.gridState);
      const setGridState = useStore((state) => state.logsActions.setGridState);
      const { navigateToSampleDetail } = useSamplesGridNavigation();
      const setFilteredSampleCount = useStore(
        (state) => state.logActions.setFilteredSampleCount
      );
      const setDisplayedSamples = useStore(
        (state) => state.logsActions.setDisplayedSamples
      );
      const clearDisplayedSamples = useStore(
        (state) => state.logsActions.clearDisplayedSamples
      );
      const clearSelectedSample = useStore(
        (state) => state.sampleActions.clearSelectedSample
      );
      const previousSamplesPath = useStore(
        (state) => state.logs.samplesListState.previousSamplesPath
      );
      const setPreviousSamplesPath = useStore(
        (state) => state.logsActions.setPreviousSamplesPath
      );
      const loading = useStore((state) => state.app.status.loading);
      const syncing = useStore((state) => state.app.status.syncing);
      const selectedLogFile = useStore((state) => state.logs.selectedLogFile);
      const selectedSampleHandle = useStore(
        (state) => state.log.selectedSampleHandle
      );
      const internalGridRef = reactExports.useRef(null);
      const gridRef = externalGridRef || internalGridRef;
      const gridContainerRef = reactExports.useRef(null);
      const { startPolling, stopPolling } = useClientEvents();
      reactExports.useEffect(() => {
        startPolling([]);
        return () => {
          stopPolling();
        };
      }, [startPolling, stopPolling]);
      const initialGridState = reactExports.useMemo(() => {
        if (previousSamplesPath !== void 0 && previousSamplesPath !== samplesPath) {
          clearDisplayedSamples();
          const result2 = { ...gridState };
          delete result2?.filter;
          return result2;
        } else {
          return gridState;
        }
      }, [previousSamplesPath, samplesPath, clearDisplayedSamples, gridState]);
      reactExports.useEffect(() => {
        if (samplesPath !== previousSamplesPath) {
          setPreviousSamplesPath(samplesPath);
        }
      }, [samplesPath, previousSamplesPath, setPreviousSamplesPath]);
      reactExports.useEffect(() => {
        gridContainerRef.current?.focus();
      }, []);
      const handleRowClick = reactExports.useCallback(
        (e) => {
          if (e.data && e.node && gridRef.current?.api) {
            gridRef.current.api.deselectAll();
            e.node.setSelected(true);
            const mouseEvent = e.event;
            const openInNewWindow = mouseEvent?.metaKey || mouseEvent?.ctrlKey || mouseEvent?.shiftKey || mouseEvent?.button === 1;
            const logFile = e.data.logFile;
            const sampleId = e.data.sampleId;
            const epoch = e.data.epoch;
            setTimeout(() => {
              navigateToSampleDetail(logFile, sampleId, epoch, openInNewWindow);
            }, 10);
          }
        },
        [navigateToSampleDetail, gridRef]
      );
      const handleOpenRow = reactExports.useCallback(
        (rowNode, e) => {
          const openInNewWindow = e.metaKey || e.ctrlKey || e.shiftKey;
          if (rowNode.data) {
            navigateToSampleDetail(
              rowNode.data.logFile,
              rowNode.data.sampleId,
              rowNode.data.epoch,
              openInNewWindow
            );
          }
        },
        [navigateToSampleDetail]
      );
      const handleKeyDown = reactExports.useMemo(
        () => createGridKeyboardHandler({
          gridRef,
          onOpenRow: handleOpenRow
        }),
        [gridRef, handleOpenRow]
      );
      reactExports.useEffect(() => {
        const gridElement = gridContainerRef.current;
        if (!gridElement) return;
        gridElement.addEventListener("keydown", handleKeyDown);
        return () => {
          gridElement.removeEventListener("keydown", handleKeyDown);
        };
      }, [handleKeyDown]);
      const sampleRowId = (logFile, sampleId, epoch) => {
        return `${logFile}-${sampleId}-${epoch}`.replace(/\s+/g, "_");
      };
      const selectCurrentSample = reactExports.useCallback(() => {
        if (!gridRef.current?.api || !selectedSampleHandle || !selectedLogFile) {
          return;
        }
        const rowId = sampleRowId(
          selectedLogFile,
          selectedSampleHandle.id,
          selectedSampleHandle.epoch
        );
        const node2 = gridRef.current.api.getRowNode(rowId);
        if (node2) {
          gridRef.current.api.deselectAll();
          node2.setSelected(true);
          gridRef.current.api.ensureNodeVisible(node2, "middle");
        }
      }, [gridRef, selectedSampleHandle, selectedLogFile]);
      reactExports.useEffect(() => {
        selectCurrentSample();
      }, [selectedSampleHandle, selectedLogFile, selectCurrentSample]);
      const maxColCount = reactExports.useRef(0);
      const resizeGridColumns = reactExports.useRef(createGridColumnResizer(gridRef)).current;
      reactExports.useEffect(() => {
        resizeGridColumns();
      }, [columns, resizeGridColumns]);
      return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$1d.gridWrapper, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: gridContainerRef, className: styles$1d.gridContainer, tabIndex: 0, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
        AgGridReact,
        {
          ref: gridRef,
          rowData: items,
          animateRows: false,
          columnDefs: columns,
          defaultColDef: {
            sortable: true,
            filter: true,
            resizable: true
          },
          autoSizeStrategy: { type: "fitGridWidth" },
          headerHeight: 25,
          rowSelection: { mode: "singleRow", checkboxes: false },
          getRowId: (params) => sampleRowId(
            params.data.logFile,
            params.data.sampleId,
            params.data.epoch
          ),
          onGridColumnsChanged: (e) => {
            const cols = e.api.getColumnDefs();
            if (cols && cols?.length > maxColCount.current) {
              maxColCount.current = cols.length;
              resizeGridColumns();
            }
          },
          onGridSizeChanged: resizeGridColumns,
          theme: themeBalham,
          enableCellTextSelection: true,
          initialState: initialGridState,
          suppressCellFocus: true,
          onStateUpdated: (e) => {
            setGridState(e.state);
            if (gridRef.current?.api) {
              const gridCurrentSamples = gridDisplayedSamples(
                gridRef.current.api
              );
              setFilteredSampleCount(gridCurrentSamples.length);
              setDisplayedSamples(gridCurrentSamples);
            }
          },
          onRowClicked: handleRowClick,
          onFilterChanged: () => {
            if (gridRef.current?.api) {
              const newDisplayedSamples = gridDisplayedSamples(
                gridRef.current.api
              );
              setFilteredSampleCount(newDisplayedSamples.length);
              setDisplayedSamples(newDisplayedSamples);
            }
          },
          onFirstDataRendered: () => {
            selectCurrentSample();
            clearSelectedSample();
          },
          loading: items.length === 0 && (loading > 0 || syncing)
        }
      ) }) });
    };
    const gridDisplayedSamples = (gridApi) => {
      const displayedSamples = [];
      const displayedRowCount = gridApi.getDisplayedRowCount();
      for (let i2 = 0; i2 < displayedRowCount; i2++) {
        const node2 = gridApi.getDisplayedRowAtIndex(i2);
        if (node2?.data) {
          displayedSamples.push({
            logFile: node2.data.logFile,
            sampleId: node2.data.sampleId,
            epoch: node2.data.epoch
          });
        }
      }
      return displayedSamples;
    };
    const panel$1 = "_panel_18nhs_1";
    const list = "_list_18nhs_8";
    const styles$1 = {
      panel: panel$1,
      list
    };
    const SamplesPanel = () => {
      const { samplesPath } = useSamplesRouteParams();
      const { loadLogs } = useLogs();
      const logDir2 = useStore((state) => state.logs.logDir);
      const loading = useStore((state) => state.app.status.loading);
      const syncing = useStore((state) => state.app.status.syncing);
      const showRetriedLogs = useStore((state) => state.logs.showRetriedLogs);
      const setShowRetriedLogs = useStore(
        (state) => state.logsActions.setShowRetriedLogs
      );
      const filteredSamplesCount = useStore(
        (state) => state.log.filteredSampleCount
      );
      const setFilteredSampleCount = useStore(
        (state) => state.logActions.setFilteredSampleCount
      );
      const gridRef = reactExports.useRef(null);
      const [showColumnSelector, setShowColumnSelector] = reactExports.useState(false);
      const columnButtonRef = reactExports.useRef(null);
      const logDetails = useStore((state) => state.logs.logDetails);
      const { columns, setColumnVisibility } = useSampleColumns(logDetails);
      const handleColumnVisibilityChange = reactExports.useCallback(
        (newVisibility) => {
          if (gridRef.current?.api) {
            const currentFilterModel = gridRef.current.api.getFilterModel() || {};
            let filtersRemoved = false;
            const newFilterModel = {};
            for (const [field, filter] of Object.entries(currentFilterModel)) {
              if (newVisibility[field] === false) {
                filtersRemoved = true;
              } else {
                newFilterModel[field] = filter;
              }
            }
            if (filtersRemoved) {
              gridRef.current.api.setFilterModel(newFilterModel);
            }
          }
          setColumnVisibility(newVisibility);
        },
        [setColumnVisibility]
      );
      const handleResetFilters = () => {
        if (gridRef.current?.api) {
          gridRef.current.api.setFilterModel(null);
        }
      };
      useFlowServerData(samplesPath || "");
      const flowData = useStore((state) => state.logs.flow);
      const currentDir = join(samplesPath || "", logDir2);
      const evalSet = useStore((state) => state.logs.evalSet);
      const logFiles = useLogsWithretried();
      const logPreviews = useStore((state) => state.logs.logPreviews);
      const currentDirLogFiles = reactExports.useMemo(() => {
        const files = [];
        for (const logFile of logFiles) {
          const inCurrentDir = logFile.name.startsWith(currentDir);
          const skipped = !showRetriedLogs && logFile.retried;
          if (inCurrentDir && !skipped) {
            files.push(logFile);
          }
        }
        return files;
      }, [currentDir, logFiles, showRetriedLogs]);
      const totalTaskCount = reactExports.useMemo(() => {
        const currentDirTaskIds = new Set(currentDirLogFiles.map((f) => f.task_id));
        let count = currentDirLogFiles.length;
        for (const task of evalSet?.tasks || []) {
          if (!currentDirTaskIds.has(task.task_id)) {
            count++;
          }
        }
        return count;
      }, [currentDirLogFiles, evalSet]);
      const completedTaskCount = reactExports.useMemo(() => {
        let count = 0;
        for (const logFile of currentDirLogFiles) {
          const preview = logPreviews[logFile.name];
          if (preview && preview.status !== "started") {
            count++;
          }
        }
        return count;
      }, [logPreviews, currentDirLogFiles]);
      reactExports.useEffect(() => {
        loadLogs(samplesPath);
      }, [loadLogs, samplesPath]);
      const logDetailsInPath = reactExports.useMemo(() => {
        if (!samplesPath) {
          return logDetails;
        }
        const samplesPathAbs = join(samplesPath, logDir2);
        return Object.entries(logDetails).reduce(
          (acc, [logFile, details]) => {
            if (logFile.startsWith(samplesPathAbs)) {
              acc[logFile] = details;
            }
            return acc;
          },
          {}
        );
      }, [logDetails, logDir2, samplesPath]);
      const [sampleRows, hasRetriedLogs] = reactExports.useMemo(() => {
        const allRows = [];
        let displayIndex = 1;
        let anyLogInCurrentDirCouldBeSkipped = false;
        const logInCurrentDirByName = currentDirLogFiles.reduce(
          (acc, log2) => {
            if (log2.retried) {
              anyLogInCurrentDirCouldBeSkipped = true;
            }
            acc[log2.name] = log2;
            return acc;
          },
          {}
        );
        Object.entries(logDetailsInPath).forEach(([logFile, logDetail]) => {
          logDetail.sampleSummaries.forEach((sampleSummary) => {
            const row2 = {
              logFile,
              created: logDetail.eval.created,
              task: logDetail.eval.task || "",
              model: logDetail.eval.model || "",
              status: logDetail.status,
              sampleId: sampleSummary.id,
              epoch: sampleSummary.epoch,
              input: inputString(sampleSummary.input).join("\n"),
              target: Array.isArray(sampleSummary.target) ? sampleSummary.target.join(", ") : sampleSummary.target,
              error: sampleSummary.error,
              limit: sampleSummary.limit,
              retries: sampleSummary.retries,
              completed: sampleSummary.completed || false,
              displayIndex: displayIndex++
            };
            if (sampleSummary.scores) {
              Object.entries(sampleSummary.scores).forEach(([scoreName, score2]) => {
                row2[`score_${scoreName}`] = score2.value;
              });
            }
            allRows.push(row2);
          });
        });
        const _sampleRows = allRows.filter(
          (row2) => row2.logFile in logInCurrentDirByName
        );
        const _hasRetriedLogs = _sampleRows.length < allRows.length || anyLogInCurrentDirCouldBeSkipped;
        return [_sampleRows, _hasRetriedLogs];
      }, [logDetailsInPath, currentDirLogFiles]);
      const filterModel = gridRef.current?.api?.getFilterModel() || {};
      const filteredFields = Object.keys(filterModel);
      const hasFilter = filteredFields.length > 0;
      return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$1.panel), children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs(ApplicationNavbar, { currentPath: samplesPath, fnNavigationUrl: samplesUrl, children: [
          hasFilter && /* @__PURE__ */ jsxRuntimeExports.jsx(
            NavbarButton,
            {
              label: "Reset Filters",
              icon: ApplicationIcons.filter,
              onClick: handleResetFilters
            },
            "reset-filters"
          ),
          hasRetriedLogs && /* @__PURE__ */ jsxRuntimeExports.jsx(
            NavbarButton,
            {
              label: "Show Retried Logs",
              icon: showRetriedLogs ? ApplicationIcons.toggle.on : ApplicationIcons.toggle.off,
              latched: showRetriedLogs,
              onClick: () => {
                setShowRetriedLogs(!showRetriedLogs);
                setTimeout(() => {
                  if (gridRef.current) {
                    setFilteredSampleCount(
                      gridRef.current.api.getDisplayedRowCount()
                    );
                  }
                }, 10);
              }
            },
            "show-retried"
          ),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            NavbarButton,
            {
              ref: columnButtonRef,
              label: "Choose Columns",
              icon: ApplicationIcons.checkbox.checked,
              onClick: (e) => {
                e.stopPropagation();
                setShowColumnSelector((prev) => !prev);
              }
            },
            "choose-columns"
          ),
          /* @__PURE__ */ jsxRuntimeExports.jsx(ViewSegmentedControl, { selectedSegment: "samples" }),
          flowData && /* @__PURE__ */ jsxRuntimeExports.jsx(FlowButton, {})
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          ColumnSelectorPopover,
          {
            showing: showColumnSelector,
            setShowing: setShowColumnSelector,
            columns,
            onVisibilityChange: handleColumnVisibilityChange,
            positionEl: columnButtonRef.current,
            filteredFields
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsx(ActivityBar, { animating: !!loading }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$1.list, "text-size-smaller"), children: /* @__PURE__ */ jsxRuntimeExports.jsx(
          SamplesGrid,
          {
            items: sampleRows,
            samplesPath,
            gridRef,
            columns
          }
        ) }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          LogListFooter,
          {
            itemCount: filteredSamplesCount ?? 0,
            itemCountLabel: filteredSamplesCount === 1 ? "sample" : "samples",
            progressText: syncing ? `Syncing${filteredSamplesCount ? ` (${filteredSamplesCount.toLocaleString()} samples)` : ""}` : void 0,
            progressBar: totalTaskCount !== completedTaskCount ? /* @__PURE__ */ jsxRuntimeExports.jsx(
              ProgressBar,
              {
                min: 0,
                max: totalTaskCount,
                value: completedTaskCount,
                width: "100px",
                label: "tasks"
              }
            ) : void 0
          }
        )
      ] });
    };
    const detail = "_detail_14cqz_1";
    const panel = "_panel_14cqz_7";
    const sampleInfo = "_sampleInfo_14cqz_11";
    const sampleNav = "_sampleNav_14cqz_17";
    const nav = "_nav_14cqz_25";
    const disabled = "_disabled_14cqz_25";
    const styles = {
      detail,
      panel,
      sampleInfo,
      sampleNav,
      nav,
      disabled
    };
    const SampleDetailView = () => {
      const { samplesPath, sampleId, epoch, tabId } = useSamplesRouteParams();
      const { loadLogs } = useLogs();
      const navigate = useNavigate();
      const selectSample = useStore((state) => state.logActions.selectSample);
      const setSelectedLogFile = useStore(
        (state) => state.logsActions.setSelectedLogFile
      );
      const selectedSampleSummary = useSelectedSampleSummary();
      const selectedLogFile = useStore((state) => state.logs.selectedLogFile);
      const initLogDir = useStore((state) => state.logsActions.initLogDir);
      const logDir2 = useStore((state) => state.logs.logDir);
      const displayedSamples = useStore(
        (state) => state.logs.samplesListState.displayedSamples
      );
      const sampleStatus = useStore((state) => state.sample.sampleStatus);
      const loadSample = useStore((state) => state.sampleActions.loadSample);
      const clearSelectedLogDetails = useStore(
        (state) => state.logActions.clearSelectedLogDetails
      );
      const clearLog = useStore((state) => state.logActions.clearLog);
      const clearSampleTab = useStore((state) => state.appActions.clearSampleTab);
      const showFind = useStore((state) => state.app.showFind);
      const setSampleTab = useStore((state) => state.appActions.setSampleTab);
      const summaryId = selectedSampleSummary?.id;
      const summaryEpoch = selectedSampleSummary?.epoch;
      const summaryCompleted = selectedSampleSummary?.completed;
      const currentIndex = reactExports.useMemo(() => {
        if (!displayedSamples || !selectedLogFile || !sampleId || !epoch) {
          return -1;
        }
        return displayedSamples.findIndex(
          (s) => s.sampleId === sampleId && s.epoch === parseInt(epoch, 10) && s.logFile === selectedLogFile
        );
      }, [displayedSamples, selectedLogFile, sampleId, epoch]);
      const hasPrevious = currentIndex > 0;
      const hasNext = displayedSamples && currentIndex >= 0 && currentIndex < displayedSamples.length - 1;
      const handlePrevious = reactExports.useCallback(() => {
        if (currentIndex > 0 && displayedSamples && samplesPath && logDir2) {
          const prev = displayedSamples[currentIndex - 1];
          const relativePath = directoryRelativeUrl(prev.logFile, logDir2);
          const url = samplesSampleUrl(
            relativePath,
            prev.sampleId,
            prev.epoch,
            tabId
          );
          navigate(url);
        }
      }, [currentIndex, displayedSamples, samplesPath, logDir2, tabId, navigate]);
      const handleNext = reactExports.useCallback(() => {
        if (displayedSamples && currentIndex >= 0 && currentIndex < displayedSamples.length - 1 && samplesPath && logDir2) {
          const next = displayedSamples[currentIndex + 1];
          const relativePath = directoryRelativeUrl(next.logFile, logDir2);
          const url = samplesSampleUrl(
            relativePath,
            next.sampleId,
            next.epoch,
            tabId
          );
          navigate(url);
        }
      }, [currentIndex, displayedSamples, samplesPath, logDir2, tabId, navigate]);
      reactExports.useEffect(() => {
        if (tabId) {
          setSampleTab(tabId);
        }
      }, [tabId, setSampleTab]);
      reactExports.useEffect(() => {
        const exec2 = async () => {
          if (samplesPath && sampleId && epoch) {
            await initLogDir();
            await loadLogs(samplesPath);
            setSelectedLogFile(samplesPath);
            const targetEpoch = parseInt(epoch, 10);
            selectSample(sampleId, targetEpoch);
          }
        };
        exec2();
      }, [
        samplesPath,
        sampleId,
        epoch,
        loadLogs,
        setSelectedLogFile,
        selectSample,
        initLogDir
      ]);
      const setShowFind = useStore((state) => state.appActions.setShowFind);
      const hideFind = useStore((state) => state.appActions.hideFind);
      const nativeFind = useStore((state) => state.app.nativeFind);
      reactExports.useEffect(() => {
        const handleGlobalKeyDown = (e) => {
          const activeElement = document.activeElement;
          const isInputFocused = activeElement && (activeElement.tagName === "INPUT" || activeElement.tagName === "TEXTAREA" || activeElement.tagName === "SELECT");
          if ((e.ctrlKey || e.metaKey) && e.key === "f") {
            if (!nativeFind) {
              e.preventDefault();
              e.stopPropagation();
              if (setShowFind) {
                setShowFind(true);
              }
            }
          } else if (e.key === "Escape") {
            if (!nativeFind) {
              hideFind();
            }
          } else if (!isInputFocused) {
            if (e.key === "ArrowLeft") {
              if (hasPrevious) {
                e.preventDefault();
                handlePrevious();
              }
            } else if (e.key === "ArrowRight") {
              if (hasNext) {
                e.preventDefault();
                handleNext();
              }
            }
          }
        };
        document.addEventListener("keydown", handleGlobalKeyDown, true);
        return () => {
          document.removeEventListener("keydown", handleGlobalKeyDown, true);
        };
      }, [
        setShowFind,
        hideFind,
        hasPrevious,
        hasNext,
        nativeFind,
        handlePrevious,
        handleNext
      ]);
      reactExports.useEffect(() => {
        const exec2 = async () => {
          if (selectedLogFile && summaryId !== void 0 && summaryEpoch !== void 0) {
            await loadSample(
              selectedLogFile,
              summaryId,
              summaryEpoch,
              summaryCompleted
            );
          }
        };
        void exec2();
      }, [loadSample, selectedLogFile, summaryId, summaryEpoch, summaryCompleted]);
      reactExports.useEffect(() => {
        return () => {
          clearSelectedLogDetails();
          clearLog();
          clearSampleTab();
        };
      }, [clearLog, clearSampleTab, clearSelectedLogDetails]);
      return /* @__PURE__ */ jsxRuntimeExports.jsxs(ExtendedFindProvider, { children: [
        showFind ? /* @__PURE__ */ jsxRuntimeExports.jsx(FindBand, {}) : "",
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles.detail, children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            ApplicationNavbar,
            {
              currentPath: samplesPath,
              fnNavigationUrl: samplesUrl,
              bordered: true,
              children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles.sampleNav), children: [
                /* @__PURE__ */ jsxRuntimeExports.jsx(
                  "div",
                  {
                    onClick: handlePrevious,
                    tabIndex: 0,
                    className: clsx(!hasPrevious && styles.disabled, styles.nav),
                    children: /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: clsx(ApplicationIcons.previous) })
                  }
                ),
                /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles.sampleInfo, "text-size-smallest"), children: [
                  "Sample ",
                  sampleId,
                  " (Epoch ",
                  epoch,
                  ")"
                ] }),
                /* @__PURE__ */ jsxRuntimeExports.jsx(
                  "div",
                  {
                    onClick: handleNext,
                    tabIndex: 0,
                    className: clsx(!hasNext && styles.disabled, styles.nav),
                    children: /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: clsx(ApplicationIcons.next) })
                  }
                )
              ] })
            }
          ),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            InlineSampleDisplay,
            {
              showActivity: sampleStatus === "loading",
              className: styles.panel
            }
          )
        ] })
      ] });
    };
    const SamplesRouter = () => {
      const { samplesPath, sampleId, epoch } = useSamplesRouteParams();
      if (samplesPath) {
        const isFlowFile = samplesPath.endsWith(".yaml") || samplesPath.endsWith(".yml");
        if (isFlowFile) {
          return /* @__PURE__ */ jsxRuntimeExports.jsx(FlowPanel, {});
        }
      }
      if (sampleId && epoch) {
        return /* @__PURE__ */ jsxRuntimeExports.jsx(SampleDetailView, {});
      }
      return /* @__PURE__ */ jsxRuntimeExports.jsx(SamplesPanel, {});
    };
    const AppLayout = () => {
      const location2 = useLocation();
      reactExports.useEffect(() => {
        if (storeImplementation) {
          storeImplementation.getState().appActions.setUrlHash(location2.pathname);
        }
      }, [location2]);
      const singleFileMode = useStore((state) => state.app.singleFileMode);
      if (singleFileMode) {
        return /* @__PURE__ */ jsxRuntimeExports.jsx(AppErrorBoundary, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(LogViewContainer, {}) });
      }
      return /* @__PURE__ */ jsxRuntimeExports.jsx(AppErrorBoundary, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Outlet, {}) });
    };
    const AppRouter = createHashRouter(
      [
        {
          path: "/",
          element: /* @__PURE__ */ jsxRuntimeExports.jsx(AppLayout, {}),
          children: [
            {
              index: true,
              // This will match exactly the "/" path
              element: /* @__PURE__ */ jsxRuntimeExports.jsx(LogsPanel, { maybeShowSingleLog: true })
            },
            {
              path: kLogsRoutUrlPattern,
              element: /* @__PURE__ */ jsxRuntimeExports.jsx(LogsPanel, {})
            },
            {
              path: kLogRouteUrlPattern,
              element: /* @__PURE__ */ jsxRuntimeExports.jsx(RouteDispatcher, {})
            },
            {
              path: kSampleRouteUrlPattern,
              element: /* @__PURE__ */ jsxRuntimeExports.jsx(LogViewContainer, {})
            },
            {
              path: kSampleUuidRouteUrlPattern,
              element: /* @__PURE__ */ jsxRuntimeExports.jsx(LogViewContainer, {})
            },
            {
              path: "/samples/*",
              element: /* @__PURE__ */ jsxRuntimeExports.jsx(SamplesRouter, {})
            }
          ]
        },
        {
          path: "*",
          element: /* @__PURE__ */ jsxRuntimeExports.jsx(Navigate, { to: "/", replace: true })
        }
      ],
      { basename: "" }
    );
    const App = ({ api: api2 }) => {
      const rehydrated = useStore((state) => state.app.rehydrated);
      const logDir2 = useStore((state) => state.logs.logDir);
      const selectedLogFile = useStore((state) => state.logs.selectedLogFile);
      const loadedLogFile = useStore((state) => state.log.loadedLog);
      const selectedLogDetails = useStore((state) => state.log.selectedLogDetails);
      const setInitialState = useStore((state) => state.appActions.setInitialState);
      const setLoading = useStore((state) => state.appActions.setLoading);
      const syncLogs = useStore((state) => state.logsActions.syncLogs);
      const setLogDir = useStore((state) => state.logsActions.setLogDir);
      const setLogFiles = useStore((state) => state.logsActions.setLogHandles);
      const setSelectedLogFile = useStore(
        (state) => state.logsActions.setSelectedLogFile
      );
      const loadLog = useStore((state) => state.logActions.syncLog);
      const pollLog = useStore((state) => state.logActions.pollLog);
      const setSingleFileMode = useStore(
        (state) => state.appActions.setSingleFileMode
      );
      reactExports.useEffect(() => {
        const loadSpecificLog = async () => {
          if (!selectedLogFile) {
            return;
          }
          if (selectedLogFile === loadedLogFile && selectedLogDetails) {
            return;
          }
          try {
            setLoading(true);
            await loadLog(selectedLogFile);
            setLoading(false);
          } catch (e) {
            console.log(e);
            setLoading(false, e);
          }
        };
        loadSpecificLog();
      }, [selectedLogFile, loadedLogFile, selectedLogDetails, loadLog, setLoading]);
      reactExports.useEffect(() => {
        const doPoll = async () => {
          await pollLog();
        };
        if (selectedLogDetails?.status === "started") {
          doPoll();
        }
      }, [pollLog, selectedLogDetails?.status]);
      const onMessage = reactExports.useCallback(
        async (e) => {
          switch (e.data.type) {
            case "updateState": {
              if (e.data.url) {
                const decodedUrl = decodeURIComponent(e.data.url);
                let targetFile = decodedUrl;
                if (isUri(targetFile)) {
                  const dir = dirname(targetFile);
                  targetFile = basename(targetFile);
                  setLogDir(dir);
                }
                if (!rehydrated) {
                  setInitialState(
                    targetFile,
                    e.data.sample_id,
                    e.data.sample_epoch
                  );
                }
              }
              break;
            }
            case "backgroundUpdate": {
              const decodedUrl = decodeURIComponent(e.data.url);
              const log_dir = e.data.log_dir;
              const isFocused = document.hasFocus();
              if (!isFocused) {
                if (log_dir === logDir2) {
                  setSelectedLogFile(decodedUrl);
                } else {
                  api2.open_log_file(e.data.url, e.data.log_dir);
                }
              } else {
                syncLogs();
              }
              break;
            }
          }
        },
        [
          setInitialState,
          setLogDir,
          logDir2,
          setSelectedLogFile,
          api2,
          syncLogs,
          rehydrated
        ]
      );
      reactExports.useEffect(() => {
        window.addEventListener("message", onMessage);
        return () => {
          window.removeEventListener("message", onMessage);
        };
      }, [onMessage]);
      reactExports.useEffect(() => {
        const loadLogsAndState = async () => {
          const embeddedState = document.getElementById("logview-state");
          if (embeddedState) {
            const state = lib$d.parse(embeddedState.textContent || "");
            onMessage({ data: state });
            setSingleFileMode(true);
          } else {
            const urlParams = new URLSearchParams(window.location.search);
            const logPath = urlParams.get("task_file");
            const resolvedLogPath = logPath ? logPath.replace(" ", "+") : logPath;
            if (resolvedLogPath) {
              setLogDir(void 0);
              setLogFiles([{ name: resolvedLogPath }]);
              setSingleFileMode(true);
            } else {
              const log_file = urlParams.get("log_file");
              if (log_file) {
                setSelectedLogFile(log_file);
                setSingleFileMode(true);
              }
            }
          }
          new ClipboardJS(".clipboard-button,.copy-button");
        };
        loadLogsAndState();
      }, [
        setLogDir,
        setLogFiles,
        setSelectedLogFile,
        syncLogs,
        onMessage,
        setSingleFileMode
      ]);
      return /* @__PURE__ */ jsxRuntimeExports.jsx(RouterProvider2, { router: AppRouter });
    };
    const resolveStorage = () => {
      const vscodeApi2 = getVscodeApi();
      if (vscodeApi2) {
        return {
          getItem: (_name) => {
            const state = vscodeApi2.getState();
            const deserialized = lib$d.parse(state);
            return deserialized;
          },
          setItem: (_name, value2) => {
            const valObj = value2;
            const serialized = lib$d.stringify(valObj);
            vscodeApi2.setState(serialized);
          },
          removeItem: (_name) => {
            vscodeApi2.setState(null);
          }
        };
      }
      return void 0;
    };
    const storage = resolveStorage();
    const applicationApi = api;
    const applicationStorage = storage;
    const vscode = getVscodeApi();
    let capabilities = {
      downloadFiles: true,
      downloadLogs: !!applicationApi.download_log,
      webWorkers: true,
      streamSamples: !!applicationApi.get_log_pending_samples,
      streamSampleData: !!applicationApi.get_log_sample_data
    };
    if (vscode) {
      const extensionVersionEl = document.querySelector(
        'meta[name="inspect-extension:version"]'
      );
      const extensionVersion = extensionVersionEl ? extensionVersionEl.getAttribute("content") : void 0;
      if (!extensionVersion) {
        capabilities.downloadFiles = false;
        capabilities.webWorkers = false;
      }
    }
    initializeStore(applicationApi, capabilities, applicationStorage);
    restoreHash();
    const containerId = "app";
    const container = document.getElementById(containerId);
    if (!container) {
      console.error("Root container not found");
      throw new Error(
        `Expected a container element with Id '${containerId}' but no such container element was present.`
      );
    }
    const root = clientExports.createRoot(container);
    root.render(/* @__PURE__ */ jsxRuntimeExports.jsx(App, { api: applicationApi }));
    function restoreHash() {
      if (storeImplementation && storeImplementation.getState().app.urlHash) {
        const storedHash = storeImplementation.getState().app.urlHash;
        if (storedHash) {
          if (storedHash.startsWith("/")) {
            window.location.hash = storedHash;
          } else if (storedHash.startsWith("#")) {
            window.location.hash = storedHash;
          } else {
            window.location.hash = "#" + storedHash;
          }
        }
      }
    }
  }
});
export default require_assets();
//# sourceMappingURL=index.js.map
